@burdenoff/microfe-bigconsole 2026.1118.10 → 2026.1119.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bigconsole/asof/AsOfBanner.d.ts +3 -0
- package/dist/bigconsole/asof/AsOfBanner.js +52 -0
- package/dist/bigconsole/asof/AsOfControl.d.ts +4 -0
- package/dist/bigconsole/asof/AsOfControl.js +164 -0
- package/dist/bigconsole/asof/AsOfProvider.d.ts +31 -0
- package/dist/bigconsole/asof/AsOfProvider.js +98 -0
- package/dist/bigconsole/asof/asOfMessage.d.ts +12 -0
- package/dist/bigconsole/asof/asOfMessage.js +12 -0
- package/dist/bigconsole/asof/asOfParam.d.ts +48 -0
- package/dist/bigconsole/asof/asOfParam.js +34 -0
- package/dist/bigconsole/asof/index.d.ts +7 -0
- package/dist/bigconsole/asof/index.js +6 -0
- package/dist/bigconsole/compare/compareEngine.d.ts +104 -0
- package/dist/bigconsole/compare/compareEngine.js +172 -0
- package/dist/bigconsole/compare/compareParam.d.ts +9 -0
- package/dist/bigconsole/compare/compareParam.js +13 -0
- package/dist/bigconsole/compare/compareSide.d.ts +5 -0
- package/dist/bigconsole/compare/compareSide.js +39 -0
- package/dist/bigconsole/compare/index.d.ts +3 -0
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js +142 -138
- package/dist/bigconsole/components/dashboard/DashboardToolbar.js +97 -92
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +78 -74
- package/dist/bigconsole/components/widgets/WidgetCompareView.d.ts +12 -0
- package/dist/bigconsole/components/widgets/WidgetCompareView.js +215 -0
- package/dist/bigconsole/components/widgets/WidgetMenu.js +98 -96
- package/dist/bigconsole/components/widgets/WidgetWrapper.js +399 -311
- package/dist/bigconsole/components/widgets/metric-card/MetricCardWidget.js +47 -148
- package/dist/bigconsole/components/widgets/metric-card/metricData.d.ts +23 -0
- package/dist/bigconsole/components/widgets/metric-card/metricData.js +105 -0
- package/dist/bigconsole/components/widgets/table/TableCell.d.ts +2 -1
- package/dist/bigconsole/components/widgets/table/TableCell.js +1 -1
- package/dist/bigconsole/components/widgets/table/TableWidget.js +142 -168
- package/dist/bigconsole/components/widgets/table/tableRows.d.ts +17 -0
- package/dist/bigconsole/components/widgets/table/tableRows.js +35 -0
- package/dist/bigconsole/hooks/index.d.ts +1 -0
- package/dist/bigconsole/hooks/index.js +25 -24
- package/dist/bigconsole/hooks/useFilterFieldValues.js +52 -22
- package/dist/bigconsole/hooks/useWidgetCompareData.d.ts +8 -0
- package/dist/bigconsole/hooks/useWidgetCompareData.js +24 -0
- package/dist/bigconsole/hooks/useWidgetData.d.ts +7 -0
- package/dist/bigconsole/hooks/useWidgetData.js +53 -43
- package/dist/bigconsole/pages/DashboardViewPage.d.ts +7 -1
- package/dist/bigconsole/pages/DashboardViewPage.js +300 -278
- package/dist/bigconsole/pages/index.d.ts +1 -1
- package/dist/bigconsole/types/index.d.ts +13 -0
- package/dist/bigconsole/utils/widgetDisplayData.d.ts +16 -0
- package/dist/bigconsole/utils/widgetDisplayData.js +12 -1
- package/dist/generated/wspace-operations.d.ts +47 -0
- package/dist/generated/wspace-operations.js +261 -16
- package/dist/generated/wspace-types.d.ts +78 -0
- package/package.json +1 -1
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { numericSeriesKeys as e } from "../components/widgets/chart/charts/numericSeries.js";
|
|
2
|
+
import { classifyChartData as t } from "../components/widgets/chart/chartRows.js";
|
|
3
|
+
import { normalizeMetricData as n } from "../components/widgets/metric-card/metricData.js";
|
|
4
|
+
import { normalizeTableRows as r } from "../components/widgets/table/tableRows.js";
|
|
5
|
+
// src/bigconsole/compare/compareEngine.ts
|
|
6
|
+
var i = {
|
|
7
|
+
absolute: null,
|
|
8
|
+
percent: null,
|
|
9
|
+
direction: "unknown"
|
|
10
|
+
};
|
|
11
|
+
function a(e) {
|
|
12
|
+
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
13
|
+
if (typeof e == "string" && e.trim() !== "") {
|
|
14
|
+
let t = Number(e);
|
|
15
|
+
return Number.isFinite(t) ? t : null;
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
function o(e, t) {
|
|
20
|
+
let n = a(e), r = a(t);
|
|
21
|
+
if (n === null || r === null) return i;
|
|
22
|
+
let o = r - n;
|
|
23
|
+
return {
|
|
24
|
+
absolute: o,
|
|
25
|
+
percent: n === 0 ? null : o / Math.abs(n) * 100,
|
|
26
|
+
direction: o === 0 ? "same" : o > 0 ? "up" : "down"
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
var s = (e) => ({
|
|
30
|
+
kind: "unavailable",
|
|
31
|
+
reason: e
|
|
32
|
+
}), c = (e) => typeof e == "number" ? Number.isFinite(e) ? e : null : typeof e == "string" ? e : null, l = (e, t) => ({
|
|
33
|
+
from: c(e),
|
|
34
|
+
to: c(t),
|
|
35
|
+
change: o(e, t)
|
|
36
|
+
});
|
|
37
|
+
function u(e, t, r) {
|
|
38
|
+
let i = e ?? void 0, a = (e) => n(e, i), o = a(t), c = a(r);
|
|
39
|
+
return o === void 0 && c === void 0 ? s("unreadable_data") : {
|
|
40
|
+
kind: "metric",
|
|
41
|
+
value: l(o?.value, c?.value),
|
|
42
|
+
from: o ?? null,
|
|
43
|
+
to: c ?? null
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
var d = /* @__PURE__ */ new Set(["bar", "line"]);
|
|
47
|
+
function f(e) {
|
|
48
|
+
let n = t(e);
|
|
49
|
+
return n.kind === "rows" ? n.rows : n.kind === "empty" ? [] : null;
|
|
50
|
+
}
|
|
51
|
+
var p = (e, t) => {
|
|
52
|
+
let n = e[t];
|
|
53
|
+
return n == null ? "" : String(n);
|
|
54
|
+
};
|
|
55
|
+
function m(e, t) {
|
|
56
|
+
let n = /* @__PURE__ */ new Map();
|
|
57
|
+
for (let r of e) {
|
|
58
|
+
let e = p(r, t);
|
|
59
|
+
if (n.has(e)) return null;
|
|
60
|
+
n.set(e, r);
|
|
61
|
+
}
|
|
62
|
+
return n;
|
|
63
|
+
}
|
|
64
|
+
function h(t, n, r) {
|
|
65
|
+
let i = f(n), a = f(r);
|
|
66
|
+
if (i === null || a === null) return s("unreadable_data");
|
|
67
|
+
let o = String(t?.xAxisField || t?.labelField || "name"), c = Array.isArray(t?.selectedFields) ? t.selectedFields : void 0, u = [.../* @__PURE__ */ new Set([...e(a, o, c), ...e(i, o, c)])], d = m(i, o), p = m(a, o);
|
|
68
|
+
return d === null || p === null ? s("duplicate_keys") : {
|
|
69
|
+
kind: "chart",
|
|
70
|
+
series: u,
|
|
71
|
+
points: [.../* @__PURE__ */ new Set([...p.keys(), ...d.keys()])].map((e) => ({
|
|
72
|
+
label: e,
|
|
73
|
+
values: u.map((t) => l(d.get(e)?.[t], p.get(e)?.[t]))
|
|
74
|
+
}))
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function g(e, t) {
|
|
78
|
+
let n = (Array.isArray(e?.columns) ? e.columns : []).flatMap((e) => {
|
|
79
|
+
if (typeof e == "string") return [e];
|
|
80
|
+
if (e && typeof e == "object") {
|
|
81
|
+
let t = e, n = t.key || t.field;
|
|
82
|
+
return typeof n == "string" && n !== "" ? [n] : [];
|
|
83
|
+
}
|
|
84
|
+
return [];
|
|
85
|
+
});
|
|
86
|
+
if (n.length > 0) return [...new Set(n)];
|
|
87
|
+
let r = t[0];
|
|
88
|
+
return r ? Object.keys(r) : [];
|
|
89
|
+
}
|
|
90
|
+
function _(e, t) {
|
|
91
|
+
if (e === t) return !0;
|
|
92
|
+
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) => _(e, t[n]));
|
|
94
|
+
let n = e, r = t, i = Object.keys(n);
|
|
95
|
+
return i.length === Object.keys(r).length && i.every((e) => e in r && _(n[e], r[e]));
|
|
96
|
+
}
|
|
97
|
+
var v = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
98
|
+
function y(e, t) {
|
|
99
|
+
return t.length > 0 && t.every((e) => e.id !== void 0 && e.id !== null) ? "id" : e[0] ?? null;
|
|
100
|
+
}
|
|
101
|
+
function b(e, t) {
|
|
102
|
+
let n = /* @__PURE__ */ new Map();
|
|
103
|
+
for (let r of e) {
|
|
104
|
+
let e = r[t], i = e == null ? "" : String(e);
|
|
105
|
+
if (n.has(i)) return null;
|
|
106
|
+
n.set(i, r);
|
|
107
|
+
}
|
|
108
|
+
return n;
|
|
109
|
+
}
|
|
110
|
+
function x(e, t, n) {
|
|
111
|
+
let a = r(t), c = r(n);
|
|
112
|
+
if (!a.every(v) || !c.every(v)) return s("unreadable_data");
|
|
113
|
+
let l = g(e, [...c, ...a]), u = y(l, [...c, ...a]);
|
|
114
|
+
if (u === null) return s("no_key_column");
|
|
115
|
+
let d = b(a, u), f = b(c, u);
|
|
116
|
+
if (d === null || f === null) return s("duplicate_keys");
|
|
117
|
+
let p = [.../* @__PURE__ */ new Set([...f.keys(), ...d.keys()])].map((e) => {
|
|
118
|
+
let t = d.get(e), n = f.get(e), r = l.map((e) => {
|
|
119
|
+
let r = t?.[e], a = n?.[e], s = t !== void 0 && n !== void 0 && !_(r, a);
|
|
120
|
+
return {
|
|
121
|
+
column: e,
|
|
122
|
+
from: r,
|
|
123
|
+
to: a,
|
|
124
|
+
changed: s,
|
|
125
|
+
change: s ? o(r, a) : i
|
|
126
|
+
};
|
|
127
|
+
});
|
|
128
|
+
return {
|
|
129
|
+
key: e,
|
|
130
|
+
status: t === void 0 ? "added" : n === void 0 ? "removed" : r.some((e) => e.changed) ? "changed" : "unchanged",
|
|
131
|
+
cells: r
|
|
132
|
+
};
|
|
133
|
+
}), m = {
|
|
134
|
+
added: 0,
|
|
135
|
+
removed: 0,
|
|
136
|
+
changed: 0,
|
|
137
|
+
unchanged: 0
|
|
138
|
+
};
|
|
139
|
+
for (let e of p) m[e.status] += 1;
|
|
140
|
+
return {
|
|
141
|
+
kind: "table",
|
|
142
|
+
columns: l,
|
|
143
|
+
keyColumn: u,
|
|
144
|
+
rows: p,
|
|
145
|
+
summary: m
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function S(e) {
|
|
149
|
+
return e === "metric_card" || e === "chart" || e === "table";
|
|
150
|
+
}
|
|
151
|
+
function C(e) {
|
|
152
|
+
return typeof e?.chartType == "string" ? e.chartType.toLowerCase() : "line";
|
|
153
|
+
}
|
|
154
|
+
function w(e) {
|
|
155
|
+
if (!S(e.widgetType)) return {
|
|
156
|
+
kind: "unsupported",
|
|
157
|
+
widgetType: e.widgetType
|
|
158
|
+
};
|
|
159
|
+
if (e.widgetType === "chart" && !d.has(C(e.config))) return {
|
|
160
|
+
kind: "unsupported",
|
|
161
|
+
widgetType: `chart:${C(e.config)}`
|
|
162
|
+
};
|
|
163
|
+
let { from: t, to: n } = e;
|
|
164
|
+
if (!t.available) return s("no_data_from");
|
|
165
|
+
if (!n.available) return s("no_data_to");
|
|
166
|
+
switch (e.widgetType) {
|
|
167
|
+
case "metric_card": return u(e.config, t.data, n.data);
|
|
168
|
+
case "chart": return h(e.config, t.data, n.data);
|
|
169
|
+
default: return x(e.config, t.data, n.data);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
export { o as changeBetween, w as compareWidget, S as isCompareSupported };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const COMPARE_PARAM = "compareTo";
|
|
2
|
+
/** The word for "live data" in the URL. */
|
|
3
|
+
export declare const COMPARE_NOW = "now";
|
|
4
|
+
/** What the board is compared with: live data, or the data at a past time. */
|
|
5
|
+
export type CompareTarget = 'now' | Date;
|
|
6
|
+
/** The compare target in a `compareTo` URL value, or null when it is not a valid one after `asOf`. */
|
|
7
|
+
export declare function parseCompareTarget(value: string | null | undefined, asOf: Date | null, now?: Date): CompareTarget | null;
|
|
8
|
+
/** The URL value for a compare target. */
|
|
9
|
+
export declare function formatCompareTarget(target: CompareTarget): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { formatAsOf as e, parseAsOf as t } from "../asof/asOfParam.js";
|
|
2
|
+
// src/bigconsole/compare/compareParam.ts
|
|
3
|
+
var n = "compareTo";
|
|
4
|
+
function r(e, n, r = /* @__PURE__ */ new Date()) {
|
|
5
|
+
if (!n || !e) return null;
|
|
6
|
+
if (e === "now") return "now";
|
|
7
|
+
let i = t(e, r);
|
|
8
|
+
return i && i.getTime() > n.getTime() ? i : null;
|
|
9
|
+
}
|
|
10
|
+
function i(t) {
|
|
11
|
+
return t === "now" ? "now" : e(t);
|
|
12
|
+
}
|
|
13
|
+
export { n as COMPARE_PARAM, i as formatCompareTarget, r as parseCompareTarget };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { WidgetData } from '../types';
|
|
2
|
+
import { CompareSide } from './compareEngine';
|
|
3
|
+
export declare function readCompareSide(fetched: WidgetData | null | undefined, config: Record<string, unknown> | undefined,
|
|
4
|
+
/** Narrows the rows the way the board's active filters do. */
|
|
5
|
+
narrow?: (data: unknown) => unknown): CompareSide;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { unwrapRows as e } from "../components/widgets/utils/inferFields.js";
|
|
2
|
+
import { resolveWidgetDataPath as t, resolveWidgetDisplayData as n } from "../utils/widgetDisplayData.js";
|
|
3
|
+
// src/bigconsole/compare/compareSide.ts
|
|
4
|
+
function r(e) {
|
|
5
|
+
let t = e?.dataKey ?? e?.dataPath ?? e?.seriesPath;
|
|
6
|
+
return typeof t == "string" && t.trim() !== "" ? t : null;
|
|
7
|
+
}
|
|
8
|
+
var i = (e) => Array.isArray(e) && e.length === 0;
|
|
9
|
+
function a(t, n) {
|
|
10
|
+
if (t.error) return !1;
|
|
11
|
+
let a = t.processed;
|
|
12
|
+
if (typeof a == "string") try {
|
|
13
|
+
a = JSON.parse(a);
|
|
14
|
+
} catch {
|
|
15
|
+
return !1;
|
|
16
|
+
}
|
|
17
|
+
if (i(a)) return !0;
|
|
18
|
+
let o = r(n);
|
|
19
|
+
return o && i(o.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, a)) ? !0 : i(e(a));
|
|
20
|
+
}
|
|
21
|
+
function o(e, r, i) {
|
|
22
|
+
if (!e || e.asOf?.historyAvailable === !1) return { available: !1 };
|
|
23
|
+
let { data: o } = n({
|
|
24
|
+
fetched: e,
|
|
25
|
+
config: r,
|
|
26
|
+
allowSamples: !1,
|
|
27
|
+
asOf: !0
|
|
28
|
+
});
|
|
29
|
+
if (o === null) return a(e, r) ? {
|
|
30
|
+
available: !0,
|
|
31
|
+
data: []
|
|
32
|
+
} : { available: !1 };
|
|
33
|
+
let s = t(o, r);
|
|
34
|
+
return {
|
|
35
|
+
available: !0,
|
|
36
|
+
data: i ? i(s) : s
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export { o as readCompareSide };
|