@oicl/openbridge-webcomponents 2.0.0-next.152 → 2.0.0-next.154

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.
Files changed (70) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +5026 -4717
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +701 -107
  4. package/dist/alert-severity.d.ts +19 -1
  5. package/dist/alert-severity.d.ts.map +1 -1
  6. package/dist/alert-severity.js +48 -2
  7. package/dist/alert-severity.js.map +1 -1
  8. package/dist/components/alert-button/alert-button.css.js +7 -1513
  9. package/dist/components/alert-button/alert-button.css.js.map +1 -1
  10. package/dist/components/alert-button/alert-button.d.ts +50 -86
  11. package/dist/components/alert-button/alert-button.d.ts.map +1 -1
  12. package/dist/components/alert-button/alert-button.js +40 -107
  13. package/dist/components/alert-button/alert-button.js.map +1 -1
  14. package/dist/components/alert-button-item/alert-button-item.css.js +1570 -0
  15. package/dist/components/alert-button-item/alert-button-item.css.js.map +1 -0
  16. package/dist/components/alert-button-item/alert-button-item.d.ts +162 -0
  17. package/dist/components/alert-button-item/alert-button-item.d.ts.map +1 -0
  18. package/dist/components/alert-button-item/alert-button-item.js +210 -0
  19. package/dist/components/alert-button-item/alert-button-item.js.map +1 -0
  20. package/dist/components/alert-counter-item/alert-counter-item.css.js +25 -0
  21. package/dist/components/alert-counter-item/alert-counter-item.css.js.map +1 -0
  22. package/dist/components/alert-counter-item/alert-counter-item.d.ts +77 -0
  23. package/dist/components/alert-counter-item/alert-counter-item.d.ts.map +1 -0
  24. package/dist/components/alert-counter-item/alert-counter-item.js +87 -0
  25. package/dist/components/alert-counter-item/alert-counter-item.js.map +1 -0
  26. package/dist/components/alert-frame/alert-frame.css.js +23 -27
  27. package/dist/components/alert-frame/alert-frame.css.js.map +1 -1
  28. package/dist/components/alert-frame/alert-frame.d.ts +7 -6
  29. package/dist/components/alert-frame/alert-frame.d.ts.map +1 -1
  30. package/dist/components/alert-frame/alert-frame.js +6 -9
  31. package/dist/components/alert-frame/alert-frame.js.map +1 -1
  32. package/dist/components/alert-list-details-experimental/alert-list-details-experimental.css.js +3 -7
  33. package/dist/components/alert-list-details-experimental/alert-list-details-experimental.css.js.map +1 -1
  34. package/dist/components/alert-list-details-experimental/alert-list-details-experimental.d.ts +133 -14
  35. package/dist/components/alert-list-details-experimental/alert-list-details-experimental.d.ts.map +1 -1
  36. package/dist/components/alert-list-details-experimental/alert-list-details-experimental.js +330 -233
  37. package/dist/components/alert-list-details-experimental/alert-list-details-experimental.js.map +1 -1
  38. package/dist/components/table/table.d.ts.map +1 -1
  39. package/dist/components/table/table.js +10 -2
  40. package/dist/components/table/table.js.map +1 -1
  41. package/dist/components/tree-navigation-item/tree-navigation-item.d.ts +7 -34
  42. package/dist/components/tree-navigation-item/tree-navigation-item.d.ts.map +1 -1
  43. package/dist/components/tree-navigation-item/tree-navigation-item.js +3 -32
  44. package/dist/components/tree-navigation-item/tree-navigation-item.js.map +1 -1
  45. package/dist/generated/locales/es-419.d.ts +11 -3
  46. package/dist/generated/locales/es-419.d.ts.map +1 -1
  47. package/dist/generated/locales/es-419.js +11 -3
  48. package/dist/generated/locales/es-419.js.map +1 -1
  49. package/dist/generated/locales/fi-FI.d.ts +8 -0
  50. package/dist/generated/locales/fi-FI.d.ts.map +1 -1
  51. package/dist/generated/locales/fi-FI.js +8 -0
  52. package/dist/generated/locales/fi-FI.js.map +1 -1
  53. package/dist/navigation-instruments/readout/readout.css.js +4 -29
  54. package/dist/navigation-instruments/readout/readout.css.js.map +1 -1
  55. package/dist/navigation-instruments/readout/readout.d.ts.map +1 -1
  56. package/dist/navigation-instruments/readout/readout.js +1 -9
  57. package/dist/navigation-instruments/readout/readout.js.map +1 -1
  58. package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js +5 -34
  59. package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js.map +1 -1
  60. package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts.map +1 -1
  61. package/dist/navigation-instruments/readout-list-item/readout-list-item.js +1 -9
  62. package/dist/navigation-instruments/readout-list-item/readout-list-item.js.map +1 -1
  63. package/dist/palettes/blinking.d.ts +6 -2
  64. package/dist/palettes/blinking.d.ts.map +1 -1
  65. package/dist/palettes/blinking.js +6 -2
  66. package/dist/palettes/blinking.js.map +1 -1
  67. package/dist/types.d.ts +15 -0
  68. package/dist/types.d.ts.map +1 -1
  69. package/dist/types.js.map +1 -1
  70. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"readout-list-item.js","sources":["../../../src/navigation-instruments/readout-list-item/readout-list-item.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS, type TemplateResult} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport componentStyle from './readout-list-item.css?inline';\nimport {customElement} from '../../decorator.js';\nimport '../../components/textbox/textbox.js';\nimport {\n ObcTextboxSize,\n ObcTextboxFontWeight,\n} from '../../components/textbox/textbox.js';\nimport '../../building-blocks/readout-block/readout-block.js';\nimport '../../icons/icon-delta.js';\nimport {\n ReadoutBlockVariant,\n ReadoutBlockSize,\n ReadoutBlockDataQuality,\n ReadoutBlockHidePhase,\n ReadoutAdviceCategory,\n} from '../../building-blocks/readout-block/readout-block.js';\nimport {\n assertReadoutValueType,\n assertReadoutFractionDigits,\n isReadoutDigitCountMissing,\n resolveReadoutDigitCount,\n resolveReadoutNumericValue,\n ReadoutValueType,\n type ReadoutNumericFormatOptions,\n} from '../readout/readout-formatters.js';\nimport {\n isDisplayedAtSetpoint,\n readoutNumericFormatOptions,\n readoutPrimarySize,\n readoutSecondarySize,\n readoutSetpointSize,\n readoutValueSize,\n readoutSetpointWeight,\n readoutDataQualityClasses,\n resolveSetpointHidePhase,\n} from '../readout/readout-shared.js';\nimport {\n type AlertFrameConfig,\n wrapWithAlertFrame,\n ObcAlertFrameType,\n ObcAlertFrameThickness,\n ObcAlertFrameMode,\n} from '../../components/alert-frame/alert-frame.js';\nimport {AlertType, FlashingSpeed} from '../../types.js';\n\n// The value weight maps straight to obc-textbox's font weights (regular /\n// semibold / bold). Re-exported so consumers can set `valueOptions.weight`\n// without a second import path.\nexport {ObcTextboxFontWeight} from '../../components/textbox/textbox.js';\n\n// Re-exported so consumers can type `valueType` without a second import path.\nexport {ReadoutValueType} from '../readout/readout-formatters.js';\n\n// Re-exported so consumers can set `adviceOptions.category` without a second\n// import path.\nexport {ReadoutAdviceCategory} from '../../building-blocks/readout-block/readout-block.js';\n\n/**\n * Density/size scale of the readout row (an alias of `ReadoutBlockSize`).\n * - `small`: regular value typography (smallest, densest).\n * - `medium`: medium value typography.\n * - `large`: large value typography.\n */\nexport const ReadoutListItemSize = ReadoutBlockSize;\nexport type ReadoutListItemSize = ReadoutBlockSize;\n\n/**\n * Placement of the unit/source relative to the label and value.\n * - `trailing-unit`: unit after the value, source after a trailing divider.\n * - `leading-unit`: unit beside/under the label.\n * - `leading-src`: source under the label (no trailing source).\n * - `leading-src-inline`: source on the label's line, after it (no trailing\n * source); keeps the row one line high.\n */\nexport enum ReadoutListItemStacking {\n trailingUnit = 'trailing-unit',\n leadingUnit = 'leading-unit',\n leadingSrc = 'leading-src',\n leadingSrcInline = 'leading-src-inline',\n}\n\n/**\n * Colour emphasis of the value.\n * - `regular`: neutral.\n * - `enhanced`: accented (in-command) colour.\n */\nexport enum ReadoutListItemPriority {\n regular = 'regular',\n enhanced = 'enhanced',\n}\n\n/**\n * Measurement quality of the value (an alias of `ReadoutBlockDataQuality`).\n * Orthogonal to the row-level `alert` – a low-integrity or invalid value can\n * also sit inside an alert frame.\n */\nexport const ReadoutListItemDataQuality = ReadoutBlockDataQuality;\nexport type ReadoutListItemDataQuality = ReadoutBlockDataQuality;\n\n/**\n * Corner style of the interactive (clickable) surface.\n * - `squared` (default): no rounding (true rectangle).\n * - `round-corners`: larger rounded corners.\n * - `round`: fully rounded (pill).\n */\nexport enum ReadoutListItemBorder {\n squared = 'squared',\n round = 'round',\n roundCorners = 'round-corners',\n}\n\nexport interface ReadoutListItemClickable {\n border?: ReadoutListItemBorder;\n}\n\n/**\n * Per-block state shared by value / setpoint / advice / src. Each is independent\n * of (and nests inside) the row-level `dataQuality` / `alert` props. All\n * combinations are allowed.\n */\nexport interface ReadoutBlockState {\n /** Per-block measurement quality (low-integrity / invalid). */\n dataQuality?: ReadoutListItemDataQuality;\n /** Per-block alert frame; nests inside any row-level alert frame. */\n alert?: false | AlertFrameConfig;\n}\n\n/**\n * Per-value options. Unlike setpoint/advice, the value's `alert` frame AND\n * `dataQuality` chip wrap the whole reading — value (+ value-icon) + degree +\n * trailing unit — rather than the value alone. The alert frame is a pure overlay\n * (4px/2px padding, stroke centred on that line); the data-quality chip reuses\n * the block chip's `outline` styling with no extra padding. Neither shifts\n * content or changes the row height / column alignment (Figma 58:10120).\n */\nexport interface ReadoutValueOptions extends ReadoutBlockState {\n /**\n * Render the unfilled leading positions as muted zeroes (requires\n * `maxDigits`). The sign never consumes a zero (`12.3` → `012.3`, `-12.3` →\n * `-012.3` at `maxDigits` 3), so a negative reading is one character wider\n * unless `hasSignSpacer` reserves the sign column; an unavailable value\n * renders dashes across the whole reserved width.\n */\n hintedZeros?: boolean;\n /**\n * Reserve a minus-sign column ahead of the digits, filled by the real sign\n * only while the value is negative — the width does not change across zero.\n * Enable it on rows whose value can go negative; inside `obc-readout-list`\n * the shared column widens automatically once any row shows a sign, but a\n * live value crossing zero still shifts the columns unless the rows that\n * can go negative opt in up front.\n */\n hasSignSpacer?: boolean;\n /**\n * Value font weight — `regular` (default), `semibold`, or `bold` (the\n * obc-textbox weights). Affects weight only; it does NOT change the colour\n * (colour is driven by `priority`).\n */\n weight?: ObcTextboxFontWeight;\n /** Show the `value-icon` slot before the value. */\n hasIcon?: boolean;\n /**\n * Longest value string to reserve width for (e.g. `\"0000.0\"`), so rows align\n * across different value lengths / `fractionDigits` — set the same value on\n * every row. Combined with the `maxDigits`/`fractionDigits`-derived reserve by\n * taking whichever is **wider**, so it never reserves less than the formatted\n * value needs.\n */\n spaceReserver?: string;\n}\n\n/**\n * How the setpoint segment behaves relative to the value.\n * - `always-visible` (default): the setpoint is always shown.\n * - `flip-flop`: value and setpoint swap emphasis (size) as the value reaches\n * the setpoint.\n * - `equal-size`: value and setpoint are always shown at the same (primary)\n * size (Figma 6.1 \"Equal size\") — the value does not demote while\n * `touching`, unlike the other modes.\n * - `pop-up`: the setpoint is shown only while the value has not reached it,\n * then fades out (100ms) once value === setpoint.\n *\n * TODO(designer): in pop-up mode the designer is considering keeping the\n * setpoint arrow visible while the setpoint itself is hidden, so an\n * at-setpoint reading still reads as \"a value you are in control of\". Until\n * that is decided, the `value-icon` slot already covers it — slot an\n * `<obi-input-right>` into the value block (see the\n * `SetpointPopUpWithValueArrow` story).\n */\nexport enum ReadoutListItemSetpointInteraction {\n alwaysVisible = 'always-visible',\n equalSize = 'equal-size',\n flipFlop = 'flip-flop',\n popUp = 'pop-up',\n}\n\nexport interface ReadoutSetpointOptions extends ReadoutBlockState {\n hintedZeros?: boolean;\n /** Reserve a minus-sign column; see {@link ReadoutValueOptions.hasSignSpacer}. */\n hasSignSpacer?: boolean;\n /** How the setpoint behaves relative to the value (default `always-visible`). */\n interaction?: ReadoutListItemSetpointInteraction;\n /**\n * The user is physically interacting with (adjusting) the setpoint — the\n * \"focus\" visual state. Same convention as `touching` on the instrument\n * setpoint marker (`SetpointMixin` / `svghelpers/setpoint.ts`): keeps the\n * setpoint visible and shows the lighter-blue focus triangle.\n */\n touching?: boolean;\n /** Longest value string to reserve width for; see {@link ReadoutValueOptions.spaceReserver}. */\n spaceReserver?: string;\n}\n\nexport interface ReadoutAdviceOptions extends ReadoutBlockState {\n hintedZeros?: boolean;\n /** Reserve a minus-sign column; see {@link ReadoutValueOptions.hasSignSpacer}. */\n hasSignSpacer?: boolean;\n /**\n * Semantic category (Figma 6.1) — picks the default marker icon and the\n * `active` styling; `regular` when unset.\n */\n category?: ReadoutAdviceCategory;\n /** The advice is triggered — filled/status icon + triggered text styling. */\n active?: boolean;\n /** Longest value string to reserve width for; see {@link ReadoutValueOptions.spaceReserver}. */\n spaceReserver?: string;\n}\n\nexport interface ReadoutReserverOptions {\n /**\n * Longest expected string to reserve width for (aligns multiple rows), e.g.\n * `\"miles\"`. A row without a unit still renders the reserved (blank)\n * trailing column, so its value and degree stay on the grid of the rows\n * that have one. `leading-unit` stacking has no trailing column to reserve.\n */\n spaceReserver?: string;\n}\n\n/**\n * Per-label (\"readout-block-title\") options.\n *\n * The label size follows the designer's Figma 6.1 title block, which carries an\n * `xs`/`s` primary-size axis: `s` is the default for stand-alone readouts (a\n * scannable label should not sit at the smallest permitted size), `xs` the\n * default for dense list rows. Values outside `xs`/`s` are not part of the\n * design and are not rejected, but their metrics are unspecified.\n */\nexport interface ReadoutLabelOptions {\n /** Label typography size — `xs` (dense rows) or `s` (stand-alone readouts). */\n size?: ObcTextboxSize;\n /** Longest expected label to reserve width for (aligns stacked readouts). */\n spaceReserver?: string;\n}\n\n/**\n * Emphasis / alert state of the source chip (Figma 6.1 \"Readout-block-source\"\n * State axis; `static`/`enabled` map to `regular`).\n * TODO(designer): the sheet also carries a `Tag` type (xs chip) and an alarm\n * state is absent by design; both left out here.\n */\nexport enum ReadoutSourceState {\n regular = 'regular',\n enhanced = 'enhanced',\n caution = 'caution',\n warning = 'warning',\n}\n\nexport interface ReadoutSrcOptions extends ReadoutBlockState {\n /** Longest expected source string to reserve width for; see {@link ReadoutReserverOptions.spaceReserver}. */\n spaceReserver?: string;\n /**\n * Emphasis / alert state of the source: `enhanced` renders the amplified\n * chip, `caution` / `warning` the matching alert chip. Like the\n * data-quality chip it uses `outline`, so toggling it never shifts the row.\n */\n state?: ReadoutSourceState;\n /**\n * Source deviation (Figma \"Source-deviation\"): renders a Δ + value line\n * under the source name. A non-finite value renders no line.\n */\n deviation?: number;\n}\n\n/**\n * `<obc-readout-list-item>` – A compact, dense readout row for lists and tables.\n *\n * Renders a label, an optional source, an optional unit, and up to three\n * cap-height \"readout building blocks\" – advice, setpoint, and value – each a\n * fixed-width-reservable numeric segment. Dynamic data is passed as top-level\n * primitives (`value`, `setpoint`, `advice`, `label`, `unit`, `src`). Global\n * layout/format is configured via top-level props (`size`, `priority`,\n * `stacking`, `hasDegree`, `dataQuality`, `alert`, …) and per-block tweaks via one\n * object per block (`valueOptions`, `setpointOptions`, `adviceOptions`,\n * `unitOptions`, `srcOptions`).\n *\n * ### Features\n * - **Building blocks:** value, optional setpoint, and optional advice segments,\n * each cap-height-aligned and able to reserve a stable width.\n * - **Sizes:** `small`, `medium`, `large` density scales.\n * - **Stacking:** `trailing-unit`, `leading-unit`, `leading-src`,\n * `leading-src-inline` placement.\n * - **Priority:** `regular`/`enhanced` colour emphasis; per-value `weight`\n * (`regular`/`semibold`/`bold`) is independent of colour.\n * - **Setpoint flip-flop:** swaps emphasis between value and setpoint as the\n * value reaches the setpoint.\n * - **Data quality:** `low-integrity`/`invalid` styling, combinable with `alert`.\n * - **Alert frame:** optional `alert` wrapper (caution/warning/alarm/level).\n * - **Clickable:** optionally rendered as a focusable button with `squared`,\n * `round-corners`, or `round` corners.\n * - **Formatting:** shared `fractionDigits`, width reservation via `maxDigits`\n * and per-segment `hintedZeros`; a `null` value renders a dash (`-`).\n * - **Text values:** `valueType=\"text\"` renders `value` verbatim (e.g.\n * `\"Thermo On\"`) instead of formatting it as a number.\n *\n * ### Usage Guidelines\n * Use for dense readout rows in lists/tables. Prefer `<obc-readout>` for rich\n * multi-segment instrument layouts, source pickers, or flyout behaviour.\n *\n * ### Slots\n * | Slot Name | Renders When | Purpose |\n * |---------------|-------------------------------|------------------------------------------|\n * | leading-icon | `hasLeadingIcon` | Icon before the label. |\n * | value-icon | `valueOptions.hasIcon` | Icon before the value. |\n * | setpoint-icon | `hasSetpoint` | Overrides the default setpoint icon. |\n * | advice-icon | `hasAdvice` | Overrides the default advice icon. |\n *\n * @property hasValue - Layout switch: `false` renders a deliberately value-less (label-only)\n * row that hugs its remaining parts. For a temporarily missing value keep\n * `hasValue` and set `value` to `null` instead — the dash keeps the value\n * block at full size, so the row does not shift when data arrives.\n * @property value - The value; `null` renders a dash. A number by default, or text when\n * `valueType` is `text`.\n * @property valueType - How `value` is interpreted. `number` (default) formats it via\n * `fractionDigits`; `text` renders it verbatim and ignores the numeric\n * format options. Passing text while this is `number` throws.\n * @property off - Render the value as `offText` (e.g. equipment powered down). Affects the value only.\n * @property offText - Text shown in place of the value when `off` is true.\n * @availableWhen offText off==true\n * @availableWhen setpoint hasSetpoint==true\n * @availableWhen advice hasAdvice==true\n * @property fractionDigits - Also formats the numeric setpoint / advice blocks, which stay numeric\n * even when the value is text. Must be between 0 and 100 — the range\n * `Number.prototype.toFixed` accepts; outside it throws a `RangeError`.\n * A fractional count truncates (`2.7` → `2`). A count that never arrived\n * (`NaN`, `null` or unset) renders the reading as the unavailable dash —\n * formatting with a precision the author never chose would let a critical\n * `0.4` pass for a healthy `0`.\n * @availableWhen fractionDigits valueType==number || hasSetpoint==true || hasAdvice==true\n * @property maxDigits - Also formats the numeric setpoint / advice blocks, which stay numeric\n * even when the value is text. Bounded before use: a fractional count\n * truncates (`2.7` → `2`), anything above 100 — including `Infinity` —\n * caps at 100, and a negative count reserves nothing. A count that never\n * arrived (`NaN`, `null` or unset) renders the reading as the unavailable\n * dash, consistent with `fractionDigits`.\n * @availableWhen maxDigits valueType==number || hasSetpoint==true || hasAdvice==true\n * @property showDebugOverlay - Development aid: outline the readout building blocks (red), the degree\n * columns (blue) and the degree spacer (green) so reserver widths / alignment\n * are visible. Off by default.\n * @slot leading-icon - Icon before the label.\n * @slot value-icon - Icon before the value.\n * @slot setpoint-icon - Overrides the default setpoint icon.\n * @slot advice-icon - Overrides the default advice icon.\n * @fires click - Fired when the item is activated. Only fired when `clickable` is set; otherwise the item renders as a non-interactive `<div>`.\n * @beta\n */\n@customElement('obc-readout-list-item')\nexport class ObcReadoutListItem extends LitElement {\n // Primitives (dynamic data)\n @property({type: String}) label?: string;\n @property({type: String}) unit?: string;\n @property({type: String}) src?: string;\n\n @property({type: Boolean, attribute: false}) hasValue = true;\n @property({type: String}) value: number | string | null = null;\n @property({type: String}) valueType: ReadoutValueType =\n ReadoutValueType.number;\n @property({type: Boolean}) off = false;\n @property({type: String}) offText = 'OFF';\n\n @property({type: Boolean}) hasSetpoint = false;\n @property({type: Number}) setpoint?: number;\n\n @property({type: Boolean}) hasAdvice = false;\n @property({type: Number}) advice?: number;\n\n // Global layout/format (each defaults via its `resolved*` getter where useful).\n @property({type: String}) size?: ReadoutListItemSize;\n @property({type: String}) priority?: ReadoutListItemPriority;\n @property({type: String}) stacking?: ReadoutListItemStacking;\n @property({type: Object}) clickable: boolean | ReadoutListItemClickable =\n false;\n @property({type: Boolean}) hasLeadingIcon = false;\n @property({type: Boolean}) hasDegree = false;\n @property({type: Boolean}) hasDegreeSpacer = false;\n @property({type: Number}) fractionDigits = 0;\n @property({type: Number}) maxDigits = 0;\n @property({type: String}) dataQuality?: ReadoutListItemDataQuality;\n // `boolean | …` (not `false | …`): the generated Angular wrapper widens a\n // literal-`false` union to `boolean`, which then won't assign back to a\n // `false`-typed element property. `wrapWithAlertFrame` treats any non-object\n // (incl. `true`) as \"no frame\", so accepting `boolean` is harmless.\n @property({type: Object}) alert: boolean | AlertFrameConfig = false;\n\n // Per-block configuration — one object per block (see the Readout*Options types).\n @property({type: Object}) valueOptions?: ReadoutValueOptions;\n @property({type: Object}) setpointOptions?: ReadoutSetpointOptions;\n @property({type: Object}) adviceOptions?: ReadoutAdviceOptions;\n @property({type: Object}) labelOptions?: ReadoutLabelOptions;\n @property({type: Object}) unitOptions?: ReadoutReserverOptions;\n @property({type: Object}) srcOptions?: ReadoutSrcOptions;\n\n @property({type: Boolean, reflect: true}) showDebugOverlay = false;\n\n /** Pop-up deferred-hide phase for the setpoint (see {@link updated}). */\n @state() private deferredSetpointHidePhase: ReadoutBlockHidePhase =\n ReadoutBlockHidePhase.none;\n private deferredSetpointHideTimer?: number;\n private hasCompletedFirstUpdate = false;\n\n private get resolvedSize(): ReadoutListItemSize {\n return this.size ?? ReadoutListItemSize.small;\n }\n\n private get resolvedStacking(): ReadoutListItemStacking {\n return this.stacking ?? ReadoutListItemStacking.trailingUnit;\n }\n\n /** Both leading-src stackings move the source into the label stack. */\n private get hasLeadingSrc(): boolean {\n const stacking = this.resolvedStacking;\n return (\n stacking === ReadoutListItemStacking.leadingSrc ||\n stacking === ReadoutListItemStacking.leadingSrcInline\n );\n }\n\n private get resolvedPriority(): ReadoutListItemPriority {\n return this.priority ?? ReadoutListItemPriority.regular;\n }\n\n /**\n * Whether a unit box follows the value: a unit, or a reserver alone — the\n * blank reserved column keeps a unit-less row aligned with its neighbours.\n */\n private get hasTrailingUnitBox(): boolean {\n return (\n this.resolvedStacking !== ReadoutListItemStacking.leadingUnit &&\n (Boolean(this.unit) || Boolean(this.unitOptions?.spaceReserver))\n );\n }\n\n private get resolvedFractionDigits(): number {\n return this.fractionDigits ?? 0;\n }\n\n private get resolvedMaxDigits(): number {\n return resolveReadoutDigitCount(this.maxDigits);\n }\n\n /**\n * Whether a digit knob failed to arrive (`NaN` / `null` / `undefined`).\n * The raw knobs are forwarded to the blocks, which render the reading as\n * the unavailable dash (see `obc-readout-block.digitCountsMissing`); this\n * getter only keeps the setpoint comparison in agreement with what is\n * displayed.\n */\n private get digitCountsMissing(): boolean {\n return (\n isReadoutDigitCountMissing(this.fractionDigits) ||\n isReadoutDigitCountMissing(this.maxDigits)\n );\n }\n\n private get resolvedClickable(): false | Required<ReadoutListItemClickable> {\n const clickable = this.clickable;\n if (!clickable) {\n return false;\n }\n if (clickable === true) {\n return {border: ReadoutListItemBorder.squared};\n }\n return {border: clickable.border ?? ReadoutListItemBorder.squared};\n }\n\n private get isAtSetpoint(): boolean {\n if (!this.hasSetpoint) {\n return false;\n }\n // A missing digit knob renders every numeric block as the dash; two\n // dashes must not read as \"at the setpoint\", so the comparison stays off\n // entirely while the configuration is untrustworthy.\n if (this.digitCountsMissing) {\n return false;\n }\n // A text value never compares equal to a setpoint, so flip-flop / pop-up\n // stay dormant for `valueType=\"text\"`.\n return isDisplayedAtSetpoint(\n resolveReadoutNumericValue(this.value, this.valueType) ?? null,\n this.setpoint,\n this.numericFormatOptions(this.resolvedMaxDigits)\n );\n }\n\n private get resolvedSetpointInteraction(): ReadoutListItemSetpointInteraction {\n return (\n this.setpointOptions?.interaction ??\n ReadoutListItemSetpointInteraction.alwaysVisible\n );\n }\n\n private get isFlipFlop(): boolean {\n return (\n this.resolvedSetpointInteraction ===\n ReadoutListItemSetpointInteraction.flipFlop\n );\n }\n\n private get isEqualSize(): boolean {\n return (\n this.resolvedSetpointInteraction ===\n ReadoutListItemSetpointInteraction.equalSize\n );\n }\n\n private get isPopUp(): boolean {\n return (\n this.resolvedSetpointInteraction ===\n ReadoutListItemSetpointInteraction.popUp\n );\n }\n\n private get setpointTouching(): boolean {\n return this.setpointOptions?.touching ?? false;\n }\n\n /**\n * The setpoint is rendered \"emphasised\" (primary size + SemiBold weight) when\n * it is the focus of attention: while actively adjusting (`touching`), or while\n * a flip-flop has the value away from the setpoint. Otherwise it is a secondary\n * (smaller, regular-weight) reference next to the value.\n */\n private get isSetpointEmphasized(): boolean {\n if (!this.hasSetpoint) {\n return false;\n }\n if (this.setpointTouching) {\n return true;\n }\n return this.isFlipFlop && !this.isAtSetpoint;\n }\n\n /**\n * The row's enhanced (in-command) colour state, applied uniformly to BOTH the\n * value and the setpoint — they are always either both neutral or both enhanced\n * (never a blue setpoint next to a grey value). Driven by `priority` only;\n * `valueOptions.weight` changes weight, not colour.\n */\n private get rowEnhanced(): boolean {\n return this.resolvedPriority === ReadoutListItemPriority.enhanced;\n }\n\n /** Primary value-typography size for the current density tier. */\n private get primarySize(): ObcTextboxSize {\n return readoutPrimarySize(this.resolvedSize);\n }\n\n /** Secondary (de-emphasised) value-typography size for the current density tier. */\n private get secondarySize(): ObcTextboxSize {\n return readoutSecondarySize(this.resolvedSize);\n }\n\n private get valueSize(): ObcTextboxSize {\n // The value takes the secondary size whenever the setpoint has the focus\n // (`touching`, or a flip-flop holding the value away from it); `equal-size`\n // opts out and keeps both blocks at the primary size.\n return readoutValueSize({\n primary: this.primarySize,\n secondary: this.secondarySize,\n setpointEmphasized: this.isSetpointEmphasized,\n equalSize: this.isEqualSize,\n });\n }\n\n private get setpointSize(): ObcTextboxSize {\n return readoutSetpointSize({\n primary: this.primarySize,\n secondary: this.secondarySize,\n emphasized: this.isSetpointEmphasized,\n equalSize: this.isEqualSize,\n });\n }\n\n /** Value font weight passes straight to obc-textbox; regular when unset. Colour is separate. */\n private get valueWeight(): ObcTextboxFontWeight {\n return this.valueOptions?.weight ?? ObcTextboxFontWeight.regular;\n }\n\n /** Label size: `xs` for dense list rows unless overridden (see {@link ReadoutLabelOptions}). */\n private get labelSize(): ObcTextboxSize {\n return this.labelOptions?.size ?? ObcTextboxSize.xs;\n }\n\n /**\n * Label weight: SemiBold only for enhanced (in-command) rows, regular\n * otherwise — the designer reduced the amount of semibold in the interface\n * (Figma 6.1 review).\n */\n private get labelWeight(): ObcTextboxFontWeight {\n return this.rowEnhanced\n ? ObcTextboxFontWeight.semibold\n : ObcTextboxFontWeight.regular;\n }\n\n /** Setpoint is SemiBold only while emphasised, otherwise regular weight. */\n private get setpointWeight(): ObcTextboxFontWeight {\n return readoutSetpointWeight(this.isSetpointEmphasized);\n }\n\n private numericFormatOptions(maxDigits: number): ReadoutNumericFormatOptions {\n return readoutNumericFormatOptions(maxDigits, this.resolvedFractionDigits);\n }\n\n /** classMap fragment for a block / source carrying per-block data quality. */\n private dataQualityClasses(\n dataQuality: ReadoutListItemDataQuality | undefined\n ): Record<string, boolean> {\n return readoutDataQualityClasses(dataQuality);\n }\n\n /**\n * Forward the matching list-item icon slot into the block's single `icon`\n * slot. The variant's default marker lives in `obc-readout-block` and shows\n * when nothing is assigned here (an empty forwarded slot flattens to nothing).\n */\n private renderForwardedIcon(variant: ReadoutBlockVariant): TemplateResult {\n if (variant === ReadoutBlockVariant.setpoint) {\n return html`<slot name=\"setpoint-icon\" slot=\"icon\"></slot>`;\n }\n if (variant === ReadoutBlockVariant.advice) {\n return html`<slot name=\"advice-icon\" slot=\"icon\"></slot>`;\n }\n return html`<slot name=\"value-icon\" slot=\"icon\"></slot>`;\n }\n\n private renderBlock(config: {\n variant: ReadoutBlockVariant;\n value: number | string | null | undefined;\n /** Only the value block is ever text; setpoint / advice stay numeric. */\n valueType?: ReadoutValueType;\n valueSize: ObcTextboxSize;\n enhanced: boolean;\n weight: ObcTextboxFontWeight;\n hintedZeros: boolean;\n hasSignSpacer?: boolean;\n spaceReserver?: string;\n off?: boolean;\n hasDegree?: boolean;\n hasIcon?: boolean;\n touching?: boolean;\n hidePhase?: ReadoutBlockHidePhase;\n dataQuality?: ReadoutBlockDataQuality;\n alert?: false | AlertFrameConfig;\n /** Advice-only: semantic category + triggered state. */\n category?: ReadoutAdviceCategory;\n active?: boolean;\n }): TemplateResult {\n // The block owns the formatting, hinted zeros, reserver, degree and icon; the\n // row keeps the density tier (`size`) and the resolved per-block number size\n // (`valueSize`) so flip-flop/pop-up emphasis stays a row decision.\n return html`\n <obc-readout-block\n exportparts=\"block, block-content, block-text, block-icon, degree\"\n .variant=${config.variant}\n .value=${config.value ?? null}\n .valueType=${config.valueType ?? ReadoutValueType.number}\n .size=${this.resolvedSize}\n .valueSize=${config.valueSize}\n .enhanced=${config.enhanced}\n .weight=${config.weight}\n .hasDegree=${config.hasDegree ?? false}\n .hasIcon=${config.hasIcon ?? false}\n .fractionDigits=${this.fractionDigits}\n .maxDigits=${this.maxDigits}\n .hintedZeros=${config.hintedZeros}\n .hasSignSpacer=${config.hasSignSpacer ?? false}\n .spaceReserver=${config.spaceReserver}\n .off=${config.off ?? false}\n .offText=${this.offText}\n .touching=${config.touching ?? false}\n .hidePhase=${config.hidePhase ?? ReadoutBlockHidePhase.none}\n .dataQuality=${config.dataQuality}\n .alert=${config.alert ?? false}\n .category=${config.category ?? ReadoutAdviceCategory.regular}\n .active=${config.active ?? false}\n >\n ${this.renderForwardedIcon(config.variant)}\n </obc-readout-block>\n `;\n }\n\n /**\n * A cap-height `°` column whose width scales with the value size. Used after\n * the value (as the value↔unit boundary, via {@link renderValueUnitGap}) and\n * inside the setpoint / advice blocks. `inherit` makes the glyph take the\n * surrounding block's colour (setpoint/advice); otherwise it uses the value\n * colour, optionally `enhanced`.\n */\n private renderDegreeGlyph(\n size: ObcTextboxSize,\n opts: {enhanced?: boolean; inherit?: boolean} = {}\n ): TemplateResult {\n return html`\n <span\n class=${classMap({\n 'degree-column': true,\n [`degree-${size}`]: true,\n 'tone-enhanced': !opts.inherit && Boolean(opts.enhanced),\n 'degree-inherit': Boolean(opts.inherit),\n })}\n part=\"degree\"\n >\n <obc-textbox class=\"degree-glyph\" .size=${size} alignment=\"center\"\n >°</obc-textbox\n >\n </span>\n `;\n }\n\n /**\n * The gap rendered between the value digits and the unit.\n *\n * - `hasDegree`: a cap-height `°` column whose width scales with the value\n * size (the `°` replaces the default gap).\n * - otherwise: the default 2px gap (only when a trailing unit follows).\n *\n * `hasDegreeSpacer` deliberately does NOT add anything here — it keeps the 2px\n * gap and instead widens the unit column via {@link renderDegreeSpacer} (a\n * spacer AFTER the unit). That way a non-degree row's value digits stay\n * aligned with degree rows (degree column width = spacer width + 2px gap)\n * while its unit shifts left. Mirrors Figma `1:2920` (spacer) / `1:2970`\n * (degree).\n *\n * TODO(designer): cross-size alignment is deferred. Degree rows of different\n * value sizes have different `°` column widths (6/8/12px), so their value digit\n * edges stagger by `degree-width`. For degree rows of mixed sizes you cannot\n * align the value digit edges AND keep the unit column aligned — resolving it\n * needs a design decision (a constant degree reserve, which widens the smaller\n * rows' `°`, OR pinning the value edge and letting the unit column stagger).\n */\n private renderValueUnitGap(): TemplateResult | typeof nothing {\n if (!this.hasValue) {\n return nothing;\n }\n if ((this.hasDegree ?? false) && !this.off) {\n return this.renderDegreeGlyph(this.valueSize, {\n enhanced: this.rowEnhanced,\n });\n }\n if (this.hasTrailingUnitBox) {\n return html`<span class=\"value-unit-gap\" aria-hidden=\"true\"></span>`;\n }\n return nothing;\n }\n\n /**\n * A spacer rendered AFTER the unit when `hasDegreeSpacer` is set on a\n * non-degree row. Its width (`degree-compensation-padding`) = the degree\n * column width minus the 2px gap, so the row's value digits align with degree\n * rows in the same column while its unit shifts left. See\n * {@link renderValueUnitGap}.\n */\n private renderDegreeSpacer(): TemplateResult | typeof nothing {\n const hasDegree = this.hasDegree ?? false;\n const hasDegreeSpacer = this.hasDegreeSpacer ?? false;\n if (hasDegree || !hasDegreeSpacer) {\n return nothing;\n }\n return html`<span\n class=\"degree-spacer\"\n part=\"degree-spacer\"\n aria-hidden=\"true\"\n ></span>`;\n }\n\n private renderTextbox(\n role: 'label' | 'unit' | 'source',\n text: string,\n reserver?: string,\n state?: ReadoutBlockState\n ): TemplateResult {\n // The label carries its own size (labelOptions) and priority-driven weight;\n // unit and source stay xs / regular.\n const weight =\n role === 'label' ? this.labelWeight : ObcTextboxFontWeight.regular;\n const size = role === 'label' ? this.labelSize : ObcTextboxSize.xs;\n const box = html`\n <obc-textbox\n class=${classMap({\n [role]: true,\n ...this.dataQualityClasses(state?.dataQuality),\n })}\n part=${role}\n .size=${size}\n .fontWeight=${weight}\n alignment=\"left\"\n >\n ${text}\n ${reserver ? html`<span slot=\"length\">${reserver}</span>` : nothing}\n </obc-textbox>\n `;\n return wrapWithAlertFrame(state?.alert ?? false, box);\n }\n\n private renderValueCluster(): TemplateResult {\n const popUpAtSetpoint =\n this.isPopUp && this.isAtSetpoint && !this.setpointTouching;\n const setpointHidePhase = resolveSetpointHidePhase(\n popUpAtSetpoint,\n this.deferredSetpointHidePhase\n );\n return html`\n <div class=\"value-cluster\" part=\"value-cluster\">\n ${this.hasAdvice\n ? this.renderBlock({\n variant: ReadoutBlockVariant.advice,\n value: this.advice,\n valueSize: this.secondarySize,\n enhanced: false,\n weight: ObcTextboxFontWeight.regular,\n hintedZeros: this.adviceOptions?.hintedZeros ?? false,\n hasSignSpacer: this.adviceOptions?.hasSignSpacer ?? false,\n spaceReserver: this.adviceOptions?.spaceReserver,\n hasDegree: this.hasDegree ?? false,\n dataQuality: this.adviceOptions?.dataQuality,\n alert: this.adviceOptions?.alert,\n category: this.adviceOptions?.category,\n active: this.adviceOptions?.active,\n })\n : nothing}\n ${this.hasSetpoint\n ? this.renderBlock({\n variant: ReadoutBlockVariant.setpoint,\n value: this.setpoint,\n valueSize: this.setpointSize,\n // Value and setpoint share the enhanced colour state (both neutral\n // or both enhanced); the setpoint is bold only while emphasised.\n enhanced: this.rowEnhanced,\n weight: this.setpointWeight,\n hintedZeros: this.setpointOptions?.hintedZeros ?? false,\n hasSignSpacer: this.setpointOptions?.hasSignSpacer ?? false,\n spaceReserver: this.setpointOptions?.spaceReserver,\n hasDegree: this.hasDegree ?? false,\n touching: this.setpointTouching,\n hidePhase: setpointHidePhase,\n dataQuality: this.setpointOptions?.dataQuality,\n alert: this.setpointOptions?.alert,\n })\n : nothing}\n ${this.renderValueReading()}\n </div>\n `;\n }\n\n /**\n * The value reading: the value block, its degree column and the trailing unit\n * grouped in one relatively-positioned wrapper so the value alert frame AND the\n * value data-quality chip can wrap value + degree + unit together (Figma\n * 58:10120).\n *\n * Moving the degree / unit into this wrapper (the new last child of\n * `.value-cluster`) preserves every existing gap, so the underlying content\n * stays column-aligned with or without the frame / chip. Both the value alert\n * (overlay) and the value data-quality chip are applied here — NOT inside\n * `obc-readout-block` — so they extend over the unit; setpoint/advice keep their\n * own block-level frame and chip. The chip uses `outline` (not `border`), so it\n * never shifts the value's width / column alignment.\n */\n private renderValueReading(): TemplateResult {\n return html`\n <div\n class=${classMap({\n 'value-reading': true,\n ...this.dataQualityClasses(this.valueOptions?.dataQuality),\n })}\n part=\"value-reading\"\n >\n ${this.hasValue\n ? this.renderBlock({\n variant: ReadoutBlockVariant.value,\n value: this.value,\n valueType: this.valueType,\n valueSize: this.valueSize,\n enhanced: this.rowEnhanced,\n weight: this.valueWeight,\n hintedZeros: this.valueOptions?.hintedZeros ?? false,\n hasSignSpacer: this.valueOptions?.hasSignSpacer ?? false,\n spaceReserver: this.valueOptions?.spaceReserver,\n off: this.off,\n hasIcon: this.valueOptions?.hasIcon ?? false,\n })\n : nothing}\n ${this.renderValueUnitGap()}\n <div class=\"unit-area\" part=\"unit-area\">\n ${this.renderTrailingUnit()} ${this.renderDegreeSpacer()}\n </div>\n ${this.renderValueAlertOverlay()}\n </div>\n `;\n }\n\n /**\n * The value alert frame, drawn as a pure overlay around the value reading\n * (value + degree + unit). It reserves no space — the `obc-alert-frame` sits in\n * an absolutely-positioned box offset outward (see `.value-alert-overlay` in\n * the CSS) so its stroke is centred on the 4px/2px padding line and toggling it\n * never shifts content or row height. Renders only when `valueOptions.alert` is\n * a config object.\n */\n private renderValueAlertOverlay(): TemplateResult | typeof nothing {\n const alert = this.valueOptions?.alert;\n if (typeof alert !== 'object' || alert === null) {\n return nothing;\n }\n const thickness = alert.thickness ?? ObcAlertFrameThickness.Small;\n return html`\n <div\n class=${classMap({\n 'value-alert-overlay': true,\n // The outward offset is thickness-dependent (see the CSS): large frames\n // draw a wider outline, so the box must sit further out to stay centred.\n 'thickness-large': thickness === ObcAlertFrameThickness.Large,\n })}\n aria-hidden=\"true\"\n >\n <obc-alert-frame\n part=\"value-alert-frame\"\n .type=${alert.type ?? ObcAlertFrameType.Regular}\n .thickness=${thickness}\n .status=${alert.status ?? AlertType.Alarm}\n .mode=${alert.mode ?? ObcAlertFrameMode.ackedActive}\n .flashingSpeed=${alert.flashingSpeed ?? FlashingSpeed.Default}\n .showIcon=${alert.showIcon ?? false}\n .showAlertCategoryIcon=${alert.showAlertCategoryIcon ?? true}\n .wrapContent=${false}\n .fullWidth=${false}\n ></obc-alert-frame>\n </div>\n `;\n }\n\n private renderLabelContainer(): TemplateResult {\n const stacking = this.resolvedStacking;\n const showLeadingUnit =\n stacking === ReadoutListItemStacking.leadingUnit && Boolean(this.unit);\n const showLeadingSrc = this.hasLeadingSrc && Boolean(this.src);\n\n return html`\n <div class=\"label-container\" part=\"label-container\">\n ${this.hasLeadingIcon\n ? html`<span class=\"leading-icon\" aria-hidden=\"true\"\n ><slot name=\"leading-icon\"></slot\n ></span>`\n : nothing}\n <div class=\"label-stack\" part=\"label-stack\">\n ${this.label\n ? this.renderTextbox(\n 'label',\n this.label,\n this.labelOptions?.spaceReserver\n )\n : nothing}\n ${showLeadingUnit\n ? this.renderTextbox(\n 'unit',\n this.unit ?? '',\n this.unitOptions?.spaceReserver\n )\n : nothing}\n ${showLeadingSrc ? this.renderSourceBlock() : nothing}\n </div>\n </div>\n `;\n }\n\n private renderTrailingUnit(): TemplateResult | typeof nothing {\n if (!this.hasTrailingUnitBox) {\n return nothing;\n }\n return this.renderTextbox(\n 'unit',\n this.unit ?? '',\n this.unitOptions?.spaceReserver\n );\n }\n\n /**\n * The source text plus its optional state chip and deviation line. The\n * plain (regular, no-deviation) case renders the bare textbox; a state or a\n * deviation wraps it in the `.source-block` stack.\n */\n private renderSourceBlock(): TemplateResult {\n const state = this.srcOptions?.state ?? ReadoutSourceState.regular;\n const deviation = this.srcOptions?.deviation;\n const hasDeviation = deviation !== undefined && Number.isFinite(deviation);\n const box = this.renderTextbox(\n 'source',\n this.src ?? '',\n this.srcOptions?.spaceReserver,\n this.srcOptions\n );\n if (state === ReadoutSourceState.regular && !hasDeviation) {\n return box;\n }\n return html`\n <div\n class=${classMap({\n 'source-block': true,\n [`source-state-${state}`]: state !== ReadoutSourceState.regular,\n })}\n part=\"source-block\"\n >\n ${box}\n ${hasDeviation\n ? html`<span class=\"source-deviation\">\n <obi-delta aria-hidden=\"true\"></obi-delta>\n <obc-textbox\n class=\"source-deviation-value\"\n .size=${ObcTextboxSize.xs}\n .tabularNums=${true}\n alignment=\"left\"\n >${deviation}</obc-textbox\n >\n </span>`\n : nothing}\n </div>\n `;\n }\n\n private renderTrailingSource(): TemplateResult | typeof nothing {\n if (this.hasLeadingSrc || !this.src) {\n return nothing;\n }\n return html`\n <div class=\"divider\" part=\"divider\" aria-hidden=\"true\"></div>\n ${this.renderSourceBlock()}\n `;\n }\n\n private renderContent(): TemplateResult {\n return html`\n <div class=\"content\" part=\"content\">\n ${this.renderLabelContainer()}\n <div class=\"value-area\" part=\"value-area\">\n ${this.renderValueCluster()}\n </div>\n ${this.renderTrailingSource()}\n </div>\n `;\n }\n\n protected override willUpdate(changed: Map<string, unknown>): void {\n super.willUpdate(changed);\n // Never gate this on `changed`: a throw clears Lit's changed map, so the\n // next update would skip the check and render the invalid value as a dash\n // (readout-components.md § 1, pinned by readout-block.spec.ts).\n assertReadoutValueType('obc-readout-list-item', this.value, this.valueType);\n assertReadoutFractionDigits('obc-readout-list-item', this.fractionDigits);\n }\n\n override updated(changed: Map<string, unknown>): void {\n super.updated(changed);\n\n const firstUpdate = !this.hasCompletedFirstUpdate;\n this.hasCompletedFirstUpdate = true;\n\n // Pop-up: hide the setpoint shortly after the value reaches it. `touching`\n // and the non-pop-up modes keep the setpoint visible.\n if (!this.isPopUp || this.setpointTouching) {\n this.clearDeferredSetpointHide();\n return;\n }\n\n const shouldHide = this.hasSetpoint && this.isAtSetpoint;\n\n if (firstUpdate) {\n // Settle to the resting state on mount without animating.\n this.deferredSetpointHidePhase = shouldHide\n ? ReadoutBlockHidePhase.hidden\n : ReadoutBlockHidePhase.none;\n return;\n }\n\n if (!shouldHide) {\n this.clearDeferredSetpointHide();\n return;\n }\n\n if (this.deferredSetpointHidePhase !== ReadoutBlockHidePhase.none) {\n return;\n }\n\n this.deferredSetpointHidePhase = ReadoutBlockHidePhase.hiding;\n window.clearTimeout(this.deferredSetpointHideTimer);\n this.deferredSetpointHideTimer = window.setTimeout(() => {\n this.deferredSetpointHidePhase = ReadoutBlockHidePhase.hidden;\n this.deferredSetpointHideTimer = undefined;\n }, 100);\n }\n\n private clearDeferredSetpointHide(): void {\n if (this.deferredSetpointHidePhase !== ReadoutBlockHidePhase.none) {\n this.deferredSetpointHidePhase = ReadoutBlockHidePhase.none;\n }\n window.clearTimeout(this.deferredSetpointHideTimer);\n this.deferredSetpointHideTimer = undefined;\n }\n\n override disconnectedCallback(): void {\n window.clearTimeout(this.deferredSetpointHideTimer);\n this.deferredSetpointHideTimer = undefined;\n // Settle a mid-flight hide to its end state. Without this, disconnecting\n // during the 100ms window leaves the phase stuck at 'hiding' (the timer that\n // would advance it to 'hidden' is gone), so a later reconnect never resolves.\n if (this.deferredSetpointHidePhase === ReadoutBlockHidePhase.hiding) {\n this.deferredSetpointHidePhase = ReadoutBlockHidePhase.hidden;\n }\n super.disconnectedCallback();\n }\n\n override render() {\n const clickable = this.resolvedClickable;\n const dataQuality = this.dataQuality;\n const classes = classMap({\n root: true,\n [`size-${this.resolvedSize}`]: true,\n [`stacking-${this.resolvedStacking}`]: true,\n [`priority-${this.resolvedPriority}`]: true,\n 'data-low-integrity':\n dataQuality === ReadoutListItemDataQuality.lowIntegrity,\n 'data-invalid': dataQuality === ReadoutListItemDataQuality.invalid,\n 'flip-flop': this.isFlipFlop,\n clickable: Boolean(clickable),\n [`border-${clickable ? clickable.border : ReadoutListItemBorder.squared}`]:\n Boolean(clickable),\n });\n\n const surface = html`<div class=\"surface\" part=\"surface\">\n ${this.renderContent()}\n </div>`;\n\n // No `aria-label` here: it would override the button's accessible name and\n // hide the dynamic readout text (value / unit / source) from screen readers.\n // The visible content (label + value + unit + source) already forms a\n // complete accessible name; icons/reservers are aria-hidden / visibility-clipped.\n const root = clickable\n ? html`<button class=${classes} part=\"root\" type=\"button\">\n ${surface}\n </button>`\n : html`<div class=${classes} part=\"root\">${surface}</div>`;\n\n // `alert: true` (the Angular wrapper's widened `boolean`) becomes a default\n // frame `{}`, as `wrapWithAlertFrame` ignores non-object truthy values. The\n // row frame stretches full width; per-block frames hug (#1001).\n const alert = this.alert === true ? {} : this.alert;\n return wrapWithAlertFrame(alert, root, true);\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-readout-list-item': ObcReadoutListItem;\n }\n}\n"],"names":["ReadoutListItemStacking","ReadoutListItemPriority","ReadoutListItemBorder","ReadoutListItemSetpointInteraction","ReadoutSourceState","state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkEO,MAAM,sBAAsB;AAW5B,IAAK,4CAAAA,6BAAL;AACLA,2BAAA,cAAA,IAAe;AACfA,2BAAA,aAAA,IAAc;AACdA,2BAAA,YAAA,IAAa;AACbA,2BAAA,kBAAA,IAAmB;AAJT,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;AAYL,IAAK,4CAAAC,6BAAL;AACLA,2BAAA,SAAA,IAAU;AACVA,2BAAA,UAAA,IAAW;AAFD,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;AAUL,MAAM,6BAA6B;AASnC,IAAK,0CAAAC,2BAAL;AACLA,yBAAA,SAAA,IAAU;AACVA,yBAAA,OAAA,IAAQ;AACRA,yBAAA,cAAA,IAAe;AAHL,SAAAA;AAAA,GAAA,yBAAA,CAAA,CAAA;AAoFL,IAAK,uDAAAC,wCAAL;AACLA,sCAAA,eAAA,IAAgB;AAChBA,sCAAA,WAAA,IAAY;AACZA,sCAAA,UAAA,IAAW;AACXA,sCAAA,OAAA,IAAQ;AAJE,SAAAA;AAAA,GAAA,sCAAA,CAAA,CAAA;AAuEL,IAAK,uCAAAC,wBAAL;AACLA,sBAAA,SAAA,IAAU;AACVA,sBAAA,UAAA,IAAW;AACXA,sBAAA,SAAA,IAAU;AACVA,sBAAA,SAAA,IAAU;AAJA,SAAAA;AAAA,GAAA,sBAAA,CAAA,CAAA;AA0GL,IAAM,qBAAN,cAAiC,WAAW;AAAA,EAA5C,cAAA;AAAA,UAAA,GAAA,SAAA;AAMwC,SAAA,WAAW;AAC9B,SAAA,QAAgC;AAChC,SAAA,YACxB,iBAAiB;AACQ,SAAA,MAAM;AACP,SAAA,UAAU;AAET,SAAA,cAAc;AAGd,SAAA,YAAY;AAOb,SAAA,YACxB;AACyB,S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Content":["import {LitElement, html, nothing, unsafeCSS, type TemplateResult} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport componentStyle from './readout-list-item.css?inline';\nimport {customElement} from '../../decorator.js';\nimport '../../components/textbox/textbox.js';\nimport {\n ObcTextboxSize,\n ObcTextboxFontWeight,\n} from '../../components/textbox/textbox.js';\nimport '../../building-blocks/readout-block/readout-block.js';\nimport '../../icons/icon-delta.js';\nimport {\n ReadoutBlockVariant,\n ReadoutBlockSize,\n ReadoutBlockDataQuality,\n ReadoutBlockHidePhase,\n ReadoutAdviceCategory,\n} from '../../building-blocks/readout-block/readout-block.js';\nimport {\n assertReadoutValueType,\n assertReadoutFractionDigits,\n isReadoutDigitCountMissing,\n resolveReadoutDigitCount,\n resolveReadoutNumericValue,\n ReadoutValueType,\n type ReadoutNumericFormatOptions,\n} from '../readout/readout-formatters.js';\nimport {\n isDisplayedAtSetpoint,\n readoutNumericFormatOptions,\n readoutPrimarySize,\n readoutSecondarySize,\n readoutSetpointSize,\n readoutValueSize,\n readoutSetpointWeight,\n readoutDataQualityClasses,\n resolveSetpointHidePhase,\n} from '../readout/readout-shared.js';\nimport {\n type AlertFrameConfig,\n wrapWithAlertFrame,\n ObcAlertFrameType,\n ObcAlertFrameThickness,\n ObcAlertFrameMode,\n} from '../../components/alert-frame/alert-frame.js';\nimport {AlertType, FlashingSpeed} from '../../types.js';\n\n// The value weight maps straight to obc-textbox's font weights (regular /\n// semibold / bold). Re-exported so consumers can set `valueOptions.weight`\n// without a second import path.\nexport {ObcTextboxFontWeight} from '../../components/textbox/textbox.js';\n\n// Re-exported so consumers can type `valueType` without a second import path.\nexport {ReadoutValueType} from '../readout/readout-formatters.js';\n\n// Re-exported so consumers can set `adviceOptions.category` without a second\n// import path.\nexport {ReadoutAdviceCategory} from '../../building-blocks/readout-block/readout-block.js';\n\n/**\n * Density/size scale of the readout row (an alias of `ReadoutBlockSize`).\n * - `small`: regular value typography (smallest, densest).\n * - `medium`: medium value typography.\n * - `large`: large value typography.\n */\nexport const ReadoutListItemSize = ReadoutBlockSize;\nexport type ReadoutListItemSize = ReadoutBlockSize;\n\n/**\n * Placement of the unit/source relative to the label and value.\n * - `trailing-unit`: unit after the value, source after a trailing divider.\n * - `leading-unit`: unit beside/under the label.\n * - `leading-src`: source under the label (no trailing source).\n * - `leading-src-inline`: source on the label's line, after it (no trailing\n * source); keeps the row one line high.\n */\nexport enum ReadoutListItemStacking {\n trailingUnit = 'trailing-unit',\n leadingUnit = 'leading-unit',\n leadingSrc = 'leading-src',\n leadingSrcInline = 'leading-src-inline',\n}\n\n/**\n * Colour emphasis of the value.\n * - `regular`: neutral.\n * - `enhanced`: accented (in-command) colour.\n */\nexport enum ReadoutListItemPriority {\n regular = 'regular',\n enhanced = 'enhanced',\n}\n\n/**\n * Measurement quality of the value (an alias of `ReadoutBlockDataQuality`).\n * Orthogonal to the row-level `alert` – a low-integrity or invalid value can\n * also sit inside an alert frame.\n */\nexport const ReadoutListItemDataQuality = ReadoutBlockDataQuality;\nexport type ReadoutListItemDataQuality = ReadoutBlockDataQuality;\n\n/**\n * Corner style of the interactive (clickable) surface.\n * - `squared` (default): no rounding (true rectangle).\n * - `round-corners`: larger rounded corners.\n * - `round`: fully rounded (pill).\n */\nexport enum ReadoutListItemBorder {\n squared = 'squared',\n round = 'round',\n roundCorners = 'round-corners',\n}\n\nexport interface ReadoutListItemClickable {\n border?: ReadoutListItemBorder;\n}\n\n/**\n * Per-block state shared by value / setpoint / advice / src. Each is independent\n * of (and nests inside) the row-level `dataQuality` / `alert` props. All\n * combinations are allowed.\n */\nexport interface ReadoutBlockState {\n /** Per-block measurement quality (low-integrity / invalid). */\n dataQuality?: ReadoutListItemDataQuality;\n /** Per-block alert frame; nests inside any row-level alert frame. */\n alert?: false | AlertFrameConfig;\n}\n\n/**\n * Per-value options. Unlike setpoint/advice, the value's `alert` frame AND\n * `dataQuality` chip wrap the whole reading — value (+ value-icon) + degree +\n * trailing unit — rather than the value alone. The alert frame is a pure overlay\n * (4px/2px padding, stroke centred on that line); the data-quality chip reuses\n * the block chip's `outline` styling with no extra padding. Neither shifts\n * content or changes the row height / column alignment (Figma 58:10120).\n */\nexport interface ReadoutValueOptions extends ReadoutBlockState {\n /**\n * Render the unfilled leading positions as muted zeroes (requires\n * `maxDigits`). The sign never consumes a zero (`12.3` → `012.3`, `-12.3` →\n * `-012.3` at `maxDigits` 3), so a negative reading is one character wider\n * unless `hasSignSpacer` reserves the sign column; an unavailable value\n * renders dashes across the whole reserved width.\n */\n hintedZeros?: boolean;\n /**\n * Reserve a minus-sign column ahead of the digits, filled by the real sign\n * only while the value is negative — the width does not change across zero.\n * Enable it on rows whose value can go negative; inside `obc-readout-list`\n * the shared column widens automatically once any row shows a sign, but a\n * live value crossing zero still shifts the columns unless the rows that\n * can go negative opt in up front.\n */\n hasSignSpacer?: boolean;\n /**\n * Value font weight — `regular` (default), `semibold`, or `bold` (the\n * obc-textbox weights). Affects weight only; it does NOT change the colour\n * (colour is driven by `priority`).\n */\n weight?: ObcTextboxFontWeight;\n /** Show the `value-icon` slot before the value. */\n hasIcon?: boolean;\n /**\n * Longest value string to reserve width for (e.g. `\"0000.0\"`), so rows align\n * across different value lengths / `fractionDigits` — set the same value on\n * every row. Combined with the `maxDigits`/`fractionDigits`-derived reserve by\n * taking whichever is **wider**, so it never reserves less than the formatted\n * value needs.\n */\n spaceReserver?: string;\n}\n\n/**\n * How the setpoint segment behaves relative to the value.\n * - `always-visible` (default): the setpoint is always shown.\n * - `flip-flop`: value and setpoint swap emphasis (size) as the value reaches\n * the setpoint.\n * - `equal-size`: value and setpoint are always shown at the same (primary)\n * size (Figma 6.1 \"Equal size\") — the value does not demote while\n * `touching`, unlike the other modes.\n * - `pop-up`: the setpoint is shown only while the value has not reached it,\n * then fades out (100ms) once value === setpoint.\n *\n * TODO(designer): in pop-up mode the designer is considering keeping the\n * setpoint arrow visible while the setpoint itself is hidden, so an\n * at-setpoint reading still reads as \"a value you are in control of\". Until\n * that is decided, the `value-icon` slot already covers it — slot an\n * `<obi-input-right>` into the value block (see the\n * `SetpointPopUpWithValueArrow` story).\n */\nexport enum ReadoutListItemSetpointInteraction {\n alwaysVisible = 'always-visible',\n equalSize = 'equal-size',\n flipFlop = 'flip-flop',\n popUp = 'pop-up',\n}\n\nexport interface ReadoutSetpointOptions extends ReadoutBlockState {\n hintedZeros?: boolean;\n /** Reserve a minus-sign column; see {@link ReadoutValueOptions.hasSignSpacer}. */\n hasSignSpacer?: boolean;\n /** How the setpoint behaves relative to the value (default `always-visible`). */\n interaction?: ReadoutListItemSetpointInteraction;\n /**\n * The user is physically interacting with (adjusting) the setpoint — the\n * \"focus\" visual state. Same convention as `touching` on the instrument\n * setpoint marker (`SetpointMixin` / `svghelpers/setpoint.ts`): keeps the\n * setpoint visible and shows the lighter-blue focus triangle.\n */\n touching?: boolean;\n /** Longest value string to reserve width for; see {@link ReadoutValueOptions.spaceReserver}. */\n spaceReserver?: string;\n}\n\nexport interface ReadoutAdviceOptions extends ReadoutBlockState {\n hintedZeros?: boolean;\n /** Reserve a minus-sign column; see {@link ReadoutValueOptions.hasSignSpacer}. */\n hasSignSpacer?: boolean;\n /**\n * Semantic category (Figma 6.1) — picks the default marker icon and the\n * `active` styling; `regular` when unset.\n */\n category?: ReadoutAdviceCategory;\n /** The advice is triggered — filled/status icon + triggered text styling. */\n active?: boolean;\n /** Longest value string to reserve width for; see {@link ReadoutValueOptions.spaceReserver}. */\n spaceReserver?: string;\n}\n\nexport interface ReadoutReserverOptions {\n /**\n * Longest expected string to reserve width for (aligns multiple rows), e.g.\n * `\"miles\"`. A row without a unit still renders the reserved (blank)\n * trailing column, so its value and degree stay on the grid of the rows\n * that have one. `leading-unit` stacking has no trailing column to reserve.\n */\n spaceReserver?: string;\n}\n\n/**\n * Per-label (\"readout-block-title\") options.\n *\n * The label size follows the designer's Figma 6.1 title block, which carries an\n * `xs`/`s` primary-size axis: `s` is the default for stand-alone readouts (a\n * scannable label should not sit at the smallest permitted size), `xs` the\n * default for dense list rows. Values outside `xs`/`s` are not part of the\n * design and are not rejected, but their metrics are unspecified.\n */\nexport interface ReadoutLabelOptions {\n /** Label typography size — `xs` (dense rows) or `s` (stand-alone readouts). */\n size?: ObcTextboxSize;\n /** Longest expected label to reserve width for (aligns stacked readouts). */\n spaceReserver?: string;\n}\n\n/**\n * Emphasis / alert state of the source chip (Figma 6.1 \"Readout-block-source\"\n * State axis; `static`/`enabled` map to `regular`).\n * TODO(designer): the sheet also carries a `Tag` type (xs chip) and an alarm\n * state is absent by design; both left out here.\n */\nexport enum ReadoutSourceState {\n regular = 'regular',\n enhanced = 'enhanced',\n caution = 'caution',\n warning = 'warning',\n}\n\nexport interface ReadoutSrcOptions extends ReadoutBlockState {\n /** Longest expected source string to reserve width for; see {@link ReadoutReserverOptions.spaceReserver}. */\n spaceReserver?: string;\n /**\n * Emphasis / alert state of the source: `enhanced` renders the amplified\n * chip, `caution` / `warning` the matching alert chip. Like the\n * data-quality chip it uses `outline`, so toggling it never shifts the row.\n */\n state?: ReadoutSourceState;\n /**\n * Source deviation (Figma \"Source-deviation\"): renders a Δ + value line\n * under the source name. A non-finite value renders no line.\n */\n deviation?: number;\n}\n\n/**\n * `<obc-readout-list-item>` – A compact, dense readout row for lists and tables.\n *\n * Renders a label, an optional source, an optional unit, and up to three\n * cap-height \"readout building blocks\" – advice, setpoint, and value – each a\n * fixed-width-reservable numeric segment. Dynamic data is passed as top-level\n * primitives (`value`, `setpoint`, `advice`, `label`, `unit`, `src`). Global\n * layout/format is configured via top-level props (`size`, `priority`,\n * `stacking`, `hasDegree`, `dataQuality`, `alert`, …) and per-block tweaks via one\n * object per block (`valueOptions`, `setpointOptions`, `adviceOptions`,\n * `unitOptions`, `srcOptions`).\n *\n * ### Features\n * - **Building blocks:** value, optional setpoint, and optional advice segments,\n * each cap-height-aligned and able to reserve a stable width.\n * - **Sizes:** `small`, `medium`, `large` density scales.\n * - **Stacking:** `trailing-unit`, `leading-unit`, `leading-src`,\n * `leading-src-inline` placement.\n * - **Priority:** `regular`/`enhanced` colour emphasis; per-value `weight`\n * (`regular`/`semibold`/`bold`) is independent of colour.\n * - **Setpoint flip-flop:** swaps emphasis between value and setpoint as the\n * value reaches the setpoint.\n * - **Data quality:** `low-integrity`/`invalid` styling, combinable with `alert`.\n * - **Alert frame:** optional `alert` wrapper (caution/warning/alarm/level).\n * - **Clickable:** optionally rendered as a focusable button with `squared`,\n * `round-corners`, or `round` corners.\n * - **Formatting:** shared `fractionDigits`, width reservation via `maxDigits`\n * and per-segment `hintedZeros`; a `null` value renders a dash (`-`).\n * - **Text values:** `valueType=\"text\"` renders `value` verbatim (e.g.\n * `\"Thermo On\"`) instead of formatting it as a number.\n *\n * ### Usage Guidelines\n * Use for dense readout rows in lists/tables. Prefer `<obc-readout>` for rich\n * multi-segment instrument layouts, source pickers, or flyout behaviour.\n *\n * ### Slots\n * | Slot Name | Renders When | Purpose |\n * |---------------|-------------------------------|------------------------------------------|\n * | leading-icon | `hasLeadingIcon` | Icon before the label. |\n * | value-icon | `valueOptions.hasIcon` | Icon before the value. |\n * | setpoint-icon | `hasSetpoint` | Overrides the default setpoint icon. |\n * | advice-icon | `hasAdvice` | Overrides the default advice icon. |\n *\n * @property hasValue - Layout switch: `false` renders a deliberately value-less (label-only)\n * row that hugs its remaining parts. For a temporarily missing value keep\n * `hasValue` and set `value` to `null` instead — the dash keeps the value\n * block at full size, so the row does not shift when data arrives.\n * @property value - The value; `null` renders a dash. A number by default, or text when\n * `valueType` is `text`.\n * @property valueType - How `value` is interpreted. `number` (default) formats it via\n * `fractionDigits`; `text` renders it verbatim and ignores the numeric\n * format options. Passing text while this is `number` throws.\n * @property off - Render the value as `offText` (e.g. equipment powered down). Affects the value only.\n * @property offText - Text shown in place of the value when `off` is true.\n * @availableWhen offText off==true\n * @availableWhen setpoint hasSetpoint==true\n * @availableWhen advice hasAdvice==true\n * @property fractionDigits - Also formats the numeric setpoint / advice blocks, which stay numeric\n * even when the value is text. Must be between 0 and 100 — the range\n * `Number.prototype.toFixed` accepts; outside it throws a `RangeError`.\n * A fractional count truncates (`2.7` → `2`). A count that never arrived\n * (`NaN`, `null` or unset) renders the reading as the unavailable dash —\n * formatting with a precision the author never chose would let a critical\n * `0.4` pass for a healthy `0`.\n * @availableWhen fractionDigits valueType==number || hasSetpoint==true || hasAdvice==true\n * @property maxDigits - Also formats the numeric setpoint / advice blocks, which stay numeric\n * even when the value is text. Bounded before use: a fractional count\n * truncates (`2.7` → `2`), anything above 100 — including `Infinity` —\n * caps at 100, and a negative count reserves nothing. A count that never\n * arrived (`NaN`, `null` or unset) renders the reading as the unavailable\n * dash, consistent with `fractionDigits`.\n * @availableWhen maxDigits valueType==number || hasSetpoint==true || hasAdvice==true\n * @property showDebugOverlay - Development aid: outline the readout building blocks (red), the degree\n * columns (blue) and the degree spacer (green) so reserver widths / alignment\n * are visible. Off by default.\n * @slot leading-icon - Icon before the label.\n * @slot value-icon - Icon before the value.\n * @slot setpoint-icon - Overrides the default setpoint icon.\n * @slot advice-icon - Overrides the default advice icon.\n * @fires click - Fired when the item is activated. Only fired when `clickable` is set; otherwise the item renders as a non-interactive `<div>`.\n * @beta\n */\n@customElement('obc-readout-list-item')\nexport class ObcReadoutListItem extends LitElement {\n // Primitives (dynamic data)\n @property({type: String}) label?: string;\n @property({type: String}) unit?: string;\n @property({type: String}) src?: string;\n\n @property({type: Boolean, attribute: false}) hasValue = true;\n @property({type: String}) value: number | string | null = null;\n @property({type: String}) valueType: ReadoutValueType =\n ReadoutValueType.number;\n @property({type: Boolean}) off = false;\n @property({type: String}) offText = 'OFF';\n\n @property({type: Boolean}) hasSetpoint = false;\n @property({type: Number}) setpoint?: number;\n\n @property({type: Boolean}) hasAdvice = false;\n @property({type: Number}) advice?: number;\n\n // Global layout/format (each defaults via its `resolved*` getter where useful).\n @property({type: String}) size?: ReadoutListItemSize;\n @property({type: String}) priority?: ReadoutListItemPriority;\n @property({type: String}) stacking?: ReadoutListItemStacking;\n @property({type: Object}) clickable: boolean | ReadoutListItemClickable =\n false;\n @property({type: Boolean}) hasLeadingIcon = false;\n @property({type: Boolean}) hasDegree = false;\n @property({type: Boolean}) hasDegreeSpacer = false;\n @property({type: Number}) fractionDigits = 0;\n @property({type: Number}) maxDigits = 0;\n @property({type: String}) dataQuality?: ReadoutListItemDataQuality;\n // `boolean | …` (not `false | …`): the generated Angular wrapper widens a\n // literal-`false` union to `boolean`, which then won't assign back to a\n // `false`-typed element property. `wrapWithAlertFrame` treats any non-object\n // (incl. `true`) as \"no frame\", so accepting `boolean` is harmless.\n @property({type: Object}) alert: boolean | AlertFrameConfig = false;\n\n // Per-block configuration — one object per block (see the Readout*Options types).\n @property({type: Object}) valueOptions?: ReadoutValueOptions;\n @property({type: Object}) setpointOptions?: ReadoutSetpointOptions;\n @property({type: Object}) adviceOptions?: ReadoutAdviceOptions;\n @property({type: Object}) labelOptions?: ReadoutLabelOptions;\n @property({type: Object}) unitOptions?: ReadoutReserverOptions;\n @property({type: Object}) srcOptions?: ReadoutSrcOptions;\n\n @property({type: Boolean, reflect: true}) showDebugOverlay = false;\n\n /** Pop-up deferred-hide phase for the setpoint (see {@link updated}). */\n @state() private deferredSetpointHidePhase: ReadoutBlockHidePhase =\n ReadoutBlockHidePhase.none;\n private deferredSetpointHideTimer?: number;\n private hasCompletedFirstUpdate = false;\n\n private get resolvedSize(): ReadoutListItemSize {\n return this.size ?? ReadoutListItemSize.small;\n }\n\n private get resolvedStacking(): ReadoutListItemStacking {\n return this.stacking ?? ReadoutListItemStacking.trailingUnit;\n }\n\n /** Both leading-src stackings move the source into the label stack. */\n private get hasLeadingSrc(): boolean {\n const stacking = this.resolvedStacking;\n return (\n stacking === ReadoutListItemStacking.leadingSrc ||\n stacking === ReadoutListItemStacking.leadingSrcInline\n );\n }\n\n private get resolvedPriority(): ReadoutListItemPriority {\n return this.priority ?? ReadoutListItemPriority.regular;\n }\n\n /**\n * Whether a unit box follows the value: a unit, or a reserver alone — the\n * blank reserved column keeps a unit-less row aligned with its neighbours.\n */\n private get hasTrailingUnitBox(): boolean {\n return (\n this.resolvedStacking !== ReadoutListItemStacking.leadingUnit &&\n (Boolean(this.unit) || Boolean(this.unitOptions?.spaceReserver))\n );\n }\n\n private get resolvedFractionDigits(): number {\n return this.fractionDigits ?? 0;\n }\n\n private get resolvedMaxDigits(): number {\n return resolveReadoutDigitCount(this.maxDigits);\n }\n\n /**\n * Whether a digit knob failed to arrive (`NaN` / `null` / `undefined`).\n * The raw knobs are forwarded to the blocks, which render the reading as\n * the unavailable dash (see `obc-readout-block.digitCountsMissing`); this\n * getter only keeps the setpoint comparison in agreement with what is\n * displayed.\n */\n private get digitCountsMissing(): boolean {\n return (\n isReadoutDigitCountMissing(this.fractionDigits) ||\n isReadoutDigitCountMissing(this.maxDigits)\n );\n }\n\n private get resolvedClickable(): false | Required<ReadoutListItemClickable> {\n const clickable = this.clickable;\n if (!clickable) {\n return false;\n }\n if (clickable === true) {\n return {border: ReadoutListItemBorder.squared};\n }\n return {border: clickable.border ?? ReadoutListItemBorder.squared};\n }\n\n private get isAtSetpoint(): boolean {\n if (!this.hasSetpoint) {\n return false;\n }\n // A missing digit knob renders every numeric block as the dash; two\n // dashes must not read as \"at the setpoint\", so the comparison stays off\n // entirely while the configuration is untrustworthy.\n if (this.digitCountsMissing) {\n return false;\n }\n // A text value never compares equal to a setpoint, so flip-flop / pop-up\n // stay dormant for `valueType=\"text\"`.\n return isDisplayedAtSetpoint(\n resolveReadoutNumericValue(this.value, this.valueType) ?? null,\n this.setpoint,\n this.numericFormatOptions(this.resolvedMaxDigits)\n );\n }\n\n private get resolvedSetpointInteraction(): ReadoutListItemSetpointInteraction {\n return (\n this.setpointOptions?.interaction ??\n ReadoutListItemSetpointInteraction.alwaysVisible\n );\n }\n\n private get isFlipFlop(): boolean {\n return (\n this.resolvedSetpointInteraction ===\n ReadoutListItemSetpointInteraction.flipFlop\n );\n }\n\n private get isEqualSize(): boolean {\n return (\n this.resolvedSetpointInteraction ===\n ReadoutListItemSetpointInteraction.equalSize\n );\n }\n\n private get isPopUp(): boolean {\n return (\n this.resolvedSetpointInteraction ===\n ReadoutListItemSetpointInteraction.popUp\n );\n }\n\n private get setpointTouching(): boolean {\n return this.setpointOptions?.touching ?? false;\n }\n\n /**\n * The setpoint is rendered \"emphasised\" (primary size + SemiBold weight) when\n * it is the focus of attention: while actively adjusting (`touching`), or while\n * a flip-flop has the value away from the setpoint. Otherwise it is a secondary\n * (smaller, regular-weight) reference next to the value.\n */\n private get isSetpointEmphasized(): boolean {\n if (!this.hasSetpoint) {\n return false;\n }\n if (this.setpointTouching) {\n return true;\n }\n return this.isFlipFlop && !this.isAtSetpoint;\n }\n\n /**\n * The row's enhanced (in-command) colour state, applied uniformly to BOTH the\n * value and the setpoint — they are always either both neutral or both enhanced\n * (never a blue setpoint next to a grey value). Driven by `priority` only;\n * `valueOptions.weight` changes weight, not colour.\n */\n private get rowEnhanced(): boolean {\n return this.resolvedPriority === ReadoutListItemPriority.enhanced;\n }\n\n /** Primary value-typography size for the current density tier. */\n private get primarySize(): ObcTextboxSize {\n return readoutPrimarySize(this.resolvedSize);\n }\n\n /** Secondary (de-emphasised) value-typography size for the current density tier. */\n private get secondarySize(): ObcTextboxSize {\n return readoutSecondarySize(this.resolvedSize);\n }\n\n private get valueSize(): ObcTextboxSize {\n // The value takes the secondary size whenever the setpoint has the focus\n // (`touching`, or a flip-flop holding the value away from it); `equal-size`\n // opts out and keeps both blocks at the primary size.\n return readoutValueSize({\n primary: this.primarySize,\n secondary: this.secondarySize,\n setpointEmphasized: this.isSetpointEmphasized,\n equalSize: this.isEqualSize,\n });\n }\n\n private get setpointSize(): ObcTextboxSize {\n return readoutSetpointSize({\n primary: this.primarySize,\n secondary: this.secondarySize,\n emphasized: this.isSetpointEmphasized,\n equalSize: this.isEqualSize,\n });\n }\n\n /** Value font weight passes straight to obc-textbox; regular when unset. Colour is separate. */\n private get valueWeight(): ObcTextboxFontWeight {\n return this.valueOptions?.weight ?? ObcTextboxFontWeight.regular;\n }\n\n /** Label size: `xs` for dense list rows unless overridden (see {@link ReadoutLabelOptions}). */\n private get labelSize(): ObcTextboxSize {\n return this.labelOptions?.size ?? ObcTextboxSize.xs;\n }\n\n /**\n * Label weight: SemiBold only for enhanced (in-command) rows, regular\n * otherwise — the designer reduced the amount of semibold in the interface\n * (Figma 6.1 review).\n */\n private get labelWeight(): ObcTextboxFontWeight {\n return this.rowEnhanced\n ? ObcTextboxFontWeight.semibold\n : ObcTextboxFontWeight.regular;\n }\n\n /** Setpoint is SemiBold only while emphasised, otherwise regular weight. */\n private get setpointWeight(): ObcTextboxFontWeight {\n return readoutSetpointWeight(this.isSetpointEmphasized);\n }\n\n private numericFormatOptions(maxDigits: number): ReadoutNumericFormatOptions {\n return readoutNumericFormatOptions(maxDigits, this.resolvedFractionDigits);\n }\n\n /** classMap fragment for a block / source carrying per-block data quality. */\n private dataQualityClasses(\n dataQuality: ReadoutListItemDataQuality | undefined\n ): Record<string, boolean> {\n return readoutDataQualityClasses(dataQuality);\n }\n\n /**\n * Forward the matching list-item icon slot into the block's single `icon`\n * slot. The variant's default marker lives in `obc-readout-block` and shows\n * when nothing is assigned here (an empty forwarded slot flattens to nothing).\n */\n private renderForwardedIcon(variant: ReadoutBlockVariant): TemplateResult {\n if (variant === ReadoutBlockVariant.setpoint) {\n return html`<slot name=\"setpoint-icon\" slot=\"icon\"></slot>`;\n }\n if (variant === ReadoutBlockVariant.advice) {\n return html`<slot name=\"advice-icon\" slot=\"icon\"></slot>`;\n }\n return html`<slot name=\"value-icon\" slot=\"icon\"></slot>`;\n }\n\n private renderBlock(config: {\n variant: ReadoutBlockVariant;\n value: number | string | null | undefined;\n /** Only the value block is ever text; setpoint / advice stay numeric. */\n valueType?: ReadoutValueType;\n valueSize: ObcTextboxSize;\n enhanced: boolean;\n weight: ObcTextboxFontWeight;\n hintedZeros: boolean;\n hasSignSpacer?: boolean;\n spaceReserver?: string;\n off?: boolean;\n hasDegree?: boolean;\n hasIcon?: boolean;\n touching?: boolean;\n hidePhase?: ReadoutBlockHidePhase;\n dataQuality?: ReadoutBlockDataQuality;\n alert?: false | AlertFrameConfig;\n /** Advice-only: semantic category + triggered state. */\n category?: ReadoutAdviceCategory;\n active?: boolean;\n }): TemplateResult {\n // The block owns the formatting, hinted zeros, reserver, degree and icon; the\n // row keeps the density tier (`size`) and the resolved per-block number size\n // (`valueSize`) so flip-flop/pop-up emphasis stays a row decision.\n return html`\n <obc-readout-block\n exportparts=\"block, block-content, block-text, block-icon, degree\"\n .variant=${config.variant}\n .value=${config.value ?? null}\n .valueType=${config.valueType ?? ReadoutValueType.number}\n .size=${this.resolvedSize}\n .valueSize=${config.valueSize}\n .enhanced=${config.enhanced}\n .weight=${config.weight}\n .hasDegree=${config.hasDegree ?? false}\n .hasIcon=${config.hasIcon ?? false}\n .fractionDigits=${this.fractionDigits}\n .maxDigits=${this.maxDigits}\n .hintedZeros=${config.hintedZeros}\n .hasSignSpacer=${config.hasSignSpacer ?? false}\n .spaceReserver=${config.spaceReserver}\n .off=${config.off ?? false}\n .offText=${this.offText}\n .touching=${config.touching ?? false}\n .hidePhase=${config.hidePhase ?? ReadoutBlockHidePhase.none}\n .dataQuality=${config.dataQuality}\n .alert=${config.alert ?? false}\n .category=${config.category ?? ReadoutAdviceCategory.regular}\n .active=${config.active ?? false}\n >\n ${this.renderForwardedIcon(config.variant)}\n </obc-readout-block>\n `;\n }\n\n /**\n * A cap-height `°` column whose width scales with the value size. Used after\n * the value (as the value↔unit boundary, via {@link renderValueUnitGap}) and\n * inside the setpoint / advice blocks. `inherit` makes the glyph take the\n * surrounding block's colour (setpoint/advice); otherwise it uses the value\n * colour, optionally `enhanced`.\n */\n private renderDegreeGlyph(\n size: ObcTextboxSize,\n opts: {enhanced?: boolean; inherit?: boolean} = {}\n ): TemplateResult {\n return html`\n <span\n class=${classMap({\n 'degree-column': true,\n [`degree-${size}`]: true,\n 'tone-enhanced': !opts.inherit && Boolean(opts.enhanced),\n 'degree-inherit': Boolean(opts.inherit),\n })}\n part=\"degree\"\n >\n <obc-textbox class=\"degree-glyph\" .size=${size} alignment=\"center\"\n >°</obc-textbox\n >\n </span>\n `;\n }\n\n /**\n * The gap rendered between the value digits and the unit.\n *\n * - `hasDegree`: a cap-height `°` column whose width scales with the value\n * size (the `°` replaces the default gap).\n * - otherwise: the default 2px gap (only when a trailing unit follows).\n *\n * `hasDegreeSpacer` deliberately does NOT add anything here — it keeps the 2px\n * gap and instead widens the unit column via {@link renderDegreeSpacer} (a\n * spacer AFTER the unit). That way a non-degree row's value digits stay\n * aligned with degree rows (degree column width = spacer width + 2px gap)\n * while its unit shifts left. Mirrors Figma `1:2920` (spacer) / `1:2970`\n * (degree).\n *\n * TODO(designer): cross-size alignment is deferred. Degree rows of different\n * value sizes have different `°` column widths (6/8/12px), so their value digit\n * edges stagger by `degree-width`. For degree rows of mixed sizes you cannot\n * align the value digit edges AND keep the unit column aligned — resolving it\n * needs a design decision (a constant degree reserve, which widens the smaller\n * rows' `°`, OR pinning the value edge and letting the unit column stagger).\n */\n private renderValueUnitGap(): TemplateResult | typeof nothing {\n if (!this.hasValue) {\n return nothing;\n }\n if ((this.hasDegree ?? false) && !this.off) {\n return this.renderDegreeGlyph(this.valueSize, {\n enhanced: this.rowEnhanced,\n });\n }\n if (this.hasTrailingUnitBox) {\n return html`<span class=\"value-unit-gap\" aria-hidden=\"true\"></span>`;\n }\n return nothing;\n }\n\n /**\n * A spacer rendered AFTER the unit when `hasDegreeSpacer` is set on a\n * non-degree row. Its width (`degree-compensation-padding`) = the degree\n * column width minus the 2px gap, so the row's value digits align with degree\n * rows in the same column while its unit shifts left. See\n * {@link renderValueUnitGap}.\n */\n private renderDegreeSpacer(): TemplateResult | typeof nothing {\n const hasDegree = this.hasDegree ?? false;\n const hasDegreeSpacer = this.hasDegreeSpacer ?? false;\n if (hasDegree || !hasDegreeSpacer) {\n return nothing;\n }\n return html`<span\n class=\"degree-spacer\"\n part=\"degree-spacer\"\n aria-hidden=\"true\"\n ></span>`;\n }\n\n private renderTextbox(\n role: 'label' | 'unit' | 'source',\n text: string,\n reserver?: string,\n state?: ReadoutBlockState\n ): TemplateResult {\n // The label carries its own size (labelOptions) and priority-driven weight;\n // unit and source stay xs / regular.\n const weight =\n role === 'label' ? this.labelWeight : ObcTextboxFontWeight.regular;\n const size = role === 'label' ? this.labelSize : ObcTextboxSize.xs;\n const box = html`\n <obc-textbox\n class=${classMap({\n [role]: true,\n ...this.dataQualityClasses(state?.dataQuality),\n })}\n part=${role}\n .size=${size}\n .fontWeight=${weight}\n alignment=\"left\"\n >\n ${text}\n ${reserver ? html`<span slot=\"length\">${reserver}</span>` : nothing}\n </obc-textbox>\n `;\n return wrapWithAlertFrame(state?.alert ?? false, box);\n }\n\n private renderValueCluster(): TemplateResult {\n const popUpAtSetpoint =\n this.isPopUp && this.isAtSetpoint && !this.setpointTouching;\n const setpointHidePhase = resolveSetpointHidePhase(\n popUpAtSetpoint,\n this.deferredSetpointHidePhase\n );\n return html`\n <div class=\"value-cluster\" part=\"value-cluster\">\n ${this.hasAdvice\n ? this.renderBlock({\n variant: ReadoutBlockVariant.advice,\n value: this.advice,\n valueSize: this.secondarySize,\n enhanced: false,\n weight: ObcTextboxFontWeight.regular,\n hintedZeros: this.adviceOptions?.hintedZeros ?? false,\n hasSignSpacer: this.adviceOptions?.hasSignSpacer ?? false,\n spaceReserver: this.adviceOptions?.spaceReserver,\n hasDegree: this.hasDegree ?? false,\n dataQuality: this.adviceOptions?.dataQuality,\n alert: this.adviceOptions?.alert,\n category: this.adviceOptions?.category,\n active: this.adviceOptions?.active,\n })\n : nothing}\n ${this.hasSetpoint\n ? this.renderBlock({\n variant: ReadoutBlockVariant.setpoint,\n value: this.setpoint,\n valueSize: this.setpointSize,\n // Value and setpoint share the enhanced colour state (both neutral\n // or both enhanced); the setpoint is bold only while emphasised.\n enhanced: this.rowEnhanced,\n weight: this.setpointWeight,\n hintedZeros: this.setpointOptions?.hintedZeros ?? false,\n hasSignSpacer: this.setpointOptions?.hasSignSpacer ?? false,\n spaceReserver: this.setpointOptions?.spaceReserver,\n hasDegree: this.hasDegree ?? false,\n touching: this.setpointTouching,\n hidePhase: setpointHidePhase,\n dataQuality: this.setpointOptions?.dataQuality,\n alert: this.setpointOptions?.alert,\n })\n : nothing}\n ${this.renderValueReading()}\n </div>\n `;\n }\n\n /**\n * The value reading: the value block, its degree column and the trailing unit\n * grouped in one relatively-positioned wrapper so the value alert frame AND the\n * value data-quality chip can wrap value + degree + unit together (Figma\n * 58:10120).\n *\n * Moving the degree / unit into this wrapper (the new last child of\n * `.value-cluster`) preserves every existing gap, so the underlying content\n * stays column-aligned with or without the frame / chip. Both the value alert\n * (overlay) and the value data-quality chip are applied here — NOT inside\n * `obc-readout-block` — so they extend over the unit; setpoint/advice keep their\n * own block-level frame and chip. The chip uses `outline` (not `border`), so it\n * never shifts the value's width / column alignment.\n */\n private renderValueReading(): TemplateResult {\n return html`\n <div\n class=${classMap({\n 'value-reading': true,\n ...this.dataQualityClasses(this.valueOptions?.dataQuality),\n })}\n part=\"value-reading\"\n >\n ${this.hasValue\n ? this.renderBlock({\n variant: ReadoutBlockVariant.value,\n value: this.value,\n valueType: this.valueType,\n valueSize: this.valueSize,\n enhanced: this.rowEnhanced,\n weight: this.valueWeight,\n hintedZeros: this.valueOptions?.hintedZeros ?? false,\n hasSignSpacer: this.valueOptions?.hasSignSpacer ?? false,\n spaceReserver: this.valueOptions?.spaceReserver,\n off: this.off,\n hasIcon: this.valueOptions?.hasIcon ?? false,\n })\n : nothing}\n ${this.renderValueUnitGap()}\n <div class=\"unit-area\" part=\"unit-area\">\n ${this.renderTrailingUnit()} ${this.renderDegreeSpacer()}\n </div>\n ${this.renderValueAlertOverlay()}\n </div>\n `;\n }\n\n /**\n * The value alert frame, drawn as a pure overlay around the value reading\n * (value + degree + unit). It reserves no space — the `obc-alert-frame` sits in\n * an absolutely-positioned box offset outward (see `.value-alert-overlay` in\n * the CSS) so its stroke is centred on the 4px/2px padding line and toggling it\n * never shifts content or row height. Renders only when `valueOptions.alert` is\n * a config object.\n */\n private renderValueAlertOverlay(): TemplateResult | typeof nothing {\n const alert = this.valueOptions?.alert;\n if (typeof alert !== 'object' || alert === null) {\n return nothing;\n }\n const thickness = alert.thickness ?? ObcAlertFrameThickness.Small;\n return html`\n <div class=\"value-alert-overlay\" aria-hidden=\"true\">\n <obc-alert-frame\n part=\"value-alert-frame\"\n .type=${alert.type ?? ObcAlertFrameType.Regular}\n .thickness=${thickness}\n .status=${alert.status ?? AlertType.Alarm}\n .mode=${alert.mode ?? ObcAlertFrameMode.ackedActive}\n .flashingSpeed=${alert.flashingSpeed ?? FlashingSpeed.Default}\n .showIcon=${alert.showIcon ?? false}\n .showAlertCategoryIcon=${alert.showAlertCategoryIcon ?? true}\n .wrapContent=${false}\n .fullWidth=${false}\n ></obc-alert-frame>\n </div>\n `;\n }\n\n private renderLabelContainer(): TemplateResult {\n const stacking = this.resolvedStacking;\n const showLeadingUnit =\n stacking === ReadoutListItemStacking.leadingUnit && Boolean(this.unit);\n const showLeadingSrc = this.hasLeadingSrc && Boolean(this.src);\n\n return html`\n <div class=\"label-container\" part=\"label-container\">\n ${this.hasLeadingIcon\n ? html`<span class=\"leading-icon\" aria-hidden=\"true\"\n ><slot name=\"leading-icon\"></slot\n ></span>`\n : nothing}\n <div class=\"label-stack\" part=\"label-stack\">\n ${this.label\n ? this.renderTextbox(\n 'label',\n this.label,\n this.labelOptions?.spaceReserver\n )\n : nothing}\n ${showLeadingUnit\n ? this.renderTextbox(\n 'unit',\n this.unit ?? '',\n this.unitOptions?.spaceReserver\n )\n : nothing}\n ${showLeadingSrc ? this.renderSourceBlock() : nothing}\n </div>\n </div>\n `;\n }\n\n private renderTrailingUnit(): TemplateResult | typeof nothing {\n if (!this.hasTrailingUnitBox) {\n return nothing;\n }\n return this.renderTextbox(\n 'unit',\n this.unit ?? '',\n this.unitOptions?.spaceReserver\n );\n }\n\n /**\n * The source text plus its optional state chip and deviation line. The\n * plain (regular, no-deviation) case renders the bare textbox; a state or a\n * deviation wraps it in the `.source-block` stack.\n */\n private renderSourceBlock(): TemplateResult {\n const state = this.srcOptions?.state ?? ReadoutSourceState.regular;\n const deviation = this.srcOptions?.deviation;\n const hasDeviation = deviation !== undefined && Number.isFinite(deviation);\n const box = this.renderTextbox(\n 'source',\n this.src ?? '',\n this.srcOptions?.spaceReserver,\n this.srcOptions\n );\n if (state === ReadoutSourceState.regular && !hasDeviation) {\n return box;\n }\n return html`\n <div\n class=${classMap({\n 'source-block': true,\n [`source-state-${state}`]: state !== ReadoutSourceState.regular,\n })}\n part=\"source-block\"\n >\n ${box}\n ${hasDeviation\n ? html`<span class=\"source-deviation\">\n <obi-delta aria-hidden=\"true\"></obi-delta>\n <obc-textbox\n class=\"source-deviation-value\"\n .size=${ObcTextboxSize.xs}\n .tabularNums=${true}\n alignment=\"left\"\n >${deviation}</obc-textbox\n >\n </span>`\n : nothing}\n </div>\n `;\n }\n\n private renderTrailingSource(): TemplateResult | typeof nothing {\n if (this.hasLeadingSrc || !this.src) {\n return nothing;\n }\n return html`\n <div class=\"divider\" part=\"divider\" aria-hidden=\"true\"></div>\n ${this.renderSourceBlock()}\n `;\n }\n\n private renderContent(): TemplateResult {\n return html`\n <div class=\"content\" part=\"content\">\n ${this.renderLabelContainer()}\n <div class=\"value-area\" part=\"value-area\">\n ${this.renderValueCluster()}\n </div>\n ${this.renderTrailingSource()}\n </div>\n `;\n }\n\n protected override willUpdate(changed: Map<string, unknown>): void {\n super.willUpdate(changed);\n // Never gate this on `changed`: a throw clears Lit's changed map, so the\n // next update would skip the check and render the invalid value as a dash\n // (readout-components.md § 1, pinned by readout-block.spec.ts).\n assertReadoutValueType('obc-readout-list-item', this.value, this.valueType);\n assertReadoutFractionDigits('obc-readout-list-item', this.fractionDigits);\n }\n\n override updated(changed: Map<string, unknown>): void {\n super.updated(changed);\n\n const firstUpdate = !this.hasCompletedFirstUpdate;\n this.hasCompletedFirstUpdate = true;\n\n // Pop-up: hide the setpoint shortly after the value reaches it. `touching`\n // and the non-pop-up modes keep the setpoint visible.\n if (!this.isPopUp || this.setpointTouching) {\n this.clearDeferredSetpointHide();\n return;\n }\n\n const shouldHide = this.hasSetpoint && this.isAtSetpoint;\n\n if (firstUpdate) {\n // Settle to the resting state on mount without animating.\n this.deferredSetpointHidePhase = shouldHide\n ? ReadoutBlockHidePhase.hidden\n : ReadoutBlockHidePhase.none;\n return;\n }\n\n if (!shouldHide) {\n this.clearDeferredSetpointHide();\n return;\n }\n\n if (this.deferredSetpointHidePhase !== ReadoutBlockHidePhase.none) {\n return;\n }\n\n this.deferredSetpointHidePhase = ReadoutBlockHidePhase.hiding;\n window.clearTimeout(this.deferredSetpointHideTimer);\n this.deferredSetpointHideTimer = window.setTimeout(() => {\n this.deferredSetpointHidePhase = ReadoutBlockHidePhase.hidden;\n this.deferredSetpointHideTimer = undefined;\n }, 100);\n }\n\n private clearDeferredSetpointHide(): void {\n if (this.deferredSetpointHidePhase !== ReadoutBlockHidePhase.none) {\n this.deferredSetpointHidePhase = ReadoutBlockHidePhase.none;\n }\n window.clearTimeout(this.deferredSetpointHideTimer);\n this.deferredSetpointHideTimer = undefined;\n }\n\n override disconnectedCallback(): void {\n window.clearTimeout(this.deferredSetpointHideTimer);\n this.deferredSetpointHideTimer = undefined;\n // Settle a mid-flight hide to its end state. Without this, disconnecting\n // during the 100ms window leaves the phase stuck at 'hiding' (the timer that\n // would advance it to 'hidden' is gone), so a later reconnect never resolves.\n if (this.deferredSetpointHidePhase === ReadoutBlockHidePhase.hiding) {\n this.deferredSetpointHidePhase = ReadoutBlockHidePhase.hidden;\n }\n super.disconnectedCallback();\n }\n\n override render() {\n const clickable = this.resolvedClickable;\n const dataQuality = this.dataQuality;\n const classes = classMap({\n root: true,\n [`size-${this.resolvedSize}`]: true,\n [`stacking-${this.resolvedStacking}`]: true,\n [`priority-${this.resolvedPriority}`]: true,\n 'data-low-integrity':\n dataQuality === ReadoutListItemDataQuality.lowIntegrity,\n 'data-invalid': dataQuality === ReadoutListItemDataQuality.invalid,\n 'flip-flop': this.isFlipFlop,\n clickable: Boolean(clickable),\n [`border-${clickable ? clickable.border : ReadoutListItemBorder.squared}`]:\n Boolean(clickable),\n });\n\n const surface = html`<div class=\"surface\" part=\"surface\">\n ${this.renderContent()}\n </div>`;\n\n // No `aria-label` here: it would override the button's accessible name and\n // hide the dynamic readout text (value / unit / source) from screen readers.\n // The visible content (label + value + unit + source) already forms a\n // complete accessible name; icons/reservers are aria-hidden / visibility-clipped.\n const root = clickable\n ? html`<button class=${classes} part=\"root\" type=\"button\">\n ${surface}\n </button>`\n : html`<div class=${classes} part=\"root\">${surface}</div>`;\n\n // `alert: true` (the Angular wrapper's widened `boolean`) becomes a default\n // frame `{}`, as `wrapWithAlertFrame` ignores non-object truthy values. The\n // row frame stretches full width; per-block frames hug (#1001).\n const alert = this.alert === true ? {} : this.alert;\n return wrapWithAlertFrame(alert, root, true);\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-readout-list-item': ObcReadoutListItem;\n }\n}\n"],"names":["ReadoutListItemStacking","ReadoutListItemPriority","ReadoutListItemBorder","ReadoutListItemSetpointInteraction","ReadoutSourceState","state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkEO,MAAM,sBAAsB;AAW5B,IAAK,4CAAAA,6BAAL;AACLA,2BAAA,cAAA,IAAe;AACfA,2BAAA,aAAA,IAAc;AACdA,2BAAA,YAAA,IAAa;AACbA,2BAAA,kBAAA,IAAmB;AAJT,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;AAYL,IAAK,4CAAAC,6BAAL;AACLA,2BAAA,SAAA,IAAU;AACVA,2BAAA,UAAA,IAAW;AAFD,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;AAUL,MAAM,6BAA6B;AASnC,IAAK,0CAAAC,2BAAL;AACLA,yB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AAM,OAAA,CAAO;AAAA,GAzCb,mBAyCe,WAAA,gBAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GA1Cb,mBA0Ce,WAAA,eAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GA3Cb,mBA2Ce,WAAA,cAAA,CAAA;AAEgB,gBAAA;AAAA,EAAzC,SAAS,EAAC,MAAM,SAAS,SAAS,MAAK;AAAA,GA7C7B,mBA6C+B,WAAA,oBAAA,CAAA;AAGzB,gBAAA;AAAA,EAAhB,MAAA;AAAM,GAhDI,mBAgDM,WAAA,6BAAA,CAAA;AAhDN,qBAAN,gBAAA;AAAA,EADN,cAAc,uBAAuB;AAAA,GACzB,kBAAA;"}
@@ -1,7 +1,11 @@
1
1
  import { FlashTempo } from '../types.js';
2
- /** Shared off phase: nested cycles (800/1600/3200 ms) then dip together (#1224). */
3
- export declare const FLASH_OFF_MS = 400;
2
+ /** Shared on phase: every tempo lights up for the first 400 ms of its cycle. */
4
3
  export declare const FLASH_ON_MS: Record<FlashTempo, number>;
4
+ /**
5
+ * The off phase carries the tempo. The cycles (800/1600/3200 ms) nest, so
6
+ * every tempo lights up together at the start of the longest one (#1224).
7
+ */
8
+ export declare const FLASH_OFF_MS: Record<FlashTempo, number>;
5
9
  export declare const FLASH_TEMPOS: readonly FlashTempo[];
6
10
  export declare function flashPeriodMs(tempo: FlashTempo): number;
7
11
  /** Animated custom property name; `on` reads 1 during the on phase, `off` 1 during the off phase. */
@@ -1 +1 @@
1
- {"version":3,"file":"blinking.d.ts","sourceRoot":"","sources":["../../src/palettes/blinking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,UAAU,EAAC,MAAM,aAAa,CAAC;AAE3D,oFAAoF;AACpF,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAIlD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAI7C,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEvD;AAED,qGAAqG;AACrG,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,GAAG,KAAK,GAAG,MAAM,CAE5E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE,WAAW,EACf,KAAK,EAAE,UAAU,GAChB,MAAM,IAAI,CAkBZ;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,IAAI,CAGvD"}
1
+ {"version":3,"file":"blinking.d.ts","sourceRoot":"","sources":["../../src/palettes/blinking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,UAAU,EAAC,MAAM,aAAa,CAAC;AAE3D,gFAAgF;AAChF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAIlD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAInD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAI7C,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEvD;AAED,qGAAqG;AACrG,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,GAAG,KAAK,GAAG,MAAM,CAE5E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE,WAAW,EACf,KAAK,EAAE,UAAU,GAChB,MAAM,IAAI,CAkBZ;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,IAAI,CAGvD"}
@@ -1,6 +1,10 @@
1
1
  import { FlashingSpeed } from "../types.js";
2
- const FLASH_OFF_MS = 400;
3
2
  const FLASH_ON_MS = {
3
+ [FlashingSpeed.Fast]: 400,
4
+ [FlashingSpeed.Slow]: 400,
5
+ [FlashingSpeed.VerySlow]: 400
6
+ };
7
+ const FLASH_OFF_MS = {
4
8
  [FlashingSpeed.Fast]: 400,
5
9
  [FlashingSpeed.Slow]: 1200,
6
10
  [FlashingSpeed.VerySlow]: 2800
@@ -11,7 +15,7 @@ const FLASH_TEMPOS = [
11
15
  FlashingSpeed.VerySlow
12
16
  ];
13
17
  function flashPeriodMs(tempo) {
14
- return FLASH_ON_MS[tempo] + FLASH_OFF_MS;
18
+ return FLASH_ON_MS[tempo] + FLASH_OFF_MS[tempo];
15
19
  }
16
20
  function flashVariable(tempo, phase) {
17
21
  return `--flash-${tempo}-${phase}`;
@@ -1 +1 @@
1
- {"version":3,"file":"blinking.js","sources":["../../src/palettes/blinking.ts"],"sourcesContent":["import {FlashingSpeed, type FlashTempo} from '../types.js';\n\n/** Shared off phase: nested cycles (800/1600/3200 ms) then dip together (#1224). */\nexport const FLASH_OFF_MS = 400;\n\nexport const FLASH_ON_MS: Record<FlashTempo, number> = {\n [FlashingSpeed.Fast]: 400,\n [FlashingSpeed.Slow]: 1200,\n [FlashingSpeed.VerySlow]: 2800,\n};\n\nexport const FLASH_TEMPOS: readonly FlashTempo[] = [\n FlashingSpeed.Fast,\n FlashingSpeed.Slow,\n FlashingSpeed.VerySlow,\n];\n\nexport function flashPeriodMs(tempo: FlashTempo): number {\n return FLASH_ON_MS[tempo] + FLASH_OFF_MS;\n}\n\n/** Animated custom property name; `on` reads 1 during the on phase, `off` 1 during the off phase. */\nexport function flashVariable(tempo: FlashTempo, phase: 'on' | 'off'): string {\n return `--flash-${tempo}-${phase}`;\n}\n\n/**\n * Animates `--flash-<tempo>-on` / `-off` on `el` for one tempo. Returns the\n * cancel function.\n */\nexport function installFlashing(\n el: HTMLElement,\n tempo: FlashTempo\n): () => void {\n const on = flashVariable(tempo, 'on');\n const off = flashVariable(tempo, 'off');\n const period = flashPeriodMs(tempo);\n const frames: Keyframe[] = [\n {[on]: 1, [off]: 0, easing: 'step-end'},\n {\n [on]: 0,\n [off]: 1,\n offset: FLASH_ON_MS[tempo] / period,\n easing: 'step-end',\n },\n {[on]: 0, [off]: 1},\n ];\n const anim = el.animate(frames, {duration: period, iterations: Infinity});\n // Document-timeline origin, so every flashing element is in the same phase.\n anim.startTime = 0;\n return () => anim.cancel();\n}\n\n/** Installs every tempo on `el`, for CSS that reads the variables directly. */\nexport function blinkingAll(el: HTMLElement): () => void {\n const cancels = FLASH_TEMPOS.map((tempo) => installFlashing(el, tempo));\n return () => cancels.forEach((cancel) => cancel());\n}\n"],"names":[],"mappings":";AAGO,MAAM,eAAe;AAErB,MAAM,cAA0C;AAAA,EACrD,CAAC,cAAc,IAAI,GAAG;AAAA,EACtB,CAAC,cAAc,IAAI,GAAG;AAAA,EACtB,CAAC,cAAc,QAAQ,GAAG;AAC5B;AAEO,MAAM,eAAsC;AAAA,EACjD,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAChB;AAEO,SAAS,cAAc,OAA2B;AACvD,SAAO,YAAY,KAAK,IAAI;AAC9B;AAGO,SAAS,cAAc,OAAmB,OAA6B;AAC5E,SAAO,WAAW,KAAK,IAAI,KAAK;AAClC;AAMO,SAAS,gBACd,IACA,OACY;AACZ,QAAM,KAAK,cAAc,OAAO,IAAI;AACpC,QAAM,MAAM,cAAc,OAAO,KAAK;AACtC,QAAM,SAAS,cAAc,KAAK;AAClC,QAAM,SAAqB;AAAA,IACzB,EAAC,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,QAAQ,WAAA;AAAA,IAC5B;AAAA,MACE,CAAC,EAAE,GAAG;AAAA,MACN,CAAC,GAAG,GAAG;AAAA,MACP,QAAQ,YAAY,KAAK,IAAI;AAAA,MAC7B,QAAQ;AAAA,IAAA;AAAA,IAEV,EAAC,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,GAAG,EAAA;AAAA,EAAC;AAEpB,QAAM,OAAO,GAAG,QAAQ,QAAQ,EAAC,UAAU,QAAQ,YAAY,UAAS;AAExE,OAAK,YAAY;AACjB,SAAO,MAAM,KAAK,OAAA;AACpB;AAGO,SAAS,YAAY,IAA6B;AACvD,QAAM,UAAU,aAAa,IAAI,CAAC,UAAU,gBAAgB,IAAI,KAAK,CAAC;AACtE,SAAO,MAAM,QAAQ,QAAQ,CAAC,WAAW,QAAQ;AACnD;"}
1
+ {"version":3,"file":"blinking.js","sources":["../../src/palettes/blinking.ts"],"sourcesContent":["import {FlashingSpeed, type FlashTempo} from '../types.js';\n\n/** Shared on phase: every tempo lights up for the first 400 ms of its cycle. */\nexport const FLASH_ON_MS: Record<FlashTempo, number> = {\n [FlashingSpeed.Fast]: 400,\n [FlashingSpeed.Slow]: 400,\n [FlashingSpeed.VerySlow]: 400,\n};\n\n/**\n * The off phase carries the tempo. The cycles (800/1600/3200 ms) nest, so\n * every tempo lights up together at the start of the longest one (#1224).\n */\nexport const FLASH_OFF_MS: Record<FlashTempo, number> = {\n [FlashingSpeed.Fast]: 400,\n [FlashingSpeed.Slow]: 1200,\n [FlashingSpeed.VerySlow]: 2800,\n};\n\nexport const FLASH_TEMPOS: readonly FlashTempo[] = [\n FlashingSpeed.Fast,\n FlashingSpeed.Slow,\n FlashingSpeed.VerySlow,\n];\n\nexport function flashPeriodMs(tempo: FlashTempo): number {\n return FLASH_ON_MS[tempo] + FLASH_OFF_MS[tempo];\n}\n\n/** Animated custom property name; `on` reads 1 during the on phase, `off` 1 during the off phase. */\nexport function flashVariable(tempo: FlashTempo, phase: 'on' | 'off'): string {\n return `--flash-${tempo}-${phase}`;\n}\n\n/**\n * Animates `--flash-<tempo>-on` / `-off` on `el` for one tempo. Returns the\n * cancel function.\n */\nexport function installFlashing(\n el: HTMLElement,\n tempo: FlashTempo\n): () => void {\n const on = flashVariable(tempo, 'on');\n const off = flashVariable(tempo, 'off');\n const period = flashPeriodMs(tempo);\n const frames: Keyframe[] = [\n {[on]: 1, [off]: 0, easing: 'step-end'},\n {\n [on]: 0,\n [off]: 1,\n offset: FLASH_ON_MS[tempo] / period,\n easing: 'step-end',\n },\n {[on]: 0, [off]: 1},\n ];\n const anim = el.animate(frames, {duration: period, iterations: Infinity});\n // Document-timeline origin, so every flashing element is in the same phase.\n anim.startTime = 0;\n return () => anim.cancel();\n}\n\n/** Installs every tempo on `el`, for CSS that reads the variables directly. */\nexport function blinkingAll(el: HTMLElement): () => void {\n const cancels = FLASH_TEMPOS.map((tempo) => installFlashing(el, tempo));\n return () => cancels.forEach((cancel) => cancel());\n}\n"],"names":[],"mappings":";AAGO,MAAM,cAA0C;AAAA,EACrD,CAAC,cAAc,IAAI,GAAG;AAAA,EACtB,CAAC,cAAc,IAAI,GAAG;AAAA,EACtB,CAAC,cAAc,QAAQ,GAAG;AAC5B;AAMO,MAAM,eAA2C;AAAA,EACtD,CAAC,cAAc,IAAI,GAAG;AAAA,EACtB,CAAC,cAAc,IAAI,GAAG;AAAA,EACtB,CAAC,cAAc,QAAQ,GAAG;AAC5B;AAEO,MAAM,eAAsC;AAAA,EACjD,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAChB;AAEO,SAAS,cAAc,OAA2B;AACvD,SAAO,YAAY,KAAK,IAAI,aAAa,KAAK;AAChD;AAGO,SAAS,cAAc,OAAmB,OAA6B;AAC5E,SAAO,WAAW,KAAK,IAAI,KAAK;AAClC;AAMO,SAAS,gBACd,IACA,OACY;AACZ,QAAM,KAAK,cAAc,OAAO,IAAI;AACpC,QAAM,MAAM,cAAc,OAAO,KAAK;AACtC,QAAM,SAAS,cAAc,KAAK;AAClC,QAAM,SAAqB;AAAA,IACzB,EAAC,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,QAAQ,WAAA;AAAA,IAC5B;AAAA,MACE,CAAC,EAAE,GAAG;AAAA,MACN,CAAC,GAAG,GAAG;AAAA,MACP,QAAQ,YAAY,KAAK,IAAI;AAAA,MAC7B,QAAQ;AAAA,IAAA;AAAA,IAEV,EAAC,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,GAAG,EAAA;AAAA,EAAC;AAEpB,QAAM,OAAO,GAAG,QAAQ,QAAQ,EAAC,UAAU,QAAQ,YAAY,UAAS;AAExE,OAAK,YAAY;AACjB,SAAO,MAAM,KAAK,OAAA;AACpB;AAGO,SAAS,YAAY,IAA6B;AACvD,QAAM,UAAU,aAAa,IAAI,CAAC,UAAU,gBAAgB,IAAI,KAAK,CAAC;AACtE,SAAO,MAAM,QAAQ,QAAQ,CAAC,WAAW,QAAQ;AACnD;"}
package/dist/types.d.ts CHANGED
@@ -29,6 +29,21 @@ export declare enum FlashingSpeed {
29
29
  export type ResolvedFlashingSpeed = Exclude<FlashingSpeed, FlashingSpeed.Default>;
30
30
  export type FlashTempo = Exclude<ResolvedFlashingSpeed, FlashingSpeed.Fixed>;
31
31
  export declare const ALERT_SEVERITY_PRIORITY: AlertType[];
32
+ /**
33
+ * Number of active alerts per severity: the level severities and the IEC
34
+ * severities `alarm`, `warning` and `caution`. `rankAlertCounts` in
35
+ * `alert-severity.ts` orders them and leaves out counts of zero or less.
36
+ */
37
+ export interface AlertCounts {
38
+ countLevelCritical?: number;
39
+ countAlarm?: number;
40
+ countLevelHigh?: number;
41
+ countWarning?: number;
42
+ countLevelMedium?: number;
43
+ countCaution?: number;
44
+ countLevelLow?: number;
45
+ countLevelDiagnostic?: number;
46
+ }
32
47
  export declare enum AlertCategory {
33
48
  a = "a",
34
49
  b = "b",
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,EAAE,OAAO;IACT,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,oBAAY,SAAS;IACnB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,aAAa,mBAAmB;IAChC,SAAS,eAA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AC,EAAE,aAAa,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,WAEpC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,WAE1C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,WAErC;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,WAErC;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,UAgBvD;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC;AAEjD,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,UA0BzC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["export enum Direction {\n Up = 'up',\n Down = 'down',\n Left = 'left',\n Right = 'right',\n}\n\nexport enum AlertType {\n Alarm = 'alarm',\n Warning = 'warning',\n Caution = 'caution',\n LevelCritical = 'level-critical',\n LevelHigh = 'level-high',\n LevelMedium = 'level-medium',\n LevelLow = 'level-low',\n LevelDiagnostic = 'level-diagnostic',\n}\n\n/**\n * Flash tempo of an alert element. `default` resolves per alert type and\n * phase (see `resolveFlashingSpeed` in `alert-severity.ts`); `fixed` never\n * flashes.\n */\nexport enum FlashingSpeed {\n Default = 'default',\n Fast = 'fast',\n Slow = 'slow',\n VerySlow = 'very-slow',\n Fixed = 'fixed',\n}\n\nexport type ResolvedFlashingSpeed = Exclude<\n FlashingSpeed,\n FlashingSpeed.Default\n>;\n\nexport type FlashTempo = Exclude<ResolvedFlashingSpeed, FlashingSpeed.Fixed>;\n\nexport const ALERT_SEVERITY_PRIORITY = [\n AlertType.LevelCritical,\n AlertType.Alarm,\n AlertType.LevelHigh,\n AlertType.Warning,\n AlertType.LevelMedium,\n AlertType.Caution,\n AlertType.LevelLow,\n AlertType.LevelDiagnostic,\n];\n\nexport enum AlertCategory {\n a = 'a',\n b = 'b',\n c = 'c',\n}\n\nexport interface Alert {\n id: string;\n tagId: string;\n source: string;\n text: string;\n note?: string;\n acknowledged:\n | false\n | {\n acknowledgedBy: string;\n acknowledgedAt: Date;\n };\n active:\n | true\n | {\n rectifiedTime: Date;\n };\n type: AlertType;\n time: Date;\n lastModified?: Date;\n shelved?:\n | false\n | {\n shelvedStartTime: Date;\n shelvedEndTime?: Date;\n shelvedBy?: string;\n };\n blocked?:\n | false\n | {\n blockedStartTime: Date;\n blockedEndTime?: Date;\n blockedBy?: string;\n };\n noAck?: boolean;\n noSilence?: boolean;\n category?: AlertCategory;\n memberOf?: string[];\n}\n\nexport function isActive(alert: Alert) {\n return alert.active === true;\n}\n\nexport function isAcknowledged(alert: Alert) {\n return alert.acknowledged !== false && alert.acknowledged !== undefined;\n}\n\nexport function isShelved(alert: Alert) {\n return alert.shelved !== false && alert.shelved !== undefined;\n}\n\nexport function isBlocked(alert: Alert) {\n return alert.blocked !== false && alert.blocked !== undefined;\n}\n\nexport function comparePriorityAlerts(a: Alert, b: Alert) {\n if (a.type !== b.type) {\n return (\n ALERT_SEVERITY_PRIORITY.indexOf(b.type) -\n ALERT_SEVERITY_PRIORITY.indexOf(a.type)\n );\n }\n\n if (isActive(a) !== isActive(b)) {\n return isActive(a) ? 1 : -1;\n }\n\n if (isAcknowledged(a) !== isAcknowledged(b)) {\n return isAcknowledged(a) ? -1 : 1;\n }\n return a.time.getTime() - b.time.getTime();\n}\n\nexport type TimeSinceFn = (time: Date) => string;\n\nexport function formatTimeSince(time: Date) {\n const now = new Date();\n const diff = now.getTime() - time.getTime();\n const diffInSeconds = diff / 1000;\n if (diffInSeconds < 60) {\n return Math.round(diffInSeconds) + 's';\n }\n const diffInMinutes = diffInSeconds / 60;\n if (diffInMinutes < 60) {\n return (\n Math.round(diffInMinutes) + 'm ' + Math.round(diffInSeconds % 60) + 's'\n );\n }\n const diffInHours = diffInMinutes / 60;\n if (diffInHours < 24) {\n return (\n Math.round(diffInHours) + 'h ' + Math.round(diffInMinutes % 60) + 'm'\n );\n }\n const diffInDays = diffInHours / 24;\n if (diffInDays < 365) {\n return Math.round(diffInDays) + 'd ' + Math.round(diffInHours % 24) + 'h';\n }\n return (\n Math.round(diffInDays / 365) + 'y ' + Math.round(diffInDays % 365) + 'd'\n );\n}\n"],"names":["Direction","AlertType","FlashingSpeed","AlertCategory"],"mappings":"AAAO,IAAK,8BAAAA,eAAL;AACLA,aAAA,IAAA,IAAK;AACLA,aAAA,MAAA,IAAO;AACPA,aAAA,MAAA,IAAO;AACPA,aAAA,OAAA,IAAQ;AAJE,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAOL,IAAK,8BAAAC,eAAL;AACLA,aAAA,OAAA,IAAQ;AACRA,aAAA,SAAA,IAAU;AACVA,aAAA,SAAA,IAAU;AACVA,aAAA,eAAA,IAAgB;AAChBA,aAAA,WAAA,IAAY;AACZA,aAAA,aAAA,IAAc;AACdA,aAAA,UAAA,IAAW;AACXA,aAAA,iBAAA,IAAkB;AARR,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAgBL,IAAK,kCAAAC,mBAAL;AACLA,iBAAA,SAAA,IAAU;AACVA,iBAAA,MAAA,IAAO;AACPA,iBAAA,MAAA,IAAO;AACPA,iBAAA,UAAA,IAAW;AACXA,iBAAA,OAAA,IAAQ;AALE,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AAeL,MAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AACF;AAEO,IAAK,kCAAAC,mBAAL;AACLA,iBAAA,GAAA,IAAI;AACJA,iBAAA,GAAA,IAAI;AACJA,iBAAA,GAAA,IAAI;AAHM,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AA8CL,SAAS,SAAS,OAAc;AACrC,SAAO,MAAM,WA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E,IAAI;AAAA,EACxE;AACA,SACE,KAAK,MAAM,aAAa,GAAG,IAAI,OAAO,KAAK,MAAM,aAAa,GAAG,IAAI;AAEzE;"}
1
+ {"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["export enum Direction {\n Up = 'up',\n Down = 'down',\n Left = 'left',\n Right = 'right',\n}\n\nexport enum AlertType {\n Alarm = 'alarm',\n Warning = 'warning',\n Caution = 'caution',\n LevelCritical = 'level-critical',\n LevelHigh = 'level-high',\n LevelMedium = 'level-medium',\n LevelLow = 'level-low',\n LevelDiagnostic = 'level-diagnostic',\n}\n\n/**\n * Flash tempo of an alert element. `default` resolves per alert type and\n * phase (see `resolveFlashingSpeed` in `alert-severity.ts`); `fixed` never\n * flashes.\n */\nexport enum FlashingSpeed {\n Default = 'default',\n Fast = 'fast',\n Slow = 'slow',\n VerySlow = 'very-slow',\n Fixed = 'fixed',\n}\n\nexport type ResolvedFlashingSpeed = Exclude<\n FlashingSpeed,\n FlashingSpeed.Default\n>;\n\nexport type FlashTempo = Exclude<ResolvedFlashingSpeed, FlashingSpeed.Fixed>;\n\nexport const ALERT_SEVERITY_PRIORITY = [\n AlertType.LevelCritical,\n AlertType.Alarm,\n AlertType.LevelHigh,\n AlertType.Warning,\n AlertType.LevelMedium,\n AlertType.Caution,\n AlertType.LevelLow,\n AlertType.LevelDiagnostic,\n];\n\n/**\n * Number of active alerts per severity: the level severities and the IEC\n * severities `alarm`, `warning` and `caution`. `rankAlertCounts` in\n * `alert-severity.ts` orders them and leaves out counts of zero or less.\n */\nexport interface AlertCounts {\n countLevelCritical?: number;\n countAlarm?: number;\n countLevelHigh?: number;\n countWarning?: number;\n countLevelMedium?: number;\n countCaution?: number;\n countLevelLow?: number;\n countLevelDiagnostic?: number;\n}\n\nexport enum AlertCategory {\n a = 'a',\n b = 'b',\n c = 'c',\n}\n\nexport interface Alert {\n id: string;\n tagId: string;\n source: string;\n text: string;\n note?: string;\n acknowledged:\n | false\n | {\n acknowledgedBy: string;\n acknowledgedAt: Date;\n };\n active:\n | true\n | {\n rectifiedTime: Date;\n };\n type: AlertType;\n time: Date;\n lastModified?: Date;\n shelved?:\n | false\n | {\n shelvedStartTime: Date;\n shelvedEndTime?: Date;\n shelvedBy?: string;\n };\n blocked?:\n | false\n | {\n blockedStartTime: Date;\n blockedEndTime?: Date;\n blockedBy?: string;\n };\n noAck?: boolean;\n noSilence?: boolean;\n category?: AlertCategory;\n memberOf?: string[];\n}\n\nexport function isActive(alert: Alert) {\n return alert.active === true;\n}\n\nexport function isAcknowledged(alert: Alert) {\n return alert.acknowledged !== false && alert.acknowledged !== undefined;\n}\n\nexport function isShelved(alert: Alert) {\n return alert.shelved !== false && alert.shelved !== undefined;\n}\n\nexport function isBlocked(alert: Alert) {\n return alert.blocked !== false && alert.blocked !== undefined;\n}\n\nexport function comparePriorityAlerts(a: Alert, b: Alert) {\n if (a.type !== b.type) {\n return (\n ALERT_SEVERITY_PRIORITY.indexOf(b.type) -\n ALERT_SEVERITY_PRIORITY.indexOf(a.type)\n );\n }\n\n if (isActive(a) !== isActive(b)) {\n return isActive(a) ? 1 : -1;\n }\n\n if (isAcknowledged(a) !== isAcknowledged(b)) {\n return isAcknowledged(a) ? -1 : 1;\n }\n return a.time.getTime() - b.time.getTime();\n}\n\nexport type TimeSinceFn = (time: Date) => string;\n\nexport function formatTimeSince(time: Date) {\n const now = new Date();\n const diff = now.getTime() - time.getTime();\n const diffInSeconds = diff / 1000;\n if (diffInSeconds < 60) {\n return Math.round(diffInSeconds) + 's';\n }\n const diffInMinutes = diffInSeconds / 60;\n if (diffInMinutes < 60) {\n return (\n Math.round(diffInMinutes) + 'm ' + Math.round(diffInSeconds % 60) + 's'\n );\n }\n const diffInHours = diffInMinutes / 60;\n if (diffInHours < 24) {\n return (\n Math.round(diffInHours) + 'h ' + Math.round(diffInMinutes % 60) + 'm'\n );\n }\n const diffInDays = diffInHours / 24;\n if (diffInDays < 365) {\n return Math.round(diffInDays) + 'd ' + Math.round(diffInHours % 24) + 'h';\n }\n return (\n Math.round(diffInDays / 365) + 'y ' + Math.round(diffInDays % 365) + 'd'\n );\n}\n"],"names":["Direction","AlertType","FlashingSpeed","AlertCategory"],"mappings":"AAAO,IAAK,8BAAAA,eAAL;AACLA,aAAA,IAAA,IAAK;AACLA,aAAA,MAAA,IAAO;AACPA,aAAA,MAAA,IAAO;AACPA,aAAA,OAAA,IAAQ;AAJE,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAOL,IAAK,8BAAAC,eAAL;AACLA,aAAA,OAAA,IAAQ;AACRA,aAAA,SAAA,IAAU;AACVA,aAAA,SAAA,IAAU;AACVA,aAAA,eAAA,IAAgB;AAChBA,aAAA,WAAA,IAAY;AACZA,aAAA,aAAA,IAAc;AACdA,aAAA,UAAA,IAAW;AACXA,aAAA,iBAAA,IAAkB;AARR,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAgBL,IAAK,kCAAAC,mBAAL;AACLA,iBAAA,SAAA,IAAU;AACVA,iBAAA,MAAA,IAAO;AACPA,iBAAA,MAAA,IAAO;AACPA,iBAAA,UAAA,IAAW;AACXA,iBAAA,OAAA,IAAQ;AALE,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AAeL,MAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AACF;AAkBO,IAAK,kCAAAC,mBAAL;AACLA,iBAAA,GAAA,IAAI;AACJA,iBAAA,GAAA,IAAI;AACJA,iBAAA,GAAA,IAAI;AAHM,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AA8CL,SAAS,SAAS,OAAc;AACrC,SAAO,MAAM,WAAW;AAC1B;AAEO,SAAS,eAAe,OAAc;AAC3C,SAAO,MAAM,iBAAiB,SAAS,MAAM,iBAAiB;AAChE;AAEO,SAAS,UAAU,OAAc;AACtC,SAAO,MAAM,YAAY,SAAS,MAAM,YAA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  "name": "@oicl/openbridge-webcomponents",
3
- "version": "2.0.0-next.152",
3
+ "version": "2.0.0-next.154",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -86,7 +86,7 @@
86
86
  "@lit-labs/cli-localize": "^0.2.2",
87
87
  "@oicl-lit/gen-wrapper-angular": "0.1.6",
88
88
  "@oicl-lit/gen-wrapper-react": "0.3.6",
89
- "@oicl-lit/gen-wrapper-svelte": "0.1.1",
89
+ "@oicl-lit/gen-wrapper-svelte": "0.2.0",
90
90
  "@oicl-lit/gen-wrapper-vue": "0.4.4",
91
91
  "@open-wc/lit-helpers": "^0.7.0",
92
92
  "@playwright/test": "1.60.0",