-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsortable-table.component.html
More file actions
70 lines (70 loc) · 3.06 KB
/
Copy pathsortable-table.component.html
File metadata and controls
70 lines (70 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<header class="main-toolbar md-elevation-z2" [style.display]="!filterByInputValue && !filterBySelect && !title ? 'none' : 'flex'">
<h1 *ngIf="title" class="title">{{title}}</h1>
<md-input-container *ngIf="filterByInputValue">
<input #searchString
mdInput
[placeholder]="filterByInputValue?.inputPlaceholder"
(keyup)="onSearchInputChanged($event)">
</md-input-container>
<md-select *ngIf="filterByInputValue && filterByInputValue.fields.length > 1" [placeholder]="filterByInputValue?.selectPlaceholder"
[(ngModel)]="filterByInputValue.defaultField">
<md-option
*ngFor="let option of filterByInputValue.fields"
[value]="option.value">
{{ option.text }}
</md-option>
</md-select>
<span class="flex"></span>
<md-select class="filter-select" *ngIf="filterBySelect"
[placeholder]="filterBySelect?.placeholder"
(change)="filterBySelectChanged($event)"
[(ngModel)]="filterBySelect.defaultOption">
<md-option
*ngFor="let option of filterBySelect.options"
[value]="option.value">
{{ option.text }}
</md-option>
</md-select>
</header>
<main class="main-container" ngfbInfiniteScroll (scrolled)="onInfinite()">
<div class="table-content md-elevation-z2 column-filter">
<table class="table table-header">
<thead *ngIf="headers && headers.length">
<th *ngFor="let header of headers">
<div>
<p>{{header.name}}</p>
<button md-mini-fab *ngIf="header.sortable" (click)="sortBy(header.name)">
<md-icon>{{ fieldToSortBy === '-' + header.name || fieldToSortBy !== header.name ? 'arrow_upward' : 'arrow_downward'}}</md-icon>
</button>
</div>
</th>
</thead>
<tbody *ngIf="data && data.length">
<ng-template *ngFor="let item of data; let i = index; trackBy: trackByFn"
ngfbSortableItem
[item]="item"
[index]="i"
(itemChange)="onItemChange($event)"
[component]="itemComponent">
</ng-template>
</tbody>
</table>
</div>
<ngfb-loading [isLoading]="isLoading"></ngfb-loading>
</main>
<footer *ngIf="pagination || addNew">
<md-select *ngIf="pagination" [placeholder]="pagination?.placeholder"
(change)="paginationChanged($event.value)"
[ngModel]="pagination.defaultOption">
<md-option *ngFor="let option of pagination.options" [value]="option">{{ option }}</md-option>
</md-select>
<span class="flex"></span>
<button color="primary"
*ngIf="addNew"
md-fab
ngfbDialog
(onDialogResult)="onItemChange($event)"
[component]="addNew">
<i class="material-icons">exposure_plus_1</i>
</button>
</footer>