@burdenoff/microfe-bigconsole 2026.1118.6 → 2026.1118.7
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/explore/SavedQueryWidget.d.ts +3 -1
- package/dist/bigconsole/components/explore/SavedQueryWidget.js +22 -18
- package/dist/bigconsole/components/widgets/WidgetMenu.js +86 -75
- package/dist/bigconsole/components/widgets/WidgetWrapper.js +221 -209
- package/package.json +1 -1
|
@@ -45,25 +45,29 @@ function u({ widgetId: e, workspaceId: u, actorId: d }) {
|
|
|
45
45
|
})
|
|
46
46
|
] });
|
|
47
47
|
}
|
|
48
|
-
function d({ id: t, title: n }) {
|
|
49
|
-
let
|
|
48
|
+
function d({ id: t, title: n, controls: r }) {
|
|
49
|
+
let i = e(), a = JSON.stringify([
|
|
50
|
+
i?.currentUser?.id,
|
|
51
|
+
i?.workspaceId,
|
|
52
|
+
t
|
|
53
|
+
]);
|
|
50
54
|
return /* @__PURE__ */ c("section", {
|
|
51
55
|
className: "h-full overflow-auto rounded-card border border-border-default bg-bg-surface p-3",
|
|
52
|
-
children: [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
});
|
|
56
|
+
children: [
|
|
57
|
+
i?.currentUser?.id && i.workspaceId && r,
|
|
58
|
+
/* @__PURE__ */ s("h3", {
|
|
59
|
+
className: "widget-drag-handle mb-2 font-medium [.react-draggable_&]:cursor-move",
|
|
60
|
+
children: n || "Saved query"
|
|
61
|
+
}),
|
|
62
|
+
i?.currentUser?.id && i.workspaceId ? /* @__PURE__ */ s(u, {
|
|
63
|
+
actorId: i.currentUser.id,
|
|
64
|
+
widgetId: t,
|
|
65
|
+
workspaceId: i.workspaceId
|
|
66
|
+
}) : /* @__PURE__ */ s("p", {
|
|
67
|
+
role: "alert",
|
|
68
|
+
children: "Sign in to view this widget."
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
}, a);
|
|
68
72
|
}
|
|
69
73
|
export { d as SavedQueryWidget };
|
|
@@ -9,37 +9,37 @@ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
|
9
9
|
import { createPortal as f } from "react-dom";
|
|
10
10
|
// src/bigconsole/components/widgets/WidgetMenu.tsx
|
|
11
11
|
var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onExportPNG: g, onSpotOutliers: _, onReconcile: v }) {
|
|
12
|
-
let [y, b] = s(!1), [x, S] = s({
|
|
12
|
+
let [y, b] = s(!1), [x, S] = s(!1), [C, w] = s({
|
|
13
13
|
top: 0,
|
|
14
14
|
left: 0
|
|
15
|
-
}),
|
|
15
|
+
}), T = o(null), E = o(null), { hasPermission: D } = c(), O = D(n.WIDGET_UPDATE), k = D(n.WIDGET_CREATE), A = D(n.WIDGET_DELETE), j = e((e) => e.selectWidget), M = e((e) => e.copyWidget), N = e((e) => e.cutWidget), P = e((e) => e.removeWidget), F = e((e) => e.openConfigPanel), { duplicateWidget: I, deleteWidget: L, refreshWidgetData: R } = t(r.pageId, r.dashboardId, { skipFetch: !0 });
|
|
16
16
|
a(() => {
|
|
17
17
|
let e = (e) => {
|
|
18
|
-
|
|
18
|
+
T.current && !T.current.contains(e.target) && E.current && !E.current.contains(e.target) && b(!1);
|
|
19
19
|
};
|
|
20
20
|
return y && document.addEventListener("mousedown", e), () => {
|
|
21
21
|
document.removeEventListener("mousedown", e);
|
|
22
22
|
};
|
|
23
23
|
}, [y]), a(() => {
|
|
24
24
|
let e = (e) => {
|
|
25
|
-
e.key === "Escape" && (b(!1),
|
|
25
|
+
e.key === "Escape" && (b(!1), E.current?.focus());
|
|
26
26
|
};
|
|
27
27
|
return y && document.addEventListener("keydown", e), () => {
|
|
28
28
|
document.removeEventListener("keydown", e);
|
|
29
29
|
};
|
|
30
30
|
}, [y]);
|
|
31
|
-
let
|
|
31
|
+
let z = i((e) => {
|
|
32
32
|
e.stopPropagation(), b((e) => {
|
|
33
|
-
if (!e &&
|
|
34
|
-
let e =
|
|
35
|
-
n + 160 > window.innerWidth - 10 && (n = window.innerWidth - 160 - 10), n < 10 && (n = 10), t + 320 > window.innerHeight - 10 && (t = e.top - 320 - 4, t < 10 && (t = 10)),
|
|
33
|
+
if (!e && E.current) {
|
|
34
|
+
let e = E.current.getBoundingClientRect(), t = e.bottom + 4, n = e.right - 160;
|
|
35
|
+
n + 160 > window.innerWidth - 10 && (n = window.innerWidth - 160 - 10), n < 10 && (n = 10), t + 320 > window.innerHeight - 10 && (t = e.top - 320 - 4, t < 10 && (t = 10)), w({
|
|
36
36
|
top: t + window.scrollY,
|
|
37
37
|
left: n + window.scrollX
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
return !e;
|
|
41
41
|
});
|
|
42
|
-
}, []),
|
|
42
|
+
}, []), B = [
|
|
43
43
|
{
|
|
44
44
|
id: "edit",
|
|
45
45
|
label: "Edit Widget",
|
|
@@ -56,10 +56,10 @@ var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onE
|
|
|
56
56
|
})
|
|
57
57
|
}),
|
|
58
58
|
action: () => {
|
|
59
|
-
|
|
59
|
+
j(r.id), F(), b(!1);
|
|
60
60
|
},
|
|
61
61
|
disabled: !p,
|
|
62
|
-
permitted:
|
|
62
|
+
permitted: O
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
id: "refresh",
|
|
@@ -77,7 +77,7 @@ var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onE
|
|
|
77
77
|
})
|
|
78
78
|
}),
|
|
79
79
|
action: async () => {
|
|
80
|
-
b(!1), m ? m() : await
|
|
80
|
+
b(!1), m ? m() : await R(r.id);
|
|
81
81
|
},
|
|
82
82
|
disabled: !1
|
|
83
83
|
},
|
|
@@ -183,10 +183,10 @@ var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onE
|
|
|
183
183
|
})
|
|
184
184
|
}),
|
|
185
185
|
action: () => {
|
|
186
|
-
|
|
186
|
+
M(r.id), b(!1);
|
|
187
187
|
},
|
|
188
188
|
disabled: !p,
|
|
189
|
-
permitted:
|
|
189
|
+
permitted: k
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
192
|
id: "cut",
|
|
@@ -204,10 +204,10 @@ var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onE
|
|
|
204
204
|
})
|
|
205
205
|
}),
|
|
206
206
|
action: () => {
|
|
207
|
-
|
|
207
|
+
N(r.id), b(!1);
|
|
208
208
|
},
|
|
209
209
|
disabled: !p,
|
|
210
|
-
permitted:
|
|
210
|
+
permitted: k && O
|
|
211
211
|
},
|
|
212
212
|
{
|
|
213
213
|
id: "duplicate",
|
|
@@ -232,10 +232,10 @@ var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onE
|
|
|
232
232
|
width: r.positionWidth ?? 4,
|
|
233
233
|
height: r.positionHeight ?? 4
|
|
234
234
|
};
|
|
235
|
-
await
|
|
235
|
+
await I(r.id, e, `${r.title} (Copy)`);
|
|
236
236
|
},
|
|
237
237
|
disabled: !p,
|
|
238
|
-
permitted:
|
|
238
|
+
permitted: k
|
|
239
239
|
},
|
|
240
240
|
{
|
|
241
241
|
id: "divider2",
|
|
@@ -260,24 +260,33 @@ var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onE
|
|
|
260
260
|
})
|
|
261
261
|
}),
|
|
262
262
|
action: async () => {
|
|
263
|
-
window.confirm("Are you sure you want to delete this widget?")
|
|
263
|
+
if (window.confirm("Are you sure you want to delete this widget?")) {
|
|
264
|
+
b(!1);
|
|
265
|
+
let e = await L(r.id);
|
|
266
|
+
r.savedQueryId ? S(!e) : e || P(r.id);
|
|
267
|
+
} else b(!1);
|
|
264
268
|
},
|
|
265
269
|
disabled: !p,
|
|
266
270
|
destructive: !0,
|
|
267
|
-
permitted:
|
|
271
|
+
permitted: A
|
|
268
272
|
}
|
|
269
|
-
].filter((e) => e.permitted !== !1),
|
|
273
|
+
].filter((e) => e.permitted !== !1 && (!r.savedQueryId || p && e.id === "delete")), V = B.filter((e, t) => {
|
|
270
274
|
if (!e.divider) return !0;
|
|
271
|
-
let n =
|
|
275
|
+
let n = B[t - 1], r = B[t + 1];
|
|
272
276
|
return n !== void 0 && r !== void 0 && !n.divider && !r.divider;
|
|
273
277
|
});
|
|
274
|
-
return /* @__PURE__ */ d("div", {
|
|
278
|
+
return V.length ? /* @__PURE__ */ d("div", {
|
|
275
279
|
className: "relative",
|
|
276
|
-
children: [
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
280
|
+
children: [
|
|
281
|
+
x && /* @__PURE__ */ u("span", {
|
|
282
|
+
role: "alert",
|
|
283
|
+
children: "Could not delete this widget."
|
|
284
|
+
}),
|
|
285
|
+
/* @__PURE__ */ u("button", {
|
|
286
|
+
ref: E,
|
|
287
|
+
type: "button",
|
|
288
|
+
onClick: z,
|
|
289
|
+
className: `
|
|
281
290
|
p-1.5 rounded-md
|
|
282
291
|
text-text-secondary
|
|
283
292
|
hover:text-text-primary
|
|
@@ -285,59 +294,61 @@ var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onE
|
|
|
285
294
|
transition-colors
|
|
286
295
|
${y ? "bg-bg-sunken" : ""}
|
|
287
296
|
`,
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
className: "\n min-w-[160px]\n py-1\n bg-bg-surface\n border border-border-default\n rounded-lg shadow-lg\n ",
|
|
322
|
-
role: "menu",
|
|
323
|
-
"aria-orientation": "vertical",
|
|
324
|
-
children: z.map((e) => e.divider ? /* @__PURE__ */ u("div", { className: "my-1 border-t border-border-default" }, e.id) : /* @__PURE__ */ d("button", {
|
|
325
|
-
type: "button",
|
|
326
|
-
onClick: (t) => {
|
|
327
|
-
t.stopPropagation(), e.action();
|
|
297
|
+
title: "Widget options",
|
|
298
|
+
"aria-haspopup": "menu",
|
|
299
|
+
"aria-expanded": y,
|
|
300
|
+
children: /* @__PURE__ */ d("svg", {
|
|
301
|
+
className: "w-4 h-4",
|
|
302
|
+
fill: "currentColor",
|
|
303
|
+
viewBox: "0 0 24 24",
|
|
304
|
+
children: [
|
|
305
|
+
/* @__PURE__ */ u("circle", {
|
|
306
|
+
cx: "12",
|
|
307
|
+
cy: "5",
|
|
308
|
+
r: "2"
|
|
309
|
+
}),
|
|
310
|
+
/* @__PURE__ */ u("circle", {
|
|
311
|
+
cx: "12",
|
|
312
|
+
cy: "12",
|
|
313
|
+
r: "2"
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ u("circle", {
|
|
316
|
+
cx: "12",
|
|
317
|
+
cy: "19",
|
|
318
|
+
r: "2"
|
|
319
|
+
})
|
|
320
|
+
]
|
|
321
|
+
})
|
|
322
|
+
}),
|
|
323
|
+
y && f(/* @__PURE__ */ u("div", {
|
|
324
|
+
ref: T,
|
|
325
|
+
style: {
|
|
326
|
+
position: "fixed",
|
|
327
|
+
top: C.top,
|
|
328
|
+
left: C.left,
|
|
329
|
+
zIndex: 99999
|
|
328
330
|
},
|
|
329
|
-
|
|
330
|
-
|
|
331
|
+
className: "\n min-w-[160px]\n py-1\n bg-bg-surface\n border border-border-default\n rounded-lg shadow-lg\n ",
|
|
332
|
+
role: "menu",
|
|
333
|
+
"aria-orientation": "vertical",
|
|
334
|
+
children: V.map((e) => e.divider ? /* @__PURE__ */ u("div", { className: "my-1 border-t border-border-default" }, e.id) : /* @__PURE__ */ d("button", {
|
|
335
|
+
type: "button",
|
|
336
|
+
onClick: (t) => {
|
|
337
|
+
t.stopPropagation(), e.action();
|
|
338
|
+
},
|
|
339
|
+
disabled: e.disabled,
|
|
340
|
+
className: `
|
|
331
341
|
w-full flex items-center gap-2
|
|
332
342
|
px-3 py-2 text-left text-sm
|
|
333
343
|
transition-colors
|
|
334
344
|
${e.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-bg-sunken"}
|
|
335
345
|
${e.destructive ? "text-status-error-text hover:text-status-error-text" : "text-text-primary"}
|
|
336
346
|
`,
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
347
|
+
role: "menuitem",
|
|
348
|
+
children: [e.icon, /* @__PURE__ */ u("span", { children: e.label })]
|
|
349
|
+
}, e.id))
|
|
350
|
+
}), document.body)
|
|
351
|
+
]
|
|
352
|
+
}) : null;
|
|
342
353
|
});
|
|
343
354
|
export { p as WidgetMenu, p as default };
|
|
@@ -9,12 +9,13 @@ import ae from "../../hooks/useWidgetComments.js";
|
|
|
9
9
|
import oe from "../../hooks/useWidgetExport.js";
|
|
10
10
|
import se from "../../hooks/useDrilldown.js";
|
|
11
11
|
import { getWidgetDefinition as ce } from "./WidgetRegistry.js";
|
|
12
|
-
import { resolveTextData as
|
|
13
|
-
import { WidgetHeader as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
12
|
+
import { resolveTextData as le } from "./text-widget/textData.js";
|
|
13
|
+
import { WidgetHeader as ue } from "./WidgetHeader.js";
|
|
14
|
+
import { WidgetMenu as i } from "./WidgetMenu.js";
|
|
15
|
+
import { useBigConsoleSettings as de } from "../../hooks/useBigConsoleSettings.js";
|
|
16
|
+
import { WidgetLoadingState as a } from "./states/LoadingState.js";
|
|
16
17
|
import { WidgetErrorState as fe } from "./states/ErrorState.js";
|
|
17
|
-
import { WidgetEmptyState as
|
|
18
|
+
import { WidgetEmptyState as o } from "./states/EmptyState.js";
|
|
18
19
|
import { WidgetErrorBoundary as pe } from "./WidgetErrorBoundary.js";
|
|
19
20
|
import { hasCustomIframeConfig as me, hasRenderableCustomConfig as he } from "./custom/config.js";
|
|
20
21
|
import { getBindingForWidget as ge } from "../../utils/widgetBinding.js";
|
|
@@ -28,31 +29,31 @@ import { WidgetRendererFactory as De } from "../../renderers/factory/WidgetRende
|
|
|
28
29
|
import { WidgetActions as Oe } from "./widget-actions/WidgetActions.js";
|
|
29
30
|
import "./widget-actions/index.js";
|
|
30
31
|
import { dashboardSuggestAnchorProps as ke } from "../../proactive/entities.js";
|
|
31
|
-
import { Suspense as
|
|
32
|
+
import { Suspense as s, lazy as c, memo as l, useCallback as u, useEffect as Ae, useMemo as d, useRef as f, useState as p } from "react";
|
|
32
33
|
import { useI18n as je } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
33
34
|
import { useQuery as Me } from "@apollo/client/react";
|
|
34
|
-
import { jsx as
|
|
35
|
+
import { jsx as m, jsxs as Ne } from "react/jsx-runtime";
|
|
35
36
|
// src/bigconsole/components/widgets/WidgetWrapper.tsx
|
|
36
|
-
var Pe =
|
|
37
|
-
|
|
38
|
-
var Qe =
|
|
37
|
+
var Pe = c(() => import("../reconcile/KpiReconcileDialog.js").then((e) => ({ default: e.KpiReconcileDialog }))), Fe = c(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), Ie = c(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), Le = c(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), Re = c(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), ze = c(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), Be = c(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), Ve = c(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), He = c(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), Ue = c(() => import("./retention/index.js").then((e) => ({ default: e.RetentionWidget }))), We = c(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), Ge = c(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), Ke = c(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), qe = c(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), Je = c(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), Ye = c(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), Xe = c(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), Ze = c(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget })));
|
|
38
|
+
c(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget })));
|
|
39
|
+
var Qe = c(() => import("./form/index.js").then((e) => ({ default: e.FormWidget }))), $e = c(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.SankeyWidget }))), et = c(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.BoxPlotWidget }))), tt = c(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.WaterfallWidget }))), nt = c(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments }))), rt = /* @__PURE__ */ new Set([
|
|
39
40
|
"text",
|
|
40
41
|
"iframe",
|
|
41
42
|
"form",
|
|
42
43
|
"adaptive_card"
|
|
43
44
|
]);
|
|
44
|
-
function
|
|
45
|
+
function h(e, t) {
|
|
45
46
|
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) && e.narrativeOpen === t.narrativeOpen && e.narrativePanel === t.narrativePanel;
|
|
46
47
|
}
|
|
47
|
-
var
|
|
48
|
-
let
|
|
49
|
-
variables: { id:
|
|
50
|
-
skip: !
|
|
48
|
+
var it = l(function({ widget: i, children: c, data: l, className: h = "", isLoading: it, error: g, onRefresh: _, onDrilldown: v, actions: y, onAction: b, filterValues: x, onToggleNarrative: at, narrativeOpen: ot = !1, narrativePanel: st, previewOnly: S = !1 }) {
|
|
49
|
+
let C = de(), ct = r((e) => e.viewMode === "edit"), w = !S && ct, T = t((e) => e.selectWidget), E = e(i.id), D = n(i.id), O = ee(), { t: lt } = je(), k = i.dashboardId, { data: ut } = Me(ne, {
|
|
50
|
+
variables: { id: k ?? "" },
|
|
51
|
+
skip: !k,
|
|
51
52
|
fetchPolicy: "cache-only"
|
|
52
|
-
}),
|
|
53
|
-
skip:
|
|
54
|
-
pollInterval: (
|
|
55
|
-
}),
|
|
53
|
+
}), A = ut?.getDashboard?.globalFilters, j = d(() => _e(A), [A]), M = d(() => Object.fromEntries(Object.entries(j).map(([e, t]) => [e, t.field])), [j]), N = d(() => ge(i), [i]), { hasDataSource: P, allowSamples: F, mockSource: I } = Te(i, N), { data: L, loading: dt, error: ft } = te(i.id, {
|
|
54
|
+
skip: S || !P,
|
|
55
|
+
pollInterval: (i.refreshInterval ?? 0) * 1e3 || 0
|
|
56
|
+
}), R = d(() => {
|
|
56
57
|
if (typeof window > "u") return {};
|
|
57
58
|
let e = new URLSearchParams(window.location.search), t = {};
|
|
58
59
|
return e.forEach((e, n) => {
|
|
@@ -61,101 +62,101 @@ var h = c(function({ widget: s, children: c, data: m, className: h = "", isLoadi
|
|
|
61
62
|
r.startsWith("__") || (t[r] = e);
|
|
62
63
|
}
|
|
63
64
|
}), t;
|
|
64
|
-
}, []),
|
|
65
|
+
}, []), z = d(() => {
|
|
65
66
|
let e = {};
|
|
66
|
-
return
|
|
67
|
+
return R && Object.keys(R).length > 0 && Object.assign(e, R), O && Object.keys(O).length > 0 && Object.assign(e, O), x && Object.keys(x).length > 0 && Object.assign(e, x), e;
|
|
67
68
|
}, [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
]),
|
|
69
|
+
R,
|
|
70
|
+
O,
|
|
71
|
+
x
|
|
72
|
+
]), B = Object.keys(z).length > 0, V = it ?? (dt && !L) ?? D.isLoading, H = g ?? ft?.message ?? D.errorMessage, pt = ce(i.type), U = f(_);
|
|
72
73
|
Ae(() => {
|
|
73
|
-
|
|
74
|
+
U.current = _;
|
|
74
75
|
}, [_]);
|
|
75
|
-
let
|
|
76
|
-
|
|
77
|
-
}, []), { timeUntilRefresh:
|
|
78
|
-
widgetId:
|
|
79
|
-
refreshInterval:
|
|
80
|
-
onRefresh:
|
|
81
|
-
enabled: !
|
|
82
|
-
}),
|
|
76
|
+
let mt = u(async () => {
|
|
77
|
+
U.current && await U.current();
|
|
78
|
+
}, []), { timeUntilRefresh: ht, isPaused: gt } = ie({
|
|
79
|
+
widgetId: i.id,
|
|
80
|
+
refreshInterval: i.refreshInterval,
|
|
81
|
+
onRefresh: mt,
|
|
82
|
+
enabled: !S && !w && !!i.refreshInterval
|
|
83
|
+
}), W = f(null), [_t, vt] = p(!1), [yt, bt] = p(!1), { count: xt } = ae(i.id, yt), St = u(() => {
|
|
83
84
|
bt(!0), vt((e) => !e);
|
|
84
|
-
}, []), G =
|
|
85
|
-
explicit:
|
|
86
|
-
fetched:
|
|
87
|
-
persisted:
|
|
88
|
-
config:
|
|
89
|
-
allowSamples:
|
|
90
|
-
mockSource:
|
|
91
|
-
widgetType:
|
|
85
|
+
}, []), G = d(() => we({
|
|
86
|
+
explicit: l,
|
|
87
|
+
fetched: L,
|
|
88
|
+
persisted: i.data,
|
|
89
|
+
config: i.config,
|
|
90
|
+
allowSamples: F,
|
|
91
|
+
mockSource: I,
|
|
92
|
+
widgetType: i.type
|
|
92
93
|
}), [
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
]), K =
|
|
94
|
+
l,
|
|
95
|
+
L,
|
|
96
|
+
i,
|
|
97
|
+
F,
|
|
98
|
+
I
|
|
99
|
+
]), K = d(() => {
|
|
99
100
|
let e = G.data;
|
|
100
101
|
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
101
|
-
let t =
|
|
102
|
+
let t = i.config, n = t?.dataKey ?? t?.dataPath ?? t?.seriesPath;
|
|
102
103
|
if (n && typeof n == "string") {
|
|
103
104
|
let t = n.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
|
|
104
105
|
t != null && Ce(t) && (e = t);
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
108
|
return e;
|
|
108
|
-
}, [G,
|
|
109
|
-
filterValues:
|
|
110
|
-
filterFieldMap:
|
|
111
|
-
widgetType:
|
|
109
|
+
}, [G, i.config]), q = d(() => B ? ye(K, {
|
|
110
|
+
filterValues: z,
|
|
111
|
+
filterFieldMap: M,
|
|
112
|
+
widgetType: i.type
|
|
112
113
|
}) : K, [
|
|
113
114
|
K,
|
|
115
|
+
B,
|
|
114
116
|
z,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
]), Ct = q !== null && G.isSample, wt = u(() => rt.has(s.type) ? [] : ve(K, A, R, s.type), [
|
|
117
|
+
M,
|
|
118
|
+
i.type
|
|
119
|
+
]), Ct = q !== null && G.isSample, wt = d(() => rt.has(i.type) ? [] : ve(K, j, z, i.type), [
|
|
119
120
|
K,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
]), Tt =
|
|
124
|
-
let e =
|
|
121
|
+
j,
|
|
122
|
+
z,
|
|
123
|
+
i.type
|
|
124
|
+
]), Tt = d(() => Ee(q, i.type), [q, i.type]), Et = d(() => {
|
|
125
|
+
let e = i.config;
|
|
125
126
|
return be(q, {
|
|
126
127
|
xAxisKey: typeof e?.xAxisKey == "string" ? e.xAxisKey : void 0,
|
|
127
128
|
selectedFields: Array.isArray(e?.selectedFields) ? e.selectedFields.filter((e) => typeof e == "string") : void 0
|
|
128
129
|
});
|
|
129
|
-
}, [q,
|
|
130
|
+
}, [q, i.config]), [Dt, Ot] = p(!1), [kt, At] = p(!1), jt = Se(i.type, S), { exportCSV: Mt, exportPNG: Nt } = oe(i, {
|
|
130
131
|
data: Tt,
|
|
131
|
-
containerRef:
|
|
132
|
+
containerRef: W
|
|
132
133
|
}), { executeDrilldown: Pt, canDrilldown: Ft } = se({ onDrilldown: (e, t) => {
|
|
133
|
-
|
|
134
|
-
} }), J =
|
|
135
|
-
if (!
|
|
134
|
+
v?.(e);
|
|
135
|
+
} }), J = d(() => Ft(i), [i, Ft]), It = u((e) => {
|
|
136
|
+
if (!i.drilldown?.enabled) return;
|
|
136
137
|
let t = {
|
|
137
138
|
selectedData: e || {},
|
|
138
|
-
globalFilters:
|
|
139
|
+
globalFilters: O || {},
|
|
139
140
|
widgetData: q || {},
|
|
140
141
|
metadata: {
|
|
141
|
-
widgetId:
|
|
142
|
-
widgetType:
|
|
143
|
-
widgetTitle:
|
|
142
|
+
widgetId: i.id,
|
|
143
|
+
widgetType: i.type,
|
|
144
|
+
widgetTitle: i.title
|
|
144
145
|
},
|
|
145
|
-
sourceDashboardId:
|
|
146
|
+
sourceDashboardId: i.dashboardId
|
|
146
147
|
};
|
|
147
|
-
Pt(
|
|
148
|
+
Pt(i.drilldown, t);
|
|
148
149
|
}, [
|
|
149
|
-
|
|
150
|
+
i,
|
|
150
151
|
q,
|
|
151
|
-
|
|
152
|
+
O,
|
|
152
153
|
Pt
|
|
153
|
-
]), Y = J && !
|
|
154
|
+
]), Y = J && !w ? It : void 0, X = f(null), Lt = u((e) => {
|
|
154
155
|
X.current = {
|
|
155
156
|
x: e.clientX,
|
|
156
157
|
y: e.clientY
|
|
157
158
|
};
|
|
158
|
-
}, []), Rt =
|
|
159
|
+
}, []), Rt = u((e) => {
|
|
159
160
|
if (e.stopPropagation(), X.current) {
|
|
160
161
|
let t = Math.abs(e.clientX - X.current.x), n = Math.abs(e.clientY - X.current.y);
|
|
161
162
|
if (t > 5 || n > 5) {
|
|
@@ -163,44 +164,44 @@ var h = c(function({ widget: s, children: c, data: m, className: h = "", isLoadi
|
|
|
163
164
|
return;
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
|
-
X.current = null,
|
|
167
|
+
X.current = null, w && T(i.id);
|
|
167
168
|
}, [
|
|
168
|
-
C,
|
|
169
169
|
w,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
T,
|
|
171
|
+
i.id
|
|
172
|
+
]), zt = u((e) => {
|
|
173
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), w && T(i.id));
|
|
173
174
|
}, [
|
|
174
|
-
C,
|
|
175
175
|
w,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
176
|
+
T,
|
|
177
|
+
i.id
|
|
178
|
+
]), Bt = d(() => i.type === "custom" && he(i.config), [i.type, i.config]), Vt = d(() => i.type === "custom" && me(i.config), [i.type, i.config]), Z = J && !Vt, Ht = d(() => i.type === "text" && le(i.config, q).hasContent, [
|
|
179
|
+
i.type,
|
|
180
|
+
i.config,
|
|
180
181
|
q
|
|
181
|
-
]), Ut = !
|
|
182
|
-
widgetId:
|
|
182
|
+
]), Ut = !V && !H && !q && !Bt && !Ht, Q = d(() => i.renderer, [i]), Wt = d(() => Q && Q !== "BIGCONSOLE", [Q]), Gt = d(() => ({
|
|
183
|
+
widgetId: i.id,
|
|
183
184
|
data: q || {}
|
|
184
|
-
}), [
|
|
185
|
-
if (!
|
|
186
|
-
let n =
|
|
187
|
-
|
|
188
|
-
}, [
|
|
185
|
+
}), [i.id, q]), $ = u((e, t) => {
|
|
186
|
+
if (!b) return;
|
|
187
|
+
let n = y?.find((t) => t.name === e.name);
|
|
188
|
+
b(n || e, t);
|
|
189
|
+
}, [b, y]), Kt = u(() => {
|
|
189
190
|
let e = (() => {
|
|
190
191
|
if (!q) return q;
|
|
191
|
-
if (
|
|
192
|
+
if (i.type === "pivot_table") {
|
|
192
193
|
if (Array.isArray(q)) return q;
|
|
193
194
|
if (q && typeof q == "object" && "rows" in q) return q.rows;
|
|
194
195
|
}
|
|
195
|
-
if (
|
|
196
|
+
if (i.type === "list") {
|
|
196
197
|
if (Array.isArray(q)) return q;
|
|
197
198
|
if (q && typeof q == "object" && "items" in q) return q.items;
|
|
198
199
|
}
|
|
199
|
-
if (
|
|
200
|
+
if (i.type === "funnel_chart") {
|
|
200
201
|
if (Array.isArray(q)) return q;
|
|
201
202
|
if (q && typeof q == "object" && "stages" in q) return q.stages;
|
|
202
203
|
}
|
|
203
|
-
if (
|
|
204
|
+
if (i.type === "chart") {
|
|
204
205
|
if (Array.isArray(q)) return q;
|
|
205
206
|
if (q && typeof q == "object" && "datasets" in q) {
|
|
206
207
|
let e = q;
|
|
@@ -212,269 +213,269 @@ var h = c(function({ widget: s, children: c, data: m, className: h = "", isLoadi
|
|
|
212
213
|
});
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
|
-
if (
|
|
216
|
-
let e = i
|
|
216
|
+
if (i.type === "text") {
|
|
217
|
+
let e = le(i.config, q);
|
|
217
218
|
return {
|
|
218
219
|
content: e.content,
|
|
219
220
|
format: e.format,
|
|
220
221
|
alignment: e.alignment
|
|
221
222
|
};
|
|
222
223
|
}
|
|
223
|
-
if (
|
|
224
|
-
let e =
|
|
224
|
+
if (i.type === "custom") {
|
|
225
|
+
let e = i.config?.valueField;
|
|
225
226
|
if (e && q && typeof q == "object" && !Array.isArray(q)) {
|
|
226
227
|
let t = q;
|
|
227
228
|
if (e in t) return {
|
|
228
229
|
value: t[e],
|
|
229
|
-
label:
|
|
230
|
+
label: i.title,
|
|
230
231
|
data: t
|
|
231
232
|
};
|
|
232
233
|
}
|
|
233
234
|
}
|
|
234
235
|
return q;
|
|
235
236
|
})(), t = {
|
|
236
|
-
widget:
|
|
237
|
+
widget: i,
|
|
237
238
|
onDrilldown: Y
|
|
238
239
|
};
|
|
239
240
|
if (Wt) {
|
|
240
241
|
let e = {};
|
|
241
|
-
if (q && typeof q == "object" && !Array.isArray(q) && Object.keys(q).length > 0 && (e = { ...q }),
|
|
242
|
-
let t =
|
|
242
|
+
if (q && typeof q == "object" && !Array.isArray(q) && Object.keys(q).length > 0 && (e = { ...q }), i.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
|
|
243
|
+
let t = i.config?.valueField;
|
|
243
244
|
if (t && t in e) {
|
|
244
245
|
let n = e[t], r = typeof n == "number" ? n.toLocaleString() : String(n);
|
|
245
246
|
e = {
|
|
246
247
|
...e,
|
|
247
248
|
value: n,
|
|
248
249
|
title: e.title || r,
|
|
249
|
-
description: e.description ||
|
|
250
|
+
description: e.description || i.title || "",
|
|
250
251
|
text: e.text || r
|
|
251
252
|
};
|
|
252
253
|
}
|
|
253
254
|
}
|
|
254
|
-
return /* @__PURE__ */
|
|
255
|
-
widget:
|
|
255
|
+
return /* @__PURE__ */ m(De, {
|
|
256
|
+
widget: i,
|
|
256
257
|
data: e,
|
|
257
|
-
isEditMode:
|
|
258
|
-
isSelected:
|
|
259
|
-
isLoading:
|
|
260
|
-
error:
|
|
258
|
+
isEditMode: w,
|
|
259
|
+
isSelected: E,
|
|
260
|
+
isLoading: V,
|
|
261
|
+
error: H,
|
|
261
262
|
onDrilldown: Y,
|
|
262
263
|
onAction: $
|
|
263
264
|
});
|
|
264
265
|
}
|
|
265
|
-
switch (
|
|
266
|
-
case "metric_card": return /* @__PURE__ */
|
|
266
|
+
switch (i.type?.toLowerCase() || "") {
|
|
267
|
+
case "metric_card": return /* @__PURE__ */ m(Fe, {
|
|
267
268
|
...t,
|
|
268
269
|
data: e
|
|
269
270
|
});
|
|
270
|
-
case "kpi_card_comparison": return /* @__PURE__ */
|
|
271
|
+
case "kpi_card_comparison": return /* @__PURE__ */ m(qe, {
|
|
271
272
|
...t,
|
|
272
273
|
data: e
|
|
273
274
|
});
|
|
274
275
|
case "chart":
|
|
275
|
-
case "funnel_chart": return /* @__PURE__ */
|
|
276
|
+
case "funnel_chart": return /* @__PURE__ */ m(Ie, {
|
|
276
277
|
...t,
|
|
277
278
|
data: e
|
|
278
279
|
});
|
|
279
|
-
case "waterfall": return /* @__PURE__ */
|
|
280
|
+
case "waterfall": return /* @__PURE__ */ m(tt, {
|
|
280
281
|
...t,
|
|
281
282
|
data: e
|
|
282
283
|
});
|
|
283
|
-
case "sankey": return /* @__PURE__ */
|
|
284
|
+
case "sankey": return /* @__PURE__ */ m($e, {
|
|
284
285
|
...t,
|
|
285
286
|
data: e
|
|
286
287
|
});
|
|
287
|
-
case "box_plot": return /* @__PURE__ */
|
|
288
|
+
case "box_plot": return /* @__PURE__ */ m(et, {
|
|
288
289
|
...t,
|
|
289
290
|
data: e
|
|
290
291
|
});
|
|
291
|
-
case "table": return /* @__PURE__ */
|
|
292
|
+
case "table": return /* @__PURE__ */ m(Le, {
|
|
292
293
|
...t,
|
|
293
294
|
data: e
|
|
294
295
|
});
|
|
295
|
-
case "pivot_table": return /* @__PURE__ */
|
|
296
|
+
case "pivot_table": return /* @__PURE__ */ m(Re, {
|
|
296
297
|
...t,
|
|
297
298
|
data: e
|
|
298
299
|
});
|
|
299
|
-
case "gauge": return /* @__PURE__ */
|
|
300
|
+
case "gauge": return /* @__PURE__ */ m(ze, {
|
|
300
301
|
...t,
|
|
301
302
|
data: e
|
|
302
303
|
});
|
|
303
|
-
case "progress": return /* @__PURE__ */
|
|
304
|
+
case "progress": return /* @__PURE__ */ m(Be, {
|
|
304
305
|
...t,
|
|
305
306
|
data: e
|
|
306
307
|
});
|
|
307
|
-
case "list": return /* @__PURE__ */
|
|
308
|
+
case "list": return /* @__PURE__ */ m(Ve, {
|
|
308
309
|
...t,
|
|
309
310
|
data: e
|
|
310
311
|
});
|
|
311
|
-
case "heatmap": return /* @__PURE__ */
|
|
312
|
+
case "heatmap": return /* @__PURE__ */ m(He, {
|
|
312
313
|
...t,
|
|
313
314
|
data: e
|
|
314
315
|
});
|
|
315
|
-
case "retention": return /* @__PURE__ */
|
|
316
|
+
case "retention": return /* @__PURE__ */ m(Ue, {
|
|
316
317
|
...t,
|
|
317
318
|
data: e
|
|
318
319
|
});
|
|
319
|
-
case "calendar": return /* @__PURE__ */
|
|
320
|
+
case "calendar": return /* @__PURE__ */ m(We, {
|
|
320
321
|
...t,
|
|
321
322
|
data: e
|
|
322
323
|
});
|
|
323
|
-
case "timeline": return /* @__PURE__ */
|
|
324
|
+
case "timeline": return /* @__PURE__ */ m(Ke, {
|
|
324
325
|
...t,
|
|
325
326
|
data: e
|
|
326
327
|
});
|
|
327
|
-
case "kanban": return /* @__PURE__ */
|
|
328
|
+
case "kanban": return /* @__PURE__ */ m(Ge, {
|
|
328
329
|
...t,
|
|
329
330
|
data: e
|
|
330
331
|
});
|
|
331
|
-
case "form": return /* @__PURE__ */
|
|
332
|
+
case "form": return /* @__PURE__ */ m(Qe, {
|
|
332
333
|
...t,
|
|
333
334
|
data: e
|
|
334
335
|
});
|
|
335
|
-
case "text": return /* @__PURE__ */
|
|
336
|
+
case "text": return /* @__PURE__ */ m(Je, {
|
|
336
337
|
...t,
|
|
337
338
|
data: e
|
|
338
339
|
});
|
|
339
|
-
case "iframe": return /* @__PURE__ */
|
|
340
|
+
case "iframe": return /* @__PURE__ */ m(Xe, {
|
|
340
341
|
...t,
|
|
341
342
|
data: e
|
|
342
343
|
});
|
|
343
|
-
case "map": return /* @__PURE__ */
|
|
344
|
+
case "map": return /* @__PURE__ */ m(Ye, {
|
|
344
345
|
...t,
|
|
345
346
|
data: e
|
|
346
347
|
});
|
|
347
|
-
case "custom": return /* @__PURE__ */
|
|
348
|
+
case "custom": return /* @__PURE__ */ m(Ze, {
|
|
348
349
|
...t,
|
|
349
350
|
data: e
|
|
350
351
|
});
|
|
351
|
-
default: return c || /* @__PURE__ */
|
|
352
|
+
default: return c || /* @__PURE__ */ m(o, { widgetType: i.type });
|
|
352
353
|
}
|
|
353
354
|
}, [
|
|
354
|
-
|
|
355
|
+
i,
|
|
355
356
|
q,
|
|
356
357
|
c,
|
|
357
358
|
Y,
|
|
358
359
|
Wt,
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
B,
|
|
360
|
+
w,
|
|
361
|
+
E,
|
|
362
362
|
V,
|
|
363
|
+
H,
|
|
363
364
|
$
|
|
364
365
|
]), qt = () => {
|
|
365
|
-
if (
|
|
366
|
-
if (
|
|
367
|
-
error:
|
|
366
|
+
if (V) return /* @__PURE__ */ m(a, {});
|
|
367
|
+
if (H) return /* @__PURE__ */ m(fe, {
|
|
368
|
+
error: H,
|
|
368
369
|
onRetry: _
|
|
369
370
|
});
|
|
370
|
-
if (Ut && !c) return /* @__PURE__ */
|
|
371
|
-
widgetType:
|
|
372
|
-
hideEditHint:
|
|
373
|
-
hasDataSource:
|
|
374
|
-
compact: (
|
|
375
|
-
templateSlot: typeof
|
|
371
|
+
if (Ut && !c) return /* @__PURE__ */ m(o, {
|
|
372
|
+
widgetType: i.type,
|
|
373
|
+
hideEditHint: S,
|
|
374
|
+
hasDataSource: P,
|
|
375
|
+
compact: (i.position?.height ?? i.positionHeight ?? 4) <= 2,
|
|
376
|
+
templateSlot: typeof i.metadata?.templateDataSinkSlot == "string" ? i.metadata.templateDataSinkSlot : null
|
|
376
377
|
});
|
|
377
|
-
let e = `${
|
|
378
|
-
return /* @__PURE__ */
|
|
379
|
-
widgetId:
|
|
380
|
-
widgetType:
|
|
381
|
-
widgetTitle:
|
|
378
|
+
let e = `${N.source.kind}|${N.source.ref ?? ""}|${N.parserId ?? ""}|${i.updatedAt ?? ""}`;
|
|
379
|
+
return /* @__PURE__ */ m(pe, {
|
|
380
|
+
widgetId: i.id,
|
|
381
|
+
widgetType: i.type,
|
|
382
|
+
widgetTitle: i.title,
|
|
382
383
|
resetKey: e,
|
|
383
|
-
children: c ?? /* @__PURE__ */
|
|
384
|
-
fallback: /* @__PURE__ */
|
|
384
|
+
children: c ?? /* @__PURE__ */ m(s, {
|
|
385
|
+
fallback: /* @__PURE__ */ m(a, {}),
|
|
385
386
|
children: Kt()
|
|
386
387
|
})
|
|
387
388
|
});
|
|
388
389
|
};
|
|
389
390
|
return /* @__PURE__ */ Ne("div", {
|
|
390
|
-
ref:
|
|
391
|
-
...
|
|
391
|
+
ref: W,
|
|
392
|
+
...S ? {} : ke(i.dashboardId, i.id),
|
|
392
393
|
className: `
|
|
393
394
|
group relative flex flex-col
|
|
394
395
|
h-full w-full min-w-0
|
|
395
396
|
rounded-card border
|
|
396
397
|
bg-bg-surface
|
|
397
398
|
shadow-[var(--shadow-elevation-1)]
|
|
398
|
-
${
|
|
399
|
-
${
|
|
400
|
-
${
|
|
399
|
+
${C.animationsEnabled ? "motion-safe:transition-[box-shadow,border-color] motion-safe:duration-200" : ""}
|
|
400
|
+
${E && w ? "border-[var(--color-action-primary-border)] ring-2 ring-[var(--color-action-primary-border)]/30 shadow-[var(--shadow-elevation-2)]" : C.showWidgetBorders ? "border-[var(--color-border-subtle)] hover:border-action-primary-bg hover:shadow-[var(--shadow-elevation-2)]" : "border-transparent"}
|
|
401
|
+
${w ? "cursor-pointer" : ""}
|
|
401
402
|
${h}
|
|
402
403
|
`,
|
|
403
404
|
onMouseDown: Lt,
|
|
404
405
|
onClick: Rt,
|
|
405
406
|
onKeyDown: zt,
|
|
406
|
-
tabIndex:
|
|
407
|
-
role:
|
|
408
|
-
"aria-selected":
|
|
409
|
-
"aria-label": `Widget: ${
|
|
410
|
-
"data-widget-id":
|
|
411
|
-
"data-widget-type":
|
|
407
|
+
tabIndex: w ? 0 : -1,
|
|
408
|
+
role: w ? "button" : void 0,
|
|
409
|
+
"aria-selected": E,
|
|
410
|
+
"aria-label": `Widget: ${i.title}`,
|
|
411
|
+
"data-widget-id": i.id,
|
|
412
|
+
"data-widget-type": i.type,
|
|
412
413
|
children: [
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
-
widget:
|
|
415
|
-
previewOnly:
|
|
416
|
-
definition:
|
|
417
|
-
isSelected:
|
|
418
|
-
isEditMode:
|
|
419
|
-
isLoading:
|
|
414
|
+
/* @__PURE__ */ m(ue, {
|
|
415
|
+
widget: i,
|
|
416
|
+
previewOnly: S,
|
|
417
|
+
definition: pt,
|
|
418
|
+
isSelected: E,
|
|
419
|
+
isEditMode: w,
|
|
420
|
+
isLoading: V,
|
|
420
421
|
isSampleData: Ct,
|
|
421
|
-
timeUntilRefresh:
|
|
422
|
+
timeUntilRefresh: i.refreshInterval && !gt ? re(ht) : void 0,
|
|
422
423
|
hasDrilldown: J,
|
|
423
424
|
onRefresh: _,
|
|
424
425
|
onExportCSV: Tt ? Mt : void 0,
|
|
425
426
|
onExportPNG: Nt,
|
|
426
427
|
onDrilldown: Y ? () => Y() : void 0,
|
|
427
|
-
onToggleComments:
|
|
428
|
-
commentsOpen:
|
|
428
|
+
onToggleComments: S ? void 0 : St,
|
|
429
|
+
commentsOpen: _t,
|
|
429
430
|
commentCount: yt ? xt : void 0,
|
|
430
|
-
onExplain:
|
|
431
|
-
explainOpen:
|
|
431
|
+
onExplain: S ? void 0 : at,
|
|
432
|
+
explainOpen: ot,
|
|
432
433
|
onSpotOutliers: Et.length > 0 ? () => Ot(!0) : void 0,
|
|
433
434
|
onReconcile: jt ? () => At(!0) : void 0
|
|
434
435
|
}),
|
|
435
|
-
|
|
436
|
-
wt.length > 0 && /* @__PURE__ */
|
|
436
|
+
ot && st,
|
|
437
|
+
wt.length > 0 && /* @__PURE__ */ m("div", {
|
|
437
438
|
role: "status",
|
|
438
439
|
"data-testid": "widget-filter-not-applicable",
|
|
439
440
|
className: "mx-3 mt-2 rounded bg-status-warning-bg-subtle px-2 py-1 text-xs text-status-warning-text",
|
|
440
|
-
children: wt.map((e) =>
|
|
441
|
+
children: wt.map((e) => lt("bigconsole.widget.filterNotApplicable", "Filter '{{name}}' does not apply to this widget (no field '{{field}}')", {
|
|
441
442
|
name: e.name,
|
|
442
443
|
field: e.field
|
|
443
444
|
})).join(" ")
|
|
444
445
|
}),
|
|
445
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ m("div", {
|
|
446
447
|
className: `
|
|
447
448
|
flex-1 overflow-hidden min-h-0 min-w-0
|
|
448
|
-
${
|
|
449
|
-
${Z && !
|
|
449
|
+
${C.compactMode ? "p-2" : "p-3 sm:p-4"}
|
|
450
|
+
${Z && !w ? "cursor-pointer" : ""}
|
|
450
451
|
`,
|
|
451
|
-
title: Z && !
|
|
452
|
-
children: /* @__PURE__ */
|
|
452
|
+
title: Z && !w ? "Click data to drill down" : void 0,
|
|
453
|
+
children: /* @__PURE__ */ m("div", {
|
|
453
454
|
className: "h-full min-w-0 overflow-auto",
|
|
454
455
|
children: qt()
|
|
455
456
|
})
|
|
456
457
|
}),
|
|
457
|
-
|
|
458
|
+
y && y.length > 0 && !V && !H && /* @__PURE__ */ m("div", {
|
|
458
459
|
className: "min-w-0 border-t border-[var(--color-border-subtle)] bg-bg-sunken px-3 py-2 sm:px-4",
|
|
459
460
|
style: { flexShrink: 0 },
|
|
460
|
-
children: /* @__PURE__ */
|
|
461
|
-
actions:
|
|
461
|
+
children: /* @__PURE__ */ m(Oe, {
|
|
462
|
+
actions: y,
|
|
462
463
|
context: Gt,
|
|
463
|
-
onAction:
|
|
464
|
-
disabled:
|
|
464
|
+
onAction: b,
|
|
465
|
+
disabled: w,
|
|
465
466
|
layout: "horizontal",
|
|
466
467
|
size: "sm"
|
|
467
468
|
})
|
|
468
469
|
}),
|
|
469
|
-
Z && !
|
|
470
|
+
Z && !w && /* @__PURE__ */ m("div", {
|
|
470
471
|
className: "\n absolute bottom-2 right-2\n opacity-0 group-hover:opacity-100\n transition-opacity duration-200\n ",
|
|
471
472
|
title: "Click to drill down",
|
|
472
|
-
children: /* @__PURE__ */
|
|
473
|
+
children: /* @__PURE__ */ m("svg", {
|
|
473
474
|
className: "w-4 h-4 text-text-secondary",
|
|
474
475
|
fill: "none",
|
|
475
476
|
stroke: "currentColor",
|
|
476
477
|
viewBox: "0 0 24 24",
|
|
477
|
-
children: /* @__PURE__ */
|
|
478
|
+
children: /* @__PURE__ */ m("path", {
|
|
478
479
|
strokeLinecap: "round",
|
|
479
480
|
strokeLinejoin: "round",
|
|
480
481
|
strokeWidth: 2,
|
|
@@ -482,37 +483,48 @@ var h = c(function({ widget: s, children: c, data: m, className: h = "", isLoadi
|
|
|
482
483
|
})
|
|
483
484
|
})
|
|
484
485
|
}),
|
|
485
|
-
|
|
486
|
+
_t && /* @__PURE__ */ m(s, {
|
|
486
487
|
fallback: null,
|
|
487
|
-
children: /* @__PURE__ */
|
|
488
|
-
widgetId:
|
|
488
|
+
children: /* @__PURE__ */ m(nt, {
|
|
489
|
+
widgetId: i.id,
|
|
489
490
|
onClose: () => vt(!1)
|
|
490
491
|
})
|
|
491
492
|
}),
|
|
492
|
-
/* @__PURE__ */
|
|
493
|
+
/* @__PURE__ */ m(xe, {
|
|
493
494
|
open: Dt,
|
|
494
495
|
onClose: () => Ot(!1),
|
|
495
|
-
widgetTitle:
|
|
496
|
+
widgetTitle: i.title,
|
|
496
497
|
series: Et
|
|
497
498
|
}),
|
|
498
|
-
kt && /* @__PURE__ */
|
|
499
|
+
kt && /* @__PURE__ */ m(s, {
|
|
499
500
|
fallback: null,
|
|
500
|
-
children: /* @__PURE__ */
|
|
501
|
+
children: /* @__PURE__ */ m(Pe, {
|
|
501
502
|
open: kt,
|
|
502
503
|
onClose: () => At(!1),
|
|
503
|
-
widget:
|
|
504
|
+
widget: i
|
|
504
505
|
})
|
|
505
506
|
})
|
|
506
507
|
]
|
|
507
508
|
});
|
|
508
|
-
},
|
|
509
|
-
|
|
509
|
+
}, h), g = c(() => import("../explore/SavedQueryWidget.js").then((e) => ({ default: e.SavedQueryWidget })));
|
|
510
|
+
function _({ widget: e }) {
|
|
511
|
+
return r((e) => e.viewMode === "edit") ? /* @__PURE__ */ m("div", {
|
|
512
|
+
className: "float-right ml-2",
|
|
513
|
+
children: /* @__PURE__ */ m(i, {
|
|
514
|
+
widget: e,
|
|
515
|
+
isEditMode: !0
|
|
516
|
+
})
|
|
517
|
+
}) : null;
|
|
518
|
+
}
|
|
519
|
+
var v = (e) => e.widget.savedQueryId ? /* @__PURE__ */ m(s, {
|
|
520
|
+
fallback: /* @__PURE__ */ m("span", {
|
|
510
521
|
role: "status",
|
|
511
522
|
children: "Loading widget…"
|
|
512
523
|
}),
|
|
513
|
-
children: /* @__PURE__ */
|
|
524
|
+
children: /* @__PURE__ */ m(g, {
|
|
514
525
|
id: e.widget.id,
|
|
515
|
-
title: e.widget.title
|
|
526
|
+
title: e.widget.title,
|
|
527
|
+
controls: e.previewOnly ? void 0 : /* @__PURE__ */ m(_, { widget: e.widget })
|
|
516
528
|
})
|
|
517
|
-
}) : /* @__PURE__ */
|
|
518
|
-
export {
|
|
529
|
+
}) : /* @__PURE__ */ m(it, { ...e });
|
|
530
|
+
export { v as WidgetWrapper, v as default };
|