@oicl/openbridge-webcomponents 2.0.0-next.50 → 2.0.0-next.51
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 +18016 -17042
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +857 -3
- package/dist/components/icon-button/icon-button.css.js +18 -18
- 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/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-button/integration-button.css.js +457 -149
- 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 +7 -1
- package/dist/integration-systems/integration-dropdown-button/integration-dropdown-button.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/package.json +3 -3
|
@@ -353,33 +353,33 @@ const iconStyle = css`
|
|
|
353
353
|
}
|
|
354
354
|
|
|
355
355
|
.wrapper.variant-integration .visible-wrapper {
|
|
356
|
-
border-color: var(--integration-
|
|
357
|
-
background-color: var(--integration-
|
|
356
|
+
border-color: var(--integration-flat-enabled-border-color);
|
|
357
|
+
background-color: var(--integration-flat-enabled-background-color);
|
|
358
358
|
border-width: 1px;
|
|
359
359
|
border-style: solid;
|
|
360
360
|
cursor: pointer;
|
|
361
|
-
--base-border-color: var(--integration-
|
|
362
|
-
--base-background-color: var(--integration-
|
|
361
|
+
--base-border-color: var(--integration-flat-enabled-border-color);
|
|
362
|
+
--base-background-color: var(--integration-flat-enabled-background-color);
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
.wrapper.variant-integration.activated .visible-wrapper {
|
|
366
|
-
border-color: var(--integration-
|
|
367
|
-
background-color: var(--integration-
|
|
368
|
-
--base-border-color: var(--integration-
|
|
369
|
-
--base-background-color: var(--integration-
|
|
366
|
+
border-color: var(--integration-flat-activated-border-color);
|
|
367
|
+
background-color: var(--integration-flat-activated-background-color);
|
|
368
|
+
--base-border-color: var(--integration-flat-activated-border-color);
|
|
369
|
+
--base-background-color: var(--integration-flat-activated-background-color);
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
@media (hover:hover) {
|
|
373
373
|
|
|
374
374
|
.wrapper.variant-integration:hover .visible-wrapper {
|
|
375
|
-
border-color: color-mix(in srgb, var(--integration-
|
|
376
|
-
background-color: color-mix(in srgb, var(--integration-
|
|
375
|
+
border-color: color-mix(in srgb, var(--integration-flat-hover-border-color) calc(var(--obc-can-hover) * 100%), var(--base-border-color));
|
|
376
|
+
background-color: color-mix(in srgb, var(--integration-flat-hover-background-color) calc(var(--obc-can-hover) * 100%), var(--base-background-color));
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
.wrapper.variant-integration:active .visible-wrapper {
|
|
381
|
-
border-color: var(--integration-
|
|
382
|
-
background-color: var(--integration-
|
|
381
|
+
border-color: var(--integration-flat-pressed-border-color);
|
|
382
|
+
background-color: var(--integration-flat-pressed-background-color);
|
|
383
383
|
}
|
|
384
384
|
|
|
385
385
|
.wrapper.variant-integration:focus-visible .visible-wrapper {
|
|
@@ -391,17 +391,17 @@ const iconStyle = css`
|
|
|
391
391
|
}
|
|
392
392
|
|
|
393
393
|
.wrapper.variant-integration:disabled .visible-wrapper {
|
|
394
|
-
border-color: var(--integration-
|
|
395
|
-
background-color: var(--integration-
|
|
394
|
+
border-color: var(--integration-flat-disabled-border-color);
|
|
395
|
+
background-color: var(--integration-flat-disabled-background-color);
|
|
396
396
|
cursor: not-allowed;
|
|
397
|
-
color: var(--integration-on-
|
|
397
|
+
color: var(--integration-on-flat-disabled-color) !important;
|
|
398
398
|
}
|
|
399
399
|
|
|
400
400
|
.wrapper.variant-integration.disabled .visible-wrapper {
|
|
401
|
-
border-color: var(--integration-
|
|
402
|
-
background-color: var(--integration-
|
|
401
|
+
border-color: var(--integration-flat-disabled-border-color);
|
|
402
|
+
background-color: var(--integration-flat-disabled-background-color);
|
|
403
403
|
cursor: not-allowed;
|
|
404
|
-
color: var(--integration-on-
|
|
404
|
+
color: var(--integration-on-flat-disabled-color) !important;
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
.wrapper.variant-integration:disabled {
|
|
@@ -4,6 +4,7 @@ import { LitElement, nothing } from 'lit';
|
|
|
4
4
|
* - `normal`: Standard appearance for most use cases.
|
|
5
5
|
* - `raised`: Adds elevation/shadow for prominence.
|
|
6
6
|
* - `flat`: Minimal, backgroundless style for subtle actions.
|
|
7
|
+
* - `integration`: For use in Integration Bar components
|
|
7
8
|
*/
|
|
8
9
|
export declare enum IconButtonVariant {
|
|
9
10
|
normal = "normal",
|
|
@@ -23,6 +24,7 @@ export declare enum IconButtonVariant {
|
|
|
23
24
|
* - `normal` (default): Standard appearance for most use cases.
|
|
24
25
|
* - `raised`: Adds elevation/shadow for prominence.
|
|
25
26
|
* - `flat`: Minimal, backgroundless style for subtle actions.
|
|
27
|
+
* - `integration`: For use in Integration Bar components
|
|
26
28
|
* - **Progress Indicator:**
|
|
27
29
|
* - Shows a circular progress spinner overlay when the `progress` property is set (0–100). Useful for indicating loading or ongoing actions.
|
|
28
30
|
* - **Label Support:**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAQ,OAAO,EAAY,MAAM,KAAK,CAAC;AAMzD
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAQ,OAAO,EAAY,MAAM,KAAK,CAAC;AAMzD;;;;;;GAMG;AACH,oBAAY,iBAAiB;IAC3B,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,WAAW,gBAAgB;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,qBACa,aAAc,SAAQ,UAAU;IAC3C;;;;;OAKG;IACuB,OAAO,EAAE,iBAAiB,CACzB;IAE3B;;;OAGG;IACwB,SAAS,UAAS;IAE7C;;;OAGG;IACwB,UAAU,UAAS;IAE9C;;;OAGG;IACwB,WAAW,UAAS;IAE/C;;;OAGG;IACwB,WAAW,UAAS;IAE/C;;OAEG;IACwB,IAAI,UAAS;IAExC;;OAEG;IACwB,QAAQ,UAAS;IAE5C;;;;OAIG;IACuB,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAa;IAEnE;;OAEG;IACwB,QAAQ,EAAE,OAAO,CAAS;IAErD,iFAAiF;IACpC,WAAW,UAAQ;IAEhE,IAAI,eAAe,0DAoDlB;IAEQ,MAAM;IAiCf,OAAgB,MAAM,0BAAwB;CAC/C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,aAAa,CAAC;KAClC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.js","sources":["../../../src/components/icon-button/icon-button.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport iconStyle from './icon-button.css?inline';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\n\n/**\n * The available visual variants for `<obc-icon-button>`.\n * - `normal`: Standard appearance for most use cases.\n * - `raised`: Adds elevation/shadow for prominence.\n * - `flat`: Minimal, backgroundless style for subtle actions.\n */\nexport enum IconButtonVariant {\n normal = 'normal',\n raised = 'raised',\n flat = 'flat',\n integration = 'integration',\n}\n\n/**\n * `<obc-icon-button>` – An icon-only or icon-with-label button for quick actions.\n *\n * Provides a compact, visually prominent button that displays an icon (and optionally a label) for triggering actions. Commonly used for toolbars, navigation, or contextual actions where space is limited and a recognizable icon can represent the function.\n *\n * Appears as a circular or rounded button with configurable visual styles, supporting progress indication and various layout adaptations.\n *\n * ## Features\n * - **Variants:**\n * - `normal` (default): Standard appearance for most use cases.\n * - `raised`: Adds elevation/shadow for prominence.\n * - `flat`: Minimal, backgroundless style for subtle actions.\n * - **Progress Indicator:**\n * - Shows a circular progress spinner overlay when the `progress` property is set (0–100). Useful for indicating loading or ongoing actions.\n * - **Label Support:**\n * - Optionally displays a text label below the icon when `hasLabel` is true and content is provided in the `label` slot.\n * - **Corner Alignment:**\n * - `cornerLeft` and `cornerRight` adjust the button's border radius and alignment for seamless placement at the start or end of a container.\n * - **Active State:**\n * - `activated` visually highlights the button as selected or toggled.\n * - `activeColor` applies an accent color for emphasis.\n * - **Wide Mode:**\n * - `wide` increases the button's width for easier touch targets or visual balance.\n * - **Disabled State:**\n * - `disabled` prevents interaction and visually dims the button.\n *\n * ## Usage Guidelines\n * - Use `obc-icon-button` for actions represented by icons, such as toolbars, navigation, or quick-access commands.\n * - Add a label (with `hasLabel` and the `label` slot) when clarity is needed or when icons alone may not be universally understood.\n * - Use the progress indicator for actions that take time, such as uploads or background processes.\n * - Prefer the `normal` variant for most cases; use `raised` to draw attention, and `flat` for less prominent or inline actions.\n * - For grouped or edge-aligned layouts, use `cornerLeft` or `cornerRight` to visually merge with container edges.\n * - Avoid using icon buttons for destructive or critical actions unless paired with clear feedback.\n * - **TODO(designer):** Clarify recommended icon sizes and when to use label vs. icon-only.\n *\n * ## Slots\n * | Slot Name | Renders When... | Purpose |\n * |-----------|---------------------|----------------------------------------------|\n * | (default) | Always | The icon to display (e.g., `<obi-search>`) |\n * | label | If `hasLabel` is set | Optional label text below the icon |\n *\n * ## Events\n * - Emits a standard `click` event (`onClick` handler in framework wrappers) when activated.\n *\n * ## Best Practices\n * - Ensure icons are clear and universally recognizable.\n * - For accessibility, provide an `aria-label` or descriptive label for the button's action.\n * - When using the progress indicator, avoid showing it for very short actions to prevent visual flicker.\n *\n * ## Example:\n * ```\n * <obc-icon-button variant=\"normal\">\n * <obi-search></obi-search>\n * </obc-icon-button>\n *\n * <obc-icon-button variant=\"normal\" hasLabel>\n * <obi-arrow></obi-arrow>\n * <span slot=\"label\">Next</span>\n * </obc-icon-button>\n * ```\n *\n * @slot - Icon slot (default): Place an icon such as <obi-search> here.\n * @slot label - Optional label shown below the icon when `hasLabel` is true.\n * @fires click - Fired when the button is clicked (if not disabled).\n */\n@customElement('obc-icon-button')\nexport class ObcIconButton extends LitElement {\n /**\n * Visual style of the button.\n * - `normal`: Standard appearance (default).\n * - `raised`: Elevated with shadow.\n * - `flat`: Minimal, backgroundless style.\n */\n @property({type: String}) variant: IconButtonVariant =\n IconButtonVariant.normal;\n\n /**\n * Whether the button is in an activated (selected/toggled) state.\n * Visually highlights the button to indicate selection.\n */\n @property({type: Boolean}) activated = false;\n\n /**\n * If true, aligns the button to the left edge and removes left border radius.\n * Useful for grouping or edge-aligned layouts.\n */\n @property({type: Boolean}) cornerLeft = false;\n\n /**\n * If true, aligns the button to the right edge and removes right border radius.\n * Useful for grouping or edge-aligned layouts.\n */\n @property({type: Boolean}) cornerRight = false;\n\n /**\n * Applies an accent color to the button for emphasis.\n * Used to visually distinguish active or important actions.\n */\n @property({type: Boolean}) activeColor = false;\n\n /**\n * Increases the button's width for larger touch targets or visual balance.\n */\n @property({type: Boolean}) wide = false;\n\n /**\n * Disables the button, preventing user interaction and dimming its appearance.\n */\n @property({type: Boolean}) disabled = false;\n\n /**\n * Shows a circular progress indicator overlay when set (0–100).\n * Use to indicate ongoing actions or loading states.\n * If undefined, no progress indicator is shown.\n */\n @property({type: Number}) progress: undefined | number = undefined;\n\n /**\n * If true, displays a label below the icon using the `label` slot.\n */\n @property({type: Boolean}) hasLabel: boolean = false;\n\n /** If false, and cornerLeft or cornerRight is true, the divider is not shown. */\n @property({type: Boolean, attribute: false}) showDivider = true;\n\n get progressSpinner() {\n if (this.progress === undefined) {\n return nothing;\n }\n if (this.progress === 100) {\n return html`<div class=\"progress-spinner\">\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"18\"\n stroke=\"#325B9A\"\n stroke-width=\"4\"\n fill=\"none\"\n />\n </svg>\n </div>`;\n }\n const angleRad = (this.progress * 0.95 * 3.6 * Math.PI) / 180;\n const x = 20 + 18 * Math.sin(angleRad);\n const y = 20 - 18 * Math.cos(angleRad);\n const largeArcFlag = angleRad > Math.PI ? 1 : 0;\n return html`<div class=\"progress-spinner\">\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"18\"\n stroke=\"var(--container-backdrop-color)\"\n stroke-width=\"4\"\n fill=\"none\"\n />\n <path\n d=\"M18 2 A18 18 0 ${largeArcFlag} 1 ${x} ${y}\"\n stroke=\"var(--instrument-enhanced-secondary-color)\"\n stroke-width=\"4\"\n stroke-linecap=\"round\"\n />\n </svg>\n </div>`;\n }\n\n override render() {\n return html`\n <button\n class=${classMap({\n wrapper: true,\n ['variant-' + this.variant]: true,\n activated: this.activated,\n 'corner-left': this.cornerLeft,\n 'corner-right': this.cornerRight,\n 'active-color': this.activeColor,\n 'has-label': this.hasLabel,\n wide: this.wide,\n progress: this.progress !== undefined,\n 'hide-divider': !this.showDivider,\n })}\n ?disabled=${this.disabled}\n part=\"wrapper\"\n >\n ${this.progress !== undefined ? this.progressSpinner : nothing}\n <div class=\"visible-wrapper\" part=\"visible-wrapper\">\n <div class=\"icon\" part=\"icon\">\n <slot></slot>\n </div>\n </div>\n ${this.hasLabel\n ? html`<div class=\"label\" part=\"label\">\n <slot name=\"label\"></slot>\n </div>`\n : nothing}\n </button>\n `;\n }\n\n static override styles = unsafeCSS(iconStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-icon-button': ObcIconButton;\n }\n}\n"],"names":["IconButtonVariant"],"mappings":";;;;;;;;;;;;;;;AAYO,IAAK,sCAAAA,uBAAL;AACLA,qBAAA,QAAA,IAAS;AACTA,qBAAA,QAAA,IAAS;AACTA,qBAAA,MAAA,IAAO;AACPA,qBAAA,aAAA,IAAc;AAJJ,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;AAyEL,IAAM,gBAAN,cAA4B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AA;AAAA,EADN,cAAc,iBAAiB;AAAA,GACnB,aAAA;"}
|
|
1
|
+
{"version":3,"file":"icon-button.js","sources":["../../../src/components/icon-button/icon-button.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport iconStyle from './icon-button.css?inline';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\n\n/**\n * The available visual variants for `<obc-icon-button>`.\n * - `normal`: Standard appearance for most use cases.\n * - `raised`: Adds elevation/shadow for prominence.\n * - `flat`: Minimal, backgroundless style for subtle actions.\n * - `integration`: For use in Integration Bar components\n */\nexport enum IconButtonVariant {\n normal = 'normal',\n raised = 'raised',\n flat = 'flat',\n integration = 'integration',\n}\n\n/**\n * `<obc-icon-button>` – An icon-only or icon-with-label button for quick actions.\n *\n * Provides a compact, visually prominent button that displays an icon (and optionally a label) for triggering actions. Commonly used for toolbars, navigation, or contextual actions where space is limited and a recognizable icon can represent the function.\n *\n * Appears as a circular or rounded button with configurable visual styles, supporting progress indication and various layout adaptations.\n *\n * ## Features\n * - **Variants:**\n * - `normal` (default): Standard appearance for most use cases.\n * - `raised`: Adds elevation/shadow for prominence.\n * - `flat`: Minimal, backgroundless style for subtle actions.\n * - `integration`: For use in Integration Bar components\n * - **Progress Indicator:**\n * - Shows a circular progress spinner overlay when the `progress` property is set (0–100). Useful for indicating loading or ongoing actions.\n * - **Label Support:**\n * - Optionally displays a text label below the icon when `hasLabel` is true and content is provided in the `label` slot.\n * - **Corner Alignment:**\n * - `cornerLeft` and `cornerRight` adjust the button's border radius and alignment for seamless placement at the start or end of a container.\n * - **Active State:**\n * - `activated` visually highlights the button as selected or toggled.\n * - `activeColor` applies an accent color for emphasis.\n * - **Wide Mode:**\n * - `wide` increases the button's width for easier touch targets or visual balance.\n * - **Disabled State:**\n * - `disabled` prevents interaction and visually dims the button.\n *\n * ## Usage Guidelines\n * - Use `obc-icon-button` for actions represented by icons, such as toolbars, navigation, or quick-access commands.\n * - Add a label (with `hasLabel` and the `label` slot) when clarity is needed or when icons alone may not be universally understood.\n * - Use the progress indicator for actions that take time, such as uploads or background processes.\n * - Prefer the `normal` variant for most cases; use `raised` to draw attention, and `flat` for less prominent or inline actions.\n * - For grouped or edge-aligned layouts, use `cornerLeft` or `cornerRight` to visually merge with container edges.\n * - Avoid using icon buttons for destructive or critical actions unless paired with clear feedback.\n * - **TODO(designer):** Clarify recommended icon sizes and when to use label vs. icon-only.\n *\n * ## Slots\n * | Slot Name | Renders When... | Purpose |\n * |-----------|---------------------|----------------------------------------------|\n * | (default) | Always | The icon to display (e.g., `<obi-search>`) |\n * | label | If `hasLabel` is set | Optional label text below the icon |\n *\n * ## Events\n * - Emits a standard `click` event (`onClick` handler in framework wrappers) when activated.\n *\n * ## Best Practices\n * - Ensure icons are clear and universally recognizable.\n * - For accessibility, provide an `aria-label` or descriptive label for the button's action.\n * - When using the progress indicator, avoid showing it for very short actions to prevent visual flicker.\n *\n * ## Example:\n * ```\n * <obc-icon-button variant=\"normal\">\n * <obi-search></obi-search>\n * </obc-icon-button>\n *\n * <obc-icon-button variant=\"normal\" hasLabel>\n * <obi-arrow></obi-arrow>\n * <span slot=\"label\">Next</span>\n * </obc-icon-button>\n * ```\n *\n * @slot - Icon slot (default): Place an icon such as <obi-search> here.\n * @slot label - Optional label shown below the icon when `hasLabel` is true.\n * @fires click - Fired when the button is clicked (if not disabled).\n */\n@customElement('obc-icon-button')\nexport class ObcIconButton extends LitElement {\n /**\n * Visual style of the button.\n * - `normal`: Standard appearance (default).\n * - `raised`: Elevated with shadow.\n * - `flat`: Minimal, backgroundless style.\n */\n @property({type: String}) variant: IconButtonVariant =\n IconButtonVariant.normal;\n\n /**\n * Whether the button is in an activated (selected/toggled) state.\n * Visually highlights the button to indicate selection.\n */\n @property({type: Boolean}) activated = false;\n\n /**\n * If true, aligns the button to the left edge and removes left border radius.\n * Useful for grouping or edge-aligned layouts.\n */\n @property({type: Boolean}) cornerLeft = false;\n\n /**\n * If true, aligns the button to the right edge and removes right border radius.\n * Useful for grouping or edge-aligned layouts.\n */\n @property({type: Boolean}) cornerRight = false;\n\n /**\n * Applies an accent color to the button for emphasis.\n * Used to visually distinguish active or important actions.\n */\n @property({type: Boolean}) activeColor = false;\n\n /**\n * Increases the button's width for larger touch targets or visual balance.\n */\n @property({type: Boolean}) wide = false;\n\n /**\n * Disables the button, preventing user interaction and dimming its appearance.\n */\n @property({type: Boolean}) disabled = false;\n\n /**\n * Shows a circular progress indicator overlay when set (0–100).\n * Use to indicate ongoing actions or loading states.\n * If undefined, no progress indicator is shown.\n */\n @property({type: Number}) progress: undefined | number = undefined;\n\n /**\n * If true, displays a label below the icon using the `label` slot.\n */\n @property({type: Boolean}) hasLabel: boolean = false;\n\n /** If false, and cornerLeft or cornerRight is true, the divider is not shown. */\n @property({type: Boolean, attribute: false}) showDivider = true;\n\n get progressSpinner() {\n if (this.progress === undefined) {\n return nothing;\n }\n if (this.progress === 100) {\n return html`<div class=\"progress-spinner\">\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"18\"\n stroke=\"#325B9A\"\n stroke-width=\"4\"\n fill=\"none\"\n />\n </svg>\n </div>`;\n }\n const angleRad = (this.progress * 0.95 * 3.6 * Math.PI) / 180;\n const x = 20 + 18 * Math.sin(angleRad);\n const y = 20 - 18 * Math.cos(angleRad);\n const largeArcFlag = angleRad > Math.PI ? 1 : 0;\n return html`<div class=\"progress-spinner\">\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"18\"\n stroke=\"var(--container-backdrop-color)\"\n stroke-width=\"4\"\n fill=\"none\"\n />\n <path\n d=\"M18 2 A18 18 0 ${largeArcFlag} 1 ${x} ${y}\"\n stroke=\"var(--instrument-enhanced-secondary-color)\"\n stroke-width=\"4\"\n stroke-linecap=\"round\"\n />\n </svg>\n </div>`;\n }\n\n override render() {\n return html`\n <button\n class=${classMap({\n wrapper: true,\n ['variant-' + this.variant]: true,\n activated: this.activated,\n 'corner-left': this.cornerLeft,\n 'corner-right': this.cornerRight,\n 'active-color': this.activeColor,\n 'has-label': this.hasLabel,\n wide: this.wide,\n progress: this.progress !== undefined,\n 'hide-divider': !this.showDivider,\n })}\n ?disabled=${this.disabled}\n part=\"wrapper\"\n >\n ${this.progress !== undefined ? this.progressSpinner : nothing}\n <div class=\"visible-wrapper\" part=\"visible-wrapper\">\n <div class=\"icon\" part=\"icon\">\n <slot></slot>\n </div>\n </div>\n ${this.hasLabel\n ? html`<div class=\"label\" part=\"label\">\n <slot name=\"label\"></slot>\n </div>`\n : nothing}\n </button>\n `;\n }\n\n static override styles = unsafeCSS(iconStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-icon-button': ObcIconButton;\n }\n}\n"],"names":["IconButtonVariant"],"mappings":";;;;;;;;;;;;;;;AAaO,IAAK,sCAAAA,uBAAL;AACLA,qBAAA,QAAA,IAAS;AACTA,qBAAA,QAAA,IAAS;AACTA,qBAAA,MAAA,IAAO;AACPA,qBAAA,aAAA,IAAc;AAJJ,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;AA0EL,IAAM,gBAAN,cAA4B,WAAW;AAAA,EAAvC,cAAA;AAAA,UAAA,GAAA,SAAA;AAOqB,SAAA,UACxB;AAMyB,SAAA,YAAY;AAMZ,SAAA,aAAa;AAMb,SAAA,cAAc;AAMd,SAAA,cAAc;AAKd,SAAA,OAAO;AAKP,SAAA,WAAW;AAOZ,SAAA,WAA+B;AAK9B,SAAA,WAAoB;AAGF,SAAA,cAAc;AAAA,EAAA;AAAA,EAE3D,IAAI,kBAAkB;AACpB,QAAI,KAAK,aAAa,QAAW;AAC/B,aAAO;AAAA,IACT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|
+
}
|
|
15
|
+
|
|
16
|
+
.wrapper {
|
|
17
|
+
display: flex;
|
|
18
|
+
padding: 0 var(--app-components-integration-system-topbar-margin-global);
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
align-items: center;
|
|
21
|
+
background: var(--integration-container-global-color);
|
|
22
|
+
box-shadow: var(--shadow-flat-x) var(--shadow-flat-y) var(--shadow-flat-blur)
|
|
23
|
+
var(--shadow-flat-spread) var(--shadow-flat-color);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.content-container {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex: 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.fleet-vessel-container {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: flex-start;
|
|
34
|
+
flex: 1 1 auto;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.fleet-button {
|
|
38
|
+
flex: initial;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.vessel-container {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex: 1 1 auto;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.integration-buttons-slot::slotted(obc-integration-button) {
|
|
47
|
+
flex: 1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.hug-buttons-slot::slotted(obc-integration-button) {
|
|
51
|
+
flex: 0 1 auto;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.home-button,
|
|
55
|
+
.link-button {
|
|
56
|
+
width: var(--app-components-integration-system-icon-button-touch-target);
|
|
57
|
+
height: var(--app-components-integration-system-icon-button-touch-target);
|
|
58
|
+
justify-content: center;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: 14px;
|
|
61
|
+
flex: initial;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.right-content-container {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-self: stretch;
|
|
67
|
+
align-items: center;
|
|
68
|
+
flex: initial;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.right-content-container.buttons-on-bar {
|
|
72
|
+
border-left: var(
|
|
73
|
+
--app-components-integration-system-navigation-item-horizontal-stroke-weight-right,
|
|
74
|
+
1px
|
|
75
|
+
)
|
|
76
|
+
solid
|
|
77
|
+
var(
|
|
78
|
+
--integration-beta-flat-enabled-border-color,
|
|
79
|
+
var(--integration-border-outline)
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.right-side-system-menu-container {
|
|
84
|
+
position: absolute;
|
|
85
|
+
position-anchor: --settings-menu-anchor;
|
|
86
|
+
top: anchor(bottom);
|
|
87
|
+
justify-self: anchor-center;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.vessel-button-placeholder {
|
|
91
|
+
flex: 1 1 auto;
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
export {
|
|
95
|
+
compentStyle as default
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=integration-bar.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-bar.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '../integration-tabs/integration-tabs.js';
|
|
3
|
+
import '../integration-button/integration-button.js';
|
|
4
|
+
import '../../components/clock/clock.js';
|
|
5
|
+
import '../../components/icon-button/icon-button.js';
|
|
6
|
+
import '../../icons/icon-palette-day-night-iec.js';
|
|
7
|
+
import '../../icons/icon-user.js';
|
|
8
|
+
import '../../icons/icon-configure.js';
|
|
9
|
+
import '../../icons/icon-notification.js';
|
|
10
|
+
import '../../icons/icon-home.js';
|
|
11
|
+
import '../../icons/icon-ship.js';
|
|
12
|
+
import '../../icons/icon-screen-desk.js';
|
|
13
|
+
import '../../icons/icon-alerts.js';
|
|
14
|
+
import '../../icons/icon-link.js';
|
|
15
|
+
/**
|
|
16
|
+
* `<obc-integration-bar>` – A compact top-level integration header for vessel and system navigation controls.
|
|
17
|
+
*
|
|
18
|
+
* Provides a configurable integration bar with home/navigation controls, optional fleet and vessel selection,
|
|
19
|
+
* and optional utility actions such as alerts, notifications, screen, system, dimming, user, and clock.
|
|
20
|
+
*
|
|
21
|
+
* @slot clock - Custom clock content, rendered when `showClock` is true
|
|
22
|
+
* @slot integration-buttons - Regular vessel integration buttons
|
|
23
|
+
* @slot hug-buttons - Compact vessel integration buttons; slotted integration buttons are forced to hug type
|
|
24
|
+
* @slot vessel-integration-menu - Modal that will appear achored below the fleet/vessel button. Typically an obc-integration-vessel-menu
|
|
25
|
+
* @property {IntegrationBarType} type - Integration bar mode for fleet/vessel presentation
|
|
26
|
+
* @property {boolean} hideHomeButton - Hides the home button when true
|
|
27
|
+
* @property {boolean} showClock - Toggles rendering of the clock slot
|
|
28
|
+
* @property {boolean} showLinkButton - Toggles visibility of link button
|
|
29
|
+
* @property {boolean} linkButtonActivated - Activated state of link button
|
|
30
|
+
* @property {boolean} showUserButton - Toggles visibility of user button
|
|
31
|
+
* @property {boolean} userButtonActivated - Activated state of user button
|
|
32
|
+
* @property {boolean} showDimmingButton - Toggles visibility of dimming button
|
|
33
|
+
* @property {boolean} dimmingButtonActivated - Activated state of dimming button
|
|
34
|
+
* @property {boolean} showSystemButton - Toggles visibility of system button
|
|
35
|
+
* @property {boolean} systemButtonActivated - Activated state of system button
|
|
36
|
+
* @property {boolean} showScreenButton - Toggles visibility of screen button
|
|
37
|
+
* @property {boolean} screenButtonActivated - Activated state of screen button
|
|
38
|
+
* @property {boolean} showNotificationButton - Toggles visibility of notification button
|
|
39
|
+
* @property {boolean} notificationButtonActivated - Activated state of notification button
|
|
40
|
+
* @property {boolean} showAlertButton - Toggles visibility of alert button
|
|
41
|
+
* @property {boolean} alertButtonActivated - Activated state of alert button
|
|
42
|
+
* @property {boolean} showFleetButton - Toggles visibility of fleet button
|
|
43
|
+
* @property {boolean} fleetButtonSelected - Selected state of fleet button
|
|
44
|
+
* @property {boolean} fleetButtonActivated - Active state of fleet button while selection is pending
|
|
45
|
+
* @property {string} fleetButtonLabel - Label for the fleet button
|
|
46
|
+
* @property {string} selectedVesselValue - Selected vessel value
|
|
47
|
+
* @property {string} activeVesselValue - Active vessel value while selection is pending
|
|
48
|
+
* @property {{value: string; label: string}[]} vesselSelectorOptions - Available vessel options
|
|
49
|
+
* @fires fleet-button-click - Fired when the fleet button is clicked
|
|
50
|
+
* @fires link-button-clicked - Fired when the link button is clicked
|
|
51
|
+
* @fires alert-button-clicked - Fired when the alert button is clicked
|
|
52
|
+
* @fires notification-button-clicked - Fired when the notification button is clicked
|
|
53
|
+
* @fires screen-button-clicked - Fired when the screen button is clicked
|
|
54
|
+
* @fires system-button-clicked - Fired when the system button is clicked
|
|
55
|
+
* @fires dimming-button-clicked - Fired when the dimming button is clicked
|
|
56
|
+
* @fires user-button-clicked - Fired when the user button is clicked
|
|
57
|
+
*/
|
|
58
|
+
export declare class ObcIntegrationBar extends LitElement {
|
|
59
|
+
hideHomeButton: boolean;
|
|
60
|
+
showClock: boolean;
|
|
61
|
+
showLinkButton: boolean;
|
|
62
|
+
linkButtonActivated: boolean;
|
|
63
|
+
showUserButton: boolean;
|
|
64
|
+
userButtonActivated: boolean;
|
|
65
|
+
showDimmingButton: boolean;
|
|
66
|
+
dimmingButtonActivated: boolean;
|
|
67
|
+
showSystemButton: boolean;
|
|
68
|
+
systemButtonActivated: boolean;
|
|
69
|
+
showScreenButton: boolean;
|
|
70
|
+
screenButtonActivated: boolean;
|
|
71
|
+
showNotificationButton: boolean;
|
|
72
|
+
notificationButtonActivated: boolean;
|
|
73
|
+
showAlertButton: boolean;
|
|
74
|
+
alertButtonActivated: boolean;
|
|
75
|
+
showFleetButton: boolean;
|
|
76
|
+
fleetButtonSelected: boolean;
|
|
77
|
+
fleetButtonActivated: boolean;
|
|
78
|
+
fleetButtonLabel: string;
|
|
79
|
+
private buttonsOnBar;
|
|
80
|
+
private onFleetButtonClick;
|
|
81
|
+
private onHugButtonsSlotChange;
|
|
82
|
+
private onButtonsSlotChange;
|
|
83
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
84
|
+
static styles: import('lit').CSSResult;
|
|
85
|
+
}
|
|
86
|
+
declare global {
|
|
87
|
+
interface HTMLElementTagNameMap {
|
|
88
|
+
'obc-integration-bar': ObcIntegrationBar;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=integration-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-bar.d.ts","sourceRoot":"","sources":["../../../src/integration-systems/integration-bar/integration-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAGzD,OAAO,yCAAyC,CAAC;AACjD,OAAO,6CAA6C,CAAC;AAKrD,OAAO,iCAAiC,CAAC;AACzC,OAAO,6CAA6C,CAAC;AACrD,OAAO,2CAA2C,CAAC;AACnD,OAAO,0BAA0B,CAAC;AAClC,OAAO,+BAA+B,CAAC;AACvC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAClC,OAAO,iCAAiC,CAAC;AACzC,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAIlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,qBACa,iBAAkB,SAAQ,UAAU;IACpB,cAAc,UAAS;IACvB,SAAS,UAAS;IAClB,cAAc,UAAS;IACvB,mBAAmB,UAAS;IAC5B,cAAc,UAAS;IACvB,mBAAmB,UAAS;IAC5B,iBAAiB,UAAS;IAC1B,sBAAsB,UAAS;IAC/B,gBAAgB,UAAS;IACzB,qBAAqB,UAAS;IAC9B,gBAAgB,UAAS;IACzB,qBAAqB,UAAS;IAC9B,sBAAsB,UAAS;IAC/B,2BAA2B,UAAS;IACpC,eAAe,UAAS;IACxB,oBAAoB,UAAS;IAC7B,eAAe,UAAS;IACxB,mBAAmB,UAAS;IAC5B,oBAAoB,UAAS;IAC9B,gBAAgB,SAAW;IAE5C,OAAO,CAAC,YAAY,CAAS;IAEtC,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,sBAAsB;IAe9B,OAAO,CAAC,mBAAmB;IAIlB,MAAM;IAmLf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,iBAAiB,CAAC;KAC1C;CACF"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { unsafeCSS, LitElement, nothing, html } from "lit";
|
|
2
|
+
import { customElement } from "../../decorator.js";
|
|
3
|
+
import compentStyle from "./integration-bar.css.js";
|
|
4
|
+
import "../integration-tabs/integration-tabs.js";
|
|
5
|
+
import { IntegrationButtonType, IntegrationButtonVariant } from "../integration-button/integration-button.js";
|
|
6
|
+
import "../../components/clock/clock.js";
|
|
7
|
+
import "../../components/icon-button/icon-button.js";
|
|
8
|
+
import "../../icons/icon-palette-day-night-iec.js";
|
|
9
|
+
import "../../icons/icon-user.js";
|
|
10
|
+
import "../../icons/icon-configure.js";
|
|
11
|
+
import "../../icons/icon-notification.js";
|
|
12
|
+
import "../../icons/icon-home.js";
|
|
13
|
+
import "../../icons/icon-ship.js";
|
|
14
|
+
import "../../icons/icon-screen-desk.js";
|
|
15
|
+
import "../../icons/icon-alerts.js";
|
|
16
|
+
import "../../icons/icon-link.js";
|
|
17
|
+
import { property, state } from "lit/decorators.js";
|
|
18
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
19
|
+
var __defProp = Object.defineProperty;
|
|
20
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
21
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
22
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
23
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
24
|
+
if (decorator = decorators[i])
|
|
25
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
26
|
+
if (kind && result) __defProp(target, key, result);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
let ObcIntegrationBar = class extends LitElement {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.hideHomeButton = false;
|
|
33
|
+
this.showClock = false;
|
|
34
|
+
this.showLinkButton = false;
|
|
35
|
+
this.linkButtonActivated = false;
|
|
36
|
+
this.showUserButton = false;
|
|
37
|
+
this.userButtonActivated = false;
|
|
38
|
+
this.showDimmingButton = false;
|
|
39
|
+
this.dimmingButtonActivated = false;
|
|
40
|
+
this.showSystemButton = false;
|
|
41
|
+
this.systemButtonActivated = false;
|
|
42
|
+
this.showScreenButton = false;
|
|
43
|
+
this.screenButtonActivated = false;
|
|
44
|
+
this.showNotificationButton = false;
|
|
45
|
+
this.notificationButtonActivated = false;
|
|
46
|
+
this.showAlertButton = false;
|
|
47
|
+
this.alertButtonActivated = false;
|
|
48
|
+
this.showFleetButton = false;
|
|
49
|
+
this.fleetButtonSelected = false;
|
|
50
|
+
this.fleetButtonActivated = false;
|
|
51
|
+
this.fleetButtonLabel = "Fleet";
|
|
52
|
+
this.buttonsOnBar = false;
|
|
53
|
+
}
|
|
54
|
+
onFleetButtonClick() {
|
|
55
|
+
this.dispatchEvent(new CustomEvent("fleet-button-click"));
|
|
56
|
+
}
|
|
57
|
+
onHugButtonsSlotChange(event) {
|
|
58
|
+
const slot = event.currentTarget;
|
|
59
|
+
const assignedElements = slot.assignedElements({ flatten: true });
|
|
60
|
+
assignedElements.forEach((element) => {
|
|
61
|
+
if (element.tagName === "OBC-INTEGRATION-BUTTON") {
|
|
62
|
+
const integrationButton = element;
|
|
63
|
+
integrationButton.type = IntegrationButtonType.hug;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
this.buttonsOnBar = true;
|
|
67
|
+
}
|
|
68
|
+
onButtonsSlotChange() {
|
|
69
|
+
this.buttonsOnBar = true;
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
const isFleetButtonAnchored = this.fleetButtonActivated;
|
|
73
|
+
return html`
|
|
74
|
+
<nav class="wrapper">
|
|
75
|
+
<div class="content-container">
|
|
76
|
+
${!this.hideHomeButton ? html`<obc-icon-button class="home-button" variant="integration">
|
|
77
|
+
<obi-home></obi-home>
|
|
78
|
+
</obc-icon-button>` : null}
|
|
79
|
+
${this.showLinkButton ? html`<obc-icon-button
|
|
80
|
+
class=${classMap({
|
|
81
|
+
"link-button": true,
|
|
82
|
+
activated: this.linkButtonActivated
|
|
83
|
+
})}
|
|
84
|
+
part="link-button"
|
|
85
|
+
variant="integration"
|
|
86
|
+
@click=${() => this.dispatchEvent(new CustomEvent("link-button-clicked"))}
|
|
87
|
+
?activated=${this.linkButtonActivated}
|
|
88
|
+
>
|
|
89
|
+
<obi-link></obi-link>
|
|
90
|
+
</obc-icon-button>` : null}
|
|
91
|
+
<div class=${classMap({ "fleet-vessel-container": true })}>
|
|
92
|
+
${this.showFleetButton ? html`<obc-integration-button
|
|
93
|
+
class="fleet-button"
|
|
94
|
+
.variant=${IntegrationButtonVariant.normal}
|
|
95
|
+
?selected=${this.fleetButtonSelected}
|
|
96
|
+
?activated=${this.fleetButtonActivated}
|
|
97
|
+
style=${isFleetButtonAnchored ? "anchor-name: --integration-menu-anchor;" : ""}
|
|
98
|
+
@click=${() => this.onFleetButtonClick()}
|
|
99
|
+
>
|
|
100
|
+
<span slot="label">${this.fleetButtonLabel}</span>
|
|
101
|
+
</obc-integration-button>` : nothing}
|
|
102
|
+
<div class="vessel-container">
|
|
103
|
+
${this.buttonsOnBar ? nothing : html`<div class="vessel-button-placeholder"></div>`}
|
|
104
|
+
<slot
|
|
105
|
+
class="hug-buttons-slot"
|
|
106
|
+
name="hug-buttons"
|
|
107
|
+
@slotchange=${this.onHugButtonsSlotChange}
|
|
108
|
+
></slot>
|
|
109
|
+
<slot
|
|
110
|
+
class="integration-buttons-slot"
|
|
111
|
+
name="integration-buttons"
|
|
112
|
+
@slotchange=${this.onButtonsSlotChange}
|
|
113
|
+
></slot>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
<div
|
|
118
|
+
class=${classMap({
|
|
119
|
+
"buttons-on-bar": this.buttonsOnBar,
|
|
120
|
+
"right-content-container": true
|
|
121
|
+
})}
|
|
122
|
+
>
|
|
123
|
+
${this.showAlertButton ? html`<obc-icon-button
|
|
124
|
+
class=${classMap({
|
|
125
|
+
"alert-button": true,
|
|
126
|
+
activated: this.alertButtonActivated
|
|
127
|
+
})}
|
|
128
|
+
part="alert-button"
|
|
129
|
+
variant="integration"
|
|
130
|
+
style=${this.alertButtonActivated ? "anchor-name: --settings-menu-anchor;" : ""}
|
|
131
|
+
@click=${() => this.dispatchEvent(new CustomEvent("alert-button-clicked"))}
|
|
132
|
+
?activated=${this.alertButtonActivated}
|
|
133
|
+
>
|
|
134
|
+
<obi-alerts></obi-alerts>
|
|
135
|
+
</obc-icon-button>` : null}
|
|
136
|
+
${this.showNotificationButton ? html`<obc-icon-button
|
|
137
|
+
class=${classMap({
|
|
138
|
+
"notification-button": true,
|
|
139
|
+
activated: this.notificationButtonActivated
|
|
140
|
+
})}
|
|
141
|
+
part="notification-button"
|
|
142
|
+
variant="integration"
|
|
143
|
+
style=${this.notificationButtonActivated ? "anchor-name: --settings-menu-anchor;" : ""}
|
|
144
|
+
@click=${() => this.dispatchEvent(
|
|
145
|
+
new CustomEvent("notification-button-clicked")
|
|
146
|
+
)}
|
|
147
|
+
?activated=${this.notificationButtonActivated}
|
|
148
|
+
>
|
|
149
|
+
<obi-notification></obi-notification>
|
|
150
|
+
</obc-icon-button>` : null}
|
|
151
|
+
${this.showScreenButton ? html`<obc-icon-button
|
|
152
|
+
class=${classMap({
|
|
153
|
+
"screen-button": true,
|
|
154
|
+
activated: this.screenButtonActivated
|
|
155
|
+
})}
|
|
156
|
+
part="screen-button"
|
|
157
|
+
variant="integration"
|
|
158
|
+
style=${this.screenButtonActivated ? "anchor-name: --settings-menu-anchor;" : ""}
|
|
159
|
+
@click=${() => this.dispatchEvent(new CustomEvent("screen-button-clicked"))}
|
|
160
|
+
?activated=${this.screenButtonActivated}
|
|
161
|
+
>
|
|
162
|
+
<obi-screen-desk></obi-screen-desk>
|
|
163
|
+
</obc-icon-button>` : null}
|
|
164
|
+
${this.showSystemButton ? html`<obc-icon-button
|
|
165
|
+
class=${classMap({
|
|
166
|
+
"system-button": true,
|
|
167
|
+
activated: this.systemButtonActivated
|
|
168
|
+
})}
|
|
169
|
+
part="system-button"
|
|
170
|
+
variant="integration"
|
|
171
|
+
style=${this.systemButtonActivated ? "anchor-name: --settings-menu-anchor;" : ""}
|
|
172
|
+
@click=${() => this.dispatchEvent(new CustomEvent("system-button-clicked"))}
|
|
173
|
+
?activated=${this.systemButtonActivated}
|
|
174
|
+
>
|
|
175
|
+
<obi-configure></obi-configure>
|
|
176
|
+
</obc-icon-button>` : null}
|
|
177
|
+
${this.showDimmingButton ? html`<obc-icon-button
|
|
178
|
+
class=${classMap({
|
|
179
|
+
"dimming-button": true,
|
|
180
|
+
activated: this.dimmingButtonActivated
|
|
181
|
+
})}
|
|
182
|
+
part="dimming-button"
|
|
183
|
+
variant="integration"
|
|
184
|
+
style=${this.dimmingButtonActivated ? "anchor-name: --settings-menu-anchor;" : ""}
|
|
185
|
+
@click=${() => this.dispatchEvent(new CustomEvent("dimming-button-clicked"))}
|
|
186
|
+
?activated=${this.dimmingButtonActivated}
|
|
187
|
+
>
|
|
188
|
+
<obi-palette-day-night-iec></obi-palette-day-night-iec>
|
|
189
|
+
</obc-icon-button>` : null}
|
|
190
|
+
${this.showUserButton ? html`<obc-icon-button
|
|
191
|
+
class=${classMap({
|
|
192
|
+
"user-button": true,
|
|
193
|
+
activated: this.userButtonActivated
|
|
194
|
+
})}
|
|
195
|
+
part="user-button"
|
|
196
|
+
variant="integration"
|
|
197
|
+
style=${this.userButtonActivated ? "anchor-name: --settings-menu-anchor;" : ""}
|
|
198
|
+
@click=${() => this.dispatchEvent(new CustomEvent("user-button-clicked"))}
|
|
199
|
+
?activated=${this.userButtonActivated}
|
|
200
|
+
>
|
|
201
|
+
<obi-user></obi-user>
|
|
202
|
+
</obc-icon-button>` : null}
|
|
203
|
+
${this.showClock ? html`<slot name="clock"></slot>` : null}
|
|
204
|
+
</div>
|
|
205
|
+
</nav>
|
|
206
|
+
`;
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
ObcIntegrationBar.styles = unsafeCSS(compentStyle);
|
|
210
|
+
__decorateClass([
|
|
211
|
+
property({ type: Boolean })
|
|
212
|
+
], ObcIntegrationBar.prototype, "hideHomeButton", 2);
|
|
213
|
+
__decorateClass([
|
|
214
|
+
property({ type: Boolean })
|
|
215
|
+
], ObcIntegrationBar.prototype, "showClock", 2);
|
|
216
|
+
__decorateClass([
|
|
217
|
+
property({ type: Boolean })
|
|
218
|
+
], ObcIntegrationBar.prototype, "showLinkButton", 2);
|
|
219
|
+
__decorateClass([
|
|
220
|
+
property({ type: Boolean })
|
|
221
|
+
], ObcIntegrationBar.prototype, "linkButtonActivated", 2);
|
|
222
|
+
__decorateClass([
|
|
223
|
+
property({ type: Boolean })
|
|
224
|
+
], ObcIntegrationBar.prototype, "showUserButton", 2);
|
|
225
|
+
__decorateClass([
|
|
226
|
+
property({ type: Boolean })
|
|
227
|
+
], ObcIntegrationBar.prototype, "userButtonActivated", 2);
|
|
228
|
+
__decorateClass([
|
|
229
|
+
property({ type: Boolean })
|
|
230
|
+
], ObcIntegrationBar.prototype, "showDimmingButton", 2);
|
|
231
|
+
__decorateClass([
|
|
232
|
+
property({ type: Boolean })
|
|
233
|
+
], ObcIntegrationBar.prototype, "dimmingButtonActivated", 2);
|
|
234
|
+
__decorateClass([
|
|
235
|
+
property({ type: Boolean })
|
|
236
|
+
], ObcIntegrationBar.prototype, "showSystemButton", 2);
|
|
237
|
+
__decorateClass([
|
|
238
|
+
property({ type: Boolean })
|
|
239
|
+
], ObcIntegrationBar.prototype, "systemButtonActivated", 2);
|
|
240
|
+
__decorateClass([
|
|
241
|
+
property({ type: Boolean })
|
|
242
|
+
], ObcIntegrationBar.prototype, "showScreenButton", 2);
|
|
243
|
+
__decorateClass([
|
|
244
|
+
property({ type: Boolean })
|
|
245
|
+
], ObcIntegrationBar.prototype, "screenButtonActivated", 2);
|
|
246
|
+
__decorateClass([
|
|
247
|
+
property({ type: Boolean })
|
|
248
|
+
], ObcIntegrationBar.prototype, "showNotificationButton", 2);
|
|
249
|
+
__decorateClass([
|
|
250
|
+
property({ type: Boolean })
|
|
251
|
+
], ObcIntegrationBar.prototype, "notificationButtonActivated", 2);
|
|
252
|
+
__decorateClass([
|
|
253
|
+
property({ type: Boolean })
|
|
254
|
+
], ObcIntegrationBar.prototype, "showAlertButton", 2);
|
|
255
|
+
__decorateClass([
|
|
256
|
+
property({ type: Boolean })
|
|
257
|
+
], ObcIntegrationBar.prototype, "alertButtonActivated", 2);
|
|
258
|
+
__decorateClass([
|
|
259
|
+
property({ type: Boolean })
|
|
260
|
+
], ObcIntegrationBar.prototype, "showFleetButton", 2);
|
|
261
|
+
__decorateClass([
|
|
262
|
+
property({ type: Boolean })
|
|
263
|
+
], ObcIntegrationBar.prototype, "fleetButtonSelected", 2);
|
|
264
|
+
__decorateClass([
|
|
265
|
+
property({ type: Boolean })
|
|
266
|
+
], ObcIntegrationBar.prototype, "fleetButtonActivated", 2);
|
|
267
|
+
__decorateClass([
|
|
268
|
+
property({ type: String })
|
|
269
|
+
], ObcIntegrationBar.prototype, "fleetButtonLabel", 2);
|
|
270
|
+
__decorateClass([
|
|
271
|
+
state()
|
|
272
|
+
], ObcIntegrationBar.prototype, "buttonsOnBar", 2);
|
|
273
|
+
ObcIntegrationBar = __decorateClass([
|
|
274
|
+
customElement("obc-integration-bar")
|
|
275
|
+
], ObcIntegrationBar);
|
|
276
|
+
export {
|
|
277
|
+
ObcIntegrationBar
|
|
278
|
+
};
|
|
279
|
+
//# sourceMappingURL=integration-bar.js.map
|