File tree Expand file tree Collapse file tree 5 files changed +94
-76
lines changed Expand file tree Collapse file tree 5 files changed +94
-76
lines changed Original file line number Diff line number Diff line change
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 >
Original file line number Diff line number Diff line change
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
+ }
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -8,13 +8,13 @@ import { AppSessionService } from './session/app-session.service';
8
8
import { AppUrlService } from './nav/app-url.service' ;
9
9
import { AppAuthService } from './auth/app-auth.service' ;
10
10
import { AppRouteGuard } from './auth/auth-route-guard' ;
11
- import { AbpPaginationControlsComponent } from './pagination/abp-pagination-controls.component' ;
12
11
import { LocalizePipe } from '@shared/pipes/localize.pipe' ;
13
12
import { DragDropModule } from '@angular/cdk/drag-drop' ;
14
13
import { ScrollingModule } from '@angular/cdk/scrolling' ;
15
14
import { CdkTableModule } from '@angular/cdk/table' ;
16
15
import { CdkTreeModule } from '@angular/cdk/tree' ;
17
16
17
+ import { AbpPaginationControlsComponent } from './components/pagination/abp-pagination-controls.component' ;
18
18
import { ApbValidationSummaryComponent } from './components/validation/abp-validation.summary.component' ;
19
19
import { AbpModalHeaderComponent } from './components/modal/abp-modal-header.component' ;
20
20
import { AbpModalFooterComponent } from './components/modal/abp-modal-footer.component' ;
You can’t perform that action at this time.
0 commit comments