@oicl/openbridge-webcomponents 2.1.0-next.1 → 2.1.0-next.3

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 (59) hide show
  1. package/README.md +1 -0
  2. package/bundle/openbridge-webcomponents.bundle.js +390 -301
  3. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  4. package/custom-elements.json +979 -94
  5. package/dist/automation/valve-analoge-two-way-icon/valve-analog-two-way-icon.d.ts +25 -1
  6. package/dist/automation/valve-analoge-two-way-icon/valve-analog-two-way-icon.d.ts.map +1 -1
  7. package/dist/automation/valve-analoge-two-way-icon/valve-analog-two-way-icon.js +39 -58
  8. package/dist/automation/valve-analoge-two-way-icon/valve-analog-two-way-icon.js.map +1 -1
  9. package/dist/building-blocks/alert-list/alert-list-base.d.ts +60 -0
  10. package/dist/building-blocks/alert-list/alert-list-base.d.ts.map +1 -0
  11. package/dist/building-blocks/alert-list/alert-list-base.js +191 -0
  12. package/dist/building-blocks/alert-list/alert-list-base.js.map +1 -0
  13. package/dist/building-blocks/alert-list/alert-list.css.js.map +1 -1
  14. package/dist/building-blocks/alert-list/alert-list.d.ts +13 -26
  15. package/dist/building-blocks/alert-list/alert-list.d.ts.map +1 -1
  16. package/dist/building-blocks/alert-list/alert-list.js +7 -142
  17. package/dist/building-blocks/alert-list/alert-list.js.map +1 -1
  18. package/dist/components/alert-icon/alert-icon.d.ts.map +1 -1
  19. package/dist/components/alert-icon/alert-icon.js +6 -5
  20. package/dist/components/alert-icon/alert-icon.js.map +1 -1
  21. package/dist/components/alert-list-details/alert-list-details.css.js +4 -1
  22. package/dist/components/alert-list-details/alert-list-details.css.js.map +1 -1
  23. package/dist/components/alert-menu/alert-menu.css.js +3 -42
  24. package/dist/components/alert-menu/alert-menu.css.js.map +1 -1
  25. package/dist/components/alert-menu/alert-menu.d.ts +28 -6
  26. package/dist/components/alert-menu/alert-menu.d.ts.map +1 -1
  27. package/dist/components/alert-menu/alert-menu.js +81 -60
  28. package/dist/components/alert-menu/alert-menu.js.map +1 -1
  29. package/dist/components/alert-menu-item/alert-menu-item.d.ts +16 -6
  30. package/dist/components/alert-menu-item/alert-menu-item.d.ts.map +1 -1
  31. package/dist/components/alert-menu-item/alert-menu-item.js +11 -2
  32. package/dist/components/alert-menu-item/alert-menu-item.js.map +1 -1
  33. package/dist/components/number-input-field/number-input-field.css.js +8 -2
  34. package/dist/components/number-input-field/number-input-field.css.js.map +1 -1
  35. package/dist/components/number-input-field/number-input-field.d.ts +15 -1
  36. package/dist/components/number-input-field/number-input-field.d.ts.map +1 -1
  37. package/dist/components/number-input-field/number-input-field.js +38 -44
  38. package/dist/components/number-input-field/number-input-field.js.map +1 -1
  39. package/dist/components/textbox/textbox.css.js +3 -9
  40. package/dist/components/textbox/textbox.css.js.map +1 -1
  41. package/dist/components/textbox/textbox.d.ts +3 -0
  42. package/dist/components/textbox/textbox.d.ts.map +1 -1
  43. package/dist/components/textbox/textbox.js.map +1 -1
  44. package/dist/generated/locales/es-419.d.ts +1 -1
  45. package/dist/generated/locales/es-419.js +1 -1
  46. package/dist/generated/locales/es-419.js.map +1 -1
  47. package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js +2 -1
  48. package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js.map +1 -1
  49. package/dist/pages/alert-detail-page/alert-detail-page.js +1 -1
  50. package/dist/pages/alert-detail-page/alert-detail-page.js.map +1 -1
  51. package/dist/pages/alert-list-page-small/alert-list-page-small-base.d.ts +63 -0
  52. package/dist/pages/alert-list-page-small/alert-list-page-small-base.d.ts.map +1 -0
  53. package/dist/pages/alert-list-page-small/alert-list-page-small-base.js +126 -0
  54. package/dist/pages/alert-list-page-small/alert-list-page-small-base.js.map +1 -0
  55. package/dist/pages/alert-list-page-small/alert-list-page-small.d.ts +12 -15
  56. package/dist/pages/alert-list-page-small/alert-list-page-small.d.ts.map +1 -1
  57. package/dist/pages/alert-list-page-small/alert-list-page-small.js +41 -92
  58. package/dist/pages/alert-list-page-small/alert-list-page-small.js.map +1 -1
  59. package/package.json +1 -1
@@ -16,6 +16,7 @@ import { localized, msg } from "@lit/localize";
16
16
  import { LitElement, html, nothing, unsafeCSS } from "lit";
17
17
  import { property, query, state } from "lit/decorators.js";
18
18
  //#region src/components/alert-menu/alert-menu.ts
19
+ var WAITING_FOR_ACK = [ObcAlertMenuItemStatus.Unacknowledged, ObcAlertMenuItemStatus.RectifiedUnacknowledged];
19
20
  var ObcAlertMenu = class ObcAlertMenu extends LitElement {
20
21
  constructor(..._args) {
21
22
  super(..._args);
@@ -26,88 +27,108 @@ var ObcAlertMenu = class ObcAlertMenu extends LitElement {
26
27
  this.canAckAll = false;
27
28
  this.showSilenceButton = true;
28
29
  this.showAlertListButton = true;
29
- this._selectedTabIndex = 1;
30
30
  }
31
31
  handleAckAllVisibleClick() {
32
32
  const visibleElements = this.alertList.getVisibleElements();
33
33
  this.dispatchEvent(new CustomEvent("ack-all-visible-click", { detail: {
34
34
  visibleElements,
35
- tabName: this.getSelectedTab().name
35
+ tabName: this.selectedTab.name
36
36
  } }));
37
37
  }
38
38
  onTabChange(e) {
39
- this._selectedTabIndex = e.detail.tab;
39
+ this._selectedTabName = this.tabs[e.detail.tab]?.name;
40
40
  }
41
- getSelectedTab() {
42
- if (this._selectedTabIndex === 0) return {
41
+ willUpdate(changedProperties) {
42
+ super.willUpdate(changedProperties);
43
+ if (!this.tabs.some((tab) => tab.name === this._selectedTabName)) this._selectedTabName = void 0;
44
+ }
45
+ /** Whether the menu offers "ACK visible" at all; `canAckAll` enables it. */
46
+ get offersAckAll() {
47
+ return true;
48
+ }
49
+ /** The tabs in display order; the menu opens on the second one. */
50
+ get tabs() {
51
+ const tabs = [{
43
52
  name: "unacked",
53
+ title: msg("Unacked"),
44
54
  emptyTitle: msg("No unacknowledged alerts"),
45
- emptyDescription: msg("Go to the 'Alert list' for more details or to manage existing alerts."),
46
- emptyIcon: html`<obi-unacknowledged></obi-unacknowledged>`,
47
- class: "unacked",
48
- filter: (item) => {
49
- return item.getAttribute("status") === ObcAlertMenuItemStatus.Unacknowledged && !item.hasAttribute("shelved");
50
- }
51
- };
52
- else if (this._selectedTabIndex === 2) return {
53
- name: "shelved",
54
- emptyTitle: msg("No shelved alerts"),
55
- emptyDescription: msg("Go to the 'Alert list' for more details or to manage existing alerts."),
56
- emptyIcon: html`<obi-alerts-shelf></obi-alerts-shelf>`,
57
- class: "shelved",
58
- filter: (item) => {
59
- return item.hasAttribute("shelved");
60
- }
61
- };
62
- else return {
55
+ emptyIcon: html`<obi-unacknowledged></obi-unacknowledged>`
56
+ }, {
63
57
  name: "all",
58
+ title: msg("Active"),
64
59
  emptyTitle: msg("No active alerts"),
65
- emptyDescription: msg("Go to the 'Alert list' for more details or to manage existing alerts."),
66
- emptyIcon: html`<obi-alerts></obi-alerts>`,
67
- class: "all",
68
- filter: (item) => {
69
- return !item.hasAttribute("shelved");
70
- }
71
- };
60
+ emptyIcon: html`<obi-alerts></obi-alerts>`
61
+ }];
62
+ if (this.hasShelved) tabs.push({
63
+ name: "shelved",
64
+ title: msg("Shelved"),
65
+ emptyTitle: msg("No shelved alerts"),
66
+ emptyIcon: html`<obi-alerts-shelf></obi-alerts-shelf>`
67
+ });
68
+ return tabs;
69
+ }
70
+ /** Where the selected tab sits in `tabs`: the one the user picked, else the second. */
71
+ selectedTabIndex(tabs) {
72
+ const index = tabs.findIndex((tab) => tab.name === this._selectedTabName);
73
+ return index === -1 ? 1 : index;
74
+ }
75
+ get selectedTab() {
76
+ const tabs = this.tabs;
77
+ return tabs[this.selectedTabIndex(tabs)];
78
+ }
79
+ /**
80
+ * The list that shows the selected tab's items. The CSS hides the items the
81
+ * tab leaves out; the filter tells the list which ones those are.
82
+ */
83
+ renderList(tab, content) {
84
+ return html`<obc-alert-list
85
+ class="alert-list ${tab.name}"
86
+ .filter=${(item) => this.tabFilter(tab.name, item)}
87
+ >${content}</obc-alert-list
88
+ >`;
89
+ }
90
+ tabFilter(name, item) {
91
+ const status = item.getAttribute("status") ?? "";
92
+ if (name === "unacked") return WAITING_FOR_ACK.includes(status) && !item.hasAttribute("shelved");
93
+ if (name === "shelved") return item.hasAttribute("shelved");
94
+ return !item.hasAttribute("shelved") && status !== ObcAlertMenuItemStatus.RectifiedUnacknowledged;
72
95
  }
73
96
  render() {
74
- const t = this.getSelectedTab();
97
+ const tabs = this.tabs;
98
+ const selectedIndex = this.selectedTabIndex(tabs);
99
+ const t = tabs[selectedIndex];
75
100
  return html`
76
101
  <obc-tabbed-card
77
- .nTabs=${this.hasShelved ? 3 : 2}
102
+ .nTabs=${tabs.length}
78
103
  class="wrapper"
79
104
  part="wrapper"
80
- .selectedTab=${this._selectedTabIndex}
105
+ .selectedTab=${selectedIndex}
81
106
  hasDefaultSlotOnly
82
107
  @tab-change=${this.onTabChange}
83
108
  >
84
- <span slot="tab-title-0">${msg("Unacked")}</span>
85
- <span slot="tab-title-1">${msg("Active")}</span>
86
- ${this.hasShelved ? html`<span slot="tab-title-2">${msg("Shelved")}</span>` : nothing}
109
+ ${tabs.map((tab, index) => html`<span slot="tab-title-${index}">${tab.title}</span>`)}
87
110
  <div class="container">
88
- <obc-alert-list class="alert-list ${t.class}" .filter=${t.filter}>
89
- <slot></slot>
90
- <slot name="empty-${t.name}-title" slot="empty-title"
91
- >${t.emptyTitle}</slot
92
- >
93
- <slot name="empty-${t.name}-description" slot="empty-description"
94
- >${t.emptyDescription}</slot
95
- >
96
- <slot name="empty-${t.name}-icon" slot="empty-icon"
97
- >${t.emptyIcon}</slot
98
- >
99
- </obc-alert-list>
111
+ ${this.renderList(t, html`<slot></slot>
112
+ <slot name="empty-${t.name}-title" slot="empty-title"
113
+ >${t.emptyTitle}</slot
114
+ >
115
+ <slot name="empty-${t.name}-description" slot="empty-description"
116
+ >${msg("Go to the 'Alert list' for more details or to manage existing alerts.")}</slot
117
+ >
118
+ <slot name="empty-${t.name}-icon" slot="empty-icon"
119
+ >${t.emptyIcon}</slot
120
+ >`)}
100
121
  <div class="action">
101
- <obc-button
102
- variant="raised"
103
- .disabled=${!this.canAckAll}
104
- fullWidth
105
- class="btn"
106
- data-testid="ack-all-visible-button"
107
- @click=${this.handleAckAllVisibleClick}
108
- >
109
- ${msg("ACK visible")}
110
- </obc-button>
122
+ ${this.offersAckAll ? html`<obc-button
123
+ variant="raised"
124
+ .disabled=${!this.canAckAll}
125
+ fullWidth
126
+ class="btn"
127
+ data-testid="ack-all-visible-button"
128
+ @click=${this.handleAckAllVisibleClick}
129
+ >
130
+ ${msg("ACK visible")}
131
+ </obc-button>` : nothing}
111
132
  ${this.showSilenceButton ? html`<obc-button
112
133
  variant="normal"
113
134
  fullWidth
@@ -153,8 +174,8 @@ __decorate([property({
153
174
  type: Boolean,
154
175
  attribute: false
155
176
  })], ObcAlertMenu.prototype, "showAlertListButton", void 0);
156
- __decorate([state()], ObcAlertMenu.prototype, "_selectedTabIndex", void 0);
157
- __decorate([query("obc-alert-list")], ObcAlertMenu.prototype, "alertList", void 0);
177
+ __decorate([state()], ObcAlertMenu.prototype, "_selectedTabName", void 0);
178
+ __decorate([query(".alert-list")], ObcAlertMenu.prototype, "alertList", void 0);
158
179
  ObcAlertMenu = __decorate([localized(), customElement("obc-alert-menu")], ObcAlertMenu);
159
180
  //#endregion
160
181
  export { ObcAlertMenu };
@@ -1 +1 @@
1
- {"version":3,"file":"alert-menu.js","names":[],"sources":["../../../src/components/alert-menu/alert-menu.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property, query, state} from 'lit/decorators.js';\nimport compentStyle from './alert-menu.css?inline';\nimport '../button/button.js';\nimport '../../icons/icon-chevron-right-google.js';\nimport '../../icons/icon-silence-iec.js';\nimport '../../icons/icon-alert-list.js';\nimport '../../icons/icon-alerts.js';\nimport '../../icons/icon-alerts-shelf.js';\nimport '../../icons/icon-unacknowledged.js';\nimport '../tabbed-card/tabbed-card.js';\nimport {localized, msg} from '@lit/localize';\nimport {customElement} from '../../decorator.js';\nimport '../../building-blocks/alert-list/alert-list.js';\nimport {ObcAlertList} from '../../building-blocks/alert-list/alert-list.js';\nimport {ObcTabbedCardChangeEvent} from '../tabbed-card/tabbed-card.js';\nimport {ObcAlertMenuItemStatus} from '../alert-menu-item/alert-menu-item.js';\nimport {PopoverController} from '../../internal/popover-controller.js';\n\nexport type ObcAckAllVisibleClickEvent = CustomEvent<{\n visibleElements: {element: HTMLElement; index: number}[];\n tabName: 'shelved' | 'unacked' | 'all';\n}>;\n\n/**\n * `<obc-alert-menu>` – A tabbed alert summary panel for displaying, acknowledging, and managing active alerts.\n *\n * Provides a compact, interactive menu for reviewing current alerts, grouped by status (e.g., unacknowledged, active, shelved). Users can acknowledge visible alerts, silence notifications, or navigate to a full alert list. Designed for quick triage and management of alert items in a sidebar or overlay context.\n *\n * ### Features\n * - **Tabbed organization:** Switch between \"Unacked\", \"Active\", and (optionally) \"Shelved\" tabs for focused alert review.\n * - **Alert filtering:** Each tab displays only relevant alerts (e.g., \"Unacked\" shows only unacknowledged, non-shelved items).\n * - **Bulk actions:** \"ACK visible\" button allows acknowledging all currently visible (filtered) alerts at once.\n * - **Silence and navigation:** Dedicated buttons to silence alerts or jump to the full alert list.\n * - **Dynamic content:** Supports any number of `<obc-alert-menu-item>` children, with automatic empty-state messaging and icons per tab.\n * - **Responsive layout:** Adapts to available space, with scrollable alert lists and sticky action bar.\n * - **Customizable:** Optionally show/hide the \"Shelved\" tab via `hasShelved` property; enable/disable bulk ACK via `canAckAll`.\n *\n * ### Usage Guidelines\n * Use `<obc-alert-menu>` to provide users with a focused, actionable summary of current alerts, typically in a sidebar, overlay, or dashboard context. Ideal for scenarios where users need to quickly review, acknowledge, or silence multiple alerts without leaving their current workflow. Avoid using for persistent, always-visible alert banners; for that, use a dedicated alert banner or notification system.\n *\n * - Place one or more `<obc-alert-menu-item>` elements as children to populate the alert list.\n * - Use the `hasShelved` property to enable the \"Shelved\" tab if your application supports alert shelving.\n * - Use the `canAckAll` property to control whether the \"ACK visible\" button is enabled (e.g., only when there are unacknowledged alerts in view).\n * - Listen for custom events (`ack-all-visible-click`, `silence-click`, `go-to-alert-list-click`) to handle user actions.\n *\n * **TODO(designer):** Confirm if there are recommended maximum numbers of alerts to display, or if there are best practices for when to use the \"Shelved\" tab.\n *\n * ### Slots\n *\n * | Slot Name | Renders When... | Purpose |\n * |----------------------------------|----------------------------------|----------------------------------------------------------------|\n * | (default) | Always | Place one or more `<obc-alert-menu-item>` elements as alert rows. |\n * | empty-<tab>-title | Selected tab is empty | Custom title for the empty state (`<tab>` is one of `unacked`, `all`, `shelved`). |\n * | empty-<tab>-description | Selected tab is empty | Custom description for the empty state (`<tab>` is one of `unacked`, `all`, `shelved`). |\n * | empty-<tab>-icon | Selected tab is empty | Custom icon for the empty state (`<tab>` is one of `unacked`, `all`, `shelved`). |\n *\n * ### Properties\n * - `hasShelved` (boolean): If true, displays the \"Shelved\" tab and enables shelving support. Default: false.\n * - `canAckAll` (boolean): If true, enables the \"ACK visible\" button for bulk acknowledgment. Default: false.\n * - `showSilenceButton` (boolean): If true, shows the \"Silence\" button. Default: true.\n * - `showAlertListButton` (boolean): If true, shows the \"Alerts\" navigation button. Default: true.\n *\n * ### Events\n * - **ack-all-visible-click** – Fired when the \"ACK visible\" button is clicked. The event detail includes the list of visible alert elements and the current tab name.\n * - **silence-click** – Fired when the \"Silence\" button is clicked.\n * - **go-to-alert-list-click** – Fired when the \"Alerts\" navigation button is clicked.\n *\n * ### Best Practices and Constraints\n * - Only enable \"ACK visible\" when there are actionable, unacknowledged alerts in the current view.\n * - Use the \"Shelved\" tab only if your application supports shelving alerts; otherwise, omit it for simplicity.\n * - For accessibility, keep all alert items and action buttons keyboard navigable.\n * - Do not use this component for persistent, always-on-screen alerts; use banners or dialogs for critical, persistent notifications.\n *\n * ### Example\n * ```\n * <obc-alert-menu hasShelved canAckAll>\n * <obc-alert-menu-item active hasTime>\n * <obi-placeholder slot=\"alert-icon\"></obi-placeholder>\n * <span slot=\"title\">Engine Overheat</span>\n * <span slot=\"description\">Main engine temperature exceeds threshold</span>\n * <span slot=\"time\">09:12:34</span>\n * </obc-alert-menu-item>\n * <!-- More alert items... -->\n * </obc-alert-menu>\n * ```\n *\n * @property hasShelved - If true, displays the \"Shelved\" tab and enables shelving support for alerts.\n * Set to false to hide the \"Shelved\" tab and related filtering.\n * @property canAckAll - If true, enables the \"ACK visible\" button, allowing users to acknowledge all currently visible alerts in the active tab.\n * Should be set to true only when there are unacknowledged alerts in view.\n * @property showSilenceButton - If true, shows the \"Silence\" button in the action bar.\n * When hidden, the \"ACK visible\" button expands to fill the freed space.\n * @property showAlertListButton - If true, shows the \"Alerts\" navigation button in the action bar.\n * When hidden, the \"ACK visible\" button expands to fill the freed space.\n * @property softDismiss - Let the browser close this menu on its own: on a click outside it, on `Escape`, or when another menu opens. Leave it off to keep showing and hiding the menu yourself.\n * @property open - Whether the menu is showing.\n * @availableWhen open softDismiss==true\n * @slot - The alerts items as ObcAlertMenuItem\n * @slot empty-<tab>-title - Custom empty-state title for the selected tab (`<tab>` is one of `unacked`, `all`, `shelved`)\n * @slot empty-<tab>-description - Custom empty-state description for the selected tab (`<tab>` is one of `unacked`, `all`, `shelved`)\n * @slot empty-<tab>-icon - Custom empty-state icon for the selected tab (`<tab>` is one of `unacked`, `all`, `shelved`)\n * @fires {ObcAckAllVisibleClickEvent} ack-all-visible-click - Fired when the ack all visible button is clicked\n * @fires {CustomEvent} silence-click - Fired when the silence button is clicked\n * @fires {CustomEvent} go-to-alert-list-click - Fired when the go to alert list button is clicked\n * @fires {CustomEvent<void>} close - Fired when the menu closed on its own, from a click outside, `Escape`, or another menu opening. `open` is already `false` by the time it arrives.\n */\n@localized()\n/**\n * @stable\n */\n@customElement('obc-alert-menu')\nexport class ObcAlertMenu extends LitElement {\n @property({type: Boolean}) softDismiss = false;\n\n @property({type: Boolean}) open = false;\n\n protected readonly softDismissController = new PopoverController(this);\n\n @property({type: Boolean}) hasShelved: boolean = false;\n\n @property({type: Boolean}) canAckAll: boolean = false;\n\n @property({type: Boolean, attribute: false}) showSilenceButton: boolean =\n true;\n\n @property({type: Boolean, attribute: false}) showAlertListButton: boolean =\n true;\n\n @state() private _selectedTabIndex = 1;\n\n @query('obc-alert-list')\n private alertList!: ObcAlertList;\n\n private handleAckAllVisibleClick() {\n const panel = this.alertList;\n const visibleElements = panel.getVisibleElements();\n this.dispatchEvent(\n new CustomEvent('ack-all-visible-click', {\n detail: {\n visibleElements: visibleElements,\n tabName: this.getSelectedTab().name,\n },\n })\n );\n }\n\n private onTabChange(e: ObcTabbedCardChangeEvent) {\n this._selectedTabIndex = e.detail.tab;\n }\n\n private getSelectedTab() {\n if (this._selectedTabIndex === 0) {\n return {\n name: 'unacked',\n emptyTitle: msg('No unacknowledged alerts'),\n emptyDescription: msg(\n \"Go to the 'Alert list' for more details or to manage existing alerts.\"\n ),\n emptyIcon: html`<obi-unacknowledged></obi-unacknowledged>`,\n class: 'unacked',\n filter: (item: HTMLElement) => {\n return (\n item.getAttribute('status') ===\n ObcAlertMenuItemStatus.Unacknowledged &&\n !item.hasAttribute('shelved')\n );\n },\n };\n } else if (this._selectedTabIndex === 2) {\n return {\n name: 'shelved',\n emptyTitle: msg('No shelved alerts'),\n emptyDescription: msg(\n \"Go to the 'Alert list' for more details or to manage existing alerts.\"\n ),\n emptyIcon: html`<obi-alerts-shelf></obi-alerts-shelf>`,\n class: 'shelved',\n filter: (item: HTMLElement) => {\n return item.hasAttribute('shelved');\n },\n };\n } else {\n return {\n name: 'all',\n emptyTitle: msg('No active alerts'),\n emptyDescription: msg(\n \"Go to the 'Alert list' for more details or to manage existing alerts.\"\n ),\n emptyIcon: html`<obi-alerts></obi-alerts>`,\n class: 'all',\n filter: (item: HTMLElement) => {\n return !item.hasAttribute('shelved');\n },\n };\n }\n }\n\n override render() {\n const t = this.getSelectedTab();\n\n return html`\n <obc-tabbed-card\n .nTabs=${this.hasShelved ? 3 : 2}\n class=\"wrapper\"\n part=\"wrapper\"\n .selectedTab=${this._selectedTabIndex}\n hasDefaultSlotOnly\n @tab-change=${this.onTabChange}\n >\n <span slot=\"tab-title-0\">${msg('Unacked')}</span>\n <span slot=\"tab-title-1\">${msg('Active')}</span>\n ${\n this.hasShelved\n ? html`<span slot=\"tab-title-2\">${msg('Shelved')}</span>`\n : nothing\n }\n <div class=\"container\">\n <obc-alert-list class=\"alert-list ${t.class}\" .filter=${t.filter}>\n <slot></slot>\n <slot name=\"empty-${t.name}-title\" slot=\"empty-title\"\n >${t.emptyTitle}</slot\n >\n <slot name=\"empty-${t.name}-description\" slot=\"empty-description\"\n >${t.emptyDescription}</slot\n >\n <slot name=\"empty-${t.name}-icon\" slot=\"empty-icon\"\n >${t.emptyIcon}</slot\n >\n </obc-alert-list>\n <div class=\"action\">\n <obc-button\n variant=\"raised\"\n .disabled=${!this.canAckAll}\n fullWidth\n class=\"btn\"\n data-testid=\"ack-all-visible-button\"\n @click=${this.handleAckAllVisibleClick}\n >\n ${msg('ACK visible')}\n </obc-button>\n ${\n this.showSilenceButton\n ? html`<obc-button\n variant=\"normal\"\n fullWidth\n class=\"btn\"\n showLeadingIcon\n @click=${() =>\n this.dispatchEvent(new CustomEvent('silence-click'))}\n >\n <obi-silence-iec slot=\"leading-icon\"></obi-silence-iec>\n ${msg('Silence')}\n </obc-button>`\n : nothing\n }\n ${\n this.showAlertListButton\n ? html`<obc-button\n variant=\"normal\"\n class=\"btn\"\n fullWidth\n showLeadingIcon\n showTrailingIcon\n @click=${() =>\n this.dispatchEvent(\n new CustomEvent('go-to-alert-list-click')\n )}\n >\n <obi-alert-list slot=\"leading-icon\"></obi-alert-list>\n <obi-chevron-right-google\n slot=\"trailing-icon\"\n ></obi-chevron-right-google>\n ${msg('Alerts')}\n </obc-button>`\n : nothing\n }\n </div>\n </div>\n </obc-tabbed-card>\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-menu': ObcAlertMenu;\n }\n}\n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AA;AAG1C,WAAA,CAAA,MAAM,CAAA,GAAA,aAAA,WAAA,qBAAA,KAAA,CAAA;AAEN,WAAA,CAAA,MAAM,gBAAgB,CAAA,GAAA,aAAA,WAAA,aAAA,KAAA,CAAA;AAxBxB,eAAA,WAAA,CAAA,UAAU,GAIV,cAAc,gBAAgB,CAAA,GAAA,YAAA"}
1
+ {"version":3,"file":"alert-menu.js","names":[],"sources":["../../../src/components/alert-menu/alert-menu.ts"],"sourcesContent":["import {\n CSSResultGroup,\n LitElement,\n PropertyValues,\n TemplateResult,\n html,\n nothing,\n unsafeCSS,\n} from 'lit';\nimport {property, query, state} from 'lit/decorators.js';\nimport compentStyle from './alert-menu.css?inline';\nimport '../button/button.js';\nimport '../../icons/icon-chevron-right-google.js';\nimport '../../icons/icon-silence-iec.js';\nimport '../../icons/icon-alert-list.js';\nimport '../../icons/icon-alerts.js';\nimport '../../icons/icon-alerts-shelf.js';\nimport '../../icons/icon-unacknowledged.js';\nimport '../tabbed-card/tabbed-card.js';\nimport {localized, msg} from '@lit/localize';\nimport {customElement} from '../../decorator.js';\nimport '../../building-blocks/alert-list/alert-list.js';\nimport type {ObcAlertListBase} from '../../building-blocks/alert-list/alert-list-base.js';\nimport {ObcTabbedCardChangeEvent} from '../tabbed-card/tabbed-card.js';\nimport {ObcAlertMenuItemStatus} from '../alert-menu-item/alert-menu-item.js';\nimport {PopoverController} from '../../internal/popover-controller.js';\n\nexport type ObcAckAllVisibleClickEvent = CustomEvent<{\n visibleElements: {element: HTMLElement; index: number}[];\n tabName: 'shelved' | 'unacked' | 'all';\n}>;\n\n/** One tab of an alert menu: its name, its label and its empty state. */\nexport interface AlertMenuTab {\n /** Names the tab in `ack-all-visible-click` and in the `empty-<tab>-*` slots. */\n name: string;\n title: string;\n emptyTitle: string;\n emptyIcon: TemplateResult;\n}\n\nconst WAITING_FOR_ACK: string[] = [\n ObcAlertMenuItemStatus.Unacknowledged,\n ObcAlertMenuItemStatus.RectifiedUnacknowledged,\n];\n\n/**\n * `<obc-alert-menu>` – A tabbed alert summary panel for displaying, acknowledging, and managing active alerts.\n *\n * Provides a compact, interactive menu for reviewing current alerts, grouped by status (e.g., unacknowledged, active, shelved). Users can acknowledge visible alerts, silence notifications, or navigate to a full alert list. Designed for quick triage and management of alert items in a sidebar or overlay context.\n *\n * ### Features\n * - **Tabbed organization:** Switch between \"Unacked\", \"Active\", and (optionally) \"Shelved\" tabs for focused alert review.\n * - **Alert filtering:** Each tab displays only relevant alerts: \"Unacked\" shows the non-shelved items still waiting for acknowledgment (`unacknowledged` or `rectified-unacknowledged`), \"Active\" every non-shelved item except the `rectified-unacknowledged` ones. A subclass changes the tabs and the list through the `tabs` and `renderList` hooks.\n * - **Bulk actions:** \"ACK visible\" button allows acknowledging all currently visible (filtered) alerts at once.\n * - **Silence and navigation:** Dedicated buttons to silence alerts or jump to the full alert list.\n * - **Dynamic content:** Supports any number of `<obc-alert-menu-item>` children, with automatic empty-state messaging and icons per tab.\n * - **Responsive layout:** Adapts to available space, with scrollable alert lists and sticky action bar.\n * - **Customizable:** Optionally show/hide the \"Shelved\" tab via `hasShelved` property; enable/disable bulk ACK via `canAckAll`.\n *\n * ### Usage Guidelines\n * Use `<obc-alert-menu>` to provide users with a focused, actionable summary of current alerts, typically in a sidebar, overlay, or dashboard context. Ideal for scenarios where users need to quickly review, acknowledge, or silence multiple alerts without leaving their current workflow. Avoid using for persistent, always-visible alert banners; for that, use a dedicated alert banner or notification system.\n *\n * - Place one or more `<obc-alert-menu-item>` elements as children to populate the alert list.\n * - Use the `hasShelved` property to enable the \"Shelved\" tab if your application supports alert shelving.\n * - Use the `canAckAll` property to control whether the \"ACK visible\" button is enabled (e.g., only when there are unacknowledged alerts in view).\n * - Listen for custom events (`ack-all-visible-click`, `silence-click`, `go-to-alert-list-click`) to handle user actions.\n *\n * **TODO(designer):** Confirm if there are recommended maximum numbers of alerts to display, or if there are best practices for when to use the \"Shelved\" tab.\n *\n * ### Slots\n *\n * | Slot Name | Renders When... | Purpose |\n * |----------------------------------|----------------------------------|----------------------------------------------------------------|\n * | (default) | Always | Place one or more `<obc-alert-menu-item>` elements as alert rows. |\n * | empty-<tab>-title | Selected tab is empty | Custom title for the empty state (`<tab>` is one of `unacked`, `all`, `shelved`). |\n * | empty-<tab>-description | Selected tab is empty | Custom description for the empty state (`<tab>` is one of `unacked`, `all`, `shelved`). |\n * | empty-<tab>-icon | Selected tab is empty | Custom icon for the empty state (`<tab>` is one of `unacked`, `all`, `shelved`). |\n *\n * ### Properties\n * - `hasShelved` (boolean): If true, displays the \"Shelved\" tab and enables shelving support. Default: false.\n * - `canAckAll` (boolean): If true, enables the \"ACK visible\" button for bulk acknowledgment. Default: false.\n * - `showSilenceButton` (boolean): If true, shows the \"Silence\" button. Default: true.\n * - `showAlertListButton` (boolean): If true, shows the \"Alerts\" navigation button. Default: true.\n *\n * ### Events\n * - **ack-all-visible-click** – Fired when the \"ACK visible\" button is clicked. The event detail includes the list of visible alert elements and the current tab name.\n * - **silence-click** – Fired when the \"Silence\" button is clicked.\n * - **go-to-alert-list-click** – Fired when the \"Alerts\" navigation button is clicked.\n *\n * ### Best Practices and Constraints\n * - Only enable \"ACK visible\" when there are actionable, unacknowledged alerts in the current view.\n * - Use the \"Shelved\" tab only if your application supports shelving alerts; otherwise, omit it for simplicity.\n * - For accessibility, keep all alert items and action buttons keyboard navigable.\n * - Do not use this component for persistent, always-on-screen alerts; use banners or dialogs for critical, persistent notifications.\n *\n * ### Example\n * ```\n * <obc-alert-menu hasShelved canAckAll>\n * <obc-alert-menu-item active hasTime>\n * <obi-placeholder slot=\"alert-icon\"></obi-placeholder>\n * <span slot=\"title\">Engine Overheat</span>\n * <span slot=\"description\">Main engine temperature exceeds threshold</span>\n * <span slot=\"time\">09:12:34</span>\n * </obc-alert-menu-item>\n * <!-- More alert items... -->\n * </obc-alert-menu>\n * ```\n *\n * @property hasShelved - If true, displays the \"Shelved\" tab and enables shelving support for alerts.\n * Set to false to hide the \"Shelved\" tab and related filtering.\n * @property canAckAll - If true, enables the \"ACK visible\" button, allowing users to acknowledge all currently visible alerts in the active tab.\n * Should be set to true only when there are unacknowledged alerts in view.\n * @property showSilenceButton - If true, shows the \"Silence\" button in the action bar.\n * When hidden, the \"ACK visible\" button expands to fill the freed space.\n * @property showAlertListButton - If true, shows the \"Alerts\" navigation button in the action bar.\n * When hidden, the \"ACK visible\" button expands to fill the freed space.\n * @property softDismiss - Let the browser close this menu on its own: on a click outside it, on `Escape`, or when another menu opens. Leave it off to keep showing and hiding the menu yourself.\n * @property open - Whether the menu is showing.\n * @availableWhen open softDismiss==true\n * @slot - The alerts items as ObcAlertMenuItem\n * @slot empty-<tab>-title - Custom empty-state title for the selected tab (`<tab>` is one of `unacked`, `all`, `shelved`)\n * @slot empty-<tab>-description - Custom empty-state description for the selected tab (`<tab>` is one of `unacked`, `all`, `shelved`)\n * @slot empty-<tab>-icon - Custom empty-state icon for the selected tab (`<tab>` is one of `unacked`, `all`, `shelved`)\n * @fires {ObcAckAllVisibleClickEvent} ack-all-visible-click - Fired when the ack all visible button is clicked\n * @fires {CustomEvent} silence-click - Fired when the silence button is clicked\n * @fires {CustomEvent} go-to-alert-list-click - Fired when the go to alert list button is clicked\n * @fires {CustomEvent<void>} close - Fired when the menu closed on its own, from a click outside, `Escape`, or another menu opening. `open` is already `false` by the time it arrives.\n */\n@localized()\n/**\n * @stable\n */\n@customElement('obc-alert-menu')\nexport class ObcAlertMenu extends LitElement {\n @property({type: Boolean}) softDismiss = false;\n\n @property({type: Boolean}) open = false;\n\n protected readonly softDismissController = new PopoverController(this);\n\n @property({type: Boolean}) hasShelved: boolean = false;\n\n @property({type: Boolean}) canAckAll: boolean = false;\n\n @property({type: Boolean, attribute: false}) showSilenceButton: boolean =\n true;\n\n @property({type: Boolean, attribute: false}) showAlertListButton: boolean =\n true;\n\n /** The `name` of the tab the user picked; the second tab shows until then. */\n @state() private _selectedTabName?: string;\n\n @query('.alert-list')\n private alertList!: ObcAlertListBase;\n\n private handleAckAllVisibleClick() {\n const panel = this.alertList;\n const visibleElements = panel.getVisibleElements();\n this.dispatchEvent(\n new CustomEvent('ack-all-visible-click', {\n detail: {\n visibleElements: visibleElements,\n tabName: this.selectedTab.name,\n },\n })\n );\n }\n\n private onTabChange(e: ObcTabbedCardChangeEvent) {\n this._selectedTabName = this.tabs[e.detail.tab]?.name;\n }\n\n protected override willUpdate(changedProperties: PropertyValues<this>) {\n super.willUpdate(changedProperties);\n // A picked tab that goes away, as Shelved does when `hasShelved` turns\n // off, gives way to the second tab, which stays when the tab returns.\n if (!this.tabs.some((tab) => tab.name === this._selectedTabName)) {\n this._selectedTabName = undefined;\n }\n }\n\n /** Whether the menu offers \"ACK visible\" at all; `canAckAll` enables it. */\n protected get offersAckAll(): boolean {\n return true;\n }\n\n /** The tabs in display order; the menu opens on the second one. */\n protected get tabs(): AlertMenuTab[] {\n const tabs = [\n {\n name: 'unacked',\n title: msg('Unacked'),\n emptyTitle: msg('No unacknowledged alerts'),\n emptyIcon: html`<obi-unacknowledged></obi-unacknowledged>`,\n },\n {\n name: 'all',\n title: msg('Active'),\n emptyTitle: msg('No active alerts'),\n emptyIcon: html`<obi-alerts></obi-alerts>`,\n },\n ];\n if (this.hasShelved) {\n tabs.push({\n name: 'shelved',\n title: msg('Shelved'),\n emptyTitle: msg('No shelved alerts'),\n emptyIcon: html`<obi-alerts-shelf></obi-alerts-shelf>`,\n });\n }\n return tabs;\n }\n\n /** Where the selected tab sits in `tabs`: the one the user picked, else the second. */\n private selectedTabIndex(tabs: AlertMenuTab[]): number {\n const index = tabs.findIndex((tab) => tab.name === this._selectedTabName);\n return index === -1 ? 1 : index;\n }\n\n private get selectedTab(): AlertMenuTab {\n const tabs = this.tabs;\n return tabs[this.selectedTabIndex(tabs)];\n }\n\n /**\n * The list that shows the selected tab's items. The CSS hides the items the\n * tab leaves out; the filter tells the list which ones those are.\n */\n protected renderList(\n tab: AlertMenuTab,\n content: TemplateResult\n ): TemplateResult {\n return html`<obc-alert-list\n class=\"alert-list ${tab.name}\"\n .filter=${(item: HTMLElement) => this.tabFilter(tab.name, item)}\n >${content}</obc-alert-list\n >`;\n }\n\n private tabFilter(name: string, item: HTMLElement): boolean {\n const status = item.getAttribute('status') ?? '';\n if (name === 'unacked') {\n return WAITING_FOR_ACK.includes(status) && !item.hasAttribute('shelved');\n }\n if (name === 'shelved') {\n return item.hasAttribute('shelved');\n }\n return (\n !item.hasAttribute('shelved') &&\n status !== ObcAlertMenuItemStatus.RectifiedUnacknowledged\n );\n }\n\n override render() {\n const tabs = this.tabs;\n const selectedIndex = this.selectedTabIndex(tabs);\n const t = tabs[selectedIndex];\n\n return html`\n <obc-tabbed-card\n .nTabs=${tabs.length}\n class=\"wrapper\"\n part=\"wrapper\"\n .selectedTab=${selectedIndex}\n hasDefaultSlotOnly\n @tab-change=${this.onTabChange}\n >\n ${tabs.map(\n (tab, index) =>\n html`<span slot=\"tab-title-${index}\">${tab.title}</span>`\n )}\n <div class=\"container\">\n ${this.renderList(\n t,\n html`<slot></slot>\n <slot name=\"empty-${t.name}-title\" slot=\"empty-title\"\n >${t.emptyTitle}</slot\n >\n <slot name=\"empty-${t.name}-description\" slot=\"empty-description\"\n >${msg(\n \"Go to the 'Alert list' for more details or to manage existing alerts.\"\n )}</slot\n >\n <slot name=\"empty-${t.name}-icon\" slot=\"empty-icon\"\n >${t.emptyIcon}</slot\n >`\n )}\n <div class=\"action\">\n ${\n this.offersAckAll\n ? html`<obc-button\n variant=\"raised\"\n .disabled=${!this.canAckAll}\n fullWidth\n class=\"btn\"\n data-testid=\"ack-all-visible-button\"\n @click=${this.handleAckAllVisibleClick}\n >\n ${msg('ACK visible')}\n </obc-button>`\n : nothing\n }\n ${\n this.showSilenceButton\n ? html`<obc-button\n variant=\"normal\"\n fullWidth\n class=\"btn\"\n showLeadingIcon\n @click=${() =>\n this.dispatchEvent(new CustomEvent('silence-click'))}\n >\n <obi-silence-iec slot=\"leading-icon\"></obi-silence-iec>\n ${msg('Silence')}\n </obc-button>`\n : nothing\n }\n ${\n this.showAlertListButton\n ? html`<obc-button\n variant=\"normal\"\n class=\"btn\"\n fullWidth\n showLeadingIcon\n showTrailingIcon\n @click=${() =>\n this.dispatchEvent(\n new CustomEvent('go-to-alert-list-click')\n )}\n >\n <obi-alert-list slot=\"leading-icon\"></obi-alert-list>\n <obi-chevron-right-google\n slot=\"trailing-icon\"\n ></obi-chevron-right-google>\n ${msg('Alerts')}\n </obc-button>`\n : nothing\n }\n </div>\n </div>\n </obc-tabbed-card>\n `;\n }\n\n static override styles: CSSResultGroup = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-menu': ObcAlertMenu;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyCA,IAAM,kBAA4B,CAChC,uBAAuB,gBACvB,uBAAuB,uBACzB;AA0FO,IAAM,eAAN,MAAM,qBAAqB,WAAW;;;EACF,KAAA,cAAA;EAEP,KAAA,OAAA;EAES,KAAA,wBAAA,IAAI,kBAAkB,IAAI;EAEpB,KAAA,aAAA;EAED,KAAA,YAAA;EAG9C,KAAA,oBAAA;EAGA,KAAA,sBAAA;;CAQF,2BAAmC;EAEjC,MAAM,kBADQ,KAAK,UACW,mBAAmB;EACjD,KAAK,cACH,IAAI,YAAY,yBAAyB,EACvC,QAAQ;GACW;GACjB,SAAS,KAAK,YAAY;EAC5B,EACF,CAAC,CACH;CACF;CAEA,YAAoB,GAA6B;EAC/C,KAAK,mBAAmB,KAAK,KAAK,EAAE,OAAO,IAAI,EAAE;CACnD;CAEA,WAA8B,mBAAyC;EACrE,MAAM,WAAW,iBAAiB;EAGlC,IAAI,CAAC,KAAK,KAAK,MAAM,QAAQ,IAAI,SAAS,KAAK,gBAAgB,GAC7D,KAAK,mBAAmB,KAAA;CAE5B;;CAGA,IAAc,eAAwB;EACpC,OAAO;CACT;;CAGA,IAAc,OAAuB;EACnC,MAAM,OAAO,CACX;GACE,MAAM;GACN,OAAO,IAAI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B,eAAA,WAAA,CAAA,UAAU,GAIV,cAAc,gBAAgB,CAAA,GAAA,YAAA"}
@@ -11,7 +11,8 @@ export declare enum ObcAlertMenuItemStatus {
11
11
  Acknowledged = "acknowledged",
12
12
  NoAckAlarm = "no-ack-alarm",
13
13
  NoAckWarning = "no-ack-warning",
14
- Rectified = "rectified"
14
+ Rectified = "rectified",
15
+ RectifiedUnacknowledged = "rectified-unacknowledged"
15
16
  }
16
17
  /**
17
18
  * Appearance of an alert menu item action.
@@ -32,12 +33,13 @@ export declare enum ObcAlertMenuItemActionState {
32
33
  * ### Features
33
34
  * - **Status Variants:** Supports multiple alert states via the `status` property:
34
35
  * - **Unacknowledged:** Shows an action button (ACK) for user acknowledgment.
36
+ * - **RectifiedUnacknowledged:** The situation that raised the alert has cleared, but the alert still waits for acknowledgment, so the ACK action stays.
35
37
  * - **Caution, Acknowledged, Rectified:** Display different visual cues for alert progression.
36
38
  * - **NoAckAlarm / NoAckWarning:** Show special icons indicating unacknowledged alarms or warnings.
37
39
  * - **Icon Support:** Optional secondary icon (e.g., system or source) and a primary alert icon. Tertiary "shelved" icon appears if the alert is shelved.
38
40
  * - **Time and Day Display:** Optionally shows day and/or time for the alert occurrence.
39
41
  * - **Expandable:** Can be toggled open/closed for additional details (via click).
40
- * - **Action Buttons:** Displays an "ACK" button for unacknowledged alerts and an optional secondary action (label set via `secondaryActionLabel`); each triggers an event when clicked.
42
+ * - **Action Buttons:** Displays an "ACK" button for the statuses that still wait for acknowledgment (`unacknowledged` and `rectified-unacknowledged`) and an optional secondary action (label set via `secondaryActionLabel`); each triggers an event when clicked.
41
43
  * - Each action's appearance is controlled independently via `primaryActionState` / `secondaryActionState` (`enabled`, `disabled`, or `none`).
42
44
  * - **Animated Intro:** Optional animation when the item appears.
43
45
  * - **Size Options:** Supports single-line or multi-line layouts (see `size` property).
@@ -51,7 +53,9 @@ export declare enum ObcAlertMenuItemActionState {
51
53
  * - Only show the "ACK" action for alerts that require acknowledgment.
52
54
  * - Provide `secondaryActionLabel` to add a second action alongside ACK.
53
55
  * - Use `primaryActionState` / `secondaryActionState` to temporarily disable an action (`disabled`) or remove it without leaving a gap (`none`).
54
- * - Use the `shelved` property to indicate alerts that are temporarily deferred.
56
+ * - Use the `shelved` property to indicate alerts that are temporarily deferred, and `blocked` for alerts another system has set aside. The alert menus sort items into their tabs by `status` and `shelved`; `blocked` is there for menus that list blocked alerts apart.
57
+ *
58
+ * **TODO(designer):** Should a blocked alert show a marker, as a shelved one shows the shelf icon?
55
59
  *
56
60
  * ### Slots
57
61
  * | Slot Name | Renders When... | Purpose |
@@ -91,13 +95,16 @@ export declare enum ObcAlertMenuItemActionState {
91
95
  * When true, the `icon` slot is rendered.
92
96
  * @property shelved - Indicates if the alert is shelved (temporarily deferred).
93
97
  * When true, a tertiary icon is shown to represent the shelved state.
98
+ * @property blocked - Indicates that another system has blocked the alert as not relevant here.
99
+ * For menus that list blocked alerts apart; the item itself shows no marker for it yet.
94
100
  * @property title - The title of the alert.
95
101
  * @property description - The description of the alert.
96
102
  * @property day - The day label for the alert (e.g., "Yesterday").
97
103
  * @property time - The time label for the alert (e.g., "14:30").
98
104
  * @property status - The current status of the alert item.
99
105
  * Determines visual style, icon, and action button visibility.
100
- * Possible values: 'unacknowledged', 'caution', 'acknowledged', 'no-ack-alarm', 'no-ack-warning', 'rectified'.
106
+ * Possible values: 'unacknowledged', 'caution', 'acknowledged', 'no-ack-alarm', 'no-ack-warning', 'rectified', 'rectified-unacknowledged'.
107
+ * 'unacknowledged' and 'rectified-unacknowledged' show the ACK action; the other values show a trailing icon instead.
101
108
  * Default is 'unacknowledged'.
102
109
  * @property open - Whether the item is expanded/open to show additional details.
103
110
  * Toggled by clicking the item.
@@ -130,6 +137,8 @@ export declare class ObcAlertMenuItem extends LitElement {
130
137
  hasIcon: boolean;
131
138
  /** Indicates if the alert is shelved (temporarily deferred). When true, a tertiary icon is shown to represent the shelved state. */
132
139
  shelved: boolean;
140
+ /** Indicates that another system has blocked the alert as not relevant here. For menus that list blocked alerts apart; the item itself shows no marker for it yet. */
141
+ blocked: boolean;
133
142
  /** The title of the alert. */
134
143
  title: string;
135
144
  /** The description of the alert. */
@@ -138,7 +147,7 @@ export declare class ObcAlertMenuItem extends LitElement {
138
147
  day: string;
139
148
  /** The time label for the alert (e.g., "14:30"). */
140
149
  time: string;
141
- /** The current status of the alert item. Determines visual style, icon, and action button visibility. Possible values: 'unacknowledged', 'caution', 'acknowledged', 'no-ack-alarm', 'no-ack-warning', 'rectified'. Default is 'unacknowledged'. */
150
+ /** The current status of the alert item. Determines visual style, icon, and action button visibility. Possible values: 'unacknowledged', 'caution', 'acknowledged', 'no-ack-alarm', 'no-ack-warning', 'rectified', 'rectified-unacknowledged'. 'unacknowledged' and 'rectified-unacknowledged' show the ACK action; the other values show a trailing icon instead. Default is 'unacknowledged'. */
142
151
  status: ObcAlertMenuItemStatus;
143
152
  /** Whether the item is expanded/open to show additional details. Toggled by clicking the item. */
144
153
  open: boolean;
@@ -152,6 +161,7 @@ export declare class ObcAlertMenuItem extends LitElement {
152
161
  primaryActionState: ObcAlertMenuItemActionState;
153
162
  /** Appearance of the secondary action: `enabled`, `disabled` or `none`, which hides it. */
154
163
  secondaryActionState: ObcAlertMenuItemActionState;
164
+ private get canAck();
155
165
  private get primaryActionLabel();
156
166
  private get secondaryActionLabelToShow();
157
167
  private get primaryActionDisabled();
@@ -165,7 +175,7 @@ export declare class ObcAlertMenuItem extends LitElement {
165
175
  }
166
176
  declare global {
167
177
  interface HTMLElementTagNameMap {
168
- 'ob-alert-menu-item': ObcAlertMenuItem;
178
+ 'obc-alert-menu-item': ObcAlertMenuItem;
169
179
  }
170
180
  }
171
181
  //# sourceMappingURL=alert-menu-item.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert-menu-item.d.ts","sourceRoot":"","sources":["../../../src/components/alert-menu-item/alert-menu-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;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B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
1
+ {"version":3,"file":"alert-menu-item.d.ts","sourceRoot":"","sources":["../../../src/components/alert-menu-item/alert-menu-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAKzD,OAAO,2CAA2C,CAAC;AACnD,OAAO,6BAA6B,CAAC;AACrC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,EAAC,sBAAsB,EAAC,MAAM,2CAA2C,CAAC;AAGjF,oBAAY,sBAAsB;IAChC,cAAc,mBAAmB;IACjC,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,UAAU,iBAAiB;IAC3B,YAAY,mBAAmB;IAC/B,SAAS,cAAc;IACvB,uBAAuB,6BAA6B;CACrD;AAED;;;;;GAKG;AACH,oBAAY,2BAA2B;IACrC,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,IAAI,SAAS;CACd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0GG;AACH,qBACa,gBAAiB,SAAQ,UAAU;IACnB,OAAO,UAAS;IAED,OAAO,UAAS;IAEhB,OAAO,UAAS;IAEvB,KAAK,SAAM;IAEpB,WAAW,SAAM;IAEjB,GAAG,SAAM;IAET,IAAI,SAAM;IAEK,MAAM,yBACP;IAEb,IAAI,UAAS;IAEd,IAAI,EAAE,sBAAsB,CAClB;IAET,YAAY,UAAS;IAEtB,oBAAoB,SAAM;IAE1B,kBAAkB,EAAE,2BAA2B,CACnC;IAEZ,oBAAoB,EAAE,2BAA2B,CACxC;IAEnC,OAAO,KAAK,MAAM,GAKjB;IAED,OAAO,KAAK,kBAAkB,GAK7B;IAED,OAAO,KAAK,0BAA0B,GAKrC;IAED,OAAO,KAAK,qBAAqB,GAEhC;IAED,OAAO,KAAK,uBAAuB,GAElC;IAED,OAAO,KAAK,eAAe,GAG1B;IAED,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,0BAA0B;IAKzB,MAAM;IAoDf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,gBAAgB,CAAC;KACzC;CACF"}
@@ -17,6 +17,7 @@ var ObcAlertMenuItemStatus = /* @__PURE__ */ function(ObcAlertMenuItemStatus) {
17
17
  ObcAlertMenuItemStatus["NoAckAlarm"] = "no-ack-alarm";
18
18
  ObcAlertMenuItemStatus["NoAckWarning"] = "no-ack-warning";
19
19
  ObcAlertMenuItemStatus["Rectified"] = "rectified";
20
+ ObcAlertMenuItemStatus["RectifiedUnacknowledged"] = "rectified-unacknowledged";
20
21
  return ObcAlertMenuItemStatus;
21
22
  }({});
22
23
  /**
@@ -36,6 +37,7 @@ var ObcAlertMenuItem = class ObcAlertMenuItem extends LitElement {
36
37
  super(..._args);
37
38
  this.hasIcon = false;
38
39
  this.shelved = false;
40
+ this.blocked = false;
39
41
  this.title = "";
40
42
  this.description = "";
41
43
  this.day = "";
@@ -48,9 +50,12 @@ var ObcAlertMenuItem = class ObcAlertMenuItem extends LitElement {
48
50
  this.primaryActionState = "enabled";
49
51
  this.secondaryActionState = "none";
50
52
  }
53
+ get canAck() {
54
+ return this.status === "unacknowledged" || this.status === "rectified-unacknowledged";
55
+ }
51
56
  get primaryActionLabel() {
52
57
  if (this.primaryActionState === "none") return "";
53
- return this.status === "unacknowledged" ? "ACK" : "";
58
+ return this.canAck ? "ACK" : "";
54
59
  }
55
60
  get secondaryActionLabelToShow() {
56
61
  if (this.secondaryActionState === "none") return "";
@@ -63,7 +68,7 @@ var ObcAlertMenuItem = class ObcAlertMenuItem extends LitElement {
63
68
  return this.secondaryActionState === "disabled";
64
69
  }
65
70
  get hasTrailingIcon() {
66
- return this.status !== "unacknowledged";
71
+ return !this.canAck;
67
72
  }
68
73
  handleMessageClick(event) {
69
74
  event.stopPropagation();
@@ -123,6 +128,10 @@ __decorate([property({
123
128
  type: Boolean,
124
129
  reflect: true
125
130
  })], ObcAlertMenuItem.prototype, "shelved", void 0);
131
+ __decorate([property({
132
+ type: Boolean,
133
+ reflect: true
134
+ })], ObcAlertMenuItem.prototype, "blocked", void 0);
126
135
  __decorate([property({ type: String })], ObcAlertMenuItem.prototype, "title", void 0);
127
136
  __decorate([property({ type: String })], ObcAlertMenuItem.prototype, "description", void 0);
128
137
  __decorate([property({ type: String })], ObcAlertMenuItem.prototype, "day", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"alert-menu-item.js","names":[],"sources":["../../../src/components/alert-menu-item/alert-menu-item.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {choose} from 'lit/directives/choose.js';\n\nimport compentStyle from './alert-menu-item.css?inline';\nimport '../message-menu-item/message-menu-item.js';\nimport '../alert-icon/alert-icon.js';\nimport '../../icons/icon-alerts-shelf.js';\nimport '../../icons/icon-alarm-noack-iec.js';\nimport '../../icons/icon-warning-noack-iec.js';\nimport {ObcMessageMenuItemSize} from '../message-menu-item/message-menu-item.js';\nimport {customElement} from '../../decorator.js';\n\nexport enum ObcAlertMenuItemStatus {\n Unacknowledged = 'unacknowledged',\n Caution = 'caution',\n Acknowledged = 'acknowledged',\n NoAckAlarm = 'no-ack-alarm',\n NoAckWarning = 'no-ack-warning',\n Rectified = 'rectified',\n}\n\n/**\n * Appearance of an alert menu item action.\n * - `enabled`: Action is shown and interactive (default).\n * - `disabled`: Action is shown but cannot be triggered.\n * - `none`: Action is removed and takes no space.\n */\nexport enum ObcAlertMenuItemActionState {\n Enabled = 'enabled',\n Disabled = 'disabled',\n None = 'none',\n}\n\n/**\n * `<obc-alert-menu-item>` – A list item component for displaying alert or notification entries with status, icons, and action controls.\n *\n * Presents a concise summary of an alert or message, including status, title, description, and optional icons. Designed for use in alert menus, notification drawers, or similar lists where users need to review and acknowledge alerts efficiently.\n *\n * ### Features\n * - **Status Variants:** Supports multiple alert states via the `status` property:\n * - **Unacknowledged:** Shows an action button (ACK) for user acknowledgment.\n * - **Caution, Acknowledged, Rectified:** Display different visual cues for alert progression.\n * - **NoAckAlarm / NoAckWarning:** Show special icons indicating unacknowledged alarms or warnings.\n * - **Icon Support:** Optional secondary icon (e.g., system or source) and a primary alert icon. Tertiary \"shelved\" icon appears if the alert is shelved.\n * - **Time and Day Display:** Optionally shows day and/or time for the alert occurrence.\n * - **Expandable:** Can be toggled open/closed for additional details (via click).\n * - **Action Buttons:** Displays an \"ACK\" button for unacknowledged alerts and an optional secondary action (label set via `secondaryActionLabel`); each triggers an event when clicked.\n * - Each action's appearance is controlled independently via `primaryActionState` / `secondaryActionState` (`enabled`, `disabled`, or `none`).\n * - **Animated Intro:** Optional animation when the item appears.\n * - **Size Options:** Supports single-line or multi-line layouts (see `size` property).\n *\n * ### Usage Guidelines\n * Use `obc-alert-menu-item` to represent individual alerts or notifications in a menu, list, or notification center. Ideal for scenarios where users need to quickly scan, identify, and acknowledge alerts. The component is best suited for transient or actionable notifications rather than persistent banners.\n *\n * - Use the `status` property to reflect the current state of the alert.\n * - Provide a relevant icon in the `alert-icon` slot to visually indicate the alert type.\n * - Use the `icon` slot for a source/system icon if needed.\n * - Only show the \"ACK\" action for alerts that require acknowledgment.\n * - Provide `secondaryActionLabel` to add a second action alongside ACK.\n * - Use `primaryActionState` / `secondaryActionState` to temporarily disable an action (`disabled`) or remove it without leaving a gap (`none`).\n * - Use the `shelved` property to indicate alerts that are temporarily deferred.\n *\n * ### Slots\n * | Slot Name | Renders When... | Purpose |\n * |---------------|-------------------------------|------------------------------------------------------|\n * | alert-icon | Always | Main alert icon representing the alert type. |\n * | title | Always | Title content; falls back to the `title` property. |\n * | description | Always | Description content; falls back to the `description` property. |\n * | icon | If `hasIcon` is true | Secondary icon (e.g., system/source of alert). |\n *\n * ### Events\n * - **ack-click** – Fired when the ACK action button is clicked.\n * - **ack-secondary-click** – Fired when the secondary action button is clicked.\n * - **item-click** – Fired when the alert menu item is clicked (toggles open/closed).\n *\n * ### Best Practices\n * - Only display the ACK action for alerts that require acknowledgment.\n * - Use concise titles and descriptions for quick scanning.\n * - For grouped alerts, ensure each item has a unique status and icon as appropriate.\n * - Avoid overloading with too many icons; use secondary and tertiary icons only when necessary.\n * - Follow standard notification design guidelines: keep actionable items prominent, and use color/iconography to indicate severity or status.\n *\n * **Example:**\n * ```\n * <obc-alert-menu-item\n * status=\"unacknowledged\"\n * title=\"Engine Temperature High\"\n * description=\"Port main engine temperature exceeds normal operating range\"\n * time=\"14:30\"\n * hasIcon\n * >\n * <obc-alert-icon slot=\"alert-icon\" type=\"alarm\" active></obc-alert-icon>\n * <obi-engine slot=\"icon\"></obi-engine>\n * </obc-alert-menu-item>\n * ```\n *\n * @property hasIcon - Whether to display a secondary icon (e.g., system/source) in the item.\n * When true, the `icon` slot is rendered.\n * @property shelved - Indicates if the alert is shelved (temporarily deferred).\n * When true, a tertiary icon is shown to represent the shelved state.\n * @property title - The title of the alert.\n * @property description - The description of the alert.\n * @property day - The day label for the alert (e.g., \"Yesterday\").\n * @property time - The time label for the alert (e.g., \"14:30\").\n * @property status - The current status of the alert item.\n * Determines visual style, icon, and action button visibility.\n * Possible values: 'unacknowledged', 'caution', 'acknowledged', 'no-ack-alarm', 'no-ack-warning', 'rectified'.\n * Default is 'unacknowledged'.\n * @property open - Whether the item is expanded/open to show additional details.\n * Toggled by clicking the item.\n * @property size - Layout size of the menu item.\n * Controls whether content is single-line or multi-line.\n * Possible values: 'single-line', 'multi-line'.\n * Default is 'single-line'.\n * @property animateIntro - Whether to animate the item's appearance (intro animation).\n * @property secondaryActionLabel - The label for the secondary action button.\n * Unlike the primary (ACK) action, the secondary label is not derived from\n * `status`; it must be provided explicitly. The secondary action is only\n * shown when a non-empty label is set and `secondaryActionState` is not\n * `none`.\n * @property primaryActionState - Appearance of the primary (ACK) action: `enabled`, `disabled` or `none`,\n * which hides it.\n * @property secondaryActionState - Appearance of the secondary action: `enabled`, `disabled` or `none`, which\n * hides it.\n * @slot alert-icon - The main alert icon representing the alert type.\n * @slot title - Title content; falls back to the `title` property when empty.\n * @slot description - Description content; falls back to the `description` property when empty.\n * @slot icon - Optional secondary icon (e.g., source/system).\n *\n * @fires {CustomEvent<void>} ack-click - Fired when the ACK action button is clicked.\n * @fires {CustomEvent<void>} ack-secondary-click - Fired when the secondary action button is clicked.\n * @fires {CustomEvent<void>} item-click - Fired when the alert menu item is clicked.\n * @stable\n */\n@customElement('obc-alert-menu-item')\nexport class ObcAlertMenuItem extends LitElement {\n @property({type: Boolean}) hasIcon = false;\n\n @property({type: Boolean, reflect: true}) shelved = false;\n\n @property({type: String}) override title = '';\n\n @property({type: String}) description = '';\n\n @property({type: String}) day = '';\n\n @property({type: String}) time = '';\n\n @property({type: String, reflect: true}) status =\n ObcAlertMenuItemStatus.Unacknowledged;\n\n @property({type: Boolean}) open = false;\n\n @property({type: String}) size: ObcMessageMenuItemSize =\n ObcMessageMenuItemSize.SingleLine;\n\n @property({type: Boolean}) animateIntro = false;\n\n @property({type: String}) secondaryActionLabel = '';\n\n @property({type: String}) primaryActionState: ObcAlertMenuItemActionState =\n ObcAlertMenuItemActionState.Enabled;\n\n @property({type: String}) secondaryActionState: ObcAlertMenuItemActionState =\n ObcAlertMenuItemActionState.None;\n\n private get primaryActionLabel() {\n if (this.primaryActionState === ObcAlertMenuItemActionState.None) {\n return '';\n }\n return this.status === ObcAlertMenuItemStatus.Unacknowledged ? 'ACK' : '';\n }\n\n private get secondaryActionLabelToShow() {\n if (this.secondaryActionState === ObcAlertMenuItemActionState.None) {\n return '';\n }\n return this.secondaryActionLabel;\n }\n\n private get primaryActionDisabled() {\n return this.primaryActionState === ObcAlertMenuItemActionState.Disabled;\n }\n\n private get secondaryActionDisabled() {\n return this.secondaryActionState === ObcAlertMenuItemActionState.Disabled;\n }\n\n private get hasTrailingIcon() {\n // True when we need the action container but don't have an ACK button\n return this.status !== ObcAlertMenuItemStatus.Unacknowledged;\n }\n\n private handleMessageClick(event: Event) {\n event.stopPropagation();\n this.dispatchEvent(new CustomEvent('item-click'));\n this.open = !this.open;\n }\n\n private handleActionClick(event: Event) {\n event.stopPropagation();\n this.dispatchEvent(new CustomEvent('ack-click'));\n }\n\n private handleSecondaryActionClick(event: Event) {\n event.stopPropagation();\n this.dispatchEvent(new CustomEvent('ack-secondary-click'));\n }\n\n override render() {\n return html`\n <obc-message-menu-item\n .title=${this.title}\n .description=${this.description}\n .day=${this.day}\n .time=${this.time}\n .primaryActionLabel=${this.primaryActionLabel}\n .secondaryActionLabel=${this.secondaryActionLabelToShow}\n .enablePrimaryAction=${!this.primaryActionDisabled}\n .enableSecondaryAction=${!this.secondaryActionDisabled}\n .size=${this.size}\n .open=${this.open}\n .hasSecondaryIcon=${this.hasIcon}\n .isShelved=${this.shelved}\n .hasTrailingIcon=${this.hasTrailingIcon}\n enhancedIcon\n hasPrimaryIcon\n @message-click=${this.handleMessageClick}\n @primary-action-click=${this.handleActionClick}\n @secondary-action-click=${this.handleSecondaryActionClick}\n >\n <slot name=\"alert-icon\" slot=\"primary-icon\"></slot>\n <slot name=\"title\" slot=\"title\">${this.title}</slot>\n <slot name=\"description\" slot=\"description\">${this.description}</slot>\n ${\n this.hasIcon\n ? html`<slot name=\"icon\" slot=\"secondary-icon\"></slot>`\n : nothing\n }\n ${choose(this.status, [\n [\n ObcAlertMenuItemStatus.NoAckAlarm,\n () =>\n html`<obi-alarm-noack-iec\n slot=\"trailing-icon\"\n useCssColor\n ></obi-alarm-noack-iec>`,\n ],\n [\n ObcAlertMenuItemStatus.NoAckWarning,\n () =>\n html`<obi-warning-noack-iec\n slot=\"trailing-icon\"\n useCssColor\n ></obi-warning-noack-iec>`,\n ],\n ])}\n </obc-message-menu-item>\n `;\n }\n\n static override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,WAAA,CAAA,SAAS;CAAC,MAAM;CAAQ,SAAS;AAAI,CAAC,CAAA,GAAA,iBAAA,WAAA,UAAA,KAAA,CAAA;AAGtC,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,iBAAA,WAAA,QAAA,KAAA,CAAA;AAExB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,QAAA,KAAA,CAAA;AAGvB,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,iBAAA,WAAA,gBAAA,KAAA,CAAA;AAExB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,wBAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,sBAAA,KAAA,CAAA;AAGvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,wBAAA,KAAA,CAAA;AA7BzB,mBAAA,WAAA,CAAA,cAAc,qBAAqB,CAAA,GAAA,gBAAA"}
1
+ {"version":3,"file":"alert-menu-item.js","names":[],"sources":["../../../src/components/alert-menu-item/alert-menu-item.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {choose} from 'lit/directives/choose.js';\n\nimport compentStyle from './alert-menu-item.css?inline';\nimport '../message-menu-item/message-menu-item.js';\nimport '../alert-icon/alert-icon.js';\nimport '../../icons/icon-alerts-shelf.js';\nimport '../../icons/icon-alarm-noack-iec.js';\nimport '../../icons/icon-warning-noack-iec.js';\nimport {ObcMessageMenuItemSize} from '../message-menu-item/message-menu-item.js';\nimport {customElement} from '../../decorator.js';\n\nexport enum ObcAlertMenuItemStatus {\n Unacknowledged = 'unacknowledged',\n Caution = 'caution',\n Acknowledged = 'acknowledged',\n NoAckAlarm = 'no-ack-alarm',\n NoAckWarning = 'no-ack-warning',\n Rectified = 'rectified',\n RectifiedUnacknowledged = 'rectified-unacknowledged',\n}\n\n/**\n * Appearance of an alert menu item action.\n * - `enabled`: Action is shown and interactive (default).\n * - `disabled`: Action is shown but cannot be triggered.\n * - `none`: Action is removed and takes no space.\n */\nexport enum ObcAlertMenuItemActionState {\n Enabled = 'enabled',\n Disabled = 'disabled',\n None = 'none',\n}\n\n/**\n * `<obc-alert-menu-item>` – A list item component for displaying alert or notification entries with status, icons, and action controls.\n *\n * Presents a concise summary of an alert or message, including status, title, description, and optional icons. Designed for use in alert menus, notification drawers, or similar lists where users need to review and acknowledge alerts efficiently.\n *\n * ### Features\n * - **Status Variants:** Supports multiple alert states via the `status` property:\n * - **Unacknowledged:** Shows an action button (ACK) for user acknowledgment.\n * - **RectifiedUnacknowledged:** The situation that raised the alert has cleared, but the alert still waits for acknowledgment, so the ACK action stays.\n * - **Caution, Acknowledged, Rectified:** Display different visual cues for alert progression.\n * - **NoAckAlarm / NoAckWarning:** Show special icons indicating unacknowledged alarms or warnings.\n * - **Icon Support:** Optional secondary icon (e.g., system or source) and a primary alert icon. Tertiary \"shelved\" icon appears if the alert is shelved.\n * - **Time and Day Display:** Optionally shows day and/or time for the alert occurrence.\n * - **Expandable:** Can be toggled open/closed for additional details (via click).\n * - **Action Buttons:** Displays an \"ACK\" button for the statuses that still wait for acknowledgment (`unacknowledged` and `rectified-unacknowledged`) and an optional secondary action (label set via `secondaryActionLabel`); each triggers an event when clicked.\n * - Each action's appearance is controlled independently via `primaryActionState` / `secondaryActionState` (`enabled`, `disabled`, or `none`).\n * - **Animated Intro:** Optional animation when the item appears.\n * - **Size Options:** Supports single-line or multi-line layouts (see `size` property).\n *\n * ### Usage Guidelines\n * Use `obc-alert-menu-item` to represent individual alerts or notifications in a menu, list, or notification center. Ideal for scenarios where users need to quickly scan, identify, and acknowledge alerts. The component is best suited for transient or actionable notifications rather than persistent banners.\n *\n * - Use the `status` property to reflect the current state of the alert.\n * - Provide a relevant icon in the `alert-icon` slot to visually indicate the alert type.\n * - Use the `icon` slot for a source/system icon if needed.\n * - Only show the \"ACK\" action for alerts that require acknowledgment.\n * - Provide `secondaryActionLabel` to add a second action alongside ACK.\n * - Use `primaryActionState` / `secondaryActionState` to temporarily disable an action (`disabled`) or remove it without leaving a gap (`none`).\n * - Use the `shelved` property to indicate alerts that are temporarily deferred, and `blocked` for alerts another system has set aside. The alert menus sort items into their tabs by `status` and `shelved`; `blocked` is there for menus that list blocked alerts apart.\n *\n * **TODO(designer):** Should a blocked alert show a marker, as a shelved one shows the shelf icon?\n *\n * ### Slots\n * | Slot Name | Renders When... | Purpose |\n * |---------------|-------------------------------|------------------------------------------------------|\n * | alert-icon | Always | Main alert icon representing the alert type. |\n * | title | Always | Title content; falls back to the `title` property. |\n * | description | Always | Description content; falls back to the `description` property. |\n * | icon | If `hasIcon` is true | Secondary icon (e.g., system/source of alert). |\n *\n * ### Events\n * - **ack-click** – Fired when the ACK action button is clicked.\n * - **ack-secondary-click** – Fired when the secondary action button is clicked.\n * - **item-click** – Fired when the alert menu item is clicked (toggles open/closed).\n *\n * ### Best Practices\n * - Only display the ACK action for alerts that require acknowledgment.\n * - Use concise titles and descriptions for quick scanning.\n * - For grouped alerts, ensure each item has a unique status and icon as appropriate.\n * - Avoid overloading with too many icons; use secondary and tertiary icons only when necessary.\n * - Follow standard notification design guidelines: keep actionable items prominent, and use color/iconography to indicate severity or status.\n *\n * **Example:**\n * ```\n * <obc-alert-menu-item\n * status=\"unacknowledged\"\n * title=\"Engine Temperature High\"\n * description=\"Port main engine temperature exceeds normal operating range\"\n * time=\"14:30\"\n * hasIcon\n * >\n * <obc-alert-icon slot=\"alert-icon\" type=\"alarm\" active></obc-alert-icon>\n * <obi-engine slot=\"icon\"></obi-engine>\n * </obc-alert-menu-item>\n * ```\n *\n * @property hasIcon - Whether to display a secondary icon (e.g., system/source) in the item.\n * When true, the `icon` slot is rendered.\n * @property shelved - Indicates if the alert is shelved (temporarily deferred).\n * When true, a tertiary icon is shown to represent the shelved state.\n * @property blocked - Indicates that another system has blocked the alert as not relevant here.\n * For menus that list blocked alerts apart; the item itself shows no marker for it yet.\n * @property title - The title of the alert.\n * @property description - The description of the alert.\n * @property day - The day label for the alert (e.g., \"Yesterday\").\n * @property time - The time label for the alert (e.g., \"14:30\").\n * @property status - The current status of the alert item.\n * Determines visual style, icon, and action button visibility.\n * Possible values: 'unacknowledged', 'caution', 'acknowledged', 'no-ack-alarm', 'no-ack-warning', 'rectified', 'rectified-unacknowledged'.\n * 'unacknowledged' and 'rectified-unacknowledged' show the ACK action; the other values show a trailing icon instead.\n * Default is 'unacknowledged'.\n * @property open - Whether the item is expanded/open to show additional details.\n * Toggled by clicking the item.\n * @property size - Layout size of the menu item.\n * Controls whether content is single-line or multi-line.\n * Possible values: 'single-line', 'multi-line'.\n * Default is 'single-line'.\n * @property animateIntro - Whether to animate the item's appearance (intro animation).\n * @property secondaryActionLabel - The label for the secondary action button.\n * Unlike the primary (ACK) action, the secondary label is not derived from\n * `status`; it must be provided explicitly. The secondary action is only\n * shown when a non-empty label is set and `secondaryActionState` is not\n * `none`.\n * @property primaryActionState - Appearance of the primary (ACK) action: `enabled`, `disabled` or `none`,\n * which hides it.\n * @property secondaryActionState - Appearance of the secondary action: `enabled`, `disabled` or `none`, which\n * hides it.\n * @slot alert-icon - The main alert icon representing the alert type.\n * @slot title - Title content; falls back to the `title` property when empty.\n * @slot description - Description content; falls back to the `description` property when empty.\n * @slot icon - Optional secondary icon (e.g., source/system).\n *\n * @fires {CustomEvent<void>} ack-click - Fired when the ACK action button is clicked.\n * @fires {CustomEvent<void>} ack-secondary-click - Fired when the secondary action button is clicked.\n * @fires {CustomEvent<void>} item-click - Fired when the alert menu item is clicked.\n * @stable\n */\n@customElement('obc-alert-menu-item')\nexport class ObcAlertMenuItem extends LitElement {\n @property({type: Boolean}) hasIcon = false;\n\n @property({type: Boolean, reflect: true}) shelved = false;\n\n @property({type: Boolean, reflect: true}) blocked = false;\n\n @property({type: String}) override title = '';\n\n @property({type: String}) description = '';\n\n @property({type: String}) day = '';\n\n @property({type: String}) time = '';\n\n @property({type: String, reflect: true}) status =\n ObcAlertMenuItemStatus.Unacknowledged;\n\n @property({type: Boolean}) open = false;\n\n @property({type: String}) size: ObcMessageMenuItemSize =\n ObcMessageMenuItemSize.SingleLine;\n\n @property({type: Boolean}) animateIntro = false;\n\n @property({type: String}) secondaryActionLabel = '';\n\n @property({type: String}) primaryActionState: ObcAlertMenuItemActionState =\n ObcAlertMenuItemActionState.Enabled;\n\n @property({type: String}) secondaryActionState: ObcAlertMenuItemActionState =\n ObcAlertMenuItemActionState.None;\n\n private get canAck() {\n return (\n this.status === ObcAlertMenuItemStatus.Unacknowledged ||\n this.status === ObcAlertMenuItemStatus.RectifiedUnacknowledged\n );\n }\n\n private get primaryActionLabel() {\n if (this.primaryActionState === ObcAlertMenuItemActionState.None) {\n return '';\n }\n return this.canAck ? 'ACK' : '';\n }\n\n private get secondaryActionLabelToShow() {\n if (this.secondaryActionState === ObcAlertMenuItemActionState.None) {\n return '';\n }\n return this.secondaryActionLabel;\n }\n\n private get primaryActionDisabled() {\n return this.primaryActionState === ObcAlertMenuItemActionState.Disabled;\n }\n\n private get secondaryActionDisabled() {\n return this.secondaryActionState === ObcAlertMenuItemActionState.Disabled;\n }\n\n private get hasTrailingIcon() {\n // True when we need the action container but don't have an ACK button\n return !this.canAck;\n }\n\n private handleMessageClick(event: Event) {\n event.stopPropagation();\n this.dispatchEvent(new CustomEvent('item-click'));\n this.open = !this.open;\n }\n\n private handleActionClick(event: Event) {\n event.stopPropagation();\n this.dispatchEvent(new CustomEvent('ack-click'));\n }\n\n private handleSecondaryActionClick(event: Event) {\n event.stopPropagation();\n this.dispatchEvent(new CustomEvent('ack-secondary-click'));\n }\n\n override render() {\n return html`\n <obc-message-menu-item\n .title=${this.title}\n .description=${this.description}\n .day=${this.day}\n .time=${this.time}\n .primaryActionLabel=${this.primaryActionLabel}\n .secondaryActionLabel=${this.secondaryActionLabelToShow}\n .enablePrimaryAction=${!this.primaryActionDisabled}\n .enableSecondaryAction=${!this.secondaryActionDisabled}\n .size=${this.size}\n .open=${this.open}\n .hasSecondaryIcon=${this.hasIcon}\n .isShelved=${this.shelved}\n .hasTrailingIcon=${this.hasTrailingIcon}\n enhancedIcon\n hasPrimaryIcon\n @message-click=${this.handleMessageClick}\n @primary-action-click=${this.handleActionClick}\n @secondary-action-click=${this.handleSecondaryActionClick}\n >\n <slot name=\"alert-icon\" slot=\"primary-icon\"></slot>\n <slot name=\"title\" slot=\"title\">${this.title}</slot>\n <slot name=\"description\" slot=\"description\">${this.description}</slot>\n ${\n this.hasIcon\n ? html`<slot name=\"icon\" slot=\"secondary-icon\"></slot>`\n : nothing\n }\n ${choose(this.status, [\n [\n ObcAlertMenuItemStatus.NoAckAlarm,\n () =>\n html`<obi-alarm-noack-iec\n slot=\"trailing-icon\"\n useCssColor\n ></obi-alarm-noack-iec>`,\n ],\n [\n ObcAlertMenuItemStatus.NoAckWarning,\n () =>\n html`<obi-warning-noack-iec\n slot=\"trailing-icon\"\n useCssColor\n ></obi-warning-noack-iec>`,\n ],\n ])}\n </obc-message-menu-item>\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-menu-item': ObcAlertMenuItem;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAaA,IAAY,yBAAL,yBAAA,wBAAA;CACL,uBAAA,oBAAA;CACA,uBAAA,aAAA;CACA,uBAAA,kBAAA;CACA,uBAAA,gBAAA;CACA,uBAAA,kBAAA;CACA,uBAAA,eAAA;CACA,uBAAA,6BAAA;;AACF,EAAA,CAAA,CAAA;;;;;;;AAQA,IAAY,8BAAL,yBAAA,6BAAA;CACL,4BAAA,aAAA;CACA,4BAAA,cAAA;CACA,4BAAA,UAAA;;AACF,EAAA,CAAA,CAAA;AA8GO,IAAM,mBAAN,MAAM,yBAAyB,WAAW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KAAA,CAAA;AAGvB,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,iBAAA,WAAA,gBAAA,KAAA,CAAA;AAExB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,wBAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,sBAAA,KAAA,CAAA;AAGvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,wBAAA,KAAA,CAAA;AA/BzB,mBAAA,WAAA,CAAA,cAAc,qBAAqB,CAAA,GAAA,gBAAA"}
@@ -419,12 +419,18 @@ var number_input_field_default = css`* {
419
419
  }
420
420
 
421
421
  .wrapper.align-center .value-input {
422
- width: var(--obc-number-input-center-width, auto);
423
- min-width: var(--obc-number-input-center-width, 40px);
422
+ field-sizing: content; /* the unit hugs the value */
423
+ width: auto;
424
424
  text-align: right;
425
425
  flex: 0 0 auto;
426
426
  }
427
427
 
428
+ @supports not (field-sizing: content) {
429
+ .wrapper.align-center .value-input {
430
+ flex: 1 1 auto; /* the 20-character default width would push the value out of a narrow field */
431
+ }
432
+ }
433
+
428
434
  .wrapper.align-right .label-container,
429
435
  .wrapper.align-right-unit-outside .label-container {
430
436
  justify-content: flex-end;
@@ -1 +1 @@
1
- {"version":3,"file":"number-input-field.css.js","names":[],"sources":["../../../src/components/number-input-field/number-input-field.css?inline"],"sourcesContent":["* {\n box-sizing: border-box;\n user-select: text;\n}\n\n.wrapper {\n @mixin base-input-field-wrapper;\n @mixin base-input-field-sizes;\n\n &.error .unit-text {\n color: var(--element-neutral-color);\n }\n}\n\n/* Shared base styles */\n@mixin base-input-field-all;\n\n.wrapper.align-center .label-container,\n.wrapper.wrapper.align-right .label-container {\n align-items: baseline;\n}\n\n/* Number input specific: text alignment */\n.value-input {\n text-align: right;\n}\n\n.squared .input-field-container {\n border-radius: 0;\n}\n\n/* Unit */\n.unit-text {\n @mixin font-instrument-unit;\n color: var(--element-inactive-color);\n white-space: nowrap;\n height: var(--global-typography-instrument-unit-line-height);\n user-select: none;\n\n &.external {\n padding-left: var(\n --ui-components-input-fields-number-input-field-unit-container-padding-left\n );\n }\n}\n\n.wrapper.align-center .label-container:focus-within .unit-text {\n color: var(--element-neutral-color);\n}\n\n/* Alignment variants */\n.wrapper.align-center .label-container {\n justify-content: center;\n}\n\n.wrapper .value-input {\n text-align: right;\n padding: 0;\n}\n\n.wrapper.align-center .value-input {\n width: var(--obc-number-input-center-width, auto);\n min-width: var(--obc-number-input-center-width, 40px);\n text-align: right;\n flex: 0 0 auto;\n}\n\n.wrapper.align-right .label-container,\n.wrapper.align-right-unit-outside .label-container {\n justify-content: flex-end;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"number-input-field.css.js","names":[],"sources":["../../../src/components/number-input-field/number-input-field.css?inline"],"sourcesContent":["* {\n box-sizing: border-box;\n user-select: text;\n}\n\n.wrapper {\n @mixin base-input-field-wrapper;\n @mixin base-input-field-sizes;\n\n &.error .unit-text {\n color: var(--element-neutral-color);\n }\n}\n\n/* Shared base styles */\n@mixin base-input-field-all;\n\n.wrapper.align-center .label-container,\n.wrapper.wrapper.align-right .label-container {\n align-items: baseline;\n}\n\n/* Number input specific: text alignment */\n.value-input {\n text-align: right;\n}\n\n.squared .input-field-container {\n border-radius: 0;\n}\n\n/* Unit */\n.unit-text {\n @mixin font-instrument-unit;\n color: var(--element-inactive-color);\n white-space: nowrap;\n height: var(--global-typography-instrument-unit-line-height);\n user-select: none;\n\n &.external {\n padding-left: var(\n --ui-components-input-fields-number-input-field-unit-container-padding-left\n );\n }\n}\n\n.wrapper.align-center .label-container:focus-within .unit-text {\n color: var(--element-neutral-color);\n}\n\n/* Alignment variants */\n.wrapper.align-center .label-container {\n justify-content: center;\n}\n\n.wrapper .value-input {\n text-align: right;\n padding: 0;\n}\n\n.wrapper.align-center .value-input {\n field-sizing: content; /* the unit hugs the value */\n width: auto;\n text-align: right;\n flex: 0 0 auto;\n}\n\n@supports not (field-sizing: content) {\n .wrapper.align-center .value-input {\n flex: 1 1 auto; /* the 20-character default width would push the value out of a narrow field */\n }\n}\n\n.wrapper.align-right .label-container,\n.wrapper.align-right-unit-outside .label-container {\n justify-content: flex-end;\n}\n"],"mappings":""}
@@ -98,6 +98,7 @@ export declare class ObcNumberInputField extends LitElement {
98
98
  private previousValue;
99
99
  private previousDisplayText;
100
100
  private lastCommittedValue;
101
+ private focusFromValueClick;
101
102
  private inputElement?;
102
103
  get displayValue(): string;
103
104
  private getFormatOptions;
@@ -106,18 +107,31 @@ export declare class ObcNumberInputField extends LitElement {
106
107
  private isProjectedValueAllowed;
107
108
  private onBeforeInput;
108
109
  private onFocus;
110
+ /**
111
+ * Ungroups a value the user clicked into, once the browser has placed the
112
+ * caret, and moves the caret with its digits. Ungrouping before that shifts
113
+ * the text under the pointer and the caret lands beside the clicked digit.
114
+ */
115
+ private ungroupKeepingSelection;
116
+ private ungroupDisplay;
109
117
  private onBlur;
110
118
  private commitDisplay;
111
119
  private dispatchInput;
112
120
  private dispatchChange;
113
121
  private get shouldUpdateValue();
114
122
  private getEffectiveDisplay;
115
- private updateCenterAlignedInputWidth;
116
123
  firstUpdated(): void;
117
124
  private get isEmpty();
118
125
  willUpdate(changedProperties: PropertyValues): void;
119
126
  updated(): void;
120
127
  private renderFooterText;
128
+ /**
129
+ * Keeps focus where it is while the chrome around the value is clicked.
130
+ * The wrapper is a `<label>`, so the click itself focuses the input; without
131
+ * this the pointerdown would blur it first and commit an unfinished edit.
132
+ * A click on the value itself is the browser's; it is only noted, so the
133
+ * focus it causes ungroups the value without moving the caret.
134
+ */
121
135
  private onPointerDown;
122
136
  render(): TemplateResult<1>;
123
137
  static styles: import('lit').CSSResult;
@@ -1 +1 @@
1
- {"version":3,"file":"number-input-field.d.ts","sourceRoot":"","sources":["../../../src/components/number-input-field/number-input-field.ts"],"names":[],"mapp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B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEvC,iBAAiB,SAAM;IAExC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,WAAW,CAAM;IACzB,OAAO,CAAC,aAAa,CAAO;IAC5B,OAAO,CAAC,mBAAmB,CAAM;IACjC,OAAO,CAAC,kBAAkB,CAAO;IAEnB,OAAO,CAAC,YAAY,CAAC,CAAmB;IAE/D,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,OAAO;IAYf,OAAO,CAAC,uBAAuB;IAiB/B,OAAO,CAAC,aAAa;IAoBrB,OAAO,CAAC,OAAO;IAaf,OAAO,CAAC,MAAM;IAUd,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,cAAc;IAQtB,OAAO,KAAK,iBAAiB,GAU5B;IAED,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,6BAA6B;IA6B5B,YAAY;IAQrB,OAAO,KAAK,OAAO,GAKlB;IAEQ,UAAU,CAAC,iBAAiB,EAAE,cAAc;IA2B5C,OAAO;IAYhB,OAAO,CAAC,gBAAgB;IAuBxB,OAAO,CAAC,aAAa;IAyCZ,MAAM;IA4Gf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,wBAAwB,EAAE,mBAAmB,CAAC;KAC/C;CACF"}
1
+ {"version":3,"file":"number-input-field.d.ts","sourceRoot":"","sources":["../../../src/components/number-input-field/number-input-field.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAIV,cAAc,EACd,cAAc,EACf,MAAM,KAAK,CAAC;AAeb,MAAM,MAAM,6BAA6B,GAAG,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC;AACzE,MAAM,MAAM,8BAA8B,GAAG,WAAW,CA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