@logicflow/core 1.1.24 → 1.1.25

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.
@@ -27127,9 +27127,15 @@ var GraphModel_GraphModel = (GraphModel_class = /*#__PURE__*/function () {
27127
27127
  }
27128
27128
 
27129
27129
  var nodeModel = node.model;
27130
- var r = nodeModel.move(deltaX, deltaY, isignoreRule); // 2) 移动边
27131
27130
 
27132
- r && this.moveEdge(nodeId, deltaX, deltaY);
27131
+ var _nodeModel$getMoveDis = nodeModel.getMoveDistance(deltaX, deltaY, isignoreRule);
27132
+
27133
+ var _nodeModel$getMoveDis2 = GraphModel_slicedToArray(_nodeModel$getMoveDis, 2);
27134
+
27135
+ deltaX = _nodeModel$getMoveDis2[0];
27136
+ deltaY = _nodeModel$getMoveDis2[1];
27137
+ // 2) 移动边
27138
+ this.moveEdge(nodeId, deltaX, deltaY);
27133
27139
  }
27134
27140
  /**
27135
27141
  * 移动节点-绝对位置
@@ -30629,6 +30635,46 @@ var BaseNodeModel_BaseNodeModel = (BaseNodeModel_class = /*#__PURE__*/function (
30629
30635
 
30630
30636
  return isAllowMoveX || isAllowMoveY;
30631
30637
  }
30638
+ }, {
30639
+ key: "getMoveDistance",
30640
+ value: function getMoveDistance(deltaX, deltaY) {
30641
+ var isIgnoreRule = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
30642
+ var isAllowMoveX = false;
30643
+ var isAllowMoveY = false;
30644
+ var moveX = 0;
30645
+ var moveY = 0;
30646
+
30647
+ if (isIgnoreRule) {
30648
+ isAllowMoveX = true;
30649
+ isAllowMoveY = true;
30650
+ } else {
30651
+ var r = this.isAllowMoveNode(deltaX, deltaY);
30652
+
30653
+ if (typeof r === 'boolean') {
30654
+ isAllowMoveX = r;
30655
+ isAllowMoveY = r;
30656
+ } else {
30657
+ isAllowMoveX = r.x;
30658
+ isAllowMoveY = r.y;
30659
+ }
30660
+ }
30661
+
30662
+ if (isAllowMoveX && deltaX) {
30663
+ var targetX = this.x + deltaX;
30664
+ this.x = targetX;
30665
+ this.text && this.moveText(deltaX, 0);
30666
+ moveX = deltaX;
30667
+ }
30668
+
30669
+ if (isAllowMoveY && deltaY) {
30670
+ var targetY = this.y + deltaY;
30671
+ this.y = targetY;
30672
+ this.text && this.moveText(0, deltaY);
30673
+ moveY = deltaY;
30674
+ }
30675
+
30676
+ return [moveX, moveY];
30677
+ }
30632
30678
  }, {
30633
30679
  key: "moveTo",
30634
30680
  value: function moveTo(x, y) {
@@ -30866,7 +30912,7 @@ var BaseNodeModel_BaseNodeModel = (BaseNodeModel_class = /*#__PURE__*/function (
30866
30912
  initializer: function initializer() {
30867
30913
  return {};
30868
30914
  }
30869
- }), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "incoming", [mobx_module["m" /* computed */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "incoming"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "outgoing", [mobx_module["m" /* computed */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "outgoing"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "addNodeMoveRules", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "addNodeMoveRules"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "move", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "move"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "moveTo", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "moveTo"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "moveText", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "moveText"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "updateText", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "updateText"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setSelected", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setSelected"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setHovered", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setHovered"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setHitable", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setHitable"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setElementState", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setElementState"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setProperty", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setProperty"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setProperties", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setProperties"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setStyle", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setStyle"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setStyles", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setStyles"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "updateStyles", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "updateStyles"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setZIndex", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setZIndex"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "updateAttributes", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "updateAttributes"), BaseNodeModel_class.prototype)), BaseNodeModel_class);
30915
+ }), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "incoming", [mobx_module["m" /* computed */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "incoming"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "outgoing", [mobx_module["m" /* computed */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "outgoing"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "addNodeMoveRules", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "addNodeMoveRules"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "move", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "move"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "getMoveDistance", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "getMoveDistance"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "moveTo", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "moveTo"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "moveText", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "moveText"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "updateText", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "updateText"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setSelected", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setSelected"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setHovered", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setHovered"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setHitable", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setHitable"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setElementState", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setElementState"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setProperty", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setProperty"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setProperties", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setProperties"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setStyle", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setStyle"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setStyles", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setStyles"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "updateStyles", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "updateStyles"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "setZIndex", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "setZIndex"), BaseNodeModel_class.prototype), BaseNodeModel_applyDecoratedDescriptor(BaseNodeModel_class.prototype, "updateAttributes", [mobx_module["k" /* action */]], Object.getOwnPropertyDescriptor(BaseNodeModel_class.prototype, "updateAttributes"), BaseNodeModel_class.prototype)), BaseNodeModel_class);
30870
30916
 
30871
30917
  // CONCATENATED MODULE: ./src/model/node/CircleNodeModel.ts
30872
30918
  function CircleNodeModel_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { CircleNodeModel_typeof = function _typeof(obj) { return typeof obj; }; } else { CircleNodeModel_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return CircleNodeModel_typeof(obj); }