arthub-table 0.2.0-beta.9 → 0.2.1
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 +51 -0
- package/dist/types/adapters/columnAdapter.d.ts +7 -0
- package/dist/types/adapters/rowDataAdapter.d.ts +23 -0
- package/dist/types/core/ColumnHeader.d.ts +26 -0
- package/dist/types/core/DataGrid.d.ts +362 -4
- package/dist/types/core/Events.d.ts +0 -1
- package/dist/types/core/GroupRow.d.ts +46 -0
- package/dist/types/core/ImageManager.d.ts +21 -0
- package/dist/types/core/NestedGrid.d.ts +56 -1
- package/dist/types/core/StyleManager.d.ts +2 -0
- package/dist/types/core/constants.d.ts +1 -0
- package/dist/types/core/types.d.ts +14 -0
- package/dist/types/core/viewers/FileViewer.d.ts +3 -3
- package/dist/types/core/viewers/ImageViewer.d.ts +3 -3
- package/dist/types/core/viewers/ModuleViewer.d.ts +10 -9
- package/dist/types/core/viewers/PivotViewer.d.ts +42 -1
- package/dist/types/core/viewers/RelatedTaskViewer.d.ts +76 -0
- package/dist/types/core/viewers/TextViewerWithSwitcher.d.ts +22 -2
- package/dist/types/core/viewers/index.d.ts +3 -0
- package/dist/types/core/viewers/types.d.ts +115 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/testing/TestHooks.d.ts +187 -24
- package/dist/types/testing/index.d.ts +1 -1
- package/dist/types/testing/installTestHooks.d.ts +4 -4
- package/package.json +5 -1
|
@@ -121,6 +121,12 @@ export interface DataGridInitOptions {
|
|
|
121
121
|
* 使宿主应用可以覆盖默认的 fontFamilyPrimary / fontFamilySystem 等 Token。
|
|
122
122
|
*/
|
|
123
123
|
customTokens?: Record<string, any>;
|
|
124
|
+
/**
|
|
125
|
+
* 是否隐藏表头业务图标(TAPD / IOMC / fieldHint / link)。
|
|
126
|
+
* 对齐 DOM 表格的 "显示表头图标" 开关(tableHeaderIconConfigStorage.hideIcon)。
|
|
127
|
+
* 默认 false(显示图标)。
|
|
128
|
+
*/
|
|
129
|
+
hideHeaderIcons?: boolean;
|
|
124
130
|
}
|
|
125
131
|
/**
|
|
126
132
|
* DataGrid 事件回调配置
|
|
@@ -276,6 +282,9 @@ export interface DataGridCallbacks {
|
|
|
276
282
|
colId: string;
|
|
277
283
|
colIndex: number;
|
|
278
284
|
colTitle: string;
|
|
285
|
+
colKey: string;
|
|
286
|
+
colType?: string;
|
|
287
|
+
parentKey?: string;
|
|
279
288
|
clientX: number;
|
|
280
289
|
clientY: number;
|
|
281
290
|
}) => void;
|
|
@@ -284,8 +293,17 @@ export interface DataGridCallbacks {
|
|
|
284
293
|
colId: string;
|
|
285
294
|
colIndex: number;
|
|
286
295
|
colTitle: string;
|
|
296
|
+
colKey: string;
|
|
297
|
+
colType?: string;
|
|
298
|
+
parentKey?: string;
|
|
287
299
|
clientX: number;
|
|
288
300
|
clientY: number;
|
|
301
|
+
headerBounds: {
|
|
302
|
+
left: number;
|
|
303
|
+
top: number;
|
|
304
|
+
width: number;
|
|
305
|
+
height: number;
|
|
306
|
+
};
|
|
289
307
|
}) => void;
|
|
290
308
|
/** 嵌套列设置图标点击 */
|
|
291
309
|
onNestedSettingsClick?: (info: {
|
|
@@ -397,6 +415,25 @@ export interface DataGridCallbacks {
|
|
|
397
415
|
nestedGridData: any[];
|
|
398
416
|
}>;
|
|
399
417
|
}) => void;
|
|
418
|
+
/** 嵌套子表内子行拖动排序回调(Alt + 拖拽触发,不跨外层行) */
|
|
419
|
+
onNestedRowDragReorder?: (params: {
|
|
420
|
+
parentRowData: any;
|
|
421
|
+
parentColKey: string;
|
|
422
|
+
parentRowIndex: number;
|
|
423
|
+
parentColIndex: number;
|
|
424
|
+
/** 被拖拽的子行索引(相对 nestedGridData) */
|
|
425
|
+
fromRowIndex: number;
|
|
426
|
+
/** 目标插入位置索引(相对 nestedGridData) */
|
|
427
|
+
toRowIndex: number;
|
|
428
|
+
/** 插入位置:front 插到目标行之前,tail 插到目标行之后 */
|
|
429
|
+
position: 'front' | 'tail';
|
|
430
|
+
/** 被拖拽子行数据 */
|
|
431
|
+
fromRowData: any;
|
|
432
|
+
/** 目标参考子行数据 */
|
|
433
|
+
toRowData: any;
|
|
434
|
+
/** NestedGrid 实际渲染的数据数组 */
|
|
435
|
+
nestedGridData: any[];
|
|
436
|
+
}) => void;
|
|
400
437
|
/** 滚动回调 */
|
|
401
438
|
onScroll?: (scrollX: number, scrollY: number) => void;
|
|
402
439
|
/** 滚动开始回调 */
|
|
@@ -509,6 +546,20 @@ export interface DataGridCallbacks {
|
|
|
509
546
|
height: number;
|
|
510
547
|
};
|
|
511
548
|
}) => void;
|
|
549
|
+
/** 表头 fieldHint info icon hover 回调:鼠标悬停/离开字段提示图标时触发 */
|
|
550
|
+
onHeaderFieldHintIconHover?: (info: {
|
|
551
|
+
show: boolean;
|
|
552
|
+
colKey: string;
|
|
553
|
+
colIndex: number;
|
|
554
|
+
colTitle: string;
|
|
555
|
+
fieldHint: string;
|
|
556
|
+
position: {
|
|
557
|
+
x: number;
|
|
558
|
+
y: number;
|
|
559
|
+
width: number;
|
|
560
|
+
height: number;
|
|
561
|
+
};
|
|
562
|
+
}) => void;
|
|
512
563
|
/** 表体 Link icon 点击回调:点击引用字段单元格的 link icon 时触发 */
|
|
513
564
|
onLinkIconClick?: (info: {
|
|
514
565
|
rowData: Record<string, any>;
|
|
@@ -32,6 +32,7 @@ export interface ITableHeader {
|
|
|
32
32
|
id?: string;
|
|
33
33
|
isTapdRelated?: boolean;
|
|
34
34
|
isIomc?: boolean;
|
|
35
|
+
fieldHint?: string;
|
|
35
36
|
showUserWorkingHours?: boolean;
|
|
36
37
|
statisticType?: string;
|
|
37
38
|
loading?: boolean;
|
|
@@ -44,6 +45,12 @@ export interface ITableHeader {
|
|
|
44
45
|
headerOriginIndex?: number;
|
|
45
46
|
perspectiveColChildren?: any[];
|
|
46
47
|
isDisplayThumbnail?: boolean;
|
|
48
|
+
isAcceptanceRemind?: boolean;
|
|
49
|
+
showAcceptanceRemind?: boolean;
|
|
50
|
+
/** 是否显示筛选图标(hover 时)。显式 false 时不绘制筛选 icon(排序相关图标保留)。默认等同 true */
|
|
51
|
+
showFilterIcon?: boolean;
|
|
52
|
+
/** 筛选命中该列时为 true:筛选图标常驻显示且显示激活色 */
|
|
53
|
+
filterIconActive?: boolean;
|
|
47
54
|
}
|
|
48
55
|
/**
|
|
49
56
|
* AssetMatrix ViewerNames 到 DataGrid ColumnType 的映射表
|
|
@@ -34,6 +34,10 @@ export interface PreprocessedRow {
|
|
|
34
34
|
_originalPathId?: string | number;
|
|
35
35
|
_tableTreeLevel?: number;
|
|
36
36
|
_proxyedDataRef?: Record<string, any>;
|
|
37
|
+
/** 组头行是否被搜索命中(仅 isGroup 行有效),供 GroupRow 渲染查询 */
|
|
38
|
+
_groupHeaderSearchMatched?: boolean;
|
|
39
|
+
/** 组头行是否是当前高亮项(需要绘制 2px 橙色 inset 边框),仅 isGroup 行有效 */
|
|
40
|
+
_groupHeaderSearchCurrentHighlight?: boolean;
|
|
37
41
|
}
|
|
38
42
|
/**
|
|
39
43
|
* Expand proxy row (parentHasLink or isUsePathId)
|
|
@@ -72,11 +76,15 @@ export declare function calculatePermissions(row: Record<string, any>, headers:
|
|
|
72
76
|
export declare function collectErrors(row: Record<string, any>, headers: ITableHeader[]): Record<string, string>;
|
|
73
77
|
/**
|
|
74
78
|
* Calculate search match state for the row
|
|
79
|
+
*
|
|
80
|
+
* Note: `isGroupHeader` is an opaque field used by GroupRow rendering only.
|
|
81
|
+
* It is transparently ignored here (data row match semantics remain unchanged).
|
|
75
82
|
*/
|
|
76
83
|
export declare function calculateSearchMatch(row: Record<string, any>, searchMatchList: Array<{
|
|
77
84
|
id: string | number;
|
|
78
85
|
key: string;
|
|
79
86
|
highlight?: boolean;
|
|
87
|
+
isGroupHeader?: boolean;
|
|
80
88
|
}>): SearchMatchResult;
|
|
81
89
|
/**
|
|
82
90
|
* Calculate background color for a cell based on highlighted properties
|
|
@@ -100,6 +108,7 @@ export interface PrecomputedContext {
|
|
|
100
108
|
searchMatchMap?: Map<string | number, Array<{
|
|
101
109
|
key: string;
|
|
102
110
|
highlight?: boolean;
|
|
111
|
+
isGroupHeader?: boolean;
|
|
103
112
|
}>>;
|
|
104
113
|
/**
|
|
105
114
|
* Pre-filtered headers that actually need transformCellValues processing.
|
|
@@ -194,3 +203,17 @@ export declare function preprocessSingleRow(rawRow: Record<string, any>, allHead
|
|
|
194
203
|
controllerProps: Record<string, any>;
|
|
195
204
|
tableIndex?: number;
|
|
196
205
|
}): PreprocessedRow;
|
|
206
|
+
/**
|
|
207
|
+
* Rebuild _nestedData for specific nested columns on given preprocessed rows.
|
|
208
|
+
*
|
|
209
|
+
* This extracts the nested data construction logic from convertToDataGridRows,
|
|
210
|
+
* allowing incremental rebuild of _nestedData when a child column's data changes
|
|
211
|
+
* (e.g. file/image upload in a nested sub-table) without a full data refresh.
|
|
212
|
+
*
|
|
213
|
+
* @param rows - Preprocessed row array (same as body.data / _dataGridData)
|
|
214
|
+
* @param rawRows - Raw row data array (same as tableDataList)
|
|
215
|
+
* @param nestedParentKeys - Keys of the nested parent columns to rebuild
|
|
216
|
+
* @param allHeaders - All column headers (including nested columns with children)
|
|
217
|
+
* @param props - Controller props (pipelineViewKey, displayTaskNum, iconUrlPrefix, etc.)
|
|
218
|
+
*/
|
|
219
|
+
export declare function rebuildNestedColumnData(rows: PreprocessedRow[], rawRows: Record<string, any>[], nestedParentKeys: string[], allHeaders: ITableHeader[], props: Record<string, any>): void;
|
|
@@ -21,6 +21,13 @@ declare class ColumnHeader extends Context {
|
|
|
21
21
|
color?: string;
|
|
22
22
|
isTapdRelated: boolean;
|
|
23
23
|
isIomc: boolean;
|
|
24
|
+
fieldHint: string;
|
|
25
|
+
fieldHintIconBounds: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
} | null;
|
|
24
31
|
isLink: boolean;
|
|
25
32
|
linkKey?: string;
|
|
26
33
|
linkTask?: string;
|
|
@@ -32,9 +39,28 @@ declare class ColumnHeader extends Context {
|
|
|
32
39
|
} | null;
|
|
33
40
|
convertMeta: string;
|
|
34
41
|
sortDisabled: boolean;
|
|
42
|
+
showFilterIcon: boolean | undefined;
|
|
43
|
+
filterIconActive: boolean | undefined;
|
|
35
44
|
constructor(grid: DataGrid, index: number, x: number, y: number, width: number, height: number, column: Column);
|
|
36
45
|
isVisibleOnScreen(): boolean;
|
|
37
46
|
draw(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Invalidate fieldHintIconBounds / linkIconBounds hit-boxes if the icon is visually
|
|
49
|
+
* covered by the given mask rectangle (which covers the sort/filter icon area) by >= 50%.
|
|
50
|
+
*
|
|
51
|
+
* Background: when the column width is narrow, the sort/filter icon mask paints over
|
|
52
|
+
* the fieldHint info icon and/or link icon (both drawn earlier in the same draw pass).
|
|
53
|
+
* The icon is no longer visible to the user, so hover interaction must not trigger the
|
|
54
|
+
* associated popper/tooltip. By zeroing the bounds here, the hover hit-testing in
|
|
55
|
+
* Events.ts naturally short-circuits (`if (... && xxxIconBounds)`).
|
|
56
|
+
*
|
|
57
|
+
* Threshold: 50% area coverage. Partial occlusion below 50% keeps the bounds active,
|
|
58
|
+
* matching user expectation that a mostly-visible icon remains interactive.
|
|
59
|
+
*
|
|
60
|
+
* Mask rectangle spans full header height (this.y, this.height), so only horizontal
|
|
61
|
+
* overlap matters in practice, but we compute 2D overlap for correctness.
|
|
62
|
+
*/
|
|
63
|
+
private _invalidateBoundsIfMasked;
|
|
38
64
|
/**
|
|
39
65
|
* Check if this nested-child column is the last child of its parent nested column.
|
|
40
66
|
* Compares right edge of this child with right edge of the parent header.
|