@svgrid/grid 2.2.32 → 2.2.34

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 (91) hide show
  1. package/dist/DockNodeView.svelte +1 -1
  2. package/dist/GridFooter.svelte +46 -47
  3. package/dist/GridMenus.svelte +0 -77
  4. package/dist/SvDateRangeInput.svelte +1 -1
  5. package/dist/SvGrid.css +10 -0
  6. package/dist/SvGrid.svelte +2 -25
  7. package/dist/SvGridChart.svelte +2 -10
  8. package/dist/SvGridSelect.svelte +0 -2
  9. package/dist/SvKbd.svelte +1 -1
  10. package/dist/SvList.svelte +1 -1
  11. package/dist/SvMenubar.svelte +1 -1
  12. package/dist/SvMultiSelect.svelte +0 -1
  13. package/dist/SvOtpInput.svelte +1 -1
  14. package/dist/SvRichText.svelte +4 -0
  15. package/dist/SvTour.svelte +4 -0
  16. package/dist/SvTreeSelect.svelte +0 -2
  17. package/dist/cdn/{GridMenus-Cyk3qpJ7.js → GridMenus-T-bZNprc.js} +153 -152
  18. package/dist/cdn/{GridMenus-C6ixSGWW.js → GridMenus-oQYElQll.js} +5 -7
  19. package/dist/cdn/{SvDateTimePicker-ClqtVIj3.js → SvDateTimePicker-CHnUkWcH.js} +163 -163
  20. package/dist/cdn/{SvDateTimePicker-CdqaP61H.js → SvDateTimePicker-CRQH_U7E.js} +570 -553
  21. package/dist/cdn/{SvGridChart-BhnFdLd0.js → SvGridChart-BEJmNNx9.js} +1 -1
  22. package/dist/cdn/{SvGridChart-BcLCYvw9.js → SvGridChart-BwVos976.js} +27 -20
  23. package/dist/cdn/{SvGridChartPanel-Cmx9DHAS.js → SvGridChartPanel-BOknOkrP.js} +2 -2
  24. package/dist/cdn/{SvGridChartPanel-DvjwxLvK.js → SvGridChartPanel-D2PjII4O.js} +22 -14
  25. package/dist/cdn/{SvGridChartView-PwqI4s02.js → SvGridChartView-00LPUHL1.js} +3 -3
  26. package/dist/cdn/{SvGridChartView-B40DTJSX.js → SvGridChartView-BhUEJ5ki.js} +2 -2
  27. package/dist/cdn/{SvGridDropdown-Dh-2ej8j.js → SvGridDropdown-D13MtJ2j.js} +5 -4
  28. package/dist/cdn/{chart-T1usDN0o.js → chart-i4XcXyHJ.js} +12 -10
  29. package/dist/cdn/disclose-version-Dr7rEVv-.js +2866 -0
  30. package/dist/cdn/{export-format-JT5pWVT8.js → export-format-Cv1Dll6k.js} +66 -245
  31. package/dist/cdn/{src-BgHjWF0Q.js → src-72QTH8lh.js} +9006 -8811
  32. package/dist/cdn/{src-CgD-wiuS.js → src-Cm7C_WOZ.js} +9206 -8927
  33. package/dist/cdn/svgrid.js +9 -9
  34. package/dist/cdn/svgrid.svelte-external.js +8 -8
  35. package/dist/chart.d.ts +2 -0
  36. package/dist/chart.js +1 -4
  37. package/dist/columns.js +9 -2
  38. package/dist/createMenu.svelte.js +0 -1
  39. package/dist/createPopoverSelect.svelte.d.ts +2 -2
  40. package/dist/editing.js +1 -1
  41. package/dist/export-format.js +3 -0
  42. package/dist/selection.js +0 -1
  43. package/package.json +3 -2
  44. package/src/DockNodeView.svelte +1 -1
  45. package/src/GridFooter.svelte +46 -47
  46. package/src/GridMenus.svelte +0 -77
  47. package/src/SvCalendar.test.ts +1 -1
  48. package/src/SvDateRangeInput.svelte +1 -1
  49. package/src/SvGrid.controller.svelte.ts +0 -5
  50. package/src/SvGrid.css +10 -0
  51. package/src/SvGrid.svelte +2 -25
  52. package/src/SvGrid.types.ts +0 -1
  53. package/src/SvGridChart.svelte +2 -10
  54. package/src/SvGridSelect.svelte +0 -2
  55. package/src/SvKbd.svelte +1 -1
  56. package/src/SvList.svelte +1 -1
  57. package/src/SvMenubar.svelte +1 -1
  58. package/src/SvMultiSelect.svelte +0 -1
  59. package/src/SvOtpInput.svelte +1 -1
  60. package/src/SvRichText.svelte +4 -0
  61. package/src/SvTour.svelte +4 -0
  62. package/src/SvTreeSelect.svelte +0 -2
  63. package/src/ai.test.ts +1 -1
  64. package/src/build-api.ts +0 -105
  65. package/src/cell-formatting.test.ts +1 -1
  66. package/src/cell-render.ts +0 -94
  67. package/src/chart.ts +1 -2
  68. package/src/clipboard.ts +0 -102
  69. package/src/columns.ts +7 -117
  70. package/src/createMenu.svelte.ts +0 -1
  71. package/src/editing.ts +2 -105
  72. package/src/editor-registry.grid.test.ts +0 -2
  73. package/src/export-format.ts +3 -0
  74. package/src/features.ts +0 -90
  75. package/src/keyboard-handlers.coverage.test.ts +1 -1
  76. package/src/keyboard-handlers.ts +0 -120
  77. package/src/menus.test.ts +0 -1
  78. package/src/menus.ts +0 -112
  79. package/src/new-features.test.ts +3 -1
  80. package/src/row-drag.test.ts +1 -1
  81. package/src/row-resize.test.ts +1 -2
  82. package/src/scroll-sync.test.ts +4 -7
  83. package/src/scroll-sync.ts +0 -122
  84. package/src/selection.ts +0 -109
  85. package/src/server-group-model.test.ts +2 -2
  86. package/src/summaries.ts +0 -112
  87. package/src/svgrid.behavior.test.ts +0 -1
  88. package/src/svgrid.column-reorder.test.ts +0 -8
  89. package/src/svgrid.footer-pagesize.svelte.test.ts +86 -0
  90. package/src/tree-row-model.test.ts +0 -1
  91. package/dist/cdn/disclose-version-DoD9AFD_.js +0 -2958
@@ -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 S = /* @__PURE__ */ e({
268
- coerceExportDate: () => C,
269
- copyTextToClipboard: () => K,
270
- downloadBlobFile: () => W,
271
- downloadTextFile: () => G,
272
- formatValueForExport: () => w,
273
- projectGridRows: () => E,
274
- serializeDelimited: () => N,
275
- serializeHtml: () => I,
276
- serializeJson: () => L,
277
- serializeMarkdown: () => z,
278
- serializeXml: () => U,
279
- toExcelNumFmt: () => T,
280
- valueForExcel: () => O
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 C(e) {
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 w(e, n) {
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 = C(e);
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 T(e) {
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 `"${D(e.currency ?? "USD")}"#,##0${n(t())}`;
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 E(e, t, n = {}) {
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 : w(r, i.format);
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 D(e) {
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 O(e, t) {
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 = C(e);
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 k = "";
400
- function A(e) {
220
+ var m = "";
221
+ function h(e) {
401
222
  if (e?.aborted) throw new DOMException("Export aborted", "AbortError");
402
223
  }
403
- var j = () => new Promise((e) => setTimeout(e, 0));
404
- function M(e, t) {
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 N(e, t, n = {}) {
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
- A(n.signal);
232
+ h(n.signal);
412
233
  let a = e[i];
413
- c.push(t.map((e) => M(a[e], r)).join(r)), i > 0 && i % o === 0 && (n.onProgress?.({
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 j());
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 ? k : "") + l;
248
+ return (a ? m : "") + l;
428
249
  }
429
- var P = {
250
+ var y = {
430
251
  "&": "&amp;",
431
252
  "<": "&lt;",
432
253
  ">": "&gt;",
433
254
  "\"": "&quot;",
434
255
  "'": "&#39;"
435
256
  };
436
- function F(e) {
437
- return (e == null ? "" : e instanceof Date ? e.toISOString() : String(e)).replace(/[&<>"']/g, (e) => P[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 I(e, t, n = {}) {
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>${F(l[e])}</th>`).join("") : "", d = [];
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
- A(n.signal);
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} ${F(l[e])}` : F(l[e]), f = s?.(c - 1, t);
449
- return f && (d = `<a href="${F(f)}">${d}</a>`), `<td${u}>${d}</td>`;
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 j());
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>${F(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>`;
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 L(e, t, n = {}) {
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
- A(n.signal);
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 j());
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 R(e) {
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 z(e, t, n = {}) {
489
- let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length, a = n.align ?? {}, o = e[0], s = `| ${t.map((e) => R(o?.[e])).join(" | ")} |`, c = `| ${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
- A(n.signal);
315
+ h(n.signal);
495
316
  let o = e[a];
496
- l.push(`| ${t.map((e) => R(o[e])).join(" | ")} |`), a > 0 && a % r === 0 && (n.onProgress?.({
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 j());
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 B = {
335
+ var T = {
515
336
  "&": "&amp;",
516
337
  "<": "&lt;",
517
338
  ">": "&gt;",
518
339
  "\"": "&quot;",
519
340
  "'": "&apos;"
520
341
  };
521
- function V(e) {
522
- return (e == null ? "" : e instanceof Date ? e.toISOString() : String(e)).replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, "").replace(/[&<>"']/g, (e) => B[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 H(e) {
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 U(e, t, n = {}) {
529
- let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length - 1, a = n.rootTag ?? "rows", o = n.rowTag ?? "row", s = t.map(H), c = ["<?xml version=\"1.0\" encoding=\"UTF-8\"?>", `<${a}>`];
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
- A(n.signal);
532
- let l = e[a], u = t.map((e, t) => `<${s[t]}>${V(l[e])}</${s[t]}>`).join("");
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 j());
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 W(e, t) {
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 G(e, t, n) {
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
- W(new Blob([e], { type: n }), t);
375
+ k(new Blob([e], { type: n }), t);
555
376
  }
556
- async function K(e) {
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 { a as C, o as S, b as _, S as a, y as b, N as c, z as d, U as f, p as g, c as h, G as i, I as l, O as m, K as n, w as o, T as p, W as r, E as s, C as t, L as u, x as v, t as w, h as x, m as y };
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 };