1 | import { ChangeDetectorRef, EventEmitter } from '@angular/core';
|
2 | import { PaginationService } from './pagination.service';
|
3 | import * as i0 from "@angular/core";
|
4 | export interface Page {
|
5 | label: string;
|
6 | value: any;
|
7 | }
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export declare class PaginationControlsDirective {
|
14 | private service;
|
15 | private changeDetectorRef;
|
16 | id: string;
|
17 | maxSize: number;
|
18 | pageChange: EventEmitter<number>;
|
19 | pageBoundsCorrection: EventEmitter<number>;
|
20 | pages: Page[];
|
21 | private changeSub;
|
22 | constructor(service: PaginationService, changeDetectorRef: ChangeDetectorRef);
|
23 | ngOnInit(): void;
|
24 | ngOnChanges(changes: any): void;
|
25 | ngOnDestroy(): void;
|
26 | /**
|
27 | * Go to the previous page
|
28 | */
|
29 | previous(): void;
|
30 | /**
|
31 | * Go to the next page
|
32 | */
|
33 | next(): void;
|
34 | /**
|
35 | * Returns true if current page is first page
|
36 | */
|
37 | isFirstPage(): boolean;
|
38 | /**
|
39 | * Returns true if current page is last page
|
40 | */
|
41 | isLastPage(): boolean;
|
42 | /**
|
43 | * Set the current page number.
|
44 | */
|
45 | setCurrent(page: number): void;
|
46 | /**
|
47 | * Get the current page number.
|
48 | */
|
49 | getCurrent(): number;
|
50 | /**
|
51 | * Returns the last page number
|
52 | */
|
53 | getLastPage(): number;
|
54 | getTotalItems(): number;
|
55 | private checkValidId;
|
56 | /**
|
57 | * Updates the page links and checks that the current page is valid. Should run whenever the
|
58 | * PaginationService.change stream emits a value matching the current ID, or when any of the
|
59 | * input values changes.
|
60 | */
|
61 | private updatePageLinks;
|
62 | /**
|
63 | * Checks that the instance.currentPage property is within bounds for the current page range.
|
64 | * If not, return a correct value for currentPage, or the current value if OK.
|
65 | */
|
66 | private outOfBoundCorrection;
|
67 | /**
|
68 | * Returns an array of Page objects to use in the pagination controls.
|
69 | */
|
70 | private createPageArray;
|
71 | /**
|
72 | * Given the position in the sequence of pagination links [i],
|
73 | * figure out what page number corresponds to that position.
|
74 | */
|
75 | private calculatePageNumber;
|
76 | static ɵfac: i0.ɵɵFactoryDeclaration<PaginationControlsDirective, never>;
|
77 | static ɵdir: i0.ɵɵDirectiveDeclaration<PaginationControlsDirective, "pagination-template,[pagination-template]", ["paginationApi"], { "id": "id"; "maxSize": "maxSize"; }, { "pageChange": "pageChange"; "pageBoundsCorrection": "pageBoundsCorrection"; }, never>;
|
78 | }
|