@xpyjs/gantt-core 0.0.1-beta.1 → 0.0.1-beta.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xpyjs/gantt-core",
3
3
  "private": false,
4
- "version": "0.0.1-beta.1",
4
+ "version": "0.0.1-beta.2",
5
5
  "description": "A powerful and flexible Gantt chart component library for modern web applications with TypeScript support",
6
6
  "type": "module",
7
7
  "main": "./dist/x-gantt.umd.cjs",
@@ -67,7 +67,7 @@ export declare class Task {
67
67
  constructor(store: Store, event: EventBus, data: any, parent?: Task, _id?: string);
68
68
  getField(field: string): any;
69
69
  /** 切换展示模式时,需要调整时间 */
70
- updateMode(): void;
70
+ updateMode(): boolean;
71
71
  updateData(data: any): void;
72
72
  updateTime(startTime: Dayjs, endTime: Dayjs): void;
73
73
  clone(): Task;
@@ -6,6 +6,7 @@ export declare class BodyGroup {
6
6
  private stage;
7
7
  private layer;
8
8
  private bgLayer;
9
+ private tasks;
9
10
  private rowsGroup;
10
11
  private rowsCache;
11
12
  private rowBgGroup;
@@ -2,8 +2,7 @@ import Konva from "konva";
2
2
  import { IContext } from "@/types/render";
3
3
  export declare class HeaderLayer {
4
4
  private context;
5
- private stage;
6
- layer: Konva.Layer;
5
+ private layer;
7
6
  private background;
8
7
  private groupHeader;
9
8
  private cellHeader;
@@ -11,7 +10,7 @@ export declare class HeaderLayer {
11
10
  private width;
12
11
  private height;
13
12
  private offsetX;
14
- constructor(context: IContext, stage: Konva.Stage);
13
+ constructor(context: IContext, layer: Konva.Layer);
15
14
  /**
16
15
  * 调整表头大小
17
16
  */
@@ -9,6 +9,7 @@ export declare class LinkGroup {
9
9
  private pointGroup;
10
10
  private linksGroup;
11
11
  private templateArrow;
12
+ private linkCache;
12
13
  private isDragging;
13
14
  private isSliderMoving;
14
15
  private selectedMap;
@@ -30,9 +31,9 @@ export declare class LinkGroup {
30
31
  */
31
32
  setOffset(x: number, y: number): void;
32
33
  /**
33
- * 更新数据
34
+ * 更新某一条数据
34
35
  */
35
- update(): void;
36
+ updateTask(task: Task): void;
36
37
  /**
37
38
  * 渲染关联线
38
39
  */
@@ -26,6 +26,7 @@ export declare class ChartSlider {
26
26
  private readonly AUTO_EXPAND_INTERVAL;
27
27
  private isDragging;
28
28
  private draggingDirection;
29
+ private dragDiffX;
29
30
  private oldTasks;
30
31
  constructor(context: IContext, x: number, y: number, task: Task, rowWidth: number);
31
32
  update(x: number, y: number): void;
@@ -13,6 +13,7 @@ export declare class Chart {
13
13
  private todayLayer;
14
14
  private linkGroup;
15
15
  private baselineGroup;
16
+ private axisLayer;
16
17
  private bgLayer;
17
18
  private bodyLayer;
18
19
  private width;
@@ -22,11 +23,11 @@ export declare class Chart {
22
23
  * 调整大小
23
24
  */
24
25
  resize(width: number, height: number): void;
25
- render(x: number, y: number, tasks: Task[]): void;
26
+ render(x: number, y: number, tasks: Task[], isRefresh?: boolean, isScroll?: boolean): void;
26
27
  /**
27
28
  * 刷新图表(用于滚动或局部更新时的高效渲染)
28
29
  */
29
- refresh(x: number, y: number, tasks: Task[]): void;
30
+ refresh(x: number, y: number, tasks: Task[], isScroll?: boolean): void;
30
31
  /**
31
32
  * 更新任务
32
33
  */
@@ -84,8 +84,6 @@ export declare class DataManager {
84
84
  * 获取可展示任务数量
85
85
  */
86
86
  getVisibleSize(): number;
87
- /** 检查任务是否可见 */
88
- isTaskVisible(task: Task): boolean;
89
87
  /**
90
88
  * 清空所有数据
91
89
  */
@@ -107,6 +107,8 @@ export declare class LinkManager {
107
107
  setCycleDetection(enabled: boolean): void;
108
108
  /** 获取所有连线 */
109
109
  getLinks(): ILink[];
110
+ /** 获取某个任务ID的连线 */
111
+ getLinksByTaskId(taskId: string): ILink[];
110
112
  /** 批量设置连线(唯一的数据修改入口) */
111
113
  setLinks(links: ILink[], detectAll?: boolean): void;
112
114
  /** 更新各种缓存配置 */
@@ -151,7 +153,7 @@ export declare class LinkManager {
151
153
  /** 检查当前图是否存在环 */
152
154
  hasCycle(): boolean;
153
155
  /** 全量环检测(Tarjan 算法) */
154
- detectAllCycles(): CycleReport;
156
+ detectAllCycles(sendErr?: boolean): CycleReport;
155
157
  /** 获取最近一次环检测报告 */
156
158
  getCycleReport(): CycleReport | null;
157
159
  /** 检测同一对任务间是否存在冲突的连线类型 */
@@ -49,7 +49,7 @@ export declare class TimeAxis {
49
49
  * @returns 对应的时间对象
50
50
  */
51
51
  getTimeByLeft(left: number): Dayjs;
52
- init(options: IGanttOptions): void;
52
+ init(options: IGanttOptions, isFirstTime?: boolean): void;
53
53
  update(options: IGanttOptions): void;
54
54
  setDate(start?: Dayjs, end?: Dayjs): void;
55
55
  /** 获取表头的日期列表 */
@@ -139,7 +139,7 @@ export interface IGanttOptions {
139
139
  distance: number;
140
140
  /** 线条的起点/终点位置与任务条的距离。 默认 5 */
141
141
  gap: number;
142
- /** 线条的虚线设定。 默认 [6, 3] */
142
+ /** 线条的虚线设定。 默认 [0],设为 0 即实线 */
143
143
  dash: number[];
144
144
  /** 线条的宽度。 默认 1 */
145
145
  width: number;
@@ -0,0 +1 @@
1
+ export declare const HandlerIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"15\" viewBox=\"0 0 15 15\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M5.5 4.625a1.125 1.125 0 1 0 0-2.25a1.125 1.125 0 0 0 0 2.25m4 0a1.125 1.125 0 1 0 0-2.25a1.125 1.125 0 0 0 0 2.25M10.625 7.5a1.125 1.125 0 1 1-2.25 0a1.125 1.125 0 0 1 2.25 0M5.5 8.625a1.125 1.125 0 1 0 0-2.25a1.125 1.125 0 0 0 0 2.25m5.125 2.875a1.125 1.125 0 1 1-2.25 0a1.125 1.125 0 0 1 2.25 0M5.5 12.625a1.125 1.125 0 1 0 0-2.25a1.125 1.125 0 0 0 0 2.25\" clip-rule=\"evenodd\"/></svg>";