@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.49 → 2.0.0-next.52
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.
- package/bundle/openbridge-webcomponents.bundle.js +18716 -17343
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +877 -14
- package/dist/ar/building-blocks/poi-header/poi-header.css.js +8 -4
- package/dist/ar/building-blocks/poi-header/poi-header.css.js.map +1 -1
- package/dist/ar/chart-object-vessel-button/chart-object-vessel-button.css.js +7 -7
- package/dist/ar/poi-card-header/poi-card-header.css.js +12 -6
- package/dist/ar/poi-card-header/poi-card-header.css.js.map +1 -1
- package/dist/automation/automation-tank/automation-tank.css.js +166 -28
- package/dist/automation/automation-tank/automation-tank.css.js.map +1 -1
- package/dist/automation/automation-tank/automation-tank.d.ts +32 -0
- package/dist/automation/automation-tank/automation-tank.d.ts.map +1 -1
- package/dist/automation/automation-tank/automation-tank.js +28 -0
- package/dist/automation/automation-tank/automation-tank.js.map +1 -1
- package/dist/building-blocks/alert-list/alert-list.css.js +4 -2
- package/dist/building-blocks/alert-list/alert-list.css.js.map +1 -1
- package/dist/components/accordion-card/accordion-card.css.js +6 -3
- package/dist/components/accordion-card/accordion-card.css.js.map +1 -1
- package/dist/components/accordion-item/accordion-item.css.js +4 -2
- package/dist/components/accordion-item/accordion-item.css.js.map +1 -1
- package/dist/components/advice-button/advice-button.css.js +2 -1
- package/dist/components/advice-button/advice-button.css.js.map +1 -1
- package/dist/components/alert-button/alert-button.css.js +2 -1
- package/dist/components/alert-button/alert-button.css.js.map +1 -1
- package/dist/components/alert-frame/alert-frame.css.js +7 -3
- package/dist/components/alert-frame/alert-frame.css.js.map +1 -1
- package/dist/components/alert-list-details/alert-list-details.css.js +4 -2
- package/dist/components/alert-list-details/alert-list-details.css.js.map +1 -1
- package/dist/components/alert-menu/alert-menu.css.js +4 -2
- package/dist/components/alert-menu/alert-menu.css.js.map +1 -1
- package/dist/components/app-button/app-button.css.js +8 -4
- package/dist/components/app-button/app-button.css.js.map +1 -1
- package/dist/components/attachment-list-item/attachment-list-item.css.js +8 -4
- package/dist/components/attachment-list-item/attachment-list-item.css.js.map +1 -1
- package/dist/components/badge/badge.css.js +4 -2
- package/dist/components/badge/badge.css.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.css.js +4 -2
- package/dist/components/breadcrumb/breadcrumb.css.js.map +1 -1
- package/dist/components/brilliance-menu/brilliance-menu.css.js +2 -1
- package/dist/components/brilliance-menu/brilliance-menu.css.js.map +1 -1
- package/dist/components/calendar/calendar.css.js +5 -3
- package/dist/components/calendar/calendar.css.js.map +1 -1
- package/dist/components/card/card.css.js +2 -1
- package/dist/components/card/card.css.js.map +1 -1
- package/dist/components/chat-message/chat-message.css.js +6 -3
- package/dist/components/chat-message/chat-message.css.js.map +1 -1
- package/dist/components/check-button/check-button.css.js +5 -3
- package/dist/components/check-button/check-button.css.js.map +1 -1
- package/dist/components/checkbox-item/checkbox-item.css.js +4 -2
- package/dist/components/checkbox-item/checkbox-item.css.js.map +1 -1
- package/dist/components/clock/clock.css.js +7 -3
- package/dist/components/clock/clock.css.js.map +1 -1
- package/dist/components/command-menu/command-menu.css.js +6 -3
- package/dist/components/command-menu/command-menu.css.js.map +1 -1
- package/dist/components/communication-table/communication-table.css.js +10 -5
- package/dist/components/communication-table/communication-table.css.js.map +1 -1
- package/dist/components/context-menu-input/context-menu-input.css.js +4 -2
- package/dist/components/context-menu-input/context-menu-input.css.js.map +1 -1
- package/dist/components/date-item/date-item.css.js +16 -8
- package/dist/components/date-item/date-item.css.js.map +1 -1
- package/dist/components/dropdown-button/dropdown-button.css.js +6 -3
- package/dist/components/dropdown-button/dropdown-button.css.js.map +1 -1
- package/dist/components/elevated-card/elevated-card.css.js +8 -4
- package/dist/components/elevated-card/elevated-card.css.js.map +1 -1
- package/dist/components/elevated-card-radio-group/elevated-card-radio-group.css.js +6 -3
- package/dist/components/elevated-card-radio-group/elevated-card-radio-group.css.js.map +1 -1
- package/dist/components/event-item/event-item.css.js +6 -3
- package/dist/components/event-item/event-item.css.js.map +1 -1
- package/dist/components/event-list/event-list.css.js +2 -1
- package/dist/components/event-list/event-list.css.js.map +1 -1
- package/dist/components/filter-chip/filter-chip.css.js +2 -1
- package/dist/components/filter-chip/filter-chip.css.js.map +1 -1
- package/dist/components/floating-item/floating-item.css.js +6 -3
- package/dist/components/floating-item/floating-item.css.js.map +1 -1
- package/dist/components/form-container/form-container.css.js +1 -1
- package/dist/components/form-group/form-group.css.js +4 -2
- package/dist/components/form-group/form-group.css.js.map +1 -1
- package/dist/components/form-item/form-item.css.js +4 -2
- package/dist/components/form-item/form-item.css.js.map +1 -1
- package/dist/components/icon-button/icon-button.css.js +20 -19
- package/dist/components/icon-button/icon-button.css.js.map +1 -1
- package/dist/components/icon-button/icon-button.d.ts +2 -0
- package/dist/components/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/icon-button/icon-button.js.map +1 -1
- package/dist/components/icon-check-button/icon-check-button.css.js +4 -2
- package/dist/components/icon-check-button/icon-check-button.css.js.map +1 -1
- package/dist/components/input-chip/input-chip.css.js +2 -1
- package/dist/components/input-chip/input-chip.css.js.map +1 -1
- package/dist/components/keyboard-full/keyboard-full.css.js +2 -1
- package/dist/components/keyboard-full/keyboard-full.css.js.map +1 -1
- package/dist/components/keyboard-numeric/keyboard-numeric.css.js +2 -1
- package/dist/components/keyboard-numeric/keyboard-numeric.css.js.map +1 -1
- package/dist/components/menu-button/menu-button.css.js +4 -2
- package/dist/components/menu-button/menu-button.css.js.map +1 -1
- package/dist/components/message-menu-item/message-menu-item.css.js +8 -13
- package/dist/components/message-menu-item/message-menu-item.css.js.map +1 -1
- package/dist/components/modal-window/modal-window.css.js +2 -1
- package/dist/components/modal-window/modal-window.css.js.map +1 -1
- package/dist/components/navigation-item/navigation-item.css.js +9 -4
- package/dist/components/navigation-item/navigation-item.css.js.map +1 -1
- package/dist/components/notification-badge-button/notification-badge-button.css.js +2 -1
- package/dist/components/notification-badge-button/notification-badge-button.css.js.map +1 -1
- package/dist/components/notification-button/notification-button.css.js +2 -1
- package/dist/components/notification-button/notification-button.css.js.map +1 -1
- package/dist/components/number-input-field/number-input-field.css.js +4 -2
- package/dist/components/number-input-field/number-input-field.css.js.map +1 -1
- package/dist/components/pivot-item/pivot-item.css.js +4 -2
- package/dist/components/pivot-item/pivot-item.css.js.map +1 -1
- package/dist/components/progress-bar/progress-bar.css.js +4 -2
- package/dist/components/progress-bar/progress-bar.css.js.map +1 -1
- package/dist/components/progress-button/progress-button.css.js +4 -2
- package/dist/components/progress-button/progress-button.css.js.map +1 -1
- package/dist/components/radio/radio.css.js +4 -2
- package/dist/components/radio/radio.css.js.map +1 -1
- package/dist/components/rich-button/rich-button.css.js +4 -2
- package/dist/components/rich-button/rich-button.css.js.map +1 -1
- package/dist/components/sequence-item/sequence-item.css.js +11 -6
- package/dist/components/sequence-item/sequence-item.css.js.map +1 -1
- package/dist/components/sequence-loading-spinner/sequence-loading-spinner.css.js +3 -3
- package/dist/components/sequence-step/sequence-step.css.js +2 -1
- package/dist/components/sequence-step/sequence-step.css.js.map +1 -1
- package/dist/components/slide-button/slide-button.css.js +2 -1
- package/dist/components/slide-button/slide-button.css.js.map +1 -1
- package/dist/components/slider-double/slider-double.css.js +2 -1
- package/dist/components/slider-double/slider-double.css.js.map +1 -1
- package/dist/components/start-stop-switch/start-stop-switch.css.js +16 -8
- package/dist/components/start-stop-switch/start-stop-switch.css.js.map +1 -1
- package/dist/components/status-indicator/status-indicator.css.js +4 -2
- package/dist/components/status-indicator/status-indicator.css.js.map +1 -1
- package/dist/components/stepper-box/stepper-box.css.js +2 -1
- package/dist/components/stepper-box/stepper-box.css.js.map +1 -1
- package/dist/components/system-menu/system-menu.css.js +26 -13
- package/dist/components/system-menu/system-menu.css.js.map +1 -1
- package/dist/components/tab-item/tab-item.css.js +8 -5
- package/dist/components/tab-item/tab-item.css.js.map +1 -1
- package/dist/components/tabbed-card/tabbed-card.css.js +4 -2
- package/dist/components/tabbed-card/tabbed-card.css.js.map +1 -1
- package/dist/components/table/table.css.js +8 -5
- package/dist/components/table/table.css.js.map +1 -1
- package/dist/components/table-header-item/table-header-item.css.js +2 -1
- package/dist/components/table-header-item/table-header-item.css.js.map +1 -1
- package/dist/components/tag/tag.css.js +4 -2
- package/dist/components/tag/tag.css.js.map +1 -1
- package/dist/components/text-input-field/text-input-field.css.js +6 -3
- package/dist/components/text-input-field/text-input-field.css.js.map +1 -1
- package/dist/components/textarea-field/textarea-field.css.js +6 -3
- package/dist/components/textarea-field/textarea-field.css.js.map +1 -1
- package/dist/components/title-container/title-container.css.js +3 -2
- package/dist/components/title-container/title-container.css.js.map +1 -1
- package/dist/components/toggle-button-option/toggle-button-option.css.js +19 -12
- package/dist/components/toggle-button-option/toggle-button-option.css.js.map +1 -1
- package/dist/components/toggle-button-vertical-option/toggle-button-vertical-option.css.js +4 -2
- package/dist/components/toggle-button-vertical-option/toggle-button-vertical-option.css.js.map +1 -1
- package/dist/components/toggle-switch/toggle-switch.css.js +6 -3
- package/dist/components/toggle-switch/toggle-switch.css.js.map +1 -1
- package/dist/components/toggletip/toggletip.css.js +4 -2
- package/dist/components/toggletip/toggletip.css.js.map +1 -1
- package/dist/components/tooltip/tooltip.css.js +2 -1
- package/dist/components/tooltip/tooltip.css.js.map +1 -1
- package/dist/components/top-bar/top-bar.css.js +4 -2
- package/dist/components/top-bar/top-bar.css.js.map +1 -1
- package/dist/components/topbar-message-item/topbar-message-item.css.js +10 -5
- package/dist/components/topbar-message-item/topbar-message-item.css.js.map +1 -1
- package/dist/components/user-button/user-button.css.js +12 -7
- package/dist/components/user-button/user-button.css.js.map +1 -1
- package/dist/components/user-menu/user-menu.css.js +4 -2
- package/dist/components/user-menu/user-menu.css.js.map +1 -1
- package/dist/integration-systems/integration-bar/integration-bar.css.js +97 -0
- package/dist/integration-systems/integration-bar/integration-bar.css.js.map +1 -0
- package/dist/integration-systems/integration-bar/integration-bar.d.ts +91 -0
- package/dist/integration-systems/integration-bar/integration-bar.d.ts.map +1 -0
- package/dist/integration-systems/integration-bar/integration-bar.js +279 -0
- package/dist/integration-systems/integration-bar/integration-bar.js.map +1 -0
- package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.css.js +2 -1
- package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.css.js.map +1 -1
- package/dist/integration-systems/integration-button/integration-button.css.js +472 -156
- package/dist/integration-systems/integration-button/integration-button.css.js.map +1 -1
- package/dist/integration-systems/integration-button/integration-button.d.ts +37 -1
- package/dist/integration-systems/integration-button/integration-button.d.ts.map +1 -1
- package/dist/integration-systems/integration-button/integration-button.js +202 -36
- package/dist/integration-systems/integration-button/integration-button.js.map +1 -1
- package/dist/integration-systems/integration-dropdown-button/integration-dropdown-button.css.js +17 -6
- package/dist/integration-systems/integration-dropdown-button/integration-dropdown-button.css.js.map +1 -1
- package/dist/integration-systems/integration-fleet-button/integration-fleet-button.css.js +12 -6
- package/dist/integration-systems/integration-fleet-button/integration-fleet-button.css.js.map +1 -1
- package/dist/integration-systems/integration-tabs/integration-tabs.css.js +3 -1
- package/dist/integration-systems/integration-tabs/integration-tabs.css.js.map +1 -1
- package/dist/integration-systems/integration-vessel-menu/integration-vessel-menu.css.js +75 -0
- package/dist/integration-systems/integration-vessel-menu/integration-vessel-menu.css.js.map +1 -0
- package/dist/integration-systems/integration-vessel-menu/integration-vessel-menu.d.ts +37 -0
- package/dist/integration-systems/integration-vessel-menu/integration-vessel-menu.d.ts.map +1 -0
- package/dist/integration-systems/integration-vessel-menu/integration-vessel-menu.js +72 -0
- package/dist/integration-systems/integration-vessel-menu/integration-vessel-menu.js.map +1 -0
- package/dist/integration-systems/integration-vessel-selector/integration-vessel-selector.css.js +21 -8
- package/dist/integration-systems/integration-vessel-selector/integration-vessel-selector.css.js.map +1 -1
- package/dist/integration-systems/integration-vessel-selector/integration-vessel-selector.d.ts +2 -0
- package/dist/integration-systems/integration-vessel-selector/integration-vessel-selector.d.ts.map +1 -1
- package/dist/integration-systems/integration-vessel-selector/integration-vessel-selector.js +5 -0
- package/dist/integration-systems/integration-vessel-selector/integration-vessel-selector.js.map +1 -1
- package/dist/navigation-instruments/azimuth-thruster-labeled/azimuth-thruster-labeled.css.js +3 -1
- package/dist/navigation-instruments/azimuth-thruster-labeled/azimuth-thruster-labeled.css.js.map +1 -1
- package/dist/navigation-instruments/instrument-field/instrument-field.css.js +4 -2
- package/dist/navigation-instruments/instrument-field/instrument-field.css.js.map +1 -1
- package/dist/navigation-instruments/readout/readout.css.js +4 -2
- package/dist/navigation-instruments/readout/readout.css.js.map +1 -1
- package/dist/navigation-instruments/watch/watch.css.js +3 -2
- package/dist/navigation-instruments/watch/watch.css.js.map +1 -1
- package/dist/navigation-instruments/watch-flat/watch-flat.css.js +3 -2
- package/dist/navigation-instruments/watch-flat/watch-flat.css.js.map +1 -1
- package/dist/openbridge.css +4 -2
- package/dist/pages/alert-detail-page/alert-detail-page.css.js +15 -8
- package/dist/pages/alert-detail-page/alert-detail-page.css.js.map +1 -1
- package/package.json +3 -3
- package/postcss.config.mjs +2 -1
- package/script/check-css-variables.ts +9 -30
- package/src/ar/chart-object-vessel-button/chart-object-vessel-button.css +7 -7
- package/src/ar/poi-layer/poi-layer.stories.ts +3 -0
- package/src/automation/automation-tank/automation-tank.css +119 -21
- package/src/automation/automation-tank/automation-tank.stories.ts +38 -0
- package/src/automation/automation-tank/automation-tank.ts +64 -0
- package/src/components/calendar/calendar.css +1 -1
- package/src/components/check-button/check-button.css +1 -1
- package/src/components/icon-button/icon-button.css +1 -1
- package/src/components/icon-button/icon-button.ts +2 -0
- package/src/components/message-menu-item/message-menu-item.css +2 -5
- package/src/components/sequence-item/sequence-item.css +5 -3
- package/src/components/sequence-loading-spinner/sequence-loading-spinner.css +3 -3
- package/src/components/tab-item/tab-item.css +2 -2
- package/src/components/table/table.css +2 -2
- package/src/components/toggle-button-option/toggle-button-option.css +1 -3
- package/src/integration-systems/integration-app-bar/integration-app-bar.stories.ts +1 -1
- package/src/integration-systems/integration-bar/integration-bar.css +86 -0
- package/src/integration-systems/integration-bar/integration-bar.stories.ts +479 -0
- package/src/integration-systems/integration-bar/integration-bar.ts +301 -0
- package/src/integration-systems/integration-bar-dropdown/integration-bar-dropdown.stories.ts +5 -3
- package/src/integration-systems/integration-button/integration-button.css +203 -64
- package/src/integration-systems/integration-button/integration-button.stories.ts +71 -5
- package/src/integration-systems/integration-button/integration-button.ts +242 -43
- package/src/integration-systems/integration-dropdown-button/integration-dropdown-button.css +7 -1
- package/src/integration-systems/integration-dropdown-button/integration-dropdown-button.stories.ts +1 -1
- package/src/integration-systems/integration-fleet-button/integration-fleet-button.stories.ts +1 -1
- package/src/integration-systems/integration-tabs/integration-tabs.stories.ts +1 -1
- package/src/integration-systems/integration-vessel-menu/integration-vessel-menu.css +59 -0
- package/src/integration-systems/integration-vessel-menu/integration-vessel-menu.stories.ts +180 -0
- package/src/integration-systems/integration-vessel-menu/integration-vessel-menu.ts +83 -0
- package/src/integration-systems/integration-vessel-selector/integration-vessel-selector.css +21 -9
- package/src/integration-systems/integration-vessel-selector/integration-vessel-selector.stories.ts +187 -3
- package/src/integration-systems/integration-vessel-selector/integration-vessel-selector.ts +5 -0
- package/src/mixins/alert.css +0 -29
- package/src/mixins/font-extras.css +103 -0
- package/src/mixins/fonts.css +26 -96
- package/src/navigation-instruments/watch/watch.css +1 -1
- package/src/navigation-instruments/watch-flat/watch-flat.css +1 -1
- package/src/pages/alert-detail-page/alert-detail-page.css +1 -1
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import type {Meta, StoryObj} from '@storybook/web-components-vite';
|
|
2
|
+
import {ObcIntegrationBar} from './integration-bar.js';
|
|
3
|
+
import './integration-bar.js';
|
|
4
|
+
import {html, nothing} from 'lit';
|
|
5
|
+
import '../../components/dropdown-button/dropdown-button.js';
|
|
6
|
+
import '../../components/clock/clock.js';
|
|
7
|
+
import '../integration-vessel-menu/integration-vessel-menu.js';
|
|
8
|
+
import {
|
|
9
|
+
IntegrationButtonType,
|
|
10
|
+
IntegrationButtonVariant,
|
|
11
|
+
} from '../integration-button/integration-button.js';
|
|
12
|
+
|
|
13
|
+
function makeStringShorter(str: string, maxLength: number): string {
|
|
14
|
+
if (str.length <= maxLength) {
|
|
15
|
+
return str;
|
|
16
|
+
}
|
|
17
|
+
return str.slice(0, maxLength);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function getIntegrationnButtonType(hug: boolean, rich: boolean) {
|
|
21
|
+
if (hug) {
|
|
22
|
+
return IntegrationButtonType.hug;
|
|
23
|
+
} else if (rich) {
|
|
24
|
+
return IntegrationButtonType.rich;
|
|
25
|
+
} else {
|
|
26
|
+
return IntegrationButtonType.regular;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function getColorForButton(color: string): string {
|
|
31
|
+
return `--integration-on-selected-active-color: var(--base-${color}-600); --integration-on-selected-neutral-color: var(--base-${color}-500); --integration-selected-enabled-background-color: var(--base-${color}-100); --integration-selected-enabled-border-color: var(--base-${color}-100); --integration-selected-hover-background-color: var(--base-${color}-100); --integration-selected-hover-border-color: var(--base-${color}-100);`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const readouts = [
|
|
35
|
+
{label: 'Readout 1', value: 'Value 1', unit: 'Unit 1'},
|
|
36
|
+
{label: 'Readout 2', value: 'Value 2', unit: 'Unit 2'},
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
type IntegrationBarStoryArgs = ObcIntegrationBar & {
|
|
40
|
+
date: string;
|
|
41
|
+
showDate: boolean;
|
|
42
|
+
showTimezone: boolean;
|
|
43
|
+
timeZoneOffsetHours: number;
|
|
44
|
+
clockMinimizeBreakpointPx: number;
|
|
45
|
+
showVesselIntegrationMenu: boolean;
|
|
46
|
+
hug: boolean;
|
|
47
|
+
rich: boolean;
|
|
48
|
+
makeLabelNamesShort: boolean;
|
|
49
|
+
containerWidthPx: number;
|
|
50
|
+
showStatus: boolean;
|
|
51
|
+
showIntegrationMenu: boolean;
|
|
52
|
+
customSelectedColors: boolean;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
function renderIntegrationButtons({
|
|
56
|
+
onIntegrationButtonClick,
|
|
57
|
+
shortNames,
|
|
58
|
+
hug,
|
|
59
|
+
rich,
|
|
60
|
+
shouldShowDividerRight,
|
|
61
|
+
showStatus,
|
|
62
|
+
showIntegrationMenu,
|
|
63
|
+
customSelectedColors,
|
|
64
|
+
}: {
|
|
65
|
+
onIntegrationButtonClick: (event: Event, buttonIndex: number) => void;
|
|
66
|
+
shortNames: boolean;
|
|
67
|
+
hug: boolean;
|
|
68
|
+
rich: boolean;
|
|
69
|
+
shouldShowDividerRight: (buttonIndex: number) => boolean;
|
|
70
|
+
showStatus: boolean;
|
|
71
|
+
showIntegrationMenu: boolean;
|
|
72
|
+
customSelectedColors: boolean;
|
|
73
|
+
}) {
|
|
74
|
+
const slotName = hug ? 'hug-buttons' : 'integration-buttons';
|
|
75
|
+
const buttonType = getIntegrationnButtonType(hug, rich);
|
|
76
|
+
const button1styling = customSelectedColors ? getColorForButton('cyan') : '';
|
|
77
|
+
const button2styling = customSelectedColors
|
|
78
|
+
? getColorForButton('indigo')
|
|
79
|
+
: '';
|
|
80
|
+
const button3styling = customSelectedColors ? getColorForButton('teal') : '';
|
|
81
|
+
const button4styling = customSelectedColors
|
|
82
|
+
? getColorForButton('purple')
|
|
83
|
+
: '';
|
|
84
|
+
|
|
85
|
+
return html`
|
|
86
|
+
<obc-integration-button
|
|
87
|
+
hasLeadingIcon
|
|
88
|
+
style=${button1styling}
|
|
89
|
+
.variant=${IntegrationButtonVariant.flat}
|
|
90
|
+
.type=${buttonType}
|
|
91
|
+
.readouts=${readouts}
|
|
92
|
+
.hasStatus=${showStatus}
|
|
93
|
+
?selected=${false}
|
|
94
|
+
?activated=${false}
|
|
95
|
+
?dividerRight=${shouldShowDividerRight(0)}
|
|
96
|
+
@click=${(e: Event) => onIntegrationButtonClick(e, 0)}
|
|
97
|
+
slot=${slotName}
|
|
98
|
+
>
|
|
99
|
+
<obi-ship slot="leading-icon"></obi-ship>
|
|
100
|
+
<span slot="label"
|
|
101
|
+
>${shortNames ? makeStringShorter('Boat', 2) : 'Boat'}</span
|
|
102
|
+
>
|
|
103
|
+
<div slot="info-label">Info Label</div>
|
|
104
|
+
<div slot="info-status">Info Status</div>
|
|
105
|
+
<div slot="status">Status</div>
|
|
106
|
+
${showIntegrationMenu
|
|
107
|
+
? html`<obc-integration-vessel-menu
|
|
108
|
+
slot="integration-vessel-menu"
|
|
109
|
+
numberOfButtons="2"
|
|
110
|
+
@button1-click=${() => console.log('Boat Button 1 clicked')}
|
|
111
|
+
@button2-click=${() => console.log('Boat Button 2 clicked')}
|
|
112
|
+
><span slot="title">Boat</span
|
|
113
|
+
><obi-placeholder slot="button-1-leading-icon"></obi-placeholder>
|
|
114
|
+
<div slot="button-1-label">Select</div>
|
|
115
|
+
<obi-placeholder slot="button-2-leading-icon"></obi-placeholder>
|
|
116
|
+
<div slot="button-2-label">Dismiss</div>
|
|
117
|
+
<div slot="content" style="padding: 24px;">
|
|
118
|
+
<p>Boat is working just fine.</p>
|
|
119
|
+
</div></obc-integration-vessel-menu
|
|
120
|
+
>`
|
|
121
|
+
: nothing}
|
|
122
|
+
</obc-integration-button>
|
|
123
|
+
<obc-integration-button
|
|
124
|
+
hasLeadingIcon
|
|
125
|
+
style=${button2styling}
|
|
126
|
+
.variant=${IntegrationButtonVariant.flat}
|
|
127
|
+
.type=${buttonType}
|
|
128
|
+
.readouts=${readouts}
|
|
129
|
+
.hasStatus=${showStatus}
|
|
130
|
+
?selected=${false}
|
|
131
|
+
?activated=${false}
|
|
132
|
+
?dividerRight=${shouldShowDividerRight(1)}
|
|
133
|
+
@click=${(e: Event) => onIntegrationButtonClick(e, 1)}
|
|
134
|
+
slot=${slotName}
|
|
135
|
+
>
|
|
136
|
+
<obi-ship slot="leading-icon"></obi-ship>
|
|
137
|
+
<span slot="label"
|
|
138
|
+
>${shortNames ? makeStringShorter('Space Ship', 2) : 'Space Ship'}</span
|
|
139
|
+
>
|
|
140
|
+
<div slot="info-label">Info Label</div>
|
|
141
|
+
<div slot="info-status">Info Status</div>
|
|
142
|
+
<div slot="status">Status</div>
|
|
143
|
+
${showIntegrationMenu
|
|
144
|
+
? html`<obc-integration-vessel-menu
|
|
145
|
+
slot="integration-vessel-menu"
|
|
146
|
+
numberOfButtons="2"
|
|
147
|
+
@button1-click=${() => console.log('Space Ship Button 1 clicked')}
|
|
148
|
+
@button2-click=${() => console.log('Space Ship Button 2 clicked')}
|
|
149
|
+
><span slot="title">Space Ship</span
|
|
150
|
+
><obi-placeholder slot="button-1-leading-icon"></obi-placeholder>
|
|
151
|
+
<div slot="button-1-label">Select</div>
|
|
152
|
+
<obi-placeholder slot="button-2-leading-icon"></obi-placeholder>
|
|
153
|
+
<div slot="button-2-label">Dismiss</div>
|
|
154
|
+
<div slot="content" style="padding: 24px;">
|
|
155
|
+
<p>Space Ship is working just fine.</p>
|
|
156
|
+
</div></obc-integration-vessel-menu
|
|
157
|
+
>`
|
|
158
|
+
: nothing}
|
|
159
|
+
</obc-integration-button>
|
|
160
|
+
<obc-integration-button
|
|
161
|
+
hasLeadingIcon
|
|
162
|
+
style=${button3styling}
|
|
163
|
+
.variant=${IntegrationButtonVariant.flat}
|
|
164
|
+
.type=${buttonType}
|
|
165
|
+
.readouts=${readouts}
|
|
166
|
+
.hasStatus=${showStatus}
|
|
167
|
+
?selected=${false}
|
|
168
|
+
?activated=${true}
|
|
169
|
+
?dividerRight=${shouldShowDividerRight(2)}
|
|
170
|
+
@click=${(e: Event) => onIntegrationButtonClick(e, 2)}
|
|
171
|
+
slot=${slotName}
|
|
172
|
+
>
|
|
173
|
+
<obi-ship slot="leading-icon"></obi-ship>
|
|
174
|
+
<span slot="label"
|
|
175
|
+
>${shortNames ? makeStringShorter('Vessel', 2) : 'Vessel'}</span
|
|
176
|
+
>
|
|
177
|
+
<div slot="info-label">Info Label</div>
|
|
178
|
+
<div slot="info-status">Info Status</div>
|
|
179
|
+
<div slot="status">Status</div>
|
|
180
|
+
${showIntegrationMenu
|
|
181
|
+
? html`<obc-integration-vessel-menu
|
|
182
|
+
slot="integration-vessel-menu"
|
|
183
|
+
numberOfButtons="2"
|
|
184
|
+
@button1-click=${() => console.log('Vessel Button 1 clicked')}
|
|
185
|
+
@button2-click=${() => console.log('Vessel Button 2 clicked')}
|
|
186
|
+
><span slot="title">Vessel</span
|
|
187
|
+
><obi-placeholder slot="button-1-leading-icon"></obi-placeholder>
|
|
188
|
+
<div slot="button-1-label">Select</div>
|
|
189
|
+
<obi-placeholder slot="button-2-leading-icon"></obi-placeholder>
|
|
190
|
+
<div slot="button-2-label">Dismiss</div>
|
|
191
|
+
<div slot="content" style="padding: 24px;">
|
|
192
|
+
<p>Vessel is working just fine.</p>
|
|
193
|
+
</div></obc-integration-vessel-menu
|
|
194
|
+
>`
|
|
195
|
+
: nothing}
|
|
196
|
+
</obc-integration-button>
|
|
197
|
+
<obc-integration-button
|
|
198
|
+
hasLeadingIcon
|
|
199
|
+
style=${button4styling}
|
|
200
|
+
.variant=${IntegrationButtonVariant.flat}
|
|
201
|
+
.type=${buttonType}
|
|
202
|
+
.readouts=${readouts}
|
|
203
|
+
.hasStatus=${showStatus}
|
|
204
|
+
?selected=${true}
|
|
205
|
+
?activated=${false}
|
|
206
|
+
?dividerRight=${shouldShowDividerRight(3)}
|
|
207
|
+
@click=${(e: Event) => onIntegrationButtonClick(e, 3)}
|
|
208
|
+
slot=${slotName}
|
|
209
|
+
>
|
|
210
|
+
<obi-ship slot="leading-icon"></obi-ship>
|
|
211
|
+
<span slot="label"
|
|
212
|
+
>${shortNames ? makeStringShorter('Last', 2) : 'Last'}</span
|
|
213
|
+
>
|
|
214
|
+
<div slot="info-label">Info Label</div>
|
|
215
|
+
<div slot="info-status">Info Status</div>
|
|
216
|
+
<div slot="status">Status</div>
|
|
217
|
+
${showIntegrationMenu
|
|
218
|
+
? html`<obc-integration-vessel-menu
|
|
219
|
+
slot="integration-vessel-menu"
|
|
220
|
+
numberOfButtons="2"
|
|
221
|
+
@button1-click=${() => console.log('Last Button 1 clicked')}
|
|
222
|
+
@button2-click=${() => console.log('Last Button 2 clicked')}
|
|
223
|
+
><span slot="title">Last</span
|
|
224
|
+
><obi-placeholder slot="button-1-leading-icon"></obi-placeholder>
|
|
225
|
+
<div slot="button-1-label">Select</div>
|
|
226
|
+
<obi-placeholder slot="button-2-leading-icon"></obi-placeholder>
|
|
227
|
+
<div slot="button-2-label">Dismiss</div>
|
|
228
|
+
<div slot="content" style="padding: 24px;">
|
|
229
|
+
<p>Last is working just fine.</p>
|
|
230
|
+
</div></obc-integration-vessel-menu
|
|
231
|
+
>`
|
|
232
|
+
: nothing}
|
|
233
|
+
</obc-integration-button>
|
|
234
|
+
`;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const meta: Meta<IntegrationBarStoryArgs> = {
|
|
238
|
+
title: 'Integration Systems/Integration Bar',
|
|
239
|
+
tags: ['alpha'],
|
|
240
|
+
component: 'obc-integration-bar',
|
|
241
|
+
globals: {
|
|
242
|
+
viewport: {value: 'desktop'},
|
|
243
|
+
},
|
|
244
|
+
parameters: {
|
|
245
|
+
layout: 'fullscreen',
|
|
246
|
+
},
|
|
247
|
+
args: {
|
|
248
|
+
containerWidthPx: 1200,
|
|
249
|
+
showClock: true,
|
|
250
|
+
date: '2021-01-01T11:11:11.111Z',
|
|
251
|
+
clockMinimizeBreakpointPx: 600,
|
|
252
|
+
showDate: false,
|
|
253
|
+
showTimezone: false,
|
|
254
|
+
timeZoneOffsetHours: 1,
|
|
255
|
+
hideHomeButton: false,
|
|
256
|
+
hug: false,
|
|
257
|
+
rich: false,
|
|
258
|
+
showLinkButton: false,
|
|
259
|
+
linkButtonActivated: false,
|
|
260
|
+
showUserButton: true,
|
|
261
|
+
userButtonActivated: false,
|
|
262
|
+
showDimmingButton: true,
|
|
263
|
+
dimmingButtonActivated: false,
|
|
264
|
+
showSystemButton: true,
|
|
265
|
+
systemButtonActivated: false,
|
|
266
|
+
showScreenButton: true,
|
|
267
|
+
screenButtonActivated: false,
|
|
268
|
+
showNotificationButton: true,
|
|
269
|
+
notificationButtonActivated: false,
|
|
270
|
+
showAlertButton: true,
|
|
271
|
+
alertButtonActivated: false,
|
|
272
|
+
showVesselIntegrationMenu: false,
|
|
273
|
+
showStatus: false,
|
|
274
|
+
fleetButtonSelected: false,
|
|
275
|
+
fleetButtonActivated: false,
|
|
276
|
+
fleetButtonLabel: 'Fleet',
|
|
277
|
+
makeLabelNamesShort: false,
|
|
278
|
+
showIntegrationMenu: false,
|
|
279
|
+
customSelectedColors: false,
|
|
280
|
+
},
|
|
281
|
+
argTypes: {
|
|
282
|
+
containerWidthPx: {
|
|
283
|
+
control: {type: 'number'},
|
|
284
|
+
},
|
|
285
|
+
showDate: {
|
|
286
|
+
control: {type: 'boolean'},
|
|
287
|
+
},
|
|
288
|
+
showVesselIntegrationMenu: {
|
|
289
|
+
control: {type: 'boolean'},
|
|
290
|
+
},
|
|
291
|
+
hug: {
|
|
292
|
+
control: {type: 'boolean'},
|
|
293
|
+
},
|
|
294
|
+
rich: {
|
|
295
|
+
control: {type: 'boolean'},
|
|
296
|
+
},
|
|
297
|
+
showIntegrationMenu: {
|
|
298
|
+
control: {type: 'boolean'},
|
|
299
|
+
},
|
|
300
|
+
customSelectedColors: {
|
|
301
|
+
control: {type: 'boolean'},
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
render: (args) => {
|
|
305
|
+
type IntegrationButtonElement = HTMLElement & {
|
|
306
|
+
activated: boolean;
|
|
307
|
+
selected: boolean;
|
|
308
|
+
dividerRight: boolean;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
const integrationButtonCount = 4;
|
|
312
|
+
// Track click phase for each button (0: both false, 1: activated true, 2: selected true)
|
|
313
|
+
const buttonStates: Map<number, number> = new Map([
|
|
314
|
+
[0, 0], // button 1
|
|
315
|
+
[1, 0], // button 2
|
|
316
|
+
[2, 1], // button 3 (currently activated=true)
|
|
317
|
+
[3, 2], // button 4 (currently selected=true)
|
|
318
|
+
]);
|
|
319
|
+
|
|
320
|
+
const isActivatedOrSelected = (phase: number): boolean => {
|
|
321
|
+
return phase === 1 || phase === 2;
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
const shouldShowDividerRight = (buttonIndex: number): boolean => {
|
|
325
|
+
if (buttonIndex >= integrationButtonCount - 1) {
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
328
|
+
const currentPhase = buttonStates.get(buttonIndex) ?? 0;
|
|
329
|
+
const rightPhase = buttonStates.get(buttonIndex + 1) ?? 0;
|
|
330
|
+
|
|
331
|
+
return (
|
|
332
|
+
!isActivatedOrSelected(currentPhase) &&
|
|
333
|
+
!isActivatedOrSelected(rightPhase)
|
|
334
|
+
);
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
const updateIntegrationButtonDividers = (
|
|
338
|
+
button: IntegrationButtonElement
|
|
339
|
+
) => {
|
|
340
|
+
const integrationBar = button.closest('obc-integration-bar');
|
|
341
|
+
if (!integrationBar) {
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const integrationButtons = Array.from(
|
|
346
|
+
integrationBar.querySelectorAll<IntegrationButtonElement>(
|
|
347
|
+
'obc-integration-button[slot="integration-buttons"], obc-integration-button[slot="hug-buttons"]'
|
|
348
|
+
)
|
|
349
|
+
);
|
|
350
|
+
|
|
351
|
+
integrationButtons.forEach((integrationButton, index) => {
|
|
352
|
+
integrationButton.dividerRight = shouldShowDividerRight(index);
|
|
353
|
+
});
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
const onIntegrationButtonClick = (event: Event, buttonIndex: number) => {
|
|
357
|
+
const button = event.currentTarget as IntegrationButtonElement;
|
|
358
|
+
let phase = buttonStates.get(buttonIndex) ?? 0;
|
|
359
|
+
|
|
360
|
+
// Cycle: 0 → 1 → 2 → 0
|
|
361
|
+
phase = (phase + 1) % 3;
|
|
362
|
+
buttonStates.set(buttonIndex, phase);
|
|
363
|
+
|
|
364
|
+
const isActivated = phase === 1;
|
|
365
|
+
const isSelected = phase === 2;
|
|
366
|
+
|
|
367
|
+
button.activated = isActivated;
|
|
368
|
+
button.selected = isSelected;
|
|
369
|
+
updateIntegrationButtonDividers(button);
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
const onFleetButtonClick = (event: Event) => {
|
|
373
|
+
const integrationBar = event.currentTarget as ObcIntegrationBar;
|
|
374
|
+
if (integrationBar.fleetButtonActivated == true) {
|
|
375
|
+
integrationBar.fleetButtonActivated = false;
|
|
376
|
+
integrationBar.fleetButtonSelected = true;
|
|
377
|
+
} else if (integrationBar.fleetButtonSelected == true) {
|
|
378
|
+
integrationBar.fleetButtonSelected = false;
|
|
379
|
+
integrationBar.fleetButtonActivated = false;
|
|
380
|
+
} else {
|
|
381
|
+
integrationBar.fleetButtonActivated = true;
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
const wrapperStyle = args.showIntegrationMenu
|
|
386
|
+
? 'width: 100%; min-height: 400px; overflow-x: auto; overflow-y: visible;'
|
|
387
|
+
: 'width: 100%; overflow-x: auto;';
|
|
388
|
+
|
|
389
|
+
return html` <div style=${wrapperStyle}>
|
|
390
|
+
<div style=${`width: ${args.containerWidthPx}px;`}>
|
|
391
|
+
<obc-integration-bar
|
|
392
|
+
showFleetButton=${true}
|
|
393
|
+
style="width: 100%;"
|
|
394
|
+
@fleet-button-click=${onFleetButtonClick}
|
|
395
|
+
.hideHomeButton=${args.hideHomeButton}
|
|
396
|
+
.showLinkButton=${args.showLinkButton}
|
|
397
|
+
.linkButtonActivated=${args.linkButtonActivated}
|
|
398
|
+
.showClock=${args.showClock}
|
|
399
|
+
.showUserButton=${args.showUserButton}
|
|
400
|
+
.userButtonActivated=${args.userButtonActivated}
|
|
401
|
+
.showDimmingButton=${args.showDimmingButton}
|
|
402
|
+
.dimmingButtonActivated=${args.dimmingButtonActivated}
|
|
403
|
+
.showSystemButton=${args.showSystemButton}
|
|
404
|
+
.systemButtonActivated=${args.systemButtonActivated}
|
|
405
|
+
.showAlertButton=${args.showAlertButton}
|
|
406
|
+
.alertButtonActivated=${args.alertButtonActivated}
|
|
407
|
+
.showScreenButton=${args.showScreenButton}
|
|
408
|
+
.screenButtonActivated=${args.screenButtonActivated}
|
|
409
|
+
.showNotificationButton=${args.showNotificationButton}
|
|
410
|
+
.notificationButtonActivated=${args.notificationButtonActivated}
|
|
411
|
+
.fleetButtonSelected=${args.fleetButtonSelected}
|
|
412
|
+
.fleetButtonActivated=${args.fleetButtonActivated}
|
|
413
|
+
.fleetButtonLabel=${args.fleetButtonLabel}
|
|
414
|
+
>
|
|
415
|
+
<obc-clock
|
|
416
|
+
integrationBarMode
|
|
417
|
+
.date=${args.date}
|
|
418
|
+
.showDate=${args.showDate}
|
|
419
|
+
slot="clock"
|
|
420
|
+
.showTimezone=${args.showTimezone}
|
|
421
|
+
.timeZoneOffsetHours=${args.timeZoneOffsetHours}
|
|
422
|
+
.blinkOnlyBreakpointPx=${args.clockMinimizeBreakpointPx}
|
|
423
|
+
></obc-clock>
|
|
424
|
+
|
|
425
|
+
${renderIntegrationButtons({
|
|
426
|
+
onIntegrationButtonClick,
|
|
427
|
+
shortNames: args.makeLabelNamesShort,
|
|
428
|
+
hug: args.hug,
|
|
429
|
+
rich: args.rich,
|
|
430
|
+
shouldShowDividerRight,
|
|
431
|
+
showStatus: args.showStatus,
|
|
432
|
+
showIntegrationMenu: args.showIntegrationMenu,
|
|
433
|
+
customSelectedColors: args.customSelectedColors,
|
|
434
|
+
})}
|
|
435
|
+
</obc-integration-bar>
|
|
436
|
+
</div>
|
|
437
|
+
</div>`;
|
|
438
|
+
},
|
|
439
|
+
} satisfies Meta<IntegrationBarStoryArgs>;
|
|
440
|
+
|
|
441
|
+
export default meta;
|
|
442
|
+
type Story = StoryObj<IntegrationBarStoryArgs>;
|
|
443
|
+
|
|
444
|
+
export const Primary: Story = {
|
|
445
|
+
args: {},
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
export const WithStatus: Story = {
|
|
449
|
+
args: {
|
|
450
|
+
showStatus: true,
|
|
451
|
+
},
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
export const Hug: Story = {
|
|
455
|
+
args: {
|
|
456
|
+
hug: true,
|
|
457
|
+
makeLabelNamesShort: true,
|
|
458
|
+
},
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
export const Rich: Story = {
|
|
462
|
+
args: {
|
|
463
|
+
makeLabelNamesShort: false,
|
|
464
|
+
rich: true,
|
|
465
|
+
containerWidthPx: 1920,
|
|
466
|
+
},
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
export const WithIntegrationMenu: Story = {
|
|
470
|
+
args: {
|
|
471
|
+
showIntegrationMenu: true,
|
|
472
|
+
},
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
export const CustomSelectedColors: Story = {
|
|
476
|
+
args: {
|
|
477
|
+
customSelectedColors: true,
|
|
478
|
+
},
|
|
479
|
+
};
|