lowcoder-comps 0.0.6 → 0.0.8

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 (41) hide show
  1. package/package/012a06bb.js +34 -0
  2. package/package/06481cb7.js +1060 -0
  3. package/package/0c8b29d5.js +6 -0
  4. package/package/114884df.js +805 -0
  5. package/package/1264ddb2.js +194 -0
  6. package/package/1cee31ec.js +1095 -0
  7. package/package/269c3ba3.js +46662 -0
  8. package/package/2a2c2e55.js +799 -0
  9. package/package/2b3ab1e4.js +98763 -0
  10. package/package/37590a81.js +967 -0
  11. package/package/3cd7980e.js +184 -0
  12. package/package/40112498.js +424 -0
  13. package/package/4b6e1d6f.js +24 -0
  14. package/package/4bc1082b.js +86 -0
  15. package/package/53e49f9b.js +1600 -0
  16. package/package/55bd5c26.js +266 -0
  17. package/package/591684c8.js +2071 -0
  18. package/package/6c000872.js +16 -0
  19. package/package/756addec.js +775 -0
  20. package/package/7668124e.js +8 -0
  21. package/package/79e8eeeb.js +949 -0
  22. package/package/926fbfec.js +91 -0
  23. package/package/945eefb3.js +2665 -0
  24. package/package/a35f148e.js +1228 -0
  25. package/package/a4d12a43.js +175 -0
  26. package/package/a60de5d1.js +804 -0
  27. package/package/a8dde1ea.js +589 -0
  28. package/package/b4148642.js +7 -0
  29. package/package/b7dd22a2.js +847 -0
  30. package/package/d4f3a2c4.js +18046 -0
  31. package/package/e0f479f3.js +91 -0
  32. package/package/eaa160c9.js +341 -0
  33. package/package/f1bfd8b5.js +311 -0
  34. package/package/f1f9ba79.js +900 -0
  35. package/package/fba61f63.js +2868 -0
  36. package/package/icons/icon-chart.svg +15 -0
  37. package/package/icons/icon-comp-calendar.svg +22 -0
  38. package/package/index.js +5 -0
  39. package/package/package.json +73 -0
  40. package/package.json +10 -2
  41. package/src/index.ts +2 -0
@@ -0,0 +1,194 @@
1
+ var z = Object.defineProperty;
2
+ var A = Object.getOwnPropertySymbols;
3
+ var q = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
4
+ var N = (o, t, n) => t in o ? z(o, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[t] = n, S = (o, t) => {
5
+ for (var n in t || (t = {}))
6
+ q.call(t, n) && N(o, n, t[n]);
7
+ if (A)
8
+ for (var n of A(t))
9
+ F.call(t, n) && N(o, n, t[n]);
10
+ return o;
11
+ };
12
+ import { p as H, d as _, s as P } from "./79e8eeeb.js";
13
+ import { l as y, c as i, h as k, y as V, t as W, r as R, o as B, p as J, k as G } from "./2b3ab1e4.js";
14
+ import { G as K } from "./945eefb3.js";
15
+ import { r as Q } from "./eaa160c9.js";
16
+ import "./06481cb7.js";
17
+ import "./a60de5d1.js";
18
+ import "./a4d12a43.js";
19
+ import "./012a06bb.js";
20
+ import "./0c8b29d5.js";
21
+ import "./e0f479f3.js";
22
+ const I = (o) => G.sanitizeText(o, i());
23
+ let T = {
24
+ dividerMargin: 10,
25
+ padding: 5,
26
+ textHeight: 10,
27
+ curve: void 0
28
+ };
29
+ const U = function(o, t, n, a) {
30
+ const e = Object.keys(o);
31
+ y.info("keys:", e), y.info(o), e.forEach(function(r) {
32
+ var u, h;
33
+ var s, c;
34
+ const l = o[r];
35
+ let b = "";
36
+ l.cssClasses.length > 0 && (b = b + " " + l.cssClasses.join(" "));
37
+ const d = { labelStyle: "", style: "" }, v = (u = l.label) != null ? u : l.id, p = 0, m = "class_box", f = {
38
+ labelStyle: d.labelStyle,
39
+ shape: m,
40
+ labelText: I(v),
41
+ classData: l,
42
+ rx: p,
43
+ ry: p,
44
+ class: b,
45
+ style: d.style,
46
+ id: l.id,
47
+ domId: l.domId,
48
+ tooltip: a.db.getTooltip(l.id) || "",
49
+ haveCallback: l.haveCallback,
50
+ link: l.link,
51
+ width: l.type === "group" ? 500 : void 0,
52
+ type: l.type,
53
+ padding: (h = (s = i().flowchart) == null ? void 0 : s.padding) != null ? h : (c = i().class) == null ? void 0 : c.padding
54
+ };
55
+ t.setNode(l.id, f), y.info("setNode", f);
56
+ });
57
+ }, X = function(o, t, n, a) {
58
+ y.info(o), o.forEach(function(e, r) {
59
+ var g;
60
+ var s, c;
61
+ const l = e, b = "", d = { labelStyle: "", style: "" }, v = l.text, p = 0, m = "note", f = {
62
+ labelStyle: d.labelStyle,
63
+ shape: m,
64
+ labelText: I(v),
65
+ noteData: l,
66
+ rx: p,
67
+ ry: p,
68
+ class: b,
69
+ style: d.style,
70
+ id: l.id,
71
+ domId: l.id,
72
+ tooltip: "",
73
+ type: "note",
74
+ padding: (g = (s = i().flowchart) == null ? void 0 : s.padding) != null ? g : (c = i().class) == null ? void 0 : c.padding
75
+ };
76
+ if (t.setNode(l.id, f), y.info("setNode", f), !l.class || !(l.class in a))
77
+ return;
78
+ const u = n + r, h = {
79
+ id: `edgeNote${u}`,
80
+ classes: "relation",
81
+ pattern: "dotted",
82
+ arrowhead: "none",
83
+ startLabelRight: "",
84
+ endLabelLeft: "",
85
+ arrowTypeStart: "none",
86
+ arrowTypeEnd: "none",
87
+ style: "fill:none",
88
+ labelStyle: "",
89
+ curve: R(T.curve, B)
90
+ };
91
+ t.setEdge(l.id, l.class, h, u);
92
+ });
93
+ }, Y = function(o, t) {
94
+ const n = i().flowchart;
95
+ let a = 0;
96
+ o.forEach(function(e) {
97
+ var c;
98
+ var r;
99
+ a++;
100
+ const s = {
101
+ classes: "relation",
102
+ pattern: e.relation.lineType == 1 ? "dashed" : "solid",
103
+ id: "id" + a,
104
+ arrowhead: e.type === "arrow_open" ? "none" : "normal",
105
+ startLabelRight: e.relationTitle1 === "none" ? "" : e.relationTitle1,
106
+ endLabelLeft: e.relationTitle2 === "none" ? "" : e.relationTitle2,
107
+ arrowTypeStart: M(e.relation.type1),
108
+ arrowTypeEnd: M(e.relation.type2),
109
+ style: "fill:none",
110
+ labelStyle: "",
111
+ curve: R(n == null ? void 0 : n.curve, B)
112
+ };
113
+ if (y.info(s, e), e.style !== void 0) {
114
+ const l = J(e.style);
115
+ s.style = l.style, s.labelStyle = l.labelStyle;
116
+ }
117
+ e.text = e.title, e.text === void 0 ? e.style !== void 0 && (s.arrowheadStyle = "fill: #333") : (s.arrowheadStyle = "fill: #333", s.labelpos = "c", ((c = (r = i().flowchart) == null ? void 0 : r.htmlLabels) != null ? c : i().htmlLabels) ? (s.labelType = "html", s.label = '<span class="edgeLabel">' + e.text + "</span>") : (s.labelType = "text", s.label = e.text.replace(G.lineBreakRegex, `
118
+ `), 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, a);
119
+ });
120
+ }, Z = function(o) {
121
+ T = S(S({}, T), o);
122
+ }, j = function(o, t, n, a) {
123
+ var h, g, L, C;
124
+ y.info("Drawing class - ", t);
125
+ const e = (h = i().flowchart) != null ? h : i().class, r = i().securityLevel;
126
+ y.info("config:", e);
127
+ const s = (g = e == null ? void 0 : e.nodeSpacing) != null ? g : 50, c = (L = e == null ? void 0 : e.rankSpacing) != null ? L : 50, l = new K({
128
+ multigraph: !0,
129
+ compound: !0
130
+ }).setGraph({
131
+ rankdir: a.db.getDirection(),
132
+ nodesep: s,
133
+ ranksep: c,
134
+ marginx: 8,
135
+ marginy: 8
136
+ }).setDefaultEdgeLabel(function() {
137
+ return {};
138
+ }), b = a.db.getClasses(), d = a.db.getRelations(), v = a.db.getNotes();
139
+ y.info(d), U(b, l, t, a), Y(d, l), X(v, l, d.length + 1, b);
140
+ let p;
141
+ r === "sandbox" && (p = k("#i" + t));
142
+ const m = r === "sandbox" ? k(p.nodes()[0].contentDocument.body) : k("body"), f = m.select(`[id="${t}"]`), u = m.select("#" + t + " g");
143
+ if (Q(
144
+ u,
145
+ l,
146
+ ["aggregation", "extension", "composition", "dependency", "lollipop"],
147
+ "classDiagram",
148
+ t
149
+ ), V.insertTitle(f, "classTitleText", (C = e == null ? void 0 : e.titleTopMargin) != null ? C : 5, a.db.getDiagramTitle()), W(l, f, e == null ? void 0 : e.diagramPadding, e == null ? void 0 : e.useMaxWidth), !(e != null && e.htmlLabels)) {
150
+ const D = r === "sandbox" ? p.nodes()[0].contentDocument : document, $ = D.querySelectorAll('[id="' + t + '"] .edgeLabel .label');
151
+ for (const w of $) {
152
+ const E = w.getBBox(), x = D.createElementNS("http://www.w3.org/2000/svg", "rect");
153
+ x.setAttribute("rx", 0), x.setAttribute("ry", 0), x.setAttribute("width", E.width), x.setAttribute("height", E.height), w.insertBefore(x, w.firstChild);
154
+ }
155
+ }
156
+ };
157
+ function M(o) {
158
+ let t;
159
+ switch (o) {
160
+ case 0:
161
+ t = "aggregation";
162
+ break;
163
+ case 1:
164
+ t = "extension";
165
+ break;
166
+ case 2:
167
+ t = "composition";
168
+ break;
169
+ case 3:
170
+ t = "dependency";
171
+ break;
172
+ case 4:
173
+ t = "lollipop";
174
+ break;
175
+ default:
176
+ t = "none";
177
+ }
178
+ return t;
179
+ }
180
+ const O = {
181
+ setConf: Z,
182
+ draw: j
183
+ }, pe = {
184
+ parser: H,
185
+ db: _,
186
+ renderer: O,
187
+ styles: P,
188
+ init: (o) => {
189
+ o.class || (o.class = {}), o.class.arrowMarkerAbsolute = o.arrowMarkerAbsolute, _.clear();
190
+ }
191
+ };
192
+ export {
193
+ pe as diagram
194
+ };