@toolbox-web/grid-react 2.0.0-rc.1 → 2.1.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/feature-registry-8K2rOVnC.js +2 -0
- package/chunks/grid-detail-panel-CLdX0T_A.js +44 -0
- package/chunks/grid-element-context-DpuQsoie.js +5 -0
- package/chunks/grid-responsive-card-Dx5U6Prm.js +41 -0
- package/chunks/portal-bridge-zxgm_jwK.js +60 -0
- package/chunks/post-mount-refresh-hooks-D7BDK4Kl.js +10 -0
- package/chunks/react-column-config-Cto2WHGC.js +126 -0
- package/chunks/react-grid-adapter-CZfpPJvo.js +308 -0
- package/features/editing.js +6 -4
- package/features/export.js +44 -59
- package/features/filtering.js +82 -132
- package/features/grouping-columns.js +24 -24
- package/features/grouping-rows.js +14 -17
- package/features/index.js +18 -20
- package/features/master-detail.js +48 -63
- package/features/pinned-rows.js +58 -51
- package/features/print.js +18 -23
- package/features/responsive.js +51 -63
- package/features/selection.js +47 -45
- package/features/undo-redo.js +53 -86
- package/index.js +621 -654
- package/lib/data-grid.d.ts.map +1 -1
- package/lib/row-diff.d.ts +20 -0
- package/lib/row-diff.d.ts.map +1 -0
- package/package.json +2 -2
- package/chunks/grid-detail-panel-BZFcujsZ.js +0 -52
- package/chunks/grid-element-context-BU3WvNtM.js +0 -5
- package/chunks/grid-responsive-card-CSZhDCoN.js +0 -45
- package/chunks/portal-bridge-CvxNt40O.js +0 -68
- package/chunks/post-mount-refresh-hooks-Dt7mPoZC.js +0 -12
- package/chunks/react-column-config-BOe_PgL1.js +0 -125
- package/chunks/react-grid-adapter-BhC9x425.js +0 -518
package/index.js
CHANGED
|
@@ -1,677 +1,644 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { c as e, d as t, f as n, l as r, n as i, p as a, r as o, s, t as c, u as l } from "./chunks/react-grid-adapter-CZfpPJvo.js";
|
|
2
|
+
import { a as u, i as d, o as f } from "./chunks/portal-bridge-zxgm_jwK.js";
|
|
3
|
+
import { n as p, t as m } from "./chunks/post-mount-refresh-hooks-D7BDK4Kl.js";
|
|
4
|
+
import { a as h, r as g } from "./chunks/react-column-config-Cto2WHGC.js";
|
|
5
|
+
import "./chunks/feature-registry-8K2rOVnC.js";
|
|
6
|
+
import { t as _ } from "./chunks/grid-element-context-DpuQsoie.js";
|
|
7
|
+
import { t as v } from "./chunks/grid-detail-panel-CLdX0T_A.js";
|
|
8
|
+
import { t as y } from "./chunks/grid-responsive-card-Dx5U6Prm.js";
|
|
9
|
+
import { DataGridElement as b, parseColumnShorthand as x } from "@toolbox-web/grid";
|
|
10
|
+
import { Component as S, createContext as C, createElement as ee, forwardRef as w, useCallback as T, useContext as E, useEffect as D, useId as O, useImperativeHandle as te, useLayoutEffect as ne, useMemo as k, useReducer as A, useRef as j, useState as M } from "react";
|
|
11
|
+
import { Fragment as N, jsx as P, jsxs as re } from "react/jsx-runtime";
|
|
12
|
+
import { createPortal as F, flushSync as I } from "react-dom";
|
|
13
|
+
import { createPluginsFromFeatures as L } from "@toolbox-web/grid/features/registry";
|
|
14
|
+
//#region libs/grid-react/src/lib/column-shorthand.ts
|
|
15
|
+
function R(e) {
|
|
16
|
+
let { field: t, header: n, type: r } = x(e);
|
|
17
|
+
return r === void 0 ? {
|
|
18
|
+
field: t,
|
|
19
|
+
header: n
|
|
20
|
+
} : {
|
|
21
|
+
field: t,
|
|
22
|
+
header: n,
|
|
23
|
+
type: r
|
|
24
|
+
};
|
|
19
25
|
}
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
return _.size === 0 || ve.forEach(t, (l) => {
|
|
23
|
-
if (!we(l)) return;
|
|
24
|
-
const n = l.type, c = typeof n == "string" ? void 0 : n?.displayName;
|
|
25
|
-
if (typeof c != "string") return;
|
|
26
|
-
const d = _.get(c);
|
|
27
|
-
if (!d) return;
|
|
28
|
-
const f = d(l);
|
|
29
|
-
f && Object.assign(r, f);
|
|
30
|
-
}), r;
|
|
26
|
+
function z(e) {
|
|
27
|
+
return e.map((e) => typeof e == "string" ? R(e) : e);
|
|
31
28
|
}
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
function B(e, t) {
|
|
30
|
+
return t ? e.map((e) => ({
|
|
31
|
+
...t,
|
|
32
|
+
...e
|
|
33
|
+
})) : e;
|
|
35
34
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
35
|
+
function V(e) {
|
|
36
|
+
return e.some((e) => typeof e == "string");
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return k(W);
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region libs/grid-react/src/lib/event-props.ts
|
|
40
|
+
var H = {
|
|
41
|
+
onCellClick: "cell-click",
|
|
42
|
+
onRowClick: "row-click",
|
|
43
|
+
onCellActivate: "cell-activate",
|
|
44
|
+
onCellChange: "cell-change",
|
|
45
|
+
onCellCommit: "cell-commit",
|
|
46
|
+
onCellCancel: "cell-cancel",
|
|
47
|
+
onRowCommit: "row-commit",
|
|
48
|
+
onChangedRowsReset: "changed-rows-reset",
|
|
49
|
+
onEditOpen: "edit-open",
|
|
50
|
+
onBeforeEditClose: "before-edit-close",
|
|
51
|
+
onEditClose: "edit-close",
|
|
52
|
+
onDirtyChange: "dirty-change",
|
|
53
|
+
onDataChange: "data-change",
|
|
54
|
+
onSortChange: "sort-change",
|
|
55
|
+
onFilterChange: "filter-change",
|
|
56
|
+
onColumnResize: "column-resize",
|
|
57
|
+
onColumnResizeReset: "column-resize-reset",
|
|
58
|
+
onColumnMove: "column-move",
|
|
59
|
+
onColumnVisibility: "column-visibility",
|
|
60
|
+
onColumnStateChange: "column-state-change",
|
|
61
|
+
onSelectionChange: "selection-change",
|
|
62
|
+
onRowMove: "row-move",
|
|
63
|
+
onRowDragStart: "row-drag-start",
|
|
64
|
+
onRowDragEnd: "row-drag-end",
|
|
65
|
+
onRowDrop: "row-drop",
|
|
66
|
+
onRowTransfer: "row-transfer",
|
|
67
|
+
onGroupToggle: "group-toggle",
|
|
68
|
+
onGroupExpand: "group-expand",
|
|
69
|
+
onGroupCollapse: "group-collapse",
|
|
70
|
+
onTreeExpand: "tree-expand",
|
|
71
|
+
onDetailExpand: "detail-expand",
|
|
72
|
+
onResponsiveChange: "responsive-change",
|
|
73
|
+
onContextMenuOpen: "context-menu-open",
|
|
74
|
+
onCopy: "copy",
|
|
75
|
+
onPaste: "paste",
|
|
76
|
+
onPasteRejected: "paste-rejected",
|
|
77
|
+
onUndo: "undo",
|
|
78
|
+
onRedo: "redo",
|
|
79
|
+
onExportComplete: "export-complete",
|
|
80
|
+
onPrintStart: "print-start",
|
|
81
|
+
onPrintComplete: "print-complete",
|
|
82
|
+
onTbwScroll: "tbw-scroll",
|
|
83
|
+
onRender: "render"
|
|
84
|
+
}, U = C(null), W = ({ icons: e, children: t }) => /* @__PURE__ */ P(U.Provider, {
|
|
85
|
+
value: e,
|
|
86
|
+
children: t
|
|
87
|
+
});
|
|
88
|
+
function G() {
|
|
89
|
+
return E(U);
|
|
92
90
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
var ie = U, K = C(null), q = ({ defaults: e, children: t }) => /* @__PURE__ */ P(K.Provider, {
|
|
92
|
+
value: e,
|
|
93
|
+
children: t
|
|
94
|
+
});
|
|
95
|
+
function J() {
|
|
96
|
+
return E(K);
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
-
|
|
98
|
+
function Y(e) {
|
|
99
|
+
return E(K)?.[e];
|
|
99
100
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
101
|
+
var ae = K, X = class extends S {
|
|
102
|
+
state = { failed: !1 };
|
|
103
|
+
static getDerivedStateFromError() {
|
|
104
|
+
return { failed: !0 };
|
|
105
|
+
}
|
|
106
|
+
componentDidCatch(e) {
|
|
107
|
+
this.props.onError(this.props.portalKey, e);
|
|
108
|
+
}
|
|
109
|
+
render() {
|
|
110
|
+
return this.state.failed ? null : this.props.children;
|
|
111
|
+
}
|
|
112
|
+
}, oe = w(function(e, t) {
|
|
113
|
+
let n = j(/* @__PURE__ */ new Map()), [, r] = A((e) => e + 1, 0), i = j(!1), a = j(0), o = j(0), s = j(!1), c = j(!1), l = () => {
|
|
114
|
+
i.current || (i.current = !0, queueMicrotask(() => {
|
|
115
|
+
i.current = !1, !c.current && (I(r), u());
|
|
116
|
+
}));
|
|
117
|
+
}, u = () => {
|
|
118
|
+
a.current ||= requestAnimationFrame(() => {
|
|
119
|
+
a.current = 0, !c.current && r();
|
|
120
|
+
});
|
|
121
|
+
}, d = (e, t) => {
|
|
122
|
+
console.error(`[grid-react] Portal "${e}" crashed; dropping.`, t), n.current.delete(e), u();
|
|
123
|
+
};
|
|
124
|
+
te(t, () => ({
|
|
125
|
+
renderPortal(e, t, r) {
|
|
126
|
+
c.current || (n.current.set(e, {
|
|
127
|
+
container: t,
|
|
128
|
+
element: r
|
|
129
|
+
}), l());
|
|
130
|
+
},
|
|
131
|
+
removePortal(e, t) {
|
|
132
|
+
if (c.current) {
|
|
133
|
+
n.current.delete(e);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
n.current.delete(e) && (o.current > 0 ? s.current = !0 : t ? I(r) : l());
|
|
137
|
+
},
|
|
138
|
+
beginBatch() {
|
|
139
|
+
o.current++;
|
|
140
|
+
},
|
|
141
|
+
endBatch() {
|
|
142
|
+
o.current !== 0 && (o.current--, o.current === 0 && s.current && (s.current = !1, r()));
|
|
143
|
+
},
|
|
144
|
+
clear() {
|
|
145
|
+
if (c.current) {
|
|
146
|
+
n.current.clear();
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
n.current.size > 0 && (n.current.clear(), a.current &&= (cancelAnimationFrame(a.current), 0), l());
|
|
150
|
+
}
|
|
151
|
+
}), []), ne(() => {
|
|
152
|
+
c.current = !1;
|
|
153
|
+
let e = n.current;
|
|
154
|
+
return () => {
|
|
155
|
+
c.current = !0, a.current &&= (cancelAnimationFrame(a.current), 0), e.clear();
|
|
156
|
+
};
|
|
157
|
+
}, []);
|
|
158
|
+
let f = [], p = null;
|
|
159
|
+
for (let [e, { container: t, element: r }] of n.current) {
|
|
160
|
+
if (!t.isConnected) {
|
|
161
|
+
(p ??= []).push(e);
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
f.push(F(/* @__PURE__ */ P(X, {
|
|
165
|
+
portalKey: e,
|
|
166
|
+
onError: d,
|
|
167
|
+
children: r
|
|
168
|
+
}), t, e));
|
|
169
|
+
}
|
|
170
|
+
if (p) {
|
|
171
|
+
let e = p;
|
|
172
|
+
queueMicrotask(() => {
|
|
173
|
+
for (let t of e) n.current.delete(t);
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
return /* @__PURE__ */ P(N, { children: f });
|
|
177
|
+
});
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region libs/grid-react/src/lib/row-diff.ts
|
|
180
|
+
function se(e, t, n) {
|
|
181
|
+
if (t.length === 0 || e.length !== t.length) return null;
|
|
182
|
+
let r = [];
|
|
183
|
+
for (let i = 0; i < e.length; i++) {
|
|
184
|
+
let a = e[i], o = t[i], s = n(a);
|
|
185
|
+
if (s !== n(o)) return null;
|
|
186
|
+
o !== a && r.push({
|
|
187
|
+
id: s,
|
|
188
|
+
changes: a
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
return r;
|
|
112
192
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}, v = () => {
|
|
119
|
-
f.current || (f.current = requestAnimationFrame(() => {
|
|
120
|
-
f.current = 0, !g.current && c();
|
|
121
|
-
}));
|
|
122
|
-
}, G = (y, s) => {
|
|
123
|
-
console.error(`[grid-react] Portal "${y}" crashed; dropping.`, s), n.current.delete(y), v();
|
|
124
|
-
};
|
|
125
|
-
fe(
|
|
126
|
-
l,
|
|
127
|
-
() => ({
|
|
128
|
-
renderPortal(y, s, p) {
|
|
129
|
-
g.current || (n.current.set(y, { container: s, element: p }), C());
|
|
130
|
-
},
|
|
131
|
-
removePortal(y, s) {
|
|
132
|
-
if (g.current) {
|
|
133
|
-
n.current.delete(y);
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
n.current.delete(y) && (u.current > 0 ? m.current = !0 : s ? oe(c) : C());
|
|
137
|
-
},
|
|
138
|
-
beginBatch() {
|
|
139
|
-
u.current++;
|
|
140
|
-
},
|
|
141
|
-
endBatch() {
|
|
142
|
-
u.current !== 0 && (u.current--, u.current === 0 && m.current && (m.current = !1, c()));
|
|
143
|
-
},
|
|
144
|
-
clear() {
|
|
145
|
-
if (g.current) {
|
|
146
|
-
n.current.clear();
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
n.current.size > 0 && (n.current.clear(), f.current && (cancelAnimationFrame(f.current), f.current = 0), C());
|
|
150
|
-
}
|
|
151
|
-
}),
|
|
152
|
-
// forceRender is stable (useReducer dispatch), refs are stable
|
|
153
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
154
|
-
[]
|
|
155
|
-
), de(() => {
|
|
156
|
-
g.current = !1;
|
|
157
|
-
const y = n.current;
|
|
158
|
-
return () => {
|
|
159
|
-
g.current = !0, f.current && (cancelAnimationFrame(f.current), f.current = 0), y.clear();
|
|
160
|
-
};
|
|
161
|
-
}, []);
|
|
162
|
-
const w = [];
|
|
163
|
-
let F = null;
|
|
164
|
-
for (const [y, { container: s, element: p }] of n.current) {
|
|
165
|
-
if (!s.isConnected) {
|
|
166
|
-
(F ??= []).push(y);
|
|
167
|
-
continue;
|
|
168
|
-
}
|
|
169
|
-
w.push(
|
|
170
|
-
De(
|
|
171
|
-
/* @__PURE__ */ S(ze, { portalKey: y, onError: G, children: p }),
|
|
172
|
-
s,
|
|
173
|
-
y
|
|
174
|
-
)
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
if (F) {
|
|
178
|
-
const y = F;
|
|
179
|
-
queueMicrotask(() => {
|
|
180
|
-
for (const s of y) n.current.delete(s);
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
return /* @__PURE__ */ S(U, { children: w });
|
|
184
|
-
}), He = {
|
|
185
|
-
undoRedo: ["editing"],
|
|
186
|
-
clipboard: ["selection"]
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region libs/grid-react/src/lib/use-sync-plugins.ts
|
|
195
|
+
var Z = {
|
|
196
|
+
undoRedo: ["editing"],
|
|
197
|
+
clipboard: ["selection"]
|
|
187
198
|
};
|
|
188
|
-
function
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
r.has(c) || console.warn(
|
|
195
|
-
`[DataGrid] Feature "${l}" requires "${c}" to be enabled. Add the "${c}" prop to your DataGrid.`
|
|
196
|
-
);
|
|
197
|
-
}
|
|
199
|
+
function ce(e) {
|
|
200
|
+
let t = new Set(e);
|
|
201
|
+
for (let n of e) {
|
|
202
|
+
let e = Z[n];
|
|
203
|
+
if (e) for (let r of e) t.has(r) || console.warn(`[DataGrid] Feature "${n}" requires "${r}" to be enabled. Add the "${r}" prop to your DataGrid.`);
|
|
204
|
+
}
|
|
198
205
|
}
|
|
199
|
-
function
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return qe(r), Me(t);
|
|
206
|
+
function le(e) {
|
|
207
|
+
let t = [];
|
|
208
|
+
for (let [n, r] of Object.entries(e)) r === void 0 || r === !1 || t.push(n);
|
|
209
|
+
return ce(t), L(e);
|
|
204
210
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region libs/grid-react/src/lib/data-grid.tsx
|
|
213
|
+
var ue = !1, Q = null;
|
|
214
|
+
function $() {
|
|
215
|
+
return ue ||= (Q = new c(), b.registerAdapter(Q), !0), Q;
|
|
208
216
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
return r === void 0 && (r = ++Ve, se.set(t, r)), r;
|
|
217
|
+
$();
|
|
218
|
+
var de = /* @__PURE__ */ new WeakMap(), fe = 0;
|
|
219
|
+
function pe(e) {
|
|
220
|
+
let t = de.get(e);
|
|
221
|
+
return t === void 0 && (t = ++fe, de.set(e, t)), t;
|
|
215
222
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
const i = e;
|
|
414
|
-
L && (i.gridConfig = L), n && (i.rows = n), I && (i.columns = I);
|
|
415
|
-
}
|
|
416
|
-
},
|
|
417
|
-
class: F,
|
|
418
|
-
style: y
|
|
419
|
-
},
|
|
420
|
-
/* @__PURE__ */ S($.Provider, { value: o, children: s })
|
|
421
|
-
)
|
|
422
|
-
] });
|
|
223
|
+
a("GridDetailPanel", (e) => {
|
|
224
|
+
let t = e.props;
|
|
225
|
+
return { masterDetail: {
|
|
226
|
+
showExpandColumn: t.showExpandColumn ?? !0,
|
|
227
|
+
animation: t.animation ?? "slide"
|
|
228
|
+
} };
|
|
229
|
+
}), a("GridResponsiveCard", () => ({ responsive: !0 }));
|
|
230
|
+
var me = w(function(e, t) {
|
|
231
|
+
let { rows: r, gridConfig: i, columns: a, columnDefaults: o, fitMode: s, columnInference: c, sortable: u, filterable: d, selectable: p, loading: h, customStyles: v, className: y, style: x, children: S, plugins: C, onRowsChange: w, ...T } = e, O = j(null), A = j(null), M = j(!1), F = j([]), I = j(void 0), L = E(ae), R = E(ie), V = k(() => {
|
|
232
|
+
let e = {}, t = T;
|
|
233
|
+
for (let n of l()) {
|
|
234
|
+
let r = t[n];
|
|
235
|
+
r !== void 0 && (e[n] = r);
|
|
236
|
+
}
|
|
237
|
+
return e;
|
|
238
|
+
}, [k(() => l().map((e) => {
|
|
239
|
+
let t = T[e];
|
|
240
|
+
if (t === void 0) return "";
|
|
241
|
+
let n;
|
|
242
|
+
try {
|
|
243
|
+
n = JSON.stringify(t) ?? "undefined";
|
|
244
|
+
} catch {
|
|
245
|
+
n = typeof t == "object" && t ? `ref#${pe(t)}` : `prim:${String(t)}`;
|
|
246
|
+
}
|
|
247
|
+
return `${e}:${n}`;
|
|
248
|
+
}).filter(Boolean).join("|"), [T])]), U = k(() => n(S), [S]), W = k(() => {
|
|
249
|
+
let e = i?.features, t = {};
|
|
250
|
+
for (let [n, r] of Object.entries(U)) e && n in e && e[n] !== void 0 && e[n] !== !1 || (t[n] = r);
|
|
251
|
+
return {
|
|
252
|
+
...t,
|
|
253
|
+
...V
|
|
254
|
+
};
|
|
255
|
+
}, [
|
|
256
|
+
V,
|
|
257
|
+
U,
|
|
258
|
+
i
|
|
259
|
+
]), G = k(() => C ? [] : le(W), [W, C]), K = k(() => {
|
|
260
|
+
if (C) {
|
|
261
|
+
let e = new Set(C.map((e) => e.name)), t = G.filter((t) => !e.has(t.name));
|
|
262
|
+
return [...C, ...t];
|
|
263
|
+
}
|
|
264
|
+
return G;
|
|
265
|
+
}, [C, G]), q = k(() => a && B(z(a), o), [a, o]), J = k(() => {
|
|
266
|
+
let e = g(i), t = {};
|
|
267
|
+
if (u !== void 0 && (t.sortable = u), d !== void 0 && (t.filterable = d), p !== void 0 && (t.selectable = p), R) {
|
|
268
|
+
let n = e?.icons || i?.icons || {};
|
|
269
|
+
t.icons = {
|
|
270
|
+
...R,
|
|
271
|
+
...n
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
if (K.length > 0 && e) {
|
|
275
|
+
let n = e.plugins || [], r = new Set(n.map((e) => e.name)), i = K.filter((e) => !r.has(e.name));
|
|
276
|
+
return {
|
|
277
|
+
...e,
|
|
278
|
+
...t,
|
|
279
|
+
plugins: [...n, ...i]
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
return K.length > 0 && !e ? {
|
|
283
|
+
...t,
|
|
284
|
+
plugins: K
|
|
285
|
+
} : Object.keys(t).length > 0 ? {
|
|
286
|
+
...e,
|
|
287
|
+
...t
|
|
288
|
+
} : e;
|
|
289
|
+
}, [
|
|
290
|
+
i,
|
|
291
|
+
K,
|
|
292
|
+
u,
|
|
293
|
+
d,
|
|
294
|
+
p,
|
|
295
|
+
R
|
|
296
|
+
]);
|
|
297
|
+
D(() => {
|
|
298
|
+
I.current = J?.getRowId;
|
|
299
|
+
}, [J]), D(() => {
|
|
300
|
+
$().setTypeDefaults(L);
|
|
301
|
+
}, [L]), D(() => {
|
|
302
|
+
let e = O.current;
|
|
303
|
+
if (!e) return;
|
|
304
|
+
let t = I.current, n = t ? se(r, F.current, t) : null;
|
|
305
|
+
if (F.current = r, n !== null) {
|
|
306
|
+
if (n.length > 0) try {
|
|
307
|
+
e.updateRows(n, "sync");
|
|
308
|
+
} catch {
|
|
309
|
+
e.rows = r;
|
|
310
|
+
}
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
e.rows = r;
|
|
314
|
+
}, [r]), D(() => {
|
|
315
|
+
O.current && J && (O.current.gridConfig = J);
|
|
316
|
+
}, [J]), D(() => {
|
|
317
|
+
O.current && q && (O.current.columns = q);
|
|
318
|
+
}, [q]), D(() => {
|
|
319
|
+
O.current && s !== void 0 && (O.current.fitMode = s);
|
|
320
|
+
}, [s]), D(() => {
|
|
321
|
+
O.current && (O.current.columnInference = c);
|
|
322
|
+
}, [c]), D(() => {
|
|
323
|
+
O.current && h !== void 0 && (O.current.loading = h);
|
|
324
|
+
}, [h]), D(() => {
|
|
325
|
+
let e = O.current;
|
|
326
|
+
if (!e) return;
|
|
327
|
+
e.__frameworkAdapter = $(), m(e);
|
|
328
|
+
let t = !1, n = requestAnimationFrame(() => {
|
|
329
|
+
t || (typeof e.refreshColumns == "function" && e.refreshColumns(), typeof e.refreshShellHeader == "function" && e.refreshShellHeader());
|
|
330
|
+
});
|
|
331
|
+
return () => {
|
|
332
|
+
t = !0, cancelAnimationFrame(n);
|
|
333
|
+
};
|
|
334
|
+
}, []), D(() => {
|
|
335
|
+
if (!O.current || !v) return;
|
|
336
|
+
let e = O.current, t = "react-custom-styles", n = !0;
|
|
337
|
+
return e.ready?.().then(() => {
|
|
338
|
+
n && v && (e.registerStyles?.(t, v), A.current = t);
|
|
339
|
+
}), () => {
|
|
340
|
+
n = !1, A.current &&= (e.unregisterStyles?.(A.current), null);
|
|
341
|
+
};
|
|
342
|
+
}, [v]), D(() => {
|
|
343
|
+
let e = O.current;
|
|
344
|
+
if (!e) return;
|
|
345
|
+
let t = [];
|
|
346
|
+
return w && t.push(e.on("rows-change", (e) => w(e.rows))), () => {
|
|
347
|
+
t.forEach((e) => e());
|
|
348
|
+
};
|
|
349
|
+
}, [w]);
|
|
350
|
+
let Y = k(() => Object.keys(H).filter((e) => typeof T[e] == "function").sort().join("|"), [T]), X = j({});
|
|
351
|
+
for (let e of Object.keys(H)) X.current[e] = T[e];
|
|
352
|
+
D(() => {
|
|
353
|
+
let e = O.current;
|
|
354
|
+
if (!e) return;
|
|
355
|
+
let t = [];
|
|
356
|
+
for (let [n, r] of Object.entries(H)) Y.includes(n) && t.push(e.on(r, (e, t) => {
|
|
357
|
+
X.current[n]?.(e, t);
|
|
358
|
+
}));
|
|
359
|
+
return () => {
|
|
360
|
+
t.forEach((e) => e());
|
|
361
|
+
};
|
|
362
|
+
}, [Y]), te(t, () => ({
|
|
363
|
+
get element() {
|
|
364
|
+
return O.current;
|
|
365
|
+
},
|
|
366
|
+
async getConfig() {
|
|
367
|
+
return O.current?.getConfig?.() ?? {};
|
|
368
|
+
},
|
|
369
|
+
async ready() {
|
|
370
|
+
return O.current?.ready?.();
|
|
371
|
+
},
|
|
372
|
+
async forceLayout() {
|
|
373
|
+
return O.current?.forceLayout?.();
|
|
374
|
+
},
|
|
375
|
+
async toggleGroup(e) {
|
|
376
|
+
return O.current?.toggleGroup?.(e);
|
|
377
|
+
},
|
|
378
|
+
registerStyles(e, t) {
|
|
379
|
+
O.current?.registerStyles?.(e, t);
|
|
380
|
+
},
|
|
381
|
+
unregisterStyles(e) {
|
|
382
|
+
O.current?.unregisterStyles?.(e);
|
|
383
|
+
},
|
|
384
|
+
setRowLoading(e, t) {
|
|
385
|
+
O.current?.setRowLoading?.(e, t);
|
|
386
|
+
},
|
|
387
|
+
setCellLoading(e, t, n) {
|
|
388
|
+
O.current?.setCellLoading?.(e, t, n);
|
|
389
|
+
},
|
|
390
|
+
isRowLoading(e) {
|
|
391
|
+
return O.current?.isRowLoading?.(e) ?? !1;
|
|
392
|
+
},
|
|
393
|
+
isCellLoading(e, t) {
|
|
394
|
+
return O.current?.isCellLoading?.(e, t) ?? !1;
|
|
395
|
+
},
|
|
396
|
+
clearAllLoading() {
|
|
397
|
+
O.current?.clearAllLoading?.();
|
|
398
|
+
}
|
|
399
|
+
}), []);
|
|
400
|
+
let Z = j(null);
|
|
401
|
+
return ne(() => {
|
|
402
|
+
let e = O.current;
|
|
403
|
+
return e && Z.current && f(e, Z.current), () => {
|
|
404
|
+
e && f(e, null);
|
|
405
|
+
};
|
|
406
|
+
}, []), /* @__PURE__ */ re(N, { children: [/* @__PURE__ */ P(oe, { ref: Z }), ee(b.activeTag, {
|
|
407
|
+
ref: (e) => {
|
|
408
|
+
if (O.current = e, e && !M.current) {
|
|
409
|
+
M.current = !0;
|
|
410
|
+
let t = e;
|
|
411
|
+
J && (t.gridConfig = J), r && (t.rows = r), q && (t.columns = q);
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
class: y,
|
|
415
|
+
style: x
|
|
416
|
+
}, /* @__PURE__ */ P(_.Provider, {
|
|
417
|
+
value: O,
|
|
418
|
+
children: S
|
|
419
|
+
}))] });
|
|
423
420
|
});
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
order: g,
|
|
435
|
-
hidden: C,
|
|
436
|
-
lockVisible: v,
|
|
437
|
-
children: G,
|
|
438
|
-
editor: w,
|
|
439
|
-
options: F,
|
|
440
|
-
multi: y,
|
|
441
|
-
format: s
|
|
442
|
-
} = t, p = b(null), h = E(
|
|
443
|
-
(D) => {
|
|
444
|
-
p.current = D, D && (G && Se(D, G), w && Ee(D, w));
|
|
445
|
-
},
|
|
446
|
-
[G, w]
|
|
447
|
-
), P = typeof u == "number" ? `${u}px` : u, o = {
|
|
448
|
-
field: r,
|
|
449
|
-
ref: h
|
|
450
|
-
};
|
|
451
|
-
return l !== void 0 && (o.header = l), n !== void 0 && (o.type = n), c !== void 0 && (o.editable = c), d !== void 0 && (o.sortable = d), f !== void 0 && (o.resizable = f), P !== void 0 && (o.width = P), m !== void 0 && (o["min-width"] = m), g !== void 0 && (o.order = g), C !== void 0 && (o.hidden = C), v !== void 0 && (o["lock-visible"] = v), y !== void 0 && (o.multi = y), s && (o["data-has-format"] = "true"), F && (o["data-has-options"] = "true"), /* @__PURE__ */ S("tbw-grid-column", { ...o });
|
|
421
|
+
//#endregion
|
|
422
|
+
//#region libs/grid-react/src/lib/grid-column.tsx
|
|
423
|
+
function he(e) {
|
|
424
|
+
let { field: t, header: n, type: r, editable: a, sortable: s, resizable: c, width: l, minWidth: u, order: d, hidden: f, lockVisible: p, children: m, editor: h, options: g, multi: _, format: v } = e, y = j(null), b = T((e) => {
|
|
425
|
+
y.current = e, e && (m && o(e, m), h && i(e, h));
|
|
426
|
+
}, [m, h]), x = typeof l == "number" ? `${l}px` : l, S = {
|
|
427
|
+
field: t,
|
|
428
|
+
ref: b
|
|
429
|
+
};
|
|
430
|
+
return n !== void 0 && (S.header = n), r !== void 0 && (S.type = r), a !== void 0 && (S.editable = a), s !== void 0 && (S.sortable = s), c !== void 0 && (S.resizable = c), x !== void 0 && (S.width = x), u !== void 0 && (S["min-width"] = u), d !== void 0 && (S.order = d), f !== void 0 && (S.hidden = f), p !== void 0 && (S["lock-visible"] = p), _ !== void 0 && (S.multi = _), v && (S["data-has-format"] = "true"), g && (S["data-has-options"] = "true"), /* @__PURE__ */ P("tbw-grid-column", { ...S });
|
|
452
431
|
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
432
|
+
//#endregion
|
|
433
|
+
//#region libs/grid-react/src/lib/grid-header-content.tsx
|
|
434
|
+
function ge({ id: e, order: t = 100, children: n }) {
|
|
435
|
+
let r = O(), i = e ?? `tbw-header-content-${r}`, a = E(_), [o, s] = M(null), c = j(null);
|
|
436
|
+
return D(() => {
|
|
437
|
+
let e = a?.current;
|
|
438
|
+
if (!e) return;
|
|
439
|
+
let n = c, r = !1;
|
|
440
|
+
return (async () => {
|
|
441
|
+
try {
|
|
442
|
+
await e.ready?.();
|
|
443
|
+
} catch {
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
if (r) return;
|
|
447
|
+
let n = {
|
|
448
|
+
id: i,
|
|
449
|
+
order: t,
|
|
450
|
+
render: (e) => (s(e), () => {})
|
|
451
|
+
};
|
|
452
|
+
e.getPluginByName?.("shell")?.registerHeaderContent(n);
|
|
453
|
+
})(), () => {
|
|
454
|
+
r = !0, e.getPluginByName?.("shell")?.unregisterHeaderContent(i), n.current &&= (d(n.current, { sync: !0 }), null), s(null);
|
|
455
|
+
};
|
|
456
|
+
}, [
|
|
457
|
+
a,
|
|
458
|
+
i,
|
|
459
|
+
t
|
|
460
|
+
]), D(() => {
|
|
461
|
+
if (!o) return;
|
|
462
|
+
let e = a?.current ?? void 0;
|
|
463
|
+
c.current = u(o, n, c.current ?? void 0, e);
|
|
464
|
+
}, [
|
|
465
|
+
n,
|
|
466
|
+
o,
|
|
467
|
+
a
|
|
468
|
+
]), null;
|
|
482
469
|
}
|
|
483
|
-
|
|
484
|
-
|
|
470
|
+
//#endregion
|
|
471
|
+
//#region libs/grid-react/src/lib/grid-tool-button.tsx
|
|
472
|
+
function _e({ children: e }) {
|
|
473
|
+
return /* @__PURE__ */ P("tbw-grid-tool-buttons", { children: e });
|
|
485
474
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
475
|
+
//#endregion
|
|
476
|
+
//#region libs/grid-react/src/lib/grid-toolbar-content.tsx
|
|
477
|
+
function ve({ id: e, order: t = 100, children: n }) {
|
|
478
|
+
let r = O(), i = e ?? `tbw-toolbar-content-${r}`, a = E(_), [o, s] = M(null), c = j(null);
|
|
479
|
+
return D(() => {
|
|
480
|
+
let e = a?.current;
|
|
481
|
+
if (!e) return;
|
|
482
|
+
let n = c, r = !1;
|
|
483
|
+
return (async () => {
|
|
484
|
+
try {
|
|
485
|
+
await e.ready?.();
|
|
486
|
+
} catch {
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
if (r) return;
|
|
490
|
+
let n = {
|
|
491
|
+
id: i,
|
|
492
|
+
order: t,
|
|
493
|
+
render: (e) => (s(e), () => {})
|
|
494
|
+
};
|
|
495
|
+
e.getPluginByName?.("shell")?.registerToolbarContent(n);
|
|
496
|
+
})(), () => {
|
|
497
|
+
r = !0, e.getPluginByName?.("shell")?.unregisterToolbarContent(i), n.current &&= (d(n.current, { sync: !0 }), null), s(null);
|
|
498
|
+
};
|
|
499
|
+
}, [
|
|
500
|
+
a,
|
|
501
|
+
i,
|
|
502
|
+
t
|
|
503
|
+
]), D(() => {
|
|
504
|
+
if (!o) return;
|
|
505
|
+
let e = a?.current ?? void 0;
|
|
506
|
+
c.current = u(o, n, c.current ?? void 0, e);
|
|
507
|
+
}, [
|
|
508
|
+
n,
|
|
509
|
+
o,
|
|
510
|
+
a
|
|
511
|
+
]), null;
|
|
515
512
|
}
|
|
516
|
-
|
|
517
|
-
|
|
513
|
+
//#endregion
|
|
514
|
+
//#region libs/grid-react/src/lib/grid-type.tsx
|
|
515
|
+
function ye(e) {
|
|
516
|
+
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/_/g, "-").toLowerCase();
|
|
518
517
|
}
|
|
519
|
-
function
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
u[`data-${We(m)}`] = String(g);
|
|
532
|
-
return /* @__PURE__ */ ce("tbw-grid-type", { ...u, children: [
|
|
533
|
-
n ? /* @__PURE__ */ S("tbw-grid-column-view", {}) : null,
|
|
534
|
-
c ? /* @__PURE__ */ S("tbw-grid-column-editor", {}) : null
|
|
535
|
-
] });
|
|
518
|
+
function be(t) {
|
|
519
|
+
let { name: n, params: r, children: i, editor: a } = t, o = j(null), c = {
|
|
520
|
+
name: n,
|
|
521
|
+
ref: T((t) => {
|
|
522
|
+
o.current = t, t && (i && e(t, i), a && s(t, a));
|
|
523
|
+
}, [i, a])
|
|
524
|
+
};
|
|
525
|
+
if (r) for (let [e, t] of Object.entries(r)) c[`data-${ye(e)}`] = String(t);
|
|
526
|
+
return /* @__PURE__ */ re("tbw-grid-type", {
|
|
527
|
+
...c,
|
|
528
|
+
children: [i ? /* @__PURE__ */ P("tbw-grid-column-view", {}) : null, a ? /* @__PURE__ */ P("tbw-grid-column-editor", {}) : null]
|
|
529
|
+
});
|
|
536
530
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
531
|
+
//#endregion
|
|
532
|
+
//#region libs/grid-react/src/lib/grid-provider.tsx
|
|
533
|
+
var xe = ({ icons: e, defaults: t, children: n }) => {
|
|
534
|
+
let r = n;
|
|
535
|
+
return t && (r = /* @__PURE__ */ P(q, {
|
|
536
|
+
defaults: t,
|
|
537
|
+
children: r
|
|
538
|
+
})), e && (r = /* @__PURE__ */ P(W, {
|
|
539
|
+
icons: e,
|
|
540
|
+
children: r
|
|
541
|
+
})), /* @__PURE__ */ P(N, { children: r });
|
|
540
542
|
};
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
), y = E(() => c?.columns ? c.columns.filter((s) => !s.hidden) : [], [c]);
|
|
622
|
-
return {
|
|
623
|
-
ref: r,
|
|
624
|
-
element: u(),
|
|
625
|
-
isReady: l,
|
|
626
|
-
config: c,
|
|
627
|
-
getConfig: m,
|
|
628
|
-
forceLayout: g,
|
|
629
|
-
toggleGroup: C,
|
|
630
|
-
getPlugin: v,
|
|
631
|
-
getPluginByName: G,
|
|
632
|
-
registerStyles: w,
|
|
633
|
-
unregisterStyles: F,
|
|
634
|
-
getVisibleColumns: y
|
|
635
|
-
};
|
|
543
|
+
//#endregion
|
|
544
|
+
//#region libs/grid-react/src/lib/use-grid.ts
|
|
545
|
+
function Se(e) {
|
|
546
|
+
let t = j(null), [n, r] = M(!1), [i, a] = M(null), o = j(null), s = T(() => e ? (o.current ??= document.querySelector(e), o.current) : t.current?.element ?? null, [e]);
|
|
547
|
+
D(() => {
|
|
548
|
+
let n = !0;
|
|
549
|
+
return (async () => {
|
|
550
|
+
try {
|
|
551
|
+
if (e) {
|
|
552
|
+
let t = document.querySelector(e);
|
|
553
|
+
if (!t) return;
|
|
554
|
+
if (o.current = t, await t.ready?.(), n) {
|
|
555
|
+
r(!0);
|
|
556
|
+
let e = await t.getConfig?.();
|
|
557
|
+
n && e && a(e);
|
|
558
|
+
}
|
|
559
|
+
} else {
|
|
560
|
+
let e = t.current;
|
|
561
|
+
if (!e) return;
|
|
562
|
+
if (await e.ready?.(), n) {
|
|
563
|
+
r(!0);
|
|
564
|
+
let t = await e.getConfig?.();
|
|
565
|
+
n && t && a(t);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
} catch {}
|
|
569
|
+
})(), () => {
|
|
570
|
+
n = !1;
|
|
571
|
+
};
|
|
572
|
+
}, [e]);
|
|
573
|
+
let c = T(async () => {
|
|
574
|
+
let e = s();
|
|
575
|
+
if (e) return await e.getConfig?.() ?? null;
|
|
576
|
+
let n = t.current;
|
|
577
|
+
return n ? await n.getConfig?.() ?? null : null;
|
|
578
|
+
}, [s]), l = T(async () => {
|
|
579
|
+
let e = s();
|
|
580
|
+
if (e) {
|
|
581
|
+
await e.forceLayout?.();
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
let n = t.current;
|
|
585
|
+
n && await n.forceLayout?.();
|
|
586
|
+
}, [s]), u = T(async (e) => {
|
|
587
|
+
let n = s();
|
|
588
|
+
if (n) {
|
|
589
|
+
await n.toggleGroup?.(e);
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
let r = t.current;
|
|
593
|
+
r && await r.toggleGroup?.(e);
|
|
594
|
+
}, [s]), d = T((e) => s()?.getPlugin?.(e), [s]), f = T(((e) => s()?.getPluginByName?.(e)), [s]), p = T((e, n) => {
|
|
595
|
+
let r = s();
|
|
596
|
+
if (r) {
|
|
597
|
+
r.registerStyles?.(e, n);
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
t.current?.registerStyles?.(e, n);
|
|
601
|
+
}, [s]), m = T((e) => {
|
|
602
|
+
let n = s();
|
|
603
|
+
if (n) {
|
|
604
|
+
n.unregisterStyles?.(e);
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
t.current?.unregisterStyles?.(e);
|
|
608
|
+
}, [s]), h = T(() => i?.columns ? i.columns.filter((e) => !e.hidden) : [], [i]);
|
|
609
|
+
return {
|
|
610
|
+
ref: t,
|
|
611
|
+
element: s(),
|
|
612
|
+
isReady: n,
|
|
613
|
+
config: i,
|
|
614
|
+
getConfig: c,
|
|
615
|
+
forceLayout: l,
|
|
616
|
+
toggleGroup: u,
|
|
617
|
+
getPlugin: d,
|
|
618
|
+
getPluginByName: f,
|
|
619
|
+
registerStyles: p,
|
|
620
|
+
unregisterStyles: m,
|
|
621
|
+
getVisibleColumns: h
|
|
622
|
+
};
|
|
636
623
|
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
624
|
+
//#endregion
|
|
625
|
+
//#region libs/grid-react/src/lib/use-grid-overlay.ts
|
|
626
|
+
function Ce(e, t = {}) {
|
|
627
|
+
let { open: n = !0, gridElement: r } = t, i = E(_);
|
|
628
|
+
D(() => {
|
|
629
|
+
if (!n) return;
|
|
630
|
+
let t = e.current;
|
|
631
|
+
if (!t) return;
|
|
632
|
+
let a = r ?? t.closest("tbw-grid, [data-tbw-grid]") ?? i?.current ?? null;
|
|
633
|
+
if (a) return a.registerExternalFocusContainer?.(t), () => {
|
|
634
|
+
a.unregisterExternalFocusContainer?.(t);
|
|
635
|
+
};
|
|
636
|
+
}, [
|
|
637
|
+
n,
|
|
638
|
+
r,
|
|
639
|
+
i,
|
|
640
|
+
e
|
|
641
|
+
]);
|
|
649
642
|
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
Ge as GridAdapter,
|
|
653
|
-
lr as GridColumn,
|
|
654
|
-
xr as GridDetailPanel,
|
|
655
|
-
fr as GridHeaderContent,
|
|
656
|
-
$e as GridIconProvider,
|
|
657
|
-
mr as GridProvider,
|
|
658
|
-
Dr as GridResponsiveCard,
|
|
659
|
-
dr as GridToolButtons,
|
|
660
|
-
wr as GridToolPanel,
|
|
661
|
-
gr as GridToolbarContent,
|
|
662
|
-
pr as GridType,
|
|
663
|
-
Oe as GridTypeProvider,
|
|
664
|
-
Ae as applyColumnDefaults,
|
|
665
|
-
ir as hasColumnShorthands,
|
|
666
|
-
Ne as normalizeColumns,
|
|
667
|
-
Le as parseColumnShorthand,
|
|
668
|
-
ye as registerChildFeatureDetector,
|
|
669
|
-
Sr as registerEditorMountHook,
|
|
670
|
-
Rr as registerFeaturePropKey,
|
|
671
|
-
Pr as registerPostMountRefresh,
|
|
672
|
-
yr as useGrid,
|
|
673
|
-
sr as useGridIcons,
|
|
674
|
-
hr as useGridOverlay,
|
|
675
|
-
cr as useGridTypeDefaults,
|
|
676
|
-
ur as useTypeDefault
|
|
677
|
-
};
|
|
643
|
+
//#endregion
|
|
644
|
+
export { me as DataGrid, c as GridAdapter, he as GridColumn, v as GridDetailPanel, ge as GridHeaderContent, W as GridIconProvider, xe as GridProvider, y as GridResponsiveCard, _e as GridToolButtons, r as GridToolPanel, ve as GridToolbarContent, be as GridType, q as GridTypeProvider, B as applyColumnDefaults, V as hasColumnShorthands, z as normalizeColumns, R as parseColumnShorthand, a as registerChildFeatureDetector, h as registerEditorMountHook, t as registerFeaturePropKey, p as registerPostMountRefresh, Se as useGrid, G as useGridIcons, Ce as useGridOverlay, J as useGridTypeDefaults, Y as useTypeDefault };
|