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