@umriss-ui/calculation 0.34.0 → 0.36.0
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/CHANGELOG.md +19 -0
- package/README.md +5 -2
- package/dist/calculation.js +335 -338
- package/docs/llms-full.md +2 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,25 @@ From 0.34.0 all five packages share one number: they are released together, and
|
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
+
## 0.36.0 – No change of its own (Oct. 2026)
|
|
16
|
+
|
|
17
|
+
Needs `@umriss-ui/core` 0.36; the peer range is `^0.36.0`. No change of its
|
|
18
|
+
own.
|
|
19
|
+
|
|
20
|
+
## 0.35.0 – React 19 is the floor (Oct. 2026)
|
|
21
|
+
|
|
22
|
+
Needs `@umriss-ui/core` 0.35; the peer range is `^0.35.0`.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- **React 19 is required.** The peers `react` and `react-dom` are `>=19`; `0.34.0` is the last version that serves React 18.
|
|
27
|
+
|
|
28
|
+
- **The package ships ES2022 syntax.** An application that serves older browsers transpiles it itself.
|
|
29
|
+
|
|
30
|
+
No other change of its own.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
15
34
|
## 0.34.0 – One number for all five packages (Oct. 2026)
|
|
16
35
|
|
|
17
36
|
From this version all five packages carry one number and are released
|
package/README.md
CHANGED
|
@@ -15,8 +15,11 @@ pnpm add @umriss-ui/calculation @umriss-ui/core
|
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
`@umriss-ui/core` is a **peer dependency**: the calculation takes its styling
|
|
18
|
-
regime, formats, wording, assessment and freshness from there. React
|
|
19
|
-
as a peer as well
|
|
18
|
+
regime, formats, wording, assessment and freshness from there. React 19 or newer
|
|
19
|
+
as a peer as well.
|
|
20
|
+
|
|
21
|
+
The package ships ES2022 syntax; an application that serves older browsers
|
|
22
|
+
transpiles it itself.
|
|
20
23
|
|
|
21
24
|
Every entry begins with `"use client"`, the directive a framework
|
|
22
25
|
with Server Components reads to treat a module as client code. No test runs
|
package/dist/calculation.js
CHANGED
|
@@ -1,74 +1,73 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./calculation.css";
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { Children as ke, isValidElement as
|
|
5
|
-
import { assess as Ie, verdictWeight as
|
|
6
|
-
function We(
|
|
7
|
-
return
|
|
3
|
+
import { jsx as $, jsxs as E } from "react/jsx-runtime";
|
|
4
|
+
import { Children as ke, isValidElement as H, Fragment as Me, useId as Te, useState as re, useRef as Ee, useCallback as Ae, useLayoutEffect as Re, useEffect as De } from "react";
|
|
5
|
+
import { assess as Ie, verdictWeight as oe, useDensityFor as Pe, useFormats as Oe, useWording as Se, VisuallyHidden as je, AngleGlyph as Be, Badge as le, useFreshness as Le, Tooltip as Fe } from "@umriss-ui/core";
|
|
6
|
+
function We(e) {
|
|
7
|
+
return e.decimals !== void 0 ? e.decimals : e.format === "percent" ? 1 : e.given ? void 0 : 2;
|
|
8
8
|
}
|
|
9
|
-
function Ue(
|
|
10
|
-
return
|
|
9
|
+
function Ue(e, t) {
|
|
10
|
+
return t === void 0 ? e : Math.sign(e) * Number(Math.abs(e).toFixed(t)) || 0;
|
|
11
11
|
}
|
|
12
|
-
function ae(
|
|
13
|
-
return Ue(
|
|
12
|
+
function ae(e, t) {
|
|
13
|
+
return Ue(e.format === "percent" ? t * 100 : t, We(e));
|
|
14
14
|
}
|
|
15
|
-
const Qe = (
|
|
16
|
-
function be(
|
|
17
|
-
const [
|
|
18
|
-
switch (
|
|
15
|
+
const Qe = (e, t) => e.format === "percent" ? t / 100 : t;
|
|
16
|
+
function be(e, t, m) {
|
|
17
|
+
const [o, ...r] = t;
|
|
18
|
+
switch (e) {
|
|
19
19
|
case "sum":
|
|
20
|
-
return
|
|
20
|
+
return t.reduce((n, c, O) => m[O] ? n - c : n + c, 0);
|
|
21
21
|
case "difference":
|
|
22
|
-
return
|
|
22
|
+
return r.reduce((n, c) => n - c, o);
|
|
23
23
|
case "product":
|
|
24
|
-
return
|
|
24
|
+
return r.reduce((n, c) => n * c, o);
|
|
25
25
|
case "quotient":
|
|
26
|
-
return
|
|
26
|
+
return o / r[0];
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
const ge = (
|
|
30
|
-
function Ve(
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
let c = null, S, l = !1, y;
|
|
29
|
+
const ge = (e, t) => t === void 0 || e !== void 0 && oe(e) >= oe(t) ? e : t;
|
|
30
|
+
function Ve(e) {
|
|
31
|
+
const t = /* @__PURE__ */ new Map(), m = (o) => {
|
|
32
|
+
const r = t.get(o);
|
|
33
|
+
if (r) return r;
|
|
34
|
+
const n = e.quantities.get(o);
|
|
35
|
+
let c = null, O, l = !1, y;
|
|
37
36
|
if (n.given) {
|
|
38
37
|
const a = n.given.value;
|
|
39
|
-
typeof a == "number" && Number.isFinite(a) ? c = a :
|
|
38
|
+
typeof a == "number" && Number.isFinite(a) ? c = a : O = { kind: "missing", label: n.label };
|
|
40
39
|
} else {
|
|
41
|
-
const a = n.operands.map((
|
|
42
|
-
for (const { operand:
|
|
43
|
-
const
|
|
44
|
-
y = ge(y,
|
|
40
|
+
const a = n.operands.map((f) => ({ operand: f, ...m(f.key) }));
|
|
41
|
+
for (const { operand: f, verdict: i, worst: g } of a) {
|
|
42
|
+
const w = f.reference ? i : ge(i, g);
|
|
43
|
+
y = ge(y, w);
|
|
45
44
|
}
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
49
|
-
const
|
|
50
|
-
c = be(n.operator, a.map((
|
|
51
|
-
const
|
|
45
|
+
O = a.find((f) => f.absence)?.absence;
|
|
46
|
+
const u = a[1];
|
|
47
|
+
if (!O && n.operator === "quotient" && u.value === 0 && (O = { kind: "zero", label: e.quantities.get(u.operand.key).label }), !O) {
|
|
48
|
+
const f = n.operands.map((g) => g.negated === !0);
|
|
49
|
+
c = be(n.operator, a.map((g) => g.value), f);
|
|
50
|
+
const i = be(
|
|
52
51
|
n.operator,
|
|
53
|
-
a.map((
|
|
54
|
-
|
|
52
|
+
a.map((g) => Qe(e.quantities.get(g.operand.key), g.shown)),
|
|
53
|
+
f
|
|
55
54
|
);
|
|
56
|
-
l = ae(n,
|
|
55
|
+
l = ae(n, i) !== ae(n, c);
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
|
-
const
|
|
58
|
+
const T = { target: n.target, limits: n.limits }, B = n.target !== void 0 || (n.limits?.length ?? 0) > 0 ? Ie(c, T) : void 0, U = (n.limits?.length ?? 0) > 0 ? B.verdict : c === null ? "unknown" : void 0, L = {
|
|
60
59
|
value: c,
|
|
61
|
-
absence:
|
|
60
|
+
absence: O,
|
|
62
61
|
shown: c === null ? null : ae(n, c),
|
|
63
62
|
approximate: l,
|
|
64
|
-
assessment:
|
|
65
|
-
verdict:
|
|
63
|
+
assessment: B,
|
|
64
|
+
verdict: U,
|
|
66
65
|
worst: y
|
|
67
66
|
};
|
|
68
|
-
return
|
|
67
|
+
return t.set(o, L), L;
|
|
69
68
|
};
|
|
70
|
-
for (const
|
|
71
|
-
return
|
|
69
|
+
for (const o of e.quantities.keys()) m(o);
|
|
70
|
+
return t;
|
|
72
71
|
}
|
|
73
72
|
const ze = () => null, Ge = () => null, He = () => null, Ke = () => null, Ye = () => null, $e = () => null, Je = () => null, Ze = () => null, Xe = () => null, et = () => null, tt = () => null, ce = () => null, nt = /* @__PURE__ */ new Map([
|
|
74
73
|
[Ge, "sum"],
|
|
@@ -86,144 +85,144 @@ const ze = () => null, Ge = () => null, He = () => null, Ke = () => null, Ye = (
|
|
|
86
85
|
[et, { name: "Times", operator: "product" }],
|
|
87
86
|
[tt, { name: "DividedBy", operator: "quotient" }]
|
|
88
87
|
]), de = "<Given>, <Sum>, <Difference>, <Product>, <Quotient> or <Chain>", ye = "a calculation with metrics only adds and subtracts - <Sum>, <Difference>, <Plus>, <Minus>.", at = ["unit", "format", "decimals"];
|
|
89
|
-
function
|
|
90
|
-
throw new Error(`@umriss-ui/calculation: ${
|
|
88
|
+
function N(e) {
|
|
89
|
+
throw new Error(`@umriss-ui/calculation: ${e}`);
|
|
91
90
|
}
|
|
92
|
-
function ee(
|
|
93
|
-
return ke.toArray(
|
|
94
|
-
(
|
|
91
|
+
function ee(e) {
|
|
92
|
+
return ke.toArray(e).flatMap(
|
|
93
|
+
(t) => H(t) && t.type === Me ? ee(t.props.children) : [t]
|
|
95
94
|
);
|
|
96
95
|
}
|
|
97
|
-
function ne(
|
|
98
|
-
if (!
|
|
99
|
-
const
|
|
100
|
-
return typeof
|
|
96
|
+
function ne(e) {
|
|
97
|
+
if (!H(e)) return JSON.stringify(e);
|
|
98
|
+
const t = e.type;
|
|
99
|
+
return typeof t == "string" ? `<${t}>` : `<${t.displayName ?? t.name ?? "anonymous"}>`;
|
|
101
100
|
}
|
|
102
|
-
const fe = (
|
|
103
|
-
function
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
for (const { id: u } of
|
|
109
|
-
|
|
101
|
+
const fe = (e, t, m) => `${e}/${H(t) && t.key || m}`;
|
|
102
|
+
function st(e, t) {
|
|
103
|
+
const m = ee(e);
|
|
104
|
+
if (m.length !== 1 && N(`<Calculation> takes exactly one child, the result; it was given ${m.length}.`), t !== void 0) {
|
|
105
|
+
t.length === 0 && N("<Calculation>: metrics is empty; leave it out for a calculation with one number per quantity.");
|
|
106
|
+
const a = /* @__PURE__ */ new Set();
|
|
107
|
+
for (const { id: u } of t)
|
|
108
|
+
a.has(u) && N(`<Calculation>: the metric id "${u}" is used twice.`), a.add(u);
|
|
110
109
|
}
|
|
111
|
-
const
|
|
112
|
-
const
|
|
113
|
-
if (
|
|
114
|
-
|
|
110
|
+
const o = t?.map((a) => `"${a.id}"`).join(", "), r = (a, u) => {
|
|
111
|
+
const f = typeof a == "object" && a !== null;
|
|
112
|
+
if (t === void 0) {
|
|
113
|
+
f && N(`${u}: value is an object by metric, but the calculation has no metrics.`);
|
|
115
114
|
return;
|
|
116
115
|
}
|
|
117
|
-
|
|
118
|
-
for (const { id:
|
|
119
|
-
|
|
120
|
-
for (const
|
|
121
|
-
|
|
122
|
-
}, n = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(),
|
|
123
|
-
const { id:
|
|
124
|
-
if (
|
|
125
|
-
for (const
|
|
126
|
-
u[
|
|
127
|
-
(u.target !== void 0 || u.limits !== void 0) &&
|
|
116
|
+
f || N(`${u}: with metrics, value is an object with a number for each metric - ${o}.`);
|
|
117
|
+
for (const { id: i } of t)
|
|
118
|
+
i in a || N(`${u}: value has no number for the metric "${i}"; write null where it is absent. The metrics: ${o}.`);
|
|
119
|
+
for (const i of Object.keys(a))
|
|
120
|
+
t.some((g) => g.id === i) || N(`${u}: value has a number for "${i}", which is no metric. The metrics: ${o}.`);
|
|
121
|
+
}, n = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), O = [], l = (a, u, f) => {
|
|
122
|
+
const { id: i, ...g } = u;
|
|
123
|
+
if (t !== void 0) {
|
|
124
|
+
for (const A of at)
|
|
125
|
+
u[A] !== void 0 && N(`${f}: ${A} belongs to the metric once the calculation has metrics, not to a quantity.`);
|
|
126
|
+
(u.target !== void 0 || u.limits !== void 0) && N(`${f}: target and limits are not assessed in a calculation with metrics.`);
|
|
128
127
|
}
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
return n.set(
|
|
132
|
-
}, y = (
|
|
133
|
-
if (
|
|
134
|
-
const
|
|
135
|
-
return
|
|
128
|
+
i !== void 0 && (c.has(i) && N(`${f}: the id "${i}" is used twice.`), c.set(i, a));
|
|
129
|
+
const w = { ...g, key: a, id: i, operands: [] };
|
|
130
|
+
return n.set(a, w), w;
|
|
131
|
+
}, y = (a, u, f) => {
|
|
132
|
+
if (H(a) && a.type === $e) {
|
|
133
|
+
const i = { key: "", reference: !0 };
|
|
134
|
+
return O.push({ operand: i, to: a.props.to, where: f }), i;
|
|
136
135
|
}
|
|
137
|
-
return { key:
|
|
138
|
-
},
|
|
139
|
-
if ((!
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
`${
|
|
136
|
+
return { key: T(a, u, f), reference: !1 };
|
|
137
|
+
}, T = (a, u, f) => {
|
|
138
|
+
if ((!H(a) || a.type === $e || ue.has(a.type) || a.type === ce) && N(`${f}: ${ne(a)} cannot stand here; a quantity must be ${de}.`), a.type === Je) return B(a.props.children, u, f);
|
|
139
|
+
const i = nt.get(a.type);
|
|
140
|
+
a.type !== ze && i === void 0 && N(
|
|
141
|
+
`${f}: ${ne(a)} is not an element of the calculation. A calculation reads its children's props and cannot look inside a component of your own; write ${de} or <Ref> directly, or return them from .map.`
|
|
143
142
|
);
|
|
144
|
-
const { children:
|
|
145
|
-
|
|
146
|
-
const C = l(u,
|
|
147
|
-
if (
|
|
148
|
-
return
|
|
149
|
-
C.operator =
|
|
150
|
-
const _ = ee(
|
|
151
|
-
return (
|
|
152
|
-
`${b}: <${_e[
|
|
153
|
-
), C.operands = _.map((
|
|
154
|
-
},
|
|
155
|
-
const
|
|
156
|
-
(
|
|
157
|
-
let
|
|
158
|
-
return
|
|
143
|
+
const { children: g, value: w, source: A, asOf: Q, ages: k, ...R } = a.props, b = `${f} › ${R.label}`;
|
|
144
|
+
t !== void 0 && (i === "product" || i === "quotient") && N(`${b}: <${_e[i]}> - ${ye}`);
|
|
145
|
+
const C = l(u, R, b);
|
|
146
|
+
if (i === void 0)
|
|
147
|
+
return r(w, b), C.given = { value: w, source: A, asOf: Q, ages: k }, u;
|
|
148
|
+
C.operator = i;
|
|
149
|
+
const _ = ee(g), S = _.length;
|
|
150
|
+
return (i === "quotient" ? S !== 2 : i !== "sum" && S < 2) && N(
|
|
151
|
+
`${b}: <${_e[i]}> takes ${i === "quotient" ? "exactly two operands" : "two or more operands"}; it was given ${S}.`
|
|
152
|
+
), C.operands = _.map((s, d) => y(s, fe(u, s, d), b)), u;
|
|
153
|
+
}, B = (a, u, f) => {
|
|
154
|
+
const i = `${f} › <Chain>`, [g, ...w] = ee(a);
|
|
155
|
+
(g === void 0 || H(g) && (ue.has(g.type) || g.type === ce)) && N(`${i}: a chain starts with a quantity that has no operator - ${de} or <Ref>.`);
|
|
156
|
+
let A = y(g, fe(u, g, 0), i), Q = ne(g), k = [], R;
|
|
157
|
+
return w.forEach((b, C) => {
|
|
159
158
|
const _ = fe(u, b, C + 1);
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
|
|
159
|
+
if (H(b) && b.type === ce) {
|
|
160
|
+
const W = b.props, z = `${i} › ${W.label}`;
|
|
161
|
+
k.length === 0 && N(`${z}: an <Interim> needs an operand since the named value before it, ${Q}.`);
|
|
162
|
+
const G = l(_, W, z);
|
|
163
|
+
G.interim = !0, G.operator = k[0].line.operator, G.operands = [A, ...k.map((te) => te.operand)], A = { key: _, reference: !1, previous: !0 }, Q = `<Interim label="${W.label}">`, k = [], R = _;
|
|
165
164
|
return;
|
|
166
165
|
}
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
(
|
|
171
|
-
`${
|
|
166
|
+
const S = H(b) ? ue.get(b.type) : void 0;
|
|
167
|
+
S === void 0 && N(`${i}: ${ne(b)} needs an operator in a chain - <Plus>, <Minus>, <Times> or <DividedBy> - or is an <Interim>.`), t !== void 0 && S.operator !== "sum" && N(`${i}: <${S.name}> - ${ye}`);
|
|
168
|
+
const s = S.operator !== "sum", d = k.find((W) => W.line.operator !== "sum");
|
|
169
|
+
(s && k.length > 0 || d) && N(
|
|
170
|
+
`${i}: <${(d ?? { line: S }).line.name}> stands alone between two named values - directly after the first quantity or an <Interim>, and directly before an <Interim>.`
|
|
172
171
|
);
|
|
173
|
-
const { children:
|
|
174
|
-
if (
|
|
175
|
-
(
|
|
176
|
-
const
|
|
177
|
-
|
|
172
|
+
const { children: v, ...q } = b.props, p = ee(v), D = () => N(`${i}: <${S.name}> takes either a label and a value, or exactly one quantity as its child.`);
|
|
173
|
+
if (p.length > 0) {
|
|
174
|
+
(p.length > 1 || Object.values(q).some((z) => z !== void 0)) && D();
|
|
175
|
+
const W = y(p[0], _, i);
|
|
176
|
+
W.negated = S.negated, k.push({ operand: W, line: S });
|
|
178
177
|
return;
|
|
179
178
|
}
|
|
180
|
-
|
|
181
|
-
const { value:
|
|
182
|
-
|
|
183
|
-
}), (
|
|
184
|
-
},
|
|
185
|
-
(
|
|
186
|
-
for (const { operand:
|
|
187
|
-
const
|
|
188
|
-
if (
|
|
189
|
-
const
|
|
190
|
-
|
|
179
|
+
q.label === void 0 && D();
|
|
180
|
+
const { value: I, source: M, asOf: P, ages: K, ...V } = q, j = `${i} › ${q.label}`, F = l(_, { ...V, label: q.label }, j);
|
|
181
|
+
r(I, j), F.given = { value: I, source: M, asOf: P, ages: K }, k.push({ operand: { key: _, reference: !1, negated: S.negated }, line: S });
|
|
182
|
+
}), (k.length > 0 || R === void 0) && N(`${i}: a chain ends with an <Interim>, which names its value.`), R;
|
|
183
|
+
}, U = T(m[0], "0", "<Calculation>"), L = n.get(U);
|
|
184
|
+
(L.emphasis !== void 0 || L.rule !== void 0) && N(`<Calculation> › ${L.label}: emphasis and rule do not stand on the Result, which is already the heaviest line.`);
|
|
185
|
+
for (const { operand: a, to: u, where: f } of O) {
|
|
186
|
+
const i = c.get(u);
|
|
187
|
+
if (i === void 0) {
|
|
188
|
+
const g = [...c.keys()].map((w) => `"${w}"`).join(", ");
|
|
189
|
+
N(`${f}: <Ref to="${u}"> names no quantity. ${g ? `The ids that exist: ${g}.` : "No quantity has an id."}`);
|
|
191
190
|
}
|
|
192
|
-
|
|
191
|
+
a.key = i;
|
|
193
192
|
}
|
|
194
|
-
return it(n), { result:
|
|
193
|
+
return it(n), { result: U, quantities: n, metrics: t };
|
|
195
194
|
}
|
|
196
|
-
function
|
|
197
|
-
return
|
|
198
|
-
const
|
|
199
|
-
for (const [
|
|
200
|
-
const n =
|
|
201
|
-
|
|
195
|
+
function ot(e) {
|
|
196
|
+
return e.metrics ? e.metrics.map((t) => {
|
|
197
|
+
const m = /* @__PURE__ */ new Map();
|
|
198
|
+
for (const [o, r] of e.quantities) {
|
|
199
|
+
const n = r.given && { ...r.given, value: r.given.value[t.id] };
|
|
200
|
+
m.set(o, { ...r, unit: t.unit, decimals: t.decimals, given: n });
|
|
202
201
|
}
|
|
203
|
-
return { result:
|
|
204
|
-
}) : [
|
|
202
|
+
return { result: e.result, quantities: m };
|
|
203
|
+
}) : [e];
|
|
205
204
|
}
|
|
206
|
-
function it(
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
209
|
-
const n =
|
|
205
|
+
function it(e) {
|
|
206
|
+
const t = /* @__PURE__ */ new Set(), m = [], o = (r) => {
|
|
207
|
+
if (t.has(r)) return;
|
|
208
|
+
const n = m.indexOf(r);
|
|
210
209
|
if (n !== -1) {
|
|
211
|
-
const c = [...
|
|
212
|
-
|
|
210
|
+
const c = [...m.slice(n), r].map((O) => e.get(O).label);
|
|
211
|
+
N(`the calculation goes round in a circle through references: ${c.join(" → ")}.`);
|
|
213
212
|
}
|
|
214
|
-
|
|
215
|
-
for (const c of
|
|
216
|
-
|
|
213
|
+
m.push(r);
|
|
214
|
+
for (const c of e.get(r).operands) o(c.key);
|
|
215
|
+
m.pop(), t.add(r);
|
|
217
216
|
};
|
|
218
|
-
for (const
|
|
217
|
+
for (const r of e.keys()) o(r);
|
|
219
218
|
}
|
|
220
219
|
const we = 4;
|
|
221
|
-
function rt(
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
224
|
-
const
|
|
225
|
-
if (
|
|
226
|
-
const c =
|
|
220
|
+
function rt(e, t, m) {
|
|
221
|
+
const o = e.operands[t];
|
|
222
|
+
if (o.previous) return;
|
|
223
|
+
const r = e.operator, n = t === 0;
|
|
224
|
+
if (r !== "sum" && r !== "difference") return n ? void 0 : { operator: r, negated: !1 };
|
|
225
|
+
const c = r === "difference" ? !n : o.negated === !0, O = new Set(m.filter((y) => y !== null && y !== 0).map(Math.sign)), l = O.size === 1 ? { operator: "sum", negated: c !== O.has(-1), unsigned: !0 } : { operator: "sum", negated: c };
|
|
227
226
|
return n && !l.negated ? void 0 : l;
|
|
228
227
|
}
|
|
229
228
|
const lt = {
|
|
@@ -237,68 +236,67 @@ const lt = {
|
|
|
237
236
|
product: "calculationProductWord",
|
|
238
237
|
quotient: "calculationQuotientWord"
|
|
239
238
|
};
|
|
240
|
-
function
|
|
241
|
-
switch (
|
|
239
|
+
function se(e, t) {
|
|
240
|
+
switch (e) {
|
|
242
241
|
case "alarm":
|
|
243
|
-
return
|
|
242
|
+
return t.verdictAlarm;
|
|
244
243
|
case "warning":
|
|
245
|
-
return
|
|
244
|
+
return t.verdictWarning;
|
|
246
245
|
case "unknown":
|
|
247
|
-
return
|
|
246
|
+
return t.verdictUnknown;
|
|
248
247
|
default:
|
|
249
|
-
return
|
|
248
|
+
return t.verdictOk;
|
|
250
249
|
}
|
|
251
250
|
}
|
|
252
|
-
function ie(
|
|
253
|
-
const
|
|
254
|
-
return
|
|
251
|
+
function ie(e, t, m) {
|
|
252
|
+
const o = e.negated ? "difference" : e.operator;
|
|
253
|
+
return m[(t ? ct : lt)[o]];
|
|
255
254
|
}
|
|
256
|
-
function ut(
|
|
257
|
-
return
|
|
255
|
+
function ut(e, t) {
|
|
256
|
+
return e.kind === "missing" ? t.calculationMissing(e.label) : t.calculationDivisionByZero(e.label);
|
|
258
257
|
}
|
|
259
|
-
function Ne(
|
|
260
|
-
const
|
|
261
|
-
return
|
|
258
|
+
function Ne(e, t, m, o) {
|
|
259
|
+
const r = e.format === "percent" ? o : e.unit, n = m.number(t, e.decimals);
|
|
260
|
+
return r ? `${n} ${r}` : n;
|
|
262
261
|
}
|
|
263
|
-
function dt(
|
|
262
|
+
function dt(e, t, m, o, r, n, c, O = () => {
|
|
264
263
|
}) {
|
|
265
|
-
const l =
|
|
266
|
-
const
|
|
267
|
-
return
|
|
268
|
-
},
|
|
269
|
-
if (
|
|
264
|
+
const l = e.quantities.get(m), y = t.get(m), T = (b, C) => b.shown !== null && C?.unsigned ? Math.abs(b.shown) : b.shown, B = (b, C, _, S) => {
|
|
265
|
+
const s = T(C, S);
|
|
266
|
+
return s === null ? _ ? n.verdictUnknown : n.statAbsentValue : Ne(b, s, r, _ ? n.calculationPercent : "%");
|
|
267
|
+
}, U = (b) => {
|
|
268
|
+
if (o || !l.operator) return {};
|
|
270
269
|
if (l.operands.length === 0) return { names: n.calculationNoOperands };
|
|
271
270
|
if (!b && l.operands.length > we)
|
|
272
271
|
return { names: n.calculationOperandCount(l.operands.length) };
|
|
273
|
-
const C = (_) => l.operands.map((
|
|
274
|
-
const d =
|
|
275
|
-
return
|
|
272
|
+
const C = (_) => l.operands.map((S, s) => {
|
|
273
|
+
const d = e.quantities.get(S.key), v = O(s);
|
|
274
|
+
return v ? `${ie(v, b, n)} ${_(d, v)}` : _(d);
|
|
276
275
|
}).join(" ");
|
|
277
276
|
return {
|
|
278
277
|
names: C((_) => _.label),
|
|
279
|
-
numbers: C((_,
|
|
278
|
+
numbers: C((_, S) => B(_, t.get(_.key), b, S))
|
|
280
279
|
};
|
|
281
|
-
},
|
|
282
|
-
|
|
283
|
-
const C = (N = y.assessment) == null ? void 0 : N.deviation;
|
|
280
|
+
}, L = (b) => {
|
|
281
|
+
const C = y.assessment?.deviation;
|
|
284
282
|
if (C === void 0 || l.target === void 0) return;
|
|
285
|
-
const _ = Ne(l, ae(l, l.target),
|
|
283
|
+
const _ = Ne(l, ae(l, l.target), r, b ? n.calculationPercent : "%");
|
|
286
284
|
return C > 0 ? n.calculationAboveTarget(_) : C < 0 ? n.calculationBelowTarget(_) : n.calculationOnTarget(_);
|
|
287
|
-
},
|
|
288
|
-
(c ? `${ie(c, !0, n)} ` : "") + l.label +
|
|
289
|
-
y.verdict !== void 0 && y.verdict !== "unknown" ?
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
].filter(Boolean).join(", "),
|
|
293
|
-
return { amount:
|
|
285
|
+
}, a = U(!1).names, u = a === void 0 || l.operands.length === 0 || l.operands.length > we ? a : `= ${a}`, f = U(!0), i = y.absence ? ut(y.absence, n) : void 0, g = ` ${n.calculationEquals} `, w = y.approximate ? `${n.calculationApproximately} ${B(l, y, !0, c)}` : B(l, y, !0, c), Q = [
|
|
286
|
+
(c ? `${ie(c, !0, n)} ` : "") + l.label + g + [f.names, f.numbers, w].filter(Boolean).join(`,${g}`),
|
|
287
|
+
y.verdict !== void 0 && y.verdict !== "unknown" ? se(y.verdict, n) : void 0,
|
|
288
|
+
L(!0),
|
|
289
|
+
i
|
|
290
|
+
].filter(Boolean).join(", "), k = y.shown === null ? void 0 : l.format === "percent" ? "%" : l.unit, R = (b) => b === null ? n.statAbsentValue : r.number(b, l.decimals);
|
|
291
|
+
return { amount: R(T(y, c)), ownAmount: R(y.shown), unit: k, names: u, target: L(!1), reason: i, sentence: Q, spokenNames: f.names, spokenNumber: w };
|
|
294
292
|
}
|
|
295
|
-
function ft(
|
|
296
|
-
const n =
|
|
297
|
-
(y,
|
|
293
|
+
function ft(e, t, m, o, r) {
|
|
294
|
+
const n = r ? `${ie(r, !0, o)} ` : "", c = t[0].spokenNames, O = n + e + (c === void 0 ? "" : ` ${o.calculationEquals} ${c}`), l = m.map(
|
|
295
|
+
(y, T) => [`${y.label} ${t[T].spokenNumber}`, t[T].reason].filter(Boolean).join(", ")
|
|
298
296
|
);
|
|
299
|
-
return `${
|
|
297
|
+
return `${O}: ${l.join("; ")}`;
|
|
300
298
|
}
|
|
301
|
-
const pt = "_frame_abb5t_24 _text_18806_22", mt = "_calculation_abb5t_51", ht = "_line_abb5t_86", vt = "_assessment_abb5t_98", bt = "_disclosure_abb5t_107", gt = "_amount_abb5t_90", $t = "_list_abb5t_128", _t = "_item_abb5t_129", yt = "_derivation_abb5t_130", wt = "_labelCell_abb5t_90", Nt = "_names_abb5t_90", Ot = "_operator_abb5t_90", St = "_unit_abb5t_90", Ct = "_label_abb5t_90", qt = "_approximate_abb5t_345", xt = "_target_abb5t_102", kt = "_worst_abb5t_102", Mt = "_head_abb5t_497", Tt = "_headCell_abb5t_504", Et = "_headUnit_abb5t_517", At = "_notes_abb5t_524", Rt = "_freshness_abb5t_538", Dt = "_headLabel_abb5t_568",
|
|
299
|
+
const pt = "_frame_abb5t_24 _text_18806_22", mt = "_calculation_abb5t_51", ht = "_line_abb5t_86", vt = "_assessment_abb5t_98", bt = "_disclosure_abb5t_107", gt = "_amount_abb5t_90", $t = "_list_abb5t_128", _t = "_item_abb5t_129", yt = "_derivation_abb5t_130", wt = "_labelCell_abb5t_90", Nt = "_names_abb5t_90", Ot = "_operator_abb5t_90", St = "_unit_abb5t_90", Ct = "_label_abb5t_90", qt = "_approximate_abb5t_345", xt = "_target_abb5t_102", kt = "_worst_abb5t_102", Mt = "_head_abb5t_497", Tt = "_headCell_abb5t_504", Et = "_headUnit_abb5t_517", At = "_notes_abb5t_524", Rt = "_freshness_abb5t_538", Dt = "_headLabel_abb5t_568", h = {
|
|
302
300
|
frame: pt,
|
|
303
301
|
calculation: mt,
|
|
304
302
|
line: ht,
|
|
@@ -322,222 +320,221 @@ const pt = "_frame_abb5t_24 _text_18806_22", mt = "_calculation_abb5t_51", ht =
|
|
|
322
320
|
notes: At,
|
|
323
321
|
freshness: Rt,
|
|
324
322
|
headLabel: Dt
|
|
325
|
-
}, It = 10, X = (
|
|
326
|
-
function Lt({ asOf:
|
|
327
|
-
const
|
|
328
|
-
return /* @__PURE__ */
|
|
323
|
+
}, It = 10, X = (e) => 4 + 2 * e, Pt = (e) => 5 + 2 * e, jt = { ok: "success", unknown: "neutral", warning: "warning", alarm: "danger" }, Bt = (...e) => e.filter(Boolean).join(" ");
|
|
324
|
+
function Lt({ asOf: e, ages: t }) {
|
|
325
|
+
const m = Oe(), o = Se(), r = Le(e, t), n = r.freshness === "lost" ? o.freshnessDisconnected : r.freshness === "stale" ? o.freshnessStale : o.freshnessFresh;
|
|
326
|
+
return /* @__PURE__ */ E("span", { className: h.freshness, "data-freshness": r.freshness, children: [
|
|
329
327
|
n,
|
|
330
|
-
|
|
328
|
+
r.age !== null && ` · ${m.relative(r.age)}`
|
|
331
329
|
] });
|
|
332
330
|
}
|
|
333
|
-
function Qt({ children:
|
|
334
|
-
const c = Pe(
|
|
335
|
-
const
|
|
336
|
-
if (!
|
|
337
|
-
|
|
331
|
+
function Qt({ children: e, className: t, style: m, metrics: o, density: r, ...n }) {
|
|
332
|
+
const c = Pe(r, "regular") === "compact", O = Oe(), l = Se(), y = Te(), T = st(e, o), B = ot(T).map((s) => ({ view: s, results: Ve(s) })), [U, L] = re(() => /* @__PURE__ */ new Set()), [a, u] = re(null), f = Ee(null), [i, g] = re(!1), w = o?.length ?? 0, A = Ae(() => {
|
|
333
|
+
const s = f.current, d = s && w > 0 ? getComputedStyle(s.firstElementChild).gridTemplateColumns.split(" ").map(parseFloat) : [], v = X(w) - 1;
|
|
334
|
+
if (!s || d.length <= v || d.some((M) => !Number.isFinite(M))) {
|
|
335
|
+
g(!1);
|
|
338
336
|
return;
|
|
339
337
|
}
|
|
340
|
-
const
|
|
341
|
-
let
|
|
342
|
-
const
|
|
343
|
-
for (const
|
|
344
|
-
|
|
345
|
-
const
|
|
346
|
-
if (
|
|
347
|
-
const
|
|
348
|
-
|
|
338
|
+
const q = d.slice(2, v).reduce((M, P) => M + P, 0);
|
|
339
|
+
let p = 0;
|
|
340
|
+
const D = document.createRange();
|
|
341
|
+
for (const M of s.querySelectorAll(`.${h.label}`)) {
|
|
342
|
+
D.selectNodeContents(M);
|
|
343
|
+
const P = [...D.getClientRects()].reduce((j, F) => j + F.width, 0);
|
|
344
|
+
if (P === 0) continue;
|
|
345
|
+
const K = M.parentElement, V = M.getBoundingClientRect().left - K.getBoundingClientRect().left;
|
|
346
|
+
p = Math.max(p, V + P + parseFloat(getComputedStyle(K).paddingRight));
|
|
349
347
|
}
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
}, [
|
|
353
|
-
Re(() =>
|
|
354
|
-
const
|
|
355
|
-
if (!
|
|
356
|
-
const d = new ResizeObserver(() =>
|
|
357
|
-
return d.observe(
|
|
358
|
-
}, [
|
|
359
|
-
const
|
|
360
|
-
const
|
|
361
|
-
return
|
|
362
|
-
}),
|
|
363
|
-
|
|
348
|
+
const I = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
349
|
+
g(s.clientWidth - q < Math.min(p, It * I));
|
|
350
|
+
}, [w]);
|
|
351
|
+
Re(() => A()), De(() => {
|
|
352
|
+
const s = f.current;
|
|
353
|
+
if (!s || w === 0) return;
|
|
354
|
+
const d = new ResizeObserver(() => A());
|
|
355
|
+
return d.observe(s), () => d.disconnect();
|
|
356
|
+
}, [A, w]);
|
|
357
|
+
const Q = (s) => L((d) => {
|
|
358
|
+
const v = new Set(d);
|
|
359
|
+
return v.delete(s) || v.add(s), v;
|
|
360
|
+
}), k = (s, d) => rt(
|
|
361
|
+
s,
|
|
364
362
|
d,
|
|
365
|
-
|
|
363
|
+
B.map(({ results: v }) => v.get(s.operands[d].key).shown)
|
|
366
364
|
);
|
|
367
|
-
let
|
|
368
|
-
const b = (
|
|
369
|
-
/* @__PURE__ */
|
|
365
|
+
let R = !1;
|
|
366
|
+
const b = (s, d) => s.map(({ own: v, text: q }, p) => [
|
|
367
|
+
/* @__PURE__ */ E(
|
|
370
368
|
"span",
|
|
371
369
|
{
|
|
372
|
-
className:
|
|
370
|
+
className: h.amount,
|
|
373
371
|
"aria-hidden": "true",
|
|
374
|
-
"data-verdict":
|
|
375
|
-
"data-later":
|
|
376
|
-
style:
|
|
372
|
+
"data-verdict": v.verdict,
|
|
373
|
+
"data-later": p > 0 ? "" : void 0,
|
|
374
|
+
style: o ? { "--column": X(p) } : void 0,
|
|
377
375
|
children: [
|
|
378
|
-
|
|
379
|
-
d ?
|
|
376
|
+
v.approximate && /* @__PURE__ */ $(Fe, { content: l.calculationApproximateNote, children: /* @__PURE__ */ $("span", { className: h.approximate, children: "≈" }) }),
|
|
377
|
+
d ? q.ownAmount : q.amount
|
|
380
378
|
]
|
|
381
379
|
},
|
|
382
|
-
`amount-${
|
|
380
|
+
`amount-${p}`
|
|
383
381
|
),
|
|
384
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ $(
|
|
385
383
|
"span",
|
|
386
384
|
{
|
|
387
|
-
className:
|
|
385
|
+
className: h.unit,
|
|
388
386
|
"aria-hidden": "true",
|
|
389
|
-
style:
|
|
390
|
-
"data-last":
|
|
391
|
-
children:
|
|
387
|
+
style: o ? { "--column": Pt(p) } : void 0,
|
|
388
|
+
"data-last": o && p === s.length - 1 ? "" : void 0,
|
|
389
|
+
children: o && !d ? void 0 : q.unit
|
|
392
390
|
},
|
|
393
|
-
`unit-${
|
|
391
|
+
`unit-${p}`
|
|
394
392
|
)
|
|
395
|
-
]), C = (
|
|
396
|
-
const
|
|
397
|
-
own: J.get(
|
|
398
|
-
text: dt(
|
|
399
|
-
})), { own:
|
|
400
|
-
|
|
401
|
-
const
|
|
402
|
-
(
|
|
403
|
-
) : [], Z =
|
|
404
|
-
!d &&
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
!d &&
|
|
408
|
-
].filter(Boolean), he =
|
|
393
|
+
]), C = (s, d) => a === null ? void 0 : s === a ? "use" : d === a ? "operand" : void 0, _ = (s, d, v, q) => {
|
|
394
|
+
const p = T.quantities.get(s), D = B.map(({ view: x, results: J }) => ({
|
|
395
|
+
own: J.get(s),
|
|
396
|
+
text: dt(x, J, s, d, O, l, v.position, (xe) => k(p, xe))
|
|
397
|
+
})), { own: I, text: M } = D[0], P = p.operator !== void 0 && !d, K = s === T.result && !d, V = P && p.operands.length > 0 && (p.interim ? v.flat : K), j = P && !V && p.operands.length > 0, F = j && U.has(s);
|
|
398
|
+
R ||= j;
|
|
399
|
+
const W = `${y}-${s}`, z = { depth: V ? v.depth : v.depth + 1, flat: !1, parent: s }, G = P ? p.operands.find((x) => x.previous) : void 0, te = G && v.flat ? _(G.key, !1, { ...v, parent: s, position: void 0 }, `${q}-c`) : [], Ce = G && !v.flat ? _(G.key, !1, { ...z, flat: !0 }, `${q}-c`) : [], pe = P ? p.operands.map(
|
|
400
|
+
(x, J) => x.previous ? null : _(x.key, x.reference, { ...z, position: k(p, J) }, `${q}-${J}`)
|
|
401
|
+
) : [], Z = j && !F && I.worst !== void 0 && oe(I.worst) > oe(I.verdict ?? "ok") ? I.worst : void 0, Y = d ? void 0 : p.given, qe = v.position ? ie(v.position, !1, l) : void 0, me = [
|
|
402
|
+
!d && p.explanation !== void 0 && /* @__PURE__ */ $("span", { children: p.explanation }, "explanation"),
|
|
403
|
+
Y?.source !== void 0 && /* @__PURE__ */ $("span", { children: l.calculationSource(Y.source) }, "source"),
|
|
404
|
+
Y?.asOf !== void 0 && (Y.ages !== void 0 ? /* @__PURE__ */ $(Lt, { asOf: Y.asOf, ages: Y.ages }, "asOf") : /* @__PURE__ */ $("span", { children: l.asOfAgo(O.dateTime(new Date(Y.asOf), !1)) }, "asOf")),
|
|
405
|
+
!d && p.aside !== void 0 && /* @__PURE__ */ $("span", { children: p.aside }, "aside")
|
|
406
|
+
].filter(Boolean), he = K ? "result" : p.interim && !d && v.flat ? "interim" : void 0, ve = /* @__PURE__ */ E(
|
|
409
407
|
"div",
|
|
410
408
|
{
|
|
411
|
-
className:
|
|
412
|
-
style: { "--depth":
|
|
413
|
-
"data-inner":
|
|
409
|
+
className: h.line,
|
|
410
|
+
style: { "--depth": v.depth },
|
|
411
|
+
"data-inner": v.depth > 0 ? "" : void 0,
|
|
414
412
|
"data-kind": he,
|
|
415
|
-
"data-foldable":
|
|
413
|
+
"data-foldable": j ? "" : void 0,
|
|
416
414
|
"data-reference": d ? "" : void 0,
|
|
417
|
-
"data-emphasis": d ? void 0 :
|
|
418
|
-
"data-rule": !d &&
|
|
419
|
-
"data-mark": C(
|
|
420
|
-
onPointerEnter: () => u(
|
|
415
|
+
"data-emphasis": d ? void 0 : p.emphasis,
|
|
416
|
+
"data-rule": !d && p.rule ? "" : void 0,
|
|
417
|
+
"data-mark": C(s, v.parent),
|
|
418
|
+
onPointerEnter: () => u(s),
|
|
421
419
|
onPointerLeave: () => u(null),
|
|
422
|
-
onFocus: () => u(
|
|
420
|
+
onFocus: () => u(s),
|
|
423
421
|
onBlur: () => u(null),
|
|
424
|
-
onClick:
|
|
425
|
-
|
|
426
|
-
(q = window.getSelection()) != null && q.toString() || M(o);
|
|
422
|
+
onClick: j ? () => {
|
|
423
|
+
window.getSelection()?.toString() || Q(s);
|
|
427
424
|
} : void 0,
|
|
428
425
|
children: [
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
Z !== void 0 && l.calculationWorstInside(
|
|
426
|
+
/* @__PURE__ */ $(je, { children: [
|
|
427
|
+
o ? ft(p.label, D.map((x) => x.text), o, l, v.position) : M.sentence,
|
|
428
|
+
D.some((x) => x.own.approximate) && l.calculationApproximateNote,
|
|
429
|
+
Z !== void 0 && l.calculationWorstInside(se(Z, l))
|
|
433
430
|
].filter(Boolean).join(". ") }),
|
|
434
|
-
/* @__PURE__ */
|
|
435
|
-
|
|
431
|
+
/* @__PURE__ */ E("span", { className: h.labelCell, children: [
|
|
432
|
+
j ? /* @__PURE__ */ $(
|
|
436
433
|
"button",
|
|
437
434
|
{
|
|
438
435
|
type: "button",
|
|
439
|
-
className:
|
|
440
|
-
"aria-expanded":
|
|
441
|
-
"aria-controls":
|
|
442
|
-
"aria-label": (
|
|
443
|
-
children: /* @__PURE__ */
|
|
436
|
+
className: h.disclosure,
|
|
437
|
+
"aria-expanded": F,
|
|
438
|
+
"aria-controls": W,
|
|
439
|
+
"aria-label": (F ? l.calculationHideDerivation : l.calculationShowDerivation)(p.label),
|
|
440
|
+
children: /* @__PURE__ */ $(Be, { "data-open": F ? "" : void 0 })
|
|
444
441
|
}
|
|
445
|
-
) : /* @__PURE__ */
|
|
446
|
-
/* @__PURE__ */
|
|
442
|
+
) : /* @__PURE__ */ $("span", { className: h.disclosure, "aria-hidden": "true" }),
|
|
443
|
+
/* @__PURE__ */ $("span", { className: h.label, "aria-hidden": "true", children: p.label })
|
|
447
444
|
] }),
|
|
448
|
-
/* @__PURE__ */
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
-
b(
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
-
|
|
445
|
+
/* @__PURE__ */ $("span", { className: h.names, "aria-hidden": "true", children: P && !V && !F ? M.names : void 0 }),
|
|
446
|
+
/* @__PURE__ */ $("span", { className: h.operator, "aria-hidden": "true", children: qe }),
|
|
447
|
+
b(D, he !== void 0),
|
|
448
|
+
/* @__PURE__ */ E("span", { className: h.assessment, "aria-hidden": "true", children: [
|
|
449
|
+
o ? (
|
|
453
450
|
/* Short: which metric. The sentence carries the full reason. */
|
|
454
|
-
|
|
455
|
-
(
|
|
451
|
+
o.map(
|
|
452
|
+
(x, J) => D[J].own.absence && /* @__PURE__ */ $(le, { children: l.calculationMissing(x.unit ?? x.label) }, x.id)
|
|
456
453
|
)
|
|
457
|
-
) :
|
|
458
|
-
|
|
459
|
-
Z !== void 0 && /* @__PURE__ */
|
|
454
|
+
) : M.reason !== void 0 ? /* @__PURE__ */ $(le, { children: M.reason }) : I.verdict !== void 0 && /* @__PURE__ */ $(le, { tone: jt[I.verdict], children: se(I.verdict, l) }),
|
|
455
|
+
M.target !== void 0 && /* @__PURE__ */ $("span", { className: h.target, children: M.target }),
|
|
456
|
+
Z !== void 0 && /* @__PURE__ */ $("span", { className: h.worst, "data-verdict": Z, children: l.calculationWorstInside(se(Z, l)) })
|
|
460
457
|
] }),
|
|
461
458
|
me.length > 0 && /* A click here - on a link in the aside, on a sparkline - is the
|
|
462
459
|
caller's, not a fold. */
|
|
463
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ $("span", { className: h.notes, onClick: (x) => x.stopPropagation(), children: me })
|
|
464
461
|
]
|
|
465
462
|
}
|
|
466
463
|
);
|
|
467
|
-
return
|
|
464
|
+
return V ? [
|
|
468
465
|
...te,
|
|
469
|
-
/* @__PURE__ */
|
|
470
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ E("li", { className: h.item, children: [
|
|
467
|
+
/* @__PURE__ */ $("ul", { className: h.list, children: pe }),
|
|
471
468
|
ve
|
|
472
|
-
] },
|
|
469
|
+
] }, q)
|
|
473
470
|
] : [
|
|
474
471
|
...te,
|
|
475
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ E("li", { className: h.item, "data-open": F ? "" : void 0, style: { "--depth": v.depth }, children: [
|
|
476
473
|
ve,
|
|
477
|
-
|
|
474
|
+
j && /* @__PURE__ */ E("ul", { id: W, className: h.derivation, hidden: !F, children: [
|
|
478
475
|
Ce,
|
|
479
476
|
pe,
|
|
480
|
-
/* @__PURE__ */
|
|
477
|
+
/* @__PURE__ */ $("li", { className: h.item, "aria-hidden": "true", children: /* @__PURE__ */ E(
|
|
481
478
|
"div",
|
|
482
479
|
{
|
|
483
|
-
className:
|
|
484
|
-
style: { "--depth":
|
|
480
|
+
className: h.line,
|
|
481
|
+
style: { "--depth": z.depth },
|
|
485
482
|
"data-inner": "",
|
|
486
483
|
"data-closing": "",
|
|
487
|
-
"data-mark":
|
|
484
|
+
"data-mark": a === s ? "use" : void 0,
|
|
488
485
|
children: [
|
|
489
|
-
/* @__PURE__ */
|
|
490
|
-
/* @__PURE__ */
|
|
491
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ E("span", { className: h.labelCell, children: [
|
|
487
|
+
/* @__PURE__ */ $("span", { className: h.disclosure }),
|
|
488
|
+
/* @__PURE__ */ E("span", { className: h.label, children: [
|
|
492
489
|
"= ",
|
|
493
|
-
|
|
490
|
+
p.label
|
|
494
491
|
] })
|
|
495
492
|
] }),
|
|
496
|
-
/* @__PURE__ */
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
b(
|
|
493
|
+
/* @__PURE__ */ $("span", { className: h.names }),
|
|
494
|
+
/* @__PURE__ */ $("span", { className: h.operator }),
|
|
495
|
+
b(D, !0)
|
|
499
496
|
]
|
|
500
497
|
}
|
|
501
498
|
) })
|
|
502
499
|
] })
|
|
503
|
-
] },
|
|
500
|
+
] }, q)
|
|
504
501
|
];
|
|
505
|
-
},
|
|
502
|
+
}, S = _(T.result, !1, { depth: 0, flat: !0, parent: null }, "r");
|
|
506
503
|
return (
|
|
507
504
|
/* The frame is the surface and the container the layout measures itself
|
|
508
505
|
against; the list inside it is the statement. */
|
|
509
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ $(
|
|
510
507
|
"div",
|
|
511
508
|
{
|
|
512
|
-
ref:
|
|
513
|
-
className: Bt(
|
|
514
|
-
style:
|
|
515
|
-
"--figure-tracks": Array(
|
|
516
|
-
"--figures-end": X(
|
|
517
|
-
"--assessment-column": X(
|
|
518
|
-
...
|
|
519
|
-
} :
|
|
520
|
-
"data-still":
|
|
521
|
-
"data-metrics":
|
|
522
|
-
"data-two-lines":
|
|
509
|
+
ref: f,
|
|
510
|
+
className: Bt(h.frame, t),
|
|
511
|
+
style: o ? {
|
|
512
|
+
"--figure-tracks": Array(w * 2).fill("auto").join(" "),
|
|
513
|
+
"--figures-end": X(w),
|
|
514
|
+
"--assessment-column": X(w),
|
|
515
|
+
...m
|
|
516
|
+
} : m,
|
|
517
|
+
"data-still": R ? void 0 : "",
|
|
518
|
+
"data-metrics": o ? w : void 0,
|
|
519
|
+
"data-two-lines": i ? "" : void 0,
|
|
523
520
|
"data-compact": c ? "" : void 0,
|
|
524
|
-
children: /* @__PURE__ */
|
|
525
|
-
|
|
521
|
+
children: /* @__PURE__ */ E("ul", { className: h.calculation, ...n, children: [
|
|
522
|
+
o && /* The head names each metric and its unit above its column. Every
|
|
526
523
|
row's sentence names them too, so the head is for the eye. */
|
|
527
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ $("li", { className: h.item, "aria-hidden": "true", children: /* @__PURE__ */ $("div", { className: h.head, children: o.map((s, d) => /* @__PURE__ */ E(
|
|
528
525
|
"span",
|
|
529
526
|
{
|
|
530
|
-
className:
|
|
531
|
-
"data-unit":
|
|
527
|
+
className: h.headCell,
|
|
528
|
+
"data-unit": s.unit === void 0 ? void 0 : "",
|
|
532
529
|
style: { "--column": X(d) },
|
|
533
530
|
children: [
|
|
534
|
-
/* @__PURE__ */
|
|
535
|
-
|
|
531
|
+
/* @__PURE__ */ $("span", { className: h.headLabel, children: s.label }),
|
|
532
|
+
s.unit !== void 0 && /* @__PURE__ */ $("span", { className: h.headUnit, children: s.unit })
|
|
536
533
|
]
|
|
537
534
|
},
|
|
538
|
-
|
|
535
|
+
s.id
|
|
539
536
|
)) }) }),
|
|
540
|
-
|
|
537
|
+
S
|
|
541
538
|
] })
|
|
542
539
|
}
|
|
543
540
|
)
|
package/docs/llms-full.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @umriss-ui/calculation 0.
|
|
1
|
+
# @umriss-ui/calculation 0.36.0
|
|
2
2
|
|
|
3
3
|
> React calculation view for data-dense applications - a derivation written as it is shown, evaluated by the library, folded and read line by line.
|
|
4
4
|
|
|
@@ -1005,7 +1005,7 @@ npm install @umriss-ui/calculation @umriss-ui/core
|
|
|
1005
1005
|
|
|
1006
1006
|
Demo page: https://romanhaendler.github.io/umriss-ui/calculation/installation/
|
|
1007
1007
|
|
|
1008
|
-
The command brings the core package along, a peer dependency: it gives the calculation its formats, its wording and the assessment of targets and limits. React
|
|
1008
|
+
The command brings the core package along, a peer dependency: it gives the calculation its formats, its wording and the assessment of targets and limits. React 19 or newer is a peer as well and stays the application's own.
|
|
1009
1009
|
|
|
1010
1010
|
The stylesheet loads itself: the package imports it and marks CSS as a side effect, so a bundler keeps it. `@umriss-ui/calculation/styles.css` stays exported for setups that link stylesheets by hand.
|
|
1011
1011
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umriss-ui/calculation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "React calculation view for data-dense applications - a derivation written as it is shown, evaluated by the library, folded and read line by line.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Roman Händler",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"./styles.css": "./dist/calculation.css"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"react": ">=
|
|
49
|
-
"react-dom": ">=
|
|
50
|
-
"@umriss-ui/core": "^0.
|
|
48
|
+
"react": ">=19",
|
|
49
|
+
"react-dom": ">=19",
|
|
50
|
+
"@umriss-ui/core": "^0.36.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@fontsource/geist-mono": "^5.3.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"typescript": "^5.6.3",
|
|
62
62
|
"vite": "^6.0.0",
|
|
63
63
|
"vite-plugin-dts": "^4.3.0",
|
|
64
|
-
"@umriss-ui/core": "0.
|
|
64
|
+
"@umriss-ui/core": "0.36.0",
|
|
65
65
|
"@umriss-ui/demo": "0.0.0"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|