vue-data-ui 2.12.8-beta.3 → 2.13.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.
- package/README.md +10 -4
- package/dist/{Arrow-kQyQXUUg.js → Arrow-B2y3GYgv.js} +1 -1
- package/dist/{BaseDraggableDialog-DLRFrsDT.js → BaseDraggableDialog-B3CZVeze.js} +2 -2
- package/dist/{BaseIcon-DaR0sIWZ.js → BaseIcon-P7wV92Er.js} +1 -1
- package/dist/{ColorPicker-Bj3sq9o7.js → ColorPicker-C7b6TR_9.js} +2 -2
- package/dist/{DataTable-BBqbcutV.js → DataTable-DBkfb6pd.js} +2 -2
- package/dist/{Legend-DRqzYrP9.js → Legend-DcDRW3Xd.js} +2 -2
- package/dist/{NonSvgPenAndPaper-CQIC2PMP.js → NonSvgPenAndPaper-DYA_rF1x.js} +3 -3
- package/dist/{PackageVersion-ClpqQxYT.js → PackageVersion-C5fpg4GN.js} +2 -2
- package/dist/{PenAndPaper-B-T7XvxF.js → PenAndPaper-BRkuVFb4.js} +3 -3
- package/dist/{Shape-DEWxbZ-l.js → Shape-CnD-h_98.js} +1 -1
- package/dist/{Slicer-o6jJH5bw.js → Slicer-CxdgZOQ7.js} +2 -2
- package/dist/{SparkTooltip-LPnbBoFu.js → SparkTooltip-BIAMOmfJ.js} +1 -1
- package/dist/{Title-apr_T9tg.js → Title-DoWqzga-.js} +1 -1
- package/dist/{Tooltip-BuHsMAfp.js → Tooltip-DYCBNM-_.js} +1 -1
- package/dist/{UserOptions-OVNxxnq5.js → UserOptions-B3q-xfQV.js} +16 -11
- package/dist/dom-to-png-4VVH9Qna.js +247 -0
- package/dist/img-Dy6IrSzX.js +20 -0
- package/dist/{index-CH_mJIWj.js → index-BXbyT0Qn.js} +6 -2
- package/dist/{pdf-Jun3ogRn.js → pdf-ZrUvUcH9.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +20 -3
- package/dist/types/vue-data-ui.d.ts +20 -3
- package/dist/{useNestedProp-rMR-JeOJ.js → useNestedProp-DVZpeH84.js} +1 -1
- package/dist/{usePrinter-DJ7WfWUs.js → usePrinter-aKh5-HcK.js} +2 -2
- package/dist/{vue-data-ui-D7AaTKU6.js → vue-data-ui-DUHiuRmY.js} +63 -63
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-BfLLrwWi.js → vue-ui-3d-bar-C3cqHCNp.js} +173 -173
- package/dist/{vue-ui-accordion-Ds4zkPIx.js → vue-ui-accordion-CXsjHe1y.js} +3 -3
- package/dist/{vue-ui-age-pyramid-C7ca5TG5.js → vue-ui-age-pyramid-B2EpIzV9.js} +179 -179
- package/dist/{vue-ui-annotator-DG2z1gw8.js → vue-ui-annotator-Czvbjx_j.js} +2 -2
- package/dist/{vue-ui-bullet-Dh25QAEH.js → vue-ui-bullet-ClY1tgTT.js} +6 -6
- package/dist/{vue-ui-candlestick-7Yo_kEV0.js → vue-ui-candlestick-BQ1RVdoH.js} +113 -113
- package/dist/{vue-ui-carousel-table-Det9Kwmy.js → vue-ui-carousel-table-UQjCOJJV.js} +94 -94
- package/dist/{vue-ui-chestnut-DLlFv6Uj.js → vue-ui-chestnut-DmEa8kef.js} +452 -452
- package/dist/{vue-ui-chord-BXlv5Z2x.js → vue-ui-chord-CEDZ-UcP.js} +17 -17
- package/dist/{vue-ui-circle-pack-DdRcdWmx.js → vue-ui-circle-pack-Bx_mLhCR.js} +116 -116
- package/dist/{vue-ui-cursor-Djtg6Ppw.js → vue-ui-cursor-D27qwk90.js} +2 -2
- package/dist/{vue-ui-dashboard-C4MDDCl6.js → vue-ui-dashboard-DKsYxh6J.js} +62 -62
- package/dist/{vue-ui-digits-8Ox6q1Ov.js → vue-ui-digits-CdDTbIAN.js} +2 -2
- package/dist/{vue-ui-donut-Hk4EaVhb.js → vue-ui-donut-DS-DfHIm.js} +149 -149
- package/dist/{vue-ui-donut-evolution-DzgYokPU.js → vue-ui-donut-evolution-XMEmv1DK.js} +109 -109
- package/dist/{vue-ui-dumbbell-CAC44_Hu.js → vue-ui-dumbbell-DAm5A4u3.js} +65 -65
- package/dist/{vue-ui-flow-CYWiZjrP.js → vue-ui-flow-CTbmqqmV.js} +12 -12
- package/dist/{vue-ui-funnel-C2eqxh_8.js → vue-ui-funnel-CihunDsZ.js} +65 -65
- package/dist/{vue-ui-galaxy-BBfg84E4.js → vue-ui-galaxy-CJHycmpt.js} +82 -82
- package/dist/{vue-ui-gauge-BJgJgef_.js → vue-ui-gauge-Bsc9wIKK.js} +5 -5
- package/dist/{vue-ui-gizmo-DBclpybR.js → vue-ui-gizmo-D6AciZZe.js} +3 -3
- package/dist/{vue-ui-heatmap-D65wOgqe.js → vue-ui-heatmap-in5WwNRr.js} +221 -221
- package/dist/{vue-ui-history-plot-CHhDy7Da.js → vue-ui-history-plot-C9IEmAmm.js} +232 -232
- package/dist/{vue-ui-kpi-uT6fsAaO.js → vue-ui-kpi-fDPWRpRZ.js} +3 -3
- package/dist/{vue-ui-mini-loader-CKVlBiYB.js → vue-ui-mini-loader-BeJRaP7N.js} +2 -2
- package/dist/{vue-ui-molecule-BwtHZtGN.js → vue-ui-molecule-BJbwA0F6.js} +30 -30
- package/dist/{vue-ui-mood-radar-Vf4_-R-m.js → vue-ui-mood-radar--YEOJ6q6.js} +75 -75
- package/dist/{vue-ui-nested-donuts-BVkSns4S.js → vue-ui-nested-donuts-BswKH0D6.js} +16 -16
- package/dist/{vue-ui-onion-UzMmwtvF.js → vue-ui-onion-BAw8X4iu.js} +70 -70
- package/dist/{vue-ui-parallel-coordinate-plot-Dk5T3ZAr.js → vue-ui-parallel-coordinate-plot-CYkzOe_Q.js} +11 -11
- package/dist/{vue-ui-quadrant-Ck7xALez.js → vue-ui-quadrant-BupqUnMn.js} +11 -11
- package/dist/{vue-ui-quick-chart-B62Pa0nG.js → vue-ui-quick-chart-BzpDL6CR.js} +5 -5
- package/dist/{vue-ui-radar-DMfv2hSb.js → vue-ui-radar-zPrbIZv5.js} +283 -282
- package/dist/{vue-ui-rating-CFYHJrxj.js → vue-ui-rating-DqCOz2LB.js} +2 -2
- package/dist/{vue-ui-relation-circle-RWlfC5BI.js → vue-ui-relation-circle-DQp_zboM.js} +5 -5
- package/dist/{vue-ui-ridgeline-Bh93VzcO.js → vue-ui-ridgeline-DoJfX7Ii.js} +100 -100
- package/dist/{vue-ui-rings-CyX30Ccv.js → vue-ui-rings-Bk4QJYsW.js} +96 -96
- package/dist/{vue-ui-scatter-BEDnWByj.js → vue-ui-scatter-RxF0N8Zj.js} +164 -164
- package/dist/{vue-ui-skeleton-C6PWt_m5.js → vue-ui-skeleton-Fxr752Oi.js} +3 -3
- package/dist/{vue-ui-smiley-79itAe84.js → vue-ui-smiley-CNScIHKI.js} +2 -2
- package/dist/{vue-ui-spark-trend-AaA4KuaH.js → vue-ui-spark-trend-CyMzdoJ9.js} +3 -3
- package/dist/{vue-ui-sparkbar-CYBZeaor.js → vue-ui-sparkbar-DMTRPWwC.js} +3 -3
- package/dist/{vue-ui-sparkgauge-ElGarXVS.js → vue-ui-sparkgauge-itAGdTj_.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-C_LV99i1.js → vue-ui-sparkhistogram-CZx5cF_r.js} +4 -4
- package/dist/{vue-ui-sparkline-DwzCA8d6.js → vue-ui-sparkline-POYMl6cO.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-CobB11uw.js → vue-ui-sparkstackbar-C0EE8xrA.js} +3 -3
- package/dist/{vue-ui-stackbar-B4SxM5Ix.js → vue-ui-stackbar-B6ytrTFL.js} +37 -37
- package/dist/{vue-ui-strip-plot-9VK_Y3SC.js → vue-ui-strip-plot-u39z36tT.js} +80 -80
- package/dist/{vue-ui-table-DFTE1OH5.js → vue-ui-table-Cvmrm0sZ.js} +3 -3
- package/dist/{vue-ui-table-heatmap-DvyJx0j7.js → vue-ui-table-heatmap-BOFRFilm.js} +57 -57
- package/dist/{vue-ui-table-sparkline-SGsBnQTK.js → vue-ui-table-sparkline-CMhk8rpj.js} +72 -72
- package/dist/{vue-ui-thermometer-DEMS6HXl.js → vue-ui-thermometer-Cxznchnu.js} +5 -5
- package/dist/{vue-ui-timer-CQ71yJ_N.js → vue-ui-timer-Du0Cskiy.js} +5 -5
- package/dist/{vue-ui-tiremarks-CsN_QtUK.js → vue-ui-tiremarks-BzC40iBw.js} +5 -5
- package/dist/{vue-ui-treemap-B0CPNusH.js → vue-ui-treemap-D5Nk7usb.js} +297 -297
- package/dist/{vue-ui-vertical-bar-Cxv-ahMT.js → vue-ui-vertical-bar-BivMp4WH.js} +81 -81
- package/dist/{vue-ui-waffle-TgNNo9UX.js → vue-ui-waffle-DI0Ul1Tb.js} +50 -50
- package/dist/{vue-ui-wheel-Bq0ZLc-R.js → vue-ui-wheel-BfHsxhQq.js} +5 -5
- package/dist/{vue-ui-word-cloud-D28awCaT.js → vue-ui-word-cloud-ytYbdQKa.js} +67 -67
- package/dist/{vue-ui-world-BhUsfhY5.js → vue-ui-world-CiYvMEKb.js} +55 -55
- package/dist/{vue-ui-xy-CEFkua9H.js → vue-ui-xy-DxgCkZEV.js} +201 -182
- package/dist/{vue-ui-xy-canvas-oHhzL0ui.js → vue-ui-xy-canvas-R0tICTKy.js} +80 -80
- package/package.json +1 -1
- package/dist/dom-to-png-C0Ct8ClX.js +0 -243
- package/dist/img-P0SFFw37.js +0 -19
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
import { X as x } from "./index-CH_mJIWj.js";
|
|
2
|
-
async function A(n) {
|
|
3
|
-
const i = n.querySelectorAll("img"), o = Array.from(i).map((t) => new Promise((s) => {
|
|
4
|
-
if (!t.src || t.src.startsWith("data:")) return s();
|
|
5
|
-
if (t.complete && t.naturalWidth !== 0) {
|
|
6
|
-
try {
|
|
7
|
-
const e = document.createElement("canvas");
|
|
8
|
-
e.width = t.naturalWidth, e.height = t.naturalHeight, e.getContext("2d").drawImage(t, 0, 0), t.src = e.toDataURL();
|
|
9
|
-
} catch {
|
|
10
|
-
}
|
|
11
|
-
return s();
|
|
12
|
-
}
|
|
13
|
-
const a = new window.Image();
|
|
14
|
-
a.crossOrigin = "anonymous", a.onload = function() {
|
|
15
|
-
try {
|
|
16
|
-
const e = document.createElement("canvas");
|
|
17
|
-
e.width = a.naturalWidth, e.height = a.naturalHeight, e.getContext("2d").drawImage(a, 0, 0), t.src = e.toDataURL();
|
|
18
|
-
} catch {
|
|
19
|
-
}
|
|
20
|
-
s();
|
|
21
|
-
}, a.onerror = function() {
|
|
22
|
-
s();
|
|
23
|
-
}, a.src = t.src;
|
|
24
|
-
}));
|
|
25
|
-
await Promise.all(o);
|
|
26
|
-
}
|
|
27
|
-
function T(n) {
|
|
28
|
-
n.querySelectorAll("[data-dom-to-png-ignore]").forEach((o) => {
|
|
29
|
-
o.remove();
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function v(n, i, o) {
|
|
33
|
-
const t = window.getComputedStyle(i), s = i.getBoundingClientRect(), a = t.display.includes("flex");
|
|
34
|
-
let e = {}, c = n.getAttribute("style");
|
|
35
|
-
typeof c != "string" && (c = ""), c.split(";").forEach((r) => {
|
|
36
|
-
if (typeof r == "string" && r.trim()) {
|
|
37
|
-
const [d, m] = r.split(":");
|
|
38
|
-
d && m !== void 0 && (e[d.trim()] = m.trim());
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
for (let r = 0; r < t.length; r += 1) {
|
|
42
|
-
const d = t[r], m = t.getPropertyValue(d);
|
|
43
|
-
e[d] = m;
|
|
44
|
-
}
|
|
45
|
-
e.color = t.color, e["background-color"] = t.backgroundColor;
|
|
46
|
-
let l = t.fontFamily || o || "";
|
|
47
|
-
(!l || l.trim() === "" || l === "inherit" || l === "initial" || l.toLowerCase().startsWith("system-ui") || l.toLowerCase() === "sans-serif" || l.toLowerCase() === "serif" || l.toLowerCase() === "monospace") && (l = "Helvetica, Arial, sans-serif"), e["font-family"] = l, e["font-size"] = t.fontSize, e["font-weight"] = t.fontWeight, (a || t.display.includes("grid") || ["inline-block", "absolute", "fixed"].includes(t.position)) && (s.width > 0 && (e.width = s.width + "px"), s.height > 0 && (e.height = s.height + "px")), a && t.flexWrap === "nowrap" && (e["white-space"] = "nowrap"), ["box-sizing", "padding", "margin", "border"].forEach((r) => {
|
|
48
|
-
e[r] = t.getPropertyValue(r);
|
|
49
|
-
}), e.overflow = "visible", e["overflow-x"] = "visible", e["overflow-y"] = "visible";
|
|
50
|
-
let u = "";
|
|
51
|
-
for (const r in e)
|
|
52
|
-
u += `${r}:${e[r]};`;
|
|
53
|
-
n.setAttribute("style", u);
|
|
54
|
-
const g = n.children || [], y = i.children || [];
|
|
55
|
-
for (let r = 0; r < g.length; r++)
|
|
56
|
-
g[r].nodeType === 1 && y[r] && v(g[r], y[r], l);
|
|
57
|
-
}
|
|
58
|
-
function I(n, i) {
|
|
59
|
-
n.querySelectorAll("text").forEach((t) => {
|
|
60
|
-
t.setAttribute("font-family", i), t.style.fontFamily = i;
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
function E(n) {
|
|
64
|
-
const i = new TextEncoder().encode(n);
|
|
65
|
-
let o = "";
|
|
66
|
-
return i.forEach((t) => o += String.fromCharCode(t)), btoa(o);
|
|
67
|
-
}
|
|
68
|
-
function $(n, i, o) {
|
|
69
|
-
let s = new XMLSerializer().serializeToString(n);
|
|
70
|
-
s.match(/^<svg[^>]+xmlns="http\:\/\/www\.w3\.org\/2000\/svg"/) || (s = s.replace(/^<svg/, '<svg xmlns="http://www.w3.org/2000/svg"'));
|
|
71
|
-
const a = window.btoa(unescape(encodeURIComponent(s))), e = new window.Image();
|
|
72
|
-
return e.src = `data:image/svg+xml;base64,${a}`, new Promise((c, l) => {
|
|
73
|
-
e.onload = function() {
|
|
74
|
-
const u = document.createElement("canvas");
|
|
75
|
-
u.width = i, u.height = o, u.getContext("2d").drawImage(e, 0, 0, i, o), c(u.toDataURL("image/png", 1));
|
|
76
|
-
}, e.onerror = (u) => l(u);
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
function O(n) {
|
|
80
|
-
if (n.nodeType !== 1) return;
|
|
81
|
-
const i = window.getComputedStyle(n);
|
|
82
|
-
let o = "";
|
|
83
|
-
for (let t = 0; t < i.length; t++) {
|
|
84
|
-
const s = i[t];
|
|
85
|
-
o += `${s}:${i.getPropertyValue(s)};`;
|
|
86
|
-
}
|
|
87
|
-
n.setAttribute("style", o);
|
|
88
|
-
for (let t = 0; t < n.children.length; t++)
|
|
89
|
-
O(n.children[t]);
|
|
90
|
-
}
|
|
91
|
-
function W() {
|
|
92
|
-
const n = [];
|
|
93
|
-
for (const i of document.styleSheets)
|
|
94
|
-
try {
|
|
95
|
-
const o = i.cssRules;
|
|
96
|
-
if (!o) continue;
|
|
97
|
-
for (const t of o)
|
|
98
|
-
(typeof CSSFontFaceRule < "u" && t instanceof CSSFontFaceRule || t.cssText.trim().startsWith("@font-face")) && n.push(t.cssText);
|
|
99
|
-
} catch {
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
return n;
|
|
103
|
-
}
|
|
104
|
-
function z(n) {
|
|
105
|
-
const i = W();
|
|
106
|
-
if (!i.length) return;
|
|
107
|
-
const o = document.createElement("style");
|
|
108
|
-
o.setAttribute("type", "text/css"), o.textContent = i.join(`
|
|
109
|
-
`);
|
|
110
|
-
const t = n.querySelector("defs") || document.createElementNS(x, "defs");
|
|
111
|
-
t.appendChild(o), n.querySelector("defs") || n.insertBefore(t, n.firstChild);
|
|
112
|
-
}
|
|
113
|
-
function M(n, i) {
|
|
114
|
-
const o = n.querySelectorAll("foreignObject"), t = i.querySelectorAll("foreignObject");
|
|
115
|
-
o.forEach((s, a) => {
|
|
116
|
-
const e = t[a];
|
|
117
|
-
if (!e) return;
|
|
118
|
-
function c(l, u) {
|
|
119
|
-
if (!l || !u) return;
|
|
120
|
-
if (l.nodeType === 1 && u.nodeType === 1) {
|
|
121
|
-
const r = window.getComputedStyle(u);
|
|
122
|
-
let d = "";
|
|
123
|
-
for (let m = 0; m < r.length; m++) {
|
|
124
|
-
const C = r[m];
|
|
125
|
-
d += `${C}:${r.getPropertyValue(C)};`;
|
|
126
|
-
}
|
|
127
|
-
l.setAttribute("style", d);
|
|
128
|
-
}
|
|
129
|
-
const g = l.children || [], y = u.children || [];
|
|
130
|
-
for (let r = 0; r < g.length; r++)
|
|
131
|
-
c(g[r], y[r]);
|
|
132
|
-
}
|
|
133
|
-
c(s, e);
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
function P(n) {
|
|
137
|
-
n.querySelectorAll("foreignObject").forEach((o) => {
|
|
138
|
-
let t = "";
|
|
139
|
-
const s = Array.from(o.querySelectorAll("*"));
|
|
140
|
-
if (s.length !== 0) {
|
|
141
|
-
for (const a of document.styleSheets) {
|
|
142
|
-
let e;
|
|
143
|
-
try {
|
|
144
|
-
e = a.cssRules;
|
|
145
|
-
} catch {
|
|
146
|
-
continue;
|
|
147
|
-
}
|
|
148
|
-
if (e) {
|
|
149
|
-
for (const c of e)
|
|
150
|
-
if (!(typeof CSSStyleRule < "u" && !(c instanceof CSSStyleRule)))
|
|
151
|
-
try {
|
|
152
|
-
s.some((l) => l.matches(c.selectorText)) && (t += c.cssText + `
|
|
153
|
-
`);
|
|
154
|
-
} catch {
|
|
155
|
-
continue;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
if (t) {
|
|
160
|
-
const a = document.createElement("style");
|
|
161
|
-
a.textContent = t, o.insertBefore(a, o.firstChild);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
function H(n) {
|
|
167
|
-
n.querySelectorAll("foreignObject").forEach((o) => {
|
|
168
|
-
const t = o.firstElementChild;
|
|
169
|
-
t && t.tagName.toLowerCase() !== "svg" && t.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
function D(n, i) {
|
|
173
|
-
const o = n.querySelectorAll("foreignObject"), t = i.querySelectorAll("foreignObject");
|
|
174
|
-
o.forEach((s, a) => {
|
|
175
|
-
const e = t[a];
|
|
176
|
-
if (!s || !e) return;
|
|
177
|
-
const c = s.firstElementChild, l = e.firstElementChild;
|
|
178
|
-
c && l && R(c, l);
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
function R(n, i) {
|
|
182
|
-
if (n.nodeType !== 1 || !i) return;
|
|
183
|
-
v(n, i);
|
|
184
|
-
const o = n.children || [], t = i.children || [];
|
|
185
|
-
for (let s = 0; s < o.length; s++)
|
|
186
|
-
R(o[s], t[s]);
|
|
187
|
-
}
|
|
188
|
-
function F(n, i) {
|
|
189
|
-
const o = Array.from(i.querySelectorAll("img"));
|
|
190
|
-
n.querySelectorAll("img").forEach((t) => {
|
|
191
|
-
const s = t.getAttribute("src"), a = o.find((e) => e.getAttribute("src") === s);
|
|
192
|
-
if (a) {
|
|
193
|
-
const e = window.getComputedStyle(a);
|
|
194
|
-
let c = "";
|
|
195
|
-
for (let l = 0; l < e.length; l++) {
|
|
196
|
-
const u = e[l];
|
|
197
|
-
c += `${u}:${e.getPropertyValue(u)};`;
|
|
198
|
-
}
|
|
199
|
-
t.setAttribute("style", c);
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
async function B({ container: n, scale: i = 2 }) {
|
|
204
|
-
if (!n) throw new Error("No container provided");
|
|
205
|
-
await document.fonts.ready;
|
|
206
|
-
let o = window.getComputedStyle(n).fontFamily || "Helvetica";
|
|
207
|
-
o.toLowerCase().includes("helvetica") || (o += ", Helvetica");
|
|
208
|
-
const t = n.cloneNode(!0), s = t.querySelectorAll("canvas"), a = n.querySelectorAll("canvas");
|
|
209
|
-
for (let p = 0; p < a.length; p += 1) {
|
|
210
|
-
const f = a[p], h = s[p];
|
|
211
|
-
if (f && h) {
|
|
212
|
-
const w = document.createElement("img");
|
|
213
|
-
w.src = f.toDataURL("image/png"), w.width = f.width, w.height = f.height, w.style.width = f.style.width || f.width + "px", w.style.height = f.style.height || f.height + "px", h.replaceWith(w);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
const e = n.querySelector("svg[aria-label]"), c = t.querySelector("svg[aria-label]");
|
|
217
|
-
if (e && c) {
|
|
218
|
-
H(c), P(c), M(c, e), D(c, e), O(c), I(c, o), F(c, e), await A(c);
|
|
219
|
-
const p = e.getBoundingClientRect(), f = p.width, h = p.height, w = Math.round(f * i), q = Math.round(h * i), L = await $(c, w, q), S = document.createElement("img");
|
|
220
|
-
S.src = L, S.width = f, S.height = h, S.style.width = f + "px", S.style.height = h + "px", c.parentNode.replaceChild(S, c);
|
|
221
|
-
}
|
|
222
|
-
v(t, n, o), F(t, n), T(t), await A(t);
|
|
223
|
-
const { width: l, height: u } = n.getBoundingClientRect(), g = Math.round(Math.max(t.scrollWidth, l) * i), y = Math.round(Math.max(t.scrollHeight, u) * 1.01 * i), r = document.createElementNS(x, "svg");
|
|
224
|
-
r.setAttribute("viewBox", `0 0 ${g} ${y}`), r.setAttribute("width", g), r.setAttribute("height", y), r.setAttribute("style", `font-family:${o};`);
|
|
225
|
-
const d = document.createElementNS(x, "foreignObject");
|
|
226
|
-
d.setAttribute("x", 0), d.setAttribute("y", 0), d.setAttribute("width", g), d.setAttribute("height", y), d.setAttribute("style", `font-family:${o};`), t.style.transform = `scale(${i})`, t.style.transformOrigin = "top left", t.style.width = l + "px", t.style.height = u + "px", t.style.background = window.getComputedStyle(n).backgroundColor, d.appendChild(t), z(r), r.appendChild(d);
|
|
227
|
-
const C = new XMLSerializer().serializeToString(r), j = E(C), b = new window.Image();
|
|
228
|
-
return b.crossOrigin = "anonymous", b.src = `data:image/svg+xml;base64,${j}`, new Promise((p, f) => {
|
|
229
|
-
b.onload = function() {
|
|
230
|
-
try {
|
|
231
|
-
const h = document.createElement("canvas");
|
|
232
|
-
h.width = g, h.height = y, h.getContext("2d").drawImage(b, 0, 0, g, y), p(h.toDataURL("image/png", 1));
|
|
233
|
-
} catch (h) {
|
|
234
|
-
f("Failed to draw SVG on canvas: " + h);
|
|
235
|
-
}
|
|
236
|
-
}, b.onerror = function() {
|
|
237
|
-
f("Failed to load SVG image for conversion");
|
|
238
|
-
};
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
export {
|
|
242
|
-
B as d
|
|
243
|
-
};
|
package/dist/img-P0SFFw37.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { d as i } from "./dom-to-png-C0Ct8ClX.js";
|
|
2
|
-
async function a({ domElement: r, fileName: n, format: t = "png", scale: c = 2 }) {
|
|
3
|
-
if (!r) return Promise.reject("No element provided");
|
|
4
|
-
if (t === "svg") {
|
|
5
|
-
const o = converter.convertToImg({ container: r, scale: c });
|
|
6
|
-
if (!o) return Promise.reject("Could not create SVG image");
|
|
7
|
-
const e = document.createElement("a");
|
|
8
|
-
return e.href = o.src, e.download = `${n}.svg`, document.body.appendChild(e), e.click(), document.body.removeChild(e), Promise.resolve();
|
|
9
|
-
}
|
|
10
|
-
try {
|
|
11
|
-
const o = await i({ container: r, scale: c }), e = document.createElement("a");
|
|
12
|
-
e.href = o, e.download = `${n}.${t}`, document.body.appendChild(e), e.click(), document.body.removeChild(e);
|
|
13
|
-
} catch (o) {
|
|
14
|
-
throw console.error("Error generating image:", o), o;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export {
|
|
18
|
-
a as default
|
|
19
|
-
};
|