@xpyjs/gantt-core 0.0.1-alpha.2 → 0.0.1-alpha.4
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/style.css +1 -0
- package/dist/x-gantt.js +6442 -0
- package/dist/x-gantt.umd.cjs +18 -0
- package/package.json +1 -1
- package/types/GanttContext.d.ts +33 -0
- package/types/XGantt.d.ts +248 -0
- package/types/event/index.d.ts +75 -0
- package/types/index.d.ts +13 -0
- package/types/logo.d.ts +2 -0
- package/types/models/Baseline.d.ts +37 -0
- package/types/models/Task.d.ts +77 -0
- package/types/rendering/RenderScheduler.d.ts +93 -0
- package/types/rendering/Renderer.d.ts +52 -0
- package/types/rendering/chart/ChartBaseline.d.ts +50 -0
- package/types/rendering/chart/ChartBody.d.ts +102 -0
- package/types/rendering/chart/ChartGrid.d.ts +37 -0
- package/types/rendering/chart/ChartHeader.d.ts +54 -0
- package/types/rendering/chart/ChartHoliday.d.ts +38 -0
- package/types/rendering/chart/ChartLink.d.ts +87 -0
- package/types/rendering/chart/ChartRow.d.ts +17 -0
- package/types/rendering/chart/ChartSlider.d.ts +58 -0
- package/types/rendering/chart/ChartToday.d.ts +31 -0
- package/types/rendering/chart/ChartWeekend.d.ts +43 -0
- package/types/rendering/chart/Pattern.d.ts +19 -0
- package/types/rendering/chart/index.d.ts +34 -0
- package/types/rendering/other/GuideLine.d.ts +50 -0
- package/types/rendering/other/MiddleResizeLine.d.ts +15 -0
- package/types/rendering/scrollbar/index.d.ts +132 -0
- package/types/rendering/table/Checkbox.d.ts +39 -0
- package/types/rendering/table/TableBody.d.ts +25 -0
- package/types/rendering/table/TableCell.d.ts +43 -0
- package/types/rendering/table/TableHeader.d.ts +13 -0
- package/types/rendering/table/TableHeaderCell.d.ts +20 -0
- package/types/rendering/table/TableHeaderGroup.d.ts +15 -0
- package/types/rendering/table/TableRow.d.ts +57 -0
- package/types/rendering/table/index.d.ts +15 -0
- package/types/store/ColumnManager.d.ts +81 -0
- package/types/store/DataManager.d.ts +132 -0
- package/types/store/OptionManager.d.ts +12 -0
- package/types/store/TimeAxis.d.ts +88 -0
- package/types/store/index.d.ts +21 -0
- package/types/types/baseline.d.ts +16 -0
- package/types/types/chart.d.ts +59 -0
- package/types/types/event.d.ts +29 -0
- package/types/types/global.d.ts +9 -0
- package/types/types/index.d.ts +26 -0
- package/types/types/link.d.ts +23 -0
- package/types/types/options.d.ts +827 -0
- package/types/types/render.d.ts +26 -0
- package/types/types/styles.d.ts +37 -0
- package/types/types/table.d.ts +139 -0
- package/types/utils/color.d.ts +148 -0
- package/types/utils/helpers.d.ts +47 -0
- package/types/utils/id.d.ts +1 -0
- package/types/utils/logger.d.ts +88 -0
- package/types/utils/size.d.ts +7 -0
- package/types/utils/time.d.ts +9 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import Konva from "konva";
|
|
2
|
+
import { IContext } from "@/types/render";
|
|
3
|
+
import { type Task } from "@/models/Task";
|
|
4
|
+
export declare class BodyGroup {
|
|
5
|
+
private context;
|
|
6
|
+
private stage;
|
|
7
|
+
private layer;
|
|
8
|
+
private bgLayer;
|
|
9
|
+
private rowsGroup;
|
|
10
|
+
private rowsCache;
|
|
11
|
+
private rowBgGroup;
|
|
12
|
+
private width;
|
|
13
|
+
private height;
|
|
14
|
+
private offsetX;
|
|
15
|
+
private offsetY;
|
|
16
|
+
private highlightedRowId;
|
|
17
|
+
private highlightRect;
|
|
18
|
+
private selectedRowId;
|
|
19
|
+
private selectedRect;
|
|
20
|
+
constructor(context: IContext, stage: Konva.Stage, layer: Konva.Layer, bgLayer: Konva.Layer);
|
|
21
|
+
/**
|
|
22
|
+
* 调整大小
|
|
23
|
+
*/
|
|
24
|
+
resize(width: number, height: number): void;
|
|
25
|
+
/**
|
|
26
|
+
* 设置偏移量 (响应滚动)
|
|
27
|
+
*/
|
|
28
|
+
setOffset(x: number, y: number): void;
|
|
29
|
+
/**
|
|
30
|
+
* 渲染主体内容
|
|
31
|
+
* @param tasks 任务数据
|
|
32
|
+
*/
|
|
33
|
+
render(tasks: Task[]): void;
|
|
34
|
+
/**
|
|
35
|
+
* 更新任务
|
|
36
|
+
*/
|
|
37
|
+
updateTask(task: Task): void;
|
|
38
|
+
/**
|
|
39
|
+
* 添加 body 事件
|
|
40
|
+
*/
|
|
41
|
+
private bindEvents;
|
|
42
|
+
/**
|
|
43
|
+
* 注册事件监听
|
|
44
|
+
*/
|
|
45
|
+
private registerEvents;
|
|
46
|
+
/**
|
|
47
|
+
* 处理鼠标移动
|
|
48
|
+
*/
|
|
49
|
+
private handleMouseMove;
|
|
50
|
+
/**
|
|
51
|
+
* 处理鼠标离开
|
|
52
|
+
*/
|
|
53
|
+
private handleMouseLeave;
|
|
54
|
+
/**
|
|
55
|
+
* 处理点击
|
|
56
|
+
*/
|
|
57
|
+
private handleClick;
|
|
58
|
+
/**
|
|
59
|
+
* 处理双击
|
|
60
|
+
*/
|
|
61
|
+
private handleDblClick;
|
|
62
|
+
/**
|
|
63
|
+
* 处理右键菜单
|
|
64
|
+
*/
|
|
65
|
+
private handleContextMenu;
|
|
66
|
+
/**
|
|
67
|
+
* 按照位置获取任务
|
|
68
|
+
*/
|
|
69
|
+
private getTaskByPosition;
|
|
70
|
+
/**
|
|
71
|
+
* 高亮指定行
|
|
72
|
+
*/
|
|
73
|
+
private highlightRow;
|
|
74
|
+
/**
|
|
75
|
+
* 取消行高亮
|
|
76
|
+
*/
|
|
77
|
+
private unhighlightRow;
|
|
78
|
+
/**
|
|
79
|
+
* 更新高亮矩形的位置
|
|
80
|
+
*/
|
|
81
|
+
private updateHighlightPosition;
|
|
82
|
+
/**
|
|
83
|
+
* 清除内容
|
|
84
|
+
*/
|
|
85
|
+
private clearHighlight;
|
|
86
|
+
/**
|
|
87
|
+
* 选中指定行
|
|
88
|
+
*/
|
|
89
|
+
private selectRow;
|
|
90
|
+
/**
|
|
91
|
+
* 取消选中指定行
|
|
92
|
+
*/
|
|
93
|
+
private unselectRow;
|
|
94
|
+
/**
|
|
95
|
+
* 更新选中矩形的位置
|
|
96
|
+
*/
|
|
97
|
+
private updateSelectedPosition;
|
|
98
|
+
/**
|
|
99
|
+
* 销毁层
|
|
100
|
+
*/
|
|
101
|
+
destroy(): void;
|
|
102
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IContext } from "@/types/render";
|
|
2
|
+
import Konva from "konva";
|
|
3
|
+
export declare class GridGroup {
|
|
4
|
+
private context;
|
|
5
|
+
private layer;
|
|
6
|
+
private verticalLines;
|
|
7
|
+
private horizontalLines;
|
|
8
|
+
private width;
|
|
9
|
+
private height;
|
|
10
|
+
private offsetX;
|
|
11
|
+
private offsetY;
|
|
12
|
+
constructor(context: IContext, layer: Konva.Layer);
|
|
13
|
+
/**
|
|
14
|
+
* 调整网格大小
|
|
15
|
+
*/
|
|
16
|
+
resize(width: number, height: number): void;
|
|
17
|
+
/**
|
|
18
|
+
* 设置偏移量 (响应滚动)
|
|
19
|
+
*/
|
|
20
|
+
setOffset(x: number, y: number): void;
|
|
21
|
+
/**
|
|
22
|
+
* 渲染网格
|
|
23
|
+
*/
|
|
24
|
+
render(): void;
|
|
25
|
+
/**
|
|
26
|
+
* 销毁网格层
|
|
27
|
+
*/
|
|
28
|
+
destroy(): void;
|
|
29
|
+
/**
|
|
30
|
+
* 计算网格位置
|
|
31
|
+
*/
|
|
32
|
+
private calculateGrid;
|
|
33
|
+
/**
|
|
34
|
+
* 清除网格线
|
|
35
|
+
*/
|
|
36
|
+
private clearGrid;
|
|
37
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import Konva from "konva";
|
|
2
|
+
import { IContext } from "@/types/render";
|
|
3
|
+
export declare class HeaderLayer {
|
|
4
|
+
private context;
|
|
5
|
+
private stage;
|
|
6
|
+
layer: Konva.Layer;
|
|
7
|
+
private background;
|
|
8
|
+
private groupHeader;
|
|
9
|
+
private cellHeader;
|
|
10
|
+
private cellCache;
|
|
11
|
+
private width;
|
|
12
|
+
private height;
|
|
13
|
+
private offsetX;
|
|
14
|
+
constructor(context: IContext, stage: Konva.Stage);
|
|
15
|
+
/**
|
|
16
|
+
* 调整表头大小
|
|
17
|
+
*/
|
|
18
|
+
resize(width: number): void;
|
|
19
|
+
/**
|
|
20
|
+
* 设置偏移量 (响应滚动)
|
|
21
|
+
* 表头只需要水平滚动,不需要垂直滚动
|
|
22
|
+
*/
|
|
23
|
+
setOffset(x: number, y: number): void;
|
|
24
|
+
/**
|
|
25
|
+
* 注册事件监听
|
|
26
|
+
*/
|
|
27
|
+
private registerEvents;
|
|
28
|
+
/**
|
|
29
|
+
* 渲染表头
|
|
30
|
+
*/
|
|
31
|
+
render(): void;
|
|
32
|
+
/**
|
|
33
|
+
* 计算并绘制表头
|
|
34
|
+
*/
|
|
35
|
+
private calculateHeader;
|
|
36
|
+
private createCell;
|
|
37
|
+
/**
|
|
38
|
+
* 清除表头内容
|
|
39
|
+
*/
|
|
40
|
+
private clearHeader;
|
|
41
|
+
/**
|
|
42
|
+
* 销毁表头层
|
|
43
|
+
*/
|
|
44
|
+
destroy(): void;
|
|
45
|
+
/**
|
|
46
|
+
* 高亮日期
|
|
47
|
+
*/
|
|
48
|
+
private highlightDate;
|
|
49
|
+
/**
|
|
50
|
+
* 取消高亮日期
|
|
51
|
+
*/
|
|
52
|
+
private unhighlightDate;
|
|
53
|
+
private handleHighlight;
|
|
54
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import Konva from "konva";
|
|
2
|
+
import { IContext } from "@/types/render";
|
|
3
|
+
/**
|
|
4
|
+
* 假期渲染
|
|
5
|
+
* 用于在甘特图中标记假期区域
|
|
6
|
+
*/
|
|
7
|
+
export declare class HolidayGroup {
|
|
8
|
+
private context;
|
|
9
|
+
private layer;
|
|
10
|
+
private width;
|
|
11
|
+
private height;
|
|
12
|
+
private offsetX;
|
|
13
|
+
private offsetY;
|
|
14
|
+
private holidayGroup;
|
|
15
|
+
private patternImage;
|
|
16
|
+
constructor(context: IContext, layer: Konva.Layer);
|
|
17
|
+
/**
|
|
18
|
+
* 调整假期大小
|
|
19
|
+
*/
|
|
20
|
+
resize(width: number, height: number): void;
|
|
21
|
+
/**
|
|
22
|
+
* 设置偏移量 (响应滚动)
|
|
23
|
+
*/
|
|
24
|
+
setOffset(x: number, y: number): void;
|
|
25
|
+
/**
|
|
26
|
+
* 渲染假期
|
|
27
|
+
*/
|
|
28
|
+
render(): void;
|
|
29
|
+
/**
|
|
30
|
+
* 销毁假期层
|
|
31
|
+
*/
|
|
32
|
+
destroy(): void;
|
|
33
|
+
private clearHoliday;
|
|
34
|
+
/**
|
|
35
|
+
* 计算假期
|
|
36
|
+
*/
|
|
37
|
+
private calculateHoliday;
|
|
38
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import Konva from "konva";
|
|
2
|
+
import { IContext } from "@/types/render";
|
|
3
|
+
import type { Task } from "@/models/Task";
|
|
4
|
+
export declare class LinkGroup {
|
|
5
|
+
private context;
|
|
6
|
+
private stage;
|
|
7
|
+
private layer;
|
|
8
|
+
private tasks;
|
|
9
|
+
private pointGroup;
|
|
10
|
+
private linksGroup;
|
|
11
|
+
private templateArrow;
|
|
12
|
+
private isDragging;
|
|
13
|
+
private isSliderMoving;
|
|
14
|
+
private selectedMap;
|
|
15
|
+
private width;
|
|
16
|
+
private height;
|
|
17
|
+
private offsetX;
|
|
18
|
+
private offsetY;
|
|
19
|
+
constructor(context: IContext, stage: Konva.Stage, layer: Konva.Layer);
|
|
20
|
+
/**
|
|
21
|
+
* 注册事件
|
|
22
|
+
*/
|
|
23
|
+
private registerEvents;
|
|
24
|
+
/**
|
|
25
|
+
* 调整关联线大小
|
|
26
|
+
*/
|
|
27
|
+
resize(width: number, height: number): void;
|
|
28
|
+
/**
|
|
29
|
+
* 设置偏移量 (响应滚动)
|
|
30
|
+
*/
|
|
31
|
+
setOffset(x: number, y: number): void;
|
|
32
|
+
/**
|
|
33
|
+
* 更新数据
|
|
34
|
+
*/
|
|
35
|
+
update(): void;
|
|
36
|
+
/**
|
|
37
|
+
* 渲染关联线
|
|
38
|
+
*/
|
|
39
|
+
render(tasks: Task[]): void;
|
|
40
|
+
/**
|
|
41
|
+
* 销毁关联线
|
|
42
|
+
*/
|
|
43
|
+
destroy(): void;
|
|
44
|
+
/**
|
|
45
|
+
* 计算点组位置
|
|
46
|
+
*/
|
|
47
|
+
private calculatePoints;
|
|
48
|
+
/**
|
|
49
|
+
* 计算关联线位置
|
|
50
|
+
*/
|
|
51
|
+
private calculateLinks;
|
|
52
|
+
private createId;
|
|
53
|
+
/** 生成 FS 连线 */
|
|
54
|
+
private createFS;
|
|
55
|
+
/** 生成 FF 连线 */
|
|
56
|
+
private createFF;
|
|
57
|
+
/** 生成 SS 连线 */
|
|
58
|
+
private createSS;
|
|
59
|
+
/** 生成 SF 连线 */
|
|
60
|
+
private createSF;
|
|
61
|
+
/**
|
|
62
|
+
* 处理连线被点击后的移动
|
|
63
|
+
*/
|
|
64
|
+
private handleDrag;
|
|
65
|
+
/**
|
|
66
|
+
* 处理连线被点击后的移动
|
|
67
|
+
*/
|
|
68
|
+
private createLink;
|
|
69
|
+
/**
|
|
70
|
+
* 按照位置获取任务
|
|
71
|
+
*/
|
|
72
|
+
private getTaskByPosition;
|
|
73
|
+
/**
|
|
74
|
+
* 检查当前连接点是否可以被创建
|
|
75
|
+
*/
|
|
76
|
+
private isAllowDrop;
|
|
77
|
+
/**
|
|
78
|
+
* 操作高亮关联线
|
|
79
|
+
*/
|
|
80
|
+
private handleHighlight;
|
|
81
|
+
/** 高亮创建点 */
|
|
82
|
+
private highlightPoint;
|
|
83
|
+
/** 取消高亮创建点 */
|
|
84
|
+
private unhighlightPoint;
|
|
85
|
+
/** 操作创建点的高亮 */
|
|
86
|
+
private handlePointHighlight;
|
|
87
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Konva from "konva";
|
|
2
|
+
import { ChartSlider } from "./ChartSlider";
|
|
3
|
+
import { IContext } from "@/types/render";
|
|
4
|
+
import type { Task } from "@/models/Task";
|
|
5
|
+
export declare class ChartRow {
|
|
6
|
+
private context;
|
|
7
|
+
task: Task;
|
|
8
|
+
private width;
|
|
9
|
+
private height;
|
|
10
|
+
row: Konva.Group;
|
|
11
|
+
slider: ChartSlider;
|
|
12
|
+
cacheKey: string;
|
|
13
|
+
constructor(context: IContext, task: Task, id: string, x: number, y: number, width: number, height: number);
|
|
14
|
+
update(x: number, y: number): void;
|
|
15
|
+
setOffset(x: number, y: number): void;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import Konva from "konva";
|
|
2
|
+
import { IContext } from "@/types/render";
|
|
3
|
+
import type { Task } from "@/models/Task";
|
|
4
|
+
export declare class ChartSlider {
|
|
5
|
+
private context;
|
|
6
|
+
private x;
|
|
7
|
+
private y;
|
|
8
|
+
private task;
|
|
9
|
+
private rowWidth;
|
|
10
|
+
private offsetX;
|
|
11
|
+
private offsetY;
|
|
12
|
+
sliderGroup: Konva.Group;
|
|
13
|
+
private slider;
|
|
14
|
+
private sliderBar;
|
|
15
|
+
private sliderType;
|
|
16
|
+
private leftHandleGroup;
|
|
17
|
+
private rightHandleGroup;
|
|
18
|
+
private progressGroup;
|
|
19
|
+
private handlerWidth;
|
|
20
|
+
private autoMoveTimer;
|
|
21
|
+
private autoScrollTimer;
|
|
22
|
+
private autoExpandTimer;
|
|
23
|
+
private readonly EDGE_THRESHOLD;
|
|
24
|
+
private readonly SCROLL_STEP;
|
|
25
|
+
private readonly MOVE_INTERVAL;
|
|
26
|
+
private readonly AUTO_EXPAND_INTERVAL;
|
|
27
|
+
private isDragging;
|
|
28
|
+
private draggingDirection;
|
|
29
|
+
private oldTasks;
|
|
30
|
+
constructor(context: IContext, x: number, y: number, task: Task, rowWidth: number);
|
|
31
|
+
update(x: number, y: number): void;
|
|
32
|
+
setOffset(x: number, y: number): void;
|
|
33
|
+
/** 太多需要 function 的判断,搞一个统一的转换 */
|
|
34
|
+
private unpackFunc;
|
|
35
|
+
private render;
|
|
36
|
+
private renderText;
|
|
37
|
+
private renderProgress;
|
|
38
|
+
private bindEvents;
|
|
39
|
+
/**
|
|
40
|
+
* 移动后更新任务时间
|
|
41
|
+
*/
|
|
42
|
+
private emitUpdate;
|
|
43
|
+
private handleDragStart;
|
|
44
|
+
private handleDragMove;
|
|
45
|
+
private handleDragEnd;
|
|
46
|
+
private handleMove;
|
|
47
|
+
private resizeMove;
|
|
48
|
+
private startAutoExpand;
|
|
49
|
+
private startAutoScroll;
|
|
50
|
+
private stopAutoMove;
|
|
51
|
+
private stopAutoScroll;
|
|
52
|
+
private stopAutoExpand;
|
|
53
|
+
private handleMouseEnter;
|
|
54
|
+
private handleMouseLeave;
|
|
55
|
+
private handleResizeHighlight;
|
|
56
|
+
/** 鼠标移入高亮 */
|
|
57
|
+
private handleBarHighlight;
|
|
58
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Konva from "konva";
|
|
2
|
+
import { IContext } from "@/types/render";
|
|
3
|
+
export declare class ChartToday {
|
|
4
|
+
private context;
|
|
5
|
+
private bgLayer;
|
|
6
|
+
private headerLayer;
|
|
7
|
+
private arrowAnimation?;
|
|
8
|
+
private todayLine?;
|
|
9
|
+
private triangle?;
|
|
10
|
+
private width;
|
|
11
|
+
private height;
|
|
12
|
+
private offsetX;
|
|
13
|
+
private offsetY;
|
|
14
|
+
constructor(context: IContext, bgLayer: Konva.Layer, headerLayer: Konva.Layer);
|
|
15
|
+
/**
|
|
16
|
+
* 调整大小
|
|
17
|
+
*/
|
|
18
|
+
resize(width: number, height: number): void;
|
|
19
|
+
/**
|
|
20
|
+
* 设置偏移量 (响应滚动)
|
|
21
|
+
*/
|
|
22
|
+
setOffset(x: number, y: number): void;
|
|
23
|
+
/**
|
|
24
|
+
* 渲染今日线
|
|
25
|
+
*/
|
|
26
|
+
render(): void;
|
|
27
|
+
/**
|
|
28
|
+
* 销毁今日线
|
|
29
|
+
*/
|
|
30
|
+
destroy(): void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import Konva from "konva";
|
|
2
|
+
import dayjs from "../../utils/time";
|
|
3
|
+
import { IContext } from "@/types/render";
|
|
4
|
+
/**
|
|
5
|
+
* 周末周末渲染
|
|
6
|
+
* 用于在甘特图中标记周末区域
|
|
7
|
+
*/
|
|
8
|
+
export declare class WeekendGroup {
|
|
9
|
+
private context;
|
|
10
|
+
private layer;
|
|
11
|
+
private width;
|
|
12
|
+
private height;
|
|
13
|
+
private offsetX;
|
|
14
|
+
private offsetY;
|
|
15
|
+
private weekendGroup;
|
|
16
|
+
private patternImage;
|
|
17
|
+
constructor(context: IContext, layer: Konva.Layer);
|
|
18
|
+
/**
|
|
19
|
+
* 检查日期是否为周末
|
|
20
|
+
*/
|
|
21
|
+
isWeekend(date: dayjs.Dayjs): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* 调整周末大小
|
|
24
|
+
*/
|
|
25
|
+
resize(width: number, height: number): void;
|
|
26
|
+
/**
|
|
27
|
+
* 设置偏移量 (响应滚动)
|
|
28
|
+
*/
|
|
29
|
+
setOffset(x: number, y: number): void;
|
|
30
|
+
/**
|
|
31
|
+
* 渲染周末
|
|
32
|
+
*/
|
|
33
|
+
render(): void;
|
|
34
|
+
/**
|
|
35
|
+
* 销毁周末层
|
|
36
|
+
*/
|
|
37
|
+
destroy(): void;
|
|
38
|
+
private clearWeekend;
|
|
39
|
+
/**
|
|
40
|
+
* 计算周末
|
|
41
|
+
*/
|
|
42
|
+
private calculateWeekend;
|
|
43
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IPattern } from "@/types/styles";
|
|
2
|
+
export declare class Pattern {
|
|
3
|
+
private constructor();
|
|
4
|
+
static createPattern(pattern?: IPattern & {
|
|
5
|
+
backgroundColor?: string;
|
|
6
|
+
}): Promise<HTMLImageElement | null>;
|
|
7
|
+
/**
|
|
8
|
+
* 创建条纹图案
|
|
9
|
+
*/
|
|
10
|
+
private static createStripePattern;
|
|
11
|
+
/**
|
|
12
|
+
* 创建圆点图案
|
|
13
|
+
*/
|
|
14
|
+
private static createDotPattern;
|
|
15
|
+
/**
|
|
16
|
+
* 创建网格图案
|
|
17
|
+
*/
|
|
18
|
+
private static createGridPattern;
|
|
19
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IContext } from "@/types/render";
|
|
2
|
+
import type { Task } from "@/models/Task";
|
|
3
|
+
export declare class Chart {
|
|
4
|
+
private context;
|
|
5
|
+
private container;
|
|
6
|
+
private stage;
|
|
7
|
+
private headerLayer;
|
|
8
|
+
private bodyGroup;
|
|
9
|
+
private gridGroup;
|
|
10
|
+
private weekendGroup;
|
|
11
|
+
private holidayGroup;
|
|
12
|
+
private todayLayer;
|
|
13
|
+
private linkGroup;
|
|
14
|
+
private baselineGroup;
|
|
15
|
+
private bgLayer;
|
|
16
|
+
private bodyLayer;
|
|
17
|
+
private width;
|
|
18
|
+
private height;
|
|
19
|
+
constructor(context: IContext, container: HTMLDivElement);
|
|
20
|
+
/**
|
|
21
|
+
* 调整大小
|
|
22
|
+
*/
|
|
23
|
+
resize(width: number, height: number): void;
|
|
24
|
+
render(x: number, y: number, tasks: Task[]): void;
|
|
25
|
+
/**
|
|
26
|
+
* 刷新图表(用于滚动或局部更新时的高效渲染)
|
|
27
|
+
*/
|
|
28
|
+
refresh(x: number, y: number, tasks: Task[]): void;
|
|
29
|
+
/**
|
|
30
|
+
* 更新任务
|
|
31
|
+
*/
|
|
32
|
+
updateTask(task: Task): void;
|
|
33
|
+
destroy(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { IContext } from "@/types/render";
|
|
2
|
+
/**
|
|
3
|
+
* 全局指示线类
|
|
4
|
+
* 用于在拖拽调整大小时显示垂直参考线
|
|
5
|
+
*/
|
|
6
|
+
export declare class GuideLine {
|
|
7
|
+
private context;
|
|
8
|
+
private element;
|
|
9
|
+
private container;
|
|
10
|
+
private visible;
|
|
11
|
+
/**
|
|
12
|
+
* @param container 指示线的容器元素
|
|
13
|
+
*/
|
|
14
|
+
constructor(context: IContext, container: HTMLElement);
|
|
15
|
+
/**
|
|
16
|
+
* 初始化指示线元素
|
|
17
|
+
*/
|
|
18
|
+
private initElement;
|
|
19
|
+
/**
|
|
20
|
+
* 初始化事件监听
|
|
21
|
+
*/
|
|
22
|
+
private initEvents;
|
|
23
|
+
/**
|
|
24
|
+
* 设置指示线容器
|
|
25
|
+
* @param container 新的容器元素
|
|
26
|
+
*/
|
|
27
|
+
setContainer(container: HTMLElement): void;
|
|
28
|
+
/**
|
|
29
|
+
* 设置指示线左侧位置
|
|
30
|
+
* @param left 左侧位置值,单位px
|
|
31
|
+
*/
|
|
32
|
+
setLeft(left: number): void;
|
|
33
|
+
/**
|
|
34
|
+
* 显示指示线
|
|
35
|
+
* @param left 可选参数,显示时设置的左侧位置
|
|
36
|
+
*/
|
|
37
|
+
show(left?: number): void;
|
|
38
|
+
/**
|
|
39
|
+
* 隐藏指示线
|
|
40
|
+
*/
|
|
41
|
+
hide(): void;
|
|
42
|
+
/**
|
|
43
|
+
* 检查指示线是否可见
|
|
44
|
+
*/
|
|
45
|
+
isVisible(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* 获取当前位置
|
|
48
|
+
*/
|
|
49
|
+
getLeft(): number;
|
|
50
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IContext } from "@/types/render";
|
|
2
|
+
export declare class MiddleResizeLine {
|
|
3
|
+
private root;
|
|
4
|
+
private container;
|
|
5
|
+
private line;
|
|
6
|
+
private initialX;
|
|
7
|
+
private initialWidth;
|
|
8
|
+
private collapseButton;
|
|
9
|
+
constructor(root: IContext, container: HTMLElement);
|
|
10
|
+
setOffset(x: number): void;
|
|
11
|
+
/**
|
|
12
|
+
* 添加拖拽事件
|
|
13
|
+
*/
|
|
14
|
+
private addDragEvents;
|
|
15
|
+
}
|