@svgrid/grid-wc 3.0.45 → 3.0.47
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/GridFind-C1YbloFh.js +39 -0
- package/dist/GridFooter-DOR8m9GQ.js +142 -0
- package/dist/GridMenus-Da8XGbc6.js +1461 -0
- package/dist/PinSplitter-Du4ZF8T3.js +178 -0
- package/dist/SvChartMenu-B6kpmwUv.js +401 -0
- package/dist/{SvDateRangeInput-Cpss2SsG.js → SvDateRangeInput-ByR-LFgf.js} +78 -77
- package/dist/SvDateTimePicker-BCxhFb5c.js +763 -0
- package/dist/{SvField-C--8r4go.js → SvField-CtzxdF7J.js} +100 -99
- package/dist/SvGridCellEditor-BUdVD7xM.js +594 -0
- package/dist/SvGridChart-DkKI8-bj.js +3684 -0
- package/dist/SvGridChartBuilder-BCQ3W8TY.js +1086 -0
- package/dist/SvGridChartPanel-uqul044E.js +1689 -0
- package/dist/{SvGridChartView-Bvacwk37.js → SvGridChartView-DWxEFzdM.js} +9 -8
- package/dist/SvGridDropdown-CnCQuXaI.js +258 -0
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +12 -3
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -1
- package/dist/angular/types/svgrid-grid-wc-angular.d.ts +5 -1
- package/dist/chart/SvChartMenu-NxEyX5kU.js +635 -0
- package/dist/chart/{chart-export-C43UPY8D.js → chart-export-Dj_zVsjI.js} +5 -7
- package/dist/chart/chart-export-pdf-pmzjhHhB.js +156 -0
- package/dist/chart/{client-BuB0wIgc.js → client-Y303i9Lw.js} +1317 -1214
- package/dist/chart/sv-chart-element.js +2390 -2405
- package/dist/chart-export-pdf-DyuVs1gO.js +156 -0
- package/dist/client-OtsRxGjS.js +3075 -0
- package/dist/{column-resize-DUPgynvc.js → column-resize-SEn7el6C.js} +21 -9
- package/dist/{csv-injection-Ce26_TOb.js → csv-injection-Cxf6dMrr.js} +1 -1
- package/dist/{date-format-B0RznzxC.js → date-format-DngG1HJ5.js} +402 -407
- package/dist/{shadow/export-format-6jDuF2nb.js → export-format-7DhxeN27.js} +2 -2
- package/dist/{grid-extension.svelte-CBhmpjuc.js → grid-extension.svelte-DToFhcZv.js} +1 -1
- package/dist/grid-menu-messages-BEsB6Jhh.js +57 -0
- package/dist/history-Q12tf0k-.js +80 -0
- package/dist/list-option-DpIu99JN.js +203 -0
- package/dist/menu-focus-lmTebXyL.js +45 -0
- package/dist/range-commit-C6Rogxem.js +385 -0
- package/dist/react/index.d.ts +11 -0
- package/dist/react/index.js +2 -1
- package/dist/shadow/GridFind-CcoKoisE.js +39 -0
- package/dist/shadow/GridFooter-CDq71ytl.js +142 -0
- package/dist/shadow/GridMenus-RAp-E3hp.js +1461 -0
- package/dist/shadow/PinSplitter-BAYTAZtm.js +178 -0
- package/dist/shadow/SvChartMenu-C74rWwjU.js +401 -0
- package/dist/shadow/{SvDateRangeInput-Cpss2SsG.js → SvDateRangeInput-9Wq4E64y.js} +78 -77
- package/dist/shadow/SvDateTimePicker-y9jPLR19.js +763 -0
- package/dist/shadow/{SvField-C--8r4go.js → SvField-DGPj2clt.js} +100 -99
- package/dist/shadow/SvGridCellEditor-CzeBp9lp.js +594 -0
- package/dist/shadow/SvGridChart-zTsB6F3Y.js +3684 -0
- package/dist/shadow/SvGridChartBuilder-VUKgOcp7.js +1086 -0
- package/dist/shadow/SvGridChartPanel-DkjEUB7t.js +1689 -0
- package/dist/shadow/{SvGridChartView-Bvacwk37.js → SvGridChartView-DQmJahyT.js} +9 -8
- package/dist/shadow/SvGridDropdown-B_5kqHQE.js +258 -0
- package/dist/shadow/chart-export-pdf-BZy6f5QB.js +156 -0
- package/dist/shadow/client-OtsRxGjS.js +3075 -0
- package/dist/shadow/{column-resize-DUPgynvc.js → column-resize-SEn7el6C.js} +21 -9
- package/dist/shadow/{csv-injection-Ce26_TOb.js → csv-injection-Cxf6dMrr.js} +1 -1
- package/dist/shadow/{date-format-B0RznzxC.js → date-format-C9UkbCig.js} +402 -407
- package/dist/{export-format-6jDuF2nb.js → shadow/export-format-7DhxeN27.js} +2 -2
- package/dist/shadow/{grid-extension.svelte-CBhmpjuc.js → grid-extension.svelte-DToFhcZv.js} +1 -1
- package/dist/shadow/grid-menu-messages-BEsB6Jhh.js +57 -0
- package/dist/shadow/history-Q12tf0k-.js +80 -0
- package/dist/shadow/list-option-DpIu99JN.js +203 -0
- package/dist/shadow/menu-focus-lmTebXyL.js +45 -0
- package/dist/shadow/range-commit-C6Rogxem.js +385 -0
- package/dist/shadow/sv-grid-shadow-element.d.ts +7 -0
- package/dist/shadow/sv-grid-shadow-element.js +4236 -4469
- package/dist/shadow/{svelte-virtualizer.svelte-u-y0InK2.js → svelte-virtualizer.svelte-DWvD9wvL.js} +17 -12
- package/dist/sv-grid-element.d.ts +7 -0
- package/dist/sv-grid-element.js +4219 -4452
- package/dist/{svelte-virtualizer.svelte-u-y0InK2.js → svelte-virtualizer.svelte-DWvD9wvL.js} +17 -12
- package/dist/vue/index.d.ts +6 -2
- package/dist/vue/index.js +1 -1
- package/package.json +4 -4
- package/dist/GridFind-DianRZxS.js +0 -39
- package/dist/GridFooter-Bp3o5qJX.js +0 -162
- package/dist/GridMenus-BYkY3nhr.js +0 -1405
- package/dist/PinSplitter-CinhgIrH.js +0 -130
- package/dist/SvChartMenu-CgAcTloT.js +0 -413
- package/dist/SvDateTimePicker-DyRO_e91.js +0 -770
- package/dist/SvGridCellEditor-DHHGSjgp.js +0 -584
- package/dist/SvGridChart-BFQLtNmn.js +0 -3703
- package/dist/SvGridChartBuilder-CtGuoAOV.js +0 -1166
- package/dist/SvGridChartPanel-CeaXNzmV.js +0 -1743
- package/dist/SvGridDropdown-CrECQYeq.js +0 -257
- package/dist/chart/SvChartMenu-DslxOgPN.js +0 -590
- package/dist/chart/chart-export-pdf-C0_y8glC.js +0 -104
- package/dist/chart-export-pdf-DDVtypH7.js +0 -104
- package/dist/client-DtIdusS4.js +0 -2974
- package/dist/focus-trap-Dbb2tJxb.js +0 -65
- package/dist/list-option-DrRyivWp.js +0 -82
- package/dist/shadow/GridFind-DianRZxS.js +0 -39
- package/dist/shadow/GridFooter-DvMFqeNV.js +0 -162
- package/dist/shadow/GridMenus-DKLNTKDZ.js +0 -1405
- package/dist/shadow/PinSplitter-CinhgIrH.js +0 -130
- package/dist/shadow/SvChartMenu-CgAcTloT.js +0 -413
- package/dist/shadow/SvDateTimePicker-DyRO_e91.js +0 -770
- package/dist/shadow/SvGridCellEditor-DHHGSjgp.js +0 -584
- package/dist/shadow/SvGridChart-BFQLtNmn.js +0 -3703
- package/dist/shadow/SvGridChartBuilder-CtGuoAOV.js +0 -1166
- package/dist/shadow/SvGridChartPanel-CeaXNzmV.js +0 -1743
- package/dist/shadow/SvGridDropdown-CrECQYeq.js +0 -257
- package/dist/shadow/chart-export-pdf-DDVtypH7.js +0 -104
- package/dist/shadow/client-DtIdusS4.js +0 -2974
- package/dist/shadow/focus-trap-Dbb2tJxb.js +0 -65
- package/dist/shadow/list-option-DrRyivWp.js +0 -82
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { a as e, n as t, r as n } from "./chart-export-Dj_zVsjI.js";
|
|
2
|
+
//#region ../grid/dist/chart-export-pdf.js
|
|
3
|
+
var r = {
|
|
4
|
+
A4: [595.28, 841.89],
|
|
5
|
+
Letter: [612, 792]
|
|
6
|
+
};
|
|
7
|
+
function i(e) {
|
|
8
|
+
let t = new Uint8Array(e.length);
|
|
9
|
+
for (let n = 0; n < e.length; n += 1) {
|
|
10
|
+
let r = e.charCodeAt(n);
|
|
11
|
+
t[n] = r < 256 ? r : 63;
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
}
|
|
15
|
+
var a = {
|
|
16
|
+
8364: 128,
|
|
17
|
+
8218: 130,
|
|
18
|
+
402: 131,
|
|
19
|
+
8222: 132,
|
|
20
|
+
8230: 133,
|
|
21
|
+
8224: 134,
|
|
22
|
+
8225: 135,
|
|
23
|
+
710: 136,
|
|
24
|
+
8240: 137,
|
|
25
|
+
352: 138,
|
|
26
|
+
8249: 139,
|
|
27
|
+
338: 140,
|
|
28
|
+
381: 142,
|
|
29
|
+
8216: 145,
|
|
30
|
+
8217: 146,
|
|
31
|
+
8220: 147,
|
|
32
|
+
8221: 148,
|
|
33
|
+
8226: 149,
|
|
34
|
+
8211: 150,
|
|
35
|
+
8212: 151,
|
|
36
|
+
732: 152,
|
|
37
|
+
8482: 153,
|
|
38
|
+
353: 154,
|
|
39
|
+
8250: 155,
|
|
40
|
+
339: 156,
|
|
41
|
+
382: 158,
|
|
42
|
+
376: 159
|
|
43
|
+
};
|
|
44
|
+
function o(e) {
|
|
45
|
+
let t = "";
|
|
46
|
+
for (let n of e) {
|
|
47
|
+
let e = n.codePointAt(0), r = e < 128 || e >= 160 && e < 256 ? e : a[e];
|
|
48
|
+
if (r == null) return null;
|
|
49
|
+
t += String.fromCharCode(r);
|
|
50
|
+
}
|
|
51
|
+
return t;
|
|
52
|
+
}
|
|
53
|
+
var s = class extends Error {
|
|
54
|
+
constructor(e) {
|
|
55
|
+
super(`The chart PDF cannot draw "${e}": its font has Western European letters only. Download the chart as PNG or SVG instead.`), this.name = "ChartPdfTextError", this.text = e;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
function c(...e) {
|
|
59
|
+
return e.find((e) => e && o(e.trim()) == null) ?? null;
|
|
60
|
+
}
|
|
61
|
+
function l(e) {
|
|
62
|
+
let t = o(e);
|
|
63
|
+
if (t == null) throw new s(e);
|
|
64
|
+
return "(" + t.replace(/[\\()]/g, (e) => "\\" + e).replace(/[\r\n]+/g, " ") + ")";
|
|
65
|
+
}
|
|
66
|
+
function u(e, t) {
|
|
67
|
+
return e.length * t * .5;
|
|
68
|
+
}
|
|
69
|
+
function d(e, t, n) {
|
|
70
|
+
return new Promise((r, i) => {
|
|
71
|
+
let a = URL.createObjectURL(e), o = new Image();
|
|
72
|
+
o.onload = () => {
|
|
73
|
+
let e = document.createElement("canvas");
|
|
74
|
+
e.width = o.naturalWidth || o.width, e.height = o.naturalHeight || o.height;
|
|
75
|
+
let s = e.getContext("2d");
|
|
76
|
+
if (!s) {
|
|
77
|
+
URL.revokeObjectURL(a), i(/* @__PURE__ */ Error("canvas 2d context unavailable"));
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
s.fillStyle = t, s.fillRect(0, 0, e.width, e.height), s.drawImage(o, 0, 0), URL.revokeObjectURL(a), e.toBlob((t) => {
|
|
81
|
+
if (!t) {
|
|
82
|
+
i(/* @__PURE__ */ Error("toBlob failed"));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
t.arrayBuffer().then((t) => r({
|
|
86
|
+
bytes: new Uint8Array(t),
|
|
87
|
+
width: e.width,
|
|
88
|
+
height: e.height
|
|
89
|
+
}), i);
|
|
90
|
+
}, "image/jpeg", n);
|
|
91
|
+
}, o.onerror = () => {
|
|
92
|
+
URL.revokeObjectURL(a), i(/* @__PURE__ */ Error("failed to decode chart PNG"));
|
|
93
|
+
}, o.src = a;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function f(e, t = {}) {
|
|
97
|
+
let [n, a] = r[t.page ?? "A4"], o = t.orientation ? t.orientation === "landscape" : e.width / e.height > n / a, s = o ? a : n, c = o ? n : a, d = (t.title ?? "").trim(), f = (t.subtitle ?? "").trim(), p = (t.caption ?? "").trim(), m = c - 40, h = [], g = (e, t, n) => {
|
|
98
|
+
m -= t + 4, h.push(`BT /F1 ${t} Tf ${n} g 40 ${m.toFixed(2)} Td ${l(e)} Tj ET`);
|
|
99
|
+
};
|
|
100
|
+
d && g(d, 16, 0), f && g(f, 11, .4), (d || f) && (m -= 8);
|
|
101
|
+
let _ = p ? 20 : 0, v = s - 80, y = m - 40 - _, b = Math.min(v / e.width, y / e.height), x = e.width * b, S = e.height * b, C = 40 + (v - x) / 2, w = m - S;
|
|
102
|
+
if (h.push(`q ${x.toFixed(2)} 0 0 ${S.toFixed(2)} ${C.toFixed(2)} ${w.toFixed(2)} cm /Im1 Do Q`), p) {
|
|
103
|
+
let e = u(p, 9) > v ? p.slice(0, Math.floor(v / 4.5) - 3) + "..." : p;
|
|
104
|
+
h.push(`BT /F1 9 Tf 0.4 g 40 ${36 .toFixed(2)} Td ${l(e)} Tj ET`);
|
|
105
|
+
}
|
|
106
|
+
let T = h.join("\n"), E = [], D = [], O = 0, k = (e) => {
|
|
107
|
+
E.push(e), O += e.length;
|
|
108
|
+
};
|
|
109
|
+
k("%PDF-1.4\n%âãÏÓ\n");
|
|
110
|
+
let A = (e, t, n) => {
|
|
111
|
+
D[e] = O, k(`${e} 0 obj\n${t}\n`), n && (k("stream\n"), k(n), k("\nendstream\n")), k("endobj\n");
|
|
112
|
+
};
|
|
113
|
+
A(1, "<< /Type /Catalog /Pages 2 0 R >>"), A(2, "<< /Type /Pages /Kids [3 0 R] /Count 1 >>"), A(3, `<< /Type /Page /Parent 2 0 R /MediaBox [0 0 ${s.toFixed(2)} ${c.toFixed(2)}] /Resources << /XObject << /Im1 4 0 R >> /Font << /F1 5 0 R >> >> /Contents 6 0 R >>`), A(4, `<< /Type /XObject /Subtype /Image /Width ${e.width} /Height ${e.height} /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /DCTDecode /Length ${e.bytes.length} >>`, e.bytes), A(5, "<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>"), A(6, `<< /Length ${T.length} >>`, i(T));
|
|
114
|
+
let j = O;
|
|
115
|
+
k("xref\n0 7\n0000000000 65535 f \n");
|
|
116
|
+
for (let e = 1; e <= 6; e += 1) k(`${String(D[e]).padStart(10, "0")} 00000 n \n`);
|
|
117
|
+
k(`trailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n${j}\n%%EOF\n`);
|
|
118
|
+
let M = new Uint8Array(new ArrayBuffer(O)), N = 0;
|
|
119
|
+
for (let e of E) {
|
|
120
|
+
let t = typeof e == "string" ? i(e) : e;
|
|
121
|
+
M.set(t, N), N += t.length;
|
|
122
|
+
}
|
|
123
|
+
return M;
|
|
124
|
+
}
|
|
125
|
+
async function p(e, n = {}) {
|
|
126
|
+
let r = c(n.title, n.subtitle, n.caption);
|
|
127
|
+
if (r != null) throw new s(r);
|
|
128
|
+
let i = e instanceof SVGSVGElement ? e : e.querySelector("svg.sv-grid-chart-svg") ?? e.querySelector("svg"), a = n.background ?? (i && getComputedStyle(i).getPropertyValue("--sg-bg").trim() || "#ffffff"), o = f(await d(await t(e, {
|
|
129
|
+
...n,
|
|
130
|
+
background: a,
|
|
131
|
+
scale: n.scale ?? 2
|
|
132
|
+
}), a, n.quality ?? .92), n);
|
|
133
|
+
return new Blob([o.buffer], { type: "application/pdf" });
|
|
134
|
+
}
|
|
135
|
+
async function m(t, n = "chart.pdf", r = {}) {
|
|
136
|
+
e(await p(t, r), n);
|
|
137
|
+
}
|
|
138
|
+
function h(e, t = {}) {
|
|
139
|
+
let r = n(e, t), i = window.open("", "_blank", "width=900,height=700");
|
|
140
|
+
if (!i) return !1;
|
|
141
|
+
let a = i.document;
|
|
142
|
+
a.title = t.title ?? "Chart";
|
|
143
|
+
let o = a.createElement("style");
|
|
144
|
+
if (o.textContent = "body{margin:24px;font-family:system-ui,sans-serif}h1{font-size:16px;margin:0 0 12px}img{max-width:100%;height:auto}@page{margin:12mm}", a.head.append(o), t.title) {
|
|
145
|
+
let e = a.createElement("h1");
|
|
146
|
+
e.textContent = t.title, a.body.append(e);
|
|
147
|
+
}
|
|
148
|
+
let s = a.createElement("img");
|
|
149
|
+
s.alt = t.title ?? "Chart", s.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(r), a.body.append(s);
|
|
150
|
+
let c = () => setTimeout(() => {
|
|
151
|
+
i.focus(), i.print();
|
|
152
|
+
}, 50);
|
|
153
|
+
return s.complete ? c() : (s.addEventListener("load", c, { once: !0 }), s.addEventListener("error", c, { once: !0 })), !0;
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
export { s as ChartPdfTextError, f as buildChartPdf, p as chartToPdfBlob, m as downloadChartPdf, c as pdfUndrawable, h as printChart };
|