@agile-team/mach-table 0.23.0 → 0.25.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/README.md +19 -109
- package/dist/adapter.cjs +1 -0
- package/dist/adapter.d.cts +384 -0
- package/dist/adapter.d.ts +384 -0
- package/dist/adapter.js +1 -0
- package/dist/configuration-CFMDwmiR.d.ts +57 -0
- package/dist/configuration-DmUvpJLO.d.cts +57 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +10 -1496
- package/dist/index.d.ts +10 -1496
- package/dist/index.js +6 -6
- package/dist/{worker-DsFc5zec.d.cts → options-CL6BYXVZ.d.cts} +973 -1088
- package/dist/{worker-DsFc5zec.d.ts → options-CL6BYXVZ.d.ts} +973 -1088
- package/dist/worker.d.cts +47 -1
- package/dist/worker.d.ts +47 -1
- package/package.json +12 -2
|
@@ -1,34 +1,3 @@
|
|
|
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
|
-
flex: number | null;
|
|
18
|
-
currentWidth: number;
|
|
19
|
-
parentGroup: ColumnGroup<TData> | null;
|
|
20
|
-
level: number;
|
|
21
|
-
isDetailToggle: boolean;
|
|
22
|
-
constructor(id: string, colDef: ColDef<TData>);
|
|
23
|
-
get sortable(): boolean;
|
|
24
|
-
get resizable(): boolean;
|
|
25
|
-
get movable(): boolean;
|
|
26
|
-
get filterable(): boolean;
|
|
27
|
-
get filterType(): FilterType;
|
|
28
|
-
get hasCheckbox(): boolean;
|
|
29
|
-
resetWidth(): void;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
1
|
interface RowNode<TData = any> {
|
|
33
2
|
id: string;
|
|
34
3
|
data: TData | null;
|
|
@@ -277,73 +246,6 @@ interface GridEventMap<TData = any> {
|
|
|
277
246
|
dirtyStateChanged: DirtyStateChangedEvent<TData>;
|
|
278
247
|
}
|
|
279
248
|
|
|
280
|
-
declare const DEFAULT_LOCALE: {
|
|
281
|
-
readonly matchContains: "包含";
|
|
282
|
-
readonly matchNotContains: "不包含";
|
|
283
|
-
readonly matchEquals: "等于";
|
|
284
|
-
readonly matchNotEquals: "不等于";
|
|
285
|
-
readonly matchStartsWith: "开头是";
|
|
286
|
-
readonly matchEndsWith: "结尾是";
|
|
287
|
-
readonly matchBlank: "为空";
|
|
288
|
-
readonly matchNotBlank: "不为空";
|
|
289
|
-
readonly matchLessThan: "小于";
|
|
290
|
-
readonly matchLessThanOrEqual: "小于等于";
|
|
291
|
-
readonly matchGreaterThan: "大于";
|
|
292
|
-
readonly matchGreaterThanOrEqual: "大于等于";
|
|
293
|
-
readonly matchInRange: "在范围内";
|
|
294
|
-
readonly apply: "应用";
|
|
295
|
-
readonly reset: "重置";
|
|
296
|
-
readonly search: "搜索...";
|
|
297
|
-
readonly emptySetLabel: "(空)";
|
|
298
|
-
readonly selectedCount: "已选 {n} 项";
|
|
299
|
-
readonly sortAsc: "升序";
|
|
300
|
-
readonly sortDesc: "降序";
|
|
301
|
-
readonly clearSort: "取消排序";
|
|
302
|
-
readonly pinLeft: "固定左侧";
|
|
303
|
-
readonly pinRight: "固定右侧";
|
|
304
|
-
readonly clearPin: "取消固定";
|
|
305
|
-
readonly autoSize: "自适应列宽";
|
|
306
|
-
readonly hideColumn: "隐藏此列";
|
|
307
|
-
readonly columnVisibility: "列显示";
|
|
308
|
-
readonly resetAll: "重置全部";
|
|
309
|
-
readonly autoSizeAll: "全部自适应";
|
|
310
|
-
readonly columnSettings: "列设置";
|
|
311
|
-
readonly totalLabel: "合计";
|
|
312
|
-
readonly totalRowsLabel: "共 {n} 行";
|
|
313
|
-
readonly menuCopy: "复制";
|
|
314
|
-
readonly menuPaste: "粘贴";
|
|
315
|
-
readonly menuClearContents: "清除内容";
|
|
316
|
-
readonly loading: "加载中...";
|
|
317
|
-
readonly statusSelected: "已选 {n} 行";
|
|
318
|
-
readonly statusSum: "和 {n}";
|
|
319
|
-
readonly statusAvg: "均 {n}";
|
|
320
|
-
readonly statusCount: "计 {n}";
|
|
321
|
-
readonly emptyRows: "暂无数据";
|
|
322
|
-
readonly emptyRowsHint: "没有可显示的行";
|
|
323
|
-
readonly paginationTotal: "共 {n} 条";
|
|
324
|
-
readonly paginationPage: "第 {a} / {b} 页";
|
|
325
|
-
readonly perPage: "{n} 条/页";
|
|
326
|
-
readonly pageFirst: "首页";
|
|
327
|
-
readonly pagePrev: "上一页";
|
|
328
|
-
readonly pageNext: "下一页";
|
|
329
|
-
readonly pageLast: "末页";
|
|
330
|
-
readonly requestFailed: "数据加载失败";
|
|
331
|
-
readonly requestFailedHint: "请检查网络后重试";
|
|
332
|
-
readonly actionView: "查看";
|
|
333
|
-
readonly actionEdit: "编辑";
|
|
334
|
-
readonly actionDelete: "删除";
|
|
335
|
-
readonly actionConfirm: "确认";
|
|
336
|
-
readonly actionSave: "保存";
|
|
337
|
-
readonly actionCancel: "取消";
|
|
338
|
-
readonly actionMore: "更多操作";
|
|
339
|
-
};
|
|
340
|
-
type RgLocaleKey = keyof typeof DEFAULT_LOCALE;
|
|
341
|
-
type RgLocale = Partial<Record<RgLocaleKey, string>>;
|
|
342
|
-
declare const LOCALE_EN: RgLocale;
|
|
343
|
-
declare function matchLocaleKey(match: string): RgLocaleKey;
|
|
344
|
-
declare function formatText(template: string, n: number | string): string;
|
|
345
|
-
declare function formatTwo(template: string, a: number | string, b: number | string): string;
|
|
346
|
-
|
|
347
249
|
interface GridStateBase {
|
|
348
250
|
columns: ColumnState[];
|
|
349
251
|
sortModel: SortModel;
|
|
@@ -358,17 +260,13 @@ interface GridStateBase {
|
|
|
358
260
|
expandedRowIds: string[];
|
|
359
261
|
expandedGroupIds: string[];
|
|
360
262
|
}
|
|
361
|
-
/** Read-only compatibility shape accepted from MachTable 0.14/0.15. */
|
|
362
|
-
interface LegacyGridStateV1 extends GridStateBase {
|
|
363
|
-
version: 1;
|
|
364
|
-
}
|
|
365
263
|
/** Serializable snapshot of user-visible grid state. */
|
|
366
264
|
interface GridState extends GridStateBase {
|
|
367
265
|
/** State schema version, independent from the package version. */
|
|
368
266
|
version: 2;
|
|
369
267
|
advancedFilterModel: AdvancedFilterModel | null;
|
|
370
268
|
}
|
|
371
|
-
type GridStateInput = GridState
|
|
269
|
+
type GridStateInput = GridState;
|
|
372
270
|
type GridStateSection = "columns" | "sort" | "filter" | "pagination" | "selection" | "expansion";
|
|
373
271
|
interface ApplyGridStateOptions {
|
|
374
272
|
/** Applies all sections when omitted. */
|
|
@@ -377,1064 +275,1051 @@ interface ApplyGridStateOptions {
|
|
|
377
275
|
emitEvents?: boolean;
|
|
378
276
|
}
|
|
379
277
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
4: 3;
|
|
389
|
-
};
|
|
390
|
-
/** Dot-separated path to a serializable field, capped to keep editor inference fast. */
|
|
391
|
-
type FieldPath<T, D extends Depth = 4> = D extends 0 ? never : T extends Primitive ? never : {
|
|
392
|
-
[K in keyof T & string]: NonNullable<T[K]> extends Primitive | readonly unknown[] ? K : K | `${K}.${FieldPath<NonNullable<T[K]>, Previous[D]>}`;
|
|
393
|
-
}[keyof T & string];
|
|
394
|
-
type FieldPathValue<T, P extends string> = P extends keyof T ? T[P] : P extends `${infer Head}.${infer Tail}` ? Head extends keyof T ? FieldPathValue<NonNullable<T[Head]>, Tail> : unknown : unknown;
|
|
395
|
-
|
|
396
|
-
interface ColumnStateStore {
|
|
397
|
-
load(key: string): ColumnState[] | null | Promise<ColumnState[] | null>;
|
|
398
|
-
save(key: string, state: ColumnState[]): void | Promise<void>;
|
|
399
|
-
}
|
|
400
|
-
interface GridStateStore {
|
|
401
|
-
load(key: string): GridStateInput | null | Promise<GridStateInput | null>;
|
|
402
|
-
save(key: string, state: GridStateInput): void | Promise<void>;
|
|
403
|
-
clear?(key: string): void | Promise<void>;
|
|
404
|
-
}
|
|
405
|
-
/** Per-grid component overrides. These take precedence over the global registry. */
|
|
406
|
-
interface GridComponents {
|
|
407
|
-
cellRenderers?: Readonly<Record<string, CellRendererFn>>;
|
|
408
|
-
cellEditors?: Readonly<Record<string, CellEditorFactory>>;
|
|
409
|
-
}
|
|
410
|
-
interface GridFeatureContext<TData = any> {
|
|
411
|
-
readonly api: GridApi<TData>;
|
|
412
|
-
readonly root: HTMLElement;
|
|
413
|
-
getOptions(): Readonly<ResolvedGridOptions<TData>>;
|
|
414
|
-
addEventListener<K extends keyof GridEventMap<TData>>(type: K, listener: (event: GridEventMap<TData>[K]) => void): () => void;
|
|
415
|
-
/** Registers cleanup even when setup later throws or the feature is hot-replaced. */
|
|
416
|
-
onCleanup(cleanup: () => void): void;
|
|
417
|
-
addManagedDomListener(target: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
418
|
-
setManagedTimeout(handler: () => void, delayMs: number): ReturnType<typeof setTimeout>;
|
|
419
|
-
createAbortController(): AbortController;
|
|
420
|
-
reportError(error: unknown, source: string, context?: Record<string, unknown>): void;
|
|
421
|
-
}
|
|
422
|
-
interface GridFeatureRequirement {
|
|
423
|
-
key: string;
|
|
424
|
-
/** Semver range, for example `>=0.18 <1`, `^0.18.0` or an exact version. */
|
|
425
|
-
version?: string;
|
|
426
|
-
}
|
|
427
|
-
/** Composable extension point; feature instances are scoped to one grid. */
|
|
428
|
-
interface GridFeature<TData = any> {
|
|
429
|
-
readonly key: string;
|
|
430
|
-
/** Informational extension version exposed through diagnostics. */
|
|
431
|
-
readonly version?: string;
|
|
432
|
-
/** Feature keys that must be initialised before this feature. */
|
|
433
|
-
readonly requires?: readonly (string | GridFeatureRequirement)[];
|
|
434
|
-
/** Mutually exclusive feature keys. Conflicting features are not initialised. */
|
|
435
|
-
readonly conflicts?: readonly string[];
|
|
436
|
-
setup(context: GridFeatureContext<TData>): void | (() => void);
|
|
437
|
-
destroy?(): void;
|
|
278
|
+
interface CsvExportParams {
|
|
279
|
+
includeHeader?: boolean;
|
|
280
|
+
columnSeparator?: string;
|
|
281
|
+
prependBOM?: boolean;
|
|
282
|
+
onlySelected?: boolean;
|
|
283
|
+
onlyAllDisplayed?: boolean;
|
|
284
|
+
protectFormulas?: boolean;
|
|
285
|
+
headersOnly?: boolean;
|
|
438
286
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
287
|
+
interface ImportCsvOptions {
|
|
288
|
+
separator?: string;
|
|
289
|
+
mode?: "replace" | "append" | "paste";
|
|
290
|
+
headerRowIndex?: number;
|
|
291
|
+
coerceNumbers?: boolean;
|
|
292
|
+
parseValue?: (params: {
|
|
293
|
+
value: string;
|
|
294
|
+
field: string;
|
|
295
|
+
rowIndex: number;
|
|
296
|
+
columnIndex: number;
|
|
297
|
+
}) => any;
|
|
448
298
|
}
|
|
449
|
-
interface
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
sortModel: SortModel;
|
|
453
|
-
filterModel: FilterModel;
|
|
454
|
-
advancedFilterModel: AdvancedFilterModel | null;
|
|
455
|
-
quickFilterText: string | null;
|
|
456
|
-
signal: AbortSignal;
|
|
457
|
-
onSuccess(rows: TData[], lastRow?: number): void;
|
|
458
|
-
fail(reason?: unknown): void;
|
|
299
|
+
interface PrintOptions {
|
|
300
|
+
title?: string;
|
|
301
|
+
includeHeader?: boolean;
|
|
459
302
|
}
|
|
460
|
-
interface
|
|
461
|
-
|
|
303
|
+
interface RowTransaction<TData = any> {
|
|
304
|
+
add?: TData[];
|
|
305
|
+
addIndex?: number;
|
|
306
|
+
remove?: TData[];
|
|
307
|
+
update?: TData[];
|
|
462
308
|
}
|
|
463
|
-
|
|
464
|
-
interface GridDataProcessorColumn {
|
|
309
|
+
interface GridCellChange {
|
|
465
310
|
colId: string;
|
|
466
|
-
|
|
467
|
-
|
|
311
|
+
originalValue: unknown;
|
|
312
|
+
value: unknown;
|
|
468
313
|
}
|
|
469
|
-
interface
|
|
470
|
-
|
|
314
|
+
interface GridChange<TData = any> {
|
|
315
|
+
rowId: string;
|
|
471
316
|
data: TData;
|
|
317
|
+
cells: GridCellChange[];
|
|
472
318
|
}
|
|
473
|
-
interface
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
quickFilterText: string | null;
|
|
480
|
-
signal: AbortSignal;
|
|
319
|
+
interface GridDiagnosticError {
|
|
320
|
+
code: GridErrorCode;
|
|
321
|
+
source: string;
|
|
322
|
+
message: string;
|
|
323
|
+
timestamp: number;
|
|
324
|
+
context?: Record<string, unknown>;
|
|
481
325
|
}
|
|
482
|
-
interface
|
|
483
|
-
|
|
484
|
-
|
|
326
|
+
interface GridPerformanceSnapshot {
|
|
327
|
+
sampleCount: number;
|
|
328
|
+
lastRenderMs: number;
|
|
329
|
+
averageRenderMs: number;
|
|
330
|
+
maxRenderMs: number;
|
|
331
|
+
p95RenderMs: number;
|
|
332
|
+
longRenderCount: number;
|
|
333
|
+
renderedRows: number;
|
|
334
|
+
renderedColumns: number;
|
|
335
|
+
renderedCells: number;
|
|
336
|
+
layoutSampleCount: number;
|
|
337
|
+
p95LayoutMs: number;
|
|
338
|
+
modelSampleCount: number;
|
|
339
|
+
p95ModelMs: number;
|
|
340
|
+
longTaskCount: number;
|
|
341
|
+
longTaskTotalMs: number;
|
|
342
|
+
usedHeapBytes: number | null;
|
|
485
343
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
344
|
+
interface GridUpdateSchedulerSnapshot {
|
|
345
|
+
batchDepth: number;
|
|
346
|
+
flushCount: number;
|
|
347
|
+
requestCount: number;
|
|
348
|
+
coalescedRequestCount: number;
|
|
349
|
+
pending: boolean;
|
|
490
350
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
interface
|
|
351
|
+
interface RemoteBlockCacheSnapshot {
|
|
352
|
+
cachedBlockCount: number;
|
|
353
|
+
loadingBlockCount: number;
|
|
354
|
+
activeRequestCount: number;
|
|
355
|
+
queuedRequestCount: number;
|
|
356
|
+
cachedRowCount: number;
|
|
357
|
+
hitCount: number;
|
|
358
|
+
missCount: number;
|
|
359
|
+
evictionCount: number;
|
|
360
|
+
}
|
|
361
|
+
interface GridAsyncOptions {
|
|
362
|
+
signal?: AbortSignal;
|
|
363
|
+
}
|
|
364
|
+
interface RefreshCellsParams {
|
|
365
|
+
/** Stable row identifiers. Omit together with rowIndexes to target every rendered row. */
|
|
366
|
+
rowIds?: readonly string[];
|
|
367
|
+
/** Displayed row indexes. Omit together with rowIds to target every rendered row. */
|
|
368
|
+
rowIndexes?: readonly number[];
|
|
369
|
+
/** Column IDs. Omit to target every rendered column in matching rows. */
|
|
370
|
+
columns?: readonly string[];
|
|
371
|
+
/** Bypasses renderer refresh hooks and recreates matching cell content. */
|
|
372
|
+
force?: boolean;
|
|
373
|
+
/** Also refreshes pinned rows. Defaults to true only for an unscoped refresh. */
|
|
374
|
+
includePinned?: boolean;
|
|
375
|
+
}
|
|
376
|
+
interface ColumnWorkbenchItem {
|
|
377
|
+
colId: string;
|
|
378
|
+
label: string;
|
|
379
|
+
visible: boolean;
|
|
380
|
+
pinned: "left" | "right" | null;
|
|
381
|
+
width: number;
|
|
382
|
+
movable: boolean;
|
|
383
|
+
hideable: boolean;
|
|
384
|
+
}
|
|
385
|
+
interface GridDiagnostics {
|
|
386
|
+
gridId: number;
|
|
387
|
+
version: string;
|
|
388
|
+
destroyed: boolean;
|
|
389
|
+
infinite: boolean;
|
|
390
|
+
loading: boolean;
|
|
391
|
+
rowCount: number;
|
|
392
|
+
renderedRowCount: number;
|
|
393
|
+
columnCount: number;
|
|
394
|
+
selectedRowCount: number;
|
|
395
|
+
dirtyRowCount: number;
|
|
396
|
+
activeFeatures: ReadonlyArray<{
|
|
397
|
+
key: string;
|
|
398
|
+
version?: string;
|
|
399
|
+
}>;
|
|
400
|
+
performance: GridPerformanceSnapshot;
|
|
401
|
+
updates: GridUpdateSchedulerSnapshot;
|
|
402
|
+
recentErrors: readonly GridDiagnosticError[];
|
|
403
|
+
}
|
|
404
|
+
interface GridRowsApi<TData = any> {
|
|
405
|
+
setData(rows: TData[] | null | undefined): void;
|
|
406
|
+
transact(transaction: RowTransaction<TData>): void;
|
|
407
|
+
transactAsync(transaction: RowTransaction<TData>, options?: GridAsyncOptions): Promise<void>;
|
|
408
|
+
flushTransactions(): void;
|
|
409
|
+
getCount(): number;
|
|
410
|
+
getAt(index: number): RowNode<TData> | undefined;
|
|
411
|
+
getById(id: string): RowNode<TData> | undefined;
|
|
412
|
+
forEach(callback: (node: RowNode<TData>, index: number) => void): void;
|
|
413
|
+
forEachDisplayed(callback: (node: RowNode<TData>, index: number) => void): void;
|
|
414
|
+
reorder(fromIndex: number, toIndex: number): boolean;
|
|
415
|
+
isRemote(): boolean;
|
|
416
|
+
reload(options?: GridAsyncOptions): Promise<void>;
|
|
417
|
+
ensureLoaded(startRow: number, endRow: number, options?: GridAsyncOptions): Promise<void>;
|
|
418
|
+
purgeCache(): void;
|
|
419
|
+
getCacheSnapshot(): RemoteBlockCacheSnapshot;
|
|
420
|
+
}
|
|
421
|
+
interface GridColumnsApi<TData = any> {
|
|
422
|
+
getDefinitions(): (ColDef<TData> | ColDefGroup<TData>)[] | null;
|
|
423
|
+
setDefinitions(definitions: (ColDef<TData> | ColDefGroup<TData>)[] | null | undefined): void;
|
|
424
|
+
getState(): ColumnState[];
|
|
425
|
+
setState(state: ColumnState[]): void;
|
|
426
|
+
resetState(): void;
|
|
427
|
+
setVisible(colId: string, visible: boolean): void;
|
|
428
|
+
setPinned(colId: string, pinned: "left" | "right" | null): void;
|
|
429
|
+
move(colId: string, toIndex: number): void;
|
|
430
|
+
setWidth(colId: string, width: number): boolean;
|
|
431
|
+
fit(width?: number): void;
|
|
432
|
+
autoSize(colId: string, skipHeader?: boolean): void;
|
|
433
|
+
autoSizeAll(skipHeader?: boolean): void;
|
|
434
|
+
getWorkbenchItems(): ColumnWorkbenchItem[];
|
|
435
|
+
openWorkbench(anchor?: HTMLElement): void;
|
|
436
|
+
closeWorkbench(): void;
|
|
437
|
+
}
|
|
438
|
+
interface GridSelectionApi<TData = any> {
|
|
439
|
+
getRows(): TData[];
|
|
440
|
+
getVisibleRows(): TData[];
|
|
441
|
+
getNodes(): RowNode<TData>[];
|
|
442
|
+
getIds(): string[];
|
|
443
|
+
setRows(rows: TData[], clearOthers?: boolean): void;
|
|
444
|
+
setById(nodeId: string, selected?: boolean, clearOthers?: boolean): void;
|
|
445
|
+
selectAll(filteredOnly?: boolean): void;
|
|
446
|
+
clear(): void;
|
|
447
|
+
getMode(): RowSelectionMode;
|
|
448
|
+
setMode(mode: RowSelectionMode): void;
|
|
449
|
+
getRange(): GridCellRange | null;
|
|
450
|
+
clearRange(): void;
|
|
451
|
+
}
|
|
452
|
+
interface GridEditingApi<TData = any> {
|
|
453
|
+
startCell(params: {
|
|
454
|
+
rowIndex: number;
|
|
455
|
+
colId: string;
|
|
456
|
+
keyPress?: string;
|
|
457
|
+
}): boolean;
|
|
458
|
+
startRow(rowIndex: number): boolean;
|
|
459
|
+
isRowActive(rowIndex?: number): boolean;
|
|
460
|
+
stop(options?: {
|
|
461
|
+
cancel?: boolean;
|
|
462
|
+
}): Promise<boolean>;
|
|
463
|
+
getChanges(): GridChange<TData>[];
|
|
464
|
+
getDirtyRowIds(): string[];
|
|
465
|
+
markSaved(rowIds?: readonly string[]): void;
|
|
466
|
+
rollback(rowIds?: readonly string[]): boolean;
|
|
467
|
+
save(handler: SaveChangesHandler<TData>, rowIds?: readonly string[]): Promise<GridBatchSaveResult<TData>>;
|
|
468
|
+
undo(): boolean;
|
|
469
|
+
redo(): boolean;
|
|
470
|
+
canUndo(): boolean;
|
|
471
|
+
canRedo(): boolean;
|
|
472
|
+
}
|
|
473
|
+
interface GridStateApi {
|
|
474
|
+
get(): GridState;
|
|
475
|
+
apply(state: GridStateInput, options?: ApplyGridStateOptions): void;
|
|
476
|
+
}
|
|
477
|
+
interface GridDiagnosticsApi {
|
|
478
|
+
get(): GridDiagnostics;
|
|
479
|
+
getPerformance(): GridPerformanceSnapshot;
|
|
480
|
+
resetPerformance(): void;
|
|
481
|
+
}
|
|
482
|
+
/** Filtering owns filter state only; server requests remain in the host query layer. */
|
|
483
|
+
interface GridFilteringApi {
|
|
484
|
+
getModel(): FilterModel;
|
|
485
|
+
setModel(model: FilterModel | null): void;
|
|
486
|
+
getAdvancedModel(): AdvancedFilterModel | null;
|
|
487
|
+
setAdvancedModel(model: AdvancedFilterModel | null): void;
|
|
488
|
+
getQuickText(): string | null;
|
|
489
|
+
setQuickText(text: string | null | undefined): void;
|
|
490
|
+
isPresent(colId?: string): boolean;
|
|
491
|
+
}
|
|
492
|
+
interface GridPaginationApi {
|
|
493
|
+
isEnabled(): boolean;
|
|
494
|
+
setEnabled(enabled: boolean): void;
|
|
495
|
+
getPage(): number;
|
|
496
|
+
setPage(page: number): void;
|
|
497
|
+
getPageSize(): number;
|
|
498
|
+
setPageSize(size: number): void;
|
|
499
|
+
getPageCount(): number;
|
|
500
|
+
getTotalRowCount(): number;
|
|
501
|
+
}
|
|
502
|
+
interface GridSortingApi {
|
|
503
|
+
getModel(): SortModel;
|
|
504
|
+
setModel(model: SortModel | null): void;
|
|
505
|
+
}
|
|
506
|
+
interface GridHierarchyApi<TData = any> {
|
|
507
|
+
isRowExpanded(rowId: string): boolean;
|
|
508
|
+
setRowExpanded(rowId: string, expanded: boolean): boolean;
|
|
509
|
+
isTreeRowLoading(rowId: string): boolean;
|
|
510
|
+
loadTreeChildren(rowId: string, options?: {
|
|
511
|
+
force?: boolean;
|
|
512
|
+
}): Promise<readonly TData[]>;
|
|
513
|
+
isGroupExpanded(groupId: string): boolean;
|
|
514
|
+
setGroupExpanded(groupId: string, expanded: boolean): boolean;
|
|
515
|
+
setAllGroupsExpanded(expanded: boolean): void;
|
|
516
|
+
setAllDetailsExpanded(expanded: boolean): void;
|
|
517
|
+
}
|
|
518
|
+
interface GridViewApi<TData = any> {
|
|
519
|
+
getRoot(): HTMLElement | null;
|
|
520
|
+
scrollToRow(index: number, position?: "top" | "bottom" | "middle" | "nearest"): void;
|
|
521
|
+
refreshCells(params?: RefreshCellsParams): void;
|
|
522
|
+
refreshLayout(): void;
|
|
523
|
+
flush(): void;
|
|
524
|
+
setOverlay(type: "loading" | "noRows" | "error" | null): void;
|
|
525
|
+
getPinnedRows(position: "top" | "bottom"): TData[];
|
|
526
|
+
setPinnedRows(position: "top" | "bottom", rows: TData[] | null): void;
|
|
527
|
+
}
|
|
528
|
+
interface GridIoApi {
|
|
529
|
+
exportCsv(params?: CsvExportParams): string;
|
|
530
|
+
importCsv(text: string, options?: ImportCsvOptions): boolean;
|
|
531
|
+
print(options?: PrintOptions): boolean;
|
|
532
|
+
copyRange(): Promise<boolean>;
|
|
533
|
+
}
|
|
534
|
+
interface SaveChangeIssue {
|
|
535
|
+
rowId: string;
|
|
536
|
+
code?: string;
|
|
537
|
+
message: string;
|
|
538
|
+
colIds?: readonly string[];
|
|
539
|
+
retryable?: boolean;
|
|
540
|
+
}
|
|
541
|
+
interface SaveChangeConflict<TData = any> extends SaveChangeIssue {
|
|
542
|
+
serverData?: TData;
|
|
543
|
+
serverVersion?: string | number;
|
|
544
|
+
}
|
|
545
|
+
interface SaveChangesResult<TData = any> {
|
|
546
|
+
/** Omit to acknowledge every submitted row; return a subset for partial batch success. */
|
|
547
|
+
savedRowIds?: readonly string[];
|
|
548
|
+
failures?: readonly SaveChangeIssue[];
|
|
549
|
+
conflicts?: readonly SaveChangeConflict<TData>[];
|
|
550
|
+
}
|
|
551
|
+
interface GridBatchSaveResult<TData = any> {
|
|
552
|
+
submitted: GridChange<TData>[];
|
|
553
|
+
saved: GridChange<TData>[];
|
|
554
|
+
failures: SaveChangeIssue[];
|
|
555
|
+
conflicts: SaveChangeConflict<TData>[];
|
|
556
|
+
}
|
|
557
|
+
type SaveChangesHandler<TData = any> = (changes: readonly GridChange<TData>[]) => void | SaveChangesResult<TData> | Promise<void | SaveChangesResult<TData>>;
|
|
558
|
+
interface GridApi<TData = any> {
|
|
559
|
+
readonly rows: GridRowsApi<TData>;
|
|
560
|
+
readonly columns: GridColumnsApi<TData>;
|
|
561
|
+
readonly selection: GridSelectionApi<TData>;
|
|
562
|
+
readonly editing: GridEditingApi<TData>;
|
|
563
|
+
readonly filtering: GridFilteringApi;
|
|
564
|
+
readonly sorting: GridSortingApi;
|
|
565
|
+
readonly pagination: GridPaginationApi;
|
|
566
|
+
readonly hierarchy: GridHierarchyApi<TData>;
|
|
567
|
+
readonly view: GridViewApi<TData>;
|
|
568
|
+
readonly state: GridStateApi;
|
|
569
|
+
readonly io: GridIoApi;
|
|
570
|
+
readonly diagnostics: GridDiagnosticsApi;
|
|
571
|
+
/** Coalesces model/layout/render work from nested synchronous API calls. */
|
|
572
|
+
batch<TResult>(callback: (api: GridApi<TData>) => TResult): TResult;
|
|
573
|
+
/** Resolves after the first layout frame and gridReady emission. */
|
|
574
|
+
whenReady(): Promise<GridApi<TData>>;
|
|
575
|
+
/** Reads the currently resolved value after application, preset and table overrides. */
|
|
576
|
+
getOption<K extends keyof GridOptions<TData>>(key: K): GridOptions<TData>[K];
|
|
577
|
+
updateOptions(options: Partial<GridOptions<TData>>): void;
|
|
578
|
+
on<K extends GridEventType>(eventType: K, listener: (event: GridEventMap<TData>[K]) => void): () => void;
|
|
579
|
+
destroy(): void;
|
|
580
|
+
isDestroyed(): boolean;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
interface ValueGetterParams<TData = any, TValue = any> {
|
|
584
|
+
data: TData | null;
|
|
585
|
+
node: RowNode<TData>;
|
|
586
|
+
colDef: ColDef<TData, TValue>;
|
|
587
|
+
column: Column<TData>;
|
|
588
|
+
api: GridApi<TData>;
|
|
589
|
+
}
|
|
590
|
+
interface ValueFormatterParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
591
|
+
value: TValue;
|
|
592
|
+
}
|
|
593
|
+
interface CellRendererParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
594
|
+
value: TValue;
|
|
595
|
+
formatted: string;
|
|
596
|
+
rowIndex: number;
|
|
597
|
+
rendererParams?: Record<string, any>;
|
|
598
|
+
}
|
|
599
|
+
interface CellClassParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
600
|
+
value: TValue;
|
|
601
|
+
rowIndex: number;
|
|
602
|
+
}
|
|
603
|
+
interface EditableParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
604
|
+
value: TValue;
|
|
605
|
+
rowIndex: number;
|
|
606
|
+
}
|
|
607
|
+
interface CellEditorParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
608
|
+
value: TValue;
|
|
609
|
+
rowIndex: number;
|
|
610
|
+
keyPress?: string | null;
|
|
611
|
+
}
|
|
612
|
+
interface ValueSetterParams<TData = any, TValue = any> {
|
|
613
|
+
oldValue: TValue;
|
|
614
|
+
newValue: TValue;
|
|
502
615
|
data: TData;
|
|
503
616
|
node: RowNode<TData>;
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
changes: readonly RowEditChange[];
|
|
617
|
+
colDef: ColDef<TData, TValue>;
|
|
618
|
+
column: Column<TData>;
|
|
507
619
|
api: GridApi<TData>;
|
|
508
620
|
}
|
|
509
|
-
|
|
510
|
-
|
|
621
|
+
interface GetRowIdParams<TData = any> {
|
|
622
|
+
data: TData;
|
|
623
|
+
index: number;
|
|
624
|
+
api: GridApi<TData>;
|
|
625
|
+
}
|
|
626
|
+
interface GetRowHeightParams<TData = any> {
|
|
511
627
|
data: TData | null;
|
|
512
628
|
node: RowNode<TData>;
|
|
513
629
|
api: GridApi<TData>;
|
|
514
630
|
}
|
|
515
|
-
interface
|
|
516
|
-
data: TData;
|
|
631
|
+
interface TooltipParams<TData = any> {
|
|
632
|
+
data: TData | null;
|
|
517
633
|
node: RowNode<TData>;
|
|
518
634
|
api: GridApi<TData>;
|
|
519
|
-
|
|
635
|
+
colId: string;
|
|
636
|
+
value: any;
|
|
637
|
+
formatted: string;
|
|
638
|
+
rowIndex: number;
|
|
520
639
|
}
|
|
521
|
-
interface
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
pageSize?: number;
|
|
529
|
-
pageSizeOptions?: number[];
|
|
530
|
-
showTotal?: boolean;
|
|
531
|
-
showPageSizeSelector?: boolean;
|
|
640
|
+
interface ContextMenuParams<TData = any> {
|
|
641
|
+
data: TData | null;
|
|
642
|
+
node: RowNode<TData>;
|
|
643
|
+
api: GridApi<TData>;
|
|
644
|
+
colId: string;
|
|
645
|
+
value: any;
|
|
646
|
+
rowIndex: number;
|
|
532
647
|
}
|
|
533
|
-
interface
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
angle?: number;
|
|
648
|
+
interface ContextMenuItem {
|
|
649
|
+
label?: string;
|
|
650
|
+
action?: () => void;
|
|
651
|
+
danger?: boolean;
|
|
652
|
+
disabled?: boolean;
|
|
653
|
+
separator?: boolean;
|
|
540
654
|
}
|
|
541
|
-
interface
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
message?: string;
|
|
546
|
-
params: CellRendererParams<TData>;
|
|
655
|
+
interface HeaderComponentParams<TData = any> {
|
|
656
|
+
colDef: ColDef<TData>;
|
|
657
|
+
column: Column<TData>;
|
|
658
|
+
api: GridApi<TData>;
|
|
547
659
|
}
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
canAccess?(context: ActionPolicyContext<TData>): boolean;
|
|
554
|
-
confirm?(context: ActionPolicyContext<TData>): boolean | Promise<boolean>;
|
|
555
|
-
onError?(error: unknown, context: ActionPolicyContext<TData>): void;
|
|
660
|
+
interface ICellRendererResult {
|
|
661
|
+
el: HTMLElement;
|
|
662
|
+
/** Reuses the mounted renderer for an update. Return false to request recreation. */
|
|
663
|
+
refresh?(params: CellRendererParams): boolean | void;
|
|
664
|
+
destroy?: () => void;
|
|
556
665
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
rowKey?: FieldPath<TData> | ((row: TData) => string | number);
|
|
566
|
-
rowHeight?: number;
|
|
567
|
-
headerHeight?: number;
|
|
568
|
-
rowBuffer?: number;
|
|
569
|
-
/** `fit` continuously fills the container without grid-ready glue code. */
|
|
570
|
-
columnLayout?: ColumnLayoutMode;
|
|
571
|
-
/** Enables pointer, double-click and Alt+Arrow column resizing. Disabled by default. */
|
|
572
|
-
enableColumnResize?: boolean;
|
|
573
|
-
/** Lets small grids grow with their rows. Avoid for large or infinite datasets. */
|
|
574
|
-
domLayout?: DomLayoutMode;
|
|
575
|
-
rowSelection?: RowSelectionMode;
|
|
576
|
-
multiSort?: boolean;
|
|
577
|
-
size?: GridSize;
|
|
578
|
-
stripedRows?: boolean;
|
|
579
|
-
showCellBorders?: boolean;
|
|
580
|
-
theme?: ThemeMode;
|
|
581
|
-
quickFilterText?: string | null;
|
|
582
|
-
/** Nested AND/OR filter expression, safe for local evaluation and backend serialization. */
|
|
583
|
-
advancedFilterModel?: AdvancedFilterModel | null;
|
|
584
|
-
masterDetail?: boolean;
|
|
585
|
-
detailRowHeight?: number;
|
|
586
|
-
detailRowRenderer?: (params: DetailRowRendererParams<TData>) => string | HTMLElement | ICellRendererResult | null | undefined;
|
|
587
|
-
isRowExpandable?: (params: DetailRowRendererParams<TData>) => boolean;
|
|
588
|
-
detailToggleColumn?: boolean;
|
|
589
|
-
columnMenu?: boolean;
|
|
590
|
-
columnStateKey?: string | null;
|
|
591
|
-
columnStateStore?: ColumnStateStore;
|
|
592
|
-
aggFuncs?: Record<string, (values: any[]) => any>;
|
|
593
|
-
components?: GridComponents;
|
|
594
|
-
/** Shared policy consumed by action column helpers. */
|
|
595
|
-
actionPolicy?: ActionPolicy<TData>;
|
|
596
|
-
features?: readonly GridFeature<TData>[];
|
|
597
|
-
/** State restored atomically after columns and initial rows are available. */
|
|
598
|
-
initialState?: GridStateInput;
|
|
599
|
-
/** Persist the complete user-visible GridState with a versioned store. */
|
|
600
|
-
stateKey?: string | null;
|
|
601
|
-
stateStore?: GridStateStore;
|
|
602
|
-
stateSaveDebounceMs?: number;
|
|
603
|
-
locale?: RgLocale;
|
|
604
|
-
/** Cell editing is isolated; fullRow stages every editable cell and commits them together. */
|
|
605
|
-
editType?: GridEditType;
|
|
606
|
-
/** Visibility of the subtle pencil affordance on editable cells. */
|
|
607
|
-
editableIndicator?: EditableIndicator;
|
|
608
|
-
/** Cross-field full-row validation. Return a message or a colId -> message map. */
|
|
609
|
-
rowEditValidator?: (params: RowEditValidationParams<TData>) => RowEditValidationResult | Promise<RowEditValidationResult>;
|
|
610
|
-
singleClickEdit?: boolean;
|
|
611
|
-
manualSorting?: boolean;
|
|
612
|
-
manualFiltering?: boolean;
|
|
613
|
-
showSummary?: boolean;
|
|
614
|
-
summaryMethod?: (params: {
|
|
615
|
-
colId: string;
|
|
616
|
-
column: Column<any>;
|
|
617
|
-
values: any[];
|
|
618
|
-
}) => string;
|
|
619
|
-
treeData?: boolean;
|
|
620
|
-
childrenKey?: string;
|
|
621
|
-
/** Marks rows that can load children even when `childrenKey` is currently empty. */
|
|
622
|
-
isTreeRowExpandable?: (params: Omit<TreeDataLoadParams<TData>, "signal">) => boolean;
|
|
623
|
-
/** Loads children once on first expansion; use the API retry/force methods to reload. */
|
|
624
|
-
loadTreeChildren?: (params: TreeDataLoadParams<TData>) => Promise<readonly TData[]>;
|
|
625
|
-
autoCheckedChildren?: boolean;
|
|
626
|
-
defaultExpandAll?: boolean;
|
|
627
|
-
indexOffset?: number;
|
|
628
|
-
applyRowDrag?: boolean;
|
|
629
|
-
undoStackSize?: number;
|
|
630
|
-
/** Milliseconds used to coalesce applyTransactionAsync calls. */
|
|
631
|
-
asyncTransactionWaitMillis?: number;
|
|
632
|
-
getRowHeight?: (params: GetRowHeightParams<TData>) => number;
|
|
633
|
-
pinnedTopRowData?: TData[] | null;
|
|
634
|
-
pinnedBottomRowData?: TData[] | null;
|
|
635
|
-
pagination?: boolean | PaginationConfig;
|
|
636
|
-
watermark?: boolean | WatermarkConfig;
|
|
637
|
-
suppressWarnings?: boolean;
|
|
638
|
-
enableRangeSelection?: boolean;
|
|
639
|
-
suppressClipboard?: boolean;
|
|
640
|
-
contextMenu?: boolean;
|
|
641
|
-
getContextMenuItems?: (params: ContextMenuParams<TData>) => ContextMenuItem[] | null;
|
|
642
|
-
tooltipComponent?: (params: TooltipParams<TData>) => string | HTMLElement;
|
|
643
|
-
tooltipShowDelay?: number;
|
|
644
|
-
flashCells?: boolean;
|
|
645
|
-
fillHandle?: boolean;
|
|
646
|
-
statusBar?: boolean | StatusBarConfig;
|
|
647
|
-
datasource?: GridDatasource<TData>;
|
|
648
|
-
/** Sequential append is the compatibility default; block enables random-access cached loading. */
|
|
649
|
-
datasourceMode?: DatasourceMode;
|
|
650
|
-
blockSize?: number;
|
|
651
|
-
infiniteBufferRows?: number;
|
|
652
|
-
/** Maximum retained blocks in random-access mode. */
|
|
653
|
-
maxBlocksInCache?: number;
|
|
654
|
-
/** Upper bound for active random-access datasource requests. Defaults to 4. */
|
|
655
|
-
datasourceMaxConcurrentRequests?: number;
|
|
656
|
-
/** Number of adjacent blocks prefetched around a requested viewport. */
|
|
657
|
-
blockPrefetch?: number;
|
|
658
|
-
/** Optional initial total enables immediate scrollbar range before the first response. */
|
|
659
|
-
datasourceRowCount?: number;
|
|
660
|
-
/** Opt-in async processor for large local filter/sort pipelines. */
|
|
661
|
-
dataProcessor?: GridDataProcessor<TData>;
|
|
662
|
-
/** Minimum local row count before dataProcessor is used. Defaults to 5,000. */
|
|
663
|
-
dataProcessorMinRows?: number;
|
|
664
|
-
/** Number of automatic retries after an infinite datasource request fails. */
|
|
665
|
-
datasourceRetryCount?: number;
|
|
666
|
-
/** Base retry delay in milliseconds. Retries use capped exponential backoff. */
|
|
667
|
-
datasourceRetryDelay?: number;
|
|
668
|
-
/** Symmetric retry jitter ratio in the 0..1 range. Defaults to 0.15. */
|
|
669
|
-
datasourceRetryJitter?: number;
|
|
670
|
-
suppressCellFocus?: boolean;
|
|
671
|
-
suppressRowHoverHighlight?: boolean;
|
|
672
|
-
suppressNoRowsOverlay?: boolean;
|
|
673
|
-
suppressHeaderFocus?: boolean;
|
|
674
|
-
/** Accessible name applied to the element with role="grid"/"treegrid". */
|
|
675
|
-
ariaLabel?: string;
|
|
676
|
-
/** ID of an external element that labels the grid. Takes precedence over ariaLabel. */
|
|
677
|
-
ariaLabelledBy?: string;
|
|
678
|
-
/** ID of an external element that provides additional grid instructions. */
|
|
679
|
-
ariaDescribedBy?: string;
|
|
680
|
-
loading?: boolean;
|
|
681
|
-
/** Non-null errors take precedence over the empty state and remain retryable by the host. */
|
|
682
|
-
error?: unknown | null;
|
|
683
|
-
overlayNoRowsTemplate?: OverlayTemplate;
|
|
684
|
-
overlayLoadingTemplate?: OverlayTemplate;
|
|
685
|
-
overlayErrorTemplate?: OverlayTemplate;
|
|
686
|
-
/** Opt in only for trusted overlay strings. Prefer HTMLElement factories. */
|
|
687
|
-
allowUnsafeOverlayHtml?: boolean;
|
|
688
|
-
className?: string;
|
|
689
|
-
}
|
|
690
|
-
interface ResolvedGridOptions<TData = any> extends EventHandlers<TData> {
|
|
691
|
-
columnDefs: (ColDef<TData> | ColDefGroup<TData>)[];
|
|
692
|
-
rowData: TData[];
|
|
693
|
-
defaultColDef: Partial<ColDef<TData>>;
|
|
694
|
-
columnTypes: Readonly<Record<string, Partial<ColDef<TData>>>>;
|
|
695
|
-
getRowId?: (params: GetRowIdParams<TData>) => string;
|
|
696
|
-
rowKey?: FieldPath<TData> | ((row: TData) => string | number);
|
|
697
|
-
rowHeight: number;
|
|
698
|
-
headerHeight: number;
|
|
699
|
-
rowBuffer: number;
|
|
700
|
-
columnLayout: ColumnLayoutMode;
|
|
701
|
-
enableColumnResize: boolean;
|
|
702
|
-
domLayout: DomLayoutMode;
|
|
703
|
-
rowSelection: RowSelectionMode;
|
|
704
|
-
multiSort: boolean;
|
|
705
|
-
size: GridSize;
|
|
706
|
-
stripedRows: boolean;
|
|
707
|
-
showCellBorders: boolean;
|
|
708
|
-
theme: ThemeMode;
|
|
709
|
-
quickFilterText: string | null;
|
|
710
|
-
advancedFilterModel: AdvancedFilterModel | null;
|
|
711
|
-
masterDetail: boolean;
|
|
712
|
-
detailRowHeight: number;
|
|
713
|
-
detailRowRenderer?: (params: DetailRowRendererParams<TData>) => string | HTMLElement | ICellRendererResult | null | undefined;
|
|
714
|
-
isRowExpandable?: (params: DetailRowRendererParams<TData>) => boolean;
|
|
715
|
-
detailToggleColumn: boolean;
|
|
716
|
-
columnMenu: boolean;
|
|
717
|
-
columnStateKey: string | null;
|
|
718
|
-
columnStateStore?: ColumnStateStore;
|
|
719
|
-
aggFuncs?: Record<string, (values: any[]) => any>;
|
|
720
|
-
components?: GridComponents;
|
|
721
|
-
actionPolicy?: ActionPolicy<TData>;
|
|
722
|
-
features: readonly GridFeature<TData>[];
|
|
723
|
-
initialState?: GridStateInput;
|
|
724
|
-
stateKey: string | null;
|
|
725
|
-
stateStore?: GridStateStore;
|
|
726
|
-
stateSaveDebounceMs: number;
|
|
727
|
-
locale: RgLocale;
|
|
728
|
-
editType: GridEditType;
|
|
729
|
-
editableIndicator: EditableIndicator;
|
|
730
|
-
rowEditValidator?: (params: RowEditValidationParams<TData>) => RowEditValidationResult | Promise<RowEditValidationResult>;
|
|
731
|
-
singleClickEdit: boolean;
|
|
732
|
-
manualSorting: boolean;
|
|
733
|
-
manualFiltering: boolean;
|
|
734
|
-
showSummary: boolean;
|
|
735
|
-
summaryMethod?: (params: {
|
|
736
|
-
colId: string;
|
|
737
|
-
column: Column<any>;
|
|
738
|
-
values: any[];
|
|
739
|
-
}) => string;
|
|
740
|
-
treeData: boolean;
|
|
741
|
-
childrenKey: string;
|
|
742
|
-
isTreeRowExpandable?: (params: Omit<TreeDataLoadParams<TData>, "signal">) => boolean;
|
|
743
|
-
loadTreeChildren?: (params: TreeDataLoadParams<TData>) => Promise<readonly TData[]>;
|
|
744
|
-
autoCheckedChildren: boolean;
|
|
745
|
-
defaultExpandAll: boolean;
|
|
746
|
-
indexOffset: number;
|
|
747
|
-
applyRowDrag: boolean;
|
|
748
|
-
undoStackSize: number;
|
|
749
|
-
asyncTransactionWaitMillis: number;
|
|
750
|
-
getRowHeight?: (params: GetRowHeightParams<TData>) => number;
|
|
751
|
-
pinnedTopRowData: TData[];
|
|
752
|
-
pinnedBottomRowData: TData[];
|
|
753
|
-
paginationEnabled: boolean;
|
|
754
|
-
paginationMode: "client" | "server";
|
|
755
|
-
paginationPage: number;
|
|
756
|
-
paginationTotal: number;
|
|
757
|
-
paginationPageSize: number;
|
|
758
|
-
paginationPageSizeOptions: number[];
|
|
759
|
-
paginationShowTotal: boolean;
|
|
760
|
-
paginationShowSizeSelector: boolean;
|
|
761
|
-
watermarkEnabled: boolean;
|
|
762
|
-
watermarkConfig: WatermarkConfig | null;
|
|
763
|
-
suppressWarnings: boolean;
|
|
764
|
-
enableRangeSelection: boolean;
|
|
765
|
-
suppressClipboard: boolean;
|
|
766
|
-
contextMenu: boolean;
|
|
767
|
-
getContextMenuItems?: (params: ContextMenuParams<TData>) => ContextMenuItem[] | null;
|
|
768
|
-
tooltipComponent?: (params: TooltipParams<TData>) => string | HTMLElement;
|
|
769
|
-
tooltipShowDelay: number;
|
|
770
|
-
flashCells: boolean;
|
|
771
|
-
fillHandle: boolean;
|
|
772
|
-
statusBarEnabled: boolean;
|
|
773
|
-
statusBarPanels: StatusBarPanel[];
|
|
774
|
-
datasource?: GridDatasource<TData>;
|
|
775
|
-
datasourceMode: DatasourceMode;
|
|
776
|
-
blockSize: number;
|
|
777
|
-
infiniteBufferRows: number;
|
|
778
|
-
maxBlocksInCache: number;
|
|
779
|
-
datasourceMaxConcurrentRequests: number;
|
|
780
|
-
blockPrefetch: number;
|
|
781
|
-
datasourceRowCount: number | null;
|
|
782
|
-
dataProcessor?: GridDataProcessor<TData>;
|
|
783
|
-
dataProcessorMinRows: number;
|
|
784
|
-
datasourceRetryCount: number;
|
|
785
|
-
datasourceRetryDelay: number;
|
|
786
|
-
datasourceRetryJitter: number;
|
|
787
|
-
suppressCellFocus: boolean;
|
|
788
|
-
suppressRowHoverHighlight: boolean;
|
|
789
|
-
suppressNoRowsOverlay: boolean;
|
|
790
|
-
suppressHeaderFocus: boolean;
|
|
791
|
-
ariaLabel: string;
|
|
792
|
-
ariaLabelledBy: string;
|
|
793
|
-
ariaDescribedBy: string;
|
|
794
|
-
loading: boolean;
|
|
795
|
-
error: unknown | null;
|
|
796
|
-
overlayNoRowsTemplate: OverlayTemplate;
|
|
797
|
-
overlayLoadingTemplate: OverlayTemplate;
|
|
798
|
-
overlayErrorTemplate: OverlayTemplate;
|
|
799
|
-
allowUnsafeOverlayHtml: boolean;
|
|
800
|
-
className: string;
|
|
666
|
+
type CellRendererOutput = string | HTMLElement | ICellRendererResult | null | undefined;
|
|
667
|
+
interface ICellEditor<TValue = any> {
|
|
668
|
+
el: HTMLElement;
|
|
669
|
+
getValue(): TValue | null | undefined;
|
|
670
|
+
focus?(): void;
|
|
671
|
+
destroy?(): void;
|
|
672
|
+
isCancelBeforeStart?(): boolean;
|
|
673
|
+
isCancelAfterEnd?(value: TValue | null | undefined): boolean;
|
|
801
674
|
}
|
|
802
675
|
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
676
|
+
type SortDirection = "asc" | "desc";
|
|
677
|
+
type PinnedDirection = "left" | "right";
|
|
678
|
+
type FilterType = "text" | "number" | "date" | "set";
|
|
679
|
+
type CellAlign = "left" | "center" | "right";
|
|
680
|
+
type TextFilterMatch = "contains" | "notContains" | "equals" | "notEquals" | "startsWith" | "endsWith" | "blank" | "notBlank";
|
|
681
|
+
type NumberFilterMatch = "equals" | "notEquals" | "lessThan" | "lessThanOrEqual" | "greaterThan" | "greaterThanOrEqual" | "inRange" | "blank" | "notBlank";
|
|
682
|
+
type DateFilterMatch = "equals" | "notEquals" | "lessThan" | "greaterThan" | "inRange" | "blank" | "notBlank";
|
|
683
|
+
interface TextFilterCondition {
|
|
684
|
+
match: TextFilterMatch;
|
|
685
|
+
value?: string;
|
|
811
686
|
}
|
|
812
|
-
interface
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
coerceNumbers?: boolean;
|
|
817
|
-
parseValue?: (params: {
|
|
818
|
-
value: string;
|
|
819
|
-
field: string;
|
|
820
|
-
rowIndex: number;
|
|
821
|
-
columnIndex: number;
|
|
822
|
-
}) => any;
|
|
687
|
+
interface NumberFilterCondition {
|
|
688
|
+
match: NumberFilterMatch;
|
|
689
|
+
value?: number;
|
|
690
|
+
value2?: number;
|
|
823
691
|
}
|
|
824
|
-
interface
|
|
825
|
-
|
|
826
|
-
|
|
692
|
+
interface DateFilterCondition {
|
|
693
|
+
match: DateFilterMatch;
|
|
694
|
+
value?: string;
|
|
695
|
+
value2?: string;
|
|
827
696
|
}
|
|
828
|
-
interface
|
|
829
|
-
|
|
830
|
-
addIndex?: number;
|
|
831
|
-
remove?: TData[];
|
|
832
|
-
update?: TData[];
|
|
697
|
+
interface SetFilterCondition {
|
|
698
|
+
values: (string | number | null)[];
|
|
833
699
|
}
|
|
834
|
-
interface
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
700
|
+
interface TextColumnFilter {
|
|
701
|
+
type: "text";
|
|
702
|
+
operator?: "and" | "or";
|
|
703
|
+
conditions: TextFilterCondition[];
|
|
838
704
|
}
|
|
839
|
-
interface
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
705
|
+
interface NumberColumnFilter {
|
|
706
|
+
type: "number";
|
|
707
|
+
operator?: "and" | "or";
|
|
708
|
+
conditions: NumberFilterCondition[];
|
|
843
709
|
}
|
|
844
|
-
interface
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
timestamp: number;
|
|
849
|
-
context?: Record<string, unknown>;
|
|
710
|
+
interface DateColumnFilter {
|
|
711
|
+
type: "date";
|
|
712
|
+
operator?: "and" | "or";
|
|
713
|
+
conditions: DateFilterCondition[];
|
|
850
714
|
}
|
|
851
|
-
interface
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
averageRenderMs: number;
|
|
855
|
-
maxRenderMs: number;
|
|
856
|
-
p95RenderMs: number;
|
|
857
|
-
longRenderCount: number;
|
|
858
|
-
renderedRows: number;
|
|
859
|
-
renderedColumns: number;
|
|
860
|
-
renderedCells: number;
|
|
861
|
-
layoutSampleCount: number;
|
|
862
|
-
p95LayoutMs: number;
|
|
863
|
-
modelSampleCount: number;
|
|
864
|
-
p95ModelMs: number;
|
|
865
|
-
longTaskCount: number;
|
|
866
|
-
longTaskTotalMs: number;
|
|
867
|
-
usedHeapBytes: number | null;
|
|
715
|
+
interface SetColumnFilter {
|
|
716
|
+
type: "set";
|
|
717
|
+
values: (string | number | null)[];
|
|
868
718
|
}
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
pending: boolean;
|
|
719
|
+
type ColumnFilter = TextColumnFilter | NumberColumnFilter | DateColumnFilter | SetColumnFilter;
|
|
720
|
+
type FilterModel = Record<string, ColumnFilter>;
|
|
721
|
+
interface SortModelItem {
|
|
722
|
+
colId: string;
|
|
723
|
+
direction: SortDirection;
|
|
875
724
|
}
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
activeRequestCount: number;
|
|
880
|
-
queuedRequestCount: number;
|
|
881
|
-
cachedRowCount: number;
|
|
882
|
-
hitCount: number;
|
|
883
|
-
missCount: number;
|
|
884
|
-
evictionCount: number;
|
|
725
|
+
type SortModel = SortModelItem[];
|
|
726
|
+
interface SelectEditorParams {
|
|
727
|
+
values: (string | number)[];
|
|
885
728
|
}
|
|
886
|
-
interface
|
|
887
|
-
|
|
729
|
+
interface SetFilterParams {
|
|
730
|
+
values?: (string | number | null)[];
|
|
731
|
+
maxValues?: number;
|
|
888
732
|
}
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
733
|
+
type CellEditorFactory = (params: CellEditorParams) => ICellEditor;
|
|
734
|
+
type CellRendererFn = (params: CellRendererParams) => string | HTMLElement | ICellRendererResult | null | undefined;
|
|
735
|
+
type CellClassRule = string | string[] | ((params: CellClassParams) => string | string[] | null | undefined);
|
|
736
|
+
type CellStyleRule = Partial<CSSStyleDeclaration> | ((params: CellClassParams<any, any>) => Partial<CSSStyleDeclaration> | null | undefined);
|
|
737
|
+
interface ColDef<TData = any, TValue = any> {
|
|
738
|
+
colId?: string;
|
|
739
|
+
field?: string;
|
|
740
|
+
headerName?: string;
|
|
741
|
+
align?: CellAlign;
|
|
742
|
+
headerAlign?: CellAlign;
|
|
743
|
+
headerClass?: string | string[];
|
|
744
|
+
headerTooltip?: string;
|
|
745
|
+
headerComponent?: (params: HeaderComponentParams<TData>) => string | HTMLElement | ICellRendererResult | null | undefined;
|
|
746
|
+
width?: number;
|
|
747
|
+
minWidth?: number;
|
|
748
|
+
maxWidth?: number;
|
|
749
|
+
flex?: number;
|
|
750
|
+
/** Excludes the column from `columnLayout: "fit"` scaling. */
|
|
751
|
+
suppressSizeToFit?: boolean;
|
|
752
|
+
hide?: boolean;
|
|
753
|
+
pinned?: PinnedDirection | boolean;
|
|
754
|
+
sortable?: boolean;
|
|
755
|
+
resizable?: boolean;
|
|
756
|
+
movable?: boolean;
|
|
757
|
+
filter?: boolean | FilterType;
|
|
758
|
+
filterParams?: SetFilterParams;
|
|
759
|
+
editable?: boolean | ((params: EditableParams<TData, TValue>) => boolean);
|
|
760
|
+
cellEditor?: "text" | "number" | "date" | "select" | CellEditorFactory | string;
|
|
761
|
+
cellEditorParams?: SelectEditorParams;
|
|
762
|
+
wrapText?: boolean;
|
|
763
|
+
checkboxSelection?: boolean;
|
|
764
|
+
rowGroup?: boolean;
|
|
765
|
+
aggFunc?: string;
|
|
766
|
+
cellStyle?: CellStyleRule;
|
|
767
|
+
selectable?: (params: CellClassParams<TData, TValue>) => boolean;
|
|
768
|
+
singleClickEdit?: boolean;
|
|
769
|
+
tooltipValueGetter?: (params: ValueFormatterParams<TData, TValue>) => string | null | undefined;
|
|
770
|
+
rowSpan?: (params: CellClassParams<TData, TValue>) => number;
|
|
771
|
+
autoRowSpan?: boolean;
|
|
772
|
+
colSpan?: (params: CellClassParams<TData, TValue>) => number;
|
|
773
|
+
autoHeight?: boolean;
|
|
774
|
+
validate?: (newValue: TValue, params: ValueSetterParams<TData, TValue>) => string | true | null | undefined | Promise<string | true | null | undefined>;
|
|
775
|
+
rowDrag?: boolean;
|
|
776
|
+
valueGetter?: (params: ValueGetterParams<TData, TValue>) => TValue;
|
|
777
|
+
valueSetter?: (params: ValueSetterParams<TData, TValue>) => boolean;
|
|
778
|
+
valueFormatter?: (params: ValueFormatterParams<TData, TValue>) => any;
|
|
779
|
+
cellRenderer?: CellRendererFn | string;
|
|
780
|
+
cellRendererParams?: Record<string, any>;
|
|
781
|
+
cellClass?: CellClassRule;
|
|
782
|
+
comparator?: (valueA: any, valueB: any, nodeA: RowNode<TData>, nodeB: RowNode<TData>) => number;
|
|
783
|
+
/** Named column type(s), resolved left-to-right before this column definition. */
|
|
784
|
+
type?: string | readonly string[];
|
|
785
|
+
initialSort?: SortDirection;
|
|
786
|
+
onCellClick?: (event: CellClickEvent<TData, TValue>) => void;
|
|
787
|
+
onCellDoubleClick?: (event: CellDoubleClickEvent<TData, TValue>) => void;
|
|
900
788
|
}
|
|
901
|
-
interface
|
|
789
|
+
interface ColDefGroup<TData = any> {
|
|
790
|
+
groupId?: string;
|
|
791
|
+
headerName?: string;
|
|
792
|
+
headerClass?: string | string[];
|
|
793
|
+
children: (ColDefGroup<TData> | ColDef<TData>)[];
|
|
794
|
+
}
|
|
795
|
+
type ColDefOrGroup<TData = any> = ColDefGroup<TData> | ColDef<TData>;
|
|
796
|
+
declare function isColDefGroup<TData = any>(def: ColDefOrGroup<TData>): def is ColDefGroup<TData>;
|
|
797
|
+
interface ColumnState {
|
|
902
798
|
colId: string;
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
799
|
+
hide?: boolean;
|
|
800
|
+
width?: number;
|
|
801
|
+
/** Active flex weight. A resize clears flex and turns width into a manual override. */
|
|
802
|
+
flex?: number | null;
|
|
803
|
+
/** Distinguishes responsive/definition width from an explicit user or API override. */
|
|
804
|
+
widthMode?: "auto" | "manual";
|
|
805
|
+
pinned?: "left" | "right" | null;
|
|
909
806
|
}
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
selectedRowCount: number;
|
|
920
|
-
dirtyRowCount: number;
|
|
921
|
-
activeFeatures: ReadonlyArray<{
|
|
922
|
-
key: string;
|
|
923
|
-
version?: string;
|
|
924
|
-
}>;
|
|
925
|
-
performance: GridPerformanceSnapshot;
|
|
926
|
-
updates: GridUpdateSchedulerSnapshot;
|
|
927
|
-
recentErrors: readonly GridDiagnosticError[];
|
|
807
|
+
|
|
808
|
+
declare class ColumnGroup<TData = any> {
|
|
809
|
+
readonly groupId: string;
|
|
810
|
+
readonly def: ColDefGroup<TData>;
|
|
811
|
+
parent: ColumnGroup<TData> | null;
|
|
812
|
+
children: (ColumnGroup<TData> | Column<TData>)[];
|
|
813
|
+
constructor(groupId: string, def: ColDefGroup<TData>);
|
|
814
|
+
get headerName(): string;
|
|
815
|
+
getLeafColumns(out?: Column<TData>[]): Column<TData>[];
|
|
928
816
|
}
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
817
|
+
|
|
818
|
+
declare class Column<TData = any> {
|
|
819
|
+
readonly id: string;
|
|
820
|
+
readonly colDef: ColDef<TData>;
|
|
821
|
+
hide: boolean;
|
|
822
|
+
pinned: PinnedDirection | null;
|
|
823
|
+
manualWidth: number | null;
|
|
824
|
+
flex: number | null;
|
|
825
|
+
currentWidth: number;
|
|
826
|
+
parentGroup: ColumnGroup<TData> | null;
|
|
827
|
+
level: number;
|
|
828
|
+
isDetailToggle: boolean;
|
|
829
|
+
constructor(id: string, colDef: ColDef<TData>);
|
|
830
|
+
get sortable(): boolean;
|
|
831
|
+
get resizable(): boolean;
|
|
832
|
+
get movable(): boolean;
|
|
833
|
+
get filterable(): boolean;
|
|
834
|
+
get filterType(): FilterType;
|
|
835
|
+
get hasCheckbox(): boolean;
|
|
836
|
+
resetWidth(): void;
|
|
939
837
|
}
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
838
|
+
|
|
839
|
+
declare const DEFAULT_LOCALE: {
|
|
840
|
+
readonly matchContains: "包含";
|
|
841
|
+
readonly matchNotContains: "不包含";
|
|
842
|
+
readonly matchEquals: "等于";
|
|
843
|
+
readonly matchNotEquals: "不等于";
|
|
844
|
+
readonly matchStartsWith: "开头是";
|
|
845
|
+
readonly matchEndsWith: "结尾是";
|
|
846
|
+
readonly matchBlank: "为空";
|
|
847
|
+
readonly matchNotBlank: "不为空";
|
|
848
|
+
readonly matchLessThan: "小于";
|
|
849
|
+
readonly matchLessThanOrEqual: "小于等于";
|
|
850
|
+
readonly matchGreaterThan: "大于";
|
|
851
|
+
readonly matchGreaterThanOrEqual: "大于等于";
|
|
852
|
+
readonly matchInRange: "在范围内";
|
|
853
|
+
readonly apply: "应用";
|
|
854
|
+
readonly reset: "重置";
|
|
855
|
+
readonly search: "搜索...";
|
|
856
|
+
readonly emptySetLabel: "(空)";
|
|
857
|
+
readonly selectedCount: "已选 {n} 项";
|
|
858
|
+
readonly sortAsc: "升序";
|
|
859
|
+
readonly sortDesc: "降序";
|
|
860
|
+
readonly clearSort: "取消排序";
|
|
861
|
+
readonly pinLeft: "固定左侧";
|
|
862
|
+
readonly pinRight: "固定右侧";
|
|
863
|
+
readonly clearPin: "取消固定";
|
|
864
|
+
readonly autoSize: "自适应列宽";
|
|
865
|
+
readonly hideColumn: "隐藏此列";
|
|
866
|
+
readonly columnVisibility: "列显示";
|
|
867
|
+
readonly resetAll: "重置全部";
|
|
868
|
+
readonly autoSizeAll: "全部自适应";
|
|
869
|
+
readonly columnSettings: "列设置";
|
|
870
|
+
readonly totalLabel: "合计";
|
|
871
|
+
readonly totalRowsLabel: "共 {n} 行";
|
|
872
|
+
readonly menuCopy: "复制";
|
|
873
|
+
readonly menuPaste: "粘贴";
|
|
874
|
+
readonly menuClearContents: "清除内容";
|
|
875
|
+
readonly loading: "加载中...";
|
|
876
|
+
readonly statusSelected: "已选 {n} 行";
|
|
877
|
+
readonly statusSum: "和 {n}";
|
|
878
|
+
readonly statusAvg: "均 {n}";
|
|
879
|
+
readonly statusCount: "计 {n}";
|
|
880
|
+
readonly emptyRows: "暂无数据";
|
|
881
|
+
readonly emptyRowsHint: "没有可显示的行";
|
|
882
|
+
readonly paginationTotal: "共 {n} 条";
|
|
883
|
+
readonly paginationPage: "第 {a} / {b} 页";
|
|
884
|
+
readonly perPage: "{n} 条/页";
|
|
885
|
+
readonly pageFirst: "首页";
|
|
886
|
+
readonly pagePrev: "上一页";
|
|
887
|
+
readonly pageNext: "下一页";
|
|
888
|
+
readonly pageLast: "末页";
|
|
889
|
+
readonly requestFailed: "数据加载失败";
|
|
890
|
+
readonly requestFailedHint: "请检查网络后重试";
|
|
891
|
+
readonly actionView: "查看";
|
|
892
|
+
readonly actionEdit: "编辑";
|
|
893
|
+
readonly actionDelete: "删除";
|
|
894
|
+
readonly actionConfirm: "确认";
|
|
895
|
+
readonly actionSave: "保存";
|
|
896
|
+
readonly actionCancel: "取消";
|
|
897
|
+
readonly actionMore: "更多操作";
|
|
898
|
+
};
|
|
899
|
+
type MachTableLocaleKey = keyof typeof DEFAULT_LOCALE;
|
|
900
|
+
type MachTableLocale = Partial<Record<MachTableLocaleKey, string>>;
|
|
901
|
+
declare const LOCALE_EN: MachTableLocale;
|
|
902
|
+
declare function matchLocaleKey(match: string): MachTableLocaleKey;
|
|
903
|
+
declare function formatText(template: string, n: number | string): string;
|
|
904
|
+
declare function formatTwo(template: string, a: number | string, b: number | string): string;
|
|
905
|
+
|
|
906
|
+
type Callable = (...args: never[]) => unknown;
|
|
907
|
+
type Primitive = string | number | boolean | bigint | symbol | null | undefined | Date | Callable;
|
|
908
|
+
type Depth = 0 | 1 | 2 | 3 | 4;
|
|
909
|
+
type Previous = {
|
|
910
|
+
0: 0;
|
|
911
|
+
1: 0;
|
|
912
|
+
2: 1;
|
|
913
|
+
3: 2;
|
|
914
|
+
4: 3;
|
|
915
|
+
};
|
|
916
|
+
/** Dot-separated path to a serializable field, capped to keep editor inference fast. */
|
|
917
|
+
type FieldPath<T, D extends Depth = 4> = D extends 0 ? never : T extends Primitive ? never : {
|
|
918
|
+
[K in keyof T & string]: NonNullable<T[K]> extends Primitive | readonly unknown[] ? K : K | `${K}.${FieldPath<NonNullable<T[K]>, Previous[D]>}`;
|
|
919
|
+
}[keyof T & string];
|
|
920
|
+
type FieldPathValue<T, P extends string> = P extends keyof T ? T[P] : P extends `${infer Head}.${infer Tail}` ? Head extends keyof T ? FieldPathValue<NonNullable<T[Head]>, Tail> : unknown : unknown;
|
|
921
|
+
|
|
922
|
+
interface GridStateStore {
|
|
923
|
+
load(key: string): GridStateInput | null | Promise<GridStateInput | null>;
|
|
924
|
+
save(key: string, state: GridStateInput): void | Promise<void>;
|
|
925
|
+
clear?(key: string): void | Promise<void>;
|
|
946
926
|
}
|
|
947
|
-
interface
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
927
|
+
interface GridPersistenceOptions {
|
|
928
|
+
/** Stable storage key; namespace it by application, user and table. */
|
|
929
|
+
key: string;
|
|
930
|
+
/** Saved and restored state sections. Defaults to every section. */
|
|
931
|
+
sections?: readonly GridStateSection[];
|
|
932
|
+
store?: GridStateStore;
|
|
933
|
+
debounceMs?: number;
|
|
952
934
|
}
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
stop(cancel?: boolean): Promise<boolean>;
|
|
935
|
+
/** Per-grid component overrides. These take precedence over the global registry. */
|
|
936
|
+
interface GridComponents {
|
|
937
|
+
cellRenderers?: Readonly<Record<string, CellRendererFn>>;
|
|
938
|
+
cellEditors?: Readonly<Record<string, CellEditorFactory>>;
|
|
958
939
|
}
|
|
959
|
-
interface
|
|
960
|
-
|
|
961
|
-
|
|
940
|
+
interface GridFeatureContext<TData = any> {
|
|
941
|
+
readonly api: GridApi<TData>;
|
|
942
|
+
readonly root: HTMLElement;
|
|
943
|
+
getOptions(): Readonly<ResolvedGridOptions<TData>>;
|
|
944
|
+
addEventListener<K extends keyof GridEventMap<TData>>(type: K, listener: (event: GridEventMap<TData>[K]) => void): () => void;
|
|
945
|
+
/** Registers cleanup even when setup later throws or the feature is hot-replaced. */
|
|
946
|
+
onCleanup(cleanup: () => void): void;
|
|
947
|
+
addManagedDomListener(target: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
948
|
+
setManagedTimeout(handler: () => void, delayMs: number): ReturnType<typeof setTimeout>;
|
|
949
|
+
createAbortController(): AbortController;
|
|
950
|
+
reportError(error: unknown, source: string, context?: Record<string, unknown>): void;
|
|
962
951
|
}
|
|
963
|
-
interface
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
952
|
+
interface GridFeatureRequirement {
|
|
953
|
+
key: string;
|
|
954
|
+
/** Semver range, for example `>=0.18 <1`, `^0.18.0` or an exact version. */
|
|
955
|
+
version?: string;
|
|
967
956
|
}
|
|
968
|
-
/**
|
|
969
|
-
interface
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
957
|
+
/** Composable extension point; feature instances are scoped to one grid. */
|
|
958
|
+
interface GridFeature<TData = any> {
|
|
959
|
+
readonly key: string;
|
|
960
|
+
/** Informational extension version exposed through diagnostics. */
|
|
961
|
+
readonly version?: string;
|
|
962
|
+
/** Feature keys that must be initialised before this feature. */
|
|
963
|
+
readonly requires?: readonly (string | GridFeatureRequirement)[];
|
|
964
|
+
/** Mutually exclusive feature keys. Conflicting features are not initialised. */
|
|
965
|
+
readonly conflicts?: readonly string[];
|
|
966
|
+
setup(context: GridFeatureContext<TData>): void | (() => void);
|
|
967
|
+
destroy?(): void;
|
|
977
968
|
}
|
|
978
|
-
/**
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
getTotalRowCount(): number;
|
|
969
|
+
/**
|
|
970
|
+
* Safe overlay content. Strings render as text unless
|
|
971
|
+
* `allowUnsafeOverlayHtml` is explicitly enabled.
|
|
972
|
+
*/
|
|
973
|
+
type OverlayContent = string | HTMLElement | ICellRendererResult;
|
|
974
|
+
type OverlayTemplate = OverlayContent | (() => OverlayContent);
|
|
975
|
+
type StatusBarPanel = "rowCount" | "selectedRowCount" | "rangeAggregate";
|
|
976
|
+
interface StatusBarConfig {
|
|
977
|
+
panels?: StatusBarPanel[];
|
|
988
978
|
}
|
|
989
|
-
interface
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
979
|
+
interface InfiniteGetRowsParams<TData = any> {
|
|
980
|
+
startRow: number;
|
|
981
|
+
endRow: number;
|
|
982
|
+
sortModel: SortModel;
|
|
983
|
+
filterModel: FilterModel;
|
|
984
|
+
advancedFilterModel: AdvancedFilterModel | null;
|
|
985
|
+
quickFilterText: string | null;
|
|
986
|
+
signal: AbortSignal;
|
|
987
|
+
onSuccess(rows: TData[], lastRow?: number): void;
|
|
988
|
+
fail(reason?: unknown): void;
|
|
995
989
|
}
|
|
996
|
-
interface
|
|
997
|
-
|
|
998
|
-
serverVersion?: string | number;
|
|
990
|
+
interface GridDatasource<TData = any> {
|
|
991
|
+
getRows(params: InfiniteGetRowsParams<TData>): void | Promise<void>;
|
|
999
992
|
}
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
993
|
+
type DatasourceMode = "sequential" | "block";
|
|
994
|
+
interface GridDataProcessorColumn {
|
|
995
|
+
colId: string;
|
|
996
|
+
/** Serializable field path when the column has one. */
|
|
997
|
+
field?: string;
|
|
1005
998
|
}
|
|
1006
|
-
interface
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
failures: SaveChangeIssue[];
|
|
1010
|
-
conflicts: SaveChangeConflict<TData>[];
|
|
999
|
+
interface GridDataProcessorRow<TData = any> {
|
|
1000
|
+
id: string;
|
|
1001
|
+
data: TData;
|
|
1011
1002
|
}
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
readonly diagnostics: GridDiagnosticsApi;
|
|
1021
|
-
readonly filtering: GridFilteringApi;
|
|
1022
|
-
readonly pagination: GridPaginationApi;
|
|
1023
|
-
/** Coalesces model/layout/render work from nested synchronous API calls. */
|
|
1024
|
-
batch<TResult>(callback: (api: GridApi<TData>) => TResult): TResult;
|
|
1025
|
-
/** Flushes deferred work; normally only needed by tests and imperative measurements. */
|
|
1026
|
-
flushUpdates(): void;
|
|
1027
|
-
/** Resolves after the first layout frame and gridReady emission. */
|
|
1028
|
-
whenReady(): Promise<GridApi<TData>>;
|
|
1029
|
-
/** Stable grid root for portals, measurements and fullscreen targets; null after destroy. */
|
|
1030
|
-
getRootElement(): HTMLElement | null;
|
|
1031
|
-
/** Reads the currently resolved value after application, preset and table overrides. */
|
|
1032
|
-
getGridOption<K extends keyof GridOptions<TData>>(key: K): GridOptions<TData>[K];
|
|
1033
|
-
/** Typed shorthand for updating one runtime option. */
|
|
1034
|
-
setGridOption<K extends keyof GridOptions<TData>>(key: K, value: GridOptions<TData>[K]): void;
|
|
1035
|
-
setRowData(rows: TData[] | null | undefined): void;
|
|
1036
|
-
applyTransaction(transaction: RowTransaction<TData>): void;
|
|
1037
|
-
/** Coalesces rapid transactions and refreshes the row pipeline once per batch. */
|
|
1038
|
-
applyTransactionAsync(transaction: RowTransaction<TData>, options?: GridAsyncOptions): Promise<void>;
|
|
1039
|
-
/** Immediately applies transactions currently waiting in the async queue. */
|
|
1040
|
-
flushAsyncTransactions(): void;
|
|
1041
|
-
getColumnDefs(): (ColDef<TData> | ColDefGroup<TData>)[] | null;
|
|
1042
|
-
setColumnDefs(colDefs: (ColDef<TData> | ColDefGroup<TData>)[] | null | undefined): void;
|
|
1043
|
-
getColumnState(): ColumnState[];
|
|
1044
|
-
setColumnState(state: ColumnState[]): void;
|
|
1045
|
-
resetColumnState(): void;
|
|
1046
|
-
setColumnVisibility(colId: string, visible: boolean): void;
|
|
1047
|
-
moveColumn(colId: string, toIndex: number): void;
|
|
1048
|
-
setColumnPinned(colId: string, pinned: "left" | "right" | null): void;
|
|
1049
|
-
/** Sets one width without replacing the rest of the column state. */
|
|
1050
|
-
setColumnWidth(colId: string, width: number): boolean;
|
|
1051
|
-
sizeColumnsToFit(width?: number): void;
|
|
1052
|
-
autoSizeColumn(colId: string, skipHeader?: boolean): void;
|
|
1053
|
-
autoSizeAllColumns(skipHeader?: boolean): void;
|
|
1054
|
-
getSortModel(): SortModel;
|
|
1055
|
-
setSortModel(sortModel: SortModel | null): void;
|
|
1056
|
-
getFilterModel(): FilterModel;
|
|
1057
|
-
setFilterModel(filterModel: FilterModel | null): void;
|
|
1058
|
-
getAdvancedFilterModel(): AdvancedFilterModel | null;
|
|
1059
|
-
setAdvancedFilterModel(model: AdvancedFilterModel | null): void;
|
|
1060
|
-
isColumnFilterPresent(colId: string): boolean;
|
|
1061
|
-
setQuickFilter(text: string | null | undefined): void;
|
|
1062
|
-
getQuickFilter(): string | null;
|
|
1063
|
-
getRowSelection(): RowSelectionMode;
|
|
1064
|
-
setRowSelection(mode: RowSelectionMode): void;
|
|
1065
|
-
getSelectedNodes(): RowNode<TData>[];
|
|
1066
|
-
getSelectedRows(): TData[];
|
|
1067
|
-
selectNodeById(nodeId: string, selected?: boolean, clearOthers?: boolean): void;
|
|
1068
|
-
selectAll(filteredOnly?: boolean): void;
|
|
1069
|
-
deselectAll(): void;
|
|
1070
|
-
getDisplayedRowCount(): number;
|
|
1071
|
-
getRowNode(rowIndex: number): RowNode<TData> | undefined;
|
|
1072
|
-
getNodeById(id: string): RowNode<TData> | undefined;
|
|
1073
|
-
forEachNode(callback: (node: RowNode<TData>, index: number) => void): void;
|
|
1074
|
-
forEachNodeAfterFilterAndSort(callback: (node: RowNode<TData>, index: number) => void): void;
|
|
1075
|
-
scrollToIndex(rowIndex: number, position?: "top" | "bottom" | "middle" | "nearest"): void;
|
|
1076
|
-
expandRow(rowId: string): boolean;
|
|
1077
|
-
collapseRow(rowId: string): boolean;
|
|
1078
|
-
toggleDetailRow(rowId: string): boolean;
|
|
1079
|
-
isRowExpanded(rowId: string): boolean;
|
|
1080
|
-
expandAllDetails(): void;
|
|
1081
|
-
collapseAllDetails(): void;
|
|
1082
|
-
/** Loads and caches lazy tree children. Concurrent calls for one row are deduplicated. */
|
|
1083
|
-
loadTreeChildren(rowId: string, options?: {
|
|
1084
|
-
force?: boolean;
|
|
1085
|
-
}): Promise<readonly TData[]>;
|
|
1086
|
-
retryTreeChildren(rowId: string): Promise<readonly TData[]>;
|
|
1087
|
-
isTreeRowLoading(rowId: string): boolean;
|
|
1088
|
-
toggleRowGroup(groupId: string): boolean;
|
|
1089
|
-
isGroupExpanded(groupId: string): boolean;
|
|
1090
|
-
expandAllGroups(): void;
|
|
1091
|
-
collapseAllGroups(): void;
|
|
1092
|
-
reorderRows(fromIndex: number, toIndex: number): boolean;
|
|
1093
|
-
setSelection(rows: TData[], clearOthers?: boolean): void;
|
|
1094
|
-
getVisibleSelection(): TData[];
|
|
1095
|
-
getSelectedIds(): string[];
|
|
1096
|
-
undo(): boolean;
|
|
1097
|
-
redo(): boolean;
|
|
1098
|
-
canUndo(): boolean;
|
|
1099
|
-
canRedo(): boolean;
|
|
1100
|
-
getDirtyRowIds(): string[];
|
|
1101
|
-
getChanges(): GridChange<TData>[];
|
|
1102
|
-
markChangesSaved(rowIds?: readonly string[]): void;
|
|
1103
|
-
/** Saves a stable snapshot; supports partial success and preserves edits made in flight. */
|
|
1104
|
-
saveChanges(handler: SaveChangesHandler<TData>, rowIds?: readonly string[]): Promise<GridChange<TData>[]>;
|
|
1105
|
-
saveChangesDetailed(handler: SaveChangesHandler<TData>, rowIds?: readonly string[]): Promise<GridBatchSaveResult<TData>>;
|
|
1106
|
-
rollbackChanges(rowIds?: readonly string[]): boolean;
|
|
1107
|
-
setPinnedTopRowData(rows: TData[] | null): void;
|
|
1108
|
-
getPinnedTopRowData(): TData[];
|
|
1109
|
-
setPinnedBottomRowData(rows: TData[] | null): void;
|
|
1110
|
-
getPinnedBottomRowData(): TData[];
|
|
1111
|
-
getRangeSelection(): GridCellRange | null;
|
|
1112
|
-
clearRangeSelection(): void;
|
|
1113
|
-
copyRangeToClipboard(): Promise<boolean>;
|
|
1114
|
-
/** Opens the built-in searchable column workbench. */
|
|
1115
|
-
openColumnWorkbench(anchor?: HTMLElement): void;
|
|
1116
|
-
closeColumnWorkbench(): void;
|
|
1117
|
-
getColumnWorkbenchItems(): ColumnWorkbenchItem[];
|
|
1118
|
-
/** @deprecated Use openColumnWorkbench. Kept during the 0.x compatibility window. */
|
|
1119
|
-
openColumnPanel(anchor?: HTMLElement): void;
|
|
1120
|
-
refreshLayout(): void;
|
|
1121
|
-
isInfinite(): boolean;
|
|
1122
|
-
reload(options?: GridAsyncOptions): Promise<void>;
|
|
1123
|
-
/** Ensures an inclusive/exclusive remote row range is cached in random-access block mode. */
|
|
1124
|
-
ensureRowsLoaded(startRow: number, endRow: number, options?: GridAsyncOptions): Promise<void>;
|
|
1125
|
-
/** Aborts block requests and removes all random-access datasource blocks. */
|
|
1126
|
-
purgeDatasourceCache(): void;
|
|
1127
|
-
getDatasourceCacheSnapshot(): RemoteBlockCacheSnapshot;
|
|
1128
|
-
paginationEnabled(): boolean;
|
|
1129
|
-
setPaginationEnabled(enabled: boolean): void;
|
|
1130
|
-
getPage(): number;
|
|
1131
|
-
setPage(page: number): void;
|
|
1132
|
-
getPageSize(): number;
|
|
1133
|
-
setPageSize(size: number): void;
|
|
1134
|
-
getPageCount(): number;
|
|
1135
|
-
getTotalRowCount(): number;
|
|
1136
|
-
importCsv(text: string, options?: ImportCsvOptions): boolean;
|
|
1137
|
-
print(options?: PrintOptions): boolean;
|
|
1138
|
-
startEditingCell(params: {
|
|
1139
|
-
rowIndex: number;
|
|
1140
|
-
colId: string;
|
|
1141
|
-
keyPress?: string;
|
|
1142
|
-
}): boolean;
|
|
1143
|
-
/** Starts staged editing for every editable cell in one displayed row. */
|
|
1144
|
-
startEditingRow(rowIndex: number): boolean;
|
|
1145
|
-
/** Returns whether any row, or the requested displayed row, is in full-row edit mode. */
|
|
1146
|
-
isRowEditing(rowIndex?: number): boolean;
|
|
1147
|
-
stopEditing(cancel?: boolean): void;
|
|
1148
|
-
/** Stops editing and resolves after synchronous or asynchronous validation. */
|
|
1149
|
-
stopEditingAsync(cancel?: boolean): Promise<boolean>;
|
|
1150
|
-
/** Explicit full-row counterpart; aliases stopEditingAsync when a row is active. */
|
|
1151
|
-
stopEditingRow(cancel?: boolean): Promise<boolean>;
|
|
1152
|
-
refreshCells(params?: RefreshCellsParams): void;
|
|
1153
|
-
updateOptions(options: Partial<GridOptions<TData>>): void;
|
|
1154
|
-
getDataAsCsv(params?: CsvExportParams): string;
|
|
1155
|
-
getState(): GridState;
|
|
1156
|
-
applyState(state: GridStateInput, options?: ApplyGridStateOptions): void;
|
|
1157
|
-
/** Lightweight runtime snapshot suitable for support logs and health panels. */
|
|
1158
|
-
getDiagnostics(): GridDiagnostics;
|
|
1159
|
-
/** Rolling viewport-render metrics for diagnostics and reproducible benchmarks. */
|
|
1160
|
-
getPerformanceSnapshot(): GridPerformanceSnapshot;
|
|
1161
|
-
resetPerformanceMetrics(): void;
|
|
1162
|
-
setOverlay(type: "loading" | "noRows" | "error" | null): void;
|
|
1163
|
-
hideOverlays(): void;
|
|
1164
|
-
addEventListener<K extends GridEventType>(eventType: K, listener: (event: GridEventMap<TData>[K]) => void): () => void;
|
|
1165
|
-
removeEventListener<K extends GridEventType>(eventType: K, listener: (event: GridEventMap<TData>[K]) => void): void;
|
|
1166
|
-
destroy(): void;
|
|
1167
|
-
isDestroyed(): boolean;
|
|
1168
|
-
}
|
|
1169
|
-
|
|
1170
|
-
interface ValueGetterParams<TData = any, TValue = any> {
|
|
1171
|
-
data: TData | null;
|
|
1172
|
-
node: RowNode<TData>;
|
|
1173
|
-
colDef: ColDef<TData, TValue>;
|
|
1174
|
-
column: Column<TData>;
|
|
1175
|
-
api: GridApi<TData>;
|
|
1176
|
-
}
|
|
1177
|
-
interface ValueFormatterParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
1178
|
-
value: TValue;
|
|
1179
|
-
}
|
|
1180
|
-
interface CellRendererParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
1181
|
-
value: TValue;
|
|
1182
|
-
formatted: string;
|
|
1183
|
-
rowIndex: number;
|
|
1184
|
-
rendererParams?: Record<string, any>;
|
|
1185
|
-
}
|
|
1186
|
-
interface CellClassParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
1187
|
-
value: TValue;
|
|
1188
|
-
rowIndex: number;
|
|
1189
|
-
}
|
|
1190
|
-
interface EditableParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
1191
|
-
value: TValue;
|
|
1192
|
-
rowIndex: number;
|
|
1003
|
+
interface GridDataProcessorRequest<TData = any> {
|
|
1004
|
+
rows: readonly GridDataProcessorRow<TData>[];
|
|
1005
|
+
columns: readonly GridDataProcessorColumn[];
|
|
1006
|
+
sortModel: SortModel;
|
|
1007
|
+
filterModel: FilterModel;
|
|
1008
|
+
advancedFilterModel: AdvancedFilterModel | null;
|
|
1009
|
+
quickFilterText: string | null;
|
|
1010
|
+
signal: AbortSignal;
|
|
1193
1011
|
}
|
|
1194
|
-
interface
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
keyPress?: string | null;
|
|
1012
|
+
interface GridDataProcessorResult {
|
|
1013
|
+
/** Filtered and sorted stable row IDs, in final display order. */
|
|
1014
|
+
rowIds: readonly string[];
|
|
1198
1015
|
}
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
node: RowNode<TData>;
|
|
1204
|
-
colDef: ColDef<TData, TValue>;
|
|
1205
|
-
column: Column<TData>;
|
|
1206
|
-
api: GridApi<TData>;
|
|
1016
|
+
/** Optional async/Worker boundary for expensive local filtering and sorting. */
|
|
1017
|
+
interface GridDataProcessor<TData = any> {
|
|
1018
|
+
process(request: GridDataProcessorRequest<TData>): Promise<GridDataProcessorResult>;
|
|
1019
|
+
destroy?(): void;
|
|
1207
1020
|
}
|
|
1208
|
-
|
|
1021
|
+
type EventHandlers<TData = any> = {
|
|
1022
|
+
[K in keyof GridEventMap<TData> as `on${Capitalize<K & string>}`]?: (event: GridEventMap<TData>[K]) => void;
|
|
1023
|
+
};
|
|
1024
|
+
type RowSelectionMode = "none" | "single" | "multiple";
|
|
1025
|
+
type GridSize = "compact" | "normal" | "large";
|
|
1026
|
+
type ColumnLayoutMode = "normal" | "fit";
|
|
1027
|
+
type DomLayoutMode = "normal" | "autoHeight";
|
|
1028
|
+
type ThemeMode = "light" | "dark" | "auto";
|
|
1029
|
+
type GridEditType = "cell" | "fullRow";
|
|
1030
|
+
type EditableIndicator = "hover" | "always" | "none";
|
|
1031
|
+
interface RowEditValidationParams<TData = any> {
|
|
1209
1032
|
data: TData;
|
|
1210
|
-
index: number;
|
|
1211
|
-
api: GridApi<TData>;
|
|
1212
|
-
}
|
|
1213
|
-
interface GetRowHeightParams<TData = any> {
|
|
1214
|
-
data: TData | null;
|
|
1215
1033
|
node: RowNode<TData>;
|
|
1034
|
+
/** Draft values keyed by colId, including unchanged editable cells. */
|
|
1035
|
+
values: Readonly<Record<string, unknown>>;
|
|
1036
|
+
changes: readonly RowEditChange[];
|
|
1216
1037
|
api: GridApi<TData>;
|
|
1217
1038
|
}
|
|
1218
|
-
|
|
1039
|
+
type RowEditValidationResult = true | null | undefined | string | Readonly<Record<string, string>>;
|
|
1040
|
+
interface DetailRowRendererParams<TData = any> {
|
|
1219
1041
|
data: TData | null;
|
|
1220
1042
|
node: RowNode<TData>;
|
|
1221
1043
|
api: GridApi<TData>;
|
|
1222
|
-
colId: string;
|
|
1223
|
-
value: any;
|
|
1224
|
-
formatted: string;
|
|
1225
|
-
rowIndex: number;
|
|
1226
1044
|
}
|
|
1227
|
-
interface
|
|
1228
|
-
data: TData
|
|
1045
|
+
interface TreeDataLoadParams<TData = any> {
|
|
1046
|
+
data: TData;
|
|
1229
1047
|
node: RowNode<TData>;
|
|
1230
1048
|
api: GridApi<TData>;
|
|
1231
|
-
|
|
1232
|
-
value: any;
|
|
1233
|
-
rowIndex: number;
|
|
1234
|
-
}
|
|
1235
|
-
interface ContextMenuItem {
|
|
1236
|
-
label?: string;
|
|
1237
|
-
action?: () => void;
|
|
1238
|
-
danger?: boolean;
|
|
1239
|
-
disabled?: boolean;
|
|
1240
|
-
separator?: boolean;
|
|
1241
|
-
}
|
|
1242
|
-
interface HeaderComponentParams<TData = any> {
|
|
1243
|
-
colDef: ColDef<TData>;
|
|
1244
|
-
column: Column<TData>;
|
|
1245
|
-
api: GridApi<TData>;
|
|
1246
|
-
}
|
|
1247
|
-
interface ICellRendererResult {
|
|
1248
|
-
el: HTMLElement;
|
|
1249
|
-
/** Reuses the mounted renderer for an update. Return false to request recreation. */
|
|
1250
|
-
refresh?(params: CellRendererParams): boolean | void;
|
|
1251
|
-
destroy?: () => void;
|
|
1252
|
-
}
|
|
1253
|
-
type CellRendererOutput = string | HTMLElement | ICellRendererResult | null | undefined;
|
|
1254
|
-
interface ICellEditor<TValue = any> {
|
|
1255
|
-
el: HTMLElement;
|
|
1256
|
-
getValue(): TValue | null | undefined;
|
|
1257
|
-
focus?(): void;
|
|
1258
|
-
destroy?(): void;
|
|
1259
|
-
isCancelBeforeStart?(): boolean;
|
|
1260
|
-
isCancelAfterEnd?(value: TValue | null | undefined): boolean;
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1263
|
-
type SortDirection = "asc" | "desc";
|
|
1264
|
-
type PinnedDirection = "left" | "right";
|
|
1265
|
-
type FilterType = "text" | "number" | "date" | "set";
|
|
1266
|
-
type CellAlign = "left" | "center" | "right";
|
|
1267
|
-
type TextFilterMatch = "contains" | "notContains" | "equals" | "notEquals" | "startsWith" | "endsWith" | "blank" | "notBlank";
|
|
1268
|
-
type NumberFilterMatch = "equals" | "notEquals" | "lessThan" | "lessThanOrEqual" | "greaterThan" | "greaterThanOrEqual" | "inRange" | "blank" | "notBlank";
|
|
1269
|
-
type DateFilterMatch = "equals" | "notEquals" | "lessThan" | "greaterThan" | "inRange" | "blank" | "notBlank";
|
|
1270
|
-
interface TextFilterCondition {
|
|
1271
|
-
match: TextFilterMatch;
|
|
1272
|
-
value?: string;
|
|
1273
|
-
}
|
|
1274
|
-
interface NumberFilterCondition {
|
|
1275
|
-
match: NumberFilterMatch;
|
|
1276
|
-
value?: number;
|
|
1277
|
-
value2?: number;
|
|
1278
|
-
}
|
|
1279
|
-
interface DateFilterCondition {
|
|
1280
|
-
match: DateFilterMatch;
|
|
1281
|
-
value?: string;
|
|
1282
|
-
value2?: string;
|
|
1283
|
-
}
|
|
1284
|
-
interface SetFilterCondition {
|
|
1285
|
-
values: (string | number | null)[];
|
|
1286
|
-
}
|
|
1287
|
-
interface TextColumnFilter {
|
|
1288
|
-
type: "text";
|
|
1289
|
-
operator?: "and" | "or";
|
|
1290
|
-
conditions: TextFilterCondition[];
|
|
1291
|
-
}
|
|
1292
|
-
interface NumberColumnFilter {
|
|
1293
|
-
type: "number";
|
|
1294
|
-
operator?: "and" | "or";
|
|
1295
|
-
conditions: NumberFilterCondition[];
|
|
1296
|
-
}
|
|
1297
|
-
interface DateColumnFilter {
|
|
1298
|
-
type: "date";
|
|
1299
|
-
operator?: "and" | "or";
|
|
1300
|
-
conditions: DateFilterCondition[];
|
|
1049
|
+
signal: AbortSignal;
|
|
1301
1050
|
}
|
|
1302
|
-
interface
|
|
1303
|
-
|
|
1304
|
-
|
|
1051
|
+
interface PaginationConfig {
|
|
1052
|
+
/** `server` displays the supplied page as-is and uses `total` for navigation. */
|
|
1053
|
+
mode?: "client" | "server";
|
|
1054
|
+
/** Controlled current page for server mode. */
|
|
1055
|
+
page?: number;
|
|
1056
|
+
/** Total rows across all server pages. */
|
|
1057
|
+
total?: number;
|
|
1058
|
+
pageSize?: number;
|
|
1059
|
+
pageSizeOptions?: number[];
|
|
1060
|
+
showTotal?: boolean;
|
|
1061
|
+
showPageSizeSelector?: boolean;
|
|
1305
1062
|
}
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1063
|
+
interface WatermarkConfig {
|
|
1064
|
+
text: string;
|
|
1065
|
+
fontSize?: number;
|
|
1066
|
+
color?: string;
|
|
1067
|
+
opacity?: number;
|
|
1068
|
+
gap?: number;
|
|
1069
|
+
angle?: number;
|
|
1311
1070
|
}
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1071
|
+
interface ActionPolicyContext<TData = any> {
|
|
1072
|
+
/** Stable business action identifier, for example `order.delete`. */
|
|
1073
|
+
actionId?: string;
|
|
1074
|
+
permissions: readonly string[];
|
|
1075
|
+
message?: string;
|
|
1076
|
+
params: CellRendererParams<TData>;
|
|
1315
1077
|
}
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1078
|
+
/**
|
|
1079
|
+
* Application-wide UI action policy. This centralises permission, confirmation
|
|
1080
|
+
* and error handling while the backend remains the final security boundary.
|
|
1081
|
+
*/
|
|
1082
|
+
interface ActionPolicy<TData = any> {
|
|
1083
|
+
canAccess?(context: ActionPolicyContext<TData>): boolean;
|
|
1084
|
+
confirm?(context: ActionPolicyContext<TData>): boolean | Promise<boolean>;
|
|
1085
|
+
onError?(error: unknown, context: ActionPolicyContext<TData>): void;
|
|
1319
1086
|
}
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
field
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
filter
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1087
|
+
interface GridOptions<TData = any> extends EventHandlers<TData> {
|
|
1088
|
+
columnDefs?: (ColDef<TData> | ColDefGroup<TData>)[] | null;
|
|
1089
|
+
rowData?: TData[] | null;
|
|
1090
|
+
defaultColDef?: Partial<ColDef<TData>>;
|
|
1091
|
+
/** Reusable semantic column definitions referenced through `colDef.type`. */
|
|
1092
|
+
columnTypes?: Readonly<Record<string, Partial<ColDef<TData>>>>;
|
|
1093
|
+
/** Stable business key. Use a field path or a function for derived identifiers. */
|
|
1094
|
+
rowKey?: FieldPath<TData> | ((row: TData) => string | number);
|
|
1095
|
+
rowHeight?: number;
|
|
1096
|
+
headerHeight?: number;
|
|
1097
|
+
rowBuffer?: number;
|
|
1098
|
+
/** `fit` continuously fills the container without grid-ready glue code. */
|
|
1099
|
+
columnLayout?: ColumnLayoutMode;
|
|
1100
|
+
/** Enables pointer, double-click and Alt+Arrow column resizing. Disabled by default. */
|
|
1101
|
+
enableColumnResize?: boolean;
|
|
1102
|
+
/** Lets small grids grow with their rows. Avoid for large or infinite datasets. */
|
|
1103
|
+
domLayout?: DomLayoutMode;
|
|
1104
|
+
rowSelection?: RowSelectionMode;
|
|
1105
|
+
multiSort?: boolean;
|
|
1106
|
+
size?: GridSize;
|
|
1107
|
+
stripedRows?: boolean;
|
|
1108
|
+
showCellBorders?: boolean;
|
|
1109
|
+
theme?: ThemeMode;
|
|
1110
|
+
quickFilterText?: string | null;
|
|
1111
|
+
/** Nested AND/OR filter expression, safe for local evaluation and backend serialization. */
|
|
1112
|
+
advancedFilterModel?: AdvancedFilterModel | null;
|
|
1113
|
+
masterDetail?: boolean;
|
|
1114
|
+
detailRowHeight?: number;
|
|
1115
|
+
detailRowRenderer?: (params: DetailRowRendererParams<TData>) => string | HTMLElement | ICellRendererResult | null | undefined;
|
|
1116
|
+
isRowExpandable?: (params: DetailRowRendererParams<TData>) => boolean;
|
|
1117
|
+
detailToggleColumn?: boolean;
|
|
1118
|
+
columnMenu?: boolean;
|
|
1119
|
+
aggFuncs?: Record<string, (values: any[]) => any>;
|
|
1120
|
+
components?: GridComponents;
|
|
1121
|
+
/** Shared policy consumed by action column helpers. */
|
|
1122
|
+
actionPolicy?: ActionPolicy<TData>;
|
|
1123
|
+
features?: readonly GridFeature<TData>[];
|
|
1124
|
+
/** State restored atomically after columns and initial rows are available. */
|
|
1125
|
+
initialState?: GridStateInput;
|
|
1126
|
+
/** Opt-in versioned state persistence. Use sections: ["columns"] for width/order memory only. */
|
|
1127
|
+
persistence?: GridPersistenceOptions | false;
|
|
1128
|
+
locale?: MachTableLocale;
|
|
1129
|
+
/** Cell editing is isolated; fullRow stages every editable cell and commits them together. */
|
|
1130
|
+
editType?: GridEditType;
|
|
1131
|
+
/** Visibility of the subtle pencil affordance on editable cells. */
|
|
1132
|
+
editableIndicator?: EditableIndicator;
|
|
1133
|
+
/** Cross-field full-row validation. Return a message or a colId -> message map. */
|
|
1134
|
+
rowEditValidator?: (params: RowEditValidationParams<TData>) => RowEditValidationResult | Promise<RowEditValidationResult>;
|
|
1135
|
+
singleClickEdit?: boolean;
|
|
1136
|
+
manualSorting?: boolean;
|
|
1137
|
+
manualFiltering?: boolean;
|
|
1138
|
+
showSummary?: boolean;
|
|
1139
|
+
summaryMethod?: (params: {
|
|
1140
|
+
colId: string;
|
|
1141
|
+
column: Column<any>;
|
|
1142
|
+
values: any[];
|
|
1143
|
+
}) => string;
|
|
1144
|
+
treeData?: boolean;
|
|
1145
|
+
childrenKey?: string;
|
|
1146
|
+
/** Marks rows that can load children even when `childrenKey` is currently empty. */
|
|
1147
|
+
isTreeRowExpandable?: (params: Omit<TreeDataLoadParams<TData>, "signal">) => boolean;
|
|
1148
|
+
/** Loads children once on first expansion; use the API retry/force methods to reload. */
|
|
1149
|
+
loadTreeChildren?: (params: TreeDataLoadParams<TData>) => Promise<readonly TData[]>;
|
|
1150
|
+
autoCheckedChildren?: boolean;
|
|
1151
|
+
defaultExpandAll?: boolean;
|
|
1152
|
+
indexOffset?: number;
|
|
1153
|
+
applyRowDrag?: boolean;
|
|
1154
|
+
undoStackSize?: number;
|
|
1155
|
+
/** Milliseconds used to coalesce applyTransactionAsync calls. */
|
|
1156
|
+
asyncTransactionWaitMillis?: number;
|
|
1157
|
+
getRowHeight?: (params: GetRowHeightParams<TData>) => number;
|
|
1158
|
+
pinnedTopRowData?: TData[] | null;
|
|
1159
|
+
pinnedBottomRowData?: TData[] | null;
|
|
1160
|
+
pagination?: boolean | PaginationConfig;
|
|
1161
|
+
watermark?: boolean | WatermarkConfig;
|
|
1162
|
+
suppressWarnings?: boolean;
|
|
1163
|
+
enableRangeSelection?: boolean;
|
|
1164
|
+
suppressClipboard?: boolean;
|
|
1165
|
+
contextMenu?: boolean;
|
|
1166
|
+
getContextMenuItems?: (params: ContextMenuParams<TData>) => ContextMenuItem[] | null;
|
|
1167
|
+
tooltipComponent?: (params: TooltipParams<TData>) => string | HTMLElement;
|
|
1168
|
+
tooltipShowDelay?: number;
|
|
1169
|
+
flashCells?: boolean;
|
|
1170
|
+
fillHandle?: boolean;
|
|
1171
|
+
statusBar?: boolean | StatusBarConfig;
|
|
1172
|
+
datasource?: GridDatasource<TData>;
|
|
1173
|
+
/** Sequential append is the compatibility default; block enables random-access cached loading. */
|
|
1174
|
+
datasourceMode?: DatasourceMode;
|
|
1175
|
+
blockSize?: number;
|
|
1176
|
+
infiniteBufferRows?: number;
|
|
1177
|
+
/** Maximum retained blocks in random-access mode. */
|
|
1178
|
+
maxBlocksInCache?: number;
|
|
1179
|
+
/** Upper bound for active random-access datasource requests. Defaults to 4. */
|
|
1180
|
+
datasourceMaxConcurrentRequests?: number;
|
|
1181
|
+
/** Number of adjacent blocks prefetched around a requested viewport. */
|
|
1182
|
+
blockPrefetch?: number;
|
|
1183
|
+
/** Optional initial total enables immediate scrollbar range before the first response. */
|
|
1184
|
+
datasourceRowCount?: number;
|
|
1185
|
+
/** Opt-in async processor for large local filter/sort pipelines. */
|
|
1186
|
+
dataProcessor?: GridDataProcessor<TData>;
|
|
1187
|
+
/** Minimum local row count before dataProcessor is used. Defaults to 5,000. */
|
|
1188
|
+
dataProcessorMinRows?: number;
|
|
1189
|
+
/** Number of automatic retries after an infinite datasource request fails. */
|
|
1190
|
+
datasourceRetryCount?: number;
|
|
1191
|
+
/** Base retry delay in milliseconds. Retries use capped exponential backoff. */
|
|
1192
|
+
datasourceRetryDelay?: number;
|
|
1193
|
+
/** Symmetric retry jitter ratio in the 0..1 range. Defaults to 0.15. */
|
|
1194
|
+
datasourceRetryJitter?: number;
|
|
1195
|
+
suppressCellFocus?: boolean;
|
|
1196
|
+
suppressRowHoverHighlight?: boolean;
|
|
1197
|
+
suppressNoRowsOverlay?: boolean;
|
|
1198
|
+
suppressHeaderFocus?: boolean;
|
|
1199
|
+
/** Accessible name applied to the element with role="grid"/"treegrid". */
|
|
1200
|
+
ariaLabel?: string;
|
|
1201
|
+
/** ID of an external element that labels the grid. Takes precedence over ariaLabel. */
|
|
1202
|
+
ariaLabelledBy?: string;
|
|
1203
|
+
/** ID of an external element that provides additional grid instructions. */
|
|
1204
|
+
ariaDescribedBy?: string;
|
|
1205
|
+
loading?: boolean;
|
|
1206
|
+
/** Non-null errors take precedence over the empty state and remain retryable by the host. */
|
|
1207
|
+
error?: unknown | null;
|
|
1208
|
+
overlayNoRowsTemplate?: OverlayTemplate;
|
|
1209
|
+
overlayLoadingTemplate?: OverlayTemplate;
|
|
1210
|
+
overlayErrorTemplate?: OverlayTemplate;
|
|
1211
|
+
/** Opt in only for trusted overlay strings. Prefer HTMLElement factories. */
|
|
1212
|
+
allowUnsafeOverlayHtml?: boolean;
|
|
1213
|
+
className?: string;
|
|
1381
1214
|
}
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1215
|
+
interface ResolvedGridOptions<TData = any> extends EventHandlers<TData> {
|
|
1216
|
+
columnDefs: (ColDef<TData> | ColDefGroup<TData>)[];
|
|
1217
|
+
rowData: TData[];
|
|
1218
|
+
defaultColDef: Partial<ColDef<TData>>;
|
|
1219
|
+
columnTypes: Readonly<Record<string, Partial<ColDef<TData>>>>;
|
|
1220
|
+
/** Internal normalized identity resolver derived from rowKey. */
|
|
1221
|
+
resolveRowId?: (params: GetRowIdParams<TData>) => string;
|
|
1222
|
+
rowKey?: FieldPath<TData> | ((row: TData) => string | number);
|
|
1223
|
+
rowHeight: number;
|
|
1224
|
+
headerHeight: number;
|
|
1225
|
+
rowBuffer: number;
|
|
1226
|
+
columnLayout: ColumnLayoutMode;
|
|
1227
|
+
enableColumnResize: boolean;
|
|
1228
|
+
domLayout: DomLayoutMode;
|
|
1229
|
+
rowSelection: RowSelectionMode;
|
|
1230
|
+
multiSort: boolean;
|
|
1231
|
+
size: GridSize;
|
|
1232
|
+
stripedRows: boolean;
|
|
1233
|
+
showCellBorders: boolean;
|
|
1234
|
+
theme: ThemeMode;
|
|
1235
|
+
quickFilterText: string | null;
|
|
1236
|
+
advancedFilterModel: AdvancedFilterModel | null;
|
|
1237
|
+
masterDetail: boolean;
|
|
1238
|
+
detailRowHeight: number;
|
|
1239
|
+
detailRowRenderer?: (params: DetailRowRendererParams<TData>) => string | HTMLElement | ICellRendererResult | null | undefined;
|
|
1240
|
+
isRowExpandable?: (params: DetailRowRendererParams<TData>) => boolean;
|
|
1241
|
+
detailToggleColumn: boolean;
|
|
1242
|
+
columnMenu: boolean;
|
|
1243
|
+
aggFuncs?: Record<string, (values: any[]) => any>;
|
|
1244
|
+
components?: GridComponents;
|
|
1245
|
+
actionPolicy?: ActionPolicy<TData>;
|
|
1246
|
+
features: readonly GridFeature<TData>[];
|
|
1247
|
+
initialState?: GridStateInput;
|
|
1248
|
+
persistence: Required<Pick<GridPersistenceOptions, "key" | "debounceMs">> & Pick<GridPersistenceOptions, "sections" | "store"> | null;
|
|
1249
|
+
locale: MachTableLocale;
|
|
1250
|
+
editType: GridEditType;
|
|
1251
|
+
editableIndicator: EditableIndicator;
|
|
1252
|
+
rowEditValidator?: (params: RowEditValidationParams<TData>) => RowEditValidationResult | Promise<RowEditValidationResult>;
|
|
1253
|
+
singleClickEdit: boolean;
|
|
1254
|
+
manualSorting: boolean;
|
|
1255
|
+
manualFiltering: boolean;
|
|
1256
|
+
showSummary: boolean;
|
|
1257
|
+
summaryMethod?: (params: {
|
|
1258
|
+
colId: string;
|
|
1259
|
+
column: Column<any>;
|
|
1260
|
+
values: any[];
|
|
1261
|
+
}) => string;
|
|
1262
|
+
treeData: boolean;
|
|
1263
|
+
childrenKey: string;
|
|
1264
|
+
isTreeRowExpandable?: (params: Omit<TreeDataLoadParams<TData>, "signal">) => boolean;
|
|
1265
|
+
loadTreeChildren?: (params: TreeDataLoadParams<TData>) => Promise<readonly TData[]>;
|
|
1266
|
+
autoCheckedChildren: boolean;
|
|
1267
|
+
defaultExpandAll: boolean;
|
|
1268
|
+
indexOffset: number;
|
|
1269
|
+
applyRowDrag: boolean;
|
|
1270
|
+
undoStackSize: number;
|
|
1271
|
+
asyncTransactionWaitMillis: number;
|
|
1272
|
+
getRowHeight?: (params: GetRowHeightParams<TData>) => number;
|
|
1273
|
+
pinnedTopRowData: TData[];
|
|
1274
|
+
pinnedBottomRowData: TData[];
|
|
1275
|
+
paginationEnabled: boolean;
|
|
1276
|
+
paginationMode: "client" | "server";
|
|
1277
|
+
paginationPage: number;
|
|
1278
|
+
paginationTotal: number;
|
|
1279
|
+
paginationPageSize: number;
|
|
1280
|
+
paginationPageSizeOptions: number[];
|
|
1281
|
+
paginationShowTotal: boolean;
|
|
1282
|
+
paginationShowSizeSelector: boolean;
|
|
1283
|
+
watermarkEnabled: boolean;
|
|
1284
|
+
watermarkConfig: WatermarkConfig | null;
|
|
1285
|
+
suppressWarnings: boolean;
|
|
1286
|
+
enableRangeSelection: boolean;
|
|
1287
|
+
suppressClipboard: boolean;
|
|
1288
|
+
contextMenu: boolean;
|
|
1289
|
+
getContextMenuItems?: (params: ContextMenuParams<TData>) => ContextMenuItem[] | null;
|
|
1290
|
+
tooltipComponent?: (params: TooltipParams<TData>) => string | HTMLElement;
|
|
1291
|
+
tooltipShowDelay: number;
|
|
1292
|
+
flashCells: boolean;
|
|
1293
|
+
fillHandle: boolean;
|
|
1294
|
+
statusBarEnabled: boolean;
|
|
1295
|
+
statusBarPanels: StatusBarPanel[];
|
|
1296
|
+
datasource?: GridDatasource<TData>;
|
|
1297
|
+
datasourceMode: DatasourceMode;
|
|
1298
|
+
blockSize: number;
|
|
1299
|
+
infiniteBufferRows: number;
|
|
1300
|
+
maxBlocksInCache: number;
|
|
1301
|
+
datasourceMaxConcurrentRequests: number;
|
|
1302
|
+
blockPrefetch: number;
|
|
1303
|
+
datasourceRowCount: number | null;
|
|
1304
|
+
dataProcessor?: GridDataProcessor<TData>;
|
|
1305
|
+
dataProcessorMinRows: number;
|
|
1306
|
+
datasourceRetryCount: number;
|
|
1307
|
+
datasourceRetryDelay: number;
|
|
1308
|
+
datasourceRetryJitter: number;
|
|
1309
|
+
suppressCellFocus: boolean;
|
|
1310
|
+
suppressRowHoverHighlight: boolean;
|
|
1311
|
+
suppressNoRowsOverlay: boolean;
|
|
1312
|
+
suppressHeaderFocus: boolean;
|
|
1313
|
+
ariaLabel: string;
|
|
1314
|
+
ariaLabelledBy: string;
|
|
1315
|
+
ariaDescribedBy: string;
|
|
1316
|
+
loading: boolean;
|
|
1317
|
+
error: unknown | null;
|
|
1318
|
+
overlayNoRowsTemplate: OverlayTemplate;
|
|
1319
|
+
overlayLoadingTemplate: OverlayTemplate;
|
|
1320
|
+
overlayErrorTemplate: OverlayTemplate;
|
|
1321
|
+
allowUnsafeOverlayHtml: boolean;
|
|
1322
|
+
className: string;
|
|
1395
1323
|
}
|
|
1396
1324
|
|
|
1397
|
-
type
|
|
1398
|
-
interface GridWorkerProcessMessage<TData = any> {
|
|
1399
|
-
type: "mach-table:process";
|
|
1400
|
-
requestId: number;
|
|
1401
|
-
payload: GridDataProcessorPayload<TData>;
|
|
1402
|
-
}
|
|
1403
|
-
interface GridWorkerCancelMessage {
|
|
1404
|
-
type: "mach-table:cancel";
|
|
1405
|
-
requestId: number;
|
|
1406
|
-
}
|
|
1407
|
-
type GridWorkerRequestMessage<TData = any> = GridWorkerProcessMessage<TData> | GridWorkerCancelMessage;
|
|
1408
|
-
type GridWorkerResponseMessage = {
|
|
1409
|
-
type: "mach-table:result";
|
|
1410
|
-
requestId: number;
|
|
1411
|
-
rowIds: readonly string[];
|
|
1412
|
-
} | {
|
|
1413
|
-
type: "mach-table:error";
|
|
1414
|
-
requestId: number;
|
|
1415
|
-
message: string;
|
|
1416
|
-
};
|
|
1417
|
-
interface WorkerDataProcessorOptions {
|
|
1418
|
-
/** Terminate the lazily-created worker when the grid is destroyed. Defaults to true. */
|
|
1419
|
-
terminateOnDestroy?: boolean;
|
|
1420
|
-
}
|
|
1421
|
-
interface FieldDataProcessorOptions {
|
|
1422
|
-
/** Cooperative cancellation/yield granularity. Defaults to 2,000 rows. */
|
|
1423
|
-
yieldEvery?: number;
|
|
1424
|
-
isCancelled?: () => boolean;
|
|
1425
|
-
}
|
|
1426
|
-
/** Built-in serializable field-path processor intended to run inside an application Worker. */
|
|
1427
|
-
declare function processFieldDataRequest<TData = any>(request: GridDataProcessorPayload<TData>, options?: FieldDataProcessorOptions): Promise<GridDataProcessorResult>;
|
|
1428
|
-
interface GridDataWorkerScope {
|
|
1429
|
-
addEventListener(type: "message", listener: (event: MessageEvent<GridWorkerRequestMessage>) => void): void;
|
|
1430
|
-
postMessage(message: GridWorkerResponseMessage): void;
|
|
1431
|
-
}
|
|
1432
|
-
/** Installs the standard field-path protocol in a dedicated Worker module. */
|
|
1433
|
-
declare function installGridDataWorker(scope: GridDataWorkerScope): void;
|
|
1434
|
-
/**
|
|
1435
|
-
* Adapts a dedicated Web Worker to GridDataProcessor without Blob URLs or eval.
|
|
1436
|
-
* The host controls the worker URL, keeping CSP and bundler behavior explicit.
|
|
1437
|
-
*/
|
|
1438
|
-
declare function createWorkerDataProcessor<TData = any>(createWorker: () => Worker, options?: WorkerDataProcessorOptions): GridDataProcessor<TData>;
|
|
1439
|
-
|
|
1440
|
-
export { type CellDoubleClickEvent as $, type AdvancedFilterModel as A, type GridState as B, type ColDefOrGroup as C, type DomLayoutMode as D, type GridStateInput as E, type FilterModel as F, type GridOptions as G, type CellRendererParams as H, type FieldPath as I, type FieldPathValue as J, type GridComponents as K, type SaveChangesResult as L, type GridBatchSaveResult as M, type SaveChangeConflict as N, type OverlayTemplate as O, type PinnedDirection as P, type ActionPolicy as Q, type RemoteBlockCacheSnapshot as R, type SortModel as S, type ThemeMode as T, type ActionPolicyContext as U, type ApplyGridStateOptions as V, type CellAlign as W, type CellClassParams as X, type CellClassRule as Y, type CellClickEvent as Z, type CellContextMenuEvent as _, type GridApi as a, type ImportCsvOptions as a$, type CellEditingStartedEvent as a0, type CellEditingStoppedEvent as a1, type CellEditorParams as a2, type CellRendererOutput as a3, type CellStyleRule as a4, type CellValueChangedEvent as a5, type ColumnLayoutMode as a6, type ColumnMovedEvent as a7, type ColumnResizedEvent as a8, type ColumnVisibilityChangedEvent as a9, type GridDataProcessorPayload as aA, type GridDataProcessorRequest as aB, type GridDataProcessorResult as aC, type GridDataProcessorRow as aD, type GridDataWorkerScope as aE, type GridDatasource as aF, type GridDiagnosticError as aG, type GridDiagnosticsApi as aH, type GridEditType as aI, type GridEditingApi as aJ, type GridErrorCode as aK, type GridErrorEvent as aL, type GridEventBase as aM, type GridFeatureContext as aN, type GridReadyEvent as aO, type GridRowsApi as aP, type GridSelectionApi as aQ, type GridStateApi as aR, type GridStateSection as aS, type GridUpdateSchedulerSnapshot as aT, type GridWorkerCancelMessage as aU, type GridWorkerProcessMessage as aV, type GridWorkerRequestMessage as aW, type GridWorkerResponseMessage as aX, type HeaderComponentParams as aY, type ICellEditor as aZ, type ICellRendererResult as a_, type ColumnWorkbenchItem as aa, type ContextMenuItem as ab, type ContextMenuParams as ac, type CsvExportParams as ad, DEFAULT_LOCALE as ae, type DatasourceMode as af, type DateFilterCondition as ag, type DateFilterMatch as ah, type DetailRowRendererParams as ai, type DetailToggledEvent as aj, type DirtyStateChangedEvent as ak, EVENT_TYPES as al, type EditableIndicator as am, type EditableParams as an, type EventHandlers as ao, type FieldDataProcessorOptions as ap, type FilterChangedEvent as aq, type FilterType as ar, type GetRowHeightParams as as, type GetRowIdParams as at, type GridAsyncOptions as au, type GridCellChange as av, type GridCellRange as aw, type GridColumnsApi as ax, type GridDataProcessor as ay, type GridDataProcessorColumn as az, Column as b, type InfiniteGetRowsParams as b0, LOCALE_EN as b1, type LegacyGridStateV1 as b2, type ModelUpdatedEvent as b3, type NumberFilterCondition as b4, type NumberFilterMatch as b5, type OverlayContent as b6, type PaginationChangedEvent as b7, type PaginationConfig as b8, type PrintOptions as b9, type TreeDataLoadParams as bA, type ValueFormatterParams as bB, type ValueGetterParams as bC, type ValueSetterParams as bD, type WatermarkConfig as bE, type WorkerDataProcessorOptions as bF, formatText as bG, formatTwo as bH, isColDefGroup as bI, matchLocaleKey as bJ, createWorkerDataProcessor as bK, installGridDataWorker as bL, processFieldDataRequest as bM, type RangeSelectionChangedEvent as ba, type RgLocale as bb, type RowClickEvent as bc, type RowDragEndEvent as bd, type RowEditChange as be, type RowEditValidationParams as bf, type RowEditValidationResult as bg, type RowEditingStartedEvent as bh, type RowEditingStoppedEvent as bi, type RowSelectionMode as bj, type SaveChangeIssue as bk, type SaveChangesHandler as bl, type SelectEditorParams as bm, type SelectionChangedEvent as bn, type SetFilterCondition as bo, type SetFilterParams as bp, type SortChangedEvent as bq, type SortDirection as br, type SortModelItem as bs, type StatusBarConfig as bt, type StatusBarPanel as bu, type TextFilterCondition as bv, type TextFilterMatch as bw, type TooltipParams as bx, type TreeChildrenLoadFailedEvent as by, type TreeChildrenLoadedEvent as bz, ColumnGroup as c, type ColumnState as d, type RowTransaction as e, type RowNode as f, type GridChange as g, type GridPerformanceSnapshot as h, type RefreshCellsParams as i, type ResolvedGridOptions as j, type GridSize as k, type GridEventMap as l, type CellRendererFn as m, type CellEditorFactory as n, type GridFeature as o, type RgLocaleKey as p, type GridEventType as q, type GridDiagnostics as r, type ColumnFilter as s, type ColDef as t, type ColDefGroup as u, type AdvancedFilterCondition as v, type AdvancedFilterNode as w, type AdvancedFilterGroup as x, type ColumnStateStore as y, type GridStateStore as z };
|
|
1325
|
+
export { type DateFilterMatch as $, type AdvancedFilterCondition as A, type CellClickEvent as B, type ColDef as C, type CellContextMenuEvent as D, type CellDoubleClickEvent as E, type FilterModel as F, type GridOptions as G, type CellEditingStartedEvent as H, type CellEditingStoppedEvent as I, type CellEditorFactory as J, type CellEditorParams as K, type CellRendererOutput as L, type CellStyleRule as M, type CellValueChangedEvent as N, type ColDefOrGroup as O, type ColumnLayoutMode as P, type ColumnMovedEvent as Q, type ColumnResizedEvent as R, type SaveChangeConflict as S, type ColumnVisibilityChangedEvent as T, type ColumnWorkbenchItem as U, type ContextMenuItem as V, type ContextMenuParams as W, type CsvExportParams as X, DEFAULT_LOCALE as Y, type DatasourceMode as Z, type DateFilterCondition as _, type GridEventType as a, type RangeSelectionChangedEvent as a$, type DetailRowRendererParams as a0, type DetailToggledEvent as a1, type DirtyStateChangedEvent as a2, type DomLayoutMode as a3, EVENT_TYPES as a4, type EditableIndicator as a5, type EditableParams as a6, type EventHandlers as a7, type FilterChangedEvent as a8, type FilterType as a9, type GridPerformanceSnapshot as aA, type GridPersistenceOptions as aB, type GridReadyEvent as aC, type GridRowsApi as aD, type GridSelectionApi as aE, type GridSortingApi as aF, type GridStateApi as aG, type GridStateSection as aH, type GridUpdateSchedulerSnapshot as aI, type GridViewApi as aJ, type HeaderComponentParams as aK, type ICellEditor as aL, type ICellRendererResult as aM, type ImportCsvOptions as aN, type InfiniteGetRowsParams as aO, LOCALE_EN as aP, type MachTableLocale as aQ, type MachTableLocaleKey as aR, type ModelUpdatedEvent as aS, type NumberFilterCondition as aT, type NumberFilterMatch as aU, type OverlayContent as aV, type OverlayTemplate as aW, type PaginationChangedEvent as aX, type PaginationConfig as aY, type PinnedDirection as aZ, type PrintOptions as a_, type GetRowHeightParams as aa, type GridAsyncOptions as ab, type GridBatchSaveResult as ac, type GridCellChange as ad, type GridCellRange as ae, type GridColumnsApi as af, type GridDataProcessor as ag, type GridDataProcessorColumn as ah, type GridDataProcessorRequest as ai, type GridDataProcessorResult as aj, type GridDataProcessorRow as ak, type GridDatasource as al, type GridDiagnosticError as am, type GridDiagnostics as an, type GridDiagnosticsApi as ao, type GridEditType as ap, type GridEditingApi as aq, type GridErrorCode as ar, type GridErrorEvent as as, type GridEventBase as at, type GridEventMap as au, type GridFeatureContext as av, type GridFilteringApi as aw, type GridHierarchyApi as ax, type GridIoApi as ay, type GridPaginationApi as az, type GridComponents as b, type RefreshCellsParams as b0, type RemoteBlockCacheSnapshot as b1, type ResolvedGridOptions as b2, type RowClickEvent as b3, type RowDragEndEvent as b4, type RowEditChange as b5, type RowEditValidationParams as b6, type RowEditValidationResult as b7, type RowEditingStartedEvent as b8, type RowEditingStoppedEvent as b9, formatText as bA, formatTwo as bB, isColDefGroup as bC, matchLocaleKey as bD, type RowNode as ba, type RowSelectionMode as bb, type RowTransaction as bc, type SaveChangeIssue as bd, type SaveChangesHandler as be, type SaveChangesResult as bf, type SelectEditorParams as bg, type SelectionChangedEvent as bh, type SetFilterCondition as bi, type SetFilterParams as bj, type SortChangedEvent as bk, type SortDirection as bl, type SortModelItem as bm, type StatusBarConfig as bn, type StatusBarPanel as bo, type TextFilterCondition as bp, type TextFilterMatch as bq, type ThemeMode as br, type TooltipParams as bs, type TreeChildrenLoadFailedEvent as bt, type TreeChildrenLoadedEvent as bu, type TreeDataLoadParams as bv, type ValueFormatterParams as bw, type ValueGetterParams as bx, type ValueSetterParams as by, type WatermarkConfig as bz, type GridApi as c, type ColumnFilter as d, type AdvancedFilterNode as e, type AdvancedFilterGroup as f, type AdvancedFilterModel as g, type GridFeature as h, type ColDefGroup as i, type GridStateStore as j, type GridState as k, type GridStateInput as l, type GridSize as m, type CellRendererParams as n, type GridChange as o, type CellRendererFn as p, type FieldPath as q, type FieldPathValue as r, type ColumnState as s, type SortModel as t, type ActionPolicy as u, type ActionPolicyContext as v, type ApplyGridStateOptions as w, type CellAlign as x, type CellClassParams as y, type CellClassRule as z };
|