@svgrid/grid 2.2.33 → 2.2.35
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/GridFooter.svelte +46 -7
- package/dist/SvGrid.css +10 -0
- package/dist/cdn/{GridMenus-BxmIvCJh.js → GridMenus-T-bZNprc.js} +153 -150
- package/dist/cdn/{GridMenus-B7XhhqdN.js → GridMenus-oQYElQll.js} +4 -4
- package/dist/cdn/{SvDateTimePicker-ClqtVIj3.js → SvDateTimePicker-CHnUkWcH.js} +163 -163
- package/dist/cdn/{SvDateTimePicker-o94wfSUa.js → SvDateTimePicker-CRQH_U7E.js} +570 -553
- package/dist/cdn/{SvGridChart-BhnFdLd0.js → SvGridChart-BEJmNNx9.js} +1 -1
- package/dist/cdn/{SvGridChart-Cr_90pPD.js → SvGridChart-BwVos976.js} +27 -20
- package/dist/cdn/{SvGridChartPanel-Cmx9DHAS.js → SvGridChartPanel-BOknOkrP.js} +2 -2
- package/dist/cdn/{SvGridChartPanel-ICbxiUvK.js → SvGridChartPanel-D2PjII4O.js} +20 -12
- package/dist/cdn/{SvGridChartView-Bx42PMvf.js → SvGridChartView-00LPUHL1.js} +3 -3
- package/dist/cdn/{SvGridChartView-B40DTJSX.js → SvGridChartView-BhUEJ5ki.js} +2 -2
- package/dist/cdn/{SvGridDropdown-CUOdm7YA.js → SvGridDropdown-D13MtJ2j.js} +5 -4
- package/dist/cdn/{chart-T1usDN0o.js → chart-i4XcXyHJ.js} +12 -10
- package/dist/cdn/{disclose-version-DljhZohK.js → disclose-version-Dr7rEVv-.js} +989 -1081
- package/dist/cdn/{export-format-JT5pWVT8.js → export-format-Cv1Dll6k.js} +66 -245
- package/dist/cdn/{src-ktbQVOk-.js → src-72QTH8lh.js} +9004 -8792
- package/dist/cdn/{src-erjBRYfX.js → src-Cm7C_WOZ.js} +9204 -8908
- package/dist/cdn/svgrid.js +9 -9
- package/dist/cdn/svgrid.svelte-external.js +8 -8
- package/dist/columns.js +9 -2
- package/package.json +1 -1
- package/src/GridFooter.svelte +46 -7
- package/src/SvGrid.css +10 -0
- package/src/columns.ts +7 -2
- package/src/svgrid.footer-pagesize.svelte.test.ts +86 -0
|
@@ -84,202 +84,23 @@ function o(e, t) {
|
|
|
84
84
|
return r(i, t.options ?? {}).format(n);
|
|
85
85
|
}
|
|
86
86
|
//#endregion
|
|
87
|
-
//#region src/conditional-formatting.ts
|
|
88
|
-
var s = {
|
|
89
|
-
arrows: [
|
|
90
|
-
"↓",
|
|
91
|
-
"→",
|
|
92
|
-
"↑"
|
|
93
|
-
],
|
|
94
|
-
traffic: [
|
|
95
|
-
"🔴",
|
|
96
|
-
"🟡",
|
|
97
|
-
"🟢"
|
|
98
|
-
],
|
|
99
|
-
triangles: [
|
|
100
|
-
"▼",
|
|
101
|
-
"◆",
|
|
102
|
-
"▲"
|
|
103
|
-
]
|
|
104
|
-
};
|
|
105
|
-
function c(e) {
|
|
106
|
-
let t = Infinity, n = -Infinity, r = !1;
|
|
107
|
-
for (let i of e) {
|
|
108
|
-
if (i == null || i === "") continue;
|
|
109
|
-
let e = Number(i);
|
|
110
|
-
Number.isFinite(e) && (r = !0, e < t && (t = e), e > n && (n = e));
|
|
111
|
-
}
|
|
112
|
-
return r ? {
|
|
113
|
-
min: t,
|
|
114
|
-
max: n
|
|
115
|
-
} : null;
|
|
116
|
-
}
|
|
117
|
-
function l(e, t, n) {
|
|
118
|
-
let r = 0;
|
|
119
|
-
for (let e = 0; e < t.length; e += 1) n >= t[e] && (r = e + 1);
|
|
120
|
-
return e[Math.min(e.length - 1, Math.max(0, r))] ?? e[e.length - 1];
|
|
121
|
-
}
|
|
122
|
-
function u(e) {
|
|
123
|
-
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
124
|
-
}
|
|
125
|
-
function d(e) {
|
|
126
|
-
let t = /^#?([0-9a-f]{6})$/i.exec(e.trim());
|
|
127
|
-
if (!t) return null;
|
|
128
|
-
let n = parseInt(t[1], 16);
|
|
129
|
-
return [
|
|
130
|
-
n >> 16 & 255,
|
|
131
|
-
n >> 8 & 255,
|
|
132
|
-
n & 255
|
|
133
|
-
];
|
|
134
|
-
}
|
|
135
|
-
function f(e) {
|
|
136
|
-
return "#" + e.map((e) => Math.round(u(e / 255) * 255).toString(16).padStart(2, "0")).join("");
|
|
137
|
-
}
|
|
138
|
-
function p(e) {
|
|
139
|
-
let t = d(e);
|
|
140
|
-
if (!t) return null;
|
|
141
|
-
let n = t.map((e) => {
|
|
142
|
-
let t = e / 255;
|
|
143
|
-
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
144
|
-
});
|
|
145
|
-
return .2126 * n[0] + .7152 * n[1] + .0722 * n[2] > .45 ? "#1e293b" : "#ffffff";
|
|
146
|
-
}
|
|
147
|
-
function m(e, t, n) {
|
|
148
|
-
let r = d(e), i = d(t);
|
|
149
|
-
if (!r || !i) return e;
|
|
150
|
-
let a = u(n);
|
|
151
|
-
return f([
|
|
152
|
-
r[0] + (i[0] - r[0]) * a,
|
|
153
|
-
r[1] + (i[1] - r[1]) * a,
|
|
154
|
-
r[2] + (i[2] - r[2]) * a
|
|
155
|
-
]);
|
|
156
|
-
}
|
|
157
|
-
function h(e, t) {
|
|
158
|
-
let n = d(e);
|
|
159
|
-
return n ? `rgba(${n[0]}, ${n[1]}, ${n[2]}, ${u(t).toFixed(3)})` : e;
|
|
160
|
-
}
|
|
161
|
-
function g(e, t) {
|
|
162
|
-
let n = [...e].sort((e, t) => e.offset - t.offset);
|
|
163
|
-
if (n.length === 0) return "#000000";
|
|
164
|
-
if (t <= n[0].offset) return n[0].color;
|
|
165
|
-
let r = n[n.length - 1];
|
|
166
|
-
if (t >= r.offset) return r.color;
|
|
167
|
-
for (let e = 0; e < n.length - 1; e += 1) {
|
|
168
|
-
let r = n[e], i = n[e + 1];
|
|
169
|
-
if (t >= r.offset && t <= i.offset) {
|
|
170
|
-
let e = i.offset - r.offset || 1;
|
|
171
|
-
return m(r.color, i.color, (t - r.offset) / e);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return r.color;
|
|
175
|
-
}
|
|
176
|
-
function _(e, t) {
|
|
177
|
-
if (e.stops && e.stops.length >= 2) return g(e.stops, t);
|
|
178
|
-
let n = e.min ?? "#ffffff", r = e.max ?? "#000000";
|
|
179
|
-
return e.mid ? t <= .5 ? m(n, e.mid, t / .5) : m(e.mid, r, (t - .5) / .5) : m(n, r, t);
|
|
180
|
-
}
|
|
181
|
-
function v(e, t, n, r) {
|
|
182
|
-
let i;
|
|
183
|
-
if (e.compareColumn) {
|
|
184
|
-
let r = Number(n?.[e.compareColumn]);
|
|
185
|
-
if (!Number.isFinite(r) || r === 0) return null;
|
|
186
|
-
i = u(t / r);
|
|
187
|
-
} else if (e.type === "colorScale" && e.zeroCentred) {
|
|
188
|
-
let n = e.minValue ?? r?.min ?? t, a = e.maxValue ?? r?.max ?? t;
|
|
189
|
-
i = u(.5 + t / (Math.max(Math.abs(n), Math.abs(a)) || 1) / 2);
|
|
190
|
-
} else {
|
|
191
|
-
let n = r?.min ?? t, a = r?.max ?? t, o, s;
|
|
192
|
-
if (e.bounds === "percent") {
|
|
193
|
-
let t = a - n;
|
|
194
|
-
o = n + (e.minValue ?? 0) / 100 * t, s = n + (e.maxValue ?? 100) / 100 * t;
|
|
195
|
-
} else o = e.minValue ?? n, s = e.maxValue ?? a;
|
|
196
|
-
i = s === o ? .5 : u((t - o) / (s - o));
|
|
197
|
-
}
|
|
198
|
-
return e.type === "colorScale" && e.reverse && (i = 1 - i), i;
|
|
199
|
-
}
|
|
200
|
-
function y(e, t, n, r, i) {
|
|
201
|
-
let a = {};
|
|
202
|
-
for (let o of r) {
|
|
203
|
-
if (o.columns && !o.columns.includes(n)) continue;
|
|
204
|
-
let r = Number(e);
|
|
205
|
-
if (o.type === "rule") {
|
|
206
|
-
if (o.when({
|
|
207
|
-
value: e,
|
|
208
|
-
row: t
|
|
209
|
-
})) {
|
|
210
|
-
if (o.background && (a.background = o.background, !o.color)) {
|
|
211
|
-
let e = p(o.background);
|
|
212
|
-
e && (a.color = e);
|
|
213
|
-
}
|
|
214
|
-
o.color && (a.color = o.color), o.fontWeight != null && (a.fontWeight = o.fontWeight);
|
|
215
|
-
}
|
|
216
|
-
continue;
|
|
217
|
-
}
|
|
218
|
-
if (!(e == null || e === "" || !Number.isFinite(r))) {
|
|
219
|
-
if (o.type === "colorScale") {
|
|
220
|
-
let n = v(o, r, t, i);
|
|
221
|
-
if (n == null) continue;
|
|
222
|
-
if (o.mode === "alpha") {
|
|
223
|
-
let [e, t] = o.alphaBounds ?? [.05, .85];
|
|
224
|
-
a.background = h(o.base ?? "#2563eb", e + (t - e) * n);
|
|
225
|
-
} else {
|
|
226
|
-
a.background = _(o, n);
|
|
227
|
-
let e = p(a.background);
|
|
228
|
-
e && (a.color = e);
|
|
229
|
-
}
|
|
230
|
-
o.tooltip === "value" ? a.title = String(e) : o.tooltip === "percent" && (a.title = `${Math.round(n * 100)}%`);
|
|
231
|
-
} else if (o.type === "dataBar") {
|
|
232
|
-
let e;
|
|
233
|
-
if (o.compareColumn) {
|
|
234
|
-
let n = v(o, r, t, i);
|
|
235
|
-
if (n == null) continue;
|
|
236
|
-
e = n * 100;
|
|
237
|
-
} else if (o.bounds === "percent") {
|
|
238
|
-
let n = v(o, r, t, i);
|
|
239
|
-
if (n == null) continue;
|
|
240
|
-
e = n * 100;
|
|
241
|
-
} else {
|
|
242
|
-
let t = o.minValue ?? Math.min(0, i?.min ?? 0), n = (o.maxValue ?? i?.max ?? r) - t || 1;
|
|
243
|
-
e = u((r - t) / n) * 100;
|
|
244
|
-
}
|
|
245
|
-
a.dataBar = {
|
|
246
|
-
percent: e,
|
|
247
|
-
color: r < 0 ? o.negativeColor ?? "#ef4444" : o.color,
|
|
248
|
-
fromRight: !1,
|
|
249
|
-
gradient: o.gradient
|
|
250
|
-
}, o.showValue === !1 && (a.color = "transparent");
|
|
251
|
-
} else if (o.type === "iconSet") {
|
|
252
|
-
let e = s[o.set ?? "arrows"];
|
|
253
|
-
a.icon = l(e, o.thresholds, r), o.iconOnly && (a.iconOnly = !0);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
return a;
|
|
258
|
-
}
|
|
259
|
-
function b(e) {
|
|
260
|
-
return (e.type === "colorScale" || e.type === "dataBar") && !("compareColumn" in e && e.compareColumn);
|
|
261
|
-
}
|
|
262
|
-
function x(e) {
|
|
263
|
-
return e.some(b);
|
|
264
|
-
}
|
|
265
|
-
//#endregion
|
|
266
87
|
//#region src/export-format.ts
|
|
267
|
-
var
|
|
268
|
-
coerceExportDate: () =>
|
|
269
|
-
copyTextToClipboard: () =>
|
|
270
|
-
downloadBlobFile: () =>
|
|
271
|
-
downloadTextFile: () =>
|
|
272
|
-
formatValueForExport: () =>
|
|
273
|
-
projectGridRows: () =>
|
|
274
|
-
serializeDelimited: () =>
|
|
275
|
-
serializeHtml: () =>
|
|
276
|
-
serializeJson: () =>
|
|
277
|
-
serializeMarkdown: () =>
|
|
278
|
-
serializeXml: () =>
|
|
279
|
-
toExcelNumFmt: () =>
|
|
280
|
-
valueForExcel: () =>
|
|
88
|
+
var s = /* @__PURE__ */ e({
|
|
89
|
+
coerceExportDate: () => c,
|
|
90
|
+
copyTextToClipboard: () => j,
|
|
91
|
+
downloadBlobFile: () => k,
|
|
92
|
+
downloadTextFile: () => A,
|
|
93
|
+
formatValueForExport: () => l,
|
|
94
|
+
projectGridRows: () => d,
|
|
95
|
+
serializeDelimited: () => v,
|
|
96
|
+
serializeHtml: () => x,
|
|
97
|
+
serializeJson: () => S,
|
|
98
|
+
serializeMarkdown: () => w,
|
|
99
|
+
serializeXml: () => O,
|
|
100
|
+
toExcelNumFmt: () => u,
|
|
101
|
+
valueForExcel: () => p
|
|
281
102
|
});
|
|
282
|
-
function
|
|
103
|
+
function c(e) {
|
|
283
104
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e;
|
|
284
105
|
if (typeof e == "number" && Number.isFinite(e)) {
|
|
285
106
|
let t = new Date(e);
|
|
@@ -291,7 +112,7 @@ function C(e) {
|
|
|
291
112
|
}
|
|
292
113
|
return null;
|
|
293
114
|
}
|
|
294
|
-
function
|
|
115
|
+
function l(e, n) {
|
|
295
116
|
if (e == null) return "";
|
|
296
117
|
if (!n) return String(e);
|
|
297
118
|
if (n.type === "number" || n.type === "currency" || n.type === "percent") return o(e, {
|
|
@@ -302,7 +123,7 @@ function w(e, n) {
|
|
|
302
123
|
options: n.options
|
|
303
124
|
});
|
|
304
125
|
if (n.type === "date" || n.type === "datetime") {
|
|
305
|
-
let r =
|
|
126
|
+
let r = c(e);
|
|
306
127
|
if (r) {
|
|
307
128
|
let e = t(n.pattern, n.type), i = e || n.options ? {
|
|
308
129
|
...e,
|
|
@@ -323,7 +144,7 @@ function w(e, n) {
|
|
|
323
144
|
}
|
|
324
145
|
return String(e);
|
|
325
146
|
}
|
|
326
|
-
function
|
|
147
|
+
function u(e) {
|
|
327
148
|
if (!e) return;
|
|
328
149
|
let t = () => {
|
|
329
150
|
let t = e.options;
|
|
@@ -331,14 +152,14 @@ function T(e) {
|
|
|
331
152
|
}, n = (e) => e > 0 ? "." + "0".repeat(e) : "";
|
|
332
153
|
switch (e.type) {
|
|
333
154
|
case "number": return `#,##0${n(t())}`;
|
|
334
|
-
case "currency": return `"${
|
|
155
|
+
case "currency": return `"${f(e.currency ?? "USD")}"#,##0${n(t())}`;
|
|
335
156
|
case "percent": return `0${n(t())}%`;
|
|
336
157
|
case "date": return "yyyy-mm-dd";
|
|
337
158
|
case "datetime": return "yyyy-mm-dd hh:mm";
|
|
338
159
|
default: return;
|
|
339
160
|
}
|
|
340
161
|
}
|
|
341
|
-
function
|
|
162
|
+
function d(e, t, n = {}) {
|
|
342
163
|
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 = {};
|
|
343
164
|
for (let e of r) e.align && (a[e.field] = e.align);
|
|
344
165
|
let o = {};
|
|
@@ -348,7 +169,7 @@ function E(e, t, n = {}) {
|
|
|
348
169
|
let e = {};
|
|
349
170
|
for (let i of r) {
|
|
350
171
|
let r = t[i.field];
|
|
351
|
-
e[i.field] = n.rawValues ? r :
|
|
172
|
+
e[i.field] = n.rawValues ? r : l(r, i.format);
|
|
352
173
|
}
|
|
353
174
|
s.push(e);
|
|
354
175
|
}
|
|
@@ -358,7 +179,7 @@ function E(e, t, n = {}) {
|
|
|
358
179
|
align: a
|
|
359
180
|
};
|
|
360
181
|
}
|
|
361
|
-
function
|
|
182
|
+
function f(e) {
|
|
362
183
|
return {
|
|
363
184
|
USD: "$",
|
|
364
185
|
EUR: "€",
|
|
@@ -371,7 +192,7 @@ function D(e) {
|
|
|
371
192
|
BRL: "R$"
|
|
372
193
|
}[e.toUpperCase()] ?? e.toUpperCase();
|
|
373
194
|
}
|
|
374
|
-
function
|
|
195
|
+
function p(e, t) {
|
|
375
196
|
if (e == null || !t) return { ok: !1 };
|
|
376
197
|
if (t.type === "number" || t.type === "currency") {
|
|
377
198
|
let t = typeof e == "number" ? e : Number(e);
|
|
@@ -388,7 +209,7 @@ function O(e, t) {
|
|
|
388
209
|
} : { ok: !1 };
|
|
389
210
|
}
|
|
390
211
|
if (t.type === "date" || t.type === "datetime") {
|
|
391
|
-
let t =
|
|
212
|
+
let t = c(e);
|
|
392
213
|
return t ? {
|
|
393
214
|
ok: !0,
|
|
394
215
|
value: t
|
|
@@ -396,26 +217,26 @@ function O(e, t) {
|
|
|
396
217
|
}
|
|
397
218
|
return { ok: !1 };
|
|
398
219
|
}
|
|
399
|
-
var
|
|
400
|
-
function
|
|
220
|
+
var m = "";
|
|
221
|
+
function h(e) {
|
|
401
222
|
if (e?.aborted) throw new DOMException("Export aborted", "AbortError");
|
|
402
223
|
}
|
|
403
|
-
var
|
|
404
|
-
function
|
|
224
|
+
var g = () => new Promise((e) => setTimeout(e, 0));
|
|
225
|
+
function _(e, t) {
|
|
405
226
|
let n = e == null ? "" : e instanceof Date ? e.toISOString() : String(e);
|
|
406
227
|
return n === "" ? n : n.includes(t) || n.includes("\"") || n.includes("\n") || n.includes("\r") ? `"${n.replace(/"/g, "\"\"")}"` : n;
|
|
407
228
|
}
|
|
408
|
-
async function
|
|
229
|
+
async function v(e, t, n = {}) {
|
|
409
230
|
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 = [];
|
|
410
231
|
for (let i = 0; i < e.length; i++) {
|
|
411
|
-
|
|
232
|
+
h(n.signal);
|
|
412
233
|
let a = e[i];
|
|
413
|
-
c.push(t.map((e) =>
|
|
234
|
+
c.push(t.map((e) => _(a[e], r)).join(r)), i > 0 && i % o === 0 && (n.onProgress?.({
|
|
414
235
|
phase: "serialize",
|
|
415
236
|
ratio: i / s,
|
|
416
237
|
row: i,
|
|
417
238
|
total: s
|
|
418
|
-
}), await
|
|
239
|
+
}), await g());
|
|
419
240
|
}
|
|
420
241
|
n.onProgress?.({
|
|
421
242
|
phase: "serialize",
|
|
@@ -424,48 +245,48 @@ async function N(e, t, n = {}) {
|
|
|
424
245
|
total: s
|
|
425
246
|
});
|
|
426
247
|
let l = c.join(i);
|
|
427
|
-
return (a ?
|
|
248
|
+
return (a ? m : "") + l;
|
|
428
249
|
}
|
|
429
|
-
var
|
|
250
|
+
var y = {
|
|
430
251
|
"&": "&",
|
|
431
252
|
"<": "<",
|
|
432
253
|
">": ">",
|
|
433
254
|
"\"": """,
|
|
434
255
|
"'": "'"
|
|
435
256
|
};
|
|
436
|
-
function
|
|
437
|
-
return (e == null ? "" : e instanceof Date ? e.toISOString() : String(e)).replace(/[&<>"']/g, (e) =>
|
|
257
|
+
function b(e) {
|
|
258
|
+
return (e == null ? "" : e instanceof Date ? e.toISOString() : String(e)).replace(/[&<>"']/g, (e) => y[e]);
|
|
438
259
|
}
|
|
439
|
-
async function
|
|
440
|
-
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>${
|
|
260
|
+
async function x(e, t, n = {}) {
|
|
261
|
+
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>${b(l[e])}</th>`).join("") : "", d = [];
|
|
441
262
|
for (let c = 1; c < e.length; c++) {
|
|
442
|
-
|
|
263
|
+
h(n.signal);
|
|
443
264
|
let l = e[c], u = t.map((e, t) => {
|
|
444
265
|
let n = a[e], r = [];
|
|
445
266
|
n && n !== "left" && r.push(`text-align:${n}`);
|
|
446
267
|
let i = o?.(c - 1, t);
|
|
447
268
|
i?.fill && r.push(`background:${i.fill}`), i?.color && r.push(`color:${i.color}`), i?.bold && r.push("font-weight:700");
|
|
448
|
-
let u = r.length ? ` style="${r.join(";")}"` : "", d = i?.icon ? `${i.icon} ${
|
|
449
|
-
return f && (d = `<a href="${
|
|
269
|
+
let u = r.length ? ` style="${r.join(";")}"` : "", d = i?.icon ? `${i.icon} ${b(l[e])}` : b(l[e]), f = s?.(c - 1, t);
|
|
270
|
+
return f && (d = `<a href="${b(f)}">${d}</a>`), `<td${u}>${d}</td>`;
|
|
450
271
|
}).join("");
|
|
451
272
|
d.push(`<tr>${u}</tr>`), c > 0 && c % r === 0 && (n.onProgress?.({
|
|
452
273
|
phase: "serialize",
|
|
453
274
|
ratio: c / i,
|
|
454
275
|
row: c,
|
|
455
276
|
total: i
|
|
456
|
-
}), await
|
|
277
|
+
}), await g());
|
|
457
278
|
}
|
|
458
279
|
return n.onProgress?.({
|
|
459
280
|
phase: "serialize",
|
|
460
281
|
ratio: 1,
|
|
461
282
|
row: i,
|
|
462
283
|
total: i
|
|
463
|
-
}), `<!doctype html><html><head><meta charset="utf-8"><title>${
|
|
284
|
+
}), `<!doctype html><html><head><meta charset="utf-8"><title>${b(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>`;
|
|
464
285
|
}
|
|
465
|
-
async function
|
|
286
|
+
async function S(e, t, n = {}) {
|
|
466
287
|
let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length - 1, a = [];
|
|
467
288
|
for (let o = 1; o < e.length; o++) {
|
|
468
|
-
|
|
289
|
+
h(n.signal);
|
|
469
290
|
let s = e[o], c = {};
|
|
470
291
|
for (let e of t) c[e] = s[e];
|
|
471
292
|
a.push(c), o > 0 && o % r === 0 && (n.onProgress?.({
|
|
@@ -473,7 +294,7 @@ async function L(e, t, n = {}) {
|
|
|
473
294
|
ratio: o / i,
|
|
474
295
|
row: o,
|
|
475
296
|
total: i
|
|
476
|
-
}), await
|
|
297
|
+
}), await g());
|
|
477
298
|
}
|
|
478
299
|
return n.onProgress?.({
|
|
479
300
|
phase: "serialize",
|
|
@@ -482,23 +303,23 @@ async function L(e, t, n = {}) {
|
|
|
482
303
|
total: i
|
|
483
304
|
}), JSON.stringify(a, null, 2);
|
|
484
305
|
}
|
|
485
|
-
function
|
|
306
|
+
function C(e) {
|
|
486
307
|
return (e == null ? "" : e instanceof Date ? e.toISOString() : String(e)).replace(/\\/g, "\\\\").replace(/\|/g, "\\|").replace(/\r?\n/g, "<br>");
|
|
487
308
|
}
|
|
488
|
-
async function
|
|
489
|
-
let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length, a = n.align ?? {}, o = e[0], s = `| ${t.map((e) =>
|
|
309
|
+
async function w(e, t, n = {}) {
|
|
310
|
+
let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length, a = n.align ?? {}, o = e[0], s = `| ${t.map((e) => C(o?.[e])).join(" | ")} |`, c = `| ${t.map((e) => {
|
|
490
311
|
let t = a[e];
|
|
491
312
|
return t === "right" ? "---:" : t === "center" ? ":--:" : "---";
|
|
492
313
|
}).join(" | ")} |`, l = [];
|
|
493
314
|
for (let a = 1; a < e.length; a++) {
|
|
494
|
-
|
|
315
|
+
h(n.signal);
|
|
495
316
|
let o = e[a];
|
|
496
|
-
l.push(`| ${t.map((e) =>
|
|
317
|
+
l.push(`| ${t.map((e) => C(o[e])).join(" | ")} |`), a > 0 && a % r === 0 && (n.onProgress?.({
|
|
497
318
|
phase: "serialize",
|
|
498
319
|
ratio: a / i,
|
|
499
320
|
row: a,
|
|
500
321
|
total: i
|
|
501
|
-
}), await
|
|
322
|
+
}), await g());
|
|
502
323
|
}
|
|
503
324
|
return n.onProgress?.({
|
|
504
325
|
phase: "serialize",
|
|
@@ -511,31 +332,31 @@ async function z(e, t, n = {}) {
|
|
|
511
332
|
...l
|
|
512
333
|
].join("\n") + "\n";
|
|
513
334
|
}
|
|
514
|
-
var
|
|
335
|
+
var T = {
|
|
515
336
|
"&": "&",
|
|
516
337
|
"<": "<",
|
|
517
338
|
">": ">",
|
|
518
339
|
"\"": """,
|
|
519
340
|
"'": "'"
|
|
520
341
|
};
|
|
521
|
-
function
|
|
522
|
-
return (e == null ? "" : e instanceof Date ? e.toISOString() : String(e)).replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, "").replace(/[&<>"']/g, (e) =>
|
|
342
|
+
function E(e) {
|
|
343
|
+
return (e == null ? "" : e instanceof Date ? e.toISOString() : String(e)).replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, "").replace(/[&<>"']/g, (e) => T[e]);
|
|
523
344
|
}
|
|
524
|
-
function
|
|
345
|
+
function D(e) {
|
|
525
346
|
let t = e.replace(/[^A-Za-z0-9_.-]/g, "_");
|
|
526
347
|
return /^[A-Za-z_]/.test(t) ? t : `_${t}`;
|
|
527
348
|
}
|
|
528
|
-
async function
|
|
529
|
-
let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length - 1, a = n.rootTag ?? "rows", o = n.rowTag ?? "row", s = t.map(
|
|
349
|
+
async function O(e, t, n = {}) {
|
|
350
|
+
let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length - 1, a = n.rootTag ?? "rows", o = n.rowTag ?? "row", s = t.map(D), c = ["<?xml version=\"1.0\" encoding=\"UTF-8\"?>", `<${a}>`];
|
|
530
351
|
for (let a = 1; a < e.length; a++) {
|
|
531
|
-
|
|
532
|
-
let l = e[a], u = t.map((e, t) => `<${s[t]}>${
|
|
352
|
+
h(n.signal);
|
|
353
|
+
let l = e[a], u = t.map((e, t) => `<${s[t]}>${E(l[e])}</${s[t]}>`).join("");
|
|
533
354
|
c.push(` <${o}>${u}</${o}>`), a > 0 && a % r === 0 && (n.onProgress?.({
|
|
534
355
|
phase: "serialize",
|
|
535
356
|
ratio: a / i,
|
|
536
357
|
row: a,
|
|
537
358
|
total: i
|
|
538
|
-
}), await
|
|
359
|
+
}), await g());
|
|
539
360
|
}
|
|
540
361
|
return c.push(`</${a}>`), n.onProgress?.({
|
|
541
362
|
phase: "serialize",
|
|
@@ -544,18 +365,18 @@ async function U(e, t, n = {}) {
|
|
|
544
365
|
total: i
|
|
545
366
|
}), c.join("\n");
|
|
546
367
|
}
|
|
547
|
-
function
|
|
368
|
+
function k(e, t) {
|
|
548
369
|
if (typeof document > "u" || typeof URL > "u") throw Error("@svgrid/grid: export requires a browser environment");
|
|
549
370
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
550
371
|
r.href = n, r.download = t, document.body.appendChild(r), r.click(), r.remove(), setTimeout(() => URL.revokeObjectURL(n), 0);
|
|
551
372
|
}
|
|
552
|
-
function
|
|
373
|
+
function A(e, t, n) {
|
|
553
374
|
if (typeof document > "u" || typeof URL > "u") throw Error("@svgrid/grid: text export requires a browser environment");
|
|
554
|
-
|
|
375
|
+
k(new Blob([e], { type: n }), t);
|
|
555
376
|
}
|
|
556
|
-
async function
|
|
377
|
+
async function j(e) {
|
|
557
378
|
if (typeof navigator > "u" || !navigator.clipboard) throw Error("@svgrid/grid: clipboard API is unavailable in this context");
|
|
558
379
|
await navigator.clipboard.writeText(e);
|
|
559
380
|
}
|
|
560
381
|
//#endregion
|
|
561
|
-
export {
|
|
382
|
+
export { t as _, s as a, v as c, w as d, O as f, a as g, o as h, A as i, x as l, p as m, j as n, l as o, u as p, k as r, d as s, c as t, S as u };
|