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 ADDED
@@ -0,0 +1,70 @@
1
+ import { n as a } from "./c7fbe06d.js";
2
+ const l = function(e, t) {
3
+ const r = e.append("rect");
4
+ if (r.attr("x", t.x), r.attr("y", t.y), r.attr("fill", t.fill), r.attr("stroke", t.stroke), r.attr("width", t.width), r.attr("height", t.height), r.attr("rx", t.rx), r.attr("ry", t.ry), t.attrs !== "undefined" && t.attrs !== null)
5
+ for (let n in t.attrs)
6
+ r.attr(n, t.attrs[n]);
7
+ return t.class !== "undefined" && r.attr("class", t.class), r;
8
+ }, c = function(e, t) {
9
+ l(e, {
10
+ x: t.startx,
11
+ y: t.starty,
12
+ width: t.stopx - t.startx,
13
+ height: t.stopy - t.starty,
14
+ fill: t.fill,
15
+ stroke: t.stroke,
16
+ class: "rect"
17
+ }).lower();
18
+ }, x = function(e, t) {
19
+ const r = t.text.replace(/<br\s*\/?>/gi, " "), n = e.append("text");
20
+ n.attr("x", t.x), n.attr("y", t.y), n.attr("class", "legend"), n.style("text-anchor", t.anchor), t.class !== void 0 && n.attr("class", t.class);
21
+ const s = n.append("tspan");
22
+ return s.attr("x", t.x + t.textMargin * 2), s.text(r), n;
23
+ }, d = function(e, t, r, n) {
24
+ const s = e.append("image");
25
+ s.attr("x", t), s.attr("y", r);
26
+ var i = a(n);
27
+ s.attr("xlink:href", i);
28
+ }, f = function(e, t, r, n) {
29
+ const s = e.append("use");
30
+ s.attr("x", t), s.attr("y", r);
31
+ const i = a(n);
32
+ s.attr("xlink:href", "#" + i);
33
+ }, h = function() {
34
+ return {
35
+ x: 0,
36
+ y: 0,
37
+ width: 100,
38
+ height: 100,
39
+ fill: "#EDF2AE",
40
+ stroke: "#666",
41
+ anchor: "start",
42
+ rx: 0,
43
+ ry: 0
44
+ };
45
+ }, g = function() {
46
+ return {
47
+ x: 0,
48
+ y: 0,
49
+ width: 100,
50
+ height: 100,
51
+ fill: void 0,
52
+ anchor: void 0,
53
+ "text-anchor": "start",
54
+ style: "#666",
55
+ textMargin: 0,
56
+ rx: 0,
57
+ ry: 0,
58
+ tspan: !0,
59
+ valign: void 0
60
+ };
61
+ };
62
+ export {
63
+ c as a,
64
+ f as b,
65
+ d as c,
66
+ l as d,
67
+ g as e,
68
+ x as f,
69
+ h as g
70
+ };
package/0f86ef29.js ADDED
@@ -0,0 +1,451 @@
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 "./86704c08.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 "./c7fbe06d.js";
19
+ import { f as K } from "./1a864f3d.js";
20
+ import { r as Q } from "./17e7d0bf.js";
21
+ import { s as Y } from "./cf7adbfe.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
+ };