Skip to content

Commit

Permalink
Merge branch 'main' into 3927-theme-property-in-luigicompoundcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
walmazacn authored Sep 23, 2024
2 parents 95e0249 + 5a0b553 commit e9795c4
Showing 1 changed file with 72 additions and 50 deletions.
122 changes: 72 additions & 50 deletions core/src/navigation/LeftNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
GenericHelpers.requestExperimentalFeature('btpToolLayout', false);
let btpNavTopCnt;
let toolLayoutSubCatDelimiter = LuigiConfig.getConfigValue('settings.btpToolLayout.subCategoryDelimiter') || '::';
let navHeaderContainer;
const getNodeLabel = node => {
return NavigationHelpers.getNodeLabel(node);
Expand Down Expand Up @@ -248,6 +249,22 @@
}
};
const handleNavHeaderRenderer = () => {
const clickHandler = node => {
if (node) {
handleClick(node);
}
};
if (navHeader?.renderer && navHeaderContainer) {
if (navHeader.clearBeforeRender) {
navHeaderContainer.innerHTML = '';
}
navHeader.renderer(navHeaderContainer, navParentNode, clickHandler);
}
};
afterUpdate(() => {
if (!window.Luigi.__btpNavTopCntRszObs) {
let updateTimeout;
Expand All @@ -269,6 +286,7 @@
} else {
resetNavEntries();
}
handleNavHeaderRenderer();
});
beforeUpdate(() => {
Expand Down Expand Up @@ -589,35 +607,37 @@
style="width: var(--luigi__left-sidenav--width); height: 100%;"
>
{#if navHeader}
<div class="lui-nav-title">
<ul class="fd-nested-list">
<li class="fd-nested-list__item">
<!-- svelte-ignore a11y-missing-attribute -->
<a class="fd-nested-list__link" title={resolveTooltipText(navHeader, $getTranslation(navHeader.label))}>
{#if navHeader.icon}
{#if isOpenUIiconName(navHeader.icon)}
<div class="lui-nav-title" bind:this={navHeaderContainer}>
{#if !navHeader.renderer}
<ul class="fd-nested-list">
<li class="fd-nested-list__item">
<!-- svelte-ignore a11y-missing-attribute -->
<a class="fd-nested-list__link" title={resolveTooltipText(navHeader, $getTranslation(navHeader.label))}>
{#if navHeader.icon}
{#if isOpenUIiconName(navHeader.icon)}
<i
class="lui-header-icon fd-nested-list__icon sap-icon {getSapIconStr(navHeader.icon)}"
role="presentation"
/>
{:else}
<span class="fd-nested-list__icon sap-icon">
<img src={navHeader.icon} alt={navHeader.altText ? navHeader.altText : ''} />
</span>
{/if}
{/if}
<span class="fd-nested-list__title"> {$getTranslation(navHeader.label)} </span>
{#if navHeader.showUpLink}
<i
class="lui-header-icon fd-nested-list__icon sap-icon {getSapIconStr(navHeader.icon)}"
class="lui-nav-up fd-nested-list__icon sap-icon sap-icon--navigation-up-arrow"
role="presentation"
title={$getTranslation('luigi.navigation.up')}
on:click|preventDefault={handleUp}
/>
{:else}
<span class="fd-nested-list__icon sap-icon">
<img src={navHeader.icon} alt={navHeader.altText ? navHeader.altText : ''} />
</span>
{/if}
{/if}
<span class="fd-nested-list__title"> {$getTranslation(navHeader.label)} </span>
{#if navHeader.showUpLink}
<i
class="lui-nav-up fd-nested-list__icon sap-icon sap-icon--navigation-up-arrow"
role="presentation"
title={$getTranslation('luigi.navigation.up')}
on:click|preventDefault={handleUp}
/>
{/if}
</a>
</li>
</ul>
</a>
</li>
</ul>
{/if}
</div>
{/if}
Expand Down Expand Up @@ -933,35 +953,37 @@
class="fd-app__sidebar fd-navigation {hideNavComponent ? 'hideNavComponent' : ''} {footerText || semiCollapsibleButton ? 'hasFooter' : ''} {footerText && !semiCollapsibleButton ? 'hasOnlyFooterText' : ''}"
>
{#if navHeader}
<div class="lui-nav-title">
<ul class="fd-nested-list">
<li class="fd-nested-list__item">
<!-- svelte-ignore a11y-missing-attribute -->
<a class="fd-nested-list__link" title={resolveTooltipText(navHeader, $getTranslation(navHeader.label))}>
{#if navHeader.icon}
{#if isOpenUIiconName(navHeader.icon)}
<div class="lui-nav-title" bind:this={navHeaderContainer}>
{#if !navHeader.renderer}
<ul class="fd-nested-list">
<li class="fd-nested-list__item">
<!-- svelte-ignore a11y-missing-attribute -->
<a class="fd-nested-list__link" title={resolveTooltipText(navHeader, $getTranslation(navHeader.label))}>
{#if navHeader.icon}
{#if isOpenUIiconName(navHeader.icon)}
<i
class="lui-header-icon fd-nested-list__icon sap-icon {getSapIconStr(navHeader.icon)}"
role="presentation"
/>
{:else}
<span class="fd-nested-list__icon sap-icon">
<img src={navHeader.icon} alt={navHeader.altText ? navHeader.altText : ''} />
</span>
{/if}
{/if}
<span class="fd-nested-list__title"> {$getTranslation(navHeader.label)} </span>
{#if navHeader.showUpLink}
<i
class="lui-header-icon fd-nested-list__icon sap-icon {getSapIconStr(navHeader.icon)}"
class="lui-nav-up fd-nested-list__icon sap-icon sap-icon--navigation-up-arrow"
role="presentation"
title={$getTranslation('luigi.navigation.up')}
on:click|preventDefault={handleUp}
/>
{:else}
<span class="fd-nested-list__icon sap-icon">
<img src={navHeader.icon} alt={navHeader.altText ? navHeader.altText : ''} />
</span>
{/if}
{/if}
<span class="fd-nested-list__title"> {$getTranslation(navHeader.label)} </span>
{#if navHeader.showUpLink}
<i
class="lui-nav-up fd-nested-list__icon sap-icon sap-icon--navigation-up-arrow"
role="presentation"
title={$getTranslation('luigi.navigation.up')}
on:click|preventDefault={handleUp}
/>
{/if}
</a>
</li>
</ul>
</a>
</li>
</ul>
{/if}
</div>
{/if}
<nav
Expand Down

0 comments on commit e9795c4

Please sign in to comment.