Skip to content

Commit

Permalink
Code format
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed May 30, 2024
1 parent 64da411 commit bd53b22
Show file tree
Hide file tree
Showing 211 changed files with 1,336 additions and 355 deletions.
11 changes: 9 additions & 2 deletions src/app/components/accordion/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,11 @@ export class AccordionTab implements AfterContentInit, OnDestroy {

accordion: Accordion;

constructor(@Inject(forwardRef(() => Accordion)) accordion: Accordion, public el: ElementRef, public changeDetector: ChangeDetectorRef) {
constructor(
@Inject(forwardRef(() => Accordion)) accordion: Accordion,
public el: ElementRef,
public changeDetector: ChangeDetectorRef
) {
this.accordion = accordion as Accordion;
this.id = UniqueComponentId();
}
Expand Down Expand Up @@ -437,7 +441,10 @@ export class Accordion implements BlockableUI, AfterContentInit, OnDestroy {

public tabs: AccordionTab[] = [];

constructor(public el: ElementRef, public changeDetector: ChangeDetectorRef) {}
constructor(
public el: ElementRef,
public changeDetector: ChangeDetectorRef
) {}

@HostListener('keydown', ['$event'])
onKeydown(event) {
Expand Down
6 changes: 5 additions & 1 deletion src/app/components/animate/animate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ export class Animate implements OnInit, AfterViewInit {

timeout: any;

constructor(private host: ElementRef, public el: ElementRef, public renderer: Renderer2) {}
constructor(
private host: ElementRef,
public el: ElementRef,
public renderer: Renderer2
) {}

ngOnInit() {
console.log('pAnimate directive is deprecated in 16.7.0 and will be removed in the future. Use pAnimateOnScroll directive instead');
Expand Down
8 changes: 7 additions & 1 deletion src/app/components/animateonscroll/animateonscroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ export class AnimateOnScroll implements OnInit, AfterViewInit {

animationEndListener: VoidFunction | undefined;

constructor(@Inject(DOCUMENT) private document: Document, @Inject(PLATFORM_ID) private platformId: any, private host: ElementRef, public el: ElementRef, public renderer: Renderer2) {}
constructor(
@Inject(DOCUMENT) private document: Document,
@Inject(PLATFORM_ID) private platformId: any,
private host: ElementRef,
public el: ElementRef,
public renderer: Renderer2
) {}

ngOnInit() {
if (isPlatformBrowser(this.platformId)) {
Expand Down
10 changes: 9 additions & 1 deletion src/app/components/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,15 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr
return typeof this.modelValue() === 'string' && this.optionValue;
}

constructor(@Inject(DOCUMENT) private document: Document, public el: ElementRef, public renderer: Renderer2, public cd: ChangeDetectorRef, public config: PrimeNGConfig, public overlayService: OverlayService, private zone: NgZone) {
constructor(
@Inject(DOCUMENT) private document: Document,
public el: ElementRef,
public renderer: Renderer2,
public cd: ChangeDetectorRef,
public config: PrimeNGConfig,
public overlayService: OverlayService,
private zone: NgZone
) {
effect(() => {
this.filled = ObjectUtils.isNotEmpty(this.modelValue());
});
Expand Down
6 changes: 5 additions & 1 deletion src/app/components/badge/badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ export class BadgeDirective implements OnChanges, AfterViewInit {
return this.id && !this.disabled;
}

constructor(@Inject(DOCUMENT) private document: Document, public el: ElementRef, private renderer: Renderer2) {}
constructor(
@Inject(DOCUMENT) private document: Document,
public el: ElementRef,
private renderer: Renderer2
) {}

public ngOnChanges({ value, size, severity, disabled }: SimpleChanges): void {
if (disabled) {
Expand Down
9 changes: 8 additions & 1 deletion src/app/components/blockui/blockui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,14 @@ export class BlockUI implements AfterViewInit, OnDestroy {

contentTemplate: TemplateRef<any> | undefined;

constructor(@Inject(DOCUMENT) private document: Document, public el: ElementRef, public cd: ChangeDetectorRef, public config: PrimeNGConfig, private renderer: Renderer2, @Inject(PLATFORM_ID) public platformId: any) {}
constructor(
@Inject(DOCUMENT) private document: Document,
public el: ElementRef,
public cd: ChangeDetectorRef,
public config: PrimeNGConfig,
private renderer: Renderer2,
@Inject(PLATFORM_ID) public platformId: any
) {}

ngAfterViewInit() {
if (this._blocked) this.block();
Expand Down
5 changes: 4 additions & 1 deletion src/app/components/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ export class ButtonDirective implements AfterViewInit, OnDestroy {
</defs>
</svg>`;

constructor(public el: ElementRef, @Inject(DOCUMENT) private document: Document) {}
constructor(
public el: ElementRef,
@Inject(DOCUMENT) private document: Document
) {}

ngAfterViewInit() {
DomHandler.addMultipleClasses(this.htmlElement, this.getStyleClass().join(' '));
Expand Down
2 changes: 0 additions & 2 deletions src/app/components/calendar/calendar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,6 @@ describe('Calendar', () => {
tick(150);
fixture.detectChanges();


dates[1].nativeElement.click();
tick(150);
fixture.detectChanges();
Expand All @@ -1524,7 +1523,6 @@ describe('Calendar', () => {
tick(150);
fixture.detectChanges();


dates[1].nativeElement.click();
tick(150);
fixture.detectChanges();
Expand Down
10 changes: 9 additions & 1 deletion src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,15 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor {
return this.currentView === 'year' ? this.getTranslation('nextDecade') : this.currentView === 'month' ? this.getTranslation('nextYear') : this.getTranslation('nextMonth');
}

constructor(@Inject(DOCUMENT) private document: Document, public el: ElementRef, public renderer: Renderer2, public cd: ChangeDetectorRef, private zone: NgZone, private config: PrimeNGConfig, public overlayService: OverlayService) {
constructor(
@Inject(DOCUMENT) private document: Document,
public el: ElementRef,
public renderer: Renderer2,
public cd: ChangeDetectorRef,
private zone: NgZone,
private config: PrimeNGConfig,
public overlayService: OverlayService
) {
this.window = this.document.defaultView as Window;
}

Expand Down
10 changes: 9 additions & 1 deletion src/app/components/carousel/carousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,15 @@ export class Carousel implements AfterContentInit {

window: Window;

constructor(public el: ElementRef, public zone: NgZone, public cd: ChangeDetectorRef, private renderer: Renderer2, @Inject(DOCUMENT) private document: Document, @Inject(PLATFORM_ID) private platformId: any, private config: PrimeNGConfig) {
constructor(
public el: ElementRef,
public zone: NgZone,
public cd: ChangeDetectorRef,
private renderer: Renderer2,
@Inject(DOCUMENT) private document: Document,
@Inject(PLATFORM_ID) private platformId: any,
private config: PrimeNGConfig
) {
this.totalShiftedItems = this.page * this.numScroll * -1;
this.window = this.document.defaultView as Window;
}
Expand Down
12 changes: 10 additions & 2 deletions src/app/components/cascadeselect/cascadeselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ export class CascadeSelectSub implements OnInit {
return this.config.getTranslation(TranslationKeys.ARIA)['listLabel'];
}

constructor(private el: ElementRef, public config: PrimeNGConfig) {}
constructor(
private el: ElementRef,
public config: PrimeNGConfig
) {}

ngOnInit() {
if (!this.root) {
Expand Down Expand Up @@ -1303,7 +1306,12 @@ export class CascadeSelect implements OnInit, AfterContentInit {
return grouped ? this.getOptionGroupLabel(processedOption.option) : this.getOptionLabel(processedOption.option);
}

constructor(private el: ElementRef, private cd: ChangeDetectorRef, private config: PrimeNGConfig, public overlayService: OverlayService) {
constructor(
private el: ElementRef,
private cd: ChangeDetectorRef,
private config: PrimeNGConfig,
public overlayService: OverlayService
) {
effect(() => {
const activeOptionPath = this.activeOptionPath();
if (ObjectUtils.isNotEmpty(activeOptionPath)) {
Expand Down
6 changes: 5 additions & 1 deletion src/app/components/chart/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ export class UIChart implements AfterViewInit, OnDestroy {

chart: any;

constructor(@Inject(PLATFORM_ID) private platformId: any, public el: ElementRef, private zone: NgZone) {}
constructor(
@Inject(PLATFORM_ID) private platformId: any,
public el: ElementRef,
private zone: NgZone
) {}

ngAfterViewInit() {
this.initChart();
Expand Down
6 changes: 5 additions & 1 deletion src/app/components/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,11 @@ export class Checkbox implements ControlValueAccessor {

focused: boolean = false;

constructor(public cd: ChangeDetectorRef, private readonly injector: Injector, public config: PrimeNGConfig) {}
constructor(
public cd: ChangeDetectorRef,
private readonly injector: Injector,
public config: PrimeNGConfig
) {}

ngAfterContentInit() {
this.templates.forEach((item) => {
Expand Down
21 changes: 10 additions & 11 deletions src/app/components/chips/chips.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('Chips', () => {
inputEl.nativeElement.value = 'primeng';
fixture.detectChanges();

let event = { code: "Enter", target: inputEl.nativeElement, preventDefault() {} };
let event = { code: 'Enter', target: inputEl.nativeElement, preventDefault() {} };
chips.onKeyDown(event);
fixture.detectChanges();

Expand All @@ -123,7 +123,7 @@ describe('Chips', () => {
inputEl.nativeElement.value = 'primeng';
fixture.detectChanges();

let event = { code: "Enter", target: inputEl.nativeElement, preventDefault() {} };
let event = { code: 'Enter', target: inputEl.nativeElement, preventDefault() {} };
chips.onKeyDown(event as KeyboardEvent);
fixture.detectChanges();

Expand All @@ -146,7 +146,7 @@ describe('Chips', () => {
inputEl.nativeElement.value = 'primeng';
fixture.detectChanges();

let event = { code: "Enter", target: inputEl.nativeElement, preventDefault() {} };
let event = { code: 'Enter', target: inputEl.nativeElement, preventDefault() {} };
chips.onKeyDown(event as KeyboardEvent);
fixture.detectChanges();

Expand All @@ -169,7 +169,7 @@ describe('Chips', () => {
inputEl.nativeElement.value = 'primeng';
fixture.detectChanges();

let event = { code: "Enter", target: inputEl.nativeElement, preventDefault() {} };
let event = { code: 'Enter', target: inputEl.nativeElement, preventDefault() {} };
chips.onKeyDown(event as KeyboardEvent);
fixture.detectChanges();

Expand All @@ -194,7 +194,7 @@ describe('Chips', () => {
inputEl.nativeElement.value = 'primeng';
fixture.detectChanges();

let event = { code: "Tab", target: inputEl.nativeElement, preventDefault() {} };
let event = { code: 'Tab', target: inputEl.nativeElement, preventDefault() {} };
chips.onKeyDown(event as KeyboardEvent);
fixture.detectChanges();

Expand Down Expand Up @@ -232,7 +232,7 @@ describe('Chips', () => {
inputEl.nativeElement.value = 'primeng';
fixture.detectChanges();

let event = { code: "Enter", target: inputEl.nativeElement, preventDefault() {} };
let event = { code: 'Enter', target: inputEl.nativeElement, preventDefault() {} };
chips.onKeyDown(event as KeyboardEvent);
fixture.detectChanges();

Expand All @@ -242,15 +242,15 @@ describe('Chips', () => {
chips.onKeyDown(event as KeyboardEvent);
fixture.detectChanges();

event.code = "Backspace";
event.code = 'Backspace';
chips.onKeyDown(event as KeyboardEvent);
fixture.detectChanges();

expect(chips.value.length).toEqual(2);
expect(chips.value[0]).toEqual('primeng');
expect(chips.value[1]).toEqual('primeng');
expect(inputEl.nativeElement.disabled).toEqual(true);
event.code = "Backspace";
event.code = 'Backspace';
chips.onKeyDown(event as KeyboardEvent);
chips.updateMaxedOut();
fixture.detectChanges();
Expand Down Expand Up @@ -279,8 +279,7 @@ describe('Chips', () => {
fixture.detectChanges();

// let event = { which: 8, preventDefault() {} };
let event = { code: "Backspace", target: inputEl.nativeElement, preventDefault() {} };

let event = { code: 'Backspace', target: inputEl.nativeElement, preventDefault() {} };

chips.onKeyDown(event as KeyboardEvent);
chips.onKeyDown(event as KeyboardEvent);
Expand Down Expand Up @@ -320,7 +319,7 @@ describe('Chips', () => {

chips.disabled = true;
fixture.detectChanges();
let event: Event = new Event("Keyboard");
let event: Event = new Event('Keyboard');

chips.removeItem(event, 0);
fixture.detectChanges();
Expand Down
11 changes: 8 additions & 3 deletions src/app/components/chips/chips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const CHIPS_VALUE_ACCESSOR: any = {
'p-disabled': disabled,
'p-focus': focused,
'p-inputwrapper-filled': (value && value.length) || (this.inputViewChild?.nativeElement.value && this.inputViewChild?.nativeElement.value.length),
'p-inputwrapper-focus': focused,
'p-inputwrapper-focus': focused
}"
[ngStyle]="style"
[class]="styleClass"
Expand Down Expand Up @@ -310,7 +310,12 @@ export class Chips implements AfterContentInit, ControlValueAccessor {
return this.max && this.value && this.max === this.value.length;
}

constructor(@Inject(DOCUMENT) private document: Document, public el: ElementRef, public cd: ChangeDetectorRef, public config: PrimeNGConfig) {}
constructor(
@Inject(DOCUMENT) private document: Document,
public el: ElementRef,
public cd: ChangeDetectorRef,
public config: PrimeNGConfig
) {}

ngAfterContentInit() {
this.templates.forEach((item) => {
Expand Down Expand Up @@ -365,7 +370,7 @@ export class Chips implements AfterContentInit, ControlValueAccessor {

case 'Space':
if (this.focusedIndex !== null && this.value && this.value.length > 0) {
this.onItemClick(event, this.value[this.focusedIndex]);
this.onItemClick(event, this.value[this.focusedIndex]);
}
break;

Expand Down
10 changes: 9 additions & 1 deletion src/app/components/confirmdialog/confirmdialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,15 @@ export class ConfirmDialog implements AfterContentInit, OnInit, OnDestroy {

translationSubscription: Subscription | undefined;

constructor(public el: ElementRef, public renderer: Renderer2, private confirmationService: ConfirmationService, public zone: NgZone, private cd: ChangeDetectorRef, public config: PrimeNGConfig, @Inject(DOCUMENT) private document: Document) {
constructor(
public el: ElementRef,
public renderer: Renderer2,
private confirmationService: ConfirmationService,
public zone: NgZone,
private cd: ChangeDetectorRef,
public config: PrimeNGConfig,
@Inject(DOCUMENT) private document: Document
) {
this.subscription = this.confirmationService.requireConfirmation$.subscribe((confirmation) => {
if (!confirmation) {
this.hide();
Expand Down
11 changes: 9 additions & 2 deletions src/app/components/contextmenu/contextmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ import { ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primeng/utils';
pTooltip
[tooltipOptions]="getItemProp(processedItem, 'tooltipOptions')"
>
<div [attr.data-pc-section]="'content'" class="p-menuitem-content" (click)="onItemClick($event, processedItem)" (mouseenter)="onItemMouseEnter({$event, processedItem})">
<div [attr.data-pc-section]="'content'" class="p-menuitem-content" (click)="onItemClick($event, processedItem)" (mouseenter)="onItemMouseEnter({ $event, processedItem })">
<ng-container *ngIf="!itemTemplate">
<a
*ngIf="!getItemProp(processedItem, 'routerLink')"
Expand Down Expand Up @@ -237,7 +237,14 @@ export class ContextMenuSub {

@ViewChild('sublist') sublistViewChild: ElementRef;

constructor(@Inject(DOCUMENT) private document: Document, public el: ElementRef, public renderer: Renderer2, private cd: ChangeDetectorRef, @Inject(forwardRef(() => ContextMenu)) public contextMenu: ContextMenu, private ref: ViewContainerRef) {}
constructor(
@Inject(DOCUMENT) private document: Document,
public el: ElementRef,
public renderer: Renderer2,
private cd: ChangeDetectorRef,
@Inject(forwardRef(() => ContextMenu)) public contextMenu: ContextMenu,
private ref: ViewContainerRef
) {}

getItemProp(processedItem: any, name: string, params: any | null = null) {
return processedItem && processedItem.item ? ObjectUtils.getItemValue(processedItem.item[name], params) : undefined;
Expand Down
Loading

0 comments on commit bd53b22

Please sign in to comment.