@toolbox-web/grid-react 0.12.1 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/{data-grid-B0FOIoOo.js → data-grid-CGvHh_mp.js} +80 -57
- package/features/export.js +1 -1
- package/features/filtering.js +1 -1
- package/features/print.js +1 -1
- package/features/selection.js +1 -1
- package/features/undo-redo.js +1 -1
- package/index.js +2 -2
- package/lib/react-grid-adapter.d.ts +7 -0
- package/lib/react-grid-adapter.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as E } from "react/jsx-runtime";
|
|
2
2
|
import { DataGridElement as pe } from "@toolbox-web/grid";
|
|
3
|
-
import { createContext as Y, useContext as
|
|
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";
|
|
4
4
|
import { flushSync as m } from "react-dom";
|
|
5
5
|
import { createRoot as h } from "react-dom/client";
|
|
6
|
-
import { c as
|
|
6
|
+
import { c as ve } from "./feature-registry-Y3KvnN54.js";
|
|
7
7
|
function Ce(n) {
|
|
8
8
|
return n.charAt(0).toUpperCase() + n.slice(1);
|
|
9
9
|
}
|
|
@@ -11,7 +11,7 @@ function ce(n) {
|
|
|
11
11
|
return n.toLowerCase() === "id" ? "ID" : n.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").split(" ").filter(Boolean).map(Ce).join(" ");
|
|
12
12
|
}
|
|
13
13
|
const Re = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime", "currency"]);
|
|
14
|
-
function
|
|
14
|
+
function Ee(n) {
|
|
15
15
|
const t = n.lastIndexOf(":");
|
|
16
16
|
if (t > 0) {
|
|
17
17
|
const e = n.slice(t + 1).toLowerCase();
|
|
@@ -29,8 +29,8 @@ function be(n) {
|
|
|
29
29
|
header: ce(n)
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return n.map((t) => typeof t == "string" ?
|
|
32
|
+
function be(n) {
|
|
33
|
+
return n.map((t) => typeof t == "string" ? Ee(t) : t);
|
|
34
34
|
}
|
|
35
35
|
const z = {
|
|
36
36
|
onCellClick: "cell-click",
|
|
@@ -57,9 +57,9 @@ 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__ */
|
|
60
|
+
}, Q = Y(null), Ue = ({ icons: n, children: t }) => /* @__PURE__ */ E(Q.Provider, { value: n, children: t });
|
|
61
61
|
function Je() {
|
|
62
|
-
return
|
|
62
|
+
return V(Q);
|
|
63
63
|
}
|
|
64
64
|
const Pe = Q, $ = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new Map();
|
|
65
65
|
function de(n) {
|
|
@@ -97,15 +97,15 @@ function De(n) {
|
|
|
97
97
|
}
|
|
98
98
|
}, []);
|
|
99
99
|
const c = e === "auto" ? "auto" : String(e);
|
|
100
|
-
return /* @__PURE__ */
|
|
100
|
+
return /* @__PURE__ */ E("tbw-grid-responsive-card", { ref: o, cardRowHeight: c });
|
|
101
101
|
}
|
|
102
102
|
De.displayName = "GridResponsiveCard";
|
|
103
|
-
const L = Y(null), Ye = ({ defaults: n, children: t }) => /* @__PURE__ */
|
|
103
|
+
const L = Y(null), Ye = ({ defaults: n, children: t }) => /* @__PURE__ */ E(L.Provider, { value: n, children: t });
|
|
104
104
|
function Ze() {
|
|
105
|
-
return
|
|
105
|
+
return V(L);
|
|
106
106
|
}
|
|
107
107
|
function Qe(n) {
|
|
108
|
-
return
|
|
108
|
+
return V(L)?.[n];
|
|
109
109
|
}
|
|
110
110
|
const Se = L;
|
|
111
111
|
function xe(n) {
|
|
@@ -150,7 +150,7 @@ function Ge(n) {
|
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
const q = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new Map();
|
|
153
|
-
function
|
|
153
|
+
function Ve(n) {
|
|
154
154
|
const t = n.querySelector("tbw-grid-detail");
|
|
155
155
|
if (t) {
|
|
156
156
|
const r = q.get(t);
|
|
@@ -160,7 +160,7 @@ function Ie(n) {
|
|
|
160
160
|
if (e)
|
|
161
161
|
return B.get(e);
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Ie(n) {
|
|
164
164
|
const { children: t, showExpandColumn: e = !0, animation: r = "slide" } = n, o = S(null), c = Z(
|
|
165
165
|
(a) => {
|
|
166
166
|
if (o.current = a, !a) return;
|
|
@@ -179,13 +179,13 @@ function Ne(n) {
|
|
|
179
179
|
q.delete(a);
|
|
180
180
|
const l = a.closest("tbw-grid");
|
|
181
181
|
if (l) {
|
|
182
|
-
const
|
|
183
|
-
|
|
182
|
+
const w = l.id || l.getAttribute("data-grid-id");
|
|
183
|
+
w && B.delete(w);
|
|
184
184
|
}
|
|
185
185
|
const g = a.parentNode;
|
|
186
186
|
g && g.contains(a);
|
|
187
187
|
}
|
|
188
|
-
}, []), /* @__PURE__ */
|
|
188
|
+
}, []), /* @__PURE__ */ E(
|
|
189
189
|
"tbw-grid-detail",
|
|
190
190
|
{
|
|
191
191
|
ref: c,
|
|
@@ -194,9 +194,9 @@ function Ne(n) {
|
|
|
194
194
|
}
|
|
195
195
|
);
|
|
196
196
|
}
|
|
197
|
-
|
|
197
|
+
Ie.displayName = "GridDetailPanel";
|
|
198
198
|
const K = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new Map();
|
|
199
|
-
function
|
|
199
|
+
function Ne(n) {
|
|
200
200
|
const t = K.get(n);
|
|
201
201
|
if (t) return t;
|
|
202
202
|
const e = n.id;
|
|
@@ -213,7 +213,7 @@ function Xe(n) {
|
|
|
213
213
|
return p(() => () => {
|
|
214
214
|
const g = a.current;
|
|
215
215
|
g && (K.delete(g), t && U.delete(t));
|
|
216
|
-
}, [t]), /* @__PURE__ */
|
|
216
|
+
}, [t]), /* @__PURE__ */ E(
|
|
217
217
|
"tbw-grid-tool-panel",
|
|
218
218
|
{
|
|
219
219
|
ref: l,
|
|
@@ -225,26 +225,26 @@ function Xe(n) {
|
|
|
225
225
|
}
|
|
226
226
|
);
|
|
227
227
|
}
|
|
228
|
-
const R = /* @__PURE__ */ new WeakMap(),
|
|
228
|
+
const R = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new Map();
|
|
229
229
|
function et(n, t) {
|
|
230
230
|
const e = n.getAttribute("field"), r = R.get(n) ?? {};
|
|
231
231
|
if (r.renderer = t, R.set(n, r), e) {
|
|
232
|
-
const o =
|
|
233
|
-
o.renderer = t,
|
|
232
|
+
const o = b.get(e) ?? {};
|
|
233
|
+
o.renderer = t, b.set(e, o);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
function tt(n, t) {
|
|
237
237
|
const e = n.getAttribute("field"), r = R.get(n) ?? {};
|
|
238
238
|
if (r.editor = t, R.set(n, r), e) {
|
|
239
|
-
const o =
|
|
240
|
-
o.editor = t,
|
|
239
|
+
const o = b.get(e) ?? {};
|
|
240
|
+
o.editor = t, b.set(e, o);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
function Fe(n) {
|
|
244
244
|
let t = R.get(n)?.renderer;
|
|
245
245
|
if (!t) {
|
|
246
246
|
const e = n.getAttribute("field");
|
|
247
|
-
e && (t =
|
|
247
|
+
e && (t = b.get(e)?.renderer);
|
|
248
248
|
}
|
|
249
249
|
return t;
|
|
250
250
|
}
|
|
@@ -252,12 +252,14 @@ function Le(n) {
|
|
|
252
252
|
let t = R.get(n)?.editor;
|
|
253
253
|
if (!t) {
|
|
254
254
|
const e = n.getAttribute("field");
|
|
255
|
-
e && (t =
|
|
255
|
+
e && (t = b.get(e)?.editor);
|
|
256
256
|
}
|
|
257
257
|
return t;
|
|
258
258
|
}
|
|
259
259
|
class le {
|
|
260
260
|
mountedViews = [];
|
|
261
|
+
/** Editor-specific views tracked separately for per-cell cleanup via releaseCell. */
|
|
262
|
+
editorViews = [];
|
|
261
263
|
typeDefaults = null;
|
|
262
264
|
/**
|
|
263
265
|
* Sets the type defaults map for this adapter.
|
|
@@ -276,7 +278,7 @@ class le {
|
|
|
276
278
|
const e = t.getAttribute("field");
|
|
277
279
|
let r = R.get(t);
|
|
278
280
|
if (!r && e) {
|
|
279
|
-
const s =
|
|
281
|
+
const s = b.get(e);
|
|
280
282
|
s && (s.renderer || s.editor) && (r = s, R.set(t, r));
|
|
281
283
|
}
|
|
282
284
|
const o = r?.renderer !== void 0, c = r?.editor !== void 0;
|
|
@@ -308,10 +310,10 @@ class le {
|
|
|
308
310
|
}), l.container;
|
|
309
311
|
const g = document.createElement("div");
|
|
310
312
|
g.className = "react-cell-renderer", g.style.display = "contents";
|
|
311
|
-
const
|
|
313
|
+
const w = h(g);
|
|
312
314
|
return m(() => {
|
|
313
|
-
|
|
314
|
-
}), r.set(c, { root:
|
|
315
|
+
w.render(e(o));
|
|
316
|
+
}), r.set(c, { root: w, container: g, lastRowIndex: o.rowIndex ?? -1 }), this.mountedViews.push({ root: w, container: g }), g;
|
|
315
317
|
}
|
|
316
318
|
const s = document.createElement("div");
|
|
317
319
|
s.className = "react-cell-renderer", s.style.display = "contents";
|
|
@@ -333,7 +335,7 @@ class le {
|
|
|
333
335
|
const c = h(o);
|
|
334
336
|
return m(() => {
|
|
335
337
|
c.render(e(r));
|
|
336
|
-
}), this.
|
|
338
|
+
}), this.editorViews.push({ root: c, container: o }), o;
|
|
337
339
|
} : () => document.createElement("div");
|
|
338
340
|
}
|
|
339
341
|
/**
|
|
@@ -341,7 +343,7 @@ class le {
|
|
|
341
343
|
* Renders React components for expandable detail rows.
|
|
342
344
|
*/
|
|
343
345
|
createDetailRenderer(t) {
|
|
344
|
-
const e =
|
|
346
|
+
const e = Ve(t);
|
|
345
347
|
if (e)
|
|
346
348
|
return (r, o) => {
|
|
347
349
|
const c = document.createElement("div");
|
|
@@ -382,7 +384,7 @@ class le {
|
|
|
382
384
|
* Renders React components into tool panel containers.
|
|
383
385
|
*/
|
|
384
386
|
createToolPanelRenderer(t) {
|
|
385
|
-
const e =
|
|
387
|
+
const e = Ne(t);
|
|
386
388
|
if (!e)
|
|
387
389
|
return;
|
|
388
390
|
const r = t.closest("tbw-grid");
|
|
@@ -463,7 +465,7 @@ class le {
|
|
|
463
465
|
const r = document.createElement("span");
|
|
464
466
|
r.style.display = "contents";
|
|
465
467
|
const o = h(r);
|
|
466
|
-
return this.
|
|
468
|
+
return this.editorViews.push({ root: o, container: r }), m(() => {
|
|
467
469
|
o.render(t(e));
|
|
468
470
|
}), r;
|
|
469
471
|
};
|
|
@@ -492,7 +494,28 @@ class le {
|
|
|
492
494
|
t.unmount();
|
|
493
495
|
} catch {
|
|
494
496
|
}
|
|
495
|
-
}), this.mountedViews = []
|
|
497
|
+
}), this.mountedViews = [], this.editorViews.forEach(({ root: t }) => {
|
|
498
|
+
try {
|
|
499
|
+
t.unmount();
|
|
500
|
+
} catch {
|
|
501
|
+
}
|
|
502
|
+
}), this.editorViews = [];
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Called when a cell's content is about to be wiped.
|
|
506
|
+
* Destroys editor React roots whose container is inside the cell.
|
|
507
|
+
*/
|
|
508
|
+
releaseCell(t) {
|
|
509
|
+
for (let e = this.editorViews.length - 1; e >= 0; e--) {
|
|
510
|
+
const { root: r, container: o } = this.editorViews[e];
|
|
511
|
+
if (t.contains(o)) {
|
|
512
|
+
try {
|
|
513
|
+
r.unmount();
|
|
514
|
+
} catch {
|
|
515
|
+
}
|
|
516
|
+
this.editorViews.splice(e, 1);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
496
519
|
}
|
|
497
520
|
/**
|
|
498
521
|
* Unmount a specific container (called when cell is recycled).
|
|
@@ -542,7 +565,7 @@ function Me(n) {
|
|
|
542
565
|
for (const s of c) {
|
|
543
566
|
const a = n[s];
|
|
544
567
|
if (a === void 0 || a === !1) continue;
|
|
545
|
-
const l =
|
|
568
|
+
const l = ve(s, a);
|
|
546
569
|
l && t.push(l);
|
|
547
570
|
}
|
|
548
571
|
return t;
|
|
@@ -569,7 +592,7 @@ function He(n, t) {
|
|
|
569
592
|
function ze(n) {
|
|
570
593
|
const t = {};
|
|
571
594
|
return he.forEach(n, (e) => {
|
|
572
|
-
if (
|
|
595
|
+
if (we(e)) {
|
|
573
596
|
if (e.type && e.type.displayName === "GridDetailPanel") {
|
|
574
597
|
const r = e.props;
|
|
575
598
|
t.masterDetail = {
|
|
@@ -593,10 +616,10 @@ const nt = me(function(t, e) {
|
|
|
593
616
|
fitMode: a,
|
|
594
617
|
sortable: l,
|
|
595
618
|
filterable: g,
|
|
596
|
-
selectable:
|
|
619
|
+
selectable: w,
|
|
597
620
|
loading: T,
|
|
598
621
|
editOn: k,
|
|
599
|
-
customStyles:
|
|
622
|
+
customStyles: I,
|
|
600
623
|
className: ue,
|
|
601
624
|
style: fe,
|
|
602
625
|
children: M,
|
|
@@ -608,7 +631,7 @@ const nt = me(function(t, e) {
|
|
|
608
631
|
onRowsChange: O,
|
|
609
632
|
// Feature props and event props are in ...rest
|
|
610
633
|
...C
|
|
611
|
-
} = t, u = S(null),
|
|
634
|
+
} = t, u = S(null), N = S(null), ee = V(Se), j = V(Pe), te = [
|
|
612
635
|
"selection",
|
|
613
636
|
"editing",
|
|
614
637
|
"filtering",
|
|
@@ -633,31 +656,31 @@ const nt = me(function(t, e) {
|
|
|
633
656
|
"print",
|
|
634
657
|
"pivot",
|
|
635
658
|
"serverSide"
|
|
636
|
-
], ge =
|
|
659
|
+
], ge = v(() => te.map((i) => {
|
|
637
660
|
const d = C[i];
|
|
638
661
|
return d !== void 0 ? `${i}:${JSON.stringify(d)}` : "";
|
|
639
|
-
}).filter(Boolean).join("|"), [C]), re =
|
|
662
|
+
}).filter(Boolean).join("|"), [C]), re = v(() => {
|
|
640
663
|
const i = {};
|
|
641
664
|
for (const d of te)
|
|
642
665
|
d in C && C[d] !== void 0 && (i[d] = C[d]);
|
|
643
666
|
return i;
|
|
644
|
-
}, [ge]), ne =
|
|
667
|
+
}, [ge]), ne = v(() => ze(M), [M]), oe = v(() => ({ ...ne, ...re }), [re, ne]), H = v(() => P || X ? [] : Me(oe), [oe, P, X]), x = v(() => {
|
|
645
668
|
if (P) {
|
|
646
669
|
const i = new Set(P.map((f) => f.name)), d = H.filter((f) => !i.has(f.name));
|
|
647
670
|
return [...P, ...d];
|
|
648
671
|
}
|
|
649
672
|
return H;
|
|
650
|
-
}, [P, H]), A =
|
|
673
|
+
}, [P, H]), A = v(() => {
|
|
651
674
|
if (!c) return c;
|
|
652
|
-
const i =
|
|
675
|
+
const i = be(c);
|
|
653
676
|
return s ? i.map((d) => ({
|
|
654
677
|
...s,
|
|
655
678
|
...d
|
|
656
679
|
// Individual column props override defaults
|
|
657
680
|
})) : i;
|
|
658
|
-
}, [c, s]), G =
|
|
681
|
+
}, [c, s]), G = v(() => {
|
|
659
682
|
const i = Ge(o), d = {};
|
|
660
|
-
if (l !== void 0 && (d.sortable = l), g !== void 0 && (d.filterable = g),
|
|
683
|
+
if (l !== void 0 && (d.sortable = l), g !== void 0 && (d.filterable = g), w !== void 0 && (d.selectable = w), j) {
|
|
661
684
|
const f = i?.icons || o?.icons || {};
|
|
662
685
|
d.icons = { ...j, ...f };
|
|
663
686
|
}
|
|
@@ -670,7 +693,7 @@ const nt = me(function(t, e) {
|
|
|
670
693
|
};
|
|
671
694
|
}
|
|
672
695
|
return x.length > 0 && !i ? { ...d, plugins: x } : Object.keys(d).length > 0 ? { ...i, ...d } : i;
|
|
673
|
-
}, [o, x, l, g,
|
|
696
|
+
}, [o, x, l, g, w, j]);
|
|
674
697
|
p(() => {
|
|
675
698
|
J().setTypeDefaults(ee);
|
|
676
699
|
}, [ee]), p(() => {
|
|
@@ -698,15 +721,15 @@ const nt = me(function(t, e) {
|
|
|
698
721
|
f = !0, cancelAnimationFrame(y);
|
|
699
722
|
};
|
|
700
723
|
}, []), p(() => {
|
|
701
|
-
if (!u.current || !
|
|
724
|
+
if (!u.current || !I) return;
|
|
702
725
|
const i = u.current, d = "react-custom-styles";
|
|
703
726
|
let f = !0;
|
|
704
727
|
return i.ready?.().then(() => {
|
|
705
|
-
f &&
|
|
728
|
+
f && I && (i.registerStyles?.(d, I), N.current = d);
|
|
706
729
|
}), () => {
|
|
707
|
-
f = !1,
|
|
730
|
+
f = !1, N.current && (i.unregisterStyles?.(N.current), N.current = null);
|
|
708
731
|
};
|
|
709
|
-
}, [
|
|
732
|
+
}, [I]), p(() => {
|
|
710
733
|
const i = u.current;
|
|
711
734
|
if (!i) return;
|
|
712
735
|
const d = [];
|
|
@@ -720,7 +743,7 @@ const nt = me(function(t, e) {
|
|
|
720
743
|
});
|
|
721
744
|
};
|
|
722
745
|
}, [O]);
|
|
723
|
-
const ie =
|
|
746
|
+
const ie = v(() => Object.keys(z).filter((i) => typeof C[i] == "function").sort().join("|"), [C]), se = S({});
|
|
724
747
|
for (const i of Object.keys(z))
|
|
725
748
|
se.current[i] = C[i];
|
|
726
749
|
return p(() => {
|
|
@@ -780,7 +803,7 @@ const nt = me(function(t, e) {
|
|
|
780
803
|
}
|
|
781
804
|
}),
|
|
782
805
|
[]
|
|
783
|
-
), /* @__PURE__ */
|
|
806
|
+
), /* @__PURE__ */ E(
|
|
784
807
|
"tbw-grid",
|
|
785
808
|
{
|
|
786
809
|
ref: (i) => {
|
|
@@ -791,7 +814,7 @@ const nt = me(function(t, e) {
|
|
|
791
814
|
},
|
|
792
815
|
class: ue,
|
|
793
816
|
style: fe,
|
|
794
|
-
children: /* @__PURE__ */
|
|
817
|
+
children: /* @__PURE__ */ E(Oe.Provider, { value: u, children: M })
|
|
795
818
|
}
|
|
796
819
|
);
|
|
797
820
|
});
|
|
@@ -802,7 +825,7 @@ export {
|
|
|
802
825
|
tt as a,
|
|
803
826
|
Ye as b,
|
|
804
827
|
Ue as c,
|
|
805
|
-
|
|
828
|
+
Ie as d,
|
|
806
829
|
De as e,
|
|
807
830
|
Xe as f,
|
|
808
831
|
Qe as g,
|
package/features/export.js
CHANGED
|
@@ -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-
|
|
3
|
+
import { G as c } from "../chunks/data-grid-CGvHh_mp.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 ?? {};
|
package/features/filtering.js
CHANGED
|
@@ -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-
|
|
5
|
+
import { G as b } from "../chunks/data-grid-CGvHh_mp.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-
|
|
3
|
+
import { G as a } from "../chunks/data-grid-CGvHh_mp.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() {
|
package/features/selection.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SelectionPlugin as i } from "@toolbox-web/grid/plugins/selection";
|
|
2
2
|
import { useContext as w, useCallback as o } from "react";
|
|
3
|
-
import { G as S } from "../chunks/data-grid-
|
|
3
|
+
import { G as S } from "../chunks/data-grid-CGvHh_mp.js";
|
|
4
4
|
import { r as C } from "../chunks/feature-registry-Y3KvnN54.js";
|
|
5
5
|
C("selection", (e) => e === "cell" || e === "row" || e === "range" ? new i({ mode: e }) : new i(e ?? void 0));
|
|
6
6
|
function P() {
|
package/features/undo-redo.js
CHANGED
|
@@ -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-
|
|
3
|
+
import { G as R } from "../chunks/data-grid-CGvHh_mp.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-
|
|
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-
|
|
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";
|
|
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) {
|
|
@@ -58,6 +58,8 @@ export declare function getRegisteredFields(): string[];
|
|
|
58
58
|
*/
|
|
59
59
|
export declare class GridAdapter implements FrameworkAdapter {
|
|
60
60
|
private mountedViews;
|
|
61
|
+
/** Editor-specific views tracked separately for per-cell cleanup via releaseCell. */
|
|
62
|
+
private editorViews;
|
|
61
63
|
private typeDefaults;
|
|
62
64
|
/**
|
|
63
65
|
* Sets the type defaults map for this adapter.
|
|
@@ -153,6 +155,11 @@ export declare class GridAdapter implements FrameworkAdapter {
|
|
|
153
155
|
* Call this when the grid is unmounted.
|
|
154
156
|
*/
|
|
155
157
|
destroy(): void;
|
|
158
|
+
/**
|
|
159
|
+
* Called when a cell's content is about to be wiped.
|
|
160
|
+
* Destroys editor React roots whose container is inside the cell.
|
|
161
|
+
*/
|
|
162
|
+
releaseCell(cellEl: HTMLElement): void;
|
|
156
163
|
/**
|
|
157
164
|
* Unmount a specific container (called when cell is recycled).
|
|
158
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,EACpB,MAAM,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,SAAS,GAChE,IAAI,CAYN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,WAAW,GACnB,CAAC,CAAC,GAAG,EAAE,iBAAi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