Skip to content

Commit

Permalink
fix(components/tabs): template usage for tabs listing #1859
Browse files Browse the repository at this point in the history
  • Loading branch information
ickisIckis committed Aug 7, 2024
1 parent f775dc9 commit a76ac81
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,35 @@ export class TabsExampleComponentComponent {
{
title: 'Вкладка 4',
},
{
title: 'Вкладка 5',
},
{
title: 'Вкладка 6',
},
{
title: 'Вкладка 7',
},
{
title: 'Вкладка 8',
},
{
title: 'Вкладка 9',
},
{
title: 'Вкладка 10',
},
{
title: 'Вкладка 11',
},
{
title: 'Вкладка 12',
},
{
title: 'Вкладка 13',
},
{
title: 'Вкладка 14',
},
];
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Component, ChangeDetectionStrategy, Inject } from '@angular/core';
import { POLYMORPH_CONTEXT, PrizmTabContext, PrizmTabItem } from '@prizm-ui/components';
import { POLYMORPH_CONTEXT, PrizmTabContext } from '@prizm-ui/components';

@Component({
selector: 'prizm-tabs-example-component-content',
template: `{{ context.idx + 1 }}`,
template: `{{ context.idx + 1 }} element`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TabsExampleComponentContentComponent {
Expand Down
21 changes: 11 additions & 10 deletions libs/components/src/lib/components/tabs/tabs.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,17 @@
<div class="icon-placeholder"></div>
</ng-template>
</ng-container>

<ng-container>
<div
class="tab-content"
#elem
[prizmHint]="tab.content"
[prizmHintCanShow]="$any(elem | prizmCallFunc : prizmIsTextOverflow$ | async)"
>
{{ tab.content }}
</div>
<ng-container *ngIf="tab.content as content">
<ng-container *polymorphOutlet="content; context: $any({ idx: i, tab: this })">
<div
class="tab-content"
#elem
[prizmHint]="content"
[prizmHintCanShow]="$any(elem | prizmCallFunc : prizmIsTextOverflow$ | async)"
>
{{ content }}
</div>
</ng-container>
</ng-container>

<ng-container rightBox>
Expand Down

0 comments on commit a76ac81

Please sign in to comment.