lowcoder-comps 0.0.13 → 0.0.15
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/0cec454e.js +70 -0
- package/0f86ef29.js +451 -0
- package/17e7d0bf.js +365 -0
- package/1a864f3d.js +1118 -0
- package/1f647469.js +34 -0
- package/23763b0f.js +849 -0
- package/256b619e.js +92 -0
- package/2ff2c7a6.js +6 -0
- package/382c4fc4.js +275 -0
- package/38d6cf93.js +2827 -0
- package/390b4e3e.js +798 -0
- package/458c9f5a.js +940 -0
- package/47fa0137.js +1602 -0
- package/4bbdb65b.js +159 -0
- package/56c3f8cf.js +18619 -0
- package/623efbe6.js +985 -0
- package/6c180067.js +1246 -0
- package/8469b98b.js +447 -0
- package/8660a8b2.js +91 -0
- package/86704c08.js +2679 -0
- package/8fa913d2.js +607 -0
- package/99a17acb.js +2456 -0
- package/9b3889f7.js +793 -0
- package/b4313a3e.js +2103 -0
- package/b554013e.js +86 -0
- package/c7fbe06d.js +117153 -0
- package/c8433421.js +326 -0
- package/cd0b1018.js +823 -0
- package/cf7adbfe.js +7 -0
- package/d1a30aa9.js +943 -0
- package/d285edec.js +212 -0
- package/d8dd0620.js +832 -0
- package/e29567a5.js +24 -0
- package/e57063e2.js +46688 -0
- package/ef9373e1.js +236 -0
- package/f9637058.js +16 -0
- package/fe274388.js +1032 -0
- package/icons/mermaidchart.svg +18 -0
- package/index.js +3 -107555
- package/package.json +13 -4
package/ef9373e1.js
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
var F = Object.defineProperty;
|
|
2
|
+
var A = Object.getOwnPropertySymbols;
|
|
3
|
+
var H = Object.prototype.hasOwnProperty, V = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var $ = (l, t, n) => t in l ? F(l, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : l[t] = n, k = (l, t) => {
|
|
5
|
+
for (var n in t || (t = {}))
|
|
6
|
+
H.call(t, n) && $(l, n, t[n]);
|
|
7
|
+
if (A)
|
|
8
|
+
for (var n of A(t))
|
|
9
|
+
V.call(t, n) && $(l, n, t[n]);
|
|
10
|
+
return l;
|
|
11
|
+
};
|
|
12
|
+
var I = (l, t, n) => new Promise((i, e) => {
|
|
13
|
+
var c = (o) => {
|
|
14
|
+
try {
|
|
15
|
+
r(n.next(o));
|
|
16
|
+
} catch (a) {
|
|
17
|
+
e(a);
|
|
18
|
+
}
|
|
19
|
+
}, s = (o) => {
|
|
20
|
+
try {
|
|
21
|
+
r(n.throw(o));
|
|
22
|
+
} catch (a) {
|
|
23
|
+
e(a);
|
|
24
|
+
}
|
|
25
|
+
}, r = (o) => o.done ? i(o.value) : Promise.resolve(o.value).then(c, s);
|
|
26
|
+
r((n = n.apply(l, t)).next());
|
|
27
|
+
});
|
|
28
|
+
import { p as W, d as M, s as J } from "./fe274388.js";
|
|
29
|
+
import { l as p, c as d, h as S, x as K, t as Q, r as B, o as G, p as U, j as z } from "./c7fbe06d.js";
|
|
30
|
+
import { G as X } from "./86704c08.js";
|
|
31
|
+
import { r as Y } from "./17e7d0bf.js";
|
|
32
|
+
import "./23763b0f.js";
|
|
33
|
+
import "./38d6cf93.js";
|
|
34
|
+
import "./4bbdb65b.js";
|
|
35
|
+
import "./1f647469.js";
|
|
36
|
+
import "./2ff2c7a6.js";
|
|
37
|
+
import "./256b619e.js";
|
|
38
|
+
const L = (l) => z.sanitizeText(l, d());
|
|
39
|
+
let T = {
|
|
40
|
+
dividerMargin: 10,
|
|
41
|
+
padding: 5,
|
|
42
|
+
textHeight: 10,
|
|
43
|
+
curve: void 0
|
|
44
|
+
};
|
|
45
|
+
const Z = function(l, t, n, i) {
|
|
46
|
+
const e = Object.keys(l);
|
|
47
|
+
p.info("keys:", e), p.info(l), e.forEach(function(c) {
|
|
48
|
+
var y;
|
|
49
|
+
var s, r;
|
|
50
|
+
const o = l[c], f = {
|
|
51
|
+
shape: "rect",
|
|
52
|
+
id: o.id,
|
|
53
|
+
domId: o.domId,
|
|
54
|
+
labelText: L(o.id),
|
|
55
|
+
labelStyle: "",
|
|
56
|
+
style: "fill: none; stroke: black",
|
|
57
|
+
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
58
|
+
padding: (y = (s = d().flowchart) == null ? void 0 : s.padding) != null ? y : (r = d().class) == null ? void 0 : r.padding
|
|
59
|
+
};
|
|
60
|
+
t.setNode(o.id, f), P(o.classes, t, n, i, o.id), p.info("setNode", f);
|
|
61
|
+
});
|
|
62
|
+
}, P = function(l, t, n, i, e) {
|
|
63
|
+
const c = Object.keys(l);
|
|
64
|
+
p.info("keys:", c), p.info(l), c.filter((s) => l[s].parent == e).forEach(function(s) {
|
|
65
|
+
var x, h;
|
|
66
|
+
var r, o;
|
|
67
|
+
const a = l[s], f = a.cssClasses.join(" "), y = { labelStyle: "", style: "" }, v = (x = a.label) != null ? x : a.id, b = 0, m = "class_box", u = {
|
|
68
|
+
labelStyle: y.labelStyle,
|
|
69
|
+
shape: m,
|
|
70
|
+
labelText: L(v),
|
|
71
|
+
classData: a,
|
|
72
|
+
rx: b,
|
|
73
|
+
ry: b,
|
|
74
|
+
class: f,
|
|
75
|
+
style: y.style,
|
|
76
|
+
id: a.id,
|
|
77
|
+
domId: a.domId,
|
|
78
|
+
tooltip: i.db.getTooltip(a.id, e) || "",
|
|
79
|
+
haveCallback: a.haveCallback,
|
|
80
|
+
link: a.link,
|
|
81
|
+
width: a.type === "group" ? 500 : void 0,
|
|
82
|
+
type: a.type,
|
|
83
|
+
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
84
|
+
padding: (h = (r = d().flowchart) == null ? void 0 : r.padding) != null ? h : (o = d().class) == null ? void 0 : o.padding
|
|
85
|
+
};
|
|
86
|
+
t.setNode(a.id, u), e && t.setParent(a.id, e), p.info("setNode", u);
|
|
87
|
+
});
|
|
88
|
+
}, j = function(l, t, n, i) {
|
|
89
|
+
p.info(l), l.forEach(function(e, c) {
|
|
90
|
+
var h;
|
|
91
|
+
var s, r;
|
|
92
|
+
const o = e, a = "", f = { labelStyle: "", style: "" }, y = o.text, v = 0, b = "note", m = {
|
|
93
|
+
labelStyle: f.labelStyle,
|
|
94
|
+
shape: b,
|
|
95
|
+
labelText: L(y),
|
|
96
|
+
noteData: o,
|
|
97
|
+
rx: v,
|
|
98
|
+
ry: v,
|
|
99
|
+
class: a,
|
|
100
|
+
style: f.style,
|
|
101
|
+
id: o.id,
|
|
102
|
+
domId: o.id,
|
|
103
|
+
tooltip: "",
|
|
104
|
+
type: "note",
|
|
105
|
+
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
106
|
+
padding: (h = (s = d().flowchart) == null ? void 0 : s.padding) != null ? h : (r = d().class) == null ? void 0 : r.padding
|
|
107
|
+
};
|
|
108
|
+
if (t.setNode(o.id, m), p.info("setNode", m), !o.class || !(o.class in i))
|
|
109
|
+
return;
|
|
110
|
+
const u = n + c, x = {
|
|
111
|
+
id: `edgeNote${u}`,
|
|
112
|
+
//Set relationship style and line type
|
|
113
|
+
classes: "relation",
|
|
114
|
+
pattern: "dotted",
|
|
115
|
+
// Set link type for rendering
|
|
116
|
+
arrowhead: "none",
|
|
117
|
+
//Set edge extra labels
|
|
118
|
+
startLabelRight: "",
|
|
119
|
+
endLabelLeft: "",
|
|
120
|
+
//Set relation arrow types
|
|
121
|
+
arrowTypeStart: "none",
|
|
122
|
+
arrowTypeEnd: "none",
|
|
123
|
+
style: "fill:none",
|
|
124
|
+
labelStyle: "",
|
|
125
|
+
curve: B(T.curve, G)
|
|
126
|
+
};
|
|
127
|
+
t.setEdge(o.id, o.class, x, u);
|
|
128
|
+
});
|
|
129
|
+
}, O = function(l, t) {
|
|
130
|
+
const n = d().flowchart;
|
|
131
|
+
let i = 0;
|
|
132
|
+
l.forEach(function(e) {
|
|
133
|
+
var r;
|
|
134
|
+
var c;
|
|
135
|
+
i++;
|
|
136
|
+
const s = {
|
|
137
|
+
//Set relationship style and line type
|
|
138
|
+
classes: "relation",
|
|
139
|
+
pattern: e.relation.lineType == 1 ? "dashed" : "solid",
|
|
140
|
+
id: "id" + i,
|
|
141
|
+
// Set link type for rendering
|
|
142
|
+
arrowhead: e.type === "arrow_open" ? "none" : "normal",
|
|
143
|
+
//Set edge extra labels
|
|
144
|
+
startLabelRight: e.relationTitle1 === "none" ? "" : e.relationTitle1,
|
|
145
|
+
endLabelLeft: e.relationTitle2 === "none" ? "" : e.relationTitle2,
|
|
146
|
+
//Set relation arrow types
|
|
147
|
+
arrowTypeStart: R(e.relation.type1),
|
|
148
|
+
arrowTypeEnd: R(e.relation.type2),
|
|
149
|
+
style: "fill:none",
|
|
150
|
+
labelStyle: "",
|
|
151
|
+
curve: B(n == null ? void 0 : n.curve, G)
|
|
152
|
+
};
|
|
153
|
+
if (p.info(s, e), e.style !== void 0) {
|
|
154
|
+
const o = U(e.style);
|
|
155
|
+
s.style = o.style, s.labelStyle = o.labelStyle;
|
|
156
|
+
}
|
|
157
|
+
e.text = e.title, e.text === void 0 ? e.style !== void 0 && (s.arrowheadStyle = "fill: #333") : (s.arrowheadStyle = "fill: #333", s.labelpos = "c", ((r = (c = d().flowchart) == null ? void 0 : c.htmlLabels) != null ? r : d().htmlLabels) ? (s.labelType = "html", s.label = '<span class="edgeLabel">' + e.text + "</span>") : (s.labelType = "text", s.label = e.text.replace(z.lineBreakRegex, `
|
|
158
|
+
`), e.style === void 0 && (s.style = s.style || "stroke: #333; stroke-width: 1.5px;fill:none"), s.labelStyle = s.labelStyle.replace("color:", "fill:"))), t.setEdge(e.id1, e.id2, s, i);
|
|
159
|
+
});
|
|
160
|
+
}, ee = function(l) {
|
|
161
|
+
T = k(k({}, T), l);
|
|
162
|
+
}, te = function(l, t, n, i) {
|
|
163
|
+
return I(this, null, function* () {
|
|
164
|
+
var h, N, D, E;
|
|
165
|
+
p.info("Drawing class - ", t);
|
|
166
|
+
const e = (h = d().flowchart) != null ? h : d().class, c = d().securityLevel;
|
|
167
|
+
p.info("config:", e);
|
|
168
|
+
const s = (N = e == null ? void 0 : e.nodeSpacing) != null ? N : 50, r = (D = e == null ? void 0 : e.rankSpacing) != null ? D : 50, o = new X({
|
|
169
|
+
multigraph: !0,
|
|
170
|
+
compound: !0
|
|
171
|
+
}).setGraph({
|
|
172
|
+
rankdir: i.db.getDirection(),
|
|
173
|
+
nodesep: s,
|
|
174
|
+
ranksep: r,
|
|
175
|
+
marginx: 8,
|
|
176
|
+
marginy: 8
|
|
177
|
+
}).setDefaultEdgeLabel(function() {
|
|
178
|
+
return {};
|
|
179
|
+
}), a = i.db.getNamespaces(), f = i.db.getClasses(), y = i.db.getRelations(), v = i.db.getNotes();
|
|
180
|
+
p.info(y), Z(a, o, t, i), P(f, o, t, i), O(y, o), j(v, o, y.length + 1, f);
|
|
181
|
+
let b;
|
|
182
|
+
c === "sandbox" && (b = S("#i" + t));
|
|
183
|
+
const m = c === "sandbox" ? S(b.nodes()[0].contentDocument.body) : S("body"), u = m.select(`[id="${t}"]`), x = m.select("#" + t + " g");
|
|
184
|
+
if (yield Y(
|
|
185
|
+
x,
|
|
186
|
+
o,
|
|
187
|
+
["aggregation", "extension", "composition", "dependency", "lollipop"],
|
|
188
|
+
"classDiagram",
|
|
189
|
+
t
|
|
190
|
+
), K.insertTitle(u, "classTitleText", (E = e == null ? void 0 : e.titleTopMargin) != null ? E : 5, i.db.getDiagramTitle()), Q(o, u, e == null ? void 0 : e.diagramPadding, e == null ? void 0 : e.useMaxWidth), !(e != null && e.htmlLabels)) {
|
|
191
|
+
const _ = c === "sandbox" ? b.nodes()[0].contentDocument : document, q = _.querySelectorAll('[id="' + t + '"] .edgeLabel .label');
|
|
192
|
+
for (const w of q) {
|
|
193
|
+
const C = w.getBBox(), g = _.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
194
|
+
g.setAttribute("rx", 0), g.setAttribute("ry", 0), g.setAttribute("width", C.width), g.setAttribute("height", C.height), w.insertBefore(g, w.firstChild);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
function R(l) {
|
|
200
|
+
let t;
|
|
201
|
+
switch (l) {
|
|
202
|
+
case 0:
|
|
203
|
+
t = "aggregation";
|
|
204
|
+
break;
|
|
205
|
+
case 1:
|
|
206
|
+
t = "extension";
|
|
207
|
+
break;
|
|
208
|
+
case 2:
|
|
209
|
+
t = "composition";
|
|
210
|
+
break;
|
|
211
|
+
case 3:
|
|
212
|
+
t = "dependency";
|
|
213
|
+
break;
|
|
214
|
+
case 4:
|
|
215
|
+
t = "lollipop";
|
|
216
|
+
break;
|
|
217
|
+
default:
|
|
218
|
+
t = "none";
|
|
219
|
+
}
|
|
220
|
+
return t;
|
|
221
|
+
}
|
|
222
|
+
const oe = {
|
|
223
|
+
setConf: ee,
|
|
224
|
+
draw: te
|
|
225
|
+
}, be = {
|
|
226
|
+
parser: W,
|
|
227
|
+
db: M,
|
|
228
|
+
renderer: oe,
|
|
229
|
+
styles: J,
|
|
230
|
+
init: (l) => {
|
|
231
|
+
l.class || (l.class = {}), l.class.arrowMarkerAbsolute = l.arrowMarkerAbsolute, M.clear();
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
export {
|
|
235
|
+
be as diagram
|
|
236
|
+
};
|