@svgrid/grid 3.0.6 → 3.0.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/SvGrid.controller.svelte.d.ts +2 -0
- package/dist/SvGrid.controller.svelte.js +30 -4
- package/dist/SvGrid.css +16 -5
- package/dist/SvGrid.helpers.js +2 -4
- package/dist/cdn/{GridMenus-C-NtjlrJ.js → GridMenus-BgUS-W3o.js} +2 -2
- package/dist/cdn/{GridMenus-TssHej3q.js → GridMenus-CcwU8I4t.js} +2 -2
- package/dist/cdn/{SvGridCellEditor-BlyCSp0q.js → SvGridCellEditor-9yz-SbdZ.js} +1 -1
- package/dist/cdn/{SvGridCellEditor-ClRRA9lW.js → SvGridCellEditor-D7-ql1Hd.js} +1 -1
- package/dist/cdn/{SvGridChart-DsmwTyZF.js → SvGridChart-DMUOFxOe.js} +3 -3
- package/dist/cdn/{SvGridChart-B4EV8U6t.js → SvGridChart-N7ik0oWy.js} +3 -3
- package/dist/cdn/{SvGridChartBuilder-cHloHobN.js → SvGridChartBuilder-CB_Jnm2k.js} +3 -3
- package/dist/cdn/{SvGridChartBuilder-vOl7C0Za.js → SvGridChartBuilder-Ca7gF8ZK.js} +3 -3
- package/dist/cdn/{SvGridChartPanel-AcqF-Ll5.js → SvGridChartPanel-9GOJRHP7.js} +5 -5
- package/dist/cdn/{SvGridChartPanel-biMtSBPA.js → SvGridChartPanel-Dl-FujN8.js} +5 -5
- package/dist/cdn/{SvGridChartView-I3rDHXAq.js → SvGridChartView-B1LFgoPP.js} +2 -2
- package/dist/cdn/{SvGridChartView-Dx_GmZuL.js → SvGridChartView-By3n7DGZ.js} +2 -2
- package/dist/cdn/{cell-formatting-DVVKOSI9.js → cell-formatting-Mnv84zoE.js} +27 -5
- package/dist/cdn/{chart-DEZxwC0i.js → chart-By7h2Guv.js} +1 -1
- package/dist/cdn/{chart-panel-messages-D12XcTZJ.js → chart-panel-messages-BC-tOgFY.js} +1 -1
- package/dist/cdn/{chart-panel-messages-DguS7gC5.js → chart-panel-messages-DUaXr-sb.js} +1 -1
- package/dist/cdn/{chart-summary-CMAXBGY-.js → chart-summary-BDtrNEiA.js} +1 -1
- package/dist/cdn/{chart-trend-BkEp61Gj.js → chart-trend-C1aOAPBZ.js} +1 -1
- package/dist/cdn/{editor-registry-BhgE3S84.js → editor-registry-BVeHvlZR.js} +49 -50
- package/dist/cdn/{export-format-YzdwBww2.js → export-format-y1wdyCcv.js} +93 -97
- package/dist/cdn/{src-CgoeSM8k.js → src-25JmJ_7g.js} +3244 -3191
- package/dist/cdn/{src-DfwxB1TH.js → src-kE9B98r6.js} +3172 -3119
- package/dist/cdn/svgrid.js +11 -11
- package/dist/cdn/svgrid.svelte-external.js +11 -11
- package/dist/cell-formatting.d.ts +9 -0
- package/dist/cell-formatting.js +34 -0
- package/dist/core.js +117 -19
- package/dist/export-format.d.ts +8 -0
- package/dist/export-format.js +23 -16
- package/dist/virtualization/column-virtualizer.d.ts +1 -0
- package/dist/virtualization/svelte-virtualizer.svelte.d.ts +1 -0
- package/dist/virtualization/svelte-virtualizer.svelte.js +1 -0
- package/dist/virtualization/virtualizer.d.ts +3 -0
- package/dist/virtualization/virtualizer.js +14 -1
- package/package.json +1 -1
- package/src/SvGrid.controller.svelte.ts +30 -4
- package/src/SvGrid.css +16 -5
- package/src/SvGrid.helpers.ts +2 -4
- package/src/cell-formatting.ts +31 -0
- package/src/core.sort.test.ts +86 -0
- package/src/core.ts +109 -19
- package/src/export-dates.test.ts +114 -0
- package/src/export-format.ts +26 -14
- package/src/svgrid.data-push.svelte.test.ts +94 -0
- package/src/svgrid.live-update-paths.svelte.test.ts +4 -2
- package/src/virtualization/svelte-virtualizer.svelte.ts +1 -0
- package/src/virtualization/virtualizer.test.ts +44 -0
- package/src/virtualization/virtualizer.ts +13 -1
|
@@ -1,50 +1,46 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as t, i as n, n as r, t as i } from "./cell-formatting-Mnv84zoE.js";
|
|
3
3
|
//#region src/export-format.ts
|
|
4
|
-
var
|
|
5
|
-
coerceExportDate: () =>
|
|
6
|
-
copyTextToClipboard: () =>
|
|
7
|
-
downloadBlobFile: () =>
|
|
8
|
-
downloadTextFile: () =>
|
|
9
|
-
formatValueForExport: () =>
|
|
10
|
-
projectGridRows: () =>
|
|
11
|
-
serializeDelimited: () =>
|
|
12
|
-
serializeHtml: () =>
|
|
13
|
-
serializeJson: () =>
|
|
14
|
-
serializeMarkdown: () =>
|
|
15
|
-
serializeXml: () =>
|
|
16
|
-
toExcelNumFmt: () =>
|
|
17
|
-
|
|
4
|
+
var a = /* @__PURE__ */ e({
|
|
5
|
+
coerceExportDate: () => o,
|
|
6
|
+
copyTextToClipboard: () => A,
|
|
7
|
+
downloadBlobFile: () => O,
|
|
8
|
+
downloadTextFile: () => k,
|
|
9
|
+
formatValueForExport: () => c,
|
|
10
|
+
projectGridRows: () => u,
|
|
11
|
+
serializeDelimited: () => _,
|
|
12
|
+
serializeHtml: () => b,
|
|
13
|
+
serializeJson: () => x,
|
|
14
|
+
serializeMarkdown: () => C,
|
|
15
|
+
serializeXml: () => D,
|
|
16
|
+
toExcelNumFmt: () => l,
|
|
17
|
+
toLocalIsoString: () => s,
|
|
18
|
+
valueForExcel: () => f
|
|
18
19
|
});
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
if (typeof e == "number" && Number.isFinite(e)) {
|
|
22
|
-
let t = new Date(e);
|
|
23
|
-
return Number.isNaN(t.getTime()) ? null : t;
|
|
24
|
-
}
|
|
25
|
-
if (typeof e == "string" && e.trim() !== "") {
|
|
26
|
-
let t = new Date(e);
|
|
27
|
-
return Number.isNaN(t.getTime()) ? null : t;
|
|
28
|
-
}
|
|
29
|
-
return null;
|
|
20
|
+
function o(e) {
|
|
21
|
+
return n(e);
|
|
30
22
|
}
|
|
31
|
-
function
|
|
23
|
+
function s(e) {
|
|
24
|
+
let t = (e, t = 2) => String(Math.abs(e)).padStart(t, "0"), n = -e.getTimezoneOffset(), r = n < 0 ? "-" : "+", i = e.getFullYear();
|
|
25
|
+
return (i < 0 ? "-" + t(i, 6) : t(i, 4)) + `-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}.${t(e.getMilliseconds(), 3)}${r}${t(Math.floor(Math.abs(n) / 60))}:${t(Math.abs(n) % 60)}`;
|
|
26
|
+
}
|
|
27
|
+
function c(e, n) {
|
|
32
28
|
if (e == null) return "";
|
|
33
|
-
if (!
|
|
34
|
-
if (
|
|
35
|
-
type:
|
|
36
|
-
locales:
|
|
37
|
-
currency:
|
|
38
|
-
valueIsPercentPoints:
|
|
39
|
-
options:
|
|
29
|
+
if (!n) return String(e);
|
|
30
|
+
if (n.type === "number" || n.type === "currency" || n.type === "percent") return i(e, {
|
|
31
|
+
type: n.type,
|
|
32
|
+
locales: n.locales,
|
|
33
|
+
currency: n.type === "currency" ? n.currency ?? "USD" : void 0,
|
|
34
|
+
valueIsPercentPoints: n.type === "percent" ? n.valueIsPercentPoints : void 0,
|
|
35
|
+
options: n.options
|
|
40
36
|
});
|
|
41
|
-
if (
|
|
42
|
-
let
|
|
43
|
-
if (
|
|
44
|
-
let e = t(
|
|
37
|
+
if (n.type === "date" || n.type === "datetime") {
|
|
38
|
+
let i = o(e);
|
|
39
|
+
if (i) {
|
|
40
|
+
let e = t(n.pattern, n.type), a = e || n.options ? {
|
|
45
41
|
...e,
|
|
46
|
-
...
|
|
47
|
-
} :
|
|
42
|
+
...n.options
|
|
43
|
+
} : n.type === "date" ? {
|
|
48
44
|
year: "numeric",
|
|
49
45
|
month: "2-digit",
|
|
50
46
|
day: "2-digit"
|
|
@@ -55,12 +51,12 @@ function o(e, i) {
|
|
|
55
51
|
hour: "2-digit",
|
|
56
52
|
minute: "2-digit"
|
|
57
53
|
};
|
|
58
|
-
return n
|
|
54
|
+
return r(n.locales, a).format(i);
|
|
59
55
|
}
|
|
60
56
|
}
|
|
61
57
|
return String(e);
|
|
62
58
|
}
|
|
63
|
-
function
|
|
59
|
+
function l(e) {
|
|
64
60
|
if (!e) return;
|
|
65
61
|
let t = () => {
|
|
66
62
|
let t = e.options;
|
|
@@ -68,34 +64,34 @@ function s(e) {
|
|
|
68
64
|
}, n = (e) => e > 0 ? "." + "0".repeat(e) : "";
|
|
69
65
|
switch (e.type) {
|
|
70
66
|
case "number": return `#,##0${n(t())}`;
|
|
71
|
-
case "currency": return `"${
|
|
67
|
+
case "currency": return `"${d(e.currency ?? "USD")}"#,##0${n(t())}`;
|
|
72
68
|
case "percent": return `0${n(t())}%`;
|
|
73
69
|
case "date": return "yyyy-mm-dd";
|
|
74
70
|
case "datetime": return "yyyy-mm-dd hh:mm";
|
|
75
71
|
default: return;
|
|
76
72
|
}
|
|
77
73
|
}
|
|
78
|
-
function
|
|
74
|
+
function u(e, t, n = {}) {
|
|
79
75
|
let r = n.columns && n.columns.length ? n.columns.map((e) => t.find((t) => t.field === e)).filter((e) => !!e) : t.filter((e) => e.field), i = r.map((e) => e.field), a = {};
|
|
80
76
|
for (let e of r) e.align && (a[e.field] = e.align);
|
|
81
|
-
let
|
|
82
|
-
for (let e of r)
|
|
83
|
-
let
|
|
77
|
+
let o = {};
|
|
78
|
+
for (let e of r) o[e.field] = e.header;
|
|
79
|
+
let s = [o];
|
|
84
80
|
for (let t of e) {
|
|
85
81
|
let e = {};
|
|
86
82
|
for (let i of r) {
|
|
87
83
|
let r = t[i.field];
|
|
88
|
-
e[i.field] = n.rawValues ? r :
|
|
84
|
+
e[i.field] = n.rawValues ? r : c(r, i.format);
|
|
89
85
|
}
|
|
90
|
-
|
|
86
|
+
s.push(e);
|
|
91
87
|
}
|
|
92
88
|
return {
|
|
93
|
-
records:
|
|
89
|
+
records: s,
|
|
94
90
|
fields: i,
|
|
95
91
|
align: a
|
|
96
92
|
};
|
|
97
93
|
}
|
|
98
|
-
function
|
|
94
|
+
function d(e) {
|
|
99
95
|
return {
|
|
100
96
|
USD: "$",
|
|
101
97
|
EUR: "€",
|
|
@@ -108,7 +104,7 @@ function l(e) {
|
|
|
108
104
|
BRL: "R$"
|
|
109
105
|
}[e.toUpperCase()] ?? e.toUpperCase();
|
|
110
106
|
}
|
|
111
|
-
function
|
|
107
|
+
function f(e, t) {
|
|
112
108
|
if (e == null || !t) return { ok: !1 };
|
|
113
109
|
if (t.type === "number" || t.type === "currency") {
|
|
114
110
|
let t = typeof e == "number" ? e : Number(e);
|
|
@@ -125,7 +121,7 @@ function u(e, t) {
|
|
|
125
121
|
} : { ok: !1 };
|
|
126
122
|
}
|
|
127
123
|
if (t.type === "date" || t.type === "datetime") {
|
|
128
|
-
let t =
|
|
124
|
+
let t = o(e);
|
|
129
125
|
return t ? {
|
|
130
126
|
ok: !0,
|
|
131
127
|
value: t
|
|
@@ -133,26 +129,26 @@ function u(e, t) {
|
|
|
133
129
|
}
|
|
134
130
|
return { ok: !1 };
|
|
135
131
|
}
|
|
136
|
-
var
|
|
137
|
-
function
|
|
132
|
+
var p = "";
|
|
133
|
+
function m(e) {
|
|
138
134
|
if (e?.aborted) throw new DOMException("Export aborted", "AbortError");
|
|
139
135
|
}
|
|
140
|
-
var
|
|
141
|
-
function
|
|
142
|
-
let n = e == null ? "" : e instanceof Date ? e
|
|
136
|
+
var h = () => new Promise((e) => setTimeout(e, 0));
|
|
137
|
+
function g(e, t) {
|
|
138
|
+
let n = e == null ? "" : e instanceof Date ? s(e) : String(e);
|
|
143
139
|
return n === "" ? n : n.includes(t) || n.includes("\"") || n.includes("\n") || n.includes("\r") ? `"${n.replace(/"/g, "\"\"")}"` : n;
|
|
144
140
|
}
|
|
145
|
-
async function
|
|
141
|
+
async function _(e, t, n = {}) {
|
|
146
142
|
let r = n.csv?.delimiter ?? ",", i = n.csv?.eol ?? "\r\n", a = n.csv?.bom ?? !0, o = Math.max(1, n.chunkRows ?? 5e3), s = e.length, c = [];
|
|
147
143
|
for (let i = 0; i < e.length; i++) {
|
|
148
|
-
|
|
144
|
+
m(n.signal);
|
|
149
145
|
let a = e[i];
|
|
150
|
-
c.push(t.map((e) =>
|
|
146
|
+
c.push(t.map((e) => g(a[e], r)).join(r)), i > 0 && i % o === 0 && (n.onProgress?.({
|
|
151
147
|
phase: "serialize",
|
|
152
148
|
ratio: i / s,
|
|
153
149
|
row: i,
|
|
154
150
|
total: s
|
|
155
|
-
}), await
|
|
151
|
+
}), await h());
|
|
156
152
|
}
|
|
157
153
|
n.onProgress?.({
|
|
158
154
|
phase: "serialize",
|
|
@@ -161,48 +157,48 @@ async function h(e, t, n = {}) {
|
|
|
161
157
|
total: s
|
|
162
158
|
});
|
|
163
159
|
let l = c.join(i);
|
|
164
|
-
return (a ?
|
|
160
|
+
return (a ? p : "") + l;
|
|
165
161
|
}
|
|
166
|
-
var
|
|
162
|
+
var v = {
|
|
167
163
|
"&": "&",
|
|
168
164
|
"<": "<",
|
|
169
165
|
">": ">",
|
|
170
166
|
"\"": """,
|
|
171
167
|
"'": "'"
|
|
172
168
|
};
|
|
173
|
-
function
|
|
174
|
-
return (e == null ? "" : e instanceof Date ? e
|
|
169
|
+
function y(e) {
|
|
170
|
+
return (e == null ? "" : e instanceof Date ? s(e) : String(e)).replace(/[&<>"']/g, (e) => v[e]);
|
|
175
171
|
}
|
|
176
|
-
async function
|
|
177
|
-
let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length, a = n.align ?? {}, o = n.cellStyle, s = n.cellLink, c = n.title ?? "Grid export", l = e[0], u = l ? t.map((e) => `<th>${
|
|
172
|
+
async function b(e, t, n = {}) {
|
|
173
|
+
let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length, a = n.align ?? {}, o = n.cellStyle, s = n.cellLink, c = n.title ?? "Grid export", l = e[0], u = l ? t.map((e) => `<th>${y(l[e])}</th>`).join("") : "", d = [];
|
|
178
174
|
for (let c = 1; c < e.length; c++) {
|
|
179
|
-
|
|
175
|
+
m(n.signal);
|
|
180
176
|
let l = e[c], u = t.map((e, t) => {
|
|
181
177
|
let n = a[e], r = [];
|
|
182
178
|
n && n !== "left" && r.push(`text-align:${n}`);
|
|
183
179
|
let i = o?.(c - 1, t);
|
|
184
180
|
i?.fill && r.push(`background:${i.fill}`), i?.color && r.push(`color:${i.color}`), i?.bold && r.push("font-weight:700");
|
|
185
|
-
let u = r.length ? ` style="${r.join(";")}"` : "", d = i?.icon ? `${i.icon} ${
|
|
186
|
-
return f && (d = `<a href="${
|
|
181
|
+
let u = r.length ? ` style="${r.join(";")}"` : "", d = i?.icon ? `${i.icon} ${y(l[e])}` : y(l[e]), f = s?.(c - 1, t);
|
|
182
|
+
return f && (d = `<a href="${y(f)}">${d}</a>`), `<td${u}>${d}</td>`;
|
|
187
183
|
}).join("");
|
|
188
184
|
d.push(`<tr>${u}</tr>`), c > 0 && c % r === 0 && (n.onProgress?.({
|
|
189
185
|
phase: "serialize",
|
|
190
186
|
ratio: c / i,
|
|
191
187
|
row: c,
|
|
192
188
|
total: i
|
|
193
|
-
}), await
|
|
189
|
+
}), await h());
|
|
194
190
|
}
|
|
195
191
|
return n.onProgress?.({
|
|
196
192
|
phase: "serialize",
|
|
197
193
|
ratio: 1,
|
|
198
194
|
row: i,
|
|
199
195
|
total: i
|
|
200
|
-
}), `<!doctype html><html><head><meta charset="utf-8"><title>${
|
|
196
|
+
}), `<!doctype html><html><head><meta charset="utf-8"><title>${y(c)}</title><style>table{border-collapse:collapse;font-family:system-ui,sans-serif;font-size:13px}th,td{border:1px solid #d0d7de;padding:6px 10px}th{background:#f6f8fa;text-align:left}</style></head><body><table><thead><tr>${u}</tr></thead><tbody>${d.join("")}</tbody></table></body></html>`;
|
|
201
197
|
}
|
|
202
|
-
async function
|
|
198
|
+
async function x(e, t, n = {}) {
|
|
203
199
|
let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length - 1, a = [];
|
|
204
200
|
for (let o = 1; o < e.length; o++) {
|
|
205
|
-
|
|
201
|
+
m(n.signal);
|
|
206
202
|
let s = e[o], c = {};
|
|
207
203
|
for (let e of t) c[e] = s[e];
|
|
208
204
|
a.push(c), o > 0 && o % r === 0 && (n.onProgress?.({
|
|
@@ -210,7 +206,7 @@ async function y(e, t, n = {}) {
|
|
|
210
206
|
ratio: o / i,
|
|
211
207
|
row: o,
|
|
212
208
|
total: i
|
|
213
|
-
}), await
|
|
209
|
+
}), await h());
|
|
214
210
|
}
|
|
215
211
|
return n.onProgress?.({
|
|
216
212
|
phase: "serialize",
|
|
@@ -219,23 +215,23 @@ async function y(e, t, n = {}) {
|
|
|
219
215
|
total: i
|
|
220
216
|
}), JSON.stringify(a, null, 2);
|
|
221
217
|
}
|
|
222
|
-
function
|
|
223
|
-
return (e == null ? "" : e instanceof Date ? e
|
|
218
|
+
function S(e) {
|
|
219
|
+
return (e == null ? "" : e instanceof Date ? s(e) : String(e)).replace(/\\/g, "\\\\").replace(/\|/g, "\\|").replace(/\r?\n/g, "<br>");
|
|
224
220
|
}
|
|
225
|
-
async function
|
|
226
|
-
let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length, a = n.align ?? {}, o = e[0], s = `| ${t.map((e) =>
|
|
221
|
+
async function C(e, t, n = {}) {
|
|
222
|
+
let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length, a = n.align ?? {}, o = e[0], s = `| ${t.map((e) => S(o?.[e])).join(" | ")} |`, c = `| ${t.map((e) => {
|
|
227
223
|
let t = a[e];
|
|
228
224
|
return t === "right" ? "---:" : t === "center" ? ":--:" : "---";
|
|
229
225
|
}).join(" | ")} |`, l = [];
|
|
230
226
|
for (let a = 1; a < e.length; a++) {
|
|
231
|
-
|
|
227
|
+
m(n.signal);
|
|
232
228
|
let o = e[a];
|
|
233
|
-
l.push(`| ${t.map((e) =>
|
|
229
|
+
l.push(`| ${t.map((e) => S(o[e])).join(" | ")} |`), a > 0 && a % r === 0 && (n.onProgress?.({
|
|
234
230
|
phase: "serialize",
|
|
235
231
|
ratio: a / i,
|
|
236
232
|
row: a,
|
|
237
233
|
total: i
|
|
238
|
-
}), await
|
|
234
|
+
}), await h());
|
|
239
235
|
}
|
|
240
236
|
return n.onProgress?.({
|
|
241
237
|
phase: "serialize",
|
|
@@ -248,31 +244,31 @@ async function x(e, t, n = {}) {
|
|
|
248
244
|
...l
|
|
249
245
|
].join("\n") + "\n";
|
|
250
246
|
}
|
|
251
|
-
var
|
|
247
|
+
var w = {
|
|
252
248
|
"&": "&",
|
|
253
249
|
"<": "<",
|
|
254
250
|
">": ">",
|
|
255
251
|
"\"": """,
|
|
256
252
|
"'": "'"
|
|
257
253
|
};
|
|
258
|
-
function
|
|
259
|
-
return (e == null ? "" : e instanceof Date ? e
|
|
254
|
+
function T(e) {
|
|
255
|
+
return (e == null ? "" : e instanceof Date ? s(e) : String(e)).replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, "").replace(/[&<>"']/g, (e) => w[e]);
|
|
260
256
|
}
|
|
261
|
-
function
|
|
257
|
+
function E(e) {
|
|
262
258
|
let t = e.replace(/[^A-Za-z0-9_.-]/g, "_");
|
|
263
259
|
return /^[A-Za-z_]/.test(t) ? t : `_${t}`;
|
|
264
260
|
}
|
|
265
|
-
async function
|
|
266
|
-
let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length - 1, a = n.rootTag ?? "rows", o = n.rowTag ?? "row", s = t.map(
|
|
261
|
+
async function D(e, t, n = {}) {
|
|
262
|
+
let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length - 1, a = n.rootTag ?? "rows", o = n.rowTag ?? "row", s = t.map(E), c = ["<?xml version=\"1.0\" encoding=\"UTF-8\"?>", `<${a}>`];
|
|
267
263
|
for (let a = 1; a < e.length; a++) {
|
|
268
|
-
|
|
269
|
-
let l = e[a], u = t.map((e, t) => `<${s[t]}>${
|
|
264
|
+
m(n.signal);
|
|
265
|
+
let l = e[a], u = t.map((e, t) => `<${s[t]}>${T(l[e])}</${s[t]}>`).join("");
|
|
270
266
|
c.push(` <${o}>${u}</${o}>`), a > 0 && a % r === 0 && (n.onProgress?.({
|
|
271
267
|
phase: "serialize",
|
|
272
268
|
ratio: a / i,
|
|
273
269
|
row: a,
|
|
274
270
|
total: i
|
|
275
|
-
}), await
|
|
271
|
+
}), await h());
|
|
276
272
|
}
|
|
277
273
|
return c.push(`</${a}>`), n.onProgress?.({
|
|
278
274
|
phase: "serialize",
|
|
@@ -281,18 +277,18 @@ async function T(e, t, n = {}) {
|
|
|
281
277
|
total: i
|
|
282
278
|
}), c.join("\n");
|
|
283
279
|
}
|
|
284
|
-
function
|
|
280
|
+
function O(e, t) {
|
|
285
281
|
if (typeof document > "u" || typeof URL > "u") throw Error("@svgrid/grid: export requires a browser environment");
|
|
286
282
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
287
283
|
r.href = n, r.download = t, document.body.appendChild(r), r.click(), r.remove(), setTimeout(() => URL.revokeObjectURL(n), 0);
|
|
288
284
|
}
|
|
289
|
-
function
|
|
285
|
+
function k(e, t, n) {
|
|
290
286
|
if (typeof document > "u" || typeof URL > "u") throw Error("@svgrid/grid: text export requires a browser environment");
|
|
291
|
-
|
|
287
|
+
O(new Blob([e], { type: n }), t);
|
|
292
288
|
}
|
|
293
|
-
async function
|
|
289
|
+
async function A(e) {
|
|
294
290
|
if (typeof navigator > "u" || !navigator.clipboard) throw Error("@svgrid/grid: clipboard API is unavailable in this context");
|
|
295
291
|
await navigator.clipboard.writeText(e);
|
|
296
292
|
}
|
|
297
293
|
//#endregion
|
|
298
|
-
export {
|
|
294
|
+
export { a, _ as c, C as d, D as f, k as i, b as l, f as m, A as n, c as o, l as p, O as r, u as s, o as t, x as u };
|