@toolbox-web/grid 0.3.3 → 0.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 (137) hide show
  1. package/all.d.ts +19 -19
  2. package/all.d.ts.map +1 -1
  3. package/all.js +1775 -1202
  4. package/all.js.map +1 -1
  5. package/index.js +2152 -2028
  6. package/index.js.map +1 -1
  7. package/lib/core/grid.d.ts +22 -12
  8. package/lib/core/grid.d.ts.map +1 -1
  9. package/lib/core/internal/columns.d.ts +0 -9
  10. package/lib/core/internal/columns.d.ts.map +1 -1
  11. package/lib/core/internal/config-manager.d.ts +236 -0
  12. package/lib/core/internal/config-manager.d.ts.map +1 -0
  13. package/lib/core/internal/event-delegation.d.ts.map +1 -1
  14. package/lib/core/internal/header.d.ts.map +1 -1
  15. package/lib/core/internal/keyboard.d.ts.map +1 -1
  16. package/lib/core/internal/render-scheduler.d.ts +123 -0
  17. package/lib/core/internal/render-scheduler.d.ts.map +1 -0
  18. package/lib/core/internal/rows.d.ts +8 -3
  19. package/lib/core/internal/rows.d.ts.map +1 -1
  20. package/lib/core/internal/sanitize.d.ts +2 -2
  21. package/lib/core/internal/sanitize.d.ts.map +1 -1
  22. package/lib/core/internal/shell.d.ts +40 -2
  23. package/lib/core/internal/shell.d.ts.map +1 -1
  24. package/lib/core/internal/validate-config.d.ts +11 -0
  25. package/lib/core/internal/validate-config.d.ts.map +1 -0
  26. package/lib/core/plugin/base-plugin.d.ts +70 -0
  27. package/lib/core/plugin/base-plugin.d.ts.map +1 -1
  28. package/lib/core/plugin/plugin-manager.d.ts +13 -2
  29. package/lib/core/plugin/plugin-manager.d.ts.map +1 -1
  30. package/lib/core/plugin/types.d.ts +17 -3
  31. package/lib/core/plugin/types.d.ts.map +1 -1
  32. package/lib/core/types.d.ts +112 -12
  33. package/lib/core/types.d.ts.map +1 -1
  34. package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -1
  35. package/lib/plugins/clipboard/index.js +50 -18
  36. package/lib/plugins/clipboard/index.js.map +1 -1
  37. package/lib/plugins/column-virtualization/index.js +60 -25
  38. package/lib/plugins/column-virtualization/index.js.map +1 -1
  39. package/lib/plugins/context-menu/index.js +51 -16
  40. package/lib/plugins/context-menu/index.js.map +1 -1
  41. package/lib/plugins/editing/EditingPlugin.d.ts +117 -0
  42. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -0
  43. package/lib/{core/internal → plugins/editing}/editors.d.ts +1 -1
  44. package/lib/plugins/editing/editors.d.ts.map +1 -0
  45. package/lib/plugins/editing/index.d.ts +8 -0
  46. package/lib/plugins/editing/index.d.ts.map +1 -0
  47. package/lib/plugins/editing/index.js +705 -0
  48. package/lib/plugins/editing/index.js.map +1 -0
  49. package/lib/plugins/editing/types.d.ts +45 -0
  50. package/lib/plugins/editing/types.d.ts.map +1 -0
  51. package/lib/plugins/export/ExportPlugin.d.ts.map +1 -1
  52. package/lib/plugins/export/index.js +74 -39
  53. package/lib/plugins/export/index.js.map +1 -1
  54. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
  55. package/lib/plugins/filtering/index.js +87 -50
  56. package/lib/plugins/filtering/index.js.map +1 -1
  57. package/lib/plugins/grouping-columns/grouping-columns.d.ts +4 -4
  58. package/lib/plugins/grouping-columns/grouping-columns.d.ts.map +1 -1
  59. package/lib/plugins/grouping-columns/index.js +59 -24
  60. package/lib/plugins/grouping-columns/index.js.map +1 -1
  61. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -1
  62. package/lib/plugins/grouping-rows/grouping-rows.d.ts.map +1 -1
  63. package/lib/plugins/grouping-rows/index.js +46 -11
  64. package/lib/plugins/grouping-rows/index.js.map +1 -1
  65. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +2 -2
  66. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -1
  67. package/lib/plugins/master-detail/index.js +140 -102
  68. package/lib/plugins/master-detail/index.js.map +1 -1
  69. package/lib/plugins/master-detail/types.d.ts +12 -2
  70. package/lib/plugins/master-detail/types.d.ts.map +1 -1
  71. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -1
  72. package/lib/plugins/multi-sort/index.js +59 -22
  73. package/lib/plugins/multi-sort/index.js.map +1 -1
  74. package/lib/plugins/pinned-columns/index.js +41 -6
  75. package/lib/plugins/pinned-columns/index.js.map +1 -1
  76. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -1
  77. package/lib/plugins/pinned-rows/index.js +45 -9
  78. package/lib/plugins/pinned-rows/index.js.map +1 -1
  79. package/lib/plugins/pivot/index.js +42 -7
  80. package/lib/plugins/pivot/index.js.map +1 -1
  81. package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -1
  82. package/lib/plugins/reorder/index.js +59 -19
  83. package/lib/plugins/reorder/index.js.map +1 -1
  84. package/lib/plugins/selection/index.js +41 -6
  85. package/lib/plugins/selection/index.js.map +1 -1
  86. package/lib/plugins/server-side/index.js +48 -13
  87. package/lib/plugins/server-side/index.js.map +1 -1
  88. package/lib/plugins/tree/TreePlugin.d.ts +3 -3
  89. package/lib/plugins/tree/TreePlugin.d.ts.map +1 -1
  90. package/lib/plugins/tree/index.js +165 -126
  91. package/lib/plugins/tree/index.js.map +1 -1
  92. package/lib/plugins/tree/tree-data.d.ts +6 -6
  93. package/lib/plugins/tree/tree-data.d.ts.map +1 -1
  94. package/lib/plugins/tree/tree-detect.d.ts +5 -9
  95. package/lib/plugins/tree/tree-detect.d.ts.map +1 -1
  96. package/lib/plugins/tree/types.d.ts +16 -4
  97. package/lib/plugins/tree/types.d.ts.map +1 -1
  98. package/lib/plugins/undo-redo/index.js +46 -11
  99. package/lib/plugins/undo-redo/index.js.map +1 -1
  100. package/lib/plugins/visibility/index.js +37 -2
  101. package/lib/plugins/visibility/index.js.map +1 -1
  102. package/package.json +1 -1
  103. package/public.d.ts +104 -13
  104. package/public.d.ts.map +1 -1
  105. package/umd/grid.all.umd.js +31 -19
  106. package/umd/grid.all.umd.js.map +1 -1
  107. package/umd/grid.umd.js +18 -6
  108. package/umd/grid.umd.js.map +1 -1
  109. package/umd/plugins/clipboard.umd.js +1 -1
  110. package/umd/plugins/clipboard.umd.js.map +1 -1
  111. package/umd/plugins/editing.umd.js +2 -0
  112. package/umd/plugins/editing.umd.js.map +1 -0
  113. package/umd/plugins/export.umd.js +2 -2
  114. package/umd/plugins/export.umd.js.map +1 -1
  115. package/umd/plugins/filtering.umd.js +1 -1
  116. package/umd/plugins/filtering.umd.js.map +1 -1
  117. package/umd/plugins/grouping-columns.umd.js +1 -1
  118. package/umd/plugins/grouping-columns.umd.js.map +1 -1
  119. package/umd/plugins/grouping-rows.umd.js +1 -1
  120. package/umd/plugins/grouping-rows.umd.js.map +1 -1
  121. package/umd/plugins/master-detail.umd.js +1 -1
  122. package/umd/plugins/master-detail.umd.js.map +1 -1
  123. package/umd/plugins/multi-sort.umd.js +1 -1
  124. package/umd/plugins/multi-sort.umd.js.map +1 -1
  125. package/umd/plugins/pinned-rows.umd.js +1 -1
  126. package/umd/plugins/pinned-rows.umd.js.map +1 -1
  127. package/umd/plugins/reorder.umd.js +1 -1
  128. package/umd/plugins/reorder.umd.js.map +1 -1
  129. package/umd/plugins/tree.umd.js +1 -1
  130. package/umd/plugins/tree.umd.js.map +1 -1
  131. package/lib/core/internal/column-state.d.ts +0 -124
  132. package/lib/core/internal/column-state.d.ts.map +0 -1
  133. package/lib/core/internal/editing.d.ts +0 -76
  134. package/lib/core/internal/editing.d.ts.map +0 -1
  135. package/lib/core/internal/editors.d.ts.map +0 -1
  136. package/lib/core/internal/grid-internals.d.ts +0 -83
  137. package/lib/core/internal/grid-internals.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"GroupingRowsPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/grouping-rows/GroupingRowsPlugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,cAA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AAC,QAAQ,EAAE,SAAS,GAAG,MAAM,CAG5D"}
@@ -25,6 +25,12 @@ class R {
25
25
  config;
26
26
  /** User-provided configuration from constructor */
27
27
  userConfig;
28
+ /**
29
+ * Plugin-level AbortController for event listener cleanup.
30
+ * Created fresh in attach(), aborted in detach().
31
+ * This ensures event listeners are properly cleaned up when plugins are re-attached.
32
+ */
33
+ #e;
28
34
  /**
29
35
  * Default configuration - subclasses should override this getter.
30
36
  * Note: This must be a getter (not property initializer) for proper inheritance
@@ -39,19 +45,48 @@ class R {
39
45
  /**
40
46
  * Called when the plugin is attached to a grid.
41
47
  * Override to set up event listeners, initialize state, etc.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * attach(grid: GridElement): void {
52
+ * super.attach(grid);
53
+ * // Set up document-level listeners with auto-cleanup
54
+ * document.addEventListener('keydown', this.handleEscape, {
55
+ * signal: this.disconnectSignal
56
+ * });
57
+ * }
58
+ * ```
42
59
  */
43
60
  attach(e) {
44
- this.grid = e, this.config = { ...this.defaultConfig, ...this.userConfig };
61
+ this.#e?.abort(), this.#e = new AbortController(), this.grid = e, this.config = { ...this.defaultConfig, ...this.userConfig };
45
62
  }
46
63
  /**
47
64
  * Called when the plugin is detached from a grid.
48
65
  * Override to clean up event listeners, timers, etc.
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * detach(): void {
70
+ * // Clean up any state not handled by disconnectSignal
71
+ * this.selectedRows.clear();
72
+ * this.cache = null;
73
+ * }
74
+ * ```
49
75
  */
50
76
  detach() {
77
+ this.#e?.abort(), this.#e = void 0;
51
78
  }
52
79
  /**
53
80
  * Get another plugin instance from the same grid.
54
81
  * Use for inter-plugin communication.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * const selection = this.getPlugin(SelectionPlugin);
86
+ * if (selection) {
87
+ * const selectedRows = selection.getSelectedRows();
88
+ * }
89
+ * ```
55
90
  */
56
91
  getPlugin(e) {
57
92
  return this.grid?.getPlugin(e);
@@ -125,7 +160,7 @@ class R {
125
160
  * document.addEventListener('keydown', handler, { signal: this.disconnectSignal });
126
161
  */
127
162
  get disconnectSignal() {
128
- return this.grid?.disconnectSignal;
163
+ return this.#e?.signal ?? this.grid?.disconnectSignal;
129
164
  }
130
165
  /**
131
166
  * Get the grid-level icons configuration.
@@ -164,7 +199,7 @@ class R {
164
199
  }
165
200
  // #endregion
166
201
  }
167
- const b = {
202
+ const m = {
168
203
  sum: (n, e) => n.reduce((t, i) => t + (Number(i[e]) || 0), 0),
169
204
  avg: (n, e) => {
170
205
  const t = n.reduce((i, r) => i + (Number(r[e]) || 0), 0);
@@ -193,7 +228,7 @@ const b = {
193
228
  */
194
229
  get(n) {
195
230
  if (n !== void 0)
196
- return typeof n == "function" ? n : _.get(n) ?? b[n];
231
+ return typeof n == "function" ? n : _.get(n) ?? m[n];
197
232
  },
198
233
  /**
199
234
  * Run an aggregator on a set of rows.
@@ -206,13 +241,13 @@ const b = {
206
241
  * Check if an aggregator exists.
207
242
  */
208
243
  has(n) {
209
- return _.has(n) || n in b;
244
+ return _.has(n) || n in m;
210
245
  },
211
246
  /**
212
247
  * List all available aggregator names.
213
248
  */
214
249
  list() {
215
- return [...Object.keys(b), ..._.keys()];
250
+ return [...Object.keys(m), ..._.keys()];
216
251
  }
217
252
  };
218
253
  f.register.bind(f);
@@ -229,10 +264,10 @@ function v({ rows: n, config: e, expanded: t }) {
229
264
  let d = i(s);
230
265
  d == null || d === !1 ? d = ["__ungrouped__"] : Array.isArray(d) || (d = [d]);
231
266
  let a = r;
232
- d.forEach((c, m) => {
267
+ d.forEach((c, b) => {
233
268
  const l = c == null ? "∅" : String(c), g = a.key === "__root__" ? l : a.key + "||" + l;
234
269
  let p = a.children.get(l);
235
- p || (p = { key: g, value: c, depth: m, rows: [], children: /* @__PURE__ */ new Map(), parent: a }, a.children.set(l, p)), a = p;
270
+ p || (p = { key: g, value: c, depth: b, rows: [], children: /* @__PURE__ */ new Map(), parent: a }, a.children.set(l, p)), a = p;
236
271
  }), a.rows.push(s);
237
272
  }), r.children.size === 1 && r.children.has("__ungrouped__") && r.children.get("__ungrouped__").rows.length === n.length)
238
273
  return [];
@@ -319,7 +354,7 @@ class E extends R {
319
354
  if (typeof t.groupOn != "function")
320
355
  return this.isActive = !1, this.flattenedRows = [], [...e];
321
356
  const i = v({
322
- rows: e,
357
+ rows: [...e],
323
358
  config: t,
324
359
  expanded: this.expandedKeys
325
360
  });
@@ -405,9 +440,9 @@ class E extends R {
405
440
  }
406
441
  renderPerColumnGroupRow(e, t, i) {
407
442
  const r = this.config, o = r.aggregators ?? {}, u = this.columns, s = e.__groupRows ?? [], a = this.shadowRoot?.querySelector(".body")?.style.gridTemplateColumns || "";
408
- a && (t.style.display = "grid", t.style.gridTemplateColumns = a), u.forEach((c, m) => {
443
+ a && (t.style.display = "grid", t.style.gridTemplateColumns = a), u.forEach((c, b) => {
409
444
  const l = document.createElement("div");
410
- if (l.className = "cell group-cell", l.setAttribute("data-col", String(m)), l.setAttribute("role", "gridcell"), m === 0) {
445
+ if (l.className = "cell group-cell", l.setAttribute("data-col", String(b)), l.setAttribute("role", "gridcell"), b === 0) {
411
446
  const g = document.createElement("button");
412
447
  g.type = "button", g.className = `group-toggle${e.__groupExpanded ? " expanded" : ""}`, g.setAttribute("aria-label", e.__groupExpanded ? "Collapse group" : "Expand group"), this.setIcon(g, this.resolveIcon(e.__groupExpanded ? "collapse" : "expand")), g.addEventListener("click", (h) => {
413
448
  h.stopPropagation(), i();