@web-utils/component 2.9.8 → 2.9.10

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,56 +1,61 @@
1
- var _ = Object.defineProperty, v = Object.defineProperties;
2
- var y = Object.getOwnPropertyDescriptors;
3
- var c = Object.getOwnPropertySymbols;
4
- var b = Object.prototype.hasOwnProperty, V = Object.prototype.propertyIsEnumerable;
5
- var u = (e, t, i) => t in e ? _(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, g = (e, t) => {
6
- for (var i in t || (t = {}))
7
- b.call(t, i) && u(e, i, t[i]);
8
- if (c)
9
- for (var i of c(t))
10
- V.call(t, i) && u(e, i, t[i]);
1
+ var k = Object.defineProperty, b = Object.defineProperties;
2
+ var M = Object.getOwnPropertyDescriptors;
3
+ var f = Object.getOwnPropertySymbols;
4
+ var x = Object.prototype.hasOwnProperty, V = Object.prototype.propertyIsEnumerable;
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
+ if (f)
9
+ for (var t of f(i))
10
+ V.call(i, t) && u(e, t, i[t]);
11
11
  return e;
12
- }, f = (e, t) => v(e, y(t));
13
- var d = (e, t, i) => new Promise((n, o) => {
14
- var l = (r) => {
12
+ }, y = (e, i) => b(e, M(i));
13
+ var v = (e, i, t) => new Promise((l, o) => {
14
+ var h = (r) => {
15
15
  try {
16
- a(i.next(r));
17
- } catch (m) {
18
- o(m);
16
+ a(t.next(r));
17
+ } catch (n) {
18
+ o(n);
19
19
  }
20
- }, h = (r) => {
20
+ }, s = (r) => {
21
21
  try {
22
- a(i.throw(r));
23
- } catch (m) {
24
- o(m);
22
+ a(t.throw(r));
23
+ } catch (n) {
24
+ o(n);
25
25
  }
26
- }, a = (r) => r.done ? n(r.value) : Promise.resolve(r.value).then(l, h);
27
- a((i = i.apply(e, t)).next());
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 x from "bpmn-js/lib/NavigatedViewer";
30
- import s from "diagram-js/lib/navigation/zoomscroll/ZoomScroll";
31
- import F from "@web-utils/component/easy-popup";
29
+ import $ from "bpmn-js/lib/NavigatedViewer";
30
+ import d from "diagram-js/lib/navigation/zoomscroll/ZoomScroll";
31
+ import { create as c, attr as m, append as p } from "tiny-svg";
32
+ import { query as E } from "min-dom";
33
+ import S from "@web-utils/component/easy-popup";
32
34
  import "@web-utils/component/easy-popup/style.css";
33
- import { n as M } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
34
- var $ = function() {
35
- var e = this, t = e.$createElement, i = e._self._c || t;
36
- return i("div", {
35
+ import { n as F } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
36
+ var A = function() {
37
+ var e = this, i = e.$createElement, t = e._self._c || i;
38
+ return t("div", {
37
39
  ref: "container",
38
- staticClass: "flow-viewer flow-background-image"
39
- }, [i("EasyPopup", {
40
+ staticClass: "flow-viewer flow-background-image",
41
+ style: {
42
+ "--highlight-color": e.highlightColor
43
+ }
44
+ }, [t("EasyPopup", {
40
45
  ref: "popup"
41
46
  }, [e._t("default", function() {
42
47
  return [e._v(" " + e._s(e.element) + " ")];
43
48
  }, {
44
49
  element: e.element
45
50
  })], 2)], 1);
46
- }, S = [];
47
- const p = s.prototype._handleWheel, k = {
51
+ }, B = [];
52
+ const g = d.prototype._handleWheel, W = {
48
53
  __init__: ["zoomScroll"],
49
- zoomScroll: ["type", s]
50
- }, A = {
54
+ zoomScroll: ["type", d]
55
+ }, X = {
51
56
  name: "FlowViewer",
52
57
  components: {
53
- EasyPopup: F
58
+ EasyPopup: S
54
59
  },
55
60
  props: {
56
61
  xml: {
@@ -64,10 +69,14 @@ const p = s.prototype._handleWheel, k = {
64
69
  type: Array,
65
70
  default: () => []
66
71
  },
67
- flows: {
72
+ historicActivities: {
68
73
  type: Array,
69
74
  default: () => []
70
75
  },
76
+ highlightColor: {
77
+ type: String,
78
+ default: "rgb(0 190 0 / 100%)"
79
+ },
71
80
  ctrlKey: Boolean
72
81
  },
73
82
  data() {
@@ -77,76 +86,105 @@ const p = s.prototype._handleWheel, k = {
77
86
  },
78
87
  watch: {
79
88
  xml(e) {
80
- var t;
81
- (t = this.bpmnViewer) == null || t.importXML(e);
82
- },
83
- activities: "highlightActivity",
84
- flows: "highlightFlow"
89
+ var i;
90
+ (i = this.bpmnViewer) == null || i.importXML(e);
91
+ }
85
92
  },
86
93
  mounted() {
87
- s.prototype._handleWheel = this.ctrlKey ? p : function(e) {
88
- const { target: t, deltaMode: i, clientX: n, clientY: o, deltaX: l, deltaY: h } = e;
89
- p.call(this, {
90
- target: t,
91
- deltaMode: i,
92
- clientX: n,
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
+ g.call(this, {
97
+ target: i,
98
+ deltaMode: t,
99
+ clientX: l,
93
100
  clientY: o,
94
- deltaX: l,
95
- deltaY: h,
101
+ deltaX: h,
102
+ deltaY: s,
96
103
  preventDefault() {
97
104
  e.preventDefault();
98
105
  },
99
106
  ctrlKey: !0
100
107
  });
101
- }, this.bpmnViewer = new x(f(g({}, this.options), {
108
+ }, this.bpmnViewer = new $(y(w({}, this.options), {
102
109
  container: this.$refs.container,
103
- additionalModules: [k]
110
+ additionalModules: [W]
104
111
  })), this.bpmnViewer.on("import.done", (e) => {
105
- const t = e.error, i = e.warnings;
106
- 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");
107
- const n = this.bpmnViewer.get("eventBus");
108
- n.on("element.mousemove", (o) => d(this, null, function* () {
109
- o.element.type === "bpmn:UserTask" && (this.$emit("node-mousemove", o.element), this.element = o.element, yield this.$nextTick(), this.$refs.popup.show(o.originalEvent));
110
- })), n.on("element.out", () => {
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) => v(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", () => {
111
118
  this.$refs.popup.hide(), this.element = {};
112
- }), this.highlightFlow(this.flows), this.highlightActivity(this.activities);
113
- }), this.bpmnViewer.importXML(this.xml);
119
+ }), this.highlightFlow(this.historicActivities, this.activities);
120
+ const o = c("marker");
121
+ m(o, {
122
+ id: "sequenceflow-arrow-green",
123
+ viewBox: "0 0 20 20",
124
+ refX: "11",
125
+ refY: "10",
126
+ markerWidth: "10",
127
+ markerHeight: "10",
128
+ orient: "auto"
129
+ });
130
+ const h = c("path");
131
+ m(h, {
132
+ d: "M 1 5 L 11 10 L 1 15 Z",
133
+ style: "stroke-linecap: round; stroke-linejoin: round; stroke: var(--highlight-color); stroke-width: 1px; fill: var(--highlight-color);"
134
+ }), p(o, h);
135
+ const s = c("marker");
136
+ m(s, {
137
+ id: "conditional-default-flow-marker-green",
138
+ viewBox: "0 0 20 20",
139
+ refX: "0",
140
+ refY: "10",
141
+ markerWidth: "10",
142
+ markerHeight: "10",
143
+ orient: "auto"
144
+ });
145
+ const a = c("path");
146
+ m(a, {
147
+ d: "M 6 4 L 10 16",
148
+ style: "stroke-linecap: round; stroke-linejoin: round; stroke: var(--highlight-color); stroke-width: 2px; fill: var(--highlight-color);"
149
+ }), p(s, a);
150
+ const r = E("defs", this.$el);
151
+ p(r, o), p(r, s);
152
+ }), this.bpmnViewer.importXML(this.xml), this.$watch(() => ({
153
+ activities: this.activities,
154
+ historicActivities: this.historicActivities
155
+ }), ({ activities: e, historicActivities: i }) => {
156
+ this.highlightFlow(i, e);
157
+ });
114
158
  },
115
159
  beforeDestroy() {
116
160
  var e;
117
- s.prototype._handleWheel = p, (e = this.bpmnViewer) == null || e.destroy();
161
+ d.prototype._handleWheel = g, (e = this.bpmnViewer) == null || e.destroy();
118
162
  },
119
163
  methods: {
120
- highlight(e, t, i) {
121
- this.elementRegistry.getAll().forEach((n) => {
122
- n.type === t && (e.includes(n.id) ? this.canvas.addMarker(n, i) : this.canvas.removeMarker(n, i));
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) && !e.includes(t.id) ? this.canvas.addMarker(t, "highlight-current") : this.canvas.removeMarker(t, "highlight-current"));
123
167
  });
124
- },
125
- highlightFlow(e) {
126
- this.highlight(e, "bpmn:SequenceFlow", "highlight-line");
127
- },
128
- highlightActivity(e) {
129
- this.highlight(e, "bpmn:UserTask", "highlight");
130
168
  }
131
169
  }
132
- }, w = {};
133
- var E = /* @__PURE__ */ M(
170
+ }, _ = {};
171
+ var C = /* @__PURE__ */ F(
172
+ X,
134
173
  A,
135
- $,
136
- S,
137
- !1,
138
174
  B,
175
+ !1,
176
+ L,
139
177
  null,
140
178
  null,
141
179
  null
142
180
  );
143
- function B(e) {
144
- for (let t in w)
145
- this[t] = w[t];
181
+ function L(e) {
182
+ for (let i in _)
183
+ this[i] = _[i];
146
184
  }
147
- const j = /* @__PURE__ */ function() {
148
- return E.exports;
185
+ const P = /* @__PURE__ */ function() {
186
+ return C.exports;
149
187
  }();
150
188
  export {
151
- j as default
189
+ P as default
152
190
  };
@@ -1 +1 @@
1
- .flow-viewer{width:100%;height:400px}.flow-viewer .highlight:not(.djs-connection) .djs-visual>:nth-child(1){fill:#fbe9d1!important}.flow-viewer .highlight g.djs-visual>:nth-child(1){stroke:#d67e7d!important}.flow-viewer .highlight-line g.djs-visual>:nth-child(1){stroke:#00be00!important}
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@web-utils/component",
3
3
  "description": "Web Components",
4
- "version": "2.9.8",
4
+ "version": "2.9.10",
5
5
  "author": "Simple",
6
6
  "license": "MIT",
7
7
  "type": "module",
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.8",
5
+ "version": "2.9.10",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "description-markup": "markdown",
@@ -2605,13 +2605,21 @@
2605
2605
  "default": "[]"
2606
2606
  },
2607
2607
  {
2608
- "name": "flows",
2608
+ "name": "historicActivities",
2609
2609
  "value": {
2610
2610
  "kind": "expression",
2611
2611
  "type": "array"
2612
2612
  },
2613
2613
  "default": "[]"
2614
2614
  },
2615
+ {
2616
+ "name": "highlightColor",
2617
+ "value": {
2618
+ "kind": "expression",
2619
+ "type": "string"
2620
+ },
2621
+ "default": "'rgb(0 190 0 / 100%)'"
2622
+ },
2615
2623
  {
2616
2624
  "name": "ctrlKey",
2617
2625
  "value": {