import Icon from "@ui5/webcomponents/dist/Icon.js"; import List from "@ui5/webcomponents/dist/List.js"; import Popover from "@ui5/webcomponents/dist/Popover.js"; import slimArrowDown from "@ui5/webcomponents-icons/dist/slim-arrow-down.js"; import type ShellBar from "../../ShellBar.js"; function ShellBarLegacyBrandingArea(this: ShellBar) { const legacy = this.legacyAdaptor; if (!legacy) { return null; } return ( <> {legacy.hasMenuItems && ShellBarInteractiveMenuButton.call(this)} {legacy.hasMenuItems && ShellBarLegacySecondaryTitle.call(this)} {!legacy.hasMenuItems && ShellBarLegacyTitleArea.call(this)} {/* Menu Popover (legacy) */} {ShellBarMenuPopover.call(this)} ); } function ShellBarLegacyTitleArea(this: ShellBar) { const legacy = this.legacyAdaptor; if (!legacy) { return null; } return ( <> {!!(legacy.isSBreakPoint && legacy.hasLogo) && ShellBarSingleLogo.call(this)} {!legacy.isSBreakPoint && (legacy.hasLogo || legacy.primaryTitle) && ( <> {ShellBarCombinedLogo.call(this)} {legacy.hasSecondaryTitle && legacy.hasPrimaryTitle && ShellBarLegacySecondaryTitle.call(this)} )} ); } /** * Renders interactive menu button for non-S breakpoints. * Shows primaryTitle with arrow, opens menu popover. */ function ShellBarInteractiveMenuButton(this: ShellBar) { const legacy = this.legacyAdaptor; if (!legacy) { return null; } return ( <> {!legacy.showLogoInMenuButton && legacy.hasLogo && ShellBarSingleLogo.call(this)} {legacy.showTitleInMenuButton &&

{legacy.primaryTitle}

} {legacy.showMenuButton && ( )} ); } /** * Renders single logo on S breakpoint when no menu items. * Used on S breakpoint when no menu items and no branding slot. */ function ShellBarSingleLogo(this: ShellBar) { const legacy = this.legacyAdaptor; if (!legacy) { return null; } return ( ); } function ShellBarCombinedLogo(this: ShellBar) { const legacy = this.legacyAdaptor; if (!legacy) { return null; } return (
{legacy.hasLogo && ( )}
{legacy.primaryTitle && (

{legacy.primaryTitle}

)}
); } function ShellBarLegacySecondaryTitle(this: ShellBar) { const legacy = this.legacyAdaptor; if (!legacy || !legacy.showSecondaryTitle) { return null; } return (
{this.secondaryTitle}
); } /** * Renders the menu popover. * Contains the list of menu items. */ function ShellBarMenuPopover(this: ShellBar) { const legacy = this.legacyAdaptor; if (!legacy || !legacy.hasMenuItems) { return null; } return ( ); } export { ShellBarSingleLogo, ShellBarMenuPopover, ShellBarLegacyTitleArea, ShellBarLegacyBrandingArea, ShellBarLegacySecondaryTitle, ShellBarInteractiveMenuButton, };