@object-ui/plugin-dashboard 3.3.0 → 3.3.2
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 +19 -0
- package/README.md +21 -1
- package/dist/index.js +876 -797
- package/dist/index.umd.cjs +4 -4
- package/dist/packages/plugin-dashboard/src/DashboardRenderer.d.ts +5 -0
- package/dist/packages/plugin-dashboard/src/DashboardRenderer.d.ts.map +1 -1
- package/dist/packages/plugin-dashboard/src/MetricCard.d.ts.map +1 -1
- package/dist/packages/plugin-dashboard/src/MetricWidget.d.ts +4 -1
- package/dist/packages/plugin-dashboard/src/MetricWidget.d.ts.map +1 -1
- package/dist/packages/plugin-dashboard/src/ObjectMetricWidget.d.ts +2 -0
- package/dist/packages/plugin-dashboard/src/ObjectMetricWidget.d.ts.map +1 -1
- package/dist/packages/plugin-dashboard/src/index.d.ts +1 -1
- package/package.json +40 -7
- package/.turbo/turbo-build.log +0 -41
- package/src/DashboardConfigPanel.stories.tsx +0 -164
- package/src/DashboardConfigPanel.tsx +0 -158
- package/src/DashboardGridLayout.tsx +0 -367
- package/src/DashboardRenderer.stories.tsx +0 -173
- package/src/DashboardRenderer.tsx +0 -479
- package/src/DashboardWithConfig.tsx +0 -211
- package/src/MetricCard.tsx +0 -102
- package/src/MetricWidget.tsx +0 -96
- package/src/ObjectDataTable.tsx +0 -226
- package/src/ObjectMetricWidget.tsx +0 -159
- package/src/ObjectPivotTable.tsx +0 -160
- package/src/PivotTable.tsx +0 -262
- package/src/WidgetConfigPanel.tsx +0 -540
- package/src/__tests__/DashboardConfigPanel.test.tsx +0 -206
- package/src/__tests__/DashboardGridLayout.test.tsx +0 -199
- package/src/__tests__/DashboardRenderer.autoRefresh.test.tsx +0 -124
- package/src/__tests__/DashboardRenderer.designMode.test.tsx +0 -386
- package/src/__tests__/DashboardRenderer.header.test.tsx +0 -114
- package/src/__tests__/DashboardRenderer.mobile.test.tsx +0 -214
- package/src/__tests__/DashboardRenderer.widgetData.test.tsx +0 -1411
- package/src/__tests__/DashboardWithConfig.test.tsx +0 -276
- package/src/__tests__/MetricCard.test.tsx +0 -107
- package/src/__tests__/ObjectDataTable.test.tsx +0 -211
- package/src/__tests__/ObjectMetricWidget.test.tsx +0 -196
- package/src/__tests__/ObjectPivotTable.test.tsx +0 -192
- package/src/__tests__/PivotTable.test.tsx +0 -162
- package/src/__tests__/WidgetConfigPanel.test.tsx +0 -492
- package/src/__tests__/ensureWidgetIds.test.tsx +0 -103
- package/src/index.tsx +0 -236
- package/src/utils.ts +0 -17
- package/tsconfig.json +0 -19
- package/vite.config.ts +0 -64
- package/vitest.config.ts +0 -9
- package/vitest.setup.tsx +0 -18
package/dist/index.js
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import { ComponentRegistry as e, extractRecords as t } from "@object-ui/core";
|
|
2
|
-
import { SchemaRenderer as n, SchemaRendererContext as r,
|
|
3
|
-
import { Button as
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { AlertCircle as O, ArrowDownIcon as k, ArrowUpIcon as A, Edit as j, GripVertical as M, Loader2 as N, MinusIcon as P, RefreshCw as F, Save as I, Settings as L, X as R } from "lucide-react";
|
|
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 c, Card as l, CardContent as u, CardHeader as d, CardTitle as f, Combobox as p, ConfigPanelRenderer as m, ConfigRow as h, Skeleton as g, cn as _, getLazyIcon as v, useConfigDraft as y } from "@object-ui/components";
|
|
4
|
+
import * as b from "react";
|
|
5
|
+
import x, { forwardRef as S, useCallback as C, useContext as w, useEffect as T, useMemo as E, useRef as D, useState as O } from "react";
|
|
6
|
+
import { AlertCircle as k, ArrowDownIcon as A, ArrowUpIcon as j, Edit as M, GripVertical as N, Loader2 as P, MinusIcon as F, RefreshCw as I, Save as L, Settings as R, X as z } from "lucide-react";
|
|
8
7
|
import ee from "clsx";
|
|
9
8
|
//#region \0rolldown/runtime.js
|
|
10
|
-
var
|
|
9
|
+
var B = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), V = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
11
10
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
12
11
|
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
13
12
|
});
|
|
14
13
|
//#endregion
|
|
15
14
|
//#region src/utils.ts
|
|
16
|
-
function
|
|
15
|
+
function H(e) {
|
|
17
16
|
return typeof e == "object" && !!e && !Array.isArray(e) && e.provider === "object";
|
|
18
17
|
}
|
|
19
18
|
//#endregion
|
|
20
19
|
//#region ../../node_modules/.pnpm/react@19.2.5/node_modules/react/cjs/react-jsx-runtime.production.js
|
|
21
|
-
var
|
|
20
|
+
var te = /* @__PURE__ */ B(((e) => {
|
|
22
21
|
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
23
22
|
function r(e, n, r) {
|
|
24
23
|
var i = null;
|
|
@@ -33,7 +32,7 @@ var H = /* @__PURE__ */ z(((e) => {
|
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
34
|
e.Fragment = n, e.jsx = r, e.jsxs = r;
|
|
36
|
-
})),
|
|
35
|
+
})), ne = /* @__PURE__ */ B(((e) => {
|
|
37
36
|
process.env.NODE_ENV !== "production" && (function() {
|
|
38
37
|
function t(e) {
|
|
39
38
|
if (e == null) return null;
|
|
@@ -176,7 +175,7 @@ var H = /* @__PURE__ */ z(((e) => {
|
|
|
176
175
|
function p(e) {
|
|
177
176
|
return typeof e == "object" && !!e && e.$$typeof === h;
|
|
178
177
|
}
|
|
179
|
-
var m =
|
|
178
|
+
var m = V("react"), h = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), x = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), O = Symbol.for("react.client.reference"), k = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, j = Array.isArray, M = console.createTask ? console.createTask : function() {
|
|
180
179
|
return null;
|
|
181
180
|
};
|
|
182
181
|
m = { react_stack_bottom_frame: function(e) {
|
|
@@ -191,66 +190,89 @@ var H = /* @__PURE__ */ z(((e) => {
|
|
|
191
190
|
return d(e, t, n, !0, r ? Error("react-stack-top-frame") : F, r ? M(i(e)) : I);
|
|
192
191
|
};
|
|
193
192
|
})();
|
|
194
|
-
})), U = (/* @__PURE__ */
|
|
195
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
193
|
+
})), U = (/* @__PURE__ */ B(((e, t) => {
|
|
194
|
+
process.env.NODE_ENV === "production" ? t.exports = te() : t.exports = ne();
|
|
196
195
|
})))();
|
|
197
|
-
function
|
|
196
|
+
function re(e) {
|
|
197
|
+
return e ? v(e) : null;
|
|
198
|
+
}
|
|
199
|
+
function ie(e) {
|
|
198
200
|
if (e != null) return typeof e == "string" ? e : e.defaultValue || e.key;
|
|
199
201
|
}
|
|
200
|
-
var
|
|
202
|
+
var ae = [
|
|
201
203
|
"hsl(var(--chart-1))",
|
|
202
204
|
"hsl(var(--chart-2))",
|
|
203
205
|
"hsl(var(--chart-3))",
|
|
204
206
|
"hsl(var(--chart-4))",
|
|
205
207
|
"hsl(var(--chart-5))"
|
|
206
|
-
],
|
|
207
|
-
let
|
|
208
|
-
|
|
209
|
-
let
|
|
208
|
+
], W = S(({ schema: e, className: t, dataSource: r, onRefresh: a, recordCount: o, userActions: s, designMode: p, selectedWidgetId: m, onWidgetClick: h, modalHandler: g, scriptHandlers: v, ...y }, b) => {
|
|
209
|
+
let x = (() => {
|
|
210
|
+
if (e.columns != null) return e.columns;
|
|
211
|
+
let t = e.widgets ?? [], n = 0;
|
|
212
|
+
for (let e of t) {
|
|
213
|
+
let t = (e.layout?.x ?? 0) + (e.layout?.w ?? 0);
|
|
214
|
+
t > n && (n = t), (e.layout?.w ?? 0) > n && (n = e.layout.w);
|
|
215
|
+
}
|
|
216
|
+
return n > 4 ? 12 : 4;
|
|
217
|
+
})(), S = x, w = e.gap || 4, [k, A] = O(!1), [j, M] = O(!1), N = D(null), { executeAction: P, engine: F } = i({ actions: E(() => (e.header?.actions ?? []).map((e) => ({
|
|
218
|
+
name: e.actionUrl || e.label,
|
|
219
|
+
type: e.actionType || "url",
|
|
220
|
+
target: e.actionUrl,
|
|
221
|
+
label: e.label
|
|
222
|
+
})), [e.header?.actions]) });
|
|
223
|
+
T(() => {
|
|
224
|
+
let e = F.getRunner();
|
|
225
|
+
if (g && e.setModalHandler(g), v) for (let [t, n] of Object.entries(v)) e.registerScript(t, n);
|
|
226
|
+
}, [
|
|
227
|
+
F,
|
|
228
|
+
g,
|
|
229
|
+
v
|
|
230
|
+
]), T(() => {
|
|
231
|
+
let e = () => M(window.innerWidth < 768);
|
|
210
232
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
211
233
|
}, []);
|
|
212
|
-
let
|
|
213
|
-
|
|
214
|
-
}, [
|
|
215
|
-
|
|
216
|
-
if (!(!e.refreshInterval || e.refreshInterval <= 0 || !
|
|
217
|
-
|
|
234
|
+
let L = C(() => {
|
|
235
|
+
a && (A(!0), a(), setTimeout(() => A(!1), 600));
|
|
236
|
+
}, [a]);
|
|
237
|
+
T(() => {
|
|
238
|
+
if (!(!e.refreshInterval || e.refreshInterval <= 0 || !a)) return N.current = setInterval(L, e.refreshInterval * 1e3), () => {
|
|
239
|
+
N.current && clearInterval(N.current);
|
|
218
240
|
};
|
|
219
241
|
}, [
|
|
220
242
|
e.refreshInterval,
|
|
221
|
-
|
|
222
|
-
|
|
243
|
+
a,
|
|
244
|
+
L
|
|
223
245
|
]);
|
|
224
|
-
let
|
|
225
|
-
!
|
|
226
|
-
}, [
|
|
227
|
-
if (!
|
|
246
|
+
let R = C((e, t) => {
|
|
247
|
+
!p || !h || !t || (e.stopPropagation(), h(t));
|
|
248
|
+
}, [p, h]), z = C((t, n, r) => {
|
|
249
|
+
if (!p || !h) return;
|
|
228
250
|
let i = e.widgets || [];
|
|
229
|
-
if (t.key === "Enter" || t.key === " ") t.preventDefault(),
|
|
251
|
+
if (t.key === "Enter" || t.key === " ") t.preventDefault(), h(n ?? null);
|
|
230
252
|
else if (t.key === "ArrowRight" || t.key === "ArrowDown") {
|
|
231
253
|
t.preventDefault();
|
|
232
254
|
let e = r + 1 < i.length ? i[r + 1] : null;
|
|
233
|
-
e?.id &&
|
|
255
|
+
e?.id && h(e.id);
|
|
234
256
|
} else if (t.key === "ArrowLeft" || t.key === "ArrowUp") {
|
|
235
257
|
t.preventDefault();
|
|
236
258
|
let e = r - 1 >= 0 ? i[r - 1] : null;
|
|
237
|
-
e?.id &&
|
|
238
|
-
} else t.key === "Escape" && (t.preventDefault(),
|
|
259
|
+
e?.id && h(e.id);
|
|
260
|
+
} else t.key === "Escape" && (t.preventDefault(), h(null));
|
|
239
261
|
}, [
|
|
240
|
-
|
|
241
|
-
|
|
262
|
+
p,
|
|
263
|
+
h,
|
|
242
264
|
e.widgets
|
|
243
|
-
]),
|
|
244
|
-
!
|
|
245
|
-
}, [
|
|
246
|
-
let
|
|
265
|
+
]), ee = C((e) => {
|
|
266
|
+
!p || !h || e.target === e.currentTarget && h(null);
|
|
267
|
+
}, [p, h]), B = (e, t, i) => {
|
|
268
|
+
let a = e.layout ? {
|
|
247
269
|
...e.layout,
|
|
248
|
-
w: Math.min(e.layout.w,
|
|
249
|
-
} : void 0,
|
|
270
|
+
w: Math.min(e.layout.w, S)
|
|
271
|
+
} : void 0, o = (() => {
|
|
250
272
|
if (e.component) return e.component;
|
|
251
273
|
let t = e.type, n = e.options || {};
|
|
252
274
|
if (t === "metric" && e.object) {
|
|
253
|
-
let t = n.data, r =
|
|
275
|
+
let t = n.data, r = H(t) && t.aggregate ? {
|
|
254
276
|
field: e.valueField || t.aggregate.field,
|
|
255
277
|
function: e.aggregate || t.aggregate.function,
|
|
256
278
|
groupBy: e.categoryField ?? t.aggregate.groupBy ?? "_all"
|
|
@@ -261,65 +283,87 @@ var ne = [
|
|
|
261
283
|
} : void 0;
|
|
262
284
|
return {
|
|
263
285
|
type: "object-metric",
|
|
264
|
-
objectName: e.object || (
|
|
286
|
+
objectName: e.object || (H(t) ? t.object : void 0),
|
|
265
287
|
aggregate: r,
|
|
266
|
-
filter: (
|
|
267
|
-
label: n.label ||
|
|
288
|
+
filter: (H(t) ? t.filter : void 0) || e.filter,
|
|
289
|
+
label: n.label || ie(e.title) || "",
|
|
268
290
|
fallbackValue: n.value,
|
|
269
291
|
trend: n.trend,
|
|
270
292
|
icon: n.icon,
|
|
293
|
+
description: n.description,
|
|
294
|
+
colorVariant: e.colorVariant
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
if ((t === "gauge" || t === "solid-gauge") && e.object) {
|
|
298
|
+
let t = e.aggregate ? {
|
|
299
|
+
field: e.valueField || "value",
|
|
300
|
+
function: e.aggregate,
|
|
301
|
+
groupBy: e.categoryField || "_all"
|
|
302
|
+
} : void 0;
|
|
303
|
+
return {
|
|
304
|
+
type: "object-metric",
|
|
305
|
+
objectName: e.object,
|
|
306
|
+
aggregate: t,
|
|
307
|
+
filter: e.filter,
|
|
308
|
+
label: n.label || ie(e.title) || "",
|
|
309
|
+
fallbackValue: n.fallbackValue ?? n.value,
|
|
310
|
+
icon: n.icon,
|
|
271
311
|
description: n.description
|
|
272
312
|
};
|
|
273
313
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
314
|
+
let r = {
|
|
315
|
+
funnel: "bar",
|
|
316
|
+
"horizontal-bar": "bar"
|
|
317
|
+
}[t] || t;
|
|
318
|
+
if (r === "bar" || r === "line" || r === "area" || r === "pie" || r === "donut" || r === "scatter") {
|
|
319
|
+
let t = e.data || n.data, i = e.categoryField || n.xField || "name", a = e.valueField || n.yField || "value";
|
|
320
|
+
if (H(t)) {
|
|
321
|
+
let n = t.aggregate, o = n ? {
|
|
278
322
|
field: e.valueField || n.field,
|
|
279
323
|
function: e.aggregate || n.function,
|
|
280
324
|
groupBy: e.categoryField || n.groupBy
|
|
281
325
|
} : void 0, s = o?.field || a;
|
|
282
326
|
return {
|
|
283
327
|
type: "object-chart",
|
|
284
|
-
chartType:
|
|
285
|
-
objectName: e.object ||
|
|
328
|
+
chartType: r,
|
|
329
|
+
objectName: e.object || t.object,
|
|
286
330
|
aggregate: o,
|
|
287
331
|
xAxisKey: i,
|
|
288
332
|
series: [{ dataKey: s }],
|
|
289
|
-
colors:
|
|
333
|
+
colors: ae,
|
|
290
334
|
className: "h-[200px] sm:h-[250px] md:h-[300px]"
|
|
291
335
|
};
|
|
292
336
|
}
|
|
293
|
-
if (!
|
|
294
|
-
let
|
|
337
|
+
if (!t && e.object) {
|
|
338
|
+
let t = e.aggregate ? {
|
|
295
339
|
field: e.valueField || "value",
|
|
296
340
|
function: e.aggregate,
|
|
297
341
|
groupBy: e.categoryField || "name"
|
|
298
342
|
} : void 0;
|
|
299
343
|
return {
|
|
300
344
|
type: "object-chart",
|
|
301
|
-
chartType:
|
|
345
|
+
chartType: r,
|
|
302
346
|
objectName: e.object,
|
|
303
|
-
aggregate:
|
|
347
|
+
aggregate: t,
|
|
304
348
|
xAxisKey: i,
|
|
305
349
|
series: [{ dataKey: e.valueField || "value" }],
|
|
306
|
-
colors:
|
|
350
|
+
colors: ae,
|
|
307
351
|
className: "h-[200px] sm:h-[250px] md:h-[300px]"
|
|
308
352
|
};
|
|
309
353
|
}
|
|
310
354
|
return {
|
|
311
355
|
type: "chart",
|
|
312
|
-
chartType:
|
|
313
|
-
data: Array.isArray(
|
|
356
|
+
chartType: r,
|
|
357
|
+
data: Array.isArray(t) ? t : t?.items || [],
|
|
314
358
|
xAxisKey: i,
|
|
315
359
|
series: [{ dataKey: a }],
|
|
316
|
-
colors:
|
|
360
|
+
colors: ae,
|
|
317
361
|
className: "h-[200px] sm:h-[250px] md:h-[300px]"
|
|
318
362
|
};
|
|
319
363
|
}
|
|
320
364
|
if (t === "table") {
|
|
321
365
|
let t = e.data || n.data;
|
|
322
|
-
if (
|
|
366
|
+
if (H(t)) {
|
|
323
367
|
let { data: r, ...i } = n;
|
|
324
368
|
return {
|
|
325
369
|
type: "object-data-table",
|
|
@@ -351,7 +395,7 @@ var ne = [
|
|
|
351
395
|
}
|
|
352
396
|
if (t === "pivot") {
|
|
353
397
|
let t = e.data || n.data;
|
|
354
|
-
if (
|
|
398
|
+
if (H(t)) {
|
|
355
399
|
let { data: r, ...i } = n;
|
|
356
400
|
return {
|
|
357
401
|
type: "object-pivot",
|
|
@@ -376,151 +420,176 @@ var ne = [
|
|
|
376
420
|
...e,
|
|
377
421
|
...n
|
|
378
422
|
};
|
|
379
|
-
})(),
|
|
423
|
+
})(), s = e.type === "metric", c = ie(e.title), h = ie(e.description), g = e.id || c || `widget-${t}`, v = p && m === e.id, y = p ? {
|
|
380
424
|
"data-testid": `dashboard-preview-widget-${e.id}`,
|
|
381
425
|
"data-widget-id": e.id,
|
|
382
426
|
role: "button",
|
|
383
427
|
tabIndex: 0,
|
|
384
|
-
"aria-selected":
|
|
385
|
-
"aria-label": `Widget: ${
|
|
386
|
-
onClick: (t) =>
|
|
387
|
-
onKeyDown: (n) =>
|
|
388
|
-
} : {}, b =
|
|
389
|
-
return
|
|
390
|
-
className:
|
|
391
|
-
style: !
|
|
392
|
-
gridColumn: `span ${
|
|
393
|
-
gridRow: `span ${
|
|
428
|
+
"aria-selected": v,
|
|
429
|
+
"aria-label": `Widget: ${c || `Widget ${t + 1}`}`,
|
|
430
|
+
onClick: (t) => R(t, e.id),
|
|
431
|
+
onKeyDown: (n) => z(n, e.id, t)
|
|
432
|
+
} : {}, b = p ? _("cursor-pointer rounded-lg transition-all outline-none", "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", v ? "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;
|
|
433
|
+
return s ? /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
434
|
+
className: _("h-full w-full", p && "relative", b),
|
|
435
|
+
style: !j && a ? {
|
|
436
|
+
gridColumn: `span ${a.w}`,
|
|
437
|
+
gridRow: `span ${a.h}`
|
|
394
438
|
} : void 0,
|
|
395
439
|
...y,
|
|
396
440
|
children: [/* @__PURE__ */ (0, U.jsx)(n, {
|
|
397
|
-
schema:
|
|
398
|
-
className:
|
|
399
|
-
|
|
441
|
+
schema: o,
|
|
442
|
+
className: _("h-full w-full", p && "pointer-events-none"),
|
|
443
|
+
dataSource: r
|
|
444
|
+
}), p && /* @__PURE__ */ (0, U.jsx)("div", {
|
|
400
445
|
className: "absolute inset-0 z-10",
|
|
401
446
|
"aria-hidden": "true",
|
|
402
447
|
"data-testid": "widget-click-overlay"
|
|
403
448
|
})]
|
|
404
|
-
},
|
|
405
|
-
className:
|
|
406
|
-
style: !
|
|
407
|
-
gridColumn: `span ${
|
|
408
|
-
gridRow: `span ${
|
|
449
|
+
}, g) : /* @__PURE__ */ (0, U.jsxs)(l, {
|
|
450
|
+
className: _("overflow-hidden border-border/50 shadow-sm transition-all hover:shadow-md", "bg-card/50 backdrop-blur-sm", i && "w-full", p && "relative", b),
|
|
451
|
+
style: !j && a ? {
|
|
452
|
+
gridColumn: `span ${a.w}`,
|
|
453
|
+
gridRow: `span ${a.h}`
|
|
409
454
|
} : void 0,
|
|
410
455
|
...y,
|
|
411
456
|
children: [
|
|
412
|
-
|
|
457
|
+
c && /* @__PURE__ */ (0, U.jsxs)(d, {
|
|
413
458
|
className: "pb-2 border-b border-border/40 bg-muted/20 px-3 sm:px-6",
|
|
414
|
-
children: [/* @__PURE__ */ (0, U.jsx)(
|
|
459
|
+
children: [/* @__PURE__ */ (0, U.jsx)(f, {
|
|
415
460
|
className: "text-sm sm:text-base font-medium tracking-tight truncate",
|
|
416
|
-
title:
|
|
417
|
-
children:
|
|
418
|
-
}),
|
|
461
|
+
title: c,
|
|
462
|
+
children: c
|
|
463
|
+
}), h && /* @__PURE__ */ (0, U.jsx)("p", {
|
|
419
464
|
className: "text-xs text-muted-foreground mt-0.5 line-clamp-2",
|
|
420
|
-
children:
|
|
465
|
+
children: h
|
|
421
466
|
})]
|
|
422
467
|
}),
|
|
423
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
468
|
+
/* @__PURE__ */ (0, U.jsx)(u, {
|
|
424
469
|
className: "p-0",
|
|
425
470
|
children: /* @__PURE__ */ (0, U.jsx)("div", {
|
|
426
|
-
className:
|
|
427
|
-
children: /* @__PURE__ */ (0, U.jsx)(n, {
|
|
471
|
+
className: _("h-full w-full", "p-3 sm:p-4 md:p-6", p && "pointer-events-none"),
|
|
472
|
+
children: /* @__PURE__ */ (0, U.jsx)(n, {
|
|
473
|
+
schema: o,
|
|
474
|
+
dataSource: r
|
|
475
|
+
})
|
|
428
476
|
})
|
|
429
477
|
}),
|
|
430
|
-
|
|
478
|
+
p && /* @__PURE__ */ (0, U.jsx)("div", {
|
|
431
479
|
className: "absolute inset-0 z-10",
|
|
432
480
|
"aria-hidden": "true",
|
|
433
481
|
"data-testid": "widget-click-overlay"
|
|
434
482
|
})
|
|
435
483
|
]
|
|
436
|
-
},
|
|
437
|
-
},
|
|
484
|
+
}, g);
|
|
485
|
+
}, V = e.header && /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
438
486
|
className: "col-span-full mb-4",
|
|
439
487
|
children: [
|
|
440
488
|
e.header.showTitle !== !1 && e.title && /* @__PURE__ */ (0, U.jsx)("h2", {
|
|
441
489
|
className: "text-lg font-semibold tracking-tight",
|
|
442
|
-
children:
|
|
490
|
+
children: ie(e.title)
|
|
443
491
|
}),
|
|
444
492
|
e.header.showDescription !== !1 && e.description && /* @__PURE__ */ (0, U.jsx)("p", {
|
|
445
493
|
className: "text-sm text-muted-foreground mt-1",
|
|
446
|
-
children:
|
|
494
|
+
children: ie(e.description)
|
|
447
495
|
}),
|
|
448
496
|
e.header.actions && e.header.actions.length > 0 && /* @__PURE__ */ (0, U.jsx)("div", {
|
|
449
497
|
className: "flex gap-2 mt-3",
|
|
450
|
-
children: e.header.actions.map((e, t) =>
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
498
|
+
children: e.header.actions.map((e, t) => {
|
|
499
|
+
let n = re(e.icon);
|
|
500
|
+
return /* @__PURE__ */ (0, U.jsxs)(c, {
|
|
501
|
+
variant: "outline",
|
|
502
|
+
size: "sm",
|
|
503
|
+
onClick: async () => {
|
|
504
|
+
let { actionType: t, actionUrl: n, label: r } = e;
|
|
505
|
+
if (!t || !n) {
|
|
506
|
+
console.warn("[DashboardRenderer] Header action missing actionType/actionUrl:", e);
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
if (t === "url") {
|
|
510
|
+
/^https?:\/\//.test(n) || n.startsWith("//") ? window.location.assign(n) : (window.history.pushState({}, "", n), window.dispatchEvent(new PopStateEvent("popstate")));
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
if (t === "modal" || t === "script") {
|
|
514
|
+
let e = await P(n || r);
|
|
515
|
+
e?.success || console.warn("[DashboardRenderer] action failed", e?.error);
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
console.warn(`[DashboardRenderer] Unknown header actionType="${t}" for "${r}"`);
|
|
519
|
+
},
|
|
520
|
+
children: [n && /* @__PURE__ */ (0, U.jsx)(n, { className: "w-4 h-4 mr-1.5" }), e.label]
|
|
521
|
+
}, t);
|
|
522
|
+
})
|
|
455
523
|
})
|
|
456
524
|
]
|
|
457
|
-
}),
|
|
525
|
+
}), te = o !== void 0 && /* @__PURE__ */ (0, U.jsxs)("span", {
|
|
458
526
|
className: "text-xs text-muted-foreground",
|
|
459
|
-
children: [
|
|
460
|
-
}),
|
|
461
|
-
className:
|
|
462
|
-
children: [
|
|
527
|
+
children: [o.toLocaleString(), " records"]
|
|
528
|
+
}), ne = s ? JSON.stringify(s) : void 0, W = a && /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
529
|
+
className: _("flex items-center justify-end gap-3 mb-2", !j && "col-span-full"),
|
|
530
|
+
children: [te, /* @__PURE__ */ (0, U.jsxs)(c, {
|
|
463
531
|
variant: "outline",
|
|
464
532
|
size: "sm",
|
|
465
|
-
onClick:
|
|
466
|
-
disabled:
|
|
533
|
+
onClick: L,
|
|
534
|
+
disabled: k,
|
|
467
535
|
"aria-label": "Refresh dashboard",
|
|
468
|
-
children: [/* @__PURE__ */ (0, U.jsx)(
|
|
536
|
+
children: [/* @__PURE__ */ (0, U.jsx)(I, { className: _("h-4 w-4 mr-2", k && "animate-spin") }), k ? "Refreshing…" : "Refresh All"]
|
|
469
537
|
})]
|
|
470
538
|
});
|
|
471
|
-
if (
|
|
539
|
+
if (j) {
|
|
472
540
|
let n = e.widgets?.filter((e) => e.type === "metric") || [], r = e.widgets?.filter((e) => e.type !== "metric") || [];
|
|
473
541
|
return /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
474
|
-
ref:
|
|
475
|
-
className:
|
|
476
|
-
"data-user-actions":
|
|
477
|
-
onClick:
|
|
478
|
-
...
|
|
542
|
+
ref: b,
|
|
543
|
+
className: _("flex flex-col gap-4 px-4", t),
|
|
544
|
+
"data-user-actions": ne,
|
|
545
|
+
onClick: ee,
|
|
546
|
+
...y,
|
|
479
547
|
children: [
|
|
480
|
-
|
|
481
|
-
|
|
548
|
+
V,
|
|
549
|
+
W,
|
|
482
550
|
n.length > 0 && /* @__PURE__ */ (0, U.jsx)("div", {
|
|
483
551
|
className: "grid grid-cols-2 gap-3",
|
|
484
|
-
onClick:
|
|
485
|
-
children: n.map((e, t) =>
|
|
552
|
+
onClick: ee,
|
|
553
|
+
children: n.map((e, t) => B(e, t))
|
|
486
554
|
}),
|
|
487
555
|
r.length > 0 && /* @__PURE__ */ (0, U.jsx)("div", {
|
|
488
556
|
className: "flex flex-col gap-4",
|
|
489
|
-
onClick:
|
|
490
|
-
children: r.map((e, t) =>
|
|
557
|
+
onClick: ee,
|
|
558
|
+
children: r.map((e, t) => B(e, t, !0))
|
|
491
559
|
})
|
|
492
560
|
]
|
|
493
561
|
});
|
|
494
562
|
}
|
|
563
|
+
let oe = e.columns != null || x !== 4;
|
|
495
564
|
return /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
496
|
-
ref:
|
|
497
|
-
className:
|
|
565
|
+
ref: b,
|
|
566
|
+
className: _("grid auto-rows-min", !oe && "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4", t),
|
|
498
567
|
style: {
|
|
499
|
-
...
|
|
500
|
-
gap: `${
|
|
568
|
+
...oe && { gridTemplateColumns: `repeat(${S}, minmax(0, 1fr))` },
|
|
569
|
+
gap: `${w * .25}rem`
|
|
501
570
|
},
|
|
502
|
-
"data-user-actions":
|
|
503
|
-
onClick:
|
|
504
|
-
...
|
|
571
|
+
"data-user-actions": ne,
|
|
572
|
+
onClick: ee,
|
|
573
|
+
...y,
|
|
505
574
|
children: [
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
e.widgets?.map((e, t) =>
|
|
575
|
+
V,
|
|
576
|
+
W,
|
|
577
|
+
e.widgets?.map((e, t) => B(e, t))
|
|
509
578
|
]
|
|
510
579
|
});
|
|
511
580
|
});
|
|
512
581
|
//#endregion
|
|
513
582
|
//#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
|
|
514
|
-
function
|
|
583
|
+
function oe(e) {
|
|
515
584
|
let { margin: t, containerPadding: n, containerWidth: r, cols: i } = e;
|
|
516
585
|
return (r - t[0] * (i - 1) - n[0] * 2) / i;
|
|
517
586
|
}
|
|
518
|
-
function
|
|
587
|
+
function se(e, t, n) {
|
|
519
588
|
return Number.isFinite(e) ? Math.round(t * e + Math.max(0, e - 1) * n) : e;
|
|
520
589
|
}
|
|
521
|
-
function
|
|
522
|
-
let { margin: s, containerPadding: c, rowHeight: l } = e, u =
|
|
523
|
-
if (o ? (d = Math.round(o.width), f = Math.round(o.height)) : (d =
|
|
590
|
+
function ce(e, t, n, r, i, a, o) {
|
|
591
|
+
let { margin: s, containerPadding: c, rowHeight: l } = e, u = oe(e), d, f, p, m;
|
|
592
|
+
if (o ? (d = Math.round(o.width), f = Math.round(o.height)) : (d = se(r, u, s[0]), f = se(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) {
|
|
524
593
|
if (Number.isFinite(r)) {
|
|
525
594
|
let e = Math.round((u + s[0]) * (t + r) + c[0]) - m - d;
|
|
526
595
|
e !== s[0] && (d += e - s[0]);
|
|
@@ -537,52 +606,52 @@ function oe(e, t, n, r, i, a, o) {
|
|
|
537
606
|
height: f
|
|
538
607
|
};
|
|
539
608
|
}
|
|
540
|
-
function
|
|
541
|
-
let { margin: a, containerPadding: o, cols: s, rowHeight: c, maxRows: l } = e, u =
|
|
542
|
-
return d =
|
|
609
|
+
function le(e, t, n, r, i) {
|
|
610
|
+
let { margin: a, containerPadding: o, cols: s, rowHeight: c, maxRows: l } = e, u = oe(e), d = Math.round((n - o[0]) / (u + a[0])), f = Math.round((t - o[1]) / (c + a[1]));
|
|
611
|
+
return d = de(d, 0, s - r), f = de(f, 0, l - i), {
|
|
543
612
|
x: d,
|
|
544
613
|
y: f
|
|
545
614
|
};
|
|
546
615
|
}
|
|
547
|
-
function
|
|
548
|
-
let { margin: r, containerPadding: i, rowHeight: a } = e, o =
|
|
616
|
+
function ue(e, t, n) {
|
|
617
|
+
let { margin: r, containerPadding: i, rowHeight: a } = e, o = oe(e);
|
|
549
618
|
return {
|
|
550
619
|
x: Math.round((n - i[0]) / (o + r[0])),
|
|
551
620
|
y: Math.round((t - i[1]) / (a + r[1]))
|
|
552
621
|
};
|
|
553
622
|
}
|
|
554
|
-
function
|
|
555
|
-
let { margin: r, rowHeight: i } = e, a =
|
|
623
|
+
function G(e, t, n) {
|
|
624
|
+
let { margin: r, rowHeight: i } = e, a = oe(e);
|
|
556
625
|
return {
|
|
557
626
|
w: Math.max(1, Math.round((t + r[0]) / (a + r[0]))),
|
|
558
627
|
h: Math.max(1, Math.round((n + r[1]) / (i + r[1])))
|
|
559
628
|
};
|
|
560
629
|
}
|
|
561
|
-
function
|
|
630
|
+
function de(e, t, n) {
|
|
562
631
|
return Math.max(Math.min(e, n), t);
|
|
563
632
|
}
|
|
564
|
-
function
|
|
633
|
+
function fe(e, t) {
|
|
565
634
|
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);
|
|
566
635
|
}
|
|
567
636
|
function K(e, t) {
|
|
568
637
|
for (let n = 0; n < e.length; n++) {
|
|
569
638
|
let r = e[n];
|
|
570
|
-
if (r !== void 0 &&
|
|
639
|
+
if (r !== void 0 && fe(r, t)) return r;
|
|
571
640
|
}
|
|
572
641
|
}
|
|
573
|
-
function
|
|
574
|
-
return e.filter((e) =>
|
|
642
|
+
function pe(e, t) {
|
|
643
|
+
return e.filter((e) => fe(e, t));
|
|
575
644
|
}
|
|
576
|
-
function
|
|
577
|
-
return t === "horizontal" ?
|
|
645
|
+
function q(e, t) {
|
|
646
|
+
return t === "horizontal" ? he(e) : t === "vertical" || t === "wrap" ? me(e) : [...e];
|
|
578
647
|
}
|
|
579
|
-
function
|
|
648
|
+
function me(e) {
|
|
580
649
|
return [...e].sort((e, t) => e.y === t.y ? e.x - t.x : e.y - t.y);
|
|
581
650
|
}
|
|
582
|
-
function
|
|
651
|
+
function he(e) {
|
|
583
652
|
return [...e].sort((e, t) => e.x === t.x ? e.y - t.y : e.x - t.x);
|
|
584
653
|
}
|
|
585
|
-
function
|
|
654
|
+
function ge(e) {
|
|
586
655
|
let t = 0;
|
|
587
656
|
for (let n = 0; n < e.length; n++) {
|
|
588
657
|
let r = e[n];
|
|
@@ -593,16 +662,16 @@ function me(e) {
|
|
|
593
662
|
}
|
|
594
663
|
return t;
|
|
595
664
|
}
|
|
596
|
-
function
|
|
665
|
+
function _e(e, t) {
|
|
597
666
|
for (let n = 0; n < e.length; n++) {
|
|
598
667
|
let r = e[n];
|
|
599
668
|
if (r !== void 0 && r.i === t) return r;
|
|
600
669
|
}
|
|
601
670
|
}
|
|
602
|
-
function
|
|
671
|
+
function ve(e) {
|
|
603
672
|
return e.filter((e) => e.static === !0);
|
|
604
673
|
}
|
|
605
|
-
function
|
|
674
|
+
function ye(e) {
|
|
606
675
|
return {
|
|
607
676
|
i: e.i,
|
|
608
677
|
x: e.x,
|
|
@@ -626,11 +695,11 @@ function J(e) {
|
|
|
626
695
|
let t = Array(e.length);
|
|
627
696
|
for (let n = 0; n < e.length; n++) {
|
|
628
697
|
let r = e[n];
|
|
629
|
-
r !== void 0 && (t[n] =
|
|
698
|
+
r !== void 0 && (t[n] = ye(r));
|
|
630
699
|
}
|
|
631
700
|
return t;
|
|
632
701
|
}
|
|
633
|
-
function
|
|
702
|
+
function be(e, t) {
|
|
634
703
|
let n = Array(e.length);
|
|
635
704
|
for (let r = 0; r < e.length; r++) {
|
|
636
705
|
let i = e[r];
|
|
@@ -638,12 +707,12 @@ function Y(e, t) {
|
|
|
638
707
|
}
|
|
639
708
|
return n;
|
|
640
709
|
}
|
|
641
|
-
function
|
|
642
|
-
let r =
|
|
643
|
-
return r ? (r = n(
|
|
710
|
+
function Y(e, t, n) {
|
|
711
|
+
let r = _e(e, t);
|
|
712
|
+
return r ? (r = n(ye(r)), [be(e, r), r]) : [[...e], null];
|
|
644
713
|
}
|
|
645
|
-
function
|
|
646
|
-
let n =
|
|
714
|
+
function X(e, t) {
|
|
715
|
+
let n = ve(e);
|
|
647
716
|
for (let r = 0; r < e.length; r++) {
|
|
648
717
|
let i = e[r];
|
|
649
718
|
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);
|
|
@@ -651,23 +720,23 @@ function ye(e, t) {
|
|
|
651
720
|
}
|
|
652
721
|
return e;
|
|
653
722
|
}
|
|
654
|
-
function
|
|
723
|
+
function Z(e, t, n, r, i, a, o, s, c) {
|
|
655
724
|
if (t.static && t.isDraggable !== !0 || t.y === r && t.x === n) return [...e];
|
|
656
725
|
let l = t.x, u = t.y;
|
|
657
726
|
typeof n == "number" && (t.x = n), typeof r == "number" && (t.y = r), t.moved = !0;
|
|
658
|
-
let d =
|
|
727
|
+
let d = q(e, o);
|
|
659
728
|
(o === "vertical" && typeof r == "number" ? u >= r : o === "horizontal" && typeof n == "number" && l >= n) && (d = d.reverse());
|
|
660
|
-
let f =
|
|
729
|
+
let f = pe(d, t), p = f.length > 0;
|
|
661
730
|
if (p && c) return J(e);
|
|
662
731
|
if (p && a) return t.x = l, t.y = u, t.moved = !1, e;
|
|
663
732
|
let m = [...e];
|
|
664
733
|
for (let e = 0; e < f.length; e++) {
|
|
665
734
|
let n = f[e];
|
|
666
|
-
n !== void 0 && (n.moved || (m = n.static ?
|
|
735
|
+
n !== void 0 && (n.moved || (m = n.static ? Q(m, n, t, i, o) : Q(m, t, n, i, o)));
|
|
667
736
|
}
|
|
668
737
|
return m;
|
|
669
738
|
}
|
|
670
|
-
function
|
|
739
|
+
function Q(e, t, n, r, i, a) {
|
|
671
740
|
let o = i === "horizontal", s = i === "vertical", c = t.static;
|
|
672
741
|
if (r) {
|
|
673
742
|
r = !1;
|
|
@@ -678,40 +747,40 @@ function be(e, t, n, r, i, a) {
|
|
|
678
747
|
h: n.h,
|
|
679
748
|
i: "-1"
|
|
680
749
|
}, l = K(e, a), u = l !== void 0 && l.y + l.h > t.y, d = l !== void 0 && t.x + t.w > l.x;
|
|
681
|
-
if (!l) return
|
|
682
|
-
if (u && s) return
|
|
750
|
+
if (!l) return Z(e, n, o ? a.x : void 0, s ? a.y : void 0, r, c, i);
|
|
751
|
+
if (u && s) return Z(e, n, void 0, n.y + 1, r, c, i);
|
|
683
752
|
if (u && i === null) return t.y = n.y, n.y += n.h, [...e];
|
|
684
|
-
if (d && o) return
|
|
753
|
+
if (d && o) return Z(e, t, n.x, void 0, r, c, i);
|
|
685
754
|
}
|
|
686
755
|
let l = o ? n.x + 1 : void 0, u = s ? n.y + 1 : void 0;
|
|
687
|
-
return l === void 0 && u === void 0 ? [...e] :
|
|
756
|
+
return l === void 0 && u === void 0 ? [...e] : Z(e, n, l, u, r, c, i);
|
|
688
757
|
}
|
|
689
758
|
//#endregion
|
|
690
759
|
//#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
|
|
691
|
-
function
|
|
760
|
+
function $(e, t, n) {
|
|
692
761
|
return Math.max(t, Math.min(n, e));
|
|
693
762
|
}
|
|
694
763
|
var xe = [{
|
|
695
764
|
name: "gridBounds",
|
|
696
765
|
constrainPosition(e, t, n, { cols: r, maxRows: i }) {
|
|
697
766
|
return {
|
|
698
|
-
x:
|
|
699
|
-
y:
|
|
767
|
+
x: $(t, 0, Math.max(0, r - e.w)),
|
|
768
|
+
y: $(n, 0, Math.max(0, i - e.h))
|
|
700
769
|
};
|
|
701
770
|
},
|
|
702
771
|
constrainSize(e, t, n, r, { cols: i, maxRows: a }) {
|
|
703
772
|
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;
|
|
704
773
|
return {
|
|
705
|
-
w:
|
|
706
|
-
h:
|
|
774
|
+
w: $(t, 1, Math.max(1, o)),
|
|
775
|
+
h: $(n, 1, Math.max(1, s))
|
|
707
776
|
};
|
|
708
777
|
}
|
|
709
778
|
}, {
|
|
710
779
|
name: "minMaxSize",
|
|
711
780
|
constrainSize(e, t, n) {
|
|
712
781
|
return {
|
|
713
|
-
w:
|
|
714
|
-
h:
|
|
782
|
+
w: $(t, e.minW ?? 1, e.maxW ?? Infinity),
|
|
783
|
+
h: $(n, e.minH ?? 1, e.maxH ?? Infinity)
|
|
715
784
|
};
|
|
716
785
|
}
|
|
717
786
|
}];
|
|
@@ -724,7 +793,7 @@ function Se(e, t, n, r, i) {
|
|
|
724
793
|
if (t.constraints) for (let e of t.constraints) e.constrainPosition && (a = e.constrainPosition(t, a.x, a.y, i));
|
|
725
794
|
return a;
|
|
726
795
|
}
|
|
727
|
-
function
|
|
796
|
+
function Ce(e, t, n, r, i, a) {
|
|
728
797
|
let o = {
|
|
729
798
|
w: n,
|
|
730
799
|
h: r
|
|
@@ -733,7 +802,7 @@ function Q(e, t, n, r, i, a) {
|
|
|
733
802
|
if (t.constraints) for (let e of t.constraints) e.constrainSize && (o = e.constrainSize(t, o.w, o.h, i, a));
|
|
734
803
|
return o;
|
|
735
804
|
}
|
|
736
|
-
function
|
|
805
|
+
function we({ top: e, left: t, width: n, height: r }) {
|
|
737
806
|
let i = `translate(${t}px,${e}px)`;
|
|
738
807
|
return {
|
|
739
808
|
transform: i,
|
|
@@ -746,7 +815,7 @@ function Ce({ top: e, left: t, width: n, height: r }) {
|
|
|
746
815
|
position: "absolute"
|
|
747
816
|
};
|
|
748
817
|
}
|
|
749
|
-
function
|
|
818
|
+
function Te({ top: e, left: t, width: n, height: r }) {
|
|
750
819
|
return {
|
|
751
820
|
top: `${e}px`,
|
|
752
821
|
left: `${t}px`,
|
|
@@ -755,190 +824,190 @@ function we({ top: e, left: t, width: n, height: r }) {
|
|
|
755
824
|
position: "absolute"
|
|
756
825
|
};
|
|
757
826
|
}
|
|
758
|
-
function
|
|
827
|
+
function Ee(e) {
|
|
759
828
|
return e * 100 + "%";
|
|
760
829
|
}
|
|
761
|
-
function
|
|
830
|
+
function De(e, t, n, r) {
|
|
762
831
|
return e + n > r ? t : n;
|
|
763
832
|
}
|
|
764
|
-
function
|
|
833
|
+
function Oe(e, t, n) {
|
|
765
834
|
return e < 0 ? t : n;
|
|
766
835
|
}
|
|
767
|
-
function
|
|
836
|
+
function ke(e) {
|
|
768
837
|
return Math.max(0, e);
|
|
769
838
|
}
|
|
770
|
-
function
|
|
839
|
+
function Ae(e) {
|
|
771
840
|
return Math.max(0, e);
|
|
772
841
|
}
|
|
773
|
-
var
|
|
842
|
+
var je = (e, t, n) => {
|
|
774
843
|
let { left: r, height: i, width: a } = t, o = e.top - (i - e.height);
|
|
775
844
|
return {
|
|
776
845
|
left: r,
|
|
777
846
|
width: a,
|
|
778
|
-
height:
|
|
779
|
-
top:
|
|
847
|
+
height: Oe(o, e.height, i),
|
|
848
|
+
top: Ae(o)
|
|
780
849
|
};
|
|
781
|
-
},
|
|
850
|
+
}, Me = (e, t, n) => {
|
|
782
851
|
let { top: r, left: i, height: a, width: o } = t;
|
|
783
852
|
return {
|
|
784
853
|
top: r,
|
|
785
854
|
height: a,
|
|
786
|
-
width:
|
|
787
|
-
left:
|
|
855
|
+
width: De(e.left, e.width, o, n),
|
|
856
|
+
left: ke(i)
|
|
788
857
|
};
|
|
789
|
-
},
|
|
858
|
+
}, Ne = (e, t, n) => {
|
|
790
859
|
let { top: r, height: i, width: a } = t, o = e.left + e.width - a;
|
|
791
860
|
return o < 0 ? {
|
|
792
861
|
height: i,
|
|
793
862
|
width: e.left + e.width,
|
|
794
|
-
top:
|
|
863
|
+
top: Ae(r),
|
|
795
864
|
left: 0
|
|
796
865
|
} : {
|
|
797
866
|
height: i,
|
|
798
867
|
width: a,
|
|
799
|
-
top:
|
|
868
|
+
top: Ae(r),
|
|
800
869
|
left: o
|
|
801
870
|
};
|
|
802
|
-
},
|
|
871
|
+
}, Pe = (e, t, n) => {
|
|
803
872
|
let { top: r, left: i, height: a, width: o } = t;
|
|
804
873
|
return {
|
|
805
874
|
width: o,
|
|
806
875
|
left: i,
|
|
807
|
-
height:
|
|
808
|
-
top:
|
|
876
|
+
height: Oe(r, e.height, a),
|
|
877
|
+
top: Ae(r)
|
|
809
878
|
};
|
|
810
|
-
},
|
|
811
|
-
n:
|
|
812
|
-
ne: (e, t, n) =>
|
|
813
|
-
e:
|
|
814
|
-
se: (e, t, n) =>
|
|
815
|
-
s:
|
|
816
|
-
sw: (e, t, n) =>
|
|
817
|
-
w:
|
|
818
|
-
nw: (e, t, n) =>
|
|
879
|
+
}, Fe = {
|
|
880
|
+
n: je,
|
|
881
|
+
ne: (e, t, n) => je(e, Me(e, t, n)),
|
|
882
|
+
e: Me,
|
|
883
|
+
se: (e, t, n) => Pe(e, Me(e, t, n)),
|
|
884
|
+
s: Pe,
|
|
885
|
+
sw: (e, t, n) => Pe(e, Ne(e, t)),
|
|
886
|
+
w: Ne,
|
|
887
|
+
nw: (e, t, n) => je(e, Ne(e, t))
|
|
819
888
|
};
|
|
820
|
-
function
|
|
821
|
-
let i =
|
|
889
|
+
function Ie(e, t, n, r) {
|
|
890
|
+
let i = Fe[e];
|
|
822
891
|
return i ? i(t, {
|
|
823
892
|
...t,
|
|
824
893
|
...n
|
|
825
894
|
}, r) : n;
|
|
826
895
|
}
|
|
827
|
-
var
|
|
896
|
+
var Le = {
|
|
828
897
|
type: "transform",
|
|
829
898
|
scale: 1,
|
|
830
899
|
calcStyle(e) {
|
|
831
|
-
return
|
|
900
|
+
return we(e);
|
|
832
901
|
}
|
|
833
|
-
},
|
|
902
|
+
}, Re = {
|
|
834
903
|
cols: 12,
|
|
835
904
|
rowHeight: 150,
|
|
836
905
|
margin: [10, 10],
|
|
837
906
|
containerPadding: null,
|
|
838
907
|
maxRows: Infinity
|
|
839
|
-
},
|
|
908
|
+
}, ze = {
|
|
840
909
|
enabled: !0,
|
|
841
910
|
bounded: !1,
|
|
842
911
|
threshold: 3
|
|
843
|
-
},
|
|
912
|
+
}, Be = {
|
|
844
913
|
enabled: !0,
|
|
845
914
|
handles: ["se"]
|
|
846
|
-
},
|
|
915
|
+
}, Ve = {
|
|
847
916
|
enabled: !1,
|
|
848
917
|
defaultItem: {
|
|
849
918
|
w: 1,
|
|
850
919
|
h: 1
|
|
851
920
|
}
|
|
852
921
|
};
|
|
853
|
-
function
|
|
922
|
+
function He(e, t, n, r, i) {
|
|
854
923
|
let a = r === "x" ? "w" : "h";
|
|
855
924
|
t[r] += 1;
|
|
856
|
-
let o = e.findIndex((e) => e.i === t.i), s = i ??
|
|
925
|
+
let o = e.findIndex((e) => e.i === t.i), s = i ?? ve(e).length > 0;
|
|
857
926
|
for (let i = o + 1; i < e.length; i++) {
|
|
858
927
|
let o = e[i];
|
|
859
928
|
if (o !== void 0 && !o.static) {
|
|
860
929
|
if (!s && o.y > t.y + t.h) break;
|
|
861
|
-
|
|
930
|
+
fe(t, o) && He(e, o, n + t[a], r, s);
|
|
862
931
|
}
|
|
863
932
|
}
|
|
864
933
|
t[r] = n;
|
|
865
934
|
}
|
|
866
|
-
function
|
|
935
|
+
function Ue(e, t, n, r) {
|
|
867
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 && !K(e, t);) t.y--;
|
|
868
937
|
let i;
|
|
869
|
-
for (; (i = K(e, t)) !== void 0;)
|
|
938
|
+
for (; (i = K(e, t)) !== void 0;) He(n, t, i.y + i.h, "y");
|
|
870
939
|
return t.y = Math.max(t.y, 0), t;
|
|
871
940
|
}
|
|
872
|
-
function
|
|
941
|
+
function We(e, t, n, r) {
|
|
873
942
|
for (t.x = Math.max(t.x, 0), t.y = Math.max(t.y, 0); t.x > 0 && !K(e, t);) t.x--;
|
|
874
943
|
let i;
|
|
875
|
-
for (; (i = K(e, t)) !== void 0;) if (
|
|
944
|
+
for (; (i = K(e, t)) !== void 0;) if (He(r, t, i.x + i.w, "x"), t.x + t.w > n) for (t.x = n - t.w, t.y++; t.x > 0 && !K(e, t);) t.x--;
|
|
876
945
|
return t.x = Math.max(t.x, 0), t;
|
|
877
946
|
}
|
|
878
|
-
var
|
|
947
|
+
var Ge = {
|
|
879
948
|
type: "vertical",
|
|
880
949
|
allowOverlap: !1,
|
|
881
950
|
compact(e, t) {
|
|
882
|
-
let n =
|
|
951
|
+
let n = ve(e), r = ge(n), i = me(e), a = Array(e.length);
|
|
883
952
|
for (let t = 0; t < i.length; t++) {
|
|
884
953
|
let o = i[t];
|
|
885
954
|
if (o === void 0) continue;
|
|
886
|
-
let s =
|
|
887
|
-
s.static || (s =
|
|
955
|
+
let s = ye(o);
|
|
956
|
+
s.static || (s = Ue(n, s, i, r), r = Math.max(r, s.y + s.h), n.push(s));
|
|
888
957
|
let c = e.indexOf(o);
|
|
889
958
|
a[c] = s, s.moved = !1;
|
|
890
959
|
}
|
|
891
960
|
return a;
|
|
892
961
|
}
|
|
893
|
-
},
|
|
962
|
+
}, Ke = {
|
|
894
963
|
type: "horizontal",
|
|
895
964
|
allowOverlap: !1,
|
|
896
965
|
compact(e, t) {
|
|
897
|
-
let n =
|
|
966
|
+
let n = ve(e), r = he(e), i = Array(e.length);
|
|
898
967
|
for (let a = 0; a < r.length; a++) {
|
|
899
968
|
let o = r[a];
|
|
900
969
|
if (o === void 0) continue;
|
|
901
|
-
let s =
|
|
902
|
-
s.static || (s =
|
|
970
|
+
let s = ye(o);
|
|
971
|
+
s.static || (s = We(n, s, t, r), n.push(s));
|
|
903
972
|
let c = e.indexOf(o);
|
|
904
973
|
i[c] = s, s.moved = !1;
|
|
905
974
|
}
|
|
906
975
|
return i;
|
|
907
976
|
}
|
|
908
|
-
},
|
|
977
|
+
}, qe = {
|
|
909
978
|
type: null,
|
|
910
979
|
allowOverlap: !1,
|
|
911
980
|
compact(e, t) {
|
|
912
981
|
return J(e);
|
|
913
982
|
}
|
|
914
|
-
},
|
|
915
|
-
...
|
|
983
|
+
}, Je = {
|
|
984
|
+
...Ge,
|
|
916
985
|
allowOverlap: !0,
|
|
917
986
|
compact(e, t) {
|
|
918
987
|
return J(e);
|
|
919
988
|
}
|
|
920
|
-
},
|
|
921
|
-
...
|
|
989
|
+
}, Ye = {
|
|
990
|
+
...Ke,
|
|
922
991
|
allowOverlap: !0,
|
|
923
992
|
compact(e, t) {
|
|
924
993
|
return J(e);
|
|
925
994
|
}
|
|
926
|
-
},
|
|
927
|
-
...
|
|
995
|
+
}, Xe = {
|
|
996
|
+
...qe,
|
|
928
997
|
allowOverlap: !0
|
|
929
998
|
};
|
|
930
|
-
function
|
|
999
|
+
function Ze(e, t = !1, n = !1) {
|
|
931
1000
|
let r;
|
|
932
|
-
return r = t ? e === "vertical" ?
|
|
1001
|
+
return r = t ? e === "vertical" ? Je : e === "horizontal" ? Ye : Xe : e === "vertical" ? Ge : e === "horizontal" ? Ke : qe, n ? {
|
|
933
1002
|
...r,
|
|
934
1003
|
preventCollision: n
|
|
935
1004
|
} : r;
|
|
936
1005
|
}
|
|
937
|
-
function
|
|
1006
|
+
function Qe(e) {
|
|
938
1007
|
return Object.keys(e).sort((t, n) => e[t] - e[n]);
|
|
939
1008
|
}
|
|
940
|
-
function
|
|
941
|
-
let n =
|
|
1009
|
+
function $e(e, t) {
|
|
1010
|
+
let n = Qe(e), r = n[0];
|
|
942
1011
|
if (r === void 0) throw Error("No breakpoints defined");
|
|
943
1012
|
for (let i = 1; i < n.length; i++) {
|
|
944
1013
|
let a = n[i];
|
|
@@ -946,15 +1015,15 @@ function Ze(e, t) {
|
|
|
946
1015
|
}
|
|
947
1016
|
return r;
|
|
948
1017
|
}
|
|
949
|
-
function
|
|
1018
|
+
function et(e, t) {
|
|
950
1019
|
let n = t[e];
|
|
951
1020
|
if (n === void 0) throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);
|
|
952
1021
|
return n;
|
|
953
1022
|
}
|
|
954
|
-
function
|
|
1023
|
+
function tt(e, t, n, r, i, a) {
|
|
955
1024
|
let o = e[n];
|
|
956
1025
|
if (o) return J(o);
|
|
957
|
-
let s = e[r], c =
|
|
1026
|
+
let s = e[r], c = Qe(t), l = c.slice(c.indexOf(n));
|
|
958
1027
|
for (let t = 0; t < l.length; t++) {
|
|
959
1028
|
let n = l[t];
|
|
960
1029
|
if (n === void 0) continue;
|
|
@@ -964,10 +1033,10 @@ function $e(e, t, n, r, i, a) {
|
|
|
964
1033
|
break;
|
|
965
1034
|
}
|
|
966
1035
|
}
|
|
967
|
-
let u =
|
|
968
|
-
return (typeof a == "object" && a ? a :
|
|
1036
|
+
let u = X(J(s || []), { cols: i });
|
|
1037
|
+
return (typeof a == "object" && a ? a : Ze(a)).compact(u, i);
|
|
969
1038
|
}
|
|
970
|
-
function
|
|
1039
|
+
function nt(e, t) {
|
|
971
1040
|
if (Array.isArray(e)) return e;
|
|
972
1041
|
let n = e, r = n[t];
|
|
973
1042
|
if (r !== void 0) return r;
|
|
@@ -980,7 +1049,7 @@ function et(e, t) {
|
|
|
980
1049
|
}
|
|
981
1050
|
//#endregion
|
|
982
1051
|
//#region ../../node_modules/.pnpm/fast-equals@4.0.3/node_modules/fast-equals/dist/fast-equals.js
|
|
983
|
-
var
|
|
1052
|
+
var rt = /* @__PURE__ */ B(((e, t) => {
|
|
984
1053
|
(function(n, r) {
|
|
985
1054
|
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"] = {}));
|
|
986
1055
|
})(e, (function(e) {
|
|
@@ -1116,10 +1185,10 @@ var tt = /* @__PURE__ */ z(((e, t) => {
|
|
|
1116
1185
|
var R = _(r(j, { createIsNestedEqual: function() {
|
|
1117
1186
|
return o;
|
|
1118
1187
|
} }));
|
|
1119
|
-
function
|
|
1188
|
+
function z(e, t) {
|
|
1120
1189
|
return R(e, t, /* @__PURE__ */ new WeakMap());
|
|
1121
1190
|
}
|
|
1122
|
-
function
|
|
1191
|
+
function ee(e) {
|
|
1123
1192
|
return _(r(A, e(A)));
|
|
1124
1193
|
}
|
|
1125
1194
|
function B(e) {
|
|
@@ -1128,20 +1197,20 @@ var tt = /* @__PURE__ */ z(((e, t) => {
|
|
|
1128
1197
|
return r === void 0 && (r = /* @__PURE__ */ new WeakMap()), t(e, n, r);
|
|
1129
1198
|
});
|
|
1130
1199
|
}
|
|
1131
|
-
e.circularDeepEqual = L, e.circularShallowEqual =
|
|
1200
|
+
e.circularDeepEqual = L, e.circularShallowEqual = z, e.createCustomCircularEqual = B, e.createCustomEqual = ee, e.deepEqual = N, e.sameValueZeroEqual = o, e.shallowEqual = F, Object.defineProperty(e, "__esModule", { value: !0 });
|
|
1132
1201
|
}));
|
|
1133
1202
|
}));
|
|
1134
1203
|
//#endregion
|
|
1135
1204
|
//#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
|
|
1136
|
-
function
|
|
1137
|
-
let { measureBeforeMount: t = !1, initialWidth: n = 1280 } = e, [r, i] =
|
|
1205
|
+
function it(e = {}) {
|
|
1206
|
+
let { measureBeforeMount: t = !1, initialWidth: n = 1280 } = e, [r, i] = O(n), [a, o] = O(!t), s = D(null), c = D(null), l = C(() => {
|
|
1138
1207
|
let e = s.current;
|
|
1139
1208
|
if (e) {
|
|
1140
1209
|
let t = e.offsetWidth;
|
|
1141
1210
|
i(t), a || o(!0);
|
|
1142
1211
|
}
|
|
1143
1212
|
}, [a]);
|
|
1144
|
-
return
|
|
1213
|
+
return T(() => {
|
|
1145
1214
|
let e = s.current;
|
|
1146
1215
|
if (e) {
|
|
1147
1216
|
if (l(), typeof ResizeObserver < "u") {
|
|
@@ -1171,7 +1240,7 @@ function nt(e = {}) {
|
|
|
1171
1240
|
}
|
|
1172
1241
|
//#endregion
|
|
1173
1242
|
//#region ../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js
|
|
1174
|
-
var
|
|
1243
|
+
var at = /* @__PURE__ */ B(((e) => {
|
|
1175
1244
|
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;
|
|
1176
1245
|
function b(e) {
|
|
1177
1246
|
if (typeof e == "object" && e) {
|
|
@@ -1227,7 +1296,7 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
1227
1296
|
}, e.isValidElementType = function(e) {
|
|
1228
1297
|
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);
|
|
1229
1298
|
}, e.typeOf = b;
|
|
1230
|
-
})),
|
|
1299
|
+
})), ot = /* @__PURE__ */ B(((e) => {
|
|
1231
1300
|
process.env.NODE_ENV !== "production" && (function() {
|
|
1232
1301
|
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;
|
|
1233
1302
|
function b(e) {
|
|
@@ -1271,10 +1340,10 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
1271
1340
|
function R(e) {
|
|
1272
1341
|
return x(e) === c;
|
|
1273
1342
|
}
|
|
1274
|
-
function
|
|
1343
|
+
function z(e) {
|
|
1275
1344
|
return x(e) === s;
|
|
1276
1345
|
}
|
|
1277
|
-
function
|
|
1346
|
+
function ee(e) {
|
|
1278
1347
|
return typeof e == "object" && !!e && e.$$typeof === n;
|
|
1279
1348
|
}
|
|
1280
1349
|
function B(e) {
|
|
@@ -1289,23 +1358,23 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
1289
1358
|
function te(e) {
|
|
1290
1359
|
return x(e) === m;
|
|
1291
1360
|
}
|
|
1292
|
-
function
|
|
1361
|
+
function ne(e) {
|
|
1293
1362
|
return x(e) === r;
|
|
1294
1363
|
}
|
|
1295
|
-
function
|
|
1364
|
+
function U(e) {
|
|
1296
1365
|
return x(e) === o;
|
|
1297
1366
|
}
|
|
1298
|
-
function
|
|
1367
|
+
function re(e) {
|
|
1299
1368
|
return x(e) === a;
|
|
1300
1369
|
}
|
|
1301
|
-
function
|
|
1370
|
+
function ie(e) {
|
|
1302
1371
|
return x(e) === f;
|
|
1303
1372
|
}
|
|
1304
|
-
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 =
|
|
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 = V, e.isLazy = H, e.isMemo = te, e.isPortal = ne, e.isProfiler = U, e.isStrictMode = re, e.isSuspense = ie, e.isValidElementType = b, e.typeOf = x;
|
|
1305
1374
|
})();
|
|
1306
|
-
})),
|
|
1307
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
1308
|
-
})),
|
|
1375
|
+
})), st = /* @__PURE__ */ B(((e, t) => {
|
|
1376
|
+
process.env.NODE_ENV === "production" ? t.exports = at() : t.exports = ot();
|
|
1377
|
+
})), ct = /* @__PURE__ */ B(((e, t) => {
|
|
1309
1378
|
var n = Object.getOwnPropertySymbols, r = Object.prototype.hasOwnProperty, i = Object.prototype.propertyIsEnumerable;
|
|
1310
1379
|
function a(e) {
|
|
1311
1380
|
if (e == null) throw TypeError("Object.assign cannot be called with null or undefined");
|
|
@@ -1338,14 +1407,14 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
1338
1407
|
}
|
|
1339
1408
|
return s;
|
|
1340
1409
|
};
|
|
1341
|
-
})),
|
|
1410
|
+
})), lt = /* @__PURE__ */ B(((e, t) => {
|
|
1342
1411
|
t.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
1343
|
-
})),
|
|
1412
|
+
})), ut = /* @__PURE__ */ B(((e, t) => {
|
|
1344
1413
|
t.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
1345
|
-
})),
|
|
1414
|
+
})), dt = /* @__PURE__ */ B(((e, t) => {
|
|
1346
1415
|
var n = function() {};
|
|
1347
1416
|
if (process.env.NODE_ENV !== "production") {
|
|
1348
|
-
var r =
|
|
1417
|
+
var r = lt(), i = {}, a = ut();
|
|
1349
1418
|
n = function(e) {
|
|
1350
1419
|
var t = "Warning: " + e;
|
|
1351
1420
|
typeof console < "u" && console.error(t);
|
|
@@ -1378,8 +1447,8 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
1378
1447
|
o.resetWarningCache = function() {
|
|
1379
1448
|
process.env.NODE_ENV !== "production" && (i = {});
|
|
1380
1449
|
}, t.exports = o;
|
|
1381
|
-
})),
|
|
1382
|
-
var n =
|
|
1450
|
+
})), ft = /* @__PURE__ */ B(((e, t) => {
|
|
1451
|
+
var n = st(), r = ct(), i = lt(), a = ut(), o = dt(), s = function() {};
|
|
1383
1452
|
process.env.NODE_ENV !== "production" && (s = function(e) {
|
|
1384
1453
|
var t = "Warning: " + e;
|
|
1385
1454
|
typeof console < "u" && console.error(t);
|
|
@@ -1637,8 +1706,8 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
1637
1706
|
}
|
|
1638
1707
|
return p.checkPropTypes = o, p.resetWarningCache = o.resetWarningCache, p.PropTypes = p, p;
|
|
1639
1708
|
};
|
|
1640
|
-
})),
|
|
1641
|
-
var n =
|
|
1709
|
+
})), pt = /* @__PURE__ */ B(((e, t) => {
|
|
1710
|
+
var n = lt();
|
|
1642
1711
|
function r() {}
|
|
1643
1712
|
function i() {}
|
|
1644
1713
|
i.resetWarningCache = r, t.exports = function() {
|
|
@@ -1677,12 +1746,12 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
1677
1746
|
};
|
|
1678
1747
|
return a.PropTypes = a, a;
|
|
1679
1748
|
};
|
|
1680
|
-
})),
|
|
1749
|
+
})), mt = /* @__PURE__ */ B(((e, t) => {
|
|
1681
1750
|
if (process.env.NODE_ENV !== "production") {
|
|
1682
|
-
var n =
|
|
1683
|
-
t.exports =
|
|
1684
|
-
} else t.exports =
|
|
1685
|
-
})),
|
|
1751
|
+
var n = st();
|
|
1752
|
+
t.exports = ft()(n.isElement, !0);
|
|
1753
|
+
} else t.exports = pt()();
|
|
1754
|
+
})), ht = /* @__PURE__ */ B(((e) => {
|
|
1686
1755
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.dontSetMe = a, e.findInArray = t, e.int = i, e.isFunction = n, e.isNum = r;
|
|
1687
1756
|
function t(e, t) {
|
|
1688
1757
|
for (let n = 0, r = e.length; n < r; n++) if (t.apply(t, [
|
|
@@ -1703,7 +1772,7 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
1703
1772
|
function a(e, t, n) {
|
|
1704
1773
|
if (e[t]) return /* @__PURE__ */ Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`);
|
|
1705
1774
|
}
|
|
1706
|
-
})),
|
|
1775
|
+
})), gt = /* @__PURE__ */ B(((e) => {
|
|
1707
1776
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.browserPrefixToKey = r, e.browserPrefixToStyle = i, e.default = void 0, e.getPrefix = n;
|
|
1708
1777
|
var t = [
|
|
1709
1778
|
"Moz",
|
|
@@ -1731,9 +1800,9 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
1731
1800
|
return t;
|
|
1732
1801
|
}
|
|
1733
1802
|
e.default = n();
|
|
1734
|
-
})),
|
|
1803
|
+
})), _t = /* @__PURE__ */ B(((e) => {
|
|
1735
1804
|
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;
|
|
1736
|
-
var t =
|
|
1805
|
+
var t = ht(), n = r(gt());
|
|
1737
1806
|
function r(e, t) {
|
|
1738
1807
|
if (typeof WeakMap == "function") var n = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap();
|
|
1739
1808
|
return (r = function(e, t) {
|
|
@@ -1857,9 +1926,9 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
1857
1926
|
function C(e, t) {
|
|
1858
1927
|
e.classList ? e.classList.remove(t) : e.className = e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`, "g"), "");
|
|
1859
1928
|
}
|
|
1860
|
-
})),
|
|
1929
|
+
})), vt = /* @__PURE__ */ B(((e) => {
|
|
1861
1930
|
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;
|
|
1862
|
-
var t =
|
|
1931
|
+
var t = ht(), n = _t();
|
|
1863
1932
|
function r(e, r, i) {
|
|
1864
1933
|
if (!e.props.bounds) return [r, i];
|
|
1865
1934
|
let { bounds: a } = e.props;
|
|
@@ -1938,12 +2007,12 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
1938
2007
|
if (!t) throw Error("<DraggableCore>: Unmounted during event!");
|
|
1939
2008
|
return t;
|
|
1940
2009
|
}
|
|
1941
|
-
})),
|
|
2010
|
+
})), yt = /* @__PURE__ */ B(((e) => {
|
|
1942
2011
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.default = t;
|
|
1943
2012
|
function t() {}
|
|
1944
|
-
})),
|
|
2013
|
+
})), bt = /* @__PURE__ */ B(((e) => {
|
|
1945
2014
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
|
|
1946
|
-
var t = l(
|
|
2015
|
+
var t = l(V("react")), n = c(mt()), r = c(V("react-dom")), i = _t(), a = vt(), o = ht(), s = c(yt());
|
|
1947
2016
|
function c(e) {
|
|
1948
2017
|
return e && e.__esModule ? e : { default: e };
|
|
1949
2018
|
}
|
|
@@ -2103,14 +2172,14 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
2103
2172
|
onMouseDown: function() {},
|
|
2104
2173
|
scale: 1
|
|
2105
2174
|
});
|
|
2106
|
-
})),
|
|
2175
|
+
})), xt = /* @__PURE__ */ B(((e) => {
|
|
2107
2176
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "DraggableCore", {
|
|
2108
2177
|
enumerable: !0,
|
|
2109
2178
|
get: function() {
|
|
2110
2179
|
return c.default;
|
|
2111
2180
|
}
|
|
2112
2181
|
}), e.default = void 0;
|
|
2113
|
-
var t = d(
|
|
2182
|
+
var t = d(V("react")), n = u(mt()), r = u(V("react-dom")), i = V("clsx"), a = _t(), o = vt(), s = ht(), c = u(bt()), l = u(yt());
|
|
2114
2183
|
function u(e) {
|
|
2115
2184
|
return e && e.__esModule ? e : { default: e };
|
|
2116
2185
|
}
|
|
@@ -2304,12 +2373,12 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
2304
2373
|
},
|
|
2305
2374
|
scale: 1
|
|
2306
2375
|
});
|
|
2307
|
-
})),
|
|
2308
|
-
var { default: n, DraggableCore: r } =
|
|
2376
|
+
})), St = /* @__PURE__ */ B(((e, t) => {
|
|
2377
|
+
var { default: n, DraggableCore: r } = xt();
|
|
2309
2378
|
t.exports = n, t.exports.default = n, t.exports.DraggableCore = r;
|
|
2310
|
-
})),
|
|
2379
|
+
})), Ct = /* @__PURE__ */ B(((e) => {
|
|
2311
2380
|
e.__esModule = !0, e.cloneElement = c;
|
|
2312
|
-
var t = n(
|
|
2381
|
+
var t = n(V("react"));
|
|
2313
2382
|
function n(e) {
|
|
2314
2383
|
return e && e.__esModule ? e : { default: e };
|
|
2315
2384
|
}
|
|
@@ -2359,10 +2428,10 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
2359
2428
|
function c(e, n) {
|
|
2360
2429
|
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);
|
|
2361
2430
|
}
|
|
2362
|
-
})),
|
|
2431
|
+
})), wt = /* @__PURE__ */ B(((e) => {
|
|
2363
2432
|
e.__esModule = !0, e.resizableProps = void 0;
|
|
2364
|
-
var t = n(
|
|
2365
|
-
|
|
2433
|
+
var t = n(mt());
|
|
2434
|
+
St();
|
|
2366
2435
|
function n(e) {
|
|
2367
2436
|
return e && e.__esModule ? e : { default: e };
|
|
2368
2437
|
}
|
|
@@ -2421,9 +2490,9 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
2421
2490
|
return n.axis === "both" || n.axis === "x" ? t.default.number.isRequired(...e) : t.default.number(...e);
|
|
2422
2491
|
}
|
|
2423
2492
|
};
|
|
2424
|
-
})),
|
|
2493
|
+
})), Tt = /* @__PURE__ */ B(((e) => {
|
|
2425
2494
|
e.__esModule = !0, e.default = void 0;
|
|
2426
|
-
var t = o(
|
|
2495
|
+
var t = o(V("react")), n = St(), r = Ct(), i = wt(), a = [
|
|
2427
2496
|
"children",
|
|
2428
2497
|
"className",
|
|
2429
2498
|
"draggableOpts",
|
|
@@ -2620,9 +2689,9 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
2620
2689
|
resizeHandles: ["se"],
|
|
2621
2690
|
transformScale: 1
|
|
2622
2691
|
};
|
|
2623
|
-
})),
|
|
2692
|
+
})), Et = /* @__PURE__ */ B(((e) => {
|
|
2624
2693
|
e.__esModule = !0, e.default = void 0;
|
|
2625
|
-
var t = s(
|
|
2694
|
+
var t = s(V("react")), n = o(mt()), r = o(Tt()), i = wt(), a = [
|
|
2626
2695
|
"handle",
|
|
2627
2696
|
"handleSize",
|
|
2628
2697
|
"onResize",
|
|
@@ -2773,26 +2842,26 @@ var rt = /* @__PURE__ */ z(((e) => {
|
|
|
2773
2842
|
}
|
|
2774
2843
|
};
|
|
2775
2844
|
e.default = g, g.propTypes = u(u({}, i.resizableProps), {}, { children: n.default.element });
|
|
2776
|
-
})),
|
|
2845
|
+
})), Dt = /* @__PURE__ */ B(((e, t) => {
|
|
2777
2846
|
t.exports = function() {
|
|
2778
2847
|
throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable");
|
|
2779
|
-
}, t.exports.Resizable =
|
|
2780
|
-
})),
|
|
2781
|
-
function
|
|
2782
|
-
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:
|
|
2848
|
+
}, t.exports.Resizable = Tt().default, t.exports.ResizableBox = Et().default;
|
|
2849
|
+
})), Ot = St(), kt = Dt(), At = rt();
|
|
2850
|
+
function jt(e) {
|
|
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: S = "", x: w, y: k, w: A, h: j, minW: M = 1, maxW: N = Infinity, minH: P = 1, maxH: F = Infinity, i: I, resizeHandles: L, resizeHandle: R, constraints: z = xe, layoutItem: B, layout: V = [], onDragStart: H, onDrag: te, onDragStop: ne, onResizeStart: re, onResize: ie, onResizeStop: ae } = e, [W, le] = O(!1), [fe, K] = O(!1), pe = D(null), q = D({
|
|
2783
2852
|
left: 0,
|
|
2784
2853
|
top: 0
|
|
2785
|
-
}), me =
|
|
2854
|
+
}), me = D({
|
|
2786
2855
|
top: 0,
|
|
2787
2856
|
left: 0,
|
|
2788
2857
|
width: 0,
|
|
2789
2858
|
height: 0
|
|
2790
|
-
}), he =
|
|
2859
|
+
}), he = D(void 0), ge = D(V);
|
|
2791
2860
|
ge.current = V;
|
|
2792
|
-
let _e =
|
|
2861
|
+
let _e = D(null), ve = D(null), ye = D(!1), J = D({
|
|
2793
2862
|
x: 0,
|
|
2794
2863
|
y: 0
|
|
2795
|
-
}),
|
|
2864
|
+
}), be = D(!1), Y = E(() => ({
|
|
2796
2865
|
cols: n,
|
|
2797
2866
|
containerPadding: a,
|
|
2798
2867
|
containerWidth: r,
|
|
@@ -2806,7 +2875,7 @@ function kt(e) {
|
|
|
2806
2875
|
i,
|
|
2807
2876
|
s,
|
|
2808
2877
|
o
|
|
2809
|
-
]),
|
|
2878
|
+
]), X = E(() => ({
|
|
2810
2879
|
cols: n,
|
|
2811
2880
|
maxRows: s,
|
|
2812
2881
|
containerWidth: r,
|
|
@@ -2820,12 +2889,12 @@ function kt(e) {
|
|
|
2820
2889
|
r,
|
|
2821
2890
|
o,
|
|
2822
2891
|
i
|
|
2823
|
-
]), Z =
|
|
2824
|
-
...
|
|
2892
|
+
]), Z = C(() => ({
|
|
2893
|
+
...X,
|
|
2825
2894
|
layout: ge.current
|
|
2826
|
-
}), [
|
|
2895
|
+
}), [X]), Q = E(() => B ?? {
|
|
2827
2896
|
i: I,
|
|
2828
|
-
x:
|
|
2897
|
+
x: w,
|
|
2829
2898
|
y: k,
|
|
2830
2899
|
w: A,
|
|
2831
2900
|
h: j,
|
|
@@ -2836,7 +2905,7 @@ function kt(e) {
|
|
|
2836
2905
|
}, [
|
|
2837
2906
|
B,
|
|
2838
2907
|
I,
|
|
2839
|
-
|
|
2908
|
+
w,
|
|
2840
2909
|
k,
|
|
2841
2910
|
A,
|
|
2842
2911
|
j,
|
|
@@ -2844,21 +2913,21 @@ function kt(e) {
|
|
|
2844
2913
|
N,
|
|
2845
2914
|
P,
|
|
2846
2915
|
F
|
|
2847
|
-
]),
|
|
2916
|
+
]), $ = C((e) => {
|
|
2848
2917
|
if (h?.calcStyle) return h.calcStyle(e);
|
|
2849
|
-
if (f) return
|
|
2850
|
-
let t =
|
|
2918
|
+
if (f) return we(e);
|
|
2919
|
+
let t = Te(e);
|
|
2851
2920
|
return p ? {
|
|
2852
2921
|
...t,
|
|
2853
|
-
left:
|
|
2854
|
-
width:
|
|
2922
|
+
left: Ee(e.left / r),
|
|
2923
|
+
width: Ee(e.width / r)
|
|
2855
2924
|
} : t;
|
|
2856
2925
|
}, [
|
|
2857
2926
|
h,
|
|
2858
2927
|
f,
|
|
2859
2928
|
p,
|
|
2860
2929
|
r
|
|
2861
|
-
]), De =
|
|
2930
|
+
]), De = C((e, { node: t }) => {
|
|
2862
2931
|
if (!H) return;
|
|
2863
2932
|
let { offsetParent: n } = t;
|
|
2864
2933
|
if (!n) return;
|
|
@@ -2872,14 +2941,14 @@ function kt(e) {
|
|
|
2872
2941
|
};
|
|
2873
2942
|
if (q.current = l, g > 0) {
|
|
2874
2943
|
let t = e;
|
|
2875
|
-
|
|
2944
|
+
J.current = {
|
|
2876
2945
|
x: t.clientX,
|
|
2877
2946
|
y: t.clientY
|
|
2878
|
-
},
|
|
2947
|
+
}, ye.current = !0, be.current = !1, le(!0);
|
|
2879
2948
|
return;
|
|
2880
2949
|
}
|
|
2881
|
-
|
|
2882
|
-
let u =
|
|
2950
|
+
le(!0);
|
|
2951
|
+
let u = ue(Y, l.top, l.left), { x: d, y: f } = Se(z, Q, u.x, u.y, Z());
|
|
2883
2952
|
H(I, d, f, {
|
|
2884
2953
|
e,
|
|
2885
2954
|
node: t,
|
|
@@ -2888,21 +2957,21 @@ function kt(e) {
|
|
|
2888
2957
|
}, [
|
|
2889
2958
|
H,
|
|
2890
2959
|
m,
|
|
2891
|
-
|
|
2960
|
+
Y,
|
|
2892
2961
|
h,
|
|
2893
2962
|
g,
|
|
2894
2963
|
z,
|
|
2895
|
-
|
|
2964
|
+
Q,
|
|
2896
2965
|
Z,
|
|
2897
2966
|
I
|
|
2898
|
-
]), Oe =
|
|
2899
|
-
if (!te || !
|
|
2967
|
+
]), Oe = C((e, { node: t, deltaX: n, deltaY: a }) => {
|
|
2968
|
+
if (!te || !W) return;
|
|
2900
2969
|
let s = e;
|
|
2901
|
-
if (
|
|
2902
|
-
let n = s.clientX -
|
|
2970
|
+
if (ye.current && !be.current) {
|
|
2971
|
+
let n = s.clientX - J.current.x, r = s.clientY - J.current.y;
|
|
2903
2972
|
if (Math.hypot(n, r) < g) return;
|
|
2904
|
-
if (
|
|
2905
|
-
let n =
|
|
2973
|
+
if (be.current = !0, ye.current = !1, H) {
|
|
2974
|
+
let n = ue(Y, q.current.top, q.current.left), { x: r, y: i } = Se(z, Q, n.x, n.y, Z());
|
|
2906
2975
|
H(I, r, i, {
|
|
2907
2976
|
e,
|
|
2908
2977
|
node: t,
|
|
@@ -2914,10 +2983,10 @@ function kt(e) {
|
|
|
2914
2983
|
if (u) {
|
|
2915
2984
|
let { offsetParent: e } = t;
|
|
2916
2985
|
if (e) {
|
|
2917
|
-
let t = e.clientHeight -
|
|
2918
|
-
c =
|
|
2919
|
-
let n = r -
|
|
2920
|
-
l =
|
|
2986
|
+
let t = e.clientHeight - se(j, o, i[1]);
|
|
2987
|
+
c = de(c, 0, t);
|
|
2988
|
+
let n = r - se(A, oe(Y), i[0]);
|
|
2989
|
+
l = de(l, 0, n);
|
|
2921
2990
|
}
|
|
2922
2991
|
}
|
|
2923
2992
|
let d = {
|
|
@@ -2925,7 +2994,7 @@ function kt(e) {
|
|
|
2925
2994
|
left: l
|
|
2926
2995
|
};
|
|
2927
2996
|
q.current = d;
|
|
2928
|
-
let f =
|
|
2997
|
+
let f = ue(Y, c, l), { x: p, y: m } = Se(z, Q, f.x, f.y, Z());
|
|
2929
2998
|
te(I, p, m, {
|
|
2930
2999
|
e,
|
|
2931
3000
|
node: t,
|
|
@@ -2934,27 +3003,27 @@ function kt(e) {
|
|
|
2934
3003
|
}, [
|
|
2935
3004
|
te,
|
|
2936
3005
|
H,
|
|
2937
|
-
|
|
3006
|
+
W,
|
|
2938
3007
|
g,
|
|
2939
3008
|
u,
|
|
2940
3009
|
j,
|
|
2941
3010
|
o,
|
|
2942
3011
|
i,
|
|
2943
|
-
|
|
3012
|
+
Y,
|
|
2944
3013
|
r,
|
|
2945
3014
|
A,
|
|
2946
3015
|
I,
|
|
2947
3016
|
z,
|
|
2948
|
-
|
|
3017
|
+
Q,
|
|
2949
3018
|
Z
|
|
2950
|
-
]), ke =
|
|
2951
|
-
if (!
|
|
2952
|
-
let n =
|
|
2953
|
-
if (
|
|
3019
|
+
]), ke = C((e, { node: t }) => {
|
|
3020
|
+
if (!ne || !W) return;
|
|
3021
|
+
let n = ye.current;
|
|
3022
|
+
if (ye.current = !1, be.current = !1, J.current = {
|
|
2954
3023
|
x: 0,
|
|
2955
3024
|
y: 0
|
|
2956
3025
|
}, n) {
|
|
2957
|
-
|
|
3026
|
+
le(!1), q.current = {
|
|
2958
3027
|
left: 0,
|
|
2959
3028
|
top: 0
|
|
2960
3029
|
};
|
|
@@ -2964,36 +3033,36 @@ function kt(e) {
|
|
|
2964
3033
|
top: i,
|
|
2965
3034
|
left: r
|
|
2966
3035
|
};
|
|
2967
|
-
|
|
3036
|
+
le(!1), q.current = {
|
|
2968
3037
|
left: 0,
|
|
2969
3038
|
top: 0
|
|
2970
3039
|
};
|
|
2971
|
-
let o =
|
|
2972
|
-
|
|
3040
|
+
let o = ue(Y, i, r), { x: s, y: c } = Se(z, Q, o.x, o.y, Z());
|
|
3041
|
+
ne(I, s, c, {
|
|
2973
3042
|
e,
|
|
2974
3043
|
node: t,
|
|
2975
3044
|
newPosition: a
|
|
2976
3045
|
});
|
|
2977
3046
|
}, [
|
|
3047
|
+
ne,
|
|
2978
3048
|
W,
|
|
2979
|
-
|
|
2980
|
-
X,
|
|
3049
|
+
Y,
|
|
2981
3050
|
z,
|
|
2982
|
-
|
|
3051
|
+
Q,
|
|
2983
3052
|
Z,
|
|
2984
3053
|
I
|
|
2985
3054
|
]);
|
|
2986
|
-
_e.current = De,
|
|
2987
|
-
let Ae =
|
|
2988
|
-
let s = o === "onResizeStart" ?
|
|
3055
|
+
_e.current = De, ve.current = Oe;
|
|
3056
|
+
let Ae = C((e, { node: t, size: n, handle: i }, a, o) => {
|
|
3057
|
+
let s = o === "onResizeStart" ? re : o === "onResize" ? ie : ae;
|
|
2989
3058
|
if (!s) return;
|
|
2990
3059
|
let c;
|
|
2991
|
-
c = t ?
|
|
3060
|
+
c = t ? Ie(i, a, n, r) : {
|
|
2992
3061
|
...n,
|
|
2993
3062
|
top: a.top,
|
|
2994
3063
|
left: a.left
|
|
2995
3064
|
}, me.current = c;
|
|
2996
|
-
let l =
|
|
3065
|
+
let l = G(Y, c.width, c.height), { w: u, h: d } = Ce(z, Q, l.w, l.h, i, Z());
|
|
2997
3066
|
s(I, u, d, {
|
|
2998
3067
|
e: e.nativeEvent,
|
|
2999
3068
|
node: t,
|
|
@@ -3001,71 +3070,71 @@ function kt(e) {
|
|
|
3001
3070
|
handle: i
|
|
3002
3071
|
});
|
|
3003
3072
|
}, [
|
|
3004
|
-
ne,
|
|
3005
3073
|
re,
|
|
3006
|
-
|
|
3074
|
+
ie,
|
|
3075
|
+
ae,
|
|
3007
3076
|
r,
|
|
3008
|
-
|
|
3077
|
+
Y,
|
|
3009
3078
|
I,
|
|
3010
3079
|
z,
|
|
3011
|
-
|
|
3080
|
+
Q,
|
|
3012
3081
|
Z
|
|
3013
|
-
]), je =
|
|
3014
|
-
|
|
3015
|
-
let n =
|
|
3082
|
+
]), je = C((e, t) => {
|
|
3083
|
+
K(!0);
|
|
3084
|
+
let n = ce(Y, w, k, A, j);
|
|
3016
3085
|
Ae(e, {
|
|
3017
3086
|
...t,
|
|
3018
3087
|
handle: t.handle
|
|
3019
3088
|
}, n, "onResizeStart");
|
|
3020
3089
|
}, [
|
|
3021
3090
|
Ae,
|
|
3022
|
-
|
|
3023
|
-
|
|
3091
|
+
Y,
|
|
3092
|
+
w,
|
|
3024
3093
|
k,
|
|
3025
3094
|
A,
|
|
3026
3095
|
j
|
|
3027
|
-
]), Me =
|
|
3028
|
-
let n =
|
|
3096
|
+
]), Me = C((e, t) => {
|
|
3097
|
+
let n = ce(Y, w, k, A, j);
|
|
3029
3098
|
Ae(e, {
|
|
3030
3099
|
...t,
|
|
3031
3100
|
handle: t.handle
|
|
3032
3101
|
}, n, "onResize");
|
|
3033
3102
|
}, [
|
|
3034
3103
|
Ae,
|
|
3035
|
-
|
|
3036
|
-
|
|
3104
|
+
Y,
|
|
3105
|
+
w,
|
|
3037
3106
|
k,
|
|
3038
3107
|
A,
|
|
3039
3108
|
j
|
|
3040
|
-
]), Ne =
|
|
3041
|
-
|
|
3109
|
+
]), Ne = C((e, t) => {
|
|
3110
|
+
K(!1), me.current = {
|
|
3042
3111
|
top: 0,
|
|
3043
3112
|
left: 0,
|
|
3044
3113
|
width: 0,
|
|
3045
3114
|
height: 0
|
|
3046
3115
|
};
|
|
3047
|
-
let n =
|
|
3116
|
+
let n = ce(Y, w, k, A, j);
|
|
3048
3117
|
Ae(e, {
|
|
3049
3118
|
...t,
|
|
3050
3119
|
handle: t.handle
|
|
3051
3120
|
}, n, "onResizeStop");
|
|
3052
3121
|
}, [
|
|
3053
3122
|
Ae,
|
|
3054
|
-
|
|
3055
|
-
|
|
3123
|
+
Y,
|
|
3124
|
+
w,
|
|
3056
3125
|
k,
|
|
3057
3126
|
A,
|
|
3058
3127
|
j
|
|
3059
3128
|
]);
|
|
3060
|
-
|
|
3129
|
+
T(() => {
|
|
3061
3130
|
if (!_) return;
|
|
3062
3131
|
let e = pe.current;
|
|
3063
3132
|
if (!e) return;
|
|
3064
3133
|
let t = he.current || {
|
|
3065
3134
|
left: 0,
|
|
3066
3135
|
top: 0
|
|
3067
|
-
}, n =
|
|
3068
|
-
if (!
|
|
3136
|
+
}, n = W && (_.left !== t.left || _.top !== t.top);
|
|
3137
|
+
if (!W) {
|
|
3069
3138
|
let t = {
|
|
3070
3139
|
node: e,
|
|
3071
3140
|
deltaX: _.left,
|
|
@@ -3086,35 +3155,35 @@ function kt(e) {
|
|
|
3086
3155
|
x: _.left,
|
|
3087
3156
|
y: _.top
|
|
3088
3157
|
};
|
|
3089
|
-
|
|
3158
|
+
ve.current?.(_.e, t);
|
|
3090
3159
|
}
|
|
3091
3160
|
he.current = _;
|
|
3092
3161
|
}, [
|
|
3093
3162
|
_,
|
|
3094
|
-
|
|
3163
|
+
W,
|
|
3095
3164
|
I
|
|
3096
3165
|
]);
|
|
3097
|
-
let
|
|
3166
|
+
let Pe = ce(Y, w, k, A, j, W ? q.current : null, fe ? me.current : null), Fe = x.Children.only(t), Le = oe(Y), Re = [se(M, Le, i[0]), se(P, o, i[1])], ze = [se(N, Le, i[0]), se(F, o, i[1])], Be = Fe.props, Ve = Be.className, He = Be.style, Ue = x.cloneElement(Fe, {
|
|
3098
3167
|
ref: pe,
|
|
3099
3168
|
className: ee("react-grid-item", Ve, v, {
|
|
3100
3169
|
static: d,
|
|
3101
|
-
resizing:
|
|
3170
|
+
resizing: fe,
|
|
3102
3171
|
"react-draggable": c,
|
|
3103
|
-
"react-draggable-dragging":
|
|
3172
|
+
"react-draggable-dragging": W,
|
|
3104
3173
|
dropping: !!_,
|
|
3105
3174
|
cssTransforms: f
|
|
3106
3175
|
}),
|
|
3107
3176
|
style: {
|
|
3108
|
-
...
|
|
3177
|
+
...y,
|
|
3109
3178
|
...He,
|
|
3110
|
-
|
|
3179
|
+
...$(Pe)
|
|
3111
3180
|
}
|
|
3112
3181
|
}), We = R;
|
|
3113
|
-
return Ue = /* @__PURE__ */ (0, U.jsx)(
|
|
3182
|
+
return Ue = /* @__PURE__ */ (0, U.jsx)(kt.Resizable, {
|
|
3114
3183
|
draggableOpts: { disabled: !l },
|
|
3115
3184
|
className: l ? void 0 : "react-resizable-hide",
|
|
3116
|
-
width:
|
|
3117
|
-
height:
|
|
3185
|
+
width: Pe.width,
|
|
3186
|
+
height: Pe.height,
|
|
3118
3187
|
minConstraints: Re,
|
|
3119
3188
|
maxConstraints: ze,
|
|
3120
3189
|
onResizeStart: je,
|
|
@@ -3124,24 +3193,24 @@ function kt(e) {
|
|
|
3124
3193
|
resizeHandles: L,
|
|
3125
3194
|
handle: We,
|
|
3126
3195
|
children: Ue
|
|
3127
|
-
}), Ue = /* @__PURE__ */ (0, U.jsx)(
|
|
3196
|
+
}), Ue = /* @__PURE__ */ (0, U.jsx)(Ot.DraggableCore, {
|
|
3128
3197
|
disabled: !c,
|
|
3129
3198
|
onStart: De,
|
|
3130
3199
|
onDrag: Oe,
|
|
3131
3200
|
onStop: ke,
|
|
3132
|
-
handle:
|
|
3133
|
-
cancel: ".react-resizable-handle" + (
|
|
3201
|
+
handle: b,
|
|
3202
|
+
cancel: ".react-resizable-handle" + (S ? "," + S : ""),
|
|
3134
3203
|
scale: m,
|
|
3135
3204
|
nodeRef: pe,
|
|
3136
3205
|
children: Ue
|
|
3137
3206
|
}), Ue;
|
|
3138
3207
|
}
|
|
3139
|
-
var
|
|
3208
|
+
var Mt = () => {}, Nt = "react-grid-layout", Pt = !1;
|
|
3140
3209
|
try {
|
|
3141
|
-
|
|
3210
|
+
Pt = /firefox/i.test(navigator.userAgent);
|
|
3142
3211
|
} catch {}
|
|
3143
|
-
function
|
|
3144
|
-
let n =
|
|
3212
|
+
function Ft(e, t) {
|
|
3213
|
+
let n = x.Children.toArray(e), r = x.Children.toArray(t);
|
|
3145
3214
|
if (n.length !== r.length) return !1;
|
|
3146
3215
|
for (let e = 0; e < n.length; e++) {
|
|
3147
3216
|
let t = n[e], i = r[e];
|
|
@@ -3149,14 +3218,14 @@ function Nt(e, t) {
|
|
|
3149
3218
|
}
|
|
3150
3219
|
return !0;
|
|
3151
3220
|
}
|
|
3152
|
-
function
|
|
3221
|
+
function It(e, t, n, r) {
|
|
3153
3222
|
let i = [], a = /* @__PURE__ */ new Set();
|
|
3154
|
-
|
|
3155
|
-
if (!
|
|
3223
|
+
x.Children.forEach(t, (t) => {
|
|
3224
|
+
if (!x.isValidElement(t) || t.key === null) return;
|
|
3156
3225
|
let n = String(t.key);
|
|
3157
3226
|
a.add(n);
|
|
3158
3227
|
let r = e.find((e) => e.i === n);
|
|
3159
|
-
if (r) i.push(
|
|
3228
|
+
if (r) i.push(ye(r));
|
|
3160
3229
|
else {
|
|
3161
3230
|
let e = t.props["data-grid"];
|
|
3162
3231
|
e ? i.push({
|
|
@@ -3177,71 +3246,71 @@ function Pt(e, t, n, r) {
|
|
|
3177
3246
|
}) : i.push({
|
|
3178
3247
|
i: n,
|
|
3179
3248
|
x: 0,
|
|
3180
|
-
y:
|
|
3249
|
+
y: ge(i),
|
|
3181
3250
|
w: 1,
|
|
3182
3251
|
h: 1
|
|
3183
3252
|
});
|
|
3184
3253
|
}
|
|
3185
3254
|
});
|
|
3186
|
-
let o =
|
|
3255
|
+
let o = X(i, { cols: n });
|
|
3187
3256
|
return r.compact(o, n);
|
|
3188
3257
|
}
|
|
3189
|
-
function
|
|
3190
|
-
let { children: t, width: n, gridConfig: r, dragConfig: i, resizeConfig: a, dropConfig: o, positionStrategy: s =
|
|
3191
|
-
...
|
|
3258
|
+
function Lt(e) {
|
|
3259
|
+
let { children: t, width: n, gridConfig: r, dragConfig: i, resizeConfig: a, dropConfig: o, positionStrategy: s = Le, compactor: c, constraints: l = xe, layout: u = [], droppingItem: d, autoSize: f = !0, className: p = "", style: m = {}, innerRef: h, onLayoutChange: g = Mt, onDragStart: _ = Mt, onDrag: v = Mt, onDragStop: y = Mt, onResizeStart: b = Mt, onResize: S = Mt, onResizeStop: w = Mt, onDrop: k = Mt, onDropDragOver: A = Mt } = e, j = E(() => ({
|
|
3260
|
+
...Re,
|
|
3192
3261
|
...r
|
|
3193
|
-
}), [r]), M =
|
|
3194
|
-
...
|
|
3262
|
+
}), [r]), M = E(() => ({
|
|
3263
|
+
...ze,
|
|
3195
3264
|
...i
|
|
3196
|
-
}), [i]), N =
|
|
3197
|
-
...
|
|
3265
|
+
}), [i]), N = E(() => ({
|
|
3266
|
+
...Be,
|
|
3198
3267
|
...a
|
|
3199
|
-
}), [a]), P =
|
|
3200
|
-
...
|
|
3268
|
+
}), [a]), P = E(() => ({
|
|
3269
|
+
...Ve,
|
|
3201
3270
|
...o
|
|
3202
|
-
}), [o]), { cols: F, rowHeight: I, maxRows: L, margin: R, containerPadding: z } = j, { enabled: B, bounded: V, handle: H, cancel: te, threshold:
|
|
3271
|
+
}), [o]), { cols: F, rowHeight: I, maxRows: L, margin: R, containerPadding: z } = j, { enabled: B, bounded: V, handle: H, cancel: te, threshold: ne } = M, { enabled: re, handles: ie, handleComponent: ae } = N, { enabled: W, defaultItem: ce, onDragOver: ue } = P, G = c ?? Ze("vertical"), de = G.type, fe = G.allowOverlap, K = G.preventCollision ?? !1, q = E(() => d ?? {
|
|
3203
3272
|
i: "__dropping-elem__",
|
|
3204
|
-
...
|
|
3205
|
-
}, [d,
|
|
3206
|
-
He.current =
|
|
3207
|
-
be(!0), (0,
|
|
3208
|
-
}, []),
|
|
3209
|
-
if (
|
|
3210
|
-
let e = !(0,
|
|
3273
|
+
...ce
|
|
3274
|
+
}, [d, ce]), me = s.type === "transform", he = s.scale, ve = z ?? R, [J, be] = O(!1), [X, Q] = O(() => It(u, t, F, G)), [$, Se] = O(null), [Ce, we] = O(!1), [Te, Ee] = O(null), [De, Oe] = O(), ke = D(null), Ae = D(null), je = D(null), Me = D(0), Ne = D(X), Pe = D(u), Fe = D(t), Ie = D(de), He = D(X);
|
|
3275
|
+
He.current = X, T(() => {
|
|
3276
|
+
be(!0), (0, At.deepEqual)(X, u) || g(X);
|
|
3277
|
+
}, []), T(() => {
|
|
3278
|
+
if ($ || Te) return;
|
|
3279
|
+
let e = !(0, At.deepEqual)(u, Pe.current), n = !Ft(t, Fe.current), r = de !== Ie.current;
|
|
3211
3280
|
if (e || n || r) {
|
|
3212
|
-
let n =
|
|
3213
|
-
(0,
|
|
3281
|
+
let n = It(e ? u : X, t, F, G);
|
|
3282
|
+
(0, At.deepEqual)(n, X) || Q(n);
|
|
3214
3283
|
}
|
|
3215
|
-
Pe.current = u,
|
|
3284
|
+
Pe.current = u, Fe.current = t, Ie.current = de;
|
|
3216
3285
|
}, [
|
|
3217
3286
|
u,
|
|
3218
3287
|
t,
|
|
3219
3288
|
F,
|
|
3220
|
-
|
|
3289
|
+
de,
|
|
3221
3290
|
G,
|
|
3222
|
-
Q,
|
|
3223
3291
|
$,
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3292
|
+
Te,
|
|
3293
|
+
X
|
|
3294
|
+
]), T(() => {
|
|
3295
|
+
!$ && !(0, At.deepEqual)(X, Ne.current) && (Ne.current = X, g(X.filter((e) => e.i !== q.i)));
|
|
3227
3296
|
}, [
|
|
3228
|
-
|
|
3229
|
-
|
|
3297
|
+
X,
|
|
3298
|
+
$,
|
|
3230
3299
|
g,
|
|
3231
3300
|
q.i
|
|
3232
3301
|
]);
|
|
3233
|
-
let Ue =
|
|
3302
|
+
let Ue = E(() => {
|
|
3234
3303
|
if (!f) return;
|
|
3235
|
-
let e =
|
|
3304
|
+
let e = ge(X), t = ve[1];
|
|
3236
3305
|
return e * I + (e - 1) * R[1] + t * 2 + "px";
|
|
3237
3306
|
}, [
|
|
3238
3307
|
f,
|
|
3239
|
-
|
|
3308
|
+
X,
|
|
3240
3309
|
I,
|
|
3241
3310
|
R,
|
|
3242
|
-
|
|
3243
|
-
]), We =
|
|
3244
|
-
let i = He.current, a =
|
|
3311
|
+
ve
|
|
3312
|
+
]), We = C((e, t, n, r) => {
|
|
3313
|
+
let i = He.current, a = _e(i, e);
|
|
3245
3314
|
if (!a) return;
|
|
3246
3315
|
let o = {
|
|
3247
3316
|
w: a.w,
|
|
@@ -3250,9 +3319,9 @@ function Ft(e) {
|
|
|
3250
3319
|
y: a.y,
|
|
3251
3320
|
i: e
|
|
3252
3321
|
};
|
|
3253
|
-
ke.current =
|
|
3254
|
-
}, [_]), Ge =
|
|
3255
|
-
let i = He.current, a = ke.current, o =
|
|
3322
|
+
ke.current = ye(a), je.current = i, Se(o), _(i, a, a, null, r.e, r.node);
|
|
3323
|
+
}, [_]), Ge = C((e, t, n, r) => {
|
|
3324
|
+
let i = He.current, a = ke.current, o = _e(i, e);
|
|
3256
3325
|
if (!o) return;
|
|
3257
3326
|
let s = {
|
|
3258
3327
|
w: o.w,
|
|
@@ -3260,37 +3329,37 @@ function Ft(e) {
|
|
|
3260
3329
|
x: o.x,
|
|
3261
3330
|
y: o.y,
|
|
3262
3331
|
i: e
|
|
3263
|
-
}, c =
|
|
3264
|
-
v(c, a, o, s, r.e, r.node),
|
|
3332
|
+
}, c = Z(i, o, t, n, !0, K, de, F, fe);
|
|
3333
|
+
v(c, a, o, s, r.e, r.node), Q(G.compact(c, F)), Se(s);
|
|
3265
3334
|
}, [
|
|
3266
|
-
pe,
|
|
3267
3335
|
K,
|
|
3336
|
+
de,
|
|
3268
3337
|
F,
|
|
3269
3338
|
fe,
|
|
3270
3339
|
G,
|
|
3271
3340
|
v
|
|
3272
|
-
]), Ke =
|
|
3273
|
-
if (
|
|
3274
|
-
let i = He.current, a = ke.current, o =
|
|
3341
|
+
]), Ke = C((e, t, n, r) => {
|
|
3342
|
+
if (!$) return;
|
|
3343
|
+
let i = He.current, a = ke.current, o = _e(i, e);
|
|
3275
3344
|
if (!o) return;
|
|
3276
|
-
let s =
|
|
3277
|
-
|
|
3345
|
+
let s = Z(i, o, t, n, !0, K, de, F, fe), c = G.compact(s, F);
|
|
3346
|
+
y(c, a, o, null, r.e, r.node);
|
|
3278
3347
|
let l = je.current;
|
|
3279
|
-
ke.current = null, je.current = null,
|
|
3348
|
+
ke.current = null, je.current = null, Se(null), Q(c), l && !(0, At.deepEqual)(l, c) && g(c);
|
|
3280
3349
|
}, [
|
|
3281
|
-
|
|
3282
|
-
pe,
|
|
3350
|
+
$,
|
|
3283
3351
|
K,
|
|
3352
|
+
de,
|
|
3284
3353
|
F,
|
|
3285
3354
|
fe,
|
|
3286
3355
|
G,
|
|
3287
|
-
|
|
3356
|
+
y,
|
|
3288
3357
|
g
|
|
3289
|
-
]), qe =
|
|
3290
|
-
let i = He.current, a =
|
|
3291
|
-
a && (Ae.current =
|
|
3292
|
-
}, [
|
|
3293
|
-
let i = He.current, a = Ae.current, { handle: o } = r, s = !1, c, l, [u, d] =
|
|
3358
|
+
]), qe = C((e, t, n, r) => {
|
|
3359
|
+
let i = He.current, a = _e(i, e);
|
|
3360
|
+
a && (Ae.current = ye(a), je.current = i, we(!0), b(i, a, a, null, r.e, r.node));
|
|
3361
|
+
}, [b]), Je = C((e, t, n, r) => {
|
|
3362
|
+
let i = He.current, a = Ae.current, { handle: o } = r, s = !1, c, l, [u, d] = Y(i, e, (e) => (c = e.x, l = e.y, [
|
|
3294
3363
|
"sw",
|
|
3295
3364
|
"w",
|
|
3296
3365
|
"nw",
|
|
@@ -3304,7 +3373,7 @@ function Ft(e) {
|
|
|
3304
3373
|
"ne",
|
|
3305
3374
|
"n",
|
|
3306
3375
|
"nw"
|
|
3307
|
-
].includes(o) && (l = e.y + (e.h - n), n = e.y !== l && l < 0 ? e.h : n, l = l < 0 ? 0 : l), s = !0),
|
|
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), K && !fe && pe(i, {
|
|
3308
3377
|
...e,
|
|
3309
3378
|
w: t,
|
|
3310
3379
|
h: n,
|
|
@@ -3313,7 +3382,7 @@ function Ft(e) {
|
|
|
3313
3382
|
}).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));
|
|
3314
3383
|
if (!d) return;
|
|
3315
3384
|
let f = u;
|
|
3316
|
-
s && c !== void 0 && l !== void 0 && (f =
|
|
3385
|
+
s && c !== void 0 && l !== void 0 && (f = Z(u, d, c, l, !0, K, de, F, fe));
|
|
3317
3386
|
let p = {
|
|
3318
3387
|
w: d.w,
|
|
3319
3388
|
h: d.h,
|
|
@@ -3322,39 +3391,39 @@ function Ft(e) {
|
|
|
3322
3391
|
i: e,
|
|
3323
3392
|
static: !0
|
|
3324
3393
|
};
|
|
3325
|
-
|
|
3394
|
+
S(f, a, d, p, r.e, r.node), Q(G.compact(f, F)), Se(p);
|
|
3326
3395
|
}, [
|
|
3327
|
-
pe,
|
|
3328
3396
|
K,
|
|
3397
|
+
de,
|
|
3329
3398
|
F,
|
|
3330
3399
|
fe,
|
|
3331
3400
|
G,
|
|
3332
|
-
|
|
3333
|
-
]),
|
|
3334
|
-
let i = He.current, a = Ae.current, o =
|
|
3335
|
-
|
|
3401
|
+
S
|
|
3402
|
+
]), Ye = C((e, t, n, r) => {
|
|
3403
|
+
let i = He.current, a = Ae.current, o = _e(i, e), s = G.compact(i, F);
|
|
3404
|
+
w(s, a, o ?? null, null, r.e, r.node);
|
|
3336
3405
|
let c = je.current;
|
|
3337
|
-
Ae.current = null, je.current = null,
|
|
3406
|
+
Ae.current = null, je.current = null, Se(null), we(!1), Q(s), c && !(0, At.deepEqual)(c, s) && g(s);
|
|
3338
3407
|
}, [
|
|
3339
3408
|
F,
|
|
3340
3409
|
G,
|
|
3341
|
-
|
|
3410
|
+
w,
|
|
3342
3411
|
g
|
|
3343
|
-
]),
|
|
3412
|
+
]), Xe = C(() => {
|
|
3344
3413
|
let e = He.current;
|
|
3345
3414
|
if (!e.some((e) => e.i === q.i)) {
|
|
3346
|
-
Ee(null),
|
|
3415
|
+
Ee(null), Se(null), Oe(void 0);
|
|
3347
3416
|
return;
|
|
3348
3417
|
}
|
|
3349
|
-
|
|
3418
|
+
Q(G.compact(e.filter((e) => e.i !== q.i), F)), Ee(null), Se(null), Oe(void 0);
|
|
3350
3419
|
}, [
|
|
3351
3420
|
q.i,
|
|
3352
3421
|
F,
|
|
3353
3422
|
G
|
|
3354
|
-
]), Qe =
|
|
3355
|
-
if (e.preventDefault(), e.stopPropagation(),
|
|
3423
|
+
]), Qe = C((e) => {
|
|
3424
|
+
if (e.preventDefault(), e.stopPropagation(), Pt && !e.nativeEvent.target?.classList.contains(Nt)) return !1;
|
|
3356
3425
|
let t = ue ? ue(e.nativeEvent) : A(e);
|
|
3357
|
-
if (t === !1) return
|
|
3426
|
+
if (t === !1) return Te && Xe(), !1;
|
|
3358
3427
|
let { dragOffsetX: r = 0, dragOffsetY: i = 0, ...a } = t ?? {}, o = {
|
|
3359
3428
|
...q,
|
|
3360
3429
|
...a
|
|
@@ -3364,16 +3433,16 @@ function Ft(e) {
|
|
|
3364
3433
|
maxRows: L,
|
|
3365
3434
|
rowHeight: I,
|
|
3366
3435
|
containerWidth: n,
|
|
3367
|
-
containerPadding:
|
|
3368
|
-
}, l =
|
|
3369
|
-
left: g /
|
|
3370
|
-
top: _ /
|
|
3436
|
+
containerPadding: ve
|
|
3437
|
+
}, l = oe(c), u = se(o.w, l, R[0]), d = se(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 = {
|
|
3438
|
+
left: g / he,
|
|
3439
|
+
top: _ / he,
|
|
3371
3440
|
e: e.nativeEvent
|
|
3372
3441
|
};
|
|
3373
|
-
if (
|
|
3442
|
+
if (Te) De && (De.left !== v.left || De.top !== v.top) && Oe(v);
|
|
3374
3443
|
else {
|
|
3375
|
-
let e =
|
|
3376
|
-
Ee(/* @__PURE__ */ (0, U.jsx)("div", {}, o.i)), Oe(v),
|
|
3444
|
+
let e = le(c, _, g, o.w, o.h);
|
|
3445
|
+
Ee(/* @__PURE__ */ (0, U.jsx)("div", {}, o.i)), Oe(v), Q([...He.current.filter((e) => e.i !== o.i), {
|
|
3377
3446
|
...o,
|
|
3378
3447
|
x: e.x,
|
|
3379
3448
|
y: e.y,
|
|
@@ -3382,41 +3451,41 @@ function Ft(e) {
|
|
|
3382
3451
|
}]);
|
|
3383
3452
|
}
|
|
3384
3453
|
}, [
|
|
3385
|
-
|
|
3454
|
+
Te,
|
|
3386
3455
|
De,
|
|
3387
3456
|
q,
|
|
3388
3457
|
ue,
|
|
3389
3458
|
A,
|
|
3390
|
-
|
|
3391
|
-
|
|
3459
|
+
Xe,
|
|
3460
|
+
he,
|
|
3392
3461
|
F,
|
|
3393
3462
|
R,
|
|
3394
3463
|
L,
|
|
3395
3464
|
I,
|
|
3396
3465
|
n,
|
|
3397
|
-
|
|
3398
|
-
]), $e =
|
|
3399
|
-
e.preventDefault(), e.stopPropagation(), Me.current--, Me.current < 0 && (Me.current = 0), Me.current === 0 &&
|
|
3400
|
-
}, [
|
|
3466
|
+
ve
|
|
3467
|
+
]), $e = C((e) => {
|
|
3468
|
+
e.preventDefault(), e.stopPropagation(), Me.current--, Me.current < 0 && (Me.current = 0), Me.current === 0 && Xe();
|
|
3469
|
+
}, [Xe]), et = C((e) => {
|
|
3401
3470
|
e.preventDefault(), e.stopPropagation(), Me.current++;
|
|
3402
|
-
}, []), tt =
|
|
3471
|
+
}, []), tt = C((e) => {
|
|
3403
3472
|
e.preventDefault(), e.stopPropagation();
|
|
3404
3473
|
let t = He.current, n = t.find((e) => e.i === q.i);
|
|
3405
|
-
Me.current = 0,
|
|
3474
|
+
Me.current = 0, Xe(), k(t, n, e.nativeEvent);
|
|
3406
3475
|
}, [
|
|
3407
3476
|
q.i,
|
|
3408
|
-
|
|
3477
|
+
Xe,
|
|
3409
3478
|
k
|
|
3410
|
-
]), nt =
|
|
3479
|
+
]), nt = C((e, t) => {
|
|
3411
3480
|
if (!e || !e.key) return null;
|
|
3412
|
-
let r =
|
|
3481
|
+
let r = _e(X, String(e.key));
|
|
3413
3482
|
if (!r) return null;
|
|
3414
|
-
let i = typeof r.isDraggable == "boolean" ? r.isDraggable : !r.static && B, a = typeof r.isResizable == "boolean" ? r.isResizable : !r.static &&
|
|
3415
|
-
return /* @__PURE__ */ (0, U.jsx)(
|
|
3483
|
+
let i = typeof r.isDraggable == "boolean" ? r.isDraggable : !r.static && B, a = typeof r.isResizable == "boolean" ? r.isResizable : !r.static && re, o = r.resizeHandles || [...ie], c = i && V && r.isBounded !== !1, u = ae;
|
|
3484
|
+
return /* @__PURE__ */ (0, U.jsx)(jt, {
|
|
3416
3485
|
containerWidth: n,
|
|
3417
3486
|
cols: F,
|
|
3418
3487
|
margin: R,
|
|
3419
|
-
containerPadding:
|
|
3488
|
+
containerPadding: ve,
|
|
3420
3489
|
maxRows: L,
|
|
3421
3490
|
rowHeight: I,
|
|
3422
3491
|
cancel: te,
|
|
@@ -3426,15 +3495,15 @@ function Ft(e) {
|
|
|
3426
3495
|
onDragStop: Ke,
|
|
3427
3496
|
onResizeStart: qe,
|
|
3428
3497
|
onResize: Je,
|
|
3429
|
-
onResizeStop:
|
|
3498
|
+
onResizeStop: Ye,
|
|
3430
3499
|
isDraggable: i,
|
|
3431
3500
|
isResizable: a,
|
|
3432
3501
|
isBounded: c,
|
|
3433
|
-
useCSSTransforms:
|
|
3434
|
-
usePercentages: !
|
|
3435
|
-
transformScale:
|
|
3502
|
+
useCSSTransforms: me && J,
|
|
3503
|
+
usePercentages: !J,
|
|
3504
|
+
transformScale: he,
|
|
3436
3505
|
positionStrategy: s,
|
|
3437
|
-
dragThreshold:
|
|
3506
|
+
dragThreshold: ne,
|
|
3438
3507
|
w: r.w,
|
|
3439
3508
|
h: r.h,
|
|
3440
3509
|
x: r.x,
|
|
@@ -3450,15 +3519,15 @@ function Ft(e) {
|
|
|
3450
3519
|
resizeHandle: u,
|
|
3451
3520
|
constraints: l,
|
|
3452
3521
|
layoutItem: r,
|
|
3453
|
-
layout:
|
|
3522
|
+
layout: X,
|
|
3454
3523
|
children: e
|
|
3455
3524
|
}, r.i);
|
|
3456
3525
|
}, [
|
|
3457
|
-
|
|
3526
|
+
X,
|
|
3458
3527
|
n,
|
|
3459
3528
|
F,
|
|
3460
3529
|
R,
|
|
3461
|
-
|
|
3530
|
+
ve,
|
|
3462
3531
|
L,
|
|
3463
3532
|
I,
|
|
3464
3533
|
te,
|
|
@@ -3468,76 +3537,76 @@ function Ft(e) {
|
|
|
3468
3537
|
Ke,
|
|
3469
3538
|
qe,
|
|
3470
3539
|
Je,
|
|
3471
|
-
|
|
3540
|
+
Ye,
|
|
3472
3541
|
B,
|
|
3473
|
-
|
|
3542
|
+
re,
|
|
3474
3543
|
V,
|
|
3475
|
-
|
|
3476
|
-
ye,
|
|
3544
|
+
me,
|
|
3477
3545
|
J,
|
|
3546
|
+
he,
|
|
3478
3547
|
s,
|
|
3479
|
-
|
|
3548
|
+
ne,
|
|
3480
3549
|
De,
|
|
3481
|
-
|
|
3482
|
-
|
|
3550
|
+
ie,
|
|
3551
|
+
ae,
|
|
3483
3552
|
l
|
|
3484
|
-
]), rt = () =>
|
|
3485
|
-
w:
|
|
3486
|
-
h:
|
|
3487
|
-
x:
|
|
3488
|
-
y:
|
|
3489
|
-
i:
|
|
3490
|
-
className: `react-grid-placeholder ${
|
|
3553
|
+
]), rt = () => $ ? /* @__PURE__ */ (0, U.jsx)(jt, {
|
|
3554
|
+
w: $.w,
|
|
3555
|
+
h: $.h,
|
|
3556
|
+
x: $.x,
|
|
3557
|
+
y: $.y,
|
|
3558
|
+
i: $.i,
|
|
3559
|
+
className: `react-grid-placeholder ${Ce ? "placeholder-resizing" : ""}`,
|
|
3491
3560
|
containerWidth: n,
|
|
3492
3561
|
cols: F,
|
|
3493
3562
|
margin: R,
|
|
3494
|
-
containerPadding:
|
|
3563
|
+
containerPadding: ve,
|
|
3495
3564
|
maxRows: L,
|
|
3496
3565
|
rowHeight: I,
|
|
3497
3566
|
isDraggable: !1,
|
|
3498
3567
|
isResizable: !1,
|
|
3499
3568
|
isBounded: !1,
|
|
3500
|
-
useCSSTransforms:
|
|
3501
|
-
transformScale:
|
|
3569
|
+
useCSSTransforms: me,
|
|
3570
|
+
transformScale: he,
|
|
3502
3571
|
constraints: l,
|
|
3503
|
-
layout:
|
|
3572
|
+
layout: X,
|
|
3504
3573
|
children: /* @__PURE__ */ (0, U.jsx)("div", {})
|
|
3505
3574
|
}) : null;
|
|
3506
3575
|
return /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
3507
3576
|
ref: h,
|
|
3508
|
-
className: ee(
|
|
3577
|
+
className: ee(Nt, p),
|
|
3509
3578
|
style: {
|
|
3510
3579
|
height: Ue,
|
|
3511
3580
|
...m
|
|
3512
3581
|
},
|
|
3513
|
-
onDrop:
|
|
3514
|
-
onDragLeave:
|
|
3515
|
-
onDragEnter:
|
|
3516
|
-
onDragOver:
|
|
3582
|
+
onDrop: W ? tt : void 0,
|
|
3583
|
+
onDragLeave: W ? $e : void 0,
|
|
3584
|
+
onDragEnter: W ? et : void 0,
|
|
3585
|
+
onDragOver: W ? Qe : void 0,
|
|
3517
3586
|
children: [
|
|
3518
|
-
|
|
3519
|
-
|
|
3587
|
+
x.Children.map(t, (e) => x.isValidElement(e) ? nt(e) : null),
|
|
3588
|
+
W && Te && nt(Te, !0),
|
|
3520
3589
|
rt()
|
|
3521
3590
|
]
|
|
3522
3591
|
});
|
|
3523
3592
|
}
|
|
3524
|
-
var
|
|
3593
|
+
var Rt = {
|
|
3525
3594
|
lg: 1200,
|
|
3526
3595
|
md: 996,
|
|
3527
3596
|
sm: 768,
|
|
3528
3597
|
xs: 480,
|
|
3529
3598
|
xxs: 0
|
|
3530
|
-
},
|
|
3599
|
+
}, zt = {
|
|
3531
3600
|
lg: 12,
|
|
3532
3601
|
md: 10,
|
|
3533
3602
|
sm: 6,
|
|
3534
3603
|
xs: 4,
|
|
3535
3604
|
xxs: 2
|
|
3536
|
-
},
|
|
3537
|
-
function
|
|
3605
|
+
}, Bt = () => {};
|
|
3606
|
+
function Vt(e, t, n, r) {
|
|
3538
3607
|
let i = [];
|
|
3539
|
-
|
|
3540
|
-
if (!
|
|
3608
|
+
x.Children.forEach(t, (t) => {
|
|
3609
|
+
if (!x.isValidElement(t) || t.key === null) return;
|
|
3541
3610
|
let n = String(t.key), r = e.find((e) => e.i === n);
|
|
3542
3611
|
if (r) i.push({
|
|
3543
3612
|
...r,
|
|
@@ -3563,36 +3632,36 @@ function zt(e, t, n, r) {
|
|
|
3563
3632
|
}) : i.push({
|
|
3564
3633
|
i: n,
|
|
3565
3634
|
x: 0,
|
|
3566
|
-
y:
|
|
3635
|
+
y: ge(i),
|
|
3567
3636
|
w: 1,
|
|
3568
3637
|
h: 1
|
|
3569
3638
|
});
|
|
3570
3639
|
}
|
|
3571
3640
|
});
|
|
3572
|
-
let a =
|
|
3641
|
+
let a = X(i, { cols: n });
|
|
3573
3642
|
return r.compact(a, n);
|
|
3574
3643
|
}
|
|
3575
|
-
function
|
|
3576
|
-
let { children: t, width: n, breakpoint: r, breakpoints: i =
|
|
3577
|
-
|
|
3644
|
+
function Ht(e) {
|
|
3645
|
+
let { children: t, width: n, breakpoint: r, breakpoints: i = Rt, cols: a = zt, layouts: o = {}, rowHeight: s = 150, maxRows: c = Infinity, margin: l = [10, 10], containerPadding: u = null, compactor: d, onBreakpointChange: f = Bt, onLayoutChange: p = Bt, onWidthChange: m = Bt, ...h } = e, g = d ?? Ze("vertical"), _ = g.type, v = g.allowOverlap, y = E(() => r ?? $e(i, n), []), b = E(() => et(y, a), [y, a]), x = E(() => tt(o, i, y, y, b, _), []), [S, w] = O(y), [k, A] = O(b), [j, M] = O(x), [N, P] = O(o), F = D(n), I = D(r), L = D(i), R = D(a), z = D(o), ee = D(_), B = D(N);
|
|
3646
|
+
T(() => {
|
|
3578
3647
|
B.current = N;
|
|
3579
3648
|
}, [N]);
|
|
3580
|
-
let V =
|
|
3649
|
+
let V = E(() => (0, At.deepEqual)(o, z.current) ? null : tt(o, i, S, S, k, g), [
|
|
3581
3650
|
o,
|
|
3582
3651
|
i,
|
|
3583
|
-
|
|
3652
|
+
S,
|
|
3584
3653
|
k,
|
|
3585
3654
|
g
|
|
3586
3655
|
]), H = V ?? j;
|
|
3587
|
-
|
|
3588
|
-
V !== null && (M(V), P(o), B.current = o,
|
|
3589
|
-
}, [V, o]),
|
|
3590
|
-
if (_ !==
|
|
3656
|
+
T(() => {
|
|
3657
|
+
V !== null && (M(V), P(o), B.current = o, z.current = o);
|
|
3658
|
+
}, [V, o]), T(() => {
|
|
3659
|
+
if (_ !== ee.current) {
|
|
3591
3660
|
let e = g.compact(J(H), k), t = {
|
|
3592
3661
|
...B.current,
|
|
3593
|
-
[
|
|
3662
|
+
[S]: e
|
|
3594
3663
|
};
|
|
3595
|
-
M(e), P(t), B.current = t, p(e, t),
|
|
3664
|
+
M(e), P(t), B.current = t, p(e, t), ee.current = _;
|
|
3596
3665
|
}
|
|
3597
3666
|
}, [
|
|
3598
3667
|
_,
|
|
@@ -3600,26 +3669,26 @@ function Bt(e) {
|
|
|
3600
3669
|
H,
|
|
3601
3670
|
k,
|
|
3602
3671
|
v,
|
|
3603
|
-
|
|
3672
|
+
S,
|
|
3604
3673
|
p
|
|
3605
|
-
]),
|
|
3606
|
-
let e = n !== F.current, o = r !== I.current, s = !(0,
|
|
3674
|
+
]), T(() => {
|
|
3675
|
+
let e = n !== F.current, o = r !== I.current, s = !(0, At.deepEqual)(i, L.current), c = !(0, At.deepEqual)(a, R.current);
|
|
3607
3676
|
if (e || o || s || c) {
|
|
3608
|
-
let e = r ??
|
|
3677
|
+
let e = r ?? $e(i, n), o = et(e, a), d = S;
|
|
3609
3678
|
if (d !== e || s || c) {
|
|
3610
3679
|
let n = { ...B.current };
|
|
3611
3680
|
n[d] || (n[d] = J(j));
|
|
3612
|
-
let r =
|
|
3613
|
-
r =
|
|
3681
|
+
let r = tt(n, i, e, d, o, g);
|
|
3682
|
+
r = Vt(r, t, o, g), n[e] = r, w(e), A(o), M(r), P(n), B.current = n, f(e, o), p(r, n);
|
|
3614
3683
|
}
|
|
3615
|
-
m(n,
|
|
3684
|
+
m(n, nt(l, e), o, u ? nt(u, e) : null), F.current = n, I.current = r, L.current = i, R.current = a;
|
|
3616
3685
|
}
|
|
3617
3686
|
}, [
|
|
3618
3687
|
n,
|
|
3619
3688
|
r,
|
|
3620
3689
|
i,
|
|
3621
3690
|
a,
|
|
3622
|
-
|
|
3691
|
+
S,
|
|
3623
3692
|
k,
|
|
3624
3693
|
j,
|
|
3625
3694
|
t,
|
|
@@ -3632,29 +3701,29 @@ function Bt(e) {
|
|
|
3632
3701
|
p,
|
|
3633
3702
|
m
|
|
3634
3703
|
]);
|
|
3635
|
-
let te =
|
|
3704
|
+
let te = C((e) => {
|
|
3636
3705
|
let t = {
|
|
3637
3706
|
...B.current,
|
|
3638
|
-
[
|
|
3707
|
+
[S]: e
|
|
3639
3708
|
};
|
|
3640
3709
|
M(e), P(t), B.current = t, p(e, t);
|
|
3641
|
-
}, [
|
|
3710
|
+
}, [S, p]), ne = E(() => nt(l, S), [l, S]), re = E(() => u === null ? null : nt(u, S), [u, S]), ie = E(() => ({
|
|
3642
3711
|
cols: k,
|
|
3643
3712
|
rowHeight: s,
|
|
3644
3713
|
maxRows: c,
|
|
3645
|
-
margin:
|
|
3646
|
-
containerPadding:
|
|
3714
|
+
margin: ne,
|
|
3715
|
+
containerPadding: re
|
|
3647
3716
|
}), [
|
|
3648
3717
|
k,
|
|
3649
3718
|
s,
|
|
3650
3719
|
c,
|
|
3651
|
-
|
|
3652
|
-
|
|
3720
|
+
ne,
|
|
3721
|
+
re
|
|
3653
3722
|
]);
|
|
3654
|
-
return /* @__PURE__ */ (0, U.jsx)(
|
|
3723
|
+
return /* @__PURE__ */ (0, U.jsx)(Lt, {
|
|
3655
3724
|
...h,
|
|
3656
3725
|
width: n,
|
|
3657
|
-
gridConfig:
|
|
3726
|
+
gridConfig: ie,
|
|
3658
3727
|
compactor: g,
|
|
3659
3728
|
onLayoutChange: te,
|
|
3660
3729
|
layout: H,
|
|
@@ -3663,9 +3732,9 @@ function Bt(e) {
|
|
|
3663
3732
|
}
|
|
3664
3733
|
//#endregion
|
|
3665
3734
|
//#region src/DashboardGridLayout.tsx
|
|
3666
|
-
function
|
|
3667
|
-
let t =
|
|
3668
|
-
return
|
|
3735
|
+
function Ut({ editMode: e }) {
|
|
3736
|
+
let t = o();
|
|
3737
|
+
return b.useEffect(() => {
|
|
3669
3738
|
if (e) return t.startDrag({
|
|
3670
3739
|
id: "dashboard-layout",
|
|
3671
3740
|
type: "dashboard-widget",
|
|
@@ -3676,17 +3745,17 @@ function Vt({ editMode: e }) {
|
|
|
3676
3745
|
t.endDrag("dashboard");
|
|
3677
3746
|
}, [e, t]), null;
|
|
3678
3747
|
}
|
|
3679
|
-
var
|
|
3748
|
+
var Wt = [
|
|
3680
3749
|
"hsl(var(--chart-1))",
|
|
3681
3750
|
"hsl(var(--chart-2))",
|
|
3682
3751
|
"hsl(var(--chart-3))",
|
|
3683
3752
|
"hsl(var(--chart-4))",
|
|
3684
3753
|
"hsl(var(--chart-5))"
|
|
3685
|
-
],
|
|
3686
|
-
let { width:
|
|
3687
|
-
a && (
|
|
3754
|
+
], Gt = ({ schema: e, className: t, onLayoutChange: r, persistLayoutKey: i = "dashboard-layout", onRefresh: a }) => {
|
|
3755
|
+
let { width: o, containerRef: p, mounted: m } = it(), [h, g] = b.useState(!1), [v, y] = b.useState(!1), x = s(), S = b.useRef(null), C = b.useCallback(() => {
|
|
3756
|
+
a && (y(!0), a(), setTimeout(() => y(!1), 600));
|
|
3688
3757
|
}, [a]);
|
|
3689
|
-
|
|
3758
|
+
b.useEffect(() => {
|
|
3690
3759
|
if (!(!e.refreshInterval || e.refreshInterval <= 0 || !a)) return S.current = setInterval(C, e.refreshInterval * 1e3), () => {
|
|
3691
3760
|
S.current && clearInterval(S.current);
|
|
3692
3761
|
};
|
|
@@ -3695,7 +3764,7 @@ var Ht = [
|
|
|
3695
3764
|
a,
|
|
3696
3765
|
C
|
|
3697
3766
|
]);
|
|
3698
|
-
let [w, T] =
|
|
3767
|
+
let [w, T] = b.useState(() => {
|
|
3699
3768
|
if (typeof window < "u" && i) {
|
|
3700
3769
|
let e = localStorage.getItem(i);
|
|
3701
3770
|
if (e) try {
|
|
@@ -3711,11 +3780,11 @@ var Ht = [
|
|
|
3711
3780
|
w: e.layout?.w || 3,
|
|
3712
3781
|
h: e.layout?.h || 4
|
|
3713
3782
|
})) || [] };
|
|
3714
|
-
}), E =
|
|
3783
|
+
}), E = b.useCallback((e, t) => {
|
|
3715
3784
|
T(t), r?.(e);
|
|
3716
|
-
}, [r]), D =
|
|
3717
|
-
typeof window < "u" && i && localStorage.setItem(i, JSON.stringify(w)),
|
|
3718
|
-
}, [w, i]), O =
|
|
3785
|
+
}, [r]), D = b.useCallback(() => {
|
|
3786
|
+
typeof window < "u" && i && localStorage.setItem(i, JSON.stringify(w)), g(!1);
|
|
3787
|
+
}, [w, i]), O = b.useCallback(() => {
|
|
3719
3788
|
T({ lg: e.widgets?.map((e, t) => ({
|
|
3720
3789
|
i: e.id || `widget-${t}`,
|
|
3721
3790
|
x: e.layout?.x || t % 4 * 3,
|
|
@@ -3723,12 +3792,12 @@ var Ht = [
|
|
|
3723
3792
|
w: e.layout?.w || 3,
|
|
3724
3793
|
h: e.layout?.h || 4
|
|
3725
3794
|
})) || [] }), typeof window < "u" && i && localStorage.removeItem(i);
|
|
3726
|
-
}, [e.widgets, i]), k =
|
|
3795
|
+
}, [e.widgets, i]), k = b.useCallback((e) => {
|
|
3727
3796
|
if (e.component) return e.component;
|
|
3728
3797
|
let t = e.type, n = e.options || {};
|
|
3729
3798
|
if (t === "bar" || t === "line" || t === "area" || t === "pie" || t === "donut" || t === "scatter") {
|
|
3730
3799
|
let r = e.data || n.data, i = e.categoryField || n.xField || "name", a = e.valueField || n.yField || "value";
|
|
3731
|
-
if (
|
|
3800
|
+
if (H(r)) {
|
|
3732
3801
|
let n = r.aggregate, o = n ? {
|
|
3733
3802
|
field: e.valueField || n.field,
|
|
3734
3803
|
function: e.aggregate || n.function,
|
|
@@ -3741,7 +3810,7 @@ var Ht = [
|
|
|
3741
3810
|
aggregate: o,
|
|
3742
3811
|
xAxisKey: i,
|
|
3743
3812
|
series: [{ dataKey: s }],
|
|
3744
|
-
colors:
|
|
3813
|
+
colors: Wt,
|
|
3745
3814
|
className: "h-full"
|
|
3746
3815
|
};
|
|
3747
3816
|
}
|
|
@@ -3758,7 +3827,7 @@ var Ht = [
|
|
|
3758
3827
|
aggregate: n,
|
|
3759
3828
|
xAxisKey: i,
|
|
3760
3829
|
series: [{ dataKey: e.valueField || "value" }],
|
|
3761
|
-
colors:
|
|
3830
|
+
colors: Wt,
|
|
3762
3831
|
className: "h-full"
|
|
3763
3832
|
};
|
|
3764
3833
|
}
|
|
@@ -3768,13 +3837,13 @@ var Ht = [
|
|
|
3768
3837
|
data: Array.isArray(r) ? r : r?.items || [],
|
|
3769
3838
|
xAxisKey: i,
|
|
3770
3839
|
series: [{ dataKey: a }],
|
|
3771
|
-
colors:
|
|
3840
|
+
colors: Wt,
|
|
3772
3841
|
className: "h-full"
|
|
3773
3842
|
};
|
|
3774
3843
|
}
|
|
3775
3844
|
if (t === "table") {
|
|
3776
3845
|
let t = e.data || n.data;
|
|
3777
|
-
if (
|
|
3846
|
+
if (H(t)) {
|
|
3778
3847
|
let { data: r, ...i } = n;
|
|
3779
3848
|
return {
|
|
3780
3849
|
type: "data-table",
|
|
@@ -3806,7 +3875,7 @@ var Ht = [
|
|
|
3806
3875
|
}
|
|
3807
3876
|
if (t === "pivot") {
|
|
3808
3877
|
let t = e.data || n.data;
|
|
3809
|
-
if (
|
|
3878
|
+
if (H(t)) {
|
|
3810
3879
|
let { data: r, ...i } = n;
|
|
3811
3880
|
return {
|
|
3812
3881
|
type: "pivot",
|
|
@@ -3829,10 +3898,10 @@ var Ht = [
|
|
|
3829
3898
|
}, []);
|
|
3830
3899
|
return /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
3831
3900
|
ref: p,
|
|
3832
|
-
className:
|
|
3901
|
+
className: _("w-full", t),
|
|
3833
3902
|
"data-testid": "grid-layout",
|
|
3834
3903
|
children: [
|
|
3835
|
-
x && /* @__PURE__ */ (0, U.jsx)(
|
|
3904
|
+
x && /* @__PURE__ */ (0, U.jsx)(Ut, { editMode: h }),
|
|
3836
3905
|
/* @__PURE__ */ (0, U.jsxs)("div", {
|
|
3837
3906
|
className: "mb-4 flex items-center justify-between",
|
|
3838
3907
|
children: [/* @__PURE__ */ (0, U.jsx)("h2", {
|
|
@@ -3841,42 +3910,42 @@ var Ht = [
|
|
|
3841
3910
|
}), /* @__PURE__ */ (0, U.jsx)("div", {
|
|
3842
3911
|
className: "flex gap-2",
|
|
3843
3912
|
children: h ? /* @__PURE__ */ (0, U.jsxs)(U.Fragment, { children: [
|
|
3844
|
-
/* @__PURE__ */ (0, U.jsxs)(
|
|
3913
|
+
/* @__PURE__ */ (0, U.jsxs)(c, {
|
|
3845
3914
|
onClick: D,
|
|
3846
3915
|
size: "sm",
|
|
3847
3916
|
variant: "default",
|
|
3848
|
-
children: [/* @__PURE__ */ (0, U.jsx)(
|
|
3917
|
+
children: [/* @__PURE__ */ (0, U.jsx)(L, { className: "h-4 w-4 mr-2" }), "Save Layout"]
|
|
3849
3918
|
}),
|
|
3850
|
-
/* @__PURE__ */ (0, U.jsxs)(
|
|
3919
|
+
/* @__PURE__ */ (0, U.jsxs)(c, {
|
|
3851
3920
|
onClick: O,
|
|
3852
3921
|
size: "sm",
|
|
3853
3922
|
variant: "outline",
|
|
3854
|
-
children: [/* @__PURE__ */ (0, U.jsx)(
|
|
3923
|
+
children: [/* @__PURE__ */ (0, U.jsx)(z, { className: "h-4 w-4 mr-2" }), "Reset"]
|
|
3855
3924
|
}),
|
|
3856
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
3857
|
-
onClick: () =>
|
|
3925
|
+
/* @__PURE__ */ (0, U.jsx)(c, {
|
|
3926
|
+
onClick: () => g(!1),
|
|
3858
3927
|
size: "sm",
|
|
3859
3928
|
variant: "ghost",
|
|
3860
3929
|
children: "Cancel"
|
|
3861
3930
|
})
|
|
3862
|
-
] }) : /* @__PURE__ */ (0, U.jsxs)(U.Fragment, { children: [a && /* @__PURE__ */ (0, U.jsxs)(
|
|
3931
|
+
] }) : /* @__PURE__ */ (0, U.jsxs)(U.Fragment, { children: [a && /* @__PURE__ */ (0, U.jsxs)(c, {
|
|
3863
3932
|
onClick: C,
|
|
3864
3933
|
size: "sm",
|
|
3865
3934
|
variant: "outline",
|
|
3866
|
-
disabled:
|
|
3935
|
+
disabled: v,
|
|
3867
3936
|
"aria-label": "Refresh dashboard",
|
|
3868
|
-
children: [/* @__PURE__ */ (0, U.jsx)(
|
|
3869
|
-
}), /* @__PURE__ */ (0, U.jsxs)(
|
|
3870
|
-
onClick: () =>
|
|
3937
|
+
children: [/* @__PURE__ */ (0, U.jsx)(I, { className: _("h-4 w-4 mr-2", v && "animate-spin") }), v ? "Refreshing…" : "Refresh All"]
|
|
3938
|
+
}), /* @__PURE__ */ (0, U.jsxs)(c, {
|
|
3939
|
+
onClick: () => g(!0),
|
|
3871
3940
|
size: "sm",
|
|
3872
3941
|
variant: "outline",
|
|
3873
|
-
children: [/* @__PURE__ */ (0, U.jsx)(
|
|
3942
|
+
children: [/* @__PURE__ */ (0, U.jsx)(M, { className: "h-4 w-4 mr-2" }), "Edit Layout"]
|
|
3874
3943
|
})] })
|
|
3875
3944
|
})]
|
|
3876
3945
|
}),
|
|
3877
|
-
m && /* @__PURE__ */ (0, U.jsx)(
|
|
3946
|
+
m && /* @__PURE__ */ (0, U.jsx)(Ht, {
|
|
3878
3947
|
className: "layout",
|
|
3879
|
-
width:
|
|
3948
|
+
width: o,
|
|
3880
3949
|
layouts: w,
|
|
3881
3950
|
breakpoints: {
|
|
3882
3951
|
lg: 1200,
|
|
@@ -3907,27 +3976,27 @@ var Ht = [
|
|
|
3907
3976
|
className: "h-full w-full relative",
|
|
3908
3977
|
children: [h && /* @__PURE__ */ (0, U.jsx)("div", {
|
|
3909
3978
|
className: "drag-handle absolute top-2 right-2 z-10 cursor-move p-1 bg-background/80 rounded border border-border",
|
|
3910
|
-
children: /* @__PURE__ */ (0, U.jsx)(
|
|
3979
|
+
children: /* @__PURE__ */ (0, U.jsx)(N, { className: "h-4 w-4" })
|
|
3911
3980
|
}), /* @__PURE__ */ (0, U.jsx)(n, {
|
|
3912
3981
|
schema: i,
|
|
3913
3982
|
className: "h-full w-full"
|
|
3914
3983
|
})]
|
|
3915
|
-
}) : /* @__PURE__ */ (0, U.jsxs)(
|
|
3916
|
-
className:
|
|
3917
|
-
children: [e.title && /* @__PURE__ */ (0, U.jsxs)(
|
|
3984
|
+
}) : /* @__PURE__ */ (0, U.jsxs)(l, {
|
|
3985
|
+
className: _("h-full overflow-hidden border-border/50 shadow-sm transition-all", "bg-card/50 backdrop-blur-sm", h && "ring-2 ring-primary/20"),
|
|
3986
|
+
children: [e.title && /* @__PURE__ */ (0, U.jsxs)(d, {
|
|
3918
3987
|
className: "pb-2 border-b border-border/40 bg-muted/20 flex flex-row items-center justify-between",
|
|
3919
|
-
children: [/* @__PURE__ */ (0, U.jsx)(
|
|
3988
|
+
children: [/* @__PURE__ */ (0, U.jsx)(f, {
|
|
3920
3989
|
className: "text-base font-medium tracking-tight truncate",
|
|
3921
3990
|
title: e.title,
|
|
3922
3991
|
children: e.title
|
|
3923
3992
|
}), h && /* @__PURE__ */ (0, U.jsx)("div", {
|
|
3924
3993
|
className: "drag-handle cursor-move p-1 hover:bg-muted/40 rounded",
|
|
3925
|
-
children: /* @__PURE__ */ (0, U.jsx)(
|
|
3994
|
+
children: /* @__PURE__ */ (0, U.jsx)(N, { className: "h-4 w-4" })
|
|
3926
3995
|
})]
|
|
3927
|
-
}), /* @__PURE__ */ (0, U.jsx)(
|
|
3996
|
+
}), /* @__PURE__ */ (0, U.jsx)(u, {
|
|
3928
3997
|
className: "p-0 h-full",
|
|
3929
3998
|
children: /* @__PURE__ */ (0, U.jsx)("div", {
|
|
3930
|
-
className:
|
|
3999
|
+
className: _("h-full w-full overflow-auto p-4"),
|
|
3931
4000
|
children: /* @__PURE__ */ (0, U.jsx)(n, { schema: i })
|
|
3932
4001
|
})
|
|
3933
4002
|
})]
|
|
@@ -3940,33 +4009,42 @@ var Ht = [
|
|
|
3940
4009
|
};
|
|
3941
4010
|
//#endregion
|
|
3942
4011
|
//#region src/MetricWidget.tsx
|
|
3943
|
-
function
|
|
4012
|
+
function Kt(e) {
|
|
3944
4013
|
if (e != null) return typeof e == "string" ? e : e.defaultValue || e.key;
|
|
3945
4014
|
}
|
|
3946
|
-
var
|
|
3947
|
-
|
|
4015
|
+
var qt = {
|
|
4016
|
+
default: "bg-muted text-muted-foreground",
|
|
4017
|
+
blue: "bg-blue-500/10 text-blue-600 dark:text-blue-400",
|
|
4018
|
+
teal: "bg-teal-500/10 text-teal-600 dark:text-teal-400",
|
|
4019
|
+
orange: "bg-orange-500/10 text-orange-600 dark:text-orange-400",
|
|
4020
|
+
purple: "bg-purple-500/10 text-purple-600 dark:text-purple-400",
|
|
4021
|
+
success: "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",
|
|
4022
|
+
warning: "bg-amber-500/10 text-amber-600 dark:text-amber-400",
|
|
4023
|
+
danger: "bg-rose-500/10 text-rose-600 dark:text-rose-400"
|
|
4024
|
+
}, Jt = ({ label: e, value: t, trend: n, icon: r, className: i, description: a, loading: o, error: s, colorVariant: c = "default", ...p }) => {
|
|
4025
|
+
let m = qt[c] || qt.default, h = E(() => {
|
|
3948
4026
|
if (typeof r == "string") {
|
|
3949
|
-
let e =
|
|
3950
|
-
return e ? /* @__PURE__ */ (0, U.jsx)(e, { className: "h-4 w-4
|
|
4027
|
+
let e = v(r);
|
|
4028
|
+
return e ? /* @__PURE__ */ (0, U.jsx)(e, { className: "h-4 w-4" }) : null;
|
|
3951
4029
|
}
|
|
3952
4030
|
return r;
|
|
3953
4031
|
}, [r]);
|
|
3954
|
-
return /* @__PURE__ */ (0, U.jsxs)(
|
|
3955
|
-
className:
|
|
3956
|
-
...
|
|
3957
|
-
children: [/* @__PURE__ */ (0, U.jsxs)(
|
|
4032
|
+
return /* @__PURE__ */ (0, U.jsxs)(l, {
|
|
4033
|
+
className: _("h-full overflow-hidden", i),
|
|
4034
|
+
...p,
|
|
4035
|
+
children: [/* @__PURE__ */ (0, U.jsxs)(d, {
|
|
3958
4036
|
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
3959
|
-
children: [/* @__PURE__ */ (0, U.jsx)(
|
|
4037
|
+
children: [/* @__PURE__ */ (0, U.jsx)(f, {
|
|
3960
4038
|
className: "text-sm font-medium truncate",
|
|
3961
|
-
children:
|
|
3962
|
-
}),
|
|
3963
|
-
className: "h-
|
|
3964
|
-
children:
|
|
4039
|
+
children: Kt(e)
|
|
4040
|
+
}), h && /* @__PURE__ */ (0, U.jsx)("div", {
|
|
4041
|
+
className: _("flex h-8 w-8 items-center justify-center rounded-md shrink-0", m),
|
|
4042
|
+
children: h
|
|
3965
4043
|
})]
|
|
3966
|
-
}), /* @__PURE__ */ (0, U.jsx)(
|
|
4044
|
+
}), /* @__PURE__ */ (0, U.jsx)(u, { children: o ? /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
3967
4045
|
className: "flex items-center gap-2 text-muted-foreground",
|
|
3968
4046
|
"data-testid": "metric-loading",
|
|
3969
|
-
children: [/* @__PURE__ */ (0, U.jsx)(
|
|
4047
|
+
children: [/* @__PURE__ */ (0, U.jsx)(P, { className: "h-4 w-4 animate-spin" }), /* @__PURE__ */ (0, U.jsx)("span", {
|
|
3970
4048
|
className: "text-sm",
|
|
3971
4049
|
children: "Loading…"
|
|
3972
4050
|
})]
|
|
@@ -3974,7 +4052,7 @@ var Gt = ({ label: e, value: t, trend: n, icon: r, className: i, description: a,
|
|
|
3974
4052
|
className: "flex items-center gap-2",
|
|
3975
4053
|
"data-testid": "metric-error",
|
|
3976
4054
|
role: "alert",
|
|
3977
|
-
children: [/* @__PURE__ */ (0, U.jsx)(
|
|
4055
|
+
children: [/* @__PURE__ */ (0, U.jsx)(k, { className: "h-4 w-4 text-destructive shrink-0" }), /* @__PURE__ */ (0, U.jsx)("span", {
|
|
3978
4056
|
className: "text-xs text-destructive truncate",
|
|
3979
4057
|
children: s
|
|
3980
4058
|
})]
|
|
@@ -3984,51 +4062,51 @@ var Gt = ({ label: e, value: t, trend: n, icon: r, className: i, description: a,
|
|
|
3984
4062
|
}), (n || a) && /* @__PURE__ */ (0, U.jsxs)("p", {
|
|
3985
4063
|
className: "text-xs text-muted-foreground flex items-center mt-1 truncate",
|
|
3986
4064
|
children: [n && /* @__PURE__ */ (0, U.jsxs)("span", {
|
|
3987
|
-
className:
|
|
4065
|
+
className: _("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"),
|
|
3988
4066
|
children: [
|
|
3989
|
-
n.direction === "up" && /* @__PURE__ */ (0, U.jsx)(
|
|
3990
|
-
n.direction === "down" && /* @__PURE__ */ (0, U.jsx)(
|
|
3991
|
-
n.direction === "neutral" && /* @__PURE__ */ (0, U.jsx)(
|
|
4067
|
+
n.direction === "up" && /* @__PURE__ */ (0, U.jsx)(j, { className: "h-3 w-3 mr-1" }),
|
|
4068
|
+
n.direction === "down" && /* @__PURE__ */ (0, U.jsx)(A, { className: "h-3 w-3 mr-1" }),
|
|
4069
|
+
n.direction === "neutral" && /* @__PURE__ */ (0, U.jsx)(F, { className: "h-3 w-3 mr-1" }),
|
|
3992
4070
|
n.value,
|
|
3993
4071
|
"%"
|
|
3994
4072
|
]
|
|
3995
4073
|
}), /* @__PURE__ */ (0, U.jsx)("span", {
|
|
3996
4074
|
className: "truncate",
|
|
3997
|
-
children:
|
|
4075
|
+
children: Kt(a) || Kt(n?.label)
|
|
3998
4076
|
})]
|
|
3999
4077
|
})] }) })]
|
|
4000
4078
|
});
|
|
4001
4079
|
};
|
|
4002
4080
|
//#endregion
|
|
4003
4081
|
//#region src/MetricCard.tsx
|
|
4004
|
-
function
|
|
4082
|
+
function Yt(e) {
|
|
4005
4083
|
if (e != null) return typeof e == "string" ? e : e.defaultValue || e.key;
|
|
4006
4084
|
}
|
|
4007
|
-
var
|
|
4008
|
-
let m = n
|
|
4009
|
-
return /* @__PURE__ */ (0, U.jsxs)(
|
|
4010
|
-
className:
|
|
4085
|
+
var Xt = ({ title: e, value: t, icon: n, trend: r, trendValue: i, description: a, className: o, loading: s, error: c, ...p }) => {
|
|
4086
|
+
let m = n ? v(n) : null;
|
|
4087
|
+
return /* @__PURE__ */ (0, U.jsxs)(l, {
|
|
4088
|
+
className: _("h-full", o),
|
|
4011
4089
|
...p,
|
|
4012
|
-
children: [/* @__PURE__ */ (0, U.jsxs)(
|
|
4090
|
+
children: [/* @__PURE__ */ (0, U.jsxs)(d, {
|
|
4013
4091
|
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
4014
|
-
children: [/* @__PURE__ */ (0, U.jsx)(
|
|
4092
|
+
children: [/* @__PURE__ */ (0, U.jsx)(f, {
|
|
4015
4093
|
className: "text-sm font-medium",
|
|
4016
|
-
children:
|
|
4094
|
+
children: Yt(e)
|
|
4017
4095
|
}), m && /* @__PURE__ */ (0, U.jsx)(m, { className: "h-4 w-4 text-muted-foreground" })]
|
|
4018
|
-
}), /* @__PURE__ */ (0, U.jsx)(
|
|
4096
|
+
}), /* @__PURE__ */ (0, U.jsx)(u, { children: s ? /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
4019
4097
|
className: "flex items-center gap-2 text-muted-foreground",
|
|
4020
4098
|
"data-testid": "metric-card-loading",
|
|
4021
|
-
children: [/* @__PURE__ */ (0, U.jsx)(
|
|
4099
|
+
children: [/* @__PURE__ */ (0, U.jsx)(P, { className: "h-4 w-4 animate-spin" }), /* @__PURE__ */ (0, U.jsx)("span", {
|
|
4022
4100
|
className: "text-sm",
|
|
4023
4101
|
children: "Loading…"
|
|
4024
4102
|
})]
|
|
4025
|
-
}) :
|
|
4103
|
+
}) : c ? /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
4026
4104
|
className: "flex items-center gap-2",
|
|
4027
4105
|
"data-testid": "metric-card-error",
|
|
4028
4106
|
role: "alert",
|
|
4029
|
-
children: [/* @__PURE__ */ (0, U.jsx)(
|
|
4107
|
+
children: [/* @__PURE__ */ (0, U.jsx)(k, { className: "h-4 w-4 text-destructive shrink-0" }), /* @__PURE__ */ (0, U.jsx)("span", {
|
|
4030
4108
|
className: "text-xs text-destructive truncate",
|
|
4031
|
-
children:
|
|
4109
|
+
children: c
|
|
4032
4110
|
})]
|
|
4033
4111
|
}) : /* @__PURE__ */ (0, U.jsxs)(U.Fragment, { children: [/* @__PURE__ */ (0, U.jsx)("div", {
|
|
4034
4112
|
className: "text-2xl font-bold",
|
|
@@ -4036,20 +4114,20 @@ var qt = ({ title: e, value: t, icon: n, trend: r, trendValue: i, description: a
|
|
|
4036
4114
|
}), (r || i || a) && /* @__PURE__ */ (0, U.jsxs)("p", {
|
|
4037
4115
|
className: "text-xs text-muted-foreground flex items-center mt-1",
|
|
4038
4116
|
children: [r && i && /* @__PURE__ */ (0, U.jsxs)("span", {
|
|
4039
|
-
className:
|
|
4117
|
+
className: _("flex items-center mr-2", r === "up" && "text-green-500", r === "down" && "text-red-500", r === "neutral" && "text-yellow-500"),
|
|
4040
4118
|
children: [
|
|
4041
|
-
r === "up" && /* @__PURE__ */ (0, U.jsx)(
|
|
4042
|
-
r === "down" && /* @__PURE__ */ (0, U.jsx)(
|
|
4043
|
-
r === "neutral" && /* @__PURE__ */ (0, U.jsx)(
|
|
4119
|
+
r === "up" && /* @__PURE__ */ (0, U.jsx)(j, { className: "h-3 w-3 mr-1" }),
|
|
4120
|
+
r === "down" && /* @__PURE__ */ (0, U.jsx)(A, { className: "h-3 w-3 mr-1" }),
|
|
4121
|
+
r === "neutral" && /* @__PURE__ */ (0, U.jsx)(F, { className: "h-3 w-3 mr-1" }),
|
|
4044
4122
|
i
|
|
4045
4123
|
]
|
|
4046
|
-
}),
|
|
4124
|
+
}), Yt(a)]
|
|
4047
4125
|
})] }) })]
|
|
4048
4126
|
});
|
|
4049
|
-
},
|
|
4050
|
-
let
|
|
4127
|
+
}, Zt = ({ objectName: e, aggregate: t, filter: n, label: i, fallbackValue: a, trend: o, icon: s, className: c, description: l, dataSource: u, colorVariant: d }) => {
|
|
4128
|
+
let f = w(r), p = u || f?.dataSource, [m, h] = O(null), [g, _] = O(!1), [v, y] = O(null), b = C(async (r, i) => {
|
|
4051
4129
|
if (!(!r || !e)) {
|
|
4052
|
-
i.current && (
|
|
4130
|
+
i.current && (_(!0), y(null));
|
|
4053
4131
|
try {
|
|
4054
4132
|
let a;
|
|
4055
4133
|
if (t && typeof r.aggregate == "function") {
|
|
@@ -4064,11 +4142,11 @@ var qt = ({ title: e, value: t, icon: n, trend: r, trendValue: i, description: a
|
|
|
4064
4142
|
let t = await r.find(e, { $filter: n });
|
|
4065
4143
|
a = (Array.isArray(t) ? t : t?.data || t?.records || []).length;
|
|
4066
4144
|
} else return;
|
|
4067
|
-
i.current &&
|
|
4145
|
+
i.current && h(a);
|
|
4068
4146
|
} catch (e) {
|
|
4069
|
-
console.error("[ObjectMetricWidget] Fetch error:", e), i.current &&
|
|
4147
|
+
console.error("[ObjectMetricWidget] Fetch error:", e), i.current && y(e instanceof Error ? e.message : "Failed to load metric");
|
|
4070
4148
|
} finally {
|
|
4071
|
-
i.current &&
|
|
4149
|
+
i.current && _(!1);
|
|
4072
4150
|
}
|
|
4073
4151
|
}
|
|
4074
4152
|
}, [
|
|
@@ -4076,29 +4154,30 @@ var qt = ({ title: e, value: t, icon: n, trend: r, trendValue: i, description: a
|
|
|
4076
4154
|
t,
|
|
4077
4155
|
n
|
|
4078
4156
|
]);
|
|
4079
|
-
return
|
|
4157
|
+
return T(() => {
|
|
4080
4158
|
let t = { current: !0 };
|
|
4081
|
-
return
|
|
4159
|
+
return p && e ? b(p, t) : (h(null), y(null)), () => {
|
|
4082
4160
|
t.current = !1;
|
|
4083
4161
|
};
|
|
4084
4162
|
}, [
|
|
4085
|
-
|
|
4163
|
+
p,
|
|
4086
4164
|
e,
|
|
4087
|
-
|
|
4088
|
-
]), /* @__PURE__ */ (0, U.jsx)(
|
|
4165
|
+
b
|
|
4166
|
+
]), /* @__PURE__ */ (0, U.jsx)(Jt, {
|
|
4089
4167
|
label: i,
|
|
4090
|
-
value:
|
|
4168
|
+
value: m === null ? p ? "—" : a ?? "—" : m,
|
|
4091
4169
|
trend: o,
|
|
4092
4170
|
icon: s,
|
|
4093
4171
|
className: c,
|
|
4094
4172
|
description: l,
|
|
4095
|
-
loading:
|
|
4096
|
-
error:
|
|
4173
|
+
loading: g,
|
|
4174
|
+
error: v,
|
|
4175
|
+
colorVariant: d
|
|
4097
4176
|
});
|
|
4098
4177
|
};
|
|
4099
4178
|
//#endregion
|
|
4100
4179
|
//#region src/PivotTable.tsx
|
|
4101
|
-
function
|
|
4180
|
+
function Qt(e, t) {
|
|
4102
4181
|
if (!t) return String(e);
|
|
4103
4182
|
let n = "", r = "", i = !1, a, o = t, s = o.match(/^([^0-9.,#]*)/);
|
|
4104
4183
|
if (s && s[1]) {
|
|
@@ -4115,7 +4194,7 @@ function Yt(e, t) {
|
|
|
4115
4194
|
}
|
|
4116
4195
|
return n + l + r;
|
|
4117
4196
|
}
|
|
4118
|
-
function
|
|
4197
|
+
function $t(e, t) {
|
|
4119
4198
|
if (e.length === 0) return 0;
|
|
4120
4199
|
switch (t) {
|
|
4121
4200
|
case "sum": return e.reduce((e, t) => e + t, 0);
|
|
@@ -4126,8 +4205,8 @@ function Xt(e, t) {
|
|
|
4126
4205
|
default: return e.reduce((e, t) => e + t, 0);
|
|
4127
4206
|
}
|
|
4128
4207
|
}
|
|
4129
|
-
var
|
|
4130
|
-
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:
|
|
4208
|
+
var en = ({ schema: e, className: t }) => {
|
|
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: v, grandTotal: y } = E(() => {
|
|
4131
4210
|
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = {};
|
|
4132
4211
|
for (let o of f) {
|
|
4133
4212
|
let s = String(o[r] ?? ""), c = String(o[i] ?? ""), l = Number(o[a]) || 0;
|
|
@@ -4138,10 +4217,10 @@ var Zt = ({ schema: e, className: t }) => {
|
|
|
4138
4217
|
l[e] = {};
|
|
4139
4218
|
let t = [];
|
|
4140
4219
|
for (let r of c) {
|
|
4141
|
-
let i = n[e]?.[r] ?? [], a =
|
|
4220
|
+
let i = n[e]?.[r] ?? [], a = $t(i, o);
|
|
4142
4221
|
l[e][r] = a, t.push(...i), !d[r] && d[r];
|
|
4143
4222
|
}
|
|
4144
|
-
u[e] =
|
|
4223
|
+
u[e] = $t(t, o);
|
|
4145
4224
|
}
|
|
4146
4225
|
for (let e of c) {
|
|
4147
4226
|
let t = [];
|
|
@@ -4149,7 +4228,7 @@ var Zt = ({ schema: e, className: t }) => {
|
|
|
4149
4228
|
let i = n[r]?.[e] ?? [];
|
|
4150
4229
|
t.push(...i);
|
|
4151
4230
|
}
|
|
4152
|
-
d[e] =
|
|
4231
|
+
d[e] = $t(t, o);
|
|
4153
4232
|
}
|
|
4154
4233
|
let p = [];
|
|
4155
4234
|
for (let e of f) p.push(Number(e[a]) || 0);
|
|
@@ -4159,7 +4238,7 @@ var Zt = ({ schema: e, className: t }) => {
|
|
|
4159
4238
|
matrix: l,
|
|
4160
4239
|
rowTotals: u,
|
|
4161
4240
|
colTotals: d,
|
|
4162
|
-
grandTotal:
|
|
4241
|
+
grandTotal: $t(p, o)
|
|
4163
4242
|
};
|
|
4164
4243
|
}, [
|
|
4165
4244
|
f,
|
|
@@ -4167,9 +4246,9 @@ var Zt = ({ schema: e, className: t }) => {
|
|
|
4167
4246
|
i,
|
|
4168
4247
|
a,
|
|
4169
4248
|
o
|
|
4170
|
-
]), b = (e) =>
|
|
4249
|
+
]), b = (e) => Qt(e, u);
|
|
4171
4250
|
return f.length === 0 ? /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
4172
|
-
className:
|
|
4251
|
+
className: _("overflow-auto", t),
|
|
4173
4252
|
children: [n && /* @__PURE__ */ (0, U.jsx)("h3", {
|
|
4174
4253
|
className: "text-sm font-semibold mb-2",
|
|
4175
4254
|
children: n
|
|
@@ -4217,7 +4296,7 @@ var Zt = ({ schema: e, className: t }) => {
|
|
|
4217
4296
|
})]
|
|
4218
4297
|
})]
|
|
4219
4298
|
}) : /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
4220
|
-
className:
|
|
4299
|
+
className: _("overflow-auto", t),
|
|
4221
4300
|
children: [n && /* @__PURE__ */ (0, U.jsx)("h3", {
|
|
4222
4301
|
className: "text-sm font-semibold mb-2",
|
|
4223
4302
|
children: n
|
|
@@ -4233,7 +4312,7 @@ var Zt = ({ schema: e, className: t }) => {
|
|
|
4233
4312
|
children: r
|
|
4234
4313
|
}),
|
|
4235
4314
|
m.map((e) => /* @__PURE__ */ (0, U.jsx)("th", {
|
|
4236
|
-
className:
|
|
4315
|
+
className: _("text-right p-2 font-medium", d?.[e] ?? "text-muted-foreground"),
|
|
4237
4316
|
children: e
|
|
4238
4317
|
}, e)),
|
|
4239
4318
|
c && /* @__PURE__ */ (0, U.jsx)("th", {
|
|
@@ -4250,12 +4329,12 @@ var Zt = ({ schema: e, className: t }) => {
|
|
|
4250
4329
|
children: e
|
|
4251
4330
|
}),
|
|
4252
4331
|
m.map((t) => /* @__PURE__ */ (0, U.jsx)("td", {
|
|
4253
|
-
className:
|
|
4332
|
+
className: _("text-right p-2 tabular-nums", d?.[t]),
|
|
4254
4333
|
children: b(h[e]?.[t] ?? 0)
|
|
4255
4334
|
}, t)),
|
|
4256
4335
|
c && /* @__PURE__ */ (0, U.jsx)("td", {
|
|
4257
4336
|
className: "text-right p-2 font-semibold tabular-nums bg-muted/20",
|
|
4258
|
-
children: b(
|
|
4337
|
+
children: b(g[e] ?? 0)
|
|
4259
4338
|
})
|
|
4260
4339
|
]
|
|
4261
4340
|
}, e)) }),
|
|
@@ -4279,9 +4358,9 @@ var Zt = ({ schema: e, className: t }) => {
|
|
|
4279
4358
|
]
|
|
4280
4359
|
})]
|
|
4281
4360
|
});
|
|
4282
|
-
},
|
|
4283
|
-
let o =
|
|
4284
|
-
|
|
4361
|
+
}, tn = ({ schema: e, dataSource: n, className: i }) => {
|
|
4362
|
+
let o = w(r), s = n || o?.dataSource, c = a(e.bind), [l, u] = O([]), [d, f] = O(!1), [p, m] = O(null);
|
|
4363
|
+
T(() => {
|
|
4285
4364
|
let n = !0;
|
|
4286
4365
|
return e.objectName && !c && (!e.data || e.data.length === 0) && (async () => {
|
|
4287
4366
|
if (!(!s || !e.objectName)) {
|
|
@@ -4307,9 +4386,9 @@ var Zt = ({ schema: e, className: t }) => {
|
|
|
4307
4386
|
e.data,
|
|
4308
4387
|
e.filter
|
|
4309
4388
|
]);
|
|
4310
|
-
let
|
|
4389
|
+
let h = c || e.data || l, v = Array.isArray(h) ? h : [];
|
|
4311
4390
|
return d && v.length === 0 ? /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
4312
|
-
className:
|
|
4391
|
+
className: _("overflow-auto", i),
|
|
4313
4392
|
"data-testid": "pivot-loading",
|
|
4314
4393
|
children: [e.title && /* @__PURE__ */ (0, U.jsx)("h3", {
|
|
4315
4394
|
className: "text-sm font-semibold mb-2",
|
|
@@ -4319,10 +4398,10 @@ var Zt = ({ schema: e, className: t }) => {
|
|
|
4319
4398
|
children: [/* @__PURE__ */ (0, U.jsxs)("div", {
|
|
4320
4399
|
className: "flex gap-2",
|
|
4321
4400
|
children: [
|
|
4322
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4323
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4324
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4325
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4401
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-6 w-24" }),
|
|
4402
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-6 w-20" }),
|
|
4403
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-6 w-20" }),
|
|
4404
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-6 w-20" })
|
|
4326
4405
|
]
|
|
4327
4406
|
}), [
|
|
4328
4407
|
1,
|
|
@@ -4331,15 +4410,15 @@ var Zt = ({ schema: e, className: t }) => {
|
|
|
4331
4410
|
].map((e) => /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
4332
4411
|
className: "flex gap-2",
|
|
4333
4412
|
children: [
|
|
4334
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4335
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4336
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4337
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4413
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-5 w-24" }),
|
|
4414
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-5 w-20" }),
|
|
4415
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-5 w-20" }),
|
|
4416
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-5 w-20" })
|
|
4338
4417
|
]
|
|
4339
4418
|
}, e))]
|
|
4340
4419
|
})]
|
|
4341
4420
|
}) : p ? /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
4342
|
-
className:
|
|
4421
|
+
className: _("overflow-auto", i),
|
|
4343
4422
|
"data-testid": "pivot-error",
|
|
4344
4423
|
children: [e.title && /* @__PURE__ */ (0, U.jsx)("h3", {
|
|
4345
4424
|
className: "text-sm font-semibold mb-2",
|
|
@@ -4381,7 +4460,7 @@ var Zt = ({ schema: e, className: t }) => {
|
|
|
4381
4460
|
})]
|
|
4382
4461
|
})]
|
|
4383
4462
|
}) : !s && e.objectName && v.length === 0 ? /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
4384
|
-
className:
|
|
4463
|
+
className: _("overflow-auto", i),
|
|
4385
4464
|
children: [e.title && /* @__PURE__ */ (0, U.jsx)("h3", {
|
|
4386
4465
|
className: "text-sm font-semibold mb-2",
|
|
4387
4466
|
children: e.title
|
|
@@ -4396,36 +4475,36 @@ var Zt = ({ schema: e, className: t }) => {
|
|
|
4396
4475
|
]
|
|
4397
4476
|
})
|
|
4398
4477
|
})]
|
|
4399
|
-
}) : /* @__PURE__ */ (0, U.jsx)(
|
|
4478
|
+
}) : /* @__PURE__ */ (0, U.jsx)(en, {
|
|
4400
4479
|
schema: {
|
|
4401
4480
|
...e,
|
|
4402
4481
|
data: v
|
|
4403
4482
|
},
|
|
4404
|
-
className:
|
|
4483
|
+
className: i
|
|
4405
4484
|
});
|
|
4406
4485
|
};
|
|
4407
4486
|
//#endregion
|
|
4408
4487
|
//#region src/ObjectDataTable.tsx
|
|
4409
|
-
function
|
|
4488
|
+
function nn(e) {
|
|
4410
4489
|
return e.map((e) => typeof e == "string" ? {
|
|
4411
4490
|
header: e.replace(/_/g, " ").replace(/([A-Z])/g, " $1").trim().replace(/\b\w/g, (e) => e.toUpperCase()),
|
|
4412
4491
|
accessorKey: e
|
|
4413
4492
|
} : e);
|
|
4414
4493
|
}
|
|
4415
|
-
var
|
|
4416
|
-
let s =
|
|
4417
|
-
|
|
4494
|
+
var rn = ({ schema: e, dataSource: i, className: o }) => {
|
|
4495
|
+
let s = w(r), c = i || s?.dataSource, l = a(e.bind), [u, d] = O([]), [f, p] = O(!1), [m, h] = O(null);
|
|
4496
|
+
T(() => {
|
|
4418
4497
|
let n = !0;
|
|
4419
4498
|
return e.objectName && !l && (!e.data || e.data.length === 0) && (async () => {
|
|
4420
4499
|
if (!(!c || !e.objectName)) {
|
|
4421
|
-
n && (p(!0),
|
|
4500
|
+
n && (p(!0), h(null));
|
|
4422
4501
|
try {
|
|
4423
4502
|
let r;
|
|
4424
4503
|
if (typeof c.find == "function") r = t(await c.find(e.objectName, { $filter: e.filter }));
|
|
4425
4504
|
else return;
|
|
4426
4505
|
n && d(r);
|
|
4427
4506
|
} catch (e) {
|
|
4428
|
-
console.error("[ObjectDataTable] Fetch error:", e), n &&
|
|
4507
|
+
console.error("[ObjectDataTable] Fetch error:", e), n && h(e instanceof Error ? e.message : "Failed to load data");
|
|
4429
4508
|
} finally {
|
|
4430
4509
|
n && p(!1);
|
|
4431
4510
|
}
|
|
@@ -4440,22 +4519,22 @@ var en = ({ schema: e, dataSource: a, className: o }) => {
|
|
|
4440
4519
|
e.data,
|
|
4441
4520
|
e.filter
|
|
4442
4521
|
]);
|
|
4443
|
-
let v = l || e.data || u, y = Array.isArray(v) ? v : [], b =
|
|
4522
|
+
let v = l || e.data || u, y = Array.isArray(v) ? v : [], b = E(() => e.columns && e.columns.length > 0 ? nn(e.columns) : y.length === 0 ? [] : Object.keys(y[0]).filter((e) => !e.startsWith("_")).map((e) => ({
|
|
4444
4523
|
header: e.charAt(0).toUpperCase() + e.slice(1).replace(/([A-Z])/g, " $1"),
|
|
4445
4524
|
accessorKey: e
|
|
4446
4525
|
})), [e.columns, y]);
|
|
4447
4526
|
return f && y.length === 0 ? /* @__PURE__ */ (0, U.jsx)("div", {
|
|
4448
|
-
className:
|
|
4527
|
+
className: _("overflow-auto", o),
|
|
4449
4528
|
"data-testid": "table-loading",
|
|
4450
4529
|
children: /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
4451
4530
|
className: "space-y-2 p-2",
|
|
4452
4531
|
children: [/* @__PURE__ */ (0, U.jsxs)("div", {
|
|
4453
4532
|
className: "flex gap-2",
|
|
4454
4533
|
children: [
|
|
4455
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4456
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4457
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4458
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4534
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-6 w-1/4" }),
|
|
4535
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-6 w-1/4" }),
|
|
4536
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-6 w-1/4" }),
|
|
4537
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-6 w-1/4" })
|
|
4459
4538
|
]
|
|
4460
4539
|
}), [
|
|
4461
4540
|
1,
|
|
@@ -4465,15 +4544,15 @@ var en = ({ schema: e, dataSource: a, className: o }) => {
|
|
|
4465
4544
|
].map((e) => /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
4466
4545
|
className: "flex gap-2",
|
|
4467
4546
|
children: [
|
|
4468
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4469
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4470
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4471
|
-
/* @__PURE__ */ (0, U.jsx)(
|
|
4547
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-5 w-1/4" }),
|
|
4548
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-5 w-1/4" }),
|
|
4549
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-5 w-1/4" }),
|
|
4550
|
+
/* @__PURE__ */ (0, U.jsx)(g, { className: "h-5 w-1/4" })
|
|
4472
4551
|
]
|
|
4473
4552
|
}, e))]
|
|
4474
4553
|
})
|
|
4475
4554
|
}) : m ? /* @__PURE__ */ (0, U.jsx)("div", {
|
|
4476
|
-
className:
|
|
4555
|
+
className: _("overflow-auto", o),
|
|
4477
4556
|
"data-testid": "table-error",
|
|
4478
4557
|
children: /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
4479
4558
|
className: "flex flex-col items-center justify-center py-8 text-destructive",
|
|
@@ -4512,7 +4591,7 @@ var en = ({ schema: e, dataSource: a, className: o }) => {
|
|
|
4512
4591
|
})]
|
|
4513
4592
|
})
|
|
4514
4593
|
}) : !c && e.objectName && y.length === 0 ? /* @__PURE__ */ (0, U.jsx)("div", {
|
|
4515
|
-
className:
|
|
4594
|
+
className: _("overflow-auto", o),
|
|
4516
4595
|
children: /* @__PURE__ */ (0, U.jsx)("div", {
|
|
4517
4596
|
className: "flex flex-col items-center justify-center py-8 text-muted-foreground",
|
|
4518
4597
|
children: /* @__PURE__ */ (0, U.jsxs)("p", {
|
|
@@ -4525,7 +4604,7 @@ var en = ({ schema: e, dataSource: a, className: o }) => {
|
|
|
4525
4604
|
})
|
|
4526
4605
|
})
|
|
4527
4606
|
}) : y.length === 0 ? /* @__PURE__ */ (0, U.jsx)("div", {
|
|
4528
|
-
className:
|
|
4607
|
+
className: _("overflow-auto", o),
|
|
4529
4608
|
"data-testid": "table-empty-state",
|
|
4530
4609
|
children: /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
4531
4610
|
className: "flex flex-col items-center justify-center py-8 text-muted-foreground",
|
|
@@ -4574,7 +4653,7 @@ var en = ({ schema: e, dataSource: a, className: o }) => {
|
|
|
4574
4653
|
},
|
|
4575
4654
|
className: o
|
|
4576
4655
|
});
|
|
4577
|
-
},
|
|
4656
|
+
}, an = {
|
|
4578
4657
|
breadcrumb: ["Dashboard", "Configuration"],
|
|
4579
4658
|
sections: [
|
|
4580
4659
|
{
|
|
@@ -4679,12 +4758,12 @@ var en = ({ schema: e, dataSource: a, className: o }) => {
|
|
|
4679
4758
|
}
|
|
4680
4759
|
]
|
|
4681
4760
|
};
|
|
4682
|
-
function
|
|
4683
|
-
let { draft: a, isDirty: o, updateField: s, discard: c } =
|
|
4684
|
-
return /* @__PURE__ */ (0, U.jsx)(
|
|
4761
|
+
function on({ open: e, onClose: t, config: n, onSave: r, onFieldChange: i }) {
|
|
4762
|
+
let { draft: a, isDirty: o, updateField: s, discard: c } = y(n, { onUpdate: i });
|
|
4763
|
+
return /* @__PURE__ */ (0, U.jsx)(m, {
|
|
4685
4764
|
open: e,
|
|
4686
4765
|
onClose: t,
|
|
4687
|
-
schema:
|
|
4766
|
+
schema: an,
|
|
4688
4767
|
draft: a,
|
|
4689
4768
|
isDirty: o,
|
|
4690
4769
|
onFieldChange: s,
|
|
@@ -4694,7 +4773,7 @@ function nn({ open: e, onClose: t, config: n, onSave: r, onFieldChange: i }) {
|
|
|
4694
4773
|
}
|
|
4695
4774
|
//#endregion
|
|
4696
4775
|
//#region src/WidgetConfigPanel.tsx
|
|
4697
|
-
var
|
|
4776
|
+
var sn = [
|
|
4698
4777
|
{
|
|
4699
4778
|
value: "metric",
|
|
4700
4779
|
label: "Metric"
|
|
@@ -4739,7 +4818,7 @@ var rn = [
|
|
|
4739
4818
|
value: "custom",
|
|
4740
4819
|
label: "Custom"
|
|
4741
4820
|
}
|
|
4742
|
-
],
|
|
4821
|
+
], cn = [
|
|
4743
4822
|
{
|
|
4744
4823
|
value: "default",
|
|
4745
4824
|
label: "Default"
|
|
@@ -4772,7 +4851,7 @@ var rn = [
|
|
|
4772
4851
|
value: "danger",
|
|
4773
4852
|
label: "Danger"
|
|
4774
4853
|
}
|
|
4775
|
-
],
|
|
4854
|
+
], ln = [
|
|
4776
4855
|
{
|
|
4777
4856
|
value: "count",
|
|
4778
4857
|
label: "Count"
|
|
@@ -4793,7 +4872,7 @@ var rn = [
|
|
|
4793
4872
|
value: "max",
|
|
4794
4873
|
label: "Max"
|
|
4795
4874
|
}
|
|
4796
|
-
],
|
|
4875
|
+
], un = [
|
|
4797
4876
|
"bar",
|
|
4798
4877
|
"line",
|
|
4799
4878
|
"area",
|
|
@@ -4801,32 +4880,32 @@ var rn = [
|
|
|
4801
4880
|
"donut",
|
|
4802
4881
|
"scatter"
|
|
4803
4882
|
];
|
|
4804
|
-
function
|
|
4805
|
-
return !!e &&
|
|
4883
|
+
function dn(e) {
|
|
4884
|
+
return !!e && un.includes(e);
|
|
4806
4885
|
}
|
|
4807
|
-
var
|
|
4886
|
+
var fn = [{
|
|
4808
4887
|
value: "group",
|
|
4809
4888
|
label: "Group"
|
|
4810
4889
|
}, {
|
|
4811
4890
|
value: "value",
|
|
4812
4891
|
label: "Value"
|
|
4813
|
-
}],
|
|
4892
|
+
}], pn = [{
|
|
4814
4893
|
value: "asc",
|
|
4815
4894
|
label: "↑"
|
|
4816
4895
|
}, {
|
|
4817
4896
|
value: "desc",
|
|
4818
4897
|
label: "↓"
|
|
4819
4898
|
}];
|
|
4820
|
-
function
|
|
4899
|
+
function mn(e, t, n, r) {
|
|
4821
4900
|
return {
|
|
4822
4901
|
key: e,
|
|
4823
4902
|
label: t,
|
|
4824
4903
|
type: "custom",
|
|
4825
|
-
render: (i, a, o) => /* @__PURE__ */ (0, U.jsx)(
|
|
4904
|
+
render: (i, a, o) => /* @__PURE__ */ (0, U.jsx)(h, {
|
|
4826
4905
|
label: t,
|
|
4827
4906
|
children: /* @__PURE__ */ (0, U.jsx)("div", {
|
|
4828
4907
|
"data-testid": `config-field-${e}`,
|
|
4829
|
-
children: /* @__PURE__ */ (0, U.jsx)(
|
|
4908
|
+
children: /* @__PURE__ */ (0, U.jsx)(p, {
|
|
4830
4909
|
options: r ?? [],
|
|
4831
4910
|
value: i ?? "",
|
|
4832
4911
|
onValueChange: a,
|
|
@@ -4840,16 +4919,16 @@ function dn(e, t, n, r) {
|
|
|
4840
4919
|
})
|
|
4841
4920
|
};
|
|
4842
4921
|
}
|
|
4843
|
-
function
|
|
4922
|
+
function hn(e, t, n) {
|
|
4844
4923
|
let r = e && e.length > 0, i = r ? {
|
|
4845
4924
|
key: "object",
|
|
4846
4925
|
label: "Data source",
|
|
4847
4926
|
type: "custom",
|
|
4848
|
-
render: (t, n) => /* @__PURE__ */ (0, U.jsx)(
|
|
4927
|
+
render: (t, n) => /* @__PURE__ */ (0, U.jsx)(h, {
|
|
4849
4928
|
label: "Data source",
|
|
4850
4929
|
children: /* @__PURE__ */ (0, U.jsx)("div", {
|
|
4851
4930
|
"data-testid": "config-field-object",
|
|
4852
|
-
children: /* @__PURE__ */ (0, U.jsx)(
|
|
4931
|
+
children: /* @__PURE__ */ (0, U.jsx)(p, {
|
|
4853
4932
|
options: e,
|
|
4854
4933
|
value: t ?? "",
|
|
4855
4934
|
onValueChange: n,
|
|
@@ -4865,27 +4944,27 @@ function fn(e, t, n) {
|
|
|
4865
4944
|
label: "Data source",
|
|
4866
4945
|
type: "input",
|
|
4867
4946
|
placeholder: "Object name"
|
|
4868
|
-
}, a = r ?
|
|
4947
|
+
}, a = r ? mn("categoryField", "Category field", "Select field…", t) : {
|
|
4869
4948
|
key: "categoryField",
|
|
4870
4949
|
label: "Category field",
|
|
4871
4950
|
type: "input",
|
|
4872
4951
|
placeholder: "e.g. status"
|
|
4873
|
-
}, o = r ?
|
|
4952
|
+
}, o = r ? mn("valueField", "Value field", "Select field…", t) : {
|
|
4874
4953
|
key: "valueField",
|
|
4875
4954
|
label: "Value field",
|
|
4876
4955
|
type: "input",
|
|
4877
4956
|
placeholder: "e.g. amount"
|
|
4878
|
-
}, s = r ?
|
|
4957
|
+
}, s = r ? mn("rowField", "Field", "Select row field…", t) : {
|
|
4879
4958
|
key: "rowField",
|
|
4880
4959
|
label: "Field",
|
|
4881
4960
|
type: "input",
|
|
4882
4961
|
placeholder: "e.g. owner"
|
|
4883
|
-
}, c = r ?
|
|
4962
|
+
}, c = r ? mn("columnField", "Field", "Select column field…", t) : {
|
|
4884
4963
|
key: "columnField",
|
|
4885
4964
|
label: "Field",
|
|
4886
4965
|
type: "input",
|
|
4887
4966
|
placeholder: "e.g. stage"
|
|
4888
|
-
}, l = r ?
|
|
4967
|
+
}, l = r ? mn("pivotValueField", "Field", "Select value field…", t) : {
|
|
4889
4968
|
key: "pivotValueField",
|
|
4890
4969
|
label: "Field",
|
|
4891
4970
|
type: "input",
|
|
@@ -4895,7 +4974,7 @@ function fn(e, t, n) {
|
|
|
4895
4974
|
breadcrumb: ["Dashboard", {
|
|
4896
4975
|
pivot: "Pivot table",
|
|
4897
4976
|
table: "Table"
|
|
4898
|
-
}[n ?? ""] ?? (
|
|
4977
|
+
}[n ?? ""] ?? (dn(n) ? "Chart" : "Widget")],
|
|
4899
4978
|
sections: [
|
|
4900
4979
|
{
|
|
4901
4980
|
key: "general",
|
|
@@ -4917,7 +4996,7 @@ function fn(e, t, n) {
|
|
|
4917
4996
|
key: "type",
|
|
4918
4997
|
label: "Widget type",
|
|
4919
4998
|
type: "select",
|
|
4920
|
-
options:
|
|
4999
|
+
options: sn,
|
|
4921
5000
|
defaultValue: "metric"
|
|
4922
5001
|
}
|
|
4923
5002
|
]
|
|
@@ -4935,7 +5014,7 @@ function fn(e, t, n) {
|
|
|
4935
5014
|
key: "aggregate",
|
|
4936
5015
|
label: "Aggregation",
|
|
4937
5016
|
type: "select",
|
|
4938
|
-
options:
|
|
5017
|
+
options: ln,
|
|
4939
5018
|
defaultValue: "count"
|
|
4940
5019
|
}
|
|
4941
5020
|
]
|
|
@@ -4958,14 +5037,14 @@ function fn(e, t, n) {
|
|
|
4958
5037
|
key: "rowSortBy",
|
|
4959
5038
|
label: "Sort by",
|
|
4960
5039
|
type: "icon-group",
|
|
4961
|
-
options:
|
|
5040
|
+
options: fn,
|
|
4962
5041
|
defaultValue: "group"
|
|
4963
5042
|
},
|
|
4964
5043
|
{
|
|
4965
5044
|
key: "rowSortOrder",
|
|
4966
5045
|
label: "Sort order",
|
|
4967
5046
|
type: "icon-group",
|
|
4968
|
-
options:
|
|
5047
|
+
options: pn,
|
|
4969
5048
|
defaultValue: "asc"
|
|
4970
5049
|
},
|
|
4971
5050
|
{
|
|
@@ -4993,14 +5072,14 @@ function fn(e, t, n) {
|
|
|
4993
5072
|
key: "columnSortBy",
|
|
4994
5073
|
label: "Sort by",
|
|
4995
5074
|
type: "icon-group",
|
|
4996
|
-
options:
|
|
5075
|
+
options: fn,
|
|
4997
5076
|
defaultValue: "group"
|
|
4998
5077
|
},
|
|
4999
5078
|
{
|
|
5000
5079
|
key: "columnSortOrder",
|
|
5001
5080
|
label: "Sort order",
|
|
5002
5081
|
type: "icon-group",
|
|
5003
|
-
options:
|
|
5082
|
+
options: pn,
|
|
5004
5083
|
defaultValue: "asc"
|
|
5005
5084
|
},
|
|
5006
5085
|
{
|
|
@@ -5028,7 +5107,7 @@ function fn(e, t, n) {
|
|
|
5028
5107
|
key: "aggregation",
|
|
5029
5108
|
label: "Aggregation",
|
|
5030
5109
|
type: "select",
|
|
5031
|
-
options:
|
|
5110
|
+
options: ln,
|
|
5032
5111
|
defaultValue: "sum"
|
|
5033
5112
|
},
|
|
5034
5113
|
{
|
|
@@ -5043,7 +5122,7 @@ function fn(e, t, n) {
|
|
|
5043
5122
|
key: "chart-axis",
|
|
5044
5123
|
title: "Axis & Series",
|
|
5045
5124
|
collapsible: !0,
|
|
5046
|
-
visibleWhen: (e) =>
|
|
5125
|
+
visibleWhen: (e) => dn(e.type),
|
|
5047
5126
|
fields: [
|
|
5048
5127
|
{
|
|
5049
5128
|
key: "xAxisLabel",
|
|
@@ -5113,7 +5192,7 @@ function fn(e, t, n) {
|
|
|
5113
5192
|
key: "colorVariant",
|
|
5114
5193
|
label: "Color variant",
|
|
5115
5194
|
type: "select",
|
|
5116
|
-
options:
|
|
5195
|
+
options: cn,
|
|
5117
5196
|
defaultValue: "default"
|
|
5118
5197
|
}, {
|
|
5119
5198
|
key: "actionUrl",
|
|
@@ -5125,7 +5204,7 @@ function fn(e, t, n) {
|
|
|
5125
5204
|
]
|
|
5126
5205
|
};
|
|
5127
5206
|
}
|
|
5128
|
-
function
|
|
5207
|
+
function gn(e) {
|
|
5129
5208
|
if (e == null) return "";
|
|
5130
5209
|
if (typeof e == "string") return e;
|
|
5131
5210
|
if (typeof e == "object") {
|
|
@@ -5134,16 +5213,16 @@ function pn(e) {
|
|
|
5134
5213
|
}
|
|
5135
5214
|
return String(e);
|
|
5136
5215
|
}
|
|
5137
|
-
function
|
|
5138
|
-
let { draft: c, isDirty: l, updateField: u, discard: d } =
|
|
5216
|
+
function _n({ open: e, onClose: t, config: n, onSave: r, onFieldChange: i, headerExtra: a, availableObjects: o, availableFields: s }) {
|
|
5217
|
+
let { draft: c, isDirty: l, updateField: u, discard: d } = y(b.useMemo(() => ({
|
|
5139
5218
|
...n,
|
|
5140
|
-
title: typeof n.title == "object" ?
|
|
5141
|
-
description: typeof n.description == "object" ?
|
|
5219
|
+
title: typeof n.title == "object" ? gn(n.title) : n.title,
|
|
5220
|
+
description: typeof n.description == "object" ? gn(n.description) : n.description
|
|
5142
5221
|
}), [n]), { onUpdate: i });
|
|
5143
|
-
return /* @__PURE__ */ (0, U.jsx)(
|
|
5222
|
+
return /* @__PURE__ */ (0, U.jsx)(m, {
|
|
5144
5223
|
open: e,
|
|
5145
5224
|
onClose: t,
|
|
5146
|
-
schema:
|
|
5225
|
+
schema: b.useMemo(() => hn(o, s, c.type), [
|
|
5147
5226
|
o,
|
|
5148
5227
|
s,
|
|
5149
5228
|
c.type
|
|
@@ -5158,12 +5237,12 @@ function mn({ open: e, onClose: t, config: n, onSave: r, onFieldChange: i, heade
|
|
|
5158
5237
|
}
|
|
5159
5238
|
//#endregion
|
|
5160
5239
|
//#region src/DashboardWithConfig.tsx
|
|
5161
|
-
function
|
|
5162
|
-
let [l, u] =
|
|
5163
|
-
|
|
5164
|
-
m(e),
|
|
5240
|
+
function vn({ schema: e, config: t, onConfigSave: n, onWidgetSave: r, onRefresh: i, recordCount: a, defaultConfigOpen: o = !1, className: s }) {
|
|
5241
|
+
let [l, u] = O(o), [d, f] = O(null), [p, m] = O(e), [h, g] = O(0);
|
|
5242
|
+
T(() => {
|
|
5243
|
+
m(e), g((e) => e + 1);
|
|
5165
5244
|
}, [e]);
|
|
5166
|
-
let
|
|
5245
|
+
let v = b.useMemo(() => {
|
|
5167
5246
|
if (!d || !p.widgets) return null;
|
|
5168
5247
|
let e = p.widgets.find((e) => (e.id || e.title) === d);
|
|
5169
5248
|
return e ? {
|
|
@@ -5180,11 +5259,11 @@ function hn({ schema: e, config: t, onConfigSave: n, onWidgetSave: r, onRefresh:
|
|
|
5180
5259
|
layoutW: e.layout?.w ?? 1,
|
|
5181
5260
|
layoutH: e.layout?.h ?? 1
|
|
5182
5261
|
} : null;
|
|
5183
|
-
}, [d, h]),
|
|
5262
|
+
}, [d, h]), y = C((e) => {
|
|
5184
5263
|
f(e), u(!0);
|
|
5185
|
-
}, []),
|
|
5264
|
+
}, []), x = C(() => {
|
|
5186
5265
|
f(null);
|
|
5187
|
-
}, []),
|
|
5266
|
+
}, []), S = C((e, t) => {
|
|
5188
5267
|
d && m((n) => n.widgets ? {
|
|
5189
5268
|
...n,
|
|
5190
5269
|
widgets: n.widgets.map((n) => (n.id || n.title) === d ? e === "layoutW" ? {
|
|
@@ -5204,42 +5283,42 @@ function hn({ schema: e, config: t, onConfigSave: n, onWidgetSave: r, onRefresh:
|
|
|
5204
5283
|
[e]: t
|
|
5205
5284
|
} : n)
|
|
5206
5285
|
} : n);
|
|
5207
|
-
}, [d]),
|
|
5208
|
-
d && r && r(d, e), f(null),
|
|
5209
|
-
}, [d, r]),
|
|
5286
|
+
}, [d]), w = C((e) => {
|
|
5287
|
+
d && r && r(d, e), f(null), g((e) => e + 1);
|
|
5288
|
+
}, [d, r]), E = C(() => {
|
|
5210
5289
|
u((e) => !e), f(null);
|
|
5211
5290
|
}, []);
|
|
5212
5291
|
return /* @__PURE__ */ (0, U.jsxs)("div", {
|
|
5213
|
-
className:
|
|
5292
|
+
className: _("flex h-full w-full", s),
|
|
5214
5293
|
"data-testid": "dashboard-with-config",
|
|
5215
5294
|
children: [/* @__PURE__ */ (0, U.jsxs)("div", {
|
|
5216
5295
|
className: "flex-1 min-w-0 overflow-auto relative",
|
|
5217
5296
|
children: [/* @__PURE__ */ (0, U.jsx)("div", {
|
|
5218
5297
|
className: "absolute top-2 right-2 z-10",
|
|
5219
|
-
children: /* @__PURE__ */ (0, U.jsxs)(
|
|
5298
|
+
children: /* @__PURE__ */ (0, U.jsxs)(c, {
|
|
5220
5299
|
size: "sm",
|
|
5221
5300
|
variant: l ? "default" : "outline",
|
|
5222
|
-
onClick:
|
|
5301
|
+
onClick: E,
|
|
5223
5302
|
"data-testid": "dashboard-config-toggle",
|
|
5224
|
-
children: [/* @__PURE__ */ (0, U.jsx)(
|
|
5303
|
+
children: [/* @__PURE__ */ (0, U.jsx)(R, { className: "h-3.5 w-3.5 mr-1" }), "Settings"]
|
|
5225
5304
|
})
|
|
5226
|
-
}), /* @__PURE__ */ (0, U.jsx)(
|
|
5305
|
+
}), /* @__PURE__ */ (0, U.jsx)(W, {
|
|
5227
5306
|
schema: p,
|
|
5228
5307
|
onRefresh: i,
|
|
5229
5308
|
recordCount: a,
|
|
5230
5309
|
designMode: l,
|
|
5231
5310
|
selectedWidgetId: d,
|
|
5232
|
-
onWidgetClick:
|
|
5311
|
+
onWidgetClick: y
|
|
5233
5312
|
})]
|
|
5234
5313
|
}), l && /* @__PURE__ */ (0, U.jsx)("div", {
|
|
5235
5314
|
className: "relative shrink-0",
|
|
5236
|
-
children: d &&
|
|
5315
|
+
children: d && v ? /* @__PURE__ */ (0, U.jsx)(_n, {
|
|
5237
5316
|
open: !0,
|
|
5238
|
-
onClose:
|
|
5239
|
-
config:
|
|
5240
|
-
onSave:
|
|
5241
|
-
onFieldChange:
|
|
5242
|
-
}) : /* @__PURE__ */ (0, U.jsx)(
|
|
5317
|
+
onClose: x,
|
|
5318
|
+
config: v,
|
|
5319
|
+
onSave: w,
|
|
5320
|
+
onFieldChange: S
|
|
5321
|
+
}) : /* @__PURE__ */ (0, U.jsx)(on, {
|
|
5243
5322
|
open: !0,
|
|
5244
5323
|
onClose: () => u(!1),
|
|
5245
5324
|
config: t,
|
|
@@ -5248,7 +5327,7 @@ function hn({ schema: e, config: t, onConfigSave: n, onWidgetSave: r, onRefresh:
|
|
|
5248
5327
|
})]
|
|
5249
5328
|
});
|
|
5250
5329
|
}
|
|
5251
|
-
e.register("dashboard",
|
|
5330
|
+
e.register("dashboard", W, {
|
|
5252
5331
|
namespace: "view",
|
|
5253
5332
|
label: "Dashboard",
|
|
5254
5333
|
category: "Complex",
|
|
@@ -5276,7 +5355,7 @@ e.register("dashboard", re, {
|
|
|
5276
5355
|
columns: 3,
|
|
5277
5356
|
widgets: []
|
|
5278
5357
|
}
|
|
5279
|
-
}), e.register("metric",
|
|
5358
|
+
}), e.register("metric", Jt, {
|
|
5280
5359
|
namespace: "plugin-dashboard",
|
|
5281
5360
|
label: "Metric Widget",
|
|
5282
5361
|
category: "Dashboard",
|
|
@@ -5289,7 +5368,7 @@ e.register("dashboard", re, {
|
|
|
5289
5368
|
type: "string",
|
|
5290
5369
|
label: "Value"
|
|
5291
5370
|
}]
|
|
5292
|
-
}), e.register("metric-card",
|
|
5371
|
+
}), e.register("metric-card", Xt, {
|
|
5293
5372
|
namespace: "plugin-dashboard",
|
|
5294
5373
|
label: "Metric Card",
|
|
5295
5374
|
category: "Dashboard",
|
|
@@ -5344,7 +5423,7 @@ e.register("dashboard", re, {
|
|
|
5344
5423
|
title: "Metric",
|
|
5345
5424
|
value: "0"
|
|
5346
5425
|
}
|
|
5347
|
-
}), e.register("object-metric",
|
|
5426
|
+
}), e.register("object-metric", Zt, {
|
|
5348
5427
|
namespace: "plugin-dashboard",
|
|
5349
5428
|
label: "Object Metric",
|
|
5350
5429
|
category: "Dashboard",
|
|
@@ -5373,7 +5452,7 @@ e.register("dashboard", re, {
|
|
|
5373
5452
|
}
|
|
5374
5453
|
],
|
|
5375
5454
|
defaultProps: { label: "Metric" }
|
|
5376
|
-
}), e.register("pivot",
|
|
5455
|
+
}), e.register("pivot", en, {
|
|
5377
5456
|
namespace: "plugin-dashboard",
|
|
5378
5457
|
label: "Pivot Table",
|
|
5379
5458
|
category: "Dashboard",
|
|
@@ -5452,7 +5531,7 @@ e.register("dashboard", re, {
|
|
|
5452
5531
|
aggregation: "sum",
|
|
5453
5532
|
data: []
|
|
5454
5533
|
}
|
|
5455
|
-
}), e.register("object-pivot",
|
|
5534
|
+
}), e.register("object-pivot", tn, {
|
|
5456
5535
|
namespace: "plugin-dashboard",
|
|
5457
5536
|
label: "Object Pivot Table",
|
|
5458
5537
|
category: "Dashboard",
|
|
@@ -5541,7 +5620,7 @@ e.register("dashboard", re, {
|
|
|
5541
5620
|
valueField: "",
|
|
5542
5621
|
aggregation: "sum"
|
|
5543
5622
|
}
|
|
5544
|
-
}), e.register("dashboard-grid",
|
|
5623
|
+
}), e.register("dashboard-grid", Gt, {
|
|
5545
5624
|
namespace: "plugin-dashboard",
|
|
5546
5625
|
label: "Dashboard Grid (Editable)",
|
|
5547
5626
|
category: "Complex",
|
|
@@ -5569,7 +5648,7 @@ e.register("dashboard", re, {
|
|
|
5569
5648
|
widgets: [],
|
|
5570
5649
|
persistLayoutKey: "dashboard-layout"
|
|
5571
5650
|
}
|
|
5572
|
-
}), e.register("object-data-table",
|
|
5651
|
+
}), e.register("object-data-table", rn, {
|
|
5573
5652
|
namespace: "plugin-dashboard",
|
|
5574
5653
|
label: "Object Data Table",
|
|
5575
5654
|
category: "Dashboard",
|
|
@@ -5607,18 +5686,18 @@ e.register("dashboard", re, {
|
|
|
5607
5686
|
pagination: !1
|
|
5608
5687
|
}
|
|
5609
5688
|
});
|
|
5610
|
-
var
|
|
5611
|
-
DashboardRenderer:
|
|
5612
|
-
DashboardGridLayout:
|
|
5613
|
-
MetricWidget:
|
|
5614
|
-
MetricCard:
|
|
5615
|
-
ObjectMetricWidget:
|
|
5616
|
-
PivotTable:
|
|
5617
|
-
ObjectPivotTable:
|
|
5618
|
-
ObjectDataTable:
|
|
5619
|
-
DashboardConfigPanel:
|
|
5620
|
-
WidgetConfigPanel:
|
|
5621
|
-
DashboardWithConfig:
|
|
5689
|
+
var yn = {
|
|
5690
|
+
DashboardRenderer: W,
|
|
5691
|
+
DashboardGridLayout: Gt,
|
|
5692
|
+
MetricWidget: Jt,
|
|
5693
|
+
MetricCard: Xt,
|
|
5694
|
+
ObjectMetricWidget: Zt,
|
|
5695
|
+
PivotTable: en,
|
|
5696
|
+
ObjectPivotTable: tn,
|
|
5697
|
+
ObjectDataTable: rn,
|
|
5698
|
+
DashboardConfigPanel: on,
|
|
5699
|
+
WidgetConfigPanel: _n,
|
|
5700
|
+
DashboardWithConfig: vn
|
|
5622
5701
|
};
|
|
5623
5702
|
//#endregion
|
|
5624
|
-
export {
|
|
5703
|
+
export { on as DashboardConfigPanel, Gt as DashboardGridLayout, W as DashboardRenderer, vn as DashboardWithConfig, Xt as MetricCard, Jt as MetricWidget, rn as ObjectDataTable, Zt as ObjectMetricWidget, tn as ObjectPivotTable, en as PivotTable, _n as WidgetConfigPanel, yn as dashboardComponents };
|