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