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