@toolbox-web/grid-react 1.6.0 → 1.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.
- package/chunks/{grid-detail-panel-CR7YUhdN.js → grid-detail-panel-BZFcujsZ.js} +10 -10
- package/chunks/grid-responsive-card-CSZhDCoN.js +45 -0
- package/chunks/portal-bridge-CvxNt40O.js +68 -0
- package/chunks/{react-column-config-B8Isgp88.js → react-column-config-BOe_PgL1.js} +28 -28
- package/chunks/{react-grid-adapter-DeV_qtlr.js → react-grid-adapter-BuuCl9rO.js} +65 -45
- package/features/editing.js +1 -1
- package/features/filtering.js +3 -3
- package/features/grouping-columns.js +1 -1
- package/features/grouping-rows.js +1 -1
- package/features/index.d.ts.map +1 -1
- package/features/index.js +1 -0
- package/features/master-detail.js +3 -3
- package/features/pinned-rows.js +1 -1
- package/features/responsive.js +3 -3
- package/features/row-drag-drop.js +1 -0
- package/features/sticky-rows.d.ts +1 -0
- package/features/sticky-rows.d.ts.map +1 -0
- package/features/sticky-rows.js +1 -0
- package/index.d.ts +2 -1
- package/index.d.ts.map +1 -1
- package/index.js +331 -311
- package/lib/data-grid.d.ts.map +1 -1
- package/lib/feature-props.d.ts +23 -5
- package/lib/feature-props.d.ts.map +1 -1
- package/lib/portal-bridge.d.ts +15 -0
- package/lib/portal-bridge.d.ts.map +1 -1
- package/lib/portal-manager.d.ts +27 -0
- package/lib/portal-manager.d.ts.map +1 -1
- package/lib/react-grid-adapter.d.ts +18 -2
- package/lib/react-grid-adapter.d.ts.map +1 -1
- package/lib/use-grid-overlay.d.ts +3 -3
- package/package.json +1 -1
- package/chunks/grid-responsive-card-BB28Zl2O.js +0 -45
- package/chunks/portal-bridge-CH_xMkYc.js +0 -52
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as u, useCallback as b, useEffect as m } from "react";
|
|
3
3
|
const o = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new Map();
|
|
4
4
|
function x(r) {
|
|
5
5
|
const i = r.querySelector("tbw-grid-detail");
|
|
@@ -11,12 +11,12 @@ function x(r) {
|
|
|
11
11
|
if (d)
|
|
12
12
|
return s.get(d);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const { children: i, showExpandColumn: d = !0, animation: n = "slide" } = r, l =
|
|
14
|
+
function p(r) {
|
|
15
|
+
const { children: i, showExpandColumn: d = !0, animation: n = "slide" } = r, l = u(null), f = b(
|
|
16
16
|
(t) => {
|
|
17
17
|
if (l.current = t, !t) return;
|
|
18
18
|
o.set(t, i);
|
|
19
|
-
const e = t.closest("tbw-grid");
|
|
19
|
+
const e = t.closest("tbw-grid, [data-tbw-grid]");
|
|
20
20
|
if (e) {
|
|
21
21
|
const a = e.id || e.getAttribute("data-grid-id");
|
|
22
22
|
a && s.set(a, i);
|
|
@@ -24,11 +24,11 @@ function b(r) {
|
|
|
24
24
|
},
|
|
25
25
|
[i]
|
|
26
26
|
);
|
|
27
|
-
return
|
|
27
|
+
return m(() => () => {
|
|
28
28
|
const t = l.current;
|
|
29
29
|
if (t) {
|
|
30
30
|
o.delete(t);
|
|
31
|
-
const e = t.closest("tbw-grid");
|
|
31
|
+
const e = t.closest("tbw-grid, [data-tbw-grid]");
|
|
32
32
|
if (e) {
|
|
33
33
|
const c = e.id || e.getAttribute("data-grid-id");
|
|
34
34
|
c && s.delete(c);
|
|
@@ -36,7 +36,7 @@ function b(r) {
|
|
|
36
36
|
const a = t.parentNode;
|
|
37
37
|
a && a.contains(t);
|
|
38
38
|
}
|
|
39
|
-
}, []), /* @__PURE__ */
|
|
39
|
+
}, []), /* @__PURE__ */ g(
|
|
40
40
|
"tbw-grid-detail",
|
|
41
41
|
{
|
|
42
42
|
ref: f,
|
|
@@ -45,8 +45,8 @@ function b(r) {
|
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
p.displayName = "GridDetailPanel";
|
|
49
49
|
export {
|
|
50
|
-
|
|
50
|
+
p as G,
|
|
51
51
|
x as g
|
|
52
52
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as f, useCallback as l, useEffect as p } from "react";
|
|
3
|
+
const o = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new Map();
|
|
4
|
+
function v(i) {
|
|
5
|
+
const r = i.querySelector("tbw-grid-responsive-card");
|
|
6
|
+
if (r) {
|
|
7
|
+
const s = o.get(r);
|
|
8
|
+
if (s) return s;
|
|
9
|
+
}
|
|
10
|
+
const d = i.id || i.getAttribute("data-grid-id");
|
|
11
|
+
if (d)
|
|
12
|
+
return a.get(d);
|
|
13
|
+
}
|
|
14
|
+
function b(i) {
|
|
15
|
+
const { children: r, cardRowHeight: d = "auto" } = i, s = f(null), c = l(
|
|
16
|
+
(t) => {
|
|
17
|
+
if (s.current = t, !t) return;
|
|
18
|
+
o.set(t, r);
|
|
19
|
+
const e = t.closest("tbw-grid, [data-tbw-grid]");
|
|
20
|
+
if (e) {
|
|
21
|
+
const n = e.id || e.getAttribute("data-grid-id");
|
|
22
|
+
n && a.set(n, r);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
[r]
|
|
26
|
+
);
|
|
27
|
+
p(() => () => {
|
|
28
|
+
const t = s.current;
|
|
29
|
+
if (t) {
|
|
30
|
+
o.delete(t);
|
|
31
|
+
const e = t.closest("tbw-grid, [data-tbw-grid]");
|
|
32
|
+
if (e) {
|
|
33
|
+
const n = e.id || e.getAttribute("data-grid-id");
|
|
34
|
+
n && a.delete(n);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}, []);
|
|
38
|
+
const g = d === "auto" ? "auto" : String(d);
|
|
39
|
+
return /* @__PURE__ */ u("tbw-grid-responsive-card", { ref: c, cardRowHeight: g });
|
|
40
|
+
}
|
|
41
|
+
b.displayName = "GridResponsiveCard";
|
|
42
|
+
export {
|
|
43
|
+
b as G,
|
|
44
|
+
v as g
|
|
45
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { flushSync as d } from "react-dom";
|
|
2
|
+
import { createRoot as p } from "react-dom/client";
|
|
3
|
+
const o = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
4
|
+
let m = 0;
|
|
5
|
+
function B(t, e) {
|
|
6
|
+
e ? o.set(t, e) : o.delete(t);
|
|
7
|
+
}
|
|
8
|
+
function g(t, e) {
|
|
9
|
+
if (e) return e;
|
|
10
|
+
const n = t.closest("tbw-grid, [data-tbw-grid]");
|
|
11
|
+
if (n) return n;
|
|
12
|
+
if (o.size === 1) return o.keys().next().value;
|
|
13
|
+
}
|
|
14
|
+
function u(t) {
|
|
15
|
+
const e = i.get(t);
|
|
16
|
+
if (e) {
|
|
17
|
+
try {
|
|
18
|
+
e.unmount();
|
|
19
|
+
} catch {
|
|
20
|
+
}
|
|
21
|
+
i.delete(t);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function v(t, e, n, r) {
|
|
25
|
+
const s = n ?? `p-${m++}`, a = g(t, r), l = a ? o.get(a) : void 0;
|
|
26
|
+
if (l)
|
|
27
|
+
u(s), a && f.set(s, a), l.renderPortal(s, t, e);
|
|
28
|
+
else {
|
|
29
|
+
let c = i.get(s);
|
|
30
|
+
c || (c = p(t), i.set(s, c)), d(() => c.render(e));
|
|
31
|
+
}
|
|
32
|
+
return s;
|
|
33
|
+
}
|
|
34
|
+
function w(t, e) {
|
|
35
|
+
const n = f.get(t);
|
|
36
|
+
(n ? o.get(n) : void 0)?.removePortal(t, e?.sync), f.delete(t), u(t);
|
|
37
|
+
}
|
|
38
|
+
function M(t) {
|
|
39
|
+
if (t) {
|
|
40
|
+
o.get(t)?.beginBatch();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
for (const e of o.values()) e.beginBatch();
|
|
44
|
+
}
|
|
45
|
+
function y(t) {
|
|
46
|
+
if (t) {
|
|
47
|
+
o.get(t)?.endBatch();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
for (const e of o.values()) e.endBatch();
|
|
51
|
+
}
|
|
52
|
+
function P(t) {
|
|
53
|
+
return (e) => {
|
|
54
|
+
const n = t(e);
|
|
55
|
+
if (n == null || n === !1) return null;
|
|
56
|
+
if (n instanceof HTMLElement) return n;
|
|
57
|
+
const r = document.createElement("div");
|
|
58
|
+
return r.style.display = "contents", v(r, n), r;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
v as a,
|
|
63
|
+
M as b,
|
|
64
|
+
P as c,
|
|
65
|
+
y as e,
|
|
66
|
+
w as r,
|
|
67
|
+
B as s
|
|
68
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as i, r as f } from "./portal-bridge-CvxNt40O.js";
|
|
2
2
|
const y = [];
|
|
3
3
|
function H(e) {
|
|
4
4
|
y.push(e);
|
|
@@ -13,15 +13,15 @@ function R(e, n) {
|
|
|
13
13
|
for (const t of r) t();
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
const l = /* @__PURE__ */ Symbol("reactProcessed"),
|
|
16
|
+
const l = /* @__PURE__ */ Symbol("reactProcessed"), s = /* @__PURE__ */ new Map();
|
|
17
17
|
function K(e) {
|
|
18
18
|
const n = e.querySelectorAll(".react-cell-editor, .react-cell-renderer");
|
|
19
19
|
for (const r of n) {
|
|
20
|
-
const t =
|
|
21
|
-
t && (t.unsub?.(), f(t.key, { sync: !0 }),
|
|
20
|
+
const t = s.get(r);
|
|
21
|
+
t && (t.unsub?.(), f(t.key, { sync: !0 }), s.delete(r));
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function u(e) {
|
|
25
25
|
const n = document.createElement("div");
|
|
26
26
|
return n.className = e, n.style.display = "contents", n;
|
|
27
27
|
}
|
|
@@ -36,36 +36,36 @@ function E(e) {
|
|
|
36
36
|
return (r) => {
|
|
37
37
|
const t = r.cellEl;
|
|
38
38
|
if (t) {
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
41
|
-
if (t.contains(
|
|
42
|
-
return
|
|
43
|
-
f(
|
|
39
|
+
const a = n.get(t);
|
|
40
|
+
if (a) {
|
|
41
|
+
if (t.contains(a.container))
|
|
42
|
+
return i(a.container, e(r), a.portalKey), a.container;
|
|
43
|
+
f(a.portalKey, { sync: !0 }), n.delete(t);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
const o =
|
|
47
|
-
return t && n.set(t, { portalKey:
|
|
46
|
+
const o = u("react-cell-renderer"), c = i(o, e(r));
|
|
47
|
+
return t && n.set(t, { portalKey: c, container: o }), s.set(o, { key: c }), o;
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function w(e) {
|
|
51
51
|
return (n) => {
|
|
52
|
-
const r =
|
|
53
|
-
return
|
|
54
|
-
const
|
|
55
|
-
|
|
52
|
+
const r = u("react-cell-editor"), o = { key: i(r, e(n)) };
|
|
53
|
+
return s.set(r, o), queueMicrotask(() => {
|
|
54
|
+
const c = r.closest("tbw-grid, [data-tbw-grid]");
|
|
55
|
+
c && (o.unsub = R(r, c));
|
|
56
56
|
}), r;
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function k(e) {
|
|
60
60
|
return (n) => {
|
|
61
|
-
const r =
|
|
62
|
-
return
|
|
61
|
+
const r = u("react-header-renderer"), t = i(r, e(n));
|
|
62
|
+
return s.set(r, { key: t }), r;
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
function h(e) {
|
|
66
66
|
return (n) => {
|
|
67
|
-
const r =
|
|
68
|
-
return
|
|
67
|
+
const r = u("react-header-label-renderer"), t = i(r, e(n));
|
|
68
|
+
return s.set(r, { key: t }), r;
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
function M(e) {
|
|
@@ -73,8 +73,8 @@ function M(e) {
|
|
|
73
73
|
const r = e(n);
|
|
74
74
|
if (r instanceof HTMLElement || typeof r == "string")
|
|
75
75
|
return r;
|
|
76
|
-
const t =
|
|
77
|
-
return
|
|
76
|
+
const t = u("react-loading-renderer"), o = i(t, r);
|
|
77
|
+
return s.set(t, { key: o }), t;
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
function b(e) {
|
|
@@ -82,8 +82,8 @@ function b(e) {
|
|
|
82
82
|
const r = e(n);
|
|
83
83
|
if (r instanceof HTMLElement || typeof r == "string")
|
|
84
84
|
return r;
|
|
85
|
-
const t =
|
|
86
|
-
return
|
|
85
|
+
const t = u("react-empty-renderer"), o = i(t, r);
|
|
86
|
+
return s.set(t, { key: o }), t;
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
function T(e) {
|
|
@@ -108,8 +108,8 @@ function T(e) {
|
|
|
108
108
|
return t[l] = !0, t;
|
|
109
109
|
}
|
|
110
110
|
const n = e.columns.map((t) => {
|
|
111
|
-
const { renderer: o, editor:
|
|
112
|
-
return o && (d.renderer = E(o)),
|
|
111
|
+
const { renderer: o, editor: c, headerRenderer: a, headerLabelRenderer: p, ...m } = t, d = { ...m };
|
|
112
|
+
return o && (d.renderer = E(o)), c && (d.editor = w(c)), a && (d.headerRenderer = k(a)), p && (d.headerLabelRenderer = h(p)), d;
|
|
113
113
|
}), r = {
|
|
114
114
|
...e,
|
|
115
115
|
columns: n
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { p as
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { a as u, r as g } from "./portal-bridge-
|
|
1
|
+
import { p as v, n as m, c as K } from "./react-column-config-BOe_PgL1.js";
|
|
2
|
+
import { jsx as w } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as T, useCallback as k, useEffect as E } from "react";
|
|
4
|
+
import { a as u, r as g, b as B, e as D } from "./portal-bridge-CvxNt40O.js";
|
|
5
5
|
const p = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new Map();
|
|
6
|
-
function
|
|
6
|
+
function M(o) {
|
|
7
7
|
const e = p.get(o);
|
|
8
8
|
if (e) return e;
|
|
9
9
|
const t = o.id;
|
|
10
10
|
if (t)
|
|
11
11
|
return h.get(t);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const { id: e, title: t, icon: r, tooltip: n, order: s = 100, children: i } = o, l =
|
|
13
|
+
function W(o) {
|
|
14
|
+
const { id: e, title: t, icon: r, tooltip: n, order: s = 100, children: i } = o, l = T(null), y = k(
|
|
15
15
|
(a) => {
|
|
16
16
|
l.current = a, a && (p.set(a, i), e && h.set(e, i));
|
|
17
17
|
},
|
|
18
18
|
[i, e]
|
|
19
19
|
);
|
|
20
|
-
return
|
|
20
|
+
return E(() => () => {
|
|
21
21
|
const a = l.current;
|
|
22
22
|
a && (p.delete(a), e && h.delete(e));
|
|
23
|
-
}, [e]), /* @__PURE__ */
|
|
23
|
+
}, [e]), /* @__PURE__ */ w(
|
|
24
24
|
"tbw-grid-tool-panel",
|
|
25
25
|
{
|
|
26
26
|
ref: y,
|
|
@@ -32,32 +32,32 @@ function x(o) {
|
|
|
32
32
|
}
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
|
-
let
|
|
36
|
-
function
|
|
37
|
-
|
|
35
|
+
let C = null, R = null, b = null;
|
|
36
|
+
function I(o) {
|
|
37
|
+
C = o;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
39
|
+
function N(o) {
|
|
40
|
+
R = o;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
42
|
+
function j(o) {
|
|
43
|
+
b = o;
|
|
44
44
|
}
|
|
45
45
|
const d = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new Map();
|
|
46
|
-
function
|
|
46
|
+
function q(o, e) {
|
|
47
47
|
const t = o.getAttribute("field"), r = d.get(o) ?? {};
|
|
48
48
|
if (r.renderer = e, d.set(o, r), t) {
|
|
49
49
|
const n = c.get(t) ?? {};
|
|
50
50
|
n.renderer = e, c.set(t, n);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function H(o, e) {
|
|
54
54
|
const t = o.getAttribute("field"), r = d.get(o) ?? {};
|
|
55
55
|
if (r.editor = e, d.set(o, r), t) {
|
|
56
56
|
const n = c.get(t) ?? {};
|
|
57
57
|
n.editor = e, c.set(t, n);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function A(o) {
|
|
61
61
|
let e = d.get(o)?.renderer;
|
|
62
62
|
if (!e) {
|
|
63
63
|
const t = o.getAttribute("field");
|
|
@@ -65,7 +65,7 @@ function B(o) {
|
|
|
65
65
|
}
|
|
66
66
|
return e;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function U(o) {
|
|
69
69
|
let e = d.get(o)?.editor;
|
|
70
70
|
if (!e) {
|
|
71
71
|
const t = o.getAttribute("field");
|
|
@@ -73,7 +73,7 @@ function M(o) {
|
|
|
73
73
|
}
|
|
74
74
|
return e;
|
|
75
75
|
}
|
|
76
|
-
class
|
|
76
|
+
class z {
|
|
77
77
|
/** Portal keys for all managed portals (for cleanup on destroy). */
|
|
78
78
|
allPortalKeys = /* @__PURE__ */ new Set();
|
|
79
79
|
/** Portal keys for editor-specific portals (for per-cell cleanup via releaseCell). */
|
|
@@ -128,7 +128,7 @@ class q {
|
|
|
128
128
|
* Converts React renderer/editor functions to DOM-returning functions.
|
|
129
129
|
*/
|
|
130
130
|
processConfig(e) {
|
|
131
|
-
return
|
|
131
|
+
return v(e) ?? e;
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
134
|
* Determines if this adapter can handle the given element.
|
|
@@ -156,10 +156,10 @@ class q {
|
|
|
156
156
|
* allowing the grid to use its default rendering.
|
|
157
157
|
*/
|
|
158
158
|
createRenderer(e) {
|
|
159
|
-
const t =
|
|
159
|
+
const t = A(e);
|
|
160
160
|
if (!t)
|
|
161
161
|
return;
|
|
162
|
-
const r = e.closest("tbw-grid"), n = /* @__PURE__ */ new WeakMap();
|
|
162
|
+
const r = e.closest("tbw-grid, [data-tbw-grid]"), n = /* @__PURE__ */ new WeakMap();
|
|
163
163
|
return (s) => {
|
|
164
164
|
const i = s.cellEl;
|
|
165
165
|
if (i) {
|
|
@@ -171,13 +171,13 @@ class q {
|
|
|
171
171
|
}
|
|
172
172
|
const f = document.createElement("div");
|
|
173
173
|
f.className = "react-cell-renderer", f.style.display = "contents";
|
|
174
|
-
const
|
|
174
|
+
const P = u(
|
|
175
175
|
f,
|
|
176
176
|
t(s),
|
|
177
177
|
void 0,
|
|
178
178
|
r ?? void 0
|
|
179
179
|
);
|
|
180
|
-
return n.set(i, { portalKey:
|
|
180
|
+
return n.set(i, { portalKey: P, container: f }), this.trackPortal(P, f, !1), f;
|
|
181
181
|
}
|
|
182
182
|
const l = document.createElement("div");
|
|
183
183
|
l.className = "react-cell-renderer", l.style.display = "contents";
|
|
@@ -195,10 +195,10 @@ class q {
|
|
|
195
195
|
* with commit/cancel callbacks passed as props.
|
|
196
196
|
*/
|
|
197
197
|
createEditor(e) {
|
|
198
|
-
const t =
|
|
198
|
+
const t = U(e);
|
|
199
199
|
if (!t)
|
|
200
200
|
return () => document.createElement("div");
|
|
201
|
-
const r = e.closest("tbw-grid") ?? void 0;
|
|
201
|
+
const r = e.closest("tbw-grid, [data-tbw-grid]") ?? void 0;
|
|
202
202
|
return (n) => {
|
|
203
203
|
const s = document.createElement("div");
|
|
204
204
|
s.className = "react-cell-editor", s.style.display = "contents";
|
|
@@ -214,31 +214,31 @@ class q {
|
|
|
214
214
|
/**
|
|
215
215
|
* Creates a detail renderer function for MasterDetailPlugin.
|
|
216
216
|
* Implementation is installed by `@toolbox-web/grid-react/features/master-detail`
|
|
217
|
-
* via
|
|
217
|
+
* via `registerDetailRendererBridge`. Returns undefined if the
|
|
218
218
|
* master-detail feature has not been imported, or if no GridDetailPanel
|
|
219
219
|
* was registered for this grid.
|
|
220
220
|
*/
|
|
221
221
|
createDetailRenderer(e) {
|
|
222
|
-
return
|
|
222
|
+
return C?.(e, this.bridgeContext);
|
|
223
223
|
}
|
|
224
224
|
/**
|
|
225
225
|
* Framework adapter hook called by MasterDetailPlugin during attach().
|
|
226
226
|
* Parses the <tbw-grid-detail> element and returns a React-based renderer.
|
|
227
227
|
*/
|
|
228
228
|
parseDetailElement(e) {
|
|
229
|
-
const t = e.closest("tbw-grid");
|
|
229
|
+
const t = e.closest("tbw-grid, [data-tbw-grid]");
|
|
230
230
|
if (t)
|
|
231
231
|
return this.createDetailRenderer(t);
|
|
232
232
|
}
|
|
233
233
|
/**
|
|
234
234
|
* Creates a responsive card renderer function for ResponsivePlugin.
|
|
235
235
|
* Implementation is installed by `@toolbox-web/grid-react/features/responsive`
|
|
236
|
-
* via
|
|
236
|
+
* via `registerResponsiveCardRendererBridge`. Returns undefined if
|
|
237
237
|
* the responsive feature has not been imported, or if no GridResponsiveCard
|
|
238
238
|
* was registered for this grid.
|
|
239
239
|
*/
|
|
240
240
|
createResponsiveCardRenderer(e) {
|
|
241
|
-
return
|
|
241
|
+
return R?.(e, this.bridgeContext);
|
|
242
242
|
}
|
|
243
243
|
/**
|
|
244
244
|
* FrameworkAdapter hook called by ResponsivePlugin during attach().
|
|
@@ -249,7 +249,7 @@ class q {
|
|
|
249
249
|
* `refreshResponsiveCardRenderer` hook in DataGrid.
|
|
250
250
|
*/
|
|
251
251
|
parseResponsiveCardElement(e) {
|
|
252
|
-
const t = e.closest("tbw-grid");
|
|
252
|
+
const t = e.closest("tbw-grid, [data-tbw-grid]");
|
|
253
253
|
if (t)
|
|
254
254
|
return this.createResponsiveCardRenderer(t);
|
|
255
255
|
}
|
|
@@ -258,10 +258,10 @@ class q {
|
|
|
258
258
|
* Renders React components into tool panel containers.
|
|
259
259
|
*/
|
|
260
260
|
createToolPanelRenderer(e) {
|
|
261
|
-
const t =
|
|
261
|
+
const t = M(e);
|
|
262
262
|
if (!t)
|
|
263
263
|
return;
|
|
264
|
-
const r = e.closest("tbw-grid");
|
|
264
|
+
const r = e.closest("tbw-grid, [data-tbw-grid]");
|
|
265
265
|
return (n) => {
|
|
266
266
|
const i = u(n, t({
|
|
267
267
|
grid: r ?? n
|
|
@@ -304,7 +304,7 @@ class q {
|
|
|
304
304
|
const n = {
|
|
305
305
|
editorParams: r.editorParams
|
|
306
306
|
};
|
|
307
|
-
return r.renderer && (n.renderer = this.createTypeRenderer(r.renderer, t)), r.editor && (n.editor = this.createTypeEditor(r.editor, t)), r.filterPanelRenderer &&
|
|
307
|
+
return r.renderer && (n.renderer = this.createTypeRenderer(r.renderer, t)), r.editor && (n.editor = this.createTypeEditor(r.editor, t)), r.filterPanelRenderer && b && (n.filterPanelRenderer = b(
|
|
308
308
|
r.filterPanelRenderer,
|
|
309
309
|
t,
|
|
310
310
|
this.bridgeContext
|
|
@@ -318,7 +318,7 @@ class q {
|
|
|
318
318
|
return (r) => {
|
|
319
319
|
const n = document.createElement("span");
|
|
320
320
|
n.style.display = "contents";
|
|
321
|
-
const s = r.cellEl?.closest("tbw-grid") ?? t, i = u(n, e(r), void 0, s);
|
|
321
|
+
const s = r.cellEl?.closest("tbw-grid, [data-tbw-grid]") ?? t, i = u(n, e(r), void 0, s);
|
|
322
322
|
return this.trackPortal(i, n, !1), n;
|
|
323
323
|
};
|
|
324
324
|
}
|
|
@@ -404,13 +404,33 @@ class q {
|
|
|
404
404
|
const t = this.containerToKey.get(e);
|
|
405
405
|
t && (g(t), this.untrackPortal(t));
|
|
406
406
|
}
|
|
407
|
+
/**
|
|
408
|
+
* Open a teardown batch on the PortalManager. Grid core wraps multi-cell
|
|
409
|
+
* release loops (`_clearRowPool`, row-pool shrink, full row rebuild) with
|
|
410
|
+
* `beginBatch` / `endBatch` so the N per-cell sync removals collapse to a
|
|
411
|
+
* single deferred render instead of N `flushSync` calls. Eliminates the
|
|
412
|
+
* "flushSync was called from inside a lifecycle method" warning storm on
|
|
413
|
+
* grouping changes (#330).
|
|
414
|
+
*/
|
|
415
|
+
beginBatch(e) {
|
|
416
|
+
B(e);
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Close a teardown batch opened by {@link beginBatch}. Caller is
|
|
420
|
+
* responsible for ensuring affected containers are detached from the
|
|
421
|
+
* DOM before this returns; the manager's render-time `isConnected`
|
|
422
|
+
* filter then prunes them silently.
|
|
423
|
+
*/
|
|
424
|
+
endBatch(e) {
|
|
425
|
+
D(e);
|
|
426
|
+
}
|
|
407
427
|
}
|
|
408
428
|
export {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
429
|
+
z as G,
|
|
430
|
+
I as a,
|
|
431
|
+
N as b,
|
|
432
|
+
q as c,
|
|
433
|
+
H as d,
|
|
434
|
+
W as e,
|
|
435
|
+
j as r
|
|
416
436
|
};
|
package/features/editing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "@toolbox-web/grid/features/editing";
|
|
2
|
-
import { r, m as s } from "../chunks/react-column-config-
|
|
2
|
+
import { r, m as s } from "../chunks/react-column-config-BOe_PgL1.js";
|
|
3
3
|
r(({ container: t, gridEl: e }) => {
|
|
4
4
|
const o = s(t);
|
|
5
5
|
return e.addEventListener("before-edit-close", o), () => e.removeEventListener("before-edit-close", o);
|
package/features/filtering.js
CHANGED
|
@@ -2,8 +2,8 @@ import { FilteringPlugin as F } from "@toolbox-web/grid/plugins/filtering";
|
|
|
2
2
|
import { useContext as h, useCallback as n } from "react";
|
|
3
3
|
import { registerFeature as E } from "@toolbox-web/grid/features/registry";
|
|
4
4
|
import { G as k } from "../chunks/grid-element-context-BU3WvNtM.js";
|
|
5
|
-
import { r as v, a as m } from "../chunks/portal-bridge-
|
|
6
|
-
import { r as C } from "../chunks/react-grid-adapter-
|
|
5
|
+
import { r as v, a as m } from "../chunks/portal-bridge-CvxNt40O.js";
|
|
6
|
+
import { r as C } from "../chunks/react-grid-adapter-BuuCl9rO.js";
|
|
7
7
|
E(
|
|
8
8
|
"filtering",
|
|
9
9
|
(l) => {
|
|
@@ -30,7 +30,7 @@ C((l, o, { trackPortal: e }) => {
|
|
|
30
30
|
return (s, a) => {
|
|
31
31
|
const g = document.createElement("div");
|
|
32
32
|
g.style.display = "contents";
|
|
33
|
-
const c = s.closest("tbw-grid") ?? o, d = m(g, f(a), void 0, c);
|
|
33
|
+
const c = s.closest("tbw-grid, [data-tbw-grid]") ?? o, d = m(g, f(a), void 0, c);
|
|
34
34
|
e(d, g, !1), s.appendChild(g);
|
|
35
35
|
};
|
|
36
36
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GroupingColumnsPlugin as t } from "@toolbox-web/grid/plugins/grouping-columns";
|
|
2
2
|
import { registerFeature as c } from "@toolbox-web/grid/features/registry";
|
|
3
|
-
import { c as p } from "../chunks/portal-bridge-
|
|
3
|
+
import { c as p } from "../chunks/portal-bridge-CvxNt40O.js";
|
|
4
4
|
function u(n) {
|
|
5
5
|
const r = p(n);
|
|
6
6
|
return (o) => r(o) ?? document.createElement("div");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GroupingRowsPlugin as o } from "@toolbox-web/grid/plugins/grouping-rows";
|
|
2
2
|
import { registerFeature as c } from "@toolbox-web/grid/features/registry";
|
|
3
|
-
import { c as p } from "../chunks/portal-bridge-
|
|
3
|
+
import { c as p } from "../chunks/portal-bridge-CvxNt40O.js";
|
|
4
4
|
c(
|
|
5
5
|
"groupingRows",
|
|
6
6
|
(e) => {
|
package/features/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,aAAa,CAAC;AACrB,OAAO,yBAAyB,CAAC;AACjC,OAAO,gBAAgB,CAAC;AACxB,OAAO,WAAW,CAAC;AACnB,OAAO,UAAU,CAAC;AAClB,OAAO,aAAa,CAAC;AACrB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,SAAS,CAAC;AACjB,OAAO,SAAS,CAAC;AACjB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AACtB,OAAO,iBAAiB,CAAC;AACzB,OAAO,aAAa,CAAC;AACrB,OAAO,eAAe,CAAC;AACvB,OAAO,WAAW,CAAC;AACnB,OAAO,QAAQ,CAAC;AAChB,OAAO,aAAa,CAAC;AACrB,OAAO,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,aAAa,CAAC;AACrB,OAAO,yBAAyB,CAAC;AACjC,OAAO,gBAAgB,CAAC;AACxB,OAAO,WAAW,CAAC;AACnB,OAAO,UAAU,CAAC;AAClB,OAAO,aAAa,CAAC;AACrB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,SAAS,CAAC;AACjB,OAAO,SAAS,CAAC;AACjB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AACtB,OAAO,iBAAiB,CAAC;AACzB,OAAO,aAAa,CAAC;AACrB,OAAO,eAAe,CAAC;AACvB,OAAO,eAAe,CAAC;AACvB,OAAO,WAAW,CAAC;AACnB,OAAO,QAAQ,CAAC;AAChB,OAAO,aAAa,CAAC;AACrB,OAAO,cAAc,CAAC"}
|
package/features/index.js
CHANGED
|
@@ -20,6 +20,7 @@ import "./responsive.js";
|
|
|
20
20
|
import "@toolbox-web/grid/features/row-drag-drop";
|
|
21
21
|
import "@toolbox-web/grid/features/selection";
|
|
22
22
|
import "@toolbox-web/grid/features/server-side";
|
|
23
|
+
import "@toolbox-web/grid/features/sticky-rows";
|
|
23
24
|
import "@toolbox-web/grid/features/tooltip";
|
|
24
25
|
import "@toolbox-web/grid/features/tree";
|
|
25
26
|
import "@toolbox-web/grid/features/undo-redo";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@toolbox-web/grid/features/master-detail";
|
|
2
|
-
import { g as c } from "../chunks/grid-detail-panel-
|
|
3
|
-
import { a as s } from "../chunks/portal-bridge-
|
|
4
|
-
import { a as d } from "../chunks/react-grid-adapter-
|
|
2
|
+
import { g as c } from "../chunks/grid-detail-panel-BZFcujsZ.js";
|
|
3
|
+
import { a as s } from "../chunks/portal-bridge-CvxNt40O.js";
|
|
4
|
+
import { a as d } from "../chunks/react-grid-adapter-BuuCl9rO.js";
|
|
5
5
|
d((r, { trackPortal: n }) => {
|
|
6
6
|
const t = c(r);
|
|
7
7
|
if (t)
|
package/features/pinned-rows.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@toolbox-web/grid/features/pinned-rows";
|
|
2
2
|
import { PinnedRowsPlugin as o } from "@toolbox-web/grid/plugins/pinned-rows";
|
|
3
3
|
import { registerFeature as m } from "@toolbox-web/grid/features/registry";
|
|
4
|
-
import { c } from "../chunks/portal-bridge-
|
|
4
|
+
import { c } from "../chunks/portal-bridge-CvxNt40O.js";
|
|
5
5
|
function u(r) {
|
|
6
6
|
return c(r);
|
|
7
7
|
}
|
package/features/responsive.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@toolbox-web/grid/features/responsive";
|
|
2
|
-
import { g as i } from "../chunks/grid-responsive-card-
|
|
3
|
-
import { a as c } from "../chunks/portal-bridge-
|
|
4
|
-
import { b as d } from "../chunks/react-grid-adapter-
|
|
2
|
+
import { g as i } from "../chunks/grid-responsive-card-CSZhDCoN.js";
|
|
3
|
+
import { a as c } from "../chunks/portal-bridge-CvxNt40O.js";
|
|
4
|
+
import { b as d } from "../chunks/react-grid-adapter-BuuCl9rO.js";
|
|
5
5
|
d((r, { trackPortal: o }) => {
|
|
6
6
|
const n = i(r);
|
|
7
7
|
if (n)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@toolbox-web/grid/features/row-drag-drop";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=sticky-rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sticky-rows.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/sticky-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,wCAAwC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@toolbox-web/grid/features/sticky-rows";
|