@web-utils/component 2.8.15 → 2.8.16

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.
@@ -1,72 +1,72 @@
1
- var v = Object.defineProperty, _ = Object.defineProperties;
2
- var w = Object.getOwnPropertyDescriptors;
3
- var m = Object.getOwnPropertySymbols;
4
- var y = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
5
- var p = (t, e, i) => e in t ? v(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, f = (t, e) => {
6
- for (var i in e || (e = {}))
7
- y.call(e, i) && p(t, i, e[i]);
8
- if (m)
9
- for (var i of m(e))
10
- E.call(e, i) && p(t, i, e[i]);
11
- return t;
12
- }, g = (t, e) => _(t, w(e));
13
- var d = (t, e, i) => new Promise((n, s) => {
14
- var l = (r) => {
1
+ var _ = Object.defineProperty, d = Object.defineProperties;
2
+ var v = Object.getOwnPropertyDescriptors;
3
+ var p = Object.getOwnPropertySymbols;
4
+ var y = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
5
+ var c = (e, t, i) => t in e ? _(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, u = (e, t) => {
6
+ for (var i in t || (t = {}))
7
+ y.call(t, i) && c(e, i, t[i]);
8
+ if (p)
9
+ for (var i of p(t))
10
+ b.call(t, i) && c(e, i, t[i]);
11
+ return e;
12
+ }, g = (e, t) => d(e, v(t));
13
+ var f = (e, t, i) => new Promise((n, o) => {
14
+ var s = (r) => {
15
15
  try {
16
16
  h(i.next(r));
17
- } catch (a) {
18
- s(a);
17
+ } catch (m) {
18
+ o(m);
19
19
  }
20
- }, o = (r) => {
20
+ }, l = (r) => {
21
21
  try {
22
22
  h(i.throw(r));
23
- } catch (a) {
24
- s(a);
23
+ } catch (m) {
24
+ o(m);
25
25
  }
26
- }, h = (r) => r.done ? n(r.value) : Promise.resolve(r.value).then(l, o);
27
- h((i = i.apply(t, e)).next());
26
+ }, h = (r) => r.done ? n(r.value) : Promise.resolve(r.value).then(s, l);
27
+ h((i = i.apply(e, t)).next());
28
28
  });
29
- import b from "bpmn-js/lib/NavigatedViewer";
30
- import c from "diagram-js/lib/navigation/zoomscroll/ZoomScroll";
31
- import M from "@web-utils/component/easy-popup";
29
+ import V from "bpmn-js/lib/NavigatedViewer";
30
+ import a from "diagram-js/lib/navigation/zoomscroll/ZoomScroll";
31
+ import x from "@web-utils/component/easy-popup";
32
32
  import "@web-utils/component/easy-popup/style.css";
33
- import { n as V } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
34
- var k = function() {
35
- var t = this, e = t.$createElement, i = t._self._c || e;
33
+ import { n as F } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
34
+ var M = function() {
35
+ var e = this, t = e.$createElement, i = e._self._c || t;
36
36
  return i("div", {
37
37
  ref: "container",
38
38
  staticClass: "flow-viewer"
39
39
  }, [i("EasyPopup", {
40
40
  ref: "popup"
41
- }, [t._t("default", function() {
42
- return [t._v(" " + t._s(t.element) + " ")];
41
+ }, [e._t("default", function() {
42
+ return [e._v(" " + e._s(e.element) + " ")];
43
43
  }, {
44
- element: t.element
44
+ element: e.element
45
45
  })], 2)], 1);
46
- }, x = [];
47
- const F = c.prototype._handleWheel;
48
- c.prototype._handleWheel = function(t) {
49
- const { target: e, deltaMode: i, clientX: n, clientY: s, deltaX: l, deltaY: o } = t;
50
- F.call(this, {
51
- target: e,
46
+ }, $ = [];
47
+ const S = a.prototype._handleWheel;
48
+ a.prototype._handleWheel = function(e) {
49
+ const { target: t, deltaMode: i, clientX: n, clientY: o, deltaX: s, deltaY: l } = e;
50
+ S.call(this, {
51
+ target: t,
52
52
  deltaMode: i,
53
53
  clientX: n,
54
- clientY: s,
55
- deltaX: l,
56
- deltaY: o,
54
+ clientY: o,
55
+ deltaX: s,
56
+ deltaY: l,
57
57
  preventDefault() {
58
- t.preventDefault();
58
+ e.preventDefault();
59
59
  },
60
60
  ctrlKey: !0
61
61
  });
62
62
  };
63
- const $ = {
63
+ const A = {
64
64
  __init__: ["zoomScroll"],
65
- zoomScroll: ["type", c]
66
- }, S = {
65
+ zoomScroll: ["type", a]
66
+ }, k = {
67
67
  name: "FlowViewer",
68
68
  components: {
69
- EasyPopup: M
69
+ EasyPopup: x
70
70
  },
71
71
  props: {
72
72
  xml: {
@@ -91,77 +91,63 @@ const $ = {
91
91
  };
92
92
  },
93
93
  watch: {
94
- xml(t) {
95
- var e;
96
- (e = this.bpmnViewer) == null || e.importXML(t);
94
+ xml(e) {
95
+ var t;
96
+ (t = this.bpmnViewer) == null || t.importXML(e);
97
97
  },
98
98
  activities: "highlightActivity",
99
99
  flows: "highlightFlow"
100
100
  },
101
101
  mounted() {
102
- var e;
103
- const t = this.$refs.container;
104
- this.bpmnViewer = new b(g(f({}, this.options), {
105
- container: t,
106
- additionalModules: [$]
107
- })), this.bpmnViewer.on("import.done", (i) => {
108
- const n = i.error, s = i.warnings;
109
- n ? this.$emit("error", n) : this.$emit("shown", s), this.bpmnViewer.get("canvas").zoom("fit-viewport", "center");
110
- const l = this.bpmnViewer.get("eventBus");
111
- this.canvas = this.bpmnViewer.get("canvas"), l.on("element.mousemove", (o) => d(this, null, function* () {
102
+ this.bpmnViewer = new V(g(u({}, this.options), {
103
+ container: this.$refs.container,
104
+ additionalModules: [A]
105
+ })), this.bpmnViewer.on("import.done", (e) => {
106
+ const t = e.error, i = e.warnings;
107
+ t ? this.$emit("error", t) : this.$emit("shown", i), this.bpmnViewer.get("canvas").zoom("fit-viewport", "center"), this.canvas = this.bpmnViewer.get("canvas"), this.elementRegistry = this.bpmnViewer.get("elementRegistry");
108
+ const n = this.bpmnViewer.get("eventBus");
109
+ n.on("element.mousemove", (o) => f(this, null, function* () {
112
110
  o.element.type === "bpmn:UserTask" && (this.$emit("node-mousemove", o.element), this.element = o.element, yield this.$nextTick(), this.$refs.popup.show(o.originalEvent));
113
- })), l.on("element.out", () => {
111
+ })), n.on("element.out", () => {
114
112
  this.$refs.popup.hide(), this.element = {};
115
113
  }), this.highlightFlow(this.flows), this.highlightActivity(this.activities);
116
- }), (e = this.bpmnViewer) == null || e.importXML(this.xml);
114
+ }), this.bpmnViewer.importXML(this.xml);
117
115
  },
118
116
  beforeDestroy() {
119
- var t;
120
- (t = this.bpmnViewer) == null || t.destroy();
117
+ var e;
118
+ (e = this.bpmnViewer) == null || e.destroy();
121
119
  },
122
120
  methods: {
123
- getElementById(t) {
124
- return this.canvas.getRootElement().children.find((e) => e.id === t);
125
- },
126
- highlightFlow(t) {
127
- this.canvas.getRootElement().children.filter((e) => e.type === "bpmn:SequenceFlow" && this.canvas.hasMarker(e, "highlight-line")).forEach((e) => {
128
- var i;
129
- return (i = this.canvas) == null ? void 0 : i.removeMarker(e, "highlight-line");
130
- }), t.length > 0 && t.forEach((e) => {
131
- var n;
132
- const i = this.getElementById(e);
133
- i && ((n = this.canvas) == null || n.addMarker(i, "highlight-line"));
121
+ highlight(e, t, i) {
122
+ this.elementRegistry.getAll().forEach((n) => {
123
+ n.type === t && (e.includes(n.id) ? this.canvas.addMarker(n, i) : this.canvas.removeMarker(n, i));
134
124
  });
135
125
  },
136
- highlightActivity(t) {
137
- this.canvas.getRootElement().children.filter((e) => e.type === "bpmn:UserTask" && this.canvas.hasMarker(e, "highlight")).forEach((e) => {
138
- var i;
139
- return (i = this.canvas) == null ? void 0 : i.removeMarker(e, "highlight");
140
- }), t.length > 0 && t.forEach((e) => {
141
- var n;
142
- const i = this.getElementById(e);
143
- i && ((n = this.canvas) == null || n.addMarker(i, "highlight"));
144
- });
126
+ highlightFlow(e) {
127
+ this.highlight(e, "bpmn:SequenceFlow", "highlight-line");
128
+ },
129
+ highlightActivity(e) {
130
+ this.highlight(e, "bpmn:UserTask", "highlight");
145
131
  }
146
132
  }
147
- }, u = {};
148
- var B = /* @__PURE__ */ V(
149
- S,
133
+ }, w = {};
134
+ var E = /* @__PURE__ */ F(
150
135
  k,
151
- x,
136
+ M,
137
+ $,
152
138
  !1,
153
- A,
139
+ R,
154
140
  null,
155
141
  null,
156
142
  null
157
143
  );
158
- function A(t) {
159
- for (let e in u)
160
- this[e] = u[e];
144
+ function R(e) {
145
+ for (let t in w)
146
+ this[t] = w[t];
161
147
  }
162
- const W = /* @__PURE__ */ function() {
163
- return B.exports;
148
+ const q = /* @__PURE__ */ function() {
149
+ return E.exports;
164
150
  }();
165
151
  export {
166
- W as default
152
+ q as default
167
153
  };