arthub-table 0.2.28 → 0.2.29-next.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/core/Footer.d.ts +6 -1
- package/dist/types/core/GroupRow.d.ts +4 -1
- package/dist/types/core/viewers/DeliveryExpectationsViewer.d.ts +64 -0
- package/dist/types/core/viewers/index.d.ts +3 -0
- package/package.json +1 -1
|
@@ -36,7 +36,12 @@ declare class Footer {
|
|
|
36
36
|
* 布局从右到左:[下拉箭头(ARROW_ICON_SIZE)] [刷新icon(REFRESH_ICON_PADDING + REFRESH_ICON_SIZE + REFRESH_ICON_PADDING)]
|
|
37
37
|
*/
|
|
38
38
|
private isInsideRefreshIcon;
|
|
39
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* 从列配置中查找指定 key 的列。
|
|
41
|
+
* 注意:必须按 key 匹配,不能按 index — grid.headers 由 calCrossSpan 生成的复合表头树形结构,
|
|
42
|
+
* 元素本身并无 index 字段(HeaderConfig 仅有 level/rowspan/colspan/children),
|
|
43
|
+
* 而 ColumnHeader 的 index 是叶子列序号,与 headers 树形结构无对应关系。
|
|
44
|
+
*/
|
|
40
45
|
private findColumnConfig;
|
|
41
46
|
/** 绘制 footer */
|
|
42
47
|
draw(): void;
|
|
@@ -309,7 +309,10 @@ declare class GroupRow extends Context {
|
|
|
309
309
|
*/
|
|
310
310
|
private isInsideNestedRefreshIcon;
|
|
311
311
|
/**
|
|
312
|
-
*
|
|
312
|
+
* 从列配置中查找指定 key 的列。
|
|
313
|
+
* 注意:必须按 key 匹配,不能按 index — grid.headers 由 calCrossSpan 生成的复合表头树形结构,
|
|
314
|
+
* 元素本身并无 index 字段(HeaderConfig 仅有 level/rowspan/colspan/children),
|
|
315
|
+
* 而 ColumnHeader 的 index 是叶子列序号,与 headers 树形结构无对应关系。
|
|
313
316
|
*/
|
|
314
317
|
private findColumnConfig;
|
|
315
318
|
dbClick(_x: number, _y: number): void;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DeliveryExpectationsViewer - 交付预期单元格渲染器(Canvas 实现)
|
|
3
|
+
*
|
|
4
|
+
* 功能:
|
|
5
|
+
* 1. 多行文本渲染:每个 module 一行,用逗号分隔时换行展示
|
|
6
|
+
* 2. 逾期标红:当 item.color === 'red' 时,该行文字渲染为红色
|
|
7
|
+
* 3. 点击交互:点击单元格弹出下拉浮窗展示完整内容
|
|
8
|
+
*
|
|
9
|
+
* 数据格式:
|
|
10
|
+
* delivery_expectations: [
|
|
11
|
+
* { color: "red", estimate_end_date: 1758815999000, module: "【默认模块 2】09月25日" }
|
|
12
|
+
* ]
|
|
13
|
+
*/
|
|
14
|
+
import type { CellViewer, ViewerRenderContext, CellViewerData } from './types';
|
|
15
|
+
/**
|
|
16
|
+
* 交付预期项
|
|
17
|
+
*/
|
|
18
|
+
export interface DeliveryExpectationItem {
|
|
19
|
+
/** 颜色标记,'red' 表示逾期 */
|
|
20
|
+
color?: string;
|
|
21
|
+
/** 预计结束时间戳 */
|
|
22
|
+
estimate_end_date?: number;
|
|
23
|
+
/** 模块显示文本,如 "【品牌】可验收,【配置】可验收" */
|
|
24
|
+
module: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 交付预期 viewer 数据
|
|
28
|
+
*/
|
|
29
|
+
export interface DeliveryExpectationsViewerData extends CellViewerData {
|
|
30
|
+
/** 交付预期列表 */
|
|
31
|
+
value: DeliveryExpectationItem[] | string | null;
|
|
32
|
+
/** 占位符文本,默认 '-' */
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
}
|
|
35
|
+
declare class DeliveryExpectationsViewer implements CellViewer<DeliveryExpectationsViewerData> {
|
|
36
|
+
readonly type = "delivery-expectations";
|
|
37
|
+
/**
|
|
38
|
+
* 绘制交付预期单元格内容
|
|
39
|
+
*/
|
|
40
|
+
draw(context: ViewerRenderContext, data: DeliveryExpectationsViewerData): void;
|
|
41
|
+
/**
|
|
42
|
+
* 点击事件处理:返回 false 不阻止默认选中行为,
|
|
43
|
+
* 由外部 afterSelectCell 回调检测 viewerType 后弹出浮窗
|
|
44
|
+
*/
|
|
45
|
+
onClick(_context: ViewerRenderContext, _data: DeliveryExpectationsViewerData, _localX: number, _localY: number): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* 鼠标悬停时显示手型光标
|
|
48
|
+
*/
|
|
49
|
+
getInteractiveCursor(_context: ViewerRenderContext, data: DeliveryExpectationsViewerData, _localX: number, _localY: number): string | null;
|
|
50
|
+
/**
|
|
51
|
+
* 解析数据为 DeliveryExpectationItem 数组
|
|
52
|
+
*/
|
|
53
|
+
private parseItems;
|
|
54
|
+
/**
|
|
55
|
+
* 将 items 拆分为多行显示
|
|
56
|
+
* 每个 item 的 module 文本按逗号拆分为多行
|
|
57
|
+
*/
|
|
58
|
+
private splitToLines;
|
|
59
|
+
/**
|
|
60
|
+
* 截断文本并添加省略号
|
|
61
|
+
*/
|
|
62
|
+
private truncateWithEllipsis;
|
|
63
|
+
}
|
|
64
|
+
export default DeliveryExpectationsViewer;
|
|
@@ -42,6 +42,7 @@ export { default as OnlyShowErrorViewer } from './OnlyShowErrorViewer';
|
|
|
42
42
|
export { default as PerspectiveViewer } from './PerspectiveViewer';
|
|
43
43
|
export { default as RelatedTaskViewer } from './RelatedTaskViewer';
|
|
44
44
|
export { default as CpPersonViewer } from './CpPersonViewer';
|
|
45
|
+
export { default as DeliveryExpectationsViewer } from './DeliveryExpectationsViewer';
|
|
45
46
|
import TextViewer from './TextViewer';
|
|
46
47
|
import DropdownViewer from './DropdownViewer';
|
|
47
48
|
import ImageViewer from './ImageViewer';
|
|
@@ -80,6 +81,7 @@ import OnlyShowErrorViewer from './OnlyShowErrorViewer';
|
|
|
80
81
|
import PerspectiveViewer from './PerspectiveViewer';
|
|
81
82
|
import RelatedTaskViewer from './RelatedTaskViewer';
|
|
82
83
|
import CpPersonViewer from './CpPersonViewer';
|
|
84
|
+
import DeliveryExpectationsViewer from './DeliveryExpectationsViewer';
|
|
83
85
|
/**
|
|
84
86
|
* Register all default viewers
|
|
85
87
|
* Call this function once during application initialization
|
|
@@ -132,4 +134,5 @@ export declare const defaultViewers: {
|
|
|
132
134
|
perspective: typeof PerspectiveViewer;
|
|
133
135
|
'related-task': typeof RelatedTaskViewer;
|
|
134
136
|
'cp-person': typeof CpPersonViewer;
|
|
137
|
+
'delivery-expectations': typeof DeliveryExpectationsViewer;
|
|
135
138
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arthub-table",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.29-next.1",
|
|
4
4
|
"description": "High-performance canvas-based table/grid component for Vue 3 with TypeScript support, featuring virtual scrolling, cell viewers, grouped rows, and nested grids.",
|
|
5
5
|
"main": "dist/arthub-table.common.js",
|
|
6
6
|
"module": "dist/arthub-table.umd.min.js",
|