ice-entity-designer 0.0.25 → 0.0.26
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/README.md +38 -2
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/index.umd.js +2 -2
- package/dist/types/gantt/GanttDependency.d.mts +18 -0
- package/dist/types/gantt/GanttDependency.d.ts +18 -0
- package/dist/types/gantt/GanttDesigner.d.mts +80 -0
- package/dist/types/gantt/GanttDesigner.d.ts +80 -0
- package/dist/types/gantt/GanttRuler.d.mts +42 -0
- package/dist/types/gantt/GanttRuler.d.ts +42 -0
- package/dist/types/gantt/GanttTask.d.mts +41 -0
- package/dist/types/gantt/GanttTask.d.ts +41 -0
- package/dist/types/gantt/gantt_date.d.mts +12 -0
- package/dist/types/gantt/gantt_date.d.ts +12 -0
- package/dist/types/index.d.mts +7 -0
- package/dist/types/index.d.ts +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { ICEPolyLine } from '../ice-render/index.mjs';
|
|
9
|
+
/**
|
|
10
|
+
* @class GanttDependency 甘特任务之间的依赖(完成 → 开始)
|
|
11
|
+
*
|
|
12
|
+
* 记法:实线 + 实心箭头,从「前置任务的右端」指向「后置任务的左端」,走正交路由(`visio`)。
|
|
13
|
+
* 依赖只表达约束,不改变条的位置(自动排程是后续能力,不属于本包 v1)。
|
|
14
|
+
*/
|
|
15
|
+
export default class GanttDependency extends ICEPolyLine {
|
|
16
|
+
static readonly typeId = "GanttDependency";
|
|
17
|
+
constructor(props?: any);
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { ICEPolyLine } from '../ice-render/index';
|
|
9
|
+
/**
|
|
10
|
+
* @class GanttDependency 甘特任务之间的依赖(完成 → 开始)
|
|
11
|
+
*
|
|
12
|
+
* 记法:实线 + 实心箭头,从「前置任务的右端」指向「后置任务的左端」,走正交路由(`visio`)。
|
|
13
|
+
* 依赖只表达约束,不改变条的位置(自动排程是后续能力,不属于本包 v1)。
|
|
14
|
+
*/
|
|
15
|
+
export default class GanttDependency extends ICEPolyLine {
|
|
16
|
+
static readonly typeId = "GanttDependency";
|
|
17
|
+
constructor(props?: any);
|
|
18
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import FlowDesigner from '../flow/FlowDesigner.mjs';
|
|
9
|
+
import GanttRuler from './GanttRuler.mjs';
|
|
10
|
+
export declare type GanttIssue = {
|
|
11
|
+
level: 'error' | 'warning';
|
|
12
|
+
message: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare type GanttTaskInput = {
|
|
16
|
+
title?: string;
|
|
17
|
+
/** `YYYY-MM-DD` */
|
|
18
|
+
start: string;
|
|
19
|
+
days?: number;
|
|
20
|
+
row?: number;
|
|
21
|
+
progress?: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @class GanttDesigner 甘特图设计器(第三个 domain pack)
|
|
25
|
+
*
|
|
26
|
+
* 与前两个包同一套结构(`FlowDesigner` 薄扩展 + 类型过滤 + 语义校验 + 复用快照/导出),
|
|
27
|
+
* 额外引入两件甘特特有的东西:
|
|
28
|
+
*
|
|
29
|
+
* 1. **时间轴**:日期 ↔ 像素的统一换算(`dayWidth` / `originDate` / `labelColumnWidth`),
|
|
30
|
+
* 框架(左列任务名 + 日期刻度 + 行线)由一个派生的 `GanttRuler` 组件渲染并在模型变化时重建;
|
|
31
|
+
* 2. **吸附**:任务条的拖拽按「整天」吸附(见 `GanttTask.setPosition`),排期不会出现小数天。
|
|
32
|
+
*/
|
|
33
|
+
export default class GanttDesigner extends FlowDesigner {
|
|
34
|
+
/** 左列(任务名)宽度 */
|
|
35
|
+
labelColumnWidth: number;
|
|
36
|
+
/** 时间轴顶部标尺高度 */
|
|
37
|
+
headerHeight: number;
|
|
38
|
+
/** 行高 */
|
|
39
|
+
rowHeight: number;
|
|
40
|
+
/** 每天像素 */
|
|
41
|
+
dayWidth: number;
|
|
42
|
+
/** 项目起点(自动取最早任务开始日) */
|
|
43
|
+
originDate: string;
|
|
44
|
+
ruler: GanttRuler;
|
|
45
|
+
private __syncing;
|
|
46
|
+
constructor(ice: any);
|
|
47
|
+
get nodes(): any[];
|
|
48
|
+
get edges(): any[];
|
|
49
|
+
/**
|
|
50
|
+
* 建一条任务(条):坐标由「起始日期 × 每日像素」算出,不接受任意 left/top
|
|
51
|
+
* —— 甘特的横轴是时间,不是自由画布。
|
|
52
|
+
*/
|
|
53
|
+
createTask(props: GanttTaskInput & {
|
|
54
|
+
id?: string;
|
|
55
|
+
}): any;
|
|
56
|
+
/** 建一条依赖(完成 → 开始),两端必须都是任务 */
|
|
57
|
+
createDependency(props?: any): any;
|
|
58
|
+
/** 改每日像素(时间轴缩放):所有任务与依赖一起重排 */
|
|
59
|
+
setDayWidth(dayWidth: number): void;
|
|
60
|
+
/** 项目起点 = 最早任务的开始日;没有任务时留空 */
|
|
61
|
+
computeOrigin(): string;
|
|
62
|
+
/** 项目区间(天数):至少 1 天,用于刻度与画布宽度 */
|
|
63
|
+
dayCount(): number;
|
|
64
|
+
/**
|
|
65
|
+
* 重建图表框架(左列任务名 + 日期刻度 + 行线)并同步所有任务的几何。
|
|
66
|
+
*
|
|
67
|
+
* 模型任何变化(增删任务、改日期、改每日像素)都要走这里 —— 时间轴是**派生**的,
|
|
68
|
+
* 不允许任务自己维护「我在哪一天的哪一像素上」。
|
|
69
|
+
*/
|
|
70
|
+
syncChrome(): void;
|
|
71
|
+
/**
|
|
72
|
+
* 甘特语义校验:
|
|
73
|
+
* - **依赖成环**(排期不成立);
|
|
74
|
+
* - 进度越界(0..1);
|
|
75
|
+
* - 持续天数非法(<1);
|
|
76
|
+
* - 任务早于项目起点(起点是自动取最早的,因此这条主要防手工改坐标)。
|
|
77
|
+
*/
|
|
78
|
+
validateGantt(): GanttIssue[];
|
|
79
|
+
private __anchor;
|
|
80
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import FlowDesigner from '../flow/FlowDesigner';
|
|
9
|
+
import GanttRuler from './GanttRuler';
|
|
10
|
+
export declare type GanttIssue = {
|
|
11
|
+
level: 'error' | 'warning';
|
|
12
|
+
message: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare type GanttTaskInput = {
|
|
16
|
+
title?: string;
|
|
17
|
+
/** `YYYY-MM-DD` */
|
|
18
|
+
start: string;
|
|
19
|
+
days?: number;
|
|
20
|
+
row?: number;
|
|
21
|
+
progress?: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @class GanttDesigner 甘特图设计器(第三个 domain pack)
|
|
25
|
+
*
|
|
26
|
+
* 与前两个包同一套结构(`FlowDesigner` 薄扩展 + 类型过滤 + 语义校验 + 复用快照/导出),
|
|
27
|
+
* 额外引入两件甘特特有的东西:
|
|
28
|
+
*
|
|
29
|
+
* 1. **时间轴**:日期 ↔ 像素的统一换算(`dayWidth` / `originDate` / `labelColumnWidth`),
|
|
30
|
+
* 框架(左列任务名 + 日期刻度 + 行线)由一个派生的 `GanttRuler` 组件渲染并在模型变化时重建;
|
|
31
|
+
* 2. **吸附**:任务条的拖拽按「整天」吸附(见 `GanttTask.setPosition`),排期不会出现小数天。
|
|
32
|
+
*/
|
|
33
|
+
export default class GanttDesigner extends FlowDesigner {
|
|
34
|
+
/** 左列(任务名)宽度 */
|
|
35
|
+
labelColumnWidth: number;
|
|
36
|
+
/** 时间轴顶部标尺高度 */
|
|
37
|
+
headerHeight: number;
|
|
38
|
+
/** 行高 */
|
|
39
|
+
rowHeight: number;
|
|
40
|
+
/** 每天像素 */
|
|
41
|
+
dayWidth: number;
|
|
42
|
+
/** 项目起点(自动取最早任务开始日) */
|
|
43
|
+
originDate: string;
|
|
44
|
+
ruler: GanttRuler;
|
|
45
|
+
private __syncing;
|
|
46
|
+
constructor(ice: any);
|
|
47
|
+
get nodes(): any[];
|
|
48
|
+
get edges(): any[];
|
|
49
|
+
/**
|
|
50
|
+
* 建一条任务(条):坐标由「起始日期 × 每日像素」算出,不接受任意 left/top
|
|
51
|
+
* —— 甘特的横轴是时间,不是自由画布。
|
|
52
|
+
*/
|
|
53
|
+
createTask(props: GanttTaskInput & {
|
|
54
|
+
id?: string;
|
|
55
|
+
}): any;
|
|
56
|
+
/** 建一条依赖(完成 → 开始),两端必须都是任务 */
|
|
57
|
+
createDependency(props?: any): any;
|
|
58
|
+
/** 改每日像素(时间轴缩放):所有任务与依赖一起重排 */
|
|
59
|
+
setDayWidth(dayWidth: number): void;
|
|
60
|
+
/** 项目起点 = 最早任务的开始日;没有任务时留空 */
|
|
61
|
+
computeOrigin(): string;
|
|
62
|
+
/** 项目区间(天数):至少 1 天,用于刻度与画布宽度 */
|
|
63
|
+
dayCount(): number;
|
|
64
|
+
/**
|
|
65
|
+
* 重建图表框架(左列任务名 + 日期刻度 + 行线)并同步所有任务的几何。
|
|
66
|
+
*
|
|
67
|
+
* 模型任何变化(增删任务、改日期、改每日像素)都要走这里 —— 时间轴是**派生**的,
|
|
68
|
+
* 不允许任务自己维护「我在哪一天的哪一像素上」。
|
|
69
|
+
*/
|
|
70
|
+
syncChrome(): void;
|
|
71
|
+
/**
|
|
72
|
+
* 甘特语义校验:
|
|
73
|
+
* - **依赖成环**(排期不成立);
|
|
74
|
+
* - 进度越界(0..1);
|
|
75
|
+
* - 持续天数非法(<1);
|
|
76
|
+
* - 任务早于项目起点(起点是自动取最早的,因此这条主要防手工改坐标)。
|
|
77
|
+
*/
|
|
78
|
+
validateGantt(): GanttIssue[];
|
|
79
|
+
private __anchor;
|
|
80
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { ICEGroup } from '../ice-render/index.mjs';
|
|
9
|
+
export declare type GanttRulerOptions = {
|
|
10
|
+
dayWidth: number;
|
|
11
|
+
labelColumnWidth: number;
|
|
12
|
+
headerHeight: number;
|
|
13
|
+
rowHeight: number;
|
|
14
|
+
originDate: string;
|
|
15
|
+
dayCount: number;
|
|
16
|
+
tasks: Array<{
|
|
17
|
+
title: string;
|
|
18
|
+
row: number;
|
|
19
|
+
}>;
|
|
20
|
+
totalWidth: number;
|
|
21
|
+
totalHeight: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @class GanttRuler 甘特的「图表框架」:左列任务名 + 日期刻度 + 行分隔线
|
|
25
|
+
*
|
|
26
|
+
* 它是**派生装饰**(由设计器按任务模型重建),不是业务图元 —— 因此:
|
|
27
|
+
* - 不进 `designer.nodes`(类型过滤按 typeId 认 GanttTask);
|
|
28
|
+
* - 但仍然进文档与导出(它是画布内容的一部分,和任务条一起被截图/导出 SVG)。
|
|
29
|
+
*
|
|
30
|
+
* 时间轴刻度是「一次性画完」的:40 天以内每天一个刻度,超过就按周一/每月聚合,
|
|
31
|
+
* 避免长排期把画布画满文字(这也是甘特工具通行做法)。
|
|
32
|
+
*/
|
|
33
|
+
export default class GanttRuler extends ICEGroup {
|
|
34
|
+
static readonly typeId = "GanttRuler";
|
|
35
|
+
constructor();
|
|
36
|
+
hasDerivedChildren(): boolean;
|
|
37
|
+
/** 按当前任务模型重建框架 */
|
|
38
|
+
sync(options: GanttRulerOptions): void;
|
|
39
|
+
/** 只给日期字符串加天数(保持与 gantt_date 同一套 UTC 口径) */
|
|
40
|
+
private __addDays;
|
|
41
|
+
private __text;
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { ICEGroup } from '../ice-render/index';
|
|
9
|
+
export declare type GanttRulerOptions = {
|
|
10
|
+
dayWidth: number;
|
|
11
|
+
labelColumnWidth: number;
|
|
12
|
+
headerHeight: number;
|
|
13
|
+
rowHeight: number;
|
|
14
|
+
originDate: string;
|
|
15
|
+
dayCount: number;
|
|
16
|
+
tasks: Array<{
|
|
17
|
+
title: string;
|
|
18
|
+
row: number;
|
|
19
|
+
}>;
|
|
20
|
+
totalWidth: number;
|
|
21
|
+
totalHeight: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @class GanttRuler 甘特的「图表框架」:左列任务名 + 日期刻度 + 行分隔线
|
|
25
|
+
*
|
|
26
|
+
* 它是**派生装饰**(由设计器按任务模型重建),不是业务图元 —— 因此:
|
|
27
|
+
* - 不进 `designer.nodes`(类型过滤按 typeId 认 GanttTask);
|
|
28
|
+
* - 但仍然进文档与导出(它是画布内容的一部分,和任务条一起被截图/导出 SVG)。
|
|
29
|
+
*
|
|
30
|
+
* 时间轴刻度是「一次性画完」的:40 天以内每天一个刻度,超过就按周一/每月聚合,
|
|
31
|
+
* 避免长排期把画布画满文字(这也是甘特工具通行做法)。
|
|
32
|
+
*/
|
|
33
|
+
export default class GanttRuler extends ICEGroup {
|
|
34
|
+
static readonly typeId = "GanttRuler";
|
|
35
|
+
constructor();
|
|
36
|
+
hasDerivedChildren(): boolean;
|
|
37
|
+
/** 按当前任务模型重建框架 */
|
|
38
|
+
sync(options: GanttRulerOptions): void;
|
|
39
|
+
/** 只给日期字符串加天数(保持与 gantt_date 同一套 UTC 口径) */
|
|
40
|
+
private __addDays;
|
|
41
|
+
private __text;
|
|
42
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { ICEGroup, ICERect, ICEText } from '../ice-render/index.mjs';
|
|
9
|
+
/**
|
|
10
|
+
* @class GanttTask 甘特图的一条任务(= 时间轴上的那个条)
|
|
11
|
+
*
|
|
12
|
+
* 复合组件(`hasDerivedChildren`):条、进度覆盖、文字都由 state 派生。
|
|
13
|
+
*
|
|
14
|
+
* **拖拽吸附**是排期语义的核心:`setPosition()` 会把 x 吸附到「整天」的格子上,
|
|
15
|
+
* 并据此反推起始日期 —— 拖动不会产生「3 月 5 日的 13:47 开工」这种排期。
|
|
16
|
+
*/
|
|
17
|
+
export default class GanttTask extends ICEGroup {
|
|
18
|
+
static readonly typeId = "GanttTask";
|
|
19
|
+
protected barComponent: ICERect | null;
|
|
20
|
+
protected progressComponent: ICERect | null;
|
|
21
|
+
protected labelComponent: ICEText | null;
|
|
22
|
+
hasDerivedChildren(): boolean;
|
|
23
|
+
constructor(props?: any);
|
|
24
|
+
protected static arrangeParam(props?: any): any;
|
|
25
|
+
private static readonly __shapeKeys;
|
|
26
|
+
setState(patch: any): void;
|
|
27
|
+
applyPatch(patch?: any): void;
|
|
28
|
+
/**
|
|
29
|
+
* @overwrite
|
|
30
|
+
* 拖拽吸附:x 吸附到整天网格并反推起始日期(y 吸附到行网格)。
|
|
31
|
+
*/
|
|
32
|
+
setPosition(left: number, top: number, evt?: any): void;
|
|
33
|
+
/** 时间轴上的左边缘(= state.left,设计器负责由日期算出它) */
|
|
34
|
+
barLeft(): number;
|
|
35
|
+
/** 进度覆盖条宽度 */
|
|
36
|
+
progressWidth(): number;
|
|
37
|
+
/** 由 start/days 反推几何(日期改了、或设计器换了 dayWidth/origin 时调用) */
|
|
38
|
+
syncGeometry(): void;
|
|
39
|
+
protected syncBar(): void;
|
|
40
|
+
private __clearDerivedChildren;
|
|
41
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 大漠穷秋.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { ICEGroup, ICERect, ICEText } from '../ice-render/index';
|
|
9
|
+
/**
|
|
10
|
+
* @class GanttTask 甘特图的一条任务(= 时间轴上的那个条)
|
|
11
|
+
*
|
|
12
|
+
* 复合组件(`hasDerivedChildren`):条、进度覆盖、文字都由 state 派生。
|
|
13
|
+
*
|
|
14
|
+
* **拖拽吸附**是排期语义的核心:`setPosition()` 会把 x 吸附到「整天」的格子上,
|
|
15
|
+
* 并据此反推起始日期 —— 拖动不会产生「3 月 5 日的 13:47 开工」这种排期。
|
|
16
|
+
*/
|
|
17
|
+
export default class GanttTask extends ICEGroup {
|
|
18
|
+
static readonly typeId = "GanttTask";
|
|
19
|
+
protected barComponent: ICERect | null;
|
|
20
|
+
protected progressComponent: ICERect | null;
|
|
21
|
+
protected labelComponent: ICEText | null;
|
|
22
|
+
hasDerivedChildren(): boolean;
|
|
23
|
+
constructor(props?: any);
|
|
24
|
+
protected static arrangeParam(props?: any): any;
|
|
25
|
+
private static readonly __shapeKeys;
|
|
26
|
+
setState(patch: any): void;
|
|
27
|
+
applyPatch(patch?: any): void;
|
|
28
|
+
/**
|
|
29
|
+
* @overwrite
|
|
30
|
+
* 拖拽吸附:x 吸附到整天网格并反推起始日期(y 吸附到行网格)。
|
|
31
|
+
*/
|
|
32
|
+
setPosition(left: number, top: number, evt?: any): void;
|
|
33
|
+
/** 时间轴上的左边缘(= state.left,设计器负责由日期算出它) */
|
|
34
|
+
barLeft(): number;
|
|
35
|
+
/** 进度覆盖条宽度 */
|
|
36
|
+
progressWidth(): number;
|
|
37
|
+
/** 由 start/days 反推几何(日期改了、或设计器换了 dayWidth/origin 时调用) */
|
|
38
|
+
syncGeometry(): void;
|
|
39
|
+
protected syncBar(): void;
|
|
40
|
+
private __clearDerivedChildren;
|
|
41
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** `YYYY-MM-DD` → UTC 时间戳(非法输入返回 NaN) */
|
|
2
|
+
export declare function parseDate(iso: string): number;
|
|
3
|
+
/** UTC 时间戳 → `YYYY-MM-DD` */
|
|
4
|
+
export declare function formatDate(timestamp: number): string;
|
|
5
|
+
/** 加天数 */
|
|
6
|
+
export declare function addDays(iso: string, days: number): string;
|
|
7
|
+
/** 相差天数(to - from) */
|
|
8
|
+
export declare function diffDays(from: string, to: string): number;
|
|
9
|
+
/** 两个日期之间(含)的每一天,用于渲染刻度 */
|
|
10
|
+
export declare function eachDay(from: string, to: string, limit?: number): string[];
|
|
11
|
+
/** 刻度文案:`03-02`(月-日);月初额外给出月份,便于阅读 */
|
|
12
|
+
export declare function tickLabel(iso: string): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** `YYYY-MM-DD` → UTC 时间戳(非法输入返回 NaN) */
|
|
2
|
+
export declare function parseDate(iso: string): number;
|
|
3
|
+
/** UTC 时间戳 → `YYYY-MM-DD` */
|
|
4
|
+
export declare function formatDate(timestamp: number): string;
|
|
5
|
+
/** 加天数 */
|
|
6
|
+
export declare function addDays(iso: string, days: number): string;
|
|
7
|
+
/** 相差天数(to - from) */
|
|
8
|
+
export declare function diffDays(from: string, to: string): number;
|
|
9
|
+
/** 两个日期之间(含)的每一天,用于渲染刻度 */
|
|
10
|
+
export declare function eachDay(from: string, to: string, limit?: number): string[];
|
|
11
|
+
/** 刻度文案:`03-02`(月-日);月初额外给出月份,便于阅读 */
|
|
12
|
+
export declare function tickLabel(iso: string): string;
|
package/dist/types/index.d.mts
CHANGED
|
@@ -36,6 +36,13 @@ export type { StatechartNodeKind } from './statechart/StateNode.mjs';
|
|
|
36
36
|
export { default as StateTransition } from './statechart/StateTransition.mjs';
|
|
37
37
|
export { default as StatechartDesigner } from './statechart/StatechartDesigner.mjs';
|
|
38
38
|
export type { StatechartIssue } from './statechart/StatechartDesigner.mjs';
|
|
39
|
+
export { default as GanttTask } from './gantt/GanttTask.mjs';
|
|
40
|
+
export { default as GanttDependency } from './gantt/GanttDependency.mjs';
|
|
41
|
+
export { default as GanttRuler } from './gantt/GanttRuler.mjs';
|
|
42
|
+
export type { GanttRulerOptions } from './gantt/GanttRuler.mjs';
|
|
43
|
+
export { default as GanttDesigner } from './gantt/GanttDesigner.mjs';
|
|
44
|
+
export type { GanttIssue, GanttTaskInput } from './gantt/GanttDesigner.mjs';
|
|
45
|
+
export { parseDate, formatDate, addDays, diffDays, eachDay, tickLabel } from './gantt/gantt_date.mjs';
|
|
39
46
|
export { toPlantUml, fromPlantUml, arrowOf, detectUmlDialect } from './uml/uml_text.mjs';
|
|
40
47
|
export type { UmlTextImportResult } from './uml/uml_text.mjs';
|
|
41
48
|
/**
|
package/dist/types/index.d.ts
CHANGED
|
@@ -36,6 +36,13 @@ export type { StatechartNodeKind } from './statechart/StateNode';
|
|
|
36
36
|
export { default as StateTransition } from './statechart/StateTransition';
|
|
37
37
|
export { default as StatechartDesigner } from './statechart/StatechartDesigner';
|
|
38
38
|
export type { StatechartIssue } from './statechart/StatechartDesigner';
|
|
39
|
+
export { default as GanttTask } from './gantt/GanttTask';
|
|
40
|
+
export { default as GanttDependency } from './gantt/GanttDependency';
|
|
41
|
+
export { default as GanttRuler } from './gantt/GanttRuler';
|
|
42
|
+
export type { GanttRulerOptions } from './gantt/GanttRuler';
|
|
43
|
+
export { default as GanttDesigner } from './gantt/GanttDesigner';
|
|
44
|
+
export type { GanttIssue, GanttTaskInput } from './gantt/GanttDesigner';
|
|
45
|
+
export { parseDate, formatDate, addDays, diffDays, eachDay, tickLabel } from './gantt/gantt_date';
|
|
39
46
|
export { toPlantUml, fromPlantUml, arrowOf, detectUmlDialect } from './uml/uml_text';
|
|
40
47
|
export type { UmlTextImportResult } from './uml/uml_text';
|
|
41
48
|
/**
|