UNPKG

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