@web-utils/component 2.8.14 → 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
  };
@@ -16,8 +16,10 @@ var c = (t, e, o) => new Promise((r, s) => {
16
16
  });
17
17
  import { hasOwn as d, toStringArray as b, animate as v, isInContainer as _ } from "@web-utils/core";
18
18
  import { merge as g } from "@web-utils/integrations/lodash";
19
- import { n as y } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
20
- var w = function() {
19
+ import y from "@web-utils/component/resize-observer";
20
+ import "@web-utils/component/resize-observer/style.css";
21
+ import { n as w } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
22
+ var x = function() {
21
23
  var t = this, e = t.$createElement, o = t._self._c || e;
22
24
  return o("div", {
23
25
  class: ["form-view", t.className]
@@ -203,16 +205,19 @@ var w = function() {
203
205
  "font-size": "16px"
204
206
  }
205
207
  }) : t._e()], 1);
206
- }, x = [];
207
- const p = ["back", "create", "save", "withdraw", "edit", "submit", "publish", "agree", "disagree", "reject", "finish", "cancel", "enable", "exp", "imp", "del", "disabled", "reload", "slot"], $ = p.map((t) => `${t}-down`), S = ["back", "withdraw", "edit"], m = ["save", "submit", "", "publish", "agree", "disagree", "reject", "finish", "cancel"], u = (t, e) => {
208
+ }, $ = [];
209
+ const p = ["back", "create", "save", "withdraw", "edit", "submit", "publish", "agree", "disagree", "reject", "finish", "cancel", "enable", "exp", "imp", "del", "disabled", "reload", "slot"], S = p.map((t) => `${t}-down`), F = ["back", "withdraw", "edit"], m = ["save", "submit", "", "publish", "agree", "disagree", "reject", "finish", "cancel"], u = (t, e) => {
208
210
  if (t.classList.contains(e))
209
211
  return t;
210
212
  let o = t.parentNode;
211
213
  for (; o && !o.classList.contains(e); )
212
214
  o = o.parentNode;
213
215
  return o.classList.contains(e) ? o : null;
214
- }, F = {
216
+ }, k = {
215
217
  name: "FormView",
218
+ components: {
219
+ ResizeObserver: y
220
+ },
216
221
  inject: {
217
222
  flowContext: {
218
223
  default: {}
@@ -273,7 +278,7 @@ const p = ["back", "create", "save", "withdraw", "edit", "submit", "publish", "a
273
278
  return this.toolbarProps.buttons.filter((t) => !m.includes(t) && t.indexOf(":down") < 0).map((t) => t.replace(":up", ""));
274
279
  },
275
280
  footerBarButtons() {
276
- let t = this.toolbarProps.buttons.filter((e) => !S.includes(e) && (m.includes(e) || e.indexOf(":down") > -1)).map((e) => e.replace(":down", ""));
281
+ let t = this.toolbarProps.buttons.filter((e) => !F.includes(e) && (m.includes(e) || e.indexOf(":down") > -1)).map((e) => e.replace(":down", ""));
277
282
  return t = t || [], this.$parent.isEnabled && !t.includes("cancel") && t.push("cancel"), t;
278
283
  }
279
284
  },
@@ -306,7 +311,7 @@ const p = ["back", "create", "save", "withdraw", "edit", "submit", "publish", "a
306
311
  return Object.keys(this.$scopedSlots).filter((t) => p.includes(t));
307
312
  },
308
313
  getFooterSlotKeys() {
309
- return Object.keys(this.$scopedSlots).filter((t) => $.includes(t));
314
+ return Object.keys(this.$scopedSlots).filter((t) => S.includes(t));
310
315
  },
311
316
  getFooterSlotKey(t) {
312
317
  return t.replace("-down", "");
@@ -344,23 +349,23 @@ const p = ["back", "create", "save", "withdraw", "edit", "submit", "publish", "a
344
349
  }
345
350
  }
346
351
  }, h = {};
347
- var k = /* @__PURE__ */ y(
348
- F,
349
- w,
352
+ var B = /* @__PURE__ */ w(
353
+ k,
350
354
  x,
355
+ $,
351
356
  !1,
352
- B,
357
+ C,
353
358
  null,
354
359
  null,
355
360
  null
356
361
  );
357
- function B(t) {
362
+ function C(t) {
358
363
  for (let e in h)
359
364
  this[e] = h[e];
360
365
  }
361
- const T = /* @__PURE__ */ function() {
362
- return k.exports;
366
+ const z = /* @__PURE__ */ function() {
367
+ return B.exports;
363
368
  }();
364
369
  export {
365
- T as default
370
+ z as default
366
371
  };