@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,40 @@
1
+ import { Group, createLine } from "@visactor/vtable/es/vrender";
2
+
3
+ export class DragOrderLine {
4
+ constructor(scene) {
5
+ this._scene = scene, this.dragLineContainer = new Group({
6
+ x: 0,
7
+ y: 0,
8
+ width: scene._gantt.tableNoFrameWidth,
9
+ height: Math.min(scene._gantt.tableNoFrameHeight, scene._gantt.drawHeight),
10
+ pickable: !1,
11
+ clip: !0,
12
+ visible: !1
13
+ }), this.dragLineContainer.name = "drag-order-line-container", scene.ganttGroup.addChild(this.dragLineContainer),
14
+ this.initDragLine();
15
+ }
16
+ initDragLine() {
17
+ if (this._scene._gantt.taskListTableInstance) {
18
+ const style = this._scene._gantt.taskListTableInstance.theme.dragHeaderSplitLine, lineObj = createLine({
19
+ pickable: !1,
20
+ stroke: "function" == typeof style.lineColor ? style.lineColor({}) : style.lineColor,
21
+ lineWidth: style.lineWidth,
22
+ points: []
23
+ });
24
+ this.dragLine = lineObj, this.dragLineContainer.appendChild(lineObj);
25
+ }
26
+ }
27
+ showDragLine(y) {
28
+ this.dragLineContainer.showAll(), this.dragLine.setAttribute("points", [ {
29
+ x: 0,
30
+ y: y
31
+ }, {
32
+ x: this._scene._gantt.tableNoFrameWidth,
33
+ y: y
34
+ } ]);
35
+ }
36
+ hideDragLine() {
37
+ this.dragLineContainer.hideAll();
38
+ }
39
+ }
40
+ //# sourceMappingURL=drag-order-line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/scenegraph/drag-order-line.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,OAAO,aAAa;IAKxB,YAAY,KAAiB;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QAEpB,IAAI,CAAC,iBAAiB,GAAG,IAAI,KAAK,CAAC;YACjC,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,iBAAiB;YACrC,MAAM,EAAE,I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AAE,CAAC;aACL;SACF,CAAC,CAAC;IACL,CAAC;IACD,YAAY;QACV,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,CAAC;IACnC,CAAC;CACF","file":"drag-order-line.js","sourcesContent":["import { createDateAtMidnight } from '../tools/util';\nimport type { IMarkLine } from '../ts-types';\nimport type { Scenegraph } from './scenegraph';\nimport type { Line } from '@visactor/vtable/es/vrender';\nimport { Group, createLine } from '@visactor/vtable/es/vrender';\n\nexport class DragOrderLine {\n _scene: Scenegraph;\n\n dragLineContainer: Group;\n dragLine: Line;\n constructor(scene: Scenegraph) {\n this._scene = scene;\n // this.width = scene._gantt.tableNoFrameWidth;\n this.dragLineContainer = new Group({\n x: 0,\n y: 0,\n width: scene._gantt.tableNoFrameWidth,\n height: Math.min(scene._gantt.tableNoFrameHeight, scene._gantt.drawHeight),\n pickable: false,\n clip: true,\n visible: false\n });\n this.dragLineContainer.name = 'drag-order-line-container';\n scene.ganttGroup.addChild(this.dragLineContainer);\n this.initDragLine();\n }\n initDragLine() {\n if (this._scene._gantt.taskListTableInstance) {\n const style = this._scene._gantt.taskListTableInstance.theme.dragHeaderSplitLine;\n // 创建拖拽位置高亮线条\n const lineObj = createLine({\n pickable: false,\n stroke: typeof style.lineColor === 'function' ? style.lineColor({} as any) : style.lineColor,\n lineWidth: style.lineWidth,\n // lineDash: style.lineDash,\n points: []\n } as any);\n this.dragLine = lineObj as any;\n this.dragLineContainer.appendChild(lineObj);\n }\n }\n\n /** 重新场景场景树节点 */\n showDragLine(y: number) {\n this.dragLineContainer.showAll();\n this.dragLine.setAttribute('points', [\n {\n x: 0,\n y: y\n },\n {\n x: this._scene._gantt.tableNoFrameWidth,\n y: y\n }\n ]);\n }\n hideDragLine() {\n this.dragLineContainer.hideAll();\n }\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import type { IRect } from '@visactor/vtable/es/vrender';
2
+ import type { Scenegraph } from './scenegraph';
3
+ export declare class FrameBorder {
4
+ _scene: Scenegraph;
5
+ border: IRect;
6
+ constructor(scene: Scenegraph);
7
+ createFrameBorder(): void;
8
+ refresh(): void;
9
+ resize(): void;
10
+ }
@@ -0,0 +1,51 @@
1
+ import { createRect } from "@visactor/vtable/es/vrender";
2
+
3
+ import { toBoxArray } from "@visactor/vtable";
4
+
5
+ export class FrameBorder {
6
+ constructor(scene) {
7
+ this._scene = scene, this.createFrameBorder();
8
+ }
9
+ createFrameBorder() {
10
+ var _a, _b, _c, _d, _e, _f;
11
+ const group = this._scene.ganttGroup, frameStyle = this._scene._gantt.parsedOptions.outerFrameStyle;
12
+ if (!frameStyle) return;
13
+ const {cornerRadius: cornerRadius, borderColor: borderColor, borderLineWidth: borderLineWidth, borderLineDash: borderLineDash} = frameStyle, groupAttributes = {}, rectAttributes = {
14
+ pickable: !1
15
+ }, lineWidths = toBoxArray(null != borderLineWidth ? borderLineWidth : 0), strokeArrayWidth = [ lineWidths[0], lineWidths[1], lineWidths[2], this._scene._gantt.taskListTableInstance ? 0 : lineWidths[3] ];
16
+ rectAttributes.stroke = !0, rectAttributes.fill = !1, rectAttributes.stroke = borderColor,
17
+ rectAttributes.lineWidth = Math.max(...strokeArrayWidth), rectAttributes.strokeArrayWidth = strokeArrayWidth,
18
+ borderLineDash && (rectAttributes.lineDash = borderLineDash), rectAttributes.lineCap = "butt";
19
+ const hasTaskList = !!this._scene._gantt.taskListTableInstance;
20
+ rectAttributes.x = hasTaskList ? 0 : strokeArrayWidth[3] / 2, rectAttributes.y = strokeArrayWidth[0] / 2;
21
+ const verticalSplitLineWidth = null !== (_b = null === (_a = this._scene._gantt.parsedOptions.verticalSplitLine) || void 0 === _a ? void 0 : _a.lineWidth) && void 0 !== _b ? _b : 0;
22
+ if (rectAttributes.width = group.attribute.width + strokeArrayWidth[3] / 2 + strokeArrayWidth[1] / 2 + (hasTaskList ? verticalSplitLineWidth : 0),
23
+ rectAttributes.height = group.attribute.height + strokeArrayWidth[0] / 2 + strokeArrayWidth[2] / 2,
24
+ cornerRadius) {
25
+ const radius = Array.isArray(cornerRadius) ? cornerRadius : [ cornerRadius, cornerRadius, cornerRadius, cornerRadius ];
26
+ this._scene._gantt.taskListTableInstance ? (rectAttributes.cornerRadius = [ 0, null !== (_c = radius[1]) && void 0 !== _c ? _c : 0, null !== (_d = radius[2]) && void 0 !== _d ? _d : 0, 0 ],
27
+ groupAttributes.cornerRadius = [ 0, null !== (_e = radius[1]) && void 0 !== _e ? _e : 0, null !== (_f = radius[2]) && void 0 !== _f ? _f : 0, 0 ]) : (rectAttributes.cornerRadius = radius,
28
+ groupAttributes.cornerRadius = radius);
29
+ }
30
+ if (group.setAttributes(groupAttributes), rectAttributes.stroke) {
31
+ const borderRect = createRect(rectAttributes);
32
+ borderRect.name = "border-rect", group.parent.insertAfter(borderRect, group), this.border = borderRect,
33
+ group.border = borderRect;
34
+ }
35
+ }
36
+ refresh() {
37
+ this.border && this.border.parent && this.border.parent.removeChild(this.border),
38
+ this.createFrameBorder();
39
+ }
40
+ resize() {
41
+ var _a, _b, _c;
42
+ const {borderLineWidth: borderLineWidth} = this._scene._gantt.parsedOptions.outerFrameStyle, lineWidths = toBoxArray(null != borderLineWidth ? borderLineWidth : 0), strokeArrayWidth = [ lineWidths[0], lineWidths[1], lineWidths[2], this._scene._gantt.taskListTableInstance ? 0 : lineWidths[3] ], verticalSplitLineWidth = null !== (_b = null === (_a = this._scene._gantt.parsedOptions.verticalSplitLine) || void 0 === _a ? void 0 : _a.lineWidth) && void 0 !== _b ? _b : 0, hasTaskList = !!this._scene._gantt.taskListTableInstance;
43
+ null === (_c = this.border) || void 0 === _c || _c.setAttributes({
44
+ x: hasTaskList ? 0 : strokeArrayWidth[3] / 2,
45
+ y: strokeArrayWidth[0] / 2,
46
+ width: this._scene.ganttGroup.attribute.width + strokeArrayWidth[3] / 2 + strokeArrayWidth[1] / 2 + (hasTaskList ? verticalSplitLineWidth : 0),
47
+ height: this._scene.ganttGroup.attribute.height + strokeArrayWidth[0] / 2 + strokeArrayWidth[2] / 2
48
+ }), this.border.strokeArrayWidth = strokeArrayWidth;
49
+ }
50
+ }
51
+ //# sourceMappingURL=frame-border.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/scenegraph/frame-border.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAO9C,MAAM,OAAO,WAAW;IAQtB,YAAY,KAAiB;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC3B,CAAC;IAKD,iBAAiB;;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,eAAe,CAAC;QACpE,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QACD,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC;QAClF,MAAM,eAAe,GAA2B,EAAE,CAAC;QACnD,MAAM,cAAc,GAA0B,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QAGlE,MAAM,UAAU,GAAG,UAAU,CAAC,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,CAAC,CAAC,CAAC;QAEpD,MAAM,gBAAgB,GAAG;YACvB,UAAU,CAAC,CAAC,CAAC;YACb,UAAU,CAAC,CAAC,CAAC;YACb,UAAU,CAAC,CAAC,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;SAC7D,CAAC;QAEF,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC;QAC7B,cAAc,CAAC,IAAI,GAAG,KAAK,CAAC;QAC5B,cAAc,CAAC,MAAM,GAAG,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D,CAAC;CACF","file":"frame-border.js","sourcesContent":["import { createRect } from '@visactor/vtable/es/vrender';\nimport type { IRect, IGroupGraphicAttribute, IRectGraphicAttribute } from '@visactor/vtable/es/vrender';\nimport { toBoxArray } from '@visactor/vtable';\n\nimport type { Scenegraph } from './scenegraph';\n\n/**\n * 甘特图外边框组件\n */\nexport class FrameBorder {\n _scene: Scenegraph;\n border: IRect;\n\n /**\n * 构造函数,初始化外边框组件。\n * @param scene 所属的 Scenegraph 实例。\n */\n constructor(scene: Scenegraph) {\n this._scene = scene;\n this.createFrameBorder();\n }\n\n /**\n * 创建甘特图整体外边框的图形基元。\n */\n createFrameBorder() {\n const group = this._scene.ganttGroup;\n const frameStyle = this._scene._gantt.parsedOptions.outerFrameStyle;\n if (!frameStyle) {\n return;\n }\n const { cornerRadius, borderColor, borderLineWidth, borderLineDash } = frameStyle;\n const groupAttributes: IGroupGraphicAttribute = {};\n const rectAttributes: IRectGraphicAttribute = { pickable: false };\n\n // 归一化 borderLineWidth 并设置 strokeArrayWidth\n const lineWidths = toBoxArray(borderLineWidth ?? 0);\n // 根据是否有任务列表决定是否显示左边框\n const strokeArrayWidth = [\n lineWidths[0],\n lineWidths[1],\n lineWidths[2],\n this._scene._gantt.taskListTableInstance ? 0 : lineWidths[3] // 有任务列表时左边为0,无任务列表时使用配置值\n ];\n\n rectAttributes.stroke = true;\n rectAttributes.fill = false;\n rectAttributes.stroke = borderColor;\n rectAttributes.lineWidth = Math.max(...strokeArrayWidth); // 设置主线宽\n (rectAttributes as any).strokeArrayWidth = strokeArrayWidth; // 设置四方向独立线宽\n borderLineDash && (rectAttributes.lineDash = borderLineDash as number[]);\n rectAttributes.lineCap = 'butt';\n\n // 计算 IRect 的位置和尺寸\n const hasTaskList = !!this._scene._gantt.taskListTableInstance;\n\n // 根据是否有任务列表调整位置,有任务列表时向左偏移以隐藏左边框\n rectAttributes.x = hasTaskList ? 0 : strokeArrayWidth[3] / 2;\n rectAttributes.y = strokeArrayWidth[0] / 2;\n\n const verticalSplitLineWidth = this._scene._gantt.parsedOptions.verticalSplitLine?.lineWidth ?? 0;\n rectAttributes.width =\n group.attribute.width +\n strokeArrayWidth[3] / 2 +\n strokeArrayWidth[1] / 2 +\n (hasTaskList ? verticalSplitLineWidth : 0);\n rectAttributes.height = group.attribute.height + strokeArrayWidth[0] / 2 + strokeArrayWidth[2] / 2;\n\n // 设置圆角属性\n if (cornerRadius) {\n const radius = Array.isArray(cornerRadius)\n ? cornerRadius\n : [cornerRadius, cornerRadius, cornerRadius, cornerRadius];\n if (this._scene._gantt.taskListTableInstance) {\n rectAttributes.cornerRadius = [0, radius[1] ?? 0, radius[2] ?? 0, 0];\n groupAttributes.cornerRadius = [0, radius[1] ?? 0, radius[2] ?? 0, 0];\n } else {\n rectAttributes.cornerRadius = radius as [number, number, number, number];\n groupAttributes.cornerRadius = radius as [number, number, number, number];\n }\n }\n\n group.setAttributes(groupAttributes); // 应用组属性\n\n if (rectAttributes.stroke) {\n // 创建并添加 IRect 图形基元到场景图\n const borderRect = createRect(rectAttributes);\n borderRect.name = 'border-rect';\n group.parent.insertAfter(borderRect, group);\n this.border = borderRect;\n (group as any).border = borderRect;\n }\n }\n\n /**\n * 刷新边框,移除旧边框并重新创建。\n */\n refresh() {\n if (this.border && this.border.parent) {\n this.border.parent.removeChild(this.border);\n }\n this.createFrameBorder();\n }\n\n /**\n * 更新边框尺寸和位置。\n * 在甘特图布局变化后调用,更新现有图形基元属性。\n */\n resize() {\n // 获取最新配置并计算尺寸\n const { borderLineWidth } = this._scene._gantt.parsedOptions.outerFrameStyle;\n const lineWidths = toBoxArray(borderLineWidth ?? 0);\n const strokeArrayWidth = [\n lineWidths[0],\n lineWidths[1],\n lineWidths[2],\n this._scene._gantt.taskListTableInstance ? 0 : lineWidths[3] // 有任务列表时左边为0,无任务列表时使用配置值\n ];\n const verticalSplitLineWidth = this._scene._gantt.parsedOptions.verticalSplitLine?.lineWidth ?? 0;\n\n // 更新边框矩形属性 (线宽, 位置, 尺寸)\n const hasTaskList = !!this._scene._gantt.taskListTableInstance;\n\n this.border?.setAttributes({\n // 根据是否有任务列表调整位置\n x: hasTaskList ? 0 : strokeArrayWidth[3] / 2,\n y: strokeArrayWidth[0] / 2,\n width:\n this._scene.ganttGroup.attribute.width +\n strokeArrayWidth[3] / 2 +\n strokeArrayWidth[1] / 2 +\n (hasTaskList ? verticalSplitLineWidth : 0),\n height: this._scene.ganttGroup.attribute.height + strokeArrayWidth[0] / 2 + strokeArrayWidth[2] / 2\n });\n // 更新 strokeArrayWidth 属性\n (this.border as any).strokeArrayWidth = strokeArrayWidth;\n }\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import type { IRect, IText, IGroupGraphicAttribute } from '@visactor/vtable/es/vrender';
2
+ import type { ITaskBarLabelTextStyle } from '../ts-types';
3
+ import { Group } from '@visactor/vtable/es/vrender';
4
+ export declare class GanttTaskBarNode extends Group {
5
+ milestoneTextLabel?: IText;
6
+ milestoneTextContainer?: Group;
7
+ clipGroupBox: Group;
8
+ barRect?: IRect;
9
+ progressRect?: IRect;
10
+ textLabel?: IText;
11
+ name: string;
12
+ task_index: number;
13
+ sub_task_index?: number;
14
+ record?: any;
15
+ labelStyle?: ITaskBarLabelTextStyle;
16
+ _lastWidth?: number;
17
+ _lastHeight?: number;
18
+ _lastX?: number;
19
+ _lastY?: number;
20
+ constructor(attrs: IGroupGraphicAttribute);
21
+ updateTextPosition(): void;
22
+ }
@@ -0,0 +1,64 @@
1
+ import { Group } from "@visactor/vtable/es/vrender";
2
+
3
+ import { getTextPos } from "../gantt-helper";
4
+
5
+ import { toBoxArray } from "../tools/util";
6
+
7
+ import { isValid } from "@visactor/vutils";
8
+
9
+ import { textMeasure } from "@visactor/vtable";
10
+
11
+ export class GanttTaskBarNode extends Group {
12
+ constructor(attrs) {
13
+ super(attrs), this._lastWidth = attrs.width, this._lastHeight = attrs.height, this._lastX = attrs.x,
14
+ this._lastY = attrs.y;
15
+ }
16
+ updateTextPosition() {
17
+ var _a, _b, _c;
18
+ if (!this.textLabel || !this.barRect) return;
19
+ const labelStyle = this.labelStyle || {}, {textAlign: textAlign = "left", textBaseline: textBaseline = "middle", textOverflow: textOverflow, color: color = "#333333", outsideColor: outsideColor = "#333333", padding: rawPadding = 8} = labelStyle, padding = Array.isArray(rawPadding) ? rawPadding[3] : rawPadding, barWidth = this.barRect.attribute.width, barHeight = this.barRect.attribute.height, fontSize = this.textLabel.attribute.fontSize || 12, fontFamily = this.textLabel.attribute.fontFamily || "Arial", text = String(this.textLabel.attribute.text || ""), textFitsInBar = textMeasure.measureTextWidth(text, {
20
+ fontSize: fontSize,
21
+ fontFamily: fontFamily
22
+ }) + 2 * padding <= barWidth, defaultPosition = getTextPos(toBoxArray(padding), textAlign, textBaseline, barWidth, barHeight), textPosition = labelStyle.orient || (!textFitsInBar && labelStyle.orientHandleWithOverflow ? labelStyle.orientHandleWithOverflow : null);
23
+ if (this.textLabel.setAttribute("visible", !0), this.textLabel.setAttribute("textBaseline", textBaseline),
24
+ textPosition) {
25
+ null === (_a = this.textLabel.parent) || void 0 === _a || _a.removeChild(this.textLabel),
26
+ this.appendChild(this.textLabel), this.textLabel.setAttribute("fill", outsideColor),
27
+ this.textLabel.setAttribute("ellipsis", void 0), this.textLabel.setAttribute("maxLineWidth", void 0),
28
+ this.textLabel.setAttribute("zIndex", 1e4), this.setAttribute("zIndex", 1e4);
29
+ const pos = {
30
+ left: {
31
+ x: -padding,
32
+ y: barHeight / 2,
33
+ align: "right",
34
+ baseline: "middle"
35
+ },
36
+ right: {
37
+ x: barWidth + padding,
38
+ y: barHeight / 2,
39
+ align: "left",
40
+ baseline: "middle"
41
+ },
42
+ top: {
43
+ x: barWidth / 2,
44
+ y: -padding,
45
+ align: "center",
46
+ baseline: "bottom"
47
+ },
48
+ bottom: {
49
+ x: barWidth / 2,
50
+ y: barHeight + padding,
51
+ align: "center",
52
+ baseline: "top"
53
+ }
54
+ }[textPosition];
55
+ pos && (this.textLabel.setAttribute("x", pos.x), this.textLabel.setAttribute("y", pos.y),
56
+ this.textLabel.setAttribute("textAlign", pos.align), this.textLabel.setAttribute("textBaseline", pos.baseline));
57
+ } else null === (_b = this.textLabel.parent) || void 0 === _b || _b.removeChild(this.textLabel),
58
+ null === (_c = this.clipGroupBox) || void 0 === _c || _c.appendChild(this.textLabel),
59
+ this.textLabel.setAttribute("x", defaultPosition.x), this.textLabel.setAttribute("y", defaultPosition.y),
60
+ this.textLabel.setAttribute("textAlign", textAlign), this.textLabel.setAttribute("fill", color),
61
+ this.textLabel.setAttribute("maxLineWidth", barWidth - padding), this.textLabel.setAttribute("ellipsis", "clip" === textOverflow ? "" : "ellipsis" === textOverflow ? "..." : isValid(textOverflow) ? textOverflow : void 0);
62
+ }
63
+ }
64
+ //# sourceMappingURL=gantt-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/scenegraph/gantt-node.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAiBzC,YAAY,KAA6B;QACvC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC;IACxB,CAAC;IAQD,kBAAkB;;QAChB,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,OAAO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E;gBACJ,CAAC,CAAC,YAAY,KAAK,UAAU;oBAC7B,CAAC,CAAC,KAAK;oBACP,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;wBACvB,CAAC,CAAC,YAAY;wBACd,CAAC,CAAC,SAAS,CACd,CAAC;SACH;IACH,CAAC;CACF","file":"gantt-node.js","sourcesContent":["import type { IRect, IText, IGroupGraphicAttribute } from '@visactor/vtable/es/vrender';\nimport type { ITaskBarLabelTextStyle } from '../ts-types';\nimport { Group } from '@visactor/vtable/es/vrender';\nimport { getTextPos } from '../gantt-helper';\nimport { toBoxArray } from '../tools/util';\nimport { isValid } from '@visactor/vutils';\nimport { textMeasure } from '@visactor/vtable';\n\nexport class GanttTaskBarNode extends Group {\n milestoneTextLabel?: IText;\n milestoneTextContainer?: Group;\n clipGroupBox: Group;\n barRect?: IRect;\n progressRect?: IRect;\n textLabel?: IText;\n declare name: string;\n task_index: number;\n sub_task_index?: number;\n record?: any;\n labelStyle?: ITaskBarLabelTextStyle;\n\n _lastWidth?: number;\n _lastHeight?: number;\n _lastX?: number;\n _lastY?: number;\n constructor(attrs: IGroupGraphicAttribute) {\n super(attrs);\n this._lastWidth = attrs.width;\n this._lastHeight = attrs.height;\n this._lastX = attrs.x;\n this._lastY = attrs.y;\n }\n\n /**\n * 更新任务条文本标签的位置和样式\n * @description 根据任务条的大小和配置,更新文本标签的位置、对齐方式等属性\n * orient: 直接将文本显示在指定方位位置\n * orientHandleWithOverflow: 只有当文本溢出时才在指定方位显示,当配置了orient时此配置无效\n */\n updateTextPosition() {\n if (!this.textLabel || !this.barRect) {\n return;\n }\n\n const labelStyle = this.labelStyle || {};\n const {\n textAlign = 'left',\n textBaseline = 'middle',\n textOverflow,\n color = '#333333',\n outsideColor = '#333333',\n padding: rawPadding = 8\n } = labelStyle;\n\n const padding = Array.isArray(rawPadding) ? rawPadding[3] : rawPadding;\n const barWidth = this.barRect.attribute.width;\n const barHeight = this.barRect.attribute.height;\n\n const fontSize = this.textLabel.attribute.fontSize || 12;\n const fontFamily = this.textLabel.attribute.fontFamily || 'Arial';\n const text = String(this.textLabel.attribute.text || '');\n const textWidth = textMeasure.measureTextWidth(text, { fontSize, fontFamily });\n\n const textFitsInBar = textWidth + padding * 2 <= barWidth;\n const defaultPosition = getTextPos(toBoxArray(padding), textAlign, textBaseline, barWidth, barHeight);\n const textPosition =\n labelStyle.orient ||\n (!textFitsInBar && labelStyle.orientHandleWithOverflow ? labelStyle.orientHandleWithOverflow : null);\n\n this.textLabel.setAttribute('visible', true);\n this.textLabel.setAttribute('textBaseline', textBaseline);\n\n if (textPosition) {\n this.textLabel.parent?.removeChild(this.textLabel);\n this.appendChild(this.textLabel);\n this.textLabel.setAttribute('fill', outsideColor);\n this.textLabel.setAttribute('ellipsis', undefined);\n this.textLabel.setAttribute('maxLineWidth', undefined);\n this.textLabel.setAttribute('zIndex', 10000);\n this.setAttribute('zIndex', 10000);\n\n type Position = {\n x: number;\n y: number;\n align: string;\n baseline: string;\n };\n type Positions = {\n [key: string]: Position;\n };\n\n const positions: Positions = {\n left: {\n x: -padding,\n y: barHeight / 2,\n align: 'right',\n baseline: 'middle'\n },\n right: {\n x: barWidth + padding,\n y: barHeight / 2,\n align: 'left',\n baseline: 'middle'\n },\n top: {\n x: barWidth / 2,\n y: -padding,\n align: 'center',\n baseline: 'bottom'\n },\n bottom: {\n x: barWidth / 2,\n y: barHeight + padding,\n align: 'center',\n baseline: 'top'\n }\n };\n\n const pos = positions[textPosition];\n if (pos) {\n this.textLabel.setAttribute('x', pos.x);\n this.textLabel.setAttribute('y', pos.y);\n this.textLabel.setAttribute('textAlign', pos.align);\n this.textLabel.setAttribute('textBaseline', pos.baseline);\n }\n } else {\n this.textLabel.parent?.removeChild(this.textLabel);\n this.clipGroupBox?.appendChild(this.textLabel);\n this.textLabel.setAttribute('x', defaultPosition.x);\n this.textLabel.setAttribute('y', defaultPosition.y);\n this.textLabel.setAttribute('textAlign', textAlign);\n this.textLabel.setAttribute('fill', color);\n this.textLabel.setAttribute('maxLineWidth', barWidth - padding);\n this.textLabel.setAttribute(\n 'ellipsis',\n textOverflow === 'clip'\n ? ''\n : textOverflow === 'ellipsis'\n ? '...'\n : isValid(textOverflow)\n ? textOverflow\n : undefined\n );\n }\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import type { IContext2d, IDrawContext, IMarkAttribute, IGraphicAttribute, IThemeAttribute, IGroupGraphicAttribute, IGroup, IGroupRenderContribution } from '@visactor/vtable/es/vrender';
2
+ import { BaseRenderContributionTime } from '@visactor/vtable/es/vrender';
3
+ export declare class DateHeaderGroupBeforeRenderContribution implements IGroupRenderContribution {
4
+ time: BaseRenderContributionTime;
5
+ useStyle: boolean;
6
+ order: number;
7
+ supportedAppName: string;
8
+ drawShape(group: IGroup, context: IContext2d, x: number, y: number, doFill: boolean, doStroke: boolean, fVisible: boolean, sVisible: boolean, groupAttribute: Required<IGroupGraphicAttribute>, drawContext: IDrawContext, fillCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, doFillOrStroke?: {
9
+ doFill: boolean;
10
+ doStroke: boolean;
11
+ }): void;
12
+ }
@@ -0,0 +1,32 @@
1
+ var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
2
+ var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
3
+ if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
4
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
5
+ };
6
+
7
+ import { injectable, BaseRenderContributionTime } from "@visactor/vtable/es/vrender";
8
+
9
+ let DateHeaderGroupBeforeRenderContribution = class {
10
+ constructor() {
11
+ this.time = BaseRenderContributionTime.beforeFillStroke, this.useStyle = !0, this.order = 0,
12
+ this.supportedAppName = "vtable";
13
+ }
14
+ drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke) {
15
+ "date-header-cell" === group.name && group.forEachChildren((child => {
16
+ var _a;
17
+ if ("date-header-cell-text" === child.name && !0 === child.attribute.textStick) {
18
+ const text = child;
19
+ text.setAttribute("dx", 0);
20
+ const textBounds = text.globalAABBBounds, stageBound = text.stage.globalAABBBounds, groupParent = text.parent.globalAABBBounds, intersectBounds = stageBound.intersect(groupParent);
21
+ stageBound.intersect(groupParent) && (textBounds.width() >= intersectBounds.width() && text.attribute.last_dx ? text.setAttribute("dx", null !== (_a = text.attribute.last_dx) && void 0 !== _a ? _a : 0) : stageBound.x1 >= textBounds.x1 ? (text.setAttribute("dx", stageBound.x1 - textBounds.x1),
22
+ text.setAttribute("last_dx", stageBound.x1 - textBounds.x1)) : stageBound.x2 <= textBounds.x2 && (text.setAttribute("dx", stageBound.x2 - textBounds.x2),
23
+ text.setAttribute("last_dx", stageBound.x1 - textBounds.x1)));
24
+ }
25
+ }));
26
+ }
27
+ };
28
+
29
+ DateHeaderGroupBeforeRenderContribution = __decorate([ injectable() ], DateHeaderGroupBeforeRenderContribution);
30
+
31
+ export { DateHeaderGroupBeforeRenderContribution };
32
+ //# sourceMappingURL=group-contribution-render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/scenegraph/graphic/group-contribution-render.ts"],"names":[],"mappings":";;;;;;AAUA,OAAO,EAAE,UAAU,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAO9E,IAAM,uCAAuC,GAA7C,MAAM,uCAAuC;IAA7C;QACL,SAAI,GAA+B,0BAA0B,CAAC,gBAAgB,CAAC;QAC/E,aAAQ,GAAG,IAAI,CAAC;QAChB,UAAK,GAAG,CAAC,CAAC;QACV,q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AAY,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;6BAC7D;iCAAM,IAAI,UAAU,CAAC,EAAE,IAAI,UAAU,CAAC,EAAE,EAAE;gCACzC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;gCACvD,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;6BAC7D;yBACF;qBAEF;iBACF;YACH,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;CACF,CAAA;AAxDY,uCAAuC;IADnD,UAAU,EAAE;GACA,uCAAuC,CAwDnD;SAxDY,uCAAuC","file":"group-contribution-render.js","sourcesContent":["import type {\n IContext2d,\n IDrawContext,\n IMarkAttribute,\n IGraphicAttribute,\n IThemeAttribute,\n IGroupGraphicAttribute,\n IGroup,\n IGroupRenderContribution\n} from '@visactor/vtable/es/vrender';\nimport { injectable, BaseRenderContributionTime } from '@visactor/vtable/es/vrender';\n\n// const highlightDash: number[] = [];\n\n// SplitGroupContribution处理分段渲染stroke\n// stroke/strokeArrayWidth/strokeArrayColor 为数组时调用\n@injectable()\nexport class DateHeaderGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n supportedAppName: string = 'vtable';\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n if (group.name === 'date-header-cell') {\n group.forEachChildren((child: any) => {\n if (child.name === 'date-header-cell-text' && child.attribute.textStick === true) {\n const text = child;\n text.setAttribute('dx', 0);\n const textBounds = text.globalAABBBounds;\n const stageBound = text.stage.globalAABBBounds;\n const groupParent = text.parent.globalAABBBounds;\n const intersectBounds = stageBound.intersect(groupParent);\n if (stageBound.intersect(groupParent)) {\n // if (!stageBound.contains(textBounds)) {\n if (textBounds.width() >= intersectBounds.width() && text.attribute.last_dx) {\n text.setAttribute('dx', text.attribute.last_dx ?? 0);\n } else {\n if (stageBound.x1 >= textBounds.x1) {\n text.setAttribute('dx', stageBound.x1 - textBounds.x1);\n text.setAttribute('last_dx', stageBound.x1 - textBounds.x1);\n } else if (stageBound.x2 <= textBounds.x2) {\n text.setAttribute('dx', stageBound.x2 - textBounds.x2);\n text.setAttribute('last_dx', stageBound.x1 - textBounds.x1);\n }\n }\n // }\n }\n }\n });\n }\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { ContainerModule } from '@visactor/vtable/es/vrender';
2
+ declare const _default: ContainerModule;
3
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { ContainerModule, GroupRenderContribution } from "@visactor/vtable/es/vrender";
2
+
3
+ import { DateHeaderGroupBeforeRenderContribution } from "./group-contribution-render";
4
+
5
+ export default new ContainerModule(((bind, unbind, isBound, rebind) => {
6
+ bind(DateHeaderGroupBeforeRenderContribution).toSelf().inSingletonScope(), bind(GroupRenderContribution).toService(DateHeaderGroupBeforeRenderContribution);
7
+ }));
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/scenegraph/graphic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEvF,OAAO,EAAE,uCAAuC,EAAE,MAAM,6BAA6B,CAAC;AAEtF,eAAe,IAAI,eAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAMnE,IAAI,CAAC,uCAAuC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC1E,IAAI,CAAC,uBAAuB,CAAC,CAAC,SAAS,CAAC,uCAAuC,CAAC,CAAC;AACnF,CAAC,CAAC,CAAC","file":"index.js","sourcesContent":["import { ContainerModule, GroupRenderContribution } from '@visactor/vtable/es/vrender';\n\nimport { DateHeaderGroupBeforeRenderContribution } from './group-contribution-render';\n\nexport default new ContainerModule((bind, unbind, isBound, rebind) => {\n // text 渲染器注入contributions\n // bind(TextStickBeforeRenderContribution).toSelf().inSingletonScope();\n // bind(TextRenderContribution).toService(TextStickBeforeRenderContribution);\n\n // group 渲染器注入contributions\n bind(DateHeaderGroupBeforeRenderContribution).toSelf().inSingletonScope();\n bind(GroupRenderContribution).toService(DateHeaderGroupBeforeRenderContribution);\n});\n"]}
@@ -0,0 +1,34 @@
1
+ import { Group } from '@visactor/vtable/es/vrender';
2
+ import type { Scenegraph } from './scenegraph';
3
+ import type { IGrid } from '../ts-types';
4
+ export declare class Grid {
5
+ gridStyle: IGrid;
6
+ scrollLeft: number;
7
+ scrollTop: number;
8
+ x: number;
9
+ y: number;
10
+ width: number;
11
+ height: number;
12
+ rowHeight: number;
13
+ rowCount: number;
14
+ group: Group;
15
+ verticalLineGroup: Group;
16
+ horizontalLineGroup: Group;
17
+ verticalBackgroundRectsGroup: Group;
18
+ horizontalBackgroundRectsGroup: Group;
19
+ cellBackgroundRectsGroup: Group;
20
+ allGridHeight: number;
21
+ allGridWidth: number;
22
+ _scene: Scenegraph;
23
+ constructor(scene: Scenegraph);
24
+ createTimeLineHeaderBottomLine(): void;
25
+ createVerticalLines(): void;
26
+ createHorizontalLines(): void;
27
+ createVerticalBackgroundRects(): void;
28
+ createHorizontalBackgroundRects(): void;
29
+ createCellBackgroundRects(): void;
30
+ refresh(): void;
31
+ setX(x: number): void;
32
+ setY(y: number): void;
33
+ resize(): void;
34
+ }