@toolbox-web/grid 1.3.0 → 1.4.0
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/all.d.ts +1 -0
- package/all.d.ts.map +1 -1
- package/all.js +997 -710
- package/all.js.map +1 -1
- package/index.js +642 -599
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/header.d.ts +7 -0
- package/lib/core/internal/header.d.ts.map +1 -1
- package/lib/core/types.d.ts +151 -0
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +19 -16
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js +42 -39
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js +25 -22
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
- package/lib/plugins/editing/index.js +53 -48
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js +23 -20
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts +11 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
- package/lib/plugins/filtering/index.js +186 -150
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js +21 -18
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js +67 -64
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js +52 -49
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js +18 -15
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js +25 -22
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js +26 -23
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js +50 -47
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/print/PrintPlugin.d.ts +98 -0
- package/lib/plugins/print/PrintPlugin.d.ts.map +1 -0
- package/lib/plugins/print/index.d.ts +10 -0
- package/lib/plugins/print/index.d.ts.map +1 -0
- package/lib/plugins/print/index.js +626 -0
- package/lib/plugins/print/index.js.map +1 -0
- package/lib/plugins/print/print-isolated.d.ts +26 -0
- package/lib/plugins/print/print-isolated.d.ts.map +1 -0
- package/lib/plugins/print/types.d.ts +147 -0
- package/lib/plugins/print/types.d.ts.map +1 -0
- package/lib/plugins/reorder/index.js +25 -22
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js +20 -17
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js +39 -36
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +115 -101
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js +35 -32
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js +26 -23
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js +23 -20
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js +22 -19
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/public.d.ts +1 -1
- package/public.d.ts.map +1 -1
- package/umd/grid.all.umd.js +98 -24
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +11 -11
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/editing.umd.js +1 -1
- package/umd/plugins/editing.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js +1 -1
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/print.umd.js +76 -0
- package/umd/plugins/print.umd.js.map +1 -0
- package/umd/plugins/selection.umd.js +2 -2
- package/umd/plugins/selection.umd.js.map +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const m = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentColor" d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>', x = {
|
|
2
2
|
expand: "▶",
|
|
3
3
|
collapse: "▼",
|
|
4
4
|
sortAsc: "▲",
|
|
@@ -6,9 +6,12 @@ const w = {
|
|
|
6
6
|
sortNone: "⇅",
|
|
7
7
|
submenuArrow: "▶",
|
|
8
8
|
dragHandle: "⋮⋮",
|
|
9
|
-
toolPanel: "☰"
|
|
9
|
+
toolPanel: "☰",
|
|
10
|
+
filter: m,
|
|
11
|
+
filterActive: m,
|
|
12
|
+
print: "🖨️"
|
|
10
13
|
};
|
|
11
|
-
class
|
|
14
|
+
class C {
|
|
12
15
|
/**
|
|
13
16
|
* Plugin dependencies - declare other plugins this one requires.
|
|
14
17
|
*
|
|
@@ -232,7 +235,7 @@ class x {
|
|
|
232
235
|
*/
|
|
233
236
|
get gridIcons() {
|
|
234
237
|
const e = this.grid?.gridConfig?.icons ?? {};
|
|
235
|
-
return { ...
|
|
238
|
+
return { ...x, ...e };
|
|
236
239
|
}
|
|
237
240
|
// #region Animation Helpers
|
|
238
241
|
/**
|
|
@@ -308,7 +311,7 @@ class x {
|
|
|
308
311
|
}
|
|
309
312
|
// #endregion
|
|
310
313
|
}
|
|
311
|
-
function
|
|
314
|
+
function b(i, e = !0) {
|
|
312
315
|
if (i == null) return "";
|
|
313
316
|
if (i instanceof Date) return i.toISOString();
|
|
314
317
|
if (typeof i == "object") return JSON.stringify(i);
|
|
@@ -316,20 +319,20 @@ function m(i, e = !0) {
|
|
|
316
319
|
return e && (t.includes(",") || t.includes('"') || t.includes(`
|
|
317
320
|
`) || t.includes("\r")) ? `"${t.replace(/"/g, '""')}"` : t;
|
|
318
321
|
}
|
|
319
|
-
function
|
|
322
|
+
function E(i, e, t, n = {}) {
|
|
320
323
|
const c = n.delimiter ?? ",", l = n.newline ?? `
|
|
321
324
|
`, o = [], r = n.bom ? "\uFEFF" : "";
|
|
322
325
|
if (t.includeHeaders !== !1) {
|
|
323
326
|
const s = e.map((a) => {
|
|
324
327
|
const d = a.header || a.field, u = t.processHeader ? t.processHeader(d, a.field) : d;
|
|
325
|
-
return
|
|
328
|
+
return b(u);
|
|
326
329
|
});
|
|
327
330
|
o.push(s.join(c));
|
|
328
331
|
}
|
|
329
332
|
for (const s of i) {
|
|
330
333
|
const a = e.map((d) => {
|
|
331
334
|
let u = s[d.field];
|
|
332
|
-
return t.processCell && (u = t.processCell(u, d.field, s)),
|
|
335
|
+
return t.processCell && (u = t.processCell(u, d.field, s)), b(u);
|
|
333
336
|
});
|
|
334
337
|
o.push(a.join(c));
|
|
335
338
|
}
|
|
@@ -339,14 +342,14 @@ function h(i, e) {
|
|
|
339
342
|
const t = URL.createObjectURL(i), n = document.createElement("a");
|
|
340
343
|
n.href = t, n.download = e, n.style.display = "none", document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(t);
|
|
341
344
|
}
|
|
342
|
-
function
|
|
345
|
+
function S(i, e) {
|
|
343
346
|
const t = new Blob([i], { type: "text/csv;charset=utf-8;" });
|
|
344
347
|
h(t, e);
|
|
345
348
|
}
|
|
346
|
-
function
|
|
349
|
+
function w(i) {
|
|
347
350
|
return i.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
348
351
|
}
|
|
349
|
-
function
|
|
352
|
+
function y(i, e, t) {
|
|
350
353
|
let n = `<?xml version="1.0" encoding="UTF-8"?>
|
|
351
354
|
<?mso-application progid="Excel.Sheet"?>
|
|
352
355
|
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
|
|
@@ -358,7 +361,7 @@ function S(i, e, t) {
|
|
|
358
361
|
<Row>`;
|
|
359
362
|
for (const c of e) {
|
|
360
363
|
const l = c.header || c.field, o = t.processHeader ? t.processHeader(l, c.field) : l;
|
|
361
|
-
n += `<Cell><Data ss:Type="String">${
|
|
364
|
+
n += `<Cell><Data ss:Type="String">${w(o)}</Data></Cell>`;
|
|
362
365
|
}
|
|
363
366
|
n += "</Row>";
|
|
364
367
|
}
|
|
@@ -369,7 +372,7 @@ function S(i, e, t) {
|
|
|
369
372
|
let o = c[l.field];
|
|
370
373
|
t.processCell && (o = t.processCell(o, l.field, c));
|
|
371
374
|
let r = "String", s = "";
|
|
372
|
-
o == null ? s = "" : typeof o == "number" && !isNaN(o) ? (r = "Number", s = String(o)) : o instanceof Date ? (r = "DateTime", s = o.toISOString()) : s =
|
|
375
|
+
o == null ? s = "" : typeof o == "number" && !isNaN(o) ? (r = "Number", s = String(o)) : o instanceof Date ? (r = "DateTime", s = o.toISOString()) : s = w(String(o)), n += `<Cell><Data ss:Type="${r}">${s}</Data></Cell>`;
|
|
373
376
|
}
|
|
374
377
|
n += "</Row>";
|
|
375
378
|
}
|
|
@@ -378,13 +381,13 @@ function S(i, e, t) {
|
|
|
378
381
|
</Worksheet>
|
|
379
382
|
</Workbook>`, n;
|
|
380
383
|
}
|
|
381
|
-
function
|
|
384
|
+
function v(i, e) {
|
|
382
385
|
const t = e.endsWith(".xls") ? e : `${e}.xls`, n = new Blob([i], {
|
|
383
386
|
type: "application/vnd.ms-excel;charset=utf-8;"
|
|
384
387
|
});
|
|
385
388
|
h(n, t);
|
|
386
389
|
}
|
|
387
|
-
class
|
|
390
|
+
class I extends C {
|
|
388
391
|
/** @internal */
|
|
389
392
|
name = "export";
|
|
390
393
|
/** @internal */
|
|
@@ -426,13 +429,13 @@ class v extends x {
|
|
|
426
429
|
try {
|
|
427
430
|
switch (e) {
|
|
428
431
|
case "csv": {
|
|
429
|
-
const s =
|
|
430
|
-
r = r.endsWith(".csv") ? r : `${r}.csv`,
|
|
432
|
+
const s = E(o, l, c, { bom: !0 });
|
|
433
|
+
r = r.endsWith(".csv") ? r : `${r}.csv`, S(s, r);
|
|
431
434
|
break;
|
|
432
435
|
}
|
|
433
436
|
case "excel": {
|
|
434
|
-
const s =
|
|
435
|
-
r = r.endsWith(".xls") ? r : `${r}.xls`,
|
|
437
|
+
const s = y(o, l, c);
|
|
438
|
+
r = r.endsWith(".xls") ? r : `${r}.xls`, v(s, r);
|
|
436
439
|
break;
|
|
437
440
|
}
|
|
438
441
|
case "json": {
|
|
@@ -507,6 +510,6 @@ class v extends x {
|
|
|
507
510
|
// #endregion
|
|
508
511
|
}
|
|
509
512
|
export {
|
|
510
|
-
|
|
513
|
+
I as ExportPlugin
|
|
511
514
|
};
|
|
512
515
|
//# sourceMappingURL=index.js.map
|