@agile-team/mach-report 2.16.0 → 2.18.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 +25 -12
- package/dist/{ExcelBindingWizard-CP6h2x1f.cjs → ExcelBindingWizard-Czn3C2yE.cjs} +1 -1
- package/dist/{ExcelBindingWizard-HhB3hAJE.js → ExcelBindingWizard-DMGZj6I6.js} +3 -3
- package/dist/ParamEditor-KzDQvbHY.js +732 -0
- package/dist/ParamEditor-oDfD8LgE.cjs +1 -0
- package/dist/{ReportBatchPanel-ruxcbfY6.js → ReportBatchPanel-BJK7PvZ4.js} +39 -39
- package/dist/ReportBatchPanel-DnmNRssu.cjs +1 -0
- package/dist/ReportParamPanel-mQkeN70Q.js +1020 -0
- package/dist/ReportParamPanel-sOANVRz-.cjs +1 -0
- package/dist/ReportPreview-BxWWTUL5.js +5583 -0
- package/dist/ReportPreview-Yf99omi3.cjs +6 -0
- package/dist/{ReportTemplateLibrary-DcwrH-63.js → ReportTemplateLibrary-BFjB08Wu.js} +1 -1
- package/dist/{ReportTemplateLibrary-BDlNT8JN.cjs → ReportTemplateLibrary-BO42QnWd.cjs} +1 -1
- package/dist/RuleEditor-CqxT1a-W.js +2337 -0
- package/dist/RuleEditor-D7YWigD9.cjs +1 -0
- package/dist/{TemplateOutlinePanel-CGrT5DFN.cjs → TemplateOutlinePanel-B0XX350V.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-SXCjaPKR.js → TemplateOutlinePanel-zG0DrsIB.js} +2 -2
- package/dist/{TemplateReusePanel-6Z3wRFz8.cjs → TemplateReusePanel-BD0HSKp_.cjs} +1 -1
- package/dist/{TemplateReusePanel-lHLOS9Wn.js → TemplateReusePanel-Czwe5GbC.js} +2 -2
- package/dist/{TemplateReviewPanel-Dpk7sLcF.cjs → TemplateReviewPanel-CA5sdffM.cjs} +1 -1
- package/dist/{TemplateReviewPanel-CJ9PLc48.js → TemplateReviewPanel-NhmQI65C.js} +2 -2
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.d.cts +163 -42
- package/dist/analytics.d.ts +163 -42
- package/dist/analytics.js +76 -141
- package/dist/artifact-integrity.json +110 -108
- package/dist/assets-2eC3mOcV.js +232 -0
- package/dist/assets-B0Hxn4l6.cjs +1 -0
- package/dist/{auto-uVBjX1j5.cjs → auto-B0EZFIK1.cjs} +1 -1
- package/dist/{auto-YR7a4BtF.js → auto-BlchZ1b8.js} +10 -10
- package/dist/{batch-WzDIXJAt.js → batch-DGCt44XM.js} +1 -1
- package/dist/{batch-z6Aw5GEY.cjs → batch-DYcokH4v.cjs} +1 -1
- package/dist/charts-Dlv8j2AG.js +141 -0
- package/dist/charts-aCtoswXq.cjs +1 -0
- package/dist/codes.cjs +9 -9
- package/dist/codes.d.cts +54 -0
- package/dist/codes.d.ts +54 -0
- package/dist/codes.js +12097 -13668
- package/dist/column-visual-BpgQVWwT.js +238 -0
- package/dist/column-visual-CtYxnBCP.cjs +1 -0
- package/dist/component-tree-6TV7W6Yj.cjs +1 -0
- package/dist/component-tree-CvW4lzpv.js +67 -0
- package/dist/computed-4TnxzgIh.cjs +1 -0
- package/dist/computed-C8NRZQss.js +739 -0
- package/dist/data-bar-Ce38juRZ.cjs +1 -0
- package/dist/data-bar-PtjXhMgN.js +9 -0
- package/dist/dataset-DL83majE.js +161 -0
- package/dist/dataset-IrlXbUvh.cjs +1 -0
- package/dist/designer--TKECSEc.cjs +2 -0
- package/dist/designer-d6hJS41w.js +5683 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +835 -45
- package/dist/designer.d.ts +835 -45
- package/dist/designer.js +23 -20
- package/dist/{encoding-BYF9ZTl9.cjs → encoding-B--eZpp1.cjs} +1 -1
- package/dist/{encoding-BOGq4qYL.js → encoding-mctOLocI.js} +2 -2
- package/dist/{font-loader-EKLzOJxf.cjs → font-loader-DBBJ5KE9.cjs} +1 -1
- package/dist/{font-loader-CzI1GuBc.js → font-loader-DW8tIaNp.js} +1 -1
- package/dist/index-CPh6tqge.js +1575 -0
- package/dist/index-CUNw7dL9.cjs +1 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +534 -16
- package/dist/index.d.ts +534 -16
- package/dist/index.js +1393 -955
- package/dist/json-snapshot-By4ZVVUt.js +1967 -0
- package/dist/json-snapshot-jiXff4lc.cjs +2 -0
- package/dist/matrix-0hywp0-F.cjs +1 -0
- package/dist/matrix-Dy-tyY7E.js +381 -0
- package/dist/param-validation-C-8sRJLq.cjs +1 -0
- package/dist/param-validation-CnDEd2l-.js +333 -0
- package/dist/{pdf-DJ5S6ukC.js → pdf-CKROKygt.js} +1845 -1845
- package/dist/{pdf-ByVCb1i6.cjs → pdf-DqyxJ96U.cjs} +47 -47
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.d.cts +66 -0
- package/dist/pdf.d.ts +66 -0
- package/dist/pdf.js +2 -2
- package/dist/{plugin-C2j5_mhx.js → plugin-ByjF2kiV.js} +5 -5
- package/dist/{plugin-Dr39GBRG.cjs → plugin-DM1M2wlI.cjs} +1 -1
- package/dist/prefill-B8H9qwE4.js +371 -0
- package/dist/prefill-D7EswyTI.cjs +1 -0
- package/dist/{prepared-DqtpvRTn.js → prepared-BE-4jfX5.js} +2 -2
- package/dist/{prepared-DdrjLC7L.cjs → prepared-CGVphji3.cjs} +1 -1
- package/dist/{protocol-BzwMP4Vw.cjs → protocol-ByRVzzQG.cjs} +1 -1
- package/dist/{protocol-kt4Iy6-3.js → protocol-Cr81vFSQ.js} +3 -3
- package/dist/{record-bindings-CZWBJ1fU.js → record-bindings-DEJtmo3p.js} +67 -107
- package/dist/record-bindings-ehjnCDHt.cjs +1 -0
- package/dist/{region-binding-workflow-CWNvIjkV.js → region-binding-workflow-CBg0l_tj.js} +2 -2
- package/dist/{region-binding-workflow-CqSMxQ4p.cjs → region-binding-workflow-D05tOYn3.cjs} +1 -1
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/{report-params-B1RzkhJj.js → report-params-D9tBuM9B.js} +1 -1
- package/dist/{report-params-WDGrA4oP.cjs → report-params-VTg8MoCp.cjs} +1 -1
- package/dist/runtime-CDA6d263.cjs +1 -0
- package/dist/runtime-CEMvybO7.js +170 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server/node.d.cts +121 -7
- package/dist/server/node.d.ts +121 -7
- package/dist/server-node.cjs +4 -4
- package/dist/server-node.js +3446 -2115
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +417 -29
- package/dist/server.d.ts +417 -29
- package/dist/server.js +787 -544
- package/dist/sha256-BDQ1Qk7A.js +158 -0
- package/dist/sha256-DgZAKXqI.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/template-bindings-Cg5oBLFT.cjs +1 -0
- package/dist/template-bindings-TKnXM7ll.js +62 -0
- package/dist/{template-catalog-BtR2JmCL.js → template-catalog-CmbWOJqy.js} +16 -16
- package/dist/template-catalog-Utu4GP09.cjs +1 -0
- package/dist/{template-fragments-BVsbxs4a.cjs → template-fragments-C_zSHJAa.cjs} +1 -1
- package/dist/{template-fragments-By0aZC1D.js → template-fragments-DWgo9tlZ.js} +2 -2
- package/dist/{template-outline-BwRV_eRo.cjs → template-outline-DWkzZXVC.cjs} +1 -1
- package/dist/{template-outline-cnWfT_LK.js → template-outline-DiADphlq.js} +1 -1
- package/dist/{template-registry-Cw3vRTX2.js → template-registry-BIhIHOab.js} +319 -314
- package/dist/template-registry-DzWswQI5.cjs +1 -0
- package/dist/vue/async.d.cts +636 -35
- package/dist/vue/async.d.ts +636 -35
- package/dist/vue/index.d.cts +746 -67
- package/dist/vue/index.d.ts +746 -67
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +94 -89
- package/dist/{workbook-session-Cbts-22R.cjs → workbook-session-B94EwVa_.cjs} +1 -1
- package/dist/{workbook-session-BeSO8PFB.js → workbook-session-BoScoOg-.js} +2 -2
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +75 -7
- package/dist/worker.d.ts +75 -7
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.d.cts +208 -15
- package/dist/xlsx.d.ts +208 -15
- package/dist/xlsx.js +288 -252
- package/package.json +1 -1
- package/dist/ParamEditor-CUQLgoxa.cjs +0 -1
- package/dist/ParamEditor-OKesP_nO.js +0 -594
- package/dist/ReportBatchPanel-cZCAMAwH.cjs +0 -1
- package/dist/ReportPreview-BcDKCLiK.js +0 -4834
- package/dist/ReportPreview-Bk9nLfO9.cjs +0 -6
- package/dist/RuleEditor-BX5S8RSF.cjs +0 -1
- package/dist/RuleEditor-CGl9XY2s.js +0 -2037
- package/dist/assets-CqIbfbTr.js +0 -126
- package/dist/assets-e4YSke8n.cjs +0 -1
- package/dist/capabilities-DDwXr_cA.js +0 -103
- package/dist/capabilities-DNLyZdNw.cjs +0 -1
- package/dist/component-tree-Ca6YYfHq.js +0 -61
- package/dist/component-tree-DkGLEfZC.cjs +0 -1
- package/dist/computed-C-4C2S5h.js +0 -521
- package/dist/computed-CGV2a809.cjs +0 -1
- package/dist/config-Dg_o8e7m.cjs +0 -1
- package/dist/config-XQ4qrQ7Q.js +0 -844
- package/dist/dataset-BkRmwgeJ.cjs +0 -1
- package/dist/dataset-H5pFuQGU.js +0 -121
- package/dist/designer-BfQSahxq.js +0 -5163
- package/dist/designer-CPPdeM5_.cjs +0 -2
- package/dist/diagnostic-notification-B9K9We3h.cjs +0 -1
- package/dist/diagnostic-notification-qGAYZdkB.js +0 -7
- package/dist/drill-CsdjgkRM.cjs +0 -1
- package/dist/drill-DIGsZfyB.js +0 -145
- package/dist/json-snapshot-D6ioHth9.js +0 -1702
- package/dist/json-snapshot-DknkjvxP.cjs +0 -2
- package/dist/matrix-CGRGkn5s.js +0 -112
- package/dist/matrix-gEO7ZM_u.cjs +0 -1
- package/dist/param-validation-C3HlcLLO.cjs +0 -1
- package/dist/param-validation-Do7Eg8Zv.js +0 -181
- package/dist/record-bindings-DUX1VMlR.cjs +0 -1
- package/dist/runtime-BjKBI530.js +0 -168
- package/dist/runtime-CBFEPKEs.cjs +0 -1
- package/dist/sha256-BshdOkCC.cjs +0 -1
- package/dist/sha256-DTG-Gq8i.js +0 -157
- package/dist/template-bindings-C2SpvsMU.js +0 -58
- package/dist/template-bindings-CEtWyiLX.cjs +0 -1
- package/dist/template-catalog-C2NLdrwB.cjs +0 -1
- package/dist/template-registry-C62vpv4a.cjs +0 -1
- package/dist/tree-BX380Rr7.cjs +0 -1
- package/dist/tree-CjVZLRw7.js +0 -172
package/dist/index.js
CHANGED
|
@@ -1,32 +1,140 @@
|
|
|
1
|
-
import { D as
|
|
2
|
-
import { C as
|
|
3
|
-
import { R as
|
|
4
|
-
import { i as
|
|
5
|
-
import { R as
|
|
6
|
-
import { v as
|
|
7
|
-
import {
|
|
8
|
-
import { v as
|
|
9
|
-
import { d as
|
|
10
|
-
import { h as
|
|
11
|
-
import { c as
|
|
12
|
-
import { R as
|
|
13
|
-
import { D as
|
|
14
|
-
import { r as
|
|
15
|
-
import {
|
|
16
|
-
import { r as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { c as
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { c as
|
|
26
|
-
import { c as
|
|
27
|
-
import { a as
|
|
28
|
-
import { T as
|
|
29
|
-
|
|
1
|
+
import { D as le, a as J, r as _, b as q, c as Ge, d as Y, e as Je, m as ue, f as Ke, g as ye, p as V, P as ie } from "./style-67OqfNed.js";
|
|
2
|
+
import { C as _r, h as Wr, i as Ur, j as Vr, L as qr, M as Gr, S as Jr, k as Kr, l as Yr } from "./style-67OqfNed.js";
|
|
3
|
+
import { R as Zr, e as Qr, f as eo, p as to, b as no, t as ro, d as oo } from "./record-bindings-DEJtmo3p.js";
|
|
4
|
+
import { i as ce, a as Ye } from "./component-tree-CvW4lzpv.js";
|
|
5
|
+
import { R as ao } from "./component-tree-CvW4lzpv.js";
|
|
6
|
+
import { v as Xe, R as Ze, a as pe, p as re, b as Et } from "./template-registry-BIhIHOab.js";
|
|
7
|
+
import { c as lo, d as co, e as mo, s as ho, f as fo, g as go, h as uo } from "./template-registry-BIhIHOab.js";
|
|
8
|
+
import { v as Ct } from "./dataset-DL83majE.js";
|
|
9
|
+
import { d as wo } from "./dataset-DL83majE.js";
|
|
10
|
+
import { h as Me, w as Qe } from "./textwrap-BEIg2w8y.js";
|
|
11
|
+
import { c as yo, a as Mo, b as vo, m as xo } from "./textwrap-BEIg2w8y.js";
|
|
12
|
+
import { R as ve, d as Tt, s as et, a as Rt, p as Pt } from "./json-snapshot-By4ZVVUt.js";
|
|
13
|
+
import { D as Eo, P as Co, b as To, c as Ro, e as Po, f as $o, g as ko, h as Ao, i as Io, j as Oo, k as No, l as Do, m as Lo, n as Fo, o as jo, q as zo, r as Ho, t as Bo, u as _o, v as Wo, w as Uo, x as Vo, y as qo, z as Go, A as Jo, B as Ko, C as Yo, E as Xo, F as Zo, G as Qo, H as ei, I as ti } from "./json-snapshot-By4ZVVUt.js";
|
|
14
|
+
import { r as xe } from "./grid-geometry-BNptEcMm.js";
|
|
15
|
+
import { d as tt } from "./data-bar-PtjXhMgN.js";
|
|
16
|
+
import { r as Se, d as $t } from "./rich-text-layout-Ct5WrY1g.js";
|
|
17
|
+
import { r as Z, n as nt, O as kt, a as Ee } from "./assets-2eC3mOcV.js";
|
|
18
|
+
import { b as ri, i as oi } from "./assets-2eC3mOcV.js";
|
|
19
|
+
import { o as At, w as De } from "./progress-Hc2vxoCs.js";
|
|
20
|
+
import { c as It } from "./prefill-B8H9qwE4.js";
|
|
21
|
+
import { R as ai, a as si, b as li, d as ci, e as di, m as mi, r as hi, f as fi, g as gi, v as ui } from "./prefill-B8H9qwE4.js";
|
|
22
|
+
import { R as wi, a as bi, f as yi, b as Mi, c as vi, d as xi, i as Si, e as Ei, g as Ci, p as Ti, h as Ri, j as Pi, k as $i, r as ki, v as Ai, l as Ii } from "./param-validation-CnDEd2l-.js";
|
|
23
|
+
import { b as Ni, d as Di } from "./matrix-Dy-tyY7E.js";
|
|
24
|
+
import { k as Fi, l as ji, r as zi } from "./computed-C8NRZQss.js";
|
|
25
|
+
import { c as Bi, a as _i, d as Wi, r as Ui, b as Vi } from "./template-catalog-CmbWOJqy.js";
|
|
26
|
+
import { c as Gi, i as Ji, t as Ki } from "./template-outline-DiADphlq.js";
|
|
27
|
+
import { a as Xi, c as Zi, i as Qi, b as ea } from "./template-fragments-DWgo9tlZ.js";
|
|
28
|
+
import { T as na, c as ra, a as oa } from "./column-visual-BpgQVWwT.js";
|
|
29
|
+
function we(e, t, n) {
|
|
30
|
+
let r = 0, o = e.length;
|
|
31
|
+
for (; r < o; ) {
|
|
32
|
+
const i = r + o >>> 1;
|
|
33
|
+
n(e[i]) < t ? r = i + 1 : o = i;
|
|
34
|
+
}
|
|
35
|
+
return r;
|
|
36
|
+
}
|
|
37
|
+
function rt(e) {
|
|
38
|
+
if (![e.leftMm, e.topMm, e.widthMm, e.heightMm].every(Number.isFinite) || e.widthMm < 0 || e.heightMm < 0) throw new RangeError("Preview viewport must have finite coordinates and nonnegative dimensions.");
|
|
39
|
+
return e;
|
|
40
|
+
}
|
|
41
|
+
function Ot(e) {
|
|
42
|
+
const t = e.rows.map(() => []);
|
|
43
|
+
for (const n of e.cells) {
|
|
44
|
+
const r = Math.min(t.length, n.ri + (n.cell.rowSpan ?? 1));
|
|
45
|
+
for (let o = n.ri; o < r; o++) t[o].push(n);
|
|
46
|
+
}
|
|
47
|
+
for (const n of t) n.sort((r, o) => r.xMm - o.xMm);
|
|
48
|
+
return {
|
|
49
|
+
cells(n) {
|
|
50
|
+
rt(n);
|
|
51
|
+
const r = /* @__PURE__ */ new Set(), o = n.topMm + n.heightMm, i = n.leftMm + n.widthMm;
|
|
52
|
+
let l = we(e.rows, n.topMm, (s) => s.pos + s.size);
|
|
53
|
+
for (; l < t.length && e.rows[l].pos <= o; ) {
|
|
54
|
+
const s = t[l++];
|
|
55
|
+
let a = we(s, n.leftMm, (c) => c.xMm + c.widthMm);
|
|
56
|
+
for (; a < s.length && s[a].xMm <= i; ) r.add(s[a++]);
|
|
57
|
+
}
|
|
58
|
+
return [...r].sort((s, a) => s.ri - a.ri || s.ci - a.ci);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function Nt(e) {
|
|
63
|
+
const t = ["h", "v"].map((n) => e.filter((r) => r.kind === n).sort((r, o) => r.pos - o.pos));
|
|
64
|
+
return (n) => {
|
|
65
|
+
const r = [];
|
|
66
|
+
return t.forEach((o, i) => {
|
|
67
|
+
const l = i === 0 ? n.topMm : n.leftMm, s = l + (i === 0 ? n.heightMm : n.widthMm), a = i === 0 ? n.leftMm : n.topMm, c = a + (i === 0 ? n.widthMm : n.heightMm);
|
|
68
|
+
let d = we(o, l, (m) => m.pos);
|
|
69
|
+
for (; d < o.length && o[d].pos <= s; ) {
|
|
70
|
+
const m = o[d++];
|
|
71
|
+
m.to >= a && m.from <= c && r.push(m);
|
|
72
|
+
}
|
|
73
|
+
}), r;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function Dt() {
|
|
77
|
+
const e = [];
|
|
78
|
+
return {
|
|
79
|
+
mount(t) {
|
|
80
|
+
e.push(zt(t));
|
|
81
|
+
},
|
|
82
|
+
update(t, n, r) {
|
|
83
|
+
rt(t);
|
|
84
|
+
let o = !1;
|
|
85
|
+
for (const i of e) o = i.update(t, i.component === n ? r : void 0) || o;
|
|
86
|
+
return o;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function Lt(e, t) {
|
|
91
|
+
const n = Math.max(8, e.widthMm / 4), r = Math.max(8, e.heightMm / 4);
|
|
92
|
+
return {
|
|
93
|
+
leftMm: e.leftMm - t.leftMm - n,
|
|
94
|
+
topMm: e.topMm - t.topMm - r,
|
|
95
|
+
widthMm: e.widthMm + 2 * n,
|
|
96
|
+
heightMm: e.heightMm + 2 * r
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function Ft(e, t, n) {
|
|
100
|
+
let r = t.get(n);
|
|
101
|
+
return r || (r = e.table.ownerDocument.createElement("tr"), r.className = e.rowClass, r.setAttribute("role", "row"), r.setAttribute("aria-rowindex", String(n + 1)), r.style.cssText = "all:unset;display:contents;box-sizing:border-box", t.set(n, r)), r;
|
|
102
|
+
}
|
|
103
|
+
function jt(e, t, n, r) {
|
|
104
|
+
const o = new Set(t), i = new Set(t.map((s) => s.ri));
|
|
105
|
+
for (const [s, a] of n) o.has(s) || (a.remove(), n.delete(s));
|
|
106
|
+
for (const [s, a] of r) i.has(s) || (a.remove(), r.delete(s));
|
|
107
|
+
for (const s of t) {
|
|
108
|
+
let a = n.get(s);
|
|
109
|
+
a || (a = e.drawCell(s), a.setAttribute("aria-colindex", String(s.ci + 1)), n.set(s, a));
|
|
110
|
+
const c = Ft(e, r, s.ri);
|
|
111
|
+
a.parentElement !== c && c.appendChild(a);
|
|
112
|
+
}
|
|
113
|
+
const l = /* @__PURE__ */ new Map();
|
|
114
|
+
for (const s of t) {
|
|
115
|
+
const a = l.get(s.ri) ?? [];
|
|
116
|
+
a.push(n.get(s)), l.set(s.ri, a);
|
|
117
|
+
}
|
|
118
|
+
for (const [s, a] of l) Le(r.get(s), a);
|
|
119
|
+
Le(e.body, [...i].sort((s, a) => s - a).map((s) => r.get(s)));
|
|
120
|
+
}
|
|
121
|
+
function Le(e, t) {
|
|
122
|
+
let n = e.firstElementChild;
|
|
123
|
+
for (const r of t)
|
|
124
|
+
r === n ? n = n.nextElementSibling : e.insertBefore(r, n);
|
|
125
|
+
}
|
|
126
|
+
function zt(e) {
|
|
127
|
+
const t = xe(e.grid, e.component.widthMm, e.component.heightMm), n = new Map(t.cells.map((c) => [`${c.ri}:${c.ci}`, c])), r = Ot(t), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), l = Nt(Se(t, e.component));
|
|
128
|
+
e.table.setAttribute("aria-rowcount", String(t.rows.length)), e.table.setAttribute("aria-colcount", String(t.columns.length));
|
|
129
|
+
let s = "", a = "";
|
|
130
|
+
return { component: e.component, update(c, d) {
|
|
131
|
+
const m = Lt(c, e.component), h = r.cells(m), f = d && n.get(`${d.rowIndex}:${d.columnIndex}`);
|
|
132
|
+
f && !h.includes(f) && h.push(f), h.sort((w, N) => w.ri - N.ri || w.ci - N.ci);
|
|
133
|
+
const g = h.map((w) => `${w.ri}:${w.ci}`).join(";"), C = l(m), S = C.map((w) => `${w.kind}:${w.pos}:${w.from}:${w.to}`).join(";"), b = g !== s, M = S !== a;
|
|
134
|
+
return b && (s = g, jt(e, h, o, i)), M && (a = S, e.edgeHost.replaceChildren(...e.drawEdges(C))), b || M;
|
|
135
|
+
} };
|
|
136
|
+
}
|
|
137
|
+
const ot = /* @__PURE__ */ new WeakMap(), Ht = {
|
|
30
138
|
root: "mr-root",
|
|
31
139
|
page: "mr-page",
|
|
32
140
|
comp: "mr-comp",
|
|
@@ -43,18 +151,18 @@ const ct = {
|
|
|
43
151
|
cell: "mr-cell",
|
|
44
152
|
unknown: "mr-unknown"
|
|
45
153
|
};
|
|
46
|
-
function
|
|
47
|
-
return t?.classNames?.[e] ??
|
|
154
|
+
function P(e, t) {
|
|
155
|
+
return t?.classNames?.[e] ?? Ht[e];
|
|
48
156
|
}
|
|
49
|
-
class
|
|
157
|
+
class Bt {
|
|
50
158
|
constructor() {
|
|
51
159
|
this.props = [];
|
|
52
160
|
}
|
|
53
161
|
add(t, n) {
|
|
54
162
|
return n == null || n === !1 || n === "" ? this : (this.props.push([t, String(n)]), this);
|
|
55
163
|
}
|
|
56
|
-
mm(t, n, r,
|
|
57
|
-
return this.add(t, `${
|
|
164
|
+
mm(t, n, r, o = 2) {
|
|
165
|
+
return this.add(t, `${J(ue(n, r), o)}px`);
|
|
58
166
|
}
|
|
59
167
|
toString() {
|
|
60
168
|
let t = "";
|
|
@@ -67,557 +175,589 @@ class dt {
|
|
|
67
175
|
n && (t.style.cssText = n);
|
|
68
176
|
}
|
|
69
177
|
}
|
|
70
|
-
function
|
|
71
|
-
return new
|
|
178
|
+
function x(e, t = "unset") {
|
|
179
|
+
return new Bt().add("all", t).add("display", e).add("box-sizing", "border-box");
|
|
72
180
|
}
|
|
73
|
-
function
|
|
74
|
-
e.add("color", t.color).add("font-family", t.fontFamily).add("font-weight", t.bold != null ? t.bold ? "700" : "400" : void 0).add("font-style", t.italic != null ? t.italic ? "italic" : "normal" : void 0).add("text-decoration", t.underline != null ? t.underline ? "underline" : "none" : void 0).add("letter-spacing", t.letterSpacing != null ? `${t.letterSpacing}pt` : void 0).add("line-height", String(
|
|
75
|
-
const r =
|
|
76
|
-
e.add("font-size", `${
|
|
181
|
+
function it(e, t, n) {
|
|
182
|
+
e.add("color", t.color).add("font-family", t.fontFamily).add("font-weight", t.bold != null ? t.bold ? "700" : "400" : void 0).add("font-style", t.italic != null ? t.italic ? "italic" : "normal" : void 0).add("text-decoration", t.underline != null ? t.underline ? "underline" : "none" : void 0).add("letter-spacing", t.letterSpacing != null ? `${t.letterSpacing}pt` : void 0).add("line-height", String(q(t))).add("text-align", t.align);
|
|
183
|
+
const r = _(t, n);
|
|
184
|
+
e.add("font-size", `${J(r.fontSizePx, 2)}px`);
|
|
77
185
|
}
|
|
78
|
-
function
|
|
186
|
+
function _t(e, t, n) {
|
|
79
187
|
const r = t.style ?? {};
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
function
|
|
83
|
-
const l = e.cell,
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
const d =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
188
|
+
it(e, r, n), e.add("background-color", r.backgroundColor).add("opacity", r.opacity != null ? String(r.opacity) : void 0).add("transform", r.rotateDeg ? `rotate(${r.rotateDeg}deg)` : void 0);
|
|
189
|
+
}
|
|
190
|
+
function Fe(e, t, n, r, o, i) {
|
|
191
|
+
const l = e.cell, s = i.createElement("td");
|
|
192
|
+
s.className = P("cell", o), s.dataset.mrRowIndex = String(e.ri), s.dataset.mrColumnIndex = String(e.ci), s.setAttribute("role", t.table?.role === "header" ? "columnheader" : "cell"), l.colSpan && (s.colSpan = l.colSpan), l.rowSpan && (s.rowSpan = l.rowSpan);
|
|
193
|
+
const a = Ke(t.style, l.style), c = x("block").add("position", "absolute").mm("left", e.xMm, r).mm("top", e.yMm, r).mm("width", e.widthMm, r).mm("height", e.heightMm, r).add("background-color", a.backgroundColor).add("vertical-align", a.verticalAlign ?? "middle");
|
|
194
|
+
it(c, a, r), c.applyTo(s);
|
|
195
|
+
const d = tt(l.dataBar, e.widthMm, e.heightMm, n);
|
|
196
|
+
if (d) {
|
|
197
|
+
const h = i.createElement("div");
|
|
198
|
+
h.className = "mr-cell-data-bar", h.setAttribute("aria-hidden", "true"), x("block").add("position", "absolute").mm("left", d.x, r).mm("top", d.y, r).mm("width", d.width, r).mm("height", d.height, r).add("background-color", d.color).add("opacity", "0.35").add("pointer-events", "none").applyTo(h), s.appendChild(h);
|
|
199
|
+
}
|
|
200
|
+
const m = i.createElement("div");
|
|
201
|
+
m.className = "mr-cell-content", x("flex").add("position", "absolute").mm("left", n + (l.indentMm ?? 0), r).mm("right", n, r).mm("top", n, r).mm("bottom", n, r).add("flex-direction", "column").add("justify-content", a.verticalAlign === "top" ? "flex-start" : a.verticalAlign === "bottom" ? "flex-end" : "center").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(m), l.richParagraphs?.length ? m.appendChild(st({ ...t, kind: "text", richParagraphs: l.richParagraphs }, r, o, i)) : l.text != null && m.append(l.text);
|
|
202
|
+
for (const h of l.children ?? []) m.appendChild(lt(h, r, o, i));
|
|
203
|
+
return s.insertBefore(m, s.firstChild), s;
|
|
204
|
+
}
|
|
205
|
+
function Wt(e, t, n, r) {
|
|
206
|
+
return at(Se(e, t), n, r);
|
|
207
|
+
}
|
|
208
|
+
function at(e, t, n) {
|
|
209
|
+
return e.map((r) => {
|
|
210
|
+
const o = `${J(r.widthPt * t / 72, 2)}px solid ${r.color}`, i = n.createElement("div");
|
|
211
|
+
i.className = "mr-grid-edge", i.setAttribute("aria-hidden", "true");
|
|
212
|
+
const l = r.kind === "h";
|
|
213
|
+
return x("block").add("position", "absolute").add("pointer-events", "none").mm("left", l ? r.from : r.pos, t).mm("top", l ? r.pos : r.from, t).mm("width", l ? r.to - r.from : 0, t).mm("height", l ? 0 : r.to - r.from, t).add(l ? "border-top" : "border-left", o).applyTo(i), i;
|
|
98
214
|
});
|
|
99
215
|
}
|
|
100
|
-
function
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
const l =
|
|
104
|
-
|
|
105
|
-
const s =
|
|
106
|
-
|
|
107
|
-
|
|
216
|
+
function Ut(e, t, n, r, o) {
|
|
217
|
+
const i = o.createElement("table");
|
|
218
|
+
i.className = P("grid", r), i.setAttribute("role", "table"), x("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(i);
|
|
219
|
+
const l = o.createElement("tbody");
|
|
220
|
+
x("contents").applyTo(l), i.appendChild(l);
|
|
221
|
+
const s = t.style?.rotateDeg ? void 0 : ot.get(r);
|
|
222
|
+
if (s) {
|
|
223
|
+
const m = o.createElement("div");
|
|
224
|
+
x("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(m);
|
|
225
|
+
const h = o.createElement("div");
|
|
226
|
+
return x("contents").applyTo(h), h.setAttribute("aria-hidden", "true"), s.mount({
|
|
227
|
+
grid: e,
|
|
228
|
+
component: t,
|
|
229
|
+
table: i,
|
|
230
|
+
rowClass: P("row", r),
|
|
231
|
+
body: l,
|
|
232
|
+
edgeHost: h,
|
|
233
|
+
drawCell: (f) => Fe(f, t, e.paddingMm ?? 0.5, n, { ...r }, o),
|
|
234
|
+
drawEdges: (f) => at(f, n, o)
|
|
235
|
+
}), m.append(i, h), m;
|
|
236
|
+
}
|
|
237
|
+
const a = xe(e, t.widthMm, t.heightMm), c = e.cells.map(() => {
|
|
238
|
+
const m = o.createElement("tr");
|
|
239
|
+
return m.className = P("row", r), m.setAttribute("role", "row"), x("contents").applyTo(m), l.appendChild(m), m;
|
|
108
240
|
});
|
|
109
|
-
for (const
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
return
|
|
113
|
-
}
|
|
114
|
-
function
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
for (const
|
|
241
|
+
for (const m of a.cells)
|
|
242
|
+
c[m.ri].appendChild(Fe(m, t, e.paddingMm ?? 0.5, n, r, o));
|
|
243
|
+
const d = o.createElement("div");
|
|
244
|
+
return x("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(d), d.append(i, ...Wt(a, t, n, o)), d;
|
|
245
|
+
}
|
|
246
|
+
function Vt(e, t, n, r) {
|
|
247
|
+
const o = r.createElement("div");
|
|
248
|
+
o.className = P("paragraph", n), x("block").add("text-align", e.align).add("line-height", e.lineHeight != null ? String(e.lineHeight) : void 0).mm("margin-top", e.spaceBeforeMm ?? 0, t).mm("margin-bottom", e.spaceAfterMm ?? 0, t).mm("text-indent", e.indentMm ?? 0, t).applyTo(o);
|
|
249
|
+
for (const i of e.segments || []) {
|
|
118
250
|
const l = r.createElement("span");
|
|
119
|
-
l.className =
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
122
|
-
const
|
|
123
|
-
|
|
251
|
+
l.className = P("segment", n), l.textContent = i.kind === "field" ? i.field ?? "" : i.text ?? "";
|
|
252
|
+
const s = x("inline");
|
|
253
|
+
if (i.style) {
|
|
254
|
+
const a = i.style;
|
|
255
|
+
s.add("color", a.color).add("background-color", a.backgroundColor).add("font-family", a.fontFamily).add("line-height", a.lineHeight).add("letter-spacing", a.letterSpacing == null ? void 0 : `${a.letterSpacing * t / 72}px`).add("font-weight", a.bold != null ? a.bold ? "700" : "400" : void 0).add("font-style", a.italic != null ? a.italic ? "italic" : "normal" : void 0).add("text-decoration", a.underline != null ? a.underline ? "underline" : "none" : void 0), (a.fontSize != null || a.fontSizePx != null) && s.add("font-size", `${J(_(a, t).fontSizePx, 2)}px`);
|
|
124
256
|
}
|
|
125
|
-
|
|
257
|
+
s.applyTo(l), o.appendChild(l);
|
|
126
258
|
}
|
|
127
|
-
return
|
|
128
|
-
}
|
|
129
|
-
function
|
|
130
|
-
if (
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
for (const
|
|
134
|
-
return
|
|
259
|
+
return o;
|
|
260
|
+
}
|
|
261
|
+
function st(e, t, n, r) {
|
|
262
|
+
if (Ye(e)) {
|
|
263
|
+
const o = r.createElement("div");
|
|
264
|
+
o.className = P("rich", n), x("block").applyTo(o);
|
|
265
|
+
for (const i of e.richParagraphs) o.appendChild(Vt(i, t, n, r));
|
|
266
|
+
return o;
|
|
135
267
|
}
|
|
136
268
|
if (Array.isArray(e.lines) && e.lines.length > 0) {
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
for (const
|
|
269
|
+
const o = r.createElement("div");
|
|
270
|
+
o.className = P("lines", n), x("block").applyTo(o);
|
|
271
|
+
for (const i of e.lines) {
|
|
140
272
|
const l = r.createElement("div");
|
|
141
|
-
l.className =
|
|
273
|
+
l.className = P("line", n), l.textContent = i, x("block").add("white-space", "pre").add("min-height", "1lh").applyTo(l), o.appendChild(l);
|
|
142
274
|
}
|
|
143
|
-
return
|
|
275
|
+
return o;
|
|
144
276
|
}
|
|
145
277
|
return e.text ?? "";
|
|
146
278
|
}
|
|
147
|
-
function
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
return
|
|
279
|
+
function qt(e, t, n, r) {
|
|
280
|
+
const o = r.createElement("div");
|
|
281
|
+
o.className = P("text", n);
|
|
282
|
+
const i = e.style || {};
|
|
283
|
+
return x("flex").add("width", "100%").add("height", "100%").add("flex-direction", "column").add("justify-content", i.verticalAlign === "middle" ? "center" : i.verticalAlign === "bottom" ? "flex-end" : "flex-start").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(o), o.append(st(e, t, n, r)), o;
|
|
152
284
|
}
|
|
153
|
-
function
|
|
285
|
+
function Gt(e, t, n) {
|
|
154
286
|
const r = n.createElement("img");
|
|
155
|
-
return r.className =
|
|
156
|
-
}
|
|
157
|
-
function ye(e, t, n, r) {
|
|
158
|
-
const i = r.createElement("div");
|
|
159
|
-
i.className = E("shape", n);
|
|
160
|
-
const o = e.style || {}, l = q(o), a = Ae(o), s = `${U(l.widthPt * t / 72, 2)}px solid ${l.color}`, c = v("block");
|
|
161
|
-
return e.grid ? c.add("position", "relative") : e.kind === "rect" ? (a.top && c.add("border-top", s), a.right && c.add("border-right", s), a.bottom && c.add("border-bottom", s), a.left && c.add("border-left", s)) : e.kind === "ellipse" ? (a.inner && c.add("border", s).add("border-radius", "50%"), o.backgroundColor && c.add("background-color", o.backgroundColor)) : e.kind === "line" && c.add("height", "0").add("border-top", s), c.add("box-sizing", "border-box").add("width", "100%").add("height", "100%"), c.applyTo(i), i;
|
|
287
|
+
return r.className = P("image", t), r.src = e.imageData, x("block").add("width", "100%").add("height", "100%").add("object-fit", "contain").applyTo(r), r.alt = e.kind, r;
|
|
162
288
|
}
|
|
163
|
-
function
|
|
164
|
-
const
|
|
165
|
-
|
|
289
|
+
function je(e, t, n, r) {
|
|
290
|
+
const o = r.createElement("div");
|
|
291
|
+
o.className = P("shape", n);
|
|
292
|
+
const i = e.style || {}, l = Y(i), s = Je(i), a = `${J(l.widthPt * t / 72, 2)}px solid ${l.color}`, c = x("block");
|
|
293
|
+
return e.grid ? c.add("position", "relative") : e.kind === "rect" ? (s.top && c.add("border-top", a), s.right && c.add("border-right", a), s.bottom && c.add("border-bottom", a), s.left && c.add("border-left", a)) : e.kind === "ellipse" ? (s.inner && c.add("border", a).add("border-radius", "50%"), i.backgroundColor && c.add("background-color", i.backgroundColor)) : e.kind === "line" && c.add("height", "0").add("border-top", a), c.add("box-sizing", "border-box").add("width", "100%").add("height", "100%"), c.applyTo(o), o;
|
|
294
|
+
}
|
|
295
|
+
function Jt(e, t, n) {
|
|
296
|
+
const r = n.createElementNS("http://www.w3.org/2000/svg", "svg"), o = ue(e.widthMm, t), i = ue(e.heightMm, t);
|
|
297
|
+
r.setAttribute("width", String(Math.max(1, o))), r.setAttribute("height", String(Math.max(1, i))), r.setAttribute("aria-hidden", "true"), r.style.overflow = "visible", r.style.display = "block";
|
|
166
298
|
const l = n.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
167
|
-
l.setAttribute("x1", "0"), l.setAttribute("x2", String(
|
|
168
|
-
const
|
|
169
|
-
return l.setAttribute("stroke",
|
|
170
|
-
}
|
|
171
|
-
function
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
return
|
|
299
|
+
l.setAttribute("x1", "0"), l.setAttribute("x2", String(o)), l.setAttribute("y1", e.lineDirection === "up" ? String(i) : "0"), l.setAttribute("y2", e.lineDirection === "up" ? "0" : String(i));
|
|
300
|
+
const s = Y({ ...e.style, borderColor: e.style?.lineColor ?? e.style?.borderColor });
|
|
301
|
+
return l.setAttribute("stroke", s.color), l.setAttribute("stroke-width", String(s.widthPt * t / 72)), r.appendChild(l), r;
|
|
302
|
+
}
|
|
303
|
+
function lt(e, t, n, r) {
|
|
304
|
+
const o = r.createElement("div");
|
|
305
|
+
o.className = `${P("comp", n)} mr-kind-${e.kind}`;
|
|
306
|
+
const i = x("block").add("position", "absolute").mm("left", e.leftMm, t).mm("top", e.topMm, t).mm("width", e.widthMm, t).mm("height", e.heightMm, t).add("box-sizing", "border-box");
|
|
307
|
+
if (_t(i, e, t), i.applyTo(o), ce(e))
|
|
308
|
+
return o.appendChild(Gt(e, n, r)), o;
|
|
177
309
|
if (e.kind === "text")
|
|
178
|
-
return
|
|
310
|
+
return o.appendChild(qt(e, t, n, r)), o;
|
|
179
311
|
if (e.grid) {
|
|
180
|
-
const
|
|
181
|
-
return
|
|
312
|
+
const s = je(e, t, n, r);
|
|
313
|
+
return s.appendChild(Ut(e.grid, e, t, n, r)), o.appendChild(s), o;
|
|
182
314
|
}
|
|
183
315
|
if (e.kind === "line" && e.lineDirection)
|
|
184
|
-
return
|
|
316
|
+
return o.appendChild(Jt(e, t, r)), o;
|
|
185
317
|
if (e.kind === "line" || e.kind === "rect" || e.kind === "ellipse")
|
|
186
|
-
return
|
|
318
|
+
return o.appendChild(je(e, t, n, r)), o;
|
|
187
319
|
const l = r.createElement("div");
|
|
188
|
-
return l.className =
|
|
320
|
+
return l.className = P("unknown", n), x("block").applyTo(l), l.textContent = e.fallbackText ?? `[${e.kind}]`, l.dataset.mrUnsupported = e.kind, l.setAttribute("role", "note"), o.appendChild(l), o;
|
|
189
321
|
}
|
|
190
|
-
function
|
|
191
|
-
const
|
|
192
|
-
return
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
}),
|
|
322
|
+
function ct(e, t, n, r) {
|
|
323
|
+
const o = r.createElement("div");
|
|
324
|
+
return o.className = P("page", n), x("block", "initial").add("position", "relative").add("font-family", le).add("font-size", `${J(_(void 0, t).fontSizePx, 2)}px`).add("line-height", String(q(void 0))).add("white-space", "pre-wrap").add("direction", "ltr").mm("width", e.pageWidthMm, t).mm("height", e.pageHeightMm, t).add("background-color", "#fff").add("color", Ge).add("overflow", "hidden").add("box-sizing", "border-box").applyTo(o), e.components.forEach((i, l) => {
|
|
325
|
+
const s = lt(i, t, n, r);
|
|
326
|
+
s.dataset.mrComponentIndex = String(l), o.appendChild(s);
|
|
327
|
+
}), o;
|
|
196
328
|
}
|
|
197
|
-
function
|
|
329
|
+
function br(e, t, n = {}) {
|
|
198
330
|
const r = n.dpi ?? 96;
|
|
199
|
-
|
|
200
|
-
const
|
|
201
|
-
return
|
|
202
|
-
|
|
203
|
-
}),
|
|
204
|
-
}
|
|
205
|
-
function
|
|
331
|
+
Z(e, "dom", n);
|
|
332
|
+
const o = t.createElement("div");
|
|
333
|
+
return o.className = P("root", n), x("block").applyTo(o), o.dataset.schemaVersion = e.schemaVersion, e.pages.forEach((i) => {
|
|
334
|
+
o.appendChild(ct(i, r, n, t));
|
|
335
|
+
}), o;
|
|
336
|
+
}
|
|
337
|
+
function yr(e, t, n, r) {
|
|
338
|
+
const o = { ...n }, i = Dt();
|
|
339
|
+
return ot.set(o, i), { element: ct(e, t, o, r), update(s, a) {
|
|
340
|
+
return i.update(s, a && e.components[a.componentIndex], a);
|
|
341
|
+
} };
|
|
342
|
+
}
|
|
343
|
+
function Ce(e, t, n, r, o, i, l, s = "top") {
|
|
206
344
|
e.font = `${t.italic ? "italic " : ""}${t.bold ? "bold " : ""}${t.fontSizePx}px ${l}`, "letterSpacing" in e && (e.letterSpacing = "0px"), e.fillStyle = t.color, e.textBaseline = "alphabetic";
|
|
207
|
-
const
|
|
208
|
-
`), d = c.length *
|
|
209
|
-
let
|
|
210
|
-
|
|
211
|
-
const
|
|
212
|
-
|
|
345
|
+
const a = t.fontSizePx * t.lineHeight, c = t.text === "" ? [""] : t.text.split(`
|
|
346
|
+
`), d = c.length * a;
|
|
347
|
+
let m = r;
|
|
348
|
+
s === "middle" ? m = r + (i - d) / 2 : s === "bottom" && (m = r + i - d), c.forEach((h, f) => {
|
|
349
|
+
const g = m + f * a + t.fontSizePx * 0.8;
|
|
350
|
+
Kt(e, h, t, n, g, o), t.underline && h && Yt(e, h, t, n, g, o);
|
|
213
351
|
}), e.textAlign = "left";
|
|
214
352
|
}
|
|
215
|
-
function
|
|
216
|
-
const l = Array.from(t),
|
|
217
|
-
if (!
|
|
353
|
+
function Kt(e, t, n, r, o, i) {
|
|
354
|
+
const l = Array.from(t), s = n.letterSpacingPx ?? 0;
|
|
355
|
+
if (!s) {
|
|
218
356
|
e.textAlign = n.align === "center" ? "center" : n.align === "right" ? "right" : "left";
|
|
219
|
-
const
|
|
220
|
-
e.fillText(t,
|
|
357
|
+
const m = n.align === "center" ? r + i / 2 : n.align === "right" ? r + i : r;
|
|
358
|
+
e.fillText(t, m, o);
|
|
221
359
|
return;
|
|
222
360
|
}
|
|
223
|
-
const
|
|
361
|
+
const a = e.measureText(t).width + Math.max(0, l.length - 1) * s, c = n.align === "center" ? r + (i - a) / 2 : n.align === "right" ? r + i - a : r;
|
|
224
362
|
e.textAlign = "left";
|
|
225
363
|
let d = "";
|
|
226
|
-
l.forEach((
|
|
227
|
-
e.fillText(
|
|
364
|
+
l.forEach((m, h) => {
|
|
365
|
+
e.fillText(m, c + e.measureText(d).width + h * s, o), d += m;
|
|
228
366
|
});
|
|
229
367
|
}
|
|
230
|
-
function
|
|
231
|
-
const l = e.measureText(t).width + Math.max(0, Array.from(t).length - 1) * (n.letterSpacingPx ?? 0),
|
|
232
|
-
e.strokeStyle = n.color, e.lineWidth = Math.max(0.5, n.fontSizePx / 20), e.beginPath(), e.moveTo(
|
|
368
|
+
function Yt(e, t, n, r, o, i) {
|
|
369
|
+
const l = e.measureText(t).width + Math.max(0, Array.from(t).length - 1) * (n.letterSpacingPx ?? 0), s = n.align === "center" ? r + (i - l) / 2 : n.align === "right" ? r + i - l : r;
|
|
370
|
+
e.strokeStyle = n.color, e.lineWidth = Math.max(0.5, n.fontSizePx / 20), e.beginPath(), e.moveTo(s, o + 1), e.lineTo(s + l, o + 1), e.stroke();
|
|
233
371
|
}
|
|
234
|
-
function
|
|
235
|
-
const
|
|
236
|
-
e.font = `${
|
|
372
|
+
function dt(e, t, n, r, o) {
|
|
373
|
+
const i = r / 72, l = (s) => {
|
|
374
|
+
e.font = `${s.italic ? "italic " : ""}${s.bold ? "bold " : ""}${_(s, r).fontSizePx}px ${s.fontFamily ?? o}`, "letterSpacing" in e && (e.letterSpacing = "0px");
|
|
237
375
|
};
|
|
238
|
-
|
|
239
|
-
measure(
|
|
240
|
-
return l(
|
|
376
|
+
$t(t, { x: n.x / i, yTop: -n.y / i, width: n.width / i, height: n.height / i }, {
|
|
377
|
+
measure(s, a) {
|
|
378
|
+
return l(a), e.measureText(s).width / i + (a.letterSpacing ?? 0);
|
|
241
379
|
},
|
|
242
|
-
draw(
|
|
243
|
-
const
|
|
244
|
-
|
|
380
|
+
draw(s, a, c, d, m) {
|
|
381
|
+
const h = _(a, r).fontSizePx, f = -d * i - h * 0.8;
|
|
382
|
+
a.backgroundColor && (e.fillStyle = a.backgroundColor, e.fillRect(c * i, f, m * i, h * q(a))), Ce(e, { text: s, fontSizePx: h, bold: !!a.bold, italic: a.italic, underline: a.underline, color: ye(a), align: "left", lineHeight: q(a), letterSpacingPx: (a.letterSpacing ?? 0) * i }, c * i, f, m * i, h, a.fontFamily ?? o);
|
|
245
383
|
}
|
|
246
384
|
});
|
|
247
385
|
}
|
|
248
|
-
function
|
|
386
|
+
function A(e) {
|
|
249
387
|
if (e?.aborted) throw e.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
250
388
|
}
|
|
251
|
-
const
|
|
252
|
-
const
|
|
253
|
-
|
|
389
|
+
const Xt = (e, t) => (A(t), /^data:image\/(?:png|jpe?g|webp|gif|svg\+xml)[;,]/i.test(e) ? new Promise((n, r) => {
|
|
390
|
+
const o = new Image(), i = () => {
|
|
391
|
+
o.onload = null, o.onerror = null, t?.removeEventListener("abort", l);
|
|
254
392
|
}, l = () => {
|
|
255
|
-
|
|
393
|
+
i(), o.src = "", r(t?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
|
|
256
394
|
};
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
},
|
|
260
|
-
|
|
261
|
-
}, t?.addEventListener("abort", l, { once: !0 }),
|
|
395
|
+
o.onload = () => {
|
|
396
|
+
i(), n(o);
|
|
397
|
+
}, o.onerror = () => {
|
|
398
|
+
i(), r(new Error("Image could not be decoded for Canvas output."));
|
|
399
|
+
}, t?.addEventListener("abort", l, { once: !0 }), o.src = e;
|
|
262
400
|
}) : Promise.reject(new TypeError("Canvas imageData must be an image data URL; provide imageLoader for other sources.")));
|
|
263
|
-
function
|
|
264
|
-
return
|
|
265
|
-
const
|
|
266
|
-
n.addEventListener("abort",
|
|
401
|
+
function Zt(e, t, n) {
|
|
402
|
+
return A(n), n ? new Promise((r, o) => {
|
|
403
|
+
const i = () => o(n.reason ?? new DOMException("The operation was aborted.", "AbortError"));
|
|
404
|
+
n.addEventListener("abort", i, { once: !0 }), Promise.resolve().then(() => e(t, n)).then(r, o).finally(() => n.removeEventListener("abort", i));
|
|
267
405
|
}) : e(t);
|
|
268
406
|
}
|
|
269
|
-
function*
|
|
270
|
-
function* t(n, r,
|
|
271
|
-
if (
|
|
272
|
-
|
|
273
|
-
const l = new Set(
|
|
274
|
-
for (const [
|
|
407
|
+
function* Te(e) {
|
|
408
|
+
function* t(n, r, o, i) {
|
|
409
|
+
if (i.has(n)) throw new TypeError("Cyclic grid children cannot be rendered.");
|
|
410
|
+
ce(n) && (yield { component: n, componentIndex: r, componentPath: o });
|
|
411
|
+
const l = new Set(i).add(n);
|
|
412
|
+
for (const [s, a] of (n.grid?.cells ?? []).entries()) for (const [c, d] of a.entries()) for (const [m, h] of (d?.children ?? []).entries()) yield* t(h, r, [...o, s, c, m], l);
|
|
275
413
|
}
|
|
276
414
|
for (const [n, r] of e.components.entries()) yield* t(r, n, [], /* @__PURE__ */ new Set());
|
|
277
415
|
}
|
|
278
|
-
async function
|
|
416
|
+
async function Qt(e, t, n) {
|
|
279
417
|
const r = /* @__PURE__ */ new Map();
|
|
280
|
-
for (const { component:
|
|
281
|
-
!
|
|
282
|
-
return
|
|
283
|
-
}
|
|
284
|
-
function
|
|
285
|
-
const l = t,
|
|
286
|
-
if (
|
|
287
|
-
const c = Math.min(
|
|
288
|
-
e.drawImage(t, n + (
|
|
289
|
-
}
|
|
290
|
-
function
|
|
291
|
-
return
|
|
292
|
-
}
|
|
293
|
-
const
|
|
294
|
-
function
|
|
295
|
-
const n = t / 96 *
|
|
418
|
+
for (const { component: o } of Te(e))
|
|
419
|
+
!ce(o) || r.has(o.imageData) || r.set(o.imageData, await Zt(t, o.imageData, n));
|
|
420
|
+
return A(n), r;
|
|
421
|
+
}
|
|
422
|
+
function en(e, t, n, r, o, i) {
|
|
423
|
+
const l = t, s = l.naturalWidth ?? l.width ?? o, a = l.naturalHeight ?? l.height ?? i;
|
|
424
|
+
if (s <= 0 || a <= 0) throw new RangeError("Decoded Canvas image dimensions must be positive.");
|
|
425
|
+
const c = Math.min(o / s, i / a), d = s * c, m = a * c;
|
|
426
|
+
e.drawImage(t, n + (o - d) / 2, r + (i - m) / 2, d, m);
|
|
427
|
+
}
|
|
428
|
+
function tn(e) {
|
|
429
|
+
return It(e.pageHeightsPx, e.gapPx).window(e.viewportHeightPx, e.scrollTopPx, e.overscan);
|
|
430
|
+
}
|
|
431
|
+
const Re = 96 / 25.4;
|
|
432
|
+
function Pe(e, t = 96) {
|
|
433
|
+
const n = t / 96 * Re;
|
|
296
434
|
return {
|
|
297
435
|
widthPx: Math.max(1, Math.round(e.pageWidthMm * n)),
|
|
298
436
|
heightPx: Math.max(1, Math.round(e.pageHeightMm * n))
|
|
299
437
|
};
|
|
300
438
|
}
|
|
301
|
-
function
|
|
439
|
+
function mt(e, t, n, r = 64e6) {
|
|
302
440
|
if (!Number.isFinite(t) || t <= 0 || !Number.isFinite(n) || n <= 0) throw new RangeError("Canvas dpr and dpi must be positive finite numbers.");
|
|
303
441
|
if (!Number.isFinite(r) || r <= 0) throw new RangeError("maxCanvasPixels must be positive and finite.");
|
|
304
|
-
const
|
|
305
|
-
if (!Number.isSafeInteger(
|
|
306
|
-
return { width:
|
|
307
|
-
}
|
|
308
|
-
function
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
const
|
|
312
|
-
if (!
|
|
442
|
+
const o = Pe(e, n), i = Math.round(o.widthPx * t), l = Math.round(o.heightPx * t);
|
|
443
|
+
if (!Number.isSafeInteger(i) || !Number.isSafeInteger(l) || i * l > r) throw new RangeError("Canvas page exceeds maxCanvasPixels; reduce resolution or split the report.");
|
|
444
|
+
return { width: i, height: l };
|
|
445
|
+
}
|
|
446
|
+
function ht(e, t, n, r) {
|
|
447
|
+
const o = document.createElement("canvas"), { widthPx: i, heightPx: l } = Pe(e, n), s = mt(e, t, n, r);
|
|
448
|
+
o.width = s.width, o.height = s.height, o.style.width = `${i}px`, o.style.height = `${l}px`;
|
|
449
|
+
const a = o.getContext("2d");
|
|
450
|
+
if (!a)
|
|
313
451
|
throw new Error("当前环境不支持 Canvas 2D(测试需真浏览器,见 e2e/canvas.spec.ts)");
|
|
314
|
-
return
|
|
452
|
+
return a.scale(t, t), a.fillStyle = "#ffffff", a.fillRect(0, 0, i, l), { canvas: o, ctx: a };
|
|
315
453
|
}
|
|
316
|
-
function
|
|
317
|
-
return
|
|
454
|
+
function Mr(e, t = 96) {
|
|
455
|
+
return _(e, t).fontSizePx;
|
|
318
456
|
}
|
|
319
|
-
function
|
|
320
|
-
for (const
|
|
321
|
-
e.strokeStyle =
|
|
457
|
+
function nn(e, t, n, r, o, i, l) {
|
|
458
|
+
for (const s of Se(t, n))
|
|
459
|
+
e.strokeStyle = s.color, e.lineWidth = V(s.widthPt, l), e.beginPath(), s.kind === "v" ? (e.moveTo(r + s.pos * i, o + s.from * i), e.lineTo(r + s.pos * i, o + s.to * i)) : (e.moveTo(r + s.from * i, o + s.pos * i), e.lineTo(r + s.to * i, o + s.pos * i)), e.stroke();
|
|
322
460
|
}
|
|
323
|
-
function
|
|
324
|
-
e.beginPath(), t.top && (e.moveTo(n, r), e.lineTo(n +
|
|
461
|
+
function rn(e, t, n, r, o, i) {
|
|
462
|
+
e.beginPath(), t.top && (e.moveTo(n, r), e.lineTo(n + o, r)), t.right && (e.moveTo(n + o, r), e.lineTo(n + o, r + i)), t.bottom && (e.moveTo(n + o, r + i), e.lineTo(n, r + i)), t.left && (e.moveTo(n, r + i), e.lineTo(n, r)), e.stroke();
|
|
325
463
|
}
|
|
326
|
-
function
|
|
327
|
-
const
|
|
328
|
-
for (const
|
|
329
|
-
const
|
|
330
|
-
|
|
464
|
+
function on(e, t, n, r, o, i, l, s, a, c, d, m) {
|
|
465
|
+
const h = xe(t, i / s, l / s);
|
|
466
|
+
for (const f of h.cells) {
|
|
467
|
+
const g = f.cell.style?.backgroundColor ?? n.style?.backgroundColor;
|
|
468
|
+
g && (e.fillStyle = g, e.fillRect(r + f.xMm * s, o + f.yMm * s, f.widthMm * s, f.heightMm * s));
|
|
331
469
|
}
|
|
332
|
-
|
|
333
|
-
for (const
|
|
470
|
+
nn(e, h, n, r, o, s, a);
|
|
471
|
+
for (const f of h.cells) an(e, f, n, r, o, s, a, c, d, m);
|
|
334
472
|
}
|
|
335
|
-
function
|
|
336
|
-
const d = n.grid?.paddingMm ?? 0.5,
|
|
337
|
-
`), b = { x: r + (t.xMm + d +
|
|
338
|
-
e.save(), e.beginPath(), e.rect(b.x, b.y, b.width, b.height), e.clip(), t.cell.richParagraphs?.length ?
|
|
473
|
+
function an(e, t, n, r, o, i, l, s, a, c) {
|
|
474
|
+
const d = n.grid?.paddingMm ?? 0.5, m = t.cell.text ?? "", h = Ke(n.style, t.cell.style), f = _(h, l), g = t.cell.indentMm ?? 0, C = Math.max(0, t.widthMm - 2 * d - g), S = Qe(m, C, { fontSizePt: f.fontSizePt, bold: h.bold, italic: h.italic, fontFamily: h.fontFamily ?? s, letterSpacingPt: h.letterSpacing }, a).join(`
|
|
475
|
+
`), b = { x: r + (t.xMm + d + g) * i, y: o + (t.yMm + d) * i, width: C * i, height: Math.max(0, t.heightMm - 2 * d) * i };
|
|
476
|
+
e.save(), e.beginPath(), e.rect(b.x, b.y, b.width, b.height), e.clip(), t.cell.richParagraphs?.length ? dt(e, { ...n, richParagraphs: t.cell.richParagraphs, style: { verticalAlign: "middle", ...h } }, b, l, s) : Ce(
|
|
339
477
|
e,
|
|
340
478
|
{
|
|
341
|
-
text:
|
|
342
|
-
fontSizePx:
|
|
343
|
-
bold:
|
|
344
|
-
italic:
|
|
345
|
-
underline:
|
|
346
|
-
color:
|
|
347
|
-
align:
|
|
348
|
-
lineHeight:
|
|
349
|
-
letterSpacingPx:
|
|
479
|
+
text: S,
|
|
480
|
+
fontSizePx: f.fontSizePx,
|
|
481
|
+
bold: h.bold ?? !1,
|
|
482
|
+
italic: h.italic,
|
|
483
|
+
underline: h.underline,
|
|
484
|
+
color: ye(h, Ge),
|
|
485
|
+
align: h.align ?? "left",
|
|
486
|
+
lineHeight: q(h),
|
|
487
|
+
letterSpacingPx: V(h.letterSpacing ?? 0, l)
|
|
350
488
|
},
|
|
351
|
-
r + (t.xMm + d +
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
Math.max(0, t.heightMm - 2 * d) *
|
|
355
|
-
|
|
356
|
-
|
|
489
|
+
r + (t.xMm + d + g) * i,
|
|
490
|
+
o + (t.yMm + d) * i,
|
|
491
|
+
C * i,
|
|
492
|
+
Math.max(0, t.heightMm - 2 * d) * i,
|
|
493
|
+
h.fontFamily ?? s,
|
|
494
|
+
h.verticalAlign ?? "middle"
|
|
357
495
|
);
|
|
358
|
-
for (const
|
|
496
|
+
for (const w of t.cell.children ?? []) de(e, { ...w, leftMm: w.leftMm + b.x / i, topMm: w.topMm + b.y / i }, i, l, s, a, c);
|
|
359
497
|
e.restore();
|
|
498
|
+
const M = tt(t.cell.dataBar, t.widthMm, t.heightMm, d);
|
|
499
|
+
M && (e.save(), e.globalAlpha *= 0.35, e.fillStyle = M.color, e.fillRect(r + (t.xMm + M.x) * i, o + (t.yMm + M.y) * i, M.width * i, M.height * i), e.restore());
|
|
360
500
|
}
|
|
361
|
-
function
|
|
362
|
-
const c = t.style ?? {}, d =
|
|
363
|
-
if (
|
|
364
|
-
|
|
501
|
+
function sn(e, t, n, r, o, i, l, s, a) {
|
|
502
|
+
const c = t.style ?? {}, d = _(c, l);
|
|
503
|
+
if (Ye(t)) {
|
|
504
|
+
dt(e, t, { x: n, y: r, width: o, height: i }, l, s);
|
|
365
505
|
return;
|
|
366
506
|
}
|
|
367
|
-
const
|
|
368
|
-
`) :
|
|
507
|
+
const m = t.lines?.length ? t.lines.join(`
|
|
508
|
+
`) : Qe(t.text ?? "", t.widthMm, { fontSizePt: d.fontSizePt, bold: c.bold, italic: c.italic, fontFamily: c.fontFamily ?? s, letterSpacingPt: c.letterSpacing }, a).join(`
|
|
369
509
|
`);
|
|
370
|
-
|
|
371
|
-
text:
|
|
510
|
+
Ce(e, {
|
|
511
|
+
text: m,
|
|
372
512
|
fontSizePx: d.fontSizePx,
|
|
373
513
|
bold: c.bold ?? !1,
|
|
374
514
|
italic: c.italic,
|
|
375
515
|
underline: c.underline,
|
|
376
|
-
color:
|
|
516
|
+
color: ye(c),
|
|
377
517
|
align: c.align ?? "left",
|
|
378
|
-
lineHeight:
|
|
379
|
-
letterSpacingPx:
|
|
380
|
-
}, n, r,
|
|
381
|
-
}
|
|
382
|
-
function
|
|
383
|
-
const
|
|
384
|
-
if (
|
|
385
|
-
const
|
|
386
|
-
|
|
518
|
+
lineHeight: q(c),
|
|
519
|
+
letterSpacingPx: V(c.letterSpacing ?? 0, l)
|
|
520
|
+
}, n, r, o, i, c.fontFamily ?? s, c.verticalAlign);
|
|
521
|
+
}
|
|
522
|
+
function de(e, t, n, r, o, i, l) {
|
|
523
|
+
const s = t.leftMm * n, a = t.topMm * n, c = t.widthMm * n, d = t.heightMm * n, m = t.style ?? {};
|
|
524
|
+
if (ce(t)) {
|
|
525
|
+
const h = l?.get(t.imageData);
|
|
526
|
+
h ? en(e, h, s, a, c, d) : ze(e, t, s, a, c, d);
|
|
387
527
|
return;
|
|
388
528
|
}
|
|
389
529
|
if (t.grid) {
|
|
390
|
-
|
|
530
|
+
on(e, t.grid, t, s, a, c, d, n, r, o, i, l);
|
|
391
531
|
return;
|
|
392
532
|
}
|
|
393
533
|
switch (t.kind) {
|
|
394
534
|
case "text": {
|
|
395
|
-
|
|
535
|
+
sn(e, t, s, a, c, d, r, o, i);
|
|
396
536
|
break;
|
|
397
537
|
}
|
|
398
538
|
case "rect": {
|
|
399
|
-
const
|
|
400
|
-
|
|
539
|
+
const h = Y(m), f = Je(m);
|
|
540
|
+
m.backgroundColor && (e.fillStyle = m.backgroundColor, e.fillRect(s, a, c, d)), f.inner && (e.strokeStyle = h.color, e.lineWidth = V(h.widthPt, r), rn(e, f, s, a, c, d));
|
|
401
541
|
break;
|
|
402
542
|
}
|
|
403
543
|
case "line": {
|
|
404
|
-
const
|
|
405
|
-
e.strokeStyle =
|
|
406
|
-
const
|
|
407
|
-
e.moveTo(
|
|
544
|
+
const h = Y({ ...m, borderColor: m.lineColor ?? m.borderColor });
|
|
545
|
+
e.strokeStyle = h.color, e.lineWidth = V(h.widthPt, r), e.beginPath();
|
|
546
|
+
const f = t.lineDirection === "up" ? a + d : t.lineDirection === "down" ? a : a + d / 2, g = t.lineDirection === "up" ? a : t.lineDirection === "down" ? a + d : a + d / 2;
|
|
547
|
+
e.moveTo(s, f), e.lineTo(s + c, g), e.stroke();
|
|
408
548
|
break;
|
|
409
549
|
}
|
|
410
550
|
case "ellipse": {
|
|
411
|
-
const
|
|
412
|
-
e.strokeStyle =
|
|
551
|
+
const h = Y(m);
|
|
552
|
+
e.strokeStyle = h.color, e.lineWidth = V(h.widthPt, r), m.backgroundColor && (e.fillStyle = m.backgroundColor, e.beginPath(), e.ellipse(s + c / 2, a + d / 2, c / 2, d / 2, 0, 0, Math.PI * 2), e.fill()), e.beginPath(), e.ellipse(s + c / 2, a + d / 2, c / 2, d / 2, 0, 0, Math.PI * 2), e.stroke();
|
|
413
553
|
break;
|
|
414
554
|
}
|
|
415
555
|
default:
|
|
416
|
-
|
|
556
|
+
ze(e, t, s, a, c, d);
|
|
417
557
|
break;
|
|
418
558
|
}
|
|
419
559
|
}
|
|
420
|
-
function
|
|
421
|
-
e.save(), e.strokeStyle = "#94a3b8", e.strokeRect(n, r,
|
|
560
|
+
function ze(e, t, n, r, o, i) {
|
|
561
|
+
e.save(), e.strokeStyle = "#94a3b8", e.strokeRect(n, r, o, i), e.fillStyle = "#64748b", e.font = "12px sans-serif", e.fillText(t.fallbackText ?? `[${t.kind}]`, n + 3, r + 14), e.restore();
|
|
422
562
|
}
|
|
423
|
-
async function
|
|
563
|
+
async function vr(e, t = {}) {
|
|
424
564
|
if (typeof document > "u")
|
|
425
565
|
throw new Error("renderPlanToImages 需要浏览器环境(SSR/Node 请在客户端钩子中调用)");
|
|
426
|
-
const { format: n = "png", quality: r = 0.92, ...
|
|
566
|
+
const { format: n = "png", quality: r = 0.92, ...o } = t;
|
|
427
567
|
if (n !== "png" && n !== "jpeg") throw new TypeError("Image format must be png or jpeg.");
|
|
428
568
|
if (!Number.isFinite(r) || r < 0 || r > 1) throw new RangeError("Image quality must be between 0 and 1.");
|
|
429
|
-
|
|
430
|
-
const
|
|
431
|
-
e =
|
|
432
|
-
const l = [...
|
|
569
|
+
A(t.signal);
|
|
570
|
+
const i = await Ee(e, { ...t, format: "canvas" });
|
|
571
|
+
e = i.plan;
|
|
572
|
+
const l = [...i.diagnostics, ...Z(e, "canvas", t)], s = n === "jpeg" ? "image/jpeg" : "image/png", a = [], c = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
|
|
433
573
|
for (let d = Math.max(0, t.start ?? 0); d <= c; d++) {
|
|
434
|
-
|
|
435
|
-
const
|
|
574
|
+
A(t.signal);
|
|
575
|
+
const m = await ft(e.pages[d], d, o, l);
|
|
436
576
|
try {
|
|
437
|
-
|
|
577
|
+
a.push(await ln(m, s, r, t.signal));
|
|
438
578
|
} finally {
|
|
439
|
-
|
|
579
|
+
m.width = 0, m.height = 0;
|
|
440
580
|
}
|
|
441
|
-
await
|
|
581
|
+
await At(t, a.length, c - Math.max(0, t.start ?? 0) + 1);
|
|
442
582
|
}
|
|
443
|
-
return
|
|
583
|
+
return A(t.signal), { blobs: a, diagnostics: l };
|
|
444
584
|
}
|
|
445
|
-
function
|
|
446
|
-
return
|
|
447
|
-
const l = () =>
|
|
585
|
+
function ln(e, t, n, r) {
|
|
586
|
+
return A(r), new Promise((o, i) => {
|
|
587
|
+
const l = () => i(r?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
|
|
448
588
|
r?.addEventListener("abort", l, { once: !0 });
|
|
449
589
|
try {
|
|
450
|
-
e.toBlob((
|
|
451
|
-
r?.removeEventListener("abort", l),
|
|
590
|
+
e.toBlob((s) => {
|
|
591
|
+
r?.removeEventListener("abort", l), s ? o(s) : i(new Error("Canvas encoding failed; no empty image was emitted."));
|
|
452
592
|
}, t, n);
|
|
453
|
-
} catch (
|
|
454
|
-
r?.removeEventListener("abort", l),
|
|
593
|
+
} catch (s) {
|
|
594
|
+
r?.removeEventListener("abort", l), i(s);
|
|
455
595
|
}
|
|
456
596
|
});
|
|
457
597
|
}
|
|
458
|
-
function
|
|
459
|
-
if (
|
|
598
|
+
function xr(e, t = {}) {
|
|
599
|
+
if (A(t.signal), typeof document > "u")
|
|
460
600
|
throw new Error("renderPlanToCanvas 需要浏览器环境(SSR 请在客户端钩子中调用)");
|
|
461
|
-
const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96,
|
|
462
|
-
for (const
|
|
463
|
-
|
|
464
|
-
if (t.fidelity === "strict" &&
|
|
465
|
-
for (let
|
|
466
|
-
|
|
467
|
-
const
|
|
468
|
-
for (const
|
|
469
|
-
|
|
470
|
-
c.push(
|
|
601
|
+
const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, o = r / 96 * Re, i = t.fontFamily ?? le, l = t.measurer ?? Me, s = Math.max(0, t.start ?? 0), a = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1), c = [], d = Z(e, "canvas", t), m = cn(e, s, a);
|
|
602
|
+
for (const h of m)
|
|
603
|
+
nt(h, t), d.push(h);
|
|
604
|
+
if (t.fidelity === "strict" && m.length) throw new kt(d);
|
|
605
|
+
for (let h = s; h <= a; h++) {
|
|
606
|
+
A(t.signal);
|
|
607
|
+
const f = e.pages[h], { canvas: g, ctx: C } = ht(f, n, r, t.maxCanvasPixels);
|
|
608
|
+
for (const S of f.components)
|
|
609
|
+
de(C, S, o, r, i, l);
|
|
610
|
+
c.push(g);
|
|
471
611
|
}
|
|
472
612
|
return { canvases: c, diagnostics: d };
|
|
473
613
|
}
|
|
474
|
-
function
|
|
475
|
-
return n < t ? [] : e.pages.slice(t, n + 1).flatMap((r,
|
|
614
|
+
function cn(e, t, n) {
|
|
615
|
+
return n < t ? [] : e.pages.slice(t, n + 1).flatMap((r, o) => [...Te(r)].map(({ component: i, componentIndex: l, componentPath: s }) => ({
|
|
476
616
|
code: "async-image-required",
|
|
477
617
|
severity: "warning",
|
|
478
618
|
format: "canvas",
|
|
479
|
-
pageIndex: t +
|
|
619
|
+
pageIndex: t + o,
|
|
480
620
|
componentIndex: l,
|
|
481
|
-
componentPath:
|
|
482
|
-
kind:
|
|
483
|
-
nid:
|
|
621
|
+
componentPath: s,
|
|
622
|
+
kind: i.kind,
|
|
623
|
+
nid: i.nid,
|
|
484
624
|
message: "Use renderPlanToCanvasAsync or renderPlanToImages to decode and include images."
|
|
485
625
|
})));
|
|
486
626
|
}
|
|
487
|
-
async function
|
|
627
|
+
async function Sr(e, t = {}) {
|
|
488
628
|
if (typeof document > "u") throw new Error("renderPlanToCanvasAsync 需要浏览器环境(Node 请使用 PDF 或 XLSX 输出)");
|
|
489
|
-
|
|
490
|
-
const n = await
|
|
629
|
+
A(t.signal);
|
|
630
|
+
const n = await Ee(e, { ...t, format: "canvas" });
|
|
491
631
|
e = n.plan;
|
|
492
|
-
const r = [...n.diagnostics, ...
|
|
493
|
-
for (let l = Math.max(0, t.start ?? 0); l <=
|
|
494
|
-
|
|
495
|
-
return { canvases:
|
|
496
|
-
}
|
|
497
|
-
async function
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
const { canvas:
|
|
501
|
-
for (const d of e.components)
|
|
502
|
-
return
|
|
503
|
-
}
|
|
504
|
-
async function
|
|
505
|
-
const
|
|
506
|
-
return
|
|
632
|
+
const r = [...n.diagnostics, ...Z(e, "canvas", t)], o = [], i = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
|
|
633
|
+
for (let l = Math.max(0, t.start ?? 0); l <= i; l++)
|
|
634
|
+
o.push(await ft(e.pages[l], l, t, r));
|
|
635
|
+
return { canvases: o, diagnostics: r };
|
|
636
|
+
}
|
|
637
|
+
async function ft(e, t, n, r) {
|
|
638
|
+
const o = n.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), i = n.dpi ?? 96, l = n.fontFamily ?? le, s = await gt(e, t, n, r);
|
|
639
|
+
A(n.signal);
|
|
640
|
+
const { canvas: a, ctx: c } = ht(e, o, i, n.maxCanvasPixels);
|
|
641
|
+
for (const d of e.components) de(c, d, i / 25.4, i, l, n.measurer ?? Me, s);
|
|
642
|
+
return a;
|
|
643
|
+
}
|
|
644
|
+
async function gt(e, t, n, r) {
|
|
645
|
+
const o = n.imageLoader ?? Xt;
|
|
646
|
+
return Qt(e, async (i, l) => {
|
|
507
647
|
try {
|
|
508
|
-
return await i
|
|
509
|
-
} catch (
|
|
510
|
-
if (l?.aborted) throw
|
|
511
|
-
const
|
|
512
|
-
throw r.push(
|
|
648
|
+
return await o(i, l);
|
|
649
|
+
} catch (s) {
|
|
650
|
+
if (l?.aborted) throw s;
|
|
651
|
+
const a = [...Te(e)].find(({ component: f }) => f.imageData === i), { component: c, componentIndex: d, componentPath: m } = a, h = { code: "image-decode-failed", severity: "warning", format: "canvas", pageIndex: t, componentIndex: d, componentPath: m, kind: c.kind, nid: c.nid, message: "Image decoding failed; raster output was cancelled instead of omitting the image." };
|
|
652
|
+
throw r.push(h), nt(h, n), s;
|
|
513
653
|
}
|
|
514
654
|
}, n.signal);
|
|
515
655
|
}
|
|
516
|
-
function
|
|
517
|
-
const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96,
|
|
518
|
-
let
|
|
519
|
-
const
|
|
520
|
-
function
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
const
|
|
524
|
-
for (let
|
|
525
|
-
const
|
|
526
|
-
|
|
656
|
+
function Er(e, t = {}) {
|
|
657
|
+
const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, o = r / 96 * Re, i = t.fontFamily ?? le, l = t.measurer ?? Me, s = t.overscan ?? 1, a = t.gapPx ?? 18, c = t.pagesPerFrame ?? 1, d = e.pages.map((p) => p.pageHeightMm * o), m = Math.max(1, ...e.pages.map((p) => p.pageWidthMm * o)), h = { start: 0, end: -1 };
|
|
658
|
+
let f = null, g = null, C = null, S = null, b = [], M = 0, w = [], N = 0, D = new AbortController();
|
|
659
|
+
const Ie = [];
|
|
660
|
+
function Mt() {
|
|
661
|
+
const p = f;
|
|
662
|
+
p.innerHTML = "", g = document.createElement("div"), g.style.cssText = `width:${m}px;margin:0 auto;`, C = document.createElement("div"), S = document.createElement("div"), g.appendChild(C), b = [];
|
|
663
|
+
const R = Math.min(e.pages.length, 3 + s * 2);
|
|
664
|
+
for (let z = 0; z < R; z++) {
|
|
665
|
+
const E = document.createElement("div");
|
|
666
|
+
E.style.cssText = `margin:0 auto ${a}px;box-shadow:0 2px 8px rgba(0,0,0,.35);background:#fff;`, g.appendChild(E), b.push(E);
|
|
527
667
|
}
|
|
528
|
-
|
|
529
|
-
}
|
|
530
|
-
async function
|
|
531
|
-
const
|
|
532
|
-
|
|
533
|
-
const
|
|
534
|
-
if (
|
|
535
|
-
const { widthPx:
|
|
536
|
-
let L =
|
|
537
|
-
(!L || L.tagName !== "CANVAS") && (L = document.createElement("canvas"),
|
|
538
|
-
const
|
|
539
|
-
L.width =
|
|
540
|
-
const
|
|
541
|
-
if (
|
|
542
|
-
|
|
543
|
-
for (const
|
|
544
|
-
|
|
545
|
-
L.dataset.canvasPage = String(
|
|
668
|
+
g.appendChild(S), p.appendChild(g);
|
|
669
|
+
}
|
|
670
|
+
async function vt(p, R) {
|
|
671
|
+
const z = N, E = await Ee(e, { ...t, signal: D.signal, format: "canvas", start: R, end: R });
|
|
672
|
+
Ie.push(...E.diagnostics);
|
|
673
|
+
const $ = E.plan.pages[R], ne = await gt($, R, { ...t, signal: D.signal }, Ie);
|
|
674
|
+
if (z !== N || !f) return;
|
|
675
|
+
const { widthPx: fe, heightPx: ge } = Pe($, r);
|
|
676
|
+
let L = p.firstElementChild;
|
|
677
|
+
(!L || L.tagName !== "CANVAS") && (L = document.createElement("canvas"), p.innerHTML = "", p.appendChild(L));
|
|
678
|
+
const Ne = mt($, n, r, t.maxCanvasPixels);
|
|
679
|
+
L.width = Ne.width, L.height = Ne.height, L.style.width = `${fe}px`, L.style.height = `${ge}px`;
|
|
680
|
+
const W = L.getContext("2d");
|
|
681
|
+
if (W) {
|
|
682
|
+
W.setTransform(1, 0, 0, 1, 0, 0), W.scale(n, n), W.fillStyle = "#ffffff", W.fillRect(0, 0, fe, ge);
|
|
683
|
+
for (const St of $.components)
|
|
684
|
+
de(W, St, o, r, i, l, ne);
|
|
685
|
+
L.dataset.canvasPage = String(R), p.style.height = `${ge}px`, p.style.width = `${fe}px`;
|
|
546
686
|
}
|
|
547
687
|
}
|
|
548
|
-
function
|
|
549
|
-
|
|
550
|
-
const
|
|
551
|
-
|
|
552
|
-
const
|
|
553
|
-
b.forEach((
|
|
554
|
-
if (
|
|
555
|
-
|
|
556
|
-
const
|
|
557
|
-
|
|
688
|
+
function xt(p) {
|
|
689
|
+
N++, h.start = p.start, h.end = p.end, C.style.height = `${p.start * a + d.slice(0, p.start).reduce((E, $) => E + $, 0)}px`;
|
|
690
|
+
const R = e.pages.length - 1 - p.end;
|
|
691
|
+
S.style.height = `${R * a + d.slice(p.end + 1).reduce((E, $) => E + $, 0)}px`;
|
|
692
|
+
const z = p.end - p.start + 1;
|
|
693
|
+
b.forEach((E, $) => {
|
|
694
|
+
if ($ < z) {
|
|
695
|
+
E.style.display = "";
|
|
696
|
+
const ne = p.start + $;
|
|
697
|
+
E.style.height = `${d[ne] ?? 0}px`;
|
|
558
698
|
} else
|
|
559
|
-
|
|
560
|
-
}),
|
|
561
|
-
for (let
|
|
562
|
-
const
|
|
563
|
-
if (
|
|
564
|
-
|
|
699
|
+
E.style.display = "none";
|
|
700
|
+
}), w = [];
|
|
701
|
+
for (let E = p.start; E <= p.end; E++) {
|
|
702
|
+
const $ = b[E - p.start];
|
|
703
|
+
if (!$) continue;
|
|
704
|
+
$.firstElementChild?.dataset?.canvasPage !== String(E) && w.push(E);
|
|
565
705
|
}
|
|
566
|
-
|
|
567
|
-
}
|
|
568
|
-
function
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
let
|
|
572
|
-
for (;
|
|
573
|
-
const
|
|
574
|
-
|
|
706
|
+
he();
|
|
707
|
+
}
|
|
708
|
+
function he() {
|
|
709
|
+
M || w.length === 0 || (M = requestAnimationFrame(() => {
|
|
710
|
+
M = 0;
|
|
711
|
+
let p = Math.max(1, c);
|
|
712
|
+
for (; w.length > 0 && p-- > 0; ) {
|
|
713
|
+
const R = w.shift(), z = b[R - h.start];
|
|
714
|
+
z && vt(z, R).catch(() => {
|
|
575
715
|
});
|
|
576
716
|
}
|
|
577
|
-
|
|
717
|
+
w.length > 0 && he();
|
|
578
718
|
}));
|
|
579
719
|
}
|
|
580
|
-
function
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
const
|
|
720
|
+
function ee() {
|
|
721
|
+
M || (M = requestAnimationFrame(() => {
|
|
722
|
+
M = 0;
|
|
723
|
+
const p = f, R = tn({
|
|
584
724
|
pageHeightsPx: d,
|
|
585
|
-
viewportHeightPx:
|
|
586
|
-
scrollTopPx:
|
|
587
|
-
overscan:
|
|
588
|
-
gapPx:
|
|
725
|
+
viewportHeightPx: p.clientHeight,
|
|
726
|
+
scrollTopPx: p.scrollTop,
|
|
727
|
+
overscan: s,
|
|
728
|
+
gapPx: a
|
|
589
729
|
});
|
|
590
|
-
|
|
730
|
+
R.start !== h.start || R.end !== h.end ? xt(R) : he();
|
|
591
731
|
}));
|
|
592
732
|
}
|
|
593
|
-
let
|
|
733
|
+
let te = null;
|
|
594
734
|
return {
|
|
595
|
-
attach(
|
|
735
|
+
attach(p) {
|
|
596
736
|
if (typeof document > "u")
|
|
597
737
|
throw new Error("createCanvasPager 需要浏览器环境(SSR 请在客户端钩子中调用 attach)");
|
|
598
|
-
|
|
738
|
+
A(t.signal), D = new AbortController(), t.signal?.addEventListener("abort", Oe, { once: !0 }), Z(e, "canvas", t), f = p, Mt(), p.addEventListener("scroll", ee, { passive: !0 }), typeof ResizeObserver < "u" && (te = new ResizeObserver(() => ee()), te.observe(p)), ee();
|
|
599
739
|
},
|
|
600
740
|
destroy() {
|
|
601
|
-
|
|
741
|
+
N++, D.abort(), t.signal?.removeEventListener("abort", Oe), M && cancelAnimationFrame(M), M = 0, te?.disconnect(), te = null, f?.removeEventListener("scroll", ee), w = [], g?.remove(), f = null;
|
|
602
742
|
},
|
|
603
743
|
window() {
|
|
604
|
-
return { ...
|
|
744
|
+
return { ...h };
|
|
605
745
|
}
|
|
606
746
|
};
|
|
607
|
-
function
|
|
608
|
-
|
|
747
|
+
function Oe() {
|
|
748
|
+
D.abort(t.signal?.reason);
|
|
609
749
|
}
|
|
610
750
|
}
|
|
611
|
-
function
|
|
612
|
-
let r,
|
|
751
|
+
function ut(e, t, n) {
|
|
752
|
+
let r, o;
|
|
613
753
|
if (typeof e == "string") {
|
|
614
|
-
const
|
|
615
|
-
if (!
|
|
616
|
-
r =
|
|
617
|
-
} else typeof e == "number" ? (r = e,
|
|
618
|
-
return n ? { widthMm:
|
|
754
|
+
const i = ie[e];
|
|
755
|
+
if (!i) throw new Error(`未知纸张预设 "${e}"(可用:${Object.keys(ie).join("/")})`);
|
|
756
|
+
r = i.widthMm, o = i.heightMm;
|
|
757
|
+
} else typeof e == "number" ? (r = e, o = t ?? 297) : (r = e.widthMm, o = e.heightMm);
|
|
758
|
+
return n ? { widthMm: o, heightMm: r } : { widthMm: r, heightMm: o };
|
|
619
759
|
}
|
|
620
|
-
class
|
|
760
|
+
class dn {
|
|
621
761
|
constructor() {
|
|
622
762
|
this.pages = [], this.pending = null, this.templateParams = void 0;
|
|
623
763
|
}
|
|
@@ -650,18 +790,18 @@ class Lt {
|
|
|
650
790
|
*/
|
|
651
791
|
page(t = "a4", n = {}, r) {
|
|
652
792
|
this.collect();
|
|
653
|
-
const
|
|
793
|
+
const i = r != null && !("margins" in r) && !("landscape" in r) && ("marginTopMm" in r || "marginBottomMm" in r || "marginLeftMm" in r || "marginRightMm" in r) ? { margins: r } : typeof n == "number" ? r ?? {} : n, { widthMm: l, heightMm: s } = ut(
|
|
654
794
|
t,
|
|
655
795
|
typeof n == "number" ? n : void 0,
|
|
656
|
-
|
|
657
|
-
),
|
|
658
|
-
return this.pending = new
|
|
796
|
+
i.landscape
|
|
797
|
+
), a = i.margins ?? {};
|
|
798
|
+
return this.pending = new mn(this, {
|
|
659
799
|
widthMm: l,
|
|
660
|
-
heightMm:
|
|
661
|
-
marginTopMm:
|
|
662
|
-
marginBottomMm:
|
|
663
|
-
marginLeftMm:
|
|
664
|
-
marginRightMm:
|
|
800
|
+
heightMm: s,
|
|
801
|
+
marginTopMm: a.marginTopMm ?? 10,
|
|
802
|
+
marginBottomMm: a.marginBottomMm ?? 10,
|
|
803
|
+
marginLeftMm: a.marginLeftMm ?? 10,
|
|
804
|
+
marginRightMm: a.marginRightMm ?? 10
|
|
665
805
|
}), this.pending;
|
|
666
806
|
}
|
|
667
807
|
collect() {
|
|
@@ -677,7 +817,7 @@ class Lt {
|
|
|
677
817
|
};
|
|
678
818
|
}
|
|
679
819
|
}
|
|
680
|
-
class
|
|
820
|
+
class mn {
|
|
681
821
|
constructor(t, n) {
|
|
682
822
|
this.parent = t, this.page = n, this.components = [];
|
|
683
823
|
}
|
|
@@ -692,7 +832,7 @@ class Dt {
|
|
|
692
832
|
style: r
|
|
693
833
|
}), this;
|
|
694
834
|
}
|
|
695
|
-
list(t, n, r,
|
|
835
|
+
list(t, n, r, o = {}) {
|
|
696
836
|
return this.components.push({
|
|
697
837
|
kind: "list",
|
|
698
838
|
leftMm: n.leftMm ?? 10,
|
|
@@ -700,20 +840,20 @@ class Dt {
|
|
|
700
840
|
widthMm: n.widthMm ?? 180,
|
|
701
841
|
dataset: t,
|
|
702
842
|
columns: r,
|
|
703
|
-
...
|
|
843
|
+
...o
|
|
704
844
|
}), this;
|
|
705
845
|
}
|
|
706
846
|
rect(t, n = {}) {
|
|
707
847
|
return this.components.push({ kind: "rect", ...t, style: n }), this;
|
|
708
848
|
}
|
|
709
|
-
line(t, n, r,
|
|
849
|
+
line(t, n, r, o = {}) {
|
|
710
850
|
return this.components.push({
|
|
711
851
|
kind: "line",
|
|
712
852
|
leftMm: t,
|
|
713
853
|
topMm: n,
|
|
714
854
|
widthMm: r,
|
|
715
855
|
heightMm: 0.5,
|
|
716
|
-
style:
|
|
856
|
+
style: o
|
|
717
857
|
}), this;
|
|
718
858
|
}
|
|
719
859
|
barcode(t, n) {
|
|
@@ -726,11 +866,11 @@ class Dt {
|
|
|
726
866
|
fallbackText: t
|
|
727
867
|
}), this;
|
|
728
868
|
}
|
|
729
|
-
qrcode(t, n, r,
|
|
869
|
+
qrcode(t, n, r, o) {
|
|
730
870
|
return this.components.push({
|
|
731
871
|
kind: "qrcode",
|
|
732
872
|
leftMm: r,
|
|
733
|
-
topMm:
|
|
873
|
+
topMm: o,
|
|
734
874
|
widthMm: n,
|
|
735
875
|
heightMm: n,
|
|
736
876
|
fallbackText: t
|
|
@@ -746,26 +886,27 @@ class Dt {
|
|
|
746
886
|
return this.done().build();
|
|
747
887
|
}
|
|
748
888
|
}
|
|
749
|
-
function
|
|
750
|
-
return new
|
|
889
|
+
function Cr() {
|
|
890
|
+
return new dn();
|
|
751
891
|
}
|
|
752
|
-
function
|
|
753
|
-
return
|
|
892
|
+
function Tr(e, t = {}) {
|
|
893
|
+
return Ct([], e), e.fields.map((n) => ({
|
|
754
894
|
field: n.field,
|
|
755
895
|
header: `${n.label ?? n.field}${n.unit ? ` (${n.unit})` : ""}`,
|
|
756
896
|
semanticRole: n.semanticRole ?? (n.type === "number" || n.type === "decimal" ? "measure" : n.type === "date" ? "date" : n.enum ? "dimension" : "text"),
|
|
897
|
+
...n.format ? { format: { ...n.format } } : {},
|
|
757
898
|
...t[n.field]
|
|
758
899
|
}));
|
|
759
900
|
}
|
|
760
|
-
function
|
|
901
|
+
function I(e, t, n = !1) {
|
|
761
902
|
if (!Number.isFinite(e) || (n ? e < 0 : e <= 0))
|
|
762
903
|
throw new Error(`${t} 必须是有限${n ? "非负" : "正"}数`);
|
|
763
904
|
}
|
|
764
|
-
function
|
|
905
|
+
function ae(e, t, n) {
|
|
765
906
|
if (e !== void 0 && !["left", "center", "right", "justify", ...n ? ["auto"] : []].includes(e))
|
|
766
907
|
throw new Error(`${t} 必须是 left/center/right/justify${n ? "/auto" : ""}`);
|
|
767
908
|
}
|
|
768
|
-
function
|
|
909
|
+
function hn(e) {
|
|
769
910
|
const t = e.layout ?? "page";
|
|
770
911
|
if (t !== "page" && t !== "wide")
|
|
771
912
|
throw new Error("layout 必须是 page 或 wide");
|
|
@@ -774,18 +915,18 @@ function Ft(e) {
|
|
|
774
915
|
if (t !== "wide" && e.columnWidthMm !== void 0)
|
|
775
916
|
throw new Error('columnWidthMm 仅适用于 layout: "wide"');
|
|
776
917
|
const n = e.columnWidthMm ?? 30;
|
|
777
|
-
return
|
|
918
|
+
return I(n, "columnWidthMm"), { layout: t, columnWidthMm: n };
|
|
778
919
|
}
|
|
779
|
-
function
|
|
920
|
+
function fn(e) {
|
|
780
921
|
const t = e.paper === void 0 ? "a4" : e.paper;
|
|
781
922
|
if (typeof t != "string" && (typeof t != "object" || t === null) || e.landscape !== void 0 && typeof e.landscape != "boolean")
|
|
782
923
|
throw new Error("paper 必须是纸张预设名或 { widthMm, heightMm } 对象,landscape 必须是布尔值");
|
|
783
|
-
if (typeof t == "string" && !Object.prototype.hasOwnProperty.call(
|
|
784
|
-
throw new Error(`未知纸张预设 "${t}"(可用:${Object.keys(
|
|
785
|
-
const n =
|
|
786
|
-
return
|
|
924
|
+
if (typeof t == "string" && !Object.prototype.hasOwnProperty.call(ie, t))
|
|
925
|
+
throw new Error(`未知纸张预设 "${t}"(可用:${Object.keys(ie).join("/")})`);
|
|
926
|
+
const n = ut(t, void 0, e.landscape), r = n.widthMm, o = n.heightMm;
|
|
927
|
+
return I(r, "纸张 widthMm"), I(o, "纸张 heightMm"), { widthMm: r, heightMm: o };
|
|
787
928
|
}
|
|
788
|
-
function
|
|
929
|
+
function gn(e) {
|
|
789
930
|
if (e.margins !== void 0 && (!e.margins || typeof e.margins != "object" || Array.isArray(e.margins)))
|
|
790
931
|
throw new Error("margins 必须是页边距对象");
|
|
791
932
|
const t = e.margins ?? {}, n = {
|
|
@@ -794,760 +935,1057 @@ function zt(e) {
|
|
|
794
935
|
marginLeftMm: t.marginLeftMm === void 0 ? 10 : t.marginLeftMm,
|
|
795
936
|
marginRightMm: t.marginRightMm === void 0 ? 10 : t.marginRightMm
|
|
796
937
|
};
|
|
797
|
-
for (const [r,
|
|
938
|
+
for (const [r, o] of Object.entries(n)) I(o, r, !0);
|
|
798
939
|
return n;
|
|
799
940
|
}
|
|
800
|
-
function
|
|
941
|
+
function un(e, t) {
|
|
801
942
|
const n = e.dataset === void 0 ? "detail" : e.dataset;
|
|
802
943
|
if (typeof n != "string" || !n.trim())
|
|
803
944
|
throw new Error("dataset 必须是非空字符串");
|
|
804
945
|
if (e.title !== void 0 && typeof e.title != "string")
|
|
805
946
|
throw new Error("title 必须是字符串");
|
|
806
|
-
const r = e.titleHeightMm === void 0 ? 10 : e.titleHeightMm,
|
|
807
|
-
|
|
808
|
-
const
|
|
947
|
+
const r = e.titleHeightMm === void 0 ? 10 : e.titleHeightMm, o = e.titleGapMm === void 0 ? 4 : e.titleGapMm;
|
|
948
|
+
I(r, "titleHeightMm"), I(o, "titleGapMm", !0);
|
|
949
|
+
const i = e.title !== void 0 && e.title.length > 0, l = i ? r + o : 0;
|
|
809
950
|
if (l >= t)
|
|
810
951
|
throw new Error("标题高度与间距占满页面,必须为表格保留可用高度");
|
|
811
|
-
return { dataset: n, titleHeightMm: r, hasTitle:
|
|
952
|
+
return { dataset: n, titleHeightMm: r, hasTitle: i, titleSpaceMm: l };
|
|
812
953
|
}
|
|
813
|
-
function
|
|
954
|
+
function pn(e) {
|
|
814
955
|
if (e.listOptions !== void 0 && (!e.listOptions || typeof e.listOptions != "object" || Array.isArray(e.listOptions)))
|
|
815
956
|
throw new Error("listOptions 必须是列表配置对象");
|
|
816
957
|
const t = e.listOptions ?? {};
|
|
817
|
-
|
|
958
|
+
ae(t.align, "listOptions.align", !0), ae(t.headerAlign, "listOptions.headerAlign", !1);
|
|
818
959
|
for (const n of ["fontSizePt", "rowHeightMm", "paddingMm"]) {
|
|
819
960
|
const r = t[n];
|
|
820
|
-
r !== void 0 &&
|
|
961
|
+
r !== void 0 && I(r, `listOptions.${n}`, n === "paddingMm");
|
|
821
962
|
}
|
|
822
963
|
return t;
|
|
823
964
|
}
|
|
824
|
-
function
|
|
965
|
+
function wn(e) {
|
|
825
966
|
let t = 0, n = 0;
|
|
826
|
-
for (const [r,
|
|
827
|
-
if (!
|
|
967
|
+
for (const [r, o] of e.entries()) {
|
|
968
|
+
if (!o || typeof o.header != "string" || typeof o.field != "string" || !o.field.trim())
|
|
828
969
|
throw new Error(`columns[${r}] 需要字符串 header 与非空 field`);
|
|
829
|
-
|
|
970
|
+
ae(o.align, `columns[${r}].align`, !0), ae(o.headerAlign, `columns[${r}].headerAlign`, !1), o.flex !== void 0 && I(o.flex, `columns[${r}].flex`), o.widthMm !== void 0 ? (I(o.widthMm, `columns[${r}].widthMm`), t += o.widthMm) : n = Math.max(n, o.flex ?? 1);
|
|
830
971
|
}
|
|
831
972
|
return { fixedWidthMm: t, maxFlex: n };
|
|
832
973
|
}
|
|
833
|
-
function
|
|
834
|
-
const { fixedWidthMm:
|
|
835
|
-
if (t === "page" &&
|
|
836
|
-
throw new Error(`固定列宽 ${
|
|
837
|
-
const l = r -
|
|
838
|
-
if (t === "page" &&
|
|
974
|
+
function bn(e, t, n, r) {
|
|
975
|
+
const { fixedWidthMm: o, maxFlex: i } = wn(e.columns);
|
|
976
|
+
if (t === "page" && o > r)
|
|
977
|
+
throw new Error(`固定列宽 ${o}mm 超出页面可用宽度 ${r}mm`);
|
|
978
|
+
const l = r - o;
|
|
979
|
+
if (t === "page" && i > 0 && l <= 0)
|
|
839
980
|
throw new Error("固定列占满页面可用宽度,自动列需要正的剩余宽度");
|
|
840
|
-
const
|
|
841
|
-
return { columns: e.columns.map(({ widthMm: c, flex: d, ...
|
|
842
|
-
const
|
|
843
|
-
return
|
|
844
|
-
}), fixedWidthMm:
|
|
981
|
+
const s = i > 0 ? e.columns.reduce((c, d) => c + (d.widthMm === void 0 ? (d.flex ?? 1) / i : 0), 0) : 0;
|
|
982
|
+
return { columns: e.columns.map(({ widthMm: c, flex: d, ...m }, h) => {
|
|
983
|
+
const f = c ?? (t === "wide" ? n * (d ?? 1) : l * ((d ?? 1) / i) / s);
|
|
984
|
+
return I(f, `columns[${h}] 分配后的 widthMm`), { ...m, widthMm: f };
|
|
985
|
+
}), fixedWidthMm: o, maxFlex: i };
|
|
845
986
|
}
|
|
846
|
-
function
|
|
987
|
+
function Rr(e) {
|
|
847
988
|
if (!e || typeof e != "object")
|
|
848
989
|
throw new Error("标准明细模板需要 options 对象");
|
|
849
990
|
if (!Array.isArray(e.columns) || e.columns.length === 0)
|
|
850
991
|
throw new Error("columns 至少需要一列");
|
|
851
|
-
const { layout: t, columnWidthMm: n } =
|
|
852
|
-
let
|
|
853
|
-
const
|
|
854
|
-
let
|
|
855
|
-
const
|
|
856
|
-
if (t === "page" &&
|
|
992
|
+
const { layout: t, columnWidthMm: n } = hn(e), r = fn(e);
|
|
993
|
+
let o = r.widthMm;
|
|
994
|
+
const i = r.heightMm, l = gn(e);
|
|
995
|
+
let s = o - l.marginLeftMm - l.marginRightMm;
|
|
996
|
+
const a = i - l.marginTopMm - l.marginBottomMm;
|
|
997
|
+
if (t === "page" && s <= 0 || a <= 0)
|
|
857
998
|
throw new Error("页边距占满纸张,必须保留正的可用宽度和高度");
|
|
858
|
-
const { dataset: c, titleHeightMm: d, hasTitle:
|
|
859
|
-
t === "wide" && (
|
|
860
|
-
const b = { widthMm:
|
|
861
|
-
return
|
|
999
|
+
const { dataset: c, titleHeightMm: d, hasTitle: m, titleSpaceMm: h } = un(e, a), f = pn(e), { columns: g, fixedWidthMm: C, maxFlex: S } = bn(e, t, n, s);
|
|
1000
|
+
t === "wide" && (s = g.reduce((M, w) => M + w.widthMm, 0), I(s, "宽表总列宽"), o = s + l.marginLeftMm + l.marginRightMm, I(o, "宽表总宽度"));
|
|
1001
|
+
const b = { widthMm: o, heightMm: i, ...l, components: [], ...t === "wide" ? { layout: t } : {} };
|
|
1002
|
+
return m && b.components.push({
|
|
862
1003
|
kind: "text",
|
|
863
1004
|
text: e.title,
|
|
864
1005
|
leftMm: l.marginLeftMm,
|
|
865
1006
|
topMm: l.marginTopMm,
|
|
866
|
-
widthMm:
|
|
1007
|
+
widthMm: s,
|
|
867
1008
|
heightMm: d,
|
|
868
1009
|
style: { fontSize: 16, bold: !0, align: "center", verticalAlign: "middle", ...e.titleStyle }
|
|
869
1010
|
}), b.components.push({
|
|
870
1011
|
align: "auto",
|
|
871
1012
|
headerAlign: "center",
|
|
872
|
-
...
|
|
1013
|
+
...f,
|
|
873
1014
|
kind: "list",
|
|
874
1015
|
...t === "wide" ? { layout: t } : {},
|
|
875
|
-
...
|
|
1016
|
+
...m ? { title: e.title } : {},
|
|
876
1017
|
dataset: c,
|
|
877
|
-
columns:
|
|
1018
|
+
columns: g,
|
|
878
1019
|
leftMm: l.marginLeftMm,
|
|
879
|
-
topMm: l.marginTopMm +
|
|
880
|
-
widthMm: t === "wide" ||
|
|
1020
|
+
topMm: l.marginTopMm + h,
|
|
1021
|
+
widthMm: t === "wide" || S > 0 ? s : C
|
|
881
1022
|
}), e.params === void 0 ? { pages: [b] } : { params: e.params, pages: [b] };
|
|
882
1023
|
}
|
|
883
|
-
function
|
|
1024
|
+
function Pr(e) {
|
|
884
1025
|
if (e.components !== void 0 && e.pages !== void 0) throw new TypeError("标签 components 与 pages 只能选择一种");
|
|
885
|
-
const { dataset: t, rowKey: n, copies: r, params:
|
|
1026
|
+
const { dataset: t, rowKey: n, copies: r, params: o } = e, i = e.pages ?? [{ components: e.components ?? [] }], l = {
|
|
886
1027
|
repeat: { dataset: t, ...n === void 0 ? {} : { rowKey: n }, ...r === void 0 ? {} : { copies: r } },
|
|
887
|
-
...
|
|
888
|
-
pages:
|
|
889
|
-
widthMm:
|
|
890
|
-
heightMm:
|
|
1028
|
+
...o === void 0 ? {} : { params: o },
|
|
1029
|
+
pages: i.map((a) => ({
|
|
1030
|
+
widthMm: a.widthMm ?? e.widthMm ?? 80,
|
|
1031
|
+
heightMm: a.heightMm ?? e.heightMm ?? 55,
|
|
891
1032
|
marginTopMm: 0,
|
|
892
1033
|
marginRightMm: 0,
|
|
893
1034
|
marginBottomMm: 0,
|
|
894
1035
|
marginLeftMm: 0,
|
|
895
|
-
components:
|
|
896
|
-
...
|
|
1036
|
+
components: a.components,
|
|
1037
|
+
...a.meta === void 0 ? {} : { meta: a.meta }
|
|
897
1038
|
}))
|
|
898
|
-
},
|
|
899
|
-
if (!
|
|
1039
|
+
}, s = Xe(l);
|
|
1040
|
+
if (!s.ok) throw new Ze(s.errors);
|
|
900
1041
|
return JSON.parse(JSON.stringify(l));
|
|
901
1042
|
}
|
|
902
|
-
function
|
|
1043
|
+
function yn(e) {
|
|
903
1044
|
if (!e || typeof e != "object" || !e.repeat)
|
|
904
|
-
throw new
|
|
905
|
-
const t =
|
|
906
|
-
if (!t.ok) throw new
|
|
1045
|
+
throw new ve("config", "defineLabelReport 需要带 repeat 的固定标签模板");
|
|
1046
|
+
const t = Xe(e);
|
|
1047
|
+
if (!t.ok) throw new Ze(t.errors);
|
|
907
1048
|
return e.repeat.dataset;
|
|
908
1049
|
}
|
|
909
|
-
function
|
|
910
|
-
if (!Array.isArray(e)) throw new
|
|
1050
|
+
function He(e, t) {
|
|
1051
|
+
if (!Array.isArray(e)) throw new ve("validate", "标签数据应为对象数组;请从业务响应中提取行数组");
|
|
911
1052
|
return { [t]: e };
|
|
912
1053
|
}
|
|
913
|
-
function
|
|
914
|
-
const { template: t, rows: n, load: r, dataSchema:
|
|
1054
|
+
function $r(e) {
|
|
1055
|
+
const { template: t, rows: n, load: r, dataSchema: o, params: i, pagination: l, dataValidation: s } = e, a = yn(t);
|
|
915
1056
|
if (n !== void 0 == (r !== void 0) || r !== void 0 && typeof r != "function")
|
|
916
|
-
throw new
|
|
917
|
-
const c = { template: t, params:
|
|
918
|
-
return r ?
|
|
1057
|
+
throw new ve("config", "标签报表应且只能配置 rows 或 load 其中一种数据来源");
|
|
1058
|
+
const c = { template: t, params: i, pagination: l, dataValidation: s, ...o === void 0 ? {} : { dataSchema: { [a]: o } } };
|
|
1059
|
+
return r ? Tt({ ...c, load: r, mapData: (d) => He(d, a) }) : { ...c, datasets: He(n, a) };
|
|
919
1060
|
}
|
|
920
|
-
function
|
|
1061
|
+
function kr(e) {
|
|
921
1062
|
return e;
|
|
922
1063
|
}
|
|
923
|
-
class
|
|
1064
|
+
class j extends Error {
|
|
1065
|
+
constructor(t, n) {
|
|
1066
|
+
super(n), this.code = t, this.name = "ReportTemplateMigrationError";
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
function Be(e) {
|
|
1070
|
+
let t = e;
|
|
1071
|
+
if (typeof t == "string") {
|
|
1072
|
+
if (t.length > 1e7) throw new j("result", "模板迁移输入超过预算");
|
|
1073
|
+
try {
|
|
1074
|
+
t = JSON.parse(t);
|
|
1075
|
+
} catch {
|
|
1076
|
+
throw new j("result", "模板 JSON 语法无效");
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
const n = et(t, { maxBytes: 1e7, error: (r, o) => new j("result", o) });
|
|
1080
|
+
if (!n || typeof n != "object" || Array.isArray(n)) throw new j("result", "模板迁移应返回文档对象");
|
|
1081
|
+
return n;
|
|
1082
|
+
}
|
|
1083
|
+
function Mn(e) {
|
|
1084
|
+
if (!Array.isArray(e) || e.length > 32) throw new j("definition", "模板迁移最多声明 32 步");
|
|
1085
|
+
const t = /* @__PURE__ */ new Map();
|
|
1086
|
+
for (const n of e) {
|
|
1087
|
+
if (!n || ![n.from, n.to].every((r) => typeof r == "string" && r.trim() && r.length <= 64) || n.from === n.to || t.has(n.from) || typeof n.migrate != "function" || n.from === pe) throw new j("definition", "迁移起点应唯一,不得从当前版本降级");
|
|
1088
|
+
t.set(n.from, { ...n });
|
|
1089
|
+
}
|
|
1090
|
+
for (const n of t.keys()) {
|
|
1091
|
+
const r = /* @__PURE__ */ new Set();
|
|
1092
|
+
let o = n;
|
|
1093
|
+
for (; t.has(o); ) {
|
|
1094
|
+
if (r.has(o)) throw new j("definition", "模板迁移链存在循环");
|
|
1095
|
+
r.add(o), o = t.get(o).to;
|
|
1096
|
+
}
|
|
1097
|
+
if (o !== pe) throw new j("definition", "每条迁移链应到达当前模板版本");
|
|
1098
|
+
}
|
|
1099
|
+
return t;
|
|
1100
|
+
}
|
|
1101
|
+
function vn(e = []) {
|
|
1102
|
+
const t = Mn(e);
|
|
1103
|
+
return async (n) => {
|
|
1104
|
+
let r = Be(n);
|
|
1105
|
+
const o = [];
|
|
1106
|
+
for (; r.schemaVersion !== pe; ) {
|
|
1107
|
+
const i = typeof r.schemaVersion == "string" ? t.get(r.schemaVersion) : void 0;
|
|
1108
|
+
if (!i) throw new j("unsupported", "未声明此模板版本的迁移路径");
|
|
1109
|
+
const l = r.id, s = Be(await i.migrate(r));
|
|
1110
|
+
if (s.schemaVersion !== i.to || typeof l == "string" && s.id !== l) throw new j("result", "迁移结果版本不匹配或改变了模板身份");
|
|
1111
|
+
o.push({ from: i.from, to: i.to }), r = s;
|
|
1112
|
+
}
|
|
1113
|
+
return { document: re(r), steps: o };
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
class F extends Error {
|
|
924
1117
|
constructor(t, n) {
|
|
925
1118
|
super(n), this.code = t, this.name = "ReportTemplateStoreError";
|
|
926
1119
|
}
|
|
927
1120
|
}
|
|
928
|
-
function
|
|
1121
|
+
function O(e) {
|
|
929
1122
|
return JSON.parse(JSON.stringify(e));
|
|
930
1123
|
}
|
|
931
|
-
function
|
|
1124
|
+
function T(e) {
|
|
932
1125
|
if (!e?.aborted) return;
|
|
933
1126
|
const t = new Error("模板操作已取消");
|
|
934
1127
|
throw t.name = "AbortError", t;
|
|
935
1128
|
}
|
|
936
|
-
function
|
|
1129
|
+
function _e(e) {
|
|
937
1130
|
const t = e ? Number(e.revision) : 0;
|
|
938
|
-
if (!Number.isSafeInteger(t) || t < 0 || t >= Number.MAX_SAFE_INTEGER) throw new
|
|
1131
|
+
if (!Number.isSafeInteger(t) || t < 0 || t >= Number.MAX_SAFE_INTEGER) throw new F("history", "修订号无效或已达上限");
|
|
939
1132
|
return String(t + 1);
|
|
940
1133
|
}
|
|
941
|
-
function
|
|
942
|
-
const n = async (
|
|
943
|
-
|
|
944
|
-
const
|
|
945
|
-
return
|
|
946
|
-
},
|
|
947
|
-
const
|
|
948
|
-
if ((
|
|
949
|
-
return
|
|
950
|
-
},
|
|
951
|
-
if (
|
|
952
|
-
return
|
|
953
|
-
},
|
|
1134
|
+
function Ar(e, t = {}) {
|
|
1135
|
+
const n = t.migrations ? vn(t.migrations) : void 0, r = async (a) => n ? (await n(a)).document : re(a), o = async (a, c) => {
|
|
1136
|
+
T(c);
|
|
1137
|
+
const d = await e.read(a, c);
|
|
1138
|
+
return T(c), d ? O(d) : void 0;
|
|
1139
|
+
}, i = async (a, c) => {
|
|
1140
|
+
const d = await o(a, c.signal);
|
|
1141
|
+
if ((d?.revision ?? null) !== c.expectedRevision) throw new F("conflict", "模板已变化,请重新读取后提交");
|
|
1142
|
+
return d;
|
|
1143
|
+
}, l = async (a, c, d) => {
|
|
1144
|
+
if (T(c.signal), !await e.compareAndSwap(a.id, c.expectedRevision, O(a), { signal: c.signal, ...d ? { publication: O(d) } : {} })) throw new F("conflict", "模板已被其他请求更新");
|
|
1145
|
+
return O(a);
|
|
1146
|
+
}, s = async (a, c, d, m) => {
|
|
954
1147
|
if (t.beforePublish) {
|
|
955
|
-
|
|
956
|
-
const
|
|
957
|
-
|
|
958
|
-
S(
|
|
1148
|
+
T(d.signal);
|
|
1149
|
+
const C = a.published ? await r(a.published) : void 0;
|
|
1150
|
+
T(d.signal);
|
|
1151
|
+
const S = await t.beforePublish({ document: re(c), previous: C, signal: d.signal });
|
|
1152
|
+
if (!S || S.ok !== !0) throw new F("review", S?.issues?.find((b) => b.severity === "error")?.message ?? "模板发布检查未通过");
|
|
1153
|
+
T(d.signal);
|
|
959
1154
|
}
|
|
960
|
-
const
|
|
961
|
-
return
|
|
1155
|
+
const h = _e(a), f = re({ ...c, revision: h }), g = { revision: h, document: f, publishedAt: (t.now?.() ?? /* @__PURE__ */ new Date()).toISOString() };
|
|
1156
|
+
return m !== void 0 && (g.restoredFrom = m), l({ id: a.id, revision: h, publishedRevision: h, published: f }, d, g);
|
|
962
1157
|
};
|
|
963
1158
|
return {
|
|
964
|
-
list: async (
|
|
965
|
-
|
|
966
|
-
const
|
|
967
|
-
return
|
|
1159
|
+
list: async (a) => {
|
|
1160
|
+
T(a);
|
|
1161
|
+
const c = await e.list(a);
|
|
1162
|
+
return T(a), O(c);
|
|
968
1163
|
},
|
|
969
|
-
get: async (
|
|
970
|
-
const
|
|
971
|
-
return
|
|
1164
|
+
get: async (a, c = {}) => {
|
|
1165
|
+
const d = await o(a, c.signal), m = c.draft ? d?.draft : d?.published, h = m ? await r(m) : void 0;
|
|
1166
|
+
return T(c.signal), h;
|
|
972
1167
|
},
|
|
973
|
-
history: async (
|
|
974
|
-
|
|
975
|
-
const
|
|
976
|
-
return
|
|
1168
|
+
history: async (a, c) => {
|
|
1169
|
+
T(c);
|
|
1170
|
+
const d = await e.history(a, c);
|
|
1171
|
+
return T(c), O(d);
|
|
977
1172
|
},
|
|
978
|
-
saveDraft: async (
|
|
979
|
-
|
|
980
|
-
const
|
|
981
|
-
return
|
|
982
|
-
id:
|
|
983
|
-
revision:
|
|
984
|
-
draft: { ...
|
|
985
|
-
...
|
|
986
|
-
},
|
|
1173
|
+
saveDraft: async (a, c) => {
|
|
1174
|
+
c = { ...c }, T(c.signal);
|
|
1175
|
+
const d = await r(t.migrate ? await t.migrate(a) : a), m = await i(d.id, c), h = _e(m);
|
|
1176
|
+
return l({
|
|
1177
|
+
id: d.id,
|
|
1178
|
+
revision: h,
|
|
1179
|
+
draft: { ...d, revision: h },
|
|
1180
|
+
...m?.publishedRevision ? { publishedRevision: m.publishedRevision, published: m.published } : {}
|
|
1181
|
+
}, c);
|
|
987
1182
|
},
|
|
988
|
-
publish: async (
|
|
989
|
-
|
|
990
|
-
const
|
|
991
|
-
if (!
|
|
992
|
-
if (!
|
|
993
|
-
return
|
|
1183
|
+
publish: async (a, c) => {
|
|
1184
|
+
c = { ...c };
|
|
1185
|
+
const d = await i(a, c);
|
|
1186
|
+
if (!d) throw new F("missing", "模板不存在");
|
|
1187
|
+
if (!d.draft) throw new F("draft", "没有可发布的草稿");
|
|
1188
|
+
return s(d, await r(d.draft), c);
|
|
994
1189
|
},
|
|
995
|
-
rollback: async (
|
|
996
|
-
|
|
997
|
-
const
|
|
998
|
-
if (!
|
|
999
|
-
|
|
1000
|
-
const
|
|
1001
|
-
if (!
|
|
1002
|
-
return
|
|
1190
|
+
rollback: async (a, c, d) => {
|
|
1191
|
+
d = { ...d };
|
|
1192
|
+
const m = await i(a, d);
|
|
1193
|
+
if (!m) throw new F("missing", "模板不存在");
|
|
1194
|
+
T(d.signal);
|
|
1195
|
+
const h = await e.getVersion(a, c, d.signal);
|
|
1196
|
+
if (!h) throw new F("history", "历史修订不存在");
|
|
1197
|
+
return s(m, await r(h.document), d, c);
|
|
1003
1198
|
}
|
|
1004
1199
|
};
|
|
1005
1200
|
}
|
|
1006
|
-
function
|
|
1201
|
+
function Ir() {
|
|
1007
1202
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
|
|
1008
1203
|
return {
|
|
1009
1204
|
read: async (n, r) => {
|
|
1010
|
-
|
|
1011
|
-
const
|
|
1012
|
-
return
|
|
1205
|
+
T(r);
|
|
1206
|
+
const o = e.get(n);
|
|
1207
|
+
return o ? O(o) : void 0;
|
|
1013
1208
|
},
|
|
1014
|
-
list: async (n) => (
|
|
1015
|
-
history: async (n, r) => (
|
|
1016
|
-
getVersion: async (n, r,
|
|
1017
|
-
|
|
1018
|
-
const
|
|
1019
|
-
return
|
|
1209
|
+
list: async (n) => (T(n), Array.from(e.values(), ({ id: r, revision: o, publishedRevision: i }) => ({ id: r, revision: o, ...i ? { publishedRevision: i } : {} }))),
|
|
1210
|
+
history: async (n, r) => (T(r), Array.from(t.get(n)?.values() ?? [], (o) => O(o))),
|
|
1211
|
+
getVersion: async (n, r, o) => {
|
|
1212
|
+
T(o);
|
|
1213
|
+
const i = t.get(n)?.get(r);
|
|
1214
|
+
return i ? O(i) : void 0;
|
|
1020
1215
|
},
|
|
1021
|
-
compareAndSwap: async (n, r,
|
|
1022
|
-
if (
|
|
1023
|
-
if (
|
|
1024
|
-
const l =
|
|
1025
|
-
if (
|
|
1026
|
-
const
|
|
1027
|
-
if (
|
|
1028
|
-
|
|
1216
|
+
compareAndSwap: async (n, r, o, i) => {
|
|
1217
|
+
if (T(i.signal), (e.get(n)?.revision ?? null) !== r) return !1;
|
|
1218
|
+
if (o.id !== n) throw new F("history", "状态 ID 与存储 ID 不一致");
|
|
1219
|
+
const l = O(o), s = i.publication;
|
|
1220
|
+
if (s) {
|
|
1221
|
+
const a = t.get(n) ?? /* @__PURE__ */ new Map();
|
|
1222
|
+
if (a.has(s.revision) || s.revision !== o.revision || s.document.id !== n) throw new F("history", "发布修订不可覆盖,且必须与状态修订和模板 ID 一致");
|
|
1223
|
+
a.set(s.revision, O(s)), t.set(n, a);
|
|
1029
1224
|
}
|
|
1030
1225
|
return e.set(n, l), !0;
|
|
1031
1226
|
}
|
|
1032
1227
|
};
|
|
1033
1228
|
}
|
|
1034
|
-
|
|
1229
|
+
class u extends Error {
|
|
1230
|
+
constructor(t, n, r = "$", o) {
|
|
1231
|
+
super(n), this.code = t, this.path = r, this.extensionId = o, this.name = "ReportComponentExtensionError";
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
const xn = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
1235
|
+
function K(e, t = "$", n = { nodes: 0, units: 0 }, r = 0) {
|
|
1236
|
+
if (++n.nodes > 2048 || r > 16) throw new u("binding", "Component extension JSON exceeds its depth/node budget.", t);
|
|
1237
|
+
if (n.units > 64 * 1024) throw new u("binding", "Component extension JSON exceeds 64 Ki UTF-16 units.", t);
|
|
1238
|
+
if (e === null || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e)) return e;
|
|
1239
|
+
if (typeof e == "string") {
|
|
1240
|
+
if (n.units += e.length, n.units > 64 * 1024) throw new u("binding", "Component extension JSON exceeds 64 Ki UTF-16 units.", t);
|
|
1241
|
+
return e;
|
|
1242
|
+
}
|
|
1243
|
+
if (!e || typeof e != "object") throw new u("binding", "Component extension values must be finite JSON data.", t);
|
|
1244
|
+
const o = Object.getPrototypeOf(e);
|
|
1245
|
+
if (Array.isArray(e)) return Sn(e, t, n, r);
|
|
1246
|
+
if (o !== Object.prototype && o !== null) throw new u("binding", "Component extension values must be plain JSON objects.", t);
|
|
1247
|
+
return En(e, t, n, r);
|
|
1248
|
+
}
|
|
1249
|
+
function $e(e, t, n) {
|
|
1250
|
+
const r = Object.getOwnPropertyDescriptor(e, t);
|
|
1251
|
+
if (typeof t != "string" || xn.has(t) || !r?.enumerable || r.get || r.set)
|
|
1252
|
+
throw new u("binding", "Component extension JSON contains an unsafe key or accessor.", n);
|
|
1253
|
+
return r.value;
|
|
1254
|
+
}
|
|
1255
|
+
function Sn(e, t, n, r) {
|
|
1256
|
+
if (Object.getPrototypeOf(e) !== Array.prototype || e.length > 2048 || Reflect.ownKeys(e).length !== e.length + 1) throw new u("binding", "Component extension arrays must be plain dense JSON arrays.", t);
|
|
1257
|
+
return Object.freeze(Array.from({ length: e.length }, (o, i) => K($e(e, String(i), `${t}[${i}]`), `${t}[${i}]`, n, r + 1)));
|
|
1258
|
+
}
|
|
1259
|
+
function En(e, t, n, r) {
|
|
1260
|
+
const o = Reflect.ownKeys(e);
|
|
1261
|
+
if (o.length > 2048) throw new u("binding", "Component extension JSON exceeds its node budget.", t);
|
|
1262
|
+
const i = o.map((l) => {
|
|
1263
|
+
const s = `${t}.${String(l)}`, a = $e(e, l, s);
|
|
1264
|
+
return n.units += String(l).length, [l, K(a, s, n, r + 1)];
|
|
1265
|
+
});
|
|
1266
|
+
return Object.freeze(Object.fromEntries(i));
|
|
1267
|
+
}
|
|
1268
|
+
function Q(e, t) {
|
|
1269
|
+
if (!e || typeof e != "object" || Array.isArray(e)) throw new u("binding", "Expected a component extension object.", t);
|
|
1270
|
+
return e;
|
|
1271
|
+
}
|
|
1272
|
+
function me(e, t, n) {
|
|
1273
|
+
for (const r of Object.keys(e)) if (!t.includes(r)) throw new u("binding", "Unknown component extension property.", `${n}.${r}`);
|
|
1274
|
+
}
|
|
1275
|
+
function be(e, t, n = 160) {
|
|
1276
|
+
if (typeof e != "string" || !e.trim() || e.length > n) throw new u("definition", "Component extension labels must be bounded nonempty strings.", t);
|
|
1277
|
+
}
|
|
1278
|
+
function pt(e, t) {
|
|
1279
|
+
if (typeof e != "string" || !/^[a-z][a-z\d_.-]{0,127}$/i.test(e)) throw new u("definition", "Invalid component extension id.", "$.id");
|
|
1280
|
+
if (typeof t != "string" || t.length > 64 || !/^\d+\.\d+\.\d+(?:-[\da-z.-]+)?(?:\+[\da-z.-]+)?$/i.test(t)) throw new u("definition", "Component extension version must be explicit semantic version text.", "$.version", e);
|
|
1281
|
+
}
|
|
1282
|
+
function ke(e, t, n) {
|
|
1283
|
+
if (!(e === null && !t.required)) {
|
|
1284
|
+
if (typeof e !== t.type || typeof e == "number" && !Number.isFinite(e)) throw new u("binding", `Expected ${t.type} component property.`, n);
|
|
1285
|
+
if (t.options && !t.options.some((r) => Object.is(r, e))) throw new u("binding", "Component property is outside its declared options.", n);
|
|
1286
|
+
if (typeof e == "number" && (e < (t.min ?? -1 / 0) || e > (t.max ?? 1 / 0))) throw new u("binding", "Component property is outside its declared range.", n);
|
|
1287
|
+
if (typeof e == "string" && e.length > (t.maxLength ?? 64 * 1024)) throw new u("binding", "Component property exceeds maxLength.", n);
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
function Cn(e, t) {
|
|
1291
|
+
const n = Q(e, t);
|
|
1292
|
+
me(n, ["label", "type", "required", "default", "options", "min", "max", "maxLength"], t);
|
|
1293
|
+
const r = n;
|
|
1294
|
+
if (be(r.label, `${t}.label`), !["string", "number", "boolean"].includes(r.type)) throw new u("definition", "Unknown component property type.", t);
|
|
1295
|
+
if (r.required !== void 0 && typeof r.required != "boolean") throw new u("definition", "Component property required must be boolean.", t);
|
|
1296
|
+
Tn(r, t), r.default !== void 0 && ke(r.default, r, `${t}.default`);
|
|
1297
|
+
}
|
|
1298
|
+
function Tn(e, t) {
|
|
1299
|
+
for (const n of ["min", "max"]) if (e[n] !== void 0 && (e.type !== "number" || !Number.isFinite(e[n]))) throw new u("definition", "Numeric property bounds must be finite numbers.", t);
|
|
1300
|
+
if ((e.min ?? -1 / 0) > (e.max ?? 1 / 0)) throw new u("definition", "Component property min exceeds max.", t);
|
|
1301
|
+
if (e.maxLength !== void 0 && (e.type !== "string" || !Number.isSafeInteger(e.maxLength) || e.maxLength < 0 || e.maxLength > 64 * 1024)) throw new u("definition", "Invalid component property maxLength.", t);
|
|
1302
|
+
if (e.options !== void 0) {
|
|
1303
|
+
if (!Array.isArray(e.options) || !e.options.length || e.options.length > 64) throw new u("definition", "Component property options must contain 1 to 64 values.", t);
|
|
1304
|
+
for (const n of e.options) ke(n, { ...e, options: void 0 }, `${t}.options`);
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
function Rn(e) {
|
|
1308
|
+
const t = Object.getPrototypeOf(e);
|
|
1309
|
+
if (t !== Object.prototype && t !== null) throw new u("definition", "Component extension metadata must be a plain object.");
|
|
1310
|
+
const n = Reflect.ownKeys(e).filter((o) => o !== "load").map((o) => [o, $e(e, o, `$.${String(o)}`)]), r = K(Object.fromEntries(n));
|
|
1311
|
+
if (me(r, ["id", "version", "kind", "label", "description", "properties"], "$"), pt(r.id, r.version), be(r.label, "$.label"), !["image", "chart", "barcode", "qrcode"].includes(r.kind)) throw new u("definition", "Extension kind must use the existing image-backed output pipeline.", "$.kind");
|
|
1312
|
+
if (r.description !== void 0 && be(r.description, "$.description", 2048), r.properties !== void 0) {
|
|
1313
|
+
const o = Q(r.properties, "$.properties");
|
|
1314
|
+
if (Object.keys(o).length > 64) throw new u("definition", "Component extension supports at most 64 properties.", "$.properties");
|
|
1315
|
+
for (const [i, l] of Object.entries(o)) Cn(l, `$.properties.${i}`);
|
|
1316
|
+
}
|
|
1317
|
+
return r;
|
|
1318
|
+
}
|
|
1319
|
+
function wt(e, t) {
|
|
1320
|
+
const n = Q(K(t ?? {}), "$.props"), r = {};
|
|
1321
|
+
for (const o of Object.keys(n)) if (!Object.prototype.hasOwnProperty.call(e.properties ?? {}, o)) throw new u("binding", "Unknown component property.", `$.props.${o}`, e.id);
|
|
1322
|
+
for (const [o, i] of Object.entries(e.properties ?? {})) {
|
|
1323
|
+
const l = Object.prototype.hasOwnProperty.call(n, o) ? n[o] : i.default;
|
|
1324
|
+
if (l === void 0) {
|
|
1325
|
+
if (i.required) throw new u("binding", "Required component property is missing.", `$.props.${o}`, e.id);
|
|
1326
|
+
continue;
|
|
1327
|
+
}
|
|
1328
|
+
ke(l, i, `$.props.${o}`), r[o] = l;
|
|
1329
|
+
}
|
|
1330
|
+
return Object.freeze(r);
|
|
1331
|
+
}
|
|
1332
|
+
const H = "componentExtension";
|
|
1333
|
+
function Pn(e) {
|
|
1334
|
+
const t = Object.getOwnPropertyDescriptor(e, "meta")?.value, n = t && Object.getOwnPropertyDescriptor(t, H);
|
|
1335
|
+
if (n) {
|
|
1336
|
+
if (n.get || n.set) throw new u("binding", "Component extension binding cannot be an accessor.", `$.meta.${H}`);
|
|
1337
|
+
return n.value;
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
function $n(e, t) {
|
|
1341
|
+
const n = Q(K(Pn(t)), `$.meta.${H}`);
|
|
1342
|
+
me(n, ["id", "version", "props", "binding"], `$.meta.${H}`), pt(n.id, n.version);
|
|
1343
|
+
const r = e.get(n.id);
|
|
1344
|
+
if (!r) throw new u("binding", "Component extension is not registered in this runtime.", `$.meta.${H}.id`, n.id);
|
|
1345
|
+
if (r.metadata.version !== n.version || r.metadata.kind !== t.kind) throw new u("binding", "Component extension version or image kind does not match its registration.", `$.meta.${H}`, r.metadata.id);
|
|
1346
|
+
const o = Object.freeze({ id: r.metadata.id, version: r.metadata.version, props: wt(r.metadata, n.props), ...n.binding === void 0 ? {} : { binding: n.binding } });
|
|
1347
|
+
return { entry: r, extension: o };
|
|
1348
|
+
}
|
|
1349
|
+
function We(e) {
|
|
1350
|
+
return e.released ??= Promise.resolve().then(() => e.renderer?.dispose?.());
|
|
1351
|
+
}
|
|
1352
|
+
function U(e) {
|
|
1353
|
+
if (e) throw new u("disposed", "Component registry has been disposed.");
|
|
1354
|
+
}
|
|
1355
|
+
function kn(e) {
|
|
1356
|
+
if (!e || typeof e != "object") throw new u("definition", "Component extension definition must be an object.");
|
|
1357
|
+
if (Object.getPrototypeOf(e) !== Object.prototype && Object.getPrototypeOf(e) !== null) throw new u("definition", "Component extension definition must be a plain object.");
|
|
1358
|
+
const t = Object.getOwnPropertyDescriptor(e, "load");
|
|
1359
|
+
if (!t || t.get || t.set || typeof t.value != "function") throw new u("definition", "Component extension needs a trusted runtime loader.", "$.load");
|
|
1360
|
+
return { metadata: Rn(e), load: t.value };
|
|
1361
|
+
}
|
|
1362
|
+
function An(e, t) {
|
|
1363
|
+
if (!(e && typeof e.render == "function" && (e.dispose === void 0 || typeof e.dispose == "function"))) {
|
|
1364
|
+
if (e && typeof e.dispose == "function")
|
|
1365
|
+
try {
|
|
1366
|
+
Promise.resolve(e.dispose()).catch(() => {
|
|
1367
|
+
});
|
|
1368
|
+
} catch {
|
|
1369
|
+
}
|
|
1370
|
+
throw new u("load", "Component loader must return render and optional dispose methods.", "$.load", t);
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
function In(e, t) {
|
|
1374
|
+
const n = new AbortController(), r = () => n.abort(e.reason), o = () => n.abort(t.reason);
|
|
1375
|
+
return e.aborted ? r() : e.addEventListener("abort", r, { once: !0 }), t.aborted ? o() : t.addEventListener("abort", o, { once: !0 }), { signal: n.signal, dispose() {
|
|
1376
|
+
e.removeEventListener("abort", r), t.removeEventListener("abort", o);
|
|
1377
|
+
} };
|
|
1378
|
+
}
|
|
1379
|
+
function Or(e) {
|
|
1380
|
+
if (!Array.isArray(e) || e.length > 128) throw new u("definition", "Register at most 128 component extensions.");
|
|
1381
|
+
const t = /* @__PURE__ */ new Map(), n = new AbortController();
|
|
1382
|
+
let r = !1, o;
|
|
1383
|
+
for (const a of e) {
|
|
1384
|
+
const c = kn(a), d = c.metadata.id;
|
|
1385
|
+
if (t.has(d)) throw new u("definition", "Component extension id is already registered.", "$.id", d);
|
|
1386
|
+
t.set(d, c);
|
|
1387
|
+
}
|
|
1388
|
+
function i(a) {
|
|
1389
|
+
return U(r), a.pending || (a.pending = Promise.resolve().then(() => (U(r), a.load(n.signal))).then(async (c) => (An(c, a.metadata.id), a.renderer = c, r && (await We(a), U(r)), c)).catch((c) => {
|
|
1390
|
+
throw a.pending = void 0, c instanceof u ? c : Object.assign(new u("load", "Component extension loader failed.", "$.load", a.metadata.id), { cause: c });
|
|
1391
|
+
})), a.pending;
|
|
1392
|
+
}
|
|
1393
|
+
const l = async (a) => {
|
|
1394
|
+
U(r);
|
|
1395
|
+
const { entry: c, extension: d } = $n(t, a.component), m = In(a.signal, n.signal);
|
|
1396
|
+
try {
|
|
1397
|
+
const h = await De(i(c), m.signal);
|
|
1398
|
+
return await De(h.render({ ...a, signal: m.signal, extension: d }), m.signal);
|
|
1399
|
+
} finally {
|
|
1400
|
+
m.dispose();
|
|
1401
|
+
}
|
|
1402
|
+
}, s = {
|
|
1403
|
+
assets: Object.freeze({ get assetRegistry() {
|
|
1404
|
+
return s;
|
|
1405
|
+
} }),
|
|
1406
|
+
describe(a) {
|
|
1407
|
+
return U(r), Object.freeze([...t.values()].map((c) => c.metadata).filter((c) => !a || c.kind === a));
|
|
1408
|
+
},
|
|
1409
|
+
hasExtension(a, c, d) {
|
|
1410
|
+
const m = t.get(a)?.metadata;
|
|
1411
|
+
return !r && m?.version === c && m.kind === d;
|
|
1412
|
+
},
|
|
1413
|
+
rendererFor(a) {
|
|
1414
|
+
const c = Object.getOwnPropertyDescriptor(a, "meta")?.value;
|
|
1415
|
+
return c && Object.prototype.hasOwnProperty.call(c, H) ? l : void 0;
|
|
1416
|
+
},
|
|
1417
|
+
createComponent(a, c = {}) {
|
|
1418
|
+
U(r);
|
|
1419
|
+
const d = t.get(a);
|
|
1420
|
+
if (!d) throw new u("binding", "Component extension is not registered in this runtime.", "$.id", a);
|
|
1421
|
+
const m = Q(K(c), "$");
|
|
1422
|
+
me(m, ["props", "binding"], "$");
|
|
1423
|
+
const h = { id: a, version: d.metadata.version, props: wt(d.metadata, m.props), ...m.binding === void 0 ? {} : { binding: m.binding } };
|
|
1424
|
+
return { kind: d.metadata.kind, meta: { [H]: Object.freeze(h) } };
|
|
1425
|
+
},
|
|
1426
|
+
dispose() {
|
|
1427
|
+
return o || (r = !0, n.abort(new u("disposed", "Component registry has been disposed.")), o = Promise.allSettled([...t.values()].filter((a) => a.renderer).map(We)).then((a) => {
|
|
1428
|
+
const c = a.find((d) => d.status === "rejected");
|
|
1429
|
+
if (c?.status === "rejected") throw c.reason;
|
|
1430
|
+
}), o);
|
|
1431
|
+
}
|
|
1432
|
+
};
|
|
1433
|
+
return s;
|
|
1434
|
+
}
|
|
1435
|
+
function Nr(e) {
|
|
1035
1436
|
return e.map((t) => t.map((n) => /[\t\r\n"]/.test(n) ? `"${n.replace(/"/g, '""')}"` : n).join(" ")).join(`\r
|
|
1036
1437
|
`);
|
|
1037
1438
|
}
|
|
1038
|
-
function
|
|
1439
|
+
function On(e, t) {
|
|
1039
1440
|
const n = e[e.length - 1];
|
|
1040
1441
|
e.length > 1 && n?.length === 1 && n[0] === "" && /[\r\n]$/.test(t) && e.pop();
|
|
1041
1442
|
}
|
|
1042
|
-
function
|
|
1443
|
+
function Dr(e, t = 1e4) {
|
|
1043
1444
|
if (e.length > 4 * 1024 * 1024) throw new Error("Clipboard text limit exceeded");
|
|
1044
1445
|
const n = [[]];
|
|
1045
|
-
let r = "",
|
|
1046
|
-
function
|
|
1446
|
+
let r = "", o = !1, i = !1, l = 0;
|
|
1447
|
+
function s() {
|
|
1047
1448
|
if (++l > t) throw new Error("Clipboard cell limit exceeded");
|
|
1048
|
-
n[n.length - 1].push(r), r = "",
|
|
1449
|
+
n[n.length - 1].push(r), r = "", i = !1;
|
|
1049
1450
|
}
|
|
1050
|
-
for (let
|
|
1051
|
-
const c = e[
|
|
1052
|
-
if (
|
|
1451
|
+
for (let a = 0; a < e.length; a++) {
|
|
1452
|
+
const c = e[a];
|
|
1453
|
+
if (o) {
|
|
1053
1454
|
if (c !== '"') {
|
|
1054
1455
|
r += c;
|
|
1055
1456
|
continue;
|
|
1056
1457
|
}
|
|
1057
|
-
if (e[
|
|
1058
|
-
r += '"',
|
|
1458
|
+
if (e[a + 1] === '"') {
|
|
1459
|
+
r += '"', a++;
|
|
1059
1460
|
continue;
|
|
1060
1461
|
}
|
|
1061
|
-
|
|
1462
|
+
o = !1, i = !0;
|
|
1062
1463
|
continue;
|
|
1063
1464
|
}
|
|
1064
|
-
if (c === '"' && !r && !
|
|
1065
|
-
|
|
1465
|
+
if (c === '"' && !r && !i) {
|
|
1466
|
+
o = !0;
|
|
1066
1467
|
continue;
|
|
1067
1468
|
}
|
|
1068
1469
|
if (c === " ") {
|
|
1069
|
-
|
|
1470
|
+
s();
|
|
1070
1471
|
continue;
|
|
1071
1472
|
}
|
|
1072
1473
|
if (c === "\r" || c === `
|
|
1073
1474
|
`) {
|
|
1074
|
-
|
|
1075
|
-
` &&
|
|
1475
|
+
s(), n.push([]), c === "\r" && e[a + 1] === `
|
|
1476
|
+
` && a++;
|
|
1076
1477
|
continue;
|
|
1077
1478
|
}
|
|
1078
|
-
if (
|
|
1479
|
+
if (i) throw new Error("Invalid quoted clipboard value");
|
|
1079
1480
|
r += c;
|
|
1080
1481
|
}
|
|
1081
|
-
if (
|
|
1082
|
-
return
|
|
1482
|
+
if (o) throw new Error("Unclosed clipboard quote");
|
|
1483
|
+
return s(), On(n, e), n;
|
|
1083
1484
|
}
|
|
1084
|
-
class
|
|
1485
|
+
class Nn extends Error {
|
|
1085
1486
|
constructor(t, n, r) {
|
|
1086
|
-
const
|
|
1087
|
-
definition: `${
|
|
1088
|
-
type: `${
|
|
1089
|
-
required: `${
|
|
1090
|
-
min: `${
|
|
1091
|
-
max: `${
|
|
1092
|
-
precision: `${
|
|
1093
|
-
length: `${
|
|
1094
|
-
choice: `${
|
|
1095
|
-
date: `${
|
|
1487
|
+
const o = typeof n.label == "string" ? n.label : "单元格", i = {
|
|
1488
|
+
definition: `${o}的编辑器配置无效`,
|
|
1489
|
+
type: `${o}的编辑器与数据类型不一致`,
|
|
1490
|
+
required: `${o}不能为空`,
|
|
1491
|
+
min: `${o}不能小于 ${r}`,
|
|
1492
|
+
max: `${o}不能大于 ${r}`,
|
|
1493
|
+
precision: `${o}最多保留 ${r} 位小数`,
|
|
1494
|
+
length: `${o}最多允许 ${r} 个字符`,
|
|
1495
|
+
choice: `${o}请选择有效选项`,
|
|
1496
|
+
date: `${o}请输入有效日期(YYYY-MM-DD)`
|
|
1096
1497
|
};
|
|
1097
|
-
super(
|
|
1498
|
+
super(i[t]), this.code = t, this.field = n, this.expected = r, this.name = "ReportCellFieldError";
|
|
1098
1499
|
}
|
|
1099
1500
|
}
|
|
1100
|
-
function
|
|
1101
|
-
throw new
|
|
1501
|
+
function y(e, t, n) {
|
|
1502
|
+
throw new Nn(t, e, n);
|
|
1102
1503
|
}
|
|
1103
|
-
function
|
|
1504
|
+
function bt(e) {
|
|
1104
1505
|
if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}$/.test(e) || e.startsWith("0000-")) return !1;
|
|
1105
1506
|
const t = /* @__PURE__ */ new Date(`${e}T00:00:00.000Z`);
|
|
1106
1507
|
return Number.isFinite(t.getTime()) && t.toISOString().slice(0, 10) === e;
|
|
1107
1508
|
}
|
|
1108
|
-
function
|
|
1509
|
+
function Dn(e) {
|
|
1109
1510
|
const [t = "", n = "0"] = String(e).toLowerCase().split("e");
|
|
1110
1511
|
return Math.max(0, (t.split(".")[1]?.length ?? 0) - Number(n));
|
|
1111
1512
|
}
|
|
1112
|
-
function
|
|
1113
|
-
e.min !== void 0 && t < e.min &&
|
|
1513
|
+
function Ln(e, t) {
|
|
1514
|
+
e.min !== void 0 && t < e.min && y(e, "min", e.min), e.max !== void 0 && t > e.max && y(e, "max", e.max), e.precision !== void 0 && Dn(t) > e.precision && y(e, "precision", e.precision);
|
|
1114
1515
|
}
|
|
1115
|
-
function
|
|
1116
|
-
|
|
1516
|
+
function Fn(e, t) {
|
|
1517
|
+
bt(t) || y(e, "date"), e.min !== void 0 && t < e.min && y(e, "min", e.min), e.max !== void 0 && t > e.max && y(e, "max", e.max);
|
|
1117
1518
|
}
|
|
1118
|
-
function
|
|
1119
|
-
[e.min, e.max].some((t) => t !== void 0 && !Number.isFinite(t)) &&
|
|
1519
|
+
function jn(e) {
|
|
1520
|
+
[e.min, e.max].some((t) => t !== void 0 && !Number.isFinite(t)) && y(e, "definition"), e.min !== void 0 && e.max !== void 0 && e.min > e.max && y(e, "definition"), e.precision !== void 0 && (!Number.isInteger(e.precision) || e.precision < 0 || e.precision > 15) && y(e, "definition");
|
|
1120
1521
|
}
|
|
1121
|
-
function
|
|
1122
|
-
[e.min, e.max].some((t) => t !== void 0 && !
|
|
1522
|
+
function zn(e) {
|
|
1523
|
+
[e.min, e.max].some((t) => t !== void 0 && !bt(t)) && y(e, "definition"), e.min !== void 0 && e.max !== void 0 && e.min > e.max && y(e, "definition");
|
|
1123
1524
|
}
|
|
1124
|
-
function
|
|
1125
|
-
(!Array.isArray(t.options) || !t.options.length) &&
|
|
1525
|
+
function Hn(e, t) {
|
|
1526
|
+
(!Array.isArray(t.options) || !t.options.length) && y(t, "definition");
|
|
1126
1527
|
const n = e.valueType === "text" ? "string" : e.valueType, r = /* @__PURE__ */ new Set();
|
|
1127
|
-
for (const
|
|
1128
|
-
(!
|
|
1528
|
+
for (const o of t.options)
|
|
1529
|
+
(!o || typeof o.value !== n || typeof o.value == "number" && !Number.isFinite(o.value)) && y(t, "definition"), o.label !== void 0 && typeof o.label != "string" && y(t, "definition"), r.has(o.value) && y(t, "definition"), r.add(o.value);
|
|
1129
1530
|
}
|
|
1130
|
-
function
|
|
1131
|
-
e.required !== void 0 && typeof e.required != "boolean" &&
|
|
1531
|
+
function Bn(e) {
|
|
1532
|
+
e.required !== void 0 && typeof e.required != "boolean" && y(e, "definition"), [e.label, e.hint, e.unit].some((t) => t !== void 0 && typeof t != "string") && y(e, "definition"), e.type === "boolean" && [e.trueLabel, e.falseLabel].some((t) => t !== void 0 && typeof t != "string") && y(e, "definition");
|
|
1132
1533
|
}
|
|
1133
|
-
function
|
|
1134
|
-
(!t || typeof t != "object" || Array.isArray(t) || !["text", "number", "boolean", "enum", "date"].includes(t.type)) &&
|
|
1534
|
+
function _n(e, t) {
|
|
1535
|
+
(!t || typeof t != "object" || Array.isArray(t) || !["text", "number", "boolean", "enum", "date"].includes(t.type)) && y(t ?? { type: "text" }, "definition"), Bn(t), (t.type === "number" || t.type === "boolean") && e.valueType !== t.type && y(t, "type"), (t.type === "text" || t.type === "date") && e.valueType !== "text" && y(t, "type"), t.type === "number" && jn(t), t.type === "text" && t.maxLength !== void 0 && (!Number.isInteger(t.maxLength) || t.maxLength < 0) && y(t, "definition"), t.type === "date" && zn(t), t.type === "enum" && Hn(e, t);
|
|
1135
1536
|
}
|
|
1136
|
-
function
|
|
1137
|
-
if (!e.editable) throw new
|
|
1138
|
-
n &&
|
|
1139
|
-
const r =
|
|
1140
|
-
return n ? (n.required && typeof r == "string" && !r.trim() &&
|
|
1537
|
+
function Lr(e, t, n) {
|
|
1538
|
+
if (!e.editable) throw new Rt("readonly");
|
|
1539
|
+
n && _n(e, n);
|
|
1540
|
+
const r = Pt(e, t);
|
|
1541
|
+
return n ? (n.required && typeof r == "string" && !r.trim() && y(n, "required"), r === null || r === "" ? (n.required && y(n, "required"), r) : (n.type === "number" && Ln(n, r), n.type === "date" && Fn(n, r), n.type === "text" && n.maxLength !== void 0 && [...String(r)].length > n.maxLength && y(n, "length", n.maxLength), n.type === "enum" && !n.options.some((o) => Object.is(o.value, r)) && y(n, "choice"), r)) : r;
|
|
1141
1542
|
}
|
|
1142
|
-
class
|
|
1543
|
+
class v extends Error {
|
|
1143
1544
|
constructor(t) {
|
|
1144
1545
|
super(`Report calculation: ${t}`), this.code = t, this.name = "ReportCalculationError";
|
|
1145
1546
|
}
|
|
1146
1547
|
}
|
|
1147
|
-
function
|
|
1548
|
+
function G(e) {
|
|
1148
1549
|
if (!e?.aborted) return;
|
|
1149
1550
|
const t = new Error("Calculation cancelled");
|
|
1150
1551
|
throw t.name = "AbortError", t;
|
|
1151
1552
|
}
|
|
1152
|
-
async function
|
|
1553
|
+
async function se(e, t = 1) {
|
|
1153
1554
|
const n = Math.floor(e.scanned / 2048);
|
|
1154
|
-
if (e.scanned += t, e.scanned > e.maxScanned) throw new
|
|
1155
|
-
|
|
1555
|
+
if (e.scanned += t, e.scanned > e.maxScanned) throw new v("limit");
|
|
1556
|
+
G(e.signal), Math.floor(e.scanned / 2048) > n && (await e.yieldToHost(), G(e.signal));
|
|
1156
1557
|
}
|
|
1157
|
-
function
|
|
1558
|
+
function Ae(e) {
|
|
1158
1559
|
return e.table?.role === "header" ? -Math.max(1, e.grid?.cells.length ?? 1) : e.table?.rowIndex ?? 0;
|
|
1159
1560
|
}
|
|
1160
|
-
function
|
|
1161
|
-
if (![t.pageIndex, t.componentIndex, t.rowIndex, t.columnIndex].every((
|
|
1561
|
+
function Ue(e, t, n) {
|
|
1562
|
+
if (![t.pageIndex, t.componentIndex, t.rowIndex, t.columnIndex].every((s) => Number.isSafeInteger(s) && s >= 0)) throw new v("selection");
|
|
1162
1563
|
const r = e.pages[t.pageIndex]?.components[t.componentIndex];
|
|
1163
|
-
if (!r?.grid || t.rowIndex >= r.grid.cells.length) throw new
|
|
1164
|
-
const
|
|
1165
|
-
if (t.columnIndex >=
|
|
1166
|
-
const
|
|
1167
|
-
if (
|
|
1168
|
-
const
|
|
1169
|
-
if (
|
|
1170
|
-
return { grid:
|
|
1564
|
+
if (!r?.grid || t.rowIndex >= r.grid.cells.length) throw new v("selection");
|
|
1565
|
+
const o = r.grid.colWidthsMm?.length ?? r.grid.cells.reduce((s, a) => Math.max(s, a.length), 1);
|
|
1566
|
+
if (t.columnIndex >= o) throw new v("selection");
|
|
1567
|
+
const i = r.table, l = e.pages[n.pageIndex]?.components[n.componentIndex]?.table;
|
|
1568
|
+
if (i && l && i.id === l.id) {
|
|
1569
|
+
const s = l.columnKeys.indexOf(i.columnKeys[t.columnIndex] ?? "");
|
|
1570
|
+
if (s < 0) throw new v("selection");
|
|
1571
|
+
return { grid: i.id, row: Ae(r) + t.rowIndex, column: s };
|
|
1171
1572
|
}
|
|
1172
1573
|
return { grid: `${t.pageIndex}:${t.componentIndex}`, row: t.rowIndex, column: t.columnIndex };
|
|
1173
1574
|
}
|
|
1174
|
-
function
|
|
1175
|
-
const r =
|
|
1176
|
-
if (r.grid !==
|
|
1177
|
-
const
|
|
1178
|
-
if (!Number.isSafeInteger(
|
|
1179
|
-
return { grid: r.grid, rowStart: Math.min(r.row,
|
|
1575
|
+
function Wn(e, t, n) {
|
|
1576
|
+
const r = Ue(e, t.anchor, t.anchor), o = Ue(e, t.focus, t.anchor);
|
|
1577
|
+
if (r.grid !== o.grid) throw new v("selection");
|
|
1578
|
+
const i = (Math.abs(r.row - o.row) + 1) * (Math.abs(r.column - o.column) + 1);
|
|
1579
|
+
if (!Number.isSafeInteger(i) || i > n) throw new v("limit");
|
|
1580
|
+
return { grid: r.grid, rowStart: Math.min(r.row, o.row), rowEnd: Math.max(r.row, o.row), columnStart: Math.min(r.column, o.column), columnEnd: Math.max(r.column, o.column), origin: e.pages[t.anchor.pageIndex].components[t.anchor.componentIndex].table };
|
|
1180
1581
|
}
|
|
1181
|
-
function
|
|
1582
|
+
function Un(e) {
|
|
1182
1583
|
if (!e) return !1;
|
|
1183
1584
|
const t = e.replace(/"[^"]*"|\\.|\[(?![hms]+\])[^\]]*\]/gi, "");
|
|
1184
1585
|
return /[ymdhs]/i.test(t);
|
|
1185
1586
|
}
|
|
1186
|
-
function
|
|
1187
|
-
if (e.valueType === "text" || e.valueType === "boolean" ||
|
|
1587
|
+
function Vn(e) {
|
|
1588
|
+
if (e.valueType === "text" || e.valueType === "boolean" || Un(e.numberFormat)) return null;
|
|
1188
1589
|
const t = e.value;
|
|
1189
1590
|
if (typeof t != "number" || !Number.isFinite(t)) return null;
|
|
1190
|
-
if (Number.isInteger(t) && !Number.isSafeInteger(t)) throw new
|
|
1591
|
+
if (Number.isInteger(t) && !Number.isSafeInteger(t)) throw new v("precision");
|
|
1191
1592
|
return t;
|
|
1192
1593
|
}
|
|
1193
|
-
function
|
|
1594
|
+
function qn(e, t, n) {
|
|
1194
1595
|
if (e.seen.has(n)) return;
|
|
1195
1596
|
e.seen.add(n), e.selected++;
|
|
1196
|
-
const r = t ?
|
|
1597
|
+
const r = t ? Vn(t) : null;
|
|
1197
1598
|
r === null ? e.excluded++ : e.values.push(r);
|
|
1198
1599
|
}
|
|
1199
|
-
function
|
|
1600
|
+
function Gn(e, t, n, r) {
|
|
1200
1601
|
return r.origin ? e.table?.id === r.origin.id : `${t}:${n}` === r.grid;
|
|
1201
1602
|
}
|
|
1202
|
-
function
|
|
1603
|
+
function Jn(e, t, n) {
|
|
1203
1604
|
return n.origin ? n.origin.columnKeys.indexOf(e.table.columnKeys[t] ?? "") : t;
|
|
1204
1605
|
}
|
|
1205
|
-
function
|
|
1206
|
-
const
|
|
1207
|
-
return
|
|
1208
|
-
}
|
|
1209
|
-
function
|
|
1210
|
-
const n = t.origin ?
|
|
1211
|
-
return
|
|
1212
|
-
}
|
|
1213
|
-
async function
|
|
1214
|
-
const
|
|
1215
|
-
if (t > r.maxScanned) throw new
|
|
1216
|
-
const l =
|
|
1217
|
-
if (l > r.maxScanned) throw new
|
|
1218
|
-
const
|
|
1219
|
-
for (let
|
|
1220
|
-
|
|
1606
|
+
function Kn(e, t, n, r) {
|
|
1607
|
+
const o = r.origin ? Ae(e) + t : t, i = Jn(e, n, r);
|
|
1608
|
+
return o < r.rowStart || o > r.rowEnd || i < r.columnStart || i > r.columnEnd ? null : `${r.grid}:${o}:${i}`;
|
|
1609
|
+
}
|
|
1610
|
+
function Yn(e, t) {
|
|
1611
|
+
const n = t.origin ? Ae(e) : 0, r = Math.max(0, t.rowStart - n), o = Math.min(e.grid.cells.length, t.rowEnd - n + 1);
|
|
1612
|
+
return o > r ? o : 0;
|
|
1613
|
+
}
|
|
1614
|
+
async function Xn(e, t, n, r, o) {
|
|
1615
|
+
const i = e.grid;
|
|
1616
|
+
if (t > r.maxScanned) throw new v("limit");
|
|
1617
|
+
const l = i.colWidthsMm?.length ?? i.cells.reduce((a, c) => Math.max(a, c.length), 1);
|
|
1618
|
+
if (l > r.maxScanned) throw new v("limit");
|
|
1619
|
+
const s = /* @__PURE__ */ new Map();
|
|
1620
|
+
for (let a = 0; a < t; a++) {
|
|
1621
|
+
a > 0 && a % 2048 === 0 && (await r.yieldToHost(), G(r.signal));
|
|
1221
1622
|
let c = 0;
|
|
1222
|
-
for (const d of
|
|
1223
|
-
for (await
|
|
1623
|
+
for (const d of i.cells[a]) {
|
|
1624
|
+
for (await se(r); c < l && (s.get(c) ?? 0) > a; ) c++;
|
|
1224
1625
|
if (c >= l) break;
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1227
|
-
for (let
|
|
1228
|
-
const
|
|
1229
|
-
|
|
1626
|
+
const m = Math.max(1, Math.min(d?.colSpan ?? 1, l - c)), h = Math.min(i.cells.length, a + Math.max(1, d?.rowSpan ?? 1));
|
|
1627
|
+
m > 1 && await se(r, m - 1);
|
|
1628
|
+
for (let g = c; g < c + m; g++) s.set(g, h);
|
|
1629
|
+
const f = Kn(e, a, c, n);
|
|
1630
|
+
f && qn(o, d, f), c += m;
|
|
1230
1631
|
}
|
|
1231
1632
|
}
|
|
1232
1633
|
}
|
|
1233
|
-
async function
|
|
1634
|
+
async function Zn(e, t, n) {
|
|
1234
1635
|
const r = { values: [], seen: /* @__PURE__ */ new Set(), excluded: 0, selected: 0 };
|
|
1235
|
-
for (let
|
|
1236
|
-
await
|
|
1237
|
-
const
|
|
1238
|
-
for (let l = 0; l <
|
|
1239
|
-
await
|
|
1240
|
-
const
|
|
1241
|
-
if (!
|
|
1242
|
-
const
|
|
1243
|
-
|
|
1636
|
+
for (let o = 0; o < e.pages.length; o++) {
|
|
1637
|
+
await se(n);
|
|
1638
|
+
const i = e.pages[o];
|
|
1639
|
+
for (let l = 0; l < i.components.length; l++) {
|
|
1640
|
+
await se(n);
|
|
1641
|
+
const s = i.components[l];
|
|
1642
|
+
if (!s.grid || !Gn(s, o, l, t) || s.table && s.table.role !== "body") continue;
|
|
1643
|
+
const a = Yn(s, t);
|
|
1644
|
+
a && await Xn(s, a, t, n, r);
|
|
1244
1645
|
}
|
|
1245
1646
|
}
|
|
1246
1647
|
return r;
|
|
1247
1648
|
}
|
|
1248
|
-
function
|
|
1249
|
-
if (!Number.isFinite(e)) throw new
|
|
1649
|
+
function X(e) {
|
|
1650
|
+
if (!Number.isFinite(e)) throw new v("overflow");
|
|
1250
1651
|
return e;
|
|
1251
1652
|
}
|
|
1252
|
-
function
|
|
1653
|
+
function Qn(e) {
|
|
1253
1654
|
let t = 0, n = 0;
|
|
1254
1655
|
for (const r of e) {
|
|
1255
|
-
const
|
|
1256
|
-
n =
|
|
1656
|
+
const o = r - n, i = X(t + o);
|
|
1657
|
+
n = i - t - o, t = i;
|
|
1257
1658
|
}
|
|
1258
1659
|
return t;
|
|
1259
1660
|
}
|
|
1260
|
-
async function
|
|
1661
|
+
async function Ve(e, t) {
|
|
1261
1662
|
let n = [...e], r = new Array(e.length);
|
|
1262
|
-
for (let
|
|
1263
|
-
for (let l = 0; l < e.length; l +=
|
|
1264
|
-
const
|
|
1265
|
-
let c = l, d =
|
|
1266
|
-
for (let
|
|
1267
|
-
r[
|
|
1663
|
+
for (let i = 1; i < e.length; i *= 2) {
|
|
1664
|
+
for (let l = 0; l < e.length; l += i * 2) {
|
|
1665
|
+
const s = Math.min(l + i, e.length), a = Math.min(l + i * 2, e.length);
|
|
1666
|
+
let c = l, d = s;
|
|
1667
|
+
for (let m = l; m < a; m++)
|
|
1668
|
+
r[m] = d >= a || c < s && n[c] <= n[d] ? n[c++] : n[d++], m % 2048 === 0 && (await t.yieldToHost(), G(t.signal));
|
|
1268
1669
|
}
|
|
1269
1670
|
[n, r] = [r, n];
|
|
1270
1671
|
}
|
|
1271
|
-
const
|
|
1272
|
-
return n.length % 2 ? n[
|
|
1672
|
+
const o = Math.floor(n.length / 2);
|
|
1673
|
+
return n.length % 2 ? n[o] : X(n[o - 1] / 2 + n[o] / 2);
|
|
1273
1674
|
}
|
|
1274
|
-
function
|
|
1275
|
-
const t =
|
|
1675
|
+
function er(e) {
|
|
1676
|
+
const t = Qn(e);
|
|
1276
1677
|
let n = 1 / 0, r = -1 / 0;
|
|
1277
|
-
for (const
|
|
1278
|
-
n = Math.min(n,
|
|
1678
|
+
for (const o of e)
|
|
1679
|
+
n = Math.min(n, o), r = Math.max(r, o);
|
|
1279
1680
|
return { SUM: t, AVERAGE: t / e.length, AVG: t / e.length, MIN: n, MAX: r, COUNT: e.length };
|
|
1280
1681
|
}
|
|
1281
|
-
function
|
|
1282
|
-
if (typeof e != "string" || e.length > 256) throw new
|
|
1682
|
+
function tr(e, t) {
|
|
1683
|
+
if (typeof e != "string" || e.length > 256) throw new v("expression");
|
|
1283
1684
|
const n = e.toUpperCase().match(/(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?|[A-Z_]+|[()+\-*/]|\S/g) ?? [];
|
|
1284
|
-
if (!n.length || n.length > 64) throw new
|
|
1685
|
+
if (!n.length || n.length > 64) throw new v("expression");
|
|
1285
1686
|
let r = 0;
|
|
1286
|
-
function
|
|
1287
|
-
if (
|
|
1288
|
-
const
|
|
1289
|
-
if (
|
|
1290
|
-
if (
|
|
1291
|
-
const c =
|
|
1292
|
-
if (n[r++] !== ")") throw new
|
|
1687
|
+
function o(s) {
|
|
1688
|
+
if (s > 16) throw new v("expression");
|
|
1689
|
+
const a = n[r++];
|
|
1690
|
+
if (a === "+" || a === "-") return (a === "-" ? -1 : 1) * o(s + 1);
|
|
1691
|
+
if (a === "(") {
|
|
1692
|
+
const c = i(0, s + 1);
|
|
1693
|
+
if (n[r++] !== ")") throw new v("expression");
|
|
1293
1694
|
return c;
|
|
1294
1695
|
}
|
|
1295
|
-
if (
|
|
1296
|
-
if (
|
|
1297
|
-
throw new
|
|
1696
|
+
if (a && /^(?:SUM|AVERAGE|AVG|MIN|MAX|COUNT|MEDIAN)$/.test(a) && Object.prototype.hasOwnProperty.call(t, a)) return X(t[a]);
|
|
1697
|
+
if (a && /^(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?$/.test(a)) return X(Number(a));
|
|
1698
|
+
throw new v("expression");
|
|
1298
1699
|
}
|
|
1299
|
-
function
|
|
1300
|
-
let c =
|
|
1700
|
+
function i(s, a) {
|
|
1701
|
+
let c = o(a);
|
|
1301
1702
|
for (; r < n.length; ) {
|
|
1302
|
-
const d = n[r],
|
|
1303
|
-
if (!
|
|
1703
|
+
const d = n[r], m = d === "+" || d === "-" ? 1 : d === "*" || d === "/" ? 2 : 0;
|
|
1704
|
+
if (!m || m < s) break;
|
|
1304
1705
|
r++;
|
|
1305
|
-
const
|
|
1306
|
-
if (d === "/" &&
|
|
1307
|
-
c =
|
|
1706
|
+
const h = i(m + 1, a + 1);
|
|
1707
|
+
if (d === "/" && h === 0) throw new v("division");
|
|
1708
|
+
c = X(d === "+" ? c + h : d === "-" ? c - h : d === "*" ? c * h : c / h);
|
|
1308
1709
|
}
|
|
1309
1710
|
return c;
|
|
1310
1711
|
}
|
|
1311
|
-
const l =
|
|
1312
|
-
if (r !== n.length) throw new
|
|
1712
|
+
const l = i(1, 0);
|
|
1713
|
+
if (r !== n.length) throw new v("expression");
|
|
1313
1714
|
return l;
|
|
1314
1715
|
}
|
|
1315
|
-
function
|
|
1716
|
+
function nr(e) {
|
|
1316
1717
|
const t = e.maxCells ?? 1e5, n = e.maxScannedCells ?? 2e5, r = e.precision ?? 2;
|
|
1317
|
-
if (![t, n].every((
|
|
1318
|
-
if (!Number.isInteger(r) || r < 0 || r > 12) throw new
|
|
1718
|
+
if (![t, n].every((o) => Number.isSafeInteger(o) && o >= 1 && o <= 2e6)) throw new v("limit");
|
|
1719
|
+
if (!Number.isInteger(r) || r < 0 || r > 12) throw new v("precision");
|
|
1319
1720
|
return { maxCells: t, maxScanned: n, precision: r };
|
|
1320
1721
|
}
|
|
1321
|
-
async function
|
|
1322
|
-
const r =
|
|
1323
|
-
|
|
1324
|
-
const
|
|
1325
|
-
if (!["sum", "average", "min", "max", "count", "median", "expression"].includes(l)) throw new
|
|
1326
|
-
let
|
|
1327
|
-
if (l === "count")
|
|
1328
|
-
else if (
|
|
1329
|
-
if (l === "median")
|
|
1722
|
+
async function Fr(e, t, n = {}) {
|
|
1723
|
+
const r = nr(n), o = { scanned: 0, maxScanned: r.maxScanned, signal: n.signal, yieldToHost: n.yieldToHost ?? (() => new Promise((a) => setTimeout(a, 0))) };
|
|
1724
|
+
G(o.signal);
|
|
1725
|
+
const i = await Zn(e, Wn(e, t, r.maxCells), o), l = n.operation ?? "sum";
|
|
1726
|
+
if (!["sum", "average", "min", "max", "count", "median", "expression"].includes(l)) throw new v("expression");
|
|
1727
|
+
let s = null;
|
|
1728
|
+
if (l === "count") s = i.values.length;
|
|
1729
|
+
else if (i.values.length)
|
|
1730
|
+
if (l === "median") s = await Ve(i.values, o);
|
|
1330
1731
|
else {
|
|
1331
|
-
const
|
|
1332
|
-
l === "expression" ? (/\bMEDIAN\b/i.test(n.expression ?? "") && (
|
|
1732
|
+
const a = er(i.values);
|
|
1733
|
+
l === "expression" ? (/\bMEDIAN\b/i.test(n.expression ?? "") && (a.MEDIAN = await Ve(i.values, o)), s = tr(n.expression ?? "", a)) : s = a[l.toUpperCase()];
|
|
1333
1734
|
}
|
|
1334
|
-
if (
|
|
1335
|
-
return { value:
|
|
1735
|
+
if (G(o.signal), s !== null && Number.isInteger(s) && !Number.isSafeInteger(s)) throw new v("precision");
|
|
1736
|
+
return { value: s, formatted: s === null ? "—" : s.toFixed(r.precision), numericCells: i.values.length, excludedCells: i.excluded, selectedCells: i.selected, precision: r.precision };
|
|
1336
1737
|
}
|
|
1337
|
-
class
|
|
1738
|
+
class k extends Error {
|
|
1338
1739
|
constructor(t, n) {
|
|
1339
1740
|
super(t), this.path = n, this.code = "label-sheet", this.name = "LabelSheetError";
|
|
1340
1741
|
}
|
|
1341
1742
|
}
|
|
1342
|
-
function
|
|
1743
|
+
function oe(e) {
|
|
1343
1744
|
if (e?.aborted) {
|
|
1344
1745
|
const t = new Error("标签拼版已取消");
|
|
1345
1746
|
throw t.name = "AbortError", t;
|
|
1346
1747
|
}
|
|
1347
1748
|
}
|
|
1348
|
-
function
|
|
1349
|
-
if (!Number.isFinite(e) || e <= 0 || n && !Number.isSafeInteger(e)) throw new
|
|
1749
|
+
function B(e, t, n = !1) {
|
|
1750
|
+
if (!Number.isFinite(e) || e <= 0 || n && !Number.isSafeInteger(e)) throw new k("应为正有限数字,数量应为安全整数", t);
|
|
1350
1751
|
return e;
|
|
1351
1752
|
}
|
|
1352
|
-
function
|
|
1353
|
-
if (!Number.isFinite(e) || e < 0) throw new
|
|
1753
|
+
function qe(e, t) {
|
|
1754
|
+
if (!Number.isFinite(e) || e < 0) throw new k("应为非负有限数字", t);
|
|
1354
1755
|
return e;
|
|
1355
1756
|
}
|
|
1356
|
-
function
|
|
1757
|
+
function rr(e) {
|
|
1357
1758
|
const t = typeof e.marginMm == "object" ? e.marginMm : { top: e.marginMm ?? 0, left: e.marginMm ?? 0, bottom: e.marginMm ?? 0, right: e.marginMm ?? 0 }, n = typeof e.gapMm == "object" ? e.gapMm : { horizontal: e.gapMm ?? 0, vertical: e.gapMm ?? 0 };
|
|
1358
|
-
for (const r of ["top", "left", "bottom", "right"])
|
|
1359
|
-
for (const r of ["horizontal", "vertical"])
|
|
1759
|
+
for (const r of ["top", "left", "bottom", "right"]) qe(t?.[r], `$.marginMm.${r}`);
|
|
1760
|
+
for (const r of ["horizontal", "vertical"]) qe(n?.[r], `$.gapMm.${r}`);
|
|
1360
1761
|
return { margin: t, gap: n };
|
|
1361
1762
|
}
|
|
1362
|
-
function
|
|
1763
|
+
function or(e) {
|
|
1363
1764
|
const t = e.paper === void 0 || e.paper === "a4" ? { widthMm: 210, heightMm: 297 } : e.paper;
|
|
1364
|
-
|
|
1365
|
-
const n =
|
|
1366
|
-
if (
|
|
1367
|
-
const { margin:
|
|
1368
|
-
if (!Number.isSafeInteger(
|
|
1369
|
-
if (!Number.isFinite(
|
|
1370
|
-
return { paper: t, columns: n, rows: r, capacity:
|
|
1371
|
-
}
|
|
1372
|
-
function
|
|
1373
|
-
return 1 + (e.grid?.cells.reduce((t, n) => t + n.length + 1 + n.reduce((r,
|
|
1374
|
-
}
|
|
1375
|
-
function
|
|
1376
|
-
if (!
|
|
1765
|
+
B(t.widthMm, "$.paper.widthMm"), B(t.heightMm, "$.paper.heightMm");
|
|
1766
|
+
const n = B(e.columns, "$.columns", !0), r = B(e.rows, "$.rows", !0), o = n * r;
|
|
1767
|
+
if (o > 1e3) throw new k("每张纸不能超过 1000 个位置", "$.columns");
|
|
1768
|
+
const { margin: i, gap: l } = rr(e), s = e.startSlot ?? 0, a = e.offsetMm ?? { x: 0, y: 0 };
|
|
1769
|
+
if (!Number.isSafeInteger(s) || s < 0 || s >= o) throw new k("起始位置应在首张纸的有效位置内", "$.startSlot");
|
|
1770
|
+
if (!Number.isFinite(a.x) || !Number.isFinite(a.y)) throw new k("校准偏移应为有限毫米值", "$.offsetMm");
|
|
1771
|
+
return { paper: t, columns: n, rows: r, capacity: o, margin: i, gap: l, startSlot: s, offset: a };
|
|
1772
|
+
}
|
|
1773
|
+
function yt(e) {
|
|
1774
|
+
return 1 + (e.grid?.cells.reduce((t, n) => t + n.length + 1 + n.reduce((r, o) => r + (o?.children?.reduce((i, l) => i + yt(l), 0) ?? 0), 0), 0) ?? 0);
|
|
1775
|
+
}
|
|
1776
|
+
function ir(e, t, n) {
|
|
1777
|
+
if (!Et(e).ok) throw new k("标签计划无效", "$.plan");
|
|
1377
1778
|
const r = e.pages[0];
|
|
1378
1779
|
if (!r) return;
|
|
1379
|
-
const { paper:
|
|
1380
|
-
if (
|
|
1780
|
+
const { paper: o, columns: i, rows: l, margin: s, gap: a, offset: c } = n;
|
|
1781
|
+
if (s.left + c.x < 0 || s.top + c.y < 0 || s.left + c.x + i * r.pageWidthMm + (i - 1) * a.horizontal + s.right > o.widthMm + 1e-6 || s.top + c.y + l * r.pageHeightMm + (l - 1) * a.vertical + s.bottom > o.heightMm + 1e-6) throw new k("标签、间距、边距及校准偏移超过纸张尺寸;不会自动缩小标签", "$.paper");
|
|
1381
1782
|
let d = 0;
|
|
1382
|
-
for (const [
|
|
1383
|
-
if (
|
|
1384
|
-
if (d +=
|
|
1385
|
-
for (const
|
|
1783
|
+
for (const [m, h] of e.pages.entries()) {
|
|
1784
|
+
if (oe(t.signal), h.layout === "wide" || h.pageWidthMm !== r.pageWidthMm || h.pageHeightMm !== r.pageHeightMm) throw new k("拼版需要尺寸相同的固定标签页面", `$.pages.${m}`);
|
|
1785
|
+
if (d += h.components.reduce((f, g) => f + yt(g), 0), d > B(t.maxComponents ?? 25e4, "$.maxComponents", !0)) throw new k("拼版组件总量超过预算", "$.maxComponents");
|
|
1786
|
+
for (const f of h.components) if (f.leftMm < 0 || f.topMm < 0 || f.leftMm + f.widthMm > h.pageWidthMm + 1e-6 || f.topMm + f.heightMm > h.pageHeightMm + 1e-6) throw new k("标签内容超出标签边界", `$.pages.${m}.components`);
|
|
1386
1787
|
}
|
|
1387
1788
|
}
|
|
1388
|
-
function
|
|
1389
|
-
|
|
1390
|
-
const n =
|
|
1391
|
-
if (d >
|
|
1392
|
-
|
|
1393
|
-
const
|
|
1394
|
-
for (const [
|
|
1395
|
-
|
|
1396
|
-
const
|
|
1397
|
-
b.meta.labelSheet.slots.push(
|
|
1789
|
+
function jr(e, t) {
|
|
1790
|
+
oe(t.signal);
|
|
1791
|
+
const n = or(t), { paper: r, columns: o, capacity: i, margin: l, gap: s, startSlot: a, offset: c } = n, d = e.pages.length ? Math.ceil((a + e.pages.length) / i) : 0;
|
|
1792
|
+
if (d > B(t.maxSheets ?? 1e4, "$.maxSheets", !0)) throw new k("拼版纸张数量超过预算", "$.maxSheets");
|
|
1793
|
+
B(t.maxComponents ?? 25e4, "$.maxComponents", !0), ir(e, t, n);
|
|
1794
|
+
const m = et(e, { maxBytes: B(t.maxSnapshotBytes ?? 64e6, "$.maxSnapshotBytes", !0), check: () => oe(t.signal), error: (f, g) => new k(g, "$.maxSnapshotBytes") }), h = Array.from({ length: d }, () => ({ pageWidthMm: r.widthMm, pageHeightMm: r.heightMm, components: [], meta: { labelSheet: { columns: o, rows: n.rows, slots: [] } } }));
|
|
1795
|
+
for (const [f, g] of m.pages.entries()) {
|
|
1796
|
+
oe(t.signal);
|
|
1797
|
+
const C = a + f, S = C % i, b = h[Math.floor(C / i)], M = l.left + c.x + S % o * (g.pageWidthMm + s.horizontal), w = l.top + c.y + Math.floor(S / o) * (g.pageHeightMm + s.vertical), N = { sourcePageIndex: f, slotIndex: S, xMm: M, yMm: w, widthMm: g.pageWidthMm, heightMm: g.pageHeightMm, ...g.meta ? { sourceMeta: g.meta } : {} };
|
|
1798
|
+
b.meta.labelSheet.slots.push(N), b.components.push(...g.components.map((D) => ({ ...D, leftMm: D.leftMm + M, topMm: D.topMm + w, meta: { ...D.meta, labelSheet: N } })));
|
|
1398
1799
|
}
|
|
1399
|
-
return { ...
|
|
1800
|
+
return { ...m, pages: h };
|
|
1801
|
+
}
|
|
1802
|
+
function zr(e) {
|
|
1803
|
+
if (!e || !["today", "yesterday", "month-start", "month-end"].includes(e.preset)) throw new TypeError("未知日期默认值");
|
|
1804
|
+
const t = e.now instanceof Date ? e.now.getTime() : e.now;
|
|
1805
|
+
if (typeof t != "number" || !Number.isFinite(t) || !Number.isFinite(new Date(t).getTime())) throw new TypeError("日期默认值需要有效的业务时钟");
|
|
1806
|
+
if (typeof e.timeZone != "string" || !e.timeZone.trim()) throw new TypeError("日期默认值需要显式业务时区");
|
|
1807
|
+
if (e.offsetDays !== void 0 && (!Number.isSafeInteger(e.offsetDays) || Math.abs(e.offsetDays) > 3660)) throw new RangeError("日期偏移应为 -3660 到 3660 的整数");
|
|
1808
|
+
const n = new Intl.DateTimeFormat("en-CA", { timeZone: e.timeZone, year: "numeric", month: "2-digit", day: "2-digit", calendar: "iso8601", numberingSystem: "latn" }).formatToParts(t), r = (i) => Number(n.find((l) => l.type === i)?.value), o = /* @__PURE__ */ new Date(0);
|
|
1809
|
+
if (o.setUTCFullYear(r("year"), r("month") - 1, r("day")), o.setUTCHours(0, 0, 0, 0), e.preset === "yesterday" && o.setUTCDate(o.getUTCDate() - 1), e.preset === "month-start" && o.setUTCDate(1), e.preset === "month-end" && o.setUTCMonth(o.getUTCMonth() + 1, 0), o.setUTCDate(o.getUTCDate() + (e.offsetDays ?? 0)), o.getUTCFullYear() < 1 || o.getUTCFullYear() > 9999) throw new RangeError("业务日期超出 0001–9999 范围");
|
|
1810
|
+
return o.toISOString().slice(0, 10);
|
|
1400
1811
|
}
|
|
1401
1812
|
export {
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
Wi as
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
yi as
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1813
|
+
_r as CSS_DPI,
|
|
1814
|
+
Wr as DEFAULT_BORDER_PT,
|
|
1815
|
+
le as DEFAULT_FONT_FAMILY,
|
|
1816
|
+
Ur as DEFAULT_FONT_PT,
|
|
1817
|
+
Eo as DEFAULT_LABEL_PAGE_LIMIT,
|
|
1818
|
+
Vr as DEFAULT_STROKE_COLOR,
|
|
1819
|
+
Ge as DEFAULT_TEXT_COLOR,
|
|
1820
|
+
qr as LINE_HEIGHT,
|
|
1821
|
+
k as LabelSheetError,
|
|
1822
|
+
Gr as MM_PER_INCH,
|
|
1823
|
+
ri as OutputAssetError,
|
|
1824
|
+
kt as OutputFidelityError,
|
|
1825
|
+
ie as PAPER_SIZES,
|
|
1826
|
+
mn as PageBuilder,
|
|
1827
|
+
Co as PaginateCellLimitError,
|
|
1828
|
+
To as PaginateChartComponentLimitError,
|
|
1829
|
+
Ro as PaginatePageLimitError,
|
|
1830
|
+
ao as RENDER_PLAN_SCHEMA_VERSION,
|
|
1831
|
+
pe as REPORT_TEMPLATE_DOCUMENT_VERSION,
|
|
1832
|
+
Zr as ReportBindingError,
|
|
1833
|
+
v as ReportCalculationError,
|
|
1834
|
+
Rt as ReportCellEditError,
|
|
1835
|
+
Nn as ReportCellFieldError,
|
|
1836
|
+
u as ReportComponentExtensionError,
|
|
1837
|
+
ai as ReportDataError,
|
|
1838
|
+
si as ReportDrillError,
|
|
1839
|
+
wi as ReportParamValidationError,
|
|
1840
|
+
ve as ReportSourceError,
|
|
1841
|
+
Ze as ReportTemplateError,
|
|
1842
|
+
j as ReportTemplateMigrationError,
|
|
1843
|
+
F as ReportTemplateStoreError,
|
|
1844
|
+
Po as ReportValidationError,
|
|
1845
|
+
Jr as SCHEMA_VERSION_MACH,
|
|
1846
|
+
dn as TemplateBuilder,
|
|
1847
|
+
na as TreeRowLimitError,
|
|
1848
|
+
$o as applyReportCellEdit,
|
|
1849
|
+
ko as applyReportCellEditBatch,
|
|
1850
|
+
Xi as applyReportDocumentStyle,
|
|
1851
|
+
Ao as applyReportEditResult,
|
|
1852
|
+
Io as applyReportSourceMetadata,
|
|
1853
|
+
lo as assertRenderPlan,
|
|
1854
|
+
bi as assertReportParams,
|
|
1855
|
+
Oo as assertReportValidation,
|
|
1856
|
+
Fr as calculateReportSelection,
|
|
1857
|
+
Zi as captureTemplateFragment,
|
|
1858
|
+
yo as charWidthEm,
|
|
1859
|
+
P as classOf,
|
|
1860
|
+
Bi as cloneReportTemplate,
|
|
1861
|
+
Gi as collectTemplateOutline,
|
|
1862
|
+
Tr as columnsFromContract,
|
|
1863
|
+
li as compareReportData,
|
|
1864
|
+
Fi as compileReportPredicate,
|
|
1865
|
+
tn as computePageWindow,
|
|
1866
|
+
No as countTemplatePages,
|
|
1867
|
+
Mo as createCanvasMeasurer,
|
|
1868
|
+
Er as createCanvasPager,
|
|
1869
|
+
vo as createHeuristicMeasurer,
|
|
1870
|
+
Pr as createLabelTemplate,
|
|
1871
|
+
_i as createLocalTemplateCatalog,
|
|
1872
|
+
Ir as createMemoryTemplateStore,
|
|
1873
|
+
yr as createPageViewportRenderer,
|
|
1874
|
+
kr as createProviderReport,
|
|
1875
|
+
Do as createReportCellEdit,
|
|
1876
|
+
Lo as createReportCellEditBatch,
|
|
1877
|
+
Fo as createReportCellResolver,
|
|
1878
|
+
Ni as createReportChartData,
|
|
1879
|
+
Or as createReportComponentRegistry,
|
|
1880
|
+
ci as createReportDrillRequest,
|
|
1881
|
+
jo as createReportEditSession,
|
|
1882
|
+
di as createReportPrefill,
|
|
1883
|
+
zo as createReportSource,
|
|
1884
|
+
Rr as createTableTemplate,
|
|
1885
|
+
Cr as createTemplate,
|
|
1886
|
+
Ar as createTemplateManager,
|
|
1887
|
+
vn as createTemplateMigrator,
|
|
1888
|
+
co as createTemplateRegistry,
|
|
1889
|
+
ra as createTreeTable,
|
|
1890
|
+
wo as datasetJsonSchema,
|
|
1891
|
+
$r as defineLabelReport,
|
|
1892
|
+
Tt as defineReport,
|
|
1893
|
+
mo as defineReportTemplate,
|
|
1894
|
+
Wi as diffReportTemplates,
|
|
1895
|
+
Ho as estimateListLayoutCells,
|
|
1896
|
+
Qr as evalStyleRule,
|
|
1897
|
+
tr as evaluateReportAggregateExpression,
|
|
1898
|
+
ji as evaluateReportPredicate,
|
|
1899
|
+
Bo as explainDatasetField,
|
|
1900
|
+
yi as formatReportCascaderPath,
|
|
1901
|
+
_o as formatReportCellEdit,
|
|
1902
|
+
Nr as formatReportClipboard,
|
|
1903
|
+
Mi as formatReportDateRange,
|
|
1904
|
+
vi as formatReportNumberRange,
|
|
1905
|
+
xi as formatReportParamSelection,
|
|
1906
|
+
eo as formatValue,
|
|
1907
|
+
Wo as getReportCellContext,
|
|
1908
|
+
Uo as getReportEditSession,
|
|
1909
|
+
Vo as hasValidDataExplanation,
|
|
1910
|
+
Me as heuristicMeasurer,
|
|
1911
|
+
jr as imposeLabelSheets,
|
|
1912
|
+
Qi as insertTemplateFragment,
|
|
1913
|
+
oi as inspectOutputCapabilities,
|
|
1914
|
+
Ji as inspectTemplateFieldUsage,
|
|
1915
|
+
ea as inspectTemplateFragmentBindings,
|
|
1916
|
+
ce as isImageBackedComponent,
|
|
1917
|
+
qo as isReportDataTarget,
|
|
1918
|
+
Si as isReportDate,
|
|
1919
|
+
Ei as isReportMonth,
|
|
1920
|
+
Go as isReportValueState,
|
|
1921
|
+
Ci as isReportYear,
|
|
1922
|
+
Ye as isRichText,
|
|
1923
|
+
mi as matchReportDrillActions,
|
|
1924
|
+
Pe as measurePageSizePx,
|
|
1925
|
+
xo as measureTextMm,
|
|
1926
|
+
Ke as mergeComponentStyles,
|
|
1927
|
+
ue as mmToPx,
|
|
1928
|
+
Kr as mmToPxFactor,
|
|
1929
|
+
Jo as paginateTemplate,
|
|
1930
|
+
Ko as paginateTemplatePages,
|
|
1931
|
+
to as parseDateLocal,
|
|
1932
|
+
Ti as parseReportCascaderPath,
|
|
1933
|
+
Lr as parseReportCellFieldInput,
|
|
1934
|
+
Pt as parseReportCellInput,
|
|
1935
|
+
Dr as parseReportClipboard,
|
|
1936
|
+
Ri as parseReportDateRange,
|
|
1937
|
+
Pi as parseReportNumberRange,
|
|
1938
|
+
$i as parseReportParamSelection,
|
|
1939
|
+
re as parseReportTemplate,
|
|
1940
|
+
Mr as planFontSizePx,
|
|
1941
|
+
Yo as projectListColumns,
|
|
1942
|
+
V as ptToPx,
|
|
1943
|
+
Yr as pxToMm,
|
|
1944
|
+
Xo as registerReportEditSession,
|
|
1945
|
+
Zo as relocateReportCellEdits,
|
|
1946
|
+
lt as renderComponent,
|
|
1947
|
+
ct as renderPage,
|
|
1948
|
+
br as renderPlan,
|
|
1949
|
+
xr as renderPlanToCanvas,
|
|
1950
|
+
Sr as renderPlanToCanvasAsync,
|
|
1951
|
+
vr as renderPlanToImages,
|
|
1952
|
+
Qo as reportCellEditKey,
|
|
1953
|
+
hi as reportDataSnapshotFromPlan,
|
|
1954
|
+
zr as reportDateDefault,
|
|
1955
|
+
Z as reportOutputDiagnostics,
|
|
1956
|
+
ki as reportParamsJsonSchema,
|
|
1957
|
+
zi as reportPredicateFields,
|
|
1958
|
+
fi as reportPrefillInputs,
|
|
1959
|
+
Je as resolveBoxBorders,
|
|
1960
|
+
no as resolveComponentBinding,
|
|
1961
|
+
_ as resolveFontSize,
|
|
1962
|
+
xe as resolveGridLayout,
|
|
1963
|
+
q as resolveLineHeight,
|
|
1964
|
+
ut as resolvePaper,
|
|
1965
|
+
Ee as resolvePlanAssets,
|
|
1966
|
+
gi as resolveReportDrillReturn,
|
|
1967
|
+
Y as resolveStroke,
|
|
1968
|
+
ye as resolveTextColor,
|
|
1969
|
+
Ui as reviewReportTemplate,
|
|
1970
|
+
Vi as reviewReportTemplateAsync,
|
|
1971
|
+
J as round,
|
|
1972
|
+
ho as serializeReportTemplate,
|
|
1973
|
+
ei as summarizeReportCellEdits,
|
|
1974
|
+
Ki as templatePathLocation,
|
|
1975
|
+
ro as toExcelNumberFormat,
|
|
1976
|
+
oo as toNumber,
|
|
1977
|
+
fo as validateComponent,
|
|
1978
|
+
Ct as validateDatasetRows,
|
|
1979
|
+
go as validatePage,
|
|
1980
|
+
Et as validateRenderPlan,
|
|
1981
|
+
_n as validateReportCellFieldDefinition,
|
|
1982
|
+
Di as validateReportChartBinding,
|
|
1983
|
+
ti as validateReportDataset,
|
|
1984
|
+
ui as validateReportDrillActions,
|
|
1985
|
+
Ai as validateReportParamDefinitions,
|
|
1986
|
+
Ii as validateReportParams,
|
|
1987
|
+
Xe as validateReportTemplate,
|
|
1988
|
+
uo as validateReportTemplateDocument,
|
|
1989
|
+
oa as validateTreeOptions,
|
|
1990
|
+
Qe as wrapText
|
|
1553
1991
|
};
|