Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/primefaces/primeng
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Nov 28, 2023
2 parents 0578539 + cae5b42 commit 2c5bb63
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 59 deletions.
77 changes: 20 additions & 57 deletions src/app/showcase/doc/tabview/basicdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,68 +8,31 @@ import { Code } from '../../domain/code';
<p>TabView consists of one or more <i>TabPanel</i> elements.</p>
</app-docsectiontext>
<div class="card">
<div class="h-full w-full pt-5">
<div class="flex h-full overflow-y-hidden p-0 w-full">
<div class="h-full p-2 w-1/3 overflow-auto flex-auto">
<p-tabView [scrollable]="true" styleClass="h-full overflow-hidden">
<p-tabPanel *ngFor="let tab of scrollableTabs" [header]="tab.title">
<p>{{ tab.content }}</p>
</p-tabPanel>
</p-tabView>
</div>
<div class="h-full p-2 w-1/3 overflow-auto flex-auto">
<p-tabView [scrollable]="true" styleClass="h-full overflow-hidden grow">
<p-tabPanel *ngFor="let tab of scrollableTabs2" [header]="tab.title">
<p>{{ tab.content }}</p>
</p-tabPanel>
</p-tabView>
</div>
<div class="h-full p-2 w-1/3 overflow-auto flex-auto">
<p-tabView [scrollable]="true" styleClass="h-full overflow-hidden grow">
<p-tabPanel *ngFor="let tab of scrollableTabs3" [header]="tab.title">
<p>{{ tab.content }}</p>
</p-tabPanel>
</p-tabView>
</div>
</div>
</div>
<p-tabView>
<p-tabPanel header="Header I">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</p-tabPanel>
<p-tabPanel header="Header II">
<p>
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim
ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Consectetur, adipisci velit, sed quia non numquam eius modi.
</p>
</p-tabPanel>
<p-tabPanel header="Header III">
<p>
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa
qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus.
</p>
</p-tabPanel>
</p-tabView>
</div>
<app-code [code]="code" selector="tab-view-basic-demo"></app-code>
`
})
export class BasicDoc {
activeIndex: number = 0;

scrollableTabs: any[];

scrollableTabs2: any[];

scrollableTabs3: any[];

scrollableTabs4: any[];

ngOnInit() {
this.scrollableTabs = Array.from({ length: 3 }, (_, i) => ({
title: 'Title',
content: 'Content'
}));

this.scrollableTabs2 = Array.from({ length: 5 }, (_, i) => ({
title: 'Title',
content: 'Content'
}));

this.scrollableTabs3 = Array.from({ length: 2 }, (_, i) => ({
title: 'Title',
content: 'Content'
}));

this.scrollableTabs4 = Array.from({ length: 30 }, (_, i) => ({
title: 'Title',
content: 'Content'
}));
}
code: Code = {
basic: `<p-tabView>
<p-tabPanel header="Header I">
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/layout/topbar/app.topbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

<ul class="flex list-none m-0 p-0 gap-2 align-items-center ">
<li>
<div id="docsearch"></div>
<div #docSearch id="docsearch"></div>
</li>
<li>
<a href="https://github.com/primefaces/primeng" target="_blank" rel="noopener noreferrer"
Expand Down
10 changes: 9 additions & 1 deletion src/app/showcase/layout/topbar/app.topbar.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule, DOCUMENT, isPlatformBrowser } from '@angular/common';
import { Component, ElementRef, EventEmitter, Inject, Input, OnDestroy, OnInit, Output, PLATFORM_ID, Renderer2 } from '@angular/core';
import { ChangeDetectorRef, Component, ElementRef, EventEmitter, Inject, Input, OnDestroy, OnInit, Output, PLATFORM_ID, Renderer2, ViewChild } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { Router, RouterModule } from '@angular/router';
import docsearch from '@docsearch/js';
Expand All @@ -19,6 +19,8 @@ export class AppTopBarComponent implements OnInit, OnDestroy {

@Input() showMenuButton = true;

@ViewChild('docSearch') docSearch: ElementRef;

@Output() onDarkModeSwitch = new EventEmitter<any>();

versions: any[] = Versions;
Expand All @@ -42,6 +44,12 @@ export class AppTopBarComponent implements OnInit, OnDestroy {
}
}

ngAfterViewChecked() {
if (!this.docSearch.nativeElement.children.length) {
this.initDocSearch();
}
}

toggleMenu() {
if (this.configService.state.menuActive) {
this.configService.hideMenu();
Expand Down

1 comment on commit 2c5bb63

@vercel
Copy link

@vercel vercel bot commented on 2c5bb63 Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.