@processmaker/modeler 1.30.0 → 1.30.2
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 +171 -203
- package/dist/modeler.common.js.map +1 -1
- package/dist/modeler.umd.js +171 -203
- package/dist/modeler.umd.js.map +1 -1
- package/dist/modeler.umd.min.js +2 -2
- package/dist/modeler.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/crown/crownButtons/associationFlowButton.vue +14 -1
- package/src/components/crown/crownConfig/crownConfig.vue +2 -0
- package/src/components/modeler/Modeler.vue +1 -0
- package/src/components/modeler/Selection.vue +4 -40
- package/src/components/nodes/boundaryEvent/boundaryEvent.vue +1 -0
- package/src/mixins/linkConfig.js +3 -12
package/package.json
CHANGED
package/src/.DS_Store
CHANGED
|
Binary file
|
|
@@ -20,6 +20,8 @@ import connectIcon from '@/assets/connect-artifacts.svg';
|
|
|
20
20
|
import CrownButton from '@/components/crown/crownButtons/crownButton';
|
|
21
21
|
import { direction } from '@/components/nodes/association/associationConfig';
|
|
22
22
|
import Node from '@/components/nodes/node';
|
|
23
|
+
import store from '@/store';
|
|
24
|
+
import { V } from 'jointjs';
|
|
23
25
|
|
|
24
26
|
export default {
|
|
25
27
|
components: { CrownButton },
|
|
@@ -29,12 +31,23 @@ export default {
|
|
|
29
31
|
connectIcon,
|
|
30
32
|
};
|
|
31
33
|
},
|
|
34
|
+
computed: {
|
|
35
|
+
paper: () => store.getters.paper,
|
|
36
|
+
},
|
|
32
37
|
methods: {
|
|
33
38
|
addAssociation(cellView, evt, x, y) {
|
|
34
39
|
this.$emit('toggle-crown-state', false);
|
|
40
|
+
const { clientX, clientY } = cellView;
|
|
41
|
+
let point = null;
|
|
42
|
+
if (cellView){
|
|
43
|
+
point = V(this.paper.viewport).toLocalPoint(clientX, clientY);
|
|
44
|
+
}
|
|
35
45
|
const associationLink = this.moddle.create('bpmn:Association', {
|
|
36
46
|
sourceRef: this.shape.component.node.definition,
|
|
37
|
-
targetRef: {
|
|
47
|
+
targetRef: {
|
|
48
|
+
x: x ? x : point.x,
|
|
49
|
+
y: y ? y : point.y,
|
|
50
|
+
},
|
|
38
51
|
associationDirection: direction.none,
|
|
39
52
|
});
|
|
40
53
|
|
|
@@ -1190,6 +1190,7 @@ export default {
|
|
|
1190
1190
|
if (!this.isDragging && this.dragStart) {
|
|
1191
1191
|
// is clicked over the shape
|
|
1192
1192
|
if (cellView) {
|
|
1193
|
+
this.$refs.selector.stopDrag(event);
|
|
1193
1194
|
this.$refs.selector.selectElement(cellView, event.shiftKey);
|
|
1194
1195
|
} else {
|
|
1195
1196
|
this.clearSelection();
|
|
@@ -53,7 +53,6 @@ export default {
|
|
|
53
53
|
isSelecting: false,
|
|
54
54
|
isSelected: false,
|
|
55
55
|
selected: [],
|
|
56
|
-
conectedLinks:[],
|
|
57
56
|
dragging: false,
|
|
58
57
|
style: {
|
|
59
58
|
left: '0px',
|
|
@@ -97,7 +96,6 @@ export default {
|
|
|
97
96
|
watch: {
|
|
98
97
|
// whenever selected changes
|
|
99
98
|
selected(newSelected) {
|
|
100
|
-
this.prepareConectedLinks(newSelected);
|
|
101
99
|
this.addToHighlightedNodes(newSelected);
|
|
102
100
|
},
|
|
103
101
|
},
|
|
@@ -296,24 +294,6 @@ export default {
|
|
|
296
294
|
});
|
|
297
295
|
return elements;
|
|
298
296
|
},
|
|
299
|
-
/**
|
|
300
|
-
* Prepare the conectedLinks collection
|
|
301
|
-
* @param {Array} shapes
|
|
302
|
-
*/
|
|
303
|
-
prepareConectedLinks(shapes){
|
|
304
|
-
const { paper } = this.paperManager;
|
|
305
|
-
this.conectedLinks = [];
|
|
306
|
-
shapes.forEach((shape) => {
|
|
307
|
-
const conectedLinks = this.graph.getConnectedLinks(shape.model);
|
|
308
|
-
conectedLinks.forEach((link) => {
|
|
309
|
-
const linkView = paper.findViewByModel(link);
|
|
310
|
-
if (!this.conectedLinks.some(obj => obj.id === linkView.id)) {
|
|
311
|
-
this.conectedLinks.push(linkView);
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
});
|
|
316
|
-
},
|
|
317
297
|
/**
|
|
318
298
|
* Return the bounding box of the selected elements,
|
|
319
299
|
* @param {Array} selected
|
|
@@ -387,7 +367,7 @@ export default {
|
|
|
387
367
|
// remove from selection the selected flows that belongs to a selected pools
|
|
388
368
|
if (shape.model.component && flowTypes.includes(shape.model.component.node.type)) {
|
|
389
369
|
const parent = shape.model.getParentCell();
|
|
390
|
-
if (parent.component && parent.component.node.pool) {
|
|
370
|
+
if (parent && parent.component && parent.component.node.pool) {
|
|
391
371
|
return !selectedPoolsIds.includes(parent.component.node.pool.component.node.id);
|
|
392
372
|
}
|
|
393
373
|
}
|
|
@@ -495,27 +475,13 @@ export default {
|
|
|
495
475
|
* @param {Object} event
|
|
496
476
|
*/
|
|
497
477
|
stopDrag() {
|
|
478
|
+
this.overPoolStopDrag();
|
|
479
|
+
this.$emit('save-state');
|
|
498
480
|
this.dragging = false;
|
|
499
481
|
this.stopForceMove = false;
|
|
500
482
|
// Readjusts the selection box, taking into consideration elements
|
|
501
483
|
// that are anchored and did not move, such as boundary events.
|
|
502
484
|
this.updateSelectionBox();
|
|
503
|
-
this.updateFlowsWaypoint();
|
|
504
|
-
this.overPoolStopDrag();
|
|
505
|
-
},
|
|
506
|
-
/**
|
|
507
|
-
* Selector will update the waypoints of the related flows
|
|
508
|
-
*/
|
|
509
|
-
updateFlowsWaypoint(){
|
|
510
|
-
this.conectedLinks.forEach((link)=> {
|
|
511
|
-
if (link.model.component && link.model.get('type') === 'standard.Link'){
|
|
512
|
-
const start = link.sourceAnchor;
|
|
513
|
-
const end = link.targetAnchor;
|
|
514
|
-
link.model.component.node.diagram.waypoint = [start,
|
|
515
|
-
...link.model.component.shape.vertices(),
|
|
516
|
-
end].map(point => link.model.component.moddle.create('dc:Point', point));
|
|
517
|
-
}
|
|
518
|
-
});
|
|
519
485
|
},
|
|
520
486
|
/**
|
|
521
487
|
* Translate the Selected shapes adding some custom validations
|
|
@@ -666,14 +632,12 @@ export default {
|
|
|
666
632
|
*/
|
|
667
633
|
overPoolStopDrag(){
|
|
668
634
|
if (this.isNotPoolChilds(this.selected)) {
|
|
669
|
-
this.$emit('save-state');
|
|
670
635
|
return;
|
|
671
636
|
}
|
|
672
637
|
if (this.isOutOfThePool) {
|
|
673
638
|
this.rollbackSelection();
|
|
674
639
|
} else {
|
|
675
640
|
this.expandToFitElement(this.selected);
|
|
676
|
-
this.$emit('save-state');
|
|
677
641
|
}
|
|
678
642
|
},
|
|
679
643
|
/**
|
|
@@ -695,7 +659,6 @@ export default {
|
|
|
695
659
|
shape.model.translate(deltaX/scale.sx, deltaY/scale.sy);
|
|
696
660
|
});
|
|
697
661
|
this.isOutOfThePool = false;
|
|
698
|
-
this.updateFlowsWaypoint();
|
|
699
662
|
await store.commit('allowSavingElementPosition');
|
|
700
663
|
this.paperManager.setStateValid();
|
|
701
664
|
await this.$nextTick();
|
|
@@ -771,6 +734,7 @@ export default {
|
|
|
771
734
|
node: pool.component.node,
|
|
772
735
|
bounds: pool.getBBox(),
|
|
773
736
|
});
|
|
737
|
+
this.$emit('save-state');
|
|
774
738
|
}
|
|
775
739
|
}
|
|
776
740
|
},
|
package/src/mixins/linkConfig.js
CHANGED
|
@@ -118,23 +118,14 @@ export default {
|
|
|
118
118
|
const targetShape = this.shape.getTargetElement();
|
|
119
119
|
resetShapeColor(targetShape);
|
|
120
120
|
|
|
121
|
-
this.shape.
|
|
121
|
+
this.shape.listenTo(this.sourceShape, 'change:position', this.updateWaypoints);
|
|
122
|
+
this.shape.listenTo(targetShape, 'change:position', this.updateWaypoints);
|
|
123
|
+
this.shape.on('change:vertices change:source change:target', this.updateWaypoints);
|
|
122
124
|
|
|
123
125
|
const sourceShape = this.shape.getSourceElement();
|
|
124
126
|
sourceShape.embed(this.shape);
|
|
125
127
|
this.$emit('set-shape-stacking', sourceShape);
|
|
126
128
|
},
|
|
127
|
-
/**
|
|
128
|
-
* On Change vertices handler
|
|
129
|
-
* @param {Object} link
|
|
130
|
-
* @param {Array} vertices
|
|
131
|
-
* @param {Object} options
|
|
132
|
-
*/
|
|
133
|
-
onChangeVertices(link, vertices, options){
|
|
134
|
-
if (options && options.ui) {
|
|
135
|
-
this.updateWaypoints();
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
129
|
updateWaypoints() {
|
|
139
130
|
const linkView = this.shape.findView(this.paper);
|
|
140
131
|
const start = linkView.sourceAnchor;
|