UNPKG

12.5 kBTypeScriptView Raw
1// Type definitions for ag-grid v18.1.2
2// Project: http://www.ag-grid.com/
3// Definitions by: Niall Crosby <https://github.com/ag-grid/>
4import { ColumnGroup } from "../entities/columnGroup";
5import { Column } from "../entities/column";
6import { ColDef, ColGroupDef, IAggFunc } from "../entities/colDef";
7import { ColumnGroupChild } from "../entities/columnGroupChild";
8import { OriginalColumnGroupChild } from "../entities/originalColumnGroupChild";
9import { ColumnEventType } from "../events";
10import { OriginalColumnGroup } from "../entities/originalColumnGroup";
11import { RowNode } from "../entities/rowNode";
12export interface ColumnResizeSet {
13 columns: Column[];
14 ratios: number[];
15 width: number;
16}
17export interface ColumnState {
18 colId: string;
19 hide?: boolean;
20 aggFunc?: string | IAggFunc;
21 width?: number;
22 pivotIndex?: number;
23 pinned?: boolean | string | "left" | "right";
24 rowGroupIndex?: number;
25}
26export declare class ColumnController {
27 private gridOptionsWrapper;
28 private expressionService;
29 private balancedColumnTreeBuilder;
30 private displayedGroupCreator;
31 private autoWidthCalculator;
32 private eventService;
33 private columnUtils;
34 private context;
35 private columnAnimationService;
36 private autoGroupColService;
37 private aggFuncService;
38 private valueCache;
39 private columnApi;
40 private gridApi;
41 private primaryBalancedTree;
42 private primaryHeaderRowCount;
43 private primaryColumns;
44 private secondaryBalancedTree;
45 private secondaryColumns;
46 private secondaryHeaderRowCount;
47 private secondaryColumnsPresent;
48 private columnsForQuickFilter;
49 private gridBalancedTree;
50 private gridColumns;
51 private gridHeaderRowCount;
52 private lastPrimaryOrder;
53 private gridColsArePrimary;
54 private displayedLeftColumnTree;
55 private displayedRightColumnTree;
56 private displayedCentreColumnTree;
57 private displayedLeftHeaderRows;
58 private displayedRightHeaderRows;
59 private displayedCentreHeaderRows;
60 private displayedLeftColumns;
61 private displayedRightColumns;
62 private displayedCenterColumns;
63 private allDisplayedColumns;
64 private allDisplayedVirtualColumns;
65 private allDisplayedCenterVirtualColumns;
66 private colSpanActive;
67 private autoRowHeightColumns;
68 private suppressColumnVirtualisation;
69 private rowGroupColumns;
70 private valueColumns;
71 private pivotColumns;
72 private groupAutoColumns;
73 private groupDisplayColumns;
74 private ready;
75 private logger;
76 private autoGroupsNeedBuilding;
77 private pivotMode;
78 private usingTreeData;
79 private scrollWidth;
80 private scrollPosition;
81 private bodyWidth;
82 private leftWidth;
83 private rightWidth;
84 private bodyWidthDirty;
85 private viewportLeft;
86 private viewportRight;
87 init(): void;
88 isAutoRowHeightActive(): boolean;
89 getAllAutoRowHeightCols(): Column[];
90 private setVirtualViewportLeftAndRight();
91 getDisplayedColumnsStartingAt(column: Column): Column[];
92 private checkDisplayedVirtualColumns();
93 setVirtualViewportPosition(scrollWidth: number, scrollPosition: number): void;
94 isPivotMode(): boolean;
95 private isPivotSettingAllowed(pivot);
96 setPivotMode(pivotMode: boolean, source?: ColumnEventType): void;
97 getSecondaryPivotColumn(pivotKeys: string[], valueColKey: Column | string): Column;
98 private setBeans(loggerFactory);
99 private setFirstRightAndLastLeftPinned(source);
100 autoSizeColumns(keys: (string | Column)[], source?: ColumnEventType): void;
101 autoSizeColumn(key: string | Column, source?: ColumnEventType): void;
102 autoSizeAllColumns(source?: ColumnEventType): void;
103 private getColumnsFromTree(rootColumns);
104 getAllDisplayedColumnGroups(): ColumnGroupChild[];
105 getPrimaryColumnTree(): OriginalColumnGroupChild[];
106 getHeaderRowCount(): number;
107 getLeftDisplayedColumnGroups(): ColumnGroupChild[];
108 getRightDisplayedColumnGroups(): ColumnGroupChild[];
109 getCenterDisplayedColumnGroups(): ColumnGroupChild[];
110 getDisplayedColumnGroups(type: string): ColumnGroupChild[];
111 isColumnDisplayed(column: Column): boolean;
112 getAllDisplayedColumns(): Column[];
113 getAllDisplayedVirtualColumns(): Column[];
114 getDisplayedLeftColumnsForRow(rowNode: RowNode): Column[];
115 getDisplayedRightColumnsForRow(rowNode: RowNode): Column[];
116 private getDisplayedColumnsForRow(rowNode, displayedColumns, filterCallback?, emptySpaceBeforeColumn?);
117 getAllDisplayedCenterVirtualColumnsForRow(rowNode: RowNode): Column[];
118 private isColumnInViewport(col);
119 getPinnedLeftContainerWidth(): number;
120 getPinnedRightContainerWidth(): number;
121 updatePrimaryColumnList(keys: (string | Column)[], masterList: Column[], actionIsAdd: boolean, columnCallback: (column: Column) => void, eventType: string, source?: ColumnEventType): void;
122 setRowGroupColumns(colKeys: (string | Column)[], source?: ColumnEventType): void;
123 private setRowGroupActive(active, column, source);
124 addRowGroupColumn(key: string | Column, source?: ColumnEventType): void;
125 addRowGroupColumns(keys: (string | Column)[], source?: ColumnEventType): void;
126 removeRowGroupColumns(keys: (string | Column)[], source?: ColumnEventType): void;
127 removeRowGroupColumn(key: string | Column, source?: ColumnEventType): void;
128 addPivotColumns(keys: (string | Column)[], source?: ColumnEventType): void;
129 setPivotColumns(colKeys: (string | Column)[], source?: ColumnEventType): void;
130 addPivotColumn(key: string | Column, source?: ColumnEventType): void;
131 removePivotColumns(keys: (string | Column)[], source?: ColumnEventType): void;
132 removePivotColumn(key: string | Column, source?: ColumnEventType): void;
133 private setPrimaryColumnList(colKeys, masterList, eventName, columnCallback, source);
134 setValueColumns(colKeys: (string | Column)[], source?: ColumnEventType): void;
135 private setValueActive(active, column, source);
136 addValueColumns(keys: (string | Column)[], source?: ColumnEventType): void;
137 addValueColumn(colKey: (string | Column), source?: ColumnEventType): void;
138 removeValueColumn(colKey: (string | Column), source?: ColumnEventType): void;
139 removeValueColumns(keys: (string | Column)[], source?: ColumnEventType): void;
140 private normaliseColumnWidth(column, newWidth);
141 private getPrimaryOrGridColumn(key);
142 setColumnWidth(key: string | Column, newWidth: number, shiftKey: boolean, finished: boolean, source?: ColumnEventType): void;
143 private checkMinAndMaxWidthsForSet(columnResizeSet);
144 resizeColumnSets(resizeSets: ColumnResizeSet[], finished: boolean, source: ColumnEventType): void;
145 setColumnAggFunc(column: Column, aggFunc: string, source?: ColumnEventType): void;
146 moveRowGroupColumn(fromIndex: number, toIndex: number, source?: ColumnEventType): void;
147 moveColumns(columnsToMoveKeys: (string | Column)[], toIndex: number, source?: ColumnEventType): void;
148 doesMovePassRules(columnsToMove: Column[], toIndex: number): boolean;
149 doesMovePassLockedPositions(proposedColumnOrder: Column[]): boolean;
150 doesMovePassMarryChildren(allColumnsCopy: Column[]): boolean;
151 moveColumn(key: string | Column, toIndex: number, source?: ColumnEventType): void;
152 moveColumnByIndex(fromIndex: number, toIndex: number, source?: ColumnEventType): void;
153 getBodyContainerWidth(): number;
154 getContainerWidth(pinned: string): number;
155 private updateBodyWidths();
156 getValueColumns(): Column[];
157 getPivotColumns(): Column[];
158 isPivotActive(): boolean;
159 getRowGroupColumns(): Column[];
160 getDisplayedCenterColumns(): Column[];
161 getDisplayedLeftColumns(): Column[];
162 getDisplayedRightColumns(): Column[];
163 getDisplayedColumns(type: string): Column[];
164 getAllPrimaryColumns(): Column[];
165 getAllColumnsForQuickFilter(): Column[];
166 getAllGridColumns(): Column[];
167 isEmpty(): boolean;
168 isRowGroupEmpty(): boolean;
169 setColumnVisible(key: string | Column, visible: boolean, source?: ColumnEventType): void;
170 setColumnsVisible(keys: (string | Column)[], visible: boolean, source?: ColumnEventType): void;
171 setColumnPinned(key: string | Column, pinned: string | boolean, source?: ColumnEventType): void;
172 setColumnsPinned(keys: (string | Column)[], pinned: string | boolean, source?: ColumnEventType): void;
173 private actionOnGridColumns(keys, action, source, createEvent?);
174 getDisplayedColBefore(col: Column): Column;
175 getDisplayedColAfter(col: Column): Column;
176 getDisplayedGroupAfter(columnGroup: ColumnGroup): ColumnGroup;
177 isPinningLeft(): boolean;
178 isPinningRight(): boolean;
179 getPrimaryAndSecondaryAndAutoColumns(): Column[];
180 private createStateItemFromColumn(column);
181 getColumnState(): ColumnState[];
182 private orderColumnStateList(columnStateList);
183 resetColumnState(source?: ColumnEventType): void;
184 setColumnState(columnState: ColumnState[], source?: ColumnEventType): boolean;
185 private sortColumnListUsingIndexes(indexes, colA, colB);
186 private syncColumnWithNoState(column, source);
187 private syncColumnWithStateItem(column, stateItem, rowGroupIndexes, pivotIndexes, source);
188 getGridColumns(keys: (string | Column)[]): Column[];
189 private getColumns(keys, columnLookupCallback);
190 getColumnWithValidation(key: string | Column): Column;
191 getPrimaryColumn(key: string | Column): Column;
192 getGridColumn(key: string | Column): Column;
193 private getColumn(key, columnList);
194 private getAutoColumn(key);
195 private columnsMatch(column, key);
196 getDisplayNameForColumn(column: Column, location: string, includeAggFunc?: boolean): string;
197 getDisplayNameForOriginalColumnGroup(columnGroup: ColumnGroup, originalColumnGroup: OriginalColumnGroup, location: string): string;
198 getDisplayNameForColumnGroup(columnGroup: ColumnGroup, location: string): string;
199 private getHeaderName(colDef, column, columnGroup, originalColumnGroup, location);
200 private wrapHeaderNameWithAggFunc(column, headerName);
201 getColumnGroup(colId: string | ColumnGroup, instanceId?: number): ColumnGroup;
202 setColumnDefs(columnDefs: (ColDef | ColGroupDef)[], source?: ColumnEventType): void;
203 isReady(): boolean;
204 private extractRowGroupColumns(source);
205 private extractPivotColumns(source);
206 resetColumnGroupState(source?: ColumnEventType): void;
207 getColumnGroupState(): {
208 groupId: string;
209 open: boolean;
210 }[];
211 setColumnGroupState(stateItems: {
212 groupId: string;
213 open: boolean;
214 }[], source?: ColumnEventType): void;
215 setColumnGroupOpened(key: OriginalColumnGroup | string, newValue: boolean, source?: ColumnEventType): void;
216 getOriginalColumnGroup(key: OriginalColumnGroup | string): OriginalColumnGroup;
217 private calculateColumnsForDisplay();
218 private checkColSpanActiveInCols(columns);
219 private calculateColumnsForGroupDisplay();
220 getGroupDisplayColumns(): Column[];
221 private updateDisplayedColumns(source);
222 isSecondaryColumnsPresent(): boolean;
223 setSecondaryColumns(colDefs: (ColDef | ColGroupDef)[], source?: ColumnEventType): void;
224 private processSecondaryColumnDefinitions(colDefs);
225 private updateGridColumns();
226 private orderGridColsLikeLastPrimary();
227 isPrimaryColumnGroupsPresent(): boolean;
228 private setupQuickFilterColumns();
229 private putFixedColumnsFirst();
230 private addAutoGroupToGridColumns();
231 private clearDisplayedColumns();
232 private updateGroupsAndDisplayedColumns(source);
233 private updateDisplayedColumnsFromTrees(source);
234 private setupAllDisplayedColumns();
235 private setLeftValues(source);
236 private setLeftValuesOfColumns(source);
237 private setLeftValuesOfGroups();
238 private addToDisplayedColumns(displayedColumnTree, displayedColumns);
239 private updateDisplayedCenterVirtualColumns();
240 getVirtualHeaderGroupRow(type: string, dept: number): ColumnGroupChild[];
241 private updateDisplayedVirtualGroups(virtualColIds);
242 private updateVirtualSets();
243 private filterOutColumnsWithinViewport();
244 sizeColumnsToFit(gridWidth: any, source?: ColumnEventType): void;
245 private buildDisplayedTrees(visibleColumns);
246 private updateOpenClosedVisibilityInColumnGroups();
247 getGroupAutoColumns(): Column[];
248 private createGroupAutoColumnsIfNeeded();
249 private createValueColumns(source);
250 private getWidthOfColsInList(columnList);
251 getGridBalancedTree(): OriginalColumnGroupChild[];
252}