@xpyjs/gantt-core 0.0.1-alpha.5 → 0.0.1-beta.0
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/x-gantt.js +1447 -1230
- package/dist/x-gantt.umd.cjs +3 -3
- package/package.json +1 -1
- package/types/rendering/chart/ChartFlag.d.ts +36 -0
- package/types/rendering/chart/ChartToday.d.ts +1 -0
- package/types/rendering/chart/index.d.ts +1 -0
- package/types/store/TimeAxis.d.ts +0 -2
- package/types/types/options.d.ts +101 -0
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-
|
|
4
|
+
"version": "0.0.1-beta.0",
|
|
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",
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import Konva from "konva";
|
|
2
|
+
import { IContext } from "@/types/render";
|
|
3
|
+
/**
|
|
4
|
+
* 标志日期的渲染
|
|
5
|
+
*/
|
|
6
|
+
export declare class FlagGroup {
|
|
7
|
+
private context;
|
|
8
|
+
private layer;
|
|
9
|
+
private width;
|
|
10
|
+
private height;
|
|
11
|
+
private offsetX;
|
|
12
|
+
private offsetY;
|
|
13
|
+
private flagGroup;
|
|
14
|
+
constructor(context: IContext, layer: 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
|
+
private clearFlag;
|
|
32
|
+
/**
|
|
33
|
+
* 计算标志日期
|
|
34
|
+
*/
|
|
35
|
+
private calculateFlag;
|
|
36
|
+
}
|
package/types/types/options.d.ts
CHANGED
|
@@ -776,6 +776,25 @@ export interface IGanttOptions {
|
|
|
776
776
|
* @default 1
|
|
777
777
|
*/
|
|
778
778
|
width: number;
|
|
779
|
+
/**
|
|
780
|
+
* 今日时间线的文本
|
|
781
|
+
*/
|
|
782
|
+
text?: {
|
|
783
|
+
/** 是否显示文本 */
|
|
784
|
+
show?: boolean;
|
|
785
|
+
/** 文本内容。默认为 '今天' */
|
|
786
|
+
content?: string;
|
|
787
|
+
/** 文本颜色 */
|
|
788
|
+
color?: string;
|
|
789
|
+
/** 背景颜色 */
|
|
790
|
+
backgroundColor?: string;
|
|
791
|
+
/** 透明度 */
|
|
792
|
+
opacity?: number;
|
|
793
|
+
/** 文本字体大小 */
|
|
794
|
+
fontSize?: number;
|
|
795
|
+
/** 文本字体 */
|
|
796
|
+
fontFamily?: string;
|
|
797
|
+
}
|
|
779
798
|
};
|
|
780
799
|
|
|
781
800
|
/** 周末配置 */
|
|
@@ -823,10 +842,92 @@ export interface IGanttOptions {
|
|
|
823
842
|
date: Date | number | string | Array<Date | number | string>;
|
|
824
843
|
backgroundColor?: string;
|
|
825
844
|
opacity?: number;
|
|
845
|
+
/**
|
|
846
|
+
* 自定义节假日期的文本
|
|
847
|
+
*/
|
|
848
|
+
text?: {
|
|
849
|
+
/** 是否显示文本 */
|
|
850
|
+
show?: boolean;
|
|
851
|
+
/** 文本内容 */
|
|
852
|
+
content?: string;
|
|
853
|
+
/** 文本颜色 */
|
|
854
|
+
color?: string;
|
|
855
|
+
/** 背景颜色 */
|
|
856
|
+
backgroundColor?: string;
|
|
857
|
+
/** 透明度 */
|
|
858
|
+
opacity?: number;
|
|
859
|
+
/** 文本字体大小 */
|
|
860
|
+
fontSize?: number;
|
|
861
|
+
/** 文本字体 */
|
|
862
|
+
fontFamily?: string;
|
|
863
|
+
}
|
|
826
864
|
} & IPattern
|
|
827
865
|
>;
|
|
828
866
|
} & IPattern;
|
|
829
867
|
|
|
868
|
+
/** 标志配置。它用于配置一个或多个标志性日期 */
|
|
869
|
+
flag?: {
|
|
870
|
+
/**
|
|
871
|
+
* 是否展示标志
|
|
872
|
+
*
|
|
873
|
+
* @default false
|
|
874
|
+
*/
|
|
875
|
+
show: boolean;
|
|
876
|
+
/**
|
|
877
|
+
* 标志的背景颜色。默认使用主色调
|
|
878
|
+
*/
|
|
879
|
+
backgroundColor?: string;
|
|
880
|
+
/**
|
|
881
|
+
* 透明度
|
|
882
|
+
*
|
|
883
|
+
* @description 它会影响标志的整体透明度
|
|
884
|
+
*/
|
|
885
|
+
opacity?: number;
|
|
886
|
+
/** 文本颜色 */
|
|
887
|
+
color?: string;
|
|
888
|
+
/** 文本字体大小 */
|
|
889
|
+
fontSize?: number;
|
|
890
|
+
/** 文本字体 */
|
|
891
|
+
fontFamily?: string;
|
|
892
|
+
/** 标志日期的数据以及配置 */
|
|
893
|
+
data: Array<{
|
|
894
|
+
/**
|
|
895
|
+
* 标志的背景颜色
|
|
896
|
+
*/
|
|
897
|
+
backgroundColor?: string;
|
|
898
|
+
/**
|
|
899
|
+
* 透明度
|
|
900
|
+
*
|
|
901
|
+
* @description 它会影响标志的整体透明度
|
|
902
|
+
*/
|
|
903
|
+
opacity?: number;
|
|
904
|
+
/**
|
|
905
|
+
* 标志时间。支持精准时间,会根据最精度位置展示
|
|
906
|
+
*/
|
|
907
|
+
date: Date | number | string;
|
|
908
|
+
/** 文本内容。展示文本就是普通文本旗帜 */
|
|
909
|
+
content?: string;
|
|
910
|
+
/**
|
|
911
|
+
* 如果不展示文本,支持几种特殊旗帜符号
|
|
912
|
+
*
|
|
913
|
+
* @description 它与文本内容互斥,如果 content 不为空,则不会展示特殊旗帜
|
|
914
|
+
*
|
|
915
|
+
* @param banner 横幅旗(比带文本旗帜略小)
|
|
916
|
+
* @param pennant 三角信号旗
|
|
917
|
+
* @param tag 矩形带缺口旗
|
|
918
|
+
* @param wedge 锥形旗
|
|
919
|
+
* @param ribbon 丝带旗
|
|
920
|
+
*/
|
|
921
|
+
flag?: "banner" | "pennant" | "tag" | "wedge" | "ribbon";
|
|
922
|
+
/** 文本颜色 */
|
|
923
|
+
color?: string;
|
|
924
|
+
/** 文本字体大小 */
|
|
925
|
+
fontSize?: number;
|
|
926
|
+
/** 文本字体 */
|
|
927
|
+
fontFamily?: string;
|
|
928
|
+
}>
|
|
929
|
+
}
|
|
930
|
+
|
|
830
931
|
/** 滚动条配置 */
|
|
831
932
|
scrollbar?: {
|
|
832
933
|
/** 是否显示水平滚动条 */
|