@oicl/openbridge-webcomponents-full-bundle 2.2.0-next.15 → 2.2.0-next.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/openbridge-webcomponents.bundle.js +320 -64
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +1752 -15
- package/dist/automation/analog-threeway-valve/analog-threeway-valve.d.ts +4 -4
- package/dist/automation/analog-threeway-valve/analog-threeway-valve.js.map +1 -1
- package/dist/automation/automation-badge/automation-badge.css_inline.js +6 -0
- package/dist/automation/automation-badge/automation-badge.d.ts +61 -1
- package/dist/automation/automation-badge/automation-badge.d.ts.map +1 -1
- package/dist/automation/automation-badge/automation-badge.js +83 -1
- package/dist/automation/automation-badge/automation-badge.js.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts +20 -0
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js +1 -0
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button.d.ts +16 -4
- package/dist/automation/automation-button/abstract-automation-button.d.ts.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button.js +46 -20
- package/dist/automation/automation-button/abstract-automation-button.js.map +1 -1
- package/dist/automation/automation-button/badge-layout.d.ts +34 -0
- package/dist/automation/automation-button/badge-layout.d.ts.map +1 -0
- package/dist/automation/automation-button/badge-layout.js +64 -0
- package/dist/automation/automation-button/badge-layout.js.map +1 -0
- package/dist/automation/automation-tank/automation-tank.d.ts.map +1 -1
- package/dist/automation/automation-tank/automation-tank.js +7 -2
- package/dist/automation/automation-tank/automation-tank.js.map +1 -1
- package/dist/automation/digital-threeway-valve/digital-threeway-valve.d.ts +4 -4
- package/dist/automation/digital-threeway-valve/digital-threeway-valve.js.map +1 -1
- package/dist/automation/electricity-battery/electricity-battery.d.ts +4 -4
- package/dist/automation/electricity-battery/electricity-battery.js.map +1 -1
- package/dist/automation/specialty-tank/abstract-specialty-tank.d.ts.map +1 -1
- package/dist/automation/specialty-tank/abstract-specialty-tank.js +7 -2
- package/dist/automation/specialty-tank/abstract-specialty-tank.js.map +1 -1
- package/dist/internal/global-setting.d.ts +55 -0
- package/dist/internal/global-setting.d.ts.map +1 -0
- package/dist/internal/global-setting.js +86 -0
- package/dist/internal/global-setting.js.map +1 -0
- package/package.json +3 -2
- package/script/check-typography-ramp.ts +144 -0
- package/script/typography/ramp.ts +237 -0
- package/script/typography-ramp.test.ts +267 -0
- package/src/automation/analog-threeway-valve/analog-threeway-valve.ts +4 -4
- package/src/automation/analog-valve/analog-valve.stories.ts +8 -0
- package/src/automation/automation-badge/automation-badge.css +6 -0
- package/src/automation/automation-badge/automation-badge.stories.ts +47 -3
- package/src/automation/automation-badge/automation-badge.ts +124 -1
- package/src/automation/automation-button/abstract-automation-button-storybook-helpers.ts +3 -0
- package/src/automation/automation-button/abstract-automation-button.ts +70 -23
- package/src/automation/automation-button/badge-layout.spec.ts +138 -0
- package/src/automation/automation-button/badge-layout.ts +120 -0
- package/src/automation/automation-tank/automation-tank.ts +11 -6
- package/src/automation/digital-threeway-valve/digital-threeway-valve.ts +4 -4
- package/src/automation/electricity-battery/electricity-battery.ts +4 -4
- package/src/automation/pump/pump.stories.ts +59 -0
- package/src/automation/specialty-tank/abstract-specialty-tank.ts +11 -6
- package/src/internal/global-setting.spec.ts +119 -0
- package/src/internal/global-setting.ts +105 -0
|
@@ -5,6 +5,7 @@ import { ObcAlertFrameMode, ObcAlertFrameThickness, ObcAlertFrameType } from "..
|
|
|
5
5
|
import { AlertType } from "../../types.js";
|
|
6
6
|
import { ObcAutomationBadgeType } from "../automation-badge/automation-badge.js";
|
|
7
7
|
import { CircularProgressMode } from "../../building-blocks/circular-progress/circular-progress.js";
|
|
8
|
+
import { AutomationButtonBadgeKind, BadgeLayoutController } from "./badge-layout.js";
|
|
8
9
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.js";
|
|
9
10
|
import { LitElement, html, nothing } from "lit";
|
|
10
11
|
import { property, queryAssignedElements } from "lit/decorators.js";
|
|
@@ -12,6 +13,7 @@ import { property, queryAssignedElements } from "lit/decorators.js";
|
|
|
12
13
|
var AutomationButtonBadgeAlert = /* @__PURE__ */ function(AutomationButtonBadgeAlert) {
|
|
13
14
|
AutomationButtonBadgeAlert["None"] = "none";
|
|
14
15
|
AutomationButtonBadgeAlert["Silence"] = "silence";
|
|
16
|
+
AutomationButtonBadgeAlert["Shelved"] = "shelved";
|
|
15
17
|
AutomationButtonBadgeAlert["Caution"] = "caution";
|
|
16
18
|
AutomationButtonBadgeAlert["Warning"] = "warning";
|
|
17
19
|
AutomationButtonBadgeAlert["Alarm"] = "alarm";
|
|
@@ -26,6 +28,7 @@ var AutomationButtonBadgeInterlock = /* @__PURE__ */ function(AutomationButtonBa
|
|
|
26
28
|
AutomationButtonBadgeInterlock["None"] = "none";
|
|
27
29
|
AutomationButtonBadgeInterlock["Interlock"] = "interlock";
|
|
28
30
|
AutomationButtonBadgeInterlock["InterlockInhibit"] = "interlock-inhibit";
|
|
31
|
+
AutomationButtonBadgeInterlock["Simulation"] = "simulation";
|
|
29
32
|
return AutomationButtonBadgeInterlock;
|
|
30
33
|
}({});
|
|
31
34
|
var AutomationButtonBadgeControl = /* @__PURE__ */ function(AutomationButtonBadgeControl) {
|
|
@@ -40,6 +43,7 @@ var AutomationButtonBadgeControl = /* @__PURE__ */ function(AutomationButtonBadg
|
|
|
40
43
|
var AutomationButtonBadgeCommandLocked = /* @__PURE__ */ function(AutomationButtonBadgeCommandLocked) {
|
|
41
44
|
AutomationButtonBadgeCommandLocked["None"] = "none";
|
|
42
45
|
AutomationButtonBadgeCommandLocked["CommandLocked"] = "command-locked";
|
|
46
|
+
AutomationButtonBadgeCommandLocked["Simulation"] = "simulation";
|
|
43
47
|
return AutomationButtonBadgeCommandLocked;
|
|
44
48
|
}({});
|
|
45
49
|
/**
|
|
@@ -47,8 +51,11 @@ var AutomationButtonBadgeCommandLocked = /* @__PURE__ */ function(AutomationButt
|
|
|
47
51
|
*
|
|
48
52
|
* Renders an `<obc-automation-button>` with the shared surface every device
|
|
49
53
|
* button needs: the readout stack and its status row, the alert frame, the
|
|
50
|
-
* circular progress indicator, and the four badge corners
|
|
51
|
-
*
|
|
54
|
+
* circular progress indicator, and the four badge corners with their slots and
|
|
55
|
+
* enum-driven fallbacks. Which badge goes in which corner follows the badge
|
|
56
|
+
* layout (`badge-layout.ts`): control top-left, alert top-right, interlock
|
|
57
|
+
* bottom-left and command-locked bottom-right unless the app or `badgeLayout`
|
|
58
|
+
* moves them.
|
|
52
59
|
*
|
|
53
60
|
* ## Usage Guidelines
|
|
54
61
|
*
|
|
@@ -70,6 +77,7 @@ var AutomationButtonBadgeCommandLocked = /* @__PURE__ */ function(AutomationButt
|
|
|
70
77
|
* @availableWhen alertFrameMode alert==true
|
|
71
78
|
* @availableWhen showAlertCategoryIcon alert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]
|
|
72
79
|
* @availableWhen showAlertIcon alert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]
|
|
80
|
+
* @property badgeLayout - Which badge kind each corner shows, on top of the app-wide layout set with `setAutomationBadgeLayout()`. A corner left out keeps the app-wide badge, `null` leaves it empty, and a badge moved here leaves the corner it came from.
|
|
73
81
|
* @property progress - Shows a progress indicator, used to indicate that an user action is in progress
|
|
74
82
|
* @availableWhen progressMode progress==true
|
|
75
83
|
* @availableWhen progressValue progress==true && progressMode in [determinate, progressiveIndeterminate]
|
|
@@ -100,6 +108,8 @@ var ObcAbstractAutomationButton = class extends LitElement {
|
|
|
100
108
|
this.badgeCommandLocked = "none";
|
|
101
109
|
this.badgeInterlock = "none";
|
|
102
110
|
this.badgeAlert = "none";
|
|
111
|
+
this.badgeLayout = void 0;
|
|
112
|
+
this._badgeLayout = new BadgeLayoutController(this);
|
|
103
113
|
}
|
|
104
114
|
get icon() {
|
|
105
115
|
throw new Error("Method \"icon\" must be implemented in subclass");
|
|
@@ -150,12 +160,12 @@ var ObcAbstractAutomationButton = class extends LitElement {
|
|
|
150
160
|
get _isVertical() {
|
|
151
161
|
return this._orientation !== AutomationButtonOrientation.horizontal || "vertical" in this && Boolean(this.vertical);
|
|
152
162
|
}
|
|
153
|
-
getBadgeSpacer() {
|
|
163
|
+
getBadgeSpacer(badges) {
|
|
154
164
|
if (!this.showReadoutStack) return false;
|
|
155
|
-
const topLeft = this.badgeTopLeft.length > 0 ||
|
|
156
|
-
const topRight = this.badgeTopRight.length > 0 ||
|
|
157
|
-
const bottomLeft = this.badgeBottomLeft.length > 0 ||
|
|
158
|
-
const bottomRight = this.badgeBottomRight.length > 0 ||
|
|
165
|
+
const topLeft = this.badgeTopLeft.length > 0 || badges.topLeft !== null;
|
|
166
|
+
const topRight = this.badgeTopRight.length > 0 || badges.topRight !== null;
|
|
167
|
+
const bottomLeft = this.badgeBottomLeft.length > 0 || badges.bottomLeft !== null;
|
|
168
|
+
const bottomRight = this.badgeBottomRight.length > 0 || badges.bottomRight !== null;
|
|
159
169
|
if (this._readoutPosition === AutomationButtonReadoutPosition.top) return topRight || topLeft;
|
|
160
170
|
else if (this._readoutPosition === AutomationButtonReadoutPosition.bottom) return bottomLeft || bottomRight;
|
|
161
171
|
else if (this._readoutPosition === AutomationButtonReadoutPosition.left) return topLeft || bottomLeft;
|
|
@@ -165,8 +175,18 @@ var ObcAbstractAutomationButton = class extends LitElement {
|
|
|
165
175
|
handleBadgeSlotChange() {
|
|
166
176
|
this.requestUpdate();
|
|
167
177
|
}
|
|
178
|
+
getBadgeType(kind) {
|
|
179
|
+
switch (kind) {
|
|
180
|
+
case AutomationButtonBadgeKind.Control: return this.getBadgeControlType();
|
|
181
|
+
case AutomationButtonBadgeKind.Alert: return this.getBadgeAlertType();
|
|
182
|
+
case AutomationButtonBadgeKind.Interlock: return this.getBadgeInterlockType();
|
|
183
|
+
case AutomationButtonBadgeKind.CommandLocked: return this.getBadgeCommandLockedType();
|
|
184
|
+
default: return null;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
168
187
|
getBadgeAlertType() {
|
|
169
188
|
if (this.badgeAlert === "silence") return ObcAutomationBadgeType.AlertSilenced;
|
|
189
|
+
else if (this.badgeAlert === "shelved") return ObcAutomationBadgeType.AlertShelved;
|
|
170
190
|
else if (this.badgeAlert === "caution") return ObcAutomationBadgeType.Caution;
|
|
171
191
|
else if (this.badgeAlert === "warning") return ObcAutomationBadgeType.Warning;
|
|
172
192
|
else if (this.badgeAlert === "alarm") return ObcAutomationBadgeType.Alarm;
|
|
@@ -188,18 +208,23 @@ var ObcAbstractAutomationButton = class extends LitElement {
|
|
|
188
208
|
getBadgeInterlockType() {
|
|
189
209
|
if (this.badgeInterlock === "interlock") return ObcAutomationBadgeType.Interlock;
|
|
190
210
|
else if (this.badgeInterlock === "interlock-inhibit") return ObcAutomationBadgeType.InterlockInhibit;
|
|
211
|
+
else if (this.badgeInterlock === "simulation") return ObcAutomationBadgeType.Simulation;
|
|
191
212
|
return null;
|
|
192
213
|
}
|
|
193
214
|
getBadgeCommandLockedType() {
|
|
194
215
|
if (this.badgeCommandLocked === "command-locked") return ObcAutomationBadgeType.CommandLocked;
|
|
216
|
+
else if (this.badgeCommandLocked === "simulation") return ObcAutomationBadgeType.Simulation;
|
|
195
217
|
return null;
|
|
196
218
|
}
|
|
197
219
|
render() {
|
|
198
220
|
const readouts = [...this.extraReadouts];
|
|
199
|
-
const
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
221
|
+
const layout = this._badgeLayout.resolve(this.badgeLayout);
|
|
222
|
+
const badges = {
|
|
223
|
+
topLeft: this.getBadgeType(layout.topLeft),
|
|
224
|
+
topRight: this.getBadgeType(layout.topRight),
|
|
225
|
+
bottomLeft: this.getBadgeType(layout.bottomLeft),
|
|
226
|
+
bottomRight: this.getBadgeType(layout.bottomRight)
|
|
227
|
+
};
|
|
203
228
|
return html`<obc-automation-button
|
|
204
229
|
.state=${this._on ? AutomationButtonState.open : AutomationButtonState.closed}
|
|
205
230
|
.readouts=${readouts}
|
|
@@ -221,7 +246,7 @@ var ObcAbstractAutomationButton = class extends LitElement {
|
|
|
221
246
|
.variant=${this._variant}
|
|
222
247
|
.direction=${this._direction}
|
|
223
248
|
.orientation=${this._orientation}
|
|
224
|
-
.hasBadgeSpacer=${this.getBadgeSpacer()}
|
|
249
|
+
.hasBadgeSpacer=${this.getBadgeSpacer(badges)}
|
|
225
250
|
.handlePosition=${this._handlePosition}
|
|
226
251
|
.static=${this.static}
|
|
227
252
|
.handleSize=${this._handleSize}
|
|
@@ -235,8 +260,8 @@ var ObcAbstractAutomationButton = class extends LitElement {
|
|
|
235
260
|
slot="badge-top-right"
|
|
236
261
|
@slotchange=${this.handleBadgeSlotChange}
|
|
237
262
|
>
|
|
238
|
-
${
|
|
239
|
-
.type=${
|
|
263
|
+
${badges.topRight ? html`<obc-automation-badge
|
|
264
|
+
.type=${badges.topRight}
|
|
240
265
|
></obc-automation-badge>` : nothing}
|
|
241
266
|
</slot>
|
|
242
267
|
<slot
|
|
@@ -244,8 +269,8 @@ var ObcAbstractAutomationButton = class extends LitElement {
|
|
|
244
269
|
slot="badge-top-left"
|
|
245
270
|
@slotchange=${this.handleBadgeSlotChange}
|
|
246
271
|
>
|
|
247
|
-
${
|
|
248
|
-
.type=${
|
|
272
|
+
${badges.topLeft ? html`<obc-automation-badge
|
|
273
|
+
.type=${badges.topLeft}
|
|
249
274
|
></obc-automation-badge>` : nothing}
|
|
250
275
|
</slot>
|
|
251
276
|
<slot
|
|
@@ -253,8 +278,8 @@ var ObcAbstractAutomationButton = class extends LitElement {
|
|
|
253
278
|
slot="badge-bottom-left"
|
|
254
279
|
@slotchange=${this.handleBadgeSlotChange}
|
|
255
280
|
>
|
|
256
|
-
${
|
|
257
|
-
.type=${
|
|
281
|
+
${badges.bottomLeft ? html`<obc-automation-badge
|
|
282
|
+
.type=${badges.bottomLeft}
|
|
258
283
|
></obc-automation-badge>` : nothing}
|
|
259
284
|
</slot>
|
|
260
285
|
<slot
|
|
@@ -262,8 +287,8 @@ var ObcAbstractAutomationButton = class extends LitElement {
|
|
|
262
287
|
slot="badge-bottom-right"
|
|
263
288
|
@slotchange=${this.handleBadgeSlotChange}
|
|
264
289
|
>
|
|
265
|
-
${
|
|
266
|
-
.type=${
|
|
290
|
+
${badges.bottomRight ? html`<obc-automation-badge
|
|
291
|
+
.type=${badges.bottomRight}
|
|
267
292
|
></obc-automation-badge>` : nothing}
|
|
268
293
|
</slot>
|
|
269
294
|
${this._handle !== false ? this._handle : nothing}
|
|
@@ -305,6 +330,7 @@ __decorate([property({ type: String })], ObcAbstractAutomationButton.prototype,
|
|
|
305
330
|
__decorate([property({ type: String })], ObcAbstractAutomationButton.prototype, "badgeCommandLocked", void 0);
|
|
306
331
|
__decorate([property({ type: String })], ObcAbstractAutomationButton.prototype, "badgeInterlock", void 0);
|
|
307
332
|
__decorate([property({ type: String })], ObcAbstractAutomationButton.prototype, "badgeAlert", void 0);
|
|
333
|
+
__decorate([property({ attribute: false })], ObcAbstractAutomationButton.prototype, "badgeLayout", void 0);
|
|
308
334
|
__decorate([queryAssignedElements({ slot: "badge-top-right" })], ObcAbstractAutomationButton.prototype, "badgeTopRight", void 0);
|
|
309
335
|
__decorate([queryAssignedElements({ slot: "badge-top-left" })], ObcAbstractAutomationButton.prototype, "badgeTopLeft", void 0);
|
|
310
336
|
__decorate([queryAssignedElements({ slot: "badge-bottom-left" })], ObcAbstractAutomationButton.prototype, "badgeBottomLeft", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-automation-button.js","names":["_decorate"],"sources":["../../../src/automation/automation-button/abstract-automation-button.ts"],"sourcesContent":["import {\n ObcValveHandle,\n ValveHandleState,\n valveHandleIcon,\n} from './valve-handle.js';\nimport {\n HTMLTemplateResult,\n LitElement,\n TemplateResult,\n html,\n nothing,\n} from 'lit';\nimport {property, queryAssignedElements} from 'lit/decorators.js';\nimport '../automation-button/automation-button.js';\nimport {\n AutomationButtonDirection,\n AutomationButtonHandlePosition,\n AutomationButtonHandleSize,\n AutomationButtonOrientation,\n AutomationButtonPositioning,\n AutomationButtonReadoutPosition,\n AutomationButtonSelfActuationLine,\n AutomationButtonState,\n AutomationButtonVariant,\n} from '../automation-button/automation-button.js';\nimport {\n AutomationButtonReadoutStack,\n AutomationButtonReadoutStackSize,\n} from '../../components/automation-button-readout-stack/automation-button-readout-stack.js';\nimport {\n ObcAlertFrameThickness,\n ObcAlertFrameType,\n ObcAlertFrameMode,\n} from '../../components/alert-frame/alert-frame.js';\nimport {AlertType} from '../../types.js';\nimport '../automation-badge/automation-badge.js';\nimport {ObcAutomationBadgeType} from '../automation-badge/automation-badge.js';\nimport {CircularProgressMode} from '../../building-blocks/circular-progress/circular-progress.js';\n\nexport enum AutomationButtonBadgeAlert {\n None = 'none',\n Silence = 'silence',\n Caution = 'caution',\n Warning = 'warning',\n Alarm = 'alarm',\n LevelCritical = 'level-critical',\n LevelHigh = 'level-high',\n LevelMedium = 'level-medium',\n LevelLow = 'level-low',\n LevelDiagnostic = 'level-diagnostic',\n}\n\nexport enum AutomationButtonBadgeInterlock {\n None = 'none',\n Interlock = 'interlock',\n InterlockInhibit = 'interlock-inhibit',\n}\n\nexport enum AutomationButtonBadgeControl {\n None = 'none',\n Local = 'local',\n LocalOnly = 'local-only',\n Manual = 'manual',\n ManualOnly = 'manual-only',\n Auto = 'auto',\n}\n\nexport enum AutomationButtonBadgeCommandLocked {\n None = 'none',\n CommandLocked = 'command-locked',\n}\n\n/**\n * Base class for the automation device buttons.\n *\n * Renders an `<obc-automation-button>` with the shared surface every device\n * button needs: the readout stack and its status row, the alert frame, the\n * circular progress indicator, and the four badge corners (control, alert,\n * interlock, command-locked) with their slots and enum-driven fallbacks.\n *\n * ## Usage Guidelines\n *\n * Not registered as a custom element. A subclass supplies the device\n * rendering through `icon`, `_on` and `_variant`, and may add rows to the\n * readout stack through `extraReadouts`. `ObcAbstractAutomationButtonSquared`\n * and `ObcAbstractAutomationButtonMotorized` extend it further;\n * `obc-analog-valve` and `obc-digital-valve` extend it directly.\n *\n * @property static - Draws the device as present with its state unknown: a grey button, and the static icon where the device has one.\n * @availableWhen readoutPosition showReadoutStack==true\n * @availableWhen showStatus showReadoutStack==true\n * @availableWhen readoutSize showReadoutStack==true\n * @availableWhen tag showReadoutStack==true\n * @property activated - Enables the activated background color, used to indicate that the button is activated/selected.\n * @availableWhen alertFrameType alert==true\n * @availableWhen alertFrameThickness alert==true\n * @availableWhen alertFrameStatus alert==true\n * @availableWhen alertFrameMode alert==true\n * @availableWhen showAlertCategoryIcon alert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]\n * @availableWhen showAlertIcon alert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]\n * @property progress - Shows a progress indicator, used to indicate that an user action is in progress\n * @availableWhen progressMode progress==true\n * @availableWhen progressValue progress==true && progressMode in [determinate, progressiveIndeterminate]\n */\nexport class ObcAbstractAutomationButton extends LitElement {\n @property({type: Boolean, attribute: false}) showReadoutStack: boolean = true;\n @property({type: Boolean}) static: boolean = false;\n @property({type: String}) readoutPosition:\n AutomationButtonReadoutPosition | undefined = undefined;\n @property({type: Boolean, attribute: false}) showStatus: boolean = true;\n @property({type: Boolean, attribute: false}) showStatusIcon: boolean = false;\n @property({type: String}) readoutSize: AutomationButtonReadoutStackSize =\n AutomationButtonReadoutStackSize.regular;\n @property({type: String}) tag: string | null = null;\n\n @property({type: String}) positioning: AutomationButtonPositioning =\n AutomationButtonPositioning.point;\n @property({type: Boolean}) activated: boolean = false;\n @property({type: Boolean}) alert: boolean = false;\n @property({type: String}) alertFrameType: ObcAlertFrameType =\n ObcAlertFrameType.SmallSideFlip;\n @property({type: String}) alertFrameThickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n @property({type: String}) alertFrameStatus: AlertType = AlertType.Alarm;\n @property({type: String}) alertFrameMode: ObcAlertFrameMode =\n ObcAlertFrameMode.ackedActive;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n @property({type: Boolean}) showAlertIcon: boolean = false;\n @property({type: Boolean}) progress: boolean = false;\n @property({type: String}) progressMode: CircularProgressMode =\n CircularProgressMode.indeterminate;\n @property({type: Number}) progressValue: number = 0;\n\n @property({type: String}) badgeControl: AutomationButtonBadgeControl =\n AutomationButtonBadgeControl.None;\n @property({type: String})\n badgeCommandLocked: AutomationButtonBadgeCommandLocked =\n AutomationButtonBadgeCommandLocked.None;\n @property({type: String}) badgeInterlock: AutomationButtonBadgeInterlock =\n AutomationButtonBadgeInterlock.None;\n @property({type: String}) badgeAlert: AutomationButtonBadgeAlert =\n AutomationButtonBadgeAlert.None;\n\n get icon(): TemplateResult {\n throw new Error('Method \"icon\" must be implemented in subclass');\n }\n\n get _on(): boolean {\n throw new Error('Method \"_on\" must be implemented in subclass');\n }\n\n get _variant(): AutomationButtonVariant {\n // @ts-expect-error - property should be defined in subclass\n return this.variant as AutomationButtonVariant;\n }\n\n get _orientation(): AutomationButtonOrientation {\n return AutomationButtonOrientation.horizontal;\n }\n\n get _direction(): AutomationButtonDirection {\n if ('direction' in this) {\n return this.direction as AutomationButtonDirection;\n }\n return AutomationButtonDirection.forward;\n }\n\n get extraReadouts(): AutomationButtonReadoutStack[] {\n return [];\n }\n\n /** Name of a device that can render with no text of its own. */\n get _accessibleName(): string | null {\n return null;\n }\n\n get _handlePosition(): AutomationButtonHandlePosition {\n return AutomationButtonHandlePosition.none;\n }\n\n get _handleSize(): AutomationButtonHandleSize {\n return AutomationButtonHandleSize.regular;\n }\n\n get _handle(): HTMLTemplateResult | false {\n return false;\n }\n\n /** The given handle on this device's side, in the colours of its state. */\n protected renderValveHandle(\n handle: ObcValveHandle\n ): HTMLTemplateResult | false {\n let state = this._on ? ValveHandleState.on : ValveHandleState.off;\n if (this.static) {\n state = ValveHandleState.static;\n }\n return valveHandleIcon(\n handle,\n this._handlePosition,\n state,\n this._handleSize\n );\n }\n\n get _selfActuationLine(): AutomationButtonSelfActuationLine {\n return AutomationButtonSelfActuationLine.none;\n }\n\n @queryAssignedElements({slot: 'badge-top-right'})\n badgeTopRight!: HTMLElement[];\n @queryAssignedElements({slot: 'badge-top-left'})\n badgeTopLeft!: HTMLElement[];\n @queryAssignedElements({slot: 'badge-bottom-left'})\n badgeBottomLeft!: HTMLElement[];\n @queryAssignedElements({slot: 'badge-bottom-right'})\n badgeBottomRight!: HTMLElement[];\n\n protected get _readoutPosition(): AutomationButtonReadoutPosition {\n if (this.readoutPosition) {\n return this.readoutPosition;\n }\n return this._isVertical\n ? AutomationButtonReadoutPosition.left\n : AutomationButtonReadoutPosition.bottom;\n }\n\n /** True when the device sits on a vertical pipe, which puts the default readout on the left. */\n protected get _isVertical(): boolean {\n return (\n this._orientation !== AutomationButtonOrientation.horizontal ||\n ('vertical' in this && Boolean(this.vertical))\n );\n }\n\n private getBadgeSpacer(): boolean {\n if (!this.showReadoutStack) {\n return false;\n }\n\n const topLeft =\n this.badgeTopLeft.length > 0 || this.getBadgeControlType() !== null;\n const topRight =\n this.badgeTopRight.length > 0 || this.getBadgeAlertType() !== null;\n const bottomLeft =\n this.badgeBottomLeft.length > 0 || this.getBadgeInterlockType() !== null;\n const bottomRight =\n this.badgeBottomRight.length > 0 ||\n this.getBadgeCommandLockedType() !== null;\n if (this._readoutPosition === AutomationButtonReadoutPosition.top) {\n return topRight || topLeft;\n } else if (\n this._readoutPosition === AutomationButtonReadoutPosition.bottom\n ) {\n return bottomLeft || bottomRight;\n } else if (this._readoutPosition === AutomationButtonReadoutPosition.left) {\n return topLeft || bottomLeft;\n } else if (\n this._readoutPosition === AutomationButtonReadoutPosition.right\n ) {\n return topRight || bottomRight;\n }\n return false;\n }\n\n private handleBadgeSlotChange() {\n this.requestUpdate();\n }\n\n private getBadgeAlertType(): ObcAutomationBadgeType | null {\n if (this.badgeAlert === AutomationButtonBadgeAlert.Silence) {\n return ObcAutomationBadgeType.AlertSilenced;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.Caution) {\n return ObcAutomationBadgeType.Caution;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.Warning) {\n return ObcAutomationBadgeType.Warning;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.Alarm) {\n return ObcAutomationBadgeType.Alarm;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.LevelCritical) {\n return ObcAutomationBadgeType.LevelCritical;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.LevelHigh) {\n return ObcAutomationBadgeType.LevelHigh;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.LevelMedium) {\n return ObcAutomationBadgeType.LevelMedium;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.LevelLow) {\n return ObcAutomationBadgeType.LevelLow;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.LevelDiagnostic) {\n return ObcAutomationBadgeType.LevelDiagnostic;\n }\n return null;\n }\n\n private getBadgeControlType(): ObcAutomationBadgeType | null {\n if (this.badgeControl === AutomationButtonBadgeControl.Local) {\n return ObcAutomationBadgeType.Local;\n } else if (this.badgeControl === AutomationButtonBadgeControl.LocalOnly) {\n return ObcAutomationBadgeType.LocalOnly;\n } else if (this.badgeControl === AutomationButtonBadgeControl.Manual) {\n return ObcAutomationBadgeType.Manual;\n } else if (this.badgeControl === AutomationButtonBadgeControl.ManualOnly) {\n return ObcAutomationBadgeType.ManualOnly;\n } else if (this.badgeControl === AutomationButtonBadgeControl.Auto) {\n return ObcAutomationBadgeType.Auto;\n }\n return null;\n }\n\n private getBadgeInterlockType(): ObcAutomationBadgeType | null {\n if (this.badgeInterlock === AutomationButtonBadgeInterlock.Interlock) {\n return ObcAutomationBadgeType.Interlock;\n } else if (\n this.badgeInterlock === AutomationButtonBadgeInterlock.InterlockInhibit\n ) {\n return ObcAutomationBadgeType.InterlockInhibit;\n }\n return null;\n }\n\n private getBadgeCommandLockedType(): ObcAutomationBadgeType | null {\n if (\n this.badgeCommandLocked ===\n AutomationButtonBadgeCommandLocked.CommandLocked\n ) {\n return ObcAutomationBadgeType.CommandLocked;\n }\n return null;\n }\n\n override render() {\n const readouts: AutomationButtonReadoutStack[] = [...this.extraReadouts];\n const badgeAlertType = this.getBadgeAlertType();\n const badgeControlType = this.getBadgeControlType();\n const badgeInterlockType = this.getBadgeInterlockType();\n const badgeCommandLockedType = this.getBadgeCommandLockedType();\n\n return html`<obc-automation-button\n .state=${\n this._on ? AutomationButtonState.open : AutomationButtonState.closed\n }\n .readouts=${readouts}\n .tag=${this.tag}\n .accessibleName=${this._accessibleName}\n .showReadoutStack=${this.showReadoutStack}\n .readoutPosition=${this._readoutPosition}\n .readoutSize=${this.readoutSize}\n ?alert=${this.alert}\n .alertFrameType=${this.alertFrameType}\n .alertFrameThickness=${this.alertFrameThickness}\n .alertFrameStatus=${this.alertFrameStatus}\n .alertFrameMode=${this.alertFrameMode}\n .showAlertCategoryIcon=${this.showAlertCategoryIcon}\n .showAlertIcon=${this.showAlertIcon}\n ?progress=${this.progress}\n .progressMode=${this.progressMode}\n .progressValue=${this.progressValue}\n .variant=${this._variant}\n .direction=${this._direction}\n .orientation=${this._orientation}\n .hasBadgeSpacer=${this.getBadgeSpacer()}\n .handlePosition=${this._handlePosition}\n .static=${this.static}\n .handleSize=${this._handleSize}\n .positioning=${this.positioning}\n .selfActuationLine=${this._selfActuationLine}\n ?activated=${this.activated}\n >\n ${this.icon}\n <slot\n name=\"badge-top-right\"\n slot=\"badge-top-right\"\n @slotchange=${this.handleBadgeSlotChange}\n >\n ${\n badgeAlertType\n ? html`<obc-automation-badge\n .type=${badgeAlertType}\n ></obc-automation-badge>`\n : nothing\n }\n </slot>\n <slot\n name=\"badge-top-left\"\n slot=\"badge-top-left\"\n @slotchange=${this.handleBadgeSlotChange}\n >\n ${\n badgeControlType\n ? html`<obc-automation-badge\n .type=${badgeControlType}\n ></obc-automation-badge>`\n : nothing\n }\n </slot>\n <slot\n name=\"badge-bottom-left\"\n slot=\"badge-bottom-left\"\n @slotchange=${this.handleBadgeSlotChange}\n >\n ${\n badgeInterlockType\n ? html`<obc-automation-badge\n .type=${badgeInterlockType}\n ></obc-automation-badge>`\n : nothing\n }\n </slot>\n <slot\n name=\"badge-bottom-right\"\n slot=\"badge-bottom-right\"\n @slotchange=${this.handleBadgeSlotChange}\n >\n ${\n badgeCommandLockedType\n ? html`<obc-automation-badge\n .type=${badgeCommandLockedType}\n ></obc-automation-badge>`\n : nothing\n }\n </slot>\n ${this._handle !== false ? this._handle : nothing}\n </obc-automation-button>`;\n }\n}\n"],"mappings":";;;;;;;;;;;AAuCA,IAAY,6BAAL,yBAAA,4BAAA;CACL,2BAAA,UAAA;CACA,2BAAA,aAAA;CACA,2BAAA,aAAA;CACA,2BAAA,aAAA;CACA,2BAAA,WAAA;CACA,2BAAA,mBAAA;CACA,2BAAA,eAAA;CACA,2BAAA,iBAAA;CACA,2BAAA,cAAA;CACA,2BAAA,qBAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,iCAAL,yBAAA,gCAAA;CACL,+BAAA,UAAA;CACA,+BAAA,eAAA;CACA,+BAAA,sBAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,+BAAL,yBAAA,8BAAA;CACL,6BAAA,UAAA;CACA,6BAAA,WAAA;CACA,6BAAA,eAAA;CACA,6BAAA,YAAA;CACA,6BAAA,gBAAA;CACA,6BAAA,UAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,qCAAL,yBAAA,oCAAA;CACL,mCAAA,UAAA;CACA,mCAAA,mBAAA;;AACF,EAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,8BAAb,cAAiD,WAAW;;;EACe,KAAA,mBAAA;EAC5B,KAAA,SAAA;EAEG,KAAA,kBAAA,KAAA;EACmB,KAAA,aAAA;EACI,K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BAAA,WAAA,iBAAA,KAAA,CAAA;AAE/CA,WAAA,CAAA,sBAAsB,EAAC,MAAM,iBAAgB,CAAC,CAAA,GAAA,4BAAA,WAAA,gBAAA,KAAA,CAAA;AAE9CA,WAAA,CAAA,sBAAsB,EAAC,MAAM,oBAAmB,CAAC,CAAA,GAAA,4BAAA,WAAA,mBAAA,KAAA,CAAA;AAEjDA,WAAA,CAAA,sBAAsB,EAAC,MAAM,qBAAoB,CAAC,CAAA,GAAA,4BAAA,WAAA,oBAAA,KAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"abstract-automation-button.js","names":["_decorate"],"sources":["../../../src/automation/automation-button/abstract-automation-button.ts"],"sourcesContent":["import {\n ObcValveHandle,\n ValveHandleState,\n valveHandleIcon,\n} from './valve-handle.js';\nimport {\n HTMLTemplateResult,\n LitElement,\n TemplateResult,\n html,\n nothing,\n} from 'lit';\nimport {property, queryAssignedElements} from 'lit/decorators.js';\nimport '../automation-button/automation-button.js';\nimport {\n AutomationButtonDirection,\n AutomationButtonHandlePosition,\n AutomationButtonHandleSize,\n AutomationButtonOrientation,\n AutomationButtonPositioning,\n AutomationButtonReadoutPosition,\n AutomationButtonSelfActuationLine,\n AutomationButtonState,\n AutomationButtonVariant,\n} from '../automation-button/automation-button.js';\nimport {\n AutomationButtonReadoutStack,\n AutomationButtonReadoutStackSize,\n} from '../../components/automation-button-readout-stack/automation-button-readout-stack.js';\nimport {\n ObcAlertFrameThickness,\n ObcAlertFrameType,\n ObcAlertFrameMode,\n} from '../../components/alert-frame/alert-frame.js';\nimport {AlertType} from '../../types.js';\nimport '../automation-badge/automation-badge.js';\nimport {ObcAutomationBadgeType} from '../automation-badge/automation-badge.js';\nimport {CircularProgressMode} from '../../building-blocks/circular-progress/circular-progress.js';\nimport {\n AutomationButtonBadgeKind,\n AutomationButtonBadgeLayout,\n BadgeLayoutController,\n} from './badge-layout.js';\n\nexport enum AutomationButtonBadgeAlert {\n None = 'none',\n Silence = 'silence',\n Shelved = 'shelved',\n Caution = 'caution',\n Warning = 'warning',\n Alarm = 'alarm',\n LevelCritical = 'level-critical',\n LevelHigh = 'level-high',\n LevelMedium = 'level-medium',\n LevelLow = 'level-low',\n LevelDiagnostic = 'level-diagnostic',\n}\n\nexport enum AutomationButtonBadgeInterlock {\n None = 'none',\n Interlock = 'interlock',\n InterlockInhibit = 'interlock-inhibit',\n Simulation = 'simulation',\n}\n\nexport enum AutomationButtonBadgeControl {\n None = 'none',\n Local = 'local',\n LocalOnly = 'local-only',\n Manual = 'manual',\n ManualOnly = 'manual-only',\n Auto = 'auto',\n}\n\nexport enum AutomationButtonBadgeCommandLocked {\n None = 'none',\n CommandLocked = 'command-locked',\n Simulation = 'simulation',\n}\n\ntype BadgeCorner = keyof AutomationButtonBadgeLayout;\n\n/**\n * Base class for the automation device buttons.\n *\n * Renders an `<obc-automation-button>` with the shared surface every device\n * button needs: the readout stack and its status row, the alert frame, the\n * circular progress indicator, and the four badge corners with their slots and\n * enum-driven fallbacks. Which badge goes in which corner follows the badge\n * layout (`badge-layout.ts`): control top-left, alert top-right, interlock\n * bottom-left and command-locked bottom-right unless the app or `badgeLayout`\n * moves them.\n *\n * ## Usage Guidelines\n *\n * Not registered as a custom element. A subclass supplies the device\n * rendering through `icon`, `_on` and `_variant`, and may add rows to the\n * readout stack through `extraReadouts`. `ObcAbstractAutomationButtonSquared`\n * and `ObcAbstractAutomationButtonMotorized` extend it further;\n * `obc-analog-valve` and `obc-digital-valve` extend it directly.\n *\n * @property static - Draws the device as present with its state unknown: a grey button, and the static icon where the device has one.\n * @availableWhen readoutPosition showReadoutStack==true\n * @availableWhen showStatus showReadoutStack==true\n * @availableWhen readoutSize showReadoutStack==true\n * @availableWhen tag showReadoutStack==true\n * @property activated - Enables the activated background color, used to indicate that the button is activated/selected.\n * @availableWhen alertFrameType alert==true\n * @availableWhen alertFrameThickness alert==true\n * @availableWhen alertFrameStatus alert==true\n * @availableWhen alertFrameMode alert==true\n * @availableWhen showAlertCategoryIcon alert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]\n * @availableWhen showAlertIcon alert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]\n * @property badgeLayout - Which badge kind each corner shows, on top of the app-wide layout set with `setAutomationBadgeLayout()`. A corner left out keeps the app-wide badge, `null` leaves it empty, and a badge moved here leaves the corner it came from.\n * @property progress - Shows a progress indicator, used to indicate that an user action is in progress\n * @availableWhen progressMode progress==true\n * @availableWhen progressValue progress==true && progressMode in [determinate, progressiveIndeterminate]\n */\nexport class ObcAbstractAutomationButton extends LitElement {\n @property({type: Boolean, attribute: false}) showReadoutStack: boolean = true;\n @property({type: Boolean}) static: boolean = false;\n @property({type: String}) readoutPosition:\n AutomationButtonReadoutPosition | undefined = undefined;\n @property({type: Boolean, attribute: false}) showStatus: boolean = true;\n @property({type: Boolean, attribute: false}) showStatusIcon: boolean = false;\n @property({type: String}) readoutSize: AutomationButtonReadoutStackSize =\n AutomationButtonReadoutStackSize.regular;\n @property({type: String}) tag: string | null = null;\n\n @property({type: String}) positioning: AutomationButtonPositioning =\n AutomationButtonPositioning.point;\n @property({type: Boolean}) activated: boolean = false;\n @property({type: Boolean}) alert: boolean = false;\n @property({type: String}) alertFrameType: ObcAlertFrameType =\n ObcAlertFrameType.SmallSideFlip;\n @property({type: String}) alertFrameThickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n @property({type: String}) alertFrameStatus: AlertType = AlertType.Alarm;\n @property({type: String}) alertFrameMode: ObcAlertFrameMode =\n ObcAlertFrameMode.ackedActive;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n @property({type: Boolean}) showAlertIcon: boolean = false;\n @property({type: Boolean}) progress: boolean = false;\n @property({type: String}) progressMode: CircularProgressMode =\n CircularProgressMode.indeterminate;\n @property({type: Number}) progressValue: number = 0;\n\n @property({type: String}) badgeControl: AutomationButtonBadgeControl =\n AutomationButtonBadgeControl.None;\n @property({type: String})\n badgeCommandLocked: AutomationButtonBadgeCommandLocked =\n AutomationButtonBadgeCommandLocked.None;\n @property({type: String}) badgeInterlock: AutomationButtonBadgeInterlock =\n AutomationButtonBadgeInterlock.None;\n @property({type: String}) badgeAlert: AutomationButtonBadgeAlert =\n AutomationButtonBadgeAlert.None;\n @property({attribute: false}) badgeLayout:\n AutomationButtonBadgeLayout | undefined = undefined;\n\n private readonly _badgeLayout = new BadgeLayoutController(this);\n\n get icon(): TemplateResult {\n throw new Error('Method \"icon\" must be implemented in subclass');\n }\n\n get _on(): boolean {\n throw new Error('Method \"_on\" must be implemented in subclass');\n }\n\n get _variant(): AutomationButtonVariant {\n // @ts-expect-error - property should be defined in subclass\n return this.variant as AutomationButtonVariant;\n }\n\n get _orientation(): AutomationButtonOrientation {\n return AutomationButtonOrientation.horizontal;\n }\n\n get _direction(): AutomationButtonDirection {\n if ('direction' in this) {\n return this.direction as AutomationButtonDirection;\n }\n return AutomationButtonDirection.forward;\n }\n\n get extraReadouts(): AutomationButtonReadoutStack[] {\n return [];\n }\n\n /** Name of a device that can render with no text of its own. */\n get _accessibleName(): string | null {\n return null;\n }\n\n get _handlePosition(): AutomationButtonHandlePosition {\n return AutomationButtonHandlePosition.none;\n }\n\n get _handleSize(): AutomationButtonHandleSize {\n return AutomationButtonHandleSize.regular;\n }\n\n get _handle(): HTMLTemplateResult | false {\n return false;\n }\n\n /** The given handle on this device's side, in the colours of its state. */\n protected renderValveHandle(\n handle: ObcValveHandle\n ): HTMLTemplateResult | false {\n let state = this._on ? ValveHandleState.on : ValveHandleState.off;\n if (this.static) {\n state = ValveHandleState.static;\n }\n return valveHandleIcon(\n handle,\n this._handlePosition,\n state,\n this._handleSize\n );\n }\n\n get _selfActuationLine(): AutomationButtonSelfActuationLine {\n return AutomationButtonSelfActuationLine.none;\n }\n\n @queryAssignedElements({slot: 'badge-top-right'})\n badgeTopRight!: HTMLElement[];\n @queryAssignedElements({slot: 'badge-top-left'})\n badgeTopLeft!: HTMLElement[];\n @queryAssignedElements({slot: 'badge-bottom-left'})\n badgeBottomLeft!: HTMLElement[];\n @queryAssignedElements({slot: 'badge-bottom-right'})\n badgeBottomRight!: HTMLElement[];\n\n protected get _readoutPosition(): AutomationButtonReadoutPosition {\n if (this.readoutPosition) {\n return this.readoutPosition;\n }\n return this._isVertical\n ? AutomationButtonReadoutPosition.left\n : AutomationButtonReadoutPosition.bottom;\n }\n\n /** True when the device sits on a vertical pipe, which puts the default readout on the left. */\n protected get _isVertical(): boolean {\n return (\n this._orientation !== AutomationButtonOrientation.horizontal ||\n ('vertical' in this && Boolean(this.vertical))\n );\n }\n\n private getBadgeSpacer(\n badges: Record<BadgeCorner, ObcAutomationBadgeType | null>\n ): boolean {\n if (!this.showReadoutStack) {\n return false;\n }\n\n const topLeft = this.badgeTopLeft.length > 0 || badges.topLeft !== null;\n const topRight = this.badgeTopRight.length > 0 || badges.topRight !== null;\n const bottomLeft =\n this.badgeBottomLeft.length > 0 || badges.bottomLeft !== null;\n const bottomRight =\n this.badgeBottomRight.length > 0 || badges.bottomRight !== null;\n if (this._readoutPosition === AutomationButtonReadoutPosition.top) {\n return topRight || topLeft;\n } else if (\n this._readoutPosition === AutomationButtonReadoutPosition.bottom\n ) {\n return bottomLeft || bottomRight;\n } else if (this._readoutPosition === AutomationButtonReadoutPosition.left) {\n return topLeft || bottomLeft;\n } else if (\n this._readoutPosition === AutomationButtonReadoutPosition.right\n ) {\n return topRight || bottomRight;\n }\n return false;\n }\n\n private handleBadgeSlotChange() {\n this.requestUpdate();\n }\n\n private getBadgeType(\n kind: AutomationButtonBadgeKind | null\n ): ObcAutomationBadgeType | null {\n switch (kind) {\n case AutomationButtonBadgeKind.Control:\n return this.getBadgeControlType();\n case AutomationButtonBadgeKind.Alert:\n return this.getBadgeAlertType();\n case AutomationButtonBadgeKind.Interlock:\n return this.getBadgeInterlockType();\n case AutomationButtonBadgeKind.CommandLocked:\n return this.getBadgeCommandLockedType();\n default:\n return null;\n }\n }\n\n private getBadgeAlertType(): ObcAutomationBadgeType | null {\n if (this.badgeAlert === AutomationButtonBadgeAlert.Silence) {\n return ObcAutomationBadgeType.AlertSilenced;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.Shelved) {\n return ObcAutomationBadgeType.AlertShelved;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.Caution) {\n return ObcAutomationBadgeType.Caution;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.Warning) {\n return ObcAutomationBadgeType.Warning;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.Alarm) {\n return ObcAutomationBadgeType.Alarm;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.LevelCritical) {\n return ObcAutomationBadgeType.LevelCritical;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.LevelHigh) {\n return ObcAutomationBadgeType.LevelHigh;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.LevelMedium) {\n return ObcAutomationBadgeType.LevelMedium;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.LevelLow) {\n return ObcAutomationBadgeType.LevelLow;\n } else if (this.badgeAlert === AutomationButtonBadgeAlert.LevelDiagnostic) {\n return ObcAutomationBadgeType.LevelDiagnostic;\n }\n return null;\n }\n\n private getBadgeControlType(): ObcAutomationBadgeType | null {\n if (this.badgeControl === AutomationButtonBadgeControl.Local) {\n return ObcAutomationBadgeType.Local;\n } else if (this.badgeControl === AutomationButtonBadgeControl.LocalOnly) {\n return ObcAutomationBadgeType.LocalOnly;\n } else if (this.badgeControl === AutomationButtonBadgeControl.Manual) {\n return ObcAutomationBadgeType.Manual;\n } else if (this.badgeControl === AutomationButtonBadgeControl.ManualOnly) {\n return ObcAutomationBadgeType.ManualOnly;\n } else if (this.badgeControl === AutomationButtonBadgeControl.Auto) {\n return ObcAutomationBadgeType.Auto;\n }\n return null;\n }\n\n private getBadgeInterlockType(): ObcAutomationBadgeType | null {\n if (this.badgeInterlock === AutomationButtonBadgeInterlock.Interlock) {\n return ObcAutomationBadgeType.Interlock;\n } else if (\n this.badgeInterlock === AutomationButtonBadgeInterlock.InterlockInhibit\n ) {\n return ObcAutomationBadgeType.InterlockInhibit;\n } else if (\n this.badgeInterlock === AutomationButtonBadgeInterlock.Simulation\n ) {\n return ObcAutomationBadgeType.Simulation;\n }\n return null;\n }\n\n private getBadgeCommandLockedType(): ObcAutomationBadgeType | null {\n if (\n this.badgeCommandLocked ===\n AutomationButtonBadgeCommandLocked.CommandLocked\n ) {\n return ObcAutomationBadgeType.CommandLocked;\n } else if (\n this.badgeCommandLocked === AutomationButtonBadgeCommandLocked.Simulation\n ) {\n return ObcAutomationBadgeType.Simulation;\n }\n return null;\n }\n\n override render() {\n const readouts: AutomationButtonReadoutStack[] = [...this.extraReadouts];\n const layout = this._badgeLayout.resolve(this.badgeLayout);\n const badges = {\n topLeft: this.getBadgeType(layout.topLeft),\n topRight: this.getBadgeType(layout.topRight),\n bottomLeft: this.getBadgeType(layout.bottomLeft),\n bottomRight: this.getBadgeType(layout.bottomRight),\n };\n\n return html`<obc-automation-button\n .state=${\n this._on ? AutomationButtonState.open : AutomationButtonState.closed\n }\n .readouts=${readouts}\n .tag=${this.tag}\n .accessibleName=${this._accessibleName}\n .showReadoutStack=${this.showReadoutStack}\n .readoutPosition=${this._readoutPosition}\n .readoutSize=${this.readoutSize}\n ?alert=${this.alert}\n .alertFrameType=${this.alertFrameType}\n .alertFrameThickness=${this.alertFrameThickness}\n .alertFrameStatus=${this.alertFrameStatus}\n .alertFrameMode=${this.alertFrameMode}\n .showAlertCategoryIcon=${this.showAlertCategoryIcon}\n .showAlertIcon=${this.showAlertIcon}\n ?progress=${this.progress}\n .progressMode=${this.progressMode}\n .progressValue=${this.progressValue}\n .variant=${this._variant}\n .direction=${this._direction}\n .orientation=${this._orientation}\n .hasBadgeSpacer=${this.getBadgeSpacer(badges)}\n .handlePosition=${this._handlePosition}\n .static=${this.static}\n .handleSize=${this._handleSize}\n .positioning=${this.positioning}\n .selfActuationLine=${this._selfActuationLine}\n ?activated=${this.activated}\n >\n ${this.icon}\n <slot\n name=\"badge-top-right\"\n slot=\"badge-top-right\"\n @slotchange=${this.handleBadgeSlotChange}\n >\n ${\n badges.topRight\n ? html`<obc-automation-badge\n .type=${badges.topRight}\n ></obc-automation-badge>`\n : nothing\n }\n </slot>\n <slot\n name=\"badge-top-left\"\n slot=\"badge-top-left\"\n @slotchange=${this.handleBadgeSlotChange}\n >\n ${\n badges.topLeft\n ? html`<obc-automation-badge\n .type=${badges.topLeft}\n ></obc-automation-badge>`\n : nothing\n }\n </slot>\n <slot\n name=\"badge-bottom-left\"\n slot=\"badge-bottom-left\"\n @slotchange=${this.handleBadgeSlotChange}\n >\n ${\n badges.bottomLeft\n ? html`<obc-automation-badge\n .type=${badges.bottomLeft}\n ></obc-automation-badge>`\n : nothing\n }\n </slot>\n <slot\n name=\"badge-bottom-right\"\n slot=\"badge-bottom-right\"\n @slotchange=${this.handleBadgeSlotChange}\n >\n ${\n badges.bottomRight\n ? html`<obc-automation-badge\n .type=${badges.bottomRight}\n ></obc-automation-badge>`\n : nothing\n }\n </slot>\n ${this._handle !== false ? this._handle : nothing}\n </obc-automation-button>`;\n }\n}\n"],"mappings":";;;;;;;;;;;;AA4CA,IAAY,6BAAL,yBAAA,4BAAA;CACL,2BAAA,UAAA;CACA,2BAAA,aAAA;CACA,2BAAA,aAAA;CACA,2BAAA,aAAA;CACA,2BAAA,aAAA;CACA,2BAAA,WAAA;CACA,2BAAA,mBAAA;CACA,2BAAA,eAAA;CACA,2BAAA,iBAAA;CACA,2BAAA,cAAA;CACA,2BAAA,qBAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,iCAAL,yBAAA,gCAAA;CACL,+BAAA,UAAA;CACA,+BAAA,eAAA;CACA,+BAAA,sBAAA;CACA,+BAAA,gBAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,+BAAL,yBAAA,8BAAA;CACL,6BAAA,UAAA;CACA,6BAAA,WAAA;CACA,6BAAA,eAAA;CACA,6BAAA,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CAAA,sBAAsB,EAAC,MAAM,qBAAoB,CAAC,CAAA,GAAA,4BAAA,WAAA,oBAAA,KAAA,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ReactiveControllerHost } from 'lit';
|
|
2
|
+
import { GlobalSettingController } from '../../internal/global-setting.js';
|
|
3
|
+
export declare enum AutomationButtonBadgeKind {
|
|
4
|
+
Control = "control",
|
|
5
|
+
Alert = "alert",
|
|
6
|
+
Interlock = "interlock",
|
|
7
|
+
CommandLocked = "command-locked"
|
|
8
|
+
}
|
|
9
|
+
/** Which badge kind each corner shows. `null` leaves the corner empty. */
|
|
10
|
+
export interface AutomationButtonBadgeLayout {
|
|
11
|
+
topLeft?: AutomationButtonBadgeKind | null;
|
|
12
|
+
topRight?: AutomationButtonBadgeKind | null;
|
|
13
|
+
bottomLeft?: AutomationButtonBadgeKind | null;
|
|
14
|
+
bottomRight?: AutomationButtonBadgeKind | null;
|
|
15
|
+
}
|
|
16
|
+
export type ResolvedAutomationButtonBadgeLayout = Required<AutomationButtonBadgeLayout>;
|
|
17
|
+
export declare const defaultAutomationButtonBadgeLayout: Readonly<ResolvedAutomationButtonBadgeLayout>;
|
|
18
|
+
/**
|
|
19
|
+
* The `base` layout with the corners `override` names put on top of it.
|
|
20
|
+
* A kind `override` names twice stays in the first corner, in reading order.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveBadgeLayout(base: ResolvedAutomationButtonBadgeLayout, override: AutomationButtonBadgeLayout | undefined): ResolvedAutomationButtonBadgeLayout;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the badge layout of every automation button on the page, and
|
|
25
|
+
* re-renders the ones already connected. `undefined` restores the default.
|
|
26
|
+
*/
|
|
27
|
+
export declare function setAutomationBadgeLayout(layout: AutomationButtonBadgeLayout | undefined): void;
|
|
28
|
+
export declare function getAutomationBadgeLayout(): ResolvedAutomationButtonBadgeLayout;
|
|
29
|
+
/** Re-renders its host when the global badge layout changes, and puts the host's own corners on top of it. */
|
|
30
|
+
export declare class BadgeLayoutController extends GlobalSettingController<ResolvedAutomationButtonBadgeLayout> {
|
|
31
|
+
constructor(host: ReactiveControllerHost);
|
|
32
|
+
resolve(local: AutomationButtonBadgeLayout | undefined): ResolvedAutomationButtonBadgeLayout;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=badge-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge-layout.d.ts","sourceRoot":"","sources":["../../../src/automation/automation-button/badge-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,KAAK,CAAC;AAChD,OAAO,EAEL,uBAAuB,EACxB,MAAM,kCAAkC,CAAC;AAE1C,oBAAY,yBAAyB;IACnC,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,aAAa,mBAAmB;CACjC;AAED,0EAA0E;AAC1E,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC5C,UAAU,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAAC;CAChD;AAED,MAAM,MAAM,mCAAmC,GAC7C,QAAQ,CAAC,2BAA2B,CAAC,CAAC;AAIxC,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CAAC,mCAAmC,CAMzF,CAAC;AAEL;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,mCAAmC,EACzC,QAAQ,EAAE,2BAA2B,GAAG,SAAS,GAChD,mCAAmC,CAuBrC;AAMD;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,2BAA2B,GAAG,SAAS,GAC9C,IAAI,CAIN;AAED,wBAAgB,wBAAwB,IAAI,mCAAmC,CAE9E;AAED,8GAA8G;AAC9G,qBAAa,qBAAsB,SAAQ,uBAAuB,CAAC,mCAAmC,CAAC;gBACzF,IAAI,EAAE,sBAAsB;IAIxC,OAAO,CACL,KAAK,EAAE,2BAA2B,GAAG,SAAS,GAC7C,mCAAmC;CAGvC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { GlobalSetting, GlobalSettingController } from "../../internal/global-setting.js";
|
|
2
|
+
// src/automation/automation-button/badge-layout.ts
|
|
3
|
+
var AutomationButtonBadgeKind = /* @__PURE__ */ function(AutomationButtonBadgeKind) {
|
|
4
|
+
AutomationButtonBadgeKind["Control"] = "control";
|
|
5
|
+
AutomationButtonBadgeKind["Alert"] = "alert";
|
|
6
|
+
AutomationButtonBadgeKind["Interlock"] = "interlock";
|
|
7
|
+
AutomationButtonBadgeKind["CommandLocked"] = "command-locked";
|
|
8
|
+
return AutomationButtonBadgeKind;
|
|
9
|
+
}({});
|
|
10
|
+
var corners = [
|
|
11
|
+
"topLeft",
|
|
12
|
+
"topRight",
|
|
13
|
+
"bottomLeft",
|
|
14
|
+
"bottomRight"
|
|
15
|
+
];
|
|
16
|
+
var defaultAutomationButtonBadgeLayout = Object.freeze({
|
|
17
|
+
topLeft: "control",
|
|
18
|
+
topRight: "alert",
|
|
19
|
+
bottomLeft: "interlock",
|
|
20
|
+
bottomRight: "command-locked"
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* The `base` layout with the corners `override` names put on top of it.
|
|
24
|
+
* A kind `override` names twice stays in the first corner, in reading order.
|
|
25
|
+
*/
|
|
26
|
+
function resolveBadgeLayout(base, override) {
|
|
27
|
+
const result = { ...base };
|
|
28
|
+
if (!override) return result;
|
|
29
|
+
const placed = /* @__PURE__ */ new Set();
|
|
30
|
+
for (const corner of corners) {
|
|
31
|
+
const kind = override[corner];
|
|
32
|
+
if (kind === void 0) continue;
|
|
33
|
+
result[corner] = kind !== null && placed.has(kind) ? null : kind;
|
|
34
|
+
if (kind !== null) placed.add(kind);
|
|
35
|
+
}
|
|
36
|
+
for (const corner of corners) {
|
|
37
|
+
const kind = result[corner];
|
|
38
|
+
if (override[corner] === void 0 && kind !== null && placed.has(kind)) result[corner] = null;
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
var globalLayout = new GlobalSetting({ ...defaultAutomationButtonBadgeLayout });
|
|
43
|
+
/**
|
|
44
|
+
* Sets the badge layout of every automation button on the page, and
|
|
45
|
+
* re-renders the ones already connected. `undefined` restores the default.
|
|
46
|
+
*/
|
|
47
|
+
function setAutomationBadgeLayout(layout) {
|
|
48
|
+
globalLayout.set(resolveBadgeLayout(defaultAutomationButtonBadgeLayout, layout));
|
|
49
|
+
}
|
|
50
|
+
function getAutomationBadgeLayout() {
|
|
51
|
+
return { ...globalLayout.get() };
|
|
52
|
+
}
|
|
53
|
+
/** Re-renders its host when the global badge layout changes, and puts the host's own corners on top of it. */
|
|
54
|
+
var BadgeLayoutController = class extends GlobalSettingController {
|
|
55
|
+
constructor(host) {
|
|
56
|
+
super(host, globalLayout);
|
|
57
|
+
}
|
|
58
|
+
resolve(local) {
|
|
59
|
+
return resolveBadgeLayout(this.value, local);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
export { AutomationButtonBadgeKind, BadgeLayoutController, defaultAutomationButtonBadgeLayout, getAutomationBadgeLayout, resolveBadgeLayout, setAutomationBadgeLayout };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=badge-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge-layout.js","names":[],"sources":["../../../src/automation/automation-button/badge-layout.ts"],"sourcesContent":["/**\n * Badge layout of the automation buttons.\n *\n * Says which badge kind each corner of an automation button shows. The app\n * sets one layout for every button with `setAutomationBadgeLayout()`; a\n * button's own `badgeLayout` property changes single corners on top of it.\n *\n * Merge rules, for both the global and the local layout:\n * - a corner left out keeps the layout underneath it,\n * - `null` leaves the corner empty,\n * - a kind moved to a new corner leaves the corner it came from, so it is\n * never shown twice.\n *\n * ```ts\n * setAutomationBadgeLayout({\n * topLeft: AutomationButtonBadgeKind.Alert,\n * topRight: AutomationButtonBadgeKind.Control,\n * });\n * ```\n *\n * @module\n */\nimport type {ReactiveControllerHost} from 'lit';\nimport {\n GlobalSetting,\n GlobalSettingController,\n} from '../../internal/global-setting.js';\n\nexport enum AutomationButtonBadgeKind {\n Control = 'control',\n Alert = 'alert',\n Interlock = 'interlock',\n CommandLocked = 'command-locked',\n}\n\n/** Which badge kind each corner shows. `null` leaves the corner empty. */\nexport interface AutomationButtonBadgeLayout {\n topLeft?: AutomationButtonBadgeKind | null;\n topRight?: AutomationButtonBadgeKind | null;\n bottomLeft?: AutomationButtonBadgeKind | null;\n bottomRight?: AutomationButtonBadgeKind | null;\n}\n\nexport type ResolvedAutomationButtonBadgeLayout =\n Required<AutomationButtonBadgeLayout>;\n\nconst corners = ['topLeft', 'topRight', 'bottomLeft', 'bottomRight'] as const;\n\nexport const defaultAutomationButtonBadgeLayout: Readonly<ResolvedAutomationButtonBadgeLayout> =\n Object.freeze({\n topLeft: AutomationButtonBadgeKind.Control,\n topRight: AutomationButtonBadgeKind.Alert,\n bottomLeft: AutomationButtonBadgeKind.Interlock,\n bottomRight: AutomationButtonBadgeKind.CommandLocked,\n });\n\n/**\n * The `base` layout with the corners `override` names put on top of it.\n * A kind `override` names twice stays in the first corner, in reading order.\n */\nexport function resolveBadgeLayout(\n base: ResolvedAutomationButtonBadgeLayout,\n override: AutomationButtonBadgeLayout | undefined\n): ResolvedAutomationButtonBadgeLayout {\n const result = {...base};\n if (!override) {\n return result;\n }\n const placed = new Set<AutomationButtonBadgeKind>();\n for (const corner of corners) {\n const kind = override[corner];\n if (kind === undefined) {\n continue;\n }\n result[corner] = kind !== null && placed.has(kind) ? null : kind;\n if (kind !== null) {\n placed.add(kind);\n }\n }\n for (const corner of corners) {\n const kind = result[corner];\n if (override[corner] === undefined && kind !== null && placed.has(kind)) {\n result[corner] = null;\n }\n }\n return result;\n}\n\nconst globalLayout = new GlobalSetting<ResolvedAutomationButtonBadgeLayout>({\n ...defaultAutomationButtonBadgeLayout,\n});\n\n/**\n * Sets the badge layout of every automation button on the page, and\n * re-renders the ones already connected. `undefined` restores the default.\n */\nexport function setAutomationBadgeLayout(\n layout: AutomationButtonBadgeLayout | undefined\n): void {\n globalLayout.set(\n resolveBadgeLayout(defaultAutomationButtonBadgeLayout, layout)\n );\n}\n\nexport function getAutomationBadgeLayout(): ResolvedAutomationButtonBadgeLayout {\n return {...globalLayout.get()};\n}\n\n/** Re-renders its host when the global badge layout changes, and puts the host's own corners on top of it. */\nexport class BadgeLayoutController extends GlobalSettingController<ResolvedAutomationButtonBadgeLayout> {\n constructor(host: ReactiveControllerHost) {\n super(host, globalLayout);\n }\n\n resolve(\n local: AutomationButtonBadgeLayout | undefined\n ): ResolvedAutomationButtonBadgeLayout {\n return resolveBadgeLayout(this.value, local);\n }\n}\n"],"mappings":";;AA4BA,IAAY,4BAAL,yBAAA,2BAAA;CACL,0BAAA,aAAA;CACA,0BAAA,WAAA;CACA,0BAAA,eAAA;CACA,0BAAA,mBAAA;;AACF,EAAA,CAAA,CAAA;AAaA,IAAM,UAAU;CAAC;CAAW;CAAY;CAAc;AAAa;AAEnE,IAAa,qCACX,OAAO,OAAO;CACZ,SAAA;CACA,UAAA;CACA,YAAA;CACA,aAAA;AACF,CAAC;;;;;AAMH,SAAgB,mBACd,MACA,UACqC;CACrC,MAAM,SAAS,EAAC,GAAG,KAAI;CACvB,IAAI,CAAC,UACH,OAAO;CAET,MAAM,yBAAS,IAAI,IAA+B;CAClD,KAAK,MAAM,UAAU,SAAS;EAC5B,MAAM,OAAO,SAAS;EACtB,IAAI,SAAS,KAAA,GACX;EAEF,OAAO,UAAU,SAAS,QAAQ,OAAO,IAAI,IAAI,IAAI,OAAO;EAC5D,IAAI,SAAS,MACX,OAAO,IAAI,IAAI;CAEnB;CACA,KAAK,MAAM,UAAU,SAAS;EAC5B,MAAM,OAAO,OAAO;EACpB,IAAI,SAAS,YAAY,KAAA,KAAa,SAAS,QAAQ,OAAO,IAAI,IAAI,GACpE,OAAO,UAAU;CAErB;CACA,OAAO;AACT;AAEA,IAAM,eAAe,IAAI,cAAmD,EAC1E,GAAG,mCACL,CAAC;;;;;AAMD,SAAgB,yBACd,QACM;CACN,aAAa,IACX,mBAAmB,oCAAoC,MAAM,CAC/D;AACF;AAEA,SAAgB,2BAAgE;CAC9E,OAAO,EAAC,GAAG,aAAa,IAAI,EAAC;AAC/B;;AAGA,IAAa,wBAAb,cAA2C,wBAA6D;CACtG,YAAY,MAA8B;EACxC,MAAM,MAAM,YAAY;CAC1B;CAEA,QACE,OACqC;EACrC,OAAO,mBAAmB,KAAK,OAAO,KAAK;CAC7C;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automation-tank.d.ts","sourceRoot":"","sources":["../../../src/automation/automation-tank/automation-tank.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,UAAU,EAEV,OAAO,EAGP,cAAc,EACf,MAAM,KAAK,CAAC;AAGb,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AACvC,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EACL,0BAA0B,EAC1B,kCAAkC,EAClC,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,oDAAoD,CAAC;AAE5D,OAAO,8CAA8C,CAAC;AACtD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,gDAAgD,CAAC;AACxD,OAAO,yCAAyC,CAAC;AACjD,OAAO,wCAAwC,CAAC;AAChD,OAAO,yBAAyB,CAAC;AACjC,OAAO,0BAA0B,CAAC;AAClC,OAAO,oCAAoC,CAAC;AAC5C,OAAO,yDAAyD,CAAC;AACjE,OAAO,oDAAoD,CAAC;AAC5D,OAAO,6CAA6C,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAC,MAAM,uCAAuC,CAAC;AAC/D,O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O,CAAQ;IAC5C,SAAS,EAAE,OAAO,CAAS;IAC5B,GAAG,EAAE,MAAM,CAAM;IAG3C,SAAS,EAAE,aAAa,CAAqB;IAG7C,SAAS,EAAE,iBAAiB,EAAE,CAAM;IAEV,QAAQ,EAAE,QAAQ,CAAoB;IAEhE,4DAA4D;IACjB,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IAEvC,SAAS,UAAS;IAEA,YAAY,UAAS;IAEvC,KAAK,EAAE,OAAO,CAAS;IACxB,cAAc,EAAE,iBAAiB,CACzB;IACR,mBAAmB,EAAE,sBAAsB,CACtC;IACL,gBAAgB,EAAE,SAAS,CAAmB;IAC9C,cAAc,EAAE,iBAAiB,CAC3B;IACa,qBAAqB,EAAE,OAAO,CACpE;IACoB,aAAa,EAAE,OAAO,CAAS;IAEb,eAAe,EAAE,OAAO,CAAQ;IAEnD,qBAAqB,EAAE,MAAM,CAAK;IAElC,YAAY,EAAE,4BAA4B,CAChC;IACV,UAAU,EAAE,0BAA0B,CAC9B;IACR,cAAc,EAAE,8BAA8B,CAClC;IAEtC,kBAAkB,EAAE,kCAAkC,CACZ;IAEjC,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,WAAW,CAAK;IACjC;;;;;;OAMG;IACM,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAS;IACrC;;;;;OAKG;IACM,OAAO,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,oBAAoB,CAAC,CAAiB;IAC9C,OAAO,CAAC,aAAa,CAAC,CAAU;IAEhC,OAAO,KAAK,SAAS,GAEpB;IAED,OAAO,CAAC,eAAe;
|
|
1
|
+
{"version":3,"file":"automation-tank.d.ts","sourceRoot":"","sources":["../../../src/automation/automation-tank/automation-tank.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,UAAU,EAEV,OAAO,EAGP,cAAc,EACf,MAAM,KAAK,CAAC;AAGb,OAAO,EAAC,UAAU,EAAC,MAAM,a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,CAAC,WAAW,CAAK;IACjC;;;;;;OAMG;IACM,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAS;IACrC;;;;;OAKG;IACM,OAAO,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,oBAAoB,CAAC,CAAiB;IAC9C,OAAO,CAAC,aAAa,CAAC,CAAU;IAEhC,OAAO,KAAK,SAAS,GAEpB;IAED,OAAO,CAAC,eAAe;IA2BvB,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,uBAAuB;IAW/B,OAAO,KAAK,eAAe,GAK1B;IAED,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,iBAAiB;IAWhB,oBAAoB,IAAI,IAAI;cAOlB,OAAO,CACxB,OAAO,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,GAC9C,IAAI;IASP,OAAO,CAAC,wBAAwB;IA8BhC,SAAS,IAAI,kBAAkB,GAAG,OAAO,OAAO;IA0BhD;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,oBAAoB;IA4I5B,OAAO,CAAC,SAAS;IAaR,UAAU,CAAC,OAAO,EAAE,cAAc;IAKlC,MAAM;IAoXf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,iBAAiB,CAAC;KAC1C;CACF"}
|
|
@@ -101,6 +101,7 @@ var ObcAutomationTank = class ObcAutomationTank extends AdviceMixin(SetpointMixi
|
|
|
101
101
|
_badgeAlertType() {
|
|
102
102
|
switch (this.badgeAlert) {
|
|
103
103
|
case AutomationButtonBadgeAlert.Silence: return ObcAutomationBadgeType.AlertSilenced;
|
|
104
|
+
case AutomationButtonBadgeAlert.Shelved: return ObcAutomationBadgeType.AlertShelved;
|
|
104
105
|
case AutomationButtonBadgeAlert.Caution: return ObcAutomationBadgeType.Caution;
|
|
105
106
|
case AutomationButtonBadgeAlert.Warning: return ObcAutomationBadgeType.Warning;
|
|
106
107
|
case AutomationButtonBadgeAlert.Alarm: return ObcAutomationBadgeType.Alarm;
|
|
@@ -126,12 +127,16 @@ var ObcAutomationTank = class ObcAutomationTank extends AdviceMixin(SetpointMixi
|
|
|
126
127
|
switch (this.badgeInterlock) {
|
|
127
128
|
case AutomationButtonBadgeInterlock.Interlock: return ObcAutomationBadgeType.Interlock;
|
|
128
129
|
case AutomationButtonBadgeInterlock.InterlockInhibit: return ObcAutomationBadgeType.InterlockInhibit;
|
|
130
|
+
case AutomationButtonBadgeInterlock.Simulation: return ObcAutomationBadgeType.Simulation;
|
|
129
131
|
default: return null;
|
|
130
132
|
}
|
|
131
133
|
}
|
|
132
134
|
_badgeCommandLockedType() {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
+
switch (this.badgeCommandLocked) {
|
|
136
|
+
case AutomationButtonBadgeCommandLocked.CommandLocked: return ObcAutomationBadgeType.CommandLocked;
|
|
137
|
+
case AutomationButtonBadgeCommandLocked.Simulation: return ObcAutomationBadgeType.Simulation;
|
|
138
|
+
default: return null;
|
|
139
|
+
}
|
|
135
140
|
}
|
|
136
141
|
get _usesGaugeTrend() {
|
|
137
142
|
return this.chartMode === "graph" || this.chartMode === "graph-and-bar";
|