lowcoder-comps 0.0.31 → 0.0.33

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 (87) hide show
  1. package/00bb478a.js +1102 -0
  2. package/02bef5a4.js +505 -0
  3. package/057d2a44.js +1127 -0
  4. package/0964fcc6.js +34 -0
  5. package/14220e98.js +1276 -0
  6. package/1c074fe4.js +25 -0
  7. package/250a6954.js +804 -0
  8. package/256b619e.js +92 -0
  9. package/2cd27cf0.js +2501 -0
  10. package/2f064957.js +64 -0
  11. package/2ff2c7a6.js +6 -0
  12. package/2ff7471d.js +9 -0
  13. package/30c4916b.js +8 -0
  14. package/36ec7270.js +915 -0
  15. package/38c14832.js +960 -0
  16. package/3ae34bed.js +819 -0
  17. package/3e2939fa.js +237 -0
  18. package/3f5f874f.js +86 -0
  19. package/3fb86fb9.js +447 -0
  20. package/415177f9.js +1579 -0
  21. package/47848c42.js +11636 -0
  22. package/4c6a0ece.js +162535 -0
  23. package/4db8e48b.js +2284 -0
  24. package/531065f1.js +1089 -0
  25. package/5a398ea8.js +881 -0
  26. package/5ab1614c.js +268 -0
  27. package/65bbb6ae.js +1536 -0
  28. package/777cd15c.js +48428 -0
  29. package/7dacfa82.js +220 -0
  30. package/800cf0d0.js +796 -0
  31. package/92e85b65.js +65 -0
  32. package/93e9bd3a.js +391 -0
  33. package/98622dfa.js +16582 -0
  34. package/a2e74e62.js +2967 -0
  35. package/a61c3bd3.js +5 -0
  36. package/b8f48ff4.js +769 -0
  37. package/bd0f5f65.js +319 -0
  38. package/bf4428f5.js +1269 -0
  39. package/cb1972f7.js +455 -0
  40. package/dfc10c94.js +818 -0
  41. package/ed2c9753.js +208 -0
  42. package/ef2833e6.js +927 -0
  43. package/f9637058.js +16 -0
  44. package/f9e72519.js +1284 -0
  45. package/fe063d15.js +19339 -0
  46. package/index.js +5 -0
  47. package/package.json +30 -3
  48. package/README.md +0 -120
  49. package/index.html +0 -26
  50. package/index.tsx +0 -21
  51. package/jest.config.js +0 -6
  52. package/src/__test__/allComp.test.tsx +0 -61
  53. package/src/app-env.d.ts +0 -3
  54. package/src/comps/calendarComp/calendarComp.tsx +0 -633
  55. package/src/comps/calendarComp/calendarConstants.tsx +0 -1048
  56. package/src/comps/calendarComp/errorBoundary.tsx +0 -30
  57. package/src/comps/chartComp/chartComp.tsx +0 -442
  58. package/src/comps/chartComp/chartConfigs/barChartConfig.tsx +0 -51
  59. package/src/comps/chartComp/chartConfigs/cartesianAxisConfig.tsx +0 -307
  60. package/src/comps/chartComp/chartConfigs/chartUrls.tsx +0 -9
  61. package/src/comps/chartComp/chartConfigs/legendConfig.tsx +0 -55
  62. package/src/comps/chartComp/chartConfigs/lineChartConfig.tsx +0 -96
  63. package/src/comps/chartComp/chartConfigs/pieChartConfig.tsx +0 -83
  64. package/src/comps/chartComp/chartConfigs/scatterChartConfig.tsx +0 -62
  65. package/src/comps/chartComp/chartConstants.tsx +0 -299
  66. package/src/comps/chartComp/chartPropertyView.tsx +0 -235
  67. package/src/comps/chartComp/chartUtils.ts +0 -291
  68. package/src/comps/chartComp/reactEcharts/core.tsx +0 -194
  69. package/src/comps/chartComp/reactEcharts/index.ts +0 -21
  70. package/src/comps/chartComp/reactEcharts/types.ts +0 -76
  71. package/src/comps/chartComp/seriesComp.tsx +0 -119
  72. package/src/comps/imageEditorComp/imageEditorClass.tsx +0 -52
  73. package/src/comps/imageEditorComp/imageEditorConstants.tsx +0 -109
  74. package/src/comps/imageEditorComp/index.tsx +0 -184
  75. package/src/comps/mermaidComp/index.tsx +0 -44
  76. package/src/comps/mermaidComp/mermaid.tsx +0 -29
  77. package/src/global.ts +0 -1
  78. package/src/i18n/comps/index.tsx +0 -29
  79. package/src/i18n/comps/locales/en.ts +0 -163
  80. package/src/i18n/comps/locales/enObj.tsx +0 -198
  81. package/src/i18n/comps/locales/index.ts +0 -7
  82. package/src/i18n/comps/locales/types.tsx +0 -10
  83. package/src/i18n/comps/locales/zh.ts +0 -156
  84. package/src/i18n/comps/locales/zhObj.tsx +0 -4
  85. package/src/index.ts +0 -11
  86. package/tsconfig.json +0 -22
  87. package/vite.config.js +0 -10
package/7dacfa82.js ADDED
@@ -0,0 +1,220 @@
1
+ import { p as A, d as S, s as G } from "./531065f1.js";
2
+ import { e as v, l as y, j as B, k as I, I as W, C as M, J as $ } from "./4c6a0ece.js";
3
+ import { G as J } from "./5a398ea8.js";
4
+ import { l as O } from "./65bbb6ae.js";
5
+ import { l as P } from "./0964fcc6.js";
6
+ import "./2ff2c7a6.js";
7
+ import "./256b619e.js";
8
+ let H = 0;
9
+ const X = 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 = P().x(function(e) {
26
+ return e.x;
27
+ }).y(function(e) {
28
+ return e.y;
29
+ }).curve(W), 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 k = M.calcLabelPosition(a.points);
41
+ f = k.x, h = k.y;
42
+ let u, m, w, b;
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, b = 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", b).attr("fill", "black").attr("font-size", "6").text(t.relationTitle2), H++;
62
+ }, Y = 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, k, 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
+ }), k = 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 + k.height).attr("y2", t.padding + h + t.dividerMargin + k.height);
91
+ const d = s.append("text").attr("x", t.padding).attr("y", h + 2 * t.dividerMargin + k.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.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: Y,
133
+ drawEdge: X,
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 J({
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
+ }), O(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
+ I(n, w, m, p.useMaxWidth);
205
+ const b = `${u.x - E} ${u.y - E} ${m} ${w}`;
206
+ y.debug(`viewBox ${b}`), n.attr("viewBox", b);
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
+ };