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