@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.154 → 2.0.0-next.156
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/LICENSE-AGPL.txt +661 -0
- package/LICENSE-APACHE.txt +177 -0
- package/LICENSE.txt +35 -0
- package/bundle/openbridge-webcomponents.bundle.js +3629 -3281
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +236 -37
- package/dist/automation/transmitter/transmitter-shared.d.ts +11 -0
- package/dist/automation/transmitter/transmitter-shared.d.ts.map +1 -0
- package/dist/automation/transmitter/transmitter-shared.js +16 -0
- package/dist/automation/transmitter/transmitter-shared.js.map +1 -0
- package/dist/automation/transmitter/transmitter.css.js +12 -1
- package/dist/automation/transmitter/transmitter.css.js.map +1 -1
- package/dist/automation/transmitter/transmitter.d.ts +9 -10
- package/dist/automation/transmitter/transmitter.d.ts.map +1 -1
- package/dist/automation/transmitter/transmitter.js +12 -15
- package/dist/automation/transmitter/transmitter.js.map +1 -1
- package/dist/automation/transmitter-button/transmitter-button.css.js +18 -42
- package/dist/automation/transmitter-button/transmitter-button.css.js.map +1 -1
- package/dist/automation/transmitter-button/transmitter-button.d.ts +31 -21
- package/dist/automation/transmitter-button/transmitter-button.d.ts.map +1 -1
- package/dist/automation/transmitter-button/transmitter-button.js +37 -39
- package/dist/automation/transmitter-button/transmitter-button.js.map +1 -1
- package/dist/automation/transmitter-stack/transmitter-stack.css.js +144 -0
- package/dist/automation/transmitter-stack/transmitter-stack.css.js.map +1 -0
- package/dist/automation/transmitter-stack/transmitter-stack.d.ts +93 -0
- package/dist/automation/transmitter-stack/transmitter-stack.d.ts.map +1 -0
- package/dist/automation/transmitter-stack/transmitter-stack.js +97 -0
- package/dist/automation/transmitter-stack/transmitter-stack.js.map +1 -0
- package/dist/building-blocks/readout-block/readout-block.d.ts +1 -1
- package/dist/building-blocks/readout-block/readout-block.js.map +1 -1
- package/dist/components/textarea-field/textarea-field.css.js +0 -2
- package/dist/components/textarea-field/textarea-field.css.js.map +1 -1
- package/dist/components/textbox/textbox.d.ts +1 -1
- package/dist/components/textbox/textbox.js.map +1 -1
- package/dist/components/user-button/user-button.css.js +68 -1
- package/dist/components/user-button/user-button.css.js.map +1 -1
- package/dist/components/user-button/user-button.d.ts +8 -1
- package/dist/components/user-button/user-button.d.ts.map +1 -1
- package/dist/components/user-button/user-button.js +12 -3
- package/dist/components/user-button/user-button.js.map +1 -1
- package/dist/components/user-menu/user-menu.css.js +15 -0
- package/dist/components/user-menu/user-menu.css.js.map +1 -1
- package/dist/components/user-menu/user-menu.d.ts +22 -2
- package/dist/components/user-menu/user-menu.d.ts.map +1 -1
- package/dist/components/user-menu/user-menu.js +34 -2
- package/dist/components/user-menu/user-menu.js.map +1 -1
- package/dist/generated/locales/es-419.d.ts +1 -0
- package/dist/generated/locales/es-419.d.ts.map +1 -1
- package/dist/generated/locales/es-419.js +1 -0
- package/dist/generated/locales/es-419.js.map +1 -1
- package/dist/generated/locales/fi-FI.d.ts +1 -0
- package/dist/generated/locales/fi-FI.d.ts.map +1 -1
- package/dist/generated/locales/fi-FI.js +1 -0
- package/dist/generated/locales/fi-FI.js.map +1 -1
- package/dist/navigation-instruments/readout/readout.d.ts +1 -1
- package/dist/navigation-instruments/readout/readout.js.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js +1 -0
- package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.js +3 -0
- package/dist/navigation-instruments/readout-list-item/readout-list-item.js.map +1 -1
- package/package.json +6 -3
- package/script/prepare-full-bundle.ts +5 -0
- package/src/automation/transmitter/transmitter-shared.ts +16 -0
- package/src/automation/transmitter/transmitter.css +3 -71
- package/src/automation/transmitter/transmitter.stories.ts +13 -1
- package/src/automation/transmitter/transmitter.ts +19 -16
- package/src/automation/transmitter-button/transmitter-button.css +11 -36
- package/src/automation/transmitter-button/transmitter-button.stories.ts +3 -1
- package/src/automation/transmitter-button/transmitter-button.ts +62 -66
- package/src/automation/transmitter-stack/transmitter-stack.css +56 -0
- package/src/automation/transmitter-stack/transmitter-stack.spec.ts +210 -0
- package/src/automation/transmitter-stack/transmitter-stack.stories.ts +149 -0
- package/src/automation/transmitter-stack/transmitter-stack.ts +172 -0
- package/src/building-blocks/readout-block/readout-block.stories.ts +1 -1
- package/src/building-blocks/readout-block/readout-block.ts +1 -1
- package/src/components/textarea-field/textarea-field.css +1 -8
- package/src/components/textbox/textbox.stories.ts +1 -1
- package/src/components/textbox/textbox.ts +1 -1
- package/src/components/user-button/user-button.css +27 -1
- package/src/components/user-button/user-button.stories.ts +29 -0
- package/src/components/user-button/user-button.ts +22 -3
- package/src/components/user-menu/user-menu.css +8 -0
- package/src/components/user-menu/user-menu.stories.ts +53 -0
- package/src/components/user-menu/user-menu.ts +55 -4
- package/src/generated/locales/es-419.ts +1 -0
- package/src/generated/locales/fi-FI.ts +1 -0
- package/src/mixins/transmitter.css +90 -0
- package/src/mixins/visually-hidden.css +10 -0
- package/src/navigation-instruments/readout/readout.stories.ts +1 -1
- package/src/navigation-instruments/readout/readout.ts +1 -1
- package/src/navigation-instruments/readout-list-item/readout-list-item.css +1 -0
- package/src/navigation-instruments/readout-list-item/readout-list-item.stories.ts +1 -1
- package/src/navigation-instruments/readout-list-item/readout-list-item.ts +12 -2
|
@@ -39,8 +39,11 @@ export enum ObcUserMenuSize {
|
|
|
39
39
|
export type ObcUserMenuUser = {
|
|
40
40
|
initials: string;
|
|
41
41
|
label: string;
|
|
42
|
+
role?: string;
|
|
42
43
|
};
|
|
43
44
|
|
|
45
|
+
export type ObcUserMenuRecentUserClickEvent = CustomEvent<ObcUserMenuUser>;
|
|
46
|
+
|
|
44
47
|
export type ObcUserMenuSignedInAction = {
|
|
45
48
|
id: string;
|
|
46
49
|
label: string;
|
|
@@ -80,8 +83,13 @@ export type ObcUserMenuSignedInAction = {
|
|
|
80
83
|
* - `passwordError` (`string`): Error message for the password field.
|
|
81
84
|
* - `userInitials` (`string`): Initials for the primary user profile.
|
|
82
85
|
* - `userLabel` (`string`): Label for the primary user profile.
|
|
86
|
+
* - `userRole` (`string`): Role shown under the primary user's label. Omit it
|
|
87
|
+
* to show no role; only the regular size draws one.
|
|
83
88
|
* - `recentUsers` (`ObcUserMenuUser[]`): List of recent users shown in the
|
|
84
|
-
* "Recently signed in" section. Empty renders no section.
|
|
89
|
+
* "Recently signed in" section. Empty renders no section. Each user may
|
|
90
|
+
* carry its own `role`.
|
|
91
|
+
* - `showUseAnotherAccount` (`boolean`): Toggles the "Use another account"
|
|
92
|
+
* button in the `user-sign-in` layouts, both sizes. Defaults to `true`.
|
|
85
93
|
* - `signedInActions` (`ObcUserMenuSignedInAction[]`): Actions shown in the
|
|
86
94
|
* signed-in navigation list. Empty renders no actions.
|
|
87
95
|
* - `primaryActionId` (`string`): Id of the action promoted to a button in the
|
|
@@ -90,6 +98,9 @@ export type ObcUserMenuSignedInAction = {
|
|
|
90
98
|
* ### Events
|
|
91
99
|
* - `sign-in-click` – Fired when a sign-in button is clicked.
|
|
92
100
|
* - `sign-out-click` – Fired when the sign-out button is clicked.
|
|
101
|
+
* - `use-another-account-click` – Fired when the "Use another account" button
|
|
102
|
+
* is clicked. The menu does not change its own type; set it to `sign-in` in
|
|
103
|
+
* the handler to show the full form.
|
|
93
104
|
* - `signed-in-action-click` – Fired when a signed-in action is clicked.
|
|
94
105
|
* - `recent-user-click` – Fired when a recent user button is clicked.
|
|
95
106
|
*
|
|
@@ -124,6 +135,8 @@ export type ObcUserMenuSignedInAction = {
|
|
|
124
135
|
* @availableWhen userInitials type!=signIn
|
|
125
136
|
* @property userLabel - Label for the primary user profile.
|
|
126
137
|
* @availableWhen userLabel type!=signIn
|
|
138
|
+
* @property userRole - Role shown under the primary user's label; omit it to show no role.
|
|
139
|
+
* @availableWhen userRole type!=signIn && size==regular
|
|
127
140
|
* @property recentUsers - Recent users for the "Recently signed in" section.
|
|
128
141
|
* @property signedInActions - Actions shown in the signed-in navigation list.
|
|
129
142
|
* @availableWhen signedInActions type==signedIn
|
|
@@ -133,11 +146,14 @@ export type ObcUserMenuSignedInAction = {
|
|
|
133
146
|
* @availableWhen showPassword type in [signIn, userSignIn]
|
|
134
147
|
* @property primaryActionId - Id of the action promoted to a button in the small signed-in layout.
|
|
135
148
|
* @availableWhen primaryActionId type==signedIn && size==small
|
|
149
|
+
* @property showUseAnotherAccount - Controls the visibility of the "Use another account" button.
|
|
150
|
+
* @availableWhen showUseAnotherAccount type==userSignIn
|
|
136
151
|
* @slot signed-in-action-icon-<id> - Optional icon for a signed-in action, one per action; `<id>` is the normalized action id (shown in the `signed-in` type).
|
|
137
152
|
* @fires {CustomEvent<{username?: string, password?: string}>} sign-in-click - Fired when a sign-in button is clicked.
|
|
138
153
|
* @fires {CustomEvent<void>} sign-out-click - Fired when the sign-out button is clicked.
|
|
154
|
+
* @fires {CustomEvent<void>} use-another-account-click - Fired when the "Use another account" button is clicked.
|
|
139
155
|
* @fires {CustomEvent<{id: string, label: string}>} signed-in-action-click - Fired when a signed-in action is clicked.
|
|
140
|
-
* @fires {
|
|
156
|
+
* @fires {ObcUserMenuRecentUserClickEvent} recent-user-click - Fired when a recent user button is clicked, carrying that user's entry.
|
|
141
157
|
* @stable
|
|
142
158
|
*/
|
|
143
159
|
@customElement('obc-user-menu')
|
|
@@ -168,6 +184,8 @@ export class ObcUserMenu extends LitElement {
|
|
|
168
184
|
|
|
169
185
|
@property({type: String}) userLabel?: string;
|
|
170
186
|
|
|
187
|
+
@property({type: String}) userRole?: string;
|
|
188
|
+
|
|
171
189
|
@property({type: Array, attribute: false})
|
|
172
190
|
recentUsers: ObcUserMenuUser[] = [];
|
|
173
191
|
|
|
@@ -176,6 +194,9 @@ export class ObcUserMenu extends LitElement {
|
|
|
176
194
|
|
|
177
195
|
@property({type: String}) primaryActionId?: string;
|
|
178
196
|
|
|
197
|
+
@property({type: Boolean, attribute: false})
|
|
198
|
+
showUseAnotherAccount = true;
|
|
199
|
+
|
|
179
200
|
private get showRecentUsers() {
|
|
180
201
|
return this.hasRecentlySignedIn && this.recentUsers.length > 0;
|
|
181
202
|
}
|
|
@@ -223,6 +244,7 @@ export class ObcUserMenu extends LitElement {
|
|
|
223
244
|
.size=${size}
|
|
224
245
|
.initials=${user.initials}
|
|
225
246
|
.label=${user.label}
|
|
247
|
+
.sublabel=${isLarge ? user.role : undefined}
|
|
226
248
|
@click=${() => this.handleRecentUserClick(user)}
|
|
227
249
|
></obc-user-button>
|
|
228
250
|
`
|
|
@@ -239,6 +261,7 @@ export class ObcUserMenu extends LitElement {
|
|
|
239
261
|
return nothing;
|
|
240
262
|
}
|
|
241
263
|
const userButtonSize = size === 'large' ? Size.large : Size.regular;
|
|
264
|
+
const role = size === 'large' ? this.userRole : undefined;
|
|
242
265
|
return html`
|
|
243
266
|
<div
|
|
244
267
|
class=${classMap({
|
|
@@ -250,12 +273,14 @@ export class ObcUserMenu extends LitElement {
|
|
|
250
273
|
class=${classMap({
|
|
251
274
|
'user-avatar': true,
|
|
252
275
|
[`size-${size}`]: true,
|
|
276
|
+
'has-role': Boolean(role),
|
|
253
277
|
})}
|
|
254
278
|
.variant=${Variant.initials}
|
|
255
279
|
.styleType=${StyleType.normal}
|
|
256
280
|
.size=${userButtonSize}
|
|
257
281
|
.initials=${this.userInitials ?? ''}
|
|
258
282
|
.label=${this.userLabel ?? ''}
|
|
283
|
+
.sublabel=${role}
|
|
259
284
|
></obc-user-button>
|
|
260
285
|
</div>
|
|
261
286
|
`;
|
|
@@ -293,8 +318,8 @@ export class ObcUserMenu extends LitElement {
|
|
|
293
318
|
|
|
294
319
|
private handleRecentUserClick(user: ObcUserMenuUser) {
|
|
295
320
|
this.dispatchEvent(
|
|
296
|
-
new CustomEvent('recent-user-click', {
|
|
297
|
-
detail: {
|
|
321
|
+
new CustomEvent<ObcUserMenuUser>('recent-user-click', {
|
|
322
|
+
detail: {...user},
|
|
298
323
|
})
|
|
299
324
|
);
|
|
300
325
|
}
|
|
@@ -352,6 +377,10 @@ export class ObcUserMenu extends LitElement {
|
|
|
352
377
|
this.dispatchEvent(new CustomEvent('sign-out-click'));
|
|
353
378
|
}
|
|
354
379
|
|
|
380
|
+
private handleUseAnotherAccountClick() {
|
|
381
|
+
this.dispatchEvent(new CustomEvent('use-another-account-click'));
|
|
382
|
+
}
|
|
383
|
+
|
|
355
384
|
private renderSignIn() {
|
|
356
385
|
return html`
|
|
357
386
|
<div class="title-container">
|
|
@@ -488,6 +517,17 @@ export class ObcUserMenu extends LitElement {
|
|
|
488
517
|
>
|
|
489
518
|
${msg('Sign in')}
|
|
490
519
|
</obc-button>
|
|
520
|
+
${this.showUseAnotherAccount
|
|
521
|
+
? html`
|
|
522
|
+
<obc-button
|
|
523
|
+
variant=${ButtonVariant.normal}
|
|
524
|
+
fullWidth
|
|
525
|
+
@click=${this.handleUseAnotherAccountClick}
|
|
526
|
+
>
|
|
527
|
+
${msg('Use another account')}
|
|
528
|
+
</obc-button>
|
|
529
|
+
`
|
|
530
|
+
: nothing}
|
|
491
531
|
</div>
|
|
492
532
|
</div>
|
|
493
533
|
${this.showRecentUsers
|
|
@@ -535,6 +575,17 @@ export class ObcUserMenu extends LitElement {
|
|
|
535
575
|
>
|
|
536
576
|
${msg('Sign in')}
|
|
537
577
|
</obc-button>
|
|
578
|
+
${this.showUseAnotherAccount
|
|
579
|
+
? html`
|
|
580
|
+
<obc-button
|
|
581
|
+
variant=${ButtonVariant.normal}
|
|
582
|
+
fullWidth
|
|
583
|
+
@click=${this.handleUseAnotherAccountClick}
|
|
584
|
+
>
|
|
585
|
+
${msg('Use another account')}
|
|
586
|
+
</obc-button>
|
|
587
|
+
`
|
|
588
|
+
: nothing}
|
|
538
589
|
</div>
|
|
539
590
|
${this.showRecentUsers
|
|
540
591
|
? html`
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
'sf6e1665c7022a1f8': `Password`,
|
|
78
78
|
's981f6febad4df84a': `Recently signed in`,
|
|
79
79
|
'sbce70cbdb856635e': `Recent`,
|
|
80
|
+
's8506875a9d95f22c': `Use another account`,
|
|
80
81
|
's7cfe12cd14df9950': `Sign out`,
|
|
81
82
|
's5be3c6d61cd9182f': `Notifications`,
|
|
82
83
|
's744d993d03f29851': `Screen`,
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
'sf6e1665c7022a1f8': `Password`,
|
|
88
88
|
's981f6febad4df84a': `Recently signed in`,
|
|
89
89
|
'sbce70cbdb856635e': `Recent`,
|
|
90
|
+
's8506875a9d95f22c': `Use another account`,
|
|
90
91
|
's7cfe12cd14df9950': `Sign out`,
|
|
91
92
|
's5be3c6d61cd9182f': `Notifications`,
|
|
92
93
|
's744d993d03f29851': `Screen`,
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/* obc-transmitter and obc-transmitter-stack attach to a line the same way;
|
|
2
|
+
what they share lives here. */
|
|
3
|
+
|
|
4
|
+
/* Leader line and anchor transform. Apply on the element that carries the
|
|
5
|
+
`orientation-*` class and `--offset` (half the line's stroke width). */
|
|
6
|
+
@define-mixin transmitter-leader {
|
|
7
|
+
position: relative;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
width: fit-content;
|
|
12
|
+
|
|
13
|
+
&.orientation-bottom {
|
|
14
|
+
padding-top: 8px;
|
|
15
|
+
top: calc(1px + var(--offset));
|
|
16
|
+
transform: translateX(-50%);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.orientation-top {
|
|
20
|
+
padding-bottom: 8px;
|
|
21
|
+
transform: translate(-50%, calc(-100% - 1px - var(--offset)));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.orientation-left {
|
|
25
|
+
padding-right: 8px;
|
|
26
|
+
transform: translate(calc(-100% - 4px - var(--offset)), -50%);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.orientation-right {
|
|
30
|
+
padding-left: 8px;
|
|
31
|
+
transform: translateY(-50%);
|
|
32
|
+
right: calc(-4px - var(--offset));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&::before {
|
|
36
|
+
content: "";
|
|
37
|
+
display: block;
|
|
38
|
+
position: absolute;
|
|
39
|
+
border: var(--normal-enabled-border-color) solid 1px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.orientation-bottom::before,
|
|
43
|
+
&.orientation-top::before {
|
|
44
|
+
width: 0;
|
|
45
|
+
height: 8px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&.orientation-bottom::before {
|
|
49
|
+
top: -1px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.orientation-top::before {
|
|
53
|
+
bottom: -1px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&.orientation-left::before,
|
|
57
|
+
&.orientation-right::before {
|
|
58
|
+
height: 0;
|
|
59
|
+
width: 8px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&.orientation-left::before {
|
|
63
|
+
right: -4px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.orientation-right::before {
|
|
67
|
+
left: -4px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Left/right anchor on the chip row's middle (Figma 25656:45233), so the id
|
|
71
|
+
tag hangs below out of flow; its parent must be the containing block. */
|
|
72
|
+
&:is(.orientation-left, .orientation-right):not(.has-alert) .id-tag {
|
|
73
|
+
position: absolute;
|
|
74
|
+
top: calc(100% + 2px);
|
|
75
|
+
left: 50%;
|
|
76
|
+
transform: translateX(-50%);
|
|
77
|
+
white-space: nowrap;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@define-mixin transmitter-id-tag {
|
|
82
|
+
color: var(--element-neutral-color);
|
|
83
|
+
font-variant-numeric: lining-nums tabular-nums;
|
|
84
|
+
font-feature-settings: "ss04" on;
|
|
85
|
+
font-family: var(--global-typography-font-family);
|
|
86
|
+
font-size: var(--global-typography-instrument-label-font-size);
|
|
87
|
+
font-style: normal;
|
|
88
|
+
font-weight: 570;
|
|
89
|
+
line-height: var(--global-typography-instrument-label-line-height);
|
|
90
|
+
}
|
|
@@ -367,7 +367,7 @@ function argsToOptions(args: ReadoutStoryArgs): StoryOptions {
|
|
|
367
367
|
|
|
368
368
|
const meta = {
|
|
369
369
|
title: 'Instruments/Readout',
|
|
370
|
-
tags: ['autodocs', '6.0'
|
|
370
|
+
tags: ['autodocs', '6.0'],
|
|
371
371
|
component: 'obc-readout',
|
|
372
372
|
decorators: [centeredCanvasDecorator],
|
|
373
373
|
render: (args) =>
|
|
@@ -304,7 +304,7 @@ export interface ReadoutSourceOptions extends ReadoutSrcOptions {
|
|
|
304
304
|
* @slot src-picker-content - Provides the source picker context menu content.
|
|
305
305
|
* @fires {CustomEvent<{value: string, label?: string}>} source-change - Fired when a source picker option is selected.
|
|
306
306
|
* @fires {CustomEvent<{src: string}>} source-flyout-click - Fired when the source row is clicked while `srcOptions.interaction == 'flyout'`.
|
|
307
|
-
* @
|
|
307
|
+
* @stable
|
|
308
308
|
*/
|
|
309
309
|
@customElement('obc-readout')
|
|
310
310
|
export class ObcReadout extends LitElement {
|
|
@@ -346,7 +346,7 @@ function argsToOptions(args: ReadoutListItemStoryArgs): StoryOptions {
|
|
|
346
346
|
|
|
347
347
|
const meta = {
|
|
348
348
|
title: 'Instruments/Readout List Item',
|
|
349
|
-
tags: ['autodocs', '6.0'
|
|
349
|
+
tags: ['autodocs', '6.0'],
|
|
350
350
|
component: 'obc-readout-list-item',
|
|
351
351
|
decorators: [centeredCanvasDecorator],
|
|
352
352
|
render: (args) =>
|
|
@@ -364,7 +364,7 @@ export interface ReadoutSrcOptions extends ReadoutBlockState {
|
|
|
364
364
|
* @slot setpoint-icon - Overrides the default setpoint icon.
|
|
365
365
|
* @slot advice-icon - Overrides the default advice icon.
|
|
366
366
|
* @fires click - Fired when the item is activated. Only fired when `clickable` is set; otherwise the item renders as a non-interactive `<div>`.
|
|
367
|
-
* @
|
|
367
|
+
* @stable
|
|
368
368
|
*/
|
|
369
369
|
@customElement('obc-readout-list-item')
|
|
370
370
|
export class ObcReadoutListItem extends LitElement {
|
|
@@ -943,11 +943,21 @@ export class ObcReadoutListItem extends LitElement {
|
|
|
943
943
|
`;
|
|
944
944
|
}
|
|
945
945
|
|
|
946
|
-
private renderLabelContainer(): TemplateResult {
|
|
946
|
+
private renderLabelContainer(): TemplateResult | typeof nothing {
|
|
947
947
|
const stacking = this.resolvedStacking;
|
|
948
948
|
const showLeadingUnit =
|
|
949
949
|
stacking === ReadoutListItemStacking.leadingUnit && Boolean(this.unit);
|
|
950
950
|
const showLeadingSrc = this.hasLeadingSrc && Boolean(this.src);
|
|
951
|
+
// An empty container would still take the content gap, so a label-less
|
|
952
|
+
// row (the transmitter chip) could not hug its value.
|
|
953
|
+
if (
|
|
954
|
+
!this.hasLeadingIcon &&
|
|
955
|
+
!this.label &&
|
|
956
|
+
!showLeadingUnit &&
|
|
957
|
+
!showLeadingSrc
|
|
958
|
+
) {
|
|
959
|
+
return nothing;
|
|
960
|
+
}
|
|
951
961
|
|
|
952
962
|
return html`
|
|
953
963
|
<div class="label-container" part="label-container">
|