@umriss-ui/calculation 0.7.3 → 0.35.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 +25 -2
- package/README.md +5 -2
- package/dist/calculation.css +1 -1
- package/dist/calculation.js +335 -338
- package/docs/llms-full.md +8 -14
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,37 @@
|
|
|
1
1
|
# Changes to `@umriss-ui/calculation`
|
|
2
2
|
|
|
3
3
|
This document describes what changes for **callers** of the package: exports,
|
|
4
|
-
props, behaviour.
|
|
5
|
-
repository's journal (`docs/journal.md`) and in the specs under `.scratch/`.
|
|
4
|
+
props, behaviour.
|
|
6
5
|
|
|
7
6
|
**The numbers.** The middle digit rises when something is added; the last one
|
|
8
7
|
when something is repaired. As long as the first digit is `0`, no number
|
|
9
8
|
promises compatibility — which is why whatever changes existing behaviour stands
|
|
10
9
|
under a heading "Changed" of its own, no matter which digit rose.
|
|
11
10
|
|
|
11
|
+
From 0.34.0 all five packages share one number: they are released together, and a package without a change of its own still gets a heading for it.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 0.35.0 – React 19 is the floor (Oct. 2026)
|
|
16
|
+
|
|
17
|
+
Needs `@umriss-ui/core` 0.35; the peer range is `^0.35.0`.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- **React 19 is required.** The peers `react` and `react-dom` are `>=19`; `0.34.0` is the last version that serves React 18.
|
|
22
|
+
|
|
23
|
+
- **The package ships ES2022 syntax.** An application that serves older browsers transpiles it itself.
|
|
24
|
+
|
|
25
|
+
No other change of its own.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 0.34.0 – One number for all five packages (Oct. 2026)
|
|
30
|
+
|
|
31
|
+
From this version all five packages carry one number and are released
|
|
32
|
+
together. Needs `@umriss-ui/core` 0.34; the peer range is `^0.34.0`. No change
|
|
33
|
+
of its own.
|
|
34
|
+
|
|
12
35
|
---
|
|
13
36
|
|
|
14
37
|
## 0.7.3 – Core 0.33.0 (Oct. 2026)
|
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.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer umriss.tokens,umriss.base,umriss.components;@layer umriss.base{._text_1krlf_23{font-family:var(--u-font-sans);font-size:var(--u-text-md);line-height:var(--u-leading-normal);color:var(--u-color-text);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}@media(pointer:fine){._dense_1krlf_39{--u-control-height-sm: var(--u-control-height-xs)}}._ink_1krlf_50{--u-color-text: var(--u-color-bg);--u-color-text-secondary: color-mix(in srgb, var(--u-color-bg) 75%, transparent);--u-color-text-muted: color-mix(in srgb, var(--u-color-bg) 60%, transparent)}._extent_1krlf_76{--_chars: 20;--_extra: 0;--_tracking: 0px;--_chrome: 0px;min-inline-size:0;max-inline-size:100%;contain:inline-size;contain-intrinsic-inline-size:calc((var(--_chars) + var(--_extra)) * (1ch + var(--_tracking)) + var(--_chrome))}._field_1krlf_91{caret-color:var(--u-color-accent)}._scroll_1krlf_97{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--u-color-text) 25%,transparent) transparent}._scroll_1krlf_97::-webkit-scrollbar{width:10px;height:10px}._scroll_1krlf_97::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--u-color-text) 22%,transparent);border-radius:var(--u-radius-full);border:3px solid transparent;background-clip:content-box}._scroll_1krlf_97::-webkit-scrollbar-track{background:transparent}}@layer umriss.components{._ring_1krlf_126:focus-visible{outline:2px solid transparent;box-shadow:var(--u-focus-ring)}@media(pointer:coarse){._field_1krlf_91._field_1krlf_91,._fieldRoot_1krlf_146._fieldRoot_1krlf_146{font-size:16px}}._field_1krlf_91:-webkit-autofill,._field_1krlf_91:-webkit-autofill:hover,._field_1krlf_91:-webkit-autofill:focus{-webkit-box-shadow:inset 0 0 0 1000px var(--u-color-surface),0 0 0 1px var(--u-edge-color-strong);-webkit-text-fill-color:var(--u-color-text);caret-color:var(--u-color-accent)}}@layer umriss.components{._frame_is340_24,._frame_is340_24:before,._frame_is340_24:after{box-sizing:border-box}._calculation_is340_51,._calculation_is340_51:before,._calculation_is340_51:after{box-sizing:border-box}._line_is340_86,._line_is340_86:before,._line_is340_86:after{box-sizing:border-box}._assessment_is340_98,._assessment_is340_98:before,._assessment_is340_98:after{box-sizing:border-box}._disclosure_is340_107,._disclosure_is340_107:before,._disclosure_is340_107:after{box-sizing:border-box}._amount_is340_90,._amount_is340_90:before,._amount_is340_90:after{box-sizing:border-box}._list_is340_128,._list_is340_128:before,._list_is340_128:after{box-sizing:border-box}._item_is340_129,._item_is340_129:before,._item_is340_129:after{box-sizing:border-box}._derivation_is340_130,._derivation_is340_130:before,._derivation_is340_130:after{box-sizing:border-box}._labelCell_is340_90,._labelCell_is340_90:before,._labelCell_is340_90:after{box-sizing:border-box}._names_is340_90,._names_is340_90:before,._names_is340_90:after{box-sizing:border-box}._operator_is340_90,._operator_is340_90:before,._operator_is340_90:after{box-sizing:border-box}._unit_is340_90,._unit_is340_90:before,._unit_is340_90:after{box-sizing:border-box}._label_is340_90,._label_is340_90:before,._label_is340_90:after{box-sizing:border-box}._approximate_is340_345,._approximate_is340_345:before,._approximate_is340_345:after{box-sizing:border-box}._target_is340_102,._target_is340_102:before,._target_is340_102:after{box-sizing:border-box}._worst_is340_102,._worst_is340_102:before,._worst_is340_102:after{box-sizing:border-box}._head_is340_497,._head_is340_497:before,._head_is340_497:after{box-sizing:border-box}._headCell_is340_504,._headCell_is340_504:before,._headCell_is340_504:after{box-sizing:border-box}._headUnit_is340_517,._headUnit_is340_517:before,._headUnit_is340_517:after{box-sizing:border-box}._notes_is340_524,._notes_is340_524:before,._notes_is340_524:after{box-sizing:border-box}._freshness_is340_538,._freshness_is340_538:before,._freshness_is340_538:after{box-sizing:border-box}._headLabel_is340_568,._headLabel_is340_568:before,._headLabel_is340_568:after{box-sizing:border-box}._frame_is340_24{font-size:var(--u-text-sm);border-radius:var(--u-radius-md);corner-shape:squircle;background:var(--u-color-surface);outline:1px solid transparent;box-shadow:var(--u-edge);overflow-x:auto;overflow-y:hidden;--disclosure-size: 20px;--disclosure-gap: var(--u-space-2);--line-pad: var(--u-space-2);--line-gap: var(--u-space-1);container-type:inline-size;width:100%}._calculation_is340_51{display:grid;grid-template-columns:fit-content(22rem) minmax(0,1fr) auto var(--figure-tracks, auto auto) auto;margin:0;padding:0;list-style:none}._frame_is340_24[data-compact]{--line-text: 18px;--line-pad: var(--u-space-1);--line-gap: calc(var(--u-space-1) / 2);font-size:var(--u-text-xs);line-height:var(--line-text)}@media(pointer:coarse){._frame_is340_24[data-compact]{--line-pad: var(--u-space-2);--line-gap: var(--u-space-1)}}._frame_is340_24[data-compact]:not([data-two-lines]) ._line_is340_86{grid-template-rows:minmax(calc(var(--line-text) + 2 * var(--line-pad)),auto)}._frame_is340_24[data-compact]:not([data-two-lines]) :is(._labelCell_is340_90,._names_is340_90,._operator_is340_90,._amount_is340_90,._unit_is340_90){padding-bottom:calc(var(--line-pad) - 1px)}._frame_is340_24[data-compact]:not([data-two-lines]) ._assessment_is340_98{padding-bottom:0}._frame_is340_24[data-compact]:not([data-two-lines]) ._assessment_is340_98>:not(._target_is340_102,._worst_is340_102){margin-block:-1px}._frame_is340_24[data-compact] ._disclosure_is340_107{margin-block:-1px}._frame_is340_24[data-compact] ._line_is340_86[data-kind=result]>._amount_is340_90{font-size:var(--u-text-sm);text-underline-offset:3px}._frame_is340_24[data-still]{--disclosure-size: 0px;--disclosure-gap: 0px}._frame_is340_24[data-still] ._disclosure_is340_107{display:none}._list_is340_128,._item_is340_129,._derivation_is340_130{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;margin:0;padding:0;list-style:none}._derivation_is340_130[hidden]{display:none}._derivation_is340_130:not([hidden]){animation:_derivationIn_is340_1 var(--u-duration-fast) var(--u-ease-out)}@keyframes _derivationIn_is340_1{0%{opacity:0}}._item_is340_129{--fall: calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) / 2 - 1px)}._derivation_is340_130{position:relative}._derivation_is340_130:before{content:"";position:absolute;top:0;bottom:0;left:var(--fall);z-index:1;width:2px;background:var(--u-color-accent);pointer-events:none}:not(._derivation_is340_130)>._item_is340_129[data-open]>._line_is340_86:not([data-mark]),:not(._derivation_is340_130)>._item_is340_129>._derivation_is340_130{background-color:var(--u-color-surface-sunken)}._derivation_is340_130 ._line_is340_86{border-top-color:transparent}._line_is340_86{position:relative;display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:baseline;border-top:1px solid var(--u-hairline)}._calculation_is340_51>._item_is340_129:first-child>._line_is340_86:first-child,._calculation_is340_51>._item_is340_129:first-child>._list_is340_128>._item_is340_129:first-child>._line_is340_86{border-top-color:transparent}._line_is340_86[data-foldable]{cursor:pointer}._line_is340_86[data-mark]{background:color-mix(in srgb,var(--u-color-accent-subtle) 50%,transparent)}._line_is340_86[data-mark=use]{background:var(--u-color-accent-subtle)}._labelCell_is340_90,._names_is340_90,._operator_is340_90,._amount_is340_90,._unit_is340_90,._assessment_is340_98{grid-row:1;padding-top:var(--line-pad);padding-bottom:var(--line-pad)}._labelCell_is340_90{grid-column:1;display:flex;align-items:baseline;gap:var(--disclosure-gap);min-width:0;padding-left:calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5));padding-right:var(--u-space-5)}._label_is340_90{min-width:0;color:var(--u-color-text)}._line_is340_86[data-reference] ._label_is340_90{font-style:italic;color:var(--u-color-text-secondary)}._disclosure_is340_107{flex:none;align-self:center;display:inline-flex;align-items:center;justify-content:center;width:var(--disclosure-size);height:var(--disclosure-size);padding:0;border:none;border-radius:var(--u-radius-xs);corner-shape:squircle;background:none;color:var(--u-color-text-muted)}button._disclosure_is340_107{box-sizing:border-box}button._disclosure_is340_107{cursor:pointer}button._disclosure_is340_107:hover,._line_is340_86[data-foldable]:hover button._disclosure_is340_107{box-sizing:border-box}button._disclosure_is340_107:hover,._line_is340_86[data-foldable]:hover button._disclosure_is340_107{background:var(--u-color-surface-sunken);color:var(--u-color-text)}button._disclosure_is340_107:active,._line_is340_86[data-foldable]:active button._disclosure_is340_107{box-sizing:border-box}button._disclosure_is340_107:active,._line_is340_86[data-foldable]:active button._disclosure_is340_107{background:var(--u-color-surface-pressed)}._item_is340_129[data-open]>._line_is340_86 button._disclosure_is340_107{box-sizing:border-box}._item_is340_129[data-open]>._line_is340_86 button._disclosure_is340_107{color:var(--u-color-accent)}button._disclosure_is340_107:focus-visible{box-sizing:border-box}button._disclosure_is340_107:focus-visible{outline:2px solid transparent;box-shadow:var(--u-focus-ring)}._disclosure_is340_107 svg{box-sizing:border-box}._disclosure_is340_107 svg{transition:transform var(--u-transition-path)}._disclosure_is340_107 svg[data-open]{box-sizing:border-box}._disclosure_is340_107 svg[data-open]{transform:rotate(90deg)}._names_is340_90{grid-column:2;min-width:0;overflow:hidden;padding-right:var(--u-space-4);white-space:nowrap;text-overflow:ellipsis;color:var(--u-color-text-secondary)}._operator_is340_90,._amount_is340_90,._unit_is340_90{font-family:var(--u-font-mono);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}._operator_is340_90{grid-column:3;padding-right:var(--u-space-3);text-align:right;color:var(--u-color-text-secondary)}._amount_is340_90{grid-column:var(--column, 4);text-align:right;color:var(--u-color-text)}._amount_is340_90[data-verdict=unknown]{color:var(--u-color-text-secondary)}._approximate_is340_345{display:inline-block;margin-right:var(--u-space-1);color:var(--u-color-text-secondary);cursor:help}._unit_is340_90{grid-column:var(--column, 5);padding-left:var(--u-space-1);padding-right:var(--u-space-3);color:var(--u-color-text-secondary)}._assessment_is340_98{grid-column:var(--assessment-column, 6);display:flex;align-items:baseline;justify-content:flex-end;gap:var(--u-space-2);padding-right:var(--u-space-3);white-space:nowrap}._assessment_is340_98:empty{padding-right:0}._target_is340_102,._worst_is340_102{font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._worst_is340_102:before{content:"● "}._worst_is340_102[data-verdict=unknown]:before{color:var(--u-color-text-muted)}._worst_is340_102[data-verdict=warning]:before{color:var(--u-color-warning)}._worst_is340_102[data-verdict=alarm]:before{color:var(--u-color-danger-text)}._line_is340_86[data-inner]>._amount_is340_90{color:var(--u-color-text-secondary)}._line_is340_86[data-kind=interim] ._label_is340_90,._line_is340_86[data-kind=interim]>._amount_is340_90{font-weight:var(--u-weight-medium)}._line_is340_86[data-emphasis=strong] ._label_is340_90,._line_is340_86[data-emphasis=strong]>._amount_is340_90{font-weight:var(--u-weight-semibold);color:var(--u-color-text)}._line_is340_86[data-emphasis=muted] ._label_is340_90,._line_is340_86[data-emphasis=muted]>._amount_is340_90{color:var(--u-color-text-secondary)}._line_is340_86[data-inner][data-emphasis=muted] ._label_is340_90,._line_is340_86[data-inner][data-emphasis=muted]>._amount_is340_90{color:var(--u-color-text-muted)}._line_is340_86[data-rule],._derivation_is340_130 ._line_is340_86[data-rule]{border-top:1px solid var(--u-color-text-secondary)}._line_is340_86[data-kind=interim]:before{content:"";grid-row:1;grid-column:3 / var(--figures-end, 6);align-self:start;border-top:1px solid var(--u-color-text-secondary);pointer-events:none}._line_is340_86[data-closing] ._label_is340_90{font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary)}._line_is340_86[data-closing]:before{content:"";grid-row:1;grid-column:3 / var(--figures-end, 6);align-self:start;border-top:1px solid var(--u-color-text-muted);pointer-events:none}._line_is340_86[data-kind=result]{border-top:1px solid var(--u-edge-color-strong)}._line_is340_86[data-kind=result]:not([data-mark]){background:var(--u-color-surface-sunken)}._line_is340_86[data-kind=result] ._label_is340_90{font-weight:var(--u-weight-semibold)}._line_is340_86[data-kind=result]>._amount_is340_90{font-size:var(--u-text-md);font-weight:var(--u-weight-semibold)}._line_is340_86[data-kind=result]>._amount_is340_90:not([data-verdict=unknown]){text-decoration-line:underline;text-decoration-style:double;text-underline-offset:5px}._amount_is340_90[data-later]{padding-left:var(--u-space-6)}._head_is340_497{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:end}._headCell_is340_504{grid-row:1;grid-column:var(--column);display:flex;flex-direction:column;align-items:flex-end;padding:var(--line-pad) 0 var(--u-space-1);font-size:var(--u-text-xs);font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary);white-space:nowrap}._headUnit_is340_517{font-family:var(--u-font-mono);font-weight:var(--u-weight-regular)}._notes_is340_524{grid-row:2;grid-column:1 / 3;display:flex;flex-wrap:wrap;align-items:center;column-gap:var(--u-space-3);margin-top:calc(-1 * var(--line-gap));padding:0 var(--u-space-4) var(--line-pad) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._freshness_is340_538[data-freshness=stale]{color:var(--u-color-warning)}._freshness_is340_538[data-freshness=lost]{color:var(--u-color-danger-text);font-weight:var(--u-weight-medium)}@container (max-width: 34rem){._calculation_is340_51{grid-template-columns:minmax(0,1fr) 0 auto var(--figure-tracks, auto auto) 0}._amount_is340_90[data-later]{padding-left:var(--u-space-2)}._frame_is340_24[data-metrics] ._unit_is340_90:not([data-last]){padding-right:var(--u-space-2)}._headCell_is340_504[data-unit] ._headLabel_is340_568,._names_is340_90{display:none}._labelCell_is340_90{padding-right:var(--u-space-3)}._assessment_is340_98:not(:empty){grid-area:2 / 1 / 3 / -1;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow:hidden;padding:0 var(--u-space-3) var(--line-pad) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));white-space:normal}._frame_is340_24[data-compact]:not([data-two-lines]) ._assessment_is340_98:not(:empty){padding-bottom:var(--line-pad)}._frame_is340_24[data-compact]:not([data-two-lines]) ._assessment_is340_98:not(:empty)>:not(._target_is340_102,._worst_is340_102){margin-block:0}._notes_is340_524{grid-row:3;grid-column:1 / -1}}._frame_is340_24[data-two-lines] ._labelCell_is340_90{grid-column:1 / -1;padding-bottom:0}._frame_is340_24[data-two-lines] ._names_is340_90{display:none}._frame_is340_24[data-two-lines] ._line_is340_86>._operator_is340_90,._frame_is340_24[data-two-lines] ._line_is340_86>._amount_is340_90,._frame_is340_24[data-two-lines] ._line_is340_86>._unit_is340_90{grid-row:2;padding-top:var(--line-gap)}._frame_is340_24[data-two-lines] ._line_is340_86[data-kind=interim]:before,._frame_is340_24[data-two-lines] ._line_is340_86[data-closing]:before{grid-row:2}._frame_is340_24[data-two-lines] ._assessment_is340_98:not(:empty){grid-area:3 / 1 / 4 / -1;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow:hidden;padding:0 var(--u-space-3) var(--line-pad) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));white-space:normal}._frame_is340_24[data-two-lines] ._notes_is340_524{grid-row:4;grid-column:1 / -1}@media(prefers-reduced-motion:reduce){._disclosure_is340_107 svg{transition:none}._derivation_is340_130:not([hidden]){animation:none}}@media(forced-colors:active){._line_is340_86[data-mark]{outline:1px solid Highlight;outline-offset:-1px}._line_is340_86[data-mark=use]{outline-width:2px;outline-offset:-2px}._derivation_is340_130:before{background:CanvasText}._line_is340_86[data-emphasis=muted] ._label_is340_90,._line_is340_86[data-emphasis=muted]>._amount_is340_90{color:GrayText}}}
|
|
1
|
+
@layer umriss.tokens,umriss.base,umriss.components;@layer umriss.base{._text_18806_22{font-family:var(--u-font-sans);font-size:var(--u-text-md);line-height:var(--u-leading-normal);color:var(--u-color-text);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}@media(pointer:fine){._dense_18806_38{--u-control-height-sm: var(--u-control-height-xs)}}._ink_18806_49{--u-color-text: var(--u-color-bg);--u-color-text-secondary: color-mix(in srgb, var(--u-color-bg) 75%, transparent);--u-color-text-muted: color-mix(in srgb, var(--u-color-bg) 60%, transparent)}._extent_18806_75{--_chars: 20;--_extra: 0;--_tracking: 0px;--_chrome: 0px;min-inline-size:0;max-inline-size:100%;contain:inline-size;contain-intrinsic-inline-size:calc((var(--_chars) + var(--_extra)) * (1ch + var(--_tracking)) + var(--_chrome))}._field_18806_90{caret-color:var(--u-color-accent)}._scroll_18806_96{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--u-color-text) 25%,transparent) transparent}._scroll_18806_96::-webkit-scrollbar{width:10px;height:10px}._scroll_18806_96::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--u-color-text) 22%,transparent);border-radius:var(--u-radius-full);border:3px solid transparent;background-clip:content-box}._scroll_18806_96::-webkit-scrollbar-track{background:transparent}}@layer umriss.components{._ring_18806_125:focus-visible{outline:2px solid transparent;box-shadow:var(--u-focus-ring)}@media(pointer:coarse){._field_18806_90._field_18806_90,._fieldRoot_18806_145._fieldRoot_18806_145{font-size:16px}}._field_18806_90:-webkit-autofill,._field_18806_90:-webkit-autofill:hover,._field_18806_90:-webkit-autofill:focus{-webkit-box-shadow:inset 0 0 0 1000px var(--u-color-surface),0 0 0 1px var(--u-edge-color-strong);-webkit-text-fill-color:var(--u-color-text);caret-color:var(--u-color-accent)}}@layer umriss.components{._frame_abb5t_24,._frame_abb5t_24:before,._frame_abb5t_24:after{box-sizing:border-box}._calculation_abb5t_51,._calculation_abb5t_51:before,._calculation_abb5t_51:after{box-sizing:border-box}._line_abb5t_86,._line_abb5t_86:before,._line_abb5t_86:after{box-sizing:border-box}._assessment_abb5t_98,._assessment_abb5t_98:before,._assessment_abb5t_98:after{box-sizing:border-box}._disclosure_abb5t_107,._disclosure_abb5t_107:before,._disclosure_abb5t_107:after{box-sizing:border-box}._amount_abb5t_90,._amount_abb5t_90:before,._amount_abb5t_90:after{box-sizing:border-box}._list_abb5t_128,._list_abb5t_128:before,._list_abb5t_128:after{box-sizing:border-box}._item_abb5t_129,._item_abb5t_129:before,._item_abb5t_129:after{box-sizing:border-box}._derivation_abb5t_130,._derivation_abb5t_130:before,._derivation_abb5t_130:after{box-sizing:border-box}._labelCell_abb5t_90,._labelCell_abb5t_90:before,._labelCell_abb5t_90:after{box-sizing:border-box}._names_abb5t_90,._names_abb5t_90:before,._names_abb5t_90:after{box-sizing:border-box}._operator_abb5t_90,._operator_abb5t_90:before,._operator_abb5t_90:after{box-sizing:border-box}._unit_abb5t_90,._unit_abb5t_90:before,._unit_abb5t_90:after{box-sizing:border-box}._label_abb5t_90,._label_abb5t_90:before,._label_abb5t_90:after{box-sizing:border-box}._approximate_abb5t_345,._approximate_abb5t_345:before,._approximate_abb5t_345:after{box-sizing:border-box}._target_abb5t_102,._target_abb5t_102:before,._target_abb5t_102:after{box-sizing:border-box}._worst_abb5t_102,._worst_abb5t_102:before,._worst_abb5t_102:after{box-sizing:border-box}._head_abb5t_497,._head_abb5t_497:before,._head_abb5t_497:after{box-sizing:border-box}._headCell_abb5t_504,._headCell_abb5t_504:before,._headCell_abb5t_504:after{box-sizing:border-box}._headUnit_abb5t_517,._headUnit_abb5t_517:before,._headUnit_abb5t_517:after{box-sizing:border-box}._notes_abb5t_524,._notes_abb5t_524:before,._notes_abb5t_524:after{box-sizing:border-box}._freshness_abb5t_538,._freshness_abb5t_538:before,._freshness_abb5t_538:after{box-sizing:border-box}._headLabel_abb5t_568,._headLabel_abb5t_568:before,._headLabel_abb5t_568:after{box-sizing:border-box}._frame_abb5t_24{font-size:var(--u-text-sm);border-radius:var(--u-radius-md);corner-shape:squircle;background:var(--u-color-surface);outline:1px solid transparent;box-shadow:var(--u-edge);overflow-x:auto;overflow-y:hidden;--disclosure-size: 20px;--disclosure-gap: var(--u-space-2);--line-pad: var(--u-space-2);--line-gap: var(--u-space-1);container-type:inline-size;width:100%}._calculation_abb5t_51{display:grid;grid-template-columns:fit-content(22rem) minmax(0,1fr) auto var(--figure-tracks, auto auto) auto;margin:0;padding:0;list-style:none}._frame_abb5t_24[data-compact]{--line-text: 18px;--line-pad: var(--u-space-1);--line-gap: calc(var(--u-space-1) / 2);font-size:var(--u-text-xs);line-height:var(--line-text)}@media(pointer:coarse){._frame_abb5t_24[data-compact]{--line-pad: var(--u-space-2);--line-gap: var(--u-space-1)}}._frame_abb5t_24[data-compact]:not([data-two-lines]) ._line_abb5t_86{grid-template-rows:minmax(calc(var(--line-text) + 2 * var(--line-pad)),auto)}._frame_abb5t_24[data-compact]:not([data-two-lines]) :is(._labelCell_abb5t_90,._names_abb5t_90,._operator_abb5t_90,._amount_abb5t_90,._unit_abb5t_90){padding-bottom:calc(var(--line-pad) - 1px)}._frame_abb5t_24[data-compact]:not([data-two-lines]) ._assessment_abb5t_98{padding-bottom:0}._frame_abb5t_24[data-compact]:not([data-two-lines]) ._assessment_abb5t_98>:not(._target_abb5t_102,._worst_abb5t_102){margin-block:-1px}._frame_abb5t_24[data-compact] ._disclosure_abb5t_107{margin-block:-1px}._frame_abb5t_24[data-compact] ._line_abb5t_86[data-kind=result]>._amount_abb5t_90{font-size:var(--u-text-sm);text-underline-offset:3px}._frame_abb5t_24[data-still]{--disclosure-size: 0px;--disclosure-gap: 0px}._frame_abb5t_24[data-still] ._disclosure_abb5t_107{display:none}._list_abb5t_128,._item_abb5t_129,._derivation_abb5t_130{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;margin:0;padding:0;list-style:none}._derivation_abb5t_130[hidden]{display:none}._derivation_abb5t_130:not([hidden]){animation:_derivationIn_abb5t_1 var(--u-duration-fast) var(--u-ease-out)}@keyframes _derivationIn_abb5t_1{0%{opacity:0}}._item_abb5t_129{--fall: calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) / 2 - 1px)}._derivation_abb5t_130{position:relative}._derivation_abb5t_130:before{content:"";position:absolute;top:0;bottom:0;left:var(--fall);z-index:1;width:2px;background:var(--u-color-accent);pointer-events:none}:not(._derivation_abb5t_130)>._item_abb5t_129[data-open]>._line_abb5t_86:not([data-mark]),:not(._derivation_abb5t_130)>._item_abb5t_129>._derivation_abb5t_130{background-color:var(--u-color-surface-sunken)}._derivation_abb5t_130 ._line_abb5t_86{border-top-color:transparent}._line_abb5t_86{position:relative;display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:baseline;border-top:1px solid var(--u-hairline)}._calculation_abb5t_51>._item_abb5t_129:first-child>._line_abb5t_86:first-child,._calculation_abb5t_51>._item_abb5t_129:first-child>._list_abb5t_128>._item_abb5t_129:first-child>._line_abb5t_86{border-top-color:transparent}._line_abb5t_86[data-foldable]{cursor:pointer}._line_abb5t_86[data-mark]{background:color-mix(in srgb,var(--u-color-accent-subtle) 50%,transparent)}._line_abb5t_86[data-mark=use]{background:var(--u-color-accent-subtle)}._labelCell_abb5t_90,._names_abb5t_90,._operator_abb5t_90,._amount_abb5t_90,._unit_abb5t_90,._assessment_abb5t_98{grid-row:1;padding-top:var(--line-pad);padding-bottom:var(--line-pad)}._labelCell_abb5t_90{grid-column:1;display:flex;align-items:baseline;gap:var(--disclosure-gap);min-width:0;padding-left:calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5));padding-right:var(--u-space-5)}._label_abb5t_90{min-width:0;color:var(--u-color-text)}._line_abb5t_86[data-reference] ._label_abb5t_90{font-style:italic;color:var(--u-color-text-secondary)}._disclosure_abb5t_107{flex:none;align-self:center;display:inline-flex;align-items:center;justify-content:center;width:var(--disclosure-size);height:var(--disclosure-size);padding:0;border:none;border-radius:var(--u-radius-xs);corner-shape:squircle;background:none;color:var(--u-color-text-muted)}button._disclosure_abb5t_107{box-sizing:border-box}button._disclosure_abb5t_107{cursor:pointer}button._disclosure_abb5t_107:hover,._line_abb5t_86[data-foldable]:hover button._disclosure_abb5t_107{box-sizing:border-box}button._disclosure_abb5t_107:hover,._line_abb5t_86[data-foldable]:hover button._disclosure_abb5t_107{background:var(--u-color-surface-sunken);color:var(--u-color-text)}button._disclosure_abb5t_107:active,._line_abb5t_86[data-foldable]:active button._disclosure_abb5t_107{box-sizing:border-box}button._disclosure_abb5t_107:active,._line_abb5t_86[data-foldable]:active button._disclosure_abb5t_107{background:var(--u-color-surface-pressed)}._item_abb5t_129[data-open]>._line_abb5t_86 button._disclosure_abb5t_107{box-sizing:border-box}._item_abb5t_129[data-open]>._line_abb5t_86 button._disclosure_abb5t_107{color:var(--u-color-accent)}button._disclosure_abb5t_107:focus-visible{box-sizing:border-box}button._disclosure_abb5t_107:focus-visible{outline:2px solid transparent;box-shadow:var(--u-focus-ring)}._disclosure_abb5t_107 svg{box-sizing:border-box}._disclosure_abb5t_107 svg{transition:transform var(--u-transition-path)}._disclosure_abb5t_107 svg[data-open]{box-sizing:border-box}._disclosure_abb5t_107 svg[data-open]{transform:rotate(90deg)}._names_abb5t_90{grid-column:2;min-width:0;overflow:hidden;padding-right:var(--u-space-4);white-space:nowrap;text-overflow:ellipsis;color:var(--u-color-text-secondary)}._operator_abb5t_90,._amount_abb5t_90,._unit_abb5t_90{font-family:var(--u-font-mono);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}._operator_abb5t_90{grid-column:3;padding-right:var(--u-space-3);text-align:right;color:var(--u-color-text-secondary)}._amount_abb5t_90{grid-column:var(--column, 4);text-align:right;color:var(--u-color-text)}._amount_abb5t_90[data-verdict=unknown]{color:var(--u-color-text-secondary)}._approximate_abb5t_345{display:inline-block;margin-right:var(--u-space-1);color:var(--u-color-text-secondary);cursor:help}._unit_abb5t_90{grid-column:var(--column, 5);padding-left:var(--u-space-1);padding-right:var(--u-space-3);color:var(--u-color-text-secondary)}._assessment_abb5t_98{grid-column:var(--assessment-column, 6);display:flex;align-items:baseline;justify-content:flex-end;gap:var(--u-space-2);padding-right:var(--u-space-3);white-space:nowrap}._assessment_abb5t_98:empty{padding-right:0}._target_abb5t_102,._worst_abb5t_102{font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._worst_abb5t_102:before{content:"● "}._worst_abb5t_102[data-verdict=unknown]:before{color:var(--u-color-text-muted)}._worst_abb5t_102[data-verdict=warning]:before{color:var(--u-color-warning)}._worst_abb5t_102[data-verdict=alarm]:before{color:var(--u-color-danger-text)}._line_abb5t_86[data-inner]>._amount_abb5t_90{color:var(--u-color-text-secondary)}._line_abb5t_86[data-kind=interim] ._label_abb5t_90,._line_abb5t_86[data-kind=interim]>._amount_abb5t_90{font-weight:var(--u-weight-medium)}._line_abb5t_86[data-emphasis=strong] ._label_abb5t_90,._line_abb5t_86[data-emphasis=strong]>._amount_abb5t_90{font-weight:var(--u-weight-semibold);color:var(--u-color-text)}._line_abb5t_86[data-emphasis=muted] ._label_abb5t_90,._line_abb5t_86[data-emphasis=muted]>._amount_abb5t_90{color:var(--u-color-text-secondary)}._line_abb5t_86[data-inner][data-emphasis=muted] ._label_abb5t_90,._line_abb5t_86[data-inner][data-emphasis=muted]>._amount_abb5t_90{color:var(--u-color-text-muted)}._line_abb5t_86[data-rule],._derivation_abb5t_130 ._line_abb5t_86[data-rule]{border-top:1px solid var(--u-color-text-secondary)}._line_abb5t_86[data-kind=interim]:before{content:"";grid-row:1;grid-column:3 / var(--figures-end, 6);align-self:start;border-top:1px solid var(--u-color-text-secondary);pointer-events:none}._line_abb5t_86[data-closing] ._label_abb5t_90{font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary)}._line_abb5t_86[data-closing]:before{content:"";grid-row:1;grid-column:3 / var(--figures-end, 6);align-self:start;border-top:1px solid var(--u-color-text-muted);pointer-events:none}._line_abb5t_86[data-kind=result]{border-top:1px solid var(--u-edge-color-strong)}._line_abb5t_86[data-kind=result]:not([data-mark]){background:var(--u-color-surface-sunken)}._line_abb5t_86[data-kind=result] ._label_abb5t_90{font-weight:var(--u-weight-semibold)}._line_abb5t_86[data-kind=result]>._amount_abb5t_90{font-size:var(--u-text-md);font-weight:var(--u-weight-semibold)}._line_abb5t_86[data-kind=result]>._amount_abb5t_90:not([data-verdict=unknown]){text-decoration-line:underline;text-decoration-style:double;text-underline-offset:5px}._amount_abb5t_90[data-later]{padding-left:var(--u-space-6)}._head_abb5t_497{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:end}._headCell_abb5t_504{grid-row:1;grid-column:var(--column);display:flex;flex-direction:column;align-items:flex-end;padding:var(--line-pad) 0 var(--u-space-1);font-size:var(--u-text-xs);font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary);white-space:nowrap}._headUnit_abb5t_517{font-family:var(--u-font-mono);font-weight:var(--u-weight-regular)}._notes_abb5t_524{grid-row:2;grid-column:1 / 3;display:flex;flex-wrap:wrap;align-items:center;column-gap:var(--u-space-3);margin-top:calc(-1 * var(--line-gap));padding:0 var(--u-space-4) var(--line-pad) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._freshness_abb5t_538[data-freshness=stale]{color:var(--u-color-warning)}._freshness_abb5t_538[data-freshness=lost]{color:var(--u-color-danger-text);font-weight:var(--u-weight-medium)}@container (max-width: 34rem){._calculation_abb5t_51{grid-template-columns:minmax(0,1fr) 0 auto var(--figure-tracks, auto auto) 0}._amount_abb5t_90[data-later]{padding-left:var(--u-space-2)}._frame_abb5t_24[data-metrics] ._unit_abb5t_90:not([data-last]){padding-right:var(--u-space-2)}._headCell_abb5t_504[data-unit] ._headLabel_abb5t_568,._names_abb5t_90{display:none}._labelCell_abb5t_90{padding-right:var(--u-space-3)}._assessment_abb5t_98:not(:empty){grid-area:2 / 1 / 3 / -1;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow:hidden;padding:0 var(--u-space-3) var(--line-pad) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));white-space:normal}._frame_abb5t_24[data-compact]:not([data-two-lines]) ._assessment_abb5t_98:not(:empty){padding-bottom:var(--line-pad)}._frame_abb5t_24[data-compact]:not([data-two-lines]) ._assessment_abb5t_98:not(:empty)>:not(._target_abb5t_102,._worst_abb5t_102){margin-block:0}._notes_abb5t_524{grid-row:3;grid-column:1 / -1}}._frame_abb5t_24[data-two-lines] ._labelCell_abb5t_90{grid-column:1 / -1;padding-bottom:0}._frame_abb5t_24[data-two-lines] ._names_abb5t_90{display:none}._frame_abb5t_24[data-two-lines] ._line_abb5t_86>._operator_abb5t_90,._frame_abb5t_24[data-two-lines] ._line_abb5t_86>._amount_abb5t_90,._frame_abb5t_24[data-two-lines] ._line_abb5t_86>._unit_abb5t_90{grid-row:2;padding-top:var(--line-gap)}._frame_abb5t_24[data-two-lines] ._line_abb5t_86[data-kind=interim]:before,._frame_abb5t_24[data-two-lines] ._line_abb5t_86[data-closing]:before{grid-row:2}._frame_abb5t_24[data-two-lines] ._assessment_abb5t_98:not(:empty){grid-area:3 / 1 / 4 / -1;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow:hidden;padding:0 var(--u-space-3) var(--line-pad) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));white-space:normal}._frame_abb5t_24[data-two-lines] ._notes_abb5t_524{grid-row:4;grid-column:1 / -1}@media(prefers-reduced-motion:reduce){._disclosure_abb5t_107 svg{transition:none}._derivation_abb5t_130:not([hidden]){animation:none}}@media(forced-colors:active){._line_abb5t_86[data-mark]{outline:1px solid Highlight;outline-offset:-1px}._line_abb5t_86[data-mark=use]{outline-width:2px;outline-offset:-2px}._derivation_abb5t_130:before{background:CanvasText}._line_abb5t_86[data-emphasis=muted] ._label_abb5t_90,._line_abb5t_86[data-emphasis=muted]>._amount_abb5t_90{color:GrayText}}}
|
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
|
|
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
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(
|
|
7
|
-
return
|
|
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
|
|
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
|
|
17
|
-
const [o, ...
|
|
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 o /
|
|
26
|
+
return o / r[0];
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
const
|
|
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
|
-
const
|
|
39
|
-
typeof
|
|
37
|
+
const a = n.given.value;
|
|
38
|
+
typeof a == "number" && Number.isFinite(a) ? c = a : O = { kind: "missing", label: n.label };
|
|
40
39
|
} else {
|
|
41
|
-
const
|
|
42
|
-
for (const { operand:
|
|
43
|
-
const
|
|
44
|
-
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 =
|
|
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
|
-
|
|
54
|
-
|
|
52
|
+
a.map((g) => Qe(e.quantities.get(g.operand.key), g.shown)),
|
|
53
|
+
f
|
|
55
54
|
);
|
|
56
|
-
l =
|
|
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:
|
|
62
|
-
shown: c === null ? null :
|
|
60
|
+
absence: O,
|
|
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 o of
|
|
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"],
|
|
@@ -85,145 +84,145 @@ const ze = () => null, Ge = () => null, He = () => null, Ke = () => null, Ye = (
|
|
|
85
84
|
[Xe, { name: "Minus", operator: "sum", negated: !0 }],
|
|
86
85
|
[et, { name: "Times", operator: "product" }],
|
|
87
86
|
[tt, { name: "DividedBy", operator: "quotient" }]
|
|
88
|
-
]), de = "<Given>, <Sum>, <Difference>, <Product>, <Quotient> or <Chain>", ye = "a calculation with metrics only adds and subtracts - <Sum>, <Difference>, <Plus>, <Minus>.",
|
|
89
|
-
function
|
|
90
|
-
throw new Error(`@umriss-ui/calculation: ${
|
|
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"];
|
|
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 o =
|
|
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
|
-
`${
|
|
153
|
-
), C.operands = _.map((
|
|
154
|
-
},
|
|
155
|
-
const
|
|
156
|
-
(
|
|
157
|
-
let
|
|
158
|
-
return
|
|
159
|
-
const _ = fe(u,
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
|
|
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) => {
|
|
158
|
+
const _ = fe(u, b, C + 1);
|
|
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 ot(
|
|
197
|
-
return
|
|
198
|
-
const
|
|
199
|
-
for (const [o,
|
|
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 o =
|
|
220
|
+
function rt(e, t, m) {
|
|
221
|
+
const o = e.operands[t];
|
|
223
222
|
if (o.previous) return;
|
|
224
|
-
const
|
|
225
|
-
if (
|
|
226
|
-
const c =
|
|
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,74 +236,73 @@ 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 o =
|
|
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
|
-
},
|
|
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) => {
|
|
269
268
|
if (o || !l.operator) return {};
|
|
270
269
|
if (l.operands.length === 0) return { names: n.calculationNoOperands };
|
|
271
|
-
if (!
|
|
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,
|
|
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 = "
|
|
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,
|
|
305
303
|
assessment: vt,
|
|
306
|
-
disclosure:
|
|
307
|
-
amount:
|
|
304
|
+
disclosure: bt,
|
|
305
|
+
amount: gt,
|
|
308
306
|
list: $t,
|
|
309
307
|
item: _t,
|
|
310
308
|
derivation: yt,
|
|
@@ -322,222 +320,221 @@ const pt = "_frame_is340_24 _text_1krlf_23", mt = "_calculation_is340_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
|
|
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: o ? { "--column": X(
|
|
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: o ? { "--column": Pt(
|
|
390
|
-
"data-last": o &&
|
|
391
|
-
children: o && !d ? void 0 :
|
|
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(a);
|
|
422
|
+
onClick: j ? () => {
|
|
423
|
+
window.getSelection()?.toString() || Q(s);
|
|
427
424
|
} : void 0,
|
|
428
425
|
children: [
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
o ? ft(
|
|
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
|
-
|
|
451
|
-
/* @__PURE__ */
|
|
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: [
|
|
452
449
|
o ? (
|
|
453
450
|
/* Short: which metric. The sentence carries the full reason. */
|
|
454
451
|
o.map(
|
|
455
|
-
(
|
|
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
|
-
|
|
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(
|
|
509
|
+
ref: f,
|
|
510
|
+
className: Bt(h.frame, t),
|
|
514
511
|
style: o ? {
|
|
515
|
-
"--figure-tracks": Array(
|
|
516
|
-
"--figures-end": X(
|
|
517
|
-
"--assessment-column": X(
|
|
518
|
-
...
|
|
519
|
-
} :
|
|
520
|
-
"data-still":
|
|
521
|
-
"data-metrics": o ?
|
|
522
|
-
"data-two-lines":
|
|
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__ */
|
|
521
|
+
children: /* @__PURE__ */ E("ul", { className: h.calculation, ...n, children: [
|
|
525
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.35.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
|
|
|
@@ -1819,8 +1819,7 @@ A bound: a value, a side, a severity.
|
|
|
1819
1819
|
|
|
1820
1820
|
No tolerance band as input. A band is derived - two limits of equal
|
|
1821
1821
|
severity on opposite sides enclose one - and as an input type it would
|
|
1822
|
-
force a `null` on one edge in the one-sided case.
|
|
1823
|
-
case, not the exception.
|
|
1822
|
+
force a `null` on one edge in the one-sided case.
|
|
1824
1823
|
|
|
1825
1824
|
| Prop | Type | Default | Description |
|
|
1826
1825
|
|---|---|---|---|
|
|
@@ -1843,8 +1842,7 @@ type Side = "upper" | "lower";
|
|
|
1843
1842
|
From `@umriss-ui/core`.
|
|
1844
1843
|
|
|
1845
1844
|
How seriously a violation weighs: one severity that advises and one that
|
|
1846
|
-
calls for action. Exactly two
|
|
1847
|
-
the screen, and five colours are noise. For a third distinction one sets a
|
|
1845
|
+
calls for action. Exactly two; for a third distinction one sets a
|
|
1848
1846
|
second limit.
|
|
1849
1847
|
|
|
1850
1848
|
```ts
|
|
@@ -2172,8 +2170,7 @@ A bound: a value, a side, a severity.
|
|
|
2172
2170
|
|
|
2173
2171
|
No tolerance band as input. A band is derived - two limits of equal
|
|
2174
2172
|
severity on opposite sides enclose one - and as an input type it would
|
|
2175
|
-
force a `null` on one edge in the one-sided case.
|
|
2176
|
-
case, not the exception.
|
|
2173
|
+
force a `null` on one edge in the one-sided case.
|
|
2177
2174
|
|
|
2178
2175
|
| Prop | Type | Default | Description |
|
|
2179
2176
|
|---|---|---|---|
|
|
@@ -2196,8 +2193,7 @@ type Side = "upper" | "lower";
|
|
|
2196
2193
|
From `@umriss-ui/core`.
|
|
2197
2194
|
|
|
2198
2195
|
How seriously a violation weighs: one severity that advises and one that
|
|
2199
|
-
calls for action. Exactly two
|
|
2200
|
-
the screen, and five colours are noise. For a third distinction one sets a
|
|
2196
|
+
calls for action. Exactly two; for a third distinction one sets a
|
|
2201
2197
|
second limit.
|
|
2202
2198
|
|
|
2203
2199
|
```ts
|
|
@@ -2808,8 +2804,7 @@ A bound: a value, a side, a severity.
|
|
|
2808
2804
|
|
|
2809
2805
|
No tolerance band as input. A band is derived - two limits of equal
|
|
2810
2806
|
severity on opposite sides enclose one - and as an input type it would
|
|
2811
|
-
force a `null` on one edge in the one-sided case.
|
|
2812
|
-
case, not the exception.
|
|
2807
|
+
force a `null` on one edge in the one-sided case.
|
|
2813
2808
|
|
|
2814
2809
|
| Prop | Type | Default | Description |
|
|
2815
2810
|
|---|---|---|---|
|
|
@@ -2832,8 +2827,7 @@ type Side = "upper" | "lower";
|
|
|
2832
2827
|
From `@umriss-ui/core`.
|
|
2833
2828
|
|
|
2834
2829
|
How seriously a violation weighs: one severity that advises and one that
|
|
2835
|
-
calls for action. Exactly two
|
|
2836
|
-
the screen, and five colours are noise. For a third distinction one sets a
|
|
2830
|
+
calls for action. Exactly two; for a third distinction one sets a
|
|
2837
2831
|
second limit.
|
|
2838
2832
|
|
|
2839
2833
|
```ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umriss-ui/calculation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.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.35.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.35.0",
|
|
65
65
|
"@umriss-ui/demo": "0.0.0"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
@@ -71,8 +71,9 @@
|
|
|
71
71
|
"build": "vite build",
|
|
72
72
|
"prebuild:demo": "pnpm run props",
|
|
73
73
|
"build:demo": "vite build --config vite.demo.config.ts",
|
|
74
|
-
"pretypecheck": "pnpm run props",
|
|
75
74
|
"typecheck": "tsc --noEmit",
|
|
75
|
+
"typecheck:demo": "pnpm run props && tsc --noEmit -p tsconfig.demo.json",
|
|
76
|
+
"check:site": "pnpm run props -- --check",
|
|
76
77
|
"preview:demo": "vite preview --config vite.demo.config.ts --port 4177 --strictPort",
|
|
77
78
|
"test:unit": "vitest run",
|
|
78
79
|
"check:dist": "node --disable-warning=ExperimentalWarning --experimental-strip-types ../../scripts/check-dist.ts calculation.js calculation.css"
|