UNPKG

6.51 kBTypeScriptView Raw
1import { EventEmitter, ChangeDetectorRef, OnInit, OnDestroy } from '@angular/core';
2import { ScrollerComponent } from './scroller.component';
3import { SelectionType } from '../../types/selection.type';
4import { RowHeightCache } from '../../utils/row-height-cache';
5export declare class DataTableBodyComponent implements OnInit, OnDestroy {
6 private cd;
7 scrollbarV: boolean;
8 scrollbarH: boolean;
9 loadingIndicator: boolean;
10 externalPaging: boolean;
11 rowHeight: number | 'auto' | ((row?: any) => number);
12 offsetX: number;
13 emptyMessage: string;
14 selectionType: SelectionType;
15 selected: any[];
16 rowIdentity: any;
17 rowDetail: any;
18 groupHeader: any;
19 selectCheck: any;
20 displayCheck: any;
21 trackByProp: string;
22 rowClass: any;
23 groupedRows: any;
24 groupExpansionDefault: boolean;
25 innerWidth: number;
26 groupRowsBy: string;
27 virtualization: boolean;
28 summaryRow: boolean;
29 summaryPosition: string;
30 summaryHeight: number;
31 set pageSize(val: number);
32 get pageSize(): number;
33 set rows(val: any[]);
34 get rows(): any[];
35 set columns(val: any[]);
36 get columns(): any[];
37 set offset(val: number);
38 get offset(): number;
39 set rowCount(val: number);
40 get rowCount(): number;
41 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>;
48 detailToggle: EventEmitter<any>;
49 rowContextmenu: EventEmitter<{
50 event: MouseEvent;
51 row: any;
52 }>;
53 treeAction: EventEmitter<any>;
54 scroller: ScrollerComponent;
55 /**
56 * Returns if selection is enabled.
57 */
58 get selectEnabled(): boolean;
59 /**
60 * Property that would calculate the height of scroll bar
61 * based on the row heights cache for virtual scroll and virtualization. Other scenarios
62 * calculate scroll height automatically (as height will be undefined).
63 */
64 get scrollHeight(): number | undefined;
65 rowHeightsCache: RowHeightCache;
66 temp: any[];
67 offsetY: number;
68 indexes: any;
69 columnGroupWidths: any;
70 columnGroupWidthsWithoutGroup: any;
71 rowTrackingFn: any;
72 listener: any;
73 rowIndexes: any;
74 rowExpansions: any[];
75 _rows: any[];
76 _bodyHeight: any;
77 _columns: any[];
78 _rowCount: number;
79 _offset: number;
80 _pageSize: number;
81 /**
82 * Creates an instance of DataTableBodyComponent.
83 */
84 constructor(cd: ChangeDetectorRef);
85 /**
86 * Called after the constructor, initializing input properties
87 */
88 ngOnInit(): void;
89 /**
90 * Called once, before the instance is destroyed.
91 */
92 ngOnDestroy(): void;
93 /**
94 * Updates the Y offset given a new offset.
95 */
96 updateOffsetY(offset?: number): void;
97 /**
98 * Body was scrolled, this is mainly useful for
99 * when a user is server-side pagination via virtual scroll.
100 */
101 onBodyScroll(event: any): void;
102 /**
103 * Updates the page given a direction.
104 */
105 updatePage(direction: string): void;
106 /**
107 * Updates the rows in the view port
108 */
109 updateRows(): void;
110 /**
111 * Get the row height
112 */
113 getRowHeight(row: any): number;
114 /**
115 * @param group the group with all rows
116 */
117 getGroupHeight(group: any): number;
118 /**
119 * Calculate row height based on the expanded state of the row.
120 */
121 getRowAndDetailHeight(row: any): number;
122 /**
123 * Get the height of the detail row.
124 */
125 getDetailRowHeight: (row?: any, index?: any) => number;
126 /**
127 * Calculates the styles for the row so that the rows can be moved in 2D space
128 * during virtual scroll inside the DOM. In the below case the Y position is
129 * manipulated. As an example, if the height of row 0 is 30 px and row 1 is
130 * 100 px then following styles are generated:
131 *
132 * transform: translate3d(0px, 0px, 0px); -> row0
133 * transform: translate3d(0px, 30px, 0px); -> row1
134 * transform: translate3d(0px, 130px, 0px); -> row2
135 *
136 * Row heights have to be calculated based on the row heights cache as we wont
137 * be able to determine which row is of what height before hand. In the above
138 * case the positionY of the translate3d for row2 would be the sum of all the
139 * heights of the rows before it (i.e. row0 and row1).
140 *
141 * @param rows the row that needs to be placed in the 2D space.
142 * @returns the CSS3 style to be applied
143 *
144 * @memberOf DataTableBodyComponent
145 */
146 getRowsStyles(rows: any): any;
147 /**
148 * Calculate bottom summary row offset for scrollbar mode.
149 * For more information about cache and offset calculation
150 * see description for `getRowsStyles` method
151 *
152 * @returns the CSS3 style to be applied
153 *
154 * @memberOf DataTableBodyComponent
155 */
156 getBottomSummaryRowStyles(): any;
157 /**
158 * Hides the loading indicator
159 */
160 hideIndicator(): void;
161 /**
162 * Updates the index of the rows in the viewport
163 */
164 updateIndexes(): void;
165 /**
166 * Refreshes the full Row Height cache. Should be used
167 * when the entire row array state has changed.
168 */
169 refreshRowHeightCache(): void;
170 /**
171 * Gets the index for the view port
172 */
173 getAdjustedViewPortIndex(): number;
174 /**
175 * Toggle the Expansion of the row i.e. if the row is expanded then it will
176 * collapse and vice versa. Note that the expanded status is stored as
177 * a part of the row object itself as we have to preserve the expanded row
178 * status in case of sorting and filtering of the row set.
179 */
180 toggleRowExpansion(row: any): void;
181 /**
182 * Expand/Collapse all the rows no matter what their state is.
183 */
184 toggleAllRows(expanded: boolean): void;
185 /**
186 * Recalculates the table
187 */
188 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 /**
200 * Returns if the row was expanded and set default row expansion when row expansion is empty
201 */
202 getRowExpanded(row: any): boolean;
203 getRowExpandedIdx(row: any, expanded: any[]): number;
204 /**
205 * Gets the row index given a row
206 */
207 getRowIndex(row: any): number;
208 onTreeAction(row: any): void;
209}