Skip to content

Commit

Permalink
formatted code
Browse files Browse the repository at this point in the history
  • Loading branch information
SoyDiego committed Nov 22, 2023
1 parent a7d5b1d commit 60a42bf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
this.updateEditableLabel();
}

if(visibleOptions && ObjectUtils.isNotEmpty(visibleOptions)) {
if (visibleOptions && ObjectUtils.isNotEmpty(visibleOptions)) {
this.selectedOption = visibleOptions[this.findSelectedOptionIndex()];
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/listbox/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ export class Listbox implements AfterContentInit, OnInit, ControlValueAccessor,
return;
}

event && this.onClick.emit({ originalEvent: event, option, value: this.value, });
event && this.onClick.emit({ originalEvent: event, option, value: this.value });

this.multiple ? this.onOptionSelectMultiple(event, option) : this.onOptionSelectSingle(event, option);
this.optionTouched = false;
Expand Down
22 changes: 15 additions & 7 deletions src/app/components/tabview/tabview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,16 @@ export class TabPanel implements AfterContentInit, OnDestroy {
template: `
<div [ngClass]="{ 'p-tabview p-component': true, 'p-tabview-scrollable': scrollable }" [ngStyle]="style" [class]="styleClass" [attr.data-pc-name]="'tabview'">
<div #elementToObserve class="p-tabview-nav-container">
<button *ngIf="scrollable && !backwardIsDisabled && autoHideButtons" #prevBtn class="p-tabview-nav-prev p-tabview-nav-btn p-link" (click)="navBackward()" [attr.tabindex]="tabindex" [attr.aria-label]="prevButtonAriaLabel" type="button" pRipple>
<button
*ngIf="scrollable && !backwardIsDisabled && autoHideButtons"
#prevBtn
class="p-tabview-nav-prev p-tabview-nav-btn p-link"
(click)="navBackward()"
[attr.tabindex]="tabindex"
[attr.aria-label]="prevButtonAriaLabel"
type="button"
pRipple
>
<ChevronLeftIcon *ngIf="!previousIconTemplate" [attr.aria-hidden]="true" />
<ng-template *ngTemplateOutlet="previousIconTemplate"></ng-template>
</button>
Expand Down Expand Up @@ -473,7 +482,7 @@ export class TabView implements AfterContentInit, AfterViewChecked, OnDestroy, B
resizeObserver: Nullable<ResizeObserver>;

container: HTMLDivElement | undefined;

list: HTMLUListElement | undefined;

buttonVisible: boolean;
Expand Down Expand Up @@ -504,26 +513,25 @@ export class TabView implements AfterContentInit, AfterViewChecked, OnDestroy, B

ngAfterViewInit() {
if (isPlatformBrowser(this.platformId)) {
if(this.autoHideButtons) {
if (this.autoHideButtons) {
this.bindResizeObserver();
}

}
}

bindResizeObserver() {
this.container = DomHandler.findSingle(this.el.nativeElement, '[data-pc-section="navcontent"]');
this.list = DomHandler.findSingle(this.el.nativeElement,'[data-pc-section="nav"]');
this.list = DomHandler.findSingle(this.el.nativeElement, '[data-pc-section="nav"]');

this.resizeObserver = new ResizeObserver(() => {
if(this.list.offsetWidth > this.container.offsetWidth) {
if (this.list.offsetWidth > this.container.offsetWidth) {
this.buttonVisible = true;
} else {
this.buttonVisible = false;
}
this.updateButtonState();
this.cd.detectChanges();
})
});
this.resizeObserver.observe(this.container);
}

Expand Down
1 change: 0 additions & 1 deletion src/app/showcase/doc/dropdown/templatedoc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { Code } from '../../domain/code';


@Component({
selector: 'dropdown-template-demo',
template: ` <section class="py-4">
Expand Down

0 comments on commit 60a42bf

Please sign in to comment.