@agile-team/mach-report 2.22.0 → 2.23.0
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 +7 -6
- package/dist/{ExcelBindingWizard-CZyppD7I.js → ExcelBindingWizard-D4FLind-.js} +3 -3
- package/dist/{ExcelBindingWizard-CW79I6Gl.cjs → ExcelBindingWizard-D4RS5Bpg.cjs} +1 -1
- package/dist/{ParamEditor-CiYCJI0b.cjs → ParamEditor-C-6C9rd2.cjs} +1 -1
- package/dist/{ParamEditor-DQit-Gdf.js → ParamEditor-CASZt-Ma.js} +2 -2
- package/dist/{ReportBatchPanel-DKTpV7MU.js → ReportBatchPanel-Bq7t8a5r.js} +2 -2
- package/dist/{ReportBatchPanel-Db6TAfG5.cjs → ReportBatchPanel-YVj5IO5y.cjs} +1 -1
- package/dist/ReportLabelStudio-Cqhita1b.cjs +1 -0
- package/dist/{ReportLabelStudio-BYnRqmje.js → ReportLabelStudio-Dj7GXhuv.js} +295 -292
- package/dist/ReportParamPanel-DZbFVmDL.cjs +1 -0
- package/dist/{ReportParamPanel-BHSKVL8k.js → ReportParamPanel-Dgmqro1Y.js} +93 -79
- package/dist/ReportPreview-DeWzG8jQ.js +6257 -0
- package/dist/ReportPreview-FFIryrIr.cjs +6 -0
- package/dist/{ReportTemplateLibrary-DEXH07ND.cjs → ReportTemplateLibrary-BaWodmpm.cjs} +1 -1
- package/dist/{ReportTemplateLibrary-BZuKn0YK.js → ReportTemplateLibrary-DdAAAD2I.js} +1 -1
- package/dist/{RuleEditor-CIQn547x.js → RuleEditor-D2UwQGF6.js} +59 -59
- package/dist/{RuleEditor-zSUmPjKa.cjs → RuleEditor-DcT9xI1v.cjs} +1 -1
- package/dist/TemplateOutlinePanel-CUHFFiNM.cjs +1 -0
- package/dist/{TemplateOutlinePanel-D0PgOSQE.js → TemplateOutlinePanel-DrT7XN0m.js} +2 -2
- package/dist/{TemplateReusePanel-BKlAEF8-.js → TemplateReusePanel-4eejkNqi.js} +2 -2
- package/dist/{TemplateReusePanel-DAy_Hwqz.cjs → TemplateReusePanel-DZMyiX5I.cjs} +1 -1
- package/dist/{TemplateReviewPanel-div-EH_m.js → TemplateReviewPanel-BIhNLeNw.js} +2 -2
- package/dist/{TemplateReviewPanel-CowmHaQQ.cjs → TemplateReviewPanel-DnYImiXu.cjs} +1 -1
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.js +26 -26
- package/dist/artifact-integrity.json +106 -104
- package/dist/assets-D2gHc4Mz.cjs +1 -0
- package/dist/assets-T_gDeFaz.js +132 -0
- package/dist/auto-4pK9HePf.cjs +1 -0
- package/dist/auto-CTIJ6PnR.js +257 -0
- package/dist/capabilities-DiBj4Qgl.cjs +1 -0
- package/dist/capabilities-pg7j7VLT.js +106 -0
- package/dist/charts-Cjw5AYkg.cjs +1 -0
- package/dist/{charts-Dlv8j2AG.js → charts-CxJZ0XaY.js} +1 -1
- package/dist/computed-DK6BruFz.cjs +1 -0
- package/dist/{computed-C8NRZQss.js → computed-f3pOqWLX.js} +381 -301
- package/dist/data-bar-CeZuFmYl.cjs +1 -0
- package/dist/{data-bar-8baGYEZ9.js → data-bar-IkI6VvMQ.js} +1 -1
- package/dist/designer-DhrE7jzw.js +7169 -0
- package/dist/designer-IAZu6kBX.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +98 -45
- package/dist/designer.d.ts +98 -45
- package/dist/designer.js +3 -3
- package/dist/dom-ChE5D-L-.cjs +1 -0
- package/dist/dom-JWrchIre.js +452 -0
- package/dist/dom-cell-address-DLD1mkTB.cjs +1 -0
- package/dist/dom-cell-address-Fn-8nk7D.js +11 -0
- package/dist/{encoding-ncQAvyOv.cjs → encoding-BefcaHdp.cjs} +1 -1
- package/dist/{encoding-DbnhbwI8.js → encoding-CL6rXEkR.js} +2 -2
- package/dist/{font-loader-Di0lQKFf.js → font-loader-BT5baV-o.js} +1 -1
- package/dist/{font-loader-BB372_XN.cjs → font-loader-Ga51c2VC.cjs} +1 -1
- package/dist/grid-strokes-Be24LGuV.cjs +1 -0
- package/dist/grid-strokes-EoY66L2f.js +53 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +944 -1259
- package/dist/json-snapshot-1tvQNzQE.cjs +2 -0
- package/dist/{json-snapshot-DvQbZlD7.js → json-snapshot-OqkPyUk5.js} +763 -776
- package/dist/matrix-B8QWbsGM.cjs +1 -0
- package/dist/matrix-C6e_r_vp.js +302 -0
- package/dist/{pdf-CARdBcuw.cjs → pdf-HiEeXe9H.cjs} +42 -42
- package/dist/{pdf-DmlnL5eB.js → pdf-aobetCsy.js} +20 -20
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.js +2 -2
- package/dist/{plugin-AcAQ2m9X.cjs → plugin-BFANt-i8.cjs} +1 -1
- package/dist/{plugin-w5Nyt08U.js → plugin-DeYYAL6F.js} +1 -1
- package/dist/{prefill-BXBxx5We.js → prefill-Dk4C6S5R.js} +21 -21
- package/dist/prefill-DsUD5OoK.cjs +1 -0
- package/dist/prepared-DCIxhKFo.js +94 -0
- package/dist/prepared-Dv-XM3i1.cjs +1 -0
- package/dist/progress-ByiOxUD3.js +250 -0
- package/dist/progress-WomPRP3B.cjs +1 -0
- package/dist/{protocol-C9ZaylID.cjs → protocol-B9YgfQ_d.cjs} +1 -1
- package/dist/{protocol-fjaeKkjf.js → protocol-DxeUKGYG.js} +3 -3
- package/dist/record-bindings-DatJZv_e.js +200 -0
- package/dist/record-bindings-MBxbeBsi.cjs +1 -0
- package/dist/{region-binding-workflow-aA8nxmkZ.js → region-binding-workflow-DjrXuR1q.js} +2 -2
- package/dist/{region-binding-workflow-BiJQ7NU6.cjs → region-binding-workflow-l7NGfagJ.cjs} +2 -2
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/rich-text-layout-Ciwa6D2o.js +52 -0
- package/dist/rich-text-layout-DK7A_a5r.cjs +3 -0
- package/dist/{runtime-BTtpjF3D.js → runtime-75Y5Oq5B.js} +52 -51
- package/dist/runtime-DKlGd_D4.cjs +1 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +1642 -1586
- package/dist/server.cjs +1 -1
- package/dist/server.js +24 -24
- package/dist/style.css +1 -1
- package/dist/{template-catalog-JSxSqk5y.js → template-catalog--cjxzgH7.js} +17 -17
- package/dist/template-catalog-CoT7jm_6.cjs +1 -0
- package/dist/{template-fragments-D2JFj7Du.js → template-fragments-CPpGpQoz.js} +12 -12
- package/dist/template-fragments-GVjpew_q.cjs +1 -0
- package/dist/template-registry-DI59PXVK.cjs +1 -0
- package/dist/{template-registry-Do1Uav2Z.js → template-registry-O0hNIOfB.js} +17 -17
- package/dist/{template-serialization-CU4n_Miu.js → template-serialization-CWmHq7lX.js} +1 -1
- package/dist/{template-serialization-CgqBo6s-.cjs → template-serialization-CqQY4zDg.cjs} +1 -1
- package/dist/{textwrap-CkGjRFT3.js → textwrap-BIjtEWmq.js} +1 -1
- package/dist/textwrap-Cy7o1hIR.cjs +4 -0
- package/dist/vue/async.d.cts +24 -0
- package/dist/vue/async.d.ts +24 -0
- package/dist/vue/index.d.cts +25 -1
- package/dist/vue/index.d.ts +25 -1
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +52 -47
- package/dist/{workbook-session-BvEBRRMz.cjs → workbook-session-C6-SrnCT.cjs} +4 -4
- package/dist/{workbook-session-f0wVlzst.js → workbook-session-C9ZmCBwY.js} +15 -16
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.js +184 -179
- package/package.json +1 -1
- package/dist/ReportLabelStudio-B0i9ohQj.cjs +0 -1
- package/dist/ReportParamPanel-lngONOEz.cjs +0 -1
- package/dist/ReportPreview-BDgKssYR.js +0 -5887
- package/dist/ReportPreview-Dw-4icG6.cjs +0 -6
- package/dist/TemplateOutlinePanel-B5SfGYVN.cjs +0 -1
- package/dist/assets-CxHunY_9.js +0 -232
- package/dist/assets-vbjAGgk8.cjs +0 -1
- package/dist/auto-DcUHlKob.cjs +0 -1
- package/dist/auto-moShblh1.js +0 -240
- package/dist/charts-aCtoswXq.cjs +0 -1
- package/dist/component-tree-1_QCiQJX.js +0 -67
- package/dist/component-tree-BjZIp6w9.cjs +0 -1
- package/dist/computed-4TnxzgIh.cjs +0 -1
- package/dist/data-bar-YltqGTaC.cjs +0 -1
- package/dist/designer-B7jJeAeG.js +0 -6914
- package/dist/designer-BWQVpJeN.cjs +0 -2
- package/dist/grid-geometry-D3SJgWFv.js +0 -136
- package/dist/grid-geometry-D8ReblRV.cjs +0 -1
- package/dist/json-snapshot-nyV63AbB.cjs +0 -2
- package/dist/matrix-0hywp0-F.cjs +0 -1
- package/dist/matrix-Dy-tyY7E.js +0 -381
- package/dist/prefill-DUvejVt1.cjs +0 -1
- package/dist/prepared-YXy-fVLw.cjs +0 -1
- package/dist/prepared-rXCKqdHY.js +0 -88
- package/dist/progress-B0ctFpKf.cjs +0 -1
- package/dist/progress-Hc2vxoCs.js +0 -52
- package/dist/record-bindings-Ct1HkPrc.cjs +0 -1
- package/dist/record-bindings-VZGS-Qd8.js +0 -155
- package/dist/rich-text-layout-K48VHUoW.cjs +0 -3
- package/dist/rich-text-layout-wxBhnAS7.js +0 -102
- package/dist/runtime-Dq0LUsyS.cjs +0 -1
- package/dist/template-catalog-CLAM4w7H.cjs +0 -1
- package/dist/template-fragments-Ca25Jt7e.cjs +0 -1
- package/dist/template-outline-CDWXptuj.js +0 -88
- package/dist/template-outline-K4jGhATu.cjs +0 -1
- package/dist/template-registry-CWnuGqyP.cjs +0 -1
- package/dist/textwrap-OTOUMr4f.cjs +0 -4
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
const G = 1.35, K = 10.5, W = '"Microsoft YaHei", sans-serif', q = 0.75, z = "#333333", F = "#000000", k = "1.0.0-mach", V = 25.4, Y = 96;
|
|
2
|
+
function O(t = 96) {
|
|
3
|
+
return t / 25.4;
|
|
4
|
+
}
|
|
5
|
+
function X(t, e = 96) {
|
|
6
|
+
return (t || 0) * O(e);
|
|
7
|
+
}
|
|
8
|
+
function Z(t, e = 96) {
|
|
9
|
+
return t / O(e);
|
|
10
|
+
}
|
|
11
|
+
function v(t, e = 96) {
|
|
12
|
+
return t * e / 72;
|
|
13
|
+
}
|
|
14
|
+
function J(t, e) {
|
|
15
|
+
const n = 10 ** e;
|
|
16
|
+
return Math.round(t * n) / n;
|
|
17
|
+
}
|
|
18
|
+
const Q = {
|
|
19
|
+
a3: { widthMm: 297, heightMm: 420 },
|
|
20
|
+
a4: { widthMm: 210, heightMm: 297 },
|
|
21
|
+
a5: { widthMm: 148, heightMm: 210 },
|
|
22
|
+
b4: { widthMm: 250, heightMm: 353 },
|
|
23
|
+
b5: { widthMm: 176, heightMm: 250 }
|
|
24
|
+
};
|
|
25
|
+
function tt(t, e = 96, n = 10.5) {
|
|
26
|
+
if (t?.fontSizePx != null)
|
|
27
|
+
return { fontSizePt: t.fontSizePx * 72 / e, fontSizePx: t.fontSizePx };
|
|
28
|
+
const o = t?.fontSize ?? n;
|
|
29
|
+
return { fontSizePt: o, fontSizePx: v(o, e) };
|
|
30
|
+
}
|
|
31
|
+
function et(t, e = z) {
|
|
32
|
+
return {
|
|
33
|
+
color: t?.borderColor ?? t?.lineColor ?? e,
|
|
34
|
+
widthPt: t?.lineWidthPt ?? 0.75
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function nt(t, e = F) {
|
|
38
|
+
return t?.color ?? e;
|
|
39
|
+
}
|
|
40
|
+
function ot(t) {
|
|
41
|
+
return t?.lineHeight ?? 1.35;
|
|
42
|
+
}
|
|
43
|
+
function rt(t) {
|
|
44
|
+
const e = t?.borderTop !== !1, n = t?.borderRight !== !1, o = t?.borderBottom !== !1, i = t?.borderLeft !== !1;
|
|
45
|
+
return { top: e, right: n, bottom: o, left: i, inner: e || n || o || i };
|
|
46
|
+
}
|
|
47
|
+
function st(t, e) {
|
|
48
|
+
const n = { ...t, ...e };
|
|
49
|
+
return e?.fontSize != null && e.fontSizePx == null && delete n.fontSizePx, e?.fontSizePx != null && e.fontSize == null && delete n.fontSize, n;
|
|
50
|
+
}
|
|
51
|
+
function H(t, e) {
|
|
52
|
+
const n = t.length;
|
|
53
|
+
if (n === 0) return [];
|
|
54
|
+
const o = t.reduce((f, h) => f + h, 0), i = o > 0 && e > 0 ? e / o : 1, a = [];
|
|
55
|
+
let u = 0;
|
|
56
|
+
for (let f = 0; f < n; f++) {
|
|
57
|
+
const h = Math.max(0, t[f] * i);
|
|
58
|
+
a.push({ pos: u, size: h }), u += h;
|
|
59
|
+
}
|
|
60
|
+
return a;
|
|
61
|
+
}
|
|
62
|
+
function L(t, e, n) {
|
|
63
|
+
return t?.length ? H(t, e) : Array.from({ length: n }, (o, i) => ({
|
|
64
|
+
pos: e * i / n,
|
|
65
|
+
size: e / n
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
function it(t, e, n) {
|
|
69
|
+
const o = t.cells ?? [], i = Math.max(o.length, 1), a = t.colWidthsMm?.length ?? o.reduce((r, s) => Math.max(r, Array.isArray(s) ? s.length : 0), 1), u = L(t.colWidthsMm, e, a), f = (r) => r <= 0 ? 0 : r >= a ? u[u.length - 1].pos + u[u.length - 1].size : u[r].pos, h = L(t.rowHeightsMm, n, i), S = (r) => r <= 0 ? 0 : r >= i ? h[h.length - 1].pos + h[h.length - 1].size : h[r].pos, w = /* @__PURE__ */ new Set(), g = (r, s) => `${r}:${s}`, T = [], M = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Set(), x = (r, s) => `v${r}:${s}`, y = (r, s) => `h${r}:${s}`;
|
|
70
|
+
o.forEach((r, s) => {
|
|
71
|
+
if (!Array.isArray(r)) return;
|
|
72
|
+
let c = 0;
|
|
73
|
+
for (const m of r) {
|
|
74
|
+
for (; c < a && w.has(g(s, c)); ) c++;
|
|
75
|
+
if (c >= a) break;
|
|
76
|
+
const I = Math.max(1, Math.min(m?.colSpan ?? 1, a - c)), $ = Math.max(1, m?.rowSpan ?? 1), E = Math.min(i, s + $), p = Math.min(a, c + I);
|
|
77
|
+
for (let d = s; d < E; d++)
|
|
78
|
+
for (let l = c; l < p; l++)
|
|
79
|
+
w.add(g(d, l));
|
|
80
|
+
for (let d = c + 1; d < p; d++)
|
|
81
|
+
for (let l = s; l < E; l++) M.add(x(d, l));
|
|
82
|
+
for (let d = s + 1; d < E; d++)
|
|
83
|
+
for (let l = c; l < p; l++) _.add(y(d, l));
|
|
84
|
+
const D = f(c), C = S(s);
|
|
85
|
+
T.push({
|
|
86
|
+
ri: s,
|
|
87
|
+
ci: c,
|
|
88
|
+
cell: m ?? {},
|
|
89
|
+
xMm: D,
|
|
90
|
+
yMm: C,
|
|
91
|
+
widthMm: f(p) - D,
|
|
92
|
+
heightMm: S(E) - C
|
|
93
|
+
}), c = p;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
const b = [];
|
|
97
|
+
for (let r = 1; r < a; r++) {
|
|
98
|
+
let s = -1;
|
|
99
|
+
for (let c = 0; c <= i; c++) {
|
|
100
|
+
const m = c < i && !M.has(x(r, c));
|
|
101
|
+
m && s < 0 && (s = c), !m && s >= 0 && (b.push({ kind: "v", pos: f(r), from: S(s), to: S(c) }), s = -1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
for (let r = 1; r < i; r++) {
|
|
105
|
+
let s = -1;
|
|
106
|
+
for (let c = 0; c <= a; c++) {
|
|
107
|
+
const m = c < a && !_.has(y(r, c));
|
|
108
|
+
m && s < 0 && (s = c), !m && s >= 0 && (b.push({ kind: "h", pos: S(r), from: f(s), to: f(c) }), s = -1);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return { columns: u, rows: h, cells: T, edges: b };
|
|
112
|
+
}
|
|
113
|
+
function ct(t) {
|
|
114
|
+
if (!t || typeof t != "object" || Array.isArray(t)) return !1;
|
|
115
|
+
const { start: e, end: n, color: o } = t;
|
|
116
|
+
return typeof e == "number" && typeof n == "number" && Number.isFinite(e) && Number.isFinite(n) && e >= 0 && n <= 1 && e <= n && typeof o == "string" && /^#[0-9a-f]{6}$/i.test(o);
|
|
117
|
+
}
|
|
118
|
+
const at = k;
|
|
119
|
+
function ft(t) {
|
|
120
|
+
return (t.kind === "image" || t.kind === "barcode" || t.kind === "qrcode" || t.kind === "chart") && !!t.imageData;
|
|
121
|
+
}
|
|
122
|
+
function ut(t) {
|
|
123
|
+
return t.kind === "text" && Array.isArray(t.richParagraphs) && t.richParagraphs.length > 0;
|
|
124
|
+
}
|
|
125
|
+
function A(t) {
|
|
126
|
+
return !!t && typeof t == "object";
|
|
127
|
+
}
|
|
128
|
+
function R(t, e, n, o, i) {
|
|
129
|
+
if (++i.nodes > 1e6) return { path: e, message: "组件树超过100万个结构节点预算" };
|
|
130
|
+
if (A(t)) {
|
|
131
|
+
if (n > 64) return { path: e, message: "组件嵌套超过64层预算" };
|
|
132
|
+
if (o.has(t)) return { path: e, message: "组件树包含循环引用" };
|
|
133
|
+
if (!(!A(t.grid) || !Array.isArray(t.grid.cells))) {
|
|
134
|
+
o.add(t);
|
|
135
|
+
try {
|
|
136
|
+
for (const [a, u] of t.grid.cells.entries())
|
|
137
|
+
if (Array.isArray(u))
|
|
138
|
+
for (const [f, h] of u.entries()) {
|
|
139
|
+
if (++i.nodes > 1e6) return { path: e, message: "组件树超过100万个结构节点预算" };
|
|
140
|
+
if (!(!A(h) || !Array.isArray(h.children)))
|
|
141
|
+
for (const [S, w] of h.children.entries()) {
|
|
142
|
+
const g = R(w, `${e}.grid.cells.${a}.${f}.children.${S}`, n + 1, o, i);
|
|
143
|
+
if (g) return g;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
} finally {
|
|
147
|
+
o.delete(t);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function N(t, e = "$.components", n = { nodes: 0 }) {
|
|
153
|
+
for (const [o, i] of t.entries()) {
|
|
154
|
+
const a = R(i, `${e}.${o}`, 0, /* @__PURE__ */ new Set(), n);
|
|
155
|
+
if (a) return a;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function B(t) {
|
|
159
|
+
const e = { nodes: 0 };
|
|
160
|
+
for (const [n, o] of t.entries()) {
|
|
161
|
+
if (!A(o) || !Array.isArray(o.components)) continue;
|
|
162
|
+
const i = N(o.components, `$.pages.${n}.components`, e);
|
|
163
|
+
if (i) return i;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function ht(t) {
|
|
167
|
+
const e = B(t.pages);
|
|
168
|
+
if (e) throw new TypeError(`${e.path}: ${e.message}`);
|
|
169
|
+
}
|
|
170
|
+
function P(t) {
|
|
171
|
+
if (t?.aborted) throw t.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
172
|
+
}
|
|
173
|
+
function U(t) {
|
|
174
|
+
try {
|
|
175
|
+
Promise.resolve(t()).catch(() => {
|
|
176
|
+
});
|
|
177
|
+
} catch {
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function j(t, e, n) {
|
|
181
|
+
P(t.signal), U(() => t.onProgress?.(e, n)), P(t.signal);
|
|
182
|
+
}
|
|
183
|
+
function dt(t, e) {
|
|
184
|
+
const n = Promise.resolve(t);
|
|
185
|
+
return e?.aborted ? (n.catch(() => {
|
|
186
|
+
}), Promise.reject(e.reason ?? new DOMException("The operation was aborted.", "AbortError"))) : e ? new Promise((o, i) => {
|
|
187
|
+
const a = () => e.removeEventListener("abort", u), u = () => {
|
|
188
|
+
a(), i(e.reason ?? new DOMException("The operation was aborted.", "AbortError"));
|
|
189
|
+
};
|
|
190
|
+
e.addEventListener("abort", u, { once: !0 }), n.then((f) => {
|
|
191
|
+
a(), o(f);
|
|
192
|
+
}, (f) => {
|
|
193
|
+
a(), i(f);
|
|
194
|
+
}), e.aborted && u();
|
|
195
|
+
}) : n;
|
|
196
|
+
}
|
|
197
|
+
function lt(t, e) {
|
|
198
|
+
const n = () => e.abort(t?.reason);
|
|
199
|
+
return t?.addEventListener("abort", n, { once: !0 }), t?.aborted && n(), () => t?.removeEventListener("abort", n);
|
|
200
|
+
}
|
|
201
|
+
async function mt(t, e, n) {
|
|
202
|
+
j(t, e, n), (t.signal || t.onProgress) && await new Promise((o) => setTimeout(o, 0)), P(t.signal);
|
|
203
|
+
}
|
|
204
|
+
function St(t) {
|
|
205
|
+
let e = 0, n = Date.now();
|
|
206
|
+
return (o = 1) => {
|
|
207
|
+
if (P(t.signal), e += o, !(e < 4096 && Date.now() - n < 8))
|
|
208
|
+
return e = 0, new Promise((i) => setTimeout(i, 0)).then(() => {
|
|
209
|
+
n = Date.now(), P(t.signal);
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
export {
|
|
214
|
+
N as A,
|
|
215
|
+
B,
|
|
216
|
+
Y as C,
|
|
217
|
+
W as D,
|
|
218
|
+
ht as E,
|
|
219
|
+
G as L,
|
|
220
|
+
V as M,
|
|
221
|
+
Q as P,
|
|
222
|
+
at as R,
|
|
223
|
+
k as S,
|
|
224
|
+
tt as a,
|
|
225
|
+
ot as b,
|
|
226
|
+
nt as c,
|
|
227
|
+
et as d,
|
|
228
|
+
rt as e,
|
|
229
|
+
ut as f,
|
|
230
|
+
F as g,
|
|
231
|
+
q as h,
|
|
232
|
+
ft as i,
|
|
233
|
+
K as j,
|
|
234
|
+
z as k,
|
|
235
|
+
X as l,
|
|
236
|
+
st as m,
|
|
237
|
+
O as n,
|
|
238
|
+
mt as o,
|
|
239
|
+
v as p,
|
|
240
|
+
Z as q,
|
|
241
|
+
it as r,
|
|
242
|
+
J as s,
|
|
243
|
+
St as t,
|
|
244
|
+
U as u,
|
|
245
|
+
P as v,
|
|
246
|
+
dt as w,
|
|
247
|
+
j as x,
|
|
248
|
+
ct as y,
|
|
249
|
+
lt as z
|
|
250
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const G='"Microsoft YaHei", sans-serif';const I="#333333",F="#000000",y="1.0.0-mach";function M(e=96){return e/25.4}function K(e,t=96){return(e||0)*M(t)}function V(e,t=96){return e/M(t)}function N(e,t=96){return e*t/72}function j(e,t){const o=10**t;return Math.round(e*o)/o}const W={a3:{widthMm:297,heightMm:420},a4:{widthMm:210,heightMm:297},a5:{widthMm:148,heightMm:210},b4:{widthMm:250,heightMm:353},b5:{widthMm:176,heightMm:250}};function Y(e,t=96,o=10.5){if(e?.fontSizePx!=null)return{fontSizePt:e.fontSizePx*72/t,fontSizePx:e.fontSizePx};const n=e?.fontSize??o;return{fontSizePt:n,fontSizePx:N(n,t)}}function X(e,t=I){return{color:e?.borderColor??e?.lineColor??t,widthPt:e?.lineWidthPt??.75}}function Z(e,t=F){return e?.color??t}function q(e){return e?.lineHeight??1.35}function J(e){const t=e?.borderTop!==!1,o=e?.borderRight!==!1,n=e?.borderBottom!==!1,i=e?.borderLeft!==!1;return{top:t,right:o,bottom:n,left:i,inner:t||o||n||i}}function Q(e,t){const o={...e,...t};return t?.fontSize!=null&&t.fontSizePx==null&&delete o.fontSizePx,t?.fontSizePx!=null&&t.fontSize==null&&delete o.fontSize,o}function ee(e,t){const o=e.length;if(o===0)return[];const n=e.reduce((a,d)=>a+d,0),i=n>0&&t>0?t/n:1,u=[];let f=0;for(let a=0;a<o;a++){const d=Math.max(0,e[a]*i);u.push({pos:f,size:d}),f+=d}return u}function C(e,t,o){return e?.length?ee(e,t):Array.from({length:o},(n,i)=>({pos:t*i/o,size:t/o}))}function te(e,t,o){const n=e.cells??[],i=Math.max(n.length,1),u=e.colWidthsMm?.length??n.reduce((r,s)=>Math.max(r,Array.isArray(s)?s.length:0),1),f=C(e.colWidthsMm,t,u),a=r=>r<=0?0:r>=u?f[f.length-1].pos+f[f.length-1].size:f[r].pos,d=C(e.rowHeightsMm,o,i),E=r=>r<=0?0:r>=i?d[d.length-1].pos+d[d.length-1].size:d[r].pos,P=new Set,S=(r,s)=>`${r}:${s}`,w=[],O=new Set,b=new Set,D=(r,s)=>`v${r}:${s}`,x=(r,s)=>`h${r}:${s}`;n.forEach((r,s)=>{if(!Array.isArray(r))return;let c=0;for(const m of r){for(;c<u&&P.has(S(s,c));)c++;if(c>=u)break;const k=Math.max(1,Math.min(m?.colSpan??1,u-c)),U=Math.max(1,m?.rowSpan??1),p=Math.min(i,s+U),_=Math.min(u,c+k);for(let l=s;l<p;l++)for(let h=c;h<_;h++)P.add(S(l,h));for(let l=c+1;l<_;l++)for(let h=s;h<p;h++)O.add(D(l,h));for(let l=s+1;l<p;l++)for(let h=c;h<_;h++)b.add(x(l,h));const L=a(c),R=E(s);w.push({ri:s,ci:c,cell:m??{},xMm:L,yMm:R,widthMm:a(_)-L,heightMm:E(p)-R}),c=_}});const g=[];for(let r=1;r<u;r++){let s=-1;for(let c=0;c<=i;c++){const m=c<i&&!O.has(D(r,c));m&&s<0&&(s=c),!m&&s>=0&&(g.push({kind:"v",pos:a(r),from:E(s),to:E(c)}),s=-1)}}for(let r=1;r<i;r++){let s=-1;for(let c=0;c<=u;c++){const m=c<u&&!b.has(x(r,c));m&&s<0&&(s=c),!m&&s>=0&&(g.push({kind:"h",pos:E(r),from:a(s),to:a(c)}),s=-1)}}return{columns:f,rows:d,cells:w,edges:g}}function oe(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const{start:t,end:o,color:n}=e;return typeof t=="number"&&typeof o=="number"&&Number.isFinite(t)&&Number.isFinite(o)&&t>=0&&o<=1&&t<=o&&typeof n=="string"&&/^#[0-9a-f]{6}$/i.test(n)}const ne=y;function re(e){return(e.kind==="image"||e.kind==="barcode"||e.kind==="qrcode"||e.kind==="chart")&&!!e.imageData}function se(e){return e.kind==="text"&&Array.isArray(e.richParagraphs)&&e.richParagraphs.length>0}function A(e){return!!e&&typeof e=="object"}function H(e,t,o,n,i){if(++i.nodes>1e6)return{path:t,message:"组件树超过100万个结构节点预算"};if(A(e)){if(o>64)return{path:t,message:"组件嵌套超过64层预算"};if(n.has(e))return{path:t,message:"组件树包含循环引用"};if(!(!A(e.grid)||!Array.isArray(e.grid.cells))){n.add(e);try{for(const[u,f]of e.grid.cells.entries())if(Array.isArray(f))for(const[a,d]of f.entries()){if(++i.nodes>1e6)return{path:t,message:"组件树超过100万个结构节点预算"};if(!(!A(d)||!Array.isArray(d.children)))for(const[E,P]of d.children.entries()){const S=H(P,`${t}.grid.cells.${u}.${a}.children.${E}`,o+1,n,i);if(S)return S}}}finally{n.delete(e)}}}}function v(e,t="$.components",o={nodes:0}){for(const[n,i]of e.entries()){const u=H(i,`${t}.${n}`,0,new Set,o);if(u)return u}}function $(e){const t={nodes:0};for(const[o,n]of e.entries()){if(!A(n)||!Array.isArray(n.components))continue;const i=v(n.components,`$.pages.${o}.components`,t);if(i)return i}}function ie(e){const t=$(e.pages);if(t)throw new TypeError(`${t.path}: ${t.message}`)}function T(e){if(e?.aborted)throw e.reason??new DOMException("The operation was aborted.","AbortError")}function z(e){try{Promise.resolve(e()).catch(()=>{})}catch{}}function B(e,t,o){T(e.signal),z(()=>e.onProgress?.(t,o)),T(e.signal)}function ce(e,t){const o=Promise.resolve(e);return t?.aborted?(o.catch(()=>{}),Promise.reject(t.reason??new DOMException("The operation was aborted.","AbortError"))):t?new Promise((n,i)=>{const u=()=>t.removeEventListener("abort",f),f=()=>{u(),i(t.reason??new DOMException("The operation was aborted.","AbortError"))};t.addEventListener("abort",f,{once:!0}),o.then(a=>{u(),n(a)},a=>{u(),i(a)}),t.aborted&&f()}):o}function ue(e,t){const o=()=>t.abort(e?.reason);return e?.addEventListener("abort",o,{once:!0}),e?.aborted&&o(),()=>e?.removeEventListener("abort",o)}async function ae(e,t,o){B(e,t,o),(e.signal||e.onProgress)&&await new Promise(n=>setTimeout(n,0)),T(e.signal)}function fe(e){let t=0,o=Date.now();return(n=1)=>{if(T(e.signal),t+=n,!(t<4096&&Date.now()-o<8))return t=0,new Promise(i=>setTimeout(i,0)).then(()=>{o=Date.now(),T(e.signal)})}}exports.CSS_DPI=96;exports.DEFAULT_BORDER_PT=.75;exports.DEFAULT_FONT_FAMILY=G;exports.DEFAULT_FONT_PT=10.5;exports.DEFAULT_STROKE_COLOR=I;exports.DEFAULT_TEXT_COLOR=F;exports.LINE_HEIGHT=1.35;exports.MM_PER_INCH=25.4;exports.PAPER_SIZES=W;exports.RENDER_PLAN_SCHEMA_VERSION=ne;exports.SCHEMA_VERSION_MACH=y;exports.assertBoundedRenderTree=ie;exports.assertOutputActive=T;exports.componentTreeIssue=v;exports.createOutputScheduler=fe;exports.forwardOutputAbort=ue;exports.isImageBackedComponent=re;exports.isRichText=se;exports.mergeComponentStyles=Q;exports.mmToPx=K;exports.mmToPxFactor=M;exports.notifyOutputProgress=B;exports.observeOutput=z;exports.outputCheckpoint=ae;exports.ptToPx=N;exports.pxToMm=V;exports.renderTreeIssue=$;exports.resolveBoxBorders=J;exports.resolveFontSize=Y;exports.resolveGridLayout=te;exports.resolveLineHeight=q;exports.resolveStroke=X;exports.resolveTextColor=Z;exports.round=j;exports.validDataBar=oe;exports.waitForOutput=ce;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const f=require("./prepared-
|
|
1
|
+
"use strict";const f=require("./prepared-Dv-XM3i1.cjs"),c=require("./json-snapshot-1tvQNzQE.cjs"),a=require("./template-registry-DI59PXVK.cjs"),i="mach-report-worker/1";class d extends Error{constructor(t){super(t.message),this.name=t.name,this.code=t.code,this.path=t.path,this.issues=t.issues,this.diagnostics=t.diagnostics}}function o(r){return!!r&&typeof r=="object"&&!Array.isArray(r)}function y(r){return o(r)?["rows","pages","cells"].every(t=>typeof r[t]=="number"&&Number.isSafeInteger(r[t])&&r[t]>=0)&&typeof r.durationMs=="number"&&Number.isFinite(r.durationMs)&&r.durationMs>=0:!1}function g(r){return Array.isArray(r)&&r.every(t=>o(t)&&typeof t.code=="string"&&typeof t.message=="string"&&["info","warning","error"].includes(t.severity)&&c.hasValidDataExplanation(t))}function m(r){return o(r)&&Object.values(r).every(t=>o(t)&&(t.revision===void 0||typeof t.revision=="string")&&(t.sourceToken===void 0||typeof t.sourceToken=="string"))}function u(r){return r===void 0?!0:o(r)&&["heuristic","provided","font-bytes"].includes(r.textMetrics)&&(r.fontFingerprint===void 0||typeof r.fontFingerprint=="string"&&/^[a-f0-9]{64}$/.test(r.fontFingerprint))}function R(r,t){if(!o(r)||!y(r.stats)||!g(r.diagnostics)||!m(r.revisions)||!u(r.layout)||!f.validPreparedSources(r.sources))return!1;if(t==="prepare")return a.validateRenderPlan(r.plan).ok;const e=r.format==="pdf"?"application/pdf":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";return r.bytes instanceof Uint8Array&&(r.format==="pdf"||r.format==="xlsx")&&r.contentType===e}function n(r){if(!r||typeof r!="object")return{message:String(r)};const t={};for(const e of["code","path","field","message"]){const s=r[e];typeof s=="string"&&(t[e]=s)}return t}function k(r){const t=n(r);if(!o(r))return t;for(const e of["format","severity","kind","nid"])typeof r[e]=="string"&&(t[e]=r[e]);for(const e of["pageIndex","componentIndex"])Number.isSafeInteger(r[e])&&r[e]>=0&&(t[e]=r[e]);return Array.isArray(r.componentPath)&&r.componentPath.every(e=>Number.isSafeInteger(e)&&e>=0)&&(t.componentPath=r.componentPath),t}function p(r){if(!(r instanceof Error))return{name:"Error",message:String(r)};const t=r;return{name:r.name,message:r.message,...typeof t.code=="string"?{code:t.code}:{},...typeof t.path=="string"?{path:t.path}:{},...Array.isArray(t.issues)?{issues:t.issues.map(n)}:{},...Array.isArray(t.diagnostics)?{diagnostics:t.diagnostics.map(k)}:{}}}function h(r){if(!r||typeof r!="object")return!1;const t=r;return t.protocol===i&&typeof t.id=="string"&&(t.operation==="prepare"||t.operation==="export"||t.operation==="exportPrepared")&&!!t.input&&typeof t.input=="object"}async function b(r,t,e){try{const s=t.operation==="prepare"?await r.prepare({...t.input,onEvent:e}):t.operation==="exportPrepared"?await r.exportPrepared({...t.input,onEvent:e}):await r.export({...t.input,onEvent:e});return{protocol:i,id:t.id,result:s}}catch(s){return{protocol:i,id:t.id,error:p(s)}}}function I(r){const t=r.result;return!t||!("bytes"in t)||!(t.bytes.buffer instanceof ArrayBuffer)?[]:[t.bytes.buffer]}function W(r,t){if(!o(r)||typeof r.taskId!="string"||!r.taskId||t.taskId!==void 0&&r.taskId!==t.taskId||r.correlationId!==t.correlationId||r.reportId!==void 0&&(typeof r.reportId!="string"||!("reportIds"in t&&t.reportIds.includes(r.reportId)))||!["query","validate","layout","assets","encode"].includes(r.stage)||!["started","completed","failed"].includes(r.status))return!1;for(const e of["completed","total"])if(r[e]!==void 0&&(typeof r[e]!="number"||!Number.isFinite(r[e])||r[e]<0))return!1;return r.completed===void 0||r.total===void 0||r.completed<=r.total}exports.REPORT_WORKER_PROTOCOL=i;exports.ReportWorkerError=d;exports.isReportWorkerRequest=h;exports.reportWorkerTransferList=I;exports.runReportWorkerRequest=b;exports.serializeError=p;exports.validReportWorkerEvent=W;exports.validReportWorkerResult=R;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { b as p } from "./template-registry-
|
|
1
|
+
import { d as f } from "./prepared-DCIxhKFo.js";
|
|
2
|
+
import { v as a } from "./json-snapshot-OqkPyUk5.js";
|
|
3
|
+
import { b as p } from "./template-registry-O0hNIOfB.js";
|
|
4
4
|
const i = "mach-report-worker/1";
|
|
5
5
|
class I extends Error {
|
|
6
6
|
constructor(r) {
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { m as f, j as m } from "./progress-ByiOxUD3.js";
|
|
2
|
+
import { a as S, c as M } from "./charts-CxJZ0XaY.js";
|
|
3
|
+
import { n as w, i as l, f as C } from "./computed-f3pOqWLX.js";
|
|
4
|
+
function N(e) {
|
|
5
|
+
if (!e || e.kind === "date") return;
|
|
6
|
+
const t = e.digits;
|
|
7
|
+
if (!(t !== void 0 && (!Number.isInteger(t) || t < 0 || t > 100))) {
|
|
8
|
+
if (e.kind === "percent") {
|
|
9
|
+
const r = t ?? 2;
|
|
10
|
+
return `0${r ? `.${"0".repeat(r)}` : ""}%`;
|
|
11
|
+
}
|
|
12
|
+
return t === void 0 ? e.thousands ? "#,##0.###############" : void 0 : `${e.thousands ? "#,##0" : "0"}${t ? `.${"0".repeat(t)}` : ""}`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function $(e) {
|
|
16
|
+
const t = /^(\d{4})[-/](\d{1,2})[-/](\d{1,2})$/.exec(e.trim());
|
|
17
|
+
if (t) {
|
|
18
|
+
const i = new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3]));
|
|
19
|
+
return Number.isNaN(i.getTime()) ? null : i;
|
|
20
|
+
}
|
|
21
|
+
const r = new Date(e);
|
|
22
|
+
return Number.isNaN(r.getTime()) ? null : r;
|
|
23
|
+
}
|
|
24
|
+
function u(e, t) {
|
|
25
|
+
return e.toLocaleString("en-US", {
|
|
26
|
+
minimumFractionDigits: t,
|
|
27
|
+
maximumFractionDigits: t
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function D(e, t) {
|
|
31
|
+
const r = (i) => String(i).padStart(2, "0");
|
|
32
|
+
return t.replace(/YYYY/g, String(e.getFullYear())).replace(/MM/g, r(e.getMonth() + 1)).replace(/DD/g, r(e.getDate())).replace(/hh/g, r(e.getHours())).replace(/mm/g, r(e.getMinutes())).replace(/ss/g, r(e.getSeconds()));
|
|
33
|
+
}
|
|
34
|
+
function x(e, t, r) {
|
|
35
|
+
return r != null ? t ? u(e, r) : e.toFixed(r) : t ? u(e) : String(e);
|
|
36
|
+
}
|
|
37
|
+
function c(e) {
|
|
38
|
+
const t = typeof e == "number" ? e : Number(String(e).replace(/,/g, ""));
|
|
39
|
+
return Number.isFinite(t) ? t : null;
|
|
40
|
+
}
|
|
41
|
+
function b(e, t) {
|
|
42
|
+
if (e == null || e === "" || !t) return String(e ?? "");
|
|
43
|
+
switch (t.kind) {
|
|
44
|
+
case "number": {
|
|
45
|
+
if (typeof e == "string")
|
|
46
|
+
try {
|
|
47
|
+
return l(e, t.digits, t.thousands === !0);
|
|
48
|
+
} catch {
|
|
49
|
+
return e;
|
|
50
|
+
}
|
|
51
|
+
const r = c(e);
|
|
52
|
+
return r == null ? String(e) : x(r, t.thousands === !0, t.digits);
|
|
53
|
+
}
|
|
54
|
+
case "percent": {
|
|
55
|
+
if (typeof e == "string")
|
|
56
|
+
try {
|
|
57
|
+
return l(e, t.digits ?? 2, !0, !0);
|
|
58
|
+
} catch {
|
|
59
|
+
return e;
|
|
60
|
+
}
|
|
61
|
+
const r = c(e);
|
|
62
|
+
return r == null ? String(e) : `${u(r * 100, t.digits ?? 2)}%`;
|
|
63
|
+
}
|
|
64
|
+
case "date": {
|
|
65
|
+
const r = t.pattern ?? "YYYY-MM-DD", i = e instanceof Date ? e : $(String(e));
|
|
66
|
+
return i ? D(i, r) : String(e);
|
|
67
|
+
}
|
|
68
|
+
default:
|
|
69
|
+
return String(e);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function h(e, t) {
|
|
73
|
+
return w(t)(e);
|
|
74
|
+
}
|
|
75
|
+
function T(e, t, r, i = e.paddingMm ?? 1) {
|
|
76
|
+
return t.field !== e.tree.labelField ? 0 : Math.min(r.depth * (e.tree.indentMm ?? 3), Math.max(0, t.widthMm - i * 2 - 4));
|
|
77
|
+
}
|
|
78
|
+
function E(e, t, r, i) {
|
|
79
|
+
const n = i.tree;
|
|
80
|
+
(n.input === "nested" || [n.idField, n.parentField].includes(t.field)) && (e.editable = !1), r.hasChildren && n.parentValues === "leaf-aggregate" && n.aggregates?.some((a) => a.field === t.field) && (e.derived = !0, e.editable = !1);
|
|
81
|
+
}
|
|
82
|
+
function F(e, t, r) {
|
|
83
|
+
return r === "identifier" || r === "dimension" || r === "date" ? "center" : r === "measure" ? "right" : r === "text" ? "left" : t?.kind === "number" || t?.kind === "percent" ? "right" : t?.kind === "date" || e instanceof Date || typeof e == "boolean" ? "center" : typeof e == "number" && Number.isFinite(e) ? "right" : "left";
|
|
84
|
+
}
|
|
85
|
+
function L(e) {
|
|
86
|
+
if (e == null) return "";
|
|
87
|
+
if (typeof e == "string" || typeof e == "number") return String(e);
|
|
88
|
+
if (typeof e == "boolean") return e ? "是" : "否";
|
|
89
|
+
if (e instanceof Date) return e.toISOString().slice(0, 10);
|
|
90
|
+
try {
|
|
91
|
+
return JSON.stringify(e);
|
|
92
|
+
} catch {
|
|
93
|
+
return String(e);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function z(e, t) {
|
|
97
|
+
let r = f({ fontSize: e.fontSizePt ?? m, bold: e.headerBold ?? !0, align: "center", verticalAlign: "middle", backgroundColor: e.headerBackgroundColor }, t.style);
|
|
98
|
+
return e.headerAlign !== void 0 && (r.align = e.headerAlign), r = f(r, e.headerStyle), t.headerAlign !== void 0 && (r.align = t.headerAlign), f(r, t.headerStyle);
|
|
99
|
+
}
|
|
100
|
+
function P(e, t, r) {
|
|
101
|
+
(r === null || typeof r == "string" || typeof r == "boolean" || typeof r == "number" && Number.isFinite(r)) && (e.value = r);
|
|
102
|
+
const i = t.format?.kind === "number" || t.format?.kind === "percent";
|
|
103
|
+
t.valueType !== void 0 ? e.valueType = t.valueType : i && (e.valueType = "number"), t.editable !== void 0 && (e.editable = t.editable);
|
|
104
|
+
const n = N(t.format);
|
|
105
|
+
(typeof e.value == "number" || e.value == null) && n !== void 0 && (e.numberFormat = n);
|
|
106
|
+
}
|
|
107
|
+
function A(e, t, r) {
|
|
108
|
+
const i = !!t.visibleWhen && !h(r, t.visibleWhen), n = i ? null : r[t.field], a = t.align ?? t.style?.align ?? e.align ?? "left";
|
|
109
|
+
let s = f({ fontSize: e.fontSizePt ?? m, verticalAlign: "middle" }, t.style);
|
|
110
|
+
s.align = a === "auto" ? F(n, t.format, t.semanticRole) : a;
|
|
111
|
+
const o = t.rules?.find((g) => h(r, g.when));
|
|
112
|
+
o && (s = f(s, o.style));
|
|
113
|
+
const d = { text: t.format ? b(n, t.format) : L(n), style: s };
|
|
114
|
+
return P(d, t, n), e.computed?.some((g) => g.field === t.field) && (d.derived = !0, d.editable = !1), i && (d.editable = !1), d;
|
|
115
|
+
}
|
|
116
|
+
function V(e, t, r) {
|
|
117
|
+
const i = A(e, t, r.row), n = T(e, t, r);
|
|
118
|
+
return t.field === e.tree.labelField && (i.style = { ...i.style, align: "left" }), n && (i.indentMm = n), E(i, t, r, e), i;
|
|
119
|
+
}
|
|
120
|
+
class _ extends Error {
|
|
121
|
+
constructor(t, r) {
|
|
122
|
+
super(`报表页数超出上限 ${t}(至少 ${r} 页)`), this.limit = t, this.actual = r, this.code = "page-limit", this.name = "PaginatePageLimitError";
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
class U extends Error {
|
|
126
|
+
constructor(t, r) {
|
|
127
|
+
super(`报表单元格数量超出上限 ${t}(至少 ${r} 格)`), this.limit = t, this.actual = r, this.code = "cell-limit", this.name = "PaginateCellLimitError";
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
class k extends Error {
|
|
131
|
+
constructor(t, r) {
|
|
132
|
+
super(`报表图表图元数量预计超出上限 ${t}(本次估算 ${r})`), this.limit = t, this.estimated = r, this.code = "chart-component-limit", this.name = "PaginateChartComponentLimitError";
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const y = 5e4;
|
|
136
|
+
function R(e = y) {
|
|
137
|
+
if (!Number.isSafeInteger(e) || e < 1 || e > 1e6) throw new RangeError("maxChartComponents 应为 1..1000000 的安全整数");
|
|
138
|
+
}
|
|
139
|
+
function I(e, t, r) {
|
|
140
|
+
const i = e.chartBinding;
|
|
141
|
+
if (e.kind !== "chart" || e.grid || e.imageData || e.binding || e.pageAnchor) throw new TypeError("绑定图表不能同时设置图片、网格、记录绑定或页眉页脚");
|
|
142
|
+
const n = Object.prototype.hasOwnProperty.call(t, i.dataset) ? t[i.dataset] : void 0;
|
|
143
|
+
if (!Array.isArray(n)) throw new TypeError(`图表数据集 ${i.dataset} 未提供`);
|
|
144
|
+
return { ...C(n, i, r), type: i.type, leftMm: e.leftMm, topMm: e.topMm, widthMm: e.widthMm, heightMm: e.heightMm, title: i.title, showValues: i.showValues };
|
|
145
|
+
}
|
|
146
|
+
function v(e, t, r = y) {
|
|
147
|
+
R(r);
|
|
148
|
+
let i = 0;
|
|
149
|
+
return Object.assign((a) => {
|
|
150
|
+
if (!a.chartBinding) return [a];
|
|
151
|
+
const s = I(a, e, t), o = i + (s.categories.length ? S(s) : 1);
|
|
152
|
+
if (!Number.isSafeInteger(o)) throw new RangeError("图表图元估算应为有限安全整数");
|
|
153
|
+
if (o > r) throw new k(r, o);
|
|
154
|
+
const d = s.categories.length ? M(s) : [{ kind: "text", leftMm: a.leftMm, topMm: a.topMm, widthMm: a.widthMm, heightMm: a.heightMm, text: "—", style: { align: "center", verticalAlign: "middle", color: "#94a3b8", fontSize: 10 } }];
|
|
155
|
+
return i += d.length, d;
|
|
156
|
+
}, { used: () => i });
|
|
157
|
+
}
|
|
158
|
+
function H(e) {
|
|
159
|
+
return typeof e == "string" && /^data:image\/(png|jpe?g);base64,[A-Za-z0-9+/\r\n]+=*$/.test(e);
|
|
160
|
+
}
|
|
161
|
+
class p extends Error {
|
|
162
|
+
constructor(t, r, i, n) {
|
|
163
|
+
super(`${t}: ${r}`), this.path = t, this.rowIndex = i, this.field = n, this.code = "report-binding", this.name = "ReportBindingError";
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function O(e, t, r = {}) {
|
|
167
|
+
const i = r.rowIndex ?? 0, a = `$.datasets.${r.dataset ?? "label"}[${i}].${t}`, s = Object.getOwnPropertyDescriptor(e, t);
|
|
168
|
+
if (!s || s.get || s.set) throw new p(a, "字段必须是记录的自有数据字段,不能缺失、使用访问器或从原型继承", i, t);
|
|
169
|
+
const o = s.value;
|
|
170
|
+
if (o == null || typeof o == "string" || typeof o == "boolean" || typeof o == "number" && Number.isFinite(o)) return o;
|
|
171
|
+
throw new p(a, "绑定值应为字符串、有限数字、布尔值或空值", i, t);
|
|
172
|
+
}
|
|
173
|
+
function W(e, t, r = {}) {
|
|
174
|
+
const i = O(t, e.field, r);
|
|
175
|
+
return i == null || i === "" ? e.emptyText ?? "" : `${e.prefix ?? ""}${b(i, e.format)}${e.suffix ?? ""}`;
|
|
176
|
+
}
|
|
177
|
+
export {
|
|
178
|
+
y as D,
|
|
179
|
+
U as P,
|
|
180
|
+
p as R,
|
|
181
|
+
V as a,
|
|
182
|
+
W as b,
|
|
183
|
+
v as c,
|
|
184
|
+
z as d,
|
|
185
|
+
k as e,
|
|
186
|
+
_ as f,
|
|
187
|
+
h as g,
|
|
188
|
+
b as h,
|
|
189
|
+
H as i,
|
|
190
|
+
c as j,
|
|
191
|
+
O as k,
|
|
192
|
+
L as l,
|
|
193
|
+
F as m,
|
|
194
|
+
T as n,
|
|
195
|
+
E as o,
|
|
196
|
+
$ as p,
|
|
197
|
+
A as r,
|
|
198
|
+
N as t,
|
|
199
|
+
R as v
|
|
200
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("./progress-WomPRP3B.cjs"),y=require("./charts-Cjw5AYkg.cjs"),g=require("./computed-DK6BruFz.cjs");function S(e){if(!e||e.kind==="date")return;const t=e.digits;if(!(t!==void 0&&(!Number.isInteger(t)||t<0||t>100))){if(e.kind==="percent"){const r=t??2;return`0${r?`.${"0".repeat(r)}`:""}%`}return t===void 0?e.thousands?"#,##0.###############":void 0:`${e.thousands?"#,##0":"0"}${t?`.${"0".repeat(t)}`:""}`}}function C(e){const t=/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})$/.exec(e.trim());if(t){const i=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(i.getTime())?null:i}const r=new Date(e);return Number.isNaN(r.getTime())?null:r}function u(e,t){return e.toLocaleString("en-US",{minimumFractionDigits:t,maximumFractionDigits:t})}function x(e,t){const r=i=>String(i).padStart(2,"0");return t.replace(/YYYY/g,String(e.getFullYear())).replace(/MM/g,r(e.getMonth()+1)).replace(/DD/g,r(e.getDate())).replace(/hh/g,r(e.getHours())).replace(/mm/g,r(e.getMinutes())).replace(/ss/g,r(e.getSeconds()))}function F(e,t,r){return r!=null?t?u(e,r):e.toFixed(r):t?u(e):String(e)}function c(e){const t=typeof e=="number"?e:Number(String(e).replace(/,/g,""));return Number.isFinite(t)?t:null}function m(e,t){if(e==null||e===""||!t)return String(e??"");switch(t.kind){case"number":{if(typeof e=="string")try{return g.formatDecimal(e,t.digits,t.thousands===!0)}catch{return e}const r=c(e);return r==null?String(e):F(r,t.thousands===!0,t.digits)}case"percent":{if(typeof e=="string")try{return g.formatDecimal(e,t.digits??2,!0,!0)}catch{return e}const r=c(e);return r==null?String(e):`${u(r*100,t.digits??2)}%`}case"date":{const r=t.pattern??"YYYY-MM-DD",i=e instanceof Date?e:C(String(e));return i?x(i,r):String(e)}default:return String(e)}}function h(e,t){return g.compileReportPredicate(t)(e)}function M(e,t,r,i=e.paddingMm??1){return t.field!==e.tree.labelField?0:Math.min(r.depth*(e.tree.indentMm??3),Math.max(0,t.widthMm-i*2-4))}function L(e,t,r,i){const n=i.tree;(n.input==="nested"||[n.idField,n.parentField].includes(t.field))&&(e.editable=!1),r.hasChildren&&n.parentValues==="leaf-aggregate"&&n.aggregates?.some(a=>a.field===t.field)&&(e.derived=!0,e.editable=!1)}function T(e,t,r){return r==="identifier"||r==="dimension"||r==="date"?"center":r==="measure"?"right":r==="text"?"left":t?.kind==="number"||t?.kind==="percent"?"right":t?.kind==="date"||e instanceof Date||typeof e=="boolean"?"center":typeof e=="number"&&Number.isFinite(e)?"right":"left"}function w(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number")return String(e);if(typeof e=="boolean")return e?"是":"否";if(e instanceof Date)return e.toISOString().slice(0,10);try{return JSON.stringify(e)}catch{return String(e)}}function P(e,t){let r=l.mergeComponentStyles({fontSize:e.fontSizePt??l.DEFAULT_FONT_PT,bold:e.headerBold??!0,align:"center",verticalAlign:"middle",backgroundColor:e.headerBackgroundColor},t.style);return e.headerAlign!==void 0&&(r.align=e.headerAlign),r=l.mergeComponentStyles(r,e.headerStyle),t.headerAlign!==void 0&&(r.align=t.headerAlign),l.mergeComponentStyles(r,t.headerStyle)}function A(e,t,r){(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"&&Number.isFinite(r))&&(e.value=r);const i=t.format?.kind==="number"||t.format?.kind==="percent";t.valueType!==void 0?e.valueType=t.valueType:i&&(e.valueType="number"),t.editable!==void 0&&(e.editable=t.editable);const n=S(t.format);(typeof e.value=="number"||e.value==null)&&n!==void 0&&(e.numberFormat=n)}function N(e,t,r){const i=!!t.visibleWhen&&!h(r,t.visibleWhen),n=i?null:r[t.field],a=t.align??t.style?.align??e.align??"left";let s=l.mergeComponentStyles({fontSize:e.fontSizePt??l.DEFAULT_FONT_PT,verticalAlign:"middle"},t.style);s.align=a==="auto"?T(n,t.format,t.semanticRole):a;const o=t.rules?.find(f=>h(r,f.when));o&&(s=l.mergeComponentStyles(s,o.style));const d={text:t.format?m(n,t.format):w(n),style:s};return A(d,t,n),e.computed?.some(f=>f.field===t.field)&&(d.derived=!0,d.editable=!1),i&&(d.editable=!1),d}function R(e,t,r){const i=N(e,t,r.row),n=M(e,t,r);return t.field===e.tree.labelField&&(i.style={...i.style,align:"left"}),n&&(i.indentMm=n),L(i,t,r,e),i}class I extends Error{constructor(t,r){super(`报表页数超出上限 ${t}(至少 ${r} 页)`),this.limit=t,this.actual=r,this.code="page-limit",this.name="PaginatePageLimitError"}}class O extends Error{constructor(t,r){super(`报表单元格数量超出上限 ${t}(至少 ${r} 格)`),this.limit=t,this.actual=r,this.code="cell-limit",this.name="PaginateCellLimitError"}}class E extends Error{constructor(t,r){super(`报表图表图元数量预计超出上限 ${t}(本次估算 ${r})`),this.limit=t,this.estimated=r,this.code="chart-component-limit",this.name="PaginateChartComponentLimitError"}}const b=5e4;function D(e=b){if(!Number.isSafeInteger(e)||e<1||e>1e6)throw new RangeError("maxChartComponents 应为 1..1000000 的安全整数")}function k(e,t,r){const i=e.chartBinding;if(e.kind!=="chart"||e.grid||e.imageData||e.binding||e.pageAnchor)throw new TypeError("绑定图表不能同时设置图片、网格、记录绑定或页眉页脚");const n=Object.prototype.hasOwnProperty.call(t,i.dataset)?t[i.dataset]:void 0;if(!Array.isArray(n))throw new TypeError(`图表数据集 ${i.dataset} 未提供`);return{...g.createReportChartData(n,i,r),type:i.type,leftMm:e.leftMm,topMm:e.topMm,widthMm:e.widthMm,heightMm:e.heightMm,title:i.title,showValues:i.showValues}}function v(e,t,r=b){D(r);let i=0;return Object.assign(a=>{if(!a.chartBinding)return[a];const s=k(a,e,t),o=i+(s.categories.length?y.chartComponentUpperBound(s):1);if(!Number.isSafeInteger(o))throw new RangeError("图表图元估算应为有限安全整数");if(o>r)throw new E(r,o);const d=s.categories.length?y.createChartComponents(s):[{kind:"text",leftMm:a.leftMm,topMm:a.topMm,widthMm:a.widthMm,heightMm:a.heightMm,text:"—",style:{align:"center",verticalAlign:"middle",color:"#94a3b8",fontSize:10}}];return i+=d.length,d},{used:()=>i})}function B(e){return typeof e=="string"&&/^data:image\/(png|jpe?g);base64,[A-Za-z0-9+/\r\n]+=*$/.test(e)}class p extends Error{constructor(t,r,i,n){super(`${t}: ${r}`),this.path=t,this.rowIndex=i,this.field=n,this.code="report-binding",this.name="ReportBindingError"}}function $(e,t,r={}){const i=r.rowIndex??0,a=`$.datasets.${r.dataset??"label"}[${i}].${t}`,s=Object.getOwnPropertyDescriptor(e,t);if(!s||s.get||s.set)throw new p(a,"字段必须是记录的自有数据字段,不能缺失、使用访问器或从原型继承",i,t);const o=s.value;if(o==null||typeof o=="string"||typeof o=="boolean"||typeof o=="number"&&Number.isFinite(o))return o;throw new p(a,"绑定值应为字符串、有限数字、布尔值或空值",i,t)}function _(e,t,r={}){const i=$(t,e.field,r);return i==null||i===""?e.emptyText??"":`${e.prefix??""}${m(i,e.format)}${e.suffix??""}`}exports.DEFAULT_CHART_COMPONENT_LIMIT=b;exports.PaginateCellLimitError=O;exports.PaginateChartComponentLimitError=E;exports.PaginatePageLimitError=I;exports.ReportBindingError=p;exports.applyListTreeMetadata=L;exports.createChartResolver=v;exports.evalStyleRule=h;exports.formatValue=m;exports.isLabelImageData=B;exports.listCellText=w;exports.listTreeIndent=M;exports.parseDateLocal=C;exports.readRecordScalar=$;exports.resolveComponentBinding=_;exports.resolveListAutoAlignment=T;exports.resolveListHeaderStyle=P;exports.resolveListSampleCell=N;exports.resolveTreeListSampleCell=R;exports.toExcelNumberFormat=S;exports.toNumber=c;exports.validateChartComponentLimit=D;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { v as F } from "./dataset-DL83majE.js";
|
|
2
|
-
import { v as D, e as z, p as Z } from "./template-registry-
|
|
3
|
-
import { r as N } from "./
|
|
2
|
+
import { v as D, e as z, p as Z } from "./template-registry-O0hNIOfB.js";
|
|
3
|
+
import { r as N } from "./progress-ByiOxUD3.js";
|
|
4
4
|
function v(t) {
|
|
5
5
|
let e = "";
|
|
6
6
|
for (let o = t; o > 0; o = Math.floor((o - 1) / 26)) e = String.fromCharCode(65 + (o - 1) % 26) + e;
|