@agile-team/mach-table 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +39 -0
- package/dist/index.cjs +8874 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1939 -0
- package/dist/index.d.ts +1939 -0
- package/dist/index.js +8796 -0
- package/dist/index.js.map +1 -0
- package/package.json +64 -0
- package/styles/mach-table.css +1384 -0
- package/styles/mach-table.css.d.ts +2 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1939 @@
|
|
|
1
|
+
declare class ColumnGroup<TData = any> {
|
|
2
|
+
readonly groupId: string;
|
|
3
|
+
readonly def: ColDefGroup<TData>;
|
|
4
|
+
parent: ColumnGroup<TData> | null;
|
|
5
|
+
children: (ColumnGroup<TData> | Column<TData>)[];
|
|
6
|
+
constructor(groupId: string, def: ColDefGroup<TData>);
|
|
7
|
+
get headerName(): string;
|
|
8
|
+
getLeafColumns(out?: Column<TData>[]): Column<TData>[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare class Column<TData = any> {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly colDef: ColDef<TData>;
|
|
14
|
+
hide: boolean;
|
|
15
|
+
pinned: PinnedDirection | null;
|
|
16
|
+
manualWidth: number | null;
|
|
17
|
+
currentWidth: number;
|
|
18
|
+
parentGroup: ColumnGroup<TData> | null;
|
|
19
|
+
level: number;
|
|
20
|
+
isDetailToggle: boolean;
|
|
21
|
+
constructor(id: string, colDef: ColDef<TData>);
|
|
22
|
+
get sortable(): boolean;
|
|
23
|
+
get resizable(): boolean;
|
|
24
|
+
get movable(): boolean;
|
|
25
|
+
get filterable(): boolean;
|
|
26
|
+
get filterType(): FilterType;
|
|
27
|
+
get hasCheckbox(): boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface RowNode<TData = any> {
|
|
31
|
+
id: string;
|
|
32
|
+
data: TData | null;
|
|
33
|
+
rowIndex: number;
|
|
34
|
+
selected: boolean;
|
|
35
|
+
isDetail?: boolean;
|
|
36
|
+
masterId?: string;
|
|
37
|
+
isGroup?: boolean;
|
|
38
|
+
groupLevel?: number;
|
|
39
|
+
groupKey?: string;
|
|
40
|
+
leafNodes?: RowNode<TData>[];
|
|
41
|
+
aggValues?: Record<string, any>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare const EVENT_TYPES: readonly ["gridReady", "gridDestroyed", "modelUpdated", "cellClicked", "cellDoubleClicked", "cellContextMenu", "rowClicked", "rowDoubleClicked", "selectionChanged", "sortChanged", "filterChanged", "columnResized", "columnMoved", "columnVisibilityChanged", "cellValueChanged", "cellEditingStarted", "cellEditingStopped", "detailToggled", "rowDragEnd", "rangeSelectionChanged", "paginationChanged", "displayedColumnsChanged", "gridError"];
|
|
45
|
+
type GridEventType = (typeof EVENT_TYPES)[number];
|
|
46
|
+
interface GridEventBase {
|
|
47
|
+
type: GridEventType;
|
|
48
|
+
api: GridApi<any>;
|
|
49
|
+
}
|
|
50
|
+
interface GridReadyEvent extends GridEventBase {
|
|
51
|
+
type: "gridReady";
|
|
52
|
+
}
|
|
53
|
+
interface GridDestroyedEvent extends GridEventBase {
|
|
54
|
+
type: "gridDestroyed";
|
|
55
|
+
}
|
|
56
|
+
interface ModelUpdatedEvent extends GridEventBase {
|
|
57
|
+
type: "modelUpdated";
|
|
58
|
+
rowCount: number;
|
|
59
|
+
}
|
|
60
|
+
interface CellClickEvent<TData = any, TValue = any> extends GridEventBase {
|
|
61
|
+
type: "cellClicked";
|
|
62
|
+
event: MouseEvent;
|
|
63
|
+
rowNode: RowNode<TData>;
|
|
64
|
+
rowIndex: number;
|
|
65
|
+
column: Column<TData>;
|
|
66
|
+
colDef: ColDef<TData, TValue>;
|
|
67
|
+
value: TValue;
|
|
68
|
+
}
|
|
69
|
+
interface CellDoubleClickEvent<TData = any, TValue = any> extends GridEventBase {
|
|
70
|
+
type: "cellDoubleClicked";
|
|
71
|
+
event: MouseEvent;
|
|
72
|
+
rowNode: RowNode<TData>;
|
|
73
|
+
rowIndex: number;
|
|
74
|
+
column: Column<TData>;
|
|
75
|
+
colDef: ColDef<TData, TValue>;
|
|
76
|
+
value: TValue;
|
|
77
|
+
}
|
|
78
|
+
interface CellContextMenuEvent<TData = any, TValue = any> extends GridEventBase {
|
|
79
|
+
type: "cellContextMenu";
|
|
80
|
+
event: MouseEvent;
|
|
81
|
+
rowNode: RowNode<TData>;
|
|
82
|
+
rowIndex: number;
|
|
83
|
+
column: Column<TData>;
|
|
84
|
+
colDef: ColDef<TData, TValue>;
|
|
85
|
+
value: TValue;
|
|
86
|
+
}
|
|
87
|
+
interface RowClickEvent<TData = any> extends GridEventBase {
|
|
88
|
+
type: "rowClicked" | "rowDoubleClicked";
|
|
89
|
+
event: MouseEvent;
|
|
90
|
+
rowNode: RowNode<TData>;
|
|
91
|
+
rowIndex: number;
|
|
92
|
+
}
|
|
93
|
+
interface SelectionChangedEvent<TData = any> extends GridEventBase {
|
|
94
|
+
type: "selectionChanged";
|
|
95
|
+
selectedNodes: RowNode<TData>[];
|
|
96
|
+
selectedRows: TData[];
|
|
97
|
+
}
|
|
98
|
+
interface SortChangedEvent extends GridEventBase {
|
|
99
|
+
type: "sortChanged";
|
|
100
|
+
sortModel: SortModel;
|
|
101
|
+
}
|
|
102
|
+
interface FilterChangedEvent extends GridEventBase {
|
|
103
|
+
type: "filterChanged";
|
|
104
|
+
filterModel: FilterModel;
|
|
105
|
+
}
|
|
106
|
+
interface ColumnResizedEvent extends GridEventBase {
|
|
107
|
+
type: "columnResized";
|
|
108
|
+
colId: string;
|
|
109
|
+
width: number;
|
|
110
|
+
finished: boolean;
|
|
111
|
+
}
|
|
112
|
+
interface ColumnMovedEvent extends GridEventBase {
|
|
113
|
+
type: "columnMoved";
|
|
114
|
+
colId: string;
|
|
115
|
+
toIndex: number;
|
|
116
|
+
}
|
|
117
|
+
interface ColumnVisibilityChangedEvent extends GridEventBase {
|
|
118
|
+
type: "columnVisibilityChanged";
|
|
119
|
+
colId: string;
|
|
120
|
+
visible: boolean;
|
|
121
|
+
}
|
|
122
|
+
interface CellValueChangedEvent<TData = any, TValue = any> extends GridEventBase {
|
|
123
|
+
type: "cellValueChanged";
|
|
124
|
+
oldValue: TValue;
|
|
125
|
+
newValue: TValue;
|
|
126
|
+
rowNode: RowNode<TData>;
|
|
127
|
+
rowIndex: number;
|
|
128
|
+
column: Column<TData>;
|
|
129
|
+
colDef: ColDef<TData, TValue>;
|
|
130
|
+
data: TData;
|
|
131
|
+
}
|
|
132
|
+
interface CellEditingStartedEvent<TData = any> extends GridEventBase {
|
|
133
|
+
type: "cellEditingStarted";
|
|
134
|
+
rowIndex: number;
|
|
135
|
+
colId: string;
|
|
136
|
+
rowNode: RowNode<TData>;
|
|
137
|
+
}
|
|
138
|
+
interface CellEditingStoppedEvent<TData = any> extends GridEventBase {
|
|
139
|
+
type: "cellEditingStopped";
|
|
140
|
+
rowIndex: number;
|
|
141
|
+
colId: string;
|
|
142
|
+
rowNode: RowNode<TData>;
|
|
143
|
+
oldValue: any;
|
|
144
|
+
newValue: any;
|
|
145
|
+
}
|
|
146
|
+
interface DetailToggledEvent<TData = any> extends GridEventBase {
|
|
147
|
+
type: "detailToggled";
|
|
148
|
+
rowId: string;
|
|
149
|
+
rowNode: RowNode<TData>;
|
|
150
|
+
expanded: boolean;
|
|
151
|
+
}
|
|
152
|
+
interface GridCellRange {
|
|
153
|
+
row1: number;
|
|
154
|
+
row2: number;
|
|
155
|
+
colId1: string;
|
|
156
|
+
colId2: string;
|
|
157
|
+
}
|
|
158
|
+
interface RangeSelectionChangedEvent extends GridEventBase {
|
|
159
|
+
type: "rangeSelectionChanged";
|
|
160
|
+
range: GridCellRange | null;
|
|
161
|
+
}
|
|
162
|
+
interface RowDragEndEvent<TData = any> extends GridEventBase {
|
|
163
|
+
type: "rowDragEnd";
|
|
164
|
+
rowNode: RowNode<TData>;
|
|
165
|
+
fromIndex: number;
|
|
166
|
+
toIndex: number;
|
|
167
|
+
}
|
|
168
|
+
interface PaginationChangedEvent extends GridEventBase {
|
|
169
|
+
type: "paginationChanged";
|
|
170
|
+
page: number;
|
|
171
|
+
pageSize: number;
|
|
172
|
+
pageCount: number;
|
|
173
|
+
total: number;
|
|
174
|
+
}
|
|
175
|
+
interface DisplayedColumnsChangedEvent extends GridEventBase {
|
|
176
|
+
type: "displayedColumnsChanged";
|
|
177
|
+
}
|
|
178
|
+
interface GridErrorEvent extends GridEventBase {
|
|
179
|
+
type: "gridError";
|
|
180
|
+
error: unknown;
|
|
181
|
+
source: string;
|
|
182
|
+
context?: Record<string, unknown>;
|
|
183
|
+
}
|
|
184
|
+
interface GridEventMap<TData = any> {
|
|
185
|
+
gridReady: GridReadyEvent;
|
|
186
|
+
gridDestroyed: GridDestroyedEvent;
|
|
187
|
+
modelUpdated: ModelUpdatedEvent;
|
|
188
|
+
cellClicked: CellClickEvent<TData>;
|
|
189
|
+
cellDoubleClicked: CellDoubleClickEvent<TData>;
|
|
190
|
+
cellContextMenu: CellContextMenuEvent<TData>;
|
|
191
|
+
rowClicked: RowClickEvent<TData>;
|
|
192
|
+
rowDoubleClicked: RowClickEvent<TData>;
|
|
193
|
+
selectionChanged: SelectionChangedEvent<TData>;
|
|
194
|
+
sortChanged: SortChangedEvent;
|
|
195
|
+
filterChanged: FilterChangedEvent;
|
|
196
|
+
columnResized: ColumnResizedEvent;
|
|
197
|
+
columnMoved: ColumnMovedEvent;
|
|
198
|
+
columnVisibilityChanged: ColumnVisibilityChangedEvent;
|
|
199
|
+
cellValueChanged: CellValueChangedEvent<TData>;
|
|
200
|
+
cellEditingStarted: CellEditingStartedEvent<TData>;
|
|
201
|
+
cellEditingStopped: CellEditingStoppedEvent<TData>;
|
|
202
|
+
detailToggled: DetailToggledEvent<TData>;
|
|
203
|
+
rowDragEnd: RowDragEndEvent<TData>;
|
|
204
|
+
rangeSelectionChanged: RangeSelectionChangedEvent;
|
|
205
|
+
paginationChanged: PaginationChangedEvent;
|
|
206
|
+
displayedColumnsChanged: DisplayedColumnsChangedEvent;
|
|
207
|
+
gridError: GridErrorEvent;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
declare const DEFAULT_LOCALE: {
|
|
211
|
+
readonly matchContains: "包含";
|
|
212
|
+
readonly matchNotContains: "不包含";
|
|
213
|
+
readonly matchEquals: "等于";
|
|
214
|
+
readonly matchNotEquals: "不等于";
|
|
215
|
+
readonly matchStartsWith: "开头是";
|
|
216
|
+
readonly matchEndsWith: "结尾是";
|
|
217
|
+
readonly matchBlank: "为空";
|
|
218
|
+
readonly matchNotBlank: "不为空";
|
|
219
|
+
readonly matchLessThan: "小于";
|
|
220
|
+
readonly matchLessThanOrEqual: "小于等于";
|
|
221
|
+
readonly matchGreaterThan: "大于";
|
|
222
|
+
readonly matchGreaterThanOrEqual: "大于等于";
|
|
223
|
+
readonly matchInRange: "在范围内";
|
|
224
|
+
readonly apply: "应用";
|
|
225
|
+
readonly reset: "重置";
|
|
226
|
+
readonly search: "搜索...";
|
|
227
|
+
readonly emptySetLabel: "(空)";
|
|
228
|
+
readonly selectedCount: "已选 {n} 项";
|
|
229
|
+
readonly sortAsc: "升序";
|
|
230
|
+
readonly sortDesc: "降序";
|
|
231
|
+
readonly clearSort: "取消排序";
|
|
232
|
+
readonly pinLeft: "固定左侧";
|
|
233
|
+
readonly pinRight: "固定右侧";
|
|
234
|
+
readonly clearPin: "取消固定";
|
|
235
|
+
readonly autoSize: "自适应列宽";
|
|
236
|
+
readonly hideColumn: "隐藏此列";
|
|
237
|
+
readonly columnVisibility: "列显示";
|
|
238
|
+
readonly resetAll: "重置全部";
|
|
239
|
+
readonly autoSizeAll: "全部自适应";
|
|
240
|
+
readonly columnSettings: "列设置";
|
|
241
|
+
readonly totalLabel: "合计";
|
|
242
|
+
readonly totalRowsLabel: "共 {n} 行";
|
|
243
|
+
readonly menuCopy: "复制";
|
|
244
|
+
readonly menuPaste: "粘贴";
|
|
245
|
+
readonly menuClearContents: "清除内容";
|
|
246
|
+
readonly loading: "加载中...";
|
|
247
|
+
readonly statusSelected: "已选 {n} 行";
|
|
248
|
+
readonly statusSum: "和 {n}";
|
|
249
|
+
readonly statusAvg: "均 {n}";
|
|
250
|
+
readonly statusCount: "计 {n}";
|
|
251
|
+
readonly emptyRows: "暂无数据";
|
|
252
|
+
readonly emptyRowsHint: "没有可显示的行";
|
|
253
|
+
readonly paginationTotal: "共 {n} 条";
|
|
254
|
+
readonly paginationPage: "第 {a} / {b} 页";
|
|
255
|
+
readonly perPage: "{n} 条/页";
|
|
256
|
+
readonly pageFirst: "首页";
|
|
257
|
+
readonly pagePrev: "上一页";
|
|
258
|
+
readonly pageNext: "下一页";
|
|
259
|
+
readonly pageLast: "末页";
|
|
260
|
+
};
|
|
261
|
+
type RgLocaleKey = keyof typeof DEFAULT_LOCALE;
|
|
262
|
+
type RgLocale = Partial<Record<RgLocaleKey, string>>;
|
|
263
|
+
declare const LOCALE_EN: RgLocale;
|
|
264
|
+
declare function matchLocaleKey(match: string): RgLocaleKey;
|
|
265
|
+
declare function formatText(template: string, n: number | string): string;
|
|
266
|
+
declare function formatTwo(template: string, a: number | string, b: number | string): string;
|
|
267
|
+
|
|
268
|
+
interface ColumnStateStore {
|
|
269
|
+
load(key: string): ColumnState[] | null | Promise<ColumnState[] | null>;
|
|
270
|
+
save(key: string, state: ColumnState[]): void | Promise<void>;
|
|
271
|
+
}
|
|
272
|
+
/** Per-grid component overrides. These take precedence over the global registry. */
|
|
273
|
+
interface GridComponents {
|
|
274
|
+
cellRenderers?: Readonly<Record<string, CellRendererFn>>;
|
|
275
|
+
cellEditors?: Readonly<Record<string, CellEditorFactory>>;
|
|
276
|
+
}
|
|
277
|
+
interface GridFeatureContext<TData = any> {
|
|
278
|
+
readonly api: GridApi<TData>;
|
|
279
|
+
readonly root: HTMLElement;
|
|
280
|
+
getOptions(): Readonly<ResolvedGridOptions<TData>>;
|
|
281
|
+
addEventListener<K extends keyof GridEventMap<TData>>(type: K, listener: (event: GridEventMap<TData>[K]) => void): () => void;
|
|
282
|
+
reportError(error: unknown, source: string, context?: Record<string, unknown>): void;
|
|
283
|
+
}
|
|
284
|
+
/** Composable extension point; feature instances are scoped to one grid. */
|
|
285
|
+
interface GridFeature<TData = any> {
|
|
286
|
+
readonly key: string;
|
|
287
|
+
setup(context: GridFeatureContext<TData>): void | (() => void);
|
|
288
|
+
destroy?(): void;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Safe overlay content. Strings render as text unless
|
|
292
|
+
* `allowUnsafeOverlayHtml` is explicitly enabled.
|
|
293
|
+
*/
|
|
294
|
+
type OverlayTemplate = string | HTMLElement | (() => string | HTMLElement);
|
|
295
|
+
type StatusBarPanel = "rowCount" | "selectedRowCount" | "rangeAggregate";
|
|
296
|
+
interface StatusBarConfig {
|
|
297
|
+
panels?: StatusBarPanel[];
|
|
298
|
+
}
|
|
299
|
+
interface InfiniteGetRowsParams<TData = any> {
|
|
300
|
+
startRow: number;
|
|
301
|
+
endRow: number;
|
|
302
|
+
sortModel: SortModel;
|
|
303
|
+
filterModel: FilterModel;
|
|
304
|
+
quickFilterText: string | null;
|
|
305
|
+
signal: AbortSignal;
|
|
306
|
+
onSuccess(rows: TData[], lastRow?: number): void;
|
|
307
|
+
fail(reason?: unknown): void;
|
|
308
|
+
}
|
|
309
|
+
interface GridDatasource<TData = any> {
|
|
310
|
+
getRows(params: InfiniteGetRowsParams<TData>): void | Promise<void>;
|
|
311
|
+
}
|
|
312
|
+
type EventHandlers<TData = any> = {
|
|
313
|
+
[K in keyof GridEventMap<TData> as `on${Capitalize<K & string>}`]?: (event: GridEventMap<TData>[K]) => void;
|
|
314
|
+
};
|
|
315
|
+
type RowSelectionMode = "none" | "single" | "multiple";
|
|
316
|
+
type GridSize = "compact" | "normal" | "large";
|
|
317
|
+
type ThemeMode = "light" | "dark" | "auto";
|
|
318
|
+
interface DetailRowRendererParams<TData = any> {
|
|
319
|
+
data: TData | null;
|
|
320
|
+
node: RowNode<TData>;
|
|
321
|
+
api: GridApi<TData>;
|
|
322
|
+
}
|
|
323
|
+
interface PaginationConfig {
|
|
324
|
+
pageSize?: number;
|
|
325
|
+
pageSizeOptions?: number[];
|
|
326
|
+
showTotal?: boolean;
|
|
327
|
+
showPageSizeSelector?: boolean;
|
|
328
|
+
}
|
|
329
|
+
interface WatermarkConfig {
|
|
330
|
+
text: string;
|
|
331
|
+
fontSize?: number;
|
|
332
|
+
color?: string;
|
|
333
|
+
opacity?: number;
|
|
334
|
+
gap?: number;
|
|
335
|
+
angle?: number;
|
|
336
|
+
}
|
|
337
|
+
interface GridOptions<TData = any> extends EventHandlers<TData> {
|
|
338
|
+
columnDefs?: (ColDef<TData> | ColDefGroup<TData>)[] | null;
|
|
339
|
+
rowData?: TData[] | null;
|
|
340
|
+
defaultColDef?: Partial<ColDef<TData>>;
|
|
341
|
+
getRowId?: (params: GetRowIdParams<TData>) => string;
|
|
342
|
+
rowHeight?: number;
|
|
343
|
+
headerHeight?: number;
|
|
344
|
+
rowBuffer?: number;
|
|
345
|
+
rowSelection?: RowSelectionMode;
|
|
346
|
+
multiSort?: boolean;
|
|
347
|
+
size?: GridSize;
|
|
348
|
+
stripedRows?: boolean;
|
|
349
|
+
showCellBorders?: boolean;
|
|
350
|
+
theme?: ThemeMode;
|
|
351
|
+
quickFilterText?: string | null;
|
|
352
|
+
masterDetail?: boolean;
|
|
353
|
+
detailRowHeight?: number;
|
|
354
|
+
detailRowRenderer?: (params: DetailRowRendererParams<TData>) => string | HTMLElement | ICellRendererResult | null | undefined;
|
|
355
|
+
isRowExpandable?: (params: DetailRowRendererParams<TData>) => boolean;
|
|
356
|
+
detailToggleColumn?: boolean;
|
|
357
|
+
columnMenu?: boolean;
|
|
358
|
+
columnStateKey?: string | null;
|
|
359
|
+
columnStateStore?: ColumnStateStore;
|
|
360
|
+
aggFuncs?: Record<string, (values: any[]) => any>;
|
|
361
|
+
components?: GridComponents;
|
|
362
|
+
features?: readonly GridFeature<TData>[];
|
|
363
|
+
locale?: RgLocale;
|
|
364
|
+
singleClickEdit?: boolean;
|
|
365
|
+
manualSorting?: boolean;
|
|
366
|
+
manualFiltering?: boolean;
|
|
367
|
+
showSummary?: boolean;
|
|
368
|
+
summaryMethod?: (params: {
|
|
369
|
+
colId: string;
|
|
370
|
+
column: Column<any>;
|
|
371
|
+
values: any[];
|
|
372
|
+
}) => string;
|
|
373
|
+
treeData?: boolean;
|
|
374
|
+
childrenKey?: string;
|
|
375
|
+
autoCheckedChildren?: boolean;
|
|
376
|
+
defaultExpandAll?: boolean;
|
|
377
|
+
indexOffset?: number;
|
|
378
|
+
applyRowDrag?: boolean;
|
|
379
|
+
undoStackSize?: number;
|
|
380
|
+
getRowHeight?: (params: GetRowHeightParams<TData>) => number;
|
|
381
|
+
pinnedTopRowData?: TData[] | null;
|
|
382
|
+
pinnedBottomRowData?: TData[] | null;
|
|
383
|
+
pagination?: boolean | PaginationConfig;
|
|
384
|
+
watermark?: boolean | WatermarkConfig;
|
|
385
|
+
suppressWarnings?: boolean;
|
|
386
|
+
enableRangeSelection?: boolean;
|
|
387
|
+
suppressClipboard?: boolean;
|
|
388
|
+
contextMenu?: boolean;
|
|
389
|
+
getContextMenuItems?: (params: ContextMenuParams<TData>) => ContextMenuItem[] | null;
|
|
390
|
+
tooltipComponent?: (params: TooltipParams<TData>) => string | HTMLElement;
|
|
391
|
+
tooltipShowDelay?: number;
|
|
392
|
+
flashCells?: boolean;
|
|
393
|
+
fillHandle?: boolean;
|
|
394
|
+
statusBar?: boolean | StatusBarConfig;
|
|
395
|
+
datasource?: GridDatasource<TData>;
|
|
396
|
+
blockSize?: number;
|
|
397
|
+
infiniteBufferRows?: number;
|
|
398
|
+
suppressCellFocus?: boolean;
|
|
399
|
+
suppressRowHoverHighlight?: boolean;
|
|
400
|
+
suppressNoRowsOverlay?: boolean;
|
|
401
|
+
suppressHeaderFocus?: boolean;
|
|
402
|
+
loading?: boolean;
|
|
403
|
+
overlayNoRowsTemplate?: OverlayTemplate;
|
|
404
|
+
overlayLoadingTemplate?: OverlayTemplate;
|
|
405
|
+
/** Opt in only for trusted overlay strings. Prefer HTMLElement factories. */
|
|
406
|
+
allowUnsafeOverlayHtml?: boolean;
|
|
407
|
+
className?: string;
|
|
408
|
+
}
|
|
409
|
+
interface ResolvedGridOptions<TData = any> extends EventHandlers<TData> {
|
|
410
|
+
columnDefs: (ColDef<TData> | ColDefGroup<TData>)[];
|
|
411
|
+
rowData: TData[];
|
|
412
|
+
defaultColDef: Partial<ColDef<TData>>;
|
|
413
|
+
getRowId?: (params: GetRowIdParams<TData>) => string;
|
|
414
|
+
rowHeight: number;
|
|
415
|
+
headerHeight: number;
|
|
416
|
+
rowBuffer: number;
|
|
417
|
+
rowSelection: RowSelectionMode;
|
|
418
|
+
multiSort: boolean;
|
|
419
|
+
size: GridSize;
|
|
420
|
+
stripedRows: boolean;
|
|
421
|
+
showCellBorders: boolean;
|
|
422
|
+
theme: ThemeMode;
|
|
423
|
+
quickFilterText: string | null;
|
|
424
|
+
masterDetail: boolean;
|
|
425
|
+
detailRowHeight: number;
|
|
426
|
+
detailRowRenderer?: (params: DetailRowRendererParams<TData>) => string | HTMLElement | ICellRendererResult | null | undefined;
|
|
427
|
+
isRowExpandable?: (params: DetailRowRendererParams<TData>) => boolean;
|
|
428
|
+
detailToggleColumn: boolean;
|
|
429
|
+
columnMenu: boolean;
|
|
430
|
+
columnStateKey: string | null;
|
|
431
|
+
columnStateStore?: ColumnStateStore;
|
|
432
|
+
aggFuncs?: Record<string, (values: any[]) => any>;
|
|
433
|
+
components?: GridComponents;
|
|
434
|
+
features: readonly GridFeature<TData>[];
|
|
435
|
+
locale: RgLocale;
|
|
436
|
+
singleClickEdit: boolean;
|
|
437
|
+
manualSorting: boolean;
|
|
438
|
+
manualFiltering: boolean;
|
|
439
|
+
showSummary: boolean;
|
|
440
|
+
summaryMethod?: (params: {
|
|
441
|
+
colId: string;
|
|
442
|
+
column: Column<any>;
|
|
443
|
+
values: any[];
|
|
444
|
+
}) => string;
|
|
445
|
+
treeData: boolean;
|
|
446
|
+
childrenKey: string;
|
|
447
|
+
autoCheckedChildren: boolean;
|
|
448
|
+
defaultExpandAll: boolean;
|
|
449
|
+
indexOffset: number;
|
|
450
|
+
applyRowDrag: boolean;
|
|
451
|
+
undoStackSize: number;
|
|
452
|
+
getRowHeight?: (params: GetRowHeightParams<TData>) => number;
|
|
453
|
+
pinnedTopRowData: TData[];
|
|
454
|
+
pinnedBottomRowData: TData[];
|
|
455
|
+
paginationEnabled: boolean;
|
|
456
|
+
paginationPageSize: number;
|
|
457
|
+
paginationPageSizeOptions: number[];
|
|
458
|
+
paginationShowTotal: boolean;
|
|
459
|
+
paginationShowSizeSelector: boolean;
|
|
460
|
+
watermarkEnabled: boolean;
|
|
461
|
+
watermarkConfig: WatermarkConfig | null;
|
|
462
|
+
suppressWarnings: boolean;
|
|
463
|
+
enableRangeSelection: boolean;
|
|
464
|
+
suppressClipboard: boolean;
|
|
465
|
+
contextMenu: boolean;
|
|
466
|
+
getContextMenuItems?: (params: ContextMenuParams<TData>) => ContextMenuItem[] | null;
|
|
467
|
+
tooltipComponent?: (params: TooltipParams<TData>) => string | HTMLElement;
|
|
468
|
+
tooltipShowDelay: number;
|
|
469
|
+
flashCells: boolean;
|
|
470
|
+
fillHandle: boolean;
|
|
471
|
+
statusBarEnabled: boolean;
|
|
472
|
+
statusBarPanels: StatusBarPanel[];
|
|
473
|
+
datasource?: GridDatasource<TData>;
|
|
474
|
+
blockSize: number;
|
|
475
|
+
infiniteBufferRows: number;
|
|
476
|
+
suppressCellFocus: boolean;
|
|
477
|
+
suppressRowHoverHighlight: boolean;
|
|
478
|
+
suppressNoRowsOverlay: boolean;
|
|
479
|
+
suppressHeaderFocus: boolean;
|
|
480
|
+
loading: boolean;
|
|
481
|
+
overlayNoRowsTemplate: OverlayTemplate;
|
|
482
|
+
overlayLoadingTemplate: OverlayTemplate;
|
|
483
|
+
allowUnsafeOverlayHtml: boolean;
|
|
484
|
+
className: string;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
interface CsvExportParams {
|
|
488
|
+
includeHeader?: boolean;
|
|
489
|
+
columnSeparator?: string;
|
|
490
|
+
prependBOM?: boolean;
|
|
491
|
+
onlySelected?: boolean;
|
|
492
|
+
onlyAllDisplayed?: boolean;
|
|
493
|
+
protectFormulas?: boolean;
|
|
494
|
+
headersOnly?: boolean;
|
|
495
|
+
}
|
|
496
|
+
interface ImportCsvOptions {
|
|
497
|
+
separator?: string;
|
|
498
|
+
mode?: "replace" | "append" | "paste";
|
|
499
|
+
headerRowIndex?: number;
|
|
500
|
+
coerceNumbers?: boolean;
|
|
501
|
+
parseValue?: (params: {
|
|
502
|
+
value: string;
|
|
503
|
+
field: string;
|
|
504
|
+
rowIndex: number;
|
|
505
|
+
columnIndex: number;
|
|
506
|
+
}) => any;
|
|
507
|
+
}
|
|
508
|
+
interface PrintOptions {
|
|
509
|
+
title?: string;
|
|
510
|
+
includeHeader?: boolean;
|
|
511
|
+
}
|
|
512
|
+
interface RowTransaction<TData = any> {
|
|
513
|
+
add?: TData[];
|
|
514
|
+
addIndex?: number;
|
|
515
|
+
remove?: TData[];
|
|
516
|
+
update?: TData[];
|
|
517
|
+
}
|
|
518
|
+
interface GridApi<TData = any> {
|
|
519
|
+
setRowData(rows: TData[] | null | undefined): void;
|
|
520
|
+
applyTransaction(transaction: RowTransaction<TData>): void;
|
|
521
|
+
getColumnDefs(): (ColDef<TData> | ColDefGroup<TData>)[] | null;
|
|
522
|
+
setColumnDefs(colDefs: (ColDef<TData> | ColDefGroup<TData>)[] | null | undefined): void;
|
|
523
|
+
getColumnState(): ColumnState[];
|
|
524
|
+
setColumnState(state: ColumnState[]): void;
|
|
525
|
+
resetColumnState(): void;
|
|
526
|
+
setColumnVisibility(colId: string, visible: boolean): void;
|
|
527
|
+
moveColumn(colId: string, toIndex: number): void;
|
|
528
|
+
setColumnPinned(colId: string, pinned: "left" | "right" | null): void;
|
|
529
|
+
sizeColumnsToFit(width?: number): void;
|
|
530
|
+
autoSizeColumn(colId: string, skipHeader?: boolean): void;
|
|
531
|
+
autoSizeAllColumns(skipHeader?: boolean): void;
|
|
532
|
+
getSortModel(): SortModel;
|
|
533
|
+
setSortModel(sortModel: SortModel | null): void;
|
|
534
|
+
getFilterModel(): FilterModel;
|
|
535
|
+
setFilterModel(filterModel: FilterModel | null): void;
|
|
536
|
+
isColumnFilterPresent(colId: string): boolean;
|
|
537
|
+
setQuickFilter(text: string | null | undefined): void;
|
|
538
|
+
getQuickFilter(): string | null;
|
|
539
|
+
getRowSelection(): RowSelectionMode;
|
|
540
|
+
setRowSelection(mode: RowSelectionMode): void;
|
|
541
|
+
getSelectedNodes(): RowNode<TData>[];
|
|
542
|
+
getSelectedRows(): TData[];
|
|
543
|
+
selectNodeById(nodeId: string, selected?: boolean, clearOthers?: boolean): void;
|
|
544
|
+
selectAll(filteredOnly?: boolean): void;
|
|
545
|
+
deselectAll(): void;
|
|
546
|
+
getDisplayedRowCount(): number;
|
|
547
|
+
getRowNode(rowIndex: number): RowNode<TData> | undefined;
|
|
548
|
+
getNodeById(id: string): RowNode<TData> | undefined;
|
|
549
|
+
forEachNode(callback: (node: RowNode<TData>, index: number) => void): void;
|
|
550
|
+
forEachNodeAfterFilterAndSort(callback: (node: RowNode<TData>, index: number) => void): void;
|
|
551
|
+
scrollToIndex(rowIndex: number, position?: "top" | "bottom" | "middle" | "nearest"): void;
|
|
552
|
+
expandRow(rowId: string): boolean;
|
|
553
|
+
collapseRow(rowId: string): boolean;
|
|
554
|
+
toggleDetailRow(rowId: string): boolean;
|
|
555
|
+
isRowExpanded(rowId: string): boolean;
|
|
556
|
+
expandAllDetails(): void;
|
|
557
|
+
collapseAllDetails(): void;
|
|
558
|
+
toggleRowGroup(groupId: string): boolean;
|
|
559
|
+
isGroupExpanded(groupId: string): boolean;
|
|
560
|
+
expandAllGroups(): void;
|
|
561
|
+
collapseAllGroups(): void;
|
|
562
|
+
reorderRows(fromIndex: number, toIndex: number): boolean;
|
|
563
|
+
setSelection(rows: TData[], clearOthers?: boolean): void;
|
|
564
|
+
getVisibleSelection(): TData[];
|
|
565
|
+
getSelectedIds(): string[];
|
|
566
|
+
undo(): boolean;
|
|
567
|
+
redo(): boolean;
|
|
568
|
+
canUndo(): boolean;
|
|
569
|
+
canRedo(): boolean;
|
|
570
|
+
setPinnedTopRowData(rows: TData[] | null): void;
|
|
571
|
+
getPinnedTopRowData(): TData[];
|
|
572
|
+
setPinnedBottomRowData(rows: TData[] | null): void;
|
|
573
|
+
getPinnedBottomRowData(): TData[];
|
|
574
|
+
getRangeSelection(): GridCellRange | null;
|
|
575
|
+
clearRangeSelection(): void;
|
|
576
|
+
copyRangeToClipboard(): Promise<boolean>;
|
|
577
|
+
openColumnPanel(anchor?: HTMLElement): void;
|
|
578
|
+
refreshLayout(): void;
|
|
579
|
+
isInfinite(): boolean;
|
|
580
|
+
reload(): Promise<void>;
|
|
581
|
+
paginationEnabled(): boolean;
|
|
582
|
+
setPaginationEnabled(enabled: boolean): void;
|
|
583
|
+
getPage(): number;
|
|
584
|
+
setPage(page: number): void;
|
|
585
|
+
getPageSize(): number;
|
|
586
|
+
setPageSize(size: number): void;
|
|
587
|
+
getPageCount(): number;
|
|
588
|
+
getTotalRowCount(): number;
|
|
589
|
+
importCsv(text: string, options?: ImportCsvOptions): boolean;
|
|
590
|
+
print(options?: PrintOptions): boolean;
|
|
591
|
+
startEditingCell(params: {
|
|
592
|
+
rowIndex: number;
|
|
593
|
+
colId: string;
|
|
594
|
+
keyPress?: string;
|
|
595
|
+
}): boolean;
|
|
596
|
+
stopEditing(cancel?: boolean): void;
|
|
597
|
+
refreshCells(): void;
|
|
598
|
+
updateOptions(options: Partial<GridOptions<TData>>): void;
|
|
599
|
+
getDataAsCsv(params?: CsvExportParams): string;
|
|
600
|
+
setOverlay(type: "loading" | "noRows" | null): void;
|
|
601
|
+
hideOverlays(): void;
|
|
602
|
+
addEventListener<K extends GridEventType>(eventType: K, listener: (event: GridEventMap<TData>[K]) => void): () => void;
|
|
603
|
+
removeEventListener<K extends GridEventType>(eventType: K, listener: (event: GridEventMap<TData>[K]) => void): void;
|
|
604
|
+
destroy(): void;
|
|
605
|
+
isDestroyed(): boolean;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
interface ValueGetterParams<TData = any, TValue = any> {
|
|
609
|
+
data: TData | null;
|
|
610
|
+
node: RowNode<TData>;
|
|
611
|
+
colDef: ColDef<TData, TValue>;
|
|
612
|
+
column: Column<TData>;
|
|
613
|
+
api: GridApi<TData>;
|
|
614
|
+
}
|
|
615
|
+
interface ValueFormatterParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
616
|
+
value: TValue;
|
|
617
|
+
}
|
|
618
|
+
interface CellRendererParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
619
|
+
value: TValue;
|
|
620
|
+
formatted: string;
|
|
621
|
+
rowIndex: number;
|
|
622
|
+
rendererParams?: Record<string, any>;
|
|
623
|
+
}
|
|
624
|
+
interface CellClassParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
625
|
+
value: TValue;
|
|
626
|
+
rowIndex: number;
|
|
627
|
+
}
|
|
628
|
+
interface EditableParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
629
|
+
value: TValue;
|
|
630
|
+
rowIndex: number;
|
|
631
|
+
}
|
|
632
|
+
interface CellEditorParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
633
|
+
value: TValue;
|
|
634
|
+
rowIndex: number;
|
|
635
|
+
keyPress?: string | null;
|
|
636
|
+
}
|
|
637
|
+
interface ValueSetterParams<TData = any, TValue = any> {
|
|
638
|
+
oldValue: TValue;
|
|
639
|
+
newValue: TValue;
|
|
640
|
+
data: TData;
|
|
641
|
+
node: RowNode<TData>;
|
|
642
|
+
colDef: ColDef<TData, TValue>;
|
|
643
|
+
column: Column<TData>;
|
|
644
|
+
api: GridApi<TData>;
|
|
645
|
+
}
|
|
646
|
+
interface GetRowIdParams<TData = any> {
|
|
647
|
+
data: TData;
|
|
648
|
+
index: number;
|
|
649
|
+
api: GridApi<TData>;
|
|
650
|
+
}
|
|
651
|
+
interface GetRowHeightParams<TData = any> {
|
|
652
|
+
data: TData | null;
|
|
653
|
+
node: RowNode<TData>;
|
|
654
|
+
api: GridApi<TData>;
|
|
655
|
+
}
|
|
656
|
+
interface TooltipParams<TData = any> {
|
|
657
|
+
data: TData | null;
|
|
658
|
+
node: RowNode<TData>;
|
|
659
|
+
api: GridApi<TData>;
|
|
660
|
+
colId: string;
|
|
661
|
+
value: any;
|
|
662
|
+
formatted: string;
|
|
663
|
+
rowIndex: number;
|
|
664
|
+
}
|
|
665
|
+
interface ContextMenuParams<TData = any> {
|
|
666
|
+
data: TData | null;
|
|
667
|
+
node: RowNode<TData>;
|
|
668
|
+
api: GridApi<TData>;
|
|
669
|
+
colId: string;
|
|
670
|
+
value: any;
|
|
671
|
+
rowIndex: number;
|
|
672
|
+
}
|
|
673
|
+
interface ContextMenuItem {
|
|
674
|
+
label?: string;
|
|
675
|
+
action?: () => void;
|
|
676
|
+
danger?: boolean;
|
|
677
|
+
disabled?: boolean;
|
|
678
|
+
separator?: boolean;
|
|
679
|
+
}
|
|
680
|
+
interface HeaderComponentParams<TData = any> {
|
|
681
|
+
colDef: ColDef<TData>;
|
|
682
|
+
column: Column<TData>;
|
|
683
|
+
api: GridApi<TData>;
|
|
684
|
+
}
|
|
685
|
+
interface ICellRendererResult {
|
|
686
|
+
el: HTMLElement;
|
|
687
|
+
destroy?: () => void;
|
|
688
|
+
}
|
|
689
|
+
type CellRendererOutput = string | HTMLElement | ICellRendererResult | null | undefined;
|
|
690
|
+
interface ICellEditor<TValue = any> {
|
|
691
|
+
el: HTMLElement;
|
|
692
|
+
getValue(): TValue | null | undefined;
|
|
693
|
+
focus?(): void;
|
|
694
|
+
destroy?(): void;
|
|
695
|
+
isCancelBeforeStart?(): boolean;
|
|
696
|
+
isCancelAfterEnd?(value: TValue | null | undefined): boolean;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
type SortDirection = "asc" | "desc";
|
|
700
|
+
type PinnedDirection = "left" | "right";
|
|
701
|
+
type FilterType = "text" | "number" | "date" | "set";
|
|
702
|
+
type CellAlign = "left" | "center" | "right";
|
|
703
|
+
type TextFilterMatch = "contains" | "notContains" | "equals" | "notEquals" | "startsWith" | "endsWith" | "blank" | "notBlank";
|
|
704
|
+
type NumberFilterMatch = "equals" | "notEquals" | "lessThan" | "lessThanOrEqual" | "greaterThan" | "greaterThanOrEqual" | "inRange" | "blank" | "notBlank";
|
|
705
|
+
type DateFilterMatch = "equals" | "notEquals" | "lessThan" | "greaterThan" | "inRange" | "blank" | "notBlank";
|
|
706
|
+
interface TextFilterCondition {
|
|
707
|
+
match: TextFilterMatch;
|
|
708
|
+
value?: string;
|
|
709
|
+
}
|
|
710
|
+
interface NumberFilterCondition {
|
|
711
|
+
match: NumberFilterMatch;
|
|
712
|
+
value?: number;
|
|
713
|
+
value2?: number;
|
|
714
|
+
}
|
|
715
|
+
interface DateFilterCondition {
|
|
716
|
+
match: DateFilterMatch;
|
|
717
|
+
value?: string;
|
|
718
|
+
value2?: string;
|
|
719
|
+
}
|
|
720
|
+
interface SetFilterCondition {
|
|
721
|
+
values: (string | number | null)[];
|
|
722
|
+
}
|
|
723
|
+
interface TextColumnFilter {
|
|
724
|
+
type: "text";
|
|
725
|
+
operator?: "and" | "or";
|
|
726
|
+
conditions: TextFilterCondition[];
|
|
727
|
+
}
|
|
728
|
+
interface NumberColumnFilter {
|
|
729
|
+
type: "number";
|
|
730
|
+
operator?: "and" | "or";
|
|
731
|
+
conditions: NumberFilterCondition[];
|
|
732
|
+
}
|
|
733
|
+
interface DateColumnFilter {
|
|
734
|
+
type: "date";
|
|
735
|
+
operator?: "and" | "or";
|
|
736
|
+
conditions: DateFilterCondition[];
|
|
737
|
+
}
|
|
738
|
+
interface SetColumnFilter {
|
|
739
|
+
type: "set";
|
|
740
|
+
values: (string | number | null)[];
|
|
741
|
+
}
|
|
742
|
+
type ColumnFilter = TextColumnFilter | NumberColumnFilter | DateColumnFilter | SetColumnFilter;
|
|
743
|
+
type FilterModel = Record<string, ColumnFilter>;
|
|
744
|
+
interface SortModelItem {
|
|
745
|
+
colId: string;
|
|
746
|
+
direction: SortDirection;
|
|
747
|
+
}
|
|
748
|
+
type SortModel = SortModelItem[];
|
|
749
|
+
interface SelectEditorParams {
|
|
750
|
+
values: (string | number)[];
|
|
751
|
+
}
|
|
752
|
+
interface SetFilterParams {
|
|
753
|
+
values?: (string | number | null)[];
|
|
754
|
+
maxValues?: number;
|
|
755
|
+
}
|
|
756
|
+
type CellEditorFactory = (params: CellEditorParams) => ICellEditor;
|
|
757
|
+
type CellRendererFn = (params: CellRendererParams) => string | HTMLElement | ICellRendererResult | null | undefined;
|
|
758
|
+
type CellClassRule = string | string[] | ((params: CellClassParams) => string | string[] | null | undefined);
|
|
759
|
+
type CellStyleRule = Partial<CSSStyleDeclaration> | ((params: CellClassParams<any, any>) => Partial<CSSStyleDeclaration> | null | undefined);
|
|
760
|
+
interface ColDef<TData = any, TValue = any> {
|
|
761
|
+
colId?: string;
|
|
762
|
+
field?: string;
|
|
763
|
+
headerName?: string;
|
|
764
|
+
align?: CellAlign;
|
|
765
|
+
headerAlign?: CellAlign;
|
|
766
|
+
headerClass?: string | string[];
|
|
767
|
+
headerTooltip?: string;
|
|
768
|
+
headerComponent?: (params: HeaderComponentParams<TData>) => string | HTMLElement | ICellRendererResult | null | undefined;
|
|
769
|
+
width?: number;
|
|
770
|
+
minWidth?: number;
|
|
771
|
+
maxWidth?: number;
|
|
772
|
+
flex?: number;
|
|
773
|
+
hide?: boolean;
|
|
774
|
+
pinned?: PinnedDirection | boolean;
|
|
775
|
+
sortable?: boolean;
|
|
776
|
+
resizable?: boolean;
|
|
777
|
+
movable?: boolean;
|
|
778
|
+
filter?: boolean | FilterType;
|
|
779
|
+
filterParams?: SetFilterParams;
|
|
780
|
+
editable?: boolean | ((params: EditableParams<TData, TValue>) => boolean);
|
|
781
|
+
cellEditor?: "text" | "number" | "date" | "select" | CellEditorFactory | string;
|
|
782
|
+
cellEditorParams?: SelectEditorParams;
|
|
783
|
+
wrapText?: boolean;
|
|
784
|
+
checkboxSelection?: boolean;
|
|
785
|
+
rowGroup?: boolean;
|
|
786
|
+
aggFunc?: string;
|
|
787
|
+
cellStyle?: CellStyleRule;
|
|
788
|
+
selectable?: (params: CellClassParams<TData, TValue>) => boolean;
|
|
789
|
+
singleClickEdit?: boolean;
|
|
790
|
+
tooltipValueGetter?: (params: ValueFormatterParams<TData, TValue>) => string | null | undefined;
|
|
791
|
+
rowSpan?: (params: CellClassParams<TData, TValue>) => number;
|
|
792
|
+
autoRowSpan?: boolean;
|
|
793
|
+
colSpan?: (params: CellClassParams<TData, TValue>) => number;
|
|
794
|
+
autoHeight?: boolean;
|
|
795
|
+
validate?: (newValue: TValue, params: ValueSetterParams<TData, TValue>) => string | true | null | undefined;
|
|
796
|
+
rowDrag?: boolean;
|
|
797
|
+
valueGetter?: (params: ValueGetterParams<TData, TValue>) => TValue;
|
|
798
|
+
valueSetter?: (params: ValueSetterParams<TData, TValue>) => boolean;
|
|
799
|
+
valueFormatter?: (params: ValueFormatterParams<TData, TValue>) => any;
|
|
800
|
+
cellRenderer?: CellRendererFn | string;
|
|
801
|
+
cellRendererParams?: Record<string, any>;
|
|
802
|
+
cellClass?: CellClassRule;
|
|
803
|
+
comparator?: (valueA: any, valueB: any, nodeA: RowNode<TData>, nodeB: RowNode<TData>) => number;
|
|
804
|
+
type?: string;
|
|
805
|
+
initialSort?: SortDirection;
|
|
806
|
+
onCellClick?: (event: CellClickEvent<TData, TValue>) => void;
|
|
807
|
+
onCellDoubleClick?: (event: CellDoubleClickEvent<TData, TValue>) => void;
|
|
808
|
+
}
|
|
809
|
+
interface ColDefGroup<TData = any> {
|
|
810
|
+
groupId?: string;
|
|
811
|
+
headerName?: string;
|
|
812
|
+
headerClass?: string | string[];
|
|
813
|
+
children: (ColDefGroup<TData> | ColDef<TData>)[];
|
|
814
|
+
}
|
|
815
|
+
type ColDefOrGroup<TData = any> = ColDefGroup<TData> | ColDef<TData>;
|
|
816
|
+
declare function isColDefGroup<TData = any>(def: ColDefOrGroup<TData>): def is ColDefGroup<TData>;
|
|
817
|
+
interface ColumnState {
|
|
818
|
+
colId: string;
|
|
819
|
+
hide?: boolean;
|
|
820
|
+
width?: number;
|
|
821
|
+
pinned?: "left" | "right" | null;
|
|
822
|
+
sort?: SortDirection | null;
|
|
823
|
+
sortIndex?: number | null;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
declare function createGrid<TData = any>(container: HTMLElement, options?: GridOptions<TData>): GridApi<TData>;
|
|
827
|
+
|
|
828
|
+
type EventKey<TEvents extends object> = Extract<keyof TEvents, string>;
|
|
829
|
+
type Listener<TEvent> = (event: TEvent) => void;
|
|
830
|
+
declare class EventBus<TEvents extends object = Record<string, any>> {
|
|
831
|
+
private onListenerError?;
|
|
832
|
+
private listeners;
|
|
833
|
+
constructor(onListenerError?: ((error: unknown, eventType: EventKey<TEvents>) => void) | undefined);
|
|
834
|
+
on<K extends EventKey<TEvents>>(type: K, listener: Listener<TEvents[K]>): () => void;
|
|
835
|
+
once<K extends EventKey<TEvents>>(type: K, listener: Listener<TEvents[K]>): () => void;
|
|
836
|
+
off<K extends EventKey<TEvents>>(type: K, listener: Listener<TEvents[K]>): void;
|
|
837
|
+
emit<K extends EventKey<TEvents>>(type: K, payload?: TEvents[K]): void;
|
|
838
|
+
clear(): void;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
type PaneType = "left" | "center" | "right";
|
|
842
|
+
type ColumnModelContext = Pick<GridCore<any>, "options">;
|
|
843
|
+
declare class ColumnModel {
|
|
844
|
+
private core;
|
|
845
|
+
private columns;
|
|
846
|
+
private rootChildren;
|
|
847
|
+
private left;
|
|
848
|
+
private center;
|
|
849
|
+
private right;
|
|
850
|
+
private sortModel;
|
|
851
|
+
private defs;
|
|
852
|
+
private headerDepth;
|
|
853
|
+
private flatIndexById;
|
|
854
|
+
viewportWidth: number;
|
|
855
|
+
constructor(core: ColumnModelContext);
|
|
856
|
+
setColumnDefs(colDefs: ColDefOrGroup<any>[] | null | undefined): void;
|
|
857
|
+
private collectLeaves;
|
|
858
|
+
private regroup;
|
|
859
|
+
getFlatIndex(colId: string): number;
|
|
860
|
+
getColumns(): Column[];
|
|
861
|
+
getColumnDefs(): ColDefOrGroup<any>[];
|
|
862
|
+
getRootChildren(): (ColumnGroup<any> | Column<any>)[];
|
|
863
|
+
getHeaderDepth(): number;
|
|
864
|
+
getColumn(colId: string): Column | undefined;
|
|
865
|
+
getPaneColumns(pane: PaneType): Column[];
|
|
866
|
+
getOrderedVisible(): Column[];
|
|
867
|
+
getRowGroupColumns(): Column[];
|
|
868
|
+
getAggColumns(): Column[];
|
|
869
|
+
hasColSpan(): boolean;
|
|
870
|
+
getGroupLabelColumn(): Column | undefined;
|
|
871
|
+
paneOf(column: Column): PaneType;
|
|
872
|
+
computeLayout(viewportWidth: number): void;
|
|
873
|
+
private widthInputOf;
|
|
874
|
+
setColumnWidth(column: Column, width: number): void;
|
|
875
|
+
setColumnVisibility(colId: string, visible: boolean): void;
|
|
876
|
+
moveColumn(colId: string, toIndex: number): boolean;
|
|
877
|
+
setColumnPinned(colId: string, pinned: PinnedDirection | null): void;
|
|
878
|
+
getColumnState(): ColumnState[];
|
|
879
|
+
applyColumnState(states: ColumnState[]): void;
|
|
880
|
+
private applyStateOrder;
|
|
881
|
+
resetColumnState(): void;
|
|
882
|
+
getSortModel(): SortModel;
|
|
883
|
+
applySortModel(sortModel: SortModel | null): void;
|
|
884
|
+
cycleSort(column: Column, additive: boolean): void;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
type RowModelContext = Pick<GridCore<any>, "bodyRenderer" | "columnModel" | "emit" | "getApi" | "getCellValue" | "getLocaleText" | "headerRenderer" | "isDestroyed" | "nextId" | "options" | "relayout" | "reportError" | "selectionService" | "skeleton" | "undoService">;
|
|
888
|
+
declare class RowModel<TData = any> {
|
|
889
|
+
private core;
|
|
890
|
+
private all;
|
|
891
|
+
private roots;
|
|
892
|
+
private childIds;
|
|
893
|
+
private displayed;
|
|
894
|
+
private nodesById;
|
|
895
|
+
private filterModel;
|
|
896
|
+
private quickFilter;
|
|
897
|
+
private expandedIds;
|
|
898
|
+
private groupExpandedIds;
|
|
899
|
+
private knownGroupIds;
|
|
900
|
+
private spanInfo;
|
|
901
|
+
private mastersBuf;
|
|
902
|
+
private infiniteLastRow;
|
|
903
|
+
private infiniteRequested;
|
|
904
|
+
private infiniteLoading;
|
|
905
|
+
private infiniteSeq;
|
|
906
|
+
private infiniteAbort;
|
|
907
|
+
private infinitePendingResolve;
|
|
908
|
+
private treeDepth;
|
|
909
|
+
private rowSequence;
|
|
910
|
+
constructor(core: RowModelContext);
|
|
911
|
+
resolveRowId(data: TData, index: number, fallback: string): string;
|
|
912
|
+
get isTree(): boolean;
|
|
913
|
+
get isInfinite(): boolean;
|
|
914
|
+
getDisplayTotalCount(): number;
|
|
915
|
+
isLoadingInfinite(): boolean;
|
|
916
|
+
startInfinite(): Promise<void>;
|
|
917
|
+
reloadInfinite(): Promise<void>;
|
|
918
|
+
private setInfiniteLoading;
|
|
919
|
+
private loadBlock;
|
|
920
|
+
private cancelInfiniteRequest;
|
|
921
|
+
private appendInfiniteRows;
|
|
922
|
+
checkInfiniteScroll(lastVisibleIndex: number): void;
|
|
923
|
+
onServerParamsChanged(): Promise<void>;
|
|
924
|
+
onDatasourceChanged(): Promise<void>;
|
|
925
|
+
destroy(): void;
|
|
926
|
+
setRowData(rows: TData[] | null | undefined): void;
|
|
927
|
+
getChildrenIds(id: string): string[];
|
|
928
|
+
getChildrenCount(id: string): number;
|
|
929
|
+
hasChildren(id: string): boolean;
|
|
930
|
+
applyTransaction(transaction: RowTransaction<TData>): void;
|
|
931
|
+
private buildChildNodes;
|
|
932
|
+
private reindexAll;
|
|
933
|
+
setFilterModel(filterModel: FilterModel | null): boolean;
|
|
934
|
+
getFilterModel(): FilterModel;
|
|
935
|
+
setQuickFilter(text: string | null | undefined): boolean;
|
|
936
|
+
getQuickFilter(): string | null;
|
|
937
|
+
isFilterPresent(): boolean;
|
|
938
|
+
refreshPipeline(): void;
|
|
939
|
+
private pipelineRows;
|
|
940
|
+
private page;
|
|
941
|
+
private pageSize;
|
|
942
|
+
get paginationActive(): boolean;
|
|
943
|
+
private applyPagination;
|
|
944
|
+
private effectivePageSize;
|
|
945
|
+
getCurrentPage(): number;
|
|
946
|
+
getTotalRowCount(): number;
|
|
947
|
+
getPageCount(): number;
|
|
948
|
+
getPipelineRows(): RowNode<TData>[];
|
|
949
|
+
setPage(page: number, silent?: boolean): void;
|
|
950
|
+
setPageSize(size: number): void;
|
|
951
|
+
setPaginationEnabled(enabled: boolean): void;
|
|
952
|
+
onPaginationOptionsChanged(): void;
|
|
953
|
+
private emitPaginationChanged;
|
|
954
|
+
private buildTreeDisplay;
|
|
955
|
+
private computeSpans;
|
|
956
|
+
getSpanInfo(colId: string): Int32Array | undefined;
|
|
957
|
+
getRowSeq(node: RowNode<TData>): number;
|
|
958
|
+
getTreeDepth(node: RowNode<TData>): number;
|
|
959
|
+
private buildGrouped;
|
|
960
|
+
isRowExpandable(node: RowNode<TData>): boolean;
|
|
961
|
+
isRowExpanded(id: string): boolean;
|
|
962
|
+
expandRow(id: string): boolean;
|
|
963
|
+
collapseRow(id: string): boolean;
|
|
964
|
+
toggleDetail(id: string): boolean;
|
|
965
|
+
private setDetailExpanded;
|
|
966
|
+
expandAllDetails(): void;
|
|
967
|
+
collapseAllDetails(): void;
|
|
968
|
+
toggleGroup(groupId: string): boolean;
|
|
969
|
+
isGroupExpanded(groupId: string): boolean;
|
|
970
|
+
getGroupNode(groupId: string): RowNode<TData> | undefined;
|
|
971
|
+
expandAllGroups(): void;
|
|
972
|
+
collapseAllGroups(): void;
|
|
973
|
+
private setGroupExpanded;
|
|
974
|
+
reorderRowsByDisplayed(fromIndex: number, toIndex: number): boolean;
|
|
975
|
+
getAllNodes(): RowNode<TData>[];
|
|
976
|
+
getRootNodes(): RowNode<TData>[];
|
|
977
|
+
getDisplayedRows(): RowNode<TData>[];
|
|
978
|
+
getDisplayedRowCount(): number;
|
|
979
|
+
getDisplayedRow(index: number): RowNode<TData> | undefined;
|
|
980
|
+
getNodeById(id: string): RowNode<TData> | undefined;
|
|
981
|
+
forEachNode(callback: (node: RowNode<TData>, index: number) => void): void;
|
|
982
|
+
forEachNodeAfterFilterAndSort(callback: (node: RowNode<TData>, index: number) => void): void;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
type SelectionContext = Pick<GridCore<any>, "bodyRenderer" | "columnModel" | "emit" | "getApi" | "getCellValue" | "headerRenderer" | "options" | "reportError" | "rowModel">;
|
|
986
|
+
declare class SelectionService {
|
|
987
|
+
private core;
|
|
988
|
+
private selectedIds;
|
|
989
|
+
private anchorId;
|
|
990
|
+
private indeterminateIds;
|
|
991
|
+
constructor(core: SelectionContext);
|
|
992
|
+
isSelected(id: string): boolean;
|
|
993
|
+
isIndeterminate(id: string): boolean;
|
|
994
|
+
isSelectable(node: RowNode<any>): boolean;
|
|
995
|
+
private findSelectableColumn;
|
|
996
|
+
getSelectedNodes(): RowNode<any>[];
|
|
997
|
+
getSelectedRows(): any[];
|
|
998
|
+
getSelectedIds(): string[];
|
|
999
|
+
onRowsRebuilt(preserveIds: boolean): void;
|
|
1000
|
+
getGroupSelectionState(groupNode: RowNode<any>): {
|
|
1001
|
+
all: boolean;
|
|
1002
|
+
some: boolean;
|
|
1003
|
+
};
|
|
1004
|
+
setGroupSelected(groupNode: RowNode<any>, selected: boolean): void;
|
|
1005
|
+
setNodeSelected(node: RowNode<any>, selected: boolean, clearOthers?: boolean): void;
|
|
1006
|
+
selectNodeById(nodeId: string, selected?: boolean, clearOthers?: boolean): void;
|
|
1007
|
+
onRowClick(node: RowNode<any>, event: MouseEvent, fromCheckbox: boolean): void;
|
|
1008
|
+
selectAll(filteredOnly?: boolean): void;
|
|
1009
|
+
deselectAll(): void;
|
|
1010
|
+
isSelectAllActive(): boolean;
|
|
1011
|
+
isSelectAllIndeterminate(): boolean;
|
|
1012
|
+
applySelectionPublic(changes: {
|
|
1013
|
+
node: RowNode<any>;
|
|
1014
|
+
selected: boolean;
|
|
1015
|
+
clearOthers?: boolean;
|
|
1016
|
+
}[], clearOthers?: boolean): void;
|
|
1017
|
+
private applySelection;
|
|
1018
|
+
private subtreeIds;
|
|
1019
|
+
private recomputeTriState;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
type ResizeContext = Pick<GridCore<any>, "columnModel" | "emit" | "persistColumnState" | "relayoutColumns" | "skeleton">;
|
|
1023
|
+
declare class ResizeService {
|
|
1024
|
+
private core;
|
|
1025
|
+
private active;
|
|
1026
|
+
private rafId;
|
|
1027
|
+
private pendingWidth;
|
|
1028
|
+
constructor(core: ResizeContext);
|
|
1029
|
+
startResize(e: PointerEvent, column: Column): void;
|
|
1030
|
+
private onMove;
|
|
1031
|
+
private onUp;
|
|
1032
|
+
destroy(): void;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
type ColumnDragContext = Pick<GridCore<any>, "bodyRenderer" | "columnModel" | "moveColumn" | "skeleton">;
|
|
1036
|
+
declare class ColumnDragService {
|
|
1037
|
+
private core;
|
|
1038
|
+
private pending;
|
|
1039
|
+
private dragging;
|
|
1040
|
+
private suppressClick;
|
|
1041
|
+
constructor(core: ColumnDragContext);
|
|
1042
|
+
onPointerDown(e: PointerEvent, column: Column): void;
|
|
1043
|
+
didDrag(): boolean;
|
|
1044
|
+
private onMove;
|
|
1045
|
+
private startDrag;
|
|
1046
|
+
private findHeaderCell;
|
|
1047
|
+
private updateIndicator;
|
|
1048
|
+
private onUp;
|
|
1049
|
+
private cleanup;
|
|
1050
|
+
destroy(): void;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
type KeyboardContext = Pick<GridCore<any>, "bodyRenderer" | "buildRangeTsv" | "clearRangeValues" | "columnModel" | "editingService" | "isDestroyed" | "options" | "pasteText" | "rowModel" | "selectionService" | "skeleton" | "undoService">;
|
|
1054
|
+
declare class KeyboardService {
|
|
1055
|
+
private core;
|
|
1056
|
+
constructor(core: KeyboardContext);
|
|
1057
|
+
init(): void;
|
|
1058
|
+
destroy(): void;
|
|
1059
|
+
nextEditable(rowIndex: number, colId: string, dir: 1 | -1): {
|
|
1060
|
+
rowIndex: number;
|
|
1061
|
+
column: Column;
|
|
1062
|
+
} | null;
|
|
1063
|
+
private skipDetailRows;
|
|
1064
|
+
private onCopy;
|
|
1065
|
+
private onCut;
|
|
1066
|
+
private onPaste;
|
|
1067
|
+
private onKeyDown;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
type EditingContext = Pick<GridCore<any>, "bodyRenderer" | "emit" | "getApi" | "getCellValue" | "keyboardService" | "reportError" | "resolveCellEditor" | "rowModel" | "setCellValue">;
|
|
1071
|
+
declare class EditingService {
|
|
1072
|
+
private core;
|
|
1073
|
+
private editing;
|
|
1074
|
+
constructor(core: EditingContext);
|
|
1075
|
+
isEditing(rowIndex?: number, colId?: string): boolean;
|
|
1076
|
+
isEditable(node: RowNode<any>, column: Column): boolean;
|
|
1077
|
+
start(rowIndex: number, column: Column, keyPress?: string | null): boolean;
|
|
1078
|
+
stop(cancel?: boolean): void;
|
|
1079
|
+
private validateValue;
|
|
1080
|
+
private showError;
|
|
1081
|
+
private applyValue;
|
|
1082
|
+
private onEditorKeyDown;
|
|
1083
|
+
private onEditorBlur;
|
|
1084
|
+
destroy(): void;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
type FilterPopupContext = Pick<GridCore<any>, "applyColumnFilter" | "getCellValue" | "getLocaleText" | "rowModel">;
|
|
1088
|
+
declare class FilterPopupService {
|
|
1089
|
+
private core;
|
|
1090
|
+
private panel;
|
|
1091
|
+
private openColId;
|
|
1092
|
+
constructor(core: FilterPopupContext);
|
|
1093
|
+
toggle(column: Column, anchor: HTMLElement): void;
|
|
1094
|
+
private docMouseDown;
|
|
1095
|
+
private docKeyDown;
|
|
1096
|
+
private open;
|
|
1097
|
+
close(): void;
|
|
1098
|
+
destroy(): void;
|
|
1099
|
+
private buildConditionBody;
|
|
1100
|
+
private buildSetBody;
|
|
1101
|
+
private readFilter;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
type ColumnMenuContext = Pick<GridCore<any>, "columnModel" | "getApi" | "getLocaleText" | "options" | "skeleton">;
|
|
1105
|
+
declare class ColumnMenuService {
|
|
1106
|
+
private core;
|
|
1107
|
+
private panel;
|
|
1108
|
+
private openColId;
|
|
1109
|
+
private standaloneAnchor;
|
|
1110
|
+
constructor(core: ColumnMenuContext);
|
|
1111
|
+
toggle(column: Column, anchor: HTMLElement): void;
|
|
1112
|
+
openStandalone(anchor?: HTMLElement): void;
|
|
1113
|
+
close(): void;
|
|
1114
|
+
destroy(): void;
|
|
1115
|
+
private docMouseDown;
|
|
1116
|
+
private docKeyDown;
|
|
1117
|
+
private open;
|
|
1118
|
+
private rebuildListStates;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
type ContextMenuContext = Pick<GridCore<any>, "bodyRenderer" | "clearRangeValues" | "columnModel" | "copyActiveRange" | "getApi" | "getCellValue" | "getLocaleText" | "options" | "pasteFromSystemClipboard" | "reportError" | "rowModel">;
|
|
1122
|
+
declare class ContextMenuService {
|
|
1123
|
+
private core;
|
|
1124
|
+
private panel;
|
|
1125
|
+
constructor(core: ContextMenuContext);
|
|
1126
|
+
open(x: number, y: number, anchor?: {
|
|
1127
|
+
rowIndex: number;
|
|
1128
|
+
colId: string;
|
|
1129
|
+
}): void;
|
|
1130
|
+
private attach;
|
|
1131
|
+
close(): void;
|
|
1132
|
+
destroy(): void;
|
|
1133
|
+
private docMouseDown;
|
|
1134
|
+
private docKeyDown;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
type TooltipContext = Pick<GridCore<any>, "columnModel" | "getApi" | "getCellValue" | "isDestroyed" | "options" | "reportError" | "rowModel" | "skeleton">;
|
|
1138
|
+
declare class TooltipService {
|
|
1139
|
+
private core;
|
|
1140
|
+
private panel;
|
|
1141
|
+
private showTimer;
|
|
1142
|
+
private hideTimer;
|
|
1143
|
+
private currentCell;
|
|
1144
|
+
constructor(core: TooltipContext);
|
|
1145
|
+
init(): void;
|
|
1146
|
+
destroy(): void;
|
|
1147
|
+
hide(): void;
|
|
1148
|
+
private clearTimers;
|
|
1149
|
+
private removePanel;
|
|
1150
|
+
private onMouseOver;
|
|
1151
|
+
private onBodyLeave;
|
|
1152
|
+
private showPanel;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
type WatermarkContext = Pick<GridCore<any>, "isDestroyed" | "options" | "skeleton">;
|
|
1156
|
+
declare class WatermarkService {
|
|
1157
|
+
private core;
|
|
1158
|
+
private overlay;
|
|
1159
|
+
constructor(core: WatermarkContext);
|
|
1160
|
+
init(): void;
|
|
1161
|
+
apply(): void;
|
|
1162
|
+
private buildTile;
|
|
1163
|
+
private isDark;
|
|
1164
|
+
refresh(): void;
|
|
1165
|
+
destroy(): void;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
type UndoContext = Pick<GridCore<any>, "bodyRenderer" | "columnModel" | "emit" | "options" | "rowModel" | "statusBarService" | "summaryRenderer" | "writeValue">;
|
|
1169
|
+
interface UndoEntry {
|
|
1170
|
+
nodeId: string;
|
|
1171
|
+
columnId: string;
|
|
1172
|
+
oldValue: any;
|
|
1173
|
+
newValue: any;
|
|
1174
|
+
}
|
|
1175
|
+
declare class UndoRedoService {
|
|
1176
|
+
private core;
|
|
1177
|
+
private stack;
|
|
1178
|
+
private pointer;
|
|
1179
|
+
private pending;
|
|
1180
|
+
constructor(core: UndoContext);
|
|
1181
|
+
beginBatch(): void;
|
|
1182
|
+
endBatch(): void;
|
|
1183
|
+
cancelBatch(): void;
|
|
1184
|
+
record(entry: UndoEntry): void;
|
|
1185
|
+
private push;
|
|
1186
|
+
trimToSize(): void;
|
|
1187
|
+
canUndo(): boolean;
|
|
1188
|
+
canRedo(): boolean;
|
|
1189
|
+
undo(): boolean;
|
|
1190
|
+
redo(): boolean;
|
|
1191
|
+
private apply;
|
|
1192
|
+
clear(): void;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
type SkeletonContext = Pick<GridCore<any>, "options" | "relayout" | "reportError">;
|
|
1196
|
+
declare class GridSkeleton {
|
|
1197
|
+
private core;
|
|
1198
|
+
root: HTMLElement;
|
|
1199
|
+
headerEl: HTMLElement;
|
|
1200
|
+
bodyEl: HTMLElement;
|
|
1201
|
+
pinnedTopEl: HTMLElement;
|
|
1202
|
+
pinnedBottomEl: HTMLElement;
|
|
1203
|
+
headerRows: Record<PaneType, HTMLElement[]>;
|
|
1204
|
+
headerRowContainers: Record<PaneType, HTMLElement>;
|
|
1205
|
+
bodyViewports: Record<PaneType, HTMLElement>;
|
|
1206
|
+
rowContainers: Record<PaneType, HTMLElement>;
|
|
1207
|
+
private headerPanes;
|
|
1208
|
+
private bodyPanes;
|
|
1209
|
+
private overlayWrapper;
|
|
1210
|
+
private overlayContent;
|
|
1211
|
+
private infiniteLoadingEl;
|
|
1212
|
+
private infiniteLoadingText;
|
|
1213
|
+
private currentOverlay;
|
|
1214
|
+
private currentOverlayContent;
|
|
1215
|
+
private currentOverlayAllowsHtml;
|
|
1216
|
+
private customClassTokens;
|
|
1217
|
+
private resizeObserver;
|
|
1218
|
+
private headerDepth;
|
|
1219
|
+
constructor(core: SkeletonContext);
|
|
1220
|
+
init(container: HTMLElement, options: ResolvedGridOptions): void;
|
|
1221
|
+
setHeaderRowCount(depth: number): void;
|
|
1222
|
+
private applyHeaderHeight;
|
|
1223
|
+
setPaneWidths(left: number, right: number): void;
|
|
1224
|
+
private applyPaneWidth;
|
|
1225
|
+
measureViewportWidth(): number;
|
|
1226
|
+
updateHeights(rowHeight: number, headerHeight: number): void;
|
|
1227
|
+
applySize(size: GridSize): void;
|
|
1228
|
+
private themeUnsub;
|
|
1229
|
+
applyTheme(theme: ThemeMode): void;
|
|
1230
|
+
private systemPrefersDark;
|
|
1231
|
+
setStriped(on: boolean): void;
|
|
1232
|
+
setCellBorders(on: boolean): void;
|
|
1233
|
+
setCustomClass(className: string | null | undefined): void;
|
|
1234
|
+
showOverlay(type: "loading" | "noRows", content: OverlayTemplate, allowUnsafeHtml?: boolean): void;
|
|
1235
|
+
hideOverlay(): void;
|
|
1236
|
+
setInfiniteLoading(active: boolean, text: string): void;
|
|
1237
|
+
destroy(): void;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
type HeaderContext = Pick<GridCore<any>, "columnDragService" | "columnMenu" | "columnModel" | "cycleSort" | "emit" | "filterPopup" | "getApi" | "isDestroyed" | "moveColumn" | "options" | "relayoutColumns" | "reportError" | "resizeService" | "rowModel" | "selectionService" | "skeleton">;
|
|
1241
|
+
declare class HeaderRenderer {
|
|
1242
|
+
private core;
|
|
1243
|
+
private leafCells;
|
|
1244
|
+
private groupCells;
|
|
1245
|
+
private paneTrees;
|
|
1246
|
+
constructor(core: HeaderContext);
|
|
1247
|
+
build(): void;
|
|
1248
|
+
private createLeafCell;
|
|
1249
|
+
private createGroupCell;
|
|
1250
|
+
applyLayout(): void;
|
|
1251
|
+
private visiblePaneLeaves;
|
|
1252
|
+
private onHeaderKeyDown;
|
|
1253
|
+
refreshSortIndicators(): void;
|
|
1254
|
+
refreshFilterIcons(): void;
|
|
1255
|
+
refreshSelectAllCheckbox(): void;
|
|
1256
|
+
destroy(): void;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
interface NormalizedRange {
|
|
1260
|
+
r1: number;
|
|
1261
|
+
c1: number;
|
|
1262
|
+
r2: number;
|
|
1263
|
+
c2: number;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
type BodyContext = Pick<GridCore<any>, "buildDefaultEmptyState" | "columnModel" | "contextMenuService" | "editingService" | "emit" | "getApi" | "getCellValue" | "gridId" | "isDestroyed" | "options" | "pinnedRowsRenderer" | "reportError" | "resolveCellRenderer" | "rowModel" | "selectionService" | "setCellValue" | "skeleton" | "summaryRenderer" | "toggleDetail" | "tooltipService" | "undoService">;
|
|
1267
|
+
interface FocusedCell {
|
|
1268
|
+
rowIndex: number;
|
|
1269
|
+
colId: string;
|
|
1270
|
+
}
|
|
1271
|
+
declare class BodyRenderer {
|
|
1272
|
+
private core;
|
|
1273
|
+
private pool;
|
|
1274
|
+
private poolSize;
|
|
1275
|
+
private first;
|
|
1276
|
+
private lastExcl;
|
|
1277
|
+
private rafId;
|
|
1278
|
+
private hoverIndex;
|
|
1279
|
+
private positions;
|
|
1280
|
+
private rangeSelection;
|
|
1281
|
+
private rangeDragging;
|
|
1282
|
+
private colFirst;
|
|
1283
|
+
private colLastExcl;
|
|
1284
|
+
focusedCell: FocusedCell | null;
|
|
1285
|
+
private rowDragController;
|
|
1286
|
+
constructor(core: BodyContext);
|
|
1287
|
+
init(): void;
|
|
1288
|
+
destroy(): void;
|
|
1289
|
+
paneForColumn(column: Column): PaneType;
|
|
1290
|
+
private onScroll;
|
|
1291
|
+
syncScroll(): void;
|
|
1292
|
+
private paneWidths;
|
|
1293
|
+
private positionsBuf;
|
|
1294
|
+
private lastMinRowHeight;
|
|
1295
|
+
private rowHeightCache;
|
|
1296
|
+
private pendingFlash;
|
|
1297
|
+
private measureCanvas;
|
|
1298
|
+
applyContainerSizes(): void;
|
|
1299
|
+
invalidateRowHeight(node: RowNode<any>): void;
|
|
1300
|
+
invalidateAllRowHeights(): void;
|
|
1301
|
+
private collectAutoHeightColumns;
|
|
1302
|
+
private get hasAnyAutoHeight();
|
|
1303
|
+
private measureAutoHeight;
|
|
1304
|
+
queueFlash(rowIndexes: number[], colIds: string[]): void;
|
|
1305
|
+
flushFlash(): void;
|
|
1306
|
+
relayout(): void;
|
|
1307
|
+
private growPool;
|
|
1308
|
+
rebuildPool(): void;
|
|
1309
|
+
applyCellLayout(): void;
|
|
1310
|
+
private computeColWindow;
|
|
1311
|
+
updateRange(force?: boolean): void;
|
|
1312
|
+
private hideSlot;
|
|
1313
|
+
private assignSlot;
|
|
1314
|
+
private renderPaneCells;
|
|
1315
|
+
private resolveColSpan;
|
|
1316
|
+
private applySpanWidth;
|
|
1317
|
+
private renderDetailContent;
|
|
1318
|
+
private cleanupDetail;
|
|
1319
|
+
private renderCell;
|
|
1320
|
+
private treeColumnCache;
|
|
1321
|
+
private getTreeColumn;
|
|
1322
|
+
private renderTreeCell;
|
|
1323
|
+
private getNodeDepth;
|
|
1324
|
+
private resetSpanStyle;
|
|
1325
|
+
private applyCellSpanStyle;
|
|
1326
|
+
private renderGroupCell;
|
|
1327
|
+
refreshRows(indexes: number[]): void;
|
|
1328
|
+
refreshAllCells(): void;
|
|
1329
|
+
onDataChanged(): void;
|
|
1330
|
+
refreshOverlays(): void;
|
|
1331
|
+
getCellElement(rowIndex: number, colId: string): HTMLElement | null;
|
|
1332
|
+
private invalidateRangeCache;
|
|
1333
|
+
normalizedRange(): NormalizedRange | null;
|
|
1334
|
+
getNormalizedRangeOrFocus(): NormalizedRange | null;
|
|
1335
|
+
getRangeSelection(): {
|
|
1336
|
+
row1: number;
|
|
1337
|
+
row2: number;
|
|
1338
|
+
colId1: string;
|
|
1339
|
+
colId2: string;
|
|
1340
|
+
} | null;
|
|
1341
|
+
getPasteStart(): {
|
|
1342
|
+
row: number;
|
|
1343
|
+
colIdx: number;
|
|
1344
|
+
} | null;
|
|
1345
|
+
clearRangeSelection(): void;
|
|
1346
|
+
private refreshRowRange;
|
|
1347
|
+
startRange(row: number, colIdx: number, extend: boolean): void;
|
|
1348
|
+
moveRangeEnd(row: number, colIdx: number): void;
|
|
1349
|
+
private applyRangeClass;
|
|
1350
|
+
private fillHandleEl;
|
|
1351
|
+
private fillDrag;
|
|
1352
|
+
private fillFromPointer;
|
|
1353
|
+
private ensureFillHandle;
|
|
1354
|
+
private updateFillHandle;
|
|
1355
|
+
private onFillHandleDown;
|
|
1356
|
+
private fillTargetRow;
|
|
1357
|
+
private fillTargetCol;
|
|
1358
|
+
private fillDragIndicator;
|
|
1359
|
+
private cancelFillDrag;
|
|
1360
|
+
private onFillMove;
|
|
1361
|
+
private fillHorizontal;
|
|
1362
|
+
private onFillUp;
|
|
1363
|
+
private fillValues;
|
|
1364
|
+
private fillValuesInner;
|
|
1365
|
+
setFocusedCell(rowIndex: number | null, colId: string | null): void;
|
|
1366
|
+
private applyFocusClass;
|
|
1367
|
+
private clearFocusClass;
|
|
1368
|
+
private ensureFocusedCellVisible;
|
|
1369
|
+
scrollToIndex(rowIndex: number, position?: "top" | "bottom" | "middle" | "nearest"): void;
|
|
1370
|
+
private setHoverIndex;
|
|
1371
|
+
private toggleHover;
|
|
1372
|
+
focusGridRoot(): void;
|
|
1373
|
+
private resolveEventTarget;
|
|
1374
|
+
private onBodyClick;
|
|
1375
|
+
private firstCheckboxColId;
|
|
1376
|
+
private onBodyDblClick;
|
|
1377
|
+
private onContextMenu;
|
|
1378
|
+
private onMouseDown;
|
|
1379
|
+
private onWindowMouseUp;
|
|
1380
|
+
private onMouseOver;
|
|
1381
|
+
private onMouseLeave;
|
|
1382
|
+
private onDragHandlePointerDown;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
type SummaryContext = Pick<GridCore<any>, "columnModel" | "getCellValue" | "isDestroyed" | "options" | "reportError" | "rowModel" | "skeleton">;
|
|
1386
|
+
declare class SummaryRenderer {
|
|
1387
|
+
private core;
|
|
1388
|
+
private footerEl;
|
|
1389
|
+
private rows;
|
|
1390
|
+
private cellsByPane;
|
|
1391
|
+
constructor(core: SummaryContext);
|
|
1392
|
+
init(): void;
|
|
1393
|
+
setVisible(visible: boolean): void;
|
|
1394
|
+
refresh(): void;
|
|
1395
|
+
destroy(): void;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
type PaginationContext = Pick<GridCore<any>, "eventBus" | "isDestroyed" | "options" | "rowModel" | "skeleton">;
|
|
1399
|
+
declare class PaginationBar {
|
|
1400
|
+
private core;
|
|
1401
|
+
private barEl;
|
|
1402
|
+
private totalEl;
|
|
1403
|
+
private pageEl;
|
|
1404
|
+
private sizeSelect;
|
|
1405
|
+
private firstBtn;
|
|
1406
|
+
private prevBtn;
|
|
1407
|
+
private nextBtn;
|
|
1408
|
+
private lastBtn;
|
|
1409
|
+
private offs;
|
|
1410
|
+
constructor(core: PaginationContext);
|
|
1411
|
+
init(): void;
|
|
1412
|
+
private buildSizeOptions;
|
|
1413
|
+
private t;
|
|
1414
|
+
rebuild(): void;
|
|
1415
|
+
refresh(): void;
|
|
1416
|
+
destroy(): void;
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
type PinnedRowsContext = Pick<GridCore<any>, "columnModel" | "getApi" | "getCellValue" | "isDestroyed" | "options" | "relayout" | "reportError" | "resolveCellRenderer" | "skeleton">;
|
|
1420
|
+
declare class PinnedRowsRenderer {
|
|
1421
|
+
private core;
|
|
1422
|
+
private top;
|
|
1423
|
+
private bottom;
|
|
1424
|
+
constructor(core: PinnedRowsContext);
|
|
1425
|
+
init(): void;
|
|
1426
|
+
private createSide;
|
|
1427
|
+
setData(top: any[] | null, bottom: any[] | null): void;
|
|
1428
|
+
setTopData(rows: any[] | null): void;
|
|
1429
|
+
setBottomData(rows: any[] | null): void;
|
|
1430
|
+
getTopData(): any[];
|
|
1431
|
+
getBottomData(): any[];
|
|
1432
|
+
rebuild(): void;
|
|
1433
|
+
private rebuildSide;
|
|
1434
|
+
applyLayout(): void;
|
|
1435
|
+
onScrollLeft(scrollLeft: number): void;
|
|
1436
|
+
refresh(): void;
|
|
1437
|
+
destroy(): void;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
type StatusBarContext = Pick<GridCore<any>, "bodyRenderer" | "columnModel" | "eventBus" | "getCellValue" | "isDestroyed" | "options" | "rowModel" | "selectionService" | "skeleton">;
|
|
1441
|
+
declare class StatusBarService {
|
|
1442
|
+
private core;
|
|
1443
|
+
private barEl;
|
|
1444
|
+
private items;
|
|
1445
|
+
private offs;
|
|
1446
|
+
constructor(core: StatusBarContext);
|
|
1447
|
+
init(): void;
|
|
1448
|
+
rebuild(): void;
|
|
1449
|
+
refresh(): void;
|
|
1450
|
+
destroy(): void;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
declare class GridCore<TData = any> {
|
|
1454
|
+
readonly gridId: number;
|
|
1455
|
+
readonly options: ResolvedGridOptions<TData>;
|
|
1456
|
+
readonly eventBus: EventBus<GridEventMap<TData>>;
|
|
1457
|
+
readonly skeleton: GridSkeleton;
|
|
1458
|
+
readonly columnModel: ColumnModel;
|
|
1459
|
+
readonly rowModel: RowModel<TData>;
|
|
1460
|
+
readonly selectionService: SelectionService;
|
|
1461
|
+
readonly headerRenderer: HeaderRenderer;
|
|
1462
|
+
readonly bodyRenderer: BodyRenderer;
|
|
1463
|
+
readonly resizeService: ResizeService;
|
|
1464
|
+
readonly columnDragService: ColumnDragService;
|
|
1465
|
+
readonly keyboardService: KeyboardService;
|
|
1466
|
+
readonly editingService: EditingService;
|
|
1467
|
+
readonly undoService: UndoRedoService;
|
|
1468
|
+
readonly filterPopup: FilterPopupService;
|
|
1469
|
+
readonly columnMenu: ColumnMenuService;
|
|
1470
|
+
readonly contextMenuService: ContextMenuService;
|
|
1471
|
+
readonly tooltipService: TooltipService;
|
|
1472
|
+
readonly watermarkService: WatermarkService;
|
|
1473
|
+
readonly paginationBar: PaginationBar;
|
|
1474
|
+
readonly pinnedRowsRenderer: PinnedRowsRenderer;
|
|
1475
|
+
readonly summaryRenderer: SummaryRenderer;
|
|
1476
|
+
readonly statusBarService: StatusBarService;
|
|
1477
|
+
readonly api: GridApi<TData>;
|
|
1478
|
+
private destroyed;
|
|
1479
|
+
private autoIdCounter;
|
|
1480
|
+
private readyRafId;
|
|
1481
|
+
private lastColumnLayoutSignature;
|
|
1482
|
+
private activeFeatures;
|
|
1483
|
+
constructor(container: HTMLElement, options: GridOptions<TData>);
|
|
1484
|
+
getApi(): GridApi<TData>;
|
|
1485
|
+
resolveCellRenderer(name: string): CellRendererFn | undefined;
|
|
1486
|
+
resolveCellEditor(name: string): CellEditorFactory | undefined;
|
|
1487
|
+
setFeatures(features: readonly GridFeature<TData>[] | null | undefined): void;
|
|
1488
|
+
private destroyFeatures;
|
|
1489
|
+
isDestroyed(): boolean;
|
|
1490
|
+
nextId(): number;
|
|
1491
|
+
getCellValue(node: RowNode<any>, column: Column): any;
|
|
1492
|
+
getLocaleText(key: RgLocaleKey): string;
|
|
1493
|
+
writeValue(node: RowNode<any>, column: Column, newValue: any, oldValue?: any): boolean;
|
|
1494
|
+
setCellValue(node: RowNode<any>, column: Column, newValue: any, oldValue: any): boolean;
|
|
1495
|
+
buildRangeTsv(range: {
|
|
1496
|
+
r1: number;
|
|
1497
|
+
c1: number;
|
|
1498
|
+
r2: number;
|
|
1499
|
+
c2: number;
|
|
1500
|
+
}): string;
|
|
1501
|
+
copyActiveRange(): Promise<boolean>;
|
|
1502
|
+
clearRangeValues(range: {
|
|
1503
|
+
r1: number;
|
|
1504
|
+
c1: number;
|
|
1505
|
+
r2: number;
|
|
1506
|
+
c2: number;
|
|
1507
|
+
}): void;
|
|
1508
|
+
pasteText(text: string, startRow: number, startColIdx: number): void;
|
|
1509
|
+
pasteFromSystemClipboard(): Promise<void>;
|
|
1510
|
+
refreshSummary(): void;
|
|
1511
|
+
emit<K extends GridEventType>(type: K, extra?: Partial<GridEventMap<TData>[K]>): GridEventMap<TData>[K];
|
|
1512
|
+
reportError(error: unknown, source: string, context?: Record<string, unknown>): void;
|
|
1513
|
+
cycleSort(column: Column, additive: boolean): void;
|
|
1514
|
+
applySortModel(): void;
|
|
1515
|
+
applyColumnFilter(column: Column, filter: ColumnFilter | null): void;
|
|
1516
|
+
applyQuickFilter(): void;
|
|
1517
|
+
moveColumn(colId: string, toIndex: number): void;
|
|
1518
|
+
toggleDetail(rowId: string): boolean;
|
|
1519
|
+
private stateLoadToken;
|
|
1520
|
+
loadPersistedColumnState(): void;
|
|
1521
|
+
persistColumnState(): void;
|
|
1522
|
+
buildDefaultEmptyState(): HTMLElement;
|
|
1523
|
+
private lastValidatedDefs;
|
|
1524
|
+
private issuedWarningSignatures;
|
|
1525
|
+
checkWarnings(): void;
|
|
1526
|
+
validateDefs(defs: (ColDef<any> | ColDefGroup<any>)[] | null | undefined): void;
|
|
1527
|
+
onColumnsStructureChanged(): void;
|
|
1528
|
+
relayout(): void;
|
|
1529
|
+
relayoutColumns(invalidateRowHeights?: boolean): void;
|
|
1530
|
+
destroy(): void;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
declare function defaultComparator(valueA: any, valueB: any): number;
|
|
1534
|
+
|
|
1535
|
+
declare function isSafePath(path: string): boolean;
|
|
1536
|
+
declare function getByPath(obj: any, path: string): any;
|
|
1537
|
+
declare function setByPath(obj: any, path: string, value: any): boolean;
|
|
1538
|
+
|
|
1539
|
+
interface WidthInput {
|
|
1540
|
+
width?: number;
|
|
1541
|
+
minWidth?: number;
|
|
1542
|
+
maxWidth?: number;
|
|
1543
|
+
flex?: number;
|
|
1544
|
+
}
|
|
1545
|
+
declare function computeColumnWidths(cols: WidthInput[], availableWidth: number): number[];
|
|
1546
|
+
|
|
1547
|
+
interface GridSizePreset {
|
|
1548
|
+
rowHeight: number;
|
|
1549
|
+
headerHeight: number;
|
|
1550
|
+
fontSize: number;
|
|
1551
|
+
cellPadding: number;
|
|
1552
|
+
}
|
|
1553
|
+
declare const GRID_SIZE_PRESETS: Record<GridSize, GridSizePreset>;
|
|
1554
|
+
|
|
1555
|
+
type GridOptionValueKind = "array" | "boolean" | "boolean-object" | "function" | "number" | "object" | "string" | "unknown";
|
|
1556
|
+
type GridOptionUpdateMode = "columnDefs" | "options" | "quickFilter" | "rowData";
|
|
1557
|
+
interface GridOptionMetadata {
|
|
1558
|
+
/** Runtime value category used by framework adapters. */
|
|
1559
|
+
kind: GridOptionValueKind;
|
|
1560
|
+
/** How a changed framework prop is forwarded to GridApi. */
|
|
1561
|
+
update: GridOptionUpdateMode;
|
|
1562
|
+
}
|
|
1563
|
+
type EventOptionKey = `on${Capitalize<GridEventType>}`;
|
|
1564
|
+
type GridOptionKey = Exclude<keyof GridOptions<any>, EventOptionKey>;
|
|
1565
|
+
/**
|
|
1566
|
+
* Runtime single source of truth for every non-event GridOptions property.
|
|
1567
|
+
*
|
|
1568
|
+
* The mapped `satisfies` type intentionally makes adding a GridOptions field a
|
|
1569
|
+
* compile error until its adapter/update behavior is declared here.
|
|
1570
|
+
*/
|
|
1571
|
+
declare const GRID_OPTION_META: {
|
|
1572
|
+
readonly columnDefs: {
|
|
1573
|
+
readonly kind: "array";
|
|
1574
|
+
readonly update: "columnDefs";
|
|
1575
|
+
};
|
|
1576
|
+
readonly rowData: {
|
|
1577
|
+
readonly kind: "array";
|
|
1578
|
+
readonly update: "rowData";
|
|
1579
|
+
};
|
|
1580
|
+
readonly defaultColDef: {
|
|
1581
|
+
readonly kind: "object";
|
|
1582
|
+
readonly update: "options";
|
|
1583
|
+
};
|
|
1584
|
+
readonly getRowId: {
|
|
1585
|
+
readonly kind: "function";
|
|
1586
|
+
readonly update: "options";
|
|
1587
|
+
};
|
|
1588
|
+
readonly rowHeight: {
|
|
1589
|
+
readonly kind: "number";
|
|
1590
|
+
readonly update: "options";
|
|
1591
|
+
};
|
|
1592
|
+
readonly headerHeight: {
|
|
1593
|
+
readonly kind: "number";
|
|
1594
|
+
readonly update: "options";
|
|
1595
|
+
};
|
|
1596
|
+
readonly rowBuffer: {
|
|
1597
|
+
readonly kind: "number";
|
|
1598
|
+
readonly update: "options";
|
|
1599
|
+
};
|
|
1600
|
+
readonly rowSelection: {
|
|
1601
|
+
readonly kind: "string";
|
|
1602
|
+
readonly update: "options";
|
|
1603
|
+
};
|
|
1604
|
+
readonly multiSort: {
|
|
1605
|
+
readonly kind: "boolean";
|
|
1606
|
+
readonly update: "options";
|
|
1607
|
+
};
|
|
1608
|
+
readonly size: {
|
|
1609
|
+
readonly kind: "string";
|
|
1610
|
+
readonly update: "options";
|
|
1611
|
+
};
|
|
1612
|
+
readonly stripedRows: {
|
|
1613
|
+
readonly kind: "boolean";
|
|
1614
|
+
readonly update: "options";
|
|
1615
|
+
};
|
|
1616
|
+
readonly showCellBorders: {
|
|
1617
|
+
readonly kind: "boolean";
|
|
1618
|
+
readonly update: "options";
|
|
1619
|
+
};
|
|
1620
|
+
readonly theme: {
|
|
1621
|
+
readonly kind: "string";
|
|
1622
|
+
readonly update: "options";
|
|
1623
|
+
};
|
|
1624
|
+
readonly quickFilterText: {
|
|
1625
|
+
readonly kind: "string";
|
|
1626
|
+
readonly update: "quickFilter";
|
|
1627
|
+
};
|
|
1628
|
+
readonly masterDetail: {
|
|
1629
|
+
readonly kind: "boolean";
|
|
1630
|
+
readonly update: "options";
|
|
1631
|
+
};
|
|
1632
|
+
readonly detailRowHeight: {
|
|
1633
|
+
readonly kind: "number";
|
|
1634
|
+
readonly update: "options";
|
|
1635
|
+
};
|
|
1636
|
+
readonly detailRowRenderer: {
|
|
1637
|
+
readonly kind: "function";
|
|
1638
|
+
readonly update: "options";
|
|
1639
|
+
};
|
|
1640
|
+
readonly isRowExpandable: {
|
|
1641
|
+
readonly kind: "function";
|
|
1642
|
+
readonly update: "options";
|
|
1643
|
+
};
|
|
1644
|
+
readonly detailToggleColumn: {
|
|
1645
|
+
readonly kind: "boolean";
|
|
1646
|
+
readonly update: "options";
|
|
1647
|
+
};
|
|
1648
|
+
readonly columnMenu: {
|
|
1649
|
+
readonly kind: "boolean";
|
|
1650
|
+
readonly update: "options";
|
|
1651
|
+
};
|
|
1652
|
+
readonly columnStateKey: {
|
|
1653
|
+
readonly kind: "string";
|
|
1654
|
+
readonly update: "options";
|
|
1655
|
+
};
|
|
1656
|
+
readonly columnStateStore: {
|
|
1657
|
+
readonly kind: "object";
|
|
1658
|
+
readonly update: "options";
|
|
1659
|
+
};
|
|
1660
|
+
readonly aggFuncs: {
|
|
1661
|
+
readonly kind: "object";
|
|
1662
|
+
readonly update: "options";
|
|
1663
|
+
};
|
|
1664
|
+
readonly components: {
|
|
1665
|
+
readonly kind: "object";
|
|
1666
|
+
readonly update: "options";
|
|
1667
|
+
};
|
|
1668
|
+
readonly features: {
|
|
1669
|
+
readonly kind: "array";
|
|
1670
|
+
readonly update: "options";
|
|
1671
|
+
};
|
|
1672
|
+
readonly locale: {
|
|
1673
|
+
readonly kind: "object";
|
|
1674
|
+
readonly update: "options";
|
|
1675
|
+
};
|
|
1676
|
+
readonly singleClickEdit: {
|
|
1677
|
+
readonly kind: "boolean";
|
|
1678
|
+
readonly update: "options";
|
|
1679
|
+
};
|
|
1680
|
+
readonly manualSorting: {
|
|
1681
|
+
readonly kind: "boolean";
|
|
1682
|
+
readonly update: "options";
|
|
1683
|
+
};
|
|
1684
|
+
readonly manualFiltering: {
|
|
1685
|
+
readonly kind: "boolean";
|
|
1686
|
+
readonly update: "options";
|
|
1687
|
+
};
|
|
1688
|
+
readonly showSummary: {
|
|
1689
|
+
readonly kind: "boolean";
|
|
1690
|
+
readonly update: "options";
|
|
1691
|
+
};
|
|
1692
|
+
readonly summaryMethod: {
|
|
1693
|
+
readonly kind: "function";
|
|
1694
|
+
readonly update: "options";
|
|
1695
|
+
};
|
|
1696
|
+
readonly treeData: {
|
|
1697
|
+
readonly kind: "boolean";
|
|
1698
|
+
readonly update: "options";
|
|
1699
|
+
};
|
|
1700
|
+
readonly childrenKey: {
|
|
1701
|
+
readonly kind: "string";
|
|
1702
|
+
readonly update: "options";
|
|
1703
|
+
};
|
|
1704
|
+
readonly autoCheckedChildren: {
|
|
1705
|
+
readonly kind: "boolean";
|
|
1706
|
+
readonly update: "options";
|
|
1707
|
+
};
|
|
1708
|
+
readonly defaultExpandAll: {
|
|
1709
|
+
readonly kind: "boolean";
|
|
1710
|
+
readonly update: "options";
|
|
1711
|
+
};
|
|
1712
|
+
readonly indexOffset: {
|
|
1713
|
+
readonly kind: "number";
|
|
1714
|
+
readonly update: "options";
|
|
1715
|
+
};
|
|
1716
|
+
readonly applyRowDrag: {
|
|
1717
|
+
readonly kind: "boolean";
|
|
1718
|
+
readonly update: "options";
|
|
1719
|
+
};
|
|
1720
|
+
readonly undoStackSize: {
|
|
1721
|
+
readonly kind: "number";
|
|
1722
|
+
readonly update: "options";
|
|
1723
|
+
};
|
|
1724
|
+
readonly getRowHeight: {
|
|
1725
|
+
readonly kind: "function";
|
|
1726
|
+
readonly update: "options";
|
|
1727
|
+
};
|
|
1728
|
+
readonly pinnedTopRowData: {
|
|
1729
|
+
readonly kind: "array";
|
|
1730
|
+
readonly update: "options";
|
|
1731
|
+
};
|
|
1732
|
+
readonly pinnedBottomRowData: {
|
|
1733
|
+
readonly kind: "array";
|
|
1734
|
+
readonly update: "options";
|
|
1735
|
+
};
|
|
1736
|
+
readonly pagination: {
|
|
1737
|
+
readonly kind: "boolean-object";
|
|
1738
|
+
readonly update: "options";
|
|
1739
|
+
};
|
|
1740
|
+
readonly watermark: {
|
|
1741
|
+
readonly kind: "boolean-object";
|
|
1742
|
+
readonly update: "options";
|
|
1743
|
+
};
|
|
1744
|
+
readonly suppressWarnings: {
|
|
1745
|
+
readonly kind: "boolean";
|
|
1746
|
+
readonly update: "options";
|
|
1747
|
+
};
|
|
1748
|
+
readonly enableRangeSelection: {
|
|
1749
|
+
readonly kind: "boolean";
|
|
1750
|
+
readonly update: "options";
|
|
1751
|
+
};
|
|
1752
|
+
readonly suppressClipboard: {
|
|
1753
|
+
readonly kind: "boolean";
|
|
1754
|
+
readonly update: "options";
|
|
1755
|
+
};
|
|
1756
|
+
readonly contextMenu: {
|
|
1757
|
+
readonly kind: "boolean";
|
|
1758
|
+
readonly update: "options";
|
|
1759
|
+
};
|
|
1760
|
+
readonly getContextMenuItems: {
|
|
1761
|
+
readonly kind: "function";
|
|
1762
|
+
readonly update: "options";
|
|
1763
|
+
};
|
|
1764
|
+
readonly tooltipComponent: {
|
|
1765
|
+
readonly kind: "function";
|
|
1766
|
+
readonly update: "options";
|
|
1767
|
+
};
|
|
1768
|
+
readonly tooltipShowDelay: {
|
|
1769
|
+
readonly kind: "number";
|
|
1770
|
+
readonly update: "options";
|
|
1771
|
+
};
|
|
1772
|
+
readonly flashCells: {
|
|
1773
|
+
readonly kind: "boolean";
|
|
1774
|
+
readonly update: "options";
|
|
1775
|
+
};
|
|
1776
|
+
readonly fillHandle: {
|
|
1777
|
+
readonly kind: "boolean";
|
|
1778
|
+
readonly update: "options";
|
|
1779
|
+
};
|
|
1780
|
+
readonly statusBar: {
|
|
1781
|
+
readonly kind: "boolean-object";
|
|
1782
|
+
readonly update: "options";
|
|
1783
|
+
};
|
|
1784
|
+
readonly datasource: {
|
|
1785
|
+
readonly kind: "object";
|
|
1786
|
+
readonly update: "options";
|
|
1787
|
+
};
|
|
1788
|
+
readonly blockSize: {
|
|
1789
|
+
readonly kind: "number";
|
|
1790
|
+
readonly update: "options";
|
|
1791
|
+
};
|
|
1792
|
+
readonly infiniteBufferRows: {
|
|
1793
|
+
readonly kind: "number";
|
|
1794
|
+
readonly update: "options";
|
|
1795
|
+
};
|
|
1796
|
+
readonly suppressCellFocus: {
|
|
1797
|
+
readonly kind: "boolean";
|
|
1798
|
+
readonly update: "options";
|
|
1799
|
+
};
|
|
1800
|
+
readonly suppressRowHoverHighlight: {
|
|
1801
|
+
readonly kind: "boolean";
|
|
1802
|
+
readonly update: "options";
|
|
1803
|
+
};
|
|
1804
|
+
readonly suppressNoRowsOverlay: {
|
|
1805
|
+
readonly kind: "boolean";
|
|
1806
|
+
readonly update: "options";
|
|
1807
|
+
};
|
|
1808
|
+
readonly suppressHeaderFocus: {
|
|
1809
|
+
readonly kind: "boolean";
|
|
1810
|
+
readonly update: "options";
|
|
1811
|
+
};
|
|
1812
|
+
readonly loading: {
|
|
1813
|
+
readonly kind: "boolean";
|
|
1814
|
+
readonly update: "options";
|
|
1815
|
+
};
|
|
1816
|
+
readonly overlayNoRowsTemplate: {
|
|
1817
|
+
readonly kind: "unknown";
|
|
1818
|
+
readonly update: "options";
|
|
1819
|
+
};
|
|
1820
|
+
readonly overlayLoadingTemplate: {
|
|
1821
|
+
readonly kind: "unknown";
|
|
1822
|
+
readonly update: "options";
|
|
1823
|
+
};
|
|
1824
|
+
readonly allowUnsafeOverlayHtml: {
|
|
1825
|
+
readonly kind: "boolean";
|
|
1826
|
+
readonly update: "options";
|
|
1827
|
+
};
|
|
1828
|
+
readonly className: {
|
|
1829
|
+
readonly kind: "string";
|
|
1830
|
+
readonly update: "options";
|
|
1831
|
+
};
|
|
1832
|
+
};
|
|
1833
|
+
declare const GRID_OPTION_KEYS: readonly GridOptionKey[];
|
|
1834
|
+
declare const DIRECT_GRID_OPTION_KEYS: readonly GridOptionKey[];
|
|
1835
|
+
|
|
1836
|
+
declare function describeFilter(filter: ColumnFilter): string;
|
|
1837
|
+
|
|
1838
|
+
type GridSchemaFieldType = "string" | "number" | "date" | "select" | "boolean";
|
|
1839
|
+
interface SchemaSelectOption {
|
|
1840
|
+
label: string;
|
|
1841
|
+
value: string | number;
|
|
1842
|
+
}
|
|
1843
|
+
interface GridSchemaField {
|
|
1844
|
+
field: string;
|
|
1845
|
+
title?: string;
|
|
1846
|
+
type?: GridSchemaFieldType;
|
|
1847
|
+
width?: number;
|
|
1848
|
+
minWidth?: number;
|
|
1849
|
+
maxWidth?: number;
|
|
1850
|
+
flex?: number;
|
|
1851
|
+
pinned?: "left" | "right";
|
|
1852
|
+
editable?: boolean;
|
|
1853
|
+
sortable?: boolean;
|
|
1854
|
+
filterable?: boolean;
|
|
1855
|
+
resizable?: boolean;
|
|
1856
|
+
hidden?: boolean;
|
|
1857
|
+
options?: SchemaSelectOption[];
|
|
1858
|
+
format?: "date" | "datetime";
|
|
1859
|
+
cellClass?: string | string[];
|
|
1860
|
+
}
|
|
1861
|
+
interface GridSchemaGroup {
|
|
1862
|
+
title: string;
|
|
1863
|
+
fields: string[];
|
|
1864
|
+
}
|
|
1865
|
+
interface GridSchema {
|
|
1866
|
+
fields: GridSchemaField[];
|
|
1867
|
+
groups?: GridSchemaGroup[];
|
|
1868
|
+
}
|
|
1869
|
+
declare function buildColDefsFromSchema<TData = any>(schema: GridSchema): (ColDef<TData> | ColDefGroup<TData>)[];
|
|
1870
|
+
|
|
1871
|
+
declare function saveColumnState(key: string, state: ColumnState[]): void;
|
|
1872
|
+
declare function loadColumnState(key: string): ColumnState[] | null;
|
|
1873
|
+
declare function clearColumnState(key: string): void;
|
|
1874
|
+
|
|
1875
|
+
type AggValues = Record<string, any>;
|
|
1876
|
+
type AggFunction = (values: any[]) => any;
|
|
1877
|
+
declare const BUILTIN_AGG_FUNCS: Record<string, AggFunction>;
|
|
1878
|
+
declare function createAggResolver(custom?: Record<string, AggFunction>): (name: string) => AggFunction | undefined;
|
|
1879
|
+
|
|
1880
|
+
declare function toTsv(rows: any[][], protectFormulas?: boolean): string;
|
|
1881
|
+
declare function parseTsv(text: string): string[][];
|
|
1882
|
+
declare function parseCsv(text: string, separator?: string): string[][];
|
|
1883
|
+
declare function parseDelimited(text: string, separator: string): string[][];
|
|
1884
|
+
|
|
1885
|
+
declare function escapeHtml(value: any): string;
|
|
1886
|
+
declare function downloadFile(filename: string, content: string, mime?: string): boolean;
|
|
1887
|
+
|
|
1888
|
+
declare function sanitizeFormulaCell(value: any): any;
|
|
1889
|
+
|
|
1890
|
+
declare function registerCellRenderer(name: string, renderer: CellRendererFn): () => void;
|
|
1891
|
+
declare function getCellRenderer(name: string): CellRendererFn | undefined;
|
|
1892
|
+
declare function registerCellEditor(name: string, editor: CellEditorFactory): () => void;
|
|
1893
|
+
declare function getCellEditor(name: string): CellEditorFactory | undefined;
|
|
1894
|
+
declare function clearComponentRegistries(): void;
|
|
1895
|
+
|
|
1896
|
+
type TagVariant = "success" | "warning" | "danger" | "info" | "neutral";
|
|
1897
|
+
interface StatusTagConfig {
|
|
1898
|
+
variantMap?: Record<string, TagVariant>;
|
|
1899
|
+
labelMap?: Record<string, string>;
|
|
1900
|
+
}
|
|
1901
|
+
declare function resolveTagVariant(value: any, variantMap?: Record<string, TagVariant>): TagVariant;
|
|
1902
|
+
declare function createStatusTagRenderer(config?: StatusTagConfig): CellRendererFn;
|
|
1903
|
+
interface ProgressConfig {
|
|
1904
|
+
showValue?: boolean;
|
|
1905
|
+
unit?: string;
|
|
1906
|
+
color?: string;
|
|
1907
|
+
}
|
|
1908
|
+
declare function createProgressBarRenderer(config?: ProgressConfig): CellRendererFn;
|
|
1909
|
+
declare function linkRenderer(params: CellRendererParams): string | HTMLElement;
|
|
1910
|
+
interface ActionItem<TData = any> {
|
|
1911
|
+
icon?: string;
|
|
1912
|
+
label?: string;
|
|
1913
|
+
title?: string;
|
|
1914
|
+
danger?: boolean;
|
|
1915
|
+
show?: (params: CellRendererParams<TData>) => boolean;
|
|
1916
|
+
onClick: (params: CellRendererParams<TData>) => void;
|
|
1917
|
+
}
|
|
1918
|
+
interface ActionButtonsConfig {
|
|
1919
|
+
actions: ActionItem[];
|
|
1920
|
+
max?: number;
|
|
1921
|
+
}
|
|
1922
|
+
declare function createActionButtonsRenderer(config: ActionButtonsConfig): CellRendererFn;
|
|
1923
|
+
declare function registerBuiltinRenderers(register: (name: string, fn: CellRendererFn) => void): void;
|
|
1924
|
+
|
|
1925
|
+
declare function selectionColumn<TData = any>(overrides?: Partial<ColDef<TData>>): ColDef<TData>;
|
|
1926
|
+
declare function indexColumn<TData = any>(overrides?: Partial<ColDef<TData>>): ColDef<TData>;
|
|
1927
|
+
declare function dragColumn<TData = any>(overrides?: Partial<ColDef<TData>>): ColDef<TData>;
|
|
1928
|
+
declare function actionsColumn<TData = any>(config?: ActionButtonsConfig & {
|
|
1929
|
+
width?: number;
|
|
1930
|
+
pinned?: "left" | "right";
|
|
1931
|
+
}): ColDef<TData>;
|
|
1932
|
+
|
|
1933
|
+
declare function evaluateColumnFilter(value: any, filter: ColumnFilter): boolean;
|
|
1934
|
+
|
|
1935
|
+
declare function sortNodes<TData>(nodes: RowNode<TData>[], sortModel: SortModel, columns: Column[], getCellValue: (node: RowNode<TData>, column: Column) => any): RowNode<TData>[];
|
|
1936
|
+
|
|
1937
|
+
declare const version: string;
|
|
1938
|
+
|
|
1939
|
+
export { type ActionButtonsConfig, type ActionItem, type AggFunction, type AggValues, BUILTIN_AGG_FUNCS, type CellAlign, type CellClassParams, type CellClassRule, type CellClickEvent, type CellContextMenuEvent, type CellDoubleClickEvent, type CellEditingStartedEvent, type CellEditingStoppedEvent, type CellEditorFactory, type CellEditorParams, type CellRendererFn, type CellRendererOutput, type CellRendererParams, type CellStyleRule, type CellValueChangedEvent, type ColDef, type ColDefGroup, type ColDefOrGroup, Column, type ColumnFilter, type ColumnMovedEvent, type ColumnResizedEvent, type ColumnState, type ColumnStateStore, type ColumnVisibilityChangedEvent, type ContextMenuItem, type ContextMenuParams, type CsvExportParams, DEFAULT_LOCALE, DIRECT_GRID_OPTION_KEYS, type DateFilterCondition, type DateFilterMatch, type DetailRowRendererParams, type DetailToggledEvent, EVENT_TYPES, type EditableParams, EventBus, type EventHandlers, type FilterChangedEvent, type FilterModel, type FilterType, GRID_OPTION_KEYS, GRID_OPTION_META, GRID_SIZE_PRESETS, type GetRowHeightParams, type GetRowIdParams, type GridApi, type GridCellRange, type GridComponents, GridCore, type GridDatasource, type GridErrorEvent, type GridEventBase, type GridEventMap, type GridEventType, type GridFeature, type GridFeatureContext, type GridOptionKey, type GridOptionMetadata, type GridOptionUpdateMode, type GridOptionValueKind, type GridOptions, type GridReadyEvent, type GridSchema, type GridSchemaField, type GridSchemaFieldType, type GridSchemaGroup, type GridSize, type GridSizePreset, type HeaderComponentParams, type ICellEditor, type ICellRendererResult, type ImportCsvOptions, type InfiniteGetRowsParams, LOCALE_EN, type ModelUpdatedEvent, type NumberFilterCondition, type NumberFilterMatch, type OverlayTemplate, type PaginationChangedEvent, type PaginationConfig, type PinnedDirection, type PrintOptions, type ProgressConfig, type RangeSelectionChangedEvent, type ResolvedGridOptions, type RgLocale, type RgLocaleKey, type RowClickEvent, type RowDragEndEvent, type RowNode, type RowSelectionMode, type RowTransaction, type SchemaSelectOption, type SelectEditorParams, type SelectionChangedEvent, type SetFilterCondition, type SetFilterParams, type SortChangedEvent, type SortDirection, type SortModel, type SortModelItem, type StatusBarConfig, type StatusBarPanel, type StatusTagConfig, type TagVariant, type TextFilterCondition, type TextFilterMatch, type ThemeMode, type TooltipParams, type ValueFormatterParams, type ValueGetterParams, type ValueSetterParams, type WatermarkConfig, type WidthInput, actionsColumn, buildColDefsFromSchema, clearColumnState, clearComponentRegistries, computeColumnWidths, createActionButtonsRenderer, createAggResolver, createGrid, createProgressBarRenderer, createStatusTagRenderer, defaultComparator, describeFilter, downloadFile, dragColumn, escapeHtml, evaluateColumnFilter, formatText, formatTwo, getByPath, getCellEditor, getCellRenderer, indexColumn, isColDefGroup, isSafePath, linkRenderer, loadColumnState, matchLocaleKey, parseCsv, parseDelimited, parseTsv, registerBuiltinRenderers, registerCellEditor, registerCellRenderer, resolveTagVariant, sanitizeFormulaCell, saveColumnState, selectionColumn, setByPath, sortNodes, toTsv, version };
|