@toolbox-web/grid-react 1.6.1 → 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-Dz234dN8.js → react-column-config-BOe_PgL1.js} +28 -28
- package/chunks/{react-grid-adapter-KD5roD6F.js → react-grid-adapter-BuuCl9rO.js} +40 -40
- 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.js +103 -103
- package/lib/data-grid.d.ts.map +1 -1
- package/lib/feature-props.d.ts +20 -1
- package/lib/feature-props.d.ts.map +1 -1
- package/lib/use-grid-overlay.d.ts +1 -1
- package/package.json +1 -1
- package/chunks/grid-responsive-card-BB28Zl2O.js +0 -45
- package/chunks/portal-bridge-BydpO5wl.js +0 -68
|
@@ -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,7 +1,7 @@
|
|
|
1
|
-
import { p as
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { a as u, r as g, b as B, e as D } 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
6
|
function M(o) {
|
|
7
7
|
const e = p.get(o);
|
|
@@ -11,16 +11,16 @@ function M(o) {
|
|
|
11
11
|
return h.get(t);
|
|
12
12
|
}
|
|
13
13
|
function W(o) {
|
|
14
|
-
const { id: e, title: t, icon: r, tooltip: n, order: s = 100, children: i } = o, l =
|
|
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,44 +32,44 @@ function W(o) {
|
|
|
32
32
|
}
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
|
-
let
|
|
35
|
+
let C = null, R = null, b = null;
|
|
36
36
|
function I(o) {
|
|
37
|
-
|
|
37
|
+
C = o;
|
|
38
38
|
}
|
|
39
39
|
function N(o) {
|
|
40
|
-
|
|
40
|
+
R = o;
|
|
41
41
|
}
|
|
42
42
|
function j(o) {
|
|
43
|
-
|
|
43
|
+
b = o;
|
|
44
44
|
}
|
|
45
|
-
const
|
|
45
|
+
const d = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new Map();
|
|
46
46
|
function q(o, e) {
|
|
47
|
-
const t = o.getAttribute("field"), r =
|
|
48
|
-
if (r.renderer = e,
|
|
49
|
-
const n =
|
|
50
|
-
n.renderer = e,
|
|
47
|
+
const t = o.getAttribute("field"), r = d.get(o) ?? {};
|
|
48
|
+
if (r.renderer = e, d.set(o, r), t) {
|
|
49
|
+
const n = c.get(t) ?? {};
|
|
50
|
+
n.renderer = e, c.set(t, n);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
function H(o, e) {
|
|
54
|
-
const t = o.getAttribute("field"), r =
|
|
55
|
-
if (r.editor = e,
|
|
56
|
-
const n =
|
|
57
|
-
n.editor = e,
|
|
54
|
+
const t = o.getAttribute("field"), r = d.get(o) ?? {};
|
|
55
|
+
if (r.editor = e, d.set(o, r), t) {
|
|
56
|
+
const n = c.get(t) ?? {};
|
|
57
|
+
n.editor = e, c.set(t, n);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
function A(o) {
|
|
61
|
-
let e =
|
|
61
|
+
let e = d.get(o)?.renderer;
|
|
62
62
|
if (!e) {
|
|
63
63
|
const t = o.getAttribute("field");
|
|
64
|
-
t && (e =
|
|
64
|
+
t && (e = c.get(t)?.renderer);
|
|
65
65
|
}
|
|
66
66
|
return e;
|
|
67
67
|
}
|
|
68
68
|
function U(o) {
|
|
69
|
-
let e =
|
|
69
|
+
let e = d.get(o)?.editor;
|
|
70
70
|
if (!e) {
|
|
71
71
|
const t = o.getAttribute("field");
|
|
72
|
-
t && (e =
|
|
72
|
+
t && (e = c.get(t)?.editor);
|
|
73
73
|
}
|
|
74
74
|
return e;
|
|
75
75
|
}
|
|
@@ -128,7 +128,7 @@ class z {
|
|
|
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.
|
|
@@ -136,10 +136,10 @@ class z {
|
|
|
136
136
|
*/
|
|
137
137
|
canHandle(e) {
|
|
138
138
|
const t = e.getAttribute("field");
|
|
139
|
-
let r =
|
|
139
|
+
let r = d.get(e);
|
|
140
140
|
if (!r && t) {
|
|
141
|
-
const i =
|
|
142
|
-
i && (i.renderer || i.editor) && (r = i,
|
|
141
|
+
const i = c.get(t);
|
|
142
|
+
i && (i.renderer || i.editor) && (r = i, d.set(e, r));
|
|
143
143
|
}
|
|
144
144
|
const n = r?.renderer !== void 0, s = r?.editor !== void 0;
|
|
145
145
|
return r !== void 0 && (n || s);
|
|
@@ -159,7 +159,7 @@ class z {
|
|
|
159
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 z {
|
|
|
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";
|
|
@@ -198,7 +198,7 @@ class z {
|
|
|
198
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";
|
|
@@ -219,14 +219,14 @@ class z {
|
|
|
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
|
}
|
|
@@ -238,7 +238,7 @@ class z {
|
|
|
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 z {
|
|
|
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
|
}
|
|
@@ -261,7 +261,7 @@ class z {
|
|
|
261
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 z {
|
|
|
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 z {
|
|
|
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
|
}
|
|
@@ -365,7 +365,7 @@ class z {
|
|
|
365
365
|
g(e);
|
|
366
366
|
this.allPortalKeys.clear(), this.editorPortalKeys.clear(), this.keyToContainer.clear();
|
|
367
367
|
for (const e of this.editorBeforeCloseUnsubs.values()) e();
|
|
368
|
-
this.editorBeforeCloseUnsubs.clear(),
|
|
368
|
+
this.editorBeforeCloseUnsubs.clear(), c.clear();
|
|
369
369
|
}
|
|
370
370
|
/**
|
|
371
371
|
* Called when a cell's content is about to be wiped.
|
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";
|
package/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { jsx as S, Fragment as V, jsxs as
|
|
2
|
-
import { DataGridElement as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { g as
|
|
5
|
-
import { G as
|
|
6
|
-
import { s as ee } from "./chunks/portal-bridge-
|
|
7
|
-
import { flushSync as re, createPortal as
|
|
8
|
-
import { p as
|
|
9
|
-
import { G as
|
|
10
|
-
import { e as
|
|
11
|
-
import { createPluginsFromFeatures as
|
|
12
|
-
import { G as
|
|
13
|
-
import { G as
|
|
14
|
-
function
|
|
1
|
+
import { jsx as S, Fragment as V, jsxs as de } from "react/jsx-runtime";
|
|
2
|
+
import { DataGridElement as ie } from "@toolbox-web/grid";
|
|
3
|
+
import { createContext as se, useContext as A, forwardRef as ce, useRef as h, useReducer as ge, useImperativeHandle as ue, useLayoutEffect as ae, Component as pe, useMemo as E, useEffect as P, createElement as me, Children as Ce, isValidElement as ye, useCallback as x, useState as X } from "react";
|
|
4
|
+
import { g as he } from "./chunks/grid-responsive-card-CSZhDCoN.js";
|
|
5
|
+
import { G as lr } from "./chunks/grid-responsive-card-CSZhDCoN.js";
|
|
6
|
+
import { s as ee } from "./chunks/portal-bridge-CvxNt40O.js";
|
|
7
|
+
import { flushSync as re, createPortal as ve } from "react-dom";
|
|
8
|
+
import { p as Re } from "./chunks/react-column-config-BOe_PgL1.js";
|
|
9
|
+
import { G as we, c as be, d as Pe } from "./chunks/react-grid-adapter-BuuCl9rO.js";
|
|
10
|
+
import { e as dr } from "./chunks/react-grid-adapter-BuuCl9rO.js";
|
|
11
|
+
import { createPluginsFromFeatures as Se } from "@toolbox-web/grid/features/registry";
|
|
12
|
+
import { G as le } from "./chunks/grid-element-context-BU3WvNtM.js";
|
|
13
|
+
import { G as pr } from "./chunks/grid-detail-panel-BZFcujsZ.js";
|
|
14
|
+
function Ge(r) {
|
|
15
15
|
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
16
16
|
}
|
|
17
17
|
function te(r) {
|
|
18
|
-
return r.toLowerCase() === "id" ? "ID" : r.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").split(" ").filter(Boolean).map(
|
|
18
|
+
return r.toLowerCase() === "id" ? "ID" : r.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").split(" ").filter(Boolean).map(Ge).join(" ");
|
|
19
19
|
}
|
|
20
|
-
const
|
|
21
|
-
function
|
|
20
|
+
const xe = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime", "currency"]);
|
|
21
|
+
function Ee(r) {
|
|
22
22
|
const t = r.lastIndexOf(":");
|
|
23
23
|
if (t > 0) {
|
|
24
24
|
const s = r.slice(t + 1).toLowerCase();
|
|
25
|
-
if (
|
|
25
|
+
if (xe.has(s)) {
|
|
26
26
|
const i = r.slice(0, t);
|
|
27
27
|
return {
|
|
28
28
|
field: i,
|
|
@@ -37,12 +37,12 @@ function xe(r) {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
function De(r) {
|
|
40
|
-
return r.map((t) => typeof t == "string" ?
|
|
40
|
+
return r.map((t) => typeof t == "string" ? Ee(t) : t);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function Fe(r, t) {
|
|
43
43
|
return t ? r.map((s) => ({ ...t, ...s })) : r;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Qe(r) {
|
|
46
46
|
return r.some((t) => typeof t == "string");
|
|
47
47
|
}
|
|
48
48
|
const $ = {
|
|
@@ -87,15 +87,15 @@ const $ = {
|
|
|
87
87
|
onPrintStart: "print-start",
|
|
88
88
|
onPrintComplete: "print-complete",
|
|
89
89
|
onTbwScroll: "tbw-scroll"
|
|
90
|
-
}, H =
|
|
91
|
-
function
|
|
90
|
+
}, H = se(null), Ae = ({ icons: r, children: t }) => /* @__PURE__ */ S(H.Provider, { value: r, children: t });
|
|
91
|
+
function Xe() {
|
|
92
92
|
return A(H);
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
function
|
|
94
|
+
const Le = H, N = se(null), Te = ({ defaults: r, children: t }) => /* @__PURE__ */ S(N.Provider, { value: r, children: t });
|
|
95
|
+
function er() {
|
|
96
96
|
return A(N);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function rr(r) {
|
|
99
99
|
return A(N)?.[r];
|
|
100
100
|
}
|
|
101
101
|
const ke = N;
|
|
@@ -111,7 +111,7 @@ class Ie extends pe {
|
|
|
111
111
|
return this.state.failed ? null : this.props.children;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
const
|
|
114
|
+
const Me = ce(function(t, s) {
|
|
115
115
|
const i = h(/* @__PURE__ */ new Map()), [, f] = ge((p) => p + 1, 0), m = h(!1), d = h(0), a = h(0), v = h(!1), y = h(!1), R = () => {
|
|
116
116
|
m.current || (m.current = !0, queueMicrotask(() => {
|
|
117
117
|
m.current = !1, !y.current && (re(f), w());
|
|
@@ -123,7 +123,7 @@ const Te = se(function(t, s) {
|
|
|
123
123
|
}, b = (p, n) => {
|
|
124
124
|
console.error(`[grid-react] Portal "${p}" crashed; dropping.`, n), i.current.delete(p), w();
|
|
125
125
|
};
|
|
126
|
-
|
|
126
|
+
ue(
|
|
127
127
|
s,
|
|
128
128
|
() => ({
|
|
129
129
|
renderPortal(p, n, g) {
|
|
@@ -153,22 +153,22 @@ const Te = se(function(t, s) {
|
|
|
153
153
|
// forceRender is stable (useReducer dispatch), refs are stable
|
|
154
154
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
155
155
|
[]
|
|
156
|
-
),
|
|
156
|
+
), ae(() => {
|
|
157
157
|
y.current = !1;
|
|
158
158
|
const p = i.current;
|
|
159
159
|
return () => {
|
|
160
160
|
y.current = !0, d.current && (cancelAnimationFrame(d.current), d.current = 0), p.clear();
|
|
161
161
|
};
|
|
162
162
|
}, []);
|
|
163
|
-
const
|
|
163
|
+
const D = [];
|
|
164
164
|
let G = null;
|
|
165
165
|
for (const [p, { container: n, element: g }] of i.current) {
|
|
166
166
|
if (!n.isConnected) {
|
|
167
167
|
(G ??= []).push(p);
|
|
168
168
|
continue;
|
|
169
169
|
}
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
D.push(
|
|
171
|
+
ve(
|
|
172
172
|
/* @__PURE__ */ S(Ie, { portalKey: p, onError: b, children: g }),
|
|
173
173
|
n,
|
|
174
174
|
p
|
|
@@ -181,15 +181,15 @@ const Te = se(function(t, s) {
|
|
|
181
181
|
for (const n of p) i.current.delete(n);
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
|
-
return /* @__PURE__ */ S(V, { children:
|
|
185
|
-
}),
|
|
184
|
+
return /* @__PURE__ */ S(V, { children: D });
|
|
185
|
+
}), Ne = {
|
|
186
186
|
undoRedo: ["editing"],
|
|
187
187
|
clipboard: ["selection"]
|
|
188
188
|
};
|
|
189
|
-
function
|
|
189
|
+
function Oe(r) {
|
|
190
190
|
const t = new Set(r);
|
|
191
191
|
for (const s of r) {
|
|
192
|
-
const i =
|
|
192
|
+
const i = Ne[s];
|
|
193
193
|
if (i)
|
|
194
194
|
for (const f of i)
|
|
195
195
|
t.has(f) || console.warn(
|
|
@@ -197,11 +197,11 @@ function Ne(r) {
|
|
|
197
197
|
);
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function je(r) {
|
|
201
201
|
const t = [];
|
|
202
202
|
for (const [s, i] of Object.entries(r))
|
|
203
203
|
i === void 0 || i === !1 || t.push(s);
|
|
204
|
-
return
|
|
204
|
+
return Oe(t), Se(r);
|
|
205
205
|
}
|
|
206
206
|
let ne = !1, _ = null;
|
|
207
207
|
const oe = [
|
|
@@ -231,26 +231,26 @@ const oe = [
|
|
|
231
231
|
"tooltip"
|
|
232
232
|
];
|
|
233
233
|
function q() {
|
|
234
|
-
return ne || (_ = new
|
|
234
|
+
return ne || (_ = new we(), ie.registerAdapter(_), ne = !0), _;
|
|
235
235
|
}
|
|
236
236
|
q();
|
|
237
|
-
function
|
|
237
|
+
function ze(r) {
|
|
238
238
|
const s = r.getPluginByName?.("masterDetail");
|
|
239
239
|
s && typeof s.refreshDetailRenderer == "function" && s.refreshDetailRenderer();
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Be(r, t) {
|
|
242
242
|
const s = r;
|
|
243
|
-
if (!r.querySelector("tbw-grid-responsive-card") || !
|
|
243
|
+
if (!r.querySelector("tbw-grid-responsive-card") || !he(r)) return;
|
|
244
244
|
const m = s.getPluginByName?.("responsive");
|
|
245
245
|
if (m && typeof m.setCardRenderer == "function") {
|
|
246
246
|
const d = t.createResponsiveCardRenderer(r);
|
|
247
247
|
d && m.setCardRenderer(d);
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function $e(r) {
|
|
251
251
|
const t = {};
|
|
252
|
-
return
|
|
253
|
-
if (
|
|
252
|
+
return Ce.forEach(r, (s) => {
|
|
253
|
+
if (ye(s)) {
|
|
254
254
|
if (s.type && s.type.displayName === "GridDetailPanel") {
|
|
255
255
|
const i = s.props;
|
|
256
256
|
t.masterDetail = {
|
|
@@ -264,7 +264,7 @@ function Be(r) {
|
|
|
264
264
|
}
|
|
265
265
|
}), t;
|
|
266
266
|
}
|
|
267
|
-
const
|
|
267
|
+
const tr = ce(function(t, s) {
|
|
268
268
|
const {
|
|
269
269
|
// Core props
|
|
270
270
|
rows: i,
|
|
@@ -277,7 +277,7 @@ const rr = se(function(t, s) {
|
|
|
277
277
|
selectable: R,
|
|
278
278
|
loading: w,
|
|
279
279
|
customStyles: b,
|
|
280
|
-
className:
|
|
280
|
+
className: D,
|
|
281
281
|
style: G,
|
|
282
282
|
children: p,
|
|
283
283
|
// Plugin props
|
|
@@ -288,33 +288,33 @@ const rr = se(function(t, s) {
|
|
|
288
288
|
onRowsChange: C,
|
|
289
289
|
// Feature props and event props are in ...rest
|
|
290
290
|
...l
|
|
291
|
-
} = t, c = h(null), M = h(null), K = h(!1), U = A(ke), O = A(
|
|
291
|
+
} = t, c = h(null), M = h(null), K = h(!1), U = A(ke), O = A(Le), fe = E(() => oe.map((e) => {
|
|
292
292
|
const o = l[e];
|
|
293
293
|
return o !== void 0 ? `${e}:${JSON.stringify(o)}` : "";
|
|
294
|
-
}).filter(Boolean).join("|"), [l]), Y =
|
|
294
|
+
}).filter(Boolean).join("|"), [l]), Y = E(() => {
|
|
295
295
|
const e = {};
|
|
296
296
|
for (const o of oe)
|
|
297
297
|
o in l && l[o] !== void 0 && (e[o] = l[o]);
|
|
298
298
|
return e;
|
|
299
|
-
}, [
|
|
299
|
+
}, [fe]), J = E(() => $e(p), [p]), W = E(() => {
|
|
300
300
|
const e = f?.features, o = {};
|
|
301
301
|
for (const [u, F] of Object.entries(J))
|
|
302
302
|
e && u in e && e[u] !== void 0 && e[u] !== !1 || (o[u] = F);
|
|
303
303
|
return { ...o, ...Y };
|
|
304
|
-
}, [Y, J, f]), j =
|
|
304
|
+
}, [Y, J, f]), j = E(() => n || g ? [] : je(W), [W, n, g]), L = E(() => {
|
|
305
305
|
if (n) {
|
|
306
306
|
const e = new Set(n.map((u) => u.name)), o = j.filter((u) => !e.has(u.name));
|
|
307
307
|
return [...n, ...o];
|
|
308
308
|
}
|
|
309
309
|
return j;
|
|
310
|
-
}, [n, j]),
|
|
311
|
-
const e =
|
|
310
|
+
}, [n, j]), T = E(() => m && Fe(De(m), d), [m, d]), k = E(() => {
|
|
311
|
+
const e = Re(f), o = {};
|
|
312
312
|
if (v !== void 0 && (o.sortable = v), y !== void 0 && (o.filterable = y), R !== void 0 && (o.selectable = R), O) {
|
|
313
313
|
const u = e?.icons || f?.icons || {};
|
|
314
314
|
o.icons = { ...O, ...u };
|
|
315
315
|
}
|
|
316
316
|
if (L.length > 0 && e) {
|
|
317
|
-
const u = e.plugins || [], F = new Set(u.map((
|
|
317
|
+
const u = e.plugins || [], F = new Set(u.map((I) => I.name)), B = L.filter((I) => !F.has(I.name));
|
|
318
318
|
return {
|
|
319
319
|
...e,
|
|
320
320
|
...o,
|
|
@@ -328,10 +328,10 @@ const rr = se(function(t, s) {
|
|
|
328
328
|
}, [U]), P(() => {
|
|
329
329
|
c.current && (c.current.rows = i);
|
|
330
330
|
}, [i]), P(() => {
|
|
331
|
-
c.current &&
|
|
332
|
-
}, [I]), P(() => {
|
|
333
|
-
c.current && k && (c.current.columns = k);
|
|
331
|
+
c.current && k && (c.current.gridConfig = k);
|
|
334
332
|
}, [k]), P(() => {
|
|
333
|
+
c.current && T && (c.current.columns = T);
|
|
334
|
+
}, [T]), P(() => {
|
|
335
335
|
c.current && a !== void 0 && (c.current.fitMode = a);
|
|
336
336
|
}, [a]), P(() => {
|
|
337
337
|
c.current && w !== void 0 && (c.current.loading = w);
|
|
@@ -339,7 +339,7 @@ const rr = se(function(t, s) {
|
|
|
339
339
|
const e = c.current;
|
|
340
340
|
if (!e) return;
|
|
341
341
|
const o = q();
|
|
342
|
-
e.__frameworkAdapter = o,
|
|
342
|
+
e.__frameworkAdapter = o, ze(e), Be(e, o);
|
|
343
343
|
let u = !1;
|
|
344
344
|
const F = requestAnimationFrame(() => {
|
|
345
345
|
u || (typeof e.refreshColumns == "function" && e.refreshColumns(), typeof e.refreshShellHeader == "function" && e.refreshShellHeader());
|
|
@@ -364,7 +364,7 @@ const rr = se(function(t, s) {
|
|
|
364
364
|
o.forEach((u) => u());
|
|
365
365
|
};
|
|
366
366
|
}, [C]);
|
|
367
|
-
const Z =
|
|
367
|
+
const Z = E(() => Object.keys($).filter((e) => typeof l[e] == "function").sort().join("|"), [l]), Q = h({});
|
|
368
368
|
for (const e of Object.keys($))
|
|
369
369
|
Q.current[e] = l[e];
|
|
370
370
|
P(() => {
|
|
@@ -373,14 +373,14 @@ const rr = se(function(t, s) {
|
|
|
373
373
|
const o = [];
|
|
374
374
|
for (const [u, F] of Object.entries($))
|
|
375
375
|
Z.includes(u) && o.push(
|
|
376
|
-
e.on(F, (B,
|
|
377
|
-
Q.current[u]?.(B,
|
|
376
|
+
e.on(F, (B, I) => {
|
|
377
|
+
Q.current[u]?.(B, I);
|
|
378
378
|
})
|
|
379
379
|
);
|
|
380
380
|
return () => {
|
|
381
381
|
o.forEach((u) => u());
|
|
382
382
|
};
|
|
383
|
-
}, [Z]),
|
|
383
|
+
}, [Z]), ue(
|
|
384
384
|
s,
|
|
385
385
|
() => ({
|
|
386
386
|
get element() {
|
|
@@ -423,31 +423,31 @@ const rr = se(function(t, s) {
|
|
|
423
423
|
[]
|
|
424
424
|
);
|
|
425
425
|
const z = h(null);
|
|
426
|
-
return
|
|
426
|
+
return ae(() => {
|
|
427
427
|
const e = c.current;
|
|
428
428
|
return e && z.current && ee(e, z.current), () => {
|
|
429
429
|
e && ee(e, null);
|
|
430
430
|
};
|
|
431
|
-
}, []), /* @__PURE__ */
|
|
432
|
-
/* @__PURE__ */ S(
|
|
433
|
-
|
|
434
|
-
|
|
431
|
+
}, []), /* @__PURE__ */ de(V, { children: [
|
|
432
|
+
/* @__PURE__ */ S(Me, { ref: z }),
|
|
433
|
+
me(
|
|
434
|
+
ie.activeTag,
|
|
435
435
|
{
|
|
436
436
|
ref: (e) => {
|
|
437
437
|
if (c.current = e, e && !K.current) {
|
|
438
438
|
K.current = !0;
|
|
439
439
|
const o = e;
|
|
440
|
-
|
|
440
|
+
k && (o.gridConfig = k), i && (o.rows = i), T && (o.columns = T);
|
|
441
441
|
}
|
|
442
442
|
},
|
|
443
|
-
class:
|
|
444
|
-
style: G
|
|
445
|
-
|
|
446
|
-
}
|
|
443
|
+
class: D,
|
|
444
|
+
style: G
|
|
445
|
+
},
|
|
446
|
+
/* @__PURE__ */ S(le.Provider, { value: c, children: p })
|
|
447
447
|
)
|
|
448
448
|
] });
|
|
449
449
|
});
|
|
450
|
-
function
|
|
450
|
+
function nr(r) {
|
|
451
451
|
const {
|
|
452
452
|
field: t,
|
|
453
453
|
header: s,
|
|
@@ -461,28 +461,28 @@ function tr(r) {
|
|
|
461
461
|
lockVisible: R,
|
|
462
462
|
children: w,
|
|
463
463
|
editor: b,
|
|
464
|
-
options:
|
|
464
|
+
options: D,
|
|
465
465
|
multi: G,
|
|
466
466
|
format: p
|
|
467
467
|
} = r, n = h(null), g = x(
|
|
468
468
|
(c) => {
|
|
469
|
-
n.current = c, c && (w &&
|
|
469
|
+
n.current = c, c && (w && be(c, w), b && Pe(c, b));
|
|
470
470
|
},
|
|
471
471
|
[w, b]
|
|
472
472
|
), C = typeof a == "number" ? `${a}px` : a, l = {
|
|
473
473
|
field: t,
|
|
474
474
|
ref: g
|
|
475
475
|
};
|
|
476
|
-
return s !== void 0 && (l.header = s), i !== void 0 && (l.type = i), f !== void 0 && (l.editable = f), m !== void 0 && (l.sortable = m), d !== void 0 && (l.resizable = d), C !== void 0 && (l.width = C), v !== void 0 && (l["min-width"] = v), y !== void 0 && (l.hidden = y), R !== void 0 && (l["lock-visible"] = R), G !== void 0 && (l.multi = G), p && (l["data-has-format"] = "true"),
|
|
476
|
+
return s !== void 0 && (l.header = s), i !== void 0 && (l.type = i), f !== void 0 && (l.editable = f), m !== void 0 && (l.sortable = m), d !== void 0 && (l.resizable = d), C !== void 0 && (l.width = C), v !== void 0 && (l["min-width"] = v), y !== void 0 && (l.hidden = y), R !== void 0 && (l["lock-visible"] = R), G !== void 0 && (l.multi = G), p && (l["data-has-format"] = "true"), D && (l["data-has-options"] = "true"), /* @__PURE__ */ S("tbw-grid-column", { ...l });
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function or({ children: r }) {
|
|
479
479
|
return /* @__PURE__ */ S("tbw-grid-tool-buttons", { children: r });
|
|
480
480
|
}
|
|
481
|
-
const
|
|
481
|
+
const ir = ({ icons: r, defaults: t, children: s }) => {
|
|
482
482
|
let i = s;
|
|
483
|
-
return t && (i = /* @__PURE__ */ S(
|
|
483
|
+
return t && (i = /* @__PURE__ */ S(Te, { defaults: t, children: i })), r && (i = /* @__PURE__ */ S(Ae, { icons: r, children: i })), /* @__PURE__ */ S(V, { children: i });
|
|
484
484
|
};
|
|
485
|
-
function
|
|
485
|
+
function sr(r) {
|
|
486
486
|
const t = h(null), [s, i] = X(!1), [f, m] = X(null), d = h(null), a = x(() => r ? (d.current ??= document.querySelector(r), d.current) : t.current?.element ?? null, [r]);
|
|
487
487
|
P(() => {
|
|
488
488
|
let n = !0;
|
|
@@ -542,7 +542,7 @@ function ir(r) {
|
|
|
542
542
|
), b = x(
|
|
543
543
|
((n) => a()?.getPluginByName?.(n)),
|
|
544
544
|
[a]
|
|
545
|
-
),
|
|
545
|
+
), D = x(
|
|
546
546
|
(n, g) => {
|
|
547
547
|
const C = a();
|
|
548
548
|
if (C) {
|
|
@@ -573,18 +573,18 @@ function ir(r) {
|
|
|
573
573
|
toggleGroup: R,
|
|
574
574
|
getPlugin: w,
|
|
575
575
|
getPluginByName: b,
|
|
576
|
-
registerStyles:
|
|
576
|
+
registerStyles: D,
|
|
577
577
|
unregisterStyles: G,
|
|
578
578
|
getVisibleColumns: p
|
|
579
579
|
};
|
|
580
580
|
}
|
|
581
|
-
function
|
|
582
|
-
const { open: s = !0, gridElement: i } = t, f = A(
|
|
581
|
+
function cr(r, t = {}) {
|
|
582
|
+
const { open: s = !0, gridElement: i } = t, f = A(le);
|
|
583
583
|
P(() => {
|
|
584
584
|
if (!s) return;
|
|
585
585
|
const m = r.current;
|
|
586
586
|
if (!m) return;
|
|
587
|
-
const d = i ?? m.closest("tbw-grid") ?? f?.current ?? null;
|
|
587
|
+
const d = i ?? m.closest("tbw-grid, [data-tbw-grid]") ?? f?.current ?? null;
|
|
588
588
|
if (d)
|
|
589
589
|
return d.registerExternalFocusContainer?.(m), () => {
|
|
590
590
|
d.unregisterExternalFocusContainer?.(m);
|
|
@@ -592,23 +592,23 @@ function sr(r, t = {}) {
|
|
|
592
592
|
}, [s, i, f, r]);
|
|
593
593
|
}
|
|
594
594
|
export {
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
595
|
+
tr as DataGrid,
|
|
596
|
+
we as GridAdapter,
|
|
597
|
+
nr as GridColumn,
|
|
598
|
+
pr as GridDetailPanel,
|
|
599
|
+
Ae as GridIconProvider,
|
|
600
|
+
ir as GridProvider,
|
|
601
|
+
lr as GridResponsiveCard,
|
|
602
|
+
or as GridToolButtons,
|
|
603
|
+
dr as GridToolPanel,
|
|
604
|
+
Te as GridTypeProvider,
|
|
605
|
+
Fe as applyColumnDefaults,
|
|
606
|
+
Qe as hasColumnShorthands,
|
|
607
607
|
De as normalizeColumns,
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
608
|
+
Ee as parseColumnShorthand,
|
|
609
|
+
sr as useGrid,
|
|
610
|
+
Xe as useGridIcons,
|
|
611
|
+
cr as useGridOverlay,
|
|
612
|
+
er as useGridTypeDefaults,
|
|
613
|
+
rr as useTypeDefault
|
|
614
614
|
};
|
package/lib/data-grid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/data-grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,
|
|
1
|
+
{"version":3,"file":"data-grid.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/data-grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EAWL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,aAAa,CAAC;AACrB,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,KAAK,eAAe,EAAqB,MAAM,iBAAiB,CAAC;AAO1E,OAAO,EAAqB,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAoE9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAqF9B;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAa,CAAC,IAAI,GAAG,OAAO,CAAE,SAAQ,eAAe,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC;IAC5F,0BAA0B;IAC1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feature-props.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClipboardConfig, ColumnVirtualizationConfig, ContextMenuConfig, ExportConfig, FilterConfig, GroupingColumnsConfig, GroupingRowsConfig, MasterDetailConfig, MultiSortConfig, PinnedRowsConfig, PivotConfig, PrintConfig, ReorderConfig, ResponsivePluginConfig, RowDragDropConfig, RowReorderConfig, SelectionConfig, ServerSideConfig, TooltipConfig, TreeConfig, UndoRedoConfig, VisibilityConfig } from '@toolbox-web/grid/all';
|
|
1
|
+
import { ClipboardConfig, ColumnVirtualizationConfig, ContextMenuConfig, ExportConfig, FilterConfig, GroupingColumnsConfig, GroupingRowsConfig, MasterDetailConfig, MultiSortConfig, PinnedRowsConfig, PivotConfig, PrintConfig, ReorderConfig, ResponsivePluginConfig, RowDragDropConfig, RowReorderConfig, SelectionConfig, ServerSideConfig, StickyRowsConfig, TooltipConfig, TreeConfig, UndoRedoConfig, VisibilityConfig } from '@toolbox-web/grid/all';
|
|
2
2
|
import { EditingConfig } from '@toolbox-web/grid/plugins/editing';
|
|
3
3
|
import { FilterPanelParams } from '@toolbox-web/grid/plugins/filtering';
|
|
4
4
|
import { ColumnGroupDefinition } from '@toolbox-web/grid/plugins/grouping-columns';
|
|
@@ -251,6 +251,25 @@ export interface FeatureProps<TRow = unknown> {
|
|
|
251
251
|
* ```
|
|
252
252
|
*/
|
|
253
253
|
pinnedRows?: boolean | PinnedRowsConfig;
|
|
254
|
+
/**
|
|
255
|
+
* Pin selected data rows below the header as the user scrolls past them.
|
|
256
|
+
*
|
|
257
|
+
* @requires `import '@toolbox-web/grid-react/features/sticky-rows';`
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```tsx
|
|
261
|
+
* // Field-name shorthand
|
|
262
|
+
* <DataGrid stickyRows={{ isSticky: 'isSection' }} />
|
|
263
|
+
*
|
|
264
|
+
* // Predicate + stack mode
|
|
265
|
+
* <DataGrid stickyRows={{
|
|
266
|
+
* isSticky: (row) => row.kind === 'section',
|
|
267
|
+
* mode: 'stack',
|
|
268
|
+
* maxStacked: 3,
|
|
269
|
+
* }} />
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
stickyRows?: StickyRowsConfig;
|
|
254
273
|
/**
|
|
255
274
|
* Enable hierarchical tree view.
|
|
256
275
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-props.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/feature-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAC1B,iBAAiB,EACjB,YAAY,EAEZ,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,aAAa,EACb,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,cAAc,EACd,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,CAAC,IAAI,GAAG,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,qBAAqB,CAAC,GAAG;IAChG,mBAAmB,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,iBAAiB,KAAK,SAAS,CAAC,CAAC;CAC9G,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,0B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CAAC;IAM9C;;;;;;;;;OASG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IAEzC;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAC;IAExC;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,0BAA0B,CAAC;IAEvD;;;;;;;;;OASG;IACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,0BAA0B,CAAC;IAM5D;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAC;IAEzC;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAEhD;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAElC;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"feature-props.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/feature-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAC1B,iBAAiB,EACjB,YAAY,EAEZ,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,aAAa,EACb,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,cAAc,EACd,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,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AE,OAAO,GAAG,UAAU,CAAC;IAE5B;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAMlC;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,sBAAsB,CAAC;IAM9C;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC;IAMpC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IAEhC;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAM9B;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IAEpB;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAM9B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,IAAI,GAAG,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC"}
|
|
@@ -19,7 +19,7 @@ export interface UseGridOverlayOptions {
|
|
|
19
19
|
* Optional explicit grid element. When omitted, the hook resolves the
|
|
20
20
|
* grid by:
|
|
21
21
|
*
|
|
22
|
-
* 1. Walking up the DOM from `panelRef.current` via `closest('tbw-grid')`
|
|
22
|
+
* 1. Walking up the DOM from `panelRef.current` via `closest('tbw-grid, [data-tbw-grid]')`
|
|
23
23
|
* (works for inline overlays).
|
|
24
24
|
* 2. Falling back to the `GridElementContext` populated by
|
|
25
25
|
* `<DataGrid>` / `<GridProvider>` (works for portal-rendered overlays
|
package/package.json
CHANGED
|
@@ -1,45 +0,0 @@
|
|
|
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 w(i) {
|
|
5
|
-
const r = i.querySelector("tbw-grid-responsive-card");
|
|
6
|
-
if (r) {
|
|
7
|
-
const d = o.get(r);
|
|
8
|
-
if (d) return d;
|
|
9
|
-
}
|
|
10
|
-
const s = i.id || i.getAttribute("data-grid-id");
|
|
11
|
-
if (s)
|
|
12
|
-
return a.get(s);
|
|
13
|
-
}
|
|
14
|
-
function R(i) {
|
|
15
|
-
const { children: r, cardRowHeight: s = "auto" } = i, d = f(null), c = l(
|
|
16
|
-
(e) => {
|
|
17
|
-
if (d.current = e, !e) return;
|
|
18
|
-
o.set(e, r);
|
|
19
|
-
const t = e.closest("tbw-grid");
|
|
20
|
-
if (t) {
|
|
21
|
-
const n = t.id || t.getAttribute("data-grid-id");
|
|
22
|
-
n && a.set(n, r);
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
[r]
|
|
26
|
-
);
|
|
27
|
-
p(() => () => {
|
|
28
|
-
const e = d.current;
|
|
29
|
-
if (e) {
|
|
30
|
-
o.delete(e);
|
|
31
|
-
const t = e.closest("tbw-grid");
|
|
32
|
-
if (t) {
|
|
33
|
-
const n = t.id || t.getAttribute("data-grid-id");
|
|
34
|
-
n && a.delete(n);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}, []);
|
|
38
|
-
const g = s === "auto" ? "auto" : String(s);
|
|
39
|
-
return /* @__PURE__ */ u("tbw-grid-responsive-card", { ref: c, cardRowHeight: g });
|
|
40
|
-
}
|
|
41
|
-
R.displayName = "GridResponsiveCard";
|
|
42
|
-
export {
|
|
43
|
-
R as G,
|
|
44
|
-
w as g
|
|
45
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
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(e, t) {
|
|
6
|
-
t ? o.set(e, t) : o.delete(e);
|
|
7
|
-
}
|
|
8
|
-
function g(e, t) {
|
|
9
|
-
if (t) return t;
|
|
10
|
-
const n = e.closest("tbw-grid");
|
|
11
|
-
if (n) return n;
|
|
12
|
-
if (o.size === 1) return o.keys().next().value;
|
|
13
|
-
}
|
|
14
|
-
function u(e) {
|
|
15
|
-
const t = i.get(e);
|
|
16
|
-
if (t) {
|
|
17
|
-
try {
|
|
18
|
-
t.unmount();
|
|
19
|
-
} catch {
|
|
20
|
-
}
|
|
21
|
-
i.delete(e);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function v(e, t, n, r) {
|
|
25
|
-
const s = n ?? `p-${m++}`, a = g(e, r), l = a ? o.get(a) : void 0;
|
|
26
|
-
if (l)
|
|
27
|
-
u(s), a && f.set(s, a), l.renderPortal(s, e, t);
|
|
28
|
-
else {
|
|
29
|
-
let c = i.get(s);
|
|
30
|
-
c || (c = p(e), i.set(s, c)), d(() => c.render(t));
|
|
31
|
-
}
|
|
32
|
-
return s;
|
|
33
|
-
}
|
|
34
|
-
function M(e, t) {
|
|
35
|
-
const n = f.get(e);
|
|
36
|
-
(n ? o.get(n) : void 0)?.removePortal(e, t?.sync), f.delete(e), u(e);
|
|
37
|
-
}
|
|
38
|
-
function w(e) {
|
|
39
|
-
if (e) {
|
|
40
|
-
o.get(e)?.beginBatch();
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
for (const t of o.values()) t.beginBatch();
|
|
44
|
-
}
|
|
45
|
-
function y(e) {
|
|
46
|
-
if (e) {
|
|
47
|
-
o.get(e)?.endBatch();
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
for (const t of o.values()) t.endBatch();
|
|
51
|
-
}
|
|
52
|
-
function P(e) {
|
|
53
|
-
return (t) => {
|
|
54
|
-
const n = e(t);
|
|
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
|
-
w as b,
|
|
64
|
-
P as c,
|
|
65
|
-
y as e,
|
|
66
|
-
M as r,
|
|
67
|
-
B as s
|
|
68
|
-
};
|