@foblex/flow 12.6.5 → 12.6.7
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/bundles/foblex-flow.umd.js +2068 -1809
- package/bundles/foblex-flow.umd.js.map +1 -1
- package/domain/create-connection-markers/create-connection-markers.execution.d.ts +5 -1
- package/domain/f-background/add-pattern-to-background/add-pattern-to-background.execution.d.ts +14 -0
- package/domain/f-background/add-pattern-to-background/add-pattern-to-background.request.d.ts +5 -0
- package/domain/f-background/add-pattern-to-background/index.d.ts +2 -0
- package/domain/f-background/index.d.ts +2 -0
- package/domain/f-background/providers.d.ts +2 -0
- package/domain/{center-group-or-node → f-canvas/center-group-or-node}/center-group-or-node.execution.d.ts +1 -1
- package/domain/f-canvas/fit-to-flow/fit-to-flow-request.d.ts +6 -0
- package/domain/f-canvas/fit-to-flow/fit-to-flow.execution.d.ts +16 -0
- package/domain/f-canvas/fit-to-flow/index.d.ts +2 -0
- package/domain/f-canvas/index.d.ts +8 -0
- package/domain/f-canvas/input-canvas-position/index.d.ts +2 -0
- package/domain/f-canvas/input-canvas-position/input-canvas-position-request.d.ts +6 -0
- package/domain/f-canvas/input-canvas-position/input-canvas-position.execution.d.ts +11 -0
- package/domain/f-canvas/input-canvas-scale/index.d.ts +2 -0
- package/domain/f-canvas/input-canvas-scale/input-canvas-scale-request.d.ts +6 -0
- package/domain/f-canvas/input-canvas-scale/input-canvas-scale.execution.d.ts +11 -0
- package/domain/f-canvas/providers.d.ts +8 -0
- package/domain/f-canvas/reset-scale/index.d.ts +2 -0
- package/domain/f-canvas/reset-scale/reset-scale-request.d.ts +2 -0
- package/domain/f-canvas/reset-scale/reset-scale.execution.d.ts +12 -0
- package/domain/f-canvas/reset-scale-and-center/index.d.ts +2 -0
- package/domain/f-canvas/reset-scale-and-center/reset-scale-and-center-request.d.ts +4 -0
- package/domain/f-canvas/reset-scale-and-center/reset-scale-and-center.execution.d.ts +16 -0
- package/domain/f-canvas/update-scale/index.d.ts +2 -0
- package/domain/f-canvas/update-scale/update-scale-request.d.ts +6 -0
- package/domain/f-canvas/update-scale/update-scale.execution.d.ts +12 -0
- package/domain/f-connection/find-closest-input-using-snap-threshold/find-closest-input-using-snap-threshold.execution.d.ts +11 -0
- package/domain/f-connection/find-closest-input-using-snap-threshold/find-closest-input-using-snap-threshold.request.d.ts +8 -0
- package/domain/f-connection/find-closest-input-using-snap-threshold/index.d.ts +2 -0
- package/domain/f-connection/get-all-can-be-connected-input-positions/get-all-can-be-connected-input-positions.execution.d.ts +21 -0
- package/domain/f-connection/get-all-can-be-connected-input-positions/get-all-can-be-connected-input-positions.request.d.ts +4 -0
- package/domain/f-connection/get-all-can-be-connected-input-positions/index.d.ts +2 -0
- package/domain/f-connection/get-connector-with-rect/get-connector-with-rect-request.d.ts +5 -0
- package/domain/f-connection/get-connector-with-rect/get-connector-with-rect.execution.d.ts +11 -0
- package/domain/f-connection/get-connector-with-rect/i-connector-with-rect.d.ts +6 -0
- package/domain/f-connection/get-connector-with-rect/index.d.ts +3 -0
- package/domain/f-connection/index.d.ts +4 -0
- package/domain/f-connection/providers.d.ts +4 -0
- package/domain/{clear-selection → f-selection/clear-selection}/clear-selection.execution.d.ts +1 -1
- package/domain/{get-selection → f-selection/get-selection}/get-selection.execution.d.ts +1 -1
- package/domain/f-selection/index.d.ts +6 -0
- package/domain/f-selection/providers.d.ts +6 -0
- package/domain/{select → f-selection/select}/select.execution.d.ts +2 -2
- package/domain/{select-all → f-selection/select-all}/select-all.execution.d.ts +2 -2
- package/domain/{select-and-update-node-layer → f-selection/select-and-update-node-layer}/select-and-update-node-layer.execution.d.ts +2 -2
- package/domain/f-selection/select-and-update-node-layer/select-and-update-node-layer.request.d.ts +5 -0
- package/domain/index.d.ts +4 -8
- package/domain/providers.d.ts +1 -9
- package/esm2015/domain/create-connection-markers/create-connection-markers.execution.js +10 -5
- package/esm2015/domain/f-background/add-pattern-to-background/add-pattern-to-background.execution.js +48 -0
- package/esm2015/domain/f-background/add-pattern-to-background/add-pattern-to-background.request.js +6 -0
- package/esm2015/domain/f-background/add-pattern-to-background/index.js +3 -0
- package/esm2015/domain/f-background/index.js +3 -0
- package/esm2015/domain/f-background/providers.js +5 -0
- package/esm2015/domain/f-canvas/center-group-or-node/center-group-or-node-request.js +7 -0
- package/esm2015/domain/f-canvas/center-group-or-node/center-group-or-node.execution.js +49 -0
- package/esm2015/domain/f-canvas/center-group-or-node/index.js +3 -0
- package/esm2015/domain/f-canvas/fit-to-flow/fit-to-flow-request.js +7 -0
- package/esm2015/domain/f-canvas/fit-to-flow/fit-to-flow.execution.js +56 -0
- package/esm2015/domain/f-canvas/fit-to-flow/index.js +3 -0
- package/esm2015/domain/f-canvas/index.js +9 -0
- package/esm2015/domain/f-canvas/input-canvas-position/index.js +3 -0
- package/esm2015/domain/f-canvas/input-canvas-position/input-canvas-position-request.js +7 -0
- package/esm2015/domain/f-canvas/input-canvas-position/input-canvas-position.execution.js +34 -0
- package/esm2015/domain/f-canvas/input-canvas-scale/index.js +3 -0
- package/esm2015/domain/f-canvas/input-canvas-scale/input-canvas-scale-request.js +7 -0
- package/esm2015/domain/f-canvas/input-canvas-scale/input-canvas-scale.execution.js +29 -0
- package/esm2015/domain/f-canvas/providers.js +17 -0
- package/esm2015/domain/f-canvas/reset-scale/index.js +3 -0
- package/esm2015/domain/f-canvas/reset-scale/reset-scale-request.js +3 -0
- package/esm2015/domain/f-canvas/reset-scale/reset-scale.execution.js +29 -0
- package/esm2015/domain/f-canvas/reset-scale-and-center/index.js +3 -0
- package/esm2015/domain/f-canvas/reset-scale-and-center/reset-scale-and-center-request.js +6 -0
- package/esm2015/domain/f-canvas/reset-scale-and-center/reset-scale-and-center.execution.js +51 -0
- package/esm2015/domain/f-canvas/update-scale/index.js +3 -0
- package/esm2015/domain/f-canvas/update-scale/update-scale-request.js +7 -0
- package/esm2015/domain/f-canvas/update-scale/update-scale.execution.js +34 -0
- package/esm2015/domain/f-connection/find-closest-input-using-snap-threshold/find-closest-input-using-snap-threshold.execution.js +39 -0
- package/esm2015/domain/f-connection/find-closest-input-using-snap-threshold/find-closest-input-using-snap-threshold.request.js +8 -0
- package/esm2015/domain/f-connection/find-closest-input-using-snap-threshold/index.js +3 -0
- package/esm2015/domain/f-connection/get-all-can-be-connected-input-positions/get-all-can-be-connected-input-positions.execution.js +55 -0
- package/esm2015/domain/f-connection/get-all-can-be-connected-input-positions/get-all-can-be-connected-input-positions.request.js +6 -0
- package/esm2015/domain/f-connection/get-all-can-be-connected-input-positions/index.js +3 -0
- package/esm2015/domain/f-connection/get-connector-with-rect/get-connector-with-rect-request.js +6 -0
- package/esm2015/domain/f-connection/get-connector-with-rect/get-connector-with-rect.execution.js +28 -0
- package/esm2015/domain/f-connection/get-connector-with-rect/i-connector-with-rect.js +2 -0
- package/esm2015/domain/f-connection/get-connector-with-rect/index.js +4 -0
- package/esm2015/domain/f-connection/index.js +5 -0
- package/esm2015/domain/f-connection/providers.js +9 -0
- package/esm2015/domain/f-selection/clear-selection/clear-selection.execution.js +26 -0
- package/esm2015/domain/f-selection/clear-selection/clear-selection.request.js +3 -0
- package/esm2015/domain/f-selection/clear-selection/index.js +3 -0
- package/esm2015/domain/f-selection/get-selection/get-selection.execution.js +35 -0
- package/esm2015/domain/f-selection/get-selection/get-selection.request.js +3 -0
- package/esm2015/domain/f-selection/get-selection/index.js +3 -0
- package/esm2015/domain/f-selection/index.js +7 -0
- package/esm2015/domain/f-selection/providers.js +13 -0
- package/esm2015/domain/f-selection/select/index.js +3 -0
- package/esm2015/domain/f-selection/select/select.execution.js +44 -0
- package/esm2015/domain/f-selection/select/select.request.js +7 -0
- package/esm2015/domain/f-selection/select-all/index.js +3 -0
- package/esm2015/domain/f-selection/select-all/select-all.execution.js +38 -0
- package/esm2015/domain/f-selection/select-all/select-all.request.js +3 -0
- package/esm2015/domain/f-selection/select-and-update-node-layer/index.js +3 -0
- package/esm2015/domain/f-selection/select-and-update-node-layer/select-and-update-node-layer.execution.js +35 -0
- package/esm2015/domain/f-selection/select-and-update-node-layer/select-and-update-node-layer.request.js +6 -0
- package/esm2015/domain/index.js +5 -9
- package/esm2015/domain/providers.js +9 -17
- package/esm2015/domain/redraw-connections/redraw-connections.execution.js +4 -1
- package/esm2015/f-backgroud/domain/i-f-background-pattern.js +1 -1
- package/esm2015/f-backgroud/f-background.component.js +10 -28
- package/esm2015/f-canvas/f-canvas-base.js +12 -15
- package/esm2015/f-canvas/f-canvas.component.js +20 -44
- package/esm2015/f-connection/common/f-connection-base.js +1 -1
- package/esm2015/f-connection/f-connection/f-connection.component.js +1 -6
- package/esm2015/f-connection/f-connection-for-create/f-connection-for-create.component.js +1 -6
- package/esm2015/f-connection/f-snap-connection/f-snap-connection.component.js +13 -9
- package/esm2015/f-connection/providers.js +4 -2
- package/esm2015/f-connectors/f-node-input/index.js +1 -2
- package/esm2015/f-draggable/canvas/canvas.drag-handler.js +2 -2
- package/esm2015/f-draggable/connections/create-connection/create-connection-finalize/create-connection-finalize.execution.js +5 -5
- package/esm2015/f-draggable/connections/create-connection/create-connection-finalize/index.js +1 -2
- package/esm2015/f-draggable/connections/create-connection/create-connection-preparation/create-connection-drag-handler/create-connection-drag-handler.execution.js +4 -5
- package/esm2015/f-draggable/connections/create-connection/create-connection-preparation/create-connection-drag-handler/index.js +1 -2
- package/esm2015/f-draggable/connections/create-connection/create-connection-preparation/create-connection-from-outlet-preparation/index.js +1 -2
- package/esm2015/f-draggable/connections/create-connection/create-connection-preparation/create-connection-from-output-preparation/index.js +1 -2
- package/esm2015/f-draggable/connections/create-connection/create-connection-preparation/index.js +1 -2
- package/esm2015/f-draggable/connections/create-connection/create-connection.drag-handler.js +50 -20
- package/esm2015/f-draggable/connections/create-connection/get-can-be-connected-output-by-outlet/index.js +1 -2
- package/esm2015/f-draggable/connections/get-input-under-pointer/get-input-under-pointer.execution.js +20 -9
- package/esm2015/f-draggable/connections/get-input-under-pointer/get-input-under-pointer.validator.js +4 -4
- package/esm2015/f-draggable/connections/get-input-under-pointer/index.js +1 -2
- package/esm2015/f-draggable/connections/providers.js +20 -10
- package/esm2015/f-draggable/connections/reassign-connection/f-reassign-connection.event.js +3 -3
- package/esm2015/f-draggable/connections/reassign-connection/reassign-connection-finalize/index.js +1 -2
- package/esm2015/f-draggable/connections/reassign-connection/reassign-connection-finalize/reassign-connection-finalize.execution.js +4 -4
- package/esm2015/f-draggable/connections/reassign-connection/reassign-connection-preparation/index.js +1 -2
- package/esm2015/f-draggable/connections/reassign-connection/reassign-connection-preparation/reassign-connection-preparation.execution.js +2 -2
- package/esm2015/f-draggable/connections/reassign-connection/reassign-connection.drag-handler.js +50 -23
- package/esm2015/f-draggable/node/connection-base-drag-handler.js +17 -19
- package/esm2015/f-draggable/node/connection-source.drag-handler.js +5 -4
- package/esm2015/f-draggable/node/connection-target.drag-handler.js +5 -4
- package/esm2015/f-draggable/node/connection.drag-handler.js +5 -4
- package/esm2015/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/put-input-connection-handlers-to-array/put-input-connection-handlers-to-array.execution.js +3 -3
- package/esm2015/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/put-output-connection-handlers-to-array/put-output-connection-handlers-to-array.execution.js +3 -3
- package/esm2015/f-draggable/node/node-move-preparation/node-move-preparation.execution.js +2 -2
- package/esm2015/f-draggable/providers.js +4 -4
- package/esm2015/f-flow/f-flow.component.js +9 -8
- package/esm2015/f-flow.module.js +18 -17
- package/esm2015/f-minimap/domain/f-minimap.drag-handler.js +2 -2
- package/esm2015/f-minimap/domain/minimap-drag-preparation/minimap-drag-preparation.execution.js +2 -2
- package/esm2015/f-storage/f-components-store.js +1 -1
- package/esm2015/f-zoom/f-zoom-base.js +4 -4
- package/esm2015/mixins/index.js +1 -6
- package/f-backgroud/domain/i-f-background-pattern.d.ts +1 -0
- package/f-backgroud/f-background.component.d.ts +5 -4
- package/f-canvas/f-canvas-base.d.ts +8 -12
- package/f-canvas/f-canvas.component.d.ts +3 -1
- package/f-connection/common/f-connection-base.d.ts +0 -2
- package/f-connection/f-connection/f-connection.component.d.ts +0 -2
- package/f-connection/f-connection-for-create/f-connection-for-create.component.d.ts +0 -2
- package/f-connection/f-snap-connection/f-snap-connection.component.d.ts +2 -3
- package/f-connection/providers.d.ts +2 -1
- package/f-connectors/f-node-input/index.d.ts +0 -1
- package/f-draggable/connections/create-connection/create-connection-finalize/index.d.ts +0 -1
- package/f-draggable/connections/create-connection/create-connection-preparation/create-connection-drag-handler/index.d.ts +0 -1
- package/f-draggable/connections/create-connection/create-connection-preparation/create-connection-from-outlet-preparation/index.d.ts +0 -1
- package/f-draggable/connections/create-connection/create-connection-preparation/create-connection-from-output-preparation/index.d.ts +0 -1
- package/f-draggable/connections/create-connection/create-connection-preparation/index.d.ts +0 -1
- package/f-draggable/connections/create-connection/create-connection.drag-handler.d.ts +14 -5
- package/f-draggable/connections/create-connection/get-can-be-connected-output-by-outlet/index.d.ts +0 -1
- package/f-draggable/connections/get-input-under-pointer/get-input-under-pointer.execution.d.ts +7 -4
- package/f-draggable/connections/get-input-under-pointer/index.d.ts +0 -1
- package/f-draggable/connections/providers.d.ts +4 -1
- package/f-draggable/connections/reassign-connection/f-reassign-connection.event.d.ts +6 -6
- package/f-draggable/connections/reassign-connection/reassign-connection-finalize/index.d.ts +0 -1
- package/f-draggable/connections/reassign-connection/reassign-connection-preparation/index.d.ts +0 -1
- package/f-draggable/connections/reassign-connection/reassign-connection.drag-handler.d.ts +16 -7
- package/f-draggable/node/connection-base-drag-handler.d.ts +9 -7
- package/f-draggable/node/connection-source.drag-handler.d.ts +2 -1
- package/f-draggable/node/connection-target.drag-handler.d.ts +2 -1
- package/f-draggable/node/connection.drag-handler.d.ts +2 -1
- package/f-draggable/providers.d.ts +1 -1
- package/f-flow.module.d.ts +19 -18
- package/f-minimap/domain/providers.d.ts +1 -1
- package/f-storage/f-components-store.d.ts +1 -0
- package/fesm2015/foblex-flow.js +1700 -1480
- package/fesm2015/foblex-flow.js.map +1 -1
- package/mixins/index.d.ts +0 -5
- package/package.json +1 -1
- package/domain/get-input-rect-in-flow/get-input-rect-in-flow-request.d.ts +0 -4
- package/domain/get-input-rect-in-flow/get-input-rect-in-flow-response.d.ts +0 -7
- package/domain/get-input-rect-in-flow/get-input-rect-in-flow.execution.d.ts +0 -13
- package/domain/get-input-rect-in-flow/index.d.ts +0 -3
- package/domain/get-output-rect-in-flow/get-output-rect-in-flow-request.d.ts +0 -4
- package/domain/get-output-rect-in-flow/get-output-rect-in-flow-response.d.ts +0 -7
- package/domain/get-output-rect-in-flow/get-output-rect-in-flow.execution.d.ts +0 -13
- package/domain/get-output-rect-in-flow/index.d.ts +0 -3
- package/domain/select-and-update-node-layer/select-and-update-node-layer.request.d.ts +0 -5
- package/esm2015/domain/center-group-or-node/center-group-or-node-request.js +0 -7
- package/esm2015/domain/center-group-or-node/center-group-or-node.execution.js +0 -51
- package/esm2015/domain/center-group-or-node/index.js +0 -3
- package/esm2015/domain/clear-selection/clear-selection.execution.js +0 -26
- package/esm2015/domain/clear-selection/clear-selection.request.js +0 -3
- package/esm2015/domain/clear-selection/index.js +0 -3
- package/esm2015/domain/get-input-rect-in-flow/get-input-rect-in-flow-request.js +0 -6
- package/esm2015/domain/get-input-rect-in-flow/get-input-rect-in-flow-response.js +0 -7
- package/esm2015/domain/get-input-rect-in-flow/get-input-rect-in-flow.execution.js +0 -33
- package/esm2015/domain/get-input-rect-in-flow/index.js +0 -4
- package/esm2015/domain/get-output-rect-in-flow/get-output-rect-in-flow-request.js +0 -6
- package/esm2015/domain/get-output-rect-in-flow/get-output-rect-in-flow-response.js +0 -7
- package/esm2015/domain/get-output-rect-in-flow/get-output-rect-in-flow.execution.js +0 -37
- package/esm2015/domain/get-output-rect-in-flow/index.js +0 -4
- package/esm2015/domain/get-selection/get-selection.execution.js +0 -35
- package/esm2015/domain/get-selection/get-selection.request.js +0 -3
- package/esm2015/domain/get-selection/index.js +0 -3
- package/esm2015/domain/select/index.js +0 -3
- package/esm2015/domain/select/select.execution.js +0 -44
- package/esm2015/domain/select/select.request.js +0 -7
- package/esm2015/domain/select-all/index.js +0 -3
- package/esm2015/domain/select-all/select-all.execution.js +0 -38
- package/esm2015/domain/select-all/select-all.request.js +0 -3
- package/esm2015/domain/select-and-update-node-layer/index.js +0 -3
- package/esm2015/domain/select-and-update-node-layer/select-and-update-node-layer.execution.js +0 -35
- package/esm2015/domain/select-and-update-node-layer/select-and-update-node-layer.request.js +0 -6
- package/esm2015/f-connectors/f-node-input/is-node-input.js +0 -4
- package/esm2015/f-draggable/connections/create-connection/create-connection-finalize/providers.js +0 -7
- package/esm2015/f-draggable/connections/create-connection/create-connection-preparation/create-connection-drag-handler/providers.js +0 -5
- package/esm2015/f-draggable/connections/create-connection/create-connection-preparation/create-connection-from-outlet-preparation/providers.js +0 -5
- package/esm2015/f-draggable/connections/create-connection/create-connection-preparation/create-connection-from-output-preparation/providers.js +0 -7
- package/esm2015/f-draggable/connections/create-connection/create-connection-preparation/providers.js +0 -13
- package/esm2015/f-draggable/connections/create-connection/get-can-be-connected-output-by-outlet/providers.js +0 -7
- package/esm2015/f-draggable/connections/get-input-under-pointer/providers.js +0 -7
- package/esm2015/f-draggable/connections/reassign-connection/reassign-connection-finalize/providers.js +0 -7
- package/esm2015/f-draggable/connections/reassign-connection/reassign-connection-preparation/providers.js +0 -7
- package/esm2015/mixins/change-position.js +0 -15
- package/esm2015/mixins/change-zoom/change-zoom.js +0 -25
- package/esm2015/mixins/change-zoom/i-can-change-zoom.js +0 -2
- package/esm2015/mixins/change-zoom/index.js +0 -3
- package/esm2015/mixins/fit-to-parent/fit-to-parent.js +0 -27
- package/esm2015/mixins/fit-to-parent/i-can-fit-to-parent.js +0 -2
- package/esm2015/mixins/fit-to-parent/index.js +0 -3
- package/esm2015/mixins/i-transformable.js +0 -2
- package/esm2015/mixins/one-to-one-centering/i-can-one-to-one-centering.js +0 -2
- package/esm2015/mixins/one-to-one-centering/index.js +0 -3
- package/esm2015/mixins/one-to-one-centering/one-to-one-centering.js +0 -24
- package/f-connectors/f-node-input/is-node-input.d.ts +0 -1
- package/f-draggable/connections/create-connection/create-connection-finalize/providers.d.ts +0 -3
- package/f-draggable/connections/create-connection/create-connection-preparation/create-connection-drag-handler/providers.d.ts +0 -2
- package/f-draggable/connections/create-connection/create-connection-preparation/create-connection-from-outlet-preparation/providers.d.ts +0 -2
- package/f-draggable/connections/create-connection/create-connection-preparation/create-connection-from-output-preparation/providers.d.ts +0 -3
- package/f-draggable/connections/create-connection/create-connection-preparation/providers.d.ts +0 -3
- package/f-draggable/connections/create-connection/get-can-be-connected-output-by-outlet/providers.d.ts +0 -3
- package/f-draggable/connections/get-input-under-pointer/providers.d.ts +0 -3
- package/f-draggable/connections/reassign-connection/reassign-connection-finalize/providers.d.ts +0 -3
- package/f-draggable/connections/reassign-connection/reassign-connection-preparation/providers.d.ts +0 -3
- package/mixins/change-position.d.ts +0 -10
- package/mixins/change-zoom/change-zoom.d.ts +0 -6
- package/mixins/change-zoom/i-can-change-zoom.d.ts +0 -6
- package/mixins/change-zoom/index.d.ts +0 -2
- package/mixins/fit-to-parent/fit-to-parent.d.ts +0 -6
- package/mixins/fit-to-parent/i-can-fit-to-parent.d.ts +0 -4
- package/mixins/fit-to-parent/index.d.ts +0 -2
- package/mixins/i-transformable.d.ts +0 -4
- package/mixins/one-to-one-centering/i-can-one-to-one-centering.d.ts +0 -4
- package/mixins/one-to-one-centering/index.d.ts +0 -2
- package/mixins/one-to-one-centering/one-to-one-centering.d.ts +0 -6
- /package/domain/{center-group-or-node → f-canvas/center-group-or-node}/center-group-or-node-request.d.ts +0 -0
- /package/domain/{center-group-or-node → f-canvas/center-group-or-node}/index.d.ts +0 -0
- /package/domain/{clear-selection → f-selection/clear-selection}/clear-selection.request.d.ts +0 -0
- /package/domain/{clear-selection → f-selection/clear-selection}/index.d.ts +0 -0
- /package/domain/{get-selection → f-selection/get-selection}/get-selection.request.d.ts +0 -0
- /package/domain/{get-selection → f-selection/get-selection}/index.d.ts +0 -0
- /package/domain/{select → f-selection/select}/index.d.ts +0 -0
- /package/domain/{select → f-selection/select}/select.request.d.ts +0 -0
- /package/domain/{select-all → f-selection/select-all}/index.d.ts +0 -0
- /package/domain/{select-all → f-selection/select-all}/select-all.request.d.ts +0 -0
- /package/domain/{select-and-update-node-layer → f-selection/select-and-update-node-layer}/index.d.ts +0 -0
package/fesm2015/foblex-flow.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, Injectable, Directive, Input, HostBinding, EventEmitter, Output, Inject, Component, ChangeDetectionStrategy, ViewChild, Optional, ContentChildren, NgZone, ContentChild, NgModule } from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { RoundedRect, RectExtensions, TransformModelExtensions, PointExtensions, Point, SizeExtensions, LineExtensions, GetIntersections, Line } from '@foblex/2d';
|
|
4
4
|
import { Subject, Observable, Subscription, merge } from 'rxjs';
|
|
5
5
|
import { debounceTime, startWith } from 'rxjs/operators';
|
|
6
6
|
import { __decorate } from 'tslib';
|
|
7
7
|
import * as i2 from '@foblex/mediator';
|
|
8
8
|
import { FExecutionRegister, FValidatorRegister, FMediator } from '@foblex/mediator';
|
|
9
|
-
import { castToEnum, castToBoolean,
|
|
9
|
+
import { normalizeDomElementId, castToEnum, castToBoolean, flatMap, isClosestElementHasClass, getDataAttrValueFromClosestElementWithClass, deepCloneNode } from '@foblex/utils';
|
|
10
10
|
import * as i1 from '@foblex/platform';
|
|
11
11
|
import { EOperationSystem } from '@foblex/platform';
|
|
12
12
|
import * as i8 from '@angular/common';
|
|
@@ -15,15 +15,12 @@ import { DragAndDropBase, EventExtensions } from '@foblex/drag-toolkit';
|
|
|
15
15
|
|
|
16
16
|
const F_BACKGROUND_PATTERN = new InjectionToken('F_BACKGROUND_PATTERN');
|
|
17
17
|
|
|
18
|
-
class
|
|
19
|
-
constructor(
|
|
20
|
-
this.
|
|
21
|
-
this.animated = animated;
|
|
18
|
+
class CreateConnectionMarkersRequest {
|
|
19
|
+
constructor(fConnection) {
|
|
20
|
+
this.fConnection = fConnection;
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
const F_CANVAS_ANIMATION_DURATION = 150;
|
|
26
|
-
|
|
27
24
|
class FComponentsStore {
|
|
28
25
|
constructor() {
|
|
29
26
|
this.componentsDataChanges = new Subject();
|
|
@@ -84,6 +81,170 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
84
81
|
type: Injectable
|
|
85
82
|
}] });
|
|
86
83
|
|
|
84
|
+
let CreateConnectionMarkersExecution = class CreateConnectionMarkersExecution {
|
|
85
|
+
constructor(fBrowser, fComponentsStore) {
|
|
86
|
+
this.fBrowser = fBrowser;
|
|
87
|
+
this.fComponentsStore = fComponentsStore;
|
|
88
|
+
}
|
|
89
|
+
handle(request) {
|
|
90
|
+
const element = createSVGElement$1('defs', this.fBrowser);
|
|
91
|
+
const fConnection = request.fConnection;
|
|
92
|
+
this.getMarkers(fConnection).forEach((marker) => {
|
|
93
|
+
const markerElement = this.createMarkerElement(marker, fConnection.fId);
|
|
94
|
+
const clone = marker.hostElement.cloneNode(true);
|
|
95
|
+
clone.setAttribute('height', `${marker.height}`);
|
|
96
|
+
clone.setAttribute('width', `${marker.width}`);
|
|
97
|
+
clone.removeAttribute('markerUnits');
|
|
98
|
+
clone.style.display = 'unset';
|
|
99
|
+
markerElement.append(clone);
|
|
100
|
+
element.append(markerElement);
|
|
101
|
+
});
|
|
102
|
+
fConnection.fDefs.nativeElement.innerHTML = element.innerHTML;
|
|
103
|
+
this.makeSafariCompatible(fConnection);
|
|
104
|
+
}
|
|
105
|
+
getMarkers(fConnection) {
|
|
106
|
+
return this.fComponentsStore.fMarkers.filter((x) => fConnection.hostElement.contains(x.hostElement));
|
|
107
|
+
}
|
|
108
|
+
// Safari does not support markers on path elements if markers are defined after the path element
|
|
109
|
+
makeSafariCompatible(fConnection) {
|
|
110
|
+
fConnection.fPath.hostElement.replaceWith(fConnection.fPath.hostElement);
|
|
111
|
+
}
|
|
112
|
+
createMarkerElement(marker, fConnectionId) {
|
|
113
|
+
const markerElement = createSVGElement$1('marker', this.fBrowser);
|
|
114
|
+
markerElement.setAttribute('id', normalizeDomElementId(marker.type + '-' + fConnectionId));
|
|
115
|
+
markerElement.setAttribute('markerHeight', `${marker.height}`);
|
|
116
|
+
markerElement.setAttribute('markerWidth', `${marker.width}`);
|
|
117
|
+
markerElement.setAttribute('orient', `${marker.orient}`);
|
|
118
|
+
markerElement.setAttribute('refX', `${marker.refX}`);
|
|
119
|
+
markerElement.setAttribute('refY', `${marker.refY}`);
|
|
120
|
+
markerElement.setAttribute('markerUnits', `${marker.markerUnits}`);
|
|
121
|
+
return markerElement;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
CreateConnectionMarkersExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CreateConnectionMarkersExecution, deps: [{ token: i1.BrowserService }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
125
|
+
CreateConnectionMarkersExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CreateConnectionMarkersExecution });
|
|
126
|
+
CreateConnectionMarkersExecution = __decorate([
|
|
127
|
+
FExecutionRegister(CreateConnectionMarkersRequest)
|
|
128
|
+
], CreateConnectionMarkersExecution);
|
|
129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CreateConnectionMarkersExecution, decorators: [{
|
|
130
|
+
type: Injectable
|
|
131
|
+
}], ctorParameters: function () { return [{ type: i1.BrowserService }, { type: FComponentsStore }]; } });
|
|
132
|
+
function createSVGElement$1(tag, fBrowser) {
|
|
133
|
+
return fBrowser.document.createElementNS('http://www.w3.org/2000/svg', tag);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
class CreateRoundedRectFromElementRequest {
|
|
137
|
+
constructor(element) {
|
|
138
|
+
this.element = element;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
let CreateRoundedRectFromElementExecution = class CreateRoundedRectFromElementExecution {
|
|
143
|
+
constructor(fBrowser) {
|
|
144
|
+
this.fBrowser = fBrowser;
|
|
145
|
+
}
|
|
146
|
+
handle(request) {
|
|
147
|
+
return this.setRadiusFromElement(RoundedRect.fromRect(RectExtensions.fromElement(request.element)), request.element);
|
|
148
|
+
}
|
|
149
|
+
setRadiusFromElement(rect, element) {
|
|
150
|
+
const styles = this.getComputedStyle(element);
|
|
151
|
+
rect.radius1 = this.toPixels(styles.borderTopLeftRadius, element, styles.fontSize);
|
|
152
|
+
rect.radius2 = this.toPixels(styles.borderTopRightRadius, element, styles.fontSize);
|
|
153
|
+
rect.radius3 = this.toPixels(styles.borderBottomRightRadius, element, styles.fontSize);
|
|
154
|
+
rect.radius4 = this.toPixels(styles.borderBottomLeftRadius, element, styles.fontSize);
|
|
155
|
+
return rect;
|
|
156
|
+
}
|
|
157
|
+
getComputedStyle(element) {
|
|
158
|
+
return this.fBrowser.window.getComputedStyle(element);
|
|
159
|
+
}
|
|
160
|
+
toPixels(value, element, fontSize) {
|
|
161
|
+
return this.fBrowser.toPixels(value, element.clientWidth, element.clientHeight, fontSize) || 0;
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
CreateRoundedRectFromElementExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CreateRoundedRectFromElementExecution, deps: [{ token: i1.BrowserService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
165
|
+
CreateRoundedRectFromElementExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CreateRoundedRectFromElementExecution });
|
|
166
|
+
CreateRoundedRectFromElementExecution = __decorate([
|
|
167
|
+
FExecutionRegister(CreateRoundedRectFromElementRequest)
|
|
168
|
+
], CreateRoundedRectFromElementExecution);
|
|
169
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CreateRoundedRectFromElementExecution, decorators: [{
|
|
170
|
+
type: Injectable
|
|
171
|
+
}], ctorParameters: function () { return [{ type: i1.BrowserService }]; } });
|
|
172
|
+
|
|
173
|
+
class EmitTransformChangesRequest {
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
let EmitTransformChangesExecution = class EmitTransformChangesExecution {
|
|
177
|
+
constructor(fTransformStore) {
|
|
178
|
+
this.fTransformStore = fTransformStore;
|
|
179
|
+
}
|
|
180
|
+
handle(request) {
|
|
181
|
+
this.fTransformStore.changes.next();
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
EmitTransformChangesExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EmitTransformChangesExecution, deps: [{ token: FTransformStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
185
|
+
EmitTransformChangesExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EmitTransformChangesExecution });
|
|
186
|
+
EmitTransformChangesExecution = __decorate([
|
|
187
|
+
FExecutionRegister(EmitTransformChangesRequest)
|
|
188
|
+
], EmitTransformChangesExecution);
|
|
189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EmitTransformChangesExecution, decorators: [{
|
|
190
|
+
type: Injectable
|
|
191
|
+
}], ctorParameters: function () { return [{ type: FTransformStore }]; } });
|
|
192
|
+
|
|
193
|
+
class AddPatternToBackgroundRequest {
|
|
194
|
+
constructor(fPattern) {
|
|
195
|
+
this.fPattern = fPattern;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
let uniqueId$c = 0;
|
|
200
|
+
let AddPatternToBackgroundExecution = class AddPatternToBackgroundExecution {
|
|
201
|
+
constructor(fComponentsStore, fBrowser) {
|
|
202
|
+
this.fComponentsStore = fComponentsStore;
|
|
203
|
+
this.fBrowser = fBrowser;
|
|
204
|
+
}
|
|
205
|
+
get fBackground() {
|
|
206
|
+
return this.fComponentsStore.fBackground;
|
|
207
|
+
}
|
|
208
|
+
handle(request) {
|
|
209
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
210
|
+
const children = ((_a = request.fPattern) === null || _a === void 0 ? void 0 : _a.hostElement.getElementsByTagName('pattern')) || [];
|
|
211
|
+
const pattern = children.length ? children[0] : undefined;
|
|
212
|
+
if (pattern) {
|
|
213
|
+
const defs = createSVGElement('defs', this.fBrowser);
|
|
214
|
+
pattern.id = 'f-background-pattern-' + uniqueId$c++;
|
|
215
|
+
(_b = request.fPattern) === null || _b === void 0 ? void 0 : _b.hostElement.remove();
|
|
216
|
+
defs.appendChild(pattern);
|
|
217
|
+
(_d = (_c = this.fBackground.hostElement) === null || _c === void 0 ? void 0 : _c.firstChild) === null || _d === void 0 ? void 0 : _d.appendChild(defs);
|
|
218
|
+
const rect = createSVGElement('rect', this.fBrowser);
|
|
219
|
+
rect.setAttribute('fill', 'url(#' + pattern.id + ')');
|
|
220
|
+
rect.setAttribute('width', '100%');
|
|
221
|
+
rect.setAttribute('height', '100%');
|
|
222
|
+
(_e = this.fBackground.hostElement.firstChild) === null || _e === void 0 ? void 0 : _e.appendChild(rect);
|
|
223
|
+
const transform = ((_f = this.fComponentsStore.fCanvas) === null || _f === void 0 ? void 0 : _f.transform) || TransformModelExtensions.default();
|
|
224
|
+
(_g = request.fPattern) === null || _g === void 0 ? void 0 : _g.setTransform(transform);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
AddPatternToBackgroundExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AddPatternToBackgroundExecution, deps: [{ token: FComponentsStore }, { token: i1.BrowserService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
229
|
+
AddPatternToBackgroundExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AddPatternToBackgroundExecution });
|
|
230
|
+
AddPatternToBackgroundExecution = __decorate([
|
|
231
|
+
FExecutionRegister(AddPatternToBackgroundRequest)
|
|
232
|
+
], AddPatternToBackgroundExecution);
|
|
233
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AddPatternToBackgroundExecution, decorators: [{
|
|
234
|
+
type: Injectable
|
|
235
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: i1.BrowserService }]; } });
|
|
236
|
+
|
|
237
|
+
const F_BACKGROUND_FEATURES = [
|
|
238
|
+
AddPatternToBackgroundExecution
|
|
239
|
+
];
|
|
240
|
+
|
|
241
|
+
class CenterGroupOrNodeRequest {
|
|
242
|
+
constructor(id, animated) {
|
|
243
|
+
this.id = id;
|
|
244
|
+
this.animated = animated;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
87
248
|
let CenterGroupOrNodeExecution = class CenterGroupOrNodeExecution {
|
|
88
249
|
constructor(fComponentsStore) {
|
|
89
250
|
this.fComponentsStore = fComponentsStore;
|
|
@@ -98,10 +259,8 @@ let CenterGroupOrNodeExecution = class CenterGroupOrNodeExecution {
|
|
|
98
259
|
}
|
|
99
260
|
this.toCenter(this.getNodeRect(fNode), this.getFlowRect(), fNode.position);
|
|
100
261
|
request.animated ? this.fComponentsStore.fCanvas.redrawWithAnimation() : this.fComponentsStore.fCanvas.redraw();
|
|
101
|
-
this.fComponentsStore.fCanvas.
|
|
102
|
-
setTimeout(() =>
|
|
103
|
-
this.fComponentsStore.componentDataChanged();
|
|
104
|
-
}, F_CANVAS_ANIMATION_DURATION);
|
|
262
|
+
this.fComponentsStore.fCanvas.emitCanvasChangeEvent();
|
|
263
|
+
setTimeout(() => this.fComponentsStore.componentDataChanged(), F_CANVAS_ANIMATION_DURATION);
|
|
105
264
|
}
|
|
106
265
|
toCenter(fNodeRect, fFlowRect, position) {
|
|
107
266
|
this.transform.scaledPosition = PointExtensions.initialize();
|
|
@@ -126,91 +285,484 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
126
285
|
type: Injectable
|
|
127
286
|
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
128
287
|
|
|
129
|
-
class
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
constructor(event) {
|
|
134
|
-
this.event = event;
|
|
288
|
+
class FitToFlowRequest {
|
|
289
|
+
constructor(toCenter, animated) {
|
|
290
|
+
this.toCenter = toCenter;
|
|
291
|
+
this.animated = animated;
|
|
135
292
|
}
|
|
136
293
|
}
|
|
137
294
|
|
|
138
|
-
class
|
|
139
|
-
constructor() {
|
|
140
|
-
this.
|
|
141
|
-
this.
|
|
142
|
-
this.onPointerDownScale = 1;
|
|
143
|
-
this.onPointerDownPosition = new Point(0, 0);
|
|
144
|
-
this.draggableItems = [];
|
|
295
|
+
let FitToFlowExecution = class FitToFlowExecution {
|
|
296
|
+
constructor(fComponentsStore, fMediator) {
|
|
297
|
+
this.fComponentsStore = fComponentsStore;
|
|
298
|
+
this.fMediator = fMediator;
|
|
145
299
|
}
|
|
146
|
-
|
|
147
|
-
this.
|
|
148
|
-
this.onPointerDownScale = 1;
|
|
149
|
-
this.onPointerDownPosition = new Point(0, 0);
|
|
300
|
+
get transform() {
|
|
301
|
+
return this.fComponentsStore.fCanvas.transform;
|
|
150
302
|
}
|
|
151
|
-
|
|
152
|
-
this.
|
|
303
|
+
handle(request) {
|
|
304
|
+
const fNodesRect = this.fMediator.send(new GetNodesRectRequest()) || RectExtensions.initialize();
|
|
305
|
+
if (fNodesRect.width === 0 || fNodesRect.height === 0) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
this.fitToParent(fNodesRect, RectExtensions.fromElement(this.fComponentsStore.fFlow.hostElement), this.fComponentsStore.fNodes.map((x) => x.position), request.toCenter);
|
|
309
|
+
request.animated ? this.fComponentsStore.fCanvas.redrawWithAnimation() : this.fComponentsStore.fCanvas.redraw();
|
|
310
|
+
this.fComponentsStore.fCanvas.emitCanvasChangeEvent();
|
|
311
|
+
setTimeout(() => this.fComponentsStore.componentDataChanged(), F_CANVAS_ANIMATION_DURATION);
|
|
153
312
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
313
|
+
fitToParent(rect, parentRect, points, toCenter) {
|
|
314
|
+
this.transform.scaledPosition = PointExtensions.initialize();
|
|
315
|
+
this.transform.position = this.getZeroPositionWithoutScale(points);
|
|
316
|
+
const itemsContainerWidth = (rect.width / this.transform.scale) + toCenter.x;
|
|
317
|
+
const itemsContainerHeight = (rect.height / this.transform.scale) + toCenter.y;
|
|
318
|
+
if ((itemsContainerWidth > parentRect.width || itemsContainerHeight > parentRect.height) ||
|
|
319
|
+
itemsContainerWidth < parentRect.width && itemsContainerHeight < parentRect.height) {
|
|
320
|
+
this.transform.scale = Math.min(parentRect.width / itemsContainerWidth, parentRect.height / itemsContainerHeight);
|
|
321
|
+
}
|
|
322
|
+
const newX = (parentRect.width - itemsContainerWidth * this.transform.scale) / 2 - this.transform.position.x * this.transform.scale;
|
|
323
|
+
const newY = (parentRect.height - itemsContainerHeight * this.transform.scale) / 2 - this.transform.position.y * this.transform.scale;
|
|
324
|
+
this.transform.position = PointExtensions.initialize(newX + (toCenter.x / 2) * this.transform.scale, newY + (toCenter.y / 2) * this.transform.scale);
|
|
325
|
+
}
|
|
326
|
+
getZeroPositionWithoutScale(points) {
|
|
327
|
+
const xPoint = points.length ? Math.min(...points.map((point) => point.x)) : 0;
|
|
328
|
+
const yPoint = points.length ? Math.min(...points.map((point) => point.y)) : 0;
|
|
329
|
+
return PointExtensions.initialize(xPoint, yPoint);
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
FitToFlowExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FitToFlowExecution, deps: [{ token: FComponentsStore }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
333
|
+
FitToFlowExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FitToFlowExecution });
|
|
334
|
+
FitToFlowExecution = __decorate([
|
|
335
|
+
FExecutionRegister(FitToFlowRequest)
|
|
336
|
+
], FitToFlowExecution);
|
|
337
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FitToFlowExecution, decorators: [{
|
|
158
338
|
type: Injectable
|
|
159
|
-
}] });
|
|
339
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: i2.FMediator }]; } });
|
|
160
340
|
|
|
161
|
-
|
|
162
|
-
constructor(
|
|
163
|
-
this.
|
|
341
|
+
class InputCanvasPositionRequest {
|
|
342
|
+
constructor(transform, position) {
|
|
343
|
+
this.transform = transform;
|
|
344
|
+
this.position = position;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
let InputCanvasPositionExecution = class InputCanvasPositionExecution {
|
|
349
|
+
constructor(fComponentsStore) {
|
|
350
|
+
this.fComponentsStore = fComponentsStore;
|
|
164
351
|
}
|
|
165
352
|
handle(request) {
|
|
166
|
-
|
|
353
|
+
var _a;
|
|
354
|
+
if (!request.position) {
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
const position = PointExtensions.sum(request.transform.position, request.transform.scaledPosition);
|
|
358
|
+
if (!PointExtensions.isEqual(position, request.position)) {
|
|
359
|
+
request.transform.position = request.position;
|
|
360
|
+
request.transform.scaledPosition = PointExtensions.initialize();
|
|
361
|
+
(_a = this.fComponentsStore.fCanvas) === null || _a === void 0 ? void 0 : _a.redraw();
|
|
362
|
+
}
|
|
167
363
|
}
|
|
168
364
|
};
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
FExecutionRegister(
|
|
173
|
-
],
|
|
174
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
365
|
+
InputCanvasPositionExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: InputCanvasPositionExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
366
|
+
InputCanvasPositionExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: InputCanvasPositionExecution });
|
|
367
|
+
InputCanvasPositionExecution = __decorate([
|
|
368
|
+
FExecutionRegister(InputCanvasPositionRequest)
|
|
369
|
+
], InputCanvasPositionExecution);
|
|
370
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: InputCanvasPositionExecution, decorators: [{
|
|
175
371
|
type: Injectable
|
|
176
|
-
}], ctorParameters: function () { return [{ type:
|
|
372
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
177
373
|
|
|
178
|
-
class
|
|
374
|
+
class InputCanvasScaleRequest {
|
|
375
|
+
constructor(transform, scale) {
|
|
376
|
+
this.transform = transform;
|
|
377
|
+
this.scale = scale;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
let InputCanvasScaleExecution = class InputCanvasScaleExecution {
|
|
179
382
|
constructor(fComponentsStore) {
|
|
180
383
|
this.fComponentsStore = fComponentsStore;
|
|
181
|
-
this.onPointerDownPosition = PointExtensions.initialize();
|
|
182
|
-
}
|
|
183
|
-
initialize() {
|
|
184
|
-
this.onPointerDownPosition = this.fComponentsStore.fCanvas.transform.position;
|
|
185
|
-
}
|
|
186
|
-
move(difference) {
|
|
187
|
-
this.fComponentsStore.fCanvas.setPosition(Point.fromPoint(this.onPointerDownPosition).add(difference));
|
|
188
|
-
this.fComponentsStore.fCanvas.redraw();
|
|
189
384
|
}
|
|
190
|
-
|
|
191
|
-
|
|
385
|
+
handle(request) {
|
|
386
|
+
var _a;
|
|
387
|
+
if (!request.scale) {
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
request.transform.scale = request.scale;
|
|
391
|
+
(_a = this.fComponentsStore.fCanvas) === null || _a === void 0 ? void 0 : _a.redraw();
|
|
192
392
|
}
|
|
393
|
+
};
|
|
394
|
+
InputCanvasScaleExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: InputCanvasScaleExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
395
|
+
InputCanvasScaleExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: InputCanvasScaleExecution });
|
|
396
|
+
InputCanvasScaleExecution = __decorate([
|
|
397
|
+
FExecutionRegister(InputCanvasScaleRequest)
|
|
398
|
+
], InputCanvasScaleExecution);
|
|
399
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: InputCanvasScaleExecution, decorators: [{
|
|
400
|
+
type: Injectable
|
|
401
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
402
|
+
|
|
403
|
+
class ResetScaleRequest {
|
|
193
404
|
}
|
|
194
405
|
|
|
195
|
-
let
|
|
196
|
-
constructor(
|
|
197
|
-
this.
|
|
406
|
+
let ResetScaleExecution = class ResetScaleExecution {
|
|
407
|
+
constructor(fComponentsStore) {
|
|
408
|
+
this.fComponentsStore = fComponentsStore;
|
|
409
|
+
}
|
|
410
|
+
get transform() {
|
|
411
|
+
return this.fComponentsStore.fCanvas.transform;
|
|
198
412
|
}
|
|
199
413
|
handle(request) {
|
|
200
|
-
|
|
414
|
+
this.transform.scale = 1;
|
|
415
|
+
this.transform.scaledPosition = PointExtensions.initialize();
|
|
201
416
|
}
|
|
202
417
|
};
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
],
|
|
208
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
418
|
+
ResetScaleExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ResetScaleExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
419
|
+
ResetScaleExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ResetScaleExecution });
|
|
420
|
+
ResetScaleExecution = __decorate([
|
|
421
|
+
FExecutionRegister(ResetScaleRequest)
|
|
422
|
+
], ResetScaleExecution);
|
|
423
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ResetScaleExecution, decorators: [{
|
|
209
424
|
type: Injectable
|
|
210
|
-
}], ctorParameters: function () { return [{ type:
|
|
425
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
211
426
|
|
|
212
|
-
|
|
213
|
-
|
|
427
|
+
class ResetScaleAndCenterRequest {
|
|
428
|
+
constructor(animated) {
|
|
429
|
+
this.animated = animated;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
let ResetScaleAndCenterExecution = class ResetScaleAndCenterExecution {
|
|
434
|
+
constructor(fComponentsStore, fMediator) {
|
|
435
|
+
this.fComponentsStore = fComponentsStore;
|
|
436
|
+
this.fMediator = fMediator;
|
|
437
|
+
}
|
|
438
|
+
get transform() {
|
|
439
|
+
return this.fComponentsStore.fCanvas.transform;
|
|
440
|
+
}
|
|
441
|
+
handle(request) {
|
|
442
|
+
const fNodesRect = this.fMediator.send(new GetNodesRectRequest()) || RectExtensions.initialize();
|
|
443
|
+
if (fNodesRect.width === 0 || fNodesRect.height === 0) {
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
this.oneToOneCentering(fNodesRect, RectExtensions.fromElement(this.fComponentsStore.fFlow.hostElement), this.fComponentsStore.fNodes.map((x) => x.position));
|
|
447
|
+
request.animated ? this.fComponentsStore.fCanvas.redrawWithAnimation() : this.fComponentsStore.fCanvas.redraw();
|
|
448
|
+
this.fComponentsStore.fCanvas.emitCanvasChangeEvent();
|
|
449
|
+
setTimeout(() => this.fComponentsStore.componentDataChanged(), F_CANVAS_ANIMATION_DURATION);
|
|
450
|
+
}
|
|
451
|
+
oneToOneCentering(rect, parentRect, points) {
|
|
452
|
+
this.transform.scaledPosition = PointExtensions.initialize();
|
|
453
|
+
this.transform.position = this.getZeroPositionWithoutScale(points);
|
|
454
|
+
const newX = (parentRect.width - rect.width / this.transform.scale) / 2 - this.transform.position.x;
|
|
455
|
+
const newY = (parentRect.height - rect.height / this.transform.scale) / 2 - this.transform.position.y;
|
|
456
|
+
this.transform.scale = 1;
|
|
457
|
+
this.transform.position = PointExtensions.initialize(newX, newY);
|
|
458
|
+
}
|
|
459
|
+
getZeroPositionWithoutScale(points) {
|
|
460
|
+
const xPoint = points.length ? Math.min(...points.map((point) => point.x)) : 0;
|
|
461
|
+
const yPoint = points.length ? Math.min(...points.map((point) => point.y)) : 0;
|
|
462
|
+
return PointExtensions.initialize(xPoint, yPoint);
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
ResetScaleAndCenterExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ResetScaleAndCenterExecution, deps: [{ token: FComponentsStore }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
466
|
+
ResetScaleAndCenterExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ResetScaleAndCenterExecution });
|
|
467
|
+
ResetScaleAndCenterExecution = __decorate([
|
|
468
|
+
FExecutionRegister(ResetScaleAndCenterRequest)
|
|
469
|
+
], ResetScaleAndCenterExecution);
|
|
470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ResetScaleAndCenterExecution, decorators: [{
|
|
471
|
+
type: Injectable
|
|
472
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: i2.FMediator }]; } });
|
|
473
|
+
|
|
474
|
+
class UpdateScaleRequest {
|
|
475
|
+
constructor(scale, toPosition) {
|
|
476
|
+
this.scale = scale;
|
|
477
|
+
this.toPosition = toPosition;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
let UpdateScaleExecution = class UpdateScaleExecution {
|
|
482
|
+
constructor(fComponentsStore) {
|
|
483
|
+
this.fComponentsStore = fComponentsStore;
|
|
484
|
+
}
|
|
485
|
+
get transform() {
|
|
486
|
+
return this.fComponentsStore.fCanvas.transform;
|
|
487
|
+
}
|
|
488
|
+
handle(request) {
|
|
489
|
+
if (request.scale !== this.transform.scale) {
|
|
490
|
+
const summaryPosition = PointExtensions.sum(this.transform.scaledPosition, this.transform.position);
|
|
491
|
+
const newX = request.toPosition.x - (request.toPosition.x - summaryPosition.x) * request.scale / this.transform.scale;
|
|
492
|
+
const newY = request.toPosition.y - (request.toPosition.y - summaryPosition.y) * request.scale / this.transform.scale;
|
|
493
|
+
this.transform.scale = request.scale;
|
|
494
|
+
this.transform.scaledPosition = PointExtensions.sub(PointExtensions.initialize(newX, newY), this.transform.position);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
UpdateScaleExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: UpdateScaleExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
499
|
+
UpdateScaleExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: UpdateScaleExecution });
|
|
500
|
+
UpdateScaleExecution = __decorate([
|
|
501
|
+
FExecutionRegister(UpdateScaleRequest)
|
|
502
|
+
], UpdateScaleExecution);
|
|
503
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: UpdateScaleExecution, decorators: [{
|
|
504
|
+
type: Injectable
|
|
505
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
506
|
+
|
|
507
|
+
const F_CANVAS_FEATURES = [
|
|
508
|
+
CenterGroupOrNodeExecution,
|
|
509
|
+
FitToFlowExecution,
|
|
510
|
+
InputCanvasPositionExecution,
|
|
511
|
+
InputCanvasScaleExecution,
|
|
512
|
+
ResetScaleExecution,
|
|
513
|
+
ResetScaleAndCenterExecution,
|
|
514
|
+
UpdateScaleExecution
|
|
515
|
+
];
|
|
516
|
+
|
|
517
|
+
class FindClosestInputUsingSnapThresholdRequest {
|
|
518
|
+
constructor(position, canBeConnectedInputs, snapThreshold) {
|
|
519
|
+
this.position = position;
|
|
520
|
+
this.canBeConnectedInputs = canBeConnectedInputs;
|
|
521
|
+
this.snapThreshold = snapThreshold;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
let FindClosestInputUsingSnapThresholdExecution = class FindClosestInputUsingSnapThresholdExecution {
|
|
526
|
+
handle(payload) {
|
|
527
|
+
let result;
|
|
528
|
+
let minDistance = Infinity;
|
|
529
|
+
for (const element of payload.canBeConnectedInputs) {
|
|
530
|
+
const distance = this.distanceToRectangle(payload.position, element);
|
|
531
|
+
if (distance < minDistance) {
|
|
532
|
+
minDistance = distance;
|
|
533
|
+
result = element;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
return minDistance < payload.snapThreshold ? result : undefined;
|
|
537
|
+
}
|
|
538
|
+
distanceToRectangle(point, inputWithRect) {
|
|
539
|
+
const closestX = this.clamp(point.x, inputWithRect.fRect.x, inputWithRect.fRect.x + inputWithRect.fRect.width);
|
|
540
|
+
const closestY = this.clamp(point.y, inputWithRect.fRect.y, inputWithRect.fRect.y + inputWithRect.fRect.height);
|
|
541
|
+
const dx = point.x - closestX;
|
|
542
|
+
const dy = point.y - closestY;
|
|
543
|
+
return Math.sqrt(dx * dx + dy * dy);
|
|
544
|
+
}
|
|
545
|
+
clamp(value, min, max) {
|
|
546
|
+
return Math.max(min, Math.min(max, value));
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
FindClosestInputUsingSnapThresholdExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FindClosestInputUsingSnapThresholdExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
550
|
+
FindClosestInputUsingSnapThresholdExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FindClosestInputUsingSnapThresholdExecution });
|
|
551
|
+
FindClosestInputUsingSnapThresholdExecution = __decorate([
|
|
552
|
+
FExecutionRegister(FindClosestInputUsingSnapThresholdRequest)
|
|
553
|
+
], FindClosestInputUsingSnapThresholdExecution);
|
|
554
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FindClosestInputUsingSnapThresholdExecution, decorators: [{
|
|
555
|
+
type: Injectable
|
|
556
|
+
}] });
|
|
557
|
+
|
|
558
|
+
class GetAllCanBeConnectedInputPositionsRequest {
|
|
559
|
+
constructor(fOutputId) {
|
|
560
|
+
this.fOutputId = fOutputId;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
class GetConnectorWithRectRequest {
|
|
565
|
+
constructor(connector) {
|
|
566
|
+
this.connector = connector;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
class GetElementRectInFlowRequest {
|
|
571
|
+
constructor(element) {
|
|
572
|
+
this.element = element;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
let GetElementRectInFlowExecution = class GetElementRectInFlowExecution {
|
|
577
|
+
constructor(fComponentsStore, fMediator) {
|
|
578
|
+
this.fComponentsStore = fComponentsStore;
|
|
579
|
+
this.fMediator = fMediator;
|
|
580
|
+
}
|
|
581
|
+
get transform() {
|
|
582
|
+
return this.fComponentsStore.transform;
|
|
583
|
+
}
|
|
584
|
+
get flowHost() {
|
|
585
|
+
return this.fComponentsStore.flowHost;
|
|
586
|
+
}
|
|
587
|
+
handle(request) {
|
|
588
|
+
const systemRect = this.fMediator.send(new CreateRoundedRectFromElementRequest(request.element));
|
|
589
|
+
const position = this.transformElementPositionInFlow(systemRect);
|
|
590
|
+
const size = this.transformElementSizeInFlow(systemRect);
|
|
591
|
+
return new RoundedRect(position.x, position.y, size.width, size.height, systemRect.radius1, systemRect.radius2, systemRect.radius3, systemRect.radius4);
|
|
592
|
+
}
|
|
593
|
+
transformElementPositionInFlow(rect) {
|
|
594
|
+
return Point.fromPoint(rect).elementTransform(this.flowHost).sub(this.transform.scaledPosition).sub(this.transform.position).div(this.transform.scale);
|
|
595
|
+
}
|
|
596
|
+
transformElementSizeInFlow(rect) {
|
|
597
|
+
return SizeExtensions.initialize(rect.width / this.transform.scale, rect.height / this.transform.scale);
|
|
598
|
+
}
|
|
599
|
+
};
|
|
600
|
+
GetElementRectInFlowExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetElementRectInFlowExecution, deps: [{ token: FComponentsStore }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
601
|
+
GetElementRectInFlowExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetElementRectInFlowExecution });
|
|
602
|
+
GetElementRectInFlowExecution = __decorate([
|
|
603
|
+
FExecutionRegister(GetElementRectInFlowRequest)
|
|
604
|
+
], GetElementRectInFlowExecution);
|
|
605
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetElementRectInFlowExecution, decorators: [{
|
|
606
|
+
type: Injectable
|
|
607
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: i2.FMediator }]; } });
|
|
608
|
+
|
|
609
|
+
let GetConnectorWithRectExecution = class GetConnectorWithRectExecution {
|
|
610
|
+
constructor(fMediator) {
|
|
611
|
+
this.fMediator = fMediator;
|
|
612
|
+
}
|
|
613
|
+
handle(request) {
|
|
614
|
+
return {
|
|
615
|
+
fConnector: request.connector,
|
|
616
|
+
fRect: this.fMediator.send(new GetElementRectInFlowRequest(request.connector.hostElement))
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
};
|
|
620
|
+
GetConnectorWithRectExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetConnectorWithRectExecution, deps: [{ token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
621
|
+
GetConnectorWithRectExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetConnectorWithRectExecution });
|
|
622
|
+
GetConnectorWithRectExecution = __decorate([
|
|
623
|
+
FExecutionRegister(GetConnectorWithRectRequest)
|
|
624
|
+
], GetConnectorWithRectExecution);
|
|
625
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetConnectorWithRectExecution, decorators: [{
|
|
626
|
+
type: Injectable
|
|
627
|
+
}], ctorParameters: function () { return [{ type: i2.FMediator }]; } });
|
|
628
|
+
|
|
629
|
+
let GetAllCanBeConnectedInputPositionsExecution = class GetAllCanBeConnectedInputPositionsExecution {
|
|
630
|
+
constructor(fComponentsStore, fMediator) {
|
|
631
|
+
this.fComponentsStore = fComponentsStore;
|
|
632
|
+
this.fMediator = fMediator;
|
|
633
|
+
}
|
|
634
|
+
get fNodes() {
|
|
635
|
+
return this.fComponentsStore.fNodes;
|
|
636
|
+
}
|
|
637
|
+
get fInputs() {
|
|
638
|
+
return this.fComponentsStore.fInputs;
|
|
639
|
+
}
|
|
640
|
+
handle(payload) {
|
|
641
|
+
return this.getCanBeConnectedInputs(this.getOutput(payload.fOutputId)).map((x) => {
|
|
642
|
+
return this.fMediator.send(new GetConnectorWithRectRequest(x));
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
getOutput(fId) {
|
|
646
|
+
return this.findOutputById(fId) || this.findOutletById(fId);
|
|
647
|
+
}
|
|
648
|
+
findOutputById(fId) {
|
|
649
|
+
return this.fComponentsStore.fOutputs.find((x) => x.id === fId);
|
|
650
|
+
}
|
|
651
|
+
findOutletById(fId) {
|
|
652
|
+
return this.fComponentsStore.fOutlets.find((x) => x.id === fId);
|
|
653
|
+
}
|
|
654
|
+
getCanBeConnectedInputs(output) {
|
|
655
|
+
return output.isSelfConnectable ?
|
|
656
|
+
this.fInputs.filter((x) => x.canBeConnected) :
|
|
657
|
+
this.filterSelfConnectable(this.fInputs.filter((x) => x.canBeConnected), output);
|
|
658
|
+
}
|
|
659
|
+
filterSelfConnectable(inputs, output) {
|
|
660
|
+
return inputs.filter((x) => { var _a, _b; return ((_a = this.getNodeOfConnector(output)) === null || _a === void 0 ? void 0 : _a.hostElement) !== ((_b = this.getNodeOfConnector(x)) === null || _b === void 0 ? void 0 : _b.hostElement); });
|
|
661
|
+
}
|
|
662
|
+
getNodeOfConnector(connector) {
|
|
663
|
+
return this.fNodes.find((x) => x.isContains(connector.hostElement));
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
GetAllCanBeConnectedInputPositionsExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetAllCanBeConnectedInputPositionsExecution, deps: [{ token: FComponentsStore }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
667
|
+
GetAllCanBeConnectedInputPositionsExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetAllCanBeConnectedInputPositionsExecution });
|
|
668
|
+
GetAllCanBeConnectedInputPositionsExecution = __decorate([
|
|
669
|
+
FExecutionRegister(GetAllCanBeConnectedInputPositionsRequest)
|
|
670
|
+
], GetAllCanBeConnectedInputPositionsExecution);
|
|
671
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetAllCanBeConnectedInputPositionsExecution, decorators: [{
|
|
672
|
+
type: Injectable
|
|
673
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: i2.FMediator }]; } });
|
|
674
|
+
|
|
675
|
+
const F_CONNECTION_FEATURES = [
|
|
676
|
+
FindClosestInputUsingSnapThresholdExecution,
|
|
677
|
+
GetAllCanBeConnectedInputPositionsExecution,
|
|
678
|
+
GetConnectorWithRectExecution,
|
|
679
|
+
];
|
|
680
|
+
|
|
681
|
+
class ClearSelectionRequest {
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
class CanvasMoveFinalizeRequest {
|
|
685
|
+
constructor(event) {
|
|
686
|
+
this.event = event;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
class FDraggableDataContext {
|
|
691
|
+
constructor() {
|
|
692
|
+
this.selectedItems = [];
|
|
693
|
+
this.isSelectedChanged = false;
|
|
694
|
+
this.onPointerDownScale = 1;
|
|
695
|
+
this.onPointerDownPosition = new Point(0, 0);
|
|
696
|
+
this.draggableItems = [];
|
|
697
|
+
}
|
|
698
|
+
reset() {
|
|
699
|
+
this.draggableItems = [];
|
|
700
|
+
this.onPointerDownScale = 1;
|
|
701
|
+
this.onPointerDownPosition = new Point(0, 0);
|
|
702
|
+
}
|
|
703
|
+
markSelectionAsChanged() {
|
|
704
|
+
this.isSelectedChanged = true;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
FDraggableDataContext.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FDraggableDataContext, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
708
|
+
FDraggableDataContext.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FDraggableDataContext });
|
|
709
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FDraggableDataContext, decorators: [{
|
|
710
|
+
type: Injectable
|
|
711
|
+
}] });
|
|
712
|
+
|
|
713
|
+
let CanvasMoveFinalizeExecution = class CanvasMoveFinalizeExecution {
|
|
714
|
+
constructor(fDraggableDataContext) {
|
|
715
|
+
this.fDraggableDataContext = fDraggableDataContext;
|
|
716
|
+
}
|
|
717
|
+
handle(request) {
|
|
718
|
+
this.fDraggableDataContext.draggableItems.forEach((x) => { var _a; return (_a = x.complete) === null || _a === void 0 ? void 0 : _a.call(x); });
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
CanvasMoveFinalizeExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CanvasMoveFinalizeExecution, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
722
|
+
CanvasMoveFinalizeExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CanvasMoveFinalizeExecution });
|
|
723
|
+
CanvasMoveFinalizeExecution = __decorate([
|
|
724
|
+
FExecutionRegister(CanvasMoveFinalizeRequest)
|
|
725
|
+
], CanvasMoveFinalizeExecution);
|
|
726
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CanvasMoveFinalizeExecution, decorators: [{
|
|
727
|
+
type: Injectable
|
|
728
|
+
}], ctorParameters: function () { return [{ type: FDraggableDataContext }]; } });
|
|
729
|
+
|
|
730
|
+
class CanvasDragHandler {
|
|
731
|
+
constructor(fComponentsStore) {
|
|
732
|
+
this.fComponentsStore = fComponentsStore;
|
|
733
|
+
this.onPointerDownPosition = PointExtensions.initialize();
|
|
734
|
+
}
|
|
735
|
+
initialize() {
|
|
736
|
+
this.onPointerDownPosition = this.fComponentsStore.fCanvas.transform.position;
|
|
737
|
+
}
|
|
738
|
+
move(difference) {
|
|
739
|
+
this.fComponentsStore.fCanvas.setPosition(Point.fromPoint(this.onPointerDownPosition).add(difference));
|
|
740
|
+
this.fComponentsStore.fCanvas.redraw();
|
|
741
|
+
}
|
|
742
|
+
complete() {
|
|
743
|
+
this.fComponentsStore.fCanvas.emitCanvasChangeEvent();
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
let CanvasMoveFinalizeValidator = class CanvasMoveFinalizeValidator {
|
|
748
|
+
constructor(fDraggableDataContext) {
|
|
749
|
+
this.fDraggableDataContext = fDraggableDataContext;
|
|
750
|
+
}
|
|
751
|
+
handle(request) {
|
|
752
|
+
return this.fDraggableDataContext.draggableItems.some((x) => x instanceof CanvasDragHandler);
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
CanvasMoveFinalizeValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CanvasMoveFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
756
|
+
CanvasMoveFinalizeValidator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CanvasMoveFinalizeValidator });
|
|
757
|
+
CanvasMoveFinalizeValidator = __decorate([
|
|
758
|
+
FValidatorRegister(CanvasMoveFinalizeRequest)
|
|
759
|
+
], CanvasMoveFinalizeValidator);
|
|
760
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CanvasMoveFinalizeValidator, decorators: [{
|
|
761
|
+
type: Injectable
|
|
762
|
+
}], ctorParameters: function () { return [{ type: FDraggableDataContext }]; } });
|
|
763
|
+
|
|
764
|
+
const CANVAS_MOVE_FINALIZE_PROVIDERS = [
|
|
765
|
+
CanvasMoveFinalizeExecution,
|
|
214
766
|
CanvasMoveFinalizeValidator,
|
|
215
767
|
];
|
|
216
768
|
|
|
@@ -375,10 +927,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
375
927
|
type: Directive
|
|
376
928
|
}] });
|
|
377
929
|
|
|
378
|
-
function isNodeInput(element) {
|
|
379
|
-
return !!element.closest('[fNodeInput]');
|
|
380
|
-
}
|
|
381
|
-
|
|
382
930
|
function isGroup(element) {
|
|
383
931
|
return !!element.closest('[fGroup]');
|
|
384
932
|
}
|
|
@@ -527,113 +1075,26 @@ function mixinChangeVisibility(base) {
|
|
|
527
1075
|
};
|
|
528
1076
|
}
|
|
529
1077
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
}
|
|
551
|
-
};
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
function mixinFitToParent(base) {
|
|
555
|
-
return class extends base {
|
|
556
|
-
fitToParent(rect, parentRect, points, toCenter) {
|
|
557
|
-
this.transform.scaledPosition = PointExtensions.initialize();
|
|
558
|
-
this.transform.position = this.getZeroPositionWithoutScale(points);
|
|
559
|
-
const itemsContainerWidth = (rect.width / this.transform.scale) + toCenter.x;
|
|
560
|
-
const itemsContainerHeight = (rect.height / this.transform.scale) + toCenter.y;
|
|
561
|
-
if ((itemsContainerWidth > parentRect.width || itemsContainerHeight > parentRect.height) ||
|
|
562
|
-
itemsContainerWidth < parentRect.width && itemsContainerHeight < parentRect.height) {
|
|
563
|
-
this.transform.scale = Math.min(parentRect.width / itemsContainerWidth, parentRect.height / itemsContainerHeight);
|
|
564
|
-
}
|
|
565
|
-
const newX = (parentRect.width - itemsContainerWidth * this.transform.scale) / 2 - this.transform.position.x * this.transform.scale;
|
|
566
|
-
const newY = (parentRect.height - itemsContainerHeight * this.transform.scale) / 2 - this.transform.position.y * this.transform.scale;
|
|
567
|
-
this.transform.position = PointExtensions.initialize(newX + (toCenter.x / 2) * this.transform.scale, newY + (toCenter.y / 2) * this.transform.scale);
|
|
568
|
-
}
|
|
569
|
-
getZeroPositionWithoutScale(points) {
|
|
570
|
-
const xPoint = points.length ? Math.min(...points.map((point) => point.x)) : 0;
|
|
571
|
-
const yPoint = points.length ? Math.min(...points.map((point) => point.y)) : 0;
|
|
572
|
-
return PointExtensions.initialize(xPoint, yPoint);
|
|
573
|
-
}
|
|
574
|
-
constructor(...args) {
|
|
575
|
-
super(...args);
|
|
576
|
-
}
|
|
577
|
-
};
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
function mixinOneToOneCentering(base) {
|
|
581
|
-
return class extends base {
|
|
582
|
-
oneToOneCentering(rect, parentRect, points) {
|
|
583
|
-
this.transform.scaledPosition = PointExtensions.initialize();
|
|
584
|
-
this.transform.position = this.getZeroPositionWithoutScale(points);
|
|
585
|
-
const itemsContainerWidth = rect.width / this.transform.scale;
|
|
586
|
-
const itemsContainerHeight = rect.height / this.transform.scale;
|
|
587
|
-
this.transform.scale = 1;
|
|
588
|
-
const newX = (parentRect.width - itemsContainerWidth * this.transform.scale) / 2 - this.transform.position.x * this.transform.scale;
|
|
589
|
-
const newY = (parentRect.height - itemsContainerHeight * this.transform.scale) / 2 - this.transform.position.y * this.transform.scale;
|
|
590
|
-
this.transform.position = PointExtensions.initialize(newX, newY);
|
|
591
|
-
}
|
|
592
|
-
getZeroPositionWithoutScale(points) {
|
|
593
|
-
const xPoint = points.length ? Math.min(...points.map((point) => point.x)) : 0;
|
|
594
|
-
const yPoint = points.length ? Math.min(...points.map((point) => point.y)) : 0;
|
|
595
|
-
return PointExtensions.initialize(xPoint, yPoint);
|
|
596
|
-
}
|
|
597
|
-
constructor(...args) {
|
|
598
|
-
super(...args);
|
|
599
|
-
}
|
|
600
|
-
};
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
function mixinChangePosition(base) {
|
|
604
|
-
return class extends base {
|
|
605
|
-
getPosition() {
|
|
606
|
-
return this.transform.position;
|
|
607
|
-
}
|
|
608
|
-
setPosition(position) {
|
|
609
|
-
this.transform.position = PointExtensions.copy(position);
|
|
610
|
-
}
|
|
611
|
-
constructor(...args) {
|
|
612
|
-
super(...args);
|
|
613
|
-
}
|
|
614
|
-
};
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
const F_NODE = new InjectionToken('F_NODE');
|
|
618
|
-
const MIXIN_BASE$2 = mixinChangeSelection(class {
|
|
619
|
-
constructor(hostElement) {
|
|
620
|
-
this.hostElement = hostElement;
|
|
621
|
-
}
|
|
622
|
-
});
|
|
623
|
-
class FNodeBase extends MIXIN_BASE$2 {
|
|
624
|
-
constructor() {
|
|
625
|
-
super(...arguments);
|
|
626
|
-
this.stateChanges = new Subject();
|
|
627
|
-
this._position = PointExtensions.initialize();
|
|
628
|
-
this.fCanBeResizedByChild = true;
|
|
629
|
-
}
|
|
630
|
-
isContains(element) {
|
|
631
|
-
return this.hostElement.contains(element);
|
|
632
|
-
}
|
|
633
|
-
redraw() {
|
|
634
|
-
if (this.size) {
|
|
635
|
-
this.setStyle('width', '' + this.size.width + 'px');
|
|
636
|
-
this.setStyle('height', '' + this.size.height + 'px');
|
|
1078
|
+
const F_NODE = new InjectionToken('F_NODE');
|
|
1079
|
+
const MIXIN_BASE$1 = mixinChangeSelection(class {
|
|
1080
|
+
constructor(hostElement) {
|
|
1081
|
+
this.hostElement = hostElement;
|
|
1082
|
+
}
|
|
1083
|
+
});
|
|
1084
|
+
class FNodeBase extends MIXIN_BASE$1 {
|
|
1085
|
+
constructor() {
|
|
1086
|
+
super(...arguments);
|
|
1087
|
+
this.stateChanges = new Subject();
|
|
1088
|
+
this._position = PointExtensions.initialize();
|
|
1089
|
+
this.fCanBeResizedByChild = true;
|
|
1090
|
+
}
|
|
1091
|
+
isContains(element) {
|
|
1092
|
+
return this.hostElement.contains(element);
|
|
1093
|
+
}
|
|
1094
|
+
redraw() {
|
|
1095
|
+
if (this.size) {
|
|
1096
|
+
this.setStyle('width', '' + this.size.width + 'px');
|
|
1097
|
+
this.setStyle('height', '' + this.size.height + 'px');
|
|
637
1098
|
}
|
|
638
1099
|
this.setStyle('transform', `translate(${this.position.x}px,${this.position.y}px)`);
|
|
639
1100
|
}
|
|
@@ -660,7 +1121,7 @@ class FResizeObserver extends Observable {
|
|
|
660
1121
|
}
|
|
661
1122
|
}
|
|
662
1123
|
|
|
663
|
-
let uniqueId$
|
|
1124
|
+
let uniqueId$b = 0;
|
|
664
1125
|
class FGroupDirective extends FNodeBase {
|
|
665
1126
|
constructor(elementReference, renderer, fComponentsStore, fMediator, fBrowser) {
|
|
666
1127
|
super(elementReference.nativeElement);
|
|
@@ -669,7 +1130,7 @@ class FGroupDirective extends FNodeBase {
|
|
|
669
1130
|
this.fMediator = fMediator;
|
|
670
1131
|
this.fBrowser = fBrowser;
|
|
671
1132
|
this.subscriptions$ = new Subscription();
|
|
672
|
-
this.fId = `f-group-${uniqueId$
|
|
1133
|
+
this.fId = `f-group-${uniqueId$b++}`;
|
|
673
1134
|
this.fParentId = null;
|
|
674
1135
|
this.positionChange = new EventEmitter();
|
|
675
1136
|
this.sizeChange = new EventEmitter();
|
|
@@ -793,7 +1254,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
793
1254
|
type: Input
|
|
794
1255
|
}] } });
|
|
795
1256
|
|
|
796
|
-
let uniqueId$
|
|
1257
|
+
let uniqueId$a = 0;
|
|
797
1258
|
class FNodeDirective extends FNodeBase {
|
|
798
1259
|
constructor(elementReference, renderer, fComponentsStore, fMediator, fBrowser) {
|
|
799
1260
|
super(elementReference.nativeElement);
|
|
@@ -802,7 +1263,7 @@ class FNodeDirective extends FNodeBase {
|
|
|
802
1263
|
this.fMediator = fMediator;
|
|
803
1264
|
this.fBrowser = fBrowser;
|
|
804
1265
|
this.subscriptions$ = new Subscription();
|
|
805
|
-
this.fId = `f-node-${uniqueId$
|
|
1266
|
+
this.fId = `f-node-${uniqueId$a++}`;
|
|
806
1267
|
this.fParentId = null;
|
|
807
1268
|
this.positionChange = new EventEmitter();
|
|
808
1269
|
this.sizeChange = new EventEmitter();
|
|
@@ -934,14 +1395,14 @@ const F_NODE_PROVIDERS = [
|
|
|
934
1395
|
FResizeHandleDirective,
|
|
935
1396
|
];
|
|
936
1397
|
|
|
937
|
-
let uniqueId$
|
|
1398
|
+
let uniqueId$9 = 0;
|
|
938
1399
|
class FNodeInputDirective extends FNodeInputBase {
|
|
939
1400
|
constructor(elementReference, fNode, fComponentsStore) {
|
|
940
1401
|
super();
|
|
941
1402
|
this.elementReference = elementReference;
|
|
942
1403
|
this.fNode = fNode;
|
|
943
1404
|
this.fComponentsStore = fComponentsStore;
|
|
944
|
-
this.id = `f-node-input-${uniqueId$
|
|
1405
|
+
this.id = `f-node-input-${uniqueId$9++}`;
|
|
945
1406
|
this.multiple = true;
|
|
946
1407
|
this.isDisabled = false;
|
|
947
1408
|
this._fConnectableSide = EFConnectableSide.AUTO;
|
|
@@ -1037,14 +1498,14 @@ function isNodeOutlet(element) {
|
|
|
1037
1498
|
return !!element.closest('[fNodeOutlet]');
|
|
1038
1499
|
}
|
|
1039
1500
|
|
|
1040
|
-
let uniqueId$
|
|
1501
|
+
let uniqueId$8 = 0;
|
|
1041
1502
|
class FNodeOutletDirective extends FNodeOutletBase {
|
|
1042
1503
|
constructor(elementReference, fNode, fComponentsStore) {
|
|
1043
1504
|
super();
|
|
1044
1505
|
this.elementReference = elementReference;
|
|
1045
1506
|
this.fNode = fNode;
|
|
1046
1507
|
this.fComponentsStore = fComponentsStore;
|
|
1047
|
-
this.id = `f-node-outlet-${uniqueId$
|
|
1508
|
+
this.id = `f-node-outlet-${uniqueId$8++}`;
|
|
1048
1509
|
this.isDisabled = false;
|
|
1049
1510
|
this.fConnectableSide = EFConnectableSide.AUTO;
|
|
1050
1511
|
this._fConnectableSide = EFConnectableSide.AUTO;
|
|
@@ -1120,14 +1581,14 @@ function isNodeOutput(element) {
|
|
|
1120
1581
|
return !!element.closest('[fNodeOutput]');
|
|
1121
1582
|
}
|
|
1122
1583
|
|
|
1123
|
-
let uniqueId$
|
|
1584
|
+
let uniqueId$7 = 0;
|
|
1124
1585
|
class FNodeOutputDirective extends FNodeOutputBase {
|
|
1125
1586
|
constructor(elementReference, fNode, fComponentsStore) {
|
|
1126
1587
|
super();
|
|
1127
1588
|
this.elementReference = elementReference;
|
|
1128
1589
|
this.fNode = fNode;
|
|
1129
1590
|
this.fComponentsStore = fComponentsStore;
|
|
1130
|
-
this.id = `f-node-output-${uniqueId$
|
|
1591
|
+
this.id = `f-node-output-${uniqueId$7++}`;
|
|
1131
1592
|
this.multiple = false;
|
|
1132
1593
|
this.isDisabled = false;
|
|
1133
1594
|
this._fConnectableSide = EFConnectableSide.AUTO;
|
|
@@ -1218,79 +1679,6 @@ class CreateConnectionFinalizeRequest {
|
|
|
1218
1679
|
}
|
|
1219
1680
|
}
|
|
1220
1681
|
|
|
1221
|
-
class GetInputUnderPointerRequest {
|
|
1222
|
-
constructor(event, dragHandler) {
|
|
1223
|
-
this.event = event;
|
|
1224
|
-
this.dragHandler = dragHandler;
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
let GetInputUnderPointerExecution = class GetInputUnderPointerExecution {
|
|
1229
|
-
constructor(fComponentsStore, fBrowser) {
|
|
1230
|
-
this.fComponentsStore = fComponentsStore;
|
|
1231
|
-
this.fBrowser = fBrowser;
|
|
1232
|
-
}
|
|
1233
|
-
get fNodes() {
|
|
1234
|
-
return this.fComponentsStore.fNodes;
|
|
1235
|
-
}
|
|
1236
|
-
get fInputs() {
|
|
1237
|
-
return this.fComponentsStore.fInputs;
|
|
1238
|
-
}
|
|
1239
|
-
handle(payload) {
|
|
1240
|
-
const output = (this.getOutput(payload.dragHandler) || this.getOutlet(payload.dragHandler));
|
|
1241
|
-
const inputsUnderPointer = this.getInputsUnderPointer(payload.event.getPosition());
|
|
1242
|
-
const connectors = output.isSelfConnectable ?
|
|
1243
|
-
inputsUnderPointer :
|
|
1244
|
-
this.filterSelfConnectable(inputsUnderPointer, output);
|
|
1245
|
-
return connectors.length > 0 ? connectors[0] : undefined;
|
|
1246
|
-
}
|
|
1247
|
-
getOutput(dragHandler) {
|
|
1248
|
-
return this.fComponentsStore.fOutputs.find((x) => x.id === dragHandler.connection.fOutputId);
|
|
1249
|
-
}
|
|
1250
|
-
getOutlet(dragHandler) {
|
|
1251
|
-
return this.fComponentsStore.fOutlets.find((x) => x.id === dragHandler.connection.fOutputId);
|
|
1252
|
-
}
|
|
1253
|
-
getInputsUnderPointer(position) {
|
|
1254
|
-
const result = this.getInputsInPosition(position);
|
|
1255
|
-
const input = this.getFirstConnectableInputOfNodeInPosition(position);
|
|
1256
|
-
if (input) {
|
|
1257
|
-
result.push(input);
|
|
1258
|
-
}
|
|
1259
|
-
return result;
|
|
1260
|
-
}
|
|
1261
|
-
getInputsInPosition(position) {
|
|
1262
|
-
return this.getElementsFromPoint(position).map((element) => this.fInputs.find(x => x.isContains(element) && x.canBeConnected)).filter((x) => !!x);
|
|
1263
|
-
}
|
|
1264
|
-
getElementsFromPoint(position) {
|
|
1265
|
-
return this.fBrowser.document.elementsFromPoint(position.x, position.y);
|
|
1266
|
-
}
|
|
1267
|
-
getFirstConnectableInputOfNodeInPosition(position) {
|
|
1268
|
-
return this.getNodesInPosition(position).map((x) => {
|
|
1269
|
-
return this.fInputs.find((i) => x.isContains(i.hostElement) && i.canBeConnected);
|
|
1270
|
-
}).find((x) => !!x);
|
|
1271
|
-
}
|
|
1272
|
-
getNodesInPosition(position) {
|
|
1273
|
-
return this.getElementsFromPoint(position).map((element) => {
|
|
1274
|
-
return this.fNodes.find((x) => x.isContains(element) && x.fConnectOnNode);
|
|
1275
|
-
}).filter((x) => !!x);
|
|
1276
|
-
}
|
|
1277
|
-
filterSelfConnectable(inputs, connector) {
|
|
1278
|
-
return inputs.filter((x) => {
|
|
1279
|
-
const targetNode = this.fNodes.find((k) => k.isContains(x.hostElement));
|
|
1280
|
-
const sourceNode = this.fNodes.find((k) => k.isContains(connector.hostElement));
|
|
1281
|
-
return (sourceNode === null || sourceNode === void 0 ? void 0 : sourceNode.hostElement) !== (targetNode === null || targetNode === void 0 ? void 0 : targetNode.hostElement);
|
|
1282
|
-
});
|
|
1283
|
-
}
|
|
1284
|
-
};
|
|
1285
|
-
GetInputUnderPointerExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetInputUnderPointerExecution, deps: [{ token: FComponentsStore }, { token: i1.BrowserService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1286
|
-
GetInputUnderPointerExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetInputUnderPointerExecution });
|
|
1287
|
-
GetInputUnderPointerExecution = __decorate([
|
|
1288
|
-
FExecutionRegister(GetInputUnderPointerRequest)
|
|
1289
|
-
], GetInputUnderPointerExecution);
|
|
1290
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetInputUnderPointerExecution, decorators: [{
|
|
1291
|
-
type: Injectable
|
|
1292
|
-
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: i1.BrowserService }]; } });
|
|
1293
|
-
|
|
1294
1682
|
function createErrorClass(impl) {
|
|
1295
1683
|
const _super = (instance) => {
|
|
1296
1684
|
Error.call(instance);
|
|
@@ -1323,38 +1711,6 @@ function RequiredOutput() {
|
|
|
1323
1711
|
return new ConflictError(`The fNode must contain at least one fOutput if there is an fOutlet`);
|
|
1324
1712
|
}
|
|
1325
1713
|
|
|
1326
|
-
let GetInputUnderPointerValidator = class GetInputUnderPointerValidator {
|
|
1327
|
-
constructor(fComponentsStore) {
|
|
1328
|
-
this.fComponentsStore = fComponentsStore;
|
|
1329
|
-
}
|
|
1330
|
-
handle(request) {
|
|
1331
|
-
let output = this.getOutput(request.dragHandler) || this.getOutlet(request.dragHandler);
|
|
1332
|
-
if (!output) {
|
|
1333
|
-
throw OutputNotFound(request.dragHandler.connection.fOutputId);
|
|
1334
|
-
}
|
|
1335
|
-
return true;
|
|
1336
|
-
}
|
|
1337
|
-
getOutput(dragHandler) {
|
|
1338
|
-
return this.fComponentsStore.fOutputs.find((x) => x.id === dragHandler.connection.fOutputId);
|
|
1339
|
-
}
|
|
1340
|
-
getOutlet(dragHandler) {
|
|
1341
|
-
return this.fComponentsStore.fOutlets.find((x) => x.id === dragHandler.connection.fOutputId);
|
|
1342
|
-
}
|
|
1343
|
-
};
|
|
1344
|
-
GetInputUnderPointerValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetInputUnderPointerValidator, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1345
|
-
GetInputUnderPointerValidator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetInputUnderPointerValidator });
|
|
1346
|
-
GetInputUnderPointerValidator = __decorate([
|
|
1347
|
-
FValidatorRegister(GetInputUnderPointerRequest)
|
|
1348
|
-
], GetInputUnderPointerValidator);
|
|
1349
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetInputUnderPointerValidator, decorators: [{
|
|
1350
|
-
type: Injectable
|
|
1351
|
-
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
1352
|
-
|
|
1353
|
-
const GET_INPUT_UNDER_POINTER_PROVIDERS = [
|
|
1354
|
-
GetInputUnderPointerExecution,
|
|
1355
|
-
GetInputUnderPointerValidator,
|
|
1356
|
-
];
|
|
1357
|
-
|
|
1358
1714
|
class GetCanBeConnectedOutputByOutletRequest {
|
|
1359
1715
|
constructor(outlet) {
|
|
1360
1716
|
this.outlet = outlet;
|
|
@@ -1416,11 +1772,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1416
1772
|
type: Injectable
|
|
1417
1773
|
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
1418
1774
|
|
|
1419
|
-
const GET_CAN_BE_CONNECTED_OUTPUT_BY_OUTLET_PROVIDERS = [
|
|
1420
|
-
GetCanBeConnectedOutputByOutletExecution,
|
|
1421
|
-
GetCanBeConnectedOutputByOutletValidator,
|
|
1422
|
-
];
|
|
1423
|
-
|
|
1424
1775
|
class FCreateConnectionEvent {
|
|
1425
1776
|
constructor(fOutputId, fInputId, fDropPosition) {
|
|
1426
1777
|
this.fOutputId = fOutputId;
|
|
@@ -1429,6 +1780,115 @@ class FCreateConnectionEvent {
|
|
|
1429
1780
|
}
|
|
1430
1781
|
}
|
|
1431
1782
|
|
|
1783
|
+
class GetInputUnderPointerRequest {
|
|
1784
|
+
constructor(event, dragHandler) {
|
|
1785
|
+
this.event = event;
|
|
1786
|
+
this.dragHandler = dragHandler;
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
let GetInputUnderPointerExecution = class GetInputUnderPointerExecution {
|
|
1791
|
+
constructor(fComponentsStore, fDraggableDataContext, fBrowser) {
|
|
1792
|
+
this.fComponentsStore = fComponentsStore;
|
|
1793
|
+
this.fDraggableDataContext = fDraggableDataContext;
|
|
1794
|
+
this.fBrowser = fBrowser;
|
|
1795
|
+
}
|
|
1796
|
+
get fNodes() {
|
|
1797
|
+
return this.fComponentsStore.fNodes;
|
|
1798
|
+
}
|
|
1799
|
+
get fInputs() {
|
|
1800
|
+
return this.fComponentsStore.fInputs;
|
|
1801
|
+
}
|
|
1802
|
+
handle(payload) {
|
|
1803
|
+
const output = (this.getOutput(payload.dragHandler) || this.getOutlet(payload.dragHandler));
|
|
1804
|
+
const inputsUnderPointer = this.getInputsUnderPointer(payload.event.getPosition(), payload.dragHandler);
|
|
1805
|
+
const connectors = output.isSelfConnectable ?
|
|
1806
|
+
inputsUnderPointer :
|
|
1807
|
+
this.filterSelfConnectable(inputsUnderPointer, output);
|
|
1808
|
+
return connectors.length > 0 ? connectors[0] : undefined;
|
|
1809
|
+
}
|
|
1810
|
+
getOutput(dragHandler) {
|
|
1811
|
+
return this.fComponentsStore.fOutputs.find((x) => x.id === dragHandler.fConnection.fOutputId);
|
|
1812
|
+
}
|
|
1813
|
+
getOutlet(dragHandler) {
|
|
1814
|
+
return this.fComponentsStore.fOutlets.find((x) => x.id === dragHandler.fConnection.fOutputId);
|
|
1815
|
+
}
|
|
1816
|
+
getInputsUnderPointer(position, dragHandler) {
|
|
1817
|
+
const result = this.getInputsInPosition(position);
|
|
1818
|
+
const closestInput = dragHandler.getClosetInput(this.getDifference(position));
|
|
1819
|
+
if (closestInput) {
|
|
1820
|
+
result.push(closestInput.fConnector);
|
|
1821
|
+
}
|
|
1822
|
+
const input = this.getFirstConnectableInputOfNodeInPosition(position);
|
|
1823
|
+
if (input) {
|
|
1824
|
+
result.push(input);
|
|
1825
|
+
}
|
|
1826
|
+
return result;
|
|
1827
|
+
}
|
|
1828
|
+
getDifference(position) {
|
|
1829
|
+
return Point.fromPoint(position).elementTransform(this.fComponentsStore.flowHost)
|
|
1830
|
+
.div(this.fDraggableDataContext.onPointerDownScale).sub(this.fDraggableDataContext.onPointerDownPosition);
|
|
1831
|
+
}
|
|
1832
|
+
getInputsInPosition(position) {
|
|
1833
|
+
return this.getElementsFromPoint(position).map((element) => this.fInputs.find(x => x.isContains(element) && x.canBeConnected)).filter((x) => !!x);
|
|
1834
|
+
}
|
|
1835
|
+
getElementsFromPoint(position) {
|
|
1836
|
+
return this.fBrowser.document.elementsFromPoint(position.x, position.y);
|
|
1837
|
+
}
|
|
1838
|
+
getFirstConnectableInputOfNodeInPosition(position) {
|
|
1839
|
+
return this.getNodesInPosition(position).map((x) => {
|
|
1840
|
+
return this.fInputs.find((i) => x.isContains(i.hostElement) && i.canBeConnected);
|
|
1841
|
+
}).find((x) => !!x);
|
|
1842
|
+
}
|
|
1843
|
+
getNodesInPosition(position) {
|
|
1844
|
+
return this.getElementsFromPoint(position).map((element) => {
|
|
1845
|
+
return this.fNodes.find((x) => x.isContains(element) && x.fConnectOnNode);
|
|
1846
|
+
}).filter((x) => !!x);
|
|
1847
|
+
}
|
|
1848
|
+
filterSelfConnectable(inputs, connector) {
|
|
1849
|
+
return inputs.filter((x) => {
|
|
1850
|
+
const targetNode = this.fNodes.find((k) => k.isContains(x.hostElement));
|
|
1851
|
+
const sourceNode = this.fNodes.find((k) => k.isContains(connector.hostElement));
|
|
1852
|
+
return (sourceNode === null || sourceNode === void 0 ? void 0 : sourceNode.hostElement) !== (targetNode === null || targetNode === void 0 ? void 0 : targetNode.hostElement);
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
};
|
|
1856
|
+
GetInputUnderPointerExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetInputUnderPointerExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: i1.BrowserService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1857
|
+
GetInputUnderPointerExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetInputUnderPointerExecution });
|
|
1858
|
+
GetInputUnderPointerExecution = __decorate([
|
|
1859
|
+
FExecutionRegister(GetInputUnderPointerRequest)
|
|
1860
|
+
], GetInputUnderPointerExecution);
|
|
1861
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetInputUnderPointerExecution, decorators: [{
|
|
1862
|
+
type: Injectable
|
|
1863
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: i1.BrowserService }]; } });
|
|
1864
|
+
|
|
1865
|
+
let GetInputUnderPointerValidator = class GetInputUnderPointerValidator {
|
|
1866
|
+
constructor(fComponentsStore) {
|
|
1867
|
+
this.fComponentsStore = fComponentsStore;
|
|
1868
|
+
}
|
|
1869
|
+
handle(request) {
|
|
1870
|
+
let output = this.getOutput(request.dragHandler) || this.getOutlet(request.dragHandler);
|
|
1871
|
+
if (!output) {
|
|
1872
|
+
throw OutputNotFound(request.dragHandler.fConnection.fOutputId);
|
|
1873
|
+
}
|
|
1874
|
+
return true;
|
|
1875
|
+
}
|
|
1876
|
+
getOutput(dragHandler) {
|
|
1877
|
+
return this.fComponentsStore.fOutputs.find((x) => x.id === dragHandler.fConnection.fOutputId);
|
|
1878
|
+
}
|
|
1879
|
+
getOutlet(dragHandler) {
|
|
1880
|
+
return this.fComponentsStore.fOutlets.find((x) => x.id === dragHandler.fConnection.fOutputId);
|
|
1881
|
+
}
|
|
1882
|
+
};
|
|
1883
|
+
GetInputUnderPointerValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetInputUnderPointerValidator, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1884
|
+
GetInputUnderPointerValidator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetInputUnderPointerValidator });
|
|
1885
|
+
GetInputUnderPointerValidator = __decorate([
|
|
1886
|
+
FValidatorRegister(GetInputUnderPointerRequest)
|
|
1887
|
+
], GetInputUnderPointerValidator);
|
|
1888
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetInputUnderPointerValidator, decorators: [{
|
|
1889
|
+
type: Injectable
|
|
1890
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
1891
|
+
|
|
1432
1892
|
let CreateConnectionFinalizeExecution = class CreateConnectionFinalizeExecution {
|
|
1433
1893
|
constructor(fComponentsStore, fDraggableDataContext, fMediator) {
|
|
1434
1894
|
this.fComponentsStore = fComponentsStore;
|
|
@@ -1444,15 +1904,15 @@ let CreateConnectionFinalizeExecution = class CreateConnectionFinalizeExecution
|
|
|
1444
1904
|
}
|
|
1445
1905
|
getTargetOutput(output) {
|
|
1446
1906
|
if (!output) {
|
|
1447
|
-
throw OutputNotFound(this.dragHandler.
|
|
1907
|
+
throw OutputNotFound(this.dragHandler.fConnection.fOutputId);
|
|
1448
1908
|
}
|
|
1449
1909
|
return isNodeOutlet(output.hostElement) ? this.fMediator.send(new GetCanBeConnectedOutputByOutletRequest(output)) : output;
|
|
1450
1910
|
}
|
|
1451
1911
|
getOutput() {
|
|
1452
|
-
return this.fComponentsStore.fOutputs.find((x) => x.id === this.dragHandler.
|
|
1912
|
+
return this.fComponentsStore.fOutputs.find((x) => x.id === this.dragHandler.fConnection.fOutputId);
|
|
1453
1913
|
}
|
|
1454
1914
|
getOutlet() {
|
|
1455
|
-
return this.fComponentsStore.fOutlets.find((x) => x.id === this.dragHandler.
|
|
1915
|
+
return this.fComponentsStore.fOutlets.find((x) => x.id === this.dragHandler.fConnection.fOutputId);
|
|
1456
1916
|
}
|
|
1457
1917
|
emitEvent(event) {
|
|
1458
1918
|
var _a, _b;
|
|
@@ -1472,32 +1932,62 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1472
1932
|
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: i2.FMediator }]; } });
|
|
1473
1933
|
|
|
1474
1934
|
class CreateConnectionDragHandler {
|
|
1475
|
-
constructor(fMediator,
|
|
1935
|
+
constructor(fMediator, fComponentsStore, fOutput, onPointerDownPosition) {
|
|
1476
1936
|
this.fMediator = fMediator;
|
|
1477
|
-
this.
|
|
1937
|
+
this.fComponentsStore = fComponentsStore;
|
|
1938
|
+
this.fOutput = fOutput;
|
|
1478
1939
|
this.onPointerDownPosition = onPointerDownPosition;
|
|
1479
|
-
this.
|
|
1480
|
-
this.
|
|
1481
|
-
|
|
1940
|
+
this.toConnectorRect = new RoundedRect();
|
|
1941
|
+
this.canBeConnectedInputs = [];
|
|
1942
|
+
}
|
|
1943
|
+
get fConnection() {
|
|
1944
|
+
return this.fComponentsStore.fTempConnection;
|
|
1945
|
+
}
|
|
1946
|
+
get fSnapConnection() {
|
|
1947
|
+
return this.fComponentsStore.fSnapConnection;
|
|
1482
1948
|
}
|
|
1483
1949
|
initialize() {
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
this.
|
|
1950
|
+
if (this.fSnapConnection) {
|
|
1951
|
+
this.fSnapConnection.fOutputId = this.fOutput.id;
|
|
1952
|
+
this.fSnapConnection.initialize();
|
|
1953
|
+
this.canBeConnectedInputs = this.fMediator.send(new GetAllCanBeConnectedInputPositionsRequest(this.fOutput.id));
|
|
1954
|
+
}
|
|
1955
|
+
this.fConnection.fOutputId = this.fOutput.id;
|
|
1956
|
+
this.fConnection.initialize();
|
|
1957
|
+
this.fOutputWithRect = this.fMediator.send(new GetConnectorWithRectRequest(this.fOutput));
|
|
1958
|
+
this.toConnectorRect = RoundedRect.fromRect(RectExtensions.initialize(this.onPointerDownPosition.x, this.onPointerDownPosition.y));
|
|
1959
|
+
this.fConnection.show();
|
|
1491
1960
|
this.move(PointExtensions.initialize());
|
|
1492
1961
|
}
|
|
1493
1962
|
move(difference) {
|
|
1494
|
-
|
|
1495
|
-
this.
|
|
1496
|
-
|
|
1963
|
+
this.drawTempConnection(this.toConnectorRect.addPoint(difference));
|
|
1964
|
+
this.drawSnapConnection(this.getClosetInput(difference));
|
|
1965
|
+
}
|
|
1966
|
+
drawTempConnection(fInputRect) {
|
|
1967
|
+
const line = this.fMediator.send(new GetConnectionLineRequest(this.fOutputWithRect.fRect, fInputRect, this.fConnection.fBehavior, this.fOutputWithRect.fConnector.fConnectableSide, EFConnectableSide.TOP));
|
|
1968
|
+
this.fConnection.setLine(line.point1, this.fOutputWithRect.fConnector.fConnectableSide, line.point2, EFConnectableSide.TOP);
|
|
1969
|
+
this.fConnection.redraw();
|
|
1970
|
+
}
|
|
1971
|
+
drawSnapConnection(fInputWithRect) {
|
|
1972
|
+
var _a;
|
|
1973
|
+
if (fInputWithRect) {
|
|
1974
|
+
const line = this.fMediator.send(new GetConnectionLineRequest(this.fOutputWithRect.fRect, fInputWithRect.fRect, this.fSnapConnection.fBehavior, this.fOutputWithRect.fConnector.fConnectableSide, fInputWithRect.fConnector.fConnectableSide));
|
|
1975
|
+
this.fSnapConnection.show();
|
|
1976
|
+
this.fSnapConnection.setLine(line.point1, this.fOutputWithRect.fConnector.fConnectableSide, line.point2, fInputWithRect.fConnector.fConnectableSide);
|
|
1977
|
+
this.fSnapConnection.redraw();
|
|
1978
|
+
}
|
|
1979
|
+
else {
|
|
1980
|
+
(_a = this.fSnapConnection) === null || _a === void 0 ? void 0 : _a.hide();
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
getClosetInput(difference) {
|
|
1984
|
+
return this.fMediator.send(new FindClosestInputUsingSnapThresholdRequest(Point.fromPoint(this.toConnectorRect).add(difference), this.canBeConnectedInputs, this.fSnapConnection.fSnapThreshold));
|
|
1497
1985
|
}
|
|
1498
1986
|
complete() {
|
|
1499
|
-
|
|
1500
|
-
this.
|
|
1987
|
+
var _a;
|
|
1988
|
+
this.fConnection.redraw();
|
|
1989
|
+
this.fConnection.hide();
|
|
1990
|
+
(_a = this.fSnapConnection) === null || _a === void 0 ? void 0 : _a.hide();
|
|
1501
1991
|
}
|
|
1502
1992
|
}
|
|
1503
1993
|
|
|
@@ -1518,11 +2008,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1518
2008
|
type: Injectable
|
|
1519
2009
|
}], ctorParameters: function () { return [{ type: FDraggableDataContext }]; } });
|
|
1520
2010
|
|
|
1521
|
-
const CREATE_CONNECTION_FINALIZE_PROVIDERS = [
|
|
1522
|
-
CreateConnectionFinalizeExecution,
|
|
1523
|
-
CreateConnectionFinalizeValidator,
|
|
1524
|
-
];
|
|
1525
|
-
|
|
1526
2011
|
class CreateConnectionDragHandlerRequest {
|
|
1527
2012
|
constructor(onPointerDownPosition, connector) {
|
|
1528
2013
|
this.onPointerDownPosition = onPointerDownPosition;
|
|
@@ -1543,15 +2028,14 @@ let CreateConnectionDragHandlerExecution = class CreateConnectionDragHandlerExec
|
|
|
1543
2028
|
return this.fComponentsStore.fCanvas.transform;
|
|
1544
2029
|
}
|
|
1545
2030
|
handle(request) {
|
|
1546
|
-
this.fComponentsStore.fTempConnection.fOutputId = request.connector.id;
|
|
1547
|
-
this.fComponentsStore.fTempConnection.initialize();
|
|
1548
2031
|
this.fDraggableDataContext.onPointerDownScale = this.transform.scale;
|
|
1549
|
-
const positionRelativeToFlowComponent = Point.fromPoint(request.onPointerDownPosition)
|
|
2032
|
+
const positionRelativeToFlowComponent = Point.fromPoint(request.onPointerDownPosition)
|
|
2033
|
+
.elementTransform(this.flowHost).div(this.transform.scale);
|
|
1550
2034
|
this.fDraggableDataContext.onPointerDownPosition = positionRelativeToFlowComponent;
|
|
1551
2035
|
const positionRelativeToCanvasComponent = Point.fromPoint(positionRelativeToFlowComponent).mult(this.transform.scale)
|
|
1552
2036
|
.sub(this.transform.position).sub(this.transform.scaledPosition).div(this.transform.scale);
|
|
1553
2037
|
this.fDraggableDataContext.draggableItems = [
|
|
1554
|
-
new CreateConnectionDragHandler(this.fMediator, this.fComponentsStore.
|
|
2038
|
+
new CreateConnectionDragHandler(this.fMediator, this.fComponentsStore, request.connector, positionRelativeToCanvasComponent)
|
|
1555
2039
|
];
|
|
1556
2040
|
}
|
|
1557
2041
|
};
|
|
@@ -1564,10 +2048,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1564
2048
|
type: Injectable
|
|
1565
2049
|
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: i2.FMediator }]; } });
|
|
1566
2050
|
|
|
1567
|
-
const CREATE_CONNECTION_DRAG_HANDLER_PROVIDERS = [
|
|
1568
|
-
CreateConnectionDragHandlerExecution,
|
|
1569
|
-
];
|
|
1570
|
-
|
|
1571
2051
|
class CreateConnectionFromOutletPreparationRequest {
|
|
1572
2052
|
constructor(event) {
|
|
1573
2053
|
this.event = event;
|
|
@@ -1616,10 +2096,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1616
2096
|
type: Injectable
|
|
1617
2097
|
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: i2.FMediator }]; } });
|
|
1618
2098
|
|
|
1619
|
-
const CREATE_CONNECTION_FROM_OUTLET_PREPARATION_PROVIDERS = [
|
|
1620
|
-
CreateConnectionFromOutletPreparationExecution,
|
|
1621
|
-
];
|
|
1622
|
-
|
|
1623
2099
|
class CreateConnectionFromOutputPreparationRequest {
|
|
1624
2100
|
constructor(event) {
|
|
1625
2101
|
this.event = event;
|
|
@@ -1682,11 +2158,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1682
2158
|
type: Injectable
|
|
1683
2159
|
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
1684
2160
|
|
|
1685
|
-
const CREATE_CONNECTION_FROM_OUTPUT_PREPARATION_PROVIDERS = [
|
|
1686
|
-
CreateConnectionFromOutputPreparationExecution,
|
|
1687
|
-
CreateConnectionFromOutputPreparationValidator,
|
|
1688
|
-
];
|
|
1689
|
-
|
|
1690
2161
|
class CreateConnectionPreparationRequest {
|
|
1691
2162
|
constructor(event) {
|
|
1692
2163
|
this.event = event;
|
|
@@ -1749,14 +2220,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1749
2220
|
type: Injectable
|
|
1750
2221
|
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: FDraggableDataContext }]; } });
|
|
1751
2222
|
|
|
1752
|
-
const CREATE_CONNECTION_PREPARATION_PROVIDERS = [
|
|
1753
|
-
...CREATE_CONNECTION_DRAG_HANDLER_PROVIDERS,
|
|
1754
|
-
...CREATE_CONNECTION_FROM_OUTLET_PREPARATION_PROVIDERS,
|
|
1755
|
-
...CREATE_CONNECTION_FROM_OUTPUT_PREPARATION_PROVIDERS,
|
|
1756
|
-
CreateConnectionPreparationExecution,
|
|
1757
|
-
CreateConnectionPreparationValidator,
|
|
1758
|
-
];
|
|
1759
|
-
|
|
1760
2223
|
class ReassignConnectionFinalizeRequest {
|
|
1761
2224
|
constructor(event) {
|
|
1762
2225
|
this.event = event;
|
|
@@ -1764,8 +2227,8 @@ class ReassignConnectionFinalizeRequest {
|
|
|
1764
2227
|
}
|
|
1765
2228
|
|
|
1766
2229
|
class FReassignConnectionEvent {
|
|
1767
|
-
constructor(
|
|
1768
|
-
this.
|
|
2230
|
+
constructor(fConnectionId, fOutputId, oldFInputId, newFInputId) {
|
|
2231
|
+
this.fConnectionId = fConnectionId;
|
|
1769
2232
|
this.fOutputId = fOutputId;
|
|
1770
2233
|
this.oldFInputId = oldFInputId;
|
|
1771
2234
|
this.newFInputId = newFInputId;
|
|
@@ -1793,13 +2256,13 @@ let ReassignConnectionFinalizeExecution = class ReassignConnectionFinalizeExecut
|
|
|
1793
2256
|
if (!input || !this.isReassignToDifferentInput(input)) {
|
|
1794
2257
|
return;
|
|
1795
2258
|
}
|
|
1796
|
-
this.fDraggable.fReassignConnection.emit(new FReassignConnectionEvent(this.dragHandler.
|
|
2259
|
+
this.fDraggable.fReassignConnection.emit(new FReassignConnectionEvent(this.dragHandler.fConnection.fId, this.dragHandler.fConnection.fOutputId, this.dragHandler.fConnection.fInputId, input.id));
|
|
1797
2260
|
}
|
|
1798
2261
|
getInputUnderPointer(event) {
|
|
1799
2262
|
return this.fMediator.send(new GetInputUnderPointerRequest(event, this.dragHandler));
|
|
1800
2263
|
}
|
|
1801
2264
|
isReassignToDifferentInput(inputsUnderPointer) {
|
|
1802
|
-
return this.dragHandler.
|
|
2265
|
+
return this.dragHandler.fConnection.fInputId !== inputsUnderPointer.id;
|
|
1803
2266
|
}
|
|
1804
2267
|
};
|
|
1805
2268
|
ReassignConnectionFinalizeExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ReassignConnectionFinalizeExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1812,32 +2275,60 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1812
2275
|
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: i2.FMediator }]; } });
|
|
1813
2276
|
|
|
1814
2277
|
class ReassignConnectionDragHandler {
|
|
1815
|
-
constructor(fMediator,
|
|
2278
|
+
constructor(fMediator, fComponentsStore, fConnection) {
|
|
1816
2279
|
this.fMediator = fMediator;
|
|
1817
|
-
this.
|
|
1818
|
-
this.
|
|
1819
|
-
this.
|
|
1820
|
-
this.
|
|
1821
|
-
|
|
2280
|
+
this.fComponentsStore = fComponentsStore;
|
|
2281
|
+
this.fConnection = fConnection;
|
|
2282
|
+
this.toConnectorRect = new RoundedRect();
|
|
2283
|
+
this.canBeConnectedInputs = [];
|
|
2284
|
+
}
|
|
2285
|
+
get fSnapConnection() {
|
|
2286
|
+
return this.fComponentsStore.fSnapConnection;
|
|
1822
2287
|
}
|
|
1823
2288
|
initialize() {
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
2289
|
+
if (this.fSnapConnection) {
|
|
2290
|
+
this.fSnapConnection.fOutputId = this.fConnection.fOutputId;
|
|
2291
|
+
this.fSnapConnection.initialize();
|
|
2292
|
+
this.canBeConnectedInputs = this.fMediator.send(new GetAllCanBeConnectedInputPositionsRequest(this.fConnection.fOutputId));
|
|
2293
|
+
}
|
|
2294
|
+
this.fOutputWithRect = this.fMediator.send(new GetConnectorWithRectRequest(this.getOutput()));
|
|
2295
|
+
this.fInputWithRect = this.fMediator.send(new GetConnectorWithRectRequest(this.getInput()));
|
|
2296
|
+
this.toConnectorRect = RoundedRect.fromRect(RectExtensions.initialize(this.fConnection.line.point2.x, this.fConnection.line.point2.y));
|
|
2297
|
+
}
|
|
2298
|
+
getOutput() {
|
|
2299
|
+
return this.fComponentsStore.fOutputs.find((x) => x.id === this.fConnection.fOutputId);
|
|
2300
|
+
}
|
|
2301
|
+
getInput() {
|
|
2302
|
+
return this.fComponentsStore.fInputs.find((x) => x.id === this.fConnection.fInputId);
|
|
1829
2303
|
}
|
|
1830
2304
|
move(difference) {
|
|
1831
|
-
|
|
1832
|
-
this.
|
|
1833
|
-
|
|
2305
|
+
this.drawConnection({ fRect: this.toConnectorRect.addPoint(difference), fConnector: this.fInputWithRect.fConnector });
|
|
2306
|
+
this.drawSnapConnection(this.getClosetInput(difference));
|
|
2307
|
+
}
|
|
2308
|
+
drawConnection(fInputWithRect) {
|
|
2309
|
+
const line = this.fMediator.send(new GetConnectionLineRequest(this.fOutputWithRect.fRect, fInputWithRect.fRect, this.fConnection.fBehavior, this.fOutputWithRect.fConnector.fConnectableSide, fInputWithRect.fConnector.fConnectableSide));
|
|
2310
|
+
this.fConnection.setLine(line.point1, this.fOutputWithRect.fConnector.fConnectableSide, line.point2, fInputWithRect.fConnector.fConnectableSide);
|
|
2311
|
+
this.fConnection.redraw();
|
|
2312
|
+
}
|
|
2313
|
+
drawSnapConnection(fInputWithRect) {
|
|
2314
|
+
var _a;
|
|
2315
|
+
if (fInputWithRect) {
|
|
2316
|
+
const line = this.fMediator.send(new GetConnectionLineRequest(this.fOutputWithRect.fRect, fInputWithRect.fRect, this.fSnapConnection.fBehavior, this.fOutputWithRect.fConnector.fConnectableSide, fInputWithRect.fConnector.fConnectableSide));
|
|
2317
|
+
this.fSnapConnection.show();
|
|
2318
|
+
this.fSnapConnection.setLine(line.point1, this.fOutputWithRect.fConnector.fConnectableSide, line.point2, fInputWithRect.fConnector.fConnectableSide);
|
|
2319
|
+
this.fSnapConnection.redraw();
|
|
2320
|
+
}
|
|
2321
|
+
else {
|
|
2322
|
+
(_a = this.fSnapConnection) === null || _a === void 0 ? void 0 : _a.hide();
|
|
2323
|
+
}
|
|
2324
|
+
}
|
|
2325
|
+
getClosetInput(difference) {
|
|
2326
|
+
return this.fMediator.send(new FindClosestInputUsingSnapThresholdRequest(Point.fromPoint(this.toConnectorRect).add(difference), this.canBeConnectedInputs, this.fSnapConnection.fSnapThreshold));
|
|
1834
2327
|
}
|
|
1835
2328
|
complete() {
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
this.connection.setLine(line.point1, fromConnector.fConnectableSide, line.point2, toConnector.fConnectableSide);
|
|
1840
|
-
this.connection.redraw();
|
|
2329
|
+
var _a;
|
|
2330
|
+
this.drawConnection(this.fInputWithRect);
|
|
2331
|
+
(_a = this.fSnapConnection) === null || _a === void 0 ? void 0 : _a.hide();
|
|
1841
2332
|
}
|
|
1842
2333
|
}
|
|
1843
2334
|
|
|
@@ -1858,11 +2349,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1858
2349
|
type: Injectable
|
|
1859
2350
|
}], ctorParameters: function () { return [{ type: FDraggableDataContext }]; } });
|
|
1860
2351
|
|
|
1861
|
-
const REASSIGN_CONNECTION_FINALIZE_PROVIDERS = [
|
|
1862
|
-
ReassignConnectionFinalizeExecution,
|
|
1863
|
-
ReassignConnectionFinalizeValidator,
|
|
1864
|
-
];
|
|
1865
|
-
|
|
1866
2352
|
class ReassignConnectionPreparationRequest {
|
|
1867
2353
|
constructor(event) {
|
|
1868
2354
|
this.event = event;
|
|
@@ -2498,12 +2984,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
2498
2984
|
args: [F_CONNECTION_BUILDERS]
|
|
2499
2985
|
}] }]; } });
|
|
2500
2986
|
|
|
2501
|
-
const MIXIN_BASE
|
|
2987
|
+
const MIXIN_BASE = mixinChangeSelection(mixinChangeVisibility(class {
|
|
2502
2988
|
constructor(hostElement) {
|
|
2503
2989
|
this.hostElement = hostElement;
|
|
2504
2990
|
}
|
|
2505
2991
|
}));
|
|
2506
|
-
class FConnectionBase extends MIXIN_BASE
|
|
2992
|
+
class FConnectionBase extends MIXIN_BASE {
|
|
2507
2993
|
constructor(elementReference, cFactory) {
|
|
2508
2994
|
super(elementReference.nativeElement);
|
|
2509
2995
|
this.cFactory = cFactory;
|
|
@@ -2585,12 +3071,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
2585
3071
|
}]
|
|
2586
3072
|
}] });
|
|
2587
3073
|
|
|
2588
|
-
let uniqueId$
|
|
3074
|
+
let uniqueId$6 = 0;
|
|
2589
3075
|
class FConnectionForCreateComponent extends FConnectionBase {
|
|
2590
3076
|
constructor(elementReference, fConnectionFactory, fComponentsStore) {
|
|
2591
3077
|
super(elementReference, fConnectionFactory);
|
|
2592
3078
|
this.fComponentsStore = fComponentsStore;
|
|
2593
|
-
this.fId = `f-connection-for-create-${uniqueId$
|
|
3079
|
+
this.fId = `f-connection-for-create-${uniqueId$6++}`;
|
|
2594
3080
|
this.fText = '';
|
|
2595
3081
|
this._fStartColor = 'black';
|
|
2596
3082
|
this._fEndColor = 'black';
|
|
@@ -2643,11 +3129,6 @@ class FConnectionForCreateComponent extends FConnectionBase {
|
|
|
2643
3129
|
get fType() {
|
|
2644
3130
|
return this._type;
|
|
2645
3131
|
}
|
|
2646
|
-
get fMarkers() {
|
|
2647
|
-
return this.fComponentsStore.fMarkers.filter((x) => {
|
|
2648
|
-
return this.hostElement.contains(x.hostElement);
|
|
2649
|
-
});
|
|
2650
|
-
}
|
|
2651
3132
|
get boundingElement() {
|
|
2652
3133
|
return this.fPath.hostElement;
|
|
2653
3134
|
}
|
|
@@ -2713,12 +3194,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
2713
3194
|
args: [FConnectionCenterDirective, { descendants: true }]
|
|
2714
3195
|
}] } });
|
|
2715
3196
|
|
|
2716
|
-
let uniqueId$
|
|
3197
|
+
let uniqueId$5 = 0;
|
|
2717
3198
|
class FConnectionComponent extends FConnectionBase {
|
|
2718
3199
|
constructor(elementReference, fConnectionFactory, fComponentsStore) {
|
|
2719
3200
|
super(elementReference, fConnectionFactory);
|
|
2720
3201
|
this.fComponentsStore = fComponentsStore;
|
|
2721
|
-
this.fId = `f-connection-${uniqueId$
|
|
3202
|
+
this.fId = `f-connection-${uniqueId$5++}`;
|
|
2722
3203
|
this._fText = '';
|
|
2723
3204
|
this._fStartColor = 'black';
|
|
2724
3205
|
this._fEndColor = 'black';
|
|
@@ -2792,11 +3273,6 @@ class FConnectionComponent extends FConnectionBase {
|
|
|
2792
3273
|
get fType() {
|
|
2793
3274
|
return this._type;
|
|
2794
3275
|
}
|
|
2795
|
-
get fMarkers() {
|
|
2796
|
-
return this.fComponentsStore.fMarkers.filter((x) => {
|
|
2797
|
-
return this.hostElement.contains(x.hostElement);
|
|
2798
|
-
});
|
|
2799
|
-
}
|
|
2800
3276
|
get boundingElement() {
|
|
2801
3277
|
return this.fPath.hostElement;
|
|
2802
3278
|
}
|
|
@@ -2947,15 +3423,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
2947
3423
|
type: Input
|
|
2948
3424
|
}] } });
|
|
2949
3425
|
|
|
2950
|
-
let uniqueId$
|
|
3426
|
+
let uniqueId$4 = 0;
|
|
2951
3427
|
class FSnapConnectionComponent extends FConnectionBase {
|
|
2952
3428
|
constructor(elementReference, fConnectionFactory, fComponentsStore) {
|
|
2953
3429
|
super(elementReference, fConnectionFactory);
|
|
2954
3430
|
this.fComponentsStore = fComponentsStore;
|
|
2955
|
-
this.fId = `f-snap-connection-${uniqueId$
|
|
3431
|
+
this.fId = `f-snap-connection-${uniqueId$4++}`;
|
|
2956
3432
|
this.fText = '';
|
|
2957
3433
|
this._fStartColor = 'black';
|
|
2958
3434
|
this._fEndColor = 'black';
|
|
3435
|
+
this.fSnapThreshold = 20;
|
|
2959
3436
|
this._fRadius = 8;
|
|
2960
3437
|
this._fOffset = 32;
|
|
2961
3438
|
this._behavior = EFConnectionBehavior.FIXED;
|
|
@@ -3005,26 +3482,21 @@ class FSnapConnectionComponent extends FConnectionBase {
|
|
|
3005
3482
|
get fType() {
|
|
3006
3483
|
return this._type;
|
|
3007
3484
|
}
|
|
3008
|
-
get fMarkers() {
|
|
3009
|
-
return this.fComponentsStore.fMarkers.filter((x) => {
|
|
3010
|
-
return this.hostElement.contains(x.hostElement);
|
|
3011
|
-
});
|
|
3012
|
-
}
|
|
3013
3485
|
get boundingElement() {
|
|
3014
3486
|
return this.fPath.hostElement;
|
|
3015
3487
|
}
|
|
3016
3488
|
ngOnInit() {
|
|
3017
|
-
this.fComponentsStore.
|
|
3489
|
+
this.fComponentsStore.fSnapConnection = this;
|
|
3018
3490
|
}
|
|
3019
3491
|
ngAfterViewInit() {
|
|
3020
3492
|
this.hide();
|
|
3021
3493
|
}
|
|
3022
3494
|
ngOnDestroy() {
|
|
3023
|
-
this.fComponentsStore.
|
|
3495
|
+
this.fComponentsStore.fSnapConnection = undefined;
|
|
3024
3496
|
}
|
|
3025
3497
|
}
|
|
3026
3498
|
FSnapConnectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FSnapConnectionComponent, deps: [{ token: i0.ElementRef }, { token: FConnectionFactory }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
3027
|
-
FSnapConnectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FSnapConnectionComponent, selector: "f-snap-connection", inputs: { fStartColor: "fStartColor", fEndColor: "fEndColor", fRadius: "fRadius", fOffset: "fOffset", fBehavior: "fBehavior", fType: "fType" }, host: { classAttribute: "f-component f-connection f-snap-connection" }, providers: [{ provide: F_CONNECTION, useExisting: FSnapConnectionComponent }], queries: [{ propertyName: "fConnectionCenters", predicate: FConnectionCenterDirective, descendants: true }], viewQueries: [{ propertyName: "fDefs", first: true, predicate: ["defs"], descendants: true, static: true }, { propertyName: "fPath", first: true, predicate: CONNECTION_PATH, descendants: true, static: true }, { propertyName: "fGradient", first: true, predicate: CONNECTION_GRADIENT, descendants: true, static: true }, { propertyName: "fDragHandle", first: true, predicate: FConnectionDragHandleComponent, descendants: true, static: true }, { propertyName: "fSelection", first: true, predicate: FConnectionSelectionComponent, descendants: true, static: true }, { propertyName: "fTextComponent", first: true, predicate: CONNECTION_TEXT, descendants: true, static: true }, { propertyName: "fConnectionCenter", first: true, predicate: ["fConnectionCenter"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\">\n <defs #defs></defs>\n <g class=\"f-connection-group\">\n <linearGradient fConnectionGradient></linearGradient>\n <path fConnectionSelection [attr.d]=\"path\"></path>\n <g>\n <path f-connection-path\n [attr.d]=\"path\">\n </path>\n <circle f-connection-drag-handle r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n <ng-content></ng-content>\n</svg>\n<div #fConnectionCenter class=\"f-connection-center\" *ngIf=\"fConnectionCenters.length\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n</div>\n", styles: [":host{pointer-events:none;position:absolute}:host svg{overflow:visible}:host svg .f-connection-group{pointer-events:all}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3499
|
+
FSnapConnectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FSnapConnectionComponent, selector: "f-snap-connection", inputs: { fStartColor: "fStartColor", fEndColor: "fEndColor", fSnapThreshold: "fSnapThreshold", fRadius: "fRadius", fOffset: "fOffset", fBehavior: "fBehavior", fType: "fType" }, host: { classAttribute: "f-component f-connection f-snap-connection" }, providers: [{ provide: F_CONNECTION, useExisting: FSnapConnectionComponent }], queries: [{ propertyName: "fConnectionCenters", predicate: FConnectionCenterDirective, descendants: true }], viewQueries: [{ propertyName: "fDefs", first: true, predicate: ["defs"], descendants: true, static: true }, { propertyName: "fPath", first: true, predicate: CONNECTION_PATH, descendants: true, static: true }, { propertyName: "fGradient", first: true, predicate: CONNECTION_GRADIENT, descendants: true, static: true }, { propertyName: "fDragHandle", first: true, predicate: FConnectionDragHandleComponent, descendants: true, static: true }, { propertyName: "fSelection", first: true, predicate: FConnectionSelectionComponent, descendants: true, static: true }, { propertyName: "fTextComponent", first: true, predicate: CONNECTION_TEXT, descendants: true, static: true }, { propertyName: "fConnectionCenter", first: true, predicate: ["fConnectionCenter"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\">\n <defs #defs></defs>\n <g class=\"f-connection-group\">\n <linearGradient fConnectionGradient></linearGradient>\n <path fConnectionSelection [attr.d]=\"path\"></path>\n <g>\n <path f-connection-path\n [attr.d]=\"path\">\n </path>\n <circle f-connection-drag-handle r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n <ng-content></ng-content>\n</svg>\n<div #fConnectionCenter class=\"f-connection-center\" *ngIf=\"fConnectionCenters.length\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n</div>\n", styles: [":host{pointer-events:none;position:absolute}:host svg{overflow:visible}:host svg .f-connection-group{pointer-events:all}:host .f-connection-center{pointer-events:all}\n"], components: [{ type: FConnectionGradientComponent, selector: "linearGradient[fConnectionGradient]" }, { type: FConnectionSelectionComponent, selector: "path[fConnectionSelection]" }, { type: FConnectionPathComponent, selector: "path[f-connection-path]" }, { type: FConnectionDragHandleComponent, selector: "circle[f-connection-drag-handle]" }, { type: FConnectionTextComponent, selector: "text[f-connection-text]" }], directives: [{ type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3028
3500
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FSnapConnectionComponent, decorators: [{
|
|
3029
3501
|
type: Component,
|
|
3030
3502
|
args: [{
|
|
@@ -3041,6 +3513,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
3041
3513
|
type: Input
|
|
3042
3514
|
}], fEndColor: [{
|
|
3043
3515
|
type: Input
|
|
3516
|
+
}], fSnapThreshold: [{
|
|
3517
|
+
type: Input
|
|
3044
3518
|
}], fRadius: [{
|
|
3045
3519
|
type: Input
|
|
3046
3520
|
}], fOffset: [{
|
|
@@ -3085,7 +3559,8 @@ const F_CONNECTION_PROVIDERS = [
|
|
|
3085
3559
|
FConnectionComponent,
|
|
3086
3560
|
FConnectionCenterDirective,
|
|
3087
3561
|
FConnectionForCreateComponent,
|
|
3088
|
-
FMarkerDirective
|
|
3562
|
+
FMarkerDirective,
|
|
3563
|
+
FSnapConnectionComponent
|
|
3089
3564
|
];
|
|
3090
3565
|
|
|
3091
3566
|
let ReassignConnectionPreparationExecution = class ReassignConnectionPreparationExecution {
|
|
@@ -3114,7 +3589,7 @@ let ReassignConnectionPreparationExecution = class ReassignConnectionPreparation
|
|
|
3114
3589
|
this.fDraggableDataContext.onPointerDownPosition = Point.fromPoint(request.event.getPosition())
|
|
3115
3590
|
.elementTransform(this.flowHost).div(this.transform.scale);
|
|
3116
3591
|
this.fDraggableDataContext.draggableItems = [
|
|
3117
|
-
new ReassignConnectionDragHandler(this.fMediator, connectionToReassign)
|
|
3592
|
+
new ReassignConnectionDragHandler(this.fMediator, this.fComponentsStore, connectionToReassign)
|
|
3118
3593
|
];
|
|
3119
3594
|
}
|
|
3120
3595
|
getDragHandleElement(position) {
|
|
@@ -3172,20 +3647,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
3172
3647
|
type: Injectable
|
|
3173
3648
|
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: i1.BrowserService }]; } });
|
|
3174
3649
|
|
|
3175
|
-
const
|
|
3650
|
+
const CONNECTIONS_PROVIDERS = [
|
|
3651
|
+
GetInputUnderPointerExecution,
|
|
3652
|
+
GetInputUnderPointerValidator,
|
|
3653
|
+
CreateConnectionFinalizeExecution,
|
|
3654
|
+
CreateConnectionFinalizeValidator,
|
|
3655
|
+
CreateConnectionDragHandlerExecution,
|
|
3656
|
+
CreateConnectionFromOutletPreparationExecution,
|
|
3657
|
+
GetCanBeConnectedOutputByOutletExecution,
|
|
3658
|
+
GetCanBeConnectedOutputByOutletValidator,
|
|
3659
|
+
CreateConnectionFromOutputPreparationExecution,
|
|
3660
|
+
CreateConnectionFromOutputPreparationValidator,
|
|
3661
|
+
CreateConnectionPreparationExecution,
|
|
3662
|
+
CreateConnectionPreparationValidator,
|
|
3663
|
+
ReassignConnectionFinalizeExecution,
|
|
3664
|
+
ReassignConnectionFinalizeValidator,
|
|
3176
3665
|
ReassignConnectionPreparationExecution,
|
|
3177
3666
|
ReassignConnectionPreparationValidator,
|
|
3178
3667
|
];
|
|
3179
3668
|
|
|
3180
|
-
const CONNECTIONS_PROVIDERS = [
|
|
3181
|
-
...CREATE_CONNECTION_FINALIZE_PROVIDERS,
|
|
3182
|
-
...CREATE_CONNECTION_PREPARATION_PROVIDERS,
|
|
3183
|
-
...GET_CAN_BE_CONNECTED_OUTPUT_BY_OUTLET_PROVIDERS,
|
|
3184
|
-
...REASSIGN_CONNECTION_FINALIZE_PROVIDERS,
|
|
3185
|
-
...REASSIGN_CONNECTION_PREPARATION_PROVIDERS,
|
|
3186
|
-
...GET_INPUT_UNDER_POINTER_PROVIDERS,
|
|
3187
|
-
];
|
|
3188
|
-
|
|
3189
3669
|
class GetNodePaddingRequest {
|
|
3190
3670
|
constructor(fNode, rect) {
|
|
3191
3671
|
this.fNode = fNode;
|
|
@@ -3374,21 +3854,20 @@ class PutInputConnectionHandlersToArrayRequest {
|
|
|
3374
3854
|
}
|
|
3375
3855
|
|
|
3376
3856
|
class ConnectionBaseDragHandler {
|
|
3377
|
-
constructor(fMediator, connection) {
|
|
3857
|
+
constructor(fMediator, fComponentsStore, connection) {
|
|
3378
3858
|
this.fMediator = fMediator;
|
|
3859
|
+
this.fComponentsStore = fComponentsStore;
|
|
3379
3860
|
this.connection = connection;
|
|
3380
|
-
this.fromConnectorRect = new RoundedRect();
|
|
3381
|
-
this.fromConnectorSide = EFConnectableSide.BOTTOM;
|
|
3382
|
-
this.toConnectorRect = new RoundedRect();
|
|
3383
|
-
this.toConnectorSide = EFConnectableSide.TOP;
|
|
3384
3861
|
}
|
|
3385
3862
|
initialize() {
|
|
3386
|
-
|
|
3387
|
-
this.
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
this.
|
|
3391
|
-
|
|
3863
|
+
this.fOutputWithRect = this.fMediator.send(new GetConnectorWithRectRequest(this.getOutput()));
|
|
3864
|
+
this.fInputWithRect = this.fMediator.send(new GetConnectorWithRectRequest(this.getInput()));
|
|
3865
|
+
}
|
|
3866
|
+
getOutput() {
|
|
3867
|
+
return this.fComponentsStore.fOutputs.find((x) => x.id === this.connection.fOutputId);
|
|
3868
|
+
}
|
|
3869
|
+
getInput() {
|
|
3870
|
+
return this.fComponentsStore.fInputs.find((x) => x.id === this.connection.fInputId);
|
|
3392
3871
|
}
|
|
3393
3872
|
getDifference(difference, restrictions) {
|
|
3394
3873
|
return {
|
|
@@ -3397,19 +3876,19 @@ class ConnectionBaseDragHandler {
|
|
|
3397
3876
|
};
|
|
3398
3877
|
}
|
|
3399
3878
|
redrawConnection(line) {
|
|
3400
|
-
this.connection.setLine(line.point1, this.
|
|
3879
|
+
this.connection.setLine(line.point1, this.fOutputWithRect.fConnector.fConnectableSide, line.point2, this.fInputWithRect.fConnector.fConnectableSide);
|
|
3401
3880
|
this.connection.redraw();
|
|
3402
3881
|
}
|
|
3403
3882
|
}
|
|
3404
|
-
ConnectionBaseDragHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ConnectionBaseDragHandler, deps: [{ token: i2.FMediator }, { token: FConnectionBase }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3883
|
+
ConnectionBaseDragHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ConnectionBaseDragHandler, deps: [{ token: i2.FMediator }, { token: FComponentsStore }, { token: FConnectionBase }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3405
3884
|
ConnectionBaseDragHandler.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: ConnectionBaseDragHandler, ngImport: i0 });
|
|
3406
3885
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ConnectionBaseDragHandler, decorators: [{
|
|
3407
3886
|
type: Directive
|
|
3408
|
-
}], ctorParameters: function () { return [{ type: i2.FMediator }, { type: FConnectionBase }]; } });
|
|
3887
|
+
}], ctorParameters: function () { return [{ type: i2.FMediator }, { type: FComponentsStore }, { type: FConnectionBase }]; } });
|
|
3409
3888
|
|
|
3410
3889
|
class ConnectionDragHandler extends ConnectionBaseDragHandler {
|
|
3411
|
-
constructor(fMediator, connection) {
|
|
3412
|
-
super(fMediator, connection);
|
|
3890
|
+
constructor(fMediator, fComponentsStore, connection) {
|
|
3891
|
+
super(fMediator, fComponentsStore, connection);
|
|
3413
3892
|
}
|
|
3414
3893
|
setOutputRestrictions(min, max) {
|
|
3415
3894
|
this.sourceRestrictions = { min, max };
|
|
@@ -3421,13 +3900,13 @@ class ConnectionDragHandler extends ConnectionBaseDragHandler {
|
|
|
3421
3900
|
this.redrawConnection(this.getNewLineValue(difference));
|
|
3422
3901
|
}
|
|
3423
3902
|
getNewLineValue(difference) {
|
|
3424
|
-
return this.fMediator.send(new GetConnectionLineRequest(this.
|
|
3903
|
+
return this.fMediator.send(new GetConnectionLineRequest(RoundedRect.fromRect(this.fOutputWithRect.fRect).addPoint(this.getDifference(Object.assign({}, difference), this.sourceRestrictions)), RoundedRect.fromRect(this.fInputWithRect.fRect).addPoint(this.getDifference(Object.assign({}, difference), this.targetRestrictions)), this.connection.fBehavior, this.fOutputWithRect.fConnector.fConnectableSide, this.fInputWithRect.fConnector.fConnectableSide));
|
|
3425
3904
|
}
|
|
3426
3905
|
}
|
|
3427
3906
|
|
|
3428
3907
|
class ConnectionTargetDragHandler extends ConnectionBaseDragHandler {
|
|
3429
|
-
constructor(fMediator, connection, minDistance, maxDistance) {
|
|
3430
|
-
super(fMediator, connection);
|
|
3908
|
+
constructor(fMediator, fComponentsStore, connection, minDistance, maxDistance) {
|
|
3909
|
+
super(fMediator, fComponentsStore, connection);
|
|
3431
3910
|
this.minDistance = minDistance;
|
|
3432
3911
|
this.maxDistance = maxDistance;
|
|
3433
3912
|
}
|
|
@@ -3435,7 +3914,7 @@ class ConnectionTargetDragHandler extends ConnectionBaseDragHandler {
|
|
|
3435
3914
|
this.redrawConnection(this.getNewLineValue(difference));
|
|
3436
3915
|
}
|
|
3437
3916
|
getNewLineValue(difference) {
|
|
3438
|
-
return this.fMediator.send(new GetConnectionLineRequest(this.
|
|
3917
|
+
return this.fMediator.send(new GetConnectionLineRequest(RoundedRect.fromRect(this.fOutputWithRect.fRect), RoundedRect.fromRect(this.fInputWithRect.fRect).addPoint(this.getDifference(Object.assign({}, difference), { min: this.minDistance, max: this.maxDistance })), this.connection.fBehavior, this.fOutputWithRect.fConnector.fConnectableSide, this.fInputWithRect.fConnector.fConnectableSide));
|
|
3439
3918
|
}
|
|
3440
3919
|
}
|
|
3441
3920
|
|
|
@@ -3479,7 +3958,7 @@ let PutInputConnectionHandlersToArrayExecution = class PutInputConnectionHandler
|
|
|
3479
3958
|
return result;
|
|
3480
3959
|
}
|
|
3481
3960
|
getNewConnectionHandler(connection, nodeDragHandler) {
|
|
3482
|
-
const handler = new ConnectionDragHandler(this.fMediator, connection);
|
|
3961
|
+
const handler = new ConnectionDragHandler(this.fMediator, this.fComponentsStore, connection);
|
|
3483
3962
|
handler.setInputRestrictions(nodeDragHandler.minDistance, nodeDragHandler.maxDistance);
|
|
3484
3963
|
return handler;
|
|
3485
3964
|
}
|
|
@@ -3487,7 +3966,7 @@ let PutInputConnectionHandlersToArrayExecution = class PutInputConnectionHandler
|
|
|
3487
3966
|
result[index].setInputRestrictions(nodeDragHandler.minDistance, nodeDragHandler.maxDistance);
|
|
3488
3967
|
}
|
|
3489
3968
|
getNewSourceConnectionHandler(connection, nodeDragHandler) {
|
|
3490
|
-
return new ConnectionTargetDragHandler(this.fMediator, connection, nodeDragHandler.minDistance, nodeDragHandler.maxDistance);
|
|
3969
|
+
return new ConnectionTargetDragHandler(this.fMediator, this.fComponentsStore, connection, nodeDragHandler.minDistance, nodeDragHandler.maxDistance);
|
|
3491
3970
|
}
|
|
3492
3971
|
};
|
|
3493
3972
|
PutInputConnectionHandlersToArrayExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PutInputConnectionHandlersToArrayExecution, deps: [{ token: FComponentsStore }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -3508,8 +3987,8 @@ class PutOutputConnectionHandlersToArrayRequest {
|
|
|
3508
3987
|
}
|
|
3509
3988
|
|
|
3510
3989
|
class ConnectionSourceDragHandler extends ConnectionBaseDragHandler {
|
|
3511
|
-
constructor(fMediator, connection, minDistance, maxDistance) {
|
|
3512
|
-
super(fMediator, connection);
|
|
3990
|
+
constructor(fMediator, fComponentsStore, connection, minDistance, maxDistance) {
|
|
3991
|
+
super(fMediator, fComponentsStore, connection);
|
|
3513
3992
|
this.minDistance = minDistance;
|
|
3514
3993
|
this.maxDistance = maxDistance;
|
|
3515
3994
|
}
|
|
@@ -3517,7 +3996,7 @@ class ConnectionSourceDragHandler extends ConnectionBaseDragHandler {
|
|
|
3517
3996
|
this.redrawConnection(this.getNewLineValue(difference));
|
|
3518
3997
|
}
|
|
3519
3998
|
getNewLineValue(difference) {
|
|
3520
|
-
return this.fMediator.send(new GetConnectionLineRequest(this.
|
|
3999
|
+
return this.fMediator.send(new GetConnectionLineRequest(RoundedRect.fromRect(this.fOutputWithRect.fRect).addPoint(this.getDifference(Object.assign({}, difference), { min: this.minDistance, max: this.maxDistance })), RoundedRect.fromRect(this.fInputWithRect.fRect), this.connection.fBehavior, this.fOutputWithRect.fConnector.fConnectableSide, this.fInputWithRect.fConnector.fConnectableSide));
|
|
3521
4000
|
}
|
|
3522
4001
|
}
|
|
3523
4002
|
|
|
@@ -3561,7 +4040,7 @@ let PutOutputConnectionHandlersToArrayExecution = class PutOutputConnectionHandl
|
|
|
3561
4040
|
return result;
|
|
3562
4041
|
}
|
|
3563
4042
|
getNewConnectionHandler(connection, nodeDragHandler) {
|
|
3564
|
-
const handler = new ConnectionDragHandler(this.fMediator, connection);
|
|
4043
|
+
const handler = new ConnectionDragHandler(this.fMediator, this.fComponentsStore, connection);
|
|
3565
4044
|
handler.setOutputRestrictions(nodeDragHandler.minDistance, nodeDragHandler.maxDistance);
|
|
3566
4045
|
return handler;
|
|
3567
4046
|
}
|
|
@@ -3569,7 +4048,7 @@ let PutOutputConnectionHandlersToArrayExecution = class PutOutputConnectionHandl
|
|
|
3569
4048
|
result[index].setOutputRestrictions(nodeDragHandler.minDistance, nodeDragHandler.maxDistance);
|
|
3570
4049
|
}
|
|
3571
4050
|
getNewSourceConnectionHandler(connection, nodeDragHandler) {
|
|
3572
|
-
return new ConnectionSourceDragHandler(this.fMediator, connection, nodeDragHandler.minDistance, nodeDragHandler.maxDistance);
|
|
4051
|
+
return new ConnectionSourceDragHandler(this.fMediator, this.fComponentsStore, connection, nodeDragHandler.minDistance, nodeDragHandler.maxDistance);
|
|
3573
4052
|
}
|
|
3574
4053
|
};
|
|
3575
4054
|
PutOutputConnectionHandlersToArrayExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PutOutputConnectionHandlersToArrayExecution, deps: [{ token: FComponentsStore }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -4673,13 +5152,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
4673
5152
|
}]
|
|
4674
5153
|
}] });
|
|
4675
5154
|
|
|
4676
|
-
let uniqueId$
|
|
5155
|
+
let uniqueId$3 = 0;
|
|
4677
5156
|
class FExternalItemDirective extends FExternalItemBase {
|
|
4678
5157
|
constructor(elementReference, fExternalItemService) {
|
|
4679
5158
|
super();
|
|
4680
5159
|
this.elementReference = elementReference;
|
|
4681
5160
|
this.fExternalItemService = fExternalItemService;
|
|
4682
|
-
this.fExternalItemId = `f-external-item-${uniqueId$
|
|
5161
|
+
this.fExternalItemId = `f-external-item-${uniqueId$3++}`;
|
|
4683
5162
|
this.fDisabled = false;
|
|
4684
5163
|
}
|
|
4685
5164
|
get hostElement() {
|
|
@@ -4885,13 +5364,6 @@ class FSelectionChangeEvent {
|
|
|
4885
5364
|
}
|
|
4886
5365
|
}
|
|
4887
5366
|
|
|
4888
|
-
class MinimapDragPreparationRequest {
|
|
4889
|
-
constructor(event, minimap) {
|
|
4890
|
-
this.event = event;
|
|
4891
|
-
this.minimap = minimap;
|
|
4892
|
-
}
|
|
4893
|
-
}
|
|
4894
|
-
|
|
4895
5367
|
class CalculateFlowPointFromMinimapPointRequest {
|
|
4896
5368
|
constructor(flowRect, canvasPosition, eventPoint, minimap) {
|
|
4897
5369
|
this.flowRect = flowRect;
|
|
@@ -4935,6 +5407,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
4935
5407
|
type: Injectable
|
|
4936
5408
|
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
4937
5409
|
|
|
5410
|
+
class MinimapDragFinalizeRequest {
|
|
5411
|
+
constructor(event) {
|
|
5412
|
+
this.event = event;
|
|
5413
|
+
}
|
|
5414
|
+
}
|
|
5415
|
+
|
|
5416
|
+
let MinimapDragFinalizeExecution = class MinimapDragFinalizeExecution {
|
|
5417
|
+
constructor(fDraggableDataContext) {
|
|
5418
|
+
this.fDraggableDataContext = fDraggableDataContext;
|
|
5419
|
+
}
|
|
5420
|
+
handle(request) {
|
|
5421
|
+
this.fDraggableDataContext.draggableItems.forEach((x) => {
|
|
5422
|
+
var _a;
|
|
5423
|
+
(_a = x.complete) === null || _a === void 0 ? void 0 : _a.call(x);
|
|
5424
|
+
});
|
|
5425
|
+
}
|
|
5426
|
+
};
|
|
5427
|
+
MinimapDragFinalizeExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MinimapDragFinalizeExecution, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5428
|
+
MinimapDragFinalizeExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MinimapDragFinalizeExecution });
|
|
5429
|
+
MinimapDragFinalizeExecution = __decorate([
|
|
5430
|
+
FExecutionRegister(MinimapDragFinalizeRequest)
|
|
5431
|
+
], MinimapDragFinalizeExecution);
|
|
5432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MinimapDragFinalizeExecution, decorators: [{
|
|
5433
|
+
type: Injectable
|
|
5434
|
+
}], ctorParameters: function () { return [{ type: FDraggableDataContext }]; } });
|
|
5435
|
+
|
|
4938
5436
|
class FMinimapDragHandler {
|
|
4939
5437
|
constructor(fComponentsStore, fMediator, flowRect, canvasPosition, eventPoint, minimap) {
|
|
4940
5438
|
this.fComponentsStore = fComponentsStore;
|
|
@@ -4966,7 +5464,36 @@ class FMinimapDragHandler {
|
|
|
4966
5464
|
complete() {
|
|
4967
5465
|
var _a;
|
|
4968
5466
|
(_a = this.fComponentsStore.fCanvas) === null || _a === void 0 ? void 0 : _a.hostElement.classList.remove('f-scaled-animate');
|
|
4969
|
-
this.fComponentsStore.fCanvas.
|
|
5467
|
+
this.fComponentsStore.fCanvas.emitCanvasChangeEvent();
|
|
5468
|
+
}
|
|
5469
|
+
}
|
|
5470
|
+
|
|
5471
|
+
let MinimapDragFinalizeValidator = class MinimapDragFinalizeValidator {
|
|
5472
|
+
constructor(fDraggableDataContext) {
|
|
5473
|
+
this.fDraggableDataContext = fDraggableDataContext;
|
|
5474
|
+
}
|
|
5475
|
+
handle(request) {
|
|
5476
|
+
return this.fDraggableDataContext.draggableItems.some((x) => x instanceof FMinimapDragHandler);
|
|
5477
|
+
}
|
|
5478
|
+
};
|
|
5479
|
+
MinimapDragFinalizeValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MinimapDragFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5480
|
+
MinimapDragFinalizeValidator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MinimapDragFinalizeValidator });
|
|
5481
|
+
MinimapDragFinalizeValidator = __decorate([
|
|
5482
|
+
FValidatorRegister(MinimapDragFinalizeRequest)
|
|
5483
|
+
], MinimapDragFinalizeValidator);
|
|
5484
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MinimapDragFinalizeValidator, decorators: [{
|
|
5485
|
+
type: Injectable
|
|
5486
|
+
}], ctorParameters: function () { return [{ type: FDraggableDataContext }]; } });
|
|
5487
|
+
|
|
5488
|
+
const MINIMAP_DRAG_FINALIZE_PROVIDERS = [
|
|
5489
|
+
MinimapDragFinalizeExecution,
|
|
5490
|
+
MinimapDragFinalizeValidator,
|
|
5491
|
+
];
|
|
5492
|
+
|
|
5493
|
+
class MinimapDragPreparationRequest {
|
|
5494
|
+
constructor(event, minimap) {
|
|
5495
|
+
this.event = event;
|
|
5496
|
+
this.minimap = minimap;
|
|
4970
5497
|
}
|
|
4971
5498
|
}
|
|
4972
5499
|
|
|
@@ -4984,7 +5511,7 @@ let MinimapDragPreparationExecution = class MinimapDragPreparationExecution {
|
|
|
4984
5511
|
const startCanvasPosition = Point.fromPoint(this.fComponentsStore.fCanvas.transform.position);
|
|
4985
5512
|
this.fComponentsStore.fCanvas.setPosition(this.getNewPosition(eventPoint, request.minimap));
|
|
4986
5513
|
this.fComponentsStore.fCanvas.redraw();
|
|
4987
|
-
this.fComponentsStore.fCanvas.
|
|
5514
|
+
this.fComponentsStore.fCanvas.emitCanvasChangeEvent();
|
|
4988
5515
|
this.fDraggableDataContext.onPointerDownScale = 1;
|
|
4989
5516
|
this.fDraggableDataContext.onPointerDownPosition = Point.fromPoint(eventPoint).elementTransform(this.flowHost);
|
|
4990
5517
|
this.fDraggableDataContext.draggableItems = [
|
|
@@ -5032,53 +5559,20 @@ const MINIMAP_DRAG_PREPARATION_PROVIDERS = [
|
|
|
5032
5559
|
MinimapDragPreparationValidator,
|
|
5033
5560
|
];
|
|
5034
5561
|
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5562
|
+
function checkRectIsFinite(rect) {
|
|
5563
|
+
if (!Number.isFinite(rect.width) || !Number.isFinite(rect.height) || !Number.isFinite(rect.x) || !Number.isFinite(rect.y)) {
|
|
5564
|
+
return RectExtensions.initialize(0, 0, 0, 0);
|
|
5038
5565
|
}
|
|
5566
|
+
return rect;
|
|
5039
5567
|
}
|
|
5040
5568
|
|
|
5041
|
-
|
|
5042
|
-
constructor(
|
|
5043
|
-
this.
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
this.fDraggableDataContext.draggableItems.forEach((x) => {
|
|
5047
|
-
var _a;
|
|
5048
|
-
(_a = x.complete) === null || _a === void 0 ? void 0 : _a.call(x);
|
|
5049
|
-
});
|
|
5050
|
-
}
|
|
5051
|
-
};
|
|
5052
|
-
MinimapDragFinalizeExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MinimapDragFinalizeExecution, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5053
|
-
MinimapDragFinalizeExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MinimapDragFinalizeExecution });
|
|
5054
|
-
MinimapDragFinalizeExecution = __decorate([
|
|
5055
|
-
FExecutionRegister(MinimapDragFinalizeRequest)
|
|
5056
|
-
], MinimapDragFinalizeExecution);
|
|
5057
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MinimapDragFinalizeExecution, decorators: [{
|
|
5058
|
-
type: Injectable
|
|
5059
|
-
}], ctorParameters: function () { return [{ type: FDraggableDataContext }]; } });
|
|
5060
|
-
|
|
5061
|
-
let MinimapDragFinalizeValidator = class MinimapDragFinalizeValidator {
|
|
5062
|
-
constructor(fDraggableDataContext) {
|
|
5063
|
-
this.fDraggableDataContext = fDraggableDataContext;
|
|
5064
|
-
}
|
|
5065
|
-
handle(request) {
|
|
5066
|
-
return this.fDraggableDataContext.draggableItems.some((x) => x instanceof FMinimapDragHandler);
|
|
5569
|
+
class FMinimapData {
|
|
5570
|
+
constructor(element, scale = 1, viewBox = RectExtensions.initialize(0, 0, 0, 0)) {
|
|
5571
|
+
this.element = element;
|
|
5572
|
+
this.scale = scale;
|
|
5573
|
+
this.viewBox = viewBox;
|
|
5067
5574
|
}
|
|
5068
|
-
}
|
|
5069
|
-
MinimapDragFinalizeValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MinimapDragFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5070
|
-
MinimapDragFinalizeValidator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MinimapDragFinalizeValidator });
|
|
5071
|
-
MinimapDragFinalizeValidator = __decorate([
|
|
5072
|
-
FValidatorRegister(MinimapDragFinalizeRequest)
|
|
5073
|
-
], MinimapDragFinalizeValidator);
|
|
5074
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MinimapDragFinalizeValidator, decorators: [{
|
|
5075
|
-
type: Injectable
|
|
5076
|
-
}], ctorParameters: function () { return [{ type: FDraggableDataContext }]; } });
|
|
5077
|
-
|
|
5078
|
-
const MINIMAP_DRAG_FINALIZE_PROVIDERS = [
|
|
5079
|
-
MinimapDragFinalizeExecution,
|
|
5080
|
-
MinimapDragFinalizeValidator,
|
|
5081
|
-
];
|
|
5575
|
+
}
|
|
5082
5576
|
|
|
5083
5577
|
const F_MINIMAP_DRAG_AND_DROP_PROVIDERS = [
|
|
5084
5578
|
CalculateFlowPointFromMinimapPointExecution,
|
|
@@ -5250,987 +5744,837 @@ const F_SELECTION_AREA_DRAG_AND_DROP_PROVIDERS = [
|
|
|
5250
5744
|
...SELECTION_AREA_PREPARATION_PROVIDERS
|
|
5251
5745
|
];
|
|
5252
5746
|
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
...NODE_RESIZE_PROVIDERS,
|
|
5261
|
-
...F_SELECTION_AREA_DRAG_AND_DROP_PROVIDERS,
|
|
5262
|
-
...F_MINIMAP_DRAG_AND_DROP_PROVIDERS
|
|
5263
|
-
];
|
|
5747
|
+
class FSelectionAreaBase {
|
|
5748
|
+
}
|
|
5749
|
+
FSelectionAreaBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FSelectionAreaBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
5750
|
+
FSelectionAreaBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: FSelectionAreaBase, ngImport: i0 });
|
|
5751
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FSelectionAreaBase, decorators: [{
|
|
5752
|
+
type: Directive
|
|
5753
|
+
}] });
|
|
5264
5754
|
|
|
5265
|
-
|
|
5266
|
-
constructor(
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
this.fDraggableDataContext.selectedItems.forEach((x) => x.deselect());
|
|
5271
|
-
this.fDraggableDataContext.selectedItems = [];
|
|
5272
|
-
this.fDraggableDataContext.isSelectedChanged = true;
|
|
5755
|
+
class FSelectionAreaComponent extends FSelectionAreaBase {
|
|
5756
|
+
constructor(elementReference, fMediator) {
|
|
5757
|
+
super();
|
|
5758
|
+
this.elementReference = elementReference;
|
|
5759
|
+
this.fMediator = fMediator;
|
|
5273
5760
|
}
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
ClearSelectionExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ClearSelectionExecution });
|
|
5277
|
-
ClearSelectionExecution = __decorate([
|
|
5278
|
-
FExecutionRegister(ClearSelectionRequest)
|
|
5279
|
-
], ClearSelectionExecution);
|
|
5280
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ClearSelectionExecution, decorators: [{
|
|
5281
|
-
type: Injectable
|
|
5282
|
-
}], ctorParameters: function () { return [{ type: FDraggableDataContext }]; } });
|
|
5283
|
-
|
|
5284
|
-
class CreateConnectionMarkersRequest {
|
|
5285
|
-
constructor(fConnection) {
|
|
5286
|
-
this.fConnection = fConnection;
|
|
5761
|
+
get hostElement() {
|
|
5762
|
+
return this.elementReference.nativeElement;
|
|
5287
5763
|
}
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
let CreateConnectionMarkersExecution = class CreateConnectionMarkersExecution {
|
|
5291
|
-
constructor(fBrowser) {
|
|
5292
|
-
this.fBrowser = fBrowser;
|
|
5293
|
-
}
|
|
5294
|
-
handle(request) {
|
|
5295
|
-
const element = createSVGElement$1('defs', this.fBrowser);
|
|
5296
|
-
const fConnection = request.fConnection;
|
|
5297
|
-
fConnection.fMarkers.forEach((marker) => {
|
|
5298
|
-
const markerElement = this.createMarkerElement(marker, fConnection.fId);
|
|
5299
|
-
const clone = marker.hostElement.cloneNode(true);
|
|
5300
|
-
clone.setAttribute('height', `${marker.height}`);
|
|
5301
|
-
clone.setAttribute('width', `${marker.width}`);
|
|
5302
|
-
clone.removeAttribute('markerUnits');
|
|
5303
|
-
clone.style.display = 'unset';
|
|
5304
|
-
markerElement.append(clone);
|
|
5305
|
-
element.append(markerElement);
|
|
5306
|
-
});
|
|
5307
|
-
fConnection.fDefs.nativeElement.innerHTML = element.innerHTML;
|
|
5308
|
-
this.makeSafariCompatible(fConnection);
|
|
5309
|
-
}
|
|
5310
|
-
// Safari does not support markers on path elements if markers are defined after the path element
|
|
5311
|
-
makeSafariCompatible(fConnection) {
|
|
5312
|
-
fConnection.fPath.hostElement.replaceWith(fConnection.fPath.hostElement);
|
|
5313
|
-
}
|
|
5314
|
-
createMarkerElement(marker, fConnectionId) {
|
|
5315
|
-
const markerElement = createSVGElement$1('marker', this.fBrowser);
|
|
5316
|
-
markerElement.setAttribute('id', normalizeDomElementId(marker.type + '-' + fConnectionId));
|
|
5317
|
-
markerElement.setAttribute('markerHeight', `${marker.height}`);
|
|
5318
|
-
markerElement.setAttribute('markerWidth', `${marker.width}`);
|
|
5319
|
-
markerElement.setAttribute('orient', `${marker.orient}`);
|
|
5320
|
-
markerElement.setAttribute('refX', `${marker.refX}`);
|
|
5321
|
-
markerElement.setAttribute('refY', `${marker.refY}`);
|
|
5322
|
-
markerElement.setAttribute('markerUnits', `${marker.markerUnits}`);
|
|
5323
|
-
return markerElement;
|
|
5324
|
-
}
|
|
5325
|
-
};
|
|
5326
|
-
CreateConnectionMarkersExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CreateConnectionMarkersExecution, deps: [{ token: i1.BrowserService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5327
|
-
CreateConnectionMarkersExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CreateConnectionMarkersExecution });
|
|
5328
|
-
CreateConnectionMarkersExecution = __decorate([
|
|
5329
|
-
FExecutionRegister(CreateConnectionMarkersRequest)
|
|
5330
|
-
], CreateConnectionMarkersExecution);
|
|
5331
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CreateConnectionMarkersExecution, decorators: [{
|
|
5332
|
-
type: Injectable
|
|
5333
|
-
}], ctorParameters: function () { return [{ type: i1.BrowserService }]; } });
|
|
5334
|
-
function createSVGElement$1(tag, fBrowser) {
|
|
5335
|
-
return fBrowser.document.createElementNS('http://www.w3.org/2000/svg', tag);
|
|
5336
|
-
}
|
|
5337
|
-
|
|
5338
|
-
class CreateRoundedRectFromElementRequest {
|
|
5339
|
-
constructor(element) {
|
|
5340
|
-
this.element = element;
|
|
5764
|
+
ngOnInit() {
|
|
5765
|
+
this.hostElement.style.display = 'none';
|
|
5341
5766
|
}
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
let CreateRoundedRectFromElementExecution = class CreateRoundedRectFromElementExecution {
|
|
5345
|
-
constructor(fBrowser) {
|
|
5346
|
-
this.fBrowser = fBrowser;
|
|
5767
|
+
hide() {
|
|
5768
|
+
this.hostElement.style.display = 'none';
|
|
5347
5769
|
}
|
|
5348
|
-
|
|
5349
|
-
|
|
5770
|
+
show() {
|
|
5771
|
+
this.hostElement.style.display = 'block';
|
|
5350
5772
|
}
|
|
5351
|
-
|
|
5352
|
-
const
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
return rect;
|
|
5773
|
+
draw(object) {
|
|
5774
|
+
const style = this.hostElement.style;
|
|
5775
|
+
style.left = object.x + 'px';
|
|
5776
|
+
style.top = object.y + 'px';
|
|
5777
|
+
style.width = object.width + 'px';
|
|
5778
|
+
style.height = object.height + 'px';
|
|
5358
5779
|
}
|
|
5359
|
-
|
|
5360
|
-
|
|
5780
|
+
onPointerDown(event) {
|
|
5781
|
+
this.fMediator.send(new SelectionAreaPreparationRequest(event, this));
|
|
5361
5782
|
}
|
|
5362
|
-
|
|
5363
|
-
|
|
5783
|
+
onPointerUp(event) {
|
|
5784
|
+
this.fMediator.send(new SelectionAreaFinalizeRequest(event));
|
|
5364
5785
|
}
|
|
5365
|
-
};
|
|
5366
|
-
CreateRoundedRectFromElementExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CreateRoundedRectFromElementExecution, deps: [{ token: i1.BrowserService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5367
|
-
CreateRoundedRectFromElementExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CreateRoundedRectFromElementExecution });
|
|
5368
|
-
CreateRoundedRectFromElementExecution = __decorate([
|
|
5369
|
-
FExecutionRegister(CreateRoundedRectFromElementRequest)
|
|
5370
|
-
], CreateRoundedRectFromElementExecution);
|
|
5371
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CreateRoundedRectFromElementExecution, decorators: [{
|
|
5372
|
-
type: Injectable
|
|
5373
|
-
}], ctorParameters: function () { return [{ type: i1.BrowserService }]; } });
|
|
5374
|
-
|
|
5375
|
-
class EmitTransformChangesRequest {
|
|
5376
5786
|
}
|
|
5787
|
+
FSelectionAreaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FSelectionAreaComponent, deps: [{ token: i0.ElementRef }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Component });
|
|
5788
|
+
FSelectionAreaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FSelectionAreaComponent, selector: "f-selection-area", host: { classAttribute: "f-selection-area f-component" }, providers: [
|
|
5789
|
+
{ provide: F_DRAG_AND_DROP_PLUGIN, useExisting: FSelectionAreaComponent },
|
|
5790
|
+
], usesInheritance: true, ngImport: i0, template: ``, isInline: true, styles: [":host{position:absolute}\n"] });
|
|
5791
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FSelectionAreaComponent, decorators: [{
|
|
5792
|
+
type: Component,
|
|
5793
|
+
args: [{
|
|
5794
|
+
selector: "f-selection-area",
|
|
5795
|
+
template: ``,
|
|
5796
|
+
styleUrls: ['./f-selection-area.component.scss'],
|
|
5797
|
+
host: {
|
|
5798
|
+
'class': 'f-selection-area f-component'
|
|
5799
|
+
},
|
|
5800
|
+
providers: [
|
|
5801
|
+
{ provide: F_DRAG_AND_DROP_PLUGIN, useExisting: FSelectionAreaComponent },
|
|
5802
|
+
],
|
|
5803
|
+
}]
|
|
5804
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2.FMediator }]; } });
|
|
5377
5805
|
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
}
|
|
5382
|
-
handle(request) {
|
|
5383
|
-
this.fTransformStore.changes.next();
|
|
5384
|
-
}
|
|
5385
|
-
};
|
|
5386
|
-
EmitTransformChangesExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EmitTransformChangesExecution, deps: [{ token: FTransformStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5387
|
-
EmitTransformChangesExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EmitTransformChangesExecution });
|
|
5388
|
-
EmitTransformChangesExecution = __decorate([
|
|
5389
|
-
FExecutionRegister(EmitTransformChangesRequest)
|
|
5390
|
-
], EmitTransformChangesExecution);
|
|
5391
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EmitTransformChangesExecution, decorators: [{
|
|
5392
|
-
type: Injectable
|
|
5393
|
-
}], ctorParameters: function () { return [{ type: FTransformStore }]; } });
|
|
5394
|
-
|
|
5395
|
-
class GetElementRectInFlowRequest {
|
|
5396
|
-
constructor(element) {
|
|
5397
|
-
this.element = element;
|
|
5398
|
-
}
|
|
5399
|
-
}
|
|
5806
|
+
const F_SELECTION_AREA_PROVIDERS = [
|
|
5807
|
+
FSelectionAreaComponent
|
|
5808
|
+
];
|
|
5400
5809
|
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
handle(request) {
|
|
5413
|
-
const systemRect = this.fMediator.send(new CreateRoundedRectFromElementRequest(request.element));
|
|
5414
|
-
const position = this.transformElementPositionInFlow(systemRect);
|
|
5415
|
-
const size = this.transformElementSizeInFlow(systemRect);
|
|
5416
|
-
return new RoundedRect(position.x, position.y, size.width, size.height, systemRect.radius1, systemRect.radius2, systemRect.radius3, systemRect.radius4);
|
|
5417
|
-
}
|
|
5418
|
-
transformElementPositionInFlow(rect) {
|
|
5419
|
-
return Point.fromPoint(rect).elementTransform(this.flowHost).sub(this.transform.scaledPosition).sub(this.transform.position).div(this.transform.scale);
|
|
5420
|
-
}
|
|
5421
|
-
transformElementSizeInFlow(rect) {
|
|
5422
|
-
return SizeExtensions.initialize(rect.width / this.transform.scale, rect.height / this.transform.scale);
|
|
5423
|
-
}
|
|
5424
|
-
};
|
|
5425
|
-
GetElementRectInFlowExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetElementRectInFlowExecution, deps: [{ token: FComponentsStore }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5426
|
-
GetElementRectInFlowExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetElementRectInFlowExecution });
|
|
5427
|
-
GetElementRectInFlowExecution = __decorate([
|
|
5428
|
-
FExecutionRegister(GetElementRectInFlowRequest)
|
|
5429
|
-
], GetElementRectInFlowExecution);
|
|
5430
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetElementRectInFlowExecution, decorators: [{
|
|
5431
|
-
type: Injectable
|
|
5432
|
-
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: i2.FMediator }]; } });
|
|
5810
|
+
const F_DRAGGABLE_PROVIDERS = [
|
|
5811
|
+
...CANVAS_PROVIDERS,
|
|
5812
|
+
...CONNECTIONS_PROVIDERS,
|
|
5813
|
+
...DRAG_AND_DROP_COMMON_PROVIDERS,
|
|
5814
|
+
...SINGLE_SELECT_PROVIDERS,
|
|
5815
|
+
...F_EXTERNAL_ITEM_DRAG_AND_DROP_PROVIDERS,
|
|
5816
|
+
...NODE_PROVIDERS,
|
|
5817
|
+
...NODE_RESIZE_PROVIDERS,
|
|
5818
|
+
...F_SELECTION_AREA_DRAG_AND_DROP_PROVIDERS,
|
|
5819
|
+
...F_MINIMAP_DRAG_AND_DROP_PROVIDERS
|
|
5820
|
+
];
|
|
5433
5821
|
|
|
5434
|
-
let
|
|
5435
|
-
constructor(
|
|
5436
|
-
this.fComponentsStore = fComponentsStore;
|
|
5822
|
+
let ClearSelectionExecution = class ClearSelectionExecution {
|
|
5823
|
+
constructor(fDraggableDataContext) {
|
|
5437
5824
|
this.fDraggableDataContext = fDraggableDataContext;
|
|
5438
|
-
this.fMediator = fMediator;
|
|
5439
|
-
}
|
|
5440
|
-
get fNodes() {
|
|
5441
|
-
return this.fComponentsStore.fNodes;
|
|
5442
|
-
}
|
|
5443
|
-
get fConnections() {
|
|
5444
|
-
return this.fComponentsStore.fConnections;
|
|
5445
|
-
}
|
|
5446
|
-
get transform() {
|
|
5447
|
-
return this.fComponentsStore.fCanvas.transform;
|
|
5448
|
-
}
|
|
5449
|
-
handle() {
|
|
5450
|
-
return [...this.getNodesWithRects(), ...this.getConnectionsWithRects()].filter((x) => {
|
|
5451
|
-
return !this.fDraggableDataContext.selectedItems.includes(x.element);
|
|
5452
|
-
});
|
|
5453
|
-
}
|
|
5454
|
-
getNodesWithRects() {
|
|
5455
|
-
return this.fNodes.filter((x) => !x.fSelectionDisabled).map((x) => {
|
|
5456
|
-
return {
|
|
5457
|
-
element: x,
|
|
5458
|
-
rect: RectExtensions.mult(this.fMediator.send(new GetElementRectInFlowRequest(x.hostElement)), this.transform.scale)
|
|
5459
|
-
};
|
|
5460
|
-
});
|
|
5461
|
-
}
|
|
5462
|
-
getConnectionsWithRects() {
|
|
5463
|
-
return this.fConnections.filter((x) => !x.fSelectionDisabled).map((x) => {
|
|
5464
|
-
return {
|
|
5465
|
-
element: x,
|
|
5466
|
-
rect: RectExtensions.mult(this.fMediator.send(new GetElementRectInFlowRequest(x.boundingElement)), this.transform.scale)
|
|
5467
|
-
};
|
|
5468
|
-
});
|
|
5469
|
-
}
|
|
5470
|
-
};
|
|
5471
|
-
GetCanBeSelectedItemsExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetCanBeSelectedItemsExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5472
|
-
GetCanBeSelectedItemsExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetCanBeSelectedItemsExecution });
|
|
5473
|
-
GetCanBeSelectedItemsExecution = __decorate([
|
|
5474
|
-
FExecutionRegister(GetCanBeSelectedItemsRequest)
|
|
5475
|
-
], GetCanBeSelectedItemsExecution);
|
|
5476
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetCanBeSelectedItemsExecution, decorators: [{
|
|
5477
|
-
type: Injectable
|
|
5478
|
-
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: i2.FMediator }]; } });
|
|
5479
|
-
|
|
5480
|
-
class GetDeepChildrenNodesAndGroupsRequest {
|
|
5481
|
-
constructor(fId) {
|
|
5482
|
-
this.fId = fId;
|
|
5483
|
-
}
|
|
5484
|
-
}
|
|
5485
|
-
|
|
5486
|
-
let GetDeepChildrenNodesAndGroupsExecution = class GetDeepChildrenNodesAndGroupsExecution {
|
|
5487
|
-
constructor(fComponentsStore) {
|
|
5488
|
-
this.fComponentsStore = fComponentsStore;
|
|
5489
5825
|
}
|
|
5490
5826
|
handle(request) {
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
if (visited.has(fId)) {
|
|
5495
|
-
throw new Error('Circular reference detected in the node hierarchy. Node id: ' + fId);
|
|
5496
|
-
}
|
|
5497
|
-
visited.add(fId);
|
|
5498
|
-
const result = this.fComponentsStore.fNodes.filter((x) => x.fParentId === fId);
|
|
5499
|
-
result.forEach((x) => {
|
|
5500
|
-
result.push(...this.getChildrenNodes(x.fId, visited));
|
|
5501
|
-
});
|
|
5502
|
-
return result;
|
|
5503
|
-
}
|
|
5504
|
-
};
|
|
5505
|
-
GetDeepChildrenNodesAndGroupsExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetDeepChildrenNodesAndGroupsExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5506
|
-
GetDeepChildrenNodesAndGroupsExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetDeepChildrenNodesAndGroupsExecution });
|
|
5507
|
-
GetDeepChildrenNodesAndGroupsExecution = __decorate([
|
|
5508
|
-
FExecutionRegister(GetDeepChildrenNodesAndGroupsRequest)
|
|
5509
|
-
], GetDeepChildrenNodesAndGroupsExecution);
|
|
5510
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetDeepChildrenNodesAndGroupsExecution, decorators: [{
|
|
5511
|
-
type: Injectable
|
|
5512
|
-
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
5513
|
-
|
|
5514
|
-
class GetConnectionLineRequest {
|
|
5515
|
-
constructor(outputRect, inputRect, behavior, outputSide, inputSide) {
|
|
5516
|
-
this.outputRect = outputRect;
|
|
5517
|
-
this.inputRect = inputRect;
|
|
5518
|
-
this.behavior = behavior;
|
|
5519
|
-
this.outputSide = outputSide;
|
|
5520
|
-
this.inputSide = inputSide;
|
|
5521
|
-
}
|
|
5522
|
-
}
|
|
5523
|
-
|
|
5524
|
-
let GetConnectionLineExecution = class GetConnectionLineExecution {
|
|
5525
|
-
constructor() {
|
|
5526
|
-
this.behaviorHandlers = {
|
|
5527
|
-
[EFConnectionBehavior.FLOATING.toString()]: this.floatingBehavior,
|
|
5528
|
-
[EFConnectionBehavior.FIXED_CENTER.toString()]: this.fixedCenterBehavior,
|
|
5529
|
-
[EFConnectionBehavior.FIXED.toString()]: this.fixedOutboundBehaviour,
|
|
5530
|
-
};
|
|
5531
|
-
}
|
|
5532
|
-
handle(payload) {
|
|
5533
|
-
return this.behaviorHandlers[payload.behavior](payload);
|
|
5534
|
-
}
|
|
5535
|
-
floatingBehavior(payload) {
|
|
5536
|
-
const fromResult = GetIntersections.getRoundedRectIntersections(payload.outputRect.gravityCenter, payload.inputRect.gravityCenter, payload.outputRect)[0];
|
|
5537
|
-
const toResult = GetIntersections.getRoundedRectIntersections(payload.inputRect.gravityCenter, payload.outputRect.gravityCenter, payload.inputRect)[0];
|
|
5538
|
-
return new Line(fromResult ? fromResult : payload.outputRect.gravityCenter, toResult ? toResult : payload.inputRect.gravityCenter);
|
|
5539
|
-
}
|
|
5540
|
-
fixedCenterBehavior(payload) {
|
|
5541
|
-
return new Line(payload.outputRect.gravityCenter, payload.inputRect.gravityCenter);
|
|
5542
|
-
}
|
|
5543
|
-
fixedOutboundBehaviour(payload) {
|
|
5544
|
-
return new Line(positionFixedOutbound[payload.outputSide === EFConnectableSide.AUTO ? EFConnectableSide.BOTTOM : payload.outputSide](payload.outputRect), positionFixedOutbound[payload.inputSide === EFConnectableSide.AUTO ? EFConnectableSide.TOP : payload.inputSide](payload.inputRect));
|
|
5827
|
+
this.fDraggableDataContext.selectedItems.forEach((x) => x.deselect());
|
|
5828
|
+
this.fDraggableDataContext.selectedItems = [];
|
|
5829
|
+
this.fDraggableDataContext.isSelectedChanged = true;
|
|
5545
5830
|
}
|
|
5546
5831
|
};
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
FExecutionRegister(
|
|
5551
|
-
],
|
|
5552
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
5832
|
+
ClearSelectionExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ClearSelectionExecution, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5833
|
+
ClearSelectionExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ClearSelectionExecution });
|
|
5834
|
+
ClearSelectionExecution = __decorate([
|
|
5835
|
+
FExecutionRegister(ClearSelectionRequest)
|
|
5836
|
+
], ClearSelectionExecution);
|
|
5837
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ClearSelectionExecution, decorators: [{
|
|
5553
5838
|
type: Injectable
|
|
5554
|
-
}] });
|
|
5555
|
-
const positionFixedOutbound = {
|
|
5556
|
-
[EFConnectableSide.TOP]: (rect) => {
|
|
5557
|
-
const result = new Point();
|
|
5558
|
-
result.y = rect.y;
|
|
5559
|
-
result.x = rect.x + rect.width / 2;
|
|
5560
|
-
return result;
|
|
5561
|
-
},
|
|
5562
|
-
[EFConnectableSide.BOTTOM]: (rect) => {
|
|
5563
|
-
const result = new Point();
|
|
5564
|
-
result.y = rect.y + rect.height;
|
|
5565
|
-
result.x = rect.x + rect.width / 2;
|
|
5566
|
-
return result;
|
|
5567
|
-
},
|
|
5568
|
-
[EFConnectableSide.LEFT]: (rect) => {
|
|
5569
|
-
const result = new Point();
|
|
5570
|
-
result.x = rect.x;
|
|
5571
|
-
result.y = rect.y + rect.height / 2;
|
|
5572
|
-
return result;
|
|
5573
|
-
},
|
|
5574
|
-
[EFConnectableSide.RIGHT]: (rect) => {
|
|
5575
|
-
const result = new Point();
|
|
5576
|
-
result.x = rect.x + rect.width;
|
|
5577
|
-
result.y = rect.y + rect.height / 2;
|
|
5578
|
-
return result;
|
|
5579
|
-
},
|
|
5580
|
-
};
|
|
5839
|
+
}], ctorParameters: function () { return [{ type: FDraggableDataContext }]; } });
|
|
5581
5840
|
|
|
5582
|
-
class
|
|
5841
|
+
class GetSelectionRequest {
|
|
5583
5842
|
}
|
|
5584
5843
|
|
|
5585
|
-
let
|
|
5586
|
-
constructor(
|
|
5587
|
-
this.
|
|
5844
|
+
let GetSelectionExecution = class GetSelectionExecution {
|
|
5845
|
+
constructor(fDraggableDataContext) {
|
|
5846
|
+
this.fDraggableDataContext = fDraggableDataContext;
|
|
5588
5847
|
}
|
|
5589
|
-
handle(
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
}
|
|
5848
|
+
handle() {
|
|
5849
|
+
let selectedNodes = [];
|
|
5850
|
+
let selectedConnections = [];
|
|
5851
|
+
this.fDraggableDataContext.selectedItems.forEach((x) => {
|
|
5852
|
+
if (x.hostElement.classList.contains('f-node')) {
|
|
5853
|
+
selectedNodes.push(x.hostElement.dataset['fNodeId']);
|
|
5854
|
+
}
|
|
5855
|
+
else {
|
|
5856
|
+
selectedConnections.push(x.hostElement.id);
|
|
5857
|
+
}
|
|
5599
5858
|
});
|
|
5859
|
+
return new FSelectionChangeEvent(selectedNodes, selectedConnections);
|
|
5600
5860
|
}
|
|
5601
5861
|
};
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
FExecutionRegister(
|
|
5606
|
-
],
|
|
5607
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
5862
|
+
GetSelectionExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetSelectionExecution, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5863
|
+
GetSelectionExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetSelectionExecution });
|
|
5864
|
+
GetSelectionExecution = __decorate([
|
|
5865
|
+
FExecutionRegister(GetSelectionRequest)
|
|
5866
|
+
], GetSelectionExecution);
|
|
5867
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetSelectionExecution, decorators: [{
|
|
5608
5868
|
type: Injectable
|
|
5609
|
-
}], ctorParameters: function () { return [{ type:
|
|
5869
|
+
}], ctorParameters: function () { return [{ type: FDraggableDataContext }]; } });
|
|
5610
5870
|
|
|
5611
|
-
class
|
|
5612
|
-
constructor(
|
|
5613
|
-
this.
|
|
5871
|
+
class SelectRequest {
|
|
5872
|
+
constructor(nodes, connections) {
|
|
5873
|
+
this.nodes = nodes;
|
|
5874
|
+
this.connections = connections;
|
|
5614
5875
|
}
|
|
5615
5876
|
}
|
|
5616
5877
|
|
|
5617
|
-
let
|
|
5618
|
-
constructor(
|
|
5619
|
-
this.
|
|
5878
|
+
let SelectExecution = class SelectExecution {
|
|
5879
|
+
constructor(fDataContext, fDraggableDataContext) {
|
|
5880
|
+
this.fDataContext = fDataContext;
|
|
5881
|
+
this.fDraggableDataContext = fDraggableDataContext;
|
|
5620
5882
|
}
|
|
5621
5883
|
handle(request) {
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
id: x.fId,
|
|
5625
|
-
parent: x.fParentId,
|
|
5626
|
-
position: x.position,
|
|
5627
|
-
size: x.size,
|
|
5628
|
-
fOutputs: this.getOutputs(x.hostElement),
|
|
5629
|
-
fInputs: this.getInputs(x.hostElement),
|
|
5630
|
-
isSelected: x.isSelected()
|
|
5631
|
-
};
|
|
5884
|
+
this.fDraggableDataContext.selectedItems.forEach((x) => {
|
|
5885
|
+
x.deselect();
|
|
5632
5886
|
});
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
}
|
|
5887
|
+
this.fDraggableDataContext.selectedItems = [];
|
|
5888
|
+
request.nodes.forEach((key) => {
|
|
5889
|
+
const node = this.fDataContext.fNodes.find((x) => x.fId === key);
|
|
5890
|
+
if (node) {
|
|
5891
|
+
node.select();
|
|
5892
|
+
this.fDraggableDataContext.selectedItems.push(node);
|
|
5893
|
+
}
|
|
5640
5894
|
});
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
};
|
|
5895
|
+
request.connections.forEach((key) => {
|
|
5896
|
+
const connection = this.fDataContext.fConnections.find((x) => x.fId === key);
|
|
5897
|
+
if (connection) {
|
|
5898
|
+
connection.select();
|
|
5899
|
+
this.fDraggableDataContext.selectedItems.push(connection);
|
|
5900
|
+
}
|
|
5648
5901
|
});
|
|
5902
|
+
this.fDraggableDataContext.isSelectedChanged = true;
|
|
5649
5903
|
}
|
|
5650
5904
|
};
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
FExecutionRegister(
|
|
5655
|
-
],
|
|
5656
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
5657
|
-
type: Injectable
|
|
5658
|
-
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
5659
|
-
|
|
5660
|
-
class GetFlowStateRequest {
|
|
5661
|
-
}
|
|
5662
|
-
|
|
5663
|
-
let GetFlowStateExecution = class GetFlowStateExecution {
|
|
5664
|
-
constructor(fComponentsStore, fMediator) {
|
|
5665
|
-
this.fComponentsStore = fComponentsStore;
|
|
5666
|
-
this.fMediator = fMediator;
|
|
5667
|
-
}
|
|
5668
|
-
handle(payload) {
|
|
5669
|
-
return {
|
|
5670
|
-
position: this.getCanvasPosition(this.fComponentsStore.fCanvas.transform),
|
|
5671
|
-
scale: this.fComponentsStore.fCanvas.transform.scale,
|
|
5672
|
-
nodes: this.fMediator.send(new GetFlowStateNodesRequest(FNodeDirective)),
|
|
5673
|
-
groups: this.fMediator.send(new GetFlowStateNodesRequest(FGroupDirective)),
|
|
5674
|
-
connections: this.fMediator.send(new GetFlowStateConnectionsRequest())
|
|
5675
|
-
};
|
|
5676
|
-
}
|
|
5677
|
-
getCanvasPosition(transform) {
|
|
5678
|
-
return PointExtensions.sum(transform.position, transform.scaledPosition);
|
|
5679
|
-
}
|
|
5680
|
-
};
|
|
5681
|
-
GetFlowStateExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetFlowStateExecution, deps: [{ token: FComponentsStore }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5682
|
-
GetFlowStateExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetFlowStateExecution });
|
|
5683
|
-
GetFlowStateExecution = __decorate([
|
|
5684
|
-
FExecutionRegister(GetFlowStateRequest)
|
|
5685
|
-
], GetFlowStateExecution);
|
|
5686
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetFlowStateExecution, decorators: [{
|
|
5905
|
+
SelectExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SelectExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5906
|
+
SelectExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SelectExecution });
|
|
5907
|
+
SelectExecution = __decorate([
|
|
5908
|
+
FExecutionRegister(SelectRequest)
|
|
5909
|
+
], SelectExecution);
|
|
5910
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SelectExecution, decorators: [{
|
|
5687
5911
|
type: Injectable
|
|
5688
|
-
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type:
|
|
5689
|
-
|
|
5690
|
-
const GET_FLOW_STATE_PROVIDERS = [
|
|
5691
|
-
GetFlowStateExecution,
|
|
5692
|
-
GetFlowStateNodesExecution,
|
|
5693
|
-
GetFlowStateConnectionsExecution
|
|
5694
|
-
];
|
|
5912
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: FDraggableDataContext }]; } });
|
|
5695
5913
|
|
|
5696
|
-
class
|
|
5914
|
+
class SelectAllRequest {
|
|
5697
5915
|
}
|
|
5698
5916
|
|
|
5699
|
-
let
|
|
5700
|
-
constructor(
|
|
5701
|
-
this.
|
|
5917
|
+
let SelectAllExecution = class SelectAllExecution {
|
|
5918
|
+
constructor(fDataContext, fDraggableDataContext) {
|
|
5919
|
+
this.fDataContext = fDataContext;
|
|
5920
|
+
this.fDraggableDataContext = fDraggableDataContext;
|
|
5702
5921
|
}
|
|
5703
5922
|
handle(request) {
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
getNodesRects() {
|
|
5707
|
-
return this.getNodes().map((x) => {
|
|
5708
|
-
const rect = RectExtensions.fromElement(x.hostElement);
|
|
5709
|
-
return RectExtensions.initialize(x.position.x, x.position.y, rect.width, rect.height);
|
|
5923
|
+
this.fDraggableDataContext.selectedItems.forEach((x) => {
|
|
5924
|
+
x.deselect();
|
|
5710
5925
|
});
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5926
|
+
this.fDraggableDataContext.selectedItems = [];
|
|
5927
|
+
this.fDataContext.fNodes.forEach((x) => {
|
|
5928
|
+
x.select();
|
|
5929
|
+
this.fDraggableDataContext.selectedItems.push(x);
|
|
5930
|
+
});
|
|
5931
|
+
this.fDataContext.fConnections.forEach((x) => {
|
|
5932
|
+
x.select();
|
|
5933
|
+
this.fDraggableDataContext.selectedItems.push(x);
|
|
5934
|
+
});
|
|
5935
|
+
this.fDraggableDataContext.isSelectedChanged = true;
|
|
5714
5936
|
}
|
|
5715
5937
|
};
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
FExecutionRegister(
|
|
5720
|
-
],
|
|
5721
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
5938
|
+
SelectAllExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SelectAllExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5939
|
+
SelectAllExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SelectAllExecution });
|
|
5940
|
+
SelectAllExecution = __decorate([
|
|
5941
|
+
FExecutionRegister(SelectAllRequest)
|
|
5942
|
+
], SelectAllExecution);
|
|
5943
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SelectAllExecution, decorators: [{
|
|
5722
5944
|
type: Injectable
|
|
5723
|
-
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
5945
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: FDraggableDataContext }]; } });
|
|
5724
5946
|
|
|
5725
|
-
class
|
|
5726
|
-
constructor(
|
|
5727
|
-
this.
|
|
5947
|
+
class SelectAndUpdateNodeLayerRequest {
|
|
5948
|
+
constructor(fNode) {
|
|
5949
|
+
this.fNode = fNode;
|
|
5728
5950
|
}
|
|
5729
5951
|
}
|
|
5730
5952
|
|
|
5731
|
-
class
|
|
5732
|
-
constructor(
|
|
5733
|
-
|
|
5734
|
-
this.
|
|
5953
|
+
class MoveFrontElementsBeforeTargetElementRequest {
|
|
5954
|
+
constructor(fItemsContainer, // fGroupsContainer || fNodesContainer || fConnectionsContainer
|
|
5955
|
+
allElements, elementsThatShouldBeInFront, targetIndex) {
|
|
5956
|
+
this.fItemsContainer = fItemsContainer;
|
|
5957
|
+
this.allElements = allElements;
|
|
5958
|
+
this.elementsThatShouldBeInFront = elementsThatShouldBeInFront;
|
|
5959
|
+
this.targetIndex = targetIndex;
|
|
5735
5960
|
}
|
|
5736
5961
|
}
|
|
5737
5962
|
|
|
5738
|
-
let
|
|
5739
|
-
constructor(fComponentsStore, fMediator) {
|
|
5740
|
-
this.fComponentsStore = fComponentsStore;
|
|
5741
|
-
this.fMediator = fMediator;
|
|
5742
|
-
}
|
|
5963
|
+
let MoveFrontElementsBeforeTargetElementExecution = class MoveFrontElementsBeforeTargetElementExecution {
|
|
5743
5964
|
handle(request) {
|
|
5744
|
-
const
|
|
5745
|
-
|
|
5746
|
-
|
|
5965
|
+
const elementsToMove = [];
|
|
5966
|
+
for (let i = request.targetIndex + 1; i < request.allElements.length; i++) {
|
|
5967
|
+
const element = request.allElements[i];
|
|
5968
|
+
if (!request.elementsThatShouldBeInFront.includes(element)) {
|
|
5969
|
+
elementsToMove.push(element);
|
|
5970
|
+
}
|
|
5747
5971
|
}
|
|
5748
|
-
|
|
5972
|
+
elementsToMove.forEach((x) => {
|
|
5973
|
+
request.fItemsContainer.removeChild(x);
|
|
5974
|
+
request.fItemsContainer.insertBefore(x, request.allElements[request.targetIndex]);
|
|
5975
|
+
});
|
|
5749
5976
|
}
|
|
5750
5977
|
};
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
FExecutionRegister(
|
|
5755
|
-
],
|
|
5756
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
5978
|
+
MoveFrontElementsBeforeTargetElementExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MoveFrontElementsBeforeTargetElementExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5979
|
+
MoveFrontElementsBeforeTargetElementExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MoveFrontElementsBeforeTargetElementExecution });
|
|
5980
|
+
MoveFrontElementsBeforeTargetElementExecution = __decorate([
|
|
5981
|
+
FExecutionRegister(MoveFrontElementsBeforeTargetElementRequest)
|
|
5982
|
+
], MoveFrontElementsBeforeTargetElementExecution);
|
|
5983
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MoveFrontElementsBeforeTargetElementExecution, decorators: [{
|
|
5757
5984
|
type: Injectable
|
|
5758
|
-
}]
|
|
5985
|
+
}] });
|
|
5759
5986
|
|
|
5760
|
-
class
|
|
5987
|
+
class UpdateItemAndChildrenLayersRequest {
|
|
5988
|
+
constructor(item, itemContainer) {
|
|
5989
|
+
this.item = item;
|
|
5990
|
+
this.itemContainer = itemContainer;
|
|
5991
|
+
}
|
|
5761
5992
|
}
|
|
5762
5993
|
|
|
5763
|
-
|
|
5994
|
+
class GetDeepChildrenNodesAndGroupsRequest {
|
|
5995
|
+
constructor(fId) {
|
|
5996
|
+
this.fId = fId;
|
|
5997
|
+
}
|
|
5998
|
+
}
|
|
5999
|
+
|
|
6000
|
+
let GetDeepChildrenNodesAndGroupsExecution = class GetDeepChildrenNodesAndGroupsExecution {
|
|
5764
6001
|
constructor(fComponentsStore) {
|
|
5765
6002
|
this.fComponentsStore = fComponentsStore;
|
|
5766
6003
|
}
|
|
5767
6004
|
handle(request) {
|
|
5768
|
-
return
|
|
5769
|
-
}
|
|
5770
|
-
getNodesRects() {
|
|
5771
|
-
return this.getNodes().map((x) => RectExtensions.fromElement(x.hostElement));
|
|
6005
|
+
return this.getChildrenNodes(request.fId);
|
|
5772
6006
|
}
|
|
5773
|
-
|
|
5774
|
-
|
|
6007
|
+
getChildrenNodes(fId, visited = new Set()) {
|
|
6008
|
+
if (visited.has(fId)) {
|
|
6009
|
+
throw new Error('Circular reference detected in the node hierarchy. Node id: ' + fId);
|
|
6010
|
+
}
|
|
6011
|
+
visited.add(fId);
|
|
6012
|
+
const result = this.fComponentsStore.fNodes.filter((x) => x.fParentId === fId);
|
|
6013
|
+
result.forEach((x) => {
|
|
6014
|
+
result.push(...this.getChildrenNodes(x.fId, visited));
|
|
6015
|
+
});
|
|
6016
|
+
return result;
|
|
5775
6017
|
}
|
|
5776
6018
|
};
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
FExecutionRegister(
|
|
5781
|
-
],
|
|
5782
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
6019
|
+
GetDeepChildrenNodesAndGroupsExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetDeepChildrenNodesAndGroupsExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6020
|
+
GetDeepChildrenNodesAndGroupsExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetDeepChildrenNodesAndGroupsExecution });
|
|
6021
|
+
GetDeepChildrenNodesAndGroupsExecution = __decorate([
|
|
6022
|
+
FExecutionRegister(GetDeepChildrenNodesAndGroupsRequest)
|
|
6023
|
+
], GetDeepChildrenNodesAndGroupsExecution);
|
|
6024
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetDeepChildrenNodesAndGroupsExecution, decorators: [{
|
|
5783
6025
|
type: Injectable
|
|
5784
6026
|
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
5785
6027
|
|
|
5786
|
-
class
|
|
5787
|
-
constructor(fOutputId) {
|
|
5788
|
-
this.fOutputId = fOutputId;
|
|
5789
|
-
}
|
|
5790
|
-
}
|
|
5791
|
-
|
|
5792
|
-
class GetOutputRectInFlowResponse {
|
|
5793
|
-
constructor(rect, fConnectableSide) {
|
|
5794
|
-
this.rect = rect;
|
|
5795
|
-
this.fConnectableSide = fConnectableSide;
|
|
5796
|
-
}
|
|
5797
|
-
}
|
|
5798
|
-
|
|
5799
|
-
let GetOutputRectInFlowExecution = class GetOutputRectInFlowExecution {
|
|
6028
|
+
let UpdateItemAndChildrenLayersExecution = class UpdateItemAndChildrenLayersExecution {
|
|
5800
6029
|
constructor(fComponentsStore, fMediator) {
|
|
5801
6030
|
this.fComponentsStore = fComponentsStore;
|
|
5802
6031
|
this.fMediator = fMediator;
|
|
5803
6032
|
}
|
|
6033
|
+
get fGroupsContainer() {
|
|
6034
|
+
return this.fComponentsStore.fCanvas.fGroupsContainer.nativeElement;
|
|
6035
|
+
}
|
|
6036
|
+
get fNodesContainer() {
|
|
6037
|
+
return this.fComponentsStore.fCanvas.fNodesContainer.nativeElement;
|
|
6038
|
+
}
|
|
6039
|
+
get fConnectionsContainer() {
|
|
6040
|
+
return this.fComponentsStore.fCanvas.fConnectionsContainer.nativeElement;
|
|
6041
|
+
}
|
|
5804
6042
|
handle(request) {
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
6043
|
+
switch (request.itemContainer) {
|
|
6044
|
+
case this.fGroupsContainer:
|
|
6045
|
+
this.handleGroup(request);
|
|
6046
|
+
break;
|
|
6047
|
+
case this.fNodesContainer:
|
|
6048
|
+
this.handleNode(request);
|
|
6049
|
+
break;
|
|
6050
|
+
case this.fConnectionsContainer:
|
|
6051
|
+
this.handleConnection(request);
|
|
6052
|
+
break;
|
|
6053
|
+
default:
|
|
6054
|
+
throw new Error('Unknown container');
|
|
5808
6055
|
}
|
|
5809
|
-
|
|
5810
|
-
|
|
6056
|
+
}
|
|
6057
|
+
handleGroup(request) {
|
|
6058
|
+
const childrenNodesAndGroups = this.getChildrenNodesAndGroups(request.item.fId);
|
|
6059
|
+
const childrenGroups = this.getChildrenGroups(childrenNodesAndGroups);
|
|
6060
|
+
this.updateLayers(this.fGroupsContainer, request.item.hostElement, childrenGroups);
|
|
6061
|
+
const childrenNodes = this.getChildrenNodes(childrenNodesAndGroups);
|
|
6062
|
+
if (childrenNodes.length) {
|
|
6063
|
+
this.updateLayers(this.fNodesContainer, childrenNodes[0], childrenNodes);
|
|
5811
6064
|
}
|
|
5812
|
-
const result = this.fMediator.send(new GetElementRectInFlowRequest(output.hostElement));
|
|
5813
|
-
return new GetOutputRectInFlowResponse(result, output.fConnectableSide);
|
|
5814
6065
|
}
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
FExecutionRegister(GetOutputRectInFlowRequest)
|
|
5820
|
-
], GetOutputRectInFlowExecution);
|
|
5821
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetOutputRectInFlowExecution, decorators: [{
|
|
5822
|
-
type: Injectable
|
|
5823
|
-
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: i2.FMediator }]; } });
|
|
5824
|
-
|
|
5825
|
-
class GetPositionInFlowRequest {
|
|
5826
|
-
constructor(position) {
|
|
5827
|
-
this.position = position;
|
|
6066
|
+
handleNode(request) {
|
|
6067
|
+
const childrenNodesAndGroups = this.getChildrenNodesAndGroups(request.item.fId);
|
|
6068
|
+
const childrenNodes = this.getChildrenNodes(childrenNodesAndGroups);
|
|
6069
|
+
this.updateLayers(request.itemContainer, request.item.hostElement, childrenNodes);
|
|
5828
6070
|
}
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
let GetPositionInFlowExecution = class GetPositionInFlowExecution {
|
|
5832
|
-
constructor(fComponentsStore) {
|
|
5833
|
-
this.fComponentsStore = fComponentsStore;
|
|
6071
|
+
handleConnection(request) {
|
|
6072
|
+
this.updateLayers(request.itemContainer, request.item.hostElement, []);
|
|
5834
6073
|
}
|
|
5835
|
-
|
|
5836
|
-
|
|
6074
|
+
updateLayers(itemContainer, item, elementsThatShouldBeInFront) {
|
|
6075
|
+
const allElements = Array.from(itemContainer.children);
|
|
6076
|
+
const targetIndex = allElements.findIndex((x) => x === item);
|
|
6077
|
+
if (this.isAnythingNeedToBeMoved(allElements, targetIndex, elementsThatShouldBeInFront)) {
|
|
6078
|
+
this.fMediator.send(new MoveFrontElementsBeforeTargetElementRequest(itemContainer, allElements, elementsThatShouldBeInFront, targetIndex));
|
|
6079
|
+
}
|
|
5837
6080
|
}
|
|
5838
|
-
|
|
5839
|
-
|
|
6081
|
+
isAnythingNeedToBeMoved(allElements, targetIndex, elementsThatShouldBeInFront) {
|
|
6082
|
+
for (let i = targetIndex + 1; i < allElements.length; i++) {
|
|
6083
|
+
if (!elementsThatShouldBeInFront.includes(allElements[i])) {
|
|
6084
|
+
return true;
|
|
6085
|
+
}
|
|
6086
|
+
}
|
|
6087
|
+
return false;
|
|
5840
6088
|
}
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
6089
|
+
getChildrenGroups(elements) {
|
|
6090
|
+
const allElements = Array.from(this.fGroupsContainer.children);
|
|
6091
|
+
return elements.filter((x) => this.fGroupsContainer.contains(x))
|
|
6092
|
+
.sort((a, b) => allElements.indexOf(a) - allElements.indexOf(b));
|
|
6093
|
+
}
|
|
6094
|
+
getChildrenNodes(elements) {
|
|
6095
|
+
const allElements = Array.from(this.fNodesContainer.children);
|
|
6096
|
+
return elements.filter((x) => this.fNodesContainer.contains(x))
|
|
6097
|
+
.sort((a, b) => allElements.indexOf(a) - allElements.indexOf(b));
|
|
6098
|
+
}
|
|
6099
|
+
getChildrenNodesAndGroups(fId) {
|
|
6100
|
+
return this.fMediator.send(new GetDeepChildrenNodesAndGroupsRequest(fId)).map((x) => x.hostElement);
|
|
5844
6101
|
}
|
|
5845
6102
|
};
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
FExecutionRegister(
|
|
5850
|
-
],
|
|
5851
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
6103
|
+
UpdateItemAndChildrenLayersExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: UpdateItemAndChildrenLayersExecution, deps: [{ token: FComponentsStore }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6104
|
+
UpdateItemAndChildrenLayersExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: UpdateItemAndChildrenLayersExecution });
|
|
6105
|
+
UpdateItemAndChildrenLayersExecution = __decorate([
|
|
6106
|
+
FExecutionRegister(UpdateItemAndChildrenLayersRequest)
|
|
6107
|
+
], UpdateItemAndChildrenLayersExecution);
|
|
6108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: UpdateItemAndChildrenLayersExecution, decorators: [{
|
|
5852
6109
|
type: Injectable
|
|
5853
|
-
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
5854
|
-
|
|
5855
|
-
class GetSelectionRequest {
|
|
5856
|
-
}
|
|
6110
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: i2.FMediator }]; } });
|
|
5857
6111
|
|
|
5858
|
-
let
|
|
5859
|
-
constructor(fDraggableDataContext) {
|
|
6112
|
+
let SelectAndUpdateNodeLayerExecution = class SelectAndUpdateNodeLayerExecution {
|
|
6113
|
+
constructor(fDraggableDataContext, fMediator) {
|
|
5860
6114
|
this.fDraggableDataContext = fDraggableDataContext;
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
this.
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
}
|
|
5873
|
-
return new FSelectionChangeEvent(selectedNodes, selectedConnections);
|
|
6115
|
+
this.fMediator = fMediator;
|
|
6116
|
+
}
|
|
6117
|
+
handle(request) {
|
|
6118
|
+
this.selectNodeIfNotSelected(request.fNode);
|
|
6119
|
+
this.fMediator.send(new UpdateItemAndChildrenLayersRequest(request.fNode, request.fNode.hostElement.parentElement));
|
|
6120
|
+
}
|
|
6121
|
+
selectNodeIfNotSelected(fNode) {
|
|
6122
|
+
if (!this.fDraggableDataContext.selectedItems.includes(fNode) && !fNode.fSelectionDisabled) {
|
|
6123
|
+
this.fDraggableDataContext.selectedItems.push(fNode);
|
|
6124
|
+
fNode.select();
|
|
6125
|
+
this.fDraggableDataContext.isSelectedChanged = true;
|
|
6126
|
+
}
|
|
5874
6127
|
}
|
|
5875
6128
|
};
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
FExecutionRegister(
|
|
5880
|
-
],
|
|
5881
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
6129
|
+
SelectAndUpdateNodeLayerExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SelectAndUpdateNodeLayerExecution, deps: [{ token: FDraggableDataContext }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6130
|
+
SelectAndUpdateNodeLayerExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SelectAndUpdateNodeLayerExecution });
|
|
6131
|
+
SelectAndUpdateNodeLayerExecution = __decorate([
|
|
6132
|
+
FExecutionRegister(SelectAndUpdateNodeLayerRequest)
|
|
6133
|
+
], SelectAndUpdateNodeLayerExecution);
|
|
6134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SelectAndUpdateNodeLayerExecution, decorators: [{
|
|
5882
6135
|
type: Injectable
|
|
5883
|
-
}], ctorParameters: function () { return [{ type: FDraggableDataContext }]; } });
|
|
6136
|
+
}], ctorParameters: function () { return [{ type: FDraggableDataContext }, { type: i2.FMediator }]; } });
|
|
5884
6137
|
|
|
5885
|
-
|
|
6138
|
+
const F_SELECTION_FEATURES = [
|
|
6139
|
+
ClearSelectionExecution,
|
|
6140
|
+
GetSelectionExecution,
|
|
6141
|
+
SelectExecution,
|
|
6142
|
+
SelectAllExecution,
|
|
6143
|
+
SelectAndUpdateNodeLayerExecution
|
|
6144
|
+
];
|
|
6145
|
+
|
|
6146
|
+
let GetCanBeSelectedItemsExecution = class GetCanBeSelectedItemsExecution {
|
|
5886
6147
|
constructor(fComponentsStore, fDraggableDataContext, fMediator) {
|
|
5887
6148
|
this.fComponentsStore = fComponentsStore;
|
|
5888
6149
|
this.fDraggableDataContext = fDraggableDataContext;
|
|
5889
6150
|
this.fMediator = fMediator;
|
|
5890
6151
|
}
|
|
6152
|
+
get fNodes() {
|
|
6153
|
+
return this.fComponentsStore.fNodes;
|
|
6154
|
+
}
|
|
6155
|
+
get fConnections() {
|
|
6156
|
+
return this.fComponentsStore.fConnections;
|
|
6157
|
+
}
|
|
5891
6158
|
get transform() {
|
|
5892
6159
|
return this.fComponentsStore.fCanvas.transform;
|
|
5893
6160
|
}
|
|
5894
|
-
get flowHost() {
|
|
5895
|
-
return this.fComponentsStore.fFlow.hostElement;
|
|
5896
|
-
}
|
|
5897
6161
|
handle() {
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
return;
|
|
5901
|
-
}
|
|
5902
|
-
const fNode = this.fDraggableDataContext.draggableItems[0].fNode;
|
|
5903
|
-
const outputsOfNode = this.getOutputsForNode(fNode);
|
|
5904
|
-
const inputsOfNode = this.getInputsForNode(fNode);
|
|
5905
|
-
const isCantBeConnectedByOutput = outputsOfNode.some((x) => !x.canBeConnected);
|
|
5906
|
-
const isCantBeConnectedByInput = this.fComponentsStore.fConnections.some((x) => {
|
|
5907
|
-
return inputsOfNode.find((input) => input.id === x.fInputId);
|
|
6162
|
+
return [...this.getNodesWithRects(), ...this.getConnectionsWithRects()].filter((x) => {
|
|
6163
|
+
return !this.fDraggableDataContext.selectedItems.includes(x.element);
|
|
5908
6164
|
});
|
|
5909
|
-
if (!isCantBeConnectedByInput && outputsOfNode.length && !isCantBeConnectedByOutput && inputsOfNode.length) {
|
|
5910
|
-
const output = outputsOfNode[0];
|
|
5911
|
-
const input = inputsOfNode[0];
|
|
5912
|
-
// const outgoingConnections = this.getOutgoingConnectionsHandler.handle([ output ]);
|
|
5913
|
-
// const incomingConnections = this.getIncomingConnectionsHandler.handle([ input ]);
|
|
5914
|
-
// if (outgoingConnections.length === 0 && incomingConnections.length === 0) {
|
|
5915
|
-
// const connections = this.findConnectionsUnderNode(fNode);
|
|
5916
|
-
// if (connections.length) {
|
|
5917
|
-
// //TODO: need to implement
|
|
5918
|
-
// }
|
|
5919
|
-
// }
|
|
5920
|
-
}
|
|
5921
|
-
}
|
|
5922
|
-
isValidRequest() {
|
|
5923
|
-
const result = this.fDraggableDataContext.draggableItems.length === 1 &&
|
|
5924
|
-
this.fDraggableDataContext.draggableItems[0] instanceof NodeDragHandler;
|
|
5925
|
-
return result;
|
|
5926
|
-
}
|
|
5927
|
-
getOutputsForNode(node) {
|
|
5928
|
-
return this.fComponentsStore.fOutputs.filter((x) => node.isContains(x.hostElement));
|
|
5929
6165
|
}
|
|
5930
|
-
|
|
5931
|
-
return this.
|
|
6166
|
+
getNodesWithRects() {
|
|
6167
|
+
return this.fNodes.filter((x) => !x.fSelectionDisabled).map((x) => {
|
|
6168
|
+
return {
|
|
6169
|
+
element: x,
|
|
6170
|
+
rect: RectExtensions.mult(this.fMediator.send(new GetElementRectInFlowRequest(x.hostElement)), this.transform.scale)
|
|
6171
|
+
};
|
|
6172
|
+
});
|
|
5932
6173
|
}
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
6174
|
+
getConnectionsWithRects() {
|
|
6175
|
+
return this.fConnections.filter((x) => !x.fSelectionDisabled).map((x) => {
|
|
6176
|
+
return {
|
|
6177
|
+
element: x,
|
|
6178
|
+
rect: RectExtensions.mult(this.fMediator.send(new GetElementRectInFlowRequest(x.boundingElement)), this.transform.scale)
|
|
6179
|
+
};
|
|
5938
6180
|
});
|
|
5939
6181
|
}
|
|
5940
6182
|
};
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
FExecutionRegister(
|
|
5945
|
-
],
|
|
5946
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
6183
|
+
GetCanBeSelectedItemsExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetCanBeSelectedItemsExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6184
|
+
GetCanBeSelectedItemsExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetCanBeSelectedItemsExecution });
|
|
6185
|
+
GetCanBeSelectedItemsExecution = __decorate([
|
|
6186
|
+
FExecutionRegister(GetCanBeSelectedItemsRequest)
|
|
6187
|
+
], GetCanBeSelectedItemsExecution);
|
|
6188
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetCanBeSelectedItemsExecution, decorators: [{
|
|
5947
6189
|
type: Injectable
|
|
5948
6190
|
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: i2.FMediator }]; } });
|
|
5949
6191
|
|
|
5950
|
-
class
|
|
6192
|
+
class GetConnectionLineRequest {
|
|
6193
|
+
constructor(outputRect, inputRect, behavior, outputSide, inputSide) {
|
|
6194
|
+
this.outputRect = outputRect;
|
|
6195
|
+
this.inputRect = inputRect;
|
|
6196
|
+
this.behavior = behavior;
|
|
6197
|
+
this.outputSide = outputSide;
|
|
6198
|
+
this.inputSide = inputSide;
|
|
6199
|
+
}
|
|
5951
6200
|
}
|
|
5952
6201
|
|
|
5953
|
-
let
|
|
5954
|
-
constructor(
|
|
6202
|
+
let GetConnectionLineExecution = class GetConnectionLineExecution {
|
|
6203
|
+
constructor() {
|
|
6204
|
+
this.behaviorHandlers = {
|
|
6205
|
+
[EFConnectionBehavior.FLOATING.toString()]: this.floatingBehavior,
|
|
6206
|
+
[EFConnectionBehavior.FIXED_CENTER.toString()]: this.fixedCenterBehavior,
|
|
6207
|
+
[EFConnectionBehavior.FIXED.toString()]: this.fixedOutboundBehaviour,
|
|
6208
|
+
};
|
|
6209
|
+
}
|
|
6210
|
+
handle(payload) {
|
|
6211
|
+
return this.behaviorHandlers[payload.behavior](payload);
|
|
6212
|
+
}
|
|
6213
|
+
floatingBehavior(payload) {
|
|
6214
|
+
const fromResult = GetIntersections.getRoundedRectIntersections(payload.outputRect.gravityCenter, payload.inputRect.gravityCenter, payload.outputRect)[0];
|
|
6215
|
+
const toResult = GetIntersections.getRoundedRectIntersections(payload.inputRect.gravityCenter, payload.outputRect.gravityCenter, payload.inputRect)[0];
|
|
6216
|
+
return new Line(fromResult ? fromResult : payload.outputRect.gravityCenter, toResult ? toResult : payload.inputRect.gravityCenter);
|
|
6217
|
+
}
|
|
6218
|
+
fixedCenterBehavior(payload) {
|
|
6219
|
+
return new Line(payload.outputRect.gravityCenter, payload.inputRect.gravityCenter);
|
|
6220
|
+
}
|
|
6221
|
+
fixedOutboundBehaviour(payload) {
|
|
6222
|
+
return new Line(positionFixedOutbound[payload.outputSide === EFConnectableSide.AUTO ? EFConnectableSide.BOTTOM : payload.outputSide](payload.outputRect), positionFixedOutbound[payload.inputSide === EFConnectableSide.AUTO ? EFConnectableSide.TOP : payload.inputSide](payload.inputRect));
|
|
6223
|
+
}
|
|
6224
|
+
};
|
|
6225
|
+
GetConnectionLineExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetConnectionLineExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6226
|
+
GetConnectionLineExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetConnectionLineExecution });
|
|
6227
|
+
GetConnectionLineExecution = __decorate([
|
|
6228
|
+
FExecutionRegister(GetConnectionLineRequest)
|
|
6229
|
+
], GetConnectionLineExecution);
|
|
6230
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetConnectionLineExecution, decorators: [{
|
|
6231
|
+
type: Injectable
|
|
6232
|
+
}] });
|
|
6233
|
+
const positionFixedOutbound = {
|
|
6234
|
+
[EFConnectableSide.TOP]: (rect) => {
|
|
6235
|
+
const result = new Point();
|
|
6236
|
+
result.y = rect.y;
|
|
6237
|
+
result.x = rect.x + rect.width / 2;
|
|
6238
|
+
return result;
|
|
6239
|
+
},
|
|
6240
|
+
[EFConnectableSide.BOTTOM]: (rect) => {
|
|
6241
|
+
const result = new Point();
|
|
6242
|
+
result.y = rect.y + rect.height;
|
|
6243
|
+
result.x = rect.x + rect.width / 2;
|
|
6244
|
+
return result;
|
|
6245
|
+
},
|
|
6246
|
+
[EFConnectableSide.LEFT]: (rect) => {
|
|
6247
|
+
const result = new Point();
|
|
6248
|
+
result.x = rect.x;
|
|
6249
|
+
result.y = rect.y + rect.height / 2;
|
|
6250
|
+
return result;
|
|
6251
|
+
},
|
|
6252
|
+
[EFConnectableSide.RIGHT]: (rect) => {
|
|
6253
|
+
const result = new Point();
|
|
6254
|
+
result.x = rect.x + rect.width;
|
|
6255
|
+
result.y = rect.y + rect.height / 2;
|
|
6256
|
+
return result;
|
|
6257
|
+
},
|
|
6258
|
+
};
|
|
6259
|
+
|
|
6260
|
+
class GetFlowStateConnectionsRequest {
|
|
6261
|
+
}
|
|
6262
|
+
|
|
6263
|
+
let GetFlowStateConnectionsExecution = class GetFlowStateConnectionsExecution {
|
|
6264
|
+
constructor(fComponentsStore) {
|
|
5955
6265
|
this.fComponentsStore = fComponentsStore;
|
|
5956
|
-
this.fMediator = fMediator;
|
|
5957
6266
|
}
|
|
5958
6267
|
handle(request) {
|
|
5959
|
-
this.
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
}
|
|
6268
|
+
return this.fComponentsStore.fConnections.map((x) => {
|
|
6269
|
+
return {
|
|
6270
|
+
id: x.fId,
|
|
6271
|
+
fOutputId: x.fOutputId,
|
|
6272
|
+
fInputId: x.fInputId,
|
|
6273
|
+
fType: x.fType,
|
|
6274
|
+
fBehavior: x.fBehavior,
|
|
6275
|
+
isSelected: x.isSelected()
|
|
6276
|
+
};
|
|
5969
6277
|
});
|
|
5970
6278
|
}
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
6279
|
+
};
|
|
6280
|
+
GetFlowStateConnectionsExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetFlowStateConnectionsExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6281
|
+
GetFlowStateConnectionsExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetFlowStateConnectionsExecution });
|
|
6282
|
+
GetFlowStateConnectionsExecution = __decorate([
|
|
6283
|
+
FExecutionRegister(GetFlowStateConnectionsRequest)
|
|
6284
|
+
], GetFlowStateConnectionsExecution);
|
|
6285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetFlowStateConnectionsExecution, decorators: [{
|
|
6286
|
+
type: Injectable
|
|
6287
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
6288
|
+
|
|
6289
|
+
class GetFlowStateNodesRequest {
|
|
6290
|
+
constructor(type) {
|
|
6291
|
+
this.type = type;
|
|
5974
6292
|
}
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
this.
|
|
5980
|
-
connection.setLine(line.point1, output.fConnectableSide, line.point2, input.fConnectableSide);
|
|
5981
|
-
connection.initialize();
|
|
5982
|
-
connection.isSelected() ? connection.select() : null;
|
|
6293
|
+
}
|
|
6294
|
+
|
|
6295
|
+
let GetFlowStateNodesExecution = class GetFlowStateNodesExecution {
|
|
6296
|
+
constructor(fComponentsStore) {
|
|
6297
|
+
this.fComponentsStore = fComponentsStore;
|
|
5983
6298
|
}
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
6299
|
+
handle(request) {
|
|
6300
|
+
return this.fComponentsStore.fNodes.filter((x) => x instanceof request.type).map((x) => {
|
|
6301
|
+
return {
|
|
6302
|
+
id: x.fId,
|
|
6303
|
+
parent: x.fParentId,
|
|
6304
|
+
position: x.position,
|
|
6305
|
+
size: x.size,
|
|
6306
|
+
fOutputs: this.getOutputs(x.hostElement),
|
|
6307
|
+
fInputs: this.getInputs(x.hostElement),
|
|
6308
|
+
isSelected: x.isSelected()
|
|
6309
|
+
};
|
|
6310
|
+
});
|
|
5988
6311
|
}
|
|
5989
|
-
|
|
5990
|
-
this.
|
|
6312
|
+
getOutputs(hostElement) {
|
|
6313
|
+
return this.fComponentsStore.fOutputs.filter((x) => hostElement.contains(x.hostElement)).map((x) => {
|
|
6314
|
+
return {
|
|
6315
|
+
id: x.id,
|
|
6316
|
+
fConnectableSide: x.fConnectableSide
|
|
6317
|
+
};
|
|
6318
|
+
});
|
|
6319
|
+
}
|
|
6320
|
+
getInputs(hostElement) {
|
|
6321
|
+
return this.fComponentsStore.fInputs.filter((x) => hostElement.contains(x.hostElement)).map((x) => {
|
|
6322
|
+
return {
|
|
6323
|
+
id: x.id,
|
|
6324
|
+
fConnectableSide: x.fConnectableSide
|
|
6325
|
+
};
|
|
6326
|
+
});
|
|
5991
6327
|
}
|
|
5992
6328
|
};
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
FExecutionRegister(
|
|
5997
|
-
],
|
|
5998
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
6329
|
+
GetFlowStateNodesExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetFlowStateNodesExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6330
|
+
GetFlowStateNodesExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetFlowStateNodesExecution });
|
|
6331
|
+
GetFlowStateNodesExecution = __decorate([
|
|
6332
|
+
FExecutionRegister(GetFlowStateNodesRequest)
|
|
6333
|
+
], GetFlowStateNodesExecution);
|
|
6334
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetFlowStateNodesExecution, decorators: [{
|
|
5999
6335
|
type: Injectable
|
|
6000
|
-
}], ctorParameters: function () { return [{ type: FComponentsStore }
|
|
6336
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
6001
6337
|
|
|
6002
|
-
class
|
|
6003
|
-
constructor(nodes, connections) {
|
|
6004
|
-
this.nodes = nodes;
|
|
6005
|
-
this.connections = connections;
|
|
6006
|
-
}
|
|
6338
|
+
class GetFlowStateRequest {
|
|
6007
6339
|
}
|
|
6008
6340
|
|
|
6009
|
-
let
|
|
6010
|
-
constructor(
|
|
6011
|
-
this.
|
|
6012
|
-
this.
|
|
6341
|
+
let GetFlowStateExecution = class GetFlowStateExecution {
|
|
6342
|
+
constructor(fComponentsStore, fMediator) {
|
|
6343
|
+
this.fComponentsStore = fComponentsStore;
|
|
6344
|
+
this.fMediator = fMediator;
|
|
6013
6345
|
}
|
|
6014
|
-
handle(
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
});
|
|
6026
|
-
request.connections.forEach((key) => {
|
|
6027
|
-
const connection = this.fDataContext.fConnections.find((x) => x.fId === key);
|
|
6028
|
-
if (connection) {
|
|
6029
|
-
connection.select();
|
|
6030
|
-
this.fDraggableDataContext.selectedItems.push(connection);
|
|
6031
|
-
}
|
|
6032
|
-
});
|
|
6033
|
-
this.fDraggableDataContext.isSelectedChanged = true;
|
|
6346
|
+
handle(payload) {
|
|
6347
|
+
return {
|
|
6348
|
+
position: this.getCanvasPosition(this.fComponentsStore.fCanvas.transform),
|
|
6349
|
+
scale: this.fComponentsStore.fCanvas.transform.scale,
|
|
6350
|
+
nodes: this.fMediator.send(new GetFlowStateNodesRequest(FNodeDirective)),
|
|
6351
|
+
groups: this.fMediator.send(new GetFlowStateNodesRequest(FGroupDirective)),
|
|
6352
|
+
connections: this.fMediator.send(new GetFlowStateConnectionsRequest())
|
|
6353
|
+
};
|
|
6354
|
+
}
|
|
6355
|
+
getCanvasPosition(transform) {
|
|
6356
|
+
return PointExtensions.sum(transform.position, transform.scaledPosition);
|
|
6034
6357
|
}
|
|
6035
6358
|
};
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
FExecutionRegister(
|
|
6040
|
-
],
|
|
6041
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
6359
|
+
GetFlowStateExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetFlowStateExecution, deps: [{ token: FComponentsStore }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6360
|
+
GetFlowStateExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetFlowStateExecution });
|
|
6361
|
+
GetFlowStateExecution = __decorate([
|
|
6362
|
+
FExecutionRegister(GetFlowStateRequest)
|
|
6363
|
+
], GetFlowStateExecution);
|
|
6364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetFlowStateExecution, decorators: [{
|
|
6042
6365
|
type: Injectable
|
|
6043
|
-
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type:
|
|
6366
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: i2.FMediator }]; } });
|
|
6044
6367
|
|
|
6045
|
-
|
|
6368
|
+
const GET_FLOW_STATE_PROVIDERS = [
|
|
6369
|
+
GetFlowStateExecution,
|
|
6370
|
+
GetFlowStateNodesExecution,
|
|
6371
|
+
GetFlowStateConnectionsExecution
|
|
6372
|
+
];
|
|
6373
|
+
|
|
6374
|
+
class GetScaledNodeRectsWithFlowPositionRequest {
|
|
6046
6375
|
}
|
|
6047
6376
|
|
|
6048
|
-
let
|
|
6049
|
-
constructor(
|
|
6050
|
-
this.
|
|
6051
|
-
this.fDraggableDataContext = fDraggableDataContext;
|
|
6377
|
+
let GetScaledNodeRectsWithFlowPositionExecution = class GetScaledNodeRectsWithFlowPositionExecution {
|
|
6378
|
+
constructor(fComponentsStore) {
|
|
6379
|
+
this.fComponentsStore = fComponentsStore;
|
|
6052
6380
|
}
|
|
6053
6381
|
handle(request) {
|
|
6054
|
-
this.
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
this.
|
|
6058
|
-
|
|
6059
|
-
x.
|
|
6060
|
-
this.fDraggableDataContext.selectedItems.push(x);
|
|
6061
|
-
});
|
|
6062
|
-
this.fDataContext.fConnections.forEach((x) => {
|
|
6063
|
-
x.select();
|
|
6064
|
-
this.fDraggableDataContext.selectedItems.push(x);
|
|
6382
|
+
return RectExtensions.union(this.getNodesRects());
|
|
6383
|
+
}
|
|
6384
|
+
getNodesRects() {
|
|
6385
|
+
return this.getNodes().map((x) => {
|
|
6386
|
+
const rect = RectExtensions.fromElement(x.hostElement);
|
|
6387
|
+
return RectExtensions.initialize(x.position.x, x.position.y, rect.width, rect.height);
|
|
6065
6388
|
});
|
|
6066
|
-
|
|
6389
|
+
}
|
|
6390
|
+
getNodes() {
|
|
6391
|
+
return this.fComponentsStore.fNodes;
|
|
6067
6392
|
}
|
|
6068
6393
|
};
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
FExecutionRegister(
|
|
6073
|
-
],
|
|
6074
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
6394
|
+
GetScaledNodeRectsWithFlowPositionExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetScaledNodeRectsWithFlowPositionExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6395
|
+
GetScaledNodeRectsWithFlowPositionExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetScaledNodeRectsWithFlowPositionExecution });
|
|
6396
|
+
GetScaledNodeRectsWithFlowPositionExecution = __decorate([
|
|
6397
|
+
FExecutionRegister(GetScaledNodeRectsWithFlowPositionRequest)
|
|
6398
|
+
], GetScaledNodeRectsWithFlowPositionExecution);
|
|
6399
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetScaledNodeRectsWithFlowPositionExecution, decorators: [{
|
|
6075
6400
|
type: Injectable
|
|
6076
|
-
}], ctorParameters: function () { return [{ type: FComponentsStore }
|
|
6401
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
6077
6402
|
|
|
6078
|
-
class
|
|
6079
|
-
constructor(node) {
|
|
6080
|
-
this.node = node;
|
|
6081
|
-
}
|
|
6403
|
+
class GetNodesRectRequest {
|
|
6082
6404
|
}
|
|
6083
6405
|
|
|
6084
|
-
class
|
|
6085
|
-
constructor(
|
|
6086
|
-
|
|
6087
|
-
this.fItemsContainer = fItemsContainer;
|
|
6088
|
-
this.allElements = allElements;
|
|
6089
|
-
this.elementsThatShouldBeInFront = elementsThatShouldBeInFront;
|
|
6090
|
-
this.targetIndex = targetIndex;
|
|
6406
|
+
let GetNodesRectExecution = class GetNodesRectExecution {
|
|
6407
|
+
constructor(fComponentsStore) {
|
|
6408
|
+
this.fComponentsStore = fComponentsStore;
|
|
6091
6409
|
}
|
|
6092
|
-
}
|
|
6093
|
-
|
|
6094
|
-
let MoveFrontElementsBeforeTargetElementExecution = class MoveFrontElementsBeforeTargetElementExecution {
|
|
6095
6410
|
handle(request) {
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
elementsToMove.forEach((x) => {
|
|
6104
|
-
request.fItemsContainer.removeChild(x);
|
|
6105
|
-
request.fItemsContainer.insertBefore(x, request.allElements[request.targetIndex]);
|
|
6106
|
-
});
|
|
6411
|
+
return RectExtensions.union(this.getNodesRects());
|
|
6412
|
+
}
|
|
6413
|
+
getNodesRects() {
|
|
6414
|
+
return this.getNodes().map((x) => RectExtensions.fromElement(x.hostElement));
|
|
6415
|
+
}
|
|
6416
|
+
getNodes() {
|
|
6417
|
+
return this.fComponentsStore.fNodes;
|
|
6107
6418
|
}
|
|
6108
6419
|
};
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
FExecutionRegister(
|
|
6113
|
-
],
|
|
6114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
6420
|
+
GetNodesRectExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetNodesRectExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6421
|
+
GetNodesRectExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetNodesRectExecution });
|
|
6422
|
+
GetNodesRectExecution = __decorate([
|
|
6423
|
+
FExecutionRegister(GetNodesRectRequest)
|
|
6424
|
+
], GetNodesRectExecution);
|
|
6425
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetNodesRectExecution, decorators: [{
|
|
6115
6426
|
type: Injectable
|
|
6116
|
-
}] });
|
|
6427
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
6117
6428
|
|
|
6118
|
-
class
|
|
6119
|
-
constructor(
|
|
6120
|
-
this.
|
|
6121
|
-
this.itemContainer = itemContainer;
|
|
6429
|
+
class GetPositionInFlowRequest {
|
|
6430
|
+
constructor(position) {
|
|
6431
|
+
this.position = position;
|
|
6122
6432
|
}
|
|
6123
6433
|
}
|
|
6124
6434
|
|
|
6125
|
-
let
|
|
6126
|
-
constructor(fComponentsStore
|
|
6435
|
+
let GetPositionInFlowExecution = class GetPositionInFlowExecution {
|
|
6436
|
+
constructor(fComponentsStore) {
|
|
6127
6437
|
this.fComponentsStore = fComponentsStore;
|
|
6128
|
-
this.fMediator = fMediator;
|
|
6129
6438
|
}
|
|
6130
|
-
get
|
|
6131
|
-
return this.fComponentsStore.
|
|
6132
|
-
}
|
|
6133
|
-
get fNodesContainer() {
|
|
6134
|
-
return this.fComponentsStore.fCanvas.fNodesContainer.nativeElement;
|
|
6439
|
+
get transform() {
|
|
6440
|
+
return this.fComponentsStore.transform;
|
|
6135
6441
|
}
|
|
6136
|
-
get
|
|
6137
|
-
return this.fComponentsStore.
|
|
6442
|
+
get flowHost() {
|
|
6443
|
+
return this.fComponentsStore.flowHost;
|
|
6138
6444
|
}
|
|
6139
6445
|
handle(request) {
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
this.handleGroup(request);
|
|
6143
|
-
break;
|
|
6144
|
-
case this.fNodesContainer:
|
|
6145
|
-
this.handleNode(request);
|
|
6146
|
-
break;
|
|
6147
|
-
case this.fConnectionsContainer:
|
|
6148
|
-
this.handleConnection(request);
|
|
6149
|
-
break;
|
|
6150
|
-
default:
|
|
6151
|
-
throw new Error('Unknown container');
|
|
6152
|
-
}
|
|
6446
|
+
return Point.fromPoint(request.position).elementTransform(this.flowHost)
|
|
6447
|
+
.sub(this.transform.scaledPosition).sub(this.transform.position).div(this.transform.scale);
|
|
6153
6448
|
}
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6449
|
+
};
|
|
6450
|
+
GetPositionInFlowExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetPositionInFlowExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6451
|
+
GetPositionInFlowExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetPositionInFlowExecution });
|
|
6452
|
+
GetPositionInFlowExecution = __decorate([
|
|
6453
|
+
FExecutionRegister(GetPositionInFlowRequest)
|
|
6454
|
+
], GetPositionInFlowExecution);
|
|
6455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GetPositionInFlowExecution, decorators: [{
|
|
6456
|
+
type: Injectable
|
|
6457
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }]; } });
|
|
6458
|
+
|
|
6459
|
+
let IsConnectionUnderNodeExecution = class IsConnectionUnderNodeExecution {
|
|
6460
|
+
constructor(fComponentsStore, fDraggableDataContext, fMediator) {
|
|
6461
|
+
this.fComponentsStore = fComponentsStore;
|
|
6462
|
+
this.fDraggableDataContext = fDraggableDataContext;
|
|
6463
|
+
this.fMediator = fMediator;
|
|
6162
6464
|
}
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
const childrenNodes = this.getChildrenNodes(childrenNodesAndGroups);
|
|
6166
|
-
this.updateLayers(request.itemContainer, request.item.hostElement, childrenNodes);
|
|
6465
|
+
get transform() {
|
|
6466
|
+
return this.fComponentsStore.fCanvas.transform;
|
|
6167
6467
|
}
|
|
6168
|
-
|
|
6169
|
-
this.
|
|
6468
|
+
get flowHost() {
|
|
6469
|
+
return this.fComponentsStore.fFlow.hostElement;
|
|
6170
6470
|
}
|
|
6171
|
-
|
|
6172
|
-
const
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6471
|
+
handle() {
|
|
6472
|
+
const isValid = this.isValidRequest();
|
|
6473
|
+
if (!isValid) {
|
|
6474
|
+
return;
|
|
6475
|
+
}
|
|
6476
|
+
const fNode = this.fDraggableDataContext.draggableItems[0].fNode;
|
|
6477
|
+
const outputsOfNode = this.getOutputsForNode(fNode);
|
|
6478
|
+
const inputsOfNode = this.getInputsForNode(fNode);
|
|
6479
|
+
const isCantBeConnectedByOutput = outputsOfNode.some((x) => !x.canBeConnected);
|
|
6480
|
+
const isCantBeConnectedByInput = this.fComponentsStore.fConnections.some((x) => {
|
|
6481
|
+
return inputsOfNode.find((input) => input.id === x.fInputId);
|
|
6482
|
+
});
|
|
6483
|
+
if (!isCantBeConnectedByInput && outputsOfNode.length && !isCantBeConnectedByOutput && inputsOfNode.length) {
|
|
6484
|
+
const output = outputsOfNode[0];
|
|
6485
|
+
const input = inputsOfNode[0];
|
|
6486
|
+
// const outgoingConnections = this.getOutgoingConnectionsHandler.handle([ output ]);
|
|
6487
|
+
// const incomingConnections = this.getIncomingConnectionsHandler.handle([ input ]);
|
|
6488
|
+
// if (outgoingConnections.length === 0 && incomingConnections.length === 0) {
|
|
6489
|
+
// const connections = this.findConnectionsUnderNode(fNode);
|
|
6490
|
+
// if (connections.length) {
|
|
6491
|
+
// //TODO: need to implement
|
|
6492
|
+
// }
|
|
6493
|
+
// }
|
|
6176
6494
|
}
|
|
6177
6495
|
}
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
}
|
|
6183
|
-
}
|
|
6184
|
-
return false;
|
|
6496
|
+
isValidRequest() {
|
|
6497
|
+
const result = this.fDraggableDataContext.draggableItems.length === 1 &&
|
|
6498
|
+
this.fDraggableDataContext.draggableItems[0] instanceof NodeDragHandler;
|
|
6499
|
+
return result;
|
|
6185
6500
|
}
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
return elements.filter((x) => this.fGroupsContainer.contains(x))
|
|
6189
|
-
.sort((a, b) => allElements.indexOf(a) - allElements.indexOf(b));
|
|
6501
|
+
getOutputsForNode(node) {
|
|
6502
|
+
return this.fComponentsStore.fOutputs.filter((x) => node.isContains(x.hostElement));
|
|
6190
6503
|
}
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
return elements.filter((x) => this.fNodesContainer.contains(x))
|
|
6194
|
-
.sort((a, b) => allElements.indexOf(a) - allElements.indexOf(b));
|
|
6504
|
+
getInputsForNode(node) {
|
|
6505
|
+
return this.fComponentsStore.fInputs.filter((x) => node.isContains(x.hostElement));
|
|
6195
6506
|
}
|
|
6196
|
-
|
|
6197
|
-
|
|
6507
|
+
findConnectionsUnderNode(node) {
|
|
6508
|
+
const nodeRect = this.fMediator.send(new GetElementRectInFlowRequest(node.hostElement));
|
|
6509
|
+
return this.fComponentsStore.fConnections.filter((x) => {
|
|
6510
|
+
// const intersection = [];// RectExtensions.intersectionWithVector(nodeRect, x.line.point1, x.line.point2, 0, 0, 0, 0);
|
|
6511
|
+
return ([]).length > 0;
|
|
6512
|
+
});
|
|
6198
6513
|
}
|
|
6199
6514
|
};
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
FExecutionRegister(
|
|
6204
|
-
],
|
|
6205
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
6515
|
+
IsConnectionUnderNodeExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IsConnectionUnderNodeExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6516
|
+
IsConnectionUnderNodeExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IsConnectionUnderNodeExecution });
|
|
6517
|
+
IsConnectionUnderNodeExecution = __decorate([
|
|
6518
|
+
FExecutionRegister(IsConnectionUnderNodeRequest)
|
|
6519
|
+
], IsConnectionUnderNodeExecution);
|
|
6520
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IsConnectionUnderNodeExecution, decorators: [{
|
|
6206
6521
|
type: Injectable
|
|
6207
|
-
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: i2.FMediator }]; } });
|
|
6522
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: i2.FMediator }]; } });
|
|
6208
6523
|
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6524
|
+
class RedrawConnectionsRequest {
|
|
6525
|
+
}
|
|
6526
|
+
|
|
6527
|
+
let RedrawConnectionsExecution = class RedrawConnectionsExecution {
|
|
6528
|
+
constructor(fComponentsStore, fMediator) {
|
|
6529
|
+
this.fComponentsStore = fComponentsStore;
|
|
6212
6530
|
this.fMediator = fMediator;
|
|
6213
6531
|
}
|
|
6214
6532
|
handle(request) {
|
|
6215
|
-
this.
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
selectNodeIfNotSelected(node) {
|
|
6219
|
-
if (!this.fDraggableDataContext.selectedItems.includes(node) && !node.fSelectionDisabled) {
|
|
6220
|
-
this.fDraggableDataContext.selectedItems.push(node);
|
|
6221
|
-
node.select();
|
|
6222
|
-
this.fDraggableDataContext.isSelectedChanged = true;
|
|
6533
|
+
this.resetConnectors();
|
|
6534
|
+
if (this.fComponentsStore.fTempConnection) {
|
|
6535
|
+
this.setMarkers(this.fComponentsStore.fTempConnection);
|
|
6223
6536
|
}
|
|
6537
|
+
if (this.fComponentsStore.fSnapConnection) {
|
|
6538
|
+
this.setMarkers(this.fComponentsStore.fSnapConnection);
|
|
6539
|
+
}
|
|
6540
|
+
this.fComponentsStore.fConnections.forEach((connection) => {
|
|
6541
|
+
const output = this.fComponentsStore.fOutputs.find((x) => x.id === connection.fOutputId);
|
|
6542
|
+
const input = this.fComponentsStore.fInputs.find((x) => x.id === connection.fInputId);
|
|
6543
|
+
if (output && input) {
|
|
6544
|
+
this.setupConnection(output, input, connection);
|
|
6545
|
+
}
|
|
6546
|
+
});
|
|
6547
|
+
}
|
|
6548
|
+
resetConnectors() {
|
|
6549
|
+
this.fComponentsStore.fOutputs.forEach((output) => output.setConnected(false));
|
|
6550
|
+
this.fComponentsStore.fInputs.forEach((input) => input.setConnected(false));
|
|
6551
|
+
}
|
|
6552
|
+
setupConnection(output, input, connection) {
|
|
6553
|
+
output.setConnected(true);
|
|
6554
|
+
input.setConnected(true);
|
|
6555
|
+
const line = this.getLine(output, input, connection);
|
|
6556
|
+
this.setMarkers(connection);
|
|
6557
|
+
connection.setLine(line.point1, output.fConnectableSide, line.point2, input.fConnectableSide);
|
|
6558
|
+
connection.initialize();
|
|
6559
|
+
connection.isSelected() ? connection.select() : null;
|
|
6560
|
+
}
|
|
6561
|
+
getLine(output, input, connection) {
|
|
6562
|
+
const outputRect = this.fMediator.send(new GetElementRectInFlowRequest(output.hostElement));
|
|
6563
|
+
const inputRect = this.fMediator.send(new GetElementRectInFlowRequest(input.hostElement));
|
|
6564
|
+
return this.fMediator.send(new GetConnectionLineRequest(outputRect, inputRect, connection.fBehavior, output.fConnectableSide, input.fConnectableSide));
|
|
6565
|
+
}
|
|
6566
|
+
setMarkers(connection) {
|
|
6567
|
+
this.fMediator.send(new CreateConnectionMarkersRequest(connection));
|
|
6224
6568
|
}
|
|
6225
6569
|
};
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
FExecutionRegister(
|
|
6230
|
-
],
|
|
6231
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
6570
|
+
RedrawConnectionsExecution.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: RedrawConnectionsExecution, deps: [{ token: FComponentsStore }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6571
|
+
RedrawConnectionsExecution.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: RedrawConnectionsExecution });
|
|
6572
|
+
RedrawConnectionsExecution = __decorate([
|
|
6573
|
+
FExecutionRegister(RedrawConnectionsRequest)
|
|
6574
|
+
], RedrawConnectionsExecution);
|
|
6575
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: RedrawConnectionsExecution, decorators: [{
|
|
6232
6576
|
type: Injectable
|
|
6233
|
-
}], ctorParameters: function () { return [{ type:
|
|
6577
|
+
}], ctorParameters: function () { return [{ type: FComponentsStore }, { type: i2.FMediator }]; } });
|
|
6234
6578
|
|
|
6235
6579
|
class ShowConnectionsAfterCalculationsRequest {
|
|
6236
6580
|
}
|
|
@@ -6404,16 +6748,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
6404
6748
|
type: Injectable
|
|
6405
6749
|
}], ctorParameters: function () { return [{ type: FTransformStore }, { type: FComponentsStore }]; } });
|
|
6406
6750
|
|
|
6751
|
+
const F_CANVAS_ANIMATION_DURATION = 150;
|
|
6752
|
+
|
|
6407
6753
|
function createSVGElement(tag, fBrowser) {
|
|
6408
6754
|
return fBrowser.document.createElementNS('http://www.w3.org/2000/svg', tag);
|
|
6409
6755
|
}
|
|
6410
6756
|
|
|
6411
6757
|
const COMMON_PROVIDERS = [
|
|
6412
|
-
|
|
6413
|
-
|
|
6758
|
+
...F_CANVAS_FEATURES,
|
|
6759
|
+
...F_CONNECTION_FEATURES,
|
|
6760
|
+
...F_BACKGROUND_FEATURES,
|
|
6414
6761
|
CreateConnectionMarkersExecution,
|
|
6415
6762
|
CreateRoundedRectFromElementExecution,
|
|
6416
6763
|
EmitTransformChangesExecution,
|
|
6764
|
+
...F_SELECTION_FEATURES,
|
|
6417
6765
|
GetCanBeSelectedItemsExecution,
|
|
6418
6766
|
GetDeepChildrenNodesAndGroupsExecution,
|
|
6419
6767
|
GetConnectionLineExecution,
|
|
@@ -6421,14 +6769,9 @@ const COMMON_PROVIDERS = [
|
|
|
6421
6769
|
...GET_FLOW_STATE_PROVIDERS,
|
|
6422
6770
|
GetScaledNodeRectsWithFlowPositionExecution,
|
|
6423
6771
|
GetNodesRectExecution,
|
|
6424
|
-
GetOutputRectInFlowExecution,
|
|
6425
6772
|
GetPositionInFlowExecution,
|
|
6426
|
-
GetSelectionExecution,
|
|
6427
6773
|
IsConnectionUnderNodeExecution,
|
|
6428
6774
|
RedrawConnectionsExecution,
|
|
6429
|
-
SelectExecution,
|
|
6430
|
-
SelectAllExecution,
|
|
6431
|
-
SelectAndUpdateNodeLayerExecution,
|
|
6432
6775
|
ShowConnectionsAfterCalculationsExecution,
|
|
6433
6776
|
SortItemLayersExecution,
|
|
6434
6777
|
SortItemsByParentExecution,
|
|
@@ -6436,17 +6779,16 @@ const COMMON_PROVIDERS = [
|
|
|
6436
6779
|
SubscribeOnTransformChangesExecution,
|
|
6437
6780
|
UpdateItemAndChildrenLayersExecution,
|
|
6438
6781
|
MoveFrontElementsBeforeTargetElementExecution,
|
|
6439
|
-
GetInputRectInFlowExecution,
|
|
6440
6782
|
];
|
|
6441
6783
|
|
|
6442
|
-
let uniqueId$
|
|
6784
|
+
let uniqueId$2 = 0;
|
|
6443
6785
|
class FRectPatternComponent {
|
|
6444
6786
|
constructor(elementReference, fBrowser) {
|
|
6445
6787
|
this.elementReference = elementReference;
|
|
6446
6788
|
this.fBrowser = fBrowser;
|
|
6447
6789
|
this._subscription$ = new Subscription();
|
|
6448
6790
|
this._stateChanges = new Subject();
|
|
6449
|
-
this.id = `f-pattern-${uniqueId$
|
|
6791
|
+
this.id = `f-pattern-${uniqueId$2++}`;
|
|
6450
6792
|
this._vColor = 'rgba(0,0,0,0.1)';
|
|
6451
6793
|
this._hColor = 'rgba(0,0,0,0.1)';
|
|
6452
6794
|
this._vSize = 20;
|
|
@@ -6553,14 +6895,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
6553
6895
|
type: Input
|
|
6554
6896
|
}] } });
|
|
6555
6897
|
|
|
6556
|
-
let uniqueId$
|
|
6898
|
+
let uniqueId$1 = 0;
|
|
6557
6899
|
class FCirclePatternComponent {
|
|
6558
6900
|
constructor(elementReference, fBrowser) {
|
|
6559
6901
|
this.elementReference = elementReference;
|
|
6560
6902
|
this.fBrowser = fBrowser;
|
|
6561
6903
|
this._subscription$ = new Subscription();
|
|
6562
6904
|
this._stateChanges = new Subject();
|
|
6563
|
-
this.id = `f-pattern-${uniqueId$
|
|
6905
|
+
this.id = `f-pattern-${uniqueId$1++}`;
|
|
6564
6906
|
this._color = 'rgba(0,0,0,0.1)';
|
|
6565
6907
|
this._radius = 20;
|
|
6566
6908
|
this._scaledRadius = 20;
|
|
@@ -6658,13 +7000,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
6658
7000
|
type: Directive
|
|
6659
7001
|
}] });
|
|
6660
7002
|
|
|
6661
|
-
let uniqueId$1 = 0;
|
|
6662
7003
|
class FBackgroundComponent extends FBackgroundBase {
|
|
6663
|
-
constructor(elementReference, fComponentsStore,
|
|
7004
|
+
constructor(elementReference, fComponentsStore, fMediator) {
|
|
6664
7005
|
super();
|
|
6665
7006
|
this.elementReference = elementReference;
|
|
6666
7007
|
this.fComponentsStore = fComponentsStore;
|
|
6667
|
-
this.
|
|
7008
|
+
this.fMediator = fMediator;
|
|
6668
7009
|
}
|
|
6669
7010
|
get hostElement() {
|
|
6670
7011
|
return this.elementReference.nativeElement;
|
|
@@ -6673,23 +7014,7 @@ class FBackgroundComponent extends FBackgroundBase {
|
|
|
6673
7014
|
this.fComponentsStore.fBackground = this;
|
|
6674
7015
|
}
|
|
6675
7016
|
ngAfterContentInit() {
|
|
6676
|
-
|
|
6677
|
-
const children = ((_a = this.fBackgroundPattern) === null || _a === void 0 ? void 0 : _a.hostElement.getElementsByTagName('pattern')) || [];
|
|
6678
|
-
const pattern = children.length ? children[0] : undefined;
|
|
6679
|
-
if (pattern) {
|
|
6680
|
-
const defs = createSVGElement('defs', this.fBrowser);
|
|
6681
|
-
pattern.id = 'f-background-marker-' + uniqueId$1++;
|
|
6682
|
-
(_b = this.fBackgroundPattern) === null || _b === void 0 ? void 0 : _b.hostElement.remove();
|
|
6683
|
-
defs.appendChild(pattern);
|
|
6684
|
-
(_d = (_c = this.hostElement) === null || _c === void 0 ? void 0 : _c.firstChild) === null || _d === void 0 ? void 0 : _d.appendChild(defs);
|
|
6685
|
-
const rect = createSVGElement('rect', this.fBrowser);
|
|
6686
|
-
rect.setAttribute('fill', 'url(#' + pattern.id + ')');
|
|
6687
|
-
rect.setAttribute('width', '100%');
|
|
6688
|
-
rect.setAttribute('height', '100%');
|
|
6689
|
-
(_e = this.hostElement.firstChild) === null || _e === void 0 ? void 0 : _e.appendChild(rect);
|
|
6690
|
-
const transform = ((_f = this.fComponentsStore.fCanvas) === null || _f === void 0 ? void 0 : _f.transform) || TransformModelExtensions.default();
|
|
6691
|
-
(_g = this.fBackgroundPattern) === null || _g === void 0 ? void 0 : _g.setTransform(transform);
|
|
6692
|
-
}
|
|
7017
|
+
this.fMediator.send(new AddPatternToBackgroundRequest(this.fBackgroundPattern));
|
|
6693
7018
|
}
|
|
6694
7019
|
isBackgroundElement(element) {
|
|
6695
7020
|
return this.hostElement.contains(element);
|
|
@@ -6702,13 +7027,13 @@ class FBackgroundComponent extends FBackgroundBase {
|
|
|
6702
7027
|
this.fComponentsStore.fBackground = undefined;
|
|
6703
7028
|
}
|
|
6704
7029
|
}
|
|
6705
|
-
FBackgroundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FBackgroundComponent, deps: [{ token: i0.ElementRef }, { token: FComponentsStore }, { token:
|
|
6706
|
-
FBackgroundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FBackgroundComponent, selector: "f-background", host: { classAttribute: "f-component f-background" }, providers: [{ provide: F_BACKGROUND, useExisting: FBackgroundComponent }], queries: [{ propertyName: "fBackgroundPattern", first: true, predicate: F_BACKGROUND_PATTERN, descendants: true }], usesInheritance: true, ngImport: i0, template: "<svg><ng-content></ng-content></svg
|
|
7030
|
+
FBackgroundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FBackgroundComponent, deps: [{ token: i0.ElementRef }, { token: FComponentsStore }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Component });
|
|
7031
|
+
FBackgroundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FBackgroundComponent, selector: "f-background", host: { classAttribute: "f-component f-background" }, providers: [{ provide: F_BACKGROUND, useExisting: FBackgroundComponent }], queries: [{ propertyName: "fBackgroundPattern", first: true, predicate: F_BACKGROUND_PATTERN, descendants: true }], usesInheritance: true, ngImport: i0, template: "<svg><ng-content></ng-content></svg>", isInline: true, styles: [":host{position:absolute;width:100%;height:100%;left:0;top:0;transform-origin:0 0;pointer-events:none}:host svg{width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6707
7032
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FBackgroundComponent, decorators: [{
|
|
6708
7033
|
type: Component,
|
|
6709
7034
|
args: [{
|
|
6710
7035
|
selector: "f-background",
|
|
6711
|
-
|
|
7036
|
+
template: "<svg><ng-content></ng-content></svg>",
|
|
6712
7037
|
styleUrls: ["./f-background.component.scss"],
|
|
6713
7038
|
host: {
|
|
6714
7039
|
'class': 'f-component f-background'
|
|
@@ -6716,7 +7041,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
6716
7041
|
providers: [{ provide: F_BACKGROUND, useExisting: FBackgroundComponent }],
|
|
6717
7042
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
6718
7043
|
}]
|
|
6719
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: FComponentsStore }, { type:
|
|
7044
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: FComponentsStore }, { type: i2.FMediator }]; }, propDecorators: { fBackgroundPattern: [{
|
|
6720
7045
|
type: ContentChild,
|
|
6721
7046
|
args: [F_BACKGROUND_PATTERN, { static: false }]
|
|
6722
7047
|
}] } });
|
|
@@ -6735,27 +7060,25 @@ class FCanvasChangeEvent {
|
|
|
6735
7060
|
}
|
|
6736
7061
|
|
|
6737
7062
|
const F_CANVAS = new InjectionToken('F_CANVAS');
|
|
6738
|
-
|
|
6739
|
-
constructor(transform) {
|
|
6740
|
-
this.transform = transform;
|
|
6741
|
-
}
|
|
6742
|
-
}))));
|
|
6743
|
-
class FCanvasBase extends MIXIN_BASE {
|
|
7063
|
+
class FCanvasBase {
|
|
6744
7064
|
constructor() {
|
|
6745
|
-
|
|
7065
|
+
this.transform = TransformModelExtensions.default();
|
|
7066
|
+
}
|
|
7067
|
+
getPosition() {
|
|
7068
|
+
return this.transform.position;
|
|
6746
7069
|
}
|
|
6747
|
-
|
|
6748
|
-
this.
|
|
7070
|
+
setPosition(position) {
|
|
7071
|
+
this.transform.position = position;
|
|
6749
7072
|
}
|
|
6750
|
-
|
|
6751
|
-
|
|
7073
|
+
emitCanvasChangeEvent() {
|
|
7074
|
+
this.fCanvasChange.emit(new FCanvasChangeEvent(PointExtensions.sum(this.transform.position, this.transform.scaledPosition), this.transform.scale));
|
|
6752
7075
|
}
|
|
6753
7076
|
}
|
|
6754
7077
|
FCanvasBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FCanvasBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
6755
|
-
FCanvasBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: FCanvasBase,
|
|
7078
|
+
FCanvasBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: FCanvasBase, ngImport: i0 });
|
|
6756
7079
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FCanvasBase, decorators: [{
|
|
6757
7080
|
type: Directive
|
|
6758
|
-
}]
|
|
7081
|
+
}] });
|
|
6759
7082
|
|
|
6760
7083
|
class FCanvasComponent extends FCanvasBase {
|
|
6761
7084
|
constructor(elementReference, fMediator, fComponentsStore) {
|
|
@@ -6766,22 +7089,10 @@ class FCanvasComponent extends FCanvasBase {
|
|
|
6766
7089
|
this.fCanvasChange = new EventEmitter();
|
|
6767
7090
|
}
|
|
6768
7091
|
set position(value) {
|
|
6769
|
-
|
|
6770
|
-
return;
|
|
6771
|
-
}
|
|
6772
|
-
const position = PointExtensions.sum(this.transform.position, this.transform.scaledPosition);
|
|
6773
|
-
if (!PointExtensions.isEqual(position, value)) {
|
|
6774
|
-
this.transform.position = value;
|
|
6775
|
-
this.transform.scaledPosition = PointExtensions.initialize();
|
|
6776
|
-
this.redraw();
|
|
6777
|
-
}
|
|
7092
|
+
this.fMediator.send(new InputCanvasPositionRequest(this.transform, value));
|
|
6778
7093
|
}
|
|
6779
7094
|
set scale(value) {
|
|
6780
|
-
|
|
6781
|
-
return;
|
|
6782
|
-
}
|
|
6783
|
-
this.transform.scale = value;
|
|
6784
|
-
this.redraw();
|
|
7095
|
+
this.fMediator.send(new InputCanvasScaleRequest(this.transform, value));
|
|
6785
7096
|
}
|
|
6786
7097
|
get fNodes() {
|
|
6787
7098
|
return this.fComponentsStore.fNodes;
|
|
@@ -6810,36 +7121,22 @@ class FCanvasComponent extends FCanvasBase {
|
|
|
6810
7121
|
this.fMediator.send(new CenterGroupOrNodeRequest(id, animated));
|
|
6811
7122
|
}
|
|
6812
7123
|
fitToScreen(toCenter = PointExtensions.initialize(), animated = true) {
|
|
6813
|
-
|
|
6814
|
-
if (fNodesRect.width === 0 || fNodesRect.height === 0) {
|
|
6815
|
-
return;
|
|
6816
|
-
}
|
|
6817
|
-
this.fitToParent(fNodesRect, RectExtensions.fromElement(this.fComponentsStore.fFlow.hostElement), this.fNodes.map((x) => {
|
|
6818
|
-
return Point.fromPoint(x.position);
|
|
6819
|
-
}), toCenter);
|
|
6820
|
-
animated ? this.redrawWithAnimation() : this.redraw();
|
|
6821
|
-
this.completeDrag();
|
|
6822
|
-
setTimeout(() => {
|
|
6823
|
-
this.fComponentsStore.componentDataChanged();
|
|
6824
|
-
}, F_CANVAS_ANIMATION_DURATION);
|
|
7124
|
+
this.fMediator.send(new FitToFlowRequest(toCenter, animated));
|
|
6825
7125
|
}
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
this.redrawWithAnimation();
|
|
6835
|
-
this.completeDrag();
|
|
6836
|
-
setTimeout(() => {
|
|
6837
|
-
this.fComponentsStore.componentDataChanged();
|
|
6838
|
-
}, F_CANVAS_ANIMATION_DURATION);
|
|
7126
|
+
resetScaleAndCenter(animated = true) {
|
|
7127
|
+
this.fMediator.send(new ResetScaleAndCenterRequest(animated));
|
|
7128
|
+
}
|
|
7129
|
+
setZoom(scale, toPosition = PointExtensions.initialize()) {
|
|
7130
|
+
this.fMediator.send(new UpdateScaleRequest(scale, toPosition));
|
|
7131
|
+
}
|
|
7132
|
+
resetZoom() {
|
|
7133
|
+
this.fMediator.send(new ResetScaleRequest());
|
|
6839
7134
|
}
|
|
6840
7135
|
}
|
|
6841
7136
|
FCanvasComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FCanvasComponent, deps: [{ token: i0.ElementRef }, { token: i2.FMediator }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
6842
|
-
FCanvasComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FCanvasComponent, selector: "f-canvas", inputs: { position: "position", scale: "scale" }, outputs: { fCanvasChange: "fCanvasChange" }, host: { classAttribute: "f-component f-canvas" }, providers: [
|
|
7137
|
+
FCanvasComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FCanvasComponent, selector: "f-canvas", inputs: { position: "position", scale: "scale" }, outputs: { fCanvasChange: "fCanvasChange" }, host: { classAttribute: "f-component f-canvas" }, providers: [
|
|
7138
|
+
{ provide: F_CANVAS, useExisting: FCanvasComponent }
|
|
7139
|
+
], viewQueries: [{ propertyName: "fGroupsContainer", first: true, predicate: ["fGroupsContainer"], descendants: true, static: true }, { propertyName: "fNodesContainer", first: true, predicate: ["fNodesContainer"], descendants: true, static: true }, { propertyName: "fConnectionsContainer", first: true, predicate: ["fConnectionsContainer"], descendants: true, static: true }], exportAs: ["fComponent"], usesInheritance: true, ngImport: i0, template: "<ng-container>\n <div #fGroupsContainer>\n <ng-content select=\"[fGroup]\"></ng-content>\n </div>\n <div #fConnectionsContainer>\n <ng-content select=\"f-snap-connection\"></ng-content>\n <ng-content select=\"f-connection\"></ng-content>\n <ng-content select=\"f-connection-for-create\"></ng-content>\n </div>\n\n <div #fNodesContainer>\n <ng-content select=\"[fNode]\"></ng-content>\n </div>\n</ng-container>\n", styles: [":host{position:absolute;overflow:visible;width:100%;height:100%;left:0;top:0;transform-origin:0 0;pointer-events:none}:host.f-scaled-animate{transition:transform .09s}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6843
7140
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FCanvasComponent, decorators: [{
|
|
6844
7141
|
type: Component,
|
|
6845
7142
|
args: [{
|
|
@@ -6850,7 +7147,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
6850
7147
|
host: {
|
|
6851
7148
|
'class': 'f-component f-canvas',
|
|
6852
7149
|
},
|
|
6853
|
-
providers: [
|
|
7150
|
+
providers: [
|
|
7151
|
+
{ provide: F_CANVAS, useExisting: FCanvasComponent }
|
|
7152
|
+
],
|
|
6854
7153
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
6855
7154
|
}]
|
|
6856
7155
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2.FMediator }, { type: FComponentsStore }]; }, propDecorators: { fCanvasChange: [{
|
|
@@ -7133,21 +7432,6 @@ const F_LINE_ALIGNMENT_PROVIDERS = [
|
|
|
7133
7432
|
FLineAlignmentComponent
|
|
7134
7433
|
];
|
|
7135
7434
|
|
|
7136
|
-
function checkRectIsFinite(rect) {
|
|
7137
|
-
if (!Number.isFinite(rect.width) || !Number.isFinite(rect.height) || !Number.isFinite(rect.x) || !Number.isFinite(rect.y)) {
|
|
7138
|
-
return RectExtensions.initialize(0, 0, 0, 0);
|
|
7139
|
-
}
|
|
7140
|
-
return rect;
|
|
7141
|
-
}
|
|
7142
|
-
|
|
7143
|
-
class FMinimapData {
|
|
7144
|
-
constructor(element, scale = 1, viewBox = RectExtensions.initialize(0, 0, 0, 0)) {
|
|
7145
|
-
this.element = element;
|
|
7146
|
-
this.scale = scale;
|
|
7147
|
-
this.viewBox = viewBox;
|
|
7148
|
-
}
|
|
7149
|
-
}
|
|
7150
|
-
|
|
7151
7435
|
class FMinimapFlowDirective {
|
|
7152
7436
|
constructor(elementReference, fMediator, fComponentsStore) {
|
|
7153
7437
|
this.elementReference = elementReference;
|
|
@@ -7379,69 +7663,6 @@ const F_MINIMAP_PROVIDERS = [
|
|
|
7379
7663
|
FMinimapFlowDirective,
|
|
7380
7664
|
];
|
|
7381
7665
|
|
|
7382
|
-
class FSelectionAreaBase {
|
|
7383
|
-
}
|
|
7384
|
-
FSelectionAreaBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FSelectionAreaBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
7385
|
-
FSelectionAreaBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: FSelectionAreaBase, ngImport: i0 });
|
|
7386
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FSelectionAreaBase, decorators: [{
|
|
7387
|
-
type: Directive
|
|
7388
|
-
}] });
|
|
7389
|
-
|
|
7390
|
-
class FSelectionAreaComponent extends FSelectionAreaBase {
|
|
7391
|
-
constructor(elementReference, fMediator) {
|
|
7392
|
-
super();
|
|
7393
|
-
this.elementReference = elementReference;
|
|
7394
|
-
this.fMediator = fMediator;
|
|
7395
|
-
}
|
|
7396
|
-
get hostElement() {
|
|
7397
|
-
return this.elementReference.nativeElement;
|
|
7398
|
-
}
|
|
7399
|
-
ngOnInit() {
|
|
7400
|
-
this.hostElement.style.display = 'none';
|
|
7401
|
-
}
|
|
7402
|
-
hide() {
|
|
7403
|
-
this.hostElement.style.display = 'none';
|
|
7404
|
-
}
|
|
7405
|
-
show() {
|
|
7406
|
-
this.hostElement.style.display = 'block';
|
|
7407
|
-
}
|
|
7408
|
-
draw(object) {
|
|
7409
|
-
const style = this.hostElement.style;
|
|
7410
|
-
style.left = object.x + 'px';
|
|
7411
|
-
style.top = object.y + 'px';
|
|
7412
|
-
style.width = object.width + 'px';
|
|
7413
|
-
style.height = object.height + 'px';
|
|
7414
|
-
}
|
|
7415
|
-
onPointerDown(event) {
|
|
7416
|
-
this.fMediator.send(new SelectionAreaPreparationRequest(event, this));
|
|
7417
|
-
}
|
|
7418
|
-
onPointerUp(event) {
|
|
7419
|
-
this.fMediator.send(new SelectionAreaFinalizeRequest(event));
|
|
7420
|
-
}
|
|
7421
|
-
}
|
|
7422
|
-
FSelectionAreaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FSelectionAreaComponent, deps: [{ token: i0.ElementRef }, { token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Component });
|
|
7423
|
-
FSelectionAreaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FSelectionAreaComponent, selector: "f-selection-area", host: { classAttribute: "f-selection-area f-component" }, providers: [
|
|
7424
|
-
{ provide: F_DRAG_AND_DROP_PLUGIN, useExisting: FSelectionAreaComponent },
|
|
7425
|
-
], usesInheritance: true, ngImport: i0, template: ``, isInline: true, styles: [":host{position:absolute}\n"] });
|
|
7426
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FSelectionAreaComponent, decorators: [{
|
|
7427
|
-
type: Component,
|
|
7428
|
-
args: [{
|
|
7429
|
-
selector: "f-selection-area",
|
|
7430
|
-
template: ``,
|
|
7431
|
-
styleUrls: ['./f-selection-area.component.scss'],
|
|
7432
|
-
host: {
|
|
7433
|
-
'class': 'f-selection-area f-component'
|
|
7434
|
-
},
|
|
7435
|
-
providers: [
|
|
7436
|
-
{ provide: F_DRAG_AND_DROP_PLUGIN, useExisting: FSelectionAreaComponent },
|
|
7437
|
-
],
|
|
7438
|
-
}]
|
|
7439
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2.FMediator }]; } });
|
|
7440
|
-
|
|
7441
|
-
const F_SELECTION_AREA_PROVIDERS = [
|
|
7442
|
-
FSelectionAreaComponent
|
|
7443
|
-
];
|
|
7444
|
-
|
|
7445
7666
|
const F_FLOW = new InjectionToken('F_FLOW');
|
|
7446
7667
|
class FFlowBase {
|
|
7447
7668
|
}
|
|
@@ -7473,15 +7694,14 @@ class FFlowComponent extends FFlowBase {
|
|
|
7473
7694
|
this.subscription$.add(this.subscribeOnComponentsCountChanges());
|
|
7474
7695
|
}
|
|
7475
7696
|
subscribeOnComponentsCountChanges() {
|
|
7476
|
-
return this.fComponentsStore.componentsCount$.pipe(startWith(null), debounceTime(
|
|
7697
|
+
return this.fComponentsStore.componentsCount$.pipe(startWith(null), debounceTime(1)).subscribe(() => {
|
|
7477
7698
|
this.fMediator.send(new SortItemLayersRequest());
|
|
7478
7699
|
});
|
|
7479
7700
|
}
|
|
7480
7701
|
subscribeOnElementsChanges() {
|
|
7481
|
-
return this.fComponentsStore.componentsData$.pipe(startWith(null), debounceTime(
|
|
7702
|
+
return this.fComponentsStore.componentsData$.pipe(startWith(null), debounceTime(1)).subscribe(() => {
|
|
7482
7703
|
this.fMediator.send(new RedrawConnectionsRequest());
|
|
7483
7704
|
if (!this.isLoaded) {
|
|
7484
|
-
// this.fMediator.send(new ShowConnectionsAfterCalculationsRequest());
|
|
7485
7705
|
this.isLoaded = true;
|
|
7486
7706
|
this.fLoaded.emit();
|
|
7487
7707
|
}
|
|
@@ -7525,8 +7745,8 @@ FFlowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version
|
|
|
7525
7745
|
FTransformStore,
|
|
7526
7746
|
FDraggableDataContext,
|
|
7527
7747
|
FConnectionFactory,
|
|
7528
|
-
...F_DRAGGABLE_PROVIDERS,
|
|
7529
7748
|
...COMMON_PROVIDERS,
|
|
7749
|
+
...F_DRAGGABLE_PROVIDERS,
|
|
7530
7750
|
{ provide: F_FLOW, useExisting: FFlowComponent },
|
|
7531
7751
|
], usesInheritance: true, ngImport: i0, template: "<ng-container>\n <ng-content select=\"[fDefinitions]\"></ng-content>\n\n <ng-content select=\"f-background\"></ng-content>\n\n <ng-content select=\"f-line-alignment\"></ng-content>\n\n <ng-content select=\"f-canvas\"></ng-content>\n\n <ng-content select=\"f-selection-area\"></ng-content>\n\n <ng-content select=\"f-minimap\"></ng-content>\n</ng-container>\n", styles: [":host{display:block;position:relative;width:100%;height:100%;overflow:hidden;pointer-events:all;-webkit-user-select:none;user-select:none;touch-action:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7532
7752
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FFlowComponent, decorators: [{
|
|
@@ -7545,8 +7765,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
7545
7765
|
FTransformStore,
|
|
7546
7766
|
FDraggableDataContext,
|
|
7547
7767
|
FConnectionFactory,
|
|
7548
|
-
...F_DRAGGABLE_PROVIDERS,
|
|
7549
7768
|
...COMMON_PROVIDERS,
|
|
7769
|
+
...F_DRAGGABLE_PROVIDERS,
|
|
7550
7770
|
{ provide: F_FLOW, useExisting: FFlowComponent },
|
|
7551
7771
|
],
|
|
7552
7772
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -7612,7 +7832,7 @@ class FZoomBase {
|
|
|
7612
7832
|
const pointerPositionInFlow = new Point(event.clientX, event.clientY).elementTransform(this.flowHost);
|
|
7613
7833
|
this.fCanvas.setZoom(result, pointerPositionInFlow);
|
|
7614
7834
|
this.fCanvas.redraw();
|
|
7615
|
-
this.fCanvas.
|
|
7835
|
+
this.fCanvas.emitCanvasChangeEvent();
|
|
7616
7836
|
}
|
|
7617
7837
|
onDoubleClick(event) {
|
|
7618
7838
|
var _a;
|
|
@@ -7629,7 +7849,7 @@ class FZoomBase {
|
|
|
7629
7849
|
const pointerPositionInFlow = new Point(event.clientX, event.clientY).elementTransform(this.flowHost);
|
|
7630
7850
|
this.fCanvas.setZoom(result, pointerPositionInFlow);
|
|
7631
7851
|
this.fCanvas.redrawWithAnimation();
|
|
7632
|
-
this.fCanvas.
|
|
7852
|
+
this.fCanvas.emitCanvasChangeEvent();
|
|
7633
7853
|
}
|
|
7634
7854
|
onZoomToCenter(deltaY, position) {
|
|
7635
7855
|
const preventDefault = () => {
|
|
@@ -7648,7 +7868,7 @@ class FZoomBase {
|
|
|
7648
7868
|
reset() {
|
|
7649
7869
|
this.fCanvas.resetZoom();
|
|
7650
7870
|
this.fCanvas.redraw();
|
|
7651
|
-
this.fCanvas.
|
|
7871
|
+
this.fCanvas.emitCanvasChangeEvent();
|
|
7652
7872
|
}
|
|
7653
7873
|
unsubscribe() {
|
|
7654
7874
|
this.listeners();
|
|
@@ -7717,7 +7937,7 @@ const F_ZOOM_PROVIDERS = [
|
|
|
7717
7937
|
class FFlowModule {
|
|
7718
7938
|
}
|
|
7719
7939
|
FFlowModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FFlowModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
7720
|
-
FFlowModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FFlowModule, declarations: [FBackgroundComponent, FRectPatternComponent, FCirclePatternComponent, FCanvasComponent, FZoomDirective, FConnectionTextComponent, FConnectionTextPathDirective, FConnectionDragHandleComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionComponent, FConnectionCenterDirective, FConnectionForCreateComponent, FMarkerDirective, FNodeInputDirective, FNodeOutletDirective, FNodeOutputDirective, FExternalItemDirective, FFlowComponent, FLineAlignmentComponent, FMinimapComponent, FMinimapCanvasDirective, FMinimapViewDirective, FMinimapFlowDirective, FGroupDirective, FNodeDirective, FDragHandleDirective, FResizeHandleDirective, FSelectionAreaComponent, FDraggableDirective], imports: [CommonModule], exports: [FBackgroundComponent, FRectPatternComponent, FCirclePatternComponent, FCanvasComponent, FZoomDirective, FConnectionTextComponent, FConnectionTextPathDirective, FConnectionDragHandleComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionComponent, FConnectionCenterDirective, FConnectionForCreateComponent, FMarkerDirective, FNodeInputDirective, FNodeOutletDirective, FNodeOutputDirective, FExternalItemDirective, FFlowComponent, FLineAlignmentComponent, FMinimapComponent, FMinimapCanvasDirective, FMinimapViewDirective, FMinimapFlowDirective, FGroupDirective, FNodeDirective, FDragHandleDirective, FResizeHandleDirective, FSelectionAreaComponent, FDraggableDirective] });
|
|
7940
|
+
FFlowModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FFlowModule, declarations: [FBackgroundComponent, FRectPatternComponent, FCirclePatternComponent, FCanvasComponent, FZoomDirective, FConnectionTextComponent, FConnectionTextPathDirective, FConnectionDragHandleComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionComponent, FConnectionCenterDirective, FConnectionForCreateComponent, FMarkerDirective, FSnapConnectionComponent, FNodeInputDirective, FNodeOutletDirective, FNodeOutputDirective, FExternalItemDirective, FFlowComponent, FLineAlignmentComponent, FMinimapComponent, FMinimapCanvasDirective, FMinimapViewDirective, FMinimapFlowDirective, FGroupDirective, FNodeDirective, FDragHandleDirective, FResizeHandleDirective, FSelectionAreaComponent, FDraggableDirective], imports: [CommonModule], exports: [FBackgroundComponent, FRectPatternComponent, FCirclePatternComponent, FCanvasComponent, FZoomDirective, FConnectionTextComponent, FConnectionTextPathDirective, FConnectionDragHandleComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionComponent, FConnectionCenterDirective, FConnectionForCreateComponent, FMarkerDirective, FSnapConnectionComponent, FNodeInputDirective, FNodeOutletDirective, FNodeOutputDirective, FExternalItemDirective, FFlowComponent, FLineAlignmentComponent, FMinimapComponent, FMinimapCanvasDirective, FMinimapViewDirective, FMinimapFlowDirective, FGroupDirective, FNodeDirective, FDragHandleDirective, FResizeHandleDirective, FSelectionAreaComponent, FDraggableDirective] });
|
|
7721
7941
|
FFlowModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FFlowModule, imports: [[
|
|
7722
7942
|
CommonModule,
|
|
7723
7943
|
]] });
|
|
@@ -7762,5 +7982,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
7762
7982
|
* Generated bundle index. Do not edit.
|
|
7763
7983
|
*/
|
|
7764
7984
|
|
|
7765
|
-
export { ApplyChildResizeRestrictionsExecution, ApplyChildResizeRestrictionsRequest, ApplyParentResizeRestrictionsExecution, ApplyParentResizeRestrictionsRequest, CANVAS_MOVE_FINALIZE_PROVIDERS, CANVAS_MOVE_PREPARATION_PROVIDERS, CANVAS_PROVIDERS, COMMON_PROVIDERS, CONNECTIONS_PROVIDERS, CONNECTION_GRADIENT, CONNECTION_PATH, CONNECTION_TEXT,
|
|
7985
|
+
export { AddPatternToBackgroundExecution, AddPatternToBackgroundRequest, ApplyChildResizeRestrictionsExecution, ApplyChildResizeRestrictionsRequest, ApplyParentResizeRestrictionsExecution, ApplyParentResizeRestrictionsRequest, CANVAS_MOVE_FINALIZE_PROVIDERS, CANVAS_MOVE_PREPARATION_PROVIDERS, CANVAS_PROVIDERS, COMMON_PROVIDERS, CONNECTIONS_PROVIDERS, CONNECTION_GRADIENT, CONNECTION_PATH, CONNECTION_TEXT, CREATE_MOVE_NODE_DRAG_MODEL_FROM_SELECTION_PROVIDERS, CalculateCenterBetweenPointsHandler, CalculateCenterBetweenPointsRequest, CalculateChangedPositionExecution, CalculateChangedPositionRequest, CalculateChangedSizeExecution, CalculateChangedSizeRequest, CalculateConnectionCenterHandler, CalculateConnectionCenterRequest, CalculateConnectorConnectableSideHandler, CalculateConnectorConnectableSideRequest, CalculateFlowPointFromMinimapPointExecution, CalculateFlowPointFromMinimapPointRequest, CanvasDragHandler, CanvasMoveFinalizeExecution, CanvasMoveFinalizeRequest, CanvasMoveFinalizeValidator, CanvasMovePreparationExecution, CanvasMovePreparationRequest, CanvasMovePreparationValidator, CenterGroupOrNodeExecution, CenterGroupOrNodeRequest, ClearSelectionExecution, ClearSelectionRequest, ConnectionBaseDragHandler, ConnectionDragHandler, ConnectionSourceDragHandler, ConnectionTargetDragHandler, CreateConnectionDragHandler, CreateConnectionDragHandlerExecution, CreateConnectionDragHandlerRequest, CreateConnectionFinalizeExecution, CreateConnectionFinalizeRequest, CreateConnectionFinalizeValidator, CreateConnectionFromOutletPreparationExecution, CreateConnectionFromOutletPreparationRequest, CreateConnectionFromOutputPreparationExecution, CreateConnectionFromOutputPreparationRequest, CreateConnectionFromOutputPreparationValidator, CreateConnectionMarkersExecution, CreateConnectionMarkersRequest, CreateConnectionPreparationExecution, CreateConnectionPreparationRequest, CreateConnectionPreparationValidator, CreateMoveNodesDragModelFromSelectionExecution, CreateMoveNodesDragModelFromSelectionRequest, CreateRoundedRectFromElementExecution, CreateRoundedRectFromElementRequest, DRAG_AND_DROP_COMMON_PROVIDERS, EFConnectableSide, EFConnectionBehavior, EFConnectionType, EFMarkerType, EFResizeHandleType, EXTERNAL_ITEM_FINALIZE_PROVIDERS, EXTERNAL_ITEM_PREPARATION_PROVIDERS, EmitTransformChangesExecution, EmitTransformChangesRequest, ExternalItemDragHandler, ExternalItemFinalizeExecution, ExternalItemFinalizeRequest, ExternalItemFinalizeValidator, ExternalItemPreparationExecution, ExternalItemPreparationRequest, ExternalItemPreparationValidator, FBackgroundBase, FBackgroundComponent, FBezierPathBuilder, FCanvasBase, FCanvasChangeEvent, FCanvasComponent, FCirclePatternComponent, FComponentsStore, FConnectionBase, FConnectionCenterDirective, FConnectionComponent, FConnectionDragHandleComponent, FConnectionFactory, FConnectionForCreateComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionTextComponent, FConnectionTextPathDirective, FConnectorBase, FCreateConnectionEvent, FCreateNodeEvent, FDragHandleDirective, FDraggableBase, FDraggableDataContext, FDraggableDirective, FExternalItemBase, FExternalItemDirective, FExternalItemService, FFlowBase, FFlowComponent, FFlowModule, FGroupDirective, FLineAlignmentBase, FLineAlignmentComponent, FMarkerBase, FMarkerDirective, FMinimapCanvasDirective, FMinimapComponent, FMinimapData, FMinimapDragHandler, FMinimapFlowDirective, FMinimapViewDirective, FNodeBase, FNodeDirective, FNodeInputBase, FNodeInputDirective, FNodeOutletBase, FNodeOutletDirective, FNodeOutputBase, FNodeOutputDirective, FReassignConnectionEvent, FRectPatternComponent, FResizeHandleDirective, FResizeObserver, FRotateHandleDirective, FSegmentPathBuilder, FSelectionAreaBase, FSelectionAreaComponent, FSelectionChangeEvent, FSnapConnectionComponent, FStraightPathBuilder, FTransformStore, FZoomBase, FZoomDirective, F_BACKGROUND, F_BACKGROUND_FEATURES, F_BACKGROUND_PATTERN, F_BACKGROUND_PROVIDERS, F_CANVAS, F_CANVAS_ANIMATION_DURATION, F_CANVAS_FEATURES, F_CANVAS_PROVIDERS, F_CONNECTION_BUILDERS, F_CONNECTION_DRAG_HANDLE_CLASS, F_CONNECTION_FEATURES, F_CONNECTION_IDENTIFIERS, F_CONNECTION_PROVIDERS, F_CONNECTORS_PROVIDERS, F_DRAGGABLE_PROVIDERS, F_DRAG_AND_DROP_PLUGIN, F_DRAG_HANDLE, F_EXTERNAL_ITEM, F_EXTERNAL_ITEM_DRAG_AND_DROP_PROVIDERS, F_EXTERNAL_ITEM_PROVIDERS, F_FLOW, F_FLOW_PROVIDERS, F_LINE_ALIGNMENT, F_LINE_ALIGNMENT_PROVIDERS, F_MARKER, F_MINIMAP_DRAG_AND_DROP_PROVIDERS, F_MINIMAP_PROVIDERS, F_NODE, F_NODE_INPUT, F_NODE_OUTLET, F_NODE_OUTPUT, F_NODE_PROVIDERS, F_RESIZE_HANDLE, F_SELECTED_CLASS, F_SELECTION_AREA_DRAG_AND_DROP_PROVIDERS, F_SELECTION_AREA_PROVIDERS, F_SELECTION_FEATURES, F_ZOOM, F_ZOOM_PROVIDERS, FindClosestInputUsingSnapThresholdExecution, FindClosestInputUsingSnapThresholdRequest, FitToFlowExecution, FitToFlowRequest, GET_FLOW_STATE_PROVIDERS, GetAllCanBeConnectedInputPositionsExecution, GetAllCanBeConnectedInputPositionsRequest, GetCanBeConnectedOutputByOutletExecution, GetCanBeConnectedOutputByOutletRequest, GetCanBeConnectedOutputByOutletValidator, GetCanBeSelectedItemsExecution, GetConnectionLineExecution, GetConnectionLineRequest, GetConnectorWithRectExecution, GetConnectorWithRectRequest, GetDeepChildrenNodesAndGroupsExecution, GetDeepChildrenNodesAndGroupsRequest, GetElementRectInFlowExecution, GetElementRectInFlowRequest, GetFlowStateConnectionsExecution, GetFlowStateConnectionsRequest, GetFlowStateExecution, GetFlowStateNodesExecution, GetFlowStateNodesRequest, GetFlowStateRequest, GetInputUnderPointerExecution, GetInputUnderPointerRequest, GetInputUnderPointerValidator, GetNodeMoveRestrictionsExecution, GetNodeMoveRestrictionsRequest, GetNodePaddingExecution, GetNodePaddingRequest, GetNodeResizeRestrictionsExecution, GetNodeResizeRestrictionsRequest, GetNodesRectExecution, GetNodesRectRequest, GetNormalizedChildrenNodesRectExecution, GetNormalizedChildrenNodesRectRequest, GetNormalizedNodeRectExecution, GetNormalizedNodeRectRequest, GetNormalizedParentNodeRectExecution, GetNormalizedParentNodeRectRequest, GetParentNodesExecution, GetParentNodesRequest, GetPositionInFlowExecution, GetPositionInFlowRequest, GetScaledNodeRectsWithFlowPositionExecution, GetScaledNodeRectsWithFlowPositionRequest, GetSelectionExecution, GetSelectionRequest, InputCanvasPositionExecution, InputCanvasPositionRequest, InputCanvasScaleExecution, InputCanvasScaleRequest, IsArrayHasParentNodeExecution, IsArrayHasParentNodeRequest, IsConnectionUnderNodeExecution, LineElement, LineService, MINIMAP_DRAG_FINALIZE_PROVIDERS, MINIMAP_DRAG_PREPARATION_PROVIDERS, MinimapDragFinalizeExecution, MinimapDragFinalizeRequest, MinimapDragFinalizeValidator, MinimapDragPreparationExecution, MinimapDragPreparationRequest, MinimapDragPreparationValidator, MoveFrontElementsBeforeTargetElementExecution, MoveFrontElementsBeforeTargetElementRequest, NODE_MOVE_FINALIZE_PROVIDERS, NODE_MOVE_PREPARATION_PROVIDERS, NODE_PROVIDERS, NODE_RESIZE_FINALIZE_PROVIDERS, NODE_RESIZE_PREPARATION_PROVIDERS, NODE_RESIZE_PROVIDERS, NearestCoordinateFinder, NodeDragHandler, NodeMoveFinalizeExecution, NodeMoveFinalizeRequest, NodeMoveFinalizeValidator, NodeMovePreparationExecution, NodeMovePreparationRequest, NodeMovePreparationValidator, NodeResizeByChildDragHandler, NodeResizeDragHandler, NodeResizeFinalizeExecution, NodeResizeFinalizeRequest, NodeResizeFinalizeValidator, NodeResizePreparationExecution, NodeResizePreparationRequest, NodeResizePreparationValidator, PutInputConnectionHandlersToArrayExecution, PutInputConnectionHandlersToArrayRequest, PutOutputConnectionHandlersToArrayExecution, PutOutputConnectionHandlersToArrayRequest, RESIZE_DIRECTIONS, ReassignConnectionDragHandler, ReassignConnectionFinalizeExecution, ReassignConnectionFinalizeRequest, ReassignConnectionFinalizeValidator, ReassignConnectionPreparationExecution, ReassignConnectionPreparationRequest, ReassignConnectionPreparationValidator, RedrawConnectionsExecution, RedrawConnectionsRequest, ResetScaleAndCenterExecution, ResetScaleAndCenterRequest, ResetScaleExecution, ResetScaleRequest, SELECTION_AREA_FINALIZE_PROVIDERS, SELECTION_AREA_PREPARATION_PROVIDERS, SINGLE_SELECT_PROVIDERS, SelectAllExecution, SelectAllRequest, SelectAndUpdateNodeLayerExecution, SelectAndUpdateNodeLayerRequest, SelectExecution, SelectRequest, SelectionAreaDragHandle, SelectionAreaFinalizeExecution, SelectionAreaFinalizeRequest, SelectionAreaFinalizeValidator, SelectionAreaPreparationExecution, SelectionAreaPreparationRequest, SelectionAreaPreparationValidator, ShowConnectionsAfterCalculationsExecution, ShowConnectionsAfterCalculationsRequest, SingleSelectExecution, SingleSelectRequest, SingleSelectValidator, SortItemLayersExecution, SortItemLayersRequest, SortItemsByParentExecution, SortItemsByParentRequest, SortNodeLayersExecution, SortNodeLayersRequest, SubscribeOnTransformChangesExecution, SubscribeOnTransformChangesRequest, UpdateItemAndChildrenLayersExecution, UpdateItemAndChildrenLayersRequest, UpdateScaleExecution, UpdateScaleRequest, checkRectIsFinite, createSVGElement, getExternalItem, getMarkerEndId, getMarkerSelectedEndId, getMarkerSelectedStartId, getMarkerStartId, isExternalItem, isGroup, isNode, isNodeOutlet, isNodeOutput, mixinChangeSelection, mixinChangeVisibility };
|
|
7766
7986
|
//# sourceMappingURL=foblex-flow.js.map
|