lowcoder-comps 0.0.17 → 0.0.19
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/README.md +27 -0
- package/index.html +26 -0
- package/index.tsx +19 -0
- package/jest.config.js +6 -0
- package/package.json +4 -5
- package/src/__test__/allComp.test.tsx +61 -0
- package/src/app-env.d.ts +3 -0
- package/src/comps/calendarComp/calendarComp.tsx +443 -0
- package/src/comps/calendarComp/calendarConstants.tsx +898 -0
- package/src/comps/chartComp/chartComp.tsx +356 -0
- package/src/comps/chartComp/chartConfigs/barChartConfig.tsx +51 -0
- package/src/comps/chartComp/chartConfigs/cartesianAxisConfig.tsx +307 -0
- package/src/comps/chartComp/chartConfigs/chartUrls.tsx +9 -0
- package/src/comps/chartComp/chartConfigs/legendConfig.tsx +55 -0
- package/src/comps/chartComp/chartConfigs/lineChartConfig.tsx +96 -0
- package/src/comps/chartComp/chartConfigs/pieChartConfig.tsx +83 -0
- package/src/comps/chartComp/chartConfigs/scatterChartConfig.tsx +62 -0
- package/src/comps/chartComp/chartConstants.tsx +288 -0
- package/src/comps/chartComp/chartPropertyView.tsx +218 -0
- package/src/comps/chartComp/chartUtils.ts +291 -0
- package/src/comps/chartComp/reactEcharts/core.tsx +194 -0
- package/src/comps/chartComp/reactEcharts/index.ts +21 -0
- package/src/comps/chartComp/reactEcharts/types.ts +76 -0
- package/src/comps/chartComp/seriesComp.tsx +119 -0
- package/src/comps/imageEditorComp/imageEditorClass.tsx +52 -0
- package/src/comps/imageEditorComp/imageEditorConstants.tsx +109 -0
- package/src/comps/imageEditorComp/index.tsx +184 -0
- package/src/comps/mermaidComp/index.tsx +44 -0
- package/src/comps/mermaidComp/mermaid.tsx +29 -0
- package/src/global.ts +1 -0
- package/src/i18n/comps/index.tsx +29 -0
- package/src/i18n/comps/locales/en.ts +150 -0
- package/src/i18n/comps/locales/enObj.tsx +198 -0
- package/src/i18n/comps/locales/index.ts +7 -0
- package/src/i18n/comps/locales/types.tsx +10 -0
- package/src/i18n/comps/locales/zh.ts +145 -0
- package/src/i18n/comps/locales/zhObj.tsx +4 -0
- package/src/index.ts +11 -0
- package/tsconfig.json +22 -0
- package/vite.config.js +10 -0
- package/001f8b13.js +0 -326
- package/085bf0c2.js +0 -46688
- package/256b619e.js +0 -92
- package/29cba276.js +0 -91
- package/2e18581a.js +0 -451
- package/2ff2c7a6.js +0 -6
- package/340c33ea.js +0 -1602
- package/3ad55ad7.js +0 -607
- package/47b0b0ff.js +0 -70
- package/4a5b6fbe.js +0 -798
- package/4abe140e.js +0 -943
- package/4cf5b178.js +0 -34
- package/5cab7b96.js +0 -18619
- package/626b9013.js +0 -7
- package/6798500f.js +0 -793
- package/68b021d0.js +0 -2456
- package/6ab1612a.js +0 -24
- package/6e903063.js +0 -940
- package/72a7048f.js +0 -849
- package/7902f186.js +0 -823
- package/82c1c410.js +0 -86
- package/8517f7c1.js +0 -365
- package/9495ef3b.js +0 -1118
- package/9ea1ddd6.js +0 -447
- package/a01c9944.js +0 -212
- package/a4ce7e8a.js +0 -2827
- package/ad68bdd0.js +0 -236
- package/b499e5a9.js +0 -2103
- package/bdc7b18a.js +0 -1032
- package/be5b66cd.js +0 -832
- package/c4378831.js +0 -117175
- package/ca8f4e3f.js +0 -275
- package/de61c633.js +0 -2679
- package/e04788e2.js +0 -159
- package/f9637058.js +0 -16
- package/f9a47b7c.js +0 -985
- package/ff16c2ec.js +0 -1246
- package/index.js +0 -5
package/256b619e.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
var E = Math.pow;
|
|
2
|
-
const c = Math.PI, x = 2 * c, u = 1e-6, A = x - u;
|
|
3
|
-
function T(e) {
|
|
4
|
-
this._ += e[0];
|
|
5
|
-
for (let t = 1, h = e.length; t < h; ++t)
|
|
6
|
-
this._ += arguments[t] + e[t];
|
|
7
|
-
}
|
|
8
|
-
function L(e) {
|
|
9
|
-
let t = Math.floor(e);
|
|
10
|
-
if (!(t >= 0))
|
|
11
|
-
throw new Error(`invalid digits: ${e}`);
|
|
12
|
-
if (t > 15)
|
|
13
|
-
return T;
|
|
14
|
-
const h = E(10, t);
|
|
15
|
-
return function(i) {
|
|
16
|
-
this._ += i[0];
|
|
17
|
-
for (let s = 1, n = i.length; s < n; ++s)
|
|
18
|
-
this._ += Math.round(arguments[s] * h) / h + i[s];
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
class P {
|
|
22
|
-
constructor(t) {
|
|
23
|
-
this._x0 = this._y0 = // start of current subpath
|
|
24
|
-
this._x1 = this._y1 = null, this._ = "", this._append = t == null ? T : L(t);
|
|
25
|
-
}
|
|
26
|
-
moveTo(t, h) {
|
|
27
|
-
this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +h}`;
|
|
28
|
-
}
|
|
29
|
-
closePath() {
|
|
30
|
-
this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`);
|
|
31
|
-
}
|
|
32
|
-
lineTo(t, h) {
|
|
33
|
-
this._append`L${this._x1 = +t},${this._y1 = +h}`;
|
|
34
|
-
}
|
|
35
|
-
quadraticCurveTo(t, h, i, s) {
|
|
36
|
-
this._append`Q${+t},${+h},${this._x1 = +i},${this._y1 = +s}`;
|
|
37
|
-
}
|
|
38
|
-
bezierCurveTo(t, h, i, s, n, $) {
|
|
39
|
-
this._append`C${+t},${+h},${+i},${+s},${this._x1 = +n},${this._y1 = +$}`;
|
|
40
|
-
}
|
|
41
|
-
arcTo(t, h, i, s, n) {
|
|
42
|
-
if (t = +t, h = +h, i = +i, s = +s, n = +n, n < 0)
|
|
43
|
-
throw new Error(`negative radius: ${n}`);
|
|
44
|
-
let $ = this._x1, r = this._y1, p = i - t, l = s - h, _ = $ - t, o = r - h, a = _ * _ + o * o;
|
|
45
|
-
if (this._x1 === null)
|
|
46
|
-
this._append`M${this._x1 = t},${this._y1 = h}`;
|
|
47
|
-
else if (a > u)
|
|
48
|
-
if (!(Math.abs(o * p - l * _) > u) || !n)
|
|
49
|
-
this._append`L${this._x1 = t},${this._y1 = h}`;
|
|
50
|
-
else {
|
|
51
|
-
let d = i - $, f = s - r, y = p * p + l * l, m = d * d + f * f, g = Math.sqrt(y), v = Math.sqrt(a), w = n * Math.tan((c - Math.acos((y + a - m) / (2 * g * v))) / 2), M = w / v, b = w / g;
|
|
52
|
-
Math.abs(M - 1) > u && this._append`L${t + M * _},${h + M * o}`, this._append`A${n},${n},0,0,${+(o * d > _ * f)},${this._x1 = t + b * p},${this._y1 = h + b * l}`;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
arc(t, h, i, s, n, $) {
|
|
56
|
-
if (t = +t, h = +h, i = +i, $ = !!$, i < 0)
|
|
57
|
-
throw new Error(`negative radius: ${i}`);
|
|
58
|
-
let r = i * Math.cos(s), p = i * Math.sin(s), l = t + r, _ = h + p, o = 1 ^ $, a = $ ? s - n : n - s;
|
|
59
|
-
this._x1 === null ? this._append`M${l},${_}` : (Math.abs(this._x1 - l) > u || Math.abs(this._y1 - _) > u) && this._append`L${l},${_}`, i && (a < 0 && (a = a % x + x), a > A ? this._append`A${i},${i},0,1,${o},${t - r},${h - p}A${i},${i},0,1,${o},${this._x1 = l},${this._y1 = _}` : a > u && this._append`A${i},${i},0,${+(a >= c)},${o},${this._x1 = t + i * Math.cos(n)},${this._y1 = h + i * Math.sin(n)}`);
|
|
60
|
-
}
|
|
61
|
-
rect(t, h, i, s) {
|
|
62
|
-
this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +h}h${i = +i}v${+s}h${-i}Z`;
|
|
63
|
-
}
|
|
64
|
-
toString() {
|
|
65
|
-
return this._;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function C(e) {
|
|
69
|
-
return function() {
|
|
70
|
-
return e;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
function R(e) {
|
|
74
|
-
let t = 3;
|
|
75
|
-
return e.digits = function(h) {
|
|
76
|
-
if (!arguments.length)
|
|
77
|
-
return t;
|
|
78
|
-
if (h == null)
|
|
79
|
-
t = null;
|
|
80
|
-
else {
|
|
81
|
-
const i = Math.floor(h);
|
|
82
|
-
if (!(i >= 0))
|
|
83
|
-
throw new RangeError(`invalid digits: ${h}`);
|
|
84
|
-
t = i;
|
|
85
|
-
}
|
|
86
|
-
return e;
|
|
87
|
-
}, () => new P(t);
|
|
88
|
-
}
|
|
89
|
-
export {
|
|
90
|
-
C as c,
|
|
91
|
-
R as w
|
|
92
|
-
};
|
package/29cba276.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { p as N, d as M, s as W } from "./bdc7b18a.js";
|
|
2
|
-
import { c as S, l as d, h as u, i as H } from "./c4378831.js";
|
|
3
|
-
import { G as X, l as Y } from "./de61c633.js";
|
|
4
|
-
import { s as l } from "./e04788e2.js";
|
|
5
|
-
import "./4cf5b178.js";
|
|
6
|
-
import "./2ff2c7a6.js";
|
|
7
|
-
import "./256b619e.js";
|
|
8
|
-
let h = {};
|
|
9
|
-
const g = 20, p = function(e) {
|
|
10
|
-
const s = Object.entries(h).find((k) => k[1].label === e);
|
|
11
|
-
if (s)
|
|
12
|
-
return s[0];
|
|
13
|
-
}, Z = function(e) {
|
|
14
|
-
e.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"), e.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
15
|
-
}, D = function(e, s, k, a) {
|
|
16
|
-
const c = S().class;
|
|
17
|
-
h = {}, d.info("Rendering diagram " + e);
|
|
18
|
-
const L = S().securityLevel;
|
|
19
|
-
let y;
|
|
20
|
-
L === "sandbox" && (y = u("#i" + s));
|
|
21
|
-
const x = L === "sandbox" ? u(y.nodes()[0].contentDocument.body) : u("body"), n = x.select(`[id='${s}']`);
|
|
22
|
-
Z(n);
|
|
23
|
-
const r = new X({
|
|
24
|
-
multigraph: !0
|
|
25
|
-
});
|
|
26
|
-
r.setGraph({
|
|
27
|
-
isMultiGraph: !0
|
|
28
|
-
}), r.setDefaultEdgeLabel(function() {
|
|
29
|
-
return {};
|
|
30
|
-
});
|
|
31
|
-
const m = a.db.getClasses(), $ = Object.keys(m);
|
|
32
|
-
for (const t of $) {
|
|
33
|
-
const o = m[t], i = l.drawClass(n, o, c, a);
|
|
34
|
-
h[i.id] = i, r.setNode(i.id, i), d.info("Org height: " + i.height);
|
|
35
|
-
}
|
|
36
|
-
a.db.getRelations().forEach(function(t) {
|
|
37
|
-
d.info(
|
|
38
|
-
"tjoho" + p(t.id1) + p(t.id2) + JSON.stringify(t)
|
|
39
|
-
), r.setEdge(
|
|
40
|
-
p(t.id1),
|
|
41
|
-
p(t.id2),
|
|
42
|
-
{
|
|
43
|
-
relation: t
|
|
44
|
-
},
|
|
45
|
-
t.title || "DEFAULT"
|
|
46
|
-
);
|
|
47
|
-
}), a.db.getNotes().forEach(function(t) {
|
|
48
|
-
d.debug(`Adding note: ${JSON.stringify(t)}`);
|
|
49
|
-
const o = l.drawNote(n, t, c, a);
|
|
50
|
-
h[o.id] = o, r.setNode(o.id, o), t.class && t.class in m && r.setEdge(
|
|
51
|
-
t.id,
|
|
52
|
-
p(t.class),
|
|
53
|
-
{
|
|
54
|
-
relation: {
|
|
55
|
-
id1: t.id,
|
|
56
|
-
id2: t.class,
|
|
57
|
-
relation: {
|
|
58
|
-
type1: "none",
|
|
59
|
-
type2: "none",
|
|
60
|
-
lineType: 10
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"DEFAULT"
|
|
65
|
-
);
|
|
66
|
-
}), Y(r), r.nodes().forEach(function(t) {
|
|
67
|
-
t !== void 0 && r.node(t) !== void 0 && (d.debug("Node " + t + ": " + JSON.stringify(r.node(t))), x.select("#" + (a.db.lookUpDomId(t) || t)).attr(
|
|
68
|
-
"transform",
|
|
69
|
-
"translate(" + (r.node(t).x - r.node(t).width / 2) + "," + (r.node(t).y - r.node(t).height / 2) + " )"
|
|
70
|
-
));
|
|
71
|
-
}), r.edges().forEach(function(t) {
|
|
72
|
-
t !== void 0 && r.edge(t) !== void 0 && (d.debug("Edge " + t.v + " -> " + t.w + ": " + JSON.stringify(r.edge(t))), l.drawEdge(n, r.edge(t), r.edge(t).relation, c, a));
|
|
73
|
-
});
|
|
74
|
-
const f = n.node().getBBox(), E = f.width + g * 2, b = f.height + g * 2;
|
|
75
|
-
H(n, b, E, c.useMaxWidth);
|
|
76
|
-
const w = `${f.x - g} ${f.y - g} ${E} ${b}`;
|
|
77
|
-
d.debug(`viewBox ${w}`), n.attr("viewBox", w);
|
|
78
|
-
}, B = {
|
|
79
|
-
draw: D
|
|
80
|
-
}, R = {
|
|
81
|
-
parser: N,
|
|
82
|
-
db: M,
|
|
83
|
-
renderer: B,
|
|
84
|
-
styles: W,
|
|
85
|
-
init: (e) => {
|
|
86
|
-
e.class || (e.class = {}), e.class.arrowMarkerAbsolute = e.arrowMarkerAbsolute, M.clear();
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
export {
|
|
90
|
-
R as diagram
|
|
91
|
-
};
|
package/2e18581a.js
DELETED
|
@@ -1,451 +0,0 @@
|
|
|
1
|
-
var I = (e, l, s) => new Promise((a, i) => {
|
|
2
|
-
var p = (c) => {
|
|
3
|
-
try {
|
|
4
|
-
o(s.next(c));
|
|
5
|
-
} catch (r) {
|
|
6
|
-
i(r);
|
|
7
|
-
}
|
|
8
|
-
}, f = (c) => {
|
|
9
|
-
try {
|
|
10
|
-
o(s.throw(c));
|
|
11
|
-
} catch (r) {
|
|
12
|
-
i(r);
|
|
13
|
-
}
|
|
14
|
-
}, o = (c) => c.done ? a(c.value) : Promise.resolve(c.value).then(p, f);
|
|
15
|
-
o((s = s.apply(e, l)).next());
|
|
16
|
-
});
|
|
17
|
-
import { i as q, G as M } from "./de61c633.js";
|
|
18
|
-
import { _ as R, C as F, v as U, p as N, l as w, q as H, c as C, j as G, r as $, o as E, h as _, x as W, t as X, y as J } from "./c4378831.js";
|
|
19
|
-
import { f as K } from "./9495ef3b.js";
|
|
20
|
-
import { r as Q } from "./8517f7c1.js";
|
|
21
|
-
import { s as Y } from "./626b9013.js";
|
|
22
|
-
const Z = (e, l) => R.lang.round(F.parse(e)[l]), j = Z;
|
|
23
|
-
function ue(e, l) {
|
|
24
|
-
return !!e.children(l).length;
|
|
25
|
-
}
|
|
26
|
-
function we(e) {
|
|
27
|
-
return L(e.v) + ":" + L(e.w) + ":" + L(e.name);
|
|
28
|
-
}
|
|
29
|
-
var O = /:/g;
|
|
30
|
-
function L(e) {
|
|
31
|
-
return e ? String(e).replace(O, "\\:") : "";
|
|
32
|
-
}
|
|
33
|
-
function ee(e, l) {
|
|
34
|
-
l && e.attr("style", l);
|
|
35
|
-
}
|
|
36
|
-
function he(e, l, s) {
|
|
37
|
-
l && e.attr("class", l).attr("class", s + " " + e.attr("class"));
|
|
38
|
-
}
|
|
39
|
-
function ye(e, l) {
|
|
40
|
-
var s = l.graph();
|
|
41
|
-
if (q(s)) {
|
|
42
|
-
var a = s.transition;
|
|
43
|
-
if (U(a))
|
|
44
|
-
return a(e);
|
|
45
|
-
}
|
|
46
|
-
return e;
|
|
47
|
-
}
|
|
48
|
-
function te(e, l) {
|
|
49
|
-
var s = e.append("foreignObject").attr("width", "100000"), a = s.append("xhtml:div");
|
|
50
|
-
a.attr("xmlns", "http://www.w3.org/1999/xhtml");
|
|
51
|
-
var i = l.label;
|
|
52
|
-
switch (typeof i) {
|
|
53
|
-
case "function":
|
|
54
|
-
a.insert(i);
|
|
55
|
-
break;
|
|
56
|
-
case "object":
|
|
57
|
-
a.insert(function() {
|
|
58
|
-
return i;
|
|
59
|
-
});
|
|
60
|
-
break;
|
|
61
|
-
default:
|
|
62
|
-
a.html(i);
|
|
63
|
-
}
|
|
64
|
-
ee(a, l.labelStyle), a.style("display", "inline-block"), a.style("white-space", "nowrap");
|
|
65
|
-
var p = a.node().getBoundingClientRect();
|
|
66
|
-
return s.attr("width", p.width).attr("height", p.height), s;
|
|
67
|
-
}
|
|
68
|
-
const z = {}, re = function(e) {
|
|
69
|
-
const l = Object.keys(e);
|
|
70
|
-
for (const s of l)
|
|
71
|
-
z[s] = e[s];
|
|
72
|
-
}, P = function(e, l, s, a, i, p) {
|
|
73
|
-
const f = a.select(`[id="${s}"]`);
|
|
74
|
-
Object.keys(e).forEach(function(c) {
|
|
75
|
-
const r = e[c];
|
|
76
|
-
let g = "default";
|
|
77
|
-
r.classes.length > 0 && (g = r.classes.join(" ")), g = g + " flowchart-label";
|
|
78
|
-
const h = N(r.styles);
|
|
79
|
-
let t = r.text !== void 0 ? r.text : r.id, d;
|
|
80
|
-
if (w.info("vertex", r, r.labelType), r.labelType === "markdown")
|
|
81
|
-
w.info("vertex", r, r.labelType);
|
|
82
|
-
else if (H(C().flowchart.htmlLabels)) {
|
|
83
|
-
const m = {
|
|
84
|
-
label: t.replace(
|
|
85
|
-
/fa[blrs]?:fa-[\w-]+/g,
|
|
86
|
-
(k) => `<i class='${k.replace(":", " ")}'></i>`
|
|
87
|
-
)
|
|
88
|
-
};
|
|
89
|
-
d = te(f, m).node(), d.parentNode.removeChild(d);
|
|
90
|
-
} else {
|
|
91
|
-
const m = i.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
92
|
-
m.setAttribute("style", h.labelStyle.replace("color:", "fill:"));
|
|
93
|
-
const k = t.split(G.lineBreakRegex);
|
|
94
|
-
for (const T of k) {
|
|
95
|
-
const v = i.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
96
|
-
v.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), v.setAttribute("dy", "1em"), v.setAttribute("x", "1"), v.textContent = T, m.appendChild(v);
|
|
97
|
-
}
|
|
98
|
-
d = m;
|
|
99
|
-
}
|
|
100
|
-
let b = 0, n = "";
|
|
101
|
-
switch (r.type) {
|
|
102
|
-
case "round":
|
|
103
|
-
b = 5, n = "rect";
|
|
104
|
-
break;
|
|
105
|
-
case "square":
|
|
106
|
-
n = "rect";
|
|
107
|
-
break;
|
|
108
|
-
case "diamond":
|
|
109
|
-
n = "question";
|
|
110
|
-
break;
|
|
111
|
-
case "hexagon":
|
|
112
|
-
n = "hexagon";
|
|
113
|
-
break;
|
|
114
|
-
case "odd":
|
|
115
|
-
n = "rect_left_inv_arrow";
|
|
116
|
-
break;
|
|
117
|
-
case "lean_right":
|
|
118
|
-
n = "lean_right";
|
|
119
|
-
break;
|
|
120
|
-
case "lean_left":
|
|
121
|
-
n = "lean_left";
|
|
122
|
-
break;
|
|
123
|
-
case "trapezoid":
|
|
124
|
-
n = "trapezoid";
|
|
125
|
-
break;
|
|
126
|
-
case "inv_trapezoid":
|
|
127
|
-
n = "inv_trapezoid";
|
|
128
|
-
break;
|
|
129
|
-
case "odd_right":
|
|
130
|
-
n = "rect_left_inv_arrow";
|
|
131
|
-
break;
|
|
132
|
-
case "circle":
|
|
133
|
-
n = "circle";
|
|
134
|
-
break;
|
|
135
|
-
case "ellipse":
|
|
136
|
-
n = "ellipse";
|
|
137
|
-
break;
|
|
138
|
-
case "stadium":
|
|
139
|
-
n = "stadium";
|
|
140
|
-
break;
|
|
141
|
-
case "subroutine":
|
|
142
|
-
n = "subroutine";
|
|
143
|
-
break;
|
|
144
|
-
case "cylinder":
|
|
145
|
-
n = "cylinder";
|
|
146
|
-
break;
|
|
147
|
-
case "group":
|
|
148
|
-
n = "rect";
|
|
149
|
-
break;
|
|
150
|
-
case "doublecircle":
|
|
151
|
-
n = "doublecircle";
|
|
152
|
-
break;
|
|
153
|
-
default:
|
|
154
|
-
n = "rect";
|
|
155
|
-
}
|
|
156
|
-
l.setNode(r.id, {
|
|
157
|
-
labelStyle: h.labelStyle,
|
|
158
|
-
shape: n,
|
|
159
|
-
labelText: t,
|
|
160
|
-
labelType: r.labelType,
|
|
161
|
-
rx: b,
|
|
162
|
-
ry: b,
|
|
163
|
-
class: g,
|
|
164
|
-
style: h.style,
|
|
165
|
-
id: r.id,
|
|
166
|
-
link: r.link,
|
|
167
|
-
linkTarget: r.linkTarget,
|
|
168
|
-
tooltip: p.db.getTooltip(r.id) || "",
|
|
169
|
-
domId: p.db.lookUpDomId(r.id),
|
|
170
|
-
haveCallback: r.haveCallback,
|
|
171
|
-
width: r.type === "group" ? 500 : void 0,
|
|
172
|
-
dir: r.dir,
|
|
173
|
-
type: r.type,
|
|
174
|
-
props: r.props,
|
|
175
|
-
padding: C().flowchart.padding
|
|
176
|
-
}), w.info("setNode", {
|
|
177
|
-
labelStyle: h.labelStyle,
|
|
178
|
-
labelType: r.labelType,
|
|
179
|
-
shape: n,
|
|
180
|
-
labelText: t,
|
|
181
|
-
rx: b,
|
|
182
|
-
ry: b,
|
|
183
|
-
class: g,
|
|
184
|
-
style: h.style,
|
|
185
|
-
id: r.id,
|
|
186
|
-
domId: p.db.lookUpDomId(r.id),
|
|
187
|
-
width: r.type === "group" ? 500 : void 0,
|
|
188
|
-
type: r.type,
|
|
189
|
-
dir: r.dir,
|
|
190
|
-
props: r.props,
|
|
191
|
-
padding: C().flowchart.padding
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
}, V = function(e, l, s) {
|
|
195
|
-
w.info("abc78 edges = ", e);
|
|
196
|
-
let a = 0, i = {}, p, f;
|
|
197
|
-
if (e.defaultStyle !== void 0) {
|
|
198
|
-
const o = N(e.defaultStyle);
|
|
199
|
-
p = o.style, f = o.labelStyle;
|
|
200
|
-
}
|
|
201
|
-
e.forEach(function(o) {
|
|
202
|
-
a++;
|
|
203
|
-
const c = "L-" + o.start + "-" + o.end;
|
|
204
|
-
i[c] === void 0 ? (i[c] = 0, w.info("abc78 new entry", c, i[c])) : (i[c]++, w.info("abc78 new entry", c, i[c]));
|
|
205
|
-
let r = c + "-" + i[c];
|
|
206
|
-
w.info("abc78 new link id to be used is", c, r, i[c]);
|
|
207
|
-
const g = "LS-" + o.start, h = "LE-" + o.end, t = { style: "", labelStyle: "" };
|
|
208
|
-
switch (t.minlen = o.length || 1, o.type === "arrow_open" ? t.arrowhead = "none" : t.arrowhead = "normal", t.arrowTypeStart = "arrow_open", t.arrowTypeEnd = "arrow_open", o.type) {
|
|
209
|
-
case "double_arrow_cross":
|
|
210
|
-
t.arrowTypeStart = "arrow_cross";
|
|
211
|
-
case "arrow_cross":
|
|
212
|
-
t.arrowTypeEnd = "arrow_cross";
|
|
213
|
-
break;
|
|
214
|
-
case "double_arrow_point":
|
|
215
|
-
t.arrowTypeStart = "arrow_point";
|
|
216
|
-
case "arrow_point":
|
|
217
|
-
t.arrowTypeEnd = "arrow_point";
|
|
218
|
-
break;
|
|
219
|
-
case "double_arrow_circle":
|
|
220
|
-
t.arrowTypeStart = "arrow_circle";
|
|
221
|
-
case "arrow_circle":
|
|
222
|
-
t.arrowTypeEnd = "arrow_circle";
|
|
223
|
-
break;
|
|
224
|
-
}
|
|
225
|
-
let d = "", b = "";
|
|
226
|
-
switch (o.stroke) {
|
|
227
|
-
case "normal":
|
|
228
|
-
d = "fill:none;", p !== void 0 && (d = p), f !== void 0 && (b = f), t.thickness = "normal", t.pattern = "solid";
|
|
229
|
-
break;
|
|
230
|
-
case "dotted":
|
|
231
|
-
t.thickness = "normal", t.pattern = "dotted", t.style = "fill:none;stroke-width:2px;stroke-dasharray:3;";
|
|
232
|
-
break;
|
|
233
|
-
case "thick":
|
|
234
|
-
t.thickness = "thick", t.pattern = "solid", t.style = "stroke-width: 3.5px;fill:none;";
|
|
235
|
-
break;
|
|
236
|
-
case "invisible":
|
|
237
|
-
t.thickness = "invisible", t.pattern = "solid", t.style = "stroke-width: 0;fill:none;";
|
|
238
|
-
break;
|
|
239
|
-
}
|
|
240
|
-
if (o.style !== void 0) {
|
|
241
|
-
const n = N(o.style);
|
|
242
|
-
d = n.style, b = n.labelStyle;
|
|
243
|
-
}
|
|
244
|
-
t.style = t.style += d, t.labelStyle = t.labelStyle += b, o.interpolate !== void 0 ? t.curve = $(o.interpolate, E) : e.defaultInterpolate !== void 0 ? t.curve = $(e.defaultInterpolate, E) : t.curve = $(z.curve, E), o.text === void 0 ? o.style !== void 0 && (t.arrowheadStyle = "fill: #333") : (t.arrowheadStyle = "fill: #333", t.labelpos = "c"), t.labelType = o.labelType, t.label = o.text.replace(G.lineBreakRegex, `
|
|
245
|
-
`), o.style === void 0 && (t.style = t.style || "stroke: #333; stroke-width: 1.5px;fill:none;"), t.labelStyle = t.labelStyle.replace("color:", "fill:"), t.id = r, t.classes = "flowchart-link " + g + " " + h, l.setEdge(o.start, o.end, t, a);
|
|
246
|
-
});
|
|
247
|
-
}, le = function(e, l) {
|
|
248
|
-
w.info("Extracting classes"), l.db.clear();
|
|
249
|
-
try {
|
|
250
|
-
return l.parse(e), l.db.getClasses();
|
|
251
|
-
} catch (s) {
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
}, ae = function(e, l, s, a) {
|
|
255
|
-
return I(this, null, function* () {
|
|
256
|
-
w.info("Drawing flowchart"), a.db.clear(), K.setGen("gen-2"), a.parser.parse(e);
|
|
257
|
-
let i = a.db.getDirection();
|
|
258
|
-
i === void 0 && (i = "TD");
|
|
259
|
-
const { securityLevel: p, flowchart: f } = C(), o = f.nodeSpacing || 50, c = f.rankSpacing || 50;
|
|
260
|
-
let r;
|
|
261
|
-
p === "sandbox" && (r = _("#i" + l));
|
|
262
|
-
const g = p === "sandbox" ? _(r.nodes()[0].contentDocument.body) : _("body"), h = p === "sandbox" ? r.nodes()[0].contentDocument : document, t = new M({
|
|
263
|
-
multigraph: !0,
|
|
264
|
-
compound: !0
|
|
265
|
-
}).setGraph({
|
|
266
|
-
rankdir: i,
|
|
267
|
-
nodesep: o,
|
|
268
|
-
ranksep: c,
|
|
269
|
-
marginx: 0,
|
|
270
|
-
marginy: 0
|
|
271
|
-
}).setDefaultEdgeLabel(function() {
|
|
272
|
-
return {};
|
|
273
|
-
});
|
|
274
|
-
let d;
|
|
275
|
-
const b = a.db.getSubGraphs();
|
|
276
|
-
w.info("Subgraphs - ", b);
|
|
277
|
-
for (let u = b.length - 1; u >= 0; u--)
|
|
278
|
-
d = b[u], w.info("Subgraph - ", d), a.db.addVertex(
|
|
279
|
-
d.id,
|
|
280
|
-
{ text: d.title, type: d.labelType },
|
|
281
|
-
"group",
|
|
282
|
-
void 0,
|
|
283
|
-
d.classes,
|
|
284
|
-
d.dir
|
|
285
|
-
);
|
|
286
|
-
const n = a.db.getVertices(), m = a.db.getEdges();
|
|
287
|
-
w.info("Edges", m);
|
|
288
|
-
let k = 0;
|
|
289
|
-
for (k = b.length - 1; k >= 0; k--) {
|
|
290
|
-
d = b[k], Y("cluster").append("text");
|
|
291
|
-
for (let u = 0; u < d.nodes.length; u++)
|
|
292
|
-
w.info("Setting up subgraphs", d.nodes[u], d.id), t.setParent(d.nodes[u], d.id);
|
|
293
|
-
}
|
|
294
|
-
P(n, t, l, g, h, a), V(m, t);
|
|
295
|
-
const T = g.select(`[id="${l}"]`), v = g.select("#" + l + " g");
|
|
296
|
-
if (yield Q(v, t, ["point", "circle", "cross"], "flowchart", l), W.insertTitle(T, "flowchartTitleText", f.titleTopMargin, a.db.getDiagramTitle()), X(t, T, f.diagramPadding, f.useMaxWidth), a.db.indexNodes("subGraph" + k), !f.htmlLabels) {
|
|
297
|
-
const u = h.querySelectorAll('[id="' + l + '"] .edgeLabel .label');
|
|
298
|
-
for (const x of u) {
|
|
299
|
-
const S = x.getBBox(), y = h.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
300
|
-
y.setAttribute("rx", 0), y.setAttribute("ry", 0), y.setAttribute("width", S.width), y.setAttribute("height", S.height), x.insertBefore(y, x.firstChild);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
Object.keys(n).forEach(function(u) {
|
|
304
|
-
const x = n[u];
|
|
305
|
-
if (x.link) {
|
|
306
|
-
const S = _("#" + l + ' [id="' + u + '"]');
|
|
307
|
-
if (S) {
|
|
308
|
-
const y = h.createElementNS("http://www.w3.org/2000/svg", "a");
|
|
309
|
-
y.setAttributeNS("http://www.w3.org/2000/svg", "class", x.classes.join(" ")), y.setAttributeNS("http://www.w3.org/2000/svg", "href", x.link), y.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), p === "sandbox" ? y.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : x.linkTarget && y.setAttributeNS("http://www.w3.org/2000/svg", "target", x.linkTarget);
|
|
310
|
-
const A = S.insert(function() {
|
|
311
|
-
return y;
|
|
312
|
-
}, ":first-child"), B = S.select(".label-container");
|
|
313
|
-
B && A.append(function() {
|
|
314
|
-
return B.node();
|
|
315
|
-
});
|
|
316
|
-
const D = S.select(".label");
|
|
317
|
-
D && A.append(function() {
|
|
318
|
-
return D.node();
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
});
|
|
324
|
-
}, ge = {
|
|
325
|
-
setConf: re,
|
|
326
|
-
addVertices: P,
|
|
327
|
-
addEdges: V,
|
|
328
|
-
getClasses: le,
|
|
329
|
-
draw: ae
|
|
330
|
-
}, oe = (e, l) => {
|
|
331
|
-
const s = j, a = s(e, "r"), i = s(e, "g"), p = s(e, "b");
|
|
332
|
-
return J(a, i, p, l);
|
|
333
|
-
}, ne = (e) => `.label {
|
|
334
|
-
font-family: ${e.fontFamily};
|
|
335
|
-
color: ${e.nodeTextColor || e.textColor};
|
|
336
|
-
}
|
|
337
|
-
.cluster-label text {
|
|
338
|
-
fill: ${e.titleColor};
|
|
339
|
-
}
|
|
340
|
-
.cluster-label span,p {
|
|
341
|
-
color: ${e.titleColor};
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
.label text,span,p {
|
|
345
|
-
fill: ${e.nodeTextColor || e.textColor};
|
|
346
|
-
color: ${e.nodeTextColor || e.textColor};
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
.node rect,
|
|
350
|
-
.node circle,
|
|
351
|
-
.node ellipse,
|
|
352
|
-
.node polygon,
|
|
353
|
-
.node path {
|
|
354
|
-
fill: ${e.mainBkg};
|
|
355
|
-
stroke: ${e.nodeBorder};
|
|
356
|
-
stroke-width: 1px;
|
|
357
|
-
}
|
|
358
|
-
.flowchart-label text {
|
|
359
|
-
text-anchor: middle;
|
|
360
|
-
}
|
|
361
|
-
// .flowchart-label .text-outer-tspan {
|
|
362
|
-
// text-anchor: middle;
|
|
363
|
-
// }
|
|
364
|
-
// .flowchart-label .text-inner-tspan {
|
|
365
|
-
// text-anchor: start;
|
|
366
|
-
// }
|
|
367
|
-
|
|
368
|
-
.node .label {
|
|
369
|
-
text-align: center;
|
|
370
|
-
}
|
|
371
|
-
.node.clickable {
|
|
372
|
-
cursor: pointer;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
.arrowheadPath {
|
|
376
|
-
fill: ${e.arrowheadColor};
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
.edgePath .path {
|
|
380
|
-
stroke: ${e.lineColor};
|
|
381
|
-
stroke-width: 2.0px;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
.flowchart-link {
|
|
385
|
-
stroke: ${e.lineColor};
|
|
386
|
-
fill: none;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
.edgeLabel {
|
|
390
|
-
background-color: ${e.edgeLabelBackground};
|
|
391
|
-
rect {
|
|
392
|
-
opacity: 0.5;
|
|
393
|
-
background-color: ${e.edgeLabelBackground};
|
|
394
|
-
fill: ${e.edgeLabelBackground};
|
|
395
|
-
}
|
|
396
|
-
text-align: center;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
/* For html labels only */
|
|
400
|
-
.labelBkg {
|
|
401
|
-
background-color: ${oe(e.edgeLabelBackground, 0.5)};
|
|
402
|
-
// background-color:
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
.cluster rect {
|
|
406
|
-
fill: ${e.clusterBkg};
|
|
407
|
-
stroke: ${e.clusterBorder};
|
|
408
|
-
stroke-width: 1px;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
.cluster text {
|
|
412
|
-
fill: ${e.titleColor};
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
.cluster span,p {
|
|
416
|
-
color: ${e.titleColor};
|
|
417
|
-
}
|
|
418
|
-
/* .cluster div {
|
|
419
|
-
color: ${e.titleColor};
|
|
420
|
-
} */
|
|
421
|
-
|
|
422
|
-
div.mermaidTooltip {
|
|
423
|
-
position: absolute;
|
|
424
|
-
text-align: center;
|
|
425
|
-
max-width: 200px;
|
|
426
|
-
padding: 2px;
|
|
427
|
-
font-family: ${e.fontFamily};
|
|
428
|
-
font-size: 12px;
|
|
429
|
-
background: ${e.tertiaryColor};
|
|
430
|
-
border: 1px solid ${e.border2};
|
|
431
|
-
border-radius: 2px;
|
|
432
|
-
pointer-events: none;
|
|
433
|
-
z-index: 100;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
.flowchartTitleText {
|
|
437
|
-
text-anchor: middle;
|
|
438
|
-
font-size: 18px;
|
|
439
|
-
fill: ${e.textColor};
|
|
440
|
-
}
|
|
441
|
-
`, ke = ne;
|
|
442
|
-
export {
|
|
443
|
-
ee as a,
|
|
444
|
-
te as b,
|
|
445
|
-
ye as c,
|
|
446
|
-
he as d,
|
|
447
|
-
we as e,
|
|
448
|
-
ge as f,
|
|
449
|
-
ke as g,
|
|
450
|
-
ue as i
|
|
451
|
-
};
|