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