@logicflow/extension 1.2.9 → 1.2.11
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/CHANGELOG.md +1727 -0
- package/cjs/NodeResize/Control/Control.js +35 -49
- package/cjs/bpmn/getBpmnId.js +25 -2
- package/cjs/bpmn-elements/index.js +102 -0
- package/cjs/bpmn-elements/presets/Event/EndEventFactory.js +134 -0
- package/cjs/bpmn-elements/presets/Event/IntermediateCatchEvent.js +118 -0
- package/cjs/bpmn-elements/presets/Event/IntermediateThrowEvent.js +119 -0
- package/cjs/bpmn-elements/presets/Event/StartEventFactory.js +133 -0
- package/cjs/bpmn-elements/presets/Event/boundaryEventFactory.js +125 -0
- package/cjs/bpmn-elements/presets/Event/index.js +16 -0
- package/cjs/bpmn-elements/presets/Flow/index.js +9 -0
- package/cjs/bpmn-elements/presets/Flow/sequenceFlow.js +78 -0
- package/cjs/bpmn-elements/presets/Gateway/gateway.js +109 -0
- package/cjs/bpmn-elements/presets/Gateway/index.js +14 -0
- package/cjs/bpmn-elements/presets/Task/index.js +134 -0
- package/cjs/bpmn-elements/presets/Task/subProcess.js +190 -0
- package/cjs/bpmn-elements/presets/Task/task.js +190 -0
- package/cjs/bpmn-elements/presets/icons.js +116 -0
- package/cjs/bpmn-elements/utils.js +45 -0
- package/cjs/bpmn-elements-adapter/constant.js +69 -0
- package/cjs/bpmn-elements-adapter/index.js +1066 -0
- package/cjs/bpmn-elements-adapter/json2xml.js +91 -0
- package/cjs/bpmn-elements-adapter/xml2json.js +554 -0
- package/cjs/components/control/index.js +1 -1
- package/cjs/components/menu/index.js +76 -7
- package/cjs/index.js +3 -1
- package/cjs/materials/group/index.js +16 -7
- package/cjs/tools/snapshot/index.js +14 -0
- package/es/NodeResize/Control/Control.d.ts +1 -0
- package/es/NodeResize/Control/Control.js +36 -50
- package/es/bpmn/getBpmnId.js +25 -2
- package/es/bpmn-elements/index.d.ts +16 -0
- package/es/bpmn-elements/index.js +88 -0
- package/es/bpmn-elements/presets/Event/EndEventFactory.d.ts +5 -0
- package/es/bpmn-elements/presets/Event/EndEventFactory.js +130 -0
- package/es/bpmn-elements/presets/Event/IntermediateCatchEvent.d.ts +5 -0
- package/es/bpmn-elements/presets/Event/IntermediateCatchEvent.js +114 -0
- package/es/bpmn-elements/presets/Event/IntermediateThrowEvent.d.ts +5 -0
- package/es/bpmn-elements/presets/Event/IntermediateThrowEvent.js +115 -0
- package/es/bpmn-elements/presets/Event/StartEventFactory.d.ts +5 -0
- package/es/bpmn-elements/presets/Event/StartEventFactory.js +129 -0
- package/es/bpmn-elements/presets/Event/boundaryEventFactory.d.ts +5 -0
- package/es/bpmn-elements/presets/Event/boundaryEventFactory.js +121 -0
- package/es/bpmn-elements/presets/Event/index.d.ts +2 -0
- package/es/bpmn-elements/presets/Event/index.js +12 -0
- package/es/bpmn-elements/presets/Flow/index.d.ts +7 -0
- package/es/bpmn-elements/presets/Flow/index.js +5 -0
- package/es/bpmn-elements/presets/Flow/sequenceFlow.d.ts +5 -0
- package/es/bpmn-elements/presets/Flow/sequenceFlow.js +74 -0
- package/es/bpmn-elements/presets/Gateway/gateway.d.ts +17 -0
- package/es/bpmn-elements/presets/Gateway/gateway.js +105 -0
- package/es/bpmn-elements/presets/Gateway/index.d.ts +2 -0
- package/es/bpmn-elements/presets/Gateway/index.js +10 -0
- package/es/bpmn-elements/presets/Task/index.d.ts +2 -0
- package/es/bpmn-elements/presets/Task/index.js +130 -0
- package/es/bpmn-elements/presets/Task/subProcess.d.ts +5 -0
- package/es/bpmn-elements/presets/Task/subProcess.js +186 -0
- package/es/bpmn-elements/presets/Task/task.d.ts +12 -0
- package/es/bpmn-elements/presets/Task/task.js +186 -0
- package/es/bpmn-elements/presets/icons.d.ts +25 -0
- package/es/bpmn-elements/presets/icons.js +113 -0
- package/es/bpmn-elements/utils.d.ts +2 -0
- package/es/bpmn-elements/utils.js +40 -0
- package/{types/bpmn → es/bpmn-elements-adapter}/constant.d.ts +20 -0
- package/es/bpmn-elements-adapter/constant.js +66 -0
- package/es/bpmn-elements-adapter/index.d.ts +103 -0
- package/es/bpmn-elements-adapter/index.js +1060 -0
- package/es/bpmn-elements-adapter/json2xml.d.ts +3 -0
- package/es/bpmn-elements-adapter/json2xml.js +87 -0
- package/es/bpmn-elements-adapter/xml2json.js +551 -0
- package/es/components/control/index.js +1 -1
- package/es/components/menu/index.js +76 -7
- package/es/index.d.ts +3 -1
- package/es/index.js +3 -1
- package/es/materials/group/index.js +16 -7
- package/es/tools/snapshot/index.js +14 -0
- package/lib/AutoLayout.js +1 -1
- package/lib/BpmnAdapter.js +1 -1
- package/lib/BpmnElement.js +1 -1
- package/lib/ContextMenu.js +1 -1
- package/lib/Control.js +1 -1
- package/lib/CurvedEdge.js +1 -1
- package/lib/DndPanel.js +1 -1
- package/lib/FlowPath.js +1 -1
- package/lib/Group.js +1 -1
- package/lib/Highlight.js +1 -1
- package/lib/InsertNodeInPolyline.js +1 -1
- package/lib/Menu.js +1 -1
- package/lib/MiniMap.js +1 -1
- package/lib/NodeResize.js +1 -1
- package/lib/RectLabelNode.js +1 -1
- package/lib/SelectionSelect.js +1 -1
- package/lib/Snapshot.js +1 -1
- package/lib/TurboAdapter.js +1 -1
- package/lib/lfJson2Xml.js +1 -1
- package/lib/lfXml2Json.js +1 -1
- package/package.json +3 -3
- package/types/NodeResize/BasicShape/Polygon.d.ts +0 -10
- package/types/NodeResize/BasicShape/Rect.d.ts +0 -17
- package/types/NodeResize/Control/Control.d.ts +0 -65
- package/types/NodeResize/Control/ControlGroup.d.ts +0 -13
- package/types/NodeResize/Control/Util.d.ts +0 -33
- package/types/NodeResize/Node/DiamondResize.d.ts +0 -30
- package/types/NodeResize/Node/EllipseResize.d.ts +0 -30
- package/types/NodeResize/Node/HtmlResize.d.ts +0 -30
- package/types/NodeResize/Node/RectResize.d.ts +0 -32
- package/types/NodeResize/index.d.ts +0 -11
- package/types/bpmn/events/EndEvent.d.ts +0 -21
- package/types/bpmn/events/StartEvent.d.ts +0 -17
- package/types/bpmn/flow/SequenceFlow.d.ts +0 -15
- package/types/bpmn/gateways/ExclusiveGateway.d.ts +0 -16
- package/types/bpmn/getBpmnId.d.ts +0 -1
- package/types/bpmn/index.d.ts +0 -13
- package/types/bpmn/tasks/ServiceTask.d.ts +0 -17
- package/types/bpmn/tasks/UserTask.d.ts +0 -17
- package/types/bpmn-adapter/bpmnIds.d.ts +0 -1
- package/types/bpmn-adapter/index.d.ts +0 -63
- package/types/bpmn-adapter/json2xml.d.ts +0 -3
- package/types/components/context-menu/index.d.ts +0 -34
- package/types/components/control/index.d.ts +0 -26
- package/types/components/dnd-panel/index.d.ts +0 -25
- package/types/components/highlight/index.d.ts +0 -21
- package/types/components/menu/index.d.ts +0 -50
- package/types/components/mini-map/index.d.ts +0 -88
- package/types/components/selection-select/index.d.ts +0 -42
- package/types/index.d.ts +0 -19
- package/types/insert-node-in-polyline/edge.d.ts +0 -31
- package/types/insert-node-in-polyline/index.d.ts +0 -28
- package/types/locale/en-locale/en.d.ts +0 -19
- package/types/locale/en-locale/index.d.ts +0 -9
- package/types/locale/locale.d.ts +0 -6
- package/types/materials/curved-edge/index.d.ts +0 -8
- package/types/materials/curved-edge/searchMiddleIndex.d.ts +0 -1
- package/types/materials/group/GroupNode.d.ts +0 -125
- package/types/materials/group/index.d.ts +0 -56
- package/types/tools/auto-layout/index.d.ts +0 -40
- package/types/tools/flow-path/index.d.ts +0 -47
- package/types/tools/snapshot/index.d.ts +0 -25
- package/types/turbo-adapter/index.d.ts +0 -21
- package/types/type/index.d.ts +0 -6
- /package/{types/bpmn-adapter → es/bpmn-elements-adapter}/xml2json.d.ts +0 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
var __assign = (this && this.__assign) || function () {
|
|
16
|
+
__assign = Object.assign || function(t) {
|
|
17
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
+
s = arguments[i];
|
|
19
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
20
|
+
t[p] = s[p];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
return __assign.apply(this, arguments);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.SubProcessFactory = void 0;
|
|
28
|
+
/* eslint-disable no-shadow */
|
|
29
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
30
|
+
var core_1 = require("@logicflow/core");
|
|
31
|
+
var index_1 = require("../../../materials/group/index");
|
|
32
|
+
function SubProcessFactory() {
|
|
33
|
+
var view = /** @class */ (function (_super) {
|
|
34
|
+
__extends(view, _super);
|
|
35
|
+
function view() {
|
|
36
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
37
|
+
}
|
|
38
|
+
view.prototype.getFoldIcon = function () {
|
|
39
|
+
var model = this.props.model;
|
|
40
|
+
var x = model.x, y = model.y, width = model.width, height = model.height, properties = model.properties, foldable = model.foldable;
|
|
41
|
+
var foldX = model.x - model.width / 2 + 5;
|
|
42
|
+
var foldY = model.y - model.height / 2 + 5;
|
|
43
|
+
if (!foldable)
|
|
44
|
+
return null;
|
|
45
|
+
var iconIcon = core_1.h('path', {
|
|
46
|
+
fill: 'none',
|
|
47
|
+
stroke: '#818281',
|
|
48
|
+
strokeWidth: 2,
|
|
49
|
+
'pointer-events': 'none',
|
|
50
|
+
d: properties.isFolded
|
|
51
|
+
? "M " + (foldX + 3) + "," + (foldY + 6) + " " + (foldX + 11) + "," + (foldY + 6) + " M" + (foldX + 7) + "," + (foldY + 2) + " " + (foldX + 7) + "," + (foldY + 10)
|
|
52
|
+
: "M " + (foldX + 3) + "," + (foldY + 6) + " " + (foldX + 11) + "," + (foldY + 6) + " ",
|
|
53
|
+
});
|
|
54
|
+
return core_1.h('g', {}, [
|
|
55
|
+
core_1.h('rect', {
|
|
56
|
+
height: 12,
|
|
57
|
+
width: 14,
|
|
58
|
+
rx: 2,
|
|
59
|
+
ry: 2,
|
|
60
|
+
strokeWidth: 1,
|
|
61
|
+
fill: '#F4F5F6',
|
|
62
|
+
stroke: '#CECECE',
|
|
63
|
+
cursor: 'pointer',
|
|
64
|
+
x: x - width / 2 + 5,
|
|
65
|
+
y: y - height / 2 + 5,
|
|
66
|
+
onClick: function (e) {
|
|
67
|
+
e.stopPropagation();
|
|
68
|
+
model.foldGroup(!properties.isFolded);
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
iconIcon,
|
|
72
|
+
]);
|
|
73
|
+
};
|
|
74
|
+
view.prototype.getResizeShape = function () {
|
|
75
|
+
var model = this.props.model;
|
|
76
|
+
var x = model.x, y = model.y, width = model.width, height = model.height;
|
|
77
|
+
var style = model.getNodeStyle();
|
|
78
|
+
var foldRectAttrs = __assign(__assign({}, style), { x: x - width / 2, y: y - height / 2, width: width,
|
|
79
|
+
height: height, stroke: 'black', strokeWidth: 2, strokeDasharray: '0 0' });
|
|
80
|
+
return core_1.h('g', {}, [
|
|
81
|
+
// this.getAddAbleShape(),
|
|
82
|
+
core_1.h('rect', __assign({}, foldRectAttrs)),
|
|
83
|
+
this.getFoldIcon(),
|
|
84
|
+
]);
|
|
85
|
+
};
|
|
86
|
+
return view;
|
|
87
|
+
}(index_1.GroupNode.view));
|
|
88
|
+
var model = /** @class */ (function (_super) {
|
|
89
|
+
__extends(model, _super);
|
|
90
|
+
function model() {
|
|
91
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
92
|
+
}
|
|
93
|
+
model.prototype.initNodeData = function (data) {
|
|
94
|
+
_super.prototype.initNodeData.call(this, data);
|
|
95
|
+
this.foldable = true;
|
|
96
|
+
// this.isFolded = true;
|
|
97
|
+
this.resizable = true;
|
|
98
|
+
this.width = 400;
|
|
99
|
+
this.height = 200;
|
|
100
|
+
// 根据 properties中的配置重设 宽高
|
|
101
|
+
this.resetWidthHeight();
|
|
102
|
+
this.isTaskNode = true; // 标识此节点是任务节点,可以被附件边界事件
|
|
103
|
+
this.boundaryEvents = []; // 记录自己附加的边界事件
|
|
104
|
+
};
|
|
105
|
+
// 自定义根据properties.iniProp
|
|
106
|
+
model.prototype.resetWidthHeight = function () {
|
|
107
|
+
var _a, _b;
|
|
108
|
+
var width = (_a = this.properties.iniProp) === null || _a === void 0 ? void 0 : _a.width;
|
|
109
|
+
var height = (_b = this.properties.iniProp) === null || _b === void 0 ? void 0 : _b.height;
|
|
110
|
+
width && (this.width = width);
|
|
111
|
+
height && (this.height = height);
|
|
112
|
+
};
|
|
113
|
+
model.prototype.getNodeStyle = function () {
|
|
114
|
+
var style = _super.prototype.getNodeStyle.call(this);
|
|
115
|
+
style.stroke = '#989891';
|
|
116
|
+
style.strokeWidth = 1;
|
|
117
|
+
style.strokeDasharray = '3 3';
|
|
118
|
+
if (this.isSelected) {
|
|
119
|
+
style.stroke = 'rgb(124, 15, 255)';
|
|
120
|
+
}
|
|
121
|
+
// isBoundaryEventTouchingTask属性用于标识拖动边界节点是否靠近此节点
|
|
122
|
+
// 如果靠近,则高亮提示
|
|
123
|
+
// style.fill = 'rgb(255, 230, 204)';
|
|
124
|
+
var isBoundaryEventTouchingTask = this.properties.isBoundaryEventTouchingTask;
|
|
125
|
+
if (isBoundaryEventTouchingTask) {
|
|
126
|
+
style.stroke = '#00acff';
|
|
127
|
+
style.strokeWidth = 2;
|
|
128
|
+
}
|
|
129
|
+
return style;
|
|
130
|
+
};
|
|
131
|
+
model.prototype.addChild = function (id) {
|
|
132
|
+
var model = this.graphModel.getElement(id);
|
|
133
|
+
model.setProperties({
|
|
134
|
+
parent: this.id,
|
|
135
|
+
});
|
|
136
|
+
_super.prototype.addChild.call(this, id);
|
|
137
|
+
};
|
|
138
|
+
// 隐藏锚点而不是设置锚点数为0
|
|
139
|
+
// 因为分组内部节点与外部节点相连时,
|
|
140
|
+
// 如果折叠分组,需要分组代替内部节点与外部节点相连。
|
|
141
|
+
model.prototype.getAnchorStyle = function () {
|
|
142
|
+
var style = _super.prototype.getAnchorStyle.call(this, {});
|
|
143
|
+
style.stroke = '#000';
|
|
144
|
+
style.fill = '#fff';
|
|
145
|
+
style.hover.stroke = 'transparent';
|
|
146
|
+
return style;
|
|
147
|
+
};
|
|
148
|
+
model.prototype.getOutlineStyle = function () {
|
|
149
|
+
var style = _super.prototype.getOutlineStyle.call(this);
|
|
150
|
+
style.stroke = 'transparent';
|
|
151
|
+
!style.hover && (style.hover = {});
|
|
152
|
+
style.hover.stroke = 'transparent';
|
|
153
|
+
return style;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* 提供方法给插件在判断此节点被拖动边界事件节点靠近时调用,从而触发高亮
|
|
157
|
+
*/
|
|
158
|
+
model.prototype.setTouching = function (flag) {
|
|
159
|
+
this.setProperty('isBoundaryEventTouchingTask', flag);
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* 附加后记录被附加的边界事件节点Id
|
|
163
|
+
*/
|
|
164
|
+
model.prototype.addBoundaryEvent = function (nodeId) {
|
|
165
|
+
this.setTouching(false);
|
|
166
|
+
if (this.boundaryEvents.find(function (item) { return item === nodeId; })) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
var boundaryEvent = this.graphModel.getNodeModelById(nodeId);
|
|
170
|
+
boundaryEvent === null || boundaryEvent === void 0 ? void 0 : boundaryEvent.setProperties({
|
|
171
|
+
attachedToRef: this.id,
|
|
172
|
+
});
|
|
173
|
+
this.boundaryEvents.push(nodeId);
|
|
174
|
+
return true;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* 被附加的边界事件节点被删除时,移除记录
|
|
178
|
+
*/
|
|
179
|
+
model.prototype.deleteBoundaryEvent = function (nodeId) {
|
|
180
|
+
this.boundaryEvents = this.boundaryEvents.filter(function (item) { return item !== nodeId; });
|
|
181
|
+
};
|
|
182
|
+
return model;
|
|
183
|
+
}(index_1.GroupNode.model));
|
|
184
|
+
return {
|
|
185
|
+
type: 'bpmn:subProcess',
|
|
186
|
+
view: view,
|
|
187
|
+
model: model,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
exports.SubProcessFactory = SubProcessFactory;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
var __assign = (this && this.__assign) || function () {
|
|
16
|
+
__assign = Object.assign || function(t) {
|
|
17
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
+
s = arguments[i];
|
|
19
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
20
|
+
t[p] = s[p];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
return __assign.apply(this, arguments);
|
|
25
|
+
};
|
|
26
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
27
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
28
|
+
if (!m) return o;
|
|
29
|
+
var i = m.call(o), r, ar = [], e;
|
|
30
|
+
try {
|
|
31
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
32
|
+
}
|
|
33
|
+
catch (error) { e = { error: error }; }
|
|
34
|
+
finally {
|
|
35
|
+
try {
|
|
36
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
37
|
+
}
|
|
38
|
+
finally { if (e) throw e.error; }
|
|
39
|
+
}
|
|
40
|
+
return ar;
|
|
41
|
+
};
|
|
42
|
+
var __spread = (this && this.__spread) || function () {
|
|
43
|
+
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
|
44
|
+
return ar;
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.TaskNodeFactory = exports.multiInstanceIcon = void 0;
|
|
48
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
49
|
+
var core_1 = require("@logicflow/core");
|
|
50
|
+
var icons_1 = require("../icons");
|
|
51
|
+
var utils_1 = require("../../utils");
|
|
52
|
+
exports.multiInstanceIcon = {
|
|
53
|
+
parallel: icons_1.parallelMarker,
|
|
54
|
+
sequential: icons_1.sequentialMarker,
|
|
55
|
+
loop: icons_1.loopMarker,
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* @param type 任务节点的type, 对应其XML定义中的节点名,如<bpmn:userTask /> 其type为bpmn:userTask
|
|
59
|
+
* @param icon 任务节点左上角的图标,可以是svg path,也可以是h函数生成的svg
|
|
60
|
+
* @param props (可选) 任务节点的属性
|
|
61
|
+
* @returns { type: string, model: any, view: any }
|
|
62
|
+
*/
|
|
63
|
+
function TaskNodeFactory(type, icon, props) {
|
|
64
|
+
var view = /** @class */ (function (_super) {
|
|
65
|
+
__extends(view, _super);
|
|
66
|
+
function view() {
|
|
67
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
68
|
+
}
|
|
69
|
+
view.prototype.getLabelShape = function () {
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
var model = this.props.model;
|
|
72
|
+
var x = model.x, y = model.y, width = model.width, height = model.height;
|
|
73
|
+
var style = model.getNodeStyle();
|
|
74
|
+
var i = Array.isArray(icon)
|
|
75
|
+
? core_1.h.apply(void 0, __spread(['g', {
|
|
76
|
+
transform: "matrix(1 0 0 1 " + (x - width / 2) + " " + (y - height / 2) + ")",
|
|
77
|
+
}], icon)) : core_1.h('path', {
|
|
78
|
+
fill: style.stroke,
|
|
79
|
+
d: icon,
|
|
80
|
+
});
|
|
81
|
+
return core_1.h('svg', {
|
|
82
|
+
x: x - width / 2 + 5,
|
|
83
|
+
y: y - height / 2 + 5,
|
|
84
|
+
width: 25,
|
|
85
|
+
height: 25,
|
|
86
|
+
viewBox: '0 0 1274 1024',
|
|
87
|
+
}, i);
|
|
88
|
+
};
|
|
89
|
+
view.prototype.getShape = function () {
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
var model = this.props.model;
|
|
92
|
+
var x = model.x, y = model.y, width = model.width, height = model.height, radius = model.radius, properties = model.properties;
|
|
93
|
+
var style = model.getNodeStyle();
|
|
94
|
+
return core_1.h('g', {}, [
|
|
95
|
+
core_1.h('rect', __assign(__assign({}, style), { x: x - width / 2, y: y - height / 2, rx: radius, ry: radius, width: width,
|
|
96
|
+
height: height, opacity: 0.95 })),
|
|
97
|
+
this.getLabelShape(),
|
|
98
|
+
core_1.h('g', {
|
|
99
|
+
transform: "matrix(1 0 0 1 " + (x - width / 2) + " " + (y - height / 2) + ")",
|
|
100
|
+
}, core_1.h('path', {
|
|
101
|
+
fill: 'white',
|
|
102
|
+
strokeLinecap: 'round',
|
|
103
|
+
strokeLinejoin: 'round',
|
|
104
|
+
stroke: 'rgb(34, 36, 42)',
|
|
105
|
+
strokeWidth: '2',
|
|
106
|
+
d: exports.multiInstanceIcon[properties.multiInstanceType] || '',
|
|
107
|
+
})),
|
|
108
|
+
]);
|
|
109
|
+
};
|
|
110
|
+
return view;
|
|
111
|
+
}(core_1.RectNode));
|
|
112
|
+
var model = /** @class */ (function (_super) {
|
|
113
|
+
__extends(model, _super);
|
|
114
|
+
function model(data, graphModel) {
|
|
115
|
+
var _a;
|
|
116
|
+
var _this = this;
|
|
117
|
+
if (!data.id) {
|
|
118
|
+
data.id = "Activity_" + utils_1.genBpmnId();
|
|
119
|
+
}
|
|
120
|
+
var properties = __assign(__assign({}, (props || {})), data.properties);
|
|
121
|
+
data.properties = properties;
|
|
122
|
+
_this = _super.call(this, data, graphModel) || this;
|
|
123
|
+
(_a = properties === null || properties === void 0 ? void 0 : properties.boundaryEvents) === null || _a === void 0 ? void 0 : _a.forEach(function (id) {
|
|
124
|
+
_this.addBoundaryEvent(id);
|
|
125
|
+
});
|
|
126
|
+
_this.deleteProperty('boundaryEvents');
|
|
127
|
+
utils_1.groupRule.call(_this);
|
|
128
|
+
return _this;
|
|
129
|
+
}
|
|
130
|
+
model.prototype.initNodeData = function (data) {
|
|
131
|
+
_super.prototype.initNodeData.call(this, data);
|
|
132
|
+
this.isTaskNode = true; // 标识此节点是任务节点,可以被附件边界事件
|
|
133
|
+
this.boundaryEvents = []; // 记录自己附加的边界事件
|
|
134
|
+
};
|
|
135
|
+
model.prototype.getNodeStyle = function () {
|
|
136
|
+
var style = _super.prototype.getNodeStyle.call(this);
|
|
137
|
+
// isBoundaryEventTouchingTask属性用于标识拖动边界节点是否靠近此节点
|
|
138
|
+
// 如果靠近,则高亮提示
|
|
139
|
+
// style.fill = 'rgb(255, 230, 204)';
|
|
140
|
+
var isBoundaryEventTouchingTask = this.properties.isBoundaryEventTouchingTask;
|
|
141
|
+
if (isBoundaryEventTouchingTask) {
|
|
142
|
+
style.stroke = '#00acff';
|
|
143
|
+
style.strokeWidth = 2;
|
|
144
|
+
}
|
|
145
|
+
return style;
|
|
146
|
+
};
|
|
147
|
+
model.prototype.getOutlineStyle = function () {
|
|
148
|
+
var style = _super.prototype.getOutlineStyle.call(this);
|
|
149
|
+
style.stroke = 'transparent';
|
|
150
|
+
!style.hover && (style.hover = {});
|
|
151
|
+
style.hover.stroke = 'transparent';
|
|
152
|
+
return style;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* 提供方法给插件在判断此节点被拖动边界事件节点靠近时调用,从而触发高亮
|
|
156
|
+
*/
|
|
157
|
+
model.prototype.setTouching = function (flag) {
|
|
158
|
+
this.setProperty('isBoundaryEventTouchingTask', flag);
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* 附加后记录被附加的边界事件节点Id
|
|
162
|
+
*/
|
|
163
|
+
model.prototype.addBoundaryEvent = function (nodeId) {
|
|
164
|
+
this.setTouching(false);
|
|
165
|
+
if (this.boundaryEvents.find(function (item) { return item === nodeId; })) {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
var boundaryEvent = this.graphModel.getNodeModelById(nodeId);
|
|
169
|
+
boundaryEvent === null || boundaryEvent === void 0 ? void 0 : boundaryEvent.setProperties({
|
|
170
|
+
attachedToRef: this.id,
|
|
171
|
+
});
|
|
172
|
+
this.boundaryEvents.push(nodeId);
|
|
173
|
+
return true;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* 被附加的边界事件节点被删除时,移除记录
|
|
177
|
+
*/
|
|
178
|
+
model.prototype.deleteBoundaryEvent = function (nodeId) {
|
|
179
|
+
this.boundaryEvents = this.boundaryEvents.filter(function (item) { return item !== nodeId; });
|
|
180
|
+
};
|
|
181
|
+
return model;
|
|
182
|
+
}(core_1.RectNodeModel));
|
|
183
|
+
// @ts-ignore
|
|
184
|
+
return {
|
|
185
|
+
type: type,
|
|
186
|
+
view: view,
|
|
187
|
+
model: model,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
exports.TaskNodeFactory = TaskNodeFactory;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loopMarker = exports.sequentialMarker = exports.parallelMarker = exports.style = exports.manualTaskIcon = exports.scriptTaskIcon = exports.userTaskIcon = exports.serviceTaskIcon = exports.inclusiveIcon = exports.parallelIcon = exports.exclusiveIcon = exports.terminateIcon = exports.signalIcon = exports.linkIcon = exports.conditionalIcon = exports.compensationIcon = exports.escalationIcon = exports.errorIcon = exports.timerIcon = exports.messageIcon = void 0;
|
|
4
|
+
var core_1 = require("@logicflow/core");
|
|
5
|
+
// event
|
|
6
|
+
exports.messageIcon = 'm 8.459999999999999,11.34 l 0,12.6 l 18.900000000000002,0 l 0,-12.6 z l 9.450000000000001,5.4 l 9.450000000000001,-5.4';
|
|
7
|
+
exports.timerIcon = [
|
|
8
|
+
core_1.h('circle', {
|
|
9
|
+
cx: 18,
|
|
10
|
+
cy: 18,
|
|
11
|
+
r: 11,
|
|
12
|
+
style: 'stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white',
|
|
13
|
+
}),
|
|
14
|
+
core_1.h('path', {
|
|
15
|
+
d: 'M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5',
|
|
16
|
+
style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;',
|
|
17
|
+
}),
|
|
18
|
+
core_1.h('path', {
|
|
19
|
+
d: 'M 18,18 m 0,7.5 l -0,2.25',
|
|
20
|
+
transform: 'rotate(0,18,18)',
|
|
21
|
+
style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
|
|
22
|
+
}),
|
|
23
|
+
core_1.h('path', {
|
|
24
|
+
d: 'M 18,18 m 0,7.5 l -0,2.25',
|
|
25
|
+
transform: 'rotate(30,18,18)',
|
|
26
|
+
style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
|
|
27
|
+
}),
|
|
28
|
+
core_1.h('path', {
|
|
29
|
+
d: 'M 18,18 m 0,7.5 l -0,2.25',
|
|
30
|
+
transform: 'rotate(60,18,18)',
|
|
31
|
+
style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
|
|
32
|
+
}),
|
|
33
|
+
core_1.h('path', {
|
|
34
|
+
d: 'M 18,18 m 0,7.5 l -0,2.25',
|
|
35
|
+
transform: 'rotate(90,18,18)',
|
|
36
|
+
style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
|
|
37
|
+
}),
|
|
38
|
+
core_1.h('path', {
|
|
39
|
+
d: 'M 18,18 m 0,7.5 l -0,2.25',
|
|
40
|
+
transform: 'rotate(120,18,18)',
|
|
41
|
+
style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
|
|
42
|
+
}),
|
|
43
|
+
core_1.h('path', {
|
|
44
|
+
d: 'M 18,18 m 0,7.5 l -0,2.25',
|
|
45
|
+
transform: 'rotate(150,18,18)',
|
|
46
|
+
style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
|
|
47
|
+
}),
|
|
48
|
+
core_1.h('path', {
|
|
49
|
+
d: 'M 18,18 m 0,7.5 l -0,2.25',
|
|
50
|
+
transform: 'rotate(180,18,18)',
|
|
51
|
+
style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
|
|
52
|
+
}),
|
|
53
|
+
core_1.h('path', {
|
|
54
|
+
d: 'M 18,18 m 0,7.5 l -0,2.25',
|
|
55
|
+
transform: 'rotate(210,18,18)',
|
|
56
|
+
style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
|
|
57
|
+
}),
|
|
58
|
+
core_1.h('path', {
|
|
59
|
+
d: 'M 18,18 m 0,7.5 l -0,2.25',
|
|
60
|
+
transform: 'rotate(240,18,18)',
|
|
61
|
+
style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
|
|
62
|
+
}),
|
|
63
|
+
core_1.h('path', {
|
|
64
|
+
d: 'M 18,18 m 0,7.5 l -0,2.25',
|
|
65
|
+
transform: 'rotate(270,18,18)',
|
|
66
|
+
style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
|
|
67
|
+
}),
|
|
68
|
+
core_1.h('path', {
|
|
69
|
+
d: 'M 18,18 m 0,7.5 l -0,2.25',
|
|
70
|
+
transform: 'rotate(300,18,18)',
|
|
71
|
+
style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
|
|
72
|
+
}),
|
|
73
|
+
core_1.h('path', {
|
|
74
|
+
d: 'M 18,18 m 0,7.5 l -0,2.25',
|
|
75
|
+
transform: 'rotate(330,18,18)',
|
|
76
|
+
style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
|
|
77
|
+
}),
|
|
78
|
+
];
|
|
79
|
+
exports.errorIcon = 'm 7.2,25.991999999999997 0.09350000000000001,-0.025300000000000003 7.3392,-9.610700000000001 7.667000000000001,8.9661 4.7003,-18.2204 -5.8707,11.6501 -7.299600000000001,-9.585400000000002 z';
|
|
80
|
+
exports.escalationIcon = 'M 18,7.2 l 8,20 l -8,-7 l -8,7 Z';
|
|
81
|
+
exports.compensationIcon = 'm 7.92,18 9,-6.5 0,13 z m 9.3,-0.4 8.7,-6.1 0,13 -8.7,-6.1 z';
|
|
82
|
+
exports.conditionalIcon = 'M 10.5,8.5 l 14.5,0 l 0,18 l -14.5,0 Z M 12.5,11.5 l 10.5,0 M 12.5,14.5 l 10.5,0 M 12.5,17.5 l 10.5,0 M 12.5,20.5 l 10.5,0 M 12.5,23.5 l 10.5,0 M 12.5,26.5 l 10.5,0 ';
|
|
83
|
+
exports.linkIcon = 'm 20.52,9.468 0,4.4375 -13.5,0 0,6.75 13.5,0 0,4.4375 9.84375,-7.8125 -9.84375,-7.8125 z';
|
|
84
|
+
exports.signalIcon = 'M 18,7.2 l 9,16.2 l -18,0 Z';
|
|
85
|
+
exports.terminateIcon = [
|
|
86
|
+
core_1.h('circle', {
|
|
87
|
+
cx: 18,
|
|
88
|
+
cy: 18,
|
|
89
|
+
r: 10,
|
|
90
|
+
style: 'stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);',
|
|
91
|
+
}),
|
|
92
|
+
];
|
|
93
|
+
// gateway
|
|
94
|
+
exports.exclusiveIcon = 'm 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z';
|
|
95
|
+
exports.parallelIcon = 'm 23,10 0,12.5 -12.5,0 0,5 12.5,0 0,12.5 5,0 0,-12.5 12.5,0 0,-5 -12.5,0 0,-12.5 -5,0 z';
|
|
96
|
+
exports.inclusiveIcon = core_1.h('circle', {
|
|
97
|
+
cx: 25,
|
|
98
|
+
cy: 25,
|
|
99
|
+
r: 13,
|
|
100
|
+
style: 'stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;',
|
|
101
|
+
});
|
|
102
|
+
// task
|
|
103
|
+
exports.serviceTaskIcon = 'M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z';
|
|
104
|
+
exports.userTaskIcon = 'M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z';
|
|
105
|
+
exports.scriptTaskIcon = 'M6.402,0.5H20.902C20.902,0.5,15.069,3.333,15.069,6.083S19.486,12.083,19.486,15.25S15.319,20.333,15.319,20.333H0.235C0.235,20.333,5.235,17.665999999999997,5.235,15.332999999999998S0.6520000000000001,8.582999999999998,0.6520000000000001,6.082999999999998S6.402,0.5,6.402,0.5ZM3.5,4.5L13.5,4.5M3.8,8.5L13.8,8.5M6.3,12.5L16.3,12.5M6.5,16.5L16.5,16.5';
|
|
106
|
+
exports.manualTaskIcon = 'M0.5,3.751L4.583,0.5009999999999999C4.583,0.5009999999999999,15.749,0.5839999999999999,16.666,0.5839999999999999S14.249,3.5009999999999994,15.166,3.5009999999999994S26.833,3.5009999999999994,27.75,3.5009999999999994C28.916,5.209,27.582,6.667999999999999,26.916,7.167999999999999S27.791,9.084999999999999,25.916,11.584999999999999C25.166,11.834999999999999,26.666,13.459999999999999,24.583000000000002,14.918C23.416,15.501,25.166,16.46,23.333000000000002,17.750999999999998C22.166,17.750999999999998,2.5000000000000036,17.833999999999996,2.5000000000000036,17.833999999999996L0.5000000000000036,16.500999999999998V3.751ZM13.5,7L27,7M13.5,11L26,11M14,14.5L25,14.5M8.2,3.1L15,3.1';
|
|
107
|
+
exports.style = {
|
|
108
|
+
throw: 'fill: rgb(34, 36, 42); stroke-linecap: round; stroke-linejoin: round; stroke: white; stroke-width: 1px;',
|
|
109
|
+
catch: 'fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
|
|
110
|
+
nonIntermediate: 'stroke-width: 1.5; stroke-dash-array: 6',
|
|
111
|
+
intermediate: 'stroke-width: 1.5',
|
|
112
|
+
};
|
|
113
|
+
// marker
|
|
114
|
+
exports.parallelMarker = 'm44,60 m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10';
|
|
115
|
+
exports.sequentialMarker = 'm47,61 m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0';
|
|
116
|
+
exports.loopMarker = 'm 50,73 c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genBpmnId = exports.groupRule = void 0;
|
|
4
|
+
/* eslint-disable no-bitwise */
|
|
5
|
+
function groupRule() {
|
|
6
|
+
var rule = {
|
|
7
|
+
message: '分组外的节点不允许连接分组内的',
|
|
8
|
+
validate: function (_sourceNode, _targetNode, _sourceAnchor, _targetAnchor) {
|
|
9
|
+
var isSourceNodeInsideTheGroup = !!_sourceNode.properties.parent;
|
|
10
|
+
var isTargetNodeInsideTheGroup = !!_targetNode.properties.parent;
|
|
11
|
+
return !(!isSourceNodeInsideTheGroup && isTargetNodeInsideTheGroup);
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
this.targetRules.push(rule);
|
|
15
|
+
}
|
|
16
|
+
exports.groupRule = groupRule;
|
|
17
|
+
/* eslint-disable no-bitwise */
|
|
18
|
+
var IDS = /** @class */ (function () {
|
|
19
|
+
function IDS() {
|
|
20
|
+
globalThis._ids = this;
|
|
21
|
+
this._ids = new Set();
|
|
22
|
+
}
|
|
23
|
+
IDS.prototype.generateId = function () {
|
|
24
|
+
var id = 'xxxxxxxx'.replace(/[x]/g, function (c) {
|
|
25
|
+
var r = (Math.random() * 16) | 0;
|
|
26
|
+
var v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
27
|
+
return v.toString(16);
|
|
28
|
+
});
|
|
29
|
+
return id;
|
|
30
|
+
};
|
|
31
|
+
IDS.prototype.next = function () {
|
|
32
|
+
var id = this.generateId();
|
|
33
|
+
while (this._ids.has(id)) {
|
|
34
|
+
id = this.generateId();
|
|
35
|
+
}
|
|
36
|
+
this._ids.add(id);
|
|
37
|
+
return id;
|
|
38
|
+
};
|
|
39
|
+
return IDS;
|
|
40
|
+
}());
|
|
41
|
+
var ids = (globalThis === null || globalThis === void 0 ? void 0 : globalThis._ids) || new IDS();
|
|
42
|
+
function genBpmnId() {
|
|
43
|
+
return ids.next();
|
|
44
|
+
}
|
|
45
|
+
exports.genBpmnId = genBpmnId;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.theme = exports.SubProcessConfig = exports.UserTaskConfig = exports.ServiceTaskConfig = exports.ExclusiveGatewayConfig = exports.InclusiveGatewayConfig = exports.ParallelGatewayConfig = exports.IntermediateEventConfig = exports.BoundaryEventConfig = exports.EndEventConfig = exports.StartEventConfig = void 0;
|
|
4
|
+
exports.StartEventConfig = {
|
|
5
|
+
width: 40,
|
|
6
|
+
height: 40,
|
|
7
|
+
};
|
|
8
|
+
exports.EndEventConfig = {
|
|
9
|
+
width: 40,
|
|
10
|
+
height: 40,
|
|
11
|
+
};
|
|
12
|
+
exports.BoundaryEventConfig = {
|
|
13
|
+
width: 100,
|
|
14
|
+
height: 80,
|
|
15
|
+
};
|
|
16
|
+
exports.IntermediateEventConfig = {
|
|
17
|
+
width: 100,
|
|
18
|
+
height: 80,
|
|
19
|
+
};
|
|
20
|
+
exports.ParallelGatewayConfig = {
|
|
21
|
+
width: 100,
|
|
22
|
+
height: 80,
|
|
23
|
+
};
|
|
24
|
+
exports.InclusiveGatewayConfig = {
|
|
25
|
+
width: 100,
|
|
26
|
+
height: 80,
|
|
27
|
+
};
|
|
28
|
+
exports.ExclusiveGatewayConfig = {
|
|
29
|
+
width: 100,
|
|
30
|
+
height: 80,
|
|
31
|
+
};
|
|
32
|
+
exports.ServiceTaskConfig = {
|
|
33
|
+
width: 100,
|
|
34
|
+
height: 80,
|
|
35
|
+
};
|
|
36
|
+
exports.UserTaskConfig = {
|
|
37
|
+
width: 100,
|
|
38
|
+
height: 80,
|
|
39
|
+
};
|
|
40
|
+
exports.SubProcessConfig = {
|
|
41
|
+
width: 100,
|
|
42
|
+
height: 80,
|
|
43
|
+
};
|
|
44
|
+
exports.theme = {
|
|
45
|
+
rect: {
|
|
46
|
+
radius: 5,
|
|
47
|
+
stroke: 'rgb(24, 125, 255)',
|
|
48
|
+
},
|
|
49
|
+
circle: {
|
|
50
|
+
r: 18,
|
|
51
|
+
stroke: 'rgb(24, 125, 255)',
|
|
52
|
+
},
|
|
53
|
+
polygon: {
|
|
54
|
+
stroke: 'rgb(24, 125, 255)',
|
|
55
|
+
},
|
|
56
|
+
polyline: {
|
|
57
|
+
stroke: 'rgb(24, 125, 255)',
|
|
58
|
+
hoverStroke: 'rgb(24, 125, 255)',
|
|
59
|
+
selectedStroke: 'rgb(24, 125, 255)',
|
|
60
|
+
},
|
|
61
|
+
edgeText: {
|
|
62
|
+
background: {
|
|
63
|
+
fill: 'white',
|
|
64
|
+
height: 14,
|
|
65
|
+
stroke: 'transparent',
|
|
66
|
+
radius: 3,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
};
|