@toolbox-web/grid-react 1.1.1 → 1.3.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/README.md +7 -31
- package/features/index.d.ts.map +1 -1
- package/features/index.js +1 -0
- package/features/row-drag-drop.d.ts +1 -0
- package/features/row-drag-drop.d.ts.map +1 -0
- package/index.js +311 -285
- package/lib/data-grid.d.ts.map +1 -1
- package/lib/event-props.d.ts +27 -1
- package/lib/event-props.d.ts.map +1 -1
- package/lib/feature-props.d.ts +19 -1
- package/lib/feature-props.d.ts.map +1 -1
- package/lib/react-grid-adapter.d.ts +9 -0
- package/lib/react-grid-adapter.d.ts.map +1 -1
- package/lib/use-grid.d.ts +7 -0
- package/lib/use-grid.d.ts.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as b, Fragment as ne, jsxs as Pe } from "react/jsx-runtime";
|
|
2
2
|
import { DataGridElement as be } from "@toolbox-web/grid";
|
|
3
|
-
import { createContext as
|
|
3
|
+
import { createContext as ye, useContext as O, useRef as k, useCallback as E, useEffect as P, forwardRef as he, useReducer as Ee, useImperativeHandle as Re, useMemo as S, useLayoutEffect as ke, Children as Se, isValidElement as De, useState as fe } from "react";
|
|
4
4
|
import { a as w, r as H, s as ge } from "./chunks/portal-bridge-DZ4yQkmm.js";
|
|
5
|
-
import { flushSync as
|
|
5
|
+
import { flushSync as V, createPortal as Ge } from "react-dom";
|
|
6
6
|
import { createPluginsFromFeatures as Ae } from "@toolbox-web/grid/features/registry";
|
|
7
7
|
import { G as Te } from "./chunks/grid-element-context-BU3WvNtM.js";
|
|
8
8
|
function xe(n) {
|
|
@@ -33,7 +33,7 @@ function Ne(n) {
|
|
|
33
33
|
function Fe(n) {
|
|
34
34
|
return n.map((e) => typeof e == "string" ? Ne(e) : e);
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const W = {
|
|
37
37
|
onCellClick: "cell-click",
|
|
38
38
|
onRowClick: "row-click",
|
|
39
39
|
onCellActivate: "cell-activate",
|
|
@@ -49,6 +49,10 @@ const B = {
|
|
|
49
49
|
onColumnStateChange: "column-state-change",
|
|
50
50
|
onSelectionChange: "selection-change",
|
|
51
51
|
onRowMove: "row-move",
|
|
52
|
+
onRowDragStart: "row-drag-start",
|
|
53
|
+
onRowDragEnd: "row-drag-end",
|
|
54
|
+
onRowDrop: "row-drop",
|
|
55
|
+
onRowTransfer: "row-transfer",
|
|
52
56
|
onGroupToggle: "group-toggle",
|
|
53
57
|
onTreeExpand: "tree-expand",
|
|
54
58
|
onDetailExpand: "detail-expand",
|
|
@@ -60,12 +64,12 @@ const B = {
|
|
|
60
64
|
onPrintStart: "print-start",
|
|
61
65
|
onPrintComplete: "print-complete",
|
|
62
66
|
onTbwScroll: "tbw-scroll"
|
|
63
|
-
}, oe =
|
|
67
|
+
}, oe = ye(null), Ie = ({ icons: n, children: e }) => /* @__PURE__ */ b(oe.Provider, { value: n, children: e });
|
|
64
68
|
function pt() {
|
|
65
69
|
return O(oe);
|
|
66
70
|
}
|
|
67
71
|
const Le = oe, Y = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new Map();
|
|
68
|
-
function
|
|
72
|
+
function ve(n) {
|
|
69
73
|
const e = n.querySelector("tbw-grid-responsive-card");
|
|
70
74
|
if (e) {
|
|
71
75
|
const r = Y.get(e);
|
|
@@ -76,14 +80,14 @@ function Ce(n) {
|
|
|
76
80
|
return Z.get(t);
|
|
77
81
|
}
|
|
78
82
|
function Me(n) {
|
|
79
|
-
const { children: e, cardRowHeight: t = "auto" } = n, r =
|
|
83
|
+
const { children: e, cardRowHeight: t = "auto" } = n, r = k(null), o = E(
|
|
80
84
|
(c) => {
|
|
81
85
|
if (r.current = c, !c) return;
|
|
82
86
|
Y.set(c, e);
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
+
const s = c.closest("tbw-grid");
|
|
88
|
+
if (s) {
|
|
89
|
+
const g = s.id || s.getAttribute("data-grid-id");
|
|
90
|
+
g && Z.set(g, e);
|
|
87
91
|
}
|
|
88
92
|
},
|
|
89
93
|
[e]
|
|
@@ -92,49 +96,49 @@ function Me(n) {
|
|
|
92
96
|
const c = r.current;
|
|
93
97
|
if (c) {
|
|
94
98
|
Y.delete(c);
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
+
const s = c.closest("tbw-grid");
|
|
100
|
+
if (s) {
|
|
101
|
+
const g = s.id || s.getAttribute("data-grid-id");
|
|
102
|
+
g && Z.delete(g);
|
|
99
103
|
}
|
|
100
104
|
}
|
|
101
105
|
}, []);
|
|
102
|
-
const
|
|
103
|
-
return /* @__PURE__ */ b("tbw-grid-responsive-card", { ref: o, cardRowHeight:
|
|
106
|
+
const a = t === "auto" ? "auto" : String(t);
|
|
107
|
+
return /* @__PURE__ */ b("tbw-grid-responsive-card", { ref: o, cardRowHeight: a });
|
|
104
108
|
}
|
|
105
109
|
Me.displayName = "GridResponsiveCard";
|
|
106
|
-
const z =
|
|
107
|
-
function
|
|
110
|
+
const z = ye(null), He = ({ defaults: n, children: e }) => /* @__PURE__ */ b(z.Provider, { value: n, children: e });
|
|
111
|
+
function mt() {
|
|
108
112
|
return O(z);
|
|
109
113
|
}
|
|
110
|
-
function
|
|
114
|
+
function yt(n) {
|
|
111
115
|
return O(z)?.[n];
|
|
112
116
|
}
|
|
113
117
|
const Oe = z, je = he(function(e, t) {
|
|
114
|
-
const r =
|
|
115
|
-
|
|
116
|
-
|
|
118
|
+
const r = k(/* @__PURE__ */ new Map()), [, o] = Ee((p) => p + 1, 0), a = k(!1), c = k(0), s = () => {
|
|
119
|
+
a.current || (a.current = !0, queueMicrotask(() => {
|
|
120
|
+
a.current = !1, V(o), g();
|
|
117
121
|
}));
|
|
118
|
-
},
|
|
122
|
+
}, g = () => {
|
|
119
123
|
c.current || (c.current = requestAnimationFrame(() => {
|
|
120
124
|
c.current = 0;
|
|
121
|
-
let
|
|
122
|
-
for (const [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
let p = !1;
|
|
126
|
+
for (const [v, C] of r.current)
|
|
127
|
+
C.container.isConnected || (r.current.delete(v), p = !0);
|
|
128
|
+
p && V(o);
|
|
125
129
|
}));
|
|
126
130
|
};
|
|
127
|
-
|
|
131
|
+
Re(
|
|
128
132
|
t,
|
|
129
133
|
() => ({
|
|
130
|
-
renderPortal(
|
|
131
|
-
r.current.set(
|
|
134
|
+
renderPortal(p, v, C) {
|
|
135
|
+
r.current.set(p, { container: v, element: C }), s();
|
|
132
136
|
},
|
|
133
|
-
removePortal(
|
|
134
|
-
r.current.delete(
|
|
137
|
+
removePortal(p, v) {
|
|
138
|
+
r.current.delete(p) && (v ? V(o) : s());
|
|
135
139
|
},
|
|
136
140
|
clear() {
|
|
137
|
-
r.current.size > 0 && (r.current.clear(), c.current && (cancelAnimationFrame(c.current), c.current = 0),
|
|
141
|
+
r.current.size > 0 && (r.current.clear(), c.current && (cancelAnimationFrame(c.current), c.current = 0), s());
|
|
138
142
|
}
|
|
139
143
|
}),
|
|
140
144
|
// forceRender is stable (useReducer dispatch), refs are stable
|
|
@@ -142,14 +146,14 @@ const Oe = z, je = he(function(e, t) {
|
|
|
142
146
|
[]
|
|
143
147
|
);
|
|
144
148
|
const d = [];
|
|
145
|
-
for (const [
|
|
146
|
-
d.push(Ge(
|
|
149
|
+
for (const [p, { container: v, element: C }] of r.current)
|
|
150
|
+
d.push(Ge(C, v, p));
|
|
147
151
|
return /* @__PURE__ */ b(ne, { children: d });
|
|
148
|
-
}), U = /* @__PURE__ */ Symbol("reactProcessed"),
|
|
152
|
+
}), U = /* @__PURE__ */ Symbol("reactProcessed"), D = [];
|
|
149
153
|
function ze(n) {
|
|
150
|
-
for (let e =
|
|
151
|
-
const t =
|
|
152
|
-
n.contains(t.container) && t.container.classList.contains("react-cell-editor") && (H(t.key),
|
|
154
|
+
for (let e = D.length - 1; e >= 0; e--) {
|
|
155
|
+
const t = D[e];
|
|
156
|
+
n.contains(t.container) && t.container.classList.contains("react-cell-editor") && (H(t.key), D.splice(e, 1));
|
|
153
157
|
}
|
|
154
158
|
}
|
|
155
159
|
function qe(n) {
|
|
@@ -163,8 +167,8 @@ function qe(n) {
|
|
|
163
167
|
}
|
|
164
168
|
const o = document.createElement("div");
|
|
165
169
|
o.className = "react-cell-renderer", o.style.display = "contents";
|
|
166
|
-
const
|
|
167
|
-
return r && e.set(r, { portalKey:
|
|
170
|
+
const a = w(o, n(t));
|
|
171
|
+
return r && e.set(r, { portalKey: a, container: o }), D.push({ key: a, container: o }), o;
|
|
168
172
|
};
|
|
169
173
|
}
|
|
170
174
|
function _e(n) {
|
|
@@ -172,7 +176,7 @@ function _e(n) {
|
|
|
172
176
|
const t = document.createElement("div");
|
|
173
177
|
t.className = "react-cell-editor", t.style.display = "contents";
|
|
174
178
|
const r = w(t, n(e));
|
|
175
|
-
return
|
|
179
|
+
return D.push({ key: r, container: t }), t;
|
|
176
180
|
};
|
|
177
181
|
}
|
|
178
182
|
function $e(n) {
|
|
@@ -180,18 +184,18 @@ function $e(n) {
|
|
|
180
184
|
const t = document.createElement("div");
|
|
181
185
|
t.className = "react-header-renderer", t.style.display = "contents";
|
|
182
186
|
const r = w(t, n(e));
|
|
183
|
-
return
|
|
187
|
+
return D.push({ key: r, container: t }), t;
|
|
184
188
|
};
|
|
185
189
|
}
|
|
186
|
-
function
|
|
190
|
+
function Be(n) {
|
|
187
191
|
return (e) => {
|
|
188
192
|
const t = document.createElement("div");
|
|
189
193
|
t.className = "react-header-label-renderer", t.style.display = "contents";
|
|
190
194
|
const r = w(t, n(e));
|
|
191
|
-
return
|
|
195
|
+
return D.push({ key: r, container: t }), t;
|
|
192
196
|
};
|
|
193
197
|
}
|
|
194
|
-
function
|
|
198
|
+
function Ve(n) {
|
|
195
199
|
return (e) => {
|
|
196
200
|
const t = n(e);
|
|
197
201
|
if (t instanceof HTMLElement || typeof t == "string")
|
|
@@ -199,17 +203,17 @@ function We(n) {
|
|
|
199
203
|
const r = document.createElement("div");
|
|
200
204
|
r.className = "react-loading-renderer", r.style.display = "contents";
|
|
201
205
|
const o = w(r, t);
|
|
202
|
-
return
|
|
206
|
+
return D.push({ key: o, container: r }), r;
|
|
203
207
|
};
|
|
204
208
|
}
|
|
205
|
-
function
|
|
209
|
+
function Ce(n) {
|
|
206
210
|
if (!n) return;
|
|
207
211
|
if (n[U]) return n;
|
|
208
212
|
if (n.loadingRenderer && typeof n.loadingRenderer == "function") {
|
|
209
213
|
const r = n.loadingRenderer;
|
|
210
214
|
n = {
|
|
211
215
|
...n,
|
|
212
|
-
loadingRenderer:
|
|
216
|
+
loadingRenderer: Ve(r)
|
|
213
217
|
};
|
|
214
218
|
}
|
|
215
219
|
if (!n.columns) {
|
|
@@ -217,8 +221,8 @@ function Re(n) {
|
|
|
217
221
|
return r[U] = !0, r;
|
|
218
222
|
}
|
|
219
223
|
const e = n.columns.map((r) => {
|
|
220
|
-
const { renderer: o, editor:
|
|
221
|
-
return o && (d.renderer = qe(o)),
|
|
224
|
+
const { renderer: o, editor: a, headerRenderer: c, headerLabelRenderer: s, ...g } = r, d = { ...g };
|
|
225
|
+
return o && (d.renderer = qe(o)), a && (d.editor = _e(a)), c && (d.headerRenderer = $e(c)), s && (d.headerLabelRenderer = Be(s)), d;
|
|
222
226
|
}), t = {
|
|
223
227
|
...n,
|
|
224
228
|
columns: e
|
|
@@ -226,7 +230,7 @@ function Re(n) {
|
|
|
226
230
|
return t[U] = !0, t;
|
|
227
231
|
}
|
|
228
232
|
const Q = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new Map();
|
|
229
|
-
function
|
|
233
|
+
function We(n) {
|
|
230
234
|
const e = n.querySelector("tbw-grid-detail");
|
|
231
235
|
if (e) {
|
|
232
236
|
const r = Q.get(e);
|
|
@@ -237,34 +241,34 @@ function Be(n) {
|
|
|
237
241
|
return X.get(t);
|
|
238
242
|
}
|
|
239
243
|
function Ue(n) {
|
|
240
|
-
const { children: e, showExpandColumn: t = !0, animation: r = "slide" } = n, o =
|
|
241
|
-
(
|
|
242
|
-
if (o.current =
|
|
243
|
-
Q.set(
|
|
244
|
-
const
|
|
245
|
-
if (
|
|
246
|
-
const d =
|
|
244
|
+
const { children: e, showExpandColumn: t = !0, animation: r = "slide" } = n, o = k(null), a = E(
|
|
245
|
+
(s) => {
|
|
246
|
+
if (o.current = s, !s) return;
|
|
247
|
+
Q.set(s, e);
|
|
248
|
+
const g = s.closest("tbw-grid");
|
|
249
|
+
if (g) {
|
|
250
|
+
const d = g.id || g.getAttribute("data-grid-id");
|
|
247
251
|
d && X.set(d, e);
|
|
248
252
|
}
|
|
249
253
|
},
|
|
250
254
|
[e]
|
|
251
255
|
);
|
|
252
256
|
return P(() => () => {
|
|
253
|
-
const
|
|
254
|
-
if (
|
|
255
|
-
Q.delete(
|
|
256
|
-
const
|
|
257
|
-
if (
|
|
258
|
-
const
|
|
259
|
-
|
|
257
|
+
const s = o.current;
|
|
258
|
+
if (s) {
|
|
259
|
+
Q.delete(s);
|
|
260
|
+
const g = s.closest("tbw-grid");
|
|
261
|
+
if (g) {
|
|
262
|
+
const p = g.id || g.getAttribute("data-grid-id");
|
|
263
|
+
p && X.delete(p);
|
|
260
264
|
}
|
|
261
|
-
const d =
|
|
262
|
-
d && d.contains(
|
|
265
|
+
const d = s.parentNode;
|
|
266
|
+
d && d.contains(s);
|
|
263
267
|
}
|
|
264
268
|
}, []), /* @__PURE__ */ b(
|
|
265
269
|
"tbw-grid-detail",
|
|
266
270
|
{
|
|
267
|
-
ref:
|
|
271
|
+
ref: a,
|
|
268
272
|
showExpandColumn: t ? void 0 : "false",
|
|
269
273
|
animation: r === !1 ? "false" : r
|
|
270
274
|
}
|
|
@@ -280,55 +284,55 @@ function Je(n) {
|
|
|
280
284
|
return te.get(t);
|
|
281
285
|
}
|
|
282
286
|
function ht(n) {
|
|
283
|
-
const { id: e, title: t, icon: r, tooltip: o, order:
|
|
287
|
+
const { id: e, title: t, icon: r, tooltip: o, order: a = 100, children: c } = n, s = k(null), g = E(
|
|
284
288
|
(d) => {
|
|
285
|
-
|
|
289
|
+
s.current = d, d && (ee.set(d, c), e && te.set(e, c));
|
|
286
290
|
},
|
|
287
291
|
[c, e]
|
|
288
292
|
);
|
|
289
293
|
return P(() => () => {
|
|
290
|
-
const d =
|
|
294
|
+
const d = s.current;
|
|
291
295
|
d && (ee.delete(d), e && te.delete(e));
|
|
292
296
|
}, [e]), /* @__PURE__ */ b(
|
|
293
297
|
"tbw-grid-tool-panel",
|
|
294
298
|
{
|
|
295
|
-
ref:
|
|
299
|
+
ref: g,
|
|
296
300
|
id: e,
|
|
297
301
|
title: t,
|
|
298
302
|
icon: r,
|
|
299
303
|
tooltip: o,
|
|
300
|
-
order:
|
|
304
|
+
order: a?.toString()
|
|
301
305
|
}
|
|
302
306
|
);
|
|
303
307
|
}
|
|
304
|
-
const
|
|
308
|
+
const G = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new Map();
|
|
305
309
|
function Ye(n, e) {
|
|
306
|
-
const t = n.getAttribute("field"), r =
|
|
307
|
-
if (r.renderer = e,
|
|
308
|
-
const o =
|
|
309
|
-
o.renderer = e,
|
|
310
|
+
const t = n.getAttribute("field"), r = G.get(n) ?? {};
|
|
311
|
+
if (r.renderer = e, G.set(n, r), t) {
|
|
312
|
+
const o = A.get(t) ?? {};
|
|
313
|
+
o.renderer = e, A.set(t, o);
|
|
310
314
|
}
|
|
311
315
|
}
|
|
312
316
|
function Ze(n, e) {
|
|
313
|
-
const t = n.getAttribute("field"), r =
|
|
314
|
-
if (r.editor = e,
|
|
315
|
-
const o =
|
|
316
|
-
o.editor = e,
|
|
317
|
+
const t = n.getAttribute("field"), r = G.get(n) ?? {};
|
|
318
|
+
if (r.editor = e, G.set(n, r), t) {
|
|
319
|
+
const o = A.get(t) ?? {};
|
|
320
|
+
o.editor = e, A.set(t, o);
|
|
317
321
|
}
|
|
318
322
|
}
|
|
319
323
|
function Qe(n) {
|
|
320
|
-
let e =
|
|
324
|
+
let e = G.get(n)?.renderer;
|
|
321
325
|
if (!e) {
|
|
322
326
|
const t = n.getAttribute("field");
|
|
323
|
-
t && (e =
|
|
327
|
+
t && (e = A.get(t)?.renderer);
|
|
324
328
|
}
|
|
325
329
|
return e;
|
|
326
330
|
}
|
|
327
331
|
function Xe(n) {
|
|
328
|
-
let e =
|
|
332
|
+
let e = G.get(n)?.editor;
|
|
329
333
|
if (!e) {
|
|
330
334
|
const t = n.getAttribute("field");
|
|
331
|
-
t && (e =
|
|
335
|
+
t && (e = A.get(t)?.editor);
|
|
332
336
|
}
|
|
333
337
|
return e;
|
|
334
338
|
}
|
|
@@ -355,7 +359,7 @@ class et {
|
|
|
355
359
|
* Converts React renderer/editor functions to DOM-returning functions.
|
|
356
360
|
*/
|
|
357
361
|
processConfig(e) {
|
|
358
|
-
return
|
|
362
|
+
return Ce(e) ?? e;
|
|
359
363
|
}
|
|
360
364
|
/**
|
|
361
365
|
* Determines if this adapter can handle the given element.
|
|
@@ -363,13 +367,13 @@ class et {
|
|
|
363
367
|
*/
|
|
364
368
|
canHandle(e) {
|
|
365
369
|
const t = e.getAttribute("field");
|
|
366
|
-
let r =
|
|
370
|
+
let r = G.get(e);
|
|
367
371
|
if (!r && t) {
|
|
368
|
-
const c =
|
|
369
|
-
c && (c.renderer || c.editor) && (r = c,
|
|
372
|
+
const c = A.get(t);
|
|
373
|
+
c && (c.renderer || c.editor) && (r = c, G.set(e, r));
|
|
370
374
|
}
|
|
371
|
-
const o = r?.renderer !== void 0,
|
|
372
|
-
return r !== void 0 && (o ||
|
|
375
|
+
const o = r?.renderer !== void 0, a = r?.editor !== void 0;
|
|
376
|
+
return r !== void 0 && (o || a);
|
|
373
377
|
}
|
|
374
378
|
/**
|
|
375
379
|
* Creates a view renderer function that renders a React component
|
|
@@ -387,31 +391,31 @@ class et {
|
|
|
387
391
|
if (!t)
|
|
388
392
|
return;
|
|
389
393
|
const r = e.closest("tbw-grid"), o = /* @__PURE__ */ new WeakMap();
|
|
390
|
-
return (
|
|
391
|
-
const c =
|
|
394
|
+
return (a) => {
|
|
395
|
+
const c = a.cellEl;
|
|
392
396
|
if (c) {
|
|
393
397
|
const d = o.get(c);
|
|
394
398
|
if (d)
|
|
395
|
-
return w(d.container, t(
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
const
|
|
399
|
-
|
|
400
|
-
t(
|
|
399
|
+
return w(d.container, t(a), d.portalKey), d.container;
|
|
400
|
+
const p = document.createElement("div");
|
|
401
|
+
p.className = "react-cell-renderer", p.style.display = "contents";
|
|
402
|
+
const v = w(
|
|
403
|
+
p,
|
|
404
|
+
t(a),
|
|
401
405
|
void 0,
|
|
402
406
|
r ?? void 0
|
|
403
407
|
);
|
|
404
|
-
return o.set(c, { portalKey:
|
|
408
|
+
return o.set(c, { portalKey: v, container: p }), this.trackPortal(v, p, !1), p;
|
|
405
409
|
}
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
t(
|
|
410
|
+
const s = document.createElement("div");
|
|
411
|
+
s.className = "react-cell-renderer", s.style.display = "contents";
|
|
412
|
+
const g = w(
|
|
413
|
+
s,
|
|
414
|
+
t(a),
|
|
411
415
|
void 0,
|
|
412
416
|
r ?? void 0
|
|
413
417
|
);
|
|
414
|
-
return this.trackPortal(
|
|
418
|
+
return this.trackPortal(g, s, !1), s;
|
|
415
419
|
};
|
|
416
420
|
}
|
|
417
421
|
/**
|
|
@@ -424,15 +428,15 @@ class et {
|
|
|
424
428
|
return () => document.createElement("div");
|
|
425
429
|
const r = e.closest("tbw-grid") ?? void 0;
|
|
426
430
|
return (o) => {
|
|
427
|
-
const
|
|
428
|
-
|
|
431
|
+
const a = document.createElement("div");
|
|
432
|
+
a.className = "react-cell-editor", a.style.display = "contents";
|
|
429
433
|
const c = w(
|
|
430
|
-
|
|
434
|
+
a,
|
|
431
435
|
t(o),
|
|
432
436
|
void 0,
|
|
433
437
|
r
|
|
434
438
|
);
|
|
435
|
-
return this.trackPortal(c,
|
|
439
|
+
return this.trackPortal(c, a, !0), a;
|
|
436
440
|
};
|
|
437
441
|
}
|
|
438
442
|
/**
|
|
@@ -440,18 +444,18 @@ class et {
|
|
|
440
444
|
* Renders React components for expandable detail rows.
|
|
441
445
|
*/
|
|
442
446
|
createDetailRenderer(e) {
|
|
443
|
-
const t =
|
|
447
|
+
const t = We(e);
|
|
444
448
|
if (t)
|
|
445
449
|
return (r, o) => {
|
|
446
|
-
const
|
|
447
|
-
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
+
const a = document.createElement("div");
|
|
451
|
+
a.className = "react-detail-panel";
|
|
452
|
+
const s = w(
|
|
453
|
+
a,
|
|
450
454
|
t({ row: r, rowIndex: o }),
|
|
451
455
|
void 0,
|
|
452
456
|
e
|
|
453
457
|
);
|
|
454
|
-
return this.trackPortal(
|
|
458
|
+
return this.trackPortal(s, a, !1), a;
|
|
455
459
|
};
|
|
456
460
|
}
|
|
457
461
|
/**
|
|
@@ -468,20 +472,33 @@ class et {
|
|
|
468
472
|
* Renders React components for card layout in responsive mode.
|
|
469
473
|
*/
|
|
470
474
|
createResponsiveCardRenderer(e) {
|
|
471
|
-
const t =
|
|
475
|
+
const t = ve(e);
|
|
472
476
|
if (t)
|
|
473
477
|
return (r, o) => {
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
const
|
|
477
|
-
|
|
478
|
+
const a = document.createElement("div");
|
|
479
|
+
a.className = "react-responsive-card";
|
|
480
|
+
const s = w(
|
|
481
|
+
a,
|
|
478
482
|
t({ row: r, index: o }),
|
|
479
483
|
void 0,
|
|
480
484
|
e
|
|
481
485
|
);
|
|
482
|
-
return this.trackPortal(
|
|
486
|
+
return this.trackPortal(s, a, !1), a;
|
|
483
487
|
};
|
|
484
488
|
}
|
|
489
|
+
/**
|
|
490
|
+
* FrameworkAdapter hook called by ResponsivePlugin during attach().
|
|
491
|
+
* Parses the `<tbw-grid-responsive-card>` element and delegates to
|
|
492
|
+
* {@link createResponsiveCardRenderer}. Needed for parity with the Vue
|
|
493
|
+
* and Angular adapters so ResponsivePlugin's standard lookup path works
|
|
494
|
+
* for React users as well, not just via the imperative
|
|
495
|
+
* `refreshResponsiveCardRenderer` hook in DataGrid.
|
|
496
|
+
*/
|
|
497
|
+
parseResponsiveCardElement(e) {
|
|
498
|
+
const t = e.closest("tbw-grid");
|
|
499
|
+
if (t)
|
|
500
|
+
return this.createResponsiveCardRenderer(t);
|
|
501
|
+
}
|
|
485
502
|
/**
|
|
486
503
|
* Creates a tool panel renderer from a light DOM element.
|
|
487
504
|
* Renders React components into tool panel containers.
|
|
@@ -543,7 +560,7 @@ class et {
|
|
|
543
560
|
return (r) => {
|
|
544
561
|
const o = document.createElement("span");
|
|
545
562
|
o.style.display = "contents";
|
|
546
|
-
const
|
|
563
|
+
const a = r.cellEl?.closest("tbw-grid") ?? t, c = w(o, e(r), void 0, a);
|
|
547
564
|
return this.trackPortal(c, o, !1), o;
|
|
548
565
|
};
|
|
549
566
|
}
|
|
@@ -555,8 +572,8 @@ class et {
|
|
|
555
572
|
return (r) => {
|
|
556
573
|
const o = document.createElement("span");
|
|
557
574
|
o.style.display = "contents";
|
|
558
|
-
const
|
|
559
|
-
return this.trackPortal(
|
|
575
|
+
const a = w(o, e(r), void 0, t);
|
|
576
|
+
return this.trackPortal(a, o, !0), o;
|
|
560
577
|
};
|
|
561
578
|
}
|
|
562
579
|
/**
|
|
@@ -565,10 +582,10 @@ class et {
|
|
|
565
582
|
*/
|
|
566
583
|
createFilterPanelRenderer(e, t) {
|
|
567
584
|
return (r, o) => {
|
|
568
|
-
const
|
|
569
|
-
|
|
570
|
-
const c = r.closest("tbw-grid") ?? t,
|
|
571
|
-
this.trackPortal(
|
|
585
|
+
const a = document.createElement("div");
|
|
586
|
+
a.style.display = "contents";
|
|
587
|
+
const c = r.closest("tbw-grid") ?? t, s = w(a, e(o), void 0, c);
|
|
588
|
+
this.trackPortal(s, a, !1), r.appendChild(a);
|
|
572
589
|
};
|
|
573
590
|
}
|
|
574
591
|
// #region Portal tracking helpers
|
|
@@ -588,7 +605,7 @@ class et {
|
|
|
588
605
|
destroy() {
|
|
589
606
|
for (const e of this.allPortalKeys)
|
|
590
607
|
H(e);
|
|
591
|
-
this.allPortalKeys.clear(), this.editorPortalKeys.clear(), this.keyToContainer.clear(),
|
|
608
|
+
this.allPortalKeys.clear(), this.editorPortalKeys.clear(), this.keyToContainer.clear(), A.clear();
|
|
592
609
|
}
|
|
593
610
|
/**
|
|
594
611
|
* Called when a cell's content is about to be wiped.
|
|
@@ -635,9 +652,9 @@ function nt(n) {
|
|
|
635
652
|
r === void 0 || r === !1 || e.push(t);
|
|
636
653
|
return rt(e), Ae(n);
|
|
637
654
|
}
|
|
638
|
-
let
|
|
655
|
+
let me = !1, J = null;
|
|
639
656
|
function re() {
|
|
640
|
-
return
|
|
657
|
+
return me || (J = new et(), be.registerAdapter(J), me = !0), J;
|
|
641
658
|
}
|
|
642
659
|
re();
|
|
643
660
|
function ot(n) {
|
|
@@ -646,11 +663,11 @@ function ot(n) {
|
|
|
646
663
|
}
|
|
647
664
|
function it(n, e) {
|
|
648
665
|
const t = n;
|
|
649
|
-
if (!n.querySelector("tbw-grid-responsive-card") || !
|
|
650
|
-
const
|
|
651
|
-
if (
|
|
666
|
+
if (!n.querySelector("tbw-grid-responsive-card") || !ve(n)) return;
|
|
667
|
+
const a = t.getPluginByName?.("responsive");
|
|
668
|
+
if (a && typeof a.setCardRenderer == "function") {
|
|
652
669
|
const c = e.createResponsiveCardRenderer(n);
|
|
653
|
-
c &&
|
|
670
|
+
c && a.setCardRenderer(c);
|
|
654
671
|
}
|
|
655
672
|
}
|
|
656
673
|
function st(n) {
|
|
@@ -670,31 +687,31 @@ function st(n) {
|
|
|
670
687
|
}
|
|
671
688
|
}), e;
|
|
672
689
|
}
|
|
673
|
-
const
|
|
690
|
+
const Rt = he(function(e, t) {
|
|
674
691
|
const {
|
|
675
692
|
// Core props
|
|
676
693
|
rows: r,
|
|
677
694
|
gridConfig: o,
|
|
678
|
-
columns:
|
|
695
|
+
columns: a,
|
|
679
696
|
columnDefaults: c,
|
|
680
|
-
fitMode:
|
|
681
|
-
sortable:
|
|
697
|
+
fitMode: s,
|
|
698
|
+
sortable: g,
|
|
682
699
|
filterable: d,
|
|
683
|
-
selectable:
|
|
684
|
-
loading:
|
|
685
|
-
customStyles:
|
|
700
|
+
selectable: p,
|
|
701
|
+
loading: v,
|
|
702
|
+
customStyles: C,
|
|
686
703
|
className: K,
|
|
687
|
-
style:
|
|
688
|
-
children:
|
|
704
|
+
style: x,
|
|
705
|
+
children: T,
|
|
689
706
|
// Plugin props
|
|
690
|
-
plugins:
|
|
707
|
+
plugins: u,
|
|
691
708
|
// SSR mode
|
|
692
|
-
ssr:
|
|
709
|
+
ssr: h,
|
|
693
710
|
// Legacy event handlers
|
|
694
|
-
onRowsChange:
|
|
711
|
+
onRowsChange: R,
|
|
695
712
|
// Feature props and event props are in ...rest
|
|
696
|
-
...
|
|
697
|
-
} = e,
|
|
713
|
+
...m
|
|
714
|
+
} = e, f = k(null), j = k(null), ie = O(Oe), q = O(Le), se = [
|
|
698
715
|
"selection",
|
|
699
716
|
"editing",
|
|
700
717
|
"filtering",
|
|
@@ -703,6 +720,7 @@ const vt = he(function(e, t) {
|
|
|
703
720
|
"contextMenu",
|
|
704
721
|
"reorderColumns",
|
|
705
722
|
"reorderRows",
|
|
723
|
+
"rowDragDrop",
|
|
706
724
|
"visibility",
|
|
707
725
|
"undoRedo",
|
|
708
726
|
"tree",
|
|
@@ -718,58 +736,58 @@ const vt = he(function(e, t) {
|
|
|
718
736
|
"pivot",
|
|
719
737
|
"serverSide",
|
|
720
738
|
"tooltip"
|
|
721
|
-
], we =
|
|
722
|
-
const l =
|
|
739
|
+
], we = S(() => se.map((i) => {
|
|
740
|
+
const l = m[i];
|
|
723
741
|
return l !== void 0 ? `${i}:${JSON.stringify(l)}` : "";
|
|
724
|
-
}).filter(Boolean).join("|"), [
|
|
742
|
+
}).filter(Boolean).join("|"), [m]), ae = S(() => {
|
|
725
743
|
const i = {};
|
|
726
744
|
for (const l of se)
|
|
727
|
-
l in
|
|
745
|
+
l in m && m[l] !== void 0 && (i[l] = m[l]);
|
|
728
746
|
return i;
|
|
729
|
-
}, [we]),
|
|
730
|
-
if (
|
|
731
|
-
const i = new Set(
|
|
732
|
-
return [...
|
|
747
|
+
}, [we]), ce = S(() => st(T), [T]), le = S(() => ({ ...ce, ...ae }), [ae, ce]), _ = S(() => u || h ? [] : nt(le), [le, u, h]), N = S(() => {
|
|
748
|
+
if (u) {
|
|
749
|
+
const i = new Set(u.map((y) => y.name)), l = _.filter((y) => !i.has(y.name));
|
|
750
|
+
return [...u, ...l];
|
|
733
751
|
}
|
|
734
752
|
return _;
|
|
735
|
-
}, [
|
|
736
|
-
if (!
|
|
737
|
-
const i = Fe(
|
|
753
|
+
}, [u, _]), F = S(() => {
|
|
754
|
+
if (!a) return a;
|
|
755
|
+
const i = Fe(a);
|
|
738
756
|
return c ? i.map((l) => ({
|
|
739
757
|
...c,
|
|
740
758
|
...l
|
|
741
759
|
// Individual column props override defaults
|
|
742
760
|
})) : i;
|
|
743
|
-
}, [
|
|
744
|
-
const i =
|
|
745
|
-
if (
|
|
761
|
+
}, [a, c]), I = S(() => {
|
|
762
|
+
const i = Ce(o), l = {};
|
|
763
|
+
if (g !== void 0 && (l.sortable = g), d !== void 0 && (l.filterable = d), p !== void 0 && (l.selectable = p), q) {
|
|
746
764
|
const y = i?.icons || o?.icons || {};
|
|
747
765
|
l.icons = { ...q, ...y };
|
|
748
766
|
}
|
|
749
767
|
if (N.length > 0 && i) {
|
|
750
|
-
const y = i.plugins || [], L = new Set(y.map((M) => M.name)),
|
|
768
|
+
const y = i.plugins || [], L = new Set(y.map((M) => M.name)), B = N.filter((M) => !L.has(M.name));
|
|
751
769
|
return {
|
|
752
770
|
...i,
|
|
753
771
|
...l,
|
|
754
|
-
plugins: [...y, ...
|
|
772
|
+
plugins: [...y, ...B]
|
|
755
773
|
};
|
|
756
774
|
}
|
|
757
775
|
return N.length > 0 && !i ? { ...l, plugins: N } : Object.keys(l).length > 0 ? { ...i, ...l } : i;
|
|
758
|
-
}, [o, N,
|
|
776
|
+
}, [o, N, g, d, p, q]);
|
|
759
777
|
P(() => {
|
|
760
778
|
re().setTypeDefaults(ie);
|
|
761
779
|
}, [ie]), P(() => {
|
|
762
|
-
|
|
780
|
+
f.current && (f.current.rows = r);
|
|
763
781
|
}, [r]), P(() => {
|
|
764
|
-
|
|
782
|
+
f.current && I && (f.current.gridConfig = I);
|
|
765
783
|
}, [I]), P(() => {
|
|
766
|
-
|
|
784
|
+
f.current && F && (f.current.columns = F);
|
|
767
785
|
}, [F]), P(() => {
|
|
768
|
-
|
|
769
|
-
}, [
|
|
770
|
-
|
|
771
|
-
}, [
|
|
772
|
-
const i =
|
|
786
|
+
f.current && s !== void 0 && (f.current.fitMode = s);
|
|
787
|
+
}, [s]), P(() => {
|
|
788
|
+
f.current && v !== void 0 && (f.current.loading = v);
|
|
789
|
+
}, [v]), P(() => {
|
|
790
|
+
const i = f.current;
|
|
773
791
|
if (!i) return;
|
|
774
792
|
const l = re();
|
|
775
793
|
i.__frameworkAdapter = l, ot(i), it(i, l);
|
|
@@ -781,83 +799,83 @@ const vt = he(function(e, t) {
|
|
|
781
799
|
y = !0, cancelAnimationFrame(L);
|
|
782
800
|
};
|
|
783
801
|
}, []), P(() => {
|
|
784
|
-
if (!
|
|
785
|
-
const i =
|
|
802
|
+
if (!f.current || !C) return;
|
|
803
|
+
const i = f.current, l = "react-custom-styles";
|
|
786
804
|
let y = !0;
|
|
787
805
|
return i.ready?.().then(() => {
|
|
788
|
-
y &&
|
|
806
|
+
y && C && (i.registerStyles?.(l, C), j.current = l);
|
|
789
807
|
}), () => {
|
|
790
808
|
y = !1, j.current && (i.unregisterStyles?.(j.current), j.current = null);
|
|
791
809
|
};
|
|
792
|
-
}, [
|
|
793
|
-
const i =
|
|
810
|
+
}, [C]), P(() => {
|
|
811
|
+
const i = f.current;
|
|
794
812
|
if (!i) return;
|
|
795
813
|
const l = [];
|
|
796
|
-
return
|
|
814
|
+
return R && l.push(i.on("rows-change", (y) => R(y.rows))), () => {
|
|
797
815
|
l.forEach((y) => y());
|
|
798
816
|
};
|
|
799
|
-
}, [
|
|
800
|
-
const de =
|
|
801
|
-
for (const i of Object.keys(
|
|
802
|
-
ue.current[i] =
|
|
817
|
+
}, [R]);
|
|
818
|
+
const de = S(() => Object.keys(W).filter((i) => typeof m[i] == "function").sort().join("|"), [m]), ue = k({});
|
|
819
|
+
for (const i of Object.keys(W))
|
|
820
|
+
ue.current[i] = m[i];
|
|
803
821
|
P(() => {
|
|
804
|
-
const i =
|
|
822
|
+
const i = f.current;
|
|
805
823
|
if (!i) return;
|
|
806
824
|
const l = [];
|
|
807
|
-
for (const [y, L] of Object.entries(
|
|
825
|
+
for (const [y, L] of Object.entries(W))
|
|
808
826
|
de.includes(y) && l.push(
|
|
809
|
-
i.on(L, (
|
|
810
|
-
ue.current[y]?.(
|
|
827
|
+
i.on(L, (B, M) => {
|
|
828
|
+
ue.current[y]?.(B, M);
|
|
811
829
|
})
|
|
812
830
|
);
|
|
813
831
|
return () => {
|
|
814
832
|
l.forEach((y) => y());
|
|
815
833
|
};
|
|
816
|
-
}, [de]),
|
|
834
|
+
}, [de]), Re(
|
|
817
835
|
t,
|
|
818
836
|
() => ({
|
|
819
837
|
get element() {
|
|
820
|
-
return
|
|
838
|
+
return f.current;
|
|
821
839
|
},
|
|
822
840
|
async getConfig() {
|
|
823
|
-
return
|
|
841
|
+
return f.current?.getConfig?.() ?? {};
|
|
824
842
|
},
|
|
825
843
|
async ready() {
|
|
826
|
-
return
|
|
844
|
+
return f.current?.ready?.();
|
|
827
845
|
},
|
|
828
846
|
async forceLayout() {
|
|
829
|
-
return
|
|
847
|
+
return f.current?.forceLayout?.();
|
|
830
848
|
},
|
|
831
849
|
async toggleGroup(i) {
|
|
832
|
-
return
|
|
850
|
+
return f.current?.toggleGroup?.(i);
|
|
833
851
|
},
|
|
834
852
|
registerStyles(i, l) {
|
|
835
|
-
|
|
853
|
+
f.current?.registerStyles?.(i, l);
|
|
836
854
|
},
|
|
837
855
|
unregisterStyles(i) {
|
|
838
|
-
|
|
856
|
+
f.current?.unregisterStyles?.(i);
|
|
839
857
|
},
|
|
840
858
|
setRowLoading(i, l) {
|
|
841
|
-
|
|
859
|
+
f.current?.setRowLoading?.(i, l);
|
|
842
860
|
},
|
|
843
861
|
setCellLoading(i, l, y) {
|
|
844
|
-
|
|
862
|
+
f.current?.setCellLoading?.(i, l, y);
|
|
845
863
|
},
|
|
846
864
|
isRowLoading(i) {
|
|
847
|
-
return
|
|
865
|
+
return f.current?.isRowLoading?.(i) ?? !1;
|
|
848
866
|
},
|
|
849
867
|
isCellLoading(i, l) {
|
|
850
|
-
return
|
|
868
|
+
return f.current?.isCellLoading?.(i, l) ?? !1;
|
|
851
869
|
},
|
|
852
870
|
clearAllLoading() {
|
|
853
|
-
|
|
871
|
+
f.current?.clearAllLoading?.();
|
|
854
872
|
}
|
|
855
873
|
}),
|
|
856
874
|
[]
|
|
857
875
|
);
|
|
858
|
-
const $ =
|
|
876
|
+
const $ = k(null);
|
|
859
877
|
return ke(() => {
|
|
860
|
-
const i =
|
|
878
|
+
const i = f.current;
|
|
861
879
|
return i && $.current && ge(i, $.current), () => {
|
|
862
880
|
i && ge(i, null);
|
|
863
881
|
};
|
|
@@ -867,47 +885,47 @@ const vt = he(function(e, t) {
|
|
|
867
885
|
"tbw-grid",
|
|
868
886
|
{
|
|
869
887
|
ref: (i) => {
|
|
870
|
-
if (
|
|
888
|
+
if (f.current = i, i) {
|
|
871
889
|
const l = i;
|
|
872
890
|
I && (l.gridConfig = I), r && (l.rows = r), F && (l.columns = F);
|
|
873
891
|
}
|
|
874
892
|
},
|
|
875
893
|
class: K,
|
|
876
|
-
style:
|
|
877
|
-
children: /* @__PURE__ */ b(Te.Provider, { value:
|
|
894
|
+
style: x,
|
|
895
|
+
children: /* @__PURE__ */ b(Te.Provider, { value: f, children: T })
|
|
878
896
|
}
|
|
879
897
|
)
|
|
880
898
|
] });
|
|
881
899
|
});
|
|
882
|
-
function
|
|
900
|
+
function vt(n) {
|
|
883
901
|
const {
|
|
884
902
|
field: e,
|
|
885
903
|
header: t,
|
|
886
904
|
type: r,
|
|
887
905
|
editable: o,
|
|
888
|
-
sortable:
|
|
906
|
+
sortable: a,
|
|
889
907
|
resizable: c,
|
|
890
|
-
width:
|
|
891
|
-
minWidth:
|
|
908
|
+
width: s,
|
|
909
|
+
minWidth: g,
|
|
892
910
|
hidden: d,
|
|
893
|
-
lockVisible:
|
|
894
|
-
children:
|
|
895
|
-
editor:
|
|
911
|
+
lockVisible: p,
|
|
912
|
+
children: v,
|
|
913
|
+
editor: C,
|
|
896
914
|
options: K,
|
|
897
|
-
multi:
|
|
898
|
-
format:
|
|
899
|
-
} = n,
|
|
900
|
-
(
|
|
901
|
-
|
|
915
|
+
multi: x,
|
|
916
|
+
format: T
|
|
917
|
+
} = n, u = k(null), h = E(
|
|
918
|
+
(f) => {
|
|
919
|
+
u.current = f, f && (v && Ye(f, v), C && Ze(f, C));
|
|
902
920
|
},
|
|
903
|
-
[
|
|
904
|
-
),
|
|
921
|
+
[v, C, e]
|
|
922
|
+
), R = typeof s == "number" ? `${s}px` : s, m = {
|
|
905
923
|
field: e,
|
|
906
|
-
ref:
|
|
924
|
+
ref: h
|
|
907
925
|
};
|
|
908
|
-
return t !== void 0 && (
|
|
926
|
+
return t !== void 0 && (m.header = t), r !== void 0 && (m.type = r), o !== void 0 && (m.editable = o), a !== void 0 && (m.sortable = a), c !== void 0 && (m.resizable = c), R !== void 0 && (m.width = R), g !== void 0 && (m["min-width"] = g), d !== void 0 && (m.hidden = d), p !== void 0 && (m["lock-visible"] = p), x !== void 0 && (m.multi = x), T && (m["data-has-format"] = "true"), K && (m["data-has-options"] = "true"), /* @__PURE__ */ b("tbw-grid-column", { ...m });
|
|
909
927
|
}
|
|
910
|
-
function
|
|
928
|
+
function Ct({ children: n }) {
|
|
911
929
|
return /* @__PURE__ */ b("tbw-grid-tool-buttons", { children: n });
|
|
912
930
|
}
|
|
913
931
|
const wt = ({ icons: n, defaults: e, children: t }) => {
|
|
@@ -915,106 +933,114 @@ const wt = ({ icons: n, defaults: e, children: t }) => {
|
|
|
915
933
|
return e && (r = /* @__PURE__ */ b(He, { defaults: e, children: r })), n && (r = /* @__PURE__ */ b(Ie, { icons: n, children: r })), /* @__PURE__ */ b(ne, { children: r });
|
|
916
934
|
};
|
|
917
935
|
function Pt(n) {
|
|
918
|
-
const e =
|
|
936
|
+
const e = k(null), [t, r] = fe(!1), [o, a] = fe(null), c = k(null), s = E(() => n ? (c.current ??= document.querySelector(n), c.current) : e.current?.element ?? null, [n]);
|
|
919
937
|
P(() => {
|
|
920
|
-
let
|
|
938
|
+
let u = !0;
|
|
921
939
|
return (async () => {
|
|
922
940
|
try {
|
|
923
941
|
if (n) {
|
|
924
|
-
const
|
|
925
|
-
if (!
|
|
926
|
-
if (c.current =
|
|
942
|
+
const R = document.querySelector(n);
|
|
943
|
+
if (!R) return;
|
|
944
|
+
if (c.current = R, await R.ready?.(), u) {
|
|
927
945
|
r(!0);
|
|
928
|
-
const
|
|
929
|
-
|
|
946
|
+
const m = await R.getConfig?.();
|
|
947
|
+
u && m && a(m);
|
|
930
948
|
}
|
|
931
949
|
} else {
|
|
932
|
-
const
|
|
933
|
-
if (!
|
|
934
|
-
if (await
|
|
950
|
+
const R = e.current;
|
|
951
|
+
if (!R) return;
|
|
952
|
+
if (await R.ready?.(), u) {
|
|
935
953
|
r(!0);
|
|
936
|
-
const
|
|
937
|
-
|
|
954
|
+
const m = await R.getConfig?.();
|
|
955
|
+
u && m && a(m);
|
|
938
956
|
}
|
|
939
957
|
}
|
|
940
958
|
} catch {
|
|
941
959
|
}
|
|
942
960
|
})(), () => {
|
|
943
|
-
|
|
961
|
+
u = !1;
|
|
944
962
|
};
|
|
945
963
|
}, [n]);
|
|
946
|
-
const
|
|
947
|
-
const
|
|
948
|
-
if (
|
|
949
|
-
return await
|
|
950
|
-
const
|
|
951
|
-
return
|
|
952
|
-
}, [
|
|
953
|
-
const
|
|
954
|
-
if (
|
|
955
|
-
await
|
|
964
|
+
const g = E(async () => {
|
|
965
|
+
const u = s();
|
|
966
|
+
if (u)
|
|
967
|
+
return await u.getConfig?.() ?? null;
|
|
968
|
+
const h = e.current;
|
|
969
|
+
return h ? await h.getConfig?.() ?? null : null;
|
|
970
|
+
}, [s]), d = E(async () => {
|
|
971
|
+
const u = s();
|
|
972
|
+
if (u) {
|
|
973
|
+
await u.forceLayout?.();
|
|
956
974
|
return;
|
|
957
975
|
}
|
|
958
|
-
const
|
|
959
|
-
|
|
960
|
-
}, [
|
|
961
|
-
async (
|
|
962
|
-
const
|
|
963
|
-
if (
|
|
964
|
-
await
|
|
976
|
+
const h = e.current;
|
|
977
|
+
h && await h.forceLayout?.();
|
|
978
|
+
}, [s]), p = E(
|
|
979
|
+
async (u) => {
|
|
980
|
+
const h = s();
|
|
981
|
+
if (h) {
|
|
982
|
+
await h.toggleGroup?.(u);
|
|
965
983
|
return;
|
|
966
984
|
}
|
|
967
|
-
const
|
|
968
|
-
|
|
985
|
+
const R = e.current;
|
|
986
|
+
R && await R.toggleGroup?.(u);
|
|
969
987
|
},
|
|
970
|
-
[
|
|
971
|
-
),
|
|
972
|
-
(
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
988
|
+
[s]
|
|
989
|
+
), v = E(
|
|
990
|
+
(u) => s()?.getPlugin?.(u),
|
|
991
|
+
[s]
|
|
992
|
+
), C = E(
|
|
993
|
+
((u) => s()?.getPluginByName?.(u)),
|
|
994
|
+
[s]
|
|
995
|
+
), K = E(
|
|
996
|
+
(u, h) => {
|
|
997
|
+
const R = s();
|
|
998
|
+
if (R) {
|
|
999
|
+
R.registerStyles?.(u, h);
|
|
976
1000
|
return;
|
|
977
1001
|
}
|
|
978
|
-
e.current?.registerStyles?.(
|
|
1002
|
+
e.current?.registerStyles?.(u, h);
|
|
979
1003
|
},
|
|
980
|
-
[
|
|
981
|
-
),
|
|
982
|
-
(
|
|
983
|
-
const
|
|
984
|
-
if (
|
|
985
|
-
|
|
1004
|
+
[s]
|
|
1005
|
+
), x = E(
|
|
1006
|
+
(u) => {
|
|
1007
|
+
const h = s();
|
|
1008
|
+
if (h) {
|
|
1009
|
+
h.unregisterStyles?.(u);
|
|
986
1010
|
return;
|
|
987
1011
|
}
|
|
988
|
-
e.current?.unregisterStyles?.(
|
|
1012
|
+
e.current?.unregisterStyles?.(u);
|
|
989
1013
|
},
|
|
990
|
-
[
|
|
991
|
-
),
|
|
1014
|
+
[s]
|
|
1015
|
+
), T = E(() => o?.columns ? o.columns.filter((u) => !u.hidden) : [], [o]);
|
|
992
1016
|
return {
|
|
993
1017
|
ref: e,
|
|
994
|
-
element:
|
|
1018
|
+
element: s(),
|
|
995
1019
|
isReady: t,
|
|
996
1020
|
config: o,
|
|
997
|
-
getConfig:
|
|
1021
|
+
getConfig: g,
|
|
998
1022
|
forceLayout: d,
|
|
999
|
-
toggleGroup:
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1023
|
+
toggleGroup: p,
|
|
1024
|
+
getPlugin: v,
|
|
1025
|
+
getPluginByName: C,
|
|
1026
|
+
registerStyles: K,
|
|
1027
|
+
unregisterStyles: x,
|
|
1028
|
+
getVisibleColumns: T
|
|
1003
1029
|
};
|
|
1004
1030
|
}
|
|
1005
1031
|
export {
|
|
1006
|
-
|
|
1032
|
+
Rt as DataGrid,
|
|
1007
1033
|
et as GridAdapter,
|
|
1008
|
-
|
|
1034
|
+
vt as GridColumn,
|
|
1009
1035
|
Ue as GridDetailPanel,
|
|
1010
1036
|
Ie as GridIconProvider,
|
|
1011
1037
|
wt as GridProvider,
|
|
1012
1038
|
Me as GridResponsiveCard,
|
|
1013
|
-
|
|
1039
|
+
Ct as GridToolButtons,
|
|
1014
1040
|
ht as GridToolPanel,
|
|
1015
1041
|
He as GridTypeProvider,
|
|
1016
1042
|
Pt as useGrid,
|
|
1017
1043
|
pt as useGridIcons,
|
|
1018
|
-
|
|
1019
|
-
|
|
1044
|
+
mt as useGridTypeDefaults,
|
|
1045
|
+
yt as useTypeDefault
|
|
1020
1046
|
};
|