@burdenoff/microfe-bigconsole 2026.1123.2 → 2026.1123.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { numericSeriesKeys as e } from "../components/widgets/chart/charts/numericSeries.js";
|
|
2
2
|
import { classifyChartData as t } from "../components/widgets/chart/chartRows.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { legacyChartToRows as n } from "../utils/legacyChartRows.js";
|
|
4
|
+
import { normalizeMetricData as r } from "../components/widgets/metric-card/metricData.js";
|
|
5
|
+
import { normalizeTableRows as i } from "../components/widgets/table/tableRows.js";
|
|
5
6
|
// src/bigconsole/compare/compareEngine.ts
|
|
6
|
-
var
|
|
7
|
+
var a = {
|
|
7
8
|
absolute: null,
|
|
8
9
|
percent: null,
|
|
9
10
|
direction: "unknown"
|
|
10
11
|
};
|
|
11
|
-
function
|
|
12
|
+
function o(e) {
|
|
12
13
|
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
13
14
|
if (typeof e == "string" && e.trim() !== "") {
|
|
14
15
|
let t = Number(e);
|
|
@@ -16,65 +17,65 @@ function a(e) {
|
|
|
16
17
|
}
|
|
17
18
|
return null;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
let n =
|
|
21
|
-
if (n === null || r === null) return
|
|
22
|
-
let
|
|
20
|
+
function s(e, t) {
|
|
21
|
+
let n = o(e), r = o(t);
|
|
22
|
+
if (n === null || r === null) return a;
|
|
23
|
+
let i = r - n;
|
|
23
24
|
return {
|
|
24
|
-
absolute:
|
|
25
|
-
percent: n === 0 ? null :
|
|
26
|
-
direction:
|
|
25
|
+
absolute: i,
|
|
26
|
+
percent: n === 0 ? null : i / Math.abs(n) * 100,
|
|
27
|
+
direction: i === 0 ? "same" : i > 0 ? "up" : "down"
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
|
-
var
|
|
30
|
+
var c = (e) => ({
|
|
30
31
|
kind: "unavailable",
|
|
31
32
|
reason: e
|
|
32
|
-
}),
|
|
33
|
-
from:
|
|
34
|
-
to:
|
|
35
|
-
change:
|
|
33
|
+
}), l = (e) => typeof e == "number" ? Number.isFinite(e) ? e : null : typeof e == "string" ? e : null, u = (e, t) => ({
|
|
34
|
+
from: l(e),
|
|
35
|
+
to: l(t),
|
|
36
|
+
change: s(e, t)
|
|
36
37
|
});
|
|
37
|
-
function
|
|
38
|
-
let i = e ?? void 0, a = (e) =>
|
|
39
|
-
return o === void 0 &&
|
|
38
|
+
function d(e, t, n) {
|
|
39
|
+
let i = e ?? void 0, a = (e) => r(e, i), o = a(t), s = a(n);
|
|
40
|
+
return o === void 0 && s === void 0 ? c("unreadable_data") : {
|
|
40
41
|
kind: "metric",
|
|
41
|
-
value:
|
|
42
|
+
value: u(o?.value, s?.value),
|
|
42
43
|
from: o ?? null,
|
|
43
|
-
to:
|
|
44
|
+
to: s ?? null
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
|
-
var
|
|
47
|
-
function
|
|
48
|
-
let
|
|
49
|
-
return
|
|
47
|
+
var f = /* @__PURE__ */ new Set(["bar", "line"]);
|
|
48
|
+
function p(e) {
|
|
49
|
+
let r = t(n(e) ?? e);
|
|
50
|
+
return r.kind === "rows" ? r.rows : r.kind === "empty" ? [] : null;
|
|
50
51
|
}
|
|
51
|
-
var
|
|
52
|
+
var m = (e, t) => {
|
|
52
53
|
let n = e[t];
|
|
53
54
|
return n == null ? "" : String(n);
|
|
54
55
|
};
|
|
55
|
-
function
|
|
56
|
+
function h(e, t) {
|
|
56
57
|
let n = /* @__PURE__ */ new Map();
|
|
57
58
|
for (let r of e) {
|
|
58
|
-
let e =
|
|
59
|
+
let e = m(r, t);
|
|
59
60
|
if (n.has(e)) return null;
|
|
60
61
|
n.set(e, r);
|
|
61
62
|
}
|
|
62
63
|
return n;
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
-
let i =
|
|
66
|
-
if (i === null || a === null) return
|
|
67
|
-
let o = String(t?.xAxisField || t?.labelField || "name"),
|
|
68
|
-
return d === null ||
|
|
65
|
+
function g(t, n, r) {
|
|
66
|
+
let i = p(n), a = p(r);
|
|
67
|
+
if (i === null || a === null) return c("unreadable_data");
|
|
68
|
+
let o = String(t?.xAxisField || t?.labelField || "name"), s = Array.isArray(t?.selectedFields) ? t.selectedFields : void 0, l = [.../* @__PURE__ */ new Set([...e(a, o, s), ...e(i, o, s)])], d = h(i, o), f = h(a, o);
|
|
69
|
+
return d === null || f === null ? c("duplicate_keys") : {
|
|
69
70
|
kind: "chart",
|
|
70
|
-
series:
|
|
71
|
-
points: [.../* @__PURE__ */ new Set([...
|
|
71
|
+
series: l,
|
|
72
|
+
points: [.../* @__PURE__ */ new Set([...f.keys(), ...d.keys()])].map((e) => ({
|
|
72
73
|
label: e,
|
|
73
|
-
values:
|
|
74
|
+
values: l.map((t) => u(d.get(e)?.[t], f.get(e)?.[t]))
|
|
74
75
|
}))
|
|
75
76
|
};
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
+
function _(e, t) {
|
|
78
79
|
let n = (Array.isArray(e?.columns) ? e.columns : []).flatMap((e) => {
|
|
79
80
|
if (typeof e == "string") return [e];
|
|
80
81
|
if (e && typeof e == "object") {
|
|
@@ -87,18 +88,18 @@ function g(e, t) {
|
|
|
87
88
|
let r = t[0];
|
|
88
89
|
return r ? Object.keys(r) : [];
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function v(e, t) {
|
|
91
92
|
if (e === t) return !0;
|
|
92
93
|
if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
|
|
93
|
-
if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length === t.length && e.every((e, n) =>
|
|
94
|
+
if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length === t.length && e.every((e, n) => v(e, t[n]));
|
|
94
95
|
let n = e, r = t, i = Object.keys(n);
|
|
95
|
-
return i.length === Object.keys(r).length && i.every((e) => e in r &&
|
|
96
|
+
return i.length === Object.keys(r).length && i.every((e) => e in r && v(n[e], r[e]));
|
|
96
97
|
}
|
|
97
|
-
var
|
|
98
|
-
function
|
|
98
|
+
var y = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
99
|
+
function b(e, t) {
|
|
99
100
|
return t.length > 0 && t.every((e) => e.id !== void 0 && e.id !== null) ? "id" : e[0] ?? null;
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
+
function x(e, t) {
|
|
102
103
|
let n = /* @__PURE__ */ new Map();
|
|
103
104
|
for (let r of e) {
|
|
104
105
|
let e = r[t], i = e == null ? "" : String(e);
|
|
@@ -107,22 +108,34 @@ function b(e, t) {
|
|
|
107
108
|
}
|
|
108
109
|
return n;
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
-
let
|
|
112
|
-
if (!
|
|
113
|
-
let l =
|
|
114
|
-
if (u === null) return
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
function S(e, t, n) {
|
|
112
|
+
let r = i(t), o = i(n);
|
|
113
|
+
if (!r.every(y) || !o.every(y)) return c("unreadable_data");
|
|
114
|
+
let l = _(e, [...o, ...r]), u = b(l, [...o, ...r]);
|
|
115
|
+
if (u === null && o.length === 0 && r.length === 0) return {
|
|
116
|
+
kind: "table",
|
|
117
|
+
columns: l,
|
|
118
|
+
keyColumn: "",
|
|
119
|
+
rows: [],
|
|
120
|
+
summary: {
|
|
121
|
+
added: 0,
|
|
122
|
+
removed: 0,
|
|
123
|
+
changed: 0,
|
|
124
|
+
unchanged: 0
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
if (u === null) return c("no_key_column");
|
|
128
|
+
let d = x(r, u), f = x(o, u);
|
|
129
|
+
if (d === null || f === null) return c("duplicate_keys");
|
|
117
130
|
let p = [.../* @__PURE__ */ new Set([...f.keys(), ...d.keys()])].map((e) => {
|
|
118
131
|
let t = d.get(e), n = f.get(e), r = l.map((e) => {
|
|
119
|
-
let r = t?.[e],
|
|
132
|
+
let r = t?.[e], i = n?.[e], o = t !== void 0 && n !== void 0 && !v(r, i);
|
|
120
133
|
return {
|
|
121
134
|
column: e,
|
|
122
135
|
from: r,
|
|
123
|
-
to:
|
|
124
|
-
changed:
|
|
125
|
-
change:
|
|
136
|
+
to: i,
|
|
137
|
+
changed: o,
|
|
138
|
+
change: o ? s(r, i) : a
|
|
126
139
|
};
|
|
127
140
|
});
|
|
128
141
|
return {
|
|
@@ -145,28 +158,28 @@ function x(e, t, n) {
|
|
|
145
158
|
summary: m
|
|
146
159
|
};
|
|
147
160
|
}
|
|
148
|
-
function
|
|
161
|
+
function C(e) {
|
|
149
162
|
return e === "metric_card" || e === "chart" || e === "table";
|
|
150
163
|
}
|
|
151
|
-
function
|
|
164
|
+
function w(e) {
|
|
152
165
|
return typeof e?.chartType == "string" ? e.chartType.toLowerCase() : "line";
|
|
153
166
|
}
|
|
154
|
-
function
|
|
155
|
-
if (!
|
|
167
|
+
function T(e) {
|
|
168
|
+
if (!C(e.widgetType)) return {
|
|
156
169
|
kind: "unsupported",
|
|
157
170
|
widgetType: e.widgetType
|
|
158
171
|
};
|
|
159
|
-
if (e.widgetType === "chart" && !
|
|
172
|
+
if (e.widgetType === "chart" && !f.has(w(e.config))) return {
|
|
160
173
|
kind: "unsupported",
|
|
161
|
-
widgetType: `chart:${
|
|
174
|
+
widgetType: `chart:${w(e.config)}`
|
|
162
175
|
};
|
|
163
176
|
let { from: t, to: n } = e;
|
|
164
|
-
if (!t.available) return
|
|
165
|
-
if (!n.available) return
|
|
177
|
+
if (!t.available) return c("no_data_from");
|
|
178
|
+
if (!n.available) return c("no_data_to");
|
|
166
179
|
switch (e.widgetType) {
|
|
167
|
-
case "metric_card": return
|
|
168
|
-
case "chart": return
|
|
169
|
-
default: return
|
|
180
|
+
case "metric_card": return d(e.config, t.data, n.data);
|
|
181
|
+
case "chart": return g(e.config, t.data, n.data);
|
|
182
|
+
default: return S(e.config, t.data, n.data);
|
|
170
183
|
}
|
|
171
184
|
}
|
|
172
|
-
export {
|
|
185
|
+
export { s as changeBetween, T as compareWidget, C as isCompareSupported };
|
|
@@ -29,41 +29,42 @@ import { WidgetErrorBoundary as xe } from "./WidgetErrorBoundary.js";
|
|
|
29
29
|
import { FilterNotAppliedNotice as Se } from "./FilterNotAppliedNotice.js";
|
|
30
30
|
import { hasCustomIframeConfig as Ce, hasRenderableCustomConfig as we } from "./custom/config.js";
|
|
31
31
|
import { getBindingForWidget as Te } from "../../utils/widgetBinding.js";
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
32
|
+
import { legacyChartToRows as Ee } from "../../utils/legacyChartRows.js";
|
|
33
|
+
import { filterMetaFromDashboard as De, findInapplicableFilters as Oe } from "../../utils/globalFilterMatching.js";
|
|
34
|
+
import { applyGlobalFilters as ke } from "../../utils/applyGlobalFilters.js";
|
|
35
|
+
import { resolveMetricCardData as Ae } from "./metric-card/metricCardData.js";
|
|
36
|
+
import { extractOutlierSeries as je } from "../insights/outlierSeries.js";
|
|
37
|
+
import { OutlierSpottingDialog as Me } from "../insights/OutlierSpottingDialog.js";
|
|
38
|
+
import { canReconcileWidget as Ne } from "../reconcile/reconcileModel.js";
|
|
39
|
+
import { canExplainKpiChange as Pe, readsAnalyzableSource as Fe } from "../kpi-change/kpiChangeModel.js";
|
|
40
|
+
import { KpiChangeDialog as Ie } from "../kpi-change/KpiChangeDialog.js";
|
|
41
|
+
import { resolveWidgetDataPath as Le, resolveWidgetDisplayData as Re, widgetDataSourcePolicy as ze, widgetExportRows as Be } from "../../utils/widgetDisplayData.js";
|
|
42
|
+
import { WidgetRendererFactory as Ve } from "../../renderers/factory/WidgetRendererFactory.js";
|
|
43
|
+
import { WidgetActions as He } from "./widget-actions/WidgetActions.js";
|
|
43
44
|
import "./widget-actions/index.js";
|
|
44
|
-
import { dashboardSuggestAnchorProps as
|
|
45
|
-
import { Suspense as c, lazy as l, memo as u, useCallback as d, useEffect as
|
|
46
|
-
import { useI18n as
|
|
47
|
-
import { useQuery as
|
|
48
|
-
import { jsx as h, jsxs as
|
|
45
|
+
import { dashboardSuggestAnchorProps as Ue } from "../../proactive/entities.js";
|
|
46
|
+
import { Suspense as c, lazy as l, memo as u, useCallback as d, useEffect as We, useMemo as f, useRef as p, useState as m } from "react";
|
|
47
|
+
import { useI18n as Ge } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
48
|
+
import { useQuery as Ke } from "@apollo/client/react";
|
|
49
|
+
import { jsx as h, jsxs as qe } from "react/jsx-runtime";
|
|
49
50
|
// src/bigconsole/components/widgets/WidgetWrapper.tsx
|
|
50
|
-
var
|
|
51
|
+
var Je = l(() => import("../reconcile/KpiReconcileDialog.js").then((e) => ({ default: e.KpiReconcileDialog }))), Ye = l(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), Xe = l(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), Ze = l(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), Qe = l(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), $e = l(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), et = l(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), tt = l(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), nt = l(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), rt = l(() => import("./retention/index.js").then((e) => ({ default: e.RetentionWidget }))), it = l(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), at = l(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), ot = l(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), st = l(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), ct = l(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), lt = l(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), ut = l(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), dt = l(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget })));
|
|
51
52
|
l(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget })));
|
|
52
|
-
var
|
|
53
|
+
var ft = l(() => import("./form/index.js").then((e) => ({ default: e.FormWidget }))), pt = l(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.SankeyWidget }))), mt = l(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.BoxPlotWidget }))), ht = l(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.WaterfallWidget }))), gt = l(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments }))), _t = /* @__PURE__ */ new Set([
|
|
53
54
|
"text",
|
|
54
55
|
"iframe",
|
|
55
56
|
"form",
|
|
56
57
|
"adaptive_card"
|
|
57
58
|
]);
|
|
58
|
-
function
|
|
59
|
+
function vt(e, t) {
|
|
59
60
|
return e.previewOnly === t.previewOnly && e.observeOnly === t.observeOnly && 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;
|
|
60
61
|
}
|
|
61
|
-
var
|
|
62
|
-
let S = he(),
|
|
63
|
-
variables: { id:
|
|
64
|
-
skip: !
|
|
62
|
+
var yt = u(function({ widget: a, children: l, data: u, className: vt = "", isLoading: yt, error: g, onRefresh: _, onDrilldown: bt, actions: v, onAction: y, filterValues: b, onToggleNarrative: xt, narrativeOpen: St = !1, narrativePanel: Ct, previewOnly: x = !1, observeOnly: wt = !1 }) {
|
|
63
|
+
let S = he(), Tt = r((e) => e.viewMode === "edit"), C = !x && Tt, w = t((e) => e.selectWidget), T = e(a.id), Et = n(a.id), E = ee(), { t: D } = Ge(), Dt = a.dashboardId, { data: Ot } = Ke(re, {
|
|
64
|
+
variables: { id: Dt ?? "" },
|
|
65
|
+
skip: !Dt,
|
|
65
66
|
fetchPolicy: "cache-only"
|
|
66
|
-
}),
|
|
67
|
+
}), kt = Ot?.getDashboard?.globalFilters, O = f(() => De(kt), [kt]), k = f(() => Object.fromEntries(Object.entries(O).map(([e, t]) => [e, t.field])), [O]), A = f(() => Te(a), [a]), { hasDataSource: j, allowSamples: At, mockSource: M } = ze(a, A), { asOf: N, compareTo: P } = pe(), { data: F, loading: jt, error: Mt, asOfInfo: Nt } = te(a.id, {
|
|
67
68
|
skip: x || !j,
|
|
68
69
|
pollInterval: N ? 0 : (a.refreshInterval ?? 0) * 1e3 || 0,
|
|
69
70
|
asOf: N
|
|
@@ -83,25 +84,25 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
83
84
|
I,
|
|
84
85
|
E,
|
|
85
86
|
b
|
|
86
|
-
]), R = Object.keys(L).length > 0, z =
|
|
87
|
-
|
|
87
|
+
]), R = Object.keys(L).length > 0, z = yt ?? (jt && !F) ?? Et.isLoading, Pt = N ? i(Nt, D) : null, B = g ?? Pt ?? Mt?.message ?? (N ? null : Et.errorMessage), Ft = le(a.type), V = p(_);
|
|
88
|
+
We(() => {
|
|
88
89
|
V.current = _;
|
|
89
90
|
}, [_]);
|
|
90
|
-
let
|
|
91
|
+
let It = d(async () => {
|
|
91
92
|
V.current && await V.current();
|
|
92
|
-
}, []), { timeUntilRefresh:
|
|
93
|
+
}, []), { timeUntilRefresh: Lt, isPaused: Rt } = ae({
|
|
93
94
|
widgetId: a.id,
|
|
94
95
|
refreshInterval: a.refreshInterval,
|
|
95
|
-
onRefresh:
|
|
96
|
+
onRefresh: It,
|
|
96
97
|
enabled: !x && !C && !!a.refreshInterval && !N
|
|
97
|
-
}),
|
|
98
|
-
|
|
99
|
-
}, []), H = f(() =>
|
|
98
|
+
}), zt = p(null), [Bt, Vt] = m(!1), [Ht, Ut] = m(!1), { count: Wt } = oe(a.id, Ht && !N), Gt = d(() => {
|
|
99
|
+
Ut(!0), Vt((e) => !e);
|
|
100
|
+
}, []), H = f(() => Re({
|
|
100
101
|
explicit: u,
|
|
101
102
|
fetched: F,
|
|
102
103
|
persisted: a.data,
|
|
103
104
|
config: a.config,
|
|
104
|
-
allowSamples:
|
|
105
|
+
allowSamples: At,
|
|
105
106
|
mockSource: M,
|
|
106
107
|
widgetType: a.type,
|
|
107
108
|
asOf: N !== null
|
|
@@ -109,13 +110,13 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
109
110
|
u,
|
|
110
111
|
F,
|
|
111
112
|
a,
|
|
112
|
-
|
|
113
|
+
At,
|
|
113
114
|
M,
|
|
114
115
|
N
|
|
115
116
|
]), U = f(() => {
|
|
116
117
|
let e = H.data;
|
|
117
|
-
return
|
|
118
|
-
}, [H, a.config]), W = f(() => R ?
|
|
118
|
+
return Le(e, a.config);
|
|
119
|
+
}, [H, a.config]), W = f(() => R ? ke(U, {
|
|
119
120
|
filterValues: L,
|
|
120
121
|
filterFieldMap: k,
|
|
121
122
|
widgetType: a.type
|
|
@@ -125,7 +126,7 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
125
126
|
L,
|
|
126
127
|
k,
|
|
127
128
|
a.type
|
|
128
|
-
]), G = N !== null && P !== null && _e(a.type), K = ne(a.id, P, x || !j || !G), q = d((e) => R ?
|
|
129
|
+
]), G = N !== null && P !== null && _e(a.type), K = ne(a.id, P, x || !j || !G), q = d((e) => R ? ke(e, {
|
|
129
130
|
filterValues: L,
|
|
130
131
|
filterFieldMap: k,
|
|
131
132
|
widgetType: a.type
|
|
@@ -134,7 +135,7 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
134
135
|
L,
|
|
135
136
|
k,
|
|
136
137
|
a.type
|
|
137
|
-
]),
|
|
138
|
+
]), Kt = f(() => {
|
|
138
139
|
if (!G) return null;
|
|
139
140
|
let e = a.config;
|
|
140
141
|
return ge({
|
|
@@ -157,24 +158,24 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
157
158
|
N,
|
|
158
159
|
P,
|
|
159
160
|
D
|
|
160
|
-
]),
|
|
161
|
-
if (
|
|
162
|
-
let e = a.type === "metric_card" &&
|
|
163
|
-
return
|
|
161
|
+
]), qt = W !== null && H.isSample, Jt = f(() => {
|
|
162
|
+
if (_t.has(a.type)) return [];
|
|
163
|
+
let e = a.type === "metric_card" && Ae(U, a.config).source === "scalar";
|
|
164
|
+
return Oe(U, O, L, a.type, { precomputedValue: e });
|
|
164
165
|
}, [
|
|
165
166
|
U,
|
|
166
167
|
O,
|
|
167
168
|
L,
|
|
168
169
|
a.type,
|
|
169
170
|
a.config
|
|
170
|
-
]),
|
|
171
|
+
]), Yt = f(() => Be(W, a.type), [W, a.type]), Xt = f(() => {
|
|
171
172
|
let e = a.config;
|
|
172
|
-
return
|
|
173
|
+
return je(W, {
|
|
173
174
|
xAxisKey: typeof e?.xAxisKey == "string" ? e.xAxisKey : void 0,
|
|
174
175
|
selectedFields: Array.isArray(e?.selectedFields) ? e.selectedFields.filter((e) => typeof e == "string") : void 0
|
|
175
176
|
});
|
|
176
|
-
}, [W, a.config]), [
|
|
177
|
-
readsDataSink: j && !M &&
|
|
177
|
+
}, [W, a.config]), [Zt, Qt] = m(!1), [$t, en] = m(!1), tn = Ne(a.type, x), [nn, rn] = m(!1), an = Pe(a.type, x || wt, {
|
|
178
|
+
readsDataSink: j && !M && Fe({
|
|
178
179
|
kind: A.source.kind,
|
|
179
180
|
ref: A.source.ref,
|
|
180
181
|
parserId: A.parserId ?? a.parserId,
|
|
@@ -183,16 +184,16 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
183
184
|
}),
|
|
184
185
|
internalType: a.config?._internalWidgetType,
|
|
185
186
|
filtered: R
|
|
186
|
-
}), { exportCSV:
|
|
187
|
-
data:
|
|
188
|
-
containerRef:
|
|
189
|
-
}), { executeDrilldown:
|
|
190
|
-
|
|
191
|
-
} }), Y = f(() =>
|
|
187
|
+
}), { exportCSV: on, exportPNG: sn } = se(a, {
|
|
188
|
+
data: Yt,
|
|
189
|
+
containerRef: zt
|
|
190
|
+
}), { executeDrilldown: cn, canDrilldown: ln } = ce({ onDrilldown: (e, t) => {
|
|
191
|
+
bt?.(e);
|
|
192
|
+
} }), Y = f(() => ln(a) && !N, [
|
|
192
193
|
a,
|
|
193
|
-
|
|
194
|
+
ln,
|
|
194
195
|
N
|
|
195
|
-
]),
|
|
196
|
+
]), un = d((e) => {
|
|
196
197
|
if (!a.drilldown?.enabled) return;
|
|
197
198
|
let t = {
|
|
198
199
|
selectedData: e || {},
|
|
@@ -205,18 +206,18 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
205
206
|
},
|
|
206
207
|
sourceDashboardId: a.dashboardId
|
|
207
208
|
};
|
|
208
|
-
|
|
209
|
+
cn(a.drilldown, t);
|
|
209
210
|
}, [
|
|
210
211
|
a,
|
|
211
212
|
W,
|
|
212
213
|
E,
|
|
213
|
-
|
|
214
|
-
]), X = Y && !C && !N ?
|
|
214
|
+
cn
|
|
215
|
+
]), X = Y && !C && !N ? un : void 0, Z = p(null), dn = d((e) => {
|
|
215
216
|
Z.current = {
|
|
216
217
|
x: e.clientX,
|
|
217
218
|
y: e.clientY
|
|
218
219
|
};
|
|
219
|
-
}, []),
|
|
220
|
+
}, []), fn = d((e) => {
|
|
220
221
|
if (e.stopPropagation(), Z.current) {
|
|
221
222
|
let t = Math.abs(e.clientX - Z.current.x), n = Math.abs(e.clientY - Z.current.y);
|
|
222
223
|
if (t > 5 || n > 5) {
|
|
@@ -229,20 +230,20 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
229
230
|
C,
|
|
230
231
|
w,
|
|
231
232
|
a.id
|
|
232
|
-
]),
|
|
233
|
+
]), pn = d((e) => {
|
|
233
234
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), C && w(a.id));
|
|
234
235
|
}, [
|
|
235
236
|
C,
|
|
236
237
|
w,
|
|
237
238
|
a.id
|
|
238
|
-
]),
|
|
239
|
+
]), mn = f(() => a.type === "custom" && we(a.config), [a.type, a.config]), hn = f(() => a.type === "custom" && Ce(a.config), [a.type, a.config]), Q = Y && !hn, gn = a.type === "iframe" || a.type === "custom", _n = f(() => a.type === "text" && ue(a.config, W).hasContent, [
|
|
239
240
|
a.type,
|
|
240
241
|
a.config,
|
|
241
242
|
W
|
|
242
|
-
]),
|
|
243
|
+
]), vn = !z && !B && !W && !mn && !_n, $ = f(() => a.renderer, [a]), yn = f(() => $ && $ !== "BIGCONSOLE", [$]), bn = f(() => ({
|
|
243
244
|
widgetId: a.id,
|
|
244
245
|
data: W || {}
|
|
245
|
-
}), [a.id, W]),
|
|
246
|
+
}), [a.id, W]), xn = d((e, t) => {
|
|
246
247
|
if (!y || N) return;
|
|
247
248
|
let n = v?.find((t) => t.name === e.name);
|
|
248
249
|
y(n || e, t);
|
|
@@ -250,7 +251,7 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
250
251
|
y,
|
|
251
252
|
v,
|
|
252
253
|
N
|
|
253
|
-
]),
|
|
254
|
+
]), Sn = d(() => {
|
|
254
255
|
let e = (() => {
|
|
255
256
|
if (!W) return W;
|
|
256
257
|
if (a.type === "pivot_table") {
|
|
@@ -268,13 +269,8 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
268
269
|
if (a.type === "chart") {
|
|
269
270
|
if (Array.isArray(W)) return W;
|
|
270
271
|
if (W && typeof W == "object" && "datasets" in W) {
|
|
271
|
-
let e = W;
|
|
272
|
-
if (e
|
|
273
|
-
let r = { name: t };
|
|
274
|
-
return e.datasets?.forEach((e) => {
|
|
275
|
-
r[e.name.toLowerCase()] = e.data[n];
|
|
276
|
-
}), r;
|
|
277
|
-
});
|
|
272
|
+
let e = Ee(W);
|
|
273
|
+
if (e) return e;
|
|
278
274
|
}
|
|
279
275
|
}
|
|
280
276
|
if (a.type === "text") {
|
|
@@ -301,7 +297,7 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
301
297
|
widget: a,
|
|
302
298
|
onDrilldown: X
|
|
303
299
|
};
|
|
304
|
-
if (
|
|
300
|
+
if (yn) {
|
|
305
301
|
let e = {};
|
|
306
302
|
if (W && typeof W == "object" && !Array.isArray(W) && Object.keys(W).length > 0 && (e = { ...W }), a.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
|
|
307
303
|
let t = a.config?.valueField;
|
|
@@ -316,7 +312,7 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
316
312
|
};
|
|
317
313
|
}
|
|
318
314
|
}
|
|
319
|
-
return /* @__PURE__ */ h(
|
|
315
|
+
return /* @__PURE__ */ h(Ve, {
|
|
320
316
|
widget: a,
|
|
321
317
|
data: e,
|
|
322
318
|
isEditMode: C,
|
|
@@ -324,92 +320,92 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
324
320
|
isLoading: z,
|
|
325
321
|
error: B,
|
|
326
322
|
onDrilldown: X,
|
|
327
|
-
onAction: N ? void 0 :
|
|
323
|
+
onAction: N ? void 0 : xn
|
|
328
324
|
});
|
|
329
325
|
}
|
|
330
326
|
switch (a.type?.toLowerCase() || "") {
|
|
331
|
-
case "metric_card": return /* @__PURE__ */ h(
|
|
327
|
+
case "metric_card": return /* @__PURE__ */ h(Ye, {
|
|
332
328
|
...t,
|
|
333
329
|
data: e
|
|
334
330
|
});
|
|
335
|
-
case "kpi_card_comparison": return /* @__PURE__ */ h(
|
|
331
|
+
case "kpi_card_comparison": return /* @__PURE__ */ h(st, {
|
|
336
332
|
...t,
|
|
337
333
|
data: e
|
|
338
334
|
});
|
|
339
335
|
case "chart":
|
|
340
|
-
case "funnel_chart": return /* @__PURE__ */ h(
|
|
336
|
+
case "funnel_chart": return /* @__PURE__ */ h(Xe, {
|
|
341
337
|
...t,
|
|
342
338
|
data: e
|
|
343
339
|
});
|
|
344
|
-
case "waterfall": return /* @__PURE__ */ h(
|
|
340
|
+
case "waterfall": return /* @__PURE__ */ h(ht, {
|
|
345
341
|
...t,
|
|
346
342
|
data: e
|
|
347
343
|
});
|
|
348
|
-
case "sankey": return /* @__PURE__ */ h(
|
|
344
|
+
case "sankey": return /* @__PURE__ */ h(pt, {
|
|
349
345
|
...t,
|
|
350
346
|
data: e
|
|
351
347
|
});
|
|
352
|
-
case "box_plot": return /* @__PURE__ */ h(
|
|
348
|
+
case "box_plot": return /* @__PURE__ */ h(mt, {
|
|
353
349
|
...t,
|
|
354
350
|
data: e
|
|
355
351
|
});
|
|
356
|
-
case "table": return /* @__PURE__ */ h(
|
|
352
|
+
case "table": return /* @__PURE__ */ h(Ze, {
|
|
357
353
|
...t,
|
|
358
354
|
data: e
|
|
359
355
|
});
|
|
360
|
-
case "pivot_table": return /* @__PURE__ */ h(
|
|
356
|
+
case "pivot_table": return /* @__PURE__ */ h(Qe, {
|
|
361
357
|
...t,
|
|
362
358
|
data: e
|
|
363
359
|
});
|
|
364
|
-
case "gauge": return /* @__PURE__ */ h(
|
|
360
|
+
case "gauge": return /* @__PURE__ */ h($e, {
|
|
365
361
|
...t,
|
|
366
362
|
data: e
|
|
367
363
|
});
|
|
368
|
-
case "progress": return /* @__PURE__ */ h(
|
|
364
|
+
case "progress": return /* @__PURE__ */ h(et, {
|
|
369
365
|
...t,
|
|
370
366
|
data: e
|
|
371
367
|
});
|
|
372
|
-
case "list": return /* @__PURE__ */ h(
|
|
368
|
+
case "list": return /* @__PURE__ */ h(tt, {
|
|
373
369
|
...t,
|
|
374
370
|
data: e
|
|
375
371
|
});
|
|
376
|
-
case "heatmap": return /* @__PURE__ */ h(
|
|
372
|
+
case "heatmap": return /* @__PURE__ */ h(nt, {
|
|
377
373
|
...t,
|
|
378
374
|
data: e
|
|
379
375
|
});
|
|
380
|
-
case "retention": return /* @__PURE__ */ h(
|
|
376
|
+
case "retention": return /* @__PURE__ */ h(rt, {
|
|
381
377
|
...t,
|
|
382
378
|
data: e
|
|
383
379
|
});
|
|
384
|
-
case "calendar": return /* @__PURE__ */ h(
|
|
380
|
+
case "calendar": return /* @__PURE__ */ h(it, {
|
|
385
381
|
...t,
|
|
386
382
|
data: e
|
|
387
383
|
});
|
|
388
|
-
case "timeline": return /* @__PURE__ */ h(
|
|
384
|
+
case "timeline": return /* @__PURE__ */ h(ot, {
|
|
389
385
|
...t,
|
|
390
386
|
data: e
|
|
391
387
|
});
|
|
392
|
-
case "kanban": return /* @__PURE__ */ h(
|
|
388
|
+
case "kanban": return /* @__PURE__ */ h(at, {
|
|
393
389
|
...t,
|
|
394
390
|
data: e
|
|
395
391
|
});
|
|
396
|
-
case "form": return /* @__PURE__ */ h(
|
|
392
|
+
case "form": return /* @__PURE__ */ h(ft, {
|
|
397
393
|
...t,
|
|
398
394
|
data: e
|
|
399
395
|
});
|
|
400
|
-
case "text": return /* @__PURE__ */ h(
|
|
396
|
+
case "text": return /* @__PURE__ */ h(ct, {
|
|
401
397
|
...t,
|
|
402
398
|
data: e
|
|
403
399
|
});
|
|
404
|
-
case "iframe": return /* @__PURE__ */ h(
|
|
400
|
+
case "iframe": return /* @__PURE__ */ h(ut, {
|
|
405
401
|
...t,
|
|
406
402
|
data: e
|
|
407
403
|
});
|
|
408
|
-
case "map": return /* @__PURE__ */ h(
|
|
404
|
+
case "map": return /* @__PURE__ */ h(lt, {
|
|
409
405
|
...t,
|
|
410
406
|
data: e
|
|
411
407
|
});
|
|
412
|
-
case "custom": return /* @__PURE__ */ h(
|
|
408
|
+
case "custom": return /* @__PURE__ */ h(dt, {
|
|
413
409
|
...t,
|
|
414
410
|
data: e
|
|
415
411
|
});
|
|
@@ -420,15 +416,15 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
420
416
|
W,
|
|
421
417
|
l,
|
|
422
418
|
X,
|
|
423
|
-
|
|
419
|
+
yn,
|
|
424
420
|
C,
|
|
425
421
|
T,
|
|
426
422
|
z,
|
|
427
423
|
B,
|
|
428
|
-
|
|
424
|
+
xn,
|
|
429
425
|
N
|
|
430
|
-
]),
|
|
431
|
-
if (N &&
|
|
426
|
+
]), Cn = () => {
|
|
427
|
+
if (N && gn) {
|
|
432
428
|
let e = i({
|
|
433
429
|
historyAvailable: !1,
|
|
434
430
|
reason: "HISTORY_NOT_AVAILABLE"
|
|
@@ -443,11 +439,11 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
443
439
|
fromLabel: J.from,
|
|
444
440
|
toLabel: J.to
|
|
445
441
|
});
|
|
446
|
-
if (
|
|
442
|
+
if (Kt) {
|
|
447
443
|
if (z || K.loading) return /* @__PURE__ */ h(o, {});
|
|
448
|
-
let e =
|
|
444
|
+
let e = Mt?.message ?? K.error?.message ?? g;
|
|
449
445
|
return e ? /* @__PURE__ */ h(s, { error: e }) : /* @__PURE__ */ h(ye, {
|
|
450
|
-
result:
|
|
446
|
+
result: Kt,
|
|
451
447
|
fromLabel: J.from,
|
|
452
448
|
toLabel: J.to,
|
|
453
449
|
config: a.config
|
|
@@ -458,7 +454,7 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
458
454
|
error: B,
|
|
459
455
|
onRetry: N ? void 0 : _
|
|
460
456
|
});
|
|
461
|
-
if (
|
|
457
|
+
if (vn && !l) return /* @__PURE__ */ h(be, {
|
|
462
458
|
widgetType: a.type,
|
|
463
459
|
hideEditHint: x,
|
|
464
460
|
hasDataSource: j,
|
|
@@ -473,13 +469,13 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
473
469
|
resetKey: e,
|
|
474
470
|
children: l ?? /* @__PURE__ */ h(c, {
|
|
475
471
|
fallback: /* @__PURE__ */ h(o, {}),
|
|
476
|
-
children:
|
|
472
|
+
children: Sn()
|
|
477
473
|
})
|
|
478
474
|
});
|
|
479
475
|
};
|
|
480
|
-
return /* @__PURE__ */
|
|
481
|
-
ref:
|
|
482
|
-
...x ? {} :
|
|
476
|
+
return /* @__PURE__ */ qe("div", {
|
|
477
|
+
ref: zt,
|
|
478
|
+
...x ? {} : Ue(a.dashboardId, a.id),
|
|
483
479
|
className: `
|
|
484
480
|
group relative flex flex-col
|
|
485
481
|
h-full w-full min-w-0
|
|
@@ -489,11 +485,11 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
489
485
|
${S.animationsEnabled ? "motion-safe:transition-[box-shadow,border-color] motion-safe:duration-200" : ""}
|
|
490
486
|
${T && C ? "border-[var(--color-action-primary-border)] ring-2 ring-[var(--color-action-primary-border)]/30 shadow-[var(--shadow-elevation-2)]" : S.showWidgetBorders ? "border-[var(--color-border-subtle)] hover:border-action-primary-bg hover:shadow-[var(--shadow-elevation-2)]" : "border-transparent"}
|
|
491
487
|
${C ? "cursor-pointer" : ""}
|
|
492
|
-
${
|
|
488
|
+
${vt}
|
|
493
489
|
`,
|
|
494
|
-
onMouseDown:
|
|
495
|
-
onClick:
|
|
496
|
-
onKeyDown:
|
|
490
|
+
onMouseDown: dn,
|
|
491
|
+
onClick: fn,
|
|
492
|
+
onKeyDown: pn,
|
|
497
493
|
tabIndex: C ? 0 : -1,
|
|
498
494
|
role: C ? "button" : void 0,
|
|
499
495
|
"aria-selected": T,
|
|
@@ -504,35 +500,35 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
504
500
|
/* @__PURE__ */ h(de, {
|
|
505
501
|
widget: a,
|
|
506
502
|
previewOnly: x,
|
|
507
|
-
definition:
|
|
503
|
+
definition: Ft,
|
|
508
504
|
isSelected: T,
|
|
509
505
|
isEditMode: C,
|
|
510
506
|
isLoading: z,
|
|
511
|
-
isSampleData:
|
|
512
|
-
timeUntilRefresh: a.refreshInterval && !
|
|
507
|
+
isSampleData: qt,
|
|
508
|
+
timeUntilRefresh: a.refreshInterval && !Rt ? ie(Lt) : void 0,
|
|
513
509
|
hasDrilldown: Y,
|
|
514
510
|
onRefresh: N ? void 0 : _,
|
|
515
|
-
onExportCSV:
|
|
516
|
-
onExportPNG: N ? void 0 :
|
|
511
|
+
onExportCSV: Yt ? N ? () => on(`${a.title.replace(/\s+/g, "_").toLowerCase()}_${fe(N)}.csv`) : on : void 0,
|
|
512
|
+
onExportPNG: N ? void 0 : sn,
|
|
517
513
|
onDrilldown: X ? () => X() : void 0,
|
|
518
|
-
onToggleComments: x || N ? void 0 :
|
|
519
|
-
commentsOpen:
|
|
520
|
-
commentCount:
|
|
521
|
-
onExplain: x || N ? void 0 :
|
|
522
|
-
explainOpen:
|
|
523
|
-
onSpotOutliers:
|
|
524
|
-
onReconcile:
|
|
525
|
-
onWhyDidItMove:
|
|
526
|
-
whyDidItMoveOpen:
|
|
514
|
+
onToggleComments: x || N ? void 0 : Gt,
|
|
515
|
+
commentsOpen: Bt,
|
|
516
|
+
commentCount: Ht ? Wt : void 0,
|
|
517
|
+
onExplain: x || N ? void 0 : xt,
|
|
518
|
+
explainOpen: St,
|
|
519
|
+
onSpotOutliers: Xt.length > 0 ? () => Qt(!0) : void 0,
|
|
520
|
+
onReconcile: tn && !N ? () => en(!0) : void 0,
|
|
521
|
+
onWhyDidItMove: an && !N ? () => rn((e) => !e) : void 0,
|
|
522
|
+
whyDidItMoveOpen: nn
|
|
527
523
|
}),
|
|
528
|
-
|
|
529
|
-
|
|
524
|
+
St && !N && Ct,
|
|
525
|
+
nn && !N && /* @__PURE__ */ h(Ie, {
|
|
530
526
|
widgetId: a.id,
|
|
531
527
|
open: !0,
|
|
532
|
-
onClose: () =>
|
|
528
|
+
onClose: () => rn(!1)
|
|
533
529
|
}),
|
|
534
530
|
/* @__PURE__ */ h(Se, {
|
|
535
|
-
filters:
|
|
531
|
+
filters: Jt,
|
|
536
532
|
t: D
|
|
537
533
|
}),
|
|
538
534
|
/* @__PURE__ */ h("div", {
|
|
@@ -544,15 +540,15 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
544
540
|
title: Q && !C ? "Click data to drill down" : void 0,
|
|
545
541
|
children: /* @__PURE__ */ h("div", {
|
|
546
542
|
className: "h-full min-w-0 overflow-auto",
|
|
547
|
-
children:
|
|
543
|
+
children: Cn()
|
|
548
544
|
})
|
|
549
545
|
}),
|
|
550
546
|
v && v.length > 0 && !z && !B && !N && /* @__PURE__ */ h("div", {
|
|
551
547
|
className: "min-w-0 border-t border-[var(--color-border-subtle)] bg-bg-sunken px-3 py-2 sm:px-4",
|
|
552
548
|
style: { flexShrink: 0 },
|
|
553
|
-
children: /* @__PURE__ */ h(
|
|
549
|
+
children: /* @__PURE__ */ h(He, {
|
|
554
550
|
actions: v,
|
|
555
|
-
context:
|
|
551
|
+
context: bn,
|
|
556
552
|
onAction: y,
|
|
557
553
|
disabled: C,
|
|
558
554
|
layout: "horizontal",
|
|
@@ -575,31 +571,31 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
|
|
|
575
571
|
})
|
|
576
572
|
})
|
|
577
573
|
}),
|
|
578
|
-
|
|
574
|
+
Bt && !N && /* @__PURE__ */ h(c, {
|
|
579
575
|
fallback: null,
|
|
580
|
-
children: /* @__PURE__ */ h(
|
|
576
|
+
children: /* @__PURE__ */ h(gt, {
|
|
581
577
|
widgetId: a.id,
|
|
582
578
|
widgetTitle: a.title,
|
|
583
|
-
onClose: () =>
|
|
579
|
+
onClose: () => Vt(!1)
|
|
584
580
|
})
|
|
585
581
|
}),
|
|
586
|
-
/* @__PURE__ */ h(
|
|
587
|
-
open:
|
|
588
|
-
onClose: () =>
|
|
582
|
+
/* @__PURE__ */ h(Me, {
|
|
583
|
+
open: Zt,
|
|
584
|
+
onClose: () => Qt(!1),
|
|
589
585
|
widgetTitle: a.title,
|
|
590
|
-
series:
|
|
586
|
+
series: Xt
|
|
591
587
|
}),
|
|
592
|
-
|
|
588
|
+
$t && !N && /* @__PURE__ */ h(c, {
|
|
593
589
|
fallback: null,
|
|
594
|
-
children: /* @__PURE__ */ h(
|
|
595
|
-
open:
|
|
596
|
-
onClose: () =>
|
|
590
|
+
children: /* @__PURE__ */ h(Je, {
|
|
591
|
+
open: $t,
|
|
592
|
+
onClose: () => en(!1),
|
|
597
593
|
widget: a
|
|
598
594
|
})
|
|
599
595
|
})
|
|
600
596
|
]
|
|
601
597
|
});
|
|
602
|
-
},
|
|
598
|
+
}, vt), g = l(() => import("../explore/SavedQueryWidget.js").then((e) => ({ default: e.SavedQueryWidget })));
|
|
603
599
|
function _({ widget: e }) {
|
|
604
600
|
return r((e) => e.viewMode === "edit") ? /* @__PURE__ */ h("div", {
|
|
605
601
|
className: "float-right ml-2",
|
|
@@ -609,12 +605,12 @@ function _({ widget: e }) {
|
|
|
609
605
|
})
|
|
610
606
|
}) : null;
|
|
611
607
|
}
|
|
612
|
-
function
|
|
613
|
-
let { t } =
|
|
608
|
+
function bt({ title: e }) {
|
|
609
|
+
let { t } = Ge(), n = i({
|
|
614
610
|
historyAvailable: !1,
|
|
615
611
|
reason: "HISTORY_NOT_AVAILABLE"
|
|
616
612
|
}, t);
|
|
617
|
-
return /* @__PURE__ */
|
|
613
|
+
return /* @__PURE__ */ qe("section", {
|
|
618
614
|
"aria-label": e ?? void 0,
|
|
619
615
|
"data-testid": "saved-query-history-unavailable",
|
|
620
616
|
className: "h-full min-w-0 rounded-lg border border-[var(--color-border-subtle)] bg-bg-surface p-3",
|
|
@@ -626,7 +622,7 @@ function yt({ title: e }) {
|
|
|
626
622
|
}
|
|
627
623
|
var v = (e) => {
|
|
628
624
|
let { asOf: t } = pe();
|
|
629
|
-
return e.widget.savedQueryId ? t ? /* @__PURE__ */ h(
|
|
625
|
+
return e.widget.savedQueryId ? t ? /* @__PURE__ */ h(bt, { title: e.widget.title }) : /* @__PURE__ */ h(c, {
|
|
630
626
|
fallback: /* @__PURE__ */ h("span", {
|
|
631
627
|
role: "status",
|
|
632
628
|
children: "Loading widget…"
|
|
@@ -636,6 +632,6 @@ var v = (e) => {
|
|
|
636
632
|
title: e.widget.title,
|
|
637
633
|
controls: e.previewOnly ? void 0 : /* @__PURE__ */ h(_, { widget: e.widget })
|
|
638
634
|
})
|
|
639
|
-
}) : /* @__PURE__ */ h(
|
|
635
|
+
}) : /* @__PURE__ */ h(yt, { ...e });
|
|
640
636
|
};
|
|
641
637
|
export { v as WidgetWrapper, v as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// src/bigconsole/utils/legacyChartRows.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
if (typeof e != "object" || !e) return !1;
|
|
4
|
+
let { name: t, data: n } = e;
|
|
5
|
+
return typeof t == "string" && Array.isArray(n);
|
|
6
|
+
}
|
|
7
|
+
function t(t) {
|
|
8
|
+
if (typeof t != "object" || !t || Array.isArray(t)) return !1;
|
|
9
|
+
let { labels: n, datasets: r } = t;
|
|
10
|
+
return Array.isArray(n) && Array.isArray(r) && r.every(e);
|
|
11
|
+
}
|
|
12
|
+
function n(e) {
|
|
13
|
+
return t(e) ? e.labels.map((t, n) => {
|
|
14
|
+
let r = { name: t };
|
|
15
|
+
for (let t of e.datasets) r[t.name.toLowerCase()] = t.data[n];
|
|
16
|
+
return r;
|
|
17
|
+
}) : null;
|
|
18
|
+
}
|
|
19
|
+
export { n as legacyChartToRows };
|