lowcoder-comps 0.0.29 → 0.0.31

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 (86) hide show
  1. package/README.md +120 -0
  2. package/index.html +26 -0
  3. package/index.tsx +21 -0
  4. package/jest.config.js +6 -0
  5. package/package.json +3 -4
  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 +633 -0
  9. package/src/comps/calendarComp/calendarConstants.tsx +1048 -0
  10. package/src/comps/calendarComp/errorBoundary.tsx +30 -0
  11. package/src/comps/chartComp/chartComp.tsx +442 -0
  12. package/src/comps/chartComp/chartConfigs/barChartConfig.tsx +51 -0
  13. package/src/comps/chartComp/chartConfigs/cartesianAxisConfig.tsx +307 -0
  14. package/src/comps/chartComp/chartConfigs/chartUrls.tsx +9 -0
  15. package/src/comps/chartComp/chartConfigs/legendConfig.tsx +55 -0
  16. package/src/comps/chartComp/chartConfigs/lineChartConfig.tsx +96 -0
  17. package/src/comps/chartComp/chartConfigs/pieChartConfig.tsx +83 -0
  18. package/src/comps/chartComp/chartConfigs/scatterChartConfig.tsx +62 -0
  19. package/src/comps/chartComp/chartConstants.tsx +299 -0
  20. package/src/comps/chartComp/chartPropertyView.tsx +235 -0
  21. package/src/comps/chartComp/chartUtils.ts +291 -0
  22. package/src/comps/chartComp/reactEcharts/core.tsx +194 -0
  23. package/src/comps/chartComp/reactEcharts/index.ts +21 -0
  24. package/src/comps/chartComp/reactEcharts/types.ts +76 -0
  25. package/src/comps/chartComp/seriesComp.tsx +119 -0
  26. package/src/comps/imageEditorComp/imageEditorClass.tsx +52 -0
  27. package/src/comps/imageEditorComp/imageEditorConstants.tsx +109 -0
  28. package/src/comps/imageEditorComp/index.tsx +184 -0
  29. package/src/comps/mermaidComp/index.tsx +44 -0
  30. package/src/comps/mermaidComp/mermaid.tsx +29 -0
  31. package/src/global.ts +1 -0
  32. package/src/i18n/comps/index.tsx +29 -0
  33. package/src/i18n/comps/locales/en.ts +163 -0
  34. package/src/i18n/comps/locales/enObj.tsx +198 -0
  35. package/src/i18n/comps/locales/index.ts +7 -0
  36. package/src/i18n/comps/locales/types.tsx +10 -0
  37. package/src/i18n/comps/locales/zh.ts +156 -0
  38. package/src/i18n/comps/locales/zhObj.tsx +4 -0
  39. package/src/index.ts +11 -0
  40. package/tsconfig.json +22 -0
  41. package/vite.config.js +10 -0
  42. package/2085da13.js +0 -960
  43. package/250691b5.js +0 -5
  44. package/256b619e.js +0 -92
  45. package/274f545c.js +0 -881
  46. package/289305a1.js +0 -208
  47. package/2eae45c2.js +0 -34
  48. package/2ff2c7a6.js +0 -6
  49. package/2ff7471d.js +0 -9
  50. package/335b22a2.js +0 -220
  51. package/38c826fe.js +0 -1127
  52. package/44011c1d.js +0 -818
  53. package/4fc06812.js +0 -64
  54. package/56a787cf.js +0 -915
  55. package/590941ff.js +0 -86
  56. package/6341867f.js +0 -804
  57. package/657fd065.js +0 -8
  58. package/78a5e50d.js +0 -1579
  59. package/820c3641.js +0 -25
  60. package/88b4e75a.js +0 -2967
  61. package/8d999722.js +0 -1102
  62. package/92e85b65.js +0 -65
  63. package/989caea2.js +0 -505
  64. package/99b984d1.js +0 -237
  65. package/9e5f02d6.js +0 -19104
  66. package/a40faea7.js +0 -11624
  67. package/abac9104.js +0 -1536
  68. package/af2f19b3.js +0 -819
  69. package/af5ee3de.js +0 -268
  70. package/b24707c2.js +0 -48428
  71. package/b68f8b69.js +0 -1276
  72. package/ba68ba65.js +0 -391
  73. package/bafb8599.js +0 -319
  74. package/bba60c35.js +0 -2501
  75. package/bd7c2a8e.js +0 -1089
  76. package/c71dadea.js +0 -455
  77. package/d05c1762.js +0 -933
  78. package/d073ab24.js +0 -134353
  79. package/d838cd10.js +0 -769
  80. package/dc36a6eb.js +0 -796
  81. package/ed143450.js +0 -1284
  82. package/ee8ec8f2.js +0 -2284
  83. package/f6755210.js +0 -1269
  84. package/f9637058.js +0 -16
  85. package/fba4c8e4.js +0 -447
  86. package/index.js +0 -5
package/99b984d1.js DELETED
@@ -1,237 +0,0 @@
1
- var H = Object.defineProperty;
2
- var C = Object.getOwnPropertySymbols;
3
- var V = Object.prototype.hasOwnProperty, W = Object.prototype.propertyIsEnumerable;
4
- var $ = (l, e, n) => e in l ? H(l, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : l[e] = n, k = (l, e) => {
5
- for (var n in e || (e = {}))
6
- V.call(e, n) && $(l, n, e[n]);
7
- if (C)
8
- for (var n of C(e))
9
- W.call(e, n) && $(l, n, e[n]);
10
- return l;
11
- };
12
- var I = (l, e, n) => new Promise((i, t) => {
13
- var c = (o) => {
14
- try {
15
- r(n.next(o));
16
- } catch (a) {
17
- t(a);
18
- }
19
- }, s = (o) => {
20
- try {
21
- r(n.throw(o));
22
- } catch (a) {
23
- t(a);
24
- }
25
- }, r = (o) => o.done ? i(o.value) : Promise.resolve(o.value).then(c, s);
26
- r((n = n.apply(l, e)).next());
27
- });
28
- import { p as J, d as M, s as K } from "./bd7c2a8e.js";
29
- import { l as p, c as d, h as S, A as Q, t as U, o as B, q as G, n as q, j as z } from "./d073ab24.js";
30
- import { G as X } from "./274f545c.js";
31
- import { r as Y } from "./ba68ba65.js";
32
- import "./abac9104.js";
33
- import "./657fd065.js";
34
- import "./8d999722.js";
35
- import "./88b4e75a.js";
36
- import "./2eae45c2.js";
37
- import "./2ff2c7a6.js";
38
- import "./256b619e.js";
39
- const L = (l) => z.sanitizeText(l, d());
40
- let T = {
41
- dividerMargin: 10,
42
- padding: 5,
43
- textHeight: 10,
44
- curve: void 0
45
- };
46
- const Z = function(l, e, n, i) {
47
- const t = Object.keys(l);
48
- p.info("keys:", t), p.info(l), t.forEach(function(c) {
49
- var y;
50
- var s, r;
51
- const o = l[c], f = {
52
- shape: "rect",
53
- id: o.id,
54
- domId: o.domId,
55
- labelText: L(o.id),
56
- labelStyle: "",
57
- style: "fill: none; stroke: black",
58
- // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
59
- padding: (y = (s = d().flowchart) == null ? void 0 : s.padding) != null ? y : (r = d().class) == null ? void 0 : r.padding
60
- };
61
- e.setNode(o.id, f), P(o.classes, e, n, i, o.id), p.info("setNode", f);
62
- });
63
- }, P = function(l, e, n, i, t) {
64
- const c = Object.keys(l);
65
- p.info("keys:", c), p.info(l), c.filter((s) => l[s].parent == t).forEach(function(s) {
66
- var x, m;
67
- var r, o;
68
- const a = l[s], f = a.cssClasses.join(" "), y = B(a.styles), v = (x = a.label) != null ? x : a.id, b = 0, h = "class_box", u = {
69
- labelStyle: y.labelStyle,
70
- shape: h,
71
- labelText: L(v),
72
- classData: a,
73
- rx: b,
74
- ry: b,
75
- class: f,
76
- style: y.style,
77
- id: a.id,
78
- domId: a.domId,
79
- tooltip: i.db.getTooltip(a.id, t) || "",
80
- haveCallback: a.haveCallback,
81
- link: a.link,
82
- width: a.type === "group" ? 500 : void 0,
83
- type: a.type,
84
- // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
85
- padding: (m = (r = d().flowchart) == null ? void 0 : r.padding) != null ? m : (o = d().class) == null ? void 0 : o.padding
86
- };
87
- e.setNode(a.id, u), t && e.setParent(a.id, t), p.info("setNode", u);
88
- });
89
- }, j = function(l, e, n, i) {
90
- p.info(l), l.forEach(function(t, c) {
91
- var m;
92
- var s, r;
93
- const o = t, a = "", f = { labelStyle: "", style: "" }, y = o.text, v = 0, b = "note", h = {
94
- labelStyle: f.labelStyle,
95
- shape: b,
96
- labelText: L(y),
97
- noteData: o,
98
- rx: v,
99
- ry: v,
100
- class: a,
101
- style: f.style,
102
- id: o.id,
103
- domId: o.id,
104
- tooltip: "",
105
- type: "note",
106
- // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
107
- padding: (m = (s = d().flowchart) == null ? void 0 : s.padding) != null ? m : (r = d().class) == null ? void 0 : r.padding
108
- };
109
- if (e.setNode(o.id, h), p.info("setNode", h), !o.class || !(o.class in i))
110
- return;
111
- const u = n + c, x = {
112
- id: `edgeNote${u}`,
113
- //Set relationship style and line type
114
- classes: "relation",
115
- pattern: "dotted",
116
- // Set link type for rendering
117
- arrowhead: "none",
118
- //Set edge extra labels
119
- startLabelRight: "",
120
- endLabelLeft: "",
121
- //Set relation arrow types
122
- arrowTypeStart: "none",
123
- arrowTypeEnd: "none",
124
- style: "fill:none",
125
- labelStyle: "",
126
- curve: G(T.curve, q)
127
- };
128
- e.setEdge(o.id, o.class, x, u);
129
- });
130
- }, O = function(l, e) {
131
- const n = d().flowchart;
132
- let i = 0;
133
- l.forEach(function(t) {
134
- var r;
135
- var c;
136
- i++;
137
- const s = {
138
- //Set relationship style and line type
139
- classes: "relation",
140
- pattern: t.relation.lineType == 1 ? "dashed" : "solid",
141
- id: `id_${t.id1}_${t.id2}_${i}`,
142
- // Set link type for rendering
143
- arrowhead: t.type === "arrow_open" ? "none" : "normal",
144
- //Set edge extra labels
145
- startLabelRight: t.relationTitle1 === "none" ? "" : t.relationTitle1,
146
- endLabelLeft: t.relationTitle2 === "none" ? "" : t.relationTitle2,
147
- //Set relation arrow types
148
- arrowTypeStart: R(t.relation.type1),
149
- arrowTypeEnd: R(t.relation.type2),
150
- style: "fill:none",
151
- labelStyle: "",
152
- curve: G(n == null ? void 0 : n.curve, q)
153
- };
154
- if (p.info(s, t), t.style !== void 0) {
155
- const o = B(t.style);
156
- s.style = o.style, s.labelStyle = o.labelStyle;
157
- }
158
- t.text = t.title, t.text === void 0 ? t.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">' + t.text + "</span>") : (s.labelType = "text", s.label = t.text.replace(z.lineBreakRegex, `
159
- `), t.style === void 0 && (s.style = s.style || "stroke: #333; stroke-width: 1.5px;fill:none"), s.labelStyle = s.labelStyle.replace("color:", "fill:"))), e.setEdge(t.id1, t.id2, s, i);
160
- });
161
- }, tt = function(l) {
162
- T = k(k({}, T), l);
163
- }, et = function(l, e, n, i) {
164
- return I(this, null, function* () {
165
- var m, _, N, D;
166
- p.info("Drawing class - ", e);
167
- const t = (m = d().flowchart) != null ? m : d().class, c = d().securityLevel;
168
- p.info("config:", t);
169
- const s = (_ = t == null ? void 0 : t.nodeSpacing) != null ? _ : 50, r = (N = t == null ? void 0 : t.rankSpacing) != null ? N : 50, o = new X({
170
- multigraph: !0,
171
- compound: !0
172
- }).setGraph({
173
- rankdir: i.db.getDirection(),
174
- nodesep: s,
175
- ranksep: r,
176
- marginx: 8,
177
- marginy: 8
178
- }).setDefaultEdgeLabel(function() {
179
- return {};
180
- }), a = i.db.getNamespaces(), f = i.db.getClasses(), y = i.db.getRelations(), v = i.db.getNotes();
181
- p.info(y), Z(a, o, e, i), P(f, o, e, i), O(y, o), j(v, o, y.length + 1, f);
182
- let b;
183
- c === "sandbox" && (b = S("#i" + e));
184
- const h = c === "sandbox" ? S(b.nodes()[0].contentDocument.body) : S("body"), u = h.select(`[id="${e}"]`), x = h.select("#" + e + " g");
185
- if (yield Y(
186
- x,
187
- o,
188
- ["aggregation", "extension", "composition", "dependency", "lollipop"],
189
- "classDiagram",
190
- e
191
- ), Q.insertTitle(u, "classTitleText", (D = t == null ? void 0 : t.titleTopMargin) != null ? D : 5, i.db.getDiagramTitle()), U(o, u, t == null ? void 0 : t.diagramPadding, t == null ? void 0 : t.useMaxWidth), !(t != null && t.htmlLabels)) {
192
- const E = c === "sandbox" ? b.nodes()[0].contentDocument : document, F = E.querySelectorAll('[id="' + e + '"] .edgeLabel .label');
193
- for (const w of F) {
194
- const A = w.getBBox(), g = E.createElementNS("http://www.w3.org/2000/svg", "rect");
195
- g.setAttribute("rx", 0), g.setAttribute("ry", 0), g.setAttribute("width", A.width), g.setAttribute("height", A.height), w.insertBefore(g, w.firstChild);
196
- }
197
- }
198
- });
199
- };
200
- function R(l) {
201
- let e;
202
- switch (l) {
203
- case 0:
204
- e = "aggregation";
205
- break;
206
- case 1:
207
- e = "extension";
208
- break;
209
- case 2:
210
- e = "composition";
211
- break;
212
- case 3:
213
- e = "dependency";
214
- break;
215
- case 4:
216
- e = "lollipop";
217
- break;
218
- default:
219
- e = "none";
220
- }
221
- return e;
222
- }
223
- const ot = {
224
- setConf: tt,
225
- draw: et
226
- }, ut = {
227
- parser: J,
228
- db: M,
229
- renderer: ot,
230
- styles: K,
231
- init: (l) => {
232
- l.class || (l.class = {}), l.class.arrowMarkerAbsolute = l.arrowMarkerAbsolute, M.clear();
233
- }
234
- };
235
- export {
236
- ut as diagram
237
- };