@svgrid/grid 3.0.1 → 3.0.2

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.
Files changed (77) hide show
  1. package/dist/GridFooter.svelte +14 -5
  2. package/dist/GridFooter.svelte.d.ts +8 -0
  3. package/dist/GridMenus.svelte +18 -10
  4. package/dist/GridMenus.svelte.d.ts +2 -1
  5. package/dist/SvGrid.controller.svelte.d.ts +17 -0
  6. package/dist/SvGrid.controller.svelte.js +128 -14
  7. package/dist/SvGrid.css +79 -10
  8. package/dist/SvGrid.svelte +191 -186
  9. package/dist/SvGrid.types.d.ts +42 -1
  10. package/dist/SvGridChart.svelte +571 -41
  11. package/dist/SvGridChart.svelte.d.ts +63 -1
  12. package/dist/SvGridChartPanel.svelte +169 -21
  13. package/dist/SvGridChartView.svelte +9 -0
  14. package/dist/SvGridChartView.svelte.d.ts +7 -0
  15. package/dist/SvGroupCell.svelte +28 -3
  16. package/dist/SvGroupCell.svelte.d.ts +8 -0
  17. package/dist/SvRowGroupPanel.svelte +20 -4
  18. package/dist/SvRowGroupPanel.svelte.d.ts +8 -0
  19. package/dist/ai.d.ts +11 -2
  20. package/dist/ai.js +51 -7
  21. package/dist/cdn/GridMenus-DyFA-QxA.js +602 -0
  22. package/dist/cdn/{GridMenus-DFB6iwF8.js → GridMenus-M2XP9t0_.js} +152 -150
  23. package/dist/cdn/SvGridChart-DAb9RbRs.js +1480 -0
  24. package/dist/cdn/SvGridChart-Yl-IXZFO.js +1481 -0
  25. package/dist/cdn/SvGridChartPanel-DayQpDsR.js +834 -0
  26. package/dist/cdn/SvGridChartPanel-aqf8n-vJ.js +810 -0
  27. package/dist/cdn/{SvGridChartView-BhUEJ5ki.js → SvGridChartView-CxfakxR0.js} +5 -3
  28. package/dist/cdn/{SvGridChartView-00LPUHL1.js → SvGridChartView-Dm_YEx9L.js} +5 -3
  29. package/dist/cdn/cell-formatting-C2Hf5gqd.js +86 -0
  30. package/dist/cdn/chart-CKJRCPOk.js +1652 -0
  31. package/dist/cdn/{export-format-Cv1Dll6k.js → export-format-CUDLy2yn.js} +84 -168
  32. package/dist/cdn/{src-C8QjSaq-.js → src-BJ2opd0j.js} +3608 -3414
  33. package/dist/cdn/{src-D0hO2eYN.js → src-DNbz94Ct.js} +8617 -8423
  34. package/dist/cdn/svgrid.js +16 -15
  35. package/dist/cdn/svgrid.svelte-external.js +16 -15
  36. package/dist/cell-formatting.d.ts +7 -0
  37. package/dist/cell-formatting.js +7 -1
  38. package/dist/chart-export.d.ts +23 -2
  39. package/dist/chart-export.js +80 -6
  40. package/dist/chart.d.ts +410 -18
  41. package/dist/chart.js +824 -24
  42. package/dist/grid-icons.d.ts +49 -0
  43. package/dist/grid-icons.js +86 -0
  44. package/dist/index.d.ts +3 -2
  45. package/dist/index.js +3 -2
  46. package/package.json +11 -11
  47. package/src/GridFooter.svelte +14 -5
  48. package/src/GridMenus.svelte +18 -10
  49. package/src/SvGrid.controller.svelte.ts +146 -13
  50. package/src/SvGrid.css +79 -10
  51. package/src/SvGrid.svelte +191 -186
  52. package/src/SvGrid.types.ts +42 -1
  53. package/src/SvGridChart.svelte +571 -41
  54. package/src/SvGridChart.test.ts +243 -1
  55. package/src/SvGridChartPanel.svelte +169 -21
  56. package/src/SvGridChartView.svelte +9 -0
  57. package/src/SvGroupCell.svelte +28 -3
  58. package/src/SvRowGroupPanel.svelte +20 -4
  59. package/src/ai.test.ts +60 -1
  60. package/src/ai.ts +59 -6
  61. package/src/cell-formatting.ts +7 -1
  62. package/src/chart-export.test.ts +112 -0
  63. package/src/chart-export.ts +76 -8
  64. package/src/chart.test.ts +830 -1
  65. package/src/chart.ts +1053 -32
  66. package/src/grid-icons.test.ts +46 -0
  67. package/src/grid-icons.ts +184 -0
  68. package/src/icon-overrides.grid.test.ts +188 -0
  69. package/src/icon-seam.test.ts +100 -0
  70. package/src/index.ts +19 -0
  71. package/src/svgrid.charting.test.ts +120 -0
  72. package/dist/cdn/GridMenus-CYzOvmNQ.js +0 -600
  73. package/dist/cdn/SvGridChart-BEJmNNx9.js +0 -1203
  74. package/dist/cdn/SvGridChart-BwVos976.js +0 -1202
  75. package/dist/cdn/SvGridChartPanel-BOknOkrP.js +0 -561
  76. package/dist/cdn/SvGridChartPanel-D2PjII4O.js +0 -585
  77. package/dist/cdn/chart-i4XcXyHJ.js +0 -1214
@@ -1,106 +1,22 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- //#region src/cell-formatting.ts
3
- function t(e, t) {
4
- if (e) switch (e.trim()) {
5
- case "d": return t === "datetime" ? {
6
- year: "numeric",
7
- month: "numeric",
8
- day: "numeric",
9
- hour: "numeric",
10
- minute: "numeric"
11
- } : {
12
- year: "numeric",
13
- month: "numeric",
14
- day: "numeric"
15
- };
16
- case "D": return t === "datetime" ? {
17
- weekday: "long",
18
- year: "numeric",
19
- month: "long",
20
- day: "numeric",
21
- hour: "numeric",
22
- minute: "numeric"
23
- } : {
24
- weekday: "long",
25
- year: "numeric",
26
- month: "long",
27
- day: "numeric"
28
- };
29
- case "y-m-d": return t === "datetime" ? {
30
- year: "numeric",
31
- month: "2-digit",
32
- day: "2-digit",
33
- hour: "2-digit",
34
- minute: "2-digit",
35
- hour12: !1
36
- } : {
37
- year: "numeric",
38
- month: "2-digit",
39
- day: "2-digit"
40
- };
41
- case "medium": return {
42
- dateStyle: "medium",
43
- timeStyle: t === "datetime" ? "short" : void 0
44
- };
45
- case "short": return {
46
- dateStyle: "short",
47
- timeStyle: t === "datetime" ? "short" : void 0
48
- };
49
- case "long": return {
50
- dateStyle: "long",
51
- timeStyle: t === "datetime" ? "short" : void 0
52
- };
53
- default: return;
54
- }
55
- }
56
- var n = /* @__PURE__ */ new Map();
57
- function r(e, t) {
58
- let r = (Array.isArray(e) ? e.join(",") : e ?? "") + "|" + (t.style ?? "") + "|" + (t.currency ?? "") + "|" + (t.minimumFractionDigits ?? "") + "|" + (t.maximumFractionDigits ?? "") + "|" + (t.useGrouping ?? "") + "|" + (t.currencyDisplay ?? "") + "|" + (t.notation ?? ""), i = n.get(r);
59
- return i || (i = new Intl.NumberFormat(e, t), n.set(r, i)), i;
60
- }
61
- var i = /* @__PURE__ */ new Map();
62
- function a(e, t) {
63
- let n = (Array.isArray(e) ? e.join(",") : e ?? "") + "|" + (t.dateStyle ?? "") + "|" + (t.timeStyle ?? "") + "|" + (t.year ?? "") + "|" + (t.month ?? "") + "|" + (t.day ?? "") + "|" + (t.hour ?? "") + "|" + (t.minute ?? "") + "|" + (t.second ?? "") + "|" + (t.weekday ?? "") + "|" + (t.hour12 ?? ""), r = i.get(n);
64
- return r || (r = new Intl.DateTimeFormat(e, t), i.set(n, r)), r;
65
- }
66
- function o(e, t) {
67
- let n = typeof e == "number" ? e : Number(e);
68
- if (!Number.isFinite(n)) return String(e ?? "");
69
- let i = t.locales;
70
- if (t.type === "currency") return r(i, {
71
- style: "currency",
72
- currency: t.currency ?? "USD",
73
- ...t.options
74
- }).format(n);
75
- if (t.type === "percent") {
76
- let e = t.valueIsPercentPoints === !0 ? n / 100 : n;
77
- return r(i, {
78
- style: "percent",
79
- minimumFractionDigits: 0,
80
- maximumFractionDigits: 2,
81
- ...t.options
82
- }).format(e);
83
- }
84
- return r(i, t.options ?? {}).format(n);
85
- }
86
- //#endregion
2
+ import { i as t, n, t as r } from "./cell-formatting-C2Hf5gqd.js";
87
3
  //#region src/export-format.ts
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
4
+ var i = /* @__PURE__ */ e({
5
+ coerceExportDate: () => a,
6
+ copyTextToClipboard: () => O,
7
+ downloadBlobFile: () => E,
8
+ downloadTextFile: () => D,
9
+ formatValueForExport: () => o,
10
+ projectGridRows: () => c,
11
+ serializeDelimited: () => h,
12
+ serializeHtml: () => v,
13
+ serializeJson: () => y,
14
+ serializeMarkdown: () => x,
15
+ serializeXml: () => T,
16
+ toExcelNumFmt: () => s,
17
+ valueForExcel: () => u
102
18
  });
103
- function c(e) {
19
+ function a(e) {
104
20
  if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e;
105
21
  if (typeof e == "number" && Number.isFinite(e)) {
106
22
  let t = new Date(e);
@@ -112,23 +28,23 @@ function c(e) {
112
28
  }
113
29
  return null;
114
30
  }
115
- function l(e, n) {
31
+ function o(e, i) {
116
32
  if (e == null) return "";
117
- if (!n) return String(e);
118
- if (n.type === "number" || n.type === "currency" || n.type === "percent") return o(e, {
119
- type: n.type,
120
- locales: n.locales,
121
- currency: n.type === "currency" ? n.currency ?? "USD" : void 0,
122
- valueIsPercentPoints: n.type === "percent" ? n.valueIsPercentPoints : void 0,
123
- options: n.options
33
+ if (!i) return String(e);
34
+ if (i.type === "number" || i.type === "currency" || i.type === "percent") return r(e, {
35
+ type: i.type,
36
+ locales: i.locales,
37
+ currency: i.type === "currency" ? i.currency ?? "USD" : void 0,
38
+ valueIsPercentPoints: i.type === "percent" ? i.valueIsPercentPoints : void 0,
39
+ options: i.options
124
40
  });
125
- if (n.type === "date" || n.type === "datetime") {
126
- let r = c(e);
41
+ if (i.type === "date" || i.type === "datetime") {
42
+ let r = a(e);
127
43
  if (r) {
128
- let e = t(n.pattern, n.type), i = e || n.options ? {
44
+ let e = t(i.pattern, i.type), a = e || i.options ? {
129
45
  ...e,
130
- ...n.options
131
- } : n.type === "date" ? {
46
+ ...i.options
47
+ } : i.type === "date" ? {
132
48
  year: "numeric",
133
49
  month: "2-digit",
134
50
  day: "2-digit"
@@ -139,12 +55,12 @@ function l(e, n) {
139
55
  hour: "2-digit",
140
56
  minute: "2-digit"
141
57
  };
142
- return a(n.locales, i).format(r);
58
+ return n(i.locales, a).format(r);
143
59
  }
144
60
  }
145
61
  return String(e);
146
62
  }
147
- function u(e) {
63
+ function s(e) {
148
64
  if (!e) return;
149
65
  let t = () => {
150
66
  let t = e.options;
@@ -152,34 +68,34 @@ function u(e) {
152
68
  }, n = (e) => e > 0 ? "." + "0".repeat(e) : "";
153
69
  switch (e.type) {
154
70
  case "number": return `#,##0${n(t())}`;
155
- case "currency": return `"${f(e.currency ?? "USD")}"#,##0${n(t())}`;
71
+ case "currency": return `"${l(e.currency ?? "USD")}"#,##0${n(t())}`;
156
72
  case "percent": return `0${n(t())}%`;
157
73
  case "date": return "yyyy-mm-dd";
158
74
  case "datetime": return "yyyy-mm-dd hh:mm";
159
75
  default: return;
160
76
  }
161
77
  }
162
- function d(e, t, n = {}) {
78
+ function c(e, t, n = {}) {
163
79
  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 = {};
164
80
  for (let e of r) e.align && (a[e.field] = e.align);
165
- let o = {};
166
- for (let e of r) o[e.field] = e.header;
167
- let s = [o];
81
+ let s = {};
82
+ for (let e of r) s[e.field] = e.header;
83
+ let c = [s];
168
84
  for (let t of e) {
169
85
  let e = {};
170
86
  for (let i of r) {
171
87
  let r = t[i.field];
172
- e[i.field] = n.rawValues ? r : l(r, i.format);
88
+ e[i.field] = n.rawValues ? r : o(r, i.format);
173
89
  }
174
- s.push(e);
90
+ c.push(e);
175
91
  }
176
92
  return {
177
- records: s,
93
+ records: c,
178
94
  fields: i,
179
95
  align: a
180
96
  };
181
97
  }
182
- function f(e) {
98
+ function l(e) {
183
99
  return {
184
100
  USD: "$",
185
101
  EUR: "€",
@@ -192,7 +108,7 @@ function f(e) {
192
108
  BRL: "R$"
193
109
  }[e.toUpperCase()] ?? e.toUpperCase();
194
110
  }
195
- function p(e, t) {
111
+ function u(e, t) {
196
112
  if (e == null || !t) return { ok: !1 };
197
113
  if (t.type === "number" || t.type === "currency") {
198
114
  let t = typeof e == "number" ? e : Number(e);
@@ -209,7 +125,7 @@ function p(e, t) {
209
125
  } : { ok: !1 };
210
126
  }
211
127
  if (t.type === "date" || t.type === "datetime") {
212
- let t = c(e);
128
+ let t = a(e);
213
129
  return t ? {
214
130
  ok: !0,
215
131
  value: t
@@ -217,26 +133,26 @@ function p(e, t) {
217
133
  }
218
134
  return { ok: !1 };
219
135
  }
220
- var m = "";
221
- function h(e) {
136
+ var d = "";
137
+ function f(e) {
222
138
  if (e?.aborted) throw new DOMException("Export aborted", "AbortError");
223
139
  }
224
- var g = () => new Promise((e) => setTimeout(e, 0));
225
- function _(e, t) {
140
+ var p = () => new Promise((e) => setTimeout(e, 0));
141
+ function m(e, t) {
226
142
  let n = e == null ? "" : e instanceof Date ? e.toISOString() : String(e);
227
143
  return n === "" ? n : n.includes(t) || n.includes("\"") || n.includes("\n") || n.includes("\r") ? `"${n.replace(/"/g, "\"\"")}"` : n;
228
144
  }
229
- async function v(e, t, n = {}) {
145
+ async function h(e, t, n = {}) {
230
146
  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 = [];
231
147
  for (let i = 0; i < e.length; i++) {
232
- h(n.signal);
148
+ f(n.signal);
233
149
  let a = e[i];
234
- c.push(t.map((e) => _(a[e], r)).join(r)), i > 0 && i % o === 0 && (n.onProgress?.({
150
+ c.push(t.map((e) => m(a[e], r)).join(r)), i > 0 && i % o === 0 && (n.onProgress?.({
235
151
  phase: "serialize",
236
152
  ratio: i / s,
237
153
  row: i,
238
154
  total: s
239
- }), await g());
155
+ }), await p());
240
156
  }
241
157
  n.onProgress?.({
242
158
  phase: "serialize",
@@ -245,48 +161,48 @@ async function v(e, t, n = {}) {
245
161
  total: s
246
162
  });
247
163
  let l = c.join(i);
248
- return (a ? m : "") + l;
164
+ return (a ? d : "") + l;
249
165
  }
250
- var y = {
166
+ var g = {
251
167
  "&": "&amp;",
252
168
  "<": "&lt;",
253
169
  ">": "&gt;",
254
170
  "\"": "&quot;",
255
171
  "'": "&#39;"
256
172
  };
257
- function b(e) {
258
- return (e == null ? "" : e instanceof Date ? e.toISOString() : String(e)).replace(/[&<>"']/g, (e) => y[e]);
173
+ function _(e) {
174
+ return (e == null ? "" : e instanceof Date ? e.toISOString() : String(e)).replace(/[&<>"']/g, (e) => g[e]);
259
175
  }
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 = [];
176
+ async function v(e, t, n = {}) {
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>${_(l[e])}</th>`).join("") : "", d = [];
262
178
  for (let c = 1; c < e.length; c++) {
263
- h(n.signal);
179
+ f(n.signal);
264
180
  let l = e[c], u = t.map((e, t) => {
265
181
  let n = a[e], r = [];
266
182
  n && n !== "left" && r.push(`text-align:${n}`);
267
183
  let i = o?.(c - 1, t);
268
184
  i?.fill && r.push(`background:${i.fill}`), i?.color && r.push(`color:${i.color}`), i?.bold && r.push("font-weight:700");
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>`;
185
+ let u = r.length ? ` style="${r.join(";")}"` : "", d = i?.icon ? `${i.icon} ${_(l[e])}` : _(l[e]), f = s?.(c - 1, t);
186
+ return f && (d = `<a href="${_(f)}">${d}</a>`), `<td${u}>${d}</td>`;
271
187
  }).join("");
272
188
  d.push(`<tr>${u}</tr>`), c > 0 && c % r === 0 && (n.onProgress?.({
273
189
  phase: "serialize",
274
190
  ratio: c / i,
275
191
  row: c,
276
192
  total: i
277
- }), await g());
193
+ }), await p());
278
194
  }
279
195
  return n.onProgress?.({
280
196
  phase: "serialize",
281
197
  ratio: 1,
282
198
  row: i,
283
199
  total: i
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>`;
200
+ }), `<!doctype html><html><head><meta charset="utf-8"><title>${_(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>`;
285
201
  }
286
- async function S(e, t, n = {}) {
202
+ async function y(e, t, n = {}) {
287
203
  let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length - 1, a = [];
288
204
  for (let o = 1; o < e.length; o++) {
289
- h(n.signal);
205
+ f(n.signal);
290
206
  let s = e[o], c = {};
291
207
  for (let e of t) c[e] = s[e];
292
208
  a.push(c), o > 0 && o % r === 0 && (n.onProgress?.({
@@ -294,7 +210,7 @@ async function S(e, t, n = {}) {
294
210
  ratio: o / i,
295
211
  row: o,
296
212
  total: i
297
- }), await g());
213
+ }), await p());
298
214
  }
299
215
  return n.onProgress?.({
300
216
  phase: "serialize",
@@ -303,23 +219,23 @@ async function S(e, t, n = {}) {
303
219
  total: i
304
220
  }), JSON.stringify(a, null, 2);
305
221
  }
306
- function C(e) {
222
+ function b(e) {
307
223
  return (e == null ? "" : e instanceof Date ? e.toISOString() : String(e)).replace(/\\/g, "\\\\").replace(/\|/g, "\\|").replace(/\r?\n/g, "<br>");
308
224
  }
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) => {
225
+ async function x(e, t, n = {}) {
226
+ let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length, a = n.align ?? {}, o = e[0], s = `| ${t.map((e) => b(o?.[e])).join(" | ")} |`, c = `| ${t.map((e) => {
311
227
  let t = a[e];
312
228
  return t === "right" ? "---:" : t === "center" ? ":--:" : "---";
313
229
  }).join(" | ")} |`, l = [];
314
230
  for (let a = 1; a < e.length; a++) {
315
- h(n.signal);
231
+ f(n.signal);
316
232
  let o = e[a];
317
- l.push(`| ${t.map((e) => C(o[e])).join(" | ")} |`), a > 0 && a % r === 0 && (n.onProgress?.({
233
+ l.push(`| ${t.map((e) => b(o[e])).join(" | ")} |`), a > 0 && a % r === 0 && (n.onProgress?.({
318
234
  phase: "serialize",
319
235
  ratio: a / i,
320
236
  row: a,
321
237
  total: i
322
- }), await g());
238
+ }), await p());
323
239
  }
324
240
  return n.onProgress?.({
325
241
  phase: "serialize",
@@ -332,31 +248,31 @@ async function w(e, t, n = {}) {
332
248
  ...l
333
249
  ].join("\n") + "\n";
334
250
  }
335
- var T = {
251
+ var S = {
336
252
  "&": "&amp;",
337
253
  "<": "&lt;",
338
254
  ">": "&gt;",
339
255
  "\"": "&quot;",
340
256
  "'": "&apos;"
341
257
  };
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]);
258
+ function C(e) {
259
+ return (e == null ? "" : e instanceof Date ? e.toISOString() : String(e)).replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, "").replace(/[&<>"']/g, (e) => S[e]);
344
260
  }
345
- function D(e) {
261
+ function w(e) {
346
262
  let t = e.replace(/[^A-Za-z0-9_.-]/g, "_");
347
263
  return /^[A-Za-z_]/.test(t) ? t : `_${t}`;
348
264
  }
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}>`];
265
+ async function T(e, t, n = {}) {
266
+ let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length - 1, a = n.rootTag ?? "rows", o = n.rowTag ?? "row", s = t.map(w), c = ["<?xml version=\"1.0\" encoding=\"UTF-8\"?>", `<${a}>`];
351
267
  for (let a = 1; a < e.length; a++) {
352
- h(n.signal);
353
- let l = e[a], u = t.map((e, t) => `<${s[t]}>${E(l[e])}</${s[t]}>`).join("");
268
+ f(n.signal);
269
+ let l = e[a], u = t.map((e, t) => `<${s[t]}>${C(l[e])}</${s[t]}>`).join("");
354
270
  c.push(` <${o}>${u}</${o}>`), a > 0 && a % r === 0 && (n.onProgress?.({
355
271
  phase: "serialize",
356
272
  ratio: a / i,
357
273
  row: a,
358
274
  total: i
359
- }), await g());
275
+ }), await p());
360
276
  }
361
277
  return c.push(`</${a}>`), n.onProgress?.({
362
278
  phase: "serialize",
@@ -365,18 +281,18 @@ async function O(e, t, n = {}) {
365
281
  total: i
366
282
  }), c.join("\n");
367
283
  }
368
- function k(e, t) {
284
+ function E(e, t) {
369
285
  if (typeof document > "u" || typeof URL > "u") throw Error("@svgrid/grid: export requires a browser environment");
370
286
  let n = URL.createObjectURL(e), r = document.createElement("a");
371
287
  r.href = n, r.download = t, document.body.appendChild(r), r.click(), r.remove(), setTimeout(() => URL.revokeObjectURL(n), 0);
372
288
  }
373
- function A(e, t, n) {
289
+ function D(e, t, n) {
374
290
  if (typeof document > "u" || typeof URL > "u") throw Error("@svgrid/grid: text export requires a browser environment");
375
- k(new Blob([e], { type: n }), t);
291
+ E(new Blob([e], { type: n }), t);
376
292
  }
377
- async function j(e) {
293
+ async function O(e) {
378
294
  if (typeof navigator > "u" || !navigator.clipboard) throw Error("@svgrid/grid: clipboard API is unavailable in this context");
379
295
  await navigator.clipboard.writeText(e);
380
296
  }
381
297
  //#endregion
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 };
298
+ export { i as a, h as c, x as d, T as f, D as i, v as l, u as m, O as n, o, s as p, E as r, c as s, a as t, y as u };