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