@xpyjs/gantt-core 0.0.1 → 0.0.3

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",
4
+ "version": "0.0.3",
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",
@@ -34,6 +34,7 @@ export declare enum EventName {
34
34
  CHART_OFFSET_CHANGE = "chart_offset_change",
35
35
  DATA_UPDATE = "data-update",
36
36
  VIEW_UPDATE = "view-update",
37
+ OPTIONS_UPDATE = "options-update",
37
38
  UPDATE_TABLE_HEADER = "update_table_header",
38
39
  UPDATE_TABLE_BODY = "update_table_body",
39
40
  UPDATE_CHART_HEADER = "update_chart_header",
@@ -11,7 +11,7 @@ export declare class ChartRow {
11
11
  slider: ChartSlider;
12
12
  cacheKey: string;
13
13
  constructor(context: IContext, task: Task, id: string, x: number, y: number, width: number, height: number);
14
- update(x: number, y: number): void;
14
+ update(x: number, y: number, task: Task): void;
15
15
  setOffset(x: number, y: number): void;
16
16
  destroy(): void;
17
17
  }
@@ -29,7 +29,7 @@ export declare class ChartSlider {
29
29
  private dragDiffX;
30
30
  private oldTasks;
31
31
  constructor(context: IContext, x: number, y: number, task: Task, rowWidth: number);
32
- update(x: number, y: number): void;
32
+ update(x: number, y: number, task: Task): void;
33
33
  setOffset(x: number, y: number): void;
34
34
  /** 太多需要 function 的判断,搞一个统一的转换 */
35
35
  private unpackFunc;
@@ -47,4 +47,8 @@ export declare class GuideLine {
47
47
  * 获取当前位置
48
48
  */
49
49
  getLeft(): number;
50
+ /**
51
+ * 更新参数
52
+ */
53
+ updateOptions(): void;
50
54
  }
@@ -7,9 +7,17 @@ export declare class MiddleResizeLine {
7
7
  private initialWidth;
8
8
  private collapseButton;
9
9
  constructor(root: IContext, container: HTMLElement);
10
+ /**
11
+ * 初始化事件
12
+ */
13
+ private initEvents;
10
14
  setOffset(x: number): void;
11
15
  /**
12
16
  * 添加拖拽事件
13
17
  */
14
18
  private addDragEvents;
19
+ /**
20
+ * 更新配置
21
+ */
22
+ private updateOptions;
15
23
  }
@@ -67,6 +67,7 @@ export declare class Scrollbar {
67
67
  private throttledHandleMouseMove;
68
68
  private throttledHandleWheel;
69
69
  constructor(root: IContext, rootElement: HTMLElement, options?: Partial<ScrollbarOptions>);
70
+ updateOptions(options?: Partial<ScrollbarOptions>): void;
70
71
  private createElements;
71
72
  private createScrollbarElement;
72
73
  private createScrollThumbElement;
@@ -40,6 +40,8 @@ export declare class ColumnManager {
40
40
  private leafColumns;
41
41
  /** 临时叶子列数据,用于更新源数据,读取宽度等原信息 */
42
42
  private temporaryLeafColumns;
43
+ /** 记录每一列的列宽 */
44
+ private columnWidths;
43
45
  /**
44
46
  * 保存所有行列合并的信息
45
47
  *
@@ -50,6 +50,11 @@ export declare class DataManager {
50
50
  private initTasks;
51
51
  private createTask;
52
52
  private updateTask;
53
+ /**
54
+ * 递归清理任务(从全局 Map、选中状态等中移除)
55
+ * 这是一个内部辅助方法,不触发视图更新事件,仅清理数据引用
56
+ */
57
+ private removeTasksRecursive;
53
58
  /**
54
59
  * 获取源数据
55
60
  */
@@ -556,6 +556,16 @@ export interface IGanttOptions {
556
556
  color: string;
557
557
  };
558
558
 
559
+ /** 表格收起按钮配置 */
560
+ collapse: {
561
+ /** 是否显示收起按钮。默认 true */
562
+ show: boolean;
563
+ /** 按钮背景颜色。默认 #fff */
564
+ backgroundColor: string;
565
+ /** 按钮圆角。针对右上角与右下角。默认 6 */
566
+ radius: number;
567
+ };
568
+
559
569
  /** 头部配置 */
560
570
  header: {
561
571
  /**
@@ -566,7 +576,7 @@ export interface IGanttOptions {
566
576
  height: number;
567
577
  /** 背景颜色。默认使用主色调 */
568
578
  backgroundColor?: string;
569
- /** 文字颜色 */
579
+ /** 文字颜色。支持 auto 特殊关键字,当为 auto 时,可根据背景色自动调整为 黑/白 */
570
580
  color: string;
571
581
  /**
572
582
  * 文字大小
@@ -127,11 +127,6 @@ export interface ITableOptions {
127
127
  */
128
128
  emptyText: string;
129
129
 
130
- /**
131
- * 允许收起表格。开启后,中线会显示一个折叠按钮,点击后可以收起表格
132
- */
133
- collapsible?: boolean;
134
-
135
130
  /**
136
131
  * 列配置
137
132
  */
@@ -145,4 +145,6 @@ export declare class Colorjs {
145
145
  * @throws {Error} 如果颜色值无法解析 (除非内部构造函数处理了默认值)。
146
146
  */
147
147
  export declare const colorjs: (value: any) => Colorjs;
148
+ /** 判断颜色是否需要自动调整 */
149
+ export declare const autoColor: (color: string, target: string) => string;
148
150
  export {};