lowcoder-comps 0.0.31 → 0.0.32
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/1e5cb9c2.js +447 -0
- package/24307cf2.js +25 -0
- package/256b619e.js +92 -0
- package/2b031be2.js +2967 -0
- package/2ff2c7a6.js +6 -0
- package/2ff7471d.js +9 -0
- package/444e09f1.js +268 -0
- package/4564a1bc.js +86 -0
- package/4a489df6.js +8 -0
- package/4a860f5d.js +505 -0
- package/4cc9caa5.js +2501 -0
- package/64d87c95.js +1536 -0
- package/6deaf0be.js +881 -0
- package/794e64d5.js +208 -0
- package/7a3f27e4.js +391 -0
- package/7ae6dd1c.js +319 -0
- package/92e85b65.js +65 -0
- package/97059d88.js +237 -0
- package/98955949.js +134435 -0
- package/a408f817.js +796 -0
- package/a40faea7.js +11624 -0
- package/a969f4ca.js +48428 -0
- package/aa1becc7.js +455 -0
- package/aa82b740.js +1269 -0
- package/c289b0aa.js +1102 -0
- package/c4d99b09.js +5 -0
- package/c9bb75eb.js +960 -0
- package/cb40fdd9.js +933 -0
- package/cc799554.js +1276 -0
- package/d3700d97.js +2284 -0
- package/d622fb26.js +818 -0
- package/d8c50a91.js +34 -0
- package/dce9fa3f.js +769 -0
- package/de8c90a7.js +1284 -0
- package/debd9490.js +819 -0
- package/df803461.js +220 -0
- package/e06dcfb0.js +1089 -0
- package/e6388bfd.js +915 -0
- package/ee801edf.js +804 -0
- package/f7c6b13d.js +19104 -0
- package/f8b68c1a.js +1127 -0
- package/f9637058.js +16 -0
- package/fcee2d3c.js +64 -0
- package/fd51bb2f.js +1579 -0
- package/index.js +5 -0
- package/package.json +4 -3
- package/README.md +0 -120
- package/index.html +0 -26
- package/index.tsx +0 -21
- package/jest.config.js +0 -6
- package/src/__test__/allComp.test.tsx +0 -61
- package/src/app-env.d.ts +0 -3
- package/src/comps/calendarComp/calendarComp.tsx +0 -633
- package/src/comps/calendarComp/calendarConstants.tsx +0 -1048
- package/src/comps/calendarComp/errorBoundary.tsx +0 -30
- package/src/comps/chartComp/chartComp.tsx +0 -442
- package/src/comps/chartComp/chartConfigs/barChartConfig.tsx +0 -51
- package/src/comps/chartComp/chartConfigs/cartesianAxisConfig.tsx +0 -307
- package/src/comps/chartComp/chartConfigs/chartUrls.tsx +0 -9
- package/src/comps/chartComp/chartConfigs/legendConfig.tsx +0 -55
- package/src/comps/chartComp/chartConfigs/lineChartConfig.tsx +0 -96
- package/src/comps/chartComp/chartConfigs/pieChartConfig.tsx +0 -83
- package/src/comps/chartComp/chartConfigs/scatterChartConfig.tsx +0 -62
- package/src/comps/chartComp/chartConstants.tsx +0 -299
- package/src/comps/chartComp/chartPropertyView.tsx +0 -235
- package/src/comps/chartComp/chartUtils.ts +0 -291
- package/src/comps/chartComp/reactEcharts/core.tsx +0 -194
- package/src/comps/chartComp/reactEcharts/index.ts +0 -21
- package/src/comps/chartComp/reactEcharts/types.ts +0 -76
- package/src/comps/chartComp/seriesComp.tsx +0 -119
- package/src/comps/imageEditorComp/imageEditorClass.tsx +0 -52
- package/src/comps/imageEditorComp/imageEditorConstants.tsx +0 -109
- package/src/comps/imageEditorComp/index.tsx +0 -184
- package/src/comps/mermaidComp/index.tsx +0 -44
- package/src/comps/mermaidComp/mermaid.tsx +0 -29
- package/src/global.ts +0 -1
- package/src/i18n/comps/index.tsx +0 -29
- package/src/i18n/comps/locales/en.ts +0 -163
- package/src/i18n/comps/locales/enObj.tsx +0 -198
- package/src/i18n/comps/locales/index.ts +0 -7
- package/src/i18n/comps/locales/types.tsx +0 -10
- package/src/i18n/comps/locales/zh.ts +0 -156
- package/src/i18n/comps/locales/zhObj.tsx +0 -4
- package/src/index.ts +0 -11
- package/tsconfig.json +0 -22
- package/vite.config.js +0 -10
package/df803461.js
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { p as A, d as S, s as G } from "./e06dcfb0.js";
|
|
2
|
+
import { c as v, l as y, h as B, i as W, F as $, A as M, G as I } from "./98955949.js";
|
|
3
|
+
import { G as O } from "./6deaf0be.js";
|
|
4
|
+
import { l as P } from "./64d87c95.js";
|
|
5
|
+
import { l as X } from "./d8c50a91.js";
|
|
6
|
+
import "./2ff2c7a6.js";
|
|
7
|
+
import "./256b619e.js";
|
|
8
|
+
let H = 0;
|
|
9
|
+
const Y = function(i, a, t, o, p) {
|
|
10
|
+
const g = function(e) {
|
|
11
|
+
switch (e) {
|
|
12
|
+
case p.db.relationType.AGGREGATION:
|
|
13
|
+
return "aggregation";
|
|
14
|
+
case p.db.relationType.EXTENSION:
|
|
15
|
+
return "extension";
|
|
16
|
+
case p.db.relationType.COMPOSITION:
|
|
17
|
+
return "composition";
|
|
18
|
+
case p.db.relationType.DEPENDENCY:
|
|
19
|
+
return "dependency";
|
|
20
|
+
case p.db.relationType.LOLLIPOP:
|
|
21
|
+
return "lollipop";
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
a.points = a.points.filter((e) => !Number.isNaN(e.y));
|
|
25
|
+
const s = a.points, c = X().x(function(e) {
|
|
26
|
+
return e.x;
|
|
27
|
+
}).y(function(e) {
|
|
28
|
+
return e.y;
|
|
29
|
+
}).curve($), n = i.append("path").attr("d", c(s)).attr("id", "edge" + H).attr("class", "relation");
|
|
30
|
+
let r = "";
|
|
31
|
+
o.arrowMarkerAbsolute && (r = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, r = r.replace(/\(/g, "\\("), r = r.replace(/\)/g, "\\)")), t.relation.lineType == 1 && n.attr("class", "relation dashed-line"), t.relation.lineType == 10 && n.attr("class", "relation dotted-line"), t.relation.type1 !== "none" && n.attr(
|
|
32
|
+
"marker-start",
|
|
33
|
+
"url(" + r + "#" + g(t.relation.type1) + "Start)"
|
|
34
|
+
), t.relation.type2 !== "none" && n.attr(
|
|
35
|
+
"marker-end",
|
|
36
|
+
"url(" + r + "#" + g(t.relation.type2) + "End)"
|
|
37
|
+
);
|
|
38
|
+
let f, h;
|
|
39
|
+
const x = a.points.length;
|
|
40
|
+
let b = M.calcLabelPosition(a.points);
|
|
41
|
+
f = b.x, h = b.y;
|
|
42
|
+
let u, m, w, k;
|
|
43
|
+
if (x % 2 !== 0 && x > 1) {
|
|
44
|
+
let e = M.calcCardinalityPosition(
|
|
45
|
+
t.relation.type1 !== "none",
|
|
46
|
+
a.points,
|
|
47
|
+
a.points[0]
|
|
48
|
+
), d = M.calcCardinalityPosition(
|
|
49
|
+
t.relation.type2 !== "none",
|
|
50
|
+
a.points,
|
|
51
|
+
a.points[x - 1]
|
|
52
|
+
);
|
|
53
|
+
y.debug("cardinality_1_point " + JSON.stringify(e)), y.debug("cardinality_2_point " + JSON.stringify(d)), u = e.x, m = e.y, w = d.x, k = d.y;
|
|
54
|
+
}
|
|
55
|
+
if (t.title !== void 0) {
|
|
56
|
+
const e = i.append("g").attr("class", "classLabel"), d = e.append("text").attr("class", "label").attr("x", f).attr("y", h).attr("fill", "red").attr("text-anchor", "middle").text(t.title);
|
|
57
|
+
window.label = d;
|
|
58
|
+
const l = d.node().getBBox();
|
|
59
|
+
e.insert("rect", ":first-child").attr("class", "box").attr("x", l.x - o.padding / 2).attr("y", l.y - o.padding / 2).attr("width", l.width + o.padding).attr("height", l.height + o.padding);
|
|
60
|
+
}
|
|
61
|
+
y.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", u).attr("y", m).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", w).attr("y", k).attr("fill", "black").attr("font-size", "6").text(t.relationTitle2), H++;
|
|
62
|
+
}, J = function(i, a, t, o) {
|
|
63
|
+
y.debug("Rendering class ", a, t);
|
|
64
|
+
const p = a.id, g = {
|
|
65
|
+
id: p,
|
|
66
|
+
label: a.id,
|
|
67
|
+
width: 0,
|
|
68
|
+
height: 0
|
|
69
|
+
}, s = i.append("g").attr("id", o.db.lookUpDomId(p)).attr("class", "classGroup");
|
|
70
|
+
let c;
|
|
71
|
+
a.link ? c = s.append("svg:a").attr("xlink:href", a.link).attr("target", a.linkTarget).append("text").attr("y", t.textHeight + t.padding).attr("x", 0) : c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
|
|
72
|
+
let n = !0;
|
|
73
|
+
a.annotations.forEach(function(d) {
|
|
74
|
+
const l = c.append("tspan").text("«" + d + "»");
|
|
75
|
+
n || l.attr("dy", t.textHeight), n = !1;
|
|
76
|
+
});
|
|
77
|
+
let r = C(a);
|
|
78
|
+
const f = c.append("tspan").text(r).attr("class", "title");
|
|
79
|
+
n || f.attr("dy", t.textHeight);
|
|
80
|
+
const h = c.node().getBBox().height;
|
|
81
|
+
let x, b, u;
|
|
82
|
+
if (a.members.length > 0) {
|
|
83
|
+
x = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin / 2).attr("y2", t.padding + h + t.dividerMargin / 2);
|
|
84
|
+
const d = s.append("text").attr("x", t.padding).attr("y", h + t.dividerMargin + t.textHeight).attr("fill", "white").attr("class", "classText");
|
|
85
|
+
n = !0, a.members.forEach(function(l) {
|
|
86
|
+
_(d, l, n, t), n = !1;
|
|
87
|
+
}), b = d.node().getBBox();
|
|
88
|
+
}
|
|
89
|
+
if (a.methods.length > 0) {
|
|
90
|
+
u = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin + b.height).attr("y2", t.padding + h + t.dividerMargin + b.height);
|
|
91
|
+
const d = s.append("text").attr("x", t.padding).attr("y", h + 2 * t.dividerMargin + b.height + t.textHeight).attr("fill", "white").attr("class", "classText");
|
|
92
|
+
n = !0, a.methods.forEach(function(l) {
|
|
93
|
+
_(d, l, n, t), n = !1;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
const m = s.node().getBBox();
|
|
97
|
+
var w = " ";
|
|
98
|
+
a.cssClasses.length > 0 && (w = w + a.cssClasses.join(" "));
|
|
99
|
+
const e = s.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", w).node().getBBox().width;
|
|
100
|
+
return c.node().childNodes.forEach(function(d) {
|
|
101
|
+
d.setAttribute("x", (e - d.getBBox().width) / 2);
|
|
102
|
+
}), a.tooltip && c.insert("title").text(a.tooltip), x && x.attr("x2", e), u && u.attr("x2", e), g.width = e, g.height = m.height + t.padding + 0.5 * t.dividerMargin, g;
|
|
103
|
+
}, C = function(i) {
|
|
104
|
+
let a = i.id;
|
|
105
|
+
return i.type && (a += "<" + I(i.type) + ">"), a;
|
|
106
|
+
}, Z = function(i, a, t, o) {
|
|
107
|
+
y.debug("Rendering note ", a, t);
|
|
108
|
+
const p = a.id, g = {
|
|
109
|
+
id: p,
|
|
110
|
+
text: a.text,
|
|
111
|
+
width: 0,
|
|
112
|
+
height: 0
|
|
113
|
+
}, s = i.append("g").attr("id", p).attr("class", "classGroup");
|
|
114
|
+
let c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
|
|
115
|
+
const n = JSON.parse(`"${a.text}"`).split(`
|
|
116
|
+
`);
|
|
117
|
+
n.forEach(function(x) {
|
|
118
|
+
y.debug(`Adding line: ${x}`), c.append("tspan").text(x).attr("class", "title").attr("dy", t.textHeight);
|
|
119
|
+
});
|
|
120
|
+
const r = s.node().getBBox(), h = s.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", r.width + 2 * t.padding).attr(
|
|
121
|
+
"height",
|
|
122
|
+
r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin
|
|
123
|
+
).node().getBBox().width;
|
|
124
|
+
return c.node().childNodes.forEach(function(x) {
|
|
125
|
+
x.setAttribute("x", (h - x.getBBox().width) / 2);
|
|
126
|
+
}), g.width = h, g.height = r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin, g;
|
|
127
|
+
}, _ = function(i, a, t, o) {
|
|
128
|
+
const { displayText: p, cssStyle: g } = a.getDisplayDetails(), s = i.append("tspan").attr("x", o.padding).text(p);
|
|
129
|
+
g !== "" && s.attr("style", a.cssStyle), t || s.attr("dy", o.textHeight);
|
|
130
|
+
}, N = {
|
|
131
|
+
getClassTitleString: C,
|
|
132
|
+
drawClass: J,
|
|
133
|
+
drawEdge: Y,
|
|
134
|
+
drawNote: Z
|
|
135
|
+
};
|
|
136
|
+
let T = {};
|
|
137
|
+
const E = 20, L = function(i) {
|
|
138
|
+
const a = Object.entries(T).find((t) => t[1].label === i);
|
|
139
|
+
if (a)
|
|
140
|
+
return a[0];
|
|
141
|
+
}, R = function(i) {
|
|
142
|
+
i.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), i.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"), i.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
143
|
+
}, F = function(i, a, t, o) {
|
|
144
|
+
const p = v().class;
|
|
145
|
+
T = {}, y.info("Rendering diagram " + i);
|
|
146
|
+
const g = v().securityLevel;
|
|
147
|
+
let s;
|
|
148
|
+
g === "sandbox" && (s = B("#i" + a));
|
|
149
|
+
const c = g === "sandbox" ? B(s.nodes()[0].contentDocument.body) : B("body"), n = c.select(`[id='${a}']`);
|
|
150
|
+
R(n);
|
|
151
|
+
const r = new O({
|
|
152
|
+
multigraph: !0
|
|
153
|
+
});
|
|
154
|
+
r.setGraph({
|
|
155
|
+
isMultiGraph: !0
|
|
156
|
+
}), r.setDefaultEdgeLabel(function() {
|
|
157
|
+
return {};
|
|
158
|
+
});
|
|
159
|
+
const f = o.db.getClasses(), h = Object.keys(f);
|
|
160
|
+
for (const e of h) {
|
|
161
|
+
const d = f[e], l = N.drawClass(n, d, p, o);
|
|
162
|
+
T[l.id] = l, r.setNode(l.id, l), y.info("Org height: " + l.height);
|
|
163
|
+
}
|
|
164
|
+
o.db.getRelations().forEach(function(e) {
|
|
165
|
+
y.info(
|
|
166
|
+
// cspell:ignore tjoho
|
|
167
|
+
"tjoho" + L(e.id1) + L(e.id2) + JSON.stringify(e)
|
|
168
|
+
), r.setEdge(
|
|
169
|
+
L(e.id1),
|
|
170
|
+
L(e.id2),
|
|
171
|
+
{
|
|
172
|
+
relation: e
|
|
173
|
+
},
|
|
174
|
+
e.title || "DEFAULT"
|
|
175
|
+
);
|
|
176
|
+
}), o.db.getNotes().forEach(function(e) {
|
|
177
|
+
y.debug(`Adding note: ${JSON.stringify(e)}`);
|
|
178
|
+
const d = N.drawNote(n, e, p, o);
|
|
179
|
+
T[d.id] = d, r.setNode(d.id, d), e.class && e.class in f && r.setEdge(
|
|
180
|
+
e.id,
|
|
181
|
+
L(e.class),
|
|
182
|
+
{
|
|
183
|
+
relation: {
|
|
184
|
+
id1: e.id,
|
|
185
|
+
id2: e.class,
|
|
186
|
+
relation: {
|
|
187
|
+
type1: "none",
|
|
188
|
+
type2: "none",
|
|
189
|
+
lineType: 10
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"DEFAULT"
|
|
194
|
+
);
|
|
195
|
+
}), P(r), r.nodes().forEach(function(e) {
|
|
196
|
+
e !== void 0 && r.node(e) !== void 0 && (y.debug("Node " + e + ": " + JSON.stringify(r.node(e))), c.select("#" + (o.db.lookUpDomId(e) || e)).attr(
|
|
197
|
+
"transform",
|
|
198
|
+
"translate(" + (r.node(e).x - r.node(e).width / 2) + "," + (r.node(e).y - r.node(e).height / 2) + " )"
|
|
199
|
+
));
|
|
200
|
+
}), r.edges().forEach(function(e) {
|
|
201
|
+
e !== void 0 && r.edge(e) !== void 0 && (y.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(r.edge(e))), N.drawEdge(n, r.edge(e), r.edge(e).relation, p, o));
|
|
202
|
+
});
|
|
203
|
+
const u = n.node().getBBox(), m = u.width + E * 2, w = u.height + E * 2;
|
|
204
|
+
W(n, w, m, p.useMaxWidth);
|
|
205
|
+
const k = `${u.x - E} ${u.y - E} ${m} ${w}`;
|
|
206
|
+
y.debug(`viewBox ${k}`), n.attr("viewBox", k);
|
|
207
|
+
}, U = {
|
|
208
|
+
draw: F
|
|
209
|
+
}, tt = {
|
|
210
|
+
parser: A,
|
|
211
|
+
db: S,
|
|
212
|
+
renderer: U,
|
|
213
|
+
styles: G,
|
|
214
|
+
init: (i) => {
|
|
215
|
+
i.class || (i.class = {}), i.class.arrowMarkerAbsolute = i.arrowMarkerAbsolute, S.clear();
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
export {
|
|
219
|
+
tt as diagram
|
|
220
|
+
};
|