Project

General

Profile

1
import {Component, Input, Output, EventEmitter} from '@angular/core';
2

    
3
@Component({
4
    selector: 'search-results-per-page',
5
    template: `
6
      <!--      <span class="uk-grid">-->
7
      <!--        <div> Results per page:</div>-->
8
      <!--        <div class="uk-width-small">-->
9
      <!--        <mat-select class="uk-width-auto uk-text-bold matSelection" id="form-horizontal-select" name="select_results_per_page"-->
10
      <!--                    [(ngModel)]="size" (ngModelChange)="sizeChanged()"-->
11
      <!--                    [disableOptionCentering]="true"-->
12
      <!--                    panelClass="matSelectionPanel">-->
13
      <!--          <mat-option [value]="5" > 5</mat-option>-->
14
      <!--          <mat-option [value]="10">10</mat-option>-->
15
      <!--          <mat-option [value]="20">20</mat-option>-->
16
      <!--          <mat-option [value]="50">50</mat-option>-->
17
      <!--        </mat-select>-->
18
      <!--        </div>-->
19
      <!--      </span>-->
20

    
21
      <div>
22
        <mat-form-field class="matSelectionFormField">
23
          <mat-label>Results per page:</mat-label>
24
          <mat-select  [(ngModel)]="size" (ngModelChange)="sizeChanged()"
25
                       [disableOptionCentering]="true"
26
                       panelClass="matSelectionPanel"
27
                       class="uk-text-bold matSelection">
28
            <mat-option [value]="5" > 5</mat-option>
29
            <mat-option [value]="10">10</mat-option>
30
            <mat-option [value]="20">20</mat-option>
31
            <mat-option [value]="50">50</mat-option>
32
          </mat-select>
33
        </mat-form-field>
34
      </div>
35
    `
36
})
37

    
38
export class SearchResultsPerPageComponent {
39
    @Input() size: number;
40
    @Output() sizeChange  = new EventEmitter();
41

    
42
    constructor () {}
43

    
44
    ngOnInit() {}
45

    
46
    sizeChanged() {
47
      this.sizeChange.emit({
48
          value: this.size
49
      });
50
    }
51
}
(48-48/55)