@burdenoff/microfe-bigconsole 2026.1119.7 → 2026.1119.9

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 (38) hide show
  1. package/dist/bigconsole/components/dashboard/ExportDashboardDialog.js +129 -117
  2. package/dist/bigconsole/components/embed/widgets/ChartEmbed.js +70 -66
  3. package/dist/bigconsole/components/insights/GeneratedFormattingReview.d.ts +21 -0
  4. package/dist/bigconsole/components/insights/GeneratedFormattingReview.js +90 -44
  5. package/dist/bigconsole/components/parser/ParserCard.d.ts +3 -1
  6. package/dist/bigconsole/components/parser/ParserCard.js +125 -120
  7. package/dist/bigconsole/components/parser/ParserScopeBadge.d.ts +6 -0
  8. package/dist/bigconsole/components/parser/ParserScopeBadge.js +23 -0
  9. package/dist/bigconsole/components/widgets/chart/ChartWidget.js +1 -0
  10. package/dist/bigconsole/components/widgets/chart/ReferenceLinesEditor.js +5 -1
  11. package/dist/bigconsole/components/widgets/chart/charts/AreaChart.js +4 -1
  12. package/dist/bigconsole/components/widgets/chart/charts/BarChart.js +53 -45
  13. package/dist/bigconsole/components/widgets/chart/charts/ComboChart.js +5 -1
  14. package/dist/bigconsole/components/widgets/chart/charts/LineChart.js +4 -1
  15. package/dist/bigconsole/components/widgets/chart/charts/referenceElements.d.ts +13 -11
  16. package/dist/bigconsole/components/widgets/chart/charts/referenceElements.js +58 -29
  17. package/dist/bigconsole/components/widgets/chart/charts/types.d.ts +8 -1
  18. package/dist/bigconsole/components/widgets/chart/referenceLineDraft.js +26 -23
  19. package/dist/bigconsole/components/widgets/utils/conditionalFormat.d.ts +41 -0
  20. package/dist/bigconsole/components/widgets/utils/conditionalFormat.js +80 -44
  21. package/dist/bigconsole/hooks/useExportDashboard.d.ts +14 -2
  22. package/dist/bigconsole/hooks/useExportDashboard.js +45 -41
  23. package/dist/bigconsole/hooks/useParserOperations.d.ts +6 -0
  24. package/dist/bigconsole/hooks/useParserOperations.js +64 -65
  25. package/dist/bigconsole/pages/DataParsersPage.js +201 -172
  26. package/dist/bigconsole/pages/InsightsPage.js +458 -451
  27. package/dist/bigconsole/store/parserScope.js +9 -6
  28. package/dist/bigconsole/types/index.d.ts +16 -0
  29. package/dist/bigconsole/utils/parserScopeFilter.d.ts +14 -0
  30. package/dist/bigconsole/utils/parserScopeFilter.js +25 -0
  31. package/dist/bigconsole/utils/pipelineExecutionTimeline.d.ts +13 -1
  32. package/dist/bigconsole/utils/pipelineExecutionTimeline.js +26 -3
  33. package/dist/generated/global-operations.d.ts +45 -6
  34. package/dist/generated/global-types.d.ts +5839 -804
  35. package/dist/generated/wspace-operations.d.ts +48 -1
  36. package/dist/generated/wspace-operations.js +86 -7
  37. package/dist/generated/wspace-types.d.ts +1339 -6
  38. package/package.json +1 -1
@@ -1,14 +1,15 @@
1
1
  import { SECTION_FOCUS_RING as e } from "../common/sectionStyles.js";
2
2
  import { ParserStatusBadge as t } from "./ParserStatusBadge.js";
3
3
  import { ParserTypeBadge as n } from "./ParserTypeBadge.js";
4
+ import { ParserScopeBadge as r } from "./ParserScopeBadge.js";
4
5
  import "../common/index.js";
5
- import { useTr as r } from "../../../shared/hooks/useTr.js";
6
- import { memo as i, useCallback as a, useMemo as o } from "react";
7
- import { Database as s, Download as c, FlaskConical as l, Pencil as u, Play as d, Trash2 as f } from "lucide-react";
8
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
6
+ import { useTr as i } from "../../../shared/hooks/useTr.js";
7
+ import { memo as a, useCallback as o, useMemo as s } from "react";
8
+ import { Database as c, Download as l, FlaskConical as u, Pencil as d, Play as f, Trash2 as p } from "lucide-react";
9
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
9
10
  // src/bigconsole/components/parser/ParserCard.tsx
10
- var h = `inline-flex min-h-11 min-w-11 items-center justify-center rounded-md text-text-secondary motion-safe:transition-colors hover:bg-bg-sunken hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-50 ${e}`, g = 6, _ = 2;
11
- function v(e) {
11
+ var g = `inline-flex min-h-11 min-w-11 items-center justify-center rounded-md text-text-secondary motion-safe:transition-colors hover:bg-bg-sunken hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-50 ${e}`, _ = 6, v = 2;
12
+ function y(e) {
12
13
  let t = new Date(e);
13
14
  return new Intl.DateTimeFormat("en-US", {
14
15
  month: "short",
@@ -18,16 +19,16 @@ function v(e) {
18
19
  minute: "2-digit"
19
20
  }).format(t);
20
21
  }
21
- function y(e) {
22
+ function b(e) {
22
23
  let t = new Date(e), n = Date.now() - t.getTime(), r = Math.floor(n / 6e4);
23
24
  if (r < 1) return "just now";
24
25
  if (r < 60) return `${r}m ago`;
25
26
  let i = Math.floor(r / 60);
26
27
  if (i < 24) return `${i}h ago`;
27
28
  let a = Math.floor(i / 24);
28
- return a < 7 ? `${a}d ago` : v(e);
29
+ return a < 7 ? `${a}d ago` : y(e);
29
30
  }
30
- function b(e, t) {
31
+ function x(e, t) {
31
32
  if (!e) return {
32
33
  lines: [],
33
34
  truncated: !1
@@ -43,208 +44,212 @@ function b(e, t) {
43
44
  truncated: r.length > t
44
45
  };
45
46
  }
46
- var x = i(function({ label: e, onClick: t, destructive: n, disabled: r, children: i }) {
47
- return /* @__PURE__ */ p("button", {
47
+ var S = a(function({ label: e, onClick: t, destructive: n, disabled: r, children: i }) {
48
+ return /* @__PURE__ */ m("button", {
48
49
  type: "button",
49
50
  onClick: t,
50
51
  disabled: r,
51
52
  "aria-label": e,
52
53
  title: e,
53
- className: `${h} ${n ? "hover:text-[var(--color-status-error-text)]" : ""}`,
54
+ className: `${g} ${n ? "hover:text-[var(--color-status-error-text)]" : ""}`,
54
55
  children: i
55
56
  });
56
- }), S = i(function({ parser: i, onView: h, onEdit: S, onTest: C, onExecute: w, onExport: T, onDelete: E, isDeleting: D = !1, layout: O = "grid" }) {
57
- let k = r(), A = i.name || k("bigconsole.parsers.view.untitled", "Untitled Parser"), j = a(() => {
58
- h?.(i.id);
59
- }, [h, i.id]), M = a((e) => {
60
- e.stopPropagation(), h?.(i.id);
61
- }, [h, i.id]), N = a((e) => {
62
- e.stopPropagation(), C?.(i.id);
63
- }, [C, i.id]), P = a((e) => {
64
- e.stopPropagation(), w?.(i.id);
65
- }, [w, i.id]), F = a((e) => {
66
- e.stopPropagation(), S?.(i.id);
67
- }, [S, i.id]), I = a((e) => {
68
- e.stopPropagation(), T?.(i.id);
69
- }, [T, i.id]), L = a((e) => {
70
- e.stopPropagation(), E?.(i.id);
71
- }, [E, i.id]), { lines: R, truncated: z } = o(() => b(i.expression, O === "list" ? _ : g), [i.expression, O]), B = "h-icon-sm w-icon-sm", V = /* @__PURE__ */ m("div", {
57
+ }), C = a(function({ parser: a, onView: g, onEdit: C, onTest: w, onExecute: T, onExport: E, onDelete: D, isDeleting: O = !1, layout: k = "grid", showScope: A = !1 }) {
58
+ let j = i(), M = a.name || j("bigconsole.parsers.view.untitled", "Untitled Parser"), N = o(() => {
59
+ g?.(a.id);
60
+ }, [g, a.id]), P = o((e) => {
61
+ e.stopPropagation(), g?.(a.id);
62
+ }, [g, a.id]), F = o((e) => {
63
+ e.stopPropagation(), w?.(a.id);
64
+ }, [w, a.id]), I = o((e) => {
65
+ e.stopPropagation(), T?.(a.id);
66
+ }, [T, a.id]), L = o((e) => {
67
+ e.stopPropagation(), C?.(a.id);
68
+ }, [C, a.id]), R = o((e) => {
69
+ e.stopPropagation(), E?.(a.id);
70
+ }, [E, a.id]), z = o((e) => {
71
+ e.stopPropagation(), D?.(a.id);
72
+ }, [D, a.id]), { lines: B, truncated: V } = s(() => x(a.expression, k === "list" ? v : _), [a.expression, k]), H = "h-icon-sm w-icon-sm", U = /* @__PURE__ */ h("div", {
72
73
  className: "flex shrink-0 flex-wrap items-center",
73
74
  children: [
74
- C && /* @__PURE__ */ p(x, {
75
- label: k("bigconsole.parsers.card.test", "Test parser"),
76
- onClick: N,
77
- disabled: D,
78
- children: /* @__PURE__ */ p(l, {
75
+ w && /* @__PURE__ */ m(S, {
76
+ label: j("bigconsole.parsers.card.test", "Test parser"),
77
+ onClick: F,
78
+ disabled: O,
79
+ children: /* @__PURE__ */ m(u, {
79
80
  "aria-hidden": "true",
80
- className: B
81
+ className: H
81
82
  })
82
83
  }),
83
- w && /* @__PURE__ */ p(x, {
84
- label: k("bigconsole.parsers.card.execute", "Execute parser"),
85
- onClick: P,
86
- disabled: D,
87
- children: /* @__PURE__ */ p(d, {
84
+ T && /* @__PURE__ */ m(S, {
85
+ label: j("bigconsole.parsers.card.execute", "Execute parser"),
86
+ onClick: I,
87
+ disabled: O,
88
+ children: /* @__PURE__ */ m(f, {
88
89
  "aria-hidden": "true",
89
- className: B
90
+ className: H
90
91
  })
91
92
  }),
92
- S && /* @__PURE__ */ p(x, {
93
- label: k("bigconsole.parsers.card.edit", "Edit parser"),
94
- onClick: F,
95
- disabled: D,
96
- children: /* @__PURE__ */ p(u, {
93
+ C && /* @__PURE__ */ m(S, {
94
+ label: j("bigconsole.parsers.card.edit", "Edit parser"),
95
+ onClick: L,
96
+ disabled: O,
97
+ children: /* @__PURE__ */ m(d, {
97
98
  "aria-hidden": "true",
98
- className: B
99
+ className: H
99
100
  })
100
101
  }),
101
- T && /* @__PURE__ */ p(x, {
102
- label: k("bigconsole.parsers.card.export", "Export parser"),
103
- onClick: I,
104
- disabled: D,
105
- children: /* @__PURE__ */ p(c, {
102
+ E && /* @__PURE__ */ m(S, {
103
+ label: j("bigconsole.parsers.card.export", "Export parser"),
104
+ onClick: R,
105
+ disabled: O,
106
+ children: /* @__PURE__ */ m(l, {
106
107
  "aria-hidden": "true",
107
- className: B
108
+ className: H
108
109
  })
109
110
  }),
110
- E && /* @__PURE__ */ p(x, {
111
- label: k("bigconsole.parsers.card.delete", "Delete parser"),
112
- onClick: L,
111
+ D && /* @__PURE__ */ m(S, {
112
+ label: j("bigconsole.parsers.card.delete", "Delete parser"),
113
+ onClick: z,
113
114
  destructive: !0,
114
- disabled: D,
115
- children: /* @__PURE__ */ p(f, {
115
+ disabled: O,
116
+ children: /* @__PURE__ */ m(p, {
116
117
  "aria-hidden": "true",
117
- className: B
118
+ className: H
118
119
  })
119
120
  })
120
121
  ]
121
- }), H = i.inputSinkKey ? /* @__PURE__ */ m("span", {
122
+ }), W = a.inputSinkKey ? /* @__PURE__ */ h("span", {
122
123
  className: "inline-flex min-w-0 items-center gap-icon-gap rounded-md border border-[var(--color-border-subtle)] bg-bg-sunken px-2 py-1 text-xs text-text-secondary",
123
- title: `${i.inputSinkKey} → ${i.outputKey}`,
124
- children: [/* @__PURE__ */ p(s, {
124
+ title: `${a.inputSinkKey} → ${a.outputKey}`,
125
+ children: [/* @__PURE__ */ m(c, {
125
126
  "aria-hidden": "true",
126
127
  className: "h-3 w-3 shrink-0"
127
- }), /* @__PURE__ */ p("span", {
128
+ }), /* @__PURE__ */ m("span", {
128
129
  className: "truncate font-mono",
129
- children: i.inputSinkKey
130
+ children: a.inputSinkKey
130
131
  })]
131
- }) : /* @__PURE__ */ p("span", {
132
+ }) : /* @__PURE__ */ m("span", {
132
133
  className: "text-xs text-text-muted",
133
- children: k("bigconsole.parsers.view.noneConfigured", "None configured")
134
- }), U = /* @__PURE__ */ p("span", {
134
+ children: j("bigconsole.parsers.view.noneConfigured", "None configured")
135
+ }), G = /* @__PURE__ */ m("span", {
135
136
  className: "whitespace-nowrap tabular-nums",
136
- title: `Last updated: ${v(i.updatedAt)}`,
137
- children: y(i.updatedAt)
138
- }), W = `
137
+ title: `Last updated: ${y(a.updatedAt)}`,
138
+ children: b(a.updatedAt)
139
+ }), K = `
139
140
  bg-bg-elevated
140
141
  border border-[var(--color-border-default)]
141
142
  rounded-card
142
143
  cursor-pointer
143
144
  hover:border-action-primary-bg
144
145
  motion-safe:transition-colors
145
- ${D ? "opacity-60 pointer-events-none" : ""}
146
- `, G = /* @__PURE__ */ p("button", {
146
+ ${O ? "opacity-60 pointer-events-none" : ""}
147
+ `, q = /* @__PURE__ */ m("button", {
147
148
  type: "button",
148
- onClick: M,
149
- disabled: D,
149
+ onClick: P,
150
+ disabled: O,
150
151
  className: `block w-full min-w-0 truncate rounded-sm text-left ${e}`,
151
- children: A
152
+ children: M
152
153
  });
153
- return O === "list" ? /* @__PURE__ */ m("div", {
154
- onClick: j,
155
- className: `${W} flex flex-wrap items-center gap-x-3 gap-y-2 p-3 sm:flex-nowrap`,
154
+ return k === "list" ? /* @__PURE__ */ h("div", {
155
+ onClick: N,
156
+ className: `${K} flex flex-wrap items-center gap-x-3 gap-y-2 p-3 sm:flex-nowrap`,
156
157
  children: [
157
- /* @__PURE__ */ p(n, {
158
- type: i.type,
158
+ /* @__PURE__ */ m(n, {
159
+ type: a.type,
159
160
  size: "sm"
160
161
  }),
161
- /* @__PURE__ */ m("div", {
162
+ /* @__PURE__ */ h("div", {
162
163
  className: "min-w-0 flex-1",
163
- children: [/* @__PURE__ */ p("h3", {
164
+ children: [/* @__PURE__ */ m("h3", {
164
165
  className: "min-w-0 text-sm font-semibold text-text-primary",
165
- children: G
166
- }), /* @__PURE__ */ m("p", {
166
+ children: q
167
+ }), /* @__PURE__ */ h("p", {
167
168
  className: "mt-0.5 truncate font-mono text-xs text-text-secondary",
168
169
  children: [
169
- i.inputSinkKey || "—",
170
+ a.inputSinkKey || "—",
170
171
  " → ",
171
- i.outputKey || "—"
172
+ a.outputKey || "—"
172
173
  ]
173
174
  })]
174
175
  }),
175
- R.length > 0 && /* @__PURE__ */ p("pre", {
176
+ A && /* @__PURE__ */ m(r, { parser: a }),
177
+ B.length > 0 && /* @__PURE__ */ m("pre", {
176
178
  "aria-hidden": "true",
177
179
  className: "hidden min-w-0 max-w-md flex-1 truncate whitespace-pre rounded-md border border-[var(--color-border-subtle)] bg-bg-sunken px-2 py-1 font-mono text-xs text-text-secondary lg:block",
178
- children: R.join(" ")
180
+ children: B.join(" ")
179
181
  }),
180
- /* @__PURE__ */ p(t, {
181
- status: i.status,
182
+ /* @__PURE__ */ m(t, {
183
+ status: a.status,
182
184
  size: "sm"
183
185
  }),
184
- /* @__PURE__ */ p("span", {
186
+ /* @__PURE__ */ m("span", {
185
187
  className: "text-xs text-text-muted",
186
- children: U
188
+ children: G
187
189
  }),
188
- V
190
+ U
189
191
  ]
190
- }) : /* @__PURE__ */ m("div", {
191
- onClick: j,
192
- className: `${W} flex h-full flex-col overflow-hidden`,
192
+ }) : /* @__PURE__ */ h("div", {
193
+ onClick: N,
194
+ className: `${K} flex h-full flex-col overflow-hidden`,
193
195
  children: [
194
- /* @__PURE__ */ m("div", {
196
+ /* @__PURE__ */ h("div", {
195
197
  className: "flex flex-wrap items-start justify-between gap-icon-gap p-4 pb-3",
196
- children: [/* @__PURE__ */ m("div", {
198
+ children: [/* @__PURE__ */ h("div", {
197
199
  className: "flex min-w-0 flex-1 items-center gap-icon-gap pt-2",
198
- children: [/* @__PURE__ */ p(n, {
199
- type: i.type,
200
+ children: [/* @__PURE__ */ m(n, {
201
+ type: a.type,
200
202
  size: "sm"
201
- }), /* @__PURE__ */ p("h3", {
203
+ }), /* @__PURE__ */ m("h3", {
202
204
  className: "min-w-0 flex-1 text-sm font-semibold text-text-primary",
203
- children: G
205
+ children: q
204
206
  })]
205
- }), V]
207
+ }), U]
206
208
  }),
207
- /* @__PURE__ */ p("div", {
209
+ /* @__PURE__ */ m("div", {
208
210
  className: "px-4",
209
- children: R.length > 0 ? /* @__PURE__ */ m("pre", {
211
+ children: B.length > 0 ? /* @__PURE__ */ h("pre", {
210
212
  className: "min-h-28 overflow-x-auto rounded-md border border-[var(--color-border-subtle)] bg-bg-sunken p-3 font-mono text-xs leading-relaxed text-text-secondary",
211
- children: [R.join("\n"), z && /* @__PURE__ */ p("span", {
213
+ children: [B.join("\n"), V && /* @__PURE__ */ m("span", {
212
214
  className: "mt-1 block text-text-muted",
213
215
  children: "…"
214
216
  })]
215
- }) : /* @__PURE__ */ p("div", {
217
+ }) : /* @__PURE__ */ m("div", {
216
218
  className: "flex min-h-28 items-center justify-center rounded-md border border-[var(--color-border-subtle)] bg-bg-sunken text-xs text-text-muted",
217
- children: k("bigconsole.parsers.card.noExpression", "No expression configured")
219
+ children: j("bigconsole.parsers.card.noExpression", "No expression configured")
218
220
  })
219
221
  }),
220
- i.description && /* @__PURE__ */ p("p", {
222
+ a.description && /* @__PURE__ */ m("p", {
221
223
  className: "line-clamp-2 px-4 pt-3 text-xs text-text-secondary",
222
- children: i.description
224
+ children: a.description
223
225
  }),
224
- /* @__PURE__ */ m("div", {
226
+ /* @__PURE__ */ h("div", {
225
227
  className: "mt-auto flex flex-col gap-2 p-4 pt-3",
226
- children: [/* @__PURE__ */ m("div", {
228
+ children: [/* @__PURE__ */ h("div", {
227
229
  className: "flex flex-wrap items-center justify-between gap-icon-gap",
228
- children: [H, /* @__PURE__ */ p(t, {
229
- status: i.status,
230
+ children: [/* @__PURE__ */ h("span", {
231
+ className: "flex min-w-0 flex-wrap items-center gap-icon-gap",
232
+ children: [W, A && /* @__PURE__ */ m(r, { parser: a })]
233
+ }), /* @__PURE__ */ m(t, {
234
+ status: a.status,
230
235
  size: "sm"
231
236
  })]
232
- }), /* @__PURE__ */ m("div", {
237
+ }), /* @__PURE__ */ h("div", {
233
238
  className: "flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-t border-[var(--color-border-subtle)] pt-2 text-xs text-text-muted",
234
- children: [/* @__PURE__ */ m("span", {
239
+ children: [/* @__PURE__ */ h("span", {
235
240
  className: "flex flex-wrap items-center gap-3",
236
- children: [i.version == null ? null : /* @__PURE__ */ m("span", { children: ["v", i.version] }), i.ttl ? /* @__PURE__ */ m("span", {
237
- title: `Cache TTL: ${i.ttl} seconds`,
241
+ children: [a.version == null ? null : /* @__PURE__ */ h("span", { children: ["v", a.version] }), a.ttl ? /* @__PURE__ */ h("span", {
242
+ title: `Cache TTL: ${a.ttl} seconds`,
238
243
  children: [
239
244
  "TTL: ",
240
- i.ttl,
245
+ a.ttl,
241
246
  "s"
242
247
  ]
243
248
  }) : null]
244
- }), U]
249
+ }), G]
245
250
  })]
246
251
  })
247
252
  ]
248
253
  });
249
254
  });
250
- export { S as ParserCard, S as default, b as previewExpression };
255
+ export { C as ParserCard, C as default, x as previewExpression };
@@ -0,0 +1,6 @@
1
+ import { Parser } from '../../types';
2
+ interface ParserScopeBadgeProps {
3
+ parser: Pick<Parser, 'consoleId' | 'console'>;
4
+ }
5
+ export declare const ParserScopeBadge: import('react').MemoExoticComponent<({ parser }: ParserScopeBadgeProps) => import('react').JSX.Element>;
6
+ export default ParserScopeBadge;
@@ -0,0 +1,23 @@
1
+ import { isGlobalParser as e } from "../../store/parserScope.js";
2
+ import { useTr as t } from "../../../shared/hooks/useTr.js";
3
+ import { memo as n } from "react";
4
+ import { Globe as r, LayoutDashboard as i } from "lucide-react";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ // src/bigconsole/components/parser/ParserScopeBadge.tsx
7
+ var s = n(function({ parser: n }) {
8
+ let s = t(), c = e(n), l = c ? r : i, u = c ? s("bigconsole.parsers.scope.global", "Global") : n.console?.name ?? s("bigconsole.parsers.scope.dashboardFallback", "Dashboard"), d = c ? s("bigconsole.parsers.scope.globalDescription", "Available in every dashboard") : s("bigconsole.parsers.scope.dashboardDescription", "Only available in dashboard \"{{name}}\"", { name: u });
9
+ return /* @__PURE__ */ o("span", {
10
+ title: d,
11
+ "aria-label": d,
12
+ "data-testid": "parser-scope-badge",
13
+ className: "inline-flex min-w-0 max-w-full items-center gap-1 rounded-md bg-bg-sunken px-1.5 py-0.5 text-xs text-text-secondary",
14
+ children: [/* @__PURE__ */ a(l, {
15
+ "aria-hidden": "true",
16
+ className: "h-3 w-3 shrink-0"
17
+ }), /* @__PURE__ */ a("span", {
18
+ className: "truncate",
19
+ children: u
20
+ })]
21
+ });
22
+ });
23
+ export { s as ParserScopeBadge, s as default };
@@ -66,6 +66,7 @@ var w = [], T = {
66
66
  innerRadius: j?.innerRadius,
67
67
  outerRadius: j?.outerRadius,
68
68
  referenceLines: j?.referenceLines,
69
+ conditionalRules: j?.conditionalRules,
69
70
  series: j?.series,
70
71
  selectedFields: j?.selectedFields,
71
72
  dualAxis: j?.dualAxis,
@@ -51,7 +51,11 @@ var m = a(function({ lines: n, onChange: a }) {
51
51
  children: [
52
52
  /* @__PURE__ */ d("legend", {
53
53
  className: "px-1 text-xs font-medium text-text-secondary",
54
- children: [s("bigconsole.widget.config.chart.referenceLines.itemLegend", "Line {{number}}", { number: l }), t.axis === "x" ? ` · ${s("bigconsole.widget.config.chart.referenceLines.xAxis", "X axis")}` : ""]
54
+ children: [
55
+ s("bigconsole.widget.config.chart.referenceLines.itemLegend", "Line {{number}}", { number: l }),
56
+ t.axis === "x" ? ` · ${s("bigconsole.widget.config.chart.referenceLines.xAxis", "X axis")}` : "",
57
+ t.relativeTo ? ` · ${t.relativeTo.mode === "percentChange" ? s("bigconsole.widget.config.chart.referenceLines.relativePercent", "% from {{field}}", { field: t.relativeTo.field }) : s("bigconsole.widget.config.chart.referenceLines.relativeDifference", "Difference from {{field}}", { field: t.relativeTo.field })}` : ""
58
+ ]
55
59
  }),
56
60
  /* @__PURE__ */ d("div", {
57
61
  className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
@@ -102,7 +102,10 @@ var g = [
102
102
  children: e
103
103
  })
104
104
  }),
105
- r(_.referenceLines),
105
+ r(_.referenceLines, {
106
+ data: i,
107
+ xAxisKey: _.xAxisKey || "name"
108
+ }),
106
109
  b.map((e, t) => /* @__PURE__ */ o(c, {
107
110
  type: _.curveType || "monotone",
108
111
  dataKey: e,
@@ -1,30 +1,31 @@
1
1
  import { numericSeriesKeys as e } from "./numericSeries.js";
2
2
  import { ChartTooltip as t } from "../ChartTooltip.js";
3
3
  import { buildReferenceElements as n } from "./referenceElements.js";
4
- import { memo as r, useMemo as i } from "react";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
- import { Bar as s, BarChart as c, CartesianGrid as l, Legend as u, ResponsiveContainer as d, Tooltip as f, XAxis as p, YAxis as m } from "recharts";
4
+ import { resolveBarFill as r } from "../../utils/conditionalFormat.js";
5
+ import { memo as i, useMemo as a } from "react";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
+ import { Bar as c, BarChart as l, CartesianGrid as u, Cell as d, Legend as f, ResponsiveContainer as p, Tooltip as m, XAxis as h, YAxis as g } from "recharts";
7
8
  // src/bigconsole/components/widgets/chart/charts/BarChart.tsx
8
- var h = [
9
+ var _ = [
9
10
  "var(--color-chart-1)",
10
11
  "var(--color-chart-2)",
11
12
  "var(--color-chart-3)",
12
13
  "var(--color-chart-4)",
13
14
  "var(--color-chart-5)"
14
- ], g = r(function({ data: r = [], config: g, hiddenSeries: _ = [], onDataClick: v }) {
15
- let y = i(() => e(r, g.xAxisKey, g.selectedFields), [
16
- r,
17
- g.xAxisKey,
18
- g.selectedFields
19
- ]), b = (e) => typeof e == "number" ? new Intl.NumberFormat("en-US", {
15
+ ], v = i(function({ data: i = [], config: v, hiddenSeries: y = [], onDataClick: b }) {
16
+ let x = a(() => e(i, v.xAxisKey, v.selectedFields), [
17
+ i,
18
+ v.xAxisKey,
19
+ v.selectedFields
20
+ ]), S = (e) => typeof e == "number" ? new Intl.NumberFormat("en-US", {
20
21
  notation: e >= 1e4 ? "compact" : "standard",
21
22
  maximumFractionDigits: 2
22
23
  }).format(e) : String(e);
23
- return r?.length ? /* @__PURE__ */ a(d, {
24
+ return i?.length ? /* @__PURE__ */ o(p, {
24
25
  width: "100%",
25
26
  height: "100%",
26
- children: /* @__PURE__ */ o(c, {
27
- data: r,
27
+ children: /* @__PURE__ */ s(l, {
28
+ data: i,
28
29
  margin: {
29
30
  top: 10,
30
31
  right: 10,
@@ -32,78 +33,85 @@ var h = [
32
33
  bottom: 0
33
34
  },
34
35
  onClick: (e) => {
35
- e?.activePayload?.[0] && v && v(e.activePayload[0].payload, e.activeTooltipIndex || 0);
36
+ e?.activePayload?.[0] && b && b(e.activePayload[0].payload, e.activeTooltipIndex || 0);
36
37
  },
37
38
  children: [
38
- g.showGrid !== !1 && /* @__PURE__ */ a(l, {
39
+ v.showGrid !== !1 && /* @__PURE__ */ o(u, {
39
40
  strokeDasharray: "3 3",
40
41
  stroke: "var(--color-border-default)",
41
42
  opacity: .5,
42
43
  vertical: !1
43
44
  }),
44
- /* @__PURE__ */ a(p, {
45
- dataKey: g.xAxisKey || "name",
45
+ /* @__PURE__ */ o(h, {
46
+ dataKey: v.xAxisKey || "name",
46
47
  tick: {
47
48
  fill: "var(--color-text-secondary)",
48
49
  fontSize: 12
49
50
  },
50
51
  tickLine: { stroke: "var(--color-border-default)" },
51
52
  axisLine: { stroke: "var(--color-border-default)" },
52
- label: g.xAxisLabel ? {
53
- value: g.xAxisLabel,
53
+ label: v.xAxisLabel ? {
54
+ value: v.xAxisLabel,
54
55
  position: "insideBottom",
55
56
  offset: -5,
56
57
  fill: "var(--color-text-secondary)"
57
58
  } : void 0
58
59
  }),
59
- /* @__PURE__ */ a(m, {
60
+ /* @__PURE__ */ o(g, {
60
61
  tick: {
61
62
  fill: "var(--color-text-secondary)",
62
63
  fontSize: 12
63
64
  },
64
65
  tickLine: { stroke: "var(--color-border-default)" },
65
66
  axisLine: { stroke: "var(--color-border-default)" },
66
- tickFormatter: b,
67
- scale: g.logScale ? "log" : "auto",
68
- domain: g.logScale ? ["auto", "auto"] : void 0,
69
- allowDataOverflow: g.logScale || void 0,
70
- label: g.yAxisLabel ? {
71
- value: g.yAxisLabel,
67
+ tickFormatter: S,
68
+ scale: v.logScale ? "log" : "auto",
69
+ domain: v.logScale ? ["auto", "auto"] : void 0,
70
+ allowDataOverflow: v.logScale || void 0,
71
+ label: v.yAxisLabel ? {
72
+ value: v.yAxisLabel,
72
73
  angle: -90,
73
74
  position: "insideLeft",
74
75
  fill: "var(--color-text-secondary)"
75
76
  } : void 0
76
77
  }),
77
- /* @__PURE__ */ a(f, {
78
- content: /* @__PURE__ */ a(t, { valueFormatter: b }),
78
+ /* @__PURE__ */ o(m, {
79
+ content: /* @__PURE__ */ o(t, { valueFormatter: S }),
79
80
  cursor: {
80
81
  fill: "var(--color-bg-muted)",
81
82
  opacity: .5
82
83
  }
83
84
  }),
84
- g.showLegend !== !1 && /* @__PURE__ */ a(u, {
85
+ v.showLegend !== !1 && /* @__PURE__ */ o(f, {
85
86
  wrapperStyle: { paddingTop: 20 },
86
- formatter: (e) => /* @__PURE__ */ a("span", {
87
+ formatter: (e) => /* @__PURE__ */ o("span", {
87
88
  style: { color: "var(--color-text-primary)" },
88
89
  children: e
89
90
  })
90
91
  }),
91
- n(g.referenceLines),
92
- y.map((e, t) => /* @__PURE__ */ a(s, {
93
- dataKey: e,
94
- name: g.seriesNames?.[e] || e,
95
- fill: g.colors?.[t] || h[t % h.length],
96
- radius: [
97
- 4,
98
- 4,
99
- 0,
100
- 0
101
- ],
102
- hide: _.includes(e),
103
- stackId: g.stacked ? "stack" : void 0
104
- }, e))
92
+ n(v.referenceLines, {
93
+ data: i,
94
+ xAxisKey: v.xAxisKey || "name"
95
+ }),
96
+ x.map((e, t) => {
97
+ let n = v.colors?.[t] || _[t % _.length];
98
+ return /* @__PURE__ */ o(c, {
99
+ dataKey: e,
100
+ name: v.seriesNames?.[e] || e,
101
+ fill: n,
102
+ radius: [
103
+ 4,
104
+ 4,
105
+ 0,
106
+ 0
107
+ ],
108
+ hide: y.includes(e),
109
+ stackId: v.stacked ? "stack" : void 0,
110
+ children: v.conditionalRules?.length ? i.map((t, i) => /* @__PURE__ */ o(d, { fill: r(t, e, v.conditionalRules) ?? n }, `${e}-${i}`)) : null
111
+ }, e);
112
+ })
105
113
  ]
106
114
  })
107
115
  }) : null;
108
116
  });
109
- export { g as BarChart, g as default };
117
+ export { v as BarChart, v as default };
@@ -121,7 +121,11 @@ var g = [
121
121
  stackId: _.stacked ? "stack" : void 0
122
122
  }, e.field);
123
123
  }),
124
- n(_.referenceLines, { yAxisId: "left" })
124
+ n(_.referenceLines, {
125
+ yAxisId: "left",
126
+ data: r,
127
+ xAxisKey: _.xAxisKey || "name"
128
+ })
125
129
  ]
126
130
  })
127
131
  }) : null;
@@ -83,7 +83,10 @@ var g = [
83
83
  children: e
84
84
  })
85
85
  }),
86
- r(_.referenceLines),
86
+ r(_.referenceLines, {
87
+ data: i,
88
+ xAxisKey: _.xAxisKey || "name"
89
+ }),
87
90
  b.map((e, t) => /* @__PURE__ */ o(u, {
88
91
  type: _.curveType || "monotone",
89
92
  dataKey: e,