@object-ui/plugin-dashboard 3.3.1 → 3.4.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/CHANGELOG.md +22 -0
- package/dist/index.js +1400 -951
- package/dist/index.umd.cjs +3 -3
- package/dist/packages/plugin-dashboard/src/DashboardRenderer.d.ts.map +1 -1
- package/dist/packages/plugin-dashboard/src/MetricCard.d.ts.map +1 -1
- package/dist/packages/plugin-dashboard/src/MetricWidget.d.ts.map +1 -1
- package/dist/packages/plugin-dashboard/src/ObjectDataTable.d.ts.map +1 -1
- package/dist/packages/plugin-dashboard/src/ObjectMetricWidget.d.ts.map +1 -1
- package/package.json +9 -8
package/dist/index.js
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import { ComponentRegistry as e, extractRecords as t } from "@object-ui/core";
|
|
2
|
-
import { SchemaRenderer as n, SchemaRendererContext as r, useActionEngine as i, useDataScope as a, useDnd as o, useHasDndProvider as s } from "@object-ui/react";
|
|
3
|
-
import { Button as
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import ee from "clsx";
|
|
2
|
+
import { SchemaRenderer as n, SchemaRendererContext as r, useActionEngine as i, useDataScope as a, useDnd as o, useHasDndProvider as s, useObjectLabel as c } from "@object-ui/react";
|
|
3
|
+
import { Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Combobox as m, ConfigPanelRenderer as h, ConfigRow as g, Skeleton as _, cn as v, getLazyIcon as y, useConfigDraft as b } from "@object-ui/components";
|
|
4
|
+
import * as x from "react";
|
|
5
|
+
import S, { createContext as C, forwardRef as w, useCallback as T, useContext as E, useEffect as D, useMemo as O, useRef as k, useState as A } from "react";
|
|
6
|
+
import { AlertCircle as j, ArrowDownIcon as M, ArrowUpIcon as N, Edit as P, GripVertical as F, Loader2 as I, MinusIcon as L, RefreshCw as R, Save as z, Settings as ee, X as B } from "lucide-react";
|
|
7
|
+
import te from "clsx";
|
|
9
8
|
//#region \0rolldown/runtime.js
|
|
10
|
-
var
|
|
9
|
+
var V = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), H = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
11
10
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
12
11
|
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
13
12
|
});
|
|
14
13
|
//#endregion
|
|
15
14
|
//#region src/utils.ts
|
|
16
|
-
function
|
|
15
|
+
function U(e) {
|
|
17
16
|
return typeof e == "object" && !!e && !Array.isArray(e) && e.provider === "object";
|
|
18
17
|
}
|
|
19
18
|
//#endregion
|
|
20
19
|
//#region ../../node_modules/.pnpm/react@19.2.5/node_modules/react/cjs/react-jsx-runtime.production.js
|
|
21
|
-
var
|
|
20
|
+
var ne = /* @__PURE__ */ V(((e) => {
|
|
22
21
|
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
23
22
|
function r(e, n, r) {
|
|
24
23
|
var i = null;
|
|
@@ -33,7 +32,7 @@ var te = /* @__PURE__ */ B(((e) => {
|
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
34
|
e.Fragment = n, e.jsx = r, e.jsxs = r;
|
|
36
|
-
})),
|
|
35
|
+
})), re = /* @__PURE__ */ V(((e) => {
|
|
37
36
|
process.env.NODE_ENV !== "production" && (function() {
|
|
38
37
|
function t(e) {
|
|
39
38
|
if (e == null) return null;
|
|
@@ -176,7 +175,7 @@ var te = /* @__PURE__ */ B(((e) => {
|
|
|
176
175
|
function p(e) {
|
|
177
176
|
return typeof e == "object" && !!e && e.$$typeof === h;
|
|
178
177
|
}
|
|
179
|
-
var m =
|
|
178
|
+
var m = H("react"), h = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), x = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), O = Symbol.for("react.client.reference"), k = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, j = Array.isArray, M = console.createTask ? console.createTask : function() {
|
|
180
179
|
return null;
|
|
181
180
|
};
|
|
182
181
|
m = { react_stack_bottom_frame: function(e) {
|
|
@@ -191,15 +190,13 @@ var te = /* @__PURE__ */ B(((e) => {
|
|
|
191
190
|
return d(e, t, n, !0, r ? Error("react-stack-top-frame") : F, r ? M(i(e)) : I);
|
|
192
191
|
};
|
|
193
192
|
})();
|
|
194
|
-
})),
|
|
195
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
193
|
+
})), W = (/* @__PURE__ */ V(((e, t) => {
|
|
194
|
+
process.env.NODE_ENV === "production" ? t.exports = ne() : t.exports = re();
|
|
196
195
|
})))();
|
|
197
|
-
function re(e) {
|
|
198
|
-
if (!e) return null;
|
|
199
|
-
let t = O;
|
|
200
|
-
return t[e] ? t[e] : t[e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? null;
|
|
201
|
-
}
|
|
202
196
|
function ie(e) {
|
|
197
|
+
return e ? y(e) : null;
|
|
198
|
+
}
|
|
199
|
+
function G(e) {
|
|
203
200
|
if (e != null) return typeof e == "string" ? e : e.defaultValue || e.key;
|
|
204
201
|
}
|
|
205
202
|
var ae = [
|
|
@@ -208,8 +205,8 @@ var ae = [
|
|
|
208
205
|
"hsl(var(--chart-3))",
|
|
209
206
|
"hsl(var(--chart-4))",
|
|
210
207
|
"hsl(var(--chart-5))"
|
|
211
|
-
],
|
|
212
|
-
let
|
|
208
|
+
], oe = w(({ schema: e, className: t, dataSource: r, onRefresh: a, recordCount: o, userActions: s, designMode: m, selectedWidgetId: h, onWidgetClick: g, modalHandler: _, scriptHandlers: y, ...b }, x) => {
|
|
209
|
+
let S = (() => {
|
|
213
210
|
if (e.columns != null) return e.columns;
|
|
214
211
|
let t = e.widgets ?? [], n = 0;
|
|
215
212
|
for (let e of t) {
|
|
@@ -217,57 +214,63 @@ var ae = [
|
|
|
217
214
|
t > n && (n = t), (e.layout?.w ?? 0) > n && (n = e.layout.w);
|
|
218
215
|
}
|
|
219
216
|
return n > 4 ? 12 : 4;
|
|
220
|
-
})(), C =
|
|
217
|
+
})(), C = S, w = e.gap || 4, [E, j] = A(!1), [M, N] = A(!1), P = k(null), { executeAction: F, engine: I } = i({ actions: O(() => (e.header?.actions ?? []).map((e) => ({
|
|
221
218
|
name: e.actionUrl || e.label,
|
|
222
219
|
type: e.actionType || "url",
|
|
223
220
|
target: e.actionUrl,
|
|
224
221
|
label: e.label
|
|
225
|
-
})), [e.header?.actions]) })
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
222
|
+
})), [e.header?.actions]) }), { dashboardLabel: L, dashboardDescription: z, dashboardActionLabel: ee, widgetTitle: B, widgetDescription: te, fieldLabel: V } = c(), H = e.name, ne = T((e) => H ? ee(H, e.actionUrl || e.label, e.label) : e.label, [H, ee]), re = T((e) => {
|
|
223
|
+
let t = G(e.title);
|
|
224
|
+
return !H || !e.id || t === void 0 ? t : B(H, e.id, t);
|
|
225
|
+
}, [H, B]), oe = T((e) => {
|
|
226
|
+
let t = G(e.description);
|
|
227
|
+
return !H || !e.id ? t : te(H, e.id, t);
|
|
228
|
+
}, [H, te]);
|
|
229
|
+
D(() => {
|
|
230
|
+
let e = I.getRunner();
|
|
231
|
+
if (_ && e.setModalHandler(_), y) for (let [t, n] of Object.entries(y)) e.registerScript(t, n);
|
|
229
232
|
}, [
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
]),
|
|
234
|
-
let e = () =>
|
|
233
|
+
I,
|
|
234
|
+
_,
|
|
235
|
+
y
|
|
236
|
+
]), D(() => {
|
|
237
|
+
let e = () => N(window.innerWidth < 768);
|
|
235
238
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
236
239
|
}, []);
|
|
237
|
-
let
|
|
238
|
-
a && (
|
|
240
|
+
let se = T(() => {
|
|
241
|
+
a && (j(!0), a(), setTimeout(() => j(!1), 600));
|
|
239
242
|
}, [a]);
|
|
240
|
-
|
|
241
|
-
if (!(!e.refreshInterval || e.refreshInterval <= 0 || !a)) return
|
|
242
|
-
|
|
243
|
+
D(() => {
|
|
244
|
+
if (!(!e.refreshInterval || e.refreshInterval <= 0 || !a)) return P.current = setInterval(se, e.refreshInterval * 1e3), () => {
|
|
245
|
+
P.current && clearInterval(P.current);
|
|
243
246
|
};
|
|
244
247
|
}, [
|
|
245
248
|
e.refreshInterval,
|
|
246
249
|
a,
|
|
247
|
-
|
|
250
|
+
se
|
|
248
251
|
]);
|
|
249
|
-
let
|
|
250
|
-
!
|
|
251
|
-
}, [
|
|
252
|
-
if (!
|
|
252
|
+
let ce = T((e, t) => {
|
|
253
|
+
!m || !g || !t || (e.stopPropagation(), g(t));
|
|
254
|
+
}, [m, g]), K = T((t, n, r) => {
|
|
255
|
+
if (!m || !g) return;
|
|
253
256
|
let i = e.widgets || [];
|
|
254
|
-
if (t.key === "Enter" || t.key === " ") t.preventDefault(),
|
|
257
|
+
if (t.key === "Enter" || t.key === " ") t.preventDefault(), g(n ?? null);
|
|
255
258
|
else if (t.key === "ArrowRight" || t.key === "ArrowDown") {
|
|
256
259
|
t.preventDefault();
|
|
257
260
|
let e = r + 1 < i.length ? i[r + 1] : null;
|
|
258
|
-
e?.id &&
|
|
261
|
+
e?.id && g(e.id);
|
|
259
262
|
} else if (t.key === "ArrowLeft" || t.key === "ArrowUp") {
|
|
260
263
|
t.preventDefault();
|
|
261
264
|
let e = r - 1 >= 0 ? i[r - 1] : null;
|
|
262
|
-
e?.id &&
|
|
263
|
-
} else t.key === "Escape" && (t.preventDefault(),
|
|
265
|
+
e?.id && g(e.id);
|
|
266
|
+
} else t.key === "Escape" && (t.preventDefault(), g(null));
|
|
264
267
|
}, [
|
|
265
|
-
|
|
266
|
-
|
|
268
|
+
m,
|
|
269
|
+
g,
|
|
267
270
|
e.widgets
|
|
268
|
-
]),
|
|
269
|
-
!
|
|
270
|
-
}, [
|
|
271
|
+
]), le = T((e) => {
|
|
272
|
+
!m || !g || e.target === e.currentTarget && g(null);
|
|
273
|
+
}, [m, g]), q = (e, t, i) => {
|
|
271
274
|
let a = e.layout ? {
|
|
272
275
|
...e.layout,
|
|
273
276
|
w: Math.min(e.layout.w, C)
|
|
@@ -275,7 +278,7 @@ var ae = [
|
|
|
275
278
|
if (e.component) return e.component;
|
|
276
279
|
let t = e.type, n = e.options || {};
|
|
277
280
|
if (t === "metric" && e.object) {
|
|
278
|
-
let t = n.data, r =
|
|
281
|
+
let t = n.data, r = U(t) && t.aggregate ? {
|
|
279
282
|
field: e.valueField || t.aggregate.field,
|
|
280
283
|
function: e.aggregate || t.aggregate.function,
|
|
281
284
|
groupBy: e.categoryField ?? t.aggregate.groupBy ?? "_all"
|
|
@@ -286,10 +289,10 @@ var ae = [
|
|
|
286
289
|
} : void 0;
|
|
287
290
|
return {
|
|
288
291
|
type: "object-metric",
|
|
289
|
-
objectName: e.object || (
|
|
292
|
+
objectName: e.object || (U(t) ? t.object : void 0),
|
|
290
293
|
aggregate: r,
|
|
291
|
-
filter: (
|
|
292
|
-
label: n.label ||
|
|
294
|
+
filter: (U(t) ? t.filter : void 0) || e.filter,
|
|
295
|
+
label: n.label || re(e) || "",
|
|
293
296
|
fallbackValue: n.value,
|
|
294
297
|
trend: n.trend,
|
|
295
298
|
icon: n.icon,
|
|
@@ -308,7 +311,7 @@ var ae = [
|
|
|
308
311
|
objectName: e.object,
|
|
309
312
|
aggregate: t,
|
|
310
313
|
filter: e.filter,
|
|
311
|
-
label: n.label ||
|
|
314
|
+
label: n.label || re(e) || "",
|
|
312
315
|
fallbackValue: n.fallbackValue ?? n.value,
|
|
313
316
|
icon: n.icon,
|
|
314
317
|
description: n.description
|
|
@@ -320,19 +323,22 @@ var ae = [
|
|
|
320
323
|
}[t] || t;
|
|
321
324
|
if (r === "bar" || r === "line" || r === "area" || r === "pie" || r === "donut" || r === "scatter") {
|
|
322
325
|
let t = e.data || n.data, i = e.categoryField || n.xField || "name", a = e.valueField || n.yField || "value";
|
|
323
|
-
if (
|
|
326
|
+
if (U(t)) {
|
|
324
327
|
let n = t.aggregate, o = n ? {
|
|
325
328
|
field: e.valueField || n.field,
|
|
326
329
|
function: e.aggregate || n.function,
|
|
327
330
|
groupBy: e.categoryField || n.groupBy
|
|
328
|
-
} : void 0, s = o?.field || a;
|
|
331
|
+
} : void 0, s = o?.field || a, c = e.object || t.object;
|
|
329
332
|
return {
|
|
330
333
|
type: "object-chart",
|
|
331
334
|
chartType: r,
|
|
332
|
-
objectName:
|
|
335
|
+
objectName: c,
|
|
333
336
|
aggregate: o,
|
|
334
337
|
xAxisKey: i,
|
|
335
|
-
series: [{
|
|
338
|
+
series: [{
|
|
339
|
+
dataKey: s,
|
|
340
|
+
label: c ? V(c, s, s) : s
|
|
341
|
+
}],
|
|
336
342
|
colors: ae,
|
|
337
343
|
className: "h-[200px] sm:h-[250px] md:h-[300px]"
|
|
338
344
|
};
|
|
@@ -342,14 +348,17 @@ var ae = [
|
|
|
342
348
|
field: e.valueField || "value",
|
|
343
349
|
function: e.aggregate,
|
|
344
350
|
groupBy: e.categoryField || "name"
|
|
345
|
-
} : void 0;
|
|
351
|
+
} : void 0, n = e.valueField || "value";
|
|
346
352
|
return {
|
|
347
353
|
type: "object-chart",
|
|
348
354
|
chartType: r,
|
|
349
355
|
objectName: e.object,
|
|
350
356
|
aggregate: t,
|
|
351
357
|
xAxisKey: i,
|
|
352
|
-
series: [{
|
|
358
|
+
series: [{
|
|
359
|
+
dataKey: n,
|
|
360
|
+
label: V(e.object, n, n)
|
|
361
|
+
}],
|
|
353
362
|
colors: ae,
|
|
354
363
|
className: "h-[200px] sm:h-[250px] md:h-[300px]"
|
|
355
364
|
};
|
|
@@ -359,14 +368,17 @@ var ae = [
|
|
|
359
368
|
chartType: r,
|
|
360
369
|
data: Array.isArray(t) ? t : t?.items || [],
|
|
361
370
|
xAxisKey: i,
|
|
362
|
-
series: [{
|
|
371
|
+
series: [{
|
|
372
|
+
dataKey: a,
|
|
373
|
+
label: e.object ? V(e.object, a, a) : a
|
|
374
|
+
}],
|
|
363
375
|
colors: ae,
|
|
364
376
|
className: "h-[200px] sm:h-[250px] md:h-[300px]"
|
|
365
377
|
};
|
|
366
378
|
}
|
|
367
379
|
if (t === "table") {
|
|
368
380
|
let t = e.data || n.data;
|
|
369
|
-
if (
|
|
381
|
+
if (U(t)) {
|
|
370
382
|
let { data: r, ...i } = n;
|
|
371
383
|
return {
|
|
372
384
|
type: "object-data-table",
|
|
@@ -398,7 +410,7 @@ var ae = [
|
|
|
398
410
|
}
|
|
399
411
|
if (t === "pivot") {
|
|
400
412
|
let t = e.data || n.data;
|
|
401
|
-
if (
|
|
413
|
+
if (U(t)) {
|
|
402
414
|
let { data: r, ...i } = n;
|
|
403
415
|
return {
|
|
404
416
|
type: "object-pivot",
|
|
@@ -423,84 +435,90 @@ var ae = [
|
|
|
423
435
|
...e,
|
|
424
436
|
...n
|
|
425
437
|
};
|
|
426
|
-
})(), s = e.type === "metric", c =
|
|
438
|
+
})(), s = e.type === "metric", c = re(e), l = oe(e), g = e.id || c || `widget-${t}`, _ = m && h === e.id, y = m ? {
|
|
427
439
|
"data-testid": `dashboard-preview-widget-${e.id}`,
|
|
428
440
|
"data-widget-id": e.id,
|
|
429
441
|
role: "button",
|
|
430
442
|
tabIndex: 0,
|
|
431
|
-
"aria-selected":
|
|
443
|
+
"aria-selected": _,
|
|
432
444
|
"aria-label": `Widget: ${c || `Widget ${t + 1}`}`,
|
|
433
|
-
onClick: (t) =>
|
|
434
|
-
onKeyDown: (n) =>
|
|
435
|
-
} : {}, b =
|
|
436
|
-
return s ? /* @__PURE__ */ (0,
|
|
437
|
-
className:
|
|
438
|
-
style: !
|
|
445
|
+
onClick: (t) => ce(t, e.id),
|
|
446
|
+
onKeyDown: (n) => K(n, e.id, t)
|
|
447
|
+
} : {}, b = m ? v("cursor-pointer rounded-lg transition-all outline-none", "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", _ ? "ring-2 ring-primary shadow-md bg-primary/5 dark:bg-primary/10" : "hover:ring-2 hover:ring-primary/40 hover:shadow-sm") : void 0;
|
|
448
|
+
return s ? /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
449
|
+
className: v("h-full w-full", m && "relative", b),
|
|
450
|
+
style: !M && a ? {
|
|
439
451
|
gridColumn: `span ${a.w}`,
|
|
440
452
|
gridRow: `span ${a.h}`
|
|
441
453
|
} : void 0,
|
|
442
454
|
...y,
|
|
443
|
-
children: [/* @__PURE__ */ (0,
|
|
455
|
+
children: [/* @__PURE__ */ (0, W.jsx)(n, {
|
|
444
456
|
schema: o,
|
|
445
|
-
className:
|
|
457
|
+
className: v("h-full w-full", m && "pointer-events-none"),
|
|
446
458
|
dataSource: r
|
|
447
|
-
}),
|
|
459
|
+
}), m && /* @__PURE__ */ (0, W.jsx)("div", {
|
|
448
460
|
className: "absolute inset-0 z-10",
|
|
449
461
|
"aria-hidden": "true",
|
|
450
462
|
"data-testid": "widget-click-overlay"
|
|
451
463
|
})]
|
|
452
|
-
}, g) : /* @__PURE__ */ (0,
|
|
453
|
-
className:
|
|
454
|
-
style: !
|
|
464
|
+
}, g) : /* @__PURE__ */ (0, W.jsxs)(u, {
|
|
465
|
+
className: v("overflow-hidden border-border/50 shadow-sm transition-all hover:shadow-md", "bg-card/50 backdrop-blur-sm", i && "w-full", m && "relative", b),
|
|
466
|
+
style: !M && a ? {
|
|
455
467
|
gridColumn: `span ${a.w}`,
|
|
456
468
|
gridRow: `span ${a.h}`
|
|
457
469
|
} : void 0,
|
|
458
470
|
...y,
|
|
459
471
|
children: [
|
|
460
|
-
c && /* @__PURE__ */ (0,
|
|
472
|
+
c && /* @__PURE__ */ (0, W.jsxs)(f, {
|
|
461
473
|
className: "pb-2 border-b border-border/40 bg-muted/20 px-3 sm:px-6",
|
|
462
|
-
children: [/* @__PURE__ */ (0,
|
|
474
|
+
children: [/* @__PURE__ */ (0, W.jsx)(p, {
|
|
463
475
|
className: "text-sm sm:text-base font-medium tracking-tight truncate",
|
|
464
476
|
title: c,
|
|
465
477
|
children: c
|
|
466
|
-
}),
|
|
478
|
+
}), l && /* @__PURE__ */ (0, W.jsx)("p", {
|
|
467
479
|
className: "text-xs text-muted-foreground mt-0.5 line-clamp-2",
|
|
468
|
-
children:
|
|
480
|
+
children: l
|
|
469
481
|
})]
|
|
470
482
|
}),
|
|
471
|
-
/* @__PURE__ */ (0,
|
|
483
|
+
/* @__PURE__ */ (0, W.jsx)(d, {
|
|
472
484
|
className: "p-0",
|
|
473
|
-
children: /* @__PURE__ */ (0,
|
|
474
|
-
className:
|
|
475
|
-
children: /* @__PURE__ */ (0,
|
|
485
|
+
children: /* @__PURE__ */ (0, W.jsx)("div", {
|
|
486
|
+
className: v("h-full w-full", "p-3 sm:p-4 md:p-6", m && "pointer-events-none"),
|
|
487
|
+
children: /* @__PURE__ */ (0, W.jsx)(n, {
|
|
476
488
|
schema: o,
|
|
477
489
|
dataSource: r
|
|
478
490
|
})
|
|
479
491
|
})
|
|
480
492
|
}),
|
|
481
|
-
|
|
493
|
+
m && /* @__PURE__ */ (0, W.jsx)("div", {
|
|
482
494
|
className: "absolute inset-0 z-10",
|
|
483
495
|
"aria-hidden": "true",
|
|
484
496
|
"data-testid": "widget-click-overlay"
|
|
485
497
|
})
|
|
486
498
|
]
|
|
487
499
|
}, g);
|
|
488
|
-
},
|
|
500
|
+
}, ue = e.header && /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
489
501
|
className: "col-span-full mb-4",
|
|
490
502
|
children: [
|
|
491
|
-
e.header.showTitle !== !1 && e.title && /* @__PURE__ */ (0,
|
|
503
|
+
e.header.showTitle !== !1 && e.title && /* @__PURE__ */ (0, W.jsx)("h2", {
|
|
492
504
|
className: "text-lg font-semibold tracking-tight",
|
|
493
|
-
children:
|
|
505
|
+
children: H ? L({
|
|
506
|
+
name: H,
|
|
507
|
+
label: G(e.title)
|
|
508
|
+
}) : G(e.title)
|
|
494
509
|
}),
|
|
495
|
-
e.header.showDescription !== !1 && e.description && /* @__PURE__ */ (0,
|
|
510
|
+
e.header.showDescription !== !1 && e.description && /* @__PURE__ */ (0, W.jsx)("p", {
|
|
496
511
|
className: "text-sm text-muted-foreground mt-1",
|
|
497
|
-
children:
|
|
512
|
+
children: H ? z({
|
|
513
|
+
name: H,
|
|
514
|
+
description: G(e.description)
|
|
515
|
+
}) : G(e.description)
|
|
498
516
|
}),
|
|
499
|
-
e.header.actions && e.header.actions.length > 0 && /* @__PURE__ */ (0,
|
|
517
|
+
e.header.actions && e.header.actions.length > 0 && /* @__PURE__ */ (0, W.jsx)("div", {
|
|
500
518
|
className: "flex gap-2 mt-3",
|
|
501
519
|
children: e.header.actions.map((e, t) => {
|
|
502
|
-
let n =
|
|
503
|
-
return /* @__PURE__ */ (0,
|
|
520
|
+
let n = ie(e.icon);
|
|
521
|
+
return /* @__PURE__ */ (0, W.jsxs)(l, {
|
|
504
522
|
variant: "outline",
|
|
505
523
|
size: "sm",
|
|
506
524
|
onClick: async () => {
|
|
@@ -514,85 +532,85 @@ var ae = [
|
|
|
514
532
|
return;
|
|
515
533
|
}
|
|
516
534
|
if (t === "modal" || t === "script") {
|
|
517
|
-
let e = await
|
|
535
|
+
let e = await F(n || r);
|
|
518
536
|
e?.success || console.warn("[DashboardRenderer] action failed", e?.error);
|
|
519
537
|
return;
|
|
520
538
|
}
|
|
521
539
|
console.warn(`[DashboardRenderer] Unknown header actionType="${t}" for "${r}"`);
|
|
522
540
|
},
|
|
523
|
-
children: [n && /* @__PURE__ */ (0,
|
|
541
|
+
children: [n && /* @__PURE__ */ (0, W.jsx)(n, { className: "w-4 h-4 mr-1.5" }), ne(e)]
|
|
524
542
|
}, t);
|
|
525
543
|
})
|
|
526
544
|
})
|
|
527
545
|
]
|
|
528
|
-
}),
|
|
546
|
+
}), J = o !== void 0 && /* @__PURE__ */ (0, W.jsxs)("span", {
|
|
529
547
|
className: "text-xs text-muted-foreground",
|
|
530
548
|
children: [o.toLocaleString(), " records"]
|
|
531
|
-
}),
|
|
532
|
-
className:
|
|
533
|
-
children: [
|
|
549
|
+
}), Y = s ? JSON.stringify(s) : void 0, X = a && /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
550
|
+
className: v("flex items-center justify-end gap-3 mb-2", !M && "col-span-full"),
|
|
551
|
+
children: [J, /* @__PURE__ */ (0, W.jsxs)(l, {
|
|
534
552
|
variant: "outline",
|
|
535
553
|
size: "sm",
|
|
536
|
-
onClick:
|
|
537
|
-
disabled:
|
|
554
|
+
onClick: se,
|
|
555
|
+
disabled: E,
|
|
538
556
|
"aria-label": "Refresh dashboard",
|
|
539
|
-
children: [/* @__PURE__ */ (0,
|
|
557
|
+
children: [/* @__PURE__ */ (0, W.jsx)(R, { className: v("h-4 w-4 mr-2", E && "animate-spin") }), E ? "Refreshing…" : "Refresh All"]
|
|
540
558
|
})]
|
|
541
559
|
});
|
|
542
|
-
if (
|
|
560
|
+
if (M) {
|
|
543
561
|
let n = e.widgets?.filter((e) => e.type === "metric") || [], r = e.widgets?.filter((e) => e.type !== "metric") || [];
|
|
544
|
-
return /* @__PURE__ */ (0,
|
|
545
|
-
ref:
|
|
546
|
-
className:
|
|
547
|
-
"data-user-actions":
|
|
548
|
-
onClick:
|
|
549
|
-
...
|
|
562
|
+
return /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
563
|
+
ref: x,
|
|
564
|
+
className: v("flex flex-col gap-4 px-4", t),
|
|
565
|
+
"data-user-actions": Y,
|
|
566
|
+
onClick: le,
|
|
567
|
+
...b,
|
|
550
568
|
children: [
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
n.length > 0 && /* @__PURE__ */ (0,
|
|
569
|
+
ue,
|
|
570
|
+
X,
|
|
571
|
+
n.length > 0 && /* @__PURE__ */ (0, W.jsx)("div", {
|
|
554
572
|
className: "grid grid-cols-2 gap-3",
|
|
555
|
-
onClick:
|
|
556
|
-
children: n.map((e, t) =>
|
|
573
|
+
onClick: le,
|
|
574
|
+
children: n.map((e, t) => q(e, t))
|
|
557
575
|
}),
|
|
558
|
-
r.length > 0 && /* @__PURE__ */ (0,
|
|
576
|
+
r.length > 0 && /* @__PURE__ */ (0, W.jsx)("div", {
|
|
559
577
|
className: "flex flex-col gap-4",
|
|
560
|
-
onClick:
|
|
561
|
-
children: r.map((e, t) =>
|
|
578
|
+
onClick: le,
|
|
579
|
+
children: r.map((e, t) => q(e, t, !0))
|
|
562
580
|
})
|
|
563
581
|
]
|
|
564
582
|
});
|
|
565
583
|
}
|
|
566
|
-
let
|
|
567
|
-
return /* @__PURE__ */ (0,
|
|
568
|
-
ref:
|
|
569
|
-
className:
|
|
584
|
+
let de = e.columns != null || S !== 4;
|
|
585
|
+
return /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
586
|
+
ref: x,
|
|
587
|
+
className: v("grid auto-rows-min", !de && "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4", t),
|
|
570
588
|
style: {
|
|
571
|
-
...
|
|
572
|
-
gap: `${
|
|
589
|
+
...de && { gridTemplateColumns: `repeat(${C}, minmax(0, 1fr))` },
|
|
590
|
+
gap: `${w * .25}rem`
|
|
573
591
|
},
|
|
574
|
-
"data-user-actions":
|
|
575
|
-
onClick:
|
|
576
|
-
...
|
|
592
|
+
"data-user-actions": Y,
|
|
593
|
+
onClick: le,
|
|
594
|
+
...b,
|
|
577
595
|
children: [
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
e.widgets?.map((e, t) =>
|
|
596
|
+
ue,
|
|
597
|
+
X,
|
|
598
|
+
e.widgets?.map((e, t) => q(e, t))
|
|
581
599
|
]
|
|
582
600
|
});
|
|
583
601
|
});
|
|
584
602
|
//#endregion
|
|
585
603
|
//#region ../../node_modules/.pnpm/react-grid-layout@2.2.3_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-grid-layout/dist/chunk-76RTO6EO.mjs
|
|
586
|
-
function
|
|
604
|
+
function se(e) {
|
|
587
605
|
let { margin: t, containerPadding: n, containerWidth: r, cols: i } = e;
|
|
588
606
|
return (r - t[0] * (i - 1) - n[0] * 2) / i;
|
|
589
607
|
}
|
|
590
|
-
function
|
|
608
|
+
function ce(e, t, n) {
|
|
591
609
|
return Number.isFinite(e) ? Math.round(t * e + Math.max(0, e - 1) * n) : e;
|
|
592
610
|
}
|
|
593
|
-
function
|
|
594
|
-
let { margin: s, containerPadding: c, rowHeight: l } = e, u =
|
|
595
|
-
if (o ? (d = Math.round(o.width), f = Math.round(o.height)) : (d =
|
|
611
|
+
function K(e, t, n, r, i, a, o) {
|
|
612
|
+
let { margin: s, containerPadding: c, rowHeight: l } = e, u = se(e), d, f, p, m;
|
|
613
|
+
if (o ? (d = Math.round(o.width), f = Math.round(o.height)) : (d = ce(r, u, s[0]), f = ce(i, l, s[1])), a ? (p = Math.round(a.top), m = Math.round(a.left)) : o ? (p = Math.round(o.top), m = Math.round(o.left)) : (p = Math.round((l + s[1]) * n + c[1]), m = Math.round((u + s[0]) * t + c[0])), !a && !o) {
|
|
596
614
|
if (Number.isFinite(r)) {
|
|
597
615
|
let e = Math.round((u + s[0]) * (t + r) + c[0]) - m - d;
|
|
598
616
|
e !== s[0] && (d += e - s[0]);
|
|
@@ -610,51 +628,51 @@ function ce(e, t, n, r, i, a, o) {
|
|
|
610
628
|
};
|
|
611
629
|
}
|
|
612
630
|
function le(e, t, n, r, i) {
|
|
613
|
-
let { margin: a, containerPadding: o, cols: s, rowHeight: c, maxRows: l } = e, u =
|
|
614
|
-
return d =
|
|
631
|
+
let { margin: a, containerPadding: o, cols: s, rowHeight: c, maxRows: l } = e, u = se(e), d = Math.round((n - o[0]) / (u + a[0])), f = Math.round((t - o[1]) / (c + a[1]));
|
|
632
|
+
return d = J(d, 0, s - r), f = J(f, 0, l - i), {
|
|
615
633
|
x: d,
|
|
616
634
|
y: f
|
|
617
635
|
};
|
|
618
636
|
}
|
|
619
|
-
function
|
|
620
|
-
let { margin: r, containerPadding: i, rowHeight: a } = e, o =
|
|
637
|
+
function q(e, t, n) {
|
|
638
|
+
let { margin: r, containerPadding: i, rowHeight: a } = e, o = se(e);
|
|
621
639
|
return {
|
|
622
640
|
x: Math.round((n - i[0]) / (o + r[0])),
|
|
623
641
|
y: Math.round((t - i[1]) / (a + r[1]))
|
|
624
642
|
};
|
|
625
643
|
}
|
|
626
|
-
function
|
|
627
|
-
let { margin: r, rowHeight: i } = e, a =
|
|
644
|
+
function ue(e, t, n) {
|
|
645
|
+
let { margin: r, rowHeight: i } = e, a = se(e);
|
|
628
646
|
return {
|
|
629
647
|
w: Math.max(1, Math.round((t + r[0]) / (a + r[0]))),
|
|
630
648
|
h: Math.max(1, Math.round((n + r[1]) / (i + r[1])))
|
|
631
649
|
};
|
|
632
650
|
}
|
|
633
|
-
function
|
|
651
|
+
function J(e, t, n) {
|
|
634
652
|
return Math.max(Math.min(e, n), t);
|
|
635
653
|
}
|
|
636
|
-
function
|
|
654
|
+
function Y(e, t) {
|
|
637
655
|
return !(e.i === t.i || e.x + e.w <= t.x || e.x >= t.x + t.w || e.y + e.h <= t.y || e.y >= t.y + t.h);
|
|
638
656
|
}
|
|
639
|
-
function
|
|
657
|
+
function X(e, t) {
|
|
640
658
|
for (let n = 0; n < e.length; n++) {
|
|
641
659
|
let r = e[n];
|
|
642
|
-
if (r !== void 0 &&
|
|
660
|
+
if (r !== void 0 && Y(r, t)) return r;
|
|
643
661
|
}
|
|
644
662
|
}
|
|
645
|
-
function
|
|
646
|
-
return e.filter((e) =>
|
|
663
|
+
function de(e, t) {
|
|
664
|
+
return e.filter((e) => Y(e, t));
|
|
647
665
|
}
|
|
648
|
-
function
|
|
649
|
-
return t === "horizontal" ?
|
|
666
|
+
function fe(e, t) {
|
|
667
|
+
return t === "horizontal" ? me(e) : t === "vertical" || t === "wrap" ? pe(e) : [...e];
|
|
650
668
|
}
|
|
651
|
-
function
|
|
669
|
+
function pe(e) {
|
|
652
670
|
return [...e].sort((e, t) => e.y === t.y ? e.x - t.x : e.y - t.y);
|
|
653
671
|
}
|
|
654
|
-
function
|
|
672
|
+
function me(e) {
|
|
655
673
|
return [...e].sort((e, t) => e.x === t.x ? e.y - t.y : e.x - t.x);
|
|
656
674
|
}
|
|
657
|
-
function
|
|
675
|
+
function he(e) {
|
|
658
676
|
let t = 0;
|
|
659
677
|
for (let n = 0; n < e.length; n++) {
|
|
660
678
|
let r = e[n];
|
|
@@ -665,16 +683,16 @@ function ge(e) {
|
|
|
665
683
|
}
|
|
666
684
|
return t;
|
|
667
685
|
}
|
|
668
|
-
function
|
|
686
|
+
function Z(e, t) {
|
|
669
687
|
for (let n = 0; n < e.length; n++) {
|
|
670
688
|
let r = e[n];
|
|
671
689
|
if (r !== void 0 && r.i === t) return r;
|
|
672
690
|
}
|
|
673
691
|
}
|
|
674
|
-
function
|
|
692
|
+
function ge(e) {
|
|
675
693
|
return e.filter((e) => e.static === !0);
|
|
676
694
|
}
|
|
677
|
-
function
|
|
695
|
+
function _e(e) {
|
|
678
696
|
return {
|
|
679
697
|
i: e.i,
|
|
680
698
|
x: e.x,
|
|
@@ -694,15 +712,15 @@ function ye(e) {
|
|
|
694
712
|
isBounded: e.isBounded
|
|
695
713
|
};
|
|
696
714
|
}
|
|
697
|
-
function
|
|
715
|
+
function Q(e) {
|
|
698
716
|
let t = Array(e.length);
|
|
699
717
|
for (let n = 0; n < e.length; n++) {
|
|
700
718
|
let r = e[n];
|
|
701
|
-
r !== void 0 && (t[n] =
|
|
719
|
+
r !== void 0 && (t[n] = _e(r));
|
|
702
720
|
}
|
|
703
721
|
return t;
|
|
704
722
|
}
|
|
705
|
-
function
|
|
723
|
+
function ve(e, t) {
|
|
706
724
|
let n = Array(e.length);
|
|
707
725
|
for (let r = 0; r < e.length; r++) {
|
|
708
726
|
let i = e[r];
|
|
@@ -710,36 +728,36 @@ function be(e, t) {
|
|
|
710
728
|
}
|
|
711
729
|
return n;
|
|
712
730
|
}
|
|
713
|
-
function
|
|
714
|
-
let r =
|
|
715
|
-
return r ? (r = n(
|
|
731
|
+
function ye(e, t, n) {
|
|
732
|
+
let r = Z(e, t);
|
|
733
|
+
return r ? (r = n(_e(r)), [ve(e, r), r]) : [[...e], null];
|
|
716
734
|
}
|
|
717
|
-
function
|
|
718
|
-
let n =
|
|
735
|
+
function $(e, t) {
|
|
736
|
+
let n = ge(e);
|
|
719
737
|
for (let r = 0; r < e.length; r++) {
|
|
720
738
|
let i = e[r];
|
|
721
739
|
if (i !== void 0) if (i.x + i.w > t.cols && (i.x = t.cols - i.w), i.x < 0 && (i.x = 0, i.w = t.cols), !i.static) n.push(i);
|
|
722
|
-
else for (;
|
|
740
|
+
else for (; X(n, i);) i.y++;
|
|
723
741
|
}
|
|
724
742
|
return e;
|
|
725
743
|
}
|
|
726
|
-
function
|
|
744
|
+
function be(e, t, n, r, i, a, o, s, c) {
|
|
727
745
|
if (t.static && t.isDraggable !== !0 || t.y === r && t.x === n) return [...e];
|
|
728
746
|
let l = t.x, u = t.y;
|
|
729
747
|
typeof n == "number" && (t.x = n), typeof r == "number" && (t.y = r), t.moved = !0;
|
|
730
|
-
let d =
|
|
748
|
+
let d = fe(e, o);
|
|
731
749
|
(o === "vertical" && typeof r == "number" ? u >= r : o === "horizontal" && typeof n == "number" && l >= n) && (d = d.reverse());
|
|
732
|
-
let f =
|
|
733
|
-
if (p && c) return
|
|
750
|
+
let f = de(d, t), p = f.length > 0;
|
|
751
|
+
if (p && c) return Q(e);
|
|
734
752
|
if (p && a) return t.x = l, t.y = u, t.moved = !1, e;
|
|
735
753
|
let m = [...e];
|
|
736
754
|
for (let e = 0; e < f.length; e++) {
|
|
737
755
|
let n = f[e];
|
|
738
|
-
n !== void 0 && (n.moved || (m = n.static ?
|
|
756
|
+
n !== void 0 && (n.moved || (m = n.static ? xe(m, n, t, i, o) : xe(m, t, n, i, o)));
|
|
739
757
|
}
|
|
740
758
|
return m;
|
|
741
759
|
}
|
|
742
|
-
function
|
|
760
|
+
function xe(e, t, n, r, i, a) {
|
|
743
761
|
let o = i === "horizontal", s = i === "vertical", c = t.static;
|
|
744
762
|
if (r) {
|
|
745
763
|
r = !1;
|
|
@@ -749,45 +767,45 @@ function Q(e, t, n, r, i, a) {
|
|
|
749
767
|
w: n.w,
|
|
750
768
|
h: n.h,
|
|
751
769
|
i: "-1"
|
|
752
|
-
}, l =
|
|
753
|
-
if (!l) return
|
|
754
|
-
if (u && s) return
|
|
770
|
+
}, l = X(e, a), u = l !== void 0 && l.y + l.h > t.y, d = l !== void 0 && t.x + t.w > l.x;
|
|
771
|
+
if (!l) return be(e, n, o ? a.x : void 0, s ? a.y : void 0, r, c, i);
|
|
772
|
+
if (u && s) return be(e, n, void 0, n.y + 1, r, c, i);
|
|
755
773
|
if (u && i === null) return t.y = n.y, n.y += n.h, [...e];
|
|
756
|
-
if (d && o) return
|
|
774
|
+
if (d && o) return be(e, t, n.x, void 0, r, c, i);
|
|
757
775
|
}
|
|
758
776
|
let l = o ? n.x + 1 : void 0, u = s ? n.y + 1 : void 0;
|
|
759
|
-
return l === void 0 && u === void 0 ? [...e] :
|
|
777
|
+
return l === void 0 && u === void 0 ? [...e] : be(e, n, l, u, r, c, i);
|
|
760
778
|
}
|
|
761
779
|
//#endregion
|
|
762
780
|
//#region ../../node_modules/.pnpm/react-grid-layout@2.2.3_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-grid-layout/dist/chunk-KDANGDDL.mjs
|
|
763
|
-
function
|
|
781
|
+
function Se(e, t, n) {
|
|
764
782
|
return Math.max(t, Math.min(n, e));
|
|
765
783
|
}
|
|
766
|
-
var
|
|
784
|
+
var Ce = [{
|
|
767
785
|
name: "gridBounds",
|
|
768
786
|
constrainPosition(e, t, n, { cols: r, maxRows: i }) {
|
|
769
787
|
return {
|
|
770
|
-
x:
|
|
771
|
-
y:
|
|
788
|
+
x: Se(t, 0, Math.max(0, r - e.w)),
|
|
789
|
+
y: Se(n, 0, Math.max(0, i - e.h))
|
|
772
790
|
};
|
|
773
791
|
},
|
|
774
792
|
constrainSize(e, t, n, r, { cols: i, maxRows: a }) {
|
|
775
793
|
let o = r === "w" || r === "nw" || r === "sw" ? e.x + e.w : i - e.x, s = r === "n" || r === "nw" || r === "ne" ? e.y + e.h : a - e.y;
|
|
776
794
|
return {
|
|
777
|
-
w:
|
|
778
|
-
h:
|
|
795
|
+
w: Se(t, 1, Math.max(1, o)),
|
|
796
|
+
h: Se(n, 1, Math.max(1, s))
|
|
779
797
|
};
|
|
780
798
|
}
|
|
781
799
|
}, {
|
|
782
800
|
name: "minMaxSize",
|
|
783
801
|
constrainSize(e, t, n) {
|
|
784
802
|
return {
|
|
785
|
-
w:
|
|
786
|
-
h:
|
|
803
|
+
w: Se(t, e.minW ?? 1, e.maxW ?? Infinity),
|
|
804
|
+
h: Se(n, e.minH ?? 1, e.maxH ?? Infinity)
|
|
787
805
|
};
|
|
788
806
|
}
|
|
789
807
|
}];
|
|
790
|
-
function
|
|
808
|
+
function we(e, t, n, r, i) {
|
|
791
809
|
let a = {
|
|
792
810
|
x: n,
|
|
793
811
|
y: r
|
|
@@ -796,7 +814,7 @@ function Se(e, t, n, r, i) {
|
|
|
796
814
|
if (t.constraints) for (let e of t.constraints) e.constrainPosition && (a = e.constrainPosition(t, a.x, a.y, i));
|
|
797
815
|
return a;
|
|
798
816
|
}
|
|
799
|
-
function
|
|
817
|
+
function Te(e, t, n, r, i, a) {
|
|
800
818
|
let o = {
|
|
801
819
|
w: n,
|
|
802
820
|
h: r
|
|
@@ -805,7 +823,7 @@ function Ce(e, t, n, r, i, a) {
|
|
|
805
823
|
if (t.constraints) for (let e of t.constraints) e.constrainSize && (o = e.constrainSize(t, o.w, o.h, i, a));
|
|
806
824
|
return o;
|
|
807
825
|
}
|
|
808
|
-
function
|
|
826
|
+
function Ee({ top: e, left: t, width: n, height: r }) {
|
|
809
827
|
let i = `translate(${t}px,${e}px)`;
|
|
810
828
|
return {
|
|
811
829
|
transform: i,
|
|
@@ -818,7 +836,7 @@ function we({ top: e, left: t, width: n, height: r }) {
|
|
|
818
836
|
position: "absolute"
|
|
819
837
|
};
|
|
820
838
|
}
|
|
821
|
-
function
|
|
839
|
+
function De({ top: e, left: t, width: n, height: r }) {
|
|
822
840
|
return {
|
|
823
841
|
top: `${e}px`,
|
|
824
842
|
left: `${t}px`,
|
|
@@ -827,190 +845,190 @@ function Te({ top: e, left: t, width: n, height: r }) {
|
|
|
827
845
|
position: "absolute"
|
|
828
846
|
};
|
|
829
847
|
}
|
|
830
|
-
function
|
|
848
|
+
function Oe(e) {
|
|
831
849
|
return e * 100 + "%";
|
|
832
850
|
}
|
|
833
|
-
function
|
|
851
|
+
function ke(e, t, n, r) {
|
|
834
852
|
return e + n > r ? t : n;
|
|
835
853
|
}
|
|
836
|
-
function
|
|
854
|
+
function Ae(e, t, n) {
|
|
837
855
|
return e < 0 ? t : n;
|
|
838
856
|
}
|
|
839
|
-
function
|
|
857
|
+
function je(e) {
|
|
840
858
|
return Math.max(0, e);
|
|
841
859
|
}
|
|
842
|
-
function
|
|
860
|
+
function Me(e) {
|
|
843
861
|
return Math.max(0, e);
|
|
844
862
|
}
|
|
845
|
-
var
|
|
863
|
+
var Ne = (e, t, n) => {
|
|
846
864
|
let { left: r, height: i, width: a } = t, o = e.top - (i - e.height);
|
|
847
865
|
return {
|
|
848
866
|
left: r,
|
|
849
867
|
width: a,
|
|
850
|
-
height:
|
|
851
|
-
top:
|
|
868
|
+
height: Ae(o, e.height, i),
|
|
869
|
+
top: Me(o)
|
|
852
870
|
};
|
|
853
|
-
},
|
|
871
|
+
}, Pe = (e, t, n) => {
|
|
854
872
|
let { top: r, left: i, height: a, width: o } = t;
|
|
855
873
|
return {
|
|
856
874
|
top: r,
|
|
857
875
|
height: a,
|
|
858
|
-
width:
|
|
859
|
-
left:
|
|
876
|
+
width: ke(e.left, e.width, o, n),
|
|
877
|
+
left: je(i)
|
|
860
878
|
};
|
|
861
|
-
},
|
|
879
|
+
}, Fe = (e, t, n) => {
|
|
862
880
|
let { top: r, height: i, width: a } = t, o = e.left + e.width - a;
|
|
863
881
|
return o < 0 ? {
|
|
864
882
|
height: i,
|
|
865
883
|
width: e.left + e.width,
|
|
866
|
-
top:
|
|
884
|
+
top: Me(r),
|
|
867
885
|
left: 0
|
|
868
886
|
} : {
|
|
869
887
|
height: i,
|
|
870
888
|
width: a,
|
|
871
|
-
top:
|
|
889
|
+
top: Me(r),
|
|
872
890
|
left: o
|
|
873
891
|
};
|
|
874
|
-
},
|
|
892
|
+
}, Ie = (e, t, n) => {
|
|
875
893
|
let { top: r, left: i, height: a, width: o } = t;
|
|
876
894
|
return {
|
|
877
895
|
width: o,
|
|
878
896
|
left: i,
|
|
879
|
-
height:
|
|
880
|
-
top:
|
|
897
|
+
height: Ae(r, e.height, a),
|
|
898
|
+
top: Me(r)
|
|
881
899
|
};
|
|
882
|
-
},
|
|
883
|
-
n:
|
|
884
|
-
ne: (e, t, n) =>
|
|
885
|
-
e:
|
|
886
|
-
se: (e, t, n) =>
|
|
887
|
-
s:
|
|
888
|
-
sw: (e, t, n) =>
|
|
889
|
-
w:
|
|
890
|
-
nw: (e, t, n) =>
|
|
900
|
+
}, Le = {
|
|
901
|
+
n: Ne,
|
|
902
|
+
ne: (e, t, n) => Ne(e, Pe(e, t, n)),
|
|
903
|
+
e: Pe,
|
|
904
|
+
se: (e, t, n) => Ie(e, Pe(e, t, n)),
|
|
905
|
+
s: Ie,
|
|
906
|
+
sw: (e, t, n) => Ie(e, Fe(e, t)),
|
|
907
|
+
w: Fe,
|
|
908
|
+
nw: (e, t, n) => Ne(e, Fe(e, t))
|
|
891
909
|
};
|
|
892
|
-
function
|
|
893
|
-
let i =
|
|
910
|
+
function Re(e, t, n, r) {
|
|
911
|
+
let i = Le[e];
|
|
894
912
|
return i ? i(t, {
|
|
895
913
|
...t,
|
|
896
914
|
...n
|
|
897
915
|
}, r) : n;
|
|
898
916
|
}
|
|
899
|
-
var
|
|
917
|
+
var ze = {
|
|
900
918
|
type: "transform",
|
|
901
919
|
scale: 1,
|
|
902
920
|
calcStyle(e) {
|
|
903
|
-
return
|
|
921
|
+
return Ee(e);
|
|
904
922
|
}
|
|
905
|
-
},
|
|
923
|
+
}, Be = {
|
|
906
924
|
cols: 12,
|
|
907
925
|
rowHeight: 150,
|
|
908
926
|
margin: [10, 10],
|
|
909
927
|
containerPadding: null,
|
|
910
928
|
maxRows: Infinity
|
|
911
|
-
},
|
|
929
|
+
}, Ve = {
|
|
912
930
|
enabled: !0,
|
|
913
931
|
bounded: !1,
|
|
914
932
|
threshold: 3
|
|
915
|
-
},
|
|
933
|
+
}, He = {
|
|
916
934
|
enabled: !0,
|
|
917
935
|
handles: ["se"]
|
|
918
|
-
},
|
|
936
|
+
}, Ue = {
|
|
919
937
|
enabled: !1,
|
|
920
938
|
defaultItem: {
|
|
921
939
|
w: 1,
|
|
922
940
|
h: 1
|
|
923
941
|
}
|
|
924
942
|
};
|
|
925
|
-
function
|
|
943
|
+
function We(e, t, n, r, i) {
|
|
926
944
|
let a = r === "x" ? "w" : "h";
|
|
927
945
|
t[r] += 1;
|
|
928
|
-
let o = e.findIndex((e) => e.i === t.i), s = i ??
|
|
946
|
+
let o = e.findIndex((e) => e.i === t.i), s = i ?? ge(e).length > 0;
|
|
929
947
|
for (let i = o + 1; i < e.length; i++) {
|
|
930
948
|
let o = e[i];
|
|
931
949
|
if (o !== void 0 && !o.static) {
|
|
932
950
|
if (!s && o.y > t.y + t.h) break;
|
|
933
|
-
|
|
951
|
+
Y(t, o) && We(e, o, n + t[a], r, s);
|
|
934
952
|
}
|
|
935
953
|
}
|
|
936
954
|
t[r] = n;
|
|
937
955
|
}
|
|
938
|
-
function
|
|
939
|
-
for (t.x = Math.max(t.x, 0), t.y = Math.max(t.y, 0), t.y = Math.min(r, t.y); t.y > 0 && !
|
|
956
|
+
function Ge(e, t, n, r) {
|
|
957
|
+
for (t.x = Math.max(t.x, 0), t.y = Math.max(t.y, 0), t.y = Math.min(r, t.y); t.y > 0 && !X(e, t);) t.y--;
|
|
940
958
|
let i;
|
|
941
|
-
for (; (i =
|
|
959
|
+
for (; (i = X(e, t)) !== void 0;) We(n, t, i.y + i.h, "y");
|
|
942
960
|
return t.y = Math.max(t.y, 0), t;
|
|
943
961
|
}
|
|
944
|
-
function
|
|
945
|
-
for (t.x = Math.max(t.x, 0), t.y = Math.max(t.y, 0); t.x > 0 && !
|
|
962
|
+
function Ke(e, t, n, r) {
|
|
963
|
+
for (t.x = Math.max(t.x, 0), t.y = Math.max(t.y, 0); t.x > 0 && !X(e, t);) t.x--;
|
|
946
964
|
let i;
|
|
947
|
-
for (; (i =
|
|
965
|
+
for (; (i = X(e, t)) !== void 0;) if (We(r, t, i.x + i.w, "x"), t.x + t.w > n) for (t.x = n - t.w, t.y++; t.x > 0 && !X(e, t);) t.x--;
|
|
948
966
|
return t.x = Math.max(t.x, 0), t;
|
|
949
967
|
}
|
|
950
|
-
var
|
|
968
|
+
var qe = {
|
|
951
969
|
type: "vertical",
|
|
952
970
|
allowOverlap: !1,
|
|
953
971
|
compact(e, t) {
|
|
954
|
-
let n =
|
|
972
|
+
let n = ge(e), r = he(n), i = pe(e), a = Array(e.length);
|
|
955
973
|
for (let t = 0; t < i.length; t++) {
|
|
956
974
|
let o = i[t];
|
|
957
975
|
if (o === void 0) continue;
|
|
958
|
-
let s =
|
|
959
|
-
s.static || (s =
|
|
976
|
+
let s = _e(o);
|
|
977
|
+
s.static || (s = Ge(n, s, i, r), r = Math.max(r, s.y + s.h), n.push(s));
|
|
960
978
|
let c = e.indexOf(o);
|
|
961
979
|
a[c] = s, s.moved = !1;
|
|
962
980
|
}
|
|
963
981
|
return a;
|
|
964
982
|
}
|
|
965
|
-
},
|
|
983
|
+
}, Je = {
|
|
966
984
|
type: "horizontal",
|
|
967
985
|
allowOverlap: !1,
|
|
968
986
|
compact(e, t) {
|
|
969
|
-
let n =
|
|
987
|
+
let n = ge(e), r = me(e), i = Array(e.length);
|
|
970
988
|
for (let a = 0; a < r.length; a++) {
|
|
971
989
|
let o = r[a];
|
|
972
990
|
if (o === void 0) continue;
|
|
973
|
-
let s =
|
|
974
|
-
s.static || (s =
|
|
991
|
+
let s = _e(o);
|
|
992
|
+
s.static || (s = Ke(n, s, t, r), n.push(s));
|
|
975
993
|
let c = e.indexOf(o);
|
|
976
994
|
i[c] = s, s.moved = !1;
|
|
977
995
|
}
|
|
978
996
|
return i;
|
|
979
997
|
}
|
|
980
|
-
},
|
|
998
|
+
}, Ye = {
|
|
981
999
|
type: null,
|
|
982
1000
|
allowOverlap: !1,
|
|
983
1001
|
compact(e, t) {
|
|
984
|
-
return
|
|
1002
|
+
return Q(e);
|
|
985
1003
|
}
|
|
986
|
-
},
|
|
987
|
-
...
|
|
1004
|
+
}, Xe = {
|
|
1005
|
+
...qe,
|
|
988
1006
|
allowOverlap: !0,
|
|
989
1007
|
compact(e, t) {
|
|
990
|
-
return
|
|
1008
|
+
return Q(e);
|
|
991
1009
|
}
|
|
992
|
-
},
|
|
993
|
-
...
|
|
1010
|
+
}, Ze = {
|
|
1011
|
+
...Je,
|
|
994
1012
|
allowOverlap: !0,
|
|
995
1013
|
compact(e, t) {
|
|
996
|
-
return
|
|
1014
|
+
return Q(e);
|
|
997
1015
|
}
|
|
998
|
-
},
|
|
999
|
-
...
|
|
1016
|
+
}, Qe = {
|
|
1017
|
+
...Ye,
|
|
1000
1018
|
allowOverlap: !0
|
|
1001
1019
|
};
|
|
1002
|
-
function
|
|
1020
|
+
function $e(e, t = !1, n = !1) {
|
|
1003
1021
|
let r;
|
|
1004
|
-
return r = t ? e === "vertical" ?
|
|
1022
|
+
return r = t ? e === "vertical" ? Xe : e === "horizontal" ? Ze : Qe : e === "vertical" ? qe : e === "horizontal" ? Je : Ye, n ? {
|
|
1005
1023
|
...r,
|
|
1006
1024
|
preventCollision: n
|
|
1007
1025
|
} : r;
|
|
1008
1026
|
}
|
|
1009
|
-
function
|
|
1027
|
+
function et(e) {
|
|
1010
1028
|
return Object.keys(e).sort((t, n) => e[t] - e[n]);
|
|
1011
1029
|
}
|
|
1012
|
-
function
|
|
1013
|
-
let n =
|
|
1030
|
+
function tt(e, t) {
|
|
1031
|
+
let n = et(e), r = n[0];
|
|
1014
1032
|
if (r === void 0) throw Error("No breakpoints defined");
|
|
1015
1033
|
for (let i = 1; i < n.length; i++) {
|
|
1016
1034
|
let a = n[i];
|
|
@@ -1018,15 +1036,15 @@ function $e(e, t) {
|
|
|
1018
1036
|
}
|
|
1019
1037
|
return r;
|
|
1020
1038
|
}
|
|
1021
|
-
function
|
|
1039
|
+
function nt(e, t) {
|
|
1022
1040
|
let n = t[e];
|
|
1023
1041
|
if (n === void 0) throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);
|
|
1024
1042
|
return n;
|
|
1025
1043
|
}
|
|
1026
|
-
function
|
|
1044
|
+
function rt(e, t, n, r, i, a) {
|
|
1027
1045
|
let o = e[n];
|
|
1028
|
-
if (o) return
|
|
1029
|
-
let s = e[r], c =
|
|
1046
|
+
if (o) return Q(o);
|
|
1047
|
+
let s = e[r], c = et(t), l = c.slice(c.indexOf(n));
|
|
1030
1048
|
for (let t = 0; t < l.length; t++) {
|
|
1031
1049
|
let n = l[t];
|
|
1032
1050
|
if (n === void 0) continue;
|
|
@@ -1036,10 +1054,10 @@ function tt(e, t, n, r, i, a) {
|
|
|
1036
1054
|
break;
|
|
1037
1055
|
}
|
|
1038
1056
|
}
|
|
1039
|
-
let u =
|
|
1040
|
-
return (typeof a == "object" && a ? a :
|
|
1057
|
+
let u = $(Q(s || []), { cols: i });
|
|
1058
|
+
return (typeof a == "object" && a ? a : $e(a)).compact(u, i);
|
|
1041
1059
|
}
|
|
1042
|
-
function
|
|
1060
|
+
function it(e, t) {
|
|
1043
1061
|
if (Array.isArray(e)) return e;
|
|
1044
1062
|
let n = e, r = n[t];
|
|
1045
1063
|
if (r !== void 0) return r;
|
|
@@ -1052,7 +1070,7 @@ function nt(e, t) {
|
|
|
1052
1070
|
}
|
|
1053
1071
|
//#endregion
|
|
1054
1072
|
//#region ../../node_modules/.pnpm/fast-equals@4.0.3/node_modules/fast-equals/dist/fast-equals.js
|
|
1055
|
-
var
|
|
1073
|
+
var at = /* @__PURE__ */ V(((e, t) => {
|
|
1056
1074
|
(function(n, r) {
|
|
1057
1075
|
typeof e == "object" && t !== void 0 ? r(e) : typeof define == "function" && define.amd ? define(["exports"], r) : (n = typeof globalThis < "u" ? globalThis : n || self, r(n["fast-equals"] = {}));
|
|
1058
1076
|
})(e, (function(e) {
|
|
@@ -1205,15 +1223,15 @@ var rt = /* @__PURE__ */ B(((e, t) => {
|
|
|
1205
1223
|
}));
|
|
1206
1224
|
//#endregion
|
|
1207
1225
|
//#region ../../node_modules/.pnpm/react-grid-layout@2.2.3_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-grid-layout/dist/chunk-PZLKKWSX.mjs
|
|
1208
|
-
function
|
|
1209
|
-
let { measureBeforeMount: t = !1, initialWidth: n = 1280 } = e, [r, i] =
|
|
1226
|
+
function ot(e = {}) {
|
|
1227
|
+
let { measureBeforeMount: t = !1, initialWidth: n = 1280 } = e, [r, i] = A(n), [a, o] = A(!t), s = k(null), c = k(null), l = T(() => {
|
|
1210
1228
|
let e = s.current;
|
|
1211
1229
|
if (e) {
|
|
1212
1230
|
let t = e.offsetWidth;
|
|
1213
1231
|
i(t), a || o(!0);
|
|
1214
1232
|
}
|
|
1215
1233
|
}, [a]);
|
|
1216
|
-
return
|
|
1234
|
+
return D(() => {
|
|
1217
1235
|
let e = s.current;
|
|
1218
1236
|
if (e) {
|
|
1219
1237
|
if (l(), typeof ResizeObserver < "u") {
|
|
@@ -1243,7 +1261,7 @@ function it(e = {}) {
|
|
|
1243
1261
|
}
|
|
1244
1262
|
//#endregion
|
|
1245
1263
|
//#region ../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js
|
|
1246
|
-
var
|
|
1264
|
+
var st = /* @__PURE__ */ V(((e) => {
|
|
1247
1265
|
var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
|
|
1248
1266
|
function b(e) {
|
|
1249
1267
|
if (typeof e == "object" && e) {
|
|
@@ -1299,7 +1317,7 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
1299
1317
|
}, e.isValidElementType = function(e) {
|
|
1300
1318
|
return typeof e == "string" || typeof e == "function" || e === i || e === u || e === o || e === a || e === f || e === p || typeof e == "object" && !!e && (e.$$typeof === h || e.$$typeof === m || e.$$typeof === s || e.$$typeof === c || e.$$typeof === d || e.$$typeof === _ || e.$$typeof === v || e.$$typeof === y || e.$$typeof === g);
|
|
1301
1319
|
}, e.typeOf = b;
|
|
1302
|
-
})),
|
|
1320
|
+
})), ct = /* @__PURE__ */ V(((e) => {
|
|
1303
1321
|
process.env.NODE_ENV !== "production" && (function() {
|
|
1304
1322
|
var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
|
|
1305
1323
|
function b(e) {
|
|
@@ -1352,32 +1370,32 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
1352
1370
|
function B(e) {
|
|
1353
1371
|
return x(e) === d;
|
|
1354
1372
|
}
|
|
1355
|
-
function
|
|
1373
|
+
function te(e) {
|
|
1356
1374
|
return x(e) === i;
|
|
1357
1375
|
}
|
|
1358
|
-
function
|
|
1376
|
+
function V(e) {
|
|
1359
1377
|
return x(e) === h;
|
|
1360
1378
|
}
|
|
1361
|
-
function
|
|
1379
|
+
function H(e) {
|
|
1362
1380
|
return x(e) === m;
|
|
1363
1381
|
}
|
|
1364
|
-
function
|
|
1382
|
+
function U(e) {
|
|
1365
1383
|
return x(e) === r;
|
|
1366
1384
|
}
|
|
1367
|
-
function
|
|
1385
|
+
function ne(e) {
|
|
1368
1386
|
return x(e) === o;
|
|
1369
1387
|
}
|
|
1370
1388
|
function re(e) {
|
|
1371
1389
|
return x(e) === a;
|
|
1372
1390
|
}
|
|
1373
|
-
function
|
|
1391
|
+
function W(e) {
|
|
1374
1392
|
return x(e) === f;
|
|
1375
1393
|
}
|
|
1376
|
-
e.AsyncMode = S, e.ConcurrentMode = C, e.ContextConsumer = w, e.ContextProvider = T, e.Element = E, e.ForwardRef = D, e.Fragment = O, e.Lazy = k, e.Memo = A, e.Portal = j, e.Profiler = M, e.StrictMode = N, e.Suspense = P, e.isAsyncMode = I, e.isConcurrentMode = L, e.isContextConsumer = R, e.isContextProvider = z, e.isElement = ee, e.isForwardRef = B, e.isFragment =
|
|
1394
|
+
e.AsyncMode = S, e.ConcurrentMode = C, e.ContextConsumer = w, e.ContextProvider = T, e.Element = E, e.ForwardRef = D, e.Fragment = O, e.Lazy = k, e.Memo = A, e.Portal = j, e.Profiler = M, e.StrictMode = N, e.Suspense = P, e.isAsyncMode = I, e.isConcurrentMode = L, e.isContextConsumer = R, e.isContextProvider = z, e.isElement = ee, e.isForwardRef = B, e.isFragment = te, e.isLazy = V, e.isMemo = H, e.isPortal = U, e.isProfiler = ne, e.isStrictMode = re, e.isSuspense = W, e.isValidElementType = b, e.typeOf = x;
|
|
1377
1395
|
})();
|
|
1378
|
-
})),
|
|
1379
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
1380
|
-
})),
|
|
1396
|
+
})), lt = /* @__PURE__ */ V(((e, t) => {
|
|
1397
|
+
process.env.NODE_ENV === "production" ? t.exports = st() : t.exports = ct();
|
|
1398
|
+
})), ut = /* @__PURE__ */ V(((e, t) => {
|
|
1381
1399
|
var n = Object.getOwnPropertySymbols, r = Object.prototype.hasOwnProperty, i = Object.prototype.propertyIsEnumerable;
|
|
1382
1400
|
function a(e) {
|
|
1383
1401
|
if (e == null) throw TypeError("Object.assign cannot be called with null or undefined");
|
|
@@ -1410,14 +1428,14 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
1410
1428
|
}
|
|
1411
1429
|
return s;
|
|
1412
1430
|
};
|
|
1413
|
-
})),
|
|
1431
|
+
})), dt = /* @__PURE__ */ V(((e, t) => {
|
|
1414
1432
|
t.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
1415
|
-
})),
|
|
1433
|
+
})), ft = /* @__PURE__ */ V(((e, t) => {
|
|
1416
1434
|
t.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
1417
|
-
})),
|
|
1435
|
+
})), pt = /* @__PURE__ */ V(((e, t) => {
|
|
1418
1436
|
var n = function() {};
|
|
1419
1437
|
if (process.env.NODE_ENV !== "production") {
|
|
1420
|
-
var r =
|
|
1438
|
+
var r = dt(), i = {}, a = ft();
|
|
1421
1439
|
n = function(e) {
|
|
1422
1440
|
var t = "Warning: " + e;
|
|
1423
1441
|
typeof console < "u" && console.error(t);
|
|
@@ -1450,8 +1468,8 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
1450
1468
|
o.resetWarningCache = function() {
|
|
1451
1469
|
process.env.NODE_ENV !== "production" && (i = {});
|
|
1452
1470
|
}, t.exports = o;
|
|
1453
|
-
})),
|
|
1454
|
-
var n =
|
|
1471
|
+
})), mt = /* @__PURE__ */ V(((e, t) => {
|
|
1472
|
+
var n = lt(), r = ut(), i = dt(), a = ft(), o = pt(), s = function() {};
|
|
1455
1473
|
process.env.NODE_ENV !== "production" && (s = function(e) {
|
|
1456
1474
|
var t = "Warning: " + e;
|
|
1457
1475
|
typeof console < "u" && console.error(t);
|
|
@@ -1709,8 +1727,8 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
1709
1727
|
}
|
|
1710
1728
|
return p.checkPropTypes = o, p.resetWarningCache = o.resetWarningCache, p.PropTypes = p, p;
|
|
1711
1729
|
};
|
|
1712
|
-
})),
|
|
1713
|
-
var n =
|
|
1730
|
+
})), ht = /* @__PURE__ */ V(((e, t) => {
|
|
1731
|
+
var n = dt();
|
|
1714
1732
|
function r() {}
|
|
1715
1733
|
function i() {}
|
|
1716
1734
|
i.resetWarningCache = r, t.exports = function() {
|
|
@@ -1749,12 +1767,12 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
1749
1767
|
};
|
|
1750
1768
|
return a.PropTypes = a, a;
|
|
1751
1769
|
};
|
|
1752
|
-
})),
|
|
1770
|
+
})), gt = /* @__PURE__ */ V(((e, t) => {
|
|
1753
1771
|
if (process.env.NODE_ENV !== "production") {
|
|
1754
|
-
var n =
|
|
1755
|
-
t.exports =
|
|
1756
|
-
} else t.exports =
|
|
1757
|
-
})),
|
|
1772
|
+
var n = lt();
|
|
1773
|
+
t.exports = mt()(n.isElement, !0);
|
|
1774
|
+
} else t.exports = ht()();
|
|
1775
|
+
})), _t = /* @__PURE__ */ V(((e) => {
|
|
1758
1776
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.dontSetMe = a, e.findInArray = t, e.int = i, e.isFunction = n, e.isNum = r;
|
|
1759
1777
|
function t(e, t) {
|
|
1760
1778
|
for (let n = 0, r = e.length; n < r; n++) if (t.apply(t, [
|
|
@@ -1775,7 +1793,7 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
1775
1793
|
function a(e, t, n) {
|
|
1776
1794
|
if (e[t]) return /* @__PURE__ */ Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`);
|
|
1777
1795
|
}
|
|
1778
|
-
})),
|
|
1796
|
+
})), vt = /* @__PURE__ */ V(((e) => {
|
|
1779
1797
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.browserPrefixToKey = r, e.browserPrefixToStyle = i, e.default = void 0, e.getPrefix = n;
|
|
1780
1798
|
var t = [
|
|
1781
1799
|
"Moz",
|
|
@@ -1803,9 +1821,9 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
1803
1821
|
return t;
|
|
1804
1822
|
}
|
|
1805
1823
|
e.default = n();
|
|
1806
|
-
})),
|
|
1824
|
+
})), yt = /* @__PURE__ */ V(((e) => {
|
|
1807
1825
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.addClassName = S, e.addEvent = s, e.addUserSelectStyles = y, e.createCSSTransform = m, e.createSVGTransform = h, e.getTouch = _, e.getTouchIdentifier = v, e.getTranslation = g, e.innerHeight = d, e.innerWidth = f, e.matchesSelector = a, e.matchesSelectorAndParentsTo = o, e.offsetXYFromParent = p, e.outerHeight = l, e.outerWidth = u, e.removeClassName = C, e.removeEvent = c, e.scheduleRemoveUserSelectStyles = b;
|
|
1808
|
-
var t =
|
|
1826
|
+
var t = _t(), n = r(vt());
|
|
1809
1827
|
function r(e, t) {
|
|
1810
1828
|
if (typeof WeakMap == "function") var n = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap();
|
|
1811
1829
|
return (r = function(e, t) {
|
|
@@ -1929,9 +1947,9 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
1929
1947
|
function C(e, t) {
|
|
1930
1948
|
e.classList ? e.classList.remove(t) : e.className = e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`, "g"), "");
|
|
1931
1949
|
}
|
|
1932
|
-
})),
|
|
1950
|
+
})), bt = /* @__PURE__ */ V(((e) => {
|
|
1933
1951
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.canDragX = a, e.canDragY = o, e.createCoreData = c, e.createDraggableData = l, e.getBoundPosition = r, e.getControlPosition = s, e.snapToGrid = i;
|
|
1934
|
-
var t =
|
|
1952
|
+
var t = _t(), n = yt();
|
|
1935
1953
|
function r(e, r, i) {
|
|
1936
1954
|
if (!e.props.bounds) return [r, i];
|
|
1937
1955
|
let { bounds: a } = e.props;
|
|
@@ -2010,12 +2028,12 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
2010
2028
|
if (!t) throw Error("<DraggableCore>: Unmounted during event!");
|
|
2011
2029
|
return t;
|
|
2012
2030
|
}
|
|
2013
|
-
})),
|
|
2031
|
+
})), xt = /* @__PURE__ */ V(((e) => {
|
|
2014
2032
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.default = t;
|
|
2015
2033
|
function t() {}
|
|
2016
|
-
})),
|
|
2034
|
+
})), St = /* @__PURE__ */ V(((e) => {
|
|
2017
2035
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
|
|
2018
|
-
var t = l(
|
|
2036
|
+
var t = l(H("react")), n = c(gt()), r = c(H("react-dom")), i = yt(), a = bt(), o = _t(), s = c(xt());
|
|
2019
2037
|
function c(e) {
|
|
2020
2038
|
return e && e.__esModule ? e : { default: e };
|
|
2021
2039
|
}
|
|
@@ -2175,14 +2193,14 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
2175
2193
|
onMouseDown: function() {},
|
|
2176
2194
|
scale: 1
|
|
2177
2195
|
});
|
|
2178
|
-
})),
|
|
2196
|
+
})), Ct = /* @__PURE__ */ V(((e) => {
|
|
2179
2197
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "DraggableCore", {
|
|
2180
2198
|
enumerable: !0,
|
|
2181
2199
|
get: function() {
|
|
2182
2200
|
return c.default;
|
|
2183
2201
|
}
|
|
2184
2202
|
}), e.default = void 0;
|
|
2185
|
-
var t = d(
|
|
2203
|
+
var t = d(H("react")), n = u(gt()), r = u(H("react-dom")), i = H("clsx"), a = yt(), o = bt(), s = _t(), c = u(St()), l = u(xt());
|
|
2186
2204
|
function u(e) {
|
|
2187
2205
|
return e && e.__esModule ? e : { default: e };
|
|
2188
2206
|
}
|
|
@@ -2376,12 +2394,12 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
2376
2394
|
},
|
|
2377
2395
|
scale: 1
|
|
2378
2396
|
});
|
|
2379
|
-
})),
|
|
2380
|
-
var { default: n, DraggableCore: r } =
|
|
2397
|
+
})), wt = /* @__PURE__ */ V(((e, t) => {
|
|
2398
|
+
var { default: n, DraggableCore: r } = Ct();
|
|
2381
2399
|
t.exports = n, t.exports.default = n, t.exports.DraggableCore = r;
|
|
2382
|
-
})),
|
|
2400
|
+
})), Tt = /* @__PURE__ */ V(((e) => {
|
|
2383
2401
|
e.__esModule = !0, e.cloneElement = c;
|
|
2384
|
-
var t = n(
|
|
2402
|
+
var t = n(H("react"));
|
|
2385
2403
|
function n(e) {
|
|
2386
2404
|
return e && e.__esModule ? e : { default: e };
|
|
2387
2405
|
}
|
|
@@ -2431,10 +2449,10 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
2431
2449
|
function c(e, n) {
|
|
2432
2450
|
return n.style && e.props.style && (n.style = i(i({}, e.props.style), n.style)), n.className && e.props.className && (n.className = `${e.props.className} ${n.className}`), /* @__PURE__ */ t.default.cloneElement(e, n);
|
|
2433
2451
|
}
|
|
2434
|
-
})),
|
|
2452
|
+
})), Et = /* @__PURE__ */ V(((e) => {
|
|
2435
2453
|
e.__esModule = !0, e.resizableProps = void 0;
|
|
2436
|
-
var t = n(
|
|
2437
|
-
|
|
2454
|
+
var t = n(gt());
|
|
2455
|
+
wt();
|
|
2438
2456
|
function n(e) {
|
|
2439
2457
|
return e && e.__esModule ? e : { default: e };
|
|
2440
2458
|
}
|
|
@@ -2493,9 +2511,9 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
2493
2511
|
return n.axis === "both" || n.axis === "x" ? t.default.number.isRequired(...e) : t.default.number(...e);
|
|
2494
2512
|
}
|
|
2495
2513
|
};
|
|
2496
|
-
})),
|
|
2514
|
+
})), Dt = /* @__PURE__ */ V(((e) => {
|
|
2497
2515
|
e.__esModule = !0, e.default = void 0;
|
|
2498
|
-
var t = o(
|
|
2516
|
+
var t = o(H("react")), n = wt(), r = Tt(), i = Et(), a = [
|
|
2499
2517
|
"children",
|
|
2500
2518
|
"className",
|
|
2501
2519
|
"draggableOpts",
|
|
@@ -2692,9 +2710,9 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
2692
2710
|
resizeHandles: ["se"],
|
|
2693
2711
|
transformScale: 1
|
|
2694
2712
|
};
|
|
2695
|
-
})),
|
|
2713
|
+
})), Ot = /* @__PURE__ */ V(((e) => {
|
|
2696
2714
|
e.__esModule = !0, e.default = void 0;
|
|
2697
|
-
var t = s(
|
|
2715
|
+
var t = s(H("react")), n = o(gt()), r = o(Dt()), i = Et(), a = [
|
|
2698
2716
|
"handle",
|
|
2699
2717
|
"handleSize",
|
|
2700
2718
|
"onResize",
|
|
@@ -2845,26 +2863,26 @@ var at = /* @__PURE__ */ B(((e) => {
|
|
|
2845
2863
|
}
|
|
2846
2864
|
};
|
|
2847
2865
|
e.default = g, g.propTypes = u(u({}, i.resizableProps), {}, { children: n.default.element });
|
|
2848
|
-
})),
|
|
2866
|
+
})), kt = /* @__PURE__ */ V(((e, t) => {
|
|
2849
2867
|
t.exports = function() {
|
|
2850
2868
|
throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable");
|
|
2851
|
-
}, t.exports.Resizable =
|
|
2852
|
-
})),
|
|
2853
|
-
function
|
|
2854
|
-
let { children: t, cols: n, containerWidth: r, margin: i, containerPadding: a, rowHeight: o, maxRows: s, isDraggable: c, isResizable: l, isBounded: u, static: d, useCSSTransforms: f = !0, usePercentages: p = !1, transformScale: m = 1, positionStrategy: h, dragThreshold: g = 0, droppingPosition: _, className: v = "", style: y, handle:
|
|
2869
|
+
}, t.exports.Resizable = Dt().default, t.exports.ResizableBox = Ot().default;
|
|
2870
|
+
})), At = wt(), jt = kt(), Mt = at();
|
|
2871
|
+
function Nt(e) {
|
|
2872
|
+
let { children: t, cols: n, containerWidth: r, margin: i, containerPadding: a, rowHeight: o, maxRows: s, isDraggable: c, isResizable: l, isBounded: u, static: d, useCSSTransforms: f = !0, usePercentages: p = !1, transformScale: m = 1, positionStrategy: h, dragThreshold: g = 0, droppingPosition: _, className: v = "", style: y, handle: b = "", cancel: x = "", x: C, y: w, w: E, h: j, minW: M = 1, maxW: N = Infinity, minH: P = 1, maxH: F = Infinity, i: I, resizeHandles: L, resizeHandle: R, constraints: z = Ce, layoutItem: ee, layout: B = [], onDragStart: V, onDrag: H, onDragStop: U, onResizeStart: ne, onResize: re, onResizeStop: ie } = e, [G, ae] = A(!1), [oe, le] = A(!1), Y = k(null), X = k({
|
|
2855
2873
|
left: 0,
|
|
2856
2874
|
top: 0
|
|
2857
|
-
}),
|
|
2875
|
+
}), de = k({
|
|
2858
2876
|
top: 0,
|
|
2859
2877
|
left: 0,
|
|
2860
2878
|
width: 0,
|
|
2861
2879
|
height: 0
|
|
2862
|
-
}),
|
|
2863
|
-
|
|
2864
|
-
let
|
|
2880
|
+
}), fe = k(void 0), pe = k(B);
|
|
2881
|
+
pe.current = B;
|
|
2882
|
+
let me = k(null), he = k(null), Z = k(!1), ge = k({
|
|
2865
2883
|
x: 0,
|
|
2866
2884
|
y: 0
|
|
2867
|
-
}),
|
|
2885
|
+
}), _e = k(!1), Q = O(() => ({
|
|
2868
2886
|
cols: n,
|
|
2869
2887
|
containerPadding: a,
|
|
2870
2888
|
containerWidth: r,
|
|
@@ -2878,7 +2896,7 @@ function jt(e) {
|
|
|
2878
2896
|
i,
|
|
2879
2897
|
s,
|
|
2880
2898
|
o
|
|
2881
|
-
]),
|
|
2899
|
+
]), ve = O(() => ({
|
|
2882
2900
|
cols: n,
|
|
2883
2901
|
maxRows: s,
|
|
2884
2902
|
containerWidth: r,
|
|
@@ -2892,46 +2910,46 @@ function jt(e) {
|
|
|
2892
2910
|
r,
|
|
2893
2911
|
o,
|
|
2894
2912
|
i
|
|
2895
|
-
]),
|
|
2896
|
-
...
|
|
2897
|
-
layout:
|
|
2898
|
-
}), [
|
|
2913
|
+
]), ye = T(() => ({
|
|
2914
|
+
...ve,
|
|
2915
|
+
layout: pe.current
|
|
2916
|
+
}), [ve]), $ = O(() => ee ?? {
|
|
2899
2917
|
i: I,
|
|
2900
|
-
x:
|
|
2901
|
-
y:
|
|
2902
|
-
w:
|
|
2918
|
+
x: C,
|
|
2919
|
+
y: w,
|
|
2920
|
+
w: E,
|
|
2903
2921
|
h: j,
|
|
2904
2922
|
minW: M,
|
|
2905
2923
|
maxW: N,
|
|
2906
2924
|
minH: P,
|
|
2907
2925
|
maxH: F
|
|
2908
2926
|
}, [
|
|
2909
|
-
|
|
2927
|
+
ee,
|
|
2910
2928
|
I,
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2929
|
+
C,
|
|
2930
|
+
w,
|
|
2931
|
+
E,
|
|
2914
2932
|
j,
|
|
2915
2933
|
M,
|
|
2916
2934
|
N,
|
|
2917
2935
|
P,
|
|
2918
2936
|
F
|
|
2919
|
-
]),
|
|
2937
|
+
]), be = T((e) => {
|
|
2920
2938
|
if (h?.calcStyle) return h.calcStyle(e);
|
|
2921
|
-
if (f) return
|
|
2922
|
-
let t =
|
|
2939
|
+
if (f) return Ee(e);
|
|
2940
|
+
let t = De(e);
|
|
2923
2941
|
return p ? {
|
|
2924
2942
|
...t,
|
|
2925
|
-
left:
|
|
2926
|
-
width:
|
|
2943
|
+
left: Oe(e.left / r),
|
|
2944
|
+
width: Oe(e.width / r)
|
|
2927
2945
|
} : t;
|
|
2928
2946
|
}, [
|
|
2929
2947
|
h,
|
|
2930
2948
|
f,
|
|
2931
2949
|
p,
|
|
2932
2950
|
r
|
|
2933
|
-
]),
|
|
2934
|
-
if (!
|
|
2951
|
+
]), xe = T((e, { node: t }) => {
|
|
2952
|
+
if (!V) return;
|
|
2935
2953
|
let { offsetParent: n } = t;
|
|
2936
2954
|
if (!n) return;
|
|
2937
2955
|
let r = n.getBoundingClientRect(), i = t.getBoundingClientRect(), a = i.left / m, o = r.left / m, s = i.top / m, c = r.top / m, l;
|
|
@@ -2942,130 +2960,130 @@ function jt(e) {
|
|
|
2942
2960
|
left: a - o + n.scrollLeft,
|
|
2943
2961
|
top: s - c + n.scrollTop
|
|
2944
2962
|
};
|
|
2945
|
-
if (
|
|
2963
|
+
if (X.current = l, g > 0) {
|
|
2946
2964
|
let t = e;
|
|
2947
|
-
|
|
2965
|
+
ge.current = {
|
|
2948
2966
|
x: t.clientX,
|
|
2949
2967
|
y: t.clientY
|
|
2950
|
-
},
|
|
2968
|
+
}, Z.current = !0, _e.current = !1, ae(!0);
|
|
2951
2969
|
return;
|
|
2952
2970
|
}
|
|
2953
|
-
|
|
2954
|
-
let u =
|
|
2955
|
-
|
|
2971
|
+
ae(!0);
|
|
2972
|
+
let u = q(Q, l.top, l.left), { x: d, y: f } = we(z, $, u.x, u.y, ye());
|
|
2973
|
+
V(I, d, f, {
|
|
2956
2974
|
e,
|
|
2957
2975
|
node: t,
|
|
2958
2976
|
newPosition: l
|
|
2959
2977
|
});
|
|
2960
2978
|
}, [
|
|
2961
|
-
|
|
2979
|
+
V,
|
|
2962
2980
|
m,
|
|
2963
|
-
|
|
2981
|
+
Q,
|
|
2964
2982
|
h,
|
|
2965
2983
|
g,
|
|
2966
2984
|
z,
|
|
2967
|
-
|
|
2968
|
-
|
|
2985
|
+
$,
|
|
2986
|
+
ye,
|
|
2969
2987
|
I
|
|
2970
|
-
]),
|
|
2971
|
-
if (!
|
|
2988
|
+
]), Se = T((e, { node: t, deltaX: n, deltaY: a }) => {
|
|
2989
|
+
if (!H || !G) return;
|
|
2972
2990
|
let s = e;
|
|
2973
|
-
if (
|
|
2974
|
-
let n = s.clientX -
|
|
2991
|
+
if (Z.current && !_e.current) {
|
|
2992
|
+
let n = s.clientX - ge.current.x, r = s.clientY - ge.current.y;
|
|
2975
2993
|
if (Math.hypot(n, r) < g) return;
|
|
2976
|
-
if (
|
|
2977
|
-
let n =
|
|
2978
|
-
|
|
2994
|
+
if (_e.current = !0, Z.current = !1, V) {
|
|
2995
|
+
let n = q(Q, X.current.top, X.current.left), { x: r, y: i } = we(z, $, n.x, n.y, ye());
|
|
2996
|
+
V(I, r, i, {
|
|
2979
2997
|
e,
|
|
2980
2998
|
node: t,
|
|
2981
|
-
newPosition:
|
|
2999
|
+
newPosition: X.current
|
|
2982
3000
|
});
|
|
2983
3001
|
}
|
|
2984
3002
|
}
|
|
2985
|
-
let c =
|
|
3003
|
+
let c = X.current.top + a, l = X.current.left + n;
|
|
2986
3004
|
if (u) {
|
|
2987
3005
|
let { offsetParent: e } = t;
|
|
2988
3006
|
if (e) {
|
|
2989
|
-
let t = e.clientHeight -
|
|
2990
|
-
c =
|
|
2991
|
-
let n = r -
|
|
2992
|
-
l =
|
|
3007
|
+
let t = e.clientHeight - ce(j, o, i[1]);
|
|
3008
|
+
c = J(c, 0, t);
|
|
3009
|
+
let n = r - ce(E, se(Q), i[0]);
|
|
3010
|
+
l = J(l, 0, n);
|
|
2993
3011
|
}
|
|
2994
3012
|
}
|
|
2995
3013
|
let d = {
|
|
2996
3014
|
top: c,
|
|
2997
3015
|
left: l
|
|
2998
3016
|
};
|
|
2999
|
-
|
|
3000
|
-
let f =
|
|
3001
|
-
|
|
3017
|
+
X.current = d;
|
|
3018
|
+
let f = q(Q, c, l), { x: p, y: m } = we(z, $, f.x, f.y, ye());
|
|
3019
|
+
H(I, p, m, {
|
|
3002
3020
|
e,
|
|
3003
3021
|
node: t,
|
|
3004
3022
|
newPosition: d
|
|
3005
3023
|
});
|
|
3006
3024
|
}, [
|
|
3007
|
-
te,
|
|
3008
3025
|
H,
|
|
3009
|
-
|
|
3026
|
+
V,
|
|
3027
|
+
G,
|
|
3010
3028
|
g,
|
|
3011
3029
|
u,
|
|
3012
3030
|
j,
|
|
3013
3031
|
o,
|
|
3014
3032
|
i,
|
|
3015
|
-
|
|
3033
|
+
Q,
|
|
3016
3034
|
r,
|
|
3017
|
-
|
|
3035
|
+
E,
|
|
3018
3036
|
I,
|
|
3019
3037
|
z,
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
]), ke =
|
|
3023
|
-
if (!
|
|
3024
|
-
let n =
|
|
3025
|
-
if (
|
|
3038
|
+
$,
|
|
3039
|
+
ye
|
|
3040
|
+
]), ke = T((e, { node: t }) => {
|
|
3041
|
+
if (!U || !G) return;
|
|
3042
|
+
let n = Z.current;
|
|
3043
|
+
if (Z.current = !1, _e.current = !1, ge.current = {
|
|
3026
3044
|
x: 0,
|
|
3027
3045
|
y: 0
|
|
3028
3046
|
}, n) {
|
|
3029
|
-
|
|
3047
|
+
ae(!1), X.current = {
|
|
3030
3048
|
left: 0,
|
|
3031
3049
|
top: 0
|
|
3032
3050
|
};
|
|
3033
3051
|
return;
|
|
3034
3052
|
}
|
|
3035
|
-
let { left: r, top: i } =
|
|
3053
|
+
let { left: r, top: i } = X.current, a = {
|
|
3036
3054
|
top: i,
|
|
3037
3055
|
left: r
|
|
3038
3056
|
};
|
|
3039
|
-
|
|
3057
|
+
ae(!1), X.current = {
|
|
3040
3058
|
left: 0,
|
|
3041
3059
|
top: 0
|
|
3042
3060
|
};
|
|
3043
|
-
let o =
|
|
3044
|
-
|
|
3061
|
+
let o = q(Q, i, r), { x: s, y: c } = we(z, $, o.x, o.y, ye());
|
|
3062
|
+
U(I, s, c, {
|
|
3045
3063
|
e,
|
|
3046
3064
|
node: t,
|
|
3047
3065
|
newPosition: a
|
|
3048
3066
|
});
|
|
3049
3067
|
}, [
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
Y,
|
|
3053
|
-
z,
|
|
3068
|
+
U,
|
|
3069
|
+
G,
|
|
3054
3070
|
Q,
|
|
3055
|
-
|
|
3071
|
+
z,
|
|
3072
|
+
$,
|
|
3073
|
+
ye,
|
|
3056
3074
|
I
|
|
3057
3075
|
]);
|
|
3058
|
-
|
|
3059
|
-
let Ae =
|
|
3060
|
-
let s = o === "onResizeStart" ?
|
|
3076
|
+
me.current = xe, he.current = Se;
|
|
3077
|
+
let Ae = T((e, { node: t, size: n, handle: i }, a, o) => {
|
|
3078
|
+
let s = o === "onResizeStart" ? ne : o === "onResize" ? re : ie;
|
|
3061
3079
|
if (!s) return;
|
|
3062
3080
|
let c;
|
|
3063
|
-
c = t ?
|
|
3081
|
+
c = t ? Re(i, a, n, r) : {
|
|
3064
3082
|
...n,
|
|
3065
3083
|
top: a.top,
|
|
3066
3084
|
left: a.left
|
|
3067
|
-
},
|
|
3068
|
-
let l =
|
|
3085
|
+
}, de.current = c;
|
|
3086
|
+
let l = ue(Q, c.width, c.height), { w: u, h: d } = Te(z, $, l.w, l.h, i, ye());
|
|
3069
3087
|
s(I, u, d, {
|
|
3070
3088
|
e: e.nativeEvent,
|
|
3071
3089
|
node: t,
|
|
@@ -3073,71 +3091,71 @@ function jt(e) {
|
|
|
3073
3091
|
handle: i
|
|
3074
3092
|
});
|
|
3075
3093
|
}, [
|
|
3094
|
+
ne,
|
|
3076
3095
|
re,
|
|
3077
3096
|
ie,
|
|
3078
|
-
ae,
|
|
3079
3097
|
r,
|
|
3080
|
-
|
|
3098
|
+
Q,
|
|
3081
3099
|
I,
|
|
3082
3100
|
z,
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
]), je =
|
|
3086
|
-
|
|
3087
|
-
let n =
|
|
3101
|
+
$,
|
|
3102
|
+
ye
|
|
3103
|
+
]), je = T((e, t) => {
|
|
3104
|
+
le(!0);
|
|
3105
|
+
let n = K(Q, C, w, E, j);
|
|
3088
3106
|
Ae(e, {
|
|
3089
3107
|
...t,
|
|
3090
3108
|
handle: t.handle
|
|
3091
3109
|
}, n, "onResizeStart");
|
|
3092
3110
|
}, [
|
|
3093
3111
|
Ae,
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3112
|
+
Q,
|
|
3113
|
+
C,
|
|
3114
|
+
w,
|
|
3115
|
+
E,
|
|
3098
3116
|
j
|
|
3099
|
-
]), Me =
|
|
3100
|
-
let n =
|
|
3117
|
+
]), Me = T((e, t) => {
|
|
3118
|
+
let n = K(Q, C, w, E, j);
|
|
3101
3119
|
Ae(e, {
|
|
3102
3120
|
...t,
|
|
3103
3121
|
handle: t.handle
|
|
3104
3122
|
}, n, "onResize");
|
|
3105
3123
|
}, [
|
|
3106
3124
|
Ae,
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3125
|
+
Q,
|
|
3126
|
+
C,
|
|
3127
|
+
w,
|
|
3128
|
+
E,
|
|
3111
3129
|
j
|
|
3112
|
-
]), Ne =
|
|
3113
|
-
|
|
3130
|
+
]), Ne = T((e, t) => {
|
|
3131
|
+
le(!1), de.current = {
|
|
3114
3132
|
top: 0,
|
|
3115
3133
|
left: 0,
|
|
3116
3134
|
width: 0,
|
|
3117
3135
|
height: 0
|
|
3118
3136
|
};
|
|
3119
|
-
let n =
|
|
3137
|
+
let n = K(Q, C, w, E, j);
|
|
3120
3138
|
Ae(e, {
|
|
3121
3139
|
...t,
|
|
3122
3140
|
handle: t.handle
|
|
3123
3141
|
}, n, "onResizeStop");
|
|
3124
3142
|
}, [
|
|
3125
3143
|
Ae,
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3144
|
+
Q,
|
|
3145
|
+
C,
|
|
3146
|
+
w,
|
|
3147
|
+
E,
|
|
3130
3148
|
j
|
|
3131
3149
|
]);
|
|
3132
|
-
|
|
3150
|
+
D(() => {
|
|
3133
3151
|
if (!_) return;
|
|
3134
|
-
let e =
|
|
3152
|
+
let e = Y.current;
|
|
3135
3153
|
if (!e) return;
|
|
3136
|
-
let t =
|
|
3154
|
+
let t = fe.current || {
|
|
3137
3155
|
left: 0,
|
|
3138
3156
|
top: 0
|
|
3139
|
-
}, n =
|
|
3140
|
-
if (!
|
|
3157
|
+
}, n = G && (_.left !== t.left || _.top !== t.top);
|
|
3158
|
+
if (!G) {
|
|
3141
3159
|
let t = {
|
|
3142
3160
|
node: e,
|
|
3143
3161
|
deltaX: _.left,
|
|
@@ -3147,47 +3165,47 @@ function jt(e) {
|
|
|
3147
3165
|
x: _.left,
|
|
3148
3166
|
y: _.top
|
|
3149
3167
|
};
|
|
3150
|
-
|
|
3168
|
+
me.current?.(_.e, t);
|
|
3151
3169
|
} else if (n) {
|
|
3152
3170
|
let t = {
|
|
3153
3171
|
node: e,
|
|
3154
|
-
deltaX: _.left -
|
|
3155
|
-
deltaY: _.top -
|
|
3156
|
-
lastX:
|
|
3157
|
-
lastY:
|
|
3172
|
+
deltaX: _.left - X.current.left,
|
|
3173
|
+
deltaY: _.top - X.current.top,
|
|
3174
|
+
lastX: X.current.left,
|
|
3175
|
+
lastY: X.current.top,
|
|
3158
3176
|
x: _.left,
|
|
3159
3177
|
y: _.top
|
|
3160
3178
|
};
|
|
3161
|
-
|
|
3179
|
+
he.current?.(_.e, t);
|
|
3162
3180
|
}
|
|
3163
|
-
|
|
3181
|
+
fe.current = _;
|
|
3164
3182
|
}, [
|
|
3165
3183
|
_,
|
|
3166
|
-
|
|
3184
|
+
G,
|
|
3167
3185
|
I
|
|
3168
3186
|
]);
|
|
3169
|
-
let Pe =
|
|
3170
|
-
ref:
|
|
3171
|
-
className:
|
|
3187
|
+
let Pe = K(Q, C, w, E, j, G ? X.current : null, oe ? de.current : null), Fe = S.Children.only(t), Ie = se(Q), Le = [ce(M, Ie, i[0]), ce(P, o, i[1])], ze = [ce(N, Ie, i[0]), ce(F, o, i[1])], Be = Fe.props, Ve = Be.className, He = Be.style, Ue = S.cloneElement(Fe, {
|
|
3188
|
+
ref: Y,
|
|
3189
|
+
className: te("react-grid-item", Ve, v, {
|
|
3172
3190
|
static: d,
|
|
3173
|
-
resizing:
|
|
3191
|
+
resizing: oe,
|
|
3174
3192
|
"react-draggable": c,
|
|
3175
|
-
"react-draggable-dragging":
|
|
3193
|
+
"react-draggable-dragging": G,
|
|
3176
3194
|
dropping: !!_,
|
|
3177
3195
|
cssTransforms: f
|
|
3178
3196
|
}),
|
|
3179
3197
|
style: {
|
|
3180
3198
|
...y,
|
|
3181
3199
|
...He,
|
|
3182
|
-
|
|
3200
|
+
...be(Pe)
|
|
3183
3201
|
}
|
|
3184
3202
|
}), We = R;
|
|
3185
|
-
return Ue = /* @__PURE__ */ (0,
|
|
3203
|
+
return Ue = /* @__PURE__ */ (0, W.jsx)(jt.Resizable, {
|
|
3186
3204
|
draggableOpts: { disabled: !l },
|
|
3187
3205
|
className: l ? void 0 : "react-resizable-hide",
|
|
3188
3206
|
width: Pe.width,
|
|
3189
3207
|
height: Pe.height,
|
|
3190
|
-
minConstraints:
|
|
3208
|
+
minConstraints: Le,
|
|
3191
3209
|
maxConstraints: ze,
|
|
3192
3210
|
onResizeStart: je,
|
|
3193
3211
|
onResize: Me,
|
|
@@ -3196,24 +3214,24 @@ function jt(e) {
|
|
|
3196
3214
|
resizeHandles: L,
|
|
3197
3215
|
handle: We,
|
|
3198
3216
|
children: Ue
|
|
3199
|
-
}), Ue = /* @__PURE__ */ (0,
|
|
3217
|
+
}), Ue = /* @__PURE__ */ (0, W.jsx)(At.DraggableCore, {
|
|
3200
3218
|
disabled: !c,
|
|
3201
|
-
onStart:
|
|
3202
|
-
onDrag:
|
|
3219
|
+
onStart: xe,
|
|
3220
|
+
onDrag: Se,
|
|
3203
3221
|
onStop: ke,
|
|
3204
|
-
handle:
|
|
3205
|
-
cancel: ".react-resizable-handle" + (
|
|
3222
|
+
handle: b,
|
|
3223
|
+
cancel: ".react-resizable-handle" + (x ? "," + x : ""),
|
|
3206
3224
|
scale: m,
|
|
3207
|
-
nodeRef:
|
|
3225
|
+
nodeRef: Y,
|
|
3208
3226
|
children: Ue
|
|
3209
3227
|
}), Ue;
|
|
3210
3228
|
}
|
|
3211
|
-
var
|
|
3229
|
+
var Pt = () => {}, Ft = "react-grid-layout", It = !1;
|
|
3212
3230
|
try {
|
|
3213
|
-
|
|
3231
|
+
It = /firefox/i.test(navigator.userAgent);
|
|
3214
3232
|
} catch {}
|
|
3215
|
-
function
|
|
3216
|
-
let n =
|
|
3233
|
+
function Lt(e, t) {
|
|
3234
|
+
let n = S.Children.toArray(e), r = S.Children.toArray(t);
|
|
3217
3235
|
if (n.length !== r.length) return !1;
|
|
3218
3236
|
for (let e = 0; e < n.length; e++) {
|
|
3219
3237
|
let t = n[e], i = r[e];
|
|
@@ -3221,14 +3239,14 @@ function Ft(e, t) {
|
|
|
3221
3239
|
}
|
|
3222
3240
|
return !0;
|
|
3223
3241
|
}
|
|
3224
|
-
function
|
|
3242
|
+
function Rt(e, t, n, r) {
|
|
3225
3243
|
let i = [], a = /* @__PURE__ */ new Set();
|
|
3226
|
-
|
|
3227
|
-
if (!
|
|
3244
|
+
S.Children.forEach(t, (t) => {
|
|
3245
|
+
if (!S.isValidElement(t) || t.key === null) return;
|
|
3228
3246
|
let n = String(t.key);
|
|
3229
3247
|
a.add(n);
|
|
3230
3248
|
let r = e.find((e) => e.i === n);
|
|
3231
|
-
if (r) i.push(
|
|
3249
|
+
if (r) i.push(_e(r));
|
|
3232
3250
|
else {
|
|
3233
3251
|
let e = t.props["data-grid"];
|
|
3234
3252
|
e ? i.push({
|
|
@@ -3249,71 +3267,71 @@ function It(e, t, n, r) {
|
|
|
3249
3267
|
}) : i.push({
|
|
3250
3268
|
i: n,
|
|
3251
3269
|
x: 0,
|
|
3252
|
-
y:
|
|
3270
|
+
y: he(i),
|
|
3253
3271
|
w: 1,
|
|
3254
3272
|
h: 1
|
|
3255
3273
|
});
|
|
3256
3274
|
}
|
|
3257
3275
|
});
|
|
3258
|
-
let o =
|
|
3276
|
+
let o = $(i, { cols: n });
|
|
3259
3277
|
return r.compact(o, n);
|
|
3260
3278
|
}
|
|
3261
|
-
function
|
|
3262
|
-
let { children: t, width: n, gridConfig: r, dragConfig: i, resizeConfig: a, dropConfig: o, positionStrategy: s =
|
|
3263
|
-
...
|
|
3279
|
+
function zt(e) {
|
|
3280
|
+
let { children: t, width: n, gridConfig: r, dragConfig: i, resizeConfig: a, dropConfig: o, positionStrategy: s = ze, compactor: c, constraints: l = Ce, layout: u = [], droppingItem: d, autoSize: f = !0, className: p = "", style: m = {}, innerRef: h, onLayoutChange: g = Pt, onDragStart: _ = Pt, onDrag: v = Pt, onDragStop: y = Pt, onResizeStart: b = Pt, onResize: x = Pt, onResizeStop: C = Pt, onDrop: w = Pt, onDropDragOver: E = Pt } = e, j = O(() => ({
|
|
3281
|
+
...Be,
|
|
3264
3282
|
...r
|
|
3265
|
-
}), [r]), M =
|
|
3266
|
-
...
|
|
3283
|
+
}), [r]), M = O(() => ({
|
|
3284
|
+
...Ve,
|
|
3267
3285
|
...i
|
|
3268
|
-
}), [i]), N =
|
|
3269
|
-
...
|
|
3286
|
+
}), [i]), N = O(() => ({
|
|
3287
|
+
...He,
|
|
3270
3288
|
...a
|
|
3271
|
-
}), [a]), P =
|
|
3272
|
-
...
|
|
3289
|
+
}), [a]), P = O(() => ({
|
|
3290
|
+
...Ue,
|
|
3273
3291
|
...o
|
|
3274
|
-
}), [o]), { cols: F, rowHeight: I, maxRows: L, margin: R, containerPadding: z } = j, { enabled:
|
|
3292
|
+
}), [o]), { cols: F, rowHeight: I, maxRows: L, margin: R, containerPadding: z } = j, { enabled: ee, bounded: B, handle: V, cancel: H, threshold: U } = M, { enabled: ne, handles: re, handleComponent: ie } = N, { enabled: G, defaultItem: ae, onDragOver: oe } = P, K = c ?? $e("vertical"), q = K.type, ue = K.allowOverlap, J = K.preventCollision ?? !1, Y = O(() => d ?? {
|
|
3275
3293
|
i: "__dropping-elem__",
|
|
3276
|
-
...
|
|
3277
|
-
}, [d,
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
}, []),
|
|
3294
|
+
...ae
|
|
3295
|
+
}, [d, ae]), X = s.type === "transform", fe = s.scale, pe = z ?? R, [me, ge] = A(!1), [Q, ve] = A(() => Rt(u, t, F, K)), [$, xe] = A(null), [Se, we] = A(!1), [Te, Ee] = A(null), [De, Oe] = A(), ke = k(null), Ae = k(null), je = k(null), Me = k(0), Ne = k(Q), Pe = k(u), Fe = k(t), Ie = k(q), Le = k(Q);
|
|
3296
|
+
Le.current = Q, D(() => {
|
|
3297
|
+
ge(!0), (0, Mt.deepEqual)(Q, u) || g(Q);
|
|
3298
|
+
}, []), D(() => {
|
|
3281
3299
|
if ($ || Te) return;
|
|
3282
|
-
let e = !(0,
|
|
3300
|
+
let e = !(0, Mt.deepEqual)(u, Pe.current), n = !Lt(t, Fe.current), r = q !== Ie.current;
|
|
3283
3301
|
if (e || n || r) {
|
|
3284
|
-
let n =
|
|
3285
|
-
(0,
|
|
3302
|
+
let n = Rt(e ? u : Q, t, F, K);
|
|
3303
|
+
(0, Mt.deepEqual)(n, Q) || ve(n);
|
|
3286
3304
|
}
|
|
3287
|
-
Pe.current = u, Fe.current = t, Ie.current =
|
|
3305
|
+
Pe.current = u, Fe.current = t, Ie.current = q;
|
|
3288
3306
|
}, [
|
|
3289
3307
|
u,
|
|
3290
3308
|
t,
|
|
3291
3309
|
F,
|
|
3292
|
-
|
|
3293
|
-
|
|
3310
|
+
q,
|
|
3311
|
+
K,
|
|
3294
3312
|
$,
|
|
3295
3313
|
Te,
|
|
3296
|
-
|
|
3297
|
-
]),
|
|
3298
|
-
!$ && !(0,
|
|
3314
|
+
Q
|
|
3315
|
+
]), D(() => {
|
|
3316
|
+
!$ && !(0, Mt.deepEqual)(Q, Ne.current) && (Ne.current = Q, g(Q.filter((e) => e.i !== Y.i)));
|
|
3299
3317
|
}, [
|
|
3300
|
-
|
|
3318
|
+
Q,
|
|
3301
3319
|
$,
|
|
3302
3320
|
g,
|
|
3303
|
-
|
|
3321
|
+
Y.i
|
|
3304
3322
|
]);
|
|
3305
|
-
let
|
|
3323
|
+
let Re = O(() => {
|
|
3306
3324
|
if (!f) return;
|
|
3307
|
-
let e =
|
|
3325
|
+
let e = he(Q), t = pe[1];
|
|
3308
3326
|
return e * I + (e - 1) * R[1] + t * 2 + "px";
|
|
3309
3327
|
}, [
|
|
3310
3328
|
f,
|
|
3311
|
-
|
|
3329
|
+
Q,
|
|
3312
3330
|
I,
|
|
3313
3331
|
R,
|
|
3314
|
-
|
|
3315
|
-
]), We =
|
|
3316
|
-
let i =
|
|
3332
|
+
pe
|
|
3333
|
+
]), We = T((e, t, n, r) => {
|
|
3334
|
+
let i = Le.current, a = Z(i, e);
|
|
3317
3335
|
if (!a) return;
|
|
3318
3336
|
let o = {
|
|
3319
3337
|
w: a.w,
|
|
@@ -3322,9 +3340,9 @@ function Lt(e) {
|
|
|
3322
3340
|
y: a.y,
|
|
3323
3341
|
i: e
|
|
3324
3342
|
};
|
|
3325
|
-
ke.current =
|
|
3326
|
-
}, [_]), Ge =
|
|
3327
|
-
let i =
|
|
3343
|
+
ke.current = _e(a), je.current = i, xe(o), _(i, a, a, null, r.e, r.node);
|
|
3344
|
+
}, [_]), Ge = T((e, t, n, r) => {
|
|
3345
|
+
let i = Le.current, a = ke.current, o = Z(i, e);
|
|
3328
3346
|
if (!o) return;
|
|
3329
3347
|
let s = {
|
|
3330
3348
|
w: o.w,
|
|
@@ -3332,37 +3350,37 @@ function Lt(e) {
|
|
|
3332
3350
|
x: o.x,
|
|
3333
3351
|
y: o.y,
|
|
3334
3352
|
i: e
|
|
3335
|
-
}, c =
|
|
3336
|
-
v(c, a, o, s, r.e, r.node),
|
|
3353
|
+
}, c = be(i, o, t, n, !0, J, q, F, ue);
|
|
3354
|
+
v(c, a, o, s, r.e, r.node), ve(K.compact(c, F)), xe(s);
|
|
3337
3355
|
}, [
|
|
3338
|
-
|
|
3339
|
-
|
|
3356
|
+
J,
|
|
3357
|
+
q,
|
|
3340
3358
|
F,
|
|
3341
|
-
|
|
3342
|
-
|
|
3359
|
+
ue,
|
|
3360
|
+
K,
|
|
3343
3361
|
v
|
|
3344
|
-
]), Ke =
|
|
3362
|
+
]), Ke = T((e, t, n, r) => {
|
|
3345
3363
|
if (!$) return;
|
|
3346
|
-
let i =
|
|
3364
|
+
let i = Le.current, a = ke.current, o = Z(i, e);
|
|
3347
3365
|
if (!o) return;
|
|
3348
|
-
let s =
|
|
3366
|
+
let s = be(i, o, t, n, !0, J, q, F, ue), c = K.compact(s, F);
|
|
3349
3367
|
y(c, a, o, null, r.e, r.node);
|
|
3350
3368
|
let l = je.current;
|
|
3351
|
-
ke.current = null, je.current = null,
|
|
3369
|
+
ke.current = null, je.current = null, xe(null), ve(c), l && !(0, Mt.deepEqual)(l, c) && g(c);
|
|
3352
3370
|
}, [
|
|
3353
3371
|
$,
|
|
3354
|
-
|
|
3355
|
-
|
|
3372
|
+
J,
|
|
3373
|
+
q,
|
|
3356
3374
|
F,
|
|
3357
|
-
|
|
3358
|
-
|
|
3375
|
+
ue,
|
|
3376
|
+
K,
|
|
3359
3377
|
y,
|
|
3360
3378
|
g
|
|
3361
|
-
]), qe =
|
|
3362
|
-
let i =
|
|
3363
|
-
a && (Ae.current =
|
|
3364
|
-
}, [
|
|
3365
|
-
let i =
|
|
3379
|
+
]), qe = T((e, t, n, r) => {
|
|
3380
|
+
let i = Le.current, a = Z(i, e);
|
|
3381
|
+
a && (Ae.current = _e(a), je.current = i, we(!0), b(i, a, a, null, r.e, r.node));
|
|
3382
|
+
}, [b]), Je = T((e, t, n, r) => {
|
|
3383
|
+
let i = Le.current, a = Ae.current, { handle: o } = r, s = !1, c, l, [u, d] = ye(i, e, (e) => (c = e.x, l = e.y, [
|
|
3366
3384
|
"sw",
|
|
3367
3385
|
"w",
|
|
3368
3386
|
"nw",
|
|
@@ -3376,7 +3394,7 @@ function Lt(e) {
|
|
|
3376
3394
|
"ne",
|
|
3377
3395
|
"n",
|
|
3378
3396
|
"nw"
|
|
3379
|
-
].includes(o) && (l = e.y + (e.h - n), n = e.y !== l && l < 0 ? e.h : n, l = l < 0 ? 0 : l), s = !0),
|
|
3397
|
+
].includes(o) && (l = e.y + (e.h - n), n = e.y !== l && l < 0 ? e.h : n, l = l < 0 ? 0 : l), s = !0), J && !ue && de(i, {
|
|
3380
3398
|
...e,
|
|
3381
3399
|
w: t,
|
|
3382
3400
|
h: n,
|
|
@@ -3385,7 +3403,7 @@ function Lt(e) {
|
|
|
3385
3403
|
}).filter((t) => t.i !== e.i).length > 0 && (l = e.y, n = e.h, c = e.x, t = e.w, s = !1), e.w = t, e.h = n, e));
|
|
3386
3404
|
if (!d) return;
|
|
3387
3405
|
let f = u;
|
|
3388
|
-
s && c !== void 0 && l !== void 0 && (f =
|
|
3406
|
+
s && c !== void 0 && l !== void 0 && (f = be(u, d, c, l, !0, J, q, F, ue));
|
|
3389
3407
|
let p = {
|
|
3390
3408
|
w: d.w,
|
|
3391
3409
|
h: d.h,
|
|
@@ -3394,41 +3412,41 @@ function Lt(e) {
|
|
|
3394
3412
|
i: e,
|
|
3395
3413
|
static: !0
|
|
3396
3414
|
};
|
|
3397
|
-
|
|
3415
|
+
x(f, a, d, p, r.e, r.node), ve(K.compact(f, F)), xe(p);
|
|
3398
3416
|
}, [
|
|
3399
|
-
|
|
3400
|
-
|
|
3417
|
+
J,
|
|
3418
|
+
q,
|
|
3401
3419
|
F,
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
]), Ye =
|
|
3406
|
-
let i =
|
|
3407
|
-
|
|
3420
|
+
ue,
|
|
3421
|
+
K,
|
|
3422
|
+
x
|
|
3423
|
+
]), Ye = T((e, t, n, r) => {
|
|
3424
|
+
let i = Le.current, a = Ae.current, o = Z(i, e), s = K.compact(i, F);
|
|
3425
|
+
C(s, a, o ?? null, null, r.e, r.node);
|
|
3408
3426
|
let c = je.current;
|
|
3409
|
-
Ae.current = null, je.current = null,
|
|
3427
|
+
Ae.current = null, je.current = null, xe(null), we(!1), ve(s), c && !(0, Mt.deepEqual)(c, s) && g(s);
|
|
3410
3428
|
}, [
|
|
3411
3429
|
F,
|
|
3412
|
-
|
|
3413
|
-
|
|
3430
|
+
K,
|
|
3431
|
+
C,
|
|
3414
3432
|
g
|
|
3415
|
-
]), Xe =
|
|
3416
|
-
let e =
|
|
3417
|
-
if (!e.some((e) => e.i ===
|
|
3418
|
-
Ee(null),
|
|
3433
|
+
]), Xe = T(() => {
|
|
3434
|
+
let e = Le.current;
|
|
3435
|
+
if (!e.some((e) => e.i === Y.i)) {
|
|
3436
|
+
Ee(null), xe(null), Oe(void 0);
|
|
3419
3437
|
return;
|
|
3420
3438
|
}
|
|
3421
|
-
|
|
3439
|
+
ve(K.compact(e.filter((e) => e.i !== Y.i), F)), Ee(null), xe(null), Oe(void 0);
|
|
3422
3440
|
}, [
|
|
3423
|
-
|
|
3441
|
+
Y.i,
|
|
3424
3442
|
F,
|
|
3425
|
-
|
|
3426
|
-
]),
|
|
3427
|
-
if (e.preventDefault(), e.stopPropagation(),
|
|
3428
|
-
let t =
|
|
3443
|
+
K
|
|
3444
|
+
]), Ze = T((e) => {
|
|
3445
|
+
if (e.preventDefault(), e.stopPropagation(), It && !e.nativeEvent.target?.classList.contains(Ft)) return !1;
|
|
3446
|
+
let t = oe ? oe(e.nativeEvent) : E(e);
|
|
3429
3447
|
if (t === !1) return Te && Xe(), !1;
|
|
3430
3448
|
let { dragOffsetX: r = 0, dragOffsetY: i = 0, ...a } = t ?? {}, o = {
|
|
3431
|
-
...
|
|
3449
|
+
...Y,
|
|
3432
3450
|
...a
|
|
3433
3451
|
}, s = e.currentTarget.getBoundingClientRect(), c = {
|
|
3434
3452
|
cols: F,
|
|
@@ -3436,16 +3454,16 @@ function Lt(e) {
|
|
|
3436
3454
|
maxRows: L,
|
|
3437
3455
|
rowHeight: I,
|
|
3438
3456
|
containerWidth: n,
|
|
3439
|
-
containerPadding:
|
|
3440
|
-
}, l =
|
|
3441
|
-
left: g /
|
|
3442
|
-
top: _ /
|
|
3457
|
+
containerPadding: pe
|
|
3458
|
+
}, l = se(c), u = ce(o.w, l, R[0]), d = ce(o.h, I, R[1]), f = u / 2, p = d / 2, m = e.clientX - s.left + r - f, h = e.clientY - s.top + i - p, g = Math.max(0, m), _ = Math.max(0, h), v = {
|
|
3459
|
+
left: g / fe,
|
|
3460
|
+
top: _ / fe,
|
|
3443
3461
|
e: e.nativeEvent
|
|
3444
3462
|
};
|
|
3445
3463
|
if (Te) De && (De.left !== v.left || De.top !== v.top) && Oe(v);
|
|
3446
3464
|
else {
|
|
3447
3465
|
let e = le(c, _, g, o.w, o.h);
|
|
3448
|
-
Ee(/* @__PURE__ */ (0,
|
|
3466
|
+
Ee(/* @__PURE__ */ (0, W.jsx)("div", {}, o.i)), Oe(v), ve([...Le.current.filter((e) => e.i !== o.i), {
|
|
3449
3467
|
...o,
|
|
3450
3468
|
x: e.x,
|
|
3451
3469
|
y: e.y,
|
|
@@ -3456,43 +3474,43 @@ function Lt(e) {
|
|
|
3456
3474
|
}, [
|
|
3457
3475
|
Te,
|
|
3458
3476
|
De,
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3477
|
+
Y,
|
|
3478
|
+
oe,
|
|
3479
|
+
E,
|
|
3462
3480
|
Xe,
|
|
3463
|
-
|
|
3481
|
+
fe,
|
|
3464
3482
|
F,
|
|
3465
3483
|
R,
|
|
3466
3484
|
L,
|
|
3467
3485
|
I,
|
|
3468
3486
|
n,
|
|
3469
|
-
|
|
3470
|
-
]),
|
|
3487
|
+
pe
|
|
3488
|
+
]), Qe = T((e) => {
|
|
3471
3489
|
e.preventDefault(), e.stopPropagation(), Me.current--, Me.current < 0 && (Me.current = 0), Me.current === 0 && Xe();
|
|
3472
|
-
}, [Xe]), et =
|
|
3490
|
+
}, [Xe]), et = T((e) => {
|
|
3473
3491
|
e.preventDefault(), e.stopPropagation(), Me.current++;
|
|
3474
|
-
}, []), tt =
|
|
3492
|
+
}, []), tt = T((e) => {
|
|
3475
3493
|
e.preventDefault(), e.stopPropagation();
|
|
3476
|
-
let t =
|
|
3477
|
-
Me.current = 0, Xe(),
|
|
3494
|
+
let t = Le.current, n = t.find((e) => e.i === Y.i);
|
|
3495
|
+
Me.current = 0, Xe(), w(t, n, e.nativeEvent);
|
|
3478
3496
|
}, [
|
|
3479
|
-
|
|
3497
|
+
Y.i,
|
|
3480
3498
|
Xe,
|
|
3481
|
-
|
|
3482
|
-
]), nt =
|
|
3499
|
+
w
|
|
3500
|
+
]), nt = T((e, t) => {
|
|
3483
3501
|
if (!e || !e.key) return null;
|
|
3484
|
-
let r =
|
|
3502
|
+
let r = Z(Q, String(e.key));
|
|
3485
3503
|
if (!r) return null;
|
|
3486
|
-
let i = typeof r.isDraggable == "boolean" ? r.isDraggable : !r.static &&
|
|
3487
|
-
return /* @__PURE__ */ (0,
|
|
3504
|
+
let i = typeof r.isDraggable == "boolean" ? r.isDraggable : !r.static && ee, a = typeof r.isResizable == "boolean" ? r.isResizable : !r.static && ne, o = r.resizeHandles || [...re], c = i && B && r.isBounded !== !1, u = ie;
|
|
3505
|
+
return /* @__PURE__ */ (0, W.jsx)(Nt, {
|
|
3488
3506
|
containerWidth: n,
|
|
3489
3507
|
cols: F,
|
|
3490
3508
|
margin: R,
|
|
3491
|
-
containerPadding:
|
|
3509
|
+
containerPadding: pe,
|
|
3492
3510
|
maxRows: L,
|
|
3493
3511
|
rowHeight: I,
|
|
3494
|
-
cancel:
|
|
3495
|
-
handle:
|
|
3512
|
+
cancel: H,
|
|
3513
|
+
handle: V,
|
|
3496
3514
|
onDragStart: We,
|
|
3497
3515
|
onDrag: Ge,
|
|
3498
3516
|
onDragStop: Ke,
|
|
@@ -3502,11 +3520,11 @@ function Lt(e) {
|
|
|
3502
3520
|
isDraggable: i,
|
|
3503
3521
|
isResizable: a,
|
|
3504
3522
|
isBounded: c,
|
|
3505
|
-
useCSSTransforms:
|
|
3506
|
-
usePercentages: !
|
|
3507
|
-
transformScale:
|
|
3523
|
+
useCSSTransforms: X && me,
|
|
3524
|
+
usePercentages: !me,
|
|
3525
|
+
transformScale: fe,
|
|
3508
3526
|
positionStrategy: s,
|
|
3509
|
-
dragThreshold:
|
|
3527
|
+
dragThreshold: U,
|
|
3510
3528
|
w: r.w,
|
|
3511
3529
|
h: r.h,
|
|
3512
3530
|
x: r.x,
|
|
@@ -3522,94 +3540,94 @@ function Lt(e) {
|
|
|
3522
3540
|
resizeHandle: u,
|
|
3523
3541
|
constraints: l,
|
|
3524
3542
|
layoutItem: r,
|
|
3525
|
-
layout:
|
|
3543
|
+
layout: Q,
|
|
3526
3544
|
children: e
|
|
3527
3545
|
}, r.i);
|
|
3528
3546
|
}, [
|
|
3529
|
-
|
|
3547
|
+
Q,
|
|
3530
3548
|
n,
|
|
3531
3549
|
F,
|
|
3532
3550
|
R,
|
|
3533
|
-
|
|
3551
|
+
pe,
|
|
3534
3552
|
L,
|
|
3535
3553
|
I,
|
|
3536
|
-
te,
|
|
3537
3554
|
H,
|
|
3555
|
+
V,
|
|
3538
3556
|
We,
|
|
3539
3557
|
Ge,
|
|
3540
3558
|
Ke,
|
|
3541
3559
|
qe,
|
|
3542
3560
|
Je,
|
|
3543
3561
|
Ye,
|
|
3562
|
+
ee,
|
|
3563
|
+
ne,
|
|
3544
3564
|
B,
|
|
3545
|
-
|
|
3546
|
-
V,
|
|
3565
|
+
X,
|
|
3547
3566
|
me,
|
|
3548
|
-
|
|
3549
|
-
he,
|
|
3567
|
+
fe,
|
|
3550
3568
|
s,
|
|
3551
|
-
|
|
3569
|
+
U,
|
|
3552
3570
|
De,
|
|
3571
|
+
re,
|
|
3553
3572
|
ie,
|
|
3554
|
-
ae,
|
|
3555
3573
|
l
|
|
3556
|
-
]), rt = () => $ ? /* @__PURE__ */ (0,
|
|
3574
|
+
]), rt = () => $ ? /* @__PURE__ */ (0, W.jsx)(Nt, {
|
|
3557
3575
|
w: $.w,
|
|
3558
3576
|
h: $.h,
|
|
3559
3577
|
x: $.x,
|
|
3560
3578
|
y: $.y,
|
|
3561
3579
|
i: $.i,
|
|
3562
|
-
className: `react-grid-placeholder ${
|
|
3580
|
+
className: `react-grid-placeholder ${Se ? "placeholder-resizing" : ""}`,
|
|
3563
3581
|
containerWidth: n,
|
|
3564
3582
|
cols: F,
|
|
3565
3583
|
margin: R,
|
|
3566
|
-
containerPadding:
|
|
3584
|
+
containerPadding: pe,
|
|
3567
3585
|
maxRows: L,
|
|
3568
3586
|
rowHeight: I,
|
|
3569
3587
|
isDraggable: !1,
|
|
3570
3588
|
isResizable: !1,
|
|
3571
3589
|
isBounded: !1,
|
|
3572
|
-
useCSSTransforms:
|
|
3573
|
-
transformScale:
|
|
3590
|
+
useCSSTransforms: X,
|
|
3591
|
+
transformScale: fe,
|
|
3574
3592
|
constraints: l,
|
|
3575
|
-
layout:
|
|
3576
|
-
children: /* @__PURE__ */ (0,
|
|
3593
|
+
layout: Q,
|
|
3594
|
+
children: /* @__PURE__ */ (0, W.jsx)("div", {})
|
|
3577
3595
|
}) : null;
|
|
3578
|
-
return /* @__PURE__ */ (0,
|
|
3596
|
+
return /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
3579
3597
|
ref: h,
|
|
3580
|
-
className:
|
|
3598
|
+
className: te(Ft, p),
|
|
3581
3599
|
style: {
|
|
3582
|
-
height:
|
|
3600
|
+
height: Re,
|
|
3583
3601
|
...m
|
|
3584
3602
|
},
|
|
3585
|
-
onDrop:
|
|
3586
|
-
onDragLeave:
|
|
3587
|
-
onDragEnter:
|
|
3588
|
-
onDragOver:
|
|
3603
|
+
onDrop: G ? tt : void 0,
|
|
3604
|
+
onDragLeave: G ? Qe : void 0,
|
|
3605
|
+
onDragEnter: G ? et : void 0,
|
|
3606
|
+
onDragOver: G ? Ze : void 0,
|
|
3589
3607
|
children: [
|
|
3590
|
-
|
|
3591
|
-
|
|
3608
|
+
S.Children.map(t, (e) => S.isValidElement(e) ? nt(e) : null),
|
|
3609
|
+
G && Te && nt(Te, !0),
|
|
3592
3610
|
rt()
|
|
3593
3611
|
]
|
|
3594
3612
|
});
|
|
3595
3613
|
}
|
|
3596
|
-
var
|
|
3614
|
+
var Bt = {
|
|
3597
3615
|
lg: 1200,
|
|
3598
3616
|
md: 996,
|
|
3599
3617
|
sm: 768,
|
|
3600
3618
|
xs: 480,
|
|
3601
3619
|
xxs: 0
|
|
3602
|
-
},
|
|
3620
|
+
}, Vt = {
|
|
3603
3621
|
lg: 12,
|
|
3604
3622
|
md: 10,
|
|
3605
3623
|
sm: 6,
|
|
3606
3624
|
xs: 4,
|
|
3607
3625
|
xxs: 2
|
|
3608
|
-
},
|
|
3609
|
-
function
|
|
3626
|
+
}, Ht = () => {};
|
|
3627
|
+
function Ut(e, t, n, r) {
|
|
3610
3628
|
let i = [];
|
|
3611
|
-
|
|
3612
|
-
if (!
|
|
3629
|
+
S.Children.forEach(t, (t) => {
|
|
3630
|
+
if (!S.isValidElement(t) || t.key === null) return;
|
|
3613
3631
|
let n = String(t.key), r = e.find((e) => e.i === n);
|
|
3614
3632
|
if (r) i.push({
|
|
3615
3633
|
...r,
|
|
@@ -3635,64 +3653,64 @@ function Vt(e, t, n, r) {
|
|
|
3635
3653
|
}) : i.push({
|
|
3636
3654
|
i: n,
|
|
3637
3655
|
x: 0,
|
|
3638
|
-
y:
|
|
3656
|
+
y: he(i),
|
|
3639
3657
|
w: 1,
|
|
3640
3658
|
h: 1
|
|
3641
3659
|
});
|
|
3642
3660
|
}
|
|
3643
3661
|
});
|
|
3644
|
-
let a =
|
|
3662
|
+
let a = $(i, { cols: n });
|
|
3645
3663
|
return r.compact(a, n);
|
|
3646
3664
|
}
|
|
3647
|
-
function
|
|
3648
|
-
let { children: t, width: n, breakpoint: r, breakpoints: i =
|
|
3649
|
-
|
|
3665
|
+
function Wt(e) {
|
|
3666
|
+
let { children: t, width: n, breakpoint: r, breakpoints: i = Bt, cols: a = Vt, layouts: o = {}, rowHeight: s = 150, maxRows: c = Infinity, margin: l = [10, 10], containerPadding: u = null, compactor: d, onBreakpointChange: f = Ht, onLayoutChange: p = Ht, onWidthChange: m = Ht, ...h } = e, g = d ?? $e("vertical"), _ = g.type, v = g.allowOverlap, y = O(() => r ?? tt(i, n), []), b = O(() => nt(y, a), [y, a]), x = O(() => rt(o, i, y, y, b, _), []), [S, C] = A(y), [w, E] = A(b), [j, M] = A(x), [N, P] = A(o), F = k(n), I = k(r), L = k(i), R = k(a), z = k(o), ee = k(_), B = k(N);
|
|
3667
|
+
D(() => {
|
|
3650
3668
|
B.current = N;
|
|
3651
3669
|
}, [N]);
|
|
3652
|
-
let
|
|
3670
|
+
let te = O(() => (0, Mt.deepEqual)(o, z.current) ? null : rt(o, i, S, S, w, g), [
|
|
3653
3671
|
o,
|
|
3654
3672
|
i,
|
|
3655
|
-
|
|
3656
|
-
|
|
3673
|
+
S,
|
|
3674
|
+
w,
|
|
3657
3675
|
g
|
|
3658
|
-
]),
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
}, [
|
|
3676
|
+
]), V = te ?? j;
|
|
3677
|
+
D(() => {
|
|
3678
|
+
te !== null && (M(te), P(o), B.current = o, z.current = o);
|
|
3679
|
+
}, [te, o]), D(() => {
|
|
3662
3680
|
if (_ !== ee.current) {
|
|
3663
|
-
let e = g.compact(
|
|
3681
|
+
let e = g.compact(Q(V), w), t = {
|
|
3664
3682
|
...B.current,
|
|
3665
|
-
[
|
|
3683
|
+
[S]: e
|
|
3666
3684
|
};
|
|
3667
3685
|
M(e), P(t), B.current = t, p(e, t), ee.current = _;
|
|
3668
3686
|
}
|
|
3669
3687
|
}, [
|
|
3670
3688
|
_,
|
|
3671
3689
|
g,
|
|
3672
|
-
|
|
3673
|
-
|
|
3690
|
+
V,
|
|
3691
|
+
w,
|
|
3674
3692
|
v,
|
|
3675
|
-
|
|
3693
|
+
S,
|
|
3676
3694
|
p
|
|
3677
|
-
]),
|
|
3678
|
-
let e = n !== F.current, o = r !== I.current, s = !(0,
|
|
3695
|
+
]), D(() => {
|
|
3696
|
+
let e = n !== F.current, o = r !== I.current, s = !(0, Mt.deepEqual)(i, L.current), c = !(0, Mt.deepEqual)(a, R.current);
|
|
3679
3697
|
if (e || o || s || c) {
|
|
3680
|
-
let e = r ??
|
|
3698
|
+
let e = r ?? tt(i, n), o = nt(e, a), d = S;
|
|
3681
3699
|
if (d !== e || s || c) {
|
|
3682
3700
|
let n = { ...B.current };
|
|
3683
|
-
n[d] || (n[d] =
|
|
3684
|
-
let r =
|
|
3685
|
-
r =
|
|
3701
|
+
n[d] || (n[d] = Q(j));
|
|
3702
|
+
let r = rt(n, i, e, d, o, g);
|
|
3703
|
+
r = Ut(r, t, o, g), n[e] = r, C(e), E(o), M(r), P(n), B.current = n, f(e, o), p(r, n);
|
|
3686
3704
|
}
|
|
3687
|
-
m(n,
|
|
3705
|
+
m(n, it(l, e), o, u ? it(u, e) : null), F.current = n, I.current = r, L.current = i, R.current = a;
|
|
3688
3706
|
}
|
|
3689
3707
|
}, [
|
|
3690
3708
|
n,
|
|
3691
3709
|
r,
|
|
3692
3710
|
i,
|
|
3693
3711
|
a,
|
|
3694
|
-
|
|
3695
|
-
|
|
3712
|
+
S,
|
|
3713
|
+
w,
|
|
3696
3714
|
j,
|
|
3697
3715
|
t,
|
|
3698
3716
|
g,
|
|
@@ -3704,40 +3722,40 @@ function Ht(e) {
|
|
|
3704
3722
|
p,
|
|
3705
3723
|
m
|
|
3706
3724
|
]);
|
|
3707
|
-
let
|
|
3725
|
+
let H = T((e) => {
|
|
3708
3726
|
let t = {
|
|
3709
3727
|
...B.current,
|
|
3710
|
-
[
|
|
3728
|
+
[S]: e
|
|
3711
3729
|
};
|
|
3712
3730
|
M(e), P(t), B.current = t, p(e, t);
|
|
3713
|
-
}, [
|
|
3714
|
-
cols:
|
|
3731
|
+
}, [S, p]), U = O(() => it(l, S), [l, S]), ne = O(() => u === null ? null : it(u, S), [u, S]), re = O(() => ({
|
|
3732
|
+
cols: w,
|
|
3715
3733
|
rowHeight: s,
|
|
3716
3734
|
maxRows: c,
|
|
3717
|
-
margin:
|
|
3718
|
-
containerPadding:
|
|
3735
|
+
margin: U,
|
|
3736
|
+
containerPadding: ne
|
|
3719
3737
|
}), [
|
|
3720
|
-
|
|
3738
|
+
w,
|
|
3721
3739
|
s,
|
|
3722
3740
|
c,
|
|
3723
|
-
|
|
3724
|
-
|
|
3741
|
+
U,
|
|
3742
|
+
ne
|
|
3725
3743
|
]);
|
|
3726
|
-
return /* @__PURE__ */ (0,
|
|
3744
|
+
return /* @__PURE__ */ (0, W.jsx)(zt, {
|
|
3727
3745
|
...h,
|
|
3728
3746
|
width: n,
|
|
3729
|
-
gridConfig:
|
|
3747
|
+
gridConfig: re,
|
|
3730
3748
|
compactor: g,
|
|
3731
|
-
onLayoutChange:
|
|
3732
|
-
layout:
|
|
3749
|
+
onLayoutChange: H,
|
|
3750
|
+
layout: V,
|
|
3733
3751
|
children: t
|
|
3734
3752
|
});
|
|
3735
3753
|
}
|
|
3736
3754
|
//#endregion
|
|
3737
3755
|
//#region src/DashboardGridLayout.tsx
|
|
3738
|
-
function
|
|
3756
|
+
function Gt({ editMode: e }) {
|
|
3739
3757
|
let t = o();
|
|
3740
|
-
return
|
|
3758
|
+
return x.useEffect(() => {
|
|
3741
3759
|
if (e) return t.startDrag({
|
|
3742
3760
|
id: "dashboard-layout",
|
|
3743
3761
|
type: "dashboard-widget",
|
|
@@ -3748,17 +3766,17 @@ function Ut({ editMode: e }) {
|
|
|
3748
3766
|
t.endDrag("dashboard");
|
|
3749
3767
|
}, [e, t]), null;
|
|
3750
3768
|
}
|
|
3751
|
-
var
|
|
3769
|
+
var Kt = [
|
|
3752
3770
|
"hsl(var(--chart-1))",
|
|
3753
3771
|
"hsl(var(--chart-2))",
|
|
3754
3772
|
"hsl(var(--chart-3))",
|
|
3755
3773
|
"hsl(var(--chart-4))",
|
|
3756
3774
|
"hsl(var(--chart-5))"
|
|
3757
|
-
],
|
|
3758
|
-
let { width: o, containerRef:
|
|
3759
|
-
a && (
|
|
3775
|
+
], qt = ({ schema: e, className: t, onLayoutChange: r, persistLayoutKey: i = "dashboard-layout", onRefresh: a }) => {
|
|
3776
|
+
let { width: o, containerRef: c, mounted: m } = ot(), [h, g] = x.useState(!1), [_, y] = x.useState(!1), b = s(), S = x.useRef(null), C = x.useCallback(() => {
|
|
3777
|
+
a && (y(!0), a(), setTimeout(() => y(!1), 600));
|
|
3760
3778
|
}, [a]);
|
|
3761
|
-
|
|
3779
|
+
x.useEffect(() => {
|
|
3762
3780
|
if (!(!e.refreshInterval || e.refreshInterval <= 0 || !a)) return S.current = setInterval(C, e.refreshInterval * 1e3), () => {
|
|
3763
3781
|
S.current && clearInterval(S.current);
|
|
3764
3782
|
};
|
|
@@ -3767,7 +3785,7 @@ var Wt = [
|
|
|
3767
3785
|
a,
|
|
3768
3786
|
C
|
|
3769
3787
|
]);
|
|
3770
|
-
let [w, T] =
|
|
3788
|
+
let [w, T] = x.useState(() => {
|
|
3771
3789
|
if (typeof window < "u" && i) {
|
|
3772
3790
|
let e = localStorage.getItem(i);
|
|
3773
3791
|
if (e) try {
|
|
@@ -3783,11 +3801,11 @@ var Wt = [
|
|
|
3783
3801
|
w: e.layout?.w || 3,
|
|
3784
3802
|
h: e.layout?.h || 4
|
|
3785
3803
|
})) || [] };
|
|
3786
|
-
}), E =
|
|
3804
|
+
}), E = x.useCallback((e, t) => {
|
|
3787
3805
|
T(t), r?.(e);
|
|
3788
|
-
}, [r]), D =
|
|
3806
|
+
}, [r]), D = x.useCallback(() => {
|
|
3789
3807
|
typeof window < "u" && i && localStorage.setItem(i, JSON.stringify(w)), g(!1);
|
|
3790
|
-
}, [w, i]), O =
|
|
3808
|
+
}, [w, i]), O = x.useCallback(() => {
|
|
3791
3809
|
T({ lg: e.widgets?.map((e, t) => ({
|
|
3792
3810
|
i: e.id || `widget-${t}`,
|
|
3793
3811
|
x: e.layout?.x || t % 4 * 3,
|
|
@@ -3795,12 +3813,12 @@ var Wt = [
|
|
|
3795
3813
|
w: e.layout?.w || 3,
|
|
3796
3814
|
h: e.layout?.h || 4
|
|
3797
3815
|
})) || [] }), typeof window < "u" && i && localStorage.removeItem(i);
|
|
3798
|
-
}, [e.widgets, i]), k =
|
|
3816
|
+
}, [e.widgets, i]), k = x.useCallback((e) => {
|
|
3799
3817
|
if (e.component) return e.component;
|
|
3800
3818
|
let t = e.type, n = e.options || {};
|
|
3801
3819
|
if (t === "bar" || t === "line" || t === "area" || t === "pie" || t === "donut" || t === "scatter") {
|
|
3802
3820
|
let r = e.data || n.data, i = e.categoryField || n.xField || "name", a = e.valueField || n.yField || "value";
|
|
3803
|
-
if (
|
|
3821
|
+
if (U(r)) {
|
|
3804
3822
|
let n = r.aggregate, o = n ? {
|
|
3805
3823
|
field: e.valueField || n.field,
|
|
3806
3824
|
function: e.aggregate || n.function,
|
|
@@ -3813,7 +3831,7 @@ var Wt = [
|
|
|
3813
3831
|
aggregate: o,
|
|
3814
3832
|
xAxisKey: i,
|
|
3815
3833
|
series: [{ dataKey: s }],
|
|
3816
|
-
colors:
|
|
3834
|
+
colors: Kt,
|
|
3817
3835
|
className: "h-full"
|
|
3818
3836
|
};
|
|
3819
3837
|
}
|
|
@@ -3830,7 +3848,7 @@ var Wt = [
|
|
|
3830
3848
|
aggregate: n,
|
|
3831
3849
|
xAxisKey: i,
|
|
3832
3850
|
series: [{ dataKey: e.valueField || "value" }],
|
|
3833
|
-
colors:
|
|
3851
|
+
colors: Kt,
|
|
3834
3852
|
className: "h-full"
|
|
3835
3853
|
};
|
|
3836
3854
|
}
|
|
@@ -3840,13 +3858,13 @@ var Wt = [
|
|
|
3840
3858
|
data: Array.isArray(r) ? r : r?.items || [],
|
|
3841
3859
|
xAxisKey: i,
|
|
3842
3860
|
series: [{ dataKey: a }],
|
|
3843
|
-
colors:
|
|
3861
|
+
colors: Kt,
|
|
3844
3862
|
className: "h-full"
|
|
3845
3863
|
};
|
|
3846
3864
|
}
|
|
3847
3865
|
if (t === "table") {
|
|
3848
3866
|
let t = e.data || n.data;
|
|
3849
|
-
if (
|
|
3867
|
+
if (U(t)) {
|
|
3850
3868
|
let { data: r, ...i } = n;
|
|
3851
3869
|
return {
|
|
3852
3870
|
type: "data-table",
|
|
@@ -3878,7 +3896,7 @@ var Wt = [
|
|
|
3878
3896
|
}
|
|
3879
3897
|
if (t === "pivot") {
|
|
3880
3898
|
let t = e.data || n.data;
|
|
3881
|
-
if (
|
|
3899
|
+
if (U(t)) {
|
|
3882
3900
|
let { data: r, ...i } = n;
|
|
3883
3901
|
return {
|
|
3884
3902
|
type: "pivot",
|
|
@@ -3899,54 +3917,54 @@ var Wt = [
|
|
|
3899
3917
|
...n
|
|
3900
3918
|
};
|
|
3901
3919
|
}, []);
|
|
3902
|
-
return /* @__PURE__ */ (0,
|
|
3903
|
-
ref:
|
|
3904
|
-
className:
|
|
3920
|
+
return /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
3921
|
+
ref: c,
|
|
3922
|
+
className: v("w-full", t),
|
|
3905
3923
|
"data-testid": "grid-layout",
|
|
3906
3924
|
children: [
|
|
3907
|
-
|
|
3908
|
-
/* @__PURE__ */ (0,
|
|
3925
|
+
b && /* @__PURE__ */ (0, W.jsx)(Gt, { editMode: h }),
|
|
3926
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
3909
3927
|
className: "mb-4 flex items-center justify-between",
|
|
3910
|
-
children: [/* @__PURE__ */ (0,
|
|
3928
|
+
children: [/* @__PURE__ */ (0, W.jsx)("h2", {
|
|
3911
3929
|
className: "text-2xl font-bold",
|
|
3912
3930
|
children: e.title || "Dashboard"
|
|
3913
|
-
}), /* @__PURE__ */ (0,
|
|
3931
|
+
}), /* @__PURE__ */ (0, W.jsx)("div", {
|
|
3914
3932
|
className: "flex gap-2",
|
|
3915
|
-
children: h ? /* @__PURE__ */ (0,
|
|
3916
|
-
/* @__PURE__ */ (0,
|
|
3933
|
+
children: h ? /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [
|
|
3934
|
+
/* @__PURE__ */ (0, W.jsxs)(l, {
|
|
3917
3935
|
onClick: D,
|
|
3918
3936
|
size: "sm",
|
|
3919
3937
|
variant: "default",
|
|
3920
|
-
children: [/* @__PURE__ */ (0,
|
|
3938
|
+
children: [/* @__PURE__ */ (0, W.jsx)(z, { className: "h-4 w-4 mr-2" }), "Save Layout"]
|
|
3921
3939
|
}),
|
|
3922
|
-
/* @__PURE__ */ (0,
|
|
3940
|
+
/* @__PURE__ */ (0, W.jsxs)(l, {
|
|
3923
3941
|
onClick: O,
|
|
3924
3942
|
size: "sm",
|
|
3925
3943
|
variant: "outline",
|
|
3926
|
-
children: [/* @__PURE__ */ (0,
|
|
3944
|
+
children: [/* @__PURE__ */ (0, W.jsx)(B, { className: "h-4 w-4 mr-2" }), "Reset"]
|
|
3927
3945
|
}),
|
|
3928
|
-
/* @__PURE__ */ (0,
|
|
3946
|
+
/* @__PURE__ */ (0, W.jsx)(l, {
|
|
3929
3947
|
onClick: () => g(!1),
|
|
3930
3948
|
size: "sm",
|
|
3931
3949
|
variant: "ghost",
|
|
3932
3950
|
children: "Cancel"
|
|
3933
3951
|
})
|
|
3934
|
-
] }) : /* @__PURE__ */ (0,
|
|
3952
|
+
] }) : /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [a && /* @__PURE__ */ (0, W.jsxs)(l, {
|
|
3935
3953
|
onClick: C,
|
|
3936
3954
|
size: "sm",
|
|
3937
3955
|
variant: "outline",
|
|
3938
|
-
disabled:
|
|
3956
|
+
disabled: _,
|
|
3939
3957
|
"aria-label": "Refresh dashboard",
|
|
3940
|
-
children: [/* @__PURE__ */ (0,
|
|
3941
|
-
}), /* @__PURE__ */ (0,
|
|
3958
|
+
children: [/* @__PURE__ */ (0, W.jsx)(R, { className: v("h-4 w-4 mr-2", _ && "animate-spin") }), _ ? "Refreshing…" : "Refresh All"]
|
|
3959
|
+
}), /* @__PURE__ */ (0, W.jsxs)(l, {
|
|
3942
3960
|
onClick: () => g(!0),
|
|
3943
3961
|
size: "sm",
|
|
3944
3962
|
variant: "outline",
|
|
3945
|
-
children: [/* @__PURE__ */ (0,
|
|
3963
|
+
children: [/* @__PURE__ */ (0, W.jsx)(P, { className: "h-4 w-4 mr-2" }), "Edit Layout"]
|
|
3946
3964
|
})] })
|
|
3947
3965
|
})]
|
|
3948
3966
|
}),
|
|
3949
|
-
m && /* @__PURE__ */ (0,
|
|
3967
|
+
m && /* @__PURE__ */ (0, W.jsx)(Wt, {
|
|
3950
3968
|
className: "layout",
|
|
3951
3969
|
width: o,
|
|
3952
3970
|
layouts: w,
|
|
@@ -3973,34 +3991,34 @@ var Wt = [
|
|
|
3973
3991
|
onLayoutChange: E,
|
|
3974
3992
|
children: e.widgets?.map((e, t) => {
|
|
3975
3993
|
let r = e.id || `widget-${t}`, i = k(e);
|
|
3976
|
-
return /* @__PURE__ */ (0,
|
|
3994
|
+
return /* @__PURE__ */ (0, W.jsx)("div", {
|
|
3977
3995
|
className: "h-full",
|
|
3978
|
-
children: e.type === "metric" ? /* @__PURE__ */ (0,
|
|
3996
|
+
children: e.type === "metric" ? /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
3979
3997
|
className: "h-full w-full relative",
|
|
3980
|
-
children: [h && /* @__PURE__ */ (0,
|
|
3998
|
+
children: [h && /* @__PURE__ */ (0, W.jsx)("div", {
|
|
3981
3999
|
className: "drag-handle absolute top-2 right-2 z-10 cursor-move p-1 bg-background/80 rounded border border-border",
|
|
3982
|
-
children: /* @__PURE__ */ (0,
|
|
3983
|
-
}), /* @__PURE__ */ (0,
|
|
4000
|
+
children: /* @__PURE__ */ (0, W.jsx)(F, { className: "h-4 w-4" })
|
|
4001
|
+
}), /* @__PURE__ */ (0, W.jsx)(n, {
|
|
3984
4002
|
schema: i,
|
|
3985
4003
|
className: "h-full w-full"
|
|
3986
4004
|
})]
|
|
3987
|
-
}) : /* @__PURE__ */ (0,
|
|
3988
|
-
className:
|
|
3989
|
-
children: [e.title && /* @__PURE__ */ (0,
|
|
4005
|
+
}) : /* @__PURE__ */ (0, W.jsxs)(u, {
|
|
4006
|
+
className: v("h-full overflow-hidden border-border/50 shadow-sm transition-all", "bg-card/50 backdrop-blur-sm", h && "ring-2 ring-primary/20"),
|
|
4007
|
+
children: [e.title && /* @__PURE__ */ (0, W.jsxs)(f, {
|
|
3990
4008
|
className: "pb-2 border-b border-border/40 bg-muted/20 flex flex-row items-center justify-between",
|
|
3991
|
-
children: [/* @__PURE__ */ (0,
|
|
4009
|
+
children: [/* @__PURE__ */ (0, W.jsx)(p, {
|
|
3992
4010
|
className: "text-base font-medium tracking-tight truncate",
|
|
3993
4011
|
title: e.title,
|
|
3994
4012
|
children: e.title
|
|
3995
|
-
}), h && /* @__PURE__ */ (0,
|
|
4013
|
+
}), h && /* @__PURE__ */ (0, W.jsx)("div", {
|
|
3996
4014
|
className: "drag-handle cursor-move p-1 hover:bg-muted/40 rounded",
|
|
3997
|
-
children: /* @__PURE__ */ (0,
|
|
4015
|
+
children: /* @__PURE__ */ (0, W.jsx)(F, { className: "h-4 w-4" })
|
|
3998
4016
|
})]
|
|
3999
|
-
}), /* @__PURE__ */ (0,
|
|
4017
|
+
}), /* @__PURE__ */ (0, W.jsx)(d, {
|
|
4000
4018
|
className: "p-0 h-full",
|
|
4001
|
-
children: /* @__PURE__ */ (0,
|
|
4002
|
-
className:
|
|
4003
|
-
children: /* @__PURE__ */ (0,
|
|
4019
|
+
children: /* @__PURE__ */ (0, W.jsx)("div", {
|
|
4020
|
+
className: v("h-full w-full overflow-auto p-4"),
|
|
4021
|
+
children: /* @__PURE__ */ (0, W.jsx)(n, { schema: i })
|
|
4004
4022
|
})
|
|
4005
4023
|
})]
|
|
4006
4024
|
})
|
|
@@ -4012,10 +4030,10 @@ var Wt = [
|
|
|
4012
4030
|
};
|
|
4013
4031
|
//#endregion
|
|
4014
4032
|
//#region src/MetricWidget.tsx
|
|
4015
|
-
function
|
|
4033
|
+
function Jt(e) {
|
|
4016
4034
|
if (e != null) return typeof e == "string" ? e : e.defaultValue || e.key;
|
|
4017
4035
|
}
|
|
4018
|
-
var
|
|
4036
|
+
var Yt = {
|
|
4019
4037
|
default: "bg-muted text-muted-foreground",
|
|
4020
4038
|
blue: "bg-blue-500/10 text-blue-600 dark:text-blue-400",
|
|
4021
4039
|
teal: "bg-teal-500/10 text-teal-600 dark:text-teal-400",
|
|
@@ -4024,111 +4042,111 @@ var qt = {
|
|
|
4024
4042
|
success: "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",
|
|
4025
4043
|
warning: "bg-amber-500/10 text-amber-600 dark:text-amber-400",
|
|
4026
4044
|
danger: "bg-rose-500/10 text-rose-600 dark:text-rose-400"
|
|
4027
|
-
},
|
|
4028
|
-
let m =
|
|
4045
|
+
}, Xt = ({ label: e, value: t, trend: n, icon: r, className: i, description: a, loading: o, error: s, colorVariant: c = "default", ...l }) => {
|
|
4046
|
+
let m = Yt[c] || Yt.default, h = O(() => {
|
|
4029
4047
|
if (typeof r == "string") {
|
|
4030
|
-
let e =
|
|
4031
|
-
return e ? /* @__PURE__ */ (0,
|
|
4048
|
+
let e = y(r);
|
|
4049
|
+
return e ? /* @__PURE__ */ (0, W.jsx)(e, { className: "h-4 w-4" }) : null;
|
|
4032
4050
|
}
|
|
4033
4051
|
return r;
|
|
4034
4052
|
}, [r]);
|
|
4035
|
-
return /* @__PURE__ */ (0,
|
|
4036
|
-
className:
|
|
4037
|
-
...
|
|
4038
|
-
children: [/* @__PURE__ */ (0,
|
|
4053
|
+
return /* @__PURE__ */ (0, W.jsxs)(u, {
|
|
4054
|
+
className: v("h-full overflow-hidden", i),
|
|
4055
|
+
...l,
|
|
4056
|
+
children: [/* @__PURE__ */ (0, W.jsxs)(f, {
|
|
4039
4057
|
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
4040
|
-
children: [/* @__PURE__ */ (0,
|
|
4058
|
+
children: [/* @__PURE__ */ (0, W.jsx)(p, {
|
|
4041
4059
|
className: "text-sm font-medium truncate",
|
|
4042
|
-
children:
|
|
4043
|
-
}), h && /* @__PURE__ */ (0,
|
|
4044
|
-
className:
|
|
4060
|
+
children: Jt(e)
|
|
4061
|
+
}), h && /* @__PURE__ */ (0, W.jsx)("div", {
|
|
4062
|
+
className: v("flex h-8 w-8 items-center justify-center rounded-md shrink-0", m),
|
|
4045
4063
|
children: h
|
|
4046
4064
|
})]
|
|
4047
|
-
}), /* @__PURE__ */ (0,
|
|
4065
|
+
}), /* @__PURE__ */ (0, W.jsx)(d, { children: o ? /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4048
4066
|
className: "flex items-center gap-2 text-muted-foreground",
|
|
4049
4067
|
"data-testid": "metric-loading",
|
|
4050
|
-
children: [/* @__PURE__ */ (0,
|
|
4068
|
+
children: [/* @__PURE__ */ (0, W.jsx)(I, { className: "h-4 w-4 animate-spin" }), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
4051
4069
|
className: "text-sm",
|
|
4052
4070
|
children: "Loading…"
|
|
4053
4071
|
})]
|
|
4054
|
-
}) : s ? /* @__PURE__ */ (0,
|
|
4072
|
+
}) : s ? /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4055
4073
|
className: "flex items-center gap-2",
|
|
4056
4074
|
"data-testid": "metric-error",
|
|
4057
4075
|
role: "alert",
|
|
4058
|
-
children: [/* @__PURE__ */ (0,
|
|
4076
|
+
children: [/* @__PURE__ */ (0, W.jsx)(j, { className: "h-4 w-4 text-destructive shrink-0" }), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
4059
4077
|
className: "text-xs text-destructive truncate",
|
|
4060
4078
|
children: s
|
|
4061
4079
|
})]
|
|
4062
|
-
}) : /* @__PURE__ */ (0,
|
|
4080
|
+
}) : /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [/* @__PURE__ */ (0, W.jsx)("div", {
|
|
4063
4081
|
className: "text-2xl font-bold truncate",
|
|
4064
4082
|
children: t
|
|
4065
|
-
}), (n || a) && /* @__PURE__ */ (0,
|
|
4083
|
+
}), (n || a) && /* @__PURE__ */ (0, W.jsxs)("p", {
|
|
4066
4084
|
className: "text-xs text-muted-foreground flex items-center mt-1 truncate",
|
|
4067
|
-
children: [n && /* @__PURE__ */ (0,
|
|
4068
|
-
className:
|
|
4085
|
+
children: [n && /* @__PURE__ */ (0, W.jsxs)("span", {
|
|
4086
|
+
className: v("flex items-center mr-2 shrink-0 font-medium", n.direction === "up" && "text-emerald-600 dark:text-emerald-400", n.direction === "down" && "text-rose-600 dark:text-rose-400", n.direction === "neutral" && "text-muted-foreground"),
|
|
4069
4087
|
children: [
|
|
4070
|
-
n.direction === "up" && /* @__PURE__ */ (0,
|
|
4071
|
-
n.direction === "down" && /* @__PURE__ */ (0,
|
|
4072
|
-
n.direction === "neutral" && /* @__PURE__ */ (0,
|
|
4088
|
+
n.direction === "up" && /* @__PURE__ */ (0, W.jsx)(N, { className: "h-3 w-3 mr-1" }),
|
|
4089
|
+
n.direction === "down" && /* @__PURE__ */ (0, W.jsx)(M, { className: "h-3 w-3 mr-1" }),
|
|
4090
|
+
n.direction === "neutral" && /* @__PURE__ */ (0, W.jsx)(L, { className: "h-3 w-3 mr-1" }),
|
|
4073
4091
|
n.value,
|
|
4074
4092
|
"%"
|
|
4075
4093
|
]
|
|
4076
|
-
}), /* @__PURE__ */ (0,
|
|
4094
|
+
}), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
4077
4095
|
className: "truncate",
|
|
4078
|
-
children:
|
|
4096
|
+
children: Jt(a) || Jt(n?.label)
|
|
4079
4097
|
})]
|
|
4080
4098
|
})] }) })]
|
|
4081
4099
|
});
|
|
4082
4100
|
};
|
|
4083
4101
|
//#endregion
|
|
4084
4102
|
//#region src/MetricCard.tsx
|
|
4085
|
-
function
|
|
4103
|
+
function Zt(e) {
|
|
4086
4104
|
if (e != null) return typeof e == "string" ? e : e.defaultValue || e.key;
|
|
4087
4105
|
}
|
|
4088
|
-
var
|
|
4089
|
-
let m = n
|
|
4090
|
-
return /* @__PURE__ */ (0,
|
|
4091
|
-
className:
|
|
4092
|
-
...
|
|
4093
|
-
children: [/* @__PURE__ */ (0,
|
|
4106
|
+
var Qt = ({ title: e, value: t, icon: n, trend: r, trendValue: i, description: a, className: o, loading: s, error: c, ...l }) => {
|
|
4107
|
+
let m = n ? y(n) : null;
|
|
4108
|
+
return /* @__PURE__ */ (0, W.jsxs)(u, {
|
|
4109
|
+
className: v("h-full", o),
|
|
4110
|
+
...l,
|
|
4111
|
+
children: [/* @__PURE__ */ (0, W.jsxs)(f, {
|
|
4094
4112
|
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
4095
|
-
children: [/* @__PURE__ */ (0,
|
|
4113
|
+
children: [/* @__PURE__ */ (0, W.jsx)(p, {
|
|
4096
4114
|
className: "text-sm font-medium",
|
|
4097
|
-
children:
|
|
4098
|
-
}), m && /* @__PURE__ */ (0,
|
|
4099
|
-
}), /* @__PURE__ */ (0,
|
|
4115
|
+
children: Zt(e)
|
|
4116
|
+
}), m && /* @__PURE__ */ (0, W.jsx)(m, { className: "h-4 w-4 text-muted-foreground" })]
|
|
4117
|
+
}), /* @__PURE__ */ (0, W.jsx)(d, { children: s ? /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4100
4118
|
className: "flex items-center gap-2 text-muted-foreground",
|
|
4101
4119
|
"data-testid": "metric-card-loading",
|
|
4102
|
-
children: [/* @__PURE__ */ (0,
|
|
4120
|
+
children: [/* @__PURE__ */ (0, W.jsx)(I, { className: "h-4 w-4 animate-spin" }), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
4103
4121
|
className: "text-sm",
|
|
4104
4122
|
children: "Loading…"
|
|
4105
4123
|
})]
|
|
4106
|
-
}) : c ? /* @__PURE__ */ (0,
|
|
4124
|
+
}) : c ? /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4107
4125
|
className: "flex items-center gap-2",
|
|
4108
4126
|
"data-testid": "metric-card-error",
|
|
4109
4127
|
role: "alert",
|
|
4110
|
-
children: [/* @__PURE__ */ (0,
|
|
4128
|
+
children: [/* @__PURE__ */ (0, W.jsx)(j, { className: "h-4 w-4 text-destructive shrink-0" }), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
4111
4129
|
className: "text-xs text-destructive truncate",
|
|
4112
4130
|
children: c
|
|
4113
4131
|
})]
|
|
4114
|
-
}) : /* @__PURE__ */ (0,
|
|
4132
|
+
}) : /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [/* @__PURE__ */ (0, W.jsx)("div", {
|
|
4115
4133
|
className: "text-2xl font-bold",
|
|
4116
4134
|
children: t
|
|
4117
|
-
}), (r || i || a) && /* @__PURE__ */ (0,
|
|
4135
|
+
}), (r || i || a) && /* @__PURE__ */ (0, W.jsxs)("p", {
|
|
4118
4136
|
className: "text-xs text-muted-foreground flex items-center mt-1",
|
|
4119
|
-
children: [r && i && /* @__PURE__ */ (0,
|
|
4120
|
-
className:
|
|
4137
|
+
children: [r && i && /* @__PURE__ */ (0, W.jsxs)("span", {
|
|
4138
|
+
className: v("flex items-center mr-2", r === "up" && "text-green-500", r === "down" && "text-red-500", r === "neutral" && "text-yellow-500"),
|
|
4121
4139
|
children: [
|
|
4122
|
-
r === "up" && /* @__PURE__ */ (0,
|
|
4123
|
-
r === "down" && /* @__PURE__ */ (0,
|
|
4124
|
-
r === "neutral" && /* @__PURE__ */ (0,
|
|
4140
|
+
r === "up" && /* @__PURE__ */ (0, W.jsx)(N, { className: "h-3 w-3 mr-1" }),
|
|
4141
|
+
r === "down" && /* @__PURE__ */ (0, W.jsx)(M, { className: "h-3 w-3 mr-1" }),
|
|
4142
|
+
r === "neutral" && /* @__PURE__ */ (0, W.jsx)(L, { className: "h-3 w-3 mr-1" }),
|
|
4125
4143
|
i
|
|
4126
4144
|
]
|
|
4127
|
-
}),
|
|
4145
|
+
}), Zt(a)]
|
|
4128
4146
|
})] }) })]
|
|
4129
4147
|
});
|
|
4130
|
-
},
|
|
4131
|
-
let f =
|
|
4148
|
+
}, $t = ({ objectName: e, aggregate: t, filter: n, label: i, fallbackValue: a, trend: o, icon: s, className: c, description: l, dataSource: u, colorVariant: d }) => {
|
|
4149
|
+
let f = E(r), p = u || f?.dataSource, [m, h] = A(null), [g, _] = A(!1), [v, y] = A(null), b = T(async (r, i) => {
|
|
4132
4150
|
if (!(!r || !e)) {
|
|
4133
4151
|
i.current && (_(!0), y(null));
|
|
4134
4152
|
try {
|
|
@@ -4154,10 +4172,10 @@ var Xt = ({ title: e, value: t, icon: n, trend: r, trendValue: i, description: a
|
|
|
4154
4172
|
}
|
|
4155
4173
|
}, [
|
|
4156
4174
|
e,
|
|
4157
|
-
t,
|
|
4158
|
-
n
|
|
4175
|
+
O(() => t ? JSON.stringify(t) : "", [t]),
|
|
4176
|
+
O(() => n ? JSON.stringify(n) : "", [n])
|
|
4159
4177
|
]);
|
|
4160
|
-
return
|
|
4178
|
+
return D(() => {
|
|
4161
4179
|
let t = { current: !0 };
|
|
4162
4180
|
return p && e ? b(p, t) : (h(null), y(null)), () => {
|
|
4163
4181
|
t.current = !1;
|
|
@@ -4166,7 +4184,7 @@ var Xt = ({ title: e, value: t, icon: n, trend: r, trendValue: i, description: a
|
|
|
4166
4184
|
p,
|
|
4167
4185
|
e,
|
|
4168
4186
|
b
|
|
4169
|
-
]), /* @__PURE__ */ (0,
|
|
4187
|
+
]), /* @__PURE__ */ (0, W.jsx)(Xt, {
|
|
4170
4188
|
label: i,
|
|
4171
4189
|
value: m === null ? p ? "—" : a ?? "—" : m,
|
|
4172
4190
|
trend: o,
|
|
@@ -4180,7 +4198,7 @@ var Xt = ({ title: e, value: t, icon: n, trend: r, trendValue: i, description: a
|
|
|
4180
4198
|
};
|
|
4181
4199
|
//#endregion
|
|
4182
4200
|
//#region src/PivotTable.tsx
|
|
4183
|
-
function
|
|
4201
|
+
function en(e, t) {
|
|
4184
4202
|
if (!t) return String(e);
|
|
4185
4203
|
let n = "", r = "", i = !1, a, o = t, s = o.match(/^([^0-9.,#]*)/);
|
|
4186
4204
|
if (s && s[1]) {
|
|
@@ -4197,7 +4215,7 @@ function Qt(e, t) {
|
|
|
4197
4215
|
}
|
|
4198
4216
|
return n + l + r;
|
|
4199
4217
|
}
|
|
4200
|
-
function
|
|
4218
|
+
function tn(e, t) {
|
|
4201
4219
|
if (e.length === 0) return 0;
|
|
4202
4220
|
switch (t) {
|
|
4203
4221
|
case "sum": return e.reduce((e, t) => e + t, 0);
|
|
@@ -4208,8 +4226,8 @@ function $t(e, t) {
|
|
|
4208
4226
|
default: return e.reduce((e, t) => e + t, 0);
|
|
4209
4227
|
}
|
|
4210
4228
|
}
|
|
4211
|
-
var
|
|
4212
|
-
let { title: n, rowField: r, columnField: i, valueField: a, aggregation: o = "sum", data: s = [], showRowTotals: c = !1, showColumnTotals: l = !1, format: u, columnColors: d } = e, f = Array.isArray(s) ? s : [], { rowKeys: p, colKeys: m, matrix: h, rowTotals: g, colTotals:
|
|
4229
|
+
var nn = ({ schema: e, className: t }) => {
|
|
4230
|
+
let { title: n, rowField: r, columnField: i, valueField: a, aggregation: o = "sum", data: s = [], showRowTotals: c = !1, showColumnTotals: l = !1, format: u, columnColors: d } = e, f = Array.isArray(s) ? s : [], { rowKeys: p, colKeys: m, matrix: h, rowTotals: g, colTotals: _, grandTotal: y } = O(() => {
|
|
4213
4231
|
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = {};
|
|
4214
4232
|
for (let o of f) {
|
|
4215
4233
|
let s = String(o[r] ?? ""), c = String(o[i] ?? ""), l = Number(o[a]) || 0;
|
|
@@ -4220,10 +4238,10 @@ var en = ({ schema: e, className: t }) => {
|
|
|
4220
4238
|
l[e] = {};
|
|
4221
4239
|
let t = [];
|
|
4222
4240
|
for (let r of c) {
|
|
4223
|
-
let i = n[e]?.[r] ?? [], a =
|
|
4241
|
+
let i = n[e]?.[r] ?? [], a = tn(i, o);
|
|
4224
4242
|
l[e][r] = a, t.push(...i), !d[r] && d[r];
|
|
4225
4243
|
}
|
|
4226
|
-
u[e] =
|
|
4244
|
+
u[e] = tn(t, o);
|
|
4227
4245
|
}
|
|
4228
4246
|
for (let e of c) {
|
|
4229
4247
|
let t = [];
|
|
@@ -4231,7 +4249,7 @@ var en = ({ schema: e, className: t }) => {
|
|
|
4231
4249
|
let i = n[r]?.[e] ?? [];
|
|
4232
4250
|
t.push(...i);
|
|
4233
4251
|
}
|
|
4234
|
-
d[e] =
|
|
4252
|
+
d[e] = tn(t, o);
|
|
4235
4253
|
}
|
|
4236
4254
|
let p = [];
|
|
4237
4255
|
for (let e of f) p.push(Number(e[a]) || 0);
|
|
@@ -4241,7 +4259,7 @@ var en = ({ schema: e, className: t }) => {
|
|
|
4241
4259
|
matrix: l,
|
|
4242
4260
|
rowTotals: u,
|
|
4243
4261
|
colTotals: d,
|
|
4244
|
-
grandTotal:
|
|
4262
|
+
grandTotal: tn(p, o)
|
|
4245
4263
|
};
|
|
4246
4264
|
}, [
|
|
4247
4265
|
f,
|
|
@@ -4249,16 +4267,16 @@ var en = ({ schema: e, className: t }) => {
|
|
|
4249
4267
|
i,
|
|
4250
4268
|
a,
|
|
4251
4269
|
o
|
|
4252
|
-
]), b = (e) =>
|
|
4253
|
-
return f.length === 0 ? /* @__PURE__ */ (0,
|
|
4254
|
-
className:
|
|
4255
|
-
children: [n && /* @__PURE__ */ (0,
|
|
4270
|
+
]), b = (e) => en(e, u);
|
|
4271
|
+
return f.length === 0 ? /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4272
|
+
className: v("overflow-auto", t),
|
|
4273
|
+
children: [n && /* @__PURE__ */ (0, W.jsx)("h3", {
|
|
4256
4274
|
className: "text-sm font-semibold mb-2",
|
|
4257
4275
|
children: n
|
|
4258
|
-
}), /* @__PURE__ */ (0,
|
|
4276
|
+
}), /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4259
4277
|
className: "flex flex-col items-center justify-center py-8 text-muted-foreground",
|
|
4260
4278
|
"data-testid": "pivot-empty-state",
|
|
4261
|
-
children: [/* @__PURE__ */ (0,
|
|
4279
|
+
children: [/* @__PURE__ */ (0, W.jsxs)("svg", {
|
|
4262
4280
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4263
4281
|
className: "h-8 w-8 mb-2 opacity-40",
|
|
4264
4282
|
viewBox: "0 0 24 24",
|
|
@@ -4268,91 +4286,91 @@ var en = ({ schema: e, className: t }) => {
|
|
|
4268
4286
|
strokeLinecap: "round",
|
|
4269
4287
|
strokeLinejoin: "round",
|
|
4270
4288
|
children: [
|
|
4271
|
-
/* @__PURE__ */ (0,
|
|
4289
|
+
/* @__PURE__ */ (0, W.jsx)("rect", {
|
|
4272
4290
|
x: "3",
|
|
4273
4291
|
y: "3",
|
|
4274
4292
|
width: "7",
|
|
4275
4293
|
height: "7"
|
|
4276
4294
|
}),
|
|
4277
|
-
/* @__PURE__ */ (0,
|
|
4295
|
+
/* @__PURE__ */ (0, W.jsx)("rect", {
|
|
4278
4296
|
x: "14",
|
|
4279
4297
|
y: "3",
|
|
4280
4298
|
width: "7",
|
|
4281
4299
|
height: "7"
|
|
4282
4300
|
}),
|
|
4283
|
-
/* @__PURE__ */ (0,
|
|
4301
|
+
/* @__PURE__ */ (0, W.jsx)("rect", {
|
|
4284
4302
|
x: "3",
|
|
4285
4303
|
y: "14",
|
|
4286
4304
|
width: "7",
|
|
4287
4305
|
height: "7"
|
|
4288
4306
|
}),
|
|
4289
|
-
/* @__PURE__ */ (0,
|
|
4307
|
+
/* @__PURE__ */ (0, W.jsx)("rect", {
|
|
4290
4308
|
x: "14",
|
|
4291
4309
|
y: "14",
|
|
4292
4310
|
width: "7",
|
|
4293
4311
|
height: "7"
|
|
4294
4312
|
})
|
|
4295
4313
|
]
|
|
4296
|
-
}), /* @__PURE__ */ (0,
|
|
4314
|
+
}), /* @__PURE__ */ (0, W.jsx)("p", {
|
|
4297
4315
|
className: "text-xs",
|
|
4298
4316
|
children: "No data available"
|
|
4299
4317
|
})]
|
|
4300
4318
|
})]
|
|
4301
|
-
}) : /* @__PURE__ */ (0,
|
|
4302
|
-
className:
|
|
4303
|
-
children: [n && /* @__PURE__ */ (0,
|
|
4319
|
+
}) : /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4320
|
+
className: v("overflow-auto", t),
|
|
4321
|
+
children: [n && /* @__PURE__ */ (0, W.jsx)("h3", {
|
|
4304
4322
|
className: "text-sm font-semibold mb-2",
|
|
4305
4323
|
children: n
|
|
4306
|
-
}), /* @__PURE__ */ (0,
|
|
4324
|
+
}), /* @__PURE__ */ (0, W.jsxs)("table", {
|
|
4307
4325
|
className: "w-full text-sm border-collapse",
|
|
4308
4326
|
role: "table",
|
|
4309
4327
|
children: [
|
|
4310
|
-
/* @__PURE__ */ (0,
|
|
4328
|
+
/* @__PURE__ */ (0, W.jsx)("thead", { children: /* @__PURE__ */ (0, W.jsxs)("tr", {
|
|
4311
4329
|
className: "border-b border-border",
|
|
4312
4330
|
children: [
|
|
4313
|
-
/* @__PURE__ */ (0,
|
|
4331
|
+
/* @__PURE__ */ (0, W.jsx)("th", {
|
|
4314
4332
|
className: "text-left p-2 font-medium text-muted-foreground",
|
|
4315
4333
|
children: r
|
|
4316
4334
|
}),
|
|
4317
|
-
m.map((e) => /* @__PURE__ */ (0,
|
|
4318
|
-
className:
|
|
4335
|
+
m.map((e) => /* @__PURE__ */ (0, W.jsx)("th", {
|
|
4336
|
+
className: v("text-right p-2 font-medium", d?.[e] ?? "text-muted-foreground"),
|
|
4319
4337
|
children: e
|
|
4320
4338
|
}, e)),
|
|
4321
|
-
c && /* @__PURE__ */ (0,
|
|
4339
|
+
c && /* @__PURE__ */ (0, W.jsx)("th", {
|
|
4322
4340
|
className: "text-right p-2 font-semibold text-muted-foreground bg-muted/20",
|
|
4323
4341
|
children: "Total"
|
|
4324
4342
|
})
|
|
4325
4343
|
]
|
|
4326
4344
|
}) }),
|
|
4327
|
-
/* @__PURE__ */ (0,
|
|
4345
|
+
/* @__PURE__ */ (0, W.jsx)("tbody", { children: p.map((e) => /* @__PURE__ */ (0, W.jsxs)("tr", {
|
|
4328
4346
|
className: "border-b border-border/50 hover:bg-muted/30",
|
|
4329
4347
|
children: [
|
|
4330
|
-
/* @__PURE__ */ (0,
|
|
4348
|
+
/* @__PURE__ */ (0, W.jsx)("td", {
|
|
4331
4349
|
className: "p-2 font-medium",
|
|
4332
4350
|
children: e
|
|
4333
4351
|
}),
|
|
4334
|
-
m.map((t) => /* @__PURE__ */ (0,
|
|
4335
|
-
className:
|
|
4352
|
+
m.map((t) => /* @__PURE__ */ (0, W.jsx)("td", {
|
|
4353
|
+
className: v("text-right p-2 tabular-nums", d?.[t]),
|
|
4336
4354
|
children: b(h[e]?.[t] ?? 0)
|
|
4337
4355
|
}, t)),
|
|
4338
|
-
c && /* @__PURE__ */ (0,
|
|
4356
|
+
c && /* @__PURE__ */ (0, W.jsx)("td", {
|
|
4339
4357
|
className: "text-right p-2 font-semibold tabular-nums bg-muted/20",
|
|
4340
4358
|
children: b(g[e] ?? 0)
|
|
4341
4359
|
})
|
|
4342
4360
|
]
|
|
4343
4361
|
}, e)) }),
|
|
4344
|
-
l && /* @__PURE__ */ (0,
|
|
4362
|
+
l && /* @__PURE__ */ (0, W.jsx)("tfoot", { children: /* @__PURE__ */ (0, W.jsxs)("tr", {
|
|
4345
4363
|
className: "border-t-2 border-border font-semibold bg-muted/40",
|
|
4346
4364
|
children: [
|
|
4347
|
-
/* @__PURE__ */ (0,
|
|
4365
|
+
/* @__PURE__ */ (0, W.jsx)("td", {
|
|
4348
4366
|
className: "p-2",
|
|
4349
4367
|
children: "Total"
|
|
4350
4368
|
}),
|
|
4351
|
-
m.map((e) => /* @__PURE__ */ (0,
|
|
4369
|
+
m.map((e) => /* @__PURE__ */ (0, W.jsx)("td", {
|
|
4352
4370
|
className: "text-right p-2 tabular-nums",
|
|
4353
|
-
children: b(
|
|
4371
|
+
children: b(_[e] ?? 0)
|
|
4354
4372
|
}, e)),
|
|
4355
|
-
c && /* @__PURE__ */ (0,
|
|
4373
|
+
c && /* @__PURE__ */ (0, W.jsx)("td", {
|
|
4356
4374
|
className: "text-right p-2 tabular-nums font-bold",
|
|
4357
4375
|
children: b(y)
|
|
4358
4376
|
})
|
|
@@ -4361,9 +4379,9 @@ var en = ({ schema: e, className: t }) => {
|
|
|
4361
4379
|
]
|
|
4362
4380
|
})]
|
|
4363
4381
|
});
|
|
4364
|
-
},
|
|
4365
|
-
let o =
|
|
4366
|
-
|
|
4382
|
+
}, rn = ({ schema: e, dataSource: n, className: i }) => {
|
|
4383
|
+
let o = E(r), s = n || o?.dataSource, c = a(e.bind), [l, u] = A([]), [d, f] = A(!1), [p, m] = A(null);
|
|
4384
|
+
D(() => {
|
|
4367
4385
|
let n = !0;
|
|
4368
4386
|
return e.objectName && !c && (!e.data || e.data.length === 0) && (async () => {
|
|
4369
4387
|
if (!(!s || !e.objectName)) {
|
|
@@ -4389,47 +4407,47 @@ var en = ({ schema: e, className: t }) => {
|
|
|
4389
4407
|
e.data,
|
|
4390
4408
|
e.filter
|
|
4391
4409
|
]);
|
|
4392
|
-
let h = c || e.data || l,
|
|
4393
|
-
return d &&
|
|
4394
|
-
className:
|
|
4410
|
+
let h = c || e.data || l, g = Array.isArray(h) ? h : [];
|
|
4411
|
+
return d && g.length === 0 ? /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4412
|
+
className: v("overflow-auto", i),
|
|
4395
4413
|
"data-testid": "pivot-loading",
|
|
4396
|
-
children: [e.title && /* @__PURE__ */ (0,
|
|
4414
|
+
children: [e.title && /* @__PURE__ */ (0, W.jsx)("h3", {
|
|
4397
4415
|
className: "text-sm font-semibold mb-2",
|
|
4398
4416
|
children: e.title
|
|
4399
|
-
}), /* @__PURE__ */ (0,
|
|
4417
|
+
}), /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4400
4418
|
className: "space-y-2 p-2",
|
|
4401
|
-
children: [/* @__PURE__ */ (0,
|
|
4419
|
+
children: [/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4402
4420
|
className: "flex gap-2",
|
|
4403
4421
|
children: [
|
|
4404
|
-
/* @__PURE__ */ (0,
|
|
4405
|
-
/* @__PURE__ */ (0,
|
|
4406
|
-
/* @__PURE__ */ (0,
|
|
4407
|
-
/* @__PURE__ */ (0,
|
|
4422
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-6 w-24" }),
|
|
4423
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-6 w-20" }),
|
|
4424
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-6 w-20" }),
|
|
4425
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-6 w-20" })
|
|
4408
4426
|
]
|
|
4409
4427
|
}), [
|
|
4410
4428
|
1,
|
|
4411
4429
|
2,
|
|
4412
4430
|
3
|
|
4413
|
-
].map((e) => /* @__PURE__ */ (0,
|
|
4431
|
+
].map((e) => /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4414
4432
|
className: "flex gap-2",
|
|
4415
4433
|
children: [
|
|
4416
|
-
/* @__PURE__ */ (0,
|
|
4417
|
-
/* @__PURE__ */ (0,
|
|
4418
|
-
/* @__PURE__ */ (0,
|
|
4419
|
-
/* @__PURE__ */ (0,
|
|
4434
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-5 w-24" }),
|
|
4435
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-5 w-20" }),
|
|
4436
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-5 w-20" }),
|
|
4437
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-5 w-20" })
|
|
4420
4438
|
]
|
|
4421
4439
|
}, e))]
|
|
4422
4440
|
})]
|
|
4423
|
-
}) : p ? /* @__PURE__ */ (0,
|
|
4424
|
-
className:
|
|
4441
|
+
}) : p ? /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4442
|
+
className: v("overflow-auto", i),
|
|
4425
4443
|
"data-testid": "pivot-error",
|
|
4426
|
-
children: [e.title && /* @__PURE__ */ (0,
|
|
4444
|
+
children: [e.title && /* @__PURE__ */ (0, W.jsx)("h3", {
|
|
4427
4445
|
className: "text-sm font-semibold mb-2",
|
|
4428
4446
|
children: e.title
|
|
4429
|
-
}), /* @__PURE__ */ (0,
|
|
4447
|
+
}), /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4430
4448
|
className: "flex flex-col items-center justify-center py-8 text-destructive",
|
|
4431
4449
|
"data-testid": "pivot-error-message",
|
|
4432
|
-
children: [/* @__PURE__ */ (0,
|
|
4450
|
+
children: [/* @__PURE__ */ (0, W.jsxs)("svg", {
|
|
4433
4451
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4434
4452
|
className: "h-8 w-8 mb-2 opacity-60",
|
|
4435
4453
|
viewBox: "0 0 24 24",
|
|
@@ -4439,37 +4457,37 @@ var en = ({ schema: e, className: t }) => {
|
|
|
4439
4457
|
strokeLinecap: "round",
|
|
4440
4458
|
strokeLinejoin: "round",
|
|
4441
4459
|
children: [
|
|
4442
|
-
/* @__PURE__ */ (0,
|
|
4460
|
+
/* @__PURE__ */ (0, W.jsx)("circle", {
|
|
4443
4461
|
cx: "12",
|
|
4444
4462
|
cy: "12",
|
|
4445
4463
|
r: "10"
|
|
4446
4464
|
}),
|
|
4447
|
-
/* @__PURE__ */ (0,
|
|
4465
|
+
/* @__PURE__ */ (0, W.jsx)("line", {
|
|
4448
4466
|
x1: "12",
|
|
4449
4467
|
y1: "8",
|
|
4450
4468
|
x2: "12",
|
|
4451
4469
|
y2: "12"
|
|
4452
4470
|
}),
|
|
4453
|
-
/* @__PURE__ */ (0,
|
|
4471
|
+
/* @__PURE__ */ (0, W.jsx)("line", {
|
|
4454
4472
|
x1: "12",
|
|
4455
4473
|
y1: "16",
|
|
4456
4474
|
x2: "12.01",
|
|
4457
4475
|
y2: "16"
|
|
4458
4476
|
})
|
|
4459
4477
|
]
|
|
4460
|
-
}), /* @__PURE__ */ (0,
|
|
4478
|
+
}), /* @__PURE__ */ (0, W.jsx)("p", {
|
|
4461
4479
|
className: "text-xs",
|
|
4462
4480
|
children: p
|
|
4463
4481
|
})]
|
|
4464
4482
|
})]
|
|
4465
|
-
}) : !s && e.objectName &&
|
|
4466
|
-
className:
|
|
4467
|
-
children: [e.title && /* @__PURE__ */ (0,
|
|
4483
|
+
}) : !s && e.objectName && g.length === 0 ? /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4484
|
+
className: v("overflow-auto", i),
|
|
4485
|
+
children: [e.title && /* @__PURE__ */ (0, W.jsx)("h3", {
|
|
4468
4486
|
className: "text-sm font-semibold mb-2",
|
|
4469
4487
|
children: e.title
|
|
4470
|
-
}), /* @__PURE__ */ (0,
|
|
4488
|
+
}), /* @__PURE__ */ (0, W.jsx)("div", {
|
|
4471
4489
|
className: "flex flex-col items-center justify-center py-8 text-muted-foreground",
|
|
4472
|
-
children: /* @__PURE__ */ (0,
|
|
4490
|
+
children: /* @__PURE__ */ (0, W.jsxs)("p", {
|
|
4473
4491
|
className: "text-xs",
|
|
4474
4492
|
children: [
|
|
4475
4493
|
"No data source available for “",
|
|
@@ -4478,38 +4496,415 @@ var en = ({ schema: e, className: t }) => {
|
|
|
4478
4496
|
]
|
|
4479
4497
|
})
|
|
4480
4498
|
})]
|
|
4481
|
-
}) : /* @__PURE__ */ (0,
|
|
4499
|
+
}) : /* @__PURE__ */ (0, W.jsx)(nn, {
|
|
4482
4500
|
schema: {
|
|
4483
4501
|
...e,
|
|
4484
|
-
data:
|
|
4502
|
+
data: g
|
|
4485
4503
|
},
|
|
4486
4504
|
className: i
|
|
4487
4505
|
});
|
|
4488
|
-
}
|
|
4506
|
+
}, an = (e, t, n, r) => {
|
|
4507
|
+
let i = [n, {
|
|
4508
|
+
code: t,
|
|
4509
|
+
...r || {}
|
|
4510
|
+
}];
|
|
4511
|
+
if (e?.services?.logger?.forward) return e.services.logger.forward(i, "warn", "react-i18next::", !0);
|
|
4512
|
+
fn(i[0]) && (i[0] = `react-i18next:: ${i[0]}`), e?.services?.logger?.warn ? e.services.logger.warn(...i) : console?.warn && console.warn(...i);
|
|
4513
|
+
}, on = {}, sn = (e, t, n, r) => {
|
|
4514
|
+
fn(n) && on[n] || (fn(n) && (on[n] = /* @__PURE__ */ new Date()), an(e, t, n, r));
|
|
4515
|
+
}, cn = (e, t) => () => {
|
|
4516
|
+
if (e.isInitialized) t();
|
|
4517
|
+
else {
|
|
4518
|
+
let n = () => {
|
|
4519
|
+
setTimeout(() => {
|
|
4520
|
+
e.off("initialized", n);
|
|
4521
|
+
}, 0), t();
|
|
4522
|
+
};
|
|
4523
|
+
e.on("initialized", n);
|
|
4524
|
+
}
|
|
4525
|
+
}, ln = (e, t, n) => {
|
|
4526
|
+
e.loadNamespaces(t, cn(e, n));
|
|
4527
|
+
}, un = (e, t, n, r) => {
|
|
4528
|
+
if (fn(n) && (n = [n]), e.options.preload && e.options.preload.indexOf(t) > -1) return ln(e, n, r);
|
|
4529
|
+
n.forEach((t) => {
|
|
4530
|
+
e.options.ns.indexOf(t) < 0 && e.options.ns.push(t);
|
|
4531
|
+
}), e.loadLanguages(t, cn(e, r));
|
|
4532
|
+
}, dn = (e, t, n = {}) => !t.languages || !t.languages.length ? (sn(t, "NO_LANGUAGES", "i18n.languages were undefined or empty", { languages: t.languages }), !0) : t.hasLoadedNamespace(e, {
|
|
4533
|
+
lng: n.lng,
|
|
4534
|
+
precheck: (t, r) => {
|
|
4535
|
+
if (n.bindI18n && n.bindI18n.indexOf("languageChanging") > -1 && t.services.backendConnector.backend && t.isLanguageChangingTo && !r(t.isLanguageChangingTo, e)) return !1;
|
|
4536
|
+
}
|
|
4537
|
+
}), fn = (e) => typeof e == "string", pn = (e) => typeof e == "object" && !!e, mn = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, hn = {
|
|
4538
|
+
"&": "&",
|
|
4539
|
+
"&": "&",
|
|
4540
|
+
"<": "<",
|
|
4541
|
+
"<": "<",
|
|
4542
|
+
">": ">",
|
|
4543
|
+
">": ">",
|
|
4544
|
+
"'": "'",
|
|
4545
|
+
"'": "'",
|
|
4546
|
+
""": "\"",
|
|
4547
|
+
""": "\"",
|
|
4548
|
+
" ": " ",
|
|
4549
|
+
" ": " ",
|
|
4550
|
+
"©": "©",
|
|
4551
|
+
"©": "©",
|
|
4552
|
+
"®": "®",
|
|
4553
|
+
"®": "®",
|
|
4554
|
+
"…": "…",
|
|
4555
|
+
"…": "…",
|
|
4556
|
+
"/": "/",
|
|
4557
|
+
"/": "/"
|
|
4558
|
+
}, gn = (e) => hn[e], _n = {
|
|
4559
|
+
bindI18n: "languageChanged",
|
|
4560
|
+
bindI18nStore: "",
|
|
4561
|
+
transEmptyNodeValue: "",
|
|
4562
|
+
transSupportBasicHtmlNodes: !0,
|
|
4563
|
+
transWrapTextNodes: "",
|
|
4564
|
+
transKeepBasicHtmlNodesFor: [
|
|
4565
|
+
"br",
|
|
4566
|
+
"strong",
|
|
4567
|
+
"i",
|
|
4568
|
+
"p"
|
|
4569
|
+
],
|
|
4570
|
+
useSuspense: !0,
|
|
4571
|
+
unescape: (e) => e.replace(mn, gn),
|
|
4572
|
+
transDefaultProps: void 0
|
|
4573
|
+
}, vn = () => _n, yn, bn = () => yn, xn = C(), Sn = class {
|
|
4574
|
+
constructor() {
|
|
4575
|
+
this.usedNamespaces = {};
|
|
4576
|
+
}
|
|
4577
|
+
addUsedNamespaces(e) {
|
|
4578
|
+
e.forEach((e) => {
|
|
4579
|
+
this.usedNamespaces[e] || (this.usedNamespaces[e] = !0);
|
|
4580
|
+
});
|
|
4581
|
+
}
|
|
4582
|
+
getUsedNamespaces() {
|
|
4583
|
+
return Object.keys(this.usedNamespaces);
|
|
4584
|
+
}
|
|
4585
|
+
}, Cn = /* @__PURE__ */ V(((e) => {
|
|
4586
|
+
var t = H("react");
|
|
4587
|
+
function n(e, t) {
|
|
4588
|
+
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
4589
|
+
}
|
|
4590
|
+
var r = typeof Object.is == "function" ? Object.is : n, i = t.useState, a = t.useEffect, o = t.useLayoutEffect, s = t.useDebugValue;
|
|
4591
|
+
function c(e, t) {
|
|
4592
|
+
var n = t(), r = i({ inst: {
|
|
4593
|
+
value: n,
|
|
4594
|
+
getSnapshot: t
|
|
4595
|
+
} }), c = r[0].inst, u = r[1];
|
|
4596
|
+
return o(function() {
|
|
4597
|
+
c.value = n, c.getSnapshot = t, l(c) && u({ inst: c });
|
|
4598
|
+
}, [
|
|
4599
|
+
e,
|
|
4600
|
+
n,
|
|
4601
|
+
t
|
|
4602
|
+
]), a(function() {
|
|
4603
|
+
return l(c) && u({ inst: c }), e(function() {
|
|
4604
|
+
l(c) && u({ inst: c });
|
|
4605
|
+
});
|
|
4606
|
+
}, [e]), s(n), n;
|
|
4607
|
+
}
|
|
4608
|
+
function l(e) {
|
|
4609
|
+
var t = e.getSnapshot;
|
|
4610
|
+
e = e.value;
|
|
4611
|
+
try {
|
|
4612
|
+
var n = t();
|
|
4613
|
+
return !r(e, n);
|
|
4614
|
+
} catch {
|
|
4615
|
+
return !0;
|
|
4616
|
+
}
|
|
4617
|
+
}
|
|
4618
|
+
function u(e, t) {
|
|
4619
|
+
return t();
|
|
4620
|
+
}
|
|
4621
|
+
var d = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? u : c;
|
|
4622
|
+
e.useSyncExternalStore = t.useSyncExternalStore === void 0 ? d : t.useSyncExternalStore;
|
|
4623
|
+
})), wn = /* @__PURE__ */ V(((e) => {
|
|
4624
|
+
process.env.NODE_ENV !== "production" && (function() {
|
|
4625
|
+
function t(e, t) {
|
|
4626
|
+
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
4627
|
+
}
|
|
4628
|
+
function n(e, t) {
|
|
4629
|
+
d || a.startTransition === void 0 || (d = !0, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
|
4630
|
+
var n = t();
|
|
4631
|
+
if (!f) {
|
|
4632
|
+
var i = t();
|
|
4633
|
+
o(n, i) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), f = !0);
|
|
4634
|
+
}
|
|
4635
|
+
i = s({ inst: {
|
|
4636
|
+
value: n,
|
|
4637
|
+
getSnapshot: t
|
|
4638
|
+
} });
|
|
4639
|
+
var p = i[0].inst, m = i[1];
|
|
4640
|
+
return l(function() {
|
|
4641
|
+
p.value = n, p.getSnapshot = t, r(p) && m({ inst: p });
|
|
4642
|
+
}, [
|
|
4643
|
+
e,
|
|
4644
|
+
n,
|
|
4645
|
+
t
|
|
4646
|
+
]), c(function() {
|
|
4647
|
+
return r(p) && m({ inst: p }), e(function() {
|
|
4648
|
+
r(p) && m({ inst: p });
|
|
4649
|
+
});
|
|
4650
|
+
}, [e]), u(n), n;
|
|
4651
|
+
}
|
|
4652
|
+
function r(e) {
|
|
4653
|
+
var t = e.getSnapshot;
|
|
4654
|
+
e = e.value;
|
|
4655
|
+
try {
|
|
4656
|
+
var n = t();
|
|
4657
|
+
return !o(e, n);
|
|
4658
|
+
} catch {
|
|
4659
|
+
return !0;
|
|
4660
|
+
}
|
|
4661
|
+
}
|
|
4662
|
+
function i(e, t) {
|
|
4663
|
+
return t();
|
|
4664
|
+
}
|
|
4665
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
4666
|
+
var a = H("react"), o = typeof Object.is == "function" ? Object.is : t, s = a.useState, c = a.useEffect, l = a.useLayoutEffect, u = a.useDebugValue, d = !1, f = !1, p = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? i : n;
|
|
4667
|
+
e.useSyncExternalStore = a.useSyncExternalStore === void 0 ? p : a.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
4668
|
+
})();
|
|
4669
|
+
})), Tn = (/* @__PURE__ */ V(((e, t) => {
|
|
4670
|
+
process.env.NODE_ENV === "production" ? t.exports = Cn() : t.exports = wn();
|
|
4671
|
+
})))(), En = {
|
|
4672
|
+
t: (e, t) => {
|
|
4673
|
+
if (fn(t)) return t;
|
|
4674
|
+
if (pn(t) && fn(t.defaultValue)) return t.defaultValue;
|
|
4675
|
+
if (typeof e == "function") return "";
|
|
4676
|
+
if (Array.isArray(e)) {
|
|
4677
|
+
let t = e[e.length - 1];
|
|
4678
|
+
return typeof t == "function" ? "" : t;
|
|
4679
|
+
}
|
|
4680
|
+
return e;
|
|
4681
|
+
},
|
|
4682
|
+
ready: !1
|
|
4683
|
+
}, Dn = () => () => {}, On = (e, t = {}) => {
|
|
4684
|
+
let { i18n: n } = t, { i18n: r, defaultNS: i } = E(xn) || {}, a = n || r || bn();
|
|
4685
|
+
a && !a.reportNamespaces && (a.reportNamespaces = new Sn()), a || sn(a, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
|
|
4686
|
+
let o = O(() => ({
|
|
4687
|
+
...vn(),
|
|
4688
|
+
...a?.options?.react,
|
|
4689
|
+
...t
|
|
4690
|
+
}), [a, t]), { useSuspense: s, keyPrefix: c } = o, l = e || i || a?.options?.defaultNS, u = fn(l) ? [l] : l || ["translation"], d = O(() => u, u);
|
|
4691
|
+
a?.reportNamespaces?.addUsedNamespaces?.(d);
|
|
4692
|
+
let f = k(0), p = T((e) => {
|
|
4693
|
+
if (!a) return Dn;
|
|
4694
|
+
let { bindI18n: t, bindI18nStore: n } = o, r = () => {
|
|
4695
|
+
f.current += 1, e();
|
|
4696
|
+
};
|
|
4697
|
+
return t && a.on(t, r), n && a.store.on(n, r), () => {
|
|
4698
|
+
t && t.split(" ").forEach((e) => a.off(e, r)), n && n.split(" ").forEach((e) => a.store.off(e, r));
|
|
4699
|
+
};
|
|
4700
|
+
}, [a, o]), m = k(), h = T(() => {
|
|
4701
|
+
if (!a) return En;
|
|
4702
|
+
let e = !!(a.isInitialized || a.initializedStoreOnce) && d.every((e) => dn(e, a, o)), n = t.lng || a.language, r = f.current, i = m.current;
|
|
4703
|
+
if (i && i.ready === e && i.lng === n && i.keyPrefix === c && i.revision === r) return i;
|
|
4704
|
+
let s = {
|
|
4705
|
+
t: a.getFixedT(n, o.nsMode === "fallback" ? d : d[0], c),
|
|
4706
|
+
ready: e,
|
|
4707
|
+
lng: n,
|
|
4708
|
+
keyPrefix: c,
|
|
4709
|
+
revision: r
|
|
4710
|
+
};
|
|
4711
|
+
return m.current = s, s;
|
|
4712
|
+
}, [
|
|
4713
|
+
a,
|
|
4714
|
+
d,
|
|
4715
|
+
c,
|
|
4716
|
+
o,
|
|
4717
|
+
t.lng
|
|
4718
|
+
]), [g, _] = A(0), { t: v, ready: y } = (0, Tn.useSyncExternalStore)(p, h, h);
|
|
4719
|
+
D(() => {
|
|
4720
|
+
if (a && !y && !s) {
|
|
4721
|
+
let e = () => _((e) => e + 1);
|
|
4722
|
+
t.lng ? un(a, t.lng, d, e) : ln(a, d, e);
|
|
4723
|
+
}
|
|
4724
|
+
}, [
|
|
4725
|
+
a,
|
|
4726
|
+
t.lng,
|
|
4727
|
+
d,
|
|
4728
|
+
y,
|
|
4729
|
+
s,
|
|
4730
|
+
g
|
|
4731
|
+
]);
|
|
4732
|
+
let b = a || {}, x = k(null), S = k(), C = (e) => {
|
|
4733
|
+
let t = Object.getOwnPropertyDescriptors(e);
|
|
4734
|
+
t.__original && delete t.__original;
|
|
4735
|
+
let n = Object.create(Object.getPrototypeOf(e), t);
|
|
4736
|
+
if (!Object.prototype.hasOwnProperty.call(n, "__original")) try {
|
|
4737
|
+
Object.defineProperty(n, "__original", {
|
|
4738
|
+
value: e,
|
|
4739
|
+
writable: !1,
|
|
4740
|
+
enumerable: !1,
|
|
4741
|
+
configurable: !1
|
|
4742
|
+
});
|
|
4743
|
+
} catch {}
|
|
4744
|
+
return n;
|
|
4745
|
+
}, w = O(() => {
|
|
4746
|
+
let e = b, t = e?.language, n = e;
|
|
4747
|
+
e && (x.current && x.current.__original === e && S.current === t ? n = x.current : (n = C(e), x.current = n, S.current = t));
|
|
4748
|
+
let r = !y && !s ? (...e) => (sn(a, "USE_T_BEFORE_READY", "useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."), v(...e)) : v, i = [
|
|
4749
|
+
r,
|
|
4750
|
+
n,
|
|
4751
|
+
y
|
|
4752
|
+
];
|
|
4753
|
+
return i.t = r, i.i18n = n, i.ready = y, i;
|
|
4754
|
+
}, [
|
|
4755
|
+
v,
|
|
4756
|
+
b,
|
|
4757
|
+
y,
|
|
4758
|
+
b.resolvedLanguage,
|
|
4759
|
+
b.language,
|
|
4760
|
+
b.languages
|
|
4761
|
+
]);
|
|
4762
|
+
if (a && s && !y) throw new Promise((e) => {
|
|
4763
|
+
let n = () => e();
|
|
4764
|
+
t.lng ? un(a, t.lng, d, n) : ln(a, d, n);
|
|
4765
|
+
});
|
|
4766
|
+
return w;
|
|
4767
|
+
}, kn = C(null);
|
|
4768
|
+
function An(e) {
|
|
4769
|
+
let t = E(kn), { t: n, i18n: r } = On(e);
|
|
4770
|
+
return {
|
|
4771
|
+
t: n,
|
|
4772
|
+
language: t?.language || r.language || "en",
|
|
4773
|
+
changeLanguage: t?.changeLanguage || (async (e) => {
|
|
4774
|
+
await r.changeLanguage(e);
|
|
4775
|
+
}),
|
|
4776
|
+
direction: t?.direction || "ltr",
|
|
4777
|
+
i18n: r
|
|
4778
|
+
};
|
|
4779
|
+
}
|
|
4780
|
+
//#endregion
|
|
4781
|
+
//#region ../i18n/dist/useObjectLabel.js
|
|
4782
|
+
var jn = new Set([
|
|
4783
|
+
"common",
|
|
4784
|
+
"validation",
|
|
4785
|
+
"form",
|
|
4786
|
+
"table",
|
|
4787
|
+
"grid",
|
|
4788
|
+
"calendar",
|
|
4789
|
+
"list",
|
|
4790
|
+
"kanban",
|
|
4791
|
+
"chart",
|
|
4792
|
+
"dashboard",
|
|
4793
|
+
"configPanel",
|
|
4794
|
+
"appDesigner",
|
|
4795
|
+
"console",
|
|
4796
|
+
"errors",
|
|
4797
|
+
"detail"
|
|
4798
|
+
]);
|
|
4799
|
+
function Mn() {
|
|
4800
|
+
let { t: e, i18n: t } = An(), n = () => {
|
|
4801
|
+
if (!t || typeof t.getResourceBundle != "function") return [];
|
|
4802
|
+
let e = t.language || "en", n = t.getResourceBundle(e, "translation");
|
|
4803
|
+
return n ? Object.keys(n).filter((e) => !jn.has(e) && n[e] && typeof n[e] == "object" && (n[e].objects || n[e].fields || n[e].apps || n[e].dashboards || n[e].pages || n[e].reports)) : [];
|
|
4804
|
+
}, r = (e) => {
|
|
4805
|
+
let t = e.indexOf("__");
|
|
4806
|
+
return t > 0 ? e.slice(t + 2) : e;
|
|
4807
|
+
}, i = (t, r) => {
|
|
4808
|
+
let i = Array.isArray(t) ? t : [t];
|
|
4809
|
+
try {
|
|
4810
|
+
let t = n();
|
|
4811
|
+
for (let n of t) for (let t of i) {
|
|
4812
|
+
let r = `${n}.${t}`, i = e(r, { defaultValue: "" });
|
|
4813
|
+
if (i && i !== r && i !== "") return i;
|
|
4814
|
+
}
|
|
4815
|
+
} catch {}
|
|
4816
|
+
return r;
|
|
4817
|
+
}, a = (e, t) => {
|
|
4818
|
+
let n = r(e);
|
|
4819
|
+
return n === e ? [`objects.${e}.${t}`] : [`objects.${e}.${t}`, `objects.${n}.${t}`];
|
|
4820
|
+
}, o = (e, t) => {
|
|
4821
|
+
let n = r(e);
|
|
4822
|
+
return n === e ? [`fields.${e}.${t}`] : [`fields.${e}.${t}`, `fields.${n}.${t}`];
|
|
4823
|
+
}, s = (e, t, n) => {
|
|
4824
|
+
let i = r(e);
|
|
4825
|
+
return i === e ? [`fieldOptions.${e}.${t}.${n}`] : [`fieldOptions.${e}.${t}.${n}`, `fieldOptions.${i}.${t}.${n}`];
|
|
4826
|
+
}, c = (e, t) => {
|
|
4827
|
+
let n = r(e);
|
|
4828
|
+
return n === e ? [`dashboards.${e}.${t}`] : [`dashboards.${e}.${t}`, `dashboards.${n}.${t}`];
|
|
4829
|
+
}, l = (e, t) => {
|
|
4830
|
+
let n = r(e);
|
|
4831
|
+
return n === e ? [`pages.${e}.${t}`] : [`pages.${e}.${t}`, `pages.${n}.${t}`];
|
|
4832
|
+
}, u = (e, t) => {
|
|
4833
|
+
let n = r(e);
|
|
4834
|
+
return n === e ? [`reports.${e}.${t}`] : [`reports.${e}.${t}`, `reports.${n}.${t}`];
|
|
4835
|
+
};
|
|
4836
|
+
return {
|
|
4837
|
+
objectLabel: (e) => i(a(e.name, "label"), e.label),
|
|
4838
|
+
objectDescription: (e) => {
|
|
4839
|
+
if (e.description) return i(a(e.name, "description"), e.description);
|
|
4840
|
+
},
|
|
4841
|
+
fieldLabel: (e, t, n) => i(o(e, t), n),
|
|
4842
|
+
fieldOptionLabel: (e, t, n, r) => i(s(e, t, n), r),
|
|
4843
|
+
translateOptions: (e, t, n) => n.map((n) => ({
|
|
4844
|
+
...n,
|
|
4845
|
+
label: i(s(e, t, n.value), n.label)
|
|
4846
|
+
})),
|
|
4847
|
+
appLabel: (e) => i(`apps.${e.name}.label`, e.label ?? e.name),
|
|
4848
|
+
appDescription: (e) => {
|
|
4849
|
+
let t = e.description ?? "";
|
|
4850
|
+
return i(`apps.${e.name}.description`, t) || void 0;
|
|
4851
|
+
},
|
|
4852
|
+
navGroupLabel: (e, t, n) => i(`apps.${e}.navigation.${t}.label`, n),
|
|
4853
|
+
dashboardLabel: (e) => i(c(e.name, "label"), e.label ?? e.name),
|
|
4854
|
+
dashboardDescription: (e) => {
|
|
4855
|
+
let t = e.description ?? "";
|
|
4856
|
+
return i(c(e.name, "description"), t) || void 0;
|
|
4857
|
+
},
|
|
4858
|
+
dashboardActionLabel: (e, t, n) => i(c(e, `actions.${t}.label`), n),
|
|
4859
|
+
widgetTitle: (e, t, n) => i(c(e, `widgets.${t}.title`), n),
|
|
4860
|
+
widgetDescription: (e, t, n) => {
|
|
4861
|
+
let r = n ?? "";
|
|
4862
|
+
return i(c(e, `widgets.${t}.description`), r) || void 0;
|
|
4863
|
+
},
|
|
4864
|
+
pageLabel: (e) => i(l(e.name, "label"), e.label ?? e.name),
|
|
4865
|
+
reportLabel: (e) => i(u(e.name, "label"), e.label ?? e.name)
|
|
4866
|
+
};
|
|
4867
|
+
}
|
|
4868
|
+
function Nn() {
|
|
4869
|
+
try {
|
|
4870
|
+
let { fieldLabel: e, translateOptions: t, fieldOptionLabel: n } = Mn();
|
|
4871
|
+
return {
|
|
4872
|
+
fieldLabel: e,
|
|
4873
|
+
translateOptions: t,
|
|
4874
|
+
fieldOptionLabel: n
|
|
4875
|
+
};
|
|
4876
|
+
} catch {
|
|
4877
|
+
return {
|
|
4878
|
+
fieldLabel: (e, t, n) => n,
|
|
4879
|
+
translateOptions: (e, t, n) => n,
|
|
4880
|
+
fieldOptionLabel: (e, t, n, r) => r
|
|
4881
|
+
};
|
|
4882
|
+
}
|
|
4883
|
+
}
|
|
4489
4884
|
//#endregion
|
|
4490
4885
|
//#region src/ObjectDataTable.tsx
|
|
4491
|
-
function
|
|
4886
|
+
function Pn(e) {
|
|
4492
4887
|
return e.map((e) => typeof e == "string" ? {
|
|
4493
4888
|
header: e.replace(/_/g, " ").replace(/([A-Z])/g, " $1").trim().replace(/\b\w/g, (e) => e.toUpperCase()),
|
|
4494
4889
|
accessorKey: e
|
|
4495
4890
|
} : e);
|
|
4496
4891
|
}
|
|
4497
|
-
var
|
|
4498
|
-
let s =
|
|
4499
|
-
|
|
4892
|
+
var Fn = ({ schema: e, dataSource: i, className: o }) => {
|
|
4893
|
+
let s = E(r), c = i || s?.dataSource, l = a(e.bind), { fieldLabel: u, fieldOptionLabel: d } = Nn(), [f, p] = A([]), [m, h] = A(null), [g, y] = A(!1), [b, x] = A(null);
|
|
4894
|
+
D(() => {
|
|
4500
4895
|
let n = !0;
|
|
4501
4896
|
return e.objectName && !l && (!e.data || e.data.length === 0) && (async () => {
|
|
4502
4897
|
if (!(!c || !e.objectName)) {
|
|
4503
|
-
n && (
|
|
4898
|
+
n && (y(!0), x(null));
|
|
4504
4899
|
try {
|
|
4505
4900
|
let r;
|
|
4506
4901
|
if (typeof c.find == "function") r = t(await c.find(e.objectName, { $filter: e.filter }));
|
|
4507
4902
|
else return;
|
|
4508
|
-
n &&
|
|
4903
|
+
n && p(r);
|
|
4509
4904
|
} catch (e) {
|
|
4510
|
-
console.error("[ObjectDataTable] Fetch error:", e), n &&
|
|
4905
|
+
console.error("[ObjectDataTable] Fetch error:", e), n && x(e instanceof Error ? e.message : "Failed to load data");
|
|
4511
4906
|
} finally {
|
|
4512
|
-
n &&
|
|
4907
|
+
n && y(!1);
|
|
4513
4908
|
}
|
|
4514
4909
|
}
|
|
4515
4910
|
})(), () => {
|
|
@@ -4521,46 +4916,100 @@ var rn = ({ schema: e, dataSource: i, className: o }) => {
|
|
|
4521
4916
|
l,
|
|
4522
4917
|
e.data,
|
|
4523
4918
|
e.filter
|
|
4919
|
+
]), D(() => {
|
|
4920
|
+
let t = !0;
|
|
4921
|
+
if (!(!c || !e.objectName || typeof c.getObjectSchema != "function")) return c.getObjectSchema(e.objectName).then((e) => {
|
|
4922
|
+
t && h(e);
|
|
4923
|
+
}).catch(() => {}), () => {
|
|
4924
|
+
t = !1;
|
|
4925
|
+
};
|
|
4926
|
+
}, [e.objectName, c]);
|
|
4927
|
+
let S = l || e.data || f, C = Array.isArray(S) ? S : [], w = O(() => {
|
|
4928
|
+
let t = e.objectName, n = (e) => {
|
|
4929
|
+
let n = e.charAt(0).toUpperCase() + e.slice(1).replace(/([A-Z])/g, " $1");
|
|
4930
|
+
return t ? u(t, e, n) : n;
|
|
4931
|
+
};
|
|
4932
|
+
if (e.columns && e.columns.length > 0) {
|
|
4933
|
+
let n = Pn(e.columns);
|
|
4934
|
+
return t ? n.map((e) => ({
|
|
4935
|
+
...e,
|
|
4936
|
+
header: u(t, e.accessorKey, e.header)
|
|
4937
|
+
})) : n;
|
|
4938
|
+
}
|
|
4939
|
+
return C.length === 0 ? [] : Object.keys(C[0]).filter((e) => !e.startsWith("_")).map((e) => ({
|
|
4940
|
+
header: n(e),
|
|
4941
|
+
accessorKey: e
|
|
4942
|
+
}));
|
|
4943
|
+
}, [
|
|
4944
|
+
e.columns,
|
|
4945
|
+
e.objectName,
|
|
4946
|
+
C,
|
|
4947
|
+
u
|
|
4948
|
+
]), T = O(() => {
|
|
4949
|
+
let t = e.objectName;
|
|
4950
|
+
if (!t || !m?.fields || C.length === 0) return C;
|
|
4951
|
+
let n = {};
|
|
4952
|
+
for (let e of w) {
|
|
4953
|
+
let t = m.fields[e.accessorKey];
|
|
4954
|
+
if (!t) continue;
|
|
4955
|
+
let r = t.type;
|
|
4956
|
+
if (r !== "select" && r !== "picklist" && r !== "dropdown") continue;
|
|
4957
|
+
let i = t.options || [], a = {};
|
|
4958
|
+
for (let e of i) typeof e == "string" ? a[e] = e : e && typeof e == "object" && (a[String(e.value)] = e.label || String(e.value));
|
|
4959
|
+
n[e.accessorKey] = a;
|
|
4960
|
+
}
|
|
4961
|
+
return Object.keys(n).length === 0 ? C : C.map((e) => {
|
|
4962
|
+
let r = { ...e };
|
|
4963
|
+
for (let [i, a] of Object.entries(n)) {
|
|
4964
|
+
let n = e[i];
|
|
4965
|
+
if (n == null || n === "") continue;
|
|
4966
|
+
let o = String(n);
|
|
4967
|
+
r[i] = d(t, i, o, a[o] || o);
|
|
4968
|
+
}
|
|
4969
|
+
return r;
|
|
4970
|
+
});
|
|
4971
|
+
}, [
|
|
4972
|
+
C,
|
|
4973
|
+
w,
|
|
4974
|
+
m,
|
|
4975
|
+
e.objectName,
|
|
4976
|
+
d
|
|
4524
4977
|
]);
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
accessorKey: e
|
|
4528
|
-
})), [e.columns, y]);
|
|
4529
|
-
return f && y.length === 0 ? /* @__PURE__ */ (0, U.jsx)("div", {
|
|
4530
|
-
className: _("overflow-auto", o),
|
|
4978
|
+
return g && C.length === 0 ? /* @__PURE__ */ (0, W.jsx)("div", {
|
|
4979
|
+
className: v("overflow-auto", o),
|
|
4531
4980
|
"data-testid": "table-loading",
|
|
4532
|
-
children: /* @__PURE__ */ (0,
|
|
4981
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4533
4982
|
className: "space-y-2 p-2",
|
|
4534
|
-
children: [/* @__PURE__ */ (0,
|
|
4983
|
+
children: [/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4535
4984
|
className: "flex gap-2",
|
|
4536
4985
|
children: [
|
|
4537
|
-
/* @__PURE__ */ (0,
|
|
4538
|
-
/* @__PURE__ */ (0,
|
|
4539
|
-
/* @__PURE__ */ (0,
|
|
4540
|
-
/* @__PURE__ */ (0,
|
|
4986
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-6 w-1/4" }),
|
|
4987
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-6 w-1/4" }),
|
|
4988
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-6 w-1/4" }),
|
|
4989
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-6 w-1/4" })
|
|
4541
4990
|
]
|
|
4542
4991
|
}), [
|
|
4543
4992
|
1,
|
|
4544
4993
|
2,
|
|
4545
4994
|
3,
|
|
4546
4995
|
4
|
|
4547
|
-
].map((e) => /* @__PURE__ */ (0,
|
|
4996
|
+
].map((e) => /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4548
4997
|
className: "flex gap-2",
|
|
4549
4998
|
children: [
|
|
4550
|
-
/* @__PURE__ */ (0,
|
|
4551
|
-
/* @__PURE__ */ (0,
|
|
4552
|
-
/* @__PURE__ */ (0,
|
|
4553
|
-
/* @__PURE__ */ (0,
|
|
4999
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-5 w-1/4" }),
|
|
5000
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-5 w-1/4" }),
|
|
5001
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-5 w-1/4" }),
|
|
5002
|
+
/* @__PURE__ */ (0, W.jsx)(_, { className: "h-5 w-1/4" })
|
|
4554
5003
|
]
|
|
4555
5004
|
}, e))]
|
|
4556
5005
|
})
|
|
4557
|
-
}) :
|
|
4558
|
-
className:
|
|
5006
|
+
}) : b ? /* @__PURE__ */ (0, W.jsx)("div", {
|
|
5007
|
+
className: v("overflow-auto", o),
|
|
4559
5008
|
"data-testid": "table-error",
|
|
4560
|
-
children: /* @__PURE__ */ (0,
|
|
5009
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4561
5010
|
className: "flex flex-col items-center justify-center py-8 text-destructive",
|
|
4562
5011
|
"data-testid": "table-error-message",
|
|
4563
|
-
children: [/* @__PURE__ */ (0,
|
|
5012
|
+
children: [/* @__PURE__ */ (0, W.jsxs)("svg", {
|
|
4564
5013
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4565
5014
|
className: "h-8 w-8 mb-2 opacity-60",
|
|
4566
5015
|
viewBox: "0 0 24 24",
|
|
@@ -4570,34 +5019,34 @@ var rn = ({ schema: e, dataSource: i, className: o }) => {
|
|
|
4570
5019
|
strokeLinecap: "round",
|
|
4571
5020
|
strokeLinejoin: "round",
|
|
4572
5021
|
children: [
|
|
4573
|
-
/* @__PURE__ */ (0,
|
|
5022
|
+
/* @__PURE__ */ (0, W.jsx)("circle", {
|
|
4574
5023
|
cx: "12",
|
|
4575
5024
|
cy: "12",
|
|
4576
5025
|
r: "10"
|
|
4577
5026
|
}),
|
|
4578
|
-
/* @__PURE__ */ (0,
|
|
5027
|
+
/* @__PURE__ */ (0, W.jsx)("line", {
|
|
4579
5028
|
x1: "12",
|
|
4580
5029
|
y1: "8",
|
|
4581
5030
|
x2: "12",
|
|
4582
5031
|
y2: "12"
|
|
4583
5032
|
}),
|
|
4584
|
-
/* @__PURE__ */ (0,
|
|
5033
|
+
/* @__PURE__ */ (0, W.jsx)("line", {
|
|
4585
5034
|
x1: "12",
|
|
4586
5035
|
y1: "16",
|
|
4587
5036
|
x2: "12.01",
|
|
4588
5037
|
y2: "16"
|
|
4589
5038
|
})
|
|
4590
5039
|
]
|
|
4591
|
-
}), /* @__PURE__ */ (0,
|
|
5040
|
+
}), /* @__PURE__ */ (0, W.jsx)("p", {
|
|
4592
5041
|
className: "text-xs",
|
|
4593
|
-
children:
|
|
5042
|
+
children: b
|
|
4594
5043
|
})]
|
|
4595
5044
|
})
|
|
4596
|
-
}) : !c && e.objectName &&
|
|
4597
|
-
className:
|
|
4598
|
-
children: /* @__PURE__ */ (0,
|
|
5045
|
+
}) : !c && e.objectName && C.length === 0 ? /* @__PURE__ */ (0, W.jsx)("div", {
|
|
5046
|
+
className: v("overflow-auto", o),
|
|
5047
|
+
children: /* @__PURE__ */ (0, W.jsx)("div", {
|
|
4599
5048
|
className: "flex flex-col items-center justify-center py-8 text-muted-foreground",
|
|
4600
|
-
children: /* @__PURE__ */ (0,
|
|
5049
|
+
children: /* @__PURE__ */ (0, W.jsxs)("p", {
|
|
4601
5050
|
className: "text-xs",
|
|
4602
5051
|
children: [
|
|
4603
5052
|
"No data source available for “",
|
|
@@ -4606,12 +5055,12 @@ var rn = ({ schema: e, dataSource: i, className: o }) => {
|
|
|
4606
5055
|
]
|
|
4607
5056
|
})
|
|
4608
5057
|
})
|
|
4609
|
-
}) :
|
|
4610
|
-
className:
|
|
5058
|
+
}) : C.length === 0 ? /* @__PURE__ */ (0, W.jsx)("div", {
|
|
5059
|
+
className: v("overflow-auto", o),
|
|
4611
5060
|
"data-testid": "table-empty-state",
|
|
4612
|
-
children: /* @__PURE__ */ (0,
|
|
5061
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
4613
5062
|
className: "flex flex-col items-center justify-center py-8 text-muted-foreground",
|
|
4614
|
-
children: [/* @__PURE__ */ (0,
|
|
5063
|
+
children: [/* @__PURE__ */ (0, W.jsxs)("svg", {
|
|
4615
5064
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4616
5065
|
className: "h-8 w-8 mb-2 opacity-40",
|
|
4617
5066
|
viewBox: "0 0 24 24",
|
|
@@ -4621,7 +5070,7 @@ var rn = ({ schema: e, dataSource: i, className: o }) => {
|
|
|
4621
5070
|
strokeLinecap: "round",
|
|
4622
5071
|
strokeLinejoin: "round",
|
|
4623
5072
|
children: [
|
|
4624
|
-
/* @__PURE__ */ (0,
|
|
5073
|
+
/* @__PURE__ */ (0, W.jsx)("rect", {
|
|
4625
5074
|
x: "3",
|
|
4626
5075
|
y: "3",
|
|
4627
5076
|
width: "18",
|
|
@@ -4629,34 +5078,34 @@ var rn = ({ schema: e, dataSource: i, className: o }) => {
|
|
|
4629
5078
|
rx: "2",
|
|
4630
5079
|
ry: "2"
|
|
4631
5080
|
}),
|
|
4632
|
-
/* @__PURE__ */ (0,
|
|
5081
|
+
/* @__PURE__ */ (0, W.jsx)("line", {
|
|
4633
5082
|
x1: "3",
|
|
4634
5083
|
y1: "9",
|
|
4635
5084
|
x2: "21",
|
|
4636
5085
|
y2: "9"
|
|
4637
5086
|
}),
|
|
4638
|
-
/* @__PURE__ */ (0,
|
|
5087
|
+
/* @__PURE__ */ (0, W.jsx)("line", {
|
|
4639
5088
|
x1: "9",
|
|
4640
5089
|
y1: "21",
|
|
4641
5090
|
x2: "9",
|
|
4642
5091
|
y2: "9"
|
|
4643
5092
|
})
|
|
4644
5093
|
]
|
|
4645
|
-
}), /* @__PURE__ */ (0,
|
|
5094
|
+
}), /* @__PURE__ */ (0, W.jsx)("p", {
|
|
4646
5095
|
className: "text-xs",
|
|
4647
5096
|
children: "No data available"
|
|
4648
5097
|
})]
|
|
4649
5098
|
})
|
|
4650
|
-
}) : /* @__PURE__ */ (0,
|
|
5099
|
+
}) : /* @__PURE__ */ (0, W.jsx)(n, {
|
|
4651
5100
|
schema: {
|
|
4652
5101
|
...e,
|
|
4653
5102
|
type: "data-table",
|
|
4654
|
-
data:
|
|
4655
|
-
columns:
|
|
5103
|
+
data: T,
|
|
5104
|
+
columns: w
|
|
4656
5105
|
},
|
|
4657
5106
|
className: o
|
|
4658
5107
|
});
|
|
4659
|
-
},
|
|
5108
|
+
}, In = {
|
|
4660
5109
|
breadcrumb: ["Dashboard", "Configuration"],
|
|
4661
5110
|
sections: [
|
|
4662
5111
|
{
|
|
@@ -4761,12 +5210,12 @@ var rn = ({ schema: e, dataSource: i, className: o }) => {
|
|
|
4761
5210
|
}
|
|
4762
5211
|
]
|
|
4763
5212
|
};
|
|
4764
|
-
function
|
|
4765
|
-
let { draft: a, isDirty: o, updateField: s, discard: c } =
|
|
4766
|
-
return /* @__PURE__ */ (0,
|
|
5213
|
+
function Ln({ open: e, onClose: t, config: n, onSave: r, onFieldChange: i }) {
|
|
5214
|
+
let { draft: a, isDirty: o, updateField: s, discard: c } = b(n, { onUpdate: i });
|
|
5215
|
+
return /* @__PURE__ */ (0, W.jsx)(h, {
|
|
4767
5216
|
open: e,
|
|
4768
5217
|
onClose: t,
|
|
4769
|
-
schema:
|
|
5218
|
+
schema: In,
|
|
4770
5219
|
draft: a,
|
|
4771
5220
|
isDirty: o,
|
|
4772
5221
|
onFieldChange: s,
|
|
@@ -4776,7 +5225,7 @@ function on({ open: e, onClose: t, config: n, onSave: r, onFieldChange: i }) {
|
|
|
4776
5225
|
}
|
|
4777
5226
|
//#endregion
|
|
4778
5227
|
//#region src/WidgetConfigPanel.tsx
|
|
4779
|
-
var
|
|
5228
|
+
var Rn = [
|
|
4780
5229
|
{
|
|
4781
5230
|
value: "metric",
|
|
4782
5231
|
label: "Metric"
|
|
@@ -4821,7 +5270,7 @@ var sn = [
|
|
|
4821
5270
|
value: "custom",
|
|
4822
5271
|
label: "Custom"
|
|
4823
5272
|
}
|
|
4824
|
-
],
|
|
5273
|
+
], zn = [
|
|
4825
5274
|
{
|
|
4826
5275
|
value: "default",
|
|
4827
5276
|
label: "Default"
|
|
@@ -4854,7 +5303,7 @@ var sn = [
|
|
|
4854
5303
|
value: "danger",
|
|
4855
5304
|
label: "Danger"
|
|
4856
5305
|
}
|
|
4857
|
-
],
|
|
5306
|
+
], Bn = [
|
|
4858
5307
|
{
|
|
4859
5308
|
value: "count",
|
|
4860
5309
|
label: "Count"
|
|
@@ -4875,7 +5324,7 @@ var sn = [
|
|
|
4875
5324
|
value: "max",
|
|
4876
5325
|
label: "Max"
|
|
4877
5326
|
}
|
|
4878
|
-
],
|
|
5327
|
+
], Vn = [
|
|
4879
5328
|
"bar",
|
|
4880
5329
|
"line",
|
|
4881
5330
|
"area",
|
|
@@ -4883,32 +5332,32 @@ var sn = [
|
|
|
4883
5332
|
"donut",
|
|
4884
5333
|
"scatter"
|
|
4885
5334
|
];
|
|
4886
|
-
function
|
|
4887
|
-
return !!e &&
|
|
5335
|
+
function Hn(e) {
|
|
5336
|
+
return !!e && Vn.includes(e);
|
|
4888
5337
|
}
|
|
4889
|
-
var
|
|
5338
|
+
var Un = [{
|
|
4890
5339
|
value: "group",
|
|
4891
5340
|
label: "Group"
|
|
4892
5341
|
}, {
|
|
4893
5342
|
value: "value",
|
|
4894
5343
|
label: "Value"
|
|
4895
|
-
}],
|
|
5344
|
+
}], Wn = [{
|
|
4896
5345
|
value: "asc",
|
|
4897
5346
|
label: "↑"
|
|
4898
5347
|
}, {
|
|
4899
5348
|
value: "desc",
|
|
4900
5349
|
label: "↓"
|
|
4901
5350
|
}];
|
|
4902
|
-
function
|
|
5351
|
+
function Gn(e, t, n, r) {
|
|
4903
5352
|
return {
|
|
4904
5353
|
key: e,
|
|
4905
5354
|
label: t,
|
|
4906
5355
|
type: "custom",
|
|
4907
|
-
render: (i, a, o) => /* @__PURE__ */ (0,
|
|
5356
|
+
render: (i, a, o) => /* @__PURE__ */ (0, W.jsx)(g, {
|
|
4908
5357
|
label: t,
|
|
4909
|
-
children: /* @__PURE__ */ (0,
|
|
5358
|
+
children: /* @__PURE__ */ (0, W.jsx)("div", {
|
|
4910
5359
|
"data-testid": `config-field-${e}`,
|
|
4911
|
-
children: /* @__PURE__ */ (0,
|
|
5360
|
+
children: /* @__PURE__ */ (0, W.jsx)(m, {
|
|
4912
5361
|
options: r ?? [],
|
|
4913
5362
|
value: i ?? "",
|
|
4914
5363
|
onValueChange: a,
|
|
@@ -4922,16 +5371,16 @@ function mn(e, t, n, r) {
|
|
|
4922
5371
|
})
|
|
4923
5372
|
};
|
|
4924
5373
|
}
|
|
4925
|
-
function
|
|
5374
|
+
function Kn(e, t, n) {
|
|
4926
5375
|
let r = e && e.length > 0, i = r ? {
|
|
4927
5376
|
key: "object",
|
|
4928
5377
|
label: "Data source",
|
|
4929
5378
|
type: "custom",
|
|
4930
|
-
render: (t, n) => /* @__PURE__ */ (0,
|
|
5379
|
+
render: (t, n) => /* @__PURE__ */ (0, W.jsx)(g, {
|
|
4931
5380
|
label: "Data source",
|
|
4932
|
-
children: /* @__PURE__ */ (0,
|
|
5381
|
+
children: /* @__PURE__ */ (0, W.jsx)("div", {
|
|
4933
5382
|
"data-testid": "config-field-object",
|
|
4934
|
-
children: /* @__PURE__ */ (0,
|
|
5383
|
+
children: /* @__PURE__ */ (0, W.jsx)(m, {
|
|
4935
5384
|
options: e,
|
|
4936
5385
|
value: t ?? "",
|
|
4937
5386
|
onValueChange: n,
|
|
@@ -4947,27 +5396,27 @@ function hn(e, t, n) {
|
|
|
4947
5396
|
label: "Data source",
|
|
4948
5397
|
type: "input",
|
|
4949
5398
|
placeholder: "Object name"
|
|
4950
|
-
}, a = r ?
|
|
5399
|
+
}, a = r ? Gn("categoryField", "Category field", "Select field…", t) : {
|
|
4951
5400
|
key: "categoryField",
|
|
4952
5401
|
label: "Category field",
|
|
4953
5402
|
type: "input",
|
|
4954
5403
|
placeholder: "e.g. status"
|
|
4955
|
-
}, o = r ?
|
|
5404
|
+
}, o = r ? Gn("valueField", "Value field", "Select field…", t) : {
|
|
4956
5405
|
key: "valueField",
|
|
4957
5406
|
label: "Value field",
|
|
4958
5407
|
type: "input",
|
|
4959
5408
|
placeholder: "e.g. amount"
|
|
4960
|
-
}, s = r ?
|
|
5409
|
+
}, s = r ? Gn("rowField", "Field", "Select row field…", t) : {
|
|
4961
5410
|
key: "rowField",
|
|
4962
5411
|
label: "Field",
|
|
4963
5412
|
type: "input",
|
|
4964
5413
|
placeholder: "e.g. owner"
|
|
4965
|
-
}, c = r ?
|
|
5414
|
+
}, c = r ? Gn("columnField", "Field", "Select column field…", t) : {
|
|
4966
5415
|
key: "columnField",
|
|
4967
5416
|
label: "Field",
|
|
4968
5417
|
type: "input",
|
|
4969
5418
|
placeholder: "e.g. stage"
|
|
4970
|
-
}, l = r ?
|
|
5419
|
+
}, l = r ? Gn("pivotValueField", "Field", "Select value field…", t) : {
|
|
4971
5420
|
key: "pivotValueField",
|
|
4972
5421
|
label: "Field",
|
|
4973
5422
|
type: "input",
|
|
@@ -4977,7 +5426,7 @@ function hn(e, t, n) {
|
|
|
4977
5426
|
breadcrumb: ["Dashboard", {
|
|
4978
5427
|
pivot: "Pivot table",
|
|
4979
5428
|
table: "Table"
|
|
4980
|
-
}[n ?? ""] ?? (
|
|
5429
|
+
}[n ?? ""] ?? (Hn(n) ? "Chart" : "Widget")],
|
|
4981
5430
|
sections: [
|
|
4982
5431
|
{
|
|
4983
5432
|
key: "general",
|
|
@@ -4999,7 +5448,7 @@ function hn(e, t, n) {
|
|
|
4999
5448
|
key: "type",
|
|
5000
5449
|
label: "Widget type",
|
|
5001
5450
|
type: "select",
|
|
5002
|
-
options:
|
|
5451
|
+
options: Rn,
|
|
5003
5452
|
defaultValue: "metric"
|
|
5004
5453
|
}
|
|
5005
5454
|
]
|
|
@@ -5017,7 +5466,7 @@ function hn(e, t, n) {
|
|
|
5017
5466
|
key: "aggregate",
|
|
5018
5467
|
label: "Aggregation",
|
|
5019
5468
|
type: "select",
|
|
5020
|
-
options:
|
|
5469
|
+
options: Bn,
|
|
5021
5470
|
defaultValue: "count"
|
|
5022
5471
|
}
|
|
5023
5472
|
]
|
|
@@ -5040,14 +5489,14 @@ function hn(e, t, n) {
|
|
|
5040
5489
|
key: "rowSortBy",
|
|
5041
5490
|
label: "Sort by",
|
|
5042
5491
|
type: "icon-group",
|
|
5043
|
-
options:
|
|
5492
|
+
options: Un,
|
|
5044
5493
|
defaultValue: "group"
|
|
5045
5494
|
},
|
|
5046
5495
|
{
|
|
5047
5496
|
key: "rowSortOrder",
|
|
5048
5497
|
label: "Sort order",
|
|
5049
5498
|
type: "icon-group",
|
|
5050
|
-
options:
|
|
5499
|
+
options: Wn,
|
|
5051
5500
|
defaultValue: "asc"
|
|
5052
5501
|
},
|
|
5053
5502
|
{
|
|
@@ -5075,14 +5524,14 @@ function hn(e, t, n) {
|
|
|
5075
5524
|
key: "columnSortBy",
|
|
5076
5525
|
label: "Sort by",
|
|
5077
5526
|
type: "icon-group",
|
|
5078
|
-
options:
|
|
5527
|
+
options: Un,
|
|
5079
5528
|
defaultValue: "group"
|
|
5080
5529
|
},
|
|
5081
5530
|
{
|
|
5082
5531
|
key: "columnSortOrder",
|
|
5083
5532
|
label: "Sort order",
|
|
5084
5533
|
type: "icon-group",
|
|
5085
|
-
options:
|
|
5534
|
+
options: Wn,
|
|
5086
5535
|
defaultValue: "asc"
|
|
5087
5536
|
},
|
|
5088
5537
|
{
|
|
@@ -5110,7 +5559,7 @@ function hn(e, t, n) {
|
|
|
5110
5559
|
key: "aggregation",
|
|
5111
5560
|
label: "Aggregation",
|
|
5112
5561
|
type: "select",
|
|
5113
|
-
options:
|
|
5562
|
+
options: Bn,
|
|
5114
5563
|
defaultValue: "sum"
|
|
5115
5564
|
},
|
|
5116
5565
|
{
|
|
@@ -5125,7 +5574,7 @@ function hn(e, t, n) {
|
|
|
5125
5574
|
key: "chart-axis",
|
|
5126
5575
|
title: "Axis & Series",
|
|
5127
5576
|
collapsible: !0,
|
|
5128
|
-
visibleWhen: (e) =>
|
|
5577
|
+
visibleWhen: (e) => Hn(e.type),
|
|
5129
5578
|
fields: [
|
|
5130
5579
|
{
|
|
5131
5580
|
key: "xAxisLabel",
|
|
@@ -5195,7 +5644,7 @@ function hn(e, t, n) {
|
|
|
5195
5644
|
key: "colorVariant",
|
|
5196
5645
|
label: "Color variant",
|
|
5197
5646
|
type: "select",
|
|
5198
|
-
options:
|
|
5647
|
+
options: zn,
|
|
5199
5648
|
defaultValue: "default"
|
|
5200
5649
|
}, {
|
|
5201
5650
|
key: "actionUrl",
|
|
@@ -5207,7 +5656,7 @@ function hn(e, t, n) {
|
|
|
5207
5656
|
]
|
|
5208
5657
|
};
|
|
5209
5658
|
}
|
|
5210
|
-
function
|
|
5659
|
+
function qn(e) {
|
|
5211
5660
|
if (e == null) return "";
|
|
5212
5661
|
if (typeof e == "string") return e;
|
|
5213
5662
|
if (typeof e == "object") {
|
|
@@ -5216,16 +5665,16 @@ function gn(e) {
|
|
|
5216
5665
|
}
|
|
5217
5666
|
return String(e);
|
|
5218
5667
|
}
|
|
5219
|
-
function
|
|
5220
|
-
let { draft: c, isDirty: l, updateField: u, discard: d } =
|
|
5668
|
+
function Jn({ open: e, onClose: t, config: n, onSave: r, onFieldChange: i, headerExtra: a, availableObjects: o, availableFields: s }) {
|
|
5669
|
+
let { draft: c, isDirty: l, updateField: u, discard: d } = b(x.useMemo(() => ({
|
|
5221
5670
|
...n,
|
|
5222
|
-
title: typeof n.title == "object" ?
|
|
5223
|
-
description: typeof n.description == "object" ?
|
|
5671
|
+
title: typeof n.title == "object" ? qn(n.title) : n.title,
|
|
5672
|
+
description: typeof n.description == "object" ? qn(n.description) : n.description
|
|
5224
5673
|
}), [n]), { onUpdate: i });
|
|
5225
|
-
return /* @__PURE__ */ (0,
|
|
5674
|
+
return /* @__PURE__ */ (0, W.jsx)(h, {
|
|
5226
5675
|
open: e,
|
|
5227
5676
|
onClose: t,
|
|
5228
|
-
schema:
|
|
5677
|
+
schema: x.useMemo(() => Kn(o, s, c.type), [
|
|
5229
5678
|
o,
|
|
5230
5679
|
s,
|
|
5231
5680
|
c.type
|
|
@@ -5240,12 +5689,12 @@ function _n({ open: e, onClose: t, config: n, onSave: r, onFieldChange: i, heade
|
|
|
5240
5689
|
}
|
|
5241
5690
|
//#endregion
|
|
5242
5691
|
//#region src/DashboardWithConfig.tsx
|
|
5243
|
-
function
|
|
5244
|
-
let [
|
|
5245
|
-
|
|
5692
|
+
function Yn({ schema: e, config: t, onConfigSave: n, onWidgetSave: r, onRefresh: i, recordCount: a, defaultConfigOpen: o = !1, className: s }) {
|
|
5693
|
+
let [c, u] = A(o), [d, f] = A(null), [p, m] = A(e), [h, g] = A(0);
|
|
5694
|
+
D(() => {
|
|
5246
5695
|
m(e), g((e) => e + 1);
|
|
5247
5696
|
}, [e]);
|
|
5248
|
-
let
|
|
5697
|
+
let _ = x.useMemo(() => {
|
|
5249
5698
|
if (!d || !p.widgets) return null;
|
|
5250
5699
|
let e = p.widgets.find((e) => (e.id || e.title) === d);
|
|
5251
5700
|
return e ? {
|
|
@@ -5262,11 +5711,11 @@ function vn({ schema: e, config: t, onConfigSave: n, onWidgetSave: r, onRefresh:
|
|
|
5262
5711
|
layoutW: e.layout?.w ?? 1,
|
|
5263
5712
|
layoutH: e.layout?.h ?? 1
|
|
5264
5713
|
} : null;
|
|
5265
|
-
}, [d, h]),
|
|
5714
|
+
}, [d, h]), y = T((e) => {
|
|
5266
5715
|
f(e), u(!0);
|
|
5267
|
-
}, []),
|
|
5716
|
+
}, []), b = T(() => {
|
|
5268
5717
|
f(null);
|
|
5269
|
-
}, []),
|
|
5718
|
+
}, []), S = T((e, t) => {
|
|
5270
5719
|
d && m((n) => n.widgets ? {
|
|
5271
5720
|
...n,
|
|
5272
5721
|
widgets: n.widgets.map((n) => (n.id || n.title) === d ? e === "layoutW" ? {
|
|
@@ -5286,42 +5735,42 @@ function vn({ schema: e, config: t, onConfigSave: n, onWidgetSave: r, onRefresh:
|
|
|
5286
5735
|
[e]: t
|
|
5287
5736
|
} : n)
|
|
5288
5737
|
} : n);
|
|
5289
|
-
}, [d]),
|
|
5738
|
+
}, [d]), C = T((e) => {
|
|
5290
5739
|
d && r && r(d, e), f(null), g((e) => e + 1);
|
|
5291
|
-
}, [d, r]),
|
|
5740
|
+
}, [d, r]), w = T(() => {
|
|
5292
5741
|
u((e) => !e), f(null);
|
|
5293
5742
|
}, []);
|
|
5294
|
-
return /* @__PURE__ */ (0,
|
|
5295
|
-
className:
|
|
5743
|
+
return /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
5744
|
+
className: v("flex h-full w-full", s),
|
|
5296
5745
|
"data-testid": "dashboard-with-config",
|
|
5297
|
-
children: [/* @__PURE__ */ (0,
|
|
5746
|
+
children: [/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
5298
5747
|
className: "flex-1 min-w-0 overflow-auto relative",
|
|
5299
|
-
children: [/* @__PURE__ */ (0,
|
|
5748
|
+
children: [/* @__PURE__ */ (0, W.jsx)("div", {
|
|
5300
5749
|
className: "absolute top-2 right-2 z-10",
|
|
5301
|
-
children: /* @__PURE__ */ (0,
|
|
5750
|
+
children: /* @__PURE__ */ (0, W.jsxs)(l, {
|
|
5302
5751
|
size: "sm",
|
|
5303
|
-
variant:
|
|
5304
|
-
onClick:
|
|
5752
|
+
variant: c ? "default" : "outline",
|
|
5753
|
+
onClick: w,
|
|
5305
5754
|
"data-testid": "dashboard-config-toggle",
|
|
5306
|
-
children: [/* @__PURE__ */ (0,
|
|
5755
|
+
children: [/* @__PURE__ */ (0, W.jsx)(ee, { className: "h-3.5 w-3.5 mr-1" }), "Settings"]
|
|
5307
5756
|
})
|
|
5308
|
-
}), /* @__PURE__ */ (0,
|
|
5757
|
+
}), /* @__PURE__ */ (0, W.jsx)(oe, {
|
|
5309
5758
|
schema: p,
|
|
5310
5759
|
onRefresh: i,
|
|
5311
5760
|
recordCount: a,
|
|
5312
|
-
designMode:
|
|
5761
|
+
designMode: c,
|
|
5313
5762
|
selectedWidgetId: d,
|
|
5314
|
-
onWidgetClick:
|
|
5763
|
+
onWidgetClick: y
|
|
5315
5764
|
})]
|
|
5316
|
-
}),
|
|
5765
|
+
}), c && /* @__PURE__ */ (0, W.jsx)("div", {
|
|
5317
5766
|
className: "relative shrink-0",
|
|
5318
|
-
children: d &&
|
|
5767
|
+
children: d && _ ? /* @__PURE__ */ (0, W.jsx)(Jn, {
|
|
5319
5768
|
open: !0,
|
|
5320
|
-
onClose:
|
|
5321
|
-
config:
|
|
5322
|
-
onSave:
|
|
5323
|
-
onFieldChange:
|
|
5324
|
-
}) : /* @__PURE__ */ (0,
|
|
5769
|
+
onClose: b,
|
|
5770
|
+
config: _,
|
|
5771
|
+
onSave: C,
|
|
5772
|
+
onFieldChange: S
|
|
5773
|
+
}) : /* @__PURE__ */ (0, W.jsx)(Ln, {
|
|
5325
5774
|
open: !0,
|
|
5326
5775
|
onClose: () => u(!1),
|
|
5327
5776
|
config: t,
|
|
@@ -5330,7 +5779,7 @@ function vn({ schema: e, config: t, onConfigSave: n, onWidgetSave: r, onRefresh:
|
|
|
5330
5779
|
})]
|
|
5331
5780
|
});
|
|
5332
5781
|
}
|
|
5333
|
-
e.register("dashboard",
|
|
5782
|
+
e.register("dashboard", oe, {
|
|
5334
5783
|
namespace: "view",
|
|
5335
5784
|
label: "Dashboard",
|
|
5336
5785
|
category: "Complex",
|
|
@@ -5358,7 +5807,7 @@ e.register("dashboard", W, {
|
|
|
5358
5807
|
columns: 3,
|
|
5359
5808
|
widgets: []
|
|
5360
5809
|
}
|
|
5361
|
-
}), e.register("metric",
|
|
5810
|
+
}), e.register("metric", Xt, {
|
|
5362
5811
|
namespace: "plugin-dashboard",
|
|
5363
5812
|
label: "Metric Widget",
|
|
5364
5813
|
category: "Dashboard",
|
|
@@ -5371,7 +5820,7 @@ e.register("dashboard", W, {
|
|
|
5371
5820
|
type: "string",
|
|
5372
5821
|
label: "Value"
|
|
5373
5822
|
}]
|
|
5374
|
-
}), e.register("metric-card",
|
|
5823
|
+
}), e.register("metric-card", Qt, {
|
|
5375
5824
|
namespace: "plugin-dashboard",
|
|
5376
5825
|
label: "Metric Card",
|
|
5377
5826
|
category: "Dashboard",
|
|
@@ -5426,7 +5875,7 @@ e.register("dashboard", W, {
|
|
|
5426
5875
|
title: "Metric",
|
|
5427
5876
|
value: "0"
|
|
5428
5877
|
}
|
|
5429
|
-
}), e.register("object-metric",
|
|
5878
|
+
}), e.register("object-metric", $t, {
|
|
5430
5879
|
namespace: "plugin-dashboard",
|
|
5431
5880
|
label: "Object Metric",
|
|
5432
5881
|
category: "Dashboard",
|
|
@@ -5455,7 +5904,7 @@ e.register("dashboard", W, {
|
|
|
5455
5904
|
}
|
|
5456
5905
|
],
|
|
5457
5906
|
defaultProps: { label: "Metric" }
|
|
5458
|
-
}), e.register("pivot",
|
|
5907
|
+
}), e.register("pivot", nn, {
|
|
5459
5908
|
namespace: "plugin-dashboard",
|
|
5460
5909
|
label: "Pivot Table",
|
|
5461
5910
|
category: "Dashboard",
|
|
@@ -5534,7 +5983,7 @@ e.register("dashboard", W, {
|
|
|
5534
5983
|
aggregation: "sum",
|
|
5535
5984
|
data: []
|
|
5536
5985
|
}
|
|
5537
|
-
}), e.register("object-pivot",
|
|
5986
|
+
}), e.register("object-pivot", rn, {
|
|
5538
5987
|
namespace: "plugin-dashboard",
|
|
5539
5988
|
label: "Object Pivot Table",
|
|
5540
5989
|
category: "Dashboard",
|
|
@@ -5623,7 +6072,7 @@ e.register("dashboard", W, {
|
|
|
5623
6072
|
valueField: "",
|
|
5624
6073
|
aggregation: "sum"
|
|
5625
6074
|
}
|
|
5626
|
-
}), e.register("dashboard-grid",
|
|
6075
|
+
}), e.register("dashboard-grid", qt, {
|
|
5627
6076
|
namespace: "plugin-dashboard",
|
|
5628
6077
|
label: "Dashboard Grid (Editable)",
|
|
5629
6078
|
category: "Complex",
|
|
@@ -5651,7 +6100,7 @@ e.register("dashboard", W, {
|
|
|
5651
6100
|
widgets: [],
|
|
5652
6101
|
persistLayoutKey: "dashboard-layout"
|
|
5653
6102
|
}
|
|
5654
|
-
}), e.register("object-data-table",
|
|
6103
|
+
}), e.register("object-data-table", Fn, {
|
|
5655
6104
|
namespace: "plugin-dashboard",
|
|
5656
6105
|
label: "Object Data Table",
|
|
5657
6106
|
category: "Dashboard",
|
|
@@ -5689,18 +6138,18 @@ e.register("dashboard", W, {
|
|
|
5689
6138
|
pagination: !1
|
|
5690
6139
|
}
|
|
5691
6140
|
});
|
|
5692
|
-
var
|
|
5693
|
-
DashboardRenderer:
|
|
5694
|
-
DashboardGridLayout:
|
|
5695
|
-
MetricWidget:
|
|
5696
|
-
MetricCard:
|
|
5697
|
-
ObjectMetricWidget:
|
|
5698
|
-
PivotTable:
|
|
5699
|
-
ObjectPivotTable:
|
|
5700
|
-
ObjectDataTable:
|
|
5701
|
-
DashboardConfigPanel:
|
|
5702
|
-
WidgetConfigPanel:
|
|
5703
|
-
DashboardWithConfig:
|
|
6141
|
+
var Xn = {
|
|
6142
|
+
DashboardRenderer: oe,
|
|
6143
|
+
DashboardGridLayout: qt,
|
|
6144
|
+
MetricWidget: Xt,
|
|
6145
|
+
MetricCard: Qt,
|
|
6146
|
+
ObjectMetricWidget: $t,
|
|
6147
|
+
PivotTable: nn,
|
|
6148
|
+
ObjectPivotTable: rn,
|
|
6149
|
+
ObjectDataTable: Fn,
|
|
6150
|
+
DashboardConfigPanel: Ln,
|
|
6151
|
+
WidgetConfigPanel: Jn,
|
|
6152
|
+
DashboardWithConfig: Yn
|
|
5704
6153
|
};
|
|
5705
6154
|
//#endregion
|
|
5706
|
-
export {
|
|
6155
|
+
export { Ln as DashboardConfigPanel, qt as DashboardGridLayout, oe as DashboardRenderer, Yn as DashboardWithConfig, Qt as MetricCard, Xt as MetricWidget, Fn as ObjectDataTable, $t as ObjectMetricWidget, rn as ObjectPivotTable, nn as PivotTable, Jn as WidgetConfigPanel, Xn as dashboardComponents };
|