1 |
61381
|
k.triantaf
|
import {Component, Input, Output, EventEmitter} from '@angular/core';
|
2 |
|
|
|
3 |
|
|
@Component({
|
4 |
|
|
selector: 'no-load-paging',
|
5 |
|
|
template: `
|
6 |
|
|
<div class="paging-hr searchPaging uk-margin-small-bottom">
|
7 |
|
|
<div class="uk-panel uk-margin-small-top uk-grid uk-flex uk-flex-middle">
|
8 |
|
|
<div class="uk-width-1-1@s uk-width-1-2@m uk-text-uppercase" *ngIf="type && totalResults">
|
9 |
|
|
<span class="uk-text-bold">{{totalResults | number}}</span>
|
10 |
|
|
<span class="uk-text-muted uk-text-uppercase"> {{type}}, page </span>
|
11 |
|
|
<span class="uk-text-bold">{{page}}</span>
|
12 |
|
|
<span class="uk-text-muted uk-text-uppercase"> of </span>
|
13 |
|
|
<span class="uk-text-bold">{{paging.getTotalPages() | number}}</span>
|
14 |
|
|
</div>
|
15 |
|
|
<div class="float-children-right-at-medium margin-small-top-at-small uk-width-expand">
|
16 |
|
|
<paging-no-load #paging [currentPage]="page"
|
17 |
|
|
customClasses="uk-margin-remove-bottom"
|
18 |
|
|
[totalResults]="totalResults" [size]="pageSize"
|
19 |
|
|
(pageChange)="updatePage($event)">
|
20 |
|
|
</paging-no-load>
|
21 |
|
|
</div>
|
22 |
|
|
</div>
|
23 |
|
|
</div>
|
24 |
|
|
`
|
25 |
|
|
})
|
26 |
|
|
export class NoLoadPagingComponent {
|
27 |
|
|
@Input() type: string;
|
28 |
|
|
@Input() page: number = 1;
|
29 |
|
|
@Input() pageSize: number = 10;
|
30 |
|
|
@Input() totalResults: number;
|
31 |
|
|
@Output() pageChange: EventEmitter<any> = new EventEmitter<any>();
|
32 |
|
|
|
33 |
|
|
public updatePage(event) {
|
34 |
|
|
this.pageChange.emit({
|
35 |
|
|
value: event.value
|
36 |
|
|
});
|
37 |
|
|
}
|
38 |
|
|
}
|