@oicl/openbridge-webcomponents 0.0.15-dev-20241203212146 → 0.0.15-dev-20241204123732
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/custom-elements.json +241 -0
- package/dist/automation/valve/valve.d.ts +27 -0
- package/dist/automation/valve/valve.d.ts.map +1 -0
- package/dist/automation/valve/valve.js +123 -0
- package/dist/automation/valve/valve.js.map +1 -0
- package/dist/index.js +3 -2
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +9 -1
- package/dist/types.js.map +1 -1
- package/package.json +13 -13
- package/src/automation/valve/valve.ts +93 -0
- package/src/types.ts +7 -0
package/custom-elements.json
CHANGED
@@ -39480,6 +39480,247 @@
|
|
39480
39480
|
}
|
39481
39481
|
]
|
39482
39482
|
},
|
39483
|
+
{
|
39484
|
+
"kind": "javascript-module",
|
39485
|
+
"path": "src/automation/valve/valve.ts",
|
39486
|
+
"declarations": [
|
39487
|
+
{
|
39488
|
+
"kind": "class",
|
39489
|
+
"description": "",
|
39490
|
+
"name": "ObcValve",
|
39491
|
+
"members": [
|
39492
|
+
{
|
39493
|
+
"kind": "field",
|
39494
|
+
"name": "size",
|
39495
|
+
"type": {
|
39496
|
+
"text": "AutomationButtonSize"
|
39497
|
+
},
|
39498
|
+
"attribute": "size"
|
39499
|
+
},
|
39500
|
+
{
|
39501
|
+
"kind": "field",
|
39502
|
+
"name": "labelPosition",
|
39503
|
+
"type": {
|
39504
|
+
"text": "AutomationButtonLabelPosition"
|
39505
|
+
},
|
39506
|
+
"attribute": "labelPosition"
|
39507
|
+
},
|
39508
|
+
{
|
39509
|
+
"kind": "field",
|
39510
|
+
"name": "labelSize",
|
39511
|
+
"type": {
|
39512
|
+
"text": "AutomationButtonLabelSize"
|
39513
|
+
},
|
39514
|
+
"attribute": "labelSize"
|
39515
|
+
},
|
39516
|
+
{
|
39517
|
+
"kind": "field",
|
39518
|
+
"name": "labelStyle",
|
39519
|
+
"type": {
|
39520
|
+
"text": "AutomationBottonLabelStyle"
|
39521
|
+
},
|
39522
|
+
"attribute": "labelStyle"
|
39523
|
+
},
|
39524
|
+
{
|
39525
|
+
"kind": "field",
|
39526
|
+
"name": "alert",
|
39527
|
+
"type": {
|
39528
|
+
"text": "boolean"
|
39529
|
+
},
|
39530
|
+
"default": "false",
|
39531
|
+
"attribute": "alert"
|
39532
|
+
},
|
39533
|
+
{
|
39534
|
+
"kind": "field",
|
39535
|
+
"name": "progress",
|
39536
|
+
"type": {
|
39537
|
+
"text": "boolean"
|
39538
|
+
},
|
39539
|
+
"default": "false",
|
39540
|
+
"attribute": "progress"
|
39541
|
+
},
|
39542
|
+
{
|
39543
|
+
"kind": "field",
|
39544
|
+
"name": "tag",
|
39545
|
+
"type": {
|
39546
|
+
"text": "string"
|
39547
|
+
},
|
39548
|
+
"default": "''",
|
39549
|
+
"attribute": "tag"
|
39550
|
+
},
|
39551
|
+
{
|
39552
|
+
"kind": "field",
|
39553
|
+
"name": "direction",
|
39554
|
+
"type": {
|
39555
|
+
"text": "Direction"
|
39556
|
+
},
|
39557
|
+
"attribute": "direction"
|
39558
|
+
},
|
39559
|
+
{
|
39560
|
+
"kind": "field",
|
39561
|
+
"name": "value",
|
39562
|
+
"type": {
|
39563
|
+
"text": "number"
|
39564
|
+
},
|
39565
|
+
"default": "100",
|
39566
|
+
"attribute": "value"
|
39567
|
+
},
|
39568
|
+
{
|
39569
|
+
"kind": "field",
|
39570
|
+
"name": "closed",
|
39571
|
+
"type": {
|
39572
|
+
"text": "boolean"
|
39573
|
+
},
|
39574
|
+
"default": "false",
|
39575
|
+
"attribute": "closed"
|
39576
|
+
},
|
39577
|
+
{
|
39578
|
+
"kind": "field",
|
39579
|
+
"name": "showDirectionLabel",
|
39580
|
+
"type": {
|
39581
|
+
"text": "boolean"
|
39582
|
+
},
|
39583
|
+
"default": "false",
|
39584
|
+
"attribute": "showDirectionLabel"
|
39585
|
+
},
|
39586
|
+
{
|
39587
|
+
"kind": "field",
|
39588
|
+
"name": "flat",
|
39589
|
+
"type": {
|
39590
|
+
"text": "boolean"
|
39591
|
+
},
|
39592
|
+
"default": "false",
|
39593
|
+
"attribute": "flat"
|
39594
|
+
},
|
39595
|
+
{
|
39596
|
+
"kind": "field",
|
39597
|
+
"name": "rotation",
|
39598
|
+
"type": {
|
39599
|
+
"text": "number"
|
39600
|
+
},
|
39601
|
+
"readonly": true
|
39602
|
+
}
|
39603
|
+
],
|
39604
|
+
"attributes": [
|
39605
|
+
{
|
39606
|
+
"name": "size",
|
39607
|
+
"type": {
|
39608
|
+
"text": "AutomationButtonSize"
|
39609
|
+
},
|
39610
|
+
"fieldName": "size"
|
39611
|
+
},
|
39612
|
+
{
|
39613
|
+
"name": "labelPosition",
|
39614
|
+
"type": {
|
39615
|
+
"text": "AutomationButtonLabelPosition"
|
39616
|
+
},
|
39617
|
+
"fieldName": "labelPosition"
|
39618
|
+
},
|
39619
|
+
{
|
39620
|
+
"name": "labelSize",
|
39621
|
+
"type": {
|
39622
|
+
"text": "AutomationButtonLabelSize"
|
39623
|
+
},
|
39624
|
+
"fieldName": "labelSize"
|
39625
|
+
},
|
39626
|
+
{
|
39627
|
+
"name": "labelStyle",
|
39628
|
+
"type": {
|
39629
|
+
"text": "AutomationBottonLabelStyle"
|
39630
|
+
},
|
39631
|
+
"fieldName": "labelStyle"
|
39632
|
+
},
|
39633
|
+
{
|
39634
|
+
"name": "alert",
|
39635
|
+
"type": {
|
39636
|
+
"text": "boolean"
|
39637
|
+
},
|
39638
|
+
"default": "false",
|
39639
|
+
"fieldName": "alert"
|
39640
|
+
},
|
39641
|
+
{
|
39642
|
+
"name": "progress",
|
39643
|
+
"type": {
|
39644
|
+
"text": "boolean"
|
39645
|
+
},
|
39646
|
+
"default": "false",
|
39647
|
+
"fieldName": "progress"
|
39648
|
+
},
|
39649
|
+
{
|
39650
|
+
"name": "tag",
|
39651
|
+
"type": {
|
39652
|
+
"text": "string"
|
39653
|
+
},
|
39654
|
+
"default": "''",
|
39655
|
+
"fieldName": "tag"
|
39656
|
+
},
|
39657
|
+
{
|
39658
|
+
"name": "direction",
|
39659
|
+
"type": {
|
39660
|
+
"text": "Direction"
|
39661
|
+
},
|
39662
|
+
"fieldName": "direction"
|
39663
|
+
},
|
39664
|
+
{
|
39665
|
+
"name": "value",
|
39666
|
+
"type": {
|
39667
|
+
"text": "number"
|
39668
|
+
},
|
39669
|
+
"default": "100",
|
39670
|
+
"fieldName": "value"
|
39671
|
+
},
|
39672
|
+
{
|
39673
|
+
"name": "closed",
|
39674
|
+
"type": {
|
39675
|
+
"text": "boolean"
|
39676
|
+
},
|
39677
|
+
"default": "false",
|
39678
|
+
"fieldName": "closed"
|
39679
|
+
},
|
39680
|
+
{
|
39681
|
+
"name": "showDirectionLabel",
|
39682
|
+
"type": {
|
39683
|
+
"text": "boolean"
|
39684
|
+
},
|
39685
|
+
"default": "false",
|
39686
|
+
"fieldName": "showDirectionLabel"
|
39687
|
+
},
|
39688
|
+
{
|
39689
|
+
"name": "flat",
|
39690
|
+
"type": {
|
39691
|
+
"text": "boolean"
|
39692
|
+
},
|
39693
|
+
"default": "false",
|
39694
|
+
"fieldName": "flat"
|
39695
|
+
}
|
39696
|
+
],
|
39697
|
+
"superclass": {
|
39698
|
+
"name": "LitElement",
|
39699
|
+
"package": "lit"
|
39700
|
+
},
|
39701
|
+
"tagName": "obc-valve",
|
39702
|
+
"customElement": true
|
39703
|
+
}
|
39704
|
+
],
|
39705
|
+
"exports": [
|
39706
|
+
{
|
39707
|
+
"kind": "js",
|
39708
|
+
"name": "ObcValve",
|
39709
|
+
"declaration": {
|
39710
|
+
"name": "ObcValve",
|
39711
|
+
"module": "src/automation/valve/valve.ts"
|
39712
|
+
}
|
39713
|
+
},
|
39714
|
+
{
|
39715
|
+
"kind": "custom-element-definition",
|
39716
|
+
"name": "obc-valve",
|
39717
|
+
"declaration": {
|
39718
|
+
"name": "ObcValve",
|
39719
|
+
"module": "src/automation/valve/valve.ts"
|
39720
|
+
}
|
39721
|
+
}
|
39722
|
+
]
|
39723
|
+
},
|
39483
39724
|
{
|
39484
39725
|
"kind": "javascript-module",
|
39485
39726
|
"path": "src/automation/valve-analog-three-way-icon/valve-analog-three-way-icon.ts",
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { LitElement } from 'lit';
|
2
|
+
import { AutomationBottonLabelStyle, AutomationButtonLabelPosition, AutomationButtonLabelSize, AutomationButtonSize } from '../automation-button/automation-button';
|
3
|
+
import { Direction } from '../../types';
|
4
|
+
import '../automation-button/automation-button';
|
5
|
+
import '../valve-analoge-two-way-icon/valve-analog-two-way-icon';
|
6
|
+
export declare class ObcValve extends LitElement {
|
7
|
+
size: AutomationButtonSize;
|
8
|
+
labelPosition: AutomationButtonLabelPosition;
|
9
|
+
labelSize: AutomationButtonLabelSize;
|
10
|
+
labelStyle: AutomationBottonLabelStyle;
|
11
|
+
alert: boolean;
|
12
|
+
progress: boolean;
|
13
|
+
tag: string;
|
14
|
+
direction: Direction;
|
15
|
+
value: number;
|
16
|
+
closed: boolean;
|
17
|
+
showDirectionLabel: boolean;
|
18
|
+
flat: boolean;
|
19
|
+
get rotation(): number;
|
20
|
+
render(): import('lit-html').TemplateResult<1>;
|
21
|
+
}
|
22
|
+
declare global {
|
23
|
+
interface HTMLElementTagNameMap {
|
24
|
+
'obc-valve': ObcValve;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
//# sourceMappingURL=valve.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"valve.d.ts","sourceRoot":"","sources":["../../../src/automation/valve/valve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAO,MAAM,KAAK,CAAC;AAErC,OAAO,wCAAwC,CAAC;AAChD,OAAO,EACL,0BAA0B,EAE1B,6BAA6B,EAC7B,yBAAyB,EACzB,oBAAoB,EAGrB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,yDAAyD,CAAC;AAEjE,qBACa,QAAS,SAAQ,UAAU;IACZ,IAAI,EAAE,oBAAoB,CACrB;IACL,aAAa,EAAE,6BAA6B,CAC/B;IACb,SAAS,EAAE,yBAAyB,CAC1B;IACV,UAAU,EAAE,0BAA0B,CAC3B;IACV,KAAK,EAAE,OAAO,CAAS;IACvB,QAAQ,EAAE,OAAO,CAAS;IAC3B,GAAG,EAAE,MAAM,CAAM;IACjB,SAAS,EAAE,SAAS,CAAmB;IACvC,KAAK,EAAE,MAAM,CAAO;IACnB,MAAM,EAAE,OAAO,CAAS;IACxB,kBAAkB,EAAE,OAAO,CAAS;IACpC,IAAI,EAAE,OAAO,CAAS;IAEjD,IAAI,QAAQ,IAAI,MAAM,CAQrB;IAEQ,MAAM;CA0ChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
@@ -0,0 +1,123 @@
|
|
1
|
+
import { LitElement, html } from "lit";
|
2
|
+
import { property, customElement } from "lit/decorators.js";
|
3
|
+
import { AutomationButtonSize, AutomationButtonLabelPosition, AutomationButtonLabelSize, AutomationBottonLabelStyle, AutomationButtonState } from "../automation-button/automation-button.js";
|
4
|
+
import { Direction } from "../../types.js";
|
5
|
+
import "../valve-analoge-two-way-icon/valve-analog-two-way-icon.js";
|
6
|
+
var __defProp = Object.defineProperty;
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
8
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
9
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
10
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
11
|
+
if (decorator = decorators[i])
|
12
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
13
|
+
if (kind && result) __defProp(target, key, result);
|
14
|
+
return result;
|
15
|
+
};
|
16
|
+
let ObcValve = class extends LitElement {
|
17
|
+
constructor() {
|
18
|
+
super(...arguments);
|
19
|
+
this.size = AutomationButtonSize.regular;
|
20
|
+
this.labelPosition = AutomationButtonLabelPosition.bottom;
|
21
|
+
this.labelSize = AutomationButtonLabelSize.regular;
|
22
|
+
this.labelStyle = AutomationBottonLabelStyle.regular;
|
23
|
+
this.alert = false;
|
24
|
+
this.progress = false;
|
25
|
+
this.tag = "";
|
26
|
+
this.direction = Direction.Right;
|
27
|
+
this.value = 100;
|
28
|
+
this.closed = false;
|
29
|
+
this.showDirectionLabel = false;
|
30
|
+
this.flat = false;
|
31
|
+
}
|
32
|
+
get rotation() {
|
33
|
+
if (this.direction === "up") {
|
34
|
+
return -90;
|
35
|
+
}
|
36
|
+
if (this.direction === "down") {
|
37
|
+
return 90;
|
38
|
+
}
|
39
|
+
return 0;
|
40
|
+
}
|
41
|
+
render() {
|
42
|
+
const labels = [
|
43
|
+
{
|
44
|
+
type: "tag",
|
45
|
+
text: this.tag,
|
46
|
+
showHash: this.showDirectionLabel
|
47
|
+
},
|
48
|
+
{
|
49
|
+
type: "direction",
|
50
|
+
nDigits: 3,
|
51
|
+
value: this.value,
|
52
|
+
direction: this.direction,
|
53
|
+
unit: "percent"
|
54
|
+
}
|
55
|
+
];
|
56
|
+
return html`
|
57
|
+
<obc-automation-button
|
58
|
+
.state=${this.closed ? AutomationButtonState.closed : AutomationButtonState.open}
|
59
|
+
.size=${this.size}
|
60
|
+
.labels=${labels}
|
61
|
+
.labelPosition=${this.labelPosition}
|
62
|
+
.labelSize=${this.labelSize}
|
63
|
+
.labelStyle=${this.labelStyle}
|
64
|
+
?alert=${this.alert}
|
65
|
+
?progress=${this.progress}
|
66
|
+
?flat=${this.flat}
|
67
|
+
>
|
68
|
+
<obc-valve-analog-two-way-icon
|
69
|
+
slot="icon"
|
70
|
+
.rotation=${this.rotation}
|
71
|
+
?closed=${this.closed}
|
72
|
+
></obc-valve-analog-two-way-icon>
|
73
|
+
<slot name="badge-top-right"></slot>
|
74
|
+
<slot name="badge-top-left"></slot>
|
75
|
+
<slot name="badge-bottom-left"></slot>
|
76
|
+
<slot name="badge-bottom-right"></slot>
|
77
|
+
</obc-automation-button>
|
78
|
+
`;
|
79
|
+
}
|
80
|
+
};
|
81
|
+
__decorateClass([
|
82
|
+
property({ type: String })
|
83
|
+
], ObcValve.prototype, "size", 2);
|
84
|
+
__decorateClass([
|
85
|
+
property({ type: String })
|
86
|
+
], ObcValve.prototype, "labelPosition", 2);
|
87
|
+
__decorateClass([
|
88
|
+
property({ type: String })
|
89
|
+
], ObcValve.prototype, "labelSize", 2);
|
90
|
+
__decorateClass([
|
91
|
+
property({ type: String })
|
92
|
+
], ObcValve.prototype, "labelStyle", 2);
|
93
|
+
__decorateClass([
|
94
|
+
property({ type: Boolean })
|
95
|
+
], ObcValve.prototype, "alert", 2);
|
96
|
+
__decorateClass([
|
97
|
+
property({ type: Boolean })
|
98
|
+
], ObcValve.prototype, "progress", 2);
|
99
|
+
__decorateClass([
|
100
|
+
property({ type: String })
|
101
|
+
], ObcValve.prototype, "tag", 2);
|
102
|
+
__decorateClass([
|
103
|
+
property({ type: String })
|
104
|
+
], ObcValve.prototype, "direction", 2);
|
105
|
+
__decorateClass([
|
106
|
+
property({ type: Number })
|
107
|
+
], ObcValve.prototype, "value", 2);
|
108
|
+
__decorateClass([
|
109
|
+
property({ type: Boolean })
|
110
|
+
], ObcValve.prototype, "closed", 2);
|
111
|
+
__decorateClass([
|
112
|
+
property({ type: Boolean })
|
113
|
+
], ObcValve.prototype, "showDirectionLabel", 2);
|
114
|
+
__decorateClass([
|
115
|
+
property({ type: Boolean })
|
116
|
+
], ObcValve.prototype, "flat", 2);
|
117
|
+
ObcValve = __decorateClass([
|
118
|
+
customElement("obc-valve")
|
119
|
+
], ObcValve);
|
120
|
+
export {
|
121
|
+
ObcValve
|
122
|
+
};
|
123
|
+
//# sourceMappingURL=valve.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"valve.js","sources":["../../../src/automation/valve/valve.ts"],"sourcesContent":["import {LitElement, html} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport '../automation-button/automation-button';\nimport {\n AutomationBottonLabelStyle,\n AutomationButtonDirectonValueLabel,\n AutomationButtonLabelPosition,\n AutomationButtonLabelSize,\n AutomationButtonSize,\n AutomationButtonState,\n AutomationButtonTagLabel,\n} from '../automation-button/automation-button';\nimport {Direction} from '../../types';\nimport '../valve-analoge-two-way-icon/valve-analog-two-way-icon';\n\n@customElement('obc-valve')\nexport class ObcValve extends LitElement {\n @property({type: String}) size: AutomationButtonSize =\n AutomationButtonSize.regular;\n @property({type: String}) labelPosition: AutomationButtonLabelPosition =\n AutomationButtonLabelPosition.bottom;\n @property({type: String}) labelSize: AutomationButtonLabelSize =\n AutomationButtonLabelSize.regular;\n @property({type: String}) labelStyle: AutomationBottonLabelStyle =\n AutomationBottonLabelStyle.regular;\n @property({type: Boolean}) alert: boolean = false;\n @property({type: Boolean}) progress: boolean = false;\n @property({type: String}) tag: string = '';\n @property({type: String}) direction: Direction = Direction.Right;\n @property({type: Number}) value: number = 100;\n @property({type: Boolean}) closed: boolean = false;\n @property({type: Boolean}) showDirectionLabel: boolean = false;\n @property({type: Boolean}) flat: boolean = false;\n\n get rotation(): number {\n if (this.direction === 'up') {\n return -90;\n }\n if (this.direction === 'down') {\n return 90;\n }\n return 0;\n }\n\n override render() {\n const labels = [\n {\n type: 'tag',\n text: this.tag,\n showHash: this.showDirectionLabel,\n } as AutomationButtonTagLabel,\n {\n type: 'direction',\n nDigits: 3,\n value: this.value,\n direction: this.direction,\n unit: 'percent',\n } as AutomationButtonDirectonValueLabel,\n ];\n\n return html`\n <obc-automation-button\n .state=${this.closed\n ? AutomationButtonState.closed\n : AutomationButtonState.open}\n .size=${this.size}\n .labels=${labels}\n .labelPosition=${this.labelPosition}\n .labelSize=${this.labelSize}\n .labelStyle=${this.labelStyle}\n ?alert=${this.alert}\n ?progress=${this.progress}\n ?flat=${this.flat}\n >\n <obc-valve-analog-two-way-icon\n slot=\"icon\"\n .rotation=${this.rotation}\n ?closed=${this.closed}\n ></obc-valve-analog-two-way-icon>\n <slot name=\"badge-top-right\"></slot>\n <slot name=\"badge-top-left\"></slot>\n <slot name=\"badge-bottom-left\"></slot>\n <slot name=\"badge-bottom-right\"></slot>\n </obc-automation-button>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-valve': ObcValve;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgBa,IAAA,WAAN,cAAuB,WAAW;AAAA,EAAlC,cAAA;AAAA,UAAA,GAAA,SAAA;AACqB,SAAA,OACxB,qBAAqB;AACG,SAAA,gBACxB,8BAA8B;AACN,SAAA,YACxB,0BAA0B;AACF,SAAA,aACxB,2BAA2B;AACe,SAAA,QAAA;AACG,SAAA,WAAA;AACP,SAAA,MAAA;AACd,SAAA,YAAuB,UAAU;AACjB,SAAA,QAAA;AACG,SAAA,SAAA;AACY,SAAA,qBAAA;AACd,SAAA,OAAA;AAAA,EAAA;AAAA,EAE3C,IAAI,WAAmB;AACjB,QAAA,KAAK,cAAc,MAAM;AACpB,aAAA;AAAA,IAAA;AAEL,QAAA,KAAK,cAAc,QAAQ;AACtB,aAAA;AAAA,IAAA;AAEF,WAAA;AAAA,EAAA;AAAA,EAGA,SAAS;AAChB,UAAM,SAAS;AAAA,MACb;AAAA,QACE,MAAM;AAAA,QACN,MAAM,KAAK;AAAA,QACX,UAAU,KAAK;AAAA,MACjB;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,SAAS;AAAA,QACT,OAAO,KAAK;AAAA,QACZ,WAAW,KAAK;AAAA,QAChB,MAAM;AAAA,MAAA;AAAA,IAEV;AAEO,WAAA;AAAA;AAAA,iBAEM,KAAK,SACV,sBAAsB,SACtB,sBAAsB,IAAI;AAAA,gBACtB,KAAK,IAAI;AAAA,kBACP,MAAM;AAAA,yBACC,KAAK,aAAa;AAAA,qBACtB,KAAK,SAAS;AAAA,sBACb,KAAK,UAAU;AAAA,iBACpB,KAAK,KAAK;AAAA,oBACP,KAAK,QAAQ;AAAA,gBACjB,KAAK,IAAI;AAAA;AAAA;AAAA;AAAA,sBAIH,KAAK,QAAQ;AAAA,oBACf,KAAK,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAS/B;AArE4B,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAO,CAAA;AAAA,GADb,SACe,WAAA,QAAA,CAAA;AAEA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAO,CAAA;AAAA,GAHb,SAGe,WAAA,iBAAA,CAAA;AAEA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAO,CAAA;AAAA,GALb,SAKe,WAAA,aAAA,CAAA;AAEA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAO,CAAA;AAAA,GAPb,SAOe,WAAA,cAAA,CAAA;AAEC,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAQ,CAAA;AAAA,GATd,SASgB,WAAA,SAAA,CAAA;AACA,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAQ,CAAA;AAAA,GAVd,SAUgB,WAAA,YAAA,CAAA;AACD,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAO,CAAA;AAAA,GAXb,SAWe,WAAA,OAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAO,CAAA;AAAA,GAZb,SAYe,WAAA,aAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAO,CAAA;AAAA,GAbb,SAae,WAAA,SAAA,CAAA;AACC,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAQ,CAAA;AAAA,GAdd,SAcgB,WAAA,UAAA,CAAA;AACA,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAQ,CAAA;AAAA,GAfd,SAegB,WAAA,sBAAA,CAAA;AACA,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAQ,CAAA;AAAA,GAhBd,SAgBgB,WAAA,QAAA,CAAA;AAhBhB,WAAN,gBAAA;AAAA,EADN,cAAc,WAAW;AAAA,GACb,QAAA;"}
|
package/dist/index.js
CHANGED
package/dist/types.d.ts
CHANGED
package/dist/types.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,IAAI,SAAS;IACb,IAAI,SAAS;CACd"}
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,oBAAY,SAAS;IACnB,EAAE,OAAO;IACT,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;CAChB"}
|
package/dist/types.js
CHANGED
@@ -9,7 +9,15 @@ var AlertType = /* @__PURE__ */ ((AlertType2) => {
|
|
9
9
|
AlertType2["Flat"] = "flat";
|
10
10
|
return AlertType2;
|
11
11
|
})(AlertType || {});
|
12
|
+
var Direction = /* @__PURE__ */ ((Direction2) => {
|
13
|
+
Direction2["Up"] = "up";
|
14
|
+
Direction2["Down"] = "down";
|
15
|
+
Direction2["Left"] = "left";
|
16
|
+
Direction2["Right"] = "right";
|
17
|
+
return Direction2;
|
18
|
+
})(Direction || {});
|
12
19
|
export {
|
13
|
-
AlertType
|
20
|
+
AlertType,
|
21
|
+
Direction
|
14
22
|
};
|
15
23
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["export enum AlertType {\n Alarm = 'alarm',\n Warning = 'warning',\n Caution = 'caution',\n Running = 'running',\n Command = 'command',\n Notification = 'notification',\n None = 'none',\n Flat = 'flat',\n}\n"],"names":["AlertType"],"mappings":"AAAY,IAAA,8BAAAA,eAAL;AACLA,aAAA,OAAQ,IAAA;AACRA,aAAA,SAAU,IAAA;AACVA,aAAA,SAAU,IAAA;AACVA,aAAA,SAAU,IAAA;AACVA,aAAA,SAAU,IAAA;AACVA,aAAA,cAAe,IAAA;AACfA,aAAA,MAAO,IAAA;AACPA,aAAA,MAAO,IAAA;AARGA,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;"}
|
1
|
+
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["export enum AlertType {\n Alarm = 'alarm',\n Warning = 'warning',\n Caution = 'caution',\n Running = 'running',\n Command = 'command',\n Notification = 'notification',\n None = 'none',\n Flat = 'flat',\n}\n\nexport enum Direction {\n Up = 'up',\n Down = 'down',\n Left = 'left',\n Right = 'right',\n}\n"],"names":["AlertType","Direction"],"mappings":"AAAY,IAAA,8BAAAA,eAAL;AACLA,aAAA,OAAQ,IAAA;AACRA,aAAA,SAAU,IAAA;AACVA,aAAA,SAAU,IAAA;AACVA,aAAA,SAAU,IAAA;AACVA,aAAA,SAAU,IAAA;AACVA,aAAA,cAAe,IAAA;AACfA,aAAA,MAAO,IAAA;AACPA,aAAA,MAAO,IAAA;AARGA,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAWA,IAAA,8BAAAC,eAAL;AACLA,aAAA,IAAK,IAAA;AACLA,aAAA,MAAO,IAAA;AACPA,aAAA,MAAO,IAAA;AACPA,aAAA,OAAQ,IAAA;AAJEA,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@oicl/openbridge-webcomponents",
|
3
|
-
"version": "0.0.15-dev-
|
3
|
+
"version": "0.0.15-dev-20241204123732",
|
4
4
|
"type": "module",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -46,18 +46,18 @@
|
|
46
46
|
"@lit-labs/gen-wrapper-vue": "^0.4.0",
|
47
47
|
"@open-wc/lit-helpers": "^0.7.0",
|
48
48
|
"@playwright/test": "^1.49.0",
|
49
|
-
"@storybook/addon-essentials": "^8.4.
|
50
|
-
"@storybook/addon-interactions": "^8.4.
|
51
|
-
"@storybook/addon-links": "^8.4.
|
52
|
-
"@storybook/addon-storysource": "^8.4.
|
53
|
-
"@storybook/addon-themes": "^8.4.
|
54
|
-
"@storybook/blocks": "^8.4.
|
55
|
-
"@storybook/manager-api": "^8.4.
|
56
|
-
"@storybook/test": "^8.4.
|
57
|
-
"@storybook/test-runner": "^0.
|
58
|
-
"@storybook/theming": "^8.4.
|
59
|
-
"@storybook/web-components": "^8.4.
|
60
|
-
"@storybook/web-components-vite": "^8.4.
|
49
|
+
"@storybook/addon-essentials": "^8.4.6",
|
50
|
+
"@storybook/addon-interactions": "^8.4.6",
|
51
|
+
"@storybook/addon-links": "^8.4.6",
|
52
|
+
"@storybook/addon-storysource": "^8.4.6",
|
53
|
+
"@storybook/addon-themes": "^8.4.6",
|
54
|
+
"@storybook/blocks": "^8.4.6",
|
55
|
+
"@storybook/manager-api": "^8.4.6",
|
56
|
+
"@storybook/test": "^8.4.6",
|
57
|
+
"@storybook/test-runner": "^0.20.1",
|
58
|
+
"@storybook/theming": "^8.4.6",
|
59
|
+
"@storybook/web-components": "^8.4.6",
|
60
|
+
"@storybook/web-components-vite": "^8.4.6",
|
61
61
|
"@topcli/prompts": "^2.0.0",
|
62
62
|
"@types/jest-image-snapshot": "^6",
|
63
63
|
"@types/node": "^22.4.1",
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import {LitElement, html} from 'lit';
|
2
|
+
import {customElement, property} from 'lit/decorators.js';
|
3
|
+
import '../automation-button/automation-button';
|
4
|
+
import {
|
5
|
+
AutomationBottonLabelStyle,
|
6
|
+
AutomationButtonDirectonValueLabel,
|
7
|
+
AutomationButtonLabelPosition,
|
8
|
+
AutomationButtonLabelSize,
|
9
|
+
AutomationButtonSize,
|
10
|
+
AutomationButtonState,
|
11
|
+
AutomationButtonTagLabel,
|
12
|
+
} from '../automation-button/automation-button';
|
13
|
+
import {Direction} from '../../types';
|
14
|
+
import '../valve-analoge-two-way-icon/valve-analog-two-way-icon';
|
15
|
+
|
16
|
+
@customElement('obc-valve')
|
17
|
+
export class ObcValve extends LitElement {
|
18
|
+
@property({type: String}) size: AutomationButtonSize =
|
19
|
+
AutomationButtonSize.regular;
|
20
|
+
@property({type: String}) labelPosition: AutomationButtonLabelPosition =
|
21
|
+
AutomationButtonLabelPosition.bottom;
|
22
|
+
@property({type: String}) labelSize: AutomationButtonLabelSize =
|
23
|
+
AutomationButtonLabelSize.regular;
|
24
|
+
@property({type: String}) labelStyle: AutomationBottonLabelStyle =
|
25
|
+
AutomationBottonLabelStyle.regular;
|
26
|
+
@property({type: Boolean}) alert: boolean = false;
|
27
|
+
@property({type: Boolean}) progress: boolean = false;
|
28
|
+
@property({type: String}) tag: string = '';
|
29
|
+
@property({type: String}) direction: Direction = Direction.Right;
|
30
|
+
@property({type: Number}) value: number = 100;
|
31
|
+
@property({type: Boolean}) closed: boolean = false;
|
32
|
+
@property({type: Boolean}) showDirectionLabel: boolean = false;
|
33
|
+
@property({type: Boolean}) flat: boolean = false;
|
34
|
+
|
35
|
+
get rotation(): number {
|
36
|
+
if (this.direction === 'up') {
|
37
|
+
return -90;
|
38
|
+
}
|
39
|
+
if (this.direction === 'down') {
|
40
|
+
return 90;
|
41
|
+
}
|
42
|
+
return 0;
|
43
|
+
}
|
44
|
+
|
45
|
+
override render() {
|
46
|
+
const labels = [
|
47
|
+
{
|
48
|
+
type: 'tag',
|
49
|
+
text: this.tag,
|
50
|
+
showHash: this.showDirectionLabel,
|
51
|
+
} as AutomationButtonTagLabel,
|
52
|
+
{
|
53
|
+
type: 'direction',
|
54
|
+
nDigits: 3,
|
55
|
+
value: this.value,
|
56
|
+
direction: this.direction,
|
57
|
+
unit: 'percent',
|
58
|
+
} as AutomationButtonDirectonValueLabel,
|
59
|
+
];
|
60
|
+
|
61
|
+
return html`
|
62
|
+
<obc-automation-button
|
63
|
+
.state=${this.closed
|
64
|
+
? AutomationButtonState.closed
|
65
|
+
: AutomationButtonState.open}
|
66
|
+
.size=${this.size}
|
67
|
+
.labels=${labels}
|
68
|
+
.labelPosition=${this.labelPosition}
|
69
|
+
.labelSize=${this.labelSize}
|
70
|
+
.labelStyle=${this.labelStyle}
|
71
|
+
?alert=${this.alert}
|
72
|
+
?progress=${this.progress}
|
73
|
+
?flat=${this.flat}
|
74
|
+
>
|
75
|
+
<obc-valve-analog-two-way-icon
|
76
|
+
slot="icon"
|
77
|
+
.rotation=${this.rotation}
|
78
|
+
?closed=${this.closed}
|
79
|
+
></obc-valve-analog-two-way-icon>
|
80
|
+
<slot name="badge-top-right"></slot>
|
81
|
+
<slot name="badge-top-left"></slot>
|
82
|
+
<slot name="badge-bottom-left"></slot>
|
83
|
+
<slot name="badge-bottom-right"></slot>
|
84
|
+
</obc-automation-button>
|
85
|
+
`;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
declare global {
|
90
|
+
interface HTMLElementTagNameMap {
|
91
|
+
'obc-valve': ObcValve;
|
92
|
+
}
|
93
|
+
}
|