@oicl/openbridge-webcomponents-full-bundle 2.2.0-next.15 → 2.2.0-next.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/openbridge-webcomponents.bundle.js +320 -64
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +1752 -15
- package/dist/automation/analog-threeway-valve/analog-threeway-valve.d.ts +4 -4
- package/dist/automation/analog-threeway-valve/analog-threeway-valve.js.map +1 -1
- package/dist/automation/automation-badge/automation-badge.css_inline.js +6 -0
- package/dist/automation/automation-badge/automation-badge.d.ts +61 -1
- package/dist/automation/automation-badge/automation-badge.d.ts.map +1 -1
- package/dist/automation/automation-badge/automation-badge.js +83 -1
- package/dist/automation/automation-badge/automation-badge.js.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts +20 -0
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js +1 -0
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button.d.ts +16 -4
- package/dist/automation/automation-button/abstract-automation-button.d.ts.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button.js +46 -20
- package/dist/automation/automation-button/abstract-automation-button.js.map +1 -1
- package/dist/automation/automation-button/badge-layout.d.ts +34 -0
- package/dist/automation/automation-button/badge-layout.d.ts.map +1 -0
- package/dist/automation/automation-button/badge-layout.js +64 -0
- package/dist/automation/automation-button/badge-layout.js.map +1 -0
- package/dist/automation/automation-tank/automation-tank.d.ts.map +1 -1
- package/dist/automation/automation-tank/automation-tank.js +7 -2
- package/dist/automation/automation-tank/automation-tank.js.map +1 -1
- package/dist/automation/digital-threeway-valve/digital-threeway-valve.d.ts +4 -4
- package/dist/automation/digital-threeway-valve/digital-threeway-valve.js.map +1 -1
- package/dist/automation/electricity-battery/electricity-battery.d.ts +4 -4
- package/dist/automation/electricity-battery/electricity-battery.js.map +1 -1
- package/dist/automation/specialty-tank/abstract-specialty-tank.d.ts.map +1 -1
- package/dist/automation/specialty-tank/abstract-specialty-tank.js +7 -2
- package/dist/automation/specialty-tank/abstract-specialty-tank.js.map +1 -1
- package/dist/internal/global-setting.d.ts +55 -0
- package/dist/internal/global-setting.d.ts.map +1 -0
- package/dist/internal/global-setting.js +86 -0
- package/dist/internal/global-setting.js.map +1 -0
- package/package.json +3 -2
- package/script/check-typography-ramp.ts +144 -0
- package/script/typography/ramp.ts +237 -0
- package/script/typography-ramp.test.ts +267 -0
- package/src/automation/analog-threeway-valve/analog-threeway-valve.ts +4 -4
- package/src/automation/analog-valve/analog-valve.stories.ts +8 -0
- package/src/automation/automation-badge/automation-badge.css +6 -0
- package/src/automation/automation-badge/automation-badge.stories.ts +47 -3
- package/src/automation/automation-badge/automation-badge.ts +124 -1
- package/src/automation/automation-button/abstract-automation-button-storybook-helpers.ts +3 -0
- package/src/automation/automation-button/abstract-automation-button.ts +70 -23
- package/src/automation/automation-button/badge-layout.spec.ts +138 -0
- package/src/automation/automation-button/badge-layout.ts +120 -0
- package/src/automation/automation-tank/automation-tank.ts +11 -6
- package/src/automation/digital-threeway-valve/digital-threeway-valve.ts +4 -4
- package/src/automation/electricity-battery/electricity-battery.ts +4 -4
- package/src/automation/pump/pump.stories.ts +59 -0
- package/src/automation/specialty-tank/abstract-specialty-tank.ts +11 -6
- package/src/internal/global-setting.spec.ts +119 -0
- package/src/internal/global-setting.ts +105 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automation-tank.js","names":["compentStyle","_decorate"],"sources":["../../../src/automation/automation-tank/automation-tank.ts"],"sourcesContent":["import {\n HTMLTemplateResult,\n LitElement,\n html,\n nothing,\n svg,\n unsafeCSS,\n PropertyValues,\n} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport compentStyle from './automation-tank.css?inline';\nimport {LineMedium} from '../index.js';\nimport '../automation-badge/automation-badge.js';\nimport {ObcAutomationBadgeType} from '../automation-badge/automation-badge.js';\nimport {\n AutomationButtonBadgeAlert,\n AutomationButtonBadgeCommandLocked,\n AutomationButtonBadgeControl,\n AutomationButtonBadgeInterlock,\n} from '../automation-button/abstract-automation-button.js';\n\nimport '../../icons/icon-chevron-double-up-google.js';\nimport '../../icons/icon-chevron-up-google.js';\nimport '../../icons/icon-chevron-double-down-google.js';\nimport '../../icons/icon-chevron-down-google.js';\nimport '../../icons/icon-arrow-right-google.js';\nimport '../../icons/icon-off.js';\nimport '../../icons/icon-tank.js';\nimport '../../icons/icon-energy-battery.js';\nimport '../../navigation-instruments/gauge-trend/gauge-trend.js';\nimport '../../building-blocks/bar-vertical/bar-vertical.js';\nimport '../../components/alert-frame/alert-frame.js';\nimport {Priority} from '../../navigation-instruments/types.js';\nimport {\n ObcAlertFrameMode,\n ObcAlertFrameThickness,\n ObcAlertFrameType,\n} from '../../components/alert-frame/alert-frame.js';\nimport {AlertType} from '../../types.js';\nimport type {ChartLineDataItem} from '../../building-blocks/chart-line/chart-line-base.js';\nimport {AdviceMixin, syncAdviceAlias} from '../../svghelpers/advice-mixin.js';\nimport type {AdviceInput} from '../../svghelpers/advice.js';\nimport {\n AdvicePosition,\n ExternalScaleSide,\n FillMode,\n ScaleType,\n computeOutsideBarThickness,\n} from '../../building-blocks/external-scale/external-scale.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\nimport {SetpointMixin} from '../../svghelpers/setpoint-mixin.js';\nimport {TankPositioning} from './tank-positioning.js';\nimport {clamp} from '../../svghelpers/math.js';\n\nexport enum TankTrend {\n fastRising = 'fast-rising',\n rising = 'rising',\n stable = 'stable',\n falling = 'falling',\n fastFalling = 'fast-falling',\n closed = 'closed',\n}\n\nexport enum TankType {\n generic = 'generic',\n atmospheric = 'atmospheric',\n pressurized = 'pressurized',\n battery = 'battery',\n}\n\nexport enum TankOrientation {\n vertical = 'vertical',\n horizontal = 'horizontal',\n}\n\nexport {TankPositioning};\n\nexport enum TankChartMode {\n /** Static fill bar driven by `value` / `max` (default, backward compatible). */\n bar = 'bar',\n /** Embedded `obc-gauge-trend` line/area chart, no side bar. */\n graph = 'graph',\n /** Embedded `obc-gauge-trend` line/area chart with a side bar. */\n graphAndBar = 'graph-and-bar',\n}\n\n/**\n *\n *\n * Setpoint properties are inherited from {@link SetpointMixin}\n * (`setpoint`, `newSetpoint`, `touching`, `atSetpoint`, `autoAtSetpoint`,\n * `autoAtSetpointDeadband`, `setpointAtZeroDeadband`, `setpointOverride`,\n * `animateSetpoint`) and are forwarded to the embedded chart: the SVG bar in\n * `bar` mode, or `obc-gauge-trend` in the graph modes (where the marker\n * renders on the side bar, i.e. `graph-and-bar`). Values share the tank's\n * `value` / `max` scale.\n *\n * @property positioning - Host positioning model — see `TankPositioning` for details. Defaults to\n * `button` (host fills parent container, 100% × 100%, falling back to the\n * design aspect ratio on any axis the parent leaves indefinite, no anchor\n * offset). Set to `point` for the legacy P&ID canvas mode (fixed default\n * dimensions + top-center anchor offset).\n * @property activated - Enables the activated background color, used to indicate that the tank is\n * activated/selected. Requires an interactive tank — the `noClick` mixin\n * variant used when `clickable` is `false` only paints the enabled state, so\n * a non-clickable tank ignores this (matching `obc-elevated-card`).\n * @availableWhen activated clickable==true\n * @property chartData - Time-series data points for the embedded gauge-trend (graph modes only).\n * @property priority - Priority hint forwarded to child charts (regular | enhanced).\n * @property advice - Advice overlays. Forwarded to the embedded `obc-gauge-trend` in\n * `graph` / `graph-and-bar` modes, or rendered as pills over the static\n * bar in `bar` mode.\n * @property hasAdvice - Show advice overlays (works in all `chartMode` variants).\n * @property alert - Show an `<obc-alert-frame>` overlay around the bordered tank area (the\n * `.halo` wrapper). Mirrors the API of `obc-automation-button`: same seven\n * properties, same three slots (`alert-icon`, `alert-label`, `alert-timer`).\n * The ring overlays `.halo` only, so the tag and readout that sit outside\n * the halo in compact / static layouts remain unaffected.\n * @property alertFrameType - Shape of the alert frame.\n * @availableWhen alertFrameType alert==true\n * @property alertFrameThickness - Thickness of the alert frame.\n * @availableWhen alertFrameThickness alert==true\n * @property alertFrameStatus - Alert status the frame is coloured for.\n * @availableWhen alertFrameStatus alert==true\n * @property alertFrameMode - Acknowledgement state of the alert: `acked-active` (default) is steady,\n * `unacked-active` flashes, `unacked-rectified` flashes a dashed frame.\n * @availableWhen alertFrameMode alert==true\n * @property showAlertCategoryIcon - Shows the alert category icon inside the frame.\n * @availableWhen showAlertCategoryIcon alert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]\n * @property showAlertIcon - Shows the slotted alert icon inside the frame.\n * @availableWhen showAlertIcon alert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]\n * @property showTrendSymbol - Show the trend chevron / off icon next to the percent readout. Default\n * `true` preserves existing behavior. Set to `false` to hide the trend\n * indicator in both compact and non-compact readouts — useful when the\n * trend is not meaningful for a given tank, or when the consumer wants\n * to keep the readout compact. Has no effect in `static` mode, which\n * renders the tank's capacity (`max` + `unit`) instead of a percent and\n * intentionally omits the trend indicator (a static tank represents\n * \"device present, current state unknown\"). `attribute: false` per the\n * repo's positive-default-true boolean convention.\n * @property percentFractionDigits - Number of fraction digits used to format the percent readout in the\n * non-compact (regular) layout. Defaults to `0` (integer percent). The\n * compact layout always renders integer percent to keep its fixed-width\n * footprint stable. The static layout renders capacity (`max` + `unit`)\n * rather than percent, so this property has no effect there — pass a\n * pre-formatted value through the `max-value` slot if fractional\n * precision is needed (see the `WithFractionDigits` story).\n * @property static - Display-only variant for a device whose current state is unknown: the\n * chart cell is hidden, the bordered area is filled with\n * `--container-section-color` and the readout is centred inside it. Always\n * compact-sized, so it overrides `compact`, and it renders as a\n * `<div role=\"img\">` — outside the tab order and not announced as a control.\n * @property clickable - Whether the tank is interactive. `true` renders the root as a `<button>`\n * with the flat-mixin interaction surface; `false` renders a `<div>` that\n * keeps the resting appearance (the mixin's `noClick` variant) but loses\n * hover, pressed and focus-visible and leaves the tab order. Everything\n * else — chart, badges, readout, tag and the alert frame — still renders,\n * so use it for a display-only tank that shows live data. No effect on a\n * `static` tank, which is already non-interactive.\n * @property chartMode - Chart cell rendering mode: `bar` (default) is a static fill bar driven by\n * `value` and `max`, `graph` embeds an `obc-gauge-trend` line/area chart,\n * and `graphAndBar` embeds one with an integrated side bar.\n * @property hasGraphIcon - Overlays a decorative icon centred on the chart cell — the energy-battery\n * icon for a battery tank, the generic tank icon otherwise. Works in every\n * `chartMode` and both orientations; the icon sits in a fixed CSS layer\n * above the bar or graph and is silhouetted so it stays legible on any\n * fill, and its size follows the ambient `obc-component-size-*` class.\n * @property badgeControl - Control badge rendered in the `badges` cell. A non-`None` value renders an\n * `<obc-automation-badge>` as fallback content for the `badges` slot, so any\n * slotted content wins. The cell orders the four badges control, alert,\n * interlock, commandLocked, left to right.\n * @slot badges - Custom badges to be displayed in the badge area.\n * @slot tag - Text or element for the tank's tag/label.\n * @slot readout - Replaces the entire readout content block.\n * @slot max-value - Content for the capacity value.\n * @slot unit - Content for the unit of measurement.\n * @slot current-value - Content for the current level value.\n * @slot rich - Detail rows below the main readout, shown in the regular\n * (non-compact, non-static) layout. Slot an `<obc-readout-list>` of\n * `<obc-readout-list-item>` rows — it owns the row typography and cross-row\n * column alignment; the tank renders a divider above it automatically when\n * the slot is filled.\n * @slot alert-icon - Custom icon for the alert frame.\n * @slot alert-label - Label for the alert frame.\n * @slot alert-timer - Timer for the alert frame.\n * @fires click - Fired when the tank is clicked. When `clickable` is `false` the tank renders a plain `<div>`, and in `static` mode a `<div role=\"img\">`, instead of a `<button>` — in both cases it is not focusable or keyboard-activatable; pointer clicks still reach the host.\n * @beta\n */\n@customElement('obc-automation-tank')\nexport class ObcAutomationTank extends AdviceMixin(SetpointMixin(LitElement)) {\n @property({type: String}) medium: LineMedium = LineMedium.water;\n @property({type: Number}) value: number = 0;\n @property({type: Number}) max: number = 100;\n @property({type: String}) trend: TankTrend = TankTrend.stable;\n @property({type: String, reflect: true}) type: TankType = TankType.generic;\n @property({type: String, reflect: true}) orientation: TankOrientation =\n TankOrientation.vertical;\n @property({type: Boolean, reflect: true}) compact: boolean = false;\n @property({type: String, reflect: true}) positioning: TankPositioning =\n TankPositioning.button;\n @property({type: Boolean, reflect: true}) static: boolean = false;\n @property({type: Boolean, attribute: false}) clickable: boolean = true;\n @property({type: Boolean}) activated: boolean = false;\n @property({type: String}) tag: string = '';\n\n @property({type: String, reflect: true, attribute: 'chart-mode'})\n chartMode: TankChartMode = TankChartMode.bar;\n\n @property({type: Array, attribute: false})\n chartData: ChartLineDataItem[] = [];\n\n @property({type: String}) priority: Priority = Priority.regular;\n\n /** @deprecated Alias of `advices`. Ranges in tank units. */\n @property({type: Array, attribute: false}) advice?: AdviceInput[];\n\n @property({type: Boolean}) hasAdvice = false;\n\n @property({type: Boolean, attribute: false}) hasGraphIcon = false;\n\n @property({type: Boolean}) alert: boolean = false;\n @property({type: String}) alertFrameType: ObcAlertFrameType =\n ObcAlertFrameType.SmallSideFlip;\n @property({type: String}) alertFrameThickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n @property({type: String}) alertFrameStatus: AlertType = AlertType.Alarm;\n @property({type: String}) alertFrameMode: ObcAlertFrameMode =\n ObcAlertFrameMode.ackedActive;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n @property({type: Boolean}) showAlertIcon: boolean = false;\n\n @property({type: Boolean, attribute: false}) showTrendSymbol: boolean = true;\n\n @property({type: Number}) percentFractionDigits: number = 0;\n\n @property({type: String}) badgeControl: AutomationButtonBadgeControl =\n AutomationButtonBadgeControl.None;\n @property({type: String}) badgeAlert: AutomationButtonBadgeAlert =\n AutomationButtonBadgeAlert.None;\n @property({type: String}) badgeInterlock: AutomationButtonBadgeInterlock =\n AutomationButtonBadgeInterlock.None;\n @property({type: String})\n badgeCommandLocked: AutomationButtonBadgeCommandLocked =\n AutomationButtonBadgeCommandLocked.None;\n\n @state() private _cellWidth = 0;\n @state() private _cellHeight = 0;\n /**\n * Tracks whether the `badges` and `tag` slots have assigned content. Used\n * in compact/static mode to collapse empty cells to 0px so the tank-frame\n * can absorb the freed space (per spec: \"if there are no badges it would\n * grow upward; if there are no readout or tags it would grow downward\").\n * Non-compact (regular) layout keeps its grid-based reserved rows.\n */\n @state() private _hasBadges = false;\n @state() private _hasTagSlot = false;\n /**\n * Tracks whether the `rich` slot has assigned content, so the regular\n * (non-compact) layout only draws the rich divider when a consumer has\n * slotted detail rows (canonically an `<obc-readout-list>`). Mirrors\n * `_hasBadges` / `_hasTagSlot`.\n */\n @state() private _hasRichSlot = false;\n private _chartResizeObserver?: ResizeObserver;\n private _observedCell?: Element;\n\n private get isCompact(): boolean {\n return this.compact || this.static;\n }\n\n private _badgeAlertType(): ObcAutomationBadgeType | null {\n switch (this.badgeAlert) {\n case AutomationButtonBadgeAlert.Silence:\n return ObcAutomationBadgeType.AlertSilenced;\n case AutomationButtonBadgeAlert.Caution:\n return ObcAutomationBadgeType.Caution;\n case AutomationButtonBadgeAlert.Warning:\n return ObcAutomationBadgeType.Warning;\n case AutomationButtonBadgeAlert.Alarm:\n return ObcAutomationBadgeType.Alarm;\n case AutomationButtonBadgeAlert.LevelCritical:\n return ObcAutomationBadgeType.LevelCritical;\n case AutomationButtonBadgeAlert.LevelHigh:\n return ObcAutomationBadgeType.LevelHigh;\n case AutomationButtonBadgeAlert.LevelMedium:\n return ObcAutomationBadgeType.LevelMedium;\n case AutomationButtonBadgeAlert.LevelLow:\n return ObcAutomationBadgeType.LevelLow;\n case AutomationButtonBadgeAlert.LevelDiagnostic:\n return ObcAutomationBadgeType.LevelDiagnostic;\n default:\n return null;\n }\n }\n\n private _badgeControlType(): ObcAutomationBadgeType | null {\n switch (this.badgeControl) {\n case AutomationButtonBadgeControl.Local:\n return ObcAutomationBadgeType.Local;\n case AutomationButtonBadgeControl.LocalOnly:\n return ObcAutomationBadgeType.LocalOnly;\n case AutomationButtonBadgeControl.Manual:\n return ObcAutomationBadgeType.Manual;\n case AutomationButtonBadgeControl.ManualOnly:\n return ObcAutomationBadgeType.ManualOnly;\n case AutomationButtonBadgeControl.Auto:\n return ObcAutomationBadgeType.Auto;\n default:\n return null;\n }\n }\n\n private _badgeInterlockType(): ObcAutomationBadgeType | null {\n switch (this.badgeInterlock) {\n case AutomationButtonBadgeInterlock.Interlock:\n return ObcAutomationBadgeType.Interlock;\n case AutomationButtonBadgeInterlock.InterlockInhibit:\n return ObcAutomationBadgeType.InterlockInhibit;\n default:\n return null;\n }\n }\n\n private _badgeCommandLockedType(): ObcAutomationBadgeType | null {\n if (\n this.badgeCommandLocked ===\n AutomationButtonBadgeCommandLocked.CommandLocked\n ) {\n return ObcAutomationBadgeType.CommandLocked;\n }\n return null;\n }\n\n private get _usesGaugeTrend(): boolean {\n return (\n this.chartMode === TankChartMode.graph ||\n this.chartMode === TankChartMode.graphAndBar\n );\n }\n\n private _onBadgesSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasBadges = slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n private _onTagSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasTagSlot = slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n private _onRichSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasRichSlot = slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._chartResizeObserver?.disconnect();\n this._chartResizeObserver = undefined;\n this._observedCell = undefined;\n }\n\n protected override updated(\n changed: Map<string | number | symbol, unknown>\n ): void {\n super.updated(changed);\n // The chart cell element is recreated when `chartMode` moves between bar\n // and graph, and appears or disappears with `static` and `compact`, so the\n // observer is re-attached to the current `.bar-container`. `priority`\n // needs no forwarding — children take it through template bindings.\n this._syncChartResizeObserver();\n }\n\n private _syncChartResizeObserver(): void {\n // Observe the bar-container in BOTH bar mode and graph modes — the bar\n // mode now renders an SVG `obc-bar-vertical` / `-horizontal` that needs\n // measured pixel dimensions for its viewBox and barThickness.\n const cell = this.renderRoot.querySelector('.bar-container');\n if (!cell) {\n if (this._chartResizeObserver) {\n this._chartResizeObserver.disconnect();\n this._observedCell = undefined;\n }\n return;\n }\n if (cell === this._observedCell) return;\n\n if (!this._chartResizeObserver) {\n this._chartResizeObserver = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (!entry) return;\n const w = Math.round(entry.contentRect.width);\n const h = Math.round(entry.contentRect.height);\n if (w !== this._cellWidth) this._cellWidth = w;\n if (h !== this._cellHeight) this._cellHeight = h;\n });\n } else {\n this._chartResizeObserver.disconnect();\n }\n this._chartResizeObserver.observe(cell);\n this._observedCell = cell;\n }\n\n trendIcon(): HTMLTemplateResult | typeof nothing {\n if (this.trend === TankTrend.fastRising) {\n return html`<obi-chevron-double-up-google\n class=\"trend-icon\"\n ></obi-chevron-double-up-google>`;\n } else if (this.trend === TankTrend.rising) {\n return html`<obi-chevron-up-google\n class=\"trend-icon\"\n ></obi-chevron-up-google>`;\n } else if (this.trend === TankTrend.fastFalling) {\n return html`<obi-chevron-double-down-google\n class=\"trend-icon\"\n ></obi-chevron-double-down-google>`;\n } else if (this.trend === TankTrend.falling) {\n return html`<obi-chevron-down-google\n class=\"trend-icon\"\n ></obi-chevron-down-google>`;\n } else if (this.trend === TankTrend.closed) {\n return html`<obi-off class=\"trend-icon\"></obi-off>`;\n } else {\n return html`<obi-arrow-right-google\n class=\"trend-icon\"\n ></obi-arrow-right-google>`;\n }\n }\n\n /**\n * Atmospheric cap, 3-piece (corner-start / stretchable middle arc / corner-end).\n * Each piece draws its own fill (closed) and stroke (open) so adjacent pieces\n * abut without a visible vertical seam line. Coordinates are derived from the\n * Figma 248x14 path; corners stay 12px wide while the middle arc stretches.\n * Position (start vs end) and orientation flipping are handled in CSS.\n *\n * Horizontal orientation reuses the same path data but rotates each piece\n * via an inner `<g transform=\"translate(0 H) rotate(-90)\">`, mapping the\n * source coord (x, y) to (y, H - x). The viewBox is swapped accordingly:\n * corner: 12x14 -> 14x12 (H=12)\n * middle: 224x14 -> 14x224 (H=224)\n * Cap-end (right side in horizontal) is mirrored via CSS scaleX(-1).\n */\n private renderAtmosphericCap(side: 'start' | 'end'): HTMLTemplateResult {\n const isHorizontal = this.orientation === TankOrientation.horizontal;\n\n // Curve Y-values are scaled proportionally from the 18/12-tall Figma\n // reference, so the corners stay continuous at both thicknesses\n // (automation-components.md § Tank rendering).\n let cornerStartFill: string;\n let cornerStartStroke: string;\n let midFill: string;\n let midStroke: string;\n let cornerEndFill: string;\n let cornerEndStroke: string;\n let cornerW: number;\n let capH: number;\n let midW: number;\n\n if (this.isCompact) {\n cornerW = 7;\n capH = 10;\n midW = 149;\n cornerStartFill =\n 'M 6.374 4.8214 C 6.138 4.8429, 6.005 4.8543, 5.83 4.8771 C 2.937 5.2557, 0.669 7.0957, 0.51 9.1936 C 0.5 9.3214, 0.5 9.4357, 0.5 9.6429 L 0.5 10 L 6.374 10 Z';\n cornerStartStroke =\n 'M 6.374 4.8214 C 6.138 4.8429, 6.005 4.8543, 5.83 4.8771 C 2.937 5.2557, 0.669 7.0957, 0.51 9.1936 C 0.5 9.3214, 0.5 9.4357, 0.5 9.6429 L 0.5 10';\n midFill =\n 'M 0 4.8214 C 10.97 3.8214, 37.83 1.7857, 74.626 1.7857 C 111.42 1.7857, 138.28 3.8214, 149.252 4.8214 L 149.252 10 L 0 10 Z';\n midStroke =\n 'M 0 4.8214 C 10.97 3.8214, 37.83 1.7857, 74.626 1.7857 C 111.42 1.7857, 138.28 3.8214, 149.252 4.8214';\n cornerEndFill =\n 'M 0 4.8214 C 0.236 4.8429, 0.369 4.8543, 0.544 4.8771 C 3.437 5.2557, 5.705 7.0957, 5.864 9.1936 C 5.874 9.3214, 5.874 9.4357, 5.874 9.6429 L 5.874 10 L 0 10 Z';\n cornerEndStroke =\n 'M 0 4.8214 C 0.236 4.8429, 0.369 4.8543, 0.544 4.8771 C 3.437 5.2557, 5.705 7.0957, 5.864 9.1936 C 5.874 9.3214, 5.874 9.4357, 5.874 9.6429 L 5.874 10';\n } else {\n cornerW = 12;\n capH = 14;\n midW = 224;\n cornerStartFill =\n 'M 12 6.5837 C 6.346 6.7737, 5.176 6.8744, 4.168 7.2537 C 2.6445 7.8272, 1.418 8.8983, 0.8613 10.1415 C 0.493 10.9641, 0.5 11.9099, 0.5 13.6111 L 0.5 14 L 12 14 Z';\n // Curve and outer edge only: the seam with `.middle` is a 1px CSS\n // `border-top` so it pixel-snaps like the pressurized cap's border,\n // where an SVG stroke renders thinner and blurrier.\n cornerStartStroke =\n 'M 12 6.5837 C 6.346 6.7737, 5.176 6.8744, 4.168 7.2537 C 2.6445 7.8272, 1.418 8.8983, 0.8613 10.1415 C 0.493 10.9641, 0.5 11.9099, 0.5 13.6111 L 0.5 14';\n midFill =\n 'M 0 6.5837 C 16 5.1124, 56 1.9444, 112 1.9444 C 168 1.9444, 208 5.1124, 224 6.5837 L 224 14 L 0 14 Z';\n midStroke =\n 'M 0 6.5837 C 16 5.1124, 56 1.9444, 112 1.9444 C 168 1.9444, 208 5.1124, 224 6.5837';\n cornerEndFill =\n 'M 0 6.5837 C 5.654 6.7737, 6.824 6.8744, 7.832 7.2537 C 9.3555 7.8272, 10.582 8.8983, 11.1387 10.1415 C 11.507 10.9641, 11.5 11.9099, 11.5 13.6111 L 11.5 14 L 0 14 Z';\n cornerEndStroke =\n 'M 0 6.5837 C 5.654 6.7737, 6.824 6.8744, 7.832 7.2537 C 9.3555 7.8272, 10.582 8.8983, 11.1387 10.1415 C 11.507 10.9641, 11.5 11.9099, 11.5 13.6111 L 11.5 14';\n }\n\n if (isHorizontal) {\n // Rotate vertical paths -90deg into a `capH`-wide column. Source coord\n // (x, y) maps to (y, cornerW - x) for corners and (y, midW - x) for mid.\n return html`\n <div class=\"cap cap-atmospheric cap-${side}\">\n <svg\n class=\"cap-corner cap-corner-start\"\n viewBox=\"0 0 ${capH} ${cornerW}\"\n preserveAspectRatio=\"xMidYMax meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${cornerW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${cornerStartFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerStartStroke}\" />\n </g>\n `}\n </svg>\n <svg\n class=\"cap-mid\"\n viewBox=\"0 0 ${capH} ${midW}\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${midW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${midFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" vector-effect=\"non-scaling-stroke\" d=\"${midStroke}\" />\n </g>\n `}\n </svg>\n <svg\n class=\"cap-corner cap-corner-end\"\n viewBox=\"0 0 ${capH} ${cornerW}\"\n preserveAspectRatio=\"xMidYMin meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${cornerW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${cornerEndFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerEndStroke}\" />\n </g>\n `}\n </svg>\n </div>\n `;\n }\n\n return html`\n <div class=\"cap cap-atmospheric cap-${side}\">\n <svg\n class=\"cap-corner cap-corner-start\"\n viewBox=\"0 0 ${cornerW} ${capH}\"\n preserveAspectRatio=\"xMaxYMid meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${cornerStartFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerStartStroke}\" />\n `}\n </svg>\n <svg\n class=\"cap-mid\"\n viewBox=\"0 0 ${midW} ${capH}\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${midFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" vector-effect=\"non-scaling-stroke\" d=\"${midStroke}\" />\n `}\n </svg>\n <svg\n class=\"cap-corner cap-corner-end\"\n viewBox=\"0 0 ${cornerW} ${capH}\"\n preserveAspectRatio=\"xMinYMid meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${cornerEndFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerEndStroke}\" />\n `}\n </svg>\n </div>\n `;\n }\n\n private renderCap(side: 'start' | 'end'): HTMLTemplateResult | null {\n if (this.type === TankType.generic) return null;\n if (this.type === TankType.battery && side === 'end') return null;\n if (this.type === TankType.atmospheric) {\n return this.renderAtmosphericCap(side);\n }\n if (this.type === TankType.pressurized) {\n return html`<div class=\"cap cap-pressurized cap-${side}\"></div>`;\n }\n // battery, start only\n return html`<div class=\"cap cap-battery cap-${side}\"></div>`;\n }\n\n override willUpdate(changed: PropertyValues) {\n super.willUpdate(changed);\n syncAdviceAlias(this, this.advice);\n }\n\n override render() {\n const safeMax = this.max > 0 ? this.max : 1;\n const percent = clamp((this.value / safeMax) * 100, 0, 100);\n const isCompact = this.isCompact;\n\n // Compact and static collapse their empty cells so the tank frame absorbs\n // the space; non-compact cells sit in the inner `.grid` and always reserve\n // their min-content rows (automation-components.md § Tank rendering).\n const controlBadge = this._badgeControlType();\n const alertBadge = this._badgeAlertType();\n const interlockBadge = this._badgeInterlockType();\n const commandLockedBadge = this._badgeCommandLockedType();\n const hasEnumBadges =\n controlBadge !== null ||\n alertBadge !== null ||\n interlockBadge !== null ||\n commandLockedBadge !== null;\n\n const badgesHidden = isCompact && !this._hasBadges && !hasEnumBadges;\n const tagHidden = isCompact && !this._hasTagSlot && !this.tag;\n\n const badgesCell = html`\n <div class=\"badges\" ?hidden=${badgesHidden}>\n <slot name=\"badges\" @slotchange=${this._onBadgesSlotChange}>\n ${\n controlBadge\n ? html`<obc-automation-badge\n .type=${controlBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n alertBadge\n ? html`<obc-automation-badge\n .type=${alertBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n interlockBadge\n ? html`<obc-automation-badge\n .type=${interlockBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n commandLockedBadge\n ? html`<obc-automation-badge\n .type=${commandLockedBadge}\n ></obc-automation-badge>`\n : nothing\n }\n </slot>\n </div>\n `;\n const tagCell = html`\n <div class=\"tag\" ?hidden=${tagHidden}>\n <slot name=\"tag\" @slotchange=${this._onTagSlotChange}>${this.tag}</slot>\n </div>\n `;\n // Static shows capacity rather than a percent: the state is unknown, so a\n // reading would be a claim the tank cannot make, and the trend icon goes\n // for the same reason (automation-components.md § Tank rendering).\n const readoutCell = this.static\n ? html`\n <div class=\"readout readout-compact readout-static\">\n <slot name=\"readout\">\n <slot name=\"max-value\">${this.max.toFixed(0)}</slot>\n <slot name=\"unit\">m<sup>3</sup></slot>\n </slot>\n </div>\n `\n : isCompact\n ? html`\n <div class=\"readout readout-compact\">\n <slot name=\"readout\">\n ${this.showTrendSymbol ? this.trendIcon() : null}\n <span class=\"percent\"\n >${percent.toFixed(0)}<span class=\"percent-symbol\"\n >%</span\n ></span\n >\n </slot>\n </div>\n `\n : html`\n <div class=\"readout\">\n <slot name=\"readout\">\n <div class=\"header\">\n ${this.showTrendSymbol ? this.trendIcon() : null}\n <div class=\"percent\">\n ${percent.toFixed(this.percentFractionDigits)}<span\n class=\"percent-symbol\"\n >%</span\n >\n </div>\n </div>\n <div class=\"value\">\n <div class=\"current\">\n <slot name=\"current-value\" class=\"current-value\"\n >${this.value.toFixed(0)}</slot\n ><span class=\"divider\">/</span>\n </div>\n <div class=\"max\">\n <slot class=\"max-value\" name=\"max-value\"\n >${this.max.toFixed(0)}</slot\n >\n <slot class=\"unit\" name=\"unit\">m<sup>3</sup></slot>\n </div>\n </div>\n <div class=\"rich-divider\" ?hidden=${!this._hasRichSlot}></div>\n <slot name=\"rich\" @slotchange=${this._onRichSlotChange}></slot>\n </slot>\n </div>\n `;\n // Two stacked icons form the silhouette `obc-automation-button` uses: the\n // back layer paints the inherited SVG `stroke` halo, the front layer the\n // fill through `color` (automation-components.md § Tank rendering).\n const graphIconClasses = classMap({\n 'graph-icon': true,\n 'priority-enhanced': this.priority === Priority.enhanced,\n });\n const graphIconOverlay =\n this.type === TankType.battery\n ? html`\n <div class=${graphIconClasses} aria-hidden=\"true\">\n <obi-energy-battery\n class=\"graph-icon-stroke\"\n ></obi-energy-battery>\n <obi-energy-battery class=\"graph-icon-fill\"></obi-energy-battery>\n </div>\n `\n : html`\n <div class=${graphIconClasses} aria-hidden=\"true\">\n <obi-tank class=\"graph-icon-stroke\"></obi-tank>\n <obi-tank class=\"graph-icon-fill\"></obi-tank>\n </div>\n `;\n // Alert-frame overlay. Mirrors the `obc-automation-button` pattern\n // exactly so consumer API is identical. Placed inside `.halo` so the\n // ring hugs only the bordered tank area; `belowHalo` (tag / readout) is\n // unaffected. `.halo` is `position: relative` (see CSS) to anchor the\n // absolutely-positioned alert-frame.\n const alertFrameOverlay = this.alert\n ? html`<obc-alert-frame\n class=\"alert-frame\"\n .type=${this.alertFrameType}\n .thickness=${this.alertFrameThickness}\n .status=${this.alertFrameStatus}\n .mode=${this.alertFrameMode}\n .showAlertCategoryIcon=${this.showAlertCategoryIcon}\n .showIcon=${this.showAlertIcon}\n >\n <span slot=\"icon\"><slot name=\"alert-icon\"></slot></span>\n <span slot=\"label\"><slot name=\"alert-label\"></slot></span>\n <span slot=\"timer\"><slot name=\"alert-timer\"></slot></span>\n </obc-alert-frame>`\n : null;\n let chartCell: HTMLTemplateResult;\n if (this._usesGaugeTrend) {\n // gauge-trend reads these as an aspect-ratio reference and derives its\n // own height from its wrapper. Rendering waits for both measurements —\n // a zero divides in that maths on first paint.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n chartCell = html`\n <div class=\"bar-container chart-cell\">\n ${\n hasSize\n ? html`<obc-gauge-trend\n .data=${this.chartData}\n .minValue=${0}\n .maxValue=${safeMax}\n .value=${this.value}\n .hasBar=${this.chartMode === TankChartMode.graphAndBar}\n .hasScale=${false}\n .hasLabelPadding=${false}\n .chartFill=${true}\n .hasAdvice=${this.hasAdvice}\n .advices=${this.advices}\n .adviceTrigger=${this.adviceTrigger}\n .adviceEmphasis=${this.adviceEmphasis}\n .width=${this._cellWidth}\n .height=${this._cellHeight}\n .setpoint=${this.setpoint}\n .newSetpoint=${this.newSetpoint}\n .touching=${this.touching}\n .atSetpoint=${this.atSetpoint}\n .autoAtSetpoint=${this.autoAtSetpoint}\n .autoAtSetpointDeadband=${this.autoAtSetpointDeadband}\n .setpointAtZeroDeadband=${this.setpointAtZeroDeadband}\n .setpointOverride=${this.setpointOverride}\n .animateSetpoint=${this.animateSetpoint}\n style=\"width: 100%; height: 100%;\"\n .priority=${this.priority}\n ></obc-gauge-trend>`\n : null\n }\n ${this.hasGraphIcon ? graphIconOverlay : null}\n </div>\n `;\n } else {\n // The shared SVG bar, the renderer gauge-trend uses for its side bar, so\n // advice overlays behave the same in all three chart modes; its fill\n // follows the instrument palette, not the tank's `medium` colour.\n // TODO(#1284): carry the medium colour through, and fold this branch\n // into gauge-trend once it offers a bar-only layout at this size.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n // The inner bar is always portrait and mirrors gauge-trend's\n // `fixedAspectRatio` sizing, so fixed-pixel SVG primitives keep one\n // on-screen size; `barThickness` and the cross-axis size are therefore\n // in viewBox units (automation-components.md § Tank rendering).\n const SCALE_REFERENCE_SIZE = 384;\n // The bar's viewBox cross-axis includes an outside-bar band for advice\n // pills, icons and/or the setpoint marker (see computeExternalScaleLayout).\n // Subtract the same band the bar will reserve so total viewBox width\n // still equals viewBoxCross and the meet-scale fills the cell exactly.\n const hasSetpointMarker =\n this.setpoint !== undefined ||\n this.newSetpoint !== undefined ||\n this.departingNewSetpoint !== undefined;\n const outsideBarReserveVb = computeOutsideBarThickness({\n hasBar: true,\n hasScale: false,\n labels: false,\n labelThickness: 0,\n tickThickness: 0,\n scaleType: ScaleType.regular,\n hasAdvice: this.hasAdvice,\n hasAdviceIcon:\n this.hasAdvice && !!this.advices?.some((a) => a.showIcon),\n advicePosition: AdvicePosition.inner,\n hasSetpoint: hasSetpointMarker,\n });\n const safeCellHeight = Math.max(1, this._cellHeight);\n const viewBoxCross =\n (this._cellWidth * SCALE_REFERENCE_SIZE) / safeCellHeight;\n const barThickness = Math.max(0, viewBoxCross - outsideBarReserveVb);\n // `tint` is locked in for tank bar mode: it draws a fill from 0 to\n // value plus a small marker at the value position, which mirrors the\n // legacy CSS bar's \"fill + top border at value\" visual idiom.\n const barWrapper = html`<obc-bar-vertical\n .minValue=${0}\n .maxValue=${safeMax}\n .value=${this.value}\n .height=${this._cellHeight}\n .fixedAspectRatio=${true}\n .scaleReferenceSize=${SCALE_REFERENCE_SIZE}\n .paddingTop=${0}\n .paddingBottom=${0}\n .side=${ExternalScaleSide.right}\n .hasBar=${true}\n .hasScale=${false}\n .showLabels=${false}\n .barThickness=${barThickness}\n .fillMode=${FillMode.tint}\n .instrumentMode=${true}\n .borderRadius=${2}\n .advices=${this.hasAdvice ? this.advices : []}\n .adviceTrigger=${this.adviceTrigger}\n .adviceEmphasis=${this.adviceEmphasis}\n .advicePosition=${AdvicePosition.inner}\n .setpoint=${this.setpoint}\n .newSetpoint=${this.newSetpoint}\n .touching=${this.touching}\n .atSetpoint=${this.atSetpoint}\n .autoAtSetpoint=${this.autoAtSetpoint}\n .autoAtSetpointDeadband=${this.autoAtSetpointDeadband}\n .setpointAtZeroDeadband=${this.setpointAtZeroDeadband}\n .setpointOverride=${this.setpointOverride}\n .animateSetpoint=${this.animateSetpoint}\n style=\"width: 100%; height: 100%;\"\n .priority=${this.priority}\n ></obc-bar-vertical>`;\n chartCell = html`\n <div class=\"bar-container bar-cell\">\n ${hasSize ? barWrapper : null}\n ${this.hasGraphIcon ? graphIconOverlay : null}\n </div>\n `;\n }\n\n const frameClasses = classMap({\n 'tank-frame': true,\n [`type-${this.type}`]: true,\n [`orientation-${this.orientation}`]: true,\n [this.medium]: true,\n compact: isCompact,\n static: this.static,\n });\n\n let middleContents: HTMLTemplateResult;\n if (this.static) {\n middleContents = html`<div class=\"static-readout\">${readoutCell}</div>`;\n } else if (this.compact) {\n middleContents = chartCell;\n } else {\n middleContents = html`<div class=\"grid\">\n ${tagCell}${badgesCell}${readoutCell}${chartCell}\n </div>`;\n }\n\n const tankFrame = html`\n <div class=${frameClasses}>\n ${this.renderCap('start')}\n <div class=\"middle\">${middleContents}</div>\n ${this.renderCap('end')}\n </div>\n `;\n\n // One interactive element: the flat mixin paints `.halo` through\n // `visibleWrapperClass` so the surround hugs the bordered area only, and\n // the alert-frame overlay is its last child so the ring covers every cell\n // (automation-components.md § Tank rendering).\n let haloContents: HTMLTemplateResult;\n if (this.static) {\n haloContents = html`${badgesCell}${tankFrame}${tagCell}`;\n } else if (this.compact) {\n haloContents = html`${badgesCell}${tankFrame}${readoutCell}${tagCell}`;\n } else {\n haloContents = tankFrame;\n }\n const halo = html`\n <div class=\"halo\">${haloContents}${alertFrameOverlay}</div>\n `;\n\n // Both classes sit on `.root` so the mixin paints `.halo`: `activated`\n // like its hover and pressed states, `clickable` choosing between the\n // six-state variant and the resting-only `noClick` one\n // (automation-components.md § Tank rendering).\n const isClickable = this.clickable && !this.static;\n const rootClasses = classMap({\n root: true,\n activated: this.activated,\n clickable: isClickable,\n });\n\n // The live region stays on all three root shapes, so an `alert` label is\n // announced whatever the interactivity (automation-components.md § Tank\n // rendering).\n // TODO(a11y): the rest of the automation family lacks the live region;\n // consolidate when alert support moves into a shared mixin.\n if (this.static) {\n return html`<div\n class=${rootClasses}\n role=\"img\"\n aria-label=${this.tag || 'Tank'}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`;\n }\n if (!isClickable) {\n return html`<div\n class=${rootClasses}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`;\n }\n return html`<button\n class=${rootClasses}\n type=\"button\"\n aria-label=${this.tag || 'Tank'}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </button>`;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-automation-tank': ObcAutomationTank;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,IAAY,YAAL,yBAAA,WAAA;CACL,UAAA,gBAAA;CACA,UAAA,YAAA;CACA,UAAA,YAAA;CACA,UAAA,aAAA;CACA,UAAA,iBAAA;CACA,UAAA,YAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,WAAL,yBAAA,UAAA;CACL,SAAA,aAAA;CACA,SAAA,iBAAA;CACA,SAAA,iBAAA;CACA,SAAA,aAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,kBAAL,yBAAA,iBAAA;CACL,gBAAA,cAAA;CACA,gBAAA,gBAAA;;AACF,EAAA,CAAA,CAAA;AAIA,IAAY,gBAAL,yBAAA,eAAA;;CAEL,cAAA,SAAA;;CAEA,cAAA,WAAA;;CAEA,cAAA,iBAAA;;AACF,EAAA,CAAA,CAAA;AAyGO,IAAM,oBAAN,MAAM,0BAA0B,YAAY,cAAc,UAAU,CAAC,CAAC,CAAC;;;EAC7B,KAAA,SAAA,WAAW;EAChB,KAAA,QAAA;EACF,KAAA,MAAA;;;;EAKqB,KAAA,UAAA;EAE3D,KAAA,cAAA,gBAAgB;EAC0C,KAAA,SAAA;EACM,KAAA,YAAA;EAClB,KAAA,YAAA;EACR,KAAA,MAAA;;EAMP,KAAA,YAAA,CAAC;EAEa,KAAA,WAAA,SAAS;EAKjB,KAAA,YAAA;EAEqB,KAAA,eAAA;EAEhB,KAAA,QAAA;EAE1C,KAAA,iBAAA,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AA,CAAA;AA3ER,oBAAAA,WAAA,CAAA,cAAc,qBAAqB,CAAA,GAAA,iBAAA"}
|
|
1
|
+
{"version":3,"file":"automation-tank.js","names":["compentStyle","_decorate"],"sources":["../../../src/automation/automation-tank/automation-tank.ts"],"sourcesContent":["import {\n HTMLTemplateResult,\n LitElement,\n html,\n nothing,\n svg,\n unsafeCSS,\n PropertyValues,\n} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport compentStyle from './automation-tank.css?inline';\nimport {LineMedium} from '../index.js';\nimport '../automation-badge/automation-badge.js';\nimport {ObcAutomationBadgeType} from '../automation-badge/automation-badge.js';\nimport {\n AutomationButtonBadgeAlert,\n AutomationButtonBadgeCommandLocked,\n AutomationButtonBadgeControl,\n AutomationButtonBadgeInterlock,\n} from '../automation-button/abstract-automation-button.js';\n\nimport '../../icons/icon-chevron-double-up-google.js';\nimport '../../icons/icon-chevron-up-google.js';\nimport '../../icons/icon-chevron-double-down-google.js';\nimport '../../icons/icon-chevron-down-google.js';\nimport '../../icons/icon-arrow-right-google.js';\nimport '../../icons/icon-off.js';\nimport '../../icons/icon-tank.js';\nimport '../../icons/icon-energy-battery.js';\nimport '../../navigation-instruments/gauge-trend/gauge-trend.js';\nimport '../../building-blocks/bar-vertical/bar-vertical.js';\nimport '../../components/alert-frame/alert-frame.js';\nimport {Priority} from '../../navigation-instruments/types.js';\nimport {\n ObcAlertFrameMode,\n ObcAlertFrameThickness,\n ObcAlertFrameType,\n} from '../../components/alert-frame/alert-frame.js';\nimport {AlertType} from '../../types.js';\nimport type {ChartLineDataItem} from '../../building-blocks/chart-line/chart-line-base.js';\nimport {AdviceMixin, syncAdviceAlias} from '../../svghelpers/advice-mixin.js';\nimport type {AdviceInput} from '../../svghelpers/advice.js';\nimport {\n AdvicePosition,\n ExternalScaleSide,\n FillMode,\n ScaleType,\n computeOutsideBarThickness,\n} from '../../building-blocks/external-scale/external-scale.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\nimport {SetpointMixin} from '../../svghelpers/setpoint-mixin.js';\nimport {TankPositioning} from './tank-positioning.js';\nimport {clamp} from '../../svghelpers/math.js';\n\nexport enum TankTrend {\n fastRising = 'fast-rising',\n rising = 'rising',\n stable = 'stable',\n falling = 'falling',\n fastFalling = 'fast-falling',\n closed = 'closed',\n}\n\nexport enum TankType {\n generic = 'generic',\n atmospheric = 'atmospheric',\n pressurized = 'pressurized',\n battery = 'battery',\n}\n\nexport enum TankOrientation {\n vertical = 'vertical',\n horizontal = 'horizontal',\n}\n\nexport {TankPositioning};\n\nexport enum TankChartMode {\n /** Static fill bar driven by `value` / `max` (default, backward compatible). */\n bar = 'bar',\n /** Embedded `obc-gauge-trend` line/area chart, no side bar. */\n graph = 'graph',\n /** Embedded `obc-gauge-trend` line/area chart with a side bar. */\n graphAndBar = 'graph-and-bar',\n}\n\n/**\n *\n *\n * Setpoint properties are inherited from {@link SetpointMixin}\n * (`setpoint`, `newSetpoint`, `touching`, `atSetpoint`, `autoAtSetpoint`,\n * `autoAtSetpointDeadband`, `setpointAtZeroDeadband`, `setpointOverride`,\n * `animateSetpoint`) and are forwarded to the embedded chart: the SVG bar in\n * `bar` mode, or `obc-gauge-trend` in the graph modes (where the marker\n * renders on the side bar, i.e. `graph-and-bar`). Values share the tank's\n * `value` / `max` scale.\n *\n * @property positioning - Host positioning model — see `TankPositioning` for details. Defaults to\n * `button` (host fills parent container, 100% × 100%, falling back to the\n * design aspect ratio on any axis the parent leaves indefinite, no anchor\n * offset). Set to `point` for the legacy P&ID canvas mode (fixed default\n * dimensions + top-center anchor offset).\n * @property activated - Enables the activated background color, used to indicate that the tank is\n * activated/selected. Requires an interactive tank — the `noClick` mixin\n * variant used when `clickable` is `false` only paints the enabled state, so\n * a non-clickable tank ignores this (matching `obc-elevated-card`).\n * @availableWhen activated clickable==true\n * @property chartData - Time-series data points for the embedded gauge-trend (graph modes only).\n * @property priority - Priority hint forwarded to child charts (regular | enhanced).\n * @property advice - Advice overlays. Forwarded to the embedded `obc-gauge-trend` in\n * `graph` / `graph-and-bar` modes, or rendered as pills over the static\n * bar in `bar` mode.\n * @property hasAdvice - Show advice overlays (works in all `chartMode` variants).\n * @property alert - Show an `<obc-alert-frame>` overlay around the bordered tank area (the\n * `.halo` wrapper). Mirrors the API of `obc-automation-button`: same seven\n * properties, same three slots (`alert-icon`, `alert-label`, `alert-timer`).\n * The ring overlays `.halo` only, so the tag and readout that sit outside\n * the halo in compact / static layouts remain unaffected.\n * @property alertFrameType - Shape of the alert frame.\n * @availableWhen alertFrameType alert==true\n * @property alertFrameThickness - Thickness of the alert frame.\n * @availableWhen alertFrameThickness alert==true\n * @property alertFrameStatus - Alert status the frame is coloured for.\n * @availableWhen alertFrameStatus alert==true\n * @property alertFrameMode - Acknowledgement state of the alert: `acked-active` (default) is steady,\n * `unacked-active` flashes, `unacked-rectified` flashes a dashed frame.\n * @availableWhen alertFrameMode alert==true\n * @property showAlertCategoryIcon - Shows the alert category icon inside the frame.\n * @availableWhen showAlertCategoryIcon alert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]\n * @property showAlertIcon - Shows the slotted alert icon inside the frame.\n * @availableWhen showAlertIcon alert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]\n * @property showTrendSymbol - Show the trend chevron / off icon next to the percent readout. Default\n * `true` preserves existing behavior. Set to `false` to hide the trend\n * indicator in both compact and non-compact readouts — useful when the\n * trend is not meaningful for a given tank, or when the consumer wants\n * to keep the readout compact. Has no effect in `static` mode, which\n * renders the tank's capacity (`max` + `unit`) instead of a percent and\n * intentionally omits the trend indicator (a static tank represents\n * \"device present, current state unknown\"). `attribute: false` per the\n * repo's positive-default-true boolean convention.\n * @property percentFractionDigits - Number of fraction digits used to format the percent readout in the\n * non-compact (regular) layout. Defaults to `0` (integer percent). The\n * compact layout always renders integer percent to keep its fixed-width\n * footprint stable. The static layout renders capacity (`max` + `unit`)\n * rather than percent, so this property has no effect there — pass a\n * pre-formatted value through the `max-value` slot if fractional\n * precision is needed (see the `WithFractionDigits` story).\n * @property static - Display-only variant for a device whose current state is unknown: the\n * chart cell is hidden, the bordered area is filled with\n * `--container-section-color` and the readout is centred inside it. Always\n * compact-sized, so it overrides `compact`, and it renders as a\n * `<div role=\"img\">` — outside the tab order and not announced as a control.\n * @property clickable - Whether the tank is interactive. `true` renders the root as a `<button>`\n * with the flat-mixin interaction surface; `false` renders a `<div>` that\n * keeps the resting appearance (the mixin's `noClick` variant) but loses\n * hover, pressed and focus-visible and leaves the tab order. Everything\n * else — chart, badges, readout, tag and the alert frame — still renders,\n * so use it for a display-only tank that shows live data. No effect on a\n * `static` tank, which is already non-interactive.\n * @property chartMode - Chart cell rendering mode: `bar` (default) is a static fill bar driven by\n * `value` and `max`, `graph` embeds an `obc-gauge-trend` line/area chart,\n * and `graphAndBar` embeds one with an integrated side bar.\n * @property hasGraphIcon - Overlays a decorative icon centred on the chart cell — the energy-battery\n * icon for a battery tank, the generic tank icon otherwise. Works in every\n * `chartMode` and both orientations; the icon sits in a fixed CSS layer\n * above the bar or graph and is silhouetted so it stays legible on any\n * fill, and its size follows the ambient `obc-component-size-*` class.\n * @property badgeControl - Control badge rendered in the `badges` cell. A non-`None` value renders an\n * `<obc-automation-badge>` as fallback content for the `badges` slot, so any\n * slotted content wins. The cell orders the four badges control, alert,\n * interlock, commandLocked, left to right.\n * @slot badges - Custom badges to be displayed in the badge area.\n * @slot tag - Text or element for the tank's tag/label.\n * @slot readout - Replaces the entire readout content block.\n * @slot max-value - Content for the capacity value.\n * @slot unit - Content for the unit of measurement.\n * @slot current-value - Content for the current level value.\n * @slot rich - Detail rows below the main readout, shown in the regular\n * (non-compact, non-static) layout. Slot an `<obc-readout-list>` of\n * `<obc-readout-list-item>` rows — it owns the row typography and cross-row\n * column alignment; the tank renders a divider above it automatically when\n * the slot is filled.\n * @slot alert-icon - Custom icon for the alert frame.\n * @slot alert-label - Label for the alert frame.\n * @slot alert-timer - Timer for the alert frame.\n * @fires click - Fired when the tank is clicked. When `clickable` is `false` the tank renders a plain `<div>`, and in `static` mode a `<div role=\"img\">`, instead of a `<button>` — in both cases it is not focusable or keyboard-activatable; pointer clicks still reach the host.\n * @beta\n */\n@customElement('obc-automation-tank')\nexport class ObcAutomationTank extends AdviceMixin(SetpointMixin(LitElement)) {\n @property({type: String}) medium: LineMedium = LineMedium.water;\n @property({type: Number}) value: number = 0;\n @property({type: Number}) max: number = 100;\n @property({type: String}) trend: TankTrend = TankTrend.stable;\n @property({type: String, reflect: true}) type: TankType = TankType.generic;\n @property({type: String, reflect: true}) orientation: TankOrientation =\n TankOrientation.vertical;\n @property({type: Boolean, reflect: true}) compact: boolean = false;\n @property({type: String, reflect: true}) positioning: TankPositioning =\n TankPositioning.button;\n @property({type: Boolean, reflect: true}) static: boolean = false;\n @property({type: Boolean, attribute: false}) clickable: boolean = true;\n @property({type: Boolean}) activated: boolean = false;\n @property({type: String}) tag: string = '';\n\n @property({type: String, reflect: true, attribute: 'chart-mode'})\n chartMode: TankChartMode = TankChartMode.bar;\n\n @property({type: Array, attribute: false})\n chartData: ChartLineDataItem[] = [];\n\n @property({type: String}) priority: Priority = Priority.regular;\n\n /** @deprecated Alias of `advices`. Ranges in tank units. */\n @property({type: Array, attribute: false}) advice?: AdviceInput[];\n\n @property({type: Boolean}) hasAdvice = false;\n\n @property({type: Boolean, attribute: false}) hasGraphIcon = false;\n\n @property({type: Boolean}) alert: boolean = false;\n @property({type: String}) alertFrameType: ObcAlertFrameType =\n ObcAlertFrameType.SmallSideFlip;\n @property({type: String}) alertFrameThickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n @property({type: String}) alertFrameStatus: AlertType = AlertType.Alarm;\n @property({type: String}) alertFrameMode: ObcAlertFrameMode =\n ObcAlertFrameMode.ackedActive;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n @property({type: Boolean}) showAlertIcon: boolean = false;\n\n @property({type: Boolean, attribute: false}) showTrendSymbol: boolean = true;\n\n @property({type: Number}) percentFractionDigits: number = 0;\n\n @property({type: String}) badgeControl: AutomationButtonBadgeControl =\n AutomationButtonBadgeControl.None;\n @property({type: String}) badgeAlert: AutomationButtonBadgeAlert =\n AutomationButtonBadgeAlert.None;\n @property({type: String}) badgeInterlock: AutomationButtonBadgeInterlock =\n AutomationButtonBadgeInterlock.None;\n @property({type: String})\n badgeCommandLocked: AutomationButtonBadgeCommandLocked =\n AutomationButtonBadgeCommandLocked.None;\n\n @state() private _cellWidth = 0;\n @state() private _cellHeight = 0;\n /**\n * Tracks whether the `badges` and `tag` slots have assigned content. Used\n * in compact/static mode to collapse empty cells to 0px so the tank-frame\n * can absorb the freed space (per spec: \"if there are no badges it would\n * grow upward; if there are no readout or tags it would grow downward\").\n * Non-compact (regular) layout keeps its grid-based reserved rows.\n */\n @state() private _hasBadges = false;\n @state() private _hasTagSlot = false;\n /**\n * Tracks whether the `rich` slot has assigned content, so the regular\n * (non-compact) layout only draws the rich divider when a consumer has\n * slotted detail rows (canonically an `<obc-readout-list>`). Mirrors\n * `_hasBadges` / `_hasTagSlot`.\n */\n @state() private _hasRichSlot = false;\n private _chartResizeObserver?: ResizeObserver;\n private _observedCell?: Element;\n\n private get isCompact(): boolean {\n return this.compact || this.static;\n }\n\n private _badgeAlertType(): ObcAutomationBadgeType | null {\n switch (this.badgeAlert) {\n case AutomationButtonBadgeAlert.Silence:\n return ObcAutomationBadgeType.AlertSilenced;\n case AutomationButtonBadgeAlert.Shelved:\n return ObcAutomationBadgeType.AlertShelved;\n case AutomationButtonBadgeAlert.Caution:\n return ObcAutomationBadgeType.Caution;\n case AutomationButtonBadgeAlert.Warning:\n return ObcAutomationBadgeType.Warning;\n case AutomationButtonBadgeAlert.Alarm:\n return ObcAutomationBadgeType.Alarm;\n case AutomationButtonBadgeAlert.LevelCritical:\n return ObcAutomationBadgeType.LevelCritical;\n case AutomationButtonBadgeAlert.LevelHigh:\n return ObcAutomationBadgeType.LevelHigh;\n case AutomationButtonBadgeAlert.LevelMedium:\n return ObcAutomationBadgeType.LevelMedium;\n case AutomationButtonBadgeAlert.LevelLow:\n return ObcAutomationBadgeType.LevelLow;\n case AutomationButtonBadgeAlert.LevelDiagnostic:\n return ObcAutomationBadgeType.LevelDiagnostic;\n default:\n return null;\n }\n }\n\n private _badgeControlType(): ObcAutomationBadgeType | null {\n switch (this.badgeControl) {\n case AutomationButtonBadgeControl.Local:\n return ObcAutomationBadgeType.Local;\n case AutomationButtonBadgeControl.LocalOnly:\n return ObcAutomationBadgeType.LocalOnly;\n case AutomationButtonBadgeControl.Manual:\n return ObcAutomationBadgeType.Manual;\n case AutomationButtonBadgeControl.ManualOnly:\n return ObcAutomationBadgeType.ManualOnly;\n case AutomationButtonBadgeControl.Auto:\n return ObcAutomationBadgeType.Auto;\n default:\n return null;\n }\n }\n\n private _badgeInterlockType(): ObcAutomationBadgeType | null {\n switch (this.badgeInterlock) {\n case AutomationButtonBadgeInterlock.Interlock:\n return ObcAutomationBadgeType.Interlock;\n case AutomationButtonBadgeInterlock.InterlockInhibit:\n return ObcAutomationBadgeType.InterlockInhibit;\n case AutomationButtonBadgeInterlock.Simulation:\n return ObcAutomationBadgeType.Simulation;\n default:\n return null;\n }\n }\n\n private _badgeCommandLockedType(): ObcAutomationBadgeType | null {\n switch (this.badgeCommandLocked) {\n case AutomationButtonBadgeCommandLocked.CommandLocked:\n return ObcAutomationBadgeType.CommandLocked;\n case AutomationButtonBadgeCommandLocked.Simulation:\n return ObcAutomationBadgeType.Simulation;\n default:\n return null;\n }\n }\n\n private get _usesGaugeTrend(): boolean {\n return (\n this.chartMode === TankChartMode.graph ||\n this.chartMode === TankChartMode.graphAndBar\n );\n }\n\n private _onBadgesSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasBadges = slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n private _onTagSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasTagSlot = slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n private _onRichSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasRichSlot = slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._chartResizeObserver?.disconnect();\n this._chartResizeObserver = undefined;\n this._observedCell = undefined;\n }\n\n protected override updated(\n changed: Map<string | number | symbol, unknown>\n ): void {\n super.updated(changed);\n // The chart cell element is recreated when `chartMode` moves between bar\n // and graph, and appears or disappears with `static` and `compact`, so the\n // observer is re-attached to the current `.bar-container`. `priority`\n // needs no forwarding — children take it through template bindings.\n this._syncChartResizeObserver();\n }\n\n private _syncChartResizeObserver(): void {\n // Observe the bar-container in BOTH bar mode and graph modes — the bar\n // mode now renders an SVG `obc-bar-vertical` / `-horizontal` that needs\n // measured pixel dimensions for its viewBox and barThickness.\n const cell = this.renderRoot.querySelector('.bar-container');\n if (!cell) {\n if (this._chartResizeObserver) {\n this._chartResizeObserver.disconnect();\n this._observedCell = undefined;\n }\n return;\n }\n if (cell === this._observedCell) return;\n\n if (!this._chartResizeObserver) {\n this._chartResizeObserver = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (!entry) return;\n const w = Math.round(entry.contentRect.width);\n const h = Math.round(entry.contentRect.height);\n if (w !== this._cellWidth) this._cellWidth = w;\n if (h !== this._cellHeight) this._cellHeight = h;\n });\n } else {\n this._chartResizeObserver.disconnect();\n }\n this._chartResizeObserver.observe(cell);\n this._observedCell = cell;\n }\n\n trendIcon(): HTMLTemplateResult | typeof nothing {\n if (this.trend === TankTrend.fastRising) {\n return html`<obi-chevron-double-up-google\n class=\"trend-icon\"\n ></obi-chevron-double-up-google>`;\n } else if (this.trend === TankTrend.rising) {\n return html`<obi-chevron-up-google\n class=\"trend-icon\"\n ></obi-chevron-up-google>`;\n } else if (this.trend === TankTrend.fastFalling) {\n return html`<obi-chevron-double-down-google\n class=\"trend-icon\"\n ></obi-chevron-double-down-google>`;\n } else if (this.trend === TankTrend.falling) {\n return html`<obi-chevron-down-google\n class=\"trend-icon\"\n ></obi-chevron-down-google>`;\n } else if (this.trend === TankTrend.closed) {\n return html`<obi-off class=\"trend-icon\"></obi-off>`;\n } else {\n return html`<obi-arrow-right-google\n class=\"trend-icon\"\n ></obi-arrow-right-google>`;\n }\n }\n\n /**\n * Atmospheric cap, 3-piece (corner-start / stretchable middle arc / corner-end).\n * Each piece draws its own fill (closed) and stroke (open) so adjacent pieces\n * abut without a visible vertical seam line. Coordinates are derived from the\n * Figma 248x14 path; corners stay 12px wide while the middle arc stretches.\n * Position (start vs end) and orientation flipping are handled in CSS.\n *\n * Horizontal orientation reuses the same path data but rotates each piece\n * via an inner `<g transform=\"translate(0 H) rotate(-90)\">`, mapping the\n * source coord (x, y) to (y, H - x). The viewBox is swapped accordingly:\n * corner: 12x14 -> 14x12 (H=12)\n * middle: 224x14 -> 14x224 (H=224)\n * Cap-end (right side in horizontal) is mirrored via CSS scaleX(-1).\n */\n private renderAtmosphericCap(side: 'start' | 'end'): HTMLTemplateResult {\n const isHorizontal = this.orientation === TankOrientation.horizontal;\n\n // Curve Y-values are scaled proportionally from the 18/12-tall Figma\n // reference, so the corners stay continuous at both thicknesses\n // (automation-components.md § Tank rendering).\n let cornerStartFill: string;\n let cornerStartStroke: string;\n let midFill: string;\n let midStroke: string;\n let cornerEndFill: string;\n let cornerEndStroke: string;\n let cornerW: number;\n let capH: number;\n let midW: number;\n\n if (this.isCompact) {\n cornerW = 7;\n capH = 10;\n midW = 149;\n cornerStartFill =\n 'M 6.374 4.8214 C 6.138 4.8429, 6.005 4.8543, 5.83 4.8771 C 2.937 5.2557, 0.669 7.0957, 0.51 9.1936 C 0.5 9.3214, 0.5 9.4357, 0.5 9.6429 L 0.5 10 L 6.374 10 Z';\n cornerStartStroke =\n 'M 6.374 4.8214 C 6.138 4.8429, 6.005 4.8543, 5.83 4.8771 C 2.937 5.2557, 0.669 7.0957, 0.51 9.1936 C 0.5 9.3214, 0.5 9.4357, 0.5 9.6429 L 0.5 10';\n midFill =\n 'M 0 4.8214 C 10.97 3.8214, 37.83 1.7857, 74.626 1.7857 C 111.42 1.7857, 138.28 3.8214, 149.252 4.8214 L 149.252 10 L 0 10 Z';\n midStroke =\n 'M 0 4.8214 C 10.97 3.8214, 37.83 1.7857, 74.626 1.7857 C 111.42 1.7857, 138.28 3.8214, 149.252 4.8214';\n cornerEndFill =\n 'M 0 4.8214 C 0.236 4.8429, 0.369 4.8543, 0.544 4.8771 C 3.437 5.2557, 5.705 7.0957, 5.864 9.1936 C 5.874 9.3214, 5.874 9.4357, 5.874 9.6429 L 5.874 10 L 0 10 Z';\n cornerEndStroke =\n 'M 0 4.8214 C 0.236 4.8429, 0.369 4.8543, 0.544 4.8771 C 3.437 5.2557, 5.705 7.0957, 5.864 9.1936 C 5.874 9.3214, 5.874 9.4357, 5.874 9.6429 L 5.874 10';\n } else {\n cornerW = 12;\n capH = 14;\n midW = 224;\n cornerStartFill =\n 'M 12 6.5837 C 6.346 6.7737, 5.176 6.8744, 4.168 7.2537 C 2.6445 7.8272, 1.418 8.8983, 0.8613 10.1415 C 0.493 10.9641, 0.5 11.9099, 0.5 13.6111 L 0.5 14 L 12 14 Z';\n // Curve and outer edge only: the seam with `.middle` is a 1px CSS\n // `border-top` so it pixel-snaps like the pressurized cap's border,\n // where an SVG stroke renders thinner and blurrier.\n cornerStartStroke =\n 'M 12 6.5837 C 6.346 6.7737, 5.176 6.8744, 4.168 7.2537 C 2.6445 7.8272, 1.418 8.8983, 0.8613 10.1415 C 0.493 10.9641, 0.5 11.9099, 0.5 13.6111 L 0.5 14';\n midFill =\n 'M 0 6.5837 C 16 5.1124, 56 1.9444, 112 1.9444 C 168 1.9444, 208 5.1124, 224 6.5837 L 224 14 L 0 14 Z';\n midStroke =\n 'M 0 6.5837 C 16 5.1124, 56 1.9444, 112 1.9444 C 168 1.9444, 208 5.1124, 224 6.5837';\n cornerEndFill =\n 'M 0 6.5837 C 5.654 6.7737, 6.824 6.8744, 7.832 7.2537 C 9.3555 7.8272, 10.582 8.8983, 11.1387 10.1415 C 11.507 10.9641, 11.5 11.9099, 11.5 13.6111 L 11.5 14 L 0 14 Z';\n cornerEndStroke =\n 'M 0 6.5837 C 5.654 6.7737, 6.824 6.8744, 7.832 7.2537 C 9.3555 7.8272, 10.582 8.8983, 11.1387 10.1415 C 11.507 10.9641, 11.5 11.9099, 11.5 13.6111 L 11.5 14';\n }\n\n if (isHorizontal) {\n // Rotate vertical paths -90deg into a `capH`-wide column. Source coord\n // (x, y) maps to (y, cornerW - x) for corners and (y, midW - x) for mid.\n return html`\n <div class=\"cap cap-atmospheric cap-${side}\">\n <svg\n class=\"cap-corner cap-corner-start\"\n viewBox=\"0 0 ${capH} ${cornerW}\"\n preserveAspectRatio=\"xMidYMax meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${cornerW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${cornerStartFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerStartStroke}\" />\n </g>\n `}\n </svg>\n <svg\n class=\"cap-mid\"\n viewBox=\"0 0 ${capH} ${midW}\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${midW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${midFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" vector-effect=\"non-scaling-stroke\" d=\"${midStroke}\" />\n </g>\n `}\n </svg>\n <svg\n class=\"cap-corner cap-corner-end\"\n viewBox=\"0 0 ${capH} ${cornerW}\"\n preserveAspectRatio=\"xMidYMin meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${cornerW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${cornerEndFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerEndStroke}\" />\n </g>\n `}\n </svg>\n </div>\n `;\n }\n\n return html`\n <div class=\"cap cap-atmospheric cap-${side}\">\n <svg\n class=\"cap-corner cap-corner-start\"\n viewBox=\"0 0 ${cornerW} ${capH}\"\n preserveAspectRatio=\"xMaxYMid meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${cornerStartFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerStartStroke}\" />\n `}\n </svg>\n <svg\n class=\"cap-mid\"\n viewBox=\"0 0 ${midW} ${capH}\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${midFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" vector-effect=\"non-scaling-stroke\" d=\"${midStroke}\" />\n `}\n </svg>\n <svg\n class=\"cap-corner cap-corner-end\"\n viewBox=\"0 0 ${cornerW} ${capH}\"\n preserveAspectRatio=\"xMinYMid meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${cornerEndFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerEndStroke}\" />\n `}\n </svg>\n </div>\n `;\n }\n\n private renderCap(side: 'start' | 'end'): HTMLTemplateResult | null {\n if (this.type === TankType.generic) return null;\n if (this.type === TankType.battery && side === 'end') return null;\n if (this.type === TankType.atmospheric) {\n return this.renderAtmosphericCap(side);\n }\n if (this.type === TankType.pressurized) {\n return html`<div class=\"cap cap-pressurized cap-${side}\"></div>`;\n }\n // battery, start only\n return html`<div class=\"cap cap-battery cap-${side}\"></div>`;\n }\n\n override willUpdate(changed: PropertyValues) {\n super.willUpdate(changed);\n syncAdviceAlias(this, this.advice);\n }\n\n override render() {\n const safeMax = this.max > 0 ? this.max : 1;\n const percent = clamp((this.value / safeMax) * 100, 0, 100);\n const isCompact = this.isCompact;\n\n // Compact and static collapse their empty cells so the tank frame absorbs\n // the space; non-compact cells sit in the inner `.grid` and always reserve\n // their min-content rows (automation-components.md § Tank rendering).\n const controlBadge = this._badgeControlType();\n const alertBadge = this._badgeAlertType();\n const interlockBadge = this._badgeInterlockType();\n const commandLockedBadge = this._badgeCommandLockedType();\n const hasEnumBadges =\n controlBadge !== null ||\n alertBadge !== null ||\n interlockBadge !== null ||\n commandLockedBadge !== null;\n\n const badgesHidden = isCompact && !this._hasBadges && !hasEnumBadges;\n const tagHidden = isCompact && !this._hasTagSlot && !this.tag;\n\n const badgesCell = html`\n <div class=\"badges\" ?hidden=${badgesHidden}>\n <slot name=\"badges\" @slotchange=${this._onBadgesSlotChange}>\n ${\n controlBadge\n ? html`<obc-automation-badge\n .type=${controlBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n alertBadge\n ? html`<obc-automation-badge\n .type=${alertBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n interlockBadge\n ? html`<obc-automation-badge\n .type=${interlockBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n commandLockedBadge\n ? html`<obc-automation-badge\n .type=${commandLockedBadge}\n ></obc-automation-badge>`\n : nothing\n }\n </slot>\n </div>\n `;\n const tagCell = html`\n <div class=\"tag\" ?hidden=${tagHidden}>\n <slot name=\"tag\" @slotchange=${this._onTagSlotChange}>${this.tag}</slot>\n </div>\n `;\n // Static shows capacity rather than a percent: the state is unknown, so a\n // reading would be a claim the tank cannot make, and the trend icon goes\n // for the same reason (automation-components.md § Tank rendering).\n const readoutCell = this.static\n ? html`\n <div class=\"readout readout-compact readout-static\">\n <slot name=\"readout\">\n <slot name=\"max-value\">${this.max.toFixed(0)}</slot>\n <slot name=\"unit\">m<sup>3</sup></slot>\n </slot>\n </div>\n `\n : isCompact\n ? html`\n <div class=\"readout readout-compact\">\n <slot name=\"readout\">\n ${this.showTrendSymbol ? this.trendIcon() : null}\n <span class=\"percent\"\n >${percent.toFixed(0)}<span class=\"percent-symbol\"\n >%</span\n ></span\n >\n </slot>\n </div>\n `\n : html`\n <div class=\"readout\">\n <slot name=\"readout\">\n <div class=\"header\">\n ${this.showTrendSymbol ? this.trendIcon() : null}\n <div class=\"percent\">\n ${percent.toFixed(this.percentFractionDigits)}<span\n class=\"percent-symbol\"\n >%</span\n >\n </div>\n </div>\n <div class=\"value\">\n <div class=\"current\">\n <slot name=\"current-value\" class=\"current-value\"\n >${this.value.toFixed(0)}</slot\n ><span class=\"divider\">/</span>\n </div>\n <div class=\"max\">\n <slot class=\"max-value\" name=\"max-value\"\n >${this.max.toFixed(0)}</slot\n >\n <slot class=\"unit\" name=\"unit\">m<sup>3</sup></slot>\n </div>\n </div>\n <div class=\"rich-divider\" ?hidden=${!this._hasRichSlot}></div>\n <slot name=\"rich\" @slotchange=${this._onRichSlotChange}></slot>\n </slot>\n </div>\n `;\n // Two stacked icons form the silhouette `obc-automation-button` uses: the\n // back layer paints the inherited SVG `stroke` halo, the front layer the\n // fill through `color` (automation-components.md § Tank rendering).\n const graphIconClasses = classMap({\n 'graph-icon': true,\n 'priority-enhanced': this.priority === Priority.enhanced,\n });\n const graphIconOverlay =\n this.type === TankType.battery\n ? html`\n <div class=${graphIconClasses} aria-hidden=\"true\">\n <obi-energy-battery\n class=\"graph-icon-stroke\"\n ></obi-energy-battery>\n <obi-energy-battery class=\"graph-icon-fill\"></obi-energy-battery>\n </div>\n `\n : html`\n <div class=${graphIconClasses} aria-hidden=\"true\">\n <obi-tank class=\"graph-icon-stroke\"></obi-tank>\n <obi-tank class=\"graph-icon-fill\"></obi-tank>\n </div>\n `;\n // Alert-frame overlay. Mirrors the `obc-automation-button` pattern\n // exactly so consumer API is identical. Placed inside `.halo` so the\n // ring hugs only the bordered tank area; `belowHalo` (tag / readout) is\n // unaffected. `.halo` is `position: relative` (see CSS) to anchor the\n // absolutely-positioned alert-frame.\n const alertFrameOverlay = this.alert\n ? html`<obc-alert-frame\n class=\"alert-frame\"\n .type=${this.alertFrameType}\n .thickness=${this.alertFrameThickness}\n .status=${this.alertFrameStatus}\n .mode=${this.alertFrameMode}\n .showAlertCategoryIcon=${this.showAlertCategoryIcon}\n .showIcon=${this.showAlertIcon}\n >\n <span slot=\"icon\"><slot name=\"alert-icon\"></slot></span>\n <span slot=\"label\"><slot name=\"alert-label\"></slot></span>\n <span slot=\"timer\"><slot name=\"alert-timer\"></slot></span>\n </obc-alert-frame>`\n : null;\n let chartCell: HTMLTemplateResult;\n if (this._usesGaugeTrend) {\n // gauge-trend reads these as an aspect-ratio reference and derives its\n // own height from its wrapper. Rendering waits for both measurements —\n // a zero divides in that maths on first paint.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n chartCell = html`\n <div class=\"bar-container chart-cell\">\n ${\n hasSize\n ? html`<obc-gauge-trend\n .data=${this.chartData}\n .minValue=${0}\n .maxValue=${safeMax}\n .value=${this.value}\n .hasBar=${this.chartMode === TankChartMode.graphAndBar}\n .hasScale=${false}\n .hasLabelPadding=${false}\n .chartFill=${true}\n .hasAdvice=${this.hasAdvice}\n .advices=${this.advices}\n .adviceTrigger=${this.adviceTrigger}\n .adviceEmphasis=${this.adviceEmphasis}\n .width=${this._cellWidth}\n .height=${this._cellHeight}\n .setpoint=${this.setpoint}\n .newSetpoint=${this.newSetpoint}\n .touching=${this.touching}\n .atSetpoint=${this.atSetpoint}\n .autoAtSetpoint=${this.autoAtSetpoint}\n .autoAtSetpointDeadband=${this.autoAtSetpointDeadband}\n .setpointAtZeroDeadband=${this.setpointAtZeroDeadband}\n .setpointOverride=${this.setpointOverride}\n .animateSetpoint=${this.animateSetpoint}\n style=\"width: 100%; height: 100%;\"\n .priority=${this.priority}\n ></obc-gauge-trend>`\n : null\n }\n ${this.hasGraphIcon ? graphIconOverlay : null}\n </div>\n `;\n } else {\n // The shared SVG bar, the renderer gauge-trend uses for its side bar, so\n // advice overlays behave the same in all three chart modes; its fill\n // follows the instrument palette, not the tank's `medium` colour.\n // TODO(#1284): carry the medium colour through, and fold this branch\n // into gauge-trend once it offers a bar-only layout at this size.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n // The inner bar is always portrait and mirrors gauge-trend's\n // `fixedAspectRatio` sizing, so fixed-pixel SVG primitives keep one\n // on-screen size; `barThickness` and the cross-axis size are therefore\n // in viewBox units (automation-components.md § Tank rendering).\n const SCALE_REFERENCE_SIZE = 384;\n // The bar's viewBox cross-axis includes an outside-bar band for advice\n // pills, icons and/or the setpoint marker (see computeExternalScaleLayout).\n // Subtract the same band the bar will reserve so total viewBox width\n // still equals viewBoxCross and the meet-scale fills the cell exactly.\n const hasSetpointMarker =\n this.setpoint !== undefined ||\n this.newSetpoint !== undefined ||\n this.departingNewSetpoint !== undefined;\n const outsideBarReserveVb = computeOutsideBarThickness({\n hasBar: true,\n hasScale: false,\n labels: false,\n labelThickness: 0,\n tickThickness: 0,\n scaleType: ScaleType.regular,\n hasAdvice: this.hasAdvice,\n hasAdviceIcon:\n this.hasAdvice && !!this.advices?.some((a) => a.showIcon),\n advicePosition: AdvicePosition.inner,\n hasSetpoint: hasSetpointMarker,\n });\n const safeCellHeight = Math.max(1, this._cellHeight);\n const viewBoxCross =\n (this._cellWidth * SCALE_REFERENCE_SIZE) / safeCellHeight;\n const barThickness = Math.max(0, viewBoxCross - outsideBarReserveVb);\n // `tint` is locked in for tank bar mode: it draws a fill from 0 to\n // value plus a small marker at the value position, which mirrors the\n // legacy CSS bar's \"fill + top border at value\" visual idiom.\n const barWrapper = html`<obc-bar-vertical\n .minValue=${0}\n .maxValue=${safeMax}\n .value=${this.value}\n .height=${this._cellHeight}\n .fixedAspectRatio=${true}\n .scaleReferenceSize=${SCALE_REFERENCE_SIZE}\n .paddingTop=${0}\n .paddingBottom=${0}\n .side=${ExternalScaleSide.right}\n .hasBar=${true}\n .hasScale=${false}\n .showLabels=${false}\n .barThickness=${barThickness}\n .fillMode=${FillMode.tint}\n .instrumentMode=${true}\n .borderRadius=${2}\n .advices=${this.hasAdvice ? this.advices : []}\n .adviceTrigger=${this.adviceTrigger}\n .adviceEmphasis=${this.adviceEmphasis}\n .advicePosition=${AdvicePosition.inner}\n .setpoint=${this.setpoint}\n .newSetpoint=${this.newSetpoint}\n .touching=${this.touching}\n .atSetpoint=${this.atSetpoint}\n .autoAtSetpoint=${this.autoAtSetpoint}\n .autoAtSetpointDeadband=${this.autoAtSetpointDeadband}\n .setpointAtZeroDeadband=${this.setpointAtZeroDeadband}\n .setpointOverride=${this.setpointOverride}\n .animateSetpoint=${this.animateSetpoint}\n style=\"width: 100%; height: 100%;\"\n .priority=${this.priority}\n ></obc-bar-vertical>`;\n chartCell = html`\n <div class=\"bar-container bar-cell\">\n ${hasSize ? barWrapper : null}\n ${this.hasGraphIcon ? graphIconOverlay : null}\n </div>\n `;\n }\n\n const frameClasses = classMap({\n 'tank-frame': true,\n [`type-${this.type}`]: true,\n [`orientation-${this.orientation}`]: true,\n [this.medium]: true,\n compact: isCompact,\n static: this.static,\n });\n\n let middleContents: HTMLTemplateResult;\n if (this.static) {\n middleContents = html`<div class=\"static-readout\">${readoutCell}</div>`;\n } else if (this.compact) {\n middleContents = chartCell;\n } else {\n middleContents = html`<div class=\"grid\">\n ${tagCell}${badgesCell}${readoutCell}${chartCell}\n </div>`;\n }\n\n const tankFrame = html`\n <div class=${frameClasses}>\n ${this.renderCap('start')}\n <div class=\"middle\">${middleContents}</div>\n ${this.renderCap('end')}\n </div>\n `;\n\n // One interactive element: the flat mixin paints `.halo` through\n // `visibleWrapperClass` so the surround hugs the bordered area only, and\n // the alert-frame overlay is its last child so the ring covers every cell\n // (automation-components.md § Tank rendering).\n let haloContents: HTMLTemplateResult;\n if (this.static) {\n haloContents = html`${badgesCell}${tankFrame}${tagCell}`;\n } else if (this.compact) {\n haloContents = html`${badgesCell}${tankFrame}${readoutCell}${tagCell}`;\n } else {\n haloContents = tankFrame;\n }\n const halo = html`\n <div class=\"halo\">${haloContents}${alertFrameOverlay}</div>\n `;\n\n // Both classes sit on `.root` so the mixin paints `.halo`: `activated`\n // like its hover and pressed states, `clickable` choosing between the\n // six-state variant and the resting-only `noClick` one\n // (automation-components.md § Tank rendering).\n const isClickable = this.clickable && !this.static;\n const rootClasses = classMap({\n root: true,\n activated: this.activated,\n clickable: isClickable,\n });\n\n // The live region stays on all three root shapes, so an `alert` label is\n // announced whatever the interactivity (automation-components.md § Tank\n // rendering).\n // TODO(a11y): the rest of the automation family lacks the live region;\n // consolidate when alert support moves into a shared mixin.\n if (this.static) {\n return html`<div\n class=${rootClasses}\n role=\"img\"\n aria-label=${this.tag || 'Tank'}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`;\n }\n if (!isClickable) {\n return html`<div\n class=${rootClasses}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`;\n }\n return html`<button\n class=${rootClasses}\n type=\"button\"\n aria-label=${this.tag || 'Tank'}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </button>`;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-automation-tank': ObcAutomationTank;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,IAAY,YAAL,yBAAA,WAAA;CACL,UAAA,gBAAA;CACA,UAAA,YAAA;CACA,UAAA,YAAA;CACA,UAAA,aAAA;CACA,UAAA,iBAAA;CACA,UAAA,YAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,WAAL,yBAAA,UAAA;CACL,SAAA,aAAA;CACA,SAAA,iBAAA;CACA,SAAA,iBAAA;CACA,SAAA,aAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,kBAAL,yBAAA,iBAAA;CACL,gBAAA,cAAA;CACA,gBAAA,gBAAA;;AACF,EAAA,CAAA,CAAA;AAI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AAA,gBAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,kBAAA,WAAA,cAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,kBAAA,WAAA,kBAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,kBAAA,WAAA,sBAAA,KAAA,CAAA;AAIvBA,WAAA,CAAA,MAAM,CAAA,GAAA,kBAAA,WAAA,cAAA,KAAA,CAAA;AACNA,WAAA,CAAA,MAAM,CAAA,GAAA,kBAAA,WAAA,eAAA,KAAA,CAAA;AAQNA,WAAA,CAAA,MAAM,CAAA,GAAA,kBAAA,WAAA,cAAA,KAAA,CAAA;AACNA,WAAA,CAAA,MAAM,CAAA,GAAA,kBAAA,WAAA,eAAA,KAAA,CAAA;AAONA,WAAA,CAAA,MAAM,CAAA,GAAA,kBAAA,WAAA,gBAAA,KAAA,CAAA;AA3ER,oBAAAA,WAAA,CAAA,cAAc,qBAAqB,CAAA,GAAA,iBAAA"}
|
|
@@ -49,10 +49,10 @@ export declare enum DigitalThreewayValveVariant {
|
|
|
49
49
|
* @property orientation - Side the stem points to.
|
|
50
50
|
* @property flows - Readout rows, one per flow: an optional arrow direction with either a value and optional unit (default `%`) or `open` for an `Open`/`Closed` state.
|
|
51
51
|
* @property variant - Visual style of the button surround.
|
|
52
|
-
* @slot badge-top-right - Content projected into the top-right badge position; overrides `
|
|
53
|
-
* @slot badge-top-left - Content projected into the top-left badge position; overrides `
|
|
54
|
-
* @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides `
|
|
55
|
-
* @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides `
|
|
52
|
+
* @slot badge-top-right - Content projected into the top-right badge position; overrides the badge `badgeLayout` puts in that corner.
|
|
53
|
+
* @slot badge-top-left - Content projected into the top-left badge position; overrides the badge `badgeLayout` puts in that corner.
|
|
54
|
+
* @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides the badge `badgeLayout` puts in that corner.
|
|
55
|
+
* @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides the badge `badgeLayout` puts in that corner.
|
|
56
56
|
* @fires click - Fired when the valve is clicked.
|
|
57
57
|
* @experimental
|
|
58
58
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"digital-threeway-valve.js","names":["_decorate"],"sources":["../../../src/automation/digital-threeway-valve/digital-threeway-valve.ts"],"sourcesContent":["import {html} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport '../../icons/icon-threeway-digital-open.js';\nimport '../../icons/icon-threeway-digital-closed.js';\nimport '../../icons/icon-threeway-digital-closed-left.js';\nimport '../../icons/icon-threeway-digital-closed-bottom.js';\nimport '../../icons/icon-threeway-digital-closed-right.js';\nimport {customElement} from '../../decorator.js';\nimport {ObcAbstractAutomationButton} from '../automation-button/abstract-automation-button.js';\nimport {AutomationButtonReadoutPosition} from '../automation-button/automation-button.js';\nimport {AutomationButtonReadoutStack} from '../../components/automation-button-readout-stack/automation-button-readout-stack.js';\nimport {\n ThreewayValveFlow,\n ThreewayValveOrientation,\n threewayValveOpenSide,\n threewayValveReadouts,\n threewayValveRotation,\n} from '../threeway-valve-shared/threeway-valve-shared.js';\n\nexport enum DigitalThreewayValveVariant {\n regular = 'regular',\n flat = 'flat',\n}\n\n/**\n * `<obc-digital-threeway-valve>` – three-way on/off valve for process\n * diagrams, with one open/closed state per port.\n *\n * ## Features\n *\n * - **Three ports:** `open1`, `open2` and `open3` open or close each port.\n * Ports are numbered from the side without a port: with `orientation`\n * `bottom`, port 1 is left, port 2 is the stem at the bottom and port 3 is\n * right. The numbering turns with the symbol.\n * - **Orientation:** `bottom` and `top` lay the valve on a horizontal pipe,\n * `left` and `right` on a vertical one; the value names the side the stem\n * points to.\n * - **Flow readout:** `flows` lists one readout row per flow, each with an\n * optional arrow direction and either a value with a unit (`%` when left out)\n * or a state, `{open}`, shown as `Open` or `Closed` after the arrow, or\n * after the on/off icon when there is no direction. Without flows the\n * readout shows `Open` or `Closed`.\n * - Badges, alert frame, progress and readout placement come from the shared\n * automation button base.\n *\n * ## Usage Guidelines\n *\n * Use where a valve directs flow between three pipes and each port is either\n * open or closed. With one port closed the symbol shows that port plugged;\n * with fewer than two ports open no flow can pass, and the valve shows as\n * closed. For a valve that opens its ports continuously use\n * `obc-analog-threeway-valve`; for a two-port valve use `obc-digital-valve`.\n *\n * TODO(designer): no icon shows a single open port, so that case uses the\n * closed symbol.\n *\n * @property open1 - Opens port 1.\n * @property open2 - Opens port 2, the stem.\n * @property open3 - Opens port 3.\n * @property orientation - Side the stem points to.\n * @property flows - Readout rows, one per flow: an optional arrow direction with either a value and optional unit (default `%`) or `open` for an `Open`/`Closed` state.\n * @property variant - Visual style of the button surround.\n * @slot badge-top-right - Content projected into the top-right badge position; overrides `
|
|
1
|
+
{"version":3,"file":"digital-threeway-valve.js","names":["_decorate"],"sources":["../../../src/automation/digital-threeway-valve/digital-threeway-valve.ts"],"sourcesContent":["import {html} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport '../../icons/icon-threeway-digital-open.js';\nimport '../../icons/icon-threeway-digital-closed.js';\nimport '../../icons/icon-threeway-digital-closed-left.js';\nimport '../../icons/icon-threeway-digital-closed-bottom.js';\nimport '../../icons/icon-threeway-digital-closed-right.js';\nimport {customElement} from '../../decorator.js';\nimport {ObcAbstractAutomationButton} from '../automation-button/abstract-automation-button.js';\nimport {AutomationButtonReadoutPosition} from '../automation-button/automation-button.js';\nimport {AutomationButtonReadoutStack} from '../../components/automation-button-readout-stack/automation-button-readout-stack.js';\nimport {\n ThreewayValveFlow,\n ThreewayValveOrientation,\n threewayValveOpenSide,\n threewayValveReadouts,\n threewayValveRotation,\n} from '../threeway-valve-shared/threeway-valve-shared.js';\n\nexport enum DigitalThreewayValveVariant {\n regular = 'regular',\n flat = 'flat',\n}\n\n/**\n * `<obc-digital-threeway-valve>` – three-way on/off valve for process\n * diagrams, with one open/closed state per port.\n *\n * ## Features\n *\n * - **Three ports:** `open1`, `open2` and `open3` open or close each port.\n * Ports are numbered from the side without a port: with `orientation`\n * `bottom`, port 1 is left, port 2 is the stem at the bottom and port 3 is\n * right. The numbering turns with the symbol.\n * - **Orientation:** `bottom` and `top` lay the valve on a horizontal pipe,\n * `left` and `right` on a vertical one; the value names the side the stem\n * points to.\n * - **Flow readout:** `flows` lists one readout row per flow, each with an\n * optional arrow direction and either a value with a unit (`%` when left out)\n * or a state, `{open}`, shown as `Open` or `Closed` after the arrow, or\n * after the on/off icon when there is no direction. Without flows the\n * readout shows `Open` or `Closed`.\n * - Badges, alert frame, progress and readout placement come from the shared\n * automation button base.\n *\n * ## Usage Guidelines\n *\n * Use where a valve directs flow between three pipes and each port is either\n * open or closed. With one port closed the symbol shows that port plugged;\n * with fewer than two ports open no flow can pass, and the valve shows as\n * closed. For a valve that opens its ports continuously use\n * `obc-analog-threeway-valve`; for a two-port valve use `obc-digital-valve`.\n *\n * TODO(designer): no icon shows a single open port, so that case uses the\n * closed symbol.\n *\n * @property open1 - Opens port 1.\n * @property open2 - Opens port 2, the stem.\n * @property open3 - Opens port 3.\n * @property orientation - Side the stem points to.\n * @property flows - Readout rows, one per flow: an optional arrow direction with either a value and optional unit (default `%`) or `open` for an `Open`/`Closed` state.\n * @property variant - Visual style of the button surround.\n * @slot badge-top-right - Content projected into the top-right badge position; overrides the badge `badgeLayout` puts in that corner.\n * @slot badge-top-left - Content projected into the top-left badge position; overrides the badge `badgeLayout` puts in that corner.\n * @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides the badge `badgeLayout` puts in that corner.\n * @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides the badge `badgeLayout` puts in that corner.\n * @fires click - Fired when the valve is clicked.\n * @experimental\n */\n@customElement('obc-digital-threeway-valve')\nexport class ObcDigitalThreewayValve extends ObcAbstractAutomationButton {\n @property({type: Boolean}) open1: boolean = false;\n @property({type: Boolean}) open2: boolean = false;\n @property({type: Boolean}) open3: boolean = false;\n @property({type: String}) orientation: ThreewayValveOrientation =\n ThreewayValveOrientation.bottom;\n @property({type: Array, attribute: false}) flows: ThreewayValveFlow[] = [];\n @property({type: String}) variant: DigitalThreewayValveVariant =\n DigitalThreewayValveVariant.regular;\n\n private get ports(): boolean[] {\n return [this.open1, this.open2, this.open3];\n }\n\n override get _on(): boolean {\n return this.ports.filter(Boolean).length >= 2;\n }\n\n override get _readoutPosition(): AutomationButtonReadoutPosition {\n return this.readoutPosition ?? threewayValveOpenSide(this.orientation);\n }\n\n override get extraReadouts(): AutomationButtonReadoutStack[] {\n if (!this.showStatus) {\n return [];\n }\n return threewayValveReadouts(this._on, this.flows, this.showStatusIcon);\n }\n\n private renderIcon(slot: string) {\n const style = `display: block; transform: rotate(${threewayValveRotation(\n this.orientation\n )}deg); line-height: 0;`;\n const ports = this.ports;\n if (!this._on) {\n return html`<obi-threeway-digital-closed\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed>`;\n }\n switch (ports.indexOf(false)) {\n case 0:\n return html`<obi-threeway-digital-closed-left\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed-left>`;\n case 1:\n return html`<obi-threeway-digital-closed-bottom\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed-bottom>`;\n case 2:\n return html`<obi-threeway-digital-closed-right\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed-right>`;\n default:\n return html`<obi-threeway-digital-open\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-open>`;\n }\n }\n\n override get icon() {\n return html`${this.renderIcon('icon')}${this.renderIcon('icon-silhouette')}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-digital-threeway-valve': ObcDigitalThreewayValve;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAmBA,IAAY,8BAAL,yBAAA,6BAAA;CACL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,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,wBAAA,WAAA,SAAA,KAAA,CAAA;AACxBA,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,wBAAA,WAAA,SAAA,KAAA,CAAA;AACxBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,wBAAA,WAAA,eAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS;CAAC,MAAM;CAAO,WAAW;AAAK,CAAC,CAAA,GAAA,wBAAA,WAAA,SAAA,KAAA,CAAA;AACxCA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,wBAAA,WAAA,WAAA,KAAA,CAAA;AARzB,0BAAAA,WAAA,CAAA,cAAc,4BAA4B,CAAA,GAAA,uBAAA"}
|
|
@@ -19,10 +19,10 @@ import '../../icons/icon-electricity-battery-off.js';
|
|
|
19
19
|
* Without a visible tag the button is named `Battery`, followed by the state
|
|
20
20
|
* (`Battery On`) when the state row is shown.
|
|
21
21
|
*
|
|
22
|
-
* @slot badge-top-right - Content projected into the top-right badge position; overrides `
|
|
23
|
-
* @slot badge-top-left - Content projected into the top-left badge position; overrides `
|
|
24
|
-
* @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides `
|
|
25
|
-
* @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides `
|
|
22
|
+
* @slot badge-top-right - Content projected into the top-right badge position; overrides the badge `badgeLayout` puts in that corner.
|
|
23
|
+
* @slot badge-top-left - Content projected into the top-left badge position; overrides the badge `badgeLayout` puts in that corner.
|
|
24
|
+
* @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides the badge `badgeLayout` puts in that corner.
|
|
25
|
+
* @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides the badge `badgeLayout` puts in that corner.
|
|
26
26
|
* @fires click - Fired when the battery is clicked.
|
|
27
27
|
* @experimental
|
|
28
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"electricity-battery.js","names":["_decorate"],"sources":["../../../src/automation/electricity-battery/electricity-battery.ts"],"sourcesContent":["import '../../icons/icon-electricity-battery-on.js';\nimport '../../icons/icon-electricity-battery-off.js';\nimport {customElement} from '../../decorator.js';\nimport {ObcAbstractAutomationButtonSquared} from '../automation-button/abstract-automation-button-squared.js';\n\n/**\n * `<obc-electricity-battery>` – Battery symbol for electrical automation diagrams.\n *\n * Shows the battery as an on/off device with the readout stack, badges and\n * alert frame of the other two-state devices.\n *\n * ## Usage Guidelines\n *\n * Use it to place a battery on an electrical one-line diagram. For a battery's\n * charge level, use `obc-indicator-battery`; for a battery tank with a fill\n * level, use `obc-automation-tank`.\n *\n * **TODO(designer):** the icons file has no static battery symbol, so a\n * `static` battery keeps its on or off icon.\n *\n * Without a visible tag the button is named `Battery`, followed by the state\n * (`Battery On`) when the state row is shown.\n *\n * @slot badge-top-right - Content projected into the top-right badge position; overrides `
|
|
1
|
+
{"version":3,"file":"electricity-battery.js","names":["_decorate"],"sources":["../../../src/automation/electricity-battery/electricity-battery.ts"],"sourcesContent":["import '../../icons/icon-electricity-battery-on.js';\nimport '../../icons/icon-electricity-battery-off.js';\nimport {customElement} from '../../decorator.js';\nimport {ObcAbstractAutomationButtonSquared} from '../automation-button/abstract-automation-button-squared.js';\n\n/**\n * `<obc-electricity-battery>` – Battery symbol for electrical automation diagrams.\n *\n * Shows the battery as an on/off device with the readout stack, badges and\n * alert frame of the other two-state devices.\n *\n * ## Usage Guidelines\n *\n * Use it to place a battery on an electrical one-line diagram. For a battery's\n * charge level, use `obc-indicator-battery`; for a battery tank with a fill\n * level, use `obc-automation-tank`.\n *\n * **TODO(designer):** the icons file has no static battery symbol, so a\n * `static` battery keeps its on or off icon.\n *\n * Without a visible tag the button is named `Battery`, followed by the state\n * (`Battery On`) when the state row is shown.\n *\n * @slot badge-top-right - Content projected into the top-right badge position; overrides the badge `badgeLayout` puts in that corner.\n * @slot badge-top-left - Content projected into the top-left badge position; overrides the badge `badgeLayout` puts in that corner.\n * @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides the badge `badgeLayout` puts in that corner.\n * @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides the badge `badgeLayout` puts in that corner.\n * @fires click - Fired when the battery is clicked.\n * @experimental\n */\n@customElement('obc-electricity-battery')\nexport class ObcElectricityBattery extends ObcAbstractAutomationButtonSquared {\n override get _accessibleName(): string | null {\n if (!this.showReadoutStack) return 'Battery';\n if (this.tag) return null;\n return this.showStatus\n ? `Battery ${this.turnedOn ? 'On' : 'Off'}`\n : 'Battery';\n }\n\n override get icon() {\n return this.renderDeviceIcon({\n on: 'electricity-battery-on',\n off: 'electricity-battery-off',\n });\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-electricity-battery': ObcElectricityBattery;\n }\n}\n"],"mappings":";;;;;;AA+BO,IAAM,wBAAN,MAAM,8BAA8B,mCAAmC;CAC5E,IAAa,kBAAiC;EAC5C,IAAI,CAAC,KAAK,kBAAkB,OAAO;EACnC,IAAI,KAAK,KAAK,OAAO;EACrB,OAAO,KAAK,aACR,WAAW,KAAK,WAAW,OAAO,UAClC;CACN;CAEA,IAAa,OAAO;EAClB,OAAO,KAAK,iBAAiB;GAC3B,IAAI;GACJ,KAAK;EACP,CAAC;CACH;AACF;AAhBC,wBAAAA,WAAA,CAAA,cAAc,yBAAyB,CAAA,GAAA,qBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-specialty-tank.d.ts","sourceRoot":"","sources":["../../../src/automation/specialty-tank/abstract-specialty-tank.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAgC,MAAM,KAAK,CAAC;AAC9D,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,KAAK,CAAC;AAIxD,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EACL,0BAA0B,EAC1B,kCAAkC,EAClC,4BAA4B,EAC5B,8BAA8B,EAC/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iB,CAC3B;IACa,qBAAqB,EAAE,OAAO,CACpE;IACoB,aAAa,EAAE,OAAO,CAAS;IAEjD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAS;IAErC,SAAS,KAAK,aAAa,IAAI,cAAc,CAE5C;IAED,yDAAyD;IACzD,SAAS,KAAK,aAAa,IAAI,MAAM,CAEpC;IAED,SAAS,KAAK,KAAK,IAAI,kBAAkB,CAExC;IAED,SAAS,KAAK,SAAS,IAAI,sBAAsB,CAEhD;IAED,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,eAAe;
|
|
1
|
+
{"version":3,"file":"abstract-specialty-tank.d.ts","sourceRoot":"","sources":["../../../src/automation/specialty-tank/abstract-specialty-tank.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAgC,MAAM,KAAK,CAAC;AAC9D,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,KAAK,CAAC;AAIxD,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EACL,0BAA0B,EAC1B,kCAAkC,EAClC,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,oDAAoD,CAAC;AAC5D,OAAO,6CAA6C,CAAC;AACrD,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAC,eAAe,EAAC,MAAM,wCAAwC,CAAC;AAEvE;;;GAGG;AACH,oBAAY,mBAAmB;IAC7B,+BAA+B;IAC/B,OAAO,YAAY;IACnB,0CAA0C;IAC1C,OAAO,YAAY;IACnB,2DAA2D;IAC3D,MAAM,WAAW;CAClB;AAED;;;GAGG;AACH,oBAAY,sBAAsB;IAChC,sCAAsC;IACtC,QAAQ,aAAa;IACrB,sCAAsC;IACtC,UAAU,eAAe;IACzB,0EAA0E;IAC1E,QAAQ,aAAa;CACtB;AAED;;GAE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AC,aAAa;IAerB;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;IAwBlB,MAAM;IAmJf,OAAgB,MAAM,EAAE,cAAc,CAA6B;CACpE"}
|
|
@@ -142,6 +142,7 @@ var ObcAbstractSpecialtyTank = class extends LitElement {
|
|
|
142
142
|
_badgeAlertType() {
|
|
143
143
|
switch (this.badgeAlert) {
|
|
144
144
|
case AutomationButtonBadgeAlert.Silence: return ObcAutomationBadgeType.AlertSilenced;
|
|
145
|
+
case AutomationButtonBadgeAlert.Shelved: return ObcAutomationBadgeType.AlertShelved;
|
|
145
146
|
case AutomationButtonBadgeAlert.Caution: return ObcAutomationBadgeType.Caution;
|
|
146
147
|
case AutomationButtonBadgeAlert.Warning: return ObcAutomationBadgeType.Warning;
|
|
147
148
|
case AutomationButtonBadgeAlert.Alarm: return ObcAutomationBadgeType.Alarm;
|
|
@@ -157,12 +158,16 @@ var ObcAbstractSpecialtyTank = class extends LitElement {
|
|
|
157
158
|
switch (this.badgeInterlock) {
|
|
158
159
|
case AutomationButtonBadgeInterlock.Interlock: return ObcAutomationBadgeType.Interlock;
|
|
159
160
|
case AutomationButtonBadgeInterlock.InterlockInhibit: return ObcAutomationBadgeType.InterlockInhibit;
|
|
161
|
+
case AutomationButtonBadgeInterlock.Simulation: return ObcAutomationBadgeType.Simulation;
|
|
160
162
|
default: return null;
|
|
161
163
|
}
|
|
162
164
|
}
|
|
163
165
|
_badgeCommandLockedType() {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
+
switch (this.badgeCommandLocked) {
|
|
167
|
+
case AutomationButtonBadgeCommandLocked.CommandLocked: return ObcAutomationBadgeType.CommandLocked;
|
|
168
|
+
case AutomationButtonBadgeCommandLocked.Simulation: return ObcAutomationBadgeType.Simulation;
|
|
169
|
+
default: return null;
|
|
170
|
+
}
|
|
166
171
|
}
|
|
167
172
|
_slotHasContent(e) {
|
|
168
173
|
return e.target.assignedNodes({ flatten: true }).some((n) => n.nodeType === Node.ELEMENT_NODE || n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-specialty-tank.js","names":["componentStyle","_decorate"],"sources":["../../../src/automation/specialty-tank/abstract-specialty-tank.ts"],"sourcesContent":["import {LitElement, html, nothing, svg, unsafeCSS} from 'lit';\nimport type {CSSResultGroup, TemplateResult} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport componentStyle from './specialty-tank.css?inline';\nimport '../automation-badge/automation-badge.js';\nimport {ObcAutomationBadgeType} from '../automation-badge/automation-badge.js';\nimport {\n AutomationButtonBadgeAlert,\n AutomationButtonBadgeCommandLocked,\n AutomationButtonBadgeControl,\n AutomationButtonBadgeInterlock,\n} from '../automation-button/abstract-automation-button.js';\nimport '../../components/alert-frame/alert-frame.js';\nimport {\n ObcAlertFrameMode,\n ObcAlertFrameThickness,\n ObcAlertFrameType,\n} from '../../components/alert-frame/alert-frame.js';\nimport {AlertType} from '../../types.js';\nimport {TankPositioning} from '../automation-tank/tank-positioning.js';\n\n/**\n * What the graphic area of a specialty tank shows. Mirrors the Figma\n * `has Medium` property; its fourth value, Static, is the `static` property.\n */\nexport enum SpecialtyTankMedium {\n /** One grey area, no split. */\n regular = 'regular',\n /** Two grey halves separated by a gap. */\n graphic = 'graphic',\n /** Hot (red) and cold (blue) halves separated by a gap. */\n medium = 'medium',\n}\n\n/**\n * Hot/cold split geometry of a specialty tank. Drives the halves and the\n * gap between them through the `split-<mode>` class on the tank frame.\n */\nexport enum SpecialtyTankSplitMode {\n /** Left half hot, right half cold. */\n vertical = 'vertical',\n /** Top half hot, bottom half cold. */\n horizontal = 'horizontal',\n /** Two corner-to-corner triangles, top-left hot and bottom-right cold. */\n diagonal = 'diagonal',\n}\n\n/**\n * Frame silhouette of a specialty tank.\n */\nexport enum SpecialtyTankFrame {\n /** One rounded border box. */\n rounded = 'rounded',\n /** Pressurized-tank silhouette: domed caps on a side-bordered body. */\n pressurized = 'pressurized',\n}\n\n/**\n * Base class for the specialty-tank tiles `obc-heat-pump`,\n * `obc-hydraulic-separator` and `obc-heat-exchanger`. Owns the halo, badge\n * row, tank frame with its hot/cold graphic area and equipment icon, tag\n * readout and alert-frame overlay. Subclasses supply `equipmentIcon`,\n * `equipmentName`, `frame` and `splitMode`, plus their own host footprint.\n *\n * ## Layout\n * The same shell as a compact `obc-automation-tank`: a fixed host (or\n * `positioning=\"button\"` to fill the parent), a 4px-padded halo holding\n * badges, the tank frame and the tag, the frame absorbing the space of\n * empty badge and tag cells. Hover, pressed, focus-visible and `activated`\n * are painted on the halo by the flat style mixin; `clickable` and `static`\n * switch the root between a `<button>`, a plain `<div>` and a\n * `<div role=\"img\">` exactly as the tank does.\n *\n * Not declared `abstract`: the wrapper generators wrap every `LitElement`\n * subclass and pass its constructor as a concrete `Constructor<T>`, so the\n * override points throw instead (same as `ObcAbstractAutomationButton`).\n *\n * @property medium - What the graphic area shows: `regular` (one grey area), `graphic` (two grey halves) or `medium` (hot/cold halves).\n * @property static - Display-only tile with a flat grey frame and a bare icon, rendered as a non-interactive `<div role=\"img\">`. Hides the graphic area.\n * @property showIcon - Show the equipment icon centered on the graphic area.\n * @property tag - Identifier rendered in the tag readout below the frame (for example `#0000`); also the accessible name. The cell collapses when empty.\n * @property positioning - Host positioning model — see `TankPositioning`. `button` (default) fills the parent, `point` uses the fixed design footprint with the P&ID anchor.\n * @property clickable - Whether the tile is interactive. `false` keeps the resting appearance but drops hover, pressed and focus states and leaves the tab order; property-only because the default is `true`.\n * @property activated - Paints the activated background on the halo. Needs an interactive tile.\n * @availableWhen activated clickable==true\n * @property badgeControl - Mode badge (auto / manual / local variants), first in the badge row.\n * @property badgeAlert - Alert badge, second in the badge row.\n * @property badgeInterlock - Interlock badge, third in the badge row.\n * @property badgeCommandLocked - Command-locked badge, last in the badge row.\n * @property alert - Show an alert-frame overlay around the halo, mirroring `obc-automation-tank`.\n * @property alertFrameType - Shape of the alert frame.\n * @availableWhen alertFrameType alert==true\n * @property alertFrameThickness - Thickness of the alert frame.\n * @availableWhen alertFrameThickness alert==true\n * @property alertFrameStatus - Alert status the frame is coloured for.\n * @availableWhen alertFrameStatus alert==true\n * @property alertFrameMode - Acknowledgement state of the alert: `acked-active` (default) is steady,\n * `unacked-active` flashes, `unacked-rectified` flashes a dashed frame.\n * @availableWhen alertFrameMode alert==true\n * @property showAlertCategoryIcon - Shows the alert category icon inside the frame.\n * @availableWhen showAlertCategoryIcon alert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]\n * @property showAlertIcon - Shows the slotted alert icon inside the frame.\n * @availableWhen showAlertIcon alert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]\n */\nexport class ObcAbstractSpecialtyTank extends LitElement {\n @property({type: String}) medium: SpecialtyTankMedium =\n SpecialtyTankMedium.regular;\n @property({type: Boolean, reflect: true}) static: boolean = false;\n @property({type: Boolean, attribute: false}) showIcon: boolean = true;\n @property({type: String}) tag: string = '';\n @property({type: String, reflect: true}) positioning: TankPositioning =\n TankPositioning.button;\n @property({type: Boolean, attribute: false}) clickable: boolean = true;\n @property({type: Boolean}) activated: boolean = false;\n\n @property({type: String}) badgeControl: AutomationButtonBadgeControl =\n AutomationButtonBadgeControl.None;\n @property({type: String}) badgeAlert: AutomationButtonBadgeAlert =\n AutomationButtonBadgeAlert.None;\n @property({type: String}) badgeInterlock: AutomationButtonBadgeInterlock =\n AutomationButtonBadgeInterlock.None;\n @property({type: String})\n badgeCommandLocked: AutomationButtonBadgeCommandLocked =\n AutomationButtonBadgeCommandLocked.None;\n\n @property({type: Boolean}) alert: boolean = false;\n @property({type: String}) alertFrameType: ObcAlertFrameType =\n ObcAlertFrameType.SmallSideFlip;\n @property({type: String}) alertFrameThickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n @property({type: String}) alertFrameStatus: AlertType = AlertType.Alarm;\n @property({type: String}) alertFrameMode: ObcAlertFrameMode =\n ObcAlertFrameMode.ackedActive;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n @property({type: Boolean}) showAlertIcon: boolean = false;\n\n @state() private _hasBadges = false;\n @state() private _hasTagSlot = false;\n\n protected get equipmentIcon(): TemplateResult {\n throw new Error('\"equipmentIcon\" must be implemented in the subclass');\n }\n\n /** Accessible-name fallback used when `tag` is empty. */\n protected get equipmentName(): string {\n throw new Error('\"equipmentName\" must be implemented in the subclass');\n }\n\n protected get frame(): SpecialtyTankFrame {\n throw new Error('\"frame\" must be implemented in the subclass');\n }\n\n protected get splitMode(): SpecialtyTankSplitMode {\n throw new Error('\"splitMode\" must be implemented in the subclass');\n }\n\n private _badgeControlType(): ObcAutomationBadgeType | null {\n switch (this.badgeControl) {\n case AutomationButtonBadgeControl.Local:\n return ObcAutomationBadgeType.Local;\n case AutomationButtonBadgeControl.LocalOnly:\n return ObcAutomationBadgeType.LocalOnly;\n case AutomationButtonBadgeControl.Manual:\n return ObcAutomationBadgeType.Manual;\n case AutomationButtonBadgeControl.ManualOnly:\n return ObcAutomationBadgeType.ManualOnly;\n case AutomationButtonBadgeControl.Auto:\n return ObcAutomationBadgeType.Auto;\n default:\n return null;\n }\n }\n\n private _badgeAlertType(): ObcAutomationBadgeType | null {\n switch (this.badgeAlert) {\n case AutomationButtonBadgeAlert.Silence:\n return ObcAutomationBadgeType.AlertSilenced;\n case AutomationButtonBadgeAlert.Caution:\n return ObcAutomationBadgeType.Caution;\n case AutomationButtonBadgeAlert.Warning:\n return ObcAutomationBadgeType.Warning;\n case AutomationButtonBadgeAlert.Alarm:\n return ObcAutomationBadgeType.Alarm;\n case AutomationButtonBadgeAlert.LevelCritical:\n return ObcAutomationBadgeType.LevelCritical;\n case AutomationButtonBadgeAlert.LevelHigh:\n return ObcAutomationBadgeType.LevelHigh;\n case AutomationButtonBadgeAlert.LevelMedium:\n return ObcAutomationBadgeType.LevelMedium;\n case AutomationButtonBadgeAlert.LevelLow:\n return ObcAutomationBadgeType.LevelLow;\n case AutomationButtonBadgeAlert.LevelDiagnostic:\n return ObcAutomationBadgeType.LevelDiagnostic;\n default:\n return null;\n }\n }\n\n private _badgeInterlockType(): ObcAutomationBadgeType | null {\n switch (this.badgeInterlock) {\n case AutomationButtonBadgeInterlock.Interlock:\n return ObcAutomationBadgeType.Interlock;\n case AutomationButtonBadgeInterlock.InterlockInhibit:\n return ObcAutomationBadgeType.InterlockInhibit;\n default:\n return null;\n }\n }\n\n private _badgeCommandLockedType(): ObcAutomationBadgeType | null {\n if (\n this.badgeCommandLocked ===\n AutomationButtonBadgeCommandLocked.CommandLocked\n ) {\n return ObcAutomationBadgeType.CommandLocked;\n }\n return null;\n }\n\n private _slotHasContent(e: Event): boolean {\n const slot = e.target as HTMLSlotElement;\n return slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n private _onBadgesSlotChange(e: Event): void {\n this._hasBadges = this._slotHasContent(e);\n }\n\n private _onTagSlotChange(e: Event): void {\n this._hasTagSlot = this._slotHasContent(e);\n }\n\n private renderGraphic(): TemplateResult {\n if (this.medium === SpecialtyTankMedium.regular) {\n return html`<div class=\"area area-single\"></div>`;\n }\n if (this.splitMode === SpecialtyTankSplitMode.diagonal) {\n return this.renderDiagonalSplit();\n }\n return html`\n <div class=\"halves\">\n <div class=\"area area-hot\"></div>\n <div class=\"area area-cold\"></div>\n </div>\n `;\n }\n\n /**\n * Diagonal split in a unit viewBox stretched over the area\n * (`preserveAspectRatio=\"none\"`); every stroke is `non-scaling` so the\n * borders and the gap keep their pixel widths at any aspect ratio. The\n * gap edges are drawn as one wide line per half, clipped to that half,\n * under the narrower frame-coloured gap line.\n */\n private renderDiagonalSplit(): TemplateResult {\n const hot = '0,0 1,0 0,1';\n const cold = '1,0 1,1 0,1';\n return html`\n <div class=\"diagonal\">\n <svg viewBox=\"0 0 1 1\" preserveAspectRatio=\"none\" aria-hidden=\"true\">\n ${svg`\n <defs>\n <clipPath id=\"clip-hot\"><polygon points=${hot} /></clipPath>\n <clipPath id=\"clip-cold\"><polygon points=${cold} /></clipPath>\n </defs>\n <polygon class=\"area-fill area-hot\" points=${hot} />\n <polygon class=\"area-fill area-cold\" points=${cold} />\n <polygon class=\"area-stroke area-hot\" points=${hot} clip-path=\"url(#clip-hot)\" vector-effect=\"non-scaling-stroke\" />\n <polygon class=\"area-stroke area-cold\" points=${cold} clip-path=\"url(#clip-cold)\" vector-effect=\"non-scaling-stroke\" />\n <line class=\"gap-edge area-hot\" x1=\"1\" y1=\"0\" x2=\"0\" y2=\"1\" clip-path=\"url(#clip-hot)\" vector-effect=\"non-scaling-stroke\" />\n <line class=\"gap-edge area-cold\" x1=\"1\" y1=\"0\" x2=\"0\" y2=\"1\" clip-path=\"url(#clip-cold)\" vector-effect=\"non-scaling-stroke\" />\n <line class=\"gap\" x1=\"1\" y1=\"0\" x2=\"0\" y2=\"1\" vector-effect=\"non-scaling-stroke\" />\n `}\n </svg>\n </div>\n `;\n }\n\n override render() {\n const controlBadge = this._badgeControlType();\n const alertBadge = this._badgeAlertType();\n const interlockBadge = this._badgeInterlockType();\n const commandLockedBadge = this._badgeCommandLockedType();\n const hasEnumBadges =\n controlBadge !== null ||\n alertBadge !== null ||\n interlockBadge !== null ||\n commandLockedBadge !== null;\n\n const badgesHidden = !this._hasBadges && !hasEnumBadges;\n const tagHidden = !this._hasTagSlot && !this.tag;\n\n const badgesCell = html`\n <div class=\"badges\" ?hidden=${badgesHidden}>\n <slot name=\"badges\" @slotchange=${this._onBadgesSlotChange}>\n ${\n controlBadge\n ? html`<obc-automation-badge\n .type=${controlBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n alertBadge\n ? html`<obc-automation-badge\n .type=${alertBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n interlockBadge\n ? html`<obc-automation-badge\n .type=${interlockBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n commandLockedBadge\n ? html`<obc-automation-badge\n .type=${commandLockedBadge}\n ></obc-automation-badge>`\n : nothing\n }\n </slot>\n </div>\n `;\n\n const tagCell = html`\n <div class=\"tag\" ?hidden=${tagHidden}>\n <slot name=\"tag\" @slotchange=${this._onTagSlotChange}>${this.tag}</slot>\n </div>\n `;\n\n const pressurized = this.frame === SpecialtyTankFrame.pressurized;\n const cap = (side: 'start' | 'end') =>\n pressurized\n ? html`<div class=\"cap cap-${side}\"><div class=\"cap-dome\"></div></div>`\n : nothing;\n const frameClasses = classMap({\n 'tank-frame': true,\n [`frame-${this.frame}`]: true,\n [`split-${this.splitMode}`]: true,\n [`medium-${this.medium}`]: true,\n static: this.static,\n });\n const tankFrame = html`\n <div class=${frameClasses}>\n ${cap('start')}\n <div class=\"middle\">\n <div class=\"content\">\n ${this.static ? nothing : this.renderGraphic()}\n ${\n this.showIcon\n ? html`<div class=\"icon-frame\">${this.equipmentIcon}</div>`\n : nothing\n }\n </div>\n </div>\n ${cap('end')}\n </div>\n `;\n\n const alertFrameOverlay = this.alert\n ? html`<obc-alert-frame\n class=\"alert-frame\"\n .type=${this.alertFrameType}\n .thickness=${this.alertFrameThickness}\n .status=${this.alertFrameStatus}\n .mode=${this.alertFrameMode}\n .showAlertCategoryIcon=${this.showAlertCategoryIcon}\n .showIcon=${this.showAlertIcon}\n >\n <span slot=\"icon\"><slot name=\"alert-icon\"></slot></span>\n <span slot=\"label\"><slot name=\"alert-label\"></slot></span>\n <span slot=\"timer\"><slot name=\"alert-timer\"></slot></span>\n </obc-alert-frame>`\n : nothing;\n\n const halo = html`\n <div class=\"halo\">\n ${badgesCell}${tankFrame}${tagCell}${alertFrameOverlay}\n </div>\n `;\n\n const isClickable = this.clickable && !this.static;\n const rootClasses = classMap({\n root: true,\n activated: this.activated,\n clickable: isClickable,\n });\n const name = this.tag || this.equipmentName;\n\n // Same three root shapes as obc-automation-tank; the live region stays on\n // all of them so a slotted alert label is announced regardless.\n if (this.static) {\n return html`<div\n class=${rootClasses}\n role=\"img\"\n aria-label=${name}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`;\n }\n if (!isClickable) {\n return html`<div\n class=${rootClasses}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`;\n }\n return html`<button\n class=${rootClasses}\n type=\"button\"\n aria-label=${name}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </button>`;\n }\n\n static override styles: CSSResultGroup = unsafeCSS(componentStyle);\n}\n"],"mappings":";;;;;;;;;;;;;;;AA0BA,IAAY,sBAAL,yBAAA,qBAAA;;CAEL,oBAAA,aAAA;;CAEA,oBAAA,aAAA;;CAEA,oBAAA,YAAA;;AACF,EAAA,CAAA,CAAA;;;;;AAMA,IAAY,yBAAL,yBAAA,wBAAA;;CAEL,uBAAA,cAAA;;CAEA,uBAAA,gBAAA;;CAEA,uBAAA,cAAA;;AACF,EAAA,CAAA,CAAA;;;;AAKA,IAAY,qBAAL,yBAAA,oBAAA;;CAEL,mBAAA,aAAA;;CAEA,mBAAA,iBAAA;;AACF,EAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAa,2BAAb,cAA8C,WAAW;;;;EAGK,KAAA,SAAA;EACK,KAAA,WAAA;EACzB,KAAA,MAAA;EAEtC,KAAA,cAAA,gBAAgB;EACgD,KAAA,YAAA;EAClB,KAAA,YAAA;EAG9C,KAAA,eAAA,6BAA6B;EAE7B,KAAA,aAAA,2BAA2B;EAE3B,KAAA,iBAAA,+BAA+B;EAG/B,KAAA,qBAAA,mCAAmC;EAEO,KAAA,QAAA;EAE1C,KAAA,iBAAA,kBAAkB;EAElB,KAAA,sBAAA,uBAAuB;EAC+B,KAAA,mBAAA,UAAU;EAEhE,KAAA,iBAAA,kBAAkB;EAElB,KAAA,wBAAA;EACkD,KAAA,gBAAA;EAEtB,KAAA,aAAA;EACC,KAA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,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,yBAAA,WAAA,oBAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,yBAAA,WAAA,kBAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS;CAAC,MAAM;CAAS,WAAW;AAAK,CAAC,CAAA,GAAA,yBAAA,WAAA,yBAAA,KAAA,CAAA;AAE1CA,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,yBAAA,WAAA,iBAAA,KAAA,CAAA;AAExBA,WAAA,CAAA,MAAM,CAAA,GAAA,yBAAA,WAAA,cAAA,KAAA,CAAA;AACNA,WAAA,CAAA,MAAM,CAAA,GAAA,yBAAA,WAAA,eAAA,KAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"abstract-specialty-tank.js","names":["componentStyle","_decorate"],"sources":["../../../src/automation/specialty-tank/abstract-specialty-tank.ts"],"sourcesContent":["import {LitElement, html, nothing, svg, unsafeCSS} from 'lit';\nimport type {CSSResultGroup, TemplateResult} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport componentStyle from './specialty-tank.css?inline';\nimport '../automation-badge/automation-badge.js';\nimport {ObcAutomationBadgeType} from '../automation-badge/automation-badge.js';\nimport {\n AutomationButtonBadgeAlert,\n AutomationButtonBadgeCommandLocked,\n AutomationButtonBadgeControl,\n AutomationButtonBadgeInterlock,\n} from '../automation-button/abstract-automation-button.js';\nimport '../../components/alert-frame/alert-frame.js';\nimport {\n ObcAlertFrameMode,\n ObcAlertFrameThickness,\n ObcAlertFrameType,\n} from '../../components/alert-frame/alert-frame.js';\nimport {AlertType} from '../../types.js';\nimport {TankPositioning} from '../automation-tank/tank-positioning.js';\n\n/**\n * What the graphic area of a specialty tank shows. Mirrors the Figma\n * `has Medium` property; its fourth value, Static, is the `static` property.\n */\nexport enum SpecialtyTankMedium {\n /** One grey area, no split. */\n regular = 'regular',\n /** Two grey halves separated by a gap. */\n graphic = 'graphic',\n /** Hot (red) and cold (blue) halves separated by a gap. */\n medium = 'medium',\n}\n\n/**\n * Hot/cold split geometry of a specialty tank. Drives the halves and the\n * gap between them through the `split-<mode>` class on the tank frame.\n */\nexport enum SpecialtyTankSplitMode {\n /** Left half hot, right half cold. */\n vertical = 'vertical',\n /** Top half hot, bottom half cold. */\n horizontal = 'horizontal',\n /** Two corner-to-corner triangles, top-left hot and bottom-right cold. */\n diagonal = 'diagonal',\n}\n\n/**\n * Frame silhouette of a specialty tank.\n */\nexport enum SpecialtyTankFrame {\n /** One rounded border box. */\n rounded = 'rounded',\n /** Pressurized-tank silhouette: domed caps on a side-bordered body. */\n pressurized = 'pressurized',\n}\n\n/**\n * Base class for the specialty-tank tiles `obc-heat-pump`,\n * `obc-hydraulic-separator` and `obc-heat-exchanger`. Owns the halo, badge\n * row, tank frame with its hot/cold graphic area and equipment icon, tag\n * readout and alert-frame overlay. Subclasses supply `equipmentIcon`,\n * `equipmentName`, `frame` and `splitMode`, plus their own host footprint.\n *\n * ## Layout\n * The same shell as a compact `obc-automation-tank`: a fixed host (or\n * `positioning=\"button\"` to fill the parent), a 4px-padded halo holding\n * badges, the tank frame and the tag, the frame absorbing the space of\n * empty badge and tag cells. Hover, pressed, focus-visible and `activated`\n * are painted on the halo by the flat style mixin; `clickable` and `static`\n * switch the root between a `<button>`, a plain `<div>` and a\n * `<div role=\"img\">` exactly as the tank does.\n *\n * Not declared `abstract`: the wrapper generators wrap every `LitElement`\n * subclass and pass its constructor as a concrete `Constructor<T>`, so the\n * override points throw instead (same as `ObcAbstractAutomationButton`).\n *\n * @property medium - What the graphic area shows: `regular` (one grey area), `graphic` (two grey halves) or `medium` (hot/cold halves).\n * @property static - Display-only tile with a flat grey frame and a bare icon, rendered as a non-interactive `<div role=\"img\">`. Hides the graphic area.\n * @property showIcon - Show the equipment icon centered on the graphic area.\n * @property tag - Identifier rendered in the tag readout below the frame (for example `#0000`); also the accessible name. The cell collapses when empty.\n * @property positioning - Host positioning model — see `TankPositioning`. `button` (default) fills the parent, `point` uses the fixed design footprint with the P&ID anchor.\n * @property clickable - Whether the tile is interactive. `false` keeps the resting appearance but drops hover, pressed and focus states and leaves the tab order; property-only because the default is `true`.\n * @property activated - Paints the activated background on the halo. Needs an interactive tile.\n * @availableWhen activated clickable==true\n * @property badgeControl - Mode badge (auto / manual / local variants), first in the badge row.\n * @property badgeAlert - Alert badge, second in the badge row.\n * @property badgeInterlock - Interlock badge, third in the badge row.\n * @property badgeCommandLocked - Command-locked badge, last in the badge row.\n * @property alert - Show an alert-frame overlay around the halo, mirroring `obc-automation-tank`.\n * @property alertFrameType - Shape of the alert frame.\n * @availableWhen alertFrameType alert==true\n * @property alertFrameThickness - Thickness of the alert frame.\n * @availableWhen alertFrameThickness alert==true\n * @property alertFrameStatus - Alert status the frame is coloured for.\n * @availableWhen alertFrameStatus alert==true\n * @property alertFrameMode - Acknowledgement state of the alert: `acked-active` (default) is steady,\n * `unacked-active` flashes, `unacked-rectified` flashes a dashed frame.\n * @availableWhen alertFrameMode alert==true\n * @property showAlertCategoryIcon - Shows the alert category icon inside the frame.\n * @availableWhen showAlertCategoryIcon alert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]\n * @property showAlertIcon - Shows the slotted alert icon inside the frame.\n * @availableWhen showAlertIcon alert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]\n */\nexport class ObcAbstractSpecialtyTank extends LitElement {\n @property({type: String}) medium: SpecialtyTankMedium =\n SpecialtyTankMedium.regular;\n @property({type: Boolean, reflect: true}) static: boolean = false;\n @property({type: Boolean, attribute: false}) showIcon: boolean = true;\n @property({type: String}) tag: string = '';\n @property({type: String, reflect: true}) positioning: TankPositioning =\n TankPositioning.button;\n @property({type: Boolean, attribute: false}) clickable: boolean = true;\n @property({type: Boolean}) activated: boolean = false;\n\n @property({type: String}) badgeControl: AutomationButtonBadgeControl =\n AutomationButtonBadgeControl.None;\n @property({type: String}) badgeAlert: AutomationButtonBadgeAlert =\n AutomationButtonBadgeAlert.None;\n @property({type: String}) badgeInterlock: AutomationButtonBadgeInterlock =\n AutomationButtonBadgeInterlock.None;\n @property({type: String})\n badgeCommandLocked: AutomationButtonBadgeCommandLocked =\n AutomationButtonBadgeCommandLocked.None;\n\n @property({type: Boolean}) alert: boolean = false;\n @property({type: String}) alertFrameType: ObcAlertFrameType =\n ObcAlertFrameType.SmallSideFlip;\n @property({type: String}) alertFrameThickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n @property({type: String}) alertFrameStatus: AlertType = AlertType.Alarm;\n @property({type: String}) alertFrameMode: ObcAlertFrameMode =\n ObcAlertFrameMode.ackedActive;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n @property({type: Boolean}) showAlertIcon: boolean = false;\n\n @state() private _hasBadges = false;\n @state() private _hasTagSlot = false;\n\n protected get equipmentIcon(): TemplateResult {\n throw new Error('\"equipmentIcon\" must be implemented in the subclass');\n }\n\n /** Accessible-name fallback used when `tag` is empty. */\n protected get equipmentName(): string {\n throw new Error('\"equipmentName\" must be implemented in the subclass');\n }\n\n protected get frame(): SpecialtyTankFrame {\n throw new Error('\"frame\" must be implemented in the subclass');\n }\n\n protected get splitMode(): SpecialtyTankSplitMode {\n throw new Error('\"splitMode\" must be implemented in the subclass');\n }\n\n private _badgeControlType(): ObcAutomationBadgeType | null {\n switch (this.badgeControl) {\n case AutomationButtonBadgeControl.Local:\n return ObcAutomationBadgeType.Local;\n case AutomationButtonBadgeControl.LocalOnly:\n return ObcAutomationBadgeType.LocalOnly;\n case AutomationButtonBadgeControl.Manual:\n return ObcAutomationBadgeType.Manual;\n case AutomationButtonBadgeControl.ManualOnly:\n return ObcAutomationBadgeType.ManualOnly;\n case AutomationButtonBadgeControl.Auto:\n return ObcAutomationBadgeType.Auto;\n default:\n return null;\n }\n }\n\n private _badgeAlertType(): ObcAutomationBadgeType | null {\n switch (this.badgeAlert) {\n case AutomationButtonBadgeAlert.Silence:\n return ObcAutomationBadgeType.AlertSilenced;\n case AutomationButtonBadgeAlert.Shelved:\n return ObcAutomationBadgeType.AlertShelved;\n case AutomationButtonBadgeAlert.Caution:\n return ObcAutomationBadgeType.Caution;\n case AutomationButtonBadgeAlert.Warning:\n return ObcAutomationBadgeType.Warning;\n case AutomationButtonBadgeAlert.Alarm:\n return ObcAutomationBadgeType.Alarm;\n case AutomationButtonBadgeAlert.LevelCritical:\n return ObcAutomationBadgeType.LevelCritical;\n case AutomationButtonBadgeAlert.LevelHigh:\n return ObcAutomationBadgeType.LevelHigh;\n case AutomationButtonBadgeAlert.LevelMedium:\n return ObcAutomationBadgeType.LevelMedium;\n case AutomationButtonBadgeAlert.LevelLow:\n return ObcAutomationBadgeType.LevelLow;\n case AutomationButtonBadgeAlert.LevelDiagnostic:\n return ObcAutomationBadgeType.LevelDiagnostic;\n default:\n return null;\n }\n }\n\n private _badgeInterlockType(): ObcAutomationBadgeType | null {\n switch (this.badgeInterlock) {\n case AutomationButtonBadgeInterlock.Interlock:\n return ObcAutomationBadgeType.Interlock;\n case AutomationButtonBadgeInterlock.InterlockInhibit:\n return ObcAutomationBadgeType.InterlockInhibit;\n case AutomationButtonBadgeInterlock.Simulation:\n return ObcAutomationBadgeType.Simulation;\n default:\n return null;\n }\n }\n\n private _badgeCommandLockedType(): ObcAutomationBadgeType | null {\n switch (this.badgeCommandLocked) {\n case AutomationButtonBadgeCommandLocked.CommandLocked:\n return ObcAutomationBadgeType.CommandLocked;\n case AutomationButtonBadgeCommandLocked.Simulation:\n return ObcAutomationBadgeType.Simulation;\n default:\n return null;\n }\n }\n\n private _slotHasContent(e: Event): boolean {\n const slot = e.target as HTMLSlotElement;\n return slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n private _onBadgesSlotChange(e: Event): void {\n this._hasBadges = this._slotHasContent(e);\n }\n\n private _onTagSlotChange(e: Event): void {\n this._hasTagSlot = this._slotHasContent(e);\n }\n\n private renderGraphic(): TemplateResult {\n if (this.medium === SpecialtyTankMedium.regular) {\n return html`<div class=\"area area-single\"></div>`;\n }\n if (this.splitMode === SpecialtyTankSplitMode.diagonal) {\n return this.renderDiagonalSplit();\n }\n return html`\n <div class=\"halves\">\n <div class=\"area area-hot\"></div>\n <div class=\"area area-cold\"></div>\n </div>\n `;\n }\n\n /**\n * Diagonal split in a unit viewBox stretched over the area\n * (`preserveAspectRatio=\"none\"`); every stroke is `non-scaling` so the\n * borders and the gap keep their pixel widths at any aspect ratio. The\n * gap edges are drawn as one wide line per half, clipped to that half,\n * under the narrower frame-coloured gap line.\n */\n private renderDiagonalSplit(): TemplateResult {\n const hot = '0,0 1,0 0,1';\n const cold = '1,0 1,1 0,1';\n return html`\n <div class=\"diagonal\">\n <svg viewBox=\"0 0 1 1\" preserveAspectRatio=\"none\" aria-hidden=\"true\">\n ${svg`\n <defs>\n <clipPath id=\"clip-hot\"><polygon points=${hot} /></clipPath>\n <clipPath id=\"clip-cold\"><polygon points=${cold} /></clipPath>\n </defs>\n <polygon class=\"area-fill area-hot\" points=${hot} />\n <polygon class=\"area-fill area-cold\" points=${cold} />\n <polygon class=\"area-stroke area-hot\" points=${hot} clip-path=\"url(#clip-hot)\" vector-effect=\"non-scaling-stroke\" />\n <polygon class=\"area-stroke area-cold\" points=${cold} clip-path=\"url(#clip-cold)\" vector-effect=\"non-scaling-stroke\" />\n <line class=\"gap-edge area-hot\" x1=\"1\" y1=\"0\" x2=\"0\" y2=\"1\" clip-path=\"url(#clip-hot)\" vector-effect=\"non-scaling-stroke\" />\n <line class=\"gap-edge area-cold\" x1=\"1\" y1=\"0\" x2=\"0\" y2=\"1\" clip-path=\"url(#clip-cold)\" vector-effect=\"non-scaling-stroke\" />\n <line class=\"gap\" x1=\"1\" y1=\"0\" x2=\"0\" y2=\"1\" vector-effect=\"non-scaling-stroke\" />\n `}\n </svg>\n </div>\n `;\n }\n\n override render() {\n const controlBadge = this._badgeControlType();\n const alertBadge = this._badgeAlertType();\n const interlockBadge = this._badgeInterlockType();\n const commandLockedBadge = this._badgeCommandLockedType();\n const hasEnumBadges =\n controlBadge !== null ||\n alertBadge !== null ||\n interlockBadge !== null ||\n commandLockedBadge !== null;\n\n const badgesHidden = !this._hasBadges && !hasEnumBadges;\n const tagHidden = !this._hasTagSlot && !this.tag;\n\n const badgesCell = html`\n <div class=\"badges\" ?hidden=${badgesHidden}>\n <slot name=\"badges\" @slotchange=${this._onBadgesSlotChange}>\n ${\n controlBadge\n ? html`<obc-automation-badge\n .type=${controlBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n alertBadge\n ? html`<obc-automation-badge\n .type=${alertBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n interlockBadge\n ? html`<obc-automation-badge\n .type=${interlockBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n commandLockedBadge\n ? html`<obc-automation-badge\n .type=${commandLockedBadge}\n ></obc-automation-badge>`\n : nothing\n }\n </slot>\n </div>\n `;\n\n const tagCell = html`\n <div class=\"tag\" ?hidden=${tagHidden}>\n <slot name=\"tag\" @slotchange=${this._onTagSlotChange}>${this.tag}</slot>\n </div>\n `;\n\n const pressurized = this.frame === SpecialtyTankFrame.pressurized;\n const cap = (side: 'start' | 'end') =>\n pressurized\n ? html`<div class=\"cap cap-${side}\"><div class=\"cap-dome\"></div></div>`\n : nothing;\n const frameClasses = classMap({\n 'tank-frame': true,\n [`frame-${this.frame}`]: true,\n [`split-${this.splitMode}`]: true,\n [`medium-${this.medium}`]: true,\n static: this.static,\n });\n const tankFrame = html`\n <div class=${frameClasses}>\n ${cap('start')}\n <div class=\"middle\">\n <div class=\"content\">\n ${this.static ? nothing : this.renderGraphic()}\n ${\n this.showIcon\n ? html`<div class=\"icon-frame\">${this.equipmentIcon}</div>`\n : nothing\n }\n </div>\n </div>\n ${cap('end')}\n </div>\n `;\n\n const alertFrameOverlay = this.alert\n ? html`<obc-alert-frame\n class=\"alert-frame\"\n .type=${this.alertFrameType}\n .thickness=${this.alertFrameThickness}\n .status=${this.alertFrameStatus}\n .mode=${this.alertFrameMode}\n .showAlertCategoryIcon=${this.showAlertCategoryIcon}\n .showIcon=${this.showAlertIcon}\n >\n <span slot=\"icon\"><slot name=\"alert-icon\"></slot></span>\n <span slot=\"label\"><slot name=\"alert-label\"></slot></span>\n <span slot=\"timer\"><slot name=\"alert-timer\"></slot></span>\n </obc-alert-frame>`\n : nothing;\n\n const halo = html`\n <div class=\"halo\">\n ${badgesCell}${tankFrame}${tagCell}${alertFrameOverlay}\n </div>\n `;\n\n const isClickable = this.clickable && !this.static;\n const rootClasses = classMap({\n root: true,\n activated: this.activated,\n clickable: isClickable,\n });\n const name = this.tag || this.equipmentName;\n\n // Same three root shapes as obc-automation-tank; the live region stays on\n // all of them so a slotted alert label is announced regardless.\n if (this.static) {\n return html`<div\n class=${rootClasses}\n role=\"img\"\n aria-label=${name}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`;\n }\n if (!isClickable) {\n return html`<div\n class=${rootClasses}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`;\n }\n return html`<button\n class=${rootClasses}\n type=\"button\"\n aria-label=${name}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </button>`;\n }\n\n static override styles: CSSResultGroup = unsafeCSS(componentStyle);\n}\n"],"mappings":";;;;;;;;;;;;;;;AA0BA,IAAY,sBAAL,yBAAA,qBAAA;;CAEL,oBAAA,aAAA;;CAEA,oBAAA,aAAA;;CAEA,oBAAA,YAAA;;AACF,EAAA,CAAA,CAAA;;;;;AAMA,IAAY,yBAAL,yBAAA,wBAAA;;CAEL,uBAAA,cAAA;;CAEA,uBAAA,gBAAA;;CAEA,uBAAA,cAAA;;AACF,EAAA,CAAA,CAAA;;;;AAKA,I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AA,WAAA,eAAA,KAAA,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* One app-wide setting the components render from.
|
|
4
|
+
*
|
|
5
|
+
* The application sets it once through a module setter such as
|
|
6
|
+
* `setAutomationBadgeLayout()` or `setAlertStandard()`. Every connected host
|
|
7
|
+
* that holds a controller for it re-renders on each change; a host detached
|
|
8
|
+
* while the value changed catches up on its next connect, and one reattached
|
|
9
|
+
* unchanged renders nothing extra. Setting the same value again is a no-op.
|
|
10
|
+
*
|
|
11
|
+
* It is a plain subscriber set rather than a signal: the value rarely changes
|
|
12
|
+
* and derives nothing, and the library stays off a pre-standard polyfill. A
|
|
13
|
+
* setter built on it can move to a signal later without changing its signature.
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* const alertStandard = new GlobalSetting<AlertStandard | undefined>(undefined);
|
|
17
|
+
* export const setAlertStandard = (s?: AlertStandard) => alertStandard.set(s);
|
|
18
|
+
*
|
|
19
|
+
* class ObcAlertIcon extends LitElement {
|
|
20
|
+
* private readonly standard = alertStandard.controller(this);
|
|
21
|
+
* render() { return draw(this.standard.value); }
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare class GlobalSetting<T> {
|
|
26
|
+
private value;
|
|
27
|
+
private currentVersion;
|
|
28
|
+
private readonly hosts;
|
|
29
|
+
constructor(value: T);
|
|
30
|
+
get(): T;
|
|
31
|
+
/** Stores the value and re-renders every connected host. */
|
|
32
|
+
set(value: T): void;
|
|
33
|
+
/** Re-renders `host` whenever the value changes; create it once, in the host's constructor. */
|
|
34
|
+
controller(host: ReactiveControllerHost): GlobalSettingController<T>;
|
|
35
|
+
/** Counts the changes, so a controller can tell whether its host rendered the current value. */
|
|
36
|
+
get version(): number;
|
|
37
|
+
attach(host: ReactiveControllerHost): void;
|
|
38
|
+
detach(host: ReactiveControllerHost): void;
|
|
39
|
+
}
|
|
40
|
+
/** Keeps one host rendered with the current value of a `GlobalSetting`. */
|
|
41
|
+
export declare class GlobalSettingController<T> implements ReactiveController {
|
|
42
|
+
private readonly host;
|
|
43
|
+
private readonly setting;
|
|
44
|
+
private renderedVersion;
|
|
45
|
+
private renderingVersion;
|
|
46
|
+
constructor(host: ReactiveControllerHost, setting: GlobalSetting<T>);
|
|
47
|
+
get value(): T;
|
|
48
|
+
/** A value set while the host was detached never reached it. */
|
|
49
|
+
hostConnected(): void;
|
|
50
|
+
hostDisconnected(): void;
|
|
51
|
+
/** The version a render starts from; a change while it runs detached must not count as rendered. */
|
|
52
|
+
hostUpdate(): void;
|
|
53
|
+
hostUpdated(): void;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=global-setting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-setting.d.ts","sourceRoot":"","sources":["../../src/internal/global-setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAE,sBAAsB,EAAC,MAAM,KAAK,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,aAAa,CAAC,CAAC;IAId,OAAO,CAAC,KAAK;IAHzB,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqC;gBAEvC,KAAK,EAAE,CAAC;IAE5B,GAAG,IAAI,CAAC;IAIR,4DAA4D;IAC5D,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IAWnB,+FAA+F;IAC/F,UAAU,CAAC,IAAI,EAAE,sBAAsB,GAAG,uBAAuB,CAAC,CAAC,CAAC;IAIpE,gGAAgG;IAChG,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,MAAM,CAAC,IAAI,EAAE,sBAAsB,GAAG,IAAI;IAI1C,MAAM,CAAC,IAAI,EAAE,sBAAsB,GAAG,IAAI;CAG3C;AAED,2EAA2E;AAC3E,qBAAa,uBAAuB,CAAC,CAAC,CAAE,YAAW,kBAAkB;IAKjE,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAL1B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,gBAAgB,CAAS;gBAGd,IAAI,EAAE,sBAAsB,EAC5B,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;IAO5C,IAAI,KAAK,IAAI,CAAC,CAEb;IAED,gEAAgE;IAChE,aAAa,IAAI,IAAI;IAOrB,gBAAgB,IAAI,IAAI;IAIxB,oGAAoG;IACpG,UAAU,IAAI,IAAI;IAIlB,WAAW,IAAI,IAAI;CAGpB"}
|