@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.148 → 2.0.0-next.150

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 (57) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +4561 -3882
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +535 -21
  4. package/dist/components/alert-list-details-experimental/alert-list-details-experimental.css.js +94 -0
  5. package/dist/components/alert-list-details-experimental/alert-list-details-experimental.css.js.map +1 -0
  6. package/dist/components/alert-list-details-experimental/alert-list-details-experimental.d.ts +72 -0
  7. package/dist/components/alert-list-details-experimental/alert-list-details-experimental.d.ts.map +1 -0
  8. package/dist/components/alert-list-details-experimental/alert-list-details-experimental.js +396 -0
  9. package/dist/components/alert-list-details-experimental/alert-list-details-experimental.js.map +1 -0
  10. package/dist/components/icon-button/icon-button.d.ts +3 -0
  11. package/dist/components/icon-button/icon-button.d.ts.map +1 -1
  12. package/dist/components/icon-button/icon-button.js +6 -0
  13. package/dist/components/icon-button/icon-button.js.map +1 -1
  14. package/dist/components/table/table.css.js +43 -0
  15. package/dist/components/table/table.css.js.map +1 -1
  16. package/dist/components/table/table.d.ts +31 -1
  17. package/dist/components/table/table.d.ts.map +1 -1
  18. package/dist/components/table/table.js +124 -11
  19. package/dist/components/table/table.js.map +1 -1
  20. package/dist/components/top-bar/top-bar.d.ts.map +1 -1
  21. package/dist/components/top-bar/top-bar.js +8 -0
  22. package/dist/components/top-bar/top-bar.js.map +1 -1
  23. package/dist/generated/locales/es-419.d.ts +11 -1
  24. package/dist/generated/locales/es-419.d.ts.map +1 -1
  25. package/dist/generated/locales/es-419.js +11 -1
  26. package/dist/generated/locales/es-419.js.map +1 -1
  27. package/dist/generated/locales/fi-FI.d.ts +11 -1
  28. package/dist/generated/locales/fi-FI.d.ts.map +1 -1
  29. package/dist/generated/locales/fi-FI.js +11 -1
  30. package/dist/generated/locales/fi-FI.js.map +1 -1
  31. package/dist/integration-systems/integration-bar/integration-bar.d.ts +8 -8
  32. package/dist/integration-systems/integration-bar/integration-bar.d.ts.map +1 -1
  33. package/dist/integration-systems/integration-bar/integration-bar.js +13 -1
  34. package/dist/integration-systems/integration-bar/integration-bar.js.map +1 -1
  35. package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.d.ts +72 -7
  36. package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.d.ts.map +1 -1
  37. package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.js +99 -41
  38. package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.js.map +1 -1
  39. package/dist/types.d.ts +2 -0
  40. package/dist/types.d.ts.map +1 -1
  41. package/dist/types.js.map +1 -1
  42. package/package.json +1 -1
  43. package/src/components/alert-list-details-experimental/alert-list-details-experimental.css +70 -0
  44. package/src/components/alert-list-details-experimental/alert-list-details-experimental.stories.ts +510 -0
  45. package/src/components/alert-list-details-experimental/alert-list-details-experimental.ts +457 -0
  46. package/src/components/icon-button/icon-button.spec.ts +52 -0
  47. package/src/components/icon-button/icon-button.ts +7 -0
  48. package/src/components/table/table.css +42 -0
  49. package/src/components/table/table.stories.ts +279 -0
  50. package/src/components/table/table.ts +177 -13
  51. package/src/components/top-bar/top-bar.ts +10 -0
  52. package/src/generated/locales/es-419.ts +11 -1
  53. package/src/generated/locales/fi-FI.ts +11 -1
  54. package/src/integration-systems/integration-bar/integration-bar.ts +21 -9
  55. package/src/integration-systems/integration-bar-dropdown/integration-bar-dropdown.stories.ts +70 -3
  56. package/src/integration-systems/integration-bar-dropdown/integration-bar-dropdown.ts +138 -52
  57. package/src/types.ts +6 -4
@@ -54,6 +54,14 @@
54
54
  'sdb1595f5c742dfbb': `Input`,
55
55
  's37cbecaec58e2192': `Mode`,
56
56
  's065289e6cba017c6': `Transcribe`,
57
+ 's5e8250fb85d64c23': `Close`,
58
+ 'sc16e00a7a8b2fde2': `Back`,
59
+ 's6d8c02aee480af7a': `Menu`,
60
+ 's6abb1cd87fe0114e': `Home`,
61
+ 's18c92783d4042bbc': `Dimming`,
62
+ 'sa48f81f001b893d2': `User`,
63
+ 'sf7eeef8b4d6e602d': `Apps`,
64
+ 's37a9e8aec5713460': `More`,
57
65
  's76b886a513fca0d8': `Username is required`,
58
66
  'seb1d48da15e775c9': `Password is required`,
59
67
  's5e27738a2e8eb763': `Sign in`,
@@ -61,8 +69,10 @@
61
69
  'sf6e1665c7022a1f8': `Password`,
62
70
  's981f6febad4df84a': `Recently signed in`,
63
71
  'sbce70cbdb856635e': `Recent`,
64
- 'sa48f81f001b893d2': `User`,
65
72
  's7cfe12cd14df9950': `Sign out`,
73
+ 's5be3c6d61cd9182f': `Notifications`,
74
+ 's744d993d03f29851': `Screen`,
75
+ 'sa81e2cdaf6921adc': `System`,
66
76
  's3374200692e9843d': `No alerts`,
67
77
  's6686fcc6d2c8f0bd': `Note`,
68
78
  'sfbc33dd48f23752c': `Tag ID`,
@@ -64,6 +64,14 @@
64
64
  'sdb1595f5c742dfbb': `Input`,
65
65
  's37cbecaec58e2192': `Mode`,
66
66
  's065289e6cba017c6': `Transcribe`,
67
+ 's5e8250fb85d64c23': `Close`,
68
+ 'sc16e00a7a8b2fde2': `Back`,
69
+ 's6d8c02aee480af7a': `Menu`,
70
+ 's6abb1cd87fe0114e': `Home`,
71
+ 's18c92783d4042bbc': `Dimming`,
72
+ 'sa48f81f001b893d2': `User`,
73
+ 'sf7eeef8b4d6e602d': `Apps`,
74
+ 's37a9e8aec5713460': `More`,
67
75
  's76b886a513fca0d8': `Username is required`,
68
76
  'seb1d48da15e775c9': `Password is required`,
69
77
  's5e27738a2e8eb763': `Sign in`,
@@ -71,8 +79,10 @@
71
79
  'sf6e1665c7022a1f8': `Password`,
72
80
  's981f6febad4df84a': `Recently signed in`,
73
81
  'sbce70cbdb856635e': `Recent`,
74
- 'sa48f81f001b893d2': `User`,
75
82
  's7cfe12cd14df9950': `Sign out`,
83
+ 's5be3c6d61cd9182f': `Notifications`,
84
+ 's744d993d03f29851': `Screen`,
85
+ 'sa81e2cdaf6921adc': `System`,
76
86
  's3374200692e9843d': `No alerts`,
77
87
  };
78
88
 
@@ -20,6 +20,7 @@ import '../../icons/icon-alerts.js';
20
20
  import '../../icons/icon-link.js';
21
21
  import {property, state} from 'lit/decorators.js';
22
22
  import {classMap} from 'lit/directives/class-map.js';
23
+ import {msg} from '@lit/localize';
23
24
 
24
25
  /**
25
26
  * `<obc-integration-bar>` – A compact top-level integration header for vessel and system navigation controls.
@@ -50,14 +51,14 @@ import {classMap} from 'lit/directives/class-map.js';
50
51
  * @slot clock - Custom clock content, rendered when `showClock` is true
51
52
  * @slot integration-buttons - Regular vessel integration buttons
52
53
  * @slot hug-buttons - Compact vessel integration buttons; slotted integration buttons are forced to hug type
53
- * @fires fleet-button-click - Fired when the fleet button is clicked
54
- * @fires link-button-clicked - Fired when the link button is clicked
55
- * @fires alert-button-clicked - Fired when the alert button is clicked
56
- * @fires notification-button-clicked - Fired when the notification button is clicked
57
- * @fires screen-button-clicked - Fired when the screen button is clicked
58
- * @fires system-button-clicked - Fired when the system button is clicked
59
- * @fires dimming-button-clicked - Fired when the dimming button is clicked
60
- * @fires user-button-clicked - Fired when the user button is clicked
54
+ * @fires {CustomEvent} fleet-button-click - Fired when the fleet button is clicked
55
+ * @fires {CustomEvent} link-button-clicked - Fired when the link button is clicked
56
+ * @fires {CustomEvent} alert-button-clicked - Fired when the alert button is clicked
57
+ * @fires {CustomEvent} notification-button-clicked - Fired when the notification button is clicked
58
+ * @fires {CustomEvent} screen-button-clicked - Fired when the screen button is clicked
59
+ * @fires {CustomEvent} system-button-clicked - Fired when the system button is clicked
60
+ * @fires {CustomEvent} dimming-button-clicked - Fired when the dimming button is clicked
61
+ * @fires {CustomEvent} user-button-clicked - Fired when the user button is clicked
61
62
  * @experimental
62
63
  */
63
64
  @customElement('obc-integration-bar')
@@ -114,7 +115,11 @@ export class ObcIntegrationBar extends LitElement {
114
115
  <nav class="wrapper">
115
116
  <div class="content-container">
116
117
  ${!this.hideHomeButton
117
- ? html`<obc-icon-button class="home-button" variant="integration">
118
+ ? html`<obc-icon-button
119
+ class="home-button"
120
+ variant="integration"
121
+ aria-label=${msg('Home')}
122
+ >
118
123
  <obi-home></obi-home>
119
124
  </obc-icon-button>`
120
125
  : null}
@@ -126,6 +131,7 @@ export class ObcIntegrationBar extends LitElement {
126
131
  })}
127
132
  part="link-button"
128
133
  variant="integration"
134
+ aria-label=${msg('Link')}
129
135
  @click=${() =>
130
136
  this.dispatchEvent(new CustomEvent('link-button-clicked'))}
131
137
  ?activated=${this.linkButtonActivated}
@@ -179,6 +185,7 @@ export class ObcIntegrationBar extends LitElement {
179
185
  })}
180
186
  part="alert-button"
181
187
  variant="integration"
188
+ aria-label=${msg('Alerts')}
182
189
  style=${this.alertButtonActivated
183
190
  ? 'anchor-name: --settings-menu-anchor;'
184
191
  : ''}
@@ -197,6 +204,7 @@ export class ObcIntegrationBar extends LitElement {
197
204
  })}
198
205
  part="notification-button"
199
206
  variant="integration"
207
+ aria-label=${msg('Notifications')}
200
208
  style=${this.notificationButtonActivated
201
209
  ? 'anchor-name: --settings-menu-anchor;'
202
210
  : ''}
@@ -217,6 +225,7 @@ export class ObcIntegrationBar extends LitElement {
217
225
  })}
218
226
  part="screen-button"
219
227
  variant="integration"
228
+ aria-label=${msg('Screen')}
220
229
  style=${this.screenButtonActivated
221
230
  ? 'anchor-name: --settings-menu-anchor;'
222
231
  : ''}
@@ -235,6 +244,7 @@ export class ObcIntegrationBar extends LitElement {
235
244
  })}
236
245
  part="system-button"
237
246
  variant="integration"
247
+ aria-label=${msg('System')}
238
248
  style=${this.systemButtonActivated
239
249
  ? 'anchor-name: --settings-menu-anchor;'
240
250
  : ''}
@@ -253,6 +263,7 @@ export class ObcIntegrationBar extends LitElement {
253
263
  })}
254
264
  part="dimming-button"
255
265
  variant="integration"
266
+ aria-label=${msg('Dimming')}
256
267
  style=${this.dimmingButtonActivated
257
268
  ? 'anchor-name: --settings-menu-anchor;'
258
269
  : ''}
@@ -271,6 +282,7 @@ export class ObcIntegrationBar extends LitElement {
271
282
  })}
272
283
  part="user-button"
273
284
  variant="integration"
285
+ aria-label=${msg('User')}
274
286
  style=${this.userButtonActivated
275
287
  ? 'anchor-name: --settings-menu-anchor;'
276
288
  : ''}
@@ -6,6 +6,7 @@ import '../integration-dropdown-button/integration-dropdown-button.js';
6
6
  import '../../components/clock/clock.js';
7
7
  import '../../icons/icon-placeholder.js';
8
8
  import {IntegrationButtonType} from '../integration-button/integration-button.js';
9
+ import {expect} from 'storybook/test';
9
10
 
10
11
  const meta: Meta<typeof ObcIntegrationBarDropdown> = {
11
12
  title: 'Integration Systems/Integration Bar Dropdown',
@@ -18,9 +19,24 @@ const meta: Meta<typeof ObcIntegrationBarDropdown> = {
18
19
  showDate: true,
19
20
  showTimezone: true,
20
21
  timeZoneOffsetHours: 1,
22
+ showHomeButton: true,
23
+ homeButtonActivated: false,
24
+ showLinkButton: false,
25
+ linkButtonActivated: false,
26
+ showAlertButton: false,
27
+ alertButtonActivated: false,
28
+ showNotificationButton: false,
29
+ notificationButtonActivated: false,
30
+ showNotificationCount: false,
31
+ notificationCount: 0,
32
+ showScreenButton: false,
33
+ screenButtonActivated: false,
34
+ showSystemButton: false,
35
+ systemButtonActivated: false,
21
36
  showDimmingButton: true,
37
+ dimmingButtonActivated: false,
22
38
  showUserButton: true,
23
- showHomeButton: true,
39
+ userButtonActivated: false,
24
40
  nStatusFields: 3,
25
41
  },
26
42
  argTypes: {
@@ -31,11 +47,24 @@ const meta: Meta<typeof ObcIntegrationBarDropdown> = {
31
47
  render: (args) =>
32
48
  html`<obc-integration-bar-dropdown
33
49
  .showHomeButton=${args.showHomeButton}
50
+ .homeButtonActivated=${args.homeButtonActivated}
51
+ .showLinkButton=${args.showLinkButton}
52
+ .linkButtonActivated=${args.linkButtonActivated}
34
53
  .showClock=${args.showClock}
35
- .showDimmingButton=${args.showDimmingButton}
36
- .showUserButton=${args.showUserButton}
54
+ .showAlertButton=${args.showAlertButton}
55
+ .alertButtonActivated=${args.alertButtonActivated}
37
56
  .showNotificationButton=${args.showNotificationButton}
57
+ .notificationButtonActivated=${args.notificationButtonActivated}
58
+ .showNotificationCount=${args.showNotificationCount}
59
+ .notificationCount=${args.notificationCount}
60
+ .showScreenButton=${args.showScreenButton}
61
+ .screenButtonActivated=${args.screenButtonActivated}
38
62
  .showSystemButton=${args.showSystemButton}
63
+ .systemButtonActivated=${args.systemButtonActivated}
64
+ .showDimmingButton=${args.showDimmingButton}
65
+ .dimmingButtonActivated=${args.dimmingButtonActivated}
66
+ .showUserButton=${args.showUserButton}
67
+ .userButtonActivated=${args.userButtonActivated}
39
68
  .nStatusFields=${args.nStatusFields}
40
69
  >
41
70
  <obc-integration-dropdown-button
@@ -95,3 +124,41 @@ type Story = StoryObj<ObcIntegrationBarDropdown>;
95
124
  export const Primary: Story = {
96
125
  args: {},
97
126
  };
127
+
128
+ export const AllButtons: Story = {
129
+ args: {
130
+ showLinkButton: true,
131
+ showAlertButton: true,
132
+ showNotificationButton: true,
133
+ showNotificationCount: true,
134
+ notificationCount: 3,
135
+ showScreenButton: true,
136
+ showSystemButton: true,
137
+ },
138
+ play: async ({canvasElement}) => {
139
+ const bar = canvasElement.querySelector(
140
+ 'obc-integration-bar-dropdown'
141
+ ) as ObcIntegrationBarDropdown;
142
+ const iconButtons = bar.shadowRoot!.querySelectorAll('obc-icon-button');
143
+
144
+ expect(iconButtons.length).toBe(7);
145
+ for (const iconButton of iconButtons) {
146
+ const control = iconButton.shadowRoot!.querySelector('button')!;
147
+ expect(control.getAttribute('aria-label')).toBeTruthy();
148
+ }
149
+ },
150
+ };
151
+
152
+ export const AllButtonsActivated: Story = {
153
+ args: {
154
+ ...AllButtons.args,
155
+ homeButtonActivated: true,
156
+ linkButtonActivated: true,
157
+ alertButtonActivated: true,
158
+ notificationButtonActivated: true,
159
+ screenButtonActivated: true,
160
+ systemButtonActivated: true,
161
+ dimmingButtonActivated: true,
162
+ userButtonActivated: true,
163
+ },
164
+ };
@@ -1,4 +1,4 @@
1
- import {LitElement, html, nothing, unsafeCSS} from 'lit';
1
+ import {LitElement, html, nothing, unsafeCSS, type TemplateResult} from 'lit';
2
2
  import {customElement} from '../../decorator.js';
3
3
  import compentStyle from './integration-bar-dropdown.css?inline';
4
4
  import '../integration-tabs/integration-tabs.js';
@@ -9,16 +9,46 @@ import '../../icons/icon-user.js';
9
9
  import '../../icons/icon-configure.js';
10
10
  import '../../icons/icon-notification.js';
11
11
  import '../../icons/icon-home.js';
12
+ import '../../icons/icon-screen-desk.js';
13
+ import '../../icons/icon-alerts.js';
14
+ import '../../icons/icon-link.js';
12
15
  import {NotificationButtonStyle} from '../../components/notification-button/notification-button.js';
13
16
  import {property} from 'lit/decorators.js';
17
+ import {msg} from '@lit/localize';
14
18
 
15
19
  /**
20
+ * `<obc-integration-bar-dropdown>` – A compact top-level integration header with a dropdown selector, status fields and system action buttons.
16
21
  *
17
- * @fires home-button-clicked - Fired when the home button is clicked
18
- * @fires dimming-button-clicked - Fired when the dimming button is clicked
19
- * @fires notification-button-clicked - Fired when the notification button is clicked
20
- * @fires user-button-clicked - Fired when the user button is clicked
21
- * @fires system-button-clicked - Fired when the system button is clicked
22
+ * @property showHomeButton - Home button at the left end of the bar.
23
+ * @property homeButtonActivated - Pressed styling for the home button.
24
+ * @availableWhen homeButtonActivated showHomeButton==true
25
+ * @property showLinkButton - Link button, between home and the selector.
26
+ * @property linkButtonActivated - Pressed styling for the link button.
27
+ * @availableWhen linkButtonActivated showLinkButton==true
28
+ * @property showClock - Renders the `clock` slot at the right end.
29
+ * @property showAlertButton - Alert button, first in the right-hand group.
30
+ * @property alertButtonActivated - Pressed styling for the alert button.
31
+ * @availableWhen alertButtonActivated showAlertButton==true
32
+ * @property showNotificationButton - Notification button, after the alert button.
33
+ * @property notificationButtonActivated - Pressed styling; the count badge only appears in this state.
34
+ * @availableWhen notificationButtonActivated showNotificationButton==true
35
+ * @property notificationCount - Number drawn in the count badge.
36
+ * @availableWhen notificationCount showNotificationButton==true && showNotificationCount==true && notificationButtonActivated==true
37
+ * @property showNotificationCount - Draws the count badge on the notification button.
38
+ * @availableWhen showNotificationCount showNotificationButton==true && notificationButtonActivated==true
39
+ * @property showScreenButton - Screen button, after the notification button.
40
+ * @property screenButtonActivated - Pressed styling for the screen button.
41
+ * @availableWhen screenButtonActivated showScreenButton==true
42
+ * @property showUserButton - User button, last before the clock.
43
+ * @property userButtonActivated - Pressed styling for the user button.
44
+ * @availableWhen userButtonActivated showUserButton==true
45
+ * @property showDimmingButton - Dimming button, between system and user.
46
+ * @property dimmingButtonActivated - Pressed styling for the dimming button.
47
+ * @availableWhen dimmingButtonActivated showDimmingButton==true
48
+ * @property showSystemButton - System button, after the screen button.
49
+ * @property systemButtonActivated - Pressed styling for the system button.
50
+ * @availableWhen systemButtonActivated showSystemButton==true
51
+ * @property nStatusFields - How many `status-icon-N`/`status-label-N` slot pairs are rendered.
22
52
  *
23
53
  * @slot vessel-selector - Vessel selector content
24
54
  * @slot status-label-1 - Label for the first status field
@@ -28,17 +58,32 @@ import {property} from 'lit/decorators.js';
28
58
  * @slot status-label-3 - Label for the third status field
29
59
  * @slot status-icon-3 - Icon for the third status field
30
60
  * @slot clock - Custom clock content, rendered when `showClock` is true
61
+ *
62
+ * @fires {CustomEvent} home-button-clicked - Fired when the home button is clicked
63
+ * @fires {CustomEvent} link-button-clicked - Fired when the link button is clicked
64
+ * @fires {CustomEvent} alert-button-clicked - Fired when the alert button is clicked
65
+ * @fires {CustomEvent} dimming-button-clicked - Fired when the dimming button is clicked
66
+ * @fires {CustomEvent} notification-button-clicked - Fired when the notification button is clicked
67
+ * @fires {CustomEvent} screen-button-clicked - Fired when the screen button is clicked
68
+ * @fires {CustomEvent} user-button-clicked - Fired when the user button is clicked
69
+ * @fires {CustomEvent} system-button-clicked - Fired when the system button is clicked
31
70
  * @experimental
32
71
  */
33
72
  @customElement('obc-integration-bar-dropdown')
34
73
  export class ObcIntegrationBarDropdown extends LitElement {
35
74
  @property({type: Boolean}) showHomeButton = false;
36
75
  @property({type: Boolean}) homeButtonActivated = false;
76
+ @property({type: Boolean}) showLinkButton = false;
77
+ @property({type: Boolean}) linkButtonActivated = false;
37
78
  @property({type: Boolean}) showClock = false;
79
+ @property({type: Boolean}) showAlertButton = false;
80
+ @property({type: Boolean}) alertButtonActivated = false;
38
81
  @property({type: Boolean}) showNotificationButton = false;
39
82
  @property({type: Boolean}) notificationButtonActivated = false;
40
83
  @property({type: Number}) notificationCount = 0;
41
84
  @property({type: Boolean}) showNotificationCount = false;
85
+ @property({type: Boolean}) showScreenButton = false;
86
+ @property({type: Boolean}) screenButtonActivated = false;
42
87
  @property({type: Boolean}) showUserButton = false;
43
88
  @property({type: Boolean}) userButtonActivated = false;
44
89
  @property({type: Boolean}) showDimmingButton = false;
@@ -66,28 +111,66 @@ export class ObcIntegrationBarDropdown extends LitElement {
66
111
  return html`<div class="status">${result}</div>`;
67
112
  }
68
113
 
114
+ // The event name stays a literal at each call site so `cem analyze` can read it.
115
+ private renderIconButton(
116
+ name: string,
117
+ activated: boolean,
118
+ label: string,
119
+ icon: TemplateResult,
120
+ onClick: () => void
121
+ ) {
122
+ return html`<obc-icon-button
123
+ class="${name}-button"
124
+ part="${name}-button"
125
+ variant="integration"
126
+ aria-label=${label}
127
+ @click=${onClick}
128
+ ?activated=${activated}
129
+ >
130
+ ${icon}
131
+ </obc-icon-button>`;
132
+ }
133
+
69
134
  override render() {
70
135
  return html`
71
136
  <div class="wrapper">
72
137
  <div class="left-side">
73
138
  ${this.showHomeButton
74
- ? html`<obc-icon-button
75
- class="home-button"
76
- part="home-button"
77
- variant="integration"
78
- @click=${() =>
79
- this.dispatchEvent(new CustomEvent('home-button-clicked'))}
80
- ?activated=${this.homeButtonActivated}
81
- >
82
- <obi-home></obi-home>
83
- </obc-icon-button>`
84
- : null}
139
+ ? this.renderIconButton(
140
+ 'home',
141
+ this.homeButtonActivated,
142
+ msg('Home'),
143
+ html`<obi-home></obi-home>`,
144
+ () => this.dispatchEvent(new CustomEvent('home-button-clicked'))
145
+ )
146
+ : nothing}
147
+ ${this.showLinkButton
148
+ ? this.renderIconButton(
149
+ 'link',
150
+ this.linkButtonActivated,
151
+ msg('Link'),
152
+ html`<obi-link></obi-link>`,
153
+ () => this.dispatchEvent(new CustomEvent('link-button-clicked'))
154
+ )
155
+ : nothing}
85
156
  <slot name="vessel-selector"></slot>
86
157
  ${this.renderStatusFields()}
87
158
  </div>
88
159
  <div class="right-side">
160
+ ${this.showAlertButton
161
+ ? this.renderIconButton(
162
+ 'alert',
163
+ this.alertButtonActivated,
164
+ msg('Alerts'),
165
+ html`<obi-alerts></obi-alerts>`,
166
+ () =>
167
+ this.dispatchEvent(new CustomEvent('alert-button-clicked'))
168
+ )
169
+ : nothing}
89
170
  ${this.showNotificationButton
90
- ? html`<obc-notification-button
171
+ ? // TODO(designer): keep the Enhanced badge button here, or match the
172
+ // sibling bar's plain notification icon button? (#624)
173
+ html`<obc-notification-button
91
174
  @click=${() =>
92
175
  this.dispatchEvent(
93
176
  new CustomEvent('notification-button-clicked')
@@ -98,43 +181,46 @@ export class ObcIntegrationBarDropdown extends LitElement {
98
181
  ?isActive=${this.notificationButtonActivated}
99
182
  ></obc-notification-button>`
100
183
  : nothing}
184
+ ${this.showScreenButton
185
+ ? this.renderIconButton(
186
+ 'screen',
187
+ this.screenButtonActivated,
188
+ msg('Screen'),
189
+ html`<obi-screen-desk></obi-screen-desk>`,
190
+ () =>
191
+ this.dispatchEvent(new CustomEvent('screen-button-clicked'))
192
+ )
193
+ : nothing}
101
194
  ${this.showSystemButton
102
- ? html`<obc-icon-button
103
- class="system-button"
104
- part="system-button"
105
- variant="integration"
106
- @click=${() =>
107
- this.dispatchEvent(new CustomEvent('system-button-clicked'))}
108
- ?activated=${this.systemButtonActivated}
109
- >
110
- <obi-configure></obi-configure>
111
- </obc-icon-button>`
112
- : null}
195
+ ? this.renderIconButton(
196
+ 'system',
197
+ this.systemButtonActivated,
198
+ msg('System'),
199
+ html`<obi-configure></obi-configure>`,
200
+ () =>
201
+ this.dispatchEvent(new CustomEvent('system-button-clicked'))
202
+ )
203
+ : nothing}
113
204
  ${this.showDimmingButton
114
- ? html`<obc-icon-button
115
- class="dimming-button"
116
- part="dimming-button"
117
- variant="integration"
118
- @click=${() =>
119
- this.dispatchEvent(new CustomEvent('dimming-button-clicked'))}
120
- ?activated=${this.dimmingButtonActivated}
121
- >
122
- <obi-palette-day-night-iec></obi-palette-day-night-iec>
123
- </obc-icon-button>`
124
- : null}
205
+ ? this.renderIconButton(
206
+ 'dimming',
207
+ this.dimmingButtonActivated,
208
+ msg('Dimming'),
209
+ html`<obi-palette-day-night-iec></obi-palette-day-night-iec>`,
210
+ () =>
211
+ this.dispatchEvent(new CustomEvent('dimming-button-clicked'))
212
+ )
213
+ : nothing}
125
214
  ${this.showUserButton
126
- ? html`<obc-icon-button
127
- class="user-button"
128
- part="user-button"
129
- variant="integration"
130
- @click=${() =>
131
- this.dispatchEvent(new CustomEvent('user-button-clicked'))}
132
- ?activated=${this.userButtonActivated}
133
- >
134
- <obi-user></obi-user>
135
- </obc-icon-button>`
136
- : null}
137
- ${this.showClock ? html`<slot name="clock"></slot>` : null}
215
+ ? this.renderIconButton(
216
+ 'user',
217
+ this.userButtonActivated,
218
+ msg('User'),
219
+ html`<obi-user></obi-user>`,
220
+ () => this.dispatchEvent(new CustomEvent('user-button-clicked'))
221
+ )
222
+ : nothing}
223
+ ${this.showClock ? html`<slot name="clock"></slot>` : nothing}
138
224
  </div>
139
225
  </div>
140
226
  `;
package/src/types.ts CHANGED
@@ -34,11 +34,11 @@ export enum AlertCategory {
34
34
  }
35
35
 
36
36
  export interface Alert {
37
- id: string; // The id of the alert
38
- tagId: string; // The tag ID visible to the user
37
+ id: string;
38
+ tagId: string;
39
39
  source: string;
40
40
  text: string;
41
- note?: string; // The note of the alert, typically by the operator
41
+ note?: string;
42
42
  acknowledged:
43
43
  | false
44
44
  | {
@@ -67,8 +67,10 @@ export interface Alert {
67
67
  blockedEndTime?: Date;
68
68
  blockedBy?: string;
69
69
  };
70
- noAck?: boolean; // If true, the alarm has no ack button
70
+ noAck?: boolean;
71
+ noSilence?: boolean;
71
72
  category?: AlertCategory;
73
+ memberOf?: string[];
72
74
  }
73
75
 
74
76
  export function isActive(alert: Alert) {