@toolbox-web/grid-angular 0.5.0 → 0.7.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 (89) hide show
  1. package/feature-registry-C-cKloXB.js +45 -0
  2. package/features/clipboard.d.ts +18 -0
  3. package/features/clipboard.d.ts.map +1 -0
  4. package/features/clipboard.js +3 -0
  5. package/features/column-virtualization.d.ts +16 -0
  6. package/features/column-virtualization.d.ts.map +1 -0
  7. package/features/column-virtualization.js +3 -0
  8. package/features/context-menu.d.ts +16 -0
  9. package/features/context-menu.d.ts.map +1 -0
  10. package/features/context-menu.js +3 -0
  11. package/features/editing.d.ts +16 -0
  12. package/features/editing.d.ts.map +1 -0
  13. package/features/editing.js +3 -0
  14. package/features/export.d.ts +17 -0
  15. package/features/export.d.ts.map +1 -0
  16. package/features/export.js +3 -0
  17. package/features/filtering.d.ts +17 -0
  18. package/features/filtering.d.ts.map +1 -0
  19. package/features/filtering.js +3 -0
  20. package/features/grouping-columns.d.ts +16 -0
  21. package/features/grouping-columns.d.ts.map +1 -0
  22. package/features/grouping-columns.js +3 -0
  23. package/features/grouping-rows.d.ts +16 -0
  24. package/features/grouping-rows.d.ts.map +1 -0
  25. package/features/grouping-rows.js +3 -0
  26. package/features/index.d.ts +1 -0
  27. package/features/index.d.ts.map +1 -0
  28. package/features/index.js +22 -0
  29. package/features/master-detail.d.ts +16 -0
  30. package/features/master-detail.d.ts.map +1 -0
  31. package/features/master-detail.js +3 -0
  32. package/features/multi-sort.d.ts +22 -0
  33. package/features/multi-sort.d.ts.map +1 -0
  34. package/features/pinned-columns.d.ts +19 -0
  35. package/features/pinned-columns.d.ts.map +1 -0
  36. package/features/pinned-columns.js +3 -0
  37. package/features/pinned-rows.d.ts +16 -0
  38. package/features/pinned-rows.d.ts.map +1 -0
  39. package/features/pinned-rows.js +3 -0
  40. package/features/pivot.d.ts +16 -0
  41. package/features/pivot.d.ts.map +1 -0
  42. package/features/pivot.js +3 -0
  43. package/features/print.d.ts +16 -0
  44. package/features/print.d.ts.map +1 -0
  45. package/features/print.js +3 -0
  46. package/features/reorder.d.ts +16 -0
  47. package/features/reorder.d.ts.map +1 -0
  48. package/features/reorder.js +3 -0
  49. package/features/responsive.d.ts +16 -0
  50. package/features/responsive.d.ts.map +1 -0
  51. package/features/responsive.js +3 -0
  52. package/features/row-reorder.d.ts +16 -0
  53. package/features/row-reorder.d.ts.map +1 -0
  54. package/features/row-reorder.js +3 -0
  55. package/features/selection.d.ts +16 -0
  56. package/features/selection.d.ts.map +1 -0
  57. package/features/selection.js +3 -0
  58. package/features/server-side.d.ts +16 -0
  59. package/features/server-side.d.ts.map +1 -0
  60. package/features/server-side.js +3 -0
  61. package/features/sorting.d.ts +1 -0
  62. package/features/sorting.d.ts.map +1 -0
  63. package/features/sorting.js +1 -0
  64. package/features/tree.d.ts +16 -0
  65. package/features/tree.d.ts.map +1 -0
  66. package/features/tree.js +3 -0
  67. package/features/undo-redo.d.ts +18 -0
  68. package/features/undo-redo.d.ts.map +1 -0
  69. package/features/undo-redo.js +3 -0
  70. package/features/visibility.d.ts +16 -0
  71. package/features/visibility.d.ts.map +1 -0
  72. package/features/visibility.js +3 -0
  73. package/index.d.ts +5 -1
  74. package/index.d.ts.map +1 -1
  75. package/index.js +1094 -306
  76. package/lib/angular-column-config.d.ts +1 -1
  77. package/lib/angular-grid-adapter.d.ts +1 -1
  78. package/lib/angular-grid-adapter.d.ts.map +1 -1
  79. package/lib/base-grid-editor.d.ts +1 -1
  80. package/lib/directives/grid-detail-view.directive.d.ts +1 -1
  81. package/lib/directives/grid.directive.d.ts +629 -3
  82. package/lib/directives/grid.directive.d.ts.map +1 -1
  83. package/lib/feature-registry.d.ts +72 -0
  84. package/lib/feature-registry.d.ts.map +1 -0
  85. package/lib/grid-type-registry.d.ts +1 -1
  86. package/lib/inject-grid.d.ts +109 -0
  87. package/lib/inject-grid.d.ts.map +1 -0
  88. package/multi-sort-DPbW58yz.js +3 -0
  89. package/package.json +11 -1
package/index.js CHANGED
@@ -1,55 +1,56 @@
1
- var qe = Object.create;
2
- var j = Object.defineProperty;
1
+ var _e = Object.create;
2
+ var N = Object.defineProperty;
3
3
  var $e = Object.getOwnPropertyDescriptor;
4
- var ue = (n, e) => (e = Symbol[n]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + n), I = (n) => {
5
- throw TypeError(n);
4
+ var pe = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), j = (i) => {
5
+ throw TypeError(i);
6
6
  };
7
- var Ue = (n, e, t) => e in n ? j(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
8
- var ce = (n, e) => j(n, "name", { value: e, configurable: !0 });
9
- var h = (n) => [, , , qe(n?.[ue("metadata")] ?? null)], de = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], O = (n) => n !== void 0 && typeof n != "function" ? I("Function expected") : n, We = (n, e, t, i, r) => ({ kind: de[n], name: e, metadata: i, addInitializer: (o) => t._ ? I("Already initialized") : r.push(O(o || null)) }), He = (n, e) => Ue(e, ue("metadata"), n[3]), g = (n, e, t, i) => {
10
- for (var r = 0, o = n[e >> 1], s = o && o.length; r < s; r++) e & 1 ? o[r].call(t) : i = o[r].call(t, i);
11
- return i;
12
- }, v = (n, e, t, i, r, o) => {
13
- var s, l, m, d, T, c = e & 7, C = !!(e & 8), a = !!(e & 16), b = c > 3 ? n.length + 1 : c ? C ? 1 : 2 : 0, D = de[c + 5], le = c > 3 && (n[b - 1] = []), Ge = n[b] || (n[b] = []), w = c && (!a && !C && (r = r.prototype), c < 5 && (c > 3 || !a) && $e(c < 4 ? r : { get [t]() {
14
- return ae(this, o);
15
- }, set [t](p) {
16
- return me(this, o, p);
7
+ var ze = (i, e, t) => e in i ? N(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
8
+ var ue = (i, e) => N(i, "name", { value: e, configurable: !0 });
9
+ var y = (i) => [, , , _e(i?.[pe("metadata")] ?? null)], fe = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], O = (i) => i !== void 0 && typeof i != "function" ? j("Function expected") : i, Be = (i, e, t, n, r) => ({ kind: fe[i], name: e, metadata: n, addInitializer: (o) => t._ ? j("Already initialized") : r.push(O(o || null)) }), Ue = (i, e) => ze(e, pe("metadata"), i[3]), b = (i, e, t, n) => {
10
+ for (var r = 0, o = i[e >> 1], s = o && o.length; r < s; r++) e & 1 ? o[r].call(t) : n = o[r].call(t, n);
11
+ return n;
12
+ }, T = (i, e, t, n, r, o) => {
13
+ var s, l, f, g, E, a = e & 7, R = !!(e & 8), h = !!(e & 16), S = a > 3 ? i.length + 1 : a ? R ? 1 : 2 : 0, M = fe[a + 5], u = a > 3 && (i[S - 1] = []), m = i[S] || (i[S] = []), d = a && (!h && !R && (r = r.prototype), a < 5 && (a > 3 || !h) && $e(a < 4 ? r : { get [t]() {
14
+ return me(this, o);
15
+ }, set [t](v) {
16
+ return de(this, o, v);
17
17
  } }, t));
18
- c ? a && c < 4 && ce(o, (c > 2 ? "set " : c > 1 ? "get " : "") + t) : ce(r, t);
19
- for (var P = i.length - 1; P >= 0; P--)
20
- d = We(c, t, m = {}, n[3], Ge), c && (d.static = C, d.private = a, T = d.access = { has: a ? (p) => Ye(r, p) : (p) => t in p }, c ^ 3 && (T.get = a ? (p) => (c ^ 1 ? ae : Xe)(p, r, c ^ 4 ? o : w.get) : (p) => p[t]), c > 2 && (T.set = a ? (p, F) => me(p, r, F, c ^ 4 ? o : w.set) : (p, F) => p[t] = F)), l = (0, i[P])(c ? c < 4 ? a ? o : w[D] : c > 4 ? void 0 : { get: w.get, set: w.set } : r, d), m._ = 1, c ^ 4 || l === void 0 ? O(l) && (c > 4 ? le.unshift(l) : c ? a ? o = l : w[D] = l : r = l) : typeof l != "object" || l === null ? I("Object expected") : (O(s = l.get) && (w.get = s), O(s = l.set) && (w.set = s), O(s = l.init) && le.unshift(s));
21
- return c || He(n, r), w && j(r, t, w), a ? c ^ 4 ? o : w : r;
18
+ a ? h && a < 4 && ue(o, (a > 2 ? "set " : a > 1 ? "get " : "") + t) : ue(r, t);
19
+ for (var C = n.length - 1; C >= 0; C--)
20
+ g = Be(a, t, f = {}, i[3], m), a && (g.static = R, g.private = h, E = g.access = { has: h ? (v) => Je(r, v) : (v) => t in v }, a ^ 3 && (E.get = h ? (v) => (a ^ 1 ? me : We)(v, r, a ^ 4 ? o : d.get) : (v) => v[t]), a > 2 && (E.set = h ? (v, L) => de(v, r, L, a ^ 4 ? o : d.set) : (v, L) => v[t] = L)), l = (0, n[C])(a ? a < 4 ? h ? o : d[M] : a > 4 ? void 0 : { get: d.get, set: d.set } : r, g), f._ = 1, a ^ 4 || l === void 0 ? O(l) && (a > 4 ? u.unshift(l) : a ? h ? o = l : d[M] = l : r = l) : typeof l != "object" || l === null ? j("Object expected") : (O(s = l.get) && (d.get = s), O(s = l.set) && (d.set = s), O(s = l.init) && u.unshift(s));
21
+ return a || Ue(i, r), d && N(r, t, d), h ? a ^ 4 ? o : d : r;
22
22
  };
23
- var k = (n, e, t) => e.has(n) || I("Cannot " + t), Ye = (n, e) => Object(e) !== e ? I('Cannot use the "in" operator on this value') : n.has(e), ae = (n, e, t) => (k(n, e, "read from private field"), t ? t.call(n) : e.get(n));
24
- var me = (n, e, t, i) => (k(n, e, "write to private field"), i ? i.call(n, t) : e.set(n, t), t), Xe = (n, e, t) => (k(n, e, "access private method"), t);
25
- import { inject as u, ElementRef as R, contentChild as x, TemplateRef as L, effect as y, Directive as E, input as f, InjectionToken as ze, Injectable as Be, makeEnvironmentProviders as Je, EventEmitter as fe, createComponent as pe, output as S, computed as A, EnvironmentInjector as Ke, ApplicationRef as Qe, ViewContainerRef as Ze } from "@angular/core";
26
- import { FormGroup as he } from "@angular/forms";
27
- import { DataGridElement as et } from "@toolbox-web/grid";
28
- import { MasterDetailPlugin as ge, ResponsivePlugin as tt } from "@toolbox-web/grid/all";
29
- function ve(n) {
30
- if (typeof n != "function" || n.prototype === void 0)
23
+ var V = (i, e, t) => e.has(i) || j("Cannot " + t), Je = (i, e) => Object(e) !== e ? j('Cannot use the "in" operator on this value') : i.has(e), me = (i, e, t) => (V(i, e, "read from private field"), t ? t.call(i) : e.get(i));
24
+ var de = (i, e, t, n) => (V(i, e, "write to private field"), n ? n.call(i, t) : e.set(i, t), t), We = (i, e, t) => (V(i, e, "access private method"), t);
25
+ import { inject as w, ElementRef as A, contentChild as k, TemplateRef as F, effect as D, Directive as x, input as c, InjectionToken as He, Injectable as Ye, makeEnvironmentProviders as Xe, EventEmitter as ge, createComponent as he, signal as G, afterNextRender as Ke, computed as P, output as p, EnvironmentInjector as Qe, ApplicationRef as Ze, ViewContainerRef as et } from "@angular/core";
26
+ import { FormGroup as ve } from "@angular/forms";
27
+ import { c as tt } from "./feature-registry-C-cKloXB.js";
28
+ import { a as wt, g as Rt, b as Ct, i as Et, r as yt } from "./feature-registry-C-cKloXB.js";
29
+ import { DataGridElement as nt } from "@toolbox-web/grid";
30
+ function we(i) {
31
+ if (typeof i != "function" || i.prototype === void 0)
31
32
  return !1;
32
- if (Object.prototype.hasOwnProperty.call(n, "ɵcmp") || Object.prototype.hasOwnProperty.call(n, "ɵfac"))
33
+ if (Object.prototype.hasOwnProperty.call(i, "ɵcmp") || Object.prototype.hasOwnProperty.call(i, "ɵfac"))
33
34
  return !0;
34
- const e = Function.prototype.toString.call(n);
35
+ const e = Function.prototype.toString.call(i);
35
36
  return e.startsWith("class ") || e.startsWith("class{");
36
37
  }
37
- const Se = /* @__PURE__ */ new Map();
38
- function Pe(n) {
39
- return Se.get(n);
38
+ const Oe = /* @__PURE__ */ new Map();
39
+ function je(i) {
40
+ return Oe.get(i);
40
41
  }
41
- var Ce, X;
42
- Ce = [E({ selector: "tbw-grid-column-editor" })];
43
- class V {
44
- elementRef = u(R);
42
+ var ye, X;
43
+ ye = [x({ selector: "tbw-grid-column-editor" })];
44
+ class q {
45
+ elementRef = w(A);
45
46
  /**
46
47
  * Query for the ng-template content child.
47
48
  */
48
- template = x(L);
49
+ template = k(F);
49
50
  /** Effect that triggers when the template is available */
50
- onTemplateReceived = y(() => {
51
+ onTemplateReceived = D(() => {
51
52
  const e = this.template();
52
- e && Se.set(this.elementRef.nativeElement, e);
53
+ e && Oe.set(this.elementRef.nativeElement, e);
53
54
  });
54
55
  /**
55
56
  * Static type guard for template context.
@@ -59,23 +60,23 @@ class V {
59
60
  return !0;
60
61
  }
61
62
  }
62
- X = h(null), V = v(X, 0, "GridColumnEditor", Ce, V), g(X, 1, V);
63
- const Fe = /* @__PURE__ */ new Map();
64
- function je(n) {
65
- return Fe.get(n);
63
+ X = y(null), q = T(X, 0, "GridColumnEditor", ye, q), b(X, 1, q);
64
+ const ke = /* @__PURE__ */ new Map();
65
+ function Ie(i) {
66
+ return ke.get(i);
66
67
  }
67
- var ye, z;
68
- ye = [E({ selector: "tbw-grid-column-view" })];
69
- class N {
70
- elementRef = u(R);
68
+ var be, K;
69
+ be = [x({ selector: "tbw-grid-column-view" })];
70
+ class _ {
71
+ elementRef = w(A);
71
72
  /**
72
73
  * Query for the ng-template content child.
73
74
  */
74
- template = x(L);
75
+ template = k(F);
75
76
  /** Effect that triggers when the template is available */
76
- onTemplateReceived = y(() => {
77
+ onTemplateReceived = D(() => {
77
78
  const e = this.template();
78
- e && Fe.set(this.elementRef.nativeElement, e);
79
+ e && ke.set(this.elementRef.nativeElement, e);
79
80
  });
80
81
  /**
81
82
  * Static type guard for template context.
@@ -85,29 +86,29 @@ class N {
85
86
  return !0;
86
87
  }
87
88
  }
88
- z = h(null), N = v(z, 0, "GridColumnView", ye, N), g(z, 1, N);
89
- const ke = /* @__PURE__ */ new Map();
90
- function we(n) {
91
- const e = n.querySelector("tbw-grid-detail");
89
+ K = y(null), _ = T(K, 0, "GridColumnView", be, _), b(K, 1, _);
90
+ const Ne = /* @__PURE__ */ new Map();
91
+ function Re(i) {
92
+ const e = i.querySelector("tbw-grid-detail");
92
93
  if (e)
93
- return ke.get(e);
94
+ return Ne.get(e);
94
95
  }
95
- var be, B;
96
- be = [E({ selector: "tbw-grid-detail" })];
97
- class _ {
98
- elementRef = u(R);
96
+ var Te, Q;
97
+ Te = [x({ selector: "tbw-grid-detail" })];
98
+ class $ {
99
+ elementRef = w(A);
99
100
  /** Whether to show the expand/collapse column. Default: true */
100
- showExpandColumn = f(!0);
101
+ showExpandColumn = c(!0);
101
102
  /** Animation style for expand/collapse. Default: 'slide' */
102
- animation = f("slide");
103
+ animation = c("slide");
103
104
  /**
104
105
  * Query for the ng-template content child.
105
106
  */
106
- template = x(L);
107
+ template = k(F);
107
108
  /** Effect that triggers when the template is available */
108
- onTemplateReceived = y(() => {
109
+ onTemplateReceived = D(() => {
109
110
  const e = this.template();
110
- e && ke.set(this.elementRef.nativeElement, e);
111
+ e && Ne.set(this.elementRef.nativeElement, e);
111
112
  });
112
113
  /**
113
114
  * Static type guard for template context.
@@ -117,62 +118,62 @@ class _ {
117
118
  return !0;
118
119
  }
119
120
  }
120
- B = h(null), _ = v(B, 0, "GridDetailView", be, _), g(B, 1, _);
121
- const ie = /* @__PURE__ */ Symbol("formArrayContext");
122
- function rt(n) {
123
- return n[ie];
121
+ Q = y(null), $ = T(Q, 0, "GridDetailView", Te, $), b(Q, 1, $);
122
+ const le = /* @__PURE__ */ Symbol("formArrayContext");
123
+ function rt(i) {
124
+ return i[le];
124
125
  }
125
- var Te, J;
126
- Te = [E({
126
+ var Ae, Z;
127
+ Ae = [x({
127
128
  selector: "tbw-grid[formArray]"
128
129
  })];
129
- class G {
130
- elementRef = u(R);
130
+ class z {
131
+ elementRef = w(A);
131
132
  cellCommitListener = null;
132
133
  touchListener = null;
133
134
  /**
134
135
  * The FormArray to bind to the grid.
135
136
  */
136
- formArray = f.required();
137
+ formArray = c.required();
137
138
  /**
138
139
  * Effect that syncs the FormArray value to the grid rows.
139
140
  */
140
- syncFormArrayToGrid = y(() => {
141
+ syncFormArrayToGrid = D(() => {
141
142
  const e = this.formArray(), t = this.elementRef.nativeElement;
142
143
  t && e && (t.rows = e.getRawValue());
143
144
  });
144
145
  ngOnInit() {
145
146
  const e = this.elementRef.nativeElement;
146
- e && (this.#r(e), this.cellCommitListener = (t) => {
147
- const i = t.detail;
148
- this.#i(i);
147
+ e && (this.#n(e), this.cellCommitListener = (t) => {
148
+ const n = t.detail;
149
+ this.#i(n);
149
150
  }, e.addEventListener("cell-commit", this.cellCommitListener), this.touchListener = () => {
150
151
  this.formArray().markAsTouched(), this.touchListener && (e.removeEventListener("click", this.touchListener), this.touchListener = null);
151
152
  }, e.addEventListener("click", this.touchListener));
152
153
  }
153
154
  ngOnDestroy() {
154
155
  const e = this.elementRef.nativeElement;
155
- e && (this.cellCommitListener && e.removeEventListener("cell-commit", this.cellCommitListener), this.touchListener && e.removeEventListener("click", this.touchListener), this.#n(e));
156
+ e && (this.cellCommitListener && e.removeEventListener("cell-commit", this.cellCommitListener), this.touchListener && e.removeEventListener("click", this.touchListener), this.#r(e));
156
157
  }
157
158
  /**
158
159
  * Checks if the FormArray contains FormGroups.
159
160
  */
160
161
  #t() {
161
162
  const e = this.formArray();
162
- return e.length === 0 ? !1 : e.at(0) instanceof he;
163
+ return e.length === 0 ? !1 : e.at(0) instanceof ve;
163
164
  }
164
165
  /**
165
166
  * Gets the FormGroup at a specific row index.
166
167
  */
167
168
  #e(e) {
168
- const i = this.formArray().at(e);
169
- return i instanceof he ? i : void 0;
169
+ const n = this.formArray().at(e);
170
+ return n instanceof ve ? n : void 0;
170
171
  }
171
172
  /**
172
173
  * Stores the FormArrayContext on the grid element.
173
174
  */
174
- #r(e) {
175
- const t = (r) => this.#e(r), i = {
175
+ #n(e) {
176
+ const t = (r) => this.#e(r), n = {
176
177
  getRow: (r) => {
177
178
  const s = this.formArray().at(r);
178
179
  return s ? s.value : null;
@@ -180,8 +181,8 @@ class G {
180
181
  updateField: (r, o, s) => {
181
182
  const l = t(r);
182
183
  if (l) {
183
- const m = l.get(o);
184
- m && (m.setValue(s), m.markAsDirty());
184
+ const f = l.get(o);
185
+ f && (f.setValue(s), f.markAsDirty());
185
186
  }
186
187
  },
187
188
  getValue: () => this.formArray().getRawValue(),
@@ -209,52 +210,52 @@ class G {
209
210
  if (!o) return null;
210
211
  const s = {};
211
212
  let l = !1;
212
- return Object.keys(o.controls).forEach((m) => {
213
- const d = o.get(m);
214
- d?.errors && (s[m] = d.errors, l = !0);
213
+ return Object.keys(o.controls).forEach((f) => {
214
+ const g = o.get(f);
215
+ g?.errors && (s[f] = g.errors, l = !0);
215
216
  }), o.errors && (s._group = o.errors, l = !0), l ? s : null;
216
217
  }
217
218
  };
218
- e[ie] = i;
219
+ e[le] = n;
219
220
  }
220
221
  /**
221
222
  * Clears the FormArrayContext from the grid element.
222
223
  */
223
- #n(e) {
224
- delete e[ie];
224
+ #r(e) {
225
+ delete e[le];
225
226
  }
226
227
  /**
227
228
  * Handles cell-commit events by updating the FormControl in the FormGroup.
228
229
  */
229
230
  #i(e) {
230
- const { rowIndex: t, field: i, value: r } = e, o = this.#e(t);
231
+ const { rowIndex: t, field: n, value: r } = e, o = this.#e(t);
231
232
  if (o) {
232
- const s = o.get(i);
233
+ const s = o.get(n);
233
234
  s && (s.setValue(r), s.markAsDirty(), s.markAsTouched());
234
235
  }
235
236
  }
236
237
  }
237
- J = h(null), G = v(J, 0, "GridFormArray", Te, G), g(J, 1, G);
238
+ Z = y(null), z = T(Z, 0, "GridFormArray", Ae, z), b(Z, 1, z);
238
239
  const Ve = /* @__PURE__ */ new Map();
239
- function nt(n) {
240
- const e = n.querySelector("tbw-grid-responsive-card");
240
+ function it(i) {
241
+ const e = i.querySelector("tbw-grid-responsive-card");
241
242
  if (e)
242
243
  return Ve.get(e);
243
244
  }
244
- var Ae, K;
245
- Ae = [E({
245
+ var xe, ee;
246
+ xe = [x({
246
247
  selector: "tbw-grid-responsive-card"
247
248
  })];
248
- class q {
249
- elementRef = u(R);
249
+ class B {
250
+ elementRef = w(A);
250
251
  /**
251
252
  * The ng-template containing the card content.
252
253
  */
253
- template = x(L);
254
+ template = k(F);
254
255
  /**
255
256
  * Effect that registers the template when it becomes available.
256
257
  */
257
- onTemplateReceived = y(() => {
258
+ onTemplateReceived = D(() => {
258
259
  const e = this.template();
259
260
  e && Ve.set(
260
261
  this.elementRef.nativeElement,
@@ -268,38 +269,38 @@ class q {
268
269
  return !0;
269
270
  }
270
271
  }
271
- K = h(null), q = v(K, 0, "GridResponsiveCard", Ae, q), g(K, 1, q);
272
- const Ne = /* @__PURE__ */ new Map();
273
- function it(n) {
274
- return Ne.get(n);
272
+ ee = y(null), B = T(ee, 0, "GridResponsiveCard", xe, B), b(ee, 1, B);
273
+ const Ge = /* @__PURE__ */ new Map();
274
+ function ot(i) {
275
+ return Ge.get(i);
275
276
  }
276
- var Le, Q;
277
- Le = [E({ selector: "tbw-grid-tool-panel" })];
278
- class $ {
279
- elementRef = u(R);
277
+ var Se, te;
278
+ Se = [x({ selector: "tbw-grid-tool-panel" })];
279
+ class U {
280
+ elementRef = w(A);
280
281
  /** Unique panel identifier (required) */
281
- id = f.required({ alias: "id" });
282
+ id = c.required({ alias: "id" });
282
283
  /** Panel title shown in accordion header (required) */
283
- title = f.required({ alias: "title" });
284
+ title = c.required({ alias: "title" });
284
285
  /** Icon for accordion section header (emoji or text) */
285
- icon = f();
286
+ icon = c();
286
287
  /** Tooltip for accordion section header */
287
- tooltip = f();
288
+ tooltip = c();
288
289
  /** Panel order priority (lower = first, default: 100) */
289
- order = f(100);
290
+ order = c(100);
290
291
  /**
291
292
  * Query for the ng-template content child.
292
293
  */
293
- template = x(L);
294
+ template = k(F);
294
295
  /** Effect that triggers when the template is available */
295
- onTemplateReceived = y(() => {
296
+ onTemplateReceived = D(() => {
296
297
  const e = this.template(), t = this.elementRef.nativeElement;
297
298
  if (e) {
298
299
  t.setAttribute("id", this.id()), t.setAttribute("title", this.title());
299
- const i = this.icon();
300
- i && t.setAttribute("icon", i);
300
+ const n = this.icon();
301
+ n && t.setAttribute("icon", n);
301
302
  const r = this.tooltip();
302
- r && t.setAttribute("tooltip", r), t.setAttribute("order", String(this.order())), Ne.set(t, e);
303
+ r && t.setAttribute("tooltip", r), t.setAttribute("order", String(this.order())), Ge.set(t, e);
303
304
  }
304
305
  });
305
306
  /**
@@ -310,30 +311,30 @@ class $ {
310
311
  return !0;
311
312
  }
312
313
  }
313
- Q = h(null), $ = v(Q, 0, "GridToolPanel", Le, $), g(Q, 1, $);
314
- const oe = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Map();
315
- function ot(n) {
316
- const e = oe.get(n);
314
+ te = y(null), U = T(te, 0, "GridToolPanel", Se, U), b(te, 1, U);
315
+ const ce = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new Map();
316
+ function st(i) {
317
+ const e = ce.get(i);
317
318
  if (e) return e;
318
- const t = n.querySelector("tbw-grid-column-view");
319
+ const t = i.querySelector("tbw-grid-column-view");
319
320
  if (t)
320
- return je(t);
321
+ return Ie(t);
321
322
  }
322
- function st(n) {
323
- const e = se.get(n);
323
+ function lt(i) {
324
+ const e = ae.get(i);
324
325
  if (e) return e;
325
- const t = n.querySelector("tbw-grid-column-editor");
326
+ const t = i.querySelector("tbw-grid-column-editor");
326
327
  if (t)
327
- return Pe(t);
328
+ return je(t);
328
329
  }
329
- var De, Z;
330
- De = [E({ selector: "[tbwRenderer]" })];
331
- class U {
332
- template = u(L);
333
- elementRef = u(R);
330
+ var Le, ne;
331
+ Le = [x({ selector: "[tbwRenderer]" })];
332
+ class J {
333
+ template = w(F);
334
+ elementRef = w(A);
334
335
  columnElement = null;
335
336
  constructor() {
336
- y(() => {
337
+ D(() => {
337
338
  this.registerTemplate();
338
339
  });
339
340
  }
@@ -341,10 +342,10 @@ class U {
341
342
  let e = this.elementRef.nativeElement?.parentElement;
342
343
  for (; e && e.tagName !== "TBW-GRID-COLUMN"; )
343
344
  e = e.parentElement;
344
- e && (this.columnElement = e, oe.set(e, this.template));
345
+ e && (this.columnElement = e, ce.set(e, this.template));
345
346
  }
346
347
  ngOnDestroy() {
347
- this.columnElement && oe.delete(this.columnElement);
348
+ this.columnElement && ce.delete(this.columnElement);
348
349
  }
349
350
  /**
350
351
  * Static type guard for template context.
@@ -354,15 +355,15 @@ class U {
354
355
  return !0;
355
356
  }
356
357
  }
357
- Z = h(null), U = v(Z, 0, "TbwRenderer", De, U), g(Z, 1, U);
358
- var Oe, ee;
359
- Oe = [E({ selector: "[tbwEditor]" })];
358
+ ne = y(null), J = T(ne, 0, "TbwRenderer", Le, J), b(ne, 1, J);
359
+ var De, re;
360
+ De = [x({ selector: "[tbwEditor]" })];
360
361
  class W {
361
- template = u(L);
362
- elementRef = u(R);
362
+ template = w(F);
363
+ elementRef = w(A);
363
364
  columnElement = null;
364
365
  constructor() {
365
- y(() => {
366
+ D(() => {
366
367
  this.registerTemplate();
367
368
  });
368
369
  }
@@ -370,10 +371,10 @@ class W {
370
371
  let e = this.elementRef.nativeElement?.parentElement;
371
372
  for (; e && e.tagName !== "TBW-GRID-COLUMN"; )
372
373
  e = e.parentElement;
373
- e && (this.columnElement = e, se.set(e, this.template));
374
+ e && (this.columnElement = e, ae.set(e, this.template));
374
375
  }
375
376
  ngOnDestroy() {
376
- this.columnElement && se.delete(this.columnElement);
377
+ this.columnElement && ae.delete(this.columnElement);
377
378
  }
378
379
  /**
379
380
  * Static type guard for template context.
@@ -383,17 +384,17 @@ class W {
383
384
  return !0;
384
385
  }
385
386
  }
386
- ee = h(null), W = v(ee, 0, "TbwEditor", Oe, W), g(ee, 1, W);
387
- const _e = new ze("GRID_TYPE_DEFAULTS");
388
- var Ie, te;
389
- Ie = [Be({ providedIn: "root" })];
390
- class M {
387
+ re = y(null), W = T(re, 0, "TbwEditor", De, W), b(re, 1, W);
388
+ const qe = new He("GRID_TYPE_DEFAULTS");
389
+ var Pe, ie;
390
+ Pe = [Ye({ providedIn: "root" })];
391
+ class I {
391
392
  defaults = /* @__PURE__ */ new Map();
392
393
  constructor() {
393
- const e = u(_e, { optional: !0 });
394
+ const e = w(qe, { optional: !0 });
394
395
  if (e)
395
- for (const [t, i] of Object.entries(e))
396
- this.defaults.set(t, i);
396
+ for (const [t, n] of Object.entries(e))
397
+ this.defaults.set(t, n);
397
398
  }
398
399
  /**
399
400
  * Register type-level defaults for a custom type.
@@ -444,23 +445,23 @@ class M {
444
445
  };
445
446
  }
446
447
  }
447
- te = h(null), M = v(te, 0, "GridTypeRegistry", Ie, M), g(te, 1, M);
448
- function ft(n) {
449
- return Je([{ provide: _e, useValue: n }]);
448
+ ie = y(null), I = T(ie, 0, "GridTypeRegistry", Pe, I), b(ie, 1, I);
449
+ function ft(i) {
450
+ return Xe([{ provide: qe, useValue: i }]);
450
451
  }
451
- function Re(n) {
452
- const e = ot(n);
453
- return e || je(n);
452
+ function Ce(i) {
453
+ const e = st(i);
454
+ return e || Ie(i);
454
455
  }
455
- function Ee(n) {
456
- const e = st(n);
457
- return e || Pe(n);
456
+ function Ee(i) {
457
+ const e = lt(i);
458
+ return e || je(i);
458
459
  }
459
- class lt {
460
- constructor(e, t, i) {
461
- this.injector = e, this.appRef = t, this.viewContainerRef = i, window.__ANGULAR_GRID_ADAPTER__ = this;
460
+ class ct {
461
+ constructor(e, t, n) {
462
+ this.injector = e, this.appRef = t, this.viewContainerRef = n, window.__ANGULAR_GRID_ADAPTER__ = this;
462
463
  try {
463
- this.typeRegistry = this.injector.get(M, null);
464
+ this.typeRegistry = this.injector.get(I, null);
464
465
  } catch {
465
466
  }
466
467
  }
@@ -496,7 +497,7 @@ class lt {
496
497
  processGridConfig(e) {
497
498
  if (!e.columns)
498
499
  return e;
499
- const t = e.columns.map((i) => this.processColumn(i));
500
+ const t = e.columns.map((n) => this.processColumn(n));
500
501
  return {
501
502
  ...e,
502
503
  columns: t
@@ -511,14 +512,14 @@ class lt {
511
512
  */
512
513
  processColumn(e) {
513
514
  const t = { ...e };
514
- return e.renderer && ve(e.renderer) && (t.renderer = this.createComponentRenderer(e.renderer)), e.editor && ve(e.editor) && (t.editor = this.createComponentEditor(e.editor)), t;
515
+ return e.renderer && we(e.renderer) && (t.renderer = this.createComponentRenderer(e.renderer)), e.editor && we(e.editor) && (t.editor = this.createComponentEditor(e.editor)), t;
515
516
  }
516
517
  /**
517
518
  * Determines if this adapter can handle the given element.
518
519
  * Checks if a template is registered for this element (structural or nested).
519
520
  */
520
521
  canHandle(e) {
521
- return Re(e) !== void 0 || Ee(e) !== void 0;
522
+ return Ce(e) !== void 0 || Ee(e) !== void 0;
522
523
  }
523
524
  /**
524
525
  * Creates a view renderer function that creates an embedded view
@@ -528,14 +529,14 @@ class lt {
528
529
  * allowing the grid to use its default rendering.
529
530
  */
530
531
  createRenderer(e) {
531
- const t = Re(e);
532
+ const t = Ce(e);
532
533
  if (t)
533
- return (i) => {
534
+ return (n) => {
534
535
  const r = {
535
- $implicit: i.value,
536
- value: i.value,
537
- row: i.row,
538
- column: i.column
536
+ $implicit: n.value,
537
+ value: n.value,
538
+ row: n.row,
539
+ column: n.column
539
540
  }, o = this.viewContainerRef.createEmbeddedView(t, r);
540
541
  return this.viewRefs.push(o), o.detectChanges(), o.rootNodes[0];
541
542
  };
@@ -559,22 +560,22 @@ class lt {
559
560
  * As long as the component emits `(commit)` with the new value.
560
561
  */
561
562
  createEditor(e) {
562
- const t = Ee(e), i = e.closest("tbw-grid");
563
+ const t = Ee(e), n = e.closest("tbw-grid");
563
564
  return t ? (r) => {
564
- const o = (a) => r.commit(a), s = () => r.cancel(), l = new fe(), m = new fe();
565
- l.subscribe((a) => r.commit(a)), m.subscribe(() => r.cancel());
566
- let d;
567
- if (i) {
568
- const a = rt(i);
569
- if (a?.hasFormGroups) {
570
- const b = i.rows;
571
- if (b) {
572
- const D = b.indexOf(r.row);
573
- D >= 0 && (d = a.getControl(D, r.field));
565
+ const o = (h) => r.commit(h), s = () => r.cancel(), l = new ge(), f = new ge();
566
+ l.subscribe((h) => r.commit(h)), f.subscribe(() => r.cancel());
567
+ let g;
568
+ if (n) {
569
+ const h = rt(n);
570
+ if (h?.hasFormGroups) {
571
+ const S = n.rows;
572
+ if (S) {
573
+ const M = S.indexOf(r.row);
574
+ M >= 0 && (g = h.getControl(M, r.field));
574
575
  }
575
576
  }
576
577
  }
577
- const T = {
578
+ const E = {
578
579
  $implicit: r.value,
579
580
  value: r.value,
580
581
  row: r.row,
@@ -583,32 +584,32 @@ class lt {
583
584
  onCommit: o,
584
585
  onCancel: s,
585
586
  // FormControl from FormArray (if available)
586
- control: d,
587
+ control: g,
587
588
  // Deprecated: EventEmitters (for backwards compatibility)
588
589
  commit: l,
589
- cancel: m
590
- }, c = this.viewContainerRef.createEmbeddedView(t, T);
591
- this.viewRefs.push(c), c.detectChanges();
592
- const C = c.rootNodes[0];
593
- return C && C.addEventListener && (C.addEventListener("commit", (a) => {
594
- const b = a;
595
- r.commit(b.detail);
596
- }), C.addEventListener("cancel", () => {
590
+ cancel: f
591
+ }, a = this.viewContainerRef.createEmbeddedView(t, E);
592
+ this.viewRefs.push(a), a.detectChanges();
593
+ const R = a.rootNodes[0];
594
+ return R && R.addEventListener && (R.addEventListener("commit", (h) => {
595
+ const S = h;
596
+ r.commit(S.detail);
597
+ }), R.addEventListener("cancel", () => {
597
598
  r.cancel();
598
- })), C;
599
- } : (console.warn("[AngularGridAdapter] No editor template registered for element"), () => document.createElement("div"));
599
+ })), R;
600
+ } : () => document.createElement("div");
600
601
  }
601
602
  /**
602
603
  * Creates a detail renderer function for MasterDetailPlugin.
603
604
  * Renders Angular templates for expandable detail rows.
604
605
  */
605
606
  createDetailRenderer(e) {
606
- const t = we(e);
607
+ const t = Re(e);
607
608
  if (t)
608
- return (i) => {
609
+ return (n) => {
609
610
  const r = {
610
- $implicit: i,
611
- row: i
611
+ $implicit: n,
612
+ row: n
612
613
  }, o = this.viewContainerRef.createEmbeddedView(t, r);
613
614
  this.viewRefs.push(o), o.detectChanges();
614
615
  const s = document.createElement("div");
@@ -623,12 +624,12 @@ class lt {
623
624
  * without manual configuration in the Grid directive.
624
625
  */
625
626
  parseDetailElement(e) {
626
- const t = we(e.closest("tbw-grid"));
627
+ const t = Re(e.closest("tbw-grid"));
627
628
  if (t)
628
- return (i) => {
629
+ return (n) => {
629
630
  const r = {
630
- $implicit: i,
631
- row: i
631
+ $implicit: n,
632
+ row: n
632
633
  }, o = this.viewContainerRef.createEmbeddedView(t, r);
633
634
  this.viewRefs.push(o), o.detectChanges();
634
635
  const s = document.createElement("div");
@@ -643,17 +644,17 @@ class lt {
643
644
  * @returns A card renderer function or undefined if no template is found
644
645
  */
645
646
  createResponsiveCardRenderer(e) {
646
- const t = nt(e);
647
+ const t = it(e);
647
648
  if (t)
648
- return (i, r) => {
649
+ return (n, r) => {
649
650
  const o = {
650
- $implicit: i,
651
- row: i,
651
+ $implicit: n,
652
+ row: n,
652
653
  index: r
653
654
  }, s = this.viewContainerRef.createEmbeddedView(t, o);
654
655
  this.viewRefs.push(s), s.detectChanges();
655
656
  const l = document.createElement("div");
656
- return s.rootNodes.forEach((m) => l.appendChild(m)), l;
657
+ return s.rootNodes.forEach((f) => l.appendChild(f)), l;
657
658
  };
658
659
  }
659
660
  /**
@@ -661,14 +662,14 @@ class lt {
661
662
  * The renderer creates an Angular template-based panel content.
662
663
  */
663
664
  createToolPanelRenderer(e) {
664
- const t = it(e);
665
+ const t = ot(e);
665
666
  if (!t)
666
667
  return;
667
- const i = e.closest("tbw-grid");
668
+ const n = e.closest("tbw-grid");
668
669
  return (r) => {
669
670
  const o = {
670
- $implicit: i ?? r,
671
- grid: i ?? r
671
+ $implicit: n ?? r,
672
+ grid: n ?? r
672
673
  }, s = this.viewContainerRef.createEmbeddedView(t, o);
673
674
  return this.viewRefs.push(s), s.detectChanges(), s.rootNodes.forEach((l) => r.appendChild(l)), () => {
674
675
  const l = this.viewRefs.indexOf(s);
@@ -709,10 +710,10 @@ class lt {
709
710
  const t = this.typeRegistry.get(e);
710
711
  if (!t)
711
712
  return;
712
- const i = {
713
+ const n = {
713
714
  editorParams: t.editorParams
714
715
  };
715
- return t.renderer && (i.renderer = this.createComponentRenderer(t.renderer)), t.editor && (i.editor = this.createComponentEditor(t.editor)), i;
716
+ return t.renderer && (n.renderer = this.createComponentRenderer(t.renderer)), t.editor && (n.editor = this.createComponentEditor(t.editor)), n;
716
717
  }
717
718
  /**
718
719
  * Creates a renderer function from an Angular component class.
@@ -720,17 +721,17 @@ class lt {
720
721
  */
721
722
  createComponentRenderer(e) {
722
723
  return (t) => {
723
- const i = document.createElement("span");
724
- i.style.display = "contents";
725
- const r = pe(e, {
724
+ const n = document.createElement("span");
725
+ n.style.display = "contents";
726
+ const r = he(e, {
726
727
  environmentInjector: this.injector,
727
- hostElement: i
728
+ hostElement: n
728
729
  });
729
730
  return this.setComponentInputs(r, {
730
731
  value: t.value,
731
732
  row: t.row,
732
733
  column: t.column
733
- }), this.appRef.attachView(r.hostView), this.componentRefs.push(r), r.changeDetectorRef.detectChanges(), i;
734
+ }), this.appRef.attachView(r.hostView), this.componentRefs.push(r), r.changeDetectorRef.detectChanges(), n;
734
735
  };
735
736
  }
736
737
  /**
@@ -739,11 +740,11 @@ class lt {
739
740
  */
740
741
  createComponentEditor(e) {
741
742
  return (t) => {
742
- const i = document.createElement("span");
743
- i.style.display = "contents";
744
- const r = pe(e, {
743
+ const n = document.createElement("span");
744
+ n.style.display = "contents";
745
+ const r = he(e, {
745
746
  environmentInjector: this.injector,
746
- hostElement: i
747
+ hostElement: n
747
748
  });
748
749
  this.setComponentInputs(r, {
749
750
  value: t.value,
@@ -751,12 +752,12 @@ class lt {
751
752
  column: t.column
752
753
  }), this.appRef.attachView(r.hostView), this.componentRefs.push(r), r.changeDetectorRef.detectChanges();
753
754
  const o = r.instance;
754
- return this.subscribeToOutput(o, "commit", (s) => t.commit(s)), this.subscribeToOutput(o, "cancel", () => t.cancel()), i.addEventListener("commit", (s) => {
755
+ return this.subscribeToOutput(o, "commit", (s) => t.commit(s)), this.subscribeToOutput(o, "cancel", () => t.cancel()), n.addEventListener("commit", (s) => {
755
756
  const l = s;
756
757
  t.commit(l.detail);
757
- }), i.addEventListener("cancel", () => {
758
+ }), n.addEventListener("cancel", () => {
758
759
  t.cancel();
759
- }), i;
760
+ }), n;
760
761
  };
761
762
  }
762
763
  /**
@@ -764,18 +765,18 @@ class lt {
764
765
  * Works with both EventEmitter and OutputEmitterRef (signal outputs).
765
766
  * @internal
766
767
  */
767
- subscribeToOutput(e, t, i) {
768
+ subscribeToOutput(e, t, n) {
768
769
  const r = e[t];
769
- r && typeof r.subscribe == "function" && r.subscribe(i);
770
+ r && typeof r.subscribe == "function" && r.subscribe(n);
770
771
  }
771
772
  /**
772
773
  * Sets component inputs using Angular's setInput API.
773
774
  * @internal
774
775
  */
775
776
  setComponentInputs(e, t) {
776
- for (const [i, r] of Object.entries(t))
777
+ for (const [n, r] of Object.entries(t))
777
778
  try {
778
- e.setInput(i, r);
779
+ e.setInput(n, r);
779
780
  } catch {
780
781
  }
781
782
  }
@@ -787,10 +788,103 @@ class lt {
787
788
  this.viewRefs.forEach((e) => e.destroy()), this.viewRefs = [], this.componentRefs.forEach((e) => e.destroy()), this.componentRefs = [];
788
789
  }
789
790
  }
790
- var xe, re;
791
- xe = [E()];
791
+ function gt() {
792
+ const i = w(A), e = G(!1), t = G(null), n = G(null);
793
+ Ke(() => {
794
+ const u = i.nativeElement.querySelector("tbw-grid");
795
+ if (!u) {
796
+ console.warn("[injectGrid] No tbw-grid element found in component");
797
+ return;
798
+ }
799
+ n.set(u), u.ready?.().then(async () => {
800
+ e.set(!0);
801
+ const m = u.getConfig?.();
802
+ m && t.set(m);
803
+ });
804
+ });
805
+ const r = P(() => {
806
+ const u = t();
807
+ return u?.columns ? u.columns.filter((m) => !m.hidden) : [];
808
+ }), o = async () => {
809
+ const u = n();
810
+ return u ? u.getConfig?.() ?? null : null;
811
+ }, s = async () => {
812
+ const u = n();
813
+ u && await u.forceLayout?.();
814
+ }, l = async (u) => {
815
+ const m = n();
816
+ m && await m.toggleGroup?.(u);
817
+ }, f = (u, m) => {
818
+ n()?.registerStyles?.(u, m);
819
+ }, g = (u) => {
820
+ n()?.unregisterStyles?.(u);
821
+ }, E = () => {
822
+ const u = n(), m = u?.getPluginByName?.("selection");
823
+ if (!m) {
824
+ console.warn("[injectGrid] selectAll requires SelectionPlugin");
825
+ return;
826
+ }
827
+ if (m.config?.mode === "row") {
828
+ const d = u?.rows ?? [], C = new Set(d.map((v, L) => L));
829
+ m.selected = C, m.requestAfterRender?.();
830
+ }
831
+ }, a = () => {
832
+ const m = n()?.getPluginByName?.("selection");
833
+ if (!m) return;
834
+ const d = m.config?.mode;
835
+ d === "row" ? m.selected = /* @__PURE__ */ new Set() : (d === "range" || d === "cell") && (m.ranges = []), m.requestAfterRender?.();
836
+ }, R = () => {
837
+ const m = n()?.getPluginByName?.("selection");
838
+ if (!m) return /* @__PURE__ */ new Set();
839
+ if (m.config?.mode === "row")
840
+ return new Set(m.selected ?? []);
841
+ const d = m.ranges ?? [], C = /* @__PURE__ */ new Set();
842
+ for (const v of d)
843
+ for (let L = v.startRow; L <= v.endRow; L++)
844
+ C.add(L);
845
+ return C;
846
+ };
847
+ return {
848
+ element: n,
849
+ isReady: e,
850
+ config: t,
851
+ visibleColumns: r,
852
+ getConfig: o,
853
+ forceLayout: s,
854
+ toggleGroup: l,
855
+ registerStyles: f,
856
+ unregisterStyles: g,
857
+ selectAll: E,
858
+ clearSelection: a,
859
+ getSelectedIndices: R,
860
+ getSelectedRows: () => {
861
+ const u = n();
862
+ if (!u) return [];
863
+ const m = u.rows ?? [], d = R();
864
+ return Array.from(d).filter((C) => C >= 0 && C < m.length).map((C) => m[C]);
865
+ },
866
+ exportToCsv: (u) => {
867
+ const d = n()?.getPluginByName?.("export");
868
+ if (!d) {
869
+ console.warn("[injectGrid] exportToCsv requires ExportPlugin");
870
+ return;
871
+ }
872
+ d.exportToCsv?.(u);
873
+ },
874
+ exportToJson: (u) => {
875
+ const d = n()?.getPluginByName?.("export");
876
+ if (!d) {
877
+ console.warn("[injectGrid] exportToJson requires ExportPlugin");
878
+ return;
879
+ }
880
+ d.exportToJson?.(u);
881
+ }
882
+ };
883
+ }
884
+ var Fe, oe;
885
+ Fe = [x()];
792
886
  class H {
793
- elementRef = u(R);
887
+ elementRef = w(A);
794
888
  // ============================================================================
795
889
  // Inputs
796
890
  // ============================================================================
@@ -798,31 +892,31 @@ class H {
798
892
  * The cell value. Used when FormControl is not available.
799
893
  * When a FormControl is provided, value is derived from control.value instead.
800
894
  */
801
- value = f();
895
+ value = c();
802
896
  /**
803
897
  * The full row data object.
804
898
  */
805
- row = f();
899
+ row = c();
806
900
  /**
807
901
  * The column configuration.
808
902
  */
809
- column = f();
903
+ column = c();
810
904
  /**
811
905
  * The FormControl for this cell, if the grid is bound to a FormArray.
812
906
  * When provided, the editor uses control.value instead of the value input.
813
907
  */
814
- control = f();
908
+ control = c();
815
909
  // ============================================================================
816
910
  // Outputs
817
911
  // ============================================================================
818
912
  /**
819
913
  * Emits when the user commits a new value.
820
914
  */
821
- commit = S();
915
+ commit = p();
822
916
  /**
823
917
  * Emits when the user cancels editing.
824
918
  */
825
- cancel = S();
919
+ cancel = p();
826
920
  // ============================================================================
827
921
  // Computed State
828
922
  // ============================================================================
@@ -830,7 +924,7 @@ class H {
830
924
  * The current value, derived from FormControl if available, otherwise from value input.
831
925
  * This is the recommended way to get the current value in your editor template.
832
926
  */
833
- currentValue = A(() => {
927
+ currentValue = P(() => {
834
928
  const e = this.control();
835
929
  return e ? e.value : this.value();
836
930
  });
@@ -838,21 +932,21 @@ class H {
838
932
  * Whether the control is invalid (has validation errors).
839
933
  * Returns false if no FormControl is available.
840
934
  */
841
- isInvalid = A(() => this.control()?.invalid ?? !1);
935
+ isInvalid = P(() => this.control()?.invalid ?? !1);
842
936
  /**
843
937
  * Whether the control is dirty (has been modified).
844
938
  * Returns false if no FormControl is available.
845
939
  */
846
- isDirty = A(() => this.control()?.dirty ?? !1);
940
+ isDirty = P(() => this.control()?.dirty ?? !1);
847
941
  /**
848
942
  * Whether the control has been touched.
849
943
  * Returns false if no FormControl is available.
850
944
  */
851
- isTouched = A(() => this.control()?.touched ?? !1);
945
+ isTouched = P(() => this.control()?.touched ?? !1);
852
946
  /**
853
947
  * Whether the control has any validation errors.
854
948
  */
855
- hasErrors = A(() => {
949
+ hasErrors = P(() => {
856
950
  const e = this.control();
857
951
  return e?.errors != null && Object.keys(e.errors).length > 0;
858
952
  });
@@ -860,7 +954,7 @@ class H {
860
954
  * The first error message from the control's validation errors.
861
955
  * Returns an empty string if no errors.
862
956
  */
863
- firstErrorMessage = A(() => {
957
+ firstErrorMessage = P(() => {
864
958
  const e = this.control();
865
959
  if (!e?.errors) return "";
866
960
  const t = Object.keys(e.errors)[0];
@@ -869,9 +963,9 @@ class H {
869
963
  /**
870
964
  * All error messages from the control's validation errors.
871
965
  */
872
- allErrorMessages = A(() => {
966
+ allErrorMessages = P(() => {
873
967
  const e = this.control();
874
- return e?.errors ? Object.entries(e.errors).map(([t, i]) => this.getErrorMessage(t, i)) : [];
968
+ return e?.errors ? Object.entries(e.errors).map(([t, n]) => this.getErrorMessage(t, n)) : [];
875
969
  });
876
970
  // ============================================================================
877
971
  // Methods
@@ -920,25 +1014,29 @@ class H {
920
1014
  }
921
1015
  }
922
1016
  }
923
- re = h(null), H = v(re, 0, "BaseGridEditor", xe, H), g(re, 1, H);
924
- var Me, ne;
925
- Me = [E({ selector: "tbw-grid" })];
1017
+ oe = y(null), H = T(oe, 0, "BaseGridEditor", Fe, H), b(oe, 1, H);
1018
+ var Me, se;
1019
+ Me = [x({ selector: "tbw-grid" })];
926
1020
  class Y {
927
- elementRef = u(R);
928
- injector = u(Ke);
929
- appRef = u(Qe);
930
- viewContainerRef = u(Ze);
1021
+ elementRef = w(A);
1022
+ injector = w(Qe);
1023
+ appRef = w(Ze);
1024
+ viewContainerRef = w(et);
931
1025
  adapter = null;
932
- cellCommitListener = null;
933
1026
  constructor() {
934
- y(() => {
1027
+ D(() => {
935
1028
  const e = this.angularConfig();
936
- if (!e || !this.adapter) return;
937
- const t = this.adapter.processGridConfig(e), i = this.elementRef.nativeElement;
938
- i.gridConfig = t;
1029
+ if (!this.adapter) return;
1030
+ const t = e ? this.adapter.processGridConfig(e) : {}, n = this.createFeaturePlugins(), r = t.plugins || [], o = [...n, ...r], s = this.sortable(), l = this.filterable(), f = this.selectable(), g = {};
1031
+ s !== void 0 && (g.sortable = s), l !== void 0 && (g.filterable = l), f !== void 0 && (g.selectable = f);
1032
+ const E = this.elementRef.nativeElement;
1033
+ E.gridConfig = {
1034
+ ...t,
1035
+ ...g,
1036
+ plugins: o.length > 0 ? o : void 0
1037
+ };
939
1038
  });
940
1039
  }
941
- rowCommitListener = null;
942
1040
  /**
943
1041
  * Custom CSS styles to inject into the grid.
944
1042
  * Use this to style custom cell renderers, editors, or detail panels.
@@ -956,7 +1054,68 @@ class Y {
956
1054
  * <tbw-grid [customStyles]="customStyles">...</tbw-grid>
957
1055
  * ```
958
1056
  */
959
- customStyles = f();
1057
+ customStyles = c();
1058
+ /**
1059
+ * Grid-wide sorting toggle.
1060
+ * When false, disables sorting for all columns regardless of their individual `sortable` setting.
1061
+ * When true (default), columns with `sortable: true` can be sorted.
1062
+ *
1063
+ * This is a core grid config property, not a plugin feature.
1064
+ * For multi-column sorting, also add the `[multiSort]` feature.
1065
+ *
1066
+ * @default true
1067
+ *
1068
+ * @example
1069
+ * ```html
1070
+ * <!-- Disable all sorting -->
1071
+ * <tbw-grid [sortable]="false" />
1072
+ *
1073
+ * <!-- Enable sorting (default) - columns still need sortable: true -->
1074
+ * <tbw-grid [sortable]="true" />
1075
+ *
1076
+ * <!-- Enable multi-column sorting -->
1077
+ * <tbw-grid [sortable]="true" [multiSort]="true" />
1078
+ * ```
1079
+ */
1080
+ sortable = c();
1081
+ /**
1082
+ * Grid-wide filtering toggle.
1083
+ * When false, disables filtering for all columns regardless of their individual `filterable` setting.
1084
+ * When true (default), columns with `filterable: true` can be filtered.
1085
+ *
1086
+ * Requires the FilteringPlugin to be loaded.
1087
+ *
1088
+ * @default true
1089
+ *
1090
+ * @example
1091
+ * ```html
1092
+ * <!-- Disable all filtering -->
1093
+ * <tbw-grid [filterable]="false" [filtering]="true" />
1094
+ *
1095
+ * <!-- Enable filtering (default) -->
1096
+ * <tbw-grid [filterable]="true" [filtering]="true" />
1097
+ * ```
1098
+ */
1099
+ filterable = c();
1100
+ /**
1101
+ * Grid-wide selection toggle.
1102
+ * When false, disables selection for all rows/cells.
1103
+ * When true (default), selection is enabled based on plugin mode.
1104
+ *
1105
+ * Requires the SelectionPlugin to be loaded.
1106
+ *
1107
+ * @default true
1108
+ *
1109
+ * @example
1110
+ * ```html
1111
+ * <!-- Disable all selection -->
1112
+ * <tbw-grid [selectable]="false" [selection]="'range'" />
1113
+ *
1114
+ * <!-- Enable selection (default) -->
1115
+ * <tbw-grid [selectable]="true" [selection]="'range'" />
1116
+ * ```
1117
+ */
1118
+ selectable = c();
960
1119
  /**
961
1120
  * Angular-specific grid configuration that supports component classes for renderers/editors.
962
1121
  *
@@ -993,7 +1152,401 @@ class Y {
993
1152
  * ```
994
1153
  */
995
1154
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
996
- angularConfig = f();
1155
+ angularConfig = c();
1156
+ // ═══════════════════════════════════════════════════════════════════════════
1157
+ // FEATURE INPUTS - Declarative plugin configuration
1158
+ // ═══════════════════════════════════════════════════════════════════════════
1159
+ /**
1160
+ * Enable cell/row/range selection.
1161
+ *
1162
+ * **Requires feature import:**
1163
+ * ```typescript
1164
+ * import '@toolbox-web/grid-angular/features/selection';
1165
+ * ```
1166
+ *
1167
+ * @example
1168
+ * ```html
1169
+ * <!-- Shorthand - just the mode -->
1170
+ * <tbw-grid [selection]="'range'" />
1171
+ *
1172
+ * <!-- Full config object -->
1173
+ * <tbw-grid [selection]="{ mode: 'range', checkbox: true }" />
1174
+ * ```
1175
+ */
1176
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1177
+ selection = c();
1178
+ /**
1179
+ * Enable inline cell editing.
1180
+ *
1181
+ * **Requires feature import:**
1182
+ * ```typescript
1183
+ * import '@toolbox-web/grid-angular/features/editing';
1184
+ * ```
1185
+ *
1186
+ * @example
1187
+ * ```html
1188
+ * <!-- Enable with default trigger (dblclick) -->
1189
+ * <tbw-grid [editing]="true" />
1190
+ *
1191
+ * <!-- Specify trigger -->
1192
+ * <tbw-grid [editing]="'click'" />
1193
+ * <tbw-grid [editing]="'dblclick'" />
1194
+ * <tbw-grid [editing]="'manual'" />
1195
+ * ```
1196
+ */
1197
+ editing = c();
1198
+ /**
1199
+ * Enable clipboard copy/paste. Requires selection to be enabled.
1200
+ *
1201
+ * **Requires feature import:**
1202
+ * ```typescript
1203
+ * import '@toolbox-web/grid-angular/features/clipboard';
1204
+ * ```
1205
+ *
1206
+ * @example
1207
+ * ```html
1208
+ * <tbw-grid [selection]="'range'" [clipboard]="true" />
1209
+ * ```
1210
+ */
1211
+ clipboard = c();
1212
+ /**
1213
+ * Enable right-click context menu.
1214
+ *
1215
+ * **Requires feature import:**
1216
+ * ```typescript
1217
+ * import '@toolbox-web/grid-angular/features/context-menu';
1218
+ * ```
1219
+ *
1220
+ * @example
1221
+ * ```html
1222
+ * <tbw-grid [contextMenu]="true" />
1223
+ * ```
1224
+ */
1225
+ contextMenu = c();
1226
+ /**
1227
+ * Enable multi-column sorting.
1228
+ *
1229
+ * Multi-sort allows users to sort by multiple columns simultaneously.
1230
+ * For basic single-column sorting, columns with `sortable: true` work without this plugin.
1231
+ *
1232
+ * **Requires feature import:**
1233
+ * ```typescript
1234
+ * import '@toolbox-web/grid-angular/features/multi-sort';
1235
+ * ```
1236
+ *
1237
+ * @example
1238
+ * ```html
1239
+ * <!-- Enable multi-column sorting -->
1240
+ * <tbw-grid [multiSort]="true" />
1241
+ *
1242
+ * <!-- Limit to single column (uses plugin but restricts to 1 column) -->
1243
+ * <tbw-grid [multiSort]="'single'" />
1244
+ *
1245
+ * <!-- Full config -->
1246
+ * <tbw-grid [multiSort]="{ maxSortColumns: 3 }" />
1247
+ * ```
1248
+ */
1249
+ multiSort = c();
1250
+ /**
1251
+ * @deprecated Use `[multiSort]` instead. Will be removed in a future version.
1252
+ *
1253
+ * Enable column sorting. This is an alias for `[multiSort]`.
1254
+ *
1255
+ * **Requires feature import:**
1256
+ * ```typescript
1257
+ * import '@toolbox-web/grid-angular/features/multi-sort';
1258
+ * ```
1259
+ */
1260
+ sorting = c();
1261
+ /**
1262
+ * Enable column filtering.
1263
+ *
1264
+ * **Requires feature import:**
1265
+ * ```typescript
1266
+ * import '@toolbox-web/grid-angular/features/filtering';
1267
+ * ```
1268
+ *
1269
+ * @example
1270
+ * ```html
1271
+ * <tbw-grid [filtering]="true" />
1272
+ * <tbw-grid [filtering]="{ debounceMs: 200 }" />
1273
+ * ```
1274
+ */
1275
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1276
+ filtering = c();
1277
+ /**
1278
+ * Enable column drag-to-reorder.
1279
+ *
1280
+ * **Requires feature import:**
1281
+ * ```typescript
1282
+ * import '@toolbox-web/grid-angular/features/reorder';
1283
+ * ```
1284
+ *
1285
+ * @example
1286
+ * ```html
1287
+ * <tbw-grid [reorder]="true" />
1288
+ * ```
1289
+ */
1290
+ reorder = c();
1291
+ /**
1292
+ * Enable column visibility toggle panel.
1293
+ *
1294
+ * **Requires feature import:**
1295
+ * ```typescript
1296
+ * import '@toolbox-web/grid-angular/features/visibility';
1297
+ * ```
1298
+ *
1299
+ * @example
1300
+ * ```html
1301
+ * <tbw-grid [visibility]="true" />
1302
+ * ```
1303
+ */
1304
+ visibility = c();
1305
+ /**
1306
+ * Enable pinned/sticky columns.
1307
+ * Columns are pinned via the `sticky` column property.
1308
+ *
1309
+ * **Requires feature import:**
1310
+ * ```typescript
1311
+ * import '@toolbox-web/grid-angular/features/pinned-columns';
1312
+ * ```
1313
+ *
1314
+ * @example
1315
+ * ```html
1316
+ * <tbw-grid [pinnedColumns]="true" [columns]="[
1317
+ * { field: 'id', sticky: 'left' },
1318
+ * { field: 'name' },
1319
+ * { field: 'actions', sticky: 'right' }
1320
+ * ]" />
1321
+ * ```
1322
+ */
1323
+ pinnedColumns = c();
1324
+ /**
1325
+ * Enable multi-level column headers (column groups).
1326
+ *
1327
+ * **Requires feature import:**
1328
+ * ```typescript
1329
+ * import '@toolbox-web/grid-angular/features/grouping-columns';
1330
+ * ```
1331
+ *
1332
+ * @example
1333
+ * ```html
1334
+ * <tbw-grid [groupingColumns]="{ columnGroups: [...] }" />
1335
+ * ```
1336
+ */
1337
+ groupingColumns = c();
1338
+ /**
1339
+ * Enable horizontal column virtualization for wide grids.
1340
+ *
1341
+ * **Requires feature import:**
1342
+ * ```typescript
1343
+ * import '@toolbox-web/grid-angular/features/column-virtualization';
1344
+ * ```
1345
+ *
1346
+ * @example
1347
+ * ```html
1348
+ * <tbw-grid [columnVirtualization]="true" />
1349
+ * ```
1350
+ */
1351
+ columnVirtualization = c();
1352
+ /**
1353
+ * Enable row drag-to-reorder.
1354
+ *
1355
+ * **Requires feature import:**
1356
+ * ```typescript
1357
+ * import '@toolbox-web/grid-angular/features/row-reorder';
1358
+ * ```
1359
+ *
1360
+ * @example
1361
+ * ```html
1362
+ * <tbw-grid [rowReorder]="true" />
1363
+ * ```
1364
+ */
1365
+ rowReorder = c();
1366
+ /**
1367
+ * Enable row grouping by field values.
1368
+ *
1369
+ * **Requires feature import:**
1370
+ * ```typescript
1371
+ * import '@toolbox-web/grid-angular/features/grouping-rows';
1372
+ * ```
1373
+ *
1374
+ * @example
1375
+ * ```html
1376
+ * <tbw-grid [groupingRows]="{ groupBy: ['department'] }" />
1377
+ * ```
1378
+ */
1379
+ groupingRows = c();
1380
+ /**
1381
+ * Enable pinned rows (aggregation/status bar).
1382
+ *
1383
+ * **Requires feature import:**
1384
+ * ```typescript
1385
+ * import '@toolbox-web/grid-angular/features/pinned-rows';
1386
+ * ```
1387
+ *
1388
+ * @example
1389
+ * ```html
1390
+ * <tbw-grid [pinnedRows]="{ bottom: [{ type: 'aggregation' }] }" />
1391
+ * ```
1392
+ */
1393
+ pinnedRows = c();
1394
+ /**
1395
+ * Enable hierarchical tree view.
1396
+ *
1397
+ * **Requires feature import:**
1398
+ * ```typescript
1399
+ * import '@toolbox-web/grid-angular/features/tree';
1400
+ * ```
1401
+ *
1402
+ * @example
1403
+ * ```html
1404
+ * <tbw-grid [tree]="{ childrenField: 'children' }" />
1405
+ * ```
1406
+ */
1407
+ tree = c();
1408
+ /**
1409
+ * Enable master-detail expandable rows.
1410
+ *
1411
+ * **Requires feature import:**
1412
+ * ```typescript
1413
+ * import '@toolbox-web/grid-angular/features/master-detail';
1414
+ * ```
1415
+ *
1416
+ * @example
1417
+ * ```html
1418
+ * <tbw-grid [masterDetail]="{ detailRenderer: detailFn }" />
1419
+ * ```
1420
+ */
1421
+ masterDetail = c();
1422
+ /**
1423
+ * Enable responsive card layout for narrow viewports.
1424
+ *
1425
+ * **Requires feature import:**
1426
+ * ```typescript
1427
+ * import '@toolbox-web/grid-angular/features/responsive';
1428
+ * ```
1429
+ *
1430
+ * @example
1431
+ * ```html
1432
+ * <tbw-grid [responsive]="{ breakpoint: 768 }" />
1433
+ * ```
1434
+ */
1435
+ responsive = c();
1436
+ /**
1437
+ * Enable undo/redo for cell edits. Requires editing to be enabled.
1438
+ *
1439
+ * **Requires feature import:**
1440
+ * ```typescript
1441
+ * import '@toolbox-web/grid-angular/features/undo-redo';
1442
+ * ```
1443
+ *
1444
+ * @example
1445
+ * ```html
1446
+ * <tbw-grid [editing]="'dblclick'" [undoRedo]="true" />
1447
+ * ```
1448
+ */
1449
+ undoRedo = c();
1450
+ /**
1451
+ * Enable CSV/JSON export functionality.
1452
+ *
1453
+ * **Requires feature import:**
1454
+ * ```typescript
1455
+ * import '@toolbox-web/grid-angular/features/export';
1456
+ * ```
1457
+ *
1458
+ * @example
1459
+ * ```html
1460
+ * <tbw-grid [export]="true" />
1461
+ * <tbw-grid [export]="{ filename: 'data.csv' }" />
1462
+ * ```
1463
+ */
1464
+ exportFeature = c();
1465
+ /**
1466
+ * Enable print functionality.
1467
+ *
1468
+ * **Requires feature import:**
1469
+ * ```typescript
1470
+ * import '@toolbox-web/grid-angular/features/print';
1471
+ * ```
1472
+ *
1473
+ * @example
1474
+ * ```html
1475
+ * <tbw-grid [print]="true" />
1476
+ * ```
1477
+ */
1478
+ print = c();
1479
+ /**
1480
+ * Enable pivot table functionality.
1481
+ *
1482
+ * **Requires feature import:**
1483
+ * ```typescript
1484
+ * import '@toolbox-web/grid-angular/features/pivot';
1485
+ * ```
1486
+ *
1487
+ * @example
1488
+ * ```html
1489
+ * <tbw-grid [pivot]="{ rowFields: ['category'], valueField: 'sales' }" />
1490
+ * ```
1491
+ */
1492
+ pivot = c();
1493
+ /**
1494
+ * Enable server-side data operations.
1495
+ *
1496
+ * **Requires feature import:**
1497
+ * ```typescript
1498
+ * import '@toolbox-web/grid-angular/features/server-side';
1499
+ * ```
1500
+ *
1501
+ * @example
1502
+ * ```html
1503
+ * <tbw-grid [serverSide]="{ dataSource: fetchDataFn }" />
1504
+ * ```
1505
+ */
1506
+ serverSide = c();
1507
+ // ═══════════════════════════════════════════════════════════════════════════
1508
+ // EVENT OUTPUTS - All grid events
1509
+ // ═══════════════════════════════════════════════════════════════════════════
1510
+ /**
1511
+ * Emitted when a cell is clicked.
1512
+ *
1513
+ * @example
1514
+ * ```html
1515
+ * <tbw-grid (cellClick)="onCellClick($event)">...</tbw-grid>
1516
+ * ```
1517
+ */
1518
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1519
+ cellClick = p();
1520
+ /**
1521
+ * Emitted when a row is clicked.
1522
+ *
1523
+ * @example
1524
+ * ```html
1525
+ * <tbw-grid (rowClick)="onRowClick($event)">...</tbw-grid>
1526
+ * ```
1527
+ */
1528
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1529
+ rowClick = p();
1530
+ /**
1531
+ * Emitted when a cell is activated (Enter key or double-click).
1532
+ *
1533
+ * @example
1534
+ * ```html
1535
+ * <tbw-grid (cellActivate)="onCellActivate($event)">...</tbw-grid>
1536
+ * ```
1537
+ */
1538
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1539
+ cellActivate = p();
1540
+ /**
1541
+ * Emitted when a cell value changes (before commit).
1542
+ *
1543
+ * @example
1544
+ * ```html
1545
+ * <tbw-grid (cellChange)="onCellChange($event)">...</tbw-grid>
1546
+ * ```
1547
+ */
1548
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1549
+ cellChange = p();
997
1550
  /**
998
1551
  * Emitted when a cell value is committed (inline editing).
999
1552
  * Provides the row, field, new value, and change tracking information.
@@ -1009,7 +1562,7 @@ class Y {
1009
1562
  * }
1010
1563
  * ```
1011
1564
  */
1012
- cellCommit = S();
1565
+ cellCommit = p();
1013
1566
  /**
1014
1567
  * Emitted when a row's values are committed (bulk/row editing).
1015
1568
  * Provides the row data and change tracking information.
@@ -1019,17 +1572,240 @@ class Y {
1019
1572
  * <tbw-grid (rowCommit)="onRowCommit($event)">...</tbw-grid>
1020
1573
  * ```
1021
1574
  */
1022
- rowCommit = S();
1575
+ rowCommit = p();
1576
+ /**
1577
+ * Emitted when the changed rows are reset.
1578
+ *
1579
+ * @example
1580
+ * ```html
1581
+ * <tbw-grid (changedRowsReset)="onChangedRowsReset($event)">...</tbw-grid>
1582
+ * ```
1583
+ */
1584
+ changedRowsReset = p();
1585
+ /**
1586
+ * Emitted when sort state changes.
1587
+ *
1588
+ * @example
1589
+ * ```html
1590
+ * <tbw-grid (sortChange)="onSortChange($event)">...</tbw-grid>
1591
+ * ```
1592
+ */
1593
+ sortChange = p();
1594
+ /**
1595
+ * Emitted when filter values change.
1596
+ *
1597
+ * @example
1598
+ * ```html
1599
+ * <tbw-grid (filterChange)="onFilterChange($event)">...</tbw-grid>
1600
+ * ```
1601
+ */
1602
+ filterChange = p();
1603
+ /**
1604
+ * Emitted when a column is resized.
1605
+ *
1606
+ * @example
1607
+ * ```html
1608
+ * <tbw-grid (columnResize)="onColumnResize($event)">...</tbw-grid>
1609
+ * ```
1610
+ */
1611
+ columnResize = p();
1612
+ /**
1613
+ * Emitted when a column is moved via drag-and-drop.
1614
+ *
1615
+ * @example
1616
+ * ```html
1617
+ * <tbw-grid (columnMove)="onColumnMove($event)">...</tbw-grid>
1618
+ * ```
1619
+ */
1620
+ columnMove = p();
1621
+ /**
1622
+ * Emitted when column visibility changes.
1623
+ *
1624
+ * @example
1625
+ * ```html
1626
+ * <tbw-grid (columnVisibility)="onColumnVisibility($event)">...</tbw-grid>
1627
+ * ```
1628
+ */
1629
+ columnVisibility = p();
1630
+ /**
1631
+ * Emitted when column state changes (resize, reorder, visibility).
1632
+ *
1633
+ * @example
1634
+ * ```html
1635
+ * <tbw-grid (columnStateChange)="onColumnStateChange($event)">...</tbw-grid>
1636
+ * ```
1637
+ */
1638
+ columnStateChange = p();
1639
+ /**
1640
+ * Emitted when selection changes.
1641
+ *
1642
+ * @example
1643
+ * ```html
1644
+ * <tbw-grid (selectionChange)="onSelectionChange($event)">...</tbw-grid>
1645
+ * ```
1646
+ */
1647
+ selectionChange = p();
1648
+ /**
1649
+ * Emitted when a row is moved via drag-and-drop.
1650
+ *
1651
+ * @example
1652
+ * ```html
1653
+ * <tbw-grid (rowMove)="onRowMove($event)">...</tbw-grid>
1654
+ * ```
1655
+ */
1656
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1657
+ rowMove = p();
1658
+ /**
1659
+ * Emitted when a group is expanded or collapsed.
1660
+ *
1661
+ * @example
1662
+ * ```html
1663
+ * <tbw-grid (groupToggle)="onGroupToggle($event)">...</tbw-grid>
1664
+ * ```
1665
+ */
1666
+ groupToggle = p();
1667
+ /**
1668
+ * Emitted when a tree node is expanded.
1669
+ *
1670
+ * @example
1671
+ * ```html
1672
+ * <tbw-grid (treeExpand)="onTreeExpand($event)">...</tbw-grid>
1673
+ * ```
1674
+ */
1675
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1676
+ treeExpand = p();
1677
+ /**
1678
+ * Emitted when a detail panel is expanded or collapsed.
1679
+ *
1680
+ * @example
1681
+ * ```html
1682
+ * <tbw-grid (detailExpand)="onDetailExpand($event)">...</tbw-grid>
1683
+ * ```
1684
+ */
1685
+ detailExpand = p();
1686
+ /**
1687
+ * Emitted when responsive mode changes (table ↔ card).
1688
+ *
1689
+ * @example
1690
+ * ```html
1691
+ * <tbw-grid (responsiveChange)="onResponsiveChange($event)">...</tbw-grid>
1692
+ * ```
1693
+ */
1694
+ responsiveChange = p();
1695
+ /**
1696
+ * Emitted when cells are copied to clipboard.
1697
+ *
1698
+ * @example
1699
+ * ```html
1700
+ * <tbw-grid (copy)="onCopy($event)">...</tbw-grid>
1701
+ * ```
1702
+ */
1703
+ copy = p();
1704
+ /**
1705
+ * Emitted when cells are pasted from clipboard.
1706
+ *
1707
+ * @example
1708
+ * ```html
1709
+ * <tbw-grid (paste)="onPaste($event)">...</tbw-grid>
1710
+ * ```
1711
+ */
1712
+ paste = p();
1713
+ /**
1714
+ * Emitted when undo/redo is performed.
1715
+ *
1716
+ * @example
1717
+ * ```html
1718
+ * <tbw-grid (undoRedoAction)="onUndoRedo($event)">...</tbw-grid>
1719
+ * ```
1720
+ */
1721
+ undoRedoAction = p();
1722
+ /**
1723
+ * Emitted when export completes.
1724
+ *
1725
+ * @example
1726
+ * ```html
1727
+ * <tbw-grid (exportComplete)="onExportComplete($event)">...</tbw-grid>
1728
+ * ```
1729
+ */
1730
+ exportComplete = p();
1731
+ /**
1732
+ * Emitted when print starts.
1733
+ *
1734
+ * @example
1735
+ * ```html
1736
+ * <tbw-grid (printStart)="onPrintStart($event)">...</tbw-grid>
1737
+ * ```
1738
+ */
1739
+ printStart = p();
1740
+ /**
1741
+ * Emitted when print completes.
1742
+ *
1743
+ * @example
1744
+ * ```html
1745
+ * <tbw-grid (printComplete)="onPrintComplete($event)">...</tbw-grid>
1746
+ * ```
1747
+ */
1748
+ printComplete = p();
1749
+ // Map of output names to event names for automatic wiring
1750
+ eventOutputMap = {
1751
+ cellClick: "cell-click",
1752
+ rowClick: "row-click",
1753
+ cellActivate: "cell-activate",
1754
+ cellChange: "cell-change",
1755
+ cellCommit: "cell-commit",
1756
+ rowCommit: "row-commit",
1757
+ changedRowsReset: "changed-rows-reset",
1758
+ sortChange: "sort-change",
1759
+ filterChange: "filter-change",
1760
+ columnResize: "column-resize",
1761
+ columnMove: "column-move",
1762
+ columnVisibility: "column-visibility",
1763
+ columnStateChange: "column-state-change",
1764
+ selectionChange: "selection-change",
1765
+ rowMove: "row-move",
1766
+ groupToggle: "group-toggle",
1767
+ treeExpand: "tree-expand",
1768
+ detailExpand: "detail-expand",
1769
+ responsiveChange: "responsive-change",
1770
+ copy: "copy",
1771
+ paste: "paste",
1772
+ undoRedoAction: "undo-redo",
1773
+ exportComplete: "export-complete",
1774
+ printStart: "print-start",
1775
+ printComplete: "print-complete"
1776
+ };
1777
+ // Store event listeners for cleanup
1778
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1779
+ eventListeners = /* @__PURE__ */ new Map();
1023
1780
  ngOnInit() {
1024
- this.adapter = new lt(this.injector, this.appRef, this.viewContainerRef), et.registerAdapter(this.adapter);
1781
+ this.adapter = new ct(this.injector, this.appRef, this.viewContainerRef), nt.registerAdapter(this.adapter);
1025
1782
  const e = this.elementRef.nativeElement;
1026
- this.cellCommitListener = (t) => {
1027
- const i = t.detail;
1028
- this.cellCommit.emit(i);
1029
- }, e.addEventListener("cell-commit", this.cellCommitListener), this.rowCommitListener = (t) => {
1030
- const i = t.detail;
1031
- this.rowCommit.emit(i);
1032
- }, e.addEventListener("row-commit", this.rowCommitListener), e.__frameworkAdapter = this.adapter;
1783
+ this.setupEventListeners(e), e.__frameworkAdapter = this.adapter;
1784
+ }
1785
+ /**
1786
+ * Sets up event listeners for all outputs using the eventOutputMap.
1787
+ */
1788
+ setupEventListeners(e) {
1789
+ for (const [t, n] of Object.entries(this.eventOutputMap)) {
1790
+ const r = (o) => {
1791
+ const s = o.detail;
1792
+ this[t].emit(s);
1793
+ };
1794
+ e.addEventListener(n, r), this.eventListeners.set(n, r);
1795
+ }
1796
+ }
1797
+ /**
1798
+ * Creates plugins from feature inputs.
1799
+ * Uses the feature registry to allow tree-shaking - only imported features are bundled.
1800
+ * Returns the array of created plugins (doesn't modify grid).
1801
+ */
1802
+ createFeaturePlugins() {
1803
+ const e = [], t = (n, r) => {
1804
+ if (r == null || r === !1) return;
1805
+ const o = tt(n, r);
1806
+ o && e.push(o);
1807
+ };
1808
+ return t("selection", this.selection()), t("editing", this.editing()), t("clipboard", this.clipboard()), t("contextMenu", this.contextMenu()), t("multiSort", this.multiSort() ?? this.sorting()), t("filtering", this.filtering()), t("reorder", this.reorder()), t("visibility", this.visibility()), t("pinnedColumns", this.pinnedColumns()), t("groupingColumns", this.groupingColumns()), t("columnVirtualization", this.columnVirtualization()), t("rowReorder", this.rowReorder()), t("groupingRows", this.groupingRows()), t("pinnedRows", this.pinnedRows()), t("tree", this.tree()), t("masterDetail", this.masterDetail()), t("responsive", this.responsive()), t("undoRedo", this.undoRedo()), t("export", this.exportFeature()), t("print", this.print()), t("pivot", this.pivot()), t("serverSide", this.serverSide()), e;
1033
1809
  }
1034
1810
  ngAfterContentInit() {
1035
1811
  const e = this.elementRef.nativeElement;
@@ -1050,30 +1826,30 @@ class Y {
1050
1826
  /**
1051
1827
  * Configures the MasterDetailPlugin after Angular templates are registered.
1052
1828
  * - If plugin exists: refresh its detail renderer
1053
- * - If plugin doesn't exist but <tbw-grid-detail> is present: create and add the plugin
1829
+ * - If plugin doesn't exist but <tbw-grid-detail> is present: dynamically import and add the plugin
1054
1830
  */
1055
- configureMasterDetail(e) {
1831
+ async configureMasterDetail(e) {
1056
1832
  if (!this.adapter) return;
1057
- const t = e.getPlugin?.(ge);
1833
+ const t = e.gridConfig?.plugins?.find((R) => R.name === "masterDetail");
1058
1834
  if (t && typeof t.refreshDetailRenderer == "function") {
1059
1835
  t.refreshDetailRenderer();
1060
1836
  return;
1061
1837
  }
1062
- const i = e.querySelector("tbw-grid-detail");
1063
- if (!i) return;
1838
+ const n = e.querySelector("tbw-grid-detail");
1839
+ if (!n) return;
1064
1840
  const r = this.adapter.createDetailRenderer(e);
1065
1841
  if (!r) return;
1066
- const o = i.getAttribute("animation");
1842
+ const o = n.getAttribute("animation");
1067
1843
  let s = "slide";
1068
1844
  o === "false" ? s = !1 : o === "fade" && (s = "fade");
1069
- const l = i.getAttribute("showExpandColumn") !== "false", m = new ge({
1845
+ const l = n.getAttribute("showExpandColumn") !== "false", { MasterDetailPlugin: f } = await import("@toolbox-web/grid/plugins/master-detail"), g = new f({
1070
1846
  detailRenderer: r,
1071
1847
  showExpandColumn: l,
1072
1848
  animation: s
1073
- }), d = e.gridConfig || {}, T = d.plugins || [];
1849
+ }), E = e.gridConfig || {}, a = E.plugins || [];
1074
1850
  e.gridConfig = {
1075
- ...d,
1076
- plugins: [...T, m]
1851
+ ...E,
1852
+ plugins: [...a, g]
1077
1853
  };
1078
1854
  }
1079
1855
  /**
@@ -1083,18 +1859,18 @@ class Y {
1083
1859
  */
1084
1860
  configureResponsiveCard(e) {
1085
1861
  if (!this.adapter || !e.querySelector("tbw-grid-responsive-card")) return;
1086
- const i = this.adapter.createResponsiveCardRenderer(e);
1087
- if (!i) return;
1088
- const r = e.getPlugin?.(tt);
1089
- if (r) {
1090
- r.setCardRenderer(i);
1862
+ const n = this.adapter.createResponsiveCardRenderer(e);
1863
+ if (!n) return;
1864
+ const r = e.gridConfig?.plugins?.find((o) => o.name === "responsive");
1865
+ if (r && typeof r.setCardRenderer == "function") {
1866
+ r.setCardRenderer(n);
1091
1867
  return;
1092
1868
  }
1093
1869
  console.warn(
1094
1870
  `[tbw-grid-angular] <tbw-grid-responsive-card> found but ResponsivePlugin is not configured.
1095
1871
  Add ResponsivePlugin to your gridConfig.plugins array:
1096
1872
 
1097
- import { ResponsivePlugin } from "@toolbox-web/grid/all";
1873
+ import { ResponsivePlugin } from "@toolbox-web/grid/plugins/responsive";
1098
1874
  gridConfig = {
1099
1875
  plugins: [new ResponsivePlugin({ breakpoint: 600 })]
1100
1876
  };`
@@ -1102,27 +1878,39 @@ Add ResponsivePlugin to your gridConfig.plugins array:
1102
1878
  }
1103
1879
  ngOnDestroy() {
1104
1880
  const e = this.elementRef.nativeElement;
1105
- e && (this.cellCommitListener && (e.removeEventListener("cell-commit", this.cellCommitListener), this.cellCommitListener = null), this.rowCommitListener && (e.removeEventListener("row-commit", this.rowCommitListener), this.rowCommitListener = null)), e && this.customStyles() && e.unregisterStyles?.("angular-custom-styles"), this.adapter && (this.adapter.destroy?.(), this.adapter = null);
1881
+ if (e) {
1882
+ for (const [t, n] of this.eventListeners)
1883
+ e.removeEventListener(t, n);
1884
+ this.eventListeners.clear();
1885
+ }
1886
+ e && this.customStyles() && e.unregisterStyles?.("angular-custom-styles"), this.adapter && (this.adapter.destroy?.(), this.adapter = null);
1106
1887
  }
1107
1888
  }
1108
- ne = h(null), Y = v(ne, 0, "Grid", Me, Y), g(ne, 1, Y);
1889
+ se = y(null), Y = T(se, 0, "Grid", Me, Y), b(se, 1, Y);
1109
1890
  export {
1110
- lt as AngularGridAdapter,
1891
+ ct as AngularGridAdapter,
1111
1892
  H as BaseGridEditor,
1112
- _e as GRID_TYPE_DEFAULTS,
1893
+ qe as GRID_TYPE_DEFAULTS,
1113
1894
  Y as Grid,
1114
- V as GridColumnEditor,
1115
- N as GridColumnView,
1116
- _ as GridDetailView,
1117
- G as GridFormArray,
1118
- q as GridResponsiveCard,
1119
- $ as GridToolPanel,
1120
- M as GridTypeRegistry,
1895
+ q as GridColumnEditor,
1896
+ _ as GridColumnView,
1897
+ $ as GridDetailView,
1898
+ z as GridFormArray,
1899
+ B as GridResponsiveCard,
1900
+ U as GridToolPanel,
1901
+ I as GridTypeRegistry,
1121
1902
  W as TbwCellEditor,
1122
- U as TbwCellView,
1903
+ J as TbwCellView,
1123
1904
  W as TbwEditor,
1124
- U as TbwRenderer,
1905
+ J as TbwRenderer,
1906
+ wt as clearFeatureRegistry,
1907
+ tt as createPluginFromFeature,
1908
+ Rt as getFeatureFactory,
1125
1909
  rt as getFormArrayContext,
1126
- ve as isComponentClass,
1127
- ft as provideGridTypeDefaults
1910
+ Ct as getRegisteredFeatures,
1911
+ gt as injectGrid,
1912
+ we as isComponentClass,
1913
+ Et as isFeatureRegistered,
1914
+ ft as provideGridTypeDefaults,
1915
+ yt as registerFeature
1128
1916
  };