1 | import { ElementRef, EventEmitter, OnInit, QueryList, AfterViewInit, DoCheck, KeyValueDiffers, KeyValueDiffer, ChangeDetectorRef } from '@angular/core';
|
2 | import { DatatableGroupHeaderDirective } from './body/body-group-header.directive';
|
3 | import { BehaviorSubject, Subscription } from 'rxjs';
|
4 | import { INgxDatatableConfig } from '../ngx-datatable.module';
|
5 | import { TableColumn } from '../types/table-column.type';
|
6 | import { ColumnMode } from '../types/column-mode.type';
|
7 | import { SelectionType } from '../types/selection.type';
|
8 | import { SortType } from '../types/sort.type';
|
9 | import { ContextmenuType } from '../types/contextmenu.type';
|
10 | import { DataTableColumnDirective } from './columns/column.directive';
|
11 | import { DatatableRowDetailDirective } from './row-detail/row-detail.directive';
|
12 | import { DatatableFooterDirective } from './footer/footer.directive';
|
13 | import { DataTableBodyComponent } from './body/body.component';
|
14 | import { DataTableHeaderComponent } from './header/header.component';
|
15 | import { ScrollbarHelper } from '../services/scrollbar-helper.service';
|
16 | import { ColumnChangesService } from '../services/column-changes.service';
|
17 | import { DimensionsHelper } from '../services/dimensions-helper.service';
|
18 | export declare class DatatableComponent implements OnInit, DoCheck, AfterViewInit {
|
19 | private scrollbarHelper;
|
20 | private dimensionsHelper;
|
21 | private cd;
|
22 | private columnChangesService;
|
23 | private configuration;
|
24 | |
25 |
|
26 |
|
27 | targetMarkerTemplate: any;
|
28 | |
29 |
|
30 |
|
31 | set rows(val: any);
|
32 | |
33 |
|
34 |
|
35 | get rows(): any;
|
36 | |
37 |
|
38 |
|
39 | set groupRowsBy(val: string);
|
40 | get groupRowsBy(): string;
|
41 | |
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | groupedRows: any[];
|
57 | |
58 |
|
59 |
|
60 | set columns(val: TableColumn[]);
|
61 | |
62 |
|
63 |
|
64 | get columns(): TableColumn[];
|
65 | |
66 |
|
67 |
|
68 |
|
69 |
|
70 | selected: any[];
|
71 | |
72 |
|
73 |
|
74 | scrollbarV: boolean;
|
75 | |
76 |
|
77 |
|
78 | scrollbarH: boolean;
|
79 | |
80 |
|
81 |
|
82 |
|
83 | rowHeight: number | 'auto' | ((row?: any) => number);
|
84 | /**
|
85 | * Type of column width distribution formula.
|
86 | * Example: flex, force, standard
|
87 | */
|
88 | columnMode: ColumnMode | keyof typeof ColumnMode;
|
89 | /**
|
90 | * The minimum header height in pixels.
|
91 | * Pass a falsey for no header
|
92 | */
|
93 | headerHeight: number;
|
94 | /**
|
95 | * The minimum footer height in pixels.
|
96 | * Pass falsey for no footer
|
97 | */
|
98 | footerHeight: number;
|
99 | /**
|
100 | * If the table should use external paging
|
101 | * otherwise its assumed that all data is preloaded.
|
102 | */
|
103 | externalPaging: boolean;
|
104 | /**
|
105 | * If the table should use external sorting or
|
106 | * the built-in basic sorting.
|
107 | */
|
108 | externalSorting: boolean;
|
109 | /**
|
110 | * The page size to be shown.
|
111 | * Default value: `undefined`
|
112 | */
|
113 | set limit(val: number | undefined);
|
114 | /**
|
115 | * Gets the limit.
|
116 | */
|
117 | get limit(): number | undefined;
|
118 | /**
|
119 | * The total count of all rows.
|
120 | * Default value: `0`
|
121 | */
|
122 | set count(val: number);
|
123 | /**
|
124 | * Gets the count.
|
125 | */
|
126 | get count(): number;
|
127 | /**
|
128 | * The current offset ( page - 1 ) shown.
|
129 | * Default value: `0`
|
130 | */
|
131 | set offset(val: number);
|
132 | get offset(): number;
|
133 | /**
|
134 | * Show the linear loading bar.
|
135 | * Default value: `false`
|
136 | */
|
137 | loadingIndicator: boolean;
|
138 | /**
|
139 | * Type of row selection. Options are:
|
140 | *
|
141 | * - `single`
|
142 | * - `multi`
|
143 | * - `checkbox`
|
144 | * - `multiClick`
|
145 | * - `cell`
|
146 | *
|
147 | * For no selection pass a `falsey`.
|
148 | * Default value: `undefined`
|
149 | */
|
150 | selectionType: SelectionType;
|
151 | /**
|
152 | * Enable/Disable ability to re-order columns
|
153 | * by dragging them.
|
154 | */
|
155 | reorderable: boolean;
|
156 | /**
|
157 | * Swap columns on re-order columns or
|
158 | * move them.
|
159 | */
|
160 | swapColumns: boolean;
|
161 | /**
|
162 | * The type of sorting
|
163 | */
|
164 | sortType: SortType;
|
165 | /**
|
166 | * Array of sorted columns by property and type.
|
167 | * Default value: `[]`
|
168 | */
|
169 | sorts: any[];
|
170 | /**
|
171 | * Css class overrides
|
172 | */
|
173 | cssClasses: any;
|
174 | /**
|
175 | * Message overrides for localization
|
176 | *
|
177 | * emptyMessage [default] = 'No data to display'
|
178 | * totalMessage [default] = 'total'
|
179 | * selectedMessage [default] = 'selected'
|
180 | */
|
181 | messages: any;
|
182 | /**
|
183 | * Row specific classes.
|
184 | * Similar implementation to ngClass.
|
185 | *
|
186 | * [rowClass]="'first second'"
|
187 | * [rowClass]="{ 'first': true, 'second': true, 'third': false }"
|
188 | */
|
189 | rowClass: any;
|
190 | /**
|
191 | * A boolean/function you can use to check whether you want
|
192 | * to select a particular row based on a criteria. Example:
|
193 | *
|
194 | * (selection) => {
|
195 | * return selection !== 'Ethel Price';
|
196 | * }
|
197 | */
|
198 | selectCheck: any;
|
199 | |
200 |
|
201 |
|
202 |
|
203 |
|
204 |
|
205 |
|
206 |
|
207 | displayCheck: (row: any, column?: any, value?: any) => boolean;
|
208 | |
209 |
|
210 |
|
211 |
|
212 |
|
213 | groupExpansionDefault: boolean;
|
214 | |
215 |
|
216 |
|
217 |
|
218 | trackByProp: string;
|
219 | |
220 |
|
221 |
|
222 |
|
223 |
|
224 |
|
225 | selectAllRowsOnPage: boolean;
|
226 | |
227 |
|
228 |
|
229 | virtualization: boolean;
|
230 | |
231 |
|
232 |
|
233 | treeFromRelation: string;
|
234 | |
235 |
|
236 |
|
237 | treeToRelation: string;
|
238 | |
239 |
|
240 |
|
241 | summaryRow: boolean;
|
242 | |
243 |
|
244 |
|
245 | summaryHeight: number;
|
246 | |
247 |
|
248 |
|
249 | summaryPosition: string;
|
250 | |
251 |
|
252 |
|
253 | scroll: EventEmitter<any>;
|
254 | |
255 |
|
256 |
|
257 | activate: EventEmitter<any>;
|
258 | |
259 |
|
260 |
|
261 | select: EventEmitter<any>;
|
262 | |
263 |
|
264 |
|
265 | sort: EventEmitter<any>;
|
266 | |
267 |
|
268 |
|
269 | page: EventEmitter<any>;
|
270 | |
271 |
|
272 |
|
273 | reorder: EventEmitter<any>;
|
274 | |
275 |
|
276 |
|
277 | resize: EventEmitter<any>;
|
278 | |
279 |
|
280 |
|
281 |
|
282 |
|
283 | tableContextmenu: EventEmitter<{
|
284 | event: MouseEvent;
|
285 | type: ContextmenuType;
|
286 | content: any;
|
287 | }>;
|
288 | |
289 |
|
290 |
|
291 | treeAction: EventEmitter<any>;
|
292 | |
293 |
|
294 |
|
295 | get isFixedHeader(): boolean;
|
296 | |
297 |
|
298 |
|
299 |
|
300 | get isFixedRow(): boolean;
|
301 | |
302 |
|
303 |
|
304 |
|
305 | get isVertScroll(): boolean;
|
306 | |
307 |
|
308 |
|
309 |
|
310 | get isVirtualized(): boolean;
|
311 | |
312 |
|
313 |
|
314 |
|
315 | get isHorScroll(): boolean;
|
316 | |
317 |
|
318 |
|
319 | get isSelectable(): boolean;
|
320 | |
321 |
|
322 |
|
323 | get isCheckboxSelection(): boolean;
|
324 | |
325 |
|
326 |
|
327 | get isCellSelection(): boolean;
|
328 | |
329 |
|
330 |
|
331 | get isSingleSelection(): boolean;
|
332 | |
333 |
|
334 |
|
335 | get isMultiSelection(): boolean;
|
336 | |
337 |
|
338 |
|
339 | get isMultiClickSelection(): boolean;
|
340 | |
341 |
|
342 |
|
343 |
|
344 | set columnTemplates(val: QueryList<DataTableColumnDirective>);
|
345 | |
346 |
|
347 |
|
348 | get columnTemplates(): QueryList<DataTableColumnDirective>;
|
349 | |
350 |
|
351 |
|
352 | rowDetail: DatatableRowDetailDirective;
|
353 | |
354 |
|
355 |
|
356 | groupHeader: DatatableGroupHeaderDirective;
|
357 | |
358 |
|
359 |
|
360 | footer: DatatableFooterDirective;
|
361 | |
362 |
|
363 |
|
364 |
|
365 | bodyComponent: DataTableBodyComponent;
|
366 | |
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 | headerComponent: DataTableHeaderComponent;
|
373 | |
374 |
|
375 |
|
376 | get allRowsSelected(): boolean;
|
377 | element: HTMLElement;
|
378 | _innerWidth: number;
|
379 | pageSize: number;
|
380 | bodyHeight: number;
|
381 | rowCount: number;
|
382 | rowDiffer: KeyValueDiffer<{}, {}>;
|
383 | _offsetX: BehaviorSubject<number>;
|
384 | _limit: number | undefined;
|
385 | _count: number;
|
386 | _offset: number;
|
387 | _rows: any[];
|
388 | _groupRowsBy: string;
|
389 | _internalRows: any[];
|
390 | _internalColumns: TableColumn[];
|
391 | _columns: TableColumn[];
|
392 | _columnTemplates: QueryList<DataTableColumnDirective>;
|
393 | _subscriptions: Subscription[];
|
394 | constructor(scrollbarHelper: ScrollbarHelper, dimensionsHelper: DimensionsHelper, cd: ChangeDetectorRef, element: ElementRef, differs: KeyValueDiffers, columnChangesService: ColumnChangesService, configuration: INgxDatatableConfig);
|
395 | /**
|
396 | * Lifecycle hook that is called after data-bound
|
397 | * properties of a directive are initialized.
|
398 | */
|
399 | ngOnInit(): void;
|
400 | /**
|
401 | * Lifecycle hook that is called after a component's
|
402 | * view has been fully initialized.
|
403 | */
|
404 | ngAfterViewInit(): void;
|
405 | /**
|
406 | * Lifecycle hook that is called after a component's
|
407 | * content has been fully initialized.
|
408 | */
|
409 | ngAfterContentInit(): void;
|
410 | /**
|
411 | * This will be used when displaying or selecting rows.
|
412 | * when tracking/comparing them, we'll use the value of this fn,
|
413 | *
|
414 | * (`fn(x) === fn(y)` instead of `x === y`)
|
415 | */
|
416 | rowIdentity: (x: any) => any;
|
417 | /**
|
418 | * Translates the templates to the column objects
|
419 | */
|
420 | translateColumns(val: any): void;
|
421 | /**
|
422 | * Creates a map with the data grouped by the user choice of grouping index
|
423 | *
|
424 | * @param originalArray the original array passed via parameter
|
425 | * @param groupByIndex the index of the column to group the data by
|
426 | */
|
427 | groupArrayBy(originalArray: any, groupBy: any): {
|
428 | key: any;
|
429 | value: any;
|
430 | }[];
|
431 | ngDoCheck(): void;
|
432 | |
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 | recalculate(): void;
|
444 | |
445 |
|
446 |
|
447 | onWindowResize(): void;
|
448 | |
449 |
|
450 |
|
451 |
|
452 | recalculateColumns(columns?: any[], forceIdx?: number, allowBleed?: boolean): any[] | undefined;
|
453 | |
454 |
|
455 |
|
456 |
|
457 |
|
458 | recalculateDims(): void;
|
459 | |
460 |
|
461 |
|
462 | recalculatePages(): void;
|
463 | |
464 |
|
465 |
|
466 | onBodyPage({ offset }: any): void;
|
467 | |
468 |
|
469 |
|
470 | onBodyScroll(event: MouseEvent): void;
|
471 | |
472 |
|
473 |
|
474 | onFooterPage(event: any): void;
|
475 | |
476 |
|
477 |
|
478 | calcPageSize(val?: any[]): number;
|
479 | |
480 |
|
481 |
|
482 | calcRowCount(val?: any[]): number;
|
483 | |
484 |
|
485 |
|
486 | onColumnContextmenu({ event, column }: any): void;
|
487 | |
488 |
|
489 |
|
490 | onRowContextmenu({ event, row }: any): void;
|
491 | |
492 |
|
493 |
|
494 | onColumnResize({ column, newValue }: any): void;
|
495 | |
496 |
|
497 |
|
498 | onColumnReorder({ column, newValue, prevValue }: any): void;
|
499 | |
500 |
|
501 |
|
502 | onColumnSort(event: any): void;
|
503 | |
504 |
|
505 |
|
506 | onHeaderSelect(event: any): void;
|
507 | |
508 |
|
509 |
|
510 | onBodySelect(event: any): void;
|
511 | |
512 |
|
513 |
|
514 | onTreeAction(event: any): void;
|
515 | ngOnDestroy(): void;
|
516 | |
517 |
|
518 |
|
519 |
|
520 | private listenForColumnInputChanges;
|
521 | private sortInternalRows;
|
522 | }
|