@visactor/vtable-gantt 1.5.4 → 1.6.0-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/cjs/Gantt.d.ts +16 -7
- package/cjs/Gantt.js +52 -32
- package/cjs/Gantt.js.map +1 -1
- package/cjs/event/event-manager.js +6 -2
- package/cjs/event/event-manager.js.map +1 -1
- package/cjs/gantt-helper.js +28 -20
- package/cjs/gantt-helper.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/frame-border.js +2 -2
- package/cjs/scenegraph/frame-border.js.map +1 -1
- package/cjs/scenegraph/grid.js +6 -6
- package/cjs/scenegraph/grid.js.map +1 -1
- package/cjs/scenegraph/mark-line.js +2 -1
- package/cjs/scenegraph/scenegraph.d.ts +1 -0
- package/cjs/scenegraph/scenegraph.js +4 -1
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/scroll-bar.js +1 -2
- package/cjs/scenegraph/task-bar.d.ts +1 -0
- package/cjs/scenegraph/task-bar.js +11 -8
- package/cjs/scenegraph/task-bar.js.map +1 -1
- package/cjs/state/gantt-table-sync.js +1 -8
- package/cjs/state/gantt-table-sync.js.map +1 -1
- package/cjs/state/state-manager.js +5 -6
- package/cjs/state/state-manager.js.map +1 -1
- package/cjs/ts-types/gantt-engine.d.ts +9 -7
- package/cjs/ts-types/gantt-engine.js.map +1 -1
- package/dist/vtable-gantt.js +286 -156
- package/dist/vtable-gantt.min.js +1 -1
- package/es/Gantt.d.ts +16 -7
- package/es/Gantt.js +50 -31
- package/es/Gantt.js.map +1 -1
- package/es/event/event-manager.js +6 -2
- package/es/event/event-manager.js.map +1 -1
- package/es/gantt-helper.js +28 -20
- package/es/gantt-helper.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/frame-border.js +2 -2
- package/es/scenegraph/frame-border.js.map +1 -1
- package/es/scenegraph/grid.js +6 -6
- package/es/scenegraph/grid.js.map +1 -1
- package/es/scenegraph/mark-line.js +2 -1
- package/es/scenegraph/scenegraph.d.ts +1 -0
- package/es/scenegraph/scenegraph.js +5 -0
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/scroll-bar.js +1 -2
- package/es/scenegraph/task-bar.d.ts +1 -0
- package/es/scenegraph/task-bar.js +4 -2
- package/es/scenegraph/task-bar.js.map +1 -1
- package/es/state/gantt-table-sync.js +1 -8
- package/es/state/gantt-table-sync.js.map +1 -1
- package/es/state/state-manager.js +6 -5
- package/es/state/state-manager.js.map +1 -1
- package/es/ts-types/gantt-engine.d.ts +9 -7
- package/es/ts-types/gantt-engine.js.map +1 -1
- package/package.json +18 -18
package/cjs/Gantt.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Scenegraph } from './scenegraph/scenegraph';
|
|
2
|
-
import type { ITaskBarStyle, GanttConstructorOptions, IGridStyle, ITimelineHeaderStyle, IMarkLine, ITaskBarLabelText, ITaskBarLabelTextStyle, IScrollStyle, IFrameStyle, ITableColumnsDefine,
|
|
2
|
+
import type { ITaskBarStyle, GanttConstructorOptions, IGridStyle, ITimelineHeaderStyle, IMarkLine, ITaskBarLabelText, ITaskBarLabelTextStyle, IScrollStyle, IFrameStyle, ITableColumnsDefine, ITaskBarCustomLayout, ITimelineDateInfo, ITimelineScale, ILineStyle } from './ts-types';
|
|
3
3
|
import type { ListTableConstructorOptions } from '@visactor/vtable';
|
|
4
4
|
import { ListTable } from '@visactor/vtable';
|
|
5
5
|
import { EventManager } from './event/event-manager';
|
|
@@ -23,6 +23,7 @@ export declare class Gantt extends EventTarget {
|
|
|
23
23
|
canvas: HTMLCanvasElement;
|
|
24
24
|
element: HTMLElement;
|
|
25
25
|
resizeLine: HTMLDivElement;
|
|
26
|
+
horizontalSplitLine: HTMLDivElement;
|
|
26
27
|
context: CanvasRenderingContext2D;
|
|
27
28
|
sortedTimelineScales: (ITimelineScale & {
|
|
28
29
|
timelineDates?: ITimelineDateInfo[];
|
|
@@ -47,13 +48,18 @@ export declare class Gantt extends EventTarget {
|
|
|
47
48
|
timelineHeaderStyles: ITimelineHeaderStyle[];
|
|
48
49
|
gridStyle: IGridStyle;
|
|
49
50
|
taskBarStyle: ITaskBarStyle;
|
|
51
|
+
taskBarHoverStyle: ITaskBarStyle & {
|
|
52
|
+
barOverLayColor?: string;
|
|
53
|
+
};
|
|
54
|
+
taskBarSelectionStyle: ITaskBarStyle & {
|
|
55
|
+
barOverLayColor?: string;
|
|
56
|
+
};
|
|
50
57
|
taskBarLabelText: ITaskBarLabelText;
|
|
51
58
|
taskBarMoveable: boolean;
|
|
52
59
|
taskBarResizable: boolean;
|
|
53
|
-
taskBarHoverColor: string;
|
|
54
60
|
taskBarLabelStyle: ITaskBarLabelTextStyle;
|
|
55
61
|
taskBarCustomLayout: ITaskBarCustomLayout;
|
|
56
|
-
|
|
62
|
+
outerFrameStyle: IFrameStyle;
|
|
57
63
|
pixelRatio: number;
|
|
58
64
|
startDateField: string;
|
|
59
65
|
endDateField: string;
|
|
@@ -63,7 +69,10 @@ export declare class Gantt extends EventTarget {
|
|
|
63
69
|
_minDateTime: number;
|
|
64
70
|
_maxDateTime: number;
|
|
65
71
|
markLine: IMarkLine[];
|
|
66
|
-
|
|
72
|
+
horizontalSplitLine: ILineStyle;
|
|
73
|
+
verticalSplitLine: ILineStyle;
|
|
74
|
+
verticalSplitLineHighlight: ILineStyle;
|
|
75
|
+
verticalSplitLineMoveable?: boolean;
|
|
67
76
|
overscrollBehavior: 'auto' | 'none';
|
|
68
77
|
};
|
|
69
78
|
taskTableWidth: number;
|
|
@@ -75,7 +84,7 @@ export declare class Gantt extends EventTarget {
|
|
|
75
84
|
_updateSize(): void;
|
|
76
85
|
_generateListTable(): void;
|
|
77
86
|
_generateListTableOptions(): ListTableConstructorOptions;
|
|
78
|
-
|
|
87
|
+
_createSplitLineAndResizeLine(): void;
|
|
79
88
|
getElement(): HTMLElement;
|
|
80
89
|
getContainer(): HTMLElement;
|
|
81
90
|
_sortScales(): void;
|
|
@@ -100,8 +109,8 @@ export declare class Gantt extends EventTarget {
|
|
|
100
109
|
endDate: Date;
|
|
101
110
|
progress: any;
|
|
102
111
|
};
|
|
103
|
-
|
|
104
|
-
updateTaskRecord(index: number): void;
|
|
112
|
+
_updateDateToTaskRecord(updateDateType: 'move' | 'start-move' | 'end-move', days: number, index: number): void;
|
|
113
|
+
updateTaskRecord(index: number, record: any): void;
|
|
105
114
|
setPixelRatio(pixelRatio: number): void;
|
|
106
115
|
_resize(): void;
|
|
107
116
|
_syncPropsFromTable(): void;
|
package/cjs/Gantt.js
CHANGED
|
@@ -33,12 +33,13 @@ class Gantt extends EventTarget_1.EventTarget {
|
|
|
33
33
|
right: 0,
|
|
34
34
|
left: 0,
|
|
35
35
|
bottom: 0
|
|
36
|
-
}, "vtable-gantt"), this.element.style.
|
|
36
|
+
}, "vtable-gantt"), this.element.style.left = this.taskTableWidth ? `${this.taskTableWidth}px` : "0px",
|
|
37
37
|
this.canvas = document.createElement("canvas"), this.element.appendChild(this.canvas),
|
|
38
38
|
this.context = this.canvas.getContext("2d"), container ? (container.appendChild(this.element),
|
|
39
39
|
this._updateSize()) : this._updateSize(), this._generateListTable(), this._syncPropsFromTable(),
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
40
|
+
this._createSplitLineAndResizeLine(), this.scenegraph = new scenegraph_1.Scenegraph(this),
|
|
41
|
+
this.stateManager = new state_manager_1.StateManager(this), this.eventManager = new event_manager_1.EventManager(this),
|
|
42
|
+
this.scenegraph.afterCreateSceneGraph();
|
|
42
43
|
}
|
|
43
44
|
renderTaskTable() {
|
|
44
45
|
this.scenegraph.updateNextFrame();
|
|
@@ -66,20 +67,22 @@ class Gantt extends EventTarget_1.EventTarget {
|
|
|
66
67
|
const width = Math.floor(widthP - (0, gantt_helper_1.getVerticalScrollBarSize)(this.parsedOptions.scrollStyle)), height = Math.floor(heightP - (0,
|
|
67
68
|
gantt_helper_1.getHorizontalScrollBarSize)(this.parsedOptions.scrollStyle));
|
|
68
69
|
if (this.tableNoFrameWidth = widthP, this.tableNoFrameHeight = Math.floor(heightP),
|
|
69
|
-
this.parsedOptions.
|
|
70
|
-
const lineWidth = null === (_f = this.parsedOptions.
|
|
70
|
+
this.parsedOptions.outerFrameStyle) {
|
|
71
|
+
const lineWidth = null === (_f = this.parsedOptions.outerFrameStyle) || void 0 === _f ? void 0 : _f.borderLineWidth;
|
|
71
72
|
this.tableX = lineWidth, this.tableY = lineWidth, this.tableNoFrameWidth = width - lineWidth,
|
|
72
73
|
this.tableNoFrameHeight = height - 2 * lineWidth;
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
_generateListTable() {
|
|
76
|
-
var _a, _b;
|
|
77
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
77
78
|
if (this.taskTableColumns.length >= 1) {
|
|
78
79
|
const listTableOption = this._generateListTableOptions();
|
|
79
80
|
if (this.taskListTableInstance = new vtable_1.ListTable(this.container, listTableOption),
|
|
80
81
|
"auto" === (null === (_b = null === (_a = this.options) || void 0 === _a ? void 0 : _a.taskListTable) || void 0 === _b ? void 0 : _b.width) && (this.taskTableWidth = this.taskListTableInstance.getAllColsWidth() + 2 * this.taskListTableInstance.tableX,
|
|
82
|
+
(null === (_d = null === (_c = this.options) || void 0 === _c ? void 0 : _c.taskListTable) || void 0 === _d ? void 0 : _d.maxWidth) && (this.taskTableWidth = Math.min(null === (_f = null === (_e = this.options) || void 0 === _e ? void 0 : _e.taskListTable) || void 0 === _f ? void 0 : _f.maxWidth, this.taskTableWidth)),
|
|
83
|
+
(null === (_h = null === (_g = this.options) || void 0 === _g ? void 0 : _g.taskListTable) || void 0 === _h ? void 0 : _h.minWidth) && (this.taskTableWidth = Math.max(null === (_k = null === (_j = this.options) || void 0 === _j ? void 0 : _j.taskListTable) || void 0 === _k ? void 0 : _k.minWidth, this.taskTableWidth)),
|
|
81
84
|
this.element.style.left = this.taskTableWidth ? `${this.taskTableWidth}px` : "0px",
|
|
82
|
-
this.taskListTableInstance.setCanvasSize(this.taskTableWidth, this.tableNoFrameHeight + 2 * this.parsedOptions.
|
|
85
|
+
this.taskListTableInstance.setCanvasSize(this.taskTableWidth, this.tableNoFrameHeight + 2 * this.parsedOptions.outerFrameStyle.borderLineWidth),
|
|
83
86
|
this._updateSize()), this.taskListTableInstance.columnHeaderLevelCount > 1) if (Array.isArray(this.parsedOptions.headerRowHeight) && this.taskListTableInstance.columnHeaderLevelCount === this.parsedOptions.headerRowHeight.length) for (let i = 0; i < this.taskListTableInstance.columnHeaderLevelCount; i++) this.taskListTableInstance.setRowHeight(i, this.parsedOptions.headerRowHeight[i]); else {
|
|
84
87
|
const newRowHeight = this.getAllHeaderRowsHeight() / this.taskListTableInstance.columnHeaderLevelCount;
|
|
85
88
|
for (let i = 0; i < this.taskListTableInstance.columnHeaderLevelCount; i++) this.taskListTableInstance.setRowHeight(i, newRowHeight);
|
|
@@ -90,7 +93,8 @@ class Gantt extends EventTarget_1.EventTarget {
|
|
|
90
93
|
var _a;
|
|
91
94
|
const listTable_options = {}, needPutInListTableKeys = [ "container", "records", "pixelRatio", "overscrollBehavior", "pixelRatio" ];
|
|
92
95
|
for (const key in this.options) needPutInListTableKeys.indexOf(key) >= 0 && (listTable_options[key] = this.options[key]);
|
|
93
|
-
for (const key in this.options.taskListTable) listTable_options[key] = this.options.taskListTable[key]
|
|
96
|
+
for (const key in this.options.taskListTable) listTable_options[key] = this.options.taskListTable[key],
|
|
97
|
+
"columns" === key && (listTable_options[key][listTable_options[key].length - 1].disableColumnResize = !0);
|
|
94
98
|
return listTable_options.theme = {
|
|
95
99
|
scrollStyle: Object.assign({}, this.parsedOptions.scrollStyle, {
|
|
96
100
|
verticalVisible: "none"
|
|
@@ -99,34 +103,48 @@ class Gantt extends EventTarget_1.EventTarget {
|
|
|
99
103
|
bgColor: this.parsedOptions.timelineHeaderBackgroundColor
|
|
100
104
|
}, this.options.taskListTable.headerStyle),
|
|
101
105
|
cellInnerBorder: !1,
|
|
102
|
-
frameStyle: Object.assign({}, this.parsedOptions.
|
|
103
|
-
cornerRadius: this.parsedOptions.
|
|
104
|
-
borderLineWidth: [ this.parsedOptions.
|
|
106
|
+
frameStyle: Object.assign({}, this.parsedOptions.outerFrameStyle, {
|
|
107
|
+
cornerRadius: this.parsedOptions.outerFrameStyle.cornerRadius,
|
|
108
|
+
borderLineWidth: [ this.parsedOptions.outerFrameStyle.borderLineWidth, 0, this.parsedOptions.outerFrameStyle.borderLineWidth, this.parsedOptions.outerFrameStyle.borderLineWidth ]
|
|
105
109
|
}),
|
|
106
110
|
bodyStyle: Object.assign({}, vtable_1.themes.DEFAULT.bodyStyle, this.options.taskListTable.bodyStyle)
|
|
107
111
|
}, listTable_options.canvasWidth = this.taskTableWidth, listTable_options.canvasHeight = null !== (_a = this.canvasHeight) && void 0 !== _a ? _a : this.canvas.height,
|
|
108
112
|
listTable_options.defaultHeaderRowHeight = this.getAllHeaderRowsHeight(), listTable_options.defaultRowHeight = this.parsedOptions.rowHeight,
|
|
109
113
|
listTable_options.clearDOM = !1, listTable_options;
|
|
110
114
|
}
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
_createSplitLineAndResizeLine() {
|
|
116
|
+
var _a, _b, _c;
|
|
117
|
+
if (this.parsedOptions.horizontalSplitLine && (this.horizontalSplitLine = document.createElement("div"),
|
|
118
|
+
this.horizontalSplitLine.style.position = "absolute", this.horizontalSplitLine.style.top = this.getAllHeaderRowsHeight() + "px",
|
|
119
|
+
this.horizontalSplitLine.style.left = this.tableY + "px", this.horizontalSplitLine.style.height = (null !== (_a = this.parsedOptions.horizontalSplitLine.lineWidth) && void 0 !== _a ? _a : 2) + "px",
|
|
120
|
+
this.horizontalSplitLine.style.width = this.tableNoFrameHeight + this.taskTableWidth + "px",
|
|
121
|
+
this.horizontalSplitLine.style.backgroundColor = this.parsedOptions.horizontalSplitLine.lineColor,
|
|
122
|
+
this.horizontalSplitLine.style.zIndex = "100", this.horizontalSplitLine.style.userSelect = "none",
|
|
123
|
+
this.horizontalSplitLine.style.opacity = "1", this.container.appendChild(this.horizontalSplitLine)),
|
|
124
|
+
this.taskListTableInstance) {
|
|
113
125
|
this.resizeLine = document.createElement("div"), this.resizeLine.style.position = "absolute",
|
|
114
126
|
this.resizeLine.style.top = this.tableY + "px", this.resizeLine.style.left = this.taskTableWidth ? this.taskTableWidth - 7 + "px" : "0px",
|
|
115
127
|
this.resizeLine.style.width = "14px", this.resizeLine.style.height = this.drawHeight + "px",
|
|
116
128
|
this.resizeLine.style.backgroundColor = "rgba(0,0,0,0)", this.resizeLine.style.zIndex = "100",
|
|
117
|
-
this.
|
|
118
|
-
this.resizeLine.style.opacity = "1";
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
highlightLine.style.
|
|
129
|
-
|
|
129
|
+
this.parsedOptions.verticalSplitLineMoveable && (this.resizeLine.style.cursor = "col-resize"),
|
|
130
|
+
this.resizeLine.style.userSelect = "none", this.resizeLine.style.opacity = "1";
|
|
131
|
+
const verticalSplitLine = document.createElement("div");
|
|
132
|
+
if (verticalSplitLine.style.position = "absolute", verticalSplitLine.style.top = "0px",
|
|
133
|
+
verticalSplitLine.style.left = (14 - this.parsedOptions.verticalSplitLine.lineWidth) / 2 + "px",
|
|
134
|
+
verticalSplitLine.style.width = this.parsedOptions.verticalSplitLine.lineWidth + "px",
|
|
135
|
+
verticalSplitLine.style.height = "100%", verticalSplitLine.style.backgroundColor = this.parsedOptions.verticalSplitLine.lineColor,
|
|
136
|
+
verticalSplitLine.style.zIndex = "100", verticalSplitLine.style.userSelect = "none",
|
|
137
|
+
verticalSplitLine.style.pointerEvents = "none", verticalSplitLine.style.transition = "background-color 0.3s",
|
|
138
|
+
this.resizeLine.appendChild(verticalSplitLine), this.parsedOptions.verticalSplitLineHighlight) {
|
|
139
|
+
const highlightLine = document.createElement("div");
|
|
140
|
+
highlightLine.style.position = "absolute", highlightLine.style.top = "0px", highlightLine.style.left = (null !== (_b = 14 - this.parsedOptions.verticalSplitLineHighlight.lineWidth) && void 0 !== _b ? _b : 2) / 2 + "px",
|
|
141
|
+
highlightLine.style.width = (null !== (_c = this.parsedOptions.verticalSplitLineHighlight.lineWidth) && void 0 !== _c ? _c : 2) + "px",
|
|
142
|
+
highlightLine.style.height = "100%", highlightLine.style.backgroundColor = this.parsedOptions.verticalSplitLineHighlight.lineColor,
|
|
143
|
+
highlightLine.style.zIndex = "100", highlightLine.style.cursor = "col-resize", highlightLine.style.userSelect = "none",
|
|
144
|
+
highlightLine.style.pointerEvents = "none", highlightLine.style.opacity = "0", highlightLine.style.transition = "background-color 0.3s",
|
|
145
|
+
this.resizeLine.appendChild(highlightLine);
|
|
146
|
+
}
|
|
147
|
+
this.container.appendChild(this.resizeLine);
|
|
130
148
|
}
|
|
131
149
|
}
|
|
132
150
|
getElement() {
|
|
@@ -194,7 +212,7 @@ class Gantt extends EventTarget_1.EventTarget {
|
|
|
194
212
|
progress: progress
|
|
195
213
|
};
|
|
196
214
|
}
|
|
197
|
-
|
|
215
|
+
_updateDateToTaskRecord(updateDateType, days, index) {
|
|
198
216
|
const taskRecord = this.getRecordByIndex(index), startDateField = this.parsedOptions.startDateField, endDateField = this.parsedOptions.endDateField, dateFormat = (0,
|
|
199
217
|
util_1.parseDateFormat)(taskRecord[startDateField]), startDate = new Date(taskRecord[startDateField]), endDate = new Date(taskRecord[endDateField]);
|
|
200
218
|
if ("move" === updateDateType) {
|
|
@@ -210,15 +228,14 @@ class Gantt extends EventTarget_1.EventTarget {
|
|
|
210
228
|
}
|
|
211
229
|
this.updateRecordToListTable(taskRecord, index);
|
|
212
230
|
}
|
|
213
|
-
updateTaskRecord(index) {
|
|
214
|
-
|
|
215
|
-
this.updateRecordToListTable(taskRecord, index);
|
|
231
|
+
updateTaskRecord(index, record) {
|
|
232
|
+
this.updateRecordToListTable(record, index);
|
|
216
233
|
}
|
|
217
234
|
setPixelRatio(pixelRatio) {
|
|
218
235
|
this.parsedOptions.pixelRatio = pixelRatio, this.scenegraph.setPixelRatio(pixelRatio);
|
|
219
236
|
}
|
|
220
237
|
_resize() {
|
|
221
|
-
this._updateSize(), this.taskListTableInstance.setCanvasSize(this.taskTableWidth, this.tableNoFrameHeight + 2 * this.parsedOptions.
|
|
238
|
+
this._updateSize(), this.taskListTableInstance.setCanvasSize(this.taskTableWidth, this.tableNoFrameHeight + 2 * this.parsedOptions.outerFrameStyle.borderLineWidth),
|
|
222
239
|
this._syncPropsFromTable(), this.scenegraph.resize();
|
|
223
240
|
}
|
|
224
241
|
_syncPropsFromTable() {
|
|
@@ -237,7 +254,10 @@ class Gantt extends EventTarget_1.EventTarget {
|
|
|
237
254
|
parentElement && parentElement.removeChild(this.element), this.scenegraph = null;
|
|
238
255
|
}
|
|
239
256
|
setRecords(records) {
|
|
240
|
-
this.records = records
|
|
257
|
+
this.records = records, this.taskListTableInstance.setRecords(records), this._syncPropsFromTable(),
|
|
258
|
+
this.resizeLine.style.height = this.drawHeight + "px", this.scenegraph.refreshTaskBarsAndGrid();
|
|
259
|
+
const left = this.stateManager.scroll.horizontalBarPos, top = this.stateManager.scroll.verticalBarPos;
|
|
260
|
+
this.scenegraph.setX(-left), this.scenegraph.setY(-top);
|
|
241
261
|
}
|
|
242
262
|
}
|
|
243
263
|
|
package/cjs/Gantt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Gantt.ts"],"names":[],"mappings":";;;AAEA,wDAAqD;AACrD,+BAA4B;AAmB5B,6CAAqD;AACrD,yDAAqD;AACrD,yDAAqD;AACrD,iDAOwB;AACxB,qDAAkD;AAClD,uCAAsF;AACtF,kDAA+C;AAE/C,SAAgB,iBAAiB,CAAC,OAAY,EAAE,Y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xB,CAAC;QACF,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC;IACxD,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,OAAO;;QACL,MAAA,KAAK,CAAC,OAAO,oDAAI,CAAC;QAClB,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;QAC5B,MAAA,IAAI,CAAC,qBAAqB,0CAAE,OAAO,EAAE,CAAC;QACtC,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QACvC,IAAI,aAAa,EAAE;YACjB,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACzC;QACD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;IACD,UAAU,CAAC,OAAc;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AA7fD,sBA6fC","file":"Gantt.js","sourcesContent":["// import themes from './themes';\n// import { createRootElement } from './core/tableHelper';\nimport { Scenegraph } from './scenegraph/scenegraph';\nimport { Env } from './env';\nimport type {\n ITaskBarStyle,\n GanttConstructorOptions,\n IGridStyle,\n ITimelineHeaderStyle,\n IMarkLine,\n ITaskBarLabelText,\n ITaskBarLabelTextStyle,\n IScrollStyle,\n IFrameStyle,\n ITableColumnsDefine,\n IResizeLineStyle,\n ITaskBarCustomLayout,\n ITimelineDateInfo,\n ITimelineScale,\n ILineStyle\n} from './ts-types';\nimport type { ListTableConstructorOptions, TYPES } from '@visactor/vtable';\nimport { ListTable, themes } from '@visactor/vtable';\nimport { EventManager } from './event/event-manager';\nimport { StateManager } from './state/state-manager';\nimport {\n DayTimes,\n generateMarkLine,\n generateTimeLineDate,\n getHorizontalScrollBarSize,\n getVerticalScrollBarSize,\n initOptions\n} from './gantt-helper';\nimport { EventTarget } from './event/EventTarget';\nimport { formatDate, getWeekNumber, parseDateFormat, toBoxArray } from './tools/util';\nimport { DataSource } from './data/DataSource';\n// import { generateGanttChartColumns } from './gantt-helper';\nexport function createRootElement(padding: any, className: string = 'vtable-gantt'): HTMLElement {\n const element = document.createElement('div');\n element.setAttribute('tabindex', '0');\n element.classList.add(className);\n element.style.outline = 'none';\n element.style.margin = `${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px`;\n\n const width = (element.offsetWidth || element.parentElement?.offsetWidth || 1) - 1;\n const height = (element.offsetHeight || element.parentElement?.offsetHeight || 1) - 1;\n\n element.style.width = (width && `${width - padding.left - padding.right}px`) || '0px';\n element.style.height = (height && `${height - padding.top - padding.bottom}px`) || '0px';\n\n return element;\n}\nexport class Gantt extends EventTarget {\n options: GanttConstructorOptions;\n container: HTMLElement;\n canvasWidth?: number;\n canvasHeight?: number;\n tableNoFrameWidth: number;\n tableNoFrameHeight: number;\n tableX: number;\n tableY: number;\n scenegraph: Scenegraph;\n stateManager: StateManager;\n eventManager: EventManager;\n\n taskListTableInstance?: ListTable;\n\n canvas: HTMLCanvasElement;\n element: HTMLElement;\n resizeLine: HTMLDivElement;\n context: CanvasRenderingContext2D;\n\n sortedTimelineScales: (ITimelineScale & { timelineDates?: ITimelineDateInfo[] })[];\n reverseSortedTimelineScales: (ITimelineScale & { timelineDates?: ITimelineDateInfo[] })[];\n headerLevel: number;\n itemCount: number;\n drawHeight: number;\n headerHeight: number;\n gridHeight: number;\n\n parsedOptions: {\n headerRowHeight: number | number[];\n rowHeight: number;\n timelineColWidth: number;\n colWidthPerDay: number; //分配给每日的宽度\n\n scrollStyle: IScrollStyle;\n // timelineHeaderStyle: ITimelineHeaderStyle;\n timelineHeaderVerticalLineStyle: ILineStyle;\n timelineHeaderHorizontalLineStyle: ILineStyle;\n timelineHeaderBackgroundColor: string;\n timelineHeaderStyles: ITimelineHeaderStyle[];\n gridStyle: IGridStyle;\n taskBarStyle: ITaskBarStyle;\n taskBarLabelText: ITaskBarLabelText;\n taskBarMoveable: boolean;\n taskBarResizable: boolean;\n taskBarHoverColor: string;\n taskBarLabelStyle: ITaskBarLabelTextStyle;\n taskBarCustomLayout: ITaskBarCustomLayout;\n frameStyle: IFrameStyle;\n pixelRatio: number;\n\n startDateField: string;\n endDateField: string;\n progressField: string;\n minDate: Date;\n maxDate: Date;\n _minDateTime: number;\n _maxDateTime: number;\n markLine: IMarkLine[];\n resizeLineStyle: IResizeLineStyle;\n overscrollBehavior: 'auto' | 'none';\n } = {} as any;\n\n taskTableWidth: number;\n taskTableColumns: ITableColumnsDefine;\n\n records: any[];\n data: DataSource;\n constructor(container: HTMLElement, options?: GanttConstructorOptions) {\n super();\n this.container = container;\n this.options = options;\n\n this.taskTableWidth = typeof options?.taskListTable?.width === 'number' ? options?.taskListTable?.width : 100;\n this.taskTableColumns = options?.taskListTable?.columns ?? [];\n this.records = options?.records ?? [];\n\n initOptions(this);\n this.data = new DataSource(this);\n this._sortScales();\n this._generateTimeLineDateMap();\n this.headerLevel = this.sortedTimelineScales.length;\n this.element = createRootElement({ top: 0, right: 0, left: 0, bottom: 0 }, 'vtable-gantt');\n this.element.style.top = '0px';\n this.element.style.left = this.taskTableWidth ? `${this.taskTableWidth}px` : '0px';\n\n this.canvas = document.createElement('canvas');\n this.element.appendChild(this.canvas);\n this.context = this.canvas.getContext('2d')!;\n if (container) {\n (container as HTMLElement).appendChild(this.element);\n this._updateSize();\n } else {\n this._updateSize();\n }\n this._generateListTable();\n this._syncPropsFromTable();\n\n this._createResizeLine();\n this.scenegraph = new Scenegraph(this);\n this.stateManager = new StateManager(this);\n this.eventManager = new EventManager(this);\n\n this.scenegraph.afterCreateSceneGraph();\n }\n\n renderTaskTable() {\n this.scenegraph.updateNextFrame();\n }\n /**\n * 窗口尺寸发生变化 或者像数比变化\n * @return {void}\n */\n _updateSize(): void {\n let widthP = 0;\n let heightP = 0;\n\n if (Env.mode === 'browser') {\n const element = this.getElement();\n let widthWithoutPadding = 0;\n let heightWithoutPadding = 0;\n if (element.parentElement) {\n const computedStyle = element.parentElement.style || window.getComputedStyle(element.parentElement); // 兼容性处理\n widthWithoutPadding =\n element.parentElement.offsetWidth -\n parseInt(computedStyle.paddingLeft || '0px', 10) -\n parseInt(computedStyle.paddingRight || '0px', 10);\n heightWithoutPadding =\n element.parentElement.offsetHeight -\n parseInt(computedStyle.paddingTop || '0px', 10) -\n parseInt(computedStyle.paddingBottom || '0px', 20);\n }\n const width1 = (widthWithoutPadding ?? 1) - 1 - this.taskTableWidth;\n const height1 = (heightWithoutPadding ?? 1) - 1;\n\n element.style.width = (width1 && `${width1}px`) || '0px';\n element.style.height = (height1 && `${height1}px`) || '0px';\n\n const { canvas } = this;\n\n widthP = canvas.parentElement?.offsetWidth ?? 1;\n heightP = canvas.parentElement?.offsetHeight ?? 1;\n\n //style 与 width,height相同\n if (this?.scenegraph?.stage) {\n this.scenegraph.stage.resize(widthP, heightP);\n } else {\n canvas.style.width = '';\n canvas.style.height = '';\n canvas.width = widthP;\n canvas.height = heightP;\n\n canvas.style.width = `${widthP}px`;\n canvas.style.height = `${heightP}px`;\n }\n } else if (Env.mode === 'node') {\n widthP = this.canvasWidth - 1;\n heightP = this.canvasHeight - 1;\n }\n const width = Math.floor(widthP - getVerticalScrollBarSize(this.parsedOptions.scrollStyle));\n const height = Math.floor(heightP - getHorizontalScrollBarSize(this.parsedOptions.scrollStyle));\n\n this.tableNoFrameWidth = widthP;\n this.tableNoFrameHeight = Math.floor(heightP);\n if (this.parsedOptions.frameStyle) {\n //考虑表格整体边框的问题\n const lineWidth = this.parsedOptions.frameStyle?.borderLineWidth; // toBoxArray(this.parsedOptions.frameStyle?.borderLineWidth ?? [null]);\n this.tableX = lineWidth;\n this.tableY = lineWidth;\n this.tableNoFrameWidth = width - lineWidth;\n\n this.tableNoFrameHeight = height - lineWidth * 2;\n }\n }\n _generateListTable() {\n if (this.taskTableColumns.length >= 1) {\n const listTableOption = this._generateListTableOptions();\n this.taskListTableInstance = new ListTable(this.container, listTableOption);\n\n if (this.options?.taskListTable?.width === 'auto') {\n this.taskTableWidth = this.taskListTableInstance.getAllColsWidth() + this.taskListTableInstance.tableX * 2;\n this.element.style.left = this.taskTableWidth ? `${this.taskTableWidth}px` : '0px';\n this.taskListTableInstance.setCanvasSize(\n this.taskTableWidth,\n this.tableNoFrameHeight + this.parsedOptions.frameStyle.borderLineWidth * 2\n );\n this._updateSize();\n }\n\n if (this.taskListTableInstance.columnHeaderLevelCount > 1) {\n if (\n Array.isArray(this.parsedOptions.headerRowHeight) &&\n this.taskListTableInstance.columnHeaderLevelCount === this.parsedOptions.headerRowHeight.length\n ) {\n for (let i = 0; i < this.taskListTableInstance.columnHeaderLevelCount; i++) {\n this.taskListTableInstance.setRowHeight(i, this.parsedOptions.headerRowHeight[i]);\n }\n } else {\n const newRowHeight = this.getAllHeaderRowsHeight() / this.taskListTableInstance.columnHeaderLevelCount;\n for (let i = 0; i < this.taskListTableInstance.columnHeaderLevelCount; i++) {\n this.taskListTableInstance.setRowHeight(i, newRowHeight);\n }\n }\n }\n }\n }\n _generateListTableOptions() {\n const listTable_options: ListTableConstructorOptions = {};\n const needPutInListTableKeys = ['container', 'records', 'pixelRatio', 'overscrollBehavior', 'pixelRatio'];\n for (const key in this.options) {\n if (needPutInListTableKeys.indexOf(key) >= 0) {\n listTable_options[key] = this.options[key];\n }\n }\n for (const key in this.options.taskListTable) {\n listTable_options[key] = this.options.taskListTable[key];\n }\n // lineWidthArr[1] = 0;\n listTable_options.theme = {\n scrollStyle: Object.assign({}, this.parsedOptions.scrollStyle, {\n verticalVisible: 'none'\n }),\n headerStyle: Object.assign(\n {},\n themes.DEFAULT.headerStyle,\n {\n bgColor: this.parsedOptions.timelineHeaderBackgroundColor\n },\n this.options.taskListTable.headerStyle\n ),\n cellInnerBorder: false,\n frameStyle: Object.assign({}, this.parsedOptions.frameStyle, {\n cornerRadius: this.parsedOptions.frameStyle.cornerRadius, //[this.parsedOptions.frameStyle.cornerRadius, 0, 0, this.parsedOptions.frameStyle.cornerRadius],\n borderLineWidth: [\n this.parsedOptions.frameStyle.borderLineWidth,\n 0,\n this.parsedOptions.frameStyle.borderLineWidth,\n this.parsedOptions.frameStyle.borderLineWidth\n ]\n }),\n bodyStyle: Object.assign({}, themes.DEFAULT.bodyStyle, this.options.taskListTable.bodyStyle)\n };\n listTable_options.canvasWidth = this.taskTableWidth as number;\n listTable_options.canvasHeight = this.canvasHeight ?? this.canvas.height;\n listTable_options.defaultHeaderRowHeight = this.getAllHeaderRowsHeight();\n listTable_options.defaultRowHeight = this.parsedOptions.rowHeight;\n listTable_options.clearDOM = false;\n return listTable_options;\n }\n _createResizeLine() {\n if (this.taskListTableInstance && this.options.taskListTable.width !== 'auto') {\n this.resizeLine = document.createElement('div');\n this.resizeLine.style.position = 'absolute';\n this.resizeLine.style.top = this.tableY + 'px';\n this.resizeLine.style.left = this.taskTableWidth ? `${this.taskTableWidth - 7}px` : '0px';\n this.resizeLine.style.width = '14px';\n this.resizeLine.style.height = this.drawHeight + 'px'; //'100%';\n this.resizeLine.style.backgroundColor = 'rgba(0,0,0,0)';\n this.resizeLine.style.zIndex = '100';\n this.resizeLine.style.cursor = 'col-resize';\n this.resizeLine.style.userSelect = 'none';\n this.resizeLine.style.opacity = '1';\n\n const highlightLine = document.createElement('div');\n highlightLine.style.position = 'absolute';\n highlightLine.style.top = '0px';\n highlightLine.style.left = '5px';\n highlightLine.style.width = this.parsedOptions.resizeLineStyle.lineWidth + 'px';\n highlightLine.style.height = '100%';\n highlightLine.style.backgroundColor = this.parsedOptions.resizeLineStyle.lineColor;\n highlightLine.style.zIndex = '100';\n highlightLine.style.cursor = 'col-resize';\n highlightLine.style.userSelect = 'none';\n highlightLine.style.pointerEvents = 'none';\n highlightLine.style.opacity = '0';\n highlightLine.style.transition = 'background-color 0.3s';\n this.resizeLine.appendChild(highlightLine);\n // 添加鼠标悬停时的高亮效果\n this.resizeLine.addEventListener('mouseover', () => {\n // highlightLine.style.backgroundColor = '#ffcc00';\n highlightLine.style.opacity = '1';\n });\n\n // 添加鼠标移出时恢复初始样式\n this.resizeLine.addEventListener('mouseout', () => {\n // highlightLine.style.backgroundColor = '#e1e4e8';\n highlightLine.style.opacity = '0';\n });\n (this.container as HTMLElement).appendChild(this.resizeLine);\n }\n }\n /**\n * 获取表格创建的DOM根节点\n */\n getElement(): HTMLElement {\n return this.element;\n }\n\n /**\n * 获取创建gantt传入的容器\n */\n getContainer(): HTMLElement {\n return this.element.parentElement;\n }\n\n _sortScales() {\n const { timelineHeader } = this.options;\n if (timelineHeader) {\n const timelineScales = timelineHeader.scales;\n const sortOrder = ['year', 'quarter', 'month', 'week', 'day'];\n const orderedScales = timelineScales.slice().sort((a, b) => {\n const indexA = sortOrder.indexOf(a.unit);\n const indexB = sortOrder.indexOf(b.unit);\n if (indexA === -1) {\n return 1;\n } else if (indexB === -1) {\n return -1;\n }\n return indexA - indexB;\n });\n const reverseOrderedScales = timelineScales.slice().sort((a, b) => {\n const indexA = sortOrder.indexOf(a.unit);\n const indexB = sortOrder.indexOf(b.unit);\n if (indexA === -1) {\n return 1;\n } else if (indexB === -1) {\n return -1;\n }\n return indexB - indexA;\n });\n\n this.sortedTimelineScales = orderedScales;\n this.reverseSortedTimelineScales = reverseOrderedScales;\n }\n }\n\n _generateTimeLineDateMap() {\n const startDate = new Date(this.parsedOptions.minDate);\n const endDate = new Date(this.parsedOptions.maxDate);\n let colWidthIncludeDays = 1000000;\n // Iterate over each scale\n for (const scale of this.reverseSortedTimelineScales) {\n // Generate the sub-columns for each step within the scale\n const currentDate = new Date(startDate);\n // const timelineDates: any[] = [];\n scale.timelineDates = generateTimeLineDate(currentDate, endDate, scale);\n }\n\n const firstScale = this.reverseSortedTimelineScales[0];\n const { unit, step } = firstScale;\n if (unit === 'day') {\n colWidthIncludeDays = step;\n } else if (unit === 'month') {\n colWidthIncludeDays = 30;\n } else if (unit === 'week') {\n colWidthIncludeDays = 7;\n } else if (unit === 'quarter') {\n colWidthIncludeDays = 90;\n } else if (unit === 'year') {\n colWidthIncludeDays = 365;\n }\n this.parsedOptions.colWidthPerDay = this.parsedOptions.timelineColWidth / colWidthIncludeDays;\n }\n getAllRowsHeight() {\n return this.getAllHeaderRowsHeight() + this.itemCount * this.parsedOptions.rowHeight;\n }\n getAllHeaderRowsHeight() {\n if (Array.isArray(this.parsedOptions.headerRowHeight)) {\n return this.parsedOptions.headerRowHeight.reduce((acc, curr, index) => {\n return acc + curr;\n }, 0);\n }\n return (this.parsedOptions.headerRowHeight as number) * this.headerLevel;\n }\n getAllColsWidth() {\n return (\n this.parsedOptions.colWidthPerDay *\n (Math.ceil(\n Math.abs(new Date(this.parsedOptions.maxDate).getTime() - new Date(this.parsedOptions.minDate).getTime()) /\n (1000 * 60 * 60 * 24)\n ) +\n 1)\n );\n }\n\n getAllGridHeight() {\n return this.itemCount * this.parsedOptions.rowHeight;\n }\n\n getRecordByIndex(index: number) {\n if (this.taskListTableInstance) {\n return this.taskListTableInstance.getRecordByRowCol(0, index + this.taskListTableInstance.columnHeaderLevelCount);\n }\n return this.records[index];\n }\n\n redrawRecord(index: number) {\n // this.listTableInstance.updateRecords([record], [index]);\n this.scenegraph.taskBar.updateTaskBarNode(index);\n this.scenegraph.updateNextFrame();\n }\n updateRecordToListTable(record: any, index: number) {\n this.taskListTableInstance.updateRecords([record], [index]);\n }\n getTaskInfoByTaskListIndex(index: number) {\n const taskRecord = this.getRecordByIndex(index);\n const startDateField = this.parsedOptions.startDateField;\n const endDateField = this.parsedOptions.endDateField;\n const progressField = this.parsedOptions.progressField;\n const rawDateStartDateTime = new Date(taskRecord[startDateField]).getTime();\n const rawDateEndDateTime = new Date(taskRecord[endDateField]).getTime();\n if (\n rawDateEndDateTime < this.parsedOptions._minDateTime ||\n rawDateStartDateTime > this.parsedOptions._maxDateTime\n ) {\n return {\n taskDays: 0\n };\n }\n const startDate = new Date(\n Math.min(Math.max(this.parsedOptions._minDateTime, rawDateStartDateTime), this.parsedOptions._maxDateTime)\n );\n const endDate = new Date(\n Math.max(Math.min(this.parsedOptions._maxDateTime, rawDateEndDateTime), this.parsedOptions._minDateTime)\n );\n const progress = taskRecord[progressField];\n const taskDays = Math.ceil(Math.abs(endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24)) + 1;\n return {\n taskRecord,\n taskDays,\n startDate,\n endDate,\n progress\n };\n }\n\n updateDateToTaskRecord(updateDateType: 'move' | 'start-move' | 'end-move', days: number, index: number) {\n const taskRecord = this.getRecordByIndex(index);\n const startDateField = this.parsedOptions.startDateField;\n const endDateField = this.parsedOptions.endDateField;\n const dateFormat = parseDateFormat(taskRecord[startDateField]);\n const startDate = new Date(taskRecord[startDateField]);\n const endDate = new Date(taskRecord[endDateField]);\n if (updateDateType === 'move') {\n const newStartDate = formatDate(new Date(days * DayTimes + startDate.getTime()), dateFormat);\n const newEndDate = formatDate(new Date(days * DayTimes + endDate.getTime()), dateFormat);\n taskRecord[startDateField] = newStartDate;\n taskRecord[endDateField] = newEndDate;\n } else if (updateDateType === 'start-move') {\n const newStartDate = formatDate(new Date(days * DayTimes + startDate.getTime()), dateFormat);\n taskRecord[startDateField] = newStartDate;\n } else if (updateDateType === 'end-move') {\n const newEndDate = formatDate(new Date(days * DayTimes + endDate.getTime()), dateFormat);\n taskRecord[endDateField] = newEndDate;\n }\n this.updateRecordToListTable(taskRecord, index);\n }\n updateTaskRecord(index: number) {\n const taskRecord = this.getRecordByIndex(index);\n this.updateRecordToListTable(taskRecord, index);\n }\n\n /**\n * 设置像数比\n * @param pixelRatio\n */\n setPixelRatio(pixelRatio: number) {\n this.parsedOptions.pixelRatio = pixelRatio;\n this.scenegraph.setPixelRatio(pixelRatio);\n }\n\n _resize() {\n this._updateSize();\n this.taskListTableInstance.setCanvasSize(\n this.taskTableWidth,\n this.tableNoFrameHeight + this.parsedOptions.frameStyle.borderLineWidth * 2\n );\n this._syncPropsFromTable();\n this.scenegraph.resize();\n }\n _syncPropsFromTable() {\n this.itemCount = this.taskListTableInstance\n ? this.taskListTableInstance.rowCount - this.taskListTableInstance.columnHeaderLevelCount\n : this.records.length;\n this.headerHeight = this.getAllHeaderRowsHeight();\n this.drawHeight = Math.min(\n this.headerHeight + this.parsedOptions.rowHeight * this.itemCount,\n this.tableNoFrameHeight\n );\n this.gridHeight = this.drawHeight - this.headerHeight;\n }\n /** 获取绘制画布的canvas上下文 */\n getContext(): CanvasRenderingContext2D {\n return this.context;\n }\n\n release(): void {\n super.release?.();\n this.eventManager.release();\n this.taskListTableInstance?.release();\n const { parentElement } = this.element;\n if (parentElement) {\n parentElement.removeChild(this.element);\n }\n this.scenegraph = null;\n }\n setRecords(records: any[]) {\n this.records = records;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/Gantt.ts"],"names":[],"mappings":";;;AAEA,wDAAqD;AACrD,+BAA4B;AAkB5B,6CAAqD;AACrD,yDAAqD;AACrD,yDAAqD;AACrD,iDAMwB;AACxB,qDAAkD;AAClD,uCAAsF;AACtF,kDAA+C;AAE/C,SAAgB,iBAAiB,CAAC,OAAY,EAAE,YAAoB,cAAc;;IAChF,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IACtC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACjC,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;IAC/B,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,KAAK,MAAM,OAAO,CAAC,MAAM,MAAM,OAAO,CAAC,IAAI,IAAI,CAAC;IAEnG,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC,WAAW,KAAI,MAAA,OAAO,CAAC,aAAa,0CAAE,WAAW,CAAA,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACnF,MAAM,MAAM,GAAG,CAAC,OAAO,CAAC,YAAY,KAAI,MAAA,OAAO,C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,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACtD,IAAI,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC;QACzC,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,gBAAgB,CAAC;QACvD,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC;QACpD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAC5B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF;AAriBD,sBAqiBC","file":"Gantt.js","sourcesContent":["// import themes from './themes';\n// import { createRootElement } from './core/tableHelper';\nimport { Scenegraph } from './scenegraph/scenegraph';\nimport { Env } from './env';\nimport type {\n ITaskBarStyle,\n GanttConstructorOptions,\n IGridStyle,\n ITimelineHeaderStyle,\n IMarkLine,\n ITaskBarLabelText,\n ITaskBarLabelTextStyle,\n IScrollStyle,\n IFrameStyle,\n ITableColumnsDefine,\n ITaskBarCustomLayout,\n ITimelineDateInfo,\n ITimelineScale,\n ILineStyle\n} from './ts-types';\nimport type { ListTableConstructorOptions, TYPES } from '@visactor/vtable';\nimport { ListTable, themes } from '@visactor/vtable';\nimport { EventManager } from './event/event-manager';\nimport { StateManager } from './state/state-manager';\nimport {\n DayTimes,\n generateTimeLineDate,\n getHorizontalScrollBarSize,\n getVerticalScrollBarSize,\n initOptions\n} from './gantt-helper';\nimport { EventTarget } from './event/EventTarget';\nimport { formatDate, getWeekNumber, parseDateFormat, toBoxArray } from './tools/util';\nimport { DataSource } from './data/DataSource';\n// import { generateGanttChartColumns } from './gantt-helper';\nexport function createRootElement(padding: any, className: string = 'vtable-gantt'): HTMLElement {\n const element = document.createElement('div');\n element.setAttribute('tabindex', '0');\n element.classList.add(className);\n element.style.outline = 'none';\n element.style.margin = `${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px`;\n\n const width = (element.offsetWidth || element.parentElement?.offsetWidth || 1) - 1;\n const height = (element.offsetHeight || element.parentElement?.offsetHeight || 1) - 1;\n\n element.style.width = (width && `${width - padding.left - padding.right}px`) || '0px';\n element.style.height = (height && `${height - padding.top - padding.bottom}px`) || '0px';\n\n return element;\n}\nexport class Gantt extends EventTarget {\n options: GanttConstructorOptions;\n container: HTMLElement;\n canvasWidth?: number;\n canvasHeight?: number;\n tableNoFrameWidth: number;\n tableNoFrameHeight: number;\n tableX: number;\n tableY: number;\n scenegraph: Scenegraph;\n stateManager: StateManager;\n eventManager: EventManager;\n\n taskListTableInstance?: ListTable;\n\n canvas: HTMLCanvasElement;\n element: HTMLElement;\n resizeLine: HTMLDivElement;\n horizontalSplitLine: HTMLDivElement;\n context: CanvasRenderingContext2D;\n\n sortedTimelineScales: (ITimelineScale & { timelineDates?: ITimelineDateInfo[] })[];\n reverseSortedTimelineScales: (ITimelineScale & { timelineDates?: ITimelineDateInfo[] })[];\n headerLevel: number;\n itemCount: number;\n drawHeight: number;\n headerHeight: number;\n gridHeight: number;\n\n parsedOptions: {\n headerRowHeight: number | number[];\n rowHeight: number;\n timelineColWidth: number;\n colWidthPerDay: number; //分配给每日的宽度\n\n scrollStyle: IScrollStyle;\n // timelineHeaderStyle: ITimelineHeaderStyle;\n timelineHeaderVerticalLineStyle: ILineStyle;\n timelineHeaderHorizontalLineStyle: ILineStyle;\n timelineHeaderBackgroundColor: string;\n timelineHeaderStyles: ITimelineHeaderStyle[];\n gridStyle: IGridStyle;\n taskBarStyle: ITaskBarStyle;\n taskBarHoverStyle: ITaskBarStyle & { barOverLayColor?: string };\n taskBarSelectionStyle: ITaskBarStyle & { barOverLayColor?: string };\n taskBarLabelText: ITaskBarLabelText;\n taskBarMoveable: boolean;\n taskBarResizable: boolean;\n taskBarLabelStyle: ITaskBarLabelTextStyle;\n taskBarCustomLayout: ITaskBarCustomLayout;\n outerFrameStyle: IFrameStyle;\n pixelRatio: number;\n\n startDateField: string;\n endDateField: string;\n progressField: string;\n minDate: Date;\n maxDate: Date;\n _minDateTime: number;\n _maxDateTime: number;\n markLine: IMarkLine[];\n horizontalSplitLine: ILineStyle;\n verticalSplitLine: ILineStyle;\n verticalSplitLineHighlight: ILineStyle;\n verticalSplitLineMoveable?: boolean;\n overscrollBehavior: 'auto' | 'none';\n } = {} as any;\n\n taskTableWidth: number;\n taskTableColumns: ITableColumnsDefine;\n\n records: any[];\n data: DataSource;\n constructor(container: HTMLElement, options?: GanttConstructorOptions) {\n super();\n this.container = container;\n this.options = options;\n\n this.taskTableWidth = typeof options?.taskListTable?.width === 'number' ? options?.taskListTable?.width : 100;\n this.taskTableColumns = options?.taskListTable?.columns ?? [];\n this.records = options?.records ?? [];\n\n initOptions(this);\n this.data = new DataSource(this);\n this._sortScales();\n this._generateTimeLineDateMap();\n this.headerLevel = this.sortedTimelineScales.length;\n this.element = createRootElement({ top: 0, right: 0, left: 0, bottom: 0 }, 'vtable-gantt');\n // this.element.style.top = '0px';\n this.element.style.left = this.taskTableWidth ? `${this.taskTableWidth}px` : '0px';\n\n this.canvas = document.createElement('canvas');\n this.element.appendChild(this.canvas);\n this.context = this.canvas.getContext('2d')!;\n if (container) {\n (container as HTMLElement).appendChild(this.element);\n this._updateSize();\n } else {\n this._updateSize();\n }\n this._generateListTable();\n this._syncPropsFromTable();\n\n this._createSplitLineAndResizeLine();\n this.scenegraph = new Scenegraph(this);\n this.stateManager = new StateManager(this);\n this.eventManager = new EventManager(this);\n\n this.scenegraph.afterCreateSceneGraph();\n }\n\n renderTaskTable() {\n this.scenegraph.updateNextFrame();\n }\n /**\n * 窗口尺寸发生变化 或者像数比变化\n * @return {void}\n */\n _updateSize(): void {\n let widthP = 0;\n let heightP = 0;\n\n if (Env.mode === 'browser') {\n const element = this.getElement();\n let widthWithoutPadding = 0;\n let heightWithoutPadding = 0;\n if (element.parentElement) {\n const computedStyle = element.parentElement.style || window.getComputedStyle(element.parentElement); // 兼容性处理\n widthWithoutPadding =\n element.parentElement.offsetWidth -\n parseInt(computedStyle.paddingLeft || '0px', 10) -\n parseInt(computedStyle.paddingRight || '0px', 10);\n heightWithoutPadding =\n element.parentElement.offsetHeight -\n parseInt(computedStyle.paddingTop || '0px', 10) -\n parseInt(computedStyle.paddingBottom || '0px', 20);\n }\n const width1 = (widthWithoutPadding ?? 1) - 1 - this.taskTableWidth;\n const height1 = (heightWithoutPadding ?? 1) - 1;\n\n element.style.width = (width1 && `${width1}px`) || '0px';\n element.style.height = (height1 && `${height1}px`) || '0px';\n\n const { canvas } = this;\n\n widthP = canvas.parentElement?.offsetWidth ?? 1;\n heightP = canvas.parentElement?.offsetHeight ?? 1;\n\n //style 与 width,height相同\n if (this?.scenegraph?.stage) {\n this.scenegraph.stage.resize(widthP, heightP);\n } else {\n canvas.style.width = '';\n canvas.style.height = '';\n canvas.width = widthP;\n canvas.height = heightP;\n\n canvas.style.width = `${widthP}px`;\n canvas.style.height = `${heightP}px`;\n }\n } else if (Env.mode === 'node') {\n widthP = this.canvasWidth - 1;\n heightP = this.canvasHeight - 1;\n }\n const width = Math.floor(widthP - getVerticalScrollBarSize(this.parsedOptions.scrollStyle));\n const height = Math.floor(heightP - getHorizontalScrollBarSize(this.parsedOptions.scrollStyle));\n\n this.tableNoFrameWidth = widthP;\n this.tableNoFrameHeight = Math.floor(heightP);\n if (this.parsedOptions.outerFrameStyle) {\n //考虑表格整体边框的问题\n const lineWidth = this.parsedOptions.outerFrameStyle?.borderLineWidth; // toBoxArray(this.parsedOptions.frameStyle?.borderLineWidth ?? [null]);\n this.tableX = lineWidth;\n this.tableY = lineWidth;\n this.tableNoFrameWidth = width - lineWidth;\n\n this.tableNoFrameHeight = height - lineWidth * 2;\n }\n }\n _generateListTable() {\n if (this.taskTableColumns.length >= 1) {\n const listTableOption = this._generateListTableOptions();\n this.taskListTableInstance = new ListTable(this.container, listTableOption);\n\n if (this.options?.taskListTable?.width === 'auto') {\n this.taskTableWidth = this.taskListTableInstance.getAllColsWidth() + this.taskListTableInstance.tableX * 2;\n if (this.options?.taskListTable?.maxWidth) {\n this.taskTableWidth = Math.min(this.options?.taskListTable?.maxWidth, this.taskTableWidth);\n }\n if (this.options?.taskListTable?.minWidth) {\n this.taskTableWidth = Math.max(this.options?.taskListTable?.minWidth, this.taskTableWidth);\n }\n this.element.style.left = this.taskTableWidth ? `${this.taskTableWidth}px` : '0px';\n this.taskListTableInstance.setCanvasSize(\n this.taskTableWidth,\n this.tableNoFrameHeight + this.parsedOptions.outerFrameStyle.borderLineWidth * 2\n );\n this._updateSize();\n }\n\n if (this.taskListTableInstance.columnHeaderLevelCount > 1) {\n if (\n Array.isArray(this.parsedOptions.headerRowHeight) &&\n this.taskListTableInstance.columnHeaderLevelCount === this.parsedOptions.headerRowHeight.length\n ) {\n for (let i = 0; i < this.taskListTableInstance.columnHeaderLevelCount; i++) {\n this.taskListTableInstance.setRowHeight(i, this.parsedOptions.headerRowHeight[i]);\n }\n } else {\n const newRowHeight = this.getAllHeaderRowsHeight() / this.taskListTableInstance.columnHeaderLevelCount;\n for (let i = 0; i < this.taskListTableInstance.columnHeaderLevelCount; i++) {\n this.taskListTableInstance.setRowHeight(i, newRowHeight);\n }\n }\n }\n }\n }\n _generateListTableOptions() {\n const listTable_options: ListTableConstructorOptions = {};\n const needPutInListTableKeys = ['container', 'records', 'pixelRatio', 'overscrollBehavior', 'pixelRatio'];\n for (const key in this.options) {\n if (needPutInListTableKeys.indexOf(key) >= 0) {\n listTable_options[key] = this.options[key];\n }\n }\n for (const key in this.options.taskListTable) {\n listTable_options[key] = this.options.taskListTable[key];\n if (key === 'columns') {\n listTable_options[key][listTable_options[key].length - 1].disableColumnResize = true;\n }\n }\n // lineWidthArr[1] = 0;\n listTable_options.theme = {\n scrollStyle: Object.assign({}, this.parsedOptions.scrollStyle, {\n verticalVisible: 'none'\n }),\n headerStyle: Object.assign(\n {},\n themes.DEFAULT.headerStyle,\n {\n bgColor: this.parsedOptions.timelineHeaderBackgroundColor\n },\n this.options.taskListTable.headerStyle\n ),\n cellInnerBorder: false,\n frameStyle: Object.assign({}, this.parsedOptions.outerFrameStyle, {\n cornerRadius: this.parsedOptions.outerFrameStyle.cornerRadius, //[this.parsedOptions.frameStyle.cornerRadius, 0, 0, this.parsedOptions.frameStyle.cornerRadius],\n borderLineWidth: [\n this.parsedOptions.outerFrameStyle.borderLineWidth,\n 0,\n this.parsedOptions.outerFrameStyle.borderLineWidth,\n this.parsedOptions.outerFrameStyle.borderLineWidth\n ]\n }),\n bodyStyle: Object.assign({}, themes.DEFAULT.bodyStyle, this.options.taskListTable.bodyStyle)\n } as ListTableConstructorOptions.theme;\n listTable_options.canvasWidth = this.taskTableWidth as number;\n listTable_options.canvasHeight = this.canvasHeight ?? this.canvas.height;\n listTable_options.defaultHeaderRowHeight = this.getAllHeaderRowsHeight();\n listTable_options.defaultRowHeight = this.parsedOptions.rowHeight;\n listTable_options.clearDOM = false;\n return listTable_options;\n }\n _createSplitLineAndResizeLine() {\n if (this.parsedOptions.horizontalSplitLine) {\n this.horizontalSplitLine = document.createElement('div');\n this.horizontalSplitLine.style.position = 'absolute';\n this.horizontalSplitLine.style.top = this.getAllHeaderRowsHeight() + 'px';\n this.horizontalSplitLine.style.left = this.tableY + 'px';\n this.horizontalSplitLine.style.height = (this.parsedOptions.horizontalSplitLine.lineWidth ?? 2) + 'px';\n this.horizontalSplitLine.style.width = this.tableNoFrameHeight + this.taskTableWidth + 'px'; //'100%';\n this.horizontalSplitLine.style.backgroundColor = this.parsedOptions.horizontalSplitLine.lineColor;\n this.horizontalSplitLine.style.zIndex = '100';\n this.horizontalSplitLine.style.userSelect = 'none';\n this.horizontalSplitLine.style.opacity = '1';\n (this.container as HTMLElement).appendChild(this.horizontalSplitLine);\n }\n if (this.taskListTableInstance) {\n this.resizeLine = document.createElement('div');\n this.resizeLine.style.position = 'absolute';\n this.resizeLine.style.top = this.tableY + 'px';\n this.resizeLine.style.left = this.taskTableWidth ? `${this.taskTableWidth - 7}px` : '0px';\n this.resizeLine.style.width = '14px';\n this.resizeLine.style.height = this.drawHeight + 'px'; //'100%';\n this.resizeLine.style.backgroundColor = 'rgba(0,0,0,0)';\n this.resizeLine.style.zIndex = '100';\n this.parsedOptions.verticalSplitLineMoveable && (this.resizeLine.style.cursor = 'col-resize');\n this.resizeLine.style.userSelect = 'none';\n this.resizeLine.style.opacity = '1';\n\n const verticalSplitLine = document.createElement('div');\n verticalSplitLine.style.position = 'absolute';\n verticalSplitLine.style.top = '0px';\n verticalSplitLine.style.left = `${(14 - this.parsedOptions.verticalSplitLine.lineWidth) / 2}px`;\n verticalSplitLine.style.width = this.parsedOptions.verticalSplitLine.lineWidth + 'px';\n verticalSplitLine.style.height = '100%';\n verticalSplitLine.style.backgroundColor = this.parsedOptions.verticalSplitLine.lineColor;\n verticalSplitLine.style.zIndex = '100';\n verticalSplitLine.style.userSelect = 'none';\n verticalSplitLine.style.pointerEvents = 'none';\n // verticalSplitLine.style.opacity = '0';\n verticalSplitLine.style.transition = 'background-color 0.3s';\n this.resizeLine.appendChild(verticalSplitLine);\n\n if (this.parsedOptions.verticalSplitLineHighlight) {\n const highlightLine = document.createElement('div');\n highlightLine.style.position = 'absolute';\n highlightLine.style.top = '0px';\n highlightLine.style.left = `${(14 - this.parsedOptions.verticalSplitLineHighlight.lineWidth ?? 2) / 2}px`;\n highlightLine.style.width = (this.parsedOptions.verticalSplitLineHighlight.lineWidth ?? 2) + 'px';\n highlightLine.style.height = '100%';\n highlightLine.style.backgroundColor = this.parsedOptions.verticalSplitLineHighlight.lineColor;\n highlightLine.style.zIndex = '100';\n highlightLine.style.cursor = 'col-resize';\n highlightLine.style.userSelect = 'none';\n highlightLine.style.pointerEvents = 'none';\n highlightLine.style.opacity = '0';\n highlightLine.style.transition = 'background-color 0.3s';\n this.resizeLine.appendChild(highlightLine);\n }\n (this.container as HTMLElement).appendChild(this.resizeLine);\n }\n }\n /**\n * 获取表格创建的DOM根节点\n */\n getElement(): HTMLElement {\n return this.element;\n }\n\n /**\n * 获取创建gantt传入的容器\n */\n getContainer(): HTMLElement {\n return this.element.parentElement;\n }\n\n _sortScales() {\n const { timelineHeader } = this.options;\n if (timelineHeader) {\n const timelineScales = timelineHeader.scales;\n const sortOrder = ['year', 'quarter', 'month', 'week', 'day'];\n const orderedScales = timelineScales.slice().sort((a, b) => {\n const indexA = sortOrder.indexOf(a.unit);\n const indexB = sortOrder.indexOf(b.unit);\n if (indexA === -1) {\n return 1;\n } else if (indexB === -1) {\n return -1;\n }\n return indexA - indexB;\n });\n const reverseOrderedScales = timelineScales.slice().sort((a, b) => {\n const indexA = sortOrder.indexOf(a.unit);\n const indexB = sortOrder.indexOf(b.unit);\n if (indexA === -1) {\n return 1;\n } else if (indexB === -1) {\n return -1;\n }\n return indexB - indexA;\n });\n\n this.sortedTimelineScales = orderedScales;\n this.reverseSortedTimelineScales = reverseOrderedScales;\n }\n }\n\n _generateTimeLineDateMap() {\n const startDate = new Date(this.parsedOptions.minDate);\n const endDate = new Date(this.parsedOptions.maxDate);\n let colWidthIncludeDays = 1000000;\n // Iterate over each scale\n for (const scale of this.reverseSortedTimelineScales) {\n // Generate the sub-columns for each step within the scale\n const currentDate = new Date(startDate);\n // const timelineDates: any[] = [];\n scale.timelineDates = generateTimeLineDate(currentDate, endDate, scale);\n }\n\n const firstScale = this.reverseSortedTimelineScales[0];\n const { unit, step } = firstScale;\n if (unit === 'day') {\n colWidthIncludeDays = step;\n } else if (unit === 'month') {\n colWidthIncludeDays = 30;\n } else if (unit === 'week') {\n colWidthIncludeDays = 7;\n } else if (unit === 'quarter') {\n colWidthIncludeDays = 90;\n } else if (unit === 'year') {\n colWidthIncludeDays = 365;\n }\n this.parsedOptions.colWidthPerDay = this.parsedOptions.timelineColWidth / colWidthIncludeDays;\n }\n getAllRowsHeight() {\n return this.getAllHeaderRowsHeight() + this.itemCount * this.parsedOptions.rowHeight;\n }\n getAllHeaderRowsHeight() {\n if (Array.isArray(this.parsedOptions.headerRowHeight)) {\n return this.parsedOptions.headerRowHeight.reduce((acc, curr, index) => {\n return acc + curr;\n }, 0);\n }\n return (this.parsedOptions.headerRowHeight as number) * this.headerLevel;\n }\n getAllColsWidth() {\n return (\n this.parsedOptions.colWidthPerDay *\n (Math.ceil(\n Math.abs(new Date(this.parsedOptions.maxDate).getTime() - new Date(this.parsedOptions.minDate).getTime()) /\n (1000 * 60 * 60 * 24)\n ) +\n 1)\n );\n }\n\n getAllGridHeight() {\n return this.itemCount * this.parsedOptions.rowHeight;\n }\n\n getRecordByIndex(index: number) {\n if (this.taskListTableInstance) {\n return this.taskListTableInstance.getRecordByRowCol(0, index + this.taskListTableInstance.columnHeaderLevelCount);\n }\n return this.records[index];\n }\n\n redrawRecord(index: number) {\n // this.listTableInstance.updateRecords([record], [index]);\n this.scenegraph.taskBar.updateTaskBarNode(index);\n this.scenegraph.updateNextFrame();\n }\n updateRecordToListTable(record: any, index: number) {\n this.taskListTableInstance.updateRecords([record], [index]);\n }\n getTaskInfoByTaskListIndex(index: number) {\n const taskRecord = this.getRecordByIndex(index);\n const startDateField = this.parsedOptions.startDateField;\n const endDateField = this.parsedOptions.endDateField;\n const progressField = this.parsedOptions.progressField;\n const rawDateStartDateTime = new Date(taskRecord[startDateField]).getTime();\n const rawDateEndDateTime = new Date(taskRecord[endDateField]).getTime();\n if (\n rawDateEndDateTime < this.parsedOptions._minDateTime ||\n rawDateStartDateTime > this.parsedOptions._maxDateTime\n ) {\n return {\n taskDays: 0\n };\n }\n const startDate = new Date(\n Math.min(Math.max(this.parsedOptions._minDateTime, rawDateStartDateTime), this.parsedOptions._maxDateTime)\n );\n const endDate = new Date(\n Math.max(Math.min(this.parsedOptions._maxDateTime, rawDateEndDateTime), this.parsedOptions._minDateTime)\n );\n const progress = taskRecord[progressField];\n const taskDays = Math.ceil(Math.abs(endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24)) + 1;\n return {\n taskRecord,\n taskDays,\n startDate,\n endDate,\n progress\n };\n }\n\n _updateDateToTaskRecord(updateDateType: 'move' | 'start-move' | 'end-move', days: number, index: number) {\n const taskRecord = this.getRecordByIndex(index);\n const startDateField = this.parsedOptions.startDateField;\n const endDateField = this.parsedOptions.endDateField;\n const dateFormat = parseDateFormat(taskRecord[startDateField]);\n const startDate = new Date(taskRecord[startDateField]);\n const endDate = new Date(taskRecord[endDateField]);\n if (updateDateType === 'move') {\n const newStartDate = formatDate(new Date(days * DayTimes + startDate.getTime()), dateFormat);\n const newEndDate = formatDate(new Date(days * DayTimes + endDate.getTime()), dateFormat);\n taskRecord[startDateField] = newStartDate;\n taskRecord[endDateField] = newEndDate;\n } else if (updateDateType === 'start-move') {\n const newStartDate = formatDate(new Date(days * DayTimes + startDate.getTime()), dateFormat);\n taskRecord[startDateField] = newStartDate;\n } else if (updateDateType === 'end-move') {\n const newEndDate = formatDate(new Date(days * DayTimes + endDate.getTime()), dateFormat);\n taskRecord[endDateField] = newEndDate;\n }\n this.updateRecordToListTable(taskRecord, index);\n }\n updateTaskRecord(index: number, record: any) {\n //const taskRecord = this.getRecordByIndex(index);\n this.updateRecordToListTable(record, index);\n }\n\n /**\n * 设置像数比\n * @param pixelRatio\n */\n setPixelRatio(pixelRatio: number) {\n this.parsedOptions.pixelRatio = pixelRatio;\n this.scenegraph.setPixelRatio(pixelRatio);\n }\n\n _resize() {\n this._updateSize();\n this.taskListTableInstance.setCanvasSize(\n this.taskTableWidth,\n this.tableNoFrameHeight + this.parsedOptions.outerFrameStyle.borderLineWidth * 2\n );\n this._syncPropsFromTable();\n this.scenegraph.resize();\n }\n _syncPropsFromTable() {\n this.itemCount = this.taskListTableInstance\n ? this.taskListTableInstance.rowCount - this.taskListTableInstance.columnHeaderLevelCount\n : this.records.length;\n this.headerHeight = this.getAllHeaderRowsHeight();\n this.drawHeight = Math.min(\n this.headerHeight + this.parsedOptions.rowHeight * this.itemCount,\n this.tableNoFrameHeight\n );\n this.gridHeight = this.drawHeight - this.headerHeight;\n }\n /** 获取绘制画布的canvas上下文 */\n getContext(): CanvasRenderingContext2D {\n return this.context;\n }\n\n release(): void {\n super.release?.();\n this.eventManager.release();\n this.taskListTableInstance?.release();\n const { parentElement } = this.element;\n if (parentElement) {\n parentElement.removeChild(this.element);\n }\n this.scenegraph = null;\n }\n setRecords(records: any[]) {\n this.records = records;\n this.taskListTableInstance.setRecords(records);\n this._syncPropsFromTable();\n this.resizeLine.style.height = this.drawHeight + 'px'; //'100%';\n this.scenegraph.refreshTaskBarsAndGrid();\n const left = this.stateManager.scroll.horizontalBarPos;\n const top = this.stateManager.scroll.verticalBarPos;\n this.scenegraph.setX(-left);\n this.scenegraph.setY(-top);\n }\n}\n"]}
|
|
@@ -49,9 +49,13 @@ function bindContainerDomListener(eventManager) {
|
|
|
49
49
|
})), handler.on(gantt.getContainer(), "resize", (e => {
|
|
50
50
|
0 === e.width && 0 === e.height || ((0, vutils_1.isValid)(gantt.options.pixelRatio) || gantt.setPixelRatio((0,
|
|
51
51
|
pixel_ratio_1.getPixelRatio)()), e.windowSizeNotChange || gantt._resize());
|
|
52
|
-
})), handler.on(gantt.resizeLine, "mousedown", (e => {
|
|
52
|
+
})), gantt.parsedOptions.verticalSplitLineMoveable && (handler.on(gantt.resizeLine, "mousedown", (e => {
|
|
53
53
|
stateManager.updateInteractionState(ts_types_1.InteractionState.grabing), stateManager.startResizeTableWidth(e);
|
|
54
|
-
})),
|
|
54
|
+
})), handler.on(gantt.resizeLine, "mouseover", (e => {
|
|
55
|
+
gantt.resizeLine.childNodes[1].style.opacity = "1";
|
|
56
|
+
})), handler.on(gantt.resizeLine, "mouseout", (e => {
|
|
57
|
+
gantt.resizeLine.childNodes[1].style.opacity = "0";
|
|
58
|
+
}))), vtable_1.VRender.vglobal.addEventListener("mousedown", (e => {
|
|
55
59
|
gantt.eventManager.lastDragPointerXYOnWindow = {
|
|
56
60
|
x: e.x,
|
|
57
61
|
y: e.y
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/event/event-man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yBAAyB,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACnE;SACF;IACH,CAAC,CAAC,CAAC;IACH,gBAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAa,EAAE,EAAE;QAC5D,IAAI,YAAY,CAAC,gBAAgB,KAAK,SAAS,EAAE;YAC/C,YAAY,CAAC,sBAAsB,CAAC,2BAAgB,CAAC,OAAO,CAAC,CAAC;YAC9D,IAAI,YAAY,CAAC,oBAAoB,EAAE,EAAE;gBACvC,YAAY,CAAC,mBAAmB,EAAE,CAAC;aACpC;iBAAM,IAAI,YAAY,CAAC,gBAAgB,EAAE,EAAE;gBAC1C,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAClC;iBAAM,IAAI,YAAY,CAAC,iBAAiB,EAAE,EAAE;gBAC3C,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACpC;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC","file":"event-manager.js","sourcesContent":["import { VRender } from '@visactor/vtable';\nimport type { Gantt } from '../Gantt';\nimport { EventHandler } from '../event/EventHandler';\nimport { handleWhell } from '../event/scroll';\nimport { throttle } from '../tools/util';\nimport { InteractionState } from '../ts-types';\nimport { isValid } from '@visactor/vutils';\nimport { getPixelRatio } from '../tools/pixel-ratio';\nimport type { GanttTaskBarNode } from '../scenegraph/ganttNode';\n\nexport class EventManager {\n _gantt: Gantt;\n _eventHandler: EventHandler;\n isDown: boolean = false;\n isDraging: boolean = false;\n lastDragPointerXYOnWindow: { x: number; y: number };\n\n // lastDragPointerXYOnResizeLine: { x: number; y: number };\n constructor(gantt: Gantt) {\n this._gantt = gantt;\n this._eventHandler = new EventHandler();\n this.bindEvent();\n }\n release() {\n this._eventHandler.release();\n }\n // 绑定DOM事件\n bindEvent() {\n bindTableGroupListener(this);\n bindContainerDomListener(this);\n // bindScrollBarListener(this);\n }\n}\nfunction bindTableGroupListener(event: EventManager) {\n const scene = event._gantt.scenegraph;\n const gantt = event._gantt;\n const stateManager = gantt.stateManager;\n scene.tableGroup.addEventListener('pointerdown', (e: VRender.FederatedPointerEvent) => {\n if (e.button !== 0) {\n // 只处理左键\n return;\n }\n const taskBarTarget = e.detailPath.find((pathNode: any) => {\n return pathNode.name === 'task-bar'; // || pathNode.name === 'task-bar-hover-shadow';\n }) as any as GanttTaskBarNode;\n if (taskBarTarget) {\n if (e.target.name === 'task-bar-hover-shadow-left-icon') {\n stateManager.startResizeTaskBar(taskBarTarget, (e.nativeEvent as any).x, (e.nativeEvent as any).y, 'left');\n stateManager.updateInteractionState(InteractionState.grabing);\n } else if (e.target.name === 'task-bar-hover-shadow-right-icon') {\n stateManager.startResizeTaskBar(taskBarTarget, (e.nativeEvent as any).x, (e.nativeEvent as any).y, 'right');\n stateManager.updateInteractionState(InteractionState.grabing);\n } else if (gantt.parsedOptions.taskBarMoveable) {\n stateManager.startMoveTaskBar(taskBarTarget, (e.nativeEvent as any).x, (e.nativeEvent as any).y);\n stateManager.updateInteractionState(InteractionState.grabing);\n }\n }\n });\n\n scene.tableGroup.addEventListener('pointermove', (e: VRender.FederatedPointerEvent) => {\n if (stateManager.interactionState === InteractionState.default) {\n const taksIndex = e.detailPath.find((pathNode: any) => {\n return pathNode.name === 'task-bar'; // || pathNode.name === 'task-bar-hover-shadow';\n });\n if (taksIndex) {\n stateManager.showTaskBarHover(e);\n } else {\n stateManager.hideTaskBarHover();\n }\n }\n });\n // scene.stage.addEventListener('pointerup', (e: FederatedPointerEvent) => {});\n\n scene.tableGroup.addEventListener('pointerenter', (e: VRender.FederatedPointerEvent) => {\n if (\n (gantt.parsedOptions.scrollStyle.horizontalVisible &&\n gantt.parsedOptions.scrollStyle.horizontalVisible === 'focus') ||\n (!gantt.parsedOptions.scrollStyle.horizontalVisible && gantt.parsedOptions.scrollStyle.visible === 'focus')\n ) {\n scene.scrollbarComponent.showHorizontalScrollBar();\n }\n if (\n (gantt.parsedOptions.scrollStyle.verticalVisible &&\n gantt.parsedOptions.scrollStyle.verticalVisible === 'focus') ||\n (!gantt.parsedOptions.scrollStyle.verticalVisible && gantt.parsedOptions.scrollStyle.visible === 'focus')\n ) {\n scene.scrollbarComponent.showVerticalScrollBar();\n }\n });\n\n scene.tableGroup.addEventListener('pointerleave', (e: VRender.FederatedPointerEvent) => {\n if (\n (gantt.parsedOptions.scrollStyle.horizontalVisible &&\n gantt.parsedOptions.scrollStyle.horizontalVisible === 'focus') ||\n (!gantt.parsedOptions.scrollStyle.horizontalVisible && gantt.parsedOptions.scrollStyle.visible === 'focus')\n ) {\n scene.scrollbarComponent.hideHorizontalScrollBar();\n }\n if (\n (gantt.parsedOptions.scrollStyle.verticalVisible &&\n gantt.parsedOptions.scrollStyle.verticalVisible === 'focus') ||\n (!gantt.parsedOptions.scrollStyle.verticalVisible && gantt.parsedOptions.scrollStyle.visible === 'focus')\n ) {\n scene.scrollbarComponent.hideVerticalScrollBar();\n }\n });\n}\n\nfunction bindContainerDomListener(eventManager: EventManager) {\n const gantt = eventManager._gantt;\n const scene = eventManager._gantt.scenegraph;\n const stateManager = gantt.stateManager;\n const handler = eventManager._eventHandler;\n handler.on(gantt.getElement(), 'wheel', (e: WheelEvent) => {\n handleWhell(e, stateManager, eventManager._gantt);\n });\n\n handler.on(gantt.getContainer(), 'resize', (e: any) => {\n // if (table.canvasSizeSeted) {\n // return;\n // }\n if (e.width === 0 && e.height === 0) {\n // 临时绕行解决因为display设置为none产生的问题\n return;\n }\n if (!isValid(gantt.options.pixelRatio)) {\n gantt.setPixelRatio(getPixelRatio());\n }\n if (!e.windowSizeNotChange) {\n gantt._resize();\n }\n });\n\n handler.on(gantt.resizeLine, 'mousedown', (e: MouseEvent) => {\n console.log('mousedown resizeLine');\n stateManager.updateInteractionState(InteractionState.grabing);\n stateManager.startResizeTableWidth(e);\n });\n\n VRender.vglobal.addEventListener('mousedown', (e: VRender.FederatedPointerEvent) => {\n gantt.eventManager.lastDragPointerXYOnWindow = { x: e.x, y: e.y };\n });\n VRender.vglobal.addEventListener('mousemove', (e: VRender.FederatedPointerEvent) => {\n if (stateManager.interactionState === InteractionState.grabing) {\n const lastX = gantt.eventManager.lastDragPointerXYOnWindow?.x ?? e.x;\n const lastY = gantt.eventManager.lastDragPointerXYOnWindow?.y ?? e.y;\n if (Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1) {\n if (stateManager.isResizingTableWidth()) {\n stateManager.dealResizeTableWidth(e);\n } else if (stateManager.isMoveingTaskBar()) {\n stateManager.dealTaskBarMove(e);\n } else if (stateManager.isResizingTaskBar()) {\n stateManager.dealTaskBarResize(e);\n }\n gantt.eventManager.lastDragPointerXYOnWindow = { x: e.x, y: e.y };\n }\n }\n });\n VRender.vglobal.addEventListener('mouseup', (e: MouseEvent) => {\n if (stateManager.interactionState === 'grabing') {\n stateManager.updateInteractionState(InteractionState.default);\n if (stateManager.isResizingTableWidth()) {\n stateManager.endResizeTableWidth();\n } else if (stateManager.isMoveingTaskBar()) {\n stateManager.endMoveTaskBar(e.x);\n } else if (stateManager.isResizingTaskBar()) {\n stateManager.endResizeTaskBar(e.x);\n }\n }\n });\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/event/event-manager.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAE3C,wDAAqD;AACrD,4CAA8C;AAE9C,0CAA+C;AAC/C,6CAA2C;AAC3C,sDAAqD;AAGrD,MAAa,YAAY;IAQvB,YAAY,KAAY;QALxB,WAAM,GAAY,KAAK,CAAC;QACxB,cAAS,GAAY,KAAK,CAAC;QAKzB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,aAAa,GAAG,IAAI,2BAAY,EAAE,CAAC;QACxC,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IACD,OAAO;QACL,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE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e,CAAC,CAAC,CAAC,CAAC;iBACjC;qBAAM,IAAI,YAAY,CAAC,iBAAiB,EAAE,EAAE;oBAC3C,YAAY,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;iBACnC;gBACD,KAAK,CAAC,YAAY,CAAC,yBAAyB,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACnE;SACF;IACH,CAAC,CAAC,CAAC;IACH,gBAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAa,EAAE,EAAE;QAC5D,IAAI,YAAY,CAAC,gBAAgB,KAAK,SAAS,EAAE;YAC/C,YAAY,CAAC,sBAAsB,CAAC,2BAAgB,CAAC,OAAO,CAAC,CAAC;YAC9D,IAAI,YAAY,CAAC,oBAAoB,EAAE,EAAE;gBACvC,YAAY,CAAC,mBAAmB,EAAE,CAAC;aACpC;iBAAM,IAAI,YAAY,CAAC,gBAAgB,EAAE,EAAE;gBAC1C,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAClC;iBAAM,IAAI,YAAY,CAAC,iBAAiB,EAAE,EAAE;gBAC3C,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACpC;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC","file":"event-manager.js","sourcesContent":["import { VRender } from '@visactor/vtable';\nimport type { Gantt } from '../Gantt';\nimport { EventHandler } from '../event/EventHandler';\nimport { handleWhell } from '../event/scroll';\nimport { throttle } from '../tools/util';\nimport { InteractionState } from '../ts-types';\nimport { isValid } from '@visactor/vutils';\nimport { getPixelRatio } from '../tools/pixel-ratio';\nimport type { GanttTaskBarNode } from '../scenegraph/ganttNode';\n\nexport class EventManager {\n _gantt: Gantt;\n _eventHandler: EventHandler;\n isDown: boolean = false;\n isDraging: boolean = false;\n lastDragPointerXYOnWindow: { x: number; y: number };\n\n // lastDragPointerXYOnResizeLine: { x: number; y: number };\n constructor(gantt: Gantt) {\n this._gantt = gantt;\n this._eventHandler = new EventHandler();\n this.bindEvent();\n }\n release() {\n this._eventHandler.release();\n }\n // 绑定DOM事件\n bindEvent() {\n bindTableGroupListener(this);\n bindContainerDomListener(this);\n // bindScrollBarListener(this);\n }\n}\nfunction bindTableGroupListener(event: EventManager) {\n const scene = event._gantt.scenegraph;\n const gantt = event._gantt;\n const stateManager = gantt.stateManager;\n scene.tableGroup.addEventListener('pointerdown', (e: VRender.FederatedPointerEvent) => {\n if (e.button !== 0) {\n // 只处理左键\n return;\n }\n const taskBarTarget = e.detailPath.find((pathNode: any) => {\n return pathNode.name === 'task-bar'; // || pathNode.name === 'task-bar-hover-shadow';\n }) as any as GanttTaskBarNode;\n if (taskBarTarget) {\n if (e.target.name === 'task-bar-hover-shadow-left-icon') {\n stateManager.startResizeTaskBar(taskBarTarget, (e.nativeEvent as any).x, (e.nativeEvent as any).y, 'left');\n stateManager.updateInteractionState(InteractionState.grabing);\n } else if (e.target.name === 'task-bar-hover-shadow-right-icon') {\n stateManager.startResizeTaskBar(taskBarTarget, (e.nativeEvent as any).x, (e.nativeEvent as any).y, 'right');\n stateManager.updateInteractionState(InteractionState.grabing);\n } else if (gantt.parsedOptions.taskBarMoveable) {\n stateManager.startMoveTaskBar(taskBarTarget, (e.nativeEvent as any).x, (e.nativeEvent as any).y);\n stateManager.updateInteractionState(InteractionState.grabing);\n }\n }\n });\n\n scene.tableGroup.addEventListener('pointermove', (e: VRender.FederatedPointerEvent) => {\n if (stateManager.interactionState === InteractionState.default) {\n const taksIndex = e.detailPath.find((pathNode: any) => {\n return pathNode.name === 'task-bar'; // || pathNode.name === 'task-bar-hover-shadow';\n });\n if (taksIndex) {\n stateManager.showTaskBarHover(e);\n } else {\n stateManager.hideTaskBarHover();\n }\n }\n });\n // scene.stage.addEventListener('pointerup', (e: FederatedPointerEvent) => {});\n\n scene.tableGroup.addEventListener('pointerenter', (e: VRender.FederatedPointerEvent) => {\n if (\n (gantt.parsedOptions.scrollStyle.horizontalVisible &&\n gantt.parsedOptions.scrollStyle.horizontalVisible === 'focus') ||\n (!gantt.parsedOptions.scrollStyle.horizontalVisible && gantt.parsedOptions.scrollStyle.visible === 'focus')\n ) {\n scene.scrollbarComponent.showHorizontalScrollBar();\n }\n if (\n (gantt.parsedOptions.scrollStyle.verticalVisible &&\n gantt.parsedOptions.scrollStyle.verticalVisible === 'focus') ||\n (!gantt.parsedOptions.scrollStyle.verticalVisible && gantt.parsedOptions.scrollStyle.visible === 'focus')\n ) {\n scene.scrollbarComponent.showVerticalScrollBar();\n }\n });\n\n scene.tableGroup.addEventListener('pointerleave', (e: VRender.FederatedPointerEvent) => {\n if (\n (gantt.parsedOptions.scrollStyle.horizontalVisible &&\n gantt.parsedOptions.scrollStyle.horizontalVisible === 'focus') ||\n (!gantt.parsedOptions.scrollStyle.horizontalVisible && gantt.parsedOptions.scrollStyle.visible === 'focus')\n ) {\n scene.scrollbarComponent.hideHorizontalScrollBar();\n }\n if (\n (gantt.parsedOptions.scrollStyle.verticalVisible &&\n gantt.parsedOptions.scrollStyle.verticalVisible === 'focus') ||\n (!gantt.parsedOptions.scrollStyle.verticalVisible && gantt.parsedOptions.scrollStyle.visible === 'focus')\n ) {\n scene.scrollbarComponent.hideVerticalScrollBar();\n }\n });\n}\n\nfunction bindContainerDomListener(eventManager: EventManager) {\n const gantt = eventManager._gantt;\n const scene = eventManager._gantt.scenegraph;\n const stateManager = gantt.stateManager;\n const handler = eventManager._eventHandler;\n handler.on(gantt.getElement(), 'wheel', (e: WheelEvent) => {\n handleWhell(e, stateManager, eventManager._gantt);\n });\n\n handler.on(gantt.getContainer(), 'resize', (e: any) => {\n // if (table.canvasSizeSeted) {\n // return;\n // }\n if (e.width === 0 && e.height === 0) {\n // 临时绕行解决因为display设置为none产生的问题\n return;\n }\n if (!isValid(gantt.options.pixelRatio)) {\n gantt.setPixelRatio(getPixelRatio());\n }\n if (!e.windowSizeNotChange) {\n gantt._resize();\n }\n });\n if (gantt.parsedOptions.verticalSplitLineMoveable) {\n handler.on(gantt.resizeLine, 'mousedown', (e: MouseEvent) => {\n console.log('resizeLine mousedown');\n stateManager.updateInteractionState(InteractionState.grabing);\n stateManager.startResizeTableWidth(e);\n });\n\n // 添加鼠标悬停时的高亮效果\n handler.on(gantt.resizeLine, 'mouseover', (e: MouseEvent) => {\n console.log('resizeLine mouseover');\n (gantt.resizeLine.childNodes[1] as HTMLDivElement).style.opacity = '1';\n });\n\n // 添加鼠标移出时恢复初始样式\n handler.on(gantt.resizeLine, 'mouseout', (e: MouseEvent) => {\n console.log('resizeLine mouseout');\n (gantt.resizeLine.childNodes[1] as HTMLDivElement).style.opacity = '0';\n });\n }\n VRender.vglobal.addEventListener('mousedown', (e: VRender.FederatedPointerEvent) => {\n gantt.eventManager.lastDragPointerXYOnWindow = { x: e.x, y: e.y };\n });\n VRender.vglobal.addEventListener('mousemove', (e: VRender.FederatedPointerEvent) => {\n if (stateManager.interactionState === InteractionState.grabing) {\n const lastX = gantt.eventManager.lastDragPointerXYOnWindow?.x ?? e.x;\n const lastY = gantt.eventManager.lastDragPointerXYOnWindow?.y ?? e.y;\n if (Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1) {\n if (stateManager.isResizingTableWidth()) {\n stateManager.dealResizeTableWidth(e);\n } else if (stateManager.isMoveingTaskBar()) {\n stateManager.dealTaskBarMove(e);\n } else if (stateManager.isResizingTaskBar()) {\n stateManager.dealTaskBarResize(e);\n }\n gantt.eventManager.lastDragPointerXYOnWindow = { x: e.x, y: e.y };\n }\n }\n });\n VRender.vglobal.addEventListener('mouseup', (e: MouseEvent) => {\n if (stateManager.interactionState === 'grabing') {\n stateManager.updateInteractionState(InteractionState.default);\n if (stateManager.isResizingTableWidth()) {\n stateManager.endResizeTableWidth();\n } else if (stateManager.isMoveingTaskBar()) {\n stateManager.endMoveTaskBar(e.x);\n } else if (stateManager.isResizingTaskBar()) {\n stateManager.endResizeTaskBar(e.x);\n }\n }\n });\n}\n"]}
|
package/cjs/gantt-helper.js
CHANGED
|
@@ -50,7 +50,7 @@ function getVerticalScrollBarSize(scrollStyle) {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
function initOptions(gantt) {
|
|
53
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20
|
|
53
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20;
|
|
54
54
|
const options = gantt.options;
|
|
55
55
|
gantt.parsedOptions.pixelRatio = null !== (_a = null == options ? void 0 : options.pixelRatio) && void 0 !== _a ? _a : 1,
|
|
56
56
|
gantt.parsedOptions.headerRowHeight = null !== (_b = null == options ? void 0 : options.headerRowHeight) && void 0 !== _b ? _b : 40,
|
|
@@ -98,29 +98,37 @@ function initOptions(gantt) {
|
|
|
98
98
|
fontFamily: "Arial",
|
|
99
99
|
fontSize: 14
|
|
100
100
|
}, null === (_u = null == options ? void 0 : options.taskBar) || void 0 === _u ? void 0 : _u.barStyle),
|
|
101
|
-
gantt.parsedOptions.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
gantt.parsedOptions.
|
|
101
|
+
gantt.parsedOptions.taskBarHoverStyle = Object.assign({
|
|
102
|
+
barOverLayColor: "rgba(99, 144, 0, 0.4)"
|
|
103
|
+
}, null === (_v = null == options ? void 0 : options.taskBar) || void 0 === _v ? void 0 : _v.hoverBarStyle),
|
|
104
|
+
gantt.parsedOptions.taskBarSelectionStyle = Object.assign({
|
|
105
|
+
barOverLayColor: "rgba(99, 144, 0, 0.4)"
|
|
106
|
+
}, null === (_w = null == options ? void 0 : options.taskBar) || void 0 === _w ? void 0 : _w.selectionBarStyle),
|
|
107
|
+
gantt.parsedOptions.taskBarLabelText = null !== (_y = null === (_x = null == options ? void 0 : options.taskBar) || void 0 === _x ? void 0 : _x.labelText) && void 0 !== _y ? _y : "",
|
|
108
|
+
gantt.parsedOptions.taskBarMoveable = null === (_0 = null === (_z = null == options ? void 0 : options.taskBar) || void 0 === _z ? void 0 : _z.moveable) || void 0 === _0 || _0,
|
|
109
|
+
gantt.parsedOptions.taskBarResizable = null === (_2 = null === (_1 = null == options ? void 0 : options.taskBar) || void 0 === _1 ? void 0 : _1.resizable) || void 0 === _2 || _2,
|
|
105
110
|
gantt.parsedOptions.taskBarLabelStyle = {
|
|
106
|
-
fontFamily: null !== (
|
|
107
|
-
fontSize: null !== (
|
|
108
|
-
color: null !== (
|
|
109
|
-
textAlign: null !== (
|
|
110
|
-
textBaseline: null !== (
|
|
111
|
-
padding: null !== (
|
|
112
|
-
textOverflow: null === (
|
|
113
|
-
}, gantt.parsedOptions.taskBarCustomLayout = null === (
|
|
114
|
-
gantt.parsedOptions.
|
|
111
|
+
fontFamily: null !== (_4 = null === (_3 = null == options ? void 0 : options.taskBar) || void 0 === _3 ? void 0 : _3.labelTextStyle.fontFamily) && void 0 !== _4 ? _4 : "Arial",
|
|
112
|
+
fontSize: null !== (_6 = null === (_5 = null == options ? void 0 : options.taskBar) || void 0 === _5 ? void 0 : _5.labelTextStyle.fontSize) && void 0 !== _6 ? _6 : gantt.parsedOptions.rowHeight,
|
|
113
|
+
color: null !== (_8 = null === (_7 = null == options ? void 0 : options.taskBar) || void 0 === _7 ? void 0 : _7.labelTextStyle.color) && void 0 !== _8 ? _8 : "#F01",
|
|
114
|
+
textAlign: null !== (_10 = null === (_9 = null == options ? void 0 : options.taskBar) || void 0 === _9 ? void 0 : _9.labelTextStyle.textAlign) && void 0 !== _10 ? _10 : "left",
|
|
115
|
+
textBaseline: null !== (_12 = null === (_11 = null == options ? void 0 : options.taskBar) || void 0 === _11 ? void 0 : _11.labelTextStyle.textBaseline) && void 0 !== _12 ? _12 : "middle",
|
|
116
|
+
padding: null !== (_14 = null === (_13 = null == options ? void 0 : options.taskBar) || void 0 === _13 ? void 0 : _13.labelTextStyle.padding) && void 0 !== _14 ? _14 : [ 0, 0, 0, 10 ],
|
|
117
|
+
textOverflow: null === (_15 = null == options ? void 0 : options.taskBar) || void 0 === _15 ? void 0 : _15.labelTextStyle.textOverflow
|
|
118
|
+
}, gantt.parsedOptions.taskBarCustomLayout = null === (_16 = null == options ? void 0 : options.taskBar) || void 0 === _16 ? void 0 : _16.customLayout,
|
|
119
|
+
gantt.parsedOptions.outerFrameStyle = Object.assign({
|
|
115
120
|
borderColor: "gray",
|
|
116
|
-
borderLineWidth:
|
|
121
|
+
borderLineWidth: 1,
|
|
117
122
|
cornerRadius: 4
|
|
118
|
-
}, null === (
|
|
123
|
+
}, null === (_17 = options.frame) || void 0 === _17 ? void 0 : _17.outerFrameStyle),
|
|
119
124
|
gantt.parsedOptions.markLine = generateMarkLine(null == options ? void 0 : options.markLine),
|
|
120
|
-
gantt.parsedOptions.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
125
|
+
gantt.parsedOptions.verticalSplitLineHighlight = null === (_18 = options.frame) || void 0 === _18 ? void 0 : _18.verticalSplitLineHighlight,
|
|
126
|
+
gantt.parsedOptions.verticalSplitLine = Object.assign({
|
|
127
|
+
lineColor: gantt.parsedOptions.outerFrameStyle.borderColor,
|
|
128
|
+
lineWidth: gantt.parsedOptions.outerFrameStyle.borderLineWidth
|
|
129
|
+
}, null === (_19 = options.frame) || void 0 === _19 ? void 0 : _19.verticalSplitLine),
|
|
130
|
+
gantt.parsedOptions.horizontalSplitLine = null === (_20 = options.frame) || void 0 === _20 ? void 0 : _20.horizontalSplitLine,
|
|
131
|
+
gantt.parsedOptions.verticalSplitLineMoveable = options.frame.verticalSplitLineMoveable;
|
|
124
132
|
}
|
|
125
133
|
|
|
126
134
|
function generateTimeLineDate(currentDate, endDate, scale) {
|