@toolbox-web/grid 1.2.0 → 1.3.1

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 (79) hide show
  1. package/README.md +80 -22
  2. package/all.js +619 -571
  3. package/all.js.map +1 -1
  4. package/index.js +362 -302
  5. package/index.js.map +1 -1
  6. package/lib/core/grid.d.ts +64 -1
  7. package/lib/core/grid.d.ts.map +1 -1
  8. package/lib/core/internal/row-animation.d.ts +37 -0
  9. package/lib/core/internal/row-animation.d.ts.map +1 -0
  10. package/lib/core/types.d.ts +17 -0
  11. package/lib/core/types.d.ts.map +1 -1
  12. package/lib/plugins/clipboard/index.js +82 -76
  13. package/lib/plugins/clipboard/index.js.map +1 -1
  14. package/lib/plugins/clipboard/types.d.ts +1 -0
  15. package/lib/plugins/clipboard/types.d.ts.map +1 -1
  16. package/lib/plugins/column-virtualization/index.js +43 -41
  17. package/lib/plugins/column-virtualization/index.js.map +1 -1
  18. package/lib/plugins/context-menu/index.js +24 -22
  19. package/lib/plugins/context-menu/index.js.map +1 -1
  20. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  21. package/lib/plugins/editing/index.js +83 -52
  22. package/lib/plugins/editing/index.js.map +1 -1
  23. package/lib/plugins/export/index.js +22 -20
  24. package/lib/plugins/export/index.js.map +1 -1
  25. package/lib/plugins/filtering/FilteringPlugin.d.ts +11 -1
  26. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
  27. package/lib/plugins/filtering/index.js +160 -125
  28. package/lib/plugins/filtering/index.js.map +1 -1
  29. package/lib/plugins/grouping-columns/index.js +20 -18
  30. package/lib/plugins/grouping-columns/index.js.map +1 -1
  31. package/lib/plugins/grouping-rows/index.js +66 -64
  32. package/lib/plugins/grouping-rows/index.js.map +1 -1
  33. package/lib/plugins/master-detail/index.js +51 -49
  34. package/lib/plugins/master-detail/index.js.map +1 -1
  35. package/lib/plugins/multi-sort/index.js +17 -15
  36. package/lib/plugins/multi-sort/index.js.map +1 -1
  37. package/lib/plugins/pinned-columns/index.js +24 -22
  38. package/lib/plugins/pinned-columns/index.js.map +1 -1
  39. package/lib/plugins/pinned-rows/index.js +25 -23
  40. package/lib/plugins/pinned-rows/index.js.map +1 -1
  41. package/lib/plugins/pivot/index.js +49 -47
  42. package/lib/plugins/pivot/index.js.map +1 -1
  43. package/lib/plugins/reorder/index.js +24 -22
  44. package/lib/plugins/reorder/index.js.map +1 -1
  45. package/lib/plugins/responsive/index.js +19 -17
  46. package/lib/plugins/responsive/index.js.map +1 -1
  47. package/lib/plugins/row-reorder/index.js +38 -36
  48. package/lib/plugins/row-reorder/index.js.map +1 -1
  49. package/lib/plugins/selection/SelectionPlugin.d.ts +13 -0
  50. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
  51. package/lib/plugins/selection/index.d.ts +1 -1
  52. package/lib/plugins/selection/index.d.ts.map +1 -1
  53. package/lib/plugins/selection/index.js +118 -85
  54. package/lib/plugins/selection/index.js.map +1 -1
  55. package/lib/plugins/selection/types.d.ts +50 -6
  56. package/lib/plugins/selection/types.d.ts.map +1 -1
  57. package/lib/plugins/server-side/index.js +34 -32
  58. package/lib/plugins/server-side/index.js.map +1 -1
  59. package/lib/plugins/tree/index.js +25 -23
  60. package/lib/plugins/tree/index.js.map +1 -1
  61. package/lib/plugins/undo-redo/index.js +22 -20
  62. package/lib/plugins/undo-redo/index.js.map +1 -1
  63. package/lib/plugins/visibility/index.js +21 -19
  64. package/lib/plugins/visibility/index.js.map +1 -1
  65. package/package.json +21 -4
  66. package/public.d.ts +1 -1
  67. package/public.d.ts.map +1 -1
  68. package/umd/grid.all.umd.js +19 -19
  69. package/umd/grid.all.umd.js.map +1 -1
  70. package/umd/grid.umd.js +9 -9
  71. package/umd/grid.umd.js.map +1 -1
  72. package/umd/plugins/clipboard.umd.js +5 -5
  73. package/umd/plugins/clipboard.umd.js.map +1 -1
  74. package/umd/plugins/editing.umd.js +1 -1
  75. package/umd/plugins/editing.umd.js.map +1 -1
  76. package/umd/plugins/filtering.umd.js +1 -1
  77. package/umd/plugins/filtering.umd.js.map +1 -1
  78. package/umd/plugins/selection.umd.js +2 -2
  79. package/umd/plugins/selection.umd.js.map +1 -1
@@ -1,4 +1,4 @@
1
- const w = {
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,11 @@ const w = {
6
6
  sortNone: "⇅",
7
7
  submenuArrow: "▶",
8
8
  dragHandle: "⋮⋮",
9
- toolPanel: "☰"
9
+ toolPanel: "☰",
10
+ filter: m,
11
+ filterActive: m
10
12
  };
11
- class x {
13
+ class C {
12
14
  /**
13
15
  * Plugin dependencies - declare other plugins this one requires.
14
16
  *
@@ -232,7 +234,7 @@ class x {
232
234
  */
233
235
  get gridIcons() {
234
236
  const e = this.grid?.gridConfig?.icons ?? {};
235
- return { ...w, ...e };
237
+ return { ...x, ...e };
236
238
  }
237
239
  // #region Animation Helpers
238
240
  /**
@@ -308,7 +310,7 @@ class x {
308
310
  }
309
311
  // #endregion
310
312
  }
311
- function m(i, e = !0) {
313
+ function b(i, e = !0) {
312
314
  if (i == null) return "";
313
315
  if (i instanceof Date) return i.toISOString();
314
316
  if (typeof i == "object") return JSON.stringify(i);
@@ -316,20 +318,20 @@ function m(i, e = !0) {
316
318
  return e && (t.includes(",") || t.includes('"') || t.includes(`
317
319
  `) || t.includes("\r")) ? `"${t.replace(/"/g, '""')}"` : t;
318
320
  }
319
- function C(i, e, t, n = {}) {
321
+ function E(i, e, t, n = {}) {
320
322
  const c = n.delimiter ?? ",", l = n.newline ?? `
321
323
  `, o = [], r = n.bom ? "\uFEFF" : "";
322
324
  if (t.includeHeaders !== !1) {
323
325
  const s = e.map((a) => {
324
326
  const d = a.header || a.field, u = t.processHeader ? t.processHeader(d, a.field) : d;
325
- return m(u);
327
+ return b(u);
326
328
  });
327
329
  o.push(s.join(c));
328
330
  }
329
331
  for (const s of i) {
330
332
  const a = e.map((d) => {
331
333
  let u = s[d.field];
332
- return t.processCell && (u = t.processCell(u, d.field, s)), m(u);
334
+ return t.processCell && (u = t.processCell(u, d.field, s)), b(u);
333
335
  });
334
336
  o.push(a.join(c));
335
337
  }
@@ -339,14 +341,14 @@ function h(i, e) {
339
341
  const t = URL.createObjectURL(i), n = document.createElement("a");
340
342
  n.href = t, n.download = e, n.style.display = "none", document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(t);
341
343
  }
342
- function E(i, e) {
344
+ function S(i, e) {
343
345
  const t = new Blob([i], { type: "text/csv;charset=utf-8;" });
344
346
  h(t, e);
345
347
  }
346
- function b(i) {
348
+ function w(i) {
347
349
  return i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
348
350
  }
349
- function S(i, e, t) {
351
+ function y(i, e, t) {
350
352
  let n = `<?xml version="1.0" encoding="UTF-8"?>
351
353
  <?mso-application progid="Excel.Sheet"?>
352
354
  <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
@@ -358,7 +360,7 @@ function S(i, e, t) {
358
360
  <Row>`;
359
361
  for (const c of e) {
360
362
  const l = c.header || c.field, o = t.processHeader ? t.processHeader(l, c.field) : l;
361
- n += `<Cell><Data ss:Type="String">${b(o)}</Data></Cell>`;
363
+ n += `<Cell><Data ss:Type="String">${w(o)}</Data></Cell>`;
362
364
  }
363
365
  n += "</Row>";
364
366
  }
@@ -369,7 +371,7 @@ function S(i, e, t) {
369
371
  let o = c[l.field];
370
372
  t.processCell && (o = t.processCell(o, l.field, c));
371
373
  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 = b(String(o)), n += `<Cell><Data ss:Type="${r}">${s}</Data></Cell>`;
374
+ 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
375
  }
374
376
  n += "</Row>";
375
377
  }
@@ -378,13 +380,13 @@ function S(i, e, t) {
378
380
  </Worksheet>
379
381
  </Workbook>`, n;
380
382
  }
381
- function y(i, e) {
383
+ function v(i, e) {
382
384
  const t = e.endsWith(".xls") ? e : `${e}.xls`, n = new Blob([i], {
383
385
  type: "application/vnd.ms-excel;charset=utf-8;"
384
386
  });
385
387
  h(n, t);
386
388
  }
387
- class v extends x {
389
+ class I extends C {
388
390
  /** @internal */
389
391
  name = "export";
390
392
  /** @internal */
@@ -426,13 +428,13 @@ class v extends x {
426
428
  try {
427
429
  switch (e) {
428
430
  case "csv": {
429
- const s = C(o, l, c, { bom: !0 });
430
- r = r.endsWith(".csv") ? r : `${r}.csv`, E(s, r);
431
+ const s = E(o, l, c, { bom: !0 });
432
+ r = r.endsWith(".csv") ? r : `${r}.csv`, S(s, r);
431
433
  break;
432
434
  }
433
435
  case "excel": {
434
- const s = S(o, l, c);
435
- r = r.endsWith(".xls") ? r : `${r}.xls`, y(s, r);
436
+ const s = y(o, l, c);
437
+ r = r.endsWith(".xls") ? r : `${r}.xls`, v(s, r);
436
438
  break;
437
439
  }
438
440
  case "json": {
@@ -507,6 +509,6 @@ class v extends x {
507
509
  // #endregion
508
510
  }
509
511
  export {
510
- v as ExportPlugin
512
+ I as ExportPlugin
511
513
  };
512
514
  //# sourceMappingURL=index.js.map