-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
c7fb551
commit 8c9d77c
Showing
18 changed files
with
363 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
libs/vre/ui/ui/src/lib/incoming-resource-pager/incoming-resource-pager.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<div class="paging-container"> | ||
<div class="navigation"> | ||
<button mat-button class="pagination-button previous" [disabled]="pageIndex === 0" (click)="changePage( - 1)"> | ||
<mat-icon>west</mat-icon> | ||
<span>{{'uiControls.pager.previous' | translate}}</span> | ||
</button> | ||
<span class="fill-remaining-space"></span> | ||
<div class="range"> | ||
<span>{{itemRangeStart}} - </span> | ||
<span>{{itemRangeEnd }}</span> | ||
</div> | ||
<span class="fill-remaining-space"></span> | ||
<button mat-button class="pagination-button next" [disabled]="isLastOnPage" (click)="changePage(1)"> | ||
<span>{{'uiControls.pager.next' | translate}}</span> | ||
<mat-icon>east</mat-icon> | ||
</button> | ||
</div> | ||
</div> |
60 changes: 60 additions & 0 deletions
60
libs/vre/ui/ui/src/lib/incoming-resource-pager/incoming-resource-pager.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
@use '../../../../../../../apps/dsp-app/src/styles/config' as *; | ||
|
||
.paging-container { | ||
border-bottom: 1px solid rgba(0, 0, 0, 0.12); | ||
position: sticky !important; | ||
top: 0; | ||
background: $bright; | ||
z-index: 1; | ||
|
||
.navigation { | ||
display: flex; | ||
box-sizing: border-box; | ||
flex-direction: row; | ||
align-items: center; | ||
white-space: nowrap; | ||
padding: 0 16px; | ||
height: 60px; | ||
width: 100%; | ||
|
||
.pagination-button:disabled { | ||
span, | ||
mat-icon{ | ||
color: $cool_gray_300; | ||
} | ||
} | ||
|
||
.pagination-button { | ||
&.previous { | ||
span{ | ||
padding-left: 14px; | ||
} | ||
} | ||
|
||
&.next { | ||
span{ | ||
padding-right: 14px; | ||
} | ||
} | ||
|
||
span, | ||
mat-icon{ | ||
color: $primary; | ||
font-weight: 400; | ||
} | ||
} | ||
|
||
.range{ | ||
color: $cool_gray_500; | ||
font-weight: 300; | ||
} | ||
} | ||
} | ||
|
||
button.active { | ||
background-color: $black-12-opacity; | ||
} | ||
|
||
.link:hover { | ||
background-color: $black-12-opacity; | ||
} |
41 changes: 41 additions & 0 deletions
41
libs/vre/ui/ui/src/lib/incoming-resource-pager/incoming-resource-pager.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; | ||
import { MatButtonModule } from '@angular/material/button'; | ||
import { MatIconModule } from '@angular/material/icon'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
|
||
@Component({ | ||
standalone: true, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
selector: 'dasch-swiss-app-incoming-resource-pager', | ||
imports: [MatIconModule, MatButtonModule, TranslateModule], | ||
templateUrl: './incoming-resource-pager.component.html', | ||
styleUrls: ['./incoming-resource-pager.component.scss'], | ||
}) | ||
export class IncomingResourcePagerComponent { | ||
@Input() pageSize = 25; | ||
@Input() lastItemOfPage = 0; | ||
@Output() pageChanged: EventEmitter<number> = new EventEmitter<number>(); | ||
|
||
private _pageIndex = 0; | ||
|
||
get pageIndex(): number { | ||
return this._pageIndex; | ||
} | ||
|
||
get isLastOnPage(): boolean { | ||
return this.lastItemOfPage !== undefined && this.lastItemOfPage < this.pageSize; | ||
} | ||
|
||
get itemRangeStart(): number { | ||
return this.pageSize * this._pageIndex + 1; | ||
} | ||
|
||
get itemRangeEnd(): number { | ||
return this.lastItemOfPage ? this.lastItemOfPage : this.pageSize * (this._pageIndex + 1); | ||
} | ||
|
||
changePage(dir: 1 | -1) { | ||
this._pageIndex += dir; | ||
this.pageChanged.emit(dir); | ||
} | ||
} |
Oops, something went wrong.