@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
@@ -12,12 +12,12 @@ import { ScatterChart as f } from "./charts/ScatterChart.js";
12
12
  import { ChartLegend as p } from "./ChartLegend.js";
13
13
  import "../../../contexts/index.js";
14
14
  import { WidgetEmptyState as m } from "../states/EmptyState.js";
15
- import { classifyChartData as h } from "./chartRows.js";
16
- import { memo as g, useCallback as _, useMemo as v, useState as y } from "react";
17
- import { useI18n as b } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
18
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
15
+ import { aggregatePieRows as h, classifyChartData as g } from "./chartRows.js";
16
+ import { memo as _, useCallback as v, useMemo as y, useState as b } from "react";
17
+ import { useI18n as x } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
18
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
19
19
  // src/bigconsole/components/widgets/chart/ChartWidget.tsx
20
- var C = [], w = {
20
+ var w = [], T = {
21
21
  number: {
22
22
  key: "bigconsole.widget.chart.unsupported.number",
23
23
  fallback: "This data is a single value."
@@ -34,162 +34,167 @@ var C = [], w = {
34
34
  key: "bigconsole.widget.chart.unsupported.values",
35
35
  fallback: "This data is a list of values without field names."
36
36
  }
37
- }, T = [
37
+ }, E = [
38
38
  "var(--color-chart-1)",
39
39
  "var(--color-chart-2)",
40
40
  "var(--color-chart-3)",
41
41
  "var(--color-chart-4)",
42
42
  "var(--color-chart-5)"
43
- ], E = g(function({ widget: g, data: E = [], onClick: D, onDrilldown: O }) {
44
- let { t: k } = b(), A = g.config, [j, M] = y([]), N = v(() => h(E), [E]), P = N.kind === "rows" ? N.rows : C, { handleDataClick: F, enabled: I } = t(g.id, A?.crossFilterMappings || [{
45
- sourceField: A?.labelField || "name",
43
+ ], D = _(function({ widget: _, data: D = [], onClick: O, onDrilldown: k }) {
44
+ let { t: A } = x(), j = _.config, [M, N] = b([]), P = y(() => g(D), [D]), F = P.kind === "rows" ? P.rows : w, I = j?.valueField || "value", L = j?.labelField || "name", R = j?.chartType?.toLowerCase() === "pie", z = y(() => R ? h(F, L, I) : F, [
45
+ R,
46
+ F,
47
+ L,
48
+ I
49
+ ]), { handleDataClick: B, enabled: V } = t(_.id, j?.crossFilterMappings || [{
50
+ sourceField: j?.labelField || "name",
46
51
  targetFilterId: "category"
47
- }]), { clearAllCrossFilters: L, hasCrossFilters: R } = e(), z = v(() => ({
48
- type: g.type === "funnel_chart" ? "funnel" : A?.chartType?.toLowerCase() || "line",
49
- xAxisKey: A?.xAxisField || A?.labelField || "name",
50
- xAxisLabel: A?.xAxisLabel,
51
- yAxisLabel: A?.yAxisLabel,
52
- showGrid: A?.showGrid,
53
- showLegend: A?.showLegend,
54
- legendPosition: A?.legendPosition,
55
- showDots: A?.showDataPoints,
56
- curveType: A?.curveType,
57
- colors: A?.colors,
58
- seriesNames: A?.seriesLabels,
59
- stacked: A?.stacked,
60
- isDonut: A?.showAsDonut,
61
- innerRadius: A?.innerRadius,
62
- outerRadius: A?.outerRadius,
63
- referenceLines: A?.referenceLines,
64
- series: A?.series,
65
- selectedFields: A?.selectedFields,
66
- dualAxis: A?.dualAxis,
67
- yAxisRightLabel: A?.yAxisRightLabel,
68
- logScale: A?.logScale,
69
- startAtZero: A?.startAtZero,
70
- yMin: A?.yMin,
71
- yMax: A?.yMax,
72
- valueField: A?.valueField,
73
- labelField: A?.labelField,
74
- showTotal: A?.showTotal,
75
- totalLabel: A?.totalLabel,
76
- xField: A?.xField,
77
- yField: A?.yField,
78
- sizeField: A?.sizeField,
79
- colorField: A?.colorField
80
- }), [A, g.type]), B = z.type !== "funnel" && (z.type === "combo" || z.dualAxis === !0 || z.series?.some((e) => e.axis === "right" || e.type === "bar") && z.series?.some((e) => e.type === "line") || !1), V = v(() => !P.length || z.type === "pie" || z.type === "funnel" || z.type === "scatter" || z.type === "waterfall" ? [] : (B && z.selectedFields !== void 0 ? n(P, z).map((e) => e.field) : r(P, z.xAxisKey, z.selectedFields)).map((e, t) => ({
52
+ }]), { clearAllCrossFilters: H, hasCrossFilters: U } = e(), W = y(() => ({
53
+ type: _.type === "funnel_chart" ? "funnel" : j?.chartType?.toLowerCase() || "line",
54
+ xAxisKey: j?.xAxisField || j?.labelField || "name",
55
+ xAxisLabel: j?.xAxisLabel,
56
+ yAxisLabel: j?.yAxisLabel,
57
+ showGrid: j?.showGrid,
58
+ showLegend: j?.showLegend,
59
+ legendPosition: j?.legendPosition,
60
+ showDots: j?.showDataPoints,
61
+ curveType: j?.curveType,
62
+ colors: j?.colors,
63
+ seriesNames: j?.seriesLabels,
64
+ stacked: j?.stacked,
65
+ isDonut: j?.showAsDonut,
66
+ innerRadius: j?.innerRadius,
67
+ outerRadius: j?.outerRadius,
68
+ referenceLines: j?.referenceLines,
69
+ series: j?.series,
70
+ selectedFields: j?.selectedFields,
71
+ dualAxis: j?.dualAxis,
72
+ yAxisRightLabel: j?.yAxisRightLabel,
73
+ logScale: j?.logScale,
74
+ startAtZero: j?.startAtZero,
75
+ yMin: j?.yMin,
76
+ yMax: j?.yMax,
77
+ valueField: j?.valueField,
78
+ labelField: j?.labelField,
79
+ showTotal: j?.showTotal,
80
+ totalLabel: j?.totalLabel,
81
+ xField: j?.xField,
82
+ yField: j?.yField,
83
+ sizeField: j?.sizeField,
84
+ colorField: j?.colorField
85
+ }), [j, _.type]), G = W.type !== "funnel" && (W.type === "combo" || W.dualAxis === !0 || W.series?.some((e) => e.axis === "right" || e.type === "bar") && W.series?.some((e) => e.type === "line") || !1), K = y(() => !F.length || W.type === "pie" || W.type === "funnel" || W.type === "scatter" || W.type === "waterfall" ? [] : (G && W.selectedFields !== void 0 ? n(F, W).map((e) => e.field) : r(F, W.xAxisKey, W.selectedFields)).map((e, t) => ({
81
86
  dataKey: e,
82
- name: z.seriesNames?.[e] || e,
83
- color: z.colors?.[t] || T[t % T.length],
84
- hidden: j.includes(e)
87
+ name: W.seriesNames?.[e] || e,
88
+ color: W.colors?.[t] || E[t % E.length],
89
+ hidden: M.includes(e)
85
90
  })), [
86
- P,
87
- z,
88
- j,
89
- A?.selectedFields,
90
- B
91
- ]), H = _((e) => {
92
- M((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
93
- }, []), U = _((e, t) => {
94
- if (I) {
95
- let t = e[A?.labelField || "name"];
96
- F(e, t);
91
+ F,
92
+ W,
93
+ M,
94
+ j?.selectedFields,
95
+ G
96
+ ]), q = v((e) => {
97
+ N((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
98
+ }, []), J = v((e, t) => {
99
+ if (V) {
100
+ let t = e[j?.labelField || "name"];
101
+ B(e, t);
97
102
  }
98
- O ? O(e) : D && g.drilldowns?.length && D(e, t);
103
+ k ? k(e) : O && _.drilldowns?.length && O(e, t);
99
104
  }, [
100
- D,
101
105
  O,
102
- g.drilldowns,
103
- I,
104
- F,
105
- A?.labelField
106
- ]), W = () => {
107
- if (B) return /* @__PURE__ */ x(u, {
108
- data: P,
109
- config: z,
110
- hiddenSeries: j,
111
- onDataClick: U
106
+ k,
107
+ _.drilldowns,
108
+ V,
109
+ B,
110
+ j?.labelField
111
+ ]), Y = () => {
112
+ if (G) return /* @__PURE__ */ S(u, {
113
+ data: F,
114
+ config: W,
115
+ hiddenSeries: M,
116
+ onDataClick: J
112
117
  });
113
- switch (z.type) {
114
- case "waterfall": return /* @__PURE__ */ x(d, {
115
- data: P,
116
- config: z,
117
- onDataClick: U
118
+ switch (W.type) {
119
+ case "waterfall": return /* @__PURE__ */ S(d, {
120
+ data: F,
121
+ config: W,
122
+ onDataClick: J
118
123
  });
119
- case "scatter": return /* @__PURE__ */ x(f, {
120
- data: P,
121
- config: z,
122
- onDataClick: U
124
+ case "scatter": return /* @__PURE__ */ S(f, {
125
+ data: F,
126
+ config: W,
127
+ onDataClick: J
123
128
  });
124
- case "bar": return /* @__PURE__ */ x(a, {
125
- data: P,
126
- config: z,
127
- hiddenSeries: j,
128
- onDataClick: U
129
+ case "bar": return /* @__PURE__ */ S(a, {
130
+ data: F,
131
+ config: W,
132
+ hiddenSeries: M,
133
+ onDataClick: J
129
134
  });
130
- case "area": return /* @__PURE__ */ x(o, {
131
- data: P,
132
- config: z,
133
- hiddenSeries: j,
134
- onDataClick: U
135
+ case "area": return /* @__PURE__ */ S(o, {
136
+ data: F,
137
+ config: W,
138
+ hiddenSeries: M,
139
+ onDataClick: J
135
140
  });
136
- case "pie": return /* @__PURE__ */ x(s, {
137
- data: P,
138
- config: z,
139
- dataKey: A?.valueField || "value",
140
- nameKey: A?.labelField || "name",
141
- onDataClick: U
141
+ case "pie": return /* @__PURE__ */ S(s, {
142
+ data: z,
143
+ config: W,
144
+ dataKey: I,
145
+ nameKey: L,
146
+ onDataClick: J
142
147
  });
143
148
  case "funnel": {
144
- let e = l(P, {
145
- valueField: A?.valueField,
146
- labelField: A?.labelField
149
+ let e = l(F, {
150
+ valueField: j?.valueField,
151
+ labelField: j?.labelField
147
152
  });
148
- return /* @__PURE__ */ x(c, {
149
- data: P,
150
- config: z,
153
+ return /* @__PURE__ */ S(c, {
154
+ data: F,
155
+ config: W,
151
156
  dataKey: e.valueField,
152
157
  nameKey: e.labelField,
153
- onDataClick: U
158
+ onDataClick: J
154
159
  });
155
160
  }
156
- default: return /* @__PURE__ */ x(i, {
157
- data: P,
158
- config: z,
159
- hiddenSeries: j,
160
- onDataClick: U
161
+ default: return /* @__PURE__ */ S(i, {
162
+ data: F,
163
+ config: W,
164
+ hiddenSeries: M,
165
+ onDataClick: J
161
166
  });
162
167
  }
163
168
  };
164
- if (N.kind === "empty") return /* @__PURE__ */ x(m, {
169
+ if (P.kind === "empty") return /* @__PURE__ */ S(m, {
165
170
  widgetType: "chart",
166
171
  hasDataSource: !0
167
172
  });
168
- if (N.kind === "unsupported") {
169
- let e = w[N.shape];
170
- return /* @__PURE__ */ x(m, {
173
+ if (P.kind === "unsupported") {
174
+ let e = T[P.shape];
175
+ return /* @__PURE__ */ S(m, {
171
176
  widgetType: "chart",
172
177
  hasDataSource: !0,
173
- message: `${k(e.key, e.fallback)} ${k("bigconsole.widget.chart.unsupported.hint", "A chart needs a list of rows. Pick a parser that returns rows, or use a Metric Card for one number.")}`
178
+ message: `${A(e.key, e.fallback)} ${A("bigconsole.widget.chart.unsupported.hint", "A chart needs a list of rows. Pick a parser that returns rows, or use a Metric Card for one number.")}`
174
179
  });
175
180
  }
176
- return /* @__PURE__ */ S("div", {
181
+ return /* @__PURE__ */ C("div", {
177
182
  className: "flex flex-col h-full p-4",
178
183
  children: [
179
- R && /* @__PURE__ */ x("div", {
184
+ U && /* @__PURE__ */ S("div", {
180
185
  className: "flex items-center gap-2 mb-2 -mt-1",
181
- children: /* @__PURE__ */ S("button", {
186
+ children: /* @__PURE__ */ C("button", {
182
187
  type: "button",
183
188
  onClick: (e) => {
184
- e.stopPropagation(), L();
189
+ e.stopPropagation(), H();
185
190
  },
186
191
  className: "\n inline-flex items-center gap-1.5\n px-2.5 py-1 rounded-md\n text-xs font-medium\n bg-action-primary-bg/10 text-action-primary-text\n hover:bg-action-primary-bg/20\n transition-colors\n ",
187
- children: [/* @__PURE__ */ x("svg", {
192
+ children: [/* @__PURE__ */ S("svg", {
188
193
  className: "w-3.5 h-3.5",
189
194
  fill: "none",
190
195
  stroke: "currentColor",
191
196
  viewBox: "0 0 24 24",
192
- children: /* @__PURE__ */ x("path", {
197
+ children: /* @__PURE__ */ S("path", {
193
198
  strokeLinecap: "round",
194
199
  strokeLinejoin: "round",
195
200
  strokeWidth: 2,
@@ -198,21 +203,21 @@ var C = [], w = {
198
203
  }), "Clear Filter"]
199
204
  })
200
205
  }),
201
- z.legendPosition === "top" && V.length > 0 && /* @__PURE__ */ x(p, {
202
- items: V,
206
+ W.legendPosition === "top" && K.length > 0 && /* @__PURE__ */ S(p, {
207
+ items: K,
203
208
  position: "top",
204
- onItemClick: H
209
+ onItemClick: q
205
210
  }),
206
- /* @__PURE__ */ x("div", {
211
+ /* @__PURE__ */ S("div", {
207
212
  className: "flex-1 min-h-0",
208
- children: W()
213
+ children: Y()
209
214
  }),
210
- z.legendPosition === "bottom" && V.length > 0 && /* @__PURE__ */ x(p, {
211
- items: V,
215
+ W.legendPosition === "bottom" && K.length > 0 && /* @__PURE__ */ S(p, {
216
+ items: K,
212
217
  position: "bottom",
213
- onItemClick: H
218
+ onItemClick: q
214
219
  })
215
220
  ]
216
221
  });
217
222
  });
218
- export { E as ChartWidget, E as default };
223
+ export { D as ChartWidget, D as default };
@@ -11,3 +11,19 @@ export type ChartRowsResult = {
11
11
  readonly shape: UnsupportedChartShape;
12
12
  };
13
13
  export declare function classifyChartData(data: unknown): ChartRowsResult;
14
+ /**
15
+ * One slice per label: a pie bound to raw rows (`[{channel, brand, region,
16
+ * sales}, …]`) sums `valueField` by `labelField` (BOFF-10411).
17
+ *
18
+ * Drawing each raw row as its own slice repeated every label, and a dashboard
19
+ * filter that narrowed the rows only reshuffled duplicate slices, so the pie
20
+ * looked unchanged. Summing per label means the pie shows the filtered mix.
21
+ *
22
+ * Rows whose labels are already unique (a pre-aggregated `[{name, value}]`
23
+ * result) are returned unchanged, keeping every field for drilldown. Merged
24
+ * rows carry only the label and the summed value, because the other fields
25
+ * differ between the rows that were merged. Labels keep first-seen order; a
26
+ * row without a numeric value adds nothing to its slice. Rows that do not
27
+ * carry `labelField` at all are returned unchanged.
28
+ */
29
+ export declare function aggregatePieRows(rows: readonly ChartData[], labelField: string, valueField: string): ChartData[];
@@ -24,4 +24,36 @@ function t(t) {
24
24
  shape: "object"
25
25
  };
26
26
  }
27
- export { t as classifyChartData };
27
+ function n(e) {
28
+ if (typeof e == "number") return Number.isFinite(e) ? e : void 0;
29
+ if (typeof e == "string" && e.trim() !== "") {
30
+ let t = Number(e);
31
+ return Number.isFinite(t) ? t : void 0;
32
+ }
33
+ }
34
+ function r(e, t, r) {
35
+ if (!e.some((e) => e[t] !== void 0 && e[t] !== null)) return e;
36
+ let i = /* @__PURE__ */ new Set(), a = !1;
37
+ for (let n of e) {
38
+ let e = String(n[t] ?? "");
39
+ if (i.has(e)) {
40
+ a = !0;
41
+ break;
42
+ }
43
+ i.add(e);
44
+ }
45
+ if (!a) return e;
46
+ let o = /* @__PURE__ */ new Map();
47
+ for (let i of e) {
48
+ let e = String(i[t] ?? ""), a = o.get(e) ?? {
49
+ label: i[t],
50
+ total: 0
51
+ };
52
+ a.total += n(i[r]) ?? 0, o.set(e, a);
53
+ }
54
+ return Array.from(o.values(), ({ label: e, total: n }) => ({
55
+ [t]: e,
56
+ [r]: n
57
+ }));
58
+ }
59
+ export { r as aggregatePieRows, t as classifyChartData };
@@ -1,7 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { Widget } from '../../../types';
3
- import { TrendDirection } from './TrendIndicator';
4
- import { SparklineDataPoint } from './SparklineChart';
3
+ import { MetricCardData } from './metricCardData';
5
4
  export interface MetricCardWidgetProps {
6
5
  /** Widget configuration */
7
6
  widget: Widget;
@@ -12,23 +11,6 @@ export interface MetricCardWidgetProps {
12
11
  /** Drilldown handler - receives metric data */
13
12
  onDrilldown?: (selectedData: Record<string, unknown>) => void;
14
13
  }
15
- export interface MetricCardData {
16
- /** Primary value to display */
17
- value: number | string;
18
- /** Previous value for comparison */
19
- previousValue?: number;
20
- /** Percentage change from previous */
21
- changePercent?: number;
22
- /** Trend direction override */
23
- trend?: TrendDirection;
24
- /** Sparkline data points */
25
- sparklineData?: SparklineDataPoint[];
26
- /** Target value for comparison */
27
- target?: number;
28
- /** Unit label (e.g., "users", "$") */
29
- unit?: string;
30
- /** Whether the metric is a currency */
31
- isCurrency?: boolean;
32
- }
14
+ export type { MetricCardData } from './metricCardData';
33
15
  export declare const MetricCardWidget: FC<MetricCardWidgetProps>;
34
16
  export default MetricCardWidget;