lowcoder-comps 0.0.17 → 0.0.19

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 (78) hide show
  1. package/README.md +27 -0
  2. package/index.html +26 -0
  3. package/index.tsx +19 -0
  4. package/jest.config.js +6 -0
  5. package/package.json +4 -5
  6. package/src/__test__/allComp.test.tsx +61 -0
  7. package/src/app-env.d.ts +3 -0
  8. package/src/comps/calendarComp/calendarComp.tsx +443 -0
  9. package/src/comps/calendarComp/calendarConstants.tsx +898 -0
  10. package/src/comps/chartComp/chartComp.tsx +356 -0
  11. package/src/comps/chartComp/chartConfigs/barChartConfig.tsx +51 -0
  12. package/src/comps/chartComp/chartConfigs/cartesianAxisConfig.tsx +307 -0
  13. package/src/comps/chartComp/chartConfigs/chartUrls.tsx +9 -0
  14. package/src/comps/chartComp/chartConfigs/legendConfig.tsx +55 -0
  15. package/src/comps/chartComp/chartConfigs/lineChartConfig.tsx +96 -0
  16. package/src/comps/chartComp/chartConfigs/pieChartConfig.tsx +83 -0
  17. package/src/comps/chartComp/chartConfigs/scatterChartConfig.tsx +62 -0
  18. package/src/comps/chartComp/chartConstants.tsx +288 -0
  19. package/src/comps/chartComp/chartPropertyView.tsx +218 -0
  20. package/src/comps/chartComp/chartUtils.ts +291 -0
  21. package/src/comps/chartComp/reactEcharts/core.tsx +194 -0
  22. package/src/comps/chartComp/reactEcharts/index.ts +21 -0
  23. package/src/comps/chartComp/reactEcharts/types.ts +76 -0
  24. package/src/comps/chartComp/seriesComp.tsx +119 -0
  25. package/src/comps/imageEditorComp/imageEditorClass.tsx +52 -0
  26. package/src/comps/imageEditorComp/imageEditorConstants.tsx +109 -0
  27. package/src/comps/imageEditorComp/index.tsx +184 -0
  28. package/src/comps/mermaidComp/index.tsx +44 -0
  29. package/src/comps/mermaidComp/mermaid.tsx +29 -0
  30. package/src/global.ts +1 -0
  31. package/src/i18n/comps/index.tsx +29 -0
  32. package/src/i18n/comps/locales/en.ts +150 -0
  33. package/src/i18n/comps/locales/enObj.tsx +198 -0
  34. package/src/i18n/comps/locales/index.ts +7 -0
  35. package/src/i18n/comps/locales/types.tsx +10 -0
  36. package/src/i18n/comps/locales/zh.ts +145 -0
  37. package/src/i18n/comps/locales/zhObj.tsx +4 -0
  38. package/src/index.ts +11 -0
  39. package/tsconfig.json +22 -0
  40. package/vite.config.js +10 -0
  41. package/001f8b13.js +0 -326
  42. package/085bf0c2.js +0 -46688
  43. package/256b619e.js +0 -92
  44. package/29cba276.js +0 -91
  45. package/2e18581a.js +0 -451
  46. package/2ff2c7a6.js +0 -6
  47. package/340c33ea.js +0 -1602
  48. package/3ad55ad7.js +0 -607
  49. package/47b0b0ff.js +0 -70
  50. package/4a5b6fbe.js +0 -798
  51. package/4abe140e.js +0 -943
  52. package/4cf5b178.js +0 -34
  53. package/5cab7b96.js +0 -18619
  54. package/626b9013.js +0 -7
  55. package/6798500f.js +0 -793
  56. package/68b021d0.js +0 -2456
  57. package/6ab1612a.js +0 -24
  58. package/6e903063.js +0 -940
  59. package/72a7048f.js +0 -849
  60. package/7902f186.js +0 -823
  61. package/82c1c410.js +0 -86
  62. package/8517f7c1.js +0 -365
  63. package/9495ef3b.js +0 -1118
  64. package/9ea1ddd6.js +0 -447
  65. package/a01c9944.js +0 -212
  66. package/a4ce7e8a.js +0 -2827
  67. package/ad68bdd0.js +0 -236
  68. package/b499e5a9.js +0 -2103
  69. package/bdc7b18a.js +0 -1032
  70. package/be5b66cd.js +0 -832
  71. package/c4378831.js +0 -117175
  72. package/ca8f4e3f.js +0 -275
  73. package/de61c633.js +0 -2679
  74. package/e04788e2.js +0 -159
  75. package/f9637058.js +0 -16
  76. package/f9a47b7c.js +0 -985
  77. package/ff16c2ec.js +0 -1246
  78. package/index.js +0 -5
package/ad68bdd0.js DELETED
@@ -1,236 +0,0 @@
1
- var F = Object.defineProperty;
2
- var A = Object.getOwnPropertySymbols;
3
- var H = Object.prototype.hasOwnProperty, V = Object.prototype.propertyIsEnumerable;
4
- var $ = (l, t, n) => t in l ? F(l, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : l[t] = n, k = (l, t) => {
5
- for (var n in t || (t = {}))
6
- H.call(t, n) && $(l, n, t[n]);
7
- if (A)
8
- for (var n of A(t))
9
- V.call(t, n) && $(l, n, t[n]);
10
- return l;
11
- };
12
- var I = (l, t, n) => new Promise((i, e) => {
13
- var c = (o) => {
14
- try {
15
- r(n.next(o));
16
- } catch (a) {
17
- e(a);
18
- }
19
- }, s = (o) => {
20
- try {
21
- r(n.throw(o));
22
- } catch (a) {
23
- e(a);
24
- }
25
- }, r = (o) => o.done ? i(o.value) : Promise.resolve(o.value).then(c, s);
26
- r((n = n.apply(l, t)).next());
27
- });
28
- import { p as W, d as M, s as J } from "./bdc7b18a.js";
29
- import { l as p, c as d, h as S, x as K, t as Q, r as B, o as G, p as U, j as z } from "./c4378831.js";
30
- import { G as X } from "./de61c633.js";
31
- import { r as Y } from "./8517f7c1.js";
32
- import "./72a7048f.js";
33
- import "./a4ce7e8a.js";
34
- import "./e04788e2.js";
35
- import "./4cf5b178.js";
36
- import "./2ff2c7a6.js";
37
- import "./256b619e.js";
38
- const L = (l) => z.sanitizeText(l, d());
39
- let T = {
40
- dividerMargin: 10,
41
- padding: 5,
42
- textHeight: 10,
43
- curve: void 0
44
- };
45
- const Z = function(l, t, n, i) {
46
- const e = Object.keys(l);
47
- p.info("keys:", e), p.info(l), e.forEach(function(c) {
48
- var y;
49
- var s, r;
50
- const o = l[c], f = {
51
- shape: "rect",
52
- id: o.id,
53
- domId: o.domId,
54
- labelText: L(o.id),
55
- labelStyle: "",
56
- style: "fill: none; stroke: black",
57
- // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
58
- padding: (y = (s = d().flowchart) == null ? void 0 : s.padding) != null ? y : (r = d().class) == null ? void 0 : r.padding
59
- };
60
- t.setNode(o.id, f), P(o.classes, t, n, i, o.id), p.info("setNode", f);
61
- });
62
- }, P = function(l, t, n, i, e) {
63
- const c = Object.keys(l);
64
- p.info("keys:", c), p.info(l), c.filter((s) => l[s].parent == e).forEach(function(s) {
65
- var x, h;
66
- var r, o;
67
- const a = l[s], f = a.cssClasses.join(" "), y = { labelStyle: "", style: "" }, v = (x = a.label) != null ? x : a.id, b = 0, m = "class_box", u = {
68
- labelStyle: y.labelStyle,
69
- shape: m,
70
- labelText: L(v),
71
- classData: a,
72
- rx: b,
73
- ry: b,
74
- class: f,
75
- style: y.style,
76
- id: a.id,
77
- domId: a.domId,
78
- tooltip: i.db.getTooltip(a.id, e) || "",
79
- haveCallback: a.haveCallback,
80
- link: a.link,
81
- width: a.type === "group" ? 500 : void 0,
82
- type: a.type,
83
- // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
84
- padding: (h = (r = d().flowchart) == null ? void 0 : r.padding) != null ? h : (o = d().class) == null ? void 0 : o.padding
85
- };
86
- t.setNode(a.id, u), e && t.setParent(a.id, e), p.info("setNode", u);
87
- });
88
- }, j = function(l, t, n, i) {
89
- p.info(l), l.forEach(function(e, c) {
90
- var h;
91
- var s, r;
92
- const o = e, a = "", f = { labelStyle: "", style: "" }, y = o.text, v = 0, b = "note", m = {
93
- labelStyle: f.labelStyle,
94
- shape: b,
95
- labelText: L(y),
96
- noteData: o,
97
- rx: v,
98
- ry: v,
99
- class: a,
100
- style: f.style,
101
- id: o.id,
102
- domId: o.id,
103
- tooltip: "",
104
- type: "note",
105
- // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
106
- padding: (h = (s = d().flowchart) == null ? void 0 : s.padding) != null ? h : (r = d().class) == null ? void 0 : r.padding
107
- };
108
- if (t.setNode(o.id, m), p.info("setNode", m), !o.class || !(o.class in i))
109
- return;
110
- const u = n + c, x = {
111
- id: `edgeNote${u}`,
112
- //Set relationship style and line type
113
- classes: "relation",
114
- pattern: "dotted",
115
- // Set link type for rendering
116
- arrowhead: "none",
117
- //Set edge extra labels
118
- startLabelRight: "",
119
- endLabelLeft: "",
120
- //Set relation arrow types
121
- arrowTypeStart: "none",
122
- arrowTypeEnd: "none",
123
- style: "fill:none",
124
- labelStyle: "",
125
- curve: B(T.curve, G)
126
- };
127
- t.setEdge(o.id, o.class, x, u);
128
- });
129
- }, O = function(l, t) {
130
- const n = d().flowchart;
131
- let i = 0;
132
- l.forEach(function(e) {
133
- var r;
134
- var c;
135
- i++;
136
- const s = {
137
- //Set relationship style and line type
138
- classes: "relation",
139
- pattern: e.relation.lineType == 1 ? "dashed" : "solid",
140
- id: "id" + i,
141
- // Set link type for rendering
142
- arrowhead: e.type === "arrow_open" ? "none" : "normal",
143
- //Set edge extra labels
144
- startLabelRight: e.relationTitle1 === "none" ? "" : e.relationTitle1,
145
- endLabelLeft: e.relationTitle2 === "none" ? "" : e.relationTitle2,
146
- //Set relation arrow types
147
- arrowTypeStart: R(e.relation.type1),
148
- arrowTypeEnd: R(e.relation.type2),
149
- style: "fill:none",
150
- labelStyle: "",
151
- curve: B(n == null ? void 0 : n.curve, G)
152
- };
153
- if (p.info(s, e), e.style !== void 0) {
154
- const o = U(e.style);
155
- s.style = o.style, s.labelStyle = o.labelStyle;
156
- }
157
- e.text = e.title, e.text === void 0 ? e.style !== void 0 && (s.arrowheadStyle = "fill: #333") : (s.arrowheadStyle = "fill: #333", s.labelpos = "c", ((r = (c = d().flowchart) == null ? void 0 : c.htmlLabels) != null ? r : d().htmlLabels) ? (s.labelType = "html", s.label = '<span class="edgeLabel">' + e.text + "</span>") : (s.labelType = "text", s.label = e.text.replace(z.lineBreakRegex, `
158
- `), 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, i);
159
- });
160
- }, ee = function(l) {
161
- T = k(k({}, T), l);
162
- }, te = function(l, t, n, i) {
163
- return I(this, null, function* () {
164
- var h, N, D, E;
165
- p.info("Drawing class - ", t);
166
- const e = (h = d().flowchart) != null ? h : d().class, c = d().securityLevel;
167
- p.info("config:", e);
168
- const s = (N = e == null ? void 0 : e.nodeSpacing) != null ? N : 50, r = (D = e == null ? void 0 : e.rankSpacing) != null ? D : 50, o = new X({
169
- multigraph: !0,
170
- compound: !0
171
- }).setGraph({
172
- rankdir: i.db.getDirection(),
173
- nodesep: s,
174
- ranksep: r,
175
- marginx: 8,
176
- marginy: 8
177
- }).setDefaultEdgeLabel(function() {
178
- return {};
179
- }), a = i.db.getNamespaces(), f = i.db.getClasses(), y = i.db.getRelations(), v = i.db.getNotes();
180
- p.info(y), Z(a, o, t, i), P(f, o, t, i), O(y, o), j(v, o, y.length + 1, f);
181
- let b;
182
- c === "sandbox" && (b = S("#i" + t));
183
- const m = c === "sandbox" ? S(b.nodes()[0].contentDocument.body) : S("body"), u = m.select(`[id="${t}"]`), x = m.select("#" + t + " g");
184
- if (yield Y(
185
- x,
186
- o,
187
- ["aggregation", "extension", "composition", "dependency", "lollipop"],
188
- "classDiagram",
189
- t
190
- ), K.insertTitle(u, "classTitleText", (E = e == null ? void 0 : e.titleTopMargin) != null ? E : 5, i.db.getDiagramTitle()), Q(o, u, e == null ? void 0 : e.diagramPadding, e == null ? void 0 : e.useMaxWidth), !(e != null && e.htmlLabels)) {
191
- const _ = c === "sandbox" ? b.nodes()[0].contentDocument : document, q = _.querySelectorAll('[id="' + t + '"] .edgeLabel .label');
192
- for (const w of q) {
193
- const C = w.getBBox(), g = _.createElementNS("http://www.w3.org/2000/svg", "rect");
194
- g.setAttribute("rx", 0), g.setAttribute("ry", 0), g.setAttribute("width", C.width), g.setAttribute("height", C.height), w.insertBefore(g, w.firstChild);
195
- }
196
- }
197
- });
198
- };
199
- function R(l) {
200
- let t;
201
- switch (l) {
202
- case 0:
203
- t = "aggregation";
204
- break;
205
- case 1:
206
- t = "extension";
207
- break;
208
- case 2:
209
- t = "composition";
210
- break;
211
- case 3:
212
- t = "dependency";
213
- break;
214
- case 4:
215
- t = "lollipop";
216
- break;
217
- default:
218
- t = "none";
219
- }
220
- return t;
221
- }
222
- const oe = {
223
- setConf: ee,
224
- draw: te
225
- }, be = {
226
- parser: W,
227
- db: M,
228
- renderer: oe,
229
- styles: J,
230
- init: (l) => {
231
- l.class || (l.class = {}), l.class.arrowMarkerAbsolute = l.arrowMarkerAbsolute, M.clear();
232
- }
233
- };
234
- export {
235
- be as diagram
236
- };