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