@foblex/flow 12.6.7 → 12.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +1 -1
  2. package/bundles/foblex-flow.umd.js +29 -13
  3. package/bundles/foblex-flow.umd.js.map +1 -1
  4. package/esm2015/domain/f-background/add-pattern-to-background/add-pattern-to-background.execution.js +2 -2
  5. package/esm2015/domain/f-canvas/center-group-or-node/center-group-or-node.execution.js +2 -2
  6. package/esm2015/domain/f-canvas/fit-to-flow/fit-to-flow.execution.js +2 -2
  7. package/esm2015/domain/f-canvas/reset-scale-and-center/reset-scale-and-center.execution.js +2 -2
  8. package/esm2015/f-draggable/connections/create-connection/create-connection.drag-handler.js +7 -2
  9. package/esm2015/f-draggable/connections/get-input-under-pointer/get-input-under-pointer.execution.js +1 -1
  10. package/esm2015/f-draggable/connections/reassign-connection/reassign-connection.drag-handler.js +11 -3
  11. package/esm2015/f-draggable/node-resize/apply-child-resize-restrictions/apply-child-resize-restrictions.request.js +1 -1
  12. package/esm2015/f-draggable/node-resize/calculate-changed-size/calculate-changed-size.execution.js +1 -1
  13. package/esm2015/f-draggable/node-resize/get-node-resize-restrictions/get-node-resize-restrictions.execution.js +9 -3
  14. package/esm2015/f-draggable/node-resize/get-node-resize-restrictions/i-node-resize-restrictions.js +1 -1
  15. package/esm2015/f-draggable/node-resize/get-normalized-children-nodes-rect/get-normalized-children-nodes-rect.execution.js +3 -6
  16. package/esm2015/f-draggable/node-resize/get-normalized-children-nodes-rect/get-normalized-children-nodes-rect.request.js +3 -3
  17. package/esm2015/f-draggable/node-resize/node-resize.drag-handler.js +5 -4
  18. package/esm2015/f-external-item/domain/external-item-preparation/external-item-preparation.execution.js +3 -3
  19. package/esm2015/f-external-item/domain/external-item-preparation/external-item-preparation.validator.js +3 -3
  20. package/esm2015/f-external-item/domain/external-item.drag-handler.js +1 -1
  21. package/esm2015/f-flow/f-flow.component.js +1 -1
  22. package/f-draggable/node-resize/get-node-resize-restrictions/get-node-resize-restrictions.execution.d.ts +1 -0
  23. package/f-draggable/node-resize/get-node-resize-restrictions/i-node-resize-restrictions.d.ts +2 -1
  24. package/f-draggable/node-resize/get-normalized-children-nodes-rect/get-normalized-children-nodes-rect.execution.d.ts +0 -1
  25. package/f-draggable/node-resize/get-normalized-children-nodes-rect/get-normalized-children-nodes-rect.request.d.ts +2 -3
  26. package/f-external-item/domain/external-item-preparation/external-item-preparation.execution.d.ts +1 -1
  27. package/f-external-item/domain/external-item-preparation/external-item-preparation.validator.d.ts +1 -1
  28. package/f-external-item/domain/external-item.drag-handler.d.ts +1 -1
  29. package/fesm2015/foblex-flow.js +29 -13
  30. package/fesm2015/foblex-flow.js.map +1 -1
  31. package/package.json +1 -1
package/README.md CHANGED
@@ -68,7 +68,7 @@ You can also report [issues](https://github.com/Foblex/flow/issues) and request
68
68
 
69
69
  ### License
70
70
 
71
- This library is available for use under the [MIT License](./LICENSE).
71
+ This library is available for use under the [MIT License](LICENSE).
72
72
 
73
73
  For more information please contact our [support](mailto:support@foblex.com).
74
74
 
@@ -2777,7 +2777,9 @@
2777
2777
  };
2778
2778
  CreateConnectionDragHandler.prototype.move = function (difference) {
2779
2779
  this.drawTempConnection(this.toConnectorRect.addPoint(difference));
2780
- this.drawSnapConnection(this.getClosetInput(difference));
2780
+ if (this.fSnapConnection) {
2781
+ this.drawSnapConnection(this.getClosetInput(difference));
2782
+ }
2781
2783
  };
2782
2784
  CreateConnectionDragHandler.prototype.drawTempConnection = function (fInputRect) {
2783
2785
  var line = this.fMediator.send(new GetConnectionLineRequest(this.fOutputWithRect.fRect, fInputRect, this.fConnection.fBehavior, this.fOutputWithRect.fConnector.fConnectableSide, exports.EFConnectableSide.TOP));
@@ -2797,6 +2799,9 @@
2797
2799
  }
2798
2800
  };
2799
2801
  CreateConnectionDragHandler.prototype.getClosetInput = function (difference) {
2802
+ if (!this.fSnapConnection) {
2803
+ return undefined;
2804
+ }
2800
2805
  return this.fMediator.send(new FindClosestInputUsingSnapThresholdRequest(_2d.Point.fromPoint(this.toConnectorRect).add(difference), this.canBeConnectedInputs, this.fSnapConnection.fSnapThreshold));
2801
2806
  };
2802
2807
  CreateConnectionDragHandler.prototype.complete = function () {
@@ -3155,8 +3160,13 @@
3155
3160
  return this.fComponentsStore.fInputs.find(function (x) { return x.id === _this.fConnection.fInputId; });
3156
3161
  };
3157
3162
  ReassignConnectionDragHandler.prototype.move = function (difference) {
3158
- this.drawConnection({ fRect: this.toConnectorRect.addPoint(difference), fConnector: this.fInputWithRect.fConnector });
3159
- this.drawSnapConnection(this.getClosetInput(difference));
3163
+ this.drawConnection({
3164
+ fRect: this.toConnectorRect.addPoint(difference),
3165
+ fConnector: this.fInputWithRect.fConnector
3166
+ });
3167
+ if (this.fSnapConnection) {
3168
+ this.drawSnapConnection(this.getClosetInput(difference));
3169
+ }
3160
3170
  };
3161
3171
  ReassignConnectionDragHandler.prototype.drawConnection = function (fInputWithRect) {
3162
3172
  var line = this.fMediator.send(new GetConnectionLineRequest(this.fOutputWithRect.fRect, fInputWithRect.fRect, this.fConnection.fBehavior, this.fOutputWithRect.fConnector.fConnectableSide, fInputWithRect.fConnector.fConnectableSide));
@@ -3176,6 +3186,9 @@
3176
3186
  }
3177
3187
  };
3178
3188
  ReassignConnectionDragHandler.prototype.getClosetInput = function (difference) {
3189
+ if (!this.fSnapConnection) {
3190
+ return undefined;
3191
+ }
3179
3192
  return this.fMediator.send(new FindClosestInputUsingSnapThresholdRequest(_2d.Point.fromPoint(this.toConnectorRect).add(difference), this.canBeConnectedInputs, this.fSnapConnection.fSnapThreshold));
3180
3193
  };
3181
3194
  ReassignConnectionDragHandler.prototype.complete = function () {
@@ -5746,9 +5759,9 @@
5746
5759
  }] });
5747
5760
 
5748
5761
  var GetNormalizedChildrenNodesRectRequest = /** @class */ (function () {
5749
- function GetNormalizedChildrenNodesRectRequest(fNode, rect) {
5762
+ function GetNormalizedChildrenNodesRectRequest(fNode, paddings) {
5750
5763
  this.fNode = fNode;
5751
- this.rect = rect;
5764
+ this.paddings = paddings;
5752
5765
  }
5753
5766
  return GetNormalizedChildrenNodesRectRequest;
5754
5767
  }());
@@ -5761,7 +5774,7 @@
5761
5774
  var _this = this;
5762
5775
  var childNodeRect = _2d.RectExtensions.union(this.getChildrenNodes(request.fNode.fId).map(function (x) { return _this.normalizeRect(x); }));
5763
5776
  return childNodeRect ?
5764
- this.concatRectWithParentPadding(childNodeRect, this.getNodePadding(request.fNode, request.rect)) : null;
5777
+ this.concatRectWithParentPadding(childNodeRect, request.paddings) : null;
5765
5778
  };
5766
5779
  GetNormalizedChildrenNodesRectExecution.prototype.getChildrenNodes = function (fId) {
5767
5780
  return this.fMediator.send(new GetDeepChildrenNodesAndGroupsRequest(fId));
@@ -5769,9 +5782,6 @@
5769
5782
  GetNormalizedChildrenNodesRectExecution.prototype.normalizeRect = function (node) {
5770
5783
  return this.fMediator.send(new GetNormalizedNodeRectRequest(node));
5771
5784
  };
5772
- GetNormalizedChildrenNodesRectExecution.prototype.getNodePadding = function (node, rect) {
5773
- return this.fMediator.send(new GetNodePaddingRequest(node, rect));
5774
- };
5775
5785
  GetNormalizedChildrenNodesRectExecution.prototype.concatRectWithParentPadding = function (rect, padding) {
5776
5786
  return _2d.RectExtensions.initialize(rect.x - padding[0], rect.y - padding[1], rect.width + padding[0] + padding[2], rect.height + +padding[1] + padding[3]);
5777
5787
  };
@@ -5799,13 +5809,18 @@
5799
5809
  this.fMediator = fMediator;
5800
5810
  }
5801
5811
  GetNodeResizeRestrictionsExecution.prototype.handle = function (request) {
5802
- var childRect = this.fMediator.send(new GetNormalizedChildrenNodesRectRequest(request.fNode, request.rect));
5812
+ var fNodePaddings = this.getNodePaddings(request.fNode, request.rect);
5813
+ var childRect = this.fMediator.send(new GetNormalizedChildrenNodesRectRequest(request.fNode, fNodePaddings));
5803
5814
  var parentRect = this.fMediator.send(new GetNormalizedParentNodeRectRequest(request.fNode));
5804
5815
  return {
5805
5816
  parentRect: parentRect,
5806
5817
  childRect: childRect,
5818
+ minSize: _2d.SizeExtensions.initialize(fNodePaddings[0] + fNodePaddings[2], fNodePaddings[1] + fNodePaddings[3])
5807
5819
  };
5808
5820
  };
5821
+ GetNodeResizeRestrictionsExecution.prototype.getNodePaddings = function (node, rect) {
5822
+ return this.fMediator.send(new GetNodePaddingRequest(node, rect));
5823
+ };
5809
5824
  return GetNodeResizeRestrictionsExecution;
5810
5825
  }());
5811
5826
  exports.GetNodeResizeRestrictionsExecution.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: exports.GetNodeResizeRestrictionsExecution, deps: [{ token: i2__namespace.FMediator }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
@@ -5850,7 +5865,8 @@
5850
5865
  this.fMediator = fMediator;
5851
5866
  this.fNode = fNode;
5852
5867
  this.fResizeHandleType = fResizeHandleType;
5853
- this.childRestrictions = function () { };
5868
+ this.childRestrictions = function () {
5869
+ };
5854
5870
  }
5855
5871
  NodeResizeDragHandler.prototype.initialize = function () {
5856
5872
  var _this = this;
@@ -5863,14 +5879,14 @@
5863
5879
  }
5864
5880
  };
5865
5881
  NodeResizeDragHandler.prototype.move = function (difference) {
5866
- var changedRect = this.changePosition(difference, this.changeSize(difference));
5882
+ var changedRect = this.changePosition(difference, this.changeSize(difference, this.restrictions.minSize));
5867
5883
  this.childRestrictions(changedRect, this.restrictions.childRect);
5868
5884
  this.applyParentRestrictions(changedRect, this.restrictions.parentRect);
5869
5885
  this.fNode.updatePosition(changedRect);
5870
5886
  this.fNode.updateSize(changedRect);
5871
5887
  this.fNode.redraw();
5872
5888
  };
5873
- NodeResizeDragHandler.prototype.changeSize = function (difference) {
5889
+ NodeResizeDragHandler.prototype.changeSize = function (difference, minSize) {
5874
5890
  return this.fMediator.send(new CalculateChangedSizeRequest(this.originalRect, difference, this.fResizeHandleType));
5875
5891
  };
5876
5892
  NodeResizeDragHandler.prototype.changePosition = function (difference, changedRect) {