@toolbox-web/grid 1.9.0 → 1.9.2

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 (65) hide show
  1. package/all.js +712 -692
  2. package/all.js.map +1 -1
  3. package/index.js +321 -300
  4. package/index.js.map +1 -1
  5. package/lib/core/grid.d.ts +9 -0
  6. package/lib/core/grid.d.ts.map +1 -1
  7. package/lib/core/plugin/base-plugin.d.ts +11 -0
  8. package/lib/core/plugin/base-plugin.d.ts.map +1 -1
  9. package/lib/plugins/clipboard/index.js +9 -0
  10. package/lib/plugins/clipboard/index.js.map +1 -1
  11. package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts +3 -0
  12. package/lib/plugins/column-virtualization/ColumnVirtualizationPlugin.d.ts.map +1 -1
  13. package/lib/plugins/column-virtualization/index.js +90 -57
  14. package/lib/plugins/column-virtualization/index.js.map +1 -1
  15. package/lib/plugins/context-menu/index.js +9 -0
  16. package/lib/plugins/context-menu/index.js.map +1 -1
  17. package/lib/plugins/editing/index.js +9 -0
  18. package/lib/plugins/editing/index.js.map +1 -1
  19. package/lib/plugins/export/index.js +38 -29
  20. package/lib/plugins/export/index.js.map +1 -1
  21. package/lib/plugins/filtering/index.js +14 -5
  22. package/lib/plugins/filtering/index.js.map +1 -1
  23. package/lib/plugins/grouping-columns/index.js +9 -0
  24. package/lib/plugins/grouping-columns/index.js.map +1 -1
  25. package/lib/plugins/grouping-rows/index.js +63 -54
  26. package/lib/plugins/grouping-rows/index.js.map +1 -1
  27. package/lib/plugins/master-detail/index.js +25 -16
  28. package/lib/plugins/master-detail/index.js.map +1 -1
  29. package/lib/plugins/multi-sort/index.js +13 -4
  30. package/lib/plugins/multi-sort/index.js.map +1 -1
  31. package/lib/plugins/pinned-columns/index.js +13 -4
  32. package/lib/plugins/pinned-columns/index.js.map +1 -1
  33. package/lib/plugins/pinned-rows/index.js +9 -0
  34. package/lib/plugins/pinned-rows/index.js.map +1 -1
  35. package/lib/plugins/pivot/index.js +13 -4
  36. package/lib/plugins/pivot/index.js.map +1 -1
  37. package/lib/plugins/print/index.js +9 -0
  38. package/lib/plugins/print/index.js.map +1 -1
  39. package/lib/plugins/reorder/index.js +13 -4
  40. package/lib/plugins/reorder/index.js.map +1 -1
  41. package/lib/plugins/responsive/index.js +42 -33
  42. package/lib/plugins/responsive/index.js.map +1 -1
  43. package/lib/plugins/row-reorder/index.js +10 -1
  44. package/lib/plugins/row-reorder/index.js.map +1 -1
  45. package/lib/plugins/selection/index.js +10 -1
  46. package/lib/plugins/selection/index.js.map +1 -1
  47. package/lib/plugins/server-side/index.js +29 -20
  48. package/lib/plugins/server-side/index.js.map +1 -1
  49. package/lib/plugins/tree/index.js +20 -11
  50. package/lib/plugins/tree/index.js.map +1 -1
  51. package/lib/plugins/undo-redo/index.js +15 -6
  52. package/lib/plugins/undo-redo/index.js.map +1 -1
  53. package/lib/plugins/visibility/index.js +9 -0
  54. package/lib/plugins/visibility/index.js.map +1 -1
  55. package/package.json +1 -1
  56. package/umd/grid.all.umd.js +14 -14
  57. package/umd/grid.all.umd.js.map +1 -1
  58. package/umd/grid.umd.js +14 -14
  59. package/umd/grid.umd.js.map +1 -1
  60. package/umd/plugins/column-virtualization.umd.js +1 -1
  61. package/umd/plugins/column-virtualization.umd.js.map +1 -1
  62. package/umd/plugins/row-reorder.umd.js +1 -1
  63. package/umd/plugins/row-reorder.umd.js.map +1 -1
  64. package/umd/plugins/selection.umd.js +1 -1
  65. package/umd/plugins/selection.umd.js.map +1 -1
@@ -1,4 +1,4 @@
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>', S = {
1
+ const b = '<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>', S = {
2
2
  expand: "▶",
3
3
  collapse: "▼",
4
4
  sortAsc: "▲",
@@ -7,8 +7,8 @@ const m = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentCo
7
7
  submenuArrow: "▶",
8
8
  dragHandle: "⋮⋮",
9
9
  toolPanel: "☰",
10
- filter: m,
11
- filterActive: m,
10
+ filter: b,
11
+ filterActive: b,
12
12
  print: "🖨️"
13
13
  };
14
14
  class E {
@@ -208,10 +208,19 @@ class E {
208
208
  }
209
209
  /**
210
210
  * Request a re-render of the grid.
211
+ * Uses ROWS phase - does NOT trigger processColumns hooks.
211
212
  */
212
213
  requestRender() {
213
214
  this.grid?.requestRender?.();
214
215
  }
216
+ /**
217
+ * Request a columns re-render of the grid.
218
+ * Uses COLUMNS phase - triggers processColumns hooks.
219
+ * Use this when your plugin needs to reprocess column configuration.
220
+ */
221
+ requestColumnsRender() {
222
+ this.grid?.requestColumnsRender?.();
223
+ }
215
224
  /**
216
225
  * Request a re-render and restore focus styling afterward.
217
226
  * Use this when a plugin action (like expand/collapse) triggers a render
@@ -368,7 +377,7 @@ class E {
368
377
  }
369
378
  // #endregion
370
379
  }
371
- function v(o, e, t) {
380
+ function R(o, e, t) {
372
381
  return o.id !== void 0 ? String(o.id) : t ? `${t}-${e}` : String(e);
373
382
  }
374
383
  function y(o, e) {
@@ -378,7 +387,7 @@ function y(o, e) {
378
387
  function w(o, e, t = null, n = 0) {
379
388
  const r = e.childrenField ?? "children", s = /* @__PURE__ */ new Set();
380
389
  for (let i = 0; i < o.length; i++) {
381
- const l = o[i], a = v(l, i, t), d = l[r];
390
+ const l = o[i], a = R(l, i, t), d = l[r];
382
391
  if (Array.isArray(d) && d.length > 0) {
383
392
  s.add(a);
384
393
  const h = w(d, e, a, n + 1);
@@ -390,15 +399,15 @@ function w(o, e, t = null, n = 0) {
390
399
  function A() {
391
400
  return /* @__PURE__ */ new Set();
392
401
  }
393
- function K(o, e, t, n = null, r = 0) {
402
+ function v(o, e, t, n = null, r = 0) {
394
403
  const s = t.childrenField ?? "children";
395
404
  for (let i = 0; i < o.length; i++) {
396
- const l = o[i], a = v(l, i, n);
405
+ const l = o[i], a = R(l, i, n);
397
406
  if (a === e)
398
407
  return [a];
399
408
  const d = l[s];
400
409
  if (Array.isArray(d) && d.length > 0) {
401
- const h = K(d, e, t, a, r + 1);
410
+ const h = v(d, e, t, a, r + 1);
402
411
  if (h)
403
412
  return [a, ...h];
404
413
  }
@@ -406,7 +415,7 @@ function K(o, e, t, n = null, r = 0) {
406
415
  return null;
407
416
  }
408
417
  function C(o, e, t, n) {
409
- const r = K(o, e, t);
418
+ const r = v(o, e, t);
410
419
  if (!r) return n;
411
420
  const s = new Set(n);
412
421
  for (let i = 0; i < r.length - 1; i++)
@@ -570,8 +579,8 @@ class T extends E {
570
579
  const t = [...e];
571
580
  if (t.length === 0) return t;
572
581
  const n = t[0], r = n.viewRenderer, s = () => this.config, i = this.setIcon.bind(this), l = this.resolveIcon.bind(this), a = (d) => {
573
- const { row: h, value: u } = d, { showExpandIcons: R = !0, indentWidth: b } = s(), g = h, _ = g.__treeDepth ?? 0, f = document.createElement("span");
574
- if (f.className = "tree-cell-wrapper", f.style.setProperty("--tbw-tree-depth", String(_)), b !== void 0 && f.style.setProperty("--tbw-tree-indent-width", `${b}px`), R)
582
+ const { row: h, value: u } = d, { showExpandIcons: K = !0, indentWidth: m } = s(), g = h, _ = g.__treeDepth ?? 0, f = document.createElement("span");
583
+ if (f.className = "tree-cell-wrapper", f.style.setProperty("--tbw-tree-depth", String(_)), m !== void 0 && f.style.setProperty("--tbw-tree-indent-width", `${m}px`), K)
575
584
  if (g.__treeHasChildren) {
576
585
  const c = document.createElement("span");
577
586
  c.className = `tree-toggle${g.__treeExpanded ? " expanded" : ""}`, i(c, l(g.__treeExpanded ? "collapse" : "expand")), c.setAttribute("data-tree-key", String(g.__treeKey ?? "")), f.appendChild(c);