@burdenoff/microfe-bigconsole 2026.1103.3 → 2026.1103.5
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/DrilldownModal.js +56 -45
- package/dist/bigconsole/components/widgets/chart/charts/FunnelChart.d.ts +1 -1
- package/dist/bigconsole/components/widgets/chart/charts/FunnelChart.js +69 -54
- package/dist/bigconsole/components/widgets/chart/charts/funnelData.d.ts +8 -0
- package/dist/bigconsole/components/widgets/chart/charts/funnelData.js +17 -0
- package/dist/bigconsole/utils/drilldownParams.d.ts +6 -0
- package/dist/bigconsole/utils/drilldownParams.js +19 -1
- package/dist/generated/wspace-operations.js +256 -130
- package/package.json +1 -1
|
@@ -1,55 +1,67 @@
|
|
|
1
1
|
import e from "../store/drilldownStore.js";
|
|
2
|
-
import {
|
|
2
|
+
import { GlobalFilterFieldsFragmentDoc as t } from "../../generated/wspace-operations.js";
|
|
3
|
+
import { SECTION_FOCUS_RING as n } from "./common/sectionStyles.js";
|
|
3
4
|
import "./common/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import { memo as
|
|
6
|
-
import { ResponsiveDialog as
|
|
7
|
-
import {
|
|
5
|
+
import { getDrilldownParamSummary as r } from "../utils/drilldownParams.js";
|
|
6
|
+
import { memo as i, useCallback as a, useContext as o, useRef as s } from "react";
|
|
7
|
+
import { ResponsiveDialog as c, ResponsiveDialogContent as l, ResponsiveDialogDescription as u, ResponsiveDialogTitle as d } from "@burdenoff/fe-libs/ui";
|
|
8
|
+
import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
|
+
import { getApolloContext as p } from "@apollo/client/react";
|
|
10
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
8
11
|
//#region src/bigconsole/components/DrilldownModal.tsx
|
|
9
|
-
var
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
}, [
|
|
13
|
-
|
|
14
|
-
}, [
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
var g = i(function({ renderDashboard: i, onClose: g }) {
|
|
13
|
+
let { t: v } = f(), { client: y } = o(p()), b = s(null), x = e((e) => e.isOpen), S = e((e) => e.dashboardId), C = e((e) => e.params), w = e((e) => e.history), T = e((e) => e.closeModal), E = e((e) => e.popDrilldown), D = a(() => {
|
|
14
|
+
T(), g?.();
|
|
15
|
+
}, [T, g]), O = a(() => {
|
|
16
|
+
E();
|
|
17
|
+
}, [E]);
|
|
18
|
+
if (!x || !S) return null;
|
|
19
|
+
let k = r(C, (e) => y?.cache.readFragment({
|
|
20
|
+
id: y.cache.identify({
|
|
21
|
+
__typename: "BigConsoleGlobalFilter",
|
|
22
|
+
id: e
|
|
23
|
+
}),
|
|
24
|
+
fragment: t,
|
|
25
|
+
returnPartialData: !0
|
|
26
|
+
}));
|
|
27
|
+
return /* @__PURE__ */ m(c, {
|
|
28
|
+
open: x,
|
|
17
29
|
onOpenChange: (e) => {
|
|
18
|
-
e ||
|
|
30
|
+
e || D();
|
|
19
31
|
},
|
|
20
|
-
children: /* @__PURE__ */
|
|
32
|
+
children: /* @__PURE__ */ h(l, {
|
|
21
33
|
showCloseButton: !1,
|
|
22
34
|
onOpenAutoFocus: () => {
|
|
23
35
|
let e = document.activeElement;
|
|
24
|
-
e instanceof HTMLElement && e !== document.body && !e.closest("[role=\"dialog\"]") && (
|
|
36
|
+
e instanceof HTMLElement && e !== document.body && !e.closest("[role=\"dialog\"]") && (b.current = e);
|
|
25
37
|
},
|
|
26
38
|
onCloseAutoFocus: (e) => {
|
|
27
|
-
e.preventDefault(),
|
|
39
|
+
e.preventDefault(), b.current?.isConnected && b.current.focus();
|
|
28
40
|
},
|
|
29
41
|
className: "flex w-full md:w-[calc(100%-2rem)] max-w-5xl flex-col gap-0 overflow-hidden rounded-card bg-bg-surface p-0 sm:max-w-5xl",
|
|
30
42
|
style: { maxHeight: "calc(100dvh - 2rem)" },
|
|
31
43
|
children: [
|
|
32
|
-
/* @__PURE__ */ u
|
|
44
|
+
/* @__PURE__ */ m(u, {
|
|
33
45
|
className: "sr-only",
|
|
34
46
|
children: "Explore the linked dashboard and return to the previous drilldown level."
|
|
35
47
|
}),
|
|
36
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ h("div", {
|
|
37
49
|
className: "flex flex-shrink-0 flex-wrap items-center justify-between gap-control-gap border-b border-[var(--color-border-subtle)] px-4 py-3",
|
|
38
|
-
children: [/* @__PURE__ */
|
|
50
|
+
children: [/* @__PURE__ */ h("div", {
|
|
39
51
|
className: "flex min-w-0 items-center gap-3",
|
|
40
52
|
children: [
|
|
41
|
-
|
|
53
|
+
w.length > 0 && /* @__PURE__ */ m("button", {
|
|
42
54
|
type: "button",
|
|
43
|
-
onClick:
|
|
55
|
+
onClick: O,
|
|
44
56
|
className: "flex h-control-md w-[var(--size-controlHeight-md)] shrink-0 items-center justify-center rounded-button motion-safe:transition-colors hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
45
57
|
title: "Go back",
|
|
46
58
|
"aria-label": "Go back",
|
|
47
|
-
children: /* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ m("svg", {
|
|
48
60
|
className: "w-5 h-5 text-text-secondary",
|
|
49
61
|
fill: "none",
|
|
50
62
|
stroke: "currentColor",
|
|
51
63
|
viewBox: "0 0 24 24",
|
|
52
|
-
children: /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ m("path", {
|
|
53
65
|
strokeLinecap: "round",
|
|
54
66
|
strokeLinejoin: "round",
|
|
55
67
|
strokeWidth: 2,
|
|
@@ -57,33 +69,33 @@ var f = r(function({ renderDashboard: r, onClose: f }) {
|
|
|
57
69
|
})
|
|
58
70
|
})
|
|
59
71
|
}),
|
|
60
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ m(d, {
|
|
61
73
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
62
74
|
children: "Drilldown View"
|
|
63
75
|
}),
|
|
64
|
-
|
|
76
|
+
w.length > 0 && /* @__PURE__ */ h("span", {
|
|
65
77
|
className: "text-xs text-text-muted",
|
|
66
78
|
children: [
|
|
67
79
|
"(",
|
|
68
|
-
|
|
80
|
+
w.length + 1,
|
|
69
81
|
" level",
|
|
70
|
-
|
|
82
|
+
w.length > 0 ? "s" : "",
|
|
71
83
|
" deep)"
|
|
72
84
|
]
|
|
73
85
|
})
|
|
74
86
|
]
|
|
75
|
-
}), /* @__PURE__ */
|
|
87
|
+
}), /* @__PURE__ */ m("button", {
|
|
76
88
|
type: "button",
|
|
77
|
-
onClick:
|
|
78
|
-
className: `flex h-control-md w-[var(--size-controlHeight-md)] shrink-0 items-center justify-center rounded-button motion-safe:transition-colors hover:bg-bg-sunken ${
|
|
89
|
+
onClick: D,
|
|
90
|
+
className: `flex h-control-md w-[var(--size-controlHeight-md)] shrink-0 items-center justify-center rounded-button motion-safe:transition-colors hover:bg-bg-sunken ${n}`,
|
|
79
91
|
title: "Close (Esc)",
|
|
80
92
|
"aria-label": "Close drilldown",
|
|
81
|
-
children: /* @__PURE__ */
|
|
93
|
+
children: /* @__PURE__ */ m("svg", {
|
|
82
94
|
className: "w-5 h-5 text-text-secondary",
|
|
83
95
|
fill: "none",
|
|
84
96
|
stroke: "currentColor",
|
|
85
97
|
viewBox: "0 0 24 24",
|
|
86
|
-
children: /* @__PURE__ */
|
|
98
|
+
children: /* @__PURE__ */ m("path", {
|
|
87
99
|
strokeLinecap: "round",
|
|
88
100
|
strokeLinejoin: "round",
|
|
89
101
|
strokeWidth: 2,
|
|
@@ -92,30 +104,29 @@ var f = r(function({ renderDashboard: r, onClose: f }) {
|
|
|
92
104
|
})
|
|
93
105
|
})]
|
|
94
106
|
}),
|
|
95
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ m("div", {
|
|
96
108
|
className: "min-h-0 flex-1 overflow-y-auto bg-bg-sunken p-4",
|
|
97
|
-
children:
|
|
109
|
+
children: i ? i(S, C) : /* @__PURE__ */ m(_, {})
|
|
98
110
|
}),
|
|
99
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ m("div", {
|
|
100
112
|
className: "flex-shrink-0 border-t border-[var(--color-border-subtle)] px-4 py-2",
|
|
101
|
-
children: /* @__PURE__ */
|
|
113
|
+
children: /* @__PURE__ */ h("div", {
|
|
102
114
|
className: "flex flex-wrap items-center justify-between gap-x-4 gap-y-1 text-xs text-text-muted",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
104
|
-
|
|
105
|
-
" ",
|
|
106
|
-
|
|
107
|
-
] }), /* @__PURE__ */ u("span", { children: "Press Esc to close" })]
|
|
115
|
+
children: [/* @__PURE__ */ m("span", {
|
|
116
|
+
className: "min-w-0 break-words",
|
|
117
|
+
children: v("bigconsole.drilldown.parameters", "Parameters: {{parameters}}", { parameters: k || v("bigconsole.drilldown.noParameters", "None") })
|
|
118
|
+
}), /* @__PURE__ */ m("span", { children: "Press Esc to close" })]
|
|
108
119
|
})
|
|
109
120
|
})
|
|
110
121
|
]
|
|
111
122
|
})
|
|
112
123
|
});
|
|
113
124
|
});
|
|
114
|
-
function
|
|
115
|
-
return /* @__PURE__ */
|
|
125
|
+
function _() {
|
|
126
|
+
return /* @__PURE__ */ m("div", {
|
|
116
127
|
className: "flex items-center justify-center h-full text-sm text-text-secondary",
|
|
117
128
|
children: "Unable to load drilldown content. Please try again."
|
|
118
129
|
});
|
|
119
130
|
}
|
|
120
131
|
//#endregion
|
|
121
|
-
export {
|
|
132
|
+
export { g as DrilldownModal, g as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { ChartConfig, ChartData } from './types';
|
|
3
3
|
export interface FunnelChartProps {
|
|
4
|
-
/** Chart data
|
|
4
|
+
/** Chart data in funnel stage order */
|
|
5
5
|
data: ChartData[];
|
|
6
6
|
/** Chart configuration */
|
|
7
7
|
config: ChartConfig;
|
|
@@ -1,68 +1,83 @@
|
|
|
1
1
|
import { ChartTooltip as e } from "../ChartTooltip.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { funnelStages as t } from "./funnelData.js";
|
|
3
|
+
import { memo as n } from "react";
|
|
4
|
+
import { useI18n as r } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { Cell as o, Funnel as s, FunnelChart as c, LabelList as l, ResponsiveContainer as u, Tooltip as d } from "recharts";
|
|
5
7
|
//#region src/bigconsole/components/widgets/chart/charts/FunnelChart.tsx
|
|
6
|
-
var
|
|
8
|
+
var f = [
|
|
7
9
|
"var(--color-chart-1)",
|
|
8
10
|
"var(--color-chart-2)",
|
|
9
11
|
"var(--color-chart-3)",
|
|
10
12
|
"var(--color-chart-4)",
|
|
11
13
|
"var(--color-chart-5)"
|
|
12
|
-
],
|
|
13
|
-
let h = (e) => typeof e == "number" ? new Intl.NumberFormat("en-US", {
|
|
14
|
+
], p = n(function({ data: n = [], config: p, dataKey: m = "value", nameKey: h = "name", onDataClick: g }) {
|
|
15
|
+
let { t: _, locale: v } = r(), y = t(n, m, h), b = (e) => typeof e == "number" ? new Intl.NumberFormat("en-US", {
|
|
14
16
|
notation: e >= 1e4 ? "compact" : "standard",
|
|
15
17
|
maximumFractionDigits: 2
|
|
16
18
|
}).format(e) : String(e);
|
|
17
|
-
if (!
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
...e,
|
|
26
|
-
rate: a
|
|
27
|
-
};
|
|
19
|
+
if (!y || !y.length || y.every((e) => e.value === 0)) return /* @__PURE__ */ i("div", {
|
|
20
|
+
role: "status",
|
|
21
|
+
className: "flex items-center justify-center h-full text-text-secondary text-sm p-4",
|
|
22
|
+
children: y ? _("bigconsole.widgets.funnel.noCounts", "No funnel counts to display. Connect data with at least one count greater than zero.") : _("bigconsole.widgets.funnel.invalidFields", "Each funnel row needs a label in \"{{labelField}}\" and a non-negative number in \"{{valueField}}\". Choose the label and value fields in Style.", {
|
|
23
|
+
labelField: h,
|
|
24
|
+
valueField: m
|
|
25
|
+
})
|
|
28
26
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
children:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
27
|
+
let x = new Intl.NumberFormat(v, {
|
|
28
|
+
style: "percent",
|
|
29
|
+
maximumFractionDigits: 1
|
|
30
|
+
}), S = y.map((e) => ({
|
|
31
|
+
...e.row,
|
|
32
|
+
__conversionLabel: `${e.label} (${e.conversion === void 0 ? "—" : x.format(e.conversion)})`
|
|
33
|
+
}));
|
|
34
|
+
return /* @__PURE__ */ a("div", {
|
|
35
|
+
className: "flex flex-col h-full",
|
|
36
|
+
children: [/* @__PURE__ */ i("p", {
|
|
37
|
+
className: "text-xs text-text-secondary mb-2",
|
|
38
|
+
children: _("bigconsole.widgets.funnel.conversionBasis", "Conversion from previous stage; first stage is the baseline.")
|
|
39
|
+
}), /* @__PURE__ */ i("div", {
|
|
40
|
+
className: "flex-1 min-h-0",
|
|
41
|
+
children: /* @__PURE__ */ i(u, {
|
|
42
|
+
width: "100%",
|
|
43
|
+
height: "100%",
|
|
44
|
+
children: /* @__PURE__ */ a(c, { children: [/* @__PURE__ */ i(d, { content: /* @__PURE__ */ i(e, {
|
|
45
|
+
valueFormatter: b,
|
|
46
|
+
labelFormatter: (e) => String(e)
|
|
47
|
+
}) }), /* @__PURE__ */ a(s, {
|
|
48
|
+
dataKey: m,
|
|
49
|
+
nameKey: h,
|
|
50
|
+
data: S,
|
|
51
|
+
isAnimationActive: !0,
|
|
52
|
+
onClick: (e, t) => {
|
|
53
|
+
t !== void 0 && n[t] && g?.(n[t], t);
|
|
54
|
+
},
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ i(l, {
|
|
57
|
+
position: "right",
|
|
58
|
+
fill: "var(--color-text-primary)",
|
|
59
|
+
stroke: "none",
|
|
60
|
+
dataKey: "__conversionLabel",
|
|
61
|
+
fontSize: 12
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ i(l, {
|
|
64
|
+
position: "center",
|
|
65
|
+
fill: "var(--color-text-on-primary, #ffffff)",
|
|
66
|
+
stroke: "none",
|
|
67
|
+
dataKey: m,
|
|
68
|
+
formatter: (e) => b(e),
|
|
69
|
+
fontSize: 14,
|
|
70
|
+
fontWeight: 600
|
|
71
|
+
}),
|
|
72
|
+
S.map((e, t) => /* @__PURE__ */ i(o, {
|
|
73
|
+
fill: p.colors?.[t] || f[t % f.length],
|
|
74
|
+
style: { cursor: g ? "pointer" : "default" }
|
|
75
|
+
}, `cell-${t}`))
|
|
76
|
+
]
|
|
77
|
+
})] })
|
|
78
|
+
})
|
|
79
|
+
})]
|
|
65
80
|
});
|
|
66
81
|
});
|
|
67
82
|
//#endregion
|
|
68
|
-
export {
|
|
83
|
+
export { p as FunnelChart, p as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChartData } from './types';
|
|
2
|
+
/** Keep the caller's stage order; conversions compare adjacent stages. */
|
|
3
|
+
export declare function funnelStages(data: ChartData[], valueField: string, labelField: string): {
|
|
4
|
+
row: ChartData;
|
|
5
|
+
value: number;
|
|
6
|
+
label: string;
|
|
7
|
+
conversion: number | undefined;
|
|
8
|
+
}[] | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/bigconsole/components/widgets/chart/charts/funnelData.ts
|
|
2
|
+
function e(e, t, n) {
|
|
3
|
+
return !Array.isArray(e) || e.some((e) => {
|
|
4
|
+
let r = e?.[t], i = e?.[n];
|
|
5
|
+
return typeof r != "number" || !Number.isFinite(r) || r < 0 || !["string", "number"].includes(typeof i) || String(i).trim() === "";
|
|
6
|
+
}) ? null : e.map((r, i) => {
|
|
7
|
+
let a = r[t], o = e[Math.max(0, i - 1)][t];
|
|
8
|
+
return {
|
|
9
|
+
row: r,
|
|
10
|
+
value: a,
|
|
11
|
+
label: String(r[n]),
|
|
12
|
+
conversion: o > 0 ? a / o : void 0
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { e as funnelStages };
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
/** Display only meaningful context; the original drilldown parameters remain unchanged. */
|
|
2
2
|
export declare function getVisibleDrilldownParams(params: Record<string, unknown>): Array<[string, unknown]>;
|
|
3
|
+
export interface DrilldownFilterLabel {
|
|
4
|
+
name?: string;
|
|
5
|
+
config?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
/** Resolve display metadata only; never rewrite filter IDs or values used by widgets. */
|
|
8
|
+
export declare function getDrilldownParamSummary(params: Record<string, unknown>, readFilter?: (id: string) => DrilldownFilterLabel | null | undefined): string;
|
|
@@ -2,5 +2,23 @@
|
|
|
2
2
|
function e(e) {
|
|
3
3
|
return Object.entries(e).filter(([e, t]) => e.startsWith("__") || t == null ? !1 : typeof t == "string" ? t.trim().length > 0 : !Array.isArray(t) || t.length > 0);
|
|
4
4
|
}
|
|
5
|
+
function t(e, n) {
|
|
6
|
+
if (Array.isArray(e)) return e.map((e) => t(e, n)).join(", ");
|
|
7
|
+
if (typeof e == "object" && e) {
|
|
8
|
+
let r = e;
|
|
9
|
+
return typeof r.label == "string" ? r.label : "value" in r ? t(r.value, n) : JSON.stringify(e);
|
|
10
|
+
}
|
|
11
|
+
if (Array.isArray(n)) {
|
|
12
|
+
let t = n.find((t) => t && typeof t == "object" && t.value === e && typeof t.label == "string");
|
|
13
|
+
if (t) return t.label;
|
|
14
|
+
}
|
|
15
|
+
return String(e);
|
|
16
|
+
}
|
|
17
|
+
function n(n, r = () => void 0) {
|
|
18
|
+
return e(n).map(([e, n]) => {
|
|
19
|
+
let i = r(e);
|
|
20
|
+
return `${i?.name || e}: ${t(n, i?.config?.options)}`;
|
|
21
|
+
}).join("; ");
|
|
22
|
+
}
|
|
5
23
|
//#endregion
|
|
6
|
-
export { e as getVisibleDrilldownParams };
|
|
24
|
+
export { n as getDrilldownParamSummary, e as getVisibleDrilldownParams };
|