@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.57 → 2.0.0-next.59
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 +6585 -4581
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +1047 -83
- package/dist/alert-severity.d.ts +38 -0
- package/dist/alert-severity.d.ts.map +1 -0
- package/dist/alert-severity.js +176 -0
- package/dist/alert-severity.js.map +1 -0
- package/dist/ar/building-blocks/poi-header/poi-header.css.js +38 -7
- package/dist/ar/building-blocks/poi-header/poi-header.css.js.map +1 -1
- package/dist/ar/building-blocks/poi-header/poi-header.d.ts +7 -2
- package/dist/ar/building-blocks/poi-header/poi-header.d.ts.map +1 -1
- package/dist/ar/building-blocks/poi-header/poi-header.js +5 -0
- package/dist/ar/building-blocks/poi-header/poi-header.js.map +1 -1
- package/dist/ar/poi-button/poi-button.css.js +110 -32
- package/dist/ar/poi-button/poi-button.css.js.map +1 -1
- package/dist/ar/poi-button/poi-button.d.ts +7 -2
- package/dist/ar/poi-button/poi-button.d.ts.map +1 -1
- package/dist/ar/poi-button/poi-button.js +15 -0
- package/dist/ar/poi-button/poi-button.js.map +1 -1
- package/dist/ar/types.d.ts +6 -1
- package/dist/ar/types.d.ts.map +1 -1
- package/dist/ar/types.js +5 -0
- package/dist/ar/types.js.map +1 -1
- package/dist/automation/automation-badge/automation-badge.d.ts +9 -1
- package/dist/automation/automation-badge/automation-badge.d.ts.map +1 -1
- package/dist/automation/automation-badge/automation-badge.js +119 -12
- package/dist/automation/automation-badge/automation-badge.js.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts +25 -1
- 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 +7 -2
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button.d.ts +10 -3
- package/dist/automation/automation-button/abstract-automation-button.d.ts.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button.js +23 -2
- package/dist/automation/automation-button/abstract-automation-button.js.map +1 -1
- package/dist/automation/automation-button/automation-button.css.js +9 -4
- package/dist/automation/automation-button/automation-button.css.js.map +1 -1
- package/dist/automation/automation-button/automation-button.d.ts +4 -2
- package/dist/automation/automation-button/automation-button.d.ts.map +1 -1
- package/dist/automation/automation-button/automation-button.js +24 -6
- package/dist/automation/automation-button/automation-button.js.map +1 -1
- package/dist/automation/automation-tank/automation-tank.d.ts +3 -2
- package/dist/automation/automation-tank/automation-tank.d.ts.map +1 -1
- package/dist/automation/automation-tank/automation-tank.js +13 -2
- package/dist/automation/automation-tank/automation-tank.js.map +1 -1
- package/dist/building-blocks/instrument-radial/instrument-radial.d.ts +10 -0
- package/dist/building-blocks/instrument-radial/instrument-radial.d.ts.map +1 -1
- package/dist/building-blocks/instrument-radial/instrument-radial.js +86 -21
- package/dist/building-blocks/instrument-radial/instrument-radial.js.map +1 -1
- package/dist/components/accordion-card/accordion-card.css.js +34 -0
- package/dist/components/accordion-card/accordion-card.css.js.map +1 -1
- package/dist/components/accordion-card/accordion-card.d.ts +3 -2
- package/dist/components/accordion-card/accordion-card.d.ts.map +1 -1
- package/dist/components/accordion-card/accordion-card.js +4 -3
- package/dist/components/accordion-card/accordion-card.js.map +1 -1
- package/dist/components/alert-button/alert-button.css.js +744 -7
- package/dist/components/alert-button/alert-button.css.js.map +1 -1
- package/dist/components/alert-button/alert-button.d.ts +3 -1
- package/dist/components/alert-button/alert-button.d.ts.map +1 -1
- package/dist/components/alert-button/alert-button.js +33 -31
- package/dist/components/alert-button/alert-button.js.map +1 -1
- package/dist/components/alert-frame/alert-frame.css.js +116 -29
- package/dist/components/alert-frame/alert-frame.css.js.map +1 -1
- package/dist/components/alert-frame/alert-frame.d.ts +42 -15
- package/dist/components/alert-frame/alert-frame.d.ts.map +1 -1
- package/dist/components/alert-frame/alert-frame.js +68 -17
- package/dist/components/alert-frame/alert-frame.js.map +1 -1
- package/dist/components/alert-frame/critical-badge.d.ts +12 -0
- package/dist/components/alert-frame/critical-badge.d.ts.map +1 -0
- package/dist/components/alert-frame/critical-badge.js +47 -0
- package/dist/components/alert-frame/critical-badge.js.map +1 -0
- package/dist/components/alert-frame/diagnostic-badge.d.ts +12 -0
- package/dist/components/alert-frame/diagnostic-badge.d.ts.map +1 -0
- package/dist/components/alert-frame/diagnostic-badge.js +60 -0
- package/dist/components/alert-frame/diagnostic-badge.js.map +1 -0
- package/dist/components/alert-icon/alert-icon.d.ts +6 -1
- package/dist/components/alert-icon/alert-icon.d.ts.map +1 -1
- package/dist/components/alert-icon/alert-icon.js +96 -38
- package/dist/components/alert-icon/alert-icon.js.map +1 -1
- package/dist/components/alert-icon/icons/icon-critical.d.ts +3 -0
- package/dist/components/alert-icon/icons/icon-critical.d.ts.map +1 -0
- package/dist/components/alert-icon/icons/icon-critical.js +26 -0
- package/dist/components/alert-icon/icons/icon-critical.js.map +1 -0
- package/dist/components/alert-list-details/alert-list-details.d.ts.map +1 -1
- package/dist/components/alert-list-details/alert-list-details.js +6 -7
- package/dist/components/alert-list-details/alert-list-details.js.map +1 -1
- package/dist/components/badge/badge.css.js +50 -2
- package/dist/components/badge/badge.css.js.map +1 -1
- package/dist/components/badge/badge.d.ts +13 -2
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/badge.js +54 -0
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/manual-icon/icon-alerts-critical-twotone.d.ts +30 -0
- package/dist/manual-icon/icon-alerts-critical-twotone.d.ts.map +1 -0
- package/dist/manual-icon/icon-alerts-critical-twotone.js +55 -0
- package/dist/manual-icon/icon-alerts-critical-twotone.js.map +1 -0
- package/dist/manual-icon/icon-alerts-diagnostic-twotone.d.ts +30 -0
- package/dist/manual-icon/icon-alerts-diagnostic-twotone.d.ts.map +1 -0
- package/dist/manual-icon/icon-alerts-diagnostic-twotone.js +55 -0
- package/dist/manual-icon/icon-alerts-diagnostic-twotone.js.map +1 -0
- package/dist/navigation-instruments/gauge-radial/gauge-radial.css.js +99 -0
- package/dist/navigation-instruments/gauge-radial/gauge-radial.css.js.map +1 -0
- package/dist/navigation-instruments/gauge-radial/gauge-radial.d.ts +42 -7
- package/dist/navigation-instruments/gauge-radial/gauge-radial.d.ts.map +1 -1
- package/dist/navigation-instruments/gauge-radial/gauge-radial.js +178 -31
- package/dist/navigation-instruments/gauge-radial/gauge-radial.js.map +1 -1
- package/dist/navigation-instruments/readout/readout.css.js +7 -18
- package/dist/navigation-instruments/readout/readout.css.js.map +1 -1
- package/dist/navigation-instruments/readout/readout.d.ts +6 -7
- package/dist/navigation-instruments/readout/readout.d.ts.map +1 -1
- package/dist/navigation-instruments/readout/readout.js +54 -52
- package/dist/navigation-instruments/readout/readout.js.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js +9 -36
- package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts +8 -8
- package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.js +49 -42
- package/dist/navigation-instruments/readout-list-item/readout-list-item.js.map +1 -1
- package/dist/navigation-instruments/watch/tickmark.d.ts +2 -1
- package/dist/navigation-instruments/watch/tickmark.d.ts.map +1 -1
- package/dist/navigation-instruments/watch/tickmark.js +24 -4
- package/dist/navigation-instruments/watch/tickmark.js.map +1 -1
- package/dist/navigation-instruments/watch/watch.d.ts +23 -1
- package/dist/navigation-instruments/watch/watch.d.ts.map +1 -1
- package/dist/navigation-instruments/watch/watch.js +48 -20
- package/dist/navigation-instruments/watch/watch.js.map +1 -1
- package/dist/openbridge.css +155 -0
- package/dist/types.d.ts +7 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +18 -7
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/src/alert-severity.ts +225 -0
- package/src/ar/building-blocks/poi-header/poi-header.css +38 -7
- package/src/ar/building-blocks/poi-header/poi-header.ts +6 -1
- package/src/ar/poi-button/poi-button.css +126 -32
- package/src/ar/poi-button/poi-button.ts +16 -1
- package/src/ar/types.ts +5 -0
- package/src/automation/automation-badge/automation-badge.ts +124 -17
- package/src/automation/automation-button/abstract-automation-button-storybook-helpers.ts +5 -0
- package/src/automation/automation-button/abstract-automation-button.ts +21 -3
- package/src/automation/automation-button/automation-button.css +9 -4
- package/src/automation/automation-button/automation-button.ts +25 -7
- package/src/automation/automation-tank/automation-tank.stories.ts +22 -0
- package/src/automation/automation-tank/automation-tank.ts +12 -3
- package/src/building-blocks/instrument-radial/instrument-radial.stories.ts +21 -0
- package/src/building-blocks/instrument-radial/instrument-radial.ts +118 -21
- package/src/components/accordion-card/accordion-card.css +33 -0
- package/src/components/accordion-card/accordion-card.stories.ts +2 -1
- package/src/components/accordion-card/accordion-card.ts +3 -4
- package/src/components/alert-button/alert-button.css +89 -5
- package/src/components/alert-button/alert-button.stories.ts +43 -0
- package/src/components/alert-button/alert-button.ts +43 -32
- package/src/components/alert-frame/alert-frame.css +116 -29
- package/src/components/alert-frame/alert-frame.stories.ts +63 -3
- package/src/components/alert-frame/alert-frame.ts +114 -23
- package/src/components/alert-frame/critical-badge.ts +39 -0
- package/src/components/alert-frame/diagnostic-badge.ts +52 -0
- package/src/components/alert-icon/alert-icon.stories.ts +41 -0
- package/src/components/alert-icon/alert-icon.ts +101 -38
- package/src/components/alert-icon/icons/icon-critical.ts +23 -0
- package/src/components/alert-list-details/alert-list-details.stories.ts +67 -0
- package/src/components/alert-list-details/alert-list-details.ts +11 -10
- package/src/components/badge/badge.css +52 -2
- package/src/components/badge/badge.stories.ts +75 -0
- package/src/components/badge/badge.ts +70 -2
- package/src/main.css +1 -0
- package/src/manual-icon/icon-alerts-critical-twotone.ts +60 -0
- package/src/manual-icon/icon-alerts-diagnostic-twotone.ts +60 -0
- package/src/mixins/alert.css +29 -0
- package/src/navigation-instruments/gauge-radial/gauge-radial.css +85 -0
- package/src/navigation-instruments/gauge-radial/gauge-radial.stories.ts +149 -7
- package/src/navigation-instruments/gauge-radial/gauge-radial.ts +212 -33
- package/src/navigation-instruments/readout/readout.css +7 -24
- package/src/navigation-instruments/readout/readout.stories.ts +57 -4
- package/src/navigation-instruments/readout/readout.ts +69 -63
- package/src/navigation-instruments/readout-list-item/readout-list-item.css +9 -42
- package/src/navigation-instruments/readout-list-item/readout-list-item.stories.ts +57 -14
- package/src/navigation-instruments/readout-list-item/readout-list-item.ts +54 -44
- package/src/navigation-instruments/watch/tickmark.ts +33 -6
- package/src/navigation-instruments/watch/watch.ts +60 -25
- package/src/palettes/critical.md +95 -0
- package/src/palettes/manual.css +165 -0
- package/src/types.ts +20 -3
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {LitElement, html} from 'lit';
|
|
1
|
+
import {LitElement, html, nothing, unsafeCSS, type TemplateResult} from 'lit';
|
|
2
|
+
import {classMap} from 'lit/directives/class-map.js';
|
|
3
|
+
import componentStyle from './gauge-radial.css?inline';
|
|
2
4
|
import {customElement} from '../../decorator.js';
|
|
3
5
|
import {property} from 'lit/decorators.js';
|
|
4
6
|
import {AdviceType} from '../watch/advice.js';
|
|
@@ -6,6 +8,11 @@ import {InstrumentState, Priority} from '../types.js';
|
|
|
6
8
|
import {SetpointMixin} from '../../svghelpers/setpoint-mixin.js';
|
|
7
9
|
import '../../building-blocks/instrument-radial/instrument-radial.js';
|
|
8
10
|
import {TickmarkStyle} from '../watch/tickmark.js';
|
|
11
|
+
import '../readout/readout.js';
|
|
12
|
+
import {
|
|
13
|
+
ReadoutStackVerticalAlignment,
|
|
14
|
+
ReadoutVariant,
|
|
15
|
+
} from '../readout/readout.js';
|
|
9
16
|
|
|
10
17
|
export enum ObcGaugeRadialType {
|
|
11
18
|
filled = 'filled',
|
|
@@ -13,6 +20,13 @@ export enum ObcGaugeRadialType {
|
|
|
13
20
|
needle = 'needle',
|
|
14
21
|
}
|
|
15
22
|
|
|
23
|
+
export enum GaugeRadialSector {
|
|
24
|
+
deg270 = '270',
|
|
25
|
+
deg180 = '180',
|
|
26
|
+
deg90Left = '90-left',
|
|
27
|
+
deg90Right = '90-right',
|
|
28
|
+
}
|
|
29
|
+
|
|
16
30
|
export interface GaugeRadialAdvice {
|
|
17
31
|
minValue: number;
|
|
18
32
|
maxValue: number;
|
|
@@ -34,14 +48,17 @@ export interface GaugeRadialAdvice {
|
|
|
34
48
|
*
|
|
35
49
|
* - **Three display types**: `filled` (solid arc), `bar` (thinner arc), and
|
|
36
50
|
* `needle` (pointer indicator) via the `type` property.
|
|
37
|
-
* - **
|
|
38
|
-
*
|
|
51
|
+
* - **Sector sweep**: `sector` selects the arc span (`270`, `180`, `90-left`, or `90-right`).
|
|
52
|
+
* The configured `minValue..maxValue` always spans the full sector. For the
|
|
53
|
+
* centered sectors (`270`, `180`) a symmetric range places `0` at 12 o'clock;
|
|
54
|
+
* for `90-left`/`90-right` the range midpoint sits at the middle of the quadrant.
|
|
39
55
|
* - **Setpoint via mixin**: `setpoint`, `newSetpoint`, `touching`,
|
|
40
56
|
* `autoAtSetpointDeadband`, `setpointOverride`, and all other setpoint
|
|
41
57
|
* properties are provided by `SetpointMixin` and forwarded to the inner
|
|
42
58
|
* `<obc-instrument-radial>`.
|
|
43
59
|
* - **Advice zones**: Pass an array of {@link GaugeRadialAdvice} objects to
|
|
44
|
-
* render caution/alert arcs on the gauge.
|
|
60
|
+
* render caution/alert arcs on the gauge. Not shown on the `90-left` /
|
|
61
|
+
* `90-right` sectors.
|
|
45
62
|
*
|
|
46
63
|
* ## Usage Guidelines
|
|
47
64
|
*
|
|
@@ -50,6 +67,12 @@ export interface GaugeRadialAdvice {
|
|
|
50
67
|
* - Provide `primaryTickmarkInterval` and `secondaryTickmarkInterval` to
|
|
51
68
|
* control tickmark density.
|
|
52
69
|
* - Enable `showLabels` to show numeric labels at primary tickmarks.
|
|
70
|
+
* - Enable `showReadout` with optional `label` and `unit`. Layout depends on `sector`
|
|
71
|
+
* and `type`: **270** filled/bar — value at center + a label-only `meta` row in
|
|
72
|
+
* the bottom gap (two separate readouts); **180** filled/bar — a single centered
|
|
73
|
+
* stack (value + label/unit) at the bottom; **270** needle — bottom stack;
|
|
74
|
+
* **180** needle — no readout; **90-left** / **90-right** filled/bar — corner
|
|
75
|
+
* readout in a square host; **90** needle — no readout.
|
|
53
76
|
*
|
|
54
77
|
* ## Best Practices
|
|
55
78
|
*
|
|
@@ -66,7 +89,7 @@ export interface GaugeRadialAdvice {
|
|
|
66
89
|
* minValue="0"
|
|
67
90
|
* maxValue="100"
|
|
68
91
|
* type="filled"
|
|
69
|
-
* enhanced
|
|
92
|
+
* priority="enhanced"
|
|
70
93
|
* showLabels
|
|
71
94
|
* primaryTickmarkInterval="25"
|
|
72
95
|
* secondaryTickmarkInterval="5"
|
|
@@ -98,47 +121,203 @@ export class ObcGaugeRadial extends SetpointMixin(LitElement) {
|
|
|
98
121
|
@property({type: Boolean}) tickmarksInside: boolean = false;
|
|
99
122
|
@property({type: String}) tickmarkStyle: TickmarkStyle =
|
|
100
123
|
TickmarkStyle.regular;
|
|
124
|
+
/** Caution/alert arcs. Ignored on `sector: 90-left` / `90-right`. */
|
|
101
125
|
@property({type: Array, attribute: false}) advices: GaugeRadialAdvice[] = [];
|
|
126
|
+
@property({type: String, reflect: true}) sector: GaugeRadialSector =
|
|
127
|
+
GaugeRadialSector.deg270;
|
|
128
|
+
@property({type: Boolean}) showReadout = false;
|
|
129
|
+
@property({type: String}) label = '';
|
|
130
|
+
@property({type: String}) unit = '';
|
|
131
|
+
@property({type: Number}) fractionDigits = 0;
|
|
132
|
+
|
|
133
|
+
private get sectorAngles(): {sweep: number; start: number} {
|
|
134
|
+
switch (this.sector) {
|
|
135
|
+
case GaugeRadialSector.deg180:
|
|
136
|
+
return {sweep: 180, start: -90};
|
|
137
|
+
case GaugeRadialSector.deg90Left:
|
|
138
|
+
return {sweep: 90, start: -90};
|
|
139
|
+
case GaugeRadialSector.deg90Right:
|
|
140
|
+
return {sweep: 90, start: 0};
|
|
141
|
+
case GaugeRadialSector.deg270:
|
|
142
|
+
default:
|
|
143
|
+
return {sweep: 270, start: -135};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
102
146
|
|
|
103
|
-
|
|
147
|
+
/**
|
|
148
|
+
* Per-edge crop (%) of the shared, origin-centered 448 SVG box each sector
|
|
149
|
+
* shows. All sectors render at the same natural scale, so the dial stays the
|
|
150
|
+
* same size; the sector only windows a different part (270 whole, 180 wide,
|
|
151
|
+
* 90 a quadrant).
|
|
152
|
+
*/
|
|
153
|
+
private get sectorClips(): {
|
|
154
|
+
top: number;
|
|
155
|
+
bottom: number;
|
|
156
|
+
left: number;
|
|
157
|
+
right: number;
|
|
158
|
+
} {
|
|
159
|
+
switch (this.sector) {
|
|
160
|
+
case GaugeRadialSector.deg180:
|
|
161
|
+
return {top: 0, bottom: 44, left: 0, right: 0};
|
|
162
|
+
case GaugeRadialSector.deg90Left:
|
|
163
|
+
return {top: 0, bottom: 45, left: 0, right: 45};
|
|
164
|
+
case GaugeRadialSector.deg90Right:
|
|
165
|
+
return {top: 0, bottom: 45, left: 45, right: 0};
|
|
166
|
+
case GaugeRadialSector.deg270:
|
|
167
|
+
default:
|
|
168
|
+
return {top: 0, bottom: 0, left: 0, right: 0};
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
private get isSector90(): boolean {
|
|
173
|
+
return (
|
|
174
|
+
this.sector === GaugeRadialSector.deg90Left ||
|
|
175
|
+
this.sector === GaugeRadialSector.deg90Right
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Arrow form so `this` binds when passed as `.getAngle=${this.getAngle}`
|
|
180
|
+
// to <obc-instrument-radial>. Do not convert to a method.
|
|
181
|
+
getAngle = (v: number): number => {
|
|
182
|
+
const {sweep, start} = this.sectorAngles;
|
|
104
183
|
const span = this.maxValue - this.minValue;
|
|
105
184
|
if (!Number.isFinite(span) || span <= 0) {
|
|
106
|
-
return
|
|
185
|
+
return start;
|
|
107
186
|
}
|
|
108
187
|
|
|
109
|
-
return ((v - this.minValue) / span) *
|
|
188
|
+
return ((v - this.minValue) / span) * sweep + start;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
/** Renders one gauge readout; `withMeta`/`labelOnly` pick parts. */
|
|
192
|
+
private renderReadout({
|
|
193
|
+
className,
|
|
194
|
+
variant,
|
|
195
|
+
alignment = ReadoutStackVerticalAlignment.vertical,
|
|
196
|
+
withMeta = true,
|
|
197
|
+
labelOnly = false,
|
|
198
|
+
}: {
|
|
199
|
+
className: string;
|
|
200
|
+
variant: ReadoutVariant;
|
|
201
|
+
alignment?: ReadoutStackVerticalAlignment;
|
|
202
|
+
withMeta?: boolean;
|
|
203
|
+
labelOnly?: boolean;
|
|
204
|
+
}): TemplateResult {
|
|
205
|
+
// `labelOnly` already means "no value", so derive it instead of passing both.
|
|
206
|
+
const withValue = !labelOnly;
|
|
207
|
+
return html`
|
|
208
|
+
<obc-readout
|
|
209
|
+
class=${className}
|
|
210
|
+
direction="vertical"
|
|
211
|
+
?labelOnly=${labelOnly}
|
|
212
|
+
.variant=${variant}
|
|
213
|
+
.alignment=${alignment}
|
|
214
|
+
.valuePriority=${withValue ? this.priority : undefined}
|
|
215
|
+
.value=${withValue ? this.value : undefined}
|
|
216
|
+
.fractionDigits=${this.fractionDigits}
|
|
217
|
+
.label=${withMeta ? this.label : ''}
|
|
218
|
+
.unit=${withMeta ? this.unit : ''}
|
|
219
|
+
></obc-readout>
|
|
220
|
+
`;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
private renderReadouts() {
|
|
224
|
+
if (!this.showReadout) {
|
|
225
|
+
return nothing;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const isNeedle = this.type === ObcGaugeRadialType.needle;
|
|
229
|
+
const is90 = this.isSector90;
|
|
230
|
+
const is180 = this.sector === GaugeRadialSector.deg180;
|
|
231
|
+
|
|
232
|
+
if (isNeedle && (is180 || is90)) {
|
|
233
|
+
return nothing;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// 90 filled/bar: enhanced corner readout (bold value + label/unit).
|
|
237
|
+
if (is90) {
|
|
238
|
+
return this.renderReadout({
|
|
239
|
+
className: 'gauge-readout-meta',
|
|
240
|
+
variant: ReadoutVariant.enhanced,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// 270 needle and 180 filled/bar: centered stack (value weight follows `priority`).
|
|
245
|
+
if (isNeedle || is180) {
|
|
246
|
+
return this.renderReadout({
|
|
247
|
+
className: 'gauge-readout-meta',
|
|
248
|
+
variant: ReadoutVariant.stack,
|
|
249
|
+
alignment: ReadoutStackVerticalAlignment.center,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// 270 filled/bar: the value sits at the circle center and the label/unit row
|
|
254
|
+
// lower in the bottom gap, so they are two separately-positioned readouts.
|
|
255
|
+
return html`
|
|
256
|
+
${this.renderReadout({
|
|
257
|
+
className: 'gauge-readout-value',
|
|
258
|
+
variant: ReadoutVariant.enhanced,
|
|
259
|
+
withMeta: false,
|
|
260
|
+
})}
|
|
261
|
+
${this.label || this.unit
|
|
262
|
+
? this.renderReadout({
|
|
263
|
+
className: 'gauge-readout-meta',
|
|
264
|
+
variant: ReadoutVariant.stack,
|
|
265
|
+
alignment: ReadoutStackVerticalAlignment.center,
|
|
266
|
+
labelOnly: true,
|
|
267
|
+
})
|
|
268
|
+
: nothing}
|
|
269
|
+
`;
|
|
110
270
|
}
|
|
111
271
|
|
|
112
272
|
override render() {
|
|
273
|
+
const clips = this.sectorClips;
|
|
113
274
|
return html`
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
.touching=${this.touching}
|
|
123
|
-
.autoAtSetpoint=${this.autoAtSetpoint}
|
|
124
|
-
.autoAtSetpointDeadband=${this.autoAtSetpointDeadband}
|
|
125
|
-
.animateSetpoint=${this.animateSetpoint}
|
|
126
|
-
.maxValue=${this.maxValue}
|
|
127
|
-
.minValue=${this.minValue}
|
|
128
|
-
.getAngle=${this.getAngle}
|
|
129
|
-
.showLabels=${this.showLabels}
|
|
130
|
-
.primaryTickmarkInterval=${this.primaryTickmarkInterval}
|
|
131
|
-
.secondaryTickmarkInterval=${this.secondaryTickmarkInterval}
|
|
132
|
-
.tertiaryTickmarkInterval=${this.tertiaryTickmarkInterval}
|
|
133
|
-
.type=${this.type}
|
|
134
|
-
.needleType=${this.type}
|
|
135
|
-
.tickmarksInside=${this.tickmarksInside}
|
|
136
|
-
.tickmarkStyle=${this.tickmarkStyle}
|
|
137
|
-
.advices=${this.advices}
|
|
275
|
+
<div
|
|
276
|
+
class=${classMap({
|
|
277
|
+
'gauge-radial-root': true,
|
|
278
|
+
'type-needle': this.type === ObcGaugeRadialType.needle,
|
|
279
|
+
'sector-180': this.sector === GaugeRadialSector.deg180,
|
|
280
|
+
'sector-90-left': this.sector === GaugeRadialSector.deg90Left,
|
|
281
|
+
'sector-90-right': this.sector === GaugeRadialSector.deg90Right,
|
|
282
|
+
})}
|
|
138
283
|
>
|
|
139
|
-
|
|
284
|
+
<obc-instrument-radial
|
|
285
|
+
.value=${this.value}
|
|
286
|
+
.state=${this.state}
|
|
287
|
+
.priority=${this.priority}
|
|
288
|
+
.setpoint=${this.setpoint}
|
|
289
|
+
.newSetpoint=${this.newSetpoint}
|
|
290
|
+
.setpointAtZeroDeadband=${this.setpointAtZeroDeadband}
|
|
291
|
+
.setpointOverride=${this.setpointOverride}
|
|
292
|
+
.touching=${this.touching}
|
|
293
|
+
.autoAtSetpoint=${this.autoAtSetpoint}
|
|
294
|
+
.autoAtSetpointDeadband=${this.autoAtSetpointDeadband}
|
|
295
|
+
.animateSetpoint=${this.animateSetpoint}
|
|
296
|
+
.maxValue=${this.maxValue}
|
|
297
|
+
.minValue=${this.minValue}
|
|
298
|
+
.getAngle=${this.getAngle}
|
|
299
|
+
.showLabels=${this.showLabels}
|
|
300
|
+
.primaryTickmarkInterval=${this.primaryTickmarkInterval}
|
|
301
|
+
.secondaryTickmarkInterval=${this.secondaryTickmarkInterval}
|
|
302
|
+
.tertiaryTickmarkInterval=${this.tertiaryTickmarkInterval}
|
|
303
|
+
.type=${this.type}
|
|
304
|
+
.needleType=${this.type}
|
|
305
|
+
.tickmarksInside=${this.tickmarksInside}
|
|
306
|
+
.tickmarkStyle=${this.tickmarkStyle}
|
|
307
|
+
.advices=${this.isSector90 ? [] : this.advices}
|
|
308
|
+
.clipTop=${clips.top}
|
|
309
|
+
.clipBottom=${clips.bottom}
|
|
310
|
+
.clipLeft=${clips.left}
|
|
311
|
+
.clipRight=${clips.right}
|
|
312
|
+
.endLabelsMaxMin=${this.sector === GaugeRadialSector.deg180}
|
|
313
|
+
>
|
|
314
|
+
</obc-instrument-radial>
|
|
315
|
+
${this.renderReadouts()}
|
|
316
|
+
</div>
|
|
140
317
|
`;
|
|
141
318
|
}
|
|
319
|
+
|
|
320
|
+
static override styles = unsafeCSS(componentStyle);
|
|
142
321
|
}
|
|
143
322
|
|
|
144
323
|
declare global {
|
|
@@ -34,43 +34,22 @@
|
|
|
34
34
|
grid-template-areas: "meta";
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
&:is(
|
|
38
|
-
.alert-low-integrity,
|
|
39
|
-
.alert-invalid,
|
|
40
|
-
.alert-caution,
|
|
41
|
-
.alert-warning,
|
|
42
|
-
.alert-alarm
|
|
43
|
-
) {
|
|
37
|
+
&:is(.data-low-integrity, .data-invalid) {
|
|
44
38
|
border-width: 1px;
|
|
45
39
|
border-style: solid;
|
|
46
40
|
border-radius: var(--global-border-radius-border-radius-base);
|
|
47
41
|
}
|
|
48
42
|
|
|
49
|
-
&.
|
|
43
|
+
&.data-low-integrity {
|
|
50
44
|
background: var(--alert-low-integrity-background-color);
|
|
51
45
|
border-color: var(--alert-low-integrity-border-color);
|
|
52
46
|
}
|
|
53
47
|
|
|
54
|
-
&.
|
|
48
|
+
&.data-invalid {
|
|
55
49
|
background: var(--alert-invalid-background-color);
|
|
56
50
|
border-color: var(--alert-invalid-border-color);
|
|
57
51
|
}
|
|
58
52
|
|
|
59
|
-
&.alert-caution {
|
|
60
|
-
background: var(--alert-caution-container-background-color);
|
|
61
|
-
border-color: var(--alert-caution-container-border-color);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
&.alert-warning {
|
|
65
|
-
background: var(--alert-warning-container-background-color);
|
|
66
|
-
border-color: var(--alert-warning-container-border-color);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
&.alert-alarm {
|
|
70
|
-
background: var(--alert-alarm-container-background-color);
|
|
71
|
-
border-color: var(--alert-alarm-container-border-color);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
53
|
&.stack {
|
|
75
54
|
padding-bottom: calc(
|
|
76
55
|
var(--obc-readout-padding-horizontal-safe) +
|
|
@@ -423,6 +402,10 @@
|
|
|
423
402
|
text-align: center;
|
|
424
403
|
}
|
|
425
404
|
|
|
405
|
+
.readout.stack.vertical.alignment-center .instrument-label-unit-container {
|
|
406
|
+
align-items: center;
|
|
407
|
+
}
|
|
408
|
+
|
|
426
409
|
.readout.stack.vertical.alignment-vertical {
|
|
427
410
|
justify-items: end;
|
|
428
411
|
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
ReadoutDirection,
|
|
11
11
|
ReadoutSetpointInteraction,
|
|
12
|
-
|
|
12
|
+
ReadoutDataState,
|
|
13
13
|
ReadoutVariant,
|
|
14
14
|
ReadoutStackVerticalAlignment,
|
|
15
15
|
} from './readout.js';
|
|
@@ -19,6 +19,12 @@ import {
|
|
|
19
19
|
ReadoutAdviceFormat,
|
|
20
20
|
ReadoutAdviceState,
|
|
21
21
|
} from '../readout-advice/readout-advice.js';
|
|
22
|
+
import {AlertType} from '../../types.js';
|
|
23
|
+
import {
|
|
24
|
+
ObcAlertFrameMode,
|
|
25
|
+
ObcAlertFrameThickness,
|
|
26
|
+
ObcAlertFrameType,
|
|
27
|
+
} from '../../components/alert-frame/alert-frame.js';
|
|
22
28
|
|
|
23
29
|
const meta: Meta<ObcReadout> = {
|
|
24
30
|
title: 'Instruments/Readout',
|
|
@@ -57,11 +63,11 @@ const meta: Meta<ObcReadout> = {
|
|
|
57
63
|
},
|
|
58
64
|
options: Object.values(Priority),
|
|
59
65
|
},
|
|
60
|
-
|
|
66
|
+
dataState: {
|
|
61
67
|
control: {
|
|
62
68
|
type: 'select',
|
|
63
69
|
},
|
|
64
|
-
options: Object.values(
|
|
70
|
+
options: Object.values(ReadoutDataState),
|
|
65
71
|
},
|
|
66
72
|
setpointInteraction: {
|
|
67
73
|
control: {
|
|
@@ -193,7 +199,7 @@ function renderComponent(args: ObcReadout): TemplateResult {
|
|
|
193
199
|
<obc-readout
|
|
194
200
|
.variant=${args.variant}
|
|
195
201
|
.valuePriority=${args.valuePriority}
|
|
196
|
-
.
|
|
202
|
+
.dataState=${args.dataState}
|
|
197
203
|
.direction=${args.direction}
|
|
198
204
|
.setpointInteraction=${args.setpointInteraction}
|
|
199
205
|
.setpointSize=${args.setpointSize}
|
|
@@ -219,6 +225,7 @@ function renderComponent(args: ObcReadout): TemplateResult {
|
|
|
219
225
|
.fractionDigits=${args.fractionDigits}
|
|
220
226
|
.alignment=${args.alignment}
|
|
221
227
|
.off=${args.off}
|
|
228
|
+
.alert=${args.alert}
|
|
222
229
|
>
|
|
223
230
|
</obc-readout>
|
|
224
231
|
`;
|
|
@@ -252,3 +259,49 @@ export const Center: Story = {
|
|
|
252
259
|
|
|
253
260
|
render: (args) => renderComponent(args as ObcReadout),
|
|
254
261
|
};
|
|
262
|
+
|
|
263
|
+
export const DataLowIntegrity: Story = {
|
|
264
|
+
args: {
|
|
265
|
+
value: 42,
|
|
266
|
+
label: 'RPM',
|
|
267
|
+
unit: 'rpm',
|
|
268
|
+
dataState: ReadoutDataState.lowIntegrity,
|
|
269
|
+
},
|
|
270
|
+
render: (args) => renderComponent(args as ObcReadout),
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
export const DataInvalid: Story = {
|
|
274
|
+
args: {
|
|
275
|
+
value: 42,
|
|
276
|
+
label: 'RPM',
|
|
277
|
+
unit: 'rpm',
|
|
278
|
+
dataState: ReadoutDataState.invalid,
|
|
279
|
+
},
|
|
280
|
+
render: (args) => renderComponent(args as ObcReadout),
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
export const Alarm: Story = {
|
|
284
|
+
args: {
|
|
285
|
+
value: 42,
|
|
286
|
+
label: 'RPM',
|
|
287
|
+
unit: 'rpm',
|
|
288
|
+
alert: {
|
|
289
|
+
status: 'alarm',
|
|
290
|
+
mode: 'acked-active',
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
render: (args) => renderComponent(args as ObcReadout),
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
export const IsaCritical: Story = {
|
|
297
|
+
args: {
|
|
298
|
+
value: 42,
|
|
299
|
+
label: 'RPM',
|
|
300
|
+
unit: 'rpm',
|
|
301
|
+
alert: {
|
|
302
|
+
status: 'isa-critical',
|
|
303
|
+
mode: 'unacked-active',
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
render: (args) => renderComponent(args as ObcReadout),
|
|
307
|
+
};
|
|
@@ -34,6 +34,10 @@ import {
|
|
|
34
34
|
ReadoutSetpointSize,
|
|
35
35
|
} from '../readout-setpoint/readout-setpoint.js';
|
|
36
36
|
import '../readout-setpoint/readout-setpoint.js';
|
|
37
|
+
import {
|
|
38
|
+
type AlertFrameConfig,
|
|
39
|
+
wrapWithAlertFrame,
|
|
40
|
+
} from '../../components/alert-frame/alert-frame.js';
|
|
37
41
|
|
|
38
42
|
export enum ReadoutVariant {
|
|
39
43
|
regular = 'regular',
|
|
@@ -41,13 +45,10 @@ export enum ReadoutVariant {
|
|
|
41
45
|
stack = 'stack',
|
|
42
46
|
}
|
|
43
47
|
|
|
44
|
-
export enum
|
|
48
|
+
export enum ReadoutDataState {
|
|
45
49
|
none = 'none',
|
|
46
50
|
lowIntegrity = 'low-integrity',
|
|
47
51
|
invalid = 'invalid',
|
|
48
|
-
caution = 'caution',
|
|
49
|
-
warning = 'warning',
|
|
50
|
-
alarm = 'alarm',
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
export enum ReadoutSetpointInteraction {
|
|
@@ -123,8 +124,7 @@ export class ObcReadout extends LitElement {
|
|
|
123
124
|
@property({type: String}) src?: string;
|
|
124
125
|
@property({type: Boolean}) off = false;
|
|
125
126
|
@property({type: String}) valuePriority?: Priority;
|
|
126
|
-
@property({type: String})
|
|
127
|
-
ReadoutAlertState.none;
|
|
127
|
+
@property({type: String}) dataState: ReadoutDataState = ReadoutDataState.none;
|
|
128
128
|
@property({type: String}) setpointInteraction: ReadoutSetpointInteraction =
|
|
129
129
|
ReadoutSetpointInteraction.alwaysVisible;
|
|
130
130
|
@property({type: String}) direction: ReadoutDirection =
|
|
@@ -161,6 +161,8 @@ export class ObcReadout extends LitElement {
|
|
|
161
161
|
@property({type: String}) sourceType?: ReadoutSourceType;
|
|
162
162
|
@property({type: Boolean}) hasLeadingIcon = false;
|
|
163
163
|
|
|
164
|
+
@property({type: Object}) alert: AlertFrameConfig | boolean = false;
|
|
165
|
+
|
|
164
166
|
@property({type: Boolean, attribute: false}) sourceHug = true;
|
|
165
167
|
@property({type: Boolean}) hasSourceLeadingIcon = false;
|
|
166
168
|
@property({type: Boolean, attribute: false}) hasSourceTrailingIcon = true;
|
|
@@ -1033,63 +1035,67 @@ export class ObcReadout extends LitElement {
|
|
|
1033
1035
|
}
|
|
1034
1036
|
|
|
1035
1037
|
override render() {
|
|
1036
|
-
return
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
this.
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
this.
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
this.
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1038
|
+
return wrapWithAlertFrame(
|
|
1039
|
+
this.alert,
|
|
1040
|
+
html`
|
|
1041
|
+
<div
|
|
1042
|
+
class=${classMap({
|
|
1043
|
+
readout: true,
|
|
1044
|
+
[this.variant]: true,
|
|
1045
|
+
[this.direction]: true,
|
|
1046
|
+
'alignment-left': this.alignment === 'left',
|
|
1047
|
+
'alignment-center': this.alignment === 'center',
|
|
1048
|
+
'alignment-vertical': this.alignment === 'vertical',
|
|
1049
|
+
'interaction-always-visible':
|
|
1050
|
+
this.interactionMode === ReadoutSetpointInteraction.alwaysVisible,
|
|
1051
|
+
'interaction-flip-flop':
|
|
1052
|
+
this.setpointInteractionEnabled &&
|
|
1053
|
+
this.interactionMode === ReadoutSetpointInteraction.flipFlop,
|
|
1054
|
+
'interaction-pop-up':
|
|
1055
|
+
this.setpointInteractionEnabled &&
|
|
1056
|
+
this.interactionMode === ReadoutSetpointInteraction.popUp,
|
|
1057
|
+
'focus-setpoint':
|
|
1058
|
+
this.setpointInteractionEnabled && this.flipFlopSetpointFocused,
|
|
1059
|
+
'focus-value':
|
|
1060
|
+
this.setpointInteractionEnabled && this.flipFlopValueFocused,
|
|
1061
|
+
'data-none': this.dataState === ReadoutDataState.none,
|
|
1062
|
+
'data-low-integrity':
|
|
1063
|
+
this.dataState === ReadoutDataState.lowIntegrity,
|
|
1064
|
+
'data-invalid': this.dataState === ReadoutDataState.invalid,
|
|
1065
|
+
'has-source': this.hasSrc,
|
|
1066
|
+
'has-setpoint': this.hasSetpoint,
|
|
1067
|
+
'has-setpoint-button':
|
|
1068
|
+
this.isHorizontal &&
|
|
1069
|
+
this.setpointFormat === ReadoutSetpointFormat.button,
|
|
1070
|
+
'no-hug': !this.hug,
|
|
1071
|
+
'label-only': this.labelOnly,
|
|
1072
|
+
})}
|
|
1073
|
+
>
|
|
1074
|
+
${!this.labelOnly && this.isVertical ? this.renderAdvice() : nothing}
|
|
1075
|
+
${!this.labelOnly && this.isVertical
|
|
1076
|
+
? this.renderSetpoint()
|
|
1077
|
+
: nothing}
|
|
1078
|
+
${!this.labelOnly && this.isVertical
|
|
1079
|
+
? this.renderValueZone()
|
|
1080
|
+
: nothing}
|
|
1081
|
+
${(this.labelOnly || this.isVertical) &&
|
|
1082
|
+
this.shouldRenderReadoutMetaZone
|
|
1083
|
+
? renderReadoutMetaZone({
|
|
1084
|
+
labelValue: this.label,
|
|
1085
|
+
unitValue: this.unit,
|
|
1086
|
+
})
|
|
1087
|
+
: nothing}
|
|
1088
|
+
${!this.labelOnly && this.hasSrc && this.isVertical
|
|
1089
|
+
? this.renderSource()
|
|
1090
|
+
: nothing}
|
|
1091
|
+
${!this.labelOnly && this.isHorizontal
|
|
1092
|
+
? this.renderHorizontalLayout()
|
|
1093
|
+
: nothing}
|
|
1094
|
+
${this.renderSourcePickerSlot()}
|
|
1095
|
+
</div>
|
|
1096
|
+
${this.renderSourcePickerContent()}
|
|
1097
|
+
`
|
|
1098
|
+
);
|
|
1093
1099
|
}
|
|
1094
1100
|
|
|
1095
1101
|
static override styles = unsafeCSS(componentStyle);
|