2020-11-11 15:43:13 +01:00
|
|
|
import {Component, Input} from '@angular/core';
|
2018-02-15 11:36:12 +01:00
|
|
|
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
@Component({
|
2021-01-22 15:36:06 +01:00
|
|
|
selector: 'search-paging',
|
|
|
|
template: `
|
2022-01-21 09:20:46 +01:00
|
|
|
<paging *ngIf="results && searchUtils.totalResults > searchUtils.size"
|
|
|
|
[currentPage]="searchUtils.page" [totalResults]="searchUtils.totalResults" [baseUrl]="baseUrl"
|
|
|
|
[size]="searchUtils.size" [parameterNames]="parameterNames" [parameterValues]="parameterValues"
|
|
|
|
[isDisabled]="isDisabled">
|
|
|
|
</paging>
|
|
|
|
<paging *ngIf="!loadPaging && oldTotalResults > searchUtils.size && searchUtils.status == errorCodes.LOADING"
|
|
|
|
[currentPage]="searchUtils.page" [totalResults]="oldTotalResults" [baseUrl]="baseUrl"
|
|
|
|
[size]="searchUtils.size" [parameterNames]="parameterNames" [parameterValues]="parameterValues"
|
|
|
|
[isDisabled]="isDisabled">
|
|
|
|
</paging>
|
2021-01-22 15:36:06 +01:00
|
|
|
`
|
2017-12-19 13:53:46 +01:00
|
|
|
})
|
|
|
|
export class SearchPagingComponent {
|
2021-01-22 15:36:06 +01:00
|
|
|
@Input() isDisabled: boolean = false;
|
|
|
|
@Input() searchUtils;
|
|
|
|
@Input() results;
|
|
|
|
@Input() baseUrl;
|
|
|
|
@Input() type;
|
|
|
|
@Input() parameterNames: string[];
|
|
|
|
@Input() parameterValues: string[];
|
|
|
|
@Input() loadPaging: boolean = true;
|
|
|
|
@Input() oldTotalResults: number = 0;
|
|
|
|
|
|
|
|
public totalResults: number = 0;
|
|
|
|
public errorCodes: ErrorCodes = new ErrorCodes();
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|