/grid-packages/ag-grid-community/dist/lib/entities/rowNode.d.ts

https://github.com/ceolter/angular-grid · TypeScript Typings · 224 lines · 167 code · 0 blank · 57 comment · 21 complexity · ba32c15702f2b1b02bd99675fe931fe3 MD5 · raw file

  1. import { AgEvent } from "../events";
  2. import { Column } from "./column";
  3. import { RowNodeCache, RowNodeCacheParams } from "../modules/rowNodeCache/rowNodeCache";
  4. import { IEventEmitter } from "../interfaces/iEventEmitter";
  5. import { DetailGridInfo } from "../gridApi";
  6. import { IRowNodeBlock } from "../interfaces/iRowNodeBlock";
  7. export interface SetSelectedParams {
  8. newValue: boolean;
  9. clearSelection?: boolean;
  10. suppressFinishActions?: boolean;
  11. rangeSelect?: boolean;
  12. groupSelectsFiltered?: boolean;
  13. }
  14. export interface RowNodeEvent extends AgEvent {
  15. node: RowNode;
  16. }
  17. export interface DataChangedEvent extends RowNodeEvent {
  18. oldData: any;
  19. newData: any;
  20. update: boolean;
  21. }
  22. export interface CellChangedEvent extends RowNodeEvent {
  23. column: Column;
  24. newValue: any;
  25. oldValue: any;
  26. }
  27. export declare class RowNode implements IEventEmitter {
  28. static ID_PREFIX_ROW_GROUP: string;
  29. static ID_PREFIX_TOP_PINNED: string;
  30. static ID_PREFIX_BOTTOM_PINNED: string;
  31. private static OBJECT_ID_SEQUENCE;
  32. static EVENT_ROW_SELECTED: string;
  33. static EVENT_DATA_CHANGED: string;
  34. static EVENT_CELL_CHANGED: string;
  35. static EVENT_ALL_CHILDREN_COUNT_CHANGED: string;
  36. static EVENT_MASTER_CHANGED: string;
  37. static EVENT_MOUSE_ENTER: string;
  38. static EVENT_MOUSE_LEAVE: string;
  39. static EVENT_HEIGHT_CHANGED: string;
  40. static EVENT_TOP_CHANGED: string;
  41. static EVENT_FIRST_CHILD_CHANGED: string;
  42. static EVENT_LAST_CHILD_CHANGED: string;
  43. static EVENT_CHILD_INDEX_CHANGED: string;
  44. static EVENT_ROW_INDEX_CHANGED: string;
  45. static EVENT_EXPANDED_CHANGED: string;
  46. static EVENT_HAS_CHILDREN_CHANGED: string;
  47. static EVENT_SELECTABLE_CHANGED: string;
  48. static EVENT_UI_LEVEL_CHANGED: string;
  49. static EVENT_HIGHLIGHT_CHANGED: string;
  50. static EVENT_DRAGGING_CHANGED: string;
  51. private mainEventService;
  52. private gridOptionsWrapper;
  53. private selectionController;
  54. private columnController;
  55. private valueService;
  56. private rowModel;
  57. private context;
  58. private valueCache;
  59. private columnApi;
  60. private gridApi;
  61. /** Unique ID for the node. Either provided by the grid, or user can set to match the primary
  62. * key in the database (or whatever data source is used). */
  63. id: string;
  64. /** The group data */
  65. groupData: any;
  66. /** The aggregated data */
  67. aggData: any;
  68. /** The user provided data */
  69. data: any;
  70. /** The parent node to this node, or empty if top level */
  71. parent: RowNode | null;
  72. /** How many levels this node is from the top */
  73. level: number;
  74. /** How many levels this node is from the top in the UI (different to the level when removing parents)*/
  75. uiLevel: number;
  76. /** If doing in memory grouping, this is the index of the group column this cell is for.
  77. * This will always be the same as the level, unless we are collapsing groups ie groupRemoveSingleChildren = true */
  78. rowGroupIndex: number | null;
  79. /** True if this node is a group node (ie has children) */
  80. group: boolean | undefined;
  81. /** True if this row is getting dragged */
  82. dragging: boolean;
  83. /** True if this row is a master row, part of master / detail (ie row can be expanded to show detail) */
  84. master: boolean;
  85. /** True if this row is a detail row, part of master / detail (ie child row of an expanded master row)*/
  86. detail: boolean;
  87. /** If this row is a master row that was expanded, this points to the associated detail row. */
  88. detailNode: RowNode;
  89. /** If master detail, this contains details about the detail grid */
  90. detailGridInfo: DetailGridInfo | null;
  91. /** True if this node is a group and the group is the bottom level in the tree */
  92. leafGroup: boolean;
  93. /** True if this is the first child in this group */
  94. firstChild: boolean;
  95. /** True if this is the last child in this group */
  96. lastChild: boolean;
  97. /** The index of this node in the group */
  98. childIndex: number;
  99. /** The index of this node in the grid, only valid if node is displayed in the grid, otherwise it should be ignored as old index may be present */
  100. rowIndex: number;
  101. /** Either 'top' or 'bottom' if row pinned, otherwise undefined or null */
  102. rowPinned: string;
  103. /** If using quick filter, stores a string representation of the row for searching against */
  104. quickFilterAggregateText: string;
  105. /** Groups only - True if row is a footer. Footers have group = true and footer = true */
  106. footer: boolean;
  107. /** Groups only - The field we are grouping on eg Country*/
  108. field: string | null;
  109. /** Groups only - the row group column for this group */
  110. rowGroupColumn: Column | null;
  111. /** Groups only - The key for the group eg Ireland, UK, USA */
  112. key: any;
  113. /** Used by server side row model, true if this row node is a stub */
  114. stub: boolean;
  115. /** All user provided nodes */
  116. allLeafChildren: RowNode[];
  117. /** Groups only - Children of this group */
  118. childrenAfterGroup: RowNode[];
  119. /** Groups only - Filtered children of this group */
  120. childrenAfterFilter: RowNode[];
  121. /** Groups only - Sorted children of this group */
  122. childrenAfterSort: RowNode[];
  123. /** Groups only - Number of children and grand children */
  124. allChildrenCount: number | null;
  125. /** Children mapped by the pivot columns */
  126. childrenMapped: {
  127. [key: string]: any;
  128. } | null;
  129. /** Server Side Row Model Only - the children are in an infinite cache */
  130. childrenCache: RowNodeCache<IRowNodeBlock, RowNodeCacheParams> | null;
  131. /** Groups only - True if group is expanded, otherwise false */
  132. expanded: boolean;
  133. /** Groups only - If doing footers, reference to the footer node for this group */
  134. sibling: RowNode;
  135. /** The height, in pixels, of this row */
  136. rowHeight: number;
  137. /** Dynamic row heights are done on demand, only when row is visible. However for row virtualisation
  138. * we need a row height to do the 'what rows are in viewport' maths. So we assign a row height to each
  139. * row based on defaults and rowHeightEstimated=true, then when the row is needed for drawing we do
  140. * the row height calculation and set rowHeightEstimated=false.*/
  141. rowHeightEstimated: boolean;
  142. /** The top pixel for this row */
  143. rowTop: number;
  144. /** The top pixel for this row last time, makes sense if data set was ordered or filtered,
  145. * it is used so new rows can animate in from their old position. */
  146. oldRowTop: number;
  147. /** True if this node is a daemon. This means row is not part of the model. Can happen when then
  148. * the row is selected and then the user sets a different ID onto the node. The nodes is then
  149. * representing a different entity, so the selection controller, if the node is selected, takes
  150. * a copy where daemon=true. */
  151. daemon: boolean;
  152. /** True by default - can be overridden via gridOptions.isRowSelectable(rowNode) */
  153. selectable: boolean;
  154. /** Used by the value service, stores values for a particular change detection turn. */
  155. __cacheData: {
  156. [colId: string]: any;
  157. };
  158. __cacheVersion: number;
  159. /** Used by sorting service - to give deterministic sort to groups. Previously we
  160. * just id for this, however id is a string and had slower sorting compared to numbers. */
  161. __objectId: number;
  162. /** We cache the result of hasChildren() so taht we can be aware of when it has changed, and hence
  163. * fire the event. Really we should just have hasChildren as an attribute and do away with hasChildren()
  164. * method, however that would be a breaking change. */
  165. private __hasChildren;
  166. /** True when nodes with the same id are being removed and added as part of the same batch transaction */
  167. alreadyRendered: boolean;
  168. highlighted: 'above' | 'below' | null;
  169. private selected;
  170. private eventService;
  171. setData(data: any): void;
  172. private updateDataOnDetailNode;
  173. private createDataChangedEvent;
  174. private createLocalRowEvent;
  175. updateData(data: any): void;
  176. getRowIndexString(): string;
  177. private createDaemonNode;
  178. setDataAndId(data: any, id: string | undefined): void;
  179. private checkRowSelectable;
  180. setRowSelectable(newVal: boolean): void;
  181. setId(id: string): void;
  182. isPixelInRange(pixel: number): boolean;
  183. clearRowTop(): void;
  184. setFirstChild(firstChild: boolean): void;
  185. setLastChild(lastChild: boolean): void;
  186. setChildIndex(childIndex: number): void;
  187. setRowTop(rowTop: number | null): void;
  188. setDragging(dragging: boolean): void;
  189. setHighlighted(highlighted: 'above' | 'below' | null): void;
  190. setAllChildrenCount(allChildrenCount: number | null): void;
  191. setMaster(master: boolean): void;
  192. setRowHeight(rowHeight: number | undefined | null, estimated?: boolean): void;
  193. setRowIndex(rowIndex: number): void;
  194. setUiLevel(uiLevel: number): void;
  195. setExpanded(expanded: boolean): void;
  196. private createGlobalRowEvent;
  197. private dispatchLocalEvent;
  198. setDataValue(colKey: string | Column, newValue: any): void;
  199. setGroupValue(colKey: string | Column, newValue: any): void;
  200. setAggData(newAggData: any): void;
  201. updateHasChildren(): void;
  202. hasChildren(): boolean;
  203. isEmptyRowGroupNode(): boolean;
  204. private dispatchCellChangedEvent;
  205. resetQuickFilterAggregateText(): void;
  206. isExpandable(): boolean;
  207. isSelected(): boolean;
  208. depthFirstSearch(callback: (rowNode: RowNode) => void): void;
  209. calculateSelectedFromChildren(): void;
  210. setSelectedInitialValue(selected: boolean): void;
  211. setSelected(newValue: boolean, clearSelection?: boolean, suppressFinishActions?: boolean): void;
  212. isRowPinned(): boolean;
  213. setSelectedParams(params: SetSelectedParams): number;
  214. private doRowRangeSelection;
  215. isParentOfNode(potentialParent: RowNode): boolean;
  216. selectThisNode(newValue: boolean): boolean;
  217. private selectChildNodes;
  218. addEventListener(eventType: string, listener: Function): void;
  219. removeEventListener(eventType: string, listener: Function): void;
  220. onMouseEnter(): void;
  221. onMouseLeave(): void;
  222. getFirstChildOfFirstChild(rowGroupColumn: Column | null): RowNode;
  223. isFullWidthCell(): boolean;
  224. }