@swimlane/ngx-datatable 20.0.0 → 21.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/fesm2022/swimlane-ngx-datatable.mjs +6842 -0
  2. package/fesm2022/swimlane-ngx-datatable.mjs.map +1 -0
  3. package/{swimlane-ngx-datatable.d.ts → index.d.ts} +1 -0
  4. package/lib/components/body/body-cell.component.d.ts +29 -21
  5. package/lib/components/body/body-group-header-template.directive.d.ts +5 -3
  6. package/lib/components/body/body-group-header.directive.d.ts +15 -7
  7. package/lib/components/body/body-row-def.component.d.ts +34 -0
  8. package/lib/components/body/body-row-wrapper.component.d.ts +35 -20
  9. package/lib/components/body/body-row.component.d.ts +29 -32
  10. package/lib/components/body/body.component.d.ts +89 -67
  11. package/lib/components/body/ghost-loader/ghost-loader.component.d.ts +12 -0
  12. package/lib/components/body/progress-bar.component.d.ts +3 -0
  13. package/lib/components/body/scroller.component.d.ts +6 -6
  14. package/lib/components/body/selection.component.d.ts +22 -23
  15. package/lib/components/body/summary/summary-row.component.d.ts +6 -2
  16. package/lib/components/columns/column-cell.directive.d.ts +6 -2
  17. package/lib/components/columns/column-ghost-cell.directive.d.ts +6 -0
  18. package/lib/components/columns/column-header.directive.d.ts +5 -3
  19. package/lib/components/columns/column.directive.d.ts +44 -16
  20. package/lib/components/columns/tree.directive.d.ts +3 -1
  21. package/lib/components/datatable.component.d.ts +143 -74
  22. package/lib/components/footer/footer-template.directive.d.ts +5 -3
  23. package/lib/components/footer/footer.component.d.ts +5 -1
  24. package/lib/components/footer/footer.directive.d.ts +8 -3
  25. package/lib/components/footer/pager.component.d.ts +8 -3
  26. package/lib/components/header/header-cell.component.d.ts +20 -17
  27. package/lib/components/header/header.component.d.ts +43 -35
  28. package/lib/components/row-detail/row-detail-template.directive.d.ts +5 -3
  29. package/lib/components/row-detail/row-detail.directive.d.ts +10 -6
  30. package/lib/directives/disable-row.directive.d.ts +22 -0
  31. package/lib/directives/draggable.directive.d.ts +13 -7
  32. package/lib/directives/long-press.directive.d.ts +18 -4
  33. package/lib/directives/orderable.directive.d.ts +23 -9
  34. package/lib/directives/resizeable.directive.d.ts +9 -4
  35. package/lib/directives/visibility.directive.d.ts +4 -2
  36. package/lib/ngx-datatable.module.d.ts +33 -1
  37. package/lib/services/column-changes.service.d.ts +4 -1
  38. package/lib/services/scrollbar-helper.service.d.ts +3 -1
  39. package/lib/types/internal.types.d.ts +31 -0
  40. package/lib/types/public.types.d.ts +142 -0
  41. package/lib/types/table-column.type.d.ts +39 -66
  42. package/lib/utils/column-helper.d.ts +2 -2
  43. package/lib/utils/column-prop-getters.d.ts +1 -1
  44. package/lib/utils/column.d.ts +7 -14
  45. package/lib/utils/keys.d.ts +6 -6
  46. package/lib/utils/math.d.ts +4 -3
  47. package/lib/utils/selection.d.ts +2 -2
  48. package/lib/utils/sort.d.ts +5 -5
  49. package/lib/utils/table-token.d.ts +7 -0
  50. package/lib/utils/tree.d.ts +2 -2
  51. package/package.json +16 -12
  52. package/public-api.d.ts +4 -11
  53. package/LICENSE +0 -22
  54. package/README.md +0 -47
  55. package/assets/app.css +0 -302
  56. package/assets/data/100k.json +0 -100002
  57. package/assets/data/company.json +0 -505
  58. package/assets/data/company_tree.json +0 -61
  59. package/assets/data/forRowGrouping.json +0 -227
  60. package/assets/fonts/data-table.eot +0 -0
  61. package/assets/fonts/data-table.svg +0 -26
  62. package/assets/fonts/data-table.ttf +0 -0
  63. package/assets/fonts/data-table.woff +0 -0
  64. package/assets/icons-reference.html +0 -395
  65. package/assets/icons.css +0 -105
  66. package/bundles/swimlane-ngx-datatable.umd.js +0 -5900
  67. package/bundles/swimlane-ngx-datatable.umd.js.map +0 -1
  68. package/esm2015/lib/components/body/body-cell.component.js +0 -361
  69. package/esm2015/lib/components/body/body-group-header-template.directive.js +0 -15
  70. package/esm2015/lib/components/body/body-group-header.directive.js +0 -54
  71. package/esm2015/lib/components/body/body-row-wrapper.component.js +0 -106
  72. package/esm2015/lib/components/body/body-row.component.js +0 -213
  73. package/esm2015/lib/components/body/body.component.js +0 -716
  74. package/esm2015/lib/components/body/progress-bar.component.js +0 -17
  75. package/esm2015/lib/components/body/scroller.component.js +0 -83
  76. package/esm2015/lib/components/body/selection.component.js +0 -140
  77. package/esm2015/lib/components/body/summary/summary-row.component.js +0 -81
  78. package/esm2015/lib/components/columns/column-cell.directive.js +0 -13
  79. package/esm2015/lib/components/columns/column-header.directive.js +0 -13
  80. package/esm2015/lib/components/columns/column.directive.js +0 -65
  81. package/esm2015/lib/components/columns/tree.directive.js +0 -13
  82. package/esm2015/lib/components/datatable.component.js +0 -925
  83. package/esm2015/lib/components/footer/footer-template.directive.js +0 -13
  84. package/esm2015/lib/components/footer/footer.component.js +0 -75
  85. package/esm2015/lib/components/footer/footer.directive.js +0 -22
  86. package/esm2015/lib/components/footer/pager.component.js +0 -136
  87. package/esm2015/lib/components/header/header-cell.component.js +0 -191
  88. package/esm2015/lib/components/header/header.component.js +0 -297
  89. package/esm2015/lib/components/row-detail/row-detail-template.directive.js +0 -15
  90. package/esm2015/lib/components/row-detail/row-detail.directive.js +0 -55
  91. package/esm2015/lib/directives/draggable.directive.js +0 -102
  92. package/esm2015/lib/directives/long-press.directive.js +0 -103
  93. package/esm2015/lib/directives/orderable.directive.js +0 -131
  94. package/esm2015/lib/directives/resizeable.directive.js +0 -89
  95. package/esm2015/lib/directives/visibility.directive.js +0 -62
  96. package/esm2015/lib/events.js +0 -7
  97. package/esm2015/lib/ngx-datatable.module.js +0 -96
  98. package/esm2015/lib/services/column-changes.service.js +0 -21
  99. package/esm2015/lib/services/dimensions-helper.service.js +0 -14
  100. package/esm2015/lib/services/scrollbar-helper.service.js +0 -34
  101. package/esm2015/lib/types/click.type.js +0 -6
  102. package/esm2015/lib/types/column-mode.type.js +0 -7
  103. package/esm2015/lib/types/contextmenu.type.js +0 -6
  104. package/esm2015/lib/types/selection.type.js +0 -9
  105. package/esm2015/lib/types/sort-direction.type.js +0 -6
  106. package/esm2015/lib/types/sort-prop-dir.type.js +0 -2
  107. package/esm2015/lib/types/sort.type.js +0 -6
  108. package/esm2015/lib/types/table-column.type.js +0 -2
  109. package/esm2015/lib/utils/camel-case.js +0 -28
  110. package/esm2015/lib/utils/column-helper.js +0 -95
  111. package/esm2015/lib/utils/column-prop-getters.js +0 -96
  112. package/esm2015/lib/utils/column.js +0 -69
  113. package/esm2015/lib/utils/elm-from-point.js +0 -38
  114. package/esm2015/lib/utils/id.js +0 -8
  115. package/esm2015/lib/utils/keys.js +0 -10
  116. package/esm2015/lib/utils/math.js +0 -146
  117. package/esm2015/lib/utils/prefixes.js +0 -40
  118. package/esm2015/lib/utils/row-height-cache.js +0 -138
  119. package/esm2015/lib/utils/selection.js +0 -40
  120. package/esm2015/lib/utils/sort.js +0 -127
  121. package/esm2015/lib/utils/throttle.js +0 -60
  122. package/esm2015/lib/utils/translate.js +0 -25
  123. package/esm2015/lib/utils/tree.js +0 -103
  124. package/esm2015/public-api.js +0 -64
  125. package/esm2015/swimlane-ngx-datatable.js +0 -5
  126. package/fesm2015/swimlane-ngx-datatable.js +0 -5218
  127. package/fesm2015/swimlane-ngx-datatable.js.map +0 -1
  128. package/index.css +0 -198
  129. package/index.scss +0 -315
  130. package/lib/events.d.ts +0 -3
  131. package/lib/services/dimensions-helper.service.d.ts +0 -7
  132. package/lib/types/click.type.d.ts +0 -4
  133. package/lib/types/column-mode.type.d.ts +0 -5
  134. package/lib/types/contextmenu.type.d.ts +0 -4
  135. package/lib/types/selection.type.d.ts +0 -7
  136. package/lib/types/sort-direction.type.d.ts +0 -4
  137. package/lib/types/sort-prop-dir.type.d.ts +0 -6
  138. package/lib/types/sort.type.d.ts +0 -4
  139. package/lib/utils/elm-from-point.d.ts +0 -8
  140. package/lib/utils/prefixes.d.ts +0 -1
  141. package/lib/utils/translate.d.ts +0 -1
  142. package/swimlane-ngx-datatable.metadata.json +0 -1
  143. package/themes/bootstrap.css +0 -67
  144. package/themes/bootstrap.scss +0 -101
  145. package/themes/dark.css +0 -75
  146. package/themes/dark.scss +0 -120
  147. package/themes/material.css +0 -305
  148. package/themes/material.scss +0 -480
@@ -1,43 +1,37 @@
1
- import { ElementRef, EventEmitter, OnInit, QueryList, AfterViewInit, DoCheck, KeyValueDiffers, KeyValueDiffer, ChangeDetectorRef } from '@angular/core';
1
+ import { AfterContentInit, AfterViewInit, DoCheck, EventEmitter, IterableDiffer, OnDestroy, OnInit, QueryList, TemplateRef } from '@angular/core';
2
2
  import { DatatableGroupHeaderDirective } from './body/body-group-header.directive';
3
3
  import { BehaviorSubject, Subscription } from 'rxjs';
4
4
  import { INgxDatatableConfig } from '../ngx-datatable.module';
5
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
6
  import { DataTableColumnDirective } from './columns/column.directive';
11
7
  import { DatatableRowDetailDirective } from './row-detail/row-detail.directive';
12
8
  import { DatatableFooterDirective } from './footer/footer.directive';
13
9
  import { DataTableBodyComponent } from './body/body.component';
14
10
  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 {
11
+ import { ActivateEvent, ColumnMode, ColumnResizeEvent, ContextmenuType, DragEventData, Group, PageEvent, PagerPageEvent, ReorderEvent, RowOrGroup, ScrollEvent, SelectionType, SortEvent, SortPropDir, SortType, TreeStatus } from '../types/public.types';
12
+ import * as i0 from "@angular/core";
13
+ export declare class DatatableComponent<TRow = any> implements OnInit, DoCheck, AfterViewInit, AfterContentInit, OnDestroy {
19
14
  private scrollbarHelper;
20
- private dimensionsHelper;
21
15
  private cd;
22
16
  private columnChangesService;
23
17
  private configuration;
24
18
  /**
25
19
  * Template for the target marker of drag target columns.
26
20
  */
27
- targetMarkerTemplate: any;
21
+ targetMarkerTemplate: TemplateRef<unknown>;
28
22
  /**
29
23
  * Rows that are displayed in the table.
30
24
  */
31
- set rows(val: any);
25
+ set rows(val: TRow[] | null | undefined);
32
26
  /**
33
27
  * Gets the rows.
34
28
  */
35
- get rows(): any;
29
+ get rows(): TRow[];
36
30
  /**
37
31
  * This attribute allows the user to set the name of the column to group the data with
38
32
  */
39
- set groupRowsBy(val: string);
40
- get groupRowsBy(): string;
33
+ set groupRowsBy(val: keyof TRow);
34
+ get groupRowsBy(): keyof TRow;
41
35
  /**
42
36
  * This attribute allows the user to set a grouped array in the following format:
43
37
  * [
@@ -53,7 +47,7 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
53
47
  * ]}
54
48
  * ]
55
49
  */
56
- groupedRows: any[];
50
+ groupedRows: Group<TRow>[];
57
51
  /**
58
52
  * Columns to be displayed.
59
53
  */
@@ -67,11 +61,18 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
67
61
  * represented as selected in the grid.
68
62
  * Default value: `[]`
69
63
  */
70
- selected: any[];
64
+ selected: TRow[];
71
65
  /**
72
66
  * Enable vertical scrollbars
73
67
  */
74
68
  scrollbarV: boolean;
69
+ /**
70
+ * Enable vertical scrollbars dynamically on demand.
71
+ * Property `scrollbarV` needs to be set `true` too.
72
+ * Width that is gained when no scrollbar is needed
73
+ * is added to the inner table width.
74
+ */
75
+ scrollbarVDynamic: boolean;
75
76
  /**
76
77
  * Enable horz scrollbars
77
78
  */
@@ -80,7 +81,7 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
80
81
  * The row height; which is necessary
81
82
  * to calculate the height for the lazy rendering.
82
83
  */
83
- rowHeight: number | 'auto' | ((row?: any) => number);
84
+ rowHeight: number | 'auto' | ((row?: TRow) => number);
84
85
  /**
85
86
  * Type of column width distribution formula.
86
87
  * Example: flex, force, standard
@@ -135,6 +136,12 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
135
136
  * Default value: `false`
136
137
  */
137
138
  loadingIndicator: boolean;
139
+ /**
140
+ * Show ghost loaders on each cell.
141
+ * Default value: `false`
142
+ */
143
+ set ghostLoadingIndicator(val: boolean);
144
+ get ghostLoadingIndicator(): boolean;
138
145
  /**
139
146
  * Type of row selection. Options are:
140
147
  *
@@ -166,11 +173,11 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
166
173
  * Array of sorted columns by property and type.
167
174
  * Default value: `[]`
168
175
  */
169
- sorts: any[];
176
+ sorts: SortPropDir[];
170
177
  /**
171
178
  * Css class overrides
172
179
  */
173
- cssClasses: any;
180
+ cssClasses: Partial<INgxDatatableConfig['cssClasses']>;
174
181
  /**
175
182
  * Message overrides for localization
176
183
  *
@@ -178,15 +185,13 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
178
185
  * totalMessage [default] = 'total'
179
186
  * selectedMessage [default] = 'selected'
180
187
  */
181
- messages: any;
188
+ messages: Partial<INgxDatatableConfig['messages']>;
182
189
  /**
183
- * Row specific classes.
184
- * Similar implementation to ngClass.
185
- *
186
- * [rowClass]="'first second'"
187
- * [rowClass]="{ 'first': true, 'second': true, 'third': false }"
190
+ * A function which is called with the row and should return either:
191
+ * - a string: `"class-1 class-2`
192
+ * - a Record<string, boolean>: `{ 'class-1': true, 'class-2': false }`
188
193
  */
189
- rowClass: any;
194
+ rowClass: (row: Group<TRow> | TRow) => string | Record<string, boolean>;
190
195
  /**
191
196
  * A boolean/function you can use to check whether you want
192
197
  * to select a particular row based on a criteria. Example:
@@ -195,7 +200,7 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
195
200
  * return selection !== 'Ethel Price';
196
201
  * }
197
202
  */
198
- selectCheck: any;
203
+ selectCheck: (value: TRow, index: number, array: TRow[]) => boolean;
199
204
  /**
200
205
  * A function you can use to check whether you want
201
206
  * to show the checkbox for a particular row based on a criteria. Example:
@@ -204,7 +209,7 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
204
209
  * return row.name !== 'Ethel Price';
205
210
  * }
206
211
  */
207
- displayCheck: (row: any, column?: any, value?: any) => boolean;
212
+ displayCheck: (row: TRow, column: TableColumn, value?: any) => boolean;
208
213
  /**
209
214
  * A boolean you can use to set the detault behaviour of rows and groups
210
215
  * whether they will start expanded or not. If ommited the default is NOT expanded.
@@ -219,8 +224,6 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
219
224
  /**
220
225
  * Property to which you can use for determining select all
221
226
  * rows on current page or not.
222
- *
223
- * @memberOf DatatableComponent
224
227
  */
225
228
  selectAllRowsOnPage: boolean;
226
229
  /**
@@ -247,34 +250,56 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
247
250
  * A property holds a summary row position: top/bottom
248
251
  */
249
252
  summaryPosition: string;
253
+ /**
254
+ * A function you can use to check whether you want
255
+ * to disable a row. Example:
256
+ *
257
+ * (row) => {
258
+ * return row.name !== 'Ethel Price';
259
+ * }
260
+ */
261
+ disableRowCheck: (row: TRow) => boolean;
262
+ /**
263
+ * A flag to enable drag behavior of native HTML5 drag and drop API on rows.
264
+ * If set to true, {@link rowDragEvents} will emit dragstart and dragend events.
265
+ */
266
+ rowDraggable: boolean;
267
+ /**
268
+ * A flag to controll behavior of sort states.
269
+ * By default sort on column toggles between ascending and descending without getting removed.
270
+ * Set true to clear sorting of column after performing ascending and descending sort on that column.
271
+ */
272
+ enableClearingSortState: boolean;
250
273
  /**
251
274
  * Body was scrolled typically in a `scrollbarV:true` scenario.
252
275
  */
253
- scroll: EventEmitter<any>;
276
+ scroll: EventEmitter<ScrollEvent>;
254
277
  /**
255
278
  * A cell or row was focused via keyboard or mouse click.
256
279
  */
257
- activate: EventEmitter<any>;
280
+ activate: EventEmitter<ActivateEvent<TRow>>;
258
281
  /**
259
282
  * A cell or row was selected.
260
283
  */
261
- select: EventEmitter<any>;
284
+ select: EventEmitter<{
285
+ selected: TRow[];
286
+ }>;
262
287
  /**
263
288
  * Column sort was invoked.
264
289
  */
265
- sort: EventEmitter<any>;
290
+ sort: EventEmitter<SortEvent>;
266
291
  /**
267
292
  * The table was paged either triggered by the pager or the body scroll.
268
293
  */
269
- page: EventEmitter<any>;
294
+ page: EventEmitter<PageEvent>;
270
295
  /**
271
296
  * Columns were re-ordered.
272
297
  */
273
- reorder: EventEmitter<any>;
298
+ reorder: EventEmitter<ReorderEvent>;
274
299
  /**
275
300
  * Column was resized.
276
301
  */
277
- resize: EventEmitter<any>;
302
+ resize: EventEmitter<ColumnResizeEvent>;
278
303
  /**
279
304
  * The context menu was invoked on the table.
280
305
  * type indicates whether the header or the body was clicked.
@@ -283,12 +308,21 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
283
308
  tableContextmenu: EventEmitter<{
284
309
  event: MouseEvent;
285
310
  type: ContextmenuType;
286
- content: any;
311
+ content: TableColumn | RowOrGroup<TRow>;
287
312
  }>;
288
313
  /**
289
314
  * A row was expanded ot collapsed for tree
290
315
  */
291
- treeAction: EventEmitter<any>;
316
+ treeAction: EventEmitter<{
317
+ row: TRow;
318
+ rowIndex: number;
319
+ }>;
320
+ /**
321
+ * Emits HTML5 native drag events.
322
+ * Only emits dragenter, dragover, drop events by default.
323
+ * Set {@link rowDraggble} to true for dragstart and dragend.
324
+ */
325
+ rowDragEvents: EventEmitter<DragEventData>;
292
326
  /**
293
327
  * CSS class applied if the header height if fixed height.
294
328
  */
@@ -341,11 +375,7 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
341
375
  * Column templates gathered from `ContentChildren`
342
376
  * if described in your markup.
343
377
  */
344
- set columnTemplates(val: QueryList<DataTableColumnDirective>);
345
- /**
346
- * Returns the column templates.
347
- */
348
- get columnTemplates(): QueryList<DataTableColumnDirective>;
378
+ columnTemplates: QueryList<DataTableColumnDirective<TRow>>;
349
379
  /**
350
380
  * Row Detail templates gathered from the ContentChild
351
381
  */
@@ -362,14 +392,16 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
362
392
  * Reference to the body component for manually
363
393
  * invoking functions on the body.
364
394
  */
365
- bodyComponent: DataTableBodyComponent;
395
+ bodyComponent: DataTableBodyComponent<TRow & {
396
+ treeStatus?: TreeStatus;
397
+ }>;
366
398
  /**
367
399
  * Reference to the header component for manually
368
400
  * invoking functions on the header.
369
- *
370
- * @memberOf DatatableComponent
371
401
  */
372
402
  headerComponent: DataTableHeaderComponent;
403
+ private bodyElement;
404
+ rowDefTemplate?: TemplateRef<any>;
373
405
  /**
374
406
  * Returns if all rows are selected.
375
407
  */
@@ -379,19 +411,22 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
379
411
  pageSize: number;
380
412
  bodyHeight: number;
381
413
  rowCount: number;
382
- rowDiffer: KeyValueDiffer<{}, {}>;
414
+ rowDiffer: IterableDiffer<TRow>;
383
415
  _offsetX: BehaviorSubject<number>;
384
416
  _limit: number | undefined;
385
417
  _count: number;
386
418
  _offset: number;
387
- _rows: any[];
388
- _groupRowsBy: string;
389
- _internalRows: any[];
419
+ _rows: TRow[] | null | undefined;
420
+ _groupRowsBy: keyof TRow;
421
+ _internalRows: TRow[];
390
422
  _internalColumns: TableColumn[];
391
423
  _columns: TableColumn[];
392
- _columnTemplates: QueryList<DataTableColumnDirective>;
393
424
  _subscriptions: Subscription[];
394
- constructor(scrollbarHelper: ScrollbarHelper, dimensionsHelper: DimensionsHelper, cd: ChangeDetectorRef, element: ElementRef, differs: KeyValueDiffers, columnChangesService: ColumnChangesService, configuration: INgxDatatableConfig);
425
+ _ghostLoadingIndicator: boolean;
426
+ _defaultColumnWidth?: number;
427
+ protected verticalScrollVisible: boolean;
428
+ private _rowInitDone;
429
+ constructor();
395
430
  /**
396
431
  * Lifecycle hook that is called after data-bound
397
432
  * properties of a directive are initialized.
@@ -413,20 +448,20 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
413
448
  *
414
449
  * (`fn(x) === fn(y)` instead of `x === y`)
415
450
  */
416
- rowIdentity: (x: any) => any;
451
+ rowIdentity: (x: TRow | Group<TRow>) => unknown;
417
452
  /**
418
453
  * Translates the templates to the column objects
419
454
  */
420
- translateColumns(val: any): void;
455
+ translateColumns(val: QueryList<DataTableColumnDirective<TRow>>): void;
421
456
  /**
422
457
  * Creates a map with the data grouped by the user choice of grouping index
423
458
  *
424
459
  * @param originalArray the original array passed via parameter
425
- * @param groupByIndex the index of the column to group the data by
460
+ * @param groupBy the key of the column to group the data by
426
461
  */
427
- groupArrayBy(originalArray: any, groupBy: any): {
428
- key: any;
429
- value: any;
462
+ groupArrayBy(originalArray: TRow[], groupBy: keyof TRow): {
463
+ key: TRow[keyof TRow];
464
+ value: TRow[];
430
465
  }[];
431
466
  ngDoCheck(): void;
432
467
  /**
@@ -449,7 +484,7 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
449
484
  * Recalulcates the column widths based on column width
450
485
  * distribution mode and scrollbar offsets.
451
486
  */
452
- recalculateColumns(columns?: any[], forceIdx?: number, allowBleed?: boolean): any[] | undefined;
487
+ recalculateColumns(columns?: TableColumn[], forceIdx?: number, allowBleed?: boolean): TableColumn[] | undefined;
453
488
  /**
454
489
  * Recalculates the dimensions of the table size.
455
490
  * Internally calls the page size and row count calcs too.
@@ -463,55 +498,66 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
463
498
  /**
464
499
  * Body triggered a page event.
465
500
  */
466
- onBodyPage({ offset }: any): void;
501
+ onBodyPage(offset: number): void;
467
502
  /**
468
503
  * The body triggered a scroll event.
469
504
  */
470
- onBodyScroll(event: MouseEvent): void;
505
+ onBodyScroll(event: ScrollEvent): void;
471
506
  /**
472
507
  * The footer triggered a page event.
473
508
  */
474
- onFooterPage(event: any): void;
509
+ onFooterPage(event: PagerPageEvent): void;
475
510
  /**
476
511
  * Recalculates the sizes of the page
477
512
  */
478
- calcPageSize(val?: any[]): number;
513
+ calcPageSize(): number;
479
514
  /**
480
515
  * Calculates the row count.
481
516
  */
482
- calcRowCount(val?: any[]): number;
517
+ calcRowCount(): number;
483
518
  /**
484
519
  * The header triggered a contextmenu event.
485
520
  */
486
- onColumnContextmenu({ event, column }: any): void;
521
+ onColumnContextmenu({ event, column }: {
522
+ event: MouseEvent;
523
+ column: TableColumn;
524
+ }): void;
487
525
  /**
488
526
  * The body triggered a contextmenu event.
489
527
  */
490
- onRowContextmenu({ event, row }: any): void;
528
+ onRowContextmenu({ event, row }: {
529
+ event: MouseEvent;
530
+ row: RowOrGroup<TRow>;
531
+ }): void;
491
532
  /**
492
533
  * The header triggered a column resize event.
493
534
  */
494
- onColumnResize({ column, newValue }: any): void;
535
+ onColumnResize({ column, newValue, prevValue }: ColumnResizeEvent): void;
536
+ onColumnResizing({ column, newValue }: ColumnResizeEvent): void;
495
537
  /**
496
538
  * The header triggered a column re-order event.
497
539
  */
498
- onColumnReorder({ column, newValue, prevValue }: any): void;
540
+ onColumnReorder({ column, newValue, prevValue }: ReorderEvent): void;
499
541
  /**
500
542
  * The header triggered a column sort event.
501
543
  */
502
- onColumnSort(event: any): void;
544
+ onColumnSort(event: SortEvent): void;
503
545
  /**
504
546
  * Toggle all row selection
505
547
  */
506
- onHeaderSelect(event: any): void;
548
+ onHeaderSelect(): void;
507
549
  /**
508
550
  * A row was selected from body
509
551
  */
510
- onBodySelect(event: any): void;
552
+ onBodySelect(event: {
553
+ selected: TRow[];
554
+ }): void;
511
555
  /**
512
556
  * A row was expanded or collapsed for tree
513
557
  */
514
- onTreeAction(event: any): void;
558
+ onTreeAction(event: {
559
+ row: TRow;
560
+ }): void;
515
561
  ngOnDestroy(): void;
516
562
  /**
517
563
  * listen for changes to input bindings of all DataTableColumnDirective and
@@ -519,4 +565,27 @@ export declare class DatatableComponent implements OnInit, DoCheck, AfterViewIni
519
565
  */
520
566
  private listenForColumnInputChanges;
521
567
  private sortInternalRows;
568
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatatableComponent<any>, never>;
569
+ static ɵcmp: i0.ɵɵComponentDeclaration<DatatableComponent<any>, "ngx-datatable", never, { "targetMarkerTemplate": { "alias": "targetMarkerTemplate"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "groupRowsBy": { "alias": "groupRowsBy"; "required": false; }; "groupedRows": { "alias": "groupedRows"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "scrollbarV": { "alias": "scrollbarV"; "required": false; }; "scrollbarVDynamic": { "alias": "scrollbarVDynamic"; "required": false; }; "scrollbarH": { "alias": "scrollbarH"; "required": false; }; "rowHeight": { "alias": "rowHeight"; "required": false; }; "columnMode": { "alias": "columnMode"; "required": false; }; "headerHeight": { "alias": "headerHeight"; "required": false; }; "footerHeight": { "alias": "footerHeight"; "required": false; }; "externalPaging": { "alias": "externalPaging"; "required": false; }; "externalSorting": { "alias": "externalSorting"; "required": false; }; "limit": { "alias": "limit"; "required": false; }; "count": { "alias": "count"; "required": false; }; "offset": { "alias": "offset"; "required": false; }; "loadingIndicator": { "alias": "loadingIndicator"; "required": false; }; "ghostLoadingIndicator": { "alias": "ghostLoadingIndicator"; "required": false; }; "selectionType": { "alias": "selectionType"; "required": false; }; "reorderable": { "alias": "reorderable"; "required": false; }; "swapColumns": { "alias": "swapColumns"; "required": false; }; "sortType": { "alias": "sortType"; "required": false; }; "sorts": { "alias": "sorts"; "required": false; }; "cssClasses": { "alias": "cssClasses"; "required": false; }; "messages": { "alias": "messages"; "required": false; }; "rowClass": { "alias": "rowClass"; "required": false; }; "selectCheck": { "alias": "selectCheck"; "required": false; }; "displayCheck": { "alias": "displayCheck"; "required": false; }; "groupExpansionDefault": { "alias": "groupExpansionDefault"; "required": false; }; "trackByProp": { "alias": "trackByProp"; "required": false; }; "selectAllRowsOnPage": { "alias": "selectAllRowsOnPage"; "required": false; }; "virtualization": { "alias": "virtualization"; "required": false; }; "treeFromRelation": { "alias": "treeFromRelation"; "required": false; }; "treeToRelation": { "alias": "treeToRelation"; "required": false; }; "summaryRow": { "alias": "summaryRow"; "required": false; }; "summaryHeight": { "alias": "summaryHeight"; "required": false; }; "summaryPosition": { "alias": "summaryPosition"; "required": false; }; "disableRowCheck": { "alias": "disableRowCheck"; "required": false; }; "rowDraggable": { "alias": "rowDraggable"; "required": false; }; "enableClearingSortState": { "alias": "enableClearingSortState"; "required": false; }; "rowIdentity": { "alias": "rowIdentity"; "required": false; }; }, { "scroll": "scroll"; "activate": "activate"; "select": "select"; "sort": "sort"; "page": "page"; "reorder": "reorder"; "resize": "resize"; "tableContextmenu": "tableContextmenu"; "treeAction": "treeAction"; "rowDragEvents": "rowDragEvents"; }, ["rowDetail", "groupHeader", "footer", "rowDefTemplate", "columnTemplates"], ["[loading-indicator]", "[empty-content]"], true, never>;
570
+ static ngAcceptInputType_scrollbarV: unknown;
571
+ static ngAcceptInputType_scrollbarVDynamic: unknown;
572
+ static ngAcceptInputType_scrollbarH: unknown;
573
+ static ngAcceptInputType_headerHeight: unknown;
574
+ static ngAcceptInputType_footerHeight: unknown;
575
+ static ngAcceptInputType_externalPaging: unknown;
576
+ static ngAcceptInputType_externalSorting: unknown;
577
+ static ngAcceptInputType_limit: unknown;
578
+ static ngAcceptInputType_count: unknown;
579
+ static ngAcceptInputType_offset: unknown;
580
+ static ngAcceptInputType_loadingIndicator: unknown;
581
+ static ngAcceptInputType_ghostLoadingIndicator: unknown;
582
+ static ngAcceptInputType_reorderable: unknown;
583
+ static ngAcceptInputType_swapColumns: unknown;
584
+ static ngAcceptInputType_groupExpansionDefault: unknown;
585
+ static ngAcceptInputType_selectAllRowsOnPage: unknown;
586
+ static ngAcceptInputType_virtualization: unknown;
587
+ static ngAcceptInputType_summaryRow: unknown;
588
+ static ngAcceptInputType_summaryHeight: unknown;
589
+ static ngAcceptInputType_rowDraggable: unknown;
590
+ static ngAcceptInputType_enableClearingSortState: unknown;
522
591
  }
@@ -1,5 +1,7 @@
1
- import { TemplateRef } from '@angular/core';
1
+ import { FooterContext } from '../../types/public.types';
2
+ import * as i0 from "@angular/core";
2
3
  export declare class DataTableFooterTemplateDirective {
3
- template: TemplateRef<any>;
4
- constructor(template: TemplateRef<any>);
4
+ static ngTemplateContextGuard(directive: DataTableFooterTemplateDirective, context: unknown): context is FooterContext;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<DataTableFooterTemplateDirective, never>;
6
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DataTableFooterTemplateDirective, "[ngx-datatable-footer-template]", never, {}, {}, never, never, true, never>;
5
7
  }
@@ -1,5 +1,7 @@
1
1
  import { EventEmitter } from '@angular/core';
2
2
  import { DatatableFooterDirective } from './footer.directive';
3
+ import { PagerPageEvent } from '../../types/public.types';
4
+ import * as i0 from "@angular/core";
3
5
  export declare class DataTableFooterComponent {
4
6
  footerHeight: number;
5
7
  rowCount: number;
@@ -13,7 +15,9 @@ export declare class DataTableFooterComponent {
13
15
  footerTemplate: DatatableFooterDirective;
14
16
  selectedCount: number;
15
17
  selectedMessage: string | boolean;
16
- page: EventEmitter<any>;
18
+ page: EventEmitter<PagerPageEvent>;
17
19
  get isVisible(): boolean;
18
20
  get curPage(): number;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<DataTableFooterComponent, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<DataTableFooterComponent, "datatable-footer", never, { "footerHeight": { "alias": "footerHeight"; "required": false; }; "rowCount": { "alias": "rowCount"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "offset": { "alias": "offset"; "required": false; }; "pagerLeftArrowIcon": { "alias": "pagerLeftArrowIcon"; "required": false; }; "pagerRightArrowIcon": { "alias": "pagerRightArrowIcon"; "required": false; }; "pagerPreviousIcon": { "alias": "pagerPreviousIcon"; "required": false; }; "pagerNextIcon": { "alias": "pagerNextIcon"; "required": false; }; "totalMessage": { "alias": "totalMessage"; "required": false; }; "footerTemplate": { "alias": "footerTemplate"; "required": false; }; "selectedCount": { "alias": "selectedCount"; "required": false; }; "selectedMessage": { "alias": "selectedMessage"; "required": false; }; }, { "page": "page"; }, never, never, true, never>;
19
23
  }
@@ -1,4 +1,6 @@
1
1
  import { TemplateRef } from '@angular/core';
2
+ import { FooterContext } from '../../types/public.types';
3
+ import * as i0 from "@angular/core";
2
4
  export declare class DatatableFooterDirective {
3
5
  footerHeight: number;
4
6
  totalMessage: string;
@@ -7,7 +9,10 @@ export declare class DatatableFooterDirective {
7
9
  pagerRightArrowIcon: string;
8
10
  pagerPreviousIcon: string;
9
11
  pagerNextIcon: string;
10
- _templateInput: TemplateRef<any>;
11
- _templateQuery: TemplateRef<any>;
12
- get template(): TemplateRef<any>;
12
+ _templateInput: TemplateRef<FooterContext>;
13
+ _templateQuery: TemplateRef<FooterContext>;
14
+ get template(): TemplateRef<FooterContext>;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatatableFooterDirective, never>;
16
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DatatableFooterDirective, "ngx-datatable-footer", never, { "footerHeight": { "alias": "footerHeight"; "required": false; }; "totalMessage": { "alias": "totalMessage"; "required": false; }; "selectedMessage": { "alias": "selectedMessage"; "required": false; }; "pagerLeftArrowIcon": { "alias": "pagerLeftArrowIcon"; "required": false; }; "pagerRightArrowIcon": { "alias": "pagerRightArrowIcon"; "required": false; }; "pagerPreviousIcon": { "alias": "pagerPreviousIcon"; "required": false; }; "pagerNextIcon": { "alias": "pagerNextIcon"; "required": false; }; "_templateInput": { "alias": "template"; "required": false; }; }, {}, ["_templateQuery"], never, true, never>;
17
+ static ngAcceptInputType_footerHeight: unknown;
13
18
  }
@@ -1,4 +1,7 @@
1
1
  import { EventEmitter } from '@angular/core';
2
+ import { PagerPageEvent } from '../../types/public.types';
3
+ import { Page } from '../../types/internal.types';
4
+ import * as i0 from "@angular/core";
2
5
  export declare class DataTablePagerComponent {
3
6
  pagerLeftArrowIcon: string;
4
7
  pagerRightArrowIcon: string;
@@ -11,15 +14,17 @@ export declare class DataTablePagerComponent {
11
14
  set page(val: number);
12
15
  get page(): number;
13
16
  get totalPages(): number;
14
- change: EventEmitter<any>;
17
+ change: EventEmitter<PagerPageEvent>;
15
18
  _count: number;
16
19
  _page: number;
17
20
  _size: number;
18
- pages: any;
21
+ pages: Page[];
19
22
  canPrevious(): boolean;
20
23
  canNext(): boolean;
21
24
  prevPage(): void;
22
25
  nextPage(): void;
23
26
  selectPage(page: number): void;
24
- calcPages(page?: number): any[];
27
+ calcPages(page?: number): Page[];
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<DataTablePagerComponent, never>;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<DataTablePagerComponent, "datatable-pager", never, { "pagerLeftArrowIcon": { "alias": "pagerLeftArrowIcon"; "required": false; }; "pagerRightArrowIcon": { "alias": "pagerRightArrowIcon"; "required": false; }; "pagerPreviousIcon": { "alias": "pagerPreviousIcon"; "required": false; }; "pagerNextIcon": { "alias": "pagerNextIcon"; "required": false; }; "size": { "alias": "size"; "required": false; }; "count": { "alias": "count"; "required": false; }; "page": { "alias": "page"; "required": false; }; }, { "change": "change"; }, never, never, true, never>;
25
30
  }
@@ -1,17 +1,17 @@
1
- import { EventEmitter, ChangeDetectorRef } from '@angular/core';
2
- import { SortType } from '../../types/sort.type';
3
- import { SelectionType } from '../../types/selection.type';
1
+ import { EventEmitter, OnInit, TemplateRef } from '@angular/core';
4
2
  import { TableColumn } from '../../types/table-column.type';
5
- import { SortDirection } from '../../types/sort-direction.type';
6
- export declare class DataTableHeaderCellComponent {
3
+ import { HeaderCellContext, InnerSortEvent, SelectionType, SortDirection, SortPropDir, SortType } from '../../types/public.types';
4
+ import * as i0 from "@angular/core";
5
+ export declare class DataTableHeaderCellComponent implements OnInit {
7
6
  private cd;
8
7
  sortType: SortType;
9
8
  sortAscendingIcon: string;
10
9
  sortDescendingIcon: string;
11
10
  sortUnsetIcon: string;
12
11
  isTarget: boolean;
13
- targetMarkerTemplate: any;
12
+ targetMarkerTemplate: TemplateRef<any>;
14
13
  targetMarkerContext: any;
14
+ enableClearingSortState: boolean;
15
15
  _allRowsSelected: boolean;
16
16
  set allRowsSelected(value: boolean);
17
17
  get allRowsSelected(): boolean;
@@ -19,31 +19,34 @@ export declare class DataTableHeaderCellComponent {
19
19
  set column(column: TableColumn);
20
20
  get column(): TableColumn;
21
21
  headerHeight: number;
22
- set sorts(val: any[]);
23
- get sorts(): any[];
24
- sort: EventEmitter<any>;
25
- select: EventEmitter<any>;
22
+ set sorts(val: SortPropDir[]);
23
+ get sorts(): SortPropDir[];
24
+ sort: EventEmitter<InnerSortEvent>;
25
+ select: EventEmitter<void>;
26
26
  columnContextmenu: EventEmitter<{
27
27
  event: MouseEvent;
28
- column: any;
28
+ column: TableColumn;
29
29
  }>;
30
- get columnCssClasses(): any;
30
+ get columnCssClasses(): string;
31
31
  get name(): string;
32
32
  get minWidth(): number;
33
33
  get maxWidth(): number;
34
34
  get width(): number;
35
+ get tabindex(): number;
35
36
  get isCheckboxable(): boolean;
36
- sortFn: any;
37
37
  sortClass: string;
38
38
  sortDir: SortDirection;
39
- selectFn: any;
40
- cellContext: any;
39
+ cellContext: HeaderCellContext;
41
40
  private _column;
42
41
  private _sorts;
43
- constructor(cd: ChangeDetectorRef);
42
+ constructor();
44
43
  onContextmenu($event: MouseEvent): void;
44
+ enter(): void;
45
45
  ngOnInit(): void;
46
- calcSortDir(sorts: any[]): any;
46
+ calcSortDir(sorts: SortPropDir[]): any;
47
+ private totalSortStatesApplied;
47
48
  onSort(): void;
48
49
  calcSortClass(sortDir: SortDirection): string;
50
+ static ɵfac: i0.ɵɵFactoryDeclaration<DataTableHeaderCellComponent, never>;
51
+ static ɵcmp: i0.ɵɵComponentDeclaration<DataTableHeaderCellComponent, "datatable-header-cell", never, { "sortType": { "alias": "sortType"; "required": false; }; "sortAscendingIcon": { "alias": "sortAscendingIcon"; "required": false; }; "sortDescendingIcon": { "alias": "sortDescendingIcon"; "required": false; }; "sortUnsetIcon": { "alias": "sortUnsetIcon"; "required": false; }; "isTarget": { "alias": "isTarget"; "required": false; }; "targetMarkerTemplate": { "alias": "targetMarkerTemplate"; "required": false; }; "targetMarkerContext": { "alias": "targetMarkerContext"; "required": false; }; "enableClearingSortState": { "alias": "enableClearingSortState"; "required": false; }; "allRowsSelected": { "alias": "allRowsSelected"; "required": false; }; "selectionType": { "alias": "selectionType"; "required": false; }; "column": { "alias": "column"; "required": false; }; "headerHeight": { "alias": "headerHeight"; "required": false; }; "sorts": { "alias": "sorts"; "required": false; }; }, { "sort": "sort"; "select": "select"; "columnContextmenu": "columnContextmenu"; }, never, never, true, never>;
49
52
  }