import Button from "@ui5/webcomponents/dist/Button.js"; import ButtonBadge from "@ui5/webcomponents/dist/ButtonBadge.js"; import Popover from "@ui5/webcomponents/dist/Popover.js"; import List from "@ui5/webcomponents/dist/List.js"; import type ShellBar from "./ShellBar.js"; import ShellBarItem from "./ShellBarItem.js"; import { ShellBarSearchField, ShellBarSearchFieldFullWidth } from "./shellbar/templates/ShellBarSearchTemplate.js"; import { ShellBarSearchField as ShellBarSearchFieldLegacy, ShellBarSearchButton as ShellBarSearchButtonLegacy, ShellBarSearchFieldFullWidth as ShellBarSearchFieldFullWidthLegacy, } from "./shellbar/templates/ShellBarSearchLegacyTemplate.js"; import { ShellBarLegacyBrandingArea, } from "./shellbar/templates/ShellBarLegacyTemplate.js"; export default function ShellBarTemplate(this: ShellBar) { const isLegacySearch = !this.isSelfCollapsibleSearch; const SearchInBarTemplate = isLegacySearch ? ShellBarSearchFieldLegacy : ShellBarSearchField; const SearchFullWidthTemplate = isLegacySearch ? ShellBarSearchFieldFullWidthLegacy : ShellBarSearchFieldFullWidth; const profileAction = this.getAction("profile"); const overflowAction = this.getAction("overflow"); const assistantAction = this.getAction("assistant"); const notificationsAction = this.getAction("notifications"); const productSwitchAction = this.getAction("products"); const actionsAccInfo = this.actionsAccessibilityInfo; return ( <>
{/* Full-width search overlay */} {this.showFullWidthSearch && SearchFullWidthTemplate.call(this)} {this.enabledFeatures.startButton && (
)} {this.enabledFeatures.branding && (
)} {/* Legacy branding (logo + primaryTitle) when no menu items */} {!this.enabledFeatures.branding && ShellBarLegacyBrandingArea.call(this)}
{this.enabledFeatures.content && (
{/* Start separator */} {this.separatorConfig.showStartSeparator && (
)} {/* Start content items */} {this.startContent.map(item => { const itemId = (item as any)._individualSlot as string; const packedSep = this.getPackedSeparatorInfo(item, true); return (
{packedSep.shouldPack && (
)}
); })} {/* Spacer: Grows to fill available space, used to measure if space is tight, should be in DOM always */}
{/* End content items */} {this.endContent.map(item => { const itemId = (item as any)._individualSlot as string; const packedSep = this.getPackedSeparatorInfo(item, false); return (
{packedSep.shouldPack && (
)}
); })} {/* End separator */} {this.separatorConfig.showEndSeparator && (
)}
)} {this.enabledFeatures.search && SearchInBarTemplate.call(this)} {this.enabledFeatures.search && isLegacySearch && ShellBarSearchButtonLegacy.call(this)} {assistantAction && (
)} {notificationsAction && ( )} {/* Custom Items */} {this.sortItems(this.items).map(item => (
{!item.inOverflow ? : null}
))} {overflowAction && ( )} {profileAction && ( )} {productSwitchAction && ( )}
{/* Overflow Popover */} {this.overflowItems.map(item => { if (item.type === "action") { const actionData = item.data; return ( ); } return ; })} ); }