@toolbox-web/grid-react 1.5.1 → 1.6.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/{portal-bridge-DLA6Zs11.js → portal-bridge-CH_xMkYc.js} +3 -2
- package/chunks/react-column-config-B8Isgp88.js +125 -0
- package/chunks/{react-grid-adapter-CzByOnua.js → react-grid-adapter-DeV_qtlr.js} +2 -2
- package/features/editing.js +1 -1
- package/features/filtering.d.ts.map +1 -1
- package/features/filtering.js +24 -20
- package/features/grouping-columns.js +19 -15
- package/features/grouping-rows.js +15 -11
- package/features/master-detail.js +2 -2
- package/features/pinned-rows.js +19 -15
- package/features/responsive.js +2 -2
- package/index.js +118 -113
- package/lib/column-shorthand.d.ts +1 -1
- package/lib/data-grid.d.ts.map +1 -1
- package/lib/portal-bridge.d.ts.map +1 -1
- package/lib/react-column-config.d.ts +16 -2
- package/lib/react-column-config.d.ts.map +1 -1
- package/lib/react-grid-adapter.d.ts +1 -1
- package/package.json +1 -1
- package/chunks/react-column-config-Sb-U7Bq3.js +0 -109
|
@@ -2,7 +2,7 @@ import { flushSync as d } from "react-dom";
|
|
|
2
2
|
import { createRoot as p } from "react-dom/client";
|
|
3
3
|
const s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
4
4
|
let m = 0;
|
|
5
|
-
function
|
|
5
|
+
function y(e, t) {
|
|
6
6
|
t ? s.set(e, t) : s.delete(e);
|
|
7
7
|
}
|
|
8
8
|
function g(e, t) {
|
|
@@ -39,6 +39,7 @@ function x(e) {
|
|
|
39
39
|
return (t) => {
|
|
40
40
|
const n = e(t);
|
|
41
41
|
if (n == null || n === !1) return null;
|
|
42
|
+
if (n instanceof HTMLElement) return n;
|
|
42
43
|
const o = document.createElement("div");
|
|
43
44
|
return o.style.display = "contents", v(o, n), o;
|
|
44
45
|
};
|
|
@@ -47,5 +48,5 @@ export {
|
|
|
47
48
|
v as a,
|
|
48
49
|
x as c,
|
|
49
50
|
b as r,
|
|
50
|
-
|
|
51
|
+
y as s
|
|
51
52
|
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { a as u, r as f } from "./portal-bridge-CH_xMkYc.js";
|
|
2
|
+
const y = [];
|
|
3
|
+
function H(e) {
|
|
4
|
+
y.push(e);
|
|
5
|
+
}
|
|
6
|
+
function R(e, n) {
|
|
7
|
+
const r = [];
|
|
8
|
+
for (const t of y) {
|
|
9
|
+
const o = t({ container: e, gridEl: n });
|
|
10
|
+
o && r.push(o);
|
|
11
|
+
}
|
|
12
|
+
return () => {
|
|
13
|
+
for (const t of r) t();
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const l = /* @__PURE__ */ Symbol("reactProcessed"), a = /* @__PURE__ */ new Map();
|
|
17
|
+
function K(e) {
|
|
18
|
+
const n = e.querySelectorAll(".react-cell-editor, .react-cell-renderer");
|
|
19
|
+
for (const r of n) {
|
|
20
|
+
const t = a.get(r);
|
|
21
|
+
t && (t.unsub?.(), f(t.key, { sync: !0 }), a.delete(r));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function i(e) {
|
|
25
|
+
const n = document.createElement("div");
|
|
26
|
+
return n.className = e, n.style.display = "contents", n;
|
|
27
|
+
}
|
|
28
|
+
function L(e) {
|
|
29
|
+
return () => {
|
|
30
|
+
const n = e.ownerDocument.activeElement;
|
|
31
|
+
n && e.contains(n) && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement) && n.blur();
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function E(e) {
|
|
35
|
+
const n = /* @__PURE__ */ new WeakMap();
|
|
36
|
+
return (r) => {
|
|
37
|
+
const t = r.cellEl;
|
|
38
|
+
if (t) {
|
|
39
|
+
const c = n.get(t);
|
|
40
|
+
if (c) {
|
|
41
|
+
if (t.contains(c.container))
|
|
42
|
+
return u(c.container, e(r), c.portalKey), c.container;
|
|
43
|
+
f(c.portalKey, { sync: !0 }), n.delete(t);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const o = i("react-cell-renderer"), s = u(o, e(r));
|
|
47
|
+
return t && n.set(t, { portalKey: s, container: o }), a.set(o, { key: s }), o;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function k(e) {
|
|
51
|
+
return (n) => {
|
|
52
|
+
const r = i("react-cell-editor"), o = { key: u(r, e(n)) };
|
|
53
|
+
return a.set(r, o), queueMicrotask(() => {
|
|
54
|
+
const s = r.closest("tbw-grid");
|
|
55
|
+
s && (o.unsub = R(r, s));
|
|
56
|
+
}), r;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function w(e) {
|
|
60
|
+
return (n) => {
|
|
61
|
+
const r = i("react-header-renderer"), t = u(r, e(n));
|
|
62
|
+
return a.set(r, { key: t }), r;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function h(e) {
|
|
66
|
+
return (n) => {
|
|
67
|
+
const r = i("react-header-label-renderer"), t = u(r, e(n));
|
|
68
|
+
return a.set(r, { key: t }), r;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function M(e) {
|
|
72
|
+
return (n) => {
|
|
73
|
+
const r = e(n);
|
|
74
|
+
if (r instanceof HTMLElement || typeof r == "string")
|
|
75
|
+
return r;
|
|
76
|
+
const t = i("react-loading-renderer"), o = u(t, r);
|
|
77
|
+
return a.set(t, { key: o }), t;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function b(e) {
|
|
81
|
+
return (n) => {
|
|
82
|
+
const r = e(n);
|
|
83
|
+
if (r instanceof HTMLElement || typeof r == "string")
|
|
84
|
+
return r;
|
|
85
|
+
const t = i("react-empty-renderer"), o = u(t, r);
|
|
86
|
+
return a.set(t, { key: o }), t;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function T(e) {
|
|
90
|
+
if (!e) return;
|
|
91
|
+
if (e[l]) return e;
|
|
92
|
+
if (e.loadingRenderer && typeof e.loadingRenderer == "function") {
|
|
93
|
+
const t = e.loadingRenderer;
|
|
94
|
+
e = {
|
|
95
|
+
...e,
|
|
96
|
+
loadingRenderer: M(t)
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
if (e.emptyRenderer && typeof e.emptyRenderer == "function") {
|
|
100
|
+
const t = e.emptyRenderer;
|
|
101
|
+
e = {
|
|
102
|
+
...e,
|
|
103
|
+
emptyRenderer: b(t)
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
if (!e.columns) {
|
|
107
|
+
const t = e;
|
|
108
|
+
return t[l] = !0, t;
|
|
109
|
+
}
|
|
110
|
+
const n = e.columns.map((t) => {
|
|
111
|
+
const { renderer: o, editor: s, headerRenderer: c, headerLabelRenderer: p, ...m } = t, d = { ...m };
|
|
112
|
+
return o && (d.renderer = E(o)), s && (d.editor = k(s)), c && (d.headerRenderer = w(c)), p && (d.headerLabelRenderer = h(p)), d;
|
|
113
|
+
}), r = {
|
|
114
|
+
...e,
|
|
115
|
+
columns: n
|
|
116
|
+
};
|
|
117
|
+
return r[l] = !0, r;
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
K as c,
|
|
121
|
+
L as m,
|
|
122
|
+
R as n,
|
|
123
|
+
T as p,
|
|
124
|
+
H as r
|
|
125
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { p as b, n as m, c as K } from "./react-column-config-
|
|
1
|
+
import { p as b, n as m, c as K } from "./react-column-config-B8Isgp88.js";
|
|
2
2
|
import { jsx as T } from "react/jsx-runtime";
|
|
3
3
|
import { useRef as k, useCallback as E, useEffect as w } from "react";
|
|
4
|
-
import { a as u, r as g } from "./portal-bridge-
|
|
4
|
+
import { a as u, r as g } from "./portal-bridge-CH_xMkYc.js";
|
|
5
5
|
const p = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new Map();
|
|
6
6
|
function D(o) {
|
|
7
7
|
const e = p.get(o);
|
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-B8Isgp88.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);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filtering.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/filtering.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAEL,KAAK,SAAS,EAEd,KAAK,WAAW,EAEjB,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"filtering.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/features/filtering.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAEL,KAAK,SAAS,EAEd,KAAK,WAAW,EAEjB,MAAM,qCAAqC,CAAC;AA6D7C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAE9G;;OAEG;IACH,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,WAAW,GAAG,SAAS,CAAC;IAEtD;;OAEG;IACH,UAAU,EAAE,MAAM,WAAW,EAAE,CAAC;IAEhC;;;OAGG;IACH,cAAc,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAEjF;;;OAGG;IACH,eAAe,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAE1D;;;OAGG;IACH,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAE1E;;OAEG;IACH,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IAE5C;;OAEG;IACH,mBAAmB,EAAE,MAAM,MAAM,CAAC;IAElC;;OAEG;IACH,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,EAAE,CAAC;IAE9C;;OAEG;IACH,eAAe,EAAE,MAAM,WAAW,EAAE,CAAC;IAErC;;OAEG;IACH,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAE3C;;OAEG;IACH,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CAC7D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAuHpE"}
|
package/features/filtering.js
CHANGED
|
@@ -2,26 +2,30 @@ 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
|
|
6
|
-
import { r as
|
|
7
|
-
E(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
5
|
+
import { r as v, a as m } from "../chunks/portal-bridge-CH_xMkYc.js";
|
|
6
|
+
import { r as C } from "../chunks/react-grid-adapter-DeV_qtlr.js";
|
|
7
|
+
E(
|
|
8
|
+
"filtering",
|
|
9
|
+
(l) => {
|
|
10
|
+
if (typeof l == "boolean") return new F();
|
|
11
|
+
if (!l) return new F();
|
|
12
|
+
const o = l, e = { ...o };
|
|
13
|
+
if (typeof o.filterPanelRenderer == "function" && o.filterPanelRenderer.length <= 1) {
|
|
14
|
+
const f = o.filterPanelRenderer, s = /* @__PURE__ */ new WeakMap();
|
|
15
|
+
e.filterPanelRenderer = (a, g) => {
|
|
16
|
+
const c = s.get(a);
|
|
17
|
+
c && v(c);
|
|
18
|
+
const d = document.createElement("div");
|
|
19
|
+
d.style.display = "contents";
|
|
20
|
+
const u = m(d, f(g));
|
|
21
|
+
s.set(a, u), a.appendChild(d);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return new F(e);
|
|
25
|
+
},
|
|
26
|
+
{ override: !0 }
|
|
27
|
+
);
|
|
28
|
+
C((l, o, { trackPortal: e }) => {
|
|
25
29
|
const f = l;
|
|
26
30
|
return (s, a) => {
|
|
27
31
|
const g = document.createElement("div");
|
|
@@ -1,21 +1,25 @@
|
|
|
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-CH_xMkYc.js";
|
|
4
4
|
function u(n) {
|
|
5
5
|
const r = p(n);
|
|
6
6
|
return (o) => r(o) ?? document.createElement("div");
|
|
7
7
|
}
|
|
8
|
-
c(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
8
|
+
c(
|
|
9
|
+
"groupingColumns",
|
|
10
|
+
(n) => {
|
|
11
|
+
if (typeof n == "boolean") return new t();
|
|
12
|
+
if (!n) return new t();
|
|
13
|
+
const r = n, o = { ...r };
|
|
14
|
+
if (typeof r.groupHeaderRenderer == "function") {
|
|
15
|
+
const e = r.groupHeaderRenderer;
|
|
16
|
+
o.groupHeaderRenderer = u(e);
|
|
17
|
+
}
|
|
18
|
+
return Array.isArray(r.columnGroups) && (o.columnGroups = r.columnGroups.map((e) => {
|
|
19
|
+
if (typeof e.renderer != "function") return e;
|
|
20
|
+
const i = e.renderer;
|
|
21
|
+
return { ...e, renderer: u(i) };
|
|
22
|
+
})), new t(o);
|
|
23
|
+
},
|
|
24
|
+
{ override: !0 }
|
|
25
|
+
);
|
|
@@ -1,13 +1,17 @@
|
|
|
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-
|
|
4
|
-
c(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
3
|
+
import { c as p } from "../chunks/portal-bridge-CH_xMkYc.js";
|
|
4
|
+
c(
|
|
5
|
+
"groupingRows",
|
|
6
|
+
(e) => {
|
|
7
|
+
if (typeof e == "boolean") return new o();
|
|
8
|
+
if (!e) return new o();
|
|
9
|
+
const r = e, n = { ...r };
|
|
10
|
+
if (typeof r.groupRowRenderer == "function") {
|
|
11
|
+
const t = r.groupRowRenderer, i = p(t);
|
|
12
|
+
n.groupRowRenderer = (u) => i(u) ?? document.createElement("div");
|
|
13
|
+
}
|
|
14
|
+
return new o(n);
|
|
15
|
+
},
|
|
16
|
+
{ override: !0 }
|
|
17
|
+
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@toolbox-web/grid/features/master-detail";
|
|
2
2
|
import { g as c } from "../chunks/grid-detail-panel-CR7YUhdN.js";
|
|
3
|
-
import { a as s } from "../chunks/portal-bridge-
|
|
4
|
-
import { a as d } from "../chunks/react-grid-adapter-
|
|
3
|
+
import { a as s } from "../chunks/portal-bridge-CH_xMkYc.js";
|
|
4
|
+
import { a as d } from "../chunks/react-grid-adapter-DeV_qtlr.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-CH_xMkYc.js";
|
|
5
5
|
function u(r) {
|
|
6
6
|
return c(r);
|
|
7
7
|
}
|
|
@@ -13,17 +13,21 @@ function p(r) {
|
|
|
13
13
|
}
|
|
14
14
|
return typeof r.render == "function" ? { ...r, render: u(r.render) } : r;
|
|
15
15
|
}
|
|
16
|
-
m(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
16
|
+
m(
|
|
17
|
+
"pinnedRows",
|
|
18
|
+
(r) => {
|
|
19
|
+
if (typeof r == "boolean") return new o();
|
|
20
|
+
if (!r) return new o();
|
|
21
|
+
const t = r, { slots: e, customPanels: d, ...f } = t, i = { ...f };
|
|
22
|
+
return Array.isArray(d) && (i.customPanels = d.map((n) => {
|
|
23
|
+
if (typeof n.render != "function") return n;
|
|
24
|
+
const a = c(n.render);
|
|
25
|
+
return {
|
|
26
|
+
...n,
|
|
27
|
+
// customPanels expect HTMLElement (not nullable); coerce null → empty wrapper.
|
|
28
|
+
render: (s) => a(s) ?? document.createElement("div")
|
|
29
|
+
};
|
|
30
|
+
})), Array.isArray(e) && (i.slots = e.map(p)), new o(i);
|
|
31
|
+
},
|
|
32
|
+
{ override: !0 }
|
|
33
|
+
);
|
package/features/responsive.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@toolbox-web/grid/features/responsive";
|
|
2
2
|
import { g as i } from "../chunks/grid-responsive-card-BB28Zl2O.js";
|
|
3
|
-
import { a as c } from "../chunks/portal-bridge-
|
|
4
|
-
import { b as d } from "../chunks/react-grid-adapter-
|
|
3
|
+
import { a as c } from "../chunks/portal-bridge-CH_xMkYc.js";
|
|
4
|
+
import { b as d } from "../chunks/react-grid-adapter-DeV_qtlr.js";
|
|
5
5
|
d((r, { trackPortal: o }) => {
|
|
6
6
|
const n = i(r);
|
|
7
7
|
if (n)
|
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as w, Fragment as V, jsxs as le } from "react/jsx-runtime";
|
|
2
2
|
import { DataGridElement as fe } from "@toolbox-web/grid";
|
|
3
|
-
import { createContext as ie, useContext as
|
|
3
|
+
import { createContext as ie, useContext as L, forwardRef as se, useRef as b, useReducer as de, useImperativeHandle as ce, Component as ge, useMemo as E, useEffect as v, useLayoutEffect as pe, Children as me, isValidElement as Ce, useCallback as x, useState as X } from "react";
|
|
4
4
|
import { g as ye } from "./chunks/grid-responsive-card-BB28Zl2O.js";
|
|
5
5
|
import { G as ur } from "./chunks/grid-responsive-card-BB28Zl2O.js";
|
|
6
|
-
import { s as ee } from "./chunks/portal-bridge-
|
|
6
|
+
import { s as ee } from "./chunks/portal-bridge-CH_xMkYc.js";
|
|
7
7
|
import { flushSync as re, createPortal as he } from "react-dom";
|
|
8
|
-
import { p as ve } from "./chunks/react-column-config-
|
|
9
|
-
import { G as we, c as Re, d as Pe } from "./chunks/react-grid-adapter-
|
|
10
|
-
import { e as fr } from "./chunks/react-grid-adapter-
|
|
8
|
+
import { p as ve } from "./chunks/react-column-config-B8Isgp88.js";
|
|
9
|
+
import { G as we, c as Re, d as Pe } from "./chunks/react-grid-adapter-DeV_qtlr.js";
|
|
10
|
+
import { e as fr } from "./chunks/react-grid-adapter-DeV_qtlr.js";
|
|
11
11
|
import { createPluginsFromFeatures as be } from "@toolbox-web/grid/features/registry";
|
|
12
12
|
import { G as ae } from "./chunks/grid-element-context-BU3WvNtM.js";
|
|
13
13
|
import { G as gr } from "./chunks/grid-detail-panel-CR7YUhdN.js";
|
|
@@ -89,14 +89,14 @@ const B = {
|
|
|
89
89
|
onTbwScroll: "tbw-scroll"
|
|
90
90
|
}, H = ie(null), Fe = ({ icons: r, children: t }) => /* @__PURE__ */ w(H.Provider, { value: r, children: t });
|
|
91
91
|
function Qe() {
|
|
92
|
-
return
|
|
92
|
+
return L(H);
|
|
93
93
|
}
|
|
94
94
|
const Le = H, N = ie(null), Ae = ({ defaults: r, children: t }) => /* @__PURE__ */ w(N.Provider, { value: r, children: t });
|
|
95
95
|
function Xe() {
|
|
96
|
-
return
|
|
96
|
+
return L(N);
|
|
97
97
|
}
|
|
98
98
|
function er(r) {
|
|
99
|
-
return
|
|
99
|
+
return L(N)?.[r];
|
|
100
100
|
}
|
|
101
101
|
const ke = N;
|
|
102
102
|
class Ie extends ge {
|
|
@@ -112,28 +112,28 @@ class Ie extends ge {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
const Te = se(function(t, i) {
|
|
115
|
-
const o = b(/* @__PURE__ */ new Map()), [,
|
|
115
|
+
const o = b(/* @__PURE__ */ new Map()), [, f] = de((d) => d + 1, 0), g = b(!1), p = b(0), l = () => {
|
|
116
116
|
g.current || (g.current = !0, queueMicrotask(() => {
|
|
117
|
-
g.current = !1, re(
|
|
117
|
+
g.current = !1, re(f), R();
|
|
118
118
|
}));
|
|
119
119
|
}, R = () => {
|
|
120
120
|
p.current || (p.current = requestAnimationFrame(() => {
|
|
121
|
-
p.current = 0,
|
|
121
|
+
p.current = 0, f();
|
|
122
122
|
}));
|
|
123
|
-
}, S = (
|
|
124
|
-
console.error(`[grid-react] Portal "${
|
|
123
|
+
}, S = (d, y) => {
|
|
124
|
+
console.error(`[grid-react] Portal "${d}" crashed; dropping.`, y), o.current.delete(d), R();
|
|
125
125
|
};
|
|
126
126
|
ce(
|
|
127
127
|
i,
|
|
128
128
|
() => ({
|
|
129
|
-
renderPortal(
|
|
130
|
-
o.current.set(
|
|
129
|
+
renderPortal(d, y, G) {
|
|
130
|
+
o.current.set(d, { container: y, element: G }), l();
|
|
131
131
|
},
|
|
132
|
-
removePortal(
|
|
133
|
-
o.current.delete(
|
|
132
|
+
removePortal(d, y) {
|
|
133
|
+
o.current.delete(d) && (y ? re(f) : l());
|
|
134
134
|
},
|
|
135
135
|
clear() {
|
|
136
|
-
o.current.size > 0 && (o.current.clear(), p.current && (cancelAnimationFrame(p.current), p.current = 0),
|
|
136
|
+
o.current.size > 0 && (o.current.clear(), p.current && (cancelAnimationFrame(p.current), p.current = 0), l());
|
|
137
137
|
}
|
|
138
138
|
}),
|
|
139
139
|
// forceRender is stable (useReducer dispatch), refs are stable
|
|
@@ -142,23 +142,23 @@ const Te = se(function(t, i) {
|
|
|
142
142
|
);
|
|
143
143
|
const P = [];
|
|
144
144
|
let h = null;
|
|
145
|
-
for (const [
|
|
145
|
+
for (const [d, { container: y, element: G }] of o.current) {
|
|
146
146
|
if (!y.isConnected) {
|
|
147
|
-
(h ??= []).push(
|
|
147
|
+
(h ??= []).push(d);
|
|
148
148
|
continue;
|
|
149
149
|
}
|
|
150
150
|
P.push(
|
|
151
151
|
he(
|
|
152
|
-
/* @__PURE__ */ w(Ie, { portalKey:
|
|
152
|
+
/* @__PURE__ */ w(Ie, { portalKey: d, onError: S, children: G }),
|
|
153
153
|
y,
|
|
154
|
-
|
|
154
|
+
d
|
|
155
155
|
)
|
|
156
156
|
);
|
|
157
157
|
}
|
|
158
158
|
if (h) {
|
|
159
|
-
const
|
|
159
|
+
const d = h;
|
|
160
160
|
queueMicrotask(() => {
|
|
161
|
-
for (const y of
|
|
161
|
+
for (const y of d) o.current.delete(y);
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
return /* @__PURE__ */ w(V, { children: P });
|
|
@@ -171,9 +171,9 @@ function Ne(r) {
|
|
|
171
171
|
for (const i of r) {
|
|
172
172
|
const o = Me[i];
|
|
173
173
|
if (o)
|
|
174
|
-
for (const
|
|
175
|
-
t.has(
|
|
176
|
-
`[DataGrid] Feature "${i}" requires "${
|
|
174
|
+
for (const f of o)
|
|
175
|
+
t.has(f) || console.warn(
|
|
176
|
+
`[DataGrid] Feature "${i}" requires "${f}" to be enabled. Add the "${f}" prop to your DataGrid.`
|
|
177
177
|
);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
@@ -214,11 +214,11 @@ function q() {
|
|
|
214
214
|
return ne || (_ = new we(), fe.registerAdapter(_), ne = !0), _;
|
|
215
215
|
}
|
|
216
216
|
q();
|
|
217
|
-
function
|
|
217
|
+
function je(r) {
|
|
218
218
|
const i = r.getPluginByName?.("masterDetail");
|
|
219
219
|
i && typeof i.refreshDetailRenderer == "function" && i.refreshDetailRenderer();
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function ze(r, t) {
|
|
222
222
|
const i = r;
|
|
223
223
|
if (!r.querySelector("tbw-grid-responsive-card") || !ye(r)) return;
|
|
224
224
|
const g = i.getPluginByName?.("responsive");
|
|
@@ -248,15 +248,15 @@ const rr = se(function(t, i) {
|
|
|
248
248
|
const {
|
|
249
249
|
// Core props
|
|
250
250
|
rows: o,
|
|
251
|
-
gridConfig:
|
|
251
|
+
gridConfig: f,
|
|
252
252
|
columns: g,
|
|
253
253
|
columnDefaults: p,
|
|
254
|
-
fitMode:
|
|
254
|
+
fitMode: l,
|
|
255
255
|
sortable: R,
|
|
256
256
|
filterable: S,
|
|
257
257
|
selectable: P,
|
|
258
258
|
loading: h,
|
|
259
|
-
customStyles:
|
|
259
|
+
customStyles: d,
|
|
260
260
|
className: y,
|
|
261
261
|
style: G,
|
|
262
262
|
children: D,
|
|
@@ -267,93 +267,98 @@ const rr = se(function(t, i) {
|
|
|
267
267
|
// Legacy event handlers
|
|
268
268
|
onRowsChange: C,
|
|
269
269
|
// Feature props and event props are in ...rest
|
|
270
|
-
...
|
|
271
|
-
} = t, c = b(null), M = b(null), K = b(!1), U =
|
|
272
|
-
const n =
|
|
270
|
+
...u
|
|
271
|
+
} = t, c = b(null), M = b(null), K = b(!1), U = L(ke), O = L(Le), ue = E(() => oe.map((e) => {
|
|
272
|
+
const n = u[e];
|
|
273
273
|
return n !== void 0 ? `${e}:${JSON.stringify(n)}` : "";
|
|
274
|
-
}).filter(Boolean).join("|"), [
|
|
274
|
+
}).filter(Boolean).join("|"), [u]), Y = E(() => {
|
|
275
275
|
const e = {};
|
|
276
276
|
for (const n of oe)
|
|
277
|
-
n in
|
|
277
|
+
n in u && u[n] !== void 0 && (e[n] = u[n]);
|
|
278
278
|
return e;
|
|
279
|
-
}, [ue]), J = E(() => $e(D), [D]), W = E(() =>
|
|
279
|
+
}, [ue]), J = E(() => $e(D), [D]), W = E(() => {
|
|
280
|
+
const e = f?.features, n = {};
|
|
281
|
+
for (const [a, F] of Object.entries(J))
|
|
282
|
+
e && a in e && e[a] !== void 0 && e[a] !== !1 || (n[a] = F);
|
|
283
|
+
return { ...n, ...Y };
|
|
284
|
+
}, [Y, J, f]), j = E(() => s || m ? [] : Oe(W), [W, s, m]), A = E(() => {
|
|
280
285
|
if (s) {
|
|
281
|
-
const e = new Set(s.map((
|
|
286
|
+
const e = new Set(s.map((a) => a.name)), n = j.filter((a) => !e.has(a.name));
|
|
282
287
|
return [...s, ...n];
|
|
283
288
|
}
|
|
284
|
-
return
|
|
285
|
-
}, [s,
|
|
286
|
-
const e = ve(
|
|
289
|
+
return j;
|
|
290
|
+
}, [s, j]), k = E(() => g && De(Ee(g), p), [g, p]), I = E(() => {
|
|
291
|
+
const e = ve(f), n = {};
|
|
287
292
|
if (R !== void 0 && (n.sortable = R), S !== void 0 && (n.filterable = S), P !== void 0 && (n.selectable = P), O) {
|
|
288
|
-
const
|
|
289
|
-
n.icons = { ...O, ...
|
|
293
|
+
const a = e?.icons || f?.icons || {};
|
|
294
|
+
n.icons = { ...O, ...a };
|
|
290
295
|
}
|
|
291
|
-
if (
|
|
292
|
-
const
|
|
296
|
+
if (A.length > 0 && e) {
|
|
297
|
+
const a = e.plugins || [], F = new Set(a.map((T) => T.name)), $ = A.filter((T) => !F.has(T.name));
|
|
293
298
|
return {
|
|
294
299
|
...e,
|
|
295
300
|
...n,
|
|
296
|
-
plugins: [...
|
|
301
|
+
plugins: [...a, ...$]
|
|
297
302
|
};
|
|
298
303
|
}
|
|
299
|
-
return
|
|
300
|
-
}, [
|
|
304
|
+
return A.length > 0 && !e ? { ...n, plugins: A } : Object.keys(n).length > 0 ? { ...e, ...n } : e;
|
|
305
|
+
}, [f, A, R, S, P, O]);
|
|
301
306
|
v(() => {
|
|
302
307
|
q().setTypeDefaults(U);
|
|
303
308
|
}, [U]), v(() => {
|
|
304
309
|
c.current && (c.current.rows = o);
|
|
305
310
|
}, [o]), v(() => {
|
|
306
|
-
c.current &&
|
|
311
|
+
c.current && I && (c.current.gridConfig = I);
|
|
312
|
+
}, [I]), v(() => {
|
|
313
|
+
c.current && k && (c.current.columns = k);
|
|
307
314
|
}, [k]), v(() => {
|
|
308
|
-
c.current &&
|
|
309
|
-
}, [
|
|
310
|
-
c.current && u !== void 0 && (c.current.fitMode = u);
|
|
311
|
-
}, [u]), v(() => {
|
|
315
|
+
c.current && l !== void 0 && (c.current.fitMode = l);
|
|
316
|
+
}, [l]), v(() => {
|
|
312
317
|
c.current && h !== void 0 && (c.current.loading = h);
|
|
313
318
|
}, [h]), v(() => {
|
|
314
319
|
const e = c.current;
|
|
315
320
|
if (!e) return;
|
|
316
321
|
const n = q();
|
|
317
|
-
e.__frameworkAdapter = n,
|
|
318
|
-
let
|
|
319
|
-
const
|
|
320
|
-
|
|
322
|
+
e.__frameworkAdapter = n, je(e), ze(e, n);
|
|
323
|
+
let a = !1;
|
|
324
|
+
const F = requestAnimationFrame(() => {
|
|
325
|
+
a || (typeof e.refreshColumns == "function" && e.refreshColumns(), typeof e.refreshShellHeader == "function" && e.refreshShellHeader());
|
|
321
326
|
});
|
|
322
327
|
return () => {
|
|
323
|
-
|
|
328
|
+
a = !0, cancelAnimationFrame(F);
|
|
324
329
|
};
|
|
325
330
|
}, []), v(() => {
|
|
326
|
-
if (!c.current || !
|
|
331
|
+
if (!c.current || !d) return;
|
|
327
332
|
const e = c.current, n = "react-custom-styles";
|
|
328
|
-
let
|
|
333
|
+
let a = !0;
|
|
329
334
|
return e.ready?.().then(() => {
|
|
330
|
-
|
|
335
|
+
a && d && (e.registerStyles?.(n, d), M.current = n);
|
|
331
336
|
}), () => {
|
|
332
|
-
|
|
337
|
+
a = !1, M.current && (e.unregisterStyles?.(M.current), M.current = null);
|
|
333
338
|
};
|
|
334
|
-
}, [
|
|
339
|
+
}, [d]), v(() => {
|
|
335
340
|
const e = c.current;
|
|
336
341
|
if (!e) return;
|
|
337
342
|
const n = [];
|
|
338
|
-
return C && n.push(e.on("rows-change", (
|
|
339
|
-
n.forEach((
|
|
343
|
+
return C && n.push(e.on("rows-change", (a) => C(a.rows))), () => {
|
|
344
|
+
n.forEach((a) => a());
|
|
340
345
|
};
|
|
341
346
|
}, [C]);
|
|
342
|
-
const Z = E(() => Object.keys(B).filter((e) => typeof
|
|
347
|
+
const Z = E(() => Object.keys(B).filter((e) => typeof u[e] == "function").sort().join("|"), [u]), Q = b({});
|
|
343
348
|
for (const e of Object.keys(B))
|
|
344
|
-
Q.current[e] =
|
|
349
|
+
Q.current[e] = u[e];
|
|
345
350
|
v(() => {
|
|
346
351
|
const e = c.current;
|
|
347
352
|
if (!e) return;
|
|
348
353
|
const n = [];
|
|
349
|
-
for (const [
|
|
350
|
-
Z.includes(
|
|
351
|
-
e.on(
|
|
352
|
-
Q.current[
|
|
354
|
+
for (const [a, F] of Object.entries(B))
|
|
355
|
+
Z.includes(a) && n.push(
|
|
356
|
+
e.on(F, ($, T) => {
|
|
357
|
+
Q.current[a]?.($, T);
|
|
353
358
|
})
|
|
354
359
|
);
|
|
355
360
|
return () => {
|
|
356
|
-
n.forEach((
|
|
361
|
+
n.forEach((a) => a());
|
|
357
362
|
};
|
|
358
363
|
}, [Z]), ce(
|
|
359
364
|
i,
|
|
@@ -382,8 +387,8 @@ const rr = se(function(t, i) {
|
|
|
382
387
|
setRowLoading(e, n) {
|
|
383
388
|
c.current?.setRowLoading?.(e, n);
|
|
384
389
|
},
|
|
385
|
-
setCellLoading(e, n,
|
|
386
|
-
c.current?.setCellLoading?.(e, n,
|
|
390
|
+
setCellLoading(e, n, a) {
|
|
391
|
+
c.current?.setCellLoading?.(e, n, a);
|
|
387
392
|
},
|
|
388
393
|
isRowLoading(e) {
|
|
389
394
|
return c.current?.isRowLoading?.(e) ?? !1;
|
|
@@ -397,14 +402,14 @@ const rr = se(function(t, i) {
|
|
|
397
402
|
}),
|
|
398
403
|
[]
|
|
399
404
|
);
|
|
400
|
-
const
|
|
405
|
+
const z = b(null);
|
|
401
406
|
return pe(() => {
|
|
402
407
|
const e = c.current;
|
|
403
|
-
return e &&
|
|
408
|
+
return e && z.current && ee(e, z.current), () => {
|
|
404
409
|
e && ee(e, null);
|
|
405
410
|
};
|
|
406
411
|
}, []), /* @__PURE__ */ le(V, { children: [
|
|
407
|
-
/* @__PURE__ */ w(Te, { ref:
|
|
412
|
+
/* @__PURE__ */ w(Te, { ref: z }),
|
|
408
413
|
/* @__PURE__ */ w(
|
|
409
414
|
"tbw-grid",
|
|
410
415
|
{
|
|
@@ -412,7 +417,7 @@ const rr = se(function(t, i) {
|
|
|
412
417
|
if (c.current = e, e && !K.current) {
|
|
413
418
|
K.current = !0;
|
|
414
419
|
const n = e;
|
|
415
|
-
|
|
420
|
+
I && (n.gridConfig = I), o && (n.rows = o), k && (n.columns = k);
|
|
416
421
|
}
|
|
417
422
|
},
|
|
418
423
|
class: y,
|
|
@@ -427,28 +432,28 @@ function tr(r) {
|
|
|
427
432
|
field: t,
|
|
428
433
|
header: i,
|
|
429
434
|
type: o,
|
|
430
|
-
editable:
|
|
435
|
+
editable: f,
|
|
431
436
|
sortable: g,
|
|
432
437
|
resizable: p,
|
|
433
|
-
width:
|
|
438
|
+
width: l,
|
|
434
439
|
minWidth: R,
|
|
435
440
|
hidden: S,
|
|
436
441
|
lockVisible: P,
|
|
437
442
|
children: h,
|
|
438
|
-
editor:
|
|
443
|
+
editor: d,
|
|
439
444
|
options: y,
|
|
440
445
|
multi: G,
|
|
441
446
|
format: D
|
|
442
447
|
} = r, s = b(null), m = x(
|
|
443
448
|
(c) => {
|
|
444
|
-
s.current = c, c && (h && Re(c, h),
|
|
449
|
+
s.current = c, c && (h && Re(c, h), d && Pe(c, d));
|
|
445
450
|
},
|
|
446
|
-
[h,
|
|
447
|
-
), C = typeof
|
|
451
|
+
[h, d, t]
|
|
452
|
+
), C = typeof l == "number" ? `${l}px` : l, u = {
|
|
448
453
|
field: t,
|
|
449
454
|
ref: m
|
|
450
455
|
};
|
|
451
|
-
return i !== void 0 && (
|
|
456
|
+
return i !== void 0 && (u.header = i), o !== void 0 && (u.type = o), f !== void 0 && (u.editable = f), g !== void 0 && (u.sortable = g), p !== void 0 && (u.resizable = p), C !== void 0 && (u.width = C), R !== void 0 && (u["min-width"] = R), S !== void 0 && (u.hidden = S), P !== void 0 && (u["lock-visible"] = P), G !== void 0 && (u.multi = G), D && (u["data-has-format"] = "true"), y && (u["data-has-options"] = "true"), /* @__PURE__ */ w("tbw-grid-column", { ...u });
|
|
452
457
|
}
|
|
453
458
|
function nr({ children: r }) {
|
|
454
459
|
return /* @__PURE__ */ w("tbw-grid-tool-buttons", { children: r });
|
|
@@ -458,7 +463,7 @@ const or = ({ icons: r, defaults: t, children: i }) => {
|
|
|
458
463
|
return t && (o = /* @__PURE__ */ w(Ae, { defaults: t, children: o })), r && (o = /* @__PURE__ */ w(Fe, { icons: r, children: o })), /* @__PURE__ */ w(V, { children: o });
|
|
459
464
|
};
|
|
460
465
|
function ir(r) {
|
|
461
|
-
const t = b(null), [i, o] = X(!1), [
|
|
466
|
+
const t = b(null), [i, o] = X(!1), [f, g] = X(null), p = b(null), l = x(() => r ? (p.current ??= document.querySelector(r), p.current) : t.current?.element ?? null, [r]);
|
|
462
467
|
v(() => {
|
|
463
468
|
let s = !0;
|
|
464
469
|
return (async () => {
|
|
@@ -468,16 +473,16 @@ function ir(r) {
|
|
|
468
473
|
if (!C) return;
|
|
469
474
|
if (p.current = C, await C.ready?.(), s) {
|
|
470
475
|
o(!0);
|
|
471
|
-
const
|
|
472
|
-
s &&
|
|
476
|
+
const u = await C.getConfig?.();
|
|
477
|
+
s && u && g(u);
|
|
473
478
|
}
|
|
474
479
|
} else {
|
|
475
480
|
const C = t.current;
|
|
476
481
|
if (!C) return;
|
|
477
482
|
if (await C.ready?.(), s) {
|
|
478
483
|
o(!0);
|
|
479
|
-
const
|
|
480
|
-
s &&
|
|
484
|
+
const u = await C.getConfig?.();
|
|
485
|
+
s && u && g(u);
|
|
481
486
|
}
|
|
482
487
|
}
|
|
483
488
|
} catch {
|
|
@@ -487,22 +492,22 @@ function ir(r) {
|
|
|
487
492
|
};
|
|
488
493
|
}, [r]);
|
|
489
494
|
const R = x(async () => {
|
|
490
|
-
const s =
|
|
495
|
+
const s = l();
|
|
491
496
|
if (s)
|
|
492
497
|
return await s.getConfig?.() ?? null;
|
|
493
498
|
const m = t.current;
|
|
494
499
|
return m ? await m.getConfig?.() ?? null : null;
|
|
495
|
-
}, [
|
|
496
|
-
const s =
|
|
500
|
+
}, [l]), S = x(async () => {
|
|
501
|
+
const s = l();
|
|
497
502
|
if (s) {
|
|
498
503
|
await s.forceLayout?.();
|
|
499
504
|
return;
|
|
500
505
|
}
|
|
501
506
|
const m = t.current;
|
|
502
507
|
m && await m.forceLayout?.();
|
|
503
|
-
}, [
|
|
508
|
+
}, [l]), P = x(
|
|
504
509
|
async (s) => {
|
|
505
|
-
const m =
|
|
510
|
+
const m = l();
|
|
506
511
|
if (m) {
|
|
507
512
|
await m.toggleGroup?.(s);
|
|
508
513
|
return;
|
|
@@ -510,61 +515,61 @@ function ir(r) {
|
|
|
510
515
|
const C = t.current;
|
|
511
516
|
C && await C.toggleGroup?.(s);
|
|
512
517
|
},
|
|
513
|
-
[
|
|
518
|
+
[l]
|
|
514
519
|
), h = x(
|
|
515
|
-
(s) =>
|
|
516
|
-
[
|
|
517
|
-
),
|
|
518
|
-
((s) =>
|
|
519
|
-
[
|
|
520
|
+
(s) => l()?.getPlugin?.(s),
|
|
521
|
+
[l]
|
|
522
|
+
), d = x(
|
|
523
|
+
((s) => l()?.getPluginByName?.(s)),
|
|
524
|
+
[l]
|
|
520
525
|
), y = x(
|
|
521
526
|
(s, m) => {
|
|
522
|
-
const C =
|
|
527
|
+
const C = l();
|
|
523
528
|
if (C) {
|
|
524
529
|
C.registerStyles?.(s, m);
|
|
525
530
|
return;
|
|
526
531
|
}
|
|
527
532
|
t.current?.registerStyles?.(s, m);
|
|
528
533
|
},
|
|
529
|
-
[
|
|
534
|
+
[l]
|
|
530
535
|
), G = x(
|
|
531
536
|
(s) => {
|
|
532
|
-
const m =
|
|
537
|
+
const m = l();
|
|
533
538
|
if (m) {
|
|
534
539
|
m.unregisterStyles?.(s);
|
|
535
540
|
return;
|
|
536
541
|
}
|
|
537
542
|
t.current?.unregisterStyles?.(s);
|
|
538
543
|
},
|
|
539
|
-
[
|
|
540
|
-
), D = x(() =>
|
|
544
|
+
[l]
|
|
545
|
+
), D = x(() => f?.columns ? f.columns.filter((s) => !s.hidden) : [], [f]);
|
|
541
546
|
return {
|
|
542
547
|
ref: t,
|
|
543
|
-
element:
|
|
548
|
+
element: l(),
|
|
544
549
|
isReady: i,
|
|
545
|
-
config:
|
|
550
|
+
config: f,
|
|
546
551
|
getConfig: R,
|
|
547
552
|
forceLayout: S,
|
|
548
553
|
toggleGroup: P,
|
|
549
554
|
getPlugin: h,
|
|
550
|
-
getPluginByName:
|
|
555
|
+
getPluginByName: d,
|
|
551
556
|
registerStyles: y,
|
|
552
557
|
unregisterStyles: G,
|
|
553
558
|
getVisibleColumns: D
|
|
554
559
|
};
|
|
555
560
|
}
|
|
556
561
|
function sr(r, t = {}) {
|
|
557
|
-
const { open: i = !0, gridElement: o } = t,
|
|
562
|
+
const { open: i = !0, gridElement: o } = t, f = L(ae);
|
|
558
563
|
v(() => {
|
|
559
564
|
if (!i) return;
|
|
560
565
|
const g = r.current;
|
|
561
566
|
if (!g) return;
|
|
562
|
-
const p = o ?? g.closest("tbw-grid") ??
|
|
567
|
+
const p = o ?? g.closest("tbw-grid") ?? f?.current ?? null;
|
|
563
568
|
if (p)
|
|
564
569
|
return p.registerExternalFocusContainer?.(g), () => {
|
|
565
570
|
p.unregisterExternalFocusContainer?.(g);
|
|
566
571
|
};
|
|
567
|
-
}, [i, o,
|
|
572
|
+
}, [i, o, f, r]);
|
|
568
573
|
}
|
|
569
574
|
export {
|
|
570
575
|
rr as DataGrid,
|
|
@@ -71,7 +71,7 @@ export declare function normalizeColumns<TRow = unknown>(columns: ColumnShorthan
|
|
|
71
71
|
* // { field: 'name', sortable: false, resizable: true },
|
|
72
72
|
* // ]
|
|
73
73
|
* ```
|
|
74
|
-
* @since
|
|
74
|
+
* @since 1.5.0
|
|
75
75
|
*/
|
|
76
76
|
export declare function applyColumnDefaults<TRow = unknown>(columns: ColumnConfig<TRow>[], defaults: Partial<ColumnConfig<TRow>> | undefined): ColumnConfig<TRow>[];
|
|
77
77
|
/**
|
package/lib/data-grid.d.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,WAAW,CAAC,IAAI,CAAC,CAAC,CAAA;CAAE,KAAK,KAAK,CAAC,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal-bridge.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/portal-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAmB5D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAM1F;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,mBAAmB,GAAG,IAAI,CAIjF;AAuCD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,SAAS,EAClB,WAAW,CAAC,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,WAAW,GACnB,MAAM,CAoBR;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAQnF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAWhE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAczC;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,IAAI,KAAK,WAAW,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"portal-bridge.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/portal-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAmB5D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAM1F;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,mBAAmB,GAAG,IAAI,CAIjF;AAuCD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,SAAS,EAClB,WAAW,CAAC,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,WAAW,GACnB,MAAM,CAoBR;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAQnF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAWhE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAczC;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,IAAI,KAAK,WAAW,GAAG,IAAI,CAe3G;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAKlC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColumnConfig as BaseColumnConfig, GridConfig as BaseGridConfig, CellRenderContext, ColumnEditorContext, HeaderCellContext, HeaderLabelContext, LoadingContext } from '@toolbox-web/grid';
|
|
1
|
+
import { ColumnConfig as BaseColumnConfig, GridConfig as BaseGridConfig, CellRenderContext, ColumnEditorContext, EmptyContext, HeaderCellContext, HeaderLabelContext, LoadingContext } from '@toolbox-web/grid';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Column configuration for React applications.
|
|
@@ -75,12 +75,19 @@ export interface ColumnConfig<TRow = unknown> extends Omit<BaseColumnConfig<TRow
|
|
|
75
75
|
* ```
|
|
76
76
|
* @since 0.0.1
|
|
77
77
|
*/
|
|
78
|
-
export type GridConfig<TRow = unknown> = Omit<BaseGridConfig<TRow>, 'columns' | 'loadingRenderer'> & {
|
|
78
|
+
export type GridConfig<TRow = unknown> = Omit<BaseGridConfig<TRow>, 'columns' | 'loadingRenderer' | 'emptyRenderer'> & {
|
|
79
79
|
columns?: ColumnConfig<TRow>[];
|
|
80
80
|
/**
|
|
81
81
|
* Custom loading renderer - can be a vanilla DOM function or a React render function returning JSX.
|
|
82
82
|
*/
|
|
83
83
|
loadingRenderer?: BaseGridConfig<TRow>['loadingRenderer'] | ((ctx: LoadingContext) => ReactNode);
|
|
84
|
+
/**
|
|
85
|
+
* Custom empty-state renderer shown when the grid has no rows and is not
|
|
86
|
+
* loading. Can be a vanilla DOM function (returning `HTMLElement | string`)
|
|
87
|
+
* or a React render function returning JSX. Set explicitly to `null` to
|
|
88
|
+
* suppress the built-in default message.
|
|
89
|
+
*/
|
|
90
|
+
emptyRenderer?: BaseGridConfig<TRow>['emptyRenderer'] | ((ctx: EmptyContext) => ReactNode);
|
|
84
91
|
};
|
|
85
92
|
/**
|
|
86
93
|
* Clean up config-based editor and renderer portals whose containers are
|
|
@@ -150,6 +157,13 @@ export declare function wrapReactHeaderLabelRenderer<TRow>(renderFn: (ctx: Heade
|
|
|
150
157
|
* Skips wrapping if the function already returns an HTMLElement or string (vanilla DOM renderer).
|
|
151
158
|
*/
|
|
152
159
|
export declare function wrapReactLoadingRenderer(renderFn: (ctx: LoadingContext) => ReactNode): (ctx: LoadingContext) => HTMLElement | string;
|
|
160
|
+
/**
|
|
161
|
+
* Wraps a React empty-state renderer into a DOM-returning function.
|
|
162
|
+
* Mirrors `wrapReactLoadingRenderer`: vanilla `HTMLElement | string` returns
|
|
163
|
+
* are passed through unchanged so consumers can mix DOM-only and React
|
|
164
|
+
* renderers freely.
|
|
165
|
+
*/
|
|
166
|
+
export declare function wrapReactEmptyRenderer(renderFn: (ctx: EmptyContext) => ReactNode): (ctx: EmptyContext) => HTMLElement | string;
|
|
153
167
|
/**
|
|
154
168
|
* Processes a GridConfig, converting React renderer/editor functions
|
|
155
169
|
* to DOM-returning functions that the grid core understands.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-column-config.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/react-column-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,UAAU,IAAI,cAAc,EAC5B,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,YAAY,CAAC,IAAI,GAAG,OAAO,CAAE,SAAQ,IAAI,CACxD,gBAAgB,CAAC,IAAI,CAAC,EACtB,UAAU,GAAG,cAAc,GAAG,QAAQ,GAAG,gBAAgB,GAAG,qBAAqB,CAClF;IACC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;IAEvD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;IAEvD;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;IAE7D;;;OAGG;IACH,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;CACpE;AAKD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,UAAU,CAAC,IAAI,GAAG,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,iBAAiB,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"react-column-config.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/react-column-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,UAAU,IAAI,cAAc,EAC5B,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,YAAY,CAAC,IAAI,GAAG,OAAO,CAAE,SAAQ,IAAI,CACxD,gBAAgB,CAAC,IAAI,CAAC,EACtB,UAAU,GAAG,cAAc,GAAG,QAAQ,GAAG,gBAAgB,GAAG,qBAAqB,CAClF;IACC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;IAEvD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;IAEvD;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,SAAS,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CAuBjD;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAC1C,QAAQ,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,SAAS,GACpD,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,WAAW,CAS/C;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAC/C,QAAQ,EAAE,CAAC,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,KAAK,SAAS,GACrD,CAAC,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,KAAK,WAAW,CAShD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,SAAS,GAC3C,CAAC,GAAG,EAAE,cAAc,KAAK,WAAW,GAAG,MAAM,CAkB/C;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,SAAS,GACzC,CAAC,GAAG,EAAE,YAAY,KAAK,WAAW,GAAG,MAAM,CAc7C;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,SAAS,CAoE9G"}
|
|
@@ -103,7 +103,7 @@ export declare function getRegisteredFields(): string[];
|
|
|
103
103
|
* )} />
|
|
104
104
|
* </DataGrid>
|
|
105
105
|
* ```
|
|
106
|
-
* @since 0.0
|
|
106
|
+
* @since 0.11.0
|
|
107
107
|
*/
|
|
108
108
|
export declare class GridAdapter implements FrameworkAdapter {
|
|
109
109
|
/** Portal keys for all managed portals (for cleanup on destroy). */
|
package/package.json
CHANGED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { a as i, r as p } from "./portal-bridge-DLA6Zs11.js";
|
|
2
|
-
const y = [];
|
|
3
|
-
function C(e) {
|
|
4
|
-
y.push(e);
|
|
5
|
-
}
|
|
6
|
-
function R(e, t) {
|
|
7
|
-
const r = [];
|
|
8
|
-
for (const n of y) {
|
|
9
|
-
const o = n({ container: e, gridEl: t });
|
|
10
|
-
o && r.push(o);
|
|
11
|
-
}
|
|
12
|
-
return () => {
|
|
13
|
-
for (const n of r) n();
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
const d = /* @__PURE__ */ Symbol("reactProcessed"), s = /* @__PURE__ */ new Map();
|
|
17
|
-
function H(e) {
|
|
18
|
-
const t = e.querySelectorAll(".react-cell-editor, .react-cell-renderer");
|
|
19
|
-
for (const r of t) {
|
|
20
|
-
const n = s.get(r);
|
|
21
|
-
n && (n.unsub?.(), p(n.key, { sync: !0 }), s.delete(r));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function l(e) {
|
|
25
|
-
const t = document.createElement("div");
|
|
26
|
-
return t.className = e, t.style.display = "contents", t;
|
|
27
|
-
}
|
|
28
|
-
function K(e) {
|
|
29
|
-
return () => {
|
|
30
|
-
const t = e.ownerDocument.activeElement;
|
|
31
|
-
t && e.contains(t) && (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement) && t.blur();
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
function E(e) {
|
|
35
|
-
const t = /* @__PURE__ */ new WeakMap();
|
|
36
|
-
return (r) => {
|
|
37
|
-
const n = r.cellEl;
|
|
38
|
-
if (n) {
|
|
39
|
-
const c = t.get(n);
|
|
40
|
-
if (c) {
|
|
41
|
-
if (n.contains(c.container))
|
|
42
|
-
return i(c.container, e(r), c.portalKey), c.container;
|
|
43
|
-
p(c.portalKey, { sync: !0 }), t.delete(n);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
const o = l("react-cell-renderer"), a = i(o, e(r));
|
|
47
|
-
return n && t.set(n, { portalKey: a, container: o }), s.set(o, { key: a }), o;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function h(e) {
|
|
51
|
-
return (t) => {
|
|
52
|
-
const r = l("react-cell-editor"), o = { key: i(r, e(t)) };
|
|
53
|
-
return s.set(r, o), queueMicrotask(() => {
|
|
54
|
-
const a = r.closest("tbw-grid");
|
|
55
|
-
a && (o.unsub = R(r, a));
|
|
56
|
-
}), r;
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
function k(e) {
|
|
60
|
-
return (t) => {
|
|
61
|
-
const r = l("react-header-renderer"), n = i(r, e(t));
|
|
62
|
-
return s.set(r, { key: n }), r;
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function w(e) {
|
|
66
|
-
return (t) => {
|
|
67
|
-
const r = l("react-header-label-renderer"), n = i(r, e(t));
|
|
68
|
-
return s.set(r, { key: n }), r;
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
function M(e) {
|
|
72
|
-
return (t) => {
|
|
73
|
-
const r = e(t);
|
|
74
|
-
if (r instanceof HTMLElement || typeof r == "string")
|
|
75
|
-
return r;
|
|
76
|
-
const n = l("react-loading-renderer"), o = i(n, r);
|
|
77
|
-
return s.set(n, { key: o }), n;
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
function L(e) {
|
|
81
|
-
if (!e) return;
|
|
82
|
-
if (e[d]) return e;
|
|
83
|
-
if (e.loadingRenderer && typeof e.loadingRenderer == "function") {
|
|
84
|
-
const n = e.loadingRenderer;
|
|
85
|
-
e = {
|
|
86
|
-
...e,
|
|
87
|
-
loadingRenderer: M(n)
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
if (!e.columns) {
|
|
91
|
-
const n = e;
|
|
92
|
-
return n[d] = !0, n;
|
|
93
|
-
}
|
|
94
|
-
const t = e.columns.map((n) => {
|
|
95
|
-
const { renderer: o, editor: a, headerRenderer: c, headerLabelRenderer: f, ...m } = n, u = { ...m };
|
|
96
|
-
return o && (u.renderer = E(o)), a && (u.editor = h(a)), c && (u.headerRenderer = k(c)), f && (u.headerLabelRenderer = w(f)), u;
|
|
97
|
-
}), r = {
|
|
98
|
-
...e,
|
|
99
|
-
columns: t
|
|
100
|
-
};
|
|
101
|
-
return r[d] = !0, r;
|
|
102
|
-
}
|
|
103
|
-
export {
|
|
104
|
-
H as c,
|
|
105
|
-
K as m,
|
|
106
|
-
R as n,
|
|
107
|
-
L as p,
|
|
108
|
-
C as r
|
|
109
|
-
};
|