@oicl/openbridge-webcomponents 2.0.0-next.115 → 2.0.0-next.116
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 +18 -5
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/dist/building-blocks/readout-block/readout-block.d.ts.map +1 -1
- package/dist/building-blocks/readout-block/readout-block.js +5 -2
- package/dist/building-blocks/readout-block/readout-block.js.map +1 -1
- package/dist/navigation-instruments/readout/readout-formatters.d.ts +23 -1
- package/dist/navigation-instruments/readout/readout-formatters.d.ts.map +1 -1
- package/dist/navigation-instruments/readout/readout-formatters.js +6 -4
- package/dist/navigation-instruments/readout/readout-formatters.js.map +1 -1
- package/dist/navigation-instruments/readout/readout-shared.d.ts.map +1 -1
- package/dist/navigation-instruments/readout/readout-shared.js +9 -0
- package/dist/navigation-instruments/readout/readout-shared.js.map +1 -1
- package/package.json +1 -1
|
@@ -57282,7 +57282,7 @@ function resolveReadoutNumericValue(value, valueType) {
|
|
|
57282
57282
|
return void 0;
|
|
57283
57283
|
}
|
|
57284
57284
|
if (typeof value === "number") {
|
|
57285
|
-
return value;
|
|
57285
|
+
return Number.isFinite(value) ? value : void 0;
|
|
57286
57286
|
}
|
|
57287
57287
|
if (isBlank(value)) {
|
|
57288
57288
|
return void 0;
|
|
@@ -57297,6 +57297,7 @@ function resolveReadoutTextValue(value, valueType) {
|
|
|
57297
57297
|
const text = typeof value === "number" ? String(value) : value;
|
|
57298
57298
|
return isBlank(text) ? void 0 : text;
|
|
57299
57299
|
}
|
|
57300
|
+
const READOUT_UNAVAILABLE_DASH = "‒";
|
|
57300
57301
|
function dashedGenerator({
|
|
57301
57302
|
showZeroPadding,
|
|
57302
57303
|
minValueLength,
|
|
@@ -57304,13 +57305,13 @@ function dashedGenerator({
|
|
|
57304
57305
|
}) {
|
|
57305
57306
|
const visibleDigits = showZeroPadding ? Math.max(minValueLength, 1) : 1;
|
|
57306
57307
|
if (fractionDigits < 1) {
|
|
57307
|
-
return
|
|
57308
|
+
return READOUT_UNAVAILABLE_DASH.repeat(visibleDigits);
|
|
57308
57309
|
}
|
|
57309
57310
|
const integerDigits = visibleDigits - fractionDigits;
|
|
57310
|
-
return
|
|
57311
|
+
return READOUT_UNAVAILABLE_DASH.repeat(Math.max(integerDigits, 1)) + "." + READOUT_UNAVAILABLE_DASH.repeat(fractionDigits);
|
|
57311
57312
|
}
|
|
57312
57313
|
function formatNumericValue(value, options) {
|
|
57313
|
-
if (value === void 0) {
|
|
57314
|
+
if (value === void 0 || !Number.isFinite(value)) {
|
|
57314
57315
|
return dashedGenerator(options);
|
|
57315
57316
|
}
|
|
57316
57317
|
return value.toFixed(options.fractionDigits);
|
|
@@ -57397,6 +57398,9 @@ let ObcReadoutBlock = class extends i$4 {
|
|
|
57397
57398
|
}
|
|
57398
57399
|
get numericFormatOptions() {
|
|
57399
57400
|
return {
|
|
57401
|
+
// The unavailable placeholder stays short (`\u2012.\u2012\u2012`) rather than
|
|
57402
|
+
// spelling out every reserved digit position — `maxDigits` already
|
|
57403
|
+
// reserves the width, so it simply sits at the right edge of it.
|
|
57400
57404
|
showZeroPadding: false,
|
|
57401
57405
|
minValueLength: this.maxDigits,
|
|
57402
57406
|
fractionDigits: this.fractionDigits
|
|
@@ -57482,7 +57486,7 @@ let ObcReadoutBlock = class extends i$4 {
|
|
|
57482
57486
|
this.valueType
|
|
57483
57487
|
);
|
|
57484
57488
|
const textValue = resolveReadoutTextValue(this.value, this.valueType);
|
|
57485
|
-
const text = this.off ? this.offText : isTextMode ? textValue ??
|
|
57489
|
+
const text = this.off ? this.offText : isTextMode ? textValue ?? READOUT_UNAVAILABLE_DASH : formatNumericValue(valueForFormat, formatOptions);
|
|
57486
57490
|
const hintCount = this.off || isTextMode || !this.hintedZeros || valueForFormat === void 0 || valueForFormat < 0 ? 0 : Math.max(this.maxDigits - readoutFormattedInteger(text), 0);
|
|
57487
57491
|
const hinted = hintCount > 0 ? "0".repeat(hintCount) : "";
|
|
57488
57492
|
const reserver = isTextMode ? this.spaceReserver ?? "" : this.hintedZeros ? this.reserverText : this.widerReserver(this.spaceReserver, this.reserverText);
|
|
@@ -58999,6 +59003,12 @@ obc-readout-block {
|
|
|
58999
59003
|
`;
|
|
59000
59004
|
function readoutNumericFormatOptions(maxDigits, fractionDigits) {
|
|
59001
59005
|
return {
|
|
59006
|
+
// Comparison-only (see `isDisplayedAtSetpoint`), which returns early unless
|
|
59007
|
+
// both operands are finite numbers — so `formatNumericValue` never reaches
|
|
59008
|
+
// its unavailable-dash branch here and the padding would have no effect.
|
|
59009
|
+
// `obc-readout-block` sets it to `false` for rendering as well, since the
|
|
59010
|
+
// unavailable placeholder is deliberately short rather than filled out to
|
|
59011
|
+
// `maxDigits`. Nothing enables it today.
|
|
59002
59012
|
showZeroPadding: false,
|
|
59003
59013
|
minValueLength: maxDigits,
|
|
59004
59014
|
fractionDigits
|
|
@@ -59008,6 +59018,9 @@ function isDisplayedAtSetpoint(value, setpoint, formatOptions) {
|
|
|
59008
59018
|
if (value === null || setpoint === void 0) {
|
|
59009
59019
|
return false;
|
|
59010
59020
|
}
|
|
59021
|
+
if (!Number.isFinite(value) || !Number.isFinite(setpoint)) {
|
|
59022
|
+
return false;
|
|
59023
|
+
}
|
|
59011
59024
|
return formatNumericValue(value, formatOptions) === formatNumericValue(setpoint, formatOptions);
|
|
59012
59025
|
}
|
|
59013
59026
|
function readoutPrimarySize(size) {
|