@oicl/openbridge-webcomponents-full-bundle 2.2.0-next.21 → 2.2.0-next.22

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 (55) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +113 -56
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +49 -21
  4. package/dist/automation/automation-tank/automation-tank.d.ts.map +1 -1
  5. package/dist/automation/automation-tank/automation-tank.js +2 -1
  6. package/dist/automation/automation-tank/automation-tank.js.map +1 -1
  7. package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts +4 -2
  8. package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts.map +1 -1
  9. package/dist/building-blocks/bar-horizontal/bar-horizontal.js +12 -6
  10. package/dist/building-blocks/bar-horizontal/bar-horizontal.js.map +1 -1
  11. package/dist/building-blocks/bar-vertical/bar-vertical.d.ts +4 -2
  12. package/dist/building-blocks/bar-vertical/bar-vertical.d.ts.map +1 -1
  13. package/dist/building-blocks/bar-vertical/bar-vertical.js +12 -6
  14. package/dist/building-blocks/bar-vertical/bar-vertical.js.map +1 -1
  15. package/dist/building-blocks/external-scale/external-scale.d.ts +21 -3
  16. package/dist/building-blocks/external-scale/external-scale.d.ts.map +1 -1
  17. package/dist/building-blocks/external-scale/external-scale.js +40 -17
  18. package/dist/building-blocks/external-scale/external-scale.js.map +1 -1
  19. package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.d.ts +4 -2
  20. package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.d.ts.map +1 -1
  21. package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.js +14 -6
  22. package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.js.map +1 -1
  23. package/dist/navigation-instruments/gauge-vertical/gauge-vertical.d.ts +4 -2
  24. package/dist/navigation-instruments/gauge-vertical/gauge-vertical.d.ts.map +1 -1
  25. package/dist/navigation-instruments/gauge-vertical/gauge-vertical.js +14 -6
  26. package/dist/navigation-instruments/gauge-vertical/gauge-vertical.js.map +1 -1
  27. package/dist/svghelpers/advice-linear.d.ts +7 -0
  28. package/dist/svghelpers/advice-linear.d.ts.map +1 -1
  29. package/dist/svghelpers/advice-linear.js +14 -10
  30. package/dist/svghelpers/advice-linear.js.map +1 -1
  31. package/dist/svghelpers/advice-patterns.d.ts +2 -2
  32. package/dist/svghelpers/advice-patterns.d.ts.map +1 -1
  33. package/dist/svghelpers/advice-patterns.js +6 -4
  34. package/dist/svghelpers/advice-patterns.js.map +1 -1
  35. package/package.json +1 -1
  36. package/src/automation/automation-tank/automation-tank.ts +4 -0
  37. package/src/building-blocks/bar-horizontal/bar-horizontal-fixed-aspect.spec.ts +50 -0
  38. package/src/building-blocks/bar-horizontal/bar-horizontal.stories.ts +6 -0
  39. package/src/building-blocks/bar-horizontal/bar-horizontal.ts +22 -9
  40. package/src/building-blocks/bar-vertical/bar-vertical-dimensions.spec.ts +36 -0
  41. package/src/building-blocks/bar-vertical/bar-vertical-fixed-aspect.spec.ts +49 -0
  42. package/src/building-blocks/bar-vertical/bar-vertical.stories.ts +6 -0
  43. package/src/building-blocks/bar-vertical/bar-vertical.ts +22 -9
  44. package/src/building-blocks/external-scale/external-scale.spec.ts +151 -0
  45. package/src/building-blocks/external-scale/external-scale.stories.ts +6 -0
  46. package/src/building-blocks/external-scale/external-scale.ts +86 -40
  47. package/src/navigation-instruments/gauge-horizontal/gauge-horizontal.spec.ts +55 -0
  48. package/src/navigation-instruments/gauge-horizontal/gauge-horizontal.stories.ts +2 -0
  49. package/src/navigation-instruments/gauge-horizontal/gauge-horizontal.ts +24 -9
  50. package/src/navigation-instruments/gauge-trend/gauge-trend.stories.ts +25 -0
  51. package/src/navigation-instruments/gauge-vertical/gauge-vertical.spec.ts +55 -0
  52. package/src/navigation-instruments/gauge-vertical/gauge-vertical.stories.ts +2 -0
  53. package/src/navigation-instruments/gauge-vertical/gauge-vertical.ts +24 -9
  54. package/src/svghelpers/advice-linear.ts +25 -11
  55. package/src/svghelpers/advice-patterns.ts +13 -5
@@ -35317,15 +35317,16 @@ var STRIPE_TILE = ADVICE_STRIPE.pitch * Math.SQRT2;
35317
35317
  * tile whose side is the pitch along the axis, with the two half lines at the
35318
35318
  * opposite corners completing the neighbours.
35319
35319
  */
35320
- function stripePattern(id, color, width = ADVICE_STRIPE.width, mirrored = false) {
35320
+ function stripePattern(id, color, width = ADVICE_STRIPE.width, mirrored = false, unitsPerPx = 1) {
35321
35321
  const t = STRIPE_TILE;
35322
- return w`<pattern id=${id} patternUnits="userSpaceOnUse" width=${t} height=${t} patternTransform=${mirrored ? "scale(-1 1)" : A}>
35322
+ const transforms = [mirrored ? "scale(-1 1)" : "", unitsPerPx !== 1 ? `scale(${unitsPerPx})` : ""].filter(Boolean);
35323
+ return w`<pattern id=${id} patternUnits="userSpaceOnUse" width=${t} height=${t} patternTransform=${transforms.length ? transforms.join(" ") : A}>
35323
35324
  <path d="M 0 0 L ${t} ${t} M ${t / 2} ${-t / 2} L ${3 * t / 2} ${t / 2} M ${-t / 2} ${t / 2} L ${t / 2} ${3 * t / 2}" stroke=${color} stroke-width=${width} stroke-linecap="square"/>
35324
35325
  </pattern>`;
35325
35326
  }
35326
35327
  /** The exclusion hatch: the stripe tile as a hairline. */
35327
- function hairlinePattern(id, color, mirrored = false) {
35328
- return stripePattern(id, color, ADVICE_HAIRLINE_WIDTH, mirrored);
35328
+ function hairlinePattern(id, color, mirrored = false, unitsPerPx = 1) {
35329
+ return stripePattern(id, color, ADVICE_HAIRLINE_WIDTH, mirrored, unitsPerPx);
35329
35330
  }
35330
35331
  /** The alarm lattice: square dots on a grid, every other row shifted by half a pitch. */
35331
35332
  function dotPattern(id, color) {
@@ -35541,9 +35542,11 @@ function bandPath$1(o, advice) {
35541
35542
  const hi = Math.max(o.mainStart, o.mainEnd);
35542
35543
  const capLo = ascending ? caps.start : caps.end;
35543
35544
  const capHi = ascending ? caps.end : caps.start;
35544
- const edgeLo = capLo === AdviceCap.pill ? lo + 4 : lo;
35545
- const edgeHi = capHi === AdviceCap.pill ? hi - 4 : hi;
35546
- const radius = (cap) => cap === AdviceCap.pill ? t / 2 : cap === AdviceCap.square ? 2 : 0;
35545
+ const u = o.unitsPerPx ?? 1;
35546
+ const inset = 4 * u;
35547
+ const edgeLo = capLo === AdviceCap.pill ? lo + inset : lo;
35548
+ const edgeHi = capHi === AdviceCap.pill ? hi - inset : hi;
35549
+ const radius = (cap) => cap === AdviceCap.pill ? t / 2 : cap === AdviceCap.square ? 2 * u : 0;
35547
35550
  const rLo = radius(capLo);
35548
35551
  const rHi = radius(capHi);
35549
35552
  if (edgeHi - edgeLo < rLo + rHi) return null;
@@ -35575,13 +35578,14 @@ function renderLinearAdviceBand(o) {
35575
35578
  const style = adviceStyle(advice.category, advice.state);
35576
35579
  const d = bandPath$1(o, advice);
35577
35580
  if (d === null) return A;
35578
- if (style.pattern === "none") return w`<path d=${d} fill=${style.fill} stroke=${style.stroke} stroke-width="1" vector-effect="non-scaling-stroke"/>`;
35581
+ if (style.pattern === "none") return w`<path class="advice-band" d=${d} fill=${style.fill} stroke=${style.stroke} stroke-width="1" vector-effect="non-scaling-stroke"/>`;
35579
35582
  const t = o.thickness ?? 8;
35580
35583
  const lo = Math.min(o.mainStart, o.mainEnd);
35581
35584
  const hi = Math.max(o.mainStart, o.mainEnd);
35582
35585
  const patternId = `${o.maskId}-pattern`;
35583
35586
  const mirrored = o.mirrorPattern ?? false;
35584
- const pattern = style.pattern === "hairline" ? hairlinePattern(patternId, style.patternColor, mirrored) : stripePattern(patternId, style.patternColor, ADVICE_STRIPE.width, mirrored);
35587
+ const unitsPerPx = o.unitsPerPx ?? 1;
35588
+ const pattern = style.pattern === "hairline" ? hairlinePattern(patternId, style.patternColor, mirrored, unitsPerPx) : stripePattern(patternId, style.patternColor, ADVICE_STRIPE.width, mirrored, unitsPerPx);
35585
35589
  const cover = o.vertical ? w`<rect x=${o.perpStart} y=${lo} width=${t} height=${hi - lo} fill=${style.fill}/><rect x=${o.perpStart} y=${lo} width=${t} height=${hi - lo} fill="url(#${patternId})"/>` : w`<rect x=${lo} y=${o.perpStart} width=${hi - lo} height=${t} fill=${style.fill}/><rect x=${lo} y=${o.perpStart} width=${hi - lo} height=${t} fill="url(#${patternId})"/>`;
35586
35590
  return w`
35587
35591
  <defs>
@@ -35591,7 +35595,7 @@ function renderLinearAdviceBand(o) {
35591
35595
  </mask>
35592
35596
  </defs>
35593
35597
  <g mask="url(#${o.maskId})">${cover}</g>
35594
- <path d=${d} fill="none" stroke=${style.stroke} stroke-width="1" vector-effect="non-scaling-stroke"/>`;
35598
+ <path class="advice-band" d=${d} fill="none" stroke=${style.stroke} stroke-width="1" vector-effect="non-scaling-stroke"/>`;
35595
35599
  }
35596
35600
  /**
35597
35601
  * A point advice: a dot for a go-to category, a thick tick across the band
@@ -35603,12 +35607,13 @@ function renderLinearAdvicePoint(o) {
35603
35607
  const style = adviceStyle(advice.category, advice.state);
35604
35608
  const cx = o.vertical ? o.perpCenter : o.main;
35605
35609
  const cy = o.vertical ? o.main : o.perpCenter;
35606
- if (isGoToCategory(advice.category)) return w`<circle cx=${cx} cy=${cy} r=${9 / 2} fill=${style.fill} stroke=${style.stroke} stroke-width="1" vector-effect="non-scaling-stroke"/>`;
35610
+ const u = o.unitsPerPx ?? 1;
35611
+ if (isGoToCategory(advice.category)) return w`<circle cx=${cx} cy=${cy} r=${9 / 2 * u} fill=${style.fill} stroke=${style.stroke} stroke-width="1" vector-effect="non-scaling-stroke"/>`;
35607
35612
  const grey = advice.category === AdviceCategory.caution ? advice.state === AdviceState.triggered ? "var(--instrument-tick-mark-primary-color)" : style.stroke : void 0;
35608
35613
  const { length, thickness, radius } = ADVICE_POINT_TICK;
35609
- const w$9 = o.vertical ? length : thickness;
35610
- const h = o.vertical ? thickness : length;
35611
- return w`<rect x=${cx - w$9 / 2} y=${cy - h / 2} width=${w$9} height=${h} rx=${radius} fill=${grey ?? style.fill} stroke=${grey ?? style.stroke} stroke-width="1" vector-effect="non-scaling-stroke"/>`;
35614
+ const w$9 = (o.vertical ? length : thickness) * u;
35615
+ const h = (o.vertical ? thickness : length) * u;
35616
+ return w`<rect x=${cx - w$9 / 2} y=${cy - h / 2} width=${w$9} height=${h} rx=${radius * u} fill=${grey ?? style.fill} stroke=${grey ?? style.stroke} stroke-width="1" vector-effect="non-scaling-stroke"/>`;
35612
35617
  }
35613
35618
  /**
35614
35619
  * The area layer across a bar: the category's tint or pattern between the
@@ -36134,9 +36139,15 @@ function toExternalScaleLayoutConfig(config) {
36134
36139
  advicePosition: config.advicePosition,
36135
36140
  hasAdvice: !!config.advices && config.advices.length > 0,
36136
36141
  hasAdviceIcon: !!config.advices?.some((a) => a.showIcon),
36137
- hasSetpoint: config.setpoint !== void 0 || config.newSetpoint !== void 0 || config.departingNewSetpoint !== void 0
36142
+ hasSetpoint: config.setpoint !== void 0 || config.newSetpoint !== void 0 || config.departingNewSetpoint !== void 0,
36143
+ fixedAspectRatioScale: config.fixedAspectRatioScale
36138
36144
  };
36139
36145
  }
36146
+ /** ViewBox units per CSS pixel of the advice geometry: 1 outside fixedAspectRatio. */
36147
+ function advicePx(config) {
36148
+ const scale = config.fixedAspectRatioScale;
36149
+ return scale !== void 0 && scale > 0 ? 1 / scale : 1;
36150
+ }
36140
36151
  /**
36141
36152
  * Compute the outer SVG viewBox for a scale given layout.
36142
36153
  * Wrappers can use this to avoid duplicating orientation-specific math.
@@ -36194,9 +36205,19 @@ function computeFixedAspectRatioScale(config) {
36194
36205
  const { containerMainAxisSize, scaleReferenceSize, containerCrossAxisSize, viewBoxThickness } = config;
36195
36206
  if (containerMainAxisSize <= 0 || scaleReferenceSize <= 0) return 1;
36196
36207
  const mainScale = containerMainAxisSize / scaleReferenceSize;
36197
- if (containerCrossAxisSize === void 0 || containerCrossAxisSize <= 0 || viewBoxThickness === void 0 || viewBoxThickness <= 0) return mainScale;
36198
- if (containerCrossAxisSize + 1 >= viewBoxThickness * mainScale) return mainScale;
36199
- return config.orientation === "vertical" ? computeMeetScale(viewBoxThickness, scaleReferenceSize, containerCrossAxisSize, containerMainAxisSize) : computeMeetScale(scaleReferenceSize, viewBoxThickness, containerMainAxisSize, containerCrossAxisSize);
36208
+ const thicknessAt = typeof viewBoxThickness === "function" ? viewBoxThickness : () => viewBoxThickness ?? 0;
36209
+ if (containerCrossAxisSize === void 0 || containerCrossAxisSize <= 0 || thicknessAt(mainScale) <= 0) return mainScale;
36210
+ if (containerCrossAxisSize + 1 >= thicknessAt(mainScale) * mainScale) return mainScale;
36211
+ const meet = (thickness) => config.orientation === "vertical" ? computeMeetScale(thickness, scaleReferenceSize, containerCrossAxisSize, containerMainAxisSize) : computeMeetScale(scaleReferenceSize, thickness, containerMainAxisSize, containerCrossAxisSize);
36212
+ const painted = (scale) => meet(thicknessAt(scale));
36213
+ let lo = 0;
36214
+ let hi = mainScale;
36215
+ for (let i = 0; i < 48; i++) {
36216
+ const mid = (lo + hi) / 2;
36217
+ if (painted(mid) >= mid) lo = mid;
36218
+ else hi = mid;
36219
+ }
36220
+ return lo > 0 ? lo : painted(mainScale);
36200
36221
  }
36201
36222
  /**
36202
36223
  * The element's content box in CSS px: the box a `100%` × `100%` SVG child
@@ -36254,8 +36275,9 @@ function computeAdviceBandThickness(config) {
36254
36275
  if (!config.hasAdvice) return 0;
36255
36276
  const position = config.hasBar ? config.advicePosition ?? "inner" : "inner";
36256
36277
  if (position === "center") return 0;
36257
- if (position === "outer") return 24;
36258
- return 16;
36278
+ const px = advicePx(config);
36279
+ if (position === "outer") return 24 * px;
36280
+ return 16 * px;
36259
36281
  }
36260
36282
  /**
36261
36283
  * The perpendicular band outside the bar: the tick and label bands, or the
@@ -37275,21 +37297,23 @@ function singleSidedTickmark$2(config, value, style, tickBase) {
37275
37297
  }
37276
37298
  /**
37277
37299
  * The perpendicular coordinate of the advice band's near edge for the
37278
- * configured position: `inner` sits on the tick band 4 off the bar edge,
37279
- * `outer` on the far side of the tick band, `center` in the middle of the
37280
- * bar. Without a bar the band is always `inner`.
37300
+ * configured position: `inner` sits on the tick band 4 px off the bar edge,
37301
+ * `outer` 14 px off it, `center` in the middle of the bar; the same on
37302
+ * either side of the bar. Without a bar the band is always `inner`.
37281
37303
  */
37282
37304
  function advicePerpStart(config) {
37283
37305
  const tickBase = tickBasePerp(config);
37284
37306
  const position = config.hasBar ? config.advicePosition : "inner";
37285
- const offset = 4;
37307
+ const px = advicePx(config);
37308
+ const offset = 4 * px;
37286
37309
  const outward = isOutwardPositive(config);
37287
37310
  if (position === "center") {
37288
- const centerOffset = config.barThickness / 2 - 4;
37289
- return (outward ? centerOffset : -config.barThickness + centerOffset) - 4 + offset;
37311
+ const centerOffset = config.barThickness / 2 - 4 * px;
37312
+ return outward ? centerOffset : -config.barThickness + centerOffset;
37290
37313
  }
37291
- if (position === "inner") return (outward ? tickBase : tickBase - 16) + offset;
37292
- return (outward ? config.barThickness + 10 : -config.barThickness - computeExternalScaleEffectiveTickThickness(config) + 14) + offset;
37314
+ if (position === "inner") return (outward ? tickBase : tickBase - 16 * px) + offset;
37315
+ const outerGap = 14 * px;
37316
+ return outward ? config.barThickness + outerGap : -config.barThickness - outerGap - 8 * px;
37293
37317
  }
37294
37318
  function renderAdvice$3(config, advice, maskId) {
37295
37319
  const tickBase = tickBasePerp(config);
@@ -37319,18 +37343,22 @@ function renderAdvice$3(config, advice, maskId) {
37319
37343
  if (advice.min > config.minValue) dash(advice.min);
37320
37344
  if (!advice.point && advice.max < config.maxValue) dash(advice.max);
37321
37345
  }
37346
+ const px = advicePx(config);
37322
37347
  const marker = advice.point ? renderLinearAdvicePoint({
37323
37348
  vertical,
37324
37349
  main: mainStart,
37325
- perpCenter: perpStart + 4,
37326
- advice
37350
+ perpCenter: perpStart + 4 * px,
37351
+ advice,
37352
+ unitsPerPx: px
37327
37353
  }) : renderLinearAdviceBand({
37328
37354
  vertical,
37329
37355
  mainStart,
37330
37356
  mainEnd,
37331
37357
  perpStart,
37358
+ thickness: 8 * px,
37332
37359
  advice,
37333
- maskId
37360
+ maskId,
37361
+ unitsPerPx: px
37334
37362
  });
37335
37363
  const icon = advice.showIcon ? renderLinearAdviceIcon({
37336
37364
  vertical,
@@ -39850,7 +39878,10 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(i$4,
39850
39878
  this.fixedAspectRatio = false;
39851
39879
  this.scaleReferenceSize = 384;
39852
39880
  this._scale = 1;
39853
- this._viewBoxThickness = 0;
39881
+ this._thicknessAt = (scale) => this._layoutConfig ? computeExternalScaleLayout({
39882
+ ...this._layoutConfig,
39883
+ fixedAspectRatioScale: scale
39884
+ }).thickness : 0;
39854
39885
  this._resizeController = new h(this, { callback: (entries) => {
39855
39886
  if (!this.fixedAspectRatio) return;
39856
39887
  const entry = entries[0];
@@ -39860,7 +39891,7 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(i$4,
39860
39891
  containerMainAxisSize: entry.contentRect.height,
39861
39892
  containerCrossAxisSize: entry.contentRect.width,
39862
39893
  scaleReferenceSize: this.scaleReferenceSize,
39863
- viewBoxThickness: this._viewBoxThickness
39894
+ viewBoxThickness: this._thicknessAt
39864
39895
  });
39865
39896
  this.reportDimensions();
39866
39897
  } });
@@ -39945,11 +39976,13 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(i$4,
39945
39976
  adviceEmphasis: this.adviceEmphasis,
39946
39977
  adviceMaskPrefix: this._adviceMaskPrefix,
39947
39978
  fixedAspectRatio: this.fixedAspectRatio,
39979
+ fixedAspectRatioScale: this.fixedAspectRatio ? this._scale : 1,
39948
39980
  instrumentMode: this.instrumentMode,
39949
39981
  highlightCurrentValue: this.highlightCurrentValue
39950
39982
  };
39951
- const layout = computeExternalScaleLayout(toExternalScaleLayoutConfig(config));
39952
- this._viewBoxThickness = layout.thickness;
39983
+ const layoutConfig = toExternalScaleLayoutConfig(config);
39984
+ const layout = computeExternalScaleLayout(layoutConfig);
39985
+ this._layoutConfig = layoutConfig;
39953
39986
  const parts = renderExternalScale(config);
39954
39987
  const viewBox = computeExternalScaleViewBox({
39955
39988
  orientation: config.orientation,
@@ -40018,7 +40051,8 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(i$4,
40018
40051
  advicePosition: this.advicePosition,
40019
40052
  hasAdvice: !!this.advices && this.advices.length > 0,
40020
40053
  hasAdviceIcon: !!this.advices?.some((a) => a.showIcon),
40021
- hasSetpoint: this.setpoint !== void 0 || this.newSetpoint !== void 0 || this.departingNewSetpoint !== void 0
40054
+ hasSetpoint: this.setpoint !== void 0 || this.newSetpoint !== void 0 || this.departingNewSetpoint !== void 0,
40055
+ fixedAspectRatioScale: this.fixedAspectRatio ? this._scale : 1
40022
40056
  });
40023
40057
  const dimensions = this.fixedAspectRatio ? {
40024
40058
  ...baseDimensions,
@@ -40076,7 +40110,7 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(i$4,
40076
40110
  containerMainAxisSize: height,
40077
40111
  containerCrossAxisSize: width,
40078
40112
  scaleReferenceSize: this.scaleReferenceSize,
40079
- viewBoxThickness: this._viewBoxThickness
40113
+ viewBoxThickness: this._thicknessAt
40080
40114
  });
40081
40115
  return true;
40082
40116
  }
@@ -40808,7 +40842,8 @@ var ObcAutomationTank = class ObcAutomationTank extends AdviceMixin(SetpointMixi
40808
40842
  hasAdvice: this.hasAdvice,
40809
40843
  hasAdviceIcon: this.hasAdvice && !!this.advices?.some((a) => a.showIcon),
40810
40844
  advicePosition: AdvicePosition.inner,
40811
- hasSetpoint: hasSetpointMarker
40845
+ hasSetpoint: hasSetpointMarker,
40846
+ fixedAspectRatioScale: Math.max(1, this._cellHeight) / SCALE_REFERENCE_SIZE
40812
40847
  });
40813
40848
  const safeCellHeight = Math.max(1, this._cellHeight);
40814
40849
  const viewBoxCross = this._cellWidth * SCALE_REFERENCE_SIZE / safeCellHeight;
@@ -74013,7 +74048,10 @@ var ObcBarHorizontal = class ObcBarHorizontal extends AdviceMixin(SetpointMixin(
74013
74048
  this.fixedAspectRatio = false;
74014
74049
  this.scaleReferenceSize = 384;
74015
74050
  this._scale = 1;
74016
- this._viewBoxThickness = 0;
74051
+ this._thicknessAt = (scale) => this._layoutConfig ? computeExternalScaleLayout({
74052
+ ...this._layoutConfig,
74053
+ fixedAspectRatioScale: scale
74054
+ }).thickness : 0;
74017
74055
  this._resizeController = new h(this, { callback: (entries) => {
74018
74056
  if (!this.fixedAspectRatio) return;
74019
74057
  const entry = entries[0];
@@ -74023,7 +74061,7 @@ var ObcBarHorizontal = class ObcBarHorizontal extends AdviceMixin(SetpointMixin(
74023
74061
  containerMainAxisSize: entry.contentRect.width,
74024
74062
  containerCrossAxisSize: entry.contentRect.height,
74025
74063
  scaleReferenceSize: this.scaleReferenceSize,
74026
- viewBoxThickness: this._viewBoxThickness
74064
+ viewBoxThickness: this._thicknessAt
74027
74065
  });
74028
74066
  this.reportDimensions();
74029
74067
  } });
@@ -74108,11 +74146,13 @@ var ObcBarHorizontal = class ObcBarHorizontal extends AdviceMixin(SetpointMixin(
74108
74146
  adviceEmphasis: this.adviceEmphasis,
74109
74147
  adviceMaskPrefix: this._adviceMaskPrefix,
74110
74148
  fixedAspectRatio: this.fixedAspectRatio,
74149
+ fixedAspectRatioScale: this.fixedAspectRatio ? this._scale : 1,
74111
74150
  instrumentMode: this.instrumentMode,
74112
74151
  highlightCurrentValue: this.highlightCurrentValue
74113
74152
  };
74114
- const layout = computeExternalScaleLayout(toExternalScaleLayoutConfig(config));
74115
- this._viewBoxThickness = layout.thickness;
74153
+ const layoutConfig = toExternalScaleLayoutConfig(config);
74154
+ const layout = computeExternalScaleLayout(layoutConfig);
74155
+ this._layoutConfig = layoutConfig;
74116
74156
  const parts = renderExternalScale(config);
74117
74157
  const viewBox = computeExternalScaleViewBox({
74118
74158
  orientation: config.orientation,
@@ -74181,7 +74221,8 @@ var ObcBarHorizontal = class ObcBarHorizontal extends AdviceMixin(SetpointMixin(
74181
74221
  advicePosition: this.advicePosition,
74182
74222
  hasAdvice: !!this.advices && this.advices.length > 0,
74183
74223
  hasAdviceIcon: !!this.advices?.some((a) => a.showIcon),
74184
- hasSetpoint: this.setpoint !== void 0 || this.newSetpoint !== void 0 || this.departingNewSetpoint !== void 0
74224
+ hasSetpoint: this.setpoint !== void 0 || this.newSetpoint !== void 0 || this.departingNewSetpoint !== void 0,
74225
+ fixedAspectRatioScale: this.fixedAspectRatio ? this._scale : 1
74185
74226
  });
74186
74227
  const dimensions = this.fixedAspectRatio ? {
74187
74228
  ...baseDimensions,
@@ -74239,7 +74280,7 @@ var ObcBarHorizontal = class ObcBarHorizontal extends AdviceMixin(SetpointMixin(
74239
74280
  containerMainAxisSize: width,
74240
74281
  containerCrossAxisSize: height,
74241
74282
  scaleReferenceSize: this.scaleReferenceSize,
74242
- viewBoxThickness: this._viewBoxThickness
74283
+ viewBoxThickness: this._thicknessAt
74243
74284
  });
74244
74285
  return true;
74245
74286
  }
@@ -204026,7 +204067,10 @@ var ObcGaugeHorizontal = class ObcGaugeHorizontal extends AdviceMixin(SetpointMi
204026
204067
  this.fixedAspectRatio = false;
204027
204068
  this.scaleReferenceSize = 384;
204028
204069
  this._scale = 1;
204029
- this._viewBoxThickness = 0;
204070
+ this._thicknessAt = (scale) => this._layoutConfig ? computeExternalScaleLayout({
204071
+ ...this._layoutConfig,
204072
+ fixedAspectRatioScale: scale
204073
+ }).thickness : 0;
204030
204074
  this._resizeController = new h(this, { callback: (entries) => {
204031
204075
  if (!this.fixedAspectRatio) return;
204032
204076
  const entry = entries[0];
@@ -204036,7 +204080,7 @@ var ObcGaugeHorizontal = class ObcGaugeHorizontal extends AdviceMixin(SetpointMi
204036
204080
  containerMainAxisSize: entry.contentRect.width,
204037
204081
  containerCrossAxisSize: entry.contentRect.height,
204038
204082
  scaleReferenceSize: this.scaleReferenceSize,
204039
- viewBoxThickness: this._viewBoxThickness
204083
+ viewBoxThickness: this._thicknessAt
204040
204084
  });
204041
204085
  this._scale = scale > 0 ? scale : 1;
204042
204086
  this.reportDimensions();
@@ -204121,11 +204165,13 @@ var ObcGaugeHorizontal = class ObcGaugeHorizontal extends AdviceMixin(SetpointMi
204121
204165
  adviceEmphasis: this.adviceEmphasis,
204122
204166
  adviceMaskPrefix: this._adviceMaskPrefix,
204123
204167
  fixedAspectRatio: this.fixedAspectRatio,
204168
+ fixedAspectRatioScale: this.fixedAspectRatio ? this._scale : 1,
204124
204169
  instrumentMode: true,
204125
204170
  highlightCurrentValue: this.highlightCurrentValue
204126
204171
  };
204127
- const layout = computeExternalScaleLayout(toExternalScaleLayoutConfig(config));
204128
- this._viewBoxThickness = layout.thickness;
204172
+ const layoutConfig = toExternalScaleLayoutConfig(config);
204173
+ const layout = computeExternalScaleLayout(layoutConfig);
204174
+ this._layoutConfig = layoutConfig;
204129
204175
  const parts = renderExternalScale(config);
204130
204176
  const viewBox = computeExternalScaleViewBox({
204131
204177
  orientation: config.orientation,
@@ -204192,8 +204238,11 @@ var ObcGaugeHorizontal = class ObcGaugeHorizontal extends AdviceMixin(SetpointMi
204192
204238
  labelThickness: this.labelThickness,
204193
204239
  length: this.fixedAspectRatio ? this.scaleReferenceSize : this.width,
204194
204240
  scaleType: this.scaleType,
204241
+ advicePosition: this.advicePosition,
204242
+ hasAdvice: !!this.advices && this.advices.length > 0,
204195
204243
  hasAdviceIcon: !!this.advices?.some((a) => a.showIcon),
204196
- hasSetpoint: this.setpoint !== void 0 || this.newSetpoint !== void 0 || this.departingNewSetpoint !== void 0
204244
+ hasSetpoint: this.setpoint !== void 0 || this.newSetpoint !== void 0 || this.departingNewSetpoint !== void 0,
204245
+ fixedAspectRatioScale: this.fixedAspectRatio ? this._scale : 1
204197
204246
  });
204198
204247
  const dimensions = this.fixedAspectRatio ? {
204199
204248
  ...baseDimensions,
@@ -204250,7 +204299,7 @@ var ObcGaugeHorizontal = class ObcGaugeHorizontal extends AdviceMixin(SetpointMi
204250
204299
  containerMainAxisSize: width,
204251
204300
  containerCrossAxisSize: height,
204252
204301
  scaleReferenceSize: this.scaleReferenceSize,
204253
- viewBoxThickness: this._viewBoxThickness
204302
+ viewBoxThickness: this._thicknessAt
204254
204303
  });
204255
204304
  return true;
204256
204305
  }
@@ -205712,7 +205761,10 @@ var ObcGaugeVertical = class ObcGaugeVertical extends AdviceMixin(SetpointMixin(
205712
205761
  this.fixedAspectRatio = false;
205713
205762
  this.scaleReferenceSize = 384;
205714
205763
  this._scale = 1;
205715
- this._viewBoxThickness = 0;
205764
+ this._thicknessAt = (scale) => this._layoutConfig ? computeExternalScaleLayout({
205765
+ ...this._layoutConfig,
205766
+ fixedAspectRatioScale: scale
205767
+ }).thickness : 0;
205716
205768
  this._resizeController = new h(this, { callback: (entries) => {
205717
205769
  if (!this.fixedAspectRatio) return;
205718
205770
  const entry = entries[0];
@@ -205722,7 +205774,7 @@ var ObcGaugeVertical = class ObcGaugeVertical extends AdviceMixin(SetpointMixin(
205722
205774
  containerMainAxisSize: entry.contentRect.height,
205723
205775
  containerCrossAxisSize: entry.contentRect.width,
205724
205776
  scaleReferenceSize: this.scaleReferenceSize,
205725
- viewBoxThickness: this._viewBoxThickness
205777
+ viewBoxThickness: this._thicknessAt
205726
205778
  });
205727
205779
  this._scale = scale > 0 ? scale : 1;
205728
205780
  this.reportDimensions();
@@ -205807,11 +205859,13 @@ var ObcGaugeVertical = class ObcGaugeVertical extends AdviceMixin(SetpointMixin(
205807
205859
  adviceEmphasis: this.adviceEmphasis,
205808
205860
  adviceMaskPrefix: this._adviceMaskPrefix,
205809
205861
  fixedAspectRatio: this.fixedAspectRatio,
205862
+ fixedAspectRatioScale: this.fixedAspectRatio ? this._scale : 1,
205810
205863
  instrumentMode: true,
205811
205864
  highlightCurrentValue: this.highlightCurrentValue
205812
205865
  };
205813
- const layout = computeExternalScaleLayout(toExternalScaleLayoutConfig(config));
205814
- this._viewBoxThickness = layout.thickness;
205866
+ const layoutConfig = toExternalScaleLayoutConfig(config);
205867
+ const layout = computeExternalScaleLayout(layoutConfig);
205868
+ this._layoutConfig = layoutConfig;
205815
205869
  const parts = renderExternalScale(config);
205816
205870
  const viewBox = computeExternalScaleViewBox({
205817
205871
  orientation: config.orientation,
@@ -205878,8 +205932,11 @@ var ObcGaugeVertical = class ObcGaugeVertical extends AdviceMixin(SetpointMixin(
205878
205932
  labelThickness: this.labelThickness,
205879
205933
  length: this.fixedAspectRatio ? this.scaleReferenceSize : this.height,
205880
205934
  scaleType: this.scaleType,
205935
+ advicePosition: this.advicePosition,
205936
+ hasAdvice: !!this.advices && this.advices.length > 0,
205881
205937
  hasAdviceIcon: !!this.advices?.some((a) => a.showIcon),
205882
- hasSetpoint: this.setpoint !== void 0 || this.newSetpoint !== void 0 || this.departingNewSetpoint !== void 0
205938
+ hasSetpoint: this.setpoint !== void 0 || this.newSetpoint !== void 0 || this.departingNewSetpoint !== void 0,
205939
+ fixedAspectRatioScale: this.fixedAspectRatio ? this._scale : 1
205883
205940
  });
205884
205941
  const dimensions = this.fixedAspectRatio ? {
205885
205942
  ...baseDimensions,
@@ -205936,7 +205993,7 @@ var ObcGaugeVertical = class ObcGaugeVertical extends AdviceMixin(SetpointMixin(
205936
205993
  containerMainAxisSize: height,
205937
205994
  containerCrossAxisSize: width,
205938
205995
  scaleReferenceSize: this.scaleReferenceSize,
205939
- viewBoxThickness: this._viewBoxThickness
205996
+ viewBoxThickness: this._thicknessAt
205940
205997
  });
205941
205998
  return true;
205942
205999
  }