1 | import { EventEmitter, OnChanges, SimpleChanges, TemplateRef } from '@angular/core';
|
2 | import { NgbPaginationConfig } from './pagination-config';
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export interface NgbPaginationLinkContext {
|
17 | |
18 |
|
19 |
|
20 | currentPage: number;
|
21 | |
22 |
|
23 |
|
24 | disabled: boolean;
|
25 | }
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export interface NgbPaginationNumberContext extends NgbPaginationLinkContext {
|
34 | |
35 |
|
36 |
|
37 | $implicit: number;
|
38 | }
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | export interface NgbPaginationPagesContext {
|
46 | |
47 |
|
48 |
|
49 | $implicit: number;
|
50 | |
51 |
|
52 |
|
53 | disabled: boolean;
|
54 | |
55 |
|
56 |
|
57 | pages: number[];
|
58 | }
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | export declare class NgbPaginationEllipsis {
|
65 | templateRef: TemplateRef<NgbPaginationLinkContext>;
|
66 | constructor(templateRef: TemplateRef<NgbPaginationLinkContext>);
|
67 | }
|
68 | /**
|
69 | * A directive to match the 'first' link template
|
70 | *
|
71 | * @since 4.1.0
|
72 | */
|
73 | export declare class NgbPaginationFirst {
|
74 | templateRef: TemplateRef<NgbPaginationLinkContext>;
|
75 | constructor(templateRef: TemplateRef<NgbPaginationLinkContext>);
|
76 | }
|
77 | /**
|
78 | * A directive to match the 'last' link template
|
79 | *
|
80 | * @since 4.1.0
|
81 | */
|
82 | export declare class NgbPaginationLast {
|
83 | templateRef: TemplateRef<NgbPaginationLinkContext>;
|
84 | constructor(templateRef: TemplateRef<NgbPaginationLinkContext>);
|
85 | }
|
86 | /**
|
87 | * A directive to match the 'next' link template
|
88 | *
|
89 | * @since 4.1.0
|
90 | */
|
91 | export declare class NgbPaginationNext {
|
92 | templateRef: TemplateRef<NgbPaginationLinkContext>;
|
93 | constructor(templateRef: TemplateRef<NgbPaginationLinkContext>);
|
94 | }
|
95 | /**
|
96 | * A directive to match the page 'number' link template
|
97 | *
|
98 | * @since 4.1.0
|
99 | */
|
100 | export declare class NgbPaginationNumber {
|
101 | templateRef: TemplateRef<NgbPaginationNumberContext>;
|
102 | constructor(templateRef: TemplateRef<NgbPaginationNumberContext>);
|
103 | }
|
104 | /**
|
105 | * A directive to match the 'previous' link template
|
106 | *
|
107 | * @since 4.1.0
|
108 | */
|
109 | export declare class NgbPaginationPrevious {
|
110 | templateRef: TemplateRef<NgbPaginationLinkContext>;
|
111 | constructor(templateRef: TemplateRef<NgbPaginationLinkContext>);
|
112 | }
|
113 | /**
|
114 | * A directive to match the 'pages' whole content
|
115 | *
|
116 | * @since 9.1.0
|
117 | */
|
118 | export declare class NgbPaginationPages {
|
119 | templateRef: TemplateRef<NgbPaginationPagesContext>;
|
120 | constructor(templateRef: TemplateRef<NgbPaginationPagesContext>);
|
121 | }
|
122 | /**
|
123 | * A component that displays page numbers and allows to customize them in several ways.
|
124 | */
|
125 | export declare class NgbPagination implements OnChanges {
|
126 | pageCount: number;
|
127 | pages: number[];
|
128 | tplEllipsis: NgbPaginationEllipsis;
|
129 | tplFirst: NgbPaginationFirst;
|
130 | tplLast: NgbPaginationLast;
|
131 | tplNext: NgbPaginationNext;
|
132 | tplNumber: NgbPaginationNumber;
|
133 | tplPrevious: NgbPaginationPrevious;
|
134 | tplPages: NgbPaginationPages;
|
135 | |
136 |
|
137 |
|
138 | disabled: boolean;
|
139 | |
140 |
|
141 |
|
142 | boundaryLinks: boolean;
|
143 | |
144 |
|
145 |
|
146 | directionLinks: boolean;
|
147 | |
148 |
|
149 |
|
150 | ellipses: boolean;
|
151 | |
152 |
|
153 |
|
154 |
|
155 |
|
156 | rotate: boolean;
|
157 | |
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 | collectionSize: number;
|
165 | |
166 |
|
167 |
|
168 | maxSize: number;
|
169 | |
170 |
|
171 |
|
172 |
|
173 |
|
174 | page: number;
|
175 | |
176 |
|
177 |
|
178 | pageSize: number;
|
179 | |
180 |
|
181 |
|
182 |
|
183 |
|
184 |
|
185 |
|
186 | pageChange: EventEmitter<number>;
|
187 | |
188 |
|
189 |
|
190 |
|
191 |
|
192 | size: 'sm' | 'lg';
|
193 | constructor(config: NgbPaginationConfig);
|
194 | hasPrevious(): boolean;
|
195 | hasNext(): boolean;
|
196 | nextDisabled(): boolean;
|
197 | previousDisabled(): boolean;
|
198 | selectPage(pageNumber: number): void;
|
199 | ngOnChanges(changes: SimpleChanges): void;
|
200 | isEllipsis(pageNumber: any): boolean;
|
201 | /**
|
202 | * Appends ellipses and first/last page number to the displayed pages
|
203 | */
|
204 | private _applyEllipses;
|
205 | /**
|
206 | * Rotates page numbers based on maxSize items visible.
|
207 | * Currently selected page stays in the middle:
|
208 | *
|
209 | * Ex. for selected page = 6:
|
210 | * [5,*6*,7] for maxSize = 3
|
211 | * [4,5,*6*,7] for maxSize = 4
|
212 | */
|
213 | private _applyRotation;
|
214 | /**
|
215 | * Paginates page numbers based on maxSize items per page.
|
216 | */
|
217 | private _applyPagination;
|
218 | private _setPageInRange;
|
219 | private _updatePages;
|
220 | }
|