@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.49 → 2.0.0-next.50
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 +196 -38
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +9 -0
- package/dist/automation/automation-tank/automation-tank.css.js +166 -28
- package/dist/automation/automation-tank/automation-tank.css.js.map +1 -1
- package/dist/automation/automation-tank/automation-tank.d.ts +32 -0
- package/dist/automation/automation-tank/automation-tank.d.ts.map +1 -1
- package/dist/automation/automation-tank/automation-tank.js +28 -0
- package/dist/automation/automation-tank/automation-tank.js.map +1 -1
- package/dist/components/message-menu-item/message-menu-item.css.js +2 -10
- package/dist/components/message-menu-item/message-menu-item.css.js.map +1 -1
- package/package.json +1 -1
- package/src/automation/automation-tank/automation-tank.css +119 -21
- package/src/automation/automation-tank/automation-tank.stories.ts +38 -0
- package/src/automation/automation-tank/automation-tank.ts +64 -0
- package/src/components/message-menu-item/message-menu-item.css +2 -5
|
@@ -94,6 +94,25 @@ export enum TankChartMode {
|
|
|
94
94
|
graphAndBar = 'graph-and-bar',
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
/**
|
|
98
|
+
* A single detail row rendered in the tank's `readout` rich list (below the
|
|
99
|
+
* main percent / value block, separated by a divider). Each row is rendered
|
|
100
|
+
* as `<label>` on the left and `<value><degree?><percent?><unit>` on the
|
|
101
|
+
* right, all on a single line.
|
|
102
|
+
*/
|
|
103
|
+
export interface TankReadoutItem {
|
|
104
|
+
/** Left-aligned label text (e.g. `Temperature`). */
|
|
105
|
+
label: string;
|
|
106
|
+
/** Numeric value, formatted with the tank's `percentFractionDigits`. */
|
|
107
|
+
value: number;
|
|
108
|
+
/** Append a `°` glyph directly after the value with no gap. */
|
|
109
|
+
hasDegree?: boolean;
|
|
110
|
+
/** Append a `%` glyph directly after the value with no gap. */
|
|
111
|
+
hasPercentage?: boolean;
|
|
112
|
+
/** Unit text (e.g. `C`, `Pa`, `m/s`). Rendered after the value/glyph. */
|
|
113
|
+
unit: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
97
116
|
/**
|
|
98
117
|
*
|
|
99
118
|
*
|
|
@@ -221,6 +240,21 @@ export class ObcAutomationTank extends LitElement {
|
|
|
221
240
|
*/
|
|
222
241
|
@property({type: Number}) percentFractionDigits: number = 0;
|
|
223
242
|
|
|
243
|
+
/**
|
|
244
|
+
* Rich detail rows shown below the main percent/value block in the regular
|
|
245
|
+
* (non-compact, non-static) layout, separated by a divider. When empty (the
|
|
246
|
+
* default), nothing is rendered — neither the divider nor the list. In
|
|
247
|
+
* vertical orientation the chart cell shrinks to make room; in horizontal
|
|
248
|
+
* orientation the readout column already has reserved whitespace so the
|
|
249
|
+
* chart is unaffected.
|
|
250
|
+
*
|
|
251
|
+
* Values are formatted using `percentFractionDigits`. Consumers that need
|
|
252
|
+
* full control over the markup can replace the entire fallback by slotting
|
|
253
|
+
* arbitrary content into `slot="rich"` (note: this is a different name from
|
|
254
|
+
* the existing `slot="readout"` which replaces the whole readout block).
|
|
255
|
+
*/
|
|
256
|
+
@property({type: Array, attribute: false}) readout: TankReadoutItem[] = [];
|
|
257
|
+
|
|
224
258
|
/**
|
|
225
259
|
* Enum-driven badges rendered inside the `badges` cell. Mirrors the API
|
|
226
260
|
* introduced for `ObcAbstractAutomationButton` in PR #839 (#829). When set
|
|
@@ -703,6 +737,36 @@ export class ObcAutomationTank extends LitElement {
|
|
|
703
737
|
<slot class="unit" name="unit">m<sup>3</sup></slot>
|
|
704
738
|
</div>
|
|
705
739
|
</div>
|
|
740
|
+
<slot name="rich">
|
|
741
|
+
${this.readout.length > 0
|
|
742
|
+
? html`
|
|
743
|
+
<div class="rich-divider"></div>
|
|
744
|
+
<div class="rich">
|
|
745
|
+
${this.readout.map(
|
|
746
|
+
(row) => html`
|
|
747
|
+
<div class="rich-row">
|
|
748
|
+
<span class="rich-label">${row.label}</span>
|
|
749
|
+
<span class="rich-value"
|
|
750
|
+
>${row.value.toFixed(
|
|
751
|
+
this.percentFractionDigits
|
|
752
|
+
)}</span
|
|
753
|
+
>
|
|
754
|
+
<span class="rich-suffix"
|
|
755
|
+
>${row.hasDegree
|
|
756
|
+
? html`<span class="rich-glyph">°</span>`
|
|
757
|
+
: nothing}${row.hasPercentage
|
|
758
|
+
? html`<span class="rich-glyph">%</span>`
|
|
759
|
+
: nothing}<span class="rich-unit"
|
|
760
|
+
>${row.unit}</span
|
|
761
|
+
></span
|
|
762
|
+
>
|
|
763
|
+
</div>
|
|
764
|
+
`
|
|
765
|
+
)}
|
|
766
|
+
</div>
|
|
767
|
+
`
|
|
768
|
+
: nothing}
|
|
769
|
+
</slot>
|
|
706
770
|
</slot>
|
|
707
771
|
</div>
|
|
708
772
|
`;
|