verben-workflow-ui 0.6.4 → 0.6.6

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 (1101) hide show
  1. package/ng-package.json +15 -0
  2. package/package.json +9 -194
  3. package/src/lib/base/core/base-data-page.facade.ts +533 -0
  4. package/src/lib/base/core/base-data-page.service.ts +222 -0
  5. package/src/lib/base/core/base-data-page.state.ts +287 -0
  6. package/src/lib/base/handlers/filter-handler.service.ts +169 -0
  7. package/src/lib/base/handlers/search-handler.service.ts +33 -0
  8. package/src/lib/base/handlers/sort-handler.service.ts +93 -0
  9. package/src/lib/base/models/api-payload.ts +13 -0
  10. package/src/lib/base/models/page-config.interface.ts +49 -0
  11. package/src/lib/base/models/page-filter-tab-option.interface.ts +20 -0
  12. package/src/lib/base/ng-package.json +6 -0
  13. package/src/lib/base/public-api.ts +16 -0
  14. package/src/lib/base/utils/column-helpers.ts +77 -0
  15. package/src/lib/components/actors/actors.columns.ts +40 -0
  16. package/src/lib/components/actors/actors.component.css +0 -0
  17. package/src/lib/components/actors/actors.component.html +320 -0
  18. package/src/lib/components/actors/actors.component.spec.ts +23 -0
  19. package/src/lib/components/actors/actors.component.ts +221 -0
  20. package/src/lib/components/actors/actors.config.ts +55 -0
  21. package/src/lib/components/actors/actors.facade.ts +71 -0
  22. package/src/lib/components/actors/actors.form.component.html +37 -0
  23. package/src/lib/components/actors/actors.form.component.ts +69 -0
  24. package/src/lib/components/actors/actors.model.ts +4 -0
  25. package/src/lib/components/actors/actors.module.ts +13 -0
  26. package/src/lib/components/actors/actors.service.ts +85 -0
  27. package/src/lib/components/actors/actors.state.ts +31 -0
  28. package/src/lib/components/actors/ng-package.json +6 -0
  29. package/src/lib/components/designer/components/label-editor.component.ts +188 -0
  30. package/src/lib/components/designer/components/node-selector.component.ts +208 -0
  31. package/src/lib/components/designer/components/swimlane-label.component.ts +102 -0
  32. package/src/lib/components/designer/components/swimlane-popup.component.ts +51 -0
  33. package/src/lib/components/designer/components/wf-canvas.component.ts +495 -0
  34. package/src/lib/components/designer/components/wf-designer.component.ts +182 -0
  35. package/src/lib/components/designer/components/wf-node.component.ts +91 -0
  36. package/src/lib/components/designer/components/wf-properties-popup.component.ts +257 -0
  37. package/src/lib/components/designer/components/wf-toolbar.component.ts +84 -0
  38. package/src/lib/components/designer/models/types.ts +133 -0
  39. package/src/lib/components/designer/ng-package.json +6 -0
  40. package/src/lib/components/designer/services/canvas-state.service.ts +63 -0
  41. package/src/lib/components/designer/services/connection-segment-interaction.service.ts +141 -0
  42. package/src/lib/components/designer/services/connection.service.ts +351 -0
  43. package/src/lib/components/designer/services/keyboard-handler.service.ts +39 -0
  44. package/src/lib/components/designer/services/label-management.service.ts +72 -0
  45. package/src/lib/components/designer/services/node-finder.service.ts +34 -0
  46. package/src/lib/components/designer/services/node-interaction.service.ts +135 -0
  47. package/src/lib/components/designer/services/node-placement.service.ts +77 -0
  48. package/src/lib/components/designer/services/node-precondition.service.ts +138 -0
  49. package/src/lib/components/designer/services/node-renderer.service.ts +97 -0
  50. package/src/lib/components/designer/services/node-selection.service.ts +110 -0
  51. package/src/lib/components/designer/services/orthogonal-router.service.ts +233 -0
  52. package/src/lib/components/designer/services/position-update.service.ts +56 -0
  53. package/src/lib/components/designer/services/rendering.service.ts +296 -0
  54. package/src/lib/components/designer/services/swimlane-management.service.ts +189 -0
  55. package/src/lib/components/designer/services/swimlane-stats.service.ts +53 -0
  56. package/src/lib/components/designer/services/tag-helper.service.ts +80 -0
  57. package/src/lib/components/designer/services/viewport.service.ts +30 -0
  58. package/src/lib/components/designer/services/wf-facade.service.ts +287 -0
  59. package/src/lib/components/designer/services/wf-mapper.service.ts +450 -0
  60. package/src/lib/components/designer/services/wf-persistence.service.ts +184 -0
  61. package/src/lib/components/designer/services/wf-state.service.ts +143 -0
  62. package/src/lib/components/expiration/expiration.component.css +0 -0
  63. package/src/lib/components/expiration/expiration.component.html +21 -0
  64. package/src/lib/components/expiration/expiration.component.spec.ts +23 -0
  65. package/src/lib/components/expiration/expiration.component.ts +52 -0
  66. package/src/lib/components/expiration/expiration.module.ts +11 -0
  67. package/src/lib/components/expiration/ng-package.json +6 -0
  68. package/src/lib/components/file-render/file-render.component.css +4 -0
  69. package/src/lib/components/file-render/file-render.component.html +21 -0
  70. package/src/lib/components/file-render/file-render.component.spec.ts +23 -0
  71. package/src/lib/components/file-render/file-render.component.ts +34 -0
  72. package/src/lib/components/file-render/file-render.module.ts +19 -0
  73. package/src/lib/components/file-render/ng-package.json +6 -0
  74. package/src/lib/components/file-upload/file-upload.component.css +0 -0
  75. package/src/lib/components/file-upload/file-upload.component.html +69 -0
  76. package/src/lib/components/file-upload/file-upload.component.spec.ts +23 -0
  77. package/src/lib/components/file-upload/file-upload.component.ts +87 -0
  78. package/src/lib/components/file-upload/file-upload.module.ts +40 -0
  79. package/src/lib/components/file-upload/ng-package.json +6 -0
  80. package/src/lib/components/flowable-status/flowable-status.columns.ts +23 -0
  81. package/src/lib/components/flowable-status/flowable-status.component.css +1 -0
  82. package/src/lib/components/flowable-status/flowable-status.component.html +166 -0
  83. package/src/lib/components/flowable-status/flowable-status.component.ts +247 -0
  84. package/src/lib/components/flowable-status/flowable-status.config.ts +54 -0
  85. package/src/lib/components/flowable-status/flowable-status.facade.ts +70 -0
  86. package/src/lib/components/flowable-status/flowable-status.form.component.html +13 -0
  87. package/src/lib/components/flowable-status/flowable-status.form.component.ts +51 -0
  88. package/src/lib/components/flowable-status/flowable-status.model.ts +3 -0
  89. package/src/lib/components/flowable-status/flowable-status.module.ts +13 -0
  90. package/src/lib/components/flowable-status/flowable-status.service.ts +39 -0
  91. package/src/lib/components/flowable-status/flowable-status.state.ts +10 -0
  92. package/src/lib/components/flowable-status/ng-package.json +6 -0
  93. package/src/lib/components/flowable-status/public-api.ts +3 -0
  94. package/src/lib/components/form-control/form-control.component.css +0 -0
  95. package/src/lib/components/form-control/form-control.component.html +259 -0
  96. package/src/lib/components/form-control/form-control.component.spec.ts +23 -0
  97. package/src/lib/components/form-control/form-control.component.ts +197 -0
  98. package/src/lib/components/form-control/form-control.module.ts +47 -0
  99. package/src/lib/components/form-control/ng-package.json +6 -0
  100. package/src/lib/components/form-group/base-table-style.ts +52 -0
  101. package/src/lib/components/form-group/form-fields/form-fields.component.css +114 -0
  102. package/src/lib/components/form-group/form-fields/form-fields.component.html +621 -0
  103. package/src/lib/components/form-group/form-fields/form-fields.component.spec.ts +23 -0
  104. package/src/lib/components/form-group/form-fields/form-fields.component.ts +1115 -0
  105. package/src/lib/components/form-group/form-fields/form-fields.module.ts +48 -0
  106. package/src/lib/components/form-group/form-fields/form-fields.service.ts +70 -0
  107. package/src/lib/components/form-group/form-fields/helper.ts +45 -0
  108. package/src/lib/components/form-group/form-group.component.css +113 -0
  109. package/src/lib/components/form-group/form-group.component.html +486 -0
  110. package/src/lib/components/form-group/form-group.component.spec.ts +22 -0
  111. package/src/lib/components/form-group/form-group.component.ts +789 -0
  112. package/src/lib/components/form-group/form-group.module.ts +54 -0
  113. package/src/lib/components/form-group/form-group.service.ts +53 -0
  114. package/src/lib/components/form-group/helper.ts +45 -0
  115. package/src/lib/components/form-group/ng-package.json +6 -0
  116. package/src/lib/components/form-response/form-response.component.css +114 -0
  117. package/src/lib/components/form-response/form-response.component.html +188 -0
  118. package/src/lib/components/form-response/form-response.component.spec.ts +23 -0
  119. package/src/lib/components/form-response/form-response.component.ts +735 -0
  120. package/src/lib/components/form-response/form-response.module.ts +48 -0
  121. package/src/lib/components/form-response/form-response.service.ts +52 -0
  122. package/src/lib/components/form-response/helper.ts +222 -0
  123. package/src/lib/components/form-response/ng-package.json +6 -0
  124. package/src/lib/components/form-timer/form-timer.component.css +0 -0
  125. package/src/lib/components/form-timer/form-timer.component.html +47 -0
  126. package/src/lib/components/form-timer/form-timer.component.spec.ts +23 -0
  127. package/src/lib/components/form-timer/form-timer.component.ts +50 -0
  128. package/src/lib/components/form-timer/form-timer.module.ts +19 -0
  129. package/src/lib/components/form-timer/ng-package.json +6 -0
  130. package/src/lib/components/form-values/form-values.component.css +48 -0
  131. package/src/lib/components/form-values/form-values.component.html +225 -0
  132. package/src/lib/components/form-values/form-values.component.ts +1437 -0
  133. package/src/lib/components/form-values/form-values.module.ts +13 -0
  134. package/src/lib/components/form-values/form-values.service.ts +45 -0
  135. package/src/lib/components/form-values/ng-package.json +6 -0
  136. package/src/lib/components/form-values/public-api.ts +3 -0
  137. package/src/lib/components/form-viewer/form-viewer.component.css +4 -0
  138. package/src/lib/components/form-viewer/form-viewer.component.html +62 -0
  139. package/src/lib/components/form-viewer/form-viewer.component.spec.ts +23 -0
  140. package/src/lib/components/form-viewer/form-viewer.component.ts +31 -0
  141. package/src/lib/components/form-viewer/form-viewer.module.ts +52 -0
  142. package/src/lib/components/form-viewer/ng-package.json +6 -0
  143. package/src/lib/components/forms/base-table-style.ts +52 -0
  144. package/src/lib/components/forms/forms.component.css +126 -0
  145. package/src/lib/components/forms/forms.component.html +538 -0
  146. package/src/lib/components/forms/forms.component.spec.ts +23 -0
  147. package/src/lib/components/forms/forms.component.ts +810 -0
  148. package/src/lib/components/forms/forms.module.ts +10 -0
  149. package/src/lib/components/forms/forms.service.spec.ts +16 -0
  150. package/src/lib/components/forms/forms.service.ts +65 -0
  151. package/src/lib/components/forms/ng-package.json +6 -0
  152. package/src/lib/components/journal/journal.component.css +0 -0
  153. package/src/lib/components/journal/journal.component.html +1 -0
  154. package/src/lib/components/journal/journal.component.spec.ts +23 -0
  155. package/src/lib/components/journal/journal.component.ts +10 -0
  156. package/src/lib/components/journal/journal.module.ts +10 -0
  157. package/src/lib/components/journal/ng-package.json +6 -0
  158. package/src/lib/components/my-queue/my-queue.columns.ts +37 -0
  159. package/src/lib/components/my-queue/my-queue.component.css +8 -0
  160. package/src/lib/components/my-queue/my-queue.component.html +319 -0
  161. package/src/lib/components/my-queue/my-queue.component.spec.ts +23 -0
  162. package/src/lib/components/my-queue/my-queue.component.ts +409 -0
  163. package/src/lib/components/my-queue/my-queue.facade.ts +670 -0
  164. package/src/lib/components/my-queue/my-queue.helper.ts +71 -0
  165. package/src/lib/components/my-queue/my-queue.module.ts +28 -0
  166. package/src/lib/components/my-queue/my-queue.service.spec.ts +16 -0
  167. package/src/lib/components/my-queue/my-queue.service.ts +262 -0
  168. package/src/lib/components/my-queue/my-queue.state.ts +133 -0
  169. package/src/lib/components/my-queue/ng-package.json +6 -0
  170. package/src/lib/components/my-queue/tasks.form.component.html +168 -0
  171. package/src/lib/components/my-queue/tasks.form.component.ts +201 -0
  172. package/src/lib/components/operation-popup/ng-package.json +6 -0
  173. package/src/lib/components/operation-popup/operation-popup.component.css +1 -0
  174. package/src/lib/components/operation-popup/operation-popup.component.html +107 -0
  175. package/src/lib/components/operation-popup/operation-popup.component.ts +476 -0
  176. package/src/lib/components/operation-popup/operation-popup.facade.ts +435 -0
  177. package/src/lib/components/operation-popup/operation-popup.service.ts +143 -0
  178. package/src/lib/components/operation-popup/operation-popup.state.ts +49 -0
  179. package/src/lib/components/stage-details/ng-package.json +6 -0
  180. package/src/lib/components/stage-details/stage-details.component.css +0 -0
  181. package/src/lib/components/stage-details/stage-details.component.html +95 -0
  182. package/src/lib/components/stage-details/stage-details.component.spec.ts +23 -0
  183. package/src/lib/components/stage-details/stage-details.component.ts +43 -0
  184. package/src/lib/components/stage-details/stage-details.module.ts +11 -0
  185. package/src/lib/components/task-form/ng-package.json +6 -0
  186. package/src/lib/components/task-form/task-form.component.css +0 -0
  187. package/src/lib/components/task-form/task-form.component.html +38 -0
  188. package/src/lib/components/task-form/task-form.component.spec.ts +23 -0
  189. package/src/lib/components/task-form/task-form.component.ts +15 -0
  190. package/src/lib/components/task-form/task-form.module.ts +31 -0
  191. package/src/lib/components/task-history/ng-package.json +6 -0
  192. package/src/lib/components/task-history/task-history.component.css +334 -0
  193. package/src/lib/components/task-history/task-history.component.html +292 -0
  194. package/src/lib/components/task-history/task-history.component.spec.ts +23 -0
  195. package/src/lib/components/task-history/task-history.component.ts +284 -0
  196. package/src/lib/components/task-history/task-history.module.ts +12 -0
  197. package/src/lib/components/task-history/task-history.service.ts +32 -0
  198. package/src/lib/components/task-notification/base-table-style.ts +52 -0
  199. package/src/lib/components/task-notification/ng-package.json +6 -0
  200. package/src/lib/components/task-notification/task-notification.component.css +94 -0
  201. package/src/lib/components/task-notification/task-notification.component.html +585 -0
  202. package/src/lib/components/task-notification/task-notification.component.spec.ts +23 -0
  203. package/src/lib/components/task-notification/task-notification.component.ts +793 -0
  204. package/src/lib/components/task-notification/task-notification.module.ts +10 -0
  205. package/src/lib/components/task-notification/task-notification.service.spec.ts +16 -0
  206. package/src/lib/components/task-notification/task-notification.service.ts +397 -0
  207. package/src/lib/components/tasks/ng-package.json +6 -0
  208. package/src/lib/components/tasks/tasks.columns.ts +50 -0
  209. package/src/lib/components/tasks/tasks.component.css +4 -0
  210. package/src/lib/components/tasks/tasks.component.html +385 -0
  211. package/src/lib/components/tasks/tasks.component.spec.ts +23 -0
  212. package/src/lib/components/tasks/tasks.component.ts +212 -0
  213. package/src/lib/components/tasks/tasks.facade.ts +482 -0
  214. package/src/lib/components/tasks/tasks.form.component.html +181 -0
  215. package/src/lib/components/tasks/tasks.form.component.ts +174 -0
  216. package/src/lib/components/tasks/tasks.helper.ts +71 -0
  217. package/src/lib/components/tasks/tasks.models.ts +4 -0
  218. package/src/lib/components/tasks/tasks.module.ts +29 -0
  219. package/src/lib/components/tasks/tasks.service.spec.ts +16 -0
  220. package/src/lib/components/tasks/tasks.service.ts +215 -0
  221. package/src/lib/components/tasks/tasks.state.ts +144 -0
  222. package/src/lib/components/wf/ng-package.json +6 -0
  223. package/src/lib/components/wf/wf.columns.ts +36 -0
  224. package/src/lib/components/wf/wf.component.css +0 -0
  225. package/src/lib/components/wf/wf.component.html +35 -0
  226. package/src/lib/components/wf/wf.component.spec.ts +23 -0
  227. package/src/lib/components/wf/wf.component.ts +71 -0
  228. package/src/lib/components/wf/wf.facade.ts +266 -0
  229. package/src/lib/components/wf/wf.helper.ts +25 -0
  230. package/src/lib/components/wf/wf.module.ts +14 -0
  231. package/src/lib/components/wf/wf.service.spec.ts +16 -0
  232. package/src/lib/components/wf/wf.service.ts +98 -0
  233. package/src/lib/components/wf/wf.state.ts +99 -0
  234. package/src/lib/components/workflow/column.ts +40 -0
  235. package/src/lib/components/workflow/helper.ts +53 -0
  236. package/src/lib/components/workflow/ng-package.json +6 -0
  237. package/src/lib/components/workflow/table-style.ts +53 -0
  238. package/src/lib/components/workflow/workflow.component.css +0 -0
  239. package/src/lib/components/workflow/workflow.component.html +226 -0
  240. package/src/lib/components/workflow/workflow.component.spec.ts +23 -0
  241. package/src/lib/components/workflow/workflow.component.ts +224 -0
  242. package/src/lib/components/workflow/workflow.module.ts +11 -0
  243. package/src/lib/components/workflow-designer/action-dialog/action-dialog.component.css +9 -0
  244. package/src/lib/components/workflow-designer/action-dialog/action-dialog.component.html +134 -0
  245. package/src/lib/components/workflow-designer/action-dialog/action-dialog.component.spec.ts +23 -0
  246. package/src/lib/components/workflow-designer/action-dialog/action-dialog.component.ts +147 -0
  247. package/src/lib/components/workflow-designer/actor-tags-dialog/actor-tags-dialog.component.css +0 -0
  248. package/src/lib/components/workflow-designer/actor-tags-dialog/actor-tags-dialog.component.html +45 -0
  249. package/src/lib/components/workflow-designer/actor-tags-dialog/actor-tags-dialog.component.ts +83 -0
  250. package/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.css +7 -0
  251. package/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.html +89 -0
  252. package/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.spec.ts +23 -0
  253. package/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.ts +87 -0
  254. package/src/lib/components/workflow-designer/decision-popup/decision-popup.component.css +11 -0
  255. package/src/lib/components/workflow-designer/decision-popup/decision-popup.component.html +74 -0
  256. package/src/lib/components/workflow-designer/decision-popup/decision-popup.component.spec.ts +23 -0
  257. package/src/lib/components/workflow-designer/decision-popup/decision-popup.component.ts +80 -0
  258. package/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.css +70 -0
  259. package/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.html +454 -0
  260. package/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.spec.ts +23 -0
  261. package/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.ts +1654 -0
  262. package/src/lib/components/workflow-designer/designer-canvas/designer-canvas.connection-drop.spec.ts +100 -0
  263. package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.css +63 -0
  264. package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.html +49 -0
  265. package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.spec.ts +23 -0
  266. package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.ts +86 -0
  267. package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.types.ts +7 -0
  268. package/src/lib/components/workflow-designer/docs/01-architecture.md +145 -0
  269. package/src/lib/components/workflow-designer/docs/02-coordinate-system.md +171 -0
  270. package/src/lib/components/workflow-designer/docs/03-data-model.md +163 -0
  271. package/src/lib/components/workflow-designer/docs/04-interactions.md +156 -0
  272. package/src/lib/components/workflow-designer/docs/05-persistence.md +117 -0
  273. package/src/lib/components/workflow-designer/docs/06-known-issues.md +181 -0
  274. package/src/lib/components/workflow-designer/docs/07-integration.md +178 -0
  275. package/src/lib/components/workflow-designer/docs/08-api-reference.md +187 -0
  276. package/src/lib/components/workflow-designer/docs/09-development.md +141 -0
  277. package/src/lib/components/workflow-designer/docs/README.md +81 -0
  278. package/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.css +13 -0
  279. package/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.html +204 -0
  280. package/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.spec.ts +23 -0
  281. package/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.ts +308 -0
  282. package/src/lib/components/workflow-designer/ng-package.json +6 -0
  283. package/src/lib/components/workflow-designer/services/connection.service.ts +325 -0
  284. package/src/lib/components/workflow-designer/services/node-management.service.ts +372 -0
  285. package/src/lib/components/workflow-designer/services/popup.service.ts +276 -0
  286. package/src/lib/components/workflow-designer/services/swimlane.service.ts +176 -0
  287. package/src/lib/components/workflow-designer/services/transformer.service.ts +318 -0
  288. package/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.css +0 -0
  289. package/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.html +208 -0
  290. package/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.spec.ts +23 -0
  291. package/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.ts +194 -0
  292. package/src/lib/components/workflow-designer/stage-node/stage-node.component.css +15 -0
  293. package/src/lib/components/workflow-designer/stage-node/stage-node.component.html +93 -0
  294. package/src/lib/components/workflow-designer/stage-node/stage-node.component.spec.ts +23 -0
  295. package/src/lib/components/workflow-designer/stage-node/stage-node.component.ts +258 -0
  296. package/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.css +0 -0
  297. package/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.html +150 -0
  298. package/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.spec.ts +23 -0
  299. package/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.ts +153 -0
  300. package/src/lib/components/workflow-designer/workflow-data.service.spec.ts +16 -0
  301. package/src/lib/components/workflow-designer/workflow-data.service.ts +290 -0
  302. package/src/lib/components/workflow-designer/workflow-designer.component.css +59 -0
  303. package/src/lib/components/workflow-designer/workflow-designer.component.html +29 -0
  304. package/src/lib/components/workflow-designer/workflow-designer.component.spec.ts +23 -0
  305. package/src/lib/components/workflow-designer/workflow-designer.component.ts +548 -0
  306. package/src/lib/components/workflow-designer/workflow-designer.models.ts +114 -0
  307. package/src/lib/components/workflow-designer/workflow-designer.module.ts +90 -0
  308. package/src/lib/components/workflow-designer/workflow-designer.state.ts +1123 -0
  309. package/src/lib/components/workflow-designer/workflow-designer.types.ts +141 -0
  310. package/src/lib/components/workflow-stage/ng-package.json +6 -0
  311. package/src/lib/components/workflow-stage/workflow-stage.component.css +24 -0
  312. package/src/lib/components/workflow-stage/workflow-stage.component.html +339 -0
  313. package/src/lib/components/workflow-stage/workflow-stage.component.spec.ts +23 -0
  314. package/src/lib/components/workflow-stage/workflow-stage.component.ts +355 -0
  315. package/src/lib/components/workflow-stage/workflow-stage.module.ts +53 -0
  316. package/src/lib/components/workflows/ng-package.json +6 -0
  317. package/src/lib/components/workflows/public-api.ts +6 -0
  318. package/src/lib/components/workflows/workflow-form/workflow-form.component.css +0 -0
  319. package/src/lib/components/workflows/workflow-form/workflow-form.component.html +138 -0
  320. package/src/lib/components/workflows/workflow-form/workflow-form.component.spec.ts +23 -0
  321. package/src/lib/components/workflows/workflow-form/workflow-form.component.ts +85 -0
  322. package/src/lib/components/workflows/workflows.api.ts +117 -0
  323. package/src/lib/components/workflows/workflows.columns.ts +41 -0
  324. package/src/lib/components/workflows/workflows.component.css +4 -0
  325. package/src/lib/components/workflows/workflows.component.html +309 -0
  326. package/src/lib/components/workflows/workflows.component.spec.ts +23 -0
  327. package/src/lib/components/workflows/workflows.component.ts +303 -0
  328. package/src/lib/components/workflows/workflows.config.ts +58 -0
  329. package/src/lib/components/workflows/workflows.facade.ts +147 -0
  330. package/src/lib/components/workflows/workflows.module.ts +14 -0
  331. package/src/lib/components/workflows/workflows.service.spec.ts +16 -0
  332. package/src/lib/components/workflows/workflows.service.ts +88 -0
  333. package/src/lib/components/workflows/workflows.state.ts +21 -0
  334. package/src/lib/models/ActionHistory.ts +19 -0
  335. package/src/lib/models/ActionType.ts +9 -0
  336. package/src/lib/models/Actor.ts +12 -0
  337. package/src/lib/models/ActorTag.ts +8 -0
  338. package/src/lib/models/Coord.ts +4 -0
  339. package/src/lib/models/DataExtensionValue.ts +5 -0
  340. package/src/lib/models/DataType.ts +25 -0
  341. package/src/lib/models/EAVDataType.ts +18 -0
  342. package/src/lib/models/EAVEntity.ts +5 -0
  343. package/src/lib/models/EntityDataValue.ts +7 -0
  344. package/src/lib/models/EntityProperty.ts +8 -0
  345. package/src/lib/models/ErrorResponse.ts +7 -0
  346. package/src/lib/models/Escalation.ts +15 -0
  347. package/src/lib/models/EscalationCycle.ts +13 -0
  348. package/src/lib/models/EscalationStage.ts +11 -0
  349. package/src/lib/models/EscalationType.ts +5 -0
  350. package/src/lib/models/File.ts +8 -0
  351. package/src/lib/models/FilterTypes.ts +8 -0
  352. package/src/lib/models/FlowableStatus.ts +6 -0
  353. package/src/lib/models/Form.ts +14 -0
  354. package/src/lib/models/FormEntity.ts +14 -0
  355. package/src/lib/models/FormFill.ts +16 -0
  356. package/src/lib/models/FormProperty.ts +16 -0
  357. package/src/lib/models/FormValue.ts +19 -0
  358. package/src/lib/models/MailConfig.ts +13 -0
  359. package/src/lib/models/MessageConfig.ts +5 -0
  360. package/src/lib/models/MessageMedium.ts +4 -0
  361. package/src/lib/models/OperationAction.ts +15 -0
  362. package/src/lib/models/PagedResult.ts +5 -0
  363. package/src/lib/models/PeriodMode.ts +10 -0
  364. package/src/lib/models/PermissionConfig.ts +8 -0
  365. package/src/lib/models/Property.ts +6 -0
  366. package/src/lib/models/ReportSchedule.ts +23 -0
  367. package/src/lib/models/ReportType.ts +5 -0
  368. package/src/lib/models/Resource.ts +57 -0
  369. package/src/lib/models/ResponseKeyValue.ts +5 -0
  370. package/src/lib/models/SMSConfig.ts +11 -0
  371. package/src/lib/models/SearchDynamicWrapper.ts +6 -0
  372. package/src/lib/models/SearchOperator.ts +4 -0
  373. package/src/lib/models/SearchPropertySign.ts +9 -0
  374. package/src/lib/models/SearchPropertyValue.ts +13 -0
  375. package/src/lib/models/SearchPropertyValueType.ts +9 -0
  376. package/src/lib/models/Size.ts +4 -0
  377. package/src/lib/models/SortDirection.ts +5 -0
  378. package/src/lib/models/StageActorRule.ts +6 -0
  379. package/src/lib/models/SwimLane.ts +14 -0
  380. package/src/lib/models/Tag.ts +7 -0
  381. package/src/lib/models/Task.ts +33 -0
  382. package/src/lib/models/TaskAssignmentType.ts +4 -0
  383. package/src/lib/models/TaskNotification.ts +16 -0
  384. package/src/lib/models/TaskNotificationMessageType.ts +4 -0
  385. package/src/lib/models/TaskNotificationType.ts +7 -0
  386. package/src/lib/models/TaskStatus.ts +7 -0
  387. package/src/lib/models/Workflow.ts +22 -0
  388. package/src/lib/models/WorkflowAction.ts +15 -0
  389. package/src/lib/models/WorkflowOperation.ts +7 -0
  390. package/src/lib/models/WorkflowStage.ts +27 -0
  391. package/src/lib/models/actors.ts +10 -0
  392. package/src/lib/models/auth-mechanism.ts +14 -0
  393. package/src/lib/models/base.ts +14 -0
  394. package/src/lib/models/ng-package.json +6 -0
  395. package/src/lib/models/object-state.ts +6 -0
  396. package/src/lib/models/operation-type.ts +6 -0
  397. package/src/lib/models/paged.ts +9 -0
  398. package/src/lib/models/public-api.ts +65 -0
  399. package/src/lib/models/query-params.ts +9 -0
  400. package/src/lib/models/status.ts +5 -0
  401. package/src/lib/models/task-history.ts +14 -0
  402. package/src/lib/models/user-access-request-status.ts +5 -0
  403. package/src/lib/models/user.ts +25 -0
  404. package/src/lib/pipes/async-label.pipe.spec.ts +12 -0
  405. package/src/lib/pipes/async-label.pipe.ts +30 -0
  406. package/src/lib/pipes/ng-package.json +6 -0
  407. package/src/lib/services/environment.service.spec.ts +16 -0
  408. package/src/lib/services/environment.service.ts +31 -0
  409. package/src/lib/services/http-web-request.service.spec.ts +16 -0
  410. package/src/lib/services/http-web-request.service.ts +154 -0
  411. package/src/lib/services/index.ts +1 -0
  412. package/src/lib/services/label.service.spec.ts +16 -0
  413. package/src/lib/services/label.service.ts +182 -0
  414. package/src/lib/services/ng-package.json +6 -0
  415. package/src/lib/services/public-api.ts +5 -0
  416. package/src/lib/services/util.service.spec.ts +16 -0
  417. package/src/lib/services/util.service.ts +72 -0
  418. package/src/lib/shared/base-table-style.ts +56 -0
  419. package/src/lib/shared/components/base-data-view.component.ts +187 -0
  420. package/src/lib/shared/components/base-model-field.ts +31 -0
  421. package/src/lib/shared/models/DataViewConfig.ts +19 -0
  422. package/src/lib/shared/ng-package.json +6 -0
  423. package/src/lib/shared/public-api.ts +14 -0
  424. package/src/lib/shared/shared.module.ts +67 -0
  425. package/src/lib/utils/index.ts +1 -0
  426. package/src/lib/utils/public-api.ts +2 -0
  427. package/src/lib/utils/store.ts +50 -0
  428. package/src/public-api.ts +58 -0
  429. package/src/styles.css +96 -0
  430. package/tailwind.config copy.js +33 -0
  431. package/tailwind.config.js +20 -0
  432. package/tsconfig.lib.json +15 -0
  433. package/tsconfig.lib.prod.json +11 -0
  434. package/tsconfig.spec.json +15 -0
  435. package/esm2022/public-api.mjs +0 -41
  436. package/esm2022/src/lib/base/core/base-data-page.facade.mjs +0 -412
  437. package/esm2022/src/lib/base/core/base-data-page.service.mjs +0 -140
  438. package/esm2022/src/lib/base/core/base-data-page.state.mjs +0 -216
  439. package/esm2022/src/lib/base/handlers/filter-handler.service.mjs +0 -138
  440. package/esm2022/src/lib/base/handlers/search-handler.service.mjs +0 -31
  441. package/esm2022/src/lib/base/handlers/sort-handler.service.mjs +0 -73
  442. package/esm2022/src/lib/base/index.mjs +0 -2
  443. package/esm2022/src/lib/base/models/api-payload.mjs +0 -7
  444. package/esm2022/src/lib/base/models/page-config.interface.mjs +0 -2
  445. package/esm2022/src/lib/base/models/page-filter-tab-option.interface.mjs +0 -2
  446. package/esm2022/src/lib/base/public-api.mjs +0 -14
  447. package/esm2022/src/lib/base/utils/column-helpers.mjs +0 -55
  448. package/esm2022/src/lib/base/verben-workflow-ui-src-lib-base.mjs +0 -5
  449. package/esm2022/src/lib/components/actors/actors.columns.mjs +0 -39
  450. package/esm2022/src/lib/components/actors/actors.component.mjs +0 -175
  451. package/esm2022/src/lib/components/actors/actors.config.mjs +0 -49
  452. package/esm2022/src/lib/components/actors/actors.facade.mjs +0 -57
  453. package/esm2022/src/lib/components/actors/actors.form.component.mjs +0 -74
  454. package/esm2022/src/lib/components/actors/actors.module.mjs +0 -21
  455. package/esm2022/src/lib/components/actors/actors.service.mjs +0 -65
  456. package/esm2022/src/lib/components/actors/actors.state.mjs +0 -31
  457. package/esm2022/src/lib/components/actors/index.mjs +0 -2
  458. package/esm2022/src/lib/components/actors/public-api.mjs +0 -3
  459. package/esm2022/src/lib/components/actors/verben-workflow-ui-src-lib-components-actors.mjs +0 -5
  460. package/esm2022/src/lib/components/designer/components/label-editor.component.mjs +0 -148
  461. package/esm2022/src/lib/components/designer/components/node-selector.component.mjs +0 -317
  462. package/esm2022/src/lib/components/designer/components/swimlane-label.component.mjs +0 -161
  463. package/esm2022/src/lib/components/designer/components/swimlane-popup.component.mjs +0 -85
  464. package/esm2022/src/lib/components/designer/components/wf-canvas.component.mjs +0 -715
  465. package/esm2022/src/lib/components/designer/components/wf-designer.component.mjs +0 -135
  466. package/esm2022/src/lib/components/designer/components/wf-toolbar.component.mjs +0 -56
  467. package/esm2022/src/lib/components/designer/index.mjs +0 -2
  468. package/esm2022/src/lib/components/designer/models/types.mjs +0 -2
  469. package/esm2022/src/lib/components/designer/public-api.mjs +0 -3
  470. package/esm2022/src/lib/components/designer/services/canvas-state.service.mjs +0 -50
  471. package/esm2022/src/lib/components/designer/services/connection-segment-interaction.service.mjs +0 -108
  472. package/esm2022/src/lib/components/designer/services/connection.service.mjs +0 -267
  473. package/esm2022/src/lib/components/designer/services/keyboard-handler.service.mjs +0 -43
  474. package/esm2022/src/lib/components/designer/services/label-management.service.mjs +0 -66
  475. package/esm2022/src/lib/components/designer/services/node-finder.service.mjs +0 -30
  476. package/esm2022/src/lib/components/designer/services/node-interaction.service.mjs +0 -108
  477. package/esm2022/src/lib/components/designer/services/node-precondition.service.mjs +0 -108
  478. package/esm2022/src/lib/components/designer/services/node-selection.service.mjs +0 -96
  479. package/esm2022/src/lib/components/designer/services/orthogonal-router.service.mjs +0 -167
  480. package/esm2022/src/lib/components/designer/services/position-update.service.mjs +0 -45
  481. package/esm2022/src/lib/components/designer/services/rendering.service.mjs +0 -236
  482. package/esm2022/src/lib/components/designer/services/swimlane-management.service.mjs +0 -145
  483. package/esm2022/src/lib/components/designer/services/swimlane-stats.service.mjs +0 -44
  484. package/esm2022/src/lib/components/designer/services/viewport.service.mjs +0 -30
  485. package/esm2022/src/lib/components/designer/services/wf-facade.service.mjs +0 -239
  486. package/esm2022/src/lib/components/designer/services/wf-mapper.service.mjs +0 -326
  487. package/esm2022/src/lib/components/designer/services/wf-persistence.service.mjs +0 -169
  488. package/esm2022/src/lib/components/designer/services/wf-state.service.mjs +0 -108
  489. package/esm2022/src/lib/components/designer/verben-workflow-ui-src-lib-components-designer.mjs +0 -5
  490. package/esm2022/src/lib/components/expiration/expiration.component.mjs +0 -49
  491. package/esm2022/src/lib/components/expiration/expiration.module.mjs +0 -19
  492. package/esm2022/src/lib/components/expiration/index.mjs +0 -2
  493. package/esm2022/src/lib/components/expiration/public-api.mjs +0 -3
  494. package/esm2022/src/lib/components/expiration/verben-workflow-ui-src-lib-components-expiration.mjs +0 -5
  495. package/esm2022/src/lib/components/file-render/file-render.component.mjs +0 -45
  496. package/esm2022/src/lib/components/file-render/file-render.module.mjs +0 -35
  497. package/esm2022/src/lib/components/file-render/index.mjs +0 -2
  498. package/esm2022/src/lib/components/file-render/public-api.mjs +0 -3
  499. package/esm2022/src/lib/components/file-render/verben-workflow-ui-src-lib-components-file-render.mjs +0 -5
  500. package/esm2022/src/lib/components/file-upload/file-upload.component.mjs +0 -93
  501. package/esm2022/src/lib/components/file-upload/file-upload.module.mjs +0 -63
  502. package/esm2022/src/lib/components/file-upload/index.mjs +0 -2
  503. package/esm2022/src/lib/components/file-upload/public-api.mjs +0 -3
  504. package/esm2022/src/lib/components/file-upload/verben-workflow-ui-src-lib-components-file-upload.mjs +0 -5
  505. package/esm2022/src/lib/components/flowable-status/flowable-status.columns.mjs +0 -21
  506. package/esm2022/src/lib/components/flowable-status/flowable-status.component.mjs +0 -203
  507. package/esm2022/src/lib/components/flowable-status/flowable-status.config.mjs +0 -47
  508. package/esm2022/src/lib/components/flowable-status/flowable-status.facade.mjs +0 -60
  509. package/esm2022/src/lib/components/flowable-status/flowable-status.form.component.mjs +0 -52
  510. package/esm2022/src/lib/components/flowable-status/flowable-status.module.mjs +0 -21
  511. package/esm2022/src/lib/components/flowable-status/flowable-status.service.mjs +0 -35
  512. package/esm2022/src/lib/components/flowable-status/flowable-status.state.mjs +0 -15
  513. package/esm2022/src/lib/components/flowable-status/index.mjs +0 -2
  514. package/esm2022/src/lib/components/flowable-status/public-api.mjs +0 -3
  515. package/esm2022/src/lib/components/flowable-status/verben-workflow-ui-src-lib-components-flowable-status.mjs +0 -5
  516. package/esm2022/src/lib/components/form-control/form-control.component.mjs +0 -180
  517. package/esm2022/src/lib/components/form-control/form-control.module.mjs +0 -75
  518. package/esm2022/src/lib/components/form-control/index.mjs +0 -2
  519. package/esm2022/src/lib/components/form-control/public-api.mjs +0 -3
  520. package/esm2022/src/lib/components/form-control/verben-workflow-ui-src-lib-components-form-control.mjs +0 -5
  521. package/esm2022/src/lib/components/form-group/base-table-style.mjs +0 -53
  522. package/esm2022/src/lib/components/form-group/form-fields/form-fields.component.mjs +0 -952
  523. package/esm2022/src/lib/components/form-group/form-fields/form-fields.module.mjs +0 -75
  524. package/esm2022/src/lib/components/form-group/form-fields/form-fields.service.mjs +0 -73
  525. package/esm2022/src/lib/components/form-group/form-group.component.mjs +0 -699
  526. package/esm2022/src/lib/components/form-group/form-group.module.mjs +0 -85
  527. package/esm2022/src/lib/components/form-group/form-group.service.mjs +0 -56
  528. package/esm2022/src/lib/components/form-group/index.mjs +0 -2
  529. package/esm2022/src/lib/components/form-group/public-api.mjs +0 -5
  530. package/esm2022/src/lib/components/form-group/verben-workflow-ui-src-lib-components-form-group.mjs +0 -5
  531. package/esm2022/src/lib/components/form-response/form-response.component.mjs +0 -641
  532. package/esm2022/src/lib/components/form-response/form-response.module.mjs +0 -76
  533. package/esm2022/src/lib/components/form-response/form-response.service.mjs +0 -54
  534. package/esm2022/src/lib/components/form-response/index.mjs +0 -2
  535. package/esm2022/src/lib/components/form-response/public-api.mjs +0 -3
  536. package/esm2022/src/lib/components/form-response/verben-workflow-ui-src-lib-components-form-response.mjs +0 -5
  537. package/esm2022/src/lib/components/form-timer/form-timer.component.mjs +0 -47
  538. package/esm2022/src/lib/components/form-timer/form-timer.module.mjs +0 -28
  539. package/esm2022/src/lib/components/form-timer/index.mjs +0 -2
  540. package/esm2022/src/lib/components/form-timer/public-api.mjs +0 -3
  541. package/esm2022/src/lib/components/form-timer/verben-workflow-ui-src-lib-components-form-timer.mjs +0 -5
  542. package/esm2022/src/lib/components/form-viewer/form-viewer.component.mjs +0 -38
  543. package/esm2022/src/lib/components/form-viewer/form-viewer.module.mjs +0 -78
  544. package/esm2022/src/lib/components/form-viewer/index.mjs +0 -2
  545. package/esm2022/src/lib/components/form-viewer/public-api.mjs +0 -3
  546. package/esm2022/src/lib/components/form-viewer/verben-workflow-ui-src-lib-components-form-viewer.mjs +0 -5
  547. package/esm2022/src/lib/components/forms/base-table-style.mjs +0 -53
  548. package/esm2022/src/lib/components/forms/forms.component.mjs +0 -673
  549. package/esm2022/src/lib/components/forms/forms.module.mjs +0 -18
  550. package/esm2022/src/lib/components/forms/forms.service.mjs +0 -68
  551. package/esm2022/src/lib/components/forms/index.mjs +0 -2
  552. package/esm2022/src/lib/components/forms/public-api.mjs +0 -3
  553. package/esm2022/src/lib/components/forms/verben-workflow-ui-src-lib-components-forms.mjs +0 -5
  554. package/esm2022/src/lib/components/journal/index.mjs +0 -2
  555. package/esm2022/src/lib/components/journal/journal.component.mjs +0 -11
  556. package/esm2022/src/lib/components/journal/journal.module.mjs +0 -18
  557. package/esm2022/src/lib/components/journal/public-api.mjs +0 -3
  558. package/esm2022/src/lib/components/journal/verben-workflow-ui-src-lib-components-journal.mjs +0 -5
  559. package/esm2022/src/lib/components/my-queue/index.mjs +0 -2
  560. package/esm2022/src/lib/components/my-queue/my-queue.columns.mjs +0 -34
  561. package/esm2022/src/lib/components/my-queue/my-queue.component.mjs +0 -342
  562. package/esm2022/src/lib/components/my-queue/my-queue.facade.mjs +0 -502
  563. package/esm2022/src/lib/components/my-queue/my-queue.module.mjs +0 -47
  564. package/esm2022/src/lib/components/my-queue/my-queue.service.mjs +0 -144
  565. package/esm2022/src/lib/components/my-queue/my-queue.state.mjs +0 -108
  566. package/esm2022/src/lib/components/my-queue/public-api.mjs +0 -4
  567. package/esm2022/src/lib/components/my-queue/tasks.form.component.mjs +0 -191
  568. package/esm2022/src/lib/components/my-queue/verben-workflow-ui-src-lib-components-my-queue.mjs +0 -5
  569. package/esm2022/src/lib/components/operation-popup/index.mjs +0 -2
  570. package/esm2022/src/lib/components/operation-popup/operation-popup.component.mjs +0 -382
  571. package/esm2022/src/lib/components/operation-popup/operation-popup.facade.mjs +0 -345
  572. package/esm2022/src/lib/components/operation-popup/operation-popup.service.mjs +0 -82
  573. package/esm2022/src/lib/components/operation-popup/operation-popup.state.mjs +0 -44
  574. package/esm2022/src/lib/components/operation-popup/public-api.mjs +0 -3
  575. package/esm2022/src/lib/components/operation-popup/verben-workflow-ui-src-lib-components-operation-popup.mjs +0 -5
  576. package/esm2022/src/lib/components/stage-details/index.mjs +0 -2
  577. package/esm2022/src/lib/components/stage-details/public-api.mjs +0 -3
  578. package/esm2022/src/lib/components/stage-details/stage-details.component.mjs +0 -49
  579. package/esm2022/src/lib/components/stage-details/stage-details.module.mjs +0 -19
  580. package/esm2022/src/lib/components/stage-details/verben-workflow-ui-src-lib-components-stage-details.mjs +0 -5
  581. package/esm2022/src/lib/components/task-form/index.mjs +0 -2
  582. package/esm2022/src/lib/components/task-form/public-api.mjs +0 -3
  583. package/esm2022/src/lib/components/task-form/task-form.component.mjs +0 -18
  584. package/esm2022/src/lib/components/task-form/task-form.module.mjs +0 -72
  585. package/esm2022/src/lib/components/task-form/verben-workflow-ui-src-lib-components-task-form.mjs +0 -5
  586. package/esm2022/src/lib/components/task-history/index.mjs +0 -2
  587. package/esm2022/src/lib/components/task-history/public-api.mjs +0 -3
  588. package/esm2022/src/lib/components/task-history/task-history.component.mjs +0 -249
  589. package/esm2022/src/lib/components/task-history/task-history.module.mjs +0 -21
  590. package/esm2022/src/lib/components/task-history/task-history.service.mjs +0 -32
  591. package/esm2022/src/lib/components/task-history/verben-workflow-ui-src-lib-components-task-history.mjs +0 -5
  592. package/esm2022/src/lib/components/task-notification/base-table-style.mjs +0 -53
  593. package/esm2022/src/lib/components/task-notification/index.mjs +0 -2
  594. package/esm2022/src/lib/components/task-notification/public-api.mjs +0 -3
  595. package/esm2022/src/lib/components/task-notification/task-notification.component.mjs +0 -670
  596. package/esm2022/src/lib/components/task-notification/task-notification.module.mjs +0 -18
  597. package/esm2022/src/lib/components/task-notification/task-notification.service.mjs +0 -256
  598. package/esm2022/src/lib/components/task-notification/verben-workflow-ui-src-lib-components-task-notification.mjs +0 -5
  599. package/esm2022/src/lib/components/tasks/index.mjs +0 -2
  600. package/esm2022/src/lib/components/tasks/public-api.mjs +0 -6
  601. package/esm2022/src/lib/components/tasks/tasks.columns.mjs +0 -48
  602. package/esm2022/src/lib/components/tasks/tasks.component.mjs +0 -194
  603. package/esm2022/src/lib/components/tasks/tasks.facade.mjs +0 -372
  604. package/esm2022/src/lib/components/tasks/tasks.form.component.mjs +0 -164
  605. package/esm2022/src/lib/components/tasks/tasks.models.mjs +0 -4
  606. package/esm2022/src/lib/components/tasks/tasks.module.mjs +0 -52
  607. package/esm2022/src/lib/components/tasks/tasks.service.mjs +0 -137
  608. package/esm2022/src/lib/components/tasks/tasks.state.mjs +0 -108
  609. package/esm2022/src/lib/components/tasks/verben-workflow-ui-src-lib-components-tasks.mjs +0 -5
  610. package/esm2022/src/lib/components/wf/index.mjs +0 -2
  611. package/esm2022/src/lib/components/wf/public-api.mjs +0 -4
  612. package/esm2022/src/lib/components/wf/verben-workflow-ui-src-lib-components-wf.mjs +0 -5
  613. package/esm2022/src/lib/components/wf/wf.columns.mjs +0 -34
  614. package/esm2022/src/lib/components/wf/wf.component.mjs +0 -68
  615. package/esm2022/src/lib/components/wf/wf.module.mjs +0 -22
  616. package/esm2022/src/lib/components/wf/wf.service.mjs +0 -82
  617. package/esm2022/src/lib/components/workflow/column.mjs +0 -38
  618. package/esm2022/src/lib/components/workflow/helper.mjs +0 -47
  619. package/esm2022/src/lib/components/workflow/index.mjs +0 -2
  620. package/esm2022/src/lib/components/workflow/public-api.mjs +0 -4
  621. package/esm2022/src/lib/components/workflow/table-style.mjs +0 -53
  622. package/esm2022/src/lib/components/workflow/verben-workflow-ui-src-lib-components-workflow.mjs +0 -5
  623. package/esm2022/src/lib/components/workflow/workflow.component.mjs +0 -210
  624. package/esm2022/src/lib/components/workflow/workflow.module.mjs +0 -19
  625. package/esm2022/src/lib/components/workflow-designer/action-dialog/action-dialog.component.mjs +0 -127
  626. package/esm2022/src/lib/components/workflow-designer/actor-tags-dialog/actor-tags-dialog.component.mjs +0 -78
  627. package/esm2022/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.mjs +0 -87
  628. package/esm2022/src/lib/components/workflow-designer/decision-popup/decision-popup.component.mjs +0 -84
  629. package/esm2022/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.mjs +0 -1270
  630. package/esm2022/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.mjs +0 -96
  631. package/esm2022/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.types.mjs +0 -2
  632. package/esm2022/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.mjs +0 -260
  633. package/esm2022/src/lib/components/workflow-designer/index.mjs +0 -2
  634. package/esm2022/src/lib/components/workflow-designer/public-api.mjs +0 -5
  635. package/esm2022/src/lib/components/workflow-designer/services/connection.service.mjs +0 -238
  636. package/esm2022/src/lib/components/workflow-designer/services/node-management.service.mjs +0 -321
  637. package/esm2022/src/lib/components/workflow-designer/services/popup.service.mjs +0 -240
  638. package/esm2022/src/lib/components/workflow-designer/services/swimlane.service.mjs +0 -158
  639. package/esm2022/src/lib/components/workflow-designer/services/transformer.service.mjs +0 -280
  640. package/esm2022/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.mjs +0 -177
  641. package/esm2022/src/lib/components/workflow-designer/stage-node/stage-node.component.mjs +0 -226
  642. package/esm2022/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.mjs +0 -137
  643. package/esm2022/src/lib/components/workflow-designer/verben-workflow-ui-src-lib-components-workflow-designer.mjs +0 -5
  644. package/esm2022/src/lib/components/workflow-designer/workflow-data.service.mjs +0 -210
  645. package/esm2022/src/lib/components/workflow-designer/workflow-designer.component.mjs +0 -460
  646. package/esm2022/src/lib/components/workflow-designer/workflow-designer.module.mjs +0 -129
  647. package/esm2022/src/lib/components/workflow-designer/workflow-designer.state.mjs +0 -928
  648. package/esm2022/src/lib/components/workflow-designer/workflow-designer.types.mjs +0 -2
  649. package/esm2022/src/lib/components/workflow-stage/index.mjs +0 -2
  650. package/esm2022/src/lib/components/workflow-stage/public-api.mjs +0 -3
  651. package/esm2022/src/lib/components/workflow-stage/verben-workflow-ui-src-lib-components-workflow-stage.mjs +0 -5
  652. package/esm2022/src/lib/components/workflow-stage/workflow-stage.component.mjs +0 -331
  653. package/esm2022/src/lib/components/workflow-stage/workflow-stage.module.mjs +0 -82
  654. package/esm2022/src/lib/components/workflows/index.mjs +0 -2
  655. package/esm2022/src/lib/components/workflows/public-api.mjs +0 -7
  656. package/esm2022/src/lib/components/workflows/verben-workflow-ui-src-lib-components-workflows.mjs +0 -5
  657. package/esm2022/src/lib/components/workflows/workflow-form/workflow-form.component.mjs +0 -89
  658. package/esm2022/src/lib/components/workflows/workflows.api.mjs +0 -63
  659. package/esm2022/src/lib/components/workflows/workflows.columns.mjs +0 -39
  660. package/esm2022/src/lib/components/workflows/workflows.component.mjs +0 -236
  661. package/esm2022/src/lib/components/workflows/workflows.config.mjs +0 -51
  662. package/esm2022/src/lib/components/workflows/workflows.facade.mjs +0 -114
  663. package/esm2022/src/lib/components/workflows/workflows.module.mjs +0 -21
  664. package/esm2022/src/lib/components/workflows/workflows.service.mjs +0 -63
  665. package/esm2022/src/lib/components/workflows/workflows.state.mjs +0 -23
  666. package/esm2022/src/lib/models/ActionHistory.mjs +0 -2
  667. package/esm2022/src/lib/models/ActionType.mjs +0 -11
  668. package/esm2022/src/lib/models/Actor.mjs +0 -2
  669. package/esm2022/src/lib/models/ActorTag.mjs +0 -2
  670. package/esm2022/src/lib/models/Coord.mjs +0 -2
  671. package/esm2022/src/lib/models/DataType.mjs +0 -27
  672. package/esm2022/src/lib/models/EAVEntity.mjs +0 -2
  673. package/esm2022/src/lib/models/ErrorResponse.mjs +0 -11
  674. package/esm2022/src/lib/models/Escalation.mjs +0 -2
  675. package/esm2022/src/lib/models/EscalationCycle.mjs +0 -2
  676. package/esm2022/src/lib/models/EscalationStage.mjs +0 -2
  677. package/esm2022/src/lib/models/EscalationType.mjs +0 -7
  678. package/esm2022/src/lib/models/File.mjs +0 -2
  679. package/esm2022/src/lib/models/FilterTypes.mjs +0 -9
  680. package/esm2022/src/lib/models/FlowableStatus.mjs +0 -2
  681. package/esm2022/src/lib/models/Form.mjs +0 -2
  682. package/esm2022/src/lib/models/FormEntity.mjs +0 -2
  683. package/esm2022/src/lib/models/FormFill.mjs +0 -6
  684. package/esm2022/src/lib/models/FormProperty.mjs +0 -2
  685. package/esm2022/src/lib/models/FormValues.mjs +0 -2
  686. package/esm2022/src/lib/models/MailConfig.mjs +0 -2
  687. package/esm2022/src/lib/models/MessageConfig.mjs +0 -2
  688. package/esm2022/src/lib/models/MessageMedium.mjs +0 -6
  689. package/esm2022/src/lib/models/OperationAction.mjs +0 -2
  690. package/esm2022/src/lib/models/PagedResult.mjs +0 -2
  691. package/esm2022/src/lib/models/PeriodMode.mjs +0 -12
  692. package/esm2022/src/lib/models/PermissionConfig.mjs +0 -2
  693. package/esm2022/src/lib/models/ReportSchedule.mjs +0 -2
  694. package/esm2022/src/lib/models/ReportType.mjs +0 -7
  695. package/esm2022/src/lib/models/Resource.mjs +0 -47
  696. package/esm2022/src/lib/models/ResponseKeyValue.mjs +0 -2
  697. package/esm2022/src/lib/models/SMSConfig.mjs +0 -2
  698. package/esm2022/src/lib/models/SearchDynamicWrapper.mjs +0 -2
  699. package/esm2022/src/lib/models/SearchOperator.mjs +0 -6
  700. package/esm2022/src/lib/models/SearchPropertySign.mjs +0 -11
  701. package/esm2022/src/lib/models/SearchPropertyValue.mjs +0 -2
  702. package/esm2022/src/lib/models/SearchPropertyValueType.mjs +0 -11
  703. package/esm2022/src/lib/models/Size.mjs +0 -2
  704. package/esm2022/src/lib/models/SortDirection.mjs +0 -7
  705. package/esm2022/src/lib/models/StageActorRule.mjs +0 -8
  706. package/esm2022/src/lib/models/SwimLane.mjs +0 -2
  707. package/esm2022/src/lib/models/Tag.mjs +0 -2
  708. package/esm2022/src/lib/models/Task.mjs +0 -2
  709. package/esm2022/src/lib/models/TaskAssignmentType.mjs +0 -6
  710. package/esm2022/src/lib/models/TaskNotification.mjs +0 -2
  711. package/esm2022/src/lib/models/TaskNotificationMessageType.mjs +0 -6
  712. package/esm2022/src/lib/models/TaskNotificationType.mjs +0 -9
  713. package/esm2022/src/lib/models/TaskStatus.mjs +0 -9
  714. package/esm2022/src/lib/models/Workflow.mjs +0 -2
  715. package/esm2022/src/lib/models/WorkflowAction.mjs +0 -2
  716. package/esm2022/src/lib/models/WorkflowOperation.mjs +0 -2
  717. package/esm2022/src/lib/models/WorkflowStage.mjs +0 -2
  718. package/esm2022/src/lib/models/actors.mjs +0 -2
  719. package/esm2022/src/lib/models/auth-mechanism.mjs +0 -8
  720. package/esm2022/src/lib/models/base.mjs +0 -2
  721. package/esm2022/src/lib/models/index.mjs +0 -2
  722. package/esm2022/src/lib/models/object-state.mjs +0 -8
  723. package/esm2022/src/lib/models/operation-type.mjs +0 -7
  724. package/esm2022/src/lib/models/paged.mjs +0 -2
  725. package/esm2022/src/lib/models/public-api.mjs +0 -64
  726. package/esm2022/src/lib/models/query-params.mjs +0 -2
  727. package/esm2022/src/lib/models/status.mjs +0 -6
  728. package/esm2022/src/lib/models/task-history.mjs +0 -2
  729. package/esm2022/src/lib/models/user-access-request-status.mjs +0 -7
  730. package/esm2022/src/lib/models/user.mjs +0 -2
  731. package/esm2022/src/lib/models/verben-workflow-ui-src-lib-models.mjs +0 -5
  732. package/esm2022/src/lib/pipes/async-label.pipe.mjs +0 -25
  733. package/esm2022/src/lib/pipes/index.mjs +0 -2
  734. package/esm2022/src/lib/pipes/public-api.mjs +0 -2
  735. package/esm2022/src/lib/pipes/verben-workflow-ui-src-lib-pipes.mjs +0 -5
  736. package/esm2022/src/lib/services/environment.service.mjs +0 -26
  737. package/esm2022/src/lib/services/http-web-request.service.mjs +0 -92
  738. package/esm2022/src/lib/services/index.mjs +0 -2
  739. package/esm2022/src/lib/services/label.service.mjs +0 -134
  740. package/esm2022/src/lib/services/public-api.mjs +0 -5
  741. package/esm2022/src/lib/services/util.service.mjs +0 -75
  742. package/esm2022/src/lib/services/verben-workflow-ui-src-lib-services.mjs +0 -5
  743. package/esm2022/src/lib/shared/base-table-style.mjs +0 -55
  744. package/esm2022/src/lib/shared/components/base-data-view.component.mjs +0 -154
  745. package/esm2022/src/lib/shared/components/base-model-field.mjs +0 -21
  746. package/esm2022/src/lib/shared/index.mjs +0 -7
  747. package/esm2022/src/lib/shared/models/DataViewConfig.mjs +0 -2
  748. package/esm2022/src/lib/shared/public-api.mjs +0 -13
  749. package/esm2022/src/lib/shared/shared.module.mjs +0 -103
  750. package/esm2022/src/lib/shared/verben-workflow-ui-src-lib-shared.mjs +0 -5
  751. package/esm2022/verben-workflow-ui.mjs +0 -5
  752. package/fesm2022/verben-workflow-ui-src-lib-base.mjs +0 -1055
  753. package/fesm2022/verben-workflow-ui-src-lib-base.mjs.map +0 -1
  754. package/fesm2022/verben-workflow-ui-src-lib-components-actors.mjs +0 -484
  755. package/fesm2022/verben-workflow-ui-src-lib-components-actors.mjs.map +0 -1
  756. package/fesm2022/verben-workflow-ui-src-lib-components-designer.mjs +0 -3891
  757. package/fesm2022/verben-workflow-ui-src-lib-components-designer.mjs.map +0 -1
  758. package/fesm2022/verben-workflow-ui-src-lib-components-expiration.mjs +0 -72
  759. package/fesm2022/verben-workflow-ui-src-lib-components-expiration.mjs.map +0 -1
  760. package/fesm2022/verben-workflow-ui-src-lib-components-file-render.mjs +0 -83
  761. package/fesm2022/verben-workflow-ui-src-lib-components-file-render.mjs.map +0 -1
  762. package/fesm2022/verben-workflow-ui-src-lib-components-file-upload.mjs +0 -159
  763. package/fesm2022/verben-workflow-ui-src-lib-components-file-upload.mjs.map +0 -1
  764. package/fesm2022/verben-workflow-ui-src-lib-components-flowable-status.mjs +0 -430
  765. package/fesm2022/verben-workflow-ui-src-lib-components-flowable-status.mjs.map +0 -1
  766. package/fesm2022/verben-workflow-ui-src-lib-components-form-control.mjs +0 -257
  767. package/fesm2022/verben-workflow-ui-src-lib-components-form-control.mjs.map +0 -1
  768. package/fesm2022/verben-workflow-ui-src-lib-components-form-group.mjs +0 -1967
  769. package/fesm2022/verben-workflow-ui-src-lib-components-form-group.mjs.map +0 -1
  770. package/fesm2022/verben-workflow-ui-src-lib-components-form-response.mjs +0 -769
  771. package/fesm2022/verben-workflow-ui-src-lib-components-form-response.mjs.map +0 -1
  772. package/fesm2022/verben-workflow-ui-src-lib-components-form-timer.mjs +0 -78
  773. package/fesm2022/verben-workflow-ui-src-lib-components-form-timer.mjs.map +0 -1
  774. package/fesm2022/verben-workflow-ui-src-lib-components-form-viewer.mjs +0 -118
  775. package/fesm2022/verben-workflow-ui-src-lib-components-form-viewer.mjs.map +0 -1
  776. package/fesm2022/verben-workflow-ui-src-lib-components-forms.mjs +0 -812
  777. package/fesm2022/verben-workflow-ui-src-lib-components-forms.mjs.map +0 -1
  778. package/fesm2022/verben-workflow-ui-src-lib-components-journal.mjs +0 -33
  779. package/fesm2022/verben-workflow-ui-src-lib-components-journal.mjs.map +0 -1
  780. package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs +0 -1338
  781. package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs.map +0 -1
  782. package/fesm2022/verben-workflow-ui-src-lib-components-operation-popup.mjs +0 -845
  783. package/fesm2022/verben-workflow-ui-src-lib-components-operation-popup.mjs.map +0 -1
  784. package/fesm2022/verben-workflow-ui-src-lib-components-stage-details.mjs +0 -72
  785. package/fesm2022/verben-workflow-ui-src-lib-components-stage-details.mjs.map +0 -1
  786. package/fesm2022/verben-workflow-ui-src-lib-components-task-form.mjs +0 -94
  787. package/fesm2022/verben-workflow-ui-src-lib-components-task-form.mjs.map +0 -1
  788. package/fesm2022/verben-workflow-ui-src-lib-components-task-history.mjs +0 -302
  789. package/fesm2022/verben-workflow-ui-src-lib-components-task-history.mjs.map +0 -1
  790. package/fesm2022/verben-workflow-ui-src-lib-components-task-notification.mjs +0 -995
  791. package/fesm2022/verben-workflow-ui-src-lib-components-task-notification.mjs.map +0 -1
  792. package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs +0 -1049
  793. package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs.map +0 -1
  794. package/fesm2022/verben-workflow-ui-src-lib-components-wf.mjs +0 -203
  795. package/fesm2022/verben-workflow-ui-src-lib-components-wf.mjs.map +0 -1
  796. package/fesm2022/verben-workflow-ui-src-lib-components-workflow-designer.mjs +0 -5389
  797. package/fesm2022/verben-workflow-ui-src-lib-components-workflow-designer.mjs.map +0 -1
  798. package/fesm2022/verben-workflow-ui-src-lib-components-workflow-stage.mjs +0 -415
  799. package/fesm2022/verben-workflow-ui-src-lib-components-workflow-stage.mjs.map +0 -1
  800. package/fesm2022/verben-workflow-ui-src-lib-components-workflow.mjs +0 -365
  801. package/fesm2022/verben-workflow-ui-src-lib-components-workflow.mjs.map +0 -1
  802. package/fesm2022/verben-workflow-ui-src-lib-components-workflows.mjs +0 -666
  803. package/fesm2022/verben-workflow-ui-src-lib-components-workflows.mjs.map +0 -1
  804. package/fesm2022/verben-workflow-ui-src-lib-models.mjs +0 -256
  805. package/fesm2022/verben-workflow-ui-src-lib-models.mjs.map +0 -1
  806. package/fesm2022/verben-workflow-ui-src-lib-pipes.mjs +0 -32
  807. package/fesm2022/verben-workflow-ui-src-lib-pipes.mjs.map +0 -1
  808. package/fesm2022/verben-workflow-ui-src-lib-services.mjs +0 -322
  809. package/fesm2022/verben-workflow-ui-src-lib-services.mjs.map +0 -1
  810. package/fesm2022/verben-workflow-ui-src-lib-shared.mjs +0 -336
  811. package/fesm2022/verben-workflow-ui-src-lib-shared.mjs.map +0 -1
  812. package/fesm2022/verben-workflow-ui.mjs +0 -34
  813. package/fesm2022/verben-workflow-ui.mjs.map +0 -1
  814. package/index.d.ts +0 -5
  815. package/public-api.d.ts +0 -22
  816. package/src/lib/base/core/base-data-page.facade.d.ts +0 -138
  817. package/src/lib/base/core/base-data-page.service.d.ts +0 -61
  818. package/src/lib/base/core/base-data-page.state.d.ts +0 -73
  819. package/src/lib/base/handlers/filter-handler.service.d.ts +0 -34
  820. package/src/lib/base/handlers/search-handler.service.d.ts +0 -20
  821. package/src/lib/base/handlers/sort-handler.service.d.ts +0 -30
  822. package/src/lib/base/models/api-payload.d.ts +0 -2
  823. package/src/lib/base/models/page-config.interface.d.ts +0 -24
  824. package/src/lib/base/models/page-filter-tab-option.interface.d.ts +0 -19
  825. package/src/lib/base/public-api.d.ts +0 -9
  826. package/src/lib/base/utils/column-helpers.d.ts +0 -24
  827. package/src/lib/components/actors/actors.columns.d.ts +0 -3
  828. package/src/lib/components/actors/actors.component.d.ts +0 -79
  829. package/src/lib/components/actors/actors.config.d.ts +0 -10
  830. package/src/lib/components/actors/actors.facade.d.ts +0 -29
  831. package/src/lib/components/actors/actors.form.component.d.ts +0 -23
  832. package/src/lib/components/actors/actors.module.d.ts +0 -11
  833. package/src/lib/components/actors/actors.service.d.ts +0 -33
  834. package/src/lib/components/actors/actors.state.d.ts +0 -19
  835. package/src/lib/components/designer/components/label-editor.component.d.ts +0 -22
  836. package/src/lib/components/designer/components/node-selector.component.d.ts +0 -23
  837. package/src/lib/components/designer/components/swimlane-label.component.d.ts +0 -12
  838. package/src/lib/components/designer/components/swimlane-popup.component.d.ts +0 -18
  839. package/src/lib/components/designer/components/wf-canvas.component.d.ts +0 -37
  840. package/src/lib/components/designer/components/wf-designer.component.d.ts +0 -22
  841. package/src/lib/components/designer/components/wf-toolbar.component.d.ts +0 -17
  842. package/src/lib/components/designer/models/types.d.ts +0 -104
  843. package/src/lib/components/designer/services/canvas-state.service.d.ts +0 -24
  844. package/src/lib/components/designer/services/connection-segment-interaction.service.d.ts +0 -36
  845. package/src/lib/components/designer/services/connection.service.d.ts +0 -47
  846. package/src/lib/components/designer/services/keyboard-handler.service.d.ts +0 -9
  847. package/src/lib/components/designer/services/label-management.service.d.ts +0 -14
  848. package/src/lib/components/designer/services/node-finder.service.d.ts +0 -10
  849. package/src/lib/components/designer/services/node-interaction.service.d.ts +0 -19
  850. package/src/lib/components/designer/services/node-precondition.service.d.ts +0 -37
  851. package/src/lib/components/designer/services/node-selection.service.d.ts +0 -19
  852. package/src/lib/components/designer/services/orthogonal-router.service.d.ts +0 -36
  853. package/src/lib/components/designer/services/position-update.service.d.ts +0 -10
  854. package/src/lib/components/designer/services/rendering.service.d.ts +0 -67
  855. package/src/lib/components/designer/services/swimlane-management.service.d.ts +0 -19
  856. package/src/lib/components/designer/services/swimlane-stats.service.d.ts +0 -19
  857. package/src/lib/components/designer/services/viewport.service.d.ts +0 -10
  858. package/src/lib/components/designer/services/wf-facade.service.d.ts +0 -67
  859. package/src/lib/components/designer/services/wf-mapper.service.d.ts +0 -26
  860. package/src/lib/components/designer/services/wf-persistence.service.d.ts +0 -21
  861. package/src/lib/components/designer/services/wf-state.service.d.ts +0 -30
  862. package/src/lib/components/expiration/expiration.component.d.ts +0 -20
  863. package/src/lib/components/expiration/expiration.module.d.ts +0 -9
  864. package/src/lib/components/file-render/file-render.component.d.ts +0 -17
  865. package/src/lib/components/file-render/file-render.module.d.ts +0 -10
  866. package/src/lib/components/file-upload/file-upload.component.d.ts +0 -22
  867. package/src/lib/components/file-upload/file-upload.module.d.ts +0 -11
  868. package/src/lib/components/flowable-status/flowable-status.columns.d.ts +0 -3
  869. package/src/lib/components/flowable-status/flowable-status.component.d.ts +0 -80
  870. package/src/lib/components/flowable-status/flowable-status.config.d.ts +0 -11
  871. package/src/lib/components/flowable-status/flowable-status.facade.d.ts +0 -26
  872. package/src/lib/components/flowable-status/flowable-status.form.component.d.ts +0 -18
  873. package/src/lib/components/flowable-status/flowable-status.module.d.ts +0 -11
  874. package/src/lib/components/flowable-status/flowable-status.service.d.ts +0 -23
  875. package/src/lib/components/flowable-status/flowable-status.state.d.ts +0 -11
  876. package/src/lib/components/flowable-status/public-api.d.ts +0 -2
  877. package/src/lib/components/form-control/form-control.component.d.ts +0 -39
  878. package/src/lib/components/form-control/form-control.module.d.ts +0 -11
  879. package/src/lib/components/form-group/base-table-style.d.ts +0 -1
  880. package/src/lib/components/form-group/form-fields/form-fields.component.d.ts +0 -136
  881. package/src/lib/components/form-group/form-fields/form-fields.module.d.ts +0 -11
  882. package/src/lib/components/form-group/form-fields/form-fields.service.d.ts +0 -9
  883. package/src/lib/components/form-group/form-group.component.d.ts +0 -108
  884. package/src/lib/components/form-group/form-group.module.d.ts +0 -15
  885. package/src/lib/components/form-group/form-group.service.d.ts +0 -9
  886. package/src/lib/components/form-response/form-response.component.d.ts +0 -108
  887. package/src/lib/components/form-response/form-response.module.d.ts +0 -12
  888. package/src/lib/components/form-response/form-response.service.d.ts +0 -9
  889. package/src/lib/components/form-timer/form-timer.component.d.ts +0 -13
  890. package/src/lib/components/form-timer/form-timer.module.d.ts +0 -9
  891. package/src/lib/components/form-viewer/form-viewer.component.d.ts +0 -17
  892. package/src/lib/components/form-viewer/form-viewer.module.d.ts +0 -11
  893. package/src/lib/components/forms/base-table-style.d.ts +0 -1
  894. package/src/lib/components/forms/forms.component.d.ts +0 -88
  895. package/src/lib/components/forms/forms.module.d.ts +0 -8
  896. package/src/lib/components/forms/forms.service.d.ts +0 -9
  897. package/src/lib/components/journal/journal.component.d.ts +0 -5
  898. package/src/lib/components/journal/journal.module.d.ts +0 -8
  899. package/src/lib/components/my-queue/my-queue.columns.d.ts +0 -3
  900. package/src/lib/components/my-queue/my-queue.component.d.ts +0 -58
  901. package/src/lib/components/my-queue/my-queue.facade.d.ts +0 -47
  902. package/src/lib/components/my-queue/my-queue.module.d.ts +0 -15
  903. package/src/lib/components/my-queue/my-queue.service.d.ts +0 -65
  904. package/src/lib/components/my-queue/my-queue.state.d.ts +0 -39
  905. package/src/lib/components/my-queue/tasks.form.component.d.ts +0 -48
  906. package/src/lib/components/operation-popup/operation-popup.component.d.ts +0 -62
  907. package/src/lib/components/operation-popup/operation-popup.facade.d.ts +0 -32
  908. package/src/lib/components/operation-popup/operation-popup.service.d.ts +0 -23
  909. package/src/lib/components/operation-popup/operation-popup.state.d.ts +0 -20
  910. package/src/lib/components/stage-details/stage-details.component.d.ts +0 -24
  911. package/src/lib/components/stage-details/stage-details.module.d.ts +0 -9
  912. package/src/lib/components/task-form/task-form.component.d.ts +0 -10
  913. package/src/lib/components/task-form/task-form.module.d.ts +0 -10
  914. package/src/lib/components/task-history/task-history.component.d.ts +0 -41
  915. package/src/lib/components/task-history/task-history.module.d.ts +0 -11
  916. package/src/lib/components/task-history/task-history.service.d.ts +0 -13
  917. package/src/lib/components/task-notification/base-table-style.d.ts +0 -1
  918. package/src/lib/components/task-notification/task-notification.component.d.ts +0 -89
  919. package/src/lib/components/task-notification/task-notification.module.d.ts +0 -8
  920. package/src/lib/components/task-notification/task-notification.service.d.ts +0 -32
  921. package/src/lib/components/tasks/tasks.columns.d.ts +0 -11
  922. package/src/lib/components/tasks/tasks.component.d.ts +0 -40
  923. package/src/lib/components/tasks/tasks.facade.d.ts +0 -44
  924. package/src/lib/components/tasks/tasks.form.component.d.ts +0 -40
  925. package/src/lib/components/tasks/tasks.models.d.ts +0 -4
  926. package/src/lib/components/tasks/tasks.module.d.ts +0 -17
  927. package/src/lib/components/tasks/tasks.service.d.ts +0 -58
  928. package/src/lib/components/tasks/tasks.state.d.ts +0 -46
  929. package/src/lib/components/wf/wf.columns.d.ts +0 -3
  930. package/src/lib/components/wf/wf.component.d.ts +0 -16
  931. package/src/lib/components/wf/wf.module.d.ts +0 -10
  932. package/src/lib/components/wf/wf.service.d.ts +0 -51
  933. package/src/lib/components/workflow/column.d.ts +0 -3
  934. package/src/lib/components/workflow/helper.d.ts +0 -2
  935. package/src/lib/components/workflow/table-style.d.ts +0 -1
  936. package/src/lib/components/workflow/workflow.component.d.ts +0 -57
  937. package/src/lib/components/workflow/workflow.module.d.ts +0 -9
  938. package/src/lib/components/workflow-designer/action-dialog/action-dialog.component.d.ts +0 -34
  939. package/src/lib/components/workflow-designer/actor-tags-dialog/actor-tags-dialog.component.d.ts +0 -25
  940. package/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.d.ts +0 -38
  941. package/src/lib/components/workflow-designer/decision-popup/decision-popup.component.d.ts +0 -29
  942. package/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.d.ts +0 -292
  943. package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.d.ts +0 -39
  944. package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.types.d.ts +0 -5
  945. package/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.d.ts +0 -47
  946. package/src/lib/components/workflow-designer/services/connection.service.d.ts +0 -101
  947. package/src/lib/components/workflow-designer/services/node-management.service.d.ts +0 -73
  948. package/src/lib/components/workflow-designer/services/popup.service.d.ts +0 -147
  949. package/src/lib/components/workflow-designer/services/swimlane.service.d.ts +0 -66
  950. package/src/lib/components/workflow-designer/services/transformer.service.d.ts +0 -51
  951. package/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.d.ts +0 -43
  952. package/src/lib/components/workflow-designer/stage-node/stage-node.component.d.ts +0 -58
  953. package/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.d.ts +0 -49
  954. package/src/lib/components/workflow-designer/workflow-data.service.d.ts +0 -59
  955. package/src/lib/components/workflow-designer/workflow-designer.component.d.ts +0 -121
  956. package/src/lib/components/workflow-designer/workflow-designer.module.d.ts +0 -41
  957. package/src/lib/components/workflow-designer/workflow-designer.state.d.ts +0 -278
  958. package/src/lib/components/workflow-designer/workflow-designer.types.d.ts +0 -130
  959. package/src/lib/components/workflow-stage/workflow-stage.component.d.ts +0 -78
  960. package/src/lib/components/workflow-stage/workflow-stage.module.d.ts +0 -12
  961. package/src/lib/components/workflows/public-api.d.ts +0 -4
  962. package/src/lib/components/workflows/workflow-form/workflow-form.component.d.ts +0 -28
  963. package/src/lib/components/workflows/workflows.api.d.ts +0 -38
  964. package/src/lib/components/workflows/workflows.columns.d.ts +0 -3
  965. package/src/lib/components/workflows/workflows.component.d.ts +0 -98
  966. package/src/lib/components/workflows/workflows.config.d.ts +0 -10
  967. package/src/lib/components/workflows/workflows.facade.d.ts +0 -41
  968. package/src/lib/components/workflows/workflows.module.d.ts +0 -11
  969. package/src/lib/components/workflows/workflows.service.d.ts +0 -32
  970. package/src/lib/components/workflows/workflows.state.d.ts +0 -15
  971. package/src/lib/models/ActionHistory.d.ts +0 -16
  972. package/src/lib/models/ActionType.d.ts +0 -9
  973. package/src/lib/models/Actor.d.ts +0 -11
  974. package/src/lib/models/ActorTag.d.ts +0 -6
  975. package/src/lib/models/Coord.d.ts +0 -4
  976. package/src/lib/models/DataType.d.ts +0 -25
  977. package/src/lib/models/EAVEntity.d.ts +0 -4
  978. package/src/lib/models/ErrorResponse.d.ts +0 -6
  979. package/src/lib/models/Escalation.d.ts +0 -14
  980. package/src/lib/models/EscalationCycle.d.ts +0 -12
  981. package/src/lib/models/EscalationStage.d.ts +0 -10
  982. package/src/lib/models/EscalationType.d.ts +0 -5
  983. package/src/lib/models/File.d.ts +0 -7
  984. package/src/lib/models/FilterTypes.d.ts +0 -6
  985. package/src/lib/models/FlowableStatus.d.ts +0 -5
  986. package/src/lib/models/Form.d.ts +0 -13
  987. package/src/lib/models/FormEntity.d.ts +0 -13
  988. package/src/lib/models/FormFill.d.ts +0 -15
  989. package/src/lib/models/FormProperty.d.ts +0 -15
  990. package/src/lib/models/FormValues.d.ts +0 -14
  991. package/src/lib/models/MailConfig.d.ts +0 -12
  992. package/src/lib/models/MessageConfig.d.ts +0 -3
  993. package/src/lib/models/MessageMedium.d.ts +0 -4
  994. package/src/lib/models/OperationAction.d.ts +0 -14
  995. package/src/lib/models/PagedResult.d.ts +0 -5
  996. package/src/lib/models/PeriodMode.d.ts +0 -10
  997. package/src/lib/models/PermissionConfig.d.ts +0 -7
  998. package/src/lib/models/ReportSchedule.d.ts +0 -22
  999. package/src/lib/models/ReportType.d.ts +0 -5
  1000. package/src/lib/models/Resource.d.ts +0 -20
  1001. package/src/lib/models/ResponseKeyValue.d.ts +0 -5
  1002. package/src/lib/models/SMSConfig.d.ts +0 -10
  1003. package/src/lib/models/SearchDynamicWrapper.d.ts +0 -5
  1004. package/src/lib/models/SearchOperator.d.ts +0 -4
  1005. package/src/lib/models/SearchPropertySign.d.ts +0 -9
  1006. package/src/lib/models/SearchPropertyValue.d.ts +0 -12
  1007. package/src/lib/models/SearchPropertyValueType.d.ts +0 -9
  1008. package/src/lib/models/Size.d.ts +0 -4
  1009. package/src/lib/models/SortDirection.d.ts +0 -5
  1010. package/src/lib/models/StageActorRule.d.ts +0 -6
  1011. package/src/lib/models/SwimLane.d.ts +0 -13
  1012. package/src/lib/models/Tag.d.ts +0 -6
  1013. package/src/lib/models/Task.d.ts +0 -32
  1014. package/src/lib/models/TaskAssignmentType.d.ts +0 -4
  1015. package/src/lib/models/TaskNotification.d.ts +0 -14
  1016. package/src/lib/models/TaskNotificationMessageType.d.ts +0 -4
  1017. package/src/lib/models/TaskNotificationType.d.ts +0 -7
  1018. package/src/lib/models/TaskStatus.d.ts +0 -7
  1019. package/src/lib/models/Workflow.d.ts +0 -21
  1020. package/src/lib/models/WorkflowAction.d.ts +0 -14
  1021. package/src/lib/models/WorkflowOperation.d.ts +0 -6
  1022. package/src/lib/models/WorkflowStage.d.ts +0 -26
  1023. package/src/lib/models/actors.d.ts +0 -8
  1024. package/src/lib/models/auth-mechanism.d.ts +0 -13
  1025. package/src/lib/models/base.d.ts +0 -13
  1026. package/src/lib/models/object-state.d.ts +0 -6
  1027. package/src/lib/models/operation-type.d.ts +0 -5
  1028. package/src/lib/models/paged.d.ts +0 -9
  1029. package/src/lib/models/public-api.d.ts +0 -63
  1030. package/src/lib/models/query-params.d.ts +0 -8
  1031. package/src/lib/models/status.d.ts +0 -4
  1032. package/src/lib/models/task-history.d.ts +0 -17
  1033. package/src/lib/models/user-access-request-status.d.ts +0 -5
  1034. package/src/lib/models/user.d.ts +0 -24
  1035. package/src/lib/pipes/async-label.pipe.d.ts +0 -11
  1036. package/src/lib/services/environment.service.d.ts +0 -23
  1037. package/src/lib/services/http-web-request.service.d.ts +0 -23
  1038. package/src/lib/services/label.service.d.ts +0 -15
  1039. package/src/lib/services/public-api.d.ts +0 -4
  1040. package/src/lib/services/util.service.d.ts +0 -20
  1041. package/src/lib/shared/base-table-style.d.ts +0 -2
  1042. package/src/lib/shared/components/base-data-view.component.d.ts +0 -41
  1043. package/src/lib/shared/components/base-model-field.d.ts +0 -26
  1044. package/src/lib/shared/models/DataViewConfig.d.ts +0 -11
  1045. package/src/lib/shared/public-api.d.ts +0 -5
  1046. package/src/lib/shared/shared.module.d.ts +0 -11
  1047. /package/src/lib/base/{index.d.ts → index.ts} +0 -0
  1048. /package/src/lib/components/actors/{index.d.ts → index.ts} +0 -0
  1049. /package/src/lib/components/actors/{public-api.d.ts → public-api.ts} +0 -0
  1050. /package/src/lib/components/designer/{index.d.ts → index.ts} +0 -0
  1051. /package/src/lib/components/designer/{public-api.d.ts → public-api.ts} +0 -0
  1052. /package/src/lib/components/expiration/{index.d.ts → index.ts} +0 -0
  1053. /package/src/lib/components/expiration/{public-api.d.ts → public-api.ts} +0 -0
  1054. /package/src/lib/components/file-render/{index.d.ts → index.ts} +0 -0
  1055. /package/src/lib/components/file-render/{public-api.d.ts → public-api.ts} +0 -0
  1056. /package/src/lib/components/file-upload/{index.d.ts → index.ts} +0 -0
  1057. /package/src/lib/components/file-upload/{public-api.d.ts → public-api.ts} +0 -0
  1058. /package/src/lib/components/flowable-status/{index.d.ts → index.ts} +0 -0
  1059. /package/src/lib/components/form-control/{index.d.ts → index.ts} +0 -0
  1060. /package/src/lib/components/form-control/{public-api.d.ts → public-api.ts} +0 -0
  1061. /package/src/lib/components/form-group/{index.d.ts → index.ts} +0 -0
  1062. /package/src/lib/components/form-group/{public-api.d.ts → public-api.ts} +0 -0
  1063. /package/src/lib/components/form-response/{index.d.ts → index.ts} +0 -0
  1064. /package/src/lib/components/form-response/{public-api.d.ts → public-api.ts} +0 -0
  1065. /package/src/lib/components/form-timer/{index.d.ts → index.ts} +0 -0
  1066. /package/src/lib/components/form-timer/{public-api.d.ts → public-api.ts} +0 -0
  1067. /package/src/lib/components/{form-viewer/index.d.ts → form-values/index.ts} +0 -0
  1068. /package/src/lib/components/{forms/index.d.ts → form-viewer/index.ts} +0 -0
  1069. /package/src/lib/components/form-viewer/{public-api.d.ts → public-api.ts} +0 -0
  1070. /package/src/lib/components/{journal/index.d.ts → forms/index.ts} +0 -0
  1071. /package/src/lib/components/forms/{public-api.d.ts → public-api.ts} +0 -0
  1072. /package/src/lib/components/{my-queue/index.d.ts → journal/index.ts} +0 -0
  1073. /package/src/lib/components/journal/{public-api.d.ts → public-api.ts} +0 -0
  1074. /package/src/lib/components/{operation-popup/index.d.ts → my-queue/index.ts} +0 -0
  1075. /package/src/lib/components/my-queue/{public-api.d.ts → public-api.ts} +0 -0
  1076. /package/src/lib/components/{stage-details/index.d.ts → operation-popup/index.ts} +0 -0
  1077. /package/src/lib/components/operation-popup/{public-api.d.ts → public-api.ts} +0 -0
  1078. /package/src/lib/components/{task-form/index.d.ts → stage-details/index.ts} +0 -0
  1079. /package/src/lib/components/stage-details/{public-api.d.ts → public-api.ts} +0 -0
  1080. /package/src/lib/components/{task-history/index.d.ts → task-form/index.ts} +0 -0
  1081. /package/src/lib/components/task-form/{public-api.d.ts → public-api.ts} +0 -0
  1082. /package/src/lib/components/{task-notification/index.d.ts → task-history/index.ts} +0 -0
  1083. /package/src/lib/components/task-history/{public-api.d.ts → public-api.ts} +0 -0
  1084. /package/src/lib/components/{tasks/index.d.ts → task-notification/index.ts} +0 -0
  1085. /package/src/lib/components/task-notification/{public-api.d.ts → public-api.ts} +0 -0
  1086. /package/src/lib/components/{wf/index.d.ts → tasks/index.ts} +0 -0
  1087. /package/src/lib/components/tasks/{public-api.d.ts → public-api.ts} +0 -0
  1088. /package/src/lib/components/{workflow-designer/index.d.ts → wf/index.ts} +0 -0
  1089. /package/src/lib/components/wf/{public-api.d.ts → public-api.ts} +0 -0
  1090. /package/src/lib/components/{workflows/index.d.ts → workflow/index.ts} +0 -0
  1091. /package/src/lib/components/workflow/{public-api.d.ts → public-api.ts} +0 -0
  1092. /package/src/lib/components/{workflow-stage/index.d.ts → workflow-designer/index.ts} +0 -0
  1093. /package/src/lib/components/workflow-designer/{public-api.d.ts → public-api.ts} +0 -0
  1094. /package/src/lib/components/{workflow/index.d.ts → workflow-stage/index.ts} +0 -0
  1095. /package/src/lib/components/workflow-stage/{public-api.d.ts → public-api.ts} +0 -0
  1096. /package/src/lib/{models/index.d.ts → components/workflows/index.ts} +0 -0
  1097. /package/src/lib/{pipes/index.d.ts → models/index.ts} +0 -0
  1098. /package/src/lib/{services/index.d.ts → pipes/index.ts} +0 -0
  1099. /package/src/lib/pipes/{public-api.d.ts → public-api.ts} +0 -0
  1100. /package/src/lib/shared/{index.d.ts → index.ts} +0 -0
  1101. /package/{styles → src/styles}/styles.css +0 -0
@@ -0,0 +1,1654 @@
1
+ import {
2
+ Component,
3
+ ElementRef,
4
+ EventEmitter,
5
+ HostListener,
6
+ Input,
7
+ OnInit,
8
+ Output,
9
+ signal,
10
+ ViewChild,
11
+ WritableSignal,
12
+ } from '@angular/core';
13
+ import {
14
+ EscalationType,
15
+ Form,
16
+ Workflow,
17
+ WorkflowAction,
18
+ WorkflowStage,
19
+ } from 'verben-workflow-ui/src/lib/models';
20
+ import { WorkflowDataService } from '../workflow-data.service';
21
+ import { WorkflowDesignerState } from '../workflow-designer.state';
22
+ import {
23
+ Connection,
24
+ ConnectionPoint,
25
+ Node,
26
+ SwimlaneItem,
27
+ ToolType,
28
+ Node as WFNode,
29
+ } from '../workflow-designer.types';
30
+
31
+ /**
32
+ * The SVG editing surface. Renders the entire scene — swimlanes, nodes,
33
+ * connections, and overlaid popups — from {@link WorkflowDesignerState}, and
34
+ * owns nearly all pointer interaction: placing nodes, dragging them within and
35
+ * between lanes, and the connection drag/drop pipeline.
36
+ *
37
+ * This is the largest file in the module. It reads and mutates the shared
38
+ * `state` singleton directly rather than holding its own model.
39
+ *
40
+ * ## Coordinate spaces used here
41
+ *
42
+ * - {@link getMousePosition} returns **absolute canvas** coordinates — the space
43
+ * `state.addNode` and `Math.floor(y / 263)` expect.
44
+ * - {@link getViewportPosition} additionally subtracts scroll offsets and is
45
+ * used **only** to position HTML popups over the SVG. Never feed its output
46
+ * into node or connection math.
47
+ *
48
+ * Read `../docs/02-coordinate-system.md` before changing anything positional.
49
+ *
50
+ * ## Popups
51
+ *
52
+ * Popup visibility is tracked with local booleans here, even though a
53
+ * `PopupService` exists. Only `StageDialogComponent` uses that service; the two
54
+ * mechanisms coexist. See `../docs/06-known-issues.md` section C.
55
+ *
56
+ * @see ../docs/04-interactions.md — the user-facing flows this component implements
57
+ */
58
+ @Component({
59
+ selector: 'lib-designer-canvas',
60
+ templateUrl: './designer-canvas.component.html',
61
+ styleUrl: './designer-canvas.component.css',
62
+ })
63
+ export class DesignerCanvasComponent implements OnInit {
64
+ /** Active toolbar tool; `null` means pointer mode. */
65
+ @Input() selectedTool: ToolType = null;
66
+ /**
67
+ * Canvas click position in **absolute** coordinates, for the parent to act on
68
+ * per the selected tool.
69
+ *
70
+ * Also carries a sentinel: `{ x: -1, y: laneIndex }` means "edit the swimlane
71
+ * at `laneIndex`" (the lane's pencil button), not a placement.
72
+ */
73
+ @Output() clickedPosition = new EventEmitter<{ x: number; y: number }>();
74
+ /** Emitted when a workflow is chosen for a subflow node. */
75
+ @Output() subflowSelected = new EventEmitter();
76
+ /** Where a stage will be created once the stage dialog is confirmed. */
77
+ pendingStagePosition: { swimlaneIndex: number; x: number; y: number } | null =
78
+ null;
79
+ /** A stage node's properties were edited on the canvas. */
80
+ @Output() stagePropertiesUpdated = new EventEmitter<{
81
+ nodeId: string;
82
+ stageData: Partial<WorkflowStage>;
83
+ }>();
84
+ /** A connection's action properties were edited on the canvas. */
85
+ @Output() actionPropertiesUpdated = new EventEmitter<{
86
+ connectionId: string;
87
+ actionData: Partial<WorkflowAction>;
88
+ }>();
89
+
90
+ /** The SVG root; its bounding box defines absolute canvas space. */
91
+ @ViewChild('canvas', { static: true }) canvasRef!: ElementRef<SVGElement>;
92
+
93
+ @HostListener('window:mouseup', ['$event'])
94
+ onWindowMouseUp(event: MouseEvent): void {
95
+ // If we have a popup open but the mouse is released outside, clean up
96
+ if (
97
+ !this.showSubflowPopup &&
98
+ !this.showStartNodeFormPopup &&
99
+ !this.popupVisible && // Only end drag if no popup is visible
100
+ this.state.isConnectionDragging()
101
+ ) {
102
+ this.state.endConnectionDrag();
103
+ }
104
+ }
105
+
106
+ // Canvas dimensions
107
+ canvasWidth = 3000;
108
+ canvasHeight = 2000;
109
+
110
+ // Grid size
111
+ gridSize = 20;
112
+
113
+ swimlaneHeight = 263;
114
+ visibleConnectionPointsNodeId: string | null = null;
115
+ popupVisible = false;
116
+ popupX = 0;
117
+ popupY = 0;
118
+ allowedNodeTypes: string[] = [];
119
+
120
+ showStartNodeFormPopup: boolean = false;
121
+ startNodeFormsList: Form[] = [];
122
+ isLoadingStartNodeForms: boolean = false;
123
+ startNodeFormPopupX: number = 0;
124
+ startNodeFormPopupY: number = 0;
125
+ activeNodeForFormSelection: Node | null = null;
126
+ nodeForms: WritableSignal<
127
+ Record<string, { formId: string; formName: string }>
128
+ > = signal({});
129
+
130
+ showSubflowPopup: boolean = false;
131
+ workflowsList: Workflow[] = [];
132
+ isLoadingWorkflows: boolean = false;
133
+ subflowPopupX: number = 0;
134
+ subflowPopupY: number = 0;
135
+ pendingSubflowPosition: {
136
+ swimlaneIndex: number;
137
+ x: number;
138
+ y: number;
139
+ } | null = null;
140
+
141
+ pendingDecisionConnection: {
142
+ decisionNodeId: string;
143
+ swimlaneIndex: number;
144
+ x: number;
145
+ y: number;
146
+ } | null = null;
147
+
148
+ pendingConnectionSourcePoint: ConnectionPoint | null = null;
149
+ pendingConnectionSourceSwimlaneIndex: number | null = null;
150
+
151
+ // ─── Node-drag state ───────────────────────────────────────────────────────
152
+ isDraggingNode = false;
153
+ draggingNode: Node | null = null;
154
+ private draggingNodeSwimlaneIndex: number = -1;
155
+ /** Mouse offset relative to node top-left at drag start (absolute canvas coords). */
156
+ private dragOffsetX = 0;
157
+ private dragOffsetY = 0;
158
+
159
+ showDecisionConditionDialog: boolean = false;
160
+ showConditionsDialog: boolean = false;
161
+ activeDecisionNodeId: string = '';
162
+ activeConnectionId: string = '';
163
+ decisionConditionPopupX: number = 0;
164
+ decisionConditionPopupY: number = 0;
165
+
166
+ isCreatingStageFromDecision: boolean = false;
167
+ pendingDecisionCondition: string = '';
168
+ activeStageId: string | null = null;
169
+ activeActionId: string | null = null;
170
+
171
+ showStageDialogLocal: boolean = false;
172
+ showEscalationDialogLocal: boolean = false;
173
+ activeEscalationType: WritableSignal<EscalationType | null> = signal(null);
174
+ activeStageCode: WritableSignal<string | null> = signal(null);
175
+ activeStageData: Partial<WorkflowStage> = {};
176
+ activeActionData: Connection | null = null;
177
+
178
+ showActionDialogLocal: boolean = false;
179
+
180
+ potentialTargetPointId: string | null = null;
181
+
182
+ constructor(
183
+ public state: WorkflowDesignerState,
184
+ private dataService: WorkflowDataService,
185
+ ) {}
186
+
187
+ ngOnInit(): void {
188
+ this.updateCanvasSize();
189
+ }
190
+
191
+ // Handle mouse click on canvas
192
+ onCanvasClick(event: MouseEvent): void {
193
+ // Only process canvas clicks if a tool is selected
194
+ if (!this.selectedTool) {
195
+ return;
196
+ }
197
+
198
+ // Get the position where the click occurred
199
+ const position = this.getMousePosition(event);
200
+
201
+ // Calculate the swimlane index based on position
202
+ // const swimlaneIndex = Math.floor(position.y / this.swimlaneHeight);
203
+
204
+ // Only emit the position if we have a tool selected and it's a valid click area
205
+ if (this.selectedTool) {
206
+ this.clickedPosition.emit({
207
+ x: position.x,
208
+ y: position.y,
209
+ });
210
+ }
211
+ }
212
+
213
+ onShowShieldDialog(stageId: string): void {
214
+ // Find the node
215
+ const nodeInfo = this.state.findNodeById(stageId);
216
+ if (nodeInfo) {
217
+ this.activeStageId = stageId;
218
+ // Seed the entry-point toggle from the node's actual start state, which is
219
+ // the source of truth for the start circle and API serialization. The
220
+ // auto-assigned entry node has isStartNode=true without stageData.IsEntryPoint.
221
+ this.activeStageData = {
222
+ ...nodeInfo.node.stageData,
223
+ IsEntryPoint: nodeInfo.node.isStartNode,
224
+ id: stageId,
225
+ };
226
+ this.showStageDialogLocal = true;
227
+ }
228
+ }
229
+
230
+ onShowActionDialog(connectionInfo: Connection): void {
231
+ // Find the node
232
+ // const connectionInfo = this.state.findActionById(actionId);
233
+ if (connectionInfo) {
234
+ this.activeActionId = connectionInfo.id;
235
+ this.activeActionData = connectionInfo;
236
+ this.showActionDialogLocal = true;
237
+ }
238
+ }
239
+
240
+ onShowEscalationDialog(event: {
241
+ stageId: string;
242
+ type: EscalationType;
243
+ }): void {
244
+ // Find the node
245
+ const nodeInfo = this.state.findNodeById(event.stageId);
246
+ if (nodeInfo) {
247
+ this.activeStageId = event.stageId;
248
+ this.activeStageData = nodeInfo.node.stageData || {
249
+ id: this.activeStageId,
250
+ };
251
+ this.activeEscalationType.set(event.type);
252
+ this.activeStageCode.set(this.activeStageData?.Code || '');
253
+ this.showEscalationDialogLocal = true;
254
+ }
255
+ }
256
+
257
+ // Add this method to handle dialog closure
258
+ onStageDialogClosed(): void {
259
+ this.showStageDialogLocal = false;
260
+ this.activeStageId = null;
261
+ this.activeStageData = {};
262
+ }
263
+
264
+ onActionDialogClosed(): void {
265
+ this.showActionDialogLocal = false;
266
+ this.activeActionId = null;
267
+ this.activeActionData = null;
268
+ }
269
+
270
+ onActionDialogDeleted(connectionId: string): void {
271
+ // Remove the connection from state
272
+ this.state.connections = this.state.connections.filter(
273
+ (c) => c.id !== connectionId,
274
+ );
275
+ // Close the dialog
276
+ this.onActionDialogClosed();
277
+ }
278
+
279
+ // Add this method to handle dialog closure
280
+ onEscalationDialogClosed(): void {
281
+ this.showEscalationDialogLocal = false;
282
+ this.activeStageId = null;
283
+ this.activeEscalationType.set(null);
284
+ this.activeStageCode.set(null);
285
+ this.activeStageData = {};
286
+ }
287
+
288
+ // Add this method to handle saving stage data
289
+ onStageDialogSaved(stageData: Partial<WorkflowStage>): void {
290
+ if (this.activeStageId) {
291
+ // Editing an existing stage
292
+ const nodeInfo = this.state.findNodeById(this.activeStageId);
293
+ if (nodeInfo) {
294
+ // Update the stage data
295
+ nodeInfo.node.stageData = {
296
+ ...nodeInfo.node.stageData,
297
+ ...stageData,
298
+ };
299
+
300
+ // Sync the entry-point flag onto node.isStartNode, which drives both the
301
+ // start circle and the IsEntryPoint value serialized to the API.
302
+ if (stageData.IsEntryPoint) {
303
+ // Enforce a single entry point: this node becomes the sole start node.
304
+ this.state.swimlanes.forEach((swimlane) => {
305
+ swimlane.nodes?.forEach((node) => {
306
+ node.isStartNode = node.id === this.activeStageId;
307
+ });
308
+ });
309
+ this.state.startNodeId = this.activeStageId;
310
+ } else {
311
+ nodeInfo.node.isStartNode = false;
312
+ if (this.state.startNodeId === this.activeStageId) {
313
+ this.state.startNodeId = null;
314
+ }
315
+ }
316
+
317
+ // Emit event for parent component to know about the update
318
+ this.stagePropertiesUpdated.emit({
319
+ nodeId: this.activeStageId,
320
+ stageData: nodeInfo.node.stageData,
321
+ });
322
+ }
323
+ }
324
+
325
+ // Close the dialog
326
+ this.onStageDialogClosed();
327
+ }
328
+
329
+ onActionDialogSaved(actionData: Connection): void {
330
+ if (this.activeActionId) {
331
+ // Editing an existing stage
332
+ // let connectionInfo = this.state.findActionById(this.activeActionId);
333
+ this.state.connections = this.state.connections.map(
334
+ (connection, index) => {
335
+ if (connection.id === this.activeActionId) {
336
+ connection.label = actionData.label;
337
+ connection.action = actionData.action;
338
+ connection.targetStatus = actionData.targetStatus;
339
+ connection.position = actionData.position;
340
+ }
341
+ return connection;
342
+ },
343
+ );
344
+ }
345
+
346
+ // Close the dialog
347
+ this.onActionDialogClosed();
348
+ }
349
+
350
+ updateCanvasSize(): void {
351
+ const requiredHeight =
352
+ (this.state.swimlanes.length + 1) * this.swimlaneHeight;
353
+ this.canvasHeight = Math.max(2000, requiredHeight); // Ensure we have at least our default height
354
+
355
+ // Update all the swimlane clip paths when size changes
356
+ setTimeout(() => {
357
+ this.state.swimlanes.forEach((swimlane, index) => {
358
+ const clipPathId = `swimlane-clip-${index}`;
359
+ const clipPathElement = document.getElementById(clipPathId);
360
+ if (clipPathElement) {
361
+ const rectElement = clipPathElement.querySelector('rect');
362
+ if (rectElement) {
363
+ rectElement.setAttribute('width', this.canvasWidth.toString());
364
+ }
365
+ }
366
+ });
367
+ }, 0);
368
+ }
369
+
370
+ /**
371
+ * Converts a DOM mouse event into **absolute canvas coordinates**, relative
372
+ * to the SVG's bounding box.
373
+ *
374
+ * This is the space that `state.addNode`, `Math.floor(y / 263)`, and all
375
+ * connection math expect. Use this — not {@link getViewportPosition} — for
376
+ * anything positional.
377
+ */
378
+ private getMousePosition(event: MouseEvent): { x: number; y: number } {
379
+ // Use clientX/Y and getBoundingClientRect() for cross-browser compatibility
380
+ const rect = this.canvasRef.nativeElement.getBoundingClientRect();
381
+ return {
382
+ x: event.clientX - rect.left,
383
+ y: event.clientY - rect.top,
384
+ };
385
+ }
386
+
387
+ /**
388
+ * Converts absolute canvas coordinates into **viewport coordinates** by
389
+ * subtracting the scroll container's offsets.
390
+ *
391
+ * Used **only** to position HTML popups overlaid on the SVG. Feeding this
392
+ * into node or connection math produces elements that drift as the canvas
393
+ * scrolls.
394
+ */
395
+ private getViewportPosition(
396
+ canvasX: number,
397
+ canvasY: number,
398
+ ): { x: number; y: number } {
399
+ const parentElement = this.canvasRef.nativeElement.parentElement;
400
+ const scrollLeft = parentElement?.scrollLeft || 0;
401
+ const scrollTop = parentElement?.scrollTop || 0;
402
+
403
+ return {
404
+ x: canvasX - scrollLeft,
405
+ y: canvasY - scrollTop,
406
+ };
407
+ }
408
+
409
+ showConnectionPoints(nodeId: string, swimlaneIndex: number): void {
410
+ this.visibleConnectionPointsNodeId = nodeId;
411
+ }
412
+
413
+ isMouseOverNode(
414
+ event: MouseEvent,
415
+ node: WFNode,
416
+ swimlaneIndex: number,
417
+ ): boolean {
418
+ const position = this.getMousePosition(event);
419
+ const nodeBounds = this.getNodeBoundsWithPadding(node, swimlaneIndex);
420
+
421
+ return (
422
+ position.x >= nodeBounds.x &&
423
+ position.x <= nodeBounds.x + nodeBounds.width &&
424
+ position.y >= nodeBounds.y &&
425
+ position.y <= nodeBounds.y + nodeBounds.height
426
+ );
427
+ }
428
+
429
+ // helper method to calculate node bounds with padding
430
+ getNodeBoundsWithPadding(
431
+ node: WFNode,
432
+ swimlaneIndex: number,
433
+ ): { x: number; y: number; width: number; height: number } {
434
+ const padding = 10; // Add 10px padding around nodes for easier hover detection
435
+
436
+ // Calculate the absolute Y position including swimlane offset
437
+ const absoluteY = node.y + swimlaneIndex * 263;
438
+
439
+ return {
440
+ x: node.x - padding,
441
+ y: absoluteY - padding,
442
+ width: node.width + padding * 2,
443
+ height: node.height + padding * 2,
444
+ };
445
+ }
446
+
447
+ hideConnectionPoints(nodeId: string): void {
448
+ if (
449
+ this.visibleConnectionPointsNodeId === nodeId &&
450
+ !this.state.isConnectionDragging()
451
+ ) {
452
+ this.visibleConnectionPointsNodeId = null;
453
+ }
454
+ }
455
+
456
+ isConnectionPointVisible(nodeId: string): boolean {
457
+ return this.visibleConnectionPointsNodeId === nodeId;
458
+ }
459
+
460
+ startConnectionDrag(
461
+ event: MouseEvent,
462
+ point: ConnectionPoint,
463
+ swimlaneIndex: number,
464
+ ): void {
465
+ event.preventDefault();
466
+ event.stopPropagation();
467
+
468
+ // Check if this is an exit point node
469
+ const nodeInfo = this.state.findNodeById(point.nodeId);
470
+ if (
471
+ nodeInfo &&
472
+ nodeInfo.node.type === 'stage' &&
473
+ nodeInfo.node.stageData?.IsExitPoint
474
+ ) {
475
+ // Don't allow connections from exit points
476
+ return;
477
+ }
478
+
479
+ const position = this.getMousePosition(event);
480
+ this.state.startConnectionDrag(
481
+ point,
482
+ swimlaneIndex,
483
+ position.x,
484
+ position.y,
485
+ );
486
+
487
+ // Add mouse move and mouse up event listeners to the document
488
+ document.addEventListener('mousemove', this.onMouseMove);
489
+ document.addEventListener('mouseup', this.onMouseUp);
490
+ }
491
+
492
+ highlightPotentialTargets(event: MouseEvent): void {
493
+ if (!this.state.isConnectionDragging()) return;
494
+
495
+ const position = this.getMousePosition(event);
496
+ const targetPointInfo = this.findConnectionPointAtPosition(
497
+ position.x,
498
+ position.y,
499
+ );
500
+
501
+ if (
502
+ targetPointInfo &&
503
+ targetPointInfo.point.id !== this.potentialTargetPointId
504
+ ) {
505
+ // We have a new target point
506
+ this.potentialTargetPointId = targetPointInfo.point.id;
507
+ } else if (!targetPointInfo && this.potentialTargetPointId) {
508
+ // We're no longer over a target point
509
+ this.potentialTargetPointId = null;
510
+ }
511
+ }
512
+
513
+ // ─────────────────────────────────────────────────────────────────────────
514
+ // Node drag logic
515
+ // ─────────────────────────────────────────────────────────────────────────
516
+
517
+ /**
518
+ * Called from the template when the user presses the mouse button on a node.
519
+ * Starts the drag interaction and registers document-level listeners so the
520
+ * drag continues even when the cursor leaves the SVG canvas.
521
+ */
522
+ onNodeMouseDown(event: MouseEvent, node: Node, swimlaneIndex: number): void {
523
+ // Do not interfere with connection dragging or open popups
524
+ if (
525
+ this.state.isConnectionDragging() ||
526
+ this.popupVisible ||
527
+ this.showStartNodeFormPopup ||
528
+ this.showSubflowPopup
529
+ )
530
+ return;
531
+
532
+ event.stopPropagation(); // Prevent onCanvasClick from firing
533
+ event.preventDefault();
534
+
535
+ const position = this.getMousePosition(event);
536
+ // Template formula: absoluteSVGY = node.y + swimlane.order * 263
537
+ const absoluteNodeY = node.y + swimlaneIndex * this.swimlaneHeight;
538
+
539
+ this.isDraggingNode = true;
540
+ this.draggingNode = node;
541
+ this.draggingNodeSwimlaneIndex = swimlaneIndex;
542
+ // Store the offset from the node's top-left so the node doesn't jump
543
+ this.dragOffsetX = position.x - node.x;
544
+ this.dragOffsetY = position.y - absoluteNodeY;
545
+
546
+ // Seed pending values with the node's CURRENT position so that a plain
547
+ // click (no mousemove) leaves node.y unchanged in onNodeDragEnd.
548
+ this._pendingAbsoluteY = absoluteNodeY;
549
+ this._pendingTargetSwimlaneIndex = swimlaneIndex;
550
+
551
+ document.addEventListener('mousemove', this.onNodeDragMove);
552
+ document.addEventListener('mouseup', this.onNodeDragEnd);
553
+ }
554
+
555
+ /**
556
+ * Arrow function (preserves `this`) — runs on every mousemove while dragging
557
+ * a node. Updates node.x / node.y in-place so Angular's change detection
558
+ * picks it up and redraws the node and all connected paths automatically.
559
+ */
560
+ onNodeDragMove = (event: MouseEvent): void => {
561
+ if (!this.isDraggingNode || !this.draggingNode) return;
562
+
563
+ const position = this.getMousePosition(event);
564
+
565
+ // Raw desired absolute position of the node top-left
566
+ const rawAbsoluteX = position.x - this.dragOffsetX;
567
+ const rawAbsoluteY = position.y - this.dragOffsetY;
568
+
569
+ // Determine which swimlane the node is being dragged into (by cursor Y)
570
+ let targetSwimlaneIndex = Math.floor(position.y / this.swimlaneHeight);
571
+ targetSwimlaneIndex = Math.max(
572
+ 0,
573
+ Math.min(targetSwimlaneIndex, this.state.swimlanes.length - 1),
574
+ );
575
+
576
+ const swimlaneTopY = targetSwimlaneIndex * this.swimlaneHeight;
577
+ const swimlaneBottomY = swimlaneTopY + this.swimlaneHeight;
578
+ const padding = 5;
579
+
580
+ // X: keep node fully on canvas (no left/right boundary needed for swimlanes)
581
+ const newAbsoluteX = Math.max(padding, rawAbsoluteX);
582
+
583
+ // Y: clamp so the node stays inside the targeted swimlane
584
+ let newAbsoluteY = rawAbsoluteY;
585
+ const node = this.draggingNode;
586
+ if (newAbsoluteY < swimlaneTopY + padding) {
587
+ newAbsoluteY = swimlaneTopY + padding;
588
+ } else if (newAbsoluteY + node.height > swimlaneBottomY - padding) {
589
+ newAbsoluteY = swimlaneBottomY - node.height - padding;
590
+ }
591
+
592
+ // Convert absolute Y to swimlane-relative Y for storage
593
+ const newRelativeY =
594
+ newAbsoluteY - targetSwimlaneIndex * this.swimlaneHeight;
595
+
596
+ // Live preview: update position directly.
597
+ // Template formula: absoluteSVGY = node.y + swimlane.order * 263
598
+ // => node.y = absoluteY - swimlane.order * 263 (swimlane-relative)
599
+ // The node is STILL in the source swimlane's array during preview,
600
+ // so swimlane.order = draggingNodeSwimlaneIndex.
601
+ node.x = newAbsoluteX;
602
+ node.y =
603
+ newAbsoluteY - this.draggingNodeSwimlaneIndex * this.swimlaneHeight;
604
+
605
+ // Store computed values for onNodeDragEnd
606
+ this._pendingTargetSwimlaneIndex = targetSwimlaneIndex;
607
+ this._pendingAbsoluteY = newAbsoluteY;
608
+ };
609
+
610
+ /** Scratch fields used to pass computed values from move → end handlers. */
611
+ private _pendingTargetSwimlaneIndex = -1;
612
+ private _pendingAbsoluteY = 0;
613
+
614
+ /**
615
+ * Arrow function (preserves `this`) — fires on mouseup after a node drag.
616
+ * Finalises the node position and performs swimlane migration if necessary.
617
+ */
618
+ onNodeDragEnd = (_event: MouseEvent): void => {
619
+ document.removeEventListener('mousemove', this.onNodeDragMove);
620
+ document.removeEventListener('mouseup', this.onNodeDragEnd);
621
+
622
+ if (!this.isDraggingNode || !this.draggingNode) {
623
+ this.isDraggingNode = false;
624
+ this.draggingNode = null;
625
+ return;
626
+ }
627
+
628
+ const node = this.draggingNode;
629
+ const fromIndex = this.draggingNodeSwimlaneIndex;
630
+ const toIndex =
631
+ this._pendingTargetSwimlaneIndex !== -1
632
+ ? this._pendingTargetSwimlaneIndex
633
+ : fromIndex;
634
+ const absoluteY = this._pendingAbsoluteY;
635
+
636
+ if (fromIndex !== toIndex) {
637
+ // Cross-swimlane drop: state helper moves node between arrays,
638
+ // updates connections, and syncs tags. It also sets node.y correctly.
639
+ this.state.moveNodeToSwimlane(
640
+ node.id,
641
+ fromIndex,
642
+ toIndex,
643
+ node.x,
644
+ absoluteY,
645
+ );
646
+ } else {
647
+ // Same swimlane: node.y = absoluteY - swimlane.order * 263 (swimlane-relative)
648
+ node.y = absoluteY - fromIndex * this.swimlaneHeight;
649
+ }
650
+
651
+ // Reset drag state
652
+ this.isDraggingNode = false;
653
+ this.draggingNode = null;
654
+ this.draggingNodeSwimlaneIndex = -1;
655
+ this.dragOffsetX = 0;
656
+ this.dragOffsetY = 0;
657
+ this._pendingTargetSwimlaneIndex = -1;
658
+ this._pendingAbsoluteY = 0;
659
+ };
660
+
661
+ /**
662
+ * Returns a CSS cursor value for the node rendering.
663
+ * Shows 'grabbing' while the node is being dragged, 'grab' otherwise.
664
+ */
665
+ getCursorForNode(nodeId: string): string {
666
+ return this.isDraggingNode && this.draggingNode?.id === nodeId
667
+ ? 'grabbing'
668
+ : 'grab';
669
+ }
670
+
671
+ // ─────────────────────────────────────────────────────────────────────────
672
+ // Connection drag logic (existing)
673
+ // ─────────────────────────────────────────────────────────────────────────
674
+
675
+ // Use arrow functions to preserve 'this' context
676
+ onMouseMove = (event: MouseEvent) => {
677
+ const position = this.getMousePosition(event);
678
+ this.updateConnectionDrag(position.x, position.y);
679
+ this.highlightPotentialTargets(event);
680
+ };
681
+
682
+ updateConnectionDrag(currentX: number, currentY: number) {
683
+ if (this.state.draggingConnectionData.sourcePoint) {
684
+ this.state.draggingConnectionData.currentX = currentX;
685
+ this.state.draggingConnectionData.currentY = currentY;
686
+
687
+ // Calculate which swimlane the cursor is over
688
+ const swimlaneIndex = Math.floor(currentY / this.swimlaneHeight);
689
+ if (swimlaneIndex >= 0 && swimlaneIndex < this.state.swimlanes.length) {
690
+ // Ensure the target swimlane is fully visible
691
+ this.ensureSwimlaneInView(swimlaneIndex);
692
+ }
693
+ }
694
+ }
695
+
696
+ /**
697
+ * Terminates a connection drag. Three outcomes, evaluated in order:
698
+ *
699
+ * 1. **Dropped on an existing connection point** — if the source and target
700
+ * are different nodes and `state.canConnect` allows the type pairing, the
701
+ * connection is created immediately.
702
+ * 2. **Dropped inside a swimlane but not on a point** — opens the node-type
703
+ * popup ({@link showConnectionPopup}), offering only the types permitted by
704
+ * `state.getAllowedTargetNodeTypes()`. The node is created later, by
705
+ * {@link createNodeConnection}.
706
+ * 3. **Dropped outside every swimlane** — the drag is cancelled.
707
+ *
708
+ * Always detaches the document-level move/up listeners first, so an early
709
+ * return cannot leave them attached.
710
+ */
711
+ onMouseUp = (event: MouseEvent) => {
712
+ document.removeEventListener('mousemove', this.onMouseMove);
713
+ document.removeEventListener('mouseup', this.onMouseUp);
714
+
715
+ const position = this.getMousePosition(event);
716
+
717
+ // Only proceed if we are dragging a connection
718
+ if (!this.state.isConnectionDragging()) {
719
+ return;
720
+ }
721
+
722
+ // Check if we're dropping onto a connection point
723
+ const targetPointInfo = this.findConnectionPointAtPosition(
724
+ position.x,
725
+ position.y,
726
+ );
727
+
728
+ if (targetPointInfo) {
729
+ // We found a target connection point
730
+
731
+ // Get the source point and swimlane index
732
+ const sourcePoint = this.state.draggingConnectionData.sourcePoint;
733
+ const sourceSwimlaneIndex =
734
+ this.state.draggingConnectionData.sourceSwimlaneIndex;
735
+
736
+ if (sourcePoint && sourceSwimlaneIndex !== undefined) {
737
+ // Prevent connecting a node to itself
738
+ if (sourcePoint.nodeId !== targetPointInfo.nodeId) {
739
+ // Get source and target node types to check if connection is allowed
740
+ const sourceNodeInfo = this.state.findNodeById(sourcePoint.nodeId);
741
+ const targetNodeInfo = this.state.findNodeById(
742
+ targetPointInfo.nodeId,
743
+ );
744
+
745
+ if (
746
+ sourceNodeInfo &&
747
+ targetNodeInfo &&
748
+ this.state.canConnect(
749
+ sourceNodeInfo.node.type,
750
+ targetNodeInfo.node.type,
751
+ )
752
+ ) {
753
+ // Create the connection
754
+ const connection = {
755
+ id: `conn-${Date.now()}-${Math.floor(Math.random() * 1000)}`,
756
+ sourceNodeId: sourcePoint.nodeId,
757
+ targetNodeId: targetPointInfo.nodeId,
758
+ sourcePointId: sourcePoint.id,
759
+ targetPointId: targetPointInfo.point.id,
760
+ sourceSwimlaneIndex: sourceSwimlaneIndex,
761
+ targetSwimlaneIndex: targetPointInfo.swimlaneIndex,
762
+ label: '',
763
+ action: null,
764
+ position: 1,
765
+ };
766
+
767
+ // Add to connections array
768
+ this.state.connections.push(connection);
769
+
770
+ // Notify about connection creation
771
+ this.onConnectionCreated(connection);
772
+ }
773
+ }
774
+ }
775
+
776
+ // End the connection drag
777
+ this.state.endConnectionDrag();
778
+ return;
779
+ }
780
+
781
+ // Check if the position is within any swimlane
782
+ const isInsideSwimlane = this.isPositionInsideSwimlane(position.y);
783
+
784
+ // Only show popup if within a swimlane
785
+ if (isInsideSwimlane && this.state.isConnectionDragging()) {
786
+ this.showConnectionPopup(position.x, position.y);
787
+ } else {
788
+ // End the connection drag if outside a swimlane
789
+ this.state.endConnectionDrag();
790
+ }
791
+ };
792
+
793
+ /**
794
+ * Hit-tests an absolute canvas position against every node's connection
795
+ * points, resolving each to absolute space as
796
+ * `node.y + swimlaneIndex * 263 + point.y` — the inverse of the render
797
+ * formula.
798
+ *
799
+ * Returns the first point within `tolerance` pixels, or `null`. Scans all
800
+ * lanes and all nodes linearly.
801
+ *
802
+ * @param x Absolute canvas X (from {@link getMousePosition}).
803
+ * @param y Absolute canvas Y.
804
+ * @param tolerance Hit radius in pixels.
805
+ */
806
+ findConnectionPointAtPosition(
807
+ x: number,
808
+ y: number,
809
+ tolerance: number = 10,
810
+ ): {
811
+ point: ConnectionPoint;
812
+ nodeId: string;
813
+ swimlaneIndex: number;
814
+ } | null {
815
+ // Iterate through all swimlanes and nodes to find connection points
816
+ for (
817
+ let swimlaneIndex = 0;
818
+ swimlaneIndex < this.state.swimlanes.length;
819
+ swimlaneIndex++
820
+ ) {
821
+ const swimlane = this.state.swimlanes[swimlaneIndex];
822
+
823
+ if (!swimlane.nodes) continue;
824
+
825
+ for (const node of swimlane.nodes) {
826
+ if (!node.connectionPoints) continue;
827
+
828
+ // Calculate the absolute position of the node (including swimlane offset)
829
+ const absoluteNodeX = node.x;
830
+ const absoluteNodeY = node.y + swimlaneIndex * this.swimlaneHeight;
831
+
832
+ for (const point of node.connectionPoints) {
833
+ // Calculate absolute position of the connection point
834
+ const pointX = absoluteNodeX + point.x;
835
+ const pointY = absoluteNodeY + point.y;
836
+
837
+ // Check if the given position is within tolerance of this point
838
+ if (
839
+ Math.abs(x - pointX) <= tolerance &&
840
+ Math.abs(y - pointY) <= tolerance
841
+ ) {
842
+ return {
843
+ point: point,
844
+ nodeId: node.id,
845
+ swimlaneIndex: swimlaneIndex,
846
+ };
847
+ }
848
+ }
849
+ }
850
+ }
851
+
852
+ return null;
853
+ }
854
+
855
+ isPositionInsideSwimlane(y: number): boolean {
856
+ // Check if y position is within any swimlane
857
+ const swimlaneCount = this.state.swimlanes.length;
858
+ if (swimlaneCount === 0) return false;
859
+
860
+ // Each swimlane has a height of 263px
861
+ const totalSwimlaneHeight = swimlaneCount * this.swimlaneHeight;
862
+
863
+ // Check if y is within the total height of all swimlanes
864
+ return y >= 0 && y < totalSwimlaneHeight;
865
+ }
866
+
867
+ showConnectionPopup(x: number, y: number): void {
868
+ // Convert canvas coordinates to viewport coordinates for popup positioning
869
+ const viewportPos = this.getViewportPosition(x, y);
870
+ this.popupX = viewportPos.x;
871
+ this.popupY = viewportPos.y;
872
+
873
+ // Get allowed node types based on the source node type
874
+ this.allowedNodeTypes = this.state.getAllowedTargetNodeTypes();
875
+
876
+ // Only show the popup if we have allowed node types
877
+ if (this.allowedNodeTypes.length > 0) {
878
+ this.popupVisible = true;
879
+
880
+ // Force the popup to be visible in the next tick
881
+ } else {
882
+ // No allowed node types, just end the drag
883
+ this.state.endConnectionDrag();
884
+ }
885
+ }
886
+
887
+ hideConnectionPopup(): void {
888
+ this.popupVisible = false;
889
+ this.state.endConnectionDrag();
890
+ }
891
+
892
+ // Add this handler to close the popup when clicking outside
893
+ // @HostListener('document:click', ['$event'])
894
+ // onDocumentClick(event: MouseEvent): void {
895
+ // if (this.popupVisible) {
896
+ // const popupElement = document.querySelector('verben-pop-Up');
897
+ // if (popupElement && !popupElement.contains(event.target as Node)) {
898
+ // this.hideConnectionPopup();
899
+ // }
900
+ // }
901
+ // }
902
+
903
+ /**
904
+ * Creates a new node at the drop point and connects the dragged edge to it —
905
+ * the path taken when the user picks a type from the node-type popup.
906
+ *
907
+ * ## The coordinate contract this method must honour
908
+ *
909
+ * The target swimlane is derived from the **drop** Y
910
+ * (`Math.floor(endY / 263)`, clamped to the lane range), and `endY` is passed
911
+ * to `state.addNode` **absolute and unconverted**. `addNode` performs the
912
+ * lane-relative conversion itself.
913
+ *
914
+ * This method previously did the opposite — pre-converting `endY` and passing
915
+ * the *source* lane — which made `addNode` subtract the lane offset twice, so
916
+ * the new stage rendered one lane too high and attached to the wrong
917
+ * swimlane. `designer-canvas.connection-drop.spec.ts` guards against the
918
+ * regression. Do not reintroduce a conversion here.
919
+ *
920
+ * Connecting a decision to a stage defers node creation until the branch
921
+ * condition is supplied, via {@link pendingDecisionConnection}.
922
+ */
923
+ createNodeConnection(nodeType: string): void {
924
+ const pathData = this.state.getConnectionPathData();
925
+ if (!pathData) {
926
+ this.hideConnectionPopup();
927
+ return;
928
+ }
929
+
930
+ // Check if this node type is allowed to be created
931
+ const allowedTypes = this.state.getAllowedTargetNodeTypes();
932
+ if (!allowedTypes.includes(nodeType)) {
933
+ this.hideConnectionPopup();
934
+ return;
935
+ }
936
+
937
+ const { endX, endY } = pathData;
938
+
939
+ // Determine the target swimlane from the drop position (NOT the source
940
+ // swimlane). `addNode` expects an absolute canvas Y plus the target
941
+ // swimlane index, and performs the swimlane-relative conversion itself.
942
+ let targetSwimlaneIndex = Math.floor(endY / this.swimlaneHeight);
943
+ targetSwimlaneIndex = Math.max(
944
+ 0,
945
+ Math.min(targetSwimlaneIndex, this.state.swimlanes.length - 1),
946
+ );
947
+
948
+ // Get source node info
949
+ const sourcePoint = this.state.draggingConnectionData.sourcePoint;
950
+ if (!sourcePoint) {
951
+ this.hideConnectionPopup();
952
+ return;
953
+ }
954
+
955
+ const sourceNodeInfo = this.state.findNodeById(sourcePoint.nodeId);
956
+ if (!sourceNodeInfo) {
957
+ this.hideConnectionPopup();
958
+ return;
959
+ }
960
+
961
+ // If connecting from a decision to a stage, show condition popup first
962
+ if (sourceNodeInfo.node.type === 'decision' && nodeType === 'stage') {
963
+ // Store information for later stage creation
964
+ this.pendingDecisionConnection = {
965
+ decisionNodeId: sourceNodeInfo.node.id,
966
+ swimlaneIndex: targetSwimlaneIndex,
967
+ x: endX,
968
+ y: endY,
969
+ };
970
+
971
+ // Center the popup over the connection endpoint
972
+ this.decisionConditionPopupX = endX;
973
+ this.decisionConditionPopupY = endY - 150; // Position above the endpoint
974
+
975
+ // Set decision node ID
976
+ this.activeDecisionNodeId = sourceNodeInfo.node.id;
977
+ this.showDecisionConditionDialog = true;
978
+
979
+ // End the connection drag
980
+ this.hideConnectionPopup();
981
+ return;
982
+ }
983
+
984
+ // Handle preconditions based on node type
985
+ if (nodeType === 'stage') {
986
+ // Create the stage in the target swimlane. `addNode` converts the
987
+ // absolute endY to a swimlane-relative position internally.
988
+ const newNode = this.state.addNode(
989
+ targetSwimlaneIndex,
990
+ 'stage',
991
+ endX,
992
+ endY,
993
+ { Name: 'New Stage' }, // Add default properties
994
+ );
995
+
996
+ if (
997
+ newNode &&
998
+ newNode.connectionPoints &&
999
+ newNode.connectionPoints.length > 0 &&
1000
+ sourcePoint
1001
+ ) {
1002
+ // Handle connection creation
1003
+ const opposingType = {
1004
+ right: 'left',
1005
+ left: 'right',
1006
+ top: 'bottom',
1007
+ bottom: 'top',
1008
+ }[sourcePoint.type] as 'top' | 'right' | 'bottom' | 'left';
1009
+
1010
+ const targetPoint = newNode.connectionPoints.find(
1011
+ (p) => p.type === opposingType,
1012
+ );
1013
+
1014
+ if (targetPoint) {
1015
+ // Create the connection
1016
+ const connection = this.state.createConnection(
1017
+ newNode.id,
1018
+ targetPoint.id,
1019
+ targetSwimlaneIndex,
1020
+ );
1021
+
1022
+ if (connection) {
1023
+ this.onConnectionCreated(connection);
1024
+ }
1025
+ }
1026
+ }
1027
+
1028
+ this.hideConnectionPopup();
1029
+ return;
1030
+ } else if (nodeType === 'subflow') {
1031
+ // Show workflow selection popup and store connection data for later use
1032
+ this.showSubflowSelectionPopup(endX, endY, targetSwimlaneIndex);
1033
+ this.hideConnectionPopup();
1034
+ return;
1035
+ }
1036
+
1037
+ // For other nodes Create the new node at the end position of the connection
1038
+ const newNode = this.state.addNode(
1039
+ targetSwimlaneIndex,
1040
+ nodeType as ToolType,
1041
+ endX,
1042
+ endY,
1043
+ );
1044
+
1045
+ if (
1046
+ newNode &&
1047
+ newNode.connectionPoints &&
1048
+ newNode.connectionPoints.length > 0
1049
+ ) {
1050
+ // Find the most appropriate connection point (closest to the source)
1051
+ if (sourcePoint) {
1052
+ // For simplicity, use the first connection point of opposing type
1053
+ // In a real implementation, you'd find the closest or most appropriate point
1054
+ let targetPoint;
1055
+
1056
+ // If source is on right, target should be on left, etc.
1057
+ const opposingType = {
1058
+ right: 'left',
1059
+ left: 'right',
1060
+ top: 'bottom',
1061
+ bottom: 'top',
1062
+ }[sourcePoint.type] as 'top' | 'right' | 'bottom' | 'left';
1063
+
1064
+ targetPoint = newNode.connectionPoints.find(
1065
+ (p) => p.type === opposingType,
1066
+ );
1067
+
1068
+ if (targetPoint) {
1069
+ // Create the connection
1070
+ const connection = this.state.createConnection(
1071
+ newNode.id,
1072
+ targetPoint.id,
1073
+ targetSwimlaneIndex,
1074
+ );
1075
+
1076
+ if (connection) {
1077
+ this.onConnectionCreated(connection);
1078
+ }
1079
+ }
1080
+ }
1081
+ }
1082
+
1083
+ if (sourceNodeInfo) {
1084
+ this.updateNodeConnections(sourceNodeInfo.node);
1085
+ }
1086
+
1087
+ // End the connection drag
1088
+ this.hideConnectionPopup();
1089
+ }
1090
+
1091
+ // Method to handle saving the condition
1092
+ onDecisionConditionSaved(event: {
1093
+ connectionId: string;
1094
+ condition: string;
1095
+ }): void {
1096
+ if (!this.pendingDecisionConnection) {
1097
+ this.showDecisionConditionDialog = false;
1098
+ return;
1099
+ }
1100
+
1101
+ const { decisionNodeId, swimlaneIndex, x, y } =
1102
+ this.pendingDecisionConnection;
1103
+
1104
+ // Create the stage directly with default properties
1105
+ const node = this.state.addNode(
1106
+ swimlaneIndex,
1107
+ 'stage',
1108
+ x,
1109
+ y,
1110
+ { Name: 'New Stage' }, // Add default properties
1111
+ );
1112
+
1113
+ if (node) {
1114
+ const decisionNodeInfo = this.state.findNodeById(decisionNodeId);
1115
+
1116
+ if (
1117
+ decisionNodeInfo &&
1118
+ node.connectionPoints &&
1119
+ node.connectionPoints.length > 0
1120
+ ) {
1121
+ // Find a suitable connection point from the decision node
1122
+ const decisionNode = decisionNodeInfo.node;
1123
+ const decisionNodePoints = decisionNode.connectionPoints || [];
1124
+ const sourcePoint = decisionNodePoints.find(
1125
+ (p) => p.type === 'right' || p.type === 'bottom',
1126
+ );
1127
+
1128
+ if (sourcePoint) {
1129
+ // Find opposing type connection point on the new stage
1130
+ const opposingType = {
1131
+ right: 'left',
1132
+ bottom: 'top',
1133
+ left: 'right',
1134
+ top: 'bottom',
1135
+ }[sourcePoint.type] as 'top' | 'right' | 'bottom' | 'left';
1136
+
1137
+ const targetPoint = node.connectionPoints.find(
1138
+ (p) => p.type === opposingType,
1139
+ );
1140
+
1141
+ if (targetPoint) {
1142
+ // Create connection with condition
1143
+ const connection = {
1144
+ id: `conn-${Date.now()}-${Math.floor(Math.random() * 1000)}`,
1145
+ sourceNodeId: decisionNode.id,
1146
+ targetNodeId: node.id,
1147
+ sourcePointId: sourcePoint.id,
1148
+ targetPointId: targetPoint.id,
1149
+ sourceSwimlaneIndex: decisionNodeInfo.swimlaneIndex,
1150
+ targetSwimlaneIndex: swimlaneIndex,
1151
+ condition: event.condition,
1152
+ label: '',
1153
+ action: null,
1154
+ position: 1,
1155
+ };
1156
+
1157
+ // Add connection to the state
1158
+ this.state.connections.push(connection);
1159
+ }
1160
+ }
1161
+ }
1162
+ }
1163
+
1164
+ // Clear pending data
1165
+ this.pendingDecisionConnection = null;
1166
+ this.pendingDecisionCondition = '';
1167
+
1168
+ // Hide the condition popup
1169
+ this.showDecisionConditionDialog = false;
1170
+ }
1171
+
1172
+ onDecisionConditionCancelled(): void {
1173
+ this.showDecisionConditionDialog = false;
1174
+ // Don't create the stage or connection
1175
+ }
1176
+
1177
+ getConnectionPath(): string {
1178
+ const pathData = this.state.getConnectionPathData();
1179
+ if (!pathData) return '';
1180
+
1181
+ const { startX, startY, endX, endY } = pathData;
1182
+ const sourcePoint = this.state.draggingConnectionData.sourcePoint;
1183
+
1184
+ if (!sourcePoint) return '';
1185
+
1186
+ return this.getOrthogonalPath(startX, startY, endX, endY, sourcePoint.type);
1187
+ }
1188
+
1189
+ getConnectionPathForSavedConnection(connection: Connection): string {
1190
+ try {
1191
+ const pathData = this.state.getConnectionData(connection);
1192
+ if (!pathData) {
1193
+ return '';
1194
+ }
1195
+
1196
+ const { startX, startY, endX, endY } = pathData;
1197
+
1198
+ const sourceNodeInfo = this.state.findNodeById(connection.sourceNodeId);
1199
+ if (!sourceNodeInfo) {
1200
+ return '';
1201
+ }
1202
+
1203
+ const sourceNode = sourceNodeInfo.node;
1204
+ const sourcePoint = sourceNode.connectionPoints?.find(
1205
+ (p) => p.id === connection.sourcePointId,
1206
+ );
1207
+
1208
+ if (!sourcePoint) {
1209
+ return '';
1210
+ }
1211
+
1212
+ return this.getOrthogonalPath(
1213
+ startX,
1214
+ startY,
1215
+ endX,
1216
+ endY,
1217
+ sourcePoint.type,
1218
+ );
1219
+ } catch (error) {
1220
+ return '';
1221
+ }
1222
+ }
1223
+
1224
+ getOrthogonalPath(
1225
+ startX: number,
1226
+ startY: number,
1227
+ endX: number,
1228
+ endY: number,
1229
+ pointType: 'top' | 'right' | 'bottom' | 'left',
1230
+ ): string {
1231
+ // Determine initial direction based on connection point type
1232
+ let path = '';
1233
+
1234
+ // For side points (left/right), start with horizontal line
1235
+ if (pointType === 'left' || pointType === 'right') {
1236
+ // Calculate horizontal distance
1237
+ const horizontalDist = endX - startX;
1238
+
1239
+ // If the end point is very close horizontally, use a simple 3-segment path
1240
+ if (Math.abs(horizontalDist) < 30) {
1241
+ const midY = (startY + endY) / 2;
1242
+ path = `M ${startX} ${startY} H ${endX} V ${midY} V ${endY}`;
1243
+ }
1244
+ // Otherwise, create a path with horizontal segment first, then vertical, then horizontal
1245
+ else {
1246
+ path = `M ${startX} ${startY} H ${
1247
+ startX + horizontalDist / 2
1248
+ } V ${endY} H ${endX}`;
1249
+ }
1250
+ }
1251
+ // For top/bottom points, start with vertical line
1252
+ else if (pointType === 'top' || pointType === 'bottom') {
1253
+ // Calculate vertical distance
1254
+ const verticalDist = endY - startY;
1255
+
1256
+ // If the end point is very close vertically, use a simple 3-segment path
1257
+ if (Math.abs(verticalDist) < 30) {
1258
+ const midX = (startX + endX) / 2;
1259
+ path = `M ${startX} ${startY} V ${endY} H ${midX} H ${endX}`;
1260
+ }
1261
+ // Otherwise, create a path with vertical segment first, then horizontal, then vertical
1262
+ else {
1263
+ path = `M ${startX} ${startY} V ${
1264
+ startY + verticalDist / 2
1265
+ } H ${endX} V ${endY}`;
1266
+ }
1267
+ }
1268
+
1269
+ return path;
1270
+ }
1271
+
1272
+ selectFormForStage(form: Form | null, node: Node) {
1273
+ // If form is null, we're clearing the selection
1274
+ if (node) {
1275
+ if (!node.stageData) {
1276
+ node.stageData = {};
1277
+ }
1278
+
1279
+ if (form) {
1280
+ node.stageData.formId = form.Code;
1281
+ node.stageData.formName = form.Name;
1282
+ } else {
1283
+ // Clear form selection
1284
+ delete node.stageData.formId;
1285
+ delete node.stageData.formName;
1286
+ }
1287
+
1288
+ // Emit an event to update the stage data
1289
+ this.onStagePropertiesUpdated({
1290
+ nodeId: node.id,
1291
+ stageData: node.stageData,
1292
+ });
1293
+ }
1294
+ }
1295
+
1296
+ onStagePropertiesUpdated(event: {
1297
+ nodeId: string;
1298
+ stageData: Partial<WorkflowStage>;
1299
+ }): void {
1300
+ // Find the node in the swimlanes
1301
+ for (let i = 0; i < this.state.swimlanes.length; i++) {
1302
+ const swimlane = this.state.swimlanes[i];
1303
+ const nodeIndex = swimlane.nodes?.findIndex((n) => n.id === event.nodeId);
1304
+
1305
+ if (nodeIndex !== undefined && nodeIndex >= 0) {
1306
+ // Update the stage data
1307
+ if (swimlane.nodes) {
1308
+ swimlane.nodes[nodeIndex].stageData = {
1309
+ ...swimlane.nodes[nodeIndex].stageData,
1310
+ ...event.stageData,
1311
+ };
1312
+ }
1313
+ break;
1314
+ }
1315
+ }
1316
+ }
1317
+
1318
+ onConnectionCreated(connection: Connection): void {
1319
+ // After a connection is created, refresh the source node to update its state
1320
+ const sourceNodeInfo = this.state.findNodeById(connection.sourceNodeId);
1321
+ if (sourceNodeInfo && sourceNodeInfo.node.type === 'stage') {
1322
+ // Refresh node state
1323
+ this.updateNodeConnections(sourceNodeInfo.node);
1324
+ }
1325
+ }
1326
+
1327
+ // Helper method to update node's connection status
1328
+ updateNodeConnections(node: WFNode): void {
1329
+ // Count the number of outgoing connections that connect to stages
1330
+ const outgoingConnections = this.state.connections.filter(
1331
+ (conn) => conn.sourceNodeId === node.id,
1332
+ );
1333
+
1334
+ // Check if the target nodes are stages
1335
+ const connectedStageNodes = outgoingConnections
1336
+ .map((conn) => this.state.findNodeById(conn.targetNodeId))
1337
+ .filter((nodeInfo) => nodeInfo && nodeInfo.node.type === 'stage');
1338
+
1339
+ node.hasMultipleConnectedStages = connectedStageNodes.length > 1;
1340
+ node.hasParallelStages = connectedStageNodes.every(
1341
+ (nd) => nd?.node.stageData?.IsParallel,
1342
+ );
1343
+ }
1344
+
1345
+ onEditSwimlane(
1346
+ event: MouseEvent,
1347
+ swimlane: SwimlaneItem,
1348
+ swimlaneIndex: number,
1349
+ ): void {
1350
+ event.stopPropagation(); // Prevent the canvas click event from firing
1351
+ event.preventDefault();
1352
+
1353
+ // Emit a special event for editing a swimlane
1354
+ this.clickedPosition.emit({
1355
+ x: -1, // Special value to indicate edit mode
1356
+ y: swimlaneIndex,
1357
+ });
1358
+ }
1359
+
1360
+ // showStartNodeFormPopup(event: MouseEvent): void {
1361
+ // event.preventDefault();
1362
+ // event.stopPropagation();
1363
+
1364
+ // // Implementation will be similar to the stage form popup
1365
+ // // We'll need to add UI elements for this
1366
+ // console.log('Start node form popup requested');
1367
+
1368
+ // // For now, this is a placeholder
1369
+ // // The actual implementation would load forms and add them to the workflow
1370
+ // }
1371
+
1372
+ toggleStartNodeFormPopup(
1373
+ event: MouseEvent,
1374
+ nodeX: number,
1375
+ nodeY: number,
1376
+ swimlaneIndex: number,
1377
+ node?: Node,
1378
+ ): void {
1379
+ event.preventDefault();
1380
+ event.stopPropagation();
1381
+
1382
+ // Set popup position - convert canvas coordinates to viewport coordinates
1383
+ const swimlaneOffset = swimlaneIndex * 263;
1384
+ const canvasX = nodeX - (!node ? 30 : 0);
1385
+ const canvasY = nodeY + swimlaneOffset;
1386
+
1387
+ const viewportPos = this.getViewportPosition(canvasX, canvasY);
1388
+ this.startNodeFormPopupX = viewportPos.x;
1389
+ this.startNodeFormPopupY = viewportPos.y;
1390
+
1391
+ // If we're opening the popup, load forms
1392
+ if (!this.showStartNodeFormPopup) {
1393
+ this.isLoadingStartNodeForms = true;
1394
+ this.dataService
1395
+ .getForms()
1396
+ .then((response) => {
1397
+ this.startNodeFormsList = response.Result;
1398
+ this.isLoadingStartNodeForms = false;
1399
+ })
1400
+ .catch((error) => {
1401
+ this.isLoadingStartNodeForms = false;
1402
+ });
1403
+ }
1404
+
1405
+ if (node) {
1406
+ this.activeNodeForFormSelection = node;
1407
+ } else {
1408
+ this.activeNodeForFormSelection = null;
1409
+ }
1410
+
1411
+ this.showStartNodeFormPopup = !this.showStartNodeFormPopup;
1412
+ }
1413
+
1414
+ selectStartNodeForm(form: Form | null): void {
1415
+ if (this.activeNodeForFormSelection) {
1416
+ this.selectFormForStage(form, this.activeNodeForFormSelection);
1417
+ } else {
1418
+ if (form) {
1419
+ this.state.setWorkflowForm(form.Code, form.Name);
1420
+ } else {
1421
+ this.state.setWorkflowForm(null, null);
1422
+ }
1423
+ }
1424
+
1425
+ // Close the popup
1426
+ this.showStartNodeFormPopup = false;
1427
+ }
1428
+
1429
+ showSubflowSelectionPopup(x: number, y: number, swimlaneIndex: number): void {
1430
+ // Convert canvas coordinates to viewport coordinates for popup positioning
1431
+ const viewportPos = this.getViewportPosition(x, y);
1432
+ this.subflowPopupX = viewportPos.x;
1433
+ this.subflowPopupY = viewportPos.y;
1434
+ this.pendingSubflowPosition = { swimlaneIndex, x, y };
1435
+
1436
+ // Store connection data if we're creating from a connection
1437
+ if (this.state.isConnectionDragging()) {
1438
+ // Store the source connection data
1439
+ this.pendingConnectionSourcePoint =
1440
+ this.state.draggingConnectionData.sourcePoint ?? null;
1441
+ this.pendingConnectionSourceSwimlaneIndex =
1442
+ this.state.draggingConnectionData.sourceSwimlaneIndex ?? null;
1443
+ }
1444
+
1445
+ // Load workflows
1446
+ this.isLoadingWorkflows = true;
1447
+ this.dataService
1448
+ .getWorkflows()
1449
+ .then((response) => {
1450
+ this.workflowsList = response.Result;
1451
+ this.isLoadingWorkflows = false;
1452
+ })
1453
+ .catch((error) => {
1454
+ this.isLoadingWorkflows = false;
1455
+ });
1456
+
1457
+ this.showSubflowPopup = true;
1458
+ }
1459
+
1460
+ selectSubflowWorkflow(workflow: Workflow): void {
1461
+ if (this.pendingSubflowPosition) {
1462
+ const { swimlaneIndex, x, y } = this.pendingSubflowPosition;
1463
+
1464
+ // Create the subflow node with the selected workflow data
1465
+ const node = this.state.addNode(
1466
+ swimlaneIndex,
1467
+ 'subflow',
1468
+ x,
1469
+ y,
1470
+ { Name: workflow.Name }, // Initialize stage name from workflow
1471
+ { id: workflow.Code, name: workflow.Name },
1472
+ );
1473
+
1474
+ // If this was created from a connection, create the connection
1475
+ if (node && this.pendingConnectionSourcePoint) {
1476
+ // Find a suitable connection point on the new node
1477
+ if (node.connectionPoints && node.connectionPoints.length > 0) {
1478
+ const sourcePoint = this.pendingConnectionSourcePoint;
1479
+
1480
+ // Find opposing type connection point
1481
+ const opposingType = {
1482
+ right: 'left',
1483
+ left: 'right',
1484
+ top: 'bottom',
1485
+ bottom: 'top',
1486
+ }[sourcePoint.type] as 'top' | 'right' | 'bottom' | 'left';
1487
+
1488
+ const targetPoint = node.connectionPoints.find(
1489
+ (p) => p.type === opposingType,
1490
+ );
1491
+
1492
+ if (targetPoint) {
1493
+ // Create connection
1494
+ const connection = {
1495
+ id: `conn-${Date.now()}-${Math.floor(Math.random() * 1000)}`,
1496
+ sourceNodeId: sourcePoint.nodeId,
1497
+ targetNodeId: node.id,
1498
+ sourcePointId: sourcePoint.id,
1499
+ targetPointId: targetPoint.id,
1500
+ sourceSwimlaneIndex: this.pendingConnectionSourceSwimlaneIndex!,
1501
+ targetSwimlaneIndex: swimlaneIndex,
1502
+ label: '',
1503
+ action: null,
1504
+ position: 1,
1505
+ };
1506
+
1507
+ // Add connection directly to the state's connections array
1508
+ this.state.connections.push(connection);
1509
+ this.onConnectionCreated(connection);
1510
+ }
1511
+ }
1512
+ this.state.endConnectionDrag();
1513
+ }
1514
+
1515
+ // Reset selection tool in parent component
1516
+ this.subflowSelected.emit();
1517
+ }
1518
+
1519
+ // Clean up
1520
+ this.showSubflowPopup = false;
1521
+ this.pendingSubflowPosition = null;
1522
+ this.pendingConnectionSourcePoint = null;
1523
+ this.pendingConnectionSourceSwimlaneIndex = null;
1524
+ }
1525
+
1526
+ showDecisionConditionsPopup(
1527
+ event: MouseEvent,
1528
+ node: WFNode,
1529
+ swimlaneIndex: number,
1530
+ ): void {
1531
+ event.preventDefault();
1532
+ event.stopPropagation();
1533
+
1534
+ // Get the position for the popup
1535
+ const position = this.getMousePosition(event);
1536
+
1537
+ // Convert canvas coordinates to viewport coordinates for popup positioning
1538
+ const viewportPos = this.getViewportPosition(position.x, position.y);
1539
+
1540
+ // Find all connections from this decision node
1541
+ const connections = this.state.connections.filter(
1542
+ (conn) => conn.sourceNodeId === node.id,
1543
+ );
1544
+
1545
+ if (connections.length === 0) {
1546
+ // No connections to show
1547
+ return;
1548
+ }
1549
+
1550
+ // Show the decision conditions popup
1551
+ this.activeDecisionNodeId = node.id;
1552
+ this.decisionConditionPopupX = viewportPos.x;
1553
+ this.decisionConditionPopupY = viewportPos.y;
1554
+
1555
+ // Set the correct popup visibility flag - this is likely the issue
1556
+ this.showDecisionConditionDialog = true;
1557
+
1558
+ // console.log('Showing decision popup:', {
1559
+ // y: globalY,
1560
+ // nodeId: node.id,
1561
+ // isVisible: this.showDecisionConditionDialog,
1562
+ // });
1563
+ }
1564
+
1565
+ ensureSwimlaneInView(swimlaneIndex: number): void {
1566
+ // Ensure we have enough swimlanes visible
1567
+ const requiredHeight = (swimlaneIndex + 1) * this.swimlaneHeight;
1568
+ if (this.canvasHeight < requiredHeight) {
1569
+ this.canvasHeight = requiredHeight;
1570
+ }
1571
+ }
1572
+
1573
+ getLabelPosition(connection: Connection): { x: number; y: number } {
1574
+ try {
1575
+ const pathData = this.state.getConnectionData(connection);
1576
+ if (!pathData) {
1577
+ return { x: 0, y: 0 };
1578
+ }
1579
+
1580
+ const { startX, startY, endX, endY } = pathData;
1581
+
1582
+ const sourceNodeInfo = this.state.findNodeById(connection.sourceNodeId);
1583
+ if (!sourceNodeInfo) {
1584
+ return { x: 0, y: 0 };
1585
+ }
1586
+
1587
+ const sourceNode = sourceNodeInfo.node;
1588
+ const sourcePoint = sourceNode.connectionPoints?.find(
1589
+ (p) => p.id === connection.sourcePointId,
1590
+ );
1591
+
1592
+ if (!sourcePoint) {
1593
+ return { x: 0, y: 0 };
1594
+ }
1595
+
1596
+ // Calculate midpoint based on the connection point type
1597
+ if (sourcePoint.type === 'left' || sourcePoint.type === 'right') {
1598
+ const horizontalDist = endX - startX;
1599
+
1600
+ if (Math.abs(horizontalDist) < 30) {
1601
+ // For short horizontal connections
1602
+ const midY = (startY + endY) / 2;
1603
+ return {
1604
+ x: startX + (endX - startX) / 2,
1605
+ y: midY,
1606
+ };
1607
+ } else {
1608
+ // For regular connections starting horizontally
1609
+ const midX = startX + horizontalDist / 2;
1610
+ const midY = endY;
1611
+ return {
1612
+ x: midX,
1613
+ y: (startY + endY) / 2,
1614
+ };
1615
+ }
1616
+ } else {
1617
+ // 'top' or 'bottom'
1618
+ const verticalDist = endY - startY;
1619
+
1620
+ if (Math.abs(verticalDist) < 30) {
1621
+ // For short vertical connections
1622
+ const midX = (startX + endX) / 2;
1623
+ return {
1624
+ x: midX,
1625
+ y: startY + (endY - startY) / 2,
1626
+ };
1627
+ } else {
1628
+ // For regular connections starting vertically
1629
+ const midX = endX;
1630
+ const midY = startY + verticalDist / 2;
1631
+ return {
1632
+ x: (startX + endX) / 2,
1633
+ y: midY,
1634
+ };
1635
+ }
1636
+ }
1637
+ } catch (error) {
1638
+ return { x: 0, y: 0 };
1639
+ }
1640
+ }
1641
+
1642
+ saveConnectionLabel(connection: Connection, label: string) {
1643
+ // Update the connection label in the state
1644
+ this.state.connections = this.state.connections.map((conn) => {
1645
+ if (conn.id === connection.id) {
1646
+ return {
1647
+ ...conn,
1648
+ label: label,
1649
+ };
1650
+ }
1651
+ return conn;
1652
+ });
1653
+ }
1654
+ }