@burdenoff/microfe-bigconsole 2026.613.6 → 2026.615.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/dist/bigconsole/components/widgets/WidgetWrapper.js +183 -183
- package/dist/bigconsole/components/widgets/WidgetWrapper.js.map +1 -1
- package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +275 -114
- package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js.map +1 -1
- package/dist/bigconsole/components/widgets/table/TableHeader.js +89 -29
- package/dist/bigconsole/components/widgets/table/TableHeader.js.map +1 -1
- package/dist/bigconsole/components/widgets/table/TableWidget.js +218 -148
- package/dist/bigconsole/components/widgets/table/TableWidget.js.map +1 -1
- package/dist/bigconsole/hooks/index.js +1 -0
- package/dist/bigconsole/hooks/useWidgetConfigPersist.js +32 -0
- package/dist/bigconsole/hooks/useWidgetConfigPersist.js.map +1 -0
- package/dist/bigconsole/store/dashboardStore.js +2 -2
- package/dist/bigconsole/store/dashboardStore.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,35 +3,35 @@ import { useDashboardStore as r, useGlobalFilterValues as i } from "../../store/
|
|
|
3
3
|
import "../../store/index.js";
|
|
4
4
|
import a from "../../hooks/useWidgetData.js";
|
|
5
5
|
import { getWidgetDefinition as o } from "./WidgetRegistry.js";
|
|
6
|
-
import { formatTimeUntilRefresh as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
6
|
+
import { formatTimeUntilRefresh as s, useWidgetAutoRefresh as c } from "../../hooks/useAutoRefresh.js";
|
|
7
|
+
import ee from "../../hooks/useWidgetExport.js";
|
|
8
|
+
import te from "../../hooks/useDrilldown.js";
|
|
9
9
|
import "../../hooks/index.js";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { hasCustomIframeConfig as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
10
|
+
import l from "./WidgetHeader.js";
|
|
11
|
+
import u from "./states/LoadingState.js";
|
|
12
|
+
import ne from "./states/ErrorState.js";
|
|
13
|
+
import d from "./states/EmptyState.js";
|
|
14
|
+
import re from "./WidgetErrorBoundary.js";
|
|
15
|
+
import { hasCustomIframeConfig as ie, hasRenderableCustomConfig as ae } from "./custom/config.js";
|
|
16
|
+
import oe from "../../renderers/factory/WidgetRendererFactory.js";
|
|
17
|
+
import se from "./widget-actions/WidgetActions.js";
|
|
18
18
|
import "./widget-actions/index.js";
|
|
19
|
-
import { Suspense as ce, lazy as f, memo as p, useCallback as m, useEffect as
|
|
20
|
-
import { jsx as
|
|
19
|
+
import { Suspense as ce, lazy as f, memo as p, useCallback as m, useEffect as h, useMemo as g, useRef as _ } from "react";
|
|
20
|
+
import { jsx as v, jsxs as le } from "react/jsx-runtime";
|
|
21
21
|
//#region src/bigconsole/components/widgets/WidgetWrapper.tsx
|
|
22
|
-
var
|
|
23
|
-
function
|
|
22
|
+
var ue = f(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), de = f(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), fe = f(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), pe = f(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), me = f(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), he = f(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), ge = f(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), _e = f(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), ve = f(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), ye = f(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), be = f(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), xe = f(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), Se = f(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), Ce = f(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), we = f(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), Te = f(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget }))), Ee = f(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget })));
|
|
23
|
+
function y(e, t) {
|
|
24
24
|
if (e.widget.id !== t.widget.id || e.widget.updatedAt !== t.widget.updatedAt || e.isLoading !== t.isLoading || e.error !== t.error || (e.actions?.length ?? 0) !== (t.actions?.length ?? 0)) return !1;
|
|
25
25
|
if (e.actions && t.actions) {
|
|
26
26
|
for (let n = 0; n < e.actions.length; n++) if (e.actions[n]?.id !== t.actions[n]?.id) return !1;
|
|
27
27
|
}
|
|
28
28
|
return !(e.data !== t.data || JSON.stringify(e.filterValues) !== JSON.stringify(t.filterValues));
|
|
29
29
|
}
|
|
30
|
-
var
|
|
31
|
-
let
|
|
32
|
-
skip: !
|
|
30
|
+
var b = p(function({ widget: f, children: p, data: y, className: b = "", isLoading: De, error: Oe, onRefresh: x, onDrilldown: S, actions: C, onAction: w, filterValues: T }) {
|
|
31
|
+
let E = r((e) => e.viewMode === "edit"), D = t((e) => e.selectWidget), O = e(f.id), k = n(f.id), A = i(), ke = !!f.dataSinkId || !!f.datasetId || !!f.parserId, { data: j, loading: Ae } = a(f.id, {
|
|
32
|
+
skip: !ke,
|
|
33
33
|
pollInterval: (f.refreshInterval ?? 0) * 1e3 || 0
|
|
34
|
-
}),
|
|
34
|
+
}), M = g(() => {
|
|
35
35
|
if (typeof window > "u") return {};
|
|
36
36
|
let e = new URLSearchParams(window.location.search), t = {};
|
|
37
37
|
return e.forEach((e, n) => {
|
|
@@ -40,26 +40,26 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
|
|
|
40
40
|
r.startsWith("__") || (t[r] = e);
|
|
41
41
|
}
|
|
42
42
|
}), t;
|
|
43
|
-
}, []),
|
|
43
|
+
}, []), N = g(() => {
|
|
44
44
|
let e = {};
|
|
45
|
-
return
|
|
45
|
+
return M && Object.keys(M).length > 0 && Object.assign(e, M), A && Object.keys(A).length > 0 && Object.assign(e, A), T && Object.keys(T).length > 0 && Object.assign(e, T), e;
|
|
46
46
|
}, [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
]),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, [
|
|
54
|
-
let
|
|
55
|
-
|
|
56
|
-
}, []), { timeUntilRefresh:
|
|
47
|
+
M,
|
|
48
|
+
A,
|
|
49
|
+
T
|
|
50
|
+
]), P = Object.keys(N).length > 0, F = De ?? (Ae && !j) ?? k.isLoading, I = Oe ?? k.errorMessage, je = o(f.type), L = _(x);
|
|
51
|
+
h(() => {
|
|
52
|
+
L.current = x;
|
|
53
|
+
}, [x]);
|
|
54
|
+
let Me = m(async () => {
|
|
55
|
+
L.current && await L.current();
|
|
56
|
+
}, []), { timeUntilRefresh: Ne, isPaused: Pe } = c({
|
|
57
57
|
widgetId: f.id,
|
|
58
58
|
refreshInterval: f.refreshInterval,
|
|
59
|
-
onRefresh:
|
|
60
|
-
enabled: !
|
|
61
|
-
}),
|
|
62
|
-
if (
|
|
59
|
+
onRefresh: Me,
|
|
60
|
+
enabled: !E && !!f.refreshInterval
|
|
61
|
+
}), R = _(null), z = g(() => {
|
|
62
|
+
if (y && Array.isArray(y)) return y;
|
|
63
63
|
let e = f.data;
|
|
64
64
|
if (e?.processed && Array.isArray(e.processed)) return e.processed;
|
|
65
65
|
if (e?.raw) {
|
|
@@ -67,24 +67,24 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
|
|
|
67
67
|
if (Array.isArray(t)) return t;
|
|
68
68
|
}
|
|
69
69
|
return null;
|
|
70
|
-
}, [
|
|
71
|
-
data:
|
|
72
|
-
containerRef:
|
|
73
|
-
}),
|
|
70
|
+
}, [y, f]), { exportCSV: Fe, exportPNG: Ie } = ee(f, {
|
|
71
|
+
data: z,
|
|
72
|
+
containerRef: R
|
|
73
|
+
}), B = m((e) => {
|
|
74
74
|
if (e == null) return !1;
|
|
75
75
|
if (Array.isArray(e)) return e.length > 0;
|
|
76
76
|
if (typeof e == "object") {
|
|
77
77
|
let t = e, n = Object.keys(t);
|
|
78
78
|
return n.length === 0 ? !1 : n.some((e) => {
|
|
79
79
|
let n = t[e];
|
|
80
|
-
return n == null || n === "" ? !1 : Array.isArray(n) ? n.length > 0 : typeof n == "object" ?
|
|
80
|
+
return n == null || n === "" ? !1 : Array.isArray(n) ? n.length > 0 : typeof n == "object" ? B(n) : !0;
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
return !0;
|
|
84
|
-
}, []),
|
|
85
|
-
if (!
|
|
84
|
+
}, []), V = m((e) => {
|
|
85
|
+
if (!P || !e) return e;
|
|
86
86
|
let t = {}, n = {};
|
|
87
|
-
Object.entries(
|
|
87
|
+
Object.entries(N || {}).forEach(([e, r]) => {
|
|
88
88
|
if (e.startsWith("ctx_")) {
|
|
89
89
|
let n = e.slice(4);
|
|
90
90
|
t[n] = r;
|
|
@@ -202,51 +202,51 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
|
|
|
202
202
|
}
|
|
203
203
|
return e;
|
|
204
204
|
}, [
|
|
205
|
-
F,
|
|
206
205
|
P,
|
|
206
|
+
N,
|
|
207
207
|
f.id
|
|
208
|
-
]),
|
|
208
|
+
]), H = g(() => {
|
|
209
209
|
let e = null;
|
|
210
|
-
if (
|
|
211
|
-
else if (
|
|
212
|
-
let t =
|
|
213
|
-
if (t?.processed &&
|
|
210
|
+
if (y && B(y)) e = y;
|
|
211
|
+
else if (j) {
|
|
212
|
+
let t = j;
|
|
213
|
+
if (t?.processed && B(t.processed)) e = t.processed;
|
|
214
214
|
else if (t?.raw) try {
|
|
215
215
|
let n = typeof t.raw == "string" ? JSON.parse(t.raw) : t.raw;
|
|
216
|
-
|
|
216
|
+
B(n) && (e = n);
|
|
217
217
|
} catch {}
|
|
218
218
|
} else {
|
|
219
219
|
let t = f.data;
|
|
220
|
-
if (t?.processed &&
|
|
220
|
+
if (t?.processed && B(t.processed)) e = t.processed;
|
|
221
221
|
else if (t?.raw) try {
|
|
222
222
|
let n = typeof t.raw == "string" ? JSON.parse(t.raw) : t.raw;
|
|
223
|
-
|
|
223
|
+
B(n) && (e = n);
|
|
224
224
|
} catch {}
|
|
225
225
|
}
|
|
226
226
|
if (!e) {
|
|
227
227
|
let t = f.config?.mockData;
|
|
228
228
|
if (t) try {
|
|
229
229
|
let n = typeof t == "string" ? JSON.parse(t) : t;
|
|
230
|
-
|
|
230
|
+
B(n) && (e = n);
|
|
231
231
|
} catch {}
|
|
232
232
|
}
|
|
233
|
-
return
|
|
233
|
+
return P && e ? V(e) : e;
|
|
234
234
|
}, [
|
|
235
|
-
|
|
235
|
+
y,
|
|
236
236
|
f,
|
|
237
|
-
|
|
238
|
-
F,
|
|
239
|
-
H,
|
|
237
|
+
j,
|
|
240
238
|
P,
|
|
241
|
-
V
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
239
|
+
V,
|
|
240
|
+
N,
|
|
241
|
+
B
|
|
242
|
+
]), U = g(() => H ?? null, [H]), { executeDrilldown: W, canDrilldown: G } = te({ onDrilldown: (e, t) => {
|
|
243
|
+
S?.(e);
|
|
244
|
+
} }), K = g(() => G(f), [f, G]), q = m((e) => {
|
|
245
245
|
if (!f.drilldown?.enabled) return;
|
|
246
246
|
let t = {
|
|
247
247
|
selectedData: e || {},
|
|
248
|
-
globalFilters:
|
|
249
|
-
widgetData:
|
|
248
|
+
globalFilters: A || {},
|
|
249
|
+
widgetData: U || {},
|
|
250
250
|
metadata: {
|
|
251
251
|
widgetId: f.id,
|
|
252
252
|
widgetType: f.type,
|
|
@@ -254,64 +254,64 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
|
|
|
254
254
|
},
|
|
255
255
|
sourceDashboardId: f.dashboardId
|
|
256
256
|
};
|
|
257
|
-
|
|
257
|
+
W(f.drilldown, t);
|
|
258
258
|
}, [
|
|
259
259
|
f,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
]),
|
|
264
|
-
|
|
260
|
+
U,
|
|
261
|
+
A,
|
|
262
|
+
W
|
|
263
|
+
]), J = _(null), Le = m((e) => {
|
|
264
|
+
J.current = {
|
|
265
265
|
x: e.clientX,
|
|
266
266
|
y: e.clientY
|
|
267
267
|
};
|
|
268
|
-
}, []),
|
|
269
|
-
if (e.stopPropagation(),
|
|
270
|
-
let t = Math.abs(e.clientX -
|
|
268
|
+
}, []), Re = m((e) => {
|
|
269
|
+
if (e.stopPropagation(), J.current) {
|
|
270
|
+
let t = Math.abs(e.clientX - J.current.x), n = Math.abs(e.clientY - J.current.y);
|
|
271
271
|
if (t > 5 || n > 5) {
|
|
272
|
-
|
|
272
|
+
J.current = null;
|
|
273
273
|
return;
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
|
|
276
|
+
J.current = null, E && D(f.id);
|
|
277
277
|
}, [
|
|
278
|
+
E,
|
|
278
279
|
D,
|
|
279
|
-
O,
|
|
280
280
|
f.id
|
|
281
|
-
]),
|
|
282
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(),
|
|
281
|
+
]), ze = m((e) => {
|
|
282
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), E && D(f.id));
|
|
283
283
|
}, [
|
|
284
|
+
E,
|
|
284
285
|
D,
|
|
285
|
-
O,
|
|
286
286
|
f.id
|
|
287
|
-
]),
|
|
287
|
+
]), Be = g(() => f.type === "custom" && ae(f.config), [f.type, f.config]), Ve = g(() => f.type === "custom" && ie(f.config), [f.type, f.config]), Y = K && !Ve, He = !F && !I && !U && !Be, X = g(() => f.renderer, [f]), Z = g(() => X && X !== "BIGCONSOLE", [X]), Ue = g(() => ({
|
|
288
288
|
widgetId: f.id,
|
|
289
|
-
data:
|
|
290
|
-
}), [f.id,
|
|
291
|
-
if (!
|
|
292
|
-
let n =
|
|
293
|
-
|
|
294
|
-
}, [
|
|
289
|
+
data: U || {}
|
|
290
|
+
}), [f.id, U]), Q = m((e, t) => {
|
|
291
|
+
if (!w) return;
|
|
292
|
+
let n = C?.find((t) => t.name === e.name);
|
|
293
|
+
w(n || e, t);
|
|
294
|
+
}, [w, C]), $ = m(() => {
|
|
295
295
|
let e = {
|
|
296
296
|
widget: f,
|
|
297
297
|
data: (() => {
|
|
298
|
-
if (!
|
|
298
|
+
if (!U) return U;
|
|
299
299
|
if (f.type === "table" || f.type === "pivot_table") {
|
|
300
|
-
if (Array.isArray(
|
|
301
|
-
if (
|
|
300
|
+
if (Array.isArray(U)) return U;
|
|
301
|
+
if (U && typeof U == "object" && "rows" in U) return U.rows;
|
|
302
302
|
}
|
|
303
303
|
if (f.type === "list") {
|
|
304
|
-
if (Array.isArray(
|
|
305
|
-
if (
|
|
304
|
+
if (Array.isArray(U)) return U;
|
|
305
|
+
if (U && typeof U == "object" && "items" in U) return U.items;
|
|
306
306
|
}
|
|
307
307
|
if (f.type === "funnel_chart") {
|
|
308
|
-
if (Array.isArray(
|
|
309
|
-
if (
|
|
308
|
+
if (Array.isArray(U)) return U;
|
|
309
|
+
if (U && typeof U == "object" && "stages" in U) return U.stages;
|
|
310
310
|
}
|
|
311
311
|
if (f.type === "chart") {
|
|
312
|
-
if (Array.isArray(
|
|
313
|
-
if (
|
|
314
|
-
let e =
|
|
312
|
+
if (Array.isArray(U)) return U;
|
|
313
|
+
if (U && typeof U == "object" && "datasets" in U) {
|
|
314
|
+
let e = U;
|
|
315
315
|
if (e.labels && e.datasets) return e.labels.map((t, n) => {
|
|
316
316
|
let r = { name: t };
|
|
317
317
|
return e.datasets?.forEach((e) => {
|
|
@@ -320,8 +320,8 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
|
|
|
320
320
|
});
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
if (f.type === "text" &&
|
|
324
|
-
let e =
|
|
323
|
+
if (f.type === "text" && U && typeof U == "object" && !("content" in U)) {
|
|
324
|
+
let e = U, t = [];
|
|
325
325
|
for (let [n, r] of Object.entries(e)) if (r && typeof r == "object" && !Array.isArray(r)) {
|
|
326
326
|
t.push(`### ${n}`);
|
|
327
327
|
for (let [e, n] of Object.entries(r)) t.push(`- **${e}:** ${n}`);
|
|
@@ -338,8 +338,8 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
|
|
|
338
338
|
}
|
|
339
339
|
if (f.type === "custom") {
|
|
340
340
|
let e = f.config?.valueField;
|
|
341
|
-
if (e &&
|
|
342
|
-
let t =
|
|
341
|
+
if (e && U && typeof U == "object" && !Array.isArray(U)) {
|
|
342
|
+
let t = U;
|
|
343
343
|
if (e in t) return {
|
|
344
344
|
value: t[e],
|
|
345
345
|
label: f.title,
|
|
@@ -347,13 +347,13 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
|
|
|
347
347
|
};
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
return
|
|
350
|
+
return U;
|
|
351
351
|
})(),
|
|
352
|
-
onDrilldown:
|
|
352
|
+
onDrilldown: K ? q : void 0
|
|
353
353
|
};
|
|
354
|
-
if (
|
|
354
|
+
if (Z) {
|
|
355
355
|
let e = {};
|
|
356
|
-
if (
|
|
356
|
+
if (H && typeof H == "object" && !Array.isArray(H) && Object.keys(H).length > 0 && (e = { ...H }), f.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
|
|
357
357
|
let t = f.config?.valueField;
|
|
358
358
|
if (t && t in e) {
|
|
359
359
|
let n = e[t], r = typeof n == "number" ? n.toLocaleString() : String(n);
|
|
@@ -366,140 +366,140 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
|
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
-
return /* @__PURE__ */
|
|
369
|
+
return /* @__PURE__ */ v(oe, {
|
|
370
370
|
widget: f,
|
|
371
371
|
data: e,
|
|
372
|
-
isEditMode:
|
|
373
|
-
isSelected:
|
|
374
|
-
isLoading:
|
|
375
|
-
error:
|
|
376
|
-
onDrilldown:
|
|
377
|
-
onAction:
|
|
372
|
+
isEditMode: E,
|
|
373
|
+
isSelected: O,
|
|
374
|
+
isLoading: F,
|
|
375
|
+
error: I,
|
|
376
|
+
onDrilldown: K ? q : void 0,
|
|
377
|
+
onAction: Q
|
|
378
378
|
});
|
|
379
379
|
}
|
|
380
380
|
switch (f.type?.toLowerCase() || "") {
|
|
381
|
-
case "metric_card": return /* @__PURE__ */
|
|
382
|
-
case "kpi_card_comparison": return /* @__PURE__ */
|
|
381
|
+
case "metric_card": return /* @__PURE__ */ v(ue, { ...e });
|
|
382
|
+
case "kpi_card_comparison": return /* @__PURE__ */ v(xe, { ...e });
|
|
383
383
|
case "chart":
|
|
384
|
-
case "funnel_chart": return /* @__PURE__ */
|
|
385
|
-
case "table":
|
|
386
|
-
case "pivot_table": return /* @__PURE__ */
|
|
387
|
-
case "gauge": return /* @__PURE__ */
|
|
388
|
-
case "progress": return /* @__PURE__ */
|
|
389
|
-
case "list": return /* @__PURE__ */
|
|
390
|
-
case "heatmap": return /* @__PURE__ */
|
|
391
|
-
case "calendar": return /* @__PURE__ */
|
|
392
|
-
case "timeline": return /* @__PURE__ */
|
|
393
|
-
case "kanban": return /* @__PURE__ */
|
|
394
|
-
case "form": return /* @__PURE__ */
|
|
395
|
-
case "text": return /* @__PURE__ */
|
|
396
|
-
case "iframe": return /* @__PURE__ */
|
|
397
|
-
case "map": return /* @__PURE__ */
|
|
398
|
-
case "custom": return /* @__PURE__ */
|
|
399
|
-
default: return p || /* @__PURE__ */
|
|
384
|
+
case "funnel_chart": return /* @__PURE__ */ v(de, { ...e });
|
|
385
|
+
case "table": return /* @__PURE__ */ v(fe, { ...e });
|
|
386
|
+
case "pivot_table": return /* @__PURE__ */ v(pe, { ...e });
|
|
387
|
+
case "gauge": return /* @__PURE__ */ v(me, { ...e });
|
|
388
|
+
case "progress": return /* @__PURE__ */ v(he, { ...e });
|
|
389
|
+
case "list": return /* @__PURE__ */ v(ge, { ...e });
|
|
390
|
+
case "heatmap": return /* @__PURE__ */ v(_e, { ...e });
|
|
391
|
+
case "calendar": return /* @__PURE__ */ v(ve, { ...e });
|
|
392
|
+
case "timeline": return /* @__PURE__ */ v(be, { ...e });
|
|
393
|
+
case "kanban": return /* @__PURE__ */ v(ye, { ...e });
|
|
394
|
+
case "form": return /* @__PURE__ */ v(Ee, { ...e });
|
|
395
|
+
case "text": return /* @__PURE__ */ v(Se, { ...e });
|
|
396
|
+
case "iframe": return /* @__PURE__ */ v(we, { ...e });
|
|
397
|
+
case "map": return /* @__PURE__ */ v(Ce, { ...e });
|
|
398
|
+
case "custom": return /* @__PURE__ */ v(Te, { ...e });
|
|
399
|
+
default: return p || /* @__PURE__ */ v(d, { widgetType: f.type });
|
|
400
400
|
}
|
|
401
401
|
}, [
|
|
402
402
|
f,
|
|
403
|
-
|
|
403
|
+
U,
|
|
404
404
|
p,
|
|
405
|
+
K,
|
|
405
406
|
q,
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
407
|
+
Z,
|
|
408
|
+
E,
|
|
409
|
+
O,
|
|
410
|
+
F,
|
|
410
411
|
I,
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
U
|
|
412
|
+
Q,
|
|
413
|
+
H
|
|
414
414
|
]);
|
|
415
|
-
return /* @__PURE__ */
|
|
416
|
-
ref:
|
|
415
|
+
return /* @__PURE__ */ le("div", {
|
|
416
|
+
ref: R,
|
|
417
417
|
className: `
|
|
418
418
|
group relative flex flex-col
|
|
419
419
|
h-full w-full
|
|
420
420
|
rounded-lg border
|
|
421
421
|
bg-bg-surface
|
|
422
422
|
transition-all duration-200
|
|
423
|
-
${
|
|
424
|
-
${
|
|
425
|
-
${
|
|
423
|
+
${O && E ? "border-action-primary-border ring-2 ring-action-primary-border/30" : "border-border-default hover:border-action-primary-bg"}
|
|
424
|
+
${E ? "cursor-pointer" : ""}
|
|
425
|
+
${b}
|
|
426
426
|
`,
|
|
427
|
-
onMouseDown:
|
|
428
|
-
onClick:
|
|
429
|
-
onKeyDown:
|
|
430
|
-
tabIndex:
|
|
431
|
-
role:
|
|
432
|
-
"aria-selected":
|
|
427
|
+
onMouseDown: Le,
|
|
428
|
+
onClick: Re,
|
|
429
|
+
onKeyDown: ze,
|
|
430
|
+
tabIndex: E ? 0 : -1,
|
|
431
|
+
role: E ? "button" : void 0,
|
|
432
|
+
"aria-selected": O,
|
|
433
433
|
"aria-label": `Widget: ${f.title}`,
|
|
434
434
|
"data-widget-id": f.id,
|
|
435
435
|
"data-widget-type": f.type,
|
|
436
436
|
children: [
|
|
437
|
-
/* @__PURE__ */
|
|
437
|
+
/* @__PURE__ */ v(l, {
|
|
438
438
|
widget: f,
|
|
439
|
-
definition:
|
|
440
|
-
isSelected:
|
|
441
|
-
isEditMode:
|
|
442
|
-
isLoading:
|
|
443
|
-
timeUntilRefresh: f.refreshInterval && !
|
|
444
|
-
hasDrilldown:
|
|
445
|
-
onRefresh:
|
|
446
|
-
onExportCSV:
|
|
447
|
-
onExportPNG:
|
|
448
|
-
onDrilldown:
|
|
439
|
+
definition: je,
|
|
440
|
+
isSelected: O,
|
|
441
|
+
isEditMode: E,
|
|
442
|
+
isLoading: F,
|
|
443
|
+
timeUntilRefresh: f.refreshInterval && !Pe ? s(Ne) : void 0,
|
|
444
|
+
hasDrilldown: K,
|
|
445
|
+
onRefresh: x,
|
|
446
|
+
onExportCSV: z ? Fe : void 0,
|
|
447
|
+
onExportPNG: Ie,
|
|
448
|
+
onDrilldown: K ? () => q() : void 0
|
|
449
449
|
}),
|
|
450
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ v("div", {
|
|
451
451
|
className: `
|
|
452
452
|
flex-1 overflow-hidden p-4 min-h-0
|
|
453
|
-
${
|
|
453
|
+
${Y && !E ? "cursor-pointer" : ""}
|
|
454
454
|
`,
|
|
455
|
-
title:
|
|
456
|
-
children: /* @__PURE__ */
|
|
455
|
+
title: Y && !E ? "Click data to drill down" : void 0,
|
|
456
|
+
children: /* @__PURE__ */ v("div", {
|
|
457
457
|
className: "h-full overflow-auto",
|
|
458
458
|
children: (() => {
|
|
459
|
-
if (
|
|
460
|
-
if (
|
|
461
|
-
error:
|
|
462
|
-
onRetry:
|
|
459
|
+
if (F) return /* @__PURE__ */ v(u, {});
|
|
460
|
+
if (I) return /* @__PURE__ */ v(ne, {
|
|
461
|
+
error: I,
|
|
462
|
+
onRetry: x
|
|
463
463
|
});
|
|
464
|
-
if (
|
|
464
|
+
if (He && !p) return /* @__PURE__ */ v(d, {
|
|
465
465
|
widgetType: f.type,
|
|
466
466
|
hasDataSource: !!f.parserId || !!f.dataSinkId
|
|
467
467
|
});
|
|
468
468
|
let e = `${f.parserId ?? ""}|${f.dataSinkId ?? ""}|${f.updatedAt ?? ""}`;
|
|
469
|
-
return /* @__PURE__ */
|
|
469
|
+
return /* @__PURE__ */ v(re, {
|
|
470
470
|
widgetId: f.id,
|
|
471
471
|
widgetType: f.type,
|
|
472
472
|
widgetTitle: f.title,
|
|
473
473
|
resetKey: e,
|
|
474
|
-
children: p ?? /* @__PURE__ */
|
|
475
|
-
fallback: /* @__PURE__ */
|
|
476
|
-
children:
|
|
474
|
+
children: p ?? /* @__PURE__ */ v(ce, {
|
|
475
|
+
fallback: /* @__PURE__ */ v(u, {}),
|
|
476
|
+
children: $()
|
|
477
477
|
})
|
|
478
478
|
});
|
|
479
479
|
})()
|
|
480
480
|
})
|
|
481
481
|
}),
|
|
482
|
-
|
|
482
|
+
C && C.length > 0 && !F && !I && /* @__PURE__ */ v("div", {
|
|
483
483
|
className: "px-4 py-3 border-t border-border-default bg-bg-muted",
|
|
484
484
|
style: { flexShrink: 0 },
|
|
485
|
-
children: /* @__PURE__ */
|
|
486
|
-
actions:
|
|
487
|
-
context:
|
|
488
|
-
onAction:
|
|
489
|
-
disabled:
|
|
485
|
+
children: /* @__PURE__ */ v(se, {
|
|
486
|
+
actions: C,
|
|
487
|
+
context: Ue,
|
|
488
|
+
onAction: w,
|
|
489
|
+
disabled: E,
|
|
490
490
|
layout: "horizontal",
|
|
491
491
|
size: "sm"
|
|
492
492
|
})
|
|
493
493
|
}),
|
|
494
|
-
|
|
494
|
+
Y && !E && /* @__PURE__ */ v("div", {
|
|
495
495
|
className: "\n absolute bottom-2 right-2\n opacity-0 group-hover:opacity-100\n transition-opacity duration-200\n ",
|
|
496
496
|
title: "Click to drill down",
|
|
497
|
-
children: /* @__PURE__ */
|
|
497
|
+
children: /* @__PURE__ */ v("svg", {
|
|
498
498
|
className: "w-4 h-4 text-text-secondary",
|
|
499
499
|
fill: "none",
|
|
500
500
|
stroke: "currentColor",
|
|
501
501
|
viewBox: "0 0 24 24",
|
|
502
|
-
children: /* @__PURE__ */
|
|
502
|
+
children: /* @__PURE__ */ v("path", {
|
|
503
503
|
strokeLinecap: "round",
|
|
504
504
|
strokeLinejoin: "round",
|
|
505
505
|
strokeWidth: 2,
|
|
@@ -509,8 +509,8 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
|
|
|
509
509
|
})
|
|
510
510
|
]
|
|
511
511
|
});
|
|
512
|
-
},
|
|
512
|
+
}, y);
|
|
513
513
|
//#endregion
|
|
514
|
-
export {
|
|
514
|
+
export { b as default };
|
|
515
515
|
|
|
516
516
|
//# sourceMappingURL=WidgetWrapper.js.map
|