@toolbox-web/grid-react 2.0.0-rc.0 → 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,676 +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
- onUndo: "undo",
82
- onRedo: "redo",
83
- onExportComplete: "export-complete",
84
- onPrintStart: "print-start",
85
- onPrintComplete: "print-complete",
86
- onTbwScroll: "tbw-scroll",
87
- onRender: "render"
88
- }, W = ae(null), $e = ({ icons: t, children: r }) => /* @__PURE__ */ S(W.Provider, { value: t, children: r });
89
- function sr() {
90
- return k(W);
91
- }
92
- const Oe = W, O = ae(null), je = ({ defaults: t, children: r }) => /* @__PURE__ */ S(O.Provider, { value: t, children: r });
93
- function cr() {
94
- return k(O);
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);
95
90
  }
96
- function ur(t) {
97
- return k(O)?.[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);
98
97
  }
99
- const Be = O;
100
- class ze extends be {
101
- state = { failed: !1 };
102
- static getDerivedStateFromError() {
103
- return { failed: !0 };
104
- }
105
- componentDidCatch(r) {
106
- this.props.onError(this.props.portalKey, r);
107
- }
108
- render() {
109
- return this.state.failed ? null : this.props.children;
110
- }
98
+ function Z(e) {
99
+ return E(J)?.[e];
111
100
  }
112
- const Ke = le(function(r, l) {
113
- 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 = () => {
114
- d.current || (d.current = !0, queueMicrotask(() => {
115
- d.current = !1, !g.current && (oe(c), v());
116
- }));
117
- }, v = () => {
118
- f.current || (f.current = requestAnimationFrame(() => {
119
- f.current = 0, !g.current && c();
120
- }));
121
- }, G = (y, s) => {
122
- console.error(`[grid-react] Portal "${y}" crashed; dropping.`, s), n.current.delete(y), v();
123
- };
124
- fe(
125
- l,
126
- () => ({
127
- renderPortal(y, s, p) {
128
- g.current || (n.current.set(y, { container: s, element: p }), C());
129
- },
130
- removePortal(y, s) {
131
- if (g.current) {
132
- n.current.delete(y);
133
- return;
134
- }
135
- n.current.delete(y) && (u.current > 0 ? m.current = !0 : s ? oe(c) : C());
136
- },
137
- beginBatch() {
138
- u.current++;
139
- },
140
- endBatch() {
141
- u.current !== 0 && (u.current--, u.current === 0 && m.current && (m.current = !1, c()));
142
- },
143
- clear() {
144
- if (g.current) {
145
- n.current.clear();
146
- return;
147
- }
148
- n.current.size > 0 && (n.current.clear(), f.current && (cancelAnimationFrame(f.current), f.current = 0), C());
149
- }
150
- }),
151
- // forceRender is stable (useReducer dispatch), refs are stable
152
- // eslint-disable-next-line react-hooks/exhaustive-deps
153
- []
154
- ), de(() => {
155
- g.current = !1;
156
- const y = n.current;
157
- return () => {
158
- g.current = !0, f.current && (cancelAnimationFrame(f.current), f.current = 0), y.clear();
159
- };
160
- }, []);
161
- const w = [];
162
- let F = null;
163
- for (const [y, { container: s, element: p }] of n.current) {
164
- if (!s.isConnected) {
165
- (F ??= []).push(y);
166
- continue;
167
- }
168
- w.push(
169
- De(
170
- /* @__PURE__ */ S(ze, { portalKey: y, onError: G, children: p }),
171
- s,
172
- y
173
- )
174
- );
175
- }
176
- if (F) {
177
- const y = F;
178
- queueMicrotask(() => {
179
- for (const s of y) n.current.delete(s);
180
- });
181
- }
182
- return /* @__PURE__ */ S(U, { children: w });
183
- }), He = {
184
- undoRedo: ["editing"],
185
- 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"]
186
180
  };
187
- function qe(t) {
188
- const r = new Set(t);
189
- for (const l of t) {
190
- const n = He[l];
191
- if (n)
192
- for (const c of n)
193
- r.has(c) || console.warn(
194
- `[DataGrid] Feature "${l}" requires "${c}" to be enabled. Add the "${c}" prop to your DataGrid.`
195
- );
196
- }
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
+ }
197
187
  }
198
- function _e(t) {
199
- const r = [];
200
- for (const [l, n] of Object.entries(t))
201
- n === void 0 || n === !1 || r.push(l);
202
- 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);
203
192
  }
204
- let ie = !1, q = null;
205
- function V() {
206
- 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;
207
198
  }
208
- V();
209
- const se = /* @__PURE__ */ new WeakMap();
210
- let Ve = 0;
211
- function Ue(t) {
212
- let r = se.get(t);
213
- 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;
214
204
  }
215
- ye("GridDetailPanel", (t) => {
216
- const r = t.props;
217
- return {
218
- masterDetail: {
219
- showExpandColumn: r.showExpandColumn ?? !0,
220
- animation: r.animation ?? "slide"
221
- // detailRenderer is wired up by the masterDetail post-mount refresh hook.
222
- }
223
- };
224
- });
225
- ye("GridResponsiveCard", () => ({
226
- // GridResponsiveCard only carries cardRowHeight; breakpoint is set via the
227
- // responsive prop. Enable the plugin with defaults — user can override.
228
- responsive: !0
229
- }));
230
- const ar = le(function(r, l) {
231
- const {
232
- // Core props
233
- rows: n,
234
- gridConfig: c,
235
- columns: d,
236
- columnDefaults: f,
237
- fitMode: u,
238
- columnInference: m,
239
- sortable: g,
240
- filterable: C,
241
- selectable: v,
242
- loading: G,
243
- customStyles: w,
244
- className: F,
245
- style: y,
246
- children: s,
247
- // Plugin props
248
- plugins: p,
249
- // Legacy event handlers
250
- onRowsChange: h,
251
- // Feature props and event props are in ...rest
252
- ...P
253
- } = r, o = b(null), D = b(null), J = b(!1), Z = k(Be), j = k(Oe), he = T(() => te().map((e) => {
254
- const i = P[e];
255
- if (i === void 0) return "";
256
- let a;
257
- try {
258
- a = JSON.stringify(i) ?? "undefined";
259
- } catch {
260
- a = typeof i == "object" && i !== null ? `ref#${Ue(i)}` : `prim:${String(i)}`;
261
- }
262
- return `${e}:${a}`;
263
- }).filter(Boolean).join("|"), [P]), Q = T(() => {
264
- const e = {}, i = P;
265
- for (const a of te()) {
266
- const x = i[a];
267
- x !== void 0 && (e[a] = x);
268
- }
269
- return e;
270
- }, [he]), X = T(() => Ie(s), [s]), Y = T(() => {
271
- const e = c?.features, i = {};
272
- for (const [a, x] of Object.entries(X))
273
- e && a in e && e[a] !== void 0 && e[a] !== !1 || (i[a] = x);
274
- return { ...i, ...Q };
275
- }, [Q, X, c]), B = T(() => p ? [] : _e(Y), [Y, p]), M = T(() => {
276
- if (p) {
277
- const e = new Set(p.map((a) => a.name)), i = B.filter((a) => !e.has(a.name));
278
- return [...p, ...i];
279
- }
280
- return B;
281
- }, [p, B]), I = T(() => d && Ae(Ne(d), f), [d, f]), L = T(() => {
282
- const e = ke(c), i = {};
283
- if (g !== void 0 && (i.sortable = g), C !== void 0 && (i.filterable = C), v !== void 0 && (i.selectable = v), j) {
284
- const a = e?.icons || c?.icons || {};
285
- i.icons = { ...j, ...a };
286
- }
287
- if (M.length > 0 && e) {
288
- const a = e.plugins || [], x = new Set(a.map((N) => N.name)), K = M.filter((N) => !x.has(N.name));
289
- return {
290
- ...e,
291
- ...i,
292
- plugins: [...a, ...K]
293
- };
294
- }
295
- return M.length > 0 && !e ? { ...i, plugins: M } : Object.keys(i).length > 0 ? { ...e, ...i } : e;
296
- }, [c, M, g, C, v, j]);
297
- R(() => {
298
- V().setTypeDefaults(Z);
299
- }, [Z]), R(() => {
300
- o.current && (o.current.rows = n);
301
- }, [n]), R(() => {
302
- o.current && L && (o.current.gridConfig = L);
303
- }, [L]), R(() => {
304
- o.current && I && (o.current.columns = I);
305
- }, [I]), R(() => {
306
- o.current && u !== void 0 && (o.current.fitMode = u);
307
- }, [u]), R(() => {
308
- o.current && (o.current.columnInference = m);
309
- }, [m]), R(() => {
310
- o.current && G !== void 0 && (o.current.loading = G);
311
- }, [G]), R(() => {
312
- const e = o.current;
313
- if (!e) return;
314
- const i = V();
315
- e.__frameworkAdapter = i, Te(e);
316
- let a = !1;
317
- const x = requestAnimationFrame(() => {
318
- a || (typeof e.refreshColumns == "function" && e.refreshColumns(), typeof e.refreshShellHeader == "function" && e.refreshShellHeader());
319
- });
320
- return () => {
321
- a = !0, cancelAnimationFrame(x);
322
- };
323
- }, []), R(() => {
324
- if (!o.current || !w) return;
325
- const e = o.current, i = "react-custom-styles";
326
- let a = !0;
327
- return e.ready?.().then(() => {
328
- a && w && (e.registerStyles?.(i, w), D.current = i);
329
- }), () => {
330
- a = !1, D.current && (e.unregisterStyles?.(D.current), D.current = null);
331
- };
332
- }, [w]), R(() => {
333
- const e = o.current;
334
- if (!e) return;
335
- const i = [];
336
- return h && i.push(e.on("rows-change", (a) => h(a.rows))), () => {
337
- i.forEach((a) => a());
338
- };
339
- }, [h]);
340
- const ee = T(() => Object.keys(H).filter((e) => typeof P[e] == "function").sort().join("|"), [P]), re = b({});
341
- for (const e of Object.keys(H))
342
- re.current[e] = P[e];
343
- R(() => {
344
- const e = o.current;
345
- if (!e) return;
346
- const i = [];
347
- for (const [a, x] of Object.entries(H))
348
- ee.includes(a) && i.push(
349
- e.on(x, (K, N) => {
350
- re.current[a]?.(K, N);
351
- })
352
- );
353
- return () => {
354
- i.forEach((a) => a());
355
- };
356
- }, [ee]), fe(
357
- l,
358
- () => ({
359
- get element() {
360
- return o.current;
361
- },
362
- async getConfig() {
363
- return o.current?.getConfig?.() ?? {};
364
- },
365
- async ready() {
366
- return o.current?.ready?.();
367
- },
368
- async forceLayout() {
369
- return o.current?.forceLayout?.();
370
- },
371
- async toggleGroup(e) {
372
- return o.current?.toggleGroup?.(e);
373
- },
374
- registerStyles(e, i) {
375
- o.current?.registerStyles?.(e, i);
376
- },
377
- unregisterStyles(e) {
378
- o.current?.unregisterStyles?.(e);
379
- },
380
- setRowLoading(e, i) {
381
- o.current?.setRowLoading?.(e, i);
382
- },
383
- setCellLoading(e, i, a) {
384
- o.current?.setCellLoading?.(e, i, a);
385
- },
386
- isRowLoading(e) {
387
- return o.current?.isRowLoading?.(e) ?? !1;
388
- },
389
- isCellLoading(e, i) {
390
- return o.current?.isCellLoading?.(e, i) ?? !1;
391
- },
392
- clearAllLoading() {
393
- o.current?.clearAllLoading?.();
394
- }
395
- }),
396
- []
397
- );
398
- const z = b(null);
399
- return de(() => {
400
- const e = o.current;
401
- return e && z.current && ne(e, z.current), () => {
402
- e && ne(e, null);
403
- };
404
- }, []), /* @__PURE__ */ ce(U, { children: [
405
- /* @__PURE__ */ S(Ke, { ref: z }),
406
- Pe(
407
- ue.activeTag,
408
- {
409
- ref: (e) => {
410
- if (o.current = e, e && !J.current) {
411
- J.current = !0;
412
- const i = e;
413
- L && (i.gridConfig = L), n && (i.rows = n), I && (i.columns = I);
414
- }
415
- },
416
- class: F,
417
- style: y
418
- },
419
- /* @__PURE__ */ S($.Provider, { value: o, children: s })
420
- )
421
- ] });
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
+ }))] });
422
389
  });
423
- function lr(t) {
424
- const {
425
- field: r,
426
- header: l,
427
- type: n,
428
- editable: c,
429
- sortable: d,
430
- resizable: f,
431
- width: u,
432
- minWidth: m,
433
- order: g,
434
- hidden: C,
435
- lockVisible: v,
436
- children: G,
437
- editor: w,
438
- options: F,
439
- multi: y,
440
- format: s
441
- } = t, p = b(null), h = E(
442
- (D) => {
443
- p.current = D, D && (G && Se(D, G), w && Ee(D, w));
444
- },
445
- [G, w]
446
- ), P = typeof u == "number" ? `${u}px` : u, o = {
447
- field: r,
448
- ref: h
449
- };
450
- 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 });
451
400
  }
452
- function fr({ id: t, order: r = 100, children: l }) {
453
- const n = ge(), c = t ?? `tbw-header-content-${n}`, d = k($), [f, u] = A(null), m = b(null);
454
- return R(() => {
455
- const g = d?.current;
456
- if (!g) return;
457
- const C = m;
458
- let v = !1;
459
- return (async () => {
460
- try {
461
- await g.ready?.();
462
- } catch {
463
- return;
464
- }
465
- if (v) return;
466
- const G = {
467
- id: c,
468
- order: r,
469
- render: (w) => (u(w), () => {
470
- })
471
- };
472
- g.getPluginByName?.("shell")?.registerHeaderContent(G);
473
- })(), () => {
474
- v = !0, g.getPluginByName?.("shell")?.unregisterHeaderContent(c), C.current && (pe(C.current, { sync: !0 }), C.current = null), u(null);
475
- };
476
- }, [d, c, r]), R(() => {
477
- if (!f) return;
478
- const g = d?.current ?? void 0;
479
- m.current = me(f, l, m.current ?? void 0, g);
480
- }, [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;
481
438
  }
482
- function dr({ children: t }) {
483
- 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 });
484
443
  }
485
- function gr({ id: t, order: r = 100, children: l }) {
486
- const n = ge(), c = t ?? `tbw-toolbar-content-${n}`, d = k($), [f, u] = A(null), m = b(null);
487
- return R(() => {
488
- const g = d?.current;
489
- if (!g) return;
490
- const C = m;
491
- let v = !1;
492
- return (async () => {
493
- try {
494
- await g.ready?.();
495
- } catch {
496
- return;
497
- }
498
- if (v) return;
499
- const G = {
500
- id: c,
501
- order: r,
502
- render: (w) => (u(w), () => {
503
- })
504
- };
505
- g.getPluginByName?.("shell")?.registerToolbarContent(G);
506
- })(), () => {
507
- v = !0, g.getPluginByName?.("shell")?.unregisterToolbarContent(c), C.current && (pe(C.current, { sync: !0 }), C.current = null), u(null);
508
- };
509
- }, [d, c, r]), R(() => {
510
- if (!f) return;
511
- const g = d?.current ?? void 0;
512
- m.current = me(f, l, m.current ?? void 0, g);
513
- }, [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;
514
481
  }
515
- function We(t) {
516
- 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();
517
486
  }
518
- function pr(t) {
519
- const { name: r, params: l, children: n, editor: c } = t, d = b(null), f = E(
520
- (m) => {
521
- d.current = m, m && (n && xe(m, n), c && Fe(m, c));
522
- },
523
- [n, c]
524
- ), u = {
525
- name: r,
526
- ref: f
527
- };
528
- if (l)
529
- for (const [m, g] of Object.entries(l))
530
- u[`data-${We(m)}`] = String(g);
531
- return /* @__PURE__ */ ce("tbw-grid-type", { ...u, children: [
532
- n ? /* @__PURE__ */ S("tbw-grid-column-view", {}) : null,
533
- c ? /* @__PURE__ */ S("tbw-grid-column-editor", {}) : null
534
- ] });
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
+ });
535
499
  }
536
- const mr = ({ icons: t, defaults: r, children: l }) => {
537
- let n = l;
538
- return r && (n = /* @__PURE__ */ S(je, { 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 });
539
511
  };
540
- function yr(t) {
541
- 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]);
542
- R(() => {
543
- let s = !0;
544
- return (async () => {
545
- try {
546
- if (t) {
547
- const h = document.querySelector(t);
548
- if (!h) return;
549
- if (f.current = h, await h.ready?.(), s) {
550
- n(!0);
551
- const P = await h.getConfig?.();
552
- s && P && d(P);
553
- }
554
- } else {
555
- const h = r.current;
556
- if (!h) return;
557
- if (await h.ready?.(), s) {
558
- n(!0);
559
- const P = await h.getConfig?.();
560
- s && P && d(P);
561
- }
562
- }
563
- } catch {
564
- }
565
- })(), () => {
566
- s = !1;
567
- };
568
- }, [t]);
569
- const m = E(async () => {
570
- const s = u();
571
- if (s)
572
- return await s.getConfig?.() ?? null;
573
- const p = r.current;
574
- return p ? await p.getConfig?.() ?? null : null;
575
- }, [u]), g = E(async () => {
576
- const s = u();
577
- if (s) {
578
- await s.forceLayout?.();
579
- return;
580
- }
581
- const p = r.current;
582
- p && await p.forceLayout?.();
583
- }, [u]), C = E(
584
- async (s) => {
585
- const p = u();
586
- if (p) {
587
- await p.toggleGroup?.(s);
588
- return;
589
- }
590
- const h = r.current;
591
- h && await h.toggleGroup?.(s);
592
- },
593
- [u]
594
- ), v = E(
595
- (s) => u()?.getPlugin?.(s),
596
- [u]
597
- ), G = E(
598
- ((s) => u()?.getPluginByName?.(s)),
599
- [u]
600
- ), w = E(
601
- (s, p) => {
602
- const h = u();
603
- if (h) {
604
- h.registerStyles?.(s, p);
605
- return;
606
- }
607
- r.current?.registerStyles?.(s, p);
608
- },
609
- [u]
610
- ), F = E(
611
- (s) => {
612
- const p = u();
613
- if (p) {
614
- p.unregisterStyles?.(s);
615
- return;
616
- }
617
- r.current?.unregisterStyles?.(s);
618
- },
619
- [u]
620
- ), y = E(() => c?.columns ? c.columns.filter((s) => !s.hidden) : [], [c]);
621
- return {
622
- ref: r,
623
- element: u(),
624
- isReady: l,
625
- config: c,
626
- getConfig: m,
627
- forceLayout: g,
628
- toggleGroup: C,
629
- getPlugin: v,
630
- getPluginByName: G,
631
- registerStyles: w,
632
- unregisterStyles: F,
633
- getVisibleColumns: y
634
- };
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
+ };
635
592
  }
636
- function hr(t, r = {}) {
637
- const { open: l = !0, gridElement: n } = r, c = k($);
638
- R(() => {
639
- if (!l) return;
640
- const d = t.current;
641
- if (!d) return;
642
- const f = n ?? d.closest("tbw-grid, [data-tbw-grid]") ?? c?.current ?? null;
643
- if (f)
644
- return f.registerExternalFocusContainer?.(d), () => {
645
- f.unregisterExternalFocusContainer?.(d);
646
- };
647
- }, [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
+ ]);
648
611
  }
649
- export {
650
- ar as DataGrid,
651
- Ge as GridAdapter,
652
- lr as GridColumn,
653
- xr as GridDetailPanel,
654
- fr as GridHeaderContent,
655
- $e as GridIconProvider,
656
- mr as GridProvider,
657
- Dr as GridResponsiveCard,
658
- dr as GridToolButtons,
659
- wr as GridToolPanel,
660
- gr as GridToolbarContent,
661
- pr as GridType,
662
- je as GridTypeProvider,
663
- Ae as applyColumnDefaults,
664
- ir as hasColumnShorthands,
665
- Ne as normalizeColumns,
666
- Le as parseColumnShorthand,
667
- ye as registerChildFeatureDetector,
668
- Sr as registerEditorMountHook,
669
- Rr as registerFeaturePropKey,
670
- Pr as registerPostMountRefresh,
671
- yr as useGrid,
672
- sr as useGridIcons,
673
- hr as useGridOverlay,
674
- cr as useGridTypeDefaults,
675
- ur as useTypeDefault
676
- };
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 };