89741: Added ThemedExpandableNavbarSectionComponent

This commit is contained in:
Alexandre Vryghem
2022-05-03 08:56:37 +02:00
parent e4f483c308
commit b9b5b50999
2 changed files with 35 additions and 5 deletions

View File

@@ -0,0 +1,29 @@
import { Component } from '@angular/core';
import { ThemedComponent } from '../../shared/theme-support/themed.component';
import { ExpandableNavbarSectionComponent } from './expandable-navbar-section.component';
import { rendersSectionForMenu } from '../../shared/menu/menu-section.decorator';
import { MenuID } from '../../shared/menu/initial-menus-state';
/**
* Themed wrapper for ExpandableNavbarSectionComponent
*/
@Component({
/* tslint:disable:component-selector */
selector: 'li[ds-themed-expandable-navbar-section]',
styleUrls: [],
templateUrl: '../../shared/theme-support/themed.component.html',
})
@rendersSectionForMenu(MenuID.PUBLIC, true)
export class ThemedExpandableNavbarSectionComponent extends ThemedComponent<ExpandableNavbarSectionComponent> {
protected getComponentName(): string {
return 'ExpandableNavbarSectionComponent';
}
protected importThemedComponent(themeName: string): Promise<any> {
return import(`../../../themes/${themeName}/app/navbar/expandable-navbar-section/expandable-navbar-section.component`);
}
protected importUnthemedComponent(): Promise<any> {
return import(`./expandable-navbar-section.component`);
}
}

View File

@@ -7,6 +7,7 @@ import { CoreModule } from '../core/core.module';
import { NavbarEffects } from './navbar.effects';
import { NavbarSectionComponent } from './navbar-section/navbar-section.component';
import { ExpandableNavbarSectionComponent } from './expandable-navbar-section/expandable-navbar-section.component';
import { ThemedExpandableNavbarSectionComponent } from './expandable-navbar-section/themed-expandable-navbar-section.component';
import { NavbarComponent } from './navbar.component';
import { MenuModule } from '../shared/menu/menu.module';
import { SharedModule } from '../shared/shared.module';
@@ -20,7 +21,7 @@ const effects = [
const ENTRY_COMPONENTS = [
// put only entry components that use custom decorator
NavbarSectionComponent,
ExpandableNavbarSectionComponent,
ThemedExpandableNavbarSectionComponent,
];
@NgModule({
@@ -36,19 +37,19 @@ const ENTRY_COMPONENTS = [
NavbarComponent,
ThemedNavbarComponent,
NavbarSectionComponent,
ExpandableNavbarSectionComponent
ExpandableNavbarSectionComponent,
ThemedExpandableNavbarSectionComponent,
],
providers: [
],
entryComponents: [
NavbarSectionComponent,
ExpandableNavbarSectionComponent
...ENTRY_COMPONENTS,
],
exports: [
ThemedNavbarComponent,
NavbarSectionComponent,
ExpandableNavbarSectionComponent
ThemedExpandableNavbarSectionComponent,
]
})