@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.
Files changed (82) hide show
  1. package/all.d.ts +1 -0
  2. package/all.d.ts.map +1 -1
  3. package/all.js +997 -710
  4. package/all.js.map +1 -1
  5. package/index.js +642 -599
  6. package/index.js.map +1 -1
  7. package/lib/core/grid.d.ts.map +1 -1
  8. package/lib/core/internal/header.d.ts +7 -0
  9. package/lib/core/internal/header.d.ts.map +1 -1
  10. package/lib/core/types.d.ts +151 -0
  11. package/lib/core/types.d.ts.map +1 -1
  12. package/lib/plugins/clipboard/index.js +19 -16
  13. package/lib/plugins/clipboard/index.js.map +1 -1
  14. package/lib/plugins/column-virtualization/index.js +42 -39
  15. package/lib/plugins/column-virtualization/index.js.map +1 -1
  16. package/lib/plugins/context-menu/index.js +25 -22
  17. package/lib/plugins/context-menu/index.js.map +1 -1
  18. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  19. package/lib/plugins/editing/index.js +53 -48
  20. package/lib/plugins/editing/index.js.map +1 -1
  21. package/lib/plugins/export/index.js +23 -20
  22. package/lib/plugins/export/index.js.map +1 -1
  23. package/lib/plugins/filtering/FilteringPlugin.d.ts +11 -1
  24. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
  25. package/lib/plugins/filtering/index.js +186 -150
  26. package/lib/plugins/filtering/index.js.map +1 -1
  27. package/lib/plugins/grouping-columns/index.js +21 -18
  28. package/lib/plugins/grouping-columns/index.js.map +1 -1
  29. package/lib/plugins/grouping-rows/index.js +67 -64
  30. package/lib/plugins/grouping-rows/index.js.map +1 -1
  31. package/lib/plugins/master-detail/index.js +52 -49
  32. package/lib/plugins/master-detail/index.js.map +1 -1
  33. package/lib/plugins/multi-sort/index.js +18 -15
  34. package/lib/plugins/multi-sort/index.js.map +1 -1
  35. package/lib/plugins/pinned-columns/index.js +25 -22
  36. package/lib/plugins/pinned-columns/index.js.map +1 -1
  37. package/lib/plugins/pinned-rows/index.js +26 -23
  38. package/lib/plugins/pinned-rows/index.js.map +1 -1
  39. package/lib/plugins/pivot/index.js +50 -47
  40. package/lib/plugins/pivot/index.js.map +1 -1
  41. package/lib/plugins/print/PrintPlugin.d.ts +98 -0
  42. package/lib/plugins/print/PrintPlugin.d.ts.map +1 -0
  43. package/lib/plugins/print/index.d.ts +10 -0
  44. package/lib/plugins/print/index.d.ts.map +1 -0
  45. package/lib/plugins/print/index.js +626 -0
  46. package/lib/plugins/print/index.js.map +1 -0
  47. package/lib/plugins/print/print-isolated.d.ts +26 -0
  48. package/lib/plugins/print/print-isolated.d.ts.map +1 -0
  49. package/lib/plugins/print/types.d.ts +147 -0
  50. package/lib/plugins/print/types.d.ts.map +1 -0
  51. package/lib/plugins/reorder/index.js +25 -22
  52. package/lib/plugins/reorder/index.js.map +1 -1
  53. package/lib/plugins/responsive/index.js +20 -17
  54. package/lib/plugins/responsive/index.js.map +1 -1
  55. package/lib/plugins/row-reorder/index.js +39 -36
  56. package/lib/plugins/row-reorder/index.js.map +1 -1
  57. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
  58. package/lib/plugins/selection/index.js +115 -101
  59. package/lib/plugins/selection/index.js.map +1 -1
  60. package/lib/plugins/server-side/index.js +35 -32
  61. package/lib/plugins/server-side/index.js.map +1 -1
  62. package/lib/plugins/tree/index.js +26 -23
  63. package/lib/plugins/tree/index.js.map +1 -1
  64. package/lib/plugins/undo-redo/index.js +23 -20
  65. package/lib/plugins/undo-redo/index.js.map +1 -1
  66. package/lib/plugins/visibility/index.js +22 -19
  67. package/lib/plugins/visibility/index.js.map +1 -1
  68. package/package.json +1 -1
  69. package/public.d.ts +1 -1
  70. package/public.d.ts.map +1 -1
  71. package/umd/grid.all.umd.js +98 -24
  72. package/umd/grid.all.umd.js.map +1 -1
  73. package/umd/grid.umd.js +11 -11
  74. package/umd/grid.umd.js.map +1 -1
  75. package/umd/plugins/editing.umd.js +1 -1
  76. package/umd/plugins/editing.umd.js.map +1 -1
  77. package/umd/plugins/filtering.umd.js +1 -1
  78. package/umd/plugins/filtering.umd.js.map +1 -1
  79. package/umd/plugins/print.umd.js +76 -0
  80. package/umd/plugins/print.umd.js.map +1 -0
  81. package/umd/plugins/selection.umd.js +2 -2
  82. package/umd/plugins/selection.umd.js.map +1 -1
@@ -1,4 +1,4 @@
1
- const d = {
1
+ const c = '<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>', u = {
2
2
  expand: "▶",
3
3
  collapse: "▼",
4
4
  sortAsc: "▲",
@@ -6,9 +6,12 @@ const d = {
6
6
  sortNone: "⇅",
7
7
  submenuArrow: "▶",
8
8
  dragHandle: "⋮⋮",
9
- toolPanel: "☰"
9
+ toolPanel: "☰",
10
+ filter: c,
11
+ filterActive: c,
12
+ print: "🖨️"
10
13
  };
11
- class u {
14
+ class S {
12
15
  /**
13
16
  * Plugin dependencies - declare other plugins this one requires.
14
17
  *
@@ -232,7 +235,7 @@ class u {
232
235
  */
233
236
  get gridIcons() {
234
237
  const t = this.grid?.gridConfig?.icons ?? {};
235
- return { ...d, ...t };
238
+ return { ...u, ...t };
236
239
  }
237
240
  // #region Animation Helpers
238
241
  /**
@@ -308,7 +311,7 @@ class u {
308
311
  }
309
312
  // #endregion
310
313
  }
311
- function S(n, t, e) {
314
+ function h(n, t, e) {
312
315
  const r = [...n.undoStack, t];
313
316
  for (; r.length > e; )
314
317
  r.shift();
@@ -318,7 +321,7 @@ function S(n, t, e) {
318
321
  // Clear redo on new action
319
322
  };
320
323
  }
321
- function a(n) {
324
+ function s(n) {
322
325
  if (n.undoStack.length === 0)
323
326
  return { newState: n, action: null };
324
327
  const t = [...n.undoStack], e = t.pop();
@@ -330,7 +333,7 @@ function a(n) {
330
333
  action: e
331
334
  } : { newState: n, action: null };
332
335
  }
333
- function s(n) {
336
+ function d(n) {
334
337
  if (n.redoStack.length === 0)
335
338
  return { newState: n, action: null };
336
339
  const t = [...n.redoStack], e = t.pop();
@@ -345,13 +348,13 @@ function s(n) {
345
348
  function l(n) {
346
349
  return n.undoStack.length > 0;
347
350
  }
348
- function h(n) {
351
+ function k(n) {
349
352
  return n.redoStack.length > 0;
350
353
  }
351
- function k() {
354
+ function g() {
352
355
  return { undoStack: [], redoStack: [] };
353
356
  }
354
- function g(n, t, e, r) {
357
+ function f(n, t, e, r) {
355
358
  return {
356
359
  type: "cell-edit",
357
360
  rowIndex: n,
@@ -361,7 +364,7 @@ function g(n, t, e, r) {
361
364
  timestamp: Date.now()
362
365
  };
363
366
  }
364
- class f extends u {
367
+ class w extends S {
365
368
  /**
366
369
  * Plugin dependencies - UndoRedoPlugin requires EditingPlugin to track edits.
367
370
  *
@@ -398,7 +401,7 @@ class f extends u {
398
401
  onKeyDown(t) {
399
402
  const e = (t.ctrlKey || t.metaKey) && t.key === "z" && !t.shiftKey, r = (t.ctrlKey || t.metaKey) && (t.key === "y" || t.key === "z" && t.shiftKey);
400
403
  if (e) {
401
- const o = a({ undoStack: this.undoStack, redoStack: this.redoStack });
404
+ const o = s({ undoStack: this.undoStack, redoStack: this.redoStack });
402
405
  if (o.action) {
403
406
  const i = this.rows;
404
407
  i[o.action.rowIndex] && (i[o.action.rowIndex][o.action.field] = o.action.oldValue), this.undoStack = o.newState.undoStack, this.redoStack = o.newState.redoStack, this.emit("undo", {
@@ -409,7 +412,7 @@ class f extends u {
409
412
  return !0;
410
413
  }
411
414
  if (r) {
412
- const o = s({ undoStack: this.undoStack, redoStack: this.redoStack });
415
+ const o = d({ undoStack: this.undoStack, redoStack: this.redoStack });
413
416
  if (o.action) {
414
417
  const i = this.rows;
415
418
  i[o.action.rowIndex] && (i[o.action.rowIndex][o.action.field] = o.action.newValue), this.undoStack = o.newState.undoStack, this.redoStack = o.newState.redoStack, this.emit("redo", {
@@ -432,12 +435,12 @@ class f extends u {
432
435
  * @param newValue - The value after the edit
433
436
  */
434
437
  recordEdit(t, e, r, o) {
435
- const i = g(t, e, r, o), c = S(
438
+ const i = f(t, e, r, o), a = h(
436
439
  { undoStack: this.undoStack, redoStack: this.redoStack },
437
440
  i,
438
441
  this.config.maxHistorySize ?? 100
439
442
  );
440
- this.undoStack = c.undoStack, this.redoStack = c.redoStack;
443
+ this.undoStack = a.undoStack, this.redoStack = a.redoStack;
441
444
  }
442
445
  /**
443
446
  * Programmatically undo the last action.
@@ -445,7 +448,7 @@ class f extends u {
445
448
  * @returns The undone action, or null if nothing to undo
446
449
  */
447
450
  undo() {
448
- const t = a({ undoStack: this.undoStack, redoStack: this.redoStack });
451
+ const t = s({ undoStack: this.undoStack, redoStack: this.redoStack });
449
452
  if (t.action) {
450
453
  const e = this.rows;
451
454
  e[t.action.rowIndex] && (e[t.action.rowIndex][t.action.field] = t.action.oldValue), this.undoStack = t.newState.undoStack, this.redoStack = t.newState.redoStack, this.requestRender();
@@ -458,7 +461,7 @@ class f extends u {
458
461
  * @returns The redone action, or null if nothing to redo
459
462
  */
460
463
  redo() {
461
- const t = s({ undoStack: this.undoStack, redoStack: this.redoStack });
464
+ const t = d({ undoStack: this.undoStack, redoStack: this.redoStack });
462
465
  if (t.action) {
463
466
  const e = this.rows;
464
467
  e[t.action.rowIndex] && (e[t.action.rowIndex][t.action.field] = t.action.newValue), this.undoStack = t.newState.undoStack, this.redoStack = t.newState.redoStack, this.requestRender();
@@ -475,13 +478,13 @@ class f extends u {
475
478
  * Check if there are any actions that can be redone.
476
479
  */
477
480
  canRedo() {
478
- return h({ undoStack: this.undoStack, redoStack: this.redoStack });
481
+ return k({ undoStack: this.undoStack, redoStack: this.redoStack });
479
482
  }
480
483
  /**
481
484
  * Clear all undo/redo history.
482
485
  */
483
486
  clearHistory() {
484
- const t = k();
487
+ const t = g();
485
488
  this.undoStack = t.undoStack, this.redoStack = t.redoStack;
486
489
  }
487
490
  /**
@@ -499,6 +502,6 @@ class f extends u {
499
502
  // #endregion
500
503
  }
501
504
  export {
502
- f as UndoRedoPlugin
505
+ w as UndoRedoPlugin
503
506
  };
504
507
  //# sourceMappingURL=index.js.map