import type NavigationMenuItem from "./NavigationMenuItem.js"; import MenuItemTemplate from "@ui5/webcomponents/dist/MenuItemTemplate.js"; import Icon from "@ui5/webcomponents/dist/Icon.js"; import slimArrowRightIcon from "@ui5/webcomponents-icons/dist/slim-arrow-right.js"; import arrowRightIcon from "@ui5/webcomponents-icons/dist/arrow-right.js"; import type { ListItemHooks } from "@ui5/webcomponents/dist/ListItemTemplate.js"; const predefinedHooks: Partial = { listItemContent, iconBegin, iconEnd, }; export default function NavigationMenuItemTemplate(this: NavigationMenuItem, hooks?: Partial) { const currentHooks = { ...predefinedHooks, ...hooks, }; return <> { this._href ? ( {MenuItemTemplate.call(this, currentHooks)} ) : MenuItemTemplate.call(this, currentHooks) } ; } function listItemContent(this: NavigationMenuItem) { return <>{this.text}; } function iconBegin(this: NavigationMenuItem) { if (this.hasIcon) { return ; } if (this._siblingsWithIcon) { return
; } } function iconEnd(this: NavigationMenuItem) { if (this.hasSubmenu) { return ; } if (this.isExternalLink) { return ; } }