@burdenoff/microfe-bigconsole 2026.1115.1 → 2026.1115.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.
- package/dist/bigconsole/components/builder/inspector/AppearanceSection.js +11 -5
- 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/ChartConfig.d.ts +5 -0
- package/dist/bigconsole/components/widgets/chart/ChartConfig.js +110 -104
- package/dist/bigconsole/components/widgets/chart/ChartWidget.d.ts +4 -1
- package/dist/bigconsole/components/widgets/chart/ChartWidget.js +170 -131
- package/dist/bigconsole/components/widgets/chart/chartRows.d.ts +13 -0
- package/dist/bigconsole/components/widgets/chart/chartRows.js +27 -0
- package/dist/bigconsole/components/widgets/chart/charts/funnelData.d.ts +16 -0
- package/dist/bigconsole/components/widgets/chart/charts/funnelData.js +12 -1
- package/dist/bigconsole/components/widgets/heatmap/HeatmapWidget.js +55 -54
- package/dist/bigconsole/components/widgets/heatmap/heatmapData.d.ts +10 -0
- package/dist/bigconsole/components/widgets/heatmap/heatmapData.js +95 -0
- package/dist/translations/en.d.ts +1 -1
- package/package.json +1 -1
|
@@ -17,11 +17,17 @@ function p(e) {
|
|
|
17
17
|
return e;
|
|
18
18
|
}
|
|
19
19
|
function m(e) {
|
|
20
|
+
return /* @__PURE__ */ f(r, {
|
|
21
|
+
...e,
|
|
22
|
+
fixedChartType: "funnel"
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function h(e) {
|
|
20
26
|
switch (e) {
|
|
21
27
|
case "metric_card": return p(t);
|
|
22
28
|
case "kpi_card_comparison": return p(n);
|
|
23
|
-
case "chart":
|
|
24
|
-
case "funnel_chart": return p(
|
|
29
|
+
case "chart": return p(r);
|
|
30
|
+
case "funnel_chart": return p(m);
|
|
25
31
|
case "table":
|
|
26
32
|
case "pivot_table": return p(i);
|
|
27
33
|
case "gauge": return p(a);
|
|
@@ -31,8 +37,8 @@ function m(e) {
|
|
|
31
37
|
default: return null;
|
|
32
38
|
}
|
|
33
39
|
}
|
|
34
|
-
var
|
|
35
|
-
let { t: i } = d(), a =
|
|
40
|
+
var g = u(function({ widgetType: t, config: n, onChange: r }) {
|
|
41
|
+
let { t: i } = d(), a = h(t);
|
|
36
42
|
return [
|
|
37
43
|
"map",
|
|
38
44
|
"waterfall",
|
|
@@ -67,4 +73,4 @@ var h = u(function({ widgetType: t, config: n, onChange: r }) {
|
|
|
67
73
|
})
|
|
68
74
|
});
|
|
69
75
|
});
|
|
70
|
-
export {
|
|
76
|
+
export { g as AppearanceSection };
|
|
@@ -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 };
|
|
@@ -5,6 +5,11 @@ export interface ChartConfigProps {
|
|
|
5
5
|
config: ConfigType;
|
|
6
6
|
/** Callback when config changes */
|
|
7
7
|
onChange: (config: ConfigType) => void;
|
|
8
|
+
/**
|
|
9
|
+
* A widget type that IS one chart type (the Funnel Chart widget) passes it here: the
|
|
10
|
+
* Chart Type picker is not offered and the settings follow that type (BOFF-10138).
|
|
11
|
+
*/
|
|
12
|
+
fixedChartType?: ConfigType['chartType'];
|
|
8
13
|
}
|
|
9
14
|
export declare const ChartConfig: FC<ChartConfigProps>;
|
|
10
15
|
export default ChartConfig;
|
|
@@ -4,225 +4,231 @@ import { memo as r, useCallback as i, useMemo as a } from "react";
|
|
|
4
4
|
import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
5
5
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
6
|
// src/bigconsole/components/widgets/chart/ChartConfig.tsx
|
|
7
|
-
var u = r(function({ config: r, onChange: u }) {
|
|
8
|
-
let { t:
|
|
7
|
+
var u = r(function({ config: r, onChange: u, fixedChartType: d }) {
|
|
8
|
+
let { t: f } = o(), p = a(() => d ? {
|
|
9
|
+
...r,
|
|
10
|
+
chartType: d
|
|
11
|
+
} : r, [r, d]), m = a(() => [
|
|
9
12
|
{
|
|
10
13
|
value: "line",
|
|
11
|
-
label:
|
|
14
|
+
label: f("bigconsole.widget.config.chart.type.line", "Line Chart")
|
|
12
15
|
},
|
|
13
16
|
{
|
|
14
17
|
value: "bar",
|
|
15
|
-
label:
|
|
18
|
+
label: f("bigconsole.widget.config.chart.type.bar", "Bar Chart")
|
|
16
19
|
},
|
|
17
20
|
{
|
|
18
21
|
value: "area",
|
|
19
|
-
label:
|
|
22
|
+
label: f("bigconsole.widget.config.chart.type.area", "Area Chart")
|
|
20
23
|
},
|
|
21
24
|
{
|
|
22
25
|
value: "pie",
|
|
23
|
-
label:
|
|
26
|
+
label: f("bigconsole.widget.config.chart.type.pie", "Pie Chart")
|
|
24
27
|
},
|
|
25
28
|
{
|
|
26
29
|
value: "funnel",
|
|
27
|
-
label:
|
|
30
|
+
label: f("bigconsole.widget.config.chart.type.funnel", "Funnel Chart")
|
|
28
31
|
}
|
|
29
|
-
], [
|
|
32
|
+
], [f]), h = a(() => [
|
|
30
33
|
{
|
|
31
34
|
value: "monotone",
|
|
32
|
-
label:
|
|
35
|
+
label: f("bigconsole.widget.config.chart.curve.smooth", "Smooth")
|
|
33
36
|
},
|
|
34
37
|
{
|
|
35
38
|
value: "linear",
|
|
36
|
-
label:
|
|
39
|
+
label: f("bigconsole.widget.config.chart.curve.linear", "Linear")
|
|
37
40
|
},
|
|
38
41
|
{
|
|
39
42
|
value: "step",
|
|
40
|
-
label:
|
|
43
|
+
label: f("bigconsole.widget.config.chart.curve.step", "Step")
|
|
41
44
|
},
|
|
42
45
|
{
|
|
43
46
|
value: "natural",
|
|
44
|
-
label:
|
|
47
|
+
label: f("bigconsole.widget.config.chart.curve.natural", "Natural")
|
|
45
48
|
}
|
|
46
|
-
], [
|
|
49
|
+
], [f]), g = a(() => [
|
|
47
50
|
{
|
|
48
51
|
value: "top",
|
|
49
|
-
label:
|
|
52
|
+
label: f("bigconsole.widget.config.chart.legendPosition.top", "Top")
|
|
50
53
|
},
|
|
51
54
|
{
|
|
52
55
|
value: "bottom",
|
|
53
|
-
label:
|
|
56
|
+
label: f("bigconsole.widget.config.chart.legendPosition.bottom", "Bottom")
|
|
54
57
|
},
|
|
55
58
|
{
|
|
56
59
|
value: "left",
|
|
57
|
-
label:
|
|
60
|
+
label: f("bigconsole.widget.config.chart.legendPosition.left", "Left")
|
|
58
61
|
},
|
|
59
62
|
{
|
|
60
63
|
value: "right",
|
|
61
|
-
label:
|
|
64
|
+
label: f("bigconsole.widget.config.chart.legendPosition.right", "Right")
|
|
62
65
|
}
|
|
63
|
-
], [
|
|
66
|
+
], [f]), _ = i((e, t) => {
|
|
64
67
|
u({
|
|
65
|
-
...
|
|
68
|
+
...p,
|
|
66
69
|
[e]: t
|
|
67
70
|
});
|
|
68
|
-
}, [
|
|
71
|
+
}, [p, u]), v = p.chartType === "pie" || p.chartType === "funnel", y = a(() => t(p.referenceLines), [p.referenceLines]);
|
|
69
72
|
return /* @__PURE__ */ l("div", {
|
|
70
73
|
className: "min-w-0 space-y-form-gap",
|
|
71
74
|
children: [
|
|
72
|
-
/* @__PURE__ */ l("div", {
|
|
73
|
-
|
|
74
|
-
children:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
children: e
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
/* @__PURE__ */ l("div", {
|
|
76
|
+
hidden: d !== void 0,
|
|
77
|
+
children: [/* @__PURE__ */ c("label", {
|
|
78
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
79
|
+
children: f("bigconsole.widget.config.chart.chartTypeLabel", "Chart Type")
|
|
80
|
+
}), /* @__PURE__ */ c("select", {
|
|
81
|
+
value: p.chartType || "line",
|
|
82
|
+
onChange: (e) => _("chartType", e.target.value),
|
|
83
|
+
className: "\n w-full px-3 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n ",
|
|
84
|
+
children: m.map((e) => /* @__PURE__ */ c("option", {
|
|
85
|
+
value: e.value,
|
|
86
|
+
children: e.label
|
|
87
|
+
}, e.value))
|
|
88
|
+
})]
|
|
89
|
+
}),
|
|
90
|
+
!v && /* @__PURE__ */ l(s, { children: [
|
|
85
91
|
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
86
92
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
87
|
-
children:
|
|
93
|
+
children: f("bigconsole.widget.config.chart.xAxisFieldLabel", "X-Axis Field")
|
|
88
94
|
}), /* @__PURE__ */ c("input", {
|
|
89
95
|
type: "text",
|
|
90
|
-
value:
|
|
91
|
-
onChange: (e) =>
|
|
92
|
-
placeholder:
|
|
96
|
+
value: p.xAxisField || "",
|
|
97
|
+
onChange: (e) => _("xAxisField", e.target.value),
|
|
98
|
+
placeholder: f("bigconsole.widget.config.chart.xAxisFieldPlaceholder", "e.g., date, category"),
|
|
93
99
|
className: "\n w-full px-3 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n "
|
|
94
100
|
})] }),
|
|
95
101
|
/* @__PURE__ */ l("div", {
|
|
96
102
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
97
103
|
children: [/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
98
104
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
99
|
-
children:
|
|
105
|
+
children: f("bigconsole.widget.config.chart.xAxisLabelLabel", "X-Axis Label")
|
|
100
106
|
}), /* @__PURE__ */ c("input", {
|
|
101
107
|
type: "text",
|
|
102
|
-
value:
|
|
103
|
-
onChange: (e) =>
|
|
104
|
-
placeholder:
|
|
108
|
+
value: p.xAxisLabel || "",
|
|
109
|
+
onChange: (e) => _("xAxisLabel", e.target.value),
|
|
110
|
+
placeholder: f("bigconsole.widget.config.chart.optionalPlaceholder", "Optional"),
|
|
105
111
|
className: "\n w-full px-3 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n "
|
|
106
112
|
})] }), /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
107
113
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
108
|
-
children:
|
|
114
|
+
children: f("bigconsole.widget.config.chart.yAxisLabelLabel", "Y-Axis Label")
|
|
109
115
|
}), /* @__PURE__ */ c("input", {
|
|
110
116
|
type: "text",
|
|
111
|
-
value:
|
|
112
|
-
onChange: (e) =>
|
|
113
|
-
placeholder:
|
|
117
|
+
value: p.yAxisLabel || "",
|
|
118
|
+
onChange: (e) => _("yAxisLabel", e.target.value),
|
|
119
|
+
placeholder: f("bigconsole.widget.config.chart.optionalPlaceholder", "Optional"),
|
|
114
120
|
className: "\n w-full px-3 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n "
|
|
115
121
|
})] })]
|
|
116
122
|
}),
|
|
117
|
-
!
|
|
123
|
+
!v && /* @__PURE__ */ l("div", {
|
|
118
124
|
className: "grid grid-cols-2 gap-3",
|
|
119
125
|
children: [/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
120
126
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
121
|
-
children:
|
|
127
|
+
children: f("bigconsole.widget.config.chart.yMinLabel", "Y-Axis Min")
|
|
122
128
|
}), /* @__PURE__ */ c("input", {
|
|
123
129
|
type: "number",
|
|
124
|
-
value:
|
|
125
|
-
onChange: (e) =>
|
|
126
|
-
placeholder:
|
|
130
|
+
value: p.yMin ?? "",
|
|
131
|
+
onChange: (e) => _("yMin", e.target.value === "" ? void 0 : Number(e.target.value)),
|
|
132
|
+
placeholder: f("bigconsole.widget.config.chart.autoPlaceholder", "Auto"),
|
|
127
133
|
className: "\n w-full px-3 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n "
|
|
128
134
|
})] }), /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
129
135
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
130
|
-
children:
|
|
136
|
+
children: f("bigconsole.widget.config.chart.yMaxLabel", "Y-Axis Max")
|
|
131
137
|
}), /* @__PURE__ */ c("input", {
|
|
132
138
|
type: "number",
|
|
133
|
-
value:
|
|
134
|
-
onChange: (e) =>
|
|
135
|
-
placeholder:
|
|
139
|
+
value: p.yMax ?? "",
|
|
140
|
+
onChange: (e) => _("yMax", e.target.value === "" ? void 0 : Number(e.target.value)),
|
|
141
|
+
placeholder: f("bigconsole.widget.config.chart.autoPlaceholder", "Auto"),
|
|
136
142
|
className: "\n w-full px-3 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n "
|
|
137
143
|
})] })]
|
|
138
144
|
}),
|
|
139
|
-
(
|
|
145
|
+
(p.chartType === "line" || p.chartType === "area") && /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
140
146
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
141
|
-
children:
|
|
147
|
+
children: f("bigconsole.widget.config.chart.curveTypeLabel", "Curve Type")
|
|
142
148
|
}), /* @__PURE__ */ c("select", {
|
|
143
|
-
value:
|
|
144
|
-
onChange: (e) =>
|
|
149
|
+
value: p.curveType || "monotone",
|
|
150
|
+
onChange: (e) => _("curveType", e.target.value),
|
|
145
151
|
className: "\n w-full px-3 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n ",
|
|
146
|
-
children:
|
|
152
|
+
children: h.map((e) => /* @__PURE__ */ c("option", {
|
|
147
153
|
value: e.value,
|
|
148
154
|
children: e.label
|
|
149
155
|
}, e.value))
|
|
150
156
|
})] })
|
|
151
157
|
] }),
|
|
152
|
-
|
|
158
|
+
v && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l("div", {
|
|
153
159
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
154
160
|
children: [/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
155
161
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
156
|
-
children:
|
|
162
|
+
children: f("bigconsole.widget.config.chart.valueFieldLabel", "Value Field")
|
|
157
163
|
}), /* @__PURE__ */ c("input", {
|
|
158
164
|
type: "text",
|
|
159
|
-
value:
|
|
160
|
-
onChange: (e) =>
|
|
161
|
-
placeholder:
|
|
165
|
+
value: p.valueField || "",
|
|
166
|
+
onChange: (e) => _("valueField", e.target.value),
|
|
167
|
+
placeholder: f("bigconsole.widget.config.chart.valueFieldPlaceholder", "e.g., value"),
|
|
162
168
|
className: "\n w-full px-3 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n "
|
|
163
169
|
})] }), /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
164
170
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
165
|
-
children:
|
|
171
|
+
children: f("bigconsole.widget.config.chart.labelFieldLabel", "Label Field")
|
|
166
172
|
}), /* @__PURE__ */ c("input", {
|
|
167
173
|
type: "text",
|
|
168
|
-
value:
|
|
169
|
-
onChange: (e) =>
|
|
170
|
-
placeholder:
|
|
174
|
+
value: p.labelField || "",
|
|
175
|
+
onChange: (e) => _("labelField", e.target.value),
|
|
176
|
+
placeholder: f("bigconsole.widget.config.chart.labelFieldPlaceholder", "e.g., name"),
|
|
171
177
|
className: "\n w-full px-3 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n "
|
|
172
178
|
})] })]
|
|
173
|
-
}),
|
|
179
|
+
}), p.chartType === "pie" && /* @__PURE__ */ l("label", {
|
|
174
180
|
className: "flex items-center gap-3",
|
|
175
181
|
children: [/* @__PURE__ */ c("input", {
|
|
176
182
|
type: "checkbox",
|
|
177
|
-
checked:
|
|
178
|
-
onChange: (e) =>
|
|
183
|
+
checked: p.showAsDonut === !0,
|
|
184
|
+
onChange: (e) => _("showAsDonut", e.target.checked),
|
|
179
185
|
className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
|
|
180
186
|
}), /* @__PURE__ */ c("span", {
|
|
181
187
|
className: "text-sm text-text-primary",
|
|
182
|
-
children:
|
|
188
|
+
children: f("bigconsole.widget.config.chart.showAsDonut", "Show as Donut")
|
|
183
189
|
})]
|
|
184
190
|
})] }),
|
|
185
191
|
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
186
192
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
187
|
-
children:
|
|
193
|
+
children: f("bigconsole.widget.config.chart.legendPositionLabel", "Legend Position")
|
|
188
194
|
}), /* @__PURE__ */ c("select", {
|
|
189
|
-
value:
|
|
190
|
-
onChange: (e) =>
|
|
195
|
+
value: p.legendPosition || "bottom",
|
|
196
|
+
onChange: (e) => _("legendPosition", e.target.value),
|
|
191
197
|
className: "\n w-full px-3 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n ",
|
|
192
|
-
children:
|
|
198
|
+
children: g.map((e) => /* @__PURE__ */ c("option", {
|
|
193
199
|
value: e.value,
|
|
194
200
|
children: e.label
|
|
195
201
|
}, e.value))
|
|
196
202
|
})] }),
|
|
197
|
-
!
|
|
203
|
+
!v && /* @__PURE__ */ l("div", { children: [
|
|
198
204
|
/* @__PURE__ */ c("label", {
|
|
199
205
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
200
|
-
children:
|
|
206
|
+
children: f("bigconsole.widget.config.chart.fieldsToDisplayLabel", "Fields to Display")
|
|
201
207
|
}),
|
|
202
208
|
/* @__PURE__ */ c("p", {
|
|
203
209
|
className: "text-xs text-text-secondary mb-2",
|
|
204
|
-
children:
|
|
210
|
+
children: f("bigconsole.widget.config.chart.fieldsToDisplayHelp", "Select which numeric fields to show as chart series. Leave empty to show all.")
|
|
205
211
|
}),
|
|
206
212
|
/* @__PURE__ */ c("input", {
|
|
207
213
|
type: "text",
|
|
208
|
-
value:
|
|
214
|
+
value: p.selectedFields?.join(", ") || "",
|
|
209
215
|
onChange: (e) => {
|
|
210
216
|
let t = e.target.value.trim(), n = t ? t.split(",").map((e) => e.trim()).filter(Boolean) : [];
|
|
211
|
-
|
|
217
|
+
_("selectedFields", n.length > 0 ? n : void 0);
|
|
212
218
|
},
|
|
213
|
-
placeholder:
|
|
219
|
+
placeholder: f("bigconsole.widget.config.chart.fieldsToDisplayPlaceholder", "e.g., revenue, orders, users (comma-separated)"),
|
|
214
220
|
className: "\n w-full px-3 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n "
|
|
215
221
|
}),
|
|
216
222
|
/* @__PURE__ */ c("p", {
|
|
217
223
|
className: "text-xs text-text-muted mt-1",
|
|
218
|
-
children:
|
|
224
|
+
children: f("bigconsole.widget.config.chart.fieldsToDisplayHint", "Enter field names separated by commas")
|
|
219
225
|
})
|
|
220
226
|
] }),
|
|
221
|
-
!
|
|
227
|
+
!v && /* @__PURE__ */ c("div", {
|
|
222
228
|
className: "border-t border-[var(--color-border-subtle)] pt-form-gap",
|
|
223
229
|
children: /* @__PURE__ */ c(e, {
|
|
224
|
-
lines:
|
|
225
|
-
onChange: (e) =>
|
|
230
|
+
lines: y,
|
|
231
|
+
onChange: (e) => _("referenceLines", n(e))
|
|
226
232
|
})
|
|
227
233
|
}),
|
|
228
234
|
/* @__PURE__ */ l("div", {
|
|
@@ -238,61 +244,61 @@ var u = r(function({ config: r, onChange: u }) {
|
|
|
238
244
|
className: "flex items-center gap-3",
|
|
239
245
|
children: [/* @__PURE__ */ c("input", {
|
|
240
246
|
type: "checkbox",
|
|
241
|
-
checked:
|
|
242
|
-
onChange: (e) =>
|
|
247
|
+
checked: p.showGrid !== !1,
|
|
248
|
+
onChange: (e) => _("showGrid", e.target.checked),
|
|
243
249
|
className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
|
|
244
250
|
}), /* @__PURE__ */ c("span", {
|
|
245
251
|
className: "text-sm text-text-primary",
|
|
246
|
-
children:
|
|
252
|
+
children: f("bigconsole.widget.config.chart.showGrid", "Show Grid")
|
|
247
253
|
})]
|
|
248
254
|
}),
|
|
249
255
|
/* @__PURE__ */ l("label", {
|
|
250
256
|
className: "flex items-center gap-3",
|
|
251
257
|
children: [/* @__PURE__ */ c("input", {
|
|
252
258
|
type: "checkbox",
|
|
253
|
-
checked:
|
|
254
|
-
onChange: (e) =>
|
|
259
|
+
checked: p.showLegend !== !1,
|
|
260
|
+
onChange: (e) => _("showLegend", e.target.checked),
|
|
255
261
|
className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
|
|
256
262
|
}), /* @__PURE__ */ c("span", {
|
|
257
263
|
className: "text-sm text-text-primary",
|
|
258
|
-
children:
|
|
264
|
+
children: f("bigconsole.widget.config.chart.showLegend", "Show Legend")
|
|
259
265
|
})]
|
|
260
266
|
}),
|
|
261
|
-
!
|
|
267
|
+
!v && /* @__PURE__ */ l(s, { children: [
|
|
262
268
|
/* @__PURE__ */ l("label", {
|
|
263
269
|
className: "flex items-center gap-3",
|
|
264
270
|
children: [/* @__PURE__ */ c("input", {
|
|
265
271
|
type: "checkbox",
|
|
266
|
-
checked:
|
|
267
|
-
onChange: (e) =>
|
|
272
|
+
checked: p.showDataPoints === !0,
|
|
273
|
+
onChange: (e) => _("showDataPoints", e.target.checked),
|
|
268
274
|
className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
|
|
269
275
|
}), /* @__PURE__ */ c("span", {
|
|
270
276
|
className: "text-sm text-text-primary",
|
|
271
|
-
children:
|
|
277
|
+
children: f("bigconsole.widget.config.chart.showDataPoints", "Show Data Points")
|
|
272
278
|
})]
|
|
273
279
|
}),
|
|
274
|
-
(
|
|
280
|
+
(p.chartType === "line" || p.chartType === "area" || p.chartType === "bar") && /* @__PURE__ */ l("label", {
|
|
275
281
|
className: "flex items-center gap-3",
|
|
276
282
|
children: [/* @__PURE__ */ c("input", {
|
|
277
283
|
type: "checkbox",
|
|
278
|
-
checked:
|
|
279
|
-
onChange: (e) =>
|
|
284
|
+
checked: p.startAtZero === !0,
|
|
285
|
+
onChange: (e) => _("startAtZero", e.target.checked),
|
|
280
286
|
className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
|
|
281
287
|
}), /* @__PURE__ */ c("span", {
|
|
282
288
|
className: "text-sm text-text-primary",
|
|
283
|
-
children:
|
|
289
|
+
children: f("bigconsole.widget.config.chart.startAtZero", "Y-axis: start at zero")
|
|
284
290
|
})]
|
|
285
291
|
}),
|
|
286
|
-
(
|
|
292
|
+
(p.chartType === "bar" || p.chartType === "area") && /* @__PURE__ */ l("label", {
|
|
287
293
|
className: "flex items-center gap-3",
|
|
288
294
|
children: [/* @__PURE__ */ c("input", {
|
|
289
295
|
type: "checkbox",
|
|
290
|
-
checked:
|
|
291
|
-
onChange: (e) =>
|
|
296
|
+
checked: p.stacked === !0,
|
|
297
|
+
onChange: (e) => _("stacked", e.target.checked),
|
|
292
298
|
className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
|
|
293
299
|
}), /* @__PURE__ */ c("span", {
|
|
294
300
|
className: "text-sm text-text-primary",
|
|
295
|
-
children:
|
|
301
|
+
children: f("bigconsole.widget.config.chart.stacked", "Stacked")
|
|
296
302
|
})]
|
|
297
303
|
})
|
|
298
304
|
] })
|
|
@@ -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;
|