@umriss-ui/calculation 0.41.1 → 0.43.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.
@@ -0,0 +1,176 @@
1
+ import { Children as ie, isValidElement as b, Fragment as ae } from "react";
2
+ const p = (o) => Object.defineProperty(() => {
3
+ throw new Error(
4
+ `@umriss-ui/calculation: <${o}> stands only directly inside a <Calculation>. A tree written in a Server Component must be written inside the <Calculation> there, in one file, not passed through a client component.`
5
+ );
6
+ }, "name", { value: o }), se = p("Given"), re = p("Sum"), ce = p("Difference"), ue = p("Product"), le = p("Quotient"), J = p("Ref"), fe = p("Chain"), de = p("Plus"), pe = p("Minus"), me = p("Times"), he = p("DividedBy"), Q = p("Interim"), $e = /* @__PURE__ */ new Map([
7
+ [re, "sum"],
8
+ [ce, "difference"],
9
+ [ue, "product"],
10
+ [le, "quotient"]
11
+ ]), U = {
12
+ sum: "Sum",
13
+ difference: "Difference",
14
+ product: "Product",
15
+ quotient: "Quotient"
16
+ }, B = /* @__PURE__ */ new Map([
17
+ [de, { name: "Plus", operator: "sum" }],
18
+ [pe, { name: "Minus", operator: "sum", negated: !0 }],
19
+ [me, { name: "Times", operator: "product" }],
20
+ [he, { name: "DividedBy", operator: "quotient" }]
21
+ ]), G = "<Given>, <Sum>, <Difference>, <Product>, <Quotient> or <Chain>", Y = "a calculation with metrics only adds and subtracts - <Sum>, <Difference>, <Plus>, <Minus>.", ye = ["unit", "format", "decimals"];
22
+ function a(o) {
23
+ throw new Error(`@umriss-ui/calculation: ${o}`);
24
+ }
25
+ function P(o) {
26
+ return ie.toArray(o).flatMap(
27
+ (t) => b(t) && t.type === ae ? P(t.props.children) : [t]
28
+ );
29
+ }
30
+ function E(o) {
31
+ if (!b(o)) return JSON.stringify(o);
32
+ const t = o.type;
33
+ return typeof t == "string" ? `<${t}>` : `<${t.displayName ?? t.name ?? "anonymous"}>`;
34
+ }
35
+ const K = (o, t, s) => `${o}/${b(t) && t.key || s}`;
36
+ function be(o, t) {
37
+ const s = P(o);
38
+ if (s.length !== 1 && a(`<Calculation> takes exactly one child, the result; it was given ${s.length}.`), t !== void 0) {
39
+ t.length === 0 && a("<Calculation>: metrics is empty; leave it out for a calculation with one number per quantity.");
40
+ const n = /* @__PURE__ */ new Set();
41
+ for (const { id: i } of t)
42
+ n.has(i) && a(`<Calculation>: the metric id "${i}" is used twice.`), n.add(i);
43
+ }
44
+ const m = t?.map((n) => `"${n.id}"`).join(", "), r = (n, i) => {
45
+ const c = typeof n == "object" && n !== null;
46
+ if (t === void 0) {
47
+ c && a(`${i}: value is an object by metric, but the calculation has no metrics.`);
48
+ return;
49
+ }
50
+ c || a(`${i}: with metrics, value is an object with a number for each metric - ${m}.`);
51
+ for (const { id: e } of t)
52
+ e in n || a(`${i}: value has no number for the metric "${e}"; write null where it is absent. The metrics: ${m}.`);
53
+ for (const e of Object.keys(n))
54
+ t.some((u) => u.id === e) || a(`${i}: value has a number for "${e}", which is no metric. The metrics: ${m}.`);
55
+ }, l = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), S = [], R = (n, i, c) => {
56
+ const { id: e, ...u } = i;
57
+ if (t !== void 0) {
58
+ for (const w of ye)
59
+ i[w] !== void 0 && a(`${c}: ${w} belongs to the metric once the calculation has metrics, not to a quantity.`);
60
+ (i.target !== void 0 || i.limits !== void 0) && a(`${c}: target and limits are not assessed in a calculation with metrics.`);
61
+ }
62
+ e !== void 0 && (v.has(e) && a(`${c}: the id "${e}" is used twice.`), v.set(e, n));
63
+ const $ = { ...u, key: n, id: e, operands: [] };
64
+ return l.set(n, $), $;
65
+ }, N = (n, i, c) => {
66
+ if (b(n) && n.type === J) {
67
+ const e = { key: "", reference: !0 };
68
+ return S.push({ operand: e, to: n.props.to, where: c }), e;
69
+ }
70
+ return { key: L(n, i, c), reference: !1 };
71
+ }, L = (n, i, c) => {
72
+ if ((!b(n) || n.type === J || B.has(n.type) || n.type === Q) && a(`${c}: ${E(n)} cannot stand here; a quantity must be ${G}.`), n.type === fe) return H(n.props.children, i, c);
73
+ const e = $e.get(n.type);
74
+ n.type !== se && e === void 0 && a(
75
+ `${c}: ${E(n)} is not an element of the calculation. A calculation reads its children's props and cannot look inside a component of your own; write ${G} or <Ref> directly, or return them from .map.`
76
+ );
77
+ const { children: u, value: $, source: w, asOf: I, ages: h, ...q } = n.props, f = `${c} › ${q.label}`;
78
+ t !== void 0 && (e === "product" || e === "quotient") && a(`${f}: <${U[e]}> - ${Y}`);
79
+ const C = R(i, q, f);
80
+ if (e === void 0)
81
+ return r($, f), C.given = { value: $, source: w, asOf: I, ages: h }, i;
82
+ C.operator = e;
83
+ const y = P(u), d = y.length;
84
+ return (e === "quotient" ? d !== 2 : e !== "sum" && d < 2) && a(
85
+ `${f}: <${U[e]}> takes ${e === "quotient" ? "exactly two operands" : "two or more operands"}; it was given ${d}.`
86
+ ), C.operands = y.map((O, T) => N(O, K(i, O, T), f)), i;
87
+ }, H = (n, i, c) => {
88
+ const e = `${c} › <Chain>`, [u, ...$] = P(n);
89
+ (u === void 0 || b(u) && (B.has(u.type) || u.type === Q)) && a(`${e}: a chain starts with a quantity that has no operator - ${G} or <Ref>.`);
90
+ let w = N(u, K(i, u, 0), e), I = E(u), h = [], q;
91
+ return $.forEach((f, C) => {
92
+ const y = K(i, f, C + 1);
93
+ if (b(f) && f.type === Q) {
94
+ const g = f.props, D = `${e} › ${g.label}`;
95
+ h.length === 0 && a(`${D}: an <Interim> needs an operand since the named value before it, ${I}.`);
96
+ const x = R(y, g, D);
97
+ x.interim = !0, x.operator = h[0].line.operator, x.operands = [w, ...h.map((oe) => oe.operand)], w = { key: y, reference: !1, previous: !0 }, I = `<Interim label="${g.label}">`, h = [], q = y;
98
+ return;
99
+ }
100
+ const d = b(f) ? B.get(f.type) : void 0;
101
+ d === void 0 && a(`${e}: ${E(f)} needs an operator in a chain - <Plus>, <Minus>, <Times> or <DividedBy> - or is an <Interim>.`), t !== void 0 && d.operator !== "sum" && a(`${e}: <${d.name}> - ${Y}`);
102
+ const O = d.operator !== "sum", T = h.find((g) => g.line.operator !== "sum");
103
+ (O && h.length > 0 || T) && a(
104
+ `${e}: <${(T ?? { line: d }).line.name}> stands alone between two named values - directly after the first quantity or an <Interim>, and directly before an <Interim>.`
105
+ );
106
+ const { children: W, ...M } = f.props, A = P(W), _ = () => a(`${e}: <${d.name}> takes either a label and a value, or exactly one quantity as its child.`);
107
+ if (A.length > 0) {
108
+ (A.length > 1 || Object.values(M).some((D) => D !== void 0)) && _();
109
+ const g = N(A[0], y, e);
110
+ g.negated = d.negated, h.push({ operand: g, line: d });
111
+ return;
112
+ }
113
+ M.label === void 0 && _();
114
+ const { value: V, source: X, asOf: Z, ages: ee, ...te } = M, F = `${e} › ${M.label}`, ne = R(y, { ...te, label: M.label }, F);
115
+ r(V, F), ne.given = { value: V, source: X, asOf: Z, ages: ee }, h.push({ operand: { key: y, reference: !1, negated: d.negated }, line: d });
116
+ }), (h.length > 0 || q === void 0) && a(`${e}: a chain ends with an <Interim>, which names its value.`), q;
117
+ }, j = L(s[0], "0", "<Calculation>"), k = l.get(j);
118
+ (k.emphasis !== void 0 || k.rule !== void 0) && a(`<Calculation> › ${k.label}: emphasis and rule do not stand on the Result, which is already the heaviest line.`);
119
+ for (const { operand: n, to: i, where: c } of S) {
120
+ const e = v.get(i);
121
+ if (e === void 0) {
122
+ const u = [...v.keys()].map(($) => `"${$}"`).join(", ");
123
+ a(`${c}: <Ref to="${i}"> names no quantity. ${u ? `The ids that exist: ${u}.` : "No quantity has an id."}`);
124
+ }
125
+ n.key = e;
126
+ }
127
+ return ve(l), t === void 0 && z(l, j), { result: j, quantities: l, metrics: t };
128
+ }
129
+ function we(o) {
130
+ return o.metrics ? o.metrics.map((t) => {
131
+ const s = /* @__PURE__ */ new Map();
132
+ for (const [m, r] of o.quantities) {
133
+ const l = r.given && { ...r.given, value: r.given.value[t.id] };
134
+ s.set(m, { ...r, unit: t.unit, decimals: t.decimals, given: l });
135
+ }
136
+ return { result: o.result, quantities: s };
137
+ }) : [o];
138
+ }
139
+ function z(o, t) {
140
+ const s = o.get(t);
141
+ for (const { key: m, reference: r } of s.operands) {
142
+ if (r) continue;
143
+ const l = o.get(m);
144
+ l.decimals === void 0 && l.unit === s.unit && l.format === s.format && (l.decimals = s.decimals), z(o, m);
145
+ }
146
+ }
147
+ function ve(o) {
148
+ const t = /* @__PURE__ */ new Set(), s = [], m = (r) => {
149
+ if (t.has(r)) return;
150
+ const l = s.indexOf(r);
151
+ if (l !== -1) {
152
+ const v = [...s.slice(l), r].map((S) => o.get(S).label);
153
+ a(`the calculation goes round in a circle through references: ${v.join(" → ")}.`);
154
+ }
155
+ s.push(r);
156
+ for (const v of o.get(r).operands) m(v.key);
157
+ s.pop(), t.add(r);
158
+ };
159
+ for (const r of o.keys()) m(r);
160
+ }
161
+ export {
162
+ fe as C,
163
+ ce as D,
164
+ se as G,
165
+ Q as I,
166
+ pe as M,
167
+ de as P,
168
+ le as Q,
169
+ J as R,
170
+ re as S,
171
+ me as T,
172
+ he as a,
173
+ ue as b,
174
+ we as p,
175
+ be as r
176
+ };
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { HTMLAttributes } from 'react';
3
3
  import { JSX } from 'react';
4
4
  import { Limit } from '@umriss-ui/core';
5
5
  import { ReactNode } from 'react';
6
+ import { RefProp } from '@umriss-ui/core';
6
7
 
7
8
  /** A derivation the package works out itself and shows as a statement, from
8
9
  the givens up to the result: one quantity as its child, written with
@@ -10,11 +11,12 @@ import { ReactNode } from 'react';
10
11
  operation it shows, the number cannot disagree with the lines above it.
11
12
  Every tree below the outermost statement starts folded and opens beneath
12
13
  the row that is clicked. */
13
- export declare function Calculation({ children, className, style, metrics, density, ...rest }: CalculationProps): JSX.Element;
14
+ export declare function Calculation({ children, metrics, ...rest }: CalculationProps): JSX.Element;
14
15
 
15
- /** `className` and `style` size and place the surface; every other attribute -
16
- `aria-label` first of all - lands on the list the surface holds. */
17
- export declare interface CalculationProps extends Omit<HTMLAttributes<HTMLUListElement>, "children"> {
16
+ /** A composite: `ref`, `className`, `style` and every other attribute reach the
17
+ surface; `aria-label`, `aria-labelledby` and `aria-describedby` reach the
18
+ list it holds, which carries the role they name. */
19
+ export declare interface CalculationProps extends Omit<HTMLAttributes<HTMLDivElement>, "children">, RefProp<HTMLDivElement> {
18
20
  /** The result: exactly one quantity - a tree (`<Sum>`, `<Difference>`,
19
21
  `<Product>`, `<Quotient>` with their operands, `<Given>` as leaves) or a
20
22
  `<Chain>`, the two mixing freely; `<Ref>` for a quantity defined
@@ -144,7 +146,8 @@ export declare interface QuantityProps {
144
146
  The quantity stays a ratio in every operation. */
145
147
  format?: "percent";
146
148
  /** Fixed number of fraction digits as shown. Rounding happens only in
147
- presentation; every operation uses the full value.
149
+ presentation; every operation uses the full value. The places carry down
150
+ to operands of the same `unit` and `format` that set none of their own.
148
151
  @default one digit for a percentage, at most two for a derived number, a
149
152
  given as it was given */
150
153
  decimals?: number;
package/docs/llms-full.md CHANGED
@@ -1,4 +1,4 @@
1
- # @umriss-ui/calculation 0.41.1
1
+ # @umriss-ui/calculation 0.43.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
 
@@ -1054,7 +1054,7 @@ From `OperatorProps` — the full table stands on [Tree](#tree).
1054
1054
  | [`id`](#tree) | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. From `QuantityProps`. |
1055
1055
  | [`unit`](#tree) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`. |
1056
1056
  | [`format`](#tree) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`. |
1057
- | [`decimals`](#tree) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. From `QuantityProps`. |
1057
+ | [`decimals`](#tree) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`. |
1058
1058
  | [`target`](#tree) | `number` | — | The value this quantity is meant to reach - missed, never violated. From `QuantityProps`. |
1059
1059
 
1060
1060
  From `RefProps` — the full table stands on [Tree](#tree).
@@ -1070,7 +1070,7 @@ From `ChainOperandProps` — the full table stands on [Chain](#chain).
1070
1070
  | [`id`](#chain) | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. From `QuantityProps`. |
1071
1071
  | [`unit`](#chain) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`. |
1072
1072
  | [`format`](#chain) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`. |
1073
- | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. From `QuantityProps`. |
1073
+ | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`. |
1074
1074
  | [`target`](#chain) | `number` | — | The value this quantity is meant to reach - missed, never violated. From `QuantityProps`. |
1075
1075
 
1076
1076
  From `QuantityProps` — the full table stands on [Chain](#chain).
@@ -1081,7 +1081,7 @@ From `QuantityProps` — the full table stands on [Chain](#chain).
1081
1081
  | [`id`](#chain) | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. |
1082
1082
  | [`unit`](#chain) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. |
1083
1083
  | [`format`](#chain) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. |
1084
- | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. |
1084
+ | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. |
1085
1085
  | [`target`](#chain) | `number` | — | The value this quantity is meant to reach - missed, never violated. |
1086
1086
 
1087
1087
  From `GivenProps` — the full table stands on [Given](#given).
@@ -1093,7 +1093,7 @@ From `GivenProps` — the full table stands on [Given](#given).
1093
1093
  | [`id`](#given) | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. From `QuantityProps`. |
1094
1094
  | [`unit`](#given) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`. |
1095
1095
  | [`format`](#given) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`. |
1096
- | [`decimals`](#given) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. From `QuantityProps`. |
1096
+ | [`decimals`](#given) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`. |
1097
1097
  | [`target`](#given) | `number` | — | The value this quantity is meant to reach - missed, never violated. From `QuantityProps`. |
1098
1098
 
1099
1099
  ## Writing a calculation
@@ -1559,15 +1559,16 @@ Name the calculation with `aria-label`, which lands on the list; without it a re
1559
1559
  | `children` *required* | `ReactNode` | — | The result: exactly one quantity - a tree (`<Sum>`, `<Difference>`, `<Product>`, `<Quotient>` with their operands, `<Given>` as leaves) or a `<Chain>`, the two mixing freely; `<Ref>` for a quantity defined elsewhere.<br>Shown in: [Two numbers and a sum](#calculation), [Write a tree](#calculation), [Write a chain](#calculation) and 50 more |
1560
1560
  | `metrics` | `readonly `[`Metric`](#metrics)`[]` | — | Several numbers per quantity, side by side - headcount and full-time equivalents of the same teams ([ADR-0038](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0038-a-calculation-can-carry-several-metrics.md)). Every `value` is then an object with a number for each metric id; unit and places are the metric's. A calculation with metrics only adds and subtracts, and assesses no target or limits.<br>Shown in: [Rows of both signs with metrics (Rows from data)](#rows-from-data), [Headcount and full-time equivalents (Metrics)](#metrics), [A number one metric does not have (Metrics)](#metrics) and 5 more |
1561
1561
  | `density` | `"regular" \| "compact"` | the density of the `UmrissProvider`, else `"regular"` | `"compact"` sets the lines as close as a compact table's rows: smaller type and less room above and below, under a finger still tall enough to tap. Columns, folding and wording stay as they are.<br>Shown in: [Density](#calculation), [A dense staff report (Metrics)](#metrics) |
1562
+ | `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`. |
1562
1563
 
1563
- Also takes every attribute of the rendered element – without `children`.
1564
+ Also takes every attribute of `<div>` – without `children`.
1564
1565
 
1565
1566
  #### Known limits
1566
1567
 
1567
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)).
1568
1569
  - No input: a calculation shows how a figure came about; changing a given is your application's form.
1569
1570
 
1570
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.41.1/docs/adr/0032-what-umriss-is-not.md).
1571
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.43.0/docs/adr/0032-what-umriss-is-not.md).
1571
1572
 
1572
1573
  ### Tree
1573
1574
 
@@ -1789,7 +1790,7 @@ The keys of [Calculation](#calculation) apply here.
1789
1790
  | `id` | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. From `QuantityProps`.<br>Shown in: [Use a quantity twice](#tree), [The availability of a service (Installation)](#installation), [Write a tree (Calculation)](#calculation) and 10 more |
1790
1791
  | `unit` | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`.<br>Shown in: [Show a share against a target](#tree), [Take several amounts away](#tree), [Multiply quantities with units](#tree) and 42 more |
1791
1792
  | `format` | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`.<br>Shown in: [Show a share against a target](#tree), [Use a quantity twice](#tree), [Build operands from data](#tree) and 17 more |
1792
- | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. From `QuantityProps`.<br>Shown in: [Multiply quantities with units](#tree), [Build operands from data](#tree), [Hold a figure to its limits](#tree) and 29 more |
1793
+ | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`.<br>Shown in: [Multiply quantities with units](#tree), [Build operands from data](#tree), [Hold a figure to its limits](#tree) and 29 more |
1793
1794
  | `target` | `number` | — | The value this quantity is meant to reach - missed, never violated. From `QuantityProps`.<br>Shown in: [Show a share against a target](#tree), [The availability of a service (Installation)](#installation), [Write a tree (Calculation)](#calculation) and 6 more |
1794
1795
  | `limits` | `readonly ``Limit``[]` | — | Bounds the quantity is assessed against, through core's `assess()`. From `QuantityProps`.<br>Shown in: [Hold a figure to its limits](#tree), [Density (Calculation)](#calculation), [Hold an interim to its limits (Chain)](#chain) and 5 more |
1795
1796
  | `explanation` | `string` | — | A sentence of plain text beside the line: why the quantity is here, or what it means. From `QuantityProps`.<br>Shown in: [Say where a number came from (Given)](#given), [A number one metric does not have (Metrics)](#metrics), [Staff movement as a chain (Metrics)](#metrics) and 2 more |
@@ -1848,7 +1849,7 @@ type Severity = "warning" | "alarm";
1848
1849
  - Four operators and nothing else – no powers, roots or functions; compute those before and hand them in as givens.
1849
1850
  - A unit is a label and is never converted or checked; the calculation does no unit algebra.
1850
1851
 
1851
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.41.1/docs/adr/0032-what-umriss-is-not.md).
1852
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.43.0/docs/adr/0032-what-umriss-is-not.md).
1852
1853
 
1853
1854
  ### Chain
1854
1855
 
@@ -2103,7 +2104,7 @@ The keys of [Calculation](#calculation) apply here.
2103
2104
  | `id` | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. From `QuantityProps`.<br>Shown in: [Fold a group of lines into one](#chain), [Put a chain inside a tree](#chain), [The availability of a service (Installation)](#installation) and 10 more |
2104
2105
  | `unit` | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 42 more |
2105
2106
  | `format` | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`.<br>Shown in: [Fold a group of lines into one](#chain), [Put a chain inside a tree](#chain), [Hold an interim to its limits](#chain) and 17 more |
2106
- | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. From `QuantityProps`.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 29 more |
2107
+ | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 29 more |
2107
2108
  | `target` | `number` | — | The value this quantity is meant to reach - missed, never violated. From `QuantityProps`.<br>Shown in: [Put a chain inside a tree](#chain), [The availability of a service (Installation)](#installation), [Write a tree (Calculation)](#calculation) and 6 more |
2108
2109
  | `limits` | `readonly ``Limit``[]` | — | Bounds the quantity is assessed against, through core's `assess()`. From `QuantityProps`.<br>Shown in: [Hold an interim to its limits](#chain), [Density (Calculation)](#calculation), [Hold a figure to its limits (Tree)](#tree) and 5 more |
2109
2110
  | `explanation` | `string` | — | A sentence of plain text beside the line: why the quantity is here, or what it means. From `QuantityProps`.<br>Shown in: [Say where a number came from (Given)](#given), [A number one metric does not have (Metrics)](#metrics), [Staff movement as a chain (Metrics)](#metrics) and 2 more |
@@ -2119,7 +2120,7 @@ The keys of [Calculation](#calculation) apply here.
2119
2120
  | `id` | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once.<br>Shown in: [Fold a group of lines into one](#chain), [Put a chain inside a tree](#chain), [The availability of a service (Installation)](#installation) and 10 more |
2120
2121
  | `unit` | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 42 more |
2121
2122
  | `format` | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation.<br>Shown in: [Fold a group of lines into one](#chain), [Put a chain inside a tree](#chain), [Hold an interim to its limits](#chain) and 17 more |
2122
- | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 29 more |
2123
+ | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 29 more |
2123
2124
  | `target` | `number` | — | The value this quantity is meant to reach - missed, never violated.<br>Shown in: [Put a chain inside a tree](#chain), [The availability of a service (Installation)](#installation), [Write a tree (Calculation)](#calculation) and 6 more |
2124
2125
  | `limits` | `readonly ``Limit``[]` | — | Bounds the quantity is assessed against, through core's `assess()`.<br>Shown in: [Hold an interim to its limits](#chain), [Density (Calculation)](#calculation), [Hold a figure to its limits (Tree)](#tree) and 5 more |
2125
2126
  | `explanation` | `string` | — | A sentence of plain text beside the line: why the quantity is here, or what it means.<br>Shown in: [Say where a number came from (Given)](#given), [A number one metric does not have (Metrics)](#metrics), [Staff movement as a chain (Metrics)](#metrics) and 2 more |
@@ -2196,7 +2197,7 @@ type Severity = "warning" | "alarm";
2196
2197
 
2197
2198
  - A chain in view does not fold; as an operand of a tree it folds to its last interim.
2198
2199
 
2199
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.41.1/docs/adr/0032-what-umriss-is-not.md).
2200
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.43.0/docs/adr/0032-what-umriss-is-not.md).
2200
2201
 
2201
2202
  ### Rows from data
2202
2203
 
@@ -2576,7 +2577,7 @@ From `OperatorProps` — the full table stands on [Tree](#tree).
2576
2577
  | [`id`](#tree) | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. From `QuantityProps`. |
2577
2578
  | [`unit`](#tree) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`. |
2578
2579
  | [`format`](#tree) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`. |
2579
- | [`decimals`](#tree) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. From `QuantityProps`. |
2580
+ | [`decimals`](#tree) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`. |
2580
2581
 
2581
2582
  From `RefProps` — the full table stands on [Tree](#tree).
2582
2583
 
@@ -2600,7 +2601,7 @@ From `ChainOperandProps` — the full table stands on [Chain](#chain).
2600
2601
  | [`id`](#chain) | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. From `QuantityProps`. |
2601
2602
  | [`unit`](#chain) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`. |
2602
2603
  | [`format`](#chain) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`. |
2603
- | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. From `QuantityProps`. |
2604
+ | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`. |
2604
2605
 
2605
2606
  From `QuantityProps` — the full table stands on [Chain](#chain).
2606
2607
 
@@ -2610,7 +2611,7 @@ From `QuantityProps` — the full table stands on [Chain](#chain).
2610
2611
  | [`id`](#chain) | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. |
2611
2612
  | [`unit`](#chain) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. |
2612
2613
  | [`format`](#chain) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. |
2613
- | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. |
2614
+ | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. |
2614
2615
 
2615
2616
  From `GivenProps` — the full table stands on [Given](#given).
2616
2617
 
@@ -2621,7 +2622,7 @@ From `GivenProps` — the full table stands on [Given](#given).
2621
2622
  | [`id`](#given) | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. From `QuantityProps`. |
2622
2623
  | [`unit`](#given) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`. |
2623
2624
  | [`format`](#given) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`. |
2624
- | [`decimals`](#given) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. From `QuantityProps`. |
2625
+ | [`decimals`](#given) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`. |
2625
2626
 
2626
2627
  From `Metric` — the full table stands on [Metrics](#metrics).
2627
2628
 
@@ -2636,7 +2637,7 @@ From `Metric` — the full table stands on [Metrics](#metrics).
2636
2637
 
2637
2638
  - 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.
2638
2639
 
2639
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.41.1/docs/adr/0032-what-umriss-is-not.md).
2640
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.43.0/docs/adr/0032-what-umriss-is-not.md).
2640
2641
 
2641
2642
  ### Given
2642
2643
 
@@ -2749,7 +2750,7 @@ The keys of [Calculation](#calculation) apply here.
2749
2750
  | `id` | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. From `QuantityProps`.<br>Shown in: [Read in German](#given), [The availability of a service (Installation)](#installation), [Write a tree (Calculation)](#calculation) and 10 more |
2750
2751
  | `unit` | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`.<br>Shown in: [Say where a number came from](#given), [State when a number was true](#given), [Read in German](#given) and 42 more |
2751
2752
  | `format` | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`.<br>Shown in: [Say where a number came from](#given), [Read in German](#given), [The availability of a service (Installation)](#installation) and 17 more |
2752
- | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. From `QuantityProps`.<br>Shown in: [Say where a number came from](#given), [State when a number was true](#given), [Read in German](#given) and 29 more |
2753
+ | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`.<br>Shown in: [Say where a number came from](#given), [State when a number was true](#given), [Read in German](#given) and 29 more |
2753
2754
  | `target` | `number` | — | The value this quantity is meant to reach - missed, never violated. From `QuantityProps`.<br>Shown in: [The availability of a service (Installation)](#installation), [Write a tree (Calculation)](#calculation), [Density (Calculation)](#calculation) and 6 more |
2754
2755
  | `limits` | `readonly ``Limit``[]` | — | Bounds the quantity is assessed against, through core's `assess()`. From `QuantityProps`.<br>Shown in: [Say where a number came from](#given), [Density (Calculation)](#calculation), [Hold a figure to its limits (Tree)](#tree) and 5 more |
2755
2756
  | `explanation` | `string` | — | A sentence of plain text beside the line: why the quantity is here, or what it means. From `QuantityProps`.<br>Shown in: [Say where a number came from](#given), [A number one metric does not have (Metrics)](#metrics), [Staff movement as a chain (Metrics)](#metrics) and 2 more |
@@ -3322,7 +3323,7 @@ The keys of [Calculation](#calculation) apply here.
3322
3323
  - 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`.
3323
3324
  - No target or limits with metrics: an assessment per cell is not there yet.
3324
3325
 
3325
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.41.1/docs/adr/0032-what-umriss-is-not.md).
3326
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.43.0/docs/adr/0032-what-umriss-is-not.md).
3326
3327
 
3327
3328
  ## In practice
3328
3329
 
@@ -3474,7 +3475,7 @@ From `OperatorProps` — the full table stands on [Tree](#tree).
3474
3475
  | [`label`](#tree) *required* | `string` | — | What the quantity is called. It stands on its line, wherever it is an operand, and in the accessible sentence. From `QuantityProps`. |
3475
3476
  | [`unit`](#tree) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`. |
3476
3477
  | [`format`](#tree) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`. |
3477
- | [`decimals`](#tree) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. From `QuantityProps`. |
3478
+ | [`decimals`](#tree) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`. |
3478
3479
  | [`target`](#tree) | `number` | — | The value this quantity is meant to reach - missed, never violated. From `QuantityProps`. |
3479
3480
  | [`limits`](#tree) | `readonly `[`Limit`](#tree)`[]` | — | Bounds the quantity is assessed against, through core's `assess()`. From `QuantityProps`. |
3480
3481
 
@@ -3492,7 +3493,7 @@ From `ChainOperandProps` — the full table stands on [Chain](#chain).
3492
3493
  | [`source`](#chain) | `string` | — | Where the number came from: a system, a report, a person. From `GivenProps`. |
3493
3494
  | [`unit`](#chain) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`. |
3494
3495
  | [`format`](#chain) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`. |
3495
- | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. From `QuantityProps`. |
3496
+ | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`. |
3496
3497
  | [`target`](#chain) | `number` | — | The value this quantity is meant to reach - missed, never violated. From `QuantityProps`. |
3497
3498
  | [`limits`](#chain) | `readonly `[`Limit`](#chain)`[]` | — | Bounds the quantity is assessed against, through core's `assess()`. From `QuantityProps`. |
3498
3499
 
@@ -3503,7 +3504,7 @@ From `QuantityProps` — the full table stands on [Chain](#chain).
3503
3504
  | [`label`](#chain) *required* | `string` | — | What the quantity is called. It stands on its line, wherever it is an operand, and in the accessible sentence. |
3504
3505
  | [`unit`](#chain) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. |
3505
3506
  | [`format`](#chain) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. |
3506
- | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. |
3507
+ | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. |
3507
3508
  | [`target`](#chain) | `number` | — | The value this quantity is meant to reach - missed, never violated. |
3508
3509
  | [`limits`](#chain) | `readonly `[`Limit`](#chain)`[]` | — | Bounds the quantity is assessed against, through core's `assess()`. |
3509
3510
 
@@ -3516,7 +3517,7 @@ From `GivenProps` — the full table stands on [Given](#given).
3516
3517
  | [`label`](#given) *required* | `string` | — | What the quantity is called. It stands on its line, wherever it is an operand, and in the accessible sentence. From `QuantityProps`. |
3517
3518
  | [`unit`](#given) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`. |
3518
3519
  | [`format`](#given) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`. |
3519
- | [`decimals`](#given) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. From `QuantityProps`. |
3520
+ | [`decimals`](#given) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`. |
3520
3521
  | [`target`](#given) | `number` | — | The value this quantity is meant to reach - missed, never violated. From `QuantityProps`. |
3521
3522
  | [`limits`](#given) | `readonly `[`Limit`](#given)`[]` | — | Bounds the quantity is assessed against, through core's `assess()`. From `QuantityProps`. |
3522
3523
 
@@ -3989,7 +3990,7 @@ From `OperatorProps` — the full table stands on [Tree](#tree).
3989
3990
  | [`id`](#tree) | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. From `QuantityProps`. |
3990
3991
  | [`unit`](#tree) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`. |
3991
3992
  | [`format`](#tree) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`. |
3992
- | [`decimals`](#tree) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. From `QuantityProps`. |
3993
+ | [`decimals`](#tree) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`. |
3993
3994
  | [`target`](#tree) | `number` | — | The value this quantity is meant to reach - missed, never violated. From `QuantityProps`. |
3994
3995
  | [`limits`](#tree) | `readonly `[`Limit`](#tree)`[]` | — | Bounds the quantity is assessed against, through core's `assess()`. From `QuantityProps`. |
3995
3996
 
@@ -4018,7 +4019,7 @@ From `ChainOperandProps` — the full table stands on [Chain](#chain).
4018
4019
  | [`id`](#chain) | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. From `QuantityProps`. |
4019
4020
  | [`unit`](#chain) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`. |
4020
4021
  | [`format`](#chain) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`. |
4021
- | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. From `QuantityProps`. |
4022
+ | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`. |
4022
4023
  | [`target`](#chain) | `number` | — | The value this quantity is meant to reach - missed, never violated. From `QuantityProps`. |
4023
4024
  | [`limits`](#chain) | `readonly `[`Limit`](#chain)`[]` | — | Bounds the quantity is assessed against, through core's `assess()`. From `QuantityProps`. |
4024
4025
 
@@ -4030,7 +4031,7 @@ From `QuantityProps` — the full table stands on [Chain](#chain).
4030
4031
  | [`id`](#chain) | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. |
4031
4032
  | [`unit`](#chain) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. |
4032
4033
  | [`format`](#chain) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. |
4033
- | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. |
4034
+ | [`decimals`](#chain) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. |
4034
4035
  | [`target`](#chain) | `number` | — | The value this quantity is meant to reach - missed, never violated. |
4035
4036
  | [`limits`](#chain) | `readonly `[`Limit`](#chain)`[]` | — | Bounds the quantity is assessed against, through core's `assess()`. |
4036
4037
 
@@ -4046,7 +4047,7 @@ From `GivenProps` — the full table stands on [Given](#given).
4046
4047
  | [`id`](#given) | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. From `QuantityProps`. |
4047
4048
  | [`unit`](#given) | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`. |
4048
4049
  | [`format`](#given) | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`. |
4049
- | [`decimals`](#given) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. From `QuantityProps`. |
4050
+ | [`decimals`](#given) | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`. |
4050
4051
  | [`target`](#given) | `number` | — | The value this quantity is meant to reach - missed, never violated. From `QuantityProps`. |
4051
4052
  | [`limits`](#given) | `readonly `[`Limit`](#given)`[]` | — | Bounds the quantity is assessed against, through core's `assess()`. From `QuantityProps`. |
4052
4053
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umriss-ui/calculation",
3
- "version": "0.41.1",
3
+ "version": "0.43.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",
@@ -47,7 +47,8 @@
47
47
  "exports": {
48
48
  ".": {
49
49
  "types": "./dist/index.d.ts",
50
- "import": "./dist/calculation.js"
50
+ "import": "./dist/calculation.js",
51
+ "default": "./dist/calculation.js"
51
52
  },
52
53
  "./styles.css": {
53
54
  "types": "./dist/styles.d.ts",
@@ -55,9 +56,9 @@
55
56
  }
56
57
  },
57
58
  "peerDependencies": {
59
+ "@umriss-ui/core": "^0.43.0",
58
60
  "react": ">=19",
59
- "react-dom": ">=19",
60
- "@umriss-ui/core": "^0.41.1"
61
+ "react-dom": ">=19"
61
62
  },
62
63
  "devDependencies": {
63
64
  "@fontsource/geist-mono": "^5.3.0",
@@ -71,7 +72,7 @@
71
72
  "typescript": "^5.6.3",
72
73
  "vite": "^6.0.0",
73
74
  "vite-plugin-dts": "^4.3.0",
74
- "@umriss-ui/core": "0.41.1",
75
+ "@umriss-ui/core": "0.43.0",
75
76
  "@umriss-ui/demo": "0.0.0"
76
77
  },
77
78
  "scripts": {
@@ -86,6 +87,6 @@
86
87
  "check:site": "pnpm run props -- --check",
87
88
  "preview:demo": "vite preview --config vite.demo.config.ts --port 4177 --strictPort",
88
89
  "test:unit": "vitest run",
89
- "check:dist": "node --disable-warning=ExperimentalWarning --experimental-strip-types ../../scripts/check-dist.ts calculation.js calculation.css"
90
+ "check:dist": "node --disable-warning=ExperimentalWarning --experimental-strip-types ../../scripts/check-dist.ts calculation.js calculation.css calculation.client.js"
90
91
  }
91
92
  }