2020-03-12 14:49:10 +01:00
|
|
|
import {Component, Input, Output, EventEmitter} from '@angular/core';
|
|
|
|
|
|
|
|
@Component({
|
2022-03-22 16:47:38 +01:00
|
|
|
selector: 'no-load-paging',
|
|
|
|
template: `
|
2022-04-20 16:40:18 +02:00
|
|
|
<div class="uk-margin-small-bottom">
|
|
|
|
<div class="uk-panel uk-grid uk-flex uk-flex-middle uk-child-width-1-1 uk-child-width-1-2@m" uk-grid>
|
|
|
|
<results-and-pages [type]="type" [page]="page" [pageSize]="pageSize" [totalResults]="totalResults"></results-and-pages>
|
2022-03-22 16:47:38 +01:00
|
|
|
<div>
|
|
|
|
<paging-no-load #paging [currentPage]="page"
|
2022-04-20 16:40:18 +02:00
|
|
|
customClasses="uk-margin-remove-bottom uk-flex-right"
|
2022-03-22 16:47:38 +01:00
|
|
|
[totalResults]="totalResults" [size]="pageSize"
|
|
|
|
(pageChange)="updatePage($event)">
|
|
|
|
</paging-no-load>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
`
|
2020-03-12 14:49:10 +01:00
|
|
|
})
|
|
|
|
export class NoLoadPagingComponent {
|
2022-03-22 16:47:38 +01:00
|
|
|
@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
|
|
|
|
});
|
|
|
|
}
|
2020-03-12 14:49:10 +01:00
|
|
|
}
|