Skip to content

Commit 315da80

Browse files
committed
abp pagination done & moved to new directory
1 parent f14fb7d commit 315da80

File tree

5 files changed

+94
-76
lines changed

5 files changed

+94
-76
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<pagination-template
2+
#p="paginationApi"
3+
[id]="id"
4+
[maxSize]="maxSize"
5+
(pageChange)="pageChange.emit($event)"
6+
>
7+
<nav>
8+
<ul *ngIf="!(autoHide && p.pages.length <= 1)" class="pagination m-0">
9+
<li
10+
*ngIf="directionLinks"
11+
class="page-item"
12+
[class.disabled]="p.isFirstPage()"
13+
>
14+
<a
15+
*ngIf="!p.isFirstPage()"
16+
class="page-link"
17+
href="javascript:;"
18+
(click)="p.previous()"
19+
>
20+
<i class="fas fa-chevron-left"></i>
21+
</a>
22+
<a *ngIf="p.isFirstPage()" class="page-link" href="javascript:;">
23+
<i class="fas fa-chevron-left"></i>
24+
</a>
25+
</li>
26+
<li
27+
*ngFor="let page of p.pages"
28+
class="page-item"
29+
[class.active]="p.getCurrent() === page.value"
30+
[style.z-index]="p.getCurrent() === page.value ? '0' : ''"
31+
>
32+
<a
33+
class="page-link"
34+
href="javascript:;"
35+
(click)="p.setCurrent(page.value)"
36+
>
37+
{{ page.label }}
38+
</a>
39+
</li>
40+
<li
41+
*ngIf="directionLinks"
42+
class="page-item"
43+
[class.disabled]="p.isLastPage()"
44+
>
45+
<a
46+
*ngIf="!p.isLastPage()"
47+
class="page-link"
48+
href="javascript:;"
49+
(click)="p.next()"
50+
>
51+
<i class="fas fa-chevron-right"></i>
52+
</a>
53+
<a *ngIf="p.isLastPage()" class="page-link" href="javascript:;">
54+
<i class="fas fa-chevron-right"></i>
55+
</a>
56+
</li>
57+
</ul>
58+
</nav>
59+
</pagination-template>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { Component, Input, Output, EventEmitter } from '@angular/core';
2+
3+
@Component({
4+
selector: 'abp-pagination-controls',
5+
templateUrl: './abp-pagination-controls.component.html'
6+
})
7+
export class AbpPaginationControlsComponent {
8+
@Input() id: string;
9+
@Input() maxSize = 7;
10+
@Input()
11+
get directionLinks(): boolean {
12+
return this._directionLinks;
13+
}
14+
set directionLinks(value: boolean) {
15+
this._directionLinks = !!value && <any>value !== 'false';
16+
}
17+
@Input()
18+
get autoHide(): boolean {
19+
return this._autoHide;
20+
}
21+
set autoHide(value: boolean) {
22+
this._autoHide = !!value && <any>value !== 'false';
23+
}
24+
@Input() previousLabel = 'Previous';
25+
@Input() nextLabel = 'Next';
26+
@Input() screenReaderPaginationLabel = 'Pagination';
27+
@Input() screenReaderPageLabel = 'page';
28+
@Input() screenReaderCurrentLabel = `You're on page`;
29+
30+
@Output() pageChange: EventEmitter<number> = new EventEmitter<number>();
31+
32+
private _directionLinks = true;
33+
private _autoHide = false;
34+
}

angular/src/shared/pagination/abp-pagination-controls.component.html

Lines changed: 0 additions & 38 deletions
This file was deleted.

angular/src/shared/pagination/abp-pagination-controls.component.ts

Lines changed: 0 additions & 37 deletions
This file was deleted.

angular/src/shared/shared.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import { AppSessionService } from './session/app-session.service';
88
import { AppUrlService } from './nav/app-url.service';
99
import { AppAuthService } from './auth/app-auth.service';
1010
import { AppRouteGuard } from './auth/auth-route-guard';
11-
import { AbpPaginationControlsComponent } from './pagination/abp-pagination-controls.component';
1211
import { LocalizePipe } from '@shared/pipes/localize.pipe';
1312
import { DragDropModule } from '@angular/cdk/drag-drop';
1413
import { ScrollingModule } from '@angular/cdk/scrolling';
1514
import { CdkTableModule } from '@angular/cdk/table';
1615
import { CdkTreeModule } from '@angular/cdk/tree';
1716

17+
import { AbpPaginationControlsComponent } from './components/pagination/abp-pagination-controls.component';
1818
import { ApbValidationSummaryComponent } from './components/validation/abp-validation.summary.component';
1919
import { AbpModalHeaderComponent } from './components/modal/abp-modal-header.component';
2020
import { AbpModalFooterComponent } from './components/modal/abp-modal-footer.component';

0 commit comments

Comments
 (0)