@processmaker/modeler 1.39.2 → 1.39.4
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/dist/modeler.common.js +115 -69
- package/dist/modeler.common.js.map +1 -1
- package/dist/modeler.umd.js +115 -69
- package/dist/modeler.umd.js.map +1 -1
- package/dist/modeler.umd.min.js +1 -1
- package/dist/modeler.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/mixins/linkConfig.js +22 -3
package/dist/modeler.common.js
CHANGED
|
@@ -27044,6 +27044,7 @@ function isPoint(item) {
|
|
|
27044
27044
|
sourceShape: null,
|
|
27045
27045
|
target: null,
|
|
27046
27046
|
listeningToMouseup: false,
|
|
27047
|
+
listeningToMouseleave: false,
|
|
27047
27048
|
vertices: null,
|
|
27048
27049
|
anchorPointFunction: getDefaultAnchorPoint
|
|
27049
27050
|
};
|
|
@@ -27175,10 +27176,11 @@ function isPoint(item) {
|
|
|
27175
27176
|
var targetShape = this.shape.getTargetElement();
|
|
27176
27177
|
resetShapeColor(targetShape);
|
|
27177
27178
|
this.shape.on('change:vertices', this.onChangeVertices);
|
|
27178
|
-
this.shape.on('change:source', this.
|
|
27179
|
-
this.shape.on('change:target', this.
|
|
27179
|
+
this.shape.on('change:source', this.onChangeTargets);
|
|
27180
|
+
this.shape.on('change:target', this.onChangeTargets);
|
|
27180
27181
|
this.shape.listenTo(this.sourceShape, 'change:position', this.updateWaypoints);
|
|
27181
27182
|
this.shape.listenTo(targetShape, 'change:position', this.updateWaypoints);
|
|
27183
|
+
this.shape.listenTo(this.paper, 'link:mouseleave', this.storeWaypoints);
|
|
27182
27184
|
var sourceShape = this.shape.getSourceElement();
|
|
27183
27185
|
sourceShape.embed(this.shape);
|
|
27184
27186
|
this.$emit('set-shape-stacking', sourceShape);
|
|
@@ -27191,46 +27193,90 @@ function isPoint(item) {
|
|
|
27191
27193
|
resolve();
|
|
27192
27194
|
});
|
|
27193
27195
|
},
|
|
27196
|
+
storeWaypoints: function storeWaypoints() {
|
|
27197
|
+
var _this4 = this;
|
|
27198
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
27199
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
27200
|
+
while (1) switch (_context.prev = _context.next) {
|
|
27201
|
+
case 0:
|
|
27202
|
+
if (!(_this4.highlighted && !_this4.listeningToMouseleave)) {
|
|
27203
|
+
_context.next = 6;
|
|
27204
|
+
break;
|
|
27205
|
+
}
|
|
27206
|
+
_this4.updateWaypoints();
|
|
27207
|
+
_context.next = 4;
|
|
27208
|
+
return _this4.$nextTick();
|
|
27209
|
+
case 4:
|
|
27210
|
+
_this4.listeningToMouseleave = true;
|
|
27211
|
+
_this4.$emit('save-state');
|
|
27212
|
+
case 6:
|
|
27213
|
+
case "end":
|
|
27214
|
+
return _context.stop();
|
|
27215
|
+
}
|
|
27216
|
+
}, _callee);
|
|
27217
|
+
}))();
|
|
27218
|
+
},
|
|
27194
27219
|
/**
|
|
27195
27220
|
* On Change vertices handler
|
|
27196
27221
|
* @param {Object} link
|
|
27197
27222
|
* @param {Array} vertices
|
|
27198
27223
|
* @param {Object} options
|
|
27199
27224
|
*/
|
|
27200
|
-
|
|
27201
|
-
var
|
|
27202
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
27203
|
-
return _regeneratorRuntime().wrap(function
|
|
27204
|
-
while (1) switch (
|
|
27225
|
+
onChangeTargets: function onChangeTargets(link, vertices, options) {
|
|
27226
|
+
var _this5 = this;
|
|
27227
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
27228
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
27229
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
27205
27230
|
case 0:
|
|
27206
27231
|
if (!(options && options.ui)) {
|
|
27207
|
-
|
|
27232
|
+
_context2.next = 7;
|
|
27208
27233
|
break;
|
|
27209
27234
|
}
|
|
27210
|
-
|
|
27211
|
-
return
|
|
27235
|
+
_context2.next = 3;
|
|
27236
|
+
return _this5.$nextTick();
|
|
27212
27237
|
case 3:
|
|
27213
|
-
|
|
27214
|
-
return
|
|
27238
|
+
_context2.next = 5;
|
|
27239
|
+
return _this5.waitForUpdateWaypoints();
|
|
27215
27240
|
case 5:
|
|
27216
|
-
|
|
27217
|
-
return
|
|
27241
|
+
_context2.next = 7;
|
|
27242
|
+
return _this5.storeWaypoints();
|
|
27218
27243
|
case 7:
|
|
27219
|
-
_this4.$emit('save-state');
|
|
27220
|
-
case 8:
|
|
27221
27244
|
case "end":
|
|
27222
|
-
return
|
|
27245
|
+
return _context2.stop();
|
|
27223
27246
|
}
|
|
27224
|
-
},
|
|
27247
|
+
}, _callee2);
|
|
27248
|
+
}))();
|
|
27249
|
+
},
|
|
27250
|
+
onChangeVertices: function onChangeVertices(link, vertices, options) {
|
|
27251
|
+
var _this6 = this;
|
|
27252
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
27253
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
27254
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
27255
|
+
case 0:
|
|
27256
|
+
if (!(options && options.ui)) {
|
|
27257
|
+
_context3.next = 6;
|
|
27258
|
+
break;
|
|
27259
|
+
}
|
|
27260
|
+
_this6.updateWaypoints();
|
|
27261
|
+
_context3.next = 4;
|
|
27262
|
+
return _this6.$nextTick();
|
|
27263
|
+
case 4:
|
|
27264
|
+
_this6.listeningToMouseleave = false;
|
|
27265
|
+
_this6.$emit('save-state');
|
|
27266
|
+
case 6:
|
|
27267
|
+
case "end":
|
|
27268
|
+
return _context3.stop();
|
|
27269
|
+
}
|
|
27270
|
+
}, _callee3);
|
|
27225
27271
|
}))();
|
|
27226
27272
|
},
|
|
27227
27273
|
updateWaypoints: function updateWaypoints() {
|
|
27228
|
-
var
|
|
27274
|
+
var _this7 = this;
|
|
27229
27275
|
var linkView = this.shape.findView(this.paper);
|
|
27230
27276
|
var start = linkView.sourceAnchor;
|
|
27231
27277
|
var end = linkView.targetAnchor;
|
|
27232
27278
|
this.node.diagram.waypoint = [start].concat(_toConsumableArray(this.shape.vertices()), [end]).map(function (point) {
|
|
27233
|
-
return
|
|
27279
|
+
return _this7.moddle.create('dc:Point', point);
|
|
27234
27280
|
});
|
|
27235
27281
|
if (!this.listeningToMouseup) {
|
|
27236
27282
|
this.listeningToMouseup = true;
|
|
@@ -27238,7 +27284,7 @@ function isPoint(item) {
|
|
|
27238
27284
|
}
|
|
27239
27285
|
},
|
|
27240
27286
|
updateLinkTarget: function updateLinkTarget(_ref) {
|
|
27241
|
-
var
|
|
27287
|
+
var _this8 = this;
|
|
27242
27288
|
var clientX = _ref.clientX,
|
|
27243
27289
|
clientY = _ref.clientY;
|
|
27244
27290
|
var localMousePosition = this.paper.clientToLocalPoint({
|
|
@@ -27267,19 +27313,19 @@ function isPoint(item) {
|
|
|
27267
27313
|
setShapeColor(this.target, validNodeColor);
|
|
27268
27314
|
this.paper.el.removeEventListener('mousemove', this.updateLinkTarget);
|
|
27269
27315
|
this.shape.listenToOnce(this.paper, 'cell:pointerclick', function () {
|
|
27270
|
-
|
|
27271
|
-
|
|
27272
|
-
|
|
27273
|
-
if (
|
|
27274
|
-
|
|
27316
|
+
_this8.completeLink();
|
|
27317
|
+
_this8.updateWaypoints();
|
|
27318
|
+
_this8.updateWaypoints.flush();
|
|
27319
|
+
if (_this8.updateDefinitionLinks) {
|
|
27320
|
+
_this8.updateDefinitionLinks();
|
|
27275
27321
|
}
|
|
27276
|
-
|
|
27322
|
+
_this8.$emit('save-state');
|
|
27277
27323
|
});
|
|
27278
27324
|
this.shape.listenToOnce(this.paper, 'cell:mouseleave', function () {
|
|
27279
|
-
|
|
27280
|
-
|
|
27281
|
-
resetShapeColor(
|
|
27282
|
-
|
|
27325
|
+
_this8.paper.el.addEventListener('mousemove', _this8.updateLinkTarget);
|
|
27326
|
+
_this8.shape.stopListening(_this8.paper, 'cell:pointerclick');
|
|
27327
|
+
resetShapeColor(_this8.target);
|
|
27328
|
+
_this8.$emit('set-cursor', 'not-allowed');
|
|
27283
27329
|
});
|
|
27284
27330
|
},
|
|
27285
27331
|
removeLink: function removeLink() {
|
|
@@ -27329,49 +27375,49 @@ function isPoint(item) {
|
|
|
27329
27375
|
this.emitSave.bind(this);
|
|
27330
27376
|
},
|
|
27331
27377
|
mounted: function mounted() {
|
|
27332
|
-
var
|
|
27333
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
27334
|
-
var targetRef, targetShape, sequenceFlowWaypoints, sourceAnchorPoint, targetAnchorPoint, _targetShape$position, targetX, targetY, targetAnchorOffset,
|
|
27335
|
-
return _regeneratorRuntime().wrap(function
|
|
27336
|
-
while (1) switch (
|
|
27378
|
+
var _this9 = this;
|
|
27379
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
27380
|
+
var targetRef, targetShape, sequenceFlowWaypoints, sourceAnchorPoint, targetAnchorPoint, _targetShape$position, targetX, targetY, targetAnchorOffset, _this9$sourceShape$po, sourceX, sourceY, sourceAnchorOffset, sequenceVertices;
|
|
27381
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
27382
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
27337
27383
|
case 0:
|
|
27338
|
-
|
|
27339
|
-
return
|
|
27384
|
+
_context4.next = 2;
|
|
27385
|
+
return _this9.$nextTick();
|
|
27340
27386
|
case 2:
|
|
27341
27387
|
/* Use nextTick to ensure this code runs after the component it is mixed into mounts.
|
|
27342
27388
|
* This will ensure this.shape is defined. */
|
|
27343
27389
|
|
|
27344
|
-
|
|
27345
|
-
|
|
27346
|
-
|
|
27347
|
-
|
|
27390
|
+
_this9.sourceShape = _this9.findSourceShape();
|
|
27391
|
+
_this9.setSource(_this9.sourceShape);
|
|
27392
|
+
_this9.$once('click', function () {
|
|
27393
|
+
_this9.$nextTick(function () {
|
|
27348
27394
|
if (store.getters.isReadOnly) {
|
|
27349
27395
|
return;
|
|
27350
27396
|
}
|
|
27351
|
-
|
|
27397
|
+
_this9.setupLinkTools();
|
|
27352
27398
|
});
|
|
27353
27399
|
});
|
|
27354
|
-
targetRef =
|
|
27400
|
+
targetRef = _this9.getTargetRef ? _this9.getTargetRef() : _this9.node.definition.get('targetRef'); // if flow doesn't have a targetRef such as incomplete node, return
|
|
27355
27401
|
if (targetRef) {
|
|
27356
|
-
|
|
27402
|
+
_context4.next = 8;
|
|
27357
27403
|
break;
|
|
27358
27404
|
}
|
|
27359
|
-
return
|
|
27405
|
+
return _context4.abrupt("return");
|
|
27360
27406
|
case 8:
|
|
27361
27407
|
if (targetRef.id) {
|
|
27362
|
-
targetShape =
|
|
27408
|
+
targetShape = _this9.graph.getElements().find(function (element) {
|
|
27363
27409
|
return element.component && element.component.node.definition === targetRef;
|
|
27364
27410
|
});
|
|
27365
|
-
|
|
27366
|
-
sequenceFlowWaypoints =
|
|
27367
|
-
sourceAnchorPoint =
|
|
27411
|
+
_this9.target = targetShape;
|
|
27412
|
+
sequenceFlowWaypoints = _this9.node.diagram.waypoint;
|
|
27413
|
+
sourceAnchorPoint = _this9.node.diagram.waypoint[0];
|
|
27368
27414
|
targetAnchorPoint = sequenceFlowWaypoints[sequenceFlowWaypoints.length - 1];
|
|
27369
27415
|
_targetShape$position = targetShape.position(), targetX = _targetShape$position.x, targetY = _targetShape$position.y;
|
|
27370
27416
|
targetAnchorOffset = {
|
|
27371
27417
|
x: targetAnchorPoint.x - targetX,
|
|
27372
27418
|
y: targetAnchorPoint.y - targetY
|
|
27373
27419
|
};
|
|
27374
|
-
|
|
27420
|
+
_this9$sourceShape$po = _this9.sourceShape.position(), sourceX = _this9$sourceShape$po.x, sourceY = _this9$sourceShape$po.y;
|
|
27375
27421
|
sourceAnchorOffset = {
|
|
27376
27422
|
x: sourceAnchorPoint.x - sourceX,
|
|
27377
27423
|
y: sourceAnchorPoint.y - sourceY
|
|
@@ -27385,38 +27431,38 @@ function isPoint(item) {
|
|
|
27385
27431
|
y: y
|
|
27386
27432
|
};
|
|
27387
27433
|
});
|
|
27388
|
-
|
|
27434
|
+
_this9.shape.vertices(sequenceVertices);
|
|
27389
27435
|
}
|
|
27390
|
-
|
|
27391
|
-
|
|
27392
|
-
|
|
27436
|
+
_this9.setSource(_this9.sourceShape, sourceAnchorOffset);
|
|
27437
|
+
_this9.setTarget(targetShape, targetAnchorOffset);
|
|
27438
|
+
_this9.completeLink();
|
|
27393
27439
|
} else {
|
|
27394
|
-
|
|
27395
|
-
|
|
27396
|
-
|
|
27397
|
-
|
|
27398
|
-
if (
|
|
27399
|
-
|
|
27440
|
+
_this9.setTarget(targetRef);
|
|
27441
|
+
_this9.paper.setInteractivity(false);
|
|
27442
|
+
_this9.paper.el.addEventListener('mousemove', _this9.updateLinkTarget);
|
|
27443
|
+
_this9.$emit('set-cursor', 'not-allowed');
|
|
27444
|
+
if (_this9.isValidConnection) {
|
|
27445
|
+
_this9.shape.stopListening(_this9.paper, 'blank:pointerdown link:pointerdown element:pointerdown', _this9.removeLink);
|
|
27400
27446
|
} else {
|
|
27401
|
-
|
|
27447
|
+
_this9.shape.listenToOnce(_this9.paper, 'blank:pointerdown link:pointerdown element:pointerdown', _this9.removeLink);
|
|
27402
27448
|
}
|
|
27403
27449
|
}
|
|
27404
|
-
|
|
27405
|
-
|
|
27450
|
+
_this9.updateRouter();
|
|
27451
|
+
_this9.shape.on('change:vertices', function () {
|
|
27406
27452
|
this.component.$emit('shape-resize');
|
|
27407
27453
|
});
|
|
27408
27454
|
if (store.getters.isReadOnly) {
|
|
27409
|
-
|
|
27410
|
-
|
|
27411
|
-
|
|
27455
|
+
_this9.$nextTick(function () {
|
|
27456
|
+
_this9.paperManager.awaitScheduledUpdates().then(function () {
|
|
27457
|
+
_this9.setShapeHighlight();
|
|
27412
27458
|
});
|
|
27413
27459
|
});
|
|
27414
27460
|
}
|
|
27415
27461
|
case 12:
|
|
27416
27462
|
case "end":
|
|
27417
|
-
return
|
|
27463
|
+
return _context4.stop();
|
|
27418
27464
|
}
|
|
27419
|
-
},
|
|
27465
|
+
}, _callee4);
|
|
27420
27466
|
}))();
|
|
27421
27467
|
},
|
|
27422
27468
|
beforeDestroy: function beforeDestroy() {
|