@oicl/openbridge-webcomponents 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
|
@@ -5,7 +5,11 @@ import { classMap } from "lit/directives/class-map.js";
|
|
|
5
5
|
import "../../icons/icon-alarm-badge.js";
|
|
6
6
|
import "../../icons/icon-warning-badge.js";
|
|
7
7
|
import "../../icons/icon-caution-badge.js";
|
|
8
|
+
import "./critical-badge.js";
|
|
9
|
+
import "./diagnostic-badge.js";
|
|
8
10
|
import { customElement } from "../../decorator.js";
|
|
11
|
+
import { AlertType } from "../../types.js";
|
|
12
|
+
import { getAlertBadgeComponent, AlertBadgeComponent } from "../../alert-severity.js";
|
|
9
13
|
var __defProp = Object.defineProperty;
|
|
10
14
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
15
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -29,12 +33,12 @@ var ObcAlertFrameThickness = /* @__PURE__ */ ((ObcAlertFrameThickness2) => {
|
|
|
29
33
|
ObcAlertFrameThickness2["Large"] = "large";
|
|
30
34
|
return ObcAlertFrameThickness2;
|
|
31
35
|
})(ObcAlertFrameThickness || {});
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return
|
|
37
|
-
})(
|
|
36
|
+
var ObcAlertFrameMode = /* @__PURE__ */ ((ObcAlertFrameMode2) => {
|
|
37
|
+
ObcAlertFrameMode2["ackedActive"] = "acked-active";
|
|
38
|
+
ObcAlertFrameMode2["unackedActive"] = "unacked-active";
|
|
39
|
+
ObcAlertFrameMode2["unackedRectified"] = "unacked-rectified";
|
|
40
|
+
return ObcAlertFrameMode2;
|
|
41
|
+
})(ObcAlertFrameMode || {});
|
|
38
42
|
var AlertFrameTextSize = /* @__PURE__ */ ((AlertFrameTextSize2) => {
|
|
39
43
|
AlertFrameTextSize2["Regular"] = "regular";
|
|
40
44
|
AlertFrameTextSize2["Large"] = "large";
|
|
@@ -45,7 +49,9 @@ let ObcAlertFrame = class extends LitElement {
|
|
|
45
49
|
super(...arguments);
|
|
46
50
|
this.type = "small-side-flip";
|
|
47
51
|
this.thickness = "small";
|
|
48
|
-
this.status =
|
|
52
|
+
this.status = AlertType.Alarm;
|
|
53
|
+
this.mode = "acked-active";
|
|
54
|
+
this.wrapContent = false;
|
|
49
55
|
this.sharpEdgeTopLeft = false;
|
|
50
56
|
this.sharpEdgeTopRight = false;
|
|
51
57
|
this.sharpEdgeBottomLeft = false;
|
|
@@ -59,6 +65,7 @@ let ObcAlertFrame = class extends LitElement {
|
|
|
59
65
|
<div
|
|
60
66
|
class=${classMap({
|
|
61
67
|
wrapper: true,
|
|
68
|
+
"wrap-content": this.wrapContent,
|
|
62
69
|
["thickness-" + this.thickness]: true,
|
|
63
70
|
[this.type]: true,
|
|
64
71
|
[this.status]: true,
|
|
@@ -66,7 +73,8 @@ let ObcAlertFrame = class extends LitElement {
|
|
|
66
73
|
"sharp-edge-top-left": this.sharpEdgeTopLeft,
|
|
67
74
|
"sharp-edge-top-right": this.sharpEdgeTopRight,
|
|
68
75
|
"sharp-edge-bottom-left": this.sharpEdgeBottomLeft,
|
|
69
|
-
"sharp-edge-bottom-right": this.sharpEdgeBottomRight
|
|
76
|
+
"sharp-edge-bottom-right": this.sharpEdgeBottomRight,
|
|
77
|
+
[this.mode]: true
|
|
70
78
|
})}
|
|
71
79
|
>
|
|
72
80
|
<slot></slot>
|
|
@@ -78,15 +86,17 @@ let ObcAlertFrame = class extends LitElement {
|
|
|
78
86
|
if (this.type === "regular") {
|
|
79
87
|
return nothing;
|
|
80
88
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
89
|
+
if (this.type === "small-side-flip" && !this.showAlertCategoryIcon) {
|
|
90
|
+
return nothing;
|
|
91
|
+
}
|
|
92
|
+
if (this.type === "large-side-flip" && !this.showIcon && !this.showAlertCategoryIcon) {
|
|
93
|
+
return nothing;
|
|
94
|
+
}
|
|
95
|
+
let icon;
|
|
84
96
|
if (!this.showAlertCategoryIcon) {
|
|
85
97
|
icon = nothing;
|
|
86
|
-
} else
|
|
87
|
-
icon =
|
|
88
|
-
} else if (this.status === "caution") {
|
|
89
|
-
icon = html`<obi-caution-badge class="icon badge"></obi-caution-badge>`;
|
|
98
|
+
} else {
|
|
99
|
+
icon = this.renderBadgeIcon();
|
|
90
100
|
}
|
|
91
101
|
if (this.type === "small-side-flip") {
|
|
92
102
|
return html`<div class="flap small">
|
|
@@ -118,6 +128,24 @@ let ObcAlertFrame = class extends LitElement {
|
|
|
118
128
|
console.error("Unknown type of alert frame:", this.type);
|
|
119
129
|
return nothing;
|
|
120
130
|
}
|
|
131
|
+
renderBadgeIcon() {
|
|
132
|
+
switch (getAlertBadgeComponent(this.status)) {
|
|
133
|
+
case AlertBadgeComponent.Critical:
|
|
134
|
+
return html`<obi-critical-badge
|
|
135
|
+
class="icon badge"
|
|
136
|
+
></obi-critical-badge>`;
|
|
137
|
+
case AlertBadgeComponent.Warning:
|
|
138
|
+
return html`<obi-warning-badge class="icon badge"></obi-warning-badge>`;
|
|
139
|
+
case AlertBadgeComponent.Caution:
|
|
140
|
+
return html`<obi-caution-badge class="icon badge"></obi-caution-badge>`;
|
|
141
|
+
case AlertBadgeComponent.Diagnostic:
|
|
142
|
+
return html`<obi-diagnostic-badge
|
|
143
|
+
class="icon badge"
|
|
144
|
+
></obi-diagnostic-badge>`;
|
|
145
|
+
default:
|
|
146
|
+
return html`<obi-alarm-badge class="icon badge"></obi-alarm-badge>`;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
121
149
|
};
|
|
122
150
|
ObcAlertFrame.styles = unsafeCSS(compentStyle);
|
|
123
151
|
__decorateClass([
|
|
@@ -129,6 +157,12 @@ __decorateClass([
|
|
|
129
157
|
__decorateClass([
|
|
130
158
|
property({ type: String })
|
|
131
159
|
], ObcAlertFrame.prototype, "status", 2);
|
|
160
|
+
__decorateClass([
|
|
161
|
+
property({ type: String })
|
|
162
|
+
], ObcAlertFrame.prototype, "mode", 2);
|
|
163
|
+
__decorateClass([
|
|
164
|
+
property({ type: Boolean, reflect: true })
|
|
165
|
+
], ObcAlertFrame.prototype, "wrapContent", 2);
|
|
132
166
|
__decorateClass([
|
|
133
167
|
property({ type: Boolean })
|
|
134
168
|
], ObcAlertFrame.prototype, "sharpEdgeTopLeft", 2);
|
|
@@ -153,11 +187,28 @@ __decorateClass([
|
|
|
153
187
|
ObcAlertFrame = __decorateClass([
|
|
154
188
|
customElement("obc-alert-frame")
|
|
155
189
|
], ObcAlertFrame);
|
|
190
|
+
function wrapWithAlertFrame(options, content) {
|
|
191
|
+
if (typeof options !== "object" || options === null) {
|
|
192
|
+
return content;
|
|
193
|
+
}
|
|
194
|
+
return html`<obc-alert-frame
|
|
195
|
+
.type=${options.type ?? "small-side-flip"}
|
|
196
|
+
.thickness=${options.thickness ?? "small"}
|
|
197
|
+
.status=${options.status ?? AlertType.Alarm}
|
|
198
|
+
.mode=${options.mode ?? "acked-active"}
|
|
199
|
+
.showIcon=${options.showIcon ?? false}
|
|
200
|
+
.showAlertCategoryIcon=${options.showAlertCategoryIcon ?? true}
|
|
201
|
+
.wrapContent=${true}
|
|
202
|
+
>${content}</obc-alert-frame
|
|
203
|
+
>`;
|
|
204
|
+
}
|
|
156
205
|
export {
|
|
157
206
|
AlertFrameTextSize,
|
|
158
207
|
ObcAlertFrame,
|
|
159
|
-
|
|
208
|
+
ObcAlertFrameMode,
|
|
209
|
+
AlertType as ObcAlertFrameStatus,
|
|
160
210
|
ObcAlertFrameThickness,
|
|
161
|
-
ObcAlertFrameType
|
|
211
|
+
ObcAlertFrameType,
|
|
212
|
+
wrapWithAlertFrame
|
|
162
213
|
};
|
|
163
214
|
//# sourceMappingURL=alert-frame.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-frame.js","sources":["../../../src/components/alert-frame/alert-frame.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS, nothing, TemplateResult} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport compentStyle from './alert-frame.css?inline';\nimport {classMap} from 'lit/directives/class-map.js';\nimport '../../icons/icon-alarm-badge.js';\nimport '../../icons/icon-warning-badge.js';\nimport '../../icons/icon-caution-badge.js';\nimport {customElement} from '../../decorator.js';\n\n/**\n * Enum representing the available frame styles for an alert component.\n *\n * - Regular (\"regular\"): Standard alert frame layout.\n * - SmallSideFlip (\"small-side-flip\"): Flipped frame with a small side edge.\n * - LargeSideFlip (\"large-side-flip\"): Flipped frame with a large side edge.\n * - BottomFlip (\"bottom-flip\"): Frame flipped to the bottom position.\n */\nexport enum ObcAlertFrameType {\n Regular = 'regular',\n SmallSideFlip = 'small-side-flip',\n LargeSideFlip = 'large-side-flip',\n BottomFlip = 'bottom-flip',\n TopFlip = 'top-flip',\n}\n\n/**\n * Thickness options for the alert frame border.\n * - `small`: Thin border (default).\n * - `large`: Thick border for higher emphasis.\n */\nexport enum ObcAlertFrameThickness {\n Small = 'small',\n Large = 'large',\n}\n\n/**\n * Status options for the alert frame, controlling color and icon.\n * - `alarm`: Highest severity (default).\n * - `warning`: Medium severity.\n * - `caution`: Lower severity.\n */\nexport enum ObcAlertFrameStatus {\n Alarm = 'alarm',\n Warning = 'warning',\n Caution = 'caution',\n}\n\n/**\n * Text size options for flip-flap typography.\n * - `regular`: Standard text size (default).\n * - `large`: Larger text for increased visibility.\n */\nexport enum AlertFrameTextSize {\n Regular = 'regular',\n Large = 'large',\n}\n\n/**\n * `<obc-alert-frame>` – A bordered frame component for visually emphasizing alert or status messages.\n *\n * The alert frame provides a prominent outline and optional \"flap\" with status icon to draw attention to critical information or UI regions. It supports multiple visual variants and thicknesses, and can be configured to indicate different alert statuses (alarm, warning, caution). The component is designed to wrap content and visually distinguish it from the surrounding UI.\n *\n * ### Features\n * - **Variants (type):**\n * - `regular`: Standard outlined frame with no flap or icon.\n * - `small-side-flip`: Adds a small side flap with a status icon at the top right.\n * - `large-side-flip`: Adds a larger, vertical side flap with a status icon and optional custom icon.\n * - `bottom-flip`: Adds a bottom flap with a status icon, label, and timer slots.\n * - **Thickness options:** Choose between `small` (thin border) and `large` (thick border) for visual emphasis.\n * - **Status indication:** Displays different color schemes and icons for `alarm`, `warning`, or `caution` states.\n * - **Customizable corners:** Each corner can be set to a sharp (non-rounded) edge for integration with other UI elements.\n * - **Slot-based content:** Supports custom icons, labels, and timers in flap variants via named slots.\n *\n * ### Usage Guidelines\n * Use `obc-alert-frame` to highlight important content, such as alerts, warnings, or status panels. The flap variants are ideal for drawing extra attention to urgent or time-sensitive information, while the regular type provides a subtle but clear border. Choose the status to match the severity of the message (alarm, warning, caution). Adjust thickness for visual hierarchy—use large for high-priority alerts and small for less critical notices.\n *\n * **TODO(designer):** Provide guidance on when to use each flap type (small-side-flip, large-side-flip, bottom-flip) and recommended scenarios for sharp edge usage.\n *\n * ### Features/Variants\n * - **Type (Visual Variant):**\n * - `regular`: Simple outlined frame, no flap or icon.\n * - `small-side-flip`: Small right-side flap with status icon.\n * - `large-side-flip`: Large vertical right-side flap with status icon and optional custom icon.\n * - `bottom-flip`: Bottom flap with status icon, label, and timer.\n * - **Thickness:** `small` (default) or `large` for border width.\n * - **Status:** `alarm`, `warning`, or `caution`—affects color and icon.\n * - **Corner Customization:** Each corner can be made sharp (not rounded) via boolean properties.\n *\n * ### Slots and Content Structure\n *\n * | Slot Name | Renders When... | Purpose |\n * |-----------|-----------------|---------|\n * | (default) | Always | Main content inside the alert frame. |\n * | icon | `large-side-flip` or `bottom-flip` | Custom icon displayed in the flap (in addition to status icon). |\n * | label | `bottom-flip` only | Label text shown in the bottom flap. |\n * | timer | `bottom-flip` only | Timer or time label in the bottom flap. |\n *\n * ### Properties and Attributes\n * - `type`: Selects the visual variant/flap style. Default is `small-side-flip`.\n * - `thickness`: Controls border thickness (`small` or `large`). Default is `small`.\n * - `status`: Sets the alert status and color/icon (`alarm`, `warning`, `caution`). Default is `alarm`.\n * - `sharpEdgeTopLeft`, `sharpEdgeTopRight`, `sharpEdgeBottomLeft`, `sharpEdgeBottomRight`: Boolean flags to make each corner sharp instead of rounded.\n *\n * ### Best Practices and Constraints\n * - Use the status property to match the severity of the alert.\n * - Only use the bottom-flip variant when both label and timer are relevant.\n * - For visual consistency, align sharp edge settings with adjacent UI elements.\n * - The default slot is for the main content; use named slots for icons, labels, and timers as needed.\n *\n * ### Example:\n * ```\n * <obc-alert-frame\n * type=\"bottom-flip\"\n * thickness=\"large\"\n * status=\"warning\"\n * sharpEdgeTopLeft\n * >\n * <obi-placeholder slot=\"icon\"></obi-placeholder>\n * <div slot=\"label\">Low Battery</div>\n * <div slot=\"timer\">00:15</div>\n * <div>Critical system message goes here.</div>\n * </obc-alert-frame>\n * ```\n *\n * @slot - Default slot for main alert content.\n * @slot icon - Custom icon for the flap (large-side-flip, bottom-flip).\n * @slot label - Label text for the bottom flap (bottom-flip only).\n * @slot timer - Timer or time label for the bottom flap (bottom-flip only).\n */\n@customElement('obc-alert-frame')\nexport class ObcAlertFrame extends LitElement {\n /**\n * Visual variant of the alert frame.\n * - `regular`: Outlined frame only.\n * - `small-side-flip`: Small right-side flap with status icon.\n * - `large-side-flip`: Large vertical right-side flap with status icon and optional custom icon.\n * - `bottom-flip`: Bottom flap with status icon, label, and timer.\n *\n * Default: `small-side-flip`\n */\n @property({type: String}) type: ObcAlertFrameType =\n ObcAlertFrameType.SmallSideFlip;\n\n /**\n * Border thickness of the alert frame.\n * - `small`: Thin border (default).\n * - `large`: Thick border for higher emphasis.\n */\n @property({type: String}) thickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n\n /**\n * Status of the alert, controlling color scheme and icon.\n * - `alarm`: Highest severity (default).\n * - `warning`: Medium severity.\n * - `caution`: Lower severity.\n */\n @property({type: String}) status: ObcAlertFrameStatus =\n ObcAlertFrameStatus.Alarm;\n\n /**\n * If true, the top-left corner will be sharp (not rounded).\n */\n @property({type: Boolean}) sharpEdgeTopLeft: boolean = false;\n\n /**\n * If true, the top-right corner will be sharp (not rounded).\n */\n @property({type: Boolean}) sharpEdgeTopRight: boolean = false;\n\n /**\n * If true, the bottom-left corner will be sharp (not rounded).\n */\n @property({type: Boolean}) sharpEdgeBottomLeft: boolean = false;\n\n /**\n * If true, the bottom-right corner will be sharp (not rounded).\n */\n @property({type: Boolean}) sharpEdgeBottomRight: boolean = false;\n\n @property({type: String}) textSize: AlertFrameTextSize =\n AlertFrameTextSize.Regular;\n\n @property({type: Boolean}) showIcon: boolean = false;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n\n override render() {\n return html`\n <div\n class=${classMap({\n wrapper: true,\n ['thickness-' + this.thickness]: true,\n [this.type]: true,\n [this.status]: true,\n ['text-size-' + this.textSize]: true,\n 'sharp-edge-top-left': this.sharpEdgeTopLeft,\n 'sharp-edge-top-right': this.sharpEdgeTopRight,\n 'sharp-edge-bottom-left': this.sharpEdgeBottomLeft,\n 'sharp-edge-bottom-right': this.sharpEdgeBottomRight,\n })}\n >\n <slot></slot>\n ${this.flap()}\n </div>\n `;\n }\n\n private flap() {\n if (this.type === ObcAlertFrameType.Regular) {\n return nothing;\n }\n\n let icon: TemplateResult | typeof nothing = html`<obi-alarm-badge\n class=\"icon badge\"\n ></obi-alarm-badge>`;\n if (!this.showAlertCategoryIcon) {\n icon = nothing;\n } else if (this.status === ObcAlertFrameStatus.Warning) {\n icon = html`<obi-warning-badge class=\"icon badge\"></obi-warning-badge>`;\n } else if (this.status === ObcAlertFrameStatus.Caution) {\n icon = html`<obi-caution-badge class=\"icon badge\"></obi-caution-badge>`;\n }\n\n if (this.type === ObcAlertFrameType.SmallSideFlip) {\n return html`<div class=\"flap small\">\n ${icon}\n <div class=\"mask up\"></div>\n </div>`;\n }\n if (this.type === ObcAlertFrameType.LargeSideFlip) {\n return html`<div class=\"flap large\">\n ${icon}\n ${this.showIcon\n ? html`<div class=\"icon\"><slot name=\"icon\"></slot></div>`\n : nothing}\n <div class=\"mask up\"></div>\n <div class=\"mask down\"></div>\n </div>`;\n }\n if (\n this.type === ObcAlertFrameType.BottomFlip ||\n this.type === ObcAlertFrameType.TopFlip\n ) {\n return html`<div\n class=\"flap ${this.type === ObcAlertFrameType.BottomFlip\n ? 'bottom'\n : 'top'}\"\n >\n ${icon}\n ${this.showIcon\n ? html`<div class=\"icon\"><slot name=\"icon\"></slot></div>`\n : nothing}\n <div class=\"label\"><slot name=\"label\"></slot></div>\n <div class=\"spacer\"></div>\n <div class=\"timer\"><slot name=\"timer\"></slot></div>\n <div class=\"mask right\"></div>\n <div class=\"mask left\"></div>\n </div>`;\n }\n console.error('Unknown type of alert frame:', this.type);\n return nothing;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-frame': ObcAlertFrame;\n }\n}\n"],"names":["ObcAlertFrameType","ObcAlertFrameThickness","ObcAlertFrameStatus","AlertFrameTextSize"],"mappings":";;;;;;;;;;;;;;;;;;AAiBO,IAAK,sCAAAA,uBAAL;AACLA,qBAAA,SAAA,IAAU;AACVA,qBAAA,eAAA,IAAgB;AAChBA,qBAAA,eAAA,IAAgB;AAChBA,qBAAA,YAAA,IAAa;AACbA,qBAAA,SAAA,IAAU;AALA,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;AAaL,IAAK,2CAAAC,4BAAL;AACLA,0BAAA,OAAA,IAAQ;AACRA,0BAAA,OAAA,IAAQ;AAFE,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;AAWL,IAAK,wCAAAC,yBAAL;AACLA,uBAAA,OAAA,IAAQ;AACRA,uBAAA,SAAA,IAAU;AACVA,uBAAA,SAAA,IAAU;AAHA,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAWL,IAAK,uCAAAC,wBAAL;AACLA,sBAAA,SAAA,IAAU;AACVA,sBAAA,OAAA,IAAQ;AAFE,SAAAA;AAAA,GAAA,sBAAA,CAAA,CAAA;AA8EL,IAAM,gBAAN,cAA4B,WAAW;AAAA,EAAvC,cAAA;AAAA,UAAA,GAAA,SAAA;AAUqB,SAAA,OACxB;AAOwB,SAAA,Y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src/components/alert-frame/alert-frame.ts"],"sourcesContent":["import {\n LitElement,\n html,\n unsafeCSS,\n nothing,\n TemplateResult,\n HTMLTemplateResult,\n} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport compentStyle from './alert-frame.css?inline';\nimport {classMap} from 'lit/directives/class-map.js';\nimport '../../icons/icon-alarm-badge.js';\nimport '../../icons/icon-warning-badge.js';\nimport '../../icons/icon-caution-badge.js';\nimport './critical-badge.js';\nimport './diagnostic-badge.js';\nimport {customElement} from '../../decorator.js';\nimport {AlertType} from '../../types.js';\nimport {\n getAlertBadgeComponent,\n AlertBadgeComponent,\n} from '../../alert-severity.js';\n\nexport {AlertType as ObcAlertFrameStatus} from '../../types.js';\n\n/**\n * Enum representing the available frame styles for an alert component.\n *\n * - Regular (\"regular\"): Standard alert frame layout.\n * - SmallSideFlip (\"small-side-flip\"): Flipped frame with a small side edge.\n * - LargeSideFlip (\"large-side-flip\"): Flipped frame with a large side edge.\n * - BottomFlip (\"bottom-flip\"): Frame flipped to the bottom position.\n */\nexport enum ObcAlertFrameType {\n Regular = 'regular',\n SmallSideFlip = 'small-side-flip',\n LargeSideFlip = 'large-side-flip',\n BottomFlip = 'bottom-flip',\n TopFlip = 'top-flip',\n}\n\n/**\n * Thickness options for the alert frame border.\n * - `small`: Thin border (default).\n * - `large`: Thick border for higher emphasis.\n */\nexport enum ObcAlertFrameThickness {\n Small = 'small',\n Large = 'large',\n}\n\nexport enum ObcAlertFrameMode {\n ackedActive = 'acked-active',\n unackedActive = 'unacked-active',\n unackedRectified = 'unacked-rectified',\n}\n\n/**\n * Text size options for flip-flap typography.\n * - `regular`: Standard text size (default).\n * - `large`: Larger text for increased visibility.\n */\nexport enum AlertFrameTextSize {\n Regular = 'regular',\n Large = 'large',\n}\n\nexport interface AlertFrameConfig {\n type?: ObcAlertFrameType;\n thickness?: ObcAlertFrameThickness;\n status?: AlertType;\n mode?: ObcAlertFrameMode;\n textSize?: AlertFrameTextSize;\n showIcon?: boolean;\n showAlertCategoryIcon?: boolean;\n}\n\n/**\n * `<obc-alert-frame>` – A bordered frame component for visually emphasizing alert or status messages.\n *\n * The alert frame provides a prominent outline and optional \"flap\" with status icon to draw attention to critical information or UI regions. It supports multiple visual variants and thicknesses, and can be configured to indicate different alert statuses (alarm, warning, caution). The component is designed to wrap content and visually distinguish it from the surrounding UI.\n *\n * ### Features\n * - **Variants (type):**\n * - `regular`: Standard outlined frame with no flap or icon.\n * - `small-side-flip`: Adds a small side flap with a status icon at the top right.\n * - `large-side-flip`: Adds a larger, vertical side flap with a status icon and optional custom icon.\n * - `bottom-flip`: Adds a bottom flap with a status icon, label, and timer slots.\n * - **Thickness options:** Choose between `small` (thin border) and `large` (thick border) for visual emphasis.\n * - **Status indication:** Displays different color schemes and icons for the legacy statuses (`alarm`, `warning`, `caution`) and the ISA statuses (`isa-critical`, `isa-high`, `isa-medium`, `isa-low`, `isa-diagnostic`).\n * - **Acknowledgement mode:** The `mode` property reflects the alert lifecycle state — `acked-active` (default), `unacked-active`, and `unacked-rectified` — driving the blinking/animation treatment of the frame.\n * - **Content wrapping:** When `wrapContent` is true, the frame wraps and sizes itself to its slotted content rather than overlaying a fixed region.\n * - **Customizable corners:** Each corner can be set to a sharp (non-rounded) edge for integration with other UI elements.\n * - **Slot-based content:** Supports custom icons, labels, and timers in flap variants via named slots.\n *\n * ### Usage Guidelines\n * Use `obc-alert-frame` to highlight important content, such as alerts, warnings, or status panels. The flap variants are ideal for drawing extra attention to urgent or time-sensitive information, while the regular type provides a subtle but clear border. Choose the status to match the severity of the message (alarm, warning, caution). Adjust thickness for visual hierarchy—use large for high-priority alerts and small for less critical notices.\n *\n * **TODO(designer):** Provide guidance on when to use each flap type (small-side-flip, large-side-flip, bottom-flip) and recommended scenarios for sharp edge usage.\n *\n * ### Features/Variants\n * - **Type (Visual Variant):**\n * - `regular`: Simple outlined frame, no flap or icon.\n * - `small-side-flip`: Small right-side flap with status icon.\n * - `large-side-flip`: Large vertical right-side flap with status icon and optional custom icon.\n * - `bottom-flip`: Bottom flap with status icon, label, and timer.\n * - **Thickness:** `small` (default) or `large` for border width.\n * - **Status:** `alarm`, `warning`, `caution`, or the ISA severities (`isa-critical`, `isa-high`, `isa-medium`, `isa-low`, `isa-diagnostic`)—affects color and icon.\n * - **Mode:** `acked-active` (default), `unacked-active`, or `unacked-rectified`—affects blinking/animation.\n * - **Corner Customization:** Each corner can be made sharp (not rounded) via boolean properties.\n *\n * ### Slots and Content Structure\n *\n * | Slot Name | Renders When... | Purpose |\n * |-----------|-----------------|---------|\n * | (default) | Always | Main content inside the alert frame. |\n * | icon | `large-side-flip` or `bottom-flip` | Custom icon displayed in the flap (in addition to status icon). |\n * | label | `bottom-flip` only | Label text shown in the bottom flap. |\n * | timer | `bottom-flip` only | Timer or time label in the bottom flap. |\n *\n * ### Properties and Attributes\n * - `type`: Selects the visual variant/flap style. Default is `small-side-flip`.\n * - `thickness`: Controls border thickness (`small` or `large`). Default is `small`.\n * - `status`: Sets the alert status and color/icon (`alarm`, `warning`, `caution`, or the `isa-*` severities). Default is `alarm`.\n * - `mode`: Acknowledgement lifecycle state (`acked-active`, `unacked-active`, `unacked-rectified`) controlling blinking/animation. Default is `acked-active`.\n * - `wrapContent`: When true, the frame wraps and sizes to its slotted content instead of overlaying a fixed region. Default is `false`.\n * - `sharpEdgeTopLeft`, `sharpEdgeTopRight`, `sharpEdgeBottomLeft`, `sharpEdgeBottomRight`: Boolean flags to make each corner sharp instead of rounded.\n *\n * ### Best Practices and Constraints\n * - Use the status property to match the severity of the alert.\n * - Only use the bottom-flip variant when both label and timer are relevant.\n * - For visual consistency, align sharp edge settings with adjacent UI elements.\n * - The default slot is for the main content; use named slots for icons, labels, and timers as needed.\n *\n * ### Example:\n * ```\n * <obc-alert-frame\n * type=\"bottom-flip\"\n * thickness=\"large\"\n * status=\"warning\"\n * sharpEdgeTopLeft\n * >\n * <obi-placeholder slot=\"icon\"></obi-placeholder>\n * <div slot=\"label\">Low Battery</div>\n * <div slot=\"timer\">00:15</div>\n * <div>Critical system message goes here.</div>\n * </obc-alert-frame>\n * ```\n *\n * @slot - Default slot for main alert content.\n * @slot icon - Custom icon for the flap (large-side-flip, bottom-flip).\n * @slot label - Label text for the bottom flap (bottom-flip only).\n * @slot timer - Timer or time label for the bottom flap (bottom-flip only).\n */\n@customElement('obc-alert-frame')\nexport class ObcAlertFrame extends LitElement {\n /**\n * Visual variant of the alert frame.\n * - `regular`: Outlined frame only.\n * - `small-side-flip`: Small right-side flap with status icon.\n * - `large-side-flip`: Large vertical right-side flap with status icon and optional custom icon.\n * - `bottom-flip`: Bottom flap with status icon, label, and timer.\n *\n * Default: `small-side-flip`\n */\n @property({type: String}) type: ObcAlertFrameType =\n ObcAlertFrameType.SmallSideFlip;\n\n /**\n * Border thickness of the alert frame.\n * - `small`: Thin border (default).\n * - `large`: Thick border for higher emphasis.\n */\n @property({type: String}) thickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n\n /**\n * Status of the alert, controlling color scheme and icon.\n * - `alarm`: Highest severity (default).\n * - `warning`: Medium severity.\n * - `caution`: Lower severity.\n * - `isa-critical`, `isa-high`, `isa-medium`, `isa-low`, `isa-diagnostic`: ISA severity levels, styled to match their legacy equivalents.\n */\n @property({type: String}) status: AlertType = AlertType.Alarm;\n\n /**\n * Acknowledgement lifecycle state, controlling the frame's blinking/animation.\n * - `acked-active`: Active and acknowledged (default); no blinking.\n * - `unacked-active`: Active and not yet acknowledged; blinks.\n * - `unacked-rectified`: Condition cleared but not yet acknowledged.\n */\n @property({type: String}) mode: ObcAlertFrameMode =\n ObcAlertFrameMode.ackedActive;\n\n /**\n * When true, the frame wraps and sizes itself to its slotted content instead\n * of overlaying a fixed region. Reflected to an attribute for CSS styling.\n */\n @property({type: Boolean, reflect: true}) wrapContent: boolean = false;\n\n /**\n * If true, the top-left corner will be sharp (not rounded).\n */\n @property({type: Boolean}) sharpEdgeTopLeft: boolean = false;\n\n /**\n * If true, the top-right corner will be sharp (not rounded).\n */\n @property({type: Boolean}) sharpEdgeTopRight: boolean = false;\n\n /**\n * If true, the bottom-left corner will be sharp (not rounded).\n */\n @property({type: Boolean}) sharpEdgeBottomLeft: boolean = false;\n\n /**\n * If true, the bottom-right corner will be sharp (not rounded).\n */\n @property({type: Boolean}) sharpEdgeBottomRight: boolean = false;\n\n @property({type: String}) textSize: AlertFrameTextSize =\n AlertFrameTextSize.Regular;\n\n @property({type: Boolean}) showIcon: boolean = false;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n\n override render() {\n return html`\n <div\n class=${classMap({\n wrapper: true,\n 'wrap-content': this.wrapContent,\n ['thickness-' + this.thickness]: true,\n [this.type]: true,\n [this.status]: true,\n ['text-size-' + this.textSize]: true,\n 'sharp-edge-top-left': this.sharpEdgeTopLeft,\n 'sharp-edge-top-right': this.sharpEdgeTopRight,\n 'sharp-edge-bottom-left': this.sharpEdgeBottomLeft,\n 'sharp-edge-bottom-right': this.sharpEdgeBottomRight,\n [this.mode]: true,\n })}\n >\n <slot></slot>\n ${this.flap()}\n </div>\n `;\n }\n\n private flap() {\n if (this.type === ObcAlertFrameType.Regular) {\n return nothing;\n }\n\n if (\n this.type === ObcAlertFrameType.SmallSideFlip &&\n !this.showAlertCategoryIcon\n ) {\n return nothing;\n }\n\n if (\n this.type === ObcAlertFrameType.LargeSideFlip &&\n !this.showIcon &&\n !this.showAlertCategoryIcon\n ) {\n return nothing;\n }\n\n let icon: TemplateResult | typeof nothing;\n if (!this.showAlertCategoryIcon) {\n icon = nothing;\n } else {\n icon = this.renderBadgeIcon();\n }\n\n if (this.type === ObcAlertFrameType.SmallSideFlip) {\n return html`<div class=\"flap small\">\n ${icon}\n <div class=\"mask up\"></div>\n </div>`;\n }\n if (this.type === ObcAlertFrameType.LargeSideFlip) {\n return html`<div class=\"flap large\">\n ${icon}\n ${this.showIcon\n ? html`<div class=\"icon\"><slot name=\"icon\"></slot></div>`\n : nothing}\n <div class=\"mask up\"></div>\n <div class=\"mask down\"></div>\n </div>`;\n }\n if (\n this.type === ObcAlertFrameType.BottomFlip ||\n this.type === ObcAlertFrameType.TopFlip\n ) {\n return html`<div\n class=\"flap ${this.type === ObcAlertFrameType.BottomFlip\n ? 'bottom'\n : 'top'}\"\n >\n ${icon}\n ${this.showIcon\n ? html`<div class=\"icon\"><slot name=\"icon\"></slot></div>`\n : nothing}\n <div class=\"label\"><slot name=\"label\"></slot></div>\n <div class=\"spacer\"></div>\n <div class=\"timer\"><slot name=\"timer\"></slot></div>\n <div class=\"mask right\"></div>\n <div class=\"mask left\"></div>\n </div>`;\n }\n console.error('Unknown type of alert frame:', this.type);\n return nothing;\n }\n\n private renderBadgeIcon(): TemplateResult {\n switch (getAlertBadgeComponent(this.status)) {\n case AlertBadgeComponent.Critical:\n return html`<obi-critical-badge\n class=\"icon badge\"\n ></obi-critical-badge>`;\n case AlertBadgeComponent.Warning:\n return html`<obi-warning-badge class=\"icon badge\"></obi-warning-badge>`;\n case AlertBadgeComponent.Caution:\n return html`<obi-caution-badge class=\"icon badge\"></obi-caution-badge>`;\n case AlertBadgeComponent.Diagnostic:\n return html`<obi-diagnostic-badge\n class=\"icon badge\"\n ></obi-diagnostic-badge>`;\n default:\n return html`<obi-alarm-badge class=\"icon badge\"></obi-alarm-badge>`;\n }\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\nexport function wrapWithAlertFrame(\n options: AlertFrameConfig | boolean | undefined,\n content: HTMLTemplateResult\n): HTMLTemplateResult {\n if (typeof options !== 'object' || options === null) {\n return content;\n }\n return html`<obc-alert-frame\n .type=${options.type ?? ObcAlertFrameType.SmallSideFlip}\n .thickness=${options.thickness ?? ObcAlertFrameThickness.Small}\n .status=${options.status ?? AlertType.Alarm}\n .mode=${options.mode ?? ObcAlertFrameMode.ackedActive}\n .showIcon=${options.showIcon ?? false}\n .showAlertCategoryIcon=${options.showAlertCategoryIcon ?? true}\n .wrapContent=${true}\n >${content}</obc-alert-frame\n >`;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-frame': ObcAlertFrame;\n }\n}\n"],"names":["ObcAlertFrameType","ObcAlertFrameThickness","ObcAlertFrameMode","AlertFrameTextSize"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCO,IAAK,sCAAAA,uBAAL;AACLA,qBAAA,SAAA,IAAU;AACVA,qBAAA,eAAA,IAAgB;AAChBA,qBAAA,eAAA,IAAgB;AAChBA,qBAAA,YAAA,IAAa;AACbA,qBAAA,SAAA,IAAU;AALA,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;AAaL,IAAK,2CAAAC,4BAAL;AACLA,0BAAA,OAAA,IAAQ;AACRA,0BAAA,OAAA,IAAQ;AAFE,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;AAKL,IAAK,sCAAAC,uBAAL;AACLA,qBAAA,aAAA,IAAc;AACdA,qBAAA,eAAA,IAAgB;AAChBA,qBAAA,kBAAA,IAAmB;AAHT,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;AAWL,IAAK,uCAAAC,wBAAL;AACLA,sBAAA,SAAA,IAAU;AACVA,sBAAA,OAAA,IAAQ;AAFE,SAAAA;AAAA,GAAA,sBAAA,CAAA,CAAA;AA6FL,IAAM,gBAAN,cAA4B,WAAW;AAAA,EAAvC,cAAA;AAAA,UAAA,GAAA,SAAA;AAUqB,SAAA,OACxB;AAOwB,SAAA,YACxB;AASwB,SAAA,SAAoB,UAAU;AAQ9B,SAAA,OACxB;AAMwC,SAAA,cAAuB;AAKtC,SAAA,mBAA4B;AAK5B,SAAA,oBAA6B;AAK7B,SAAA,sBAA+B;AAK/B,SAAA,uBAAgC;AAEjC,SAAA,WACxB;AAEyB,SAAA,WAAoB;AACF,SAAA,wBAC3C;AAAA,EAAA;AAAA,EAEO,SAAS;AAChB,WAAO;AAAA;AAAA,gBAEK,SAAS;AAAA,MACf,SAAS;AAAA,MACT,gBAAgB,KAAK;AAAA,MACrB,CAAC,eAAe,KAAK,SAAS,G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gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GApEd,cAoEgB,WAAA,YAAA,CAAA;AACkB,gBAAA;AAAA,EAA5C,SAAS,EAAC,MAAM,SAAS,WAAW,OAAM;AAAA,GArEhC,cAqEkC,WAAA,yBAAA,CAAA;AArElC,gBAAN,gBAAA;AAAA,EADN,cAAc,iBAAiB;AAAA,GACnB,aAAA;AAwLN,SAAS,mBACd,SACA,SACoB;AACpB,MAAI,OAAO,YAAY,YAAY,YAAY,MAAM;AACnD,WAAO;AAAA,EACT;AACA,SAAO;AAAA,YACG,QAAQ,QAAQ,iBAAA;AAAA,iBACX,QAAQ,aAAa,OAAA;AAAA,cACxB,QAAQ,UAAU,UAAU,KAAK;AAAA,YACnC,QAAQ,QAAQ,cAAA;AAAA,gBACZ,QAAQ,YAAY,KAAK;AAAA,6BACZ,QAAQ,yBAAyB,IAAI;AAAA,mBAC/C,IAAI;AAAA,OAChB,OAAO;AAAA;AAEd;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class ObiCriticalBadge extends LitElement {
|
|
3
|
+
private icon;
|
|
4
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
5
|
+
static styles: import('lit').CSSResult;
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'obi-critical-badge': ObiCriticalBadge;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=critical-badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"critical-badge.d.ts","sourceRoot":"","sources":["../../../src/components/alert-frame/critical-badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAiB,MAAM,KAAK,CAAC;AAG/C,qBACa,gBAAiB,SAAQ,UAAU;IAC9C,OAAO,CAAC,IAAI,CAUZ;IAES,MAAM;IAIf,OAAgB,MAAM,0BAUpB;CACH;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { css, LitElement, svg, html } from "lit";
|
|
2
|
+
import { customElement } from "../../decorator.js";
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
5
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
6
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7
|
+
if (decorator = decorators[i])
|
|
8
|
+
result = decorator(result) || result;
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
let ObiCriticalBadge = class extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.icon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
|
15
|
+
<path d="M 22,12
|
|
16
|
+
L 17,20.66
|
|
17
|
+
L 7,20.66
|
|
18
|
+
L 2,12
|
|
19
|
+
L 7,3.34
|
|
20
|
+
L 17,3.34
|
|
21
|
+
Z"
|
|
22
|
+
fill="currentColor"/>
|
|
23
|
+
</svg>
|
|
24
|
+
`;
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
return html` <div class="wrapper">${this.icon}</div> `;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
ObiCriticalBadge.styles = css`
|
|
31
|
+
.wrapper {
|
|
32
|
+
height: 100%;
|
|
33
|
+
width: 100%;
|
|
34
|
+
line-height: 0;
|
|
35
|
+
}
|
|
36
|
+
.wrapper > * {
|
|
37
|
+
height: 100%;
|
|
38
|
+
width: 100%;
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
ObiCriticalBadge = __decorateClass([
|
|
42
|
+
customElement("obi-critical-badge")
|
|
43
|
+
], ObiCriticalBadge);
|
|
44
|
+
export {
|
|
45
|
+
ObiCriticalBadge
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=critical-badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"critical-badge.js","sources":["../../../src/components/alert-frame/critical-badge.ts"],"sourcesContent":["import {LitElement, html, css, svg} from 'lit';\nimport {customElement} from '../../decorator.js';\n\n@customElement('obi-critical-badge')\nexport class ObiCriticalBadge extends LitElement {\n private icon = svg`<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M 22,12 \n L 17,20.66 \n L 7,20.66 \n L 2,12 \n L 7,3.34 \n L 17,3.34 \n Z\" \n fill=\"currentColor\"/>\n</svg>\n`;\n\n override render() {\n return html` <div class=\"wrapper\">${this.icon}</div> `;\n }\n\n static override styles = css`\n .wrapper {\n height: 100%;\n width: 100%;\n line-height: 0;\n }\n .wrapper > * {\n height: 100%;\n width: 100%;\n }\n `;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obi-critical-badge': ObiCriticalBadge;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAIO,IAAM,mBAAN,cAA+B,WAAW;AAAA,EAA1C,cAAA;AAAA,UAAA,GAAA,SAAA;AACL,SAAQ,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAAA,EAYN,SAAS;AAChB,WAAO,6BAA6B,KAAK,IAAI;AAAA,EAC/C;AAaF;AA5Ba,iBAiBK,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAjBd,mBAAN,gBAAA;AAAA,EADN,cAAc,oBAAoB;AAAA,GACtB,gBAAA;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class ObiDiagnosticBadge extends LitElement {
|
|
3
|
+
private icon;
|
|
4
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
5
|
+
static styles: import('lit').CSSResult;
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'obi-diagnostic-badge': ObiDiagnosticBadge;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=diagnostic-badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostic-badge.d.ts","sourceRoot":"","sources":["../../../src/components/alert-frame/diagnostic-badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAiB,MAAM,KAAK,CAAC;AAG/C,qBACa,kBAAmB,SAAQ,UAAU;IAChD,OAAO,CAAC,IAAI,CAuBZ;IAES,MAAM;IAIf,OAAgB,MAAM,0BAUpB;CACH;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,kBAAkB,CAAC;KAC5C;CACF"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { css, LitElement, svg, html } from "lit";
|
|
2
|
+
import { customElement } from "../../decorator.js";
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
5
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
6
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7
|
+
if (decorator = decorators[i])
|
|
8
|
+
result = decorator(result) || result;
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
let ObiDiagnosticBadge = class extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.icon = svg`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="100" height="100">
|
|
15
|
+
<path d="M 10.5,2
|
|
16
|
+
L 13.5,2
|
|
17
|
+
L 13.5,9.4
|
|
18
|
+
L 19.91,5.7
|
|
19
|
+
L 21.41,8.3
|
|
20
|
+
L 15,12
|
|
21
|
+
L 21.41,15.7
|
|
22
|
+
L 19.91,18.3
|
|
23
|
+
L 13.5,14.6
|
|
24
|
+
L 13.5,22
|
|
25
|
+
L 10.5,22
|
|
26
|
+
L 10.5,14.6
|
|
27
|
+
L 4.09,18.3
|
|
28
|
+
L 2.59,15.7
|
|
29
|
+
L 9,12
|
|
30
|
+
L 2.59,8.3
|
|
31
|
+
L 4.09,5.7
|
|
32
|
+
L 10.5,9.4
|
|
33
|
+
Z"
|
|
34
|
+
fill="currentColor" />
|
|
35
|
+
</svg>
|
|
36
|
+
|
|
37
|
+
`;
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
return html` <div class="wrapper">${this.icon}</div> `;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
ObiDiagnosticBadge.styles = css`
|
|
44
|
+
.wrapper {
|
|
45
|
+
height: 100%;
|
|
46
|
+
width: 100%;
|
|
47
|
+
line-height: 0;
|
|
48
|
+
}
|
|
49
|
+
.wrapper > * {
|
|
50
|
+
height: 100%;
|
|
51
|
+
width: 100%;
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
ObiDiagnosticBadge = __decorateClass([
|
|
55
|
+
customElement("obi-diagnostic-badge")
|
|
56
|
+
], ObiDiagnosticBadge);
|
|
57
|
+
export {
|
|
58
|
+
ObiDiagnosticBadge
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=diagnostic-badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostic-badge.js","sources":["../../../src/components/alert-frame/diagnostic-badge.ts"],"sourcesContent":["import {LitElement, html, css, svg} from 'lit';\nimport {customElement} from '../../decorator.js';\n\n@customElement('obi-diagnostic-badge')\nexport class ObiDiagnosticBadge extends LitElement {\n private icon = svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"100\" height=\"100\">\n <path d=\"M 10.5,2 \n L 13.5,2 \n L 13.5,9.4 \n L 19.91,5.7 \n L 21.41,8.3 \n L 15,12 \n L 21.41,15.7 \n L 19.91,18.3 \n L 13.5,14.6 \n L 13.5,22 \n L 10.5,22 \n L 10.5,14.6 \n L 4.09,18.3 \n L 2.59,15.7 \n L 9,12 \n L 2.59,8.3 \n L 4.09,5.7 \n L 10.5,9.4 \n Z\" \n fill=\"currentColor\" />\n</svg>\n\n`;\n\n override render() {\n return html` <div class=\"wrapper\">${this.icon}</div> `;\n }\n\n static override styles = css`\n .wrapper {\n height: 100%;\n width: 100%;\n line-height: 0;\n }\n .wrapper > * {\n height: 100%;\n width: 100%;\n }\n `;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obi-diagnostic-badge': ObiDiagnosticBadge;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAIO,IAAM,qBAAN,cAAiC,WAAW;AAAA,EAA5C,cAAA;AAAA,UAAA,GAAA,SAAA;AACL,SAAQ,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAAA,EAyBN,SAAS;AAChB,WAAO,6BAA6B,KAAK,IAAI;AAAA,EAC/C;AAaF;AAzCa,mBA8BK,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA9Bd,qBAAN,gBAAA;AAAA,EADN,cAAc,sBAAsB;AAAA,GACxB,kBAAA;"}
|
|
@@ -4,6 +4,8 @@ import '../../icons/icon-caution-color-iec.js';
|
|
|
4
4
|
import '../../icons/icon-alarm-badge-outline.js';
|
|
5
5
|
import '../../icons/icon-warning-badge-outline.js';
|
|
6
6
|
import '../../icons/icon-caution-badge-outline.js';
|
|
7
|
+
import '../alert-frame/critical-badge.js';
|
|
8
|
+
import '../alert-frame/diagnostic-badge.js';
|
|
7
9
|
/**
|
|
8
10
|
* `obc-alert-icon` – Animated alert icon for signaling alarm and warning states.
|
|
9
11
|
*
|
|
@@ -42,10 +44,13 @@ export declare class ObcAlertIcon extends LitElement {
|
|
|
42
44
|
acknowledged: boolean;
|
|
43
45
|
active: boolean;
|
|
44
46
|
outline: boolean;
|
|
47
|
+
private get bamType();
|
|
45
48
|
get icon(): {
|
|
46
49
|
a: TemplateResult<2>;
|
|
47
50
|
b: TemplateResult<2>;
|
|
48
|
-
};
|
|
51
|
+
} | null;
|
|
52
|
+
private renderOutlineIcon;
|
|
53
|
+
private renderStaticIcon;
|
|
49
54
|
render(): TemplateResult<1>;
|
|
50
55
|
static styles: import('lit').CSSResult;
|
|
51
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-icon.d.ts","sourceRoot":"","sources":["../../../src/components/alert-icon/alert-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAa,cAAc,
|
|
1
|
+
{"version":3,"file":"alert-icon.d.ts","sourceRoot":"","sources":["../../../src/components/alert-icon/alert-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAa,cAAc,EAAU,MAAM,KAAK,CAAC;AAYnE,OAAO,uCAAuC,CAAC;AAE/C,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAQzC,OAAO,yCAAyC,CAAC;AACjD,OAAO,2CAA2C,CAAC;AACnD,OAAO,2CAA2C,CAAC;AACnD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,oCAAoC,CAAC;AA2C5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBACa,YAAa,SAAQ,UAAU;IAChB,IAAI,EAAG,SAAS,CAAC;IAChB,YAAY,EAAG,OAAO,CAAC;IACvB,MAAM,EAAG,OAAO,CAAC;IACjB,OAAO,EAAG,OAAO,CAAC;IAE7C,OAAO,KAAK,OAAO,GAElB;IAED,IAAI,IAAI;;;aAsBP;IAED,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,gBAAgB;IAYf,MAAM;IA4Bf,OAAgB,MAAM,0BAuDpB;CACH;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;KAChC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css, LitElement, html } from "lit";
|
|
1
|
+
import { css, LitElement, html, nothing } from "lit";
|
|
2
2
|
import { property } from "lit/decorators.js";
|
|
3
3
|
import { classMap } from "lit/directives/class-map.js";
|
|
4
4
|
import { alarmRectifiedA } from "./icons/icon-alarm-rectified.js";
|
|
@@ -10,9 +10,13 @@ import { warningUnackB, warningUnackA } from "./icons/icon-warning-unack.js";
|
|
|
10
10
|
import "../../icons/icon-caution-color-iec.js";
|
|
11
11
|
import { customElement } from "../../decorator.js";
|
|
12
12
|
import { AlertType } from "../../types.js";
|
|
13
|
+
import { getBamAlertTypeForBlinking, getAlertBadgeComponent, AlertBadgeComponent, supportsBlinking, getAlertBlinkMode } from "../../alert-severity.js";
|
|
13
14
|
import "../../icons/icon-alarm-badge-outline.js";
|
|
14
15
|
import "../../icons/icon-warning-badge-outline.js";
|
|
15
16
|
import "../../icons/icon-caution-badge-outline.js";
|
|
17
|
+
import "../alert-frame/critical-badge.js";
|
|
18
|
+
import "../alert-frame/diagnostic-badge.js";
|
|
19
|
+
import { criticalB, criticalA } from "./icons/icon-critical.js";
|
|
16
20
|
var __defProp = Object.defineProperty;
|
|
17
21
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
18
22
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -65,11 +69,26 @@ const mapping = {
|
|
|
65
69
|
]: {
|
|
66
70
|
a: warningSilencedA,
|
|
67
71
|
b: warningSilencedB
|
|
72
|
+
},
|
|
73
|
+
[
|
|
74
|
+
"critical"
|
|
75
|
+
/* Critical */
|
|
76
|
+
]: {
|
|
77
|
+
a: criticalA,
|
|
78
|
+
b: criticalB
|
|
68
79
|
}
|
|
69
80
|
};
|
|
70
81
|
let ObcAlertIcon = class extends LitElement {
|
|
82
|
+
get bamType() {
|
|
83
|
+
return getBamAlertTypeForBlinking(this.type);
|
|
84
|
+
}
|
|
71
85
|
get icon() {
|
|
72
|
-
if (this.type === AlertType.
|
|
86
|
+
if (this.type === AlertType.IsaCritical) {
|
|
87
|
+
return mapping[
|
|
88
|
+
"critical"
|
|
89
|
+
/* Critical */
|
|
90
|
+
];
|
|
91
|
+
} else if (this.bamType === AlertType.Alarm) {
|
|
73
92
|
if (this.active === false) {
|
|
74
93
|
return mapping[
|
|
75
94
|
"alarm-rectified"
|
|
@@ -86,7 +105,7 @@ let ObcAlertIcon = class extends LitElement {
|
|
|
86
105
|
/* AlarmUnack */
|
|
87
106
|
];
|
|
88
107
|
}
|
|
89
|
-
} else {
|
|
108
|
+
} else if (this.bamType === AlertType.Warning) {
|
|
90
109
|
if (this.active === false) {
|
|
91
110
|
return mapping[
|
|
92
111
|
"warning-rectified"
|
|
@@ -104,44 +123,61 @@ let ObcAlertIcon = class extends LitElement {
|
|
|
104
123
|
];
|
|
105
124
|
}
|
|
106
125
|
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
renderOutlineIcon() {
|
|
129
|
+
switch (getAlertBadgeComponent(this.type)) {
|
|
130
|
+
case AlertBadgeComponent.Critical:
|
|
131
|
+
return html`<obi-critical-badge></obi-critical-badge>`;
|
|
132
|
+
case AlertBadgeComponent.Warning:
|
|
133
|
+
return html`<obi-warning-badge-outline></obi-warning-badge-outline>`;
|
|
134
|
+
case AlertBadgeComponent.Caution:
|
|
135
|
+
return html`<obi-caution-badge-outline></obi-caution-badge-outline>`;
|
|
136
|
+
case AlertBadgeComponent.Diagnostic:
|
|
137
|
+
return html`<obi-diagnostic-badge
|
|
138
|
+
style="color: var(--alert-diagnostic-color);"
|
|
139
|
+
></obi-diagnostic-badge>`;
|
|
140
|
+
default:
|
|
141
|
+
return html`<obi-alarm-badge-outline></obi-alarm-badge-outline>`;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
renderStaticIcon() {
|
|
145
|
+
if (this.type === AlertType.Caution || this.type === AlertType.IsaLow) {
|
|
146
|
+
return html`<obi-caution-color-iec usecsscolor></obi-caution-color-iec>`;
|
|
147
|
+
}
|
|
148
|
+
if (this.type === AlertType.IsaDiagnostic) {
|
|
149
|
+
return html`<obi-diagnostic-badge
|
|
150
|
+
style="color: var(--alert-diagnostic-color);"
|
|
151
|
+
></obi-diagnostic-badge>`;
|
|
152
|
+
}
|
|
153
|
+
return nothing;
|
|
107
154
|
}
|
|
108
155
|
render() {
|
|
109
156
|
if (!this.type) {
|
|
110
157
|
return html`<div>No alarm</div>`;
|
|
111
158
|
}
|
|
112
|
-
let icon;
|
|
113
159
|
if (this.outline) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
break;
|
|
118
|
-
case AlertType.Warning:
|
|
119
|
-
icon = html`<obi-warning-badge-outline></obi-warning-badge-outline>`;
|
|
120
|
-
break;
|
|
121
|
-
case AlertType.Caution:
|
|
122
|
-
icon = html`<obi-caution-badge-outline></obi-caution-badge-outline>`;
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
} else if (this.type === AlertType.Caution) {
|
|
126
|
-
icon = html`<obi-caution-color-iec usecsscolor></obi-caution-color-iec>`;
|
|
127
|
-
} else if ([AlertType.Alarm, AlertType.Warning].includes(this.type)) {
|
|
160
|
+
return html`<div class="wrapper">${this.renderOutlineIcon()}</div>`;
|
|
161
|
+
}
|
|
162
|
+
if (supportsBlinking(this.type) && !(this.type === AlertType.IsaLow)) {
|
|
128
163
|
const icons = this.icon;
|
|
129
|
-
|
|
164
|
+
if (!icons) {
|
|
165
|
+
throw new Error("No icon found");
|
|
166
|
+
}
|
|
167
|
+
const blinkMode = getAlertBlinkMode(this.type);
|
|
130
168
|
return html`
|
|
131
169
|
<div
|
|
132
170
|
class=${classMap({
|
|
133
171
|
wrapper: true,
|
|
134
|
-
|
|
172
|
+
[`blink-${blinkMode}`]: true
|
|
135
173
|
})}
|
|
136
174
|
>
|
|
137
175
|
<span class="a">${icons.a}</span>
|
|
138
176
|
<span class="b">${icons.b}</span>
|
|
139
177
|
</div>
|
|
140
178
|
`;
|
|
141
|
-
} else {
|
|
142
|
-
return html`<div>No alarm</div>`;
|
|
143
179
|
}
|
|
144
|
-
return html`<div class="wrapper">${
|
|
180
|
+
return html`<div class="wrapper">${this.renderStaticIcon()}</div>`;
|
|
145
181
|
}
|
|
146
182
|
};
|
|
147
183
|
ObcAlertIcon.styles = css`
|
|
@@ -149,33 +185,55 @@ ObcAlertIcon.styles = css`
|
|
|
149
185
|
height: 100%;
|
|
150
186
|
width: 100%;
|
|
151
187
|
position: relative;
|
|
152
|
-
}
|
|
153
|
-
.wrapper svg {
|
|
154
|
-
height: 100%;
|
|
155
|
-
width: 100%;
|
|
156
|
-
position: absolute;
|
|
157
|
-
top: 0;
|
|
158
|
-
left: 0;
|
|
159
|
-
}
|
|
160
188
|
|
|
161
|
-
|
|
162
|
-
|
|
189
|
+
obi-diagnostic-badge,
|
|
190
|
+
obi-critical-badge {
|
|
191
|
+
display: block;
|
|
192
|
+
height: 100%;
|
|
193
|
+
width: 100%;
|
|
194
|
+
position: absolute;
|
|
195
|
+
top: 0;
|
|
196
|
+
left: 0;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
svg {
|
|
200
|
+
height: 100%;
|
|
201
|
+
width: 100%;
|
|
202
|
+
position: absolute;
|
|
203
|
+
top: 0;
|
|
204
|
+
left: 0;
|
|
205
|
+
}
|
|
206
|
+
&.blink-alarm .a {
|
|
163
207
|
opacity: var(--alarm-blink-on);
|
|
164
208
|
}
|
|
165
209
|
|
|
166
|
-
.b {
|
|
210
|
+
&.blink-alarm .b {
|
|
167
211
|
opacity: var(--alarm-blink-off);
|
|
168
212
|
}
|
|
169
|
-
}
|
|
170
213
|
|
|
171
|
-
|
|
172
|
-
|
|
214
|
+
&.blink-critical .a {
|
|
215
|
+
opacity: var(--critical-blink-on);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
&.blink-critical .b {
|
|
219
|
+
opacity: var(--critical-blink-off);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
&.blink-warning .a {
|
|
173
223
|
opacity: var(--warning-blink-on);
|
|
174
224
|
}
|
|
175
225
|
|
|
176
|
-
.b {
|
|
226
|
+
&.blink-warning .b {
|
|
177
227
|
opacity: var(--warning-blink-off);
|
|
178
228
|
}
|
|
229
|
+
|
|
230
|
+
&.blink-low .a {
|
|
231
|
+
opacity: var(--low-blink-on);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
&.blink-low .b {
|
|
235
|
+
opacity: var(--low-blink-off);
|
|
236
|
+
}
|
|
179
237
|
}
|
|
180
238
|
`;
|
|
181
239
|
__decorateClass([
|