@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.148 → 2.0.0-next.149
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 +119 -42
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +154 -19
- package/dist/components/icon-button/icon-button.d.ts +3 -0
- package/dist/components/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/icon-button/icon-button.js +6 -0
- package/dist/components/icon-button/icon-button.js.map +1 -1
- package/dist/components/top-bar/top-bar.d.ts.map +1 -1
- package/dist/components/top-bar/top-bar.js +8 -0
- package/dist/components/top-bar/top-bar.js.map +1 -1
- package/dist/generated/locales/es-419.d.ts +11 -1
- package/dist/generated/locales/es-419.d.ts.map +1 -1
- package/dist/generated/locales/es-419.js +11 -1
- package/dist/generated/locales/es-419.js.map +1 -1
- package/dist/generated/locales/fi-FI.d.ts +11 -1
- package/dist/generated/locales/fi-FI.d.ts.map +1 -1
- package/dist/generated/locales/fi-FI.js +11 -1
- package/dist/generated/locales/fi-FI.js.map +1 -1
- package/dist/integration-systems/integration-bar/integration-bar.d.ts +8 -8
- package/dist/integration-systems/integration-bar/integration-bar.d.ts.map +1 -1
- package/dist/integration-systems/integration-bar/integration-bar.js +13 -1
- package/dist/integration-systems/integration-bar/integration-bar.js.map +1 -1
- package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.d.ts +72 -7
- package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.d.ts.map +1 -1
- package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.js +99 -41
- package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.js.map +1 -1
- package/package.json +1 -1
- package/src/components/icon-button/icon-button.spec.ts +52 -0
- package/src/components/icon-button/icon-button.ts +7 -0
- package/src/components/top-bar/top-bar.ts +10 -0
- package/src/generated/locales/es-419.ts +11 -1
- package/src/generated/locales/fi-FI.ts +11 -1
- package/src/integration-systems/integration-bar/integration-bar.ts +21 -9
- package/src/integration-systems/integration-bar-dropdown/integration-bar-dropdown.stories.ts +70 -3
- package/src/integration-systems/integration-bar-dropdown/integration-bar-dropdown.ts +138 -52
package/custom-elements.json
CHANGED
|
@@ -6192,7 +6192,7 @@
|
|
|
6192
6192
|
{
|
|
6193
6193
|
"kind": "variable",
|
|
6194
6194
|
"name": "ObcIconButton",
|
|
6195
|
-
"default": "class extends LitElement { constructor() { super(...arguments); this.variant = \"normal\"; this.activated = false; this.cornerLeft = false; this.cornerRight = false; this.activeColor = false; this.wide = false; this.disabled = false; this.progress = void 0; this.hasLabel = false; this.showDivider = true; } get progressSpinner() { if (this.progress === void 0) { return nothing; } if (this.progress === 100) { return html`<div class=\"progress-spinner\"> <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" > <circle cx=\"20\" cy=\"20\" r=\"18\" stroke=\"#325B9A\" stroke-width=\"4\" fill=\"none\" /> </svg> </div>`; } const angleRad = degToRad(this.progress * 0.95 * 3.6); const x = 20 + 18 * Math.sin(angleRad); const y = 20 - 18 * Math.cos(angleRad); const largeArcFlag = angleRad > Math.PI ? 1 : 0; return html`<div class=\"progress-spinner\"> <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" > <circle cx=\"20\" cy=\"20\" r=\"18\" stroke=\"var(--container-backdrop-color)\" stroke-width=\"4\" fill=\"none\" /> <path d=\"M18 2 A18 18 0 ${largeArcFlag} 1 ${x} ${y}\" stroke=\"var(--instrument-enhanced-secondary-color)\" stroke-width=\"4\" stroke-linecap=\"round\" /> </svg> </div>`; } render() { return html` <button class=${classMap({ wrapper: true, [\"variant-\" + this.variant]: true, activated: this.activated, \"corner-left\": this.cornerLeft, \"corner-right\": this.cornerRight, \"active-color\": this.activeColor, \"has-label\": this.hasLabel, wide: this.wide, progress: this.progress !== void 0, \"hide-divider\": !this.showDivider })} ?disabled=${this.disabled} part=\"wrapper\" > ${this.progress !== void 0 ? this.progressSpinner : nothing} <div class=\"visible-wrapper\" part=\"visible-wrapper\"> <div class=\"icon\" part=\"icon\"> <slot></slot> </div> </div> ${this.hasLabel ? html`<div class=\"label\" part=\"label\"> <slot name=\"label\"></slot> </div>` : nothing} </button> `; } }"
|
|
6195
|
+
"default": "class extends LitElement { constructor() { super(...arguments); this.variant = \"normal\"; this.activated = false; this.cornerLeft = false; this.cornerRight = false; this.activeColor = false; this.wide = false; this.disabled = false; this.progress = void 0; this.hasLabel = false; this.showDivider = true; this.ariaLabel = null; } get progressSpinner() { if (this.progress === void 0) { return nothing; } if (this.progress === 100) { return html`<div class=\"progress-spinner\"> <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" > <circle cx=\"20\" cy=\"20\" r=\"18\" stroke=\"#325B9A\" stroke-width=\"4\" fill=\"none\" /> </svg> </div>`; } const angleRad = degToRad(this.progress * 0.95 * 3.6); const x = 20 + 18 * Math.sin(angleRad); const y = 20 - 18 * Math.cos(angleRad); const largeArcFlag = angleRad > Math.PI ? 1 : 0; return html`<div class=\"progress-spinner\"> <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" > <circle cx=\"20\" cy=\"20\" r=\"18\" stroke=\"var(--container-backdrop-color)\" stroke-width=\"4\" fill=\"none\" /> <path d=\"M18 2 A18 18 0 ${largeArcFlag} 1 ${x} ${y}\" stroke=\"var(--instrument-enhanced-secondary-color)\" stroke-width=\"4\" stroke-linecap=\"round\" /> </svg> </div>`; } render() { return html` <button class=${classMap({ wrapper: true, [\"variant-\" + this.variant]: true, activated: this.activated, \"corner-left\": this.cornerLeft, \"corner-right\": this.cornerRight, \"active-color\": this.activeColor, \"has-label\": this.hasLabel, wide: this.wide, progress: this.progress !== void 0, \"hide-divider\": !this.showDivider })} ?disabled=${this.disabled} aria-label=${ifDefined(this.ariaLabel ?? void 0)} part=\"wrapper\" > ${this.progress !== void 0 ? this.progressSpinner : nothing} <div class=\"visible-wrapper\" part=\"visible-wrapper\"> <div class=\"icon\" part=\"icon\"> <slot></slot> </div> </div> ${this.hasLabel ? html`<div class=\"label\" part=\"label\"> <slot name=\"label\"></slot> </div>` : nothing} </button> `; } }"
|
|
6196
6196
|
}
|
|
6197
6197
|
],
|
|
6198
6198
|
"exports": [
|
|
@@ -8220,7 +8220,7 @@
|
|
|
8220
8220
|
{
|
|
8221
8221
|
"kind": "variable",
|
|
8222
8222
|
"name": "ObcTopBar",
|
|
8223
|
-
"default": "class extends LitElement { constructor() { super(...arguments); this.appTitle = \"App\"; this.pageName = \"Page\"; this.menuButtonIcon = \"menu\"; this.menuButtonActivated = false; this.dimmingButtonActivated = false; this.appsButtonActivated = false; this.leftMoreButtonActivated = false; this.userButtonActivated = false; this.userButtonDisabled = false; this.tall = false; this.wideMenuButton = false; this.showAppsButton = false; this.showDimmingButton = false; this.showUserButton = false; this.showClock = false; this.showDate = false; this.showAppIcon = false; this.inactive = false; this.appButtonBreakpointPx = 500; this.dimmingButtonBreakpointPx = 500; this.appTitleBreakpointPx = 500; this.userButtonBreakpointPx = 500; this.appIconBreakpointPx = 500; this.settings = false; this.breadcrumbItems = []; this.leftButtonEvent = null; this.leftButtonTimeout = null; this.isLeftButtonDown = false; this.isEmergencyBrightness = false; } dimmingButtonClicked() { this.dispatchEvent(new CustomEvent(\"dimming-button-clicked\")); } appsButtonClicked() { this.dispatchEvent(new CustomEvent(\"apps-button-clicked\")); } leftMoreButtonClicked() { this.dispatchEvent(new CustomEvent(\"left-more-button-clicked\")); } userButtonClicked() { this.dispatchEvent(new CustomEvent(\"user-button-clicked\")); } leftButtonDown(event) { this.leftButtonEvent = event; this.isLeftButtonDown = true; this.leftButtonTimeout = setTimeout(() => { this.leftButtonEvent = null; this.dispatchEvent(new CustomEvent(\"emergency-brightness-start\")); this.isEmergencyBrightness = true; }, 500); } leftButtonUp() { if (this.leftButtonEvent) { this.dispatchEvent(this.leftButtonEvent); this.leftButtonEvent = null; } if (this.leftButtonTimeout) { clearTimeout(this.leftButtonTimeout); this.leftButtonTimeout = null; } if (this.isEmergencyBrightness) { this.dispatchEvent(new CustomEvent(\"emergency-brightness-stop\")); this.isEmergencyBrightness = false; } this.isLeftButtonDown = false; } leftButtonLeave() { if (!this.isLeftButtonDown) return; if (this.leftButtonTimeout) { clearInterval(this.leftButtonTimeout); this.leftButtonTimeout = null; } if (this.isEmergencyBrightness) { this.dispatchEvent(new CustomEvent(\"emergency-brightness-stop\")); this.isEmergencyBrightness = false; } this.isLeftButtonDown = false; } render() { const leftGroup = []; if (this.settings) { leftGroup.push( html`<div class=\"menu-button\"> <obc-icon-button variant=\"flat\" @pointerdown=${() => this.leftButtonDown(new CustomEvent(\"close\"))} @pointerup=${() => this.leftButtonUp()} @pointerleave=${() => this.leftButtonLeave()} > <obi-close-google></obi-close-google> </obc-icon-button> </div>` ); leftGroup.push( html`<obc-icon-button variant=\"flat\" @click=${() => this.dispatchEvent(new CustomEvent(\"back\"))} > <obi-arrow-left-google></obi-arrow-left-google> </obc-icon-button>` ); leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`); leftGroup.push( html`<obc-breadcrumb .items=${this.breadcrumbItems} @breadcrumb-click=${(e) => this.dispatchEvent( new CustomEvent(\"breadcrumb-click\", { detail: e.detail }) )} ></obc-breadcrumb>` ); } else { if (!this.inactive) { leftGroup.push( html`<div class=\"menu-button ${this.wideMenuButton ? \"wide\" : null}\"> <obc-icon-button variant=\"flat\" @pointerdown=${() => this.leftButtonDown(new CustomEvent(\"menu-button-clicked\"))} @pointerup=${() => this.leftButtonUp()} @pointerleave=${() => this.leftButtonLeave()} ?activated=${this.menuButtonActivated} > ${this.menuButtonIcon === \"menu\" ? html`<obi-menu-iec></obi-menu-iec>` : html`<obi-home></obi-home>`} </obc-icon-button> </div>` ); } if (this.showAppIcon) { leftGroup.push( html`<div class=\"app-icon\"><slot name=\"app-icon\"></slot></div>` ); } leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`); leftGroup.push(html`<div class=\"page-name\">${this.pageName}</div>`); leftGroup.push(html`<slot name=\"command-button\"></slot>`); } const breakpointMoreButton = Math.max( this.appButtonBreakpointPx, this.dimmingButtonBreakpointPx ); return html` <style> @media (max-width: ${breakpointMoreButton}px) { .left-more-button { display: revert !important; } .group.left > * { margin-right: 4px; margin-left: 4px; } } @media (max-width: ${this.appButtonBreakpointPx}px) { .apps-button { display: none; } } @media (max-width: ${this.dimmingButtonBreakpointPx}px) { .dimming-button { display: none; } } @media (max-width: ${this.appTitleBreakpointPx}px) { .title { display: none !important; /* the stylesheet's display wins over this inline rule otherwise */ } } @media (max-width: ${this.userButtonBreakpointPx}px) { .user-button { display: none; } } @media (max-width: ${this.appIconBreakpointPx}px) { .app-icon { display: none; } } </style> <nav class=${classMap({ wrapper: true, inactive: this.inactive, settings: this.settings, tall: this.tall })} role=\"menubar\" > <div class=\"left group\">${leftGroup}</div> <div class=\"right group\"> <div class=\"alert-container\"> <slot name=\"alerts\"></slot> </div> ${this.showDimmingButton && !this.inactive ? html`<obc-icon-button class=\"dimming-button\" part=\"dimming-button\" variant=\"flat\" @click=${this.dimmingButtonClicked} ?activated=${this.dimmingButtonActivated} > <obi-palette-day-night-iec></obi-palette-day-night-iec> </obc-icon-button>` : null} ${this.showUserButton && !this.inactive ? html`<obc-icon-button class=\"user-button\" variant=\"flat\" part=\"user-button\" @click=${this.userButtonClicked} ?activated=${this.userButtonActivated} ?disabled=${this.userButtonDisabled} > <obi-user></obi-user> </obc-icon-button>` : null} ${this.showAppsButton && !this.inactive ? html`<obc-icon-button class=\"apps-button\" variant=\"flat\" part=\"apps-button\" @click=${this.appsButtonClicked} ?activated=${this.appsButtonActivated} > <obi-applications></obi-applications> </obc-icon-button>` : null} ${this.showClock ? html`<slot name=\"clock\"></slot>` : null} ${!this.inactive ? html`<obc-icon-button class=\"left-more-button\" part=\"left-more-button\" variant=\"flat\" @click=${this.leftMoreButtonClicked} ?activated=${this.leftMoreButtonActivated} > <obi-more-vertical-google></obi-more-vertical-google> </obc-icon-button>` : null} </div> </nav> `; } }"
|
|
8223
|
+
"default": "class extends LitElement { constructor() { super(...arguments); this.appTitle = \"App\"; this.pageName = \"Page\"; this.menuButtonIcon = \"menu\"; this.menuButtonActivated = false; this.dimmingButtonActivated = false; this.appsButtonActivated = false; this.leftMoreButtonActivated = false; this.userButtonActivated = false; this.userButtonDisabled = false; this.tall = false; this.wideMenuButton = false; this.showAppsButton = false; this.showDimmingButton = false; this.showUserButton = false; this.showClock = false; this.showDate = false; this.showAppIcon = false; this.inactive = false; this.appButtonBreakpointPx = 500; this.dimmingButtonBreakpointPx = 500; this.appTitleBreakpointPx = 500; this.userButtonBreakpointPx = 500; this.appIconBreakpointPx = 500; this.settings = false; this.breadcrumbItems = []; this.leftButtonEvent = null; this.leftButtonTimeout = null; this.isLeftButtonDown = false; this.isEmergencyBrightness = false; } dimmingButtonClicked() { this.dispatchEvent(new CustomEvent(\"dimming-button-clicked\")); } appsButtonClicked() { this.dispatchEvent(new CustomEvent(\"apps-button-clicked\")); } leftMoreButtonClicked() { this.dispatchEvent(new CustomEvent(\"left-more-button-clicked\")); } userButtonClicked() { this.dispatchEvent(new CustomEvent(\"user-button-clicked\")); } leftButtonDown(event) { this.leftButtonEvent = event; this.isLeftButtonDown = true; this.leftButtonTimeout = setTimeout(() => { this.leftButtonEvent = null; this.dispatchEvent(new CustomEvent(\"emergency-brightness-start\")); this.isEmergencyBrightness = true; }, 500); } leftButtonUp() { if (this.leftButtonEvent) { this.dispatchEvent(this.leftButtonEvent); this.leftButtonEvent = null; } if (this.leftButtonTimeout) { clearTimeout(this.leftButtonTimeout); this.leftButtonTimeout = null; } if (this.isEmergencyBrightness) { this.dispatchEvent(new CustomEvent(\"emergency-brightness-stop\")); this.isEmergencyBrightness = false; } this.isLeftButtonDown = false; } leftButtonLeave() { if (!this.isLeftButtonDown) return; if (this.leftButtonTimeout) { clearInterval(this.leftButtonTimeout); this.leftButtonTimeout = null; } if (this.isEmergencyBrightness) { this.dispatchEvent(new CustomEvent(\"emergency-brightness-stop\")); this.isEmergencyBrightness = false; } this.isLeftButtonDown = false; } render() { const leftGroup = []; if (this.settings) { leftGroup.push( html`<div class=\"menu-button\"> <obc-icon-button variant=\"flat\" aria-label=${msg(\"Close\")} @pointerdown=${() => this.leftButtonDown(new CustomEvent(\"close\"))} @pointerup=${() => this.leftButtonUp()} @pointerleave=${() => this.leftButtonLeave()} > <obi-close-google></obi-close-google> </obc-icon-button> </div>` ); leftGroup.push( html`<obc-icon-button variant=\"flat\" aria-label=${msg(\"Back\")} @click=${() => this.dispatchEvent(new CustomEvent(\"back\"))} > <obi-arrow-left-google></obi-arrow-left-google> </obc-icon-button>` ); leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`); leftGroup.push( html`<obc-breadcrumb .items=${this.breadcrumbItems} @breadcrumb-click=${(e) => this.dispatchEvent( new CustomEvent(\"breadcrumb-click\", { detail: e.detail }) )} ></obc-breadcrumb>` ); } else { if (!this.inactive) { leftGroup.push( html`<div class=\"menu-button ${this.wideMenuButton ? \"wide\" : null}\"> <obc-icon-button variant=\"flat\" aria-label=${this.menuButtonIcon === \"menu\" ? msg(\"Menu\") : msg(\"Home\")} @pointerdown=${() => this.leftButtonDown(new CustomEvent(\"menu-button-clicked\"))} @pointerup=${() => this.leftButtonUp()} @pointerleave=${() => this.leftButtonLeave()} ?activated=${this.menuButtonActivated} > ${this.menuButtonIcon === \"menu\" ? html`<obi-menu-iec></obi-menu-iec>` : html`<obi-home></obi-home>`} </obc-icon-button> </div>` ); } if (this.showAppIcon) { leftGroup.push( html`<div class=\"app-icon\"><slot name=\"app-icon\"></slot></div>` ); } leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`); leftGroup.push(html`<div class=\"page-name\">${this.pageName}</div>`); leftGroup.push(html`<slot name=\"command-button\"></slot>`); } const breakpointMoreButton = Math.max( this.appButtonBreakpointPx, this.dimmingButtonBreakpointPx ); return html` <style> @media (max-width: ${breakpointMoreButton}px) { .left-more-button { display: revert !important; } .group.left > * { margin-right: 4px; margin-left: 4px; } } @media (max-width: ${this.appButtonBreakpointPx}px) { .apps-button { display: none; } } @media (max-width: ${this.dimmingButtonBreakpointPx}px) { .dimming-button { display: none; } } @media (max-width: ${this.appTitleBreakpointPx}px) { .title { display: none !important; /* the stylesheet's display wins over this inline rule otherwise */ } } @media (max-width: ${this.userButtonBreakpointPx}px) { .user-button { display: none; } } @media (max-width: ${this.appIconBreakpointPx}px) { .app-icon { display: none; } } </style> <nav class=${classMap({ wrapper: true, inactive: this.inactive, settings: this.settings, tall: this.tall })} role=\"menubar\" > <div class=\"left group\">${leftGroup}</div> <div class=\"right group\"> <div class=\"alert-container\"> <slot name=\"alerts\"></slot> </div> ${this.showDimmingButton && !this.inactive ? html`<obc-icon-button class=\"dimming-button\" part=\"dimming-button\" variant=\"flat\" aria-label=${msg(\"Dimming\")} @click=${this.dimmingButtonClicked} ?activated=${this.dimmingButtonActivated} > <obi-palette-day-night-iec></obi-palette-day-night-iec> </obc-icon-button>` : null} ${this.showUserButton && !this.inactive ? html`<obc-icon-button class=\"user-button\" variant=\"flat\" part=\"user-button\" aria-label=${msg(\"User\")} @click=${this.userButtonClicked} ?activated=${this.userButtonActivated} ?disabled=${this.userButtonDisabled} > <obi-user></obi-user> </obc-icon-button>` : null} ${this.showAppsButton && !this.inactive ? html`<obc-icon-button class=\"apps-button\" variant=\"flat\" part=\"apps-button\" aria-label=${msg(\"Apps\")} @click=${this.appsButtonClicked} ?activated=${this.appsButtonActivated} > <obi-applications></obi-applications> </obc-icon-button>` : null} ${this.showClock ? html`<slot name=\"clock\"></slot>` : null} ${!this.inactive ? html`<obc-icon-button class=\"left-more-button\" part=\"left-more-button\" variant=\"flat\" aria-label=${msg(\"More\")} @click=${this.leftMoreButtonClicked} ?activated=${this.leftMoreButtonActivated} > <obi-more-vertical-google></obi-more-vertical-google> </obc-icon-button>` : null} </div> </nav> `; } }"
|
|
8224
8224
|
}
|
|
8225
8225
|
],
|
|
8226
8226
|
"exports": [
|
|
@@ -8505,7 +8505,7 @@
|
|
|
8505
8505
|
{
|
|
8506
8506
|
"kind": "variable",
|
|
8507
8507
|
"name": "ObcIntegrationBarDropdown",
|
|
8508
|
-
"default": "class extends LitElement { constructor() { super(...arguments); this.showHomeButton = false; this.homeButtonActivated = false; this.showClock = false; this.showNotificationButton = false; this.notificationButtonActivated = false; this.notificationCount = 0; this.showNotificationCount = false; this.showUserButton = false; this.userButtonActivated = false; this.showDimmingButton = false; this.dimmingButtonActivated = false; this.showSystemButton = false; this.systemButtonActivated = false; this.nStatusFields = 0; } renderStatusFields() { if (this.nStatusFields <= 0) { return nothing; } const result = []; for (let i = 0; i < this.nStatusFields; i++) { if (i > 0) { result.push(html`<div class=\"divider\"></div>`); } result.push(html` <div class=\"status-item\"> <slot class=\"status-icon\" name=\"status-icon-${i + 1}\"></slot> <slot class=\"status-label\" name=\"status-label-${i + 1}\"></slot> </div> `); } return html`<div class=\"status\">${result}</div>`; } render() { return html` <div class=\"wrapper\"> <div class=\"left-side\"> ${this.showHomeButton ?
|
|
8508
|
+
"default": "class extends LitElement { constructor() { super(...arguments); this.showHomeButton = false; this.homeButtonActivated = false; this.showLinkButton = false; this.linkButtonActivated = false; this.showClock = false; this.showAlertButton = false; this.alertButtonActivated = false; this.showNotificationButton = false; this.notificationButtonActivated = false; this.notificationCount = 0; this.showNotificationCount = false; this.showScreenButton = false; this.screenButtonActivated = false; this.showUserButton = false; this.userButtonActivated = false; this.showDimmingButton = false; this.dimmingButtonActivated = false; this.showSystemButton = false; this.systemButtonActivated = false; this.nStatusFields = 0; } renderStatusFields() { if (this.nStatusFields <= 0) { return nothing; } const result = []; for (let i = 0; i < this.nStatusFields; i++) { if (i > 0) { result.push(html`<div class=\"divider\"></div>`); } result.push(html` <div class=\"status-item\"> <slot class=\"status-icon\" name=\"status-icon-${i + 1}\"></slot> <slot class=\"status-label\" name=\"status-label-${i + 1}\"></slot> </div> `); } return html`<div class=\"status\">${result}</div>`; } // The event name stays a literal at each call site so `cem analyze` can read it. renderIconButton(name, activated, label, icon, onClick) { return html`<obc-icon-button class=\"${name}-button\" part=\"${name}-button\" variant=\"integration\" aria-label=${label} @click=${onClick} ?activated=${activated} > ${icon} </obc-icon-button>`; } render() { return html` <div class=\"wrapper\"> <div class=\"left-side\"> ${this.showHomeButton ? this.renderIconButton( \"home\", this.homeButtonActivated, msg(\"Home\"), html`<obi-home></obi-home>`, () => this.dispatchEvent(new CustomEvent(\"home-button-clicked\")) ) : nothing} ${this.showLinkButton ? this.renderIconButton( \"link\", this.linkButtonActivated, msg(\"Link\"), html`<obi-link></obi-link>`, () => this.dispatchEvent(new CustomEvent(\"link-button-clicked\")) ) : nothing} <slot name=\"vessel-selector\"></slot> ${this.renderStatusFields()} </div> <div class=\"right-side\"> ${this.showAlertButton ? this.renderIconButton( \"alert\", this.alertButtonActivated, msg(\"Alerts\"), html`<obi-alerts></obi-alerts>`, () => this.dispatchEvent(new CustomEvent(\"alert-button-clicked\")) ) : nothing} ${this.showNotificationButton ? ( // TODO(designer): keep the Enhanced badge button here, or match the // sibling bar's plain notification icon button? (#624) html`<obc-notification-button @click=${() => this.dispatchEvent( new CustomEvent(\"notification-button-clicked\") )} .buttonStyle=${NotificationButtonStyle.Enhanced} .showCount=${this.showNotificationCount} .count=${this.notificationCount} ?isActive=${this.notificationButtonActivated} ></obc-notification-button>` ) : nothing} ${this.showScreenButton ? this.renderIconButton( \"screen\", this.screenButtonActivated, msg(\"Screen\"), html`<obi-screen-desk></obi-screen-desk>`, () => this.dispatchEvent(new CustomEvent(\"screen-button-clicked\")) ) : nothing} ${this.showSystemButton ? this.renderIconButton( \"system\", this.systemButtonActivated, msg(\"System\"), html`<obi-configure></obi-configure>`, () => this.dispatchEvent(new CustomEvent(\"system-button-clicked\")) ) : nothing} ${this.showDimmingButton ? this.renderIconButton( \"dimming\", this.dimmingButtonActivated, msg(\"Dimming\"), html`<obi-palette-day-night-iec></obi-palette-day-night-iec>`, () => this.dispatchEvent(new CustomEvent(\"dimming-button-clicked\")) ) : nothing} ${this.showUserButton ? this.renderIconButton( \"user\", this.userButtonActivated, msg(\"User\"), html`<obi-user></obi-user>`, () => this.dispatchEvent(new CustomEvent(\"user-button-clicked\")) ) : nothing} ${this.showClock ? html`<slot name=\"clock\"></slot>` : nothing} </div> </div> `; } }"
|
|
8509
8509
|
}
|
|
8510
8510
|
],
|
|
8511
8511
|
"exports": [
|
|
@@ -8526,7 +8526,7 @@
|
|
|
8526
8526
|
{
|
|
8527
8527
|
"kind": "variable",
|
|
8528
8528
|
"name": "ObcIntegrationBar",
|
|
8529
|
-
"default": "class extends LitElement { constructor() { super(...arguments); this.hideHomeButton = false; this.showClock = false; this.showLinkButton = false; this.linkButtonActivated = false; this.showUserButton = false; this.userButtonActivated = false; this.showDimmingButton = false; this.dimmingButtonActivated = false; this.showSystemButton = false; this.systemButtonActivated = false; this.showScreenButton = false; this.screenButtonActivated = false; this.showNotificationButton = false; this.notificationButtonActivated = false; this.showAlertButton = false; this.alertButtonActivated = false; this.showFleetButton = false; this.fleetButtonSelected = false; this.fleetButtonActivated = false; this.fleetButtonLabel = \"Fleet\"; this.buttonsOnBar = false; } onFleetButtonClick() { this.dispatchEvent(new CustomEvent(\"fleet-button-click\")); } onHugButtonsSlotChange(event) { const slot = event.currentTarget; const assignedElements = slot.assignedElements({ flatten: true }); assignedElements.forEach((element) => { if (element.tagName === \"OBC-INTEGRATION-BUTTON\") { const integrationButton = element; integrationButton.type = IntegrationButtonType.hug; } }); this.buttonsOnBar = true; } onButtonsSlotChange() { this.buttonsOnBar = true; } render() { const isFleetButtonAnchored = this.fleetButtonActivated; return html` <nav class=\"wrapper\"> <div class=\"content-container\"> ${!this.hideHomeButton ? html`<obc-icon-button class=\"home-button\" variant=\"integration\"> <obi-home></obi-home> </obc-icon-button>` : null} ${this.showLinkButton ? html`<obc-icon-button class=${classMap({ \"link-button\": true, activated: this.linkButtonActivated })} part=\"link-button\" variant=\"integration\" @click=${() => this.dispatchEvent(new CustomEvent(\"link-button-clicked\"))} ?activated=${this.linkButtonActivated} > <obi-link></obi-link> </obc-icon-button>` : null} <div class=${classMap({ \"fleet-vessel-container\": true })}> ${this.showFleetButton ? html`<obc-integration-button class=\"fleet-button\" .variant=${IntegrationButtonVariant.normal} ?selected=${this.fleetButtonSelected} ?activated=${this.fleetButtonActivated} style=${isFleetButtonAnchored ? \"anchor-name: --integration-menu-anchor;\" : \"\"} @click=${() => this.onFleetButtonClick()} > <span slot=\"label\">${this.fleetButtonLabel}</span> </obc-integration-button>` : nothing} <div class=\"vessel-container\"> ${this.buttonsOnBar ? nothing : html`<div class=\"vessel-button-placeholder\"></div>`} <slot class=\"hug-buttons-slot\" name=\"hug-buttons\" @slotchange=${this.onHugButtonsSlotChange} ></slot> <slot class=\"integration-buttons-slot\" name=\"integration-buttons\" @slotchange=${this.onButtonsSlotChange} ></slot> </div> </div> </div> <div class=${classMap({ \"buttons-on-bar\": this.buttonsOnBar, \"right-content-container\": true })} > ${this.showAlertButton ? html`<obc-icon-button class=${classMap({ \"alert-button\": true, activated: this.alertButtonActivated })} part=\"alert-button\" variant=\"integration\" style=${this.alertButtonActivated ? \"anchor-name: --settings-menu-anchor;\" : \"\"} @click=${() => this.dispatchEvent(new CustomEvent(\"alert-button-clicked\"))} ?activated=${this.alertButtonActivated} > <obi-alerts></obi-alerts> </obc-icon-button>` : null} ${this.showNotificationButton ? html`<obc-icon-button class=${classMap({ \"notification-button\": true, activated: this.notificationButtonActivated })} part=\"notification-button\" variant=\"integration\" style=${this.notificationButtonActivated ? \"anchor-name: --settings-menu-anchor;\" : \"\"} @click=${() => this.dispatchEvent( new CustomEvent(\"notification-button-clicked\") )} ?activated=${this.notificationButtonActivated} > <obi-notification></obi-notification> </obc-icon-button>` : null} ${this.showScreenButton ? html`<obc-icon-button class=${classMap({ \"screen-button\": true, activated: this.screenButtonActivated })} part=\"screen-button\" variant=\"integration\" style=${this.screenButtonActivated ? \"anchor-name: --settings-menu-anchor;\" : \"\"} @click=${() => this.dispatchEvent(new CustomEvent(\"screen-button-clicked\"))} ?activated=${this.screenButtonActivated} > <obi-screen-desk></obi-screen-desk> </obc-icon-button>` : null} ${this.showSystemButton ? html`<obc-icon-button class=${classMap({ \"system-button\": true, activated: this.systemButtonActivated })} part=\"system-button\" variant=\"integration\" style=${this.systemButtonActivated ? \"anchor-name: --settings-menu-anchor;\" : \"\"} @click=${() => this.dispatchEvent(new CustomEvent(\"system-button-clicked\"))} ?activated=${this.systemButtonActivated} > <obi-configure></obi-configure> </obc-icon-button>` : null} ${this.showDimmingButton ? html`<obc-icon-button class=${classMap({ \"dimming-button\": true, activated: this.dimmingButtonActivated })} part=\"dimming-button\" variant=\"integration\" style=${this.dimmingButtonActivated ? \"anchor-name: --settings-menu-anchor;\" : \"\"} @click=${() => this.dispatchEvent(new CustomEvent(\"dimming-button-clicked\"))} ?activated=${this.dimmingButtonActivated} > <obi-palette-day-night-iec></obi-palette-day-night-iec> </obc-icon-button>` : null} ${this.showUserButton ? html`<obc-icon-button class=${classMap({ \"user-button\": true, activated: this.userButtonActivated })} part=\"user-button\" variant=\"integration\" style=${this.userButtonActivated ? \"anchor-name: --settings-menu-anchor;\" : \"\"} @click=${() => this.dispatchEvent(new CustomEvent(\"user-button-clicked\"))} ?activated=${this.userButtonActivated} > <obi-user></obi-user> </obc-icon-button>` : null} ${this.showClock ? html`<slot name=\"clock\"></slot>` : null} </div> </nav> `; } }"
|
|
8529
|
+
"default": "class extends LitElement { constructor() { super(...arguments); this.hideHomeButton = false; this.showClock = false; this.showLinkButton = false; this.linkButtonActivated = false; this.showUserButton = false; this.userButtonActivated = false; this.showDimmingButton = false; this.dimmingButtonActivated = false; this.showSystemButton = false; this.systemButtonActivated = false; this.showScreenButton = false; this.screenButtonActivated = false; this.showNotificationButton = false; this.notificationButtonActivated = false; this.showAlertButton = false; this.alertButtonActivated = false; this.showFleetButton = false; this.fleetButtonSelected = false; this.fleetButtonActivated = false; this.fleetButtonLabel = \"Fleet\"; this.buttonsOnBar = false; } onFleetButtonClick() { this.dispatchEvent(new CustomEvent(\"fleet-button-click\")); } onHugButtonsSlotChange(event) { const slot = event.currentTarget; const assignedElements = slot.assignedElements({ flatten: true }); assignedElements.forEach((element) => { if (element.tagName === \"OBC-INTEGRATION-BUTTON\") { const integrationButton = element; integrationButton.type = IntegrationButtonType.hug; } }); this.buttonsOnBar = true; } onButtonsSlotChange() { this.buttonsOnBar = true; } render() { const isFleetButtonAnchored = this.fleetButtonActivated; return html` <nav class=\"wrapper\"> <div class=\"content-container\"> ${!this.hideHomeButton ? html`<obc-icon-button class=\"home-button\" variant=\"integration\" aria-label=${msg(\"Home\")} > <obi-home></obi-home> </obc-icon-button>` : null} ${this.showLinkButton ? html`<obc-icon-button class=${classMap({ \"link-button\": true, activated: this.linkButtonActivated })} part=\"link-button\" variant=\"integration\" aria-label=${msg(\"Link\")} @click=${() => this.dispatchEvent(new CustomEvent(\"link-button-clicked\"))} ?activated=${this.linkButtonActivated} > <obi-link></obi-link> </obc-icon-button>` : null} <div class=${classMap({ \"fleet-vessel-container\": true })}> ${this.showFleetButton ? html`<obc-integration-button class=\"fleet-button\" .variant=${IntegrationButtonVariant.normal} ?selected=${this.fleetButtonSelected} ?activated=${this.fleetButtonActivated} style=${isFleetButtonAnchored ? \"anchor-name: --integration-menu-anchor;\" : \"\"} @click=${() => this.onFleetButtonClick()} > <span slot=\"label\">${this.fleetButtonLabel}</span> </obc-integration-button>` : nothing} <div class=\"vessel-container\"> ${this.buttonsOnBar ? nothing : html`<div class=\"vessel-button-placeholder\"></div>`} <slot class=\"hug-buttons-slot\" name=\"hug-buttons\" @slotchange=${this.onHugButtonsSlotChange} ></slot> <slot class=\"integration-buttons-slot\" name=\"integration-buttons\" @slotchange=${this.onButtonsSlotChange} ></slot> </div> </div> </div> <div class=${classMap({ \"buttons-on-bar\": this.buttonsOnBar, \"right-content-container\": true })} > ${this.showAlertButton ? html`<obc-icon-button class=${classMap({ \"alert-button\": true, activated: this.alertButtonActivated })} part=\"alert-button\" variant=\"integration\" aria-label=${msg(\"Alerts\")} style=${this.alertButtonActivated ? \"anchor-name: --settings-menu-anchor;\" : \"\"} @click=${() => this.dispatchEvent(new CustomEvent(\"alert-button-clicked\"))} ?activated=${this.alertButtonActivated} > <obi-alerts></obi-alerts> </obc-icon-button>` : null} ${this.showNotificationButton ? html`<obc-icon-button class=${classMap({ \"notification-button\": true, activated: this.notificationButtonActivated })} part=\"notification-button\" variant=\"integration\" aria-label=${msg(\"Notifications\")} style=${this.notificationButtonActivated ? \"anchor-name: --settings-menu-anchor;\" : \"\"} @click=${() => this.dispatchEvent( new CustomEvent(\"notification-button-clicked\") )} ?activated=${this.notificationButtonActivated} > <obi-notification></obi-notification> </obc-icon-button>` : null} ${this.showScreenButton ? html`<obc-icon-button class=${classMap({ \"screen-button\": true, activated: this.screenButtonActivated })} part=\"screen-button\" variant=\"integration\" aria-label=${msg(\"Screen\")} style=${this.screenButtonActivated ? \"anchor-name: --settings-menu-anchor;\" : \"\"} @click=${() => this.dispatchEvent(new CustomEvent(\"screen-button-clicked\"))} ?activated=${this.screenButtonActivated} > <obi-screen-desk></obi-screen-desk> </obc-icon-button>` : null} ${this.showSystemButton ? html`<obc-icon-button class=${classMap({ \"system-button\": true, activated: this.systemButtonActivated })} part=\"system-button\" variant=\"integration\" aria-label=${msg(\"System\")} style=${this.systemButtonActivated ? \"anchor-name: --settings-menu-anchor;\" : \"\"} @click=${() => this.dispatchEvent(new CustomEvent(\"system-button-clicked\"))} ?activated=${this.systemButtonActivated} > <obi-configure></obi-configure> </obc-icon-button>` : null} ${this.showDimmingButton ? html`<obc-icon-button class=${classMap({ \"dimming-button\": true, activated: this.dimmingButtonActivated })} part=\"dimming-button\" variant=\"integration\" aria-label=${msg(\"Dimming\")} style=${this.dimmingButtonActivated ? \"anchor-name: --settings-menu-anchor;\" : \"\"} @click=${() => this.dispatchEvent(new CustomEvent(\"dimming-button-clicked\"))} ?activated=${this.dimmingButtonActivated} > <obi-palette-day-night-iec></obi-palette-day-night-iec> </obc-icon-button>` : null} ${this.showUserButton ? html`<obc-icon-button class=${classMap({ \"user-button\": true, activated: this.userButtonActivated })} part=\"user-button\" variant=\"integration\" aria-label=${msg(\"User\")} style=${this.userButtonActivated ? \"anchor-name: --settings-menu-anchor;\" : \"\"} @click=${() => this.dispatchEvent(new CustomEvent(\"user-button-clicked\"))} ?activated=${this.userButtonActivated} > <obi-user></obi-user> </obc-icon-button>` : null} ${this.showClock ? html`<slot name=\"clock\"></slot>` : null} </div> </nav> `; } }"
|
|
8530
8530
|
}
|
|
8531
8531
|
],
|
|
8532
8532
|
"exports": [
|
|
@@ -55348,6 +55348,15 @@
|
|
|
55348
55348
|
"default": "true",
|
|
55349
55349
|
"description": "If false, and cornerLeft or cornerRight is true, the divider is not shown."
|
|
55350
55350
|
},
|
|
55351
|
+
{
|
|
55352
|
+
"kind": "field",
|
|
55353
|
+
"name": "ariaLabel",
|
|
55354
|
+
"type": {
|
|
55355
|
+
"text": "string | null"
|
|
55356
|
+
},
|
|
55357
|
+
"default": "null",
|
|
55358
|
+
"description": "Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary."
|
|
55359
|
+
},
|
|
55351
55360
|
{
|
|
55352
55361
|
"kind": "field",
|
|
55353
55362
|
"name": "progressSpinner",
|
|
@@ -70804,7 +70813,7 @@
|
|
|
70804
70813
|
"declarations": [
|
|
70805
70814
|
{
|
|
70806
70815
|
"kind": "class",
|
|
70807
|
-
"description": "",
|
|
70816
|
+
"description": "`<obc-integration-bar-dropdown>` – A compact top-level integration header with a dropdown selector, status fields and system action buttons.",
|
|
70808
70817
|
"name": "ObcIntegrationBarDropdown",
|
|
70809
70818
|
"slots": [
|
|
70810
70819
|
{
|
|
@@ -70847,7 +70856,8 @@
|
|
|
70847
70856
|
"type": {
|
|
70848
70857
|
"text": "boolean"
|
|
70849
70858
|
},
|
|
70850
|
-
"default": "false"
|
|
70859
|
+
"default": "false",
|
|
70860
|
+
"description": "Home button at the left end of the bar."
|
|
70851
70861
|
},
|
|
70852
70862
|
{
|
|
70853
70863
|
"kind": "field",
|
|
@@ -70855,7 +70865,26 @@
|
|
|
70855
70865
|
"type": {
|
|
70856
70866
|
"text": "boolean"
|
|
70857
70867
|
},
|
|
70858
|
-
"default": "false"
|
|
70868
|
+
"default": "false",
|
|
70869
|
+
"description": "Pressed styling for the home button."
|
|
70870
|
+
},
|
|
70871
|
+
{
|
|
70872
|
+
"kind": "field",
|
|
70873
|
+
"name": "showLinkButton",
|
|
70874
|
+
"type": {
|
|
70875
|
+
"text": "boolean"
|
|
70876
|
+
},
|
|
70877
|
+
"default": "false",
|
|
70878
|
+
"description": "Link button, between home and the selector."
|
|
70879
|
+
},
|
|
70880
|
+
{
|
|
70881
|
+
"kind": "field",
|
|
70882
|
+
"name": "linkButtonActivated",
|
|
70883
|
+
"type": {
|
|
70884
|
+
"text": "boolean"
|
|
70885
|
+
},
|
|
70886
|
+
"default": "false",
|
|
70887
|
+
"description": "Pressed styling for the link button."
|
|
70859
70888
|
},
|
|
70860
70889
|
{
|
|
70861
70890
|
"kind": "field",
|
|
@@ -70863,7 +70892,26 @@
|
|
|
70863
70892
|
"type": {
|
|
70864
70893
|
"text": "boolean"
|
|
70865
70894
|
},
|
|
70866
|
-
"default": "false"
|
|
70895
|
+
"default": "false",
|
|
70896
|
+
"description": "Renders the `clock` slot at the right end."
|
|
70897
|
+
},
|
|
70898
|
+
{
|
|
70899
|
+
"kind": "field",
|
|
70900
|
+
"name": "showAlertButton",
|
|
70901
|
+
"type": {
|
|
70902
|
+
"text": "boolean"
|
|
70903
|
+
},
|
|
70904
|
+
"default": "false",
|
|
70905
|
+
"description": "Alert button, first in the right-hand group."
|
|
70906
|
+
},
|
|
70907
|
+
{
|
|
70908
|
+
"kind": "field",
|
|
70909
|
+
"name": "alertButtonActivated",
|
|
70910
|
+
"type": {
|
|
70911
|
+
"text": "boolean"
|
|
70912
|
+
},
|
|
70913
|
+
"default": "false",
|
|
70914
|
+
"description": "Pressed styling for the alert button."
|
|
70867
70915
|
},
|
|
70868
70916
|
{
|
|
70869
70917
|
"kind": "field",
|
|
@@ -70871,7 +70919,8 @@
|
|
|
70871
70919
|
"type": {
|
|
70872
70920
|
"text": "boolean"
|
|
70873
70921
|
},
|
|
70874
|
-
"default": "false"
|
|
70922
|
+
"default": "false",
|
|
70923
|
+
"description": "Notification button, after the alert button."
|
|
70875
70924
|
},
|
|
70876
70925
|
{
|
|
70877
70926
|
"kind": "field",
|
|
@@ -70879,7 +70928,8 @@
|
|
|
70879
70928
|
"type": {
|
|
70880
70929
|
"text": "boolean"
|
|
70881
70930
|
},
|
|
70882
|
-
"default": "false"
|
|
70931
|
+
"default": "false",
|
|
70932
|
+
"description": "Pressed styling; the count badge only appears in this state."
|
|
70883
70933
|
},
|
|
70884
70934
|
{
|
|
70885
70935
|
"kind": "field",
|
|
@@ -70887,7 +70937,8 @@
|
|
|
70887
70937
|
"type": {
|
|
70888
70938
|
"text": "number"
|
|
70889
70939
|
},
|
|
70890
|
-
"default": "0"
|
|
70940
|
+
"default": "0",
|
|
70941
|
+
"description": "Number drawn in the count badge."
|
|
70891
70942
|
},
|
|
70892
70943
|
{
|
|
70893
70944
|
"kind": "field",
|
|
@@ -70895,7 +70946,26 @@
|
|
|
70895
70946
|
"type": {
|
|
70896
70947
|
"text": "boolean"
|
|
70897
70948
|
},
|
|
70898
|
-
"default": "false"
|
|
70949
|
+
"default": "false",
|
|
70950
|
+
"description": "Draws the count badge on the notification button."
|
|
70951
|
+
},
|
|
70952
|
+
{
|
|
70953
|
+
"kind": "field",
|
|
70954
|
+
"name": "showScreenButton",
|
|
70955
|
+
"type": {
|
|
70956
|
+
"text": "boolean"
|
|
70957
|
+
},
|
|
70958
|
+
"default": "false",
|
|
70959
|
+
"description": "Screen button, after the notification button."
|
|
70960
|
+
},
|
|
70961
|
+
{
|
|
70962
|
+
"kind": "field",
|
|
70963
|
+
"name": "screenButtonActivated",
|
|
70964
|
+
"type": {
|
|
70965
|
+
"text": "boolean"
|
|
70966
|
+
},
|
|
70967
|
+
"default": "false",
|
|
70968
|
+
"description": "Pressed styling for the screen button."
|
|
70899
70969
|
},
|
|
70900
70970
|
{
|
|
70901
70971
|
"kind": "field",
|
|
@@ -70903,7 +70973,8 @@
|
|
|
70903
70973
|
"type": {
|
|
70904
70974
|
"text": "boolean"
|
|
70905
70975
|
},
|
|
70906
|
-
"default": "false"
|
|
70976
|
+
"default": "false",
|
|
70977
|
+
"description": "User button, last before the clock."
|
|
70907
70978
|
},
|
|
70908
70979
|
{
|
|
70909
70980
|
"kind": "field",
|
|
@@ -70911,7 +70982,8 @@
|
|
|
70911
70982
|
"type": {
|
|
70912
70983
|
"text": "boolean"
|
|
70913
70984
|
},
|
|
70914
|
-
"default": "false"
|
|
70985
|
+
"default": "false",
|
|
70986
|
+
"description": "Pressed styling for the user button."
|
|
70915
70987
|
},
|
|
70916
70988
|
{
|
|
70917
70989
|
"kind": "field",
|
|
@@ -70919,7 +70991,8 @@
|
|
|
70919
70991
|
"type": {
|
|
70920
70992
|
"text": "boolean"
|
|
70921
70993
|
},
|
|
70922
|
-
"default": "false"
|
|
70994
|
+
"default": "false",
|
|
70995
|
+
"description": "Dimming button, between system and user."
|
|
70923
70996
|
},
|
|
70924
70997
|
{
|
|
70925
70998
|
"kind": "field",
|
|
@@ -70927,7 +71000,8 @@
|
|
|
70927
71000
|
"type": {
|
|
70928
71001
|
"text": "boolean"
|
|
70929
71002
|
},
|
|
70930
|
-
"default": "false"
|
|
71003
|
+
"default": "false",
|
|
71004
|
+
"description": "Pressed styling for the dimming button."
|
|
70931
71005
|
},
|
|
70932
71006
|
{
|
|
70933
71007
|
"kind": "field",
|
|
@@ -70935,7 +71009,8 @@
|
|
|
70935
71009
|
"type": {
|
|
70936
71010
|
"text": "boolean"
|
|
70937
71011
|
},
|
|
70938
|
-
"default": "false"
|
|
71012
|
+
"default": "false",
|
|
71013
|
+
"description": "System button, after the screen button."
|
|
70939
71014
|
},
|
|
70940
71015
|
{
|
|
70941
71016
|
"kind": "field",
|
|
@@ -70943,7 +71018,8 @@
|
|
|
70943
71018
|
"type": {
|
|
70944
71019
|
"text": "boolean"
|
|
70945
71020
|
},
|
|
70946
|
-
"default": "false"
|
|
71021
|
+
"default": "false",
|
|
71022
|
+
"description": "Pressed styling for the system button."
|
|
70947
71023
|
},
|
|
70948
71024
|
{
|
|
70949
71025
|
"kind": "field",
|
|
@@ -70951,13 +71027,51 @@
|
|
|
70951
71027
|
"type": {
|
|
70952
71028
|
"text": "number"
|
|
70953
71029
|
},
|
|
70954
|
-
"default": "0"
|
|
71030
|
+
"default": "0",
|
|
71031
|
+
"description": "How many `status-icon-N`/`status-label-N` slot pairs are rendered."
|
|
70955
71032
|
},
|
|
70956
71033
|
{
|
|
70957
71034
|
"kind": "method",
|
|
70958
71035
|
"name": "renderStatusFields",
|
|
70959
71036
|
"privacy": "private"
|
|
70960
71037
|
},
|
|
71038
|
+
{
|
|
71039
|
+
"kind": "method",
|
|
71040
|
+
"name": "renderIconButton",
|
|
71041
|
+
"privacy": "private",
|
|
71042
|
+
"parameters": [
|
|
71043
|
+
{
|
|
71044
|
+
"name": "name",
|
|
71045
|
+
"type": {
|
|
71046
|
+
"text": "string"
|
|
71047
|
+
}
|
|
71048
|
+
},
|
|
71049
|
+
{
|
|
71050
|
+
"name": "activated",
|
|
71051
|
+
"type": {
|
|
71052
|
+
"text": "boolean"
|
|
71053
|
+
}
|
|
71054
|
+
},
|
|
71055
|
+
{
|
|
71056
|
+
"name": "label",
|
|
71057
|
+
"type": {
|
|
71058
|
+
"text": "string"
|
|
71059
|
+
}
|
|
71060
|
+
},
|
|
71061
|
+
{
|
|
71062
|
+
"name": "icon",
|
|
71063
|
+
"type": {
|
|
71064
|
+
"text": "TemplateResult"
|
|
71065
|
+
}
|
|
71066
|
+
},
|
|
71067
|
+
{
|
|
71068
|
+
"name": "onClick",
|
|
71069
|
+
"type": {
|
|
71070
|
+
"text": "() => void"
|
|
71071
|
+
}
|
|
71072
|
+
}
|
|
71073
|
+
]
|
|
71074
|
+
},
|
|
70961
71075
|
{
|
|
70962
71076
|
"kind": "method",
|
|
70963
71077
|
"name": "render"
|
|
@@ -70976,6 +71090,20 @@
|
|
|
70976
71090
|
},
|
|
70977
71091
|
"description": "Fired when the home button is clicked"
|
|
70978
71092
|
},
|
|
71093
|
+
{
|
|
71094
|
+
"name": "link-button-clicked",
|
|
71095
|
+
"type": {
|
|
71096
|
+
"text": "CustomEvent"
|
|
71097
|
+
},
|
|
71098
|
+
"description": "Fired when the link button is clicked"
|
|
71099
|
+
},
|
|
71100
|
+
{
|
|
71101
|
+
"name": "alert-button-clicked",
|
|
71102
|
+
"type": {
|
|
71103
|
+
"text": "CustomEvent"
|
|
71104
|
+
},
|
|
71105
|
+
"description": "Fired when the alert button is clicked"
|
|
71106
|
+
},
|
|
70979
71107
|
{
|
|
70980
71108
|
"name": "notification-button-clicked",
|
|
70981
71109
|
"type": {
|
|
@@ -70983,6 +71111,13 @@
|
|
|
70983
71111
|
},
|
|
70984
71112
|
"description": "Fired when the notification button is clicked"
|
|
70985
71113
|
},
|
|
71114
|
+
{
|
|
71115
|
+
"name": "screen-button-clicked",
|
|
71116
|
+
"type": {
|
|
71117
|
+
"text": "CustomEvent"
|
|
71118
|
+
},
|
|
71119
|
+
"description": "Fired when the screen button is clicked"
|
|
71120
|
+
},
|
|
70986
71121
|
{
|
|
70987
71122
|
"name": "system-button-clicked",
|
|
70988
71123
|
"type": {
|
|
@@ -89,6 +89,7 @@ export declare enum IconButtonVariant {
|
|
|
89
89
|
* If undefined, no progress indicator is shown.
|
|
90
90
|
* @property hasLabel - If true, displays a label below the icon using the `label` slot.
|
|
91
91
|
* @property showDivider - If false, and cornerLeft or cornerRight is true, the divider is not shown.
|
|
92
|
+
* @property ariaLabel - Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary.
|
|
92
93
|
* @slot - Icon slot (default): Place an icon such as <obi-search> here.
|
|
93
94
|
* @slot label - Optional label shown below the icon when `hasLabel` is true.
|
|
94
95
|
* @fires click - Fired when the button is clicked (if not disabled).
|
|
@@ -120,6 +121,8 @@ export declare class ObcIconButton extends LitElement {
|
|
|
120
121
|
hasLabel: boolean;
|
|
121
122
|
/** If false, and cornerLeft or cornerRight is true, the divider is not shown. */
|
|
122
123
|
showDivider: boolean;
|
|
124
|
+
/** Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary. */
|
|
125
|
+
ariaLabel: string | null;
|
|
123
126
|
get progressSpinner(): import('lit-html').TemplateResult<1> | typeof nothing;
|
|
124
127
|
render(): import('lit-html').TemplateResult<1>;
|
|
125
128
|
static styles: import('lit').CSSResult;
|
|
@@ -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;
|
|
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;AAQzD;;;;;;GAMG;AACH,oBAAY,iBAAiB;IAC3B,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,WAAW,gBAAgB;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFG;AACH,qBACa,aAAc,SAAQ,UAAU;IAC3C;;;;;OAKG;IACuB,OAAO,EAAE,iBAAiB,CACzB;IAEA,SAAS,UAAS;IAElB,UAAU,UAAS;IAEnB,WAAW,UAAS;IAEpB,WAAW,UAAS;IAEpB,IAAI,UAAS;IAEb,QAAQ,UAAS;IAElB,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAa;IAExC,QAAQ,EAAE,OAAO,CAAS;IAER,WAAW,UAAQ;IAIvD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEzC,IAAI,eAAe,0DAoDlB;IAEQ,MAAM;IAkCf,OAAgB,MAAM,0BAAwB;CAC/C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,aAAa,CAAC;KAClC;CACF"}
|
|
@@ -2,6 +2,7 @@ import { unsafeCSS, LitElement, nothing, html } from "lit";
|
|
|
2
2
|
import { property } from "lit/decorators.js";
|
|
3
3
|
import iconStyle from "./icon-button.css.js";
|
|
4
4
|
import { classMap } from "lit/directives/class-map.js";
|
|
5
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
5
6
|
import { customElement } from "../../decorator.js";
|
|
6
7
|
import { degToRad } from "../../svghelpers/math.js";
|
|
7
8
|
var __defProp = Object.defineProperty;
|
|
@@ -34,6 +35,7 @@ let ObcIconButton = class extends LitElement {
|
|
|
34
35
|
this.progress = void 0;
|
|
35
36
|
this.hasLabel = false;
|
|
36
37
|
this.showDivider = true;
|
|
38
|
+
this.ariaLabel = null;
|
|
37
39
|
}
|
|
38
40
|
get progressSpinner() {
|
|
39
41
|
if (this.progress === void 0) {
|
|
@@ -104,6 +106,7 @@ let ObcIconButton = class extends LitElement {
|
|
|
104
106
|
"hide-divider": !this.showDivider
|
|
105
107
|
})}
|
|
106
108
|
?disabled=${this.disabled}
|
|
109
|
+
aria-label=${ifDefined(this.ariaLabel ?? void 0)}
|
|
107
110
|
part="wrapper"
|
|
108
111
|
>
|
|
109
112
|
${this.progress !== void 0 ? this.progressSpinner : nothing}
|
|
@@ -150,6 +153,9 @@ __decorateClass([
|
|
|
150
153
|
__decorateClass([
|
|
151
154
|
property({ type: Boolean, attribute: false })
|
|
152
155
|
], ObcIconButton.prototype, "showDivider", 2);
|
|
156
|
+
__decorateClass([
|
|
157
|
+
property({ type: String, attribute: "aria-label" })
|
|
158
|
+
], ObcIconButton.prototype, "ariaLabel", 2);
|
|
153
159
|
ObcIconButton = __decorateClass([
|
|
154
160
|
customElement("obc-icon-button")
|
|
155
161
|
], ObcIconButton);
|
|
@@ -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';\nimport {degToRad} from '../../svghelpers/math.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 * @property activated - Whether the button is in an activated (selected/toggled) state.\n * Visually highlights the button to indicate selection.\n * @property cornerLeft - If true, aligns the button to the left edge and removes left border radius.\n * Useful for grouping or edge-aligned layouts.\n * @property cornerRight - If true, aligns the button to the right edge and removes right border radius.\n * Useful for grouping or edge-aligned layouts.\n * @property activeColor - Applies an accent color to the button for emphasis.\n * Used to visually distinguish active or important actions.\n * @property wide - Increases the button's width for larger touch targets or visual balance.\n * @property disabled - Disables the button, preventing user interaction and dimming its appearance.\n * @property progress - 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 * @property hasLabel - If true, displays a label below the icon using the `label` slot.\n * @property showDivider - If false, and cornerLeft or cornerRight is true, the divider is not shown.\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 * @stable\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 @property({type: Boolean}) activated = false;\n\n @property({type: Boolean}) cornerLeft = false;\n\n @property({type: Boolean}) cornerRight = false;\n\n @property({type: Boolean}) activeColor = false;\n\n @property({type: Boolean}) wide = false;\n\n @property({type: Boolean}) disabled = false;\n\n @property({type: Number}) progress: undefined | number = undefined;\n\n @property({type: Boolean}) hasLabel: boolean = false;\n\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 = degToRad(this.progress * 0.95 * 3.6);\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":";;;;;;;;;;;;;;;;AAcO,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;AA0FL,IAAM,gBAAN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,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 {ifDefined} from 'lit/directives/if-defined.js';\nimport {customElement} from '../../decorator.js';\nimport {degToRad} from '../../svghelpers/math.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 * @property activated - Whether the button is in an activated (selected/toggled) state.\n * Visually highlights the button to indicate selection.\n * @property cornerLeft - If true, aligns the button to the left edge and removes left border radius.\n * Useful for grouping or edge-aligned layouts.\n * @property cornerRight - If true, aligns the button to the right edge and removes right border radius.\n * Useful for grouping or edge-aligned layouts.\n * @property activeColor - Applies an accent color to the button for emphasis.\n * Used to visually distinguish active or important actions.\n * @property wide - Increases the button's width for larger touch targets or visual balance.\n * @property disabled - Disables the button, preventing user interaction and dimming its appearance.\n * @property progress - 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 * @property hasLabel - If true, displays a label below the icon using the `label` slot.\n * @property showDivider - If false, and cornerLeft or cornerRight is true, the divider is not shown.\n * @property ariaLabel - Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary.\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 * @stable\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 @property({type: Boolean}) activated = false;\n\n @property({type: Boolean}) cornerLeft = false;\n\n @property({type: Boolean}) cornerRight = false;\n\n @property({type: Boolean}) activeColor = false;\n\n @property({type: Boolean}) wide = false;\n\n @property({type: Boolean}) disabled = false;\n\n @property({type: Number}) progress: undefined | number = undefined;\n\n @property({type: Boolean}) hasLabel: boolean = false;\n\n @property({type: Boolean, attribute: false}) showDivider = true;\n\n // Reactive so a consumer swapping the name (Play → Pause) re-renders the shadow button.\n @property({type: String, attribute: 'aria-label'})\n override ariaLabel: string | null = null;\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 = degToRad(this.progress * 0.95 * 3.6);\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 aria-label=${ifDefined(this.ariaLabel ?? undefined)}\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":";;;;;;;;;;;;;;;;;AAeO,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;AA2FL,IAAM,gBAAN,cAA4B,WAAW;AAAA,EAAvC,cAAA;AAAA,UAAA,GAAA,SAAA;AAOqB,S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S,EAAC,MAAM,QAAQ,WAAW,cAAa;AAAA,GA7BtC,cA8BF,WAAA,aAAA,CAAA;AA9BE,gBAAN,gBAAA;AAAA,EADN,cAAc,iBAAiB;AAAA,GACnB,aAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top-bar.d.ts","sourceRoot":"","sources":["../../../src/components/top-bar/top-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"top-bar.d.ts","sourceRoot":"","sources":["../../../src/components/top-bar/top-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;AAKhD,OAAO,+BAA+B,CAAC;AACvC,OAAO,mBAAmB,CAAC;AAC3B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,6BAA6B,CAAC;AACrC,OAAO,8BAA8B,CAAC;AACtC,OAAO,0BAA0B,CAAC;AAClC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,wCAAwC,CAAC;AAChD,OAAO,2CAA2C,CAAC;AACnD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,0CAA0C,CAAC;AAClD,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAEL,cAAc,EACf,MAAM,6BAA6B,CAAC;AAGrC,oBAAY,uBAAuB;IACjC,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6HG;AACH,qBACa,SAAU,SAAQ,UAAU;IACvC;;;;OAIG;IACuB,QAAQ,SAAS;IAE3C;;;;;OAKG;IACuB,QAAQ,SAAU;IAElB,cAAc,0BAAgC;IAExE;;;;;OAKG;IAEH,mBAAmB,UAAS;IAE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1B;CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { unsafeCSS, LitElement, html } from "lit";
|
|
2
2
|
import { property } from "lit/decorators.js";
|
|
3
3
|
import { classMap } from "lit/directives/class-map.js";
|
|
4
|
+
import { msg } from "@lit/localize";
|
|
4
5
|
import compentStyle from "./top-bar.css.js";
|
|
5
6
|
import "../icon-button/icon-button.js";
|
|
6
7
|
import "../clock/clock.js";
|
|
@@ -119,6 +120,7 @@ let ObcTopBar = class extends LitElement {
|
|
|
119
120
|
html`<div class="menu-button">
|
|
120
121
|
<obc-icon-button
|
|
121
122
|
variant="flat"
|
|
123
|
+
aria-label=${msg("Close")}
|
|
122
124
|
@pointerdown=${() => this.leftButtonDown(new CustomEvent("close"))}
|
|
123
125
|
@pointerup=${() => this.leftButtonUp()}
|
|
124
126
|
@pointerleave=${() => this.leftButtonLeave()}
|
|
@@ -130,6 +132,7 @@ let ObcTopBar = class extends LitElement {
|
|
|
130
132
|
leftGroup.push(
|
|
131
133
|
html`<obc-icon-button
|
|
132
134
|
variant="flat"
|
|
135
|
+
aria-label=${msg("Back")}
|
|
133
136
|
@click=${() => this.dispatchEvent(new CustomEvent("back"))}
|
|
134
137
|
>
|
|
135
138
|
<obi-arrow-left-google></obi-arrow-left-google>
|
|
@@ -152,6 +155,7 @@ let ObcTopBar = class extends LitElement {
|
|
|
152
155
|
html`<div class="menu-button ${this.wideMenuButton ? "wide" : null}">
|
|
153
156
|
<obc-icon-button
|
|
154
157
|
variant="flat"
|
|
158
|
+
aria-label=${this.menuButtonIcon === "menu" ? msg("Menu") : msg("Home")}
|
|
155
159
|
@pointerdown=${() => this.leftButtonDown(new CustomEvent("menu-button-clicked"))}
|
|
156
160
|
@pointerup=${() => this.leftButtonUp()}
|
|
157
161
|
@pointerleave=${() => this.leftButtonLeave()}
|
|
@@ -236,6 +240,7 @@ let ObcTopBar = class extends LitElement {
|
|
|
236
240
|
class="dimming-button"
|
|
237
241
|
part="dimming-button"
|
|
238
242
|
variant="flat"
|
|
243
|
+
aria-label=${msg("Dimming")}
|
|
239
244
|
@click=${this.dimmingButtonClicked}
|
|
240
245
|
?activated=${this.dimmingButtonActivated}
|
|
241
246
|
>
|
|
@@ -245,6 +250,7 @@ let ObcTopBar = class extends LitElement {
|
|
|
245
250
|
class="user-button"
|
|
246
251
|
variant="flat"
|
|
247
252
|
part="user-button"
|
|
253
|
+
aria-label=${msg("User")}
|
|
248
254
|
@click=${this.userButtonClicked}
|
|
249
255
|
?activated=${this.userButtonActivated}
|
|
250
256
|
?disabled=${this.userButtonDisabled}
|
|
@@ -255,6 +261,7 @@ let ObcTopBar = class extends LitElement {
|
|
|
255
261
|
class="apps-button"
|
|
256
262
|
variant="flat"
|
|
257
263
|
part="apps-button"
|
|
264
|
+
aria-label=${msg("Apps")}
|
|
258
265
|
@click=${this.appsButtonClicked}
|
|
259
266
|
?activated=${this.appsButtonActivated}
|
|
260
267
|
>
|
|
@@ -265,6 +272,7 @@ let ObcTopBar = class extends LitElement {
|
|
|
265
272
|
class="left-more-button"
|
|
266
273
|
part="left-more-button"
|
|
267
274
|
variant="flat"
|
|
275
|
+
aria-label=${msg("More")}
|
|
268
276
|
@click=${this.leftMoreButtonClicked}
|
|
269
277
|
?activated=${this.leftMoreButtonActivated}
|
|
270
278
|
>
|