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