36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import {Component, Input, Output, EventEmitter} from '@angular/core';
|
|
|
|
@Component({
|
|
selector: 'search-results-per-page',
|
|
template: `
|
|
<div>
|
|
<mat-form-field class="matSelectionFormField">
|
|
<mat-label>Results per page:</mat-label>
|
|
<mat-select [(ngModel)]="size" (ngModelChange)="sizeChanged()"
|
|
[disableOptionCentering]="true"
|
|
panelClass="matSelectionPanel"
|
|
class="uk-text-bold matSelection">
|
|
<mat-option [value]="5" [disabled]="isDisabled"> 5</mat-option>
|
|
<mat-option [value]="10" [disabled]="isDisabled">10</mat-option>
|
|
<mat-option [value]="20" [disabled]="isDisabled">20</mat-option>
|
|
<mat-option [value]="50" [disabled]="isDisabled">50</mat-option>
|
|
</mat-select>
|
|
</mat-form-field>
|
|
</div>
|
|
`
|
|
})
|
|
|
|
export class SearchResultsPerPageComponent {
|
|
@Input() isDisabled: boolean = false;
|
|
@Input() size: number;
|
|
@Output() sizeChange = new EventEmitter();
|
|
|
|
constructor () {}
|
|
|
|
ngOnInit() {}
|
|
|
|
sizeChanged() {
|
|
this.sizeChange.emit(this.size);
|
|
}
|
|
}
|