lowcoder-comps 0.0.7 → 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.
- package/icons/icon-chart.svg +15 -0
- package/icons/icon-comp-calendar.svg +22 -0
- package/index.html +26 -0
- package/index.tsx +19 -0
- package/jest.config.js +5 -0
- package/package/012a06bb.js +34 -0
- package/package/06481cb7.js +1060 -0
- package/package/0c8b29d5.js +6 -0
- package/package/114884df.js +805 -0
- package/package/1264ddb2.js +194 -0
- package/package/1cee31ec.js +1095 -0
- package/package/269c3ba3.js +46662 -0
- package/package/2a2c2e55.js +799 -0
- package/package/2b3ab1e4.js +98763 -0
- package/package/37590a81.js +967 -0
- package/package/3cd7980e.js +184 -0
- package/package/40112498.js +424 -0
- package/package/4b6e1d6f.js +24 -0
- package/package/4bc1082b.js +86 -0
- package/package/53e49f9b.js +1600 -0
- package/package/55bd5c26.js +266 -0
- package/package/591684c8.js +2071 -0
- package/package/6c000872.js +16 -0
- package/package/756addec.js +775 -0
- package/package/7668124e.js +8 -0
- package/package/79e8eeeb.js +949 -0
- package/package/926fbfec.js +91 -0
- package/package/945eefb3.js +2665 -0
- package/package/a35f148e.js +1228 -0
- package/package/a4d12a43.js +175 -0
- package/package/a60de5d1.js +804 -0
- package/package/a8dde1ea.js +589 -0
- package/package/b4148642.js +7 -0
- package/package/b7dd22a2.js +847 -0
- package/package/d4f3a2c4.js +18046 -0
- package/package/e0f479f3.js +91 -0
- package/package/eaa160c9.js +341 -0
- package/package/f1bfd8b5.js +311 -0
- package/package/f1f9ba79.js +900 -0
- package/package/fba61f63.js +2868 -0
- package/package/icons/icon-chart.svg +15 -0
- package/package/icons/icon-comp-calendar.svg +22 -0
- package/package/index.js +5 -0
- package/package/package.json +73 -0
- package/package.json +1 -4
- package/src/__test__/allComp.test.tsx +61 -0
- package/src/app-env.d.ts +3 -0
- package/src/comps/calendarComp/calendarComp.tsx +442 -0
- package/src/comps/calendarComp/calendarConstants.tsx +897 -0
- package/src/comps/chartComp/chartComp.tsx +249 -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 +6 -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 +243 -0
- package/src/comps/chartComp/chartPropertyView.tsx +161 -0
- package/src/comps/chartComp/chartUtils.ts +240 -0
- package/src/comps/chartComp/reactEcharts/core.tsx +187 -0
- package/src/comps/chartComp/reactEcharts/index.ts +20 -0
- package/src/comps/chartComp/reactEcharts/types.ts +70 -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 +142 -0
- package/src/i18n/comps/locales/enObj.tsx +120 -0
- package/src/i18n/comps/locales/index.ts +7 -0
- package/src/i18n/comps/locales/types.tsx +9 -0
- package/src/i18n/comps/locales/zh.ts +4 -0
- package/src/i18n/comps/locales/zhObj.tsx +4 -0
- package/src/index.ts +11 -0
- package/vite.config.js +10 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { a2 as C, y as E, l as b, a3 as w } from "./2b3ab1e4.js";
|
|
2
|
+
import { l as k } from "./012a06bb.js";
|
|
3
|
+
let S = 0;
|
|
4
|
+
const O = function(i, e, t, n, r) {
|
|
5
|
+
const a = function(o) {
|
|
6
|
+
switch (o) {
|
|
7
|
+
case r.db.relationType.AGGREGATION:
|
|
8
|
+
return "aggregation";
|
|
9
|
+
case r.db.relationType.EXTENSION:
|
|
10
|
+
return "extension";
|
|
11
|
+
case r.db.relationType.COMPOSITION:
|
|
12
|
+
return "composition";
|
|
13
|
+
case r.db.relationType.DEPENDENCY:
|
|
14
|
+
return "dependency";
|
|
15
|
+
case r.db.relationType.LOLLIPOP:
|
|
16
|
+
return "lollipop";
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
e.points = e.points.filter((o) => !Number.isNaN(o.y));
|
|
20
|
+
const l = e.points, d = k().x(function(o) {
|
|
21
|
+
return o.x;
|
|
22
|
+
}).y(function(o) {
|
|
23
|
+
return o.y;
|
|
24
|
+
}).curve(C), s = i.append("path").attr("d", d(l)).attr("id", "edge" + S).attr("class", "relation");
|
|
25
|
+
let g = "";
|
|
26
|
+
n.arrowMarkerAbsolute && (g = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, g = g.replace(/\(/g, "\\("), g = g.replace(/\)/g, "\\)")), t.relation.lineType == 1 && s.attr("class", "relation dashed-line"), t.relation.lineType == 10 && s.attr("class", "relation dotted-line"), t.relation.type1 !== "none" && s.attr(
|
|
27
|
+
"marker-start",
|
|
28
|
+
"url(" + g + "#" + a(t.relation.type1) + "Start)"
|
|
29
|
+
), t.relation.type2 !== "none" && s.attr(
|
|
30
|
+
"marker-end",
|
|
31
|
+
"url(" + g + "#" + a(t.relation.type2) + "End)"
|
|
32
|
+
);
|
|
33
|
+
let f, c;
|
|
34
|
+
const p = e.points.length;
|
|
35
|
+
let v = E.calcLabelPosition(e.points);
|
|
36
|
+
f = v.x, c = v.y;
|
|
37
|
+
let x, B, N, m;
|
|
38
|
+
if (p % 2 !== 0 && p > 1) {
|
|
39
|
+
let o = E.calcCardinalityPosition(
|
|
40
|
+
t.relation.type1 !== "none",
|
|
41
|
+
e.points,
|
|
42
|
+
e.points[0]
|
|
43
|
+
), u = E.calcCardinalityPosition(
|
|
44
|
+
t.relation.type2 !== "none",
|
|
45
|
+
e.points,
|
|
46
|
+
e.points[p - 1]
|
|
47
|
+
);
|
|
48
|
+
b.debug("cardinality_1_point " + JSON.stringify(o)), b.debug("cardinality_2_point " + JSON.stringify(u)), x = o.x, B = o.y, N = u.x, m = u.y;
|
|
49
|
+
}
|
|
50
|
+
if (t.title !== void 0) {
|
|
51
|
+
const o = i.append("g").attr("class", "classLabel"), u = o.append("text").attr("class", "label").attr("x", f).attr("y", c).attr("fill", "red").attr("text-anchor", "middle").text(t.title);
|
|
52
|
+
window.label = u;
|
|
53
|
+
const h = u.node().getBBox();
|
|
54
|
+
o.insert("rect", ":first-child").attr("class", "box").attr("x", h.x - n.padding / 2).attr("y", h.y - n.padding / 2).attr("width", h.width + n.padding).attr("height", h.height + n.padding);
|
|
55
|
+
}
|
|
56
|
+
b.info("Rendering relation " + JSON.stringify(t)), t.relationTitle1 !== void 0 && t.relationTitle1 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type1").attr("x", x).attr("y", B).attr("fill", "black").attr("font-size", "6").text(t.relationTitle1), t.relationTitle2 !== void 0 && t.relationTitle2 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type2").attr("x", N).attr("y", m).attr("fill", "black").attr("font-size", "6").text(t.relationTitle2), S++;
|
|
57
|
+
}, P = function(i, e, t, n) {
|
|
58
|
+
b.debug("Rendering class ", e, t);
|
|
59
|
+
const r = e.id, a = {
|
|
60
|
+
id: r,
|
|
61
|
+
label: e.id,
|
|
62
|
+
width: 0,
|
|
63
|
+
height: 0
|
|
64
|
+
}, l = i.append("g").attr("id", n.db.lookUpDomId(r)).attr("class", "classGroup");
|
|
65
|
+
let d;
|
|
66
|
+
e.link ? d = l.append("svg:a").attr("xlink:href", e.link).attr("target", e.linkTarget).append("text").attr("y", t.textHeight + t.padding).attr("x", 0) : d = l.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
|
|
67
|
+
let s = !0;
|
|
68
|
+
e.annotations.forEach(function(y) {
|
|
69
|
+
const H = d.append("tspan").text("\xAB" + y + "\xBB");
|
|
70
|
+
s || H.attr("dy", t.textHeight), s = !1;
|
|
71
|
+
});
|
|
72
|
+
let g = e.id;
|
|
73
|
+
e.type !== void 0 && e.type !== "" && (g += "<" + e.type + ">");
|
|
74
|
+
const f = d.append("tspan").text(g).attr("class", "title");
|
|
75
|
+
s || f.attr("dy", t.textHeight);
|
|
76
|
+
const c = d.node().getBBox().height, p = l.append("line").attr("x1", 0).attr("y1", t.padding + c + t.dividerMargin / 2).attr("y2", t.padding + c + t.dividerMargin / 2), v = l.append("text").attr("x", t.padding).attr("y", c + t.dividerMargin + t.textHeight).attr("fill", "white").attr("class", "classText");
|
|
77
|
+
s = !0, e.members.forEach(function(y) {
|
|
78
|
+
_(v, y, s, t), s = !1;
|
|
79
|
+
});
|
|
80
|
+
const x = v.node().getBBox(), B = l.append("line").attr("x1", 0).attr("y1", t.padding + c + t.dividerMargin + x.height).attr("y2", t.padding + c + t.dividerMargin + x.height), N = l.append("text").attr("x", t.padding).attr("y", c + 2 * t.dividerMargin + x.height + t.textHeight).attr("fill", "white").attr("class", "classText");
|
|
81
|
+
s = !0, e.methods.forEach(function(y) {
|
|
82
|
+
_(N, y, s, t), s = !1;
|
|
83
|
+
});
|
|
84
|
+
const m = l.node().getBBox();
|
|
85
|
+
var o = " ";
|
|
86
|
+
e.cssClasses.length > 0 && (o = o + e.cssClasses.join(" "));
|
|
87
|
+
const h = l.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", m.width + 2 * t.padding).attr("height", m.height + t.padding + 0.5 * t.dividerMargin).attr("class", o).node().getBBox().width;
|
|
88
|
+
return d.node().childNodes.forEach(function(y) {
|
|
89
|
+
y.setAttribute("x", (h - y.getBBox().width) / 2);
|
|
90
|
+
}), e.tooltip && d.insert("title").text(e.tooltip), p.attr("x2", h), B.attr("x2", h), a.width = h, a.height = m.height + t.padding + 0.5 * t.dividerMargin, a;
|
|
91
|
+
}, I = function(i, e, t, n) {
|
|
92
|
+
b.debug("Rendering note ", e, t);
|
|
93
|
+
const r = e.id, a = {
|
|
94
|
+
id: r,
|
|
95
|
+
text: e.text,
|
|
96
|
+
width: 0,
|
|
97
|
+
height: 0
|
|
98
|
+
}, l = i.append("g").attr("id", r).attr("class", "classGroup");
|
|
99
|
+
let d = l.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
|
|
100
|
+
const s = JSON.parse(`"${e.text}"`).split(`
|
|
101
|
+
`);
|
|
102
|
+
s.forEach(function(p) {
|
|
103
|
+
b.debug(`Adding line: ${p}`), d.append("tspan").text(p).attr("class", "title").attr("dy", t.textHeight);
|
|
104
|
+
});
|
|
105
|
+
const g = l.node().getBBox(), c = l.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", g.width + 2 * t.padding).attr(
|
|
106
|
+
"height",
|
|
107
|
+
g.height + s.length * t.textHeight + t.padding + 0.5 * t.dividerMargin
|
|
108
|
+
).node().getBBox().width;
|
|
109
|
+
return d.node().childNodes.forEach(function(p) {
|
|
110
|
+
p.setAttribute("x", (c - p.getBBox().width) / 2);
|
|
111
|
+
}), a.width = c, a.height = g.height + s.length * t.textHeight + t.padding + 0.5 * t.dividerMargin, a;
|
|
112
|
+
}, T = function(i) {
|
|
113
|
+
const e = /^([#+~-])?(\w+)(~\w+~|\[])?\s+(\w+) *([$*])?$/, t = /^([#+|~-])?(\w+) *\( *(.*)\) *([$*])? *(\w*[[\]|~]*\s*\w*~?)$/;
|
|
114
|
+
let n = i.match(e), r = i.match(t);
|
|
115
|
+
return n && !r ? L(n) : r ? R(r) : $(i);
|
|
116
|
+
}, L = function(i) {
|
|
117
|
+
let e = "", t = "";
|
|
118
|
+
try {
|
|
119
|
+
let n = i[1] ? i[1].trim() : "", r = i[2] ? i[2].trim() : "", a = i[3] ? w(i[3].trim()) : "", l = i[4] ? i[4].trim() : "", d = i[5] ? i[5].trim() : "";
|
|
120
|
+
t = n + r + a + " " + l, e = M(d);
|
|
121
|
+
} catch (n) {
|
|
122
|
+
t = i;
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
displayText: t,
|
|
126
|
+
cssStyle: e
|
|
127
|
+
};
|
|
128
|
+
}, R = function(i) {
|
|
129
|
+
let e = "", t = "";
|
|
130
|
+
try {
|
|
131
|
+
let n = i[1] ? i[1].trim() : "", r = i[2] ? i[2].trim() : "", a = i[3] ? w(i[3].trim()) : "", l = i[4] ? i[4].trim() : "", d = i[5] ? " : " + w(i[5]).trim() : "";
|
|
132
|
+
t = n + r + "(" + a + ")" + d, e = M(l);
|
|
133
|
+
} catch (n) {
|
|
134
|
+
t = i;
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
displayText: t,
|
|
138
|
+
cssStyle: e
|
|
139
|
+
};
|
|
140
|
+
}, $ = function(i) {
|
|
141
|
+
let e = "", t = "", n = "", r = i.indexOf("("), a = i.indexOf(")");
|
|
142
|
+
if (r > 1 && a > r && a <= i.length) {
|
|
143
|
+
let l = "", d = "", s = i.substring(0, 1);
|
|
144
|
+
s.match(/\w/) ? d = i.substring(0, r).trim() : (s.match(/[#+~-]/) && (l = s), d = i.substring(1, r).trim());
|
|
145
|
+
const g = i.substring(r + 1, a);
|
|
146
|
+
i.substring(a + 1, 1), t = M(i.substring(a + 1, a + 2)), e = l + d + "(" + w(g.trim()) + ")", a < i.length && (n = i.substring(a + 2).trim(), n !== "" && (n = " : " + w(n), e += n));
|
|
147
|
+
} else
|
|
148
|
+
e = w(i);
|
|
149
|
+
return {
|
|
150
|
+
displayText: e,
|
|
151
|
+
cssStyle: t
|
|
152
|
+
};
|
|
153
|
+
}, _ = function(i, e, t, n) {
|
|
154
|
+
let r = T(e);
|
|
155
|
+
const a = i.append("tspan").attr("x", n.padding).text(r.displayText);
|
|
156
|
+
r.cssStyle !== "" && a.attr("style", r.cssStyle), t || a.attr("dy", n.textHeight);
|
|
157
|
+
}, M = function(i) {
|
|
158
|
+
switch (i) {
|
|
159
|
+
case "*":
|
|
160
|
+
return "font-style:italic;";
|
|
161
|
+
case "$":
|
|
162
|
+
return "text-decoration:underline;";
|
|
163
|
+
default:
|
|
164
|
+
return "";
|
|
165
|
+
}
|
|
166
|
+
}, J = {
|
|
167
|
+
drawClass: P,
|
|
168
|
+
drawEdge: O,
|
|
169
|
+
drawNote: I,
|
|
170
|
+
parseMember: T
|
|
171
|
+
};
|
|
172
|
+
export {
|
|
173
|
+
T as p,
|
|
174
|
+
J as s
|
|
175
|
+
};
|