Skip to content

Commit 33c4745

Browse files
committed
fix: maps in tab widget would not correctly initialize + prevent all tabs to load at same tiem
1 parent 30c235a commit 33c4745

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

apps/web-widgets/src/app/app.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ const initializeAuthAndTranslations =
9696
);
9797
},
9898
complete: () => {
99-
// console.log(translate.instant('kendo.datetimepicker.now'));
10099
resolve(null);
101100
},
102101
});

libs/shared/src/lib/components/widgets/tabs-settings/tab-main/tab-main.component.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@
4343
</div>
4444
</div>
4545
</ng-container>
46-
<shared-tab-settings
47-
[tabGroup]="$any(tab)"
48-
(delete)="onDeleteTab(i)"
49-
></shared-tab-settings>
46+
<ng-template uiTabContent>
47+
<shared-tab-settings
48+
[tabGroup]="$any(tab)"
49+
(delete)="onDeleteTab(i)"
50+
></shared-tab-settings>
51+
</ng-template>
5052
</ui-tab>
5153
</ui-tabs>

libs/shared/src/lib/components/widgets/tabs/tab/tab.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ export class TabComponent implements AfterViewInit {
2323
ngAfterViewInit(): void {
2424
const componentRef = this.content.createComponent(WidgetGridComponent);
2525
componentRef.setInput('widgets', this.structure);
26+
/** To use angular hooks */
27+
componentRef.changeDetectorRef.detectChanges();
2628
}
2729
}

libs/shared/src/lib/components/widgets/tabs/tabs.component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
<div class="h-full flex flex-col">
22
<ui-tabs
3+
[selectedIndex]="selectedIndex"
4+
(openedTab)="selectedIndex = $event.index"
35
class="h-full overflow-hidden"
46
*ngIf="settings.tabs && settings.tabs.length > 0; else empty"
57
>
68
<ui-tab *ngFor="let tab of settings.tabs">
79
<ng-container ngProjectAs="label">{{ tab.label }}</ng-container>
8-
<shared-tab [structure]="tab.structure"></shared-tab>
10+
<ng-template uiTabContent>
11+
<shared-tab [structure]="tab.structure"></shared-tab>
12+
</ng-template>
913
</ui-tab>
1014
</ui-tabs>
1115
<ng-template #empty>

libs/shared/src/lib/components/widgets/tabs/tabs.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export class TabsComponent
4343
tabGroup?: UiTabsComponent;
4444
/** CDK portal. Allow to display part of the tab group element in another place */
4545
portal?: DomPortal;
46+
/** Selected tab index */
47+
selectedIndex = 0;
4648

4749
/**
4850
* Tabs widget component.

0 commit comments

Comments
 (0)