@oicl/openbridge-webcomponents 2.0.0-next.88 → 2.0.0-next.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +17344 -16794
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +720 -43
  4. package/dist/building-blocks/readout-block/readout-block.css.js +229 -0
  5. package/dist/building-blocks/readout-block/readout-block.css.js.map +1 -0
  6. package/dist/building-blocks/readout-block/readout-block.d.ts +146 -0
  7. package/dist/building-blocks/readout-block/readout-block.d.ts.map +1 -0
  8. package/dist/building-blocks/readout-block/readout-block.js +273 -0
  9. package/dist/building-blocks/readout-block/readout-block.js.map +1 -0
  10. package/dist/navigation-instruments/readout-list/readout-list.css.js +24 -0
  11. package/dist/navigation-instruments/readout-list/readout-list.css.js.map +1 -0
  12. package/dist/navigation-instruments/readout-list/readout-list.d.ts +70 -0
  13. package/dist/navigation-instruments/readout-list/readout-list.d.ts.map +1 -0
  14. package/dist/navigation-instruments/readout-list/readout-list.js +154 -0
  15. package/dist/navigation-instruments/readout-list/readout-list.js.map +1 -0
  16. package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js +80 -145
  17. package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js.map +1 -1
  18. package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts +25 -26
  19. package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts.map +1 -1
  20. package/dist/navigation-instruments/readout-list-item/readout-list-item.js +66 -118
  21. package/dist/navigation-instruments/readout-list-item/readout-list-item.js.map +1 -1
  22. package/package.json +1 -1
@@ -1,21 +1,18 @@
1
1
  import { LitElement } from 'lit';
2
2
  import { ObcTextboxFontWeight } from '../../components/textbox/textbox.js';
3
+ import { ReadoutBlockSize, ReadoutBlockDataQuality } from '../../building-blocks/readout-block/readout-block.js';
3
4
  import { AlertFrameConfig } from '../../components/alert-frame/alert-frame.js';
4
5
  import '../../components/textbox/textbox.js';
5
- import '../../icons/icon-input-right.js';
6
- import '../../icons/icon-notification-advice.js';
6
+ import '../../building-blocks/readout-block/readout-block.js';
7
7
  export { ObcTextboxFontWeight } from '../../components/textbox/textbox.js';
8
8
  /**
9
- * Density/size scale of the readout row.
9
+ * Density/size scale of the readout row (an alias of `ReadoutBlockSize`).
10
10
  * - `small`: regular value typography (smallest, densest).
11
11
  * - `medium`: medium value typography.
12
12
  * - `large`: large value typography.
13
13
  */
14
- export declare enum ReadoutListItemSize {
15
- small = "small",
16
- medium = "medium",
17
- large = "large"
18
- }
14
+ export declare const ReadoutListItemSize: typeof ReadoutBlockSize;
15
+ export type ReadoutListItemSize = ReadoutBlockSize;
19
16
  /**
20
17
  * Placement of the unit/source relative to the label and value.
21
18
  * - `trailing-unit`: unit after the value, source after a trailing divider.
@@ -37,13 +34,12 @@ export declare enum ReadoutListItemPriority {
37
34
  enhanced = "enhanced"
38
35
  }
39
36
  /**
40
- * Measurement quality of the value. Orthogonal to the row-level `alert`
41
- * – a low-integrity or invalid value can also sit inside an alert frame.
37
+ * Measurement quality of the value (an alias of `ReadoutBlockDataQuality`).
38
+ * Orthogonal to the row-level `alert` – a low-integrity or invalid value can
39
+ * also sit inside an alert frame.
42
40
  */
43
- export declare enum ReadoutListItemDataQuality {
44
- lowIntegrity = "low-integrity",
45
- invalid = "invalid"
46
- }
41
+ export declare const ReadoutListItemDataQuality: typeof ReadoutBlockDataQuality;
42
+ export type ReadoutListItemDataQuality = ReadoutBlockDataQuality;
47
43
  /**
48
44
  * Corner style of the interactive (clickable) surface.
49
45
  * - `squared` (default): no rounding (true rectangle).
@@ -183,8 +179,10 @@ export declare class ObcReadoutListItem extends LitElement {
183
179
  src?: string;
184
180
  hasValue: boolean;
185
181
  value: number | null;
186
- /** Render the value as the literal "OFF" (e.g. equipment powered down). Affects the value only. */
182
+ /** Render the value as `offText` (e.g. equipment powered down). Affects the value only. */
187
183
  off: boolean;
184
+ /** Text shown in place of the value when `off` is true. @availableWhen off==true */
185
+ offText: string;
188
186
  hasSetpoint: boolean;
189
187
  /** @availableWhen hasSetpoint==true */
190
188
  setpoint?: number;
@@ -207,6 +205,12 @@ export declare class ObcReadoutListItem extends LitElement {
207
205
  adviceOptions?: ReadoutAdviceOptions;
208
206
  unitOptions?: ReadoutReserverOptions;
209
207
  srcOptions?: ReadoutSrcOptions;
208
+ /**
209
+ * Development aid: outline the readout building blocks (red), the degree
210
+ * columns (blue) and the degree spacer (green) so reserver widths / alignment
211
+ * are visible. Off by default.
212
+ */
213
+ showDebugOverlay: boolean;
210
214
  /** Pop-up deferred-hide phase for the setpoint (see {@link updated}). */
211
215
  private deferredSetpointHidePhase;
212
216
  private deferredSetpointHideTimer?;
@@ -247,19 +251,14 @@ export declare class ObcReadoutListItem extends LitElement {
247
251
  /** Setpoint is SemiBold only while emphasised, otherwise regular weight. */
248
252
  private get setpointWeight();
249
253
  private numericFormatOptions;
250
- /** Widest possible value string for width reservation (e.g. `"000.0"`). */
251
- private get reserverText();
252
- /**
253
- * Effective width reserver for a numeric block: the wider of the explicit
254
- * `spaceReserver` and the `maxDigits`/`fractionDigits`-derived reserve, so an
255
- * explicit reserver can never reserve *less* than the formatted value needs.
256
- * Under tabular-nums the rendered width is proportional to character count, so
257
- * "wider" compares string length.
258
- */
259
- private widerReserver;
260
254
  /** classMap fragment for a block / source carrying per-block data quality. */
261
255
  private dataQualityClasses;
262
- private renderIcon;
256
+ /**
257
+ * Forward the matching list-item icon slot into the block's single `icon`
258
+ * slot. The variant's default marker lives in `obc-readout-block` and shows
259
+ * when nothing is assigned here (an empty forwarded slot flattens to nothing).
260
+ */
261
+ private renderForwardedIcon;
263
262
  private renderBlock;
264
263
  /**
265
264
  * A cap-height `°` column whose width scales with the value size. Used after
@@ -1 +1 @@
1
- {"version":3,"file":"readout-list-item.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/readout-list-item/readout-list-item.ts"],"names":[],"mappings":"AAAA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O,CAAC,oBAAoB;IAQ5B,2EAA2E;IAC3E,OAAO,KAAK,YAAY,GAUvB;IAED;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAUrB,8EAA8E;IAC9E,OAAO,CAAC,kBAAkB;IAU1B,OAAO,CAAC,UAAU;IAqBlB,OAAO,CAAC,WAAW;IAuEnB;;;;;;OAMG;IACH,OAAO,CAAC,iBAAiB;IAqBzB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,kBAAkB;IAmB1B;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,aAAa;IA4BrB,OAAO,CAAC,kBAAkB;IA6D1B,OAAO,CAAC,oBAAoB;IAoC5B,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,oBAAoB;IAkB5B,OAAO,CAAC,aAAa;IAeZ,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAsCrD,OAAO,CAAC,yBAAyB;IAQxB,oBAAoB,IAAI,IAAI;IAY5B,MAAM;IA0Cf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,uBAAuB,EAAE,kBAAkB,CAAC;KAC7C;CACF"}
1
+ {"version":3,"file":"readout-list-item.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/readout-list-item/readout-list-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAgD,MAAM,KAAK,CAAC;AAK9E,OAAO,qCAAqC,CAAC;AAC7C,OAAO,EAEL,oBAAoB,EACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,sDAAsD,CAAC;AAC9D,OAAO,EAEL,gBAAgB,EAChB,uBAAuB,EAExB,MAAM,sDAAsD,CAAC;AAK9D,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,6CAA6C,CAAC;AAKrD,OAAO,EAAC,oBAAoB,EAAC,MAAM,q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B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,kBAAkB;IAmB1B;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,aAAa;IA4BrB,OAAO,CAAC,kBAAkB;IA+D1B,OAAO,CAAC,oBAAoB;IAoC5B,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,oBAAoB;IAkB5B,OAAO,CAAC,aAAa;IAeZ,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAsCrD,OAAO,CAAC,yBAAyB;IAQxB,oBAAoB,IAAI,IAAI;IAY5B,MAAM;IA0Cf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,uBAAuB,EAAE,kBAAkB,CAAC;KAC7C;CACF"}
@@ -1,12 +1,11 @@
1
- import { unsafeCSS, LitElement, nothing, html } from "lit";
1
+ import { unsafeCSS, LitElement, html, nothing } from "lit";
2
2
  import { property, state } from "lit/decorators.js";
3
3
  import { classMap } from "lit/directives/class-map.js";
4
4
  import componentStyle from "./readout-list-item.css.js";
5
5
  import { customElement } from "../../decorator.js";
6
6
  import { ObcTextboxSize, ObcTextboxFontWeight } from "../../components/textbox/textbox.js";
7
- import "../../icons/icon-input-right.js";
8
- import "../../icons/icon-notification-advice.js";
9
- import { formatNumericValue, getHintZeros } from "../readout/readout-formatters.js";
7
+ import { ReadoutBlockSize, ReadoutBlockDataQuality, ReadoutBlockVariant, ReadoutBlockHidePhase } from "../../building-blocks/readout-block/readout-block.js";
8
+ import { formatNumericValue } from "../readout/readout-formatters.js";
10
9
  import { wrapWithAlertFrame } from "../../components/alert-frame/alert-frame.js";
11
10
  var __defProp = Object.defineProperty;
12
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -18,12 +17,7 @@ var __decorateClass = (decorators, target, key, kind) => {
18
17
  if (kind && result) __defProp(target, key, result);
19
18
  return result;
20
19
  };
21
- var ReadoutListItemSize = /* @__PURE__ */ ((ReadoutListItemSize2) => {
22
- ReadoutListItemSize2["small"] = "small";
23
- ReadoutListItemSize2["medium"] = "medium";
24
- ReadoutListItemSize2["large"] = "large";
25
- return ReadoutListItemSize2;
26
- })(ReadoutListItemSize || {});
20
+ const ReadoutListItemSize = ReadoutBlockSize;
27
21
  var ReadoutListItemStacking = /* @__PURE__ */ ((ReadoutListItemStacking2) => {
28
22
  ReadoutListItemStacking2["trailingUnit"] = "trailing-unit";
29
23
  ReadoutListItemStacking2["leadingUnit"] = "leading-unit";
@@ -35,11 +29,7 @@ var ReadoutListItemPriority = /* @__PURE__ */ ((ReadoutListItemPriority2) => {
35
29
  ReadoutListItemPriority2["enhanced"] = "enhanced";
36
30
  return ReadoutListItemPriority2;
37
31
  })(ReadoutListItemPriority || {});
38
- var ReadoutListItemDataQuality = /* @__PURE__ */ ((ReadoutListItemDataQuality2) => {
39
- ReadoutListItemDataQuality2["lowIntegrity"] = "low-integrity";
40
- ReadoutListItemDataQuality2["invalid"] = "invalid";
41
- return ReadoutListItemDataQuality2;
42
- })(ReadoutListItemDataQuality || {});
32
+ const ReadoutListItemDataQuality = ReadoutBlockDataQuality;
43
33
  var ReadoutListItemBorder = /* @__PURE__ */ ((ReadoutListItemBorder2) => {
44
34
  ReadoutListItemBorder2["squared"] = "squared";
45
35
  ReadoutListItemBorder2["round"] = "round";
@@ -58,6 +48,7 @@ let ObcReadoutListItem = class extends LitElement {
58
48
  this.hasValue = true;
59
49
  this.value = null;
60
50
  this.off = false;
51
+ this.offText = "OFF";
61
52
  this.hasSetpoint = false;
62
53
  this.hasAdvice = false;
63
54
  this.clickable = false;
@@ -67,11 +58,12 @@ let ObcReadoutListItem = class extends LitElement {
67
58
  this.fractionDigits = 0;
68
59
  this.maxDigits = 0;
69
60
  this.alert = false;
61
+ this.showDebugOverlay = false;
70
62
  this.deferredSetpointHidePhase = "none";
71
63
  this.hasCompletedFirstUpdate = false;
72
64
  }
73
65
  get resolvedSize() {
74
- return this.size ?? "small";
66
+ return this.size ?? ReadoutListItemSize.small;
75
67
  }
76
68
  get resolvedStacking() {
77
69
  return this.stacking ?? "trailing-unit";
@@ -147,9 +139,9 @@ let ObcReadoutListItem = class extends LitElement {
147
139
  /** Primary value-typography size for the current density tier. */
148
140
  get primarySize() {
149
141
  switch (this.resolvedSize) {
150
- case "large":
142
+ case ReadoutListItemSize.large:
151
143
  return ObcTextboxSize.l;
152
- case "medium":
144
+ case ReadoutListItemSize.medium:
153
145
  return ObcTextboxSize.m;
154
146
  default:
155
147
  return ObcTextboxSize.s;
@@ -158,9 +150,9 @@ let ObcReadoutListItem = class extends LitElement {
158
150
  /** Secondary (de-emphasised) value-typography size for the current density tier. */
159
151
  get secondarySize() {
160
152
  switch (this.resolvedSize) {
161
- case "large":
153
+ case ReadoutListItemSize.large:
162
154
  return ObcTextboxSize.s;
163
- case "medium":
155
+ case ReadoutListItemSize.medium:
164
156
  return ObcTextboxSize.s;
165
157
  default:
166
158
  return ObcTextboxSize.xs;
@@ -190,101 +182,53 @@ let ObcReadoutListItem = class extends LitElement {
190
182
  fractionDigits: this.resolvedFractionDigits
191
183
  };
192
184
  }
193
- /** Widest possible value string for width reservation (e.g. `"000.0"`). */
194
- get reserverText() {
195
- const maxDigits = this.resolvedMaxDigits;
196
- if (maxDigits <= 0) {
197
- return "";
198
- }
199
- const fractionDigits = this.resolvedFractionDigits;
200
- const integer = "0".repeat(Math.max(maxDigits, 1));
201
- return fractionDigits > 0 ? `${integer}.${"0".repeat(fractionDigits)}` : integer;
202
- }
203
- /**
204
- * Effective width reserver for a numeric block: the wider of the explicit
205
- * `spaceReserver` and the `maxDigits`/`fractionDigits`-derived reserve, so an
206
- * explicit reserver can never reserve *less* than the formatted value needs.
207
- * Under tabular-nums the rendered width is proportional to character count, so
208
- * "wider" compares string length.
209
- */
210
- widerReserver(explicit, derived) {
211
- if (!explicit) {
212
- return derived;
213
- }
214
- if (!derived) {
215
- return explicit;
216
- }
217
- return explicit.length >= derived.length ? explicit : derived;
218
- }
219
185
  /** classMap fragment for a block / source carrying per-block data quality. */
220
186
  dataQualityClasses(dataQuality) {
221
187
  return {
222
- "data-low-integrity": dataQuality === "low-integrity",
223
- "data-invalid": dataQuality === "invalid"
224
- /* invalid */
188
+ "data-low-integrity": dataQuality === ReadoutListItemDataQuality.lowIntegrity,
189
+ "data-invalid": dataQuality === ReadoutListItemDataQuality.invalid
225
190
  };
226
191
  }
227
- renderIcon(role) {
228
- if (role === "value") {
229
- if (!this.valueOptions?.hasIcon) {
230
- return nothing;
231
- }
232
- return html`<span class="block-icon" aria-hidden="true"
233
- ><slot name="value-icon"></slot
234
- ></span>`;
192
+ /**
193
+ * Forward the matching list-item icon slot into the block's single `icon`
194
+ * slot. The variant's default marker lives in `obc-readout-block` and shows
195
+ * when nothing is assigned here (an empty forwarded slot flattens to nothing).
196
+ */
197
+ renderForwardedIcon(variant) {
198
+ if (variant === ReadoutBlockVariant.setpoint) {
199
+ return html`<slot name="setpoint-icon" slot="icon"></slot>`;
235
200
  }
236
- if (role === "setpoint") {
237
- return html`<span class="block-icon" aria-hidden="true">
238
- <slot name="setpoint-icon"><obi-input-right></obi-input-right></slot>
239
- </span>`;
201
+ if (variant === ReadoutBlockVariant.advice) {
202
+ return html`<slot name="advice-icon" slot="icon"></slot>`;
240
203
  }
241
- return html`<span class="block-icon" aria-hidden="true">
242
- <slot name="advice-icon"
243
- ><obi-notification-advice></obi-notification-advice
244
- ></slot>
245
- </span>`;
204
+ return html`<slot name="value-icon" slot="icon"></slot>`;
246
205
  }
247
206
  renderBlock(config) {
248
- const formatOptions = this.numericFormatOptions(this.resolvedMaxDigits);
249
- const valueForFormat = config.value ?? void 0;
250
- const text = config.off ? "OFF" : formatNumericValue(valueForFormat, formatOptions);
251
- const hinted = config.off || !config.hintedZeros ? "" : getHintZeros(valueForFormat, {
252
- ...formatOptions,
253
- minValueLength: formatOptions.minValueLength + formatOptions.fractionDigits
254
- });
255
- const reserver = this.widerReserver(
256
- config.spaceReserver,
257
- this.reserverText
258
- );
259
- const block = html`
260
- <div
261
- class=${classMap({
262
- block: true,
263
- [`block-${config.role}`]: true,
264
- "tone-enhanced": config.enhanced,
265
- ...this.dataQualityClasses(config.dataQuality),
266
- ...config.extraClasses ?? {}
267
- })}
268
- part="block block-${config.role}"
207
+ return html`
208
+ <obc-readout-block
209
+ exportparts="block, block-content, block-text, block-icon, degree"
210
+ .variant=${config.variant}
211
+ .value=${config.value ?? null}
212
+ .size=${this.resolvedSize}
213
+ .valueSize=${config.valueSize}
214
+ .enhanced=${config.enhanced}
215
+ .weight=${config.weight}
216
+ .hasDegree=${config.hasDegree ?? false}
217
+ .hasIcon=${config.hasIcon ?? false}
218
+ .fractionDigits=${this.resolvedFractionDigits}
219
+ .maxDigits=${this.resolvedMaxDigits}
220
+ .hintedZeros=${config.hintedZeros}
221
+ .spaceReserver=${config.spaceReserver}
222
+ .off=${config.off ?? false}
223
+ .offText=${this.offText}
224
+ .touching=${config.touching ?? false}
225
+ .hidePhase=${config.hidePhase ?? ReadoutBlockHidePhase.none}
226
+ .dataQuality=${config.dataQuality}
227
+ .alert=${config.alert ?? false}
269
228
  >
270
- ${this.renderIcon(config.role)}
271
- <span class="block-content">
272
- <obc-textbox
273
- class="block-text"
274
- .size=${config.size}
275
- .fontWeight=${config.weight}
276
- .tabularNums=${true}
277
- >
278
- ${hinted ? html`<span class="hinted-zero" aria-hidden="true"
279
- >${hinted}</span
280
- >` : nothing}${text}
281
- ${reserver ? html`<span slot="length">${reserver}</span>` : nothing}
282
- </obc-textbox>
283
- ${config.hasDegree ? this.renderDegreeGlyph(config.size, { inherit: true }) : nothing}
284
- </span>
285
- </div>
229
+ ${this.renderForwardedIcon(config.variant)}
230
+ </obc-readout-block>
286
231
  `;
287
- return wrapWithAlertFrame(config.alert ?? false, block);
288
232
  }
289
233
  /**
290
234
  * A cap-height `°` column whose width scales with the value size. Used after
@@ -386,17 +330,13 @@ let ObcReadoutListItem = class extends LitElement {
386
330
  }
387
331
  renderValueCluster() {
388
332
  const popUpAtSetpoint = this.isPopUp && this.isAtSetpoint && !this.setpointTouching;
389
- const setpointExtraClasses = {
390
- "is-hiding": popUpAtSetpoint && this.deferredSetpointHidePhase === "hiding",
391
- "is-hidden": popUpAtSetpoint && this.deferredSetpointHidePhase === "hidden",
392
- touching: this.setpointTouching
393
- };
333
+ const setpointHidePhase = !popUpAtSetpoint ? ReadoutBlockHidePhase.none : this.deferredSetpointHidePhase === "hiding" ? ReadoutBlockHidePhase.hiding : this.deferredSetpointHidePhase === "hidden" ? ReadoutBlockHidePhase.hidden : ReadoutBlockHidePhase.none;
394
334
  return html`
395
335
  <div class="value-cluster" part="value-cluster">
396
336
  ${this.hasAdvice ? this.renderBlock({
397
- role: "advice",
337
+ variant: ReadoutBlockVariant.advice,
398
338
  value: this.advice,
399
- size: this.secondarySize,
339
+ valueSize: this.secondarySize,
400
340
  enhanced: false,
401
341
  weight: ObcTextboxFontWeight.regular,
402
342
  hintedZeros: this.adviceOptions?.hintedZeros ?? false,
@@ -406,9 +346,9 @@ let ObcReadoutListItem = class extends LitElement {
406
346
  alert: this.adviceOptions?.alert
407
347
  }) : nothing}
408
348
  ${this.hasSetpoint ? this.renderBlock({
409
- role: "setpoint",
349
+ variant: ReadoutBlockVariant.setpoint,
410
350
  value: this.setpoint,
411
- size: this.setpointSize,
351
+ valueSize: this.setpointSize,
412
352
  // Value and setpoint share the enhanced colour state (both neutral
413
353
  // or both enhanced); the setpoint is bold only while emphasised.
414
354
  enhanced: this.rowEnhanced,
@@ -416,19 +356,21 @@ let ObcReadoutListItem = class extends LitElement {
416
356
  hintedZeros: this.setpointOptions?.hintedZeros ?? false,
417
357
  spaceReserver: this.setpointOptions?.spaceReserver,
418
358
  hasDegree: this.hasDegree ?? false,
419
- extraClasses: setpointExtraClasses,
359
+ touching: this.setpointTouching,
360
+ hidePhase: setpointHidePhase,
420
361
  dataQuality: this.setpointOptions?.dataQuality,
421
362
  alert: this.setpointOptions?.alert
422
363
  }) : nothing}
423
364
  ${this.hasValue ? this.renderBlock({
424
- role: "value",
365
+ variant: ReadoutBlockVariant.value,
425
366
  value: this.value,
426
- size: this.valueSize,
367
+ valueSize: this.valueSize,
427
368
  enhanced: this.rowEnhanced,
428
369
  weight: this.valueWeight,
429
370
  hintedZeros: this.valueOptions?.hintedZeros ?? false,
430
371
  spaceReserver: this.valueOptions?.spaceReserver,
431
372
  off: this.off,
373
+ hasIcon: this.valueOptions?.hasIcon ?? false,
432
374
  dataQuality: this.valueOptions?.dataQuality,
433
375
  alert: this.valueOptions?.alert
434
376
  }) : nothing}
@@ -549,8 +491,8 @@ let ObcReadoutListItem = class extends LitElement {
549
491
  [`size-${this.resolvedSize}`]: true,
550
492
  [`stacking-${this.resolvedStacking}`]: true,
551
493
  [`priority-${this.resolvedPriority}`]: true,
552
- "data-low-integrity": dataQuality === "low-integrity",
553
- "data-invalid": dataQuality === "invalid",
494
+ "data-low-integrity": dataQuality === ReadoutListItemDataQuality.lowIntegrity,
495
+ "data-invalid": dataQuality === ReadoutListItemDataQuality.invalid,
554
496
  "flip-flop": this.isFlipFlop,
555
497
  clickable: Boolean(clickable),
556
498
  [`border-${clickable ? clickable.border : "squared"}`]: Boolean(clickable)
@@ -584,6 +526,9 @@ __decorateClass([
584
526
  __decorateClass([
585
527
  property({ type: Boolean })
586
528
  ], ObcReadoutListItem.prototype, "off", 2);
529
+ __decorateClass([
530
+ property({ type: String })
531
+ ], ObcReadoutListItem.prototype, "offText", 2);
587
532
  __decorateClass([
588
533
  property({ type: Boolean })
589
534
  ], ObcReadoutListItem.prototype, "hasSetpoint", 2);
@@ -644,6 +589,9 @@ __decorateClass([
644
589
  __decorateClass([
645
590
  property({ type: Object })
646
591
  ], ObcReadoutListItem.prototype, "srcOptions", 2);
592
+ __decorateClass([
593
+ property({ type: Boolean, reflect: true })
594
+ ], ObcReadoutListItem.prototype, "showDebugOverlay", 2);
647
595
  __decorateClass([
648
596
  state()
649
597
  ], ObcReadoutListItem.prototype, "deferredSetpointHidePhase", 2);