lowcoder-comps 0.0.26 → 0.0.28

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.
Files changed (56) hide show
  1. package/000297fb.js +5 -0
  2. package/{92fb34a2.js → 0205ce17.js} +27 -27
  3. package/{3f63d12d.js → 1269154d.js} +32711 -34763
  4. package/{6fbc4c21.js → 1f088099.js} +18 -18
  5. package/{2b3b3386.js → 2ae47d58.js} +548 -548
  6. package/2ff7471d.js +9 -0
  7. package/{44cd1a62.js → 42b75267.js} +11 -11
  8. package/{ed8c376c.js → 45a7c119.js} +286 -293
  9. package/4bc5ef7f.js +881 -0
  10. package/{90d3581f.js → 4c822e6b.js} +133 -132
  11. package/5bb002c8.js +64 -0
  12. package/{82c8e71b.js → 6517e88b.js} +12 -10
  13. package/65d3daa9.js +391 -0
  14. package/{87b4699c.js → 6909d829.js} +1 -1
  15. package/{b28dda80.js → 711961f8.js} +13 -12
  16. package/77491f00.js +86 -0
  17. package/7805c934.js +455 -0
  18. package/7dc7ce37.js +19104 -0
  19. package/{c3caea77.js → 83feec48.js} +45 -43
  20. package/{c66d9114.js → 8c8fb30b.js} +25 -24
  21. package/{3220cb2e.js → 945d7302.js} +2 -1
  22. package/{4891fa68.js → 9a9b397d.js} +6 -5
  23. package/{3ebbaeae.js → a2d32dbb.js} +18 -18
  24. package/{2c0287e1.js → a39d3869.js} +2 -2
  25. package/a40faea7.js +11624 -0
  26. package/b7bda09a.js +237 -0
  27. package/{5f138044.js → b99f5b2a.js} +158 -147
  28. package/bcc07d29.js +1536 -0
  29. package/c2bf7d82.js +819 -0
  30. package/c4bd6ed7.js +1269 -0
  31. package/c4c5f13b.js +8 -0
  32. package/d2bae1f4.js +2284 -0
  33. package/d4b9d281.js +1089 -0
  34. package/{11b36d97.js → d4ba48b2.js} +148 -145
  35. package/dd0ec77a.js +48428 -0
  36. package/{c889073f.js → e0bacb89.js} +1 -1
  37. package/{b70abaaf.js → e437d53e.js} +1 -1
  38. package/e95fa522.js +1102 -0
  39. package/ed46c11a.js +1276 -0
  40. package/f2b8cbc8.js +25 -0
  41. package/index.js +2 -2
  42. package/package.json +1 -1
  43. package/33035c6f.js +0 -86
  44. package/3f82489c.js +0 -2396
  45. package/454ca826.js +0 -46724
  46. package/4938ecf8.js +0 -22
  47. package/558b96ef.js +0 -18798
  48. package/596b7f71.js +0 -365
  49. package/637a168a.js +0 -235
  50. package/765a2a38.js +0 -1055
  51. package/8ed940ee.js +0 -786
  52. package/9c1ceb2f.js +0 -448
  53. package/aad4f2fa.js +0 -1235
  54. package/b053e17f.js +0 -1000
  55. package/bed24264.js +0 -2192
  56. package/d3478475.js +0 -64
package/596b7f71.js DELETED
@@ -1,365 +0,0 @@
1
- var E = (n, t, e) => new Promise((r, i) => {
2
- var a = (f) => {
3
- try {
4
- l(e.next(f));
5
- } catch (h) {
6
- i(h);
7
- }
8
- }, u = (f) => {
9
- try {
10
- l(e.throw(f));
11
- } catch (h) {
12
- i(h);
13
- }
14
- }, l = (f) => f.done ? r(f.value) : Promise.resolve(f.value).then(a, u);
15
- l((e = e.apply(n, t)).next());
16
- });
17
- import { b as j, i as m, m as L, G as A, l as M } from "./3f82489c.js";
18
- import { i as _, u as H, s as V, a as U, b as W, p as O, c as Y, d as q, e as z, f as K, g as T, h as B } from "./b053e17f.js";
19
- import { l as s, p as S, c as X, h as J } from "./3f63d12d.js";
20
- import { a as Q } from "./3220cb2e.js";
21
- var Z = 4;
22
- function I(n) {
23
- return j(n, Z);
24
- }
25
- function x(n) {
26
- var t = {
27
- options: {
28
- directed: n.isDirected(),
29
- multigraph: n.isMultigraph(),
30
- compound: n.isCompound()
31
- },
32
- nodes: tt(n),
33
- edges: et(n)
34
- };
35
- return m(n.graph()) || (t.value = I(n.graph())), t;
36
- }
37
- function tt(n) {
38
- return L(n.nodes(), function(t) {
39
- var e = n.node(t), r = n.parent(t), i = { v: t };
40
- return m(e) || (i.value = e), m(r) || (i.parent = r), i;
41
- });
42
- }
43
- function et(n) {
44
- return L(n.edges(), function(t) {
45
- var e = n.edge(t), r = { v: t.v, w: t.w };
46
- return m(t.name) || (r.name = t.name), m(e) || (r.value = e), r;
47
- });
48
- }
49
- let d = {}, g = {}, R = {};
50
- const nt = () => {
51
- g = {}, R = {}, d = {};
52
- }, C = (n, t) => (s.trace("In isDecendant", t, " ", n, " = ", g[t].includes(n)), !!g[t].includes(n)), it = (n, t) => (s.info("Decendants of ", t, " is ", g[t]), s.info("Edge is ", n), n.v === t || n.w === t ? !1 : g[t] ? g[t].includes(n.v) || C(n.v, t) || C(n.w, t) || g[t].includes(n.w) : (s.debug("Tilt, ", t, ",not in decendants"), !1)), p = (n, t, e, r) => {
53
- s.warn(
54
- "Copying children of ",
55
- n,
56
- "root",
57
- r,
58
- "data",
59
- t.node(n),
60
- r
61
- );
62
- const i = t.children(n) || [];
63
- n !== r && i.push(n), s.warn("Copying (nodes) clusterId", n, "nodes", i), i.forEach((a) => {
64
- if (t.children(a).length > 0)
65
- p(a, t, e, r);
66
- else {
67
- const u = t.node(a);
68
- s.info("cp ", a, " to ", r, " with parent ", n), e.setNode(a, u), r !== t.parent(a) && (s.warn("Setting parent", a, t.parent(a)), e.setParent(a, t.parent(a))), n !== r && a !== n ? (s.debug("Setting parent", a, n), e.setParent(a, n)) : (s.info("In copy ", n, "root", r, "data", t.node(n), r), s.debug(
69
- "Not Setting parent for node=",
70
- a,
71
- "cluster!==rootId",
72
- n !== r,
73
- "node!==clusterId",
74
- a !== n
75
- ));
76
- const l = t.edges(a);
77
- s.debug("Copying Edges", l), l.forEach((f) => {
78
- s.info("Edge", f);
79
- const h = t.edge(f.v, f.w, f.name);
80
- s.info("Edge data", h, r);
81
- try {
82
- it(f, r) ? (s.info("Copying as ", f.v, f.w, h, f.name), e.setEdge(f.v, f.w, h, f.name), s.info("newGraph edges ", e.edges(), e.edge(e.edges()[0]))) : s.info(
83
- "Skipping copy of edge ",
84
- f.v,
85
- "-->",
86
- f.w,
87
- " rootId: ",
88
- r,
89
- " clusterId:",
90
- n
91
- );
92
- } catch (w) {
93
- s.error(w);
94
- }
95
- });
96
- }
97
- s.debug("Removing node", a), t.removeNode(a);
98
- });
99
- }, P = (n, t) => {
100
- const e = t.children(n);
101
- let r = [...e];
102
- for (const i of e)
103
- R[i] = n, r = [...r, ...P(i, t)];
104
- return r;
105
- }, b = (n, t) => {
106
- s.trace("Searching", n);
107
- const e = t.children(n);
108
- if (s.trace("Searching children of id ", n, e), e.length < 1)
109
- return s.trace("This is a valid node", n), n;
110
- for (const r of e) {
111
- const i = b(r, t);
112
- if (i)
113
- return s.trace("Found replacement for", n, " => ", i), i;
114
- }
115
- }, N = (n) => !d[n] || !d[n].externalConnections ? n : d[n] ? d[n].id : n, st = (n, t) => {
116
- if (!n || t > 10) {
117
- s.debug("Opting out, no graph ");
118
- return;
119
- } else
120
- s.debug("Opting in, graph ");
121
- n.nodes().forEach(function(e) {
122
- n.children(e).length > 0 && (s.warn(
123
- "Cluster identified",
124
- e,
125
- " Replacement id in edges: ",
126
- b(e, n)
127
- ), g[e] = P(e, n), d[e] = { id: b(e, n), clusterData: n.node(e) });
128
- }), n.nodes().forEach(function(e) {
129
- const r = n.children(e), i = n.edges();
130
- r.length > 0 ? (s.debug("Cluster identified", e, g), i.forEach((a) => {
131
- if (a.v !== e && a.w !== e) {
132
- const u = C(a.v, e), l = C(a.w, e);
133
- u ^ l && (s.warn("Edge: ", a, " leaves cluster ", e), s.warn("Decendants of XXX ", e, ": ", g[e]), d[e].externalConnections = !0);
134
- }
135
- })) : s.debug("Not a cluster ", e, g);
136
- }), n.edges().forEach(function(e) {
137
- const r = n.edge(e);
138
- s.warn("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e)), s.warn("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(n.edge(e)));
139
- let i = e.v, a = e.w;
140
- if (s.warn(
141
- "Fix XXX",
142
- d,
143
- "ids:",
144
- e.v,
145
- e.w,
146
- "Translating: ",
147
- d[e.v],
148
- " --- ",
149
- d[e.w]
150
- ), d[e.v] && d[e.w] && d[e.v] === d[e.w]) {
151
- s.warn("Fixing and trixing link to self - removing XXX", e.v, e.w, e.name), s.warn("Fixing and trixing - removing XXX", e.v, e.w, e.name), i = N(e.v), a = N(e.w), n.removeEdge(e.v, e.w, e.name);
152
- const u = e.w + "---" + e.v;
153
- n.setNode(u, {
154
- domId: u,
155
- id: u,
156
- labelStyle: "",
157
- labelText: r.label,
158
- padding: 0,
159
- shape: "labelRect",
160
- style: ""
161
- });
162
- const l = structuredClone(r), f = structuredClone(r);
163
- l.label = "", l.arrowTypeEnd = "none", f.label = "", l.fromCluster = e.v, f.toCluster = e.v, n.setEdge(i, u, l, e.name + "-cyclic-special"), n.setEdge(u, a, f, e.name + "-cyclic-special");
164
- } else
165
- (d[e.v] || d[e.w]) && (s.warn("Fixing and trixing - removing XXX", e.v, e.w, e.name), i = N(e.v), a = N(e.w), n.removeEdge(e.v, e.w, e.name), i !== e.v && (r.fromCluster = e.v), a !== e.w && (r.toCluster = e.w), s.warn("Fix Replacing with XXX", i, a, e.name), n.setEdge(i, a, r, e.name));
166
- }), s.warn("Adjusted Graph", x(n)), F(n, 0), s.trace(d);
167
- }, F = (n, t) => {
168
- if (s.warn("extractor - ", t, x(n), n.children("D")), t > 10) {
169
- s.error("Bailing out");
170
- return;
171
- }
172
- let e = n.nodes(), r = !1;
173
- for (const i of e) {
174
- const a = n.children(i);
175
- r = r || a.length > 0;
176
- }
177
- if (!r) {
178
- s.debug("Done, no node has children", n.nodes());
179
- return;
180
- }
181
- s.debug("Nodes = ", e, t);
182
- for (const i of e)
183
- if (s.debug(
184
- "Extracting node",
185
- i,
186
- d,
187
- d[i] && !d[i].externalConnections,
188
- !n.parent(i),
189
- n.node(i),
190
- n.children("D"),
191
- " Depth ",
192
- t
193
- ), !d[i])
194
- s.debug("Not a cluster", i, t);
195
- else if (!d[i].externalConnections && // !graph.parent(node) &&
196
- n.children(i) && n.children(i).length > 0) {
197
- s.warn(
198
- "Cluster without external connections, without a parent and with children",
199
- i,
200
- t
201
- );
202
- let u = n.graph().rankdir === "TB" ? "LR" : "TB";
203
- d[i] && d[i].clusterData && d[i].clusterData.dir && (u = d[i].clusterData.dir, s.warn("Fixing dir", d[i].clusterData.dir, u));
204
- const l = new A({
205
- multigraph: !0,
206
- compound: !0
207
- }).setGraph({
208
- rankdir: u,
209
- // Todo: set proper spacing
210
- nodesep: 50,
211
- ranksep: 50,
212
- marginx: 8,
213
- marginy: 8
214
- }).setDefaultEdgeLabel(function() {
215
- return {};
216
- });
217
- s.warn("Old graph before copy", x(n)), p(i, n, l, i), n.setNode(i, {
218
- clusterNode: !0,
219
- id: i,
220
- clusterData: d[i].clusterData,
221
- labelText: d[i].labelText,
222
- graph: l
223
- }), s.warn("New graph after copy node: (", i, ")", x(l)), s.debug("Old graph after copy", x(n));
224
- } else
225
- s.warn(
226
- "Cluster ** ",
227
- i,
228
- " **not meeting the criteria !externalConnections:",
229
- !d[i].externalConnections,
230
- " no parent: ",
231
- !n.parent(i),
232
- " children ",
233
- n.children(i) && n.children(i).length > 0,
234
- n.children("D"),
235
- t
236
- ), s.debug(d);
237
- e = n.nodes(), s.warn("New list of nodes", e);
238
- for (const i of e) {
239
- const a = n.node(i);
240
- s.warn(" Now next level", i, a), a.clusterNode && F(a.graph, t + 1);
241
- }
242
- }, k = (n, t) => {
243
- if (t.length === 0)
244
- return [];
245
- let e = Object.assign(t);
246
- return t.forEach((r) => {
247
- const i = n.children(r), a = k(n, i);
248
- e = [...e, ...a];
249
- }), e;
250
- }, rt = (n) => k(n, n.children()), at = (n, t) => {
251
- s.info("Creating subgraph rect for ", t.id, t);
252
- const e = n.insert("g").attr("class", "cluster" + (t.class ? " " + t.class : "")).attr("id", t.id), r = e.insert("rect", ":first-child"), i = S(X().flowchart.htmlLabels), a = e.insert("g").attr("class", "cluster-label"), u = t.labelType === "markdown" ? Q(a, t.labelText, { style: t.labelStyle, useHtmlLabels: i }) : a.node().appendChild(T(t.labelText, t.labelStyle, void 0, !0));
253
- let l = u.getBBox();
254
- if (S(X().flowchart.htmlLabels)) {
255
- const c = u.children[0], o = J(u);
256
- l = c.getBoundingClientRect(), o.attr("width", l.width), o.attr("height", l.height);
257
- }
258
- const f = 0 * t.padding, h = f / 2, w = t.width <= l.width + f ? l.width + f : t.width;
259
- t.width <= l.width + f ? t.diff = (l.width - t.width) / 2 - t.padding / 2 : t.diff = -t.padding / 2, s.trace("Data ", t, JSON.stringify(t)), r.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - w / 2).attr("y", t.y - t.height / 2 - h).attr("width", w).attr("height", t.height + f), i ? a.attr(
260
- "transform",
261
- // This puts the labal on top of the box instead of inside it
262
- "translate(" + (t.x - l.width / 2) + ", " + (t.y - t.height / 2) + ")"
263
- ) : a.attr(
264
- "transform",
265
- // This puts the labal on top of the box instead of inside it
266
- "translate(" + t.x + ", " + (t.y - t.height / 2) + ")"
267
- );
268
- const v = r.node().getBBox();
269
- return t.width = v.width, t.height = v.height, t.intersect = function(c) {
270
- return B(t, c);
271
- }, e;
272
- }, ct = (n, t) => {
273
- const e = n.insert("g").attr("class", "note-cluster").attr("id", t.id), r = e.insert("rect", ":first-child"), i = 0 * t.padding, a = i / 2;
274
- r.attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - t.width / 2 - a).attr("y", t.y - t.height / 2 - a).attr("width", t.width + i).attr("height", t.height + i).attr("fill", "none");
275
- const u = r.node().getBBox();
276
- return t.width = u.width, t.height = u.height, t.intersect = function(l) {
277
- return B(t, l);
278
- }, e;
279
- }, ot = (n, t) => {
280
- const e = n.insert("g").attr("class", t.classes).attr("id", t.id), r = e.insert("rect", ":first-child"), i = e.insert("g").attr("class", "cluster-label"), a = e.append("rect"), u = i.node().appendChild(T(t.labelText, t.labelStyle, void 0, !0));
281
- let l = u.getBBox();
282
- if (S(X().flowchart.htmlLabels)) {
283
- const c = u.children[0], o = J(u);
284
- l = c.getBoundingClientRect(), o.attr("width", l.width), o.attr("height", l.height);
285
- }
286
- l = u.getBBox();
287
- const f = 0 * t.padding, h = f / 2, w = t.width <= l.width + t.padding ? l.width + t.padding : t.width;
288
- t.width <= l.width + t.padding ? t.diff = (l.width + t.padding * 0 - t.width) / 2 : t.diff = -t.padding / 2, r.attr("class", "outer").attr("x", t.x - w / 2 - h).attr("y", t.y - t.height / 2 - h).attr("width", w + f).attr("height", t.height + f), a.attr("class", "inner").attr("x", t.x - w / 2 - h).attr("y", t.y - t.height / 2 - h + l.height - 1).attr("width", w + f).attr("height", t.height + f - l.height - 3), i.attr(
289
- "transform",
290
- "translate(" + (t.x - l.width / 2) + ", " + (t.y - t.height / 2 - t.padding / 3 + (S(X().flowchart.htmlLabels) ? 5 : 3)) + ")"
291
- );
292
- const v = r.node().getBBox();
293
- return t.height = v.height, t.intersect = function(c) {
294
- return B(t, c);
295
- }, e;
296
- }, lt = (n, t) => {
297
- const e = n.insert("g").attr("class", t.classes).attr("id", t.id), r = e.insert("rect", ":first-child"), i = 0 * t.padding, a = i / 2;
298
- r.attr("class", "divider").attr("x", t.x - t.width / 2 - a).attr("y", t.y - t.height / 2).attr("width", t.width + i).attr("height", t.height + i);
299
- const u = r.node().getBBox();
300
- return t.width = u.width, t.height = u.height, t.diff = -t.padding / 2, t.intersect = function(l) {
301
- return B(t, l);
302
- }, e;
303
- }, ft = { rect: at, roundedWithTitle: ot, noteGroup: ct, divider: lt };
304
- let $ = {};
305
- const dt = (n, t) => {
306
- s.trace("Inserting cluster");
307
- const e = t.shape || "rect";
308
- $[t.id] = ft[e](n, t);
309
- }, ut = () => {
310
- $ = {};
311
- }, G = (n, t, e, r, i) => E(void 0, null, function* () {
312
- s.info("Graph in recursive render: XXX", x(t), i);
313
- const a = t.graph().rankdir;
314
- s.trace("Dir in recursive render - dir:", a);
315
- const u = n.insert("g").attr("class", "root");
316
- t.nodes() ? s.info("Recursive render XXX", t.nodes()) : s.info("No nodes found for", t), t.edges().length > 0 && s.trace("Recursive edges", t.edge(t.edges()[0]));
317
- const l = u.insert("g").attr("class", "clusters"), f = u.insert("g").attr("class", "edgePaths"), h = u.insert("g").attr("class", "edgeLabels"), w = u.insert("g").attr("class", "nodes");
318
- yield Promise.all(
319
- t.nodes().map(function(c) {
320
- return E(this, null, function* () {
321
- const o = t.node(c);
322
- if (i !== void 0) {
323
- const y = JSON.parse(JSON.stringify(i.clusterData));
324
- s.info("Setting data for cluster XXX (", c, ") ", y, i), t.setNode(i.id, y), t.parent(c) || (s.trace("Setting parent", c, i.id), t.setParent(c, i.id, y));
325
- }
326
- if (s.info("(Insert) Node XXX" + c + ": " + JSON.stringify(t.node(c))), o && o.clusterNode) {
327
- s.info("Cluster identified", c, o.width, t.node(c));
328
- const y = yield G(w, o.graph, e, r, t.node(c)), D = y.elem;
329
- H(o, D), o.diff = y.diff || 0, s.info("Node bounds (abc123)", c, o, o.width, o.x, o.y), V(D, o), s.warn("Recursive render complete ", D, o);
330
- } else
331
- t.children(c).length > 0 ? (s.info("Cluster - the non recursive path XXX", c, o.id, o, t), s.info(b(o.id, t)), d[o.id] = { id: b(o.id, t), node: o }) : (s.info("Node - the non recursive path", c, o.id, o), yield U(w, t.node(c), a));
332
- });
333
- })
334
- ), t.edges().forEach(function(c) {
335
- const o = t.edge(c.v, c.w, c.name);
336
- s.info("Edge " + c.v + " -> " + c.w + ": " + JSON.stringify(c)), s.info("Edge " + c.v + " -> " + c.w + ": ", c, " ", JSON.stringify(t.edge(c))), s.info("Fix", d, "ids:", c.v, c.w, "Translateing: ", d[c.v], d[c.w]), W(h, o);
337
- }), t.edges().forEach(function(c) {
338
- s.info("Edge " + c.v + " -> " + c.w + ": " + JSON.stringify(c));
339
- }), s.info("#############################################"), s.info("### Layout ###"), s.info("#############################################"), s.info(t), M(t), s.info("Graph after layout:", x(t));
340
- let v = 0;
341
- return rt(t).forEach(function(c) {
342
- const o = t.node(c);
343
- s.info("Position " + c + ": " + JSON.stringify(t.node(c))), s.info(
344
- "Position " + c + ": (" + o.x,
345
- "," + o.y,
346
- ") width: ",
347
- o.width,
348
- " height: ",
349
- o.height
350
- ), o && o.clusterNode ? O(o) : t.children(c).length > 0 ? (dt(l, o), d[o.id].node = o) : O(o);
351
- }), t.edges().forEach(function(c) {
352
- const o = t.edge(c);
353
- s.info("Edge " + c.v + " -> " + c.w + ": " + JSON.stringify(o), o);
354
- const y = Y(f, c, o, d, e, t, r);
355
- q(o, y);
356
- }), t.nodes().forEach(function(c) {
357
- const o = t.node(c);
358
- s.info(c, o.type, o.diff), o.type === "group" && (v = o.diff);
359
- }), { elem: u, diff: v };
360
- }), vt = (n, t, e, r, i) => E(void 0, null, function* () {
361
- _(n, e, r, i), z(), K(), ut(), nt(), s.warn("Graph at first:", JSON.stringify(x(t))), st(t), s.warn("Graph after:", JSON.stringify(x(t))), yield G(n, t, r, i);
362
- });
363
- export {
364
- vt as r
365
- };
package/637a168a.js DELETED
@@ -1,235 +0,0 @@
1
- var F = Object.defineProperty;
2
- var A = Object.getOwnPropertySymbols;
3
- var H = Object.prototype.hasOwnProperty, V = Object.prototype.propertyIsEnumerable;
4
- var I = (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) && I(l, n, t[n]);
7
- if (A)
8
- for (var n of A(t))
9
- V.call(t, n) && I(l, n, t[n]);
10
- return l;
11
- };
12
- var M = (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 $, s as J } from "./765a2a38.js";
29
- import { l as p, c as d, h as S, z as K, r as Q, q as B, n as G, o as U, j as z } from "./3f63d12d.js";
30
- import { G as X } from "./3f82489c.js";
31
- import { r as Y } from "./596b7f71.js";
32
- import "./b053e17f.js";
33
- import "./3220cb2e.js";
34
- import "./b70abaaf.js";
35
- import "./2ff2c7a6.js";
36
- import "./256b619e.js";
37
- const L = (l) => z.sanitizeText(l, d());
38
- let T = {
39
- dividerMargin: 10,
40
- padding: 5,
41
- textHeight: 10,
42
- curve: void 0
43
- };
44
- const Z = function(l, t, n, i) {
45
- const e = Object.keys(l);
46
- p.info("keys:", e), p.info(l), e.forEach(function(c) {
47
- var y;
48
- var s, r;
49
- const o = l[c], f = {
50
- shape: "rect",
51
- id: o.id,
52
- domId: o.domId,
53
- labelText: L(o.id),
54
- labelStyle: "",
55
- style: "fill: none; stroke: black",
56
- // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
57
- padding: (y = (s = d().flowchart) == null ? void 0 : s.padding) != null ? y : (r = d().class) == null ? void 0 : r.padding
58
- };
59
- t.setNode(o.id, f), q(o.classes, t, n, i, o.id), p.info("setNode", f);
60
- });
61
- }, q = function(l, t, n, i, e) {
62
- const c = Object.keys(l);
63
- p.info("keys:", c), p.info(l), c.filter((s) => l[s].parent == e).forEach(function(s) {
64
- var g, h;
65
- var r, o;
66
- const a = l[s], f = a.cssClasses.join(" "), y = { labelStyle: "", style: "" }, v = (g = a.label) != null ? g : a.id, b = 0, m = "class_box", u = {
67
- labelStyle: y.labelStyle,
68
- shape: m,
69
- labelText: L(v),
70
- classData: a,
71
- rx: b,
72
- ry: b,
73
- class: f,
74
- style: y.style,
75
- id: a.id,
76
- domId: a.domId,
77
- tooltip: i.db.getTooltip(a.id, e) || "",
78
- haveCallback: a.haveCallback,
79
- link: a.link,
80
- width: a.type === "group" ? 500 : void 0,
81
- type: a.type,
82
- // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
83
- padding: (h = (r = d().flowchart) == null ? void 0 : r.padding) != null ? h : (o = d().class) == null ? void 0 : o.padding
84
- };
85
- t.setNode(a.id, u), e && t.setParent(a.id, e), p.info("setNode", u);
86
- });
87
- }, j = function(l, t, n, i) {
88
- p.info(l), l.forEach(function(e, c) {
89
- var h;
90
- var s, r;
91
- const o = e, a = "", f = { labelStyle: "", style: "" }, y = o.text, v = 0, b = "note", m = {
92
- labelStyle: f.labelStyle,
93
- shape: b,
94
- labelText: L(y),
95
- noteData: o,
96
- rx: v,
97
- ry: v,
98
- class: a,
99
- style: f.style,
100
- id: o.id,
101
- domId: o.id,
102
- tooltip: "",
103
- type: "note",
104
- // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
105
- padding: (h = (s = d().flowchart) == null ? void 0 : s.padding) != null ? h : (r = d().class) == null ? void 0 : r.padding
106
- };
107
- if (t.setNode(o.id, m), p.info("setNode", m), !o.class || !(o.class in i))
108
- return;
109
- const u = n + c, g = {
110
- id: `edgeNote${u}`,
111
- //Set relationship style and line type
112
- classes: "relation",
113
- pattern: "dotted",
114
- // Set link type for rendering
115
- arrowhead: "none",
116
- //Set edge extra labels
117
- startLabelRight: "",
118
- endLabelLeft: "",
119
- //Set relation arrow types
120
- arrowTypeStart: "none",
121
- arrowTypeEnd: "none",
122
- style: "fill:none",
123
- labelStyle: "",
124
- curve: B(T.curve, G)
125
- };
126
- t.setEdge(o.id, o.class, g, u);
127
- });
128
- }, O = function(l, t) {
129
- const n = d().flowchart;
130
- let i = 0;
131
- l.forEach(function(e) {
132
- var r;
133
- var c;
134
- i++;
135
- const s = {
136
- //Set relationship style and line type
137
- classes: "relation",
138
- pattern: e.relation.lineType == 1 ? "dashed" : "solid",
139
- id: "id" + i,
140
- // Set link type for rendering
141
- arrowhead: e.type === "arrow_open" ? "none" : "normal",
142
- //Set edge extra labels
143
- startLabelRight: e.relationTitle1 === "none" ? "" : e.relationTitle1,
144
- endLabelLeft: e.relationTitle2 === "none" ? "" : e.relationTitle2,
145
- //Set relation arrow types
146
- arrowTypeStart: R(e.relation.type1),
147
- arrowTypeEnd: R(e.relation.type2),
148
- style: "fill:none",
149
- labelStyle: "",
150
- curve: B(n == null ? void 0 : n.curve, G)
151
- };
152
- if (p.info(s, e), e.style !== void 0) {
153
- const o = U(e.style);
154
- s.style = o.style, s.labelStyle = o.labelStyle;
155
- }
156
- 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, `
157
- `), 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);
158
- });
159
- }, ee = function(l) {
160
- T = k(k({}, T), l);
161
- }, te = function(l, t, n, i) {
162
- return M(this, null, function* () {
163
- var h, N, D, E;
164
- p.info("Drawing class - ", t);
165
- const e = (h = d().flowchart) != null ? h : d().class, c = d().securityLevel;
166
- p.info("config:", e);
167
- 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({
168
- multigraph: !0,
169
- compound: !0
170
- }).setGraph({
171
- rankdir: i.db.getDirection(),
172
- nodesep: s,
173
- ranksep: r,
174
- marginx: 8,
175
- marginy: 8
176
- }).setDefaultEdgeLabel(function() {
177
- return {};
178
- }), a = i.db.getNamespaces(), f = i.db.getClasses(), y = i.db.getRelations(), v = i.db.getNotes();
179
- p.info(y), Z(a, o, t, i), q(f, o, t, i), O(y, o), j(v, o, y.length + 1, f);
180
- let b;
181
- c === "sandbox" && (b = S("#i" + t));
182
- const m = c === "sandbox" ? S(b.nodes()[0].contentDocument.body) : S("body"), u = m.select(`[id="${t}"]`), g = m.select("#" + t + " g");
183
- if (yield Y(
184
- g,
185
- o,
186
- ["aggregation", "extension", "composition", "dependency", "lollipop"],
187
- "classDiagram",
188
- t
189
- ), 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)) {
190
- const _ = c === "sandbox" ? b.nodes()[0].contentDocument : document, P = _.querySelectorAll('[id="' + t + '"] .edgeLabel .label');
191
- for (const w of P) {
192
- const C = w.getBBox(), x = _.createElementNS("http://www.w3.org/2000/svg", "rect");
193
- x.setAttribute("rx", 0), x.setAttribute("ry", 0), x.setAttribute("width", C.width), x.setAttribute("height", C.height), w.insertBefore(x, w.firstChild);
194
- }
195
- }
196
- });
197
- };
198
- function R(l) {
199
- let t;
200
- switch (l) {
201
- case 0:
202
- t = "aggregation";
203
- break;
204
- case 1:
205
- t = "extension";
206
- break;
207
- case 2:
208
- t = "composition";
209
- break;
210
- case 3:
211
- t = "dependency";
212
- break;
213
- case 4:
214
- t = "lollipop";
215
- break;
216
- default:
217
- t = "none";
218
- }
219
- return t;
220
- }
221
- const oe = {
222
- setConf: ee,
223
- draw: te
224
- }, fe = {
225
- parser: W,
226
- db: $,
227
- renderer: oe,
228
- styles: J,
229
- init: (l) => {
230
- l.class || (l.class = {}), l.class.arrowMarkerAbsolute = l.arrowMarkerAbsolute, $.clear();
231
- }
232
- };
233
- export {
234
- fe as diagram
235
- };