@oicl/openbridge-webcomponents 2.2.0-next.12 → 2.2.0-next.13

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.
@@ -56051,7 +56051,7 @@
56051
56051
  "declarations": [
56052
56052
  {
56053
56053
  "kind": "class",
56054
- "description": "`<obc-transmitter-stack>` – Several transmitter readings side by side in one\njoined chip, attached to a line by a single leader line.\n\nEach entry of `values` renders an `<obc-transmitter-button>` segment with its\nown icon, value, unit and id tag. The segments take equal widths, set by the\nwidest reading, and share their borders. Positioning and the leader line\nfollow `<obc-transmitter>`.\n\n### Features / Variants\n- **`orientation`** – `top`, `right`, `bottom`, `left`; the edge the leader\n line attaches to. `top` places the id tags above the chip.\n- **Values** – `value` and `unit` per segment. `idTag` adds a label row under\n every segment once any value has one, so the chip stays aligned.\n- **Formatting** – per value `fractionDigits` (default `1`), `maxDigits`\n (default `0`), `hintedZeros`, `hasSignSpacer` and `hasDegree`, formatted like\n `<obc-transmitter-button>`. An omitted key takes its default; a key set to\n `null`, `undefined` or `NaN` renders the reading as the unavailable dash.\n- **Icons** – `iconSlotName` projects the light-DOM element with that slot\n name as the segment's icon; names must be unique within the stack. The\n name is chosen per value, so it carries no `@slot` tag (the wrapper\n generator needs literal names).\n- **Accessible name** – each segment is a native button named by its\n reading, unit and `idTag`; the visible tag is hidden from assistive\n technology so it is not read twice.\n- **Empty** – with no `values` nothing renders, leader line included.\n\n### Usage Guidelines\nUse when one source reports several readings that share one leader line. For\na single reading, a tag pill or a trend graph, use `<obc-transmitter>`. Each\nsegment's hit area is `<obc-transmitter-button>`'s chip (24 px high), below\nthe 48 px touch-target token; see its design note.\n\n### Slots\n| Slot Name | Conditions | Purpose |\n|------------------|---------------------------------|-------------------------------|\n| `<iconSlotName>` | a value declares `iconSlotName` | Icon in that value's segment. |",
56054
+ "description": "`<obc-transmitter-stack>` – Several transmitter readings side by side in one\njoined chip, attached to a line by a single leader line.\n\nEach entry of `values` renders an `<obc-transmitter-button>` segment with its\nown icon, value, unit and id tag. The segments take equal widths, set by the\nwidest reading, and share their borders. Positioning and the leader line\nfollow `<obc-transmitter>`.\n\n### Features / Variants\n- **`orientation`** – `top`, `right`, `bottom`, `left`; the edge the leader\n line attaches to. `top` places the id tags above the chip.\n- **`showLine`** – draw the leader line (default). Set `false` when the\n line is drawn by other tools: the stack is then a plain box with no\n padding or anchor offset, and `orientation` only decides whether the id\n tags sit above (`top`) or below the chip.\n- **Values** – `value` and `unit` per segment. `idTag` adds a label row under\n every segment once any value has one, so the chip stays aligned.\n- **Formatting** – per value `fractionDigits` (default `1`), `maxDigits`\n (default `0`), `hintedZeros`, `hasSignSpacer` and `hasDegree`, formatted like\n `<obc-transmitter-button>`. An omitted key takes its default; a key set to\n `null`, `undefined` or `NaN` renders the reading as the unavailable dash.\n- **Icons** – `iconSlotName` projects the light-DOM element with that slot\n name as the segment's icon; names must be unique within the stack. The\n name is chosen per value, so it carries no `@slot` tag (the wrapper\n generator needs literal names).\n- **Accessible name** – each segment is a native button named by its\n reading, unit and `idTag`; the visible tag is hidden from assistive\n technology so it is not read twice.\n- **Empty** – with no `values` nothing renders, leader line included.\n\n### Usage Guidelines\nUse when one source reports several readings that share one leader line. For\na single reading, a tag pill or a trend graph, use `<obc-transmitter>`. Each\nsegment's hit area is `<obc-transmitter-button>`'s chip (24 px high), below\nthe 48 px touch-target token; see its design note.\n\n### Slots\n| Slot Name | Conditions | Purpose |\n|------------------|---------------------------------|-------------------------------|\n| `<iconSlotName>` | a value declares `iconSlotName` | Icon in that value's segment. |",
56055
56055
  "name": "ObcTransmitterStack",
56056
56056
  "members": [
56057
56057
  {
@@ -56073,6 +56073,15 @@
56073
56073
  "description": "Line the transmitter sits on; offsets the leader line by half its stroke.",
56074
56074
  "attribute": "lineType"
56075
56075
  },
56076
+ {
56077
+ "kind": "field",
56078
+ "name": "showLine",
56079
+ "type": {
56080
+ "text": "boolean"
56081
+ },
56082
+ "default": "true",
56083
+ "description": "Draw the leader line. Set `false` when the line is drawn by other tools; the stack is then a plain box with no padding or anchor offset."
56084
+ },
56076
56085
  {
56077
56086
  "kind": "field",
56078
56087
  "name": "values",
@@ -56207,7 +56216,7 @@
56207
56216
  "declarations": [
56208
56217
  {
56209
56218
  "kind": "class",
56210
- "description": "`<obc-transmitter>` – A readout label that attaches to a line via a leader\nline, showing a measured value, a tag identifier, or a value paired with a\ntrend graph.\n\nPositioning (orientation + leader line) follows `<obc-automation-readout>`.\nThe value chip is an `<obc-transmitter-button>` and the trend is an\n`<obc-indicator-graph>` with its area fill enabled.\n\n### Features / Variants\n- **`type`** – `indicator` (tag pill), `value` (icon/value/unit), or value\n paired with a `horizontal-graph` (beside) or `vertical-graph` (below).\n- **`orientation`** – `top`, `right`, `bottom`, `left`; controls which edge\n the leader line attaches to.\n- **Segments** – opt into a leading advice segment with `hasAdvice`/\n `adviceValue` and a setpoint segment with `hasSetPoint`/`setpointValue`;\n both are read-only and shown in the value chip for non-`indicator` types.\n- **Alert frame** – `hasAlert` wraps the whole transmitter in an\n `<obc-alert-frame>`. `alertFrameStatus`, `alertFrameType`,\n `alertFrameThickness` and `alertFrameMode` set its severity, flap, border\n and flashing, with the same names as on the automation devices; a flap\n carries the status badge and the `alert-icon`, `alert-label` and\n `alert-timer` slots.\n- **Formatting** – `fractionDigits`, `maxDigits`, `hintedZeros` and\n `hasSignSpacer` are forwarded to the value chip to control decimal\n precision, muted leading-zero padding (e.g. `0012.3`) and the sign\n column. The advice and setpoint segments reuse the same formatting.\n `hasDegree` adds a degree column between the value and the unit.\n `value`, `adviceValue` and `setpointValue` render dashes when they are\n `NaN`, `null` or `undefined`.\n\n**TODO(designer):** the Figma Transmitter set (25656:45081) draws no alert\nstate, so the frame and its flaps follow the automation devices.\n\n### Slots\n| Slot Name | Conditions | Purpose |\n|-------------|----------------------------------------------------------|---------------------------------|\n| icon | value/graph + `hasIcon` | Leading icon in the value chip. |\n| alert-icon | `hasAlert` + `showAlertIcon`, large side/bottom/top flap | Custom icon in the alert flap. |\n| alert-label | `hasAlert`, bottom/top flap | Label in the alert flap. |\n| alert-timer | `hasAlert`, bottom/top flap | Timer in the alert flap. |",
56219
+ "description": "`<obc-transmitter>` – A readout label that attaches to a line via a leader\nline, showing a measured value, a tag identifier, or a value paired with a\ntrend graph.\n\nPositioning (orientation + leader line) follows `<obc-automation-readout>`.\nThe value chip is an `<obc-transmitter-button>` and the trend is an\n`<obc-indicator-graph>` with its area fill enabled.\n\n### Features / Variants\n- **`type`** – `indicator` (tag pill), `value` (icon/value/unit), or value\n paired with a `horizontal-graph` (beside) or `vertical-graph` (below).\n- **`orientation`** – `top`, `right`, `bottom`, `left`; controls which edge\n the leader line attaches to.\n- **`showLine`** – draw the leader line (default). Set `false` when the\n line is drawn by other tools: the transmitter is then a plain box with no\n padding or anchor offset, and `orientation` only sets the side of the\n chip the id tag sits on.\n- **Segments** – opt into a leading advice segment with `hasAdvice`/\n `adviceValue` and a setpoint segment with `hasSetPoint`/`setpointValue`;\n both are read-only and shown in the value chip for non-`indicator` types.\n- **Alert frame** – `hasAlert` wraps the whole transmitter in an\n `<obc-alert-frame>`. `alertFrameStatus`, `alertFrameType`,\n `alertFrameThickness` and `alertFrameMode` set its severity, flap, border\n and flashing, with the same names as on the automation devices; a flap\n carries the status badge and the `alert-icon`, `alert-label` and\n `alert-timer` slots.\n- **Formatting** – `fractionDigits`, `maxDigits`, `hintedZeros` and\n `hasSignSpacer` are forwarded to the value chip to control decimal\n precision, muted leading-zero padding (e.g. `0012.3`) and the sign\n column. The advice and setpoint segments reuse the same formatting.\n `hasDegree` adds a degree column between the value and the unit.\n `value`, `adviceValue` and `setpointValue` render dashes when they are\n `NaN`, `null` or `undefined`.\n\n**TODO(designer):** the Figma Transmitter set (25656:45081) draws no alert\nstate, so the frame and its flaps follow the automation devices.\n\n### Slots\n| Slot Name | Conditions | Purpose |\n|-------------|----------------------------------------------------------|---------------------------------|\n| icon | value/graph + `hasIcon` | Leading icon in the value chip. |\n| alert-icon | `hasAlert` + `showAlertIcon`, large side/bottom/top flap | Custom icon in the alert flap. |\n| alert-label | `hasAlert`, bottom/top flap | Label in the alert flap. |\n| alert-timer | `hasAlert`, bottom/top flap | Timer in the alert flap. |",
56211
56220
  "name": "ObcTransmitter",
56212
56221
  "slots": [
56213
56222
  {
@@ -56253,6 +56262,15 @@
56253
56262
  "default": "undefined",
56254
56263
  "attribute": "lineType"
56255
56264
  },
56265
+ {
56266
+ "kind": "field",
56267
+ "name": "showLine",
56268
+ "type": {
56269
+ "text": "boolean"
56270
+ },
56271
+ "default": "true",
56272
+ "description": "Draw the leader line. Set `false` when the line is drawn by other tools; the transmitter is then a plain box with no padding or anchor offset, and `orientation` only sets the side of the chip the id tag sits on."
56273
+ },
56256
56274
  {
56257
56275
  "kind": "field",
56258
56276
  "name": "value",
@@ -12,7 +12,7 @@ var transmitter_default = css`* {
12
12
  display: block;
13
13
  }
14
14
 
15
- .transmitter {
15
+ .transmitter:not(.no-line) {
16
16
  position: relative;
17
17
  display: flex;
18
18
  align-items: center;
@@ -20,65 +20,65 @@ var transmitter_default = css`* {
20
20
  width: fit-content;
21
21
  }
22
22
 
23
- .transmitter.orientation-bottom {
23
+ .transmitter.orientation-bottom:not(.no-line) {
24
24
  padding-top: 8px;
25
25
  top: calc(1px + var(--offset));
26
26
  transform: translateX(-50%);
27
27
  }
28
28
 
29
- .transmitter.orientation-top {
29
+ .transmitter.orientation-top:not(.no-line) {
30
30
  padding-bottom: 8px;
31
31
  transform: translate(-50%, calc(-100% - 1px - var(--offset)));
32
32
  }
33
33
 
34
- .transmitter.orientation-left {
34
+ .transmitter.orientation-left:not(.no-line) {
35
35
  padding-right: 8px;
36
36
  transform: translate(calc(-100% - 4px - var(--offset)), -50%);
37
37
  }
38
38
 
39
- .transmitter.orientation-right {
39
+ .transmitter.orientation-right:not(.no-line) {
40
40
  padding-left: 8px;
41
41
  transform: translateY(-50%);
42
42
  right: calc(-4px - var(--offset));
43
43
  }
44
44
 
45
- .transmitter::before {
45
+ .transmitter:not(.no-line)::before {
46
46
  content: "";
47
47
  display: block;
48
48
  position: absolute;
49
49
  border: var(--normal-enabled-border-color) solid 1px;
50
50
  }
51
51
 
52
- .transmitter.orientation-bottom::before,.transmitter.orientation-top::before {
52
+ .transmitter.orientation-bottom:not(.no-line)::before,.transmitter.orientation-top:not(.no-line)::before {
53
53
  width: 0;
54
54
  height: 8px;
55
55
  }
56
56
 
57
- .transmitter.orientation-bottom::before {
57
+ .transmitter.orientation-bottom:not(.no-line)::before {
58
58
  top: -1px;
59
59
  }
60
60
 
61
- .transmitter.orientation-top::before {
61
+ .transmitter.orientation-top:not(.no-line)::before {
62
62
  bottom: -1px;
63
63
  }
64
64
 
65
- .transmitter.orientation-left::before,.transmitter.orientation-right::before {
65
+ .transmitter.orientation-left:not(.no-line)::before,.transmitter.orientation-right:not(.no-line)::before {
66
66
  height: 0;
67
67
  width: 8px;
68
68
  }
69
69
 
70
- .transmitter.orientation-left::before {
70
+ .transmitter.orientation-left:not(.no-line)::before {
71
71
  right: -4px;
72
72
  }
73
73
 
74
- .transmitter.orientation-right::before {
74
+ .transmitter.orientation-right:not(.no-line)::before {
75
75
  left: -4px;
76
76
  }
77
77
 
78
78
  /* Left/right anchor on the chip row's middle (Figma 25656:45233), so the id
79
79
  tag hangs below out of flow; its parent must be the containing block. */
80
80
 
81
- .transmitter:is(.orientation-left,.orientation-right):not(.has-alert) .id-tag {
81
+ .transmitter:not(.no-line):is(.orientation-left,.orientation-right):not(.has-alert) .id-tag {
82
82
  position: absolute;
83
83
  top: calc(100% + 2px);
84
84
  left: 50%;
@@ -86,6 +86,10 @@ var transmitter_default = css`* {
86
86
  white-space: nowrap;
87
87
  }
88
88
 
89
+ .transmitter.no-line {
90
+ width: fit-content; /* a full-width box would centre the chip away from its placement point */
91
+ }
92
+
89
93
  .content {
90
94
  position: relative; /* containing block for the left/right id tag (transmitter-leader) */
91
95
  display: flex;
@@ -103,6 +107,15 @@ var transmitter_default = css`* {
103
107
  flex-direction: column-reverse;
104
108
  }
105
109
 
110
+ /* Without a line, left/right put the id-tag beside the chip on that side. */
111
+ .no-line.orientation-left .content {
112
+ flex-direction: row-reverse;
113
+ }
114
+
115
+ .no-line.orientation-right .content {
116
+ flex-direction: row;
117
+ }
118
+
106
119
  .body {
107
120
  display: flex;
108
121
  }
@@ -1 +1 @@
1
- {"version":3,"file":"transmitter.css.js","names":[],"sources":["../../../src/automation/transmitter/transmitter.css?inline"],"sourcesContent":["* {\n box-sizing: border-box;\n}\n\n:host {\n display: block;\n}\n\n.transmitter {\n @mixin transmitter-leader;\n}\n\n.content {\n position: relative; /* containing block for the left/right id tag (transmitter-leader) */\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 2px;\n}\n\n.alert-frame .content {\n padding: 4px;\n}\n\n/* Top orientation places the id-tag above the chip (leader line below). */\n.orientation-top .content {\n flex-direction: column-reverse;\n}\n\n.body {\n display: flex;\n}\n\n.type-horizontal-graph .body {\n flex-direction: row;\n align-items: stretch;\n}\n\n.type-vertical-graph .body {\n flex-direction: column;\n align-items: stretch;\n}\n\n.graph-box {\n overflow: hidden;\n border: 1px solid var(--instrument-regular-tertiary-color);\n}\n\n.type-horizontal-graph .graph-box {\n width: 64px;\n border-left: none;\n border-radius: 0 4px 4px 0;\n}\n\n.type-vertical-graph .graph-box {\n height: 48px;\n border-top: none;\n border-radius: 0 0 4px 4px;\n}\n\n/* Flatten the chip corners and drop the shared border where the graph joins. */\n.type-horizontal-graph .chip::part(button) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: none;\n}\n\n.type-vertical-graph .chip::part(button) {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: none;\n}\n\n.type-vertical-graph .chip {\n width: 100%;\n}\n\n.id-tag {\n @mixin transmitter-id-tag;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"transmitter.css.js","names":[],"sources":["../../../src/automation/transmitter/transmitter.css?inline"],"sourcesContent":["* {\n box-sizing: border-box;\n}\n\n:host {\n display: block;\n}\n\n.transmitter:not(.no-line) {\n @mixin transmitter-leader;\n}\n\n.transmitter.no-line {\n width: fit-content; /* a full-width box would centre the chip away from its placement point */\n}\n\n.content {\n position: relative; /* containing block for the left/right id tag (transmitter-leader) */\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 2px;\n}\n\n.alert-frame .content {\n padding: 4px;\n}\n\n/* Top orientation places the id-tag above the chip (leader line below). */\n.orientation-top .content {\n flex-direction: column-reverse;\n}\n\n/* Without a line, left/right put the id-tag beside the chip on that side. */\n.no-line.orientation-left .content {\n flex-direction: row-reverse;\n}\n\n.no-line.orientation-right .content {\n flex-direction: row;\n}\n\n.body {\n display: flex;\n}\n\n.type-horizontal-graph .body {\n flex-direction: row;\n align-items: stretch;\n}\n\n.type-vertical-graph .body {\n flex-direction: column;\n align-items: stretch;\n}\n\n.graph-box {\n overflow: hidden;\n border: 1px solid var(--instrument-regular-tertiary-color);\n}\n\n.type-horizontal-graph .graph-box {\n width: 64px;\n border-left: none;\n border-radius: 0 4px 4px 0;\n}\n\n.type-vertical-graph .graph-box {\n height: 48px;\n border-top: none;\n border-radius: 0 0 4px 4px;\n}\n\n/* Flatten the chip corners and drop the shared border where the graph joins. */\n.type-horizontal-graph .chip::part(button) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: none;\n}\n\n.type-vertical-graph .chip::part(button) {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: none;\n}\n\n.type-vertical-graph .chip {\n width: 100%;\n}\n\n.id-tag {\n @mixin transmitter-id-tag;\n}\n"],"mappings":""}
@@ -28,6 +28,10 @@ export declare enum TransmitterType {
28
28
  * paired with a `horizontal-graph` (beside) or `vertical-graph` (below).
29
29
  * - **`orientation`** – `top`, `right`, `bottom`, `left`; controls which edge
30
30
  * the leader line attaches to.
31
+ * - **`showLine`** – draw the leader line (default). Set `false` when the
32
+ * line is drawn by other tools: the transmitter is then a plain box with no
33
+ * padding or anchor offset, and `orientation` only sets the side of the
34
+ * chip the id tag sits on.
31
35
  * - **Segments** – opt into a leading advice segment with `hasAdvice`/
32
36
  * `adviceValue` and a setpoint segment with `hasSetPoint`/`setpointValue`;
33
37
  * both are read-only and shown in the value chip for non-`indicator` types.
@@ -61,6 +65,9 @@ export declare enum TransmitterType {
61
65
  * only while a value is negative, so the chip's width does not change
62
66
  * across zero.
63
67
  * @property hasDegree - Show a degree column between the value and the unit (e.g. `12.3°` then `C`).
68
+ * @property showLine - Draw the leader line. Set `false` when the line is drawn by other tools;
69
+ * the transmitter is then a plain box with no padding or anchor offset, and
70
+ * `orientation` only sets the side of the chip the id tag sits on.
64
71
  * @property hasAlert - Wrap the transmitter in an `<obc-alert-frame>` when true.
65
72
  * @property alertFrameStatus - Severity of the alert frame, which picks its colour and flap badge:
66
73
  * `alarm` (default), `warning`, `caution` or one of the `level-*` severities.
@@ -94,6 +101,8 @@ export declare class ObcTransmitter extends LitElement {
94
101
  orientation: TransmitterOrientation;
95
102
  type: TransmitterType;
96
103
  lineType: LineType | undefined;
104
+ /** Draw the leader line. Set `false` when the line is drawn by other tools; the transmitter is then a plain box with no padding or anchor offset, and `orientation` only sets the side of the chip the id tag sits on. */
105
+ showLine: boolean;
97
106
  value?: number | null;
98
107
  unit: string;
99
108
  fractionDigits: number;
@@ -1 +1 @@
1
- {"version":3,"file":"transmitter.d.ts","sourceRoot":"","sources":["../../../src/automation/transmitter/transmitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AACzD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,KAAK,CAAC;AAKxC,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,sBAAsB,EAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,EAEtB,MAAM,6CAA6C,CAAC;AACrD,OAAO,6CAA6C,CAAC;AAKrD,OAAO,iEAAiE,CAAC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,GAKnB;IAED,OAAO,CAAC,YAAY;IA+BpB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,gBAAgB;IAoBf,MAAM;IAoBf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,cAAc,CAAC;KACnC;CACF"}
1
+ {"version":3,"file":"transmitter.d.ts","sourceRoot":"","sources":["../../../src/automation/transmitter/transmitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AACzD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,KAAK,CAAC;AAKxC,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,sBAAsB,EAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,EAEtB,MAAM,6CAA6C,CAAC;AACrD,OAAO,6CAA6C,CAAC;AAKrD,OAAO,iEAAiE,CAAC;AACzE,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,6CAA6C,CAAC;AACrD,OAAO,6CAA6C,CAAC;AACrD,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAEjC,oBAAY,eAAe;IACzB,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,eAAe,qBAAqB;IACpC,aAAa,mBAAmB;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFG;AACH,qBACa,cAAe,SAAQ,UAAU;IAClB,WAAW,EAAE,sBAAsB,CAC7B;IACN,IAAI,EAAE,eAAe,CAAyB;IAC9C,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAa;IACxB,QAAQ,UAAQ;IAEnC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,SAAM;IACV,cAAc,SAAK;IAEnB,SAAS,SAAK;IAEb,WAAW,UAAS;IACpB,aAAa,UAAS;IACtB,SAAS,UAAS;IACnB,IAAI,EAAE,qBAAqB,CACrB;IACL,OAAO,UAAS;IAChB,SAAS,UAAS;IAElB,QAAQ,UAAS;IAClB,gBAAgB,EAAE,SAAS,CAAmB;IAC9C,cAAc,EAAE,iBAAiB,CAC/B;IACF,mBAAmB,EAAE,sBAAsB,CACtC;IACL,cAAc,EAAE,iBAAiB,CAC3B;IACa,qBAAqB,UAAQ;IAC/C,aAAa,UAAS;IAEvB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B,WAAW,UAAS;IAErB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,GAAG,SAAM;IAET,KAAK,SAAM;IAEZ,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAY;IAE/D,OAAO,KAAK,QAAQ,GAKnB;IAED,OAAO,CAAC,YAAY;IA+BpB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,gBAAgB;IAoBf,MAAM;IAqBf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,cAAc,CAAC;KACnC;CACF"}
@@ -23,6 +23,7 @@ var ObcTransmitter = class ObcTransmitter extends LitElement {
23
23
  this.orientation = TransmitterOrientation.bottom;
24
24
  this.type = "value";
25
25
  this.lineType = void 0;
26
+ this.showLine = true;
26
27
  this.unit = "";
27
28
  this.fractionDigits = 1;
28
29
  this.maxDigits = 0;
@@ -124,6 +125,7 @@ var ObcTransmitter = class ObcTransmitter extends LitElement {
124
125
  class=${classMap({
125
126
  transmitter: true,
126
127
  "has-alert": this.hasAlert,
128
+ "no-line": !this.showLine,
127
129
  [`orientation-${this.orientation}`]: true,
128
130
  [`type-${this.type}`]: true
129
131
  })}
@@ -140,6 +142,10 @@ var ObcTransmitter = class ObcTransmitter extends LitElement {
140
142
  __decorate([property({ type: String })], ObcTransmitter.prototype, "orientation", void 0);
141
143
  __decorate([property({ type: String })], ObcTransmitter.prototype, "type", void 0);
142
144
  __decorate([property({ type: String })], ObcTransmitter.prototype, "lineType", void 0);
145
+ __decorate([property({
146
+ type: Boolean,
147
+ attribute: false
148
+ })], ObcTransmitter.prototype, "showLine", void 0);
143
149
  __decorate([property({ type: Number })], ObcTransmitter.prototype, "value", void 0);
144
150
  __decorate([property({ type: String })], ObcTransmitter.prototype, "unit", void 0);
145
151
  __decorate([property({ type: Number })], ObcTransmitter.prototype, "fractionDigits", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"transmitter.js","names":[],"sources":["../../../src/automation/transmitter/transmitter.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport type {TemplateResult} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport componentStyle from './transmitter.css?inline';\nimport {customElement} from '../../decorator.js';\nimport {LineType} from '../index.js';\nimport {\n TransmitterOrientation,\n transmitterLeaderOffset,\n} from './transmitter-shared.js';\nimport {\n TransmitterButtonSize,\n TransmitterButtonVariant,\n} from '../transmitter-button/transmitter-button.js';\nimport '../transmitter-button/transmitter-button.js';\nimport {\n ObcIndicatorGraphSize,\n type ObcIndicatorGraphLayout,\n} from '../../navigation-instruments/indicator-graph/indicator-graph.js';\nimport '../../navigation-instruments/indicator-graph/indicator-graph.js';\nimport {\n ObcAlertFrameMode,\n ObcAlertFrameThickness,\n ObcAlertFrameType,\n} from '../../components/alert-frame/alert-frame.js';\nimport '../../components/alert-frame/alert-frame.js';\nimport {AlertType} from '../../types.js';\n\nexport {\n TransmitterOrientation,\n transmitterLeaderOffset,\n} from './transmitter-shared.js';\n\nexport enum TransmitterType {\n indicator = 'indicator',\n value = 'value',\n horizontalGraph = 'horizontal-graph',\n verticalGraph = 'vertical-graph',\n}\n\n/**\n * `<obc-transmitter>` – A readout label that attaches to a line via a leader\n * line, showing a measured value, a tag identifier, or a value paired with a\n * trend graph.\n *\n * Positioning (orientation + leader line) follows `<obc-automation-readout>`.\n * The value chip is an `<obc-transmitter-button>` and the trend is an\n * `<obc-indicator-graph>` with its area fill enabled.\n *\n * ### Features / Variants\n * - **`type`** – `indicator` (tag pill), `value` (icon/value/unit), or value\n * paired with a `horizontal-graph` (beside) or `vertical-graph` (below).\n * - **`orientation`** – `top`, `right`, `bottom`, `left`; controls which edge\n * the leader line attaches to.\n * - **Segments** – opt into a leading advice segment with `hasAdvice`/\n * `adviceValue` and a setpoint segment with `hasSetPoint`/`setpointValue`;\n * both are read-only and shown in the value chip for non-`indicator` types.\n * - **Alert frame** – `hasAlert` wraps the whole transmitter in an\n * `<obc-alert-frame>`. `alertFrameStatus`, `alertFrameType`,\n * `alertFrameThickness` and `alertFrameMode` set its severity, flap, border\n * and flashing, with the same names as on the automation devices; a flap\n * carries the status badge and the `alert-icon`, `alert-label` and\n * `alert-timer` slots.\n * - **Formatting** – `fractionDigits`, `maxDigits`, `hintedZeros` and\n * `hasSignSpacer` are forwarded to the value chip to control decimal\n * precision, muted leading-zero padding (e.g. `0012.3`) and the sign\n * column. The advice and setpoint segments reuse the same formatting.\n * `hasDegree` adds a degree column between the value and the unit.\n * `value`, `adviceValue` and `setpointValue` render dashes when they are\n * `NaN`, `null` or `undefined`.\n *\n * **TODO(designer):** the Figma Transmitter set (25656:45081) draws no alert\n * state, so the frame and its flaps follow the automation devices.\n *\n * ### Slots\n * | Slot Name | Conditions | Purpose |\n * |-------------|----------------------------------------------------------|---------------------------------|\n * | icon | value/graph + `hasIcon` | Leading icon in the value chip. |\n * | alert-icon | `hasAlert` + `showAlertIcon`, large side/bottom/top flap | Custom icon in the alert flap. |\n * | alert-label | `hasAlert`, bottom/top flap | Label in the alert flap. |\n * | alert-timer | `hasAlert`, bottom/top flap | Timer in the alert flap. |\n *\n * @property maxDigits - Integer digits to reserve / hint (independent of `fractionDigits`).\n * @property hasSignSpacer - Reserve a minus-sign column on every segment, filled by the real sign\n * only while a value is negative, so the chip's width does not change\n * across zero.\n * @property hasDegree - Show a degree column between the value and the unit (e.g. `12.3°` then `C`).\n * @property hasAlert - Wrap the transmitter in an `<obc-alert-frame>` when true.\n * @property alertFrameStatus - Severity of the alert frame, which picks its colour and flap badge:\n * `alarm` (default), `warning`, `caution` or one of the `level-*` severities.\n * @availableWhen alertFrameStatus hasAlert==true\n * @property alertFrameType - Flap of the alert frame: `regular` (default) draws the outline alone,\n * `small-side-flip`, `large-side-flip`, `bottom-flip` and `top-flip` add a flap\n * with the status badge.\n * @availableWhen alertFrameType hasAlert==true\n * @property alertFrameThickness - Border of the alert frame: `small` (default) or `large`.\n * @availableWhen alertFrameThickness hasAlert==true\n * @property alertFrameMode - Acknowledgement state of the alert: `acked-active` (default) is steady,\n * `unacked-active` flashes, `unacked-rectified` flashes a dashed frame.\n * @availableWhen alertFrameMode hasAlert==true\n * @property showAlertCategoryIcon - Show the status badge in the flap; a small side flap without it is not drawn.\n * @availableWhen showAlertCategoryIcon hasAlert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]\n * @property showAlertIcon - Show the `alert-icon` slot in a large side, bottom or top flap.\n * @availableWhen showAlertIcon hasAlert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]\n * @property adviceValue - Advisory value shown in the leading advice segment when `hasAdvice`.\n * @property setpointValue - Target value shown in the setpoint segment when `hasSetPoint`.\n * @property tag - Tag identifier shown when `type` is `indicator` (e.g. `TT`).\n * @property idTag - Optional identifier shown below the chip (e.g. `#0000`).\n * @property data - Trend data for the graph types: `[xValues, yValues]`.\n * @slot icon - Leading icon in the value chip.\n * @slot alert-icon - Custom icon in the alert flap, shown when `hasAlert` and `showAlertIcon`.\n * @slot alert-label - Label in a bottom or top alert flap, shown when `hasAlert`.\n * @slot alert-timer - Timer in a bottom or top alert flap, shown when `hasAlert`.\n *\n * @experimental\n */\n@customElement('obc-transmitter')\nexport class ObcTransmitter extends LitElement {\n @property({type: String}) orientation: TransmitterOrientation =\n TransmitterOrientation.bottom;\n @property({type: String}) type: TransmitterType = TransmitterType.value;\n @property({type: String}) lineType: LineType | undefined = undefined;\n\n @property({type: Number}) value?: number | null;\n @property({type: String}) unit = '';\n @property({type: Number}) fractionDigits = 1;\n\n @property({type: Number}) maxDigits = 0;\n\n @property({type: Boolean}) hintedZeros = false;\n @property({type: Boolean}) hasSignSpacer = false;\n @property({type: Boolean}) hasDegree = false;\n @property({type: String}) size: TransmitterButtonSize =\n TransmitterButtonSize.regular;\n @property({type: Boolean}) hasIcon = false;\n @property({type: Boolean}) hasAdvice = false;\n\n @property({type: Boolean}) hasAlert = false;\n @property({type: String}) alertFrameStatus: AlertType = AlertType.Alarm;\n @property({type: String}) alertFrameType: ObcAlertFrameType =\n ObcAlertFrameType.Regular;\n @property({type: String}) alertFrameThickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n @property({type: String}) alertFrameMode: ObcAlertFrameMode =\n ObcAlertFrameMode.ackedActive;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon = true;\n @property({type: Boolean}) showAlertIcon = false;\n\n @property({type: Number}) adviceValue?: number | null;\n\n @property({type: Boolean}) hasSetPoint = false;\n\n @property({type: Number}) setpointValue?: number | null;\n\n @property({type: String}) tag = '';\n\n @property({type: String}) idTag = '';\n\n @property({type: Array}) data: [number[], number[]] = [[], []];\n\n private get hasGraph() {\n return (\n this.type === TransmitterType.horizontalGraph ||\n this.type === TransmitterType.verticalGraph\n );\n }\n\n private renderButton() {\n const isIndicator = this.type === TransmitterType.indicator;\n return html`\n <obc-transmitter-button\n class=\"chip\"\n .variant=${\n isIndicator\n ? TransmitterButtonVariant.tag\n : TransmitterButtonVariant.value\n }\n .size=${this.size}\n .value=${this.value}\n .unit=${this.unit}\n .fractionDigits=${this.fractionDigits}\n .maxDigits=${this.maxDigits}\n .hintedZeros=${this.hintedZeros}\n .hasSignSpacer=${this.hasSignSpacer}\n .hasDegree=${this.hasDegree}\n .hasIcon=${this.hasIcon}\n .hasAdvice=${this.hasAdvice}\n .adviceValue=${this.adviceValue}\n .hasSetPoint=${this.hasSetPoint}\n .setpointValue=${this.setpointValue}\n .label=${this.tag}\n .idTag=${this.idTag}\n >\n <slot name=\"icon\" slot=\"icon\"></slot>\n </obc-transmitter-button>\n `;\n }\n\n private renderGraph() {\n if (!this.hasGraph) {\n return nothing;\n }\n const layout: ObcIndicatorGraphLayout = {\n size: ObcIndicatorGraphSize.small,\n fill: true,\n };\n return html`\n <div class=\"graph-box\">\n <obc-indicator-graph .data=${this.data} .layout=${layout}>\n </obc-indicator-graph>\n </div>\n `;\n }\n\n private renderLabel() {\n if (!this.idTag) {\n return nothing;\n }\n return html`<div class=\"id-tag\" aria-hidden=\"true\">${this.idTag}</div>`;\n }\n\n private renderContent() {\n return html`\n <div class=\"content\">\n <div class=\"body\">${this.renderButton()} ${this.renderGraph()}</div>\n ${this.renderLabel()}\n </div>\n `;\n }\n\n private renderAlertFrame(content: TemplateResult) {\n return html`\n <obc-alert-frame\n class=\"alert-frame\"\n .type=${this.alertFrameType}\n .thickness=${this.alertFrameThickness}\n .status=${this.alertFrameStatus}\n .mode=${this.alertFrameMode}\n .showAlertCategoryIcon=${this.showAlertCategoryIcon}\n .showIcon=${this.showAlertIcon}\n .wrapContent=${true}\n >\n ${content}\n <span slot=\"icon\"><slot name=\"alert-icon\"></slot></span>\n <span slot=\"label\"><slot name=\"alert-label\"></slot></span>\n <span slot=\"timer\"><slot name=\"alert-timer\"></slot></span>\n </obc-alert-frame>\n `;\n }\n\n override render() {\n const content = this.hasAlert\n ? this.renderAlertFrame(this.renderContent())\n : this.renderContent();\n\n return html`\n <div\n class=${classMap({\n transmitter: true,\n 'has-alert': this.hasAlert,\n [`orientation-${this.orientation}`]: true,\n [`type-${this.type}`]: true,\n })}\n style=\"--offset: ${transmitterLeaderOffset(this.lineType)}px;\"\n >\n ${content}\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-transmitter': ObcTransmitter;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAkCA,IAAY,kBAAL,yBAAA,iBAAA;CACL,gBAAA,eAAA;CACA,gBAAA,WAAA;CACA,gBAAA,qBAAA;CACA,gBAAA,mBAAA;;AACF,EAAA,CAAA,CAAA;AA+EO,IAAM,iBAAN,MAAM,uBAAuB,WAAW;;;EAE3C,KAAA,cAAA,uBAAuB;;EAEkC,KAAA,WAAA,KAAA;EAG1B,KAAA,OAAA;EACU,KAAA,iBAAA;EAEL,KAAA,YAAA;EAEG,KAAA,cAAA;EACE,KAAA,gBAAA;EACJ,KAAA,YAAA;EAErC,KAAA,OAAA,sBAAsB;EACa,KAAA,UAAA;EACE,KAAA,YAAA;EAED,KAAA,WAAA;EACkB,KAAA,mBAAA,UAAU;EAEhE,KAAA,iBAAA,kBAAkB;EAElB,KAAA,sBAAA,uBAAuB;EAEvB,KAAA,iBAAA,kBAAkB;EACiD,KAAA,wBAAA;EAC1B,KAAA,gBAAA;EAIF,KAAA,cAAA;EAIT,KAAA,MAAA;EAEE,KAAA,QAAA;EAEoB,KAAA,OAAA,CAAC,CAAC,GAAG,CAAC,CAAC;;CAE7D,IAAY,WAAW;EACrB,OACE,KAAK,SAAA,sBACL,KAAK,SAAA;CAET;CAEA,eAAuB;EACrB,MAAM,cAAc,KAAK,SAAA;EACzB,OAAO,IAAI;;;mBAIL,cACI,yBAAyB,MACzB,yBAAyB,MAC9B;gBACO,KAAK,KAAK;iBACT,KAAK,MAAM;gBACZ,KAAK,KAAK;0BACA,KAAK,eAAe;qBACzB,KAAK,UAAU;uBACb,KAAK,YA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AA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,kBAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,uBAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,kBAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS;CAAC,MAAM;CAAS,WAAW;AAAK,CAAC,CAAA,GAAA,eAAA,WAAA,yBAAA,KAAA,CAAA;AAC1C,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,eAAA,WAAA,iBAAA,KAAA,CAAA;AAExB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,eAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,eAAA,WAAA,eAAA,KAAA,CAAA;AAExB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,iBAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,OAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,SAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,MAAK,CAAC,CAAA,GAAA,eAAA,WAAA,QAAA,KAAA,CAAA;AA1CxB,iBAAA,WAAA,CAAA,cAAc,iBAAiB,CAAA,GAAA,cAAA"}
1
+ {"version":3,"file":"transmitter.js","names":[],"sources":["../../../src/automation/transmitter/transmitter.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport type {TemplateResult} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport componentStyle from './transmitter.css?inline';\nimport {customElement} from '../../decorator.js';\nimport {LineType} from '../index.js';\nimport {\n TransmitterOrientation,\n transmitterLeaderOffset,\n} from './transmitter-shared.js';\nimport {\n TransmitterButtonSize,\n TransmitterButtonVariant,\n} from '../transmitter-button/transmitter-button.js';\nimport '../transmitter-button/transmitter-button.js';\nimport {\n ObcIndicatorGraphSize,\n type ObcIndicatorGraphLayout,\n} from '../../navigation-instruments/indicator-graph/indicator-graph.js';\nimport '../../navigation-instruments/indicator-graph/indicator-graph.js';\nimport {\n ObcAlertFrameMode,\n ObcAlertFrameThickness,\n ObcAlertFrameType,\n} from '../../components/alert-frame/alert-frame.js';\nimport '../../components/alert-frame/alert-frame.js';\nimport {AlertType} from '../../types.js';\n\nexport {\n TransmitterOrientation,\n transmitterLeaderOffset,\n} from './transmitter-shared.js';\n\nexport enum TransmitterType {\n indicator = 'indicator',\n value = 'value',\n horizontalGraph = 'horizontal-graph',\n verticalGraph = 'vertical-graph',\n}\n\n/**\n * `<obc-transmitter>` – A readout label that attaches to a line via a leader\n * line, showing a measured value, a tag identifier, or a value paired with a\n * trend graph.\n *\n * Positioning (orientation + leader line) follows `<obc-automation-readout>`.\n * The value chip is an `<obc-transmitter-button>` and the trend is an\n * `<obc-indicator-graph>` with its area fill enabled.\n *\n * ### Features / Variants\n * - **`type`** – `indicator` (tag pill), `value` (icon/value/unit), or value\n * paired with a `horizontal-graph` (beside) or `vertical-graph` (below).\n * - **`orientation`** – `top`, `right`, `bottom`, `left`; controls which edge\n * the leader line attaches to.\n * - **`showLine`** – draw the leader line (default). Set `false` when the\n * line is drawn by other tools: the transmitter is then a plain box with no\n * padding or anchor offset, and `orientation` only sets the side of the\n * chip the id tag sits on.\n * - **Segments** – opt into a leading advice segment with `hasAdvice`/\n * `adviceValue` and a setpoint segment with `hasSetPoint`/`setpointValue`;\n * both are read-only and shown in the value chip for non-`indicator` types.\n * - **Alert frame** – `hasAlert` wraps the whole transmitter in an\n * `<obc-alert-frame>`. `alertFrameStatus`, `alertFrameType`,\n * `alertFrameThickness` and `alertFrameMode` set its severity, flap, border\n * and flashing, with the same names as on the automation devices; a flap\n * carries the status badge and the `alert-icon`, `alert-label` and\n * `alert-timer` slots.\n * - **Formatting** – `fractionDigits`, `maxDigits`, `hintedZeros` and\n * `hasSignSpacer` are forwarded to the value chip to control decimal\n * precision, muted leading-zero padding (e.g. `0012.3`) and the sign\n * column. The advice and setpoint segments reuse the same formatting.\n * `hasDegree` adds a degree column between the value and the unit.\n * `value`, `adviceValue` and `setpointValue` render dashes when they are\n * `NaN`, `null` or `undefined`.\n *\n * **TODO(designer):** the Figma Transmitter set (25656:45081) draws no alert\n * state, so the frame and its flaps follow the automation devices.\n *\n * ### Slots\n * | Slot Name | Conditions | Purpose |\n * |-------------|----------------------------------------------------------|---------------------------------|\n * | icon | value/graph + `hasIcon` | Leading icon in the value chip. |\n * | alert-icon | `hasAlert` + `showAlertIcon`, large side/bottom/top flap | Custom icon in the alert flap. |\n * | alert-label | `hasAlert`, bottom/top flap | Label in the alert flap. |\n * | alert-timer | `hasAlert`, bottom/top flap | Timer in the alert flap. |\n *\n * @property maxDigits - Integer digits to reserve / hint (independent of `fractionDigits`).\n * @property hasSignSpacer - Reserve a minus-sign column on every segment, filled by the real sign\n * only while a value is negative, so the chip's width does not change\n * across zero.\n * @property hasDegree - Show a degree column between the value and the unit (e.g. `12.3°` then `C`).\n * @property showLine - Draw the leader line. Set `false` when the line is drawn by other tools;\n * the transmitter is then a plain box with no padding or anchor offset, and\n * `orientation` only sets the side of the chip the id tag sits on.\n * @property hasAlert - Wrap the transmitter in an `<obc-alert-frame>` when true.\n * @property alertFrameStatus - Severity of the alert frame, which picks its colour and flap badge:\n * `alarm` (default), `warning`, `caution` or one of the `level-*` severities.\n * @availableWhen alertFrameStatus hasAlert==true\n * @property alertFrameType - Flap of the alert frame: `regular` (default) draws the outline alone,\n * `small-side-flip`, `large-side-flip`, `bottom-flip` and `top-flip` add a flap\n * with the status badge.\n * @availableWhen alertFrameType hasAlert==true\n * @property alertFrameThickness - Border of the alert frame: `small` (default) or `large`.\n * @availableWhen alertFrameThickness hasAlert==true\n * @property alertFrameMode - Acknowledgement state of the alert: `acked-active` (default) is steady,\n * `unacked-active` flashes, `unacked-rectified` flashes a dashed frame.\n * @availableWhen alertFrameMode hasAlert==true\n * @property showAlertCategoryIcon - Show the status badge in the flap; a small side flap without it is not drawn.\n * @availableWhen showAlertCategoryIcon hasAlert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]\n * @property showAlertIcon - Show the `alert-icon` slot in a large side, bottom or top flap.\n * @availableWhen showAlertIcon hasAlert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]\n * @property adviceValue - Advisory value shown in the leading advice segment when `hasAdvice`.\n * @property setpointValue - Target value shown in the setpoint segment when `hasSetPoint`.\n * @property tag - Tag identifier shown when `type` is `indicator` (e.g. `TT`).\n * @property idTag - Optional identifier shown below the chip (e.g. `#0000`).\n * @property data - Trend data for the graph types: `[xValues, yValues]`.\n * @slot icon - Leading icon in the value chip.\n * @slot alert-icon - Custom icon in the alert flap, shown when `hasAlert` and `showAlertIcon`.\n * @slot alert-label - Label in a bottom or top alert flap, shown when `hasAlert`.\n * @slot alert-timer - Timer in a bottom or top alert flap, shown when `hasAlert`.\n *\n * @experimental\n */\n@customElement('obc-transmitter')\nexport class ObcTransmitter extends LitElement {\n @property({type: String}) orientation: TransmitterOrientation =\n TransmitterOrientation.bottom;\n @property({type: String}) type: TransmitterType = TransmitterType.value;\n @property({type: String}) lineType: LineType | undefined = undefined;\n @property({type: Boolean, attribute: false}) showLine = true;\n\n @property({type: Number}) value?: number | null;\n @property({type: String}) unit = '';\n @property({type: Number}) fractionDigits = 1;\n\n @property({type: Number}) maxDigits = 0;\n\n @property({type: Boolean}) hintedZeros = false;\n @property({type: Boolean}) hasSignSpacer = false;\n @property({type: Boolean}) hasDegree = false;\n @property({type: String}) size: TransmitterButtonSize =\n TransmitterButtonSize.regular;\n @property({type: Boolean}) hasIcon = false;\n @property({type: Boolean}) hasAdvice = false;\n\n @property({type: Boolean}) hasAlert = false;\n @property({type: String}) alertFrameStatus: AlertType = AlertType.Alarm;\n @property({type: String}) alertFrameType: ObcAlertFrameType =\n ObcAlertFrameType.Regular;\n @property({type: String}) alertFrameThickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n @property({type: String}) alertFrameMode: ObcAlertFrameMode =\n ObcAlertFrameMode.ackedActive;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon = true;\n @property({type: Boolean}) showAlertIcon = false;\n\n @property({type: Number}) adviceValue?: number | null;\n\n @property({type: Boolean}) hasSetPoint = false;\n\n @property({type: Number}) setpointValue?: number | null;\n\n @property({type: String}) tag = '';\n\n @property({type: String}) idTag = '';\n\n @property({type: Array}) data: [number[], number[]] = [[], []];\n\n private get hasGraph() {\n return (\n this.type === TransmitterType.horizontalGraph ||\n this.type === TransmitterType.verticalGraph\n );\n }\n\n private renderButton() {\n const isIndicator = this.type === TransmitterType.indicator;\n return html`\n <obc-transmitter-button\n class=\"chip\"\n .variant=${\n isIndicator\n ? TransmitterButtonVariant.tag\n : TransmitterButtonVariant.value\n }\n .size=${this.size}\n .value=${this.value}\n .unit=${this.unit}\n .fractionDigits=${this.fractionDigits}\n .maxDigits=${this.maxDigits}\n .hintedZeros=${this.hintedZeros}\n .hasSignSpacer=${this.hasSignSpacer}\n .hasDegree=${this.hasDegree}\n .hasIcon=${this.hasIcon}\n .hasAdvice=${this.hasAdvice}\n .adviceValue=${this.adviceValue}\n .hasSetPoint=${this.hasSetPoint}\n .setpointValue=${this.setpointValue}\n .label=${this.tag}\n .idTag=${this.idTag}\n >\n <slot name=\"icon\" slot=\"icon\"></slot>\n </obc-transmitter-button>\n `;\n }\n\n private renderGraph() {\n if (!this.hasGraph) {\n return nothing;\n }\n const layout: ObcIndicatorGraphLayout = {\n size: ObcIndicatorGraphSize.small,\n fill: true,\n };\n return html`\n <div class=\"graph-box\">\n <obc-indicator-graph .data=${this.data} .layout=${layout}>\n </obc-indicator-graph>\n </div>\n `;\n }\n\n private renderLabel() {\n if (!this.idTag) {\n return nothing;\n }\n return html`<div class=\"id-tag\" aria-hidden=\"true\">${this.idTag}</div>`;\n }\n\n private renderContent() {\n return html`\n <div class=\"content\">\n <div class=\"body\">${this.renderButton()} ${this.renderGraph()}</div>\n ${this.renderLabel()}\n </div>\n `;\n }\n\n private renderAlertFrame(content: TemplateResult) {\n return html`\n <obc-alert-frame\n class=\"alert-frame\"\n .type=${this.alertFrameType}\n .thickness=${this.alertFrameThickness}\n .status=${this.alertFrameStatus}\n .mode=${this.alertFrameMode}\n .showAlertCategoryIcon=${this.showAlertCategoryIcon}\n .showIcon=${this.showAlertIcon}\n .wrapContent=${true}\n >\n ${content}\n <span slot=\"icon\"><slot name=\"alert-icon\"></slot></span>\n <span slot=\"label\"><slot name=\"alert-label\"></slot></span>\n <span slot=\"timer\"><slot name=\"alert-timer\"></slot></span>\n </obc-alert-frame>\n `;\n }\n\n override render() {\n const content = this.hasAlert\n ? this.renderAlertFrame(this.renderContent())\n : this.renderContent();\n\n return html`\n <div\n class=${classMap({\n transmitter: true,\n 'has-alert': this.hasAlert,\n 'no-line': !this.showLine,\n [`orientation-${this.orientation}`]: true,\n [`type-${this.type}`]: true,\n })}\n style=\"--offset: ${transmitterLeaderOffset(this.lineType)}px;\"\n >\n ${content}\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-transmitter': ObcTransmitter;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAkCA,IAAY,kBAAL,yBAAA,iBAAA;CACL,gBAAA,eAAA;CACA,gBAAA,WAAA;CACA,gBAAA,qBAAA;CACA,gBAAA,mBAAA;;AACF,EAAA,CAAA,CAAA;AAsFO,IAAM,iBAAN,MAAM,uBAAuB,WAAW;;;EAE3C,K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CAAC,CAAA,GAAA,eAAA,WAAA,yBAAA,KAAA,CAAA;AAC1C,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,eAAA,WAAA,iBAAA,KAAA,CAAA;AAExB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,eAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,eAAA,WAAA,eAAA,KAAA,CAAA;AAExB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,iBAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,OAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,SAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,MAAK,CAAC,CAAA,GAAA,eAAA,WAAA,QAAA,KAAA,CAAA;AA3CxB,iBAAA,WAAA,CAAA,cAAc,iBAAiB,CAAA,GAAA,cAAA"}
@@ -12,7 +12,7 @@ var transmitter_stack_default = css`* {
12
12
  display: block;
13
13
  }
14
14
 
15
- .transmitter {
15
+ .transmitter:not(.no-line) {
16
16
  position: relative;
17
17
  display: flex;
18
18
  align-items: center;
@@ -20,65 +20,65 @@ var transmitter_stack_default = css`* {
20
20
  width: fit-content;
21
21
  }
22
22
 
23
- .transmitter.orientation-bottom {
23
+ .transmitter.orientation-bottom:not(.no-line) {
24
24
  padding-top: 8px;
25
25
  top: calc(1px + var(--offset));
26
26
  transform: translateX(-50%);
27
27
  }
28
28
 
29
- .transmitter.orientation-top {
29
+ .transmitter.orientation-top:not(.no-line) {
30
30
  padding-bottom: 8px;
31
31
  transform: translate(-50%, calc(-100% - 1px - var(--offset)));
32
32
  }
33
33
 
34
- .transmitter.orientation-left {
34
+ .transmitter.orientation-left:not(.no-line) {
35
35
  padding-right: 8px;
36
36
  transform: translate(calc(-100% - 4px - var(--offset)), -50%);
37
37
  }
38
38
 
39
- .transmitter.orientation-right {
39
+ .transmitter.orientation-right:not(.no-line) {
40
40
  padding-left: 8px;
41
41
  transform: translateY(-50%);
42
42
  right: calc(-4px - var(--offset));
43
43
  }
44
44
 
45
- .transmitter::before {
45
+ .transmitter:not(.no-line)::before {
46
46
  content: "";
47
47
  display: block;
48
48
  position: absolute;
49
49
  border: var(--normal-enabled-border-color) solid 1px;
50
50
  }
51
51
 
52
- .transmitter.orientation-bottom::before,.transmitter.orientation-top::before {
52
+ .transmitter.orientation-bottom:not(.no-line)::before,.transmitter.orientation-top:not(.no-line)::before {
53
53
  width: 0;
54
54
  height: 8px;
55
55
  }
56
56
 
57
- .transmitter.orientation-bottom::before {
57
+ .transmitter.orientation-bottom:not(.no-line)::before {
58
58
  top: -1px;
59
59
  }
60
60
 
61
- .transmitter.orientation-top::before {
61
+ .transmitter.orientation-top:not(.no-line)::before {
62
62
  bottom: -1px;
63
63
  }
64
64
 
65
- .transmitter.orientation-left::before,.transmitter.orientation-right::before {
65
+ .transmitter.orientation-left:not(.no-line)::before,.transmitter.orientation-right:not(.no-line)::before {
66
66
  height: 0;
67
67
  width: 8px;
68
68
  }
69
69
 
70
- .transmitter.orientation-left::before {
70
+ .transmitter.orientation-left:not(.no-line)::before {
71
71
  right: -4px;
72
72
  }
73
73
 
74
- .transmitter.orientation-right::before {
74
+ .transmitter.orientation-right:not(.no-line)::before {
75
75
  left: -4px;
76
76
  }
77
77
 
78
78
  /* Left/right anchor on the chip row's middle (Figma 25656:45233), so the id
79
79
  tag hangs below out of flow; its parent must be the containing block. */
80
80
 
81
- .transmitter:is(.orientation-left,.orientation-right):not(.has-alert) .id-tag {
81
+ .transmitter:not(.no-line):is(.orientation-left,.orientation-right):not(.has-alert) .id-tag {
82
82
  position: absolute;
83
83
  top: calc(100% + 2px);
84
84
  left: 50%;
@@ -86,6 +86,10 @@ var transmitter_stack_default = css`* {
86
86
  white-space: nowrap;
87
87
  }
88
88
 
89
+ .transmitter.no-line {
90
+ width: fit-content; /* a full-width box would stretch the 1fr segments across the container */
91
+ }
92
+
89
93
  .values {
90
94
  display: grid;
91
95
  grid-auto-flow: column;
@@ -1 +1 @@
1
- {"version":3,"file":"transmitter-stack.css.js","names":[],"sources":["../../../src/automation/transmitter-stack/transmitter-stack.css?inline"],"sourcesContent":["* {\n box-sizing: border-box;\n}\n\n:host {\n display: block;\n}\n\n.transmitter {\n @mixin transmitter-leader;\n}\n\n.values {\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 1fr; /* equal segments, sized by the widest reading (Figma 25656:45218) */\n}\n\n.cell {\n position: relative; /* containing block for the left/right id tag (transmitter-leader) */\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 2px;\n}\n\n.orientation-top .cell {\n flex-direction: column-reverse;\n}\n\n.segment {\n width: 100%;\n}\n\n.segment::part(button) {\n flex: 1;\n justify-content: center;\n}\n\n/* Neighbours share one border line; only the chip's outer corners round. */\n.cell:not(:last-child) .segment::part(button) {\n border-right: none;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.cell:not(:first-child) .segment::part(button) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.id-tag {\n @mixin transmitter-id-tag;\n /* an empty tag keeps the chip row aligned */\n min-height: var(--global-typography-general-xs-line-height);\n}\n"],"mappings":""}
1
+ {"version":3,"file":"transmitter-stack.css.js","names":[],"sources":["../../../src/automation/transmitter-stack/transmitter-stack.css?inline"],"sourcesContent":["* {\n box-sizing: border-box;\n}\n\n:host {\n display: block;\n}\n\n.transmitter:not(.no-line) {\n @mixin transmitter-leader;\n}\n\n.transmitter.no-line {\n width: fit-content; /* a full-width box would stretch the 1fr segments across the container */\n}\n\n.values {\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 1fr; /* equal segments, sized by the widest reading (Figma 25656:45218) */\n}\n\n.cell {\n position: relative; /* containing block for the left/right id tag (transmitter-leader) */\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 2px;\n}\n\n.orientation-top .cell {\n flex-direction: column-reverse;\n}\n\n.segment {\n width: 100%;\n}\n\n.segment::part(button) {\n flex: 1;\n justify-content: center;\n}\n\n/* Neighbours share one border line; only the chip's outer corners round. */\n.cell:not(:last-child) .segment::part(button) {\n border-right: none;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.cell:not(:first-child) .segment::part(button) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.id-tag {\n @mixin transmitter-id-tag;\n /* an empty tag keeps the chip row aligned */\n min-height: var(--global-typography-general-xs-line-height);\n}\n"],"mappings":""}
@@ -40,6 +40,10 @@ export interface TransmitterStackValueClickDetail {
40
40
  * ### Features / Variants
41
41
  * - **`orientation`** – `top`, `right`, `bottom`, `left`; the edge the leader
42
42
  * line attaches to. `top` places the id tags above the chip.
43
+ * - **`showLine`** – draw the leader line (default). Set `false` when the
44
+ * line is drawn by other tools: the stack is then a plain box with no
45
+ * padding or anchor offset, and `orientation` only decides whether the id
46
+ * tags sit above (`top`) or below the chip.
43
47
  * - **Values** – `value` and `unit` per segment. `idTag` adds a label row under
44
48
  * every segment once any value has one, so the chip stays aligned.
45
49
  * - **Formatting** – per value `fractionDigits` (default `1`), `maxDigits`
@@ -68,6 +72,8 @@ export interface TransmitterStackValueClickDetail {
68
72
  *
69
73
  * @property orientation - Edge of the chip the leader line attaches to.
70
74
  * @property lineType - Line the transmitter sits on; offsets the leader line by half its stroke.
75
+ * @property showLine - Draw the leader line. Set `false` when the line is drawn by other tools;
76
+ * the stack is then a plain box with no padding or anchor offset.
71
77
  * @property values - One segment per entry, in order.
72
78
  * @fires {CustomEvent<TransmitterStackValueClickDetail>} value-click - Fired when a segment is activated, with its value and index.
73
79
  * @fires click - Fired when any segment is clicked; `value-click` tells which.
@@ -78,6 +84,8 @@ export declare class ObcTransmitterStack extends LitElement {
78
84
  orientation: TransmitterOrientation;
79
85
  /** Line the transmitter sits on; offsets the leader line by half its stroke. */
80
86
  lineType: LineType | undefined;
87
+ /** Draw the leader line. Set `false` when the line is drawn by other tools; the stack is then a plain box with no padding or anchor offset. */
88
+ showLine: boolean;
81
89
  /** One segment per entry, in order. */
82
90
  values: TransmitterStackValue[];
83
91
  private handleValueClick;
@@ -1 +1 @@
1
- {"version":3,"file":"transmitter-stack.d.ts","sourceRoot":"","sources":["../../../src/automation/transmitter-stack/transmitter-stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAQ,OAAO,EAAY,MAAM,KAAK,CAAC;AAKzD,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,sBAAsB,EAEvB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,6CAA6C,CAAC;AAErD,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gCAAgC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,qBAAqB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,qBACa,mBAAoB,SAAQ,UAAU;IACvB,WAAW,EAAE,sBAAsB,CAC7B;IACN,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAa;IAC5C,MAAM,EAAE,qBAAqB,EAAE,CAAM;IAE9D,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,WAAW;IA2CV,MAAM;IAsBf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,uBAAuB,EAAE,mBAAmB,CAAC;KAC9C;CACF"}
1
+ {"version":3,"file":"transmitter-stack.d.ts","sourceRoot":"","sources":["../../../src/automation/transmitter-stack/transmitter-stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAQ,OAAO,EAAY,MAAM,KAAK,CAAC;AAKzD,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,sBAAsB,EAEvB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,6CAA6C,CAAC;AAErD,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gCAAgC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,qBAAqB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,qBACa,mBAAoB,SAAQ,UAAU;IACvB,WAAW,EAAE,sBAAsB,CAC7B;IACN,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAa;IACxB,QAAQ,UAAQ;IACpC,MAAM,EAAE,qBAAqB,EAAE,CAAM;IAE9D,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,WAAW;IA2CV,MAAM;IAuBf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,uBAAuB,EAAE,mBAAmB,CAAC;KAC9C;CACF"}
@@ -12,6 +12,7 @@ var ObcTransmitterStack = class ObcTransmitterStack extends LitElement {
12
12
  super(..._args);
13
13
  this.orientation = TransmitterOrientation.bottom;
14
14
  this.lineType = void 0;
15
+ this.showLine = true;
15
16
  this.values = [];
16
17
  }
17
18
  handleValueClick(index, value) {
@@ -56,6 +57,7 @@ var ObcTransmitterStack = class ObcTransmitterStack extends LitElement {
56
57
  <div
57
58
  class=${classMap({
58
59
  transmitter: true,
60
+ "no-line": !this.showLine,
59
61
  [`orientation-${this.orientation}`]: true
60
62
  })}
61
63
  style="--offset: ${transmitterLeaderOffset(this.lineType)}px;"
@@ -72,6 +74,10 @@ var ObcTransmitterStack = class ObcTransmitterStack extends LitElement {
72
74
  };
73
75
  __decorate([property({ type: String })], ObcTransmitterStack.prototype, "orientation", void 0);
74
76
  __decorate([property({ type: String })], ObcTransmitterStack.prototype, "lineType", void 0);
77
+ __decorate([property({
78
+ type: Boolean,
79
+ attribute: false
80
+ })], ObcTransmitterStack.prototype, "showLine", void 0);
75
81
  __decorate([property({ type: Array })], ObcTransmitterStack.prototype, "values", void 0);
76
82
  ObcTransmitterStack = __decorate([customElement("obc-transmitter-stack")], ObcTransmitterStack);
77
83
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"transmitter-stack.js","names":[],"sources":["../../../src/automation/transmitter-stack/transmitter-stack.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport componentStyle from './transmitter-stack.css?inline';\nimport {customElement} from '../../decorator.js';\nimport {LineType} from '../index.js';\nimport {\n TransmitterOrientation,\n transmitterLeaderOffset,\n} from '../transmitter/transmitter-shared.js';\nimport {TransmitterButtonVariant} from '../transmitter-button/transmitter-button.js';\nimport '../transmitter-button/transmitter-button.js';\n\n/** One reading of a transmitter stack. */\nexport interface TransmitterStackValue {\n /** The reading; `null` or `NaN` renders the unavailable dash. */\n value: number | null;\n unit?: string;\n /** Identifier shown under the segment (above it for `top`) and read as part of its name. */\n idTag?: string;\n /** Decimal precision; `1` when the key is omitted. */\n fractionDigits?: number;\n /** Integer digits to reserve; `0` when the key is omitted. */\n maxDigits?: number;\n hintedZeros?: boolean;\n hasSignSpacer?: boolean;\n /** Show a degree column between the value and the unit (e.g. `12.3°` then `C`). */\n hasDegree?: boolean;\n /**\n * Name of the light-DOM slot projected as this segment's icon. Unique within\n * the stack: an element is projected once, so a repeated name leaves later\n * segments with an empty icon.\n */\n iconSlotName?: string;\n}\n\nexport interface TransmitterStackValueClickDetail {\n index: number;\n value: TransmitterStackValue;\n}\n\n/**\n * `<obc-transmitter-stack>` – Several transmitter readings side by side in one\n * joined chip, attached to a line by a single leader line.\n *\n * Each entry of `values` renders an `<obc-transmitter-button>` segment with its\n * own icon, value, unit and id tag. The segments take equal widths, set by the\n * widest reading, and share their borders. Positioning and the leader line\n * follow `<obc-transmitter>`.\n *\n * ### Features / Variants\n * - **`orientation`** – `top`, `right`, `bottom`, `left`; the edge the leader\n * line attaches to. `top` places the id tags above the chip.\n * - **Values** – `value` and `unit` per segment. `idTag` adds a label row under\n * every segment once any value has one, so the chip stays aligned.\n * - **Formatting** – per value `fractionDigits` (default `1`), `maxDigits`\n * (default `0`), `hintedZeros`, `hasSignSpacer` and `hasDegree`, formatted like\n * `<obc-transmitter-button>`. An omitted key takes its default; a key set to\n * `null`, `undefined` or `NaN` renders the reading as the unavailable dash.\n * - **Icons** – `iconSlotName` projects the light-DOM element with that slot\n * name as the segment's icon; names must be unique within the stack. The\n * name is chosen per value, so it carries no `@slot` tag (the wrapper\n * generator needs literal names).\n * - **Accessible name** – each segment is a native button named by its\n * reading, unit and `idTag`; the visible tag is hidden from assistive\n * technology so it is not read twice.\n * - **Empty** – with no `values` nothing renders, leader line included.\n *\n * ### Usage Guidelines\n * Use when one source reports several readings that share one leader line. For\n * a single reading, a tag pill or a trend graph, use `<obc-transmitter>`. Each\n * segment's hit area is `<obc-transmitter-button>`'s chip (24 px high), below\n * the 48 px touch-target token; see its design note.\n *\n * ### Slots\n * | Slot Name | Conditions | Purpose |\n * |------------------|---------------------------------|-------------------------------|\n * | `<iconSlotName>` | a value declares `iconSlotName` | Icon in that value's segment. |\n *\n * @property orientation - Edge of the chip the leader line attaches to.\n * @property lineType - Line the transmitter sits on; offsets the leader line by half its stroke.\n * @property values - One segment per entry, in order.\n * @fires {CustomEvent<TransmitterStackValueClickDetail>} value-click - Fired when a segment is activated, with its value and index.\n * @fires click - Fired when any segment is clicked; `value-click` tells which.\n * @experimental\n */\n@customElement('obc-transmitter-stack')\nexport class ObcTransmitterStack extends LitElement {\n @property({type: String}) orientation: TransmitterOrientation =\n TransmitterOrientation.bottom;\n @property({type: String}) lineType: LineType | undefined = undefined;\n @property({type: Array}) values: TransmitterStackValue[] = [];\n\n private handleValueClick(index: number, value: TransmitterStackValue): void {\n this.dispatchEvent(\n new CustomEvent<TransmitterStackValueClickDetail>('value-click', {\n detail: {index, value},\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private renderValue(\n entry: TransmitterStackValue,\n index: number,\n hasIdTags: boolean\n ) {\n // `in`, not `??` alone: a key that is present but empty is a failed\n // runtime write and must reach the block as missing (NaN renders the dash,\n // readout-components.md § 2).\n return html`\n <div class=\"cell\" part=\"cell\">\n <obc-transmitter-button\n class=\"segment\"\n .variant=${TransmitterButtonVariant.value}\n .value=${entry.value}\n .unit=${entry.unit ?? ''}\n .fractionDigits=${\n 'fractionDigits' in entry ? (entry.fractionDigits ?? NaN) : 1\n }\n .maxDigits=${'maxDigits' in entry ? (entry.maxDigits ?? NaN) : 0}\n .hintedZeros=${entry.hintedZeros ?? false}\n .hasSignSpacer=${entry.hasSignSpacer ?? false}\n .hasDegree=${entry.hasDegree ?? false}\n .hasIcon=${Boolean(entry.iconSlotName)}\n .idTag=${entry.idTag ?? ''}\n @click=${() => this.handleValueClick(index, entry)}\n >\n ${\n entry.iconSlotName\n ? html`<slot name=${entry.iconSlotName} slot=\"icon\"></slot>`\n : nothing\n }\n </obc-transmitter-button>\n ${\n hasIdTags\n ? html`<div class=\"id-tag\" aria-hidden=\"true\">\n ${entry.idTag ?? ''}\n </div>`\n : nothing\n }\n </div>\n `;\n }\n\n override render() {\n if (this.values.length === 0) {\n return nothing;\n }\n const hasIdTags = this.values.some((entry) => Boolean(entry.idTag));\n return html`\n <div\n class=${classMap({\n transmitter: true,\n [`orientation-${this.orientation}`]: true,\n })}\n style=\"--offset: ${transmitterLeaderOffset(this.lineType)}px;\"\n >\n <div class=\"values\" part=\"values\">\n ${this.values.map((entry, index) =>\n this.renderValue(entry, index, hasIdTags)\n )}\n </div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-transmitter-stack': ObcTransmitterStack;\n }\n}\n"],"mappings":";;;;;;;;;AAuFO,IAAM,sBAAN,MAAM,4BAA4B,WAAW;;;EAEhD,KAAA,cAAA,uBAAuB;EACkC,KAAA,WAAA,KAAA;EACA,KAAA,SAAA,CAAC;;CAE5D,iBAAyB,OAAe,OAAoC;EAC1E,KAAK,cACH,IAAI,YAA8C,eAAe;GAC/D,QAAQ;IAAC;IAAO;GAAK;GACrB,SAAS;GACT,UAAU;EACZ,CAAC,CACH;CACF;CAEA,YACE,OACA,OACA,WACA;EAIA,OAAO,IAAI;;;;qBAIM,yBAAyB,MAAM;mBACjC,MAAM,MAAM;kBACb,MAAM,QAAQ,GAAG;4BAEvB,oBAAoB,QAAS,MAAM,kBAAkB,MAAO,EAC7D;uBACY,eAAe,QAAS,MAAM,aAAa,MAAO,EAAE;yBAClD,MAAM,eAAe,MAAM;2BACzB,MAAM,iBAAiB,MAAM;uBACjC,MAAM,aAAa,MAAM;qBAC3B,QAAQ,MAAM,YAAY,EAAE;mBAC9B,MAAM,SAAS,GAAG;yBACZ,KAAK,iBAAiB,OAAO,KAAK,EAAE;;YAGjD,MAAM,eACF,IAAI,cAAc,MAAM,aAAa,wBACrC,QACL;;UAGD,YACI,IAAI;kBACA,MAAM,SAAS,GAAG;wBAEtB,QACL;;;CAGP;CAEA,SAAkB;EAChB,IAAI,KAAK,OAAO,WAAW,GACzB,OAAO;EAET,MAAM,YAAY,KAAK,OAAO,MAAM,UAAU,QAAQ,MAAM,KAAK,CAAC;EAClE,OAAO,IAAI;;gBAEC,SAAS;GACf,aAAa;IACZ,eAAe,KAAK,gBAAgB;EACvC,CAAC,EAAE;2BACgB,wBAAwB,KAAK,QAAQ,EAAE;;;YAGtD,KAAK,OAAO,KAAK,OAAO,UACxB,KAAK,YAAY,OAAO,OAAO,SAAS,CAC1C,EAAE;;;;CAIV;;EAEyB,KAAA,SAAA,UAAU,yBAAc;;AACnD;AAjFG,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,oBAAA,WAAA,eAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,oBAAA,WAAA,YAAA,KAAA,CAAA;AACvB,WAAA,CAAA,SAAS,EAAC,MAAM,MAAK,CAAC,CAAA,GAAA,oBAAA,WAAA,UAAA,KAAA,CAAA;AALxB,sBAAA,WAAA,CAAA,cAAc,uBAAuB,CAAA,GAAA,mBAAA"}
1
+ {"version":3,"file":"transmitter-stack.js","names":[],"sources":["../../../src/automation/transmitter-stack/transmitter-stack.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport componentStyle from './transmitter-stack.css?inline';\nimport {customElement} from '../../decorator.js';\nimport {LineType} from '../index.js';\nimport {\n TransmitterOrientation,\n transmitterLeaderOffset,\n} from '../transmitter/transmitter-shared.js';\nimport {TransmitterButtonVariant} from '../transmitter-button/transmitter-button.js';\nimport '../transmitter-button/transmitter-button.js';\n\n/** One reading of a transmitter stack. */\nexport interface TransmitterStackValue {\n /** The reading; `null` or `NaN` renders the unavailable dash. */\n value: number | null;\n unit?: string;\n /** Identifier shown under the segment (above it for `top`) and read as part of its name. */\n idTag?: string;\n /** Decimal precision; `1` when the key is omitted. */\n fractionDigits?: number;\n /** Integer digits to reserve; `0` when the key is omitted. */\n maxDigits?: number;\n hintedZeros?: boolean;\n hasSignSpacer?: boolean;\n /** Show a degree column between the value and the unit (e.g. `12.3°` then `C`). */\n hasDegree?: boolean;\n /**\n * Name of the light-DOM slot projected as this segment's icon. Unique within\n * the stack: an element is projected once, so a repeated name leaves later\n * segments with an empty icon.\n */\n iconSlotName?: string;\n}\n\nexport interface TransmitterStackValueClickDetail {\n index: number;\n value: TransmitterStackValue;\n}\n\n/**\n * `<obc-transmitter-stack>` – Several transmitter readings side by side in one\n * joined chip, attached to a line by a single leader line.\n *\n * Each entry of `values` renders an `<obc-transmitter-button>` segment with its\n * own icon, value, unit and id tag. The segments take equal widths, set by the\n * widest reading, and share their borders. Positioning and the leader line\n * follow `<obc-transmitter>`.\n *\n * ### Features / Variants\n * - **`orientation`** – `top`, `right`, `bottom`, `left`; the edge the leader\n * line attaches to. `top` places the id tags above the chip.\n * - **`showLine`** – draw the leader line (default). Set `false` when the\n * line is drawn by other tools: the stack is then a plain box with no\n * padding or anchor offset, and `orientation` only decides whether the id\n * tags sit above (`top`) or below the chip.\n * - **Values** – `value` and `unit` per segment. `idTag` adds a label row under\n * every segment once any value has one, so the chip stays aligned.\n * - **Formatting** – per value `fractionDigits` (default `1`), `maxDigits`\n * (default `0`), `hintedZeros`, `hasSignSpacer` and `hasDegree`, formatted like\n * `<obc-transmitter-button>`. An omitted key takes its default; a key set to\n * `null`, `undefined` or `NaN` renders the reading as the unavailable dash.\n * - **Icons** – `iconSlotName` projects the light-DOM element with that slot\n * name as the segment's icon; names must be unique within the stack. The\n * name is chosen per value, so it carries no `@slot` tag (the wrapper\n * generator needs literal names).\n * - **Accessible name** – each segment is a native button named by its\n * reading, unit and `idTag`; the visible tag is hidden from assistive\n * technology so it is not read twice.\n * - **Empty** – with no `values` nothing renders, leader line included.\n *\n * ### Usage Guidelines\n * Use when one source reports several readings that share one leader line. For\n * a single reading, a tag pill or a trend graph, use `<obc-transmitter>`. Each\n * segment's hit area is `<obc-transmitter-button>`'s chip (24 px high), below\n * the 48 px touch-target token; see its design note.\n *\n * ### Slots\n * | Slot Name | Conditions | Purpose |\n * |------------------|---------------------------------|-------------------------------|\n * | `<iconSlotName>` | a value declares `iconSlotName` | Icon in that value's segment. |\n *\n * @property orientation - Edge of the chip the leader line attaches to.\n * @property lineType - Line the transmitter sits on; offsets the leader line by half its stroke.\n * @property showLine - Draw the leader line. Set `false` when the line is drawn by other tools;\n * the stack is then a plain box with no padding or anchor offset.\n * @property values - One segment per entry, in order.\n * @fires {CustomEvent<TransmitterStackValueClickDetail>} value-click - Fired when a segment is activated, with its value and index.\n * @fires click - Fired when any segment is clicked; `value-click` tells which.\n * @experimental\n */\n@customElement('obc-transmitter-stack')\nexport class ObcTransmitterStack extends LitElement {\n @property({type: String}) orientation: TransmitterOrientation =\n TransmitterOrientation.bottom;\n @property({type: String}) lineType: LineType | undefined = undefined;\n @property({type: Boolean, attribute: false}) showLine = true;\n @property({type: Array}) values: TransmitterStackValue[] = [];\n\n private handleValueClick(index: number, value: TransmitterStackValue): void {\n this.dispatchEvent(\n new CustomEvent<TransmitterStackValueClickDetail>('value-click', {\n detail: {index, value},\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private renderValue(\n entry: TransmitterStackValue,\n index: number,\n hasIdTags: boolean\n ) {\n // `in`, not `??` alone: a key that is present but empty is a failed\n // runtime write and must reach the block as missing (NaN renders the dash,\n // readout-components.md § 2).\n return html`\n <div class=\"cell\" part=\"cell\">\n <obc-transmitter-button\n class=\"segment\"\n .variant=${TransmitterButtonVariant.value}\n .value=${entry.value}\n .unit=${entry.unit ?? ''}\n .fractionDigits=${\n 'fractionDigits' in entry ? (entry.fractionDigits ?? NaN) : 1\n }\n .maxDigits=${'maxDigits' in entry ? (entry.maxDigits ?? NaN) : 0}\n .hintedZeros=${entry.hintedZeros ?? false}\n .hasSignSpacer=${entry.hasSignSpacer ?? false}\n .hasDegree=${entry.hasDegree ?? false}\n .hasIcon=${Boolean(entry.iconSlotName)}\n .idTag=${entry.idTag ?? ''}\n @click=${() => this.handleValueClick(index, entry)}\n >\n ${\n entry.iconSlotName\n ? html`<slot name=${entry.iconSlotName} slot=\"icon\"></slot>`\n : nothing\n }\n </obc-transmitter-button>\n ${\n hasIdTags\n ? html`<div class=\"id-tag\" aria-hidden=\"true\">\n ${entry.idTag ?? ''}\n </div>`\n : nothing\n }\n </div>\n `;\n }\n\n override render() {\n if (this.values.length === 0) {\n return nothing;\n }\n const hasIdTags = this.values.some((entry) => Boolean(entry.idTag));\n return html`\n <div\n class=${classMap({\n transmitter: true,\n 'no-line': !this.showLine,\n [`orientation-${this.orientation}`]: true,\n })}\n style=\"--offset: ${transmitterLeaderOffset(this.lineType)}px;\"\n >\n <div class=\"values\" part=\"values\">\n ${this.values.map((entry, index) =>\n this.renderValue(entry, index, hasIdTags)\n )}\n </div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-transmitter-stack': ObcTransmitterStack;\n }\n}\n"],"mappings":";;;;;;;;;AA6FO,IAAM,sBAAN,MAAM,4BAA4B,WAAW;;;EAEhD,KAAA,cAAA,uBAAuB;EACkC,KAAA,WAAA,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AC,CAAA,GAAA,oBAAA,WAAA,YAAA,KAAA,CAAA;AACvB,WAAA,CAAA,SAAS;CAAC,MAAM;CAAS,WAAW;AAAK,CAAC,CAAA,GAAA,oBAAA,WAAA,YAAA,KAAA,CAAA;AAC1C,WAAA,CAAA,SAAS,EAAC,MAAM,MAAK,CAAC,CAAA,GAAA,oBAAA,WAAA,UAAA,KAAA,CAAA;AANxB,sBAAA,WAAA,CAAA,cAAc,uBAAuB,CAAA,GAAA,mBAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oicl/openbridge-webcomponents",
3
- "version": "2.2.0-next.12",
3
+ "version": "2.2.0-next.13",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",