@oicl/openbridge-webcomponents 2.0.0-next.72 → 2.0.0-next.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +89 -22
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +311 -13
  4. package/dist/automation/automation-button/abstract-automation-button-motorized.d.ts +7 -0
  5. package/dist/automation/automation-button/abstract-automation-button-motorized.d.ts.map +1 -1
  6. package/dist/automation/automation-button/abstract-automation-button-motorized.js +16 -4
  7. package/dist/automation/automation-button/abstract-automation-button-motorized.js.map +1 -1
  8. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts +16 -0
  9. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts.map +1 -1
  10. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js +11 -1
  11. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js.map +1 -1
  12. package/dist/components/toggle-button-vertical-group/toggle-button-vertical-group.d.ts +14 -0
  13. package/dist/components/toggle-button-vertical-group/toggle-button-vertical-group.d.ts.map +1 -1
  14. package/dist/components/toggle-button-vertical-group/toggle-button-vertical-group.js +25 -5
  15. package/dist/components/toggle-button-vertical-group/toggle-button-vertical-group.js.map +1 -1
  16. package/dist/integration-systems/integration-vessel-menu/integration-vessel-menu.css.js +17 -2
  17. package/dist/integration-systems/integration-vessel-menu/integration-vessel-menu.css.js.map +1 -1
  18. package/dist/integration-systems/integration-vessel-menu/integration-vessel-menu.d.ts +24 -2
  19. package/dist/integration-systems/integration-vessel-menu/integration-vessel-menu.d.ts.map +1 -1
  20. package/dist/integration-systems/integration-vessel-menu/integration-vessel-menu.js +32 -11
  21. package/dist/integration-systems/integration-vessel-menu/integration-vessel-menu.js.map +1 -1
  22. package/package.json +1 -1
@@ -26,6 +26,10 @@ export type ObcToggleButtonVerticalGroupValueChangeEvent = CustomEvent<{
26
26
  * - **Layout behavior:**
27
27
  * - By default, the group stretches to fill available container width, with options stacked vertically.
28
28
  * - When `hugWidth` is true, the group shrinks to fit its content width instead of expanding.
29
+ * - **Empty selection mode:** When `allowEmptySelection` is true, a `value` that does not match any enabled
30
+ * option leaves the group with no option selected, instead of defaulting to the first enabled option. Use
31
+ * this when a selection may legitimately be absent (e.g. unset, loading, or error states) so the UI does not
32
+ * imply a choice the user has not made.
29
33
  * - **Disabled state:** Setting `disabled` on the group disables all contained options at once. Individual
30
34
  * options can also be disabled independently while the group remains enabled.
31
35
  * - **Divider management:** Automatically shows visual dividers between options and hides the divider after
@@ -113,6 +117,16 @@ export declare class ObcToggleButtonVerticalGroup extends LitElement {
113
117
  * Defaults to false.
114
118
  */
115
119
  hugWidth: boolean;
120
+ /**
121
+ * If true, a `value` that does not match any enabled option leaves the group with no option selected
122
+ * instead of defaulting to the first enabled option.
123
+ *
124
+ * This also applies when the currently selected option becomes disabled: the group clears its selection
125
+ * rather than falling back to another option.
126
+ *
127
+ * Defaults to false (the first enabled option is selected when the value does not match).
128
+ */
129
+ allowEmptySelection: boolean;
116
130
  /**
117
131
  * Disables the entire group and all contained options.
118
132
  *
@@ -1 +1 @@
1
- {"version":3,"file":"toggle-button-vertical-group.d.ts","sourceRoot":"","sources":["../../../src/components/toggle-button-vertical-group/toggle-button-vertical-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAmB,cAAc,EAAC,MAAM,KAAK,CAAC;AAKhE,OAAO,EAEL,iCAAiC,EAClC,MAAM,mEAAmE,CAAC;AAI3E,MAAM,MAAM,4CAA4C,GAAG,WAAW,CAAC;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH,qBACa,4BAA6B,SAAQ,UAAU;IAC1D;;;;OAIG;IACuB,KAAK,SAAM;IAErC;;;;OAIG;IACuB,IAAI,oCAA6C;IAE3E;;;;OAIG;IACwB,QAAQ,UAAS;IAE5C;;;;;;OAMG;IACuC,QAAQ,UAAS;IAG3D,OAAO,CAAC,OAAO,CAA6C;IAE5D,OAAO,CAAC,uBAAuB,CAG3B;IAEJ,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,wBAAwB;IAKhC,OAAO,CAAC,eAAe;cAgDJ,YAAY,CAAC,OAAO,EAAE,cAAc;IA+CvD,OAAO,CAAC,0BAA0B;IAUzB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IA0BzC,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAYlD,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,gBAAgB;IAKf,MAAM;IAiBf,OAAgB,MAAM,0BAAoB;CAC3C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kCAAkC,EAAE,4BAA4B,CAAC;KAClE;CACF"}
1
+ {"version":3,"file":"toggle-button-vertical-group.d.ts","sourceRoot":"","sources":["../../../src/components/toggle-button-vertical-group/toggle-button-vertical-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAmB,cAAc,EAAC,MAAM,KAAK,CAAC;AAKhE,OAAO,EAEL,iCAAiC,EAClC,MAAM,mEAAmE,CAAC;AAI3E,MAAM,MAAM,4CAA4C,GAAG,WAAW,CAAC;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AACH,qBACa,4BAA6B,SAAQ,UAAU;IAC1D;;;;OAIG;IACuB,KAAK,SAAM;IAErC;;;;OAIG;IACuB,IAAI,oCAA6C;IAE3E;;;;OAIG;IACwB,QAAQ,UAAS;IAE5C;;;;;;;;OAQG;IACwB,mBAAmB,UAAS;IAEvD;;;;;;OAMG;IACuC,QAAQ,UAAS;IAG3D,OAAO,CAAC,OAAO,CAA6C;IAE5D,OAAO,CAAC,uBAAuB,CAG3B;IAEJ,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,wBAAwB;IAKhC,OAAO,CAAC,eAAe;cAoDJ,YAAY,CAAC,OAAO,EAAE,cAAc;IAmDvD,OAAO,CAAC,0BAA0B;IAczB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IA0BzC,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAgBlD,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,gBAAgB;IAKf,MAAM;IAiBf,OAAgB,MAAM,0BAAoB;CAC3C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kCAAkC,EAAE,4BAA4B,CAAC;KAClE;CACF"}
@@ -20,6 +20,7 @@ let ObcToggleButtonVerticalGroup = class extends LitElement {
20
20
  this.value = "";
21
21
  this.type = ObcToggleButtonVerticalOptionType.regular;
22
22
  this.hugWidth = false;
23
+ this.allowEmptySelection = false;
23
24
  this.disabled = false;
24
25
  this._originalDisabledStates = /* @__PURE__ */ new Map();
25
26
  }
@@ -56,8 +57,12 @@ let ObcToggleButtonVerticalGroup = class extends LitElement {
56
57
  this.updateDividers();
57
58
  return;
58
59
  }
59
- const fallback = this.getFirstSelectableOption();
60
- newValue = fallback?.value || "";
60
+ if (this.allowEmptySelection) {
61
+ newValue = "";
62
+ } else {
63
+ const fallback = this.getFirstSelectableOption();
64
+ newValue = fallback?.value || "";
65
+ }
61
66
  }
62
67
  this.value = newValue;
63
68
  this.options.forEach((option) => {
@@ -100,9 +105,13 @@ let ObcToggleButtonVerticalGroup = class extends LitElement {
100
105
  }
101
106
  });
102
107
  if (!this.value || !this.getOptionByValue(this.value)) {
103
- const firstSelectable = this.getFirstSelectableOption();
104
- if (firstSelectable) {
105
- this.updateSelection(firstSelectable.value, false);
108
+ if (this.allowEmptySelection) {
109
+ this.updateSelection("", false);
110
+ } else {
111
+ const firstSelectable = this.getFirstSelectableOption();
112
+ if (firstSelectable) {
113
+ this.updateSelection(firstSelectable.value, false);
114
+ }
106
115
  }
107
116
  } else {
108
117
  this.updateSelection(this.value, false);
@@ -111,6 +120,10 @@ let ObcToggleButtonVerticalGroup = class extends LitElement {
111
120
  handleOptionDisabledChange() {
112
121
  const currentOption = this.getOptionByValue(this.value);
113
122
  if (currentOption?.disabled && this.hasAnyEnabledOption()) {
123
+ if (this.allowEmptySelection) {
124
+ this.updateSelection("");
125
+ return;
126
+ }
114
127
  const firstSelectable = this.getFirstSelectableOption();
115
128
  if (firstSelectable) {
116
129
  this.updateSelection(firstSelectable.value);
@@ -143,6 +156,10 @@ let ObcToggleButtonVerticalGroup = class extends LitElement {
143
156
  super.updated(changedProperties);
144
157
  const currentOption = this.getOptionByValue(this.value);
145
158
  if (currentOption?.disabled && this.hasAnyEnabledOption()) {
159
+ if (this.allowEmptySelection) {
160
+ this.updateSelection("");
161
+ return;
162
+ }
146
163
  const firstSelectable = this.getFirstSelectableOption();
147
164
  if (firstSelectable) {
148
165
  this.updateSelection(firstSelectable.value);
@@ -185,6 +202,9 @@ __decorateClass([
185
202
  __decorateClass([
186
203
  property({ type: Boolean })
187
204
  ], ObcToggleButtonVerticalGroup.prototype, "hugWidth", 2);
205
+ __decorateClass([
206
+ property({ type: Boolean })
207
+ ], ObcToggleButtonVerticalGroup.prototype, "allowEmptySelection", 2);
188
208
  __decorateClass([
189
209
  property({ type: Boolean, reflect: true })
190
210
  ], ObcToggleButtonVerticalGroup.prototype, "disabled", 2);
@@ -1 +1 @@
1
- {"version":3,"file":"toggle-button-vertical-group.js","sources":["../../../src/components/toggle-button-vertical-group/toggle-button-vertical-group.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS, PropertyValues} from 'lit';\nimport {property, queryAssignedElements} from 'lit/decorators.js';\nimport {customElement} from '../../decorator.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {\n ObcToggleButtonVerticalOption,\n ObcToggleButtonVerticalOptionType,\n} from '../toggle-button-vertical-option/toggle-button-vertical-option.js';\n\nimport style from './toggle-button-vertical-group.css?inline';\n\nexport type ObcToggleButtonVerticalGroupValueChangeEvent = CustomEvent<{\n value: string;\n previousValue: string;\n}>;\n\n/**\n * `<obc-toggle-button-vertical-group>` – A vertically oriented segmented control for selecting a single option from a set.\n *\n * Provides a vertical stack of connected toggle buttons where only one option can be selected at a time.\n * Each option is represented by an `<obc-toggle-button-vertical-option>` child element. The group manages selection\n * state automatically, deselecting the previous option when a new one is chosen.\n *\n * Appears as a visually unified vertical column of buttons with clear selection indicators. Commonly used for sidebar\n * navigation, vertical filter controls, or mode selection in vertical layouts. Ideal for scenarios where vertical\n * space is available and horizontal space is limited, such as side panels or navigation drawers.\n *\n * ### Features\n *\n * - **Single selection mode:** Only one option can be active at a time; selecting a new option automatically\n * deselects the previous one. Similar to radio button behavior but with a button-like vertical appearance.\n * - **Visual variants:**\n * - `regular` (default): Standard appearance with full background and border styling.\n * - `flat`: Minimal style with reduced visual weight, no prominent background or border.\n * - `normal`: **TODO(designer)** – Clarify the visual difference and intended use case for the `normal` variant compared to `regular` and `flat`.\n * - **Layout behavior:**\n * - By default, the group stretches to fill available container width, with options stacked vertically.\n * - When `hugWidth` is true, the group shrinks to fit its content width instead of expanding.\n * - **Disabled state:** Setting `disabled` on the group disables all contained options at once. Individual\n * options can also be disabled independently while the group remains enabled.\n * - **Divider management:** Automatically shows visual dividers between options and hides the divider after\n * the last option for a clean, unified appearance.\n * - **Property propagation:** The group automatically synchronizes the `type` property to all child\n * `<obc-toggle-button-vertical-option>` elements for consistent styling.\n * - **Automatic fallback selection:** If the current value is set to a disabled or non-existent option, the\n * group automatically selects the first enabled option to ensure a valid state.\n *\n * ### Usage Guidelines\n *\n * Use `<obc-toggle-button-vertical-group>` when you need users to choose exactly one option from a small set of\n * mutually exclusive choices (typically 2-5 options) in a vertical layout. It provides a more compact and visually\n * integrated alternative to radio buttons for vertical navigation or control panels.\n *\n * **Ideal use cases:**\n * - Sidebar navigation toggles (e.g., dashboard/reports/settings views)\n * - Vertical filter controls (e.g., all/active/archived items)\n * - Mode selectors in vertical panels (e.g., edit/preview/code modes)\n * - View toggles in constrained horizontal spaces (e.g., mobile side panels)\n * - Control panels with vertical layout preference\n *\n * **When not to use:**\n * - For binary on/off choices, use a switch or checkbox instead.\n * - For multiple selections from a set, use checkboxes or chips.\n * - For many options (6+), consider a dropdown/select or radio button list for better scannability.\n * - For horizontal layouts with adequate space, use `<obc-toggle-button-group>` instead.\n * - For navigation between pages or sections, use tabs or a navigation menu.\n *\n * **Best Practices:**\n * - Each option must have a unique `value` property to prevent selection conflicts.\n * - Provide clear, concise labels for each option. Keep text short (1-2 words ideal).\n * - For icon-only buttons, ensure icons are universally recognizable or provide tooltips.\n * - Set an initial `value` to indicate the default selection, or the first enabled option will be selected automatically.\n * - Avoid disabling the currently selected option; if an option becomes unavailable, selection will shift to the first enabled option.\n * - Use `type=\"flat\"` in dense UIs or when the toggle is secondary to other content.\n * - Ensure adequate vertical space for the number of options to avoid excessive scrolling or cramped layouts.\n *\n * ### Slots\n *\n * | Slot Name | Renders When... | Purpose |\n * |-----------|-----------------|---------|\n * | (default) | Always | Place one or more `<obc-toggle-button-vertical-option>` elements here to define the selectable options in the group. Each option can include an icon via its own `icon` slot. |\n *\n * ### Events\n *\n * - `value` – Fired when the selected value changes, either through user interaction or programmatic change.\n * Event detail: `{ value: string, previousValue: string }`. Listen to this event to react to selection changes.\n *\n * ### Example\n *\n * ```html\n * <obc-toggle-button-vertical-group value=\"list\" type=\"regular\">\n * <obc-toggle-button-vertical-option value=\"list\" label=\"List\" hasIcon>\n * <obi-placeholder slot=\"icon\"></obi-placeholder>\n * </obc-toggle-button-vertical-option>\n * <obc-toggle-button-vertical-option value=\"grid\" label=\"Grid\" hasIcon>\n * <obi-placeholder slot=\"icon\"></obi-placeholder>\n * </obc-toggle-button-vertical-option>\n * <obc-toggle-button-vertical-option value=\"table\" label=\"Table\" hasIcon>\n * <obi-placeholder slot=\"icon\"></obi-placeholder>\n * </obc-toggle-button-vertical-option>\n * </obc-toggle-button-vertical-group>\n * ```\n *\n * @slot - Place one or more `<obc-toggle-button-vertical-option>` elements here to define the selectable options.\n * @fires value {CustomEvent<{value: string, previousValue: string}>} Fired when the selected value changes.\n */\n@customElement('obc-toggle-button-vertical-group')\nexport class ObcToggleButtonVerticalGroup extends LitElement {\n /**\n * The value of the currently selected option.\n *\n * Setting this property programmatically updates the selection. If the value does not match any enabled option, the group selects the first available enabled option.\n */\n @property({type: String}) value = '';\n\n /**\n * Visual style for all options in the group.\n *\n * One of: \"flat\", \"regular\", \"normal\".\n */\n @property({type: String}) type = ObcToggleButtonVerticalOptionType.regular;\n\n /**\n * If true, the group shrinks to fit its content width instead of stretching to fill its container.\n *\n * Defaults to false.\n */\n @property({type: Boolean}) hugWidth = false;\n\n /**\n * Disables the entire group and all contained options.\n *\n * When set to true, all options become non-interactive, regardless of their individual disabled state.\n *\n * Defaults to false.\n */\n @property({type: Boolean, reflect: true}) disabled = false;\n\n @queryAssignedElements({selector: 'obc-toggle-button-vertical-option'})\n private options!: NodeListOf<ObcToggleButtonVerticalOption>;\n\n private _originalDisabledStates = new Map<\n ObcToggleButtonVerticalOption,\n boolean\n >();\n\n private hasAnyEnabledOption(): boolean {\n if (this.disabled) return false;\n return Array.from(this.options).some((opt) => !opt.disabled);\n }\n\n private canSelectOption(value: string): boolean {\n if (this.disabled) return false;\n const option = this.getOptionByValue(value);\n return option !== null && !option.disabled;\n }\n\n private getOptionByValue(\n value: string\n ): ObcToggleButtonVerticalOption | null {\n return Array.from(this.options).find((opt) => opt.value === value) || null;\n }\n\n private getFirstSelectableOption(): ObcToggleButtonVerticalOption | null {\n if (this.disabled) return null;\n return Array.from(this.options).find((opt) => !opt.disabled) || null;\n }\n\n private updateSelection(newValue: string, emitEvent: boolean = true) {\n const oldValue = this.value;\n\n if (!this.hasAnyEnabledOption()) {\n this.options.forEach((option) => {\n option.selected = option.value === this.value;\n });\n this.updateDividers();\n return;\n }\n\n if (!this.canSelectOption(newValue)) {\n if (this.value && this.getOptionByValue(this.value)) {\n this.options.forEach((option) => {\n option.selected = option.value === this.value;\n });\n this.updateDividers();\n return;\n }\n const fallback = this.getFirstSelectableOption();\n newValue = fallback?.value || '';\n }\n\n this.value = newValue;\n\n this.options.forEach((option) => {\n option.selected = option.value === newValue;\n });\n\n this.updateDividers();\n\n if (emitEvent && oldValue !== newValue) {\n /**\n * Fired when the selected option changes.\n *\n * The event detail contains the new value and the previous value:\n * `{ value: string, previousValue: string }`\n *\n * @event value\n */\n this.dispatchEvent(\n new CustomEvent('value', {\n detail: {value: newValue, previousValue: oldValue},\n })\n );\n }\n }\n\n protected override firstUpdated(changed: PropertyValues) {\n super.firstUpdated(changed);\n\n const values = Array.from(this.options).map((opt) => opt.value);\n const uniqueValues = new Set(values);\n if (values.length !== uniqueValues.size) {\n console.warn(\n 'Toggle button vertical group has duplicate values. This may cause unexpected behavior.'\n );\n }\n\n this.options.forEach((opt) => {\n this._originalDisabledStates.set(opt, opt.disabled);\n\n opt.addEventListener('selected', (e) => this.onOptionSelected(e));\n\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (\n mutation.attributeName === 'disabled' &&\n !opt.hasAttribute('data-group-disabled')\n ) {\n this._originalDisabledStates.set(opt, opt.disabled);\n this.handleOptionDisabledChange();\n }\n });\n });\n observer.observe(opt, {attributes: true, attributeFilter: ['disabled']});\n\n opt.type = this.type;\n\n if (this.disabled) {\n opt.setAttribute('data-group-disabled', 'true');\n opt.disabled = true;\n }\n });\n\n if (!this.value || !this.getOptionByValue(this.value)) {\n const firstSelectable = this.getFirstSelectableOption();\n if (firstSelectable) {\n this.updateSelection(firstSelectable.value, false);\n }\n } else {\n this.updateSelection(this.value, false);\n }\n }\n\n private handleOptionDisabledChange() {\n const currentOption = this.getOptionByValue(this.value);\n if (currentOption?.disabled && this.hasAnyEnabledOption()) {\n const firstSelectable = this.getFirstSelectableOption();\n if (firstSelectable) {\n this.updateSelection(firstSelectable.value);\n }\n }\n }\n\n override willUpdate(changed: PropertyValues): void {\n if (changed.has('value')) {\n this.updateSelection(this.value);\n }\n\n if (changed.has('type')) {\n this.options.forEach((opt) => {\n opt.type = this.type;\n });\n }\n\n if (changed.has('disabled')) {\n this.options.forEach((option) => {\n if (this.disabled) {\n option.setAttribute('data-group-disabled', 'true');\n option.disabled = true;\n } else {\n option.removeAttribute('data-group-disabled');\n const originalState =\n this._originalDisabledStates.get(option) || false;\n option.disabled = originalState;\n }\n });\n }\n }\n\n override updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n\n const currentOption = this.getOptionByValue(this.value);\n if (currentOption?.disabled && this.hasAnyEnabledOption()) {\n const firstSelectable = this.getFirstSelectableOption();\n if (firstSelectable) {\n this.updateSelection(firstSelectable.value);\n }\n }\n }\n\n private updateDividers(): void {\n const last = this.options.length - 1;\n this.options.forEach((opt, idx) => {\n opt.showDivider = idx !== last;\n });\n }\n\n private onOptionSelected(e: Event): void {\n const {value} = (e as CustomEvent).detail;\n this.updateSelection(value);\n }\n\n override render() {\n const classes = {\n 'outer-wrapper': true,\n flat: this.type === ObcToggleButtonVerticalOptionType.flat,\n regular: this.type === ObcToggleButtonVerticalOptionType.regular,\n normal: this.type === ObcToggleButtonVerticalOptionType.normal,\n 'hug-width': this.hugWidth,\n disabled: this.disabled,\n };\n\n return html`\n <div class=${classMap(classes)}>\n <div class=\"wrapper\"><slot></slot></div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(style);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-to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B3D,6BAgCH,WAAA,WAAA,CAAA;AAhCG,+BAAN,gBAAA;AAAA,EADN,cAAc,kCAAkC;AAAA,GACpC,4BAAA;"}
1
+ {"version":3,"file":"toggle-button-vertical-group.js","sources":["../../../src/components/toggle-button-vertical-group/toggle-button-vertical-group.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS, PropertyValues} from 'lit';\nimport {property, queryAssignedElements} from 'lit/decorators.js';\nimport {customElement} from '../../decorator.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {\n ObcToggleButtonVerticalOption,\n ObcToggleButtonVerticalOptionType,\n} from '../toggle-button-vertical-option/toggle-button-vertical-option.js';\n\nimport style from './toggle-button-vertical-group.css?inline';\n\nexport type ObcToggleButtonVerticalGroupValueChangeEvent = CustomEvent<{\n value: string;\n previousValue: string;\n}>;\n\n/**\n * `<obc-toggle-button-vertical-group>` – A vertically oriented segmented control for selecting a single option from a set.\n *\n * Provides a vertical stack of connected toggle buttons where only one option can be selected at a time.\n * Each option is represented by an `<obc-toggle-button-vertical-option>` child element. The group manages selection\n * state automatically, deselecting the previous option when a new one is chosen.\n *\n * Appears as a visually unified vertical column of buttons with clear selection indicators. Commonly used for sidebar\n * navigation, vertical filter controls, or mode selection in vertical layouts. Ideal for scenarios where vertical\n * space is available and horizontal space is limited, such as side panels or navigation drawers.\n *\n * ### Features\n *\n * - **Single selection mode:** Only one option can be active at a time; selecting a new option automatically\n * deselects the previous one. Similar to radio button behavior but with a button-like vertical appearance.\n * - **Visual variants:**\n * - `regular` (default): Standard appearance with full background and border styling.\n * - `flat`: Minimal style with reduced visual weight, no prominent background or border.\n * - `normal`: **TODO(designer)** – Clarify the visual difference and intended use case for the `normal` variant compared to `regular` and `flat`.\n * - **Layout behavior:**\n * - By default, the group stretches to fill available container width, with options stacked vertically.\n * - When `hugWidth` is true, the group shrinks to fit its content width instead of expanding.\n * - **Empty selection mode:** When `allowEmptySelection` is true, a `value` that does not match any enabled\n * option leaves the group with no option selected, instead of defaulting to the first enabled option. Use\n * this when a selection may legitimately be absent (e.g. unset, loading, or error states) so the UI does not\n * imply a choice the user has not made.\n * - **Disabled state:** Setting `disabled` on the group disables all contained options at once. Individual\n * options can also be disabled independently while the group remains enabled.\n * - **Divider management:** Automatically shows visual dividers between options and hides the divider after\n * the last option for a clean, unified appearance.\n * - **Property propagation:** The group automatically synchronizes the `type` property to all child\n * `<obc-toggle-button-vertical-option>` elements for consistent styling.\n * - **Automatic fallback selection:** If the current value is set to a disabled or non-existent option, the\n * group automatically selects the first enabled option to ensure a valid state.\n *\n * ### Usage Guidelines\n *\n * Use `<obc-toggle-button-vertical-group>` when you need users to choose exactly one option from a small set of\n * mutually exclusive choices (typically 2-5 options) in a vertical layout. It provides a more compact and visually\n * integrated alternative to radio buttons for vertical navigation or control panels.\n *\n * **Ideal use cases:**\n * - Sidebar navigation toggles (e.g., dashboard/reports/settings views)\n * - Vertical filter controls (e.g., all/active/archived items)\n * - Mode selectors in vertical panels (e.g., edit/preview/code modes)\n * - View toggles in constrained horizontal spaces (e.g., mobile side panels)\n * - Control panels with vertical layout preference\n *\n * **When not to use:**\n * - For binary on/off choices, use a switch or checkbox instead.\n * - For multiple selections from a set, use checkboxes or chips.\n * - For many options (6+), consider a dropdown/select or radio button list for better scannability.\n * - For horizontal layouts with adequate space, use `<obc-toggle-button-group>` instead.\n * - For navigation between pages or sections, use tabs or a navigation menu.\n *\n * **Best Practices:**\n * - Each option must have a unique `value` property to prevent selection conflicts.\n * - Provide clear, concise labels for each option. Keep text short (1-2 words ideal).\n * - For icon-only buttons, ensure icons are universally recognizable or provide tooltips.\n * - Set an initial `value` to indicate the default selection, or the first enabled option will be selected automatically.\n * - Avoid disabling the currently selected option; if an option becomes unavailable, selection will shift to the first enabled option.\n * - Use `type=\"flat\"` in dense UIs or when the toggle is secondary to other content.\n * - Ensure adequate vertical space for the number of options to avoid excessive scrolling or cramped layouts.\n *\n * ### Slots\n *\n * | Slot Name | Renders When... | Purpose |\n * |-----------|-----------------|---------|\n * | (default) | Always | Place one or more `<obc-toggle-button-vertical-option>` elements here to define the selectable options in the group. Each option can include an icon via its own `icon` slot. |\n *\n * ### Events\n *\n * - `value` – Fired when the selected value changes, either through user interaction or programmatic change.\n * Event detail: `{ value: string, previousValue: string }`. Listen to this event to react to selection changes.\n *\n * ### Example\n *\n * ```html\n * <obc-toggle-button-vertical-group value=\"list\" type=\"regular\">\n * <obc-toggle-button-vertical-option value=\"list\" label=\"List\" hasIcon>\n * <obi-placeholder slot=\"icon\"></obi-placeholder>\n * </obc-toggle-button-vertical-option>\n * <obc-toggle-button-vertical-option value=\"grid\" label=\"Grid\" hasIcon>\n * <obi-placeholder slot=\"icon\"></obi-placeholder>\n * </obc-toggle-button-vertical-option>\n * <obc-toggle-button-vertical-option value=\"table\" label=\"Table\" hasIcon>\n * <obi-placeholder slot=\"icon\"></obi-placeholder>\n * </obc-toggle-button-vertical-option>\n * </obc-toggle-button-vertical-group>\n * ```\n *\n * @slot - Place one or more `<obc-toggle-button-vertical-option>` elements here to define the selectable options.\n * @fires value {CustomEvent<{value: string, previousValue: string}>} Fired when the selected value changes.\n */\n@customElement('obc-toggle-button-vertical-group')\nexport class ObcToggleButtonVerticalGroup extends LitElement {\n /**\n * The value of the currently selected option.\n *\n * Setting this property programmatically updates the selection. If the value does not match any enabled option, the group selects the first available enabled option.\n */\n @property({type: String}) value = '';\n\n /**\n * Visual style for all options in the group.\n *\n * One of: \"flat\", \"regular\", \"normal\".\n */\n @property({type: String}) type = ObcToggleButtonVerticalOptionType.regular;\n\n /**\n * If true, the group shrinks to fit its content width instead of stretching to fill its container.\n *\n * Defaults to false.\n */\n @property({type: Boolean}) hugWidth = false;\n\n /**\n * If true, a `value` that does not match any enabled option leaves the group with no option selected\n * instead of defaulting to the first enabled option.\n *\n * This also applies when the currently selected option becomes disabled: the group clears its selection\n * rather than falling back to another option.\n *\n * Defaults to false (the first enabled option is selected when the value does not match).\n */\n @property({type: Boolean}) allowEmptySelection = false;\n\n /**\n * Disables the entire group and all contained options.\n *\n * When set to true, all options become non-interactive, regardless of their individual disabled state.\n *\n * Defaults to false.\n */\n @property({type: Boolean, reflect: true}) disabled = false;\n\n @queryAssignedElements({selector: 'obc-toggle-button-vertical-option'})\n private options!: NodeListOf<ObcToggleButtonVerticalOption>;\n\n private _originalDisabledStates = new Map<\n ObcToggleButtonVerticalOption,\n boolean\n >();\n\n private hasAnyEnabledOption(): boolean {\n if (this.disabled) return false;\n return Array.from(this.options).some((opt) => !opt.disabled);\n }\n\n private canSelectOption(value: string): boolean {\n if (this.disabled) return false;\n const option = this.getOptionByValue(value);\n return option !== null && !option.disabled;\n }\n\n private getOptionByValue(\n value: string\n ): ObcToggleButtonVerticalOption | null {\n return Array.from(this.options).find((opt) => opt.value === value) || null;\n }\n\n private getFirstSelectableOption(): ObcToggleButtonVerticalOption | null {\n if (this.disabled) return null;\n return Array.from(this.options).find((opt) => !opt.disabled) || null;\n }\n\n private updateSelection(newValue: string, emitEvent: boolean = true) {\n const oldValue = this.value;\n\n if (!this.hasAnyEnabledOption()) {\n this.options.forEach((option) => {\n option.selected = option.value === this.value;\n });\n this.updateDividers();\n return;\n }\n\n if (!this.canSelectOption(newValue)) {\n if (this.value && this.getOptionByValue(this.value)) {\n this.options.forEach((option) => {\n option.selected = option.value === this.value;\n });\n this.updateDividers();\n return;\n }\n if (this.allowEmptySelection) {\n newValue = '';\n } else {\n const fallback = this.getFirstSelectableOption();\n newValue = fallback?.value || '';\n }\n }\n\n this.value = newValue;\n\n this.options.forEach((option) => {\n option.selected = option.value === newValue;\n });\n\n this.updateDividers();\n\n if (emitEvent && oldValue !== newValue) {\n /**\n * Fired when the selected option changes.\n *\n * The event detail contains the new value and the previous value:\n * `{ value: string, previousValue: string }`\n *\n * @event value\n */\n this.dispatchEvent(\n new CustomEvent('value', {\n detail: {value: newValue, previousValue: oldValue},\n })\n );\n }\n }\n\n protected override firstUpdated(changed: PropertyValues) {\n super.firstUpdated(changed);\n\n const values = Array.from(this.options).map((opt) => opt.value);\n const uniqueValues = new Set(values);\n if (values.length !== uniqueValues.size) {\n console.warn(\n 'Toggle button vertical group has duplicate values. This may cause unexpected behavior.'\n );\n }\n\n this.options.forEach((opt) => {\n this._originalDisabledStates.set(opt, opt.disabled);\n\n opt.addEventListener('selected', (e) => this.onOptionSelected(e));\n\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (\n mutation.attributeName === 'disabled' &&\n !opt.hasAttribute('data-group-disabled')\n ) {\n this._originalDisabledStates.set(opt, opt.disabled);\n this.handleOptionDisabledChange();\n }\n });\n });\n observer.observe(opt, {attributes: true, attributeFilter: ['disabled']});\n\n opt.type = this.type;\n\n if (this.disabled) {\n opt.setAttribute('data-group-disabled', 'true');\n opt.disabled = true;\n }\n });\n\n if (!this.value || !this.getOptionByValue(this.value)) {\n if (this.allowEmptySelection) {\n this.updateSelection('', false);\n } else {\n const firstSelectable = this.getFirstSelectableOption();\n if (firstSelectable) {\n this.updateSelection(firstSelectable.value, false);\n }\n }\n } else {\n this.updateSelection(this.value, false);\n }\n }\n\n private handleOptionDisabledChange() {\n const currentOption = this.getOptionByValue(this.value);\n if (currentOption?.disabled && this.hasAnyEnabledOption()) {\n if (this.allowEmptySelection) {\n this.updateSelection('');\n return;\n }\n const firstSelectable = this.getFirstSelectableOption();\n if (firstSelectable) {\n this.updateSelection(firstSelectable.value);\n }\n }\n }\n\n override willUpdate(changed: PropertyValues): void {\n if (changed.has('value')) {\n this.updateSelection(this.value);\n }\n\n if (changed.has('type')) {\n this.options.forEach((opt) => {\n opt.type = this.type;\n });\n }\n\n if (changed.has('disabled')) {\n this.options.forEach((option) => {\n if (this.disabled) {\n option.setAttribute('data-group-disabled', 'true');\n option.disabled = true;\n } else {\n option.removeAttribute('data-group-disabled');\n const originalState =\n this._originalDisabledStates.get(option) || false;\n option.disabled = originalState;\n }\n });\n }\n }\n\n override updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n\n const currentOption = this.getOptionByValue(this.value);\n if (currentOption?.disabled && this.hasAnyEnabledOption()) {\n if (this.allowEmptySelection) {\n this.updateSelection('');\n return;\n }\n const firstSelectable = this.getFirstSelectableOption();\n if (firstSelectable) {\n this.updateSelection(firstSelectable.value);\n }\n }\n }\n\n private updateDividers(): void {\n const last = this.options.length - 1;\n this.options.forEach((opt, idx) => {\n opt.showDivider = idx !== last;\n });\n }\n\n private onOptionSelected(e: Event): void {\n const {value} = (e as CustomEvent).detail;\n this.updateSelection(value);\n }\n\n override render() {\n const classes = {\n 'outer-wrapper': true,\n flat: this.type === ObcToggleButtonVerticalOptionType.flat,\n regular: this.type === ObcToggleButtonVerticalOptionType.regular,\n normal: this.type === ObcToggleButtonVerticalOptionType.normal,\n 'hug-width': this.hugWidth,\n disabled: this.disabled,\n };\n\n return html`\n <div class=${classMap(classes)}>\n <div class=\"wrapper\"><slot></slot></div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(style);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-toggle-button-vertical-group': ObcToggleButtonVerticalGroup;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgHO,IAAM,+BAAN,cAA2C,WAAW;AAAA,EAAtD,cAAA;AAAA,UAAA,GAAA,SAAA;AAMqB,SAAA,QAAQ;AAOR,SAAA,OAAO,kCAAkC;AAOxC,SAAA,WAAW;AAWX,SAAA,sBAAsB;AASP,SAAA,WAAW;AAKrD,SAAQ,8CAA8B,IAAA;AAAA,EAGpC;AAAA,EAEM,sBAA+B;AACrC,QAAI,KAAK,SAAU,QAAO;AAC1B,WAAO,MAAM,KAAK,KAAK,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI,QAAQ;AAAA,EAC7D;AAAA,EAEQ,gBAAgB,OAAwB;AAC9C,QAAI,KAAK,SAAU,QAAO;AAC1B,UAAM,SAAS,KAAK,iBAAiB,KAAK;AAC1C,WAAO,WAAW,QAAQ,CAAC,OAAO;AAAA,EACpC;AAAA,EAEQ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 }
14
+
11
15
  .wrapper {
12
16
  border-color: var(--integration-normal-enabled-border-color);
13
17
  background-color: var(--integration-normal-enabled-background-color);
@@ -18,6 +22,7 @@ const componentStyle = css`
18
22
  display: flex;
19
23
  flex-direction: column;
20
24
  align-items: center;
25
+ height: 100%;
21
26
  background: var(--container-global-color);
22
27
  border-radius: var(
23
28
  --app-components-integration-system-dropdown-menu-border-radius
@@ -44,6 +49,10 @@ const componentStyle = css`
44
49
  border-radius: 12px;
45
50
  }
46
51
 
52
+ .footer-container.hidden {
53
+ display: none;
54
+ }
55
+
47
56
  .content-area {
48
57
  display: flex;
49
58
  flex-direction: column;
@@ -53,6 +62,10 @@ const componentStyle = css`
53
62
  border-radius: 8px;
54
63
  }
55
64
 
65
+ .content-area.hidden {
66
+ display: none;
67
+ }
68
+
56
69
  .footer-container slot[name="buttons"]::slotted(*) {
57
70
  display: flex;
58
71
  flex: 1 1 0px;
@@ -67,7 +80,8 @@ const componentStyle = css`
67
80
  gap: var(--app-components-integration-system-menu-action-spacing);
68
81
  }
69
82
 
70
- .buttons-slot {
83
+ .buttons-slot,
84
+ .content-slot {
71
85
  display: contents;
72
86
  }
73
87
 
@@ -81,12 +95,13 @@ const componentStyle = css`
81
95
  border-radius: 8px;
82
96
  }
83
97
 
84
- .content-container.hidealarmlist {
98
+ .content-container.hidden {
85
99
  display: none;
86
100
  }
87
101
 
88
102
  .alertlist {
89
103
  width: 100%;
104
+ height: 100%;
90
105
  }
91
106
 
92
107
  .leading-icon {
@@ -1 +1 @@
1
- {"version":3,"file":"integration-vessel-menu.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"integration-vessel-menu.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,17 +2,39 @@ import { LitElement } from 'lit';
2
2
  import '../../components/button/button.js';
3
3
  import '../../components/icon-button/icon-button.js';
4
4
  import '../../icons/icon-placeholder.js';
5
+ import '../../icons/icon-unacknowledged.js';
5
6
  import '../../building-blocks/alert-list/alert-list.js';
6
7
  /**
7
8
  * `<obc-integration-vessel-menu>` – A menu to be shown when selecting a obc-integration-button from a obc-integration-bar.
8
9
  *
10
+ * ## Sizing
11
+ *
12
+ * The menu hugs its content and never reserves more space than its slotted
13
+ * sections need; it deliberately does not impose a height of its own. Sizing is
14
+ * owned by the consumer, since only the consumer knows how large the menu may
15
+ * grow in a given layout.
16
+ *
17
+ * From a web components perspective, drive the size from the host element and
18
+ * the slotted light-DOM nodes — not from component properties:
19
+ *
20
+ * - **Bound the whole menu** by giving the host element a definite `height`. The
21
+ * menu fills that height and the alert list scrolls within the remaining space
22
+ * while the footer and content keep their size. This is the recommended
23
+ * approach. (A `max-height` alone will not bound the list — the internal
24
+ * scroll needs a definite height to resolve against.)
25
+ * - **Size sections independently** (advanced) by sizing the slotted nodes
26
+ * directly — e.g. a fixed-height `content` element, or a capped, scrollable
27
+ * wrapper around the `alarms` items.
28
+ * - **Leave it unbounded** to let the menu grow with its content.
29
+ *
9
30
  * @slot buttons - Buttons shown in the footer.
10
31
  * @slot content - Main content shown in the content area.
11
32
  * @slot alarms - Alarm items rendered inside the alert list.
12
33
  */
13
34
  export declare class ObcIntegrationVesselMenu extends LitElement {
14
- /** Hide the alarm list, ensuring it doesn't take space (display: none). */
15
- hideAlarmList: boolean;
35
+ hasActions: boolean;
36
+ hasAlertList: boolean;
37
+ hasContent: boolean;
16
38
  protected render(): import('lit-html').TemplateResult<1>;
17
39
  static styles: import('lit').CSSResult;
18
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"integration-vessel-menu.d.ts","sourceRoot":"","sources":["../../../src/integration-systems/integration-vessel-menu/integration-vessel-menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;AAMhD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,6CAA6C,CAAC;AACrD,OAAO,iCAAiC,CAAC;AACzC,OAAO,gDAAgD,CAAC;AAExD;;;;;;GAMG;AAEH,qBACa,wBAAyB,SAAQ,UAAU;IACtD,2EAA2E;IAChD,aAAa,UAAS;cAE9B,MAAM;IA2BzB,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,6BAA6B,EAAE,wBAAwB,CAAC;KACzD;CACF"}
1
+ {"version":3,"file":"integration-vessel-menu.d.ts","sourceRoot":"","sources":["../../../src/integration-systems/integration-vessel-menu/integration-vessel-menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;AAMhD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,6CAA6C,CAAC;AACrD,OAAO,iCAAiC,CAAC;AACzC,OAAO,oCAAoC,CAAC;AAC5C,OAAO,gDAAgD,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,qBACa,wBAAyB,SAAQ,UAAU;IACT,UAAU,UAAQ;IAClB,YAAY,UAAQ;IACpB,UAAU,UAAQ;cAE5C,MAAM;IAuCzB,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,6BAA6B,EAAE,wBAAwB,CAAC;KACzD;CACF"}
@@ -6,6 +6,7 @@ import componentStyle from "./integration-vessel-menu.css.js";
6
6
  import "../../components/button/button.js";
7
7
  import "../../components/icon-button/icon-button.js";
8
8
  import "../../icons/icon-placeholder.js";
9
+ import "../../icons/icon-unacknowledged.js";
9
10
  import "../../building-blocks/alert-list/alert-list.js";
10
11
  var __defProp = Object.defineProperty;
11
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -20,29 +21,43 @@ var __decorateClass = (decorators, target, key, kind) => {
20
21
  let ObcIntegrationVesselMenu = class extends LitElement {
21
22
  constructor() {
22
23
  super(...arguments);
23
- this.hideAlarmList = false;
24
+ this.hasActions = true;
25
+ this.hasAlertList = true;
26
+ this.hasContent = true;
24
27
  }
25
28
  render() {
26
29
  return html`
27
- <div
28
- class=${classMap({
29
- wrapper: true
30
+ <div class="wrapper">
31
+ <div
32
+ class=${classMap({
33
+ "footer-container": true,
34
+ hidden: !this.hasActions
30
35
  })}
31
- >
32
- <div class="footer-container">
36
+ >
33
37
  <slot name="buttons" class="buttons-slot"></slot>
34
38
  </div>
35
- <div class="content-area">
36
- <slot name="content"></slot>
39
+ <div
40
+ class=${classMap({
41
+ "content-area": true,
42
+ hidden: !this.hasContent
43
+ })}
44
+ >
45
+ <slot name="content" class="content-slot"></slot>
37
46
  </div>
38
47
  <div
39
48
  class=${classMap({
40
49
  "content-container": true,
41
- hidealarmlist: this.hideAlarmList
50
+ hidden: !this.hasAlertList
42
51
  })}
43
52
  >
44
53
  <obc-alert-list class="alertlist"
45
54
  ><slot name="alarms"></slot>
55
+ <div slot="empty-icon">
56
+ <obi-unacknowledged></obi-unacknowledged>
57
+ </div>
58
+ <div slot="empty-title">
59
+ <span>No alerts</span>
60
+ </div>
46
61
  </obc-alert-list>
47
62
  </div>
48
63
  </div>
@@ -51,8 +66,14 @@ let ObcIntegrationVesselMenu = class extends LitElement {
51
66
  };
52
67
  ObcIntegrationVesselMenu.styles = unsafeCSS(componentStyle);
53
68
  __decorateClass([
54
- property({ type: Boolean })
55
- ], ObcIntegrationVesselMenu.prototype, "hideAlarmList", 2);
69
+ property({ type: Boolean, attribute: false })
70
+ ], ObcIntegrationVesselMenu.prototype, "hasActions", 2);
71
+ __decorateClass([
72
+ property({ type: Boolean, attribute: false })
73
+ ], ObcIntegrationVesselMenu.prototype, "hasAlertList", 2);
74
+ __decorateClass([
75
+ property({ type: Boolean, attribute: false })
76
+ ], ObcIntegrationVesselMenu.prototype, "hasContent", 2);
56
77
  ObcIntegrationVesselMenu = __decorateClass([
57
78
  customElement("obc-integration-vessel-menu")
58
79
  ], ObcIntegrationVesselMenu);
@@ -1 +1 @@
1
- {"version":3,"file":"integration-vessel-menu.js","sources":["../../../src/integration-systems/integration-vessel-menu/integration-vessel-menu.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\nimport componentStyle from './integration-vessel-menu.css?inline';\n\nimport '../../components/button/button.js';\nimport '../../components/icon-button/icon-button.js';\nimport '../../icons/icon-placeholder.js';\nimport '../../building-blocks/alert-list/alert-list.js';\n\n/**\n * `<obc-integration-vessel-menu>` – A menu to be shown when selecting a obc-integration-button from a obc-integration-bar.\n *\n * @slot buttons - Buttons shown in the footer.\n * @slot content - Main content shown in the content area.\n * @slot alarms - Alarm items rendered inside the alert list.\n */\n\n@customElement('obc-integration-vessel-menu')\nexport class ObcIntegrationVesselMenu extends LitElement {\n /** Hide the alarm list, ensuring it doesn't take space (display: none). */\n @property({type: Boolean}) hideAlarmList = false;\n\n protected override render() {\n return html`\n <div\n class=${classMap({\n wrapper: true,\n })}\n >\n <div class=\"footer-container\">\n <slot name=\"buttons\" class=\"buttons-slot\"></slot>\n </div>\n <div class=\"content-area\">\n <slot name=\"content\"></slot>\n </div>\n <div\n class=${classMap({\n 'content-container': true,\n hidealarmlist: this.hideAlarmList,\n })}\n >\n <obc-alert-list class=\"alertlist\"\n ><slot name=\"alarms\"></slot>\n </obc-alert-list>\n </div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-integration-vessel-menu': ObcIntegrationVesselMenu;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAoBO,IAAM,2BAAN,cAAuC,WAAW;AAAA,EAAlD,cAAA;AAAA,UAAA,GAAA,SAAA;AAEsB,SAAA,gBAAgB;AAAA,EAAA;AAAA,EAExB,SAAS;AAC1B,WAAO;AAAA;AAAA,gBAEK,SAAS;AAAA,MACf,SAAS;AAAA,IAAA,CACV,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBASQ,SAAS;AAAA,MACf,qBAAqB;AAAA,MACrB,eAAe,KAAK;AAAA,IAAA,CACrB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQV;AAGF;AAhCa,yBA+BK,SAAS,UAAU,cAAc;AA7BtB,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAFd,yBAEgB,WAAA,iBAAA,CAAA;AAFhB,2BAAN,gBAAA;AAAA,EADN,cAAc,6BAA6B;AAAA,GAC/B,wBAAA;"}
1
+ {"version":3,"file":"integration-vessel-menu.js","sources":["../../../src/integration-systems/integration-vessel-menu/integration-vessel-menu.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\nimport componentStyle from './integration-vessel-menu.css?inline';\n\nimport '../../components/button/button.js';\nimport '../../components/icon-button/icon-button.js';\nimport '../../icons/icon-placeholder.js';\nimport '../../icons/icon-unacknowledged.js';\nimport '../../building-blocks/alert-list/alert-list.js';\n\n/**\n * `<obc-integration-vessel-menu>` – A menu to be shown when selecting a obc-integration-button from a obc-integration-bar.\n *\n * ## Sizing\n *\n * The menu hugs its content and never reserves more space than its slotted\n * sections need; it deliberately does not impose a height of its own. Sizing is\n * owned by the consumer, since only the consumer knows how large the menu may\n * grow in a given layout.\n *\n * From a web components perspective, drive the size from the host element and\n * the slotted light-DOM nodes — not from component properties:\n *\n * - **Bound the whole menu** by giving the host element a definite `height`. The\n * menu fills that height and the alert list scrolls within the remaining space\n * while the footer and content keep their size. This is the recommended\n * approach. (A `max-height` alone will not bound the list — the internal\n * scroll needs a definite height to resolve against.)\n * - **Size sections independently** (advanced) by sizing the slotted nodes\n * directly — e.g. a fixed-height `content` element, or a capped, scrollable\n * wrapper around the `alarms` items.\n * - **Leave it unbounded** to let the menu grow with its content.\n *\n * @slot buttons - Buttons shown in the footer.\n * @slot content - Main content shown in the content area.\n * @slot alarms - Alarm items rendered inside the alert list.\n */\n\n@customElement('obc-integration-vessel-menu')\nexport class ObcIntegrationVesselMenu extends LitElement {\n @property({type: Boolean, attribute: false}) hasActions = true;\n @property({type: Boolean, attribute: false}) hasAlertList = true;\n @property({type: Boolean, attribute: false}) hasContent = true;\n\n protected override render() {\n return html`\n <div class=\"wrapper\">\n <div\n class=${classMap({\n 'footer-container': true,\n hidden: !this.hasActions,\n })}\n >\n <slot name=\"buttons\" class=\"buttons-slot\"></slot>\n </div>\n <div\n class=${classMap({\n 'content-area': true,\n hidden: !this.hasContent,\n })}\n >\n <slot name=\"content\" class=\"content-slot\"></slot>\n </div>\n <div\n class=${classMap({\n 'content-container': true,\n hidden: !this.hasAlertList,\n })}\n >\n <obc-alert-list class=\"alertlist\"\n ><slot name=\"alarms\"></slot>\n <div slot=\"empty-icon\">\n <obi-unacknowledged></obi-unacknowledged>\n </div>\n <div slot=\"empty-title\">\n <span>No alerts</span>\n </div>\n </obc-alert-list>\n </div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-integration-vessel-menu': ObcIntegrationVesselMenu;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAyCO,IAAM,2BAAN,cAAuC,WAAW;AAAA,EAAlD,cAAA;AAAA,UAAA,GAAA,SAAA;AACwC,SAAA,aAAa;AACb,SAAA,eAAe;AACf,SAAA,aAAa;AAAA,EAAA;AAAA,EAEvC,SAAS;AAC1B,WAAO;AAAA;AAAA;AAAA,kBAGO,SAAS;AAAA,MACf,oBAAoB;AAAA,MACpB,QAAQ,CAAC,KAAK;AAAA,IAAA,CACf,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,kBAKM,SAAS;AAAA,MACf,gBAAgB;AAAA,MAChB,QAAQ,CAAC,KAAK;AAAA,IAAA,CACf,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,kBAKM,SAAS;AAAA,MACf,qBAAqB;AAAA,MACrB,QAAQ,CAAC,KAAK;AAAA,IAAA,CACf,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcV;AAGF;AA7Ca,yBA4CK,SAAS,UAAU,cAAc;AA3CJ,gBAAA;AAAA,EAA5C,SAAS,EAAC,MAAM,SAAS,WAAW,OAAM;AAAA,GADhC,yBACkC,WAAA,cAAA,CAAA;AACA,gBAAA;AAAA,EAA5C,SAAS,EAAC,MAAM,SAAS,WAAW,OAAM;AAAA,GAFhC,yBAEkC,WAAA,gBAAA,CAAA;AACA,gBAAA;AAAA,EAA5C,SAAS,EAAC,MAAM,SAAS,WAAW,OAAM;AAAA,GAHhC,yBAGkC,WAAA,cAAA,CAAA;AAHlC,2BAAN,gBAAA;AAAA,EADN,cAAc,6BAA6B;AAAA,GAC/B,wBAAA;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oicl/openbridge-webcomponents",
3
- "version": "2.0.0-next.72",
3
+ "version": "2.0.0-next.74",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",