verben-workflow-ui 0.5.80 → 0.5.82

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 (1006) hide show
  1. package/ng-package.json +15 -0
  2. package/package.json +9 -175
  3. package/src/lib/components/actors/actors.columns.ts +40 -0
  4. package/src/lib/components/actors/actors.component.css +0 -0
  5. package/src/lib/components/actors/actors.component.html +329 -0
  6. package/src/lib/components/actors/actors.component.spec.ts +23 -0
  7. package/src/lib/components/actors/actors.component.ts +141 -0
  8. package/src/lib/components/actors/actors.facade.ts +314 -0
  9. package/src/lib/components/actors/actors.form.component.html +37 -0
  10. package/src/lib/components/actors/actors.form.component.ts +80 -0
  11. package/src/lib/components/actors/actors.model.ts +4 -0
  12. package/src/lib/components/actors/actors.module.ts +13 -0
  13. package/src/lib/components/actors/actors.service.ts +101 -0
  14. package/src/lib/components/actors/actors.state.ts +117 -0
  15. package/src/lib/components/actors/ng-package.json +6 -0
  16. package/src/lib/components/designer/components/label-editor.component.ts +188 -0
  17. package/src/lib/components/designer/components/node-selector.component.ts +210 -0
  18. package/src/lib/components/designer/components/swimlane-label.component.ts +102 -0
  19. package/src/lib/components/designer/components/swimlane-popup.component.ts +51 -0
  20. package/src/lib/components/designer/components/wf-canvas.component.ts +495 -0
  21. package/src/lib/components/designer/components/wf-designer.component.ts +185 -0
  22. package/src/lib/components/designer/components/wf-node.component.ts +91 -0
  23. package/src/lib/components/designer/components/wf-properties-popup.component.ts +257 -0
  24. package/src/lib/components/designer/components/wf-toolbar.component.ts +84 -0
  25. package/src/lib/components/designer/models/types.ts +132 -0
  26. package/src/lib/components/designer/ng-package.json +6 -0
  27. package/src/lib/components/designer/services/canvas-state.service.ts +63 -0
  28. package/src/lib/components/designer/services/connection-segment-interaction.service.ts +141 -0
  29. package/src/lib/components/designer/services/connection.service.ts +350 -0
  30. package/src/lib/components/designer/services/keyboard-handler.service.ts +39 -0
  31. package/src/lib/components/designer/services/label-management.service.ts +72 -0
  32. package/src/lib/components/designer/services/node-finder.service.ts +34 -0
  33. package/src/lib/components/designer/services/node-interaction.service.ts +135 -0
  34. package/src/lib/components/designer/services/node-placement.service.ts +77 -0
  35. package/src/lib/components/designer/services/node-precondition.service.ts +139 -0
  36. package/src/lib/components/designer/services/node-renderer.service.ts +97 -0
  37. package/src/lib/components/designer/services/node-selection.service.ts +110 -0
  38. package/src/lib/components/designer/services/orthogonal-router.service.ts +233 -0
  39. package/src/lib/components/designer/services/position-update.service.ts +56 -0
  40. package/src/lib/components/designer/services/rendering.service.ts +296 -0
  41. package/src/lib/components/designer/services/swimlane-management.service.ts +189 -0
  42. package/src/lib/components/designer/services/swimlane-stats.service.ts +53 -0
  43. package/src/lib/components/designer/services/tag-helper.service.ts +80 -0
  44. package/src/lib/components/designer/services/viewport.service.ts +30 -0
  45. package/src/lib/components/designer/services/wf-facade.service.ts +287 -0
  46. package/src/lib/components/designer/services/wf-mapper.service.ts +448 -0
  47. package/src/lib/components/designer/services/wf-persistence.service.ts +180 -0
  48. package/src/lib/components/designer/services/wf-state.service.ts +143 -0
  49. package/src/lib/components/expiration/expiration.component.css +0 -0
  50. package/src/lib/components/expiration/expiration.component.html +21 -0
  51. package/src/lib/components/expiration/expiration.component.spec.ts +23 -0
  52. package/src/lib/components/expiration/expiration.component.ts +52 -0
  53. package/src/lib/components/expiration/expiration.module.ts +11 -0
  54. package/src/lib/components/expiration/ng-package.json +6 -0
  55. package/src/lib/components/file-render/file-render.component.css +4 -0
  56. package/src/lib/components/file-render/file-render.component.html +21 -0
  57. package/src/lib/components/file-render/file-render.component.spec.ts +23 -0
  58. package/src/lib/components/file-render/file-render.component.ts +34 -0
  59. package/src/lib/components/file-render/file-render.module.ts +19 -0
  60. package/src/lib/components/file-render/ng-package.json +6 -0
  61. package/src/lib/components/file-upload/file-upload.component.css +0 -0
  62. package/src/lib/components/file-upload/file-upload.component.html +69 -0
  63. package/src/lib/components/file-upload/file-upload.component.spec.ts +23 -0
  64. package/src/lib/components/file-upload/file-upload.component.ts +87 -0
  65. package/src/lib/components/file-upload/file-upload.module.ts +40 -0
  66. package/src/lib/components/file-upload/ng-package.json +6 -0
  67. package/src/lib/components/flowable-status/flowable-status.columns.ts +23 -0
  68. package/src/lib/components/flowable-status/flowable-status.component.css +1 -0
  69. package/src/lib/components/flowable-status/flowable-status.component.html +159 -0
  70. package/src/lib/components/flowable-status/flowable-status.component.ts +147 -0
  71. package/src/lib/components/flowable-status/flowable-status.facade.ts +251 -0
  72. package/src/lib/components/flowable-status/flowable-status.form.component.html +13 -0
  73. package/src/lib/components/flowable-status/flowable-status.form.component.ts +51 -0
  74. package/src/lib/components/flowable-status/flowable-status.model.ts +3 -0
  75. package/src/lib/components/flowable-status/flowable-status.module.ts +13 -0
  76. package/src/lib/components/flowable-status/flowable-status.service.ts +62 -0
  77. package/src/lib/components/flowable-status/flowable-status.state.ts +97 -0
  78. package/src/lib/components/flowable-status/ng-package.json +6 -0
  79. package/src/lib/components/flowable-status/public-api.ts +3 -0
  80. package/src/lib/components/form-control/form-control.component.css +0 -0
  81. package/src/lib/components/form-control/form-control.component.html +254 -0
  82. package/src/lib/components/form-control/form-control.component.spec.ts +23 -0
  83. package/src/lib/components/form-control/form-control.component.ts +171 -0
  84. package/src/lib/components/form-control/form-control.module.ts +47 -0
  85. package/src/lib/components/form-control/ng-package.json +6 -0
  86. package/src/lib/components/form-group/base-table-style.ts +52 -0
  87. package/src/lib/components/form-group/form-fields/form-fields.component.css +114 -0
  88. package/src/lib/components/form-group/form-fields/form-fields.component.html +621 -0
  89. package/src/lib/components/form-group/form-fields/form-fields.component.spec.ts +23 -0
  90. package/src/lib/components/form-group/form-fields/form-fields.component.ts +1120 -0
  91. package/src/lib/components/form-group/form-fields/form-fields.module.ts +48 -0
  92. package/src/lib/components/form-group/form-fields/form-fields.service.ts +70 -0
  93. package/src/lib/components/form-group/form-fields/helper.ts +45 -0
  94. package/src/lib/components/form-group/form-group.component.css +113 -0
  95. package/src/lib/components/form-group/form-group.component.html +486 -0
  96. package/src/lib/components/form-group/form-group.component.spec.ts +22 -0
  97. package/src/lib/components/form-group/form-group.component.ts +798 -0
  98. package/src/lib/components/form-group/form-group.module.ts +54 -0
  99. package/src/lib/components/form-group/form-group.service.ts +53 -0
  100. package/src/lib/components/form-group/helper.ts +45 -0
  101. package/src/lib/components/form-group/ng-package.json +6 -0
  102. package/src/lib/components/form-response/form-response.component.css +114 -0
  103. package/src/lib/components/form-response/form-response.component.html +188 -0
  104. package/src/lib/components/form-response/form-response.component.spec.ts +23 -0
  105. package/src/lib/components/form-response/form-response.component.ts +726 -0
  106. package/src/lib/components/form-response/form-response.module.ts +48 -0
  107. package/src/lib/components/form-response/form-response.service.ts +52 -0
  108. package/src/lib/components/form-response/helper.ts +222 -0
  109. package/src/lib/components/form-response/ng-package.json +6 -0
  110. package/src/lib/components/form-timer/form-timer.component.css +0 -0
  111. package/src/lib/components/form-timer/form-timer.component.html +47 -0
  112. package/src/lib/components/form-timer/form-timer.component.spec.ts +23 -0
  113. package/src/lib/components/form-timer/form-timer.component.ts +52 -0
  114. package/src/lib/components/form-timer/form-timer.module.ts +19 -0
  115. package/src/lib/components/form-timer/ng-package.json +6 -0
  116. package/src/lib/components/forms/base-table-style.ts +52 -0
  117. package/src/lib/components/forms/forms.component.css +126 -0
  118. package/src/lib/components/forms/forms.component.html +538 -0
  119. package/src/lib/components/forms/forms.component.spec.ts +23 -0
  120. package/src/lib/components/forms/forms.component.ts +810 -0
  121. package/src/lib/components/forms/forms.module.ts +10 -0
  122. package/src/lib/components/forms/forms.service.spec.ts +16 -0
  123. package/src/lib/components/forms/forms.service.ts +65 -0
  124. package/src/lib/components/forms/ng-package.json +6 -0
  125. package/src/lib/components/journal/journal.component.css +0 -0
  126. package/src/lib/components/journal/journal.component.html +1 -0
  127. package/src/lib/components/journal/journal.component.spec.ts +23 -0
  128. package/src/lib/components/journal/journal.component.ts +10 -0
  129. package/src/lib/components/journal/journal.module.ts +10 -0
  130. package/src/lib/components/journal/ng-package.json +6 -0
  131. package/src/lib/components/my-queue/my-queue.columns.ts +32 -0
  132. package/src/lib/components/my-queue/my-queue.component.css +4 -0
  133. package/src/lib/components/my-queue/my-queue.component.html +181 -0
  134. package/src/lib/components/my-queue/my-queue.component.spec.ts +23 -0
  135. package/src/lib/components/my-queue/my-queue.component.ts +136 -0
  136. package/src/lib/components/my-queue/my-queue.facade.ts +577 -0
  137. package/src/lib/components/my-queue/my-queue.helper.ts +72 -0
  138. package/src/lib/components/my-queue/my-queue.module.ts +23 -0
  139. package/src/lib/components/my-queue/my-queue.service.spec.ts +16 -0
  140. package/src/lib/components/my-queue/my-queue.service.ts +229 -0
  141. package/src/lib/components/my-queue/my-queue.state.ts +105 -0
  142. package/src/lib/components/my-queue/ng-package.json +6 -0
  143. package/src/lib/components/my-queue/tasks.form.component.html +144 -0
  144. package/src/lib/components/my-queue/tasks.form.component.ts +152 -0
  145. package/src/lib/components/operation-popup/ng-package.json +6 -0
  146. package/src/lib/components/operation-popup/operation-popup.component.css +1 -0
  147. package/src/lib/components/operation-popup/operation-popup.component.html +107 -0
  148. package/src/lib/components/operation-popup/operation-popup.component.ts +381 -0
  149. package/src/lib/components/operation-popup/operation-popup.facade.ts +430 -0
  150. package/src/lib/components/operation-popup/operation-popup.service.ts +120 -0
  151. package/src/lib/components/operation-popup/operation-popup.state.ts +49 -0
  152. package/src/lib/components/stage-details/ng-package.json +6 -0
  153. package/src/lib/components/stage-details/stage-details.component.css +0 -0
  154. package/src/lib/components/stage-details/stage-details.component.html +95 -0
  155. package/src/lib/components/stage-details/stage-details.component.spec.ts +23 -0
  156. package/src/lib/components/stage-details/stage-details.component.ts +45 -0
  157. package/src/lib/components/stage-details/stage-details.module.ts +11 -0
  158. package/src/lib/components/task-form/ng-package.json +6 -0
  159. package/src/lib/components/task-form/task-form.component.css +0 -0
  160. package/src/lib/components/task-form/task-form.component.html +38 -0
  161. package/src/lib/components/task-form/task-form.component.spec.ts +23 -0
  162. package/src/lib/components/task-form/task-form.component.ts +15 -0
  163. package/src/lib/components/task-form/task-form.module.ts +31 -0
  164. package/src/lib/components/task-history/ng-package.json +6 -0
  165. package/src/lib/components/task-history/task-history.component.css +334 -0
  166. package/src/lib/components/task-history/task-history.component.html +145 -0
  167. package/src/lib/components/task-history/task-history.component.spec.ts +23 -0
  168. package/src/lib/components/task-history/task-history.component.ts +236 -0
  169. package/src/lib/components/task-history/task-history.module.ts +11 -0
  170. package/src/lib/components/task-history/task-history.service.ts +32 -0
  171. package/src/lib/components/task-notification/base-table-style.ts +52 -0
  172. package/src/lib/components/task-notification/ng-package.json +6 -0
  173. package/src/lib/components/task-notification/task-notification.component.css +94 -0
  174. package/src/lib/components/task-notification/task-notification.component.html +585 -0
  175. package/src/lib/components/task-notification/task-notification.component.spec.ts +23 -0
  176. package/src/lib/components/task-notification/task-notification.component.ts +770 -0
  177. package/src/lib/components/task-notification/task-notification.module.ts +10 -0
  178. package/src/lib/components/task-notification/task-notification.service.spec.ts +16 -0
  179. package/src/lib/components/task-notification/task-notification.service.ts +397 -0
  180. package/src/lib/components/tasks/ng-package.json +6 -0
  181. package/src/lib/components/tasks/tasks.columns.ts +36 -0
  182. package/src/lib/components/tasks/tasks.component.css +4 -0
  183. package/src/lib/components/tasks/tasks.component.html +215 -0
  184. package/src/lib/components/tasks/tasks.component.spec.ts +23 -0
  185. package/src/lib/components/tasks/tasks.component.ts +111 -0
  186. package/src/lib/components/tasks/tasks.facade.ts +443 -0
  187. package/src/lib/components/tasks/tasks.form.component.html +144 -0
  188. package/src/lib/components/tasks/tasks.form.component.ts +152 -0
  189. package/src/lib/components/tasks/tasks.helper.ts +72 -0
  190. package/src/lib/components/tasks/tasks.models.ts +4 -0
  191. package/src/lib/components/tasks/tasks.module.ts +28 -0
  192. package/src/lib/components/tasks/tasks.service.spec.ts +16 -0
  193. package/src/lib/components/tasks/tasks.service.ts +157 -0
  194. package/src/lib/components/tasks/tasks.state.ts +113 -0
  195. package/src/lib/components/wf/ng-package.json +6 -0
  196. package/src/lib/components/wf/wf.columns.ts +36 -0
  197. package/src/lib/components/wf/wf.component.css +0 -0
  198. package/src/lib/components/wf/wf.component.html +35 -0
  199. package/src/lib/components/wf/wf.component.spec.ts +23 -0
  200. package/src/lib/components/wf/wf.component.ts +72 -0
  201. package/src/lib/components/wf/wf.facade.ts +274 -0
  202. package/src/lib/components/wf/wf.helper.ts +23 -0
  203. package/src/lib/components/wf/wf.module.ts +14 -0
  204. package/src/lib/components/wf/wf.service.spec.ts +16 -0
  205. package/src/lib/components/wf/wf.service.ts +98 -0
  206. package/src/lib/components/wf/wf.state.ts +99 -0
  207. package/src/lib/components/workflow/column.ts +40 -0
  208. package/src/lib/components/workflow/helper.ts +53 -0
  209. package/src/lib/components/workflow/ng-package.json +6 -0
  210. package/src/lib/components/workflow/table-style.ts +53 -0
  211. package/src/lib/components/workflow/workflow.component.css +0 -0
  212. package/src/lib/components/workflow/workflow.component.html +226 -0
  213. package/src/lib/components/workflow/workflow.component.spec.ts +23 -0
  214. package/src/lib/components/workflow/workflow.component.ts +230 -0
  215. package/src/lib/components/workflow/workflow.module.ts +11 -0
  216. package/src/lib/components/workflow-designer/action-dialog/action-dialog.component.css +9 -0
  217. package/src/lib/components/workflow-designer/action-dialog/action-dialog.component.html +56 -0
  218. package/src/lib/components/workflow-designer/action-dialog/action-dialog.component.spec.ts +23 -0
  219. package/src/lib/components/workflow-designer/action-dialog/action-dialog.component.ts +136 -0
  220. package/src/lib/components/workflow-designer/actor-tags-dialog/actor-tags-dialog.component.css +0 -0
  221. package/src/lib/components/workflow-designer/actor-tags-dialog/actor-tags-dialog.component.html +45 -0
  222. package/src/lib/components/workflow-designer/actor-tags-dialog/actor-tags-dialog.component.ts +75 -0
  223. package/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.css +7 -0
  224. package/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.html +89 -0
  225. package/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.spec.ts +23 -0
  226. package/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.ts +76 -0
  227. package/src/lib/components/workflow-designer/decision-popup/decision-popup.component.css +11 -0
  228. package/src/lib/components/workflow-designer/decision-popup/decision-popup.component.html +74 -0
  229. package/src/lib/components/workflow-designer/decision-popup/decision-popup.component.spec.ts +23 -0
  230. package/src/lib/components/workflow-designer/decision-popup/decision-popup.component.ts +61 -0
  231. package/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.css +70 -0
  232. package/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.html +454 -0
  233. package/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.spec.ts +23 -0
  234. package/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.ts +1620 -0
  235. package/src/lib/components/workflow-designer/designer-canvas/designer-canvas.connection-drop.spec.ts +100 -0
  236. package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.css +63 -0
  237. package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.html +49 -0
  238. package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.spec.ts +23 -0
  239. package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.ts +73 -0
  240. package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.types.ts +7 -0
  241. package/src/lib/components/workflow-designer/docs/01-architecture.md +145 -0
  242. package/src/lib/components/workflow-designer/docs/02-coordinate-system.md +170 -0
  243. package/src/lib/components/workflow-designer/docs/03-data-model.md +163 -0
  244. package/src/lib/components/workflow-designer/docs/04-interactions.md +156 -0
  245. package/src/lib/components/workflow-designer/docs/05-persistence.md +107 -0
  246. package/src/lib/components/workflow-designer/docs/06-known-issues.md +126 -0
  247. package/src/lib/components/workflow-designer/docs/README.md +71 -0
  248. package/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.css +9 -0
  249. package/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.html +94 -0
  250. package/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.spec.ts +23 -0
  251. package/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.ts +272 -0
  252. package/src/lib/components/workflow-designer/ng-package.json +6 -0
  253. package/src/lib/components/workflow-designer/services/connection.service.ts +309 -0
  254. package/src/lib/components/workflow-designer/services/node-management.service.ts +351 -0
  255. package/src/lib/components/workflow-designer/services/popup.service.ts +271 -0
  256. package/src/lib/components/workflow-designer/services/swimlane.service.ts +163 -0
  257. package/src/lib/components/workflow-designer/services/transformer.service.ts +301 -0
  258. package/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.css +0 -0
  259. package/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.html +208 -0
  260. package/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.spec.ts +23 -0
  261. package/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.ts +190 -0
  262. package/src/lib/components/workflow-designer/stage-node/stage-node.component.css +15 -0
  263. package/src/lib/components/workflow-designer/stage-node/stage-node.component.html +93 -0
  264. package/src/lib/components/workflow-designer/stage-node/stage-node.component.spec.ts +23 -0
  265. package/src/lib/components/workflow-designer/stage-node/stage-node.component.ts +253 -0
  266. package/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.css +0 -0
  267. package/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.html +151 -0
  268. package/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.spec.ts +23 -0
  269. package/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.ts +149 -0
  270. package/src/lib/components/workflow-designer/workflow-data.service.spec.ts +16 -0
  271. package/src/lib/components/workflow-designer/workflow-data.service.ts +266 -0
  272. package/src/lib/components/workflow-designer/workflow-designer.component.css +59 -0
  273. package/src/lib/components/workflow-designer/workflow-designer.component.html +29 -0
  274. package/src/lib/components/workflow-designer/workflow-designer.component.spec.ts +23 -0
  275. package/src/lib/components/workflow-designer/workflow-designer.component.ts +515 -0
  276. package/src/lib/components/workflow-designer/workflow-designer.models.ts +102 -0
  277. package/src/lib/components/workflow-designer/workflow-designer.module.ts +69 -0
  278. package/src/lib/components/workflow-designer/workflow-designer.state.ts +953 -0
  279. package/src/lib/components/workflow-designer/workflow-designer.types.ts +61 -0
  280. package/src/lib/components/workflow-stage/workflow-stage.component.css +24 -0
  281. package/src/lib/components/workflow-stage/workflow-stage.component.html +201 -0
  282. package/src/lib/components/workflow-stage/workflow-stage.component.spec.ts +23 -0
  283. package/src/lib/components/workflow-stage/workflow-stage.component.ts +179 -0
  284. package/src/lib/components/workflow-stage/workflow-stage.module.ts +55 -0
  285. package/src/lib/components/workflows/ng-package.json +6 -0
  286. package/src/lib/components/workflows/workflow-form/workflow-form.component.css +0 -0
  287. package/src/lib/components/workflows/workflow-form/workflow-form.component.html +128 -0
  288. package/src/lib/components/workflows/workflow-form/workflow-form.component.spec.ts +23 -0
  289. package/src/lib/components/workflows/workflow-form/workflow-form.component.ts +87 -0
  290. package/src/lib/components/workflows/workflows.columns.ts +36 -0
  291. package/src/lib/components/workflows/workflows.component.css +4 -0
  292. package/src/lib/components/workflows/workflows.component.html +271 -0
  293. package/src/lib/components/workflows/workflows.component.spec.ts +23 -0
  294. package/src/lib/components/workflows/workflows.component.ts +214 -0
  295. package/src/lib/components/workflows/workflows.facade.ts +386 -0
  296. package/src/lib/components/workflows/workflows.helper.ts +23 -0
  297. package/src/lib/components/workflows/workflows.module.ts +14 -0
  298. package/src/lib/components/workflows/workflows.service.spec.ts +16 -0
  299. package/src/lib/components/workflows/workflows.service.ts +161 -0
  300. package/src/lib/components/workflows/workflows.state.ts +106 -0
  301. package/src/lib/models/ActionHistory.ts +17 -0
  302. package/src/lib/models/ActionType.ts +9 -0
  303. package/src/lib/models/Actor.ts +12 -0
  304. package/src/lib/models/ActorTag.ts +8 -0
  305. package/src/lib/models/Coord.ts +4 -0
  306. package/src/lib/models/DataType.ts +25 -0
  307. package/src/lib/models/EAVEntity.ts +5 -0
  308. package/src/lib/models/ErrorResponse.ts +7 -0
  309. package/src/lib/models/Escalation.ts +15 -0
  310. package/src/lib/models/EscalationCycle.ts +13 -0
  311. package/src/lib/models/EscalationStage.ts +11 -0
  312. package/src/lib/models/EscalationType.ts +5 -0
  313. package/src/lib/models/File.ts +8 -0
  314. package/src/lib/models/FilterTypes.ts +8 -0
  315. package/src/lib/models/FlowableStatus.ts +6 -0
  316. package/src/lib/models/Form.ts +14 -0
  317. package/src/lib/models/FormEntity.ts +14 -0
  318. package/src/lib/models/FormFill.ts +16 -0
  319. package/src/lib/models/FormProperty.ts +16 -0
  320. package/src/lib/models/FormValues.ts +16 -0
  321. package/src/lib/models/MailConfig.ts +13 -0
  322. package/src/lib/models/MessageConfig.ts +5 -0
  323. package/src/lib/models/MessageMedium.ts +4 -0
  324. package/src/lib/models/OperationAction.ts +15 -0
  325. package/src/lib/models/PagedResult.ts +5 -0
  326. package/src/lib/models/PeriodMode.ts +10 -0
  327. package/src/lib/models/PermissionConfig.ts +8 -0
  328. package/src/lib/models/ReportSchedule.ts +23 -0
  329. package/src/lib/models/ReportType.ts +5 -0
  330. package/src/lib/models/Resource.ts +57 -0
  331. package/src/lib/models/ResponseKeyValue.ts +5 -0
  332. package/src/lib/models/SMSConfig.ts +11 -0
  333. package/src/lib/models/SearchDynamicWrapper.ts +6 -0
  334. package/src/lib/models/SearchOperator.ts +4 -0
  335. package/src/lib/models/SearchPropertySign.ts +9 -0
  336. package/src/lib/models/SearchPropertyValue.ts +13 -0
  337. package/src/lib/models/SearchPropertyValueType.ts +9 -0
  338. package/src/lib/models/Size.ts +4 -0
  339. package/src/lib/models/SortDirection.ts +5 -0
  340. package/src/lib/models/StageActorRule.ts +6 -0
  341. package/src/lib/models/SwimLane.ts +14 -0
  342. package/src/lib/models/Tag.ts +7 -0
  343. package/src/lib/models/Task.ts +23 -0
  344. package/src/lib/models/TaskAssignmentType.ts +4 -0
  345. package/src/lib/models/TaskNotification.ts +16 -0
  346. package/src/lib/models/TaskNotificationMessageType.ts +4 -0
  347. package/src/lib/models/TaskNotificationType.ts +6 -0
  348. package/src/lib/models/TaskStatus.ts +7 -0
  349. package/src/lib/models/Workflow.ts +21 -0
  350. package/src/lib/models/WorkflowAction.ts +14 -0
  351. package/src/lib/models/WorkflowOperation.ts +7 -0
  352. package/src/lib/models/WorkflowStage.ts +27 -0
  353. package/src/lib/models/actors.ts +10 -0
  354. package/src/lib/models/auth-mechanism.ts +14 -0
  355. package/src/lib/models/base.ts +12 -0
  356. package/src/lib/models/ng-package.json +6 -0
  357. package/src/lib/models/object-state.ts +6 -0
  358. package/src/lib/models/operation-type.ts +6 -0
  359. package/src/lib/models/paged.ts +9 -0
  360. package/src/lib/models/query-params.ts +9 -0
  361. package/src/lib/models/status.ts +5 -0
  362. package/src/lib/models/task-history.ts +14 -0
  363. package/src/lib/models/user-access-request-status.ts +5 -0
  364. package/src/lib/models/user.ts +24 -0
  365. package/src/lib/pipes/async-label.pipe.spec.ts +8 -0
  366. package/src/lib/pipes/async-label.pipe.ts +30 -0
  367. package/src/lib/pipes/ng-package.json +6 -0
  368. package/src/lib/services/environment.service.spec.ts +16 -0
  369. package/src/lib/services/environment.service.ts +32 -0
  370. package/src/lib/services/http-web-request.service.spec.ts +16 -0
  371. package/src/lib/services/http-web-request.service.ts +118 -0
  372. package/src/lib/services/label.service.spec.ts +16 -0
  373. package/src/lib/services/label.service.ts +182 -0
  374. package/src/lib/services/ng-package.json +6 -0
  375. package/src/lib/services/public-api.ts +5 -0
  376. package/src/lib/services/util.service.spec.ts +16 -0
  377. package/src/lib/services/util.service.ts +58 -0
  378. package/src/lib/shared/base-table-style.ts +56 -0
  379. package/src/lib/shared/components/base-data-view.component.ts +191 -0
  380. package/src/lib/shared/components/base-model-field.ts +31 -0
  381. package/src/lib/shared/models/DataViewConfig.ts +19 -0
  382. package/src/lib/shared/ng-package.json +6 -0
  383. package/src/lib/shared/public-api.ts +14 -0
  384. package/src/lib/shared/shared.module.ts +67 -0
  385. package/src/lib/utils/index.ts +1 -0
  386. package/src/lib/utils/public-api.ts +2 -0
  387. package/src/lib/utils/store.ts +50 -0
  388. package/src/public-api.ts +54 -0
  389. package/src/styles.css +96 -0
  390. package/tailwind.config copy.js +33 -0
  391. package/tailwind.config.js +20 -0
  392. package/tsconfig.lib.json +15 -0
  393. package/tsconfig.lib.prod.json +11 -0
  394. package/tsconfig.spec.json +15 -0
  395. package/esm2022/public-api.mjs +0 -39
  396. package/esm2022/src/lib/components/actors/actors.columns.mjs +0 -39
  397. package/esm2022/src/lib/components/actors/actors.component.mjs +0 -129
  398. package/esm2022/src/lib/components/actors/actors.facade.mjs +0 -253
  399. package/esm2022/src/lib/components/actors/actors.form.component.mjs +0 -78
  400. package/esm2022/src/lib/components/actors/actors.module.mjs +0 -21
  401. package/esm2022/src/lib/components/actors/actors.service.mjs +0 -78
  402. package/esm2022/src/lib/components/actors/actors.state.mjs +0 -100
  403. package/esm2022/src/lib/components/actors/index.mjs +0 -2
  404. package/esm2022/src/lib/components/actors/public-api.mjs +0 -3
  405. package/esm2022/src/lib/components/actors/verben-workflow-ui-src-lib-components-actors.mjs +0 -5
  406. package/esm2022/src/lib/components/designer/components/label-editor.component.mjs +0 -148
  407. package/esm2022/src/lib/components/designer/components/node-selector.component.mjs +0 -319
  408. package/esm2022/src/lib/components/designer/components/swimlane-label.component.mjs +0 -161
  409. package/esm2022/src/lib/components/designer/components/swimlane-popup.component.mjs +0 -85
  410. package/esm2022/src/lib/components/designer/components/wf-canvas.component.mjs +0 -715
  411. package/esm2022/src/lib/components/designer/components/wf-designer.component.mjs +0 -138
  412. package/esm2022/src/lib/components/designer/components/wf-toolbar.component.mjs +0 -56
  413. package/esm2022/src/lib/components/designer/index.mjs +0 -2
  414. package/esm2022/src/lib/components/designer/models/types.mjs +0 -2
  415. package/esm2022/src/lib/components/designer/public-api.mjs +0 -3
  416. package/esm2022/src/lib/components/designer/services/canvas-state.service.mjs +0 -50
  417. package/esm2022/src/lib/components/designer/services/connection-segment-interaction.service.mjs +0 -108
  418. package/esm2022/src/lib/components/designer/services/connection.service.mjs +0 -266
  419. package/esm2022/src/lib/components/designer/services/keyboard-handler.service.mjs +0 -43
  420. package/esm2022/src/lib/components/designer/services/label-management.service.mjs +0 -66
  421. package/esm2022/src/lib/components/designer/services/node-finder.service.mjs +0 -30
  422. package/esm2022/src/lib/components/designer/services/node-interaction.service.mjs +0 -108
  423. package/esm2022/src/lib/components/designer/services/node-precondition.service.mjs +0 -109
  424. package/esm2022/src/lib/components/designer/services/node-selection.service.mjs +0 -96
  425. package/esm2022/src/lib/components/designer/services/orthogonal-router.service.mjs +0 -167
  426. package/esm2022/src/lib/components/designer/services/position-update.service.mjs +0 -45
  427. package/esm2022/src/lib/components/designer/services/rendering.service.mjs +0 -236
  428. package/esm2022/src/lib/components/designer/services/swimlane-management.service.mjs +0 -145
  429. package/esm2022/src/lib/components/designer/services/swimlane-stats.service.mjs +0 -44
  430. package/esm2022/src/lib/components/designer/services/viewport.service.mjs +0 -30
  431. package/esm2022/src/lib/components/designer/services/wf-facade.service.mjs +0 -239
  432. package/esm2022/src/lib/components/designer/services/wf-mapper.service.mjs +0 -324
  433. package/esm2022/src/lib/components/designer/services/wf-persistence.service.mjs +0 -167
  434. package/esm2022/src/lib/components/designer/services/wf-state.service.mjs +0 -108
  435. package/esm2022/src/lib/components/designer/verben-workflow-ui-src-lib-components-designer.mjs +0 -5
  436. package/esm2022/src/lib/components/expiration/expiration.component.mjs +0 -49
  437. package/esm2022/src/lib/components/expiration/expiration.module.mjs +0 -19
  438. package/esm2022/src/lib/components/expiration/index.mjs +0 -2
  439. package/esm2022/src/lib/components/expiration/public-api.mjs +0 -3
  440. package/esm2022/src/lib/components/expiration/verben-workflow-ui-src-lib-components-expiration.mjs +0 -5
  441. package/esm2022/src/lib/components/file-render/file-render.component.mjs +0 -45
  442. package/esm2022/src/lib/components/file-render/file-render.module.mjs +0 -35
  443. package/esm2022/src/lib/components/file-render/index.mjs +0 -2
  444. package/esm2022/src/lib/components/file-render/public-api.mjs +0 -3
  445. package/esm2022/src/lib/components/file-render/verben-workflow-ui-src-lib-components-file-render.mjs +0 -5
  446. package/esm2022/src/lib/components/file-upload/file-upload.component.mjs +0 -93
  447. package/esm2022/src/lib/components/file-upload/file-upload.module.mjs +0 -63
  448. package/esm2022/src/lib/components/file-upload/index.mjs +0 -2
  449. package/esm2022/src/lib/components/file-upload/public-api.mjs +0 -3
  450. package/esm2022/src/lib/components/file-upload/verben-workflow-ui-src-lib-components-file-upload.mjs +0 -5
  451. package/esm2022/src/lib/components/flowable-status/flowable-status.columns.mjs +0 -21
  452. package/esm2022/src/lib/components/flowable-status/flowable-status.component.mjs +0 -136
  453. package/esm2022/src/lib/components/flowable-status/flowable-status.facade.mjs +0 -207
  454. package/esm2022/src/lib/components/flowable-status/flowable-status.form.component.mjs +0 -52
  455. package/esm2022/src/lib/components/flowable-status/flowable-status.module.mjs +0 -21
  456. package/esm2022/src/lib/components/flowable-status/flowable-status.service.mjs +0 -54
  457. package/esm2022/src/lib/components/flowable-status/flowable-status.state.mjs +0 -85
  458. package/esm2022/src/lib/components/flowable-status/index.mjs +0 -2
  459. package/esm2022/src/lib/components/flowable-status/public-api.mjs +0 -3
  460. package/esm2022/src/lib/components/flowable-status/verben-workflow-ui-src-lib-components-flowable-status.mjs +0 -5
  461. package/esm2022/src/lib/components/form-control/form-control.component.mjs +0 -157
  462. package/esm2022/src/lib/components/form-control/form-control.module.mjs +0 -75
  463. package/esm2022/src/lib/components/form-control/index.mjs +0 -2
  464. package/esm2022/src/lib/components/form-control/public-api.mjs +0 -3
  465. package/esm2022/src/lib/components/form-control/verben-workflow-ui-src-lib-components-form-control.mjs +0 -5
  466. package/esm2022/src/lib/components/form-group/base-table-style.mjs +0 -53
  467. package/esm2022/src/lib/components/form-group/form-fields/form-fields.component.mjs +0 -958
  468. package/esm2022/src/lib/components/form-group/form-fields/form-fields.module.mjs +0 -75
  469. package/esm2022/src/lib/components/form-group/form-fields/form-fields.service.mjs +0 -73
  470. package/esm2022/src/lib/components/form-group/form-group.component.mjs +0 -707
  471. package/esm2022/src/lib/components/form-group/form-group.module.mjs +0 -85
  472. package/esm2022/src/lib/components/form-group/form-group.service.mjs +0 -56
  473. package/esm2022/src/lib/components/form-group/index.mjs +0 -2
  474. package/esm2022/src/lib/components/form-group/public-api.mjs +0 -5
  475. package/esm2022/src/lib/components/form-group/verben-workflow-ui-src-lib-components-form-group.mjs +0 -5
  476. package/esm2022/src/lib/components/form-response/form-response.component.mjs +0 -645
  477. package/esm2022/src/lib/components/form-response/form-response.module.mjs +0 -76
  478. package/esm2022/src/lib/components/form-response/form-response.service.mjs +0 -54
  479. package/esm2022/src/lib/components/form-response/index.mjs +0 -2
  480. package/esm2022/src/lib/components/form-response/public-api.mjs +0 -3
  481. package/esm2022/src/lib/components/form-response/verben-workflow-ui-src-lib-components-form-response.mjs +0 -5
  482. package/esm2022/src/lib/components/form-timer/form-timer.component.mjs +0 -50
  483. package/esm2022/src/lib/components/form-timer/form-timer.module.mjs +0 -28
  484. package/esm2022/src/lib/components/form-timer/index.mjs +0 -2
  485. package/esm2022/src/lib/components/form-timer/public-api.mjs +0 -3
  486. package/esm2022/src/lib/components/form-timer/verben-workflow-ui-src-lib-components-form-timer.mjs +0 -5
  487. package/esm2022/src/lib/components/forms/base-table-style.mjs +0 -53
  488. package/esm2022/src/lib/components/forms/forms.component.mjs +0 -673
  489. package/esm2022/src/lib/components/forms/forms.module.mjs +0 -18
  490. package/esm2022/src/lib/components/forms/forms.service.mjs +0 -68
  491. package/esm2022/src/lib/components/forms/index.mjs +0 -2
  492. package/esm2022/src/lib/components/forms/public-api.mjs +0 -3
  493. package/esm2022/src/lib/components/forms/verben-workflow-ui-src-lib-components-forms.mjs +0 -5
  494. package/esm2022/src/lib/components/journal/index.mjs +0 -2
  495. package/esm2022/src/lib/components/journal/journal.component.mjs +0 -11
  496. package/esm2022/src/lib/components/journal/journal.module.mjs +0 -18
  497. package/esm2022/src/lib/components/journal/public-api.mjs +0 -3
  498. package/esm2022/src/lib/components/journal/verben-workflow-ui-src-lib-components-journal.mjs +0 -5
  499. package/esm2022/src/lib/components/my-queue/index.mjs +0 -2
  500. package/esm2022/src/lib/components/my-queue/my-queue.columns.mjs +0 -29
  501. package/esm2022/src/lib/components/my-queue/my-queue.component.mjs +0 -142
  502. package/esm2022/src/lib/components/my-queue/my-queue.facade.mjs +0 -469
  503. package/esm2022/src/lib/components/my-queue/my-queue.module.mjs +0 -40
  504. package/esm2022/src/lib/components/my-queue/my-queue.service.mjs +0 -138
  505. package/esm2022/src/lib/components/my-queue/my-queue.state.mjs +0 -90
  506. package/esm2022/src/lib/components/my-queue/public-api.mjs +0 -4
  507. package/esm2022/src/lib/components/my-queue/tasks.form.component.mjs +0 -147
  508. package/esm2022/src/lib/components/my-queue/verben-workflow-ui-src-lib-components-my-queue.mjs +0 -5
  509. package/esm2022/src/lib/components/operation-popup/index.mjs +0 -2
  510. package/esm2022/src/lib/components/operation-popup/operation-popup.component.mjs +0 -353
  511. package/esm2022/src/lib/components/operation-popup/operation-popup.facade.mjs +0 -352
  512. package/esm2022/src/lib/components/operation-popup/operation-popup.service.mjs +0 -71
  513. package/esm2022/src/lib/components/operation-popup/operation-popup.state.mjs +0 -44
  514. package/esm2022/src/lib/components/operation-popup/public-api.mjs +0 -2
  515. package/esm2022/src/lib/components/operation-popup/verben-workflow-ui-src-lib-components-operation-popup.mjs +0 -5
  516. package/esm2022/src/lib/components/stage-details/index.mjs +0 -2
  517. package/esm2022/src/lib/components/stage-details/public-api.mjs +0 -3
  518. package/esm2022/src/lib/components/stage-details/stage-details.component.mjs +0 -51
  519. package/esm2022/src/lib/components/stage-details/stage-details.module.mjs +0 -19
  520. package/esm2022/src/lib/components/stage-details/verben-workflow-ui-src-lib-components-stage-details.mjs +0 -5
  521. package/esm2022/src/lib/components/task-form/index.mjs +0 -2
  522. package/esm2022/src/lib/components/task-form/public-api.mjs +0 -3
  523. package/esm2022/src/lib/components/task-form/task-form.component.mjs +0 -18
  524. package/esm2022/src/lib/components/task-form/task-form.module.mjs +0 -72
  525. package/esm2022/src/lib/components/task-form/verben-workflow-ui-src-lib-components-task-form.mjs +0 -5
  526. package/esm2022/src/lib/components/task-history/index.mjs +0 -2
  527. package/esm2022/src/lib/components/task-history/public-api.mjs +0 -3
  528. package/esm2022/src/lib/components/task-history/task-history.component.mjs +0 -221
  529. package/esm2022/src/lib/components/task-history/task-history.module.mjs +0 -20
  530. package/esm2022/src/lib/components/task-history/task-history.service.mjs +0 -32
  531. package/esm2022/src/lib/components/task-history/verben-workflow-ui-src-lib-components-task-history.mjs +0 -5
  532. package/esm2022/src/lib/components/task-notification/base-table-style.mjs +0 -53
  533. package/esm2022/src/lib/components/task-notification/index.mjs +0 -2
  534. package/esm2022/src/lib/components/task-notification/public-api.mjs +0 -3
  535. package/esm2022/src/lib/components/task-notification/task-notification.component.mjs +0 -670
  536. package/esm2022/src/lib/components/task-notification/task-notification.module.mjs +0 -18
  537. package/esm2022/src/lib/components/task-notification/task-notification.service.mjs +0 -256
  538. package/esm2022/src/lib/components/task-notification/verben-workflow-ui-src-lib-components-task-notification.mjs +0 -5
  539. package/esm2022/src/lib/components/tasks/index.mjs +0 -2
  540. package/esm2022/src/lib/components/tasks/public-api.mjs +0 -6
  541. package/esm2022/src/lib/components/tasks/tasks.columns.mjs +0 -34
  542. package/esm2022/src/lib/components/tasks/tasks.component.mjs +0 -113
  543. package/esm2022/src/lib/components/tasks/tasks.facade.mjs +0 -355
  544. package/esm2022/src/lib/components/tasks/tasks.form.component.mjs +0 -147
  545. package/esm2022/src/lib/components/tasks/tasks.models.mjs +0 -4
  546. package/esm2022/src/lib/components/tasks/tasks.module.mjs +0 -48
  547. package/esm2022/src/lib/components/tasks/tasks.service.mjs +0 -106
  548. package/esm2022/src/lib/components/tasks/tasks.state.mjs +0 -96
  549. package/esm2022/src/lib/components/tasks/verben-workflow-ui-src-lib-components-tasks.mjs +0 -5
  550. package/esm2022/src/lib/components/wf/index.mjs +0 -2
  551. package/esm2022/src/lib/components/wf/public-api.mjs +0 -4
  552. package/esm2022/src/lib/components/wf/verben-workflow-ui-src-lib-components-wf.mjs +0 -5
  553. package/esm2022/src/lib/components/wf/wf.columns.mjs +0 -34
  554. package/esm2022/src/lib/components/wf/wf.component.mjs +0 -69
  555. package/esm2022/src/lib/components/wf/wf.module.mjs +0 -22
  556. package/esm2022/src/lib/components/wf/wf.service.mjs +0 -82
  557. package/esm2022/src/lib/components/workflow/column.mjs +0 -38
  558. package/esm2022/src/lib/components/workflow/helper.mjs +0 -47
  559. package/esm2022/src/lib/components/workflow/index.mjs +0 -2
  560. package/esm2022/src/lib/components/workflow/public-api.mjs +0 -4
  561. package/esm2022/src/lib/components/workflow/table-style.mjs +0 -53
  562. package/esm2022/src/lib/components/workflow/verben-workflow-ui-src-lib-components-workflow.mjs +0 -5
  563. package/esm2022/src/lib/components/workflow/workflow.component.mjs +0 -216
  564. package/esm2022/src/lib/components/workflow/workflow.module.mjs +0 -19
  565. package/esm2022/src/lib/components/workflow-designer/action-dialog/action-dialog.component.mjs +0 -119
  566. package/esm2022/src/lib/components/workflow-designer/actor-tags-dialog/actor-tags-dialog.component.mjs +0 -70
  567. package/esm2022/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.mjs +0 -76
  568. package/esm2022/src/lib/components/workflow-designer/decision-popup/decision-popup.component.mjs +0 -65
  569. package/esm2022/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.mjs +0 -1226
  570. package/esm2022/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.mjs +0 -83
  571. package/esm2022/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.types.mjs +0 -2
  572. package/esm2022/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.mjs +0 -238
  573. package/esm2022/src/lib/components/workflow-designer/index.mjs +0 -2
  574. package/esm2022/src/lib/components/workflow-designer/public-api.mjs +0 -5
  575. package/esm2022/src/lib/components/workflow-designer/services/connection.service.mjs +0 -222
  576. package/esm2022/src/lib/components/workflow-designer/services/node-management.service.mjs +0 -300
  577. package/esm2022/src/lib/components/workflow-designer/services/popup.service.mjs +0 -235
  578. package/esm2022/src/lib/components/workflow-designer/services/swimlane.service.mjs +0 -145
  579. package/esm2022/src/lib/components/workflow-designer/services/transformer.service.mjs +0 -263
  580. package/esm2022/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.mjs +0 -175
  581. package/esm2022/src/lib/components/workflow-designer/stage-node/stage-node.component.mjs +0 -217
  582. package/esm2022/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.mjs +0 -131
  583. package/esm2022/src/lib/components/workflow-designer/verben-workflow-ui-src-lib-components-workflow-designer.mjs +0 -5
  584. package/esm2022/src/lib/components/workflow-designer/workflow-data.service.mjs +0 -186
  585. package/esm2022/src/lib/components/workflow-designer/workflow-designer.component.mjs +0 -408
  586. package/esm2022/src/lib/components/workflow-designer/workflow-designer.module.mjs +0 -107
  587. package/esm2022/src/lib/components/workflow-designer/workflow-designer.state.mjs +0 -759
  588. package/esm2022/src/lib/components/workflow-designer/workflow-designer.types.mjs +0 -2
  589. package/esm2022/src/lib/components/workflows/index.mjs +0 -2
  590. package/esm2022/src/lib/components/workflows/public-api.mjs +0 -4
  591. package/esm2022/src/lib/components/workflows/verben-workflow-ui-src-lib-components-workflows.mjs +0 -5
  592. package/esm2022/src/lib/components/workflows/workflow-form/workflow-form.component.mjs +0 -91
  593. package/esm2022/src/lib/components/workflows/workflows.columns.mjs +0 -34
  594. package/esm2022/src/lib/components/workflows/workflows.component.mjs +0 -190
  595. package/esm2022/src/lib/components/workflows/workflows.facade.mjs +0 -306
  596. package/esm2022/src/lib/components/workflows/workflows.helper.mjs +0 -21
  597. package/esm2022/src/lib/components/workflows/workflows.module.mjs +0 -21
  598. package/esm2022/src/lib/components/workflows/workflows.service.mjs +0 -122
  599. package/esm2022/src/lib/components/workflows/workflows.state.mjs +0 -92
  600. package/esm2022/src/lib/models/ActionHistory.mjs +0 -2
  601. package/esm2022/src/lib/models/ActionType.mjs +0 -11
  602. package/esm2022/src/lib/models/Actor.mjs +0 -2
  603. package/esm2022/src/lib/models/ActorTag.mjs +0 -2
  604. package/esm2022/src/lib/models/Coord.mjs +0 -2
  605. package/esm2022/src/lib/models/DataType.mjs +0 -27
  606. package/esm2022/src/lib/models/EAVEntity.mjs +0 -2
  607. package/esm2022/src/lib/models/ErrorResponse.mjs +0 -11
  608. package/esm2022/src/lib/models/Escalation.mjs +0 -2
  609. package/esm2022/src/lib/models/EscalationCycle.mjs +0 -2
  610. package/esm2022/src/lib/models/EscalationStage.mjs +0 -2
  611. package/esm2022/src/lib/models/EscalationType.mjs +0 -7
  612. package/esm2022/src/lib/models/File.mjs +0 -2
  613. package/esm2022/src/lib/models/FilterTypes.mjs +0 -9
  614. package/esm2022/src/lib/models/FlowableStatus.mjs +0 -2
  615. package/esm2022/src/lib/models/Form.mjs +0 -2
  616. package/esm2022/src/lib/models/FormEntity.mjs +0 -2
  617. package/esm2022/src/lib/models/FormFill.mjs +0 -6
  618. package/esm2022/src/lib/models/FormProperty.mjs +0 -2
  619. package/esm2022/src/lib/models/FormValues.mjs +0 -2
  620. package/esm2022/src/lib/models/MailConfig.mjs +0 -2
  621. package/esm2022/src/lib/models/MessageConfig.mjs +0 -2
  622. package/esm2022/src/lib/models/MessageMedium.mjs +0 -6
  623. package/esm2022/src/lib/models/OperationAction.mjs +0 -2
  624. package/esm2022/src/lib/models/PagedResult.mjs +0 -2
  625. package/esm2022/src/lib/models/PeriodMode.mjs +0 -12
  626. package/esm2022/src/lib/models/PermissionConfig.mjs +0 -2
  627. package/esm2022/src/lib/models/ReportSchedule.mjs +0 -2
  628. package/esm2022/src/lib/models/ReportType.mjs +0 -7
  629. package/esm2022/src/lib/models/Resource.mjs +0 -47
  630. package/esm2022/src/lib/models/ResponseKeyValue.mjs +0 -2
  631. package/esm2022/src/lib/models/SMSConfig.mjs +0 -2
  632. package/esm2022/src/lib/models/SearchDynamicWrapper.mjs +0 -2
  633. package/esm2022/src/lib/models/SearchOperator.mjs +0 -6
  634. package/esm2022/src/lib/models/SearchPropertySign.mjs +0 -11
  635. package/esm2022/src/lib/models/SearchPropertyValue.mjs +0 -2
  636. package/esm2022/src/lib/models/SearchPropertyValueType.mjs +0 -11
  637. package/esm2022/src/lib/models/Size.mjs +0 -2
  638. package/esm2022/src/lib/models/SortDirection.mjs +0 -7
  639. package/esm2022/src/lib/models/StageActorRule.mjs +0 -8
  640. package/esm2022/src/lib/models/SwimLane.mjs +0 -2
  641. package/esm2022/src/lib/models/Tag.mjs +0 -2
  642. package/esm2022/src/lib/models/Task.mjs +0 -2
  643. package/esm2022/src/lib/models/TaskAssignmentType.mjs +0 -6
  644. package/esm2022/src/lib/models/TaskNotification.mjs +0 -2
  645. package/esm2022/src/lib/models/TaskNotificationMessageType.mjs +0 -6
  646. package/esm2022/src/lib/models/TaskNotificationType.mjs +0 -8
  647. package/esm2022/src/lib/models/TaskStatus.mjs +0 -9
  648. package/esm2022/src/lib/models/Workflow.mjs +0 -2
  649. package/esm2022/src/lib/models/WorkflowAction.mjs +0 -2
  650. package/esm2022/src/lib/models/WorkflowOperation.mjs +0 -2
  651. package/esm2022/src/lib/models/WorkflowStage.mjs +0 -2
  652. package/esm2022/src/lib/models/actors.mjs +0 -2
  653. package/esm2022/src/lib/models/auth-mechanism.mjs +0 -8
  654. package/esm2022/src/lib/models/base.mjs +0 -2
  655. package/esm2022/src/lib/models/index.mjs +0 -2
  656. package/esm2022/src/lib/models/object-state.mjs +0 -8
  657. package/esm2022/src/lib/models/operation-type.mjs +0 -7
  658. package/esm2022/src/lib/models/paged.mjs +0 -2
  659. package/esm2022/src/lib/models/public-api.mjs +0 -64
  660. package/esm2022/src/lib/models/query-params.mjs +0 -2
  661. package/esm2022/src/lib/models/status.mjs +0 -6
  662. package/esm2022/src/lib/models/task-history.mjs +0 -2
  663. package/esm2022/src/lib/models/user-access-request-status.mjs +0 -7
  664. package/esm2022/src/lib/models/user.mjs +0 -2
  665. package/esm2022/src/lib/models/verben-workflow-ui-src-lib-models.mjs +0 -5
  666. package/esm2022/src/lib/pipes/async-label.pipe.mjs +0 -25
  667. package/esm2022/src/lib/pipes/index.mjs +0 -2
  668. package/esm2022/src/lib/pipes/public-api.mjs +0 -2
  669. package/esm2022/src/lib/pipes/verben-workflow-ui-src-lib-pipes.mjs +0 -5
  670. package/esm2022/src/lib/services/environment.service.mjs +0 -27
  671. package/esm2022/src/lib/services/http-web-request.service.mjs +0 -90
  672. package/esm2022/src/lib/services/index.mjs +0 -2
  673. package/esm2022/src/lib/services/label.service.mjs +0 -134
  674. package/esm2022/src/lib/services/public-api.mjs +0 -5
  675. package/esm2022/src/lib/services/util.service.mjs +0 -65
  676. package/esm2022/src/lib/services/verben-workflow-ui-src-lib-services.mjs +0 -5
  677. package/esm2022/src/lib/shared/base-table-style.mjs +0 -55
  678. package/esm2022/src/lib/shared/components/base-data-view.component.mjs +0 -158
  679. package/esm2022/src/lib/shared/components/base-model-field.mjs +0 -21
  680. package/esm2022/src/lib/shared/index.mjs +0 -7
  681. package/esm2022/src/lib/shared/models/DataViewConfig.mjs +0 -2
  682. package/esm2022/src/lib/shared/public-api.mjs +0 -13
  683. package/esm2022/src/lib/shared/shared.module.mjs +0 -103
  684. package/esm2022/src/lib/shared/verben-workflow-ui-src-lib-shared.mjs +0 -5
  685. package/esm2022/verben-workflow-ui.mjs +0 -5
  686. package/fesm2022/verben-workflow-ui-src-lib-components-actors.mjs +0 -678
  687. package/fesm2022/verben-workflow-ui-src-lib-components-actors.mjs.map +0 -1
  688. package/fesm2022/verben-workflow-ui-src-lib-components-designer.mjs +0 -3892
  689. package/fesm2022/verben-workflow-ui-src-lib-components-designer.mjs.map +0 -1
  690. package/fesm2022/verben-workflow-ui-src-lib-components-expiration.mjs +0 -72
  691. package/fesm2022/verben-workflow-ui-src-lib-components-expiration.mjs.map +0 -1
  692. package/fesm2022/verben-workflow-ui-src-lib-components-file-render.mjs +0 -83
  693. package/fesm2022/verben-workflow-ui-src-lib-components-file-render.mjs.map +0 -1
  694. package/fesm2022/verben-workflow-ui-src-lib-components-file-upload.mjs +0 -159
  695. package/fesm2022/verben-workflow-ui-src-lib-components-file-upload.mjs.map +0 -1
  696. package/fesm2022/verben-workflow-ui-src-lib-components-flowable-status.mjs +0 -558
  697. package/fesm2022/verben-workflow-ui-src-lib-components-flowable-status.mjs.map +0 -1
  698. package/fesm2022/verben-workflow-ui-src-lib-components-form-control.mjs +0 -234
  699. package/fesm2022/verben-workflow-ui-src-lib-components-form-control.mjs.map +0 -1
  700. package/fesm2022/verben-workflow-ui-src-lib-components-form-group.mjs +0 -1981
  701. package/fesm2022/verben-workflow-ui-src-lib-components-form-group.mjs.map +0 -1
  702. package/fesm2022/verben-workflow-ui-src-lib-components-form-response.mjs +0 -773
  703. package/fesm2022/verben-workflow-ui-src-lib-components-form-response.mjs.map +0 -1
  704. package/fesm2022/verben-workflow-ui-src-lib-components-form-timer.mjs +0 -81
  705. package/fesm2022/verben-workflow-ui-src-lib-components-form-timer.mjs.map +0 -1
  706. package/fesm2022/verben-workflow-ui-src-lib-components-forms.mjs +0 -812
  707. package/fesm2022/verben-workflow-ui-src-lib-components-forms.mjs.map +0 -1
  708. package/fesm2022/verben-workflow-ui-src-lib-components-journal.mjs +0 -33
  709. package/fesm2022/verben-workflow-ui-src-lib-components-journal.mjs.map +0 -1
  710. package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs +0 -1034
  711. package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs.map +0 -1
  712. package/fesm2022/verben-workflow-ui-src-lib-components-operation-popup.mjs +0 -812
  713. package/fesm2022/verben-workflow-ui-src-lib-components-operation-popup.mjs.map +0 -1
  714. package/fesm2022/verben-workflow-ui-src-lib-components-stage-details.mjs +0 -74
  715. package/fesm2022/verben-workflow-ui-src-lib-components-stage-details.mjs.map +0 -1
  716. package/fesm2022/verben-workflow-ui-src-lib-components-task-form.mjs +0 -94
  717. package/fesm2022/verben-workflow-ui-src-lib-components-task-form.mjs.map +0 -1
  718. package/fesm2022/verben-workflow-ui-src-lib-components-task-history.mjs +0 -273
  719. package/fesm2022/verben-workflow-ui-src-lib-components-task-history.mjs.map +0 -1
  720. package/fesm2022/verben-workflow-ui-src-lib-components-task-notification.mjs +0 -995
  721. package/fesm2022/verben-workflow-ui-src-lib-components-task-notification.mjs.map +0 -1
  722. package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs +0 -878
  723. package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs.map +0 -1
  724. package/fesm2022/verben-workflow-ui-src-lib-components-wf.mjs +0 -204
  725. package/fesm2022/verben-workflow-ui-src-lib-components-wf.mjs.map +0 -1
  726. package/fesm2022/verben-workflow-ui-src-lib-components-workflow-designer.mjs +0 -4908
  727. package/fesm2022/verben-workflow-ui-src-lib-components-workflow-designer.mjs.map +0 -1
  728. package/fesm2022/verben-workflow-ui-src-lib-components-workflow.mjs +0 -371
  729. package/fesm2022/verben-workflow-ui-src-lib-components-workflow.mjs.map +0 -1
  730. package/fesm2022/verben-workflow-ui-src-lib-components-workflows.mjs +0 -854
  731. package/fesm2022/verben-workflow-ui-src-lib-components-workflows.mjs.map +0 -1
  732. package/fesm2022/verben-workflow-ui-src-lib-models.mjs +0 -255
  733. package/fesm2022/verben-workflow-ui-src-lib-models.mjs.map +0 -1
  734. package/fesm2022/verben-workflow-ui-src-lib-pipes.mjs +0 -32
  735. package/fesm2022/verben-workflow-ui-src-lib-pipes.mjs.map +0 -1
  736. package/fesm2022/verben-workflow-ui-src-lib-services.mjs +0 -311
  737. package/fesm2022/verben-workflow-ui-src-lib-services.mjs.map +0 -1
  738. package/fesm2022/verben-workflow-ui-src-lib-shared.mjs +0 -340
  739. package/fesm2022/verben-workflow-ui-src-lib-shared.mjs.map +0 -1
  740. package/fesm2022/verben-workflow-ui.mjs +0 -32
  741. package/fesm2022/verben-workflow-ui.mjs.map +0 -1
  742. package/index.d.ts +0 -5
  743. package/public-api.d.ts +0 -20
  744. package/src/lib/components/actors/actors.columns.d.ts +0 -3
  745. package/src/lib/components/actors/actors.component.d.ts +0 -31
  746. package/src/lib/components/actors/actors.facade.d.ts +0 -37
  747. package/src/lib/components/actors/actors.form.component.d.ts +0 -23
  748. package/src/lib/components/actors/actors.module.d.ts +0 -11
  749. package/src/lib/components/actors/actors.service.d.ts +0 -53
  750. package/src/lib/components/actors/actors.state.d.ts +0 -36
  751. package/src/lib/components/designer/components/label-editor.component.d.ts +0 -22
  752. package/src/lib/components/designer/components/node-selector.component.d.ts +0 -23
  753. package/src/lib/components/designer/components/swimlane-label.component.d.ts +0 -12
  754. package/src/lib/components/designer/components/swimlane-popup.component.d.ts +0 -18
  755. package/src/lib/components/designer/components/wf-canvas.component.d.ts +0 -37
  756. package/src/lib/components/designer/components/wf-designer.component.d.ts +0 -22
  757. package/src/lib/components/designer/components/wf-toolbar.component.d.ts +0 -17
  758. package/src/lib/components/designer/models/types.d.ts +0 -103
  759. package/src/lib/components/designer/services/canvas-state.service.d.ts +0 -24
  760. package/src/lib/components/designer/services/connection-segment-interaction.service.d.ts +0 -36
  761. package/src/lib/components/designer/services/connection.service.d.ts +0 -47
  762. package/src/lib/components/designer/services/keyboard-handler.service.d.ts +0 -9
  763. package/src/lib/components/designer/services/label-management.service.d.ts +0 -14
  764. package/src/lib/components/designer/services/node-finder.service.d.ts +0 -10
  765. package/src/lib/components/designer/services/node-interaction.service.d.ts +0 -19
  766. package/src/lib/components/designer/services/node-precondition.service.d.ts +0 -37
  767. package/src/lib/components/designer/services/node-selection.service.d.ts +0 -19
  768. package/src/lib/components/designer/services/orthogonal-router.service.d.ts +0 -36
  769. package/src/lib/components/designer/services/position-update.service.d.ts +0 -10
  770. package/src/lib/components/designer/services/rendering.service.d.ts +0 -67
  771. package/src/lib/components/designer/services/swimlane-management.service.d.ts +0 -19
  772. package/src/lib/components/designer/services/swimlane-stats.service.d.ts +0 -19
  773. package/src/lib/components/designer/services/viewport.service.d.ts +0 -10
  774. package/src/lib/components/designer/services/wf-facade.service.d.ts +0 -67
  775. package/src/lib/components/designer/services/wf-mapper.service.d.ts +0 -26
  776. package/src/lib/components/designer/services/wf-persistence.service.d.ts +0 -21
  777. package/src/lib/components/designer/services/wf-state.service.d.ts +0 -30
  778. package/src/lib/components/expiration/expiration.component.d.ts +0 -20
  779. package/src/lib/components/expiration/expiration.module.d.ts +0 -9
  780. package/src/lib/components/file-render/file-render.component.d.ts +0 -17
  781. package/src/lib/components/file-render/file-render.module.d.ts +0 -10
  782. package/src/lib/components/file-upload/file-upload.component.d.ts +0 -22
  783. package/src/lib/components/file-upload/file-upload.module.d.ts +0 -11
  784. package/src/lib/components/flowable-status/flowable-status.columns.d.ts +0 -3
  785. package/src/lib/components/flowable-status/flowable-status.component.d.ts +0 -34
  786. package/src/lib/components/flowable-status/flowable-status.facade.d.ts +0 -32
  787. package/src/lib/components/flowable-status/flowable-status.form.component.d.ts +0 -18
  788. package/src/lib/components/flowable-status/flowable-status.module.d.ts +0 -11
  789. package/src/lib/components/flowable-status/flowable-status.service.d.ts +0 -35
  790. package/src/lib/components/flowable-status/flowable-status.state.d.ts +0 -30
  791. package/src/lib/components/flowable-status/public-api.d.ts +0 -2
  792. package/src/lib/components/form-control/form-control.component.d.ts +0 -38
  793. package/src/lib/components/form-control/form-control.module.d.ts +0 -11
  794. package/src/lib/components/form-group/base-table-style.d.ts +0 -1
  795. package/src/lib/components/form-group/form-fields/form-fields.component.d.ts +0 -136
  796. package/src/lib/components/form-group/form-fields/form-fields.module.d.ts +0 -11
  797. package/src/lib/components/form-group/form-fields/form-fields.service.d.ts +0 -9
  798. package/src/lib/components/form-group/form-group.component.d.ts +0 -108
  799. package/src/lib/components/form-group/form-group.module.d.ts +0 -15
  800. package/src/lib/components/form-group/form-group.service.d.ts +0 -9
  801. package/src/lib/components/form-response/form-response.component.d.ts +0 -108
  802. package/src/lib/components/form-response/form-response.module.d.ts +0 -12
  803. package/src/lib/components/form-response/form-response.service.d.ts +0 -9
  804. package/src/lib/components/form-timer/form-timer.component.d.ts +0 -13
  805. package/src/lib/components/form-timer/form-timer.module.d.ts +0 -9
  806. package/src/lib/components/forms/base-table-style.d.ts +0 -1
  807. package/src/lib/components/forms/forms.component.d.ts +0 -88
  808. package/src/lib/components/forms/forms.module.d.ts +0 -8
  809. package/src/lib/components/forms/forms.service.d.ts +0 -9
  810. package/src/lib/components/journal/journal.component.d.ts +0 -5
  811. package/src/lib/components/journal/journal.module.d.ts +0 -8
  812. package/src/lib/components/my-queue/my-queue.columns.d.ts +0 -3
  813. package/src/lib/components/my-queue/my-queue.component.d.ts +0 -26
  814. package/src/lib/components/my-queue/my-queue.facade.d.ts +0 -42
  815. package/src/lib/components/my-queue/my-queue.module.d.ts +0 -14
  816. package/src/lib/components/my-queue/my-queue.service.d.ts +0 -65
  817. package/src/lib/components/my-queue/my-queue.state.d.ts +0 -33
  818. package/src/lib/components/my-queue/tasks.form.component.d.ts +0 -36
  819. package/src/lib/components/operation-popup/operation-popup.component.d.ts +0 -57
  820. package/src/lib/components/operation-popup/operation-popup.facade.d.ts +0 -32
  821. package/src/lib/components/operation-popup/operation-popup.service.d.ts +0 -23
  822. package/src/lib/components/operation-popup/operation-popup.state.d.ts +0 -20
  823. package/src/lib/components/stage-details/stage-details.component.d.ts +0 -24
  824. package/src/lib/components/stage-details/stage-details.module.d.ts +0 -9
  825. package/src/lib/components/task-form/task-form.component.d.ts +0 -10
  826. package/src/lib/components/task-form/task-form.module.d.ts +0 -10
  827. package/src/lib/components/task-history/task-history.component.d.ts +0 -35
  828. package/src/lib/components/task-history/task-history.module.d.ts +0 -10
  829. package/src/lib/components/task-history/task-history.service.d.ts +0 -13
  830. package/src/lib/components/task-notification/base-table-style.d.ts +0 -1
  831. package/src/lib/components/task-notification/task-notification.component.d.ts +0 -89
  832. package/src/lib/components/task-notification/task-notification.module.d.ts +0 -8
  833. package/src/lib/components/task-notification/task-notification.service.d.ts +0 -32
  834. package/src/lib/components/tasks/tasks.columns.d.ts +0 -3
  835. package/src/lib/components/tasks/tasks.component.d.ts +0 -28
  836. package/src/lib/components/tasks/tasks.facade.d.ts +0 -40
  837. package/src/lib/components/tasks/tasks.form.component.d.ts +0 -36
  838. package/src/lib/components/tasks/tasks.models.d.ts +0 -4
  839. package/src/lib/components/tasks/tasks.module.d.ts +0 -16
  840. package/src/lib/components/tasks/tasks.service.d.ts +0 -57
  841. package/src/lib/components/tasks/tasks.state.d.ts +0 -35
  842. package/src/lib/components/wf/wf.columns.d.ts +0 -3
  843. package/src/lib/components/wf/wf.component.d.ts +0 -16
  844. package/src/lib/components/wf/wf.module.d.ts +0 -10
  845. package/src/lib/components/wf/wf.service.d.ts +0 -51
  846. package/src/lib/components/workflow/column.d.ts +0 -3
  847. package/src/lib/components/workflow/helper.d.ts +0 -2
  848. package/src/lib/components/workflow/table-style.d.ts +0 -1
  849. package/src/lib/components/workflow/workflow.component.d.ts +0 -57
  850. package/src/lib/components/workflow/workflow.module.d.ts +0 -9
  851. package/src/lib/components/workflow-designer/action-dialog/action-dialog.component.d.ts +0 -30
  852. package/src/lib/components/workflow-designer/actor-tags-dialog/actor-tags-dialog.component.d.ts +0 -24
  853. package/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.d.ts +0 -34
  854. package/src/lib/components/workflow-designer/decision-popup/decision-popup.component.d.ts +0 -26
  855. package/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.d.ts +0 -188
  856. package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.d.ts +0 -33
  857. package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.types.d.ts +0 -5
  858. package/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.d.ts +0 -42
  859. package/src/lib/components/workflow-designer/services/connection.service.d.ts +0 -85
  860. package/src/lib/components/workflow-designer/services/node-management.service.d.ts +0 -52
  861. package/src/lib/components/workflow-designer/services/popup.service.d.ts +0 -139
  862. package/src/lib/components/workflow-designer/services/swimlane.service.d.ts +0 -51
  863. package/src/lib/components/workflow-designer/services/transformer.service.d.ts +0 -36
  864. package/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.d.ts +0 -40
  865. package/src/lib/components/workflow-designer/stage-node/stage-node.component.d.ts +0 -54
  866. package/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.d.ts +0 -45
  867. package/src/lib/components/workflow-designer/workflow-data.service.d.ts +0 -35
  868. package/src/lib/components/workflow-designer/workflow-designer.component.d.ts +0 -47
  869. package/src/lib/components/workflow-designer/workflow-designer.module.d.ts +0 -22
  870. package/src/lib/components/workflow-designer/workflow-designer.state.d.ts +0 -99
  871. package/src/lib/components/workflow-designer/workflow-designer.types.d.ts +0 -49
  872. package/src/lib/components/workflows/workflow-form/workflow-form.component.d.ts +0 -28
  873. package/src/lib/components/workflows/workflows.columns.d.ts +0 -3
  874. package/src/lib/components/workflows/workflows.component.d.ts +0 -49
  875. package/src/lib/components/workflows/workflows.facade.d.ts +0 -38
  876. package/src/lib/components/workflows/workflows.helper.d.ts +0 -3
  877. package/src/lib/components/workflows/workflows.module.d.ts +0 -11
  878. package/src/lib/components/workflows/workflows.service.d.ts +0 -78
  879. package/src/lib/components/workflows/workflows.state.d.ts +0 -33
  880. package/src/lib/models/ActionHistory.d.ts +0 -14
  881. package/src/lib/models/ActionType.d.ts +0 -9
  882. package/src/lib/models/Actor.d.ts +0 -11
  883. package/src/lib/models/ActorTag.d.ts +0 -6
  884. package/src/lib/models/Coord.d.ts +0 -4
  885. package/src/lib/models/DataType.d.ts +0 -25
  886. package/src/lib/models/EAVEntity.d.ts +0 -4
  887. package/src/lib/models/ErrorResponse.d.ts +0 -6
  888. package/src/lib/models/Escalation.d.ts +0 -14
  889. package/src/lib/models/EscalationCycle.d.ts +0 -12
  890. package/src/lib/models/EscalationStage.d.ts +0 -10
  891. package/src/lib/models/EscalationType.d.ts +0 -5
  892. package/src/lib/models/File.d.ts +0 -7
  893. package/src/lib/models/FilterTypes.d.ts +0 -6
  894. package/src/lib/models/FlowableStatus.d.ts +0 -5
  895. package/src/lib/models/Form.d.ts +0 -13
  896. package/src/lib/models/FormEntity.d.ts +0 -13
  897. package/src/lib/models/FormFill.d.ts +0 -15
  898. package/src/lib/models/FormProperty.d.ts +0 -15
  899. package/src/lib/models/FormValues.d.ts +0 -14
  900. package/src/lib/models/MailConfig.d.ts +0 -12
  901. package/src/lib/models/MessageConfig.d.ts +0 -3
  902. package/src/lib/models/MessageMedium.d.ts +0 -4
  903. package/src/lib/models/OperationAction.d.ts +0 -14
  904. package/src/lib/models/PagedResult.d.ts +0 -5
  905. package/src/lib/models/PeriodMode.d.ts +0 -10
  906. package/src/lib/models/PermissionConfig.d.ts +0 -7
  907. package/src/lib/models/ReportSchedule.d.ts +0 -22
  908. package/src/lib/models/ReportType.d.ts +0 -5
  909. package/src/lib/models/Resource.d.ts +0 -20
  910. package/src/lib/models/ResponseKeyValue.d.ts +0 -5
  911. package/src/lib/models/SMSConfig.d.ts +0 -10
  912. package/src/lib/models/SearchDynamicWrapper.d.ts +0 -5
  913. package/src/lib/models/SearchOperator.d.ts +0 -4
  914. package/src/lib/models/SearchPropertySign.d.ts +0 -9
  915. package/src/lib/models/SearchPropertyValue.d.ts +0 -12
  916. package/src/lib/models/SearchPropertyValueType.d.ts +0 -9
  917. package/src/lib/models/Size.d.ts +0 -4
  918. package/src/lib/models/SortDirection.d.ts +0 -5
  919. package/src/lib/models/StageActorRule.d.ts +0 -6
  920. package/src/lib/models/SwimLane.d.ts +0 -13
  921. package/src/lib/models/Tag.d.ts +0 -6
  922. package/src/lib/models/Task.d.ts +0 -22
  923. package/src/lib/models/TaskAssignmentType.d.ts +0 -4
  924. package/src/lib/models/TaskNotification.d.ts +0 -14
  925. package/src/lib/models/TaskNotificationMessageType.d.ts +0 -4
  926. package/src/lib/models/TaskNotificationType.d.ts +0 -6
  927. package/src/lib/models/TaskStatus.d.ts +0 -7
  928. package/src/lib/models/Workflow.d.ts +0 -20
  929. package/src/lib/models/WorkflowAction.d.ts +0 -13
  930. package/src/lib/models/WorkflowOperation.d.ts +0 -6
  931. package/src/lib/models/WorkflowStage.d.ts +0 -26
  932. package/src/lib/models/actors.d.ts +0 -8
  933. package/src/lib/models/auth-mechanism.d.ts +0 -13
  934. package/src/lib/models/base.d.ts +0 -11
  935. package/src/lib/models/object-state.d.ts +0 -6
  936. package/src/lib/models/operation-type.d.ts +0 -5
  937. package/src/lib/models/paged.d.ts +0 -9
  938. package/src/lib/models/query-params.d.ts +0 -8
  939. package/src/lib/models/status.d.ts +0 -4
  940. package/src/lib/models/task-history.d.ts +0 -17
  941. package/src/lib/models/user-access-request-status.d.ts +0 -5
  942. package/src/lib/models/user.d.ts +0 -23
  943. package/src/lib/pipes/async-label.pipe.d.ts +0 -11
  944. package/src/lib/services/environment.service.d.ts +0 -23
  945. package/src/lib/services/http-web-request.service.d.ts +0 -23
  946. package/src/lib/services/label.service.d.ts +0 -15
  947. package/src/lib/services/public-api.d.ts +0 -4
  948. package/src/lib/services/util.service.d.ts +0 -12
  949. package/src/lib/shared/base-table-style.d.ts +0 -2
  950. package/src/lib/shared/components/base-data-view.component.d.ts +0 -41
  951. package/src/lib/shared/components/base-model-field.d.ts +0 -26
  952. package/src/lib/shared/models/DataViewConfig.d.ts +0 -11
  953. package/src/lib/shared/public-api.d.ts +0 -5
  954. package/src/lib/shared/shared.module.d.ts +0 -11
  955. /package/src/lib/components/actors/{index.d.ts → index.ts} +0 -0
  956. /package/src/lib/components/actors/{public-api.d.ts → public-api.ts} +0 -0
  957. /package/src/lib/components/designer/{index.d.ts → index.ts} +0 -0
  958. /package/src/lib/components/designer/{public-api.d.ts → public-api.ts} +0 -0
  959. /package/src/lib/components/expiration/{index.d.ts → index.ts} +0 -0
  960. /package/src/lib/components/expiration/{public-api.d.ts → public-api.ts} +0 -0
  961. /package/src/lib/components/file-render/{index.d.ts → index.ts} +0 -0
  962. /package/src/lib/components/file-render/{public-api.d.ts → public-api.ts} +0 -0
  963. /package/src/lib/components/file-upload/{index.d.ts → index.ts} +0 -0
  964. /package/src/lib/components/file-upload/{public-api.d.ts → public-api.ts} +0 -0
  965. /package/src/lib/components/flowable-status/{index.d.ts → index.ts} +0 -0
  966. /package/src/lib/components/form-control/{index.d.ts → index.ts} +0 -0
  967. /package/src/lib/components/form-control/{public-api.d.ts → public-api.ts} +0 -0
  968. /package/src/lib/components/form-group/{index.d.ts → index.ts} +0 -0
  969. /package/src/lib/components/form-group/{public-api.d.ts → public-api.ts} +0 -0
  970. /package/src/lib/components/form-response/{index.d.ts → index.ts} +0 -0
  971. /package/src/lib/components/form-response/{public-api.d.ts → public-api.ts} +0 -0
  972. /package/src/lib/components/form-timer/{index.d.ts → index.ts} +0 -0
  973. /package/src/lib/components/form-timer/{public-api.d.ts → public-api.ts} +0 -0
  974. /package/src/lib/components/forms/{index.d.ts → index.ts} +0 -0
  975. /package/src/lib/components/forms/{public-api.d.ts → public-api.ts} +0 -0
  976. /package/src/lib/components/journal/{index.d.ts → index.ts} +0 -0
  977. /package/src/lib/components/journal/{public-api.d.ts → public-api.ts} +0 -0
  978. /package/src/lib/components/my-queue/{index.d.ts → index.ts} +0 -0
  979. /package/src/lib/components/my-queue/{public-api.d.ts → public-api.ts} +0 -0
  980. /package/src/lib/components/operation-popup/{index.d.ts → index.ts} +0 -0
  981. /package/src/lib/components/operation-popup/{public-api.d.ts → public-api.ts} +0 -0
  982. /package/src/lib/components/stage-details/{index.d.ts → index.ts} +0 -0
  983. /package/src/lib/components/stage-details/{public-api.d.ts → public-api.ts} +0 -0
  984. /package/src/lib/components/task-form/{index.d.ts → index.ts} +0 -0
  985. /package/src/lib/components/task-form/{public-api.d.ts → public-api.ts} +0 -0
  986. /package/src/lib/components/task-history/{index.d.ts → index.ts} +0 -0
  987. /package/src/lib/components/task-history/{public-api.d.ts → public-api.ts} +0 -0
  988. /package/src/lib/components/task-notification/{index.d.ts → index.ts} +0 -0
  989. /package/src/lib/components/task-notification/{public-api.d.ts → public-api.ts} +0 -0
  990. /package/src/lib/components/tasks/{index.d.ts → index.ts} +0 -0
  991. /package/src/lib/components/tasks/{public-api.d.ts → public-api.ts} +0 -0
  992. /package/src/lib/components/wf/{index.d.ts → index.ts} +0 -0
  993. /package/src/lib/components/wf/{public-api.d.ts → public-api.ts} +0 -0
  994. /package/src/lib/components/workflow/{index.d.ts → index.ts} +0 -0
  995. /package/src/lib/components/workflow/{public-api.d.ts → public-api.ts} +0 -0
  996. /package/src/lib/components/workflow-designer/{index.d.ts → index.ts} +0 -0
  997. /package/src/lib/components/workflow-designer/{public-api.d.ts → public-api.ts} +0 -0
  998. /package/src/lib/components/workflows/{index.d.ts → index.ts} +0 -0
  999. /package/src/lib/components/workflows/{public-api.d.ts → public-api.ts} +0 -0
  1000. /package/src/lib/models/{index.d.ts → index.ts} +0 -0
  1001. /package/src/lib/models/{public-api.d.ts → public-api.ts} +0 -0
  1002. /package/src/lib/pipes/{index.d.ts → index.ts} +0 -0
  1003. /package/src/lib/pipes/{public-api.d.ts → public-api.ts} +0 -0
  1004. /package/src/lib/services/{index.d.ts → index.ts} +0 -0
  1005. /package/src/lib/shared/{index.d.ts → index.ts} +0 -0
  1006. /package/{styles → src/styles}/styles.css +0 -0
@@ -1,3892 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { EventEmitter, Component, Input, Output, ViewChild, HostListener, signal, computed, Injectable, inject, input } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
- import * as i2 from '@angular/forms';
6
- import { FormsModule } from '@angular/forms';
7
- import * as i1$1 from 'verben-ng-ui';
8
- import { VerbenDialogueModule, DropDownModule } from 'verben-ng-ui';
9
- import { WorkflowsService } from 'verben-workflow-ui/src/lib/components/workflows';
10
- import { TaskAssignmentType, Status, ObjectState, StageActorRule, ErrorResponse } from 'verben-workflow-ui/src/lib/models';
11
- import { UtilService, EnvironmentService } from 'verben-workflow-ui/src/lib/services';
12
-
13
- // components/workflow/toolbar/wf-toolbar.component.ts
14
- class WFToolbarComponent {
15
- selectedTool = null;
16
- toolSelected = new EventEmitter();
17
- toolbarItems = [
18
- { id: 'swimlane', label: 'Swimlane', icon: 'icons/swimlane.svg' },
19
- { id: 'stage', label: 'Stage', icon: 'icons/stage.svg' },
20
- { id: 'action', label: 'Action', icon: 'icons/action.svg' },
21
- { id: 'form', label: 'Form', icon: 'icons/form.svg' },
22
- // { id: 'decision', label: 'Decision', icon: 'icons/decision.svg' },
23
- { id: 'decision', label: 'Decision', icon: 'icons/stage.svg' },
24
- { id: 'subflow', label: 'Subflow', icon: 'icons/subflow.svg' },
25
- ];
26
- onToolSelect(toolId) {
27
- // If same tool is selected, deselect it
28
- this.toolSelected.emit(this.selectedTool === toolId ? null : toolId);
29
- }
30
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WFToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
31
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WFToolbarComponent, isStandalone: true, selector: "wf-toolbar", inputs: { selectedTool: "selectedTool" }, outputs: { toolSelected: "toolSelected" }, ngImport: i0, template: `
32
- <div class="toolbar">
33
- @for (item of toolbarItems; track item.id) {
34
- <button
35
- class="tool-button"
36
- [class.active]="selectedTool === item.id"
37
- (click)="onToolSelect(item.id)"
38
- >
39
- <img [src]="item.icon" [alt]="item.label" class="tool-icon" />
40
- </button>
41
- }
42
- </div>
43
- `, isInline: true, styles: [".toolbar{display:flex;padding:.5rem;gap:.5rem;background:#fff;border:1px solid #aa00ff;border-radius:7px;box-shadow:4px 4px 4px 3px #00000040}.tool-button{display:flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;border-radius:.375rem;background:#fff;cursor:pointer;transition:all .2s;&:hover{background:#f9fafb}&.active{background:#f3e8ff;border-color:#d8b4fe}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
44
- }
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WFToolbarComponent, decorators: [{
46
- type: Component,
47
- args: [{ selector: 'wf-toolbar', standalone: true, imports: [CommonModule], template: `
48
- <div class="toolbar">
49
- @for (item of toolbarItems; track item.id) {
50
- <button
51
- class="tool-button"
52
- [class.active]="selectedTool === item.id"
53
- (click)="onToolSelect(item.id)"
54
- >
55
- <img [src]="item.icon" [alt]="item.label" class="tool-icon" />
56
- </button>
57
- }
58
- </div>
59
- `, styles: [".toolbar{display:flex;padding:.5rem;gap:.5rem;background:#fff;border:1px solid #aa00ff;border-radius:7px;box-shadow:4px 4px 4px 3px #00000040}.tool-button{display:flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;border-radius:.375rem;background:#fff;cursor:pointer;transition:all .2s;&:hover{background:#f9fafb}&.active{background:#f3e8ff;border-color:#d8b4fe}}\n"] }]
60
- }], propDecorators: { selectedTool: [{
61
- type: Input
62
- }], toolSelected: [{
63
- type: Output
64
- }] } });
65
-
66
- // components/label-editor.component.ts
67
- class LabelEditorComponent {
68
- label = '';
69
- x = 0;
70
- y = 0;
71
- isConnection = false;
72
- isSwimlane = false;
73
- labelChange = new EventEmitter();
74
- openDialog = new EventEmitter();
75
- labelInput;
76
- isEditing = false;
77
- Math = Math;
78
- getEditorPosition() {
79
- // const offsetX = this.isConnection ? -25 : -25; // Center the label
80
- // const offsetY = -10; // Slight upward offset to center vertically
81
- const offsetX = this.isConnection ? 0 : 0; // Center the label
82
- const offsetY = 0; // Slight upward offset to center vertically
83
- // return `translate(${this.x + offsetX}px, ${this.y + offsetY}px)`;
84
- return `translate(50%, 50%)`;
85
- }
86
- getLabelStyle() {
87
- if (this.isEditing)
88
- return {};
89
- return {
90
- 'text-anchor': 'middle',
91
- 'dominant-baseline': 'middle',
92
- 'pointer-events': 'all',
93
- };
94
- }
95
- startEditing() {
96
- this.isEditing = true;
97
- setTimeout(() => {
98
- if (this.labelInput) {
99
- this.labelInput.nativeElement.focus();
100
- this.labelInput.nativeElement.select();
101
- }
102
- });
103
- }
104
- finishEditing() {
105
- if (this.isEditing) {
106
- const newValue = this.labelInput.nativeElement.value.trim();
107
- if (newValue && newValue !== this.label) {
108
- this.labelChange.emit(newValue);
109
- }
110
- this.isEditing = false;
111
- }
112
- }
113
- cancelEditing() {
114
- this.isEditing = false;
115
- }
116
- onEscapePress() {
117
- this.cancelEditing();
118
- }
119
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LabelEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
120
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LabelEditorComponent, isStandalone: true, selector: "wf-label-editor", inputs: { label: "label", x: "x", y: "y", isConnection: "isConnection", isSwimlane: "isSwimlane" }, outputs: { labelChange: "labelChange", openDialog: "openDialog" }, host: { listeners: { "document:keydown.escape": "onEscapePress()" } }, viewQueries: [{ propertyName: "labelInput", first: true, predicate: ["labelInput"], descendants: true }], ngImport: i0, template: `
121
- <div
122
- class="label-container"
123
- [class.editing]="isEditing"
124
- [class.swimlane-label]="isSwimlane"
125
- >
126
- @if (isEditing) {
127
- <input
128
- #labelInput
129
- type="text"
130
- [value]="label"
131
- (blur)="finishEditing()"
132
- (keyup.enter)="finishEditing()"
133
- (keyup.escape)="cancelEditing()"
134
- class="label-input"
135
- [class.swimlane-input]="isSwimlane"
136
- [style.width.px]="Math.max(100, label.length * 8)"
137
- />
138
- } @else {
139
- <span
140
- (dblclick)="startEditing()"
141
- class="label-text"
142
- [class.connection-label]="isConnection"
143
- [class.swimlane-text]="isSwimlane"
144
- >
145
- {{ label }}
146
- <svg (click)="openDialog.emit($event)" class="edit-icon" width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
147
- <path d="M8.78934 3.19845L11.8027 6.21184M12.1148 2.0038L12.9974 2.8864C13.5858 3.47481 13.5858 4.42879 12.9974 5.01719L4.26925 13.7453H1.25586V10.7319L9.98399 2.0038C10.5724 1.4154 11.5264 1.4154 12.1148 2.0038Z" stroke="#3479E9" stroke-linecap="square"/>
148
- </svg>
149
- </span>
150
- }
151
- </div>
152
- `, isInline: true, styles: [":host{display:block;width:100%;height:100%}.label-container{display:flex;align-items:center;justify-content:center;min-width:50px;z-index:1000}.label-container.editing{background:#fff;padding:2px;border-radius:4px;box-shadow:0 2px 4px #0000001a}.label-input{padding:2px 4px;border:1px solid #d36cff;border-radius:2px;font-size:12px;font-family:inherit;outline:none;&.swimlane-input{font-size:14px;font-weight:500;min-width:150px}}.label-text{cursor:text;-webkit-user-select:none;user-select:none;font-size:12px;pointer-events:all;display:inline-block;min-width:20px;min-height:14px;position:relative}.connection-label{background:#fff;padding:2px 4px;border:1px solid #e5e7eb;border-radius:2px}.swimlane-text{font-size:14px;font-weight:500;color:#64748b}.swimlane-label{position:absolute;left:20px}.edit-icon{position:absolute;right:-14px;top:-14px;cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
153
- }
154
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LabelEditorComponent, decorators: [{
155
- type: Component,
156
- args: [{ selector: 'wf-label-editor', standalone: true, imports: [CommonModule], template: `
157
- <div
158
- class="label-container"
159
- [class.editing]="isEditing"
160
- [class.swimlane-label]="isSwimlane"
161
- >
162
- @if (isEditing) {
163
- <input
164
- #labelInput
165
- type="text"
166
- [value]="label"
167
- (blur)="finishEditing()"
168
- (keyup.enter)="finishEditing()"
169
- (keyup.escape)="cancelEditing()"
170
- class="label-input"
171
- [class.swimlane-input]="isSwimlane"
172
- [style.width.px]="Math.max(100, label.length * 8)"
173
- />
174
- } @else {
175
- <span
176
- (dblclick)="startEditing()"
177
- class="label-text"
178
- [class.connection-label]="isConnection"
179
- [class.swimlane-text]="isSwimlane"
180
- >
181
- {{ label }}
182
- <svg (click)="openDialog.emit($event)" class="edit-icon" width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
183
- <path d="M8.78934 3.19845L11.8027 6.21184M12.1148 2.0038L12.9974 2.8864C13.5858 3.47481 13.5858 4.42879 12.9974 5.01719L4.26925 13.7453H1.25586V10.7319L9.98399 2.0038C10.5724 1.4154 11.5264 1.4154 12.1148 2.0038Z" stroke="#3479E9" stroke-linecap="square"/>
184
- </svg>
185
- </span>
186
- }
187
- </div>
188
- `, styles: [":host{display:block;width:100%;height:100%}.label-container{display:flex;align-items:center;justify-content:center;min-width:50px;z-index:1000}.label-container.editing{background:#fff;padding:2px;border-radius:4px;box-shadow:0 2px 4px #0000001a}.label-input{padding:2px 4px;border:1px solid #d36cff;border-radius:2px;font-size:12px;font-family:inherit;outline:none;&.swimlane-input{font-size:14px;font-weight:500;min-width:150px}}.label-text{cursor:text;-webkit-user-select:none;user-select:none;font-size:12px;pointer-events:all;display:inline-block;min-width:20px;min-height:14px;position:relative}.connection-label{background:#fff;padding:2px 4px;border:1px solid #e5e7eb;border-radius:2px}.swimlane-text{font-size:14px;font-weight:500;color:#64748b}.swimlane-label{position:absolute;left:20px}.edit-icon{position:absolute;right:-14px;top:-14px;cursor:pointer}\n"] }]
189
- }], propDecorators: { label: [{
190
- type: Input
191
- }], x: [{
192
- type: Input
193
- }], y: [{
194
- type: Input
195
- }], isConnection: [{
196
- type: Input
197
- }], isSwimlane: [{
198
- type: Input
199
- }], labelChange: [{
200
- type: Output
201
- }], openDialog: [{
202
- type: Output
203
- }], labelInput: [{
204
- type: ViewChild,
205
- args: ['labelInput']
206
- }], onEscapePress: [{
207
- type: HostListener,
208
- args: ['document:keydown.escape']
209
- }] } });
210
-
211
- // services/wf-state.service.ts
212
- class WorkflowStateService {
213
- state = signal({
214
- objects: [],
215
- selectedObjectId: null,
216
- selectedTool: null,
217
- });
218
- // Computed signals for better reactivity
219
- objects = computed(() => this.state().objects);
220
- selectedObjectId = computed(() => this.state().selectedObjectId);
221
- selectedTool = computed(() => this.state().selectedTool);
222
- // private swimlaneManagement = inject(SwimlaneManagementService);
223
- // Computed signals for filtered objects
224
- nodes = computed(() => this.objects().filter((obj) => obj.type !== 'swimlane' && obj.type !== 'action'));
225
- swimlanes = computed(() => this.objects().filter((obj) => obj.type === 'swimlane'));
226
- connections = computed(() => this.objects().filter((obj) => obj.type === 'action'));
227
- addObject(object) {
228
- this.state.update((state) => ({
229
- ...state,
230
- objects: [...state.objects, object],
231
- }));
232
- }
233
- updateObject(id, changes) {
234
- this.state.update((state) => ({
235
- ...state,
236
- objects: state.objects.map((obj) => obj.id === id ? { ...obj, ...changes } : obj),
237
- }));
238
- }
239
- updateMultipleObjects(updates) {
240
- this.state.update((state) => ({
241
- ...state,
242
- objects: state.objects.map((obj) => {
243
- const update = updates.find((u) => u.id === obj.id);
244
- return update ? { ...obj, ...update.changes } : obj;
245
- }),
246
- }));
247
- }
248
- removeObject(id) {
249
- this.state.update((state) => ({
250
- ...state,
251
- objects: state.objects.filter((obj) => obj.id !== id),
252
- }));
253
- }
254
- setSelectedTool(tool) {
255
- this.state.update((state) => ({ ...state, selectedTool: tool }));
256
- }
257
- setSelectedObject(id) {
258
- this.state.update((state) => ({ ...state, selectedObjectId: id }));
259
- }
260
- getObjectById(id) {
261
- return this.objects().find((obj) => obj.id === id);
262
- }
263
- // Initialize workflow with default objects
264
- initializeWorkflow() {
265
- const swimlaneHeight = 260;
266
- const swimlane = {
267
- id: crypto.randomUUID(),
268
- type: 'swimlane',
269
- position: { x: 0, y: 0 },
270
- size: { width: 3000 - 40, height: swimlaneHeight },
271
- label: 'Default Swimlane',
272
- };
273
- // Position start node vertically centered in the swimlane
274
- const startNodeHeight = 46; // Height of start node
275
- const startY = (swimlaneHeight - startNodeHeight) / 2;
276
- const startNode = {
277
- id: crypto.randomUUID(),
278
- type: 'start',
279
- position: { x: 50, y: startY },
280
- size: { width: 58, height: startNodeHeight },
281
- label: 'Start',
282
- };
283
- const initialConnection = {
284
- id: crypto.randomUUID(),
285
- type: 'action',
286
- position: startNode.position,
287
- size: { width: 0, height: 0 },
288
- label: '',
289
- fromId: startNode.id,
290
- toId: '',
291
- points: [
292
- {
293
- x: startNode.position.x + startNode.size.width,
294
- y: startNode.position.y + startNode.size.height / 2,
295
- },
296
- {
297
- x: startNode.position.x + startNode.size.width + 50,
298
- y: startNode.position.y + startNode.size.height / 2,
299
- },
300
- ],
301
- };
302
- this.state.set({
303
- ...this.state(),
304
- objects: [swimlane, startNode, initialConnection],
305
- });
306
- }
307
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WorkflowStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
308
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WorkflowStateService, providedIn: 'root' });
309
- }
310
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WorkflowStateService, decorators: [{
311
- type: Injectable,
312
- args: [{
313
- providedIn: 'root',
314
- }]
315
- }] });
316
-
317
- // services/label-management.service.ts
318
- class LabelManagementService {
319
- workflowState = inject(WorkflowStateService);
320
- updateLabel(objectId, newLabel) {
321
- this.workflowState.updateObject(objectId, { label: newLabel });
322
- }
323
- getLabelPosition(object) {
324
- if (object.type === 'action') {
325
- return this.getConnectionLabelPosition(object);
326
- }
327
- // // // For regular nodes, use SVG coordinates
328
- // if (object.type === 'swimlane') {
329
- // return {
330
- // x: 100, // Fixed position for swimlane labels
331
- // y: object.position.y + 20,
332
- // };
333
- // }
334
- // For regular nodes, use SVG coordinates
335
- // For swimlanes, position label at the left side
336
- if (object.type === 'swimlane') {
337
- return {
338
- x: object.position.x + 20, // Small indent from left edge
339
- y: object.position.y + object.size.height / 2, // Vertically centered
340
- };
341
- }
342
- return {
343
- x: object.position.x + object.size.width / 2,
344
- y: object.position.y + object.size.height / 2,
345
- };
346
- }
347
- getConnectionLabelPosition(connection) {
348
- if (!connection.points || connection.points.length < 2) {
349
- return { x: 0, y: 0 };
350
- }
351
- // Find the middle point of the connection
352
- const midIndex = Math.floor(connection.points.length / 2);
353
- const point1 = connection.points[midIndex - 1];
354
- const point2 = connection.points[midIndex];
355
- return {
356
- x: (point1.x + point2.x) / 2,
357
- y: (point1.y + point2.y) / 2 - 10, // Offset above the line
358
- };
359
- }
360
- getSVGTextPosition(object) {
361
- // Center the label for all node types
362
- const centerX = object.size.width / 2;
363
- let centerY = object.size.height / 2;
364
- // Adjust position for form type
365
- if (object.type === 'form') {
366
- centerY = object.size.height + 20; // Position below the form
367
- }
368
- return { x: centerX, y: centerY };
369
- }
370
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LabelManagementService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
371
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LabelManagementService, providedIn: 'root' });
372
- }
373
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LabelManagementService, decorators: [{
374
- type: Injectable,
375
- args: [{
376
- providedIn: 'root',
377
- }]
378
- }] });
379
-
380
- // components/workflow/swimlane-label.component.ts
381
- class SwimlaneLabelComponent {
382
- label = '';
383
- count = 0;
384
- addClick = new EventEmitter();
385
- labelChange = new EventEmitter();
386
- onAddClick(event) {
387
- event.stopPropagation();
388
- this.addClick.emit(event);
389
- }
390
- onLabelChange(newLabel) {
391
- this.labelChange.emit(newLabel);
392
- }
393
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SwimlaneLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
394
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: SwimlaneLabelComponent, isStandalone: true, selector: "[wf-swimlane-label]", inputs: { label: "label", count: "count" }, outputs: { addClick: "addClick", labelChange: "labelChange" }, ngImport: i0, template: `
395
- <svg:g>
396
- <!-- Plus icon at top -->
397
- <svg:g
398
- transform="translate(0, 20)"
399
- class="cursor-pointer"
400
- (click)="onAddClick($event)"
401
- >
402
- <svg:circle r="10" fill="white" stroke="#D8B4FE" stroke-width="1" />
403
- <svg:path
404
- d="M-6 0h12 M0 -6v12"
405
- stroke="#9333EA"
406
- stroke-width="2"
407
- stroke-linecap="round"
408
- />
409
- </svg:g>
410
-
411
- <!-- Label in middle with edit support -->
412
- <svg:g transform="translate(0, 120)">
413
- <svg:foreignObject
414
- x="-60"
415
- y="-12"
416
- width="180"
417
- height="24"
418
- transform="rotate(-90)"
419
- >
420
- <xhtml:div
421
- xmlns="http://www.w3.org/1999/xhtml"
422
- style="width: 100%; height: 100%;"
423
- >
424
- <wf-label-editor
425
- [label]="label"
426
- [x]="0"
427
- [y]="0"
428
- (labelChange)="onLabelChange($event)"
429
- />
430
- </xhtml:div>
431
- </svg:foreignObject>
432
- </svg:g>
433
-
434
- <!-- Count badge at bottom -->
435
- <svg:g transform="translate(0, 200)">
436
- <svg:rect
437
- x="-15"
438
- y="-10"
439
- width="20"
440
- height="20"
441
- rx="20"
442
- fill="#F3E8FF"
443
- stroke="#D8B4FE"
444
- />
445
- <svg:text
446
- x="0"
447
- y="4"
448
- text-anchor="middle"
449
- font-size="12"
450
- fill="#7E22CE"
451
- font-weight="500"
452
- transform="rotate(-90)"
453
- >
454
- {{ count }}
455
- </svg:text>
456
- </svg:g>
457
- </svg:g>
458
- `, isInline: true, styles: [":host{display:block}circle:hover{fill:#f3e8ff}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: LabelEditorComponent, selector: "wf-label-editor", inputs: ["label", "x", "y", "isConnection", "isSwimlane"], outputs: ["labelChange", "openDialog"] }] });
459
- }
460
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SwimlaneLabelComponent, decorators: [{
461
- type: Component,
462
- args: [{ selector: '[wf-swimlane-label]', standalone: true, imports: [CommonModule, LabelEditorComponent], template: `
463
- <svg:g>
464
- <!-- Plus icon at top -->
465
- <svg:g
466
- transform="translate(0, 20)"
467
- class="cursor-pointer"
468
- (click)="onAddClick($event)"
469
- >
470
- <svg:circle r="10" fill="white" stroke="#D8B4FE" stroke-width="1" />
471
- <svg:path
472
- d="M-6 0h12 M0 -6v12"
473
- stroke="#9333EA"
474
- stroke-width="2"
475
- stroke-linecap="round"
476
- />
477
- </svg:g>
478
-
479
- <!-- Label in middle with edit support -->
480
- <svg:g transform="translate(0, 120)">
481
- <svg:foreignObject
482
- x="-60"
483
- y="-12"
484
- width="180"
485
- height="24"
486
- transform="rotate(-90)"
487
- >
488
- <xhtml:div
489
- xmlns="http://www.w3.org/1999/xhtml"
490
- style="width: 100%; height: 100%;"
491
- >
492
- <wf-label-editor
493
- [label]="label"
494
- [x]="0"
495
- [y]="0"
496
- (labelChange)="onLabelChange($event)"
497
- />
498
- </xhtml:div>
499
- </svg:foreignObject>
500
- </svg:g>
501
-
502
- <!-- Count badge at bottom -->
503
- <svg:g transform="translate(0, 200)">
504
- <svg:rect
505
- x="-15"
506
- y="-10"
507
- width="20"
508
- height="20"
509
- rx="20"
510
- fill="#F3E8FF"
511
- stroke="#D8B4FE"
512
- />
513
- <svg:text
514
- x="0"
515
- y="4"
516
- text-anchor="middle"
517
- font-size="12"
518
- fill="#7E22CE"
519
- font-weight="500"
520
- transform="rotate(-90)"
521
- >
522
- {{ count }}
523
- </svg:text>
524
- </svg:g>
525
- </svg:g>
526
- `, styles: [":host{display:block}circle:hover{fill:#f3e8ff}\n"] }]
527
- }], propDecorators: { label: [{
528
- type: Input
529
- }], count: [{
530
- type: Input
531
- }], addClick: [{
532
- type: Output
533
- }], labelChange: [{
534
- type: Output
535
- }] } });
536
-
537
- // components/workflow/swimlane-popup.component.ts
538
- class SwimLanePopupComponent {
539
- position;
540
- close = new EventEmitter();
541
- actionSelected = new EventEmitter();
542
- actions = [
543
- { id: 'add-above', label: 'Add Swimlane Above' },
544
- { id: 'add-below', label: 'Add Swimlane Below' },
545
- { id: 'delete', label: 'Delete Swimlane' },
546
- ];
547
- onActionClick(action) {
548
- this.actionSelected.emit(action.id);
549
- this.close.emit();
550
- }
551
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SwimLanePopupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
552
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: SwimLanePopupComponent, isStandalone: true, selector: "wf-swimlane-popup", inputs: { position: "position" }, outputs: { close: "close", actionSelected: "actionSelected" }, ngImport: i0, template: `
553
- <div
554
- class="fixed bg-white rounded-lg shadow-lg border border-slate-200 p-4 min-w-[200px]"
555
- [style.left.px]="position.x"
556
- [style.top.px]="position.y"
557
- >
558
- <div class="flex justify-between items-center mb-4">
559
- <h3 class="text-sm font-medium text-slate-900">Swimlane Actions</h3>
560
- <button
561
- class="text-slate-400 hover:text-slate-600"
562
- (click)="close.emit()"
563
- >×</button>
564
- </div>
565
-
566
- <div class="space-y-2">
567
- <button
568
- *ngFor="let action of actions"
569
- class="w-full text-left px-3 py-2 text-sm text-slate-700 hover:bg-purple-50 rounded-md"
570
- (click)="onActionClick(action)"
571
- >
572
- {{ action.label }}
573
- </button>
574
- </div>
575
- </div>
576
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
577
- }
578
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SwimLanePopupComponent, decorators: [{
579
- type: Component,
580
- args: [{
581
- selector: 'wf-swimlane-popup',
582
- standalone: true,
583
- imports: [CommonModule],
584
- template: `
585
- <div
586
- class="fixed bg-white rounded-lg shadow-lg border border-slate-200 p-4 min-w-[200px]"
587
- [style.left.px]="position.x"
588
- [style.top.px]="position.y"
589
- >
590
- <div class="flex justify-between items-center mb-4">
591
- <h3 class="text-sm font-medium text-slate-900">Swimlane Actions</h3>
592
- <button
593
- class="text-slate-400 hover:text-slate-600"
594
- (click)="close.emit()"
595
- >×</button>
596
- </div>
597
-
598
- <div class="space-y-2">
599
- <button
600
- *ngFor="let action of actions"
601
- class="w-full text-left px-3 py-2 text-sm text-slate-700 hover:bg-purple-50 rounded-md"
602
- (click)="onActionClick(action)"
603
- >
604
- {{ action.label }}
605
- </button>
606
- </div>
607
- </div>
608
- `
609
- }]
610
- }], propDecorators: { position: [{
611
- type: Input
612
- }], close: [{
613
- type: Output
614
- }], actionSelected: [{
615
- type: Output
616
- }] } });
617
-
618
- // services/swimlane-stats.service.ts
619
- class SwimlaneStatsService {
620
- workflowState = inject(WorkflowStateService);
621
- popupState = signal({
622
- isOpen: false,
623
- position: { x: 0, y: 0 },
624
- swimlaneId: null,
625
- });
626
- popupStatus = this.popupState.asReadonly();
627
- getNodeCount(swimlaneId) {
628
- const nodes = this.workflowState.nodes();
629
- return nodes.filter((node) => this.isNodeInSwimlane(node, swimlaneId))
630
- .length;
631
- }
632
- isNodeInSwimlane(node, swimlaneId) {
633
- const swimlane = this.workflowState.getObjectById(swimlaneId);
634
- if (!swimlane)
635
- return false;
636
- return (node.position.y >= swimlane.position.y &&
637
- node.position.y <= swimlane.position.y + swimlane.size.height);
638
- }
639
- openPopup(position, swimlaneId) {
640
- this.popupState.set({
641
- isOpen: true,
642
- position,
643
- swimlaneId,
644
- });
645
- }
646
- closePopup() {
647
- this.popupState.update((state) => ({ ...state, isOpen: false }));
648
- }
649
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SwimlaneStatsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
650
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SwimlaneStatsService, providedIn: 'root' });
651
- }
652
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SwimlaneStatsService, decorators: [{
653
- type: Injectable,
654
- args: [{
655
- providedIn: 'root',
656
- }]
657
- }] });
658
-
659
- // services/canvas-state.service.ts
660
- class CanvasStateService {
661
- state = signal({
662
- width: 3000,
663
- height: 2000,
664
- gridSize: 20,
665
- isConnecting: false,
666
- isDragging: false,
667
- dragStartPosition: null,
668
- dragOffset: { x: 0, y: 0 },
669
- connectionPreview: null,
670
- });
671
- canvasState = this.state.asReadonly();
672
- setConnecting(isConnecting) {
673
- this.state.update((state) => ({ ...state, isConnecting }));
674
- }
675
- setDragging(isDragging) {
676
- this.state.update((state) => ({ ...state, isDragging }));
677
- }
678
- setDragStartPosition(position) {
679
- this.state.update((state) => ({ ...state, dragStartPosition: position }));
680
- }
681
- setDragOffset(offset) {
682
- this.state.update((state) => ({ ...state, dragOffset: offset }));
683
- }
684
- setConnectionPreview(points) {
685
- this.state.update((state) => ({ ...state, connectionPreview: points }));
686
- }
687
- resetInteractionState() {
688
- this.state.update((state) => ({
689
- ...state,
690
- isConnecting: false,
691
- isDragging: false,
692
- dragStartPosition: null,
693
- dragOffset: { x: 0, y: 0 },
694
- connectionPreview: null,
695
- }));
696
- }
697
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CanvasStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
698
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CanvasStateService, providedIn: 'root' });
699
- }
700
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CanvasStateService, decorators: [{
701
- type: Injectable,
702
- args: [{
703
- providedIn: 'root',
704
- }]
705
- }] });
706
-
707
- // services/node-finder.service.ts
708
- class NodeFinderService {
709
- workflowState = inject(WorkflowStateService);
710
- findNodeAtPoint(point) {
711
- return (this.workflowState
712
- .nodes()
713
- .find((node) => this.isPointInNode(point, node)) || null);
714
- }
715
- isPointInNode(point, node) {
716
- return (point.x >= node.position.x &&
717
- point.x <= node.position.x + node.size.width &&
718
- point.y >= node.position.y &&
719
- point.y <= node.position.y + node.size.height);
720
- }
721
- isProtectedNode(node) {
722
- return ['start', 'swimlane'].includes(node.type);
723
- }
724
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NodeFinderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
725
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NodeFinderService, providedIn: 'root' });
726
- }
727
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NodeFinderService, decorators: [{
728
- type: Injectable,
729
- args: [{
730
- providedIn: 'root',
731
- }]
732
- }] });
733
-
734
- class NodeSelectionService {
735
- workflowState = inject(WorkflowStateService);
736
- nodeFinder = inject(NodeFinderService);
737
- canvasState = inject(CanvasStateService);
738
- handleNodeClick(point) {
739
- // Clear any ongoing interactions first
740
- this.canvasState.resetInteractionState();
741
- const nodes = this.workflowState.nodes();
742
- const clickedNode = this.nodeFinder.findNodeAtPoint(point);
743
- if (clickedNode) {
744
- this.selectNode(clickedNode.id);
745
- }
746
- else {
747
- this.clearSelection();
748
- }
749
- }
750
- selectNode(nodeId) {
751
- // Don't reselect if already selected
752
- if (this.workflowState.selectedObjectId() === nodeId)
753
- return;
754
- this.workflowState.setSelectedObject(nodeId);
755
- }
756
- clearSelection() {
757
- this.workflowState.setSelectedObject(null);
758
- }
759
- isSelected(nodeId) {
760
- return this.workflowState.selectedObjectId() === nodeId;
761
- }
762
- getSelectedNode() {
763
- const selectedId = this.workflowState.selectedObjectId();
764
- if (!selectedId)
765
- return null;
766
- return this.workflowState.getObjectById(selectedId) || null;
767
- }
768
- canSelectNode(node) {
769
- // Add any rules for node selection here
770
- // For example, prevent selecting swimlanes
771
- return node.type !== 'swimlane';
772
- }
773
- handleToolSelection(nodeType) {
774
- // Clear selection when tool is selected
775
- if (nodeType) {
776
- this.clearSelection();
777
- }
778
- }
779
- handleKeyboardEvent(event) {
780
- // Handle keyboard shortcuts for selection
781
- // For example, 'Escape' to clear selection
782
- if (event.key === 'Escape') {
783
- this.clearSelection();
784
- }
785
- }
786
- handleClickOutside(event) {
787
- // Check if click is outside any node and clear selection
788
- const target = event.target;
789
- if (target.tagName === 'svg' ||
790
- target.classList.contains('canvas-container')) {
791
- this.clearSelection();
792
- }
793
- }
794
- deleteSelectedObject() {
795
- const selectedId = this.workflowState.selectedObjectId();
796
- if (!selectedId)
797
- return;
798
- const selectedObject = this.workflowState.getObjectById(selectedId);
799
- if (!selectedObject)
800
- return;
801
- // First, remove any connections to/from this object
802
- const connections = this.workflowState.connections();
803
- const relatedConnectionIds = connections
804
- .filter((conn) => conn.fromId === selectedId || conn.toId === selectedId)
805
- .map((conn) => conn.id);
806
- // Remove all related connections
807
- relatedConnectionIds.forEach((id) => {
808
- this.workflowState.removeObject(id);
809
- });
810
- // Remove the selected object
811
- this.workflowState.removeObject(selectedId);
812
- // Clear the selection
813
- this.clearSelection();
814
- }
815
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NodeSelectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
816
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NodeSelectionService, providedIn: 'root' });
817
- }
818
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NodeSelectionService, decorators: [{
819
- type: Injectable,
820
- args: [{
821
- providedIn: 'root',
822
- }]
823
- }] });
824
-
825
- // services/keyboard-handler.service.ts
826
- class KeyboardHandlerService {
827
- workflowState = inject(WorkflowStateService);
828
- selection = inject(NodeSelectionService);
829
- handleKeyDown(event) {
830
- // Only handle keyboard events if an object is selected
831
- if (!this.workflowState.selectedObjectId())
832
- return;
833
- switch (event.key) {
834
- case 'Delete':
835
- case 'Backspace':
836
- this.handleDelete();
837
- break;
838
- // Add other keyboard shortcuts here
839
- }
840
- }
841
- handleDelete() {
842
- const selectedId = this.workflowState.selectedObjectId();
843
- if (!selectedId)
844
- return;
845
- const selectedObject = this.workflowState.getObjectById(selectedId);
846
- if (!selectedObject)
847
- return;
848
- // Don't delete protected nodes like start node or swimlanes
849
- if (['start', 'swimlane'].includes(selectedObject.type))
850
- return;
851
- // Remove the object and its connections
852
- this.selection.deleteSelectedObject();
853
- }
854
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KeyboardHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
855
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KeyboardHandlerService, providedIn: 'root' });
856
- }
857
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KeyboardHandlerService, decorators: [{
858
- type: Injectable,
859
- args: [{
860
- providedIn: 'root',
861
- }]
862
- }] });
863
-
864
- // services/rendering.service.ts
865
- class RenderingService {
866
- // Node path generation
867
- generateNodePath(object) {
868
- switch (object.type) {
869
- case 'start':
870
- return this.getStartNodePath(object.size.width, object.size.height);
871
- case 'decision':
872
- return this.getDecisionPath(object.size.width, object.size.height);
873
- case 'form':
874
- return this.getFormPath(object.size.width, object.size.height);
875
- case 'subflow':
876
- return this.getSubflowPath(object.size.width, object.size.height);
877
- default:
878
- return '';
879
- }
880
- }
881
- // Individual path generators
882
- getStartNodePath(width, height) {
883
- return `M${width} ${height / 2}
884
- A${width / 2} ${height / 2} 0 0 0
885
- 0 ${height / 2}
886
- A${width / 2} ${height / 2} 0 0 0
887
- ${width} ${height / 2}`;
888
- }
889
- getFormPath(width, height) {
890
- // Use exact path from design SVG
891
- return `M74.0625 40.5591V85.0625C74.0625 87.9716 72.9069 90.7615 70.8498 92.8186C68.7928 94.8756 66.0028 96.0312 63.0938 96.0312H11.9062C8.99716 96.0312 6.20721 94.8756 4.15017 92.8186C2.09313 90.7615 0.9375 87.9716 0.9375 85.0625V11.9375C0.9375 9.02841 2.09313 6.23846 4.15017 4.18142C6.20721 2.12438 8.99716 0.96875 11.9062 0.96875H34.4722C36.4109 0.969043 38.2701 1.73921 39.6412 3.10994L71.9213 35.3901C73.292 36.7611 74.0622 38.6204 74.0625 40.5591Z`;
892
- }
893
- getStartNodePaths() {
894
- return {
895
- circle: 'M57.5 23C57.5 35.3246 44.8544 45.5 29 45.5C13.1456 45.5 0.5 35.3246 0.5 23C0.5 10.6754 13.1456 0.5 29 0.5C44.8544 0.5 57.5 10.6754 57.5 23Z',
896
- arrow: 'M74 6L64 0.226497V11.7735L74 6ZM0 7H65V5H0V7Z',
897
- };
898
- }
899
- getNodeStyle(isSelected) {
900
- return {
901
- fill: 'white',
902
- stroke: '#D36CFF',
903
- strokeWidth: isSelected ? 2 : 1,
904
- strokeLinejoin: 'round',
905
- };
906
- }
907
- getConnectionStyle(isSelected) {
908
- return {
909
- stroke: '#D36CFF',
910
- strokeWidth: isSelected ? '2' : '1',
911
- fill: 'none',
912
- };
913
- }
914
- getConnectionPreviewStyle() {
915
- return {
916
- stroke: '#D36CFF',
917
- strokeWidth: '1',
918
- strokeDasharray: '4',
919
- fill: 'none',
920
- };
921
- }
922
- getSwimlaneStyle() {
923
- return {
924
- fill: '#f8fafc',
925
- stroke: '#e2e8f0',
926
- strokeWidth: '1',
927
- };
928
- }
929
- getNodeTransforms(node) {
930
- const baseTransform = `translate(${node.position.x}, ${node.position.y})`;
931
- switch (node.type) {
932
- case 'start':
933
- return {
934
- node: baseTransform,
935
- arrow: 'translate(57, 17)', // Position arrow relative to circle
936
- };
937
- case 'decision':
938
- return {
939
- node: baseTransform,
940
- indicator: `translate(${node.size.width + 10}, -10)`, // Position properties indicator
941
- };
942
- default:
943
- return { node: baseTransform };
944
- }
945
- }
946
- getDecisionNodePath(width, height) {
947
- return `M${width / 2} 0 L${width} ${height / 2} L${width / 2} ${height} L0 ${height / 2} Z`;
948
- }
949
- getPropertiesIndicator() {
950
- return {
951
- circle: {
952
- r: 8,
953
- style: {
954
- fill: 'white',
955
- stroke: '#D36CFF',
956
- strokeWidth: 1,
957
- },
958
- },
959
- text: {
960
- content: 'i',
961
- style: {
962
- fontSize: '12px',
963
- textAnchor: 'middle',
964
- alignmentBaseline: 'middle',
965
- userSelect: 'none',
966
- pointerEvents: 'none',
967
- },
968
- },
969
- };
970
- }
971
- getLabelStyle(nodeType) {
972
- const baseStyle = {
973
- fontSize: '12px',
974
- textAnchor: 'middle',
975
- dominantBaseline: 'middle',
976
- userSelect: 'none',
977
- pointerEvents: 'none',
978
- };
979
- switch (nodeType) {
980
- case 'swimlane':
981
- return {
982
- ...baseStyle,
983
- fontSize: '14px',
984
- fontWeight: '500',
985
- fill: '#64748b',
986
- // writingMode: 'vertical-lr',
987
- };
988
- default:
989
- return baseStyle;
990
- }
991
- }
992
- getDefaultDimensions() {
993
- return {
994
- width: 3000,
995
- height: 2000,
996
- gridSize: 20,
997
- };
998
- }
999
- getGridPattern() {
1000
- return {
1001
- pattern: {
1002
- width: 20,
1003
- height: 20,
1004
- },
1005
- path: {
1006
- d: 'M 20 0 L 0 0 0 20',
1007
- style: {
1008
- fill: 'none',
1009
- stroke: '#e2e8f0',
1010
- strokeWidth: '0.5',
1011
- },
1012
- },
1013
- };
1014
- }
1015
- // getConnectionPath(points: Position[]): string {
1016
- // if (!points || points.length < 2) return '';
1017
- // const [start, ...rest] = points;
1018
- // const end = rest[rest.length - 1];
1019
- // // Create the main path
1020
- // const mainPath =
1021
- // `M ${start.x} ${start.y} ` + rest.map((p) => `L ${p.x} ${p.y}`).join(' ');
1022
- // // Add arrowhead
1023
- // const arrowPath = this.createArrowhead(
1024
- // end,
1025
- // this.getEndPointAngle(points[points.length - 2], end)
1026
- // );
1027
- // return `${mainPath} ${arrowPath}`;
1028
- // }
1029
- /**
1030
- * Gets the SVG path for a connection
1031
- */
1032
- getConnectionPath(points) {
1033
- if (!points || points.length < 2)
1034
- return '';
1035
- // Create the main path
1036
- const pathCommands = points.map((point, index) => {
1037
- return index === 0
1038
- ? `M ${point.x} ${point.y}`
1039
- : `L ${point.x} ${point.y}`;
1040
- });
1041
- // Add arrowhead to the last segment
1042
- const lastSegmentStart = points[points.length - 2];
1043
- const lastSegmentEnd = points[points.length - 1];
1044
- const arrowPath = this.createArrowhead(lastSegmentEnd, this.getEndPointAngle(lastSegmentStart, lastSegmentEnd));
1045
- return `${pathCommands.join(' ')} ${arrowPath}`;
1046
- }
1047
- /**
1048
- * Gets style for an individual connection segment
1049
- */
1050
- getConnectionSegmentStyle(isSelected, isHovered) {
1051
- return {
1052
- stroke: '#D36CFF',
1053
- strokeWidth: isSelected ? '2' : isHovered ? '2' : '1',
1054
- fill: 'none',
1055
- transition: 'stroke-width 0.2s ease',
1056
- };
1057
- }
1058
- createArrowhead(point, angle) {
1059
- const arrowSize = 10;
1060
- const arrowPoints = [
1061
- {
1062
- x: point.x - arrowSize * Math.cos(angle - Math.PI / 6),
1063
- y: point.y - arrowSize * Math.sin(angle - Math.PI / 6),
1064
- },
1065
- point,
1066
- {
1067
- x: point.x - arrowSize * Math.cos(angle + Math.PI / 6),
1068
- y: point.y - arrowSize * Math.sin(angle + Math.PI / 6),
1069
- },
1070
- ];
1071
- return (`M ${arrowPoints[0].x} ${arrowPoints[0].y} ` +
1072
- `L ${arrowPoints[1].x} ${arrowPoints[1].y} ` +
1073
- `L ${arrowPoints[2].x} ${arrowPoints[2].y}`);
1074
- }
1075
- getEndPointAngle(p1, p2) {
1076
- return Math.atan2(p2.y - p1.y, p2.x - p1.x);
1077
- }
1078
- getDecisionPath(width, height) {
1079
- // Using the exact dimensions from your SVG
1080
- const centerX = width / 2;
1081
- const centerY = height / 2;
1082
- return `M0.981845 ${centerY} L${centerX} 0.580976 L${width - 0.981845} ${centerY} L${centerX} ${height - 0.580976}Z`;
1083
- }
1084
- getSubflowPath(width, height) {
1085
- // Using the exact dimensions from your SVG
1086
- return `M1.19873 ${height * 0.252887}L${width / 2} 0.57735L${width - 1.19873} ${height * 0.252887}V${height * 0.747113}L${width / 2} ${height - 0.57735}L1.19873 ${height * 0.747113}V${height * 0.252887}`;
1087
- }
1088
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RenderingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1089
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RenderingService, providedIn: 'root' });
1090
- }
1091
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RenderingService, decorators: [{
1092
- type: Injectable,
1093
- args: [{
1094
- providedIn: 'root',
1095
- }]
1096
- }] });
1097
-
1098
- // services/orthogonal-router.service.ts
1099
- class OrthogonalRouterService {
1100
- /**
1101
- * Finds the closest node side and point for a given mouse position
1102
- */
1103
- findConnectionPoint(node, mousePos) {
1104
- const { position: pos, size } = node;
1105
- // Calculate distances to each side
1106
- const distToTop = Math.abs(mousePos.y - pos.y);
1107
- const distToBottom = Math.abs(mousePos.y - (pos.y + size.height));
1108
- const distToLeft = Math.abs(mousePos.x - pos.x);
1109
- const distToRight = Math.abs(mousePos.x - (pos.x + size.width));
1110
- // Find the minimum distance
1111
- const minDist = Math.min(distToTop, distToBottom, distToLeft, distToRight);
1112
- // Determine connection point based on closest side
1113
- let side;
1114
- let x;
1115
- let y;
1116
- if (minDist === distToTop) {
1117
- side = 'top';
1118
- x = Math.min(Math.max(mousePos.x, pos.x), pos.x + size.width);
1119
- y = pos.y;
1120
- }
1121
- else if (minDist === distToBottom) {
1122
- side = 'bottom';
1123
- x = Math.min(Math.max(mousePos.x, pos.x), pos.x + size.width);
1124
- y = pos.y + size.height;
1125
- }
1126
- else if (minDist === distToLeft) {
1127
- side = 'left';
1128
- x = pos.x;
1129
- y = Math.min(Math.max(mousePos.y, pos.y), pos.y + size.height);
1130
- }
1131
- else {
1132
- side = 'right';
1133
- x = pos.x + size.width;
1134
- y = Math.min(Math.max(mousePos.y, pos.y), pos.y + size.height);
1135
- }
1136
- return { x, y, side };
1137
- }
1138
- /**
1139
- * Calculates the optimal orthogonal route between two points
1140
- */
1141
- calculateRoute(startNode, endNode, startPoint, endPoint) {
1142
- // Convert connection points to routing points
1143
- const start = { ...startPoint, type: 'start' };
1144
- const end = { ...endPoint, type: 'end' };
1145
- // If points are aligned vertically or horizontally, create direct route
1146
- if (Math.abs(start.x - end.x) < 10) {
1147
- return this.createVerticalRoute(start, end);
1148
- }
1149
- if (Math.abs(start.y - end.y) < 10) {
1150
- return this.createHorizontalRoute(start, end);
1151
- }
1152
- // Create route based on connection sides
1153
- return this.createRouteFromSides(start, end, startPoint.side, endPoint.side);
1154
- }
1155
- createRouteFromSides(start, end, startSide, endSide) {
1156
- const points = [start];
1157
- // Determine if we need to start horizontally or vertically based on the start side
1158
- const startHorizontal = startSide === 'left' || startSide === 'right';
1159
- const endHorizontal = endSide === 'left' || endSide === 'right';
1160
- if (startHorizontal) {
1161
- // Start with horizontal movement
1162
- const midX = (start.x + end.x) / 2;
1163
- if (start.y !== end.y) {
1164
- points.push(this.createBendPoint(midX, start.y, true));
1165
- points.push(this.createBendPoint(midX, end.y, false));
1166
- }
1167
- }
1168
- else {
1169
- // Start with vertical movement
1170
- const midY = (start.y + end.y) / 2;
1171
- if (start.x !== end.x) {
1172
- points.push(this.createBendPoint(start.x, midY, false));
1173
- points.push(this.createBendPoint(end.x, midY, true));
1174
- }
1175
- }
1176
- points.push(end);
1177
- return this.simplifyRoute(points);
1178
- }
1179
- createBendPoint(x, y, isHorizontal) {
1180
- return { x, y, type: 'bend', isHorizontal };
1181
- }
1182
- createHorizontalRoute(start, end) {
1183
- return [start, { ...end, type: 'end', isHorizontal: true }];
1184
- }
1185
- createVerticalRoute(start, end) {
1186
- return [start, { ...end, type: 'end', isHorizontal: false }];
1187
- }
1188
- simplifyRoute(points) {
1189
- // Remove unnecessary bends (where three points form a straight line)
1190
- const simplified = points.filter((point, index) => {
1191
- if (index === 0 || index === points.length - 1)
1192
- return true;
1193
- const prev = points[index - 1];
1194
- const next = points[index + 1];
1195
- // Keep point if it creates an actual bend
1196
- return (!(prev.x === point.x && point.x === next.x) &&
1197
- !(prev.y === point.y && point.y === next.y));
1198
- });
1199
- // Update point types and horizontal flags
1200
- return simplified.map((point, index) => ({
1201
- ...point,
1202
- type: index === 0
1203
- ? 'start'
1204
- : index === simplified.length - 1
1205
- ? 'end'
1206
- : 'bend',
1207
- isHorizontal: index < simplified.length - 1
1208
- ? simplified[index + 1].y === point.y
1209
- : point.y === simplified[index - 1].y,
1210
- }));
1211
- }
1212
- /**
1213
- * Updates a segment's position while maintaining orthogonal constraints
1214
- */
1215
- updateSegment(points, segmentIndex, newPosition) {
1216
- const updatedPoints = [...points];
1217
- const currentPoint = points[segmentIndex];
1218
- const nextPoint = points[segmentIndex + 1];
1219
- if (!currentPoint || !nextPoint)
1220
- return points;
1221
- // Determine if this is a horizontal or vertical segment
1222
- const isHorizontal = currentPoint.y === nextPoint.y;
1223
- if (isHorizontal) {
1224
- // Moving a horizontal segment - adjust y coordinate
1225
- updatedPoints[segmentIndex].y = newPosition.y;
1226
- updatedPoints[segmentIndex + 1].y = newPosition.y;
1227
- }
1228
- else {
1229
- // Moving a vertical segment - adjust x coordinate
1230
- updatedPoints[segmentIndex].x = newPosition.x;
1231
- updatedPoints[segmentIndex + 1].x = newPosition.x;
1232
- }
1233
- return this.simplifyRoute(updatedPoints);
1234
- }
1235
- /**
1236
- * Determines if a point is near enough to a line segment for manipulation
1237
- */
1238
- isPointNearSegment(point, segmentStart, segmentEnd, threshold = 10) {
1239
- // For horizontal segments
1240
- if (segmentStart.y === segmentEnd.y) {
1241
- return (Math.abs(point.y - segmentStart.y) <= threshold &&
1242
- point.x >= Math.min(segmentStart.x, segmentEnd.x) &&
1243
- point.x <= Math.max(segmentStart.x, segmentEnd.x));
1244
- }
1245
- // For vertical segments
1246
- if (segmentStart.x === segmentEnd.x) {
1247
- return (Math.abs(point.x - segmentStart.x) <= threshold &&
1248
- point.y >= Math.min(segmentStart.y, segmentEnd.y) &&
1249
- point.y <= Math.max(segmentStart.y, segmentEnd.y));
1250
- }
1251
- return false;
1252
- }
1253
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: OrthogonalRouterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1254
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: OrthogonalRouterService, providedIn: 'root' });
1255
- }
1256
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: OrthogonalRouterService, decorators: [{
1257
- type: Injectable,
1258
- args: [{
1259
- providedIn: 'root',
1260
- }]
1261
- }] });
1262
-
1263
- // services/connection-segment-interaction.service.ts
1264
- class ConnectionSegmentInteractionService {
1265
- workflowState = inject(WorkflowStateService);
1266
- orthogonalRouter = inject(OrthogonalRouterService);
1267
- dragState = null;
1268
- /**
1269
- * Identifies if a point is near any connection segment
1270
- */
1271
- findSegmentAtPoint(point) {
1272
- const connections = this.workflowState.connections();
1273
- for (const connection of connections) {
1274
- const points = connection.points;
1275
- if (!points || points.length < 2)
1276
- continue;
1277
- // Check each segment
1278
- for (let i = 0; i < points.length - 1; i++) {
1279
- if (this.orthogonalRouter.isPointNearSegment(point, points[i], points[i + 1])) {
1280
- return {
1281
- connectionId: connection.id,
1282
- segmentIndex: i,
1283
- };
1284
- }
1285
- }
1286
- }
1287
- return null;
1288
- }
1289
- /**
1290
- * Starts dragging a connection segment
1291
- */
1292
- startDragging(connectionId, segmentIndex, point) {
1293
- this.dragState = {
1294
- connectionId,
1295
- segmentIndex,
1296
- initialPosition: point,
1297
- };
1298
- }
1299
- /**
1300
- * Updates segment position during drag
1301
- */
1302
- updateDragging(point) {
1303
- if (!this.dragState)
1304
- return;
1305
- const connection = this.workflowState.getObjectById(this.dragState.connectionId);
1306
- if (!connection || !connection.points)
1307
- return;
1308
- // Convert Position[] to RoutingPoint[]
1309
- const routingPoints = connection.points.map((p, index) => ({
1310
- ...p,
1311
- type: index === 0
1312
- ? 'start'
1313
- : index === connection.points.length - 1
1314
- ? 'end'
1315
- : 'bend',
1316
- isHorizontal: index < connection.points.length - 1
1317
- ? connection.points[index].y === connection.points[index + 1].y
1318
- : false,
1319
- }));
1320
- const updatedPoints = this.orthogonalRouter.updateSegment(routingPoints, this.dragState.segmentIndex, point);
1321
- // Convert back to Position[] for storage
1322
- const positionPoints = updatedPoints.map((p) => ({
1323
- x: p.x,
1324
- y: p.y,
1325
- }));
1326
- this.workflowState.updateObject(connection.id, {
1327
- points: positionPoints,
1328
- });
1329
- }
1330
- /**
1331
- * Completes the drag operation
1332
- */
1333
- finishDragging() {
1334
- // Additional cleanup if needed
1335
- this.dragState = null;
1336
- }
1337
- /**
1338
- * Returns whether a segment is currently being dragged
1339
- */
1340
- isDragging() {
1341
- return this.dragState !== null;
1342
- }
1343
- /**
1344
- * Gets cursor style based on segment orientation
1345
- */
1346
- getSegmentCursor(connectionId, segmentIndex) {
1347
- const connection = this.workflowState.getObjectById(connectionId);
1348
- if (!connection || !connection.points)
1349
- return 'default';
1350
- const point = connection.points[segmentIndex];
1351
- const nextPoint = connection.points[segmentIndex + 1];
1352
- if (!point || !nextPoint)
1353
- return 'default';
1354
- // Return appropriate cursor based on segment orientation
1355
- return point.y === nextPoint.y ? 'ns-resize' : 'ew-resize';
1356
- }
1357
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ConnectionSegmentInteractionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1358
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ConnectionSegmentInteractionService, providedIn: 'root' });
1359
- }
1360
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ConnectionSegmentInteractionService, decorators: [{
1361
- type: Injectable,
1362
- args: [{
1363
- providedIn: 'root',
1364
- }]
1365
- }] });
1366
-
1367
- // services/connection.service.ts
1368
- class ConnectionService {
1369
- workflowState = inject(WorkflowStateService);
1370
- canvasState = inject(CanvasStateService);
1371
- nodeFinder = inject(NodeFinderService);
1372
- rendering = inject(RenderingService);
1373
- orthogonalRouter = inject(OrthogonalRouterService);
1374
- segmentInteraction = inject(ConnectionSegmentInteractionService);
1375
- connectionEndpoints = new Map();
1376
- startConnection(sourceNode, point) {
1377
- if (!this.canStartConnection(sourceNode))
1378
- return;
1379
- const startPoint = {
1380
- ...this.orthogonalRouter.findConnectionPoint(sourceNode, point),
1381
- type: 'start',
1382
- position: point,
1383
- };
1384
- this.canvasState.setConnecting(true);
1385
- this.workflowState.setSelectedObject(sourceNode.id);
1386
- // Store the start point for later use
1387
- const tempId = 'preview';
1388
- this.connectionEndpoints.set(tempId, {
1389
- startPoint,
1390
- endPoint: { ...startPoint }, // Create a new object with the same properties
1391
- });
1392
- // Calculate initial preview route
1393
- const previewPoints = this.orthogonalRouter.calculateRoute(sourceNode, { position: point, size: { width: 0, height: 0 } }, startPoint, startPoint);
1394
- this.canvasState.setConnectionPreview(previewPoints);
1395
- }
1396
- updateConnectionPreview(point) {
1397
- const sourceNodeId = this.workflowState.selectedObjectId();
1398
- if (!sourceNodeId)
1399
- return;
1400
- const sourceNode = this.workflowState.getObjectById(sourceNodeId);
1401
- if (!sourceNode)
1402
- return;
1403
- const endpoints = this.connectionEndpoints.get('preview');
1404
- if (!endpoints)
1405
- return;
1406
- const endPoint = {
1407
- x: point.x,
1408
- y: point.y,
1409
- side: this.determineEndSide(endpoints.startPoint, point),
1410
- type: 'end',
1411
- position: point,
1412
- };
1413
- // Update preview with new end point
1414
- const previewPoints = this.orthogonalRouter.calculateRoute(sourceNode, { position: point, size: { width: 0, height: 0 } }, endpoints.startPoint, endPoint);
1415
- this.canvasState.setConnectionPreview(previewPoints);
1416
- }
1417
- finalizeConnection(point) {
1418
- const sourceNodeId = this.workflowState.selectedObjectId();
1419
- if (!sourceNodeId)
1420
- return;
1421
- const sourceNode = this.workflowState.getObjectById(sourceNodeId);
1422
- if (!sourceNode)
1423
- return;
1424
- const targetNode = this.nodeFinder.findNodeAtPoint(point);
1425
- const endpoints = this.connectionEndpoints.get('preview');
1426
- if (targetNode && endpoints && this.canConnect(sourceNode, targetNode)) {
1427
- const endPoint = {
1428
- ...this.orthogonalRouter.findConnectionPoint(targetNode, point),
1429
- type: 'end',
1430
- position: point,
1431
- };
1432
- // Calculate final route
1433
- const routePoints = this.orthogonalRouter.calculateRoute(sourceNode, targetNode, endpoints.startPoint, endPoint);
1434
- const newConnection = {
1435
- id: crypto.randomUUID(),
1436
- type: 'action',
1437
- fromId: sourceNode.id,
1438
- toId: targetNode.id,
1439
- label: '',
1440
- position: sourceNode.position,
1441
- size: { width: 0, height: 0 },
1442
- points: routePoints,
1443
- };
1444
- // Store the connection endpoints for later use
1445
- this.connectionEndpoints.set(newConnection.id, {
1446
- startPoint: endpoints.startPoint,
1447
- endPoint,
1448
- });
1449
- this.workflowState.addObject(newConnection);
1450
- }
1451
- this.connectionEndpoints.delete('preview');
1452
- }
1453
- updateConnectionsForNode(nodeId) {
1454
- const node = this.workflowState.getObjectById(nodeId);
1455
- if (!node)
1456
- return;
1457
- const connections = this.workflowState
1458
- .connections()
1459
- .filter((conn) => conn.fromId === nodeId || conn.toId === nodeId);
1460
- connections.forEach((connection) => {
1461
- const sourceNode = this.workflowState.getObjectById(connection.fromId);
1462
- const targetNode = this.workflowState.getObjectById(connection.toId);
1463
- if (sourceNode && targetNode) {
1464
- // Determine connection points based on current node positions
1465
- const startPoint = {
1466
- ...this.orthogonalRouter.findConnectionPoint(sourceNode, {
1467
- x: sourceNode.position.x + sourceNode.size.width / 2,
1468
- y: sourceNode.position.y + sourceNode.size.height / 2,
1469
- }),
1470
- type: 'start',
1471
- position: sourceNode.position,
1472
- };
1473
- const endPoint = {
1474
- ...this.orthogonalRouter.findConnectionPoint(targetNode, {
1475
- x: targetNode.position.x + targetNode.size.width / 2,
1476
- y: targetNode.position.y + targetNode.size.height / 2,
1477
- }),
1478
- type: 'end',
1479
- position: targetNode.position,
1480
- };
1481
- // Calculate completely new route
1482
- const newPoints = this.orthogonalRouter.calculateRoute(sourceNode, targetNode, startPoint, endPoint);
1483
- // Update connection
1484
- this.workflowState.updateObject(connection.id, {
1485
- points: newPoints,
1486
- });
1487
- // Store new endpoints
1488
- this.connectionEndpoints.set(connection.id, { startPoint, endPoint });
1489
- }
1490
- });
1491
- }
1492
- determineEndSide(startPoint, endPoint) {
1493
- // Determine the best side for the end point based on relative position
1494
- const dx = endPoint.x - startPoint.x;
1495
- const dy = endPoint.y - startPoint.y;
1496
- if (Math.abs(dx) > Math.abs(dy)) {
1497
- return dx > 0 ? 'left' : 'right';
1498
- }
1499
- else {
1500
- return dy > 0 ? 'top' : 'bottom';
1501
- }
1502
- }
1503
- /**
1504
- * Handles clicking on a connection segment
1505
- */
1506
- handleSegmentClick(point) {
1507
- const segment = this.segmentInteraction.findSegmentAtPoint(point);
1508
- if (segment) {
1509
- this.segmentInteraction.startDragging(segment.connectionId, segment.segmentIndex, point);
1510
- }
1511
- }
1512
- /**
1513
- * Updates segment position during drag
1514
- */
1515
- handleSegmentDrag(point) {
1516
- if (this.segmentInteraction.isDragging()) {
1517
- this.segmentInteraction.updateDragging(point);
1518
- }
1519
- }
1520
- /**
1521
- * Completes segment drag operation
1522
- */
1523
- finishSegmentDrag() {
1524
- this.segmentInteraction.finishDragging();
1525
- }
1526
- /**
1527
- * Gets cursor style for a segment
1528
- */
1529
- getSegmentCursor(connectionId, segmentIndex) {
1530
- return this.segmentInteraction.getSegmentCursor(connectionId, segmentIndex);
1531
- }
1532
- getConnectionPath(connection) {
1533
- if (!connection.points || connection.points.length < 2)
1534
- return '';
1535
- const points = connection.points;
1536
- const [start, ...rest] = points;
1537
- return (`M ${start.x} ${start.y} ` + rest.map((p) => `L ${p.x} ${p.y}`).join(' '));
1538
- }
1539
- canStartConnection(node) {
1540
- if (node.type === 'start') {
1541
- // Start node can only have one outgoing connection
1542
- return !this.hasOutgoingConnections(node.id);
1543
- }
1544
- return ['stage', 'decision', 'form', 'subflow'].includes(node.type);
1545
- }
1546
- canConnect(source, target) {
1547
- if (!target || source.id === target.id)
1548
- return false;
1549
- // Prevent connections to start node and swimlanes
1550
- if (['start', 'swimlane'].includes(target.type))
1551
- return false;
1552
- // Prevent duplicate connections
1553
- return !this.hasConnection(source.id, target.id);
1554
- }
1555
- hasConnection(sourceId, targetId) {
1556
- return this.workflowState
1557
- .connections()
1558
- .some((conn) => conn.fromId === sourceId &&
1559
- conn.toId === targetId);
1560
- }
1561
- getPreviewPath() {
1562
- const preview = this.canvasState.canvasState().connectionPreview;
1563
- if (!preview || preview.length < 2)
1564
- return '';
1565
- // Use the rendering service for consistent path generation
1566
- return this.rendering.getConnectionPath(preview);
1567
- }
1568
- hasOutgoingConnections(nodeId) {
1569
- return this.workflowState
1570
- .connections()
1571
- .some((conn) => conn.fromId === nodeId);
1572
- }
1573
- getConnectionPoint(node, type) {
1574
- const center = {
1575
- x: node.position.x + node.size.width / 2,
1576
- y: node.position.y + node.size.height / 2,
1577
- };
1578
- switch (node.type) {
1579
- case 'stage':
1580
- return {
1581
- x: type === 'input'
1582
- ? node.position.x
1583
- : node.position.x + node.size.width,
1584
- y: center.y,
1585
- };
1586
- case 'decision':
1587
- return type === 'input'
1588
- ? { x: center.x, y: node.position.y }
1589
- : { x: node.position.x + node.size.width, y: center.y };
1590
- default:
1591
- return type === 'input'
1592
- ? { x: node.position.x, y: center.y }
1593
- : { x: node.position.x + node.size.width, y: center.y };
1594
- }
1595
- }
1596
- recalculateConnectionPoints(source, target, existingPoints) {
1597
- // Start and end points
1598
- const startPoint = this.getConnectionPoint(source, 'output');
1599
- const endPoint = this.getConnectionPoint(target, 'input');
1600
- // If it's a simple connection, just return direct path
1601
- if (existingPoints.length <= 2) {
1602
- return [startPoint, endPoint];
1603
- }
1604
- // For complex paths, maintain the middle points' relative positions
1605
- const middlePoints = existingPoints.slice(1, -1).map((point) => ({
1606
- x: point.x + (startPoint.x - existingPoints[0].x),
1607
- y: point.y + (startPoint.y - existingPoints[0].y),
1608
- }));
1609
- return [startPoint, ...middlePoints, endPoint];
1610
- }
1611
- // Use nodeFinder methods instead of NodeInteractionService
1612
- findTargetNode(point) {
1613
- return this.nodeFinder.findNodeAtPoint(point);
1614
- }
1615
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ConnectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1616
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ConnectionService, providedIn: 'root' });
1617
- }
1618
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ConnectionService, decorators: [{
1619
- type: Injectable,
1620
- args: [{
1621
- providedIn: 'root',
1622
- }]
1623
- }] });
1624
-
1625
- // services/workflow-mapper.service.ts
1626
- class WorkflowMapperService {
1627
- connectionService;
1628
- constructor(connectionService) {
1629
- this.connectionService = connectionService;
1630
- }
1631
- // Frontend to Backend transformation
1632
- toBackendWorkflow(objects, workflowMetadata) {
1633
- const swimlanes = objects.filter((obj) => obj.type === 'swimlane');
1634
- const stages = objects.filter((obj) => obj.type === 'stage');
1635
- const connections = objects.filter((obj) => obj.type === 'action' &&
1636
- obj?.fromId &&
1637
- obj?.toId);
1638
- const startNode = objects.find((obj) => obj.type === 'start');
1639
- const forms = objects.filter((obj) => obj.type === 'form');
1640
- // Find entry points (stages connected to start node)
1641
- const entryPointIds = connections
1642
- .filter((conn) => conn.fromId === startNode?.id)
1643
- .map((conn) => conn.toId);
1644
- // Find exit points (stages with no outgoing connections)
1645
- const exitPointIds = stages
1646
- .filter((stage) => !connections.some((conn) => conn.fromId === stage.id))
1647
- .map((stage) => stage.id);
1648
- // Preserve original workflow code if it exists, otherwise generate a new one
1649
- const code = workflowMetadata.code || this.generateCode(workflowMetadata.name);
1650
- const workflow = {
1651
- Id: workflowMetadata.id || '',
1652
- id: workflowMetadata.id || '',
1653
- Code: code,
1654
- Name: workflowMetadata.name,
1655
- Description: workflowMetadata.description || `Workflow for ${workflowMetadata.name}`,
1656
- StageEntryRule: this.generateStageEntryRule(entryPointIds.length),
1657
- Form: workflowMetadata.formId || '',
1658
- AssignmentType: TaskAssignmentType.Queue,
1659
- Status: Status.Active,
1660
- Actions: connections.map((connection) => this.toBackendAction(connection, code)),
1661
- Lanes: swimlanes.map((lane) => this.toBackendSwimlane(lane, code)),
1662
- Stages: [],
1663
- TenantId: workflowMetadata.tenantId || '',
1664
- ServiceName: 'Workflow',
1665
- CreatedAt: workflowMetadata.createdAt || new Date(),
1666
- UpdatedAt: new Date(),
1667
- DataState: workflowMetadata.isNew ? ObjectState.New : ObjectState.Changed,
1668
- };
1669
- // Map stages with entry/exit point information
1670
- const mappedStages = stages.map((stage) => this.toBackendStage(stage, code, entryPointIds.includes(stage.id), exitPointIds.includes(stage.id), this.findSwimlaneForStage(stage, swimlanes), workflowMetadata.tenantId || ''));
1671
- // Store stages in workflow
1672
- workflow.Stages = mappedStages;
1673
- return workflow;
1674
- }
1675
- generateCode(name) {
1676
- return name
1677
- .toLowerCase()
1678
- .replace(/[^a-z0-9]+/g, '-')
1679
- .replace(/^-+|-+$/g, '');
1680
- }
1681
- findSwimlaneForStage(stage, swimlanes) {
1682
- return (swimlanes.find((lane) => stage.position.y >= lane.position.y &&
1683
- stage.position.y <= lane.position.y + lane.size.height)?.id || '');
1684
- }
1685
- generateStageEntryRule(entryPointCount) {
1686
- return entryPointCount > 1 ? 'parallel-entry' : 'single-entry';
1687
- }
1688
- toBackendSwimlane(frontendLane, workflow) {
1689
- // Preserve original ID if available
1690
- const originalId = frontendLane.originalId || '';
1691
- return {
1692
- Id: originalId,
1693
- id: originalId,
1694
- Code: frontendLane.originalCode || this.generateCode(frontendLane.label),
1695
- Position: Math.floor(frontendLane.position.y / frontendLane.size.height),
1696
- Workflow: workflow,
1697
- Coordinates: {
1698
- X: frontendLane.position.x,
1699
- Y: frontendLane.position.y,
1700
- },
1701
- Size: {
1702
- Width: frontendLane.size.width,
1703
- Height: frontendLane.size.height,
1704
- },
1705
- Tags: frontendLane.tags || [], // This now correctly maps Tag[] to Tag[]
1706
- TenantId: frontendLane.tenantId || '',
1707
- ServiceName: 'Workflow',
1708
- CreatedAt: frontendLane.createdAt || new Date(),
1709
- UpdatedAt: new Date(),
1710
- DataState: originalId ? ObjectState.Changed : ObjectState.New,
1711
- };
1712
- }
1713
- toBackendStage(frontendStage, workflowId, isEntryPoint, isExitPoint, swimlaneId, tenantId) {
1714
- const stage = frontendStage;
1715
- const originalId = stage.originalId || '';
1716
- return {
1717
- Id: originalId,
1718
- id: originalId,
1719
- Code: stage.originalCode || this.generateCode(stage.label),
1720
- Key: stage.id,
1721
- Workflow: workflowId,
1722
- Name: stage.label,
1723
- Description: stage.description || '',
1724
- Duration: stage.duration || 0,
1725
- PassOnRule: stage.passOnRule || '',
1726
- ActorRule: stage.actorRule || StageActorRule.Any,
1727
- MinNoOfActor: stage.minNoOfActor || 1,
1728
- IsParallel: stage.isParallel || false,
1729
- IsEntryPoint: isEntryPoint,
1730
- IsExitPoint: isExitPoint,
1731
- Tags: stage.tags || [], // Now correctly maps Tag[] to Tag[]
1732
- Form: stage.form || '',
1733
- AllowMultiSubProcess: stage.allowMultiSubProcess || false,
1734
- AssignmentType: stage.assignmentType ||
1735
- TaskAssignmentType.Queue,
1736
- SubWorkFlow: stage.subWorkflow || '',
1737
- SwimLane: swimlaneId,
1738
- Coordinates: {
1739
- X: stage.position.x,
1740
- Y: stage.position.y,
1741
- },
1742
- IsSubProcess: stage.isSubProcess || false,
1743
- TenantId: tenantId,
1744
- ServiceName: 'Workflow',
1745
- CreatedAt: stage.createdAt || new Date(),
1746
- UpdatedAt: new Date(),
1747
- DataState: originalId ? ObjectState.Changed : ObjectState.New,
1748
- };
1749
- }
1750
- toBackendAction(frontendAction, workflow) {
1751
- const originalId = frontendAction.originalId || '';
1752
- return {
1753
- Id: originalId,
1754
- id: originalId,
1755
- Code: frontendAction.originalCode ||
1756
- `${frontendAction.fromId}-to-${frontendAction.toId}`,
1757
- Workflow: workflow,
1758
- Name: frontendAction.label || 'Unnamed Action',
1759
- OperationAction: null,
1760
- FromStage: frontendAction.fromId,
1761
- ToStage: frontendAction.toId,
1762
- IsParallel: frontendAction.isParallel || false,
1763
- PassOnRule: frontendAction.passOnRule || '',
1764
- TenantId: frontendAction.tenantId || '',
1765
- ServiceName: 'Workflow',
1766
- CreatedAt: frontendAction.createdAt || new Date(),
1767
- UpdatedAt: new Date(),
1768
- DataState: originalId ? ObjectState.Changed : ObjectState.New,
1769
- };
1770
- }
1771
- // Backend to Frontend transformation
1772
- toFrontendObjects(workflow) {
1773
- const objects = [];
1774
- // Create metadata object to store workflow information
1775
- const metadata = {
1776
- id: workflow.Id,
1777
- code: workflow.Code,
1778
- name: workflow.Name,
1779
- description: workflow.Description,
1780
- tenantId: workflow.TenantId,
1781
- formId: workflow.Form,
1782
- createdAt: workflow.CreatedAt,
1783
- isNew: workflow.DataState === ObjectState.New,
1784
- };
1785
- // Start with the start node
1786
- const startNode = this.createStartNode();
1787
- objects.push(startNode);
1788
- // Convert swimlanes
1789
- const swimlanes = workflow.Lanes.map((lane) => this.toFrontendSwimlane(lane));
1790
- objects.push(...swimlanes);
1791
- // Convert stages
1792
- const stages = workflow.Stages.map((stage) => this.toFrontendStage(stage));
1793
- objects.push(...stages);
1794
- // Create connections, including from start node to entry points
1795
- const connections = this.createConnections(workflow, startNode.id, stages);
1796
- objects.push(...connections);
1797
- return { objects, metadata };
1798
- }
1799
- createStartNode() {
1800
- return {
1801
- id: 'start-node',
1802
- type: 'start',
1803
- position: { x: 50, y: 37 },
1804
- size: { width: 58, height: 46 },
1805
- label: 'Start',
1806
- };
1807
- }
1808
- toFrontendSwimlane(backendLane) {
1809
- // Normalize the coordinates and size
1810
- const coordinates = backendLane.Coordinates || {
1811
- X: 0,
1812
- Y: backendLane.Position * 120,
1813
- };
1814
- const position = {
1815
- x: coordinates.X ?? 0,
1816
- y: coordinates.Y ?? 0,
1817
- };
1818
- const size = backendLane.Size || { Width: 2960, Height: 120 };
1819
- const normalizedSize = {
1820
- width: size.Width ?? 2960,
1821
- height: size.Height ?? 120,
1822
- };
1823
- return {
1824
- id: backendLane.Code,
1825
- type: 'swimlane',
1826
- position,
1827
- size: normalizedSize,
1828
- label: backendLane.Code,
1829
- // Store original backend information for later use
1830
- originalId: backendLane.Id,
1831
- originalCode: backendLane.Code,
1832
- tags: backendLane.Tags || [],
1833
- tenantId: backendLane.TenantId,
1834
- createdAt: backendLane.CreatedAt,
1835
- };
1836
- }
1837
- toFrontendStage(backendStage) {
1838
- // Normalize coordinates
1839
- const coordinates = backendStage.Coordinates || { X: 0, Y: 0 };
1840
- const position = {
1841
- x: coordinates.X ?? 0,
1842
- y: coordinates.Y ?? 0,
1843
- };
1844
- return {
1845
- id: backendStage.Key || backendStage.Code,
1846
- type: 'stage',
1847
- position,
1848
- size: { width: 120, height: 80 }, // Default size for stages
1849
- label: backendStage.Name,
1850
- // Store original backend information
1851
- originalId: backendStage.Id,
1852
- originalCode: backendStage.Code,
1853
- description: backendStage.Description,
1854
- duration: backendStage.Duration,
1855
- passOnRule: backendStage.PassOnRule,
1856
- actorRule: backendStage.ActorRule,
1857
- minNoOfActor: backendStage.MinNoOfActor,
1858
- isParallel: backendStage.IsParallel,
1859
- isEntryPoint: backendStage.IsEntryPoint,
1860
- isExitPoint: backendStage.IsExitPoint,
1861
- tags: backendStage.Tags,
1862
- forms: backendStage.Form,
1863
- allowMultiSubProcess: backendStage.AllowMultiSubProcess,
1864
- assignmentType: backendStage.AssignmentType,
1865
- subWorkflow: backendStage.SubWorkFlow,
1866
- isSubProcess: backendStage.IsSubProcess,
1867
- tenantId: backendStage.TenantId,
1868
- createdAt: backendStage.CreatedAt,
1869
- };
1870
- }
1871
- createConnections(workflow, startNodeId, stages) {
1872
- const connections = [];
1873
- const actions = workflow.Actions;
1874
- // Create connections from start node to entry points
1875
- stages
1876
- .filter((stage) => workflow.Stages.find((s) => s.Key === stage.id || s.Code === stage.id)
1877
- ?.IsEntryPoint)
1878
- .forEach((entryStage) => {
1879
- connections.push(this.createConnection(crypto.randomUUID(), startNodeId, entryStage.id, 'Start', stages));
1880
- });
1881
- // Create connections between stages
1882
- actions.forEach((action) => {
1883
- connections.push(this.createConnection(action.Code, action.FromStage, action.ToStage, action.Name || '', stages, {
1884
- originalId: action.Id,
1885
- originalCode: action.Code,
1886
- isParallel: action.IsParallel,
1887
- passOnRule: action.PassOnRule,
1888
- tenantId: action.TenantId,
1889
- createdAt: action.CreatedAt,
1890
- }));
1891
- });
1892
- return connections;
1893
- }
1894
- createConnection(id, fromId, toId, label, stages, properties) {
1895
- const sourceNode = stages.find((s) => s.id === fromId) || this.createStartNode();
1896
- const targetNode = stages.find((s) => s.id === toId);
1897
- if (!targetNode) {
1898
- console.error(`Unable to find target stage with id: ${toId}`);
1899
- // Return a minimal connection to avoid breaking the application
1900
- return {
1901
- id,
1902
- type: 'action',
1903
- fromId,
1904
- toId,
1905
- label,
1906
- position: { x: 0, y: 0 },
1907
- size: { width: 0, height: 0 },
1908
- points: [],
1909
- ...properties,
1910
- };
1911
- }
1912
- const points = this.connectionService.recalculateConnectionPoints(sourceNode, targetNode, []);
1913
- return {
1914
- id,
1915
- type: 'action',
1916
- fromId,
1917
- toId,
1918
- label,
1919
- position: sourceNode.position,
1920
- size: { width: 0, height: 0 },
1921
- points,
1922
- // Store all additional properties from backend
1923
- originalId: properties?.originalId,
1924
- originalCode: properties?.originalCode,
1925
- isParallel: properties?.isParallel,
1926
- passOnRule: properties?.passOnRule,
1927
- tenantId: properties?.tenantId,
1928
- createdAt: properties?.createdAt,
1929
- properties: properties?.properties,
1930
- };
1931
- }
1932
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WorkflowMapperService, deps: [{ token: ConnectionService }], target: i0.ɵɵFactoryTarget.Injectable });
1933
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WorkflowMapperService, providedIn: 'root' });
1934
- }
1935
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WorkflowMapperService, decorators: [{
1936
- type: Injectable,
1937
- args: [{
1938
- providedIn: 'root',
1939
- }]
1940
- }], ctorParameters: () => [{ type: ConnectionService }] });
1941
-
1942
- // services/workflow-persistence.service.ts
1943
- class WorkflowPersistenceService {
1944
- workflowState = inject(WorkflowStateService);
1945
- mapper = inject(WorkflowMapperService);
1946
- service = inject(WorkflowsService);
1947
- utilSvc = inject(UtilService);
1948
- // Add a property to store the current workflow metadata
1949
- currentWorkflowMetadata = {
1950
- id: '',
1951
- code: '',
1952
- name: 'New Workflow',
1953
- description: '',
1954
- isNew: true,
1955
- };
1956
- // Getter for workflow metadata
1957
- get workflowMetadata() {
1958
- return { ...this.currentWorkflowMetadata };
1959
- }
1960
- // Save workflow with current metadata
1961
- saveWorkflow() {
1962
- const currentObjects = this.workflowState.objects();
1963
- const workflow = this.mapper.toBackendWorkflow(currentObjects, this.currentWorkflowMetadata);
1964
- return this.service.saveWorkflows([workflow]).then((results) => {
1965
- // Update metadata with saved workflow info if successful
1966
- if (results && results.length > 0) {
1967
- const savedWorkflow = results[0];
1968
- this.updateWorkflowMetadata({
1969
- id: savedWorkflow.Id,
1970
- code: savedWorkflow.Code,
1971
- name: savedWorkflow.Name,
1972
- description: savedWorkflow.Description,
1973
- tenantId: savedWorkflow.TenantId,
1974
- formId: savedWorkflow.Form,
1975
- createdAt: savedWorkflow.CreatedAt,
1976
- isNew: false,
1977
- });
1978
- }
1979
- return results;
1980
- });
1981
- }
1982
- // Load workflow by ID
1983
- async loadWorkflow(workflowId) {
1984
- try {
1985
- const data = await this.service.getWorkflowWithParam(workflowId);
1986
- if (data instanceof ErrorResponse) {
1987
- this.utilSvc.showError(data.ErrorMsg);
1988
- return;
1989
- }
1990
- const workflow = data.Result[0];
1991
- if (workflow) {
1992
- const result = this.mapper.toFrontendObjects(workflow);
1993
- // Update metadata
1994
- this.updateWorkflowMetadata({
1995
- id: workflow.Id,
1996
- code: workflow.Code,
1997
- name: workflow.Name,
1998
- description: workflow.Description,
1999
- tenantId: workflow.TenantId,
2000
- formId: workflow.Form,
2001
- createdAt: workflow.CreatedAt,
2002
- isNew: false,
2003
- });
2004
- // Clear existing state and load new objects
2005
- this.workflowState.state.set({
2006
- objects: result.objects,
2007
- selectedObjectId: null,
2008
- selectedTool: null,
2009
- });
2010
- }
2011
- }
2012
- catch (error) {
2013
- console.error('Error loading workflow:', error);
2014
- throw error;
2015
- }
2016
- }
2017
- // Update workflow metadata
2018
- updateWorkflowMetadata(metadata) {
2019
- this.currentWorkflowMetadata = {
2020
- ...this.currentWorkflowMetadata,
2021
- ...metadata,
2022
- };
2023
- }
2024
- // Create a new workflow
2025
- createNewWorkflow(name, description) {
2026
- // Reset the state
2027
- this.workflowState.initializeWorkflow();
2028
- // Set up new metadata
2029
- this.updateWorkflowMetadata({
2030
- id: '',
2031
- code: '',
2032
- name: name,
2033
- description: description || `New workflow: ${name}`,
2034
- isNew: true,
2035
- });
2036
- }
2037
- // Update existing workflow
2038
- async updateWorkflow(workflowName, description) {
2039
- // Update metadata
2040
- this.updateWorkflowMetadata({
2041
- name: workflowName,
2042
- description: description || this.currentWorkflowMetadata.description,
2043
- });
2044
- // Save with updated metadata
2045
- return this.saveWorkflow();
2046
- }
2047
- // Load all workflows
2048
- async loadWorkflows() {
2049
- try {
2050
- const data = await this.service.getWorkflows(0, 0, 'createdAt', 'ASC');
2051
- if (data instanceof ErrorResponse) {
2052
- this.utilSvc.showError(data.ErrorMsg);
2053
- return [];
2054
- }
2055
- return data.Result;
2056
- }
2057
- catch (error) {
2058
- console.error('Error loading workflows:', error);
2059
- throw error;
2060
- }
2061
- }
2062
- // Load forms
2063
- async loadForms() {
2064
- try {
2065
- const data = await this.service.getForms(0, 0, 'createdAt', 'ASC');
2066
- if (data instanceof ErrorResponse) {
2067
- this.utilSvc.showError(data.ErrorMsg);
2068
- return [];
2069
- }
2070
- return data.Result;
2071
- }
2072
- catch (error) {
2073
- console.error('Error loading forms:', error);
2074
- throw error;
2075
- }
2076
- }
2077
- // Load tags
2078
- async loadTags() {
2079
- try {
2080
- const data = await this.service.getTags(0, 0, 'createdAt', 'ASC');
2081
- if (data instanceof ErrorResponse) {
2082
- this.utilSvc.showError(data.ErrorMsg);
2083
- return [];
2084
- }
2085
- return data.Result;
2086
- }
2087
- catch (error) {
2088
- console.error('Error loading tags:', error);
2089
- throw error;
2090
- }
2091
- }
2092
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WorkflowPersistenceService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2093
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WorkflowPersistenceService, providedIn: 'root' });
2094
- }
2095
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WorkflowPersistenceService, decorators: [{
2096
- type: Injectable,
2097
- args: [{
2098
- providedIn: 'root',
2099
- }]
2100
- }] });
2101
-
2102
- // services/node-precondition.service.ts
2103
- class NodePreconditionService {
2104
- persistence = inject(WorkflowPersistenceService);
2105
- preconditionRequired = new Set([
2106
- 'form',
2107
- 'subflow',
2108
- 'swimlane',
2109
- 'decision',
2110
- ]);
2111
- pendingNodeSignal = signal(null);
2112
- pendingNode = this.pendingNodeSignal.asReadonly();
2113
- // Replace mock data signals with real data signals
2114
- formOptions = signal([]);
2115
- workflowOptions = signal([]);
2116
- tagOptions = signal([]);
2117
- // Add readonly accessors
2118
- forms = this.formOptions.asReadonly();
2119
- workflows = this.workflowOptions.asReadonly();
2120
- tags = this.tagOptions.asReadonly();
2121
- // Add initialization method to load real data
2122
- async initializeData() {
2123
- try {
2124
- const [forms, workflows, tags] = await Promise.all([
2125
- this.persistence.loadForms(),
2126
- this.persistence.loadWorkflows(),
2127
- this.persistence.loadTags(),
2128
- ]);
2129
- this.formOptions.set(forms.map((form) => ({
2130
- type: 'form',
2131
- id: form.Id,
2132
- name: form.Name,
2133
- })));
2134
- this.workflowOptions.set(workflows.map((workflow) => ({
2135
- type: 'subflow',
2136
- id: workflow.Id,
2137
- name: workflow.Name,
2138
- })));
2139
- this.tagOptions.set(tags);
2140
- }
2141
- catch (error) {
2142
- console.error('Failed to load precondition data:', error);
2143
- }
2144
- }
2145
- requiresPrecondition(type) {
2146
- return this.preconditionRequired.has(type);
2147
- }
2148
- setPendingNode(type, position) {
2149
- this.pendingNodeSignal.set({ type, position });
2150
- }
2151
- clearPendingNode() {
2152
- this.pendingNodeSignal.set(null);
2153
- }
2154
- async getItems(type) {
2155
- switch (type) {
2156
- case 'form':
2157
- return this.mapForms(await this.persistence.loadForms());
2158
- case 'subflow':
2159
- return this.mapWorkflows(await this.persistence.loadWorkflows());
2160
- case 'swimlane':
2161
- return this.mapTags(await this.persistence.loadTags());
2162
- case 'decision':
2163
- return this.getDecisionConditions();
2164
- default:
2165
- return [];
2166
- }
2167
- }
2168
- mapForms(forms) {
2169
- return forms.map((form) => ({
2170
- type: 'form',
2171
- id: form.Id,
2172
- name: form.Name,
2173
- }));
2174
- }
2175
- mapWorkflows(workflows) {
2176
- return workflows.map((workflow) => ({
2177
- type: 'subflow',
2178
- id: workflow.Id,
2179
- name: workflow.Name,
2180
- }));
2181
- }
2182
- mapTags(tags) {
2183
- return [
2184
- {
2185
- type: 'swimlane',
2186
- tags: tags,
2187
- },
2188
- ];
2189
- }
2190
- getDecisionConditions() {
2191
- return [
2192
- {
2193
- type: 'decision',
2194
- condition: '', // Empty condition to be filled by user
2195
- },
2196
- ];
2197
- }
2198
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NodePreconditionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2199
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NodePreconditionService, providedIn: 'root' });
2200
- }
2201
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NodePreconditionService, decorators: [{
2202
- type: Injectable,
2203
- args: [{
2204
- providedIn: 'root',
2205
- }]
2206
- }] });
2207
-
2208
- // Update imports
2209
- class NodeSelectorComponent {
2210
- // Replace existing properties with these
2211
- selectedTags = [];
2212
- selectedFormId = '';
2213
- selectedWorkflowId = '';
2214
- condition = '';
2215
- preconditionService = inject(NodePreconditionService);
2216
- select = new EventEmitter();
2217
- // Methods for dropdown handling
2218
- onTagSelectionChange(event) {
2219
- // Handle tag selection change if needed
2220
- console.log('Tag selection changed:', this.selectedTags);
2221
- }
2222
- onDropdownChange(event) {
2223
- console.log('Dropdown selection changed:', event);
2224
- }
2225
- onFormSubmit() {
2226
- const selectedForm = this.preconditionService
2227
- .forms()
2228
- .find((f) => f.id === this.selectedFormId);
2229
- if (selectedForm) {
2230
- this.select.emit(selectedForm);
2231
- }
2232
- }
2233
- onWorkflowSubmit() {
2234
- const selectedWorkflow = this.preconditionService
2235
- .workflows()
2236
- .find((w) => w.id === this.selectedWorkflowId);
2237
- if (selectedWorkflow) {
2238
- this.select.emit(selectedWorkflow);
2239
- }
2240
- }
2241
- getDialogTitle() {
2242
- const type = this.preconditionService.pendingNode()?.type;
2243
- switch (type) {
2244
- case 'form':
2245
- return 'Select Form';
2246
- case 'subflow':
2247
- return 'Select Workflow';
2248
- case 'swimlane':
2249
- return 'Select Tags';
2250
- case 'decision':
2251
- return 'Set Condition';
2252
- default:
2253
- return 'Select';
2254
- }
2255
- }
2256
- onTagsSubmit() {
2257
- this.select.emit({
2258
- type: 'swimlane',
2259
- id: crypto.randomUUID(),
2260
- name: 'Swimlane',
2261
- tags: this.selectedTags,
2262
- });
2263
- }
2264
- onConditionSubmit() {
2265
- this.select.emit({
2266
- type: 'decision',
2267
- id: crypto.randomUUID(),
2268
- name: 'Decision',
2269
- condition: this.condition,
2270
- });
2271
- }
2272
- onSelect(data) {
2273
- this.select.emit(data);
2274
- }
2275
- onModalClose(event) {
2276
- this.preconditionService.clearPendingNode();
2277
- }
2278
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NodeSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2279
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: NodeSelectorComponent, isStandalone: true, selector: "wf-node-selector", outputs: { select: "select" }, ngImport: i0, template: `
2280
- <verben-dialogue
2281
- [isVisible]="!!preconditionService.pendingNode()"
2282
- [showCloseIcon]="true"
2283
- [dismissOutsideClick]="true"
2284
- [closeOnEscape]="true"
2285
- [size]="'small'"
2286
- [mode]="'dialogue'"
2287
- [customClass]="'precondition-dialogue'"
2288
- [headerTemplate]="headerTemplate"
2289
- [bodyTemplate]="bodyTemplate"
2290
- (closeModal)="onModalClose($event)"
2291
- >
2292
- </verben-dialogue>
2293
-
2294
- <ng-template #headerTemplate>
2295
- <h3 class="text-lg font-semibold">{{ getDialogTitle() }}</h3>
2296
- </ng-template>
2297
-
2298
- <ng-template #bodyTemplate>
2299
- <div class="p-6">
2300
- @switch (preconditionService.pendingNode()?.type) { @case ('swimlane') {
2301
- <div class="space-y-4">
2302
- <verben-drop-down
2303
- [multiselect]="true"
2304
- display="chip"
2305
- [required]="true"
2306
- [filter]="true"
2307
- [showClear]="true"
2308
- placeholder="Select Tags"
2309
- optionLabel="Name"
2310
- styleClass="w-full"
2311
- [options]="preconditionService.tags()"
2312
- [(ngModel)]="selectedTags"
2313
- (onChange)="onTagSelectionChange($event)"
2314
- ></verben-drop-down>
2315
-
2316
- <button
2317
- class="w-full px-4 py-2 bg-purple-600 text-white rounded-md"
2318
- [disabled]="!selectedTags.length"
2319
- (click)="onTagsSubmit()"
2320
- >
2321
- Apply Tags
2322
- </button>
2323
- </div>
2324
- } @case ('decision') {
2325
- <div class="space-y-4">
2326
- <div>
2327
- <label class="block text-sm font-medium mb-2">Condition</label>
2328
- <textarea
2329
- class="w-full p-2 border rounded-md"
2330
- rows="3"
2331
- [(ngModel)]="condition"
2332
- placeholder="Enter condition..."
2333
- ></textarea>
2334
- </div>
2335
- <button
2336
- class="w-full px-4 py-2 bg-purple-600 text-white rounded-md"
2337
- [disabled]="!condition"
2338
- (click)="onConditionSubmit()"
2339
- >
2340
- Apply Condition
2341
- </button>
2342
- </div>
2343
- } @case ('form') {
2344
- <div class="space-y-4">
2345
- <verben-drop-down
2346
- [required]="true"
2347
- [filter]="true"
2348
- [showClear]="true"
2349
- placeholder="Select Form"
2350
- optionLabel="name"
2351
- optionValue="id"
2352
- styleClass="w-full"
2353
- [options]="preconditionService.forms()"
2354
- [(ngModel)]="selectedFormId"
2355
- (onChange)="onDropdownChange($event)"
2356
- ></verben-drop-down>
2357
-
2358
- <button
2359
- class="w-full px-4 py-2 bg-purple-600 text-white rounded-md"
2360
- [disabled]="!selectedFormId"
2361
- (click)="onFormSubmit()"
2362
- >
2363
- Select Form
2364
- </button>
2365
- </div>
2366
- } @default {
2367
- <div class="space-y-4">
2368
- <verben-drop-down
2369
- [required]="true"
2370
- [filter]="true"
2371
- [showClear]="true"
2372
- placeholder="Select Workflow"
2373
- optionLabel="name"
2374
- optionValue="id"
2375
- styleClass="w-full"
2376
- [options]="preconditionService.workflows()"
2377
- [(ngModel)]="selectedWorkflowId"
2378
- (onChange)="onDropdownChange($event)"
2379
- ></verben-drop-down>
2380
-
2381
- <button
2382
- class="w-full px-4 py-2 bg-purple-600 text-white rounded-md"
2383
- [disabled]="!selectedWorkflowId"
2384
- (click)="onWorkflowSubmit()"
2385
- >
2386
- Select Workflow
2387
- </button>
2388
- </div>
2389
- } }
2390
- </div>
2391
- </ng-template>
2392
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: VerbenDialogueModule }, { kind: "component", type: i1$1.VerbenDialogueComponent, selector: "verben-dialogue", inputs: ["dialogueWidth", "headerTemplate", "bodyTemplate", "footerTemplate", "showCloseIcon", "dismissOutsideClick", "closeOnEscape", "isVisible", "size", "backdropColor", "customClass", "disableFooter", "margin", "padding", "borderRadius", "dialogueBgColor", "width", "closeIconClass", "boxShadow", "enableTransition", "modalData", "mode", "position", "drawerWidth"], outputs: ["openModal", "closeModal"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: DropDownModule }, { kind: "component", type: i1$1.DropDownComponent, selector: "verben-drop-down", inputs: ["options", "width", "overlayWidth", "showHorizontalLine", "horizontalLineColor", "optionLabel", "optionSubLabel", "optionValue", "placeholder", "invalidMessage", "errorPosition", "loadMoreCaption", "display", "showClear", "lazyLoad", "selectKey", "styleClass", "group", "multiselect", "filter", "avoidDuplication", "filterBy", "debounceTime", "minChar", "refPageSize", "disabled", "required", "load", "asyncLabel", "search"], outputs: ["optionsChange", "onChange", "onClick", "onClear"] }] });
2393
- }
2394
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NodeSelectorComponent, decorators: [{
2395
- type: Component,
2396
- args: [{
2397
- selector: 'wf-node-selector',
2398
- standalone: true,
2399
- imports: [CommonModule, VerbenDialogueModule, FormsModule, DropDownModule],
2400
- template: `
2401
- <verben-dialogue
2402
- [isVisible]="!!preconditionService.pendingNode()"
2403
- [showCloseIcon]="true"
2404
- [dismissOutsideClick]="true"
2405
- [closeOnEscape]="true"
2406
- [size]="'small'"
2407
- [mode]="'dialogue'"
2408
- [customClass]="'precondition-dialogue'"
2409
- [headerTemplate]="headerTemplate"
2410
- [bodyTemplate]="bodyTemplate"
2411
- (closeModal)="onModalClose($event)"
2412
- >
2413
- </verben-dialogue>
2414
-
2415
- <ng-template #headerTemplate>
2416
- <h3 class="text-lg font-semibold">{{ getDialogTitle() }}</h3>
2417
- </ng-template>
2418
-
2419
- <ng-template #bodyTemplate>
2420
- <div class="p-6">
2421
- @switch (preconditionService.pendingNode()?.type) { @case ('swimlane') {
2422
- <div class="space-y-4">
2423
- <verben-drop-down
2424
- [multiselect]="true"
2425
- display="chip"
2426
- [required]="true"
2427
- [filter]="true"
2428
- [showClear]="true"
2429
- placeholder="Select Tags"
2430
- optionLabel="Name"
2431
- styleClass="w-full"
2432
- [options]="preconditionService.tags()"
2433
- [(ngModel)]="selectedTags"
2434
- (onChange)="onTagSelectionChange($event)"
2435
- ></verben-drop-down>
2436
-
2437
- <button
2438
- class="w-full px-4 py-2 bg-purple-600 text-white rounded-md"
2439
- [disabled]="!selectedTags.length"
2440
- (click)="onTagsSubmit()"
2441
- >
2442
- Apply Tags
2443
- </button>
2444
- </div>
2445
- } @case ('decision') {
2446
- <div class="space-y-4">
2447
- <div>
2448
- <label class="block text-sm font-medium mb-2">Condition</label>
2449
- <textarea
2450
- class="w-full p-2 border rounded-md"
2451
- rows="3"
2452
- [(ngModel)]="condition"
2453
- placeholder="Enter condition..."
2454
- ></textarea>
2455
- </div>
2456
- <button
2457
- class="w-full px-4 py-2 bg-purple-600 text-white rounded-md"
2458
- [disabled]="!condition"
2459
- (click)="onConditionSubmit()"
2460
- >
2461
- Apply Condition
2462
- </button>
2463
- </div>
2464
- } @case ('form') {
2465
- <div class="space-y-4">
2466
- <verben-drop-down
2467
- [required]="true"
2468
- [filter]="true"
2469
- [showClear]="true"
2470
- placeholder="Select Form"
2471
- optionLabel="name"
2472
- optionValue="id"
2473
- styleClass="w-full"
2474
- [options]="preconditionService.forms()"
2475
- [(ngModel)]="selectedFormId"
2476
- (onChange)="onDropdownChange($event)"
2477
- ></verben-drop-down>
2478
-
2479
- <button
2480
- class="w-full px-4 py-2 bg-purple-600 text-white rounded-md"
2481
- [disabled]="!selectedFormId"
2482
- (click)="onFormSubmit()"
2483
- >
2484
- Select Form
2485
- </button>
2486
- </div>
2487
- } @default {
2488
- <div class="space-y-4">
2489
- <verben-drop-down
2490
- [required]="true"
2491
- [filter]="true"
2492
- [showClear]="true"
2493
- placeholder="Select Workflow"
2494
- optionLabel="name"
2495
- optionValue="id"
2496
- styleClass="w-full"
2497
- [options]="preconditionService.workflows()"
2498
- [(ngModel)]="selectedWorkflowId"
2499
- (onChange)="onDropdownChange($event)"
2500
- ></verben-drop-down>
2501
-
2502
- <button
2503
- class="w-full px-4 py-2 bg-purple-600 text-white rounded-md"
2504
- [disabled]="!selectedWorkflowId"
2505
- (click)="onWorkflowSubmit()"
2506
- >
2507
- Select Workflow
2508
- </button>
2509
- </div>
2510
- } }
2511
- </div>
2512
- </ng-template>
2513
- `,
2514
- }]
2515
- }], propDecorators: { select: [{
2516
- type: Output
2517
- }] } });
2518
-
2519
- // services/viewport.service.ts
2520
- class ViewportService {
2521
- getCanvasPoint(event, canvasRef) {
2522
- const rect = canvasRef.nativeElement.getBoundingClientRect();
2523
- return {
2524
- x: event.clientX - rect.left,
2525
- y: event.clientY - rect.top,
2526
- };
2527
- }
2528
- snapToGrid(position, gridSize) {
2529
- return {
2530
- x: Math.round(position.x / gridSize) * gridSize,
2531
- y: Math.round(position.y / gridSize) * gridSize,
2532
- };
2533
- }
2534
- getObjectTransform(position) {
2535
- return `translate(${position.x}, ${position.y})`;
2536
- }
2537
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ViewportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2538
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ViewportService, providedIn: 'root' });
2539
- }
2540
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ViewportService, decorators: [{
2541
- type: Injectable,
2542
- args: [{
2543
- providedIn: 'root',
2544
- }]
2545
- }] });
2546
-
2547
- // services/position-update.service.ts
2548
- class PositionUpdateService {
2549
- workflowState = inject(WorkflowStateService);
2550
- connection = inject(ConnectionService);
2551
- updateNodeWithConnections(nodeId, newPosition) {
2552
- // Update node position
2553
- this.workflowState.updateObject(nodeId, { position: newPosition });
2554
- // Update connected paths
2555
- const connections = this.workflowState
2556
- .connections()
2557
- .filter((conn) => conn.fromId === nodeId || conn.toId === nodeId);
2558
- const updates = this.getConnectionUpdates(nodeId, newPosition, connections);
2559
- if (updates.length > 0) {
2560
- this.workflowState.updateMultipleObjects(updates);
2561
- }
2562
- }
2563
- getConnectionUpdates(nodeId, newPosition, connections) {
2564
- return connections
2565
- .map((conn) => {
2566
- const sourceNode = this.workflowState.getObjectById(conn.fromId);
2567
- const targetNode = this.workflowState.getObjectById(conn.toId);
2568
- if (!sourceNode || !targetNode)
2569
- return null;
2570
- const points = this.connection.recalculateConnectionPoints(sourceNode, targetNode, conn.points);
2571
- return {
2572
- id: conn.id,
2573
- changes: { points },
2574
- };
2575
- })
2576
- .filter((update) => update !== null);
2577
- }
2578
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PositionUpdateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2579
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PositionUpdateService, providedIn: 'root' });
2580
- }
2581
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PositionUpdateService, decorators: [{
2582
- type: Injectable,
2583
- args: [{
2584
- providedIn: 'root',
2585
- }]
2586
- }] });
2587
-
2588
- // services/node-interaction.service.ts
2589
- class NodeInteractionService {
2590
- viewport = inject(ViewportService);
2591
- workflowState = inject(WorkflowStateService);
2592
- canvasState = inject(CanvasStateService);
2593
- positionUpdate = inject(PositionUpdateService);
2594
- nodeFinder = inject(NodeFinderService);
2595
- // Use nodeFinder instead of direct implementation
2596
- findNodeAtPoint(point) {
2597
- return this.nodeFinder.findNodeAtPoint(point);
2598
- }
2599
- isPointInNode(point, node) {
2600
- return (point.x >= node.position.x &&
2601
- point.x <= node.position.x + node.size.width &&
2602
- point.y >= node.position.y &&
2603
- point.y <= node.position.y + node.size.height);
2604
- }
2605
- startDragging(node, point) {
2606
- if (this.isProtectedNode(node))
2607
- return;
2608
- this.canvasState.setDragging(true);
2609
- this.canvasState.setDragStartPosition(point);
2610
- this.workflowState.setSelectedObject(node.id);
2611
- // Calculate offset from node position to click position
2612
- this.canvasState.setDragOffset({
2613
- x: point.x - node.position.x,
2614
- y: point.y - node.position.y,
2615
- });
2616
- }
2617
- handleDragging(currentPoint, gridSize) {
2618
- const objectId = this.workflowState.selectedObjectId();
2619
- if (!objectId)
2620
- return;
2621
- const selectedNode = this.workflowState.getObjectById(objectId);
2622
- if (!selectedNode)
2623
- return;
2624
- const { dragOffset } = this.canvasState.canvasState();
2625
- const newPosition = {
2626
- x: currentPoint.x - dragOffset.x,
2627
- y: currentPoint.y - dragOffset.y,
2628
- };
2629
- // Snap to grid
2630
- const snappedPosition = this.viewport.snapToGrid(newPosition, gridSize);
2631
- // Find nearest swimlane if applicable
2632
- const nearestSwimlane = this.findNearestSwimlane(snappedPosition);
2633
- if (nearestSwimlane) {
2634
- snappedPosition.y =
2635
- nearestSwimlane.position.y +
2636
- (nearestSwimlane.size.height - selectedNode.size.height) / 2;
2637
- }
2638
- // Update node position
2639
- this.workflowState.updateObject(selectedNode.id, {
2640
- position: snappedPosition,
2641
- });
2642
- // Use the new service
2643
- this.positionUpdate.updateNodeWithConnections(selectedNode.id, snappedPosition);
2644
- }
2645
- finalizeDragging(finalPoint) {
2646
- const objectId = this.workflowState.selectedObjectId();
2647
- if (!objectId)
2648
- return;
2649
- const selectedNode = this.workflowState.getObjectById(objectId);
2650
- if (!selectedNode)
2651
- return;
2652
- // Perform any final position adjustments
2653
- const boundedPosition = this.keepWithinBounds(selectedNode.position, this.canvasState.canvasState().width, this.canvasState.canvasState().height);
2654
- if (boundedPosition !== selectedNode.position) {
2655
- this.workflowState.updateObject(selectedNode.id, {
2656
- position: boundedPosition,
2657
- });
2658
- }
2659
- }
2660
- findNearestSwimlane(position) {
2661
- const swimlanes = this.workflowState.swimlanes();
2662
- for (const swimlane of swimlanes) {
2663
- if (position.y >= swimlane.position.y &&
2664
- position.y <= swimlane.position.y + swimlane.size.height) {
2665
- return swimlane;
2666
- }
2667
- }
2668
- return null;
2669
- }
2670
- keepWithinBounds(position, width, height) {
2671
- return {
2672
- x: Math.max(0, Math.min(position.x, width - 100)), // 100 is minimum node width
2673
- y: Math.max(0, Math.min(position.y, height - 60)), // 60 is minimum node height
2674
- };
2675
- }
2676
- isProtectedNode(node) {
2677
- return ['start', 'swimlane'].includes(node.type);
2678
- }
2679
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NodeInteractionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2680
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NodeInteractionService, providedIn: 'root' });
2681
- }
2682
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NodeInteractionService, decorators: [{
2683
- type: Injectable,
2684
- args: [{
2685
- providedIn: 'root',
2686
- }]
2687
- }] });
2688
-
2689
- class SwimlaneManagementService {
2690
- workflowState = inject(WorkflowStateService);
2691
- canvasState = inject(CanvasStateService);
2692
- DEFAULT_SWIMLANE_HEIGHT = 260;
2693
- createSwimlane(clickPosition) {
2694
- const swimlanes = this.workflowState.swimlanes();
2695
- const canvasWidth = this.canvasState.canvasState().width;
2696
- // Calculate the new swimlane's position
2697
- const newPosition = this.calculateNewSwimlanePosition(clickPosition, swimlanes);
2698
- const newSwimlane = {
2699
- id: crypto.randomUUID(),
2700
- type: 'swimlane',
2701
- position: { x: 0, y: this.findNearestSwimlanePosition(clickPosition) },
2702
- size: { width: canvasWidth - 40, height: this.DEFAULT_SWIMLANE_HEIGHT },
2703
- label: `Swimlane ${swimlanes.length + 1}`,
2704
- };
2705
- this.workflowState.addObject(newSwimlane);
2706
- this.reorderSwimlanes();
2707
- }
2708
- getVerticalCenterForSwimlane(swimlaneY) {
2709
- return swimlaneY + this.DEFAULT_SWIMLANE_HEIGHT / 2;
2710
- }
2711
- getSwimlaneHeight() {
2712
- return this.DEFAULT_SWIMLANE_HEIGHT;
2713
- }
2714
- calculateNewSwimlanePosition(clickY, swimlanes) {
2715
- if (swimlanes.length === 0)
2716
- return 0;
2717
- // Sort swimlanes by vertical position
2718
- const sortedSwimlanes = [...swimlanes].sort((a, b) => a.position.y - b.position.y);
2719
- // Find the appropriate insertion point based on click position
2720
- for (let i = 0; i < sortedSwimlanes.length; i++) {
2721
- const swimlane = sortedSwimlanes[i];
2722
- if (clickY < swimlane.position.y + swimlane.size.height / 2) {
2723
- return i * this.DEFAULT_SWIMLANE_HEIGHT;
2724
- }
2725
- }
2726
- // If click is below all existing swimlanes, add to the end
2727
- return sortedSwimlanes.length * this.DEFAULT_SWIMLANE_HEIGHT;
2728
- }
2729
- // reorderSwimlanes(): void {
2730
- // const swimlanes = [...this.workflowState.swimlanes()].sort(
2731
- // (a, b) => a.position.y - b.position.y
2732
- // );
2733
- // const updates = swimlanes.map((swimlane, index) => ({
2734
- // id: swimlane.id,
2735
- // changes: {
2736
- // position: { x: 0, y: index * this.DEFAULT_SWIMLANE_HEIGHT },
2737
- // size: { ...swimlane.size },
2738
- // },
2739
- // }));
2740
- // this.workflowState.updateMultipleObjects(updates);
2741
- // }
2742
- reorderSwimlanes() {
2743
- const swimlanes = [...this.workflowState.swimlanes()].sort((a, b) => a.position.y - b.position.y);
2744
- // Update positions and adjust contained nodes
2745
- swimlanes.forEach((swimlane, index) => {
2746
- const oldY = swimlane.position.y;
2747
- const newY = index * this.DEFAULT_SWIMLANE_HEIGHT;
2748
- // Update swimlane position
2749
- this.workflowState.updateObject(swimlane.id, {
2750
- position: { x: 0, y: newY },
2751
- size: { ...swimlane.size, height: this.DEFAULT_SWIMLANE_HEIGHT },
2752
- });
2753
- // If position changed, adjust contained nodes
2754
- if (oldY !== newY) {
2755
- this.adjustNodesInSwimlane(swimlane.id, oldY, newY);
2756
- }
2757
- });
2758
- }
2759
- adjustNodesInSwimlane(swimlaneId, oldY, newY) {
2760
- const nodes = this.workflowState.nodes();
2761
- const swimlane = this.workflowState.getObjectById(swimlaneId);
2762
- if (!swimlane)
2763
- return;
2764
- nodes.forEach((node) => {
2765
- if (this.isNodeInSwimlane(node, swimlane)) {
2766
- const relativeY = node.position.y - oldY; // Position relative to old swimlane top
2767
- const newNodeY = newY + relativeY; // Maintain relative position in new location
2768
- this.workflowState.updateObject(node.id, {
2769
- position: { ...node.position, y: newNodeY },
2770
- });
2771
- }
2772
- });
2773
- }
2774
- isNodeInSwimlane(node, swimlane) {
2775
- return (node.position.y >= swimlane.position.y &&
2776
- node.position.y <= swimlane.position.y + swimlane.size.height);
2777
- }
2778
- resizeSwimlanesForCanvas(canvasWidth) {
2779
- const swimlanes = this.workflowState.swimlanes();
2780
- const updates = swimlanes.map((swimlane) => ({
2781
- id: swimlane.id,
2782
- changes: {
2783
- size: { width: canvasWidth - 40, height: this.DEFAULT_SWIMLANE_HEIGHT },
2784
- },
2785
- }));
2786
- this.workflowState.updateMultipleObjects(updates);
2787
- }
2788
- getTotalHeight() {
2789
- const swimlanes = this.workflowState.swimlanes();
2790
- return swimlanes.length * this.DEFAULT_SWIMLANE_HEIGHT;
2791
- }
2792
- swapSwimlanes(swimlane1Id, swimlane2Id) {
2793
- const swimlane1 = this.workflowState.getObjectById(swimlane1Id);
2794
- const swimlane2 = this.workflowState.getObjectById(swimlane2Id);
2795
- if (!swimlane1 || !swimlane2)
2796
- return;
2797
- const temp = swimlane1.position.y;
2798
- this.workflowState.updateObject(swimlane1Id, {
2799
- position: { ...swimlane1.position, y: swimlane2.position.y },
2800
- });
2801
- this.workflowState.updateObject(swimlane2Id, {
2802
- position: { ...swimlane2.position, y: temp },
2803
- });
2804
- this.reorderSwimlanes();
2805
- }
2806
- findNearestSwimlanePosition(yPosition) {
2807
- const swimlanes = this.workflowState.swimlanes();
2808
- if (swimlanes.length === 0)
2809
- return 0;
2810
- const sortedSwimlanes = [...swimlanes].sort((a, b) => a.position.y - b.position.y);
2811
- // Find the first swimlane that's below the given position
2812
- for (let i = 0; i < sortedSwimlanes.length; i++) {
2813
- if (sortedSwimlanes[i].position.y > yPosition) {
2814
- return i * sortedSwimlanes[0].size.height;
2815
- }
2816
- }
2817
- // If no swimlane is below, add to the end
2818
- return sortedSwimlanes.length * sortedSwimlanes[0].size.height;
2819
- }
2820
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SwimlaneManagementService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2821
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SwimlaneManagementService, providedIn: 'root' });
2822
- }
2823
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SwimlaneManagementService, decorators: [{
2824
- type: Injectable,
2825
- args: [{
2826
- providedIn: 'root',
2827
- }]
2828
- }] });
2829
-
2830
- // services/workflow-facade.service.ts
2831
- class WorkflowFacadeService {
2832
- workflowState = inject(WorkflowStateService);
2833
- viewport = inject(ViewportService);
2834
- nodeInteraction = inject(NodeInteractionService);
2835
- connection = inject(ConnectionService);
2836
- rendering = inject(RenderingService);
2837
- selection = inject(NodeSelectionService);
2838
- canvasStateService = inject(CanvasStateService);
2839
- swimlaneManagement = inject(SwimlaneManagementService);
2840
- persistence = inject(WorkflowPersistenceService);
2841
- segmentInteraction = inject(ConnectionSegmentInteractionService);
2842
- preconditionService = inject(NodePreconditionService);
2843
- // Canvas State Accessors
2844
- canvasState = this.canvasStateService.canvasState;
2845
- workflowObjects = this.workflowState.objects;
2846
- selectedObjectId = this.workflowState.selectedObjectId;
2847
- selectedTool = this.workflowState.selectedTool;
2848
- // Filtered Object Accessors
2849
- nodes = this.workflowState.nodes;
2850
- swimlanes = this.workflowState.swimlanes;
2851
- connections = this.workflowState.connections;
2852
- // Rendering Methods
2853
- getNodeStyle = this.rendering.getNodeStyle;
2854
- getConnectionStyle = this.rendering.getConnectionStyle;
2855
- getStartNodePaths = this.rendering.getStartNodePaths;
2856
- getNodeTransforms = this.rendering.getNodeTransforms;
2857
- getGridPattern = this.rendering.getGridPattern;
2858
- // Connection methods
2859
- getConnectionPath(points) {
2860
- return this.rendering.getConnectionPath(points);
2861
- }
2862
- // Added these getter methods to expose connection service functionality
2863
- getConnectionPreviewPath = () => this.connection.getPreviewPath();
2864
- hasOutgoingConnections = (nodeId) => this.connection.hasOutgoingConnections(nodeId);
2865
- // Segment interaction methods
2866
- handleSegmentMouseDown(event, canvasRef, connectionId, segmentIndex) {
2867
- const point = this.viewport.getCanvasPoint(event, canvasRef);
2868
- this.segmentInteraction.startDragging(connectionId, segmentIndex, point);
2869
- this.canvasStateService.setDragging(true);
2870
- }
2871
- getSegmentCursor(connectionId, segmentIndex) {
2872
- return this.segmentInteraction.getSegmentCursor(connectionId, segmentIndex);
2873
- }
2874
- // Mouse Event Handlers
2875
- handleMouseDown(event, canvasRef) {
2876
- if (event.button !== 0)
2877
- return;
2878
- const point = this.viewport.getCanvasPoint(event, canvasRef);
2879
- const clickedNode = this.nodeInteraction.findNodeAtPoint(point
2880
- // this.nodes()
2881
- );
2882
- if (this.selectedTool() === 'action' && clickedNode) {
2883
- this.connection.startConnection(clickedNode, point);
2884
- }
2885
- else if (this.selectedTool()) {
2886
- this.handleToolPlacement(point);
2887
- }
2888
- else if (clickedNode) {
2889
- if (event.target instanceof Element &&
2890
- event.target.classList.contains('properties-indicator')) {
2891
- // Handle properties click
2892
- return;
2893
- }
2894
- this.nodeInteraction.startDragging(clickedNode, point);
2895
- }
2896
- else {
2897
- this.selection.handleClickOutside(event);
2898
- }
2899
- }
2900
- handleMouseMove(event, canvasRef) {
2901
- const point = this.viewport.getCanvasPoint(event, canvasRef);
2902
- const { isConnecting, isDragging } = this.canvasState();
2903
- if (isConnecting) {
2904
- this.connection.updateConnectionPreview(point);
2905
- }
2906
- else if (isDragging) {
2907
- // this.nodeInteraction.handleDragging(point, this.canvasState().gridSize);
2908
- if (this.segmentInteraction.isDragging()) {
2909
- this.segmentInteraction.updateDragging(point);
2910
- }
2911
- else {
2912
- this.nodeInteraction.handleDragging(point, this.canvasState().gridSize);
2913
- }
2914
- }
2915
- }
2916
- handleMouseUp(event, canvasRef) {
2917
- const point = this.viewport.getCanvasPoint(event, canvasRef);
2918
- const { isConnecting, isDragging } = this.canvasState();
2919
- if (isConnecting) {
2920
- this.connection.finalizeConnection(point);
2921
- }
2922
- else if (isDragging) {
2923
- // this.nodeInteraction.finalizeDragging(point);
2924
- if (this.segmentInteraction.isDragging()) {
2925
- this.segmentInteraction.finishDragging();
2926
- }
2927
- else {
2928
- this.nodeInteraction.finalizeDragging(point);
2929
- }
2930
- }
2931
- this.canvasStateService.resetInteractionState();
2932
- }
2933
- handleMouseLeave() {
2934
- this.canvasStateService.resetInteractionState();
2935
- }
2936
- // Tool and Object Management
2937
- handleToolSelection(tool) {
2938
- this.workflowState.setSelectedTool(tool);
2939
- this.selection.handleToolSelection(tool);
2940
- }
2941
- // private handleToolPlacement(point: Position): void {
2942
- // console.log('Tool placement triggered', {
2943
- // selectedTool: this.selectedTool(),
2944
- // point,
2945
- // });
2946
- // if (this.selectedTool() === 'swimlane') {
2947
- // this.swimlaneManagement.createSwimlane(point.y);
2948
- // console.log(
2949
- // 'Swimlane created, current swimlanes:',
2950
- // this.workflowState.swimlanes()
2951
- // );
2952
- // this.workflowState.setSelectedTool(null);
2953
- // return;
2954
- // }
2955
- // const newNode: WorkflowObject = {
2956
- // id: crypto.randomUUID(),
2957
- // type: this.selectedTool()!,
2958
- // position: this.viewport.snapToGrid(point, this.canvasState().gridSize),
2959
- // size: this.getDefaultSize(this.selectedTool()!),
2960
- // label: `New ${this.selectedTool()}`,
2961
- // };
2962
- // this.workflowState.addObject(newNode);
2963
- // this.workflowState.setSelectedTool(null);
2964
- // }
2965
- handleToolPlacement(point) {
2966
- if (!this.selectedTool())
2967
- return;
2968
- const nodeType = this.selectedTool();
2969
- // Check if precondition is required
2970
- if (this.preconditionService.requiresPrecondition(nodeType)) {
2971
- this.preconditionService.setPendingNode(nodeType, point);
2972
- return; // Don't create node yet
2973
- }
2974
- // Create node immediately if no precondition required
2975
- this.createNode(nodeType, point);
2976
- }
2977
- createNode(type, position, selectedData) {
2978
- const baseNode = {
2979
- id: crypto.randomUUID(),
2980
- type: type,
2981
- position: this.viewport.snapToGrid(position, this.canvasState().gridSize),
2982
- size: this.getDefaultSize(type),
2983
- };
2984
- let nodeData;
2985
- switch (type) {
2986
- case 'form':
2987
- case 'subflow':
2988
- nodeData = {
2989
- ...baseNode,
2990
- label: selectedData?.name || `New ${type}`,
2991
- referenceId: selectedData?.id,
2992
- };
2993
- break;
2994
- case 'swimlane':
2995
- nodeData = {
2996
- ...baseNode,
2997
- label: selectedData?.name || 'Swimlane',
2998
- tags: selectedData?.tags || [],
2999
- order: this.workflowState.swimlanes().length, // Add order based on current swimlane count
3000
- };
3001
- break;
3002
- case 'decision':
3003
- nodeData = {
3004
- ...baseNode,
3005
- label: selectedData?.name || 'Decision',
3006
- condition: selectedData?.condition || '',
3007
- };
3008
- break;
3009
- default:
3010
- nodeData = {
3011
- ...baseNode,
3012
- label: `New ${type}`,
3013
- };
3014
- }
3015
- this.workflowState.addObject(nodeData);
3016
- this.workflowState.setSelectedTool(null);
3017
- }
3018
- // Call this when a form/subflow is selected
3019
- finalizeNodeCreation(selectedData) {
3020
- const pendingNode = this.preconditionService.pendingNode();
3021
- if (!pendingNode)
3022
- return;
3023
- this.createNode(pendingNode.type, pendingNode.position, selectedData);
3024
- this.preconditionService.clearPendingNode();
3025
- }
3026
- handleSwimlaneCreation(point) {
3027
- const swimlaneManagement = inject(SwimlaneManagementService);
3028
- swimlaneManagement.createSwimlane(point.y);
3029
- }
3030
- getDefaultSize(type) {
3031
- const sizes = {
3032
- stage: { width: 120, height: 80 },
3033
- action: { width: 40, height: 40 },
3034
- form: { width: 75, height: 96 }, // Exact size from design SVG
3035
- decision: { width: 100, height: 100 },
3036
- subflow: { width: 120, height: 80 },
3037
- swimlane: { width: 0, height: 0 }, // Handled separately
3038
- start: { width: 58, height: 46 },
3039
- };
3040
- return sizes[type];
3041
- }
3042
- // Initialization
3043
- initializeWorkflow() {
3044
- this.workflowState.initializeWorkflow();
3045
- }
3046
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WorkflowFacadeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3047
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WorkflowFacadeService, providedIn: 'root' });
3048
- }
3049
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WorkflowFacadeService, decorators: [{
3050
- type: Injectable,
3051
- args: [{
3052
- providedIn: 'root',
3053
- }]
3054
- }] });
3055
-
3056
- // components/workflow/canvas/wf-canvas.component.ts
3057
- class WFCanvasComponent {
3058
- facade;
3059
- containerRef;
3060
- canvasRef;
3061
- labelService = inject(LabelManagementService);
3062
- swimlaneStats = inject(SwimlaneStatsService);
3063
- keyboardHandler = inject(KeyboardHandlerService);
3064
- preconditionService = inject(NodePreconditionService);
3065
- hoveredSegment = null;
3066
- constructor(facade) {
3067
- this.facade = facade;
3068
- }
3069
- onKeyDown(event) {
3070
- // Only handle keyboard events if the canvas is focused
3071
- if (this.containerRef.nativeElement.contains(document.activeElement)) {
3072
- this.keyboardHandler.handleKeyDown(event);
3073
- }
3074
- }
3075
- // Add click handler to ensure the canvas can receive keyboard events
3076
- onClick() {
3077
- this.containerRef.nativeElement.focus();
3078
- }
3079
- updateLabel(objectId, newLabel) {
3080
- this.labelService.updateLabel(objectId, newLabel);
3081
- }
3082
- // Event handlers
3083
- onMouseDown(event) {
3084
- this.facade.handleMouseDown(event, this.canvasRef);
3085
- }
3086
- onMouseMove(event) {
3087
- this.facade.handleMouseMove(event, this.canvasRef);
3088
- }
3089
- onMouseUp(event) {
3090
- this.facade.handleMouseUp(event, this.canvasRef);
3091
- }
3092
- onMouseLeave() {
3093
- this.facade.handleMouseLeave();
3094
- }
3095
- onSwimlaneAddClick(event, swimlane) {
3096
- const rect = this.canvasRef.nativeElement.getBoundingClientRect();
3097
- const position = {
3098
- x: event.clientX - rect.left + 20,
3099
- y: event.clientY - rect.top,
3100
- };
3101
- this.swimlaneStats.openPopup(position, swimlane.id);
3102
- }
3103
- onPopupAction(actionId) {
3104
- const swimlaneId = this.swimlaneStats.popupStatus().swimlaneId;
3105
- if (!swimlaneId)
3106
- return;
3107
- switch (actionId) {
3108
- case 'add-above':
3109
- // Handle adding swimlane above
3110
- break;
3111
- case 'add-below':
3112
- // Handle adding swimlane below
3113
- break;
3114
- case 'delete':
3115
- // Handle deletion
3116
- break;
3117
- }
3118
- }
3119
- getSegmentPath(start, end) {
3120
- return `M ${start.x} ${start.y} L ${end.x} ${end.y}`;
3121
- }
3122
- isSegmentHovered(connectionId, index) {
3123
- return (this.hoveredSegment?.connectionId === connectionId &&
3124
- this.hoveredSegment?.index === index);
3125
- }
3126
- onSegmentMouseDown(event, connectionId, segmentIndex) {
3127
- event.stopPropagation();
3128
- this.facade.handleSegmentMouseDown(event, this.canvasRef, connectionId, segmentIndex);
3129
- }
3130
- onNodeSelected(data) {
3131
- this.facade.finalizeNodeCreation(data);
3132
- }
3133
- onNodeSelectionCancelled() {
3134
- this.facade.preconditionService.clearPendingNode();
3135
- }
3136
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WFCanvasComponent, deps: [{ token: WorkflowFacadeService }], target: i0.ɵɵFactoryTarget.Component });
3137
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WFCanvasComponent, isStandalone: true, selector: "wf-canvas", host: { listeners: { "window:keydown": "onKeyDown($event)", "click": "onClick()" } }, viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["container"], descendants: true }, { propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true }], ngImport: i0, template: `
3138
- <div
3139
- class="canvas-container"
3140
- #container
3141
- [class.connecting]="facade.canvasState().isConnecting"
3142
- (mousedown)="onMouseDown($event)"
3143
- (mousemove)="onMouseMove($event)"
3144
- (mouseup)="onMouseUp($event)"
3145
- (mouseleave)="onMouseLeave()"
3146
- >
3147
- <svg
3148
- #canvas
3149
- [attr.width]="facade.canvasState().width"
3150
- [attr.height]="facade.canvasState().height"
3151
- >
3152
- <!-- Grid Pattern -->
3153
- <defs>
3154
- <pattern
3155
- id="grid"
3156
- [attr.width]="facade.canvasState().gridSize"
3157
- [attr.height]="facade.canvasState().gridSize"
3158
- patternUnits="userSpaceOnUse"
3159
- >
3160
- <path
3161
- [attr.d]="facade.getGridPattern().path.d"
3162
- [ngStyle]="facade.getGridPattern().path.style"
3163
- />
3164
- </pattern>
3165
- </defs>
3166
-
3167
- <!-- Background grid -->
3168
- <rect width="100%" height="100%" fill="url(#grid)" />
3169
-
3170
- <!-- Swimlanes -->
3171
- @for (swimlane of facade.swimlanes(); track swimlane.id) {
3172
- <g [attr.transform]="facade.getNodeTransforms(swimlane).node">
3173
- <rect
3174
- [attr.width]="swimlane.size.width"
3175
- [attr.height]="swimlane.size.height"
3176
- [ngStyle]="facade.rendering.getSwimlaneStyle()"
3177
- />
3178
- <!-- <text
3179
- x="100"
3180
- y="20"
3181
- [ngStyle]="facade.rendering.getLabelStyle('swimlane')"
3182
- >
3183
- {{ swimlane.label }}
3184
- </text> -->
3185
- <!-- <foreignObject
3186
- [attr.x]="labelService.getLabelPosition(swimlane).x"
3187
- [attr.y]="labelService.getLabelPosition(swimlane).y"
3188
- width="150"
3189
- height="40"
3190
- style="overflow: visible;"
3191
- >
3192
- <wf-label-editor
3193
- [label]="swimlane.label || 'New Swimlane'"
3194
- [x]="0"
3195
- [y]="0"
3196
- [isSwimlane]="true"
3197
- (labelChange)="updateLabel(swimlane.id, $event)"
3198
- />
3199
- </foreignObject> -->
3200
-
3201
- <!-- <g
3202
- wf-swimlane-label
3203
- [label]="swimlane.label"
3204
- [count]="swimlaneStats.getNodeCount(swimlane.id)"
3205
- [x]="20"
3206
- [y]="swimlane.size.height - 20"
3207
- (addClick)="onSwimlaneAddClick($event, swimlane)"
3208
- (labelChange)="updateLabel(swimlane.id, $event)"
3209
- /> -->
3210
-
3211
- <g transform="translate(30, 20)">
3212
- <g
3213
- wf-swimlane-label
3214
- [label]="swimlane.label"
3215
- [count]="swimlaneStats.getNodeCount(swimlane.id)"
3216
- (addClick)="onSwimlaneAddClick($event, swimlane)"
3217
- (labelChange)="updateLabel(swimlane.id, $event)"
3218
- />
3219
- </g>
3220
-
3221
- <!-- <foreignObject
3222
- [attr.x]="50"
3223
- [attr.y]="20"
3224
- width="150"
3225
- height="40"
3226
- style="overflow: visible;"
3227
- >
3228
- <wf-label-editor
3229
- [label]="swimlane.label || 'New Swimlane'"
3230
- [x]="0"
3231
- [y]="0"
3232
- [isSwimlane]="true"
3233
- (labelChange)="updateLabel(swimlane.id, $event)"
3234
- />
3235
- </foreignObject> -->
3236
- </g>
3237
- }
3238
-
3239
- <!-- Connections with labels -->
3240
- @for (connection of facade.connections(); track connection.id) {
3241
- <g
3242
- class="connection"
3243
- [class.selected]="facade.selection.isSelected(connection.id)"
3244
- >
3245
- <!-- <path
3246
- [attr.d]="facade.getConnectionPath(connection.points)"
3247
- [ngStyle]="
3248
- facade.getConnectionStyle(
3249
- facade.selection.isSelected(connection.id)
3250
- )
3251
- "
3252
- /> -->
3253
- <!-- Complete connection path with arrowhead -->
3254
- <path
3255
- [attr.d]="facade.getConnectionPath(connection.points)"
3256
- [ngStyle]="
3257
- facade.getConnectionStyle(
3258
- facade.selection.isSelected(connection.id)
3259
- )
3260
- "
3261
- />
3262
- <!-- Render segments -->
3263
- @for (point of connection.points; let i = $index; track i) { @if (i <
3264
- connection.points.length - 1) {
3265
- <!-- Interactive segment -->
3266
- <!-- <path
3267
- [attr.d]="getSegmentPath(point, connection.points[i + 1])"
3268
- [ngStyle]="
3269
- facade.getConnectionStyle(
3270
- facade.selection.isSelected(connection.id)
3271
- )
3272
- "
3273
- [style.cursor]="facade.getSegmentCursor(connection.id, i)"
3274
- (mousedown)="onSegmentMouseDown($event, connection.id, i)"
3275
- class="connection-segment"
3276
- /> -->
3277
- <g
3278
- class="segment-group"
3279
- (mouseenter)="
3280
- hoveredSegment = { connectionId: connection.id, index: i }
3281
- "
3282
- (mouseleave)="hoveredSegment = null"
3283
- >
3284
- <!-- Hit detection area -->
3285
- <path
3286
- [attr.d]="getSegmentPath(point, connection.points[i + 1])"
3287
- class="segment-hitarea"
3288
- [style.cursor]="facade.getSegmentCursor(connection.id, i)"
3289
- (mousedown)="onSegmentMouseDown($event, connection.id, i)"
3290
- />
3291
-
3292
- <!-- Visible segment -->
3293
- <path
3294
- [attr.d]="getSegmentPath(point, connection.points[i + 1])"
3295
- [ngStyle]="
3296
- facade.rendering.getConnectionSegmentStyle(
3297
- facade.selection.isSelected(connection.id),
3298
- isSegmentHovered(connection.id, i)
3299
- )
3300
- "
3301
- />
3302
- </g>
3303
- } }
3304
- <!-- Connection Label -->
3305
- @if (connection.fromId && connection.toId) {
3306
- <foreignObject
3307
- [attr.x]="labelService.getLabelPosition(connection).x"
3308
- [attr.y]="labelService.getLabelPosition(connection).y"
3309
- width="150"
3310
- height="40"
3311
- style="overflow: visible; pointer-events: all;"
3312
- [attr.transform]="'translate(-10, -10)'"
3313
- >
3314
- <wf-label-editor
3315
- [label]="connection.label || 'New Action'"
3316
- [x]="0"
3317
- [y]="0"
3318
- [isConnection]="true"
3319
- (labelChange)="updateLabel(connection.id, $event)"
3320
- />
3321
- </foreignObject>
3322
- }
3323
- </g>
3324
- }
3325
-
3326
- <!-- Nodes -->
3327
- @for (node of facade.nodes(); track node.id) {
3328
- <g
3329
- [attr.transform]="facade.getNodeTransforms(node).node"
3330
- [class.selected]="facade.selection.isSelected(node.id)"
3331
- [class.dragging]="
3332
- facade.canvasState().isDragging &&
3333
- facade.selection.isSelected(node.id)
3334
- "
3335
- >
3336
- @switch (node.type) { @case ('start') {
3337
- <path
3338
- [attr.d]="facade.getStartNodePaths().circle"
3339
- [ngStyle]="
3340
- facade.getNodeStyle(facade.selection.isSelected(node.id))
3341
- "
3342
- />
3343
- @if (!facade.hasOutgoingConnections(node.id)) {
3344
- <path
3345
- [attr.d]="facade.getStartNodePaths().arrow"
3346
- [attr.transform]="facade.getNodeTransforms(node).arrow"
3347
- fill="#D36CFF"
3348
- />
3349
- } }@case ('form') {
3350
- <path
3351
- [attr.d]="facade.rendering.generateNodePath(node)"
3352
- [ngStyle]="
3353
- facade.getNodeStyle(facade.selection.isSelected(node.id))
3354
- "
3355
- />
3356
- } @case ('decision') {
3357
- <path
3358
- [attr.d]="
3359
- facade.rendering.getDecisionPath(
3360
- node.size.width,
3361
- node.size.height
3362
- )
3363
- "
3364
- [ngStyle]="
3365
- facade.getNodeStyle(facade.selection.isSelected(node.id))
3366
- "
3367
- />
3368
- } @case ('subflow') {
3369
- <path
3370
- [attr.d]="
3371
- facade.rendering.getSubflowPath(node.size.width, node.size.height)
3372
- "
3373
- [ngStyle]="
3374
- facade.getNodeStyle(facade.selection.isSelected(node.id))
3375
- "
3376
- />
3377
- } @default {
3378
- <rect
3379
- [attr.width]="node.size.width"
3380
- [attr.height]="node.size.height"
3381
- [attr.rx]="4"
3382
- [ngStyle]="
3383
- facade.getNodeStyle(facade.selection.isSelected(node.id))
3384
- "
3385
- />
3386
- } }
3387
-
3388
- <!-- Node label -->
3389
- <!-- <text
3390
- [attr.x]="node.size.width / 2"
3391
- [attr.y]="node.size.height / 2"
3392
- [ngStyle]="facade.rendering.getLabelStyle(node.type)"
3393
- >
3394
- {{ node.label }}
3395
- </text> -->
3396
- <foreignObject
3397
- [attr.x]="0"
3398
- [attr.y]="0"
3399
- [attr.width]="node.size.width"
3400
- [attr.height]="node.size.height"
3401
- style="overflow: visible;"
3402
- >
3403
- <wf-label-editor
3404
- [label]="node.label"
3405
- [x]="labelService.getSVGTextPosition(node).x"
3406
- [y]="labelService.getSVGTextPosition(node).y"
3407
- (labelChange)="updateLabel(node.id, $event)"
3408
- />
3409
- </foreignObject>
3410
- </g>
3411
- }
3412
-
3413
- <!-- Connection preview with arrowhead -->
3414
- @if (facade.canvasState().connectionPreview) {
3415
- <path
3416
- [attr.d]="facade.getConnectionPreviewPath()"
3417
- [ngStyle]="facade.rendering.getConnectionPreviewStyle()"
3418
- />
3419
- }
3420
- </svg>
3421
-
3422
- @if (swimlaneStats.popupStatus().isOpen) {
3423
- <wf-swimlane-popup
3424
- [position]="swimlaneStats.popupStatus().position"
3425
- (close)="swimlaneStats.closePopup()"
3426
- (actionSelected)="onPopupAction($event)"
3427
- />
3428
- }
3429
- </div>
3430
-
3431
- <wf-node-selector
3432
- (select)="onNodeSelected($event)"
3433
- (cancel)="onNodeSelectionCancelled()"
3434
- />
3435
- `, isInline: true, styles: [".canvas-container{flex:1;overflow:auto;position:relative;background:#fff;&.connecting{cursor:crosshair}}.connection{path{stroke:#d36cff;stroke-width:2;fill:none;pointer-events:none}&.selected path{stroke-width:3}}.selected{:not(text){stroke-width:3}}.dragging{cursor:grabbing}.connection{pointer-events:none}.segment-group{pointer-events:all}.segment-hitarea{stroke:transparent;stroke-width:10;fill:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: LabelEditorComponent, selector: "wf-label-editor", inputs: ["label", "x", "y", "isConnection", "isSwimlane"], outputs: ["labelChange", "openDialog"] }, { kind: "component", type: SwimlaneLabelComponent, selector: "[wf-swimlane-label]", inputs: ["label", "count"], outputs: ["addClick", "labelChange"] }, { kind: "component", type: SwimLanePopupComponent, selector: "wf-swimlane-popup", inputs: ["position"], outputs: ["close", "actionSelected"] }, { kind: "component", type: NodeSelectorComponent, selector: "wf-node-selector", outputs: ["select"] }] });
3436
- }
3437
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WFCanvasComponent, decorators: [{
3438
- type: Component,
3439
- args: [{ selector: 'wf-canvas', standalone: true, imports: [
3440
- CommonModule,
3441
- LabelEditorComponent,
3442
- SwimlaneLabelComponent,
3443
- SwimLanePopupComponent,
3444
- NodeSelectorComponent,
3445
- ], template: `
3446
- <div
3447
- class="canvas-container"
3448
- #container
3449
- [class.connecting]="facade.canvasState().isConnecting"
3450
- (mousedown)="onMouseDown($event)"
3451
- (mousemove)="onMouseMove($event)"
3452
- (mouseup)="onMouseUp($event)"
3453
- (mouseleave)="onMouseLeave()"
3454
- >
3455
- <svg
3456
- #canvas
3457
- [attr.width]="facade.canvasState().width"
3458
- [attr.height]="facade.canvasState().height"
3459
- >
3460
- <!-- Grid Pattern -->
3461
- <defs>
3462
- <pattern
3463
- id="grid"
3464
- [attr.width]="facade.canvasState().gridSize"
3465
- [attr.height]="facade.canvasState().gridSize"
3466
- patternUnits="userSpaceOnUse"
3467
- >
3468
- <path
3469
- [attr.d]="facade.getGridPattern().path.d"
3470
- [ngStyle]="facade.getGridPattern().path.style"
3471
- />
3472
- </pattern>
3473
- </defs>
3474
-
3475
- <!-- Background grid -->
3476
- <rect width="100%" height="100%" fill="url(#grid)" />
3477
-
3478
- <!-- Swimlanes -->
3479
- @for (swimlane of facade.swimlanes(); track swimlane.id) {
3480
- <g [attr.transform]="facade.getNodeTransforms(swimlane).node">
3481
- <rect
3482
- [attr.width]="swimlane.size.width"
3483
- [attr.height]="swimlane.size.height"
3484
- [ngStyle]="facade.rendering.getSwimlaneStyle()"
3485
- />
3486
- <!-- <text
3487
- x="100"
3488
- y="20"
3489
- [ngStyle]="facade.rendering.getLabelStyle('swimlane')"
3490
- >
3491
- {{ swimlane.label }}
3492
- </text> -->
3493
- <!-- <foreignObject
3494
- [attr.x]="labelService.getLabelPosition(swimlane).x"
3495
- [attr.y]="labelService.getLabelPosition(swimlane).y"
3496
- width="150"
3497
- height="40"
3498
- style="overflow: visible;"
3499
- >
3500
- <wf-label-editor
3501
- [label]="swimlane.label || 'New Swimlane'"
3502
- [x]="0"
3503
- [y]="0"
3504
- [isSwimlane]="true"
3505
- (labelChange)="updateLabel(swimlane.id, $event)"
3506
- />
3507
- </foreignObject> -->
3508
-
3509
- <!-- <g
3510
- wf-swimlane-label
3511
- [label]="swimlane.label"
3512
- [count]="swimlaneStats.getNodeCount(swimlane.id)"
3513
- [x]="20"
3514
- [y]="swimlane.size.height - 20"
3515
- (addClick)="onSwimlaneAddClick($event, swimlane)"
3516
- (labelChange)="updateLabel(swimlane.id, $event)"
3517
- /> -->
3518
-
3519
- <g transform="translate(30, 20)">
3520
- <g
3521
- wf-swimlane-label
3522
- [label]="swimlane.label"
3523
- [count]="swimlaneStats.getNodeCount(swimlane.id)"
3524
- (addClick)="onSwimlaneAddClick($event, swimlane)"
3525
- (labelChange)="updateLabel(swimlane.id, $event)"
3526
- />
3527
- </g>
3528
-
3529
- <!-- <foreignObject
3530
- [attr.x]="50"
3531
- [attr.y]="20"
3532
- width="150"
3533
- height="40"
3534
- style="overflow: visible;"
3535
- >
3536
- <wf-label-editor
3537
- [label]="swimlane.label || 'New Swimlane'"
3538
- [x]="0"
3539
- [y]="0"
3540
- [isSwimlane]="true"
3541
- (labelChange)="updateLabel(swimlane.id, $event)"
3542
- />
3543
- </foreignObject> -->
3544
- </g>
3545
- }
3546
-
3547
- <!-- Connections with labels -->
3548
- @for (connection of facade.connections(); track connection.id) {
3549
- <g
3550
- class="connection"
3551
- [class.selected]="facade.selection.isSelected(connection.id)"
3552
- >
3553
- <!-- <path
3554
- [attr.d]="facade.getConnectionPath(connection.points)"
3555
- [ngStyle]="
3556
- facade.getConnectionStyle(
3557
- facade.selection.isSelected(connection.id)
3558
- )
3559
- "
3560
- /> -->
3561
- <!-- Complete connection path with arrowhead -->
3562
- <path
3563
- [attr.d]="facade.getConnectionPath(connection.points)"
3564
- [ngStyle]="
3565
- facade.getConnectionStyle(
3566
- facade.selection.isSelected(connection.id)
3567
- )
3568
- "
3569
- />
3570
- <!-- Render segments -->
3571
- @for (point of connection.points; let i = $index; track i) { @if (i <
3572
- connection.points.length - 1) {
3573
- <!-- Interactive segment -->
3574
- <!-- <path
3575
- [attr.d]="getSegmentPath(point, connection.points[i + 1])"
3576
- [ngStyle]="
3577
- facade.getConnectionStyle(
3578
- facade.selection.isSelected(connection.id)
3579
- )
3580
- "
3581
- [style.cursor]="facade.getSegmentCursor(connection.id, i)"
3582
- (mousedown)="onSegmentMouseDown($event, connection.id, i)"
3583
- class="connection-segment"
3584
- /> -->
3585
- <g
3586
- class="segment-group"
3587
- (mouseenter)="
3588
- hoveredSegment = { connectionId: connection.id, index: i }
3589
- "
3590
- (mouseleave)="hoveredSegment = null"
3591
- >
3592
- <!-- Hit detection area -->
3593
- <path
3594
- [attr.d]="getSegmentPath(point, connection.points[i + 1])"
3595
- class="segment-hitarea"
3596
- [style.cursor]="facade.getSegmentCursor(connection.id, i)"
3597
- (mousedown)="onSegmentMouseDown($event, connection.id, i)"
3598
- />
3599
-
3600
- <!-- Visible segment -->
3601
- <path
3602
- [attr.d]="getSegmentPath(point, connection.points[i + 1])"
3603
- [ngStyle]="
3604
- facade.rendering.getConnectionSegmentStyle(
3605
- facade.selection.isSelected(connection.id),
3606
- isSegmentHovered(connection.id, i)
3607
- )
3608
- "
3609
- />
3610
- </g>
3611
- } }
3612
- <!-- Connection Label -->
3613
- @if (connection.fromId && connection.toId) {
3614
- <foreignObject
3615
- [attr.x]="labelService.getLabelPosition(connection).x"
3616
- [attr.y]="labelService.getLabelPosition(connection).y"
3617
- width="150"
3618
- height="40"
3619
- style="overflow: visible; pointer-events: all;"
3620
- [attr.transform]="'translate(-10, -10)'"
3621
- >
3622
- <wf-label-editor
3623
- [label]="connection.label || 'New Action'"
3624
- [x]="0"
3625
- [y]="0"
3626
- [isConnection]="true"
3627
- (labelChange)="updateLabel(connection.id, $event)"
3628
- />
3629
- </foreignObject>
3630
- }
3631
- </g>
3632
- }
3633
-
3634
- <!-- Nodes -->
3635
- @for (node of facade.nodes(); track node.id) {
3636
- <g
3637
- [attr.transform]="facade.getNodeTransforms(node).node"
3638
- [class.selected]="facade.selection.isSelected(node.id)"
3639
- [class.dragging]="
3640
- facade.canvasState().isDragging &&
3641
- facade.selection.isSelected(node.id)
3642
- "
3643
- >
3644
- @switch (node.type) { @case ('start') {
3645
- <path
3646
- [attr.d]="facade.getStartNodePaths().circle"
3647
- [ngStyle]="
3648
- facade.getNodeStyle(facade.selection.isSelected(node.id))
3649
- "
3650
- />
3651
- @if (!facade.hasOutgoingConnections(node.id)) {
3652
- <path
3653
- [attr.d]="facade.getStartNodePaths().arrow"
3654
- [attr.transform]="facade.getNodeTransforms(node).arrow"
3655
- fill="#D36CFF"
3656
- />
3657
- } }@case ('form') {
3658
- <path
3659
- [attr.d]="facade.rendering.generateNodePath(node)"
3660
- [ngStyle]="
3661
- facade.getNodeStyle(facade.selection.isSelected(node.id))
3662
- "
3663
- />
3664
- } @case ('decision') {
3665
- <path
3666
- [attr.d]="
3667
- facade.rendering.getDecisionPath(
3668
- node.size.width,
3669
- node.size.height
3670
- )
3671
- "
3672
- [ngStyle]="
3673
- facade.getNodeStyle(facade.selection.isSelected(node.id))
3674
- "
3675
- />
3676
- } @case ('subflow') {
3677
- <path
3678
- [attr.d]="
3679
- facade.rendering.getSubflowPath(node.size.width, node.size.height)
3680
- "
3681
- [ngStyle]="
3682
- facade.getNodeStyle(facade.selection.isSelected(node.id))
3683
- "
3684
- />
3685
- } @default {
3686
- <rect
3687
- [attr.width]="node.size.width"
3688
- [attr.height]="node.size.height"
3689
- [attr.rx]="4"
3690
- [ngStyle]="
3691
- facade.getNodeStyle(facade.selection.isSelected(node.id))
3692
- "
3693
- />
3694
- } }
3695
-
3696
- <!-- Node label -->
3697
- <!-- <text
3698
- [attr.x]="node.size.width / 2"
3699
- [attr.y]="node.size.height / 2"
3700
- [ngStyle]="facade.rendering.getLabelStyle(node.type)"
3701
- >
3702
- {{ node.label }}
3703
- </text> -->
3704
- <foreignObject
3705
- [attr.x]="0"
3706
- [attr.y]="0"
3707
- [attr.width]="node.size.width"
3708
- [attr.height]="node.size.height"
3709
- style="overflow: visible;"
3710
- >
3711
- <wf-label-editor
3712
- [label]="node.label"
3713
- [x]="labelService.getSVGTextPosition(node).x"
3714
- [y]="labelService.getSVGTextPosition(node).y"
3715
- (labelChange)="updateLabel(node.id, $event)"
3716
- />
3717
- </foreignObject>
3718
- </g>
3719
- }
3720
-
3721
- <!-- Connection preview with arrowhead -->
3722
- @if (facade.canvasState().connectionPreview) {
3723
- <path
3724
- [attr.d]="facade.getConnectionPreviewPath()"
3725
- [ngStyle]="facade.rendering.getConnectionPreviewStyle()"
3726
- />
3727
- }
3728
- </svg>
3729
-
3730
- @if (swimlaneStats.popupStatus().isOpen) {
3731
- <wf-swimlane-popup
3732
- [position]="swimlaneStats.popupStatus().position"
3733
- (close)="swimlaneStats.closePopup()"
3734
- (actionSelected)="onPopupAction($event)"
3735
- />
3736
- }
3737
- </div>
3738
-
3739
- <wf-node-selector
3740
- (select)="onNodeSelected($event)"
3741
- (cancel)="onNodeSelectionCancelled()"
3742
- />
3743
- `, styles: [".canvas-container{flex:1;overflow:auto;position:relative;background:#fff;&.connecting{cursor:crosshair}}.connection{path{stroke:#d36cff;stroke-width:2;fill:none;pointer-events:none}&.selected path{stroke-width:3}}.selected{:not(text){stroke-width:3}}.dragging{cursor:grabbing}.connection{pointer-events:none}.segment-group{pointer-events:all}.segment-hitarea{stroke:transparent;stroke-width:10;fill:none}\n"] }]
3744
- }], ctorParameters: () => [{ type: WorkflowFacadeService }], propDecorators: { containerRef: [{
3745
- type: ViewChild,
3746
- args: ['container']
3747
- }], canvasRef: [{
3748
- type: ViewChild,
3749
- args: ['canvas']
3750
- }], onKeyDown: [{
3751
- type: HostListener,
3752
- args: ['window:keydown', ['$event']]
3753
- }], onClick: [{
3754
- type: HostListener,
3755
- args: ['click']
3756
- }] } });
3757
-
3758
- // components/workflow/wf-designer.component.ts
3759
- class WFDesignerComponent {
3760
- workflowId = input.required();
3761
- facade = inject(WorkflowFacadeService);
3762
- saving = signal(false);
3763
- // Computed signals for reactive UI
3764
- workflowName = computed(() => this.facade.persistence.workflowMetadata.name || 'Untitled Workflow');
3765
- workflowDescription = computed(() => this.facade.persistence.workflowMetadata.description || '');
3766
- isSaving = this.saving.asReadonly();
3767
- constructor() {
3768
- this.facade.initializeWorkflow();
3769
- }
3770
- ngOnInit() {
3771
- const workflowId = this.workflowId();
3772
- if (workflowId) {
3773
- this.loadWorkflow(workflowId);
3774
- }
3775
- }
3776
- loadWorkflow(workflowId) {
3777
- this.facade.persistence.loadWorkflow(workflowId).catch((error) => {
3778
- console.error('Failed to load workflow:', error);
3779
- // Optionally show an error notification here
3780
- });
3781
- }
3782
- handleToolSelection(tool) {
3783
- this.facade.handleToolSelection(tool);
3784
- }
3785
- handleSave() {
3786
- if (this.isSaving())
3787
- return;
3788
- this.saving.set(true);
3789
- this.facade.persistence
3790
- .saveWorkflow()
3791
- .then((results) => {
3792
- console.log('Workflow saved successfully:', results);
3793
- // Optionally show a success notification
3794
- })
3795
- .catch((error) => {
3796
- console.error('Error saving workflow:', error);
3797
- // Optionally show an error notification
3798
- })
3799
- .finally(() => {
3800
- this.saving.set(false);
3801
- });
3802
- }
3803
- handleNodeSelection(data) {
3804
- this.facade.finalizeNodeCreation(data);
3805
- }
3806
- handleNodeSelectionCancel() {
3807
- // The node selection was canceled, clear the pending node
3808
- this.facade.preconditionService.clearPendingNode();
3809
- }
3810
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WFDesignerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3811
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: WFDesignerComponent, isStandalone: true, selector: "wf-designer", inputs: { workflowId: { classPropertyName: "workflowId", publicName: "workflowId", isSignal: true, isRequired: true, transformFunction: null } }, providers: [EnvironmentService], ngImport: i0, template: `
3812
- <div class="workflow-designer">
3813
- <div class="workflow-header">
3814
- <h1 class="workflow-title">{{ workflowName() }}</h1>
3815
- <p *ngIf="workflowDescription()" class="workflow-description">
3816
- {{ workflowDescription() }}
3817
- </p>
3818
- </div>
3819
-
3820
- <wf-toolbar
3821
- [selectedTool]="facade.selectedTool()"
3822
- (toolSelected)="handleToolSelection($event)"
3823
- />
3824
-
3825
- <wf-canvas />
3826
-
3827
- <div class="workflow-actions">
3828
- <button
3829
- class="save-button"
3830
- (click)="handleSave()"
3831
- [disabled]="isSaving()"
3832
- >
3833
- {{ isSaving() ? 'Saving...' : 'Save' }}
3834
- </button>
3835
- </div>
3836
-
3837
- <!-- Node selector dialog for forms, subflows, etc. -->
3838
- <wf-node-selector
3839
- (select)="handleNodeSelection($event)"
3840
- (cancel)="handleNodeSelectionCancel()"
3841
- />
3842
- </div>
3843
- `, isInline: true, styles: [".workflow-designer{display:flex;flex-direction:column;height:100vh;background:#fff}.workflow-header{padding:1rem;border-bottom:1px solid #e5e7eb}.workflow-title{font-size:1.25rem;font-weight:600;color:#111827}.workflow-description{font-size:.875rem;color:#6b7280;margin-top:.25rem}.workflow-actions{padding:.75rem;border-top:1px solid #e5e7eb;display:flex;justify-content:flex-end}.save-button{padding:.5rem 1rem;background-color:#9333ea;color:#fff;font-weight:500;border-radius:.375rem;border:none;cursor:pointer;transition:background-color .2s}.save-button:hover{background-color:#7e22ce}.save-button:disabled{background-color:#d8b4fe;cursor:not-allowed}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: WFToolbarComponent, selector: "wf-toolbar", inputs: ["selectedTool"], outputs: ["toolSelected"] }, { kind: "component", type: WFCanvasComponent, selector: "wf-canvas" }, { kind: "component", type: NodeSelectorComponent, selector: "wf-node-selector", outputs: ["select"] }] });
3844
- }
3845
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WFDesignerComponent, decorators: [{
3846
- type: Component,
3847
- args: [{ selector: 'wf-designer', standalone: true, imports: [
3848
- CommonModule,
3849
- WFToolbarComponent,
3850
- WFCanvasComponent,
3851
- NodeSelectorComponent,
3852
- ], providers: [EnvironmentService], template: `
3853
- <div class="workflow-designer">
3854
- <div class="workflow-header">
3855
- <h1 class="workflow-title">{{ workflowName() }}</h1>
3856
- <p *ngIf="workflowDescription()" class="workflow-description">
3857
- {{ workflowDescription() }}
3858
- </p>
3859
- </div>
3860
-
3861
- <wf-toolbar
3862
- [selectedTool]="facade.selectedTool()"
3863
- (toolSelected)="handleToolSelection($event)"
3864
- />
3865
-
3866
- <wf-canvas />
3867
-
3868
- <div class="workflow-actions">
3869
- <button
3870
- class="save-button"
3871
- (click)="handleSave()"
3872
- [disabled]="isSaving()"
3873
- >
3874
- {{ isSaving() ? 'Saving...' : 'Save' }}
3875
- </button>
3876
- </div>
3877
-
3878
- <!-- Node selector dialog for forms, subflows, etc. -->
3879
- <wf-node-selector
3880
- (select)="handleNodeSelection($event)"
3881
- (cancel)="handleNodeSelectionCancel()"
3882
- />
3883
- </div>
3884
- `, styles: [".workflow-designer{display:flex;flex-direction:column;height:100vh;background:#fff}.workflow-header{padding:1rem;border-bottom:1px solid #e5e7eb}.workflow-title{font-size:1.25rem;font-weight:600;color:#111827}.workflow-description{font-size:.875rem;color:#6b7280;margin-top:.25rem}.workflow-actions{padding:.75rem;border-top:1px solid #e5e7eb;display:flex;justify-content:flex-end}.save-button{padding:.5rem 1rem;background-color:#9333ea;color:#fff;font-weight:500;border-radius:.375rem;border:none;cursor:pointer;transition:background-color .2s}.save-button:hover{background-color:#7e22ce}.save-button:disabled{background-color:#d8b4fe;cursor:not-allowed}\n"] }]
3885
- }], ctorParameters: () => [] });
3886
-
3887
- /**
3888
- * Generated bundle index. Do not edit.
3889
- */
3890
-
3891
- export { LabelEditorComponent, WFDesignerComponent };
3892
- //# sourceMappingURL=verben-workflow-ui-src-lib-components-designer.mjs.map