@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.54 → 2.0.0-next.55
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 +34 -12
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +25 -0
- package/dist/integration-systems/integration-bar/integration-bar.css.js +9 -2
- package/dist/integration-systems/integration-bar/integration-bar.css.js.map +1 -1
- package/dist/navigation-instruments/readout/readout.css.js +5 -1
- package/dist/navigation-instruments/readout/readout.css.js.map +1 -1
- package/dist/navigation-instruments/readout/readout.d.ts.map +1 -1
- package/dist/navigation-instruments/readout/readout.js +1 -0
- package/dist/navigation-instruments/readout/readout.js.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js +2 -5
- 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 -0
- 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 +10 -4
- package/dist/navigation-instruments/readout-list-item/readout-list-item.js.map +1 -1
- package/dist/navigation-instruments/readout-setpoint/readout-setpoint.d.ts +1 -0
- package/dist/navigation-instruments/readout-setpoint/readout-setpoint.d.ts.map +1 -1
- package/dist/navigation-instruments/readout-setpoint/readout-setpoint.js +7 -0
- package/dist/navigation-instruments/readout-setpoint/readout-setpoint.js.map +1 -1
- package/package.json +1 -1
- package/src/integration-systems/integration-bar/integration-bar.css +9 -2
- package/src/navigation-instruments/readout/readout.css +5 -1
- package/src/navigation-instruments/readout/readout.stories.ts +26 -0
- package/src/navigation-instruments/readout/readout.ts +2 -0
- package/src/navigation-instruments/readout-list-item/readout-list-item.css +2 -5
- package/src/navigation-instruments/readout-list-item/readout-list-item.stories.ts +2 -0
- package/src/navigation-instruments/readout-list-item/readout-list-item.ts +10 -4
- package/src/navigation-instruments/readout-setpoint/readout-setpoint.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readout-setpoint.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/readout-setpoint/readout-setpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAKzD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,yCAAyC,CAAC;AACjD,OAAO,KAAK,EACV,gBAAgB,IAAI,wBAAwB,EAC5C,cAAc,IAAI,2BAA2B,EAC9C,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AAOrC,oBAAY,sBAAsB;IAChC,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,oBAAY,mBAAmB;IAC7B,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,oBAAY,qBAAqB;IAC/B,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;IACf,aAAa,mBAAmB;IAChC,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED,oBAAY,mBAAmB;IAC7B,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,iBAAiB,uBAAuB;CACzC;AAED,oBAAY,8BAA8B;IACxC,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAOD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBACa,kBAAmB,SAAQ,UAAU;IACtB,OAAO,EAAE,sBAAsB,CACvB;IACR,YAAY,CAAC,EAAE,2BAA2B,CAAC;IAC3C,SAAS,CAAC,EAAE,wBAAwB,CAAC;IACrC,IAAI,EAAE,mBAAmB,CACvB;IAK5B,eAAe,CAAC,EAAE,8BAA8B,CAAC;IAEvB,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACJ,UAAU,UAAS;IACnC,cAAc,SAAK;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACvB,GAAG,UAAS;IACb,WAAW,SAAM;IAChB,cAAc,UAAS;IACvB,SAAS,UAAS;IAClB,eAAe,UAAS;IACzB,cAAc,SAAK;
|
|
1
|
+
{"version":3,"file":"readout-setpoint.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/readout-setpoint/readout-setpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAKzD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,yCAAyC,CAAC;AACjD,OAAO,KAAK,EACV,gBAAgB,IAAI,wBAAwB,EAC5C,cAAc,IAAI,2BAA2B,EAC9C,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AAOrC,oBAAY,sBAAsB;IAChC,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,oBAAY,mBAAmB;IAC7B,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,oBAAY,qBAAqB;IAC/B,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;IACf,aAAa,mBAAmB;IAChC,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED,oBAAY,mBAAmB;IAC7B,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,iBAAiB,uBAAuB;CACzC;AAED,oBAAY,8BAA8B;IACxC,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAOD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBACa,kBAAmB,SAAQ,UAAU;IACtB,OA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D,OAAO,CAAC,oBAAoB;IA4C5B,OAAO,CAAC,qBAAqB;IAuBpB,MAAM;IAwCf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,kBAAkB,CAAC;KAC5C;CACF"}
|
|
@@ -64,6 +64,7 @@ let ObcReadoutSetpoint = class extends LitElement {
|
|
|
64
64
|
this.hasDegree = false;
|
|
65
65
|
this.showZeroPadding = false;
|
|
66
66
|
this.fractionDigits = 0;
|
|
67
|
+
this.reserveSpaceForIcon = false;
|
|
67
68
|
this.hasAssignedValueIcon = false;
|
|
68
69
|
}
|
|
69
70
|
get resolvedFormat() {
|
|
@@ -276,6 +277,9 @@ let ObcReadoutSetpoint = class extends LitElement {
|
|
|
276
277
|
`;
|
|
277
278
|
}
|
|
278
279
|
renderRegularValueInlineIcon(size) {
|
|
280
|
+
if (!this.reserveSpaceForIcon) {
|
|
281
|
+
return nothing;
|
|
282
|
+
}
|
|
279
283
|
const hideStyle = this.hasAssignedValueIcon ? "" : this.direction === "vertical" ? "visibility:hidden;" : "display:none;";
|
|
280
284
|
return html`
|
|
281
285
|
<div class="icon-container" aria-hidden="true" style=${hideStyle}>
|
|
@@ -476,6 +480,9 @@ __decorateClass([
|
|
|
476
480
|
__decorateClass([
|
|
477
481
|
property({ type: Number })
|
|
478
482
|
], ObcReadoutSetpoint.prototype, "fractionDigits", 2);
|
|
483
|
+
__decorateClass([
|
|
484
|
+
property({ type: Boolean, attribute: false })
|
|
485
|
+
], ObcReadoutSetpoint.prototype, "reserveSpaceForIcon", 2);
|
|
479
486
|
__decorateClass([
|
|
480
487
|
state()
|
|
481
488
|
], ObcReadoutSetpoint.prototype, "hasAssignedValueIcon", 2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readout-setpoint.js","sources":["../../../src/navigation-instruments/readout-setpoint/readout-setpoint.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property, query, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport componentStyle from './readout-setpoint.css?inline';\nimport {customElement} from '../../decorator.js';\nimport '../../components/button/button.js';\nimport '../../icons/icon-notification-advice.js';\nimport type {\n ReadoutDirection as ReadoutSetpointDirection,\n ReadoutVariant as ReadoutSetpointReadoutStyle,\n} from '../readout/readout.js';\nimport {Priority} from '../types.js';\nimport {\n getHintZeros,\n formatNumericValue,\n type ReadoutNumericFormatOptions,\n} from '../readout/readout-formatters.js';\n\nexport enum ReadoutSetpointVariant {\n setpoint = 'setpoint',\n advice = 'advice',\n value = 'value',\n}\n\nexport enum ReadoutSetpointSize {\n small = 'small',\n regular = 'regular',\n medium = 'medium',\n large = 'large',\n}\n\nexport enum ReadoutSetpointFormat {\n regular = 'regular',\n description = 'description',\n range = 'range',\n verticalStack = 'vertical-stack',\n baseline = 'baseline',\n button = 'button',\n}\n\nexport enum ReadoutSetpointMode {\n display = 'display',\n setpoint = 'setpoint',\n setpointTemporary = 'setpoint-temporary',\n}\n\nexport enum ReadoutSetpointValueTypography {\n regular = 'regular',\n medium = 'medium',\n large = 'large',\n}\n\ntype ReadoutValueRenderModel = {\n valueText: string; // formatted value\n hintedText: string; // hinted zeros (used to reserve space or for zero-padding)\n};\n\n/**\n * `<obc-readout-setpoint>` - A readout segment for displaying a value, setpoint, or temporary entry.\n *\n * Renders a leading marker icon and a single value string with optional fixed-width rendering, hinted zero padding, and an optional degree suffix. Use it as a low-level building block when one value segment must be shown separately inside a larger readout.\n *\n * ## Features\n * - Variants: Supports `setpoint`, `advice`, and `value`.\n * - Sizes: Supports `small`, `regular`, `medium`, and `large`.\n * - Formats: Supports `regular`, `description`, `range`, `vertical-stack`, `baseline`, and `button`. Format selects the structural subtype; size is controlled independently via the `size` property.\n * - Mode axis: `mode` controls behavior/typography (`display`, `setpoint`, `setpointTemporary`).\n * - Priority axis: `priority` controls color emphasis (`regular`/`enhanced`).\n * - Width control: `minValueLength` defines the minimum digit count reserved for the formatted numeric value. Longer values expand the segment width naturally.\n * - Hinted zeros: `hasHintedZeros` renders muted leading zeroes that fill the remaining `minValueLength` slots when the formatted value is shorter than the minimum.\n * - Degree suffix: `hasDegree` renders a trailing degree symbol (`°`).\n * - Description line: `type=\"description\"` can render a secondary label below the value by using the `description` property.\n * - Range line: `type=\"range\"` can render a second numeric line below the value by using the `secondaryValue` property.\n * - Vertical stack marker: `type=\"vertical-stack\"` renders a trailing label to the right of the value.\n * - Icon override: A named slot can replace the default leading marker icon.\n *\n * ## Usage Guidelines\n * Use this component when one value segment needs to be rendered inside a larger readout composition. Prefer a higher-level readout container when label, unit, advice, or source content must be arranged together.\n *\n * For fixed-width layouts, set `minValueLength` to the minimum digit count the segment should reserve. Enable `hasHintedZeros` when the reserved leading positions should remain visible as muted zeroes; otherwise the space is preserved without a visible glyph.\n *\n * ## Slots\n *\n * - `icon`: Replaces the default leading marker icon.\n * - `value`: Replaces the formatted value content for `variant=\"value\"`.\n *\n * @slot icon - Replaces the default leading marker icon.\n * @slot value - Replaces the formatted value content for `variant=\"value\"`.\n */\n@customElement('obc-readout-setpoint')\nexport class ObcReadoutSetpoint extends LitElement {\n @property({type: String}) variant: ReadoutSetpointVariant =\n ReadoutSetpointVariant.setpoint;\n @property({type: String}) readoutStyle?: ReadoutSetpointReadoutStyle;\n @property({type: String}) direction?: ReadoutSetpointDirection;\n @property({type: String}) size: ReadoutSetpointSize =\n ReadoutSetpointSize.small;\n @property({\n type: String,\n reflect: true,\n })\n valueTypography?: ReadoutSetpointValueTypography;\n\n @property({type: String}) format?: ReadoutSetpointFormat;\n @property({type: String}) mode?: ReadoutSetpointMode;\n @property({type: String}) priority?: Priority;\n @property({type: Boolean, reflect: true}) hugContent = false;\n @property({type: Number}) minValueLength = 0;\n @property({type: Number}) value?: number;\n @property({type: Number}) secondaryValue?: number;\n @property({type: Boolean}) off = false;\n @property({type: String}) description = '';\n @property({type: Boolean}) hasHintedZeros = false;\n @property({type: Boolean}) hasDegree = false;\n @property({type: Boolean}) showZeroPadding = false;\n @property({type: Number}) fractionDigits = 0;\n\n @state() private hasAssignedValueIcon = false;\n\n @query('slot[name=\"icon\"]') private iconSlot?: HTMLSlotElement;\n\n private get resolvedFormat(): ReadoutSetpointFormat {\n return this.format ?? ReadoutSetpointFormat.regular;\n }\n\n private get resolvedMode(): ReadoutSetpointMode {\n return this.mode ?? ReadoutSetpointMode.display;\n }\n\n private get resolvedStateClass(): string {\n if (this.resolvedMode === ReadoutSetpointMode.setpointTemporary) {\n return 'setpoint-temporary';\n }\n if (this.resolvedMode === ReadoutSetpointMode.setpoint) {\n return 'setpoint';\n }\n return (this.priority ?? Priority.regular) === Priority.enhanced\n ? 'enhanced'\n : 'enabled';\n }\n\n private get resolvedHasDegree(): boolean {\n return this.hasDegree && !this.off;\n }\n\n private get resolvedSize(): ReadoutSetpointSize {\n return this.size;\n }\n\n private get resolvedInlineSize(): ReadoutSetpointSize {\n const format = this.resolvedFormat;\n const canPromoteToLarge =\n format !== ReadoutSetpointFormat.description &&\n format !== ReadoutSetpointFormat.range;\n\n if (\n this.direction === 'horizontal' &&\n canPromoteToLarge &&\n (this.readoutStyle === 'enhanced' || this.readoutStyle === 'stack') &&\n (this.resolvedSize === ReadoutSetpointSize.regular ||\n this.resolvedSize === ReadoutSetpointSize.medium)\n ) {\n return ReadoutSetpointSize.large;\n }\n\n return this.resolvedSize;\n }\n\n private get resolvedValueVariantSize(): ReadoutSetpointSize {\n if (this.readoutStyle === 'enhanced' || this.readoutStyle === 'stack') {\n return ReadoutSetpointSize.large;\n }\n\n if (this.readoutStyle === 'regular') {\n return this.resolvedInlineSize;\n }\n\n if (this.readoutStyle) {\n return ReadoutSetpointSize.medium;\n }\n\n return this.resolvedInlineSize;\n }\n\n private get resolvedVariantSize(): ReadoutSetpointSize {\n if (this.variant === ReadoutSetpointVariant.value) {\n return this.resolvedValueVariantSize;\n }\n\n return this.resolvedInlineSize;\n }\n\n private getValueVariantRenderModel(\n value: number | undefined\n ): ReadoutValueRenderModel {\n const numericFormatOptions: ReadoutNumericFormatOptions = {\n showZeroPadding: this.showZeroPadding,\n minValueLength: this.minValueLength,\n fractionDigits: this.fractionDigits,\n };\n const formattedText = formatNumericValue(value, numericFormatOptions);\n const hintedText = getHintZeros(value, numericFormatOptions);\n\n return {\n hintedText,\n valueText: formattedText,\n };\n }\n\n private get valueVariantRenderModel(): ReadoutValueRenderModel {\n return this.getValueVariantRenderModel(this.value);\n }\n\n private get secondaryValueVariantRenderModel(): string {\n return this.getValueVariantRenderModel(this.secondaryValue).valueText;\n }\n\n private renderSetpointIcon() {\n return html`\n <slot\n name=\"icon\"\n @slotchange=${(event: Event) => {\n this.hasAssignedValueIcon =\n ((event.target as HTMLSlotElement).assignedElements({\n flatten: true,\n }).length ?? 0) > 0;\n }}\n ></slot>\n ${this.variant === ReadoutSetpointVariant.advice &&\n !this.hasAssignedValueIcon\n ? html`<obi-notification-advice></obi-notification-advice>`\n : nothing}\n `;\n }\n\n override firstUpdated() {\n this.hasAssignedValueIcon =\n (this.iconSlot?.assignedElements({flatten: true}).length ?? 0) > 0;\n }\n\n private get toneAccent() {\n if (this.priority === Priority.enhanced) {\n return true;\n }\n\n if (this.priority === Priority.regular) {\n return false;\n }\n\n if (this.variant === ReadoutSetpointVariant.value) {\n if (this.readoutStyle) {\n return (\n this.hasAttribute('data-obc-priority-scoped') &&\n this.priority === Priority.enhanced\n );\n }\n\n return true;\n }\n\n return this.priority === Priority.enhanced;\n }\n\n private get wrapperBaseClasses() {\n return {\n 'readout-setpoint-wrapper': true,\n [`variant-${this.variant}`]: true,\n 'tone-accent': this.toneAccent,\n [`direction-${this.direction}`]: Boolean(this.direction),\n [`readout-style-${this.readoutStyle}`]: Boolean(this.readoutStyle),\n [this.resolvedSize]: true,\n [`type-${this.resolvedFormat}`]: true,\n [`state-${this.resolvedStateClass}`]: true,\n 'no-hug-content': !this.hugContent,\n };\n }\n\n private get setpointValueClasses() {\n return {\n 'setpoint-value': true,\n [this.resolvedVariantSize]: true,\n 'has-fixed-length': this.minValueLength > 1,\n };\n }\n\n private renderValueVariantIcon() {\n return html`\n <div\n class=${classMap({\n 'icon-container': true,\n hidden: !this.hasAssignedValueIcon,\n })}\n aria-hidden=\"true\"\n >\n <div\n class=${classMap({\n 'setpoint-linear': true,\n [this.resolvedVariantSize]: true,\n })}\n >\n <slot\n name=\"icon\"\n @slotchange=${(event: Event) => {\n this.hasAssignedValueIcon =\n ((event.target as HTMLSlotElement).assignedElements({\n flatten: true,\n }).length ?? 0) > 0;\n }}\n ></slot>\n </div>\n </div>\n `;\n }\n\n private renderValueTextContent({\n hintedText,\n valueText,\n }: ReadoutValueRenderModel) {\n if (this.off) {\n return html`\n <span class=\"value-layer\">\n <span class=\"value\">OFF</span>\n </span>\n `;\n }\n\n let hasZeroPadding = true;\n if (hintedText === '') {\n hasZeroPadding = false;\n } else if (\n this.hugContent &&\n !this.hasHintedZeros &&\n this.variant !== ReadoutSetpointVariant.value\n ) {\n // TODO: Make a shadow element that reserve space the minimum value length.\n hasZeroPadding = false;\n }\n\n return html`\n <span class=\"value-layer\">\n ${hasZeroPadding\n ? html`<span\n class=${classMap({\n 'hinted-zero': true,\n 'is-hidden': !this.hasHintedZeros,\n })}\n aria-hidden=\"true\"\n >${hintedText}</span\n >`\n : nothing}\n <span class=\"value\">${valueText}</span>\n </span>\n `;\n }\n\n private renderValueVariantComponent() {\n const size = this.resolvedVariantSize;\n const valueModel = this.valueVariantRenderModel;\n\n return html`\n <div\n class=${classMap({\n 'readout-setpoint-wrapper': true,\n 'variant-value': true,\n 'tone-accent': this.toneAccent,\n [`direction-${this.direction}`]: Boolean(this.direction),\n [`readout-style-${this.readoutStyle}`]: Boolean(this.readoutStyle),\n [`state-${this.resolvedStateClass}`]: true,\n [size]: true,\n })}\n >\n ${this.renderValueVariantIcon()}\n <span\n class=${classMap({\n 'variant-value-content': true,\n [size]: true,\n 'with-degree': this.resolvedHasDegree,\n })}\n part=\"variant-value-content\"\n >\n <span class=\"value-content-container\" part=\"value-content-container\">\n <slot name=\"value\">\n ${this.renderValueTextContent(valueModel)}\n </slot>\n ${this.resolvedHasDegree\n ? html`<span class=\"degree\">°</span>`\n : nothing}\n </span>\n </span>\n </div>\n `;\n }\n\n private renderRegularValueInlineIcon(size: ReadoutSetpointSize) {\n const hideStyle = this.hasAssignedValueIcon\n ? ''\n : this.direction === 'vertical'\n ? 'visibility:hidden;'\n : 'display:none;';\n\n return html`\n <div class=\"icon-container\" aria-hidden=\"true\" style=${hideStyle}>\n <div\n class=${classMap({\n 'setpoint-linear': true,\n [size]: true,\n })}\n >\n <slot\n name=\"icon\"\n @slotchange=${(event: Event) => {\n this.hasAssignedValueIcon =\n ((event.target as HTMLSlotElement).assignedElements({\n flatten: true,\n }).length ?? 0) > 0;\n }}\n ></slot>\n </div>\n </div>\n `;\n }\n\n private renderRegularVerticalReadoutValueLikeInline() {\n const size = this.resolvedInlineSize;\n const valueModel = this.valueVariantRenderModel;\n\n return html`\n <div\n class=${classMap({\n 'readout-setpoint-wrapper': true,\n 'tone-accent': this.toneAccent,\n [`direction-${this.direction}`]: Boolean(this.direction),\n [`readout-style-${this.readoutStyle}`]: Boolean(this.readoutStyle),\n [`state-${this.resolvedStateClass}`]: true,\n [size]: true,\n [`type-${this.resolvedFormat}`]: true,\n 'no-hug-content': !this.hugContent,\n })}\n >\n ${this.renderRegularValueInlineIcon(size)}\n <div\n class=${classMap({\n 'setpoint-value': true,\n [size]: true,\n 'with-degree': this.resolvedHasDegree,\n })}\n >\n <span class=\"value-content-container\">\n ${this.renderValueTextContent(valueModel)}\n ${this.resolvedHasDegree\n ? html`<span class=\"degree\">°</span>`\n : nothing}\n </span>\n </div>\n </div>\n `;\n }\n\n private renderValueComponent() {\n const format = this.resolvedFormat;\n const valueModel = this.valueVariantRenderModel;\n const showsDescription =\n format === ReadoutSetpointFormat.description &&\n this.description.trim().length > 0;\n const showsVerticalStackLabel =\n format === ReadoutSetpointFormat.verticalStack &&\n this.description.trim().length > 0;\n const resolvedSecondaryValue = this.secondaryValueVariantRenderModel;\n const showsSecondaryValue =\n format === ReadoutSetpointFormat.range &&\n resolvedSecondaryValue.length > 0;\n return html`\n <span class=\"value-content-container\">\n ${this.renderValueTextContent(valueModel)}\n ${this.resolvedHasDegree\n ? html`<span class=\"degree\">°</span>`\n : nothing}\n </span>\n ${showsDescription\n ? html`\n <span class=\"description-box\">\n <span class=\"description\">${this.description}</span>\n </span>\n `\n : nothing}\n ${showsSecondaryValue\n ? html`\n <span class=\"secondary-value-box\">\n <span class=\"secondary-value\">${resolvedSecondaryValue}</span>\n </span>\n `\n : nothing}\n ${showsVerticalStackLabel\n ? html`\n <span class=\"vertical-stack-label-box\">\n <span class=\"vertical-stack-label\">${this.description}</span>\n </span>\n `\n : nothing}\n `;\n }\n\n private renderButtonComponent() {\n return html`\n <obc-button\n class=\"readout-setpoint-button\"\n variant=\"flat\"\n .fullWidth=${false}\n ?showLeadingIcon=${this.hasAssignedValueIcon}\n >\n <span slot=\"leading-icon\" class=\"readout-setpoint-button-icon\">\n ${this.renderSetpointIcon()}\n </span>\n <span\n class=${classMap({\n ...this.setpointValueClasses,\n 'with-degree': this.resolvedHasDegree,\n })}\n >\n ${this.renderValueComponent()}\n </span>\n </obc-button>\n `;\n }\n\n override render() {\n if (this.variant === ReadoutSetpointVariant.value) {\n if (this.readoutStyle === 'regular') {\n return this.renderRegularVerticalReadoutValueLikeInline();\n }\n return this.renderValueVariantComponent();\n }\n\n if (this.resolvedFormat === ReadoutSetpointFormat.button) {\n return html`\n <div class=${classMap(this.wrapperBaseClasses)}>\n ${this.renderButtonComponent()}\n </div>\n `;\n }\n\n return html`\n <div class=${classMap(this.wrapperBaseClasses)}>\n <div class=\"icon-container\" aria-hidden=\"true\">\n <div\n class=${classMap({\n 'setpoint-linear': true,\n [this.resolvedVariantSize]: true,\n })}\n >\n ${this.renderSetpointIcon()}\n </div>\n </div>\n <div\n class=${classMap({\n ...this.setpointValueClasses,\n 'with-degree': this.resolvedHasDegree,\n })}\n >\n ${this.renderValueComponent()}\n </div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-readout-setpoint': ObcReadoutSetpoint;\n }\n}\n"],"names":["ReadoutSetpointVariant","ReadoutSetpointSize","ReadoutSetpointFormat","ReadoutSetpointMode","ReadoutSetpointValueTypography"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBO,IAAK,2CAAAA,4BAAL;AACLA,0BAAA,UAAA,IAAW;AACXA,0BAAA,QAAA,IAAS;AACTA,0BAAA,OAAA,IAAQ;AAHE,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;AAML,IAAK,wCAAAC,yBAAL;AACLA,uBAAA,OAAA,IAAQ;AACRA,uBAAA,SAAA,IAAU;AACVA,uBAAA,QAAA,IAAS;AACTA,uBAAA,OAAA,IAAQ;AAJE,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAOL,IAAK,0CAAAC,2BAAL;AACLA,yBAAA,SAAA,IAAU;AACVA,yBAAA,aAAA,IAAc;AACdA,yBAAA,OAAA,IAAQ;AACRA,yBAAA,eAAA,IAAgB;AAChBA,yBAAA,UAAA,IAAW;AACXA,yBAAA,QAAA,IAAS;AANC,SAAAA;AAAA,GAAA,yBAAA,CAAA,CAAA;AASL,IAAK,wCAAAC,yBAAL;AACLA,uBAAA,SAAA,IAAU;AACVA,uBAAA,UAAA,IAAW;AACXA,uBAAA,mBAAA,IAAoB;AAHV,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAML,IAAK,mDAAAC,oCAAL;AACLA,kCAAA,SAAA,IAAU;AACVA,kCAAA,QAAA,IAAS;AACTA,kCAAA,OAAA,IAAQ;AAHE,SAAAA;AAAA,GAAA,kCAAA,CAAA,CAAA;AA4CL,IAAM,qBAAN,cAAiC,WAAW;AAAA,EAA5C,cAAA;AAAA,UAAA,GAAA,SAAA;AACq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MAAM,OAAA,CAAO;AAAA,GAnBb,mBAmBe,WAAA,kBAAA,CAAA;AACC,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GApBd,mBAoBgB,WAAA,OAAA,CAAA;AACD,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GArBb,mBAqBe,WAAA,eAAA,CAAA;AACC,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAtBd,mBAsBgB,WAAA,kBAAA,CAAA;AACA,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAvBd,mBAuBgB,WAAA,aAAA,CAAA;AACA,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAxBd,mBAwBgB,WAAA,mBAAA,CAAA;AACD,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAzBb,mBAyBe,WAAA,kBAAA,CAAA;AAET,gBAAA;AAAA,EAAhB,MAAA;AAAM,GA3BI,mBA2BM,WAAA,wBAAA,CAAA;AAEmB,gBAAA;AAAA,EAAnC,MAAM,mBAAmB;AAAA,GA7Bf,mBA6ByB,WAAA,YAAA,CAAA;AA7BzB,qBAAN,gBAAA;AAAA,EADN,cAAc,sBAAsB;AAAA,GACxB,kBAAA;"}
|
|
1
|
+
{"version":3,"file":"readout-setpoint.js","sources":["../../../src/navigation-instruments/readout-setpoint/readout-setpoint.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property, query, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport componentStyle from './readout-setpoint.css?inline';\nimport {customElement} from '../../decorator.js';\nimport '../../components/button/button.js';\nimport '../../icons/icon-notification-advice.js';\nimport type {\n ReadoutDirection as ReadoutSetpointDirection,\n ReadoutVariant as ReadoutSetpointReadoutStyle,\n} from '../readout/readout.js';\nimport {Priority} from '../types.js';\nimport {\n getHintZeros,\n formatNumericValue,\n type ReadoutNumericFormatOptions,\n} from '../readout/readout-formatters.js';\n\nexport enum ReadoutSetpointVariant {\n setpoint = 'setpoint',\n advice = 'advice',\n value = 'value',\n}\n\nexport enum ReadoutSetpointSize {\n small = 'small',\n regular = 'regular',\n medium = 'medium',\n large = 'large',\n}\n\nexport enum ReadoutSetpointFormat {\n regular = 'regular',\n description = 'description',\n range = 'range',\n verticalStack = 'vertical-stack',\n baseline = 'baseline',\n button = 'button',\n}\n\nexport enum ReadoutSetpointMode {\n display = 'display',\n setpoint = 'setpoint',\n setpointTemporary = 'setpoint-temporary',\n}\n\nexport enum ReadoutSetpointValueTypography {\n regular = 'regular',\n medium = 'medium',\n large = 'large',\n}\n\ntype ReadoutValueRenderModel = {\n valueText: string; // formatted value\n hintedText: string; // hinted zeros (used to reserve space or for zero-padding)\n};\n\n/**\n * `<obc-readout-setpoint>` - A readout segment for displaying a value, setpoint, or temporary entry.\n *\n * Renders a leading marker icon and a single value string with optional fixed-width rendering, hinted zero padding, and an optional degree suffix. Use it as a low-level building block when one value segment must be shown separately inside a larger readout.\n *\n * ## Features\n * - Variants: Supports `setpoint`, `advice`, and `value`.\n * - Sizes: Supports `small`, `regular`, `medium`, and `large`.\n * - Formats: Supports `regular`, `description`, `range`, `vertical-stack`, `baseline`, and `button`. Format selects the structural subtype; size is controlled independently via the `size` property.\n * - Mode axis: `mode` controls behavior/typography (`display`, `setpoint`, `setpointTemporary`).\n * - Priority axis: `priority` controls color emphasis (`regular`/`enhanced`).\n * - Width control: `minValueLength` defines the minimum digit count reserved for the formatted numeric value. Longer values expand the segment width naturally.\n * - Hinted zeros: `hasHintedZeros` renders muted leading zeroes that fill the remaining `minValueLength` slots when the formatted value is shorter than the minimum.\n * - Degree suffix: `hasDegree` renders a trailing degree symbol (`°`).\n * - Description line: `type=\"description\"` can render a secondary label below the value by using the `description` property.\n * - Range line: `type=\"range\"` can render a second numeric line below the value by using the `secondaryValue` property.\n * - Vertical stack marker: `type=\"vertical-stack\"` renders a trailing label to the right of the value.\n * - Icon override: A named slot can replace the default leading marker icon.\n *\n * ## Usage Guidelines\n * Use this component when one value segment needs to be rendered inside a larger readout composition. Prefer a higher-level readout container when label, unit, advice, or source content must be arranged together.\n *\n * For fixed-width layouts, set `minValueLength` to the minimum digit count the segment should reserve. Enable `hasHintedZeros` when the reserved leading positions should remain visible as muted zeroes; otherwise the space is preserved without a visible glyph.\n *\n * ## Slots\n *\n * - `icon`: Replaces the default leading marker icon.\n * - `value`: Replaces the formatted value content for `variant=\"value\"`.\n *\n * @slot icon - Replaces the default leading marker icon.\n * @slot value - Replaces the formatted value content for `variant=\"value\"`.\n */\n@customElement('obc-readout-setpoint')\nexport class ObcReadoutSetpoint extends LitElement {\n @property({type: String}) variant: ReadoutSetpointVariant =\n ReadoutSetpointVariant.setpoint;\n @property({type: String}) readoutStyle?: ReadoutSetpointReadoutStyle;\n @property({type: String}) direction?: ReadoutSetpointDirection;\n @property({type: String}) size: ReadoutSetpointSize =\n ReadoutSetpointSize.small;\n @property({\n type: String,\n reflect: true,\n })\n valueTypography?: ReadoutSetpointValueTypography;\n\n @property({type: String}) format?: ReadoutSetpointFormat;\n @property({type: String}) mode?: ReadoutSetpointMode;\n @property({type: String}) priority?: Priority;\n @property({type: Boolean, reflect: true}) hugContent = false;\n @property({type: Number}) minValueLength = 0;\n @property({type: Number}) value?: number;\n @property({type: Number}) secondaryValue?: number;\n @property({type: Boolean}) off = false;\n @property({type: String}) description = '';\n @property({type: Boolean}) hasHintedZeros = false;\n @property({type: Boolean}) hasDegree = false;\n @property({type: Boolean}) showZeroPadding = false;\n @property({type: Number}) fractionDigits = 0;\n @property({type: Boolean, attribute: false}) reserveSpaceForIcon = false;\n\n @state() private hasAssignedValueIcon = false;\n\n @query('slot[name=\"icon\"]') private iconSlot?: HTMLSlotElement;\n\n private get resolvedFormat(): ReadoutSetpointFormat {\n return this.format ?? ReadoutSetpointFormat.regular;\n }\n\n private get resolvedMode(): ReadoutSetpointMode {\n return this.mode ?? ReadoutSetpointMode.display;\n }\n\n private get resolvedStateClass(): string {\n if (this.resolvedMode === ReadoutSetpointMode.setpointTemporary) {\n return 'setpoint-temporary';\n }\n if (this.resolvedMode === ReadoutSetpointMode.setpoint) {\n return 'setpoint';\n }\n return (this.priority ?? Priority.regular) === Priority.enhanced\n ? 'enhanced'\n : 'enabled';\n }\n\n private get resolvedHasDegree(): boolean {\n return this.hasDegree && !this.off;\n }\n\n private get resolvedSize(): ReadoutSetpointSize {\n return this.size;\n }\n\n private get resolvedInlineSize(): ReadoutSetpointSize {\n const format = this.resolvedFormat;\n const canPromoteToLarge =\n format !== ReadoutSetpointFormat.description &&\n format !== ReadoutSetpointFormat.range;\n\n if (\n this.direction === 'horizontal' &&\n canPromoteToLarge &&\n (this.readoutStyle === 'enhanced' || this.readoutStyle === 'stack') &&\n (this.resolvedSize === ReadoutSetpointSize.regular ||\n this.resolvedSize === ReadoutSetpointSize.medium)\n ) {\n return ReadoutSetpointSize.large;\n }\n\n return this.resolvedSize;\n }\n\n private get resolvedValueVariantSize(): ReadoutSetpointSize {\n if (this.readoutStyle === 'enhanced' || this.readoutStyle === 'stack') {\n return ReadoutSetpointSize.large;\n }\n\n if (this.readoutStyle === 'regular') {\n return this.resolvedInlineSize;\n }\n\n if (this.readoutStyle) {\n return ReadoutSetpointSize.medium;\n }\n\n return this.resolvedInlineSize;\n }\n\n private get resolvedVariantSize(): ReadoutSetpointSize {\n if (this.variant === ReadoutSetpointVariant.value) {\n return this.resolvedValueVariantSize;\n }\n\n return this.resolvedInlineSize;\n }\n\n private getValueVariantRenderModel(\n value: number | undefined\n ): ReadoutValueRenderModel {\n const numericFormatOptions: ReadoutNumericFormatOptions = {\n showZeroPadding: this.showZeroPadding,\n minValueLength: this.minValueLength,\n fractionDigits: this.fractionDigits,\n };\n const formattedText = formatNumericValue(value, numericFormatOptions);\n const hintedText = getHintZeros(value, numericFormatOptions);\n\n return {\n hintedText,\n valueText: formattedText,\n };\n }\n\n private get valueVariantRenderModel(): ReadoutValueRenderModel {\n return this.getValueVariantRenderModel(this.value);\n }\n\n private get secondaryValueVariantRenderModel(): string {\n return this.getValueVariantRenderModel(this.secondaryValue).valueText;\n }\n\n private renderSetpointIcon() {\n return html`\n <slot\n name=\"icon\"\n @slotchange=${(event: Event) => {\n this.hasAssignedValueIcon =\n ((event.target as HTMLSlotElement).assignedElements({\n flatten: true,\n }).length ?? 0) > 0;\n }}\n ></slot>\n ${this.variant === ReadoutSetpointVariant.advice &&\n !this.hasAssignedValueIcon\n ? html`<obi-notification-advice></obi-notification-advice>`\n : nothing}\n `;\n }\n\n override firstUpdated() {\n this.hasAssignedValueIcon =\n (this.iconSlot?.assignedElements({flatten: true}).length ?? 0) > 0;\n }\n\n private get toneAccent() {\n if (this.priority === Priority.enhanced) {\n return true;\n }\n\n if (this.priority === Priority.regular) {\n return false;\n }\n\n if (this.variant === ReadoutSetpointVariant.value) {\n if (this.readoutStyle) {\n return (\n this.hasAttribute('data-obc-priority-scoped') &&\n this.priority === Priority.enhanced\n );\n }\n\n return true;\n }\n\n return this.priority === Priority.enhanced;\n }\n\n private get wrapperBaseClasses() {\n return {\n 'readout-setpoint-wrapper': true,\n [`variant-${this.variant}`]: true,\n 'tone-accent': this.toneAccent,\n [`direction-${this.direction}`]: Boolean(this.direction),\n [`readout-style-${this.readoutStyle}`]: Boolean(this.readoutStyle),\n [this.resolvedSize]: true,\n [`type-${this.resolvedFormat}`]: true,\n [`state-${this.resolvedStateClass}`]: true,\n 'no-hug-content': !this.hugContent,\n };\n }\n\n private get setpointValueClasses() {\n return {\n 'setpoint-value': true,\n [this.resolvedVariantSize]: true,\n 'has-fixed-length': this.minValueLength > 1,\n };\n }\n\n private renderValueVariantIcon() {\n return html`\n <div\n class=${classMap({\n 'icon-container': true,\n hidden: !this.hasAssignedValueIcon,\n })}\n aria-hidden=\"true\"\n >\n <div\n class=${classMap({\n 'setpoint-linear': true,\n [this.resolvedVariantSize]: true,\n })}\n >\n <slot\n name=\"icon\"\n @slotchange=${(event: Event) => {\n this.hasAssignedValueIcon =\n ((event.target as HTMLSlotElement).assignedElements({\n flatten: true,\n }).length ?? 0) > 0;\n }}\n ></slot>\n </div>\n </div>\n `;\n }\n\n private renderValueTextContent({\n hintedText,\n valueText,\n }: ReadoutValueRenderModel) {\n if (this.off) {\n return html`\n <span class=\"value-layer\">\n <span class=\"value\">OFF</span>\n </span>\n `;\n }\n\n let hasZeroPadding = true;\n if (hintedText === '') {\n hasZeroPadding = false;\n } else if (\n this.hugContent &&\n !this.hasHintedZeros &&\n this.variant !== ReadoutSetpointVariant.value\n ) {\n // TODO: Make a shadow element that reserve space the minimum value length.\n hasZeroPadding = false;\n }\n\n return html`\n <span class=\"value-layer\">\n ${hasZeroPadding\n ? html`<span\n class=${classMap({\n 'hinted-zero': true,\n 'is-hidden': !this.hasHintedZeros,\n })}\n aria-hidden=\"true\"\n >${hintedText}</span\n >`\n : nothing}\n <span class=\"value\">${valueText}</span>\n </span>\n `;\n }\n\n private renderValueVariantComponent() {\n const size = this.resolvedVariantSize;\n const valueModel = this.valueVariantRenderModel;\n\n return html`\n <div\n class=${classMap({\n 'readout-setpoint-wrapper': true,\n 'variant-value': true,\n 'tone-accent': this.toneAccent,\n [`direction-${this.direction}`]: Boolean(this.direction),\n [`readout-style-${this.readoutStyle}`]: Boolean(this.readoutStyle),\n [`state-${this.resolvedStateClass}`]: true,\n [size]: true,\n })}\n >\n ${this.renderValueVariantIcon()}\n <span\n class=${classMap({\n 'variant-value-content': true,\n [size]: true,\n 'with-degree': this.resolvedHasDegree,\n })}\n part=\"variant-value-content\"\n >\n <span class=\"value-content-container\" part=\"value-content-container\">\n <slot name=\"value\">\n ${this.renderValueTextContent(valueModel)}\n </slot>\n ${this.resolvedHasDegree\n ? html`<span class=\"degree\">°</span>`\n : nothing}\n </span>\n </span>\n </div>\n `;\n }\n\n private renderRegularValueInlineIcon(size: ReadoutSetpointSize) {\n if (!this.reserveSpaceForIcon) {\n return nothing;\n }\n const hideStyle = this.hasAssignedValueIcon\n ? ''\n : this.direction === 'vertical'\n ? 'visibility:hidden;'\n : 'display:none;';\n\n return html`\n <div class=\"icon-container\" aria-hidden=\"true\" style=${hideStyle}>\n <div\n class=${classMap({\n 'setpoint-linear': true,\n [size]: true,\n })}\n >\n <slot\n name=\"icon\"\n @slotchange=${(event: Event) => {\n this.hasAssignedValueIcon =\n ((event.target as HTMLSlotElement).assignedElements({\n flatten: true,\n }).length ?? 0) > 0;\n }}\n ></slot>\n </div>\n </div>\n `;\n }\n\n private renderRegularVerticalReadoutValueLikeInline() {\n const size = this.resolvedInlineSize;\n const valueModel = this.valueVariantRenderModel;\n\n return html`\n <div\n class=${classMap({\n 'readout-setpoint-wrapper': true,\n 'tone-accent': this.toneAccent,\n [`direction-${this.direction}`]: Boolean(this.direction),\n [`readout-style-${this.readoutStyle}`]: Boolean(this.readoutStyle),\n [`state-${this.resolvedStateClass}`]: true,\n [size]: true,\n [`type-${this.resolvedFormat}`]: true,\n 'no-hug-content': !this.hugContent,\n })}\n >\n ${this.renderRegularValueInlineIcon(size)}\n <div\n class=${classMap({\n 'setpoint-value': true,\n [size]: true,\n 'with-degree': this.resolvedHasDegree,\n })}\n >\n <span class=\"value-content-container\">\n ${this.renderValueTextContent(valueModel)}\n ${this.resolvedHasDegree\n ? html`<span class=\"degree\">°</span>`\n : nothing}\n </span>\n </div>\n </div>\n `;\n }\n\n private renderValueComponent() {\n const format = this.resolvedFormat;\n const valueModel = this.valueVariantRenderModel;\n const showsDescription =\n format === ReadoutSetpointFormat.description &&\n this.description.trim().length > 0;\n const showsVerticalStackLabel =\n format === ReadoutSetpointFormat.verticalStack &&\n this.description.trim().length > 0;\n const resolvedSecondaryValue = this.secondaryValueVariantRenderModel;\n const showsSecondaryValue =\n format === ReadoutSetpointFormat.range &&\n resolvedSecondaryValue.length > 0;\n return html`\n <span class=\"value-content-container\">\n ${this.renderValueTextContent(valueModel)}\n ${this.resolvedHasDegree\n ? html`<span class=\"degree\">°</span>`\n : nothing}\n </span>\n ${showsDescription\n ? html`\n <span class=\"description-box\">\n <span class=\"description\">${this.description}</span>\n </span>\n `\n : nothing}\n ${showsSecondaryValue\n ? html`\n <span class=\"secondary-value-box\">\n <span class=\"secondary-value\">${resolvedSecondaryValue}</span>\n </span>\n `\n : nothing}\n ${showsVerticalStackLabel\n ? html`\n <span class=\"vertical-stack-label-box\">\n <span class=\"vertical-stack-label\">${this.description}</span>\n </span>\n `\n : nothing}\n `;\n }\n\n private renderButtonComponent() {\n return html`\n <obc-button\n class=\"readout-setpoint-button\"\n variant=\"flat\"\n .fullWidth=${false}\n ?showLeadingIcon=${this.hasAssignedValueIcon}\n >\n <span slot=\"leading-icon\" class=\"readout-setpoint-button-icon\">\n ${this.renderSetpointIcon()}\n </span>\n <span\n class=${classMap({\n ...this.setpointValueClasses,\n 'with-degree': this.resolvedHasDegree,\n })}\n >\n ${this.renderValueComponent()}\n </span>\n </obc-button>\n `;\n }\n\n override render() {\n if (this.variant === ReadoutSetpointVariant.value) {\n if (this.readoutStyle === 'regular') {\n return this.renderRegularVerticalReadoutValueLikeInline();\n }\n return this.renderValueVariantComponent();\n }\n\n if (this.resolvedFormat === ReadoutSetpointFormat.button) {\n return html`\n <div class=${classMap(this.wrapperBaseClasses)}>\n ${this.renderButtonComponent()}\n </div>\n `;\n }\n\n return html`\n <div class=${classMap(this.wrapperBaseClasses)}>\n <div class=\"icon-container\" aria-hidden=\"true\">\n <div\n class=${classMap({\n 'setpoint-linear': true,\n [this.resolvedVariantSize]: true,\n })}\n >\n ${this.renderSetpointIcon()}\n </div>\n </div>\n <div\n class=${classMap({\n ...this.setpointValueClasses,\n 'with-degree': this.resolvedHasDegree,\n })}\n >\n ${this.renderValueComponent()}\n </div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-readout-setpoint': ObcReadoutSetp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AM,QAAA,CAAQ;AAAA,GApBd,mBAoBgB,WAAA,OAAA,CAAA;AACD,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GArBb,mBAqBe,WAAA,eAAA,CAAA;AACC,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAtBd,mBAsBgB,WAAA,kBAAA,CAAA;AACA,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAvBd,mBAuBgB,WAAA,aAAA,CAAA;AACA,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAxBd,mBAwBgB,WAAA,mBAAA,CAAA;AACD,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAzBb,mBAyBe,WAAA,kBAAA,CAAA;AACmB,gBAAA;AAAA,EAA5C,SAAS,EAAC,MAAM,SAAS,WAAW,OAAM;AAAA,GA1BhC,mBA0BkC,WAAA,uBAAA,CAAA;AAE5B,gBAAA;AAAA,EAAhB,MAAA;AAAM,GA5BI,mBA4BM,WAAA,wBAAA,CAAA;AAEmB,gBAAA;AAAA,EAAnC,MAAM,mBAAmB;AAAA,GA9Bf,mBA8ByB,WAAA,YAAA,CAAA;AA9BzB,qBAAN,gBAAA;AAAA,EADN,cAAc,sBAAsB;AAAA,GACxB,kBAAA;"}
|
package/package.json
CHANGED
|
@@ -37,14 +37,21 @@
|
|
|
37
37
|
flex: 1 1 auto;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
.integration-buttons-slot::slotted(
|
|
40
|
+
.integration-buttons-slot::slotted(*) {
|
|
41
|
+
display: flex;
|
|
41
42
|
flex: 1;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
.hug-buttons-slot::slotted(
|
|
45
|
+
.hug-buttons-slot::slotted(*) {
|
|
46
|
+
display: flex;
|
|
45
47
|
flex: 0 1 auto;
|
|
46
48
|
}
|
|
47
49
|
|
|
50
|
+
.hug-buttons-slot,
|
|
51
|
+
.integration-buttons-slot {
|
|
52
|
+
display: contents;
|
|
53
|
+
}
|
|
54
|
+
|
|
48
55
|
.home-button,
|
|
49
56
|
.link-button {
|
|
50
57
|
width: var(--app-components-integration-system-icon-button-touch-target);
|
|
@@ -394,8 +394,12 @@
|
|
|
394
394
|
margin-left: 0;
|
|
395
395
|
}
|
|
396
396
|
|
|
397
|
-
.readout.
|
|
397
|
+
.readout.vertical.alignment-center {
|
|
398
398
|
justify-items: center;
|
|
399
|
+
|
|
400
|
+
> * {
|
|
401
|
+
justify-self: center !important;
|
|
402
|
+
}
|
|
399
403
|
}
|
|
400
404
|
|
|
401
405
|
.readout.stack.vertical.alignment-center
|
|
@@ -40,6 +40,11 @@ const meta: Meta<ObcReadout> = {
|
|
|
40
40
|
direction: ReadoutDirection.vertical,
|
|
41
41
|
},
|
|
42
42
|
argTypes: {
|
|
43
|
+
value: {
|
|
44
|
+
control: {
|
|
45
|
+
type: 'number',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
43
48
|
variant: {
|
|
44
49
|
control: {
|
|
45
50
|
type: 'select',
|
|
@@ -226,3 +231,24 @@ export const Off: Story = {
|
|
|
226
231
|
},
|
|
227
232
|
render: (args) => renderComponent(args as ObcReadout),
|
|
228
233
|
};
|
|
234
|
+
|
|
235
|
+
export const Center: Story = {
|
|
236
|
+
args: {
|
|
237
|
+
value: 100,
|
|
238
|
+
hasDegree: false,
|
|
239
|
+
hasSetpoint: true,
|
|
240
|
+
setpointValue: 12,
|
|
241
|
+
setpointSecondaryValue: 14,
|
|
242
|
+
adviceValue: 16,
|
|
243
|
+
adviceSecondaryValue: 18,
|
|
244
|
+
label: 'SOG',
|
|
245
|
+
unit: 'kn',
|
|
246
|
+
minValueLength: 0,
|
|
247
|
+
variant: 'regular',
|
|
248
|
+
valuePriority: 'regular',
|
|
249
|
+
direction: 'vertical',
|
|
250
|
+
alignment: 'center',
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
render: (args) => renderComponent(args as ObcReadout),
|
|
254
|
+
};
|
|
@@ -779,6 +779,8 @@ export class ObcReadout extends LitElement {
|
|
|
779
779
|
>
|
|
780
780
|
<slot name="setpoint">
|
|
781
781
|
<obc-readout-setpoint
|
|
782
|
+
.reserveSpaceForIcon=${this.alignment !==
|
|
783
|
+
ReadoutStackVerticalAlignment.center}
|
|
782
784
|
data-obc-value-typography=${this.variant ===
|
|
783
785
|
ReadoutVariant.regular &&
|
|
784
786
|
this.isVertical &&
|
|
@@ -3,17 +3,14 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
:host {
|
|
6
|
-
display:
|
|
7
|
-
|
|
8
|
-
width: max-content;
|
|
9
|
-
max-width: none;
|
|
6
|
+
display: block;
|
|
7
|
+
width: 100%;
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
.root {
|
|
13
11
|
display: inline-flex;
|
|
14
12
|
align-items: flex-end;
|
|
15
13
|
border-radius: var(--global-border-radius-border-radius-base);
|
|
16
|
-
max-width: none;
|
|
17
14
|
width: 100%;
|
|
18
15
|
|
|
19
16
|
.content {
|
|
@@ -31,6 +31,7 @@ type ReadoutListItemStoryArgs = {
|
|
|
31
31
|
value: number;
|
|
32
32
|
fractionDigits: number;
|
|
33
33
|
showZeroPadding: boolean;
|
|
34
|
+
labelOnly: boolean;
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
type ReadoutShowcaseCase = {
|
|
@@ -174,6 +175,7 @@ function renderReadoutListItem(args: Partial<ReadoutListItemStoryArgs>) {
|
|
|
174
175
|
.value=${resolved.value}
|
|
175
176
|
.fractionDigits=${resolved.fractionDigits}
|
|
176
177
|
.showZeroPadding=${resolved.showZeroPadding}
|
|
178
|
+
.labelOnly=${resolved.labelOnly}
|
|
177
179
|
>
|
|
178
180
|
${resolved.hasLeadingIcon
|
|
179
181
|
? html`<span
|
|
@@ -95,6 +95,8 @@ export class ObcReadoutListItem extends LitElement {
|
|
|
95
95
|
@property({type: Number}) minValueLength = 0;
|
|
96
96
|
@property({type: Boolean}) hasHintedZeros = false;
|
|
97
97
|
|
|
98
|
+
@property({type: Boolean}) labelOnly = false;
|
|
99
|
+
|
|
98
100
|
private get resolvedMainValueSize(): ReadoutSetpointSize {
|
|
99
101
|
return this.size === ReadoutListItemSize.enhanced
|
|
100
102
|
? ReadoutSetpointSize.large
|
|
@@ -395,11 +397,15 @@ export class ObcReadoutListItem extends LitElement {
|
|
|
395
397
|
${this.renderLabelContainer()}
|
|
396
398
|
</div>
|
|
397
399
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
400
|
+
${this.labelOnly
|
|
401
|
+
? nothing
|
|
402
|
+
: html`
|
|
403
|
+
<div class="value-container" part="value-container">
|
|
404
|
+
${this.renderValue()} ${this.renderTrailingUnit()}
|
|
405
|
+
</div>
|
|
401
406
|
|
|
402
|
-
|
|
407
|
+
${this.renderTrailingSource()}
|
|
408
|
+
`}
|
|
403
409
|
</div>
|
|
404
410
|
</div>
|
|
405
411
|
`;
|
|
@@ -114,6 +114,7 @@ export class ObcReadoutSetpoint extends LitElement {
|
|
|
114
114
|
@property({type: Boolean}) hasDegree = false;
|
|
115
115
|
@property({type: Boolean}) showZeroPadding = false;
|
|
116
116
|
@property({type: Number}) fractionDigits = 0;
|
|
117
|
+
@property({type: Boolean, attribute: false}) reserveSpaceForIcon = false;
|
|
117
118
|
|
|
118
119
|
@state() private hasAssignedValueIcon = false;
|
|
119
120
|
|
|
@@ -392,6 +393,9 @@ export class ObcReadoutSetpoint extends LitElement {
|
|
|
392
393
|
}
|
|
393
394
|
|
|
394
395
|
private renderRegularValueInlineIcon(size: ReadoutSetpointSize) {
|
|
396
|
+
if (!this.reserveSpaceForIcon) {
|
|
397
|
+
return nothing;
|
|
398
|
+
}
|
|
395
399
|
const hideStyle = this.hasAssignedValueIcon
|
|
396
400
|
? ''
|
|
397
401
|
: this.direction === 'vertical'
|