lowcoder-comps 0.0.21 → 0.0.22
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/029c585a.js +825 -0
- package/0f49842f.js +915 -0
- package/14c95def.js +2396 -0
- package/{8219433d.js → 14de54b2.js} +7120 -6939
- package/17b0984b.js +1116 -0
- package/{31b1cdd2.js → 1a4b39ab.js} +29 -30
- package/1e35aee7.js +932 -0
- package/{54511d22.js → 1f97d569.js} +73 -76
- package/3120eee5.js +1235 -0
- package/313e94fb.js +796 -0
- package/{b38c288b.js → 41a4677f.js} +10 -12
- package/{2768fdea.js → 48a69d01.js} +89 -97
- package/4a8006fe.js +2501 -0
- package/{a6e7fb9e.js → 585231df.js} +64 -71
- package/5e96f5d8.js +64 -0
- package/5f9be850.js +1055 -0
- package/{f576ac90.js → 6e0c66a6.js} +97 -109
- package/76d315c1.js +2192 -0
- package/{7c62ef63.js → 867cdd47.js} +1 -1
- package/{3bd738e9.js → 8a65542f.js} +58 -64
- package/913e1a65.js +804 -0
- package/92e85b65.js +65 -0
- package/97298a99.js +2966 -0
- package/{450c6bd6.js → a396e61e.js} +44 -44
- package/a6d42292.js +1284 -0
- package/afd2e4d5.js +86 -0
- package/be5f3226.js +768 -0
- package/{9f3281b9.js → bf75928a.js} +30053 -30574
- package/{ba44e76c.js → bfd01456.js} +4257 -4221
- package/c239ec69.js +1000 -0
- package/e731f493.js +502 -0
- package/ef3524ce.js +960 -0
- package/f5b4a4bc.js +365 -0
- package/{fb09e069.js → fa29410e.js} +598 -622
- package/fbc7bdd4.js +218 -0
- package/index.js +2 -2
- package/package.json +2 -2
- package/04ea1009.js +0 -985
- package/0a1968f4.js +0 -832
- package/3087113d.js +0 -1032
- package/39f71758.js +0 -849
- package/4d1cf087.js +0 -2679
- package/59cbb8ee.js +0 -2456
- package/62c916e0.js +0 -86
- package/74645131.js +0 -1246
- package/75095038.js +0 -159
- package/86a4a706.js +0 -1118
- package/88c87bf8.js +0 -943
- package/8d8e98a7.js +0 -365
- package/9200edf7.js +0 -70
- package/acdad8f2.js +0 -7
- package/cbee3d44.js +0 -607
- package/cc0f1351.js +0 -793
- package/e614be0d.js +0 -91
- package/f40ee59a.js +0 -940
- package/fc5c5300.js +0 -2103
- package/fe636892.js +0 -823
- package/fea654db.js +0 -2827
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { p as St, f as W } from "./
|
|
2
|
-
import { h as S, u as Lt, r as Et, p as _t, l as Tt, d as
|
|
3
|
-
import { h as
|
|
4
|
-
import { a as N, b as at, i as nt, c as _, e as st, d as it, f as Ct, g as It } from "./
|
|
5
|
-
import { l as
|
|
6
|
-
import
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
9
|
-
import "./fea654db.js";
|
|
10
|
-
import "./75095038.js";
|
|
1
|
+
import { p as St, f as W } from "./17b0984b.js";
|
|
2
|
+
import { h as S, u as Lt, r as Et, p as _t, l as Tt, d as M, f as tt, G as Nt } from "./14c95def.js";
|
|
3
|
+
import { h as m, n as P, o as z, p as et, c as J, j as rt, l as R, q as V, r as At } from "./bf75928a.js";
|
|
4
|
+
import { a as N, b as at, i as nt, c as _, e as st, d as it, f as Ct, g as It, s as Bt } from "./1f97d569.js";
|
|
5
|
+
import { l as Mt } from "./867cdd47.js";
|
|
6
|
+
import "./f5b4a4bc.js";
|
|
7
|
+
import "./c239ec69.js";
|
|
8
|
+
import "./97298a99.js";
|
|
11
9
|
import "./2ff2c7a6.js";
|
|
12
10
|
import "./256b619e.js";
|
|
13
11
|
function Dt(r) {
|
|
@@ -15,13 +13,13 @@ function Dt(r) {
|
|
|
15
13
|
throw new Error(r.status + " " + r.statusText);
|
|
16
14
|
return r.text();
|
|
17
15
|
}
|
|
18
|
-
function
|
|
16
|
+
function Rt(r, e) {
|
|
19
17
|
return fetch(r, e).then(Dt);
|
|
20
18
|
}
|
|
21
|
-
function
|
|
22
|
-
return (e, t) =>
|
|
19
|
+
function Gt(r) {
|
|
20
|
+
return (e, t) => Rt(e, t).then((n) => new DOMParser().parseFromString(n, r));
|
|
23
21
|
}
|
|
24
|
-
var
|
|
22
|
+
var Pt = Gt("image/svg+xml"), Y = {
|
|
25
23
|
normal: $t,
|
|
26
24
|
vee: Wt,
|
|
27
25
|
undirected: Vt
|
|
@@ -94,13 +92,13 @@ var H = function(r, e) {
|
|
|
94
92
|
var i = e.node(s);
|
|
95
93
|
return i.id;
|
|
96
94
|
}).style("opacity", 0).each(function(s) {
|
|
97
|
-
var i = e.node(s), o =
|
|
98
|
-
|
|
95
|
+
var i = e.node(s), o = m(this);
|
|
96
|
+
m(this).append("rect");
|
|
99
97
|
var c = o.append("g").attr("class", "label");
|
|
100
98
|
K(c, i, i.clusterLabelPos);
|
|
101
99
|
});
|
|
102
100
|
return n = n.merge(a), n = _(n, e).style("opacity", 1), n.selectAll("rect").each(function(s) {
|
|
103
|
-
var i = e.node(s), o =
|
|
101
|
+
var i = e.node(s), o = m(this);
|
|
104
102
|
N(o, i.style);
|
|
105
103
|
}), n;
|
|
106
104
|
};
|
|
@@ -112,7 +110,7 @@ let X = function(r, e) {
|
|
|
112
110
|
return st(a);
|
|
113
111
|
}).classed("update", !0);
|
|
114
112
|
t.exit().remove(), t.enter().append("g").classed("edgeLabel", !0).style("opacity", 0), t = r.selectAll("g.edgeLabel"), t.each(function(a) {
|
|
115
|
-
var s =
|
|
113
|
+
var s = m(this);
|
|
116
114
|
s.select(".label").remove();
|
|
117
115
|
var i = e.edge(a), o = K(s, e.edge(a), 0).classed("label", !0), c = o.node().getBBox();
|
|
118
116
|
i.labelId && o.attr("id", i.labelId), S(i, "width") || (i.width = c.width), S(i, "height") || (i.height = c.height);
|
|
@@ -133,7 +131,7 @@ var F = function(r, e, t) {
|
|
|
133
131
|
Ot(n, e);
|
|
134
132
|
var s = n.merge !== void 0 ? n.merge(a) : n;
|
|
135
133
|
return _(s, e).style("opacity", 1), s.each(function(i) {
|
|
136
|
-
var o =
|
|
134
|
+
var o = m(this), c = e.edge(i);
|
|
137
135
|
c.elem = this, c.id && o.attr("id", c.id), it(
|
|
138
136
|
o,
|
|
139
137
|
c.class,
|
|
@@ -142,7 +140,7 @@ var F = function(r, e, t) {
|
|
|
142
140
|
}), s.selectAll("path.path").each(function(i) {
|
|
143
141
|
var o = e.edge(i);
|
|
144
142
|
o.arrowheadId = Lt("arrowhead");
|
|
145
|
-
var c =
|
|
143
|
+
var c = m(this).attr("marker-end", function() {
|
|
146
144
|
return "url(" + Qt(location.href, o.arrowheadId) + ")";
|
|
147
145
|
}).style("fill", "none");
|
|
148
146
|
_(c, e).attr("d", function(d) {
|
|
@@ -150,7 +148,7 @@ var F = function(r, e, t) {
|
|
|
150
148
|
}), N(c, o.style);
|
|
151
149
|
}), s.selectAll("defs *").remove(), s.selectAll("defs").each(function(i) {
|
|
152
150
|
var o = e.edge(i), c = t[o.arrowhead];
|
|
153
|
-
c(
|
|
151
|
+
c(m(this), o.arrowheadId, o, "arrowhead");
|
|
154
152
|
}), s;
|
|
155
153
|
};
|
|
156
154
|
function qt(r) {
|
|
@@ -165,7 +163,7 @@ function Jt(r, e) {
|
|
|
165
163
|
return s.unshift(O(n, s[0])), s.push(O(a, s[s.length - 1])), ot(t, s);
|
|
166
164
|
}
|
|
167
165
|
function ot(r, e) {
|
|
168
|
-
var t = (
|
|
166
|
+
var t = (Mt || Pt.line)().x(function(n) {
|
|
169
167
|
return n.x;
|
|
170
168
|
}).y(function(n) {
|
|
171
169
|
return n.y;
|
|
@@ -196,7 +194,7 @@ var q = function(r, e, t) {
|
|
|
196
194
|
return i;
|
|
197
195
|
}).classed("update", !0);
|
|
198
196
|
a.exit().remove(), a.enter().append("g").attr("class", "node").style("opacity", 0), a = r.selectAll("g.node"), a.each(function(i) {
|
|
199
|
-
var o = e.node(i), c =
|
|
197
|
+
var o = e.node(i), c = m(this);
|
|
200
198
|
it(
|
|
201
199
|
c,
|
|
202
200
|
o.class,
|
|
@@ -207,12 +205,12 @@ var q = function(r, e, t) {
|
|
|
207
205
|
"transform",
|
|
208
206
|
"translate(" + (o.paddingLeft - o.paddingRight) / 2 + "," + (o.paddingTop - o.paddingBottom) / 2 + ")"
|
|
209
207
|
);
|
|
210
|
-
var u =
|
|
208
|
+
var u = m(this);
|
|
211
209
|
u.select(".label-container").remove();
|
|
212
210
|
var p = v(u, h, o).classed("label-container", !0);
|
|
213
211
|
N(p, o.style);
|
|
214
|
-
var
|
|
215
|
-
o.width =
|
|
212
|
+
var g = p.node().getBBox();
|
|
213
|
+
o.width = g.width, o.height = g.height;
|
|
216
214
|
});
|
|
217
215
|
var s;
|
|
218
216
|
return a.exit ? s = a.exit() : s = a.selectAll(null), _(s, e).style("opacity", 0).remove(), a;
|
|
@@ -222,7 +220,7 @@ function jt(r) {
|
|
|
222
220
|
}
|
|
223
221
|
function te(r, e) {
|
|
224
222
|
var t = r.filter(function() {
|
|
225
|
-
return !
|
|
223
|
+
return !m(this).classed("update");
|
|
226
224
|
});
|
|
227
225
|
function n(a) {
|
|
228
226
|
var s = e.node(a);
|
|
@@ -242,7 +240,7 @@ function te(r, e) {
|
|
|
242
240
|
}
|
|
243
241
|
function ee(r, e) {
|
|
244
242
|
var t = r.filter(function() {
|
|
245
|
-
return !
|
|
243
|
+
return !m(this).classed("update");
|
|
246
244
|
});
|
|
247
245
|
function n(a) {
|
|
248
246
|
var s = e.edge(a);
|
|
@@ -252,7 +250,7 @@ function ee(r, e) {
|
|
|
252
250
|
}
|
|
253
251
|
function re(r, e) {
|
|
254
252
|
var t = r.filter(function() {
|
|
255
|
-
return !
|
|
253
|
+
return !m(this).classed("update");
|
|
256
254
|
});
|
|
257
255
|
function n(a) {
|
|
258
256
|
var s = e.node(a);
|
|
@@ -270,9 +268,9 @@ function ae(r, e, t) {
|
|
|
270
268
|
return lt(r, e, e, t);
|
|
271
269
|
}
|
|
272
270
|
function ne(r, e, t, n) {
|
|
273
|
-
var a, s, i, o, c, d, l, v, h, u, p,
|
|
271
|
+
var a, s, i, o, c, d, l, v, h, u, p, g, f, y, k;
|
|
274
272
|
if (a = e.y - r.y, i = r.x - e.x, c = e.x * r.y - r.x * e.y, h = a * t.x + i * t.y + c, u = a * n.x + i * n.y + c, !(h !== 0 && u !== 0 && j(h, u)) && (s = n.y - t.y, o = t.x - n.x, d = n.x * t.y - t.x * n.y, l = s * r.x + o * r.y + d, v = s * e.x + o * e.y + d, !(l !== 0 && v !== 0 && j(l, v)) && (p = a * o - s * i, p !== 0)))
|
|
275
|
-
return
|
|
273
|
+
return g = Math.abs(p / 2), f = i * d - o * c, y = f < 0 ? (f - g) / p : (f + g) / p, f = s * c - a * d, k = f < 0 ? (f - g) / p : (f + g) / p, { x: y, y: k };
|
|
276
274
|
}
|
|
277
275
|
function j(r, e) {
|
|
278
276
|
return r * e > 0;
|
|
@@ -291,8 +289,8 @@ function T(r, e, t) {
|
|
|
291
289
|
);
|
|
292
290
|
u && s.push(u);
|
|
293
291
|
}
|
|
294
|
-
return s.length ? (s.length > 1 && s.sort(function(p,
|
|
295
|
-
var f = p.x - t.x, y = p.y - t.y, k = Math.sqrt(f * f + y * y),
|
|
292
|
+
return s.length ? (s.length > 1 && s.sort(function(p, g) {
|
|
293
|
+
var f = p.x - t.x, y = p.y - t.y, k = Math.sqrt(f * f + y * y), I = g.x - t.x, E = g.y - t.y, U = Math.sqrt(I * I + E * E);
|
|
296
294
|
return k < U ? -1 : k === U ? 0 : 1;
|
|
297
295
|
}), s[0]) : (console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", r), r);
|
|
298
296
|
}
|
|
@@ -346,7 +344,7 @@ function ce(r, e, t) {
|
|
|
346
344
|
function de() {
|
|
347
345
|
var r = function(e, t) {
|
|
348
346
|
fe(t);
|
|
349
|
-
var n =
|
|
347
|
+
var n = D(e, "output"), a = D(n, "clusters"), s = D(n, "edgePaths"), i = X(D(n, "edgeLabels"), t), o = q(D(n, "nodes"), t, Q);
|
|
350
348
|
Tt(t), re(o, t), ee(i, t), F(s, t, Y);
|
|
351
349
|
var c = H(a, t);
|
|
352
350
|
te(c, t), pe(t);
|
|
@@ -375,28 +373,28 @@ var he = {
|
|
|
375
373
|
shape: "rect"
|
|
376
374
|
}, ue = {
|
|
377
375
|
arrowhead: "normal",
|
|
378
|
-
curve:
|
|
376
|
+
curve: P
|
|
379
377
|
};
|
|
380
378
|
function fe(r) {
|
|
381
379
|
r.nodes().forEach(function(e) {
|
|
382
380
|
var t = r.node(e);
|
|
383
|
-
!S(t, "label") && !r.children(e).length && (t.label = e), S(t, "paddingX") &&
|
|
381
|
+
!S(t, "label") && !r.children(e).length && (t.label = e), S(t, "paddingX") && M(t, {
|
|
384
382
|
paddingLeft: t.paddingX,
|
|
385
383
|
paddingRight: t.paddingX
|
|
386
|
-
}), S(t, "paddingY") &&
|
|
384
|
+
}), S(t, "paddingY") && M(t, {
|
|
387
385
|
paddingTop: t.paddingY,
|
|
388
386
|
paddingBottom: t.paddingY
|
|
389
|
-
}), S(t, "padding") &&
|
|
387
|
+
}), S(t, "padding") && M(t, {
|
|
390
388
|
paddingLeft: t.padding,
|
|
391
389
|
paddingRight: t.padding,
|
|
392
390
|
paddingTop: t.padding,
|
|
393
391
|
paddingBottom: t.padding
|
|
394
|
-
}),
|
|
392
|
+
}), M(t, he), tt(["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"], function(n) {
|
|
395
393
|
t[n] = Number(t[n]);
|
|
396
394
|
}), S(t, "width") && (t._prevWidth = t.width), S(t, "height") && (t._prevHeight = t.height);
|
|
397
395
|
}), r.edges().forEach(function(e) {
|
|
398
396
|
var t = r.edge(e);
|
|
399
|
-
S(t, "label") || (t.label = ""),
|
|
397
|
+
S(t, "label") || (t.label = ""), M(t, ue);
|
|
400
398
|
});
|
|
401
399
|
}
|
|
402
400
|
function pe(r) {
|
|
@@ -405,7 +403,7 @@ function pe(r) {
|
|
|
405
403
|
S(t, "_prevWidth") ? t.width = t._prevWidth : delete t.width, S(t, "_prevHeight") ? t.height = t._prevHeight : delete t.height, delete t._prevWidth, delete t._prevHeight;
|
|
406
404
|
});
|
|
407
405
|
}
|
|
408
|
-
function
|
|
406
|
+
function D(r, e) {
|
|
409
407
|
var t = r.select("g." + e);
|
|
410
408
|
return t.empty() && (t = r.append("g").attr("class", e)), t;
|
|
411
409
|
}
|
|
@@ -507,7 +505,7 @@ function gt(r, e, t) {
|
|
|
507
505
|
return Z(t, i);
|
|
508
506
|
}, s;
|
|
509
507
|
}
|
|
510
|
-
function
|
|
508
|
+
function wt(r, e, t) {
|
|
511
509
|
const n = e.width, a = e.height, s = [
|
|
512
510
|
{ x: 0, y: 0 },
|
|
513
511
|
{ x: n, y: 0 },
|
|
@@ -524,7 +522,7 @@ function mt(r, e, t) {
|
|
|
524
522
|
return T(t, s, o);
|
|
525
523
|
}, i;
|
|
526
524
|
}
|
|
527
|
-
function
|
|
525
|
+
function xt(r, e, t) {
|
|
528
526
|
const n = e.width, a = n / 2, s = a / (2.5 + n / 50), i = e.height + s, o = "M 0," + s + " a " + a + "," + s + " 0,0,0 " + n + " 0 a " + a + "," + s + " 0,0,0 " + -n + " 0 l 0," + i + " a " + a + "," + s + " 0,0,0 " + n + " 0 l 0," + -i, c = r.attr("label-offset-y", s).insert("path", ":first-child").attr("d", o).attr("transform", "translate(" + -n / 2 + "," + -(i / 2 + s) + ")");
|
|
529
527
|
return t.intersect = function(d) {
|
|
530
528
|
const l = Z(t, d), v = l.x - t.x;
|
|
@@ -536,10 +534,10 @@ function wt(r, e, t) {
|
|
|
536
534
|
}, c;
|
|
537
535
|
}
|
|
538
536
|
function ve(r) {
|
|
539
|
-
r.shapes().question = ct, r.shapes().hexagon = dt, r.shapes().stadium = gt, r.shapes().subroutine =
|
|
537
|
+
r.shapes().question = ct, r.shapes().hexagon = dt, r.shapes().stadium = gt, r.shapes().subroutine = wt, r.shapes().cylinder = xt, r.shapes().rect_left_inv_arrow = ht, r.shapes().lean_right = ut, r.shapes().lean_left = ft, r.shapes().trapezoid = pt, r.shapes().inv_trapezoid = vt, r.shapes().rect_right_inv_arrow = yt;
|
|
540
538
|
}
|
|
541
539
|
function ye(r) {
|
|
542
|
-
r({ question: ct }), r({ hexagon: dt }), r({ stadium: gt }), r({ subroutine:
|
|
540
|
+
r({ question: ct }), r({ hexagon: dt }), r({ stadium: gt }), r({ subroutine: wt }), r({ cylinder: xt }), r({ rect_left_inv_arrow: ht }), r({ lean_right: ut }), r({ lean_left: ft }), r({ trapezoid: pt }), r({ inv_trapezoid: vt }), r({ rect_right_inv_arrow: yt });
|
|
543
541
|
}
|
|
544
542
|
function A(r, e, t, n) {
|
|
545
543
|
return r.insert("polygon", ":first-child").attr(
|
|
@@ -552,12 +550,12 @@ function A(r, e, t, n) {
|
|
|
552
550
|
const ge = {
|
|
553
551
|
addToRender: ve,
|
|
554
552
|
addToRenderV2: ye
|
|
555
|
-
},
|
|
553
|
+
}, mt = {}, we = function(r) {
|
|
556
554
|
const e = Object.keys(r);
|
|
557
555
|
for (const t of e)
|
|
558
|
-
|
|
556
|
+
mt[t] = r[t];
|
|
559
557
|
}, bt = function(r, e, t, n, a, s) {
|
|
560
|
-
const i = n ? n.select(`[id="${t}"]`) :
|
|
558
|
+
const i = n ? n.select(`[id="${t}"]`) : m(`[id="${t}"]`), o = a || document;
|
|
561
559
|
Object.keys(r).forEach(function(d) {
|
|
562
560
|
const l = r[d];
|
|
563
561
|
let v = "default";
|
|
@@ -576,16 +574,16 @@ const ge = {
|
|
|
576
574
|
const y = o.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
577
575
|
y.setAttribute("style", h.labelStyle.replace("color:", "fill:"));
|
|
578
576
|
const k = u.split(rt.lineBreakRegex);
|
|
579
|
-
for (const
|
|
577
|
+
for (const I of k) {
|
|
580
578
|
const E = o.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
581
|
-
E.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), E.setAttribute("dy", "1em"), E.setAttribute("x", "1"), E.textContent =
|
|
579
|
+
E.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), E.setAttribute("dy", "1em"), E.setAttribute("x", "1"), E.textContent = I, y.appendChild(E);
|
|
582
580
|
}
|
|
583
581
|
p = y;
|
|
584
582
|
}
|
|
585
|
-
let
|
|
583
|
+
let g = 0, f = "";
|
|
586
584
|
switch (l.type) {
|
|
587
585
|
case "round":
|
|
588
|
-
|
|
586
|
+
g = 5, f = "rect";
|
|
589
587
|
break;
|
|
590
588
|
case "square":
|
|
591
589
|
f = "rect";
|
|
@@ -635,13 +633,13 @@ const ge = {
|
|
|
635
633
|
default:
|
|
636
634
|
f = "rect";
|
|
637
635
|
}
|
|
638
|
-
|
|
636
|
+
R.warn("Adding node", l.id, l.domId), e.setNode(s.db.lookUpDomId(l.id), {
|
|
639
637
|
labelType: "svg",
|
|
640
638
|
labelStyle: h.labelStyle,
|
|
641
639
|
shape: f,
|
|
642
640
|
label: p,
|
|
643
|
-
rx:
|
|
644
|
-
ry:
|
|
641
|
+
rx: g,
|
|
642
|
+
ry: g,
|
|
645
643
|
class: v,
|
|
646
644
|
style: h.style,
|
|
647
645
|
id: s.db.lookUpDomId(l.id)
|
|
@@ -673,30 +671,20 @@ const ge = {
|
|
|
673
671
|
v = " stroke-width: 3.5px;fill:none";
|
|
674
672
|
break;
|
|
675
673
|
}
|
|
676
|
-
l.style = v, l.labelStyle = h, i.interpolate !== void 0 ? l.curve = V(i.interpolate,
|
|
674
|
+
l.style = v, l.labelStyle = h, i.interpolate !== void 0 ? l.curve = V(i.interpolate, P) : r.defaultInterpolate !== void 0 ? l.curve = V(r.defaultInterpolate, P) : l.curve = V(mt.curve, P), i.text === void 0 ? i.style !== void 0 && (l.arrowheadStyle = "fill: #333") : (l.arrowheadStyle = "fill: #333", l.labelpos = "c", et(J().flowchart.htmlLabels) ? (l.labelType = "html", l.label = `<span id="L-${o}" class="edgeLabel L-${c}' L-${d}" style="${l.labelStyle}">${i.text.replace(
|
|
677
675
|
/fa[blrs]?:fa-[\w-]+/g,
|
|
678
676
|
(u) => `<i class='${u.replace(":", " ")}'></i>`
|
|
679
677
|
)}</span>`) : (l.labelType = "text", l.label = i.text.replace(rt.lineBreakRegex, `
|
|
680
678
|
`), i.style === void 0 && (l.style = l.style || "stroke: #333; stroke-width: 1.5px;fill:none"), l.labelStyle = l.labelStyle.replace("color:", "fill:"))), l.id = o, l.class = c + " " + d, l.minlen = i.length || 1, e.setEdge(t.db.lookUpDomId(i.start), t.db.lookUpDomId(i.end), l, n);
|
|
681
679
|
});
|
|
682
|
-
},
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
} catch (t) {
|
|
687
|
-
return I.error(t), {};
|
|
688
|
-
}
|
|
689
|
-
}, xe = function(r, e, t, n) {
|
|
690
|
-
I.info("Drawing flowchart"), n.db.clear();
|
|
680
|
+
}, xe = function(r, e) {
|
|
681
|
+
return R.info("Extracting classes"), e.db.getClasses();
|
|
682
|
+
}, me = function(r, e, t, n) {
|
|
683
|
+
R.info("Drawing flowchart");
|
|
691
684
|
const { securityLevel: a, flowchart: s } = J();
|
|
692
685
|
let i;
|
|
693
|
-
a === "sandbox" && (i =
|
|
694
|
-
const o = a === "sandbox" ?
|
|
695
|
-
try {
|
|
696
|
-
n.parser.parse(r);
|
|
697
|
-
} catch (g) {
|
|
698
|
-
I.debug("Parsing failed");
|
|
699
|
-
}
|
|
686
|
+
a === "sandbox" && (i = m("#i" + e));
|
|
687
|
+
const o = a === "sandbox" ? m(i.nodes()[0].contentDocument.body) : m("body"), c = a === "sandbox" ? i.nodes()[0].contentDocument : document;
|
|
700
688
|
let d = n.db.getDirection();
|
|
701
689
|
d === void 0 && (d = "TD");
|
|
702
690
|
const l = s.nodeSpacing || 50, v = s.rankSpacing || 50, h = new Nt({
|
|
@@ -713,78 +701,78 @@ const ge = {
|
|
|
713
701
|
});
|
|
714
702
|
let u;
|
|
715
703
|
const p = n.db.getSubGraphs();
|
|
716
|
-
for (let
|
|
717
|
-
u = p[
|
|
718
|
-
const
|
|
719
|
-
|
|
704
|
+
for (let w = p.length - 1; w >= 0; w--)
|
|
705
|
+
u = p[w], n.db.addVertex(u.id, u.title, "group", void 0, u.classes);
|
|
706
|
+
const g = n.db.getVertices();
|
|
707
|
+
R.warn("Get vertices", g);
|
|
720
708
|
const f = n.db.getEdges();
|
|
721
709
|
let y = 0;
|
|
722
710
|
for (y = p.length - 1; y >= 0; y--) {
|
|
723
|
-
u = p[y],
|
|
724
|
-
for (let
|
|
725
|
-
|
|
711
|
+
u = p[y], Bt("cluster").append("text");
|
|
712
|
+
for (let w = 0; w < u.nodes.length; w++)
|
|
713
|
+
R.warn(
|
|
726
714
|
"Setting subgraph",
|
|
727
|
-
u.nodes[
|
|
728
|
-
n.db.lookUpDomId(u.nodes[
|
|
715
|
+
u.nodes[w],
|
|
716
|
+
n.db.lookUpDomId(u.nodes[w]),
|
|
729
717
|
n.db.lookUpDomId(u.id)
|
|
730
|
-
), h.setParent(n.db.lookUpDomId(u.nodes[
|
|
718
|
+
), h.setParent(n.db.lookUpDomId(u.nodes[w]), n.db.lookUpDomId(u.id));
|
|
731
719
|
}
|
|
732
|
-
bt(
|
|
720
|
+
bt(g, h, e, o, c, n), kt(f, h, n);
|
|
733
721
|
const k = new de();
|
|
734
|
-
ge.addToRender(k), k.arrows().none = function(b, L,
|
|
722
|
+
ge.addToRender(k), k.arrows().none = function(b, L, x, B) {
|
|
735
723
|
const C = b.append("marker").attr("id", L).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto").append("path").attr("d", "M 0 0 L 0 0 L 0 0 z");
|
|
736
|
-
N(C,
|
|
724
|
+
N(C, x[B + "Style"]);
|
|
737
725
|
}, k.arrows().normal = function(b, L) {
|
|
738
726
|
b.append("marker").attr("id", L).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowheadPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
739
727
|
};
|
|
740
|
-
const
|
|
728
|
+
const I = o.select(`[id="${e}"]`), E = o.select("#" + e + " g");
|
|
741
729
|
for (k(E, h), E.selectAll("g.node").attr("title", function() {
|
|
742
730
|
return n.db.getTooltip(this.id);
|
|
743
731
|
}), n.db.indexNodes("subGraph" + y), y = 0; y < p.length; y++)
|
|
744
732
|
if (u = p[y], u.title !== "undefined") {
|
|
745
|
-
const
|
|
733
|
+
const w = c.querySelectorAll(
|
|
746
734
|
"#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"] rect'
|
|
747
735
|
), b = c.querySelectorAll(
|
|
748
736
|
"#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"]'
|
|
749
|
-
), L =
|
|
750
|
-
C.attr("transform", `translate(${L +
|
|
737
|
+
), L = w[0].x.baseVal.value, x = w[0].y.baseVal.value, B = w[0].width.baseVal.value, C = m(b[0]).select(".label");
|
|
738
|
+
C.attr("transform", `translate(${L + B / 2}, ${x + 14})`), C.attr("id", e + "Text");
|
|
751
739
|
for (let $ = 0; $ < u.classes.length; $++)
|
|
752
740
|
b[0].classList.add(u.classes[$]);
|
|
753
741
|
}
|
|
754
742
|
if (!s.htmlLabels) {
|
|
755
|
-
const
|
|
756
|
-
for (const b of
|
|
757
|
-
const L = b.getBBox(),
|
|
758
|
-
|
|
743
|
+
const w = c.querySelectorAll('[id="' + e + '"] .edgeLabel .label');
|
|
744
|
+
for (const b of w) {
|
|
745
|
+
const L = b.getBBox(), x = c.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
746
|
+
x.setAttribute("rx", 0), x.setAttribute("ry", 0), x.setAttribute("width", L.width), x.setAttribute("height", L.height), b.insertBefore(x, b.firstChild);
|
|
759
747
|
}
|
|
760
748
|
}
|
|
761
|
-
At(h,
|
|
762
|
-
const b =
|
|
749
|
+
At(h, I, s.diagramPadding, s.useMaxWidth), Object.keys(g).forEach(function(w) {
|
|
750
|
+
const b = g[w];
|
|
763
751
|
if (b.link) {
|
|
764
|
-
const L = o.select("#" + e + ' [id="' + n.db.lookUpDomId(
|
|
752
|
+
const L = o.select("#" + e + ' [id="' + n.db.lookUpDomId(w) + '"]');
|
|
765
753
|
if (L) {
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
const
|
|
769
|
-
return
|
|
770
|
-
}, ":first-child"),
|
|
771
|
-
|
|
772
|
-
return
|
|
754
|
+
const x = c.createElementNS("http://www.w3.org/2000/svg", "a");
|
|
755
|
+
x.setAttributeNS("http://www.w3.org/2000/svg", "class", b.classes.join(" ")), x.setAttributeNS("http://www.w3.org/2000/svg", "href", b.link), x.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), a === "sandbox" ? x.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : b.linkTarget && x.setAttributeNS("http://www.w3.org/2000/svg", "target", b.linkTarget);
|
|
756
|
+
const B = L.insert(function() {
|
|
757
|
+
return x;
|
|
758
|
+
}, ":first-child"), G = L.select(".label-container");
|
|
759
|
+
G && B.append(function() {
|
|
760
|
+
return G.node();
|
|
773
761
|
});
|
|
774
762
|
const C = L.select(".label");
|
|
775
|
-
C &&
|
|
763
|
+
C && B.append(function() {
|
|
776
764
|
return C.node();
|
|
777
765
|
});
|
|
778
766
|
}
|
|
779
767
|
}
|
|
780
768
|
});
|
|
781
769
|
}, be = {
|
|
782
|
-
setConf:
|
|
770
|
+
setConf: we,
|
|
783
771
|
addVertices: bt,
|
|
784
772
|
addEdges: kt,
|
|
785
|
-
getClasses:
|
|
786
|
-
draw:
|
|
787
|
-
},
|
|
773
|
+
getClasses: xe,
|
|
774
|
+
draw: me
|
|
775
|
+
}, Be = {
|
|
788
776
|
parser: St,
|
|
789
777
|
db: W,
|
|
790
778
|
renderer: Ct,
|
|
@@ -794,5 +782,5 @@ const ge = {
|
|
|
794
782
|
}
|
|
795
783
|
};
|
|
796
784
|
export {
|
|
797
|
-
|
|
785
|
+
Be as diagram
|
|
798
786
|
};
|