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