body.component.d.ts 6.2 KB

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