@toolbox-web/grid-react 0.12.2 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -695,11 +695,11 @@ import type {
695
695
  // Deprecated aliases
696
696
  ReactGridConfig,
697
697
  ReactColumnConfig,
698
- // Context types
699
- CellRenderContext,
700
- ColumnEditorContext,
701
- DetailPanelContext,
702
- ToolPanelContext,
698
+ // Context types (React-specific wrappers)
699
+ GridCellContext,
700
+ GridEditorContext,
701
+ GridDetailContext,
702
+ GridToolPanelContext,
703
703
  DataGridRef,
704
704
  DataGridProps,
705
705
  // Feature props
@@ -760,28 +760,28 @@ import type {
760
760
 
761
761
  ### GridColumn Props
762
762
 
763
- | Prop | Type | Description |
764
- | ----------- | --------------------------------------------- | ----------------------- |
765
- | `field` | `string` | Field key in row object |
766
- | `header` | `string` | Column header text |
767
- | `type` | `'string' \| 'number' \| 'date' \| 'boolean'` | Data type |
768
- | `editable` | `boolean` | Enable editing |
769
- | `sortable` | `boolean` | Enable sorting |
770
- | `resizable` | `boolean` | Enable column resizing |
771
- | `width` | `string \| number` | Column width |
772
- | `children` | `(ctx: CellRenderContext) => ReactNode` | Custom renderer |
773
- | `editor` | `(ctx: ColumnEditorContext) => ReactNode` | Custom editor |
763
+ | Prop | Type | Description |
764
+ | ----------- | ------------------------------------------------------- | ------------------------------------------------------- |
765
+ | `field` | `string` | Field key in row object |
766
+ | `header` | `string` | Column header text |
767
+ | `type` | `'string' \| 'number' \| 'date' \| 'boolean'` | Data type |
768
+ | `editable` | `boolean` | Enable editing |
769
+ | `sortable` | `boolean` | Enable sorting |
770
+ | `resizable` | `boolean` | Enable column resizing |
771
+ | `width` | `string \| number` | Column width |
772
+ | `children` | `(ctx: CellRenderContext<TRow, TValue>) => ReactNode` | Custom renderer (context type from `@toolbox-web/grid`) |
773
+ | `editor` | `(ctx: ColumnEditorContext<TRow, TValue>) => ReactNode` | Custom editor (context type from `@toolbox-web/grid`) |
774
774
 
775
775
  ### DataGridRef Methods
776
776
 
777
777
  | Method | Description |
778
- | ------------------------- | --------------------------- | -------------------- |
778
+ | ------------------------- | --------------------------- |
779
779
  | `getConfig()` | Get effective configuration |
780
780
  | `ready()` | Wait for grid ready |
781
781
  | `forceLayout()` | Force layout recalculation |
782
782
  | `toggleGroup(key)` | Toggle group expansion |
783
783
  | `registerStyles(id, css)` | Register custom styles |
784
- | `unregisterStyles(id)` | `void` | Remove custom styles |
784
+ | `unregisterStyles(id)` | Remove custom styles |
785
785
 
786
786
  ### ReactGridAdapter
787
787
 
@@ -1,38 +1,38 @@
1
- import { jsx as E } from "react/jsx-runtime";
2
- import { DataGridElement as pe } from "@toolbox-web/grid";
3
- import { createContext as Y, useContext as V, useRef as S, useCallback as Z, useEffect as p, forwardRef as me, useMemo as v, useImperativeHandle as ye, Children as he, isValidElement as we } from "react";
1
+ import { jsx as b } from "react/jsx-runtime";
2
+ import { DataGridElement as me } from "@toolbox-web/grid";
3
+ import { createContext as Z, useContext as V, useRef as S, useCallback as Q, useEffect as p, forwardRef as he, useMemo as v, useImperativeHandle as ye, Children as we, isValidElement as ve } from "react";
4
4
  import { flushSync as m } from "react-dom";
5
- import { createRoot as h } from "react-dom/client";
6
- import { c as ve } from "./feature-registry-Y3KvnN54.js";
7
- function Ce(n) {
5
+ import { createRoot as y } from "react-dom/client";
6
+ import { c as Ce } from "./feature-registry-Y3KvnN54.js";
7
+ function Re(n) {
8
8
  return n.charAt(0).toUpperCase() + n.slice(1);
9
9
  }
10
- function ce(n) {
11
- return n.toLowerCase() === "id" ? "ID" : n.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").split(" ").filter(Boolean).map(Ce).join(" ");
10
+ function ae(n) {
11
+ return n.toLowerCase() === "id" ? "ID" : n.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").split(" ").filter(Boolean).map(Re).join(" ");
12
12
  }
13
- const Re = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime", "currency"]);
13
+ const be = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime", "currency"]);
14
14
  function Ee(n) {
15
15
  const t = n.lastIndexOf(":");
16
16
  if (t > 0) {
17
17
  const e = n.slice(t + 1).toLowerCase();
18
- if (Re.has(e)) {
18
+ if (be.has(e)) {
19
19
  const r = n.slice(0, t);
20
20
  return {
21
21
  field: r,
22
- header: ce(r),
22
+ header: ae(r),
23
23
  type: e
24
24
  };
25
25
  }
26
26
  }
27
27
  return {
28
28
  field: n,
29
- header: ce(n)
29
+ header: ae(n)
30
30
  };
31
31
  }
32
- function be(n) {
32
+ function Pe(n) {
33
33
  return n.map((t) => typeof t == "string" ? Ee(t) : t);
34
34
  }
35
- const z = {
35
+ const _ = {
36
36
  onCellClick: "cell-click",
37
37
  onRowClick: "row-click",
38
38
  onCellActivate: "cell-activate",
@@ -57,30 +57,30 @@ const z = {
57
57
  onExportComplete: "export-complete",
58
58
  onPrintStart: "print-start",
59
59
  onPrintComplete: "print-complete"
60
- }, Q = Y(null), Ue = ({ icons: n, children: t }) => /* @__PURE__ */ E(Q.Provider, { value: n, children: t });
61
- function Je() {
62
- return V(Q);
60
+ }, X = Z(null), Ye = ({ icons: n, children: t }) => /* @__PURE__ */ b(X.Provider, { value: n, children: t });
61
+ function Ze() {
62
+ return V(X);
63
63
  }
64
- const Pe = Q, $ = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new Map();
65
- function de(n) {
64
+ const De = X, W = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new Map();
65
+ function le(n) {
66
66
  const t = n.querySelector("tbw-grid-responsive-card");
67
67
  if (t) {
68
- const r = $.get(t);
68
+ const r = W.get(t);
69
69
  if (r) return r;
70
70
  }
71
71
  const e = n.id || n.getAttribute("data-grid-id");
72
72
  if (e)
73
- return W.get(e);
73
+ return q.get(e);
74
74
  }
75
- function De(n) {
76
- const { children: t, cardRowHeight: e = "auto" } = n, r = S(null), o = Z(
75
+ function Se(n) {
76
+ const { children: t, cardRowHeight: e = "auto" } = n, r = S(null), o = Q(
77
77
  (s) => {
78
78
  if (r.current = s, !s) return;
79
- $.set(s, t);
79
+ W.set(s, t);
80
80
  const a = s.closest("tbw-grid");
81
81
  if (a) {
82
82
  const l = a.id || a.getAttribute("data-grid-id");
83
- l && W.set(l, t);
83
+ l && q.set(l, t);
84
84
  }
85
85
  },
86
86
  [t]
@@ -88,27 +88,39 @@ function De(n) {
88
88
  p(() => () => {
89
89
  const s = r.current;
90
90
  if (s) {
91
- $.delete(s);
91
+ W.delete(s);
92
92
  const a = s.closest("tbw-grid");
93
93
  if (a) {
94
94
  const l = a.id || a.getAttribute("data-grid-id");
95
- l && W.delete(l);
95
+ l && q.delete(l);
96
96
  }
97
97
  }
98
98
  }, []);
99
99
  const c = e === "auto" ? "auto" : String(e);
100
- return /* @__PURE__ */ E("tbw-grid-responsive-card", { ref: o, cardRowHeight: c });
100
+ return /* @__PURE__ */ b("tbw-grid-responsive-card", { ref: o, cardRowHeight: c });
101
101
  }
102
- De.displayName = "GridResponsiveCard";
103
- const L = Y(null), Ye = ({ defaults: n, children: t }) => /* @__PURE__ */ E(L.Provider, { value: n, children: t });
104
- function Ze() {
105
- return V(L);
102
+ Se.displayName = "GridResponsiveCard";
103
+ const T = Z(null), Qe = ({ defaults: n, children: t }) => /* @__PURE__ */ b(T.Provider, { value: n, children: t });
104
+ function Xe() {
105
+ return V(T);
106
106
  }
107
- function Qe(n) {
108
- return V(L)?.[n];
107
+ function et(n) {
108
+ return V(T)?.[n];
109
+ }
110
+ const xe = T, I = [];
111
+ function Ae(n) {
112
+ for (let t = I.length - 1; t >= 0; t--) {
113
+ const e = I[t];
114
+ if (n.contains(e.container) && e.container.classList.contains("react-cell-editor")) {
115
+ try {
116
+ e.root.unmount();
117
+ } catch {
118
+ }
119
+ I.splice(t, 1);
120
+ }
121
+ }
109
122
  }
110
- const Se = L;
111
- function xe(n) {
123
+ function Ge(n) {
112
124
  const t = /* @__PURE__ */ new WeakMap();
113
125
  return (e) => {
114
126
  const r = e.cellEl;
@@ -121,54 +133,54 @@ function xe(n) {
121
133
  }
122
134
  const o = document.createElement("div");
123
135
  o.className = "react-cell-renderer", o.style.display = "contents";
124
- const c = h(o);
136
+ const c = y(o);
125
137
  return m(() => {
126
138
  c.render(n(e));
127
- }), r && t.set(r, { root: c, container: o }), o;
139
+ }), r && t.set(r, { root: c, container: o }), I.push({ root: c, container: o }), o;
128
140
  };
129
141
  }
130
- function Ae(n) {
142
+ function Ie(n) {
131
143
  return (t) => {
132
144
  const e = document.createElement("div");
133
145
  e.className = "react-cell-editor", e.style.display = "contents";
134
- const r = h(e);
146
+ const r = y(e);
135
147
  return m(() => {
136
148
  r.render(n(t));
137
- }), e;
149
+ }), I.push({ root: r, container: e }), e;
138
150
  };
139
151
  }
140
- function Ge(n) {
152
+ function Ve(n) {
141
153
  if (!n) return;
142
154
  if (!n.columns) return n;
143
155
  const t = n.columns.map((e) => {
144
156
  const { renderer: r, editor: o, ...c } = e, s = { ...c };
145
- return r && (s.renderer = xe(r)), o && (s.editor = Ae(o)), s;
157
+ return r && (s.renderer = Ge(r)), o && (s.editor = Ie(o)), s;
146
158
  });
147
159
  return {
148
160
  ...n,
149
161
  columns: t
150
162
  };
151
163
  }
152
- const q = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new Map();
153
- function Ve(n) {
164
+ const B = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new Map();
165
+ function Ne(n) {
154
166
  const t = n.querySelector("tbw-grid-detail");
155
167
  if (t) {
156
- const r = q.get(t);
168
+ const r = B.get(t);
157
169
  if (r) return r;
158
170
  }
159
171
  const e = n.id || n.getAttribute("data-grid-id");
160
172
  if (e)
161
- return B.get(e);
173
+ return K.get(e);
162
174
  }
163
- function Ie(n) {
164
- const { children: t, showExpandColumn: e = !0, animation: r = "slide" } = n, o = S(null), c = Z(
175
+ function Le(n) {
176
+ const { children: t, showExpandColumn: e = !0, animation: r = "slide" } = n, o = S(null), c = Q(
165
177
  (a) => {
166
178
  if (o.current = a, !a) return;
167
- q.set(a, t);
179
+ B.set(a, t);
168
180
  const l = a.closest("tbw-grid");
169
181
  if (l) {
170
182
  const g = l.id || l.getAttribute("data-grid-id");
171
- g && B.set(g, t);
183
+ g && K.set(g, t);
172
184
  }
173
185
  },
174
186
  [t]
@@ -176,16 +188,16 @@ function Ie(n) {
176
188
  return p(() => () => {
177
189
  const a = o.current;
178
190
  if (a) {
179
- q.delete(a);
191
+ B.delete(a);
180
192
  const l = a.closest("tbw-grid");
181
193
  if (l) {
182
194
  const w = l.id || l.getAttribute("data-grid-id");
183
- w && B.delete(w);
195
+ w && K.delete(w);
184
196
  }
185
197
  const g = a.parentNode;
186
198
  g && g.contains(a);
187
199
  }
188
- }, []), /* @__PURE__ */ E(
200
+ }, []), /* @__PURE__ */ b(
189
201
  "tbw-grid-detail",
190
202
  {
191
203
  ref: c,
@@ -194,26 +206,26 @@ function Ie(n) {
194
206
  }
195
207
  );
196
208
  }
197
- Ie.displayName = "GridDetailPanel";
198
- const K = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new Map();
199
- function Ne(n) {
200
- const t = K.get(n);
209
+ Le.displayName = "GridDetailPanel";
210
+ const U = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new Map();
211
+ function Fe(n) {
212
+ const t = U.get(n);
201
213
  if (t) return t;
202
214
  const e = n.id;
203
215
  if (e)
204
- return U.get(e);
216
+ return J.get(e);
205
217
  }
206
- function Xe(n) {
207
- const { id: t, title: e, icon: r, tooltip: o, order: c = 100, children: s } = n, a = S(null), l = Z(
218
+ function tt(n) {
219
+ const { id: t, title: e, icon: r, tooltip: o, order: c = 100, children: s } = n, a = S(null), l = Q(
208
220
  (g) => {
209
- a.current = g, g && (K.set(g, s), t && U.set(t, s));
221
+ a.current = g, g && (U.set(g, s), t && J.set(t, s));
210
222
  },
211
223
  [s, t]
212
224
  );
213
225
  return p(() => () => {
214
226
  const g = a.current;
215
- g && (K.delete(g), t && U.delete(t));
216
- }, [t]), /* @__PURE__ */ E(
227
+ g && (U.delete(g), t && J.delete(t));
228
+ }, [t]), /* @__PURE__ */ b(
217
229
  "tbw-grid-tool-panel",
218
230
  {
219
231
  ref: l,
@@ -225,38 +237,38 @@ function Xe(n) {
225
237
  }
226
238
  );
227
239
  }
228
- const R = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new Map();
229
- function et(n, t) {
240
+ const R = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new Map();
241
+ function rt(n, t) {
230
242
  const e = n.getAttribute("field"), r = R.get(n) ?? {};
231
243
  if (r.renderer = t, R.set(n, r), e) {
232
- const o = b.get(e) ?? {};
233
- o.renderer = t, b.set(e, o);
244
+ const o = E.get(e) ?? {};
245
+ o.renderer = t, E.set(e, o);
234
246
  }
235
247
  }
236
- function tt(n, t) {
248
+ function nt(n, t) {
237
249
  const e = n.getAttribute("field"), r = R.get(n) ?? {};
238
250
  if (r.editor = t, R.set(n, r), e) {
239
- const o = b.get(e) ?? {};
240
- o.editor = t, b.set(e, o);
251
+ const o = E.get(e) ?? {};
252
+ o.editor = t, E.set(e, o);
241
253
  }
242
254
  }
243
- function Fe(n) {
255
+ function Te(n) {
244
256
  let t = R.get(n)?.renderer;
245
257
  if (!t) {
246
258
  const e = n.getAttribute("field");
247
- e && (t = b.get(e)?.renderer);
259
+ e && (t = E.get(e)?.renderer);
248
260
  }
249
261
  return t;
250
262
  }
251
- function Le(n) {
263
+ function ke(n) {
252
264
  let t = R.get(n)?.editor;
253
265
  if (!t) {
254
266
  const e = n.getAttribute("field");
255
- e && (t = b.get(e)?.editor);
267
+ e && (t = E.get(e)?.editor);
256
268
  }
257
269
  return t;
258
270
  }
259
- class le {
271
+ class ue {
260
272
  mountedViews = [];
261
273
  /** Editor-specific views tracked separately for per-cell cleanup via releaseCell. */
262
274
  editorViews = [];
@@ -278,7 +290,7 @@ class le {
278
290
  const e = t.getAttribute("field");
279
291
  let r = R.get(t);
280
292
  if (!r && e) {
281
- const s = b.get(e);
293
+ const s = E.get(e);
282
294
  s && (s.renderer || s.editor) && (r = s, R.set(t, r));
283
295
  }
284
296
  const o = r?.renderer !== void 0, c = r?.editor !== void 0;
@@ -296,7 +308,7 @@ class le {
296
308
  * allowing the grid to use its default rendering.
297
309
  */
298
310
  createRenderer(t) {
299
- const e = Fe(t);
311
+ const e = Te(t);
300
312
  if (!e)
301
313
  return;
302
314
  const r = /* @__PURE__ */ new WeakMap();
@@ -310,14 +322,14 @@ class le {
310
322
  }), l.container;
311
323
  const g = document.createElement("div");
312
324
  g.className = "react-cell-renderer", g.style.display = "contents";
313
- const w = h(g);
325
+ const w = y(g);
314
326
  return m(() => {
315
327
  w.render(e(o));
316
328
  }), r.set(c, { root: w, container: g, lastRowIndex: o.rowIndex ?? -1 }), this.mountedViews.push({ root: w, container: g }), g;
317
329
  }
318
330
  const s = document.createElement("div");
319
331
  s.className = "react-cell-renderer", s.style.display = "contents";
320
- const a = h(s);
332
+ const a = y(s);
321
333
  return m(() => {
322
334
  a.render(e(o));
323
335
  }), this.mountedViews.push({ root: a, container: s }), s;
@@ -328,11 +340,11 @@ class le {
328
340
  * with commit/cancel callbacks passed as props.
329
341
  */
330
342
  createEditor(t) {
331
- const e = Le(t);
343
+ const e = ke(t);
332
344
  return e ? (r) => {
333
345
  const o = document.createElement("div");
334
346
  o.className = "react-cell-editor", o.style.display = "contents";
335
- const c = h(o);
347
+ const c = y(o);
336
348
  return m(() => {
337
349
  c.render(e(r));
338
350
  }), this.editorViews.push({ root: c, container: o }), o;
@@ -343,12 +355,12 @@ class le {
343
355
  * Renders React components for expandable detail rows.
344
356
  */
345
357
  createDetailRenderer(t) {
346
- const e = Ve(t);
358
+ const e = Ne(t);
347
359
  if (e)
348
360
  return (r, o) => {
349
361
  const c = document.createElement("div");
350
362
  c.className = "react-detail-panel";
351
- const s = { row: r, rowIndex: o }, a = h(c);
363
+ const s = { row: r, rowIndex: o }, a = y(c);
352
364
  return m(() => {
353
365
  a.render(e(s));
354
366
  }), this.mountedViews.push({ root: a, container: c }), c;
@@ -368,12 +380,12 @@ class le {
368
380
  * Renders React components for card layout in responsive mode.
369
381
  */
370
382
  createResponsiveCardRenderer(t) {
371
- const e = de(t);
383
+ const e = le(t);
372
384
  if (e)
373
385
  return (r, o) => {
374
386
  const c = document.createElement("div");
375
387
  c.className = "react-responsive-card";
376
- const s = { row: r, index: o }, a = h(c);
388
+ const s = { row: r, index: o }, a = y(c);
377
389
  return m(() => {
378
390
  a.render(e(s));
379
391
  }), this.mountedViews.push({ root: a, container: c }), c;
@@ -384,14 +396,14 @@ class le {
384
396
  * Renders React components into tool panel containers.
385
397
  */
386
398
  createToolPanelRenderer(t) {
387
- const e = Ne(t);
399
+ const e = Fe(t);
388
400
  if (!e)
389
401
  return;
390
402
  const r = t.closest("tbw-grid");
391
403
  return (o) => {
392
404
  const c = {
393
405
  grid: r ?? o
394
- }, s = h(o);
406
+ }, s = y(o);
395
407
  return m(() => {
396
408
  s.render(e(c));
397
409
  }), this.mountedViews.push({ root: s, container: o }), () => {
@@ -450,7 +462,7 @@ class le {
450
462
  return (e) => {
451
463
  const r = document.createElement("span");
452
464
  r.style.display = "contents";
453
- const o = h(r);
465
+ const o = y(r);
454
466
  return this.mountedViews.push({ root: o, container: r }), m(() => {
455
467
  o.render(t(e));
456
468
  }), r;
@@ -464,7 +476,7 @@ class le {
464
476
  return (e) => {
465
477
  const r = document.createElement("span");
466
478
  r.style.display = "contents";
467
- const o = h(r);
479
+ const o = y(r);
468
480
  return this.editorViews.push({ root: o, container: r }), m(() => {
469
481
  o.render(t(e));
470
482
  }), r;
@@ -478,7 +490,7 @@ class le {
478
490
  return (e, r) => {
479
491
  const o = document.createElement("div");
480
492
  o.style.display = "contents";
481
- const c = h(o);
493
+ const c = y(o);
482
494
  this.mountedViews.push({ root: c, container: o }), m(() => {
483
495
  c.render(t(r));
484
496
  }), e.appendChild(o);
@@ -504,6 +516,8 @@ class le {
504
516
  /**
505
517
  * Called when a cell's content is about to be wiped.
506
518
  * Destroys editor React roots whose container is inside the cell.
519
+ * Also cleans up config-based editor roots (from processGridConfig/wrapReactEditor)
520
+ * that bypass the adapter's tracking arrays.
507
521
  */
508
522
  releaseCell(t) {
509
523
  for (let e = this.editorViews.length - 1; e >= 0; e--) {
@@ -516,6 +530,7 @@ class le {
516
530
  this.editorViews.splice(e, 1);
517
531
  }
518
532
  }
533
+ Ae(t);
519
534
  }
520
535
  /**
521
536
  * Unmount a specific container (called when cell is recycled).
@@ -532,14 +547,14 @@ class le {
532
547
  }
533
548
  }
534
549
  }
535
- const rt = le, Te = {
550
+ const ot = ue, Me = {
536
551
  undoRedo: ["editing"],
537
552
  clipboard: ["selection"]
538
553
  };
539
- function ke(n) {
554
+ function Oe(n) {
540
555
  const t = new Set(n);
541
556
  for (const e of n) {
542
- const r = Te[e];
557
+ const r = Me[e];
543
558
  if (r)
544
559
  for (const o of r)
545
560
  t.has(o) || console.warn(
@@ -547,7 +562,7 @@ function ke(n) {
547
562
  );
548
563
  }
549
564
  }
550
- function Me(n) {
565
+ function je(n) {
551
566
  const t = [], e = [], r = { ...n };
552
567
  r.multiSort !== void 0 ? delete r.sorting : r.sorting !== void 0 && (r.multiSort = r.sorting, delete r.sorting);
553
568
  for (const [s, a] of Object.entries(r)) {
@@ -555,7 +570,7 @@ function Me(n) {
555
570
  const l = s;
556
571
  e.push(l);
557
572
  }
558
- ke(e);
573
+ Oe(e);
559
574
  const o = [
560
575
  "selection",
561
576
  "editing",
@@ -565,34 +580,34 @@ function Me(n) {
565
580
  for (const s of c) {
566
581
  const a = n[s];
567
582
  if (a === void 0 || a === !1) continue;
568
- const l = ve(s, a);
583
+ const l = Ce(s, a);
569
584
  l && t.push(l);
570
585
  }
571
586
  return t;
572
587
  }
573
- let ae = !1, _ = null;
574
- function J() {
575
- return ae || (_ = new le(), pe.registerAdapter(_), ae = !0), _;
588
+ let de = !1, $ = null;
589
+ function Y() {
590
+ return de || ($ = new ue(), me.registerAdapter($), de = !0), $;
576
591
  }
577
- J();
578
- const Oe = Y(null);
579
- function je(n) {
592
+ Y();
593
+ const He = Z(null);
594
+ function ze(n) {
580
595
  const e = n.getPluginByName?.("masterDetail");
581
596
  e && typeof e.refreshDetailRenderer == "function" && e.refreshDetailRenderer();
582
597
  }
583
- function He(n, t) {
598
+ function _e(n, t) {
584
599
  const e = n;
585
- if (!n.querySelector("tbw-grid-responsive-card") || !de(n)) return;
600
+ if (!n.querySelector("tbw-grid-responsive-card") || !le(n)) return;
586
601
  const c = e.getPluginByName?.("responsive");
587
602
  if (c && typeof c.setCardRenderer == "function") {
588
603
  const s = t.createResponsiveCardRenderer(n);
589
604
  s && c.setCardRenderer(s);
590
605
  }
591
606
  }
592
- function ze(n) {
607
+ function $e(n) {
593
608
  const t = {};
594
- return he.forEach(n, (e) => {
595
- if (we(e)) {
609
+ return we.forEach(n, (e) => {
610
+ if (ve(e)) {
596
611
  if (e.type && e.type.displayName === "GridDetailPanel") {
597
612
  const r = e.props;
598
613
  t.masterDetail = {
@@ -606,7 +621,7 @@ function ze(n) {
606
621
  }
607
622
  }), t;
608
623
  }
609
- const nt = me(function(t, e) {
624
+ const it = he(function(t, e) {
610
625
  const {
611
626
  // Core props
612
627
  rows: r,
@@ -617,21 +632,21 @@ const nt = me(function(t, e) {
617
632
  sortable: l,
618
633
  filterable: g,
619
634
  selectable: w,
620
- loading: T,
621
- editOn: k,
622
- customStyles: I,
623
- className: ue,
624
- style: fe,
625
- children: M,
635
+ loading: k,
636
+ editOn: M,
637
+ customStyles: N,
638
+ className: fe,
639
+ style: ge,
640
+ children: O,
626
641
  // Plugin props
627
642
  plugins: P,
628
643
  // SSR mode
629
- ssr: X,
644
+ ssr: ee,
630
645
  // Legacy event handlers
631
- onRowsChange: O,
646
+ onRowsChange: j,
632
647
  // Feature props and event props are in ...rest
633
648
  ...C
634
- } = t, u = S(null), N = S(null), ee = V(Se), j = V(Pe), te = [
649
+ } = t, u = S(null), L = S(null), te = V(xe), H = V(De), re = [
635
650
  "selection",
636
651
  "editing",
637
652
  "filtering",
@@ -656,36 +671,36 @@ const nt = me(function(t, e) {
656
671
  "print",
657
672
  "pivot",
658
673
  "serverSide"
659
- ], ge = v(() => te.map((i) => {
674
+ ], pe = v(() => re.map((i) => {
660
675
  const d = C[i];
661
676
  return d !== void 0 ? `${i}:${JSON.stringify(d)}` : "";
662
- }).filter(Boolean).join("|"), [C]), re = v(() => {
677
+ }).filter(Boolean).join("|"), [C]), ne = v(() => {
663
678
  const i = {};
664
- for (const d of te)
679
+ for (const d of re)
665
680
  d in C && C[d] !== void 0 && (i[d] = C[d]);
666
681
  return i;
667
- }, [ge]), ne = v(() => ze(M), [M]), oe = v(() => ({ ...ne, ...re }), [re, ne]), H = v(() => P || X ? [] : Me(oe), [oe, P, X]), x = v(() => {
682
+ }, [pe]), oe = v(() => $e(O), [O]), ie = v(() => ({ ...oe, ...ne }), [ne, oe]), z = v(() => P || ee ? [] : je(ie), [ie, P, ee]), x = v(() => {
668
683
  if (P) {
669
- const i = new Set(P.map((f) => f.name)), d = H.filter((f) => !i.has(f.name));
684
+ const i = new Set(P.map((f) => f.name)), d = z.filter((f) => !i.has(f.name));
670
685
  return [...P, ...d];
671
686
  }
672
- return H;
673
- }, [P, H]), A = v(() => {
687
+ return z;
688
+ }, [P, z]), A = v(() => {
674
689
  if (!c) return c;
675
- const i = be(c);
690
+ const i = Pe(c);
676
691
  return s ? i.map((d) => ({
677
692
  ...s,
678
693
  ...d
679
694
  // Individual column props override defaults
680
695
  })) : i;
681
696
  }, [c, s]), G = v(() => {
682
- const i = Ge(o), d = {};
683
- if (l !== void 0 && (d.sortable = l), g !== void 0 && (d.filterable = g), w !== void 0 && (d.selectable = w), j) {
697
+ const i = Ve(o), d = {};
698
+ if (l !== void 0 && (d.sortable = l), g !== void 0 && (d.filterable = g), w !== void 0 && (d.selectable = w), H) {
684
699
  const f = i?.icons || o?.icons || {};
685
- d.icons = { ...j, ...f };
700
+ d.icons = { ...H, ...f };
686
701
  }
687
702
  if (x.length > 0 && i) {
688
- const f = i.plugins || [], y = new Set(f.map((D) => D.name)), F = x.filter((D) => !y.has(D.name));
703
+ const f = i.plugins || [], h = new Set(f.map((D) => D.name)), F = x.filter((D) => !h.has(D.name));
689
704
  return {
690
705
  ...i,
691
706
  ...d,
@@ -693,10 +708,10 @@ const nt = me(function(t, e) {
693
708
  };
694
709
  }
695
710
  return x.length > 0 && !i ? { ...d, plugins: x } : Object.keys(d).length > 0 ? { ...i, ...d } : i;
696
- }, [o, x, l, g, w, j]);
711
+ }, [o, x, l, g, w, H]);
697
712
  p(() => {
698
- J().setTypeDefaults(ee);
699
- }, [ee]), p(() => {
713
+ Y().setTypeDefaults(te);
714
+ }, [te]), p(() => {
700
715
  u.current && (u.current.rows = r);
701
716
  }, [r]), p(() => {
702
717
  u.current && G && (u.current.gridConfig = G);
@@ -705,64 +720,64 @@ const nt = me(function(t, e) {
705
720
  }, [A]), p(() => {
706
721
  u.current && a !== void 0 && (u.current.fitMode = a);
707
722
  }, [a]), p(() => {
708
- u.current && k !== void 0 && (u.current.editOn = k);
723
+ u.current && M !== void 0 && (u.current.editOn = M);
724
+ }, [M]), p(() => {
725
+ u.current && k !== void 0 && (u.current.loading = k);
709
726
  }, [k]), p(() => {
710
- u.current && T !== void 0 && (u.current.loading = T);
711
- }, [T]), p(() => {
712
727
  const i = u.current;
713
728
  if (!i) return;
714
- const d = J();
715
- i.__frameworkAdapter = d, je(i), He(i, d);
729
+ const d = Y();
730
+ i.__frameworkAdapter = d, ze(i), _e(i, d);
716
731
  let f = !1;
717
- const y = requestAnimationFrame(() => {
732
+ const h = requestAnimationFrame(() => {
718
733
  f || (typeof i.refreshColumns == "function" && i.refreshColumns(), typeof i.refreshShellHeader == "function" && i.refreshShellHeader());
719
734
  });
720
735
  return () => {
721
- f = !0, cancelAnimationFrame(y);
736
+ f = !0, cancelAnimationFrame(h);
722
737
  };
723
738
  }, []), p(() => {
724
- if (!u.current || !I) return;
739
+ if (!u.current || !N) return;
725
740
  const i = u.current, d = "react-custom-styles";
726
741
  let f = !0;
727
742
  return i.ready?.().then(() => {
728
- f && I && (i.registerStyles?.(d, I), N.current = d);
743
+ f && N && (i.registerStyles?.(d, N), L.current = d);
729
744
  }), () => {
730
- f = !1, N.current && (i.unregisterStyles?.(N.current), N.current = null);
745
+ f = !1, L.current && (i.unregisterStyles?.(L.current), L.current = null);
731
746
  };
732
- }, [I]), p(() => {
747
+ }, [N]), p(() => {
733
748
  const i = u.current;
734
749
  if (!i) return;
735
750
  const d = [];
736
- if (O) {
737
- const f = ((y) => O(y.detail.rows));
751
+ if (j) {
752
+ const f = ((h) => j(h.detail.rows));
738
753
  i.addEventListener("rows-change", f), d.push(["rows-change", f]);
739
754
  }
740
755
  return () => {
741
- d.forEach(([f, y]) => {
742
- i.removeEventListener(f, y);
756
+ d.forEach(([f, h]) => {
757
+ i.removeEventListener(f, h);
743
758
  });
744
759
  };
745
- }, [O]);
746
- const ie = v(() => Object.keys(z).filter((i) => typeof C[i] == "function").sort().join("|"), [C]), se = S({});
747
- for (const i of Object.keys(z))
748
- se.current[i] = C[i];
760
+ }, [j]);
761
+ const se = v(() => Object.keys(_).filter((i) => typeof C[i] == "function").sort().join("|"), [C]), ce = S({});
762
+ for (const i of Object.keys(_))
763
+ ce.current[i] = C[i];
749
764
  return p(() => {
750
765
  const i = u.current;
751
766
  if (!i) return;
752
767
  const d = [];
753
- for (const [f, y] of Object.entries(z))
754
- if (ie.includes(f)) {
768
+ for (const [f, h] of Object.entries(_))
769
+ if (se.includes(f)) {
755
770
  const F = ((D) => {
756
- se.current[f]?.(D.detail, D);
771
+ ce.current[f]?.(D.detail, D);
757
772
  });
758
- i.addEventListener(y, F), d.push([y, F]);
773
+ i.addEventListener(h, F), d.push([h, F]);
759
774
  }
760
775
  return () => {
761
- d.forEach(([f, y]) => {
762
- i.removeEventListener(f, y);
776
+ d.forEach(([f, h]) => {
777
+ i.removeEventListener(f, h);
763
778
  });
764
779
  };
765
- }, [ie]), ye(
780
+ }, [se]), ye(
766
781
  e,
767
782
  () => ({
768
783
  get element() {
@@ -803,7 +818,7 @@ const nt = me(function(t, e) {
803
818
  }
804
819
  }),
805
820
  []
806
- ), /* @__PURE__ */ E(
821
+ ), /* @__PURE__ */ b(
807
822
  "tbw-grid",
808
823
  {
809
824
  ref: (i) => {
@@ -812,25 +827,25 @@ const nt = me(function(t, e) {
812
827
  G && (d.gridConfig = G), r && (d.rows = r), A && (d.columns = A);
813
828
  }
814
829
  },
815
- class: ue,
816
- style: fe,
817
- children: /* @__PURE__ */ E(Oe.Provider, { value: u, children: M })
830
+ class: fe,
831
+ style: ge,
832
+ children: /* @__PURE__ */ b(He.Provider, { value: u, children: O })
818
833
  }
819
834
  );
820
835
  });
821
836
  export {
822
- nt as D,
823
- Oe as G,
824
- rt as R,
825
- tt as a,
826
- Ye as b,
827
- Ue as c,
828
- Ie as d,
829
- De as e,
830
- Xe as f,
831
- Qe as g,
832
- Je as h,
833
- le as i,
834
- et as r,
835
- Ze as u
837
+ it as D,
838
+ He as G,
839
+ ot as R,
840
+ nt as a,
841
+ Qe as b,
842
+ Ye as c,
843
+ Le as d,
844
+ Se as e,
845
+ tt as f,
846
+ et as g,
847
+ Ze as h,
848
+ ue as i,
849
+ rt as r,
850
+ Xe as u
836
851
  };
@@ -1,6 +1,6 @@
1
1
  import { ExportPlugin as p } from "@toolbox-web/grid/plugins/export";
2
2
  import { useContext as a, useCallback as n } from "react";
3
- import { G as c } from "../chunks/data-grid-CGvHh_mp.js";
3
+ import { G as c } from "../chunks/data-grid-O97pdLCY.js";
4
4
  import { r as f } from "../chunks/feature-registry-Y3KvnN54.js";
5
5
  f("export", (i) => {
6
6
  const t = typeof i == "boolean" ? {} : i ?? {};
@@ -2,7 +2,7 @@ import { FilteringPlugin as g } from "@toolbox-web/grid/plugins/filtering";
2
2
  import { useContext as m, useCallback as n } from "react";
3
3
  import { flushSync as w } from "react-dom";
4
4
  import { createRoot as P } from "react-dom/client";
5
- import { G as b } from "../chunks/data-grid-CGvHh_mp.js";
5
+ import { G as b } from "../chunks/data-grid-O97pdLCY.js";
6
6
  import { r as R } from "../chunks/feature-registry-Y3KvnN54.js";
7
7
  R("filtering", (i) => {
8
8
  if (typeof i == "boolean") return new g();
package/features/print.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { PrintPlugin as i } from "@toolbox-web/grid/plugins/print";
2
2
  import { useContext as g, useCallback as n } from "react";
3
- import { G as a } from "../chunks/data-grid-CGvHh_mp.js";
3
+ import { G as a } from "../chunks/data-grid-O97pdLCY.js";
4
4
  import { r as p } from "../chunks/feature-registry-Y3KvnN54.js";
5
5
  p("print", (r) => r === !0 ? new i() : new i(r ?? void 0));
6
6
  function m() {
@@ -5,7 +5,7 @@ import { CellRange, SelectionResult } from '@toolbox-web/grid/plugins/selection'
5
5
  * Uses React context to access the grid ref - works reliably regardless of
6
6
  * when the grid mounts or conditional rendering.
7
7
  */
8
- export interface SelectionMethods {
8
+ export interface SelectionMethods<TRow = unknown> {
9
9
  /**
10
10
  * Select all rows (row mode) or all cells (range mode).
11
11
  */
@@ -27,6 +27,16 @@ export interface SelectionMethods {
27
27
  * Set selection ranges programmatically.
28
28
  */
29
29
  setRanges: (ranges: CellRange[]) => void;
30
+ /**
31
+ * Get actual row objects for the current selection.
32
+ * Works in all selection modes (row, cell, range) — resolves indices
33
+ * against the grid's processed (sorted/filtered) rows.
34
+ *
35
+ * This is the recommended way to get selected rows. Unlike manual
36
+ * index mapping, it correctly resolves rows even when the grid is
37
+ * sorted or filtered.
38
+ */
39
+ getSelectedRows: () => TRow[];
30
40
  }
31
41
  /**
32
42
  * Hook for programmatic selection control.
@@ -52,5 +62,5 @@ export interface SelectionMethods {
52
62
  * }
53
63
  * ```
54
64
  */
55
- export declare function useGridSelection<TRow = unknown>(): SelectionMethods;
65
+ export declare function useGridSelection<TRow = unknown>(): SelectionMethods<TRow>;
56
66
  //# sourceMappingURL=selection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAc5G;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB;;OAEG;IACH,cAAc,EAAE,MAAM,IAAI,CAAC;IAE3B;;;OAGG;IACH,YAAY,EAAE,MAAM,eAAe,GAAG,IAAI,CAAC;IAE3C;;OAEG;IACH,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAEtD;;OAEG;IACH,SAAS,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAG,OAAO,KAAK,gBAAgB,CAkEnE"}
1
+ {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAc5G;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAAC,IAAI,GAAG,OAAO;IAC9C;;OAEG;IACH,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB;;OAEG;IACH,cAAc,EAAE,MAAM,IAAI,CAAC;IAE3B;;;OAGG;IACH,YAAY,EAAE,MAAM,eAAe,GAAG,IAAI,CAAC;IAE3C;;OAEG;IACH,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAEtD;;OAEG;IACH,SAAS,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;IAEzC;;;;;;;;OAQG;IACH,eAAe,EAAE,MAAM,IAAI,EAAE,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAG,OAAO,KAAK,gBAAgB,CAAC,IAAI,CAAC,CAuEzE"}
@@ -1,11 +1,11 @@
1
1
  import { SelectionPlugin as i } from "@toolbox-web/grid/plugins/selection";
2
- import { useContext as w, useCallback as o } from "react";
3
- import { G as S } from "../chunks/data-grid-CGvHh_mp.js";
4
- import { r as C } from "../chunks/feature-registry-Y3KvnN54.js";
5
- C("selection", (e) => e === "cell" || e === "row" || e === "range" ? new i({ mode: e }) : new i(e ?? void 0));
6
- function P() {
7
- const e = w(S), t = o(() => e?.current?.getPlugin(i), [e]), g = o(() => {
8
- const n = t();
2
+ import { useContext as S, useCallback as o } from "react";
3
+ import { G as C } from "../chunks/data-grid-O97pdLCY.js";
4
+ import { r as R } from "../chunks/feature-registry-Y3KvnN54.js";
5
+ R("selection", (t) => t === "cell" || t === "row" || t === "range" ? new i({ mode: t }) : new i(t ?? void 0));
6
+ function b() {
7
+ const t = S(C), e = o(() => t?.current?.getPlugin(i), [t]), g = o(() => {
8
+ const n = e();
9
9
  if (!n) {
10
10
  console.warn(
11
11
  `[tbw-grid:selection] SelectionPlugin not found.
@@ -15,7 +15,7 @@ function P() {
15
15
  );
16
16
  return;
17
17
  }
18
- const r = e?.current, u = n.config?.mode;
18
+ const r = t?.current, u = n.config?.mode;
19
19
  if (u === "row") {
20
20
  const s = r?.rows?.length ?? 0, l = /* @__PURE__ */ new Set();
21
21
  for (let c = 0; c < s; c++) l.add(c);
@@ -24,25 +24,26 @@ function P() {
24
24
  const s = r?.rows?.length ?? 0, l = r?._columns?.length ?? 0;
25
25
  s > 0 && l > 0 && n.setRanges([{ from: { row: 0, col: 0 }, to: { row: s - 1, col: l - 1 } }]);
26
26
  }
27
- }, [t, e]), d = o(() => {
28
- t()?.clearSelection();
29
- }, [t]), a = o(() => t()?.getSelection() ?? null, [t]), m = o(
30
- (n, r) => t()?.isCellSelected(n, r) ?? !1,
31
- [t]
32
- ), f = o(
27
+ }, [e, t]), d = o(() => {
28
+ e()?.clearSelection();
29
+ }, [e]), a = o(() => e()?.getSelection() ?? null, [e]), w = o(
30
+ (n, r) => e()?.isCellSelected(n, r) ?? !1,
31
+ [e]
32
+ ), m = o(
33
33
  (n) => {
34
- t()?.setRanges(n);
34
+ e()?.setRanges(n);
35
35
  },
36
- [t]
37
- );
36
+ [e]
37
+ ), f = o(() => e()?.getSelectedRows() ?? [], [e]);
38
38
  return {
39
39
  selectAll: g,
40
40
  clearSelection: d,
41
41
  getSelection: a,
42
- isCellSelected: m,
43
- setRanges: f
42
+ isCellSelected: w,
43
+ setRanges: m,
44
+ getSelectedRows: f
44
45
  };
45
46
  }
46
47
  export {
47
- P as useGridSelection
48
+ b as useGridSelection
48
49
  };
@@ -1,6 +1,6 @@
1
1
  import { UndoRedoPlugin as t } from "@toolbox-web/grid/plugins/undo-redo";
2
2
  import { useContext as g, useCallback as e } from "react";
3
- import { G as R } from "../chunks/data-grid-CGvHh_mp.js";
3
+ import { G as R } from "../chunks/data-grid-O97pdLCY.js";
4
4
  import { r as f } from "../chunks/feature-registry-Y3KvnN54.js";
5
5
  f("undoRedo", (d) => {
6
6
  const o = typeof d == "boolean" ? {} : d ?? {};
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { r as T, a as B, b as k, c as A } from "./chunks/data-grid-CGvHh_mp.js";
2
- import { D as H, i as U, d as $, e as K, f as M, R as O, h as Q, u as X, g as Y } from "./chunks/data-grid-CGvHh_mp.js";
1
+ import { r as T, a as B, b as k, c as A } from "./chunks/data-grid-O97pdLCY.js";
2
+ import { D as H, i as U, d as $, e as K, f as M, R as O, h as Q, u as X, g as Y } from "./chunks/data-grid-O97pdLCY.js";
3
3
  import { jsx as w, Fragment as I } from "react/jsx-runtime";
4
4
  import { useRef as R, useCallback as i, useState as P, useEffect as S } from "react";
5
5
  function J(n) {
@@ -76,6 +76,17 @@ export type GridConfig<TRow = unknown> = Omit<BaseGridConfig<TRow>, 'columns'> &
76
76
  * @see {@link GridConfig}
77
77
  */
78
78
  export type ReactGridConfig<TRow = unknown> = GridConfig<TRow>;
79
+ /**
80
+ * Clean up config-based editor React roots whose containers are inside the given element.
81
+ * Called by the React GridAdapter's releaseCell to properly unmount editor roots
82
+ * that were created by `wrapReactEditor` (which bypasses the adapter's tracking).
83
+ *
84
+ * Only targets editor containers (`.react-cell-editor`), not renderer containers,
85
+ * since renderers use a WeakMap cache and must survive cell recycling.
86
+ *
87
+ * @internal
88
+ */
89
+ export declare function cleanupConfigRootsIn(parentEl: HTMLElement): void;
79
90
  /**
80
91
  * Wraps a React renderer function into a DOM-returning viewRenderer.
81
92
  * Used internally by DataGrid to process reactRenderer properties.
@@ -1 +1 @@
1
- {"version":3,"file":"react-column-config.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/react-column-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,UAAU,IAAI,cAAc,EAC5B,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,YAAY,CAAC,IAAI,GAAG,OAAO,CAAE,SAAQ,IAAI,CACxD,gBAAgB,CAAC,IAAI,CAAC,EACtB,UAAU,GAAG,cAAc,GAAG,QAAQ,CACvC;IACC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;IAEvD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;CACxD;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,IAAI,GAAG,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;AAInE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,UAAU,CAAC,IAAI,GAAG,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,GAAG;IAC/E,OAAO,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;CAChC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,IAAI,GAAG,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;AAM/D;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EACpC,QAAQ,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,SAAS,GACpD,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,WAAW,CAiC/C;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAClC,QAAQ,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,SAAS,GACtD,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,WAAW,CAcjD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,SAAS,CAyB9G;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,0BAAoB,CAAC"}
1
+ {"version":3,"file":"react-column-config.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/react-column-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,IAA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AW,CAiC/C;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAClC,QAAQ,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,SAAS,GACtD,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,WAAW,CAcjD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,SAAS,CAyB9G;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,0BAAoB,CAAC"}
@@ -158,6 +158,8 @@ export declare class GridAdapter implements FrameworkAdapter {
158
158
  /**
159
159
  * Called when a cell's content is about to be wiped.
160
160
  * Destroys editor React roots whose container is inside the cell.
161
+ * Also cleans up config-based editor roots (from processGridConfig/wrapReactEditor)
162
+ * that bypass the adapter's tracking arrays.
161
163
  */
162
164
  releaseCell(cellEl: HTMLElement): void;
163
165
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"react-grid-adapter.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/react-grid-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAiB9E;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,SAAS,GAChE,IAAI,CAaN;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACp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IACH,OAAO,IAAI,IAAI;IAmBf;;;;;OAKG;IACH,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAgBtC;;OAEG;IACH,OAAO,CAAC,SAAS,EAAE,WAAW,GAAG,IAAI;CAYtC;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,oBAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolbox-web/grid-react",
3
- "version": "0.12.2",
3
+ "version": "0.13.1",
4
4
  "description": "React adapter for @toolbox-web/grid data grid component",
5
5
  "type": "module",
6
6
  "main": "./index.js",