Skip to content

Commit

Permalink
Code format
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed May 3, 2024
1 parent b0f9586 commit 9df3367
Show file tree
Hide file tree
Showing 124 changed files with 195 additions and 201 deletions.
3 changes: 1 addition & 2 deletions src/app/components/api/treenode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ export interface TreeNode<T = any> {
* Mandatory unique key of the node.
*/
key?: string;
/**
/**
* Mandatory unique key of the node.
*/
loading?: boolean;

}
2 changes: 1 addition & 1 deletion src/app/components/breadcrumb/breadcrumb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class Breadcrumb implements AfterContentInit {
case 'item':
this.itemTemplate = item.template;
break;

default:
this.itemTemplate = item.template;
break;
Expand Down
3 changes: 1 addition & 2 deletions src/app/components/contextmenu/contextmenu.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ export interface ContextMenuTemplates {
/**
* Item instance.
*/
$implicit: MenuItem

$implicit: MenuItem;
}): TemplateRef<{ $implicit: MenuItem }>;
/**
* Custom template of submenuicon.
Expand Down
9 changes: 4 additions & 5 deletions src/app/components/megamenu/megamenu.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ export interface MegaMenuTemplates {
* Custom item template.
*/
item(context: {
/**
* Item instance.
*/
$implicit: MenuItem

/**
* Item instance.
*/
$implicit: MenuItem;
}): TemplateRef<{ $implicit: MenuItem }>;
/**
* Custom template of start.
Expand Down
9 changes: 3 additions & 6 deletions src/app/components/menu/menu.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,15 @@ export interface MenuTemplates {
/**
* Item instance.
*/
$implicit: MenuItem

$implicit: MenuItem;
}): TemplateRef<{ $implicit: MenuItem }>;
/**
/**
* Custom template of submenuheader.
*/
submenuheader(context: {
/**
* Item instance.
*/
$implicit: MenuItem

$implicit: MenuItem;
}): TemplateRef<{ $implicit: MenuItem }>;

}
1 change: 0 additions & 1 deletion src/app/components/menubar/menubar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ describe('Menubar', () => {

expect(firstParentEl?.parent?.parent?.nativeElement.className).toContain('p-menuitem-active');
expect(secondParentEl?.parent?.parent?.nativeElement.className).not.toContain('p-menuitem-active');

});

it('should show router items', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/menubar/menubar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ export class Menubar implements AfterContentInit, OnDestroy, OnInit {
case 'item':
this.itemTemplate = item.template;
break;

default:
this.itemTemplate = item.template;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/paginator/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,4 +558,4 @@ export class Paginator implements OnInit, AfterContentInit, OnChanges {
exports: [Paginator, DropdownModule, InputNumberModule, FormsModule, SharedModule],
declarations: [Paginator]
})
export class PaginatorModule {}
export class PaginatorModule {}
9 changes: 4 additions & 5 deletions src/app/components/panelmenu/panelmenu.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ export interface PanelMenuTemplates {
* Custom item template.
*/
item(context: {
/**
* Item instance.
*/
$implicit: MenuItem

/**
* Item instance.
*/
$implicit: MenuItem;
}): TemplateRef<{ $implicit: MenuItem }>;
/**
* Custom template of submenuicon.
Expand Down
47 changes: 23 additions & 24 deletions src/app/components/panelmenu/panelmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -742,31 +742,30 @@ export class PanelMenuList implements OnChanges {
(keydown)="onHeaderKeyDown($event, item, i)"
>
<div class="p-panelmenu-header-content">
<ng-container *ngIf="!headerContentTemplate">
<a
*ngIf="!getItemProp(item, 'routerLink')"
[attr.href]="getItemProp(item, 'url')"
[attr.tabindex]="-1"
[target]="getItemProp(item, 'target')"
[attr.title]="getItemProp(item, 'title')"
class="p-panelmenu-header-action"
[attr.data-pc-section]="'headeraction'"
>
<ng-container *ngIf="isItemGroup(item)">
<ng-container *ngIf="!submenuIconTemplate">
<ChevronDownIcon [styleClass]="'p-submenu-icon'" *ngIf="isItemActive(item)" />
<ChevronRightIcon [styleClass]="'p-submenu-icon'" *ngIf="!isItemActive(item)" />
<ng-container *ngIf="!headerContentTemplate">
<a
*ngIf="!getItemProp(item, 'routerLink')"
[attr.href]="getItemProp(item, 'url')"
[attr.tabindex]="-1"
[target]="getItemProp(item, 'target')"
[attr.title]="getItemProp(item, 'title')"
class="p-panelmenu-header-action"
[attr.data-pc-section]="'headeraction'"
>
<ng-container *ngIf="isItemGroup(item)">
<ng-container *ngIf="!submenuIconTemplate">
<ChevronDownIcon [styleClass]="'p-submenu-icon'" *ngIf="isItemActive(item)" />
<ChevronRightIcon [styleClass]="'p-submenu-icon'" *ngIf="!isItemActive(item)" />
</ng-container>
<ng-template *ngTemplateOutlet="submenuIconTemplate"></ng-template>
</ng-container>
<ng-template *ngTemplateOutlet="submenuIconTemplate"></ng-template>
</ng-container>
<span class="p-menuitem-icon" [ngClass]="item.icon" *ngIf="item.icon" [ngStyle]="getItemProp(item, 'iconStyle')"></span>
<span class="p-menuitem-text" *ngIf="getItemProp(item, 'escape') !== false; else htmlLabel">{{ getItemProp(item, 'label') }}</span>
<ng-template #htmlLabel><span class="p-menuitem-text" [innerHTML]="getItemProp(item, 'label')"></span></ng-template>
<span class="p-menuitem-badge" *ngIf="getItemProp(item, 'badge')" [ngClass]="getItemProp(item, 'badgeStyleClass')">{{ getItemProp(item, 'badge') }}</span>
</a>
<span class="p-menuitem-icon" [ngClass]="item.icon" *ngIf="item.icon" [ngStyle]="getItemProp(item, 'iconStyle')"></span>
<span class="p-menuitem-text" *ngIf="getItemProp(item, 'escape') !== false; else htmlLabel">{{ getItemProp(item, 'label') }}</span>
<ng-template #htmlLabel><span class="p-menuitem-text" [innerHTML]="getItemProp(item, 'label')"></span></ng-template>
<span class="p-menuitem-badge" *ngIf="getItemProp(item, 'badge')" [ngClass]="getItemProp(item, 'badgeStyleClass')">{{ getItemProp(item, 'badge') }}</span>
</a>
</ng-container>
<ng-container *ngTemplateOutlet="headerContentTemplate, context:{$implicit : item}"></ng-container>
<ng-container *ngTemplateOutlet="headerContentTemplate; context: { $implicit: item }"></ng-container>
<a
*ngIf="getItemProp(item, 'routerLink')"
[routerLink]="getItemProp(item, 'routerLink')"
Expand Down Expand Up @@ -913,7 +912,7 @@ export class PanelMenu implements AfterContentInit {
case 'headercontent':
this.headerContentTemplate = item.template;
break;

case 'submenuicon':
this.submenuIconTemplate = item.template;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/picklist/picklist.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('PickList', () => {
fixture.detectChanges();

const sourceListItems = fixture.debugElement.query(By.css('.p-picklist-source-wrapper')).queryAll(By.css('.p-picklist-item'));
//expect(picklist.visibleOptionsSource).toBeDefined();
//expect(picklist.visibleOptionsSource).toBeDefined();
expect(picklist.visibleOptionsSource.length).toEqual(2);
expect(picklist.visibleOptionsSource[0].brand).toEqual('VW');
expect(picklist.visibleOptionsSource[1].brand).toEqual('Volvo');
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/scroller/scroller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ export class Scroller implements OnInit, AfterContentInit, AfterViewChecked, OnD
}

getRenderedRange() {
const calculateFirstInViewport = (_pos: number, _size: number) => (_size || _pos) ? Math.floor(_pos / (_size || _pos)) : 0;
const calculateFirstInViewport = (_pos: number, _size: number) => (_size || _pos ? Math.floor(_pos / (_size || _pos)) : 0);

let firstInViewport = this.first;
let lastInViewport: any = 0;
Expand Down Expand Up @@ -767,7 +767,7 @@ export class Scroller implements OnInit, AfterContentInit, AfterViewChecked, OnD
const contentPos = this.getContentPosition();
const contentWidth = (this.elementViewChild?.nativeElement ? this.elementViewChild.nativeElement.offsetWidth - contentPos.left : 0) || 0;
const contentHeight = (this.elementViewChild?.nativeElement ? this.elementViewChild.nativeElement.offsetHeight - contentPos.top : 0) || 0;
const calculateNumItemsInViewport = (_contentSize: number, _itemSize: number) => (_itemSize || _contentSize) ? Math.ceil(_contentSize / (_itemSize || _contentSize)) : 0;
const calculateNumItemsInViewport = (_contentSize: number, _itemSize: number) => (_itemSize || _contentSize ? Math.ceil(_contentSize / (_itemSize || _contentSize)) : 0);
const calculateNumToleratedItems = (_numItems: number) => Math.ceil(_numItems / 2);
const numItemsInViewport: any = this.both
? { rows: calculateNumItemsInViewport(contentHeight, (<number[]>this._itemSize)[0]), cols: calculateNumItemsInViewport(contentWidth, (<number[]>this._itemSize)[1]) }
Expand Down Expand Up @@ -897,7 +897,7 @@ export class Scroller implements OnInit, AfterContentInit, AfterViewChecked, OnD
const target = event.target;
const contentPos = this.getContentPosition();
const calculateScrollPos = (_pos: number, _cpos: number) => (_pos ? (_pos > _cpos ? _pos - _cpos : _pos) : 0);
const calculateCurrentIndex = (_pos: number, _size: number) => (_size || _pos) ? Math.floor(_pos / (_size || _pos)) : 0;
const calculateCurrentIndex = (_pos: number, _size: number) => (_size || _pos ? Math.floor(_pos / (_size || _pos)) : 0);
const calculateTriggerIndex = (_currentIndex: number, _first: number, _last: number, _num: number, _numT: number, _isScrollDownOrRight: any) => {
return _currentIndex <= _numT ? _numT : _isScrollDownOrRight ? _last - _num - _numT : _first + _numT - 1;
};
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/tieredmenu/tieredmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class TieredMenuSub implements AfterContentInit {
if (ObjectUtils.isNotEmpty(path)) {
this.positionSubmenu();
}
})
});
}

ngAfterContentInit(): void {
Expand Down Expand Up @@ -591,7 +591,7 @@ export class TieredMenu implements OnInit, AfterContentInit, OnDestroy {
case 'item':
this.itemTemplate = item.template;
break;

default:
this.itemTemplate = item.template;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/tree/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ export class Tree implements OnInit, AfterContentInit, OnChanges, OnDestroy, Blo
}

hasFilterActive() {
return this.filter && this.filterViewChild?.nativeElement?.value.length > 0
return this.filter && this.filterViewChild?.nativeElement?.value.length > 0;
}

getNodeWithKey(key: string, nodes: TreeNode<any>[]): TreeNode<any> | undefined {
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/autocomplete/basicdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface AutoCompleteCompleteEvent {
</p>
</app-docsectiontext>
<div class="card flex justify-content-center">
<p-autoComplete [(ngModel)]="selectedItem" [suggestions]="suggestions" (completeMethod)="search($event)" placeholder="Search"/>
<p-autoComplete [(ngModel)]="selectedItem" [suggestions]="suggestions" (completeMethod)="search($event)" placeholder="Search" />
</div>
<app-code [code]="code" selector="autocomplete-basic-demo"></app-code>`
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/autocomplete/disableddoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface AutoCompleteCompleteEvent {
<p>When <i>disabled</i> is present, the element cannot be edited and focused.</p>
</app-docsectiontext>
<div class="card flex justify-content-center">
<p-autoComplete [(ngModel)]="selectedItem" [suggestions]="suggestions" placeholder="Search" (completeMethod)="search($event)" [disabled]="true"/>
<p-autoComplete [(ngModel)]="selectedItem" [suggestions]="suggestions" placeholder="Search" (completeMethod)="search($event)" [disabled]="true" />
</div>
<app-code [code]="code" selector="autocomplete-disabled-demo"></app-code>`
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/autocomplete/filleddoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface AutoCompleteCompleteEvent {
<p>Specify the <i>variant</i> property as <i>filled</i> to display the component with a higher visual emphasis than the default <i>outlined</i> style.</p>
</app-docsectiontext>
<div class="card flex justify-content-center">
<p-autoComplete [(ngModel)]="selectedItem" [suggestions]="suggestions" (completeMethod)="search($event)" variant="filled"/>
<p-autoComplete [(ngModel)]="selectedItem" [suggestions]="suggestions" (completeMethod)="search($event)" variant="filled" />
</div>
<app-code [code]="code" selector="autocomplete-filled-demo"></app-code>`
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/autocomplete/forceselectiondoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface AutoCompleteCompleteEvent {
<p>ForceSelection mode validates the manual input to check whether it also exists in the suggestions list, if not the input value is cleared to make sure the value passed to the model is always one of the suggestions.</p>
</app-docsectiontext>
<div class="card flex justify-content-center">
<p-autoComplete [(ngModel)]="selectedCountry" [forceSelection]="true" [suggestions]="filteredCountries" (completeMethod)="filterCountry($event)" field="name"/>
<p-autoComplete [(ngModel)]="selectedCountry" [forceSelection]="true" [suggestions]="filteredCountries" (completeMethod)="filterCountry($event)" field="name" />
</div>
<app-code [code]="code" selector="autocomplete-force-selection-demo"></app-code>`
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/autocomplete/multipledoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface AutoCompleteCompleteEvent {
</app-docsectiontext>
<div class="card">
<span class="p-fluid">
<p-autoComplete [(ngModel)]="selectedItems" [suggestions]="items" (completeMethod)="search($event)" [multiple]="true"/>
<p-autoComplete [(ngModel)]="selectedItems" [suggestions]="items" (completeMethod)="search($event)" [multiple]="true" />
</span>
</div>
<app-code [code]="code" selector="autocomplete-multiple-demo"></app-code>`
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/autocomplete/objectsdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface AutoCompleteCompleteEvent {
</p>
</app-docsectiontext>
<div class="card flex justify-content-center">
<p-autoComplete [(ngModel)]="selectedCountry" placeholder="Search" [suggestions]="filteredCountries" (completeMethod)="filterCountry($event)" field="name"/>
<p-autoComplete [(ngModel)]="selectedCountry" placeholder="Search" [suggestions]="filteredCountries" (completeMethod)="filterCountry($event)" field="name" />
</div>
<app-code [code]="code" selector="autocomplete-objects-demo"></app-code>`
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/autocomplete/reactiveformsdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface AutoCompleteCompleteEvent {
</app-docsectiontext>
<div class="card flex justify-content-center">
<form [formGroup]="formGroup">
<p-autoComplete formControlName="selectedCountry" [suggestions]="filteredCountries" (completeMethod)="filterCountry($event)" field="name" placeholder="Search"/>
<p-autoComplete formControlName="selectedCountry" [suggestions]="filteredCountries" (completeMethod)="filterCountry($event)" field="name" placeholder="Search" />
</form>
</div>
<app-code [code]="code" selector="autocomplete-reactive-forms-demo"></app-code>`
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/autocomplete/virtualscrolldoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface AutoCompleteCompleteEvent {
</p>
</app-docsectiontext>
<div class="card flex justify-content-center">
<p-autoComplete [(ngModel)]="selectedItem" [virtualScroll]="true" [suggestions]="filteredItems" [virtualScrollItemSize]="34" (completeMethod)="filterItems($event)" field="label" [dropdown]="true"/>
<p-autoComplete [(ngModel)]="selectedItem" [virtualScroll]="true" [suggestions]="filteredItems" [virtualScrollItemSize]="34" (completeMethod)="filterItems($event)" field="label" [dropdown]="true" />
</div>
<app-code [code]="code" selector="autocomplete-virtual-scroll-demo"></app-code>`
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/calendar/basicdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Code } from '@domain/code';
<p>Two-way value binding is defined using the standard <i>ngModel</i> directive referencing to a <i>Date</i> property.</p>
</app-docsectiontext>
<div class="card flex justify-content-center">
<p-calendar [(ngModel)]="date"/>
<p-calendar [(ngModel)]="date" />
</div>
<app-code [code]="code" selector="calendar-basic-demo"></app-code>
`
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/calendar/buttonbardoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Code } from '@domain/code';
<p>When <i>showButtonBar</i> is present, today and clear buttons are displayed at the footer.</p>
</app-docsectiontext>
<div class="card flex justify-content-center">
<p-calendar [(ngModel)]="date" [showButtonBar]="true"/>
<p-calendar [(ngModel)]="date" [showButtonBar]="true" />
</div>
<app-code [code]="code" selector="calendar-buttonbar-demo"></app-code>
`
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/calendar/disableddoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Code } from '@domain/code';
<p>When <i>disabled</i> is present, the element cannot be edited and focused.</p>
</app-docsectiontext>
<div class="card flex justify-content-center">
<p-calendar [(ngModel)]="date" [disabled]="true"/>
<p-calendar [(ngModel)]="date" [disabled]="true" />
</div>
<app-code [code]="code" selector="calendar-disabled-demo"></app-code>
`
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/calendar/formatdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { Code } from '@domain/code';
</ul>
</app-docsectiontext>
<div class="card flex justify-content-center">
<p-calendar [(ngModel)]="date" dateFormat="dd.mm.yy"/>
<p-calendar [(ngModel)]="date" dateFormat="dd.mm.yy" />
</div>
<app-code [code]="code" selector="calendar-format-demo"></app-code>
`
Expand Down
4 changes: 2 additions & 2 deletions src/app/showcase/doc/calendar/icondoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { Code } from '@domain/code';
<div class="card flex flex-wrap gap-3 p-fluid">
<div class="flex-auto">
<label for="buttondisplay" class="font-bold block mb-2"> Button </label>
<p-calendar [(ngModel)]="date1" [showIcon]="true" inputId="buttondisplay" [showOnFocus]="false"/>
<p-calendar [(ngModel)]="date1" [showIcon]="true" inputId="buttondisplay" [showOnFocus]="false" />
</div>
<div class="flex-auto">
<label for="icondisplay" class="font-bold block mb-2"> Default Icon </label>
<p-calendar [(ngModel)]="date2" [iconDisplay]="'input'" [showIcon]="true" inputId="icondisplay"/>
<p-calendar [(ngModel)]="date2" [iconDisplay]="'input'" [showIcon]="true" inputId="icondisplay" />
</div>
<div class="flex-auto">
Expand Down
Loading

0 comments on commit 9df3367

Please sign in to comment.