@wimi/vtable-gantt 1.0.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.
Files changed (317) hide show
  1. package/README.md +213 -0
  2. package/README.zh-CN.md +215 -0
  3. package/cjs/Gantt.d.ts +200 -0
  4. package/cjs/Gantt.js +582 -0
  5. package/cjs/Gantt.js.map +1 -0
  6. package/cjs/components/Menu.d.ts +1 -0
  7. package/cjs/components/Menu.js +1 -0
  8. package/cjs/components/Menu.js.map +1 -0
  9. package/cjs/components/MenuElementStyle.d.ts +1 -0
  10. package/cjs/components/MenuElementStyle.js +12 -0
  11. package/cjs/components/MenuElementStyle.js.map +1 -0
  12. package/cjs/data/DataSource.d.ts +9 -0
  13. package/cjs/data/DataSource.js +76 -0
  14. package/cjs/data/DataSource.js.map +1 -0
  15. package/cjs/env.d.ts +19 -0
  16. package/cjs/env.js +48 -0
  17. package/cjs/env.js.map +1 -0
  18. package/cjs/event/EventHandler.d.ts +47 -0
  19. package/cjs/event/EventHandler.js +128 -0
  20. package/cjs/event/EventHandler.js.map +1 -0
  21. package/cjs/event/EventTarget.d.ts +12 -0
  22. package/cjs/event/EventTarget.js +67 -0
  23. package/cjs/event/EventTarget.js.map +1 -0
  24. package/cjs/event/event-manager.d.ts +34 -0
  25. package/cjs/event/event-manager.js +369 -0
  26. package/cjs/event/event-manager.js.map +1 -0
  27. package/cjs/event/scroll.d.ts +8 -0
  28. package/cjs/event/scroll.js +112 -0
  29. package/cjs/event/scroll.js.map +1 -0
  30. package/cjs/event/touch.d.ts +2 -0
  31. package/cjs/event/touch.js +86 -0
  32. package/cjs/event/touch.js.map +1 -0
  33. package/cjs/gantt-helper.d.ts +63 -0
  34. package/cjs/gantt-helper.js +712 -0
  35. package/cjs/gantt-helper.js.map +1 -0
  36. package/cjs/index.d.ts +10 -0
  37. package/cjs/index.js +60 -0
  38. package/cjs/index.js.map +1 -0
  39. package/cjs/plugins/index.d.ts +2 -0
  40. package/cjs/plugins/index.js +15 -0
  41. package/cjs/plugins/index.js.map +1 -0
  42. package/cjs/plugins/interface.d.ts +10 -0
  43. package/cjs/plugins/interface.js +6 -0
  44. package/cjs/plugins/interface.js.map +1 -0
  45. package/cjs/plugins/plugin-manager.d.ts +16 -0
  46. package/cjs/plugins/plugin-manager.js +63 -0
  47. package/cjs/plugins/plugin-manager.js.map +1 -0
  48. package/cjs/register.d.ts +1 -0
  49. package/cjs/register.js +1 -0
  50. package/cjs/register.js.map +1 -0
  51. package/cjs/scenegraph/dependency-link.d.ts +48 -0
  52. package/cjs/scenegraph/dependency-link.js +480 -0
  53. package/cjs/scenegraph/dependency-link.js.map +1 -0
  54. package/cjs/scenegraph/drag-order-line.d.ts +12 -0
  55. package/cjs/scenegraph/drag-order-line.js +49 -0
  56. package/cjs/scenegraph/drag-order-line.js.map +1 -0
  57. package/cjs/scenegraph/frame-border.d.ts +10 -0
  58. package/cjs/scenegraph/frame-border.js +58 -0
  59. package/cjs/scenegraph/frame-border.js.map +1 -0
  60. package/cjs/scenegraph/gantt-node.d.ts +22 -0
  61. package/cjs/scenegraph/gantt-node.js +66 -0
  62. package/cjs/scenegraph/gantt-node.js.map +1 -0
  63. package/cjs/scenegraph/graphic/group-contribution-render.d.ts +12 -0
  64. package/cjs/scenegraph/graphic/group-contribution-render.js +37 -0
  65. package/cjs/scenegraph/graphic/group-contribution-render.js.map +1 -0
  66. package/cjs/scenegraph/graphic/index.d.ts +3 -0
  67. package/cjs/scenegraph/graphic/index.js +13 -0
  68. package/cjs/scenegraph/graphic/index.js.map +1 -0
  69. package/cjs/scenegraph/grid.d.ts +34 -0
  70. package/cjs/scenegraph/grid.js +316 -0
  71. package/cjs/scenegraph/grid.js.map +1 -0
  72. package/cjs/scenegraph/mark-line.d.ts +13 -0
  73. package/cjs/scenegraph/mark-line.js +109 -0
  74. package/cjs/scenegraph/mark-line.js.map +1 -0
  75. package/cjs/scenegraph/scenegraph.d.ts +59 -0
  76. package/cjs/scenegraph/scenegraph.js +240 -0
  77. package/cjs/scenegraph/scenegraph.js.map +1 -0
  78. package/cjs/scenegraph/scroll-bar.d.ts +19 -0
  79. package/cjs/scenegraph/scroll-bar.js +150 -0
  80. package/cjs/scenegraph/scroll-bar.js.map +1 -0
  81. package/cjs/scenegraph/task-bar.d.ts +40 -0
  82. package/cjs/scenegraph/task-bar.js +476 -0
  83. package/cjs/scenegraph/task-bar.js.map +1 -0
  84. package/cjs/scenegraph/task-creation-button.d.ts +13 -0
  85. package/cjs/scenegraph/task-creation-button.js +86 -0
  86. package/cjs/scenegraph/task-creation-button.js.map +1 -0
  87. package/cjs/scenegraph/timeline-header.d.ts +14 -0
  88. package/cjs/scenegraph/timeline-header.js +190 -0
  89. package/cjs/scenegraph/timeline-header.js.map +1 -0
  90. package/cjs/scenegraph/tooltip.d.ts +9 -0
  91. package/cjs/scenegraph/tooltip.js +59 -0
  92. package/cjs/scenegraph/tooltip.js.map +1 -0
  93. package/cjs/state/gantt-table-sync.d.ts +8 -0
  94. package/cjs/state/gantt-table-sync.js +96 -0
  95. package/cjs/state/gantt-table-sync.js.map +1 -0
  96. package/cjs/state/state-manager.d.ts +127 -0
  97. package/cjs/state/state-manager.js +634 -0
  98. package/cjs/state/state-manager.js.map +1 -0
  99. package/cjs/sub-tasks-inline-helper.d.ts +1 -0
  100. package/cjs/sub-tasks-inline-helper.js +1 -0
  101. package/cjs/sub-tasks-inline-helper.js.map +1 -0
  102. package/cjs/themes.d.ts +1 -0
  103. package/cjs/themes.js +1 -0
  104. package/cjs/themes.js.map +1 -0
  105. package/cjs/tools/debounce.d.ts +1 -0
  106. package/cjs/tools/debounce.js +51 -0
  107. package/cjs/tools/debounce.js.map +1 -0
  108. package/cjs/tools/dom.d.ts +1 -0
  109. package/cjs/tools/dom.js +11 -0
  110. package/cjs/tools/dom.js.map +1 -0
  111. package/cjs/tools/index.d.ts +2 -0
  112. package/cjs/tools/index.js +30 -0
  113. package/cjs/tools/index.js.map +1 -0
  114. package/cjs/tools/inertia.d.ts +15 -0
  115. package/cjs/tools/inertia.js +40 -0
  116. package/cjs/tools/inertia.js.map +1 -0
  117. package/cjs/tools/isx.d.ts +16 -0
  118. package/cjs/tools/isx.js +117 -0
  119. package/cjs/tools/isx.js.map +1 -0
  120. package/cjs/tools/pixel-ratio.d.ts +2 -0
  121. package/cjs/tools/pixel-ratio.js +16 -0
  122. package/cjs/tools/pixel-ratio.js.map +1 -0
  123. package/cjs/tools/util.d.ts +19 -0
  124. package/cjs/tools/util.js +404 -0
  125. package/cjs/tools/util.js.map +1 -0
  126. package/cjs/ts-types/EVENT_TYPE.d.ts +19 -0
  127. package/cjs/ts-types/EVENT_TYPE.js +22 -0
  128. package/cjs/ts-types/EVENT_TYPE.js.map +1 -0
  129. package/cjs/ts-types/common.d.ts +11 -0
  130. package/cjs/ts-types/common.js +10 -0
  131. package/cjs/ts-types/common.js.map +1 -0
  132. package/cjs/ts-types/events.d.ts +132 -0
  133. package/cjs/ts-types/events.js +6 -0
  134. package/cjs/ts-types/events.js.map +1 -0
  135. package/cjs/ts-types/gantt-engine.d.ts +344 -0
  136. package/cjs/ts-types/gantt-engine.js +18 -0
  137. package/cjs/ts-types/gantt-engine.js.map +1 -0
  138. package/cjs/ts-types/index.d.ts +5 -0
  139. package/cjs/ts-types/index.js +23 -0
  140. package/cjs/ts-types/index.js.map +1 -0
  141. package/cjs/ts-types/zoom-scale.d.ts +32 -0
  142. package/cjs/ts-types/zoom-scale.js +6 -0
  143. package/cjs/ts-types/zoom-scale.js.map +1 -0
  144. package/cjs/vrender.d.ts +1 -0
  145. package/cjs/vrender.js +60 -0
  146. package/cjs/vrender.js.map +1 -0
  147. package/cjs/vtable.d.ts +1 -0
  148. package/cjs/vtable.js +35 -0
  149. package/cjs/vtable.js.map +1 -0
  150. package/cjs/zoom-scale/DataZoomIntegration.d.ts +50 -0
  151. package/cjs/zoom-scale/DataZoomIntegration.js +261 -0
  152. package/cjs/zoom-scale/DataZoomIntegration.js.map +1 -0
  153. package/cjs/zoom-scale/ZoomScaleManager.d.ts +55 -0
  154. package/cjs/zoom-scale/ZoomScaleManager.js +328 -0
  155. package/cjs/zoom-scale/ZoomScaleManager.js.map +1 -0
  156. package/cjs/zoom-scale/index.d.ts +4 -0
  157. package/cjs/zoom-scale/index.js +24 -0
  158. package/cjs/zoom-scale/index.js.map +1 -0
  159. package/dist/vtable-gantt.js +76328 -0
  160. package/dist/vtable-gantt.min.js +15 -0
  161. package/es/Gantt.d.ts +200 -0
  162. package/es/Gantt.js +584 -0
  163. package/es/Gantt.js.map +1 -0
  164. package/es/components/Menu.d.ts +1 -0
  165. package/es/components/Menu.js +1 -0
  166. package/es/components/Menu.js.map +1 -0
  167. package/es/components/MenuElementStyle.d.ts +1 -0
  168. package/es/components/MenuElementStyle.js +6 -0
  169. package/es/components/MenuElementStyle.js.map +1 -0
  170. package/es/data/DataSource.d.ts +9 -0
  171. package/es/data/DataSource.js +63 -0
  172. package/es/data/DataSource.js.map +1 -0
  173. package/es/env.d.ts +19 -0
  174. package/es/env.js +42 -0
  175. package/es/env.js.map +1 -0
  176. package/es/event/EventHandler.d.ts +47 -0
  177. package/es/event/EventHandler.js +119 -0
  178. package/es/event/EventHandler.js.map +1 -0
  179. package/es/event/EventTarget.d.ts +12 -0
  180. package/es/event/EventTarget.js +58 -0
  181. package/es/event/EventTarget.js.map +1 -0
  182. package/es/event/event-manager.d.ts +34 -0
  183. package/es/event/event-manager.js +376 -0
  184. package/es/event/event-manager.js.map +1 -0
  185. package/es/event/scroll.d.ts +8 -0
  186. package/es/event/scroll.js +104 -0
  187. package/es/event/scroll.js.map +1 -0
  188. package/es/event/touch.d.ts +2 -0
  189. package/es/event/touch.js +78 -0
  190. package/es/event/touch.js.map +1 -0
  191. package/es/gantt-helper.d.ts +63 -0
  192. package/es/gantt-helper.js +683 -0
  193. package/es/gantt-helper.js.map +1 -0
  194. package/es/index.d.ts +10 -0
  195. package/es/index.js +16 -0
  196. package/es/index.js.map +1 -0
  197. package/es/plugins/index.d.ts +2 -0
  198. package/es/plugins/index.js +2 -0
  199. package/es/plugins/index.js.map +1 -0
  200. package/es/plugins/interface.d.ts +10 -0
  201. package/es/plugins/interface.js +2 -0
  202. package/es/plugins/interface.js.map +1 -0
  203. package/es/plugins/plugin-manager.d.ts +16 -0
  204. package/es/plugins/plugin-manager.js +55 -0
  205. package/es/plugins/plugin-manager.js.map +1 -0
  206. package/es/register.d.ts +1 -0
  207. package/es/register.js +1 -0
  208. package/es/register.js.map +1 -0
  209. package/es/scenegraph/dependency-link.d.ts +48 -0
  210. package/es/scenegraph/dependency-link.js +462 -0
  211. package/es/scenegraph/dependency-link.js.map +1 -0
  212. package/es/scenegraph/drag-order-line.d.ts +12 -0
  213. package/es/scenegraph/drag-order-line.js +40 -0
  214. package/es/scenegraph/drag-order-line.js.map +1 -0
  215. package/es/scenegraph/frame-border.d.ts +10 -0
  216. package/es/scenegraph/frame-border.js +51 -0
  217. package/es/scenegraph/frame-border.js.map +1 -0
  218. package/es/scenegraph/gantt-node.d.ts +22 -0
  219. package/es/scenegraph/gantt-node.js +64 -0
  220. package/es/scenegraph/gantt-node.js.map +1 -0
  221. package/es/scenegraph/graphic/group-contribution-render.d.ts +12 -0
  222. package/es/scenegraph/graphic/group-contribution-render.js +32 -0
  223. package/es/scenegraph/graphic/group-contribution-render.js.map +1 -0
  224. package/es/scenegraph/graphic/index.d.ts +3 -0
  225. package/es/scenegraph/graphic/index.js +8 -0
  226. package/es/scenegraph/graphic/index.js.map +1 -0
  227. package/es/scenegraph/grid.d.ts +34 -0
  228. package/es/scenegraph/grid.js +306 -0
  229. package/es/scenegraph/grid.js.map +1 -0
  230. package/es/scenegraph/mark-line.d.ts +13 -0
  231. package/es/scenegraph/mark-line.js +101 -0
  232. package/es/scenegraph/mark-line.js.map +1 -0
  233. package/es/scenegraph/scenegraph.d.ts +59 -0
  234. package/es/scenegraph/scenegraph.js +250 -0
  235. package/es/scenegraph/scenegraph.js.map +1 -0
  236. package/es/scenegraph/scroll-bar.d.ts +19 -0
  237. package/es/scenegraph/scroll-bar.js +144 -0
  238. package/es/scenegraph/scroll-bar.js.map +1 -0
  239. package/es/scenegraph/task-bar.d.ts +40 -0
  240. package/es/scenegraph/task-bar.js +475 -0
  241. package/es/scenegraph/task-bar.js.map +1 -0
  242. package/es/scenegraph/task-creation-button.d.ts +13 -0
  243. package/es/scenegraph/task-creation-button.js +78 -0
  244. package/es/scenegraph/task-creation-button.js.map +1 -0
  245. package/es/scenegraph/timeline-header.d.ts +14 -0
  246. package/es/scenegraph/timeline-header.js +186 -0
  247. package/es/scenegraph/timeline-header.js.map +1 -0
  248. package/es/scenegraph/tooltip.d.ts +9 -0
  249. package/es/scenegraph/tooltip.js +51 -0
  250. package/es/scenegraph/tooltip.js.map +1 -0
  251. package/es/state/gantt-table-sync.d.ts +8 -0
  252. package/es/state/gantt-table-sync.js +87 -0
  253. package/es/state/gantt-table-sync.js.map +1 -0
  254. package/es/state/state-manager.d.ts +127 -0
  255. package/es/state/state-manager.js +631 -0
  256. package/es/state/state-manager.js.map +1 -0
  257. package/es/sub-tasks-inline-helper.d.ts +1 -0
  258. package/es/sub-tasks-inline-helper.js +1 -0
  259. package/es/sub-tasks-inline-helper.js.map +1 -0
  260. package/es/themes.d.ts +1 -0
  261. package/es/themes.js +1 -0
  262. package/es/themes.js.map +1 -0
  263. package/es/tools/debounce.d.ts +1 -0
  264. package/es/tools/debounce.js +45 -0
  265. package/es/tools/debounce.js.map +1 -0
  266. package/es/tools/dom.d.ts +1 -0
  267. package/es/tools/dom.js +5 -0
  268. package/es/tools/dom.js.map +1 -0
  269. package/es/tools/index.d.ts +2 -0
  270. package/es/tools/index.js +4 -0
  271. package/es/tools/index.js.map +1 -0
  272. package/es/tools/inertia.d.ts +15 -0
  273. package/es/tools/inertia.js +31 -0
  274. package/es/tools/inertia.js.map +1 -0
  275. package/es/tools/isx.d.ts +16 -0
  276. package/es/tools/isx.js +80 -0
  277. package/es/tools/isx.js.map +1 -0
  278. package/es/tools/pixel-ratio.d.ts +2 -0
  279. package/es/tools/pixel-ratio.js +12 -0
  280. package/es/tools/pixel-ratio.js.map +1 -0
  281. package/es/tools/util.d.ts +19 -0
  282. package/es/tools/util.js +390 -0
  283. package/es/tools/util.js.map +1 -0
  284. package/es/ts-types/EVENT_TYPE.d.ts +19 -0
  285. package/es/ts-types/EVENT_TYPE.js +18 -0
  286. package/es/ts-types/EVENT_TYPE.js.map +1 -0
  287. package/es/ts-types/common.d.ts +11 -0
  288. package/es/ts-types/common.js +6 -0
  289. package/es/ts-types/common.js.map +1 -0
  290. package/es/ts-types/events.d.ts +132 -0
  291. package/es/ts-types/events.js +2 -0
  292. package/es/ts-types/events.js.map +1 -0
  293. package/es/ts-types/gantt-engine.d.ts +344 -0
  294. package/es/ts-types/gantt-engine.js +21 -0
  295. package/es/ts-types/gantt-engine.js.map +1 -0
  296. package/es/ts-types/index.d.ts +5 -0
  297. package/es/ts-types/index.js +10 -0
  298. package/es/ts-types/index.js.map +1 -0
  299. package/es/ts-types/zoom-scale.d.ts +32 -0
  300. package/es/ts-types/zoom-scale.js +2 -0
  301. package/es/ts-types/zoom-scale.js.map +1 -0
  302. package/es/vrender.d.ts +1 -0
  303. package/es/vrender.js +2 -0
  304. package/es/vrender.js.map +1 -0
  305. package/es/vtable.d.ts +1 -0
  306. package/es/vtable.js +2 -0
  307. package/es/vtable.js.map +1 -0
  308. package/es/zoom-scale/DataZoomIntegration.d.ts +50 -0
  309. package/es/zoom-scale/DataZoomIntegration.js +253 -0
  310. package/es/zoom-scale/DataZoomIntegration.js.map +1 -0
  311. package/es/zoom-scale/ZoomScaleManager.d.ts +55 -0
  312. package/es/zoom-scale/ZoomScaleManager.js +322 -0
  313. package/es/zoom-scale/ZoomScaleManager.js.map +1 -0
  314. package/es/zoom-scale/index.d.ts +4 -0
  315. package/es/zoom-scale/index.js +4 -0
  316. package/es/zoom-scale/index.js.map +1 -0
  317. package/package.json +124 -0
@@ -0,0 +1,475 @@
1
+ import { Group, createText, createRect, Image, Circle, Line, Polygon } from "@visactor/vtable/es/vrender";
2
+
3
+ import { computeCountToTimeScale, parseStringTemplate, toBoxArray } from "../tools/util";
4
+
5
+ import { isValid } from "@visactor/vutils";
6
+
7
+ import { defaultTaskBarStyle, getTextPos } from "../gantt-helper";
8
+
9
+ import { GanttTaskBarNode } from "./gantt-node";
10
+
11
+ import { TasksShowMode, TaskType } from "../ts-types";
12
+
13
+ const TASKBAR_HOVER_ICON = '<svg width="100" height="200" xmlns="http://www.w3.org/2000/svg">\n <line x1="30" y1="10" x2="30" y2="190" stroke="black" stroke-width="4"/>\n <line x1="70" y1="10" x2="70" y2="190" stroke="black" stroke-width="4"/>\n</svg>';
14
+
15
+ export const TASKBAR_HOVER_ICON_WIDTH = 10;
16
+
17
+ export class TaskBar {
18
+ formatMilestoneText(text, record) {
19
+ if (!text) return "";
20
+ const matches = text.match(/{([^}]+)}/g);
21
+ return matches && matches.forEach((match => {
22
+ const fieldName = match.substring(1, match.length - 1), fieldValue = record[fieldName];
23
+ void 0 !== fieldValue && (text = text.replace(match, String(fieldValue)));
24
+ })), text;
25
+ }
26
+ calculateMilestoneTextPosition(position, milestoneWidth, padding = 4) {
27
+ const paddingVal = "number" == typeof padding ? padding : 4;
28
+ let textX = 0, textY = 0, textAlignValue = "left", textBaselineValue = "middle";
29
+ const center = milestoneWidth / 2;
30
+ switch (position) {
31
+ case "left":
32
+ textX = -paddingVal, textY = center, textAlignValue = "end", textBaselineValue = "middle";
33
+ break;
34
+
35
+ case "right":
36
+ default:
37
+ textX = milestoneWidth + paddingVal, textY = center, textAlignValue = "start", textBaselineValue = "middle";
38
+ break;
39
+
40
+ case "top":
41
+ textX = center, textY = -paddingVal, textAlignValue = "center", textBaselineValue = "bottom";
42
+ break;
43
+
44
+ case "bottom":
45
+ textX = center, textY = milestoneWidth + paddingVal, textAlignValue = "center",
46
+ textBaselineValue = "top";
47
+ }
48
+ return {
49
+ textX: textX,
50
+ textY: textY,
51
+ textAlignValue: textAlignValue,
52
+ textBaselineValue: textBaselineValue
53
+ };
54
+ }
55
+ constructor(scene) {
56
+ this.selectedBorders = [], this._scene = scene, this.width = scene._gantt.tableNoFrameWidth,
57
+ this.height = scene._gantt.gridHeight, this.group = new Group({
58
+ x: 0,
59
+ y: scene._gantt.getAllHeaderRowsHeight(),
60
+ width: this.width,
61
+ height: this.height,
62
+ pickable: !1,
63
+ clip: !0
64
+ }), this.group.name = "task-bar-container", scene.ganttGroup.addChild(this.group),
65
+ this.initBars(), this.initHoverBarIcons();
66
+ }
67
+ initBars() {
68
+ var _a, _b, _c;
69
+ this.barContainer = new Group({
70
+ x: 0,
71
+ y: 0,
72
+ width: this._scene._gantt.getAllDateColsWidth(),
73
+ height: this._scene._gantt.getAllTaskBarsHeight(),
74
+ pickable: !1,
75
+ clip: !0
76
+ }), this.group.appendChild(this.barContainer);
77
+ for (let i = 0; i < this._scene._gantt.itemCount; i++) if (this._scene._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Inline && this._scene._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Separate && this._scene._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Arrange && this._scene._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Compact) if (this._scene._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Project_Sub_Tasks_Inline) {
78
+ const barGroup = this.initBar(i);
79
+ barGroup && this.barContainer.appendChild(barGroup);
80
+ } else {
81
+ const record = this._scene._gantt.getRecordByIndex(i), isExpanded = "expand" === record.hierarchyState;
82
+ if (record.type === TaskType.PROJECT && (null === (_c = record.children) || void 0 === _c ? void 0 : _c.length) > 0 && !isExpanded) {
83
+ const recordIndex = this._scene._gantt.getRecordIndexByTaskShowIndex(i), sub_task_indexs = Array.isArray(recordIndex) ? [ ...recordIndex ] : [ recordIndex ], callInitBar = (record, sub_task_indexs) => {
84
+ var _a, _b;
85
+ if ((null === (_a = record.children) || void 0 === _a ? void 0 : _a.length) > 0) for (let j = 0; j < (null === (_b = record.children) || void 0 === _b ? void 0 : _b.length); j++) {
86
+ const child_record = record.children[j];
87
+ if (child_record.type !== TaskType.PROJECT) {
88
+ const barGroup = this.initBar(i, [ ...sub_task_indexs, j ], record.children.length);
89
+ barGroup && this.barContainer.appendChild(barGroup);
90
+ } else callInitBar(child_record, [ ...sub_task_indexs, j ]);
91
+ }
92
+ };
93
+ callInitBar(record, sub_task_indexs);
94
+ } else {
95
+ const barGroup = this.initBar(i);
96
+ barGroup && this.barContainer.appendChild(barGroup);
97
+ }
98
+ } else {
99
+ const record = this._scene._gantt.getRecordByIndex(i);
100
+ if ((null === (_a = record.children) || void 0 === _a ? void 0 : _a.length) > 0) for (let j = 0; j < (null === (_b = record.children) || void 0 === _b ? void 0 : _b.length); j++) {
101
+ const barGroup = this.initBar(i, j, record.children.length);
102
+ barGroup && this.barContainer.appendChild(barGroup);
103
+ } else {
104
+ const barGroup = this.initBar(i);
105
+ barGroup && this.barContainer.appendChild(barGroup);
106
+ }
107
+ }
108
+ }
109
+ initBar(index, childIndex, childrenLength) {
110
+ var _a, _b, _c, _d, _e;
111
+ const taskBarCustomLayout = this._scene._gantt.parsedOptions.taskBarCustomLayout, {startDate: startDate, endDate: endDate, taskDays: taskDays, progress: progress, taskRecord: taskRecord} = this._scene._gantt.getTaskInfoByTaskListIndex(index, childIndex), isMilestone = taskRecord.type === TaskType.MILESTONE;
112
+ if (isMilestone && !startDate || !isMilestone && (taskDays <= 0 || !startDate || !endDate || startDate.getTime() > endDate.getTime())) return null;
113
+ const {unit: unit, step: step} = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0];
114
+ let taskBarSize = computeCountToTimeScale(endDate, startDate, unit, step, 1) * this._scene._gantt.parsedOptions.timelineColWidth;
115
+ const taskBarStyle = this._scene._gantt.getTaskBarStyle(index, childIndex), taskbarHeight = taskBarStyle.width;
116
+ isValid(taskBarStyle.minSize) && (taskBarSize = Math.max(taskBarSize, taskBarStyle.minSize));
117
+ const oneTaskHeigth = this._scene._gantt.parsedOptions.rowHeight, milestoneTaskBarHeight = this._scene._gantt.parsedOptions.taskBarMilestoneStyle.width, x = computeCountToTimeScale(startDate, this._scene._gantt.parsedOptions.minDate, unit, step) * this._scene._gantt.parsedOptions.timelineColWidth - (isMilestone ? milestoneTaskBarHeight / 2 : 0), y = this._scene._gantt.getRowsHeightByIndex(0, index - 1) + (this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate ? (null !== (_a = childIndex) && void 0 !== _a ? _a : 0) * oneTaskHeigth : this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange || this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact ? taskRecord.vtable_gantt_showIndex * oneTaskHeigth : 0) + (oneTaskHeigth - (isMilestone ? milestoneTaskBarHeight : taskbarHeight)) / 2, barGroupBox = new GanttTaskBarNode({
118
+ x: x,
119
+ y: y,
120
+ width: isMilestone ? milestoneTaskBarHeight : taskBarSize,
121
+ height: isMilestone ? milestoneTaskBarHeight : taskbarHeight,
122
+ cornerRadius: isMilestone ? this._scene._gantt.parsedOptions.taskBarMilestoneStyle.cornerRadius : taskBarStyle.cornerRadius,
123
+ lineWidth: isMilestone ? 2 * this._scene._gantt.parsedOptions.taskBarMilestoneStyle.borderLineWidth : 2 * (null !== (_b = taskBarStyle.borderLineWidth) && void 0 !== _b ? _b : taskBarStyle.borderWidth),
124
+ stroke: isMilestone ? this._scene._gantt.parsedOptions.taskBarMilestoneStyle.borderColor : taskBarStyle.borderColor,
125
+ angle: isMilestone ? .25 * Math.PI : 0,
126
+ anchor: isMilestone ? [ x + milestoneTaskBarHeight / 2, y + milestoneTaskBarHeight / 2 ] : void 0
127
+ });
128
+ barGroupBox.name = "task-bar", barGroupBox.task_index = index, barGroupBox.sub_task_index = childIndex,
129
+ barGroupBox.record = taskRecord;
130
+ const barGroup = new Group({
131
+ x: 0,
132
+ y: 0,
133
+ width: barGroupBox.attribute.width,
134
+ height: barGroupBox.attribute.height,
135
+ cornerRadius: isMilestone ? this._scene._gantt.parsedOptions.taskBarMilestoneStyle.cornerRadius : taskBarStyle.cornerRadius,
136
+ clip: this._scene._gantt.parsedOptions.taskBarClip
137
+ });
138
+ let rootContainer;
139
+ barGroup.name = "task-bar-group", barGroupBox.appendChild(barGroup), barGroupBox.clipGroupBox = barGroup;
140
+ let renderDefaultBar = !0, renderDefaultText = !0;
141
+ if (taskBarCustomLayout) {
142
+ let customLayoutObj;
143
+ if ("function" == typeof taskBarCustomLayout) {
144
+ customLayoutObj = taskBarCustomLayout({
145
+ width: taskBarSize,
146
+ height: taskbarHeight,
147
+ index: index,
148
+ startDate: startDate,
149
+ endDate: endDate,
150
+ taskDays: taskDays,
151
+ progress: progress,
152
+ taskRecord: taskRecord,
153
+ ganttInstance: this._scene._gantt
154
+ });
155
+ } else customLayoutObj = taskBarCustomLayout;
156
+ customLayoutObj && (rootContainer = customLayoutObj.rootContainer, renderDefaultBar = null !== (_c = customLayoutObj.renderDefaultBar) && void 0 !== _c && _c,
157
+ renderDefaultText = null !== (_d = customLayoutObj.renderDefaultText) && void 0 !== _d && _d,
158
+ rootContainer && (rootContainer.name = "task-bar-custom-render"));
159
+ }
160
+ if (renderDefaultBar) {
161
+ const rect = createRect({
162
+ x: 0,
163
+ y: 0,
164
+ width: barGroupBox.attribute.width,
165
+ height: barGroupBox.attribute.height,
166
+ fill: isMilestone ? this._scene._gantt.parsedOptions.taskBarMilestoneStyle.fillColor : taskBarStyle.barColor,
167
+ pickable: !1
168
+ });
169
+ if (rect.name = "task-bar-rect", barGroup.appendChild(rect), barGroupBox.barRect = rect,
170
+ taskRecord.type !== TaskType.MILESTONE) {
171
+ const progress_rect = createRect({
172
+ x: 0,
173
+ y: 0,
174
+ width: taskBarSize * progress / 100,
175
+ height: taskbarHeight,
176
+ fill: taskBarStyle.completedBarColor,
177
+ pickable: !1
178
+ });
179
+ progress_rect.name = "task-bar-progress-rect", barGroup.appendChild(progress_rect),
180
+ barGroupBox.progressRect = progress_rect;
181
+ }
182
+ }
183
+ if (rootContainer && barGroup.appendChild(rootContainer), renderDefaultText && taskRecord.type !== TaskType.MILESTONE) {
184
+ const {textAlign: textAlign, textBaseline: textBaseline, fontSize: fontSize, fontFamily: fontFamily, textOverflow: textOverflow, color: color, padding: padding} = this._scene._gantt.parsedOptions.taskBarLabelStyle, position = getTextPos(toBoxArray(padding), textAlign, textBaseline, taskBarSize, taskbarHeight), label = createText({
185
+ x: position.x,
186
+ y: position.y,
187
+ fontSize: fontSize,
188
+ fill: color,
189
+ fontFamily: fontFamily,
190
+ text: parseStringTemplate(this._scene._gantt.parsedOptions.taskBarLabelText, taskRecord),
191
+ maxLineWidth: taskBarSize - 10,
192
+ textBaseline: textBaseline,
193
+ textAlign: textAlign,
194
+ ellipsis: "clip" === textOverflow ? "" : "ellipsis" === textOverflow ? "..." : isValid(textOverflow) ? textOverflow : void 0,
195
+ poptip: {
196
+ position: "bottom"
197
+ }
198
+ });
199
+ barGroup.appendChild(label), barGroupBox.textLabel = label, barGroupBox.labelStyle = this._scene._gantt.parsedOptions.taskBarLabelStyle,
200
+ barGroupBox.updateTextPosition();
201
+ }
202
+ if (renderDefaultText && "milestone" === taskRecord.type && this._scene._gantt.parsedOptions.taskBarMilestoneStyle.labelText) {
203
+ const milestoneStyle = this._scene._gantt.parsedOptions.taskBarMilestoneStyle, textStyle = milestoneStyle.labelTextStyle || {}, pos = this.calculateMilestoneTextPosition(milestoneStyle.textOrient || "right", milestoneStyle.width, null !== (_e = textStyle.padding) && void 0 !== _e ? _e : 4), textContainer = new Group({
204
+ x: x,
205
+ y: y,
206
+ width: milestoneStyle.width,
207
+ height: milestoneStyle.width,
208
+ angle: 0,
209
+ pickable: !1
210
+ }), milestoneLabel = createText({
211
+ x: pos.textX,
212
+ y: pos.textY,
213
+ fontSize: textStyle.fontSize || 16,
214
+ fontFamily: textStyle.fontFamily || "Arial",
215
+ fill: textStyle.color || "#ff0000",
216
+ textBaseline: textStyle.textBaseline || pos.textBaselineValue,
217
+ textAlign: textStyle.textAlign || pos.textAlignValue,
218
+ text: this.formatMilestoneText(milestoneStyle.labelText, taskRecord),
219
+ pickable: !1
220
+ });
221
+ textContainer.appendChild(milestoneLabel), this.barContainer.appendChild(textContainer),
222
+ barGroupBox.milestoneTextLabel = milestoneLabel, barGroupBox.milestoneTextContainer = textContainer;
223
+ }
224
+ return barGroupBox;
225
+ }
226
+ updateTaskBarNode(index, sub_task_index) {
227
+ const taskbarGroup = this.getTaskBarNodeByIndex(index, sub_task_index);
228
+ taskbarGroup && this.barContainer.removeChild(taskbarGroup);
229
+ const barGroup = this.initBar(index, sub_task_index);
230
+ barGroup && (this.barContainer.insertInto(barGroup, index), barGroup.updateTextPosition());
231
+ }
232
+ initHoverBarIcons() {
233
+ var _a, _b;
234
+ const hoverBarGroup = new Group({
235
+ x: 0,
236
+ y: 0,
237
+ width: 100,
238
+ height: 100,
239
+ clip: !1,
240
+ pickable: !1,
241
+ cornerRadius: null !== (_b = null !== (_a = this._scene._gantt.parsedOptions.taskBarHoverStyle.cornerRadius) && void 0 !== _a ? _a : defaultTaskBarStyle.cornerRadius) && void 0 !== _b ? _b : 0,
242
+ fill: this._scene._gantt.parsedOptions.taskBarHoverStyle.barOverlayColor,
243
+ visibleAll: !1
244
+ });
245
+ if (this.hoverBarGroup = hoverBarGroup, hoverBarGroup.name = "task-bar-hover-shadow",
246
+ this._scene._gantt.parsedOptions.taskBarResizable) {
247
+ const icon = new Image({
248
+ x: 0,
249
+ y: 0,
250
+ width: 10,
251
+ height: 20,
252
+ image: TASKBAR_HOVER_ICON,
253
+ pickable: !0,
254
+ cursor: "col-resize"
255
+ });
256
+ icon.name = "task-bar-hover-shadow-left-icon", this.hoverBarLeftIcon = icon, hoverBarGroup.appendChild(icon);
257
+ const rightIcon = new Image({
258
+ x: 0,
259
+ y: 0,
260
+ width: 10,
261
+ height: 20,
262
+ image: TASKBAR_HOVER_ICON,
263
+ pickable: !0,
264
+ cursor: "col-resize"
265
+ });
266
+ rightIcon.name = "task-bar-hover-shadow-right-icon", this.hoverBarRightIcon = rightIcon,
267
+ hoverBarGroup.appendChild(rightIcon);
268
+ }
269
+ const progressHandle = new Group({
270
+ x: 0,
271
+ y: 0,
272
+ width: 12,
273
+ height: 12,
274
+ pickable: !0,
275
+ cursor: "ew-resize",
276
+ visible: !1
277
+ }), triangleHandle = new Polygon({
278
+ points: [ {
279
+ x: 6,
280
+ y: 0
281
+ }, {
282
+ x: 0,
283
+ y: 6
284
+ }, {
285
+ x: 12,
286
+ y: 6
287
+ } ],
288
+ fill: "#0064ff",
289
+ stroke: "#ffffff",
290
+ lineWidth: 1,
291
+ pickable: !1
292
+ });
293
+ progressHandle.appendChild(triangleHandle), progressHandle.name = "task-bar-progress-handle",
294
+ this.hoverBarProgressHandle = progressHandle, hoverBarGroup.appendChild(progressHandle);
295
+ }
296
+ setX(x) {
297
+ this.barContainer.setAttribute("x", x);
298
+ }
299
+ setY(y) {
300
+ this.barContainer.setAttribute("y", y);
301
+ }
302
+ refresh() {
303
+ this.width = this._scene._gantt.tableNoFrameWidth, this.height = this._scene._gantt.gridHeight,
304
+ this.group.setAttributes({
305
+ height: this.height,
306
+ width: this.width,
307
+ y: this._scene._gantt.getAllHeaderRowsHeight()
308
+ });
309
+ const x = this.barContainer.attribute.x, y = this.barContainer.attribute.y;
310
+ this.barContainer.removeAllChild(), this.group.removeChild(this.barContainer), this.initBars(),
311
+ this.setX(x), this.setY(y);
312
+ }
313
+ resize() {
314
+ this.width = this._scene._gantt.tableNoFrameWidth, this.height = this._scene._gantt.gridHeight,
315
+ this.group.setAttribute("width", this.width), this.group.setAttribute("height", this.height);
316
+ }
317
+ showHoverBar(x, y, width, height, target) {
318
+ var _a, _b, _c, _d, _e;
319
+ const {startDate: startDate, endDate: endDate, taskRecord: taskRecord} = this._scene._gantt.getTaskInfoByTaskListIndex(target.task_index, target.sub_task_index);
320
+ target && "task-bar" === target.name && target.appendChild(this.hoverBarGroup),
321
+ this.hoverBarGroup.setAttribute("x", 0), this.hoverBarGroup.setAttribute("y", 0),
322
+ this.hoverBarGroup.setAttribute("width", width), this.hoverBarGroup.setAttribute("height", height),
323
+ this.hoverBarGroup.setAttribute("visibleAll", !0);
324
+ const taskBarStyle = this._scene._gantt.getTaskBarStyle(target.task_index, target.sub_task_index);
325
+ if (taskRecord.type === TaskType.MILESTONE) this.hoverBarGroup.setAttribute("cornerRadius", target.attribute.cornerRadius); else {
326
+ const cornerRadius = null !== (_b = null !== (_a = this._scene._gantt.parsedOptions.taskBarHoverStyle.cornerRadius) && void 0 !== _a ? _a : taskBarStyle.cornerRadius) && void 0 !== _b ? _b : 0;
327
+ this.hoverBarGroup.setAttribute("cornerRadius", cornerRadius);
328
+ }
329
+ null === (_c = this.hoverBarLeftIcon) || void 0 === _c || _c.setAttribute("visible", !1),
330
+ null === (_d = this.hoverBarRightIcon) || void 0 === _d || _d.setAttribute("visible", !1),
331
+ null === (_e = this.hoverBarProgressHandle) || void 0 === _e || _e.setAttribute("visibleAll", !1);
332
+ let leftResizable = !0, rightResizable = !0, progressAdjustable = !0;
333
+ const progressField = this._scene._gantt.parsedOptions.progressField;
334
+ if (progressField && void 0 !== taskRecord[progressField] && null !== taskRecord[progressField]) if ("function" == typeof this._scene._gantt.parsedOptions.taskBarProgressAdjustable) {
335
+ const arg = {
336
+ index: target.task_index,
337
+ startDate: startDate,
338
+ endDate: endDate,
339
+ taskRecord: taskRecord,
340
+ ganttInstance: this._scene._gantt
341
+ };
342
+ progressAdjustable = this._scene._gantt.parsedOptions.taskBarProgressAdjustable(arg);
343
+ } else progressAdjustable = this._scene._gantt.parsedOptions.taskBarProgressAdjustable; else progressAdjustable = !1;
344
+ if (taskRecord.type === TaskType.MILESTONE) leftResizable = !1, rightResizable = !1,
345
+ progressAdjustable = !1; else if ("function" == typeof this._scene._gantt.parsedOptions.taskBarResizable) {
346
+ const arg = {
347
+ index: target.task_index,
348
+ startDate: startDate,
349
+ endDate: endDate,
350
+ taskRecord: taskRecord,
351
+ ganttInstance: this._scene._gantt
352
+ }, resizableResult = this._scene._gantt.parsedOptions.taskBarResizable(arg);
353
+ Array.isArray(resizableResult) ? [leftResizable, rightResizable] = resizableResult : (leftResizable = resizableResult,
354
+ rightResizable = resizableResult);
355
+ } else Array.isArray(this._scene._gantt.parsedOptions.taskBarResizable) ? [leftResizable, rightResizable] = this._scene._gantt.parsedOptions.taskBarResizable : (leftResizable = this._scene._gantt.parsedOptions.taskBarResizable,
356
+ rightResizable = this._scene._gantt.parsedOptions.taskBarResizable);
357
+ if (leftResizable && this.hoverBarLeftIcon.setAttribute("visible", !0), rightResizable && this.hoverBarRightIcon.setAttribute("visible", !0),
358
+ progressAdjustable && this.hoverBarProgressHandle.setAttribute("visibleAll", !0),
359
+ this.hoverBarLeftIcon && (this.hoverBarLeftIcon.setAttribute("x", 0), this.hoverBarLeftIcon.setAttribute("y", Math.ceil(height / 10)),
360
+ this.hoverBarLeftIcon.setAttribute("width", 10), this.hoverBarLeftIcon.setAttribute("height", height - 2 * Math.ceil(height / 10)),
361
+ this.hoverBarRightIcon.setAttribute("x", width - 10), this.hoverBarRightIcon.setAttribute("y", Math.ceil(height / 10)),
362
+ this.hoverBarRightIcon.setAttribute("width", 10), this.hoverBarRightIcon.setAttribute("height", height - 2 * Math.ceil(height / 10))),
363
+ this.hoverBarProgressHandle) {
364
+ const {progress: progress} = this._scene._gantt.getTaskInfoByTaskListIndex(target.task_index, target.sub_task_index), progressX = width * progress / 100 - 6;
365
+ this.hoverBarProgressHandle.setAttribute("x", progressX), this.hoverBarProgressHandle.setAttribute("y", height - 3);
366
+ }
367
+ }
368
+ hideHoverBar() {
369
+ this.hoverBarGroup.setAttribute("visibleAll", !1);
370
+ }
371
+ createSelectedBorder(x, y, width, height, attachedToTaskBarNode, showLinkPoint = !1) {
372
+ const record = attachedToTaskBarNode.record, selectedBorder = new Group({
373
+ x: x,
374
+ y: y,
375
+ width: width,
376
+ height: height,
377
+ pickable: !1,
378
+ attachedToTaskBarNode: attachedToTaskBarNode,
379
+ zIndex: 1e4
380
+ });
381
+ selectedBorder.name = "task-bar-select-border", this.barContainer.appendChild(selectedBorder),
382
+ this.selectedBorders.push(selectedBorder);
383
+ const selectRectBorder = new Group({
384
+ x: 0,
385
+ y: 0,
386
+ width: width,
387
+ height: height,
388
+ lineWidth: this._scene._gantt.parsedOptions.taskBarSelectedStyle.borderLineWidth,
389
+ pickable: !1,
390
+ cornerRadius: attachedToTaskBarNode.attribute.cornerRadius,
391
+ fill: !1,
392
+ stroke: this._scene._gantt.parsedOptions.taskBarSelectedStyle.borderColor,
393
+ shadowColor: this._scene._gantt.parsedOptions.taskBarSelectedStyle.shadowColor,
394
+ shadowOffsetX: this._scene._gantt.parsedOptions.taskBarSelectedStyle.shadowOffsetX,
395
+ shadowOffsetY: this._scene._gantt.parsedOptions.taskBarSelectedStyle.shadowOffsetY,
396
+ shadowBlur: this._scene._gantt.parsedOptions.taskBarSelectedStyle.shadowBlur,
397
+ angle: attachedToTaskBarNode.attribute.angle,
398
+ anchor: [ width / 2, height / 2 ]
399
+ });
400
+ if (selectedBorder.appendChild(selectRectBorder), showLinkPoint) {
401
+ const linePointPadding = record.type === TaskType.MILESTONE ? 15 : 10, linkPointContainer = new Group({
402
+ x: -linePointPadding,
403
+ y: 0,
404
+ width: 10,
405
+ height: height,
406
+ pickable: !0
407
+ }), linkPoint = new Circle({
408
+ x: 5,
409
+ y: height / 2,
410
+ radius: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.radius,
411
+ fill: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.fillColor,
412
+ stroke: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeColor,
413
+ lineWidth: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeWidth,
414
+ pickable: !1
415
+ });
416
+ linkPointContainer.appendChild(linkPoint), linkPointContainer.name = "task-bar-link-point-left",
417
+ selectedBorder.appendChild(linkPointContainer);
418
+ const linkPointContainer1 = new Group({
419
+ x: width + (linePointPadding - 10),
420
+ y: 0,
421
+ width: 10,
422
+ height: height,
423
+ pickable: !0
424
+ }), linkPoint1 = new Circle({
425
+ x: 5,
426
+ y: height / 2,
427
+ radius: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.radius,
428
+ fill: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.fillColor,
429
+ stroke: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeColor,
430
+ lineWidth: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeWidth,
431
+ pickable: !1,
432
+ pickStrokeBuffer: 10
433
+ });
434
+ linkPointContainer1.appendChild(linkPoint1), linkPointContainer1.name = "task-bar-link-point-right",
435
+ selectedBorder.appendChild(linkPointContainer1);
436
+ }
437
+ }
438
+ removeSelectedBorder() {
439
+ this.selectedBorders.forEach((border => {
440
+ border.delete();
441
+ })), this.selectedBorders = [];
442
+ }
443
+ removeSecondSelectedBorder() {
444
+ if (2 === this.selectedBorders.length) {
445
+ this.selectedBorders.pop().delete();
446
+ }
447
+ }
448
+ updateCreatingDependencyLine(x1, y1, x2, y2) {
449
+ this.creatingDependencyLine && (this.creatingDependencyLine.delete(), this.creatingDependencyLine = void 0);
450
+ const line = new Line({
451
+ points: [ {
452
+ x: x1,
453
+ y: y1
454
+ }, {
455
+ x: x2,
456
+ y: y2
457
+ } ],
458
+ stroke: this._scene._gantt.parsedOptions.dependencyLinkLineCreatingStyle.lineColor,
459
+ lineWidth: this._scene._gantt.parsedOptions.dependencyLinkLineCreatingStyle.lineWidth,
460
+ lineDash: this._scene._gantt.parsedOptions.dependencyLinkLineCreatingStyle.lineDash,
461
+ pickable: !1
462
+ });
463
+ this.creatingDependencyLine = line, this.selectedBorders[0].appendChild(line);
464
+ }
465
+ getTaskBarNodeByIndex(index, sub_task_index) {
466
+ let c = this.barContainer.firstChild;
467
+ if (!c) return null;
468
+ for (let i = 0; i < this.barContainer.childrenCount; i++) {
469
+ if (c.task_index === index && (!isValid(sub_task_index) || isValid(sub_task_index) && c.sub_task_index === sub_task_index)) return c;
470
+ c = c._next;
471
+ }
472
+ return null;
473
+ }
474
+ }
475
+ //# sourceMappingURL=task-bar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/scenegraph/task-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAG1G,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,kBAAkB,GAAG;;;OAGpB,CAAC;AACR,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAE3C,MAAM,OAAO,OAAO;IAClB,mBAAmB,CAAC,IAAY,EAAE,MAAW;QAC3C,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,EAAE,CAAC;SACX;QACD,MAAM,YAAY,GAAG,YAAY,CAAC;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAEzC,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACtB,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;gBACvD,MAAM,UAAU,GAAG,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AAE,EAAE;YACxD,IACE,CAAC,CAAC,UAAU,KAAK,KAAK;gBACtB,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,cAAc,KAAK,cAAc,CAAC,CAAC,EAC9F;gBACA,OAAO,CAAC,CAAC;aACV;YACD,CAAC,GAAG,CAAC,CAAC,KAAyB,CAAC;SACjC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","file":"task-bar.js","sourcesContent":["import { Group, createText, createRect, Image, Circle, Line, Polygon } from '@visactor/vtable/es/vrender';\nimport type { Scenegraph } from './scenegraph';\n// import { Icon } from './icon';\nimport { computeCountToTimeScale, parseStringTemplate, toBoxArray } from '../tools/util';\nimport { isValid } from '@visactor/vutils';\nimport { defaultTaskBarStyle, getTextPos } from '../gantt-helper';\nimport { GanttTaskBarNode } from './gantt-node';\nimport { TasksShowMode, TaskType } from '../ts-types';\n\nconst TASKBAR_HOVER_ICON = `<svg width=\"100\" height=\"200\" xmlns=\"http://www.w3.org/2000/svg\">\n <line x1=\"30\" y1=\"10\" x2=\"30\" y2=\"190\" stroke=\"black\" stroke-width=\"4\"/>\n <line x1=\"70\" y1=\"10\" x2=\"70\" y2=\"190\" stroke=\"black\" stroke-width=\"4\"/>\n</svg>`;\nexport const TASKBAR_HOVER_ICON_WIDTH = 10;\n\nexport class TaskBar {\n formatMilestoneText(text: string, record: any): string {\n if (!text) {\n return '';\n }\n const fieldPattern = /{([^}]+)}/g;\n const matches = text.match(fieldPattern);\n\n if (matches) {\n matches.forEach(match => {\n const fieldName = match.substring(1, match.length - 1);\n const fieldValue = record[fieldName];\n if (fieldValue !== undefined) {\n text = text.replace(match, String(fieldValue));\n }\n });\n }\n return text;\n }\n\n calculateMilestoneTextPosition(\n position: string,\n milestoneWidth: number,\n padding: number | number[] = 4\n ): {\n textX: number;\n textY: number;\n textAlignValue: CanvasTextAlign;\n textBaselineValue: CanvasTextBaseline;\n } {\n const paddingVal = typeof padding === 'number' ? padding : 4;\n let textX = 0;\n let textY = 0;\n let textAlignValue: CanvasTextAlign = 'left';\n let textBaselineValue: CanvasTextBaseline = 'middle';\n\n // 将文本位置改为以中心点为基准\n const center = milestoneWidth / 2;\n\n switch (position) {\n case 'left':\n textX = -paddingVal;\n textY = center;\n textAlignValue = 'end';\n textBaselineValue = 'middle';\n break;\n case 'right':\n textX = milestoneWidth + paddingVal;\n textY = center;\n textAlignValue = 'start';\n textBaselineValue = 'middle';\n break;\n case 'top':\n textX = center;\n textY = -paddingVal;\n textAlignValue = 'center';\n textBaselineValue = 'bottom';\n break;\n case 'bottom':\n textX = center;\n textY = milestoneWidth + paddingVal;\n textAlignValue = 'center';\n textBaselineValue = 'top';\n break;\n default:\n textX = milestoneWidth + paddingVal;\n textY = center;\n textAlignValue = 'start';\n textBaselineValue = 'middle';\n }\n\n return {\n textX,\n textY,\n textAlignValue,\n textBaselineValue\n };\n }\n group: Group;\n barContainer: Group;\n hoverBarGroup: Group;\n creatingDependencyLine: Line;\n hoverBarLeftIcon: Image;\n hoverBarRightIcon: Image;\n hoverBarProgressHandle: Group;\n _scene: Scenegraph;\n width: number;\n height: number;\n selectedBorders: Group[] = [];\n constructor(scene: Scenegraph) {\n this._scene = scene;\n // const height = Math.min(scene._gantt.tableNoFrameHeight, scene._gantt.drawHeight);\n this.width = scene._gantt.tableNoFrameWidth;\n this.height = scene._gantt.gridHeight;\n this.group = new Group({\n x: 0,\n y: scene._gantt.getAllHeaderRowsHeight(),\n width: this.width,\n height: this.height,\n pickable: false,\n clip: true\n });\n this.group.name = 'task-bar-container';\n scene.ganttGroup.addChild(this.group);\n this.initBars();\n this.initHoverBarIcons();\n }\n\n initBars() {\n this.barContainer = new Group({\n x: 0,\n y: 0,\n width: this._scene._gantt.getAllDateColsWidth(),\n height: this._scene._gantt.getAllTaskBarsHeight(),\n pickable: false,\n clip: true\n });\n this.group.appendChild(this.barContainer);\n\n for (let i = 0; i < this._scene._gantt.itemCount; i++) {\n if (\n this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Inline ||\n this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate ||\n this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ) {\n const record = this._scene._gantt.getRecordByIndex(i);\n if (record.children?.length > 0) {\n for (let j = 0; j < record.children?.length; j++) {\n const barGroup = this.initBar(i, j, record.children.length);\n if (barGroup) {\n this.barContainer.appendChild(barGroup);\n }\n }\n } else {\n const barGroup = this.initBar(i);\n if (barGroup) {\n this.barContainer.appendChild(barGroup);\n }\n }\n continue;\n } else if (this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Project_Sub_Tasks_Inline) {\n const record = this._scene._gantt.getRecordByIndex(i);\n const isExpanded = record.hierarchyState === 'expand';\n // For project type records, we want to show all children in one line when collapsed\n if (record.type === TaskType.PROJECT && record.children?.length > 0 && !isExpanded) {\n const recordIndex = this._scene._gantt.getRecordIndexByTaskShowIndex(i);\n const sub_task_indexs: number[] = Array.isArray(recordIndex) ? [...recordIndex] : [recordIndex];\n\n const callInitBar = (record: any, sub_task_indexs: number[]) => {\n if (record.children?.length > 0) {\n for (let j = 0; j < record.children?.length; j++) {\n const child_record = record.children[j];\n if (child_record.type !== TaskType.PROJECT) {\n const barGroup = this.initBar(i, [...sub_task_indexs, j], record.children.length);\n if (barGroup) {\n this.barContainer.appendChild(barGroup);\n }\n } else {\n //如果是project类型的子任务,需要递归调用 只将类型不是project的子任务添加到barContainer中\n callInitBar(child_record, [...sub_task_indexs, j]);\n }\n }\n }\n };\n callInitBar(record, sub_task_indexs);\n } else {\n // For non-project tasks, use the default Tasks_Separate mode\n const barGroup = this.initBar(i);\n if (barGroup) {\n this.barContainer.appendChild(barGroup);\n }\n }\n continue;\n } else {\n const barGroup = this.initBar(i);\n if (barGroup) {\n this.barContainer.appendChild(barGroup);\n }\n }\n }\n }\n\n /**\n * @param index 任务显示的index,从0开始\n * @param childIndex 子任务的index, 当taskShowMode是sub_tasks_*模式时,会传入sub_task_index。如果是tasks_separate模式,sub_task_index传入undefined。\n * 如果模式Project_Sub_Tasks_Inline时,传入的sub_task_index是一个数组,数组的第一个元素是父任务的index,第二个元素是子任务的index,依次类推算是各层子任务的path。\n */\n initBar(index: number, childIndex?: number | number[], childrenLength?: number) {\n const taskBarCustomLayout = this._scene._gantt.parsedOptions.taskBarCustomLayout;\n const { startDate, endDate, taskDays, progress, taskRecord } = this._scene._gantt.getTaskInfoByTaskListIndex(\n index,\n childIndex\n );\n const isMilestone = taskRecord.type === TaskType.MILESTONE;\n if (\n (isMilestone && !startDate) ||\n (!isMilestone && (taskDays <= 0 || !startDate || !endDate || startDate.getTime() > endDate.getTime()))\n ) {\n return null;\n }\n const { unit, step } = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0];\n let taskBarSize =\n computeCountToTimeScale(endDate, startDate, unit, step, 1) * this._scene._gantt.parsedOptions.timelineColWidth;\n\n const taskBarStyle = this._scene._gantt.getTaskBarStyle(index, childIndex);\n const taskbarHeight = taskBarStyle.width;\n if (isValid(taskBarStyle.minSize)) {\n taskBarSize = Math.max(taskBarSize, taskBarStyle.minSize);\n }\n // const minDate = createDateAtMidnight(this._scene._gantt.parsedOptions.minDate);\n\n // const subTaskShowRowCount =\n // this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate\n // ? childrenLength || 1\n // : this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange\n // ? computeRowsCountByRecordDate(this._scene._gantt, this._scene._gantt.records[index])\n // : this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n // ? computeRowsCountByRecordDateForCompact(this._scene._gantt, this._scene._gantt.records[index])\n // : 1;\n const oneTaskHeigth = this._scene._gantt.parsedOptions.rowHeight; // this._scene._gantt.getRowHeightByIndex(index) / subTaskShowRowCount;\n const milestoneTaskBarHeight = this._scene._gantt.parsedOptions.taskBarMilestoneStyle.width;\n const x =\n computeCountToTimeScale(startDate, this._scene._gantt.parsedOptions.minDate, unit, step) *\n this._scene._gantt.parsedOptions.timelineColWidth -\n (isMilestone ? milestoneTaskBarHeight / 2 : 0);\n const y =\n this._scene._gantt.getRowsHeightByIndex(0, index - 1) +\n (this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate\n ? ((childIndex as number) ?? 0) * oneTaskHeigth\n : this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ? taskRecord.vtable_gantt_showIndex * oneTaskHeigth\n : 0) +\n (oneTaskHeigth - (isMilestone ? milestoneTaskBarHeight : taskbarHeight)) / 2;\n const barGroupBox = new GanttTaskBarNode({\n x,\n y,\n width: isMilestone ? milestoneTaskBarHeight : taskBarSize,\n // height: this._scene._gantt.parsedOptions.rowHeight,\n height: isMilestone ? milestoneTaskBarHeight : taskbarHeight,\n cornerRadius: isMilestone\n ? this._scene._gantt.parsedOptions.taskBarMilestoneStyle.cornerRadius\n : taskBarStyle.cornerRadius,\n lineWidth: isMilestone\n ? this._scene._gantt.parsedOptions.taskBarMilestoneStyle.borderLineWidth * 2\n : (taskBarStyle.borderLineWidth ?? taskBarStyle.borderWidth) * 2,\n stroke: isMilestone\n ? this._scene._gantt.parsedOptions.taskBarMilestoneStyle.borderColor\n : taskBarStyle.borderColor,\n angle: isMilestone ? (45 / 180) * Math.PI : 0,\n anchor: isMilestone ? [x + milestoneTaskBarHeight / 2, y + milestoneTaskBarHeight / 2] : undefined\n // clip: true\n });\n barGroupBox.name = 'task-bar';\n //如果TaskShowMode是tasks_separate模式 这里的task_index其实是table中的bodyIndex;如果TaskShowMode是sub_tasks_***模式 task_index也是对应父节点任务条在table中的bodyIndex(但不会渲染父节点,只是渲染子节点)\n barGroupBox.task_index = index;\n //如果TaskShowMode是tasks_separate模式,不会赋值sub_task_index;如果TaskShowMode是sub_tasks_***模式 这里的sub_task_index是父节点下子元素的index\n barGroupBox.sub_task_index = childIndex as any;\n barGroupBox.record = taskRecord;\n\n const barGroup = new Group({\n x: 0,\n y: 0,\n width: barGroupBox.attribute.width,\n height: barGroupBox.attribute.height,\n cornerRadius: isMilestone\n ? this._scene._gantt.parsedOptions.taskBarMilestoneStyle.cornerRadius\n : taskBarStyle.cornerRadius,\n clip: this._scene._gantt.parsedOptions.taskBarClip\n });\n barGroup.name = 'task-bar-group';\n barGroupBox.appendChild(barGroup);\n barGroupBox.clipGroupBox = barGroup;\n let rootContainer;\n let renderDefaultBar = true;\n let renderDefaultText = true;\n\n if (taskBarCustomLayout) {\n let customLayoutObj;\n if (typeof taskBarCustomLayout === 'function') {\n const arg = {\n width: taskBarSize,\n height: taskbarHeight,\n index,\n startDate,\n endDate,\n taskDays,\n progress,\n taskRecord,\n ganttInstance: this._scene._gantt\n };\n customLayoutObj = taskBarCustomLayout(arg);\n } else {\n customLayoutObj = taskBarCustomLayout;\n }\n if (customLayoutObj) {\n // if (customLayoutObj.rootContainer) {\n // customLayoutObj.rootContainer = decodeReactDom(customLayoutObj.rootContainer);\n // }\n rootContainer = customLayoutObj.rootContainer;\n renderDefaultBar = customLayoutObj.renderDefaultBar ?? false;\n renderDefaultText = customLayoutObj.renderDefaultText ?? false;\n rootContainer && (rootContainer.name = 'task-bar-custom-render');\n }\n }\n\n if (renderDefaultBar) {\n // 创建整个任务条rect\n const rect = createRect({\n x: 0,\n y: 0, //this._scene._gantt.parsedOptions.rowHeight - taskbarHeight) / 2,\n width: barGroupBox.attribute.width,\n height: barGroupBox.attribute.height,\n fill: isMilestone ? this._scene._gantt.parsedOptions.taskBarMilestoneStyle.fillColor : taskBarStyle.barColor,\n pickable: false\n });\n rect.name = 'task-bar-rect';\n barGroup.appendChild(rect);\n barGroupBox.barRect = rect;\n if (taskRecord.type !== TaskType.MILESTONE) {\n // 创建已完成部分任务条rect\n const progress_rect = createRect({\n x: 0,\n y: 0, //(this._scene._gantt.parsedOptions.rowHeight - taskbarHeight) / 2,\n width: (taskBarSize * progress) / 100,\n height: taskbarHeight,\n fill: taskBarStyle.completedBarColor,\n pickable: false\n });\n progress_rect.name = 'task-bar-progress-rect';\n barGroup.appendChild(progress_rect);\n barGroupBox.progressRect = progress_rect;\n }\n }\n\n rootContainer && barGroup.appendChild(rootContainer);\n if (renderDefaultText && taskRecord.type !== TaskType.MILESTONE) {\n const { textAlign, textBaseline, fontSize, fontFamily, textOverflow, color, padding } =\n this._scene._gantt.parsedOptions.taskBarLabelStyle;\n const position = getTextPos(toBoxArray(padding), textAlign, textBaseline, taskBarSize, taskbarHeight);\n //创建label 文字\n const label = createText({\n // visible: false,\n // pickable: false,\n x: position.x, //extAlign === 'center' ? taskBarSize / 2 : textAlign === 'left' ? 10 : taskBarSize - 10,\n y: position.y, //fontSize / 2,\n fontSize: fontSize, // 10\n fill: color,\n fontFamily: fontFamily,\n text: parseStringTemplate(this._scene._gantt.parsedOptions.taskBarLabelText as string, taskRecord),\n maxLineWidth: taskBarSize - TASKBAR_HOVER_ICON_WIDTH,\n textBaseline,\n textAlign,\n ellipsis:\n textOverflow === 'clip'\n ? ''\n : textOverflow === 'ellipsis'\n ? '...'\n : isValid(textOverflow)\n ? textOverflow\n : undefined,\n poptip: {\n position: 'bottom'\n // dx: (taskBarSize - TASKBAR_HOVER_ICON_WIDTH) / 4\n }\n // dx: 12 + 4,\n // dy: this._scene._gantt.barLabelStyle.fontSize / 2\n } as any);\n\n barGroup.appendChild(label);\n barGroupBox.textLabel = label;\n\n barGroupBox.labelStyle = this._scene._gantt.parsedOptions.taskBarLabelStyle;\n\n barGroupBox.updateTextPosition();\n }\n if (\n renderDefaultText &&\n taskRecord.type === 'milestone' &&\n this._scene._gantt.parsedOptions.taskBarMilestoneStyle.labelText\n ) {\n const milestoneStyle = this._scene._gantt.parsedOptions.taskBarMilestoneStyle;\n const textStyle = milestoneStyle.labelTextStyle || {};\n const pos = this.calculateMilestoneTextPosition(\n milestoneStyle.textOrient || 'right',\n milestoneStyle.width,\n textStyle.padding ?? 4\n );\n\n const textContainer = new Group({\n x,\n y,\n width: milestoneStyle.width,\n height: milestoneStyle.width,\n angle: 0,\n pickable: false\n });\n\n const milestoneLabel = createText({\n x: pos.textX,\n y: pos.textY,\n fontSize: textStyle.fontSize || 16,\n fontFamily: textStyle.fontFamily || 'Arial',\n fill: textStyle.color || '#ff0000',\n textBaseline: (textStyle.textBaseline || pos.textBaselineValue) as any,\n textAlign: textStyle.textAlign || pos.textAlignValue,\n text: this.formatMilestoneText(milestoneStyle.labelText, taskRecord),\n pickable: false\n });\n\n textContainer.appendChild(milestoneLabel);\n this.barContainer.appendChild(textContainer);\n\n barGroupBox.milestoneTextLabel = milestoneLabel;\n barGroupBox.milestoneTextContainer = textContainer;\n }\n return barGroupBox;\n }\n updateTaskBarNode(index: number, sub_task_index?: number) {\n const taskbarGroup = this.getTaskBarNodeByIndex(index, sub_task_index);\n if (taskbarGroup) {\n this.barContainer.removeChild(taskbarGroup);\n }\n const barGroup = this.initBar(index, sub_task_index);\n if (barGroup) {\n this.barContainer.insertInto(barGroup, index); //TODO\n barGroup.updateTextPosition();\n }\n }\n initHoverBarIcons() {\n const hoverBarGroup = new Group({\n x: 0,\n y: 0,\n width: 100,\n height: 100,\n clip: false, // 关闭裁剪以允许进度手柄显示在任务条外部\n pickable: false,\n cornerRadius:\n this._scene._gantt.parsedOptions.taskBarHoverStyle.cornerRadius ?? defaultTaskBarStyle.cornerRadius ?? 0,\n fill: this._scene._gantt.parsedOptions.taskBarHoverStyle.barOverlayColor,\n visibleAll: false\n });\n this.hoverBarGroup = hoverBarGroup;\n hoverBarGroup.name = 'task-bar-hover-shadow';\n // this.barContainer.appendChild(hoverBarGroup);\n // 创建左侧的icon\n if (this._scene._gantt.parsedOptions.taskBarResizable) {\n const icon = new Image({\n x: 0,\n y: 0, //this._scene._gantt.parsedOptions.rowHeight - taskbarHeight) / 2,\n width: TASKBAR_HOVER_ICON_WIDTH,\n height: 20,\n image: TASKBAR_HOVER_ICON,\n pickable: true,\n cursor: 'col-resize'\n });\n icon.name = 'task-bar-hover-shadow-left-icon';\n this.hoverBarLeftIcon = icon;\n hoverBarGroup.appendChild(icon);\n\n // 创建右侧的icon\n const rightIcon = new Image({\n x: 0,\n y: 0, //this._scene._gantt.parsedOptions.rowHeight - taskbarHeight) / 2,\n width: TASKBAR_HOVER_ICON_WIDTH,\n height: 20,\n image: TASKBAR_HOVER_ICON,\n pickable: true,\n cursor: 'col-resize'\n });\n rightIcon.name = 'task-bar-hover-shadow-right-icon';\n this.hoverBarRightIcon = rightIcon;\n hoverBarGroup.appendChild(rightIcon);\n }\n\n // 创建进度手柄\n const progressHandle = new Group({\n x: 0,\n y: 0,\n width: 12,\n height: 12,\n pickable: true,\n cursor: 'ew-resize',\n visible: false\n });\n\n // 创建三角形手柄\n const triangleHandle = new Polygon({\n points: [\n { x: 6, y: 0 }, // 顶部中心点\n { x: 0, y: 6 }, // 左下角\n { x: 12, y: 6 } // 右下角\n ],\n fill: '#0064ff',\n stroke: '#ffffff',\n lineWidth: 1,\n pickable: false\n });\n progressHandle.appendChild(triangleHandle);\n\n progressHandle.name = 'task-bar-progress-handle';\n this.hoverBarProgressHandle = progressHandle;\n hoverBarGroup.appendChild(progressHandle);\n }\n\n setX(x: number) {\n this.barContainer.setAttribute('x', x);\n }\n setY(y: number) {\n this.barContainer.setAttribute('y', y);\n }\n /** 重新创建任务条节点 */\n refresh() {\n this.width = this._scene._gantt.tableNoFrameWidth;\n this.height = this._scene._gantt.gridHeight;\n this.group.setAttributes({\n height: this.height,\n width: this.width,\n y: this._scene._gantt.getAllHeaderRowsHeight()\n });\n const x = this.barContainer.attribute.x;\n const y = this.barContainer.attribute.y;\n this.barContainer.removeAllChild();\n this.group.removeChild(this.barContainer);\n this.initBars();\n this.setX(x);\n this.setY(y);\n }\n resize() {\n this.width = this._scene._gantt.tableNoFrameWidth;\n this.height = this._scene._gantt.gridHeight;\n this.group.setAttribute('width', this.width);\n this.group.setAttribute('height', this.height);\n }\n\n showHoverBar(x: number, y: number, width: number, height: number, target?: GanttTaskBarNode) {\n const { startDate, endDate, taskRecord } = this._scene._gantt.getTaskInfoByTaskListIndex(\n target.task_index,\n target.sub_task_index\n );\n if (target && target.name === 'task-bar') {\n // this.hoverBarGroup.releatedTaskBar = target;\n target.appendChild(this.hoverBarGroup);\n }\n this.hoverBarGroup.setAttribute('x', 0);\n this.hoverBarGroup.setAttribute('y', 0);\n this.hoverBarGroup.setAttribute('width', width);\n this.hoverBarGroup.setAttribute('height', height);\n this.hoverBarGroup.setAttribute('visibleAll', true);\n const taskBarStyle = this._scene._gantt.getTaskBarStyle(target.task_index, target.sub_task_index);\n if (taskRecord.type === TaskType.MILESTONE) {\n this.hoverBarGroup.setAttribute('cornerRadius', target.attribute.cornerRadius);\n } else {\n const cornerRadius =\n this._scene._gantt.parsedOptions.taskBarHoverStyle.cornerRadius ?? taskBarStyle.cornerRadius ?? 0;\n this.hoverBarGroup.setAttribute('cornerRadius', cornerRadius);\n }\n this.hoverBarLeftIcon?.setAttribute('visible', false);\n this.hoverBarRightIcon?.setAttribute('visible', false);\n this.hoverBarProgressHandle?.setAttribute('visibleAll', false);\n\n let leftResizable = true;\n let rightResizable = true;\n let progressAdjustable = true;\n\n const progressField = this._scene._gantt.parsedOptions.progressField;\n const hasProgressField =\n progressField && taskRecord[progressField] !== undefined && taskRecord[progressField] !== null;\n\n if (!hasProgressField) {\n progressAdjustable = false;\n } else if (typeof this._scene._gantt.parsedOptions.taskBarProgressAdjustable === 'function') {\n const arg = {\n index: target.task_index,\n startDate,\n endDate,\n taskRecord,\n ganttInstance: this._scene._gantt\n };\n progressAdjustable = this._scene._gantt.parsedOptions.taskBarProgressAdjustable(arg);\n } else {\n progressAdjustable = this._scene._gantt.parsedOptions.taskBarProgressAdjustable;\n }\n\n if (taskRecord.type === TaskType.MILESTONE) {\n leftResizable = false;\n rightResizable = false;\n progressAdjustable = false;\n } else if (typeof this._scene._gantt.parsedOptions.taskBarResizable === 'function') {\n const arg = {\n index: target.task_index,\n startDate,\n endDate,\n taskRecord,\n ganttInstance: this._scene._gantt\n };\n const resizableResult = this._scene._gantt.parsedOptions.taskBarResizable(arg);\n if (Array.isArray(resizableResult)) {\n [leftResizable, rightResizable] = resizableResult;\n } else {\n leftResizable = resizableResult;\n rightResizable = resizableResult;\n }\n } else if (Array.isArray(this._scene._gantt.parsedOptions.taskBarResizable)) {\n [leftResizable, rightResizable] = this._scene._gantt.parsedOptions.taskBarResizable;\n } else {\n leftResizable = this._scene._gantt.parsedOptions.taskBarResizable;\n rightResizable = this._scene._gantt.parsedOptions.taskBarResizable;\n }\n if (leftResizable) {\n this.hoverBarLeftIcon.setAttribute('visible', true);\n }\n if (rightResizable) {\n this.hoverBarRightIcon.setAttribute('visible', true);\n }\n if (progressAdjustable) {\n this.hoverBarProgressHandle.setAttribute('visibleAll', true);\n }\n if (this.hoverBarLeftIcon) {\n this.hoverBarLeftIcon.setAttribute('x', 0);\n this.hoverBarLeftIcon.setAttribute('y', Math.ceil(height / 10));\n this.hoverBarLeftIcon.setAttribute('width', TASKBAR_HOVER_ICON_WIDTH);\n this.hoverBarLeftIcon.setAttribute('height', height - 2 * Math.ceil(height / 10));\n this.hoverBarRightIcon.setAttribute('x', width - TASKBAR_HOVER_ICON_WIDTH);\n this.hoverBarRightIcon.setAttribute('y', Math.ceil(height / 10));\n this.hoverBarRightIcon.setAttribute('width', TASKBAR_HOVER_ICON_WIDTH);\n this.hoverBarRightIcon.setAttribute('height', height - 2 * Math.ceil(height / 10));\n }\n if (this.hoverBarProgressHandle) {\n const { progress } = this._scene._gantt.getTaskInfoByTaskListIndex(target.task_index, target.sub_task_index);\n const progressX = (width * progress) / 100 - 6;\n this.hoverBarProgressHandle.setAttribute('x', progressX);\n this.hoverBarProgressHandle.setAttribute('y', height - 3); // 让三角形有一半在进度条内\n }\n }\n hideHoverBar() {\n this.hoverBarGroup.setAttribute('visibleAll', false);\n }\n\n createSelectedBorder(\n x: number,\n y: number,\n width: number,\n height: number,\n attachedToTaskBarNode: GanttTaskBarNode,\n showLinkPoint: boolean = false\n ) {\n const record = attachedToTaskBarNode.record;\n const selectedBorder = new Group({\n x,\n y,\n width,\n height,\n // lineWidth: this._scene._gantt.parsedOptions.taskBarSelectedStyle.borderLineWidth,\n pickable: false,\n // cornerRadius: attachedToTaskBarNode.attribute.cornerRadius,\n // fill: false,\n // stroke: this._scene._gantt.parsedOptions.taskBarSelectedStyle.borderColor,\n // shadowColor: this._scene._gantt.parsedOptions.taskBarSelectedStyle.shadowColor,\n // shadowOffsetX: this._scene._gantt.parsedOptions.taskBarSelectedStyle.shadowOffsetX,\n // shadowOffsetY: this._scene._gantt.parsedOptions.taskBarSelectedStyle.shadowOffsetY,\n // shadowBlur: this._scene._gantt.parsedOptions.taskBarSelectedStyle.shadowBlur,\n attachedToTaskBarNode: attachedToTaskBarNode,\n zIndex: 10000\n // angle: attachedToTaskBarNode.attribute.angle,\n // anchor: attachedToTaskBarNode.attribute.anchor\n } as any);\n selectedBorder.name = 'task-bar-select-border';\n this.barContainer.appendChild(selectedBorder);\n this.selectedBorders.push(selectedBorder);\n\n const selectRectBorder = new Group({\n x: 0,\n y: 0,\n width,\n height,\n lineWidth: this._scene._gantt.parsedOptions.taskBarSelectedStyle.borderLineWidth,\n pickable: false,\n cornerRadius: attachedToTaskBarNode.attribute.cornerRadius,\n fill: false,\n stroke: this._scene._gantt.parsedOptions.taskBarSelectedStyle.borderColor,\n shadowColor: this._scene._gantt.parsedOptions.taskBarSelectedStyle.shadowColor,\n shadowOffsetX: this._scene._gantt.parsedOptions.taskBarSelectedStyle.shadowOffsetX,\n shadowOffsetY: this._scene._gantt.parsedOptions.taskBarSelectedStyle.shadowOffsetY,\n shadowBlur: this._scene._gantt.parsedOptions.taskBarSelectedStyle.shadowBlur,\n // attachedToTaskBarNode: attachedToTaskBarNode,\n angle: attachedToTaskBarNode.attribute.angle,\n anchor: [width / 2, height / 2]\n });\n // selectRectBorder.name = 'task-bar-select-border';\n selectedBorder.appendChild(selectRectBorder);\n\n if (showLinkPoint) {\n const isMilestone = record.type === TaskType.MILESTONE;\n const linePointPadding = isMilestone ? 15 : 10;\n const linkPointContainer = new Group({\n x: -linePointPadding,\n y: 0,\n width: 10,\n height: height,\n pickable: true\n });\n const linkPoint = new Circle({\n x: 5,\n y: height / 2,\n radius: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.radius,\n fill: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.fillColor,\n stroke: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeColor,\n lineWidth: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeWidth,\n pickable: false\n });\n linkPointContainer.appendChild(linkPoint);\n linkPointContainer.name = 'task-bar-link-point-left';\n selectedBorder.appendChild(linkPointContainer);\n\n const linkPointContainer1 = new Group({\n x: width + (linePointPadding - 10),\n y: 0,\n width: 10,\n height: height,\n pickable: true\n });\n const linkPoint1 = new Circle({\n x: 5,\n y: height / 2,\n radius: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.radius,\n fill: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.fillColor,\n stroke: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeColor,\n lineWidth: this._scene._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeWidth,\n pickable: false,\n pickStrokeBuffer: 10\n });\n linkPointContainer1.appendChild(linkPoint1);\n linkPointContainer1.name = 'task-bar-link-point-right';\n selectedBorder.appendChild(linkPointContainer1);\n }\n }\n removeSelectedBorder() {\n this.selectedBorders.forEach(border => {\n border.delete();\n });\n this.selectedBorders = [];\n }\n removeSecondSelectedBorder() {\n if (this.selectedBorders.length === 2) {\n const secondBorder = this.selectedBorders.pop();\n secondBorder.delete();\n }\n }\n updateCreatingDependencyLine(x1: number, y1: number, x2: number, y2: number) {\n if (this.creatingDependencyLine) {\n this.creatingDependencyLine.delete();\n this.creatingDependencyLine = undefined;\n }\n const line = new Line({\n points: [\n { x: x1, y: y1 },\n { x: x2, y: y2 }\n ],\n stroke: this._scene._gantt.parsedOptions.dependencyLinkLineCreatingStyle.lineColor,\n lineWidth: this._scene._gantt.parsedOptions.dependencyLinkLineCreatingStyle.lineWidth,\n lineDash: this._scene._gantt.parsedOptions.dependencyLinkLineCreatingStyle.lineDash,\n pickable: false\n });\n this.creatingDependencyLine = line;\n this.selectedBorders[0].appendChild(line);\n }\n\n getTaskBarNodeByIndex(index: number, sub_task_index?: number): GanttTaskBarNode {\n let c = this.barContainer.firstChild as GanttTaskBarNode;\n if (!c) {\n return null;\n }\n for (let i = 0; i < this.barContainer.childrenCount; i++) {\n if (\n c.task_index === index &&\n (!isValid(sub_task_index) || (isValid(sub_task_index) && c.sub_task_index === sub_task_index))\n ) {\n return c;\n }\n c = c._next as GanttTaskBarNode;\n }\n return null;\n }\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import { Group } from '@visactor/vtable/es/vrender';
2
+ import type { ILine } from '@visactor/vtable/es/vrender';
3
+ import type { Scenegraph } from './scenegraph';
4
+ export declare class TaskCreationButton {
5
+ _scene: Scenegraph;
6
+ group: Group;
7
+ lineVertical: ILine;
8
+ lineHorizontal: ILine;
9
+ constructor(scene: Scenegraph);
10
+ createAddButton(): void;
11
+ show(x: number, y: number, width: number, height: number): void;
12
+ hide(): void;
13
+ }