arthub-table 0.1.0-beta.2 → 0.1.0-beta.21
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/dist/arthub-table.common.js +1 -1
- package/dist/arthub-table.common.js.map +1 -1
- package/dist/arthub-table.umd.js +1 -1
- package/dist/arthub-table.umd.js.map +1 -1
- package/dist/arthub-table.umd.min.js +1 -1
- package/dist/arthub-table.umd.min.js.map +1 -1
- package/dist/types/adapters/DataGridIntegration.d.ts +128 -0
- package/dist/types/adapters/index.d.ts +2 -2
- package/dist/types/adapters/rowDataAdapter.d.ts +80 -47
- package/dist/types/adapters/styleAdapter.d.ts +2 -0
- package/dist/types/assets/icon/defaultAvatar.d.ts +1 -1
- package/dist/types/core/Body.d.ts +7 -1
- package/dist/types/core/Cell.d.ts +16 -3
- package/dist/types/core/ColumnHeader.d.ts +16 -0
- package/dist/types/core/DataGrid.d.ts +325 -3
- package/dist/types/core/Footer.d.ts +29 -2
- package/dist/types/core/GroupRow.d.ts +83 -12
- package/dist/types/core/Header.d.ts +9 -0
- package/dist/types/core/ImageManager.d.ts +23 -0
- package/dist/types/core/NestedGrid.d.ts +21 -0
- package/dist/types/core/Paint.d.ts +26 -0
- package/dist/types/core/Row.d.ts +2 -2
- package/dist/types/core/RowHeader.d.ts +37 -0
- package/dist/types/core/StyleManager.d.ts +20 -0
- package/dist/types/core/constants.d.ts +3 -2
- package/dist/types/core/types.d.ts +83 -3
- package/dist/types/core/viewers/BooleanViewer.d.ts +1 -0
- package/dist/types/core/viewers/FileViewer.d.ts +1 -0
- package/dist/types/core/viewers/GroupNameViewer.d.ts +56 -0
- package/dist/types/core/viewers/PersonViewer.d.ts +6 -0
- package/dist/types/core/viewers/PriorityTextViewer.d.ts +0 -4
- package/dist/types/core/viewers/TaskNodeViewer.d.ts +5 -1
- package/dist/types/core/viewers/TextViewerWithSwitcher.d.ts +15 -1
- package/dist/types/core/viewers/index.d.ts +3 -3
- package/dist/types/core/viewers/types.d.ts +83 -1
- package/dist/types/index.d.ts +4 -4
- package/package.json +1 -1
|
@@ -40,6 +40,10 @@ export interface DataGridInitOptions {
|
|
|
40
40
|
headerHeight?: number;
|
|
41
41
|
/** 是否显示底部统计行 */
|
|
42
42
|
showFooter?: boolean;
|
|
43
|
+
/** 列总宽小于表格可视区域宽度时,是否将剩余空间均分到每列(默认 false) */
|
|
44
|
+
autoFillTableWidth?: boolean;
|
|
45
|
+
/** 底部统计行高度,默认 36 */
|
|
46
|
+
footerHeight?: number;
|
|
43
47
|
/** 是否显示斑马纹 */
|
|
44
48
|
striped?: boolean;
|
|
45
49
|
/** 是否是透视子表 */
|
|
@@ -48,6 +52,8 @@ export interface DataGridInitOptions {
|
|
|
48
52
|
showCheckbox?: boolean;
|
|
49
53
|
/** 是否显示索引列 */
|
|
50
54
|
showTableIndex?: boolean;
|
|
55
|
+
/** 是否在表头左上角显示全选 checkbox,默认 false */
|
|
56
|
+
showHeaderCheckbox?: boolean;
|
|
51
57
|
/**
|
|
52
58
|
* 索引列模式:
|
|
53
59
|
* - 'auto':自动模式,行号 = rowIndex + 1(默认)
|
|
@@ -58,6 +64,12 @@ export interface DataGridInitOptions {
|
|
|
58
64
|
debug?: boolean;
|
|
59
65
|
/** 是否启用内置键盘快捷键监听,默认 false */
|
|
60
66
|
enableKeyboardShortcuts?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Whether to disable DataGrid's built-in "click outside to close editing" behavior.
|
|
69
|
+
* When true, the host application is responsible for managing click-outside logic.
|
|
70
|
+
* Default: false.
|
|
71
|
+
*/
|
|
72
|
+
disableClickOutside?: boolean;
|
|
61
73
|
/** 主题 */
|
|
62
74
|
theme?: string | Record<string, any>;
|
|
63
75
|
/** WfState Viewer 显示样式:'icon'=图标+文字(默认),'tag'=色块标签 */
|
|
@@ -73,6 +85,15 @@ export interface DataGridInitOptions {
|
|
|
73
85
|
* 默认 'controlled'
|
|
74
86
|
*/
|
|
75
87
|
groupToggleMode?: 'controlled' | 'uncontrolled';
|
|
88
|
+
/**
|
|
89
|
+
* 分组维度数(由外部传入,优先级高于行数据遍历推断)。
|
|
90
|
+
* - 0 = 无分组
|
|
91
|
+
* - 1 = 一维分组
|
|
92
|
+
* - 2 = 二维分组
|
|
93
|
+
* - 3 = 三维分组
|
|
94
|
+
* 未传入时退化为遍历行数据推断(旧逻辑)。
|
|
95
|
+
*/
|
|
96
|
+
groupDimension?: number;
|
|
76
97
|
/** 业务 props (用于行数据预处理) */
|
|
77
98
|
controllerProps?: Record<string, any>;
|
|
78
99
|
/**
|
|
@@ -80,6 +101,18 @@ export interface DataGridInitOptions {
|
|
|
80
101
|
* 当为 true 时,行数据中 tapd_sync_state 处于同步状态的任务名称列将显示 TAPD 蓝色
|
|
81
102
|
*/
|
|
82
103
|
tapdInSyncTaskNameHighlight?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* 嵌套子表数据比对 key 列表(性能优化)。
|
|
106
|
+
* loadData 时比较新旧嵌套数据中这些 key 的值,未变化则复用旧 NestedGrid 实例。
|
|
107
|
+
* 默认 ['id']。
|
|
108
|
+
*/
|
|
109
|
+
nestedDataCompareKeys?: string[];
|
|
110
|
+
/**
|
|
111
|
+
* 嵌套子表强制刷新 key 列表(性能优化)。
|
|
112
|
+
* 新嵌套数据中任意一行包含这些 key 且有值时,强制重建 NestedGrid。
|
|
113
|
+
* 默认 []。
|
|
114
|
+
*/
|
|
115
|
+
nestedForceRefreshKeys?: string[];
|
|
83
116
|
/** DataGrid 事件回调 */
|
|
84
117
|
callbacks?: DataGridCallbacks;
|
|
85
118
|
}
|
|
@@ -164,6 +197,7 @@ export interface DataGridCallbacks {
|
|
|
164
197
|
endRow: number;
|
|
165
198
|
endCol: number;
|
|
166
199
|
};
|
|
200
|
+
nestedGridData: any[];
|
|
167
201
|
}) => void;
|
|
168
202
|
/** 粘贴完成 */
|
|
169
203
|
afterPaste?: (data: any) => void;
|
|
@@ -207,6 +241,10 @@ export interface DataGridCallbacks {
|
|
|
207
241
|
onFooterCellClick?: (info: any) => void;
|
|
208
242
|
/** 组头单元格点击 */
|
|
209
243
|
onGroupHeaderCellClick?: (info: any) => void;
|
|
244
|
+
/** Footer 嵌套列统计刷新 */
|
|
245
|
+
onFooterStatRefresh?: (info: any) => void;
|
|
246
|
+
/** 组头嵌套列统计刷新 */
|
|
247
|
+
onGroupHeaderStatRefresh?: (info: any) => void;
|
|
210
248
|
/** 表头排序图标点击 */
|
|
211
249
|
onHeaderSortClick?: (info: {
|
|
212
250
|
colId: string;
|
|
@@ -277,6 +315,47 @@ export interface DataGridCallbacks {
|
|
|
277
315
|
height: number;
|
|
278
316
|
};
|
|
279
317
|
}) => void;
|
|
318
|
+
/** 嵌套子表框选变化回调:选区跨子表或单子表变化时触发 */
|
|
319
|
+
onNestedSelectionChange?: (params: {
|
|
320
|
+
parentColKey: string;
|
|
321
|
+
selections: Array<{
|
|
322
|
+
parentRowData: any;
|
|
323
|
+
parentRowIndex: number;
|
|
324
|
+
parentColIndex: number;
|
|
325
|
+
selectionRange: {
|
|
326
|
+
startRow: number;
|
|
327
|
+
startCol: number;
|
|
328
|
+
endRow: number;
|
|
329
|
+
endCol: number;
|
|
330
|
+
};
|
|
331
|
+
}>;
|
|
332
|
+
}) => void;
|
|
333
|
+
/** 嵌套子表跨子表 autofill 结束回调 */
|
|
334
|
+
onNestedCrossAutofillEnd?: (params: {
|
|
335
|
+
parentColKey: string;
|
|
336
|
+
sourceSelections: Array<{
|
|
337
|
+
parentRowData: any;
|
|
338
|
+
parentRowIndex: number;
|
|
339
|
+
selectionRange: {
|
|
340
|
+
startRow: number;
|
|
341
|
+
startCol: number;
|
|
342
|
+
endRow: number;
|
|
343
|
+
endCol: number;
|
|
344
|
+
};
|
|
345
|
+
}>;
|
|
346
|
+
targetSelections: Array<{
|
|
347
|
+
parentRowData: any;
|
|
348
|
+
parentRowIndex: number;
|
|
349
|
+
autofillRange: {
|
|
350
|
+
startRow: number;
|
|
351
|
+
startCol: number;
|
|
352
|
+
endRow: number;
|
|
353
|
+
endCol: number;
|
|
354
|
+
};
|
|
355
|
+
/** NestedGrid 实际渲染的数据数组(行索引与 autofillRange 完全一致) */
|
|
356
|
+
nestedGridData: any[];
|
|
357
|
+
}>;
|
|
358
|
+
}) => void;
|
|
280
359
|
/** 滚动回调 */
|
|
281
360
|
onScroll?: (scrollX: number, scrollY: number) => void;
|
|
282
361
|
/** 滚动开始回调 */
|
|
@@ -314,6 +393,24 @@ export interface DataGridCallbacks {
|
|
|
314
393
|
isNestedChild: boolean;
|
|
315
394
|
nestedChildOffset: number;
|
|
316
395
|
}) => void;
|
|
396
|
+
/** Cell hover 变化回调:当 hover 的单元格变化时通知外部(用于时间型字段 tooltip / 历史变更等) */
|
|
397
|
+
onCellHoverChange?: (info: {
|
|
398
|
+
show: boolean;
|
|
399
|
+
rowIndex: number;
|
|
400
|
+
colIndex: number;
|
|
401
|
+
colKey: string;
|
|
402
|
+
rowData: Record<string, any>;
|
|
403
|
+
position: {
|
|
404
|
+
x: number;
|
|
405
|
+
y: number;
|
|
406
|
+
width: number;
|
|
407
|
+
height: number;
|
|
408
|
+
};
|
|
409
|
+
canvasElement: HTMLCanvasElement;
|
|
410
|
+
displayText: string;
|
|
411
|
+
mouseX: number;
|
|
412
|
+
mouseY: number;
|
|
413
|
+
}) => void;
|
|
317
414
|
/** Error icon hover 回调:鼠标悬停在单元格 warning icon 上时触发(用于外部 AlarmPopper) */
|
|
318
415
|
onErrorIconHover?: (info: {
|
|
319
416
|
show: boolean;
|
|
@@ -378,6 +475,28 @@ export interface DataGridCallbacks {
|
|
|
378
475
|
onBeforeRowRender?: (rowIndex: number, rowData: Record<string, any>) => void;
|
|
379
476
|
/** 嵌套表格渲染前回调:每个嵌套表格格子绘制前触发,用于分组表格管线列渐进式加载 */
|
|
380
477
|
onBeforeNestedGridRender?: (rowIndex: number, rowData: Record<string, any>, colKey: string) => void;
|
|
478
|
+
/** 普通行 checkbox 变更回调(受控模式):checkbox 点击时通知外部更新 tableSelectedList */
|
|
479
|
+
onRowCheckChange?: (info: {
|
|
480
|
+
rowId: string;
|
|
481
|
+
checked: boolean;
|
|
482
|
+
rowData: any;
|
|
483
|
+
selectedRowIds: string[];
|
|
484
|
+
event?: MouseEvent;
|
|
485
|
+
}) => void;
|
|
486
|
+
/** 组头 checkbox 变更回调(受控模式):组头 checkbox 点击时通知外部批量更新 tableSelectedList */
|
|
487
|
+
onGroupCheckboxChange?: (info: {
|
|
488
|
+
groupId: string | number;
|
|
489
|
+
checked: boolean;
|
|
490
|
+
data: any;
|
|
491
|
+
selectedRowIds: string[];
|
|
492
|
+
}) => void;
|
|
493
|
+
/**
|
|
494
|
+
* Cell value transformer callback.
|
|
495
|
+
* Called by Cell.drawWithViewer() before passing data to viewer.draw().
|
|
496
|
+
* Transforms raw cell values to display values at render time.
|
|
497
|
+
* Return undefined to keep the original value.
|
|
498
|
+
*/
|
|
499
|
+
cellValueTransformer?: import('../core/viewers/types').CellValueTransformer;
|
|
381
500
|
}
|
|
382
501
|
/**
|
|
383
502
|
* DataGrid 初始化结果
|
|
@@ -494,6 +613,15 @@ export declare function refreshDataGridColumns(tableHeadListFixLeft: ITableHeade
|
|
|
494
613
|
* @param controllerProps - 业务 props(包含 resolver 函数等)
|
|
495
614
|
*/
|
|
496
615
|
export declare function refreshDataGridColumnByKeys(dataGrid: any, preprocessedData: PreprocessedRow[], rawDataList: Record<string, any>[], colKeys: string[], allHeaders: ITableHeader[], controllerProps: Record<string, any>): void;
|
|
616
|
+
/**
|
|
617
|
+
* [Optimization B] Async time-sliced version of refreshDataGridColumnByKeys.
|
|
618
|
+
* Processes rows in batches via refreshColumnCellValuesAsync, yielding to the
|
|
619
|
+
* main thread between batches to prevent long tasks from blocking scrolling.
|
|
620
|
+
* After all batches are processed, triggers a single DataGrid repaint.
|
|
621
|
+
*
|
|
622
|
+
* @param batchSize - Number of rows per batch (default 200)
|
|
623
|
+
*/
|
|
624
|
+
export declare function refreshDataGridColumnByKeysAsync(dataGrid: any, preprocessedData: PreprocessedRow[], rawDataList: Record<string, any>[], colKeys: string[], allHeaders: ITableHeader[], controllerProps: Record<string, any>, batchSize?: number, isStale?: () => boolean): Promise<void>;
|
|
497
625
|
/**
|
|
498
626
|
* Incrementally update a single row in the DataGrid.
|
|
499
627
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 桥接 AssetMatrix ProgressTableFillerController 与 DataGrid 组件
|
|
4
4
|
*/
|
|
5
5
|
export { ITableHeader, VIEWER_TYPE_MAP, mapHeaderToColumn, convertToDataGridColumns, getDataGridViewerType, mapViewerToNestedType, } from './columnAdapter';
|
|
6
|
-
export { PreprocessedRow, SearchMatchResult, expandProxyRow, calculatePermissions, collectErrors, calculateSearchMatch, calculateRowBgColor, preprocessRow, preprocessSingleRow, convertToDataGridRows, computeStageFlags, } from './rowDataAdapter';
|
|
6
|
+
export { PreprocessedRow, SearchMatchResult, expandProxyRow, calculatePermissions, collectErrors, calculateSearchMatch, calculateRowBgColor, preprocessRow, preprocessSingleRow, convertToDataGridRows, refreshColumnCellValues, refreshColumnCellValuesAsync, computeStageFlags, isPerfLogEnabled, } from './rowDataAdapter';
|
|
7
7
|
export { RowStyleResult, preprocessRowStyles, getRowClassName, getCellClassName, calculateFirstLeftColor, } from './styleAdapter';
|
|
8
8
|
export { DataGridEventAdapter, EventCategory, EventContext, extractEventContext, mapDomEventToDataGridEvent, } from './DataGridEventAdapter';
|
|
9
|
-
export { DataGridInitOptions, DataGridCallbacks, DataGridInitResult, buildDataGridInitParams, refreshDataGridRows, refreshDataGridColumns, refreshDataGridColumnByKeys, refreshDataGridRowByIndex, } from './DataGridIntegration';
|
|
9
|
+
export { DataGridInitOptions, DataGridCallbacks, DataGridInitResult, buildDataGridInitParams, refreshDataGridRows, refreshDataGridColumns, refreshDataGridColumnByKeys, refreshDataGridColumnByKeysAsync, refreshDataGridRowByIndex, } from './DataGridIntegration';
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
* 将 AssetMatrix 的逐格 getCellData 逻辑前移为整行预处理
|
|
4
4
|
*/
|
|
5
5
|
import type { ITableHeader } from './columnAdapter';
|
|
6
|
+
/**
|
|
7
|
+
* Check if performance logging is enabled.
|
|
8
|
+
* Toggle in DevTools console: `window.__PERF_LOG__ = true` to enable.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isPerfLogEnabled(): boolean;
|
|
6
11
|
/**
|
|
7
12
|
* Search match result for a row
|
|
8
13
|
*/
|
|
@@ -21,9 +26,9 @@ export interface PreprocessedRow {
|
|
|
21
26
|
_searchMatch: SearchMatchResult;
|
|
22
27
|
_cellBgColors: Record<string, string>;
|
|
23
28
|
_bgColor?: string;
|
|
29
|
+
_isTopLevelEntity?: boolean;
|
|
24
30
|
_isEmpty?: boolean;
|
|
25
31
|
_isGroup?: boolean;
|
|
26
|
-
_rowReadonly?: boolean;
|
|
27
32
|
_parentHasLink?: boolean;
|
|
28
33
|
_pathId?: string;
|
|
29
34
|
_originalPathId?: string | number;
|
|
@@ -42,7 +47,23 @@ export interface PreprocessedRow {
|
|
|
42
47
|
*/
|
|
43
48
|
export declare function expandProxyRow(row: Record<string, any>, headerKeys?: string[]): Record<string, any>;
|
|
44
49
|
/**
|
|
45
|
-
* Calculate
|
|
50
|
+
* Calculate per-cell canEdit permissions for each column.
|
|
51
|
+
*
|
|
52
|
+
* This is the SINGLE source of truth for whether a cell is editable.
|
|
53
|
+
* Cell.readonly in arthub-table is simply `!_permissions[key]`.
|
|
54
|
+
*
|
|
55
|
+
* Rules (in priority order):
|
|
56
|
+
* 1. Special rows (isSeparateRow, isEmpty, isGroup, isAddTask) → all false
|
|
57
|
+
* 2. When writePermissionInfo exists:
|
|
58
|
+
* - header.canEdit=false → false
|
|
59
|
+
* - parentHasLink → false
|
|
60
|
+
* - deliverable_review column → false
|
|
61
|
+
* - writePermissionInfo[key]=false or filterMatched=false → false
|
|
62
|
+
* - isLink columns → false
|
|
63
|
+
* - otherwise → !!writePermissionInfo[key]
|
|
64
|
+
* 3. When writePermissionInfo does NOT exist → default true (editable)
|
|
65
|
+
* - header.canEdit=false → false
|
|
66
|
+
* - isLink columns → false
|
|
46
67
|
*/
|
|
47
68
|
export declare function calculatePermissions(row: Record<string, any>, headers: ITableHeader[]): Record<string, boolean>;
|
|
48
69
|
/**
|
|
@@ -61,66 +82,78 @@ export declare function calculateSearchMatch(row: Record<string, any>, searchMat
|
|
|
61
82
|
* Calculate background color for a cell based on highlighted properties
|
|
62
83
|
*/
|
|
63
84
|
export declare function calculateRowBgColor(row: Record<string, any>, key: string, highlightedProperties: Record<string, string>): string | undefined;
|
|
85
|
+
export declare function resetPerfAccum(): void;
|
|
86
|
+
export declare function dumpPerfAccum(): void;
|
|
64
87
|
/**
|
|
65
88
|
* Preprocess a single row for DataGrid consumption
|
|
66
89
|
*/
|
|
67
|
-
export declare function preprocessRow(rawRow: Record<string, any>, headers: ITableHeader[], props: Record<string, any>): PreprocessedRow;
|
|
68
90
|
/**
|
|
69
|
-
*
|
|
91
|
+
* Pre-computed context for batch processing.
|
|
92
|
+
* Created once in convertToDataGridRows and reused for every row.
|
|
93
|
+
*/
|
|
94
|
+
export interface PrecomputedContext {
|
|
95
|
+
headerKeys: string[];
|
|
96
|
+
}
|
|
97
|
+
export declare function preprocessRow(rawRow: Record<string, any>, headers: ITableHeader[], props: Record<string, any>, precomputed?: PrecomputedContext): PreprocessedRow;
|
|
98
|
+
/**
|
|
99
|
+
* 批量将原始行数据转换为 DataGrid 预处理后的行数据
|
|
70
100
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
101
|
+
* 对每一行调用 preprocessRow 进行展开代理、权限计算、错误收集、
|
|
102
|
+
* 搜索匹配、单元格值转换等预处理操作。
|
|
73
103
|
*
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
* @param props -
|
|
77
|
-
* @
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
*
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
104
|
+
* @param tableDataList - 原始行数据列表
|
|
105
|
+
* @param allHeaders - 所有列头配置
|
|
106
|
+
* @param props - 业务 props(含 resolver、搜索列表等)
|
|
107
|
+
* @returns 预处理后的行数据数组
|
|
108
|
+
*/
|
|
109
|
+
export declare function convertToDataGridRows(tableDataList: Record<string, any>[], allHeaders: ITableHeader[], props: Record<string, any>): PreprocessedRow[];
|
|
110
|
+
/**
|
|
111
|
+
* 对指定列重新执行 transformCellValues,更新已预处理行数据中的值
|
|
112
|
+
*
|
|
113
|
+
* 用于增量列刷新场景:当某些列的数据或配置变化时,只需重新转换这些列的值,
|
|
114
|
+
* 而不必对所有行做全量 preprocessRow。
|
|
115
|
+
*
|
|
116
|
+
* @param preprocessedData - 已预处理的行数据数组(会被就地修改)
|
|
117
|
+
* @param rawDataList - 原始行数据列表(用于读取最新的原始值)
|
|
118
|
+
* @param colKeys - 需要刷新的列 key 列表
|
|
119
|
+
* @param allHeaders - 所有列头配置
|
|
120
|
+
* @param props - 业务 props
|
|
121
|
+
*/
|
|
122
|
+
export declare function refreshColumnCellValues(preprocessedData: PreprocessedRow[], rawDataList: Record<string, any>[], colKeys: string[], allHeaders: ITableHeader[], props: Record<string, any>): void;
|
|
89
123
|
/**
|
|
90
|
-
*
|
|
124
|
+
* [Optimization B] Async time-sliced version of refreshColumnCellValues.
|
|
125
|
+
* Processes rows in batches, yielding to the main thread between batches
|
|
126
|
+
* to prevent long tasks from blocking UI interactions (scrolling, input).
|
|
91
127
|
*
|
|
92
|
-
* @param
|
|
93
|
-
* @
|
|
94
|
-
* @param props - Controller props (searchMatchList, highlightedProperties, etc.)
|
|
95
|
-
* @returns Preprocessed rows ready for DataGrid
|
|
128
|
+
* @param batchSize - Number of rows to process per batch (default 200)
|
|
129
|
+
* @returns Promise that resolves when all rows have been processed
|
|
96
130
|
*/
|
|
97
|
-
export declare function
|
|
131
|
+
export declare function refreshColumnCellValuesAsync(preprocessedData: PreprocessedRow[], rawDataList: Record<string, any>[], colKeys: string[], allHeaders: ITableHeader[], props: Record<string, any>, batchSize?: number): Promise<void>;
|
|
98
132
|
/**
|
|
99
|
-
*
|
|
133
|
+
* 计算 Stage 分组标志位
|
|
100
134
|
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* - `_isFirstChildStage`: 该行是子环节分组的第一行
|
|
104
|
-
* - `_isLastChildStage`: 该行是子环节分组的最后一行
|
|
135
|
+
* 遍历所有行,对 Stage 类型的行计算 isChildStage、isFisrtChildStage、
|
|
136
|
+
* isLastChildStage 标志位,用于 Canvas 表格的父子区分显示。
|
|
105
137
|
*
|
|
106
|
-
* @param data -
|
|
107
|
-
* @param getTopParentStageByPath -
|
|
138
|
+
* @param data - 预处理后的行数据数组(会被就地修改)
|
|
139
|
+
* @param getTopParentStageByPath - 根据 path 获取顶层父 Stage 的函数
|
|
108
140
|
*/
|
|
109
141
|
export declare function computeStageFlags(data: PreprocessedRow[], getTopParentStageByPath: (path: any[]) => any): void;
|
|
110
142
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* 仅对 colKeys 对应的列重新执行 transformCellValues 逻辑,
|
|
114
|
-
* 不重新展开 Proxy 行、不重算权限/错误/搜索匹配/背景色,
|
|
115
|
-
* 性能开销 O(rows × colKeys.length),远低于全量 preprocessRow。
|
|
143
|
+
* 单行预处理(含样式计算)
|
|
116
144
|
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
145
|
+
* 与 preprocessRow 类似,但额外执行样式预处理和序号分配,
|
|
146
|
+
* 用于增量更新单行场景。
|
|
119
147
|
*
|
|
120
|
-
* @param
|
|
121
|
-
* @param
|
|
122
|
-
* @param
|
|
123
|
-
* @param
|
|
124
|
-
* @
|
|
148
|
+
* @param rawRow - 原始行数据
|
|
149
|
+
* @param allHeaders - 所有列头配置
|
|
150
|
+
* @param props - 业务 props
|
|
151
|
+
* @param options - 额外选项(行索引、列数、序号等)
|
|
152
|
+
* @returns 预处理后的行数据
|
|
125
153
|
*/
|
|
126
|
-
export declare function
|
|
154
|
+
export declare function preprocessSingleRow(rawRow: Record<string, any>, allHeaders: ITableHeader[], props: Record<string, any>, options: {
|
|
155
|
+
rowIndex: number;
|
|
156
|
+
columnsLength: number;
|
|
157
|
+
controllerProps: Record<string, any>;
|
|
158
|
+
tableIndex?: number;
|
|
159
|
+
}): PreprocessedRow;
|
|
@@ -12,6 +12,8 @@ export interface RowStyleResult {
|
|
|
12
12
|
_tapdBgColor?: string;
|
|
13
13
|
_isFirstLeft?: boolean;
|
|
14
14
|
_firstLeftColor?: string;
|
|
15
|
+
_demandChangeType?: 'add' | 'cancel';
|
|
16
|
+
_isTopLevelEntity?: boolean;
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
19
|
* Get row-level CSS class name based on row type and index
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* 默认头像 - base64 编码的 PNG 图片
|
|
3
3
|
* 对齐 AssetMatrix 中 StaticImageUrl,用于人员头像加载失败时的兜底显示
|
|
4
4
|
*/
|
|
5
|
-
export declare const DEFAULT_AVATAR_URL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAABGdBTUEAALGPC/xhBQAABVVJREFUeAHtnNtvVFUUxtdMZ6adaYehtEIKBbk1LUjVKgWDgCGhISQghECCL5KY+OSb/D/CG6kmJsYYJQGRcJFULiIYUlFQbhoDHUpnqL1Mx7OalGSaZnPO2btrrZ2s/
|
|
5
|
+
export declare const DEFAULT_AVATAR_URL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAABGdBTUEAALGPC/xhBQAABVVJREFUeAHtnNtvVFUUxtdMZ6adaYehtEIKBbk1LUjVKgWDgCGhISQghECCL5KY+OSb/D/CG6kmJsYYJQGRcJFULiIYUlFQbhoDHUpnqL1Mx7OalGSaZnPO2btrrZ2s/TLt7Mv69vc761z22W3io6P3q6BFjANJMUpUyLQDCkTYgaBAFIgwB4TJ0QxRIMIcECZHM0SBCHNAmBzNEAUizAFhcjRDFIgwB4TJ0QxRIMIcECZHM0SBCHNAmBzNEAUizAFhcjRDFIgwB4TJ0QxRIMIcECZHM0SBCHNAmBzNEGFAUsL0hJbTtiQF77yVg/UdDbC4NQV1waH1pFiBew/H4fqt/+DazVGoVEIPJ6ahd0Ay6QTs37UA+rY3QTKZqDGyvS0J7W1p2LKxER4PTUL/18Nw9cZoTRvpvyR82tu7fGkaPjnSAq+0hD+Ovvx2GL45PSKdwwt93lxDWprr4NOPWyPBwFke2F2At1/Pvpiw9B+8AfLhwWZYkK+L5efh9wuQitc1VjybTl4AWdmehg2dDbHnuWhhCtaurI/dn7KjF0B6uu1POV1rFYizA2vZkrT1WKtWZKzHoBjAiwxJOlA56w6ZwttYMRxMNVbcSJ3Kz6citZ+rccnBGHON6/o7L4AUh+0fuYtP7cdwbf5c43kBZMiBmU8cjDGXga6/Ew8kEayObHozZz3v3jey0+td1gPN8wDigSwOlkk619jfsnasqp9ehJxnP62HFw8EM8RZcTmWM1G1A4kHUirb32HNTNnlWDNjuv6UDyS4XZ2YsP9nExOTVRgpuYPrGsTMeOKBoNDBO2MzemN/Dv5hP0bs4BE6egHk+OdFuHz9eYRp1Tb9Keh7rH+o9kuhv3kBBB8ML12LD2Tg51F4+kz+6QqPES+AoNDf/xyHajX6tQT73L7rx+nKKyB4Qb51O7qx2MeHiznCwOJNhqDYk2ejvxv/7ofofTAWV/EKyM3BMfjxavhrycXLZfj1t+hZxQUD43oFBAWfuVDCj1Dl7KVyqHaSGnkHJMrLKqfLLkTUvAMSxeTZG+mIPLUK4x2QKCZHgWflosPOXgHB01Xn6vBL8d1dDYBbT30qXmwlzWQSsLU3B7vey0ProvDbSBHESLkC318ow5mLJS+eR0QDwe2jO7Y0wfbNjdCYs0tmXO0dCJZfTgd3aX89mBCbNOKApIME6F6Xnc4IPOVEuWaEdfnuvXE4N1CGK8HOeGnvSEQAWddRDz2vZeHVYMvoimUZsvP+1FQV/v53MlgnG4Mrv4yKeIhkBYLvyj/YV4DlS2XsKrz/aBxOfDUMnO9OWIDgXzsd2luAnVubICHs3hRXh0+dL8EXwR/7VBhW7O2ulGFP2rPaHTnUDH3b8uJgoEw8QFAbauQo5EB278jDu72NHHONFBM1olbqQgqkuVAHe/voJxnXVNSKmikLKZA9O/NQnyENaeUlakXNlIXMHVzC2NxjvyWU0hyMhZopl1/IgGwIHvKyDWThnHFDzaidqpA51OVgfy6VKbPjUGonA4JP4b4WSu1kQHAXu6+FUjsZkJzlai0nTErtZEAe/SN3yftlsB8SaicD8ll/EXDxLs7uw5cZNl/1qBU1Hwu0UxWWxUWqyfkYhyxDfDSHQ7MC4XDdEFOBGMzhqFIgHK4bYioQgzkcVQqEw3VDTAViMIejSoFwuG6IqUAM5nBUKRAO1w0xFYjBHI4qBcLhuiGmAjGYw1GlQDhcN8RUIAZzOKoUCIfrhpgKxGAOR5UC4XDdEFOBGMzhqFIgHK4bYioQgzkcVQqEw3VDTAViMIejSoFwuG6IqUAM5nBUKRAO1w0x/wfkhw8Kl6ANEgAAAABJRU5ErkJggg==";
|
|
@@ -33,6 +33,12 @@ declare class Body {
|
|
|
33
33
|
private rowAccessTime;
|
|
34
34
|
private maxCacheSize;
|
|
35
35
|
constructor(grid: DataGrid, data: RowData[]);
|
|
36
|
+
/**
|
|
37
|
+
* Clear all row caches (Row objects + LRU access times).
|
|
38
|
+
* Called when group dimension changes to force re-creation of all rows
|
|
39
|
+
* with updated styles (background colors, color bars, borders, etc.)
|
|
40
|
+
*/
|
|
41
|
+
clearRowCache(): void;
|
|
36
42
|
paint(data: RowData[]): void;
|
|
37
43
|
/**
|
|
38
44
|
* CTRL+V 粘贴
|
|
@@ -51,7 +57,7 @@ declare class Body {
|
|
|
51
57
|
handleCheckHeader(): void;
|
|
52
58
|
mouseMove(x: number, y: number): void;
|
|
53
59
|
mouseDown(x: number, y: number, shiftKey?: boolean): void;
|
|
54
|
-
click(x: number, y: number, clientX?: number, clientY?: number): void;
|
|
60
|
+
click(x: number, y: number, clientX?: number, clientY?: number, event?: MouseEvent): void;
|
|
55
61
|
dbClick(x: number, y: number): void;
|
|
56
62
|
/**
|
|
57
63
|
* Check if double click hits a viewer with onDblClick handler
|
|
@@ -37,9 +37,12 @@ declare class Cell extends Context {
|
|
|
37
37
|
fillColor?: string;
|
|
38
38
|
borderWidth?: number;
|
|
39
39
|
nestedGrid?: NestedGrid;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
/** @internal 是否有嵌套数据待创建(Body.tryAdoptNestedGrids 需要访问) */
|
|
41
|
+
hasNestedData: boolean;
|
|
42
|
+
/** @internal 嵌套配置(Body.tryAdoptNestedGrids 需要访问) */
|
|
43
|
+
nestedConfig?: any;
|
|
44
|
+
/** @internal 嵌套列配置(Body.updateRowByIndex 需要访问) */
|
|
45
|
+
nestedColumns?: any[];
|
|
43
46
|
viewerType?: string;
|
|
44
47
|
viewerData?: CellViewerData;
|
|
45
48
|
useViewer?: boolean;
|
|
@@ -56,6 +59,16 @@ declare class Cell extends Context {
|
|
|
56
59
|
* 仅在首次绘制时创建,避免构造函数中的大量对象创建
|
|
57
60
|
*/
|
|
58
61
|
private createNestedGridLazy;
|
|
62
|
+
/**
|
|
63
|
+
* 性能优化:从旧 Cell 迁移已有的 NestedGrid 实例(避免重建)。
|
|
64
|
+
*
|
|
65
|
+
* 当 Body.paint() 重建 Row/Cell 时,如果嵌套数据未变化,
|
|
66
|
+
* 可以通过此方法直接复用旧 Cell 的 NestedGrid 实例,跳过重建。
|
|
67
|
+
*
|
|
68
|
+
* @param oldNestedGrid 旧 Cell 上的 NestedGrid 实例
|
|
69
|
+
* @param dataChanged 嵌套数据是否发生了变化(如果变化了,需要 updateData)
|
|
70
|
+
*/
|
|
71
|
+
adoptNestedGrid(oldNestedGrid: NestedGrid, dataChanged: boolean): void;
|
|
59
72
|
/**
|
|
60
73
|
* Build viewer data from cell properties
|
|
61
74
|
*/
|
|
@@ -30,8 +30,24 @@ declare class ColumnHeader extends Context {
|
|
|
30
30
|
width: number;
|
|
31
31
|
height: number;
|
|
32
32
|
} | null;
|
|
33
|
+
convertMeta: string;
|
|
33
34
|
constructor(grid: DataGrid, index: number, x: number, y: number, width: number, height: number, column: Column);
|
|
34
35
|
isVisibleOnScreen(): boolean;
|
|
35
36
|
draw(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Check if this nested-child column is the last child of its parent nested column.
|
|
39
|
+
* Compares right edge of this child with right edge of the parent header.
|
|
40
|
+
*/
|
|
41
|
+
private _isLastNestedChild;
|
|
42
|
+
/**
|
|
43
|
+
* Check if this column header's right edge is shared with another nested column's left edge.
|
|
44
|
+
* Used to split the shared border into two 1px lines with different colors.
|
|
45
|
+
*/
|
|
46
|
+
private _isRightEdgeSharedWithNestedColumn;
|
|
47
|
+
/**
|
|
48
|
+
* Check if this column header's left edge is shared with another nested column's right edge.
|
|
49
|
+
* Used to split the shared border into two 1px lines with different colors.
|
|
50
|
+
*/
|
|
51
|
+
private _isLeftEdgeSharedWithNestedColumn;
|
|
36
52
|
}
|
|
37
53
|
export default ColumnHeader;
|