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.
- package/README.md +120 -0
- package/index.html +26 -0
- package/index.tsx +21 -0
- package/jest.config.js +6 -0
- package/package.json +3 -4
- package/src/__test__/allComp.test.tsx +61 -0
- package/src/app-env.d.ts +3 -0
- package/src/comps/calendarComp/calendarComp.tsx +633 -0
- package/src/comps/calendarComp/calendarConstants.tsx +1048 -0
- package/src/comps/calendarComp/errorBoundary.tsx +30 -0
- package/src/comps/chartComp/chartComp.tsx +442 -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 +9 -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 +299 -0
- package/src/comps/chartComp/chartPropertyView.tsx +235 -0
- package/src/comps/chartComp/chartUtils.ts +291 -0
- package/src/comps/chartComp/reactEcharts/core.tsx +194 -0
- package/src/comps/chartComp/reactEcharts/index.ts +21 -0
- package/src/comps/chartComp/reactEcharts/types.ts +76 -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 +163 -0
- package/src/i18n/comps/locales/enObj.tsx +198 -0
- package/src/i18n/comps/locales/index.ts +7 -0
- package/src/i18n/comps/locales/types.tsx +10 -0
- package/src/i18n/comps/locales/zh.ts +156 -0
- package/src/i18n/comps/locales/zhObj.tsx +4 -0
- package/src/index.ts +11 -0
- package/tsconfig.json +22 -0
- package/vite.config.js +10 -0
- package/2085da13.js +0 -960
- package/250691b5.js +0 -5
- package/256b619e.js +0 -92
- package/274f545c.js +0 -881
- package/289305a1.js +0 -208
- package/2eae45c2.js +0 -34
- package/2ff2c7a6.js +0 -6
- package/2ff7471d.js +0 -9
- package/335b22a2.js +0 -220
- package/38c826fe.js +0 -1127
- package/44011c1d.js +0 -818
- package/4fc06812.js +0 -64
- package/56a787cf.js +0 -915
- package/590941ff.js +0 -86
- package/6341867f.js +0 -804
- package/657fd065.js +0 -8
- package/78a5e50d.js +0 -1579
- package/820c3641.js +0 -25
- package/88b4e75a.js +0 -2967
- package/8d999722.js +0 -1102
- package/92e85b65.js +0 -65
- package/989caea2.js +0 -505
- package/99b984d1.js +0 -237
- package/9e5f02d6.js +0 -19104
- package/a40faea7.js +0 -11624
- package/abac9104.js +0 -1536
- package/af2f19b3.js +0 -819
- package/af5ee3de.js +0 -268
- package/b24707c2.js +0 -48428
- package/b68f8b69.js +0 -1276
- package/ba68ba65.js +0 -391
- package/bafb8599.js +0 -319
- package/bba60c35.js +0 -2501
- package/bd7c2a8e.js +0 -1089
- package/c71dadea.js +0 -455
- package/d05c1762.js +0 -933
- package/d073ab24.js +0 -134353
- package/d838cd10.js +0 -769
- package/dc36a6eb.js +0 -796
- package/ed143450.js +0 -1284
- package/ee8ec8f2.js +0 -2284
- package/f6755210.js +0 -1269
- package/f9637058.js +0 -16
- package/fba4c8e4.js +0 -447
- package/index.js +0 -5
package/92e85b65.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { i as a } from "./f9637058.js";
|
|
2
|
-
class o extends Map {
|
|
3
|
-
constructor(n, t = g) {
|
|
4
|
-
if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: t } }), n != null)
|
|
5
|
-
for (const [r, s] of n)
|
|
6
|
-
this.set(r, s);
|
|
7
|
-
}
|
|
8
|
-
get(n) {
|
|
9
|
-
return super.get(c(this, n));
|
|
10
|
-
}
|
|
11
|
-
has(n) {
|
|
12
|
-
return super.has(c(this, n));
|
|
13
|
-
}
|
|
14
|
-
set(n, t) {
|
|
15
|
-
return super.set(l(this, n), t);
|
|
16
|
-
}
|
|
17
|
-
delete(n) {
|
|
18
|
-
return super.delete(p(this, n));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function c({ _intern: e, _key: n }, t) {
|
|
22
|
-
const r = n(t);
|
|
23
|
-
return e.has(r) ? e.get(r) : t;
|
|
24
|
-
}
|
|
25
|
-
function l({ _intern: e, _key: n }, t) {
|
|
26
|
-
const r = n(t);
|
|
27
|
-
return e.has(r) ? e.get(r) : (e.set(r, t), t);
|
|
28
|
-
}
|
|
29
|
-
function p({ _intern: e, _key: n }, t) {
|
|
30
|
-
const r = n(t);
|
|
31
|
-
return e.has(r) && (t = e.get(r), e.delete(r)), t;
|
|
32
|
-
}
|
|
33
|
-
function g(e) {
|
|
34
|
-
return e !== null && typeof e == "object" ? e.valueOf() : e;
|
|
35
|
-
}
|
|
36
|
-
const f = Symbol("implicit");
|
|
37
|
-
function h() {
|
|
38
|
-
var e = new o(), n = [], t = [], r = f;
|
|
39
|
-
function s(u) {
|
|
40
|
-
let i = e.get(u);
|
|
41
|
-
if (i === void 0) {
|
|
42
|
-
if (r !== f)
|
|
43
|
-
return r;
|
|
44
|
-
e.set(u, i = n.push(u) - 1);
|
|
45
|
-
}
|
|
46
|
-
return t[i % t.length];
|
|
47
|
-
}
|
|
48
|
-
return s.domain = function(u) {
|
|
49
|
-
if (!arguments.length)
|
|
50
|
-
return n.slice();
|
|
51
|
-
n = [], e = new o();
|
|
52
|
-
for (const i of u)
|
|
53
|
-
e.has(i) || e.set(i, n.push(i) - 1);
|
|
54
|
-
return s;
|
|
55
|
-
}, s.range = function(u) {
|
|
56
|
-
return arguments.length ? (t = Array.from(u), s) : t.slice();
|
|
57
|
-
}, s.unknown = function(u) {
|
|
58
|
-
return arguments.length ? (r = u, s) : r;
|
|
59
|
-
}, s.copy = function() {
|
|
60
|
-
return h(n, t).unknown(r);
|
|
61
|
-
}, a.apply(s, arguments), s;
|
|
62
|
-
}
|
|
63
|
-
export {
|
|
64
|
-
h as o
|
|
65
|
-
};
|
package/989caea2.js
DELETED
|
@@ -1,505 +0,0 @@
|
|
|
1
|
-
import { U as H, V as at, C as lt, D as ct, s as ot, g as ht, b as ut, a as yt, E as ft, d as pt, c as et, l as it, W as gt, T as dt, X as mt, i as _t } from "./d073ab24.js";
|
|
2
|
-
import { a as tt } from "./590941ff.js";
|
|
3
|
-
import { o as xt } from "./92e85b65.js";
|
|
4
|
-
import { a as vt } from "./2ff2c7a6.js";
|
|
5
|
-
import { c as F } from "./256b619e.js";
|
|
6
|
-
import "./f9637058.js";
|
|
7
|
-
function kt(e, u) {
|
|
8
|
-
return u < e ? -1 : u > e ? 1 : u >= e ? 0 : NaN;
|
|
9
|
-
}
|
|
10
|
-
function bt(e) {
|
|
11
|
-
return e;
|
|
12
|
-
}
|
|
13
|
-
function St() {
|
|
14
|
-
var e = bt, u = kt, E = null, p = F(0), g = F(H), A = F(0);
|
|
15
|
-
function y(a) {
|
|
16
|
-
var l, d = (a = vt(a)).length, m, D, T = 0, _ = new Array(d), k = new Array(d), o = +p.apply(this, arguments), b = Math.min(H, Math.max(-H, g.apply(this, arguments) - o)), V, w = Math.min(Math.abs(b) / d, A.apply(this, arguments)), S = w * (b < 0 ? -1 : 1), t;
|
|
17
|
-
for (l = 0; l < d; ++l)
|
|
18
|
-
(t = k[_[l] = l] = +e(a[l], l, a)) > 0 && (T += t);
|
|
19
|
-
for (u != null ? _.sort(function(i, n) {
|
|
20
|
-
return u(k[i], k[n]);
|
|
21
|
-
}) : E != null && _.sort(function(i, n) {
|
|
22
|
-
return E(a[i], a[n]);
|
|
23
|
-
}), l = 0, D = T ? (b - d * S) / T : 0; l < d; ++l, o = V)
|
|
24
|
-
m = _[l], t = k[m], V = o + (t > 0 ? t * D : 0) + S, k[m] = {
|
|
25
|
-
data: a[m],
|
|
26
|
-
index: l,
|
|
27
|
-
value: t,
|
|
28
|
-
startAngle: o,
|
|
29
|
-
endAngle: V,
|
|
30
|
-
padAngle: w
|
|
31
|
-
};
|
|
32
|
-
return k;
|
|
33
|
-
}
|
|
34
|
-
return y.value = function(a) {
|
|
35
|
-
return arguments.length ? (e = typeof a == "function" ? a : F(+a), y) : e;
|
|
36
|
-
}, y.sortValues = function(a) {
|
|
37
|
-
return arguments.length ? (u = a, E = null, y) : u;
|
|
38
|
-
}, y.sort = function(a) {
|
|
39
|
-
return arguments.length ? (E = a, u = null, y) : E;
|
|
40
|
-
}, y.startAngle = function(a) {
|
|
41
|
-
return arguments.length ? (p = typeof a == "function" ? a : F(+a), y) : p;
|
|
42
|
-
}, y.endAngle = function(a) {
|
|
43
|
-
return arguments.length ? (g = typeof a == "function" ? a : F(+a), y) : g;
|
|
44
|
-
}, y.padAngle = function(a) {
|
|
45
|
-
return arguments.length ? (A = typeof a == "function" ? a : F(+a), y) : A;
|
|
46
|
-
}, y;
|
|
47
|
-
}
|
|
48
|
-
var J = function() {
|
|
49
|
-
var e = function(S, t, i, n) {
|
|
50
|
-
for (i = i || {}, n = S.length; n--; i[S[n]] = t)
|
|
51
|
-
;
|
|
52
|
-
return i;
|
|
53
|
-
}, u = [1, 3], E = [1, 4], p = [1, 5], g = [1, 6], A = [1, 10, 12, 14, 16, 18, 19, 20, 21, 22], y = [2, 4], a = [1, 5, 10, 12, 14, 16, 18, 19, 20, 21, 22], l = [20, 21, 22], d = [2, 7], m = [1, 12], D = [1, 13], T = [1, 14], _ = [1, 15], k = [1, 16], o = [1, 17], b = {
|
|
54
|
-
trace: function() {
|
|
55
|
-
},
|
|
56
|
-
yy: {},
|
|
57
|
-
symbols_: { error: 2, start: 3, eol: 4, PIE: 5, document: 6, showData: 7, line: 8, statement: 9, txt: 10, value: 11, title: 12, title_value: 13, acc_title: 14, acc_title_value: 15, acc_descr: 16, acc_descr_value: 17, acc_descr_multiline_value: 18, section: 19, NEWLINE: 20, ";": 21, EOF: 22, $accept: 0, $end: 1 },
|
|
58
|
-
terminals_: { 2: "error", 5: "PIE", 7: "showData", 10: "txt", 11: "value", 12: "title", 13: "title_value", 14: "acc_title", 15: "acc_title_value", 16: "acc_descr", 17: "acc_descr_value", 18: "acc_descr_multiline_value", 19: "section", 20: "NEWLINE", 21: ";", 22: "EOF" },
|
|
59
|
-
productions_: [0, [3, 2], [3, 2], [3, 3], [6, 0], [6, 2], [8, 2], [9, 0], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [4, 1], [4, 1], [4, 1]],
|
|
60
|
-
performAction: function(t, i, n, r, c, s, P) {
|
|
61
|
-
var x = s.length - 1;
|
|
62
|
-
switch (c) {
|
|
63
|
-
case 3:
|
|
64
|
-
r.setShowData(!0);
|
|
65
|
-
break;
|
|
66
|
-
case 6:
|
|
67
|
-
this.$ = s[x - 1];
|
|
68
|
-
break;
|
|
69
|
-
case 8:
|
|
70
|
-
r.addSection(s[x - 1], r.cleanupValue(s[x]));
|
|
71
|
-
break;
|
|
72
|
-
case 9:
|
|
73
|
-
this.$ = s[x].trim(), r.setDiagramTitle(this.$);
|
|
74
|
-
break;
|
|
75
|
-
case 10:
|
|
76
|
-
this.$ = s[x].trim(), r.setAccTitle(this.$);
|
|
77
|
-
break;
|
|
78
|
-
case 11:
|
|
79
|
-
case 12:
|
|
80
|
-
this.$ = s[x].trim(), r.setAccDescription(this.$);
|
|
81
|
-
break;
|
|
82
|
-
case 13:
|
|
83
|
-
r.addSection(s[x].substr(8)), this.$ = s[x].substr(8);
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
table: [{ 3: 1, 4: 2, 5: u, 20: E, 21: p, 22: g }, { 1: [3] }, { 3: 7, 4: 2, 5: u, 20: E, 21: p, 22: g }, e(A, y, { 6: 8, 7: [1, 9] }), e(a, [2, 14]), e(a, [2, 15]), e(a, [2, 16]), { 1: [2, 1] }, e(l, d, { 8: 10, 9: 11, 1: [2, 2], 10: m, 12: D, 14: T, 16: _, 18: k, 19: o }), e(A, y, { 6: 18 }), e(A, [2, 5]), { 4: 19, 20: E, 21: p, 22: g }, { 11: [1, 20] }, { 13: [1, 21] }, { 15: [1, 22] }, { 17: [1, 23] }, e(l, [2, 12]), e(l, [2, 13]), e(l, d, { 8: 10, 9: 11, 1: [2, 3], 10: m, 12: D, 14: T, 16: _, 18: k, 19: o }), e(A, [2, 6]), e(l, [2, 8]), e(l, [2, 9]), e(l, [2, 10]), e(l, [2, 11])],
|
|
88
|
-
defaultActions: { 7: [2, 1] },
|
|
89
|
-
parseError: function(t, i) {
|
|
90
|
-
if (i.recoverable)
|
|
91
|
-
this.trace(t);
|
|
92
|
-
else {
|
|
93
|
-
var n = new Error(t);
|
|
94
|
-
throw n.hash = i, n;
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
parse: function(t) {
|
|
98
|
-
var i = this, n = [0], r = [], c = [null], s = [], P = this.table, x = "", f = 0, I = 0, R = 2, M = 1, B = s.slice.call(arguments, 1), h = Object.create(this.lexer), N = { yy: {} };
|
|
99
|
-
for (var Y in this.yy)
|
|
100
|
-
Object.prototype.hasOwnProperty.call(this.yy, Y) && (N.yy[Y] = this.yy[Y]);
|
|
101
|
-
h.setInput(t, N.yy), N.yy.lexer = h, N.yy.parser = this, typeof h.yylloc == "undefined" && (h.yylloc = {});
|
|
102
|
-
var X = h.yylloc;
|
|
103
|
-
s.push(X);
|
|
104
|
-
var st = h.options && h.options.ranges;
|
|
105
|
-
typeof N.yy.parseError == "function" ? this.parseError = N.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
106
|
-
function rt() {
|
|
107
|
-
var O;
|
|
108
|
-
return O = r.pop() || h.lex() || M, typeof O != "number" && (O instanceof Array && (r = O, O = r.pop()), O = i.symbols_[O] || O), O;
|
|
109
|
-
}
|
|
110
|
-
for (var v, L, $, Z, z = {}, j, C, Q, W; ; ) {
|
|
111
|
-
if (L = n[n.length - 1], this.defaultActions[L] ? $ = this.defaultActions[L] : ((v === null || typeof v == "undefined") && (v = rt()), $ = P[L] && P[L][v]), typeof $ == "undefined" || !$.length || !$[0]) {
|
|
112
|
-
var q = "";
|
|
113
|
-
W = [];
|
|
114
|
-
for (j in P[L])
|
|
115
|
-
this.terminals_[j] && j > R && W.push("'" + this.terminals_[j] + "'");
|
|
116
|
-
h.showPosition ? q = "Parse error on line " + (f + 1) + `:
|
|
117
|
-
` + h.showPosition() + `
|
|
118
|
-
Expecting ` + W.join(", ") + ", got '" + (this.terminals_[v] || v) + "'" : q = "Parse error on line " + (f + 1) + ": Unexpected " + (v == M ? "end of input" : "'" + (this.terminals_[v] || v) + "'"), this.parseError(q, {
|
|
119
|
-
text: h.match,
|
|
120
|
-
token: this.terminals_[v] || v,
|
|
121
|
-
line: h.yylineno,
|
|
122
|
-
loc: X,
|
|
123
|
-
expected: W
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
if ($[0] instanceof Array && $.length > 1)
|
|
127
|
-
throw new Error("Parse Error: multiple actions possible at state: " + L + ", token: " + v);
|
|
128
|
-
switch ($[0]) {
|
|
129
|
-
case 1:
|
|
130
|
-
n.push(v), c.push(h.yytext), s.push(h.yylloc), n.push($[1]), v = null, I = h.yyleng, x = h.yytext, f = h.yylineno, X = h.yylloc;
|
|
131
|
-
break;
|
|
132
|
-
case 2:
|
|
133
|
-
if (C = this.productions_[$[1]][1], z.$ = c[c.length - C], z._$ = {
|
|
134
|
-
first_line: s[s.length - (C || 1)].first_line,
|
|
135
|
-
last_line: s[s.length - 1].last_line,
|
|
136
|
-
first_column: s[s.length - (C || 1)].first_column,
|
|
137
|
-
last_column: s[s.length - 1].last_column
|
|
138
|
-
}, st && (z._$.range = [
|
|
139
|
-
s[s.length - (C || 1)].range[0],
|
|
140
|
-
s[s.length - 1].range[1]
|
|
141
|
-
]), Z = this.performAction.apply(z, [
|
|
142
|
-
x,
|
|
143
|
-
I,
|
|
144
|
-
f,
|
|
145
|
-
N.yy,
|
|
146
|
-
$[1],
|
|
147
|
-
c,
|
|
148
|
-
s
|
|
149
|
-
].concat(B)), typeof Z != "undefined")
|
|
150
|
-
return Z;
|
|
151
|
-
C && (n = n.slice(0, -1 * C * 2), c = c.slice(0, -1 * C), s = s.slice(0, -1 * C)), n.push(this.productions_[$[1]][0]), c.push(z.$), s.push(z._$), Q = P[n[n.length - 2]][n[n.length - 1]], n.push(Q);
|
|
152
|
-
break;
|
|
153
|
-
case 3:
|
|
154
|
-
return !0;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
return !0;
|
|
158
|
-
}
|
|
159
|
-
}, V = function() {
|
|
160
|
-
var S = {
|
|
161
|
-
EOF: 1,
|
|
162
|
-
parseError: function(i, n) {
|
|
163
|
-
if (this.yy.parser)
|
|
164
|
-
this.yy.parser.parseError(i, n);
|
|
165
|
-
else
|
|
166
|
-
throw new Error(i);
|
|
167
|
-
},
|
|
168
|
-
// resets the lexer, sets new input
|
|
169
|
-
setInput: function(t, i) {
|
|
170
|
-
return this.yy = i || this.yy || {}, this._input = t, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
|
171
|
-
first_line: 1,
|
|
172
|
-
first_column: 0,
|
|
173
|
-
last_line: 1,
|
|
174
|
-
last_column: 0
|
|
175
|
-
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
176
|
-
},
|
|
177
|
-
// consumes and returns one char from the input
|
|
178
|
-
input: function() {
|
|
179
|
-
var t = this._input[0];
|
|
180
|
-
this.yytext += t, this.yyleng++, this.offset++, this.match += t, this.matched += t;
|
|
181
|
-
var i = t.match(/(?:\r\n?|\n).*/g);
|
|
182
|
-
return i ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), t;
|
|
183
|
-
},
|
|
184
|
-
// unshifts one char (or a string) into the input
|
|
185
|
-
unput: function(t) {
|
|
186
|
-
var i = t.length, n = t.split(/(?:\r\n?|\n)/g);
|
|
187
|
-
this._input = t + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - i), this.offset -= i;
|
|
188
|
-
var r = this.match.split(/(?:\r\n?|\n)/g);
|
|
189
|
-
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
|
|
190
|
-
var c = this.yylloc.range;
|
|
191
|
-
return this.yylloc = {
|
|
192
|
-
first_line: this.yylloc.first_line,
|
|
193
|
-
last_line: this.yylineno + 1,
|
|
194
|
-
first_column: this.yylloc.first_column,
|
|
195
|
-
last_column: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - i
|
|
196
|
-
}, this.options.ranges && (this.yylloc.range = [c[0], c[0] + this.yyleng - i]), this.yyleng = this.yytext.length, this;
|
|
197
|
-
},
|
|
198
|
-
// When called from action, caches matched text and appends it on next action
|
|
199
|
-
more: function() {
|
|
200
|
-
return this._more = !0, this;
|
|
201
|
-
},
|
|
202
|
-
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
|
|
203
|
-
reject: function() {
|
|
204
|
-
if (this.options.backtrack_lexer)
|
|
205
|
-
this._backtrack = !0;
|
|
206
|
-
else
|
|
207
|
-
return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
208
|
-
` + this.showPosition(), {
|
|
209
|
-
text: "",
|
|
210
|
-
token: null,
|
|
211
|
-
line: this.yylineno
|
|
212
|
-
});
|
|
213
|
-
return this;
|
|
214
|
-
},
|
|
215
|
-
// retain first n characters of the match
|
|
216
|
-
less: function(t) {
|
|
217
|
-
this.unput(this.match.slice(t));
|
|
218
|
-
},
|
|
219
|
-
// displays already matched input, i.e. for error messages
|
|
220
|
-
pastInput: function() {
|
|
221
|
-
var t = this.matched.substr(0, this.matched.length - this.match.length);
|
|
222
|
-
return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, "");
|
|
223
|
-
},
|
|
224
|
-
// displays upcoming input, i.e. for error messages
|
|
225
|
-
upcomingInput: function() {
|
|
226
|
-
var t = this.match;
|
|
227
|
-
return t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
228
|
-
},
|
|
229
|
-
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
230
|
-
showPosition: function() {
|
|
231
|
-
var t = this.pastInput(), i = new Array(t.length + 1).join("-");
|
|
232
|
-
return t + this.upcomingInput() + `
|
|
233
|
-
` + i + "^";
|
|
234
|
-
},
|
|
235
|
-
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
236
|
-
test_match: function(t, i) {
|
|
237
|
-
var n, r, c;
|
|
238
|
-
if (this.options.backtrack_lexer && (c = {
|
|
239
|
-
yylineno: this.yylineno,
|
|
240
|
-
yylloc: {
|
|
241
|
-
first_line: this.yylloc.first_line,
|
|
242
|
-
last_line: this.last_line,
|
|
243
|
-
first_column: this.yylloc.first_column,
|
|
244
|
-
last_column: this.yylloc.last_column
|
|
245
|
-
},
|
|
246
|
-
yytext: this.yytext,
|
|
247
|
-
match: this.match,
|
|
248
|
-
matches: this.matches,
|
|
249
|
-
matched: this.matched,
|
|
250
|
-
yyleng: this.yyleng,
|
|
251
|
-
offset: this.offset,
|
|
252
|
-
_more: this._more,
|
|
253
|
-
_input: this._input,
|
|
254
|
-
yy: this.yy,
|
|
255
|
-
conditionStack: this.conditionStack.slice(0),
|
|
256
|
-
done: this.done
|
|
257
|
-
}, this.options.ranges && (c.yylloc.range = this.yylloc.range.slice(0))), r = t[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
|
|
258
|
-
first_line: this.yylloc.last_line,
|
|
259
|
-
last_line: this.yylineno + 1,
|
|
260
|
-
first_column: this.yylloc.last_column,
|
|
261
|
-
last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length
|
|
262
|
-
}, this.yytext += t[0], this.match += t[0], this.matches = t, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(t[0].length), this.matched += t[0], n = this.performAction.call(this, this.yy, this, i, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n)
|
|
263
|
-
return n;
|
|
264
|
-
if (this._backtrack) {
|
|
265
|
-
for (var s in c)
|
|
266
|
-
this[s] = c[s];
|
|
267
|
-
return !1;
|
|
268
|
-
}
|
|
269
|
-
return !1;
|
|
270
|
-
},
|
|
271
|
-
// return next match in input
|
|
272
|
-
next: function() {
|
|
273
|
-
if (this.done)
|
|
274
|
-
return this.EOF;
|
|
275
|
-
this._input || (this.done = !0);
|
|
276
|
-
var t, i, n, r;
|
|
277
|
-
this._more || (this.yytext = "", this.match = "");
|
|
278
|
-
for (var c = this._currentRules(), s = 0; s < c.length; s++)
|
|
279
|
-
if (n = this._input.match(this.rules[c[s]]), n && (!i || n[0].length > i[0].length)) {
|
|
280
|
-
if (i = n, r = s, this.options.backtrack_lexer) {
|
|
281
|
-
if (t = this.test_match(n, c[s]), t !== !1)
|
|
282
|
-
return t;
|
|
283
|
-
if (this._backtrack) {
|
|
284
|
-
i = !1;
|
|
285
|
-
continue;
|
|
286
|
-
} else
|
|
287
|
-
return !1;
|
|
288
|
-
} else if (!this.options.flex)
|
|
289
|
-
break;
|
|
290
|
-
}
|
|
291
|
-
return i ? (t = this.test_match(i, c[r]), t !== !1 ? t : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
292
|
-
` + this.showPosition(), {
|
|
293
|
-
text: "",
|
|
294
|
-
token: null,
|
|
295
|
-
line: this.yylineno
|
|
296
|
-
});
|
|
297
|
-
},
|
|
298
|
-
// return next match that has a token
|
|
299
|
-
lex: function() {
|
|
300
|
-
var i = this.next();
|
|
301
|
-
return i || this.lex();
|
|
302
|
-
},
|
|
303
|
-
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
304
|
-
begin: function(i) {
|
|
305
|
-
this.conditionStack.push(i);
|
|
306
|
-
},
|
|
307
|
-
// pop the previously active lexer condition state off the condition stack
|
|
308
|
-
popState: function() {
|
|
309
|
-
var i = this.conditionStack.length - 1;
|
|
310
|
-
return i > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
311
|
-
},
|
|
312
|
-
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
313
|
-
_currentRules: function() {
|
|
314
|
-
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
315
|
-
},
|
|
316
|
-
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
317
|
-
topState: function(i) {
|
|
318
|
-
return i = this.conditionStack.length - 1 - Math.abs(i || 0), i >= 0 ? this.conditionStack[i] : "INITIAL";
|
|
319
|
-
},
|
|
320
|
-
// alias for begin(condition)
|
|
321
|
-
pushState: function(i) {
|
|
322
|
-
this.begin(i);
|
|
323
|
-
},
|
|
324
|
-
// return the number of states currently on the stack
|
|
325
|
-
stateStackSize: function() {
|
|
326
|
-
return this.conditionStack.length;
|
|
327
|
-
},
|
|
328
|
-
options: { "case-insensitive": !0 },
|
|
329
|
-
performAction: function(i, n, r, c) {
|
|
330
|
-
switch (r) {
|
|
331
|
-
case 0:
|
|
332
|
-
break;
|
|
333
|
-
case 1:
|
|
334
|
-
break;
|
|
335
|
-
case 2:
|
|
336
|
-
return 20;
|
|
337
|
-
case 3:
|
|
338
|
-
break;
|
|
339
|
-
case 4:
|
|
340
|
-
break;
|
|
341
|
-
case 5:
|
|
342
|
-
return this.begin("title"), 12;
|
|
343
|
-
case 6:
|
|
344
|
-
return this.popState(), "title_value";
|
|
345
|
-
case 7:
|
|
346
|
-
return this.begin("acc_title"), 14;
|
|
347
|
-
case 8:
|
|
348
|
-
return this.popState(), "acc_title_value";
|
|
349
|
-
case 9:
|
|
350
|
-
return this.begin("acc_descr"), 16;
|
|
351
|
-
case 10:
|
|
352
|
-
return this.popState(), "acc_descr_value";
|
|
353
|
-
case 11:
|
|
354
|
-
this.begin("acc_descr_multiline");
|
|
355
|
-
break;
|
|
356
|
-
case 12:
|
|
357
|
-
this.popState();
|
|
358
|
-
break;
|
|
359
|
-
case 13:
|
|
360
|
-
return "acc_descr_multiline_value";
|
|
361
|
-
case 14:
|
|
362
|
-
this.begin("string");
|
|
363
|
-
break;
|
|
364
|
-
case 15:
|
|
365
|
-
this.popState();
|
|
366
|
-
break;
|
|
367
|
-
case 16:
|
|
368
|
-
return "txt";
|
|
369
|
-
case 17:
|
|
370
|
-
return 5;
|
|
371
|
-
case 18:
|
|
372
|
-
return 7;
|
|
373
|
-
case 19:
|
|
374
|
-
return "value";
|
|
375
|
-
case 20:
|
|
376
|
-
return 22;
|
|
377
|
-
}
|
|
378
|
-
},
|
|
379
|
-
rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:[\s]+)/i, /^(?:title\b)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:pie\b)/i, /^(?:showData\b)/i, /^(?::[\s]*[\d]+(?:\.[\d]+)?)/i, /^(?:$)/i],
|
|
380
|
-
conditions: { acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, title: { rules: [6], inclusive: !1 }, string: { rules: [15, 16], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 7, 9, 11, 14, 17, 18, 19, 20], inclusive: !0 } }
|
|
381
|
-
};
|
|
382
|
-
return S;
|
|
383
|
-
}();
|
|
384
|
-
b.lexer = V;
|
|
385
|
-
function w() {
|
|
386
|
-
this.yy = {};
|
|
387
|
-
}
|
|
388
|
-
return w.prototype = b, b.Parser = w, new w();
|
|
389
|
-
}();
|
|
390
|
-
J.parser = J;
|
|
391
|
-
const $t = J, nt = at.pie, G = {
|
|
392
|
-
sections: {},
|
|
393
|
-
showData: !1,
|
|
394
|
-
config: nt
|
|
395
|
-
};
|
|
396
|
-
let U = G.sections, K = G.showData;
|
|
397
|
-
const Et = structuredClone(nt), At = () => structuredClone(Et), wt = () => {
|
|
398
|
-
U = structuredClone(G.sections), K = G.showData, ft();
|
|
399
|
-
}, Tt = (e, u) => {
|
|
400
|
-
e = pt(e, et()), U[e] === void 0 && (U[e] = u, it.debug(`added new section: ${e}, with value: ${u}`));
|
|
401
|
-
}, It = () => U, Dt = (e) => (e.substring(0, 1) === ":" && (e = e.substring(1).trim()), Number(e.trim())), Ct = (e) => {
|
|
402
|
-
K = e;
|
|
403
|
-
}, Ot = () => K, Vt = {
|
|
404
|
-
getConfig: At,
|
|
405
|
-
clear: wt,
|
|
406
|
-
setDiagramTitle: lt,
|
|
407
|
-
getDiagramTitle: ct,
|
|
408
|
-
setAccTitle: ot,
|
|
409
|
-
getAccTitle: ht,
|
|
410
|
-
setAccDescription: ut,
|
|
411
|
-
getAccDescription: yt,
|
|
412
|
-
addSection: Tt,
|
|
413
|
-
getSections: It,
|
|
414
|
-
cleanupValue: Dt,
|
|
415
|
-
setShowData: Ct,
|
|
416
|
-
getShowData: Ot
|
|
417
|
-
}, Pt = (e) => `
|
|
418
|
-
.pieCircle{
|
|
419
|
-
stroke: ${e.pieStrokeColor};
|
|
420
|
-
stroke-width : ${e.pieStrokeWidth};
|
|
421
|
-
opacity : ${e.pieOpacity};
|
|
422
|
-
}
|
|
423
|
-
.pieOuterCircle{
|
|
424
|
-
stroke: ${e.pieOuterStrokeColor};
|
|
425
|
-
stroke-width: ${e.pieOuterStrokeWidth};
|
|
426
|
-
fill: none;
|
|
427
|
-
}
|
|
428
|
-
.pieTitleText {
|
|
429
|
-
text-anchor: middle;
|
|
430
|
-
font-size: ${e.pieTitleTextSize};
|
|
431
|
-
fill: ${e.pieTitleTextColor};
|
|
432
|
-
font-family: ${e.fontFamily};
|
|
433
|
-
}
|
|
434
|
-
.slice {
|
|
435
|
-
font-family: ${e.fontFamily};
|
|
436
|
-
fill: ${e.pieSectionTextColor};
|
|
437
|
-
font-size:${e.pieSectionTextSize};
|
|
438
|
-
// fill: white;
|
|
439
|
-
}
|
|
440
|
-
.legend text {
|
|
441
|
-
fill: ${e.pieLegendTextColor};
|
|
442
|
-
font-family: ${e.fontFamily};
|
|
443
|
-
font-size: ${e.pieLegendTextSize};
|
|
444
|
-
}
|
|
445
|
-
`, Nt = Pt, Lt = (e) => {
|
|
446
|
-
const u = Object.entries(e).map((p) => ({
|
|
447
|
-
label: p[0],
|
|
448
|
-
value: p[1]
|
|
449
|
-
})).sort((p, g) => g.value - p.value);
|
|
450
|
-
return St().value(
|
|
451
|
-
(p) => p.value
|
|
452
|
-
)(u);
|
|
453
|
-
}, Ft = (e, u, E, p) => {
|
|
454
|
-
it.debug(`rendering pie chart
|
|
455
|
-
` + e);
|
|
456
|
-
const g = p.db, A = et(), y = gt(g.getConfig(), A.pie), a = 40, l = 18, d = 4, m = 450, D = m, T = dt(u), _ = T.append("g"), k = g.getSections();
|
|
457
|
-
_.attr("transform", "translate(" + D / 2 + "," + m / 2 + ")");
|
|
458
|
-
const { themeVariables: o } = A;
|
|
459
|
-
let [b] = mt(o.pieOuterStrokeWidth);
|
|
460
|
-
b != null || (b = 2);
|
|
461
|
-
const V = y.textPosition, w = Math.min(D, m) / 2 - a, S = tt().innerRadius(0).outerRadius(w), t = tt().innerRadius(w * V).outerRadius(w * V);
|
|
462
|
-
_.append("circle").attr("cx", 0).attr("cy", 0).attr("r", w + b / 2).attr("class", "pieOuterCircle");
|
|
463
|
-
const i = Lt(k), n = [
|
|
464
|
-
o.pie1,
|
|
465
|
-
o.pie2,
|
|
466
|
-
o.pie3,
|
|
467
|
-
o.pie4,
|
|
468
|
-
o.pie5,
|
|
469
|
-
o.pie6,
|
|
470
|
-
o.pie7,
|
|
471
|
-
o.pie8,
|
|
472
|
-
o.pie9,
|
|
473
|
-
o.pie10,
|
|
474
|
-
o.pie11,
|
|
475
|
-
o.pie12
|
|
476
|
-
], r = xt(n);
|
|
477
|
-
_.selectAll("mySlices").data(i).enter().append("path").attr("d", S).attr("fill", (f) => r(f.data.label)).attr("class", "pieCircle");
|
|
478
|
-
let c = 0;
|
|
479
|
-
Object.keys(k).forEach((f) => {
|
|
480
|
-
c += k[f];
|
|
481
|
-
}), _.selectAll("mySlices").data(i).enter().append("text").text((f) => (f.data.value / c * 100).toFixed(0) + "%").attr("transform", (f) => "translate(" + t.centroid(f) + ")").style("text-anchor", "middle").attr("class", "slice"), _.append("text").text(g.getDiagramTitle()).attr("x", 0).attr("y", -(m - 50) / 2).attr("class", "pieTitleText");
|
|
482
|
-
const s = _.selectAll(".legend").data(r.domain()).enter().append("g").attr("class", "legend").attr("transform", (f, I) => {
|
|
483
|
-
const R = l + d, M = R * r.domain().length / 2, B = 12 * l, h = I * R - M;
|
|
484
|
-
return "translate(" + B + "," + h + ")";
|
|
485
|
-
});
|
|
486
|
-
s.append("rect").attr("width", l).attr("height", l).style("fill", r).style("stroke", r), s.data(i).append("text").attr("x", l + d).attr("y", l - d).text((f) => {
|
|
487
|
-
const { label: I, value: R } = f.data;
|
|
488
|
-
return g.getShowData() ? `${I} [${R}]` : I;
|
|
489
|
-
});
|
|
490
|
-
const P = Math.max(
|
|
491
|
-
...s.selectAll("text").nodes().map((f) => {
|
|
492
|
-
var I;
|
|
493
|
-
return (I = f == null ? void 0 : f.getBoundingClientRect().width) != null ? I : 0;
|
|
494
|
-
})
|
|
495
|
-
), x = D + a + l + d + P;
|
|
496
|
-
T.attr("viewBox", `0 0 ${x} ${m}`), _t(T, m, x, y.useMaxWidth);
|
|
497
|
-
}, Rt = { draw: Ft }, Bt = {
|
|
498
|
-
parser: $t,
|
|
499
|
-
db: Vt,
|
|
500
|
-
renderer: Rt,
|
|
501
|
-
styles: Nt
|
|
502
|
-
};
|
|
503
|
-
export {
|
|
504
|
-
Bt as diagram
|
|
505
|
-
};
|