@foblex/flow 16.0.0 → 16.0.1

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 (23) hide show
  1. package/esm2022/f-draggable/connections/create-connection/create-connection.drag-handler.mjs +7 -2
  2. package/esm2022/f-draggable/connections/get-input-under-pointer/get-input-under-pointer.execution.mjs +1 -1
  3. package/esm2022/f-draggable/connections/reassign-connection/reassign-connection.drag-handler.mjs +11 -3
  4. package/esm2022/f-draggable/node-resize/apply-child-resize-restrictions/apply-child-resize-restrictions.request.mjs +1 -1
  5. package/esm2022/f-draggable/node-resize/calculate-changed-size/calculate-changed-size.execution.mjs +1 -1
  6. package/esm2022/f-draggable/node-resize/get-node-resize-restrictions/get-node-resize-restrictions.execution.mjs +9 -3
  7. package/esm2022/f-draggable/node-resize/get-node-resize-restrictions/i-node-resize-restrictions.mjs +1 -1
  8. package/esm2022/f-draggable/node-resize/get-normalized-children-nodes-rect/get-normalized-children-nodes-rect.execution.mjs +3 -6
  9. package/esm2022/f-draggable/node-resize/get-normalized-children-nodes-rect/get-normalized-children-nodes-rect.request.mjs +3 -3
  10. package/esm2022/f-draggable/node-resize/node-resize.drag-handler.mjs +5 -4
  11. package/esm2022/f-flow/f-flow.component.mjs +1 -1
  12. package/f-draggable/connections/providers.d.ts +1 -1
  13. package/f-draggable/node/create-move-nodes-drag-model-from-selection/providers.d.ts +1 -1
  14. package/f-draggable/node/providers.d.ts +1 -1
  15. package/f-draggable/node-resize/get-node-resize-restrictions/get-node-resize-restrictions.execution.d.ts +1 -0
  16. package/f-draggable/node-resize/get-node-resize-restrictions/i-node-resize-restrictions.d.ts +2 -1
  17. package/f-draggable/node-resize/get-normalized-children-nodes-rect/get-normalized-children-nodes-rect.execution.d.ts +0 -1
  18. package/f-draggable/node-resize/get-normalized-children-nodes-rect/get-normalized-children-nodes-rect.request.d.ts +2 -3
  19. package/f-draggable/node-resize/providers.d.ts +1 -1
  20. package/f-draggable/providers.d.ts +1 -1
  21. package/fesm2022/foblex-flow.mjs +29 -13
  22. package/fesm2022/foblex-flow.mjs.map +1 -1
  23. package/package.json +1 -1
@@ -1952,7 +1952,9 @@ class CreateConnectionDragHandler {
1952
1952
  }
1953
1953
  move(difference) {
1954
1954
  this.drawTempConnection(this.toConnectorRect.addPoint(difference));
1955
- this.drawSnapConnection(this.getClosetInput(difference));
1955
+ if (this.fSnapConnection) {
1956
+ this.drawSnapConnection(this.getClosetInput(difference));
1957
+ }
1956
1958
  }
1957
1959
  drawTempConnection(fInputRect) {
1958
1960
  const line = this.fMediator.send(new GetConnectionLineRequest(this.fOutputWithRect.fRect, fInputRect, this.fConnection.fBehavior, this.fOutputWithRect.fConnector.fConnectableSide, EFConnectableSide.TOP));
@@ -1971,6 +1973,9 @@ class CreateConnectionDragHandler {
1971
1973
  }
1972
1974
  }
1973
1975
  getClosetInput(difference) {
1976
+ if (!this.fSnapConnection) {
1977
+ return undefined;
1978
+ }
1974
1979
  return this.fMediator.send(new FindClosestInputUsingSnapThresholdRequest(Point.fromPoint(this.toConnectorRect).add(difference), this.canBeConnectedInputs, this.fSnapConnection.fSnapThreshold));
1975
1980
  }
1976
1981
  complete() {
@@ -2291,8 +2296,13 @@ class ReassignConnectionDragHandler {
2291
2296
  return this.fComponentsStore.fInputs.find((x) => x.id === this.fConnection.fInputId);
2292
2297
  }
2293
2298
  move(difference) {
2294
- this.drawConnection({ fRect: this.toConnectorRect.addPoint(difference), fConnector: this.fInputWithRect.fConnector });
2295
- this.drawSnapConnection(this.getClosetInput(difference));
2299
+ this.drawConnection({
2300
+ fRect: this.toConnectorRect.addPoint(difference),
2301
+ fConnector: this.fInputWithRect.fConnector
2302
+ });
2303
+ if (this.fSnapConnection) {
2304
+ this.drawSnapConnection(this.getClosetInput(difference));
2305
+ }
2296
2306
  }
2297
2307
  drawConnection(fInputWithRect) {
2298
2308
  const line = this.fMediator.send(new GetConnectionLineRequest(this.fOutputWithRect.fRect, fInputWithRect.fRect, this.fConnection.fBehavior, this.fOutputWithRect.fConnector.fConnectableSide, fInputWithRect.fConnector.fConnectableSide));
@@ -2311,6 +2321,9 @@ class ReassignConnectionDragHandler {
2311
2321
  }
2312
2322
  }
2313
2323
  getClosetInput(difference) {
2324
+ if (!this.fSnapConnection) {
2325
+ return undefined;
2326
+ }
2314
2327
  return this.fMediator.send(new FindClosestInputUsingSnapThresholdRequest(Point.fromPoint(this.toConnectorRect).add(difference), this.canBeConnectedInputs, this.fSnapConnection.fSnapThreshold));
2315
2328
  }
2316
2329
  complete() {
@@ -4509,9 +4522,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
4509
4522
  }] });
4510
4523
 
4511
4524
  class GetNormalizedChildrenNodesRectRequest {
4512
- constructor(fNode, rect) {
4525
+ constructor(fNode, paddings) {
4513
4526
  this.fNode = fNode;
4514
- this.rect = rect;
4527
+ this.paddings = paddings;
4515
4528
  }
4516
4529
  }
4517
4530
 
@@ -4522,7 +4535,7 @@ let GetNormalizedChildrenNodesRectExecution = class GetNormalizedChildrenNodesRe
4522
4535
  handle(request) {
4523
4536
  const childNodeRect = RectExtensions.union(this.getChildrenNodes(request.fNode.fId).map((x) => this.normalizeRect(x)));
4524
4537
  return childNodeRect ?
4525
- this.concatRectWithParentPadding(childNodeRect, this.getNodePadding(request.fNode, request.rect)) : null;
4538
+ this.concatRectWithParentPadding(childNodeRect, request.paddings) : null;
4526
4539
  }
4527
4540
  getChildrenNodes(fId) {
4528
4541
  return this.fMediator.send(new GetDeepChildrenNodesAndGroupsRequest(fId));
@@ -4530,9 +4543,6 @@ let GetNormalizedChildrenNodesRectExecution = class GetNormalizedChildrenNodesRe
4530
4543
  normalizeRect(node) {
4531
4544
  return this.fMediator.send(new GetNormalizedNodeRectRequest(node));
4532
4545
  }
4533
- getNodePadding(node, rect) {
4534
- return this.fMediator.send(new GetNodePaddingRequest(node, rect));
4535
- }
4536
4546
  concatRectWithParentPadding(rect, padding) {
4537
4547
  return RectExtensions.initialize(rect.x - padding[0], rect.y - padding[1], rect.width + padding[0] + padding[2], rect.height + +padding[1] + padding[3]);
4538
4548
  }
@@ -4558,13 +4568,18 @@ let GetNodeResizeRestrictionsExecution = class GetNodeResizeRestrictionsExecutio
4558
4568
  this.fMediator = fMediator;
4559
4569
  }
4560
4570
  handle(request) {
4561
- const childRect = this.fMediator.send(new GetNormalizedChildrenNodesRectRequest(request.fNode, request.rect));
4571
+ const fNodePaddings = this.getNodePaddings(request.fNode, request.rect);
4572
+ const childRect = this.fMediator.send(new GetNormalizedChildrenNodesRectRequest(request.fNode, fNodePaddings));
4562
4573
  const parentRect = this.fMediator.send(new GetNormalizedParentNodeRectRequest(request.fNode));
4563
4574
  return {
4564
4575
  parentRect,
4565
4576
  childRect,
4577
+ minSize: SizeExtensions.initialize(fNodePaddings[0] + fNodePaddings[2], fNodePaddings[1] + fNodePaddings[3])
4566
4578
  };
4567
4579
  }
4580
+ getNodePaddings(node, rect) {
4581
+ return this.fMediator.send(new GetNodePaddingRequest(node, rect));
4582
+ }
4568
4583
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GetNodeResizeRestrictionsExecution, deps: [{ token: i2.FMediator }], target: i0.ɵɵFactoryTarget.Injectable }); }
4569
4584
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GetNodeResizeRestrictionsExecution }); }
4570
4585
  };
@@ -4605,7 +4620,8 @@ class NodeResizeDragHandler {
4605
4620
  this.fMediator = fMediator;
4606
4621
  this.fNode = fNode;
4607
4622
  this.fResizeHandleType = fResizeHandleType;
4608
- this.childRestrictions = () => { };
4623
+ this.childRestrictions = () => {
4624
+ };
4609
4625
  }
4610
4626
  initialize() {
4611
4627
  this.originalRect = this.fMediator.send(new GetNormalizedNodeRectRequest(this.fNode));
@@ -4617,14 +4633,14 @@ class NodeResizeDragHandler {
4617
4633
  }
4618
4634
  }
4619
4635
  move(difference) {
4620
- const changedRect = this.changePosition(difference, this.changeSize(difference));
4636
+ const changedRect = this.changePosition(difference, this.changeSize(difference, this.restrictions.minSize));
4621
4637
  this.childRestrictions(changedRect, this.restrictions.childRect);
4622
4638
  this.applyParentRestrictions(changedRect, this.restrictions.parentRect);
4623
4639
  this.fNode.updatePosition(changedRect);
4624
4640
  this.fNode.updateSize(changedRect);
4625
4641
  this.fNode.redraw();
4626
4642
  }
4627
- changeSize(difference) {
4643
+ changeSize(difference, minSize) {
4628
4644
  return this.fMediator.send(new CalculateChangedSizeRequest(this.originalRect, difference, this.fResizeHandleType));
4629
4645
  }
4630
4646
  changePosition(difference, changedRect) {