vue-data-ui 2.6.52-beta.5 → 2.6.52-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Arrow-CCFjwZTr.cjs → Arrow-DaC4Jggt.cjs} +1 -1
- package/dist/{Arrow-B8TY__mr.js → Arrow-Dac3K3h8.js} +1 -1
- package/dist/{BaseIcon-OHZFIigi.js → BaseIcon-By9WO4ls.js} +1 -1
- package/dist/{BaseIcon-wi17eqJD.cjs → BaseIcon-qK9HKOKj.cjs} +1 -1
- package/dist/{ColorPicker-rxGC7zZJ.js → ColorPicker-CRLN58_A.js} +3 -3
- package/dist/{ColorPicker-BYpMaN-k.cjs → ColorPicker-D4DTJqI4.cjs} +1 -1
- package/dist/{DataTable-DEhSbfTA.js → DataTable-0qV0jhOu.js} +2 -2
- package/dist/{DataTable-ulYxsv3G.cjs → DataTable-ON_AwHrY.cjs} +1 -1
- package/dist/{Legend-B4z-JTwx.cjs → Legend-Cz8MqyYC.cjs} +1 -1
- package/dist/{Legend-Gk-NvR9L.js → Legend-D_pcYpOJ.js} +2 -2
- package/dist/{PackageVersion-BQ3Cn3FN.js → PackageVersion-BudVgT3M.js} +1 -1
- package/dist/{PackageVersion-B9tYNMh3.cjs → PackageVersion-C018cxFA.cjs} +1 -1
- package/dist/{PenAndPaper-CA54zihy.js → PenAndPaper-BYiQGyiJ.js} +3 -3
- package/dist/{PenAndPaper-DhCdcCXA.cjs → PenAndPaper-eLbpB2Tr.cjs} +1 -1
- package/dist/{Shape-CDasQsCP.cjs → Shape-COTQ5iv2.cjs} +1 -1
- package/dist/{Shape-DWRJ_Arj.js → Shape-CcYM5MgR.js} +1 -1
- package/dist/{Slicer-D9aqFtZi.cjs → Slicer-DCHrly-q.cjs} +1 -1
- package/dist/{Slicer-B0EiYJb-.js → Slicer-DDKRQlPl.js} +2 -2
- package/dist/{Title-BNqg4yHT.cjs → Title-D9WNuQFw.cjs} +1 -1
- package/dist/{Title-91XTZBtf.js → Title-eLQhK-oq.js} +1 -1
- package/dist/{Tooltip-Bdq54smD.cjs → Tooltip-B3kdH-2d.cjs} +1 -1
- package/dist/{Tooltip-DMLMfsGJ.js → Tooltip-BSVuMX7E.js} +1 -1
- package/dist/dom-to-png-DHexIXWy.cjs +2 -0
- package/dist/dom-to-png-qzX39YwJ.js +147 -0
- package/dist/{img-y9Ect0to.js → img-LQGQYbAP.js} +1 -1
- package/dist/{img-D3wKXQ0X.cjs → img-kapZonyN.cjs} +1 -1
- package/dist/{index-BxtdKYe5.js → index-BdRXF4zl.js} +1 -1
- package/dist/{index-D5fKdu4P.cjs → index-BpnRfvUv.cjs} +1 -1
- package/dist/{pdf-BDhGolfm.js → pdf-CCssh6kD.js} +1 -1
- package/dist/{pdf-DBZi33Yl.cjs → pdf-dfIXjDRu.cjs} +1 -1
- package/dist/{useNestedProp-CnPzAiCM.js → useNestedProp-BdfpF0fL.js} +1 -1
- package/dist/{useNestedProp-BzP-YAbu.cjs → useNestedProp-yHffQRpQ.cjs} +1 -1
- package/dist/{usePrinter-DzQ4aoxR.cjs → usePrinter-BlwwnMSN.cjs} +1 -1
- package/dist/{usePrinter-Oyqm23V8.js → usePrinter-C2JlskbC.js} +3 -3
- package/dist/{vue-data-ui-DuU_k2Fp.cjs → vue-data-ui-7v42K5gt.cjs} +1 -1
- package/dist/{vue-data-ui-DJ8atgeQ.js → vue-data-ui-DskkVLyv.js} +60 -60
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-ykNTOF2m.js → vue-ui-3d-bar-5_2LNSHm.js} +9 -9
- package/dist/{vue-ui-3d-bar-CmQIPPbd.cjs → vue-ui-3d-bar-SlYzaTWe.cjs} +1 -1
- package/dist/{vue-ui-accordion-BssZ9Mi4.cjs → vue-ui-accordion-Dv7_RuxV.cjs} +1 -1
- package/dist/{vue-ui-accordion-CuQpkn0t.js → vue-ui-accordion-MQI7RWbr.js} +3 -3
- package/dist/{vue-ui-age-pyramid-C6Y-Oher.cjs → vue-ui-age-pyramid-DA8ecgTq.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-Cphe-E4p.js → vue-ui-age-pyramid-DGgHWKGr.js} +10 -10
- package/dist/{vue-ui-annotator-x2upb1AK.cjs → vue-ui-annotator-B50RLG4_.cjs} +1 -1
- package/dist/{vue-ui-annotator-BVp8X_7a.js → vue-ui-annotator-Bam-aGzF.js} +2 -2
- package/dist/{vue-ui-bullet-Biu4-ee6.js → vue-ui-bullet-B5uALO6p.js} +8 -8
- package/dist/{vue-ui-bullet-mLayZ1Sd.cjs → vue-ui-bullet-BCCEdISW.cjs} +1 -1
- package/dist/{vue-ui-candlestick-D8iEqK8f.js → vue-ui-candlestick--ZbkDpG_.js} +11 -11
- package/dist/{vue-ui-candlestick-BWhWI3J3.cjs → vue-ui-candlestick-D2MEbWNY.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-CNk7v5IQ.js → vue-ui-carousel-table-BM8buKoR.js} +4 -4
- package/dist/{vue-ui-carousel-table-C8WUNBZs.cjs → vue-ui-carousel-table-CN8NGTlR.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DhTICdKN.js → vue-ui-chestnut-B8QPhKND.js} +8 -8
- package/dist/{vue-ui-chestnut-D2EJHszH.cjs → vue-ui-chestnut-CbDkM7ky.cjs} +1 -1
- package/dist/{vue-ui-circle-pack-BWugCuZh.js → vue-ui-circle-pack-BO-u58zm.js} +9 -9
- package/dist/{vue-ui-circle-pack-Dgwxf-jd.cjs → vue-ui-circle-pack-Dft1dJUa.cjs} +1 -1
- package/dist/{vue-ui-cursor-CAMZYE57.cjs → vue-ui-cursor-BLTxIE3s.cjs} +1 -1
- package/dist/{vue-ui-cursor-DMhyascs.js → vue-ui-cursor-k_iArHJc.js} +2 -2
- package/dist/{vue-ui-dashboard-yjjaT653.cjs → vue-ui-dashboard-DPscKTx9.cjs} +1 -1
- package/dist/{vue-ui-dashboard-JVaZYCF3.js → vue-ui-dashboard-DghtiiV0.js} +3 -3
- package/dist/{vue-ui-digits-B4J1Lk0X.js → vue-ui-digits-C163oPQi.js} +2 -2
- package/dist/{vue-ui-digits-wAr997Ag.cjs → vue-ui-digits-C5MYWO6c.cjs} +1 -1
- package/dist/{vue-ui-donut-CXiQyXRn.cjs → vue-ui-donut-CdTrxJPw.cjs} +1 -1
- package/dist/{vue-ui-donut-vwUDlaKK.js → vue-ui-donut-DGmc_2ql.js} +12 -12
- package/dist/{vue-ui-donut-evolution-CF8qeLbv.cjs → vue-ui-donut-evolution-B_Ryni-e.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution--wdAk63p.js → vue-ui-donut-evolution-CUjSJbxw.js} +11 -11
- package/dist/{vue-ui-dumbbell-my4f8BAM.cjs → vue-ui-dumbbell-DyqVa3uy.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-BWYOAThm.js → vue-ui-dumbbell-WqCILK1Y.js} +10 -10
- package/dist/{vue-ui-flow-Cls5S3ha.cjs → vue-ui-flow-B1FWfGHZ.cjs} +1 -1
- package/dist/{vue-ui-flow-BmVwWcM1.js → vue-ui-flow-qnDJs7TX.js} +9 -9
- package/dist/{vue-ui-funnel-BdRWwxN8.js → vue-ui-funnel-BoetEPIk.js} +9 -9
- package/dist/{vue-ui-funnel-ehfGkf1d.cjs → vue-ui-funnel-CaDqiFzZ.cjs} +1 -1
- package/dist/{vue-ui-galaxy-Cif1VwDV.cjs → vue-ui-galaxy-CxdhenWS.cjs} +1 -1
- package/dist/{vue-ui-galaxy-z2AMuEAZ.js → vue-ui-galaxy-D_8Vd-bt.js} +11 -11
- package/dist/{vue-ui-gauge-D9QOYMez.cjs → vue-ui-gauge-D9Ezw8B7.cjs} +1 -1
- package/dist/{vue-ui-gauge-Z0fgbeHK.js → vue-ui-gauge-DIBzYR9Q.js} +7 -7
- package/dist/{vue-ui-gizmo-CfEVJo1b.cjs → vue-ui-gizmo-Cb4_knsM.cjs} +1 -1
- package/dist/{vue-ui-gizmo-Dtq7IdYi.js → vue-ui-gizmo-_SZ4F9Tq.js} +3 -3
- package/dist/{vue-ui-heatmap-BB1n3ZCa.js → vue-ui-heatmap-BSI3N3xB.js} +10 -10
- package/dist/{vue-ui-heatmap-B1CLU_df.cjs → vue-ui-heatmap-CGkUNTgH.cjs} +1 -1
- package/dist/{vue-ui-history-plot-DrizNoKH.cjs → vue-ui-history-plot-BJa7JIzW.cjs} +1 -1
- package/dist/{vue-ui-history-plot-Dm8h1kdK.js → vue-ui-history-plot-C_alDuC1.js} +11 -11
- package/dist/{vue-ui-kpi-DhdvFpfw.js → vue-ui-kpi-D1MeO3Cd.js} +3 -3
- package/dist/{vue-ui-kpi-DGDCYKmQ.cjs → vue-ui-kpi-Dj65b5iZ.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-B6jMMJBP.cjs → vue-ui-mini-loader-Bl0krmav.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-B5rimMGL.js → vue-ui-mini-loader-C2RuVDXi.js} +2 -2
- package/dist/{vue-ui-molecule-Bl_rnlLf.js → vue-ui-molecule-B8X_ADL9.js} +11 -11
- package/dist/{vue-ui-molecule-BSgKNNRK.cjs → vue-ui-molecule-BbGpmjGK.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-DyympfXO.js → vue-ui-mood-radar-BPi1Td2q.js} +11 -11
- package/dist/{vue-ui-mood-radar-DbeVAsTR.cjs → vue-ui-mood-radar-DjMoBLgA.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-CQl3nJFB.cjs → vue-ui-nested-donuts-DCVonBCM.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-C0P6Vlqr.js → vue-ui-nested-donuts-DErVz3N4.js} +11 -11
- package/dist/{vue-ui-onion-DmiPhWjl.js → vue-ui-onion-BUYmuiEj.js} +11 -11
- package/dist/{vue-ui-onion-BvoZuStT.cjs → vue-ui-onion-NH4sxfSF.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-DdEFQQyQ.js → vue-ui-parallel-coordinate-plot-CVlP5vY8.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-jfNy0UjO.cjs → vue-ui-parallel-coordinate-plot-CY6jzBpv.cjs} +1 -1
- package/dist/{vue-ui-quadrant-C2DMP04c.js → vue-ui-quadrant-R2YsB5-E.js} +12 -12
- package/dist/{vue-ui-quadrant-DPTiwZuy.cjs → vue-ui-quadrant-eR9JtoM3.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-DD8kCaB2.js → vue-ui-quick-chart-BytiWbRR.js} +9 -9
- package/dist/{vue-ui-quick-chart-BcY1CXEU.cjs → vue-ui-quick-chart-DNQH765e.cjs} +1 -1
- package/dist/{vue-ui-radar-CfDcZOnn.js → vue-ui-radar-BiQHcJl8.js} +12 -12
- package/dist/{vue-ui-radar-B25pdHQZ.cjs → vue-ui-radar-DKbD---J.cjs} +1 -1
- package/dist/{vue-ui-rating-traxyYUw.js → vue-ui-rating-BDOS2tMB.js} +2 -2
- package/dist/{vue-ui-rating-CrsLg0J1.cjs → vue-ui-rating-jJJLduA9.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-CnIJtPPN.js → vue-ui-relation-circle-BQXf37dy.js} +7 -7
- package/dist/{vue-ui-relation-circle-pdiic3Fm.cjs → vue-ui-relation-circle-CXpjECVe.cjs} +1 -1
- package/dist/{vue-ui-rings-DOq7oNsM.js → vue-ui-rings-8xTm_fSZ.js} +12 -12
- package/dist/{vue-ui-rings-CikXnOsg.cjs → vue-ui-rings-Dibiz3by.cjs} +1 -1
- package/dist/{vue-ui-scatter-oTX2ZmRw.js → vue-ui-scatter-CVOdgA4o.js} +12 -12
- package/dist/{vue-ui-scatter-DOyOzgsD.cjs → vue-ui-scatter-DRfMPJxM.cjs} +1 -1
- package/dist/{vue-ui-skeleton-BarYY56T.js → vue-ui-skeleton-B0nPRRlJ.js} +3 -3
- package/dist/{vue-ui-skeleton-CpnSZUlg.cjs → vue-ui-skeleton-R-5ZiSXE.cjs} +1 -1
- package/dist/{vue-ui-smiley-CToFy8wS.cjs → vue-ui-smiley-DL4v0xTc.cjs} +1 -1
- package/dist/{vue-ui-smiley-DRSUjVEp.js → vue-ui-smiley-DsfyKykj.js} +2 -2
- package/dist/{vue-ui-spark-trend-Dh7-Qi-2.cjs → vue-ui-spark-trend-CtZueeli.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-pWJIbFo8.js → vue-ui-spark-trend-DeNpHh0b.js} +5 -5
- package/dist/{vue-ui-sparkbar-daJ0HwoJ.cjs → vue-ui-sparkbar-BuyBi1lu.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-BAIq89hg.js → vue-ui-sparkbar-CCMc6e3r.js} +4 -4
- package/dist/{vue-ui-sparkgauge-F_V-PZFj.cjs → vue-ui-sparkgauge-Du2ue49R.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-G2UFRxHT.js → vue-ui-sparkgauge-GeDl1JLP.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-HMYtmBMr.js → vue-ui-sparkhistogram-B_Z5HNKE.js} +5 -5
- package/dist/{vue-ui-sparkhistogram-CEJVlFh7.cjs → vue-ui-sparkhistogram-CWmqcycr.cjs} +1 -1
- package/dist/{vue-ui-sparkline-CEaEJniY.cjs → vue-ui-sparkline-Dmb_5C0G.cjs} +1 -1
- package/dist/{vue-ui-sparkline-EnsuPcgZ.js → vue-ui-sparkline-DuI3UoML.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-DYDt9vsR.cjs → vue-ui-sparkstackbar-C3e6K5v1.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-CAja3JPB.js → vue-ui-sparkstackbar-ntCbTlSM.js} +5 -5
- package/dist/{vue-ui-stackbar-YnSKSnLq.cjs → vue-ui-stackbar-C6KJfccr.cjs} +1 -1
- package/dist/{vue-ui-stackbar-DVoF_W8n.js → vue-ui-stackbar-DUIwcaso.js} +13 -13
- package/dist/{vue-ui-strip-plot-CFhSfYCk.js → vue-ui-strip-plot-C0bfeCNH.js} +11 -11
- package/dist/{vue-ui-strip-plot-BGTrxjms.cjs → vue-ui-strip-plot-DP_PpPtz.cjs} +1 -1
- package/dist/{vue-ui-table-BVIgf3Bs.cjs → vue-ui-table-D2Cwg4FX.cjs} +1 -1
- package/dist/{vue-ui-table-CT-g7R2y.js → vue-ui-table-DaxNA7Ul.js} +1 -1
- package/dist/{vue-ui-table-heatmap-ByT9v-Pw.js → vue-ui-table-heatmap-DvPQdgJS.js} +4 -4
- package/dist/{vue-ui-table-heatmap-VfSLaa5E.cjs → vue-ui-table-heatmap-iysX0iSr.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-DqXwxQRl.js → vue-ui-table-sparkline-0Zpt7gvo.js} +5 -5
- package/dist/{vue-ui-table-sparkline-DhKaCRB8.cjs → vue-ui-table-sparkline-D2d4XFaK.cjs} +1 -1
- package/dist/{vue-ui-thermometer-DeV7tqvG.js → vue-ui-thermometer-0BbHDeMW.js} +7 -7
- package/dist/{vue-ui-thermometer-DD1B_pti.cjs → vue-ui-thermometer-6-ENHra5.cjs} +1 -1
- package/dist/{vue-ui-timer-Bfh_Wfmk.cjs → vue-ui-timer-BVidfYwu.cjs} +1 -1
- package/dist/{vue-ui-timer-C-UkRll5.js → vue-ui-timer-BsuWxldB.js} +5 -5
- package/dist/{vue-ui-tiremarks-BURfGPTa.cjs → vue-ui-tiremarks-C2oBMeBH.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-BLaIMFfO.js → vue-ui-tiremarks-DYkVKOcU.js} +7 -7
- package/dist/{vue-ui-treemap-Bh9T2QGR.js → vue-ui-treemap-B6D40yJF.js} +12 -12
- package/dist/{vue-ui-treemap-BEIZtm1v.cjs → vue-ui-treemap-y0ahQpVZ.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-BDTFAaSi.js → vue-ui-vertical-bar-CacgMbML.js} +12 -12
- package/dist/{vue-ui-vertical-bar-D34jOmBL.cjs → vue-ui-vertical-bar-Cvnk_DfK.cjs} +1 -1
- package/dist/{vue-ui-waffle-YbCXaB8a.cjs → vue-ui-waffle-Lt6Np1DU.cjs} +1 -1
- package/dist/{vue-ui-waffle-D_wFHYjx.js → vue-ui-waffle-bQ9QKWYN.js} +12 -12
- package/dist/{vue-ui-wheel-D5soHQXq.js → vue-ui-wheel-BKkVrcIW.js} +7 -7
- package/dist/{vue-ui-wheel-CP1r3DEg.cjs → vue-ui-wheel-_L5kmjKE.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-BMg0Rxu1.js → vue-ui-word-cloud-BPFArbsP.js} +10 -10
- package/dist/{vue-ui-word-cloud-Xg52fNIm.cjs → vue-ui-word-cloud-THML_zJG.cjs} +1 -1
- package/dist/{vue-ui-xy-DSuTcLVn.cjs → vue-ui-xy-BQnq2Jvu.cjs} +2 -2
- package/dist/{vue-ui-xy-canvas-CVVtbjSN.cjs → vue-ui-xy-canvas-B_KgByGx.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-CmfEj3_k.js → vue-ui-xy-canvas-CLJtE3DK.js} +12 -12
- package/dist/{vue-ui-xy-CfcADzgG.js → vue-ui-xy-mIg7Wumg.js} +16 -16
- package/package.json +1 -1
- package/dist/dom-to-png-B0WsorZy.cjs +0 -2
- package/dist/dom-to-png-DpH-wv1p.js +0 -153
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),u=require("./index-D5fKdu4P.cjs"),p=require("./useResponsive-DQmBAoBf.cjs"),vt=require("./Tooltip-Bdq54smD.cjs"),dt=require("./Legend-B4z-JTwx.cjs"),ht=require("./Title-BNqg4yHT.cjs"),ft=require("./Slicer-D9aqFtZi.cjs"),Ye=require("./usePrinter-DzQ4aoxR.cjs"),yt=require("./vue-ui-accordion-BssZ9Mi4.cjs"),pt=require("./DataTable-ulYxsv3G.cjs"),gt=require("./vue-ui-skeleton-CpnSZUlg.cjs"),He=require("./useNestedProp-BzP-YAbu.cjs"),mt=require("./useUserOptionState-BgepsfED.cjs"),bt=require("./useChartAccessibility-Cm7nkzTG.cjs"),me=require("./BaseIcon-wi17eqJD.cjs"),xt=require("./ColorPicker-BYpMaN-k.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-BpnRfvUv.cjs"),p=require("./useResponsive-DQmBAoBf.cjs"),vt=require("./Tooltip-B3kdH-2d.cjs"),dt=require("./Legend-Cz8MqyYC.cjs"),ht=require("./Title-D9WNuQFw.cjs"),ft=require("./Slicer-DCHrly-q.cjs"),Ye=require("./usePrinter-BlwwnMSN.cjs"),yt=require("./vue-ui-accordion-Dv7_RuxV.cjs"),pt=require("./DataTable-ON_AwHrY.cjs"),gt=require("./vue-ui-skeleton-R-5ZiSXE.cjs"),He=require("./useNestedProp-yHffQRpQ.cjs"),mt=require("./useUserOptionState-BgepsfED.cjs"),bt=require("./useChartAccessibility-Cm7nkzTG.cjs"),me=require("./BaseIcon-qK9HKOKj.cjs"),xt=require("./ColorPicker-D4DTJqI4.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-
|
|
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-BdRXF4zl.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-
|
|
5
|
-
import { L as fl } from "./Legend-
|
|
6
|
-
import { _ as yl } from "./Title-
|
|
7
|
-
import { S as gl } from "./Slicer-
|
|
8
|
-
import { u as pl, U as ml } from "./usePrinter-
|
|
9
|
-
import bl from "./vue-ui-accordion-
|
|
10
|
-
import { D as xl } from "./DataTable-
|
|
11
|
-
import kl from "./vue-ui-skeleton-
|
|
12
|
-
import { u as mt } from "./useNestedProp-
|
|
4
|
+
import { _ as hl } from "./Tooltip-BSVuMX7E.js";
|
|
5
|
+
import { L as fl } from "./Legend-D_pcYpOJ.js";
|
|
6
|
+
import { _ as yl } from "./Title-eLQhK-oq.js";
|
|
7
|
+
import { S as gl } from "./Slicer-DDKRQlPl.js";
|
|
8
|
+
import { u as pl, U as ml } from "./usePrinter-C2JlskbC.js";
|
|
9
|
+
import bl from "./vue-ui-accordion-MQI7RWbr.js";
|
|
10
|
+
import { D as xl } from "./DataTable-0qV0jhOu.js";
|
|
11
|
+
import kl from "./vue-ui-skeleton-B0nPRRlJ.js";
|
|
12
|
+
import { u as mt } from "./useNestedProp-BdfpF0fL.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-
|
|
16
|
-
import { C as wl } from "./ColorPicker-
|
|
15
|
+
import Ye from "./BaseIcon-By9WO4ls.js";
|
|
16
|
+
import { C as wl } from "./ColorPicker-CRLN58_A.js";
|
|
17
17
|
import { _ as kt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
18
18
|
const $l = {
|
|
19
19
|
class: /* @__PURE__ */ fe({
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Q as H, Y as q, a7 as j, c as X, A as $, F as ee, w as te, s as le, o as ae, $ as re, a8 as ie, x as se, C as ne, y as ce, a5 as oe, e as he, r as ue, f as U, a9 as de, S as ge, T as fe, q as Ie, b as me, z as Ne, d as xe, aa as be, v as Fe, ab as _e, a3 as ye, ac as Ae, i as Le, G as Ce, L as Se, u as ke, p as we, B as Oe, a as Ge, t as ve } from "./index-
|
|
2
|
-
import { D as pe } from "./DataTable-
|
|
3
|
-
import { _ as Me } from "./Title-
|
|
4
|
-
import { u as ze, _ as Te } from "./Tooltip-
|
|
5
|
-
import { U as Pe } from "./usePrinter-
|
|
6
|
-
import { _ as Ve } from "./Shape-
|
|
7
|
-
import Re from "./BaseIcon-
|
|
8
|
-
import He from "./vue-ui-table-sparkline-
|
|
9
|
-
import De from "./vue-ui-skeleton-
|
|
10
|
-
import { S as Be } from "./Slicer-
|
|
11
|
-
import Ee from "./vue-ui-accordion-
|
|
12
|
-
import { u as Z } from "./useNestedProp-
|
|
13
|
-
import { _ as Ye } from "./PackageVersion-
|
|
14
|
-
import { P as We } from "./PenAndPaper-
|
|
1
|
+
import { Q as H, Y as q, a7 as j, c as X, A as $, F as ee, w as te, s as le, o as ae, $ as re, a8 as ie, x as se, C as ne, y as ce, a5 as oe, e as he, r as ue, f as U, a9 as de, S as ge, T as fe, q as Ie, b as me, z as Ne, d as xe, aa as be, v as Fe, ab as _e, a3 as ye, ac as Ae, i as Le, G as Ce, L as Se, u as ke, p as we, B as Oe, a as Ge, t as ve } from "./index-BdRXF4zl.js";
|
|
2
|
+
import { D as pe } from "./DataTable-0qV0jhOu.js";
|
|
3
|
+
import { _ as Me } from "./Title-eLQhK-oq.js";
|
|
4
|
+
import { u as ze, _ as Te } from "./Tooltip-BSVuMX7E.js";
|
|
5
|
+
import { U as Pe } from "./usePrinter-C2JlskbC.js";
|
|
6
|
+
import { _ as Ve } from "./Shape-CcYM5MgR.js";
|
|
7
|
+
import Re from "./BaseIcon-By9WO4ls.js";
|
|
8
|
+
import He from "./vue-ui-table-sparkline-0Zpt7gvo.js";
|
|
9
|
+
import De from "./vue-ui-skeleton-B0nPRRlJ.js";
|
|
10
|
+
import { S as Be } from "./Slicer-DDKRQlPl.js";
|
|
11
|
+
import Ee from "./vue-ui-accordion-MQI7RWbr.js";
|
|
12
|
+
import { u as Z } from "./useNestedProp-BdfpF0fL.js";
|
|
13
|
+
import { _ as Ye } from "./PackageVersion-BudVgT3M.js";
|
|
14
|
+
import { P as We } from "./PenAndPaper-BYiQGyiJ.js";
|
|
15
15
|
import { resolveComponent as R, createElementBlock as i, openBlock as r, normalizeStyle as x, normalizeClass as B, createBlock as D, createCommentVNode as u, createVNode as W, createSlots as qe, withCtx as P, renderSlot as S, normalizeProps as E, guardReactiveProps as Y, createElementVNode as f, createTextVNode as J, Fragment as d, renderList as I, toDisplayString as T, mergeProps as Q, withDirectives as Xe, vModelCheckbox as Ue } from "vue";
|
|
16
16
|
import { _ as Ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
17
17
|
const Je = X(), Qe = {
|
|
@@ -1103,7 +1103,7 @@ const Je = X(), Qe = {
|
|
|
1103
1103
|
async generatePdf() {
|
|
1104
1104
|
this.showSpinnerPdf(), clearTimeout(this.__to__), this.isPrinting = !0, this.__to__ = setTimeout(async () => {
|
|
1105
1105
|
try {
|
|
1106
|
-
const { default: t } = await import("./pdf-
|
|
1106
|
+
const { default: t } = await import("./pdf-CCssh6kD.js");
|
|
1107
1107
|
await t({
|
|
1108
1108
|
domElement: document.getElementById(`vue-ui-xy_${this.uniqueId}`),
|
|
1109
1109
|
fileName: this.FINAL_CONFIG.chart.title.text || "vue-ui-xy",
|
|
@@ -1126,7 +1126,7 @@ const Je = X(), Qe = {
|
|
|
1126
1126
|
async generateImage() {
|
|
1127
1127
|
this.showSpinnerImage(), clearTimeout(this.__to__), this.isImaging = !0, this.__to__ = setTimeout(async () => {
|
|
1128
1128
|
try {
|
|
1129
|
-
const { default: t } = await import("./img-
|
|
1129
|
+
const { default: t } = await import("./img-LQGQYbAP.js");
|
|
1130
1130
|
await t({
|
|
1131
1131
|
domElement: document.getElementById(`vue-ui-xy_${this.uniqueId}`),
|
|
1132
1132
|
fileName: this.FINAL_CONFIG.chart.title.text || "vue-ui-xy",
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const v=require("./index-D5fKdu4P.cjs");async function L(e){const o=e.querySelectorAll("img"),n=[];o.forEach(t=>{t.src&&!t.src.startsWith("data:")&&n.push(new Promise(s=>{const l=new window.Image;l.crossOrigin="anonymous",l.onload=function(){try{const r=document.createElement("canvas");r.width=l.naturalWidth,r.height=l.naturalHeight,r.getContext("2d").drawImage(l,0,0),t.src=r.toDataURL()}catch{}s()},l.onerror=function(){s()},l.src=t.src}))}),await Promise.all(n)}function M(e){e.querySelectorAll("[data-dom-to-png-ignore]").forEach(n=>{n.parentNode&&n.parentNode.removeChild(n)})}function C(e,o,n){const t=window.getComputedStyle(o);let s={},l=e.getAttribute("style");typeof l!="string"&&(l=""),l.split(";").forEach(i=>{if(typeof i=="string"&&i.trim()){const[c,p]=i.split(":");c&&p!==void 0&&(s[c.trim()]=p.trim())}});for(let i=0;i<t.length;i+=1){const c=t[i],p=t.getPropertyValue(c);s[c]=p}s.overflow="visible",s["overflow-x"]="visible",s["overflow-y"]="visible";const r=o.getBoundingClientRect();(t.display.includes("flex")||o.parentElement&&window.getComputedStyle(o.parentElement).display.includes("flex")||t.position==="absolute"||t.position==="fixed")&&(r.width>0&&(s.width=r.width+"px"),r.height>0&&(s.height=r.height+"px")),n&&(s["font-family"]=n),["min-width","max-width","min-height","max-height"].forEach(i=>{const c=t.getPropertyValue(i);c&&c!=="none"&&c!=="auto"&&(s[i]=c)});let f="";for(const i in s)f+=`${i}:${s[i]};`;e.setAttribute("style",f);const a=e.children||[],g=o.children||[];for(let i=0;i<a.length;i++)a[i].nodeType===1&&g[i]&&C(a[i],g[i],n)}function F(e,o){e.querySelectorAll("text").forEach(t=>{t.setAttribute("font-family",o),t.style.fontFamily=o})}function N(e){const o=new TextEncoder().encode(e);let n="";return o.forEach(t=>n+=String.fromCharCode(t)),btoa(n)}function T(e,o,n){let s=new XMLSerializer().serializeToString(e);s.match(/^<svg[^>]+xmlns="http\:\/\/www\.w3\.org\/2000\/svg"/)||(s=s.replace(/^<svg/,'<svg xmlns="http://www.w3.org/2000/svg"'));const l=window.btoa(unescape(encodeURIComponent(s))),r=new window.Image;return r.src=`data:image/svg+xml;base64,${l}`,new Promise((w,f)=>{r.onload=function(){const a=document.createElement("canvas");a.width=o,a.height=n,a.getContext("2d").drawImage(r,0,0,o,n),w(a.toDataURL("image/png",1))},r.onerror=a=>f(a)})}function b(e){if(e.nodeType!==1)return;const o=window.getComputedStyle(e);let n="";for(let t=0;t<o.length;t++){const s=o[t];n+=`${s}:${o.getPropertyValue(s)};`}e.setAttribute("style",n);for(let t=0;t<e.children.length;t++)b(e.children[t])}function $(){const e=[];for(const o of document.styleSheets)try{const n=o.cssRules;if(!n)continue;for(const t of n)(t.constructor.name==="CSSFontFaceRule"||t.cssText.startsWith("@font-face"))&&e.push(t.cssText)}catch{continue}return e}function q(e){const o=$();if(!o.length)return;const n=document.createElement("style");n.setAttribute("type","text/css"),n.textContent=o.join(`
|
|
2
|
-
`);const t=e.querySelector("defs")||document.createElementNS(v.XMLNS,"defs");t.appendChild(n),e.querySelector("defs")||e.insertBefore(t,e.firstChild)}async function I({container:e,scale:o=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),s=t.querySelectorAll("canvas"),l=e.querySelectorAll("canvas");for(let u=0;u<l.length;u+=1){const d=l[u],h=s[u];if(d&&h){const m=document.createElement("img");m.src=d.toDataURL("image/png"),m.width=d.width,m.height=d.height,m.style.width=d.style.width||d.width+"px",m.style.height=d.style.height||d.height+"px",h.replaceWith(m)}}const r=e.querySelector("svg[aria-label]");if(r){const u=r.getBoundingClientRect(),d=u.width,h=u.height;b(r),F(r,n);const m=Math.round(d*o),E=Math.round(h*o),R=await T(r,m,E),S=t.querySelector("svg[aria-label]");if(S){const y=document.createElement("img");y.src=R,y.width=d,y.height=h,y.style.width=d+"px",y.style.height=h+"px",S.parentNode.replaceChild(y,S)}}C(t,e,n),M(t),await L(t);const{width:w,height:f}=e.getBoundingClientRect(),a=Math.round(Math.max(t.scrollWidth,w)*o),g=Math.round(Math.max(t.scrollHeight,f)*1.01*o),i=document.createElementNS(v.XMLNS,"svg");i.setAttribute("viewBox",`0 0 ${a} ${g}`),i.setAttribute("width",a),i.setAttribute("height",g),i.setAttribute("style",`font-family:${n};`);const c=document.createElementNS(v.XMLNS,"foreignObject");c.setAttribute("x",0),c.setAttribute("y",0),c.setAttribute("width",a),c.setAttribute("height",g),c.setAttribute("style",`font-family:${n};`),t.style.transform=`scale(${o})`,t.style.transformOrigin="top left",t.style.width=w+"px",t.style.height=f+"px",t.style.background=window.getComputedStyle(e).backgroundColor,c.appendChild(t),q(i),i.appendChild(c);const p=new XMLSerializer().serializeToString(i),A=N(p),x=new window.Image;return x.crossOrigin="anonymous",x.src=`data:image/svg+xml;base64,${A}`,new Promise((u,d)=>{x.onload=function(){try{const h=document.createElement("canvas");h.width=a,h.height=g,h.getContext("2d").drawImage(x,0,0,a,g),u(h.toDataURL("image/png",1))}catch(h){d("Failed to draw SVG on canvas: "+h)}},x.onerror=function(){d("Failed to load SVG image for conversion")}})}exports.domToPng=I;
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { X as S } from "./index-BxtdKYe5.js";
|
|
2
|
-
async function F(e) {
|
|
3
|
-
const o = e.querySelectorAll("img"), n = [];
|
|
4
|
-
o.forEach((t) => {
|
|
5
|
-
t.src && !t.src.startsWith("data:") && n.push(
|
|
6
|
-
new Promise((s) => {
|
|
7
|
-
const c = new window.Image();
|
|
8
|
-
c.crossOrigin = "anonymous", c.onload = function() {
|
|
9
|
-
try {
|
|
10
|
-
const r = document.createElement("canvas");
|
|
11
|
-
r.width = c.naturalWidth, r.height = c.naturalHeight, r.getContext("2d").drawImage(c, 0, 0), t.src = r.toDataURL();
|
|
12
|
-
} catch {
|
|
13
|
-
}
|
|
14
|
-
s();
|
|
15
|
-
}, c.onerror = function() {
|
|
16
|
-
s();
|
|
17
|
-
}, c.src = t.src;
|
|
18
|
-
})
|
|
19
|
-
);
|
|
20
|
-
}), await Promise.all(n);
|
|
21
|
-
}
|
|
22
|
-
function $(e) {
|
|
23
|
-
e.querySelectorAll("[data-dom-to-png-ignore]").forEach((n) => {
|
|
24
|
-
n.parentNode && n.parentNode.removeChild(n);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
function C(e, o, n) {
|
|
28
|
-
const t = window.getComputedStyle(o);
|
|
29
|
-
let s = {}, c = e.getAttribute("style");
|
|
30
|
-
typeof c != "string" && (c = ""), c.split(";").forEach((i) => {
|
|
31
|
-
if (typeof i == "string" && i.trim()) {
|
|
32
|
-
const [a, p] = i.split(":");
|
|
33
|
-
a && p !== void 0 && (s[a.trim()] = p.trim());
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
for (let i = 0; i < t.length; i += 1) {
|
|
37
|
-
const a = t[i], p = t.getPropertyValue(a);
|
|
38
|
-
s[a] = p;
|
|
39
|
-
}
|
|
40
|
-
s.overflow = "visible", s["overflow-x"] = "visible", s["overflow-y"] = "visible";
|
|
41
|
-
const r = o.getBoundingClientRect();
|
|
42
|
-
(t.display.includes("flex") || o.parentElement && window.getComputedStyle(o.parentElement).display.includes("flex") || t.position === "absolute" || t.position === "fixed") && (r.width > 0 && (s.width = r.width + "px"), r.height > 0 && (s.height = r.height + "px")), n && (s["font-family"] = n), ["min-width", "max-width", "min-height", "max-height"].forEach((i) => {
|
|
43
|
-
const a = t.getPropertyValue(i);
|
|
44
|
-
a && a !== "none" && a !== "auto" && (s[i] = a);
|
|
45
|
-
});
|
|
46
|
-
let f = "";
|
|
47
|
-
for (const i in s)
|
|
48
|
-
f += `${i}:${s[i]};`;
|
|
49
|
-
e.setAttribute("style", f);
|
|
50
|
-
const l = e.children || [], g = o.children || [];
|
|
51
|
-
for (let i = 0; i < l.length; i++)
|
|
52
|
-
l[i].nodeType === 1 && g[i] && C(l[i], g[i], n);
|
|
53
|
-
}
|
|
54
|
-
function I(e, o) {
|
|
55
|
-
e.querySelectorAll("text").forEach((t) => {
|
|
56
|
-
t.setAttribute("font-family", o), t.style.fontFamily = o;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
function L(e) {
|
|
60
|
-
const o = new TextEncoder().encode(e);
|
|
61
|
-
let n = "";
|
|
62
|
-
return o.forEach((t) => n += String.fromCharCode(t)), btoa(n);
|
|
63
|
-
}
|
|
64
|
-
function M(e, o, n) {
|
|
65
|
-
let s = new XMLSerializer().serializeToString(e);
|
|
66
|
-
s.match(/^<svg[^>]+xmlns="http\:\/\/www\.w3\.org\/2000\/svg"/) || (s = s.replace(/^<svg/, '<svg xmlns="http://www.w3.org/2000/svg"'));
|
|
67
|
-
const c = window.btoa(unescape(encodeURIComponent(s))), r = new window.Image();
|
|
68
|
-
return r.src = `data:image/svg+xml;base64,${c}`, new Promise((w, f) => {
|
|
69
|
-
r.onload = function() {
|
|
70
|
-
const l = document.createElement("canvas");
|
|
71
|
-
l.width = o, l.height = n, l.getContext("2d").drawImage(r, 0, 0, o, n), w(l.toDataURL("image/png", 1));
|
|
72
|
-
}, r.onerror = (l) => f(l);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
function b(e) {
|
|
76
|
-
if (e.nodeType !== 1) return;
|
|
77
|
-
const o = window.getComputedStyle(e);
|
|
78
|
-
let n = "";
|
|
79
|
-
for (let t = 0; t < o.length; t++) {
|
|
80
|
-
const s = o[t];
|
|
81
|
-
n += `${s}:${o.getPropertyValue(s)};`;
|
|
82
|
-
}
|
|
83
|
-
e.setAttribute("style", n);
|
|
84
|
-
for (let t = 0; t < e.children.length; t++)
|
|
85
|
-
b(e.children[t]);
|
|
86
|
-
}
|
|
87
|
-
function T() {
|
|
88
|
-
const e = [];
|
|
89
|
-
for (const o of document.styleSheets)
|
|
90
|
-
try {
|
|
91
|
-
const n = o.cssRules;
|
|
92
|
-
if (!n) continue;
|
|
93
|
-
for (const t of n)
|
|
94
|
-
(t.constructor.name === "CSSFontFaceRule" || t.cssText.startsWith("@font-face")) && e.push(t.cssText);
|
|
95
|
-
} catch {
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
return e;
|
|
99
|
-
}
|
|
100
|
-
function q(e) {
|
|
101
|
-
const o = T();
|
|
102
|
-
if (!o.length) return;
|
|
103
|
-
const n = document.createElement("style");
|
|
104
|
-
n.setAttribute("type", "text/css"), n.textContent = o.join(`
|
|
105
|
-
`);
|
|
106
|
-
const t = e.querySelector("defs") || document.createElementNS(S, "defs");
|
|
107
|
-
t.appendChild(n), e.querySelector("defs") || e.insertBefore(t, e.firstChild);
|
|
108
|
-
}
|
|
109
|
-
async function P({ container: e, scale: o = 2 }) {
|
|
110
|
-
if (!e) throw new Error("No container provided");
|
|
111
|
-
await document.fonts.ready;
|
|
112
|
-
let n = window.getComputedStyle(e).fontFamily || "Helvetica";
|
|
113
|
-
n.toLowerCase().includes("helvetica") || (n += ", Helvetica");
|
|
114
|
-
const t = e.cloneNode(!0), s = t.querySelectorAll("canvas"), c = e.querySelectorAll("canvas");
|
|
115
|
-
for (let u = 0; u < c.length; u += 1) {
|
|
116
|
-
const d = c[u], h = s[u];
|
|
117
|
-
if (d && h) {
|
|
118
|
-
const m = document.createElement("img");
|
|
119
|
-
m.src = d.toDataURL("image/png"), m.width = d.width, m.height = d.height, m.style.width = d.style.width || d.width + "px", m.style.height = d.style.height || d.height + "px", h.replaceWith(m);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
const r = e.querySelector("svg[aria-label]");
|
|
123
|
-
if (r) {
|
|
124
|
-
const u = r.getBoundingClientRect(), d = u.width, h = u.height;
|
|
125
|
-
b(r), I(r, n);
|
|
126
|
-
const m = Math.round(d * o), E = Math.round(h * o), R = await M(r, m, E), v = t.querySelector("svg[aria-label]");
|
|
127
|
-
if (v) {
|
|
128
|
-
const y = document.createElement("img");
|
|
129
|
-
y.src = R, y.width = d, y.height = h, y.style.width = d + "px", y.style.height = h + "px", v.parentNode.replaceChild(y, v);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
C(t, e, n), $(t), await F(t);
|
|
133
|
-
const { width: w, height: f } = e.getBoundingClientRect(), l = Math.round(Math.max(t.scrollWidth, w) * o), g = Math.round(Math.max(t.scrollHeight, f) * 1.01 * o), i = document.createElementNS(S, "svg");
|
|
134
|
-
i.setAttribute("viewBox", `0 0 ${l} ${g}`), i.setAttribute("width", l), i.setAttribute("height", g), i.setAttribute("style", `font-family:${n};`);
|
|
135
|
-
const a = document.createElementNS(S, "foreignObject");
|
|
136
|
-
a.setAttribute("x", 0), a.setAttribute("y", 0), a.setAttribute("width", l), a.setAttribute("height", g), a.setAttribute("style", `font-family:${n};`), t.style.transform = `scale(${o})`, t.style.transformOrigin = "top left", t.style.width = w + "px", t.style.height = f + "px", t.style.background = window.getComputedStyle(e).backgroundColor, a.appendChild(t), q(i), i.appendChild(a);
|
|
137
|
-
const p = new XMLSerializer().serializeToString(i), A = L(p), x = new window.Image();
|
|
138
|
-
return x.crossOrigin = "anonymous", x.src = `data:image/svg+xml;base64,${A}`, new Promise((u, d) => {
|
|
139
|
-
x.onload = function() {
|
|
140
|
-
try {
|
|
141
|
-
const h = document.createElement("canvas");
|
|
142
|
-
h.width = l, h.height = g, h.getContext("2d").drawImage(x, 0, 0, l, g), u(h.toDataURL("image/png", 1));
|
|
143
|
-
} catch (h) {
|
|
144
|
-
d("Failed to draw SVG on canvas: " + h);
|
|
145
|
-
}
|
|
146
|
-
}, x.onerror = function() {
|
|
147
|
-
d("Failed to load SVG image for conversion");
|
|
148
|
-
};
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
export {
|
|
152
|
-
P as d
|
|
153
|
-
};
|