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