Skip to content

Commit

Permalink
revert demo changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed Jul 24, 2024
1 parent f7f061a commit 96fc148
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 19 deletions.
24 changes: 8 additions & 16 deletions src/app/showcase/doc/tabmenu/basicdoc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { MenuItem } from 'primeng/api';
import { Code } from '@domain/code';

Expand All @@ -9,29 +9,21 @@ import { Code } from '@domain/code';
<p>TabMenu requires a collection of menuitems as its model.</p>
</app-docsectiontext>
<div class="card">
<p-tabMenu [scrollable]="true" [model]="items" [activeItem]="activeItem"></p-tabMenu>
<p-tabMenu [model]="items" />
</div>
<app-code [code]="code" selector="tab-menu-basic-demo"></app-code>
`
})
export class BasicDoc implements OnInit {
items: MenuItem[] | undefined;

activeItem: MenuItem | undefined;

constructor(private cd:ChangeDetectorRef){

}

ngOnInit() {
this.items = Array.from({ length: 50 }, (_, i) => ({
label: `Tab ${i + 1}`,
}));

setTimeout((_) => {
this.activeItem = this.items[40];
this.cd.markForCheck()
}, 2000);
this.items = [
{ label: 'Dashboard', icon: 'pi pi-home' },
{ label: 'Transactions', icon: 'pi pi-chart-line' },
{ label: 'Products', icon: 'pi pi-list' },
{ label: 'Messages', icon: 'pi pi-inbox' }
];
}

code: Code = {
Expand Down
39 changes: 36 additions & 3 deletions src/app/showcase/pages/tabmenu/tabmenudemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,45 @@ import { RouterDoc } from '@doc/tabmenu/routerdoc';
})
export class TabMenuDemo {
docs = [

{
id: 'import',
label: 'Import',
component: ImportDoc
},
{
id: 'basic',
label: 'Basic',
component: BasicDoc
},

{
id: 'controlled',
label: 'Controlled',
component: ControlledDoc
},
{
id: 'template',
label: 'Template',
component: TemplateDoc
},
{
id: 'command',
label: 'Command',
component: CommandDoc
},
{
id: 'router',
label: 'Router',
component: RouterDoc
},
{
id: 'style',
label: 'Style',
component: StyleDoc
},
{
id: 'accessibility',
label: 'Accessibility',
component: AccessibilityDoc
}
];
}
}

0 comments on commit 96fc148

Please sign in to comment.