@burdenoff/microfe-bigconsole 2026.1119.1 → 2026.1119.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.
Files changed (43) hide show
  1. package/dist/bigconsole/asof/AsOfBanner.js +28 -14
  2. package/dist/bigconsole/asof/AsOfControl.js +84 -16
  3. package/dist/bigconsole/asof/AsOfProvider.d.ts +7 -0
  4. package/dist/bigconsole/asof/AsOfProvider.js +74 -52
  5. package/dist/bigconsole/asof/index.d.ts +1 -1
  6. package/dist/bigconsole/asof/index.js +4 -4
  7. package/dist/bigconsole/compare/compareEngine.d.ts +104 -0
  8. package/dist/bigconsole/compare/compareEngine.js +172 -0
  9. package/dist/bigconsole/compare/compareParam.d.ts +9 -0
  10. package/dist/bigconsole/compare/compareParam.js +13 -0
  11. package/dist/bigconsole/compare/compareSide.d.ts +5 -0
  12. package/dist/bigconsole/compare/compareSide.js +39 -0
  13. package/dist/bigconsole/compare/index.d.ts +3 -0
  14. package/dist/bigconsole/components/widgets/FilterNotAppliedNotice.d.ts +15 -0
  15. package/dist/bigconsole/components/widgets/FilterNotAppliedNotice.js +62 -0
  16. package/dist/bigconsole/components/widgets/WidgetCompareView.d.ts +12 -0
  17. package/dist/bigconsole/components/widgets/WidgetCompareView.js +215 -0
  18. package/dist/bigconsole/components/widgets/WidgetWrapper.js +380 -329
  19. package/dist/bigconsole/components/widgets/chart/ChartWidget.js +131 -126
  20. package/dist/bigconsole/components/widgets/chart/chartRows.d.ts +16 -0
  21. package/dist/bigconsole/components/widgets/chart/chartRows.js +33 -1
  22. package/dist/bigconsole/components/widgets/metric-card/MetricCardWidget.d.ts +2 -20
  23. package/dist/bigconsole/components/widgets/metric-card/MetricCardWidget.js +48 -148
  24. package/dist/bigconsole/components/widgets/metric-card/metricCardData.d.ts +48 -0
  25. package/dist/bigconsole/components/widgets/metric-card/metricCardData.js +96 -0
  26. package/dist/bigconsole/components/widgets/metric-card/metricData.d.ts +30 -0
  27. package/dist/bigconsole/components/widgets/metric-card/metricData.js +46 -0
  28. package/dist/bigconsole/components/widgets/table/TableCell.d.ts +2 -1
  29. package/dist/bigconsole/components/widgets/table/TableCell.js +1 -1
  30. package/dist/bigconsole/components/widgets/table/TableWidget.js +142 -168
  31. package/dist/bigconsole/components/widgets/table/tableRows.d.ts +17 -0
  32. package/dist/bigconsole/components/widgets/table/tableRows.js +35 -0
  33. package/dist/bigconsole/hooks/index.d.ts +1 -0
  34. package/dist/bigconsole/hooks/index.js +25 -24
  35. package/dist/bigconsole/hooks/useWidgetCompareData.d.ts +8 -0
  36. package/dist/bigconsole/hooks/useWidgetCompareData.js +24 -0
  37. package/dist/bigconsole/utils/applyGlobalFilters.d.ts +3 -1
  38. package/dist/bigconsole/utils/applyGlobalFilters.js +53 -4
  39. package/dist/bigconsole/utils/globalFilterMatching.d.ts +21 -3
  40. package/dist/bigconsole/utils/globalFilterMatching.js +14 -9
  41. package/dist/bigconsole/utils/widgetDisplayData.d.ts +10 -0
  42. package/dist/bigconsole/utils/widgetDisplayData.js +8 -1
  43. package/package.json +1 -1
@@ -1,39 +1,40 @@
1
1
  import e from "./useWidgetData.js";
2
+ import { useWidgetCompareData as t } from "./useWidgetCompareData.js";
2
3
  import "./useWidgetCatalog.js";
3
- import { formatTimeUntilRefresh as t, useWidgetAutoRefresh as n } from "./useAutoRefresh.js";
4
- import r from "./useWidgetOperations.js";
5
- import i from "./useWidgetComments.js";
6
- import a from "./useWidgetConfigPersist.js";
7
- import o from "./useDashboardOperations.js";
8
- import s from "./useWidgetExport.js";
4
+ import { formatTimeUntilRefresh as n, useWidgetAutoRefresh as r } from "./useAutoRefresh.js";
5
+ import i from "./useWidgetOperations.js";
6
+ import a from "./useWidgetComments.js";
7
+ import o from "./useWidgetConfigPersist.js";
8
+ import s from "./useDashboardOperations.js";
9
+ import c from "./useWidgetExport.js";
9
10
  import "./useDashboardImageExport.js";
10
- import c from "./useDrilldown.js";
11
- import l from "./useDrilldownOperations.js";
11
+ import l from "./useDrilldown.js";
12
+ import u from "./useDrilldownOperations.js";
12
13
  import "./useWidgetEvents.js";
13
14
  import "./useWidgetActions.js";
14
- import u from "./useExportDashboard.js";
15
- import d from "./useImportDashboard.js";
16
- import f from "./useBoardMigrationPreview.js";
15
+ import d from "./useExportDashboard.js";
16
+ import f from "./useImportDashboard.js";
17
+ import p from "./useBoardMigrationPreview.js";
17
18
  import "./useEventWebhooks.js";
18
19
  import "./useEventLogs.js";
19
- import p from "./useDataSinkOperations.js";
20
+ import m from "./useDataSinkOperations.js";
20
21
  import "./useBigConsoleAnalytics.js";
21
- import m from "./useParserOperations.js";
22
+ import h from "./useParserOperations.js";
22
23
  import "./useWorkflowOperations.js";
23
24
  import "./usePipelineOperations.js";
24
- import h from "./useGlobalFilters.js";
25
- import g from "./useDashboardSharing.js";
26
- import _ from "./useDashboardViews.js";
25
+ import g from "./useGlobalFilters.js";
26
+ import _ from "./useDashboardSharing.js";
27
+ import v from "./useDashboardViews.js";
27
28
  import "./useDashboardTemplates.js";
28
- import v from "./useFilterUrlSync.js";
29
- import y from "./useFilterPresets.js";
29
+ import y from "./useFilterUrlSync.js";
30
+ import b from "./useFilterPresets.js";
30
31
  import "./useCrossFilter.js";
31
- import b from "./usePageOperations.js";
32
- import x from "./useExportParser.js";
33
- import S from "./useImportParser.js";
32
+ import x from "./usePageOperations.js";
33
+ import S from "./useExportParser.js";
34
+ import C from "./useImportParser.js";
34
35
  import "./useDetectAnomalies.js";
35
- import C from "./useExportDataSink.js";
36
- import w from "./useImportDataSink.js";
36
+ import w from "./useExportDataSink.js";
37
+ import T from "./useImportDataSink.js";
37
38
  import "./useWidgetNarrative.js";
38
39
  import "./useDashboardDigest.js";
39
- export { t as formatTimeUntilRefresh, f as useBoardMigrationPreview, o as useDashboardOperations, g as useDashboardSharing, _ as useDashboardViews, p as useDataSinkOperations, c as useDrilldown, l as useDrilldownOperations, u as useExportDashboard, C as useExportDataSink, x as useExportParser, y as useFilterPresets, v as useFilterUrlSync, h as useGlobalFilters, d as useImportDashboard, w as useImportDataSink, S as useImportParser, b as usePageOperations, m as useParserOperations, n as useWidgetAutoRefresh, i as useWidgetComments, a as useWidgetConfigPersist, e as useWidgetData, s as useWidgetExport, r as useWidgetOperations };
40
+ export { n as formatTimeUntilRefresh, p as useBoardMigrationPreview, s as useDashboardOperations, _ as useDashboardSharing, v as useDashboardViews, m as useDataSinkOperations, l as useDrilldown, u as useDrilldownOperations, d as useExportDashboard, w as useExportDataSink, S as useExportParser, b as useFilterPresets, y as useFilterUrlSync, g as useGlobalFilters, f as useImportDashboard, T as useImportDataSink, C as useImportParser, x as usePageOperations, h as useParserOperations, r as useWidgetAutoRefresh, a as useWidgetComments, t as useWidgetCompareData, o as useWidgetConfigPersist, e as useWidgetData, c as useWidgetExport, i as useWidgetOperations };
@@ -0,0 +1,8 @@
1
+ import { CompareTarget } from '../compare/compareParam';
2
+ import { WidgetData } from '../types';
3
+ export interface WidgetCompareData {
4
+ data: WidgetData | null;
5
+ loading: boolean;
6
+ error: Error | null;
7
+ }
8
+ export declare function useWidgetCompareData(widgetId: string, target: CompareTarget | null, skip?: boolean): WidgetCompareData;
@@ -0,0 +1,24 @@
1
+ import { GetWidgetDataAsOfDocument as e, GetWidgetDocument as t } from "../../generated/wspace-operations.js";
2
+ import { useMemo as n } from "react";
3
+ import { useQuery as r } from "@apollo/client/react";
4
+ // src/bigconsole/hooks/useWidgetCompareData.ts
5
+ function i(i, a, o = !1) {
6
+ let s = a instanceof Date ? a : null, c = a === "now", l = o || !i || a === null, u = r(t, {
7
+ variables: { id: i },
8
+ skip: l || !c,
9
+ fetchPolicy: "network-only"
10
+ }), d = r(e, {
11
+ variables: {
12
+ id: i,
13
+ asOf: (s ?? /* @__PURE__ */ new Date(0)).toISOString()
14
+ },
15
+ skip: l || s === null,
16
+ fetchPolicy: "cache-first"
17
+ }), f = c ? u : d, p = f.data?.getWidget?.data ?? null, m = f.error?.message, h = n(() => m ? Error(m) : null, [m]);
18
+ return {
19
+ data: p,
20
+ loading: !l && f.loading,
21
+ error: h
22
+ };
23
+ }
24
+ export { i as useWidgetCompareData };
@@ -7,7 +7,9 @@
7
7
  * filter either narrows the rows a widget renders or is reported as not
8
8
  * applicable. Envelopes keep every other property (e.g. retention `periods`,
9
9
  * chart axes), so derived values such as retention averages are recomputed by
10
- * the renderer from the narrowed rows.
10
+ * the renderer from the narrowed rows. A heatmap's axes are the exception:
11
+ * labels whose cells were all filtered out are dropped (see
12
+ * `narrowHeatmapEnvelope`), because the renderer draws every axis label.
11
13
  */
12
14
  export interface ApplyGlobalFiltersOptions {
13
15
  /** Merged filter values keyed by filter id, `ctx_<field>` (drilldown) or a field name. */
@@ -80,11 +80,60 @@ function f(e, n) {
80
80
  if (typeof e != "object") return e;
81
81
  let o = e, s = t(o, n.widgetType);
82
82
  if (!s) return e;
83
- let c = o[s].filter(a);
84
- return {
83
+ let c = o[s], l = c.filter(a), u = {
85
84
  ...o,
86
- [s]: c,
87
- ...s === "rows" ? { totalRows: c.length } : {}
85
+ [s]: l,
86
+ ...s === "rows" ? { totalRows: l.length } : {}
88
87
  };
88
+ return s === "cells" && l.length < c.length ? g(u, c, l) : u;
89
+ }
90
+ function p(e) {
91
+ return Array.isArray(e) && e.every((e) => typeof e == "string");
92
+ }
93
+ function m(e) {
94
+ let t;
95
+ for (let n of e) {
96
+ if (typeof n != "object" || !n) continue;
97
+ let e = l(n.value);
98
+ e !== void 0 && (t = t ? {
99
+ min: Math.min(t.min, e),
100
+ max: Math.max(t.max, e)
101
+ } : {
102
+ min: e,
103
+ max: e
104
+ });
105
+ }
106
+ return t;
107
+ }
108
+ function h(e, t) {
109
+ let n = /* @__PURE__ */ new Set();
110
+ for (let r of e) {
111
+ if (typeof r != "object" || !r) continue;
112
+ let e = r[t];
113
+ e != null && n.add(String(e));
114
+ }
115
+ return n;
116
+ }
117
+ function g(e, t, n) {
118
+ let r = { ...e };
119
+ for (let [i, a] of [["rows", "row"], ["columns", "column"]]) {
120
+ let o = e[i];
121
+ if (!p(o)) continue;
122
+ let s = h(t, a), c = h(n, a);
123
+ r[i] = o.filter((e) => !s.has(e) || c.has(e));
124
+ }
125
+ let i = m(t);
126
+ if (!i) return r;
127
+ let a = m(n), o = [[
128
+ "minValue",
129
+ i.min,
130
+ a?.min
131
+ ], [
132
+ "maxValue",
133
+ i.max,
134
+ a?.max
135
+ ]];
136
+ for (let [t, n, i] of o) l(e[t]) === n && (i === void 0 ? delete r[t] : r[t] = i);
137
+ return r;
89
138
  }
90
139
  export { f as applyGlobalFilters };
@@ -43,14 +43,32 @@ export interface InapplicableFilter {
43
43
  filterId: string;
44
44
  name: string;
45
45
  field: string;
46
+ /**
47
+ * Why the filter cannot narrow the widget:
48
+ * - `missingField`: no row carries the field (or the data has no rows).
49
+ * - `precomputedValue`: the rows carry the field, but the value the widget
50
+ * shows is a precomputed figure beside them (a metric card's `total`), so
51
+ * narrowing the rows does not change it.
52
+ */
53
+ reason: 'missingField' | 'precomputedValue';
54
+ }
55
+ export interface FindInapplicableFiltersOptions {
56
+ /**
57
+ * True when the widget shows a single precomputed value rather than a value
58
+ * derived from the rows (see `resolveMetricCardData`). Every active filter is
59
+ * then reported, because none can change that value.
60
+ */
61
+ precomputedValue?: boolean;
46
62
  }
47
63
  /**
48
64
  * Active filters that cannot narrow this widget's data: either the data has
49
65
  * object rows but none carries the filter's configured field, or the data has
50
- * no rows at all (e.g. a single-value metric card). Pass the same subtree that
51
- * is filtered (after dataKey/dataPath resolution). Absent data reports nothing.
66
+ * no rows at all (e.g. a single-value metric card), or the widget shows a
67
+ * precomputed value the rows do not feed (`options.precomputedValue`). Pass
68
+ * the same subtree that is filtered (after dataKey/dataPath resolution).
69
+ * Absent data reports nothing.
52
70
  */
53
- export declare function findInapplicableFilters(data: unknown, filterMeta: Record<string, FilterMeta>, filterValues: Record<string, unknown>, widgetType?: string): InapplicableFilter[];
71
+ export declare function findInapplicableFilters(data: unknown, filterMeta: Record<string, FilterMeta>, filterValues: Record<string, unknown>, widgetType?: string, options?: FindInapplicableFiltersOptions): InapplicableFilter[];
54
72
  /**
55
73
  * Category options for a filter. Configured labels always win for the values
56
74
  * they cover. With `optionsFromField`, data-derived values lead and configured
@@ -105,15 +105,20 @@ function d(e, t) {
105
105
  label: e
106
106
  }));
107
107
  }
108
- function f(e, t, r, i) {
109
- if (e == null || l(e, i)) return [];
110
- let a = u(e, i).filter(n), c = [];
111
- for (let [e, n] of Object.entries(t)) o(r[e]) || a.some((e) => s(e, n.field) !== void 0) || c.push({
112
- filterId: e,
113
- name: n.name,
114
- field: n.field
115
- });
116
- return c;
108
+ function f(e, t, r, i, a = {}) {
109
+ if (e == null || !a.precomputedValue && l(e, i)) return [];
110
+ let c = u(e, i).filter(n), d = [];
111
+ for (let [e, n] of Object.entries(t)) {
112
+ if (o(r[e])) continue;
113
+ let t = c.some((e) => s(e, n.field) !== void 0);
114
+ (!t || a.precomputedValue) && d.push({
115
+ filterId: e,
116
+ name: n.name,
117
+ field: n.field,
118
+ reason: t || a.precomputedValue && c.length === 0 ? "precomputedValue" : "missingField"
119
+ });
120
+ }
121
+ return d;
117
122
  }
118
123
  function p(e, t, r) {
119
124
  let i = (Array.isArray(e) ? e : []).filter(n).map((e) => ({
@@ -35,3 +35,13 @@ export declare function widgetDataSourcePolicy(widget: {
35
35
  allowSamples: boolean;
36
36
  mockSource: boolean;
37
37
  };
38
+ /**
39
+ * A widget may bind to a parser whose output is an envelope ({ byUnit:[...], house:{...} })
40
+ * rather than the exact array or object the renderer wants. `config.dataKey` / `dataPath` /
41
+ * `seriesPath` is a dot-path into the data that points at the renderable subtree. When it
42
+ * resolves to nothing usable, the data is returned as it was.
43
+ *
44
+ * valueField (single-value metric path) is intentionally NOT applied here: the metric card
45
+ * resolves it itself against the envelope.
46
+ */
47
+ export declare function resolveWidgetDataPath<T>(data: T, config: Record<string, unknown> | undefined): T | Record<string, unknown>;
@@ -111,4 +111,11 @@ function u(e, t) {
111
111
  mockSource: a
112
112
  };
113
113
  }
114
- export { n as isUsableWidgetData, o as resolveWidgetDisplayData, u as widgetDataSourcePolicy, l as widgetExportRows };
114
+ function d(e, t) {
115
+ if (!e || typeof e != "object" || Array.isArray(e)) return e;
116
+ let r = t?.dataKey ?? t?.dataPath ?? t?.seriesPath;
117
+ if (!r || typeof r != "string") return e;
118
+ let i = r.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
119
+ return i != null && n(i) ? i : e;
120
+ }
121
+ export { n as isUsableWidgetData, d as resolveWidgetDataPath, o as resolveWidgetDisplayData, u as widgetDataSourcePolicy, l as widgetExportRows };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-bigconsole",
3
- "version": "2026.1119.1",
3
+ "version": "2026.1119.3",
4
4
  "description": "BigConsole - AI-powered analytics and dashboard platform",
5
5
  "repository": {
6
6
  "type": "git",