Skip to content

Commit eea3fd4

Browse files
committed
fix: dynamic tabs title issue
1 parent d8615ab commit eea3fd4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/angular-sdk-components/src/lib/_components/template/dynamic-tabs/dynamic-tabs.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<div *ngIf="propsToUse.showLabel && propsToUse.label" class="template-title-container">
2+
<span>{{ propsToUse.label }}</span>
3+
</div>
14
<mat-tab-group id="dynamic-tabs" mat-stretch-tabs="false" animationDuration="0">
25
<mat-tab *ngFor="let tab of tabsItems" [label]="tab.name">
36
<component-mapper name="View" [props]="{ pConn$: tab.content.getPConnect() }"></component-mapper>

packages/angular-sdk-components/src/lib/_components/template/dynamic-tabs/dynamic-tabs.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { ComponentMapperComponent } from '../../../_bridge/component-mapper/comp
99
interface DynamicTabsProps {
1010
referenceList: string;
1111
template: string;
12+
label?: string;
13+
showLabel?: boolean;
1214
}
1315

1416
@Component({
@@ -24,6 +26,7 @@ export class DynamicTabsComponent implements OnInit, OnDestroy {
2426

2527
angularPConnectData: AngularPConnectData = {};
2628
tabsItems: any[];
29+
propsToUse: any;
2730

2831
constructor(private angularPConnect: AngularPConnectService) {}
2932

@@ -54,7 +57,9 @@ export class DynamicTabsComponent implements OnInit, OnDestroy {
5457
}
5558

5659
updateSelf() {
57-
const { referenceList } = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as DynamicTabsProps;
60+
const { referenceList, label, showLabel } = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as DynamicTabsProps;
61+
62+
this.propsToUse = { label, showLabel, ...this.pConn$.getInheritedProps() };
5863

5964
const { tablabel } = this.pConn$.getComponentConfig();
6065
const tablabelProp = PCore.getAnnotationUtils().getPropertyName(tablabel);

0 commit comments

Comments
 (0)