@web-utils/component 2.9.9 → 2.9.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/flow-viewer/index.mjs +78 -83
- package/flow-viewer/style.css +1 -1
- package/package.json +1 -1
- package/web-types.json +2 -2
package/flow-viewer/index.mjs
CHANGED
|
@@ -2,60 +2,60 @@ var k = Object.defineProperty, b = Object.defineProperties;
|
|
|
2
2
|
var M = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var f = Object.getOwnPropertySymbols;
|
|
4
4
|
var x = Object.prototype.hasOwnProperty, V = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var u = (
|
|
6
|
-
for (var
|
|
7
|
-
x.call(i,
|
|
5
|
+
var u = (e, i, t) => i in e ? k(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, w = (e, i) => {
|
|
6
|
+
for (var t in i || (i = {}))
|
|
7
|
+
x.call(i, t) && u(e, t, i[t]);
|
|
8
8
|
if (f)
|
|
9
|
-
for (var
|
|
10
|
-
V.call(i,
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
9
|
+
for (var t of f(i))
|
|
10
|
+
V.call(i, t) && u(e, t, i[t]);
|
|
11
|
+
return e;
|
|
12
|
+
}, v = (e, i) => b(e, M(i));
|
|
13
|
+
var y = (e, i, t) => new Promise((l, o) => {
|
|
14
|
+
var h = (r) => {
|
|
15
15
|
try {
|
|
16
|
-
a(
|
|
17
|
-
} catch (
|
|
18
|
-
n
|
|
16
|
+
a(t.next(r));
|
|
17
|
+
} catch (n) {
|
|
18
|
+
o(n);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, s = (r) => {
|
|
21
21
|
try {
|
|
22
|
-
a(
|
|
23
|
-
} catch (
|
|
24
|
-
n
|
|
22
|
+
a(t.throw(r));
|
|
23
|
+
} catch (n) {
|
|
24
|
+
o(n);
|
|
25
25
|
}
|
|
26
|
-
}, a = (
|
|
27
|
-
a((
|
|
26
|
+
}, a = (r) => r.done ? l(r.value) : Promise.resolve(r.value).then(h, s);
|
|
27
|
+
a((t = t.apply(e, i)).next());
|
|
28
28
|
});
|
|
29
|
-
import
|
|
29
|
+
import $ from "bpmn-js/lib/NavigatedViewer";
|
|
30
30
|
import d from "diagram-js/lib/navigation/zoomscroll/ZoomScroll";
|
|
31
31
|
import { create as c, attr as m, append as p } from "tiny-svg";
|
|
32
|
-
import { query as
|
|
33
|
-
import
|
|
32
|
+
import { query as E } from "min-dom";
|
|
33
|
+
import S from "@web-utils/component/easy-popup";
|
|
34
34
|
import "@web-utils/component/easy-popup/style.css";
|
|
35
35
|
import { n as F } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
return
|
|
36
|
+
var A = function() {
|
|
37
|
+
var e = this, i = e.$createElement, t = e._self._c || i;
|
|
38
|
+
return t("div", {
|
|
39
39
|
ref: "container",
|
|
40
40
|
staticClass: "flow-viewer flow-background-image",
|
|
41
41
|
style: {
|
|
42
|
-
"--highlight-color":
|
|
42
|
+
"--highlight-color": e.highlightColor
|
|
43
43
|
}
|
|
44
|
-
}, [
|
|
44
|
+
}, [t("EasyPopup", {
|
|
45
45
|
ref: "popup"
|
|
46
|
-
}, [
|
|
47
|
-
return [
|
|
46
|
+
}, [e._t("default", function() {
|
|
47
|
+
return [e._v(" " + e._s(e.element) + " ")];
|
|
48
48
|
}, {
|
|
49
|
-
element:
|
|
49
|
+
element: e.element
|
|
50
50
|
})], 2)], 1);
|
|
51
|
-
},
|
|
52
|
-
const g = d.prototype._handleWheel,
|
|
51
|
+
}, B = [];
|
|
52
|
+
const g = d.prototype._handleWheel, W = {
|
|
53
53
|
__init__: ["zoomScroll"],
|
|
54
54
|
zoomScroll: ["type", d]
|
|
55
|
-
},
|
|
55
|
+
}, X = {
|
|
56
56
|
name: "FlowViewer",
|
|
57
57
|
components: {
|
|
58
|
-
EasyPopup:
|
|
58
|
+
EasyPopup: S
|
|
59
59
|
},
|
|
60
60
|
props: {
|
|
61
61
|
xml: {
|
|
@@ -69,7 +69,7 @@ const g = d.prototype._handleWheel, X = {
|
|
|
69
69
|
type: Array,
|
|
70
70
|
default: () => []
|
|
71
71
|
},
|
|
72
|
-
|
|
72
|
+
historicActivities: {
|
|
73
73
|
type: Array,
|
|
74
74
|
default: () => []
|
|
75
75
|
},
|
|
@@ -85,40 +85,40 @@ const g = d.prototype._handleWheel, X = {
|
|
|
85
85
|
};
|
|
86
86
|
},
|
|
87
87
|
watch: {
|
|
88
|
-
xml(
|
|
88
|
+
xml(e) {
|
|
89
89
|
var i;
|
|
90
|
-
(i = this.bpmnViewer) == null || i.importXML(
|
|
90
|
+
(i = this.bpmnViewer) == null || i.importXML(e);
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
mounted() {
|
|
94
|
-
d.prototype._handleWheel = this.ctrlKey ? g : function(
|
|
95
|
-
const { target: i, deltaMode:
|
|
94
|
+
d.prototype._handleWheel = this.ctrlKey ? g : function(e) {
|
|
95
|
+
const { target: i, deltaMode: t, clientX: l, clientY: o, deltaX: h, deltaY: s } = e;
|
|
96
96
|
g.call(this, {
|
|
97
97
|
target: i,
|
|
98
|
-
deltaMode:
|
|
99
|
-
clientX:
|
|
100
|
-
clientY:
|
|
101
|
-
deltaX:
|
|
102
|
-
deltaY:
|
|
98
|
+
deltaMode: t,
|
|
99
|
+
clientX: l,
|
|
100
|
+
clientY: o,
|
|
101
|
+
deltaX: h,
|
|
102
|
+
deltaY: s,
|
|
103
103
|
preventDefault() {
|
|
104
|
-
|
|
104
|
+
e.preventDefault();
|
|
105
105
|
},
|
|
106
106
|
ctrlKey: !0
|
|
107
107
|
});
|
|
108
|
-
}, this.bpmnViewer = new
|
|
108
|
+
}, this.bpmnViewer = new $(v(w({}, this.options), {
|
|
109
109
|
container: this.$refs.container,
|
|
110
|
-
additionalModules: [
|
|
111
|
-
})), this.bpmnViewer.on("import.done", (
|
|
112
|
-
const i =
|
|
113
|
-
i ? this.$emit("error", i) : this.$emit("shown",
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
})),
|
|
110
|
+
additionalModules: [W]
|
|
111
|
+
})), this.bpmnViewer.on("import.done", (e) => {
|
|
112
|
+
const i = e.error, t = e.warnings;
|
|
113
|
+
i ? this.$emit("error", i) : this.$emit("shown", t), this.bpmnViewer.get("canvas").zoom("fit-viewport", "center"), this.canvas = this.bpmnViewer.get("canvas"), this.elementRegistry = this.bpmnViewer.get("elementRegistry");
|
|
114
|
+
const l = this.bpmnViewer.get("eventBus");
|
|
115
|
+
l.on("element.mousemove", (n) => y(this, null, function* () {
|
|
116
|
+
n.element.type === "bpmn:UserTask" && (this.$emit("node-mousemove", n.element), this.element = n.element, yield this.$nextTick(), this.$refs.popup.show(n.originalEvent));
|
|
117
|
+
})), l.on("element.out", () => {
|
|
118
118
|
this.$refs.popup.hide(), this.element = {};
|
|
119
|
-
}), this.highlightFlow(this.
|
|
120
|
-
const
|
|
121
|
-
m(
|
|
119
|
+
}), this.highlightFlow(this.historicActivities, this.activities);
|
|
120
|
+
const o = c("marker");
|
|
121
|
+
m(o, {
|
|
122
122
|
id: "sequenceflow-arrow-green",
|
|
123
123
|
viewBox: "0 0 20 20",
|
|
124
124
|
refX: "11",
|
|
@@ -127,13 +127,13 @@ const g = d.prototype._handleWheel, X = {
|
|
|
127
127
|
markerHeight: "10",
|
|
128
128
|
orient: "auto"
|
|
129
129
|
});
|
|
130
|
-
const
|
|
131
|
-
m(
|
|
130
|
+
const h = c("path");
|
|
131
|
+
m(h, {
|
|
132
132
|
d: "M 1 5 L 11 10 L 1 15 Z",
|
|
133
133
|
style: "stroke-linecap: round; stroke-linejoin: round; stroke: var(--highlight-color); stroke-width: 1px; fill: var(--highlight-color);"
|
|
134
|
-
}), p(
|
|
135
|
-
const
|
|
136
|
-
m(
|
|
134
|
+
}), p(o, h);
|
|
135
|
+
const s = c("marker");
|
|
136
|
+
m(s, {
|
|
137
137
|
id: "conditional-default-flow-marker-green",
|
|
138
138
|
viewBox: "0 0 20 20",
|
|
139
139
|
refX: "0",
|
|
@@ -146,49 +146,44 @@ const g = d.prototype._handleWheel, X = {
|
|
|
146
146
|
m(a, {
|
|
147
147
|
d: "M 6 4 L 10 16",
|
|
148
148
|
style: "stroke-linecap: round; stroke-linejoin: round; stroke: var(--highlight-color); stroke-width: 2px; fill: var(--highlight-color);"
|
|
149
|
-
}), p(
|
|
150
|
-
const
|
|
151
|
-
p(
|
|
149
|
+
}), p(s, a);
|
|
150
|
+
const r = E("defs", this.$el);
|
|
151
|
+
p(r, o), p(r, s);
|
|
152
152
|
}), this.bpmnViewer.importXML(this.xml), this.$watch(() => ({
|
|
153
153
|
activities: this.activities,
|
|
154
|
-
|
|
155
|
-
}), ({ activities:
|
|
156
|
-
this.highlightFlow(i,
|
|
154
|
+
historicActivities: this.historicActivities
|
|
155
|
+
}), ({ activities: e, historicActivities: i }) => {
|
|
156
|
+
this.highlightFlow(i, e);
|
|
157
157
|
});
|
|
158
158
|
},
|
|
159
159
|
beforeDestroy() {
|
|
160
|
-
var
|
|
161
|
-
d.prototype._handleWheel = g, (
|
|
160
|
+
var e;
|
|
161
|
+
d.prototype._handleWheel = g, (e = this.bpmnViewer) == null || e.destroy();
|
|
162
162
|
},
|
|
163
163
|
methods: {
|
|
164
|
-
highlightFlow(
|
|
165
|
-
this.elementRegistry.getAll().forEach((
|
|
166
|
-
|
|
167
|
-
this.canvas.removeMarker(e, "highlight");
|
|
168
|
-
const s = e.incoming.map((r) => r.id), n = e.outgoing.map((r) => r.id);
|
|
169
|
-
e.type === "bpmn:StartEvent" && n.some((r) => t.includes(r)) && this.canvas.addMarker(e, "highlight"), e.type === "bpmn:EndEvent" && s.some((r) => t.includes(r)) && this.canvas.addMarker(e, "highlight"), !this.activities.includes(e.id) && s.some((r) => t.includes(r)) && n.some((r) => t.includes(r)) && this.canvas.addMarker(e, "highlight");
|
|
170
|
-
}
|
|
171
|
-
e.type === "bpmn:SequenceFlow" && (t.includes(e.id) ? this.canvas.addMarker(e, "highlight-line") : this.canvas.removeMarker(e, "highlight-line")), e.type === "bpmn:UserTask" && (i.includes(e.id) ? this.canvas.addMarker(e, "highlight-current") : this.canvas.removeMarker(e, "highlight-current"));
|
|
164
|
+
highlightFlow(e, i) {
|
|
165
|
+
this.elementRegistry.getAll().forEach((t) => {
|
|
166
|
+
["bpmn:StartEvent", "bpmn:UserTask", "bpmn:ExclusiveGateway", "bpmn:ParallelGateway", "bpmn:EndEvent"].includes(t.type) && (e.includes(t.id) && !i.includes(t.id) ? this.canvas.addMarker(t, "highlight") : this.canvas.removeMarker(t, "highlight")), t.type === "bpmn:SequenceFlow" && (e.includes(t.id) ? this.canvas.addMarker(t, "highlight-line") : this.canvas.removeMarker(t, "highlight-line")), t.type === "bpmn:UserTask" && (i.includes(t.id) ? this.canvas.addMarker(t, "highlight-current") : this.canvas.removeMarker(t, "highlight-current"));
|
|
172
167
|
});
|
|
173
168
|
}
|
|
174
169
|
}
|
|
175
170
|
}, _ = {};
|
|
176
|
-
var
|
|
177
|
-
|
|
171
|
+
var C = /* @__PURE__ */ F(
|
|
172
|
+
X,
|
|
173
|
+
A,
|
|
178
174
|
B,
|
|
179
|
-
W,
|
|
180
175
|
!1,
|
|
181
|
-
|
|
176
|
+
L,
|
|
182
177
|
null,
|
|
183
178
|
null,
|
|
184
179
|
null
|
|
185
180
|
);
|
|
186
|
-
function
|
|
181
|
+
function L(e) {
|
|
187
182
|
for (let i in _)
|
|
188
183
|
this[i] = _[i];
|
|
189
184
|
}
|
|
190
185
|
const P = /* @__PURE__ */ function() {
|
|
191
|
-
return
|
|
186
|
+
return C.exports;
|
|
192
187
|
}();
|
|
193
188
|
export {
|
|
194
189
|
P as default
|
package/flow-viewer/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.flow-viewer{width:100%;height:400px}.flow-viewer .highlight g.djs-visual rect,.flow-viewer .highlight g.djs-visual circle,.flow-viewer .highlight g.djs-visual polygon,.flow-viewer .highlight g.djs-visual path{stroke:var(--highlight-color)!important}.flow-viewer .highlight g.djs-visual polygon+path{fill:var(--highlight-color)!important}@keyframes dashoffset{to{stroke-dashoffset:
|
|
1
|
+
.flow-viewer{width:100%;height:400px}.flow-viewer .highlight g.djs-visual rect,.flow-viewer .highlight g.djs-visual circle,.flow-viewer .highlight g.djs-visual polygon,.flow-viewer .highlight g.djs-visual path{stroke:var(--highlight-color)!important}.flow-viewer .highlight g.djs-visual polygon+path{fill:var(--highlight-color)!important}@keyframes dashoffset{to{stroke-dashoffset:100%}}.flow-viewer .highlight-current g.djs-visual rect{fill:#fbe9d1!important;stroke:#d67e7d!important;animation:dashoffset 40s linear infinite;animation-fill-mode:forwards;stroke-dasharray:8}.flow-viewer .highlight-line g.djs-visual path{stroke:var(--highlight-color)!important;stroke-width:2px!important;marker-end:url(#sequenceflow-arrow-green)!important}
|
package/package.json
CHANGED
package/web-types.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "@web-utils/component",
|
|
5
|
-
"version": "2.9.
|
|
5
|
+
"version": "2.9.11",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"description-markup": "markdown",
|
|
@@ -2605,7 +2605,7 @@
|
|
|
2605
2605
|
"default": "[]"
|
|
2606
2606
|
},
|
|
2607
2607
|
{
|
|
2608
|
-
"name": "
|
|
2608
|
+
"name": "historicActivities",
|
|
2609
2609
|
"value": {
|
|
2610
2610
|
"kind": "expression",
|
|
2611
2611
|
"type": "array"
|