2020-03-12 14:49:10 +01:00
|
|
|
import {Component, Input, Output, EventEmitter} from '@angular/core';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'no-load-paging',
|
|
|
|
template: `
|
|
|
|
<div class="paging-hr searchPaging uk-margin-small-bottom">
|
|
|
|
<div class="uk-panel uk-margin-small-top uk-grid uk-flex uk-flex-middle">
|
2021-01-22 15:36:06 +01:00
|
|
|
<div class="uk-width-1-1@s uk-width-1-2@m uk-text-uppercase" *ngIf="type && totalResults">
|
|
|
|
<span class="uk-text-bold">{{totalResults | number}}</span>
|
2020-03-12 14:49:10 +01:00
|
|
|
<span class="uk-text-muted uk-text-uppercase"> {{type}}, page </span>
|
2021-01-22 15:36:06 +01:00
|
|
|
<span class="uk-text-bold">{{page}}</span>
|
2020-03-12 14:49:10 +01:00
|
|
|
<span class="uk-text-muted uk-text-uppercase"> of </span>
|
2021-01-22 15:36:06 +01:00
|
|
|
<span class="uk-text-bold">{{paging.getTotalPages()}}</span>
|
2020-03-12 14:49:10 +01:00
|
|
|
</div>
|
|
|
|
<div class="float-children-right-at-medium margin-small-top-at-small uk-width-expand">
|
|
|
|
<paging-no-load #paging [currentPage]="page"
|
|
|
|
customClasses="uk-margin-remove-bottom"
|
|
|
|
[totalResults]="totalResults" [size]="pageSize"
|
|
|
|
(pageChange)="updatePage($event)">
|
|
|
|
</paging-no-load>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
`
|
|
|
|
})
|
|
|
|
export class NoLoadPagingComponent {
|
|
|
|
@Input() type: string;
|
|
|
|
@Input() page: number = 1;
|
|
|
|
@Input() pageSize: number = 10;
|
|
|
|
@Input() totalResults: number;
|
|
|
|
@Output() pageChange: EventEmitter<any> = new EventEmitter<any>();
|
|
|
|
|
|
|
|
public updatePage(event) {
|
|
|
|
this.pageChange.emit({
|
|
|
|
value: event.value
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|