@burdenoff/microfe-bigconsole 2026.1123.2 → 2026.1123.4

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.
@@ -1,14 +1,15 @@
1
1
  import { numericSeriesKeys as e } from "../components/widgets/chart/charts/numericSeries.js";
2
2
  import { classifyChartData as t } from "../components/widgets/chart/chartRows.js";
3
- import { normalizeMetricData as n } from "../components/widgets/metric-card/metricData.js";
4
- import { normalizeTableRows as r } from "../components/widgets/table/tableRows.js";
3
+ import { legacyChartToRows as n } from "../utils/legacyChartRows.js";
4
+ import { normalizeMetricData as r } from "../components/widgets/metric-card/metricData.js";
5
+ import { normalizeTableRows as i } from "../components/widgets/table/tableRows.js";
5
6
  // src/bigconsole/compare/compareEngine.ts
6
- var i = {
7
+ var a = {
7
8
  absolute: null,
8
9
  percent: null,
9
10
  direction: "unknown"
10
11
  };
11
- function a(e) {
12
+ function o(e) {
12
13
  if (typeof e == "number") return Number.isFinite(e) ? e : null;
13
14
  if (typeof e == "string" && e.trim() !== "") {
14
15
  let t = Number(e);
@@ -16,65 +17,65 @@ function a(e) {
16
17
  }
17
18
  return null;
18
19
  }
19
- function o(e, t) {
20
- let n = a(e), r = a(t);
21
- if (n === null || r === null) return i;
22
- let o = r - n;
20
+ function s(e, t) {
21
+ let n = o(e), r = o(t);
22
+ if (n === null || r === null) return a;
23
+ let i = r - n;
23
24
  return {
24
- absolute: o,
25
- percent: n === 0 ? null : o / Math.abs(n) * 100,
26
- direction: o === 0 ? "same" : o > 0 ? "up" : "down"
25
+ absolute: i,
26
+ percent: n === 0 ? null : i / Math.abs(n) * 100,
27
+ direction: i === 0 ? "same" : i > 0 ? "up" : "down"
27
28
  };
28
29
  }
29
- var s = (e) => ({
30
+ var c = (e) => ({
30
31
  kind: "unavailable",
31
32
  reason: e
32
- }), c = (e) => typeof e == "number" ? Number.isFinite(e) ? e : null : typeof e == "string" ? e : null, l = (e, t) => ({
33
- from: c(e),
34
- to: c(t),
35
- change: o(e, t)
33
+ }), l = (e) => typeof e == "number" ? Number.isFinite(e) ? e : null : typeof e == "string" ? e : null, u = (e, t) => ({
34
+ from: l(e),
35
+ to: l(t),
36
+ change: s(e, t)
36
37
  });
37
- function u(e, t, r) {
38
- let i = e ?? void 0, a = (e) => n(e, i), o = a(t), c = a(r);
39
- return o === void 0 && c === void 0 ? s("unreadable_data") : {
38
+ function d(e, t, n) {
39
+ let i = e ?? void 0, a = (e) => r(e, i), o = a(t), s = a(n);
40
+ return o === void 0 && s === void 0 ? c("unreadable_data") : {
40
41
  kind: "metric",
41
- value: l(o?.value, c?.value),
42
+ value: u(o?.value, s?.value),
42
43
  from: o ?? null,
43
- to: c ?? null
44
+ to: s ?? null
44
45
  };
45
46
  }
46
- var d = /* @__PURE__ */ new Set(["bar", "line"]);
47
- function f(e) {
48
- let n = t(e);
49
- return n.kind === "rows" ? n.rows : n.kind === "empty" ? [] : null;
47
+ var f = /* @__PURE__ */ new Set(["bar", "line"]);
48
+ function p(e) {
49
+ let r = t(n(e) ?? e);
50
+ return r.kind === "rows" ? r.rows : r.kind === "empty" ? [] : null;
50
51
  }
51
- var p = (e, t) => {
52
+ var m = (e, t) => {
52
53
  let n = e[t];
53
54
  return n == null ? "" : String(n);
54
55
  };
55
- function m(e, t) {
56
+ function h(e, t) {
56
57
  let n = /* @__PURE__ */ new Map();
57
58
  for (let r of e) {
58
- let e = p(r, t);
59
+ let e = m(r, t);
59
60
  if (n.has(e)) return null;
60
61
  n.set(e, r);
61
62
  }
62
63
  return n;
63
64
  }
64
- function h(t, n, r) {
65
- let i = f(n), a = f(r);
66
- if (i === null || a === null) return s("unreadable_data");
67
- let o = String(t?.xAxisField || t?.labelField || "name"), c = Array.isArray(t?.selectedFields) ? t.selectedFields : void 0, u = [.../* @__PURE__ */ new Set([...e(a, o, c), ...e(i, o, c)])], d = m(i, o), p = m(a, o);
68
- return d === null || p === null ? s("duplicate_keys") : {
65
+ function g(t, n, r) {
66
+ let i = p(n), a = p(r);
67
+ if (i === null || a === null) return c("unreadable_data");
68
+ let o = String(t?.xAxisField || t?.labelField || "name"), s = Array.isArray(t?.selectedFields) ? t.selectedFields : void 0, l = [.../* @__PURE__ */ new Set([...e(a, o, s), ...e(i, o, s)])], d = h(i, o), f = h(a, o);
69
+ return d === null || f === null ? c("duplicate_keys") : {
69
70
  kind: "chart",
70
- series: u,
71
- points: [.../* @__PURE__ */ new Set([...p.keys(), ...d.keys()])].map((e) => ({
71
+ series: l,
72
+ points: [.../* @__PURE__ */ new Set([...f.keys(), ...d.keys()])].map((e) => ({
72
73
  label: e,
73
- values: u.map((t) => l(d.get(e)?.[t], p.get(e)?.[t]))
74
+ values: l.map((t) => u(d.get(e)?.[t], f.get(e)?.[t]))
74
75
  }))
75
76
  };
76
77
  }
77
- function g(e, t) {
78
+ function _(e, t) {
78
79
  let n = (Array.isArray(e?.columns) ? e.columns : []).flatMap((e) => {
79
80
  if (typeof e == "string") return [e];
80
81
  if (e && typeof e == "object") {
@@ -87,18 +88,18 @@ function g(e, t) {
87
88
  let r = t[0];
88
89
  return r ? Object.keys(r) : [];
89
90
  }
90
- function _(e, t) {
91
+ function v(e, t) {
91
92
  if (e === t) return !0;
92
93
  if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
93
- if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length === t.length && e.every((e, n) => _(e, t[n]));
94
+ if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length === t.length && e.every((e, n) => v(e, t[n]));
94
95
  let n = e, r = t, i = Object.keys(n);
95
- return i.length === Object.keys(r).length && i.every((e) => e in r && _(n[e], r[e]));
96
+ return i.length === Object.keys(r).length && i.every((e) => e in r && v(n[e], r[e]));
96
97
  }
97
- var v = (e) => typeof e == "object" && !!e && !Array.isArray(e);
98
- function y(e, t) {
98
+ var y = (e) => typeof e == "object" && !!e && !Array.isArray(e);
99
+ function b(e, t) {
99
100
  return t.length > 0 && t.every((e) => e.id !== void 0 && e.id !== null) ? "id" : e[0] ?? null;
100
101
  }
101
- function b(e, t) {
102
+ function x(e, t) {
102
103
  let n = /* @__PURE__ */ new Map();
103
104
  for (let r of e) {
104
105
  let e = r[t], i = e == null ? "" : String(e);
@@ -107,22 +108,34 @@ function b(e, t) {
107
108
  }
108
109
  return n;
109
110
  }
110
- function x(e, t, n) {
111
- let a = r(t), c = r(n);
112
- if (!a.every(v) || !c.every(v)) return s("unreadable_data");
113
- let l = g(e, [...c, ...a]), u = y(l, [...c, ...a]);
114
- if (u === null) return s("no_key_column");
115
- let d = b(a, u), f = b(c, u);
116
- if (d === null || f === null) return s("duplicate_keys");
111
+ function S(e, t, n) {
112
+ let r = i(t), o = i(n);
113
+ if (!r.every(y) || !o.every(y)) return c("unreadable_data");
114
+ let l = _(e, [...o, ...r]), u = b(l, [...o, ...r]);
115
+ if (u === null && o.length === 0 && r.length === 0) return {
116
+ kind: "table",
117
+ columns: l,
118
+ keyColumn: "",
119
+ rows: [],
120
+ summary: {
121
+ added: 0,
122
+ removed: 0,
123
+ changed: 0,
124
+ unchanged: 0
125
+ }
126
+ };
127
+ if (u === null) return c("no_key_column");
128
+ let d = x(r, u), f = x(o, u);
129
+ if (d === null || f === null) return c("duplicate_keys");
117
130
  let p = [.../* @__PURE__ */ new Set([...f.keys(), ...d.keys()])].map((e) => {
118
131
  let t = d.get(e), n = f.get(e), r = l.map((e) => {
119
- let r = t?.[e], a = n?.[e], s = t !== void 0 && n !== void 0 && !_(r, a);
132
+ let r = t?.[e], i = n?.[e], o = t !== void 0 && n !== void 0 && !v(r, i);
120
133
  return {
121
134
  column: e,
122
135
  from: r,
123
- to: a,
124
- changed: s,
125
- change: s ? o(r, a) : i
136
+ to: i,
137
+ changed: o,
138
+ change: o ? s(r, i) : a
126
139
  };
127
140
  });
128
141
  return {
@@ -145,28 +158,28 @@ function x(e, t, n) {
145
158
  summary: m
146
159
  };
147
160
  }
148
- function S(e) {
161
+ function C(e) {
149
162
  return e === "metric_card" || e === "chart" || e === "table";
150
163
  }
151
- function C(e) {
164
+ function w(e) {
152
165
  return typeof e?.chartType == "string" ? e.chartType.toLowerCase() : "line";
153
166
  }
154
- function w(e) {
155
- if (!S(e.widgetType)) return {
167
+ function T(e) {
168
+ if (!C(e.widgetType)) return {
156
169
  kind: "unsupported",
157
170
  widgetType: e.widgetType
158
171
  };
159
- if (e.widgetType === "chart" && !d.has(C(e.config))) return {
172
+ if (e.widgetType === "chart" && !f.has(w(e.config))) return {
160
173
  kind: "unsupported",
161
- widgetType: `chart:${C(e.config)}`
174
+ widgetType: `chart:${w(e.config)}`
162
175
  };
163
176
  let { from: t, to: n } = e;
164
- if (!t.available) return s("no_data_from");
165
- if (!n.available) return s("no_data_to");
177
+ if (!t.available) return c("no_data_from");
178
+ if (!n.available) return c("no_data_to");
166
179
  switch (e.widgetType) {
167
- case "metric_card": return u(e.config, t.data, n.data);
168
- case "chart": return h(e.config, t.data, n.data);
169
- default: return x(e.config, t.data, n.data);
180
+ case "metric_card": return d(e.config, t.data, n.data);
181
+ case "chart": return g(e.config, t.data, n.data);
182
+ default: return S(e.config, t.data, n.data);
170
183
  }
171
184
  }
172
- export { o as changeBetween, w as compareWidget, S as isCompareSupported };
185
+ export { s as changeBetween, T as compareWidget, C as isCompareSupported };
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ export interface CreateLinkedCopyDialogProps {
3
+ isOpen: boolean;
4
+ masterName: string;
5
+ busy: boolean;
6
+ /** The server's refusal, worded for the person, or null. */
7
+ error: string | null;
8
+ onClose: () => void;
9
+ onCreate: (name: string) => void | Promise<void>;
10
+ }
11
+ export declare const CreateLinkedCopyDialog: FC<CreateLinkedCopyDialogProps>;
12
+ export default CreateLinkedCopyDialog;
@@ -0,0 +1,61 @@
1
+ import { useTr as e } from "../../../shared/hooks/useTr.js";
2
+ import { memo as t, useEffect as n, useState as r } from "react";
3
+ import { Button as i, Input as a, ResponsiveDialog as o, ResponsiveDialogContent as s, ResponsiveDialogDescription as c, ResponsiveDialogFooter as l, ResponsiveDialogHeader as u, ResponsiveDialogTitle as d, Spinner as f } from "@burdenoff/fe-libs/ui";
4
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
5
+ // src/bigconsole/components/fleet/CreateLinkedCopyDialog.tsx
6
+ var h = t(function({ isOpen: t, masterName: h, busy: g, error: _, onClose: v, onCreate: y }) {
7
+ let b = e(), [x, S] = r("");
8
+ n(() => {
9
+ t && S(b("bigconsole.fleet.create.defaultName", "{{name}} (copy)", { name: h }));
10
+ }, [
11
+ t,
12
+ h,
13
+ b
14
+ ]);
15
+ let C = x.trim();
16
+ return /* @__PURE__ */ p(o, {
17
+ open: t,
18
+ onOpenChange: (e) => !e && !g && v(),
19
+ children: /* @__PURE__ */ p(s, { children: /* @__PURE__ */ m("form", {
20
+ onSubmit: (e) => {
21
+ e.preventDefault(), C && !g && y(C);
22
+ },
23
+ className: "flex flex-col gap-form-gap",
24
+ children: [
25
+ /* @__PURE__ */ m(u, { children: [/* @__PURE__ */ p(d, { children: b("bigconsole.fleet.create.title", "Create linked copy") }), /* @__PURE__ */ p(c, { children: b("bigconsole.fleet.create.description", "A new board that starts as a copy of \"{{name}}\" and keeps following it.", { name: h }) })] }),
26
+ /* @__PURE__ */ p(a, {
27
+ value: x,
28
+ onChange: (e) => S(e.target.value),
29
+ "aria-label": b("bigconsole.fleet.create.nameLabel", "Name of the new board"),
30
+ "data-testid": "fleet-create-name",
31
+ autoFocus: !0
32
+ }),
33
+ _ && /* @__PURE__ */ p("p", {
34
+ role: "alert",
35
+ "data-testid": "fleet-create-error",
36
+ style: {
37
+ color: "var(--color-status-error-text)",
38
+ margin: 0
39
+ },
40
+ children: _
41
+ }),
42
+ /* @__PURE__ */ m(l, { children: [/* @__PURE__ */ p(i, {
43
+ type: "button",
44
+ variant: "outline",
45
+ onClick: v,
46
+ disabled: g,
47
+ children: b("bigconsole.fleet.link.cancel", "Cancel")
48
+ }), /* @__PURE__ */ m(i, {
49
+ type: "submit",
50
+ disabled: !C || g,
51
+ "data-testid": "fleet-create-confirm",
52
+ children: [g && /* @__PURE__ */ p(f, { style: {
53
+ height: "var(--size-icon-sm)",
54
+ width: "var(--size-icon-sm)"
55
+ } }), b("bigconsole.fleet.create.confirm", "Create")]
56
+ })] })
57
+ ]
58
+ }) })
59
+ });
60
+ });
61
+ export { h as CreateLinkedCopyDialog, h as default };
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ export interface FleetChildrenPanelProps {
3
+ dashboardId: string;
4
+ dashboardName: string;
5
+ onClose: () => void;
6
+ onOpenBoard: (dashboardId: string) => void;
7
+ }
8
+ export declare const FleetChildrenPanel: FC<FleetChildrenPanelProps>;
9
+ export default FleetChildrenPanel;