${this.showBanner ? html`
` : nothing}
${sidenavFirst
? html`
${this.renderSidenav()}
`
: html`
${this.renderSidenav()}
`}
${this.renderSidenav()}
${this.showIdentifier ? html`
` : nothing}
`;
}
/**
* Public API: Set navigation items
*/
setNavItems(items: NavItem[]): void {
this.navItems = [...items];
}
/**
* Public API: Add a navigation item
*/
addNavItem(item: NavItem): void {
this.navItems = [...this.navItems, item];
}
/**
* Public API: Set current page in navigation
*/
setCurrentPage(href: string): void {
const updateCurrent = (items: NavItem[]): NavItem[] => {
return items.map((item) => ({
...item,
current: item.href === href,
subnav: item.subnav ? updateCurrent(item.subnav) : undefined,
}));
};
this.navItems = updateCurrent(this.navItems);
}
}