@oicl/openbridge-webcomponents-full-bundle 2.2.0-next.16 → 2.2.0-next.18

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 (68) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +442 -87
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +1970 -28
  4. package/dist/automation/analog-threeway-valve/analog-threeway-valve.d.ts +4 -4
  5. package/dist/automation/analog-threeway-valve/analog-threeway-valve.js.map +1 -1
  6. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts +20 -0
  7. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts.map +1 -1
  8. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js +1 -0
  9. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js.map +1 -1
  10. package/dist/automation/automation-button/abstract-automation-button.d.ts +11 -2
  11. package/dist/automation/automation-button/abstract-automation-button.d.ts.map +1 -1
  12. package/dist/automation/automation-button/abstract-automation-button.js +40 -20
  13. package/dist/automation/automation-button/abstract-automation-button.js.map +1 -1
  14. package/dist/automation/automation-button/badge-layout.d.ts +34 -0
  15. package/dist/automation/automation-button/badge-layout.d.ts.map +1 -0
  16. package/dist/automation/automation-button/badge-layout.js +64 -0
  17. package/dist/automation/automation-button/badge-layout.js.map +1 -0
  18. package/dist/automation/digital-threeway-valve/digital-threeway-valve.d.ts +4 -4
  19. package/dist/automation/digital-threeway-valve/digital-threeway-valve.js.map +1 -1
  20. package/dist/automation/electricity-battery/electricity-battery.d.ts +4 -4
  21. package/dist/automation/electricity-battery/electricity-battery.js.map +1 -1
  22. package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts +4 -0
  23. package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts.map +1 -1
  24. package/dist/building-blocks/bar-horizontal/bar-horizontal.js +26 -23
  25. package/dist/building-blocks/bar-horizontal/bar-horizontal.js.map +1 -1
  26. package/dist/building-blocks/bar-vertical/bar-vertical.d.ts +4 -0
  27. package/dist/building-blocks/bar-vertical/bar-vertical.d.ts.map +1 -1
  28. package/dist/building-blocks/bar-vertical/bar-vertical.js +26 -23
  29. package/dist/building-blocks/bar-vertical/bar-vertical.js.map +1 -1
  30. package/dist/building-blocks/external-scale/external-scale.d.ts +28 -1
  31. package/dist/building-blocks/external-scale/external-scale.d.ts.map +1 -1
  32. package/dist/building-blocks/external-scale/external-scale.js +30 -4
  33. package/dist/building-blocks/external-scale/external-scale.js.map +1 -1
  34. package/dist/internal/global-setting.d.ts +55 -0
  35. package/dist/internal/global-setting.d.ts.map +1 -0
  36. package/dist/internal/global-setting.js +86 -0
  37. package/dist/internal/global-setting.js.map +1 -0
  38. package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.d.ts +28 -17
  39. package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.d.ts.map +1 -1
  40. package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.js +91 -11
  41. package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.js.map +1 -1
  42. package/dist/navigation-instruments/gauge-vertical/gauge-vertical.d.ts +28 -17
  43. package/dist/navigation-instruments/gauge-vertical/gauge-vertical.d.ts.map +1 -1
  44. package/dist/navigation-instruments/gauge-vertical/gauge-vertical.js +91 -11
  45. package/dist/navigation-instruments/gauge-vertical/gauge-vertical.js.map +1 -1
  46. package/package.json +1 -1
  47. package/src/automation/analog-threeway-valve/analog-threeway-valve.ts +4 -4
  48. package/src/automation/automation-button/abstract-automation-button-storybook-helpers.ts +3 -0
  49. package/src/automation/automation-button/abstract-automation-button.ts +57 -23
  50. package/src/automation/automation-button/badge-layout.spec.ts +138 -0
  51. package/src/automation/automation-button/badge-layout.ts +120 -0
  52. package/src/automation/digital-threeway-valve/digital-threeway-valve.ts +4 -4
  53. package/src/automation/electricity-battery/electricity-battery.ts +4 -4
  54. package/src/automation/pump/pump.stories.ts +59 -0
  55. package/src/building-blocks/bar-horizontal/bar-horizontal-fixed-aspect.spec.ts +102 -0
  56. package/src/building-blocks/bar-horizontal/bar-horizontal.ts +28 -23
  57. package/src/building-blocks/bar-vertical/bar-vertical-fixed-aspect.spec.ts +101 -0
  58. package/src/building-blocks/bar-vertical/bar-vertical.ts +28 -23
  59. package/src/building-blocks/external-scale/external-scale.ts +72 -3
  60. package/src/internal/global-setting.spec.ts +119 -0
  61. package/src/internal/global-setting.ts +105 -0
  62. package/src/navigation-instruments/gauge-horizontal/gauge-horizontal.spec.ts +288 -0
  63. package/src/navigation-instruments/gauge-horizontal/gauge-horizontal.stories.ts +114 -4
  64. package/src/navigation-instruments/gauge-horizontal/gauge-horizontal.ts +129 -41
  65. package/src/navigation-instruments/gauge-trend/gauge-trend.stories.ts +8 -0
  66. package/src/navigation-instruments/gauge-vertical/gauge-vertical.spec.ts +284 -0
  67. package/src/navigation-instruments/gauge-vertical/gauge-vertical.stories.ts +117 -4
  68. package/src/navigation-instruments/gauge-vertical/gauge-vertical.ts +129 -41
@@ -1 +1 @@
1
- {"version":3,"file":"digital-threeway-valve.js","names":["_decorate"],"sources":["../../../src/automation/digital-threeway-valve/digital-threeway-valve.ts"],"sourcesContent":["import {html} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport '../../icons/icon-threeway-digital-open.js';\nimport '../../icons/icon-threeway-digital-closed.js';\nimport '../../icons/icon-threeway-digital-closed-left.js';\nimport '../../icons/icon-threeway-digital-closed-bottom.js';\nimport '../../icons/icon-threeway-digital-closed-right.js';\nimport {customElement} from '../../decorator.js';\nimport {ObcAbstractAutomationButton} from '../automation-button/abstract-automation-button.js';\nimport {AutomationButtonReadoutPosition} from '../automation-button/automation-button.js';\nimport {AutomationButtonReadoutStack} from '../../components/automation-button-readout-stack/automation-button-readout-stack.js';\nimport {\n ThreewayValveFlow,\n ThreewayValveOrientation,\n threewayValveOpenSide,\n threewayValveReadouts,\n threewayValveRotation,\n} from '../threeway-valve-shared/threeway-valve-shared.js';\n\nexport enum DigitalThreewayValveVariant {\n regular = 'regular',\n flat = 'flat',\n}\n\n/**\n * `<obc-digital-threeway-valve>` – three-way on/off valve for process\n * diagrams, with one open/closed state per port.\n *\n * ## Features\n *\n * - **Three ports:** `open1`, `open2` and `open3` open or close each port.\n * Ports are numbered from the side without a port: with `orientation`\n * `bottom`, port 1 is left, port 2 is the stem at the bottom and port 3 is\n * right. The numbering turns with the symbol.\n * - **Orientation:** `bottom` and `top` lay the valve on a horizontal pipe,\n * `left` and `right` on a vertical one; the value names the side the stem\n * points to.\n * - **Flow readout:** `flows` lists one readout row per flow, each with an\n * optional arrow direction and either a value with a unit (`%` when left out)\n * or a state, `{open}`, shown as `Open` or `Closed` after the arrow, or\n * after the on/off icon when there is no direction. Without flows the\n * readout shows `Open` or `Closed`.\n * - Badges, alert frame, progress and readout placement come from the shared\n * automation button base.\n *\n * ## Usage Guidelines\n *\n * Use where a valve directs flow between three pipes and each port is either\n * open or closed. With one port closed the symbol shows that port plugged;\n * with fewer than two ports open no flow can pass, and the valve shows as\n * closed. For a valve that opens its ports continuously use\n * `obc-analog-threeway-valve`; for a two-port valve use `obc-digital-valve`.\n *\n * TODO(designer): no icon shows a single open port, so that case uses the\n * closed symbol.\n *\n * @property open1 - Opens port 1.\n * @property open2 - Opens port 2, the stem.\n * @property open3 - Opens port 3.\n * @property orientation - Side the stem points to.\n * @property flows - Readout rows, one per flow: an optional arrow direction with either a value and optional unit (default `%`) or `open` for an `Open`/`Closed` state.\n * @property variant - Visual style of the button surround.\n * @slot badge-top-right - Content projected into the top-right badge position; overrides `badgeAlert`.\n * @slot badge-top-left - Content projected into the top-left badge position; overrides `badgeControl`.\n * @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides `badgeInterlock`.\n * @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides `badgeCommandLocked`.\n * @fires click - Fired when the valve is clicked.\n * @experimental\n */\n@customElement('obc-digital-threeway-valve')\nexport class ObcDigitalThreewayValve extends ObcAbstractAutomationButton {\n @property({type: Boolean}) open1: boolean = false;\n @property({type: Boolean}) open2: boolean = false;\n @property({type: Boolean}) open3: boolean = false;\n @property({type: String}) orientation: ThreewayValveOrientation =\n ThreewayValveOrientation.bottom;\n @property({type: Array, attribute: false}) flows: ThreewayValveFlow[] = [];\n @property({type: String}) variant: DigitalThreewayValveVariant =\n DigitalThreewayValveVariant.regular;\n\n private get ports(): boolean[] {\n return [this.open1, this.open2, this.open3];\n }\n\n override get _on(): boolean {\n return this.ports.filter(Boolean).length >= 2;\n }\n\n override get _readoutPosition(): AutomationButtonReadoutPosition {\n return this.readoutPosition ?? threewayValveOpenSide(this.orientation);\n }\n\n override get extraReadouts(): AutomationButtonReadoutStack[] {\n if (!this.showStatus) {\n return [];\n }\n return threewayValveReadouts(this._on, this.flows, this.showStatusIcon);\n }\n\n private renderIcon(slot: string) {\n const style = `display: block; transform: rotate(${threewayValveRotation(\n this.orientation\n )}deg); line-height: 0;`;\n const ports = this.ports;\n if (!this._on) {\n return html`<obi-threeway-digital-closed\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed>`;\n }\n switch (ports.indexOf(false)) {\n case 0:\n return html`<obi-threeway-digital-closed-left\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed-left>`;\n case 1:\n return html`<obi-threeway-digital-closed-bottom\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed-bottom>`;\n case 2:\n return html`<obi-threeway-digital-closed-right\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed-right>`;\n default:\n return html`<obi-threeway-digital-open\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-open>`;\n }\n }\n\n override get icon() {\n return html`${this.renderIcon('icon')}${this.renderIcon('icon-silhouette')}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-digital-threeway-valve': ObcDigitalThreewayValve;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAmBA,IAAY,8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AACxBA,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,wBAAA,WAAA,SAAA,KAAA,CAAA;AACxBA,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,wBAAA,WAAA,SAAA,KAAA,CAAA;AACxBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,wBAAA,WAAA,eAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS;CAAC,MAAM;CAAO,WAAW;AAAK,CAAC,CAAA,GAAA,wBAAA,WAAA,SAAA,KAAA,CAAA;AACxCA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,wBAAA,WAAA,WAAA,KAAA,CAAA;AARzB,0BAAAA,WAAA,CAAA,cAAc,4BAA4B,CAAA,GAAA,uBAAA"}
1
+ {"version":3,"file":"digital-threeway-valve.js","names":["_decorate"],"sources":["../../../src/automation/digital-threeway-valve/digital-threeway-valve.ts"],"sourcesContent":["import {html} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport '../../icons/icon-threeway-digital-open.js';\nimport '../../icons/icon-threeway-digital-closed.js';\nimport '../../icons/icon-threeway-digital-closed-left.js';\nimport '../../icons/icon-threeway-digital-closed-bottom.js';\nimport '../../icons/icon-threeway-digital-closed-right.js';\nimport {customElement} from '../../decorator.js';\nimport {ObcAbstractAutomationButton} from '../automation-button/abstract-automation-button.js';\nimport {AutomationButtonReadoutPosition} from '../automation-button/automation-button.js';\nimport {AutomationButtonReadoutStack} from '../../components/automation-button-readout-stack/automation-button-readout-stack.js';\nimport {\n ThreewayValveFlow,\n ThreewayValveOrientation,\n threewayValveOpenSide,\n threewayValveReadouts,\n threewayValveRotation,\n} from '../threeway-valve-shared/threeway-valve-shared.js';\n\nexport enum DigitalThreewayValveVariant {\n regular = 'regular',\n flat = 'flat',\n}\n\n/**\n * `<obc-digital-threeway-valve>` – three-way on/off valve for process\n * diagrams, with one open/closed state per port.\n *\n * ## Features\n *\n * - **Three ports:** `open1`, `open2` and `open3` open or close each port.\n * Ports are numbered from the side without a port: with `orientation`\n * `bottom`, port 1 is left, port 2 is the stem at the bottom and port 3 is\n * right. The numbering turns with the symbol.\n * - **Orientation:** `bottom` and `top` lay the valve on a horizontal pipe,\n * `left` and `right` on a vertical one; the value names the side the stem\n * points to.\n * - **Flow readout:** `flows` lists one readout row per flow, each with an\n * optional arrow direction and either a value with a unit (`%` when left out)\n * or a state, `{open}`, shown as `Open` or `Closed` after the arrow, or\n * after the on/off icon when there is no direction. Without flows the\n * readout shows `Open` or `Closed`.\n * - Badges, alert frame, progress and readout placement come from the shared\n * automation button base.\n *\n * ## Usage Guidelines\n *\n * Use where a valve directs flow between three pipes and each port is either\n * open or closed. With one port closed the symbol shows that port plugged;\n * with fewer than two ports open no flow can pass, and the valve shows as\n * closed. For a valve that opens its ports continuously use\n * `obc-analog-threeway-valve`; for a two-port valve use `obc-digital-valve`.\n *\n * TODO(designer): no icon shows a single open port, so that case uses the\n * closed symbol.\n *\n * @property open1 - Opens port 1.\n * @property open2 - Opens port 2, the stem.\n * @property open3 - Opens port 3.\n * @property orientation - Side the stem points to.\n * @property flows - Readout rows, one per flow: an optional arrow direction with either a value and optional unit (default `%`) or `open` for an `Open`/`Closed` state.\n * @property variant - Visual style of the button surround.\n * @slot badge-top-right - Content projected into the top-right badge position; overrides the badge `badgeLayout` puts in that corner.\n * @slot badge-top-left - Content projected into the top-left badge position; overrides the badge `badgeLayout` puts in that corner.\n * @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides the badge `badgeLayout` puts in that corner.\n * @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides the badge `badgeLayout` puts in that corner.\n * @fires click - Fired when the valve is clicked.\n * @experimental\n */\n@customElement('obc-digital-threeway-valve')\nexport class ObcDigitalThreewayValve extends ObcAbstractAutomationButton {\n @property({type: Boolean}) open1: boolean = false;\n @property({type: Boolean}) open2: boolean = false;\n @property({type: Boolean}) open3: boolean = false;\n @property({type: String}) orientation: ThreewayValveOrientation =\n ThreewayValveOrientation.bottom;\n @property({type: Array, attribute: false}) flows: ThreewayValveFlow[] = [];\n @property({type: String}) variant: DigitalThreewayValveVariant =\n DigitalThreewayValveVariant.regular;\n\n private get ports(): boolean[] {\n return [this.open1, this.open2, this.open3];\n }\n\n override get _on(): boolean {\n return this.ports.filter(Boolean).length >= 2;\n }\n\n override get _readoutPosition(): AutomationButtonReadoutPosition {\n return this.readoutPosition ?? threewayValveOpenSide(this.orientation);\n }\n\n override get extraReadouts(): AutomationButtonReadoutStack[] {\n if (!this.showStatus) {\n return [];\n }\n return threewayValveReadouts(this._on, this.flows, this.showStatusIcon);\n }\n\n private renderIcon(slot: string) {\n const style = `display: block; transform: rotate(${threewayValveRotation(\n this.orientation\n )}deg); line-height: 0;`;\n const ports = this.ports;\n if (!this._on) {\n return html`<obi-threeway-digital-closed\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed>`;\n }\n switch (ports.indexOf(false)) {\n case 0:\n return html`<obi-threeway-digital-closed-left\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed-left>`;\n case 1:\n return html`<obi-threeway-digital-closed-bottom\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed-bottom>`;\n case 2:\n return html`<obi-threeway-digital-closed-right\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-closed-right>`;\n default:\n return html`<obi-threeway-digital-open\n usecsscolor\n slot=${slot}\n style=${style}\n ></obi-threeway-digital-open>`;\n }\n }\n\n override get icon() {\n return html`${this.renderIcon('icon')}${this.renderIcon('icon-silhouette')}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-digital-threeway-valve': ObcDigitalThreewayValve;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAmBA,IAAY,8BAAL,yBAAA,6BAAA;CACL,4BAAA,aAAA;CACA,4BAAA,UAAA;;AACF,EAAA,C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AAA,SAAA,KAAA,CAAA;AACxBA,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,wBAAA,WAAA,SAAA,KAAA,CAAA;AACxBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,wBAAA,WAAA,eAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS;CAAC,MAAM;CAAO,WAAW;AAAK,CAAC,CAAA,GAAA,wBAAA,WAAA,SAAA,KAAA,CAAA;AACxCA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,wBAAA,WAAA,WAAA,KAAA,CAAA;AARzB,0BAAAA,WAAA,CAAA,cAAc,4BAA4B,CAAA,GAAA,uBAAA"}
@@ -19,10 +19,10 @@ import '../../icons/icon-electricity-battery-off.js';
19
19
  * Without a visible tag the button is named `Battery`, followed by the state
20
20
  * (`Battery On`) when the state row is shown.
21
21
  *
22
- * @slot badge-top-right - Content projected into the top-right badge position; overrides `badgeAlert`.
23
- * @slot badge-top-left - Content projected into the top-left badge position; overrides `badgeControl`.
24
- * @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides `badgeInterlock`.
25
- * @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides `badgeCommandLocked`.
22
+ * @slot badge-top-right - Content projected into the top-right badge position; overrides the badge `badgeLayout` puts in that corner.
23
+ * @slot badge-top-left - Content projected into the top-left badge position; overrides the badge `badgeLayout` puts in that corner.
24
+ * @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides the badge `badgeLayout` puts in that corner.
25
+ * @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides the badge `badgeLayout` puts in that corner.
26
26
  * @fires click - Fired when the battery is clicked.
27
27
  * @experimental
28
28
  */
@@ -1 +1 @@
1
- {"version":3,"file":"electricity-battery.js","names":["_decorate"],"sources":["../../../src/automation/electricity-battery/electricity-battery.ts"],"sourcesContent":["import '../../icons/icon-electricity-battery-on.js';\nimport '../../icons/icon-electricity-battery-off.js';\nimport {customElement} from '../../decorator.js';\nimport {ObcAbstractAutomationButtonSquared} from '../automation-button/abstract-automation-button-squared.js';\n\n/**\n * `<obc-electricity-battery>` – Battery symbol for electrical automation diagrams.\n *\n * Shows the battery as an on/off device with the readout stack, badges and\n * alert frame of the other two-state devices.\n *\n * ## Usage Guidelines\n *\n * Use it to place a battery on an electrical one-line diagram. For a battery's\n * charge level, use `obc-indicator-battery`; for a battery tank with a fill\n * level, use `obc-automation-tank`.\n *\n * **TODO(designer):** the icons file has no static battery symbol, so a\n * `static` battery keeps its on or off icon.\n *\n * Without a visible tag the button is named `Battery`, followed by the state\n * (`Battery On`) when the state row is shown.\n *\n * @slot badge-top-right - Content projected into the top-right badge position; overrides `badgeAlert`.\n * @slot badge-top-left - Content projected into the top-left badge position; overrides `badgeControl`.\n * @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides `badgeInterlock`.\n * @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides `badgeCommandLocked`.\n * @fires click - Fired when the battery is clicked.\n * @experimental\n */\n@customElement('obc-electricity-battery')\nexport class ObcElectricityBattery extends ObcAbstractAutomationButtonSquared {\n override get _accessibleName(): string | null {\n if (!this.showReadoutStack) return 'Battery';\n if (this.tag) return null;\n return this.showStatus\n ? `Battery ${this.turnedOn ? 'On' : 'Off'}`\n : 'Battery';\n }\n\n override get icon() {\n return this.renderDeviceIcon({\n on: 'electricity-battery-on',\n off: 'electricity-battery-off',\n });\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-electricity-battery': ObcElectricityBattery;\n }\n}\n"],"mappings":";;;;;;AA+BO,IAAM,wBAAN,MAAM,8BAA8B,mCAAmC;CAC5E,IAAa,kBAAiC;EAC5C,IAAI,CAAC,KAAK,kBAAkB,OAAO;EACnC,IAAI,KAAK,KAAK,OAAO;EACrB,OAAO,KAAK,aACR,WAAW,KAAK,WAAW,OAAO,UAClC;CACN;CAEA,IAAa,OAAO;EAClB,OAAO,KAAK,iBAAiB;GAC3B,IAAI;GACJ,KAAK;EACP,CAAC;CACH;AACF;AAhBC,wBAAAA,WAAA,CAAA,cAAc,yBAAyB,CAAA,GAAA,qBAAA"}
1
+ {"version":3,"file":"electricity-battery.js","names":["_decorate"],"sources":["../../../src/automation/electricity-battery/electricity-battery.ts"],"sourcesContent":["import '../../icons/icon-electricity-battery-on.js';\nimport '../../icons/icon-electricity-battery-off.js';\nimport {customElement} from '../../decorator.js';\nimport {ObcAbstractAutomationButtonSquared} from '../automation-button/abstract-automation-button-squared.js';\n\n/**\n * `<obc-electricity-battery>` – Battery symbol for electrical automation diagrams.\n *\n * Shows the battery as an on/off device with the readout stack, badges and\n * alert frame of the other two-state devices.\n *\n * ## Usage Guidelines\n *\n * Use it to place a battery on an electrical one-line diagram. For a battery's\n * charge level, use `obc-indicator-battery`; for a battery tank with a fill\n * level, use `obc-automation-tank`.\n *\n * **TODO(designer):** the icons file has no static battery symbol, so a\n * `static` battery keeps its on or off icon.\n *\n * Without a visible tag the button is named `Battery`, followed by the state\n * (`Battery On`) when the state row is shown.\n *\n * @slot badge-top-right - Content projected into the top-right badge position; overrides the badge `badgeLayout` puts in that corner.\n * @slot badge-top-left - Content projected into the top-left badge position; overrides the badge `badgeLayout` puts in that corner.\n * @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides the badge `badgeLayout` puts in that corner.\n * @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides the badge `badgeLayout` puts in that corner.\n * @fires click - Fired when the battery is clicked.\n * @experimental\n */\n@customElement('obc-electricity-battery')\nexport class ObcElectricityBattery extends ObcAbstractAutomationButtonSquared {\n override get _accessibleName(): string | null {\n if (!this.showReadoutStack) return 'Battery';\n if (this.tag) return null;\n return this.showStatus\n ? `Battery ${this.turnedOn ? 'On' : 'Off'}`\n : 'Battery';\n }\n\n override get icon() {\n return this.renderDeviceIcon({\n on: 'electricity-battery-on',\n off: 'electricity-battery-off',\n });\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-electricity-battery': ObcElectricityBattery;\n }\n}\n"],"mappings":";;;;;;AA+BO,IAAM,wBAAN,MAAM,8BAA8B,mCAAmC;CAC5E,IAAa,kBAAiC;EAC5C,IAAI,CAAC,KAAK,kBAAkB,OAAO;EACnC,IAAI,KAAK,KAAK,OAAO;EACrB,OAAO,KAAK,aACR,WAAW,KAAK,WAAW,OAAO,UAClC;CACN;CAEA,IAAa,OAAO;EAClB,OAAO,KAAK,iBAAiB;GAC3B,IAAI;GACJ,KAAK;EACP,CAAC;CACH;AACF;AAhBC,wBAAAA,WAAA,CAAA,cAAc,yBAAyB,CAAA,GAAA,qBAAA"}
@@ -123,6 +123,8 @@ export declare class ObcBarHorizontal extends ObcBarHorizontal_base {
123
123
  */
124
124
  scaleReferenceSize: number;
125
125
  private _scale;
126
+ /** The drawing's height in viewBox units, kept from the last render for the scale measurement. */
127
+ private _viewBoxThickness;
126
128
  private _resizeController;
127
129
  /** Show scale tickmarks */
128
130
  hasScale: boolean;
@@ -266,6 +268,8 @@ export declare class ObcBarHorizontal extends ObcBarHorizontal_base {
266
268
  * Remove fixed aspect ratio styles when switching back to pixel mode.
267
269
  */
268
270
  private _removeFixedAspectRatioStyles;
271
+ /** Reads the host's content box into the scale; false while the host has no size yet. */
272
+ private _measureScale;
269
273
  /**
270
274
  * Calculate scale based on current element size.
271
275
  * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.
@@ -1 +1 @@
1
- {"version":3,"file":"bar-horizontal.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/bar-horizontal/bar-horizontal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAO,MAAM,KAAK,CAAC;AAErC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,KAAK,CAAC;AAIxC,OAAO,EACL,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACT,MAAM,uCAAuC,CAAC;AAI/C,OAAO,EAUL,SAAS,EACT,QAAQ,EACR,cAAc,EACd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;IAGuB,QAAQ,EAAE,QAAQ,CAAoB;IACtC,QAAQ,EAAE,QAAQ,CAAiB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAa;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAa;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAa;IAE3B,KAAK,EAAE,eAAe,CAA0B;IAGhD,cAAc,EAAE,cAAc,CACjC;IAEvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA2B;IAElC,qBAAqB,UAAS;IAEhD,MAAM;IAiGN,OAAO,CAAC,OAAO,EAAE,cAAc;IAqDxC;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;cAoDL,gBAAgB;IAI1B,iBAAiB,IAAI,IAAI;IAezB,oBAAoB,IAAI,IAAI;IAMrC,OAAO,CAAC,0BAA0B;IASlC;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAMpC;;OAEG;IACH,OAAO,CAAC,6BAA6B;IAMrC,yFAAyF;IACzF,OAAO,CAAC,aAAa;IAarB;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAWnC,OAAO,CAAC,8BAA8B;IAiBtC;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;CAelC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
@@ -3,7 +3,7 @@ import { CHART_DIMENSIONS } from "../../charthelpers/constants.js";
3
3
  import { BorderRadiusPosition, FrameStyle, InstrumentState, Priority } from "../../navigation-instruments/types.js";
4
4
  import { AdviceMixin } from "../../svghelpers/advice-mixin.js";
5
5
  import { nextAdviceMaskId } from "../../svghelpers/advice.js";
6
- import { AdvicePosition, BarContainerStyle, ExternalScaleOrientation, ExternalScaleSide, FillMode, ScaleType, computeExternalScaleEffectiveBarThickness, computeExternalScaleLayout, computeExternalScaleViewBox, computeFixedAspectRatioScale, computeScaleDimensionsForReport, readExternalScaleBorderRadiusPx, renderExternalScale, startExternalScaleBorderRadiusObserver, toExternalScaleLayoutConfig } from "../external-scale/external-scale.js";
6
+ import { AdvicePosition, BarContainerStyle, ExternalScaleOrientation, ExternalScaleSide, FillMode, ScaleType, computeExternalScaleEffectiveBarThickness, computeExternalScaleLayout, computeExternalScaleViewBox, computeFixedAspectRatioScale, computeScaleDimensionsForReport, readContentBox, readExternalScaleBorderRadiusPx, renderExternalScale, startExternalScaleBorderRadiusObserver, toExternalScaleLayoutConfig } from "../external-scale/external-scale.js";
7
7
  import { SetpointMixin } from "../../svghelpers/setpoint-mixin.js";
8
8
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.js";
9
9
  import { LitElement, html } from "lit";
@@ -23,15 +23,17 @@ var ObcBarHorizontal = class ObcBarHorizontal extends AdviceMixin(SetpointMixin(
23
23
  this.fixedAspectRatio = false;
24
24
  this.scaleReferenceSize = 384;
25
25
  this._scale = 1;
26
+ this._viewBoxThickness = 0;
26
27
  this._resizeController = new ResizeController(this, { callback: (entries) => {
27
28
  if (!this.fixedAspectRatio) return;
28
29
  const entry = entries[0];
29
30
  if (!entry) return;
30
- const containerMainAxisSize = entry.contentRect.width;
31
31
  this._scale = computeFixedAspectRatioScale({
32
32
  orientation: ExternalScaleOrientation.horizontal,
33
- containerMainAxisSize,
34
- scaleReferenceSize: this.scaleReferenceSize
33
+ containerMainAxisSize: entry.contentRect.width,
34
+ containerCrossAxisSize: entry.contentRect.height,
35
+ scaleReferenceSize: this.scaleReferenceSize,
36
+ viewBoxThickness: this._viewBoxThickness
35
37
  });
36
38
  this.reportDimensions();
37
39
  } });
@@ -120,6 +122,7 @@ var ObcBarHorizontal = class ObcBarHorizontal extends AdviceMixin(SetpointMixin(
120
122
  highlightCurrentValue: this.highlightCurrentValue
121
123
  };
122
124
  const layout = computeExternalScaleLayout(toExternalScaleLayoutConfig(config));
125
+ this._viewBoxThickness = layout.thickness;
123
126
  const parts = renderExternalScale(config);
124
127
  const viewBox = computeExternalScaleViewBox({
125
128
  orientation: config.orientation,
@@ -155,7 +158,10 @@ var ObcBarHorizontal = class ObcBarHorizontal extends AdviceMixin(SetpointMixin(
155
158
  }
156
159
  if (changed.has("scaleReferenceSize") && this.fixedAspectRatio) this._updateScaleFromCurrentSize();
157
160
  const layoutChanged = changed.has("side") || changed.has("showLabels") || changed.has("showMainTickmarkLabels") || changed.has("hasScale") || changed.has("hasBar") || changed.has("barThickness") || changed.has("tickThickness") || changed.has("labelThickness") || changed.has("scaleType") || changed.has("borderRadiusPosition") || changed.has("borderRadius") || changed.has("advices") || changed.has("advicePosition") || this.setpointPresenceChanged(changed);
158
- if (!this.fixedAspectRatio || layoutChanged) this.reportDimensions();
161
+ if (!this.fixedAspectRatio || layoutChanged) {
162
+ if (this.fixedAspectRatio) this._measureScale();
163
+ this.reportDimensions();
164
+ }
159
165
  }
160
166
  /**
161
167
  * Report scale dimensions to parent chart component.
@@ -234,19 +240,26 @@ var ObcBarHorizontal = class ObcBarHorizontal extends AdviceMixin(SetpointMixin(
234
240
  this.style.width = "";
235
241
  this.style.height = "";
236
242
  }
243
+ /** Reads the host's content box into the scale; false while the host has no size yet. */
244
+ _measureScale() {
245
+ const { width, height } = readContentBox(this);
246
+ if (width <= 0) return false;
247
+ this._scale = computeFixedAspectRatioScale({
248
+ orientation: ExternalScaleOrientation.horizontal,
249
+ containerMainAxisSize: width,
250
+ containerCrossAxisSize: height,
251
+ scaleReferenceSize: this.scaleReferenceSize,
252
+ viewBoxThickness: this._viewBoxThickness
253
+ });
254
+ return true;
255
+ }
237
256
  /**
238
257
  * Calculate scale based on current element size.
239
258
  * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.
240
259
  */
241
260
  _updateScaleFromCurrentSize() {
242
261
  requestAnimationFrame(() => {
243
- const containerWidth = this.clientWidth;
244
- if (containerWidth > 0) {
245
- this._scale = computeFixedAspectRatioScale({
246
- orientation: ExternalScaleOrientation.horizontal,
247
- containerMainAxisSize: containerWidth,
248
- scaleReferenceSize: this.scaleReferenceSize
249
- });
262
+ if (this._measureScale()) {
250
263
  this.requestUpdate();
251
264
  this.reportDimensions();
252
265
  }
@@ -256,17 +269,7 @@ var ObcBarHorizontal = class ObcBarHorizontal extends AdviceMixin(SetpointMixin(
256
269
  if (this.instrumentMode) return;
257
270
  const next = readExternalScaleBorderRadiusPx(this, this.scaleType);
258
271
  if (this._computedBorderRadius !== next) this._computedBorderRadius = next;
259
- if (this.fixedAspectRatio) {
260
- const rect = this.getBoundingClientRect();
261
- if (rect.width > 0) {
262
- this._scale = computeFixedAspectRatioScale({
263
- orientation: ExternalScaleOrientation.horizontal,
264
- containerMainAxisSize: rect.width,
265
- scaleReferenceSize: this.scaleReferenceSize
266
- });
267
- this.reportDimensions();
268
- }
269
- }
272
+ if (this.fixedAspectRatio && this._measureScale()) this.reportDimensions();
270
273
  }
271
274
  /**
272
275
  * Get the effective border radius to use.
@@ -1 +1 @@
1
- {"version":3,"file":"bar-horizontal.js","names":["_decorate"],"sources":["../../../src/building-blocks/bar-horizontal/bar-horizontal.ts"],"sourcesContent":["import {LitElement, html} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport type {PropertyValues} from 'lit';\nimport {customElement} from '../../decorator.js';\nimport {ResizeController} from '@lit-labs/observers/resize-controller.js';\nimport {CHART_DIMENSIONS} from '../../charthelpers/constants.js';\nimport {\n InstrumentState,\n FrameStyle,\n BorderRadiusPosition,\n Priority,\n} from '../../navigation-instruments/types.js';\nimport {AdviceMixin} from '../../svghelpers/advice-mixin.js';\nimport {nextAdviceMaskId} from '../../svghelpers/advice.js';\nimport type {ExternalScaleConfig} from '../external-scale/external-scale.js';\nimport {\n computeExternalScaleViewBox,\n computeFixedAspectRatioScale,\n computeExternalScaleLayout,\n renderExternalScale,\n toExternalScaleLayoutConfig,\n computeScaleDimensionsForReport,\n computeExternalScaleEffectiveBarThickness,\n readExternalScaleBorderRadiusPx,\n startExternalScaleBorderRadiusObserver,\n ScaleType,\n FillMode,\n AdvicePosition,\n BarContainerStyle,\n ExternalScaleOrientation,\n ExternalScaleSide,\n} from '../external-scale/external-scale.js';\nimport {SetpointMixin} from '../../svghelpers/setpoint-mixin.js';\n\n// Re-export shared enums for convenience\nexport {\n ScaleType,\n FillMode,\n AdvicePosition,\n FrameStyle,\n BorderRadiusPosition,\n InstrumentState,\n Priority,\n BarContainerStyle,\n ExternalScaleSide,\n};\n\n/**\n * Horizontal SVG bar + external scale.\n *\n * This is a thin web-component wrapper around the pure SVG building-block renderer in `external-scale.ts`.\n *\n * It sets up the outer `<svg>`/`viewBox` for a horizontal scale and delegates rendering/layout to:\n * - `computeExternalScaleLayout(...)`\n * - `renderExternalScale(config)`\n *\n * For renderer documentation see: **Building Blocks/External Scale**.\n *\n * For more test cases (Auto at-setpoint detection, Manual at-setpoint control, Deadband tuning and Zero snap behavior) see: **Bars and Graphs/Bar Vertical**.\n *\n * Set `priority` to `Priority.enhanced` to use the blue/enhanced color palette\n * for bar fill and setpoint instead of the default gray/regular palette\n * (default: `Priority.regular`).\n *\n * @property minValue - Minimum scale value (manual mode)\n * @property maxValue - Maximum scale value (manual mode)\n * @property reverse - Plot `minValue` at the right so values grow leftward.\n * @property width - Total width in pixels (including padding bands)\n * @availableWhen width fixedAspectRatio==false\n * @property paddingLeft - Padding left of the drawing area\n * @property paddingRight - Padding right of the drawing area\n * @property side - Which side this scale lives on\n * @property fixedAspectRatio - When true, freezes all internal calculations and scales the entire component\n * proportionally (like CSS transform:scale), except label font-size remains constant.\n * When false (default), dimensions react to component properties.\n * @property scaleReferenceSize - Reference size for proportional scaling when fixedAspectRatio is true.\n * At this width, the scale renders at native 1:1 (matches Figma design).\n * Above this width, the scale grows proportionally; below, it shrinks.\n * @availableWhen scaleReferenceSize fixedAspectRatio==true\n * @property hasScale - Show scale tickmarks\n * @property showMainTickmarkLabels - Label the main tickmarks (min / 0 / max) instead of the\n * primary interval ladder, for a scale too short for a ladder. A chart sets it on its\n * slotted scales below its label threshold.\n * @availableWhen showMainTickmarkLabels showLabels==true\n * @property hasBar - Show bar\n * @property scaleBackground - Show background behind the scale tickmarks.\n * @property barContainerStyle - Bar container background style.\n * When undefined, defaults based on scaleBackground.\n * Set explicitly to override: 'primary' (lighter) or 'secondary' (gray).\n * @availableWhen barContainerStyle hasBar==true\n * @property barThickness - Bar/fill thickness in pixels\n * @availableWhen barThickness hasBar==true\n * @property tickThickness - Tickmark band thickness in pixels.\n * @availableWhen tickThickness hasScale==true\n * @property labelThickness - Label band thickness in pixels.\n * @availableWhen labelThickness showLabels==true\n * @property mainTickmarks - Array of values for main tickmarks. When undefined, no main tickmarks shown.\n * When empty array [], defaults to [minValue, 0, maxValue].\n * @availableWhen mainTickmarks hasScale==true\n * @property primaryTickmarkInterval - Interval for primary (longest) tickmarks with labels (minimum 1).\n * When undefined, no primary tickmarks are shown.\n * @availableWhen primaryTickmarkInterval hasScale==true || showLabels==true\n * @property secondaryTickmarkInterval - Interval for secondary (medium) tickmarks (minimum 1).\n * When undefined, no secondary tickmarks are shown.\n * @availableWhen secondaryTickmarkInterval hasScale==true\n * @property tertiaryTickmarkInterval - Interval for tertiary (shortest) tickmarks (minimum 1).\n * When undefined, no tertiary tickmarks are shown.\n * @availableWhen tertiaryTickmarkInterval hasScale==true\n * @property scaleType - Scale display mode: regular or condensed (shorter ticks)\n * @property frameStyle - Frame style: regular (4px gap for all), flat (main tickmarks touch edge), framed, or instrument\n * @availableWhen frameStyle hasScale==true && mainTickmarks!=undefined\n * @property borderRadiusPosition - Border radius position based on component layout\n * @availableWhen borderRadiusPosition hasBar==true\n * @property instrumentMode - When true, the component is used inside an instrument (e.g., gauge-trend).\n * In this mode, only label font size responds to .obc-component-size-* CSS classes.\n * Border radius and bar thickness use explicit values or defaults, not CSS variables.\n * @property borderRadius - Explicit border radius value in pixels.\n * When instrumentMode=true, this value is used directly (defaults to 8px for regular, 4px for condensed).\n * When instrumentMode=false, this is ignored and border radius is read from CSS variable.\n * @availableWhen borderRadius instrumentMode==true\n * @property priority - Color priority: enhanced uses blue instrument colors for bar fill and setpoint\n * @property fillMode - Fill visualization mode: fill or tint\n * @availableWhen fillMode hasBar==true && value!=undefined\n * @property fillMin - Minimum fill value for tint mode (defaults to 0)\n * @availableWhen fillMin hasBar==true && value!=undefined\n * @property fillMax - Maximum fill value for tint mode (defaults to value)\n * @availableWhen fillMax hasBar==true && value!=undefined\n * @property value - Current value (bar fill level)\n * @property state - Instrument state (affects colors and some marker behavior)\n * @property advicePosition - Advice overlay positioning: center (in bar), inner (covers minor ticks), outer (no overlap)\n * @availableWhen advicePosition hasBar==true\n * @property advices - Advice/alert overlays with state and positioning.\n * When undefined or empty, no advice shown.\n * @property highlightCurrentValue - When true, displays a dot indicator at the current value position.\n * The dot is rendered in the scale band, touching its inner edge (towards the chart).\n * This provides an alternative to bar fill for highlighting the current value.\n * @fires {CustomEvent} scale-dimensions-changed - Fired when the scale's computed layout thickness changes; a parent chart listens for this to reserve space for the scale. It bubbles to the chart slot the scale sits in and does not leave the shadow root around it.\n * @beta\n */\n@customElement('obc-bar-horizontal')\nexport class ObcBarHorizontal extends AdviceMixin(\n SetpointMixin(LitElement, {\n defaultDeadband: 1,\n })\n) {\n @property({type: Number}) minValue = 0;\n @property({type: Number}) maxValue = 100;\n @property({type: Boolean}) reverse = false;\n\n @property({type: Number}) width = 320;\n\n @property({type: Number}) paddingLeft: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: Number}) paddingRight: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: String}) side: ExternalScaleSide = ExternalScaleSide.bottom;\n\n @property({type: Boolean})\n fixedAspectRatio = false;\n\n @property({type: Number})\n scaleReferenceSize = 384;\n\n @state()\n private _scale = 1;\n\n // ResizeController automatically subscribes/unsubscribes based on component lifecycle\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _resizeController = new ResizeController(this, {\n callback: (entries) => {\n if (!this.fixedAspectRatio) return;\n\n const entry = entries[0];\n if (!entry) return;\n\n // Use the centralized function that computes scale based on reference size\n // For horizontal scales, compare container width to reference size\n const containerMainAxisSize = entry.contentRect.width;\n\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n\n // Report scaled dimensions to parent chart\n this.reportDimensions();\n },\n });\n\n // Bands (thickness)\n @property({type: Boolean, attribute: false}) hasScale = true;\n @property({type: Boolean, attribute: false}) showLabels = true;\n @property({type: Boolean}) showMainTickmarkLabels = false;\n @property({type: Boolean}) hasBar = false;\n @property({type: Boolean})\n scaleBackground = false;\n @property({type: String})\n barContainerStyle?: BarContainerStyle = undefined;\n @property({type: Number}) barThickness = 24;\n @property({type: Number}) tickThickness = 24;\n @property({type: Number}) labelThickness = 60;\n\n // Tick configuration\n @property({type: Array, attribute: false}) mainTickmarks?: number[] = [];\n @property({type: Number}) primaryTickmarkInterval?: number = undefined;\n @property({type: Number}) secondaryTickmarkInterval?: number = undefined;\n @property({type: Number}) tertiaryTickmarkInterval?: number = undefined;\n @property({type: String}) scaleType: ScaleType = ScaleType.regular;\n @property({type: String}) frameStyle: FrameStyle = FrameStyle.regular;\n @property({type: String})\n borderRadiusPosition?: BorderRadiusPosition = undefined;\n\n @property({type: Boolean})\n instrumentMode = false;\n\n @property({type: Number})\n borderRadius?: number = undefined;\n\n @state()\n private _computedBorderRadius?: number;\n\n private _borderRadiusObserver?: MutationObserver;\n\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _borderRadiusResizeController = new ResizeController(this, {\n callback: () => {\n // Skip CSS variable reading in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n }\n },\n });\n\n // Values\n @property({type: String}) priority: Priority = Priority.regular;\n @property({type: String}) fillMode: FillMode = FillMode.fill;\n @property({type: Number}) fillMin?: number = undefined;\n @property({type: Number}) fillMax?: number = undefined;\n @property({type: Number}) value?: number = undefined;\n\n @property({type: String}) state: InstrumentState = InstrumentState.active;\n\n // Advice\n @property({type: String}) advicePosition: AdvicePosition =\n AdvicePosition.inner;\n // Mask ids are document-scoped, so each scale names its own.\n private readonly _adviceMaskPrefix = nextAdviceMaskId('bar');\n\n @property({type: Boolean}) highlightCurrentValue = false;\n\n override render() {\n // When fixedAspectRatio is true, use scaleReferenceSize for the viewBox length.\n // This makes the SVG render at the \"design reference size\" and then scale\n // proportionally to fit the actual container via preserveAspectRatio=\"xMidYMid meet\".\n // The _scale CSS variable counter-scales text labels to maintain constant visual size.\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.width;\n\n // The parent chart component (chart-line-base) calculates and passes the correct\n // viewBox padding values when fixedAspectRatioScaling is enabled. The padding is\n // pre-scaled to: basePadding * scaleReferenceSize / referenceWidth\n // This ensures the visual padding matches the chart's Canvas padding at any aspect ratio.\n\n const config: ExternalScaleConfig = {\n orientation: ExternalScaleOrientation.horizontal,\n side: this.side,\n length: effectiveLength,\n paddingStart: this.paddingLeft,\n paddingEnd: this.paddingRight,\n minValue: this.minValue,\n maxValue: this.maxValue,\n reverse: this.reverse,\n hasScale: this.hasScale,\n labels: this.showLabels,\n mainTickmarkLabels: this.showMainTickmarkLabels,\n hasBar: this.hasBar,\n scaleBackground: this.scaleBackground,\n barContainerStyle: this.barContainerStyle,\n barThickness: this.barThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n borderRadius: this._getEffectiveBorderRadius(),\n mainTickmarks: this.mainTickmarks,\n primaryTickmarkInterval: this.primaryTickmarkInterval,\n secondaryTickmarkInterval: this.secondaryTickmarkInterval,\n tertiaryTickmarkInterval: this.tertiaryTickmarkInterval,\n scaleType: this.scaleType,\n frameStyle: this.frameStyle,\n borderRadiusPosition: this.borderRadiusPosition,\n priority: this.priority,\n setpointOverride: this.setpointOverride,\n fillMode: this.fillMode,\n fillMin: this.fillMin,\n fillMax: this.fillMax,\n value: this.value,\n setpoint: this.setpoint,\n newSetpoint: this.newSetpoint,\n atSetpoint: this.atSetpoint,\n autoAtSetpoint: this.autoAtSetpoint,\n autoAtSetpointDeadband: this.autoAtSetpointDeadband,\n setpointAtZeroDeadband: this.setpointAtZeroDeadband,\n animateSetpoint: this.animateSetpoint,\n departingNewSetpoint: this.departingNewSetpoint,\n state: this.state,\n touching: this.touching,\n advicePosition: this.advicePosition,\n advices: this.advices,\n adviceTrigger: this.adviceTrigger,\n adviceEmphasis: this.adviceEmphasis,\n adviceMaskPrefix: this._adviceMaskPrefix,\n fixedAspectRatio: this.fixedAspectRatio,\n instrumentMode: this.instrumentMode,\n highlightCurrentValue: this.highlightCurrentValue,\n };\n\n const layout = computeExternalScaleLayout(\n toExternalScaleLayoutConfig(config)\n );\n\n const parts = renderExternalScale(config);\n\n const viewBox = computeExternalScaleViewBox(\n {orientation: config.orientation, length: effectiveLength},\n layout\n );\n const preserveAspectRatio = this.fixedAspectRatio\n ? 'xMidYMid meet'\n : 'none';\n\n return html`\n <svg\n width=${this.fixedAspectRatio ? '100%' : `${this.width}px`}\n height=${this.fixedAspectRatio ? '100%' : `${viewBox.height}px`}\n viewBox=\"${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}\"\n preserveAspectRatio=\"${preserveAspectRatio}\"\n style=\"--scale: ${this.fixedAspectRatio ? this._scale : 1};\"\n part=\"svg\"\n >\n ${parts.barContainer} ${parts.barFill} ${parts.scaleBackground}\n ${parts.tickmarks} ${parts.labels} ${parts.adviceOverlays}\n ${parts.currentValueDot} ${parts.setpoint}\n </svg>\n `;\n }\n\n override updated(changed: PropertyValues) {\n super.updated(changed);\n\n if (changed.has('scaleType')) {\n this._refreshBorderRadiusFromCssVar();\n }\n\n // Update host styles when fixedAspectRatio changes\n if (changed.has('fixedAspectRatio')) {\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n // Force initial scale calculation based on current size\n this._updateScaleFromCurrentSize();\n } else {\n this._removeFixedAspectRatioStyles();\n this._scale = 1;\n }\n }\n\n // Also recalculate scale when scaleReferenceSize changes\n if (changed.has('scaleReferenceSize') && this.fixedAspectRatio) {\n this._updateScaleFromCurrentSize();\n }\n\n // Report dimensions to parent chart when layout-affecting properties change.\n // In fixedAspectRatio mode, resize events also trigger reportDimensions() via ResizeController.\n // In regular mode, we report on every update to keep parent chart in sync.\n // Layout-affecting properties change the computed thickness and must notify the parent\n // even in fixedAspectRatio mode to keep chart padding accurate.\n const layoutChanged =\n changed.has('side') ||\n changed.has('showLabels') ||\n changed.has('showMainTickmarkLabels') ||\n changed.has('hasScale') ||\n changed.has('hasBar') ||\n changed.has('barThickness') ||\n changed.has('tickThickness') ||\n changed.has('labelThickness') ||\n changed.has('scaleType') ||\n changed.has('borderRadiusPosition') ||\n changed.has('borderRadius') ||\n changed.has('advices') ||\n changed.has('advicePosition') ||\n this.setpointPresenceChanged(changed);\n\n if (!this.fixedAspectRatio || layoutChanged) {\n this.reportDimensions();\n }\n }\n\n /**\n * Report scale dimensions to parent chart component.\n * When fixedAspectRatio=true, reports the actual visual (scaled) thickness\n * so the chart can correctly reserve space for the scale.\n * When fixedAspectRatio=false, reports the base/unscaled thickness.\n */\n private reportDimensions() {\n const effectiveBarThickness = computeExternalScaleEffectiveBarThickness({\n hasBar: this.hasBar,\n barThickness: this.barThickness,\n borderRadius: this._getEffectiveBorderRadius(),\n scaleType: this.scaleType,\n });\n\n // Use scaleReferenceSize for layout calculation when in fixedAspectRatio mode\n // This ensures consistent layout dimensions based on the design reference size\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.width;\n\n const baseDimensions = computeScaleDimensionsForReport({\n orientation: ExternalScaleOrientation.horizontal,\n side: this.side,\n hasBar: this.hasBar,\n hasScale: this.hasScale,\n labels: this.showLabels,\n barThickness: effectiveBarThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n length: effectiveLength,\n scaleType: this.scaleType,\n advicePosition: this.advicePosition,\n hasAdvice: !!this.advices && this.advices.length > 0,\n hasAdviceIcon: !!this.advices?.some((a) => a.showIcon),\n hasSetpoint:\n this.setpoint !== undefined ||\n this.newSetpoint !== undefined ||\n this.departingNewSetpoint !== undefined,\n });\n\n // When fixedAspectRatio=true, the SVG scales proportionally via preserveAspectRatio=\"meet\".\n // The visual thickness = baseThickness × scale, where scale = containerSize / scaleReferenceSize.\n // Report the actual visual thickness so the chart can reserve the correct space.\n const dimensions = this.fixedAspectRatio\n ? {\n ...baseDimensions,\n thickness: Math.round(baseDimensions.thickness * this._scale),\n }\n : baseDimensions;\n\n this.dispatchEvent(\n new CustomEvent('scale-dimensions-changed', {\n detail: dimensions,\n bubbles: true,\n })\n );\n }\n\n protected override createRenderRoot() {\n return this;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Only read from CSS variable and observe changes when not in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n this._startBorderRadiusObserver();\n }\n\n // Ensure the element fills its container when in fixedAspectRatio mode\n // Custom elements are display:inline by default, which doesn't work for percentage-based sizing\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n }\n }\n\n override disconnectedCallback(): void {\n this._borderRadiusObserver?.disconnect();\n this._borderRadiusObserver = undefined;\n super.disconnectedCallback();\n }\n\n private _startBorderRadiusObserver(): void {\n this._borderRadiusObserver?.disconnect();\n\n this._borderRadiusObserver = startExternalScaleBorderRadiusObserver(\n this,\n () => this._refreshBorderRadiusFromCssVar()\n );\n }\n\n /**\n * Apply CSS styles needed for fixedAspectRatio mode.\n * Custom elements are display:inline by default, which doesn't work with percentage-based sizing.\n * We need display:block and width:100% to fill the slot container.\n */\n private _applyFixedAspectRatioStyles(): void {\n this.style.display = 'block';\n this.style.width = '100%';\n this.style.height = 'auto';\n }\n\n /**\n * Remove fixed aspect ratio styles when switching back to pixel mode.\n */\n private _removeFixedAspectRatioStyles(): void {\n this.style.display = '';\n this.style.width = '';\n this.style.height = '';\n }\n\n /**\n * Calculate scale based on current element size.\n * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.\n */\n private _updateScaleFromCurrentSize(): void {\n // Use requestAnimationFrame to ensure layout is complete\n requestAnimationFrame(() => {\n const containerWidth = this.clientWidth;\n if (containerWidth > 0) {\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize: containerWidth,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n this.requestUpdate();\n // Report updated dimensions to parent (matches pattern in ResizeController and _refreshBorderRadiusFromCssVar)\n this.reportDimensions();\n }\n });\n }\n\n private _refreshBorderRadiusFromCssVar(): void {\n // Skip CSS variable reading in instrument mode\n if (this.instrumentMode) return;\n\n const next = readExternalScaleBorderRadiusPx(this, this.scaleType);\n\n if (this._computedBorderRadius !== next) {\n this._computedBorderRadius = next;\n }\n\n // In fixed-aspect-ratio mode, recompute scale when border radius changes\n // (border radius affects effective bar thickness and therefore viewBox)\n if (this.fixedAspectRatio) {\n const rect = this.getBoundingClientRect();\n if (rect.width > 0) {\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize: rect.width,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n // Report updated dimensions\n this.reportDimensions();\n }\n }\n }\n\n /**\n * Get the effective border radius to use.\n * In instrument mode: use explicit borderRadius prop or default based on scaleType.\n * In normal mode: use CSS variable computed value.\n */\n private _getEffectiveBorderRadius(): number {\n if (this.instrumentMode) {\n // In instrument mode, use explicit value or default\n if (this.borderRadius !== undefined) {\n return this.borderRadius;\n }\n // Default: 8px for regular, 4px for condensed\n return this.scaleType === ScaleType.condensed ? 4 : 8;\n }\n // Normal mode: use CSS variable computed value\n return (\n this._computedBorderRadius ??\n (this.scaleType === ScaleType.condensed ? 4 : 8)\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-bar-horizontal': ObcBarHorizontal;\n }\n}\n"],"mappings":";;;;;;;;;;;;AA4IO,IAAM,mBAAN,MAAM,yBAAyB,YACpC,cAAc,YAAY,EACxB,iBAAiB,EACnB,CAAC,CACH,CAAC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,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,YAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,YAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,WAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,WAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,SAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,SAAA,KAAA,CAAA;AAGvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,kBAAA,KAAA,CAAA;AAKvBA,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,iBAAA,WAAA,yBAAA,KAAA,CAAA;AAhH1B,mBAAAA,WAAA,CAAA,cAAc,oBAAoB,CAAA,GAAA,gBAAA"}
1
+ {"version":3,"file":"bar-horizontal.js","names":["_decorate"],"sources":["../../../src/building-blocks/bar-horizontal/bar-horizontal.ts"],"sourcesContent":["import {LitElement, html} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport type {PropertyValues} from 'lit';\nimport {customElement} from '../../decorator.js';\nimport {ResizeController} from '@lit-labs/observers/resize-controller.js';\nimport {CHART_DIMENSIONS} from '../../charthelpers/constants.js';\nimport {\n InstrumentState,\n FrameStyle,\n BorderRadiusPosition,\n Priority,\n} from '../../navigation-instruments/types.js';\nimport {AdviceMixin} from '../../svghelpers/advice-mixin.js';\nimport {nextAdviceMaskId} from '../../svghelpers/advice.js';\nimport type {ExternalScaleConfig} from '../external-scale/external-scale.js';\nimport {\n computeExternalScaleViewBox,\n computeFixedAspectRatioScale,\n computeExternalScaleLayout,\n renderExternalScale,\n toExternalScaleLayoutConfig,\n computeScaleDimensionsForReport,\n computeExternalScaleEffectiveBarThickness,\n readExternalScaleBorderRadiusPx,\n startExternalScaleBorderRadiusObserver,\n readContentBox,\n ScaleType,\n FillMode,\n AdvicePosition,\n BarContainerStyle,\n ExternalScaleOrientation,\n ExternalScaleSide,\n} from '../external-scale/external-scale.js';\nimport {SetpointMixin} from '../../svghelpers/setpoint-mixin.js';\n\n// Re-export shared enums for convenience\nexport {\n ScaleType,\n FillMode,\n AdvicePosition,\n FrameStyle,\n BorderRadiusPosition,\n InstrumentState,\n Priority,\n BarContainerStyle,\n ExternalScaleSide,\n};\n\n/**\n * Horizontal SVG bar + external scale.\n *\n * This is a thin web-component wrapper around the pure SVG building-block renderer in `external-scale.ts`.\n *\n * It sets up the outer `<svg>`/`viewBox` for a horizontal scale and delegates rendering/layout to:\n * - `computeExternalScaleLayout(...)`\n * - `renderExternalScale(config)`\n *\n * For renderer documentation see: **Building Blocks/External Scale**.\n *\n * For more test cases (Auto at-setpoint detection, Manual at-setpoint control, Deadband tuning and Zero snap behavior) see: **Bars and Graphs/Bar Vertical**.\n *\n * Set `priority` to `Priority.enhanced` to use the blue/enhanced color palette\n * for bar fill and setpoint instead of the default gray/regular palette\n * (default: `Priority.regular`).\n *\n * @property minValue - Minimum scale value (manual mode)\n * @property maxValue - Maximum scale value (manual mode)\n * @property reverse - Plot `minValue` at the right so values grow leftward.\n * @property width - Total width in pixels (including padding bands)\n * @availableWhen width fixedAspectRatio==false\n * @property paddingLeft - Padding left of the drawing area\n * @property paddingRight - Padding right of the drawing area\n * @property side - Which side this scale lives on\n * @property fixedAspectRatio - When true, freezes all internal calculations and scales the entire component\n * proportionally (like CSS transform:scale), except label font-size remains constant.\n * When false (default), dimensions react to component properties.\n * @property scaleReferenceSize - Reference size for proportional scaling when fixedAspectRatio is true.\n * At this width, the scale renders at native 1:1 (matches Figma design).\n * Above this width, the scale grows proportionally; below, it shrinks.\n * @availableWhen scaleReferenceSize fixedAspectRatio==true\n * @property hasScale - Show scale tickmarks\n * @property showMainTickmarkLabels - Label the main tickmarks (min / 0 / max) instead of the\n * primary interval ladder, for a scale too short for a ladder. A chart sets it on its\n * slotted scales below its label threshold.\n * @availableWhen showMainTickmarkLabels showLabels==true\n * @property hasBar - Show bar\n * @property scaleBackground - Show background behind the scale tickmarks.\n * @property barContainerStyle - Bar container background style.\n * When undefined, defaults based on scaleBackground.\n * Set explicitly to override: 'primary' (lighter) or 'secondary' (gray).\n * @availableWhen barContainerStyle hasBar==true\n * @property barThickness - Bar/fill thickness in pixels\n * @availableWhen barThickness hasBar==true\n * @property tickThickness - Tickmark band thickness in pixels.\n * @availableWhen tickThickness hasScale==true\n * @property labelThickness - Label band thickness in pixels.\n * @availableWhen labelThickness showLabels==true\n * @property mainTickmarks - Array of values for main tickmarks. When undefined, no main tickmarks shown.\n * When empty array [], defaults to [minValue, 0, maxValue].\n * @availableWhen mainTickmarks hasScale==true\n * @property primaryTickmarkInterval - Interval for primary (longest) tickmarks with labels (minimum 1).\n * When undefined, no primary tickmarks are shown.\n * @availableWhen primaryTickmarkInterval hasScale==true || showLabels==true\n * @property secondaryTickmarkInterval - Interval for secondary (medium) tickmarks (minimum 1).\n * When undefined, no secondary tickmarks are shown.\n * @availableWhen secondaryTickmarkInterval hasScale==true\n * @property tertiaryTickmarkInterval - Interval for tertiary (shortest) tickmarks (minimum 1).\n * When undefined, no tertiary tickmarks are shown.\n * @availableWhen tertiaryTickmarkInterval hasScale==true\n * @property scaleType - Scale display mode: regular or condensed (shorter ticks)\n * @property frameStyle - Frame style: regular (4px gap for all), flat (main tickmarks touch edge), framed, or instrument\n * @availableWhen frameStyle hasScale==true && mainTickmarks!=undefined\n * @property borderRadiusPosition - Border radius position based on component layout\n * @availableWhen borderRadiusPosition hasBar==true\n * @property instrumentMode - When true, the component is used inside an instrument (e.g., gauge-trend).\n * In this mode, only label font size responds to .obc-component-size-* CSS classes.\n * Border radius and bar thickness use explicit values or defaults, not CSS variables.\n * @property borderRadius - Explicit border radius value in pixels.\n * When instrumentMode=true, this value is used directly (defaults to 8px for regular, 4px for condensed).\n * When instrumentMode=false, this is ignored and border radius is read from CSS variable.\n * @availableWhen borderRadius instrumentMode==true\n * @property priority - Color priority: enhanced uses blue instrument colors for bar fill and setpoint\n * @property fillMode - Fill visualization mode: fill or tint\n * @availableWhen fillMode hasBar==true && value!=undefined\n * @property fillMin - Minimum fill value for tint mode (defaults to 0)\n * @availableWhen fillMin hasBar==true && value!=undefined\n * @property fillMax - Maximum fill value for tint mode (defaults to value)\n * @availableWhen fillMax hasBar==true && value!=undefined\n * @property value - Current value (bar fill level)\n * @property state - Instrument state (affects colors and some marker behavior)\n * @property advicePosition - Advice overlay positioning: center (in bar), inner (covers minor ticks), outer (no overlap)\n * @availableWhen advicePosition hasBar==true\n * @property advices - Advice/alert overlays with state and positioning.\n * When undefined or empty, no advice shown.\n * @property highlightCurrentValue - When true, displays a dot indicator at the current value position.\n * The dot is rendered in the scale band, touching its inner edge (towards the chart).\n * This provides an alternative to bar fill for highlighting the current value.\n * @fires {CustomEvent} scale-dimensions-changed - Fired when the scale's computed layout thickness changes; a parent chart listens for this to reserve space for the scale. It bubbles to the chart slot the scale sits in and does not leave the shadow root around it.\n * @beta\n */\n@customElement('obc-bar-horizontal')\nexport class ObcBarHorizontal extends AdviceMixin(\n SetpointMixin(LitElement, {\n defaultDeadband: 1,\n })\n) {\n @property({type: Number}) minValue = 0;\n @property({type: Number}) maxValue = 100;\n @property({type: Boolean}) reverse = false;\n\n @property({type: Number}) width = 320;\n\n @property({type: Number}) paddingLeft: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: Number}) paddingRight: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: String}) side: ExternalScaleSide = ExternalScaleSide.bottom;\n\n @property({type: Boolean})\n fixedAspectRatio = false;\n\n @property({type: Number})\n scaleReferenceSize = 384;\n\n @state()\n private _scale = 1;\n\n /** The drawing's height in viewBox units, kept from the last render for the scale measurement. */\n private _viewBoxThickness = 0;\n\n // ResizeController automatically subscribes/unsubscribes based on component lifecycle\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _resizeController = new ResizeController(this, {\n callback: (entries) => {\n if (!this.fixedAspectRatio) return;\n\n const entry = entries[0];\n if (!entry) return;\n\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize: entry.contentRect.width,\n containerCrossAxisSize: entry.contentRect.height,\n scaleReferenceSize: this.scaleReferenceSize,\n viewBoxThickness: this._viewBoxThickness,\n });\n\n // Report scaled dimensions to parent chart\n this.reportDimensions();\n },\n });\n\n // Bands (thickness)\n @property({type: Boolean, attribute: false}) hasScale = true;\n @property({type: Boolean, attribute: false}) showLabels = true;\n @property({type: Boolean}) showMainTickmarkLabels = false;\n @property({type: Boolean}) hasBar = false;\n @property({type: Boolean})\n scaleBackground = false;\n @property({type: String})\n barContainerStyle?: BarContainerStyle = undefined;\n @property({type: Number}) barThickness = 24;\n @property({type: Number}) tickThickness = 24;\n @property({type: Number}) labelThickness = 60;\n\n // Tick configuration\n @property({type: Array, attribute: false}) mainTickmarks?: number[] = [];\n @property({type: Number}) primaryTickmarkInterval?: number = undefined;\n @property({type: Number}) secondaryTickmarkInterval?: number = undefined;\n @property({type: Number}) tertiaryTickmarkInterval?: number = undefined;\n @property({type: String}) scaleType: ScaleType = ScaleType.regular;\n @property({type: String}) frameStyle: FrameStyle = FrameStyle.regular;\n @property({type: String})\n borderRadiusPosition?: BorderRadiusPosition = undefined;\n\n @property({type: Boolean})\n instrumentMode = false;\n\n @property({type: Number})\n borderRadius?: number = undefined;\n\n @state()\n private _computedBorderRadius?: number;\n\n private _borderRadiusObserver?: MutationObserver;\n\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _borderRadiusResizeController = new ResizeController(this, {\n callback: () => {\n // Skip CSS variable reading in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n }\n },\n });\n\n // Values\n @property({type: String}) priority: Priority = Priority.regular;\n @property({type: String}) fillMode: FillMode = FillMode.fill;\n @property({type: Number}) fillMin?: number = undefined;\n @property({type: Number}) fillMax?: number = undefined;\n @property({type: Number}) value?: number = undefined;\n\n @property({type: String}) state: InstrumentState = InstrumentState.active;\n\n // Advice\n @property({type: String}) advicePosition: AdvicePosition =\n AdvicePosition.inner;\n // Mask ids are document-scoped, so each scale names its own.\n private readonly _adviceMaskPrefix = nextAdviceMaskId('bar');\n\n @property({type: Boolean}) highlightCurrentValue = false;\n\n override render() {\n // When fixedAspectRatio is true, use scaleReferenceSize for the viewBox length.\n // This makes the SVG render at the \"design reference size\" and then scale\n // proportionally to fit the actual container via preserveAspectRatio=\"xMidYMid meet\".\n // The _scale CSS variable counter-scales text labels to maintain constant visual size.\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.width;\n\n // The parent chart component (chart-line-base) calculates and passes the correct\n // viewBox padding values when fixedAspectRatioScaling is enabled. The padding is\n // pre-scaled to: basePadding * scaleReferenceSize / referenceWidth\n // This ensures the visual padding matches the chart's Canvas padding at any aspect ratio.\n\n const config: ExternalScaleConfig = {\n orientation: ExternalScaleOrientation.horizontal,\n side: this.side,\n length: effectiveLength,\n paddingStart: this.paddingLeft,\n paddingEnd: this.paddingRight,\n minValue: this.minValue,\n maxValue: this.maxValue,\n reverse: this.reverse,\n hasScale: this.hasScale,\n labels: this.showLabels,\n mainTickmarkLabels: this.showMainTickmarkLabels,\n hasBar: this.hasBar,\n scaleBackground: this.scaleBackground,\n barContainerStyle: this.barContainerStyle,\n barThickness: this.barThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n borderRadius: this._getEffectiveBorderRadius(),\n mainTickmarks: this.mainTickmarks,\n primaryTickmarkInterval: this.primaryTickmarkInterval,\n secondaryTickmarkInterval: this.secondaryTickmarkInterval,\n tertiaryTickmarkInterval: this.tertiaryTickmarkInterval,\n scaleType: this.scaleType,\n frameStyle: this.frameStyle,\n borderRadiusPosition: this.borderRadiusPosition,\n priority: this.priority,\n setpointOverride: this.setpointOverride,\n fillMode: this.fillMode,\n fillMin: this.fillMin,\n fillMax: this.fillMax,\n value: this.value,\n setpoint: this.setpoint,\n newSetpoint: this.newSetpoint,\n atSetpoint: this.atSetpoint,\n autoAtSetpoint: this.autoAtSetpoint,\n autoAtSetpointDeadband: this.autoAtSetpointDeadband,\n setpointAtZeroDeadband: this.setpointAtZeroDeadband,\n animateSetpoint: this.animateSetpoint,\n departingNewSetpoint: this.departingNewSetpoint,\n state: this.state,\n touching: this.touching,\n advicePosition: this.advicePosition,\n advices: this.advices,\n adviceTrigger: this.adviceTrigger,\n adviceEmphasis: this.adviceEmphasis,\n adviceMaskPrefix: this._adviceMaskPrefix,\n fixedAspectRatio: this.fixedAspectRatio,\n instrumentMode: this.instrumentMode,\n highlightCurrentValue: this.highlightCurrentValue,\n };\n\n const layout = computeExternalScaleLayout(\n toExternalScaleLayoutConfig(config)\n );\n this._viewBoxThickness = layout.thickness;\n\n const parts = renderExternalScale(config);\n\n const viewBox = computeExternalScaleViewBox(\n {orientation: config.orientation, length: effectiveLength},\n layout\n );\n const preserveAspectRatio = this.fixedAspectRatio\n ? 'xMidYMid meet'\n : 'none';\n\n return html`\n <svg\n width=${this.fixedAspectRatio ? '100%' : `${this.width}px`}\n height=${this.fixedAspectRatio ? '100%' : `${viewBox.height}px`}\n viewBox=\"${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}\"\n preserveAspectRatio=\"${preserveAspectRatio}\"\n style=\"--scale: ${this.fixedAspectRatio ? this._scale : 1};\"\n part=\"svg\"\n >\n ${parts.barContainer} ${parts.barFill} ${parts.scaleBackground}\n ${parts.tickmarks} ${parts.labels} ${parts.adviceOverlays}\n ${parts.currentValueDot} ${parts.setpoint}\n </svg>\n `;\n }\n\n override updated(changed: PropertyValues) {\n super.updated(changed);\n\n if (changed.has('scaleType')) {\n this._refreshBorderRadiusFromCssVar();\n }\n\n // Update host styles when fixedAspectRatio changes\n if (changed.has('fixedAspectRatio')) {\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n // Force initial scale calculation based on current size\n this._updateScaleFromCurrentSize();\n } else {\n this._removeFixedAspectRatioStyles();\n this._scale = 1;\n }\n }\n\n // Also recalculate scale when scaleReferenceSize changes\n if (changed.has('scaleReferenceSize') && this.fixedAspectRatio) {\n this._updateScaleFromCurrentSize();\n }\n\n // Report dimensions to parent chart when layout-affecting properties change.\n // In fixedAspectRatio mode, resize events also trigger reportDimensions() via ResizeController.\n // In regular mode, we report on every update to keep parent chart in sync.\n // Layout-affecting properties change the computed thickness and must notify the parent\n // even in fixedAspectRatio mode to keep chart padding accurate.\n const layoutChanged =\n changed.has('side') ||\n changed.has('showLabels') ||\n changed.has('showMainTickmarkLabels') ||\n changed.has('hasScale') ||\n changed.has('hasBar') ||\n changed.has('barThickness') ||\n changed.has('tickThickness') ||\n changed.has('labelThickness') ||\n changed.has('scaleType') ||\n changed.has('borderRadiusPosition') ||\n changed.has('borderRadius') ||\n changed.has('advices') ||\n changed.has('advicePosition') ||\n this.setpointPresenceChanged(changed);\n\n if (!this.fixedAspectRatio || layoutChanged) {\n // A thinner or thicker drawing under the same box changes the painted\n // scale without a resize event.\n if (this.fixedAspectRatio) this._measureScale();\n this.reportDimensions();\n }\n }\n\n /**\n * Report scale dimensions to parent chart component.\n * When fixedAspectRatio=true, reports the actual visual (scaled) thickness\n * so the chart can correctly reserve space for the scale.\n * When fixedAspectRatio=false, reports the base/unscaled thickness.\n */\n private reportDimensions() {\n const effectiveBarThickness = computeExternalScaleEffectiveBarThickness({\n hasBar: this.hasBar,\n barThickness: this.barThickness,\n borderRadius: this._getEffectiveBorderRadius(),\n scaleType: this.scaleType,\n });\n\n // Use scaleReferenceSize for layout calculation when in fixedAspectRatio mode\n // This ensures consistent layout dimensions based on the design reference size\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.width;\n\n const baseDimensions = computeScaleDimensionsForReport({\n orientation: ExternalScaleOrientation.horizontal,\n side: this.side,\n hasBar: this.hasBar,\n hasScale: this.hasScale,\n labels: this.showLabels,\n barThickness: effectiveBarThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n length: effectiveLength,\n scaleType: this.scaleType,\n advicePosition: this.advicePosition,\n hasAdvice: !!this.advices && this.advices.length > 0,\n hasAdviceIcon: !!this.advices?.some((a) => a.showIcon),\n hasSetpoint:\n this.setpoint !== undefined ||\n this.newSetpoint !== undefined ||\n this.departingNewSetpoint !== undefined,\n });\n\n // When fixedAspectRatio=true, the SVG scales proportionally via preserveAspectRatio=\"meet\".\n // The visual thickness = baseThickness × scale, where scale = containerSize / scaleReferenceSize.\n // Report the actual visual thickness so the chart can reserve the correct space.\n const dimensions = this.fixedAspectRatio\n ? {\n ...baseDimensions,\n thickness: Math.round(baseDimensions.thickness * this._scale),\n }\n : baseDimensions;\n\n this.dispatchEvent(\n new CustomEvent('scale-dimensions-changed', {\n detail: dimensions,\n bubbles: true,\n })\n );\n }\n\n protected override createRenderRoot() {\n return this;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Only read from CSS variable and observe changes when not in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n this._startBorderRadiusObserver();\n }\n\n // Ensure the element fills its container when in fixedAspectRatio mode\n // Custom elements are display:inline by default, which doesn't work for percentage-based sizing\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n }\n }\n\n override disconnectedCallback(): void {\n this._borderRadiusObserver?.disconnect();\n this._borderRadiusObserver = undefined;\n super.disconnectedCallback();\n }\n\n private _startBorderRadiusObserver(): void {\n this._borderRadiusObserver?.disconnect();\n\n this._borderRadiusObserver = startExternalScaleBorderRadiusObserver(\n this,\n () => this._refreshBorderRadiusFromCssVar()\n );\n }\n\n /**\n * Apply CSS styles needed for fixedAspectRatio mode.\n * Custom elements are display:inline by default, which doesn't work with percentage-based sizing.\n * We need display:block and width:100% to fill the slot container.\n */\n private _applyFixedAspectRatioStyles(): void {\n this.style.display = 'block';\n this.style.width = '100%';\n this.style.height = 'auto';\n }\n\n /**\n * Remove fixed aspect ratio styles when switching back to pixel mode.\n */\n private _removeFixedAspectRatioStyles(): void {\n this.style.display = '';\n this.style.width = '';\n this.style.height = '';\n }\n\n /** Reads the host's content box into the scale; false while the host has no size yet. */\n private _measureScale(): boolean {\n const {width, height} = readContentBox(this);\n if (width <= 0) return false;\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize: width,\n containerCrossAxisSize: height,\n scaleReferenceSize: this.scaleReferenceSize,\n viewBoxThickness: this._viewBoxThickness,\n });\n return true;\n }\n\n /**\n * Calculate scale based on current element size.\n * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.\n */\n private _updateScaleFromCurrentSize(): void {\n // Use requestAnimationFrame to ensure layout is complete\n requestAnimationFrame(() => {\n if (this._measureScale()) {\n this.requestUpdate();\n // Report updated dimensions to parent (matches pattern in ResizeController and _refreshBorderRadiusFromCssVar)\n this.reportDimensions();\n }\n });\n }\n\n private _refreshBorderRadiusFromCssVar(): void {\n // Skip CSS variable reading in instrument mode\n if (this.instrumentMode) return;\n\n const next = readExternalScaleBorderRadiusPx(this, this.scaleType);\n\n if (this._computedBorderRadius !== next) {\n this._computedBorderRadius = next;\n }\n\n // In fixed-aspect-ratio mode, recompute scale when border radius changes\n // (border radius affects effective bar thickness and therefore viewBox)\n if (this.fixedAspectRatio && this._measureScale()) {\n this.reportDimensions();\n }\n }\n\n /**\n * Get the effective border radius to use.\n * In instrument mode: use explicit borderRadius prop or default based on scaleType.\n * In normal mode: use CSS variable computed value.\n */\n private _getEffectiveBorderRadius(): number {\n if (this.instrumentMode) {\n // In instrument mode, use explicit value or default\n if (this.borderRadius !== undefined) {\n return this.borderRadius;\n }\n // Default: 8px for regular, 4px for condensed\n return this.scaleType === ScaleType.condensed ? 4 : 8;\n }\n // Normal mode: use CSS variable computed value\n return (\n this._computedBorderRadius ??\n (this.scaleType === ScaleType.condensed ? 4 : 8)\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-bar-horizontal': ObcBarHorizontal;\n }\n}\n"],"mappings":";;;;;;;;;;;;AA6IO,IAAM,mBAAN,MAAM,yBAAyB,YACpC,cAAc,YAAY,EACxB,iBAAiB,EACnB,CAAC,CACH,CAAC,CAAC;;;EACqC,KAAA,WAAA;EACA,KAAA,WAAA;EACA,KAAA,UAAA;EAEH,KAAA,QAAA;EAGhC,KAAA,cAAA,iBAAiB;EAGjB,KAAA,eAAA,iBAAiB;EAEiC,KAAA,OAAA,kBAAkB;EAGnD,KAAA,mBAAA;EAGE,KAAA,qBAAA;EAGJ,KAAA,SAAA;EAGW,KAAA,oBAAA;EAIA,KAAA,oBAAA,IAAI,iBAAiB,MAAM,EACrD,WAAW,YAAY;GACrB,IAAI,CAAC,KAAK,kBAAkB;GAE5B,MAAM,QAAQ,QAAQ;GACtB,IAAI,CAAC,OAAO;GAEZ,KAAK,SAAS,6BAA6B;IACzC,aAAa,yBAAyB;IACtC,uBAAuB,MAAM,YAAY;IACzC,wBAAwB,MAAM,YAAY;IAC1C,oBAAoB,KAAK;IACzB,kBAAkB,KAAK;GACzB,CAAC;GAGD,KAAK,iBAAiB;EACxB,EACF,CAAC;EAGuD,KAAA,WAAA;EACE,KAAA,aAAA;EACN,KAAA,yBAAA;EAChB,KAAA,SAAA;EAElB,KAAA,kBAAA;EAEsB,KAAA,oBAAA,KAAA;EACC,KAAA,eAAA;EACC,KAAA,gBAAA;EACC,KAAA,iBAAA;EAG2B,KAAA,gBAAA,CAAC;EACV,KAAA,0BAAA,KAAA;EACE,KAAA,4BAAA,KAAA;EACD,KAAA,2BAAA,KAAA;EACb,KAAA,YAAA,UAAU;EACR,KAAA,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
@@ -108,6 +108,8 @@ export declare class ObcBarVertical extends ObcBarVertical_base {
108
108
  */
109
109
  scaleReferenceSize: number;
110
110
  private _scale;
111
+ /** The drawing's width in viewBox units, kept from the last render for the scale measurement. */
112
+ private _viewBoxThickness;
111
113
  private _resizeController;
112
114
  /** Show scale tickmarks */
113
115
  hasScale: boolean;
@@ -219,6 +221,8 @@ export declare class ObcBarVertical extends ObcBarVertical_base {
219
221
  * Remove fixed aspect ratio styles when switching back to pixel mode.
220
222
  */
221
223
  private _removeFixedAspectRatioStyles;
224
+ /** Reads the host's content box into the scale; false while the host has no size yet. */
225
+ private _measureScale;
222
226
  /**
223
227
  * Calculate scale based on current element size.
224
228
  * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.
@@ -1 +1 @@
1
- {"version":3,"file":"bar-vertical.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/bar-vertical/bar-vertical.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAO,MAAM,KAAK,CAAC;AAErC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,KAAK,CAAC;AAIxC,OAAO,EACL,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACT,MAAM,uCAAuC,CAAC;AAI/C,OAAO,EAUL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,iBAAiB,EAEjB,iBAAiB,EAClB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EACL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,GAClB,CAAC;;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AACH,qBACa,cAAe,SAAQ,mBAInC;IAC2B,QAAQ,SAAK;IACb,QAAQ,SAAO;IACd,OAAO,UAAS;IAEjB,MAAM,SAAO;IAEb,UAAU,EAAE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AAgB;IAI1B,iBAAiB,IAAI,IAAI;IAezB,oBAAoB,IAAI,IAAI;IAMrC,OAAO,CAAC,0BAA0B;IASlC;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAMpC;;OAEG;IACH,OAAO,CAAC,6BAA6B;IAMrC;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAiBnC,OAAO,CAAC,8BAA8B;IA0BtC;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;CAelC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
1
+ {"version":3,"file":"bar-vertical.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/bar-vertical/bar-vertical.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAO,MAAM,KAAK,CAAC;AAErC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,KAAK,CAAC;AAIxC,OAAO,EACL,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACT,MAAM,uCAAuC,CAAC;AAI/C,OAAO,EAWL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,iBAAiB,EAEjB,iBAAiB,EAClB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EACL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,GAClB,CAAC;;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AACH,qBACa,cAAe,SAAQ,mBAInC;IAC2B,QAAQ,SAAK;IACb,QAAQ,SAAO;IACd,OAAO,UAAS;IAEjB,MAAM,SAAO;IAEb,UAAU,EAAE,MAAM,CACV;IAER,aAAa,EAAE,MAAM,CACb;IAER,IAAI,EAAE,iBAAiB,CAA2B;IAG5E,gBAAgB,UAAS;I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B,IAAI,IAAI;IAMrC,OAAO,CAAC,0BAA0B;IASlC;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAMpC;;OAEG;IACH,OAAO,CAAC,6BAA6B;IAMrC,yFAAyF;IACzF,OAAO,CAAC,aAAa;IAarB;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAWnC,OAAO,CAAC,8BAA8B;IAiBtC;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;CAelC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
@@ -3,7 +3,7 @@ import { CHART_DIMENSIONS } from "../../charthelpers/constants.js";
3
3
  import { BorderRadiusPosition, FrameStyle, InstrumentState, Priority } from "../../navigation-instruments/types.js";
4
4
  import { AdviceMixin } from "../../svghelpers/advice-mixin.js";
5
5
  import { nextAdviceMaskId } from "../../svghelpers/advice.js";
6
- import { AdvicePosition, BarContainerStyle, ExternalScaleOrientation, ExternalScaleSide, FillMode, ScaleType, computeExternalScaleEffectiveBarThickness, computeExternalScaleLayout, computeExternalScaleViewBox, computeFixedAspectRatioScale, computeScaleDimensionsForReport, readExternalScaleBorderRadiusPx, renderExternalScale, startExternalScaleBorderRadiusObserver, toExternalScaleLayoutConfig } from "../external-scale/external-scale.js";
6
+ import { AdvicePosition, BarContainerStyle, ExternalScaleOrientation, ExternalScaleSide, FillMode, ScaleType, computeExternalScaleEffectiveBarThickness, computeExternalScaleLayout, computeExternalScaleViewBox, computeFixedAspectRatioScale, computeScaleDimensionsForReport, readContentBox, readExternalScaleBorderRadiusPx, renderExternalScale, startExternalScaleBorderRadiusObserver, toExternalScaleLayoutConfig } from "../external-scale/external-scale.js";
7
7
  import { SetpointMixin } from "../../svghelpers/setpoint-mixin.js";
8
8
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.js";
9
9
  import { LitElement, html } from "lit";
@@ -23,15 +23,17 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(LitE
23
23
  this.fixedAspectRatio = false;
24
24
  this.scaleReferenceSize = 384;
25
25
  this._scale = 1;
26
+ this._viewBoxThickness = 0;
26
27
  this._resizeController = new ResizeController(this, { callback: (entries) => {
27
28
  if (!this.fixedAspectRatio) return;
28
29
  const entry = entries[0];
29
30
  if (!entry) return;
30
- const containerMainAxisSize = entry.contentRect.height;
31
31
  this._scale = computeFixedAspectRatioScale({
32
32
  orientation: ExternalScaleOrientation.vertical,
33
- containerMainAxisSize,
34
- scaleReferenceSize: this.scaleReferenceSize
33
+ containerMainAxisSize: entry.contentRect.height,
34
+ containerCrossAxisSize: entry.contentRect.width,
35
+ scaleReferenceSize: this.scaleReferenceSize,
36
+ viewBoxThickness: this._viewBoxThickness
35
37
  });
36
38
  this.reportDimensions();
37
39
  } });
@@ -120,6 +122,7 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(LitE
120
122
  highlightCurrentValue: this.highlightCurrentValue
121
123
  };
122
124
  const layout = computeExternalScaleLayout(toExternalScaleLayoutConfig(config));
125
+ this._viewBoxThickness = layout.thickness;
123
126
  const parts = renderExternalScale(config);
124
127
  const viewBox = computeExternalScaleViewBox({
125
128
  orientation: config.orientation,
@@ -155,7 +158,10 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(LitE
155
158
  }
156
159
  if (changed.has("scaleReferenceSize") && this.fixedAspectRatio) this._updateScaleFromCurrentSize();
157
160
  const layoutChanged = changed.has("side") || changed.has("showLabels") || changed.has("showMainTickmarkLabels") || changed.has("hasScale") || changed.has("hasBar") || changed.has("barThickness") || changed.has("tickThickness") || changed.has("labelThickness") || changed.has("scaleType") || changed.has("borderRadiusPosition") || changed.has("borderRadius") || changed.has("advices") || changed.has("advicePosition") || this.setpointPresenceChanged(changed);
158
- if (!this.fixedAspectRatio || layoutChanged) this.reportDimensions();
161
+ if (!this.fixedAspectRatio || layoutChanged) {
162
+ if (this.fixedAspectRatio) this._measureScale();
163
+ this.reportDimensions();
164
+ }
159
165
  }
160
166
  /**
161
167
  * Report scale dimensions to parent chart component.
@@ -234,19 +240,26 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(LitE
234
240
  this.style.height = "";
235
241
  this.style.width = "";
236
242
  }
243
+ /** Reads the host's content box into the scale; false while the host has no size yet. */
244
+ _measureScale() {
245
+ const { width, height } = readContentBox(this);
246
+ if (height <= 0) return false;
247
+ this._scale = computeFixedAspectRatioScale({
248
+ orientation: ExternalScaleOrientation.vertical,
249
+ containerMainAxisSize: height,
250
+ containerCrossAxisSize: width,
251
+ scaleReferenceSize: this.scaleReferenceSize,
252
+ viewBoxThickness: this._viewBoxThickness
253
+ });
254
+ return true;
255
+ }
237
256
  /**
238
257
  * Calculate scale based on current element size.
239
258
  * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.
240
259
  */
241
260
  _updateScaleFromCurrentSize() {
242
261
  requestAnimationFrame(() => {
243
- const containerHeight = this.clientHeight;
244
- if (containerHeight > 0) {
245
- this._scale = computeFixedAspectRatioScale({
246
- orientation: ExternalScaleOrientation.vertical,
247
- containerMainAxisSize: containerHeight,
248
- scaleReferenceSize: this.scaleReferenceSize
249
- });
262
+ if (this._measureScale()) {
250
263
  this.requestUpdate();
251
264
  this.reportDimensions();
252
265
  }
@@ -256,17 +269,7 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(LitE
256
269
  if (this.instrumentMode) return;
257
270
  const next = readExternalScaleBorderRadiusPx(this, this.scaleType);
258
271
  if (this._computedBorderRadius !== next) this._computedBorderRadius = next;
259
- if (this.fixedAspectRatio) {
260
- const rect = this.getBoundingClientRect();
261
- if (rect.height > 0) {
262
- this._scale = computeFixedAspectRatioScale({
263
- orientation: ExternalScaleOrientation.vertical,
264
- containerMainAxisSize: rect.height,
265
- scaleReferenceSize: this.scaleReferenceSize
266
- });
267
- this.reportDimensions();
268
- }
269
- }
272
+ if (this.fixedAspectRatio && this._measureScale()) this.reportDimensions();
270
273
  }
271
274
  /**
272
275
  * Get the effective border radius to use.