@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
|
@@ -21,6 +21,10 @@ import {
|
|
|
21
21
|
type ZoomToFitArcFrame,
|
|
22
22
|
} from '../../svghelpers/arc-frame.js';
|
|
23
23
|
|
|
24
|
+
// Must match obc-watch's un-zoomed viewBox `(176 + getPadding()) * 2`
|
|
25
|
+
// (default padding 48 → 448); instrument-radial overlays obc-watch 1:1.
|
|
26
|
+
const WATCH_DEFAULT_VIEWBOX = 448;
|
|
27
|
+
|
|
24
28
|
export enum ObcGaugeRadialType {
|
|
25
29
|
filled = 'filled',
|
|
26
30
|
bar = 'bar',
|
|
@@ -34,6 +38,11 @@ export interface GaugeRadialAdvice {
|
|
|
34
38
|
hinted: boolean;
|
|
35
39
|
}
|
|
36
40
|
|
|
41
|
+
const NEEDLE_TIP_RADIUS = 160;
|
|
42
|
+
const NEEDLE_TIP_GAP = 5; // tip stops this far short of the scale
|
|
43
|
+
const NEEDLE_WIDTH = 8;
|
|
44
|
+
const NEEDLE_HUB_RADIUS = 16;
|
|
45
|
+
|
|
37
46
|
function rangeIncludesZero(minValue: number, maxValue: number): boolean {
|
|
38
47
|
return minValue <= 0 && maxValue >= 0;
|
|
39
48
|
}
|
|
@@ -55,6 +64,56 @@ function strongerTickmarkType(
|
|
|
55
64
|
return priority[candidate] > priority[existing] ? candidate : existing;
|
|
56
65
|
}
|
|
57
66
|
|
|
67
|
+
interface Clips {
|
|
68
|
+
top: number;
|
|
69
|
+
bottom: number;
|
|
70
|
+
left: number;
|
|
71
|
+
right: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Clamp a clip percentage to [0, 100]; non-finite returns 0. */
|
|
75
|
+
function clampClipPercent(n: number): number {
|
|
76
|
+
return Number.isFinite(n) ? Math.min(Math.max(n, 0), 100) : 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Clamp the four clips to [0, 100] and drop any opposite pair that would
|
|
81
|
+
* collapse the viewBox (sum >= 100), so a bad clip can't produce a zero- or
|
|
82
|
+
* negative-size box. Valid clips pass through unchanged.
|
|
83
|
+
*/
|
|
84
|
+
function normalizeClips(clips: Clips): Clips {
|
|
85
|
+
let top = clampClipPercent(clips.top);
|
|
86
|
+
let bottom = clampClipPercent(clips.bottom);
|
|
87
|
+
let left = clampClipPercent(clips.left);
|
|
88
|
+
let right = clampClipPercent(clips.right);
|
|
89
|
+
if (top + bottom >= 100) {
|
|
90
|
+
top = 0;
|
|
91
|
+
bottom = 0;
|
|
92
|
+
}
|
|
93
|
+
if (left + right >= 100) {
|
|
94
|
+
left = 0;
|
|
95
|
+
right = 0;
|
|
96
|
+
}
|
|
97
|
+
return {top, bottom, left, right};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Fallback value-to-angle mapping when no `getAngle` is supplied: linear over
|
|
102
|
+
* the historical 270° sweep (-135 to 135). Returns -135 for a non-positive or
|
|
103
|
+
* non-finite span.
|
|
104
|
+
*/
|
|
105
|
+
function defaultGaugeAngle(
|
|
106
|
+
value: number,
|
|
107
|
+
minValue: number,
|
|
108
|
+
maxValue: number
|
|
109
|
+
): number {
|
|
110
|
+
const span = maxValue - minValue;
|
|
111
|
+
if (!Number.isFinite(span) || span <= 0) {
|
|
112
|
+
return -135;
|
|
113
|
+
}
|
|
114
|
+
return ((value - minValue) / span) * 270 - 135;
|
|
115
|
+
}
|
|
116
|
+
|
|
58
117
|
@customElement('obc-instrument-radial')
|
|
59
118
|
export class ObcInstrumentRadial extends SetpointMixin(LitElement) {
|
|
60
119
|
// setpoint, newSetpoint, atSetpoint, touching, autoAtSetpoint,
|
|
@@ -97,6 +156,14 @@ export class ObcInstrumentRadial extends SetpointMixin(LitElement) {
|
|
|
97
156
|
@property({type: Array, attribute: false}) advices: GaugeRadialAdvice[] = [];
|
|
98
157
|
@property({type: Number}) clipTop: number = 0; // in percent of height
|
|
99
158
|
@property({type: Number}) clipBottom: number = 0; // in percent of height
|
|
159
|
+
@property({type: Number}) clipLeft: number = 0; // in percent of width
|
|
160
|
+
@property({type: Number}) clipRight: number = 0; // in percent of width
|
|
161
|
+
/**
|
|
162
|
+
* Place the horizontal end labels (±90°, e.g. min/max) below the tick instead
|
|
163
|
+
* of beside it — the "Max-min" placement from the radial label model
|
|
164
|
+
* (External / Internal / Max-min). See PR #903 / design discussion.
|
|
165
|
+
*/
|
|
166
|
+
@property({type: Boolean}) endLabelsMaxMin: boolean = false;
|
|
100
167
|
@property({type: Boolean}) zoomToFitArc: boolean = false;
|
|
101
168
|
|
|
102
169
|
private _radiusOffset = 0;
|
|
@@ -109,11 +176,33 @@ export class ObcInstrumentRadial extends SetpointMixin(LitElement) {
|
|
|
109
176
|
}
|
|
110
177
|
|
|
111
178
|
private get minAngle(): number {
|
|
112
|
-
return this.
|
|
179
|
+
return this.mapAngle(this.minValue);
|
|
113
180
|
}
|
|
114
181
|
|
|
115
182
|
private get maxAngle(): number {
|
|
116
|
-
return this.
|
|
183
|
+
return this.mapAngle(this.maxValue);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Map a value to an angle via the consumer's `getAngle`, guarding a missing
|
|
187
|
+
// or non-finite mapping so a misconfigured consumer can't emit NaN geometry.
|
|
188
|
+
private mapAngle(value: number): number {
|
|
189
|
+
const fn = this.getAngle;
|
|
190
|
+
const angle =
|
|
191
|
+
typeof fn === 'function'
|
|
192
|
+
? fn(value)
|
|
193
|
+
: defaultGaugeAngle(value, this.minValue, this.maxValue);
|
|
194
|
+
return Number.isFinite(angle) ? angle : 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Clamped clips, reused for the overlay viewBox and the clips forwarded to
|
|
198
|
+
// obc-watch.
|
|
199
|
+
private get safeClips(): Clips {
|
|
200
|
+
return normalizeClips({
|
|
201
|
+
top: this.clipTop,
|
|
202
|
+
bottom: this.clipBottom,
|
|
203
|
+
left: this.clipLeft,
|
|
204
|
+
right: this.clipRight,
|
|
205
|
+
});
|
|
117
206
|
}
|
|
118
207
|
|
|
119
208
|
private get _derivedNeedleColor(): string {
|
|
@@ -150,10 +239,10 @@ export class ObcInstrumentRadial extends SetpointMixin(LitElement) {
|
|
|
150
239
|
const barStartValue = Math.max(this.minValue, Math.min(0, this.maxValue));
|
|
151
240
|
const value = this.clampedValue;
|
|
152
241
|
const setpointAngle =
|
|
153
|
-
this.setpoint !== undefined ? this.
|
|
242
|
+
this.setpoint !== undefined ? this.mapAngle(this.setpoint) : undefined;
|
|
154
243
|
const newSetpointAngle =
|
|
155
244
|
this.newSetpoint !== undefined
|
|
156
|
-
? this.
|
|
245
|
+
? this.mapAngle(this.newSetpoint)
|
|
157
246
|
: undefined;
|
|
158
247
|
|
|
159
248
|
const barAreas =
|
|
@@ -161,8 +250,8 @@ export class ObcInstrumentRadial extends SetpointMixin(LitElement) {
|
|
|
161
250
|
? []
|
|
162
251
|
: [
|
|
163
252
|
{
|
|
164
|
-
startAngle: this.
|
|
165
|
-
endAngle: this.
|
|
253
|
+
startAngle: this.mapAngle(barStartValue),
|
|
254
|
+
endAngle: this.mapAngle(value),
|
|
166
255
|
fillColor: barColor,
|
|
167
256
|
},
|
|
168
257
|
];
|
|
@@ -181,6 +270,7 @@ export class ObcInstrumentRadial extends SetpointMixin(LitElement) {
|
|
|
181
270
|
? WatchCircleType.single
|
|
182
271
|
: WatchCircleType.double;
|
|
183
272
|
|
|
273
|
+
const clips = this.safeClips;
|
|
184
274
|
let viewBox: string;
|
|
185
275
|
if (this.zoomToFitArc) {
|
|
186
276
|
const ext = 48;
|
|
@@ -192,16 +282,18 @@ export class ObcInstrumentRadial extends SetpointMixin(LitElement) {
|
|
|
192
282
|
extension: ext,
|
|
193
283
|
targetSize,
|
|
194
284
|
});
|
|
195
|
-
viewBox = frame.viewBox;
|
|
196
285
|
this._radiusOffset = frame.radiusOffset;
|
|
286
|
+
viewBox = frame.viewBox;
|
|
197
287
|
this._arcFrame = frame;
|
|
198
288
|
} else {
|
|
199
289
|
this._radiusOffset = 0;
|
|
200
290
|
this._arcFrame = undefined;
|
|
201
|
-
const
|
|
202
|
-
const
|
|
203
|
-
const
|
|
204
|
-
|
|
291
|
+
const full = WATCH_DEFAULT_VIEWBOX;
|
|
292
|
+
const w = full * (1 - clips.left / 100 - clips.right / 100);
|
|
293
|
+
const h = full * (1 - clips.top / 100 - clips.bottom / 100);
|
|
294
|
+
const left = -full / 2 + (full * clips.left) / 100;
|
|
295
|
+
const top = -full / 2 + (full * clips.top) / 100;
|
|
296
|
+
viewBox = `${left} ${top} ${w} ${h}`;
|
|
205
297
|
}
|
|
206
298
|
|
|
207
299
|
return html`
|
|
@@ -223,8 +315,11 @@ export class ObcInstrumentRadial extends SetpointMixin(LitElement) {
|
|
|
223
315
|
.areas=${areas}
|
|
224
316
|
.watchCircleType=${watchCircleType}
|
|
225
317
|
.barAreas=${barAreas}
|
|
226
|
-
.clipTop=${this.zoomToFitArc ? 0 :
|
|
227
|
-
.clipBottom=${this.zoomToFitArc ? 0 :
|
|
318
|
+
.clipTop=${this.zoomToFitArc ? 0 : clips.top}
|
|
319
|
+
.clipBottom=${this.zoomToFitArc ? 0 : clips.bottom}
|
|
320
|
+
.clipLeft=${this.zoomToFitArc ? 0 : clips.left}
|
|
321
|
+
.clipRight=${this.zoomToFitArc ? 0 : clips.right}
|
|
322
|
+
.endLabelsMaxMin=${this.endLabelsMaxMin}
|
|
228
323
|
.zoomToFitArc=${this.zoomToFitArc}
|
|
229
324
|
.arcFrame=${this._arcFrame}
|
|
230
325
|
></obc-watch>
|
|
@@ -241,14 +336,16 @@ export class ObcInstrumentRadial extends SetpointMixin(LitElement) {
|
|
|
241
336
|
const rOff = this._radiusOffset;
|
|
242
337
|
const value = this.clampedValue;
|
|
243
338
|
if (this.type === ObcGaugeRadialType.needle) {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
339
|
+
// Rod runs from the value tip down to the center hub. Width is constant;
|
|
340
|
+
// the tip shifts outward additively under zoom.
|
|
341
|
+
const tipY = 256 - (NEEDLE_TIP_RADIUS - NEEDLE_TIP_GAP) - rOff;
|
|
342
|
+
return svg`<g transform="rotate(${this.mapAngle(value)}) translate(-256, -256)">
|
|
343
|
+
<rect x="${256 - NEEDLE_WIDTH / 2}" y="${tipY}" width="${NEEDLE_WIDTH}" height="${256 - tipY}" rx="${NEEDLE_WIDTH / 2}" fill=${needleColor} stroke=${needleColor}/>
|
|
344
|
+
<circle cx="256" cy="256" r="${NEEDLE_HUB_RADIUS}" fill=${needleColor}/>
|
|
248
345
|
</g>
|
|
249
346
|
`;
|
|
250
347
|
} else {
|
|
251
|
-
return svg`<g transform="rotate(${this.
|
|
348
|
+
return svg`<g transform="rotate(${this.mapAngle(value)}) translate(-256, -256)">
|
|
252
349
|
<rect x="252" y="${96 - rOff}" width="8" height="48" rx="4" fill=${needleColor} stroke="var(--border-silhouette-color)"/>
|
|
253
350
|
</g>
|
|
254
351
|
`;
|
|
@@ -284,7 +381,7 @@ export class ObcInstrumentRadial extends SetpointMixin(LitElement) {
|
|
|
284
381
|
}
|
|
285
382
|
|
|
286
383
|
tickmarksByValue.set(normalizedValue, {
|
|
287
|
-
angle: this.
|
|
384
|
+
angle: this.mapAngle(normalizedValue),
|
|
288
385
|
type,
|
|
289
386
|
text,
|
|
290
387
|
});
|
|
@@ -370,8 +467,8 @@ export class ObcInstrumentRadial extends SetpointMixin(LitElement) {
|
|
|
370
467
|
const value = this.clampedValue;
|
|
371
468
|
|
|
372
469
|
return this.advices.map((advice) => {
|
|
373
|
-
const minAngle = this.
|
|
374
|
-
const maxAngle = this.
|
|
470
|
+
const minAngle = this.mapAngle(advice.minValue);
|
|
471
|
+
const maxAngle = this.mapAngle(advice.maxValue);
|
|
375
472
|
let state = advice.hinted ? AdviceState.hinted : AdviceState.regular;
|
|
376
473
|
if (value >= advice.minValue && value <= advice.maxValue) {
|
|
377
474
|
state = AdviceState.triggered;
|
|
@@ -205,4 +205,37 @@
|
|
|
205
205
|
|
|
206
206
|
.alert {
|
|
207
207
|
pointer-events: none;
|
|
208
|
+
|
|
209
|
+
/* z-index follows ALERT_SEVERITY_PRIORITY: more severe statuses stack on top. */
|
|
210
|
+
&.alert-isa-critical {
|
|
211
|
+
z-index: 8;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
&.alert-alarm {
|
|
215
|
+
z-index: 7;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
&.alert-isa-high {
|
|
219
|
+
z-index: 6;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
&.alert-warning {
|
|
223
|
+
z-index: 5;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&.alert-isa-medium {
|
|
227
|
+
z-index: 4;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&.alert-caution {
|
|
231
|
+
z-index: 3;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
&.alert-isa-low {
|
|
235
|
+
z-index: 2;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
&.alert-isa-diagnostic {
|
|
239
|
+
z-index: 1;
|
|
240
|
+
}
|
|
208
241
|
}
|
|
@@ -229,7 +229,7 @@ export const Multiple: Story = {
|
|
|
229
229
|
.size="${AccordionSize.SingleLine}"
|
|
230
230
|
.position="${Position.top}"
|
|
231
231
|
.hasAlert=${true}
|
|
232
|
-
.alertFrameStatus="${ObcAlertFrameStatus.
|
|
232
|
+
.alertFrameStatus="${ObcAlertFrameStatus.Alarm}"
|
|
233
233
|
>
|
|
234
234
|
<div slot="expanded-content">Placeholder text</div>
|
|
235
235
|
</obc-accordion-card>
|
|
@@ -241,6 +241,7 @@ export const Multiple: Story = {
|
|
|
241
241
|
.hasDescription=${true}
|
|
242
242
|
.position="${Position.center}"
|
|
243
243
|
.hasAlert=${true}
|
|
244
|
+
.alertFrameStatus="${ObcAlertFrameStatus.Warning}"
|
|
244
245
|
>
|
|
245
246
|
<div slot="expanded-content">Placeholder text</div>
|
|
246
247
|
</obc-accordion-card>
|
|
@@ -7,10 +7,10 @@ import '../../icons/icon-chevron-up-google.js';
|
|
|
7
7
|
import '../../icons/icon-chevron-down-google.js';
|
|
8
8
|
import '../alert-frame/alert-frame.js';
|
|
9
9
|
import {
|
|
10
|
-
ObcAlertFrameStatus,
|
|
11
10
|
ObcAlertFrameThickness,
|
|
12
11
|
ObcAlertFrameType,
|
|
13
12
|
} from '../alert-frame/alert-frame.js';
|
|
13
|
+
import {AlertType} from '../../types.js';
|
|
14
14
|
|
|
15
15
|
export enum AccordionSize {
|
|
16
16
|
SingleLine = 'single-line',
|
|
@@ -188,8 +188,7 @@ export class ObcAccordionCard extends LitElement {
|
|
|
188
188
|
* Status of the alert frame overlay (used when `hasAlert` is true).
|
|
189
189
|
* See `obc-alert-frame` for available statuses.
|
|
190
190
|
*/
|
|
191
|
-
@property({type: String}) alertFrameStatus:
|
|
192
|
-
ObcAlertFrameStatus.Alarm;
|
|
191
|
+
@property({type: String}) alertFrameStatus: AlertType = AlertType.Alarm;
|
|
193
192
|
|
|
194
193
|
private get shouldShowDescription() {
|
|
195
194
|
return (
|
|
@@ -304,7 +303,7 @@ export class ObcAccordionCard extends LitElement {
|
|
|
304
303
|
${this.hasAlert
|
|
305
304
|
? html`
|
|
306
305
|
<obc-alert-frame
|
|
307
|
-
class="alert"
|
|
306
|
+
class="alert alert-${this.alertFrameStatus}"
|
|
308
307
|
.sharpEdgeTopLeft=${this.isShartEdgeTop()}
|
|
309
308
|
.sharpEdgeTopRight=${this.isShartEdgeTop()}
|
|
310
309
|
.sharpEdgeBottomLeft=${this.isShartEdgeBottom()}
|
|
@@ -89,6 +89,46 @@ button {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
.type-enhanced.alert-type-isa-critical & {
|
|
93
|
+
@mixin style style=normal visibleWrapperClass=.blink;
|
|
94
|
+
@mixin style style=critical visibleWrapperClass=.visible-wrapper;
|
|
95
|
+
& .visible-wrapper {
|
|
96
|
+
color: var(--on-critical-active-color);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.type-enhanced.alert-type-isa-high & {
|
|
101
|
+
@mixin style style=normal visibleWrapperClass=.blink;
|
|
102
|
+
@mixin style style=alarm visibleWrapperClass=.visible-wrapper;
|
|
103
|
+
& .visible-wrapper {
|
|
104
|
+
color: var(--on-alarm-active-color);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.type-enhanced.alert-type-isa-medium & {
|
|
109
|
+
@mixin style style=normal visibleWrapperClass=.blink;
|
|
110
|
+
@mixin style style=warning visibleWrapperClass=.visible-wrapper;
|
|
111
|
+
& .visible-wrapper {
|
|
112
|
+
color: var(--on-warning-active-color);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.type-enhanced.alert-type-isa-low & {
|
|
117
|
+
@mixin style style=normal visibleWrapperClass=.blink;
|
|
118
|
+
@mixin style style=caution visibleWrapperClass=.visible-wrapper;
|
|
119
|
+
& .visible-wrapper {
|
|
120
|
+
color: var(--on-caution-active-color);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.type-enhanced.alert-type-isa-diagnostic & {
|
|
125
|
+
@mixin style style=normal visibleWrapperClass=.blink;
|
|
126
|
+
@mixin style style=notification visibleWrapperClass=.visible-wrapper;
|
|
127
|
+
& .visible-wrapper {
|
|
128
|
+
color: var(--on-notification-active-color);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
92
132
|
& .visible-wrapper,
|
|
93
133
|
& .blink {
|
|
94
134
|
border-radius: var(--ui-components-button-border-radius-top-left)
|
|
@@ -127,7 +167,29 @@ button {
|
|
|
127
167
|
}
|
|
128
168
|
}
|
|
129
169
|
|
|
130
|
-
.blinking.alert-type-
|
|
170
|
+
.blinking.alert-type-warning .alert-button,
|
|
171
|
+
.blinking.alert-type-isa-medium .alert-button {
|
|
172
|
+
.visible-wrapper {
|
|
173
|
+
opacity: var(--warning-blink-on);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.blink {
|
|
177
|
+
opacity: var(--warning-blink-off);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.blinking.alert-type-isa-critical .alert-button {
|
|
182
|
+
.visible-wrapper {
|
|
183
|
+
opacity: var(--critical-blink-on);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.blink {
|
|
187
|
+
opacity: var(--critical-blink-off);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.blinking.alert-type-alarm .alert-button,
|
|
192
|
+
.blinking.alert-type-isa-high .alert-button {
|
|
131
193
|
.visible-wrapper {
|
|
132
194
|
opacity: var(--alarm-blink-on);
|
|
133
195
|
}
|
|
@@ -137,13 +199,14 @@ button {
|
|
|
137
199
|
}
|
|
138
200
|
}
|
|
139
201
|
|
|
140
|
-
.blinking.alert-type-
|
|
202
|
+
.blinking.alert-type-caution .alert-button,
|
|
203
|
+
.blinking.alert-type-isa-low .alert-button {
|
|
141
204
|
.visible-wrapper {
|
|
142
|
-
opacity: var(--
|
|
205
|
+
opacity: var(--low-blink-on);
|
|
143
206
|
}
|
|
144
207
|
|
|
145
208
|
.blink {
|
|
146
|
-
opacity: var(--
|
|
209
|
+
opacity: var(--low-blink-off);
|
|
147
210
|
}
|
|
148
211
|
}
|
|
149
212
|
|
|
@@ -163,11 +226,32 @@ button {
|
|
|
163
226
|
--icon-stroke: var(--warning-pressed-border-color);
|
|
164
227
|
}
|
|
165
228
|
|
|
166
|
-
.alert-type-caution
|
|
229
|
+
.alert-type-caution,
|
|
230
|
+
.alert-type-isa-low {
|
|
167
231
|
--icon-fill: var(--caution-enabled-background-color);
|
|
168
232
|
--icon-stroke: var(--caution-pressed-border-color);
|
|
169
233
|
}
|
|
170
234
|
|
|
235
|
+
.alert-type-isa-critical {
|
|
236
|
+
--icon-fill: var(--alert-critical-color);
|
|
237
|
+
--icon-stroke: var(--alert-critical-outline-color);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.alert-type-isa-high {
|
|
241
|
+
--icon-fill: var(--alarm-enabled-background-color);
|
|
242
|
+
--icon-stroke: var(--alarm-pressed-border-color);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.alert-type-isa-medium {
|
|
246
|
+
--icon-fill: var(--warning-enabled-background-color);
|
|
247
|
+
--icon-stroke: var(--warning-pressed-border-color);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.alert-type-isa-diagnostic {
|
|
251
|
+
--icon-fill: var(--alert-diagnostic-color);
|
|
252
|
+
--icon-stroke: var(--alert-diagnostic-outline-color);
|
|
253
|
+
}
|
|
254
|
+
|
|
171
255
|
.silence-button {
|
|
172
256
|
@mixin style style=normal visibleWrapperClass=.visible-wrapper;
|
|
173
257
|
color: var(--on-normal-neutral-color);
|
|
@@ -207,3 +207,46 @@ export const EnhancedCaution: Story = {
|
|
|
207
207
|
nAlerts: 3,
|
|
208
208
|
},
|
|
209
209
|
};
|
|
210
|
+
|
|
211
|
+
export const EnhancedIsaCritical: Story = {
|
|
212
|
+
args: {
|
|
213
|
+
alertType: AlertType.IsaCritical,
|
|
214
|
+
type: ObcAlertButtonType.Enhanced,
|
|
215
|
+
nAlerts: 3,
|
|
216
|
+
blinking: true,
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
export const NormalIsaHigh: Story = {
|
|
221
|
+
args: {
|
|
222
|
+
alertType: AlertType.IsaHigh,
|
|
223
|
+
type: ObcAlertButtonType.Normal,
|
|
224
|
+
nAlerts: 2,
|
|
225
|
+
blinking: true,
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export const NormalIsaMedium: Story = {
|
|
230
|
+
args: {
|
|
231
|
+
alertType: AlertType.IsaMedium,
|
|
232
|
+
type: ObcAlertButtonType.Normal,
|
|
233
|
+
nAlerts: 1,
|
|
234
|
+
blinking: true,
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export const FlatIsaLow: Story = {
|
|
239
|
+
args: {
|
|
240
|
+
alertType: AlertType.IsaLow,
|
|
241
|
+
type: ObcAlertButtonType.Flat,
|
|
242
|
+
nAlerts: 1,
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
export const NormalIsaDiagnostic: Story = {
|
|
247
|
+
args: {
|
|
248
|
+
alertType: AlertType.IsaDiagnostic,
|
|
249
|
+
type: ObcAlertButtonType.Normal,
|
|
250
|
+
nAlerts: 1,
|
|
251
|
+
},
|
|
252
|
+
};
|
|
@@ -4,14 +4,20 @@ import compentStyle from './alert-button.css?inline';
|
|
|
4
4
|
import '../../icons/icon-alerts.js';
|
|
5
5
|
import '../../icons/icon-alerts-active.js';
|
|
6
6
|
import '../../icons/icon-notification.js';
|
|
7
|
-
import '../../icons/icon-notification-filled.js';
|
|
8
7
|
import '../../icons/icon-notification-advice.js';
|
|
9
8
|
import '../../icons/icon-notification-advice-active.js';
|
|
10
9
|
import '../../icons/icon-silence-iec.js';
|
|
11
10
|
import '../../icons/icon-alerts-alarm-twotone.js';
|
|
12
11
|
import '../../icons/icon-alerts-warning-twotone.js';
|
|
13
12
|
import '../../icons/icon-alerts-caution-twotone.js';
|
|
13
|
+
import '../../manual-icon/icon-alerts-critical-twotone.js';
|
|
14
|
+
import '../../manual-icon/icon-alerts-diagnostic-twotone.js';
|
|
14
15
|
import {AlertType} from '../../types.js';
|
|
16
|
+
import {
|
|
17
|
+
getAlertTwotoneComponent,
|
|
18
|
+
AlertTwotoneComponent,
|
|
19
|
+
supportsBlinking,
|
|
20
|
+
} from '../../alert-severity.js';
|
|
15
21
|
import {classMap} from 'lit/directives/class-map.js';
|
|
16
22
|
import {customElement} from '../../decorator.js';
|
|
17
23
|
|
|
@@ -196,31 +202,48 @@ export class ObcAlertButton extends LitElement {
|
|
|
196
202
|
super.disconnectedCallback();
|
|
197
203
|
}
|
|
198
204
|
|
|
199
|
-
private
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
return html`<obi-alerts-
|
|
206
|
-
} else if (this.alertType === AlertType.Alarm) {
|
|
207
|
-
return html`<obi-alerts-alarm-twotone
|
|
205
|
+
private renderAlertTwotoneIcon() {
|
|
206
|
+
const twotone = this.alertType
|
|
207
|
+
? getAlertTwotoneComponent(this.alertType)
|
|
208
|
+
: AlertTwotoneComponent.Caution;
|
|
209
|
+
switch (twotone) {
|
|
210
|
+
case AlertTwotoneComponent.Critical:
|
|
211
|
+
return html`<obi-alerts-critical-twotone
|
|
208
212
|
useCssColor
|
|
209
213
|
class="icon"
|
|
210
|
-
></obi-alerts-
|
|
211
|
-
|
|
214
|
+
></obi-alerts-critical-twotone>`;
|
|
215
|
+
case AlertTwotoneComponent.Diagnostic:
|
|
216
|
+
return html`<obi-alerts-diagnostic-twotone
|
|
217
|
+
useCssColor
|
|
218
|
+
class="icon"
|
|
219
|
+
></obi-alerts-diagnostic-twotone>`;
|
|
220
|
+
case AlertTwotoneComponent.Warning:
|
|
212
221
|
return html`<obi-alerts-warning-twotone
|
|
213
222
|
useCssColor
|
|
214
223
|
class="icon"
|
|
215
224
|
></obi-alerts-warning-twotone>`;
|
|
216
|
-
|
|
225
|
+
case AlertTwotoneComponent.Caution:
|
|
217
226
|
return html`<obi-alerts-caution-twotone
|
|
218
227
|
useCssColor
|
|
219
228
|
class="icon"
|
|
220
229
|
></obi-alerts-caution-twotone>`;
|
|
221
|
-
|
|
222
|
-
|
|
230
|
+
default:
|
|
231
|
+
return html`<obi-alerts-alarm-twotone
|
|
232
|
+
useCssColor
|
|
233
|
+
class="icon"
|
|
234
|
+
></obi-alerts-alarm-twotone>`;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
private alertIcon() {
|
|
239
|
+
const isIdle = this.nAlerts === 0;
|
|
240
|
+
if (isIdle) {
|
|
241
|
+
return html`<obi-alerts class="icon"></obi-alerts>`;
|
|
242
|
+
}
|
|
243
|
+
if (this.type === ObcAlertButtonType.Enhanced) {
|
|
244
|
+
return html`<obi-alerts-active class="icon"></obi-alerts-active>`;
|
|
223
245
|
}
|
|
246
|
+
return this.renderAlertTwotoneIcon();
|
|
224
247
|
}
|
|
225
248
|
|
|
226
249
|
private alertIconNegative() {
|
|
@@ -228,23 +251,8 @@ export class ObcAlertButton extends LitElement {
|
|
|
228
251
|
this.nAlerts === 0 || this.type !== ObcAlertButtonType.Enhanced;
|
|
229
252
|
if (useIdle) {
|
|
230
253
|
return html`<obi-alerts class="icon"></obi-alerts>`;
|
|
231
|
-
} else if (this.alertType === AlertType.Alarm) {
|
|
232
|
-
return html`<obi-alerts-alarm-twotone
|
|
233
|
-
useCssColor
|
|
234
|
-
class="icon"
|
|
235
|
-
></obi-alerts-alarm-twotone>`;
|
|
236
|
-
} else if (this.alertType === AlertType.Warning) {
|
|
237
|
-
return html`<obi-alerts-warning-twotone
|
|
238
|
-
useCssColor
|
|
239
|
-
class="icon"
|
|
240
|
-
></obi-alerts-warning-twotone>`;
|
|
241
|
-
} else {
|
|
242
|
-
return html`<obi-alerts-caution-twotone
|
|
243
|
-
useCssColor
|
|
244
|
-
class="icon"
|
|
245
|
-
></obi-alerts-caution-twotone>`;
|
|
246
|
-
// }
|
|
247
254
|
}
|
|
255
|
+
return this.renderAlertTwotoneIcon();
|
|
248
256
|
}
|
|
249
257
|
|
|
250
258
|
private get activeType(): ObcAlertButtonType {
|
|
@@ -270,7 +278,10 @@ export class ObcAlertButton extends LitElement {
|
|
|
270
278
|
const showCounter =
|
|
271
279
|
this.counter && hasAlerts && this.activeType !== ObcAlertButtonType.Flat;
|
|
272
280
|
const showBlinking =
|
|
273
|
-
this.blinking &&
|
|
281
|
+
this.blinking &&
|
|
282
|
+
hasAlerts &&
|
|
283
|
+
this.alertType !== undefined &&
|
|
284
|
+
supportsBlinking(this.alertType);
|
|
274
285
|
return html`
|
|
275
286
|
<div
|
|
276
287
|
class=${classMap({
|