@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 h = {
1
+ const d = '<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>', g = {
2
2
  expand: "▶",
3
3
  collapse: "▼",
4
4
  sortAsc: "▲",
@@ -6,12 +6,14 @@ const h = {
6
6
  sortNone: "⇅",
7
7
  submenuArrow: "▶",
8
8
  dragHandle: "⋮⋮",
9
- toolPanel: "☰"
10
- }, g = {
9
+ toolPanel: "☰",
10
+ filter: d,
11
+ filterActive: d
12
+ }, y = {
11
13
  /** Ask if a column can be moved. Context: ColumnConfig. Response: boolean | undefined */
12
14
  CAN_MOVE_COLUMN: "canMoveColumn"
13
15
  };
14
- class y {
16
+ class m {
15
17
  /**
16
18
  * Plugin dependencies - declare other plugins this one requires.
17
19
  *
@@ -235,7 +237,7 @@ class y {
235
237
  */
236
238
  get gridIcons() {
237
239
  const t = this.grid?.gridConfig?.icons ?? {};
238
- return { ...h, ...t };
240
+ return { ...g, ...t };
239
241
  }
240
242
  // #region Animation Helpers
241
243
  /**
@@ -311,16 +313,16 @@ class y {
311
313
  }
312
314
  // #endregion
313
315
  }
314
- function m(r) {
316
+ function p(r) {
315
317
  return r.filter((t) => t.sticky === "left");
316
318
  }
317
- function p(r) {
319
+ function k(r) {
318
320
  return r.filter((t) => t.sticky === "right");
319
321
  }
320
- function d(r) {
322
+ function a(r) {
321
323
  return r.some((t) => t.sticky === "left" || t.sticky === "right");
322
324
  }
323
- function a(r, t) {
325
+ function u(r, t) {
324
326
  const e = Array.from(r.querySelectorAll(".header-row .cell"));
325
327
  if (!e.length) return;
326
328
  const s = /* @__PURE__ */ new Map();
@@ -344,12 +346,12 @@ function a(r, t) {
344
346
  }), f += i.offsetWidth);
345
347
  }
346
348
  }
347
- function u(r) {
349
+ function h(r) {
348
350
  r.querySelectorAll(".sticky-left, .sticky-right").forEach((e) => {
349
351
  e.classList.remove("sticky-left", "sticky-right"), e.style.position = "", e.style.left = "", e.style.right = "";
350
352
  });
351
353
  }
352
- class k extends y {
354
+ class C extends m {
353
355
  /**
354
356
  * Plugin manifest - declares owned properties for configuration validation.
355
357
  * @internal
@@ -387,25 +389,25 @@ class k extends y {
387
389
  */
388
390
  static detect(t, e) {
389
391
  const s = e?.columns;
390
- return Array.isArray(s) ? d(s) : !1;
392
+ return Array.isArray(s) ? a(s) : !1;
391
393
  }
392
394
  // #endregion
393
395
  // #region Hooks
394
396
  /** @internal */
395
397
  processColumns(t) {
396
- return this.isApplied = d([...t]), [...t];
398
+ return this.isApplied = a([...t]), [...t];
397
399
  }
398
400
  /** @internal */
399
401
  afterRender() {
400
402
  if (!this.isApplied)
401
403
  return;
402
404
  const t = this.grid, e = [...this.columns];
403
- if (!d(e)) {
404
- u(t), this.isApplied = !1;
405
+ if (!a(e)) {
406
+ h(t), this.isApplied = !1;
405
407
  return;
406
408
  }
407
409
  queueMicrotask(() => {
408
- a(t, e);
410
+ u(t, e);
409
411
  });
410
412
  }
411
413
  /**
@@ -414,7 +416,7 @@ class k extends y {
414
416
  */
415
417
  onPluginQuery(t) {
416
418
  switch (t.type) {
417
- case g.CAN_MOVE_COLUMN: {
419
+ case y.CAN_MOVE_COLUMN: {
418
420
  const e = t.context, s = e.sticky;
419
421
  if (s === "left" || s === "right")
420
422
  return !1;
@@ -432,27 +434,27 @@ class k extends y {
432
434
  */
433
435
  refreshStickyOffsets() {
434
436
  const t = [...this.columns];
435
- a(this.grid, t);
437
+ u(this.grid, t);
436
438
  }
437
439
  /**
438
440
  * Get columns pinned to the left.
439
441
  */
440
442
  getLeftPinnedColumns() {
441
443
  const t = [...this.columns];
442
- return m(t);
444
+ return p(t);
443
445
  }
444
446
  /**
445
447
  * Get columns pinned to the right.
446
448
  */
447
449
  getRightPinnedColumns() {
448
450
  const t = [...this.columns];
449
- return p(t);
451
+ return k(t);
450
452
  }
451
453
  /**
452
454
  * Clear all sticky positioning.
453
455
  */
454
456
  clearStickyPositions() {
455
- u(this.grid);
457
+ h(this.grid);
456
458
  }
457
459
  /**
458
460
  * Report horizontal scroll boundary offsets for pinned columns.
@@ -480,6 +482,6 @@ class k extends y {
480
482
  // #endregion
481
483
  }
482
484
  export {
483
- k as PinnedColumnsPlugin
485
+ C as PinnedColumnsPlugin
484
486
  };
485
487
  //# sourceMappingURL=index.js.map