openaire-library/searchPages/searchUtils/searchResultsPerPage.compon...

52 lines
1.8 KiB
TypeScript
Raw Normal View History

import {Component, Input, Output, EventEmitter} from '@angular/core';
@Component({
selector: 'search-results-per-page',
template: `
<!-- <span class="uk-grid">-->
<!-- <div> Results per page:</div>-->
<!-- <div class="uk-width-small">-->
<!-- <mat-select class="uk-width-auto uk-text-bold matSelection" id="form-horizontal-select" name="select_results_per_page"-->
<!-- [(ngModel)]="size" (ngModelChange)="sizeChanged()"-->
<!-- [disableOptionCentering]="true"-->
<!-- panelClass="matSelectionPanel">-->
<!-- <mat-option [value]="5" > 5</mat-option>-->
<!-- <mat-option [value]="10">10</mat-option>-->
<!-- <mat-option [value]="20">20</mat-option>-->
<!-- <mat-option [value]="50">50</mat-option>-->
<!-- </mat-select>-->
<!-- </div>-->
<!-- </span>-->
<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" > 5</mat-option>
<mat-option [value]="10">10</mat-option>
<mat-option [value]="20">20</mat-option>
<mat-option [value]="50">50</mat-option>
</mat-select>
</mat-form-field>
</div>
`
})
export class SearchResultsPerPageComponent {
@Input() size: number;
@Output() sizeChange = new EventEmitter();
constructor () {}
ngOnInit() {}
sizeChanged() {
this.sizeChange.emit({
value: this.size
});
}
}