@oicl/openbridge-webcomponents 2.1.0-next.3 → 2.1.0-next.4

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.
Files changed (25) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +726 -485
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +3845 -1817
  4. package/dist/automation/analog-threeway-valve/analog-threeway-valve.d.ts +76 -0
  5. package/dist/automation/analog-threeway-valve/analog-threeway-valve.d.ts.map +1 -0
  6. package/dist/automation/analog-threeway-valve/analog-threeway-valve.js +61 -0
  7. package/dist/automation/analog-threeway-valve/analog-threeway-valve.js.map +1 -0
  8. package/dist/automation/analog-valve/analog-valve.js +1 -1
  9. package/dist/automation/digital-threeway-valve/digital-threeway-valve.d.ts +82 -0
  10. package/dist/automation/digital-threeway-valve/digital-threeway-valve.d.ts.map +1 -0
  11. package/dist/automation/digital-threeway-valve/digital-threeway-valve.js +90 -0
  12. package/dist/automation/digital-threeway-valve/digital-threeway-valve.js.map +1 -0
  13. package/dist/automation/threeway-valve-shared/threeway-valve-shared.d.ts +39 -0
  14. package/dist/automation/threeway-valve-shared/threeway-valve-shared.d.ts.map +1 -0
  15. package/dist/automation/threeway-valve-shared/threeway-valve-shared.js +80 -0
  16. package/dist/automation/threeway-valve-shared/threeway-valve-shared.js.map +1 -0
  17. package/dist/automation/valve-analog-three-way-icon/valve-analog-three-way-icon.d.ts +65 -4
  18. package/dist/automation/valve-analog-three-way-icon/valve-analog-three-way-icon.d.ts.map +1 -1
  19. package/dist/automation/valve-analog-three-way-icon/valve-analog-three-way-icon.js +153 -111
  20. package/dist/automation/valve-analog-three-way-icon/valve-analog-three-way-icon.js.map +1 -1
  21. package/dist/components/automation-button-readout-stack/automation-button-readout-stack.d.ts +3 -0
  22. package/dist/components/automation-button-readout-stack/automation-button-readout-stack.d.ts.map +1 -1
  23. package/dist/components/automation-button-readout-stack/automation-button-readout-stack.js +17 -10
  24. package/dist/components/automation-button-readout-stack/automation-button-readout-stack.js.map +1 -1
  25. package/package.json +1 -1
@@ -0,0 +1,76 @@
1
+ import { ObcAbstractAutomationButton } from '../automation-button/abstract-automation-button.js';
2
+ import { AutomationButtonReadoutStack } from '../../components/automation-button-readout-stack/automation-button-readout-stack.js';
3
+ import { ThreewayValveFlow, ThreewayValveOrientation } from '../threeway-valve-shared/threeway-valve-shared.js';
4
+ import '../valve-analog-three-way-icon/valve-analog-three-way-icon.js';
5
+ export declare enum AnalogThreewayValveVariant {
6
+ regular = "regular",
7
+ flat = "flat"
8
+ }
9
+ /**
10
+ * `<obc-analog-threeway-valve>` – three-way control valve for process
11
+ * diagrams, with a continuous opening per port.
12
+ *
13
+ * ## Features
14
+ *
15
+ * - **Three ports:** `open1`, `open2` and `open3` set each port's opening in
16
+ * percent. Ports are numbered from the side without a port: with
17
+ * `orientation` `bottom`, port 1 is left, port 2 is the stem at the bottom
18
+ * and port 3 is right. The numbering turns with the symbol.
19
+ * - **Symbol:** a partly open port shows its shut part as a band at the port
20
+ * end, a port at 0 % is drawn plugged, and the handle shows how the most
21
+ * open port splits between the two others (`obc-valve-analog-three-way-icon`).
22
+ * - **Orientation:** `bottom` and `top` lay the valve on a horizontal pipe,
23
+ * `left` and `right` on a vertical one; the value names the side the stem
24
+ * points to.
25
+ * - **Flow readout:** `flows` lists one readout row per flow, each with an
26
+ * optional arrow direction and either a value with a unit (`%` when left out)
27
+ * or a state, `{open}`, shown as `Open` or `Closed` after the arrow, or
28
+ * after the on/off icon when there is no direction. Without flows the
29
+ * readout shows `Open` or `Closed`.
30
+ * - Badges, alert frame, progress and readout placement come from the shared
31
+ * automation button base.
32
+ *
33
+ * ## Usage Guidelines
34
+ *
35
+ * Use for a mixing or diverting valve that opens its ports continuously.
36
+ * With fewer than two ports open no flow can pass, and the valve shows as
37
+ * closed. For on/off ports use `obc-digital-threeway-valve`; for a two-port
38
+ * control valve use `obc-analog-valve`.
39
+ *
40
+ * @property open1 - Opening of port 1 in percent (0–100).
41
+ * @property open2 - Opening of port 2, the stem, in percent (0–100).
42
+ * @property open3 - Opening of port 3 in percent (0–100).
43
+ * @property orientation - Side the stem points to.
44
+ * @property flows - Readout rows, one per flow: an optional arrow direction with either a value and optional unit (default `%`) or `open` for an `Open`/`Closed` state.
45
+ * @property variant - Visual style of the button surround.
46
+ * @slot badge-top-right - Content projected into the top-right badge position; overrides `badgeAlert`.
47
+ * @slot badge-top-left - Content projected into the top-left badge position; overrides `badgeControl`.
48
+ * @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides `badgeInterlock`.
49
+ * @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides `badgeCommandLocked`.
50
+ * @fires click - Fired when the valve is clicked.
51
+ * @experimental
52
+ */
53
+ export declare class ObcAnalogThreewayValve extends ObcAbstractAutomationButton {
54
+ /** Opening of port 1 in percent (0–100). */
55
+ open1: number;
56
+ /** Opening of port 2, the stem, in percent (0–100). */
57
+ open2: number;
58
+ /** Opening of port 3 in percent (0–100). */
59
+ open3: number;
60
+ /** Side the stem points to. */
61
+ orientation: ThreewayValveOrientation;
62
+ /** Readout rows, one per flow: an optional arrow direction with either a value and optional unit (default `%`) or `open` for an `Open`/`Closed` state. */
63
+ flows: ThreewayValveFlow[];
64
+ /** Visual style of the button surround. */
65
+ variant: AnalogThreewayValveVariant;
66
+ get _on(): boolean;
67
+ get extraReadouts(): AutomationButtonReadoutStack[];
68
+ private renderIcon;
69
+ get icon(): import('lit-html').TemplateResult<1>;
70
+ }
71
+ declare global {
72
+ interface HTMLElementTagNameMap {
73
+ 'obc-analog-threeway-valve': ObcAnalogThreewayValve;
74
+ }
75
+ }
76
+ //# sourceMappingURL=analog-threeway-valve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analog-threeway-valve.d.ts","sourceRoot":"","sources":["../../../src/automation/analog-threeway-valve/analog-threeway-valve.ts"],"names":[],"mappings":"AAEA,OAAO,+DAA+D,CAAC;AAEvE,OAAO,EAAC,2BAA2B,EAAC,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAC,4BAA4B,EAAC,MAAM,qFAAqF,CAAC;AACjI,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,mDAAmD,CAAC;AAE3D,oBAAY,0BAA0B;IACpC,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,qBACa,sBAAuB,SAAQ,2BAA2B;IAC3C,KAAK,EAAE,MAAM,CAAK;IAClB,KAAK,EAAE,MAAM,CAAK;IAClB,KAAK,EAAE,MAAM,CAAK;IAClB,WAAW,EAAE,wBAAwB,CAC7B;IACS,KAAK,EAAE,iBAAiB,EAAE,CAAM;IACjD,OAAO,EAAE,0BAA0B,CACxB;IAErC,IAAa,GAAG,IAAI,OAAO,CAI1B;IAED,IAAa,aAAa,IAAI,4BAA4B,EAAE,CAK3D;IAED,OAAO,CAAC,UAAU;IAUlB,IAAa,IAAI,yCAEhB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,2BAA2B,EAAE,sBAAsB,CAAC;KACrD;CACF"}
@@ -0,0 +1,61 @@
1
+ import { customElement } from "../../decorator.js";
2
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/decorate.js";
3
+ import { ThreewayValveOrientation, threewayValveReadouts } from "../threeway-valve-shared/threeway-valve-shared.js";
4
+ import "../valve-analog-three-way-icon/valve-analog-three-way-icon.js";
5
+ import { ObcAbstractAutomationButton } from "../automation-button/abstract-automation-button.js";
6
+ import { html } from "lit";
7
+ import { property } from "lit/decorators.js";
8
+ //#region src/automation/analog-threeway-valve/analog-threeway-valve.ts
9
+ var AnalogThreewayValveVariant = /* @__PURE__ */ function(AnalogThreewayValveVariant) {
10
+ AnalogThreewayValveVariant["regular"] = "regular";
11
+ AnalogThreewayValveVariant["flat"] = "flat";
12
+ return AnalogThreewayValveVariant;
13
+ }({});
14
+ var ObcAnalogThreewayValve = class ObcAnalogThreewayValve extends ObcAbstractAutomationButton {
15
+ constructor(..._args) {
16
+ super(..._args);
17
+ this.open1 = 0;
18
+ this.open2 = 0;
19
+ this.open3 = 0;
20
+ this.orientation = ThreewayValveOrientation.bottom;
21
+ this.flows = [];
22
+ this.variant = "regular";
23
+ }
24
+ get _on() {
25
+ return [
26
+ this.open1,
27
+ this.open2,
28
+ this.open3
29
+ ].filter((o) => o > 0).length >= 2;
30
+ }
31
+ get extraReadouts() {
32
+ if (!this.showStatus) return [];
33
+ return threewayValveReadouts(this._on, this.flows);
34
+ }
35
+ renderIcon(slot) {
36
+ return html`<obc-valve-analog-three-way-icon
37
+ .open1=${this.open1}
38
+ .open2=${this.open2}
39
+ .open3=${this.open3}
40
+ .orientation=${this.orientation}
41
+ slot=${slot}
42
+ ></obc-valve-analog-three-way-icon>`;
43
+ }
44
+ get icon() {
45
+ return html`${this.renderIcon("icon")}${this.renderIcon("icon-silhouette")}`;
46
+ }
47
+ };
48
+ __decorate([property({ type: Number })], ObcAnalogThreewayValve.prototype, "open1", void 0);
49
+ __decorate([property({ type: Number })], ObcAnalogThreewayValve.prototype, "open2", void 0);
50
+ __decorate([property({ type: Number })], ObcAnalogThreewayValve.prototype, "open3", void 0);
51
+ __decorate([property({ type: String })], ObcAnalogThreewayValve.prototype, "orientation", void 0);
52
+ __decorate([property({
53
+ type: Array,
54
+ attribute: false
55
+ })], ObcAnalogThreewayValve.prototype, "flows", void 0);
56
+ __decorate([property({ type: String })], ObcAnalogThreewayValve.prototype, "variant", void 0);
57
+ ObcAnalogThreewayValve = __decorate([customElement("obc-analog-threeway-valve")], ObcAnalogThreewayValve);
58
+ //#endregion
59
+ export { AnalogThreewayValveVariant, ObcAnalogThreewayValve };
60
+
61
+ //# sourceMappingURL=analog-threeway-valve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analog-threeway-valve.js","names":[],"sources":["../../../src/automation/analog-threeway-valve/analog-threeway-valve.ts"],"sourcesContent":["import {html} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport '../valve-analog-three-way-icon/valve-analog-three-way-icon.js';\nimport {customElement} from '../../decorator.js';\nimport {ObcAbstractAutomationButton} from '../automation-button/abstract-automation-button.js';\nimport {AutomationButtonReadoutStack} from '../../components/automation-button-readout-stack/automation-button-readout-stack.js';\nimport {\n ThreewayValveFlow,\n ThreewayValveOrientation,\n threewayValveReadouts,\n} from '../threeway-valve-shared/threeway-valve-shared.js';\n\nexport enum AnalogThreewayValveVariant {\n regular = 'regular',\n flat = 'flat',\n}\n\n/**\n * `<obc-analog-threeway-valve>` – three-way control valve for process\n * diagrams, with a continuous opening per port.\n *\n * ## Features\n *\n * - **Three ports:** `open1`, `open2` and `open3` set each port's opening in\n * percent. Ports are numbered from the side without a port: with\n * `orientation` `bottom`, port 1 is left, port 2 is the stem at the bottom\n * and port 3 is right. The numbering turns with the symbol.\n * - **Symbol:** a partly open port shows its shut part as a band at the port\n * end, a port at 0 % is drawn plugged, and the handle shows how the most\n * open port splits between the two others (`obc-valve-analog-three-way-icon`).\n * - **Orientation:** `bottom` and `top` lay the valve on a horizontal pipe,\n * `left` and `right` on a vertical one; the value names the side the stem\n * points to.\n * - **Flow readout:** `flows` lists one readout row per flow, each with an\n * optional arrow direction and either a value with a unit (`%` when left out)\n * or a state, `{open}`, shown as `Open` or `Closed` after the arrow, or\n * after the on/off icon when there is no direction. Without flows the\n * readout shows `Open` or `Closed`.\n * - Badges, alert frame, progress and readout placement come from the shared\n * automation button base.\n *\n * ## Usage Guidelines\n *\n * Use for a mixing or diverting valve that opens its ports continuously.\n * With fewer than two ports open no flow can pass, and the valve shows as\n * closed. For on/off ports use `obc-digital-threeway-valve`; for a two-port\n * control valve use `obc-analog-valve`.\n *\n * @property open1 - Opening of port 1 in percent (0–100).\n * @property open2 - Opening of port 2, the stem, in percent (0–100).\n * @property open3 - Opening of port 3 in percent (0–100).\n * @property orientation - Side the stem points to.\n * @property flows - Readout rows, one per flow: an optional arrow direction with either a value and optional unit (default `%`) or `open` for an `Open`/`Closed` state.\n * @property variant - Visual style of the button surround.\n * @slot badge-top-right - Content projected into the top-right badge position; overrides `badgeAlert`.\n * @slot badge-top-left - Content projected into the top-left badge position; overrides `badgeControl`.\n * @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides `badgeInterlock`.\n * @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides `badgeCommandLocked`.\n * @fires click - Fired when the valve is clicked.\n * @experimental\n */\n@customElement('obc-analog-threeway-valve')\nexport class ObcAnalogThreewayValve extends ObcAbstractAutomationButton {\n @property({type: Number}) open1: number = 0;\n @property({type: Number}) open2: number = 0;\n @property({type: Number}) open3: number = 0;\n @property({type: String}) orientation: ThreewayValveOrientation =\n ThreewayValveOrientation.bottom;\n @property({type: Array, attribute: false}) flows: ThreewayValveFlow[] = [];\n @property({type: String}) variant: AnalogThreewayValveVariant =\n AnalogThreewayValveVariant.regular;\n\n override get _on(): boolean {\n return (\n [this.open1, this.open2, this.open3].filter((o) => o > 0).length >= 2\n );\n }\n\n override get extraReadouts(): AutomationButtonReadoutStack[] {\n if (!this.showStatus) {\n return [];\n }\n return threewayValveReadouts(this._on, this.flows);\n }\n\n private renderIcon(slot: string) {\n return html`<obc-valve-analog-three-way-icon\n .open1=${this.open1}\n .open2=${this.open2}\n .open3=${this.open3}\n .orientation=${this.orientation}\n slot=${slot}\n ></obc-valve-analog-three-way-icon>`;\n }\n\n override get icon() {\n return html`${this.renderIcon('icon')}${this.renderIcon('icon-silhouette')}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-analog-threeway-valve': ObcAnalogThreewayValve;\n }\n}\n"],"mappings":";;;;;;;;AAYA,IAAY,6BAAL,yBAAA,4BAAA;CACL,2BAAA,aAAA;CACA,2BAAA,UAAA;;AACF,EAAA,CAAA,CAAA;AA+CO,IAAM,yBAAN,MAAM,+BAA+B,4BAA4B;;;EAC5B,KAAA,QAAA;EACA,KAAA,QAAA;EACA,KAAA,QAAA;EAExC,KAAA,cAAA,yBAAyB;EAC6C,KAAA,QAAA,CAAC;;;CAIzE,IAAa,MAAe;EAC1B,OACE;GAAC,KAAK;GAAO,KAAK;GAAO,KAAK;EAAK,CAAC,CAAC,QAAQ,MAAM,IAAI,CAAC,CAAC,CAAC,UAAU;CAExE;CAEA,IAAa,gBAAgD;EAC3D,IAAI,CAAC,KAAK,YACR,OAAO,CAAC;EAEV,OAAO,sBAAsB,KAAK,KAAK,KAAK,KAAK;CACnD;CAEA,WAAmB,MAAc;EAC/B,OAAO,IAAI;eACA,KAAK,MAAM;eACX,KAAK,MAAM;eACX,KAAK,MAAM;qBACL,KAAK,YAAY;aACzB,KAAK;;CAEhB;CAEA,IAAa,OAAO;EAClB,OAAO,IAAI,GAAG,KAAK,WAAW,MAAM,IAAI,KAAK,WAAW,iBAAiB;CAC3E;AACF;AAnCG,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,uBAAA,WAAA,SAAA,KAAA,CAAA;AACvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,uBAAA,WAAA,SAAA,KAAA,CAAA;AACvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,uBAAA,WAAA,SAAA,KAAA,CAAA;AACvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,uBAAA,WAAA,eAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS;CAAC,MAAM;CAAO,WAAW;AAAK,CAAC,CAAA,GAAA,uBAAA,WAAA,SAAA,KAAA,CAAA;AACxC,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,uBAAA,WAAA,WAAA,KAAA,CAAA;AARzB,yBAAA,WAAA,CAAA,cAAc,2BAA2B,CAAA,GAAA,sBAAA"}
@@ -1,8 +1,8 @@
1
1
  import { customElement } from "../../decorator.js";
2
2
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/decorate.js";
3
- import "../valve-analoge-two-way-icon/valve-analog-two-way-icon.js";
4
3
  import { AutomationButtonLabelDirection } from "../automation-button/automation-button.js";
5
4
  import { ObcAbstractAutomationButton } from "../automation-button/abstract-automation-button.js";
5
+ import "../valve-analoge-two-way-icon/valve-analog-two-way-icon.js";
6
6
  import { html } from "lit";
7
7
  import { property } from "lit/decorators.js";
8
8
  //#region src/automation/analog-valve/analog-valve.ts
@@ -0,0 +1,82 @@
1
+ import { ObcAbstractAutomationButton } from '../automation-button/abstract-automation-button.js';
2
+ import { AutomationButtonReadoutStack } from '../../components/automation-button-readout-stack/automation-button-readout-stack.js';
3
+ import { ThreewayValveFlow, ThreewayValveOrientation } from '../threeway-valve-shared/threeway-valve-shared.js';
4
+ import '../../icons/icon-threeway-digital-open.js';
5
+ import '../../icons/icon-threeway-digital-closed.js';
6
+ import '../../icons/icon-threeway-digital-closed-left.js';
7
+ import '../../icons/icon-threeway-digital-closed-bottom.js';
8
+ import '../../icons/icon-threeway-digital-closed-right.js';
9
+ export declare enum DigitalThreewayValveVariant {
10
+ regular = "regular",
11
+ flat = "flat"
12
+ }
13
+ /**
14
+ * `<obc-digital-threeway-valve>` – three-way on/off valve for process
15
+ * diagrams, with one open/closed state per port.
16
+ *
17
+ * ## Features
18
+ *
19
+ * - **Three ports:** `open1`, `open2` and `open3` open or close each port.
20
+ * Ports are numbered from the side without a port: with `orientation`
21
+ * `bottom`, port 1 is left, port 2 is the stem at the bottom and port 3 is
22
+ * right. The numbering turns with the symbol.
23
+ * - **Orientation:** `bottom` and `top` lay the valve on a horizontal pipe,
24
+ * `left` and `right` on a vertical one; the value names the side the stem
25
+ * points to.
26
+ * - **Flow readout:** `flows` lists one readout row per flow, each with an
27
+ * optional arrow direction and either a value with a unit (`%` when left out)
28
+ * or a state, `{open}`, shown as `Open` or `Closed` after the arrow, or
29
+ * after the on/off icon when there is no direction. Without flows the
30
+ * readout shows `Open` or `Closed`.
31
+ * - Badges, alert frame, progress and readout placement come from the shared
32
+ * automation button base.
33
+ *
34
+ * ## Usage Guidelines
35
+ *
36
+ * Use where a valve directs flow between three pipes and each port is either
37
+ * open or closed. With one port closed the symbol shows that port plugged;
38
+ * with fewer than two ports open no flow can pass, and the valve shows as
39
+ * closed. For a valve that opens its ports continuously use
40
+ * `obc-analog-threeway-valve`; for a two-port valve use `obc-digital-valve`.
41
+ *
42
+ * TODO(designer): no icon shows a single open port, so that case uses the
43
+ * closed symbol.
44
+ *
45
+ * @property open1 - Opens port 1.
46
+ * @property open2 - Opens port 2, the stem.
47
+ * @property open3 - Opens port 3.
48
+ * @property orientation - Side the stem points to.
49
+ * @property flows - Readout rows, one per flow: an optional arrow direction with either a value and optional unit (default `%`) or `open` for an `Open`/`Closed` state.
50
+ * @property variant - Visual style of the button surround.
51
+ * @slot badge-top-right - Content projected into the top-right badge position; overrides `badgeAlert`.
52
+ * @slot badge-top-left - Content projected into the top-left badge position; overrides `badgeControl`.
53
+ * @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides `badgeInterlock`.
54
+ * @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides `badgeCommandLocked`.
55
+ * @fires click - Fired when the valve is clicked.
56
+ * @experimental
57
+ */
58
+ export declare class ObcDigitalThreewayValve extends ObcAbstractAutomationButton {
59
+ /** Opens port 1. */
60
+ open1: boolean;
61
+ /** Opens port 2, the stem. */
62
+ open2: boolean;
63
+ /** Opens port 3. */
64
+ open3: boolean;
65
+ /** Side the stem points to. */
66
+ orientation: ThreewayValveOrientation;
67
+ /** Readout rows, one per flow: an optional arrow direction with either a value and optional unit (default `%`) or `open` for an `Open`/`Closed` state. */
68
+ flows: ThreewayValveFlow[];
69
+ /** Visual style of the button surround. */
70
+ variant: DigitalThreewayValveVariant;
71
+ private get ports();
72
+ get _on(): boolean;
73
+ get extraReadouts(): AutomationButtonReadoutStack[];
74
+ private renderIcon;
75
+ get icon(): import('lit-html').TemplateResult<1>;
76
+ }
77
+ declare global {
78
+ interface HTMLElementTagNameMap {
79
+ 'obc-digital-threeway-valve': ObcDigitalThreewayValve;
80
+ }
81
+ }
82
+ //# sourceMappingURL=digital-threeway-valve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"digital-threeway-valve.d.ts","sourceRoot":"","sources":["../../../src/automation/digital-threeway-valve/digital-threeway-valve.ts"],"names":[],"mappings":"AAEA,OAAO,2CAA2C,CAAC;AACnD,OAAO,6CAA6C,CAAC;AACrD,OAAO,kDAAkD,CAAC;AAC1D,OAAO,oDAAoD,CAAC;AAC5D,OAAO,mDAAmD,CAAC;AAE3D,OAAO,EAAC,2BAA2B,EAAC,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAC,4BAA4B,EAAC,MAAM,qFAAqF,CAAC;AACjI,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EAGzB,MAAM,mDAAmD,CAAC;AAE3D,oBAAY,2BAA2B;IACrC,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,qBACa,uBAAwB,SAAQ,2BAA2B;IAC3C,KAAK,EAAE,OAAO,CAAS;IACvB,KAAK,EAAE,OAAO,CAAS;IACvB,KAAK,EAAE,OAAO,CAAS;IACxB,WAAW,EAAE,wBAAwB,CAC7B;IACS,KAAK,EAAE,iBAAiB,EAAE,CAAM;IACjD,OAAO,EAAE,2BAA2B,CACxB;IAEtC,OAAO,KAAK,KAAK,GAEhB;IAED,IAAa,GAAG,IAAI,OAAO,CAE1B;IAED,IAAa,aAAa,IAAI,4BAA4B,EAAE,CAK3D;IAED,OAAO,CAAC,UAAU;IAwClB,IAAa,IAAI,yCAEhB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,4BAA4B,EAAE,uBAAuB,CAAC;KACvD;CACF"}
@@ -0,0 +1,90 @@
1
+ import { customElement } from "../../decorator.js";
2
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/decorate.js";
3
+ import "../../icons/icon-threeway-digital-closed-bottom.js";
4
+ import "../../icons/icon-threeway-digital-closed-left.js";
5
+ import "../../icons/icon-threeway-digital-closed-right.js";
6
+ import "../../icons/icon-threeway-digital-closed.js";
7
+ import "../../icons/icon-threeway-digital-open.js";
8
+ import { ThreewayValveOrientation, threewayValveReadouts, threewayValveRotation } from "../threeway-valve-shared/threeway-valve-shared.js";
9
+ import { ObcAbstractAutomationButton } from "../automation-button/abstract-automation-button.js";
10
+ import { html } from "lit";
11
+ import { property } from "lit/decorators.js";
12
+ //#region src/automation/digital-threeway-valve/digital-threeway-valve.ts
13
+ var DigitalThreewayValveVariant = /* @__PURE__ */ function(DigitalThreewayValveVariant) {
14
+ DigitalThreewayValveVariant["regular"] = "regular";
15
+ DigitalThreewayValveVariant["flat"] = "flat";
16
+ return DigitalThreewayValveVariant;
17
+ }({});
18
+ var ObcDigitalThreewayValve = class ObcDigitalThreewayValve extends ObcAbstractAutomationButton {
19
+ constructor(..._args) {
20
+ super(..._args);
21
+ this.open1 = false;
22
+ this.open2 = false;
23
+ this.open3 = false;
24
+ this.orientation = ThreewayValveOrientation.bottom;
25
+ this.flows = [];
26
+ this.variant = "regular";
27
+ }
28
+ get ports() {
29
+ return [
30
+ this.open1,
31
+ this.open2,
32
+ this.open3
33
+ ];
34
+ }
35
+ get _on() {
36
+ return this.ports.filter(Boolean).length >= 2;
37
+ }
38
+ get extraReadouts() {
39
+ if (!this.showStatus) return [];
40
+ return threewayValveReadouts(this._on, this.flows);
41
+ }
42
+ renderIcon(slot) {
43
+ const style = `display: block; transform: rotate(${threewayValveRotation(this.orientation)}deg); line-height: 0;`;
44
+ const ports = this.ports;
45
+ if (!this._on) return html`<obi-threeway-digital-closed
46
+ usecsscolor
47
+ slot=${slot}
48
+ style=${style}
49
+ ></obi-threeway-digital-closed>`;
50
+ switch (ports.indexOf(false)) {
51
+ case 0: return html`<obi-threeway-digital-closed-left
52
+ usecsscolor
53
+ slot=${slot}
54
+ style=${style}
55
+ ></obi-threeway-digital-closed-left>`;
56
+ case 1: return html`<obi-threeway-digital-closed-bottom
57
+ usecsscolor
58
+ slot=${slot}
59
+ style=${style}
60
+ ></obi-threeway-digital-closed-bottom>`;
61
+ case 2: return html`<obi-threeway-digital-closed-right
62
+ usecsscolor
63
+ slot=${slot}
64
+ style=${style}
65
+ ></obi-threeway-digital-closed-right>`;
66
+ default: return html`<obi-threeway-digital-open
67
+ usecsscolor
68
+ slot=${slot}
69
+ style=${style}
70
+ ></obi-threeway-digital-open>`;
71
+ }
72
+ }
73
+ get icon() {
74
+ return html`${this.renderIcon("icon")}${this.renderIcon("icon-silhouette")}`;
75
+ }
76
+ };
77
+ __decorate([property({ type: Boolean })], ObcDigitalThreewayValve.prototype, "open1", void 0);
78
+ __decorate([property({ type: Boolean })], ObcDigitalThreewayValve.prototype, "open2", void 0);
79
+ __decorate([property({ type: Boolean })], ObcDigitalThreewayValve.prototype, "open3", void 0);
80
+ __decorate([property({ type: String })], ObcDigitalThreewayValve.prototype, "orientation", void 0);
81
+ __decorate([property({
82
+ type: Array,
83
+ attribute: false
84
+ })], ObcDigitalThreewayValve.prototype, "flows", void 0);
85
+ __decorate([property({ type: String })], ObcDigitalThreewayValve.prototype, "variant", void 0);
86
+ ObcDigitalThreewayValve = __decorate([customElement("obc-digital-threeway-valve")], ObcDigitalThreewayValve);
87
+ //#endregion
88
+ export { DigitalThreewayValveVariant, ObcDigitalThreewayValve };
89
+
90
+ //# sourceMappingURL=digital-threeway-valve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"digital-threeway-valve.js","names":[],"sources":["../../../src/automation/digital-threeway-valve/digital-threeway-valve.ts"],"sourcesContent":["import {html} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport '../../icons/icon-threeway-digital-open.js';\nimport '../../icons/icon-threeway-digital-closed.js';\nimport '../../icons/icon-threeway-digital-closed-left.js';\nimport '../../icons/icon-threeway-digital-closed-bottom.js';\nimport '../../icons/icon-threeway-digital-closed-right.js';\nimport {customElement} from '../../decorator.js';\nimport {ObcAbstractAutomationButton} from '../automation-button/abstract-automation-button.js';\nimport {AutomationButtonReadoutStack} from '../../components/automation-button-readout-stack/automation-button-readout-stack.js';\nimport {\n ThreewayValveFlow,\n ThreewayValveOrientation,\n threewayValveReadouts,\n threewayValveRotation,\n} from '../threeway-valve-shared/threeway-valve-shared.js';\n\nexport enum DigitalThreewayValveVariant {\n regular = 'regular',\n flat = 'flat',\n}\n\n/**\n * `<obc-digital-threeway-valve>` – three-way on/off valve for process\n * diagrams, with one open/closed state per port.\n *\n * ## Features\n *\n * - **Three ports:** `open1`, `open2` and `open3` open or close each port.\n * Ports are numbered from the side without a port: with `orientation`\n * `bottom`, port 1 is left, port 2 is the stem at the bottom and port 3 is\n * right. The numbering turns with the symbol.\n * - **Orientation:** `bottom` and `top` lay the valve on a horizontal pipe,\n * `left` and `right` on a vertical one; the value names the side the stem\n * points to.\n * - **Flow readout:** `flows` lists one readout row per flow, each with an\n * optional arrow direction and either a value with a unit (`%` when left out)\n * or a state, `{open}`, shown as `Open` or `Closed` after the arrow, or\n * after the on/off icon when there is no direction. Without flows the\n * readout shows `Open` or `Closed`.\n * - Badges, alert frame, progress and readout placement come from the shared\n * automation button base.\n *\n * ## Usage Guidelines\n *\n * Use where a valve directs flow between three pipes and each port is either\n * open or closed. With one port closed the symbol shows that port plugged;\n * with fewer than two ports open no flow can pass, and the valve shows as\n * closed. For a valve that opens its ports continuously use\n * `obc-analog-threeway-valve`; for a two-port valve use `obc-digital-valve`.\n *\n * TODO(designer): no icon shows a single open port, so that case uses the\n * closed symbol.\n *\n * @property open1 - Opens port 1.\n * @property open2 - Opens port 2, the stem.\n * @property open3 - Opens port 3.\n * @property orientation - Side the stem points to.\n * @property flows - Readout rows, one per flow: an optional arrow direction with either a value and optional unit (default `%`) or `open` for an `Open`/`Closed` state.\n * @property variant - Visual style of the button surround.\n * @slot badge-top-right - Content projected into the top-right badge position; overrides `badgeAlert`.\n * @slot badge-top-left - Content projected into the top-left badge position; overrides `badgeControl`.\n * @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides `badgeInterlock`.\n * @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides `badgeCommandLocked`.\n * @fires click - Fired when the valve is clicked.\n * @experimental\n */\n@customElement('obc-digital-threeway-valve')\nexport class ObcDigitalThreewayValve extends ObcAbstractAutomationButton {\n @property({type: Boolean}) open1: boolean = false;\n @property({type: Boolean}) open2: boolean = false;\n @property({type: Boolean}) open3: boolean = false;\n @property({type: String}) orientation: ThreewayValveOrientation =\n ThreewayValveOrientation.bottom;\n @property({type: Array, attribute: false}) flows: ThreewayValveFlow[] = [];\n @property({type: String}) variant: DigitalThreewayValveVariant =\n DigitalThreewayValveVariant.regular;\n\n private get ports(): boolean[] {\n return [this.open1, this.open2, this.open3];\n }\n\n override get _on(): boolean {\n return this.ports.filter(Boolean).length >= 2;\n }\n\n override get extraReadouts(): AutomationButtonReadoutStack[] {\n if (!this.showStatus) {\n return [];\n }\n return threewayValveReadouts(this._on, this.flows);\n }\n\n private renderIcon(slot: string) {\n const style = `display: block; transform: rotate(${threewayValveRotation(\n this.orientation\n )}deg); line-height: 0;`;\n const ports = this.ports;\n if (!this._on) {\n return html`<obi-threeway-digital-closed\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed>`;\n }\n switch (ports.indexOf(false)) {\n case 0:\n return html`<obi-threeway-digital-closed-left\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed-left>`;\n case 1:\n return html`<obi-threeway-digital-closed-bottom\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed-bottom>`;\n case 2:\n return html`<obi-threeway-digital-closed-right\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed-right>`;\n default:\n return html`<obi-threeway-digital-open\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-open>`;\n }\n }\n\n override get icon() {\n return html`${this.renderIcon('icon')}${this.renderIcon('icon-silhouette')}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-digital-threeway-valve': ObcDigitalThreewayValve;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,IAAY,8BAAL,yBAAA,6BAAA;CACL,4BAAA,aAAA;CACA,4BAAA,UAAA;;AACF,EAAA,CAAA,CAAA;AAgDO,IAAM,0BAAN,MAAM,gCAAgC,4BAA4B;;;EAC3B,KAAA,QAAA;EACA,KAAA,QAAA;EACA,KAAA,QAAA;EAE1C,KAAA,cAAA,yBAAyB;EAC6C,KAAA,QAAA,CAAC;;;CAIzE,IAAY,QAAmB;EAC7B,OAAO;GAAC,KAAK;GAAO,KAAK;GAAO,KAAK;EAAK;CAC5C;CAEA,IAAa,MAAe;EAC1B,OAAO,KAAK,MAAM,OAAO,OAAO,CAAC,CAAC,UAAU;CAC9C;CAEA,IAAa,gBAAgD;EAC3D,IAAI,CAAC,KAAK,YACR,OAAO,CAAC;EAEV,OAAO,sBAAsB,KAAK,KAAK,KAAK,KAAK;CACnD;CAEA,WAAmB,MAAc;EAC/B,MAAM,QAAQ,qCAAqC,sBACjD,KAAK,WACP,EAAE;EACF,MAAM,QAAQ,KAAK;EACnB,IAAI,CAAC,KAAK,KACR,OAAO,IAAI;;eAEF,KAAK;gBACJ,MAAM;;EAGlB,QAAQ,MAAM,QAAQ,KAAK,GAA3B;GACE,KAAK,GACH,OAAO,IAAI;;iBAEF,KAAK;kBACJ,MAAM;;GAElB,KAAK,GACH,OAAO,IAAI;;iBAEF,KAAK;kBACJ,MAAM;;GAElB,KAAK,GACH,OAAO,IAAI;;iBAEF,KAAK;kBACJ,MAAM;;GAElB,SACE,OAAO,IAAI;;iBAEF,KAAK;kBACJ,MAAM;;EAEpB;CACF;CAEA,IAAa,OAAO;EAClB,OAAO,IAAI,GAAG,KAAK,WAAW,MAAM,IAAI,KAAK,WAAW,iBAAiB;CAC3E;AACF;AAnEG,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,wBAAA,WAAA,SAAA,KAAA,CAAA;AACxB,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,wBAAA,WAAA,SAAA,KAAA,CAAA;AACxB,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,wBAAA,WAAA,SAAA,KAAA,CAAA;AACxB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,wBAAA,WAAA,eAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS;CAAC,MAAM;CAAO,WAAW;AAAK,CAAC,CAAA,GAAA,wBAAA,WAAA,SAAA,KAAA,CAAA;AACxC,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,wBAAA,WAAA,WAAA,KAAA,CAAA;AARzB,0BAAA,WAAA,CAAA,cAAc,4BAA4B,CAAA,GAAA,uBAAA"}
@@ -0,0 +1,39 @@
1
+ import { AutomationButtonLabelDirection } from '../automation-button/automation-button.js';
2
+ import { AutomationButtonReadoutStack } from '../../components/automation-button-readout-stack/automation-button-readout-stack.js';
3
+ /**
4
+ * The side the stem (port 2) points to. `bottom` and `top` lay the valve on a
5
+ * horizontal pipe, `left` and `right` on a vertical one.
6
+ */
7
+ export declare enum ThreewayValveOrientation {
8
+ bottom = "bottom",
9
+ left = "left",
10
+ top = "top",
11
+ right = "right"
12
+ }
13
+ /** Clockwise rotation from the `bottom` drawing, in degrees. */
14
+ export declare function threewayValveRotation(orientation: ThreewayValveOrientation): number;
15
+ /** A flow readout row with a value: `→ 060 %`. */
16
+ export interface ThreewayValveValueFlow {
17
+ /** Arrow direction on screen; left out or `none` hides the arrow. */
18
+ direction?: AutomationButtonLabelDirection;
19
+ value: number;
20
+ /** Defaults to `%`. */
21
+ unit?: string;
22
+ }
23
+ /** A flow readout row with a state: `→ Open`, `→ Closed`, or the on/off icon without a direction. */
24
+ export interface ThreewayValveStateFlow {
25
+ /**
26
+ * Arrow direction on screen; left out or `none` shows the on or off icon
27
+ * instead.
28
+ */
29
+ direction?: AutomationButtonLabelDirection;
30
+ open: boolean;
31
+ }
32
+ /** One row of the flow readout. */
33
+ export type ThreewayValveFlow = ThreewayValveValueFlow | ThreewayValveStateFlow;
34
+ /**
35
+ * The readout rows of a three-way valve: `Closed` while no flow can pass,
36
+ * the flow rows while it can, and `Open` when the application gives no flows.
37
+ */
38
+ export declare function threewayValveReadouts(passing: boolean, flows: ThreewayValveFlow[]): AutomationButtonReadoutStack[];
39
+ //# sourceMappingURL=threeway-valve-shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threeway-valve-shared.d.ts","sourceRoot":"","sources":["../../../src/automation/threeway-valve-shared/threeway-valve-shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAC,8BAA8B,EAAC,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAAC,4BAA4B,EAAC,MAAM,qFAAqF,CAAC;AAEjI;;;GAGG;AACH,oBAAY,wBAAwB;IAClC,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;CAChB;AAED,gEAAgE;AAChE,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,wBAAwB,GACpC,MAAM,CAWR;AAED,kDAAkD;AAClD,MAAM,WAAW,sBAAsB;IACrC,qEAAqE;IACrE,SAAS,CAAC,EAAE,8BAA8B,CAAC;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qGAAqG;AACrG,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,SAAS,CAAC,EAAE,8BAA8B,CAAC;IAC3C,IAAI,EAAE,OAAO,CAAC;CACf;AAED,mCAAmC;AACnC,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,GAAG,sBAAsB,CAAC;AAEhF;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,iBAAiB,EAAE,GACzB,4BAA4B,EAAE,CA6BhC"}
@@ -0,0 +1,80 @@
1
+ import { AutomationButtonLabelDirection } from "../automation-button/automation-button.js";
2
+ //#region src/automation/threeway-valve-shared/threeway-valve-shared.ts
3
+ /**
4
+ * Shared vocabulary of the three-way valves: `obc-digital-threeway-valve`,
5
+ * `obc-analog-threeway-valve` and `obc-valve-analog-three-way-icon`.
6
+ *
7
+ * ## Ports
8
+ *
9
+ * A three-way valve has three ports and one side without a port. The ports
10
+ * are numbered from the side without a port, in the order left, stem, right
11
+ * as seen with the stem pointing down: with `orientation` `bottom`, port 1 is
12
+ * the left port, port 2 the bottom port (the stem) and port 3 the right port.
13
+ * The numbering turns with the symbol, so port 2 is always the stem.
14
+ *
15
+ * ## Flow readouts
16
+ *
17
+ * Flow through a three-way valve can go several ways at once, so the readout
18
+ * is a list: one row per flow, each with an optional arrow direction and
19
+ * either a value with a unit (`%` when left out) or a state (`Open` /
20
+ * `Closed`).
21
+ *
22
+ * @module
23
+ */
24
+ /**
25
+ * The side the stem (port 2) points to. `bottom` and `top` lay the valve on a
26
+ * horizontal pipe, `left` and `right` on a vertical one.
27
+ */
28
+ var ThreewayValveOrientation = /* @__PURE__ */ function(ThreewayValveOrientation) {
29
+ ThreewayValveOrientation["bottom"] = "bottom";
30
+ ThreewayValveOrientation["left"] = "left";
31
+ ThreewayValveOrientation["top"] = "top";
32
+ ThreewayValveOrientation["right"] = "right";
33
+ return ThreewayValveOrientation;
34
+ }({});
35
+ /** Clockwise rotation from the `bottom` drawing, in degrees. */
36
+ function threewayValveRotation(orientation) {
37
+ switch (orientation) {
38
+ case "left": return 90;
39
+ case "top": return 180;
40
+ case "right": return 270;
41
+ default: return 0;
42
+ }
43
+ }
44
+ /**
45
+ * The readout rows of a three-way valve: `Closed` while no flow can pass,
46
+ * the flow rows while it can, and `Open` when the application gives no flows.
47
+ */
48
+ function threewayValveReadouts(passing, flows) {
49
+ if (!passing) return [{
50
+ type: "state-off",
51
+ value: "Closed",
52
+ hasIcon: true
53
+ }];
54
+ if (flows.length === 0) return [{
55
+ type: "state-on",
56
+ value: "Open",
57
+ hasIcon: true
58
+ }];
59
+ return flows.map((flow) => {
60
+ if ("open" in flow) return {
61
+ type: flow.open ? "state-on" : "state-off",
62
+ value: flow.open ? "Open" : "Closed",
63
+ hasIcon: flow.direction === void 0 || flow.direction === AutomationButtonLabelDirection.none,
64
+ direction: flow.direction
65
+ };
66
+ const direction = flow.direction ?? AutomationButtonLabelDirection.none;
67
+ return {
68
+ type: "value",
69
+ value: flow.value,
70
+ nDigits: 3,
71
+ unit: flow.unit ?? "%",
72
+ direction,
73
+ icon: direction === AutomationButtonLabelDirection.none ? "none" : "arrow"
74
+ };
75
+ });
76
+ }
77
+ //#endregion
78
+ export { ThreewayValveOrientation, threewayValveReadouts, threewayValveRotation };
79
+
80
+ //# sourceMappingURL=threeway-valve-shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threeway-valve-shared.js","names":[],"sources":["../../../src/automation/threeway-valve-shared/threeway-valve-shared.ts"],"sourcesContent":["/**\n * Shared vocabulary of the three-way valves: `obc-digital-threeway-valve`,\n * `obc-analog-threeway-valve` and `obc-valve-analog-three-way-icon`.\n *\n * ## Ports\n *\n * A three-way valve has three ports and one side without a port. The ports\n * are numbered from the side without a port, in the order left, stem, right\n * as seen with the stem pointing down: with `orientation` `bottom`, port 1 is\n * the left port, port 2 the bottom port (the stem) and port 3 the right port.\n * The numbering turns with the symbol, so port 2 is always the stem.\n *\n * ## Flow readouts\n *\n * Flow through a three-way valve can go several ways at once, so the readout\n * is a list: one row per flow, each with an optional arrow direction and\n * either a value with a unit (`%` when left out) or a state (`Open` /\n * `Closed`).\n *\n * @module\n */\nimport {AutomationButtonLabelDirection} from '../automation-button/automation-button.js';\nimport {AutomationButtonReadoutStack} from '../../components/automation-button-readout-stack/automation-button-readout-stack.js';\n\n/**\n * The side the stem (port 2) points to. `bottom` and `top` lay the valve on a\n * horizontal pipe, `left` and `right` on a vertical one.\n */\nexport enum ThreewayValveOrientation {\n bottom = 'bottom',\n left = 'left',\n top = 'top',\n right = 'right',\n}\n\n/** Clockwise rotation from the `bottom` drawing, in degrees. */\nexport function threewayValveRotation(\n orientation: ThreewayValveOrientation\n): number {\n switch (orientation) {\n case ThreewayValveOrientation.left:\n return 90;\n case ThreewayValveOrientation.top:\n return 180;\n case ThreewayValveOrientation.right:\n return 270;\n default:\n return 0;\n }\n}\n\n/** A flow readout row with a value: `→ 060 %`. */\nexport interface ThreewayValveValueFlow {\n /** Arrow direction on screen; left out or `none` hides the arrow. */\n direction?: AutomationButtonLabelDirection;\n value: number;\n /** Defaults to `%`. */\n unit?: string;\n}\n\n/** A flow readout row with a state: `→ Open`, `→ Closed`, or the on/off icon without a direction. */\nexport interface ThreewayValveStateFlow {\n /**\n * Arrow direction on screen; left out or `none` shows the on or off icon\n * instead.\n */\n direction?: AutomationButtonLabelDirection;\n open: boolean;\n}\n\n/** One row of the flow readout. */\nexport type ThreewayValveFlow = ThreewayValveValueFlow | ThreewayValveStateFlow;\n\n/**\n * The readout rows of a three-way valve: `Closed` while no flow can pass,\n * the flow rows while it can, and `Open` when the application gives no flows.\n */\nexport function threewayValveReadouts(\n passing: boolean,\n flows: ThreewayValveFlow[]\n): AutomationButtonReadoutStack[] {\n if (!passing) {\n return [{type: 'state-off', value: 'Closed', hasIcon: true}];\n }\n if (flows.length === 0) {\n return [{type: 'state-on', value: 'Open', hasIcon: true}];\n }\n return flows.map((flow): AutomationButtonReadoutStack => {\n if ('open' in flow) {\n return {\n type: flow.open ? 'state-on' : 'state-off',\n value: flow.open ? 'Open' : 'Closed',\n hasIcon:\n flow.direction === undefined ||\n flow.direction === AutomationButtonLabelDirection.none,\n direction: flow.direction,\n };\n }\n const direction = flow.direction ?? AutomationButtonLabelDirection.none;\n return {\n type: 'value',\n value: flow.value,\n nDigits: 3,\n unit: flow.unit ?? '%',\n direction,\n icon:\n direction === AutomationButtonLabelDirection.none ? 'none' : 'arrow',\n };\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,IAAY,2BAAL,yBAAA,0BAAA;CACL,yBAAA,YAAA;CACA,yBAAA,UAAA;CACA,yBAAA,SAAA;CACA,yBAAA,WAAA;;AACF,EAAA,CAAA,CAAA;;AAGA,SAAgB,sBACd,aACQ;CACR,QAAQ,aAAR;EACE,KAAA,QACE,OAAO;EACT,KAAA,OACE,OAAO;EACT,KAAA,SACE,OAAO;EACT,SACE,OAAO;CACX;AACF;;;;;AA4BA,SAAgB,sBACd,SACA,OACgC;CAChC,IAAI,CAAC,SACH,OAAO,CAAC;EAAC,MAAM;EAAa,OAAO;EAAU,SAAS;CAAI,CAAC;CAE7D,IAAI,MAAM,WAAW,GACnB,OAAO,CAAC;EAAC,MAAM;EAAY,OAAO;EAAQ,SAAS;CAAI,CAAC;CAE1D,OAAO,MAAM,KAAK,SAAuC;EACvD,IAAI,UAAU,MACZ,OAAO;GACL,MAAM,KAAK,OAAO,aAAa;GAC/B,OAAO,KAAK,OAAO,SAAS;GAC5B,SACE,KAAK,cAAc,KAAA,KACnB,KAAK,cAAc,+BAA+B;GACpD,WAAW,KAAK;EAClB;EAEF,MAAM,YAAY,KAAK,aAAa,+BAA+B;EACnE,OAAO;GACL,MAAM;GACN,OAAO,KAAK;GACZ,SAAS;GACT,MAAM,KAAK,QAAQ;GACnB;GACA,MACE,cAAc,+BAA+B,OAAO,SAAS;EACjE;CACF,CAAC;AACH"}
@@ -1,12 +1,73 @@
1
1
  import { LitElement } from 'lit';
2
+ import { ThreewayValveOrientation } from '../threeway-valve-shared/threeway-valve-shared.js';
2
3
  /**
4
+ * Three-way analog valve symbol whose ports open continuously from 0 to
5
+ * 100 %.
6
+ *
7
+ * Draws the same symbol as the `obi-threeway-analog-*` icons. The bands, the
8
+ * handle angle and the handle position are linear in the opening: exact at
9
+ * 0 and 100 %, within a fraction of a unit of the icons' 25/50/75 steps.
10
+ * Used as the icon of `obc-analog-threeway-valve`, and on its
11
+ * own inside an `obc-automation-button`.
12
+ *
13
+ * ## Ports
14
+ *
15
+ * Ports are numbered from the side without a port: with `orientation`
16
+ * `bottom`, port 1 is left, port 2 is the stem at the bottom and port 3 is
17
+ * right. The numbering turns with the symbol.
18
+ *
19
+ * - A port between 0 and 100 % shows its shut part as a band at the port end.
20
+ * - A port at 0 % is drawn plugged.
21
+ * - With fewer than two ports open no flow can pass, and the closed symbol is
22
+ * shown.
23
+ * - With all three ports at 100 % the generic open symbol is shown.
24
+ *
25
+ * The handle shows how the most open port (the inlet) splits between the two
26
+ * others, the way the `inleft-*` icons do.
27
+ *
28
+ * TODO(designer): the `inleft-bottom` and `inleft-right` icons name their 0
29
+ * and 100 steps the other way round from their 25/50/75 steps (at `-0` the
30
+ * port the series opens is shut). The symbol follows the 25/50/75 steps.
31
+ *
32
+ * @property open1 - Opening of port 1 in percent (0–100).
33
+ * @property open2 - Opening of port 2, the stem, in percent (0–100).
34
+ * @property open3 - Opening of port 3 in percent (0–100).
35
+ * @property orientation - Side the stem points to; `bottom` and `top` lay the valve on a horizontal pipe, `left` and `right` on a vertical one.
3
36
  * @stable
4
37
  */
5
38
  export declare class ObcValveAnalogThreeWayIcon extends LitElement {
6
- value: number;
7
- value2: number;
8
- closed: boolean;
9
- horisontal: boolean;
39
+ /** Opening of port 1 in percent (0–100). */
40
+ open1: number;
41
+ /** Opening of port 2, the stem, in percent (0–100). */
42
+ open2: number;
43
+ /** Opening of port 3 in percent (0–100). */
44
+ open3: number;
45
+ /** Side the stem points to; `bottom` and `top` lay the valve on a horizontal pipe, `left` and `right` on a vertical one. */
46
+ orientation: ThreewayValveOrientation;
47
+ /**
48
+ * Opening of the right port with the stem up. Setting any of `value`,
49
+ * `value2`, `closed` or `horisontal` draws the symbol stem up, with the
50
+ * left port fully open, and ignores `open1`–`open3` and `orientation`.
51
+ * @deprecated Use `open1`–`open3` and `orientation`.
52
+ */
53
+ value?: number;
54
+ /**
55
+ * Opening of the top port (the stem).
56
+ * @deprecated Use `open1`–`open3` and `orientation`.
57
+ */
58
+ value2?: number;
59
+ /** @deprecated Set every opening to 0. */
60
+ closed?: boolean;
61
+ /**
62
+ * Makes the stem the fully open port; `value` then opens the left port and
63
+ * `value2` the right one.
64
+ * @deprecated Use `open1`–`open3` and `orientation`.
65
+ */
66
+ horisontal?: boolean;
67
+ private get usesLegacyProperties();
68
+ private get ports();
69
+ private get rotation();
70
+ private renderOpen;
10
71
  render(): import('lit-html').TemplateResult<1>;
11
72
  static styles: import('lit').CSSResult;
12
73
  }
@@ -1 +1 @@
1
- {"version":3,"file":"valve-analog-three-way-icon.d.ts","sourceRoot":"","sources":["../../../src/automation/valve-analog-three-way-icon/valve-analog-three-way-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAuB,MAAM,KAAK,CAAC;AAKrD;;GAEG;AACH,qBACa,0BAA2B,SAAQ,UAAU;IAC9B,KAAK,EAAE,MAAM,CAAK;IAClB,MAAM,EAAE,MAAM,CAAK;IAClB,MAAM,EAAE,OAAO,CAAS;IACxB,UAAU,EAAE,OAAO,CAAS;IAE9C,MAAM;IAmIf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iCAAiC,EAAE,0BAA0B,CAAC;KAC/D;CACF"}
1
+ {"version":3,"file":"valve-analog-three-way-icon.d.ts","sourceRoot":"","sources":["../../../src/automation/valve-analog-three-way-icon/valve-analog-three-way-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAuB,MAAM,KAAK,CAAC;AAKrD,OAAO,EACL,wBAAwB,EAEzB,MAAM,mDAAmD,CAAC;AAqF3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBACa,0BAA2B,SAAQ,UAAU;IAC9B,KAAK,EAAE,MAAM,CAAK;IAClB,KAAK,EAAE,MAAM,CAAK;IAClB,KAAK,EAAE,MAAM,CAAK;IAClB,WAAW,EAAE,wBAAwB,CAC7B;IAElC;;;;;OAKG;IACuB,KAAK,CAAC,EAAE,MAAM,CAAC;IACzC;;;OAGG;IACuB,MAAM,CAAC,EAAE,MAAM,CAAC;IAC1C,0CAA0C;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IAC5C;;;;OAIG;IACwB,UAAU,CAAC,EAAE,OAAO,CAAC;IAEhD,OAAO,KAAK,oBAAoB,GAO/B;IAED,OAAO,KAAK,KAAK,GAQhB;IAED,OAAO,KAAK,QAAQ,GAMnB;IAED,OAAO,CAAC,UAAU;IA2CT,MAAM;IAkBf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iCAAiC,EAAE,0BAA0B,CAAC;KAC/D;CACF"}