@umriss-ui/calculation 0.49.0 → 0.51.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 +8 -0
- package/dist/calculation.client.js +75 -78
- package/docs/llms-full.md +6 -6
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,14 @@ From 0.34.0 the packages share one number - five, six from 0.40.0, when the dash
|
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
+
## 0.51.0 – A page is what its frame holds: a table fills its pane, the pager says the range (Oct. 2026)
|
|
18
|
+
|
|
19
|
+
No change of its own; the number moves with the other packages (ADR-0066).
|
|
20
|
+
|
|
21
|
+
## 0.50.0 – Straightened: dialogs focus without React's internals, tables work per change, the edges 0.49.0 left (Oct. 2026)
|
|
22
|
+
|
|
23
|
+
No change of its own; the number moves with the other packages (ADR-0066).
|
|
24
|
+
|
|
17
25
|
## 0.49.0 – The second shakedown: lists that shrink, a flood that scrolls, five things the table lacked (Oct. 2026)
|
|
18
26
|
|
|
19
27
|
### Fixed
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./calculation.css";
|
|
3
3
|
import { jsx as r, jsxs as $ } from "react/jsx-runtime";
|
|
4
|
-
import { useId as Ce, useState as se, useRef as
|
|
5
|
-
import { assess as
|
|
6
|
-
import { p as
|
|
7
|
-
function
|
|
4
|
+
import { useId as Ce, useState as se, useRef as Se, useCallback as fe, useLayoutEffect as ke, useEffect as Ae } from "react";
|
|
5
|
+
import { assess as Ee, verdictWeight as te, warnOnce as Me, useDensityFor as Te, useFormats as Ne, useWording as xe, VisuallyHidden as We, AngleGlyph as Be, Badge as oe, useFreshness as Le, Tooltip as Re } from "@umriss-ui/core";
|
|
6
|
+
import { p as De } from "./calculation.model-BTqFvIHM.js";
|
|
7
|
+
function ye(e, t) {
|
|
8
8
|
if (e.decimals !== void 0) return e.decimals;
|
|
9
9
|
const f = e.format === "percent" ? 1 : e.given ? void 0 : 2;
|
|
10
10
|
if (f === void 0) return;
|
|
11
11
|
const i = e.format === "percent" ? t * 100 : t;
|
|
12
|
-
return i !== 0 &&
|
|
12
|
+
return i !== 0 && we(i, f) === 0 ? void 0 : f;
|
|
13
13
|
}
|
|
14
14
|
function pe(e, t) {
|
|
15
15
|
const [f, i = "0"] = String(e).split("e");
|
|
16
16
|
return +`${f}e${Number(i) + t}`;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function we(e, t) {
|
|
19
19
|
return t === void 0 ? e : Math.sign(e) * pe(Math.round(pe(Math.abs(e), t)), -t) || 0;
|
|
20
20
|
}
|
|
21
|
-
function X(e, t, f =
|
|
22
|
-
return
|
|
21
|
+
function X(e, t, f = ye(e, t)) {
|
|
22
|
+
return we(e.format === "percent" ? t * 100 : t, f);
|
|
23
23
|
}
|
|
24
24
|
const Fe = (e, t) => e.format === "percent" ? t / 100 : t;
|
|
25
25
|
function he(e, t, f) {
|
|
@@ -41,32 +41,32 @@ function je(e) {
|
|
|
41
41
|
const u = t.get(i);
|
|
42
42
|
if (u) return u;
|
|
43
43
|
const n = e.quantities.get(i);
|
|
44
|
-
let l = null, g, p = !1, s,
|
|
44
|
+
let l = null, g, p = !1, s, C = "good";
|
|
45
45
|
if (n.given) {
|
|
46
46
|
const y = n.given.value;
|
|
47
|
-
typeof y == "number" && Number.isFinite(y) ? l = y : g = { kind: "missing", label: n.label },
|
|
47
|
+
typeof y == "number" && Number.isFinite(y) ? l = y : g = { kind: "missing", label: n.label }, C = n.given.quality ?? "good";
|
|
48
48
|
} else {
|
|
49
49
|
const y = n.operands.map((v) => ({ operand: v, ...f(v.key) }));
|
|
50
50
|
for (const v of y)
|
|
51
|
-
ge[v.quality] > ge[
|
|
51
|
+
ge[v.quality] > ge[C] && (C = v.quality);
|
|
52
52
|
for (const { operand: v, verdict: O, worst: k } of y) {
|
|
53
53
|
const w = v.reference ? O : ve(O, k);
|
|
54
54
|
s = ve(s, w);
|
|
55
55
|
}
|
|
56
56
|
g = y.find((v) => v.absence)?.absence;
|
|
57
|
-
const
|
|
58
|
-
if (!g && n.operator === "quotient" &&
|
|
57
|
+
const D = y[1];
|
|
58
|
+
if (!g && n.operator === "quotient" && D.value === 0 && (g = { kind: "zero", label: e.quantities.get(D.operand.key).label }), !g) {
|
|
59
59
|
const v = n.operands.map((w) => w.negated === !0);
|
|
60
60
|
l = he(n.operator, y.map((w) => w.value), v);
|
|
61
61
|
const O = he(
|
|
62
62
|
n.operator,
|
|
63
63
|
y.map((w) => Fe(e.quantities.get(w.operand.key), w.shown)),
|
|
64
64
|
v
|
|
65
|
-
), k =
|
|
65
|
+
), k = ye(n, l);
|
|
66
66
|
p = X(n, O, k) !== X(n, l, k);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const S = { target: n.target, limits: n.limits }, h = n.target !== void 0 || (n.limits?.length ?? 0) > 0 ? Ee(l, S) : void 0, P = (n.limits?.length ?? 0) > 0 ? h.verdict : l === null ? "unknown" : void 0, W = {
|
|
70
70
|
value: l,
|
|
71
71
|
absence: g,
|
|
72
72
|
shown: l === null ? null : X(n, l),
|
|
@@ -74,7 +74,7 @@ function je(e) {
|
|
|
74
74
|
assessment: h,
|
|
75
75
|
verdict: P,
|
|
76
76
|
worst: s,
|
|
77
|
-
quality:
|
|
77
|
+
quality: C
|
|
78
78
|
};
|
|
79
79
|
return t.set(i, W), W;
|
|
80
80
|
};
|
|
@@ -88,11 +88,8 @@ function Ue() {
|
|
|
88
88
|
return !1;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
!Ie || _e.has(e) || (_e.add(e), console.warn(`@umriss-ui/calculation: ${t}`));
|
|
94
|
-
}
|
|
95
|
-
const be = 4;
|
|
91
|
+
Ue();
|
|
92
|
+
const Ie = "@umriss-ui/calculation", Pe = (e, t) => Me(Ie, e, t), _e = 4;
|
|
96
93
|
function Ve(e, t, f) {
|
|
97
94
|
const i = e.operands[t];
|
|
98
95
|
if (i.previous) return;
|
|
@@ -106,13 +103,13 @@ const ze = {
|
|
|
106
103
|
difference: "calculationDifferenceSymbol",
|
|
107
104
|
product: "calculationProductSymbol",
|
|
108
105
|
quotient: "calculationQuotientSymbol"
|
|
109
|
-
},
|
|
106
|
+
}, Ge = {
|
|
110
107
|
sum: "calculationSumWord",
|
|
111
108
|
difference: "calculationDifferenceWord",
|
|
112
109
|
product: "calculationProductWord",
|
|
113
110
|
quotient: "calculationQuotientWord"
|
|
114
111
|
};
|
|
115
|
-
function
|
|
112
|
+
function He(e, t) {
|
|
116
113
|
return e === "bad" ? t.qualityBad : e === "uncertain" ? t.qualityUncertain : void 0;
|
|
117
114
|
}
|
|
118
115
|
function ee(e, t) {
|
|
@@ -129,56 +126,56 @@ function ee(e, t) {
|
|
|
129
126
|
}
|
|
130
127
|
function ne(e, t, f) {
|
|
131
128
|
const i = e.negated ? "difference" : e.operator;
|
|
132
|
-
return f[(t ?
|
|
129
|
+
return f[(t ? Ge : ze)[i]];
|
|
133
130
|
}
|
|
134
|
-
function
|
|
131
|
+
function Qe(e, t) {
|
|
135
132
|
return e.kind === "missing" ? t.calculationMissing(e.label) : t.calculationDivisionByZero(e.label);
|
|
136
133
|
}
|
|
137
|
-
function
|
|
134
|
+
function be(e, t, f, i) {
|
|
138
135
|
const u = e.format === "percent" ? i : e.unit, n = f.number(t, e.decimals);
|
|
139
136
|
return u ? `${n} ${u}` : n;
|
|
140
137
|
}
|
|
141
138
|
function Ye(e, t, f, i, u, n, l, g = () => {
|
|
142
139
|
}) {
|
|
143
|
-
const p = e.quantities.get(f), s = t.get(f),
|
|
144
|
-
const z =
|
|
145
|
-
return z === null ? _ ? n.verdictUnknown : n.statAbsentValue :
|
|
140
|
+
const p = e.quantities.get(f), s = t.get(f), C = (N, q) => N.shown !== null && q?.unsigned ? Math.abs(N.shown) : N.shown, S = (N, q, _, F) => {
|
|
141
|
+
const z = C(q, F);
|
|
142
|
+
return z === null ? _ ? n.verdictUnknown : n.statAbsentValue : be(N, z, u, _ ? n.calculationPercent : "%");
|
|
146
143
|
}, h = (N) => {
|
|
147
144
|
if (i || !p.operator) return {};
|
|
148
145
|
if (p.operands.length === 0) return { names: n.calculationNoOperands };
|
|
149
|
-
if (!N && p.operands.length >
|
|
146
|
+
if (!N && p.operands.length > _e)
|
|
150
147
|
return { names: n.calculationOperandCount(p.operands.length) };
|
|
151
148
|
const q = (_) => p.operands.map((F, z) => {
|
|
152
|
-
const j = e.quantities.get(F.key),
|
|
153
|
-
return
|
|
149
|
+
const j = e.quantities.get(F.key), H = g(z);
|
|
150
|
+
return H ? `${ne(H, N, n)} ${_(j, H)}` : _(j);
|
|
154
151
|
}).join(" ");
|
|
155
152
|
return {
|
|
156
153
|
names: q((_) => _.label),
|
|
157
|
-
numbers: q((_, F) =>
|
|
154
|
+
numbers: q((_, F) => S(_, t.get(_.key), N, F))
|
|
158
155
|
};
|
|
159
156
|
}, P = (N) => {
|
|
160
157
|
const q = s.assessment?.deviation;
|
|
161
158
|
if (q === void 0 || p.target === void 0) return;
|
|
162
|
-
const _ =
|
|
159
|
+
const _ = be(p, X(p, p.target), u, N ? n.calculationPercent : "%");
|
|
163
160
|
return q > 0 ? n.calculationAboveTarget(_) : q < 0 ? n.calculationBelowTarget(_) : n.calculationOnTarget(_);
|
|
164
|
-
}, W = h(!1).names, y = W === void 0 || p.operands.length === 0 || p.operands.length >
|
|
165
|
-
(l ? `${ne(l, !0, n)} ` : "") + p.label + k + [
|
|
161
|
+
}, W = h(!1).names, y = W === void 0 || p.operands.length === 0 || p.operands.length > _e ? W : `= ${W}`, D = h(!0), v = He(s.quality, n), O = s.absence ? Qe(s.absence, n) : void 0, k = ` ${n.calculationEquals} `, w = s.approximate ? `${n.calculationApproximately} ${S(p, s, !0, l)}` : S(p, s, !0, l), Z = [
|
|
162
|
+
(l ? `${ne(l, !0, n)} ` : "") + p.label + k + [D.names, D.numbers, w].filter(Boolean).join(`,${k}`),
|
|
166
163
|
s.verdict !== void 0 && s.verdict !== "unknown" ? ee(s.verdict, n) : void 0,
|
|
167
164
|
v,
|
|
168
165
|
P(!0),
|
|
169
166
|
O
|
|
170
167
|
].filter(Boolean).join(", "), A = s.shown === null ? void 0 : p.format === "percent" ? "%" : p.unit, V = (N) => N === null ? n.statAbsentValue : u.number(N, p.decimals);
|
|
171
|
-
return { amount: V(
|
|
168
|
+
return { amount: V(C(s, l)), ownAmount: V(s.shown), unit: A, names: y, target: P(!1), quality: v, reason: O, sentence: Z, spokenNames: D.names, spokenNumber: w };
|
|
172
169
|
}
|
|
173
|
-
function
|
|
170
|
+
function Ke(e, t, f, i, u) {
|
|
174
171
|
const n = u ? `${ne(u, !0, i)} ` : "", l = t[0].spokenNames, g = n + e + (l === void 0 ? "" : ` ${i.calculationEquals} ${l}`), p = f.map(
|
|
175
|
-
(
|
|
172
|
+
(C, S) => [`${C.label} ${t[S].spokenNumber}`, t[S].reason].filter(Boolean).join(", ")
|
|
176
173
|
), s = t[0].quality;
|
|
177
174
|
return `${g}: ${p.join("; ")}${s ? `, ${s}` : ""}`;
|
|
178
175
|
}
|
|
179
|
-
const
|
|
180
|
-
frame:
|
|
181
|
-
calculation:
|
|
176
|
+
const Ze = "_frame_184xf_24 _text_18806_22", Je = "_calculation_184xf_51", Xe = "_line_184xf_86", et = "_assessment_184xf_98", tt = "_disclosure_184xf_107", nt = "_amount_184xf_90", at = "_list_184xf_128", st = "_item_184xf_129", ot = "_derivation_184xf_130", it = "_labelCell_184xf_90", rt = "_names_184xf_90", lt = "_operator_184xf_90", ct = "_unit_184xf_90", ut = "_label_184xf_90", dt = "_approximate_184xf_360", mt = "_target_184xf_102", ft = "_worst_184xf_102", pt = "_quality_184xf_102", ht = "_head_184xf_539", vt = "_headCell_184xf_546", gt = "_headUnit_184xf_559", _t = "_notes_184xf_566", bt = "_freshness_184xf_580", Nt = "_headLabel_184xf_610", o = {
|
|
177
|
+
frame: Ze,
|
|
178
|
+
calculation: Je,
|
|
182
179
|
line: Xe,
|
|
183
180
|
assessment: et,
|
|
184
181
|
disclosure: tt,
|
|
@@ -201,9 +198,9 @@ const Je = "_frame_184xf_24 _text_18806_22", Ke = "_calculation_184xf_51", Xe =
|
|
|
201
198
|
notes: _t,
|
|
202
199
|
freshness: bt,
|
|
203
200
|
headLabel: Nt
|
|
204
|
-
}, xt = 10,
|
|
201
|
+
}, xt = 10, K = (e) => 4 + 2 * e, yt = (e) => 5 + 2 * e, wt = { ok: "success", unknown: "neutral", warning: "warning", alarm: "danger" }, qt = (...e) => e.filter(Boolean).join(" ");
|
|
205
202
|
function $t({ asOf: e, ages: t }) {
|
|
206
|
-
const f =
|
|
203
|
+
const f = Ne(), i = xe(), u = Le(e, t), n = u.freshness === "lost" ? i.freshnessDisconnected : u.freshness === "stale" ? i.freshnessStale : i.freshnessFresh;
|
|
207
204
|
return /* @__PURE__ */ $("span", { className: o.freshness, "data-freshness": u.freshness, children: [
|
|
208
205
|
n,
|
|
209
206
|
u.age !== null && ` · ${f.relative(u.age)}`
|
|
@@ -221,15 +218,15 @@ function At({
|
|
|
221
218
|
...p
|
|
222
219
|
}) {
|
|
223
220
|
!n && !l && Pe("no-name", "A Calculation has no accessible name: give it aria-label or aria-labelledby.");
|
|
224
|
-
const s = e.metrics,
|
|
221
|
+
const s = e.metrics, C = Te(u, "regular") === "compact", S = Ne(), h = xe(), P = Ce(), W = De(e).map((a) => ({ view: a, results: je(a) })), [y, D] = se(() => /* @__PURE__ */ new Set()), [v, O] = se(null), k = Se(null), w = fe(
|
|
225
222
|
(a) => {
|
|
226
223
|
k.current = a, typeof t == "function" ? t(a) : t && (t.current = a);
|
|
227
224
|
},
|
|
228
225
|
[t]
|
|
229
|
-
), [ie,
|
|
230
|
-
const a = k.current, d = a && A > 0 ? getComputedStyle(a.firstElementChild).gridTemplateColumns.split(" ").map(parseFloat) : [], m =
|
|
226
|
+
), [ie, Z] = se(!1), A = s?.length ?? 0, V = fe(() => {
|
|
227
|
+
const a = k.current, d = a && A > 0 ? getComputedStyle(a.firstElementChild).gridTemplateColumns.split(" ").map(parseFloat) : [], m = K(A) - 1;
|
|
231
228
|
if (!a || d.length <= m || d.some((x) => !Number.isFinite(x))) {
|
|
232
|
-
|
|
229
|
+
Z(!1);
|
|
233
230
|
return;
|
|
234
231
|
}
|
|
235
232
|
const E = d.slice(2, m).reduce((x, T) => x + T, 0);
|
|
@@ -237,21 +234,21 @@ function At({
|
|
|
237
234
|
const B = document.createRange();
|
|
238
235
|
for (const x of a.querySelectorAll(`.${o.label}`)) {
|
|
239
236
|
B.selectNodeContents(x);
|
|
240
|
-
const T = [...B.getClientRects()].reduce((L,
|
|
237
|
+
const T = [...B.getClientRects()].reduce((L, R) => L + R.width, 0);
|
|
241
238
|
if (T === 0) continue;
|
|
242
|
-
const
|
|
243
|
-
c = Math.max(c,
|
|
239
|
+
const Q = x.parentElement, G = x.getBoundingClientRect().left - Q.getBoundingClientRect().left;
|
|
240
|
+
c = Math.max(c, G + T + parseFloat(getComputedStyle(Q).paddingRight));
|
|
244
241
|
}
|
|
245
242
|
const M = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
246
|
-
|
|
243
|
+
Z(a.clientWidth - E < Math.min(c, xt * M));
|
|
247
244
|
}, [A]);
|
|
248
|
-
|
|
245
|
+
ke(() => V()), Ae(() => {
|
|
249
246
|
const a = k.current;
|
|
250
247
|
if (!a || A === 0) return;
|
|
251
248
|
const d = new ResizeObserver(() => V());
|
|
252
249
|
return d.observe(a), () => d.disconnect();
|
|
253
250
|
}, [V, A]);
|
|
254
|
-
const N = (a) =>
|
|
251
|
+
const N = (a) => D((d) => {
|
|
255
252
|
const m = new Set(d);
|
|
256
253
|
return m.delete(a) || m.add(a), m;
|
|
257
254
|
}), q = (a, d) => Ve(
|
|
@@ -269,9 +266,9 @@ function At({
|
|
|
269
266
|
"data-verdict": m.verdict,
|
|
270
267
|
"data-quality": m.quality === "good" ? void 0 : m.quality,
|
|
271
268
|
"data-later": c > 0 ? "" : void 0,
|
|
272
|
-
style: s ? { "--_calculation-column":
|
|
269
|
+
style: s ? { "--_calculation-column": K(c) } : void 0,
|
|
273
270
|
children: [
|
|
274
|
-
m.approximate && /* @__PURE__ */ r(
|
|
271
|
+
m.approximate && /* @__PURE__ */ r(Re, { content: h.calculationApproximateNote, children: /* @__PURE__ */ r("span", { className: o.approximate, children: "≈" }) }),
|
|
275
272
|
d ? E.ownAmount : E.amount
|
|
276
273
|
]
|
|
277
274
|
},
|
|
@@ -291,17 +288,17 @@ function At({
|
|
|
291
288
|
]), z = (a, d) => v === null ? void 0 : a === v ? "use" : d === v ? "operand" : void 0, j = (a, d, m, E) => {
|
|
292
289
|
const c = e.quantities.get(a), B = W.map(({ view: b, results: I }) => ({
|
|
293
290
|
own: I.get(a),
|
|
294
|
-
text: Ye(b, I, a, d,
|
|
295
|
-
})), { own: M, text: x } = B[0], T = c.operator !== void 0 && !d,
|
|
291
|
+
text: Ye(b, I, a, d, S, h, m.position, (Oe) => q(c, Oe))
|
|
292
|
+
})), { own: M, text: x } = B[0], T = c.operator !== void 0 && !d, Q = a === e.result && !d, G = T && c.operands.length > 0 && (c.interim ? m.flat : Q), L = T && !G && c.operands.length > 0, R = L && y.has(a);
|
|
296
293
|
_ ||= L;
|
|
297
|
-
const re = `${P}-${a}`, ae = { depth:
|
|
294
|
+
const re = `${P}-${a}`, ae = { depth: G ? m.depth : m.depth + 1, flat: !1, parent: a }, J = T ? c.operands.find((b) => b.previous) : void 0, le = J && m.flat ? j(J.key, !1, { ...m, parent: a, position: void 0 }, `${E}-c`) : [], qe = J && !m.flat ? j(J.key, !1, { ...ae, flat: !0 }, `${E}-c`) : [], ce = T ? c.operands.map(
|
|
298
295
|
(b, I) => b.previous ? null : j(b.key, b.reference, { ...ae, position: q(c, I) }, `${E}-${I}`)
|
|
299
|
-
) : [], Y = L && !
|
|
296
|
+
) : [], Y = L && !R && M.worst !== void 0 && te(M.worst) > te(M.verdict ?? "ok") ? M.worst : void 0, U = d ? void 0 : c.given, $e = m.position ? ne(m.position, !1, h) : void 0, ue = [
|
|
300
297
|
!d && c.explanation !== void 0 && /* @__PURE__ */ r("span", { children: c.explanation }, "explanation"),
|
|
301
298
|
U?.source !== void 0 && /* @__PURE__ */ r("span", { children: h.calculationSource(U.source) }, "source"),
|
|
302
|
-
U?.asOf !== void 0 && (U.ages !== void 0 ? /* @__PURE__ */ r($t, { asOf: U.asOf, ages: U.ages }, "asOf") : /* @__PURE__ */ r("span", { children: h.asOfAgo(
|
|
299
|
+
U?.asOf !== void 0 && (U.ages !== void 0 ? /* @__PURE__ */ r($t, { asOf: U.asOf, ages: U.ages }, "asOf") : /* @__PURE__ */ r("span", { children: h.asOfAgo(S.dateTime(new Date(U.asOf), !1)) }, "asOf")),
|
|
303
300
|
!d && c.aside !== void 0 && /* @__PURE__ */ r("span", { children: c.aside }, "aside")
|
|
304
|
-
].filter(Boolean), de =
|
|
301
|
+
].filter(Boolean), de = Q ? "result" : c.interim && !d && m.flat ? "interim" : void 0, me = /* @__PURE__ */ $(
|
|
305
302
|
"div",
|
|
306
303
|
{
|
|
307
304
|
className: o.line,
|
|
@@ -322,7 +319,7 @@ function At({
|
|
|
322
319
|
} : void 0,
|
|
323
320
|
children: [
|
|
324
321
|
/* @__PURE__ */ r(We, { children: [
|
|
325
|
-
s ?
|
|
322
|
+
s ? Ke(c.label, B.map((b) => b.text), s, h, m.position) : x.sentence,
|
|
326
323
|
B.some((b) => b.own.approximate) && h.calculationApproximateNote,
|
|
327
324
|
Y !== void 0 && h.calculationWorstInside(ee(Y, h))
|
|
328
325
|
].filter(Boolean).join(". ") }),
|
|
@@ -332,16 +329,16 @@ function At({
|
|
|
332
329
|
{
|
|
333
330
|
type: "button",
|
|
334
331
|
className: o.disclosure,
|
|
335
|
-
"aria-expanded":
|
|
332
|
+
"aria-expanded": R,
|
|
336
333
|
"aria-controls": re,
|
|
337
|
-
"aria-label": (
|
|
338
|
-
children: /* @__PURE__ */ r(Be, { "data-open":
|
|
334
|
+
"aria-label": (R ? h.calculationHideDerivation : h.calculationShowDerivation)(c.label),
|
|
335
|
+
children: /* @__PURE__ */ r(Be, { "data-open": R ? "" : void 0 })
|
|
339
336
|
}
|
|
340
337
|
) : /* @__PURE__ */ r("span", { className: o.disclosure, "aria-hidden": "true" }),
|
|
341
338
|
/* @__PURE__ */ r("span", { className: o.label, "aria-hidden": "true", children: c.label })
|
|
342
339
|
] }),
|
|
343
|
-
/* @__PURE__ */ r("span", { className: o.names, "aria-hidden": "true", children: T && !
|
|
344
|
-
/* @__PURE__ */ r("span", { className: o.operator, "aria-hidden": "true", children:
|
|
340
|
+
/* @__PURE__ */ r("span", { className: o.names, "aria-hidden": "true", children: T && !G && !R ? x.names : void 0 }),
|
|
341
|
+
/* @__PURE__ */ r("span", { className: o.operator, "aria-hidden": "true", children: $e }),
|
|
345
342
|
F(B, de !== void 0),
|
|
346
343
|
/* @__PURE__ */ $("span", { className: o.assessment, "aria-hidden": "true", children: [
|
|
347
344
|
s ? (
|
|
@@ -360,7 +357,7 @@ function At({
|
|
|
360
357
|
]
|
|
361
358
|
}
|
|
362
359
|
);
|
|
363
|
-
return
|
|
360
|
+
return G ? [
|
|
364
361
|
...le,
|
|
365
362
|
/* @__PURE__ */ $("li", { className: o.item, children: [
|
|
366
363
|
/* @__PURE__ */ r("ul", { className: o.list, children: ce }),
|
|
@@ -368,10 +365,10 @@ function At({
|
|
|
368
365
|
] }, E)
|
|
369
366
|
] : [
|
|
370
367
|
...le,
|
|
371
|
-
/* @__PURE__ */ $("li", { className: o.item, "data-open":
|
|
368
|
+
/* @__PURE__ */ $("li", { className: o.item, "data-open": R ? "" : void 0, style: { "--_calculation-depth": m.depth }, children: [
|
|
372
369
|
me,
|
|
373
|
-
L && /* @__PURE__ */ $("ul", { id: re, className: o.derivation, hidden: !
|
|
374
|
-
|
|
370
|
+
L && /* @__PURE__ */ $("ul", { id: re, className: o.derivation, hidden: !R, children: [
|
|
371
|
+
qe,
|
|
375
372
|
ce,
|
|
376
373
|
/* @__PURE__ */ r("li", { className: o.item, "aria-hidden": "true", children: /* @__PURE__ */ $(
|
|
377
374
|
"div",
|
|
@@ -398,7 +395,7 @@ function At({
|
|
|
398
395
|
] })
|
|
399
396
|
] }, E)
|
|
400
397
|
];
|
|
401
|
-
},
|
|
398
|
+
}, H = j(e.result, !1, { depth: 0, flat: !0, parent: null }, "r");
|
|
402
399
|
return (
|
|
403
400
|
/* The frame is the surface and the container the layout measures itself
|
|
404
401
|
against; the list inside it is the statement. */
|
|
@@ -410,14 +407,14 @@ function At({
|
|
|
410
407
|
className: qt(o.frame, f),
|
|
411
408
|
style: s ? {
|
|
412
409
|
"--_calculation-figure-tracks": Array(A * 2).fill("auto").join(" "),
|
|
413
|
-
"--_calculation-figures-end":
|
|
414
|
-
"--_calculation-assessment-column":
|
|
410
|
+
"--_calculation-figures-end": K(A),
|
|
411
|
+
"--_calculation-assessment-column": K(A),
|
|
415
412
|
...i
|
|
416
413
|
} : i,
|
|
417
414
|
"data-still": _ ? void 0 : "",
|
|
418
415
|
"data-metrics": s ? A : void 0,
|
|
419
416
|
"data-two-lines": ie ? "" : void 0,
|
|
420
|
-
"data-compact":
|
|
417
|
+
"data-compact": C ? "" : void 0,
|
|
421
418
|
children: /* @__PURE__ */ $("ul", { className: o.calculation, "aria-label": n, "aria-labelledby": l, "aria-describedby": g, children: [
|
|
422
419
|
s && /* The head names each metric and its unit above its column. Every
|
|
423
420
|
row's sentence names them too, so the head is for the eye. */
|
|
@@ -426,7 +423,7 @@ function At({
|
|
|
426
423
|
{
|
|
427
424
|
className: o.headCell,
|
|
428
425
|
"data-unit": a.unit === void 0 ? void 0 : "",
|
|
429
|
-
style: { "--_calculation-column":
|
|
426
|
+
style: { "--_calculation-column": K(d) },
|
|
430
427
|
children: [
|
|
431
428
|
/* @__PURE__ */ r("span", { className: o.headLabel, children: a.label }),
|
|
432
429
|
a.unit !== void 0 && /* @__PURE__ */ r("span", { className: o.headUnit, children: a.unit })
|
|
@@ -434,7 +431,7 @@ function At({
|
|
|
434
431
|
},
|
|
435
432
|
a.id
|
|
436
433
|
)) }) }),
|
|
437
|
-
|
|
434
|
+
H
|
|
438
435
|
] })
|
|
439
436
|
}
|
|
440
437
|
)
|
package/docs/llms-full.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @umriss-ui/calculation 0.
|
|
1
|
+
# @umriss-ui/calculation 0.51.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
|
|
|
@@ -1568,7 +1568,7 @@ Also takes every attribute of `<div>` – without `children`.
|
|
|
1568
1568
|
- No result, formula text or operator of your own: a written-out operation the library did not perform could say something the number does not ([ADR-0027](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0027-a-calculation-is-written-as-it-is-shown.md)).
|
|
1569
1569
|
- No input: a calculation shows how a figure came about; changing a given is your application's form.
|
|
1570
1570
|
|
|
1571
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.
|
|
1571
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.51.0/docs/adr/0032-what-umriss-is-not.md).
|
|
1572
1572
|
|
|
1573
1573
|
### Tree
|
|
1574
1574
|
|
|
@@ -1849,7 +1849,7 @@ type Severity = "warning" | "alarm";
|
|
|
1849
1849
|
- Four operators and nothing else – no powers, roots or functions; compute those before and hand them in as givens.
|
|
1850
1850
|
- A unit is a label and is never converted or checked; the calculation does no unit algebra.
|
|
1851
1851
|
|
|
1852
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.
|
|
1852
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.51.0/docs/adr/0032-what-umriss-is-not.md).
|
|
1853
1853
|
|
|
1854
1854
|
### Chain
|
|
1855
1855
|
|
|
@@ -2209,7 +2209,7 @@ type Severity = "warning" | "alarm";
|
|
|
2209
2209
|
|
|
2210
2210
|
- A chain in view does not fold; as an operand of a tree it folds to its last interim.
|
|
2211
2211
|
|
|
2212
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.
|
|
2212
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.51.0/docs/adr/0032-what-umriss-is-not.md).
|
|
2213
2213
|
|
|
2214
2214
|
### Rows from data
|
|
2215
2215
|
|
|
@@ -2649,7 +2649,7 @@ From `Metric` — the full table stands on [Metrics](#metrics).
|
|
|
2649
2649
|
|
|
2650
2650
|
- Only a sum takes any count: an empty product, a difference of one and a quotient of anything but two still fail on the first render.
|
|
2651
2651
|
|
|
2652
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.
|
|
2652
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.51.0/docs/adr/0032-what-umriss-is-not.md).
|
|
2653
2653
|
|
|
2654
2654
|
### Given
|
|
2655
2655
|
|
|
@@ -3371,7 +3371,7 @@ The keys of [Calculation](#calculation) apply here.
|
|
|
3371
3371
|
- Unit, format and places belong to the metric; on a quantity they fail on the first render, and so does a missing or unknown metric key in a `value`.
|
|
3372
3372
|
- No target or limits with metrics: an assessment per cell is not there yet.
|
|
3373
3373
|
|
|
3374
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.
|
|
3374
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.51.0/docs/adr/0032-what-umriss-is-not.md).
|
|
3375
3375
|
|
|
3376
3376
|
## In practice
|
|
3377
3377
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umriss-ui/calculation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.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",
|
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@umriss-ui/core": "^0.
|
|
59
|
+
"@umriss-ui/core": "^0.51.0",
|
|
60
60
|
"react": ">=19",
|
|
61
61
|
"react-dom": ">=19"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@fontsource/geist-mono": "^5.3.0",
|
|
65
65
|
"@fontsource/geist-sans": "^5.3.0",
|
|
66
|
-
"@umriss-ui/core": "0.
|
|
66
|
+
"@umriss-ui/core": "0.51.0",
|
|
67
67
|
"@umriss-ui/demo": "0.0.0",
|
|
68
68
|
"@types/node": "^22.20.2",
|
|
69
69
|
"@types/react": "^19.0.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"typecheck": "tsc --noEmit",
|
|
86
86
|
"typecheck:demo": "pnpm run props && tsc --noEmit -p tsconfig.demo.json",
|
|
87
87
|
"check:site": "pnpm run props -- --check && node --disable-warning=ExperimentalWarning --experimental-strip-types ../../scripts/checkReadmeLinks.ts",
|
|
88
|
-
"preview:demo": "
|
|
88
|
+
"preview:demo": "node ../../scripts/preview.mjs calculation",
|
|
89
89
|
"test:unit": "vitest run",
|
|
90
90
|
"check:dist": "node --disable-warning=ExperimentalWarning --experimental-strip-types ../../scripts/check-dist.ts calculation.js calculation.css calculation.client.js"
|
|
91
91
|
}
|