arthub-table 0.2.51-next.3 → 0.2.51
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/viewers/BooleanViewer.d.ts +7 -23
- package/dist/types/core/viewers/HyperlinkTextViewer.d.ts +9 -9
- package/dist/types/core/viewers/PriorityTextViewer.d.ts +2 -7
- package/dist/types/core/viewers/ProgressViewer.d.ts +0 -8
- package/dist/types/core/viewers/RichTextViewer.d.ts +3 -3
- package/dist/types/core/viewers/types.d.ts +6 -7
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* BooleanViewer - Boolean/Checkbox rendering viewer
|
|
3
|
-
* Handles boolean value display with checkbox, switch, or text styles
|
|
4
|
-
* 支持单值和数组值(多节点引用场景)。
|
|
3
|
+
* Handles boolean value display with checkbox, switch, or text styles
|
|
5
4
|
*/
|
|
6
5
|
import type { CellViewer, ViewerRenderContext, BooleanViewerData } from './types';
|
|
7
6
|
/**
|
|
@@ -12,14 +11,15 @@ declare class BooleanViewer implements CellViewer<BooleanViewerData> {
|
|
|
12
11
|
readonly type = "boolean";
|
|
13
12
|
readonly hideEditIcon = true;
|
|
14
13
|
/**
|
|
15
|
-
* Handle click on boolean cell
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* Handle click on boolean cell
|
|
15
|
+
* Returns true if the click was on the checkbox/switch area
|
|
16
|
+
* 注意:实际的值切换、乐观更新、onValueChange 回调和重绘由 Row.mouseDown 统一处理
|
|
17
|
+
* 此方法仅做命中检测,返回 true 表示点击在交互区域内
|
|
18
18
|
*/
|
|
19
19
|
onClick(context: ViewerRenderContext, data: BooleanViewerData, localX: number, localY: number): boolean;
|
|
20
20
|
/**
|
|
21
21
|
* 鼠标悬停在 checkbox/switch 交互区域时显示指针光标
|
|
22
|
-
*
|
|
22
|
+
* 注意:不能调用 onClick,否则会在 mousemove 时触发值变更
|
|
23
23
|
*/
|
|
24
24
|
getInteractiveCursor(context: ViewerRenderContext, data: BooleanViewerData, localX: number, localY: number): string | null;
|
|
25
25
|
/**
|
|
@@ -27,8 +27,7 @@ declare class BooleanViewer implements CellViewer<BooleanViewerData> {
|
|
|
27
27
|
*/
|
|
28
28
|
private hitTestArea;
|
|
29
29
|
/**
|
|
30
|
-
* Draw boolean content in the cell
|
|
31
|
-
* 数组值场景:渲染多个 checkbox/switch/text 标签并排显示。
|
|
30
|
+
* Draw boolean content in the cell
|
|
32
31
|
*/
|
|
33
32
|
draw(context: ViewerRenderContext, data: BooleanViewerData): void;
|
|
34
33
|
/**
|
|
@@ -41,9 +40,6 @@ declare class BooleanViewer implements CellViewer<BooleanViewerData> {
|
|
|
41
40
|
* - checkboxBorderDisabled : border (readonly + unchecked)
|
|
42
41
|
* `data.checkedColor` may override the editable-checked fill color.
|
|
43
42
|
*/
|
|
44
|
-
/**
|
|
45
|
-
* Draw a single checkbox using toBool for string-compatible boolean detection.
|
|
46
|
-
*/
|
|
47
43
|
private drawCheckbox;
|
|
48
44
|
/**
|
|
49
45
|
* Draw switch style
|
|
@@ -53,18 +49,6 @@ declare class BooleanViewer implements CellViewer<BooleanViewerData> {
|
|
|
53
49
|
* Draw text style
|
|
54
50
|
*/
|
|
55
51
|
private drawText;
|
|
56
|
-
/**
|
|
57
|
-
* 绘制空状态(数组值全为空/无有效值时显示)
|
|
58
|
-
*/
|
|
59
|
-
private drawEmpty;
|
|
60
|
-
/**
|
|
61
|
-
* 绘制多个 checkbox 标签(数组值场景),每项 16×16,间隔 4px,整组居中
|
|
62
|
-
*/
|
|
63
|
-
private drawCheckboxes;
|
|
64
|
-
/**
|
|
65
|
-
* 数组值 fallback:用文本形式展示多个布尔值,以逗号分隔
|
|
66
|
-
*/
|
|
67
|
-
private drawTexts;
|
|
68
52
|
/**
|
|
69
53
|
* Draw a filled rounded rectangle
|
|
70
54
|
*/
|
|
@@ -8,8 +8,8 @@ import type { CellViewer, ViewerRenderContext, CellViewerData } from './types';
|
|
|
8
8
|
* 超链接 Viewer 数据接口
|
|
9
9
|
*/
|
|
10
10
|
export interface HyperlinkTextViewerData extends CellViewerData {
|
|
11
|
-
/**
|
|
12
|
-
value: string
|
|
11
|
+
/** 值格式:[显示文本, 链接URL] 或 null */
|
|
12
|
+
value: [string, string] | null;
|
|
13
13
|
/** 数据行 ID */
|
|
14
14
|
id?: string | number;
|
|
15
15
|
/** 属性 key */
|
|
@@ -45,14 +45,14 @@ declare class HyperlinkTextViewer implements CellViewer<HyperlinkTextViewerData>
|
|
|
45
45
|
*/
|
|
46
46
|
getInteractiveCursor(context: ViewerRenderContext, data: HyperlinkTextViewerData, localX: number, localY: number): string | null;
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
48
|
+
* 解析超链接值
|
|
49
|
+
* 值格式为数组 [显示文本, 链接URL]
|
|
50
50
|
*/
|
|
51
|
-
private
|
|
51
|
+
private parseValue;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* 绘制超链接文本
|
|
54
54
|
*/
|
|
55
|
-
private
|
|
55
|
+
private drawHyperLinkText;
|
|
56
56
|
/**
|
|
57
57
|
* 绘制右侧编辑按钮
|
|
58
58
|
*/
|
|
@@ -74,8 +74,8 @@ declare class HyperlinkTextViewer implements CellViewer<HyperlinkTextViewerData>
|
|
|
74
74
|
*/
|
|
75
75
|
private drawErrorIcon;
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
77
|
+
* 文本截断,超出宽度时显示省略号
|
|
78
78
|
*/
|
|
79
|
-
private
|
|
79
|
+
private truncateText;
|
|
80
80
|
}
|
|
81
81
|
export default HyperlinkTextViewer;
|
|
@@ -12,16 +12,11 @@ declare class PriorityTextViewer implements CellViewer<PriorityTextViewerData> {
|
|
|
12
12
|
/** 空值占位符 */
|
|
13
13
|
private readonly emptyValue;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* 支持单值(string | number)和多节点引用场景的数组值。
|
|
15
|
+
* 绘制优先级标签内容
|
|
17
16
|
*/
|
|
18
17
|
draw(context: ViewerRenderContext, data: PriorityTextViewerData): void;
|
|
19
18
|
/**
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
private drawPriorityTags;
|
|
23
|
-
/**
|
|
24
|
-
* 绘制单个优先级标签
|
|
19
|
+
* 绘制优先级标签
|
|
25
20
|
*/
|
|
26
21
|
private drawPriorityTag;
|
|
27
22
|
/**
|
|
@@ -18,10 +18,6 @@ declare class ProgressViewer implements CellViewer<ProgressViewerData> {
|
|
|
18
18
|
* Draw progress bar in the cell
|
|
19
19
|
*/
|
|
20
20
|
draw(context: ViewerRenderContext, data: ProgressViewerData): void;
|
|
21
|
-
/**
|
|
22
|
-
* 绘制数组数值文本(逗号间隔,不渲染进度条)
|
|
23
|
-
*/
|
|
24
|
-
private drawArrayText;
|
|
25
21
|
/**
|
|
26
22
|
* Check if mouse is over the drag handle
|
|
27
23
|
*/
|
|
@@ -38,10 +34,6 @@ declare class ProgressViewer implements CellViewer<ProgressViewerData> {
|
|
|
38
34
|
* Handle drag end - trigger onProgressChange callback for data persistence
|
|
39
35
|
*/
|
|
40
36
|
onDragEnd(_context: ViewerRenderContext, data: ProgressViewerData, newValue: any, startValue?: any): void;
|
|
41
|
-
/**
|
|
42
|
-
* 从 data.value 中提取单值(数组长度 <= 1 时取首个元素,否则返回 NaN)
|
|
43
|
-
*/
|
|
44
|
-
private getSingleValue;
|
|
45
37
|
/**
|
|
46
38
|
* Check if mouse is over the drag handle
|
|
47
39
|
*/
|
|
@@ -9,8 +9,8 @@ import type { CellViewer, ViewerRenderContext, CellViewerData } from './types';
|
|
|
9
9
|
* 富文本 Viewer 数据接口
|
|
10
10
|
*/
|
|
11
11
|
export interface RichTextViewerData extends CellViewerData {
|
|
12
|
-
/** HTML
|
|
13
|
-
value: string |
|
|
12
|
+
/** HTML 富文本内容或纯文本 */
|
|
13
|
+
value: string | null;
|
|
14
14
|
/** 数据行 ID */
|
|
15
15
|
id?: string | number;
|
|
16
16
|
/** 属性 key */
|
|
@@ -35,7 +35,7 @@ export interface RichTextViewerData extends CellViewerData {
|
|
|
35
35
|
* 解析富文本值,去除 HTML 标签 + 解码常见 HTML 实体。
|
|
36
36
|
* <img> 标签替换为 [图片],<video> 标签替换为 [视频]
|
|
37
37
|
*/
|
|
38
|
-
export declare function getDisplayValue(value: string |
|
|
38
|
+
export declare function getDisplayValue(value: string | null | undefined): string;
|
|
39
39
|
declare class RichTextViewer implements CellViewer<RichTextViewerData> {
|
|
40
40
|
readonly type = "rich-text";
|
|
41
41
|
private _sm;
|
|
@@ -409,7 +409,7 @@ export interface PersonInfo {
|
|
|
409
409
|
* Progress viewer data
|
|
410
410
|
*/
|
|
411
411
|
export interface ProgressViewerData extends CellViewerData {
|
|
412
|
-
value: number
|
|
412
|
+
value: number;
|
|
413
413
|
/** Minimum value (default 0) */
|
|
414
414
|
min?: number;
|
|
415
415
|
/** Maximum value (default 100) */
|
|
@@ -460,8 +460,7 @@ export interface DatetimeViewerData extends CellViewerData {
|
|
|
460
460
|
* Boolean/Checkbox viewer data
|
|
461
461
|
*/
|
|
462
462
|
export interface BooleanViewerData extends CellViewerData {
|
|
463
|
-
|
|
464
|
-
value: (boolean | string)[] | boolean | string | null;
|
|
463
|
+
value: boolean | null;
|
|
465
464
|
/** Display style */
|
|
466
465
|
displayStyle?: 'checkbox' | 'switch' | 'text';
|
|
467
466
|
/** Text for true value */
|
|
@@ -801,8 +800,8 @@ export interface FileViewerData extends CellViewerData {
|
|
|
801
800
|
* HyperLink text viewer data (超链接文本)
|
|
802
801
|
*/
|
|
803
802
|
export interface HyperlinkTextViewerData extends CellViewerData {
|
|
804
|
-
/**
|
|
805
|
-
value: string
|
|
803
|
+
/** 值格式:[显示文本, 链接URL] 或 null */
|
|
804
|
+
value: [string, string] | null;
|
|
806
805
|
/** 数据行 ID */
|
|
807
806
|
id?: string | number;
|
|
808
807
|
/** 属性 key */
|
|
@@ -1275,8 +1274,8 @@ export interface PunchTimingViewerData extends CellViewerData {
|
|
|
1275
1274
|
* 用于展示优先级标签(P0-P4+),带有对应的颜色和背景色
|
|
1276
1275
|
*/
|
|
1277
1276
|
export interface PriorityTextViewerData extends CellViewerData {
|
|
1278
|
-
/** 优先级值,支持数字或字符串(如 0, 1, 2, '0', '1'
|
|
1279
|
-
value:
|
|
1277
|
+
/** 优先级值,支持数字或字符串(如 0, 1, 2, '0', '1') */
|
|
1278
|
+
value: string | number | null;
|
|
1280
1279
|
/** 文本对齐方式,默认 'center' */
|
|
1281
1280
|
textAlign?: 'left' | 'center' | 'right';
|
|
1282
1281
|
/** 标签圆角半径,默认 2 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arthub-table",
|
|
3
|
-
"version": "0.2.51
|
|
3
|
+
"version": "0.2.51",
|
|
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",
|