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