@burdenoff/microfe-bigconsole 2026.1115.1 → 2026.1115.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/components/widgets/WidgetErrorBoundary.d.ts +5 -0
- package/dist/bigconsole/components/widgets/WidgetErrorBoundary.js +44 -14
- package/dist/bigconsole/components/widgets/chart/ChartWidget.d.ts +4 -1
- package/dist/bigconsole/components/widgets/chart/ChartWidget.js +158 -126
- package/dist/bigconsole/components/widgets/chart/chartRows.d.ts +13 -0
- package/dist/bigconsole/components/widgets/chart/chartRows.js +27 -0
- package/dist/translations/en.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Component, ErrorInfo, ReactNode } from 'react';
|
|
2
|
+
/** Reload the page. A seam so tests can observe it without a browser. */
|
|
3
|
+
export declare const widgetErrorBoundaryReload: {
|
|
4
|
+
reload: () => void;
|
|
5
|
+
};
|
|
2
6
|
export interface WidgetErrorBoundaryProps {
|
|
3
7
|
widgetId: string;
|
|
4
8
|
widgetType?: string;
|
|
@@ -16,6 +20,7 @@ export declare class WidgetErrorBoundary extends Component<WidgetErrorBoundaryPr
|
|
|
16
20
|
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
17
21
|
componentDidUpdate(prevProps: WidgetErrorBoundaryProps): void;
|
|
18
22
|
private handleRetry;
|
|
23
|
+
private handleReload;
|
|
19
24
|
render(): ReactNode;
|
|
20
25
|
}
|
|
21
26
|
export default WidgetErrorBoundary;
|
|
@@ -1,7 +1,33 @@
|
|
|
1
1
|
import { Component as e } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { useOptionalI18n as t } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
3
|
+
import { isChunkLoadError as n } from "@burdenoff/fe-libs/shared/utils";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
3
5
|
// src/bigconsole/components/widgets/WidgetErrorBoundary.tsx
|
|
4
|
-
|
|
6
|
+
function a({ onReload: e }) {
|
|
7
|
+
let n = t(), a = (e, t) => n?.t(e, t) ?? t;
|
|
8
|
+
return /* @__PURE__ */ i("div", {
|
|
9
|
+
className: "flex h-full w-full min-w-0 min-h-[120px] flex-col items-center justify-center px-3 text-center",
|
|
10
|
+
role: "alert",
|
|
11
|
+
"data-widget-error": "stale-code",
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ r("p", {
|
|
14
|
+
className: "mb-1 text-sm font-semibold text-text-primary",
|
|
15
|
+
children: a("bigconsole.widget.error.staleCode.title", "This widget needs a page reload")
|
|
16
|
+
}),
|
|
17
|
+
/* @__PURE__ */ r("p", {
|
|
18
|
+
className: "mb-3 max-w-[32ch] text-xs text-text-secondary",
|
|
19
|
+
children: a("bigconsole.widget.error.staleCode.body", "BigConsole was updated after this page opened, so this widget could not load. Reload the page to fix it.")
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ r("button", {
|
|
22
|
+
type: "button",
|
|
23
|
+
onClick: e,
|
|
24
|
+
className: "inline-flex min-h-control-md items-center gap-1.5 rounded-button bg-action-primary-bg px-3 text-sm font-medium text-action-primary-text hover:bg-action-primary-bgHover motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
25
|
+
children: a("bigconsole.widget.error.staleCode.reload", "Reload page")
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
var o = { reload: () => window.location.reload() }, s = class extends e {
|
|
5
31
|
state = { error: null };
|
|
6
32
|
static getDerivedStateFromError(e) {
|
|
7
33
|
return { error: e };
|
|
@@ -16,24 +42,28 @@ var r = class extends e {
|
|
|
16
42
|
handleRetry = () => {
|
|
17
43
|
this.setState({ error: null });
|
|
18
44
|
};
|
|
45
|
+
handleReload = () => {
|
|
46
|
+
o.reload();
|
|
47
|
+
};
|
|
19
48
|
render() {
|
|
20
49
|
let { error: e } = this.state;
|
|
21
50
|
if (!e) return this.props.children;
|
|
22
|
-
|
|
23
|
-
|
|
51
|
+
if (n(e)) return /* @__PURE__ */ r(a, { onReload: this.handleReload });
|
|
52
|
+
let { widgetType: t, widgetTitle: o } = this.props;
|
|
53
|
+
return /* @__PURE__ */ i("div", {
|
|
24
54
|
className: "flex h-full w-full min-w-0 min-h-[120px] flex-col items-center justify-center px-3 text-center",
|
|
25
55
|
role: "alert",
|
|
26
56
|
"data-widget-error": "true",
|
|
27
57
|
children: [
|
|
28
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ r("div", {
|
|
29
59
|
className: "mb-3 flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-status-error-bg-subtle text-[var(--color-status-error-text)]",
|
|
30
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ r("svg", {
|
|
31
61
|
"aria-hidden": "true",
|
|
32
62
|
className: "w-6 h-6",
|
|
33
63
|
fill: "none",
|
|
34
64
|
stroke: "currentColor",
|
|
35
65
|
viewBox: "0 0 24 24",
|
|
36
|
-
children: /* @__PURE__ */
|
|
66
|
+
children: /* @__PURE__ */ r("path", {
|
|
37
67
|
strokeLinecap: "round",
|
|
38
68
|
strokeLinejoin: "round",
|
|
39
69
|
strokeWidth: 2,
|
|
@@ -41,25 +71,25 @@ var r = class extends e {
|
|
|
41
71
|
})
|
|
42
72
|
})
|
|
43
73
|
}),
|
|
44
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ r("p", {
|
|
45
75
|
className: "mb-1 text-sm font-semibold text-[var(--color-status-error-text)]",
|
|
46
76
|
children: "Widget failed to render"
|
|
47
77
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ i("p", {
|
|
49
79
|
className: "mb-3 max-w-[32ch] text-xs text-text-secondary",
|
|
50
|
-
children: [
|
|
80
|
+
children: [o || t || "This widget", " hit an unexpected error. Check the console for details or retry."]
|
|
51
81
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ i("button", {
|
|
53
83
|
type: "button",
|
|
54
84
|
onClick: this.handleRetry,
|
|
55
85
|
className: "inline-flex min-h-control-md items-center gap-1.5 rounded-button bg-action-primary-bg px-3 text-sm font-medium text-action-primary-text hover:bg-action-primary-bgHover motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
56
|
-
children: [/* @__PURE__ */
|
|
86
|
+
children: [/* @__PURE__ */ r("svg", {
|
|
57
87
|
"aria-hidden": "true",
|
|
58
88
|
className: "w-4 h-4",
|
|
59
89
|
fill: "none",
|
|
60
90
|
stroke: "currentColor",
|
|
61
91
|
viewBox: "0 0 24 24",
|
|
62
|
-
children: /* @__PURE__ */
|
|
92
|
+
children: /* @__PURE__ */ r("path", {
|
|
63
93
|
strokeLinecap: "round",
|
|
64
94
|
strokeLinejoin: "round",
|
|
65
95
|
strokeWidth: 2,
|
|
@@ -71,4 +101,4 @@ var r = class extends e {
|
|
|
71
101
|
});
|
|
72
102
|
}
|
|
73
103
|
};
|
|
74
|
-
export {
|
|
104
|
+
export { s as WidgetErrorBoundary, s as default, o as widgetErrorBoundaryReload };
|
|
@@ -4,7 +4,10 @@ import { ChartData } from './charts/types';
|
|
|
4
4
|
export interface ChartWidgetProps {
|
|
5
5
|
/** Widget configuration */
|
|
6
6
|
widget: Widget;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Chart data: a list of rows. Parser output reaches this prop unchecked, so anything
|
|
9
|
+
* else (a single number, text, one object) is caught and explained (BOFF-9925).
|
|
10
|
+
*/
|
|
8
11
|
data?: ChartData[];
|
|
9
12
|
/** Click handler for drilldown */
|
|
10
13
|
onClick?: (dataPoint: ChartData, index: number) => void;
|
|
@@ -10,96 +10,179 @@ import { WaterfallChart as u } from "./charts/WaterfallChart.js";
|
|
|
10
10
|
import { ScatterChart as d } from "./charts/ScatterChart.js";
|
|
11
11
|
import { ChartLegend as f } from "./ChartLegend.js";
|
|
12
12
|
import "../../../contexts/index.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { WidgetEmptyState as p } from "../states/EmptyState.js";
|
|
14
|
+
import { classifyChartData as m } from "./chartRows.js";
|
|
15
|
+
import { memo as h, useCallback as g, useMemo as _, useState as v } from "react";
|
|
16
|
+
import { useI18n as y } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
17
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
15
18
|
// src/bigconsole/components/widgets/chart/ChartWidget.tsx
|
|
16
|
-
var
|
|
19
|
+
var S = [], C = {
|
|
20
|
+
number: {
|
|
21
|
+
key: "bigconsole.widget.chart.unsupported.number",
|
|
22
|
+
fallback: "This data is a single value."
|
|
23
|
+
},
|
|
24
|
+
text: {
|
|
25
|
+
key: "bigconsole.widget.chart.unsupported.text",
|
|
26
|
+
fallback: "This data is text."
|
|
27
|
+
},
|
|
28
|
+
object: {
|
|
29
|
+
key: "bigconsole.widget.chart.unsupported.object",
|
|
30
|
+
fallback: "This data is one record, not a list of rows."
|
|
31
|
+
},
|
|
32
|
+
values: {
|
|
33
|
+
key: "bigconsole.widget.chart.unsupported.values",
|
|
34
|
+
fallback: "This data is a list of values without field names."
|
|
35
|
+
}
|
|
36
|
+
}, w = [
|
|
17
37
|
"var(--color-chart-1)",
|
|
18
38
|
"var(--color-chart-2)",
|
|
19
39
|
"var(--color-chart-3)",
|
|
20
40
|
"var(--color-chart-4)",
|
|
21
41
|
"var(--color-chart-5)"
|
|
22
|
-
],
|
|
23
|
-
let
|
|
24
|
-
sourceField:
|
|
42
|
+
], T = h(function({ widget: h, data: T = [], onClick: E, onDrilldown: D }) {
|
|
43
|
+
let { t: O } = y(), k = h.config, [A, j] = v([]), M = _(() => m(T), [T]), N = M.kind === "rows" ? M.rows : S, { handleDataClick: P, enabled: F } = t(h.id, k?.crossFilterMappings || [{
|
|
44
|
+
sourceField: k?.labelField || "name",
|
|
25
45
|
targetFilterId: "category"
|
|
26
|
-
}]), { clearAllCrossFilters:
|
|
27
|
-
type:
|
|
28
|
-
xAxisKey:
|
|
29
|
-
xAxisLabel:
|
|
30
|
-
yAxisLabel:
|
|
31
|
-
showGrid:
|
|
32
|
-
showLegend:
|
|
33
|
-
legendPosition:
|
|
34
|
-
showDots:
|
|
35
|
-
curveType:
|
|
36
|
-
colors:
|
|
37
|
-
seriesNames:
|
|
38
|
-
stacked:
|
|
39
|
-
isDonut:
|
|
40
|
-
innerRadius:
|
|
41
|
-
outerRadius:
|
|
42
|
-
referenceLines:
|
|
43
|
-
series:
|
|
44
|
-
selectedFields:
|
|
45
|
-
dualAxis:
|
|
46
|
-
yAxisRightLabel:
|
|
47
|
-
logScale:
|
|
48
|
-
startAtZero:
|
|
49
|
-
yMin:
|
|
50
|
-
yMax:
|
|
51
|
-
valueField:
|
|
52
|
-
labelField:
|
|
53
|
-
showTotal:
|
|
54
|
-
totalLabel:
|
|
55
|
-
xField:
|
|
56
|
-
yField:
|
|
57
|
-
sizeField:
|
|
58
|
-
colorField:
|
|
59
|
-
}), [
|
|
46
|
+
}]), { clearAllCrossFilters: I, hasCrossFilters: L } = e(), R = _(() => ({
|
|
47
|
+
type: k?.chartType?.toLowerCase() || "line",
|
|
48
|
+
xAxisKey: k?.xAxisField || k?.labelField || "name",
|
|
49
|
+
xAxisLabel: k?.xAxisLabel,
|
|
50
|
+
yAxisLabel: k?.yAxisLabel,
|
|
51
|
+
showGrid: k?.showGrid,
|
|
52
|
+
showLegend: k?.showLegend,
|
|
53
|
+
legendPosition: k?.legendPosition,
|
|
54
|
+
showDots: k?.showDataPoints,
|
|
55
|
+
curveType: k?.curveType,
|
|
56
|
+
colors: k?.colors,
|
|
57
|
+
seriesNames: k?.seriesLabels,
|
|
58
|
+
stacked: k?.stacked,
|
|
59
|
+
isDonut: k?.showAsDonut,
|
|
60
|
+
innerRadius: k?.innerRadius,
|
|
61
|
+
outerRadius: k?.outerRadius,
|
|
62
|
+
referenceLines: k?.referenceLines,
|
|
63
|
+
series: k?.series,
|
|
64
|
+
selectedFields: k?.selectedFields,
|
|
65
|
+
dualAxis: k?.dualAxis,
|
|
66
|
+
yAxisRightLabel: k?.yAxisRightLabel,
|
|
67
|
+
logScale: k?.logScale,
|
|
68
|
+
startAtZero: k?.startAtZero,
|
|
69
|
+
yMin: k?.yMin,
|
|
70
|
+
yMax: k?.yMax,
|
|
71
|
+
valueField: k?.valueField,
|
|
72
|
+
labelField: k?.labelField,
|
|
73
|
+
showTotal: k?.showTotal,
|
|
74
|
+
totalLabel: k?.totalLabel,
|
|
75
|
+
xField: k?.xField,
|
|
76
|
+
yField: k?.yField,
|
|
77
|
+
sizeField: k?.sizeField,
|
|
78
|
+
colorField: k?.colorField
|
|
79
|
+
}), [k]), z = R.type === "combo" || R.dualAxis === !0 || R.series?.some((e) => e.axis === "right" || e.type === "bar") && R.series?.some((e) => e.type === "line") || !1, B = _(() => !N.length || R.type === "pie" || R.type === "funnel" || R.type === "scatter" || R.type === "waterfall" ? [] : (z && R.selectedFields !== void 0 ? n(N, R).map((e) => e.field) : r(N, R.xAxisKey, R.selectedFields)).map((e, t) => ({
|
|
60
80
|
dataKey: e,
|
|
61
|
-
name:
|
|
62
|
-
color:
|
|
63
|
-
hidden:
|
|
81
|
+
name: R.seriesNames?.[e] || e,
|
|
82
|
+
color: R.colors?.[t] || w[t % w.length],
|
|
83
|
+
hidden: A.includes(e)
|
|
64
84
|
})), [
|
|
65
|
-
|
|
85
|
+
N,
|
|
86
|
+
R,
|
|
66
87
|
A,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
E(e, t);
|
|
88
|
+
k?.selectedFields,
|
|
89
|
+
z
|
|
90
|
+
]), V = g((e) => {
|
|
91
|
+
j((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
92
|
+
}, []), H = g((e, t) => {
|
|
93
|
+
if (F) {
|
|
94
|
+
let t = e[k?.labelField || "name"];
|
|
95
|
+
P(e, t);
|
|
76
96
|
}
|
|
77
|
-
|
|
97
|
+
D ? D(e) : E && h.drilldowns?.length && E(e, t);
|
|
78
98
|
}, [
|
|
79
|
-
x,
|
|
80
|
-
S,
|
|
81
|
-
p.drilldowns,
|
|
82
|
-
D,
|
|
83
99
|
E,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
100
|
+
D,
|
|
101
|
+
h.drilldowns,
|
|
102
|
+
F,
|
|
103
|
+
P,
|
|
104
|
+
k?.labelField
|
|
105
|
+
]), U = () => {
|
|
106
|
+
if (z) return /* @__PURE__ */ b(l, {
|
|
107
|
+
data: N,
|
|
108
|
+
config: R,
|
|
109
|
+
hiddenSeries: A,
|
|
110
|
+
onDataClick: H
|
|
111
|
+
});
|
|
112
|
+
switch (R.type) {
|
|
113
|
+
case "waterfall": return /* @__PURE__ */ b(u, {
|
|
114
|
+
data: N,
|
|
115
|
+
config: R,
|
|
116
|
+
onDataClick: H
|
|
117
|
+
});
|
|
118
|
+
case "scatter": return /* @__PURE__ */ b(d, {
|
|
119
|
+
data: N,
|
|
120
|
+
config: R,
|
|
121
|
+
onDataClick: H
|
|
122
|
+
});
|
|
123
|
+
case "bar": return /* @__PURE__ */ b(a, {
|
|
124
|
+
data: N,
|
|
125
|
+
config: R,
|
|
126
|
+
hiddenSeries: A,
|
|
127
|
+
onDataClick: H
|
|
128
|
+
});
|
|
129
|
+
case "area": return /* @__PURE__ */ b(o, {
|
|
130
|
+
data: N,
|
|
131
|
+
config: R,
|
|
132
|
+
hiddenSeries: A,
|
|
133
|
+
onDataClick: H
|
|
134
|
+
});
|
|
135
|
+
case "pie": return /* @__PURE__ */ b(s, {
|
|
136
|
+
data: N,
|
|
137
|
+
config: R,
|
|
138
|
+
dataKey: k?.valueField || "value",
|
|
139
|
+
nameKey: k?.labelField || "name",
|
|
140
|
+
onDataClick: H
|
|
141
|
+
});
|
|
142
|
+
case "funnel": return /* @__PURE__ */ b(c, {
|
|
143
|
+
data: N,
|
|
144
|
+
config: R,
|
|
145
|
+
dataKey: k?.valueField || "value",
|
|
146
|
+
nameKey: k?.labelField || "name",
|
|
147
|
+
onDataClick: H
|
|
148
|
+
});
|
|
149
|
+
default: return /* @__PURE__ */ b(i, {
|
|
150
|
+
data: N,
|
|
151
|
+
config: R,
|
|
152
|
+
hiddenSeries: A,
|
|
153
|
+
onDataClick: H
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
if (M.kind === "empty") return /* @__PURE__ */ b(p, {
|
|
158
|
+
widgetType: "chart",
|
|
159
|
+
hasDataSource: !0
|
|
160
|
+
});
|
|
161
|
+
if (M.kind === "unsupported") {
|
|
162
|
+
let e = C[M.shape];
|
|
163
|
+
return /* @__PURE__ */ b(p, {
|
|
164
|
+
widgetType: "chart",
|
|
165
|
+
hasDataSource: !0,
|
|
166
|
+
message: `${O(e.key, e.fallback)} ${O("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.")}`
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
return /* @__PURE__ */ x("div", {
|
|
87
170
|
className: "flex flex-col h-full p-4",
|
|
88
171
|
children: [
|
|
89
|
-
|
|
172
|
+
L && /* @__PURE__ */ b("div", {
|
|
90
173
|
className: "flex items-center gap-2 mb-2 -mt-1",
|
|
91
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ x("button", {
|
|
92
175
|
type: "button",
|
|
93
176
|
onClick: (e) => {
|
|
94
|
-
e.stopPropagation(),
|
|
177
|
+
e.stopPropagation(), I();
|
|
95
178
|
},
|
|
96
179
|
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 ",
|
|
97
|
-
children: [/* @__PURE__ */
|
|
180
|
+
children: [/* @__PURE__ */ b("svg", {
|
|
98
181
|
className: "w-3.5 h-3.5",
|
|
99
182
|
fill: "none",
|
|
100
183
|
stroke: "currentColor",
|
|
101
184
|
viewBox: "0 0 24 24",
|
|
102
|
-
children: /* @__PURE__ */
|
|
185
|
+
children: /* @__PURE__ */ b("path", {
|
|
103
186
|
strokeLinecap: "round",
|
|
104
187
|
strokeLinejoin: "round",
|
|
105
188
|
strokeWidth: 2,
|
|
@@ -108,72 +191,21 @@ var y = [
|
|
|
108
191
|
}), "Clear Filter"]
|
|
109
192
|
})
|
|
110
193
|
}),
|
|
111
|
-
|
|
112
|
-
items:
|
|
194
|
+
R.legendPosition === "top" && B.length > 0 && /* @__PURE__ */ b(f, {
|
|
195
|
+
items: B,
|
|
113
196
|
position: "top",
|
|
114
|
-
onItemClick:
|
|
197
|
+
onItemClick: V
|
|
115
198
|
}),
|
|
116
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ b("div", {
|
|
117
200
|
className: "flex-1 min-h-0",
|
|
118
|
-
children: (
|
|
119
|
-
if (j) return /* @__PURE__ */ _(l, {
|
|
120
|
-
data: b,
|
|
121
|
-
config: A,
|
|
122
|
-
hiddenSeries: w,
|
|
123
|
-
onDataClick: P
|
|
124
|
-
});
|
|
125
|
-
switch (A.type) {
|
|
126
|
-
case "waterfall": return /* @__PURE__ */ _(u, {
|
|
127
|
-
data: b,
|
|
128
|
-
config: A,
|
|
129
|
-
onDataClick: P
|
|
130
|
-
});
|
|
131
|
-
case "scatter": return /* @__PURE__ */ _(d, {
|
|
132
|
-
data: b,
|
|
133
|
-
config: A,
|
|
134
|
-
onDataClick: P
|
|
135
|
-
});
|
|
136
|
-
case "bar": return /* @__PURE__ */ _(a, {
|
|
137
|
-
data: b,
|
|
138
|
-
config: A,
|
|
139
|
-
hiddenSeries: w,
|
|
140
|
-
onDataClick: P
|
|
141
|
-
});
|
|
142
|
-
case "area": return /* @__PURE__ */ _(o, {
|
|
143
|
-
data: b,
|
|
144
|
-
config: A,
|
|
145
|
-
hiddenSeries: w,
|
|
146
|
-
onDataClick: P
|
|
147
|
-
});
|
|
148
|
-
case "pie": return /* @__PURE__ */ _(s, {
|
|
149
|
-
data: b,
|
|
150
|
-
config: A,
|
|
151
|
-
dataKey: C?.valueField || "value",
|
|
152
|
-
nameKey: C?.labelField || "name",
|
|
153
|
-
onDataClick: P
|
|
154
|
-
});
|
|
155
|
-
case "funnel": return /* @__PURE__ */ _(c, {
|
|
156
|
-
data: b,
|
|
157
|
-
config: A,
|
|
158
|
-
dataKey: C?.valueField || "value",
|
|
159
|
-
nameKey: C?.labelField || "name",
|
|
160
|
-
onDataClick: P
|
|
161
|
-
});
|
|
162
|
-
default: return /* @__PURE__ */ _(i, {
|
|
163
|
-
data: b,
|
|
164
|
-
config: A,
|
|
165
|
-
hiddenSeries: w,
|
|
166
|
-
onDataClick: P
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
})()
|
|
201
|
+
children: U()
|
|
170
202
|
}),
|
|
171
|
-
|
|
172
|
-
items:
|
|
203
|
+
R.legendPosition === "bottom" && B.length > 0 && /* @__PURE__ */ b(f, {
|
|
204
|
+
items: B,
|
|
173
205
|
position: "bottom",
|
|
174
|
-
onItemClick:
|
|
206
|
+
onItemClick: V
|
|
175
207
|
})
|
|
176
208
|
]
|
|
177
209
|
});
|
|
178
210
|
});
|
|
179
|
-
export {
|
|
211
|
+
export { T as ChartWidget, T as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChartData } from './charts/types';
|
|
2
|
+
/** Why the data cannot be drawn. Drives the message, not the logic. */
|
|
3
|
+
export type UnsupportedChartShape = 'number' | 'text' | 'object' | 'values';
|
|
4
|
+
export type ChartRowsResult = {
|
|
5
|
+
readonly kind: 'rows';
|
|
6
|
+
readonly rows: ChartData[];
|
|
7
|
+
} | {
|
|
8
|
+
readonly kind: 'empty';
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: 'unsupported';
|
|
11
|
+
readonly shape: UnsupportedChartShape;
|
|
12
|
+
};
|
|
13
|
+
export declare function classifyChartData(data: unknown): ChartRowsResult;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// src/bigconsole/components/widgets/chart/chartRows.ts
|
|
2
|
+
var e = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
3
|
+
function t(t) {
|
|
4
|
+
if (t == null) return { kind: "empty" };
|
|
5
|
+
if (Array.isArray(t)) {
|
|
6
|
+
if (t.length === 0) return { kind: "empty" };
|
|
7
|
+
let n = t.filter(e);
|
|
8
|
+
return n.length === 0 ? {
|
|
9
|
+
kind: "unsupported",
|
|
10
|
+
shape: "values"
|
|
11
|
+
} : {
|
|
12
|
+
kind: "rows",
|
|
13
|
+
rows: n
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return typeof t == "number" || typeof t == "bigint" || typeof t == "boolean" ? {
|
|
17
|
+
kind: "unsupported",
|
|
18
|
+
shape: "number"
|
|
19
|
+
} : typeof t == "string" ? {
|
|
20
|
+
kind: "unsupported",
|
|
21
|
+
shape: "text"
|
|
22
|
+
} : {
|
|
23
|
+
kind: "unsupported",
|
|
24
|
+
shape: "object"
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export { t as classifyChartData };
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* workflows/settings list+view pages, plus the pre-wired home/admin/dashboards
|
|
23
23
|
* lists. Builders and deep components are tracked as follow-up on BOFF-6004.
|
|
24
24
|
*
|
|
25
|
-
* Generated + hand-maintained.
|
|
25
|
+
* Generated + hand-maintained. 2064 keys.
|
|
26
26
|
*/
|
|
27
27
|
export declare const enTranslations: Record<string, string>;
|
|
28
28
|
export default enTranslations;
|