@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,4 +1,5 @@
1
1
  /**
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
+ /// <amd-module name="@swimlane/ngx-datatable" />
4
5
  export * from './public-api';
@@ -1,12 +1,18 @@
1
- import { ChangeDetectorRef, EventEmitter, ElementRef, ViewContainerRef, OnDestroy, DoCheck } from '@angular/core';
1
+ import { DoCheck, EventEmitter, OnDestroy, ViewContainerRef } from '@angular/core';
2
2
  import { TableColumn } from '../../types/table-column.type';
3
- import { SortDirection } from '../../types/sort-direction.type';
4
- export declare type TreeStatus = 'collapsed' | 'expanded' | 'loading' | 'disabled';
5
- export declare class DataTableBodyCellComponent implements DoCheck, OnDestroy {
3
+ import { BehaviorSubject } from 'rxjs';
4
+ import { ActivateEvent, CellContext, RowOrGroup, SortDirection, SortPropDir, TreeStatus } from '../../types/public.types';
5
+ import * as i0 from "@angular/core";
6
+ export declare class DataTableBodyCellComponent<TRow extends {
7
+ level?: number;
8
+ } = any> implements DoCheck, OnDestroy {
6
9
  private cd;
7
- displayCheck: (row: any, column?: TableColumn, value?: any) => boolean;
8
- set group(group: any);
9
- get group(): any;
10
+ displayCheck: (row: RowOrGroup<TRow>, column: TableColumn, value: any) => boolean;
11
+ _disable$: BehaviorSubject<boolean>;
12
+ set disable$(val: BehaviorSubject<boolean>);
13
+ get disable$(): BehaviorSubject<boolean>;
14
+ set group(group: TRow[]);
15
+ get group(): TRow[];
10
16
  set rowHeight(val: number);
11
17
  get rowHeight(): number;
12
18
  set isSelected(val: boolean);
@@ -17,27 +23,27 @@ export declare class DataTableBodyCellComponent implements DoCheck, OnDestroy {
17
23
  get rowIndex(): number;
18
24
  set column(column: TableColumn);
19
25
  get column(): TableColumn;
20
- set row(row: any);
21
- get row(): any;
22
- set sorts(val: any[]);
23
- get sorts(): any[];
26
+ set row(row: TRow);
27
+ get row(): TRow;
28
+ set sorts(val: SortPropDir[]);
29
+ get sorts(): SortPropDir[];
24
30
  set treeStatus(status: TreeStatus);
25
31
  get treeStatus(): TreeStatus;
26
- activate: EventEmitter<any>;
32
+ ghostLoadingIndicator: boolean;
33
+ activate: EventEmitter<ActivateEvent<TRow>>;
27
34
  treeAction: EventEmitter<any>;
28
35
  cellTemplate: ViewContainerRef;
29
- get columnCssClasses(): any;
36
+ ghostLoaderTemplate: ViewContainerRef;
37
+ get columnCssClasses(): string;
30
38
  get width(): number;
31
39
  get minWidth(): number;
32
40
  get maxWidth(): number;
33
41
  get height(): string | number;
34
- sanitizedValue: any;
42
+ sanitizedValue: string;
35
43
  value: any;
36
44
  sortDir: SortDirection;
37
45
  isFocused: boolean;
38
- onCheckboxChangeFn: any;
39
- activateFn: any;
40
- cellContext: any;
46
+ cellContext: CellContext<TRow>;
41
47
  private _isSelected;
42
48
  private _sorts;
43
49
  private _column;
@@ -48,7 +54,7 @@ export declare class DataTableBodyCellComponent implements DoCheck, OnDestroy {
48
54
  private _expanded;
49
55
  private _element;
50
56
  private _treeStatus;
51
- constructor(element: ElementRef, cd: ChangeDetectorRef);
57
+ constructor();
52
58
  ngDoCheck(): void;
53
59
  ngOnDestroy(): void;
54
60
  checkValueUpdates(): void;
@@ -57,9 +63,11 @@ export declare class DataTableBodyCellComponent implements DoCheck, OnDestroy {
57
63
  onClick(event: MouseEvent): void;
58
64
  onDblClick(event: MouseEvent): void;
59
65
  onKeyDown(event: KeyboardEvent): void;
60
- onCheckboxChange(event: any): void;
61
- calcSortDir(sorts: any[]): any;
66
+ onCheckboxChange(event: MouseEvent | KeyboardEvent): void;
67
+ calcSortDir(sorts: SortPropDir[]): SortDirection;
62
68
  stripHtml(html: string): string;
63
69
  onTreeAction(): void;
64
- calcLeftMargin(column: any, row: any): number;
70
+ calcLeftMargin(column: TableColumn, row: RowOrGroup<TRow>): number;
71
+ static ɵfac: i0.ɵɵFactoryDeclaration<DataTableBodyCellComponent<any>, never>;
72
+ static ɵcmp: i0.ɵɵComponentDeclaration<DataTableBodyCellComponent<any>, "datatable-body-cell", never, { "displayCheck": { "alias": "displayCheck"; "required": false; }; "disable$": { "alias": "disable$"; "required": false; }; "group": { "alias": "group"; "required": false; }; "rowHeight": { "alias": "rowHeight"; "required": false; }; "isSelected": { "alias": "isSelected"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; "rowIndex": { "alias": "rowIndex"; "required": false; }; "column": { "alias": "column"; "required": false; }; "row": { "alias": "row"; "required": false; }; "sorts": { "alias": "sorts"; "required": false; }; "treeStatus": { "alias": "treeStatus"; "required": false; }; "ghostLoadingIndicator": { "alias": "ghostLoadingIndicator"; "required": false; }; }, { "activate": "activate"; "treeAction": "treeAction"; }, never, never, true, never>;
65
73
  }
@@ -1,5 +1,7 @@
1
- import { TemplateRef } from '@angular/core';
1
+ import { GroupContext } from '../../types/public.types';
2
+ import * as i0 from "@angular/core";
2
3
  export declare class DatatableGroupHeaderTemplateDirective {
3
- template: TemplateRef<any>;
4
- constructor(template: TemplateRef<any>);
4
+ static ngTemplateContextGuard(directive: DatatableGroupHeaderTemplateDirective, context: unknown): context is GroupContext;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatatableGroupHeaderTemplateDirective, never>;
6
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DatatableGroupHeaderTemplateDirective, "[ngx-datatable-group-header-template]", never, {}, {}, never, never, true, never>;
5
7
  }
@@ -1,20 +1,26 @@
1
1
  import { EventEmitter, TemplateRef } from '@angular/core';
2
- export declare class DatatableGroupHeaderDirective {
2
+ import { Group, GroupContext, GroupToggleEvents } from '../../types/public.types';
3
+ import * as i0 from "@angular/core";
4
+ export declare class DatatableGroupHeaderDirective<TRow = any> {
3
5
  /**
4
6
  * Row height is required when virtual scroll is enabled.
5
7
  */
6
- rowHeight: number | ((group?: any, index?: number) => number);
7
- _templateInput: TemplateRef<any>;
8
- _templateQuery: TemplateRef<any>;
9
- get template(): TemplateRef<any>;
8
+ rowHeight: number | ((group?: Group<TRow>, index?: number) => number);
9
+ /**
10
+ * Show checkbox at group header to select all rows of the group.
11
+ */
12
+ checkboxable: boolean;
13
+ _templateInput: TemplateRef<GroupContext<TRow>>;
14
+ _templateQuery: TemplateRef<GroupContext<TRow>>;
15
+ get template(): TemplateRef<GroupContext<TRow>>;
10
16
  /**
11
17
  * Track toggling of group visibility
12
18
  */
13
- toggle: EventEmitter<any>;
19
+ toggle: EventEmitter<GroupToggleEvents<TRow>>;
14
20
  /**
15
21
  * Toggle the expansion of a group
16
22
  */
17
- toggleExpandGroup(group: any): void;
23
+ toggleExpandGroup(group: Group<TRow>): void;
18
24
  /**
19
25
  * Expand all groups
20
26
  */
@@ -23,4 +29,6 @@ export declare class DatatableGroupHeaderDirective {
23
29
  * Collapse all groups
24
30
  */
25
31
  collapseAllGroups(): void;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatatableGroupHeaderDirective<any>, never>;
33
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DatatableGroupHeaderDirective<any>, "ngx-datatable-group-header", never, { "rowHeight": { "alias": "rowHeight"; "required": false; }; "checkboxable": { "alias": "checkboxable"; "required": false; }; "_templateInput": { "alias": "template"; "required": false; }; }, { "toggle": "toggle"; }, ["_templateQuery"], never, true, never>;
26
34
  }
@@ -0,0 +1,34 @@
1
+ import { OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * This component is passed as ng-template and rendered by BodyComponent.
5
+ * BodyComponent uses rowDefInternal to first inject actual row template.
6
+ * This component will render that actual row template.
7
+ */
8
+ export declare class DatatableRowDefComponent {
9
+ rowDef: DatatableRowDefInternalDirective;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatatableRowDefComponent, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<DatatableRowDefComponent, "datatable-row-def", never, {}, {}, never, never, true, never>;
12
+ }
13
+ export declare class DatatableRowDefDirective {
14
+ static ngTemplateContextGuard(_dir: DatatableRowDefDirective, ctx: unknown): ctx is RowDefContext;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatatableRowDefDirective, never>;
16
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DatatableRowDefDirective, "[rowDef]", never, {}, {}, never, never, true, never>;
17
+ }
18
+ /**
19
+ * @internal To be used internally by ngx-datatable.
20
+ */
21
+ export declare class DatatableRowDefInternalDirective implements OnInit {
22
+ vc: ViewContainerRef;
23
+ rowDefInternal?: RowDefContext;
24
+ ngOnInit(): void;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatatableRowDefInternalDirective, never>;
26
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DatatableRowDefInternalDirective, "[rowDefInternal]", never, { "rowDefInternal": { "alias": "rowDefInternal"; "required": false; }; }, {}, never, never, true, never>;
27
+ }
28
+ type RowDefContext = {
29
+ template: TemplateRef<unknown>;
30
+ rowTemplate: TemplateRef<unknown>;
31
+ row: any;
32
+ index: number;
33
+ };
34
+ export {};
@@ -1,29 +1,44 @@
1
- import { EventEmitter, DoCheck, ChangeDetectorRef, KeyValueDiffers } from '@angular/core';
2
- export declare class DataTableRowWrapperComponent implements DoCheck {
3
- private cd;
4
- private differs;
1
+ import { DoCheck, ElementRef, EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import { Group, GroupContext, RowDetailContext, RowOrGroup } from '../../types/public.types';
4
+ import { DatatableGroupHeaderDirective } from './body-group-header.directive';
5
+ import { DatatableRowDetailDirective } from '../row-detail/row-detail.directive';
6
+ import * as i0 from "@angular/core";
7
+ export declare class DataTableRowWrapperComponent<TRow = any> implements DoCheck, OnInit, OnChanges {
8
+ checkBoxInput: ElementRef<HTMLInputElement>;
5
9
  innerWidth: number;
6
- rowDetail: any;
7
- groupHeader: any;
10
+ rowDetail: DatatableRowDetailDirective;
11
+ groupHeader: DatatableGroupHeaderDirective;
8
12
  offsetX: number;
9
- detailRowHeight: any;
10
- row: any;
11
- groupedRows: any;
13
+ detailRowHeight: number;
14
+ groupHeaderRowHeight: number;
15
+ row: RowOrGroup<TRow>;
16
+ groupedRows: Group<TRow>[];
17
+ disableCheck: (row: RowOrGroup<TRow>) => boolean;
18
+ selected: TRow[];
12
19
  rowContextmenu: EventEmitter<{
13
20
  event: MouseEvent;
14
- row: any;
21
+ row: RowOrGroup<TRow>;
15
22
  }>;
16
- set rowIndex(val: number);
17
- get rowIndex(): number;
18
- set expanded(val: boolean);
19
- get expanded(): boolean;
20
- groupContext: any;
21
- rowContext: any;
23
+ rowIndex?: number;
24
+ selectedGroupRows: import("@angular/core").WritableSignal<TRow[]>;
25
+ expanded: boolean;
26
+ groupContext?: GroupContext<TRow>;
27
+ rowContext?: RowDetailContext<TRow>;
28
+ disable$: BehaviorSubject<boolean>;
22
29
  private rowDiffer;
23
- private _expanded;
24
- private _rowIndex;
25
- constructor(cd: ChangeDetectorRef, differs: KeyValueDiffers);
30
+ private iterableDiffers;
31
+ private selectedRowsDiffer;
32
+ private tableComponent;
33
+ private cd;
34
+ protected group: import("@angular/core").Signal<Group<TRow>>;
35
+ ngOnInit(): void;
36
+ ngOnChanges(changes: SimpleChanges): void;
26
37
  ngDoCheck(): void;
27
38
  onContextmenu($event: MouseEvent): void;
28
- getGroupHeaderStyle(): any;
39
+ onCheckboxChange(groupSelected: boolean): void;
40
+ isGroup(row: RowOrGroup<TRow>): row is Group<TRow>;
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<DataTableRowWrapperComponent<any>, never>;
42
+ static ɵcmp: i0.ɵɵComponentDeclaration<DataTableRowWrapperComponent<any>, "datatable-row-wrapper", never, { "innerWidth": { "alias": "innerWidth"; "required": false; }; "rowDetail": { "alias": "rowDetail"; "required": false; }; "groupHeader": { "alias": "groupHeader"; "required": false; }; "offsetX": { "alias": "offsetX"; "required": false; }; "detailRowHeight": { "alias": "detailRowHeight"; "required": false; }; "groupHeaderRowHeight": { "alias": "groupHeaderRowHeight"; "required": false; }; "row": { "alias": "row"; "required": false; }; "groupedRows": { "alias": "groupedRows"; "required": false; }; "disableCheck": { "alias": "disableCheck"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "rowIndex": { "alias": "rowIndex"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; }, { "rowContextmenu": "rowContextmenu"; }, never, ["*"], true, never>;
43
+ static ngAcceptInputType_expanded: unknown;
29
44
  }
@@ -1,50 +1,47 @@
1
- import { ElementRef, KeyValueDiffers, EventEmitter, ChangeDetectorRef, DoCheck } from '@angular/core';
2
- import { TreeStatus } from './body-cell.component';
3
- import { ScrollbarHelper } from '../../services/scrollbar-helper.service';
4
- export declare class DataTableBodyRowComponent implements DoCheck {
5
- private differs;
6
- private scrollbarHelper;
1
+ import { DoCheck, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import { ActivateEvent, RowOrGroup, TreeStatus } from '../../types/public.types';
4
+ import { TableColumn } from '../../types/table-column.type';
5
+ import { ColumnGroupWidth, PinnedColumns } from '../../types/internal.types';
6
+ import * as i0 from "@angular/core";
7
+ export declare class DataTableBodyRowComponent<TRow = any> implements DoCheck, OnChanges {
7
8
  private cd;
8
- set columns(val: any[]);
9
- get columns(): any[];
9
+ set columns(val: TableColumn[]);
10
+ get columns(): TableColumn[];
10
11
  set innerWidth(val: number);
11
12
  get innerWidth(): number;
12
13
  expanded: boolean;
13
- rowClass: any;
14
- row: any;
15
- group: any;
14
+ rowClass?: (row: RowOrGroup<TRow>) => string | Record<string, boolean>;
15
+ row: TRow;
16
+ group: TRow[];
16
17
  isSelected: boolean;
17
18
  rowIndex: number;
18
- displayCheck: any;
19
- treeStatus: TreeStatus;
19
+ displayCheck: (row: TRow, column: TableColumn, value?: any) => boolean;
20
+ treeStatus?: TreeStatus;
21
+ ghostLoadingIndicator: boolean;
22
+ verticalScrollVisible: boolean;
23
+ disable$: BehaviorSubject<boolean>;
20
24
  set offsetX(val: number);
21
25
  get offsetX(): number;
22
26
  get cssClass(): string;
23
27
  rowHeight: number;
24
- get columnsTotalWidths(): string;
25
- activate: EventEmitter<any>;
28
+ get columnsTotalWidths(): number;
29
+ activate: EventEmitter<ActivateEvent<TRow>>;
26
30
  treeAction: EventEmitter<any>;
27
- _element: any;
28
- _columnGroupWidths: any;
29
- _columnsByPin: any;
31
+ _element: HTMLElement;
32
+ _columnGroupWidths: ColumnGroupWidth;
33
+ _columnsByPin: PinnedColumns[];
30
34
  _offsetX: number;
31
- _columns: any[];
35
+ _columns: TableColumn[];
32
36
  _innerWidth: number;
33
- _groupStyles: {
34
- [prop: string]: {};
35
- };
36
37
  private _rowDiffer;
37
- constructor(differs: KeyValueDiffers, scrollbarHelper: ScrollbarHelper, cd: ChangeDetectorRef, element: ElementRef);
38
+ ngOnChanges(changes: SimpleChanges): void;
38
39
  ngDoCheck(): void;
39
- trackByGroups(index: number, colGroup: any): any;
40
- columnTrackingFn(index: number, column: any): any;
41
- buildStylesByGroup(): void;
42
- calcStylesByGroup(group: string): {
43
- width: string;
44
- };
45
- onActivate(event: any, index: number): void;
40
+ onActivate(event: ActivateEvent<TRow>, index: number): void;
46
41
  onKeyDown(event: KeyboardEvent): void;
47
- onMouseenter(event: any): void;
48
- recalculateColumns(val?: any[]): void;
42
+ onMouseenter(event: MouseEvent): void;
43
+ recalculateColumns(val?: TableColumn<TRow>[]): void;
49
44
  onTreeAction(): void;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<DataTableBodyRowComponent<any>, never>;
46
+ static ɵcmp: i0.ɵɵComponentDeclaration<DataTableBodyRowComponent<any>, "datatable-body-row", never, { "columns": { "alias": "columns"; "required": false; }; "innerWidth": { "alias": "innerWidth"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; "rowClass": { "alias": "rowClass"; "required": false; }; "row": { "alias": "row"; "required": false; }; "group": { "alias": "group"; "required": false; }; "isSelected": { "alias": "isSelected"; "required": false; }; "rowIndex": { "alias": "rowIndex"; "required": false; }; "displayCheck": { "alias": "displayCheck"; "required": false; }; "treeStatus": { "alias": "treeStatus"; "required": false; }; "ghostLoadingIndicator": { "alias": "ghostLoadingIndicator"; "required": false; }; "verticalScrollVisible": { "alias": "verticalScrollVisible"; "required": false; }; "disable$": { "alias": "disable$"; "required": false; }; "offsetX": { "alias": "offsetX"; "required": false; }; "rowHeight": { "alias": "rowHeight"; "required": false; }; }, { "activate": "activate"; "treeAction": "treeAction"; }, never, never, true, never>;
50
47
  }
@@ -1,56 +1,73 @@
1
- import { EventEmitter, ChangeDetectorRef, OnInit, OnDestroy } from '@angular/core';
1
+ import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit, TemplateRef, TrackByFunction } from '@angular/core';
2
2
  import { ScrollerComponent } from './scroller.component';
3
- import { SelectionType } from '../../types/selection.type';
4
3
  import { RowHeightCache } from '../../utils/row-height-cache';
5
- export declare class DataTableBodyComponent implements OnInit, OnDestroy {
6
- private cd;
4
+ import { TableColumn } from '../../types/table-column.type';
5
+ import { DatatableGroupHeaderDirective } from './body-group-header.directive';
6
+ import { DatatableRowDetailDirective } from '../row-detail/row-detail.directive';
7
+ import { DataTableBodyRowComponent } from './body-row.component';
8
+ import { ColumnGroupWidth } from '../../types/internal.types';
9
+ import { ActivateEvent, DragEventData, Group, RowOrGroup, ScrollEvent, SelectionType, TreeStatus } from '../../types/public.types';
10
+ import * as i0 from "@angular/core";
11
+ export declare class DataTableBodyComponent<TRow extends {
12
+ treeStatus?: TreeStatus;
13
+ } = any> implements OnInit, OnDestroy {
14
+ cd: ChangeDetectorRef;
15
+ rowDefTemplate?: TemplateRef<any>;
7
16
  scrollbarV: boolean;
8
17
  scrollbarH: boolean;
9
18
  loadingIndicator: boolean;
19
+ ghostLoadingIndicator: boolean;
10
20
  externalPaging: boolean;
11
21
  rowHeight: number | 'auto' | ((row?: any) => number);
12
22
  offsetX: number;
13
- emptyMessage: string;
14
23
  selectionType: SelectionType;
15
24
  selected: any[];
16
25
  rowIdentity: any;
17
- rowDetail: any;
18
- groupHeader: any;
19
- selectCheck: any;
20
- displayCheck: any;
26
+ rowDetail: DatatableRowDetailDirective;
27
+ groupHeader: DatatableGroupHeaderDirective;
28
+ selectCheck: (value: TRow, index: number, array: TRow[]) => boolean;
29
+ displayCheck: (row: TRow, column: TableColumn, value?: any) => boolean;
21
30
  trackByProp: string;
22
- rowClass: any;
23
- groupedRows: any;
31
+ rowClass: (row: RowOrGroup<TRow>) => string | Record<string, boolean>;
32
+ groupedRows: Group<TRow>[];
24
33
  groupExpansionDefault: boolean;
25
34
  innerWidth: number;
26
- groupRowsBy: string;
35
+ groupRowsBy: keyof TRow;
27
36
  virtualization: boolean;
28
37
  summaryRow: boolean;
29
38
  summaryPosition: string;
30
39
  summaryHeight: number;
40
+ rowDraggable: boolean;
41
+ rowDragEvents: EventEmitter<DragEventData>;
42
+ disableRowCheck: (row: TRow) => boolean;
31
43
  set pageSize(val: number);
32
44
  get pageSize(): number;
33
- set rows(val: any[]);
34
- get rows(): any[];
35
- set columns(val: any[]);
45
+ set rows(val: TRow[]);
46
+ get rows(): TRow[];
47
+ set columns(val: TableColumn[]);
36
48
  get columns(): any[];
37
49
  set offset(val: number);
38
50
  get offset(): number;
39
51
  set rowCount(val: number);
40
52
  get rowCount(): number;
41
53
  get bodyWidth(): string;
42
- set bodyHeight(val: any);
43
- get bodyHeight(): any;
44
- scroll: EventEmitter<any>;
45
- page: EventEmitter<any>;
46
- activate: EventEmitter<any>;
47
- select: EventEmitter<any>;
54
+ set bodyHeight(val: number | string);
55
+ get bodyHeight(): number | string;
56
+ verticalScrollVisible: boolean;
57
+ scroll: EventEmitter<ScrollEvent>;
58
+ page: EventEmitter<number>;
59
+ activate: EventEmitter<ActivateEvent<TRow>>;
60
+ select: EventEmitter<{
61
+ selected: TRow[];
62
+ }>;
48
63
  detailToggle: EventEmitter<any>;
49
64
  rowContextmenu: EventEmitter<{
50
65
  event: MouseEvent;
51
- row: any;
66
+ row: RowOrGroup<TRow>;
67
+ }>;
68
+ treeAction: EventEmitter<{
69
+ row: TRow;
52
70
  }>;
53
- treeAction: EventEmitter<any>;
54
71
  scroller: ScrollerComponent;
55
72
  /**
56
73
  * Returns if selection is enabled.
@@ -61,31 +78,37 @@ export declare class DataTableBodyComponent implements OnInit, OnDestroy {
61
78
  * based on the row heights cache for virtual scroll and virtualization. Other scenarios
62
79
  * calculate scroll height automatically (as height will be undefined).
63
80
  */
64
- get scrollHeight(): number | undefined;
65
- rowHeightsCache: RowHeightCache;
66
- temp: any[];
81
+ scrollHeight: import("@angular/core").Signal<number>;
82
+ rowsToRender: import("@angular/core").Signal<RowOrGroup<TRow>[]>;
83
+ rowHeightsCache: import("@angular/core").WritableSignal<RowHeightCache>;
67
84
  offsetY: number;
68
- indexes: any;
69
- columnGroupWidths: any;
70
- columnGroupWidthsWithoutGroup: any;
71
- rowTrackingFn: any;
85
+ indexes: import("@angular/core").WritableSignal<{
86
+ first: number;
87
+ last: number;
88
+ }>;
89
+ columnGroupWidths: ColumnGroupWidth;
90
+ rowTrackingFn: TrackByFunction<RowOrGroup<TRow>>;
72
91
  listener: any;
73
- rowIndexes: any;
92
+ rowIndexes: WeakMap<any, any>;
74
93
  rowExpansions: any[];
75
- _rows: any[];
76
- _bodyHeight: any;
77
- _columns: any[];
94
+ _rows: TRow[];
95
+ _bodyHeight: string;
96
+ _columns: TableColumn[];
78
97
  _rowCount: number;
79
98
  _offset: number;
80
99
  _pageSize: number;
100
+ _offsetEvent: number;
101
+ private _draggedRow;
102
+ private _draggedRowElement;
81
103
  /**
82
104
  * Creates an instance of DataTableBodyComponent.
83
105
  */
84
- constructor(cd: ChangeDetectorRef);
106
+ constructor();
85
107
  /**
86
108
  * Called after the constructor, initializing input properties
87
109
  */
88
110
  ngOnInit(): void;
111
+ private toggleStateChange;
89
112
  /**
90
113
  * Called once, before the instance is destroyed.
91
114
  */
@@ -106,23 +129,24 @@ export declare class DataTableBodyComponent implements OnInit, OnDestroy {
106
129
  /**
107
130
  * Updates the rows in the view port
108
131
  */
109
- updateRows(): void;
132
+ updateRows(): RowOrGroup<TRow>[];
110
133
  /**
111
134
  * Get the row height
112
135
  */
113
- getRowHeight(row: any): number;
136
+ getRowHeight(row: RowOrGroup<TRow>): number;
114
137
  /**
115
138
  * @param group the group with all rows
116
139
  */
117
- getGroupHeight(group: any): number;
140
+ getGroupHeight(group: Group<TRow>): number;
118
141
  /**
119
142
  * Calculate row height based on the expanded state of the row.
120
143
  */
121
- getRowAndDetailHeight(row: any): number;
144
+ getRowAndDetailHeight(row: TRow): number;
122
145
  /**
123
146
  * Get the height of the detail row.
124
147
  */
125
- getDetailRowHeight: (row?: any, index?: any) => number;
148
+ getDetailRowHeight: (row?: TRow, index?: number) => number;
149
+ getGroupHeaderRowHeight: (row?: any, index?: any) => number;
126
150
  /**
127
151
  * Calculates the styles for the row so that the rows can be moved in 2D space
128
152
  * during virtual scroll inside the DOM. In the below case the Y position is
@@ -138,26 +162,22 @@ export declare class DataTableBodyComponent implements OnInit, OnDestroy {
138
162
  * case the positionY of the translate3d for row2 would be the sum of all the
139
163
  * heights of the rows before it (i.e. row0 and row1).
140
164
  *
141
- * @param rows the row that needs to be placed in the 2D space.
142
165
  * @returns the CSS3 style to be applied
143
- *
144
- * @memberOf DataTableBodyComponent
145
166
  */
146
- getRowsStyles(rows: any): any;
167
+ rowsStyles: import("@angular/core").Signal<{
168
+ [klass: string]: any;
169
+ }[]>;
147
170
  /**
148
171
  * Calculate bottom summary row offset for scrollbar mode.
149
172
  * For more information about cache and offset calculation
150
- * see description for `getRowsStyles` method
173
+ * see description for `rowsStyles` signal
151
174
  *
152
175
  * @returns the CSS3 style to be applied
153
- *
154
- * @memberOf DataTableBodyComponent
155
- */
156
- getBottomSummaryRowStyles(): any;
157
- /**
158
- * Hides the loading indicator
159
176
  */
160
- hideIndicator(): void;
177
+ bottomSummaryRowsStyles: import("@angular/core").Signal<{
178
+ transform: string;
179
+ position: string;
180
+ }>;
161
181
  /**
162
182
  * Updates the index of the rows in the viewport
163
183
  */
@@ -177,7 +197,7 @@ export declare class DataTableBodyComponent implements OnInit, OnDestroy {
177
197
  * a part of the row object itself as we have to preserve the expanded row
178
198
  * status in case of sorting and filtering of the row set.
179
199
  */
180
- toggleRowExpansion(row: any): void;
200
+ toggleRowExpansion(row: TRow): void;
181
201
  /**
182
202
  * Expand/Collapse all the rows no matter what their state is.
183
203
  */
@@ -186,24 +206,26 @@ export declare class DataTableBodyComponent implements OnInit, OnDestroy {
186
206
  * Recalculates the table
187
207
  */
188
208
  recalcLayout(): void;
189
- /**
190
- * Tracks the column
191
- */
192
- columnTrackingFn(index: number, column: any): any;
193
- /**
194
- * Gets the row pinning group styles
195
- */
196
- stylesByGroup(group: string): {
197
- width: string;
198
- };
199
209
  /**
200
210
  * Returns if the row was expanded and set default row expansion when row expansion is empty
201
211
  */
202
- getRowExpanded(row: any): boolean;
203
- getRowExpandedIdx(row: any, expanded: any[]): number;
212
+ getRowExpanded(row: RowOrGroup<TRow>): boolean;
213
+ getRowExpandedIdx(row: RowOrGroup<TRow>, expanded: RowOrGroup<TRow>[]): number;
204
214
  /**
205
215
  * Gets the row index given a row
206
216
  */
207
- getRowIndex(row: any): number;
208
- onTreeAction(row: any): void;
217
+ getRowIndex(row: RowOrGroup<TRow>): number;
218
+ onTreeAction(row: TRow): void;
219
+ dragOver(event: DragEvent, dropRow: RowOrGroup<TRow>): void;
220
+ drag(event: DragEvent, dragRow: RowOrGroup<TRow>, rowComponent: DataTableBodyRowComponent<TRow>): void;
221
+ drop(event: DragEvent, dropRow: RowOrGroup<TRow>, rowComponent: DataTableBodyRowComponent<TRow>): void;
222
+ dragEnter(event: DragEvent, dropRow: RowOrGroup<TRow>, rowComponent: DataTableBodyRowComponent<TRow>): void;
223
+ dragLeave(event: DragEvent, dropRow: RowOrGroup<TRow>, rowComponent: DataTableBodyRowComponent<TRow>): void;
224
+ dragEnd(event: DragEvent, dragRow: RowOrGroup<TRow>): void;
225
+ updateColumnGroupWidths(): void;
226
+ protected isGroup(row: RowOrGroup<TRow>[]): row is Group<TRow>[];
227
+ protected isGroup(row: RowOrGroup<TRow>): row is Group<TRow>;
228
+ protected isRow(row: RowOrGroup<TRow>): row is TRow;
229
+ static ɵfac: i0.ɵɵFactoryDeclaration<DataTableBodyComponent<any>, never>;
230
+ static ɵcmp: i0.ɵɵComponentDeclaration<DataTableBodyComponent<any>, "datatable-body", never, { "rowDefTemplate": { "alias": "rowDefTemplate"; "required": false; }; "scrollbarV": { "alias": "scrollbarV"; "required": false; }; "scrollbarH": { "alias": "scrollbarH"; "required": false; }; "loadingIndicator": { "alias": "loadingIndicator"; "required": false; }; "ghostLoadingIndicator": { "alias": "ghostLoadingIndicator"; "required": false; }; "externalPaging": { "alias": "externalPaging"; "required": false; }; "rowHeight": { "alias": "rowHeight"; "required": false; }; "offsetX": { "alias": "offsetX"; "required": false; }; "selectionType": { "alias": "selectionType"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "rowIdentity": { "alias": "rowIdentity"; "required": false; }; "rowDetail": { "alias": "rowDetail"; "required": false; }; "groupHeader": { "alias": "groupHeader"; "required": false; }; "selectCheck": { "alias": "selectCheck"; "required": false; }; "displayCheck": { "alias": "displayCheck"; "required": false; }; "trackByProp": { "alias": "trackByProp"; "required": false; }; "rowClass": { "alias": "rowClass"; "required": false; }; "groupedRows": { "alias": "groupedRows"; "required": false; }; "groupExpansionDefault": { "alias": "groupExpansionDefault"; "required": false; }; "innerWidth": { "alias": "innerWidth"; "required": false; }; "groupRowsBy": { "alias": "groupRowsBy"; "required": false; }; "virtualization": { "alias": "virtualization"; "required": false; }; "summaryRow": { "alias": "summaryRow"; "required": false; }; "summaryPosition": { "alias": "summaryPosition"; "required": false; }; "summaryHeight": { "alias": "summaryHeight"; "required": false; }; "rowDraggable": { "alias": "rowDraggable"; "required": false; }; "rowDragEvents": { "alias": "rowDragEvents"; "required": false; }; "disableRowCheck": { "alias": "disableRowCheck"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "offset": { "alias": "offset"; "required": false; }; "rowCount": { "alias": "rowCount"; "required": false; }; "bodyHeight": { "alias": "bodyHeight"; "required": false; }; "verticalScrollVisible": { "alias": "verticalScrollVisible"; "required": false; }; }, { "scroll": "scroll"; "page": "page"; "activate": "activate"; "select": "select"; "detailToggle": "detailToggle"; "rowContextmenu": "rowContextmenu"; "treeAction": "treeAction"; }, never, ["[loading-indicator]", "[empty-content]"], true, never>;
209
231
  }
@@ -0,0 +1,12 @@
1
+ import { TableColumn } from '../../../types/table-column.type';
2
+ import * as i0 from "@angular/core";
3
+ export declare class DataTableGhostLoaderComponent {
4
+ columns: TableColumn[];
5
+ pageSize: number;
6
+ rowHeight: number | 'auto' | ((row?: any) => number);
7
+ ghostBodyHeight: number;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<DataTableGhostLoaderComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<DataTableGhostLoaderComponent, "ghost-loader", never, { "columns": { "alias": "columns"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "rowHeight": { "alias": "rowHeight"; "required": false; }; "ghostBodyHeight": { "alias": "ghostBodyHeight"; "required": false; }; }, {}, never, never, true, never>;
10
+ static ngAcceptInputType_pageSize: unknown;
11
+ static ngAcceptInputType_ghostBodyHeight: unknown;
12
+ }
@@ -1,2 +1,5 @@
1
+ import * as i0 from "@angular/core";
1
2
  export declare class ProgressBarComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<ProgressBarComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<ProgressBarComponent, "datatable-progress", never, {}, {}, never, never, true, never>;
2
5
  }