@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.128 → 2.0.0-next.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/openbridge-webcomponents.bundle.js +12321 -11895
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +227 -3
- package/dist/building-blocks/readout-block/readout-block.css.js +53 -19
- package/dist/building-blocks/readout-block/readout-block.css.js.map +1 -1
- package/dist/building-blocks/readout-block/readout-block.d.ts +55 -0
- package/dist/building-blocks/readout-block/readout-block.d.ts.map +1 -1
- package/dist/building-blocks/readout-block/readout-block.js +57 -2
- package/dist/building-blocks/readout-block/readout-block.js.map +1 -1
- package/dist/navigation-instruments/readout/readout-shared.d.ts +23 -0
- package/dist/navigation-instruments/readout/readout-shared.d.ts.map +1 -1
- package/dist/navigation-instruments/readout/readout-shared.js +8 -0
- package/dist/navigation-instruments/readout/readout-shared.js.map +1 -1
- package/dist/navigation-instruments/readout/readout.css.js +138 -31
- package/dist/navigation-instruments/readout/readout.css.js.map +1 -1
- package/dist/navigation-instruments/readout/readout.d.ts +63 -3
- package/dist/navigation-instruments/readout/readout.d.ts.map +1 -1
- package/dist/navigation-instruments/readout/readout.js +127 -27
- package/dist/navigation-instruments/readout/readout.js.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js +64 -1
- 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 +77 -2
- 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 +100 -23
- package/dist/navigation-instruments/readout-list-item/readout-list-item.js.map +1 -1
- package/package.json +1 -1
- package/src/building-blocks/readout-block/readout-block.css +49 -20
- package/src/building-blocks/readout-block/readout-block.stories.ts +54 -0
- package/src/building-blocks/readout-block/readout-block.ts +101 -2
- package/src/navigation-instruments/instrument-field/instrument-field.stories.ts +1150 -180
- package/src/navigation-instruments/readout/readout-shared.spec.ts +50 -0
- package/src/navigation-instruments/readout/readout-shared.ts +33 -0
- package/src/navigation-instruments/readout/readout.css +124 -32
- package/src/navigation-instruments/readout/readout.stories.ts +536 -19
- package/src/navigation-instruments/readout/readout.ts +184 -31
- package/src/navigation-instruments/readout-list-item/readout-list-item.css +55 -1
- package/src/navigation-instruments/readout-list-item/readout-list-item.stories.ts +341 -0
- package/src/navigation-instruments/readout-list-item/readout-list-item.ts +169 -25
|
@@ -14,13 +14,16 @@ import {
|
|
|
14
14
|
ReadoutBlockSize,
|
|
15
15
|
ReadoutBlockDataQuality,
|
|
16
16
|
ReadoutBlockHidePhase,
|
|
17
|
+
ReadoutAdviceCategory,
|
|
17
18
|
} from '../../building-blocks/readout-block/readout-block.js';
|
|
18
19
|
import {
|
|
19
20
|
ReadoutListItemSetpointInteraction,
|
|
21
|
+
ReadoutSourceState,
|
|
20
22
|
type ReadoutBlockState,
|
|
21
23
|
type ReadoutValueOptions,
|
|
22
24
|
type ReadoutSetpointOptions,
|
|
23
25
|
type ReadoutAdviceOptions,
|
|
26
|
+
type ReadoutLabelOptions,
|
|
24
27
|
type ReadoutReserverOptions,
|
|
25
28
|
type ReadoutSrcOptions,
|
|
26
29
|
} from '../readout-list-item/readout-list-item.js';
|
|
@@ -39,6 +42,8 @@ import {
|
|
|
39
42
|
readoutNumericFormatOptions,
|
|
40
43
|
readoutPrimarySize,
|
|
41
44
|
readoutSecondarySize,
|
|
45
|
+
readoutSetpointSize,
|
|
46
|
+
readoutValueSize,
|
|
42
47
|
readoutSetpointWeight,
|
|
43
48
|
readoutDataQualityClasses,
|
|
44
49
|
resolveSetpointHidePhase,
|
|
@@ -60,6 +65,7 @@ import {
|
|
|
60
65
|
} from '../../components/context-menu-input/context-menu-input.js';
|
|
61
66
|
import '../../icons/icon-chevron-right-google.js';
|
|
62
67
|
import '../../icons/icon-drop-down-google.js';
|
|
68
|
+
import '../../icons/icon-delta.js';
|
|
63
69
|
|
|
64
70
|
// Re-exported so consumers configure the readout without a second import path.
|
|
65
71
|
// The option interfaces and enums are shared with `obc-readout-list-item` on
|
|
@@ -67,11 +73,14 @@ import '../../icons/icon-drop-down-google.js';
|
|
|
67
73
|
// per-block options API and may merge in a future release.
|
|
68
74
|
export {ObcTextboxFontWeight} from '../../components/textbox/textbox.js';
|
|
69
75
|
export {ReadoutValueType} from './readout-formatters.js';
|
|
76
|
+
export {ReadoutAdviceCategory} from '../../building-blocks/readout-block/readout-block.js';
|
|
77
|
+
export {ReadoutSourceState} from '../readout-list-item/readout-list-item.js';
|
|
70
78
|
export type {
|
|
71
79
|
ReadoutBlockState,
|
|
72
80
|
ReadoutValueOptions,
|
|
73
81
|
ReadoutSetpointOptions,
|
|
74
82
|
ReadoutAdviceOptions,
|
|
83
|
+
ReadoutLabelOptions,
|
|
75
84
|
ReadoutReserverOptions,
|
|
76
85
|
ReadoutSrcOptions,
|
|
77
86
|
} from '../readout-list-item/readout-list-item.js';
|
|
@@ -106,6 +115,9 @@ export type ReadoutDataQuality = ReadoutBlockDataQuality;
|
|
|
106
115
|
* How the setpoint segment behaves relative to the value (an alias of
|
|
107
116
|
* `ReadoutListItemSetpointInteraction`).
|
|
108
117
|
* - `always-visible` (default): the setpoint is always shown.
|
|
118
|
+
* - `equal-size`: value and setpoint are always shown at the same (primary)
|
|
119
|
+
* size (Figma 6.1 "Equal size") — the value does not demote while
|
|
120
|
+
* `touching`, unlike the other modes.
|
|
109
121
|
* - `flip-flop`: value and setpoint swap emphasis (size) as the value reaches
|
|
110
122
|
* the setpoint.
|
|
111
123
|
* - `pop-up`: the setpoint is shown only while the value has not reached it,
|
|
@@ -172,6 +184,11 @@ export enum ReadoutSourceInteraction {
|
|
|
172
184
|
/**
|
|
173
185
|
* Per-source options. Extends the shared per-block state (data quality, alert,
|
|
174
186
|
* space reserver) with the readout's source interactivity.
|
|
187
|
+
*
|
|
188
|
+
* `state` and `deviation` apply to the plain (non-interactive) source only —
|
|
189
|
+
* the Figma 6.1 sheets do not define them on the picker / flyout buttons, so
|
|
190
|
+
* those branches render without a state chip or deviation line
|
|
191
|
+
* (TODO(designer): pending a design for interactive source states).
|
|
175
192
|
*/
|
|
176
193
|
export interface ReadoutSourceOptions extends ReadoutSrcOptions {
|
|
177
194
|
/** Interactivity of the source row (default `none`). */
|
|
@@ -226,6 +243,7 @@ export interface ReadoutSourceOptions extends ReadoutSrcOptions {
|
|
|
226
243
|
* ### Slots
|
|
227
244
|
* | Slot Name | Renders When | Purpose |
|
|
228
245
|
* |--------------------|---------------------------------------|--------------------------------------|
|
|
246
|
+
* | leading-icon | `hasLeadingIcon` | Icon before the label/unit meta zone.|
|
|
229
247
|
* | value-icon | `valueOptions.hasIcon` | Icon before the value. |
|
|
230
248
|
* | setpoint-icon | `hasSetpoint` | Overrides the default setpoint icon. |
|
|
231
249
|
* | advice-icon | `hasAdvice` | Overrides the default advice icon. |
|
|
@@ -234,6 +252,7 @@ export interface ReadoutSourceOptions extends ReadoutSrcOptions {
|
|
|
234
252
|
* @fires {CustomEvent<{value: string, label?: string}>} source-change - Fired when a source picker option is selected.
|
|
235
253
|
* @fires {CustomEvent<{src: string}>} source-flyout-click - Fired when the source row is clicked while `srcOptions.interaction == 'flyout'`.
|
|
236
254
|
*
|
|
255
|
+
* @slot leading-icon - Icon before the label/unit meta zone.
|
|
237
256
|
* @slot value-icon - Icon before the value.
|
|
238
257
|
* @slot setpoint-icon - Overrides the default setpoint icon.
|
|
239
258
|
* @slot advice-icon - Overrides the default advice icon.
|
|
@@ -279,6 +298,13 @@ export class ObcReadout extends LitElement {
|
|
|
279
298
|
@property({type: Number}) advice?: number;
|
|
280
299
|
|
|
281
300
|
// Global layout/format (each defaults via its `resolved*` getter where useful).
|
|
301
|
+
/**
|
|
302
|
+
* Density tier. Applies to the vertical direction only — the horizontal
|
|
303
|
+
* arrangement exists in the large tier alone (Figma 6.1: it relies on the
|
|
304
|
+
* label+unit stack aligning with the L-size value caps), so `size` is
|
|
305
|
+
* ignored when `direction` is `horizontal`.
|
|
306
|
+
* @availableWhen direction==vertical
|
|
307
|
+
*/
|
|
282
308
|
@property({type: String}) size?: ReadoutSize;
|
|
283
309
|
@property({type: String}) priority?: ReadoutPriority;
|
|
284
310
|
@property({type: String}) direction?: ReadoutDirection;
|
|
@@ -286,9 +312,16 @@ export class ObcReadout extends LitElement {
|
|
|
286
312
|
@property({type: String}) stacking?: ReadoutStacking;
|
|
287
313
|
/** @availableWhen direction==vertical && stacking==stacked */
|
|
288
314
|
@property({type: String}) alignment?: ReadoutAlignment;
|
|
315
|
+
/**
|
|
316
|
+
* Render the cap-height degree glyph (`°`) after the ACTUAL VALUE only —
|
|
317
|
+
* the setpoint / advice blocks never carry one (Figma 6.1 review: the unit
|
|
318
|
+
* is written once for the readout, and the degree follows the same rule).
|
|
319
|
+
*/
|
|
289
320
|
@property({type: Boolean}) hasDegree = false;
|
|
290
321
|
/** @availableWhen hasDegree==false */
|
|
291
322
|
@property({type: Boolean}) hasDegreeSpacer = false;
|
|
323
|
+
/** Show the `leading-icon` slot before the label/unit meta zone. */
|
|
324
|
+
@property({type: Boolean}) hasLeadingIcon = false;
|
|
292
325
|
/**
|
|
293
326
|
* Also formats the numeric setpoint / advice blocks, which stay numeric
|
|
294
327
|
* even when the value is text. Must be between 0 and 100 — the range
|
|
@@ -324,6 +357,8 @@ export class ObcReadout extends LitElement {
|
|
|
324
357
|
@property({type: Object}) setpointOptions?: ReadoutSetpointOptions;
|
|
325
358
|
/** @availableWhen hasAdvice==true */
|
|
326
359
|
@property({type: Object}) adviceOptions?: ReadoutAdviceOptions;
|
|
360
|
+
/** @availableWhen label!='' */
|
|
361
|
+
@property({type: Object}) labelOptions?: ReadoutLabelOptions;
|
|
327
362
|
/** @availableWhen unit!='' */
|
|
328
363
|
@property({type: Object}) unitOptions?: ReadoutReserverOptions;
|
|
329
364
|
/** @availableWhen src!='' */
|
|
@@ -359,6 +394,12 @@ export class ObcReadout extends LitElement {
|
|
|
359
394
|
};
|
|
360
395
|
|
|
361
396
|
private get resolvedSize(): ReadoutSize {
|
|
397
|
+
// The horizontal arrangement exists only in the large tier (Figma 6.1 /
|
|
398
|
+
// design review 2026-08-18): it relies on the label+unit stack aligning
|
|
399
|
+
// with the L-size value caps, so `size` is ignored when horizontal.
|
|
400
|
+
if (this.isHorizontal) {
|
|
401
|
+
return ReadoutSize.large;
|
|
402
|
+
}
|
|
362
403
|
return this.size ?? ReadoutSize.small;
|
|
363
404
|
}
|
|
364
405
|
|
|
@@ -444,6 +485,12 @@ export class ObcReadout extends LitElement {
|
|
|
444
485
|
);
|
|
445
486
|
}
|
|
446
487
|
|
|
488
|
+
private get isEqualSize(): boolean {
|
|
489
|
+
return (
|
|
490
|
+
this.resolvedSetpointInteraction === ReadoutSetpointInteraction.equalSize
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
|
|
447
494
|
private get isPopUp(): boolean {
|
|
448
495
|
return (
|
|
449
496
|
this.resolvedSetpointInteraction === ReadoutSetpointInteraction.popUp
|
|
@@ -503,15 +550,23 @@ export class ObcReadout extends LitElement {
|
|
|
503
550
|
private get valueSize(): ObcTextboxSize {
|
|
504
551
|
// The value de-emphasises (secondary size) whenever the setpoint is the
|
|
505
552
|
// focus — while actively adjusting (`touching`) or while a flip-flop holds
|
|
506
|
-
// the value away from the setpoint —
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
553
|
+
// the value away from the setpoint — except in `equal-size`, where both
|
|
554
|
+
// blocks always hold the primary size (even while touching).
|
|
555
|
+
return readoutValueSize({
|
|
556
|
+
primary: this.primarySize,
|
|
557
|
+
secondary: this.secondarySize,
|
|
558
|
+
setpointEmphasized: this.isSetpointEmphasized,
|
|
559
|
+
equalSize: this.isEqualSize,
|
|
560
|
+
});
|
|
511
561
|
}
|
|
512
562
|
|
|
513
563
|
private get setpointSize(): ObcTextboxSize {
|
|
514
|
-
return
|
|
564
|
+
return readoutSetpointSize({
|
|
565
|
+
primary: this.primarySize,
|
|
566
|
+
secondary: this.secondarySize,
|
|
567
|
+
emphasized: this.isSetpointEmphasized,
|
|
568
|
+
equalSize: this.isEqualSize,
|
|
569
|
+
});
|
|
515
570
|
}
|
|
516
571
|
|
|
517
572
|
/** Value font weight passes straight to obc-textbox; regular when unset. Colour is separate. */
|
|
@@ -519,6 +574,35 @@ export class ObcReadout extends LitElement {
|
|
|
519
574
|
return this.valueOptions?.weight ?? ObcTextboxFontWeight.regular;
|
|
520
575
|
}
|
|
521
576
|
|
|
577
|
+
/**
|
|
578
|
+
* Label size. The Figma 6.1 title block defaults large readouts to `s` — a
|
|
579
|
+
* scannable label should not sit at the smallest permitted size — while
|
|
580
|
+
* small/medium tiers stay `xs`; `labelOptions.size` overrides either way
|
|
581
|
+
* (per the design team, for context / density / secondary instruments).
|
|
582
|
+
* The `s` default was confirmed by the design team (2026-08-17).
|
|
583
|
+
* TODO(designer): the medium-tier default is unverified in the new sheets
|
|
584
|
+
* (only XS and S exist on the title's size axis).
|
|
585
|
+
*/
|
|
586
|
+
private get labelSize(): ObcTextboxSize {
|
|
587
|
+
return (
|
|
588
|
+
this.labelOptions?.size ??
|
|
589
|
+
(this.resolvedSize === ReadoutSize.large
|
|
590
|
+
? ObcTextboxSize.s
|
|
591
|
+
: ObcTextboxSize.xs)
|
|
592
|
+
);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Label weight: SemiBold only for enhanced (in-command) readouts, regular
|
|
597
|
+
* otherwise — the designer reduced the amount of semibold in the interface
|
|
598
|
+
* (Figma 6.1 review).
|
|
599
|
+
*/
|
|
600
|
+
private get labelWeight(): ObcTextboxFontWeight {
|
|
601
|
+
return this.rowEnhanced
|
|
602
|
+
? ObcTextboxFontWeight.semibold
|
|
603
|
+
: ObcTextboxFontWeight.regular;
|
|
604
|
+
}
|
|
605
|
+
|
|
522
606
|
/** Setpoint is SemiBold only while emphasised, otherwise regular weight. */
|
|
523
607
|
private get setpointWeight(): ObcTextboxFontWeight {
|
|
524
608
|
return readoutSetpointWeight(this.isSetpointEmphasized);
|
|
@@ -567,6 +651,9 @@ export class ObcReadout extends LitElement {
|
|
|
567
651
|
hidePhase?: ReadoutBlockHidePhase;
|
|
568
652
|
dataQuality?: ReadoutBlockDataQuality;
|
|
569
653
|
alert?: false | AlertFrameConfig;
|
|
654
|
+
/** Advice-only: semantic category + triggered state. */
|
|
655
|
+
category?: ReadoutAdviceCategory;
|
|
656
|
+
active?: boolean;
|
|
570
657
|
/**
|
|
571
658
|
* Invisible width-reserving duplicate (see
|
|
572
659
|
* {@link renderSetpointWidthReserve}): skips the forwarded icon slot so
|
|
@@ -600,6 +687,8 @@ export class ObcReadout extends LitElement {
|
|
|
600
687
|
.hidePhase=${config.hidePhase ?? ReadoutBlockHidePhase.none}
|
|
601
688
|
.dataQuality=${config.dataQuality}
|
|
602
689
|
.alert=${config.alert ?? false}
|
|
690
|
+
.category=${config.category ?? ReadoutAdviceCategory.regular}
|
|
691
|
+
.active=${config.active ?? false}
|
|
603
692
|
>
|
|
604
693
|
${config.ghost ? nothing : this.renderForwardedIcon(config.variant)}
|
|
605
694
|
</obc-readout-block>
|
|
@@ -658,10 +747,11 @@ export class ObcReadout extends LitElement {
|
|
|
658
747
|
reserver?: string,
|
|
659
748
|
blockState?: ReadoutBlockState
|
|
660
749
|
): TemplateResult {
|
|
750
|
+
// The label carries its own size (labelOptions / tier default) and
|
|
751
|
+
// priority-driven weight; unit and source stay xs / regular.
|
|
661
752
|
const weight =
|
|
662
|
-
role === 'label'
|
|
663
|
-
|
|
664
|
-
: ObcTextboxFontWeight.regular;
|
|
753
|
+
role === 'label' ? this.labelWeight : ObcTextboxFontWeight.regular;
|
|
754
|
+
const size = role === 'label' ? this.labelSize : ObcTextboxSize.xs;
|
|
665
755
|
const box = html`
|
|
666
756
|
<obc-textbox
|
|
667
757
|
class=${classMap({
|
|
@@ -669,7 +759,7 @@ export class ObcReadout extends LitElement {
|
|
|
669
759
|
...this.dataQualityClasses(blockState?.dataQuality),
|
|
670
760
|
})}
|
|
671
761
|
part=${role}
|
|
672
|
-
.size=${
|
|
762
|
+
.size=${size}
|
|
673
763
|
.fontWeight=${weight}
|
|
674
764
|
alignment="left"
|
|
675
765
|
>
|
|
@@ -689,6 +779,11 @@ export class ObcReadout extends LitElement {
|
|
|
689
779
|
);
|
|
690
780
|
}
|
|
691
781
|
|
|
782
|
+
// `hasDegree` is deliberately NOT forwarded to the advice / setpoint blocks:
|
|
783
|
+
// the degree glyph renders on the actual value only (Figma 6.1 review,
|
|
784
|
+
// 2026-08-18) — the unit is written once for the whole readout, and the
|
|
785
|
+
// degree follows the same rule; the setpoint / advice implicitly share it.
|
|
786
|
+
// `obc-readout-list-item` keeps its own per-row convention.
|
|
692
787
|
private renderAdviceBlock(): TemplateResult {
|
|
693
788
|
return this.renderBlock({
|
|
694
789
|
variant: ReadoutBlockVariant.advice,
|
|
@@ -698,9 +793,10 @@ export class ObcReadout extends LitElement {
|
|
|
698
793
|
weight: ObcTextboxFontWeight.regular,
|
|
699
794
|
hintedZeros: this.adviceOptions?.hintedZeros ?? false,
|
|
700
795
|
spaceReserver: this.adviceOptions?.spaceReserver,
|
|
701
|
-
hasDegree: this.hasDegree ?? false,
|
|
702
796
|
dataQuality: this.adviceOptions?.dataQuality,
|
|
703
797
|
alert: this.adviceOptions?.alert,
|
|
798
|
+
category: this.adviceOptions?.category,
|
|
799
|
+
active: this.adviceOptions?.active,
|
|
704
800
|
});
|
|
705
801
|
}
|
|
706
802
|
|
|
@@ -715,7 +811,6 @@ export class ObcReadout extends LitElement {
|
|
|
715
811
|
weight: this.setpointWeight,
|
|
716
812
|
hintedZeros: this.setpointOptions?.hintedZeros ?? false,
|
|
717
813
|
spaceReserver: this.setpointOptions?.spaceReserver,
|
|
718
|
-
hasDegree: this.hasDegree ?? false,
|
|
719
814
|
touching: this.setpointTouching,
|
|
720
815
|
hidePhase: this.setpointHidePhase,
|
|
721
816
|
dataQuality: this.setpointOptions?.dataQuality,
|
|
@@ -814,14 +909,27 @@ export class ObcReadout extends LitElement {
|
|
|
814
909
|
})}
|
|
815
910
|
part="meta-wrapper"
|
|
816
911
|
>
|
|
817
|
-
${this.
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
this.unit,
|
|
822
|
-
this.unitOptions?.spaceReserver
|
|
823
|
-
)
|
|
912
|
+
${this.hasLeadingIcon
|
|
913
|
+
? html`<span class="leading-icon" aria-hidden="true"
|
|
914
|
+
><slot name="leading-icon"></slot
|
|
915
|
+
></span>`
|
|
824
916
|
: nothing}
|
|
917
|
+
<div class="meta-labels" part="meta-labels">
|
|
918
|
+
${this.label
|
|
919
|
+
? this.renderTextbox(
|
|
920
|
+
'label',
|
|
921
|
+
this.label,
|
|
922
|
+
this.labelOptions?.spaceReserver
|
|
923
|
+
)
|
|
924
|
+
: nothing}
|
|
925
|
+
${this.unit
|
|
926
|
+
? this.renderTextbox(
|
|
927
|
+
'unit',
|
|
928
|
+
this.unit,
|
|
929
|
+
this.unitOptions?.spaceReserver
|
|
930
|
+
)
|
|
931
|
+
: nothing}
|
|
932
|
+
</div>
|
|
825
933
|
</div>
|
|
826
934
|
`;
|
|
827
935
|
}
|
|
@@ -882,29 +990,73 @@ export class ObcReadout extends LitElement {
|
|
|
882
990
|
return wrapWithAlertFrame(this.srcOptions?.alert ?? false, button);
|
|
883
991
|
}
|
|
884
992
|
|
|
885
|
-
return this.
|
|
993
|
+
return this.renderSourceBlock(src);
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* The plain (non-interactive) source: the textbox plus its optional state
|
|
998
|
+
* chip and deviation line. The regular no-deviation case renders the bare
|
|
999
|
+
* textbox — the pre-6.1 output; a state or deviation wraps it in the
|
|
1000
|
+
* `.source-block` stack. The picker / flyout button variants do not carry
|
|
1001
|
+
* state / deviation yet — TODO(designer): undefined in the 6.1 sheets.
|
|
1002
|
+
*/
|
|
1003
|
+
private renderSourceBlock(src: string): TemplateResult {
|
|
1004
|
+
const state = this.srcOptions?.state ?? ReadoutSourceState.regular;
|
|
1005
|
+
const deviation = this.srcOptions?.deviation;
|
|
1006
|
+
const hasDeviation = deviation !== undefined && Number.isFinite(deviation);
|
|
1007
|
+
const box = this.renderTextbox(
|
|
886
1008
|
'source',
|
|
887
1009
|
src,
|
|
888
1010
|
this.srcOptions?.spaceReserver,
|
|
889
1011
|
this.srcOptions
|
|
890
1012
|
);
|
|
1013
|
+
if (state === ReadoutSourceState.regular && !hasDeviation) {
|
|
1014
|
+
return box;
|
|
1015
|
+
}
|
|
1016
|
+
return html`
|
|
1017
|
+
<div
|
|
1018
|
+
class=${classMap({
|
|
1019
|
+
'source-block': true,
|
|
1020
|
+
[`source-state-${state}`]: state !== ReadoutSourceState.regular,
|
|
1021
|
+
})}
|
|
1022
|
+
part="source-block"
|
|
1023
|
+
>
|
|
1024
|
+
${box}
|
|
1025
|
+
${hasDeviation
|
|
1026
|
+
? html`<span class="source-deviation">
|
|
1027
|
+
<obi-delta aria-hidden="true"></obi-delta>
|
|
1028
|
+
<obc-textbox
|
|
1029
|
+
class="source-deviation-value"
|
|
1030
|
+
.size=${ObcTextboxSize.xs}
|
|
1031
|
+
.tabularNums=${true}
|
|
1032
|
+
alignment="left"
|
|
1033
|
+
>${deviation}</obc-textbox
|
|
1034
|
+
>
|
|
1035
|
+
</span>`
|
|
1036
|
+
: nothing}
|
|
1037
|
+
</div>
|
|
1038
|
+
`;
|
|
891
1039
|
}
|
|
892
1040
|
|
|
893
|
-
/**
|
|
1041
|
+
/**
|
|
1042
|
+
* The source row (vertical) / segment (horizontal). Only the horizontal
|
|
1043
|
+
* direction draws an auto divider before the source — the Figma 6.1 review
|
|
1044
|
+
* (node 95:24490 "remove dividers", 95:26891 "Source-divider are there")
|
|
1045
|
+
* keeps the vertical source row divider-free while the horizontal flow
|
|
1046
|
+
* separates the source with a vertical rule.
|
|
1047
|
+
*/
|
|
894
1048
|
private renderSource(): TemplateResult | typeof nothing {
|
|
895
1049
|
if (!this.hasSrc) {
|
|
896
1050
|
return nothing;
|
|
897
1051
|
}
|
|
898
1052
|
return html`
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
aria-hidden="true"
|
|
907
|
-
></div>
|
|
1053
|
+
${this.isHorizontal
|
|
1054
|
+
? html`<div
|
|
1055
|
+
class="divider divider-vertical"
|
|
1056
|
+
part="divider"
|
|
1057
|
+
aria-hidden="true"
|
|
1058
|
+
></div>`
|
|
1059
|
+
: nothing}
|
|
908
1060
|
<div class="source-row" part="source-wrapper">
|
|
909
1061
|
${this.renderSourceContent()}
|
|
910
1062
|
</div>
|
|
@@ -1074,10 +1226,11 @@ export class ObcReadout extends LitElement {
|
|
|
1074
1226
|
valueSize: this.primarySize,
|
|
1075
1227
|
enhanced: false,
|
|
1076
1228
|
// The emphasised setpoint is SemiBold — reserve its widest form.
|
|
1229
|
+
// No degree: the visible setpoint block carries none (the degree
|
|
1230
|
+
// renders on the actual value only), so the ghost mirrors it.
|
|
1077
1231
|
weight: ObcTextboxFontWeight.semibold,
|
|
1078
1232
|
hintedZeros: this.setpointOptions?.hintedZeros ?? false,
|
|
1079
1233
|
spaceReserver: this.setpointOptions?.spaceReserver,
|
|
1080
|
-
hasDegree: this.hasDegree ?? false,
|
|
1081
1234
|
alert: this.setpointOptions?.alert,
|
|
1082
1235
|
ghost: true,
|
|
1083
1236
|
})
|
|
@@ -41,7 +41,7 @@ obc-readout-block {
|
|
|
41
41
|
);
|
|
42
42
|
--obc-readout-block-hinted-color: var(
|
|
43
43
|
--obc-readout-list-item-hinted-color,
|
|
44
|
-
var(--element-
|
|
44
|
+
var(--element-disabled-color)
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -302,6 +302,60 @@ obc-readout-block {
|
|
|
302
302
|
outline-color: var(--alert-invalid-border-color);
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
+
/* ---------- Source state chip & deviation (Figma 6.1 Readout-block-source)
|
|
306
|
+
* `enhanced` renders the amplified chip, `caution`/`warning` the alert chip.
|
|
307
|
+
* Like the data-quality chip these use `outline`, so toggling a state never
|
|
308
|
+
* shifts the row. TODO(designer): Figma pads the chip 4px; a padding here
|
|
309
|
+
* would shift the row on live state changes, so the chip hugs the text like
|
|
310
|
+
* the data-quality chip does. */
|
|
311
|
+
.source-block {
|
|
312
|
+
display: inline-flex;
|
|
313
|
+
flex-direction: column;
|
|
314
|
+
align-items: flex-start;
|
|
315
|
+
}
|
|
316
|
+
.source-block.source-state-enhanced,
|
|
317
|
+
.source-block.source-state-caution,
|
|
318
|
+
.source-block.source-state-warning {
|
|
319
|
+
outline: 1px solid;
|
|
320
|
+
border-radius: var(--global-border-radius-border-radius-check);
|
|
321
|
+
}
|
|
322
|
+
.source-block.source-state-enhanced {
|
|
323
|
+
background: var(--amplified-enabled-background-color);
|
|
324
|
+
outline-color: var(--amplified-enabled-border-color);
|
|
325
|
+
}
|
|
326
|
+
.source-block.source-state-enhanced .source,
|
|
327
|
+
.source-block.source-state-enhanced .source-deviation {
|
|
328
|
+
color: var(--on-amplified-active-color);
|
|
329
|
+
}
|
|
330
|
+
.source-block.source-state-caution {
|
|
331
|
+
background: var(--alert-caution-color);
|
|
332
|
+
outline-color: var(--alert-caution-outline-color);
|
|
333
|
+
}
|
|
334
|
+
.source-block.source-state-caution .source,
|
|
335
|
+
.source-block.source-state-caution .source-deviation {
|
|
336
|
+
color: var(--on-caution-active-color);
|
|
337
|
+
}
|
|
338
|
+
.source-block.source-state-warning {
|
|
339
|
+
background: var(--alert-warning-color);
|
|
340
|
+
outline-color: var(--alert-warning-outline-color);
|
|
341
|
+
}
|
|
342
|
+
.source-block.source-state-warning .source,
|
|
343
|
+
.source-block.source-state-warning .source-deviation {
|
|
344
|
+
color: var(--on-warning-active-color);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.source-deviation {
|
|
348
|
+
display: inline-flex;
|
|
349
|
+
align-items: center;
|
|
350
|
+
gap: 2px;
|
|
351
|
+
color: var(--element-inactive-color);
|
|
352
|
+
}
|
|
353
|
+
.source-deviation obi-delta {
|
|
354
|
+
display: block;
|
|
355
|
+
inline-size: 12px;
|
|
356
|
+
block-size: 12px;
|
|
357
|
+
}
|
|
358
|
+
|
|
305
359
|
.leading-icon {
|
|
306
360
|
display: inline-flex;
|
|
307
361
|
align-items: center;
|