@agile-team/mach-report 2.10.0 → 2.11.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 +6 -2
- package/dist/ExcelBindingWizard-CjIiVox-.cjs +1 -0
- package/dist/ExcelBindingWizard-Dxm-K5HL.js +1240 -0
- package/dist/ParamEditor-D-Hf5xfO.cjs +1 -0
- package/dist/ParamEditor-DRGxzxeO.js +381 -0
- package/dist/ReportBatchPanel-BYgg0EDB.cjs +1 -0
- package/dist/ReportBatchPanel-Bby5yLzU.js +287 -0
- package/dist/ReportPreview-DWXROHBP.cjs +6 -0
- package/dist/ReportPreview-DiNXhQI0.js +4138 -0
- package/dist/ReportTemplateLibrary-C6CO7YCT.cjs +1 -0
- package/dist/ReportTemplateLibrary-DfzDXRvr.js +260 -0
- package/dist/RuleEditor-C2QsOHOs.cjs +1 -0
- package/dist/RuleEditor-D9wQHrkf.js +2024 -0
- package/dist/TemplateReviewPanel-BKofGrV9.js +222 -0
- package/dist/TemplateReviewPanel-DwtOcLue.cjs +1 -0
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.d.cts +2 -0
- package/dist/analytics.d.ts +2 -0
- package/dist/analytics.js +29 -29
- package/dist/batch-Bt3Fd27Z.cjs +1 -0
- package/dist/batch-mRqhhhjt.js +364 -0
- package/dist/computed-Bvk0W15F.js +521 -0
- package/dist/computed-CGV2a809.cjs +1 -0
- package/dist/config-B612mw0x.js +525 -0
- package/dist/config-BRoLo2oj.cjs +1 -0
- package/dist/designer.cjs +2 -2
- package/dist/designer.d.cts +659 -9
- package/dist/designer.d.ts +659 -9
- package/dist/designer.js +2030 -1824
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +147 -3
- package/dist/index.d.ts +147 -3
- package/dist/index.js +639 -592
- package/dist/injection-keys-Db_DyLkm.cjs +1 -0
- package/dist/injection-keys-e85udZCp.js +7 -0
- package/dist/list-cell-BuYn4tGF.cjs +1 -0
- package/dist/{list-cell-Dxyi7DOw.js → list-cell-ClFra1zS.js} +54 -40
- package/dist/matrix-DVyWiYsd.cjs +1 -0
- package/dist/matrix-yZsGnldA.js +227 -0
- package/dist/param-validation-BlHHXs6u.js +153 -0
- package/dist/param-validation-DCK039V1.cjs +1 -0
- package/dist/pdf.cjs +25 -25
- package/dist/pdf.d.cts +3 -0
- package/dist/pdf.d.ts +3 -0
- package/dist/pdf.js +677 -677
- package/dist/plugin-BDTU4D94.cjs +1 -0
- package/dist/plugin-Cd5G2QQn.js +22 -0
- package/dist/region-binding-workflow-CXDmt9Bs.js +977 -0
- package/dist/region-binding-workflow-DhQvu1co.cjs +3 -0
- package/dist/{report-params-B_VCihAh.js → report-params-B44imUd4.js} +1 -1
- package/dist/{report-params-CjWrjPl6.cjs → report-params-SJfhKgaX.cjs} +1 -1
- package/dist/server/node.d.cts +5 -2
- package/dist/server/node.d.ts +5 -2
- package/dist/server-node.cjs +1 -1
- package/dist/server-node.js +87 -87
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +201 -2
- package/dist/server.d.ts +201 -2
- package/dist/server.js +557 -658
- package/dist/style.css +1 -1
- package/dist/template-registry-WNXdkiET.js +506 -0
- package/dist/template-registry-ukBGlm8N.cjs +1 -0
- package/dist/template-review-BXp2oyqg.cjs +1 -0
- package/dist/template-review-BdcXSYbx.js +1616 -0
- package/dist/tree-BX380Rr7.cjs +1 -0
- package/dist/tree-CqcQ99NM.js +172 -0
- package/dist/{validate-UUy9yP4K.js → validate-7s0yn6ii.js} +44 -44
- package/dist/validate-DsRiNw8h.cjs +1 -0
- package/dist/vue/async.d.cts +93 -4
- package/dist/vue/async.d.ts +93 -4
- package/dist/vue/index.d.cts +145 -7
- package/dist/vue/index.d.ts +145 -7
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +5 -5
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +116 -113
- package/dist/{workbook-session-B-bW5_yR.js → workbook-session-BKOTwcoq.js} +1 -1
- package/dist/{workbook-session-D7RtdNo0.cjs → workbook-session-CLYLhZWu.cjs} +1 -1
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +5 -2
- package/dist/worker.d.ts +5 -2
- package/dist/worker.js +1 -1
- package/dist/xlsx.cjs +3 -3
- package/dist/xlsx.d.cts +129 -2
- package/dist/xlsx.d.ts +129 -2
- package/dist/xlsx.js +336 -242
- package/package.json +1 -1
- package/dist/ExcelBindingWizard-CF7RplWm.cjs +0 -1
- package/dist/ExcelBindingWizard-qhwEderR.js +0 -842
- package/dist/ReportPreview-BE1tCHqE.js +0 -4604
- package/dist/ReportPreview-QKRKQOe3.cjs +0 -6
- package/dist/RuleEditor-BA36yIV6.js +0 -1723
- package/dist/RuleEditor-CczJ6mJm.cjs +0 -1
- package/dist/TemplateReviewPanel-CHi4Alqa.cjs +0 -1
- package/dist/TemplateReviewPanel-Dz0G5o83.js +0 -217
- package/dist/binding-preview-BWsdf_z2.cjs +0 -2
- package/dist/binding-preview-DILq0-0f.js +0 -649
- package/dist/decimal-CI1OAczk.js +0 -87
- package/dist/decimal-CQA0xJex.cjs +0 -1
- package/dist/list-cell-CyM1ZlRN.cjs +0 -1
- package/dist/matrix-BbXarwyk.js +0 -661
- package/dist/matrix-Cm65WLLP.cjs +0 -1
- package/dist/param-validation-BWNjLcN0.js +0 -116
- package/dist/param-validation-CiTxFeZ8.cjs +0 -1
- package/dist/plugin-CThk42vJ.cjs +0 -1
- package/dist/plugin-tGn7-5oF.js +0 -25
- package/dist/template-registry-CGWTLtIA.cjs +0 -1
- package/dist/template-registry-DzlQs3OF.js +0 -434
- package/dist/template-review-D1RoNCPw.cjs +0 -1
- package/dist/template-review-fnteXRng.js +0 -1473
- package/dist/validate-Bf6ccFr2.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { D as Z, a as ve } from "./defaults-DXhiM1ZD.js";
|
|
2
|
-
import { b as
|
|
3
|
-
import { e as
|
|
4
|
-
import { a as
|
|
5
|
-
import { C as
|
|
6
|
-
import { i as ee, a as
|
|
2
|
+
import { b as kn, c as In, d as $n, L as Nn, S as Ln } from "./defaults-DXhiM1ZD.js";
|
|
3
|
+
import { e as Fn, f as On, p as zn, t as Hn, c as Wn } from "./list-cell-ClFra1zS.js";
|
|
4
|
+
import { a as H, r as W, b as Q, c as j, d as Me, m as ie, e as xe, p as O, f as Ee, P as K } from "./style-CQ1PK8ZB.js";
|
|
5
|
+
import { C as jn, M as Bn, g as Gn, h as Un } from "./style-CQ1PK8ZB.js";
|
|
6
|
+
import { i as ee, a as Se } from "./render-plan-Ck6koX9L.js";
|
|
7
7
|
import { R as qn } from "./render-plan-Ck6koX9L.js";
|
|
8
|
-
import { a as
|
|
8
|
+
import { a as Kn, v as Xn, b as Jn, c as Zn } from "./validate-7s0yn6ii.js";
|
|
9
9
|
import { v as je } from "./dataset-H5pFuQGU.js";
|
|
10
|
-
import { d as
|
|
11
|
-
import { h as ae, w as
|
|
12
|
-
import { c as
|
|
13
|
-
import { R as
|
|
14
|
-
import { P as
|
|
15
|
-
import { r as
|
|
16
|
-
import { r as
|
|
17
|
-
import { O as
|
|
18
|
-
import { r as
|
|
19
|
-
import { i as
|
|
20
|
-
import { o as
|
|
21
|
-
import { c as
|
|
22
|
-
import { p as
|
|
23
|
-
import { R as
|
|
24
|
-
import { R as
|
|
25
|
-
|
|
10
|
+
import { d as er } from "./dataset-H5pFuQGU.js";
|
|
11
|
+
import { h as ae, w as Te } from "./textwrap-DE1kgcJB.js";
|
|
12
|
+
import { c as nr, a as rr, b as ir, m as ar } from "./textwrap-DE1kgcJB.js";
|
|
13
|
+
import { R as Be, p as Ge } from "./template-review-BdcXSYbx.js";
|
|
14
|
+
import { P as sr, a as lr, b as cr, c as dr, d as mr, e as hr, f as gr, g as ur, h as fr, i as pr, j as wr, k as br, l as yr, m as vr, n as Mr, o as xr, q as Er, r as Sr, s as Tr, t as Cr, u as Rr, v as Pr, w as Ar, x as kr, y as Ir, z as $r } from "./template-review-BdcXSYbx.js";
|
|
15
|
+
import { r as Ce } from "./grid-geometry-BNptEcMm.js";
|
|
16
|
+
import { r as Re, a as oe } from "./assets-DegqDNqY.js";
|
|
17
|
+
import { O as Lr } from "./assets-DegqDNqY.js";
|
|
18
|
+
import { r as G, n as Pe, O as Ue } from "./capabilities-CK_7hizc.js";
|
|
19
|
+
import { i as Fr } from "./capabilities-CK_7hizc.js";
|
|
20
|
+
import { o as Ve } from "./progress-7OSZbFok.js";
|
|
21
|
+
import { c as qe } from "./page-window-index-CIuT4BAv.js";
|
|
22
|
+
import { p as D } from "./template-registry-WNXdkiET.js";
|
|
23
|
+
import { R as zr, a as Hr, c as Wr, d as _r, s as jr, v as Br, b as Gr } from "./template-registry-WNXdkiET.js";
|
|
24
|
+
import { R as Vr, a as qr, f as Yr, i as Kr, b as Xr, c as Jr, p as Zr, r as Qr, v as ei, d as ti } from "./param-validation-BlHHXs6u.js";
|
|
25
|
+
import { T as ri, c as ii, v as ai } from "./tree-CqcQ99NM.js";
|
|
26
|
+
const Ye = {
|
|
26
27
|
root: "mr-root",
|
|
27
28
|
page: "mr-page",
|
|
28
29
|
comp: "mr-comp",
|
|
@@ -40,9 +41,9 @@ const Ve = {
|
|
|
40
41
|
unknown: "mr-unknown"
|
|
41
42
|
};
|
|
42
43
|
function E(e, t) {
|
|
43
|
-
return t?.classNames?.[e] ??
|
|
44
|
+
return t?.classNames?.[e] ?? Ye[e];
|
|
44
45
|
}
|
|
45
|
-
class
|
|
46
|
+
class Ke {
|
|
46
47
|
constructor() {
|
|
47
48
|
this.props = [];
|
|
48
49
|
}
|
|
@@ -50,7 +51,7 @@ class Ye {
|
|
|
50
51
|
return n == null || n === !1 || n === "" ? this : (this.props.push([t, String(n)]), this);
|
|
51
52
|
}
|
|
52
53
|
mm(t, n, r, i = 2) {
|
|
53
|
-
return this.add(t, `${
|
|
54
|
+
return this.add(t, `${H(ie(n, r), i)}px`);
|
|
54
55
|
}
|
|
55
56
|
toString() {
|
|
56
57
|
let t = "";
|
|
@@ -63,176 +64,176 @@ class Ye {
|
|
|
63
64
|
n && (t.style.cssText = n);
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
-
return new
|
|
67
|
+
function v(e, t = "unset") {
|
|
68
|
+
return new Ke().add("all", t).add("display", e).add("box-sizing", "border-box");
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
+
function Ae(e, t, n) {
|
|
70
71
|
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);
|
|
71
|
-
const r =
|
|
72
|
-
e.add("font-size", `${
|
|
72
|
+
const r = W(t, n);
|
|
73
|
+
e.add("font-size", `${H(r.fontSizePx, 2)}px`);
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
+
function Xe(e, t, n) {
|
|
75
76
|
const r = t.style ?? {};
|
|
76
|
-
|
|
77
|
+
Ae(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);
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
-
const
|
|
80
|
-
a.className = E("cell", i), a.dataset.mrRowIndex = String(e.ri), a.dataset.mrColumnIndex = String(e.ci), a.setAttribute("role", t.table?.role === "header" ? "columnheader" : "cell"),
|
|
81
|
-
const
|
|
82
|
-
|
|
79
|
+
function Je(e, t, n, r, i, o) {
|
|
80
|
+
const l = e.cell, a = o.createElement("td");
|
|
81
|
+
a.className = E("cell", i), a.dataset.mrRowIndex = String(e.ri), a.dataset.mrColumnIndex = String(e.ci), a.setAttribute("role", t.table?.role === "header" ? "columnheader" : "cell"), l.colSpan && (a.colSpan = l.colSpan), l.rowSpan && (a.rowSpan = l.rowSpan);
|
|
82
|
+
const s = xe(t.style, l.style), c = v("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", s.backgroundColor).add("vertical-align", s.verticalAlign ?? "middle");
|
|
83
|
+
Ae(c, s, r), c.applyTo(a);
|
|
83
84
|
const d = o.createElement("div");
|
|
84
|
-
d.className = "mr-cell-content",
|
|
85
|
-
for (const m of
|
|
85
|
+
d.className = "mr-cell-content", v("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", s.verticalAlign === "top" ? "flex-start" : s.verticalAlign === "bottom" ? "flex-end" : "center").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(d), l.text != null && d.append(l.text);
|
|
86
|
+
for (const m of l.children ?? []) d.appendChild(ke(m, r, i, o));
|
|
86
87
|
return a.appendChild(d), a;
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
-
return
|
|
90
|
-
const o = `${
|
|
91
|
-
|
|
89
|
+
function Ze(e, t, n, r) {
|
|
90
|
+
return Re(e, t).map((i) => {
|
|
91
|
+
const o = `${H(i.widthPt * n / 72, 2)}px solid ${i.color}`, l = r.createElement("div");
|
|
92
|
+
l.className = "mr-grid-edge", l.setAttribute("aria-hidden", "true");
|
|
92
93
|
const a = i.kind === "h";
|
|
93
|
-
return
|
|
94
|
+
return v("block").add("position", "absolute").add("pointer-events", "none").mm("left", a ? i.from : i.pos, n).mm("top", a ? i.pos : i.from, n).mm("width", a ? i.to - i.from : 0, n).mm("height", a ? 0 : i.to - i.from, n).add(a ? "border-top" : "border-left", o).applyTo(l), l;
|
|
94
95
|
});
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
+
function Qe(e, t, n, r, i) {
|
|
97
98
|
const o = i.createElement("table");
|
|
98
|
-
o.className = E("grid", r), o.setAttribute("role", "table"),
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
const
|
|
99
|
+
o.className = E("grid", r), o.setAttribute("role", "table"), v("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(o);
|
|
100
|
+
const l = Ce(e, t.widthMm, t.heightMm), a = i.createElement("tbody");
|
|
101
|
+
v("contents").applyTo(a), o.appendChild(a);
|
|
102
|
+
const s = e.cells.map(() => {
|
|
102
103
|
const d = i.createElement("tr");
|
|
103
|
-
return d.className = E("row", r), d.setAttribute("role", "row"),
|
|
104
|
+
return d.className = E("row", r), d.setAttribute("role", "row"), v("contents").applyTo(d), a.appendChild(d), d;
|
|
104
105
|
});
|
|
105
|
-
for (const d of
|
|
106
|
-
|
|
106
|
+
for (const d of l.cells)
|
|
107
|
+
s[d.ri].appendChild(Je(d, t, e.paddingMm ?? 0.5, n, r, i));
|
|
107
108
|
const c = i.createElement("div");
|
|
108
|
-
return
|
|
109
|
+
return v("block").add("position", "relative").add("width", "100%").add("height", "100%").applyTo(c), c.append(o, ...Ze(l, t, n, i)), c;
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
+
function et(e, t, n, r) {
|
|
111
112
|
const i = r.createElement("div");
|
|
112
|
-
i.className = E("paragraph", n),
|
|
113
|
+
i.className = E("paragraph", n), v("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(i);
|
|
113
114
|
for (const o of e.segments || []) {
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
const a =
|
|
115
|
+
const l = r.createElement("span");
|
|
116
|
+
l.className = E("segment", n), l.textContent = o.kind === "field" ? o.field ?? "" : o.text ?? "";
|
|
117
|
+
const a = v("inline");
|
|
117
118
|
if (o.style) {
|
|
118
|
-
const
|
|
119
|
-
a.add("color",
|
|
119
|
+
const s = o.style;
|
|
120
|
+
a.add("color", s.color).add("font-family", s.fontFamily).add("font-weight", s.bold != null ? s.bold ? "700" : "400" : void 0).add("font-style", s.italic != null ? s.italic ? "italic" : "normal" : void 0).add("text-decoration", s.underline != null ? s.underline ? "underline" : "none" : void 0), (s.fontSize != null || s.fontSizePx != null) && a.add("font-size", `${H(W(s, t).fontSizePx, 2)}px`);
|
|
120
121
|
}
|
|
121
|
-
a.applyTo(
|
|
122
|
+
a.applyTo(l), i.appendChild(l);
|
|
122
123
|
}
|
|
123
124
|
return i;
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
-
if (
|
|
126
|
+
function tt(e, t, n, r) {
|
|
127
|
+
if (Se(e)) {
|
|
127
128
|
const i = r.createElement("div");
|
|
128
|
-
i.className = E("rich", n),
|
|
129
|
-
for (const o of e.richParagraphs) i.appendChild(
|
|
129
|
+
i.className = E("rich", n), v("block").applyTo(i);
|
|
130
|
+
for (const o of e.richParagraphs) i.appendChild(et(o, t, n, r));
|
|
130
131
|
return i;
|
|
131
132
|
}
|
|
132
133
|
if (Array.isArray(e.lines) && e.lines.length > 0) {
|
|
133
134
|
const i = r.createElement("div");
|
|
134
|
-
i.className = E("lines", n),
|
|
135
|
+
i.className = E("lines", n), v("block").applyTo(i);
|
|
135
136
|
for (const o of e.lines) {
|
|
136
|
-
const
|
|
137
|
-
|
|
137
|
+
const l = r.createElement("div");
|
|
138
|
+
l.className = E("line", n), l.textContent = o, v("block").add("white-space", "pre").add("min-height", "1lh").applyTo(l), i.appendChild(l);
|
|
138
139
|
}
|
|
139
140
|
return i;
|
|
140
141
|
}
|
|
141
142
|
return e.text ?? "";
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
+
function nt(e, t, n, r) {
|
|
144
145
|
const i = r.createElement("div");
|
|
145
146
|
i.className = E("text", n);
|
|
146
147
|
const o = e.style || {};
|
|
147
|
-
return
|
|
148
|
+
return v("flex").add("width", "100%").add("height", "100%").add("flex-direction", "column").add("justify-content", o.verticalAlign === "middle" ? "center" : o.verticalAlign === "bottom" ? "flex-end" : "flex-start").add("overflow-wrap", "anywhere").add("overflow", "hidden").applyTo(i), i.append(tt(e, t, n, r)), i;
|
|
148
149
|
}
|
|
149
|
-
function
|
|
150
|
+
function rt(e, t, n) {
|
|
150
151
|
const r = n.createElement("img");
|
|
151
|
-
return r.className = E("image", t), r.src = e.imageData,
|
|
152
|
+
return r.className = E("image", t), r.src = e.imageData, v("block").add("width", "100%").add("height", "100%").add("object-fit", "contain").applyTo(r), r.alt = e.kind, r;
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
+
function ue(e, t, n, r) {
|
|
154
155
|
const i = r.createElement("div");
|
|
155
156
|
i.className = E("shape", n);
|
|
156
|
-
const o = e.style || {},
|
|
157
|
-
return e.grid ? c.add("position", "relative") : e.kind === "rect" ? (a.top && c.add("border-top",
|
|
157
|
+
const o = e.style || {}, l = j(o), a = Me(o), s = `${H(l.widthPt * t / 72, 2)}px solid ${l.color}`, c = v("block");
|
|
158
|
+
return e.grid ? c.add("position", "relative") : e.kind === "rect" ? (a.top && c.add("border-top", s), a.right && c.add("border-right", s), a.bottom && c.add("border-bottom", s), a.left && c.add("border-left", s)) : e.kind === "ellipse" ? (a.inner && c.add("border", s).add("border-radius", "50%"), o.backgroundColor && c.add("background-color", o.backgroundColor)) : e.kind === "line" && c.add("height", "0").add("border-top", s), c.add("box-sizing", "border-box").add("width", "100%").add("height", "100%"), c.applyTo(i), i;
|
|
158
159
|
}
|
|
159
|
-
function
|
|
160
|
+
function it(e, t, n) {
|
|
160
161
|
const r = n.createElementNS("http://www.w3.org/2000/svg", "svg"), i = ie(e.widthMm, t), o = ie(e.heightMm, t);
|
|
161
162
|
r.setAttribute("width", String(Math.max(1, i))), r.setAttribute("height", String(Math.max(1, o))), r.setAttribute("aria-hidden", "true"), r.style.overflow = "visible", r.style.display = "block";
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
const a =
|
|
165
|
-
return
|
|
163
|
+
const l = n.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
164
|
+
l.setAttribute("x1", "0"), l.setAttribute("x2", String(i)), l.setAttribute("y1", e.lineDirection === "up" ? String(o) : "0"), l.setAttribute("y2", e.lineDirection === "up" ? "0" : String(o));
|
|
165
|
+
const a = j({ ...e.style, borderColor: e.style?.lineColor ?? e.style?.borderColor });
|
|
166
|
+
return l.setAttribute("stroke", a.color), l.setAttribute("stroke-width", String(a.widthPt * t / 72)), r.appendChild(l), r;
|
|
166
167
|
}
|
|
167
|
-
function
|
|
168
|
+
function ke(e, t, n, r) {
|
|
168
169
|
const i = r.createElement("div");
|
|
169
170
|
i.className = `${E("comp", n)} mr-kind-${e.kind}`;
|
|
170
|
-
const o =
|
|
171
|
-
if (
|
|
172
|
-
return i.appendChild(
|
|
171
|
+
const o = v("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");
|
|
172
|
+
if (Xe(o, e, t), o.applyTo(i), ee(e))
|
|
173
|
+
return i.appendChild(rt(e, n, r)), i;
|
|
173
174
|
if (e.kind === "text")
|
|
174
|
-
return i.appendChild(
|
|
175
|
+
return i.appendChild(nt(e, t, n, r)), i;
|
|
175
176
|
if (e.grid) {
|
|
176
|
-
const a =
|
|
177
|
-
return a.appendChild(
|
|
177
|
+
const a = ue(e, t, n, r);
|
|
178
|
+
return a.appendChild(Qe(e.grid, e, t, n, r)), i.appendChild(a), i;
|
|
178
179
|
}
|
|
179
180
|
if (e.kind === "line" && e.lineDirection)
|
|
180
|
-
return i.appendChild(
|
|
181
|
+
return i.appendChild(it(e, t, r)), i;
|
|
181
182
|
if (e.kind === "line" || e.kind === "rect" || e.kind === "ellipse")
|
|
182
|
-
return i.appendChild(
|
|
183
|
-
const
|
|
184
|
-
return
|
|
183
|
+
return i.appendChild(ue(e, t, n, r)), i;
|
|
184
|
+
const l = r.createElement("div");
|
|
185
|
+
return l.className = E("unknown", n), v("block").applyTo(l), l.textContent = e.fallbackText ?? `[${e.kind}]`, l.dataset.mrUnsupported = e.kind, l.setAttribute("role", "note"), i.appendChild(l), i;
|
|
185
186
|
}
|
|
186
|
-
function
|
|
187
|
+
function at(e, t, n, r) {
|
|
187
188
|
const i = r.createElement("div");
|
|
188
|
-
return i.className = E("page", n),
|
|
189
|
-
const a =
|
|
190
|
-
a.dataset.mrComponentIndex = String(
|
|
189
|
+
return i.className = E("page", n), v("block", "initial").add("position", "relative").add("font-family", Z).add("font-size", `${H(W(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", ve).add("overflow", "hidden").add("box-sizing", "border-box").applyTo(i), e.components.forEach((o, l) => {
|
|
190
|
+
const a = ke(o, t, n, r);
|
|
191
|
+
a.dataset.mrComponentIndex = String(l), i.appendChild(a);
|
|
191
192
|
}), i;
|
|
192
193
|
}
|
|
193
|
-
function
|
|
194
|
+
function dn(e, t, n = {}) {
|
|
194
195
|
const r = n.dpi ?? 96;
|
|
195
|
-
|
|
196
|
+
G(e, "dom", n);
|
|
196
197
|
const i = t.createElement("div");
|
|
197
|
-
return i.className = E("root", n),
|
|
198
|
-
i.appendChild(
|
|
198
|
+
return i.className = E("root", n), v("block").applyTo(i), i.dataset.schemaVersion = e.schemaVersion, e.pages.forEach((o) => {
|
|
199
|
+
i.appendChild(at(o, r, n, t));
|
|
199
200
|
}), i;
|
|
200
201
|
}
|
|
201
|
-
function
|
|
202
|
+
function R(e) {
|
|
202
203
|
if (e?.aborted) throw e.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
203
204
|
}
|
|
204
|
-
const
|
|
205
|
+
const ot = (e, t) => (R(t), /^data:image\/(?:png|jpe?g|webp|gif|svg\+xml)[;,]/i.test(e) ? new Promise((n, r) => {
|
|
205
206
|
const i = new Image(), o = () => {
|
|
206
|
-
i.onload = null, i.onerror = null, t?.removeEventListener("abort",
|
|
207
|
-
},
|
|
207
|
+
i.onload = null, i.onerror = null, t?.removeEventListener("abort", l);
|
|
208
|
+
}, l = () => {
|
|
208
209
|
o(), i.src = "", r(t?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
|
|
209
210
|
};
|
|
210
211
|
i.onload = () => {
|
|
211
212
|
o(), n(i);
|
|
212
213
|
}, i.onerror = () => {
|
|
213
214
|
o(), r(new Error("Image could not be decoded for Canvas output."));
|
|
214
|
-
}, t?.addEventListener("abort",
|
|
215
|
+
}, t?.addEventListener("abort", l, { once: !0 }), i.src = e;
|
|
215
216
|
}) : Promise.reject(new TypeError("Canvas imageData must be an image data URL; provide imageLoader for other sources.")));
|
|
216
|
-
function
|
|
217
|
-
return
|
|
217
|
+
function st(e, t, n) {
|
|
218
|
+
return R(n), n ? new Promise((r, i) => {
|
|
218
219
|
const o = () => i(n.reason ?? new DOMException("The operation was aborted.", "AbortError"));
|
|
219
220
|
n.addEventListener("abort", o, { once: !0 }), Promise.resolve().then(() => e(t, n)).then(r, i).finally(() => n.removeEventListener("abort", o));
|
|
220
221
|
}) : e(t);
|
|
221
222
|
}
|
|
222
|
-
async function
|
|
223
|
+
async function lt(e, t, n) {
|
|
223
224
|
const r = /* @__PURE__ */ new Map();
|
|
224
225
|
for (const i of e.components)
|
|
225
|
-
!ee(i) || r.has(i.imageData) || r.set(i.imageData, await
|
|
226
|
-
return
|
|
226
|
+
!ee(i) || r.has(i.imageData) || r.set(i.imageData, await st(t, i.imageData, n));
|
|
227
|
+
return R(n), r;
|
|
227
228
|
}
|
|
228
|
-
function
|
|
229
|
-
const
|
|
230
|
-
if (a <= 0 ||
|
|
231
|
-
const c = Math.min(i / a, o /
|
|
229
|
+
function ct(e, t, n, r, i, o) {
|
|
230
|
+
const l = t, a = l.naturalWidth ?? l.width ?? i, s = l.naturalHeight ?? l.height ?? o;
|
|
231
|
+
if (a <= 0 || s <= 0) throw new RangeError("Decoded Canvas image dimensions must be positive.");
|
|
232
|
+
const c = Math.min(i / a, o / s), d = a * c, m = s * c;
|
|
232
233
|
e.drawImage(t, n + (i - d) / 2, r + (o - m) / 2, d, m);
|
|
233
234
|
}
|
|
234
|
-
function
|
|
235
|
-
return
|
|
235
|
+
function dt(e) {
|
|
236
|
+
return qe(e.pageHeightsPx, e.gapPx).window(e.viewportHeightPx, e.scrollTopPx, e.overscan);
|
|
236
237
|
}
|
|
237
238
|
const se = 96 / 25.4;
|
|
238
239
|
function le(e, t = 96) {
|
|
@@ -242,204 +243,204 @@ function le(e, t = 96) {
|
|
|
242
243
|
heightPx: Math.max(1, Math.round(e.pageHeightMm * n))
|
|
243
244
|
};
|
|
244
245
|
}
|
|
245
|
-
function
|
|
246
|
+
function Ie(e, t, n, r = 64e6) {
|
|
246
247
|
if (!Number.isFinite(t) || t <= 0 || !Number.isFinite(n) || n <= 0) throw new RangeError("Canvas dpr and dpi must be positive finite numbers.");
|
|
247
248
|
if (!Number.isFinite(r) || r <= 0) throw new RangeError("maxCanvasPixels must be positive and finite.");
|
|
248
|
-
const i = le(e, n), o = Math.round(i.widthPx * t),
|
|
249
|
-
if (!Number.isSafeInteger(o) || !Number.isSafeInteger(
|
|
250
|
-
return { width: o, height:
|
|
251
|
-
}
|
|
252
|
-
function
|
|
253
|
-
const i = document.createElement("canvas"), { widthPx: o, heightPx:
|
|
254
|
-
i.width = a.width, i.height = a.height, i.style.width = `${o}px`, i.style.height = `${
|
|
255
|
-
const
|
|
256
|
-
if (!
|
|
249
|
+
const i = le(e, n), o = Math.round(i.widthPx * t), l = Math.round(i.heightPx * t);
|
|
250
|
+
if (!Number.isSafeInteger(o) || !Number.isSafeInteger(l) || o * l > r) throw new RangeError("Canvas page exceeds maxCanvasPixels; reduce resolution or split the report.");
|
|
251
|
+
return { width: o, height: l };
|
|
252
|
+
}
|
|
253
|
+
function $e(e, t, n, r) {
|
|
254
|
+
const i = document.createElement("canvas"), { widthPx: o, heightPx: l } = le(e, n), a = Ie(e, t, n, r);
|
|
255
|
+
i.width = a.width, i.height = a.height, i.style.width = `${o}px`, i.style.height = `${l}px`;
|
|
256
|
+
const s = i.getContext("2d");
|
|
257
|
+
if (!s)
|
|
257
258
|
throw new Error("当前环境不支持 Canvas 2D(测试需真浏览器,见 e2e/canvas.spec.ts)");
|
|
258
|
-
return
|
|
259
|
+
return s.scale(t, t), s.fillStyle = "#ffffff", s.fillRect(0, 0, o, l), { canvas: i, ctx: s };
|
|
259
260
|
}
|
|
260
|
-
function
|
|
261
|
-
return
|
|
261
|
+
function mn(e, t = 96) {
|
|
262
|
+
return W(e, t).fontSizePx;
|
|
262
263
|
}
|
|
263
|
-
function
|
|
264
|
-
e.font = `${t.italic ? "italic " : ""}${t.bold ? "bold " : ""}${t.fontSizePx}px ${
|
|
265
|
-
const
|
|
266
|
-
`), d = c.length *
|
|
264
|
+
function Ne(e, t, n, r, i, o, l, a = "top") {
|
|
265
|
+
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";
|
|
266
|
+
const s = t.fontSizePx * t.lineHeight, c = t.text === "" ? [""] : t.text.split(`
|
|
267
|
+
`), d = c.length * s;
|
|
267
268
|
let m = r;
|
|
268
|
-
a === "middle" ? m = r + (o - d) / 2 : a === "bottom" && (m = r + o - d), c.forEach((h,
|
|
269
|
-
|
|
269
|
+
a === "middle" ? m = r + (o - d) / 2 : a === "bottom" && (m = r + o - d), c.forEach((h, g) => {
|
|
270
|
+
mt(e, h, t, n, m + g * s + t.fontSizePx * 0.8, i);
|
|
270
271
|
}), e.textAlign = "left";
|
|
271
272
|
}
|
|
272
|
-
function
|
|
273
|
-
const
|
|
273
|
+
function mt(e, t, n, r, i, o) {
|
|
274
|
+
const l = Array.from(t), a = n.letterSpacingPx ?? 0;
|
|
274
275
|
if (!a) {
|
|
275
276
|
e.textAlign = n.align === "center" ? "center" : n.align === "right" ? "right" : "left";
|
|
276
277
|
const m = n.align === "center" ? r + o / 2 : n.align === "right" ? r + o : r;
|
|
277
278
|
e.fillText(t, m, i);
|
|
278
279
|
return;
|
|
279
280
|
}
|
|
280
|
-
const
|
|
281
|
+
const s = e.measureText(t).width + Math.max(0, l.length - 1) * a, c = n.align === "center" ? r + (o - s) / 2 : n.align === "right" ? r + o - s : r;
|
|
281
282
|
e.textAlign = "left";
|
|
282
283
|
let d = "";
|
|
283
|
-
|
|
284
|
+
l.forEach((m, h) => {
|
|
284
285
|
e.fillText(m, c + e.measureText(d).width + h * a, i), d += m;
|
|
285
286
|
});
|
|
286
287
|
}
|
|
287
|
-
function
|
|
288
|
-
for (const a of
|
|
289
|
-
e.strokeStyle = a.color, e.lineWidth =
|
|
288
|
+
function ht(e, t, n, r, i, o, l) {
|
|
289
|
+
for (const a of Re(t, n))
|
|
290
|
+
e.strokeStyle = a.color, e.lineWidth = O(a.widthPt, l), e.beginPath(), a.kind === "v" ? (e.moveTo(r + a.pos * o, i + a.from * o), e.lineTo(r + a.pos * o, i + a.to * o)) : (e.moveTo(r + a.from * o, i + a.pos * o), e.lineTo(r + a.to * o, i + a.pos * o)), e.stroke();
|
|
290
291
|
}
|
|
291
|
-
function
|
|
292
|
+
function gt(e, t, n, r, i, o) {
|
|
292
293
|
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();
|
|
293
294
|
}
|
|
294
|
-
function ut(e, t, n, r, i, o,
|
|
295
|
-
const m =
|
|
296
|
-
for (const
|
|
297
|
-
const f =
|
|
298
|
-
f && (e.fillStyle = f, e.fillRect(r +
|
|
295
|
+
function ut(e, t, n, r, i, o, l, a, s, c, d) {
|
|
296
|
+
const m = Ce(t, o / a, l / a);
|
|
297
|
+
for (const g of m.cells) {
|
|
298
|
+
const f = g.cell.style?.backgroundColor ?? n.style?.backgroundColor;
|
|
299
|
+
f && (e.fillStyle = f, e.fillRect(r + g.xMm * a, i + g.yMm * a, g.widthMm * a, g.heightMm * a));
|
|
299
300
|
}
|
|
300
|
-
|
|
301
|
+
ht(e, m, n, r, i, a, s);
|
|
301
302
|
const h = t.paddingMm ?? 0.5;
|
|
302
|
-
for (const
|
|
303
|
-
const f =
|
|
303
|
+
for (const g of m.cells) {
|
|
304
|
+
const f = g.cell.text ?? "";
|
|
304
305
|
if (!f) continue;
|
|
305
|
-
const b =
|
|
306
|
+
const b = xe(n.style, g.cell.style), I = W(b, s), C = g.cell.indentMm ?? 0, S = Math.max(0, g.widthMm - 2 * h - C), A = Te(f, S, { fontSizePt: I.fontSizePt, bold: b.bold, italic: b.italic, fontFamily: b.fontFamily ?? c, letterSpacingPt: b.letterSpacing }, d).join(`
|
|
306
307
|
`);
|
|
307
|
-
|
|
308
|
+
Ne(
|
|
308
309
|
e,
|
|
309
310
|
{
|
|
310
|
-
text:
|
|
311
|
-
fontSizePx:
|
|
311
|
+
text: A,
|
|
312
|
+
fontSizePx: I.fontSizePx,
|
|
312
313
|
bold: b.bold ?? !1,
|
|
313
314
|
italic: b.italic,
|
|
314
|
-
color:
|
|
315
|
+
color: Ee(b, ve),
|
|
315
316
|
align: b.align ?? "left",
|
|
316
317
|
lineHeight: Q(b),
|
|
317
|
-
letterSpacingPx:
|
|
318
|
+
letterSpacingPx: O(b.letterSpacing ?? 0, s)
|
|
318
319
|
},
|
|
319
|
-
r + (
|
|
320
|
-
i + (
|
|
321
|
-
|
|
322
|
-
Math.max(0,
|
|
320
|
+
r + (g.xMm + h + C) * a,
|
|
321
|
+
i + (g.yMm + h) * a,
|
|
322
|
+
S * a,
|
|
323
|
+
Math.max(0, g.heightMm - 2 * h) * a,
|
|
323
324
|
b.fontFamily ?? c,
|
|
324
325
|
b.verticalAlign ?? "middle"
|
|
325
326
|
);
|
|
326
327
|
}
|
|
327
328
|
}
|
|
328
|
-
function
|
|
329
|
-
const c = t.style ?? {}, d =
|
|
329
|
+
function ft(e, t, n, r, i, o, l, a, s) {
|
|
330
|
+
const c = t.style ?? {}, d = W(c, l), m = Se(t) ? t.richParagraphs.map((h) => h.segments.map((g) => g.text ?? g.field ?? "").join("")).join(`
|
|
330
331
|
`) : t.lines?.length ? t.lines.join(`
|
|
331
|
-
`) :
|
|
332
|
+
`) : Te(t.text ?? "", t.widthMm, { fontSizePt: d.fontSizePt, bold: c.bold, italic: c.italic, fontFamily: c.fontFamily ?? a, letterSpacingPt: c.letterSpacing }, s).join(`
|
|
332
333
|
`);
|
|
333
|
-
|
|
334
|
+
Ne(e, {
|
|
334
335
|
text: m,
|
|
335
336
|
fontSizePx: d.fontSizePx,
|
|
336
337
|
bold: c.bold ?? !1,
|
|
337
338
|
italic: c.italic,
|
|
338
|
-
color:
|
|
339
|
+
color: Ee(c),
|
|
339
340
|
align: c.align ?? "left",
|
|
340
341
|
lineHeight: Q(c),
|
|
341
|
-
letterSpacingPx:
|
|
342
|
+
letterSpacingPx: O(c.letterSpacing ?? 0, l)
|
|
342
343
|
}, n, r, i, o, c.fontFamily ?? a, c.verticalAlign);
|
|
343
344
|
}
|
|
344
|
-
function ce(e, t, n, r, i, o,
|
|
345
|
-
const a = t.leftMm * n,
|
|
345
|
+
function ce(e, t, n, r, i, o, l) {
|
|
346
|
+
const a = t.leftMm * n, s = t.topMm * n, c = t.widthMm * n, d = t.heightMm * n, m = t.style ?? {};
|
|
346
347
|
if (ee(t)) {
|
|
347
|
-
const h =
|
|
348
|
-
h ?
|
|
348
|
+
const h = l?.get(t.imageData);
|
|
349
|
+
h ? ct(e, h, a, s, c, d) : fe(e, t, a, s, c, d);
|
|
349
350
|
return;
|
|
350
351
|
}
|
|
351
352
|
if (t.grid) {
|
|
352
|
-
ut(e, t.grid, t, a,
|
|
353
|
+
ut(e, t.grid, t, a, s, c, d, n, r, i, o);
|
|
353
354
|
return;
|
|
354
355
|
}
|
|
355
356
|
switch (t.kind) {
|
|
356
357
|
case "text": {
|
|
357
|
-
|
|
358
|
+
ft(e, t, a, s, c, d, r, i, o);
|
|
358
359
|
break;
|
|
359
360
|
}
|
|
360
361
|
case "rect": {
|
|
361
|
-
const h =
|
|
362
|
-
m.backgroundColor && (e.fillStyle = m.backgroundColor, e.fillRect(a,
|
|
362
|
+
const h = j(m), g = Me(m);
|
|
363
|
+
m.backgroundColor && (e.fillStyle = m.backgroundColor, e.fillRect(a, s, c, d)), g.inner && (e.strokeStyle = h.color, e.lineWidth = O(h.widthPt, r), gt(e, g, a, s, c, d));
|
|
363
364
|
break;
|
|
364
365
|
}
|
|
365
366
|
case "line": {
|
|
366
|
-
const h =
|
|
367
|
-
e.strokeStyle = h.color, e.lineWidth =
|
|
368
|
-
const
|
|
369
|
-
e.moveTo(a,
|
|
367
|
+
const h = j({ ...m, borderColor: m.lineColor ?? m.borderColor });
|
|
368
|
+
e.strokeStyle = h.color, e.lineWidth = O(h.widthPt, r), e.beginPath();
|
|
369
|
+
const g = t.lineDirection === "up" ? s + d : t.lineDirection === "down" ? s : s + d / 2, f = t.lineDirection === "up" ? s : t.lineDirection === "down" ? s + d : s + d / 2;
|
|
370
|
+
e.moveTo(a, g), e.lineTo(a + c, f), e.stroke();
|
|
370
371
|
break;
|
|
371
372
|
}
|
|
372
373
|
case "ellipse": {
|
|
373
|
-
const h =
|
|
374
|
-
e.strokeStyle = h.color, e.lineWidth =
|
|
374
|
+
const h = j(m);
|
|
375
|
+
e.strokeStyle = h.color, e.lineWidth = O(h.widthPt, r), m.backgroundColor && (e.fillStyle = m.backgroundColor, e.beginPath(), e.ellipse(a + c / 2, s + d / 2, c / 2, d / 2, 0, 0, Math.PI * 2), e.fill()), e.beginPath(), e.ellipse(a + c / 2, s + d / 2, c / 2, d / 2, 0, 0, Math.PI * 2), e.stroke();
|
|
375
376
|
break;
|
|
376
377
|
}
|
|
377
378
|
default:
|
|
378
|
-
fe(e, t, a,
|
|
379
|
+
fe(e, t, a, s, c, d);
|
|
379
380
|
break;
|
|
380
381
|
}
|
|
381
382
|
}
|
|
382
383
|
function fe(e, t, n, r, i, o) {
|
|
383
384
|
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();
|
|
384
385
|
}
|
|
385
|
-
async function
|
|
386
|
+
async function hn(e, t = {}) {
|
|
386
387
|
if (typeof document > "u")
|
|
387
388
|
throw new Error("renderPlanToImages 需要浏览器环境(SSR/Node 请在客户端钩子中调用)");
|
|
388
389
|
const { format: n = "png", quality: r = 0.92, ...i } = t;
|
|
389
390
|
if (n !== "png" && n !== "jpeg") throw new TypeError("Image format must be png or jpeg.");
|
|
390
391
|
if (!Number.isFinite(r) || r < 0 || r > 1) throw new RangeError("Image quality must be between 0 and 1.");
|
|
391
|
-
|
|
392
|
+
R(t.signal);
|
|
392
393
|
const o = await oe(e, { ...t, format: "canvas" });
|
|
393
394
|
e = o.plan;
|
|
394
|
-
const
|
|
395
|
+
const l = [...o.diagnostics, ...G(e, "canvas", t)], a = n === "jpeg" ? "image/jpeg" : "image/png", s = [], c = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
|
|
395
396
|
for (let d = Math.max(0, t.start ?? 0); d <= c; d++) {
|
|
396
|
-
|
|
397
|
-
const m = await
|
|
397
|
+
R(t.signal);
|
|
398
|
+
const m = await Le(e.pages[d], d, i, l);
|
|
398
399
|
try {
|
|
399
|
-
|
|
400
|
+
s.push(await pt(m, a, r, t.signal));
|
|
400
401
|
} finally {
|
|
401
402
|
m.width = 0, m.height = 0;
|
|
402
403
|
}
|
|
403
|
-
await
|
|
404
|
+
await Ve(t, s.length, c - Math.max(0, t.start ?? 0) + 1);
|
|
404
405
|
}
|
|
405
|
-
return
|
|
406
|
+
return R(t.signal), { blobs: s, diagnostics: l };
|
|
406
407
|
}
|
|
407
|
-
function
|
|
408
|
-
return
|
|
409
|
-
const
|
|
410
|
-
r?.addEventListener("abort",
|
|
408
|
+
function pt(e, t, n, r) {
|
|
409
|
+
return R(r), new Promise((i, o) => {
|
|
410
|
+
const l = () => o(r?.reason ?? new DOMException("The operation was aborted.", "AbortError"));
|
|
411
|
+
r?.addEventListener("abort", l, { once: !0 });
|
|
411
412
|
try {
|
|
412
413
|
e.toBlob((a) => {
|
|
413
|
-
r?.removeEventListener("abort",
|
|
414
|
+
r?.removeEventListener("abort", l), a ? i(a) : o(new Error("Canvas encoding failed; no empty image was emitted."));
|
|
414
415
|
}, t, n);
|
|
415
416
|
} catch (a) {
|
|
416
|
-
r?.removeEventListener("abort",
|
|
417
|
+
r?.removeEventListener("abort", l), o(a);
|
|
417
418
|
}
|
|
418
419
|
});
|
|
419
420
|
}
|
|
420
|
-
function
|
|
421
|
-
if (
|
|
421
|
+
function gn(e, t = {}) {
|
|
422
|
+
if (R(t.signal), typeof document > "u")
|
|
422
423
|
throw new Error("renderPlanToCanvas 需要浏览器环境(SSR 请在客户端钩子中调用)");
|
|
423
|
-
const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, i = r / 96 * se, o = t.fontFamily ?? Z,
|
|
424
|
+
const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, i = r / 96 * se, o = t.fontFamily ?? Z, l = t.measurer ?? ae, a = Math.max(0, t.start ?? 0), s = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1), c = [], d = G(e, "canvas", t), m = wt(e, a, s);
|
|
424
425
|
for (const h of m)
|
|
425
426
|
Pe(h, t), d.push(h);
|
|
426
|
-
if (t.fidelity === "strict" && m.length) throw new
|
|
427
|
-
for (let h = a; h <=
|
|
428
|
-
|
|
429
|
-
const
|
|
430
|
-
for (const
|
|
431
|
-
ce(b,
|
|
427
|
+
if (t.fidelity === "strict" && m.length) throw new Ue(d);
|
|
428
|
+
for (let h = a; h <= s; h++) {
|
|
429
|
+
R(t.signal);
|
|
430
|
+
const g = e.pages[h], { canvas: f, ctx: b } = $e(g, n, r, t.maxCanvasPixels);
|
|
431
|
+
for (const I of g.components)
|
|
432
|
+
ce(b, I, i, r, o, l);
|
|
432
433
|
c.push(f);
|
|
433
434
|
}
|
|
434
435
|
return { canvases: c, diagnostics: d };
|
|
435
436
|
}
|
|
436
|
-
function
|
|
437
|
-
return n < t ? [] : e.pages.slice(t, n + 1).flatMap((r, i) => r.components.flatMap((o,
|
|
437
|
+
function wt(e, t, n) {
|
|
438
|
+
return n < t ? [] : e.pages.slice(t, n + 1).flatMap((r, i) => r.components.flatMap((o, l) => ee(o) ? [{
|
|
438
439
|
code: "async-image-required",
|
|
439
440
|
severity: "warning",
|
|
440
441
|
format: "canvas",
|
|
441
442
|
pageIndex: t + i,
|
|
442
|
-
componentIndex:
|
|
443
|
+
componentIndex: l,
|
|
443
444
|
kind: o.kind,
|
|
444
445
|
nid: o.nid,
|
|
445
446
|
message: "Use renderPlanToCanvasAsync or renderPlanToImages to decode and include images."
|
|
@@ -447,129 +448,129 @@ function pt(e, t, n) {
|
|
|
447
448
|
}
|
|
448
449
|
async function un(e, t = {}) {
|
|
449
450
|
if (typeof document > "u") throw new Error("renderPlanToCanvasAsync 需要浏览器环境(Node 请使用 PDF 或 XLSX 输出)");
|
|
450
|
-
|
|
451
|
+
R(t.signal);
|
|
451
452
|
const n = await oe(e, { ...t, format: "canvas" });
|
|
452
453
|
e = n.plan;
|
|
453
|
-
const r = [...n.diagnostics, ...
|
|
454
|
-
for (let
|
|
455
|
-
i.push(await
|
|
454
|
+
const r = [...n.diagnostics, ...G(e, "canvas", t)], i = [], o = Math.min(e.pages.length - 1, t.end ?? e.pages.length - 1);
|
|
455
|
+
for (let l = Math.max(0, t.start ?? 0); l <= o; l++)
|
|
456
|
+
i.push(await Le(e.pages[l], l, t, r));
|
|
456
457
|
return { canvases: i, diagnostics: r };
|
|
457
458
|
}
|
|
458
|
-
async function Ne(e, t, n, r) {
|
|
459
|
-
const i = n.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), o = n.dpi ?? 96, s = n.fontFamily ?? Z, a = await Le(e, t, n, r);
|
|
460
|
-
P(n.signal);
|
|
461
|
-
const { canvas: l, ctx: c } = Ie(e, i, o, n.maxCanvasPixels);
|
|
462
|
-
for (const d of e.components) ce(c, d, o / 25.4, o, s, n.measurer ?? ae, a);
|
|
463
|
-
return l;
|
|
464
|
-
}
|
|
465
459
|
async function Le(e, t, n, r) {
|
|
466
|
-
const i = n.
|
|
467
|
-
|
|
460
|
+
const i = n.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), o = n.dpi ?? 96, l = n.fontFamily ?? Z, a = await De(e, t, n, r);
|
|
461
|
+
R(n.signal);
|
|
462
|
+
const { canvas: s, ctx: c } = $e(e, i, o, n.maxCanvasPixels);
|
|
463
|
+
for (const d of e.components) ce(c, d, o / 25.4, o, l, n.measurer ?? ae, a);
|
|
464
|
+
return s;
|
|
465
|
+
}
|
|
466
|
+
async function De(e, t, n, r) {
|
|
467
|
+
const i = n.imageLoader ?? ot;
|
|
468
|
+
return lt(e, async (o, l) => {
|
|
468
469
|
try {
|
|
469
|
-
return await i(o,
|
|
470
|
+
return await i(o, l);
|
|
470
471
|
} catch (a) {
|
|
471
|
-
if (
|
|
472
|
-
const
|
|
472
|
+
if (l?.aborted) throw a;
|
|
473
|
+
const s = e.components.findIndex((m) => m.imageData === o), c = e.components[s], d = { code: "image-decode-failed", severity: "warning", format: "canvas", pageIndex: t, componentIndex: s, kind: c.kind, nid: c.nid, message: "Image decoding failed; raster output was cancelled instead of omitting the image." };
|
|
473
474
|
throw r.push(d), Pe(d, n), a;
|
|
474
475
|
}
|
|
475
476
|
}, n.signal);
|
|
476
477
|
}
|
|
477
|
-
function
|
|
478
|
-
const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, i = r / 96 * se, o = t.fontFamily ?? Z,
|
|
479
|
-
let
|
|
478
|
+
function fn(e, t = {}) {
|
|
479
|
+
const n = t.dpr ?? (typeof devicePixelRatio == "number" ? devicePixelRatio : 1), r = t.dpi ?? 96, i = r / 96 * se, o = t.fontFamily ?? Z, l = t.measurer ?? ae, a = t.overscan ?? 1, s = t.gapPx ?? 18, c = t.pagesPerFrame ?? 1, d = e.pages.map((u) => u.pageHeightMm * i), m = Math.max(1, ...e.pages.map((u) => u.pageWidthMm * i)), h = { start: 0, end: -1 };
|
|
480
|
+
let g = null, f = null, b = null, I = null, C = [], S = 0, A = [], U = 0, _ = new AbortController();
|
|
480
481
|
const me = [];
|
|
481
|
-
function
|
|
482
|
-
const
|
|
483
|
-
|
|
482
|
+
function ze() {
|
|
483
|
+
const u = g;
|
|
484
|
+
u.innerHTML = "", f = document.createElement("div"), f.style.cssText = `width:${m}px;margin:0 auto;`, b = document.createElement("div"), I = document.createElement("div"), f.appendChild(b), C = [];
|
|
484
485
|
const M = Math.min(e.pages.length, 3 + a * 2);
|
|
485
486
|
for (let L = 0; L < M; L++) {
|
|
486
|
-
const
|
|
487
|
-
|
|
487
|
+
const y = document.createElement("div");
|
|
488
|
+
y.style.cssText = `margin:0 auto ${s}px;box-shadow:0 2px 8px rgba(0,0,0,.35);background:#fff;`, f.appendChild(y), C.push(y);
|
|
488
489
|
}
|
|
489
|
-
f.appendChild(
|
|
490
|
+
f.appendChild(I), u.appendChild(f);
|
|
490
491
|
}
|
|
491
|
-
async function
|
|
492
|
-
const L =
|
|
493
|
-
me.push(...
|
|
494
|
-
const
|
|
495
|
-
if (L !==
|
|
496
|
-
const { widthPx: ne, heightPx: re } = le(
|
|
497
|
-
let
|
|
498
|
-
(
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
const
|
|
502
|
-
if (
|
|
503
|
-
|
|
504
|
-
for (const
|
|
505
|
-
ce(
|
|
506
|
-
|
|
492
|
+
async function He(u, M) {
|
|
493
|
+
const L = U, y = await oe(e, { ...t, signal: _.signal, format: "canvas", start: M, end: M });
|
|
494
|
+
me.push(...y.diagnostics);
|
|
495
|
+
const T = y.plan.pages[M], Y = await De(T, M, { ...t, signal: _.signal }, me);
|
|
496
|
+
if (L !== U || !g) return;
|
|
497
|
+
const { widthPx: ne, heightPx: re } = le(T, r);
|
|
498
|
+
let $ = u.firstElementChild;
|
|
499
|
+
(!$ || $.tagName !== "CANVAS") && ($ = document.createElement("canvas"), u.innerHTML = "", u.appendChild($));
|
|
500
|
+
const ge = Ie(T, n, r, t.maxCanvasPixels);
|
|
501
|
+
$.width = ge.width, $.height = ge.height, $.style.width = `${ne}px`, $.style.height = `${re}px`;
|
|
502
|
+
const F = $.getContext("2d");
|
|
503
|
+
if (F) {
|
|
504
|
+
F.setTransform(1, 0, 0, 1, 0, 0), F.scale(n, n), F.fillStyle = "#ffffff", F.fillRect(0, 0, ne, re);
|
|
505
|
+
for (const _e of T.components)
|
|
506
|
+
ce(F, _e, i, r, o, l, Y);
|
|
507
|
+
$.dataset.canvasPage = String(M), u.style.height = `${re}px`, u.style.width = `${ne}px`;
|
|
507
508
|
}
|
|
508
509
|
}
|
|
509
|
-
function
|
|
510
|
-
|
|
511
|
-
const M = e.pages.length - 1 -
|
|
512
|
-
|
|
513
|
-
const L =
|
|
514
|
-
|
|
515
|
-
if (
|
|
516
|
-
|
|
517
|
-
const Y =
|
|
518
|
-
|
|
510
|
+
function We(u) {
|
|
511
|
+
U++, h.start = u.start, h.end = u.end, b.style.height = `${u.start * s + d.slice(0, u.start).reduce((y, T) => y + T, 0)}px`;
|
|
512
|
+
const M = e.pages.length - 1 - u.end;
|
|
513
|
+
I.style.height = `${M * s + d.slice(u.end + 1).reduce((y, T) => y + T, 0)}px`;
|
|
514
|
+
const L = u.end - u.start + 1;
|
|
515
|
+
C.forEach((y, T) => {
|
|
516
|
+
if (T < L) {
|
|
517
|
+
y.style.display = "";
|
|
518
|
+
const Y = u.start + T;
|
|
519
|
+
y.style.height = `${d[Y] ?? 0}px`;
|
|
519
520
|
} else
|
|
520
|
-
|
|
521
|
-
}),
|
|
522
|
-
for (let
|
|
523
|
-
const
|
|
524
|
-
if (!
|
|
525
|
-
|
|
521
|
+
y.style.display = "none";
|
|
522
|
+
}), A = [];
|
|
523
|
+
for (let y = u.start; y <= u.end; y++) {
|
|
524
|
+
const T = C[y - u.start];
|
|
525
|
+
if (!T) continue;
|
|
526
|
+
T.firstElementChild?.dataset?.canvasPage !== String(y) && A.push(y);
|
|
526
527
|
}
|
|
527
528
|
te();
|
|
528
529
|
}
|
|
529
530
|
function te() {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
let
|
|
533
|
-
for (;
|
|
534
|
-
const M =
|
|
535
|
-
L &&
|
|
531
|
+
S || A.length === 0 || (S = requestAnimationFrame(() => {
|
|
532
|
+
S = 0;
|
|
533
|
+
let u = Math.max(1, c);
|
|
534
|
+
for (; A.length > 0 && u-- > 0; ) {
|
|
535
|
+
const M = A.shift(), L = C[M - h.start];
|
|
536
|
+
L && He(L, M).catch(() => {
|
|
536
537
|
});
|
|
537
538
|
}
|
|
538
|
-
|
|
539
|
+
A.length > 0 && te();
|
|
539
540
|
}));
|
|
540
541
|
}
|
|
541
|
-
function
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
const
|
|
542
|
+
function V() {
|
|
543
|
+
S || (S = requestAnimationFrame(() => {
|
|
544
|
+
S = 0;
|
|
545
|
+
const u = g, M = dt({
|
|
545
546
|
pageHeightsPx: d,
|
|
546
|
-
viewportHeightPx:
|
|
547
|
-
scrollTopPx:
|
|
547
|
+
viewportHeightPx: u.clientHeight,
|
|
548
|
+
scrollTopPx: u.scrollTop,
|
|
548
549
|
overscan: a,
|
|
549
|
-
gapPx:
|
|
550
|
+
gapPx: s
|
|
550
551
|
});
|
|
551
|
-
M.start !== h.start || M.end !== h.end ?
|
|
552
|
+
M.start !== h.start || M.end !== h.end ? We(M) : te();
|
|
552
553
|
}));
|
|
553
554
|
}
|
|
554
|
-
let
|
|
555
|
+
let q = null;
|
|
555
556
|
return {
|
|
556
|
-
attach(
|
|
557
|
+
attach(u) {
|
|
557
558
|
if (typeof document > "u")
|
|
558
559
|
throw new Error("createCanvasPager 需要浏览器环境(SSR 请在客户端钩子中调用 attach)");
|
|
559
|
-
|
|
560
|
+
R(t.signal), _ = new AbortController(), t.signal?.addEventListener("abort", he, { once: !0 }), G(e, "canvas", t), g = u, ze(), u.addEventListener("scroll", V, { passive: !0 }), typeof ResizeObserver < "u" && (q = new ResizeObserver(() => V()), q.observe(u)), V();
|
|
560
561
|
},
|
|
561
562
|
destroy() {
|
|
562
|
-
|
|
563
|
+
U++, _.abort(), t.signal?.removeEventListener("abort", he), S && cancelAnimationFrame(S), S = 0, q?.disconnect(), q = null, g?.removeEventListener("scroll", V), A = [], f?.remove(), g = null;
|
|
563
564
|
},
|
|
564
565
|
window() {
|
|
565
566
|
return { ...h };
|
|
566
567
|
}
|
|
567
568
|
};
|
|
568
569
|
function he() {
|
|
569
|
-
|
|
570
|
+
_.abort(t.signal?.reason);
|
|
570
571
|
}
|
|
571
572
|
}
|
|
572
|
-
function
|
|
573
|
+
function Fe(e, t, n) {
|
|
573
574
|
let r, i;
|
|
574
575
|
if (typeof e == "string") {
|
|
575
576
|
const o = K[e];
|
|
@@ -578,7 +579,7 @@ function De(e, t, n) {
|
|
|
578
579
|
} else typeof e == "number" ? (r = e, i = t ?? 297) : (r = e.widthMm, i = e.heightMm);
|
|
579
580
|
return n ? { widthMm: i, heightMm: r } : { widthMm: r, heightMm: i };
|
|
580
581
|
}
|
|
581
|
-
class
|
|
582
|
+
class bt {
|
|
582
583
|
constructor() {
|
|
583
584
|
this.pages = [], this.pending = null, this.templateParams = void 0;
|
|
584
585
|
}
|
|
@@ -607,18 +608,18 @@ class wt {
|
|
|
607
608
|
*/
|
|
608
609
|
page(t = "a4", n = {}, r) {
|
|
609
610
|
this.collect();
|
|
610
|
-
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:
|
|
611
|
+
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: a } = Fe(
|
|
611
612
|
t,
|
|
612
613
|
typeof n == "number" ? n : void 0,
|
|
613
614
|
o.landscape
|
|
614
|
-
),
|
|
615
|
-
return this.pending = new
|
|
616
|
-
widthMm:
|
|
615
|
+
), s = o.margins ?? {};
|
|
616
|
+
return this.pending = new yt(this, {
|
|
617
|
+
widthMm: l,
|
|
617
618
|
heightMm: a,
|
|
618
|
-
marginTopMm:
|
|
619
|
-
marginBottomMm:
|
|
620
|
-
marginLeftMm:
|
|
621
|
-
marginRightMm:
|
|
619
|
+
marginTopMm: s.marginTopMm ?? 10,
|
|
620
|
+
marginBottomMm: s.marginBottomMm ?? 10,
|
|
621
|
+
marginLeftMm: s.marginLeftMm ?? 10,
|
|
622
|
+
marginRightMm: s.marginRightMm ?? 10
|
|
622
623
|
}), this.pending;
|
|
623
624
|
}
|
|
624
625
|
collect() {
|
|
@@ -630,7 +631,7 @@ class wt {
|
|
|
630
631
|
return this.templateParams ? { params: this.templateParams, pages: this.pages } : { pages: this.pages };
|
|
631
632
|
}
|
|
632
633
|
}
|
|
633
|
-
class
|
|
634
|
+
class yt {
|
|
634
635
|
constructor(t, n) {
|
|
635
636
|
this.parent = t, this.page = n, this.components = [];
|
|
636
637
|
}
|
|
@@ -699,10 +700,10 @@ class bt {
|
|
|
699
700
|
return this.done().build();
|
|
700
701
|
}
|
|
701
702
|
}
|
|
702
|
-
function
|
|
703
|
-
return new
|
|
703
|
+
function pn() {
|
|
704
|
+
return new bt();
|
|
704
705
|
}
|
|
705
|
-
function
|
|
706
|
+
function wn(e, t = {}) {
|
|
706
707
|
return je([], e), e.fields.map((n) => ({
|
|
707
708
|
field: n.field,
|
|
708
709
|
header: `${n.label ?? n.field}${n.unit ? ` (${n.unit})` : ""}`,
|
|
@@ -710,7 +711,7 @@ function pn(e, t = {}) {
|
|
|
710
711
|
...t[n.field]
|
|
711
712
|
}));
|
|
712
713
|
}
|
|
713
|
-
function
|
|
714
|
+
function P(e, t, n = !1) {
|
|
714
715
|
if (!Number.isFinite(e) || (n ? e < 0 : e <= 0))
|
|
715
716
|
throw new Error(`${t} 必须是有限${n ? "非负" : "正"}数`);
|
|
716
717
|
}
|
|
@@ -727,18 +728,18 @@ function vt(e) {
|
|
|
727
728
|
if (t !== "wide" && e.columnWidthMm !== void 0)
|
|
728
729
|
throw new Error('columnWidthMm 仅适用于 layout: "wide"');
|
|
729
730
|
const n = e.columnWidthMm ?? 30;
|
|
730
|
-
return
|
|
731
|
+
return P(n, "columnWidthMm"), { layout: t, columnWidthMm: n };
|
|
731
732
|
}
|
|
732
|
-
function
|
|
733
|
+
function Mt(e) {
|
|
733
734
|
const t = e.paper === void 0 ? "a4" : e.paper;
|
|
734
735
|
if (typeof t != "string" && (typeof t != "object" || t === null) || e.landscape !== void 0 && typeof e.landscape != "boolean")
|
|
735
736
|
throw new Error("paper 必须是纸张预设名或 { widthMm, heightMm } 对象,landscape 必须是布尔值");
|
|
736
737
|
if (typeof t == "string" && !Object.prototype.hasOwnProperty.call(K, t))
|
|
737
738
|
throw new Error(`未知纸张预设 "${t}"(可用:${Object.keys(K).join("/")})`);
|
|
738
|
-
const n =
|
|
739
|
-
return
|
|
739
|
+
const n = Fe(t, void 0, e.landscape), r = n.widthMm, i = n.heightMm;
|
|
740
|
+
return P(r, "纸张 widthMm"), P(i, "纸张 heightMm"), { widthMm: r, heightMm: i };
|
|
740
741
|
}
|
|
741
|
-
function
|
|
742
|
+
function xt(e) {
|
|
742
743
|
if (e.margins !== void 0 && (!e.margins || typeof e.margins != "object" || Array.isArray(e.margins)))
|
|
743
744
|
throw new Error("margins 必须是页边距对象");
|
|
744
745
|
const t = e.margins ?? {}, n = {
|
|
@@ -747,101 +748,101 @@ function Mt(e) {
|
|
|
747
748
|
marginLeftMm: t.marginLeftMm === void 0 ? 10 : t.marginLeftMm,
|
|
748
749
|
marginRightMm: t.marginRightMm === void 0 ? 10 : t.marginRightMm
|
|
749
750
|
};
|
|
750
|
-
for (const [r, i] of Object.entries(n))
|
|
751
|
+
for (const [r, i] of Object.entries(n)) P(i, r, !0);
|
|
751
752
|
return n;
|
|
752
753
|
}
|
|
753
|
-
function
|
|
754
|
+
function Et(e, t) {
|
|
754
755
|
const n = e.dataset === void 0 ? "detail" : e.dataset;
|
|
755
756
|
if (typeof n != "string" || !n.trim())
|
|
756
757
|
throw new Error("dataset 必须是非空字符串");
|
|
757
758
|
if (e.title !== void 0 && typeof e.title != "string")
|
|
758
759
|
throw new Error("title 必须是字符串");
|
|
759
760
|
const r = e.titleHeightMm === void 0 ? 10 : e.titleHeightMm, i = e.titleGapMm === void 0 ? 4 : e.titleGapMm;
|
|
760
|
-
|
|
761
|
-
const o = e.title !== void 0 && e.title.length > 0,
|
|
762
|
-
if (
|
|
761
|
+
P(r, "titleHeightMm"), P(i, "titleGapMm", !0);
|
|
762
|
+
const o = e.title !== void 0 && e.title.length > 0, l = o ? r + i : 0;
|
|
763
|
+
if (l >= t)
|
|
763
764
|
throw new Error("标题高度与间距占满页面,必须为表格保留可用高度");
|
|
764
|
-
return { dataset: n, titleHeightMm: r, hasTitle: o, titleSpaceMm:
|
|
765
|
+
return { dataset: n, titleHeightMm: r, hasTitle: o, titleSpaceMm: l };
|
|
765
766
|
}
|
|
766
|
-
function
|
|
767
|
+
function St(e) {
|
|
767
768
|
if (e.listOptions !== void 0 && (!e.listOptions || typeof e.listOptions != "object" || Array.isArray(e.listOptions)))
|
|
768
769
|
throw new Error("listOptions 必须是列表配置对象");
|
|
769
770
|
const t = e.listOptions ?? {};
|
|
770
771
|
X(t.align, "listOptions.align", !0), X(t.headerAlign, "listOptions.headerAlign", !1);
|
|
771
772
|
for (const n of ["fontSizePt", "rowHeightMm", "paddingMm"]) {
|
|
772
773
|
const r = t[n];
|
|
773
|
-
r !== void 0 &&
|
|
774
|
+
r !== void 0 && P(r, `listOptions.${n}`, n === "paddingMm");
|
|
774
775
|
}
|
|
775
776
|
return t;
|
|
776
777
|
}
|
|
777
|
-
function
|
|
778
|
+
function Tt(e) {
|
|
778
779
|
let t = 0, n = 0;
|
|
779
780
|
for (const [r, i] of e.entries()) {
|
|
780
781
|
if (!i || typeof i.header != "string" || typeof i.field != "string" || !i.field.trim())
|
|
781
782
|
throw new Error(`columns[${r}] 需要字符串 header 与非空 field`);
|
|
782
|
-
X(i.align, `columns[${r}].align`, !0), X(i.headerAlign, `columns[${r}].headerAlign`, !1), i.flex !== void 0 &&
|
|
783
|
+
X(i.align, `columns[${r}].align`, !0), X(i.headerAlign, `columns[${r}].headerAlign`, !1), i.flex !== void 0 && P(i.flex, `columns[${r}].flex`), i.widthMm !== void 0 ? (P(i.widthMm, `columns[${r}].widthMm`), t += i.widthMm) : n = Math.max(n, i.flex ?? 1);
|
|
783
784
|
}
|
|
784
785
|
return { fixedWidthMm: t, maxFlex: n };
|
|
785
786
|
}
|
|
786
|
-
function
|
|
787
|
-
const { fixedWidthMm: i, maxFlex: o } =
|
|
787
|
+
function Ct(e, t, n, r) {
|
|
788
|
+
const { fixedWidthMm: i, maxFlex: o } = Tt(e.columns);
|
|
788
789
|
if (t === "page" && i > r)
|
|
789
790
|
throw new Error(`固定列宽 ${i}mm 超出页面可用宽度 ${r}mm`);
|
|
790
|
-
const
|
|
791
|
-
if (t === "page" && o > 0 &&
|
|
791
|
+
const l = r - i;
|
|
792
|
+
if (t === "page" && o > 0 && l <= 0)
|
|
792
793
|
throw new Error("固定列占满页面可用宽度,自动列需要正的剩余宽度");
|
|
793
794
|
const a = o > 0 ? e.columns.reduce((c, d) => c + (d.widthMm === void 0 ? (d.flex ?? 1) / o : 0), 0) : 0;
|
|
794
795
|
return { columns: e.columns.map(({ widthMm: c, flex: d, ...m }, h) => {
|
|
795
|
-
const
|
|
796
|
-
return
|
|
796
|
+
const g = c ?? (t === "wide" ? n * (d ?? 1) : l * ((d ?? 1) / o) / a);
|
|
797
|
+
return P(g, `columns[${h}] 分配后的 widthMm`), { ...m, widthMm: g };
|
|
797
798
|
}), fixedWidthMm: i, maxFlex: o };
|
|
798
799
|
}
|
|
799
|
-
function
|
|
800
|
+
function bn(e) {
|
|
800
801
|
if (!e || typeof e != "object")
|
|
801
802
|
throw new Error("标准明细模板需要 options 对象");
|
|
802
803
|
if (!Array.isArray(e.columns) || e.columns.length === 0)
|
|
803
804
|
throw new Error("columns 至少需要一列");
|
|
804
|
-
const { layout: t, columnWidthMm: n } = vt(e), r =
|
|
805
|
+
const { layout: t, columnWidthMm: n } = vt(e), r = Mt(e);
|
|
805
806
|
let i = r.widthMm;
|
|
806
|
-
const o = r.heightMm,
|
|
807
|
-
let a = i -
|
|
808
|
-
const
|
|
809
|
-
if (t === "page" && a <= 0 ||
|
|
807
|
+
const o = r.heightMm, l = xt(e);
|
|
808
|
+
let a = i - l.marginLeftMm - l.marginRightMm;
|
|
809
|
+
const s = o - l.marginTopMm - l.marginBottomMm;
|
|
810
|
+
if (t === "page" && a <= 0 || s <= 0)
|
|
810
811
|
throw new Error("页边距占满纸张,必须保留正的可用宽度和高度");
|
|
811
|
-
const { dataset: c, titleHeightMm: d, hasTitle: m, titleSpaceMm: h } =
|
|
812
|
-
t === "wide" && (a = f.reduce((
|
|
813
|
-
const
|
|
814
|
-
return m &&
|
|
812
|
+
const { dataset: c, titleHeightMm: d, hasTitle: m, titleSpaceMm: h } = Et(e, s), g = St(e), { columns: f, fixedWidthMm: b, maxFlex: I } = Ct(e, t, n, a);
|
|
813
|
+
t === "wide" && (a = f.reduce((S, A) => S + A.widthMm, 0), P(a, "宽表总列宽"), i = a + l.marginLeftMm + l.marginRightMm, P(i, "宽表总宽度"));
|
|
814
|
+
const C = { widthMm: i, heightMm: o, ...l, components: [], ...t === "wide" ? { layout: t } : {} };
|
|
815
|
+
return m && C.components.push({
|
|
815
816
|
kind: "text",
|
|
816
817
|
text: e.title,
|
|
817
|
-
leftMm:
|
|
818
|
-
topMm:
|
|
818
|
+
leftMm: l.marginLeftMm,
|
|
819
|
+
topMm: l.marginTopMm,
|
|
819
820
|
widthMm: a,
|
|
820
821
|
heightMm: d,
|
|
821
822
|
style: { fontSize: 16, bold: !0, align: "center", verticalAlign: "middle", ...e.titleStyle }
|
|
822
|
-
}),
|
|
823
|
+
}), C.components.push({
|
|
823
824
|
align: "auto",
|
|
824
825
|
headerAlign: "center",
|
|
825
|
-
...
|
|
826
|
+
...g,
|
|
826
827
|
kind: "list",
|
|
827
828
|
...t === "wide" ? { layout: t } : {},
|
|
828
829
|
...m ? { title: e.title } : {},
|
|
829
830
|
dataset: c,
|
|
830
831
|
columns: f,
|
|
831
|
-
leftMm:
|
|
832
|
-
topMm:
|
|
833
|
-
widthMm: t === "wide" ||
|
|
834
|
-
}), e.params === void 0 ? { pages: [
|
|
832
|
+
leftMm: l.marginLeftMm,
|
|
833
|
+
topMm: l.marginTopMm + h,
|
|
834
|
+
widthMm: t === "wide" || I > 0 ? a : b
|
|
835
|
+
}), e.params === void 0 ? { pages: [C] } : { params: e.params, pages: [C] };
|
|
835
836
|
}
|
|
836
|
-
function
|
|
837
|
+
function yn(e) {
|
|
837
838
|
return e;
|
|
838
839
|
}
|
|
839
|
-
class
|
|
840
|
+
class N extends Error {
|
|
840
841
|
constructor(t, n) {
|
|
841
842
|
super(n), this.code = t, this.name = "ReportTemplateStoreError";
|
|
842
843
|
}
|
|
843
844
|
}
|
|
844
|
-
function
|
|
845
|
+
function k(e) {
|
|
845
846
|
return JSON.parse(JSON.stringify(e));
|
|
846
847
|
}
|
|
847
848
|
function x(e) {
|
|
@@ -851,127 +852,164 @@ function x(e) {
|
|
|
851
852
|
}
|
|
852
853
|
function pe(e) {
|
|
853
854
|
const t = e ? Number(e.revision) : 0;
|
|
854
|
-
if (!Number.isSafeInteger(t) || t < 0 || t >= Number.MAX_SAFE_INTEGER) throw new
|
|
855
|
+
if (!Number.isSafeInteger(t) || t < 0 || t >= Number.MAX_SAFE_INTEGER) throw new N("history", "修订号无效或已达上限");
|
|
855
856
|
return String(t + 1);
|
|
856
857
|
}
|
|
857
858
|
function vn(e, t = {}) {
|
|
858
|
-
const n = async (
|
|
859
|
+
const n = async (l, a) => {
|
|
859
860
|
x(a);
|
|
860
|
-
const
|
|
861
|
-
return x(a),
|
|
862
|
-
}, r = async (
|
|
863
|
-
const
|
|
864
|
-
if ((
|
|
865
|
-
return
|
|
866
|
-
}, i = async (
|
|
867
|
-
if (x(a.signal), !await e.compareAndSwap(
|
|
868
|
-
return
|
|
869
|
-
}, o = async (
|
|
861
|
+
const s = await e.read(l, a);
|
|
862
|
+
return x(a), s ? k(s) : void 0;
|
|
863
|
+
}, r = async (l, a) => {
|
|
864
|
+
const s = await n(l, a.signal);
|
|
865
|
+
if ((s?.revision ?? null) !== a.expectedRevision) throw new N("conflict", "模板已变化,请重新读取后提交");
|
|
866
|
+
return s;
|
|
867
|
+
}, i = async (l, a, s) => {
|
|
868
|
+
if (x(a.signal), !await e.compareAndSwap(l.id, a.expectedRevision, k(l), { signal: a.signal, ...s ? { publication: k(s) } : {} })) throw new N("conflict", "模板已被其他请求更新");
|
|
869
|
+
return k(l);
|
|
870
|
+
}, o = async (l, a, s, c) => {
|
|
870
871
|
if (t.beforePublish) {
|
|
871
|
-
x(
|
|
872
|
-
const
|
|
873
|
-
if (!
|
|
874
|
-
x(
|
|
872
|
+
x(s.signal);
|
|
873
|
+
const g = await t.beforePublish({ document: D(a), previous: l.published ? D(l.published) : void 0, signal: s.signal });
|
|
874
|
+
if (!g || g.ok !== !0) throw new N("review", g?.issues?.find((f) => f.severity === "error")?.message ?? "模板发布检查未通过");
|
|
875
|
+
x(s.signal);
|
|
875
876
|
}
|
|
876
|
-
const d = pe(
|
|
877
|
-
return c !== void 0 && (h.restoredFrom = c), i({ id:
|
|
877
|
+
const d = pe(l), m = D({ ...a, revision: d }), h = { revision: d, document: m, publishedAt: (t.now?.() ?? /* @__PURE__ */ new Date()).toISOString() };
|
|
878
|
+
return c !== void 0 && (h.restoredFrom = c), i({ id: l.id, revision: d, publishedRevision: d, published: m }, s, h);
|
|
878
879
|
};
|
|
879
880
|
return {
|
|
880
|
-
list: async (
|
|
881
|
-
x(
|
|
882
|
-
const a = await e.list(
|
|
883
|
-
return x(
|
|
881
|
+
list: async (l) => {
|
|
882
|
+
x(l);
|
|
883
|
+
const a = await e.list(l);
|
|
884
|
+
return x(l), k(a);
|
|
884
885
|
},
|
|
885
|
-
get: async (
|
|
886
|
-
const
|
|
887
|
-
return c ?
|
|
886
|
+
get: async (l, a = {}) => {
|
|
887
|
+
const s = await n(l, a.signal), c = a.draft ? s?.draft : s?.published;
|
|
888
|
+
return c ? D(c) : void 0;
|
|
888
889
|
},
|
|
889
|
-
history: async (
|
|
890
|
+
history: async (l, a) => {
|
|
890
891
|
x(a);
|
|
891
|
-
const
|
|
892
|
-
return x(a),
|
|
892
|
+
const s = await e.history(l, a);
|
|
893
|
+
return x(a), k(s);
|
|
893
894
|
},
|
|
894
|
-
saveDraft: async (
|
|
895
|
+
saveDraft: async (l, a) => {
|
|
895
896
|
a = { ...a }, x(a.signal);
|
|
896
|
-
const
|
|
897
|
+
const s = D(t.migrate ? await t.migrate(l) : l), c = await r(s.id, a), d = pe(c);
|
|
897
898
|
return i({
|
|
898
|
-
id:
|
|
899
|
+
id: s.id,
|
|
899
900
|
revision: d,
|
|
900
|
-
draft: { ...
|
|
901
|
+
draft: { ...s, revision: d },
|
|
901
902
|
...c?.publishedRevision ? { publishedRevision: c.publishedRevision, published: c.published } : {}
|
|
902
903
|
}, a);
|
|
903
904
|
},
|
|
904
|
-
publish: async (
|
|
905
|
+
publish: async (l, a) => {
|
|
905
906
|
a = { ...a };
|
|
906
|
-
const
|
|
907
|
-
if (!
|
|
908
|
-
if (!
|
|
909
|
-
return o(
|
|
907
|
+
const s = await r(l, a);
|
|
908
|
+
if (!s) throw new N("missing", "模板不存在");
|
|
909
|
+
if (!s.draft) throw new N("draft", "没有可发布的草稿");
|
|
910
|
+
return o(s, s.draft, a);
|
|
910
911
|
},
|
|
911
|
-
rollback: async (
|
|
912
|
-
|
|
913
|
-
const c = await r(
|
|
914
|
-
if (!c) throw new
|
|
915
|
-
x(
|
|
916
|
-
const d = await e.getVersion(
|
|
917
|
-
if (!d) throw new
|
|
918
|
-
return o(c, d.document,
|
|
912
|
+
rollback: async (l, a, s) => {
|
|
913
|
+
s = { ...s };
|
|
914
|
+
const c = await r(l, s);
|
|
915
|
+
if (!c) throw new N("missing", "模板不存在");
|
|
916
|
+
x(s.signal);
|
|
917
|
+
const d = await e.getVersion(l, a, s.signal);
|
|
918
|
+
if (!d) throw new N("history", "历史修订不存在");
|
|
919
|
+
return o(c, d.document, s, a);
|
|
919
920
|
}
|
|
920
921
|
};
|
|
921
922
|
}
|
|
922
|
-
function
|
|
923
|
+
function Mn() {
|
|
923
924
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
|
|
924
925
|
return {
|
|
925
926
|
read: async (n, r) => {
|
|
926
927
|
x(r);
|
|
927
928
|
const i = e.get(n);
|
|
928
|
-
return i ?
|
|
929
|
+
return i ? k(i) : void 0;
|
|
929
930
|
},
|
|
930
931
|
list: async (n) => (x(n), Array.from(e.values(), ({ id: r, revision: i, publishedRevision: o }) => ({ id: r, revision: i, ...o ? { publishedRevision: o } : {} }))),
|
|
931
|
-
history: async (n, r) => (x(r), Array.from(t.get(n)?.values() ?? [], (i) =>
|
|
932
|
+
history: async (n, r) => (x(r), Array.from(t.get(n)?.values() ?? [], (i) => k(i))),
|
|
932
933
|
getVersion: async (n, r, i) => {
|
|
933
934
|
x(i);
|
|
934
935
|
const o = t.get(n)?.get(r);
|
|
935
|
-
return o ?
|
|
936
|
+
return o ? k(o) : void 0;
|
|
936
937
|
},
|
|
937
938
|
compareAndSwap: async (n, r, i, o) => {
|
|
938
939
|
if (x(o.signal), (e.get(n)?.revision ?? null) !== r) return !1;
|
|
939
|
-
if (i.id !== n) throw new
|
|
940
|
-
const
|
|
940
|
+
if (i.id !== n) throw new N("history", "状态 ID 与存储 ID 不一致");
|
|
941
|
+
const l = k(i), a = o.publication;
|
|
941
942
|
if (a) {
|
|
942
|
-
const
|
|
943
|
-
if (
|
|
944
|
-
|
|
943
|
+
const s = t.get(n) ?? /* @__PURE__ */ new Map();
|
|
944
|
+
if (s.has(a.revision) || a.revision !== i.revision || a.document.id !== n) throw new N("history", "发布修订不可覆盖,且必须与状态修订和模板 ID 一致");
|
|
945
|
+
s.set(a.revision, k(a)), t.set(n, s);
|
|
945
946
|
}
|
|
946
|
-
return e.set(n,
|
|
947
|
+
return e.set(n, l), !0;
|
|
947
948
|
}
|
|
948
949
|
};
|
|
949
950
|
}
|
|
950
|
-
function
|
|
951
|
+
function xn(e, t) {
|
|
952
|
+
const n = D(e);
|
|
953
|
+
if (t.id === n.id) throw new Error("复制模板应使用新的 ID");
|
|
954
|
+
const { revision: r, ...i } = n;
|
|
955
|
+
return D({ ...i, id: t.id, name: t.name });
|
|
956
|
+
}
|
|
957
|
+
function En(e) {
|
|
958
|
+
if (!Array.isArray(e) || e.length > 1e3) throw new RangeError("本地模板目录最多 1000 项");
|
|
959
|
+
const t = /* @__PURE__ */ new Map(), n = [];
|
|
960
|
+
for (const r of e) {
|
|
961
|
+
const i = D(r.document);
|
|
962
|
+
if (t.has(i.id)) throw new Error(`模板 ID 重复:${i.id}`);
|
|
963
|
+
if (r.category !== void 0 && (typeof r.category != "string" || r.category.length > 128) || r.tags !== void 0 && (!Array.isArray(r.tags) || r.tags.length > 20 || r.tags.some((a) => typeof a != "string" || a.length > 128))) throw new TypeError("模板分类和标签无效");
|
|
964
|
+
const { template: o, ...l } = i;
|
|
965
|
+
t.set(i.id, i), n.push({ ...l, ...r.category ? { category: r.category } : {}, ...r.tags ? { tags: [...r.tags] } : {} });
|
|
966
|
+
}
|
|
967
|
+
return n.sort((r, i) => r.id < i.id ? -1 : 1), {
|
|
968
|
+
search: async (r) => {
|
|
969
|
+
we(r.signal);
|
|
970
|
+
const i = r.limit ?? 30;
|
|
971
|
+
if (!Number.isSafeInteger(i) || i < 1 || i > 100) throw new RangeError("模板每页数量应为 1–100");
|
|
972
|
+
const o = r.query?.trim().toLocaleLowerCase() ?? "", l = n.filter((s) => (!r.category || s.category === r.category) && (!r.cursor || s.id > r.cursor) && (!o || [s.id, s.name, s.description, ...s.tags ?? []].some((c) => c?.toLocaleLowerCase().includes(o)))), a = /* @__PURE__ */ new Map();
|
|
973
|
+
for (const s of n) s.category && a.set(s.category, (a.get(s.category) ?? 0) + 1);
|
|
974
|
+
return JSON.parse(JSON.stringify({ items: l.slice(0, i), ...l.length > i ? { next: l[i - 1].id } : {}, categories: Array.from(a, ([s, c]) => ({ id: s, label: s, count: c })) }));
|
|
975
|
+
},
|
|
976
|
+
get: async (r, i) => {
|
|
977
|
+
we(i.signal);
|
|
978
|
+
const o = t.get(r);
|
|
979
|
+
return o ? D(o) : void 0;
|
|
980
|
+
}
|
|
981
|
+
};
|
|
982
|
+
}
|
|
983
|
+
function we(e) {
|
|
984
|
+
if (!e?.aborted) return;
|
|
985
|
+
const t = new Error("模板目录操作已取消");
|
|
986
|
+
throw t.name = "AbortError", t;
|
|
987
|
+
}
|
|
988
|
+
function Sn(e) {
|
|
951
989
|
return e.map((t) => t.map((n) => /[\t\r\n"]/.test(n) ? `"${n.replace(/"/g, '""')}"` : n).join(" ")).join(`\r
|
|
952
990
|
`);
|
|
953
991
|
}
|
|
954
|
-
function
|
|
992
|
+
function Rt(e, t) {
|
|
955
993
|
const n = e[e.length - 1];
|
|
956
994
|
e.length > 1 && n?.length === 1 && n[0] === "" && /[\r\n]$/.test(t) && e.pop();
|
|
957
995
|
}
|
|
958
|
-
function
|
|
996
|
+
function Tn(e, t = 1e4) {
|
|
959
997
|
if (e.length > 4 * 1024 * 1024) throw new Error("Clipboard text limit exceeded");
|
|
960
998
|
const n = [[]];
|
|
961
|
-
let r = "", i = !1, o = !1,
|
|
999
|
+
let r = "", i = !1, o = !1, l = 0;
|
|
962
1000
|
function a() {
|
|
963
|
-
if (++
|
|
1001
|
+
if (++l > t) throw new Error("Clipboard cell limit exceeded");
|
|
964
1002
|
n[n.length - 1].push(r), r = "", o = !1;
|
|
965
1003
|
}
|
|
966
|
-
for (let
|
|
967
|
-
const c = e[
|
|
1004
|
+
for (let s = 0; s < e.length; s++) {
|
|
1005
|
+
const c = e[s];
|
|
968
1006
|
if (i) {
|
|
969
1007
|
if (c !== '"') {
|
|
970
1008
|
r += c;
|
|
971
1009
|
continue;
|
|
972
1010
|
}
|
|
973
|
-
if (e[
|
|
974
|
-
r += '"',
|
|
1011
|
+
if (e[s + 1] === '"') {
|
|
1012
|
+
r += '"', s++;
|
|
975
1013
|
continue;
|
|
976
1014
|
}
|
|
977
1015
|
i = !1, o = !0;
|
|
@@ -987,15 +1025,15 @@ function xn(e, t = 1e4) {
|
|
|
987
1025
|
}
|
|
988
1026
|
if (c === "\r" || c === `
|
|
989
1027
|
`) {
|
|
990
|
-
a(), n.push([]), c === "\r" && e[
|
|
991
|
-
` &&
|
|
1028
|
+
a(), n.push([]), c === "\r" && e[s + 1] === `
|
|
1029
|
+
` && s++;
|
|
992
1030
|
continue;
|
|
993
1031
|
}
|
|
994
1032
|
if (o) throw new Error("Invalid quoted clipboard value");
|
|
995
1033
|
r += c;
|
|
996
1034
|
}
|
|
997
1035
|
if (i) throw new Error("Unclosed clipboard quote");
|
|
998
|
-
return a(),
|
|
1036
|
+
return a(), Rt(n, e), n;
|
|
999
1037
|
}
|
|
1000
1038
|
class Pt extends Error {
|
|
1001
1039
|
constructor(t, n, r) {
|
|
@@ -1016,51 +1054,51 @@ class Pt extends Error {
|
|
|
1016
1054
|
function p(e, t, n) {
|
|
1017
1055
|
throw new Pt(t, e, n);
|
|
1018
1056
|
}
|
|
1019
|
-
function
|
|
1057
|
+
function Oe(e) {
|
|
1020
1058
|
if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}$/.test(e) || e.startsWith("0000-")) return !1;
|
|
1021
1059
|
const t = /* @__PURE__ */ new Date(`${e}T00:00:00.000Z`);
|
|
1022
1060
|
return Number.isFinite(t.getTime()) && t.toISOString().slice(0, 10) === e;
|
|
1023
1061
|
}
|
|
1024
|
-
function
|
|
1062
|
+
function At(e) {
|
|
1025
1063
|
const [t = "", n = "0"] = String(e).toLowerCase().split("e");
|
|
1026
1064
|
return Math.max(0, (t.split(".")[1]?.length ?? 0) - Number(n));
|
|
1027
1065
|
}
|
|
1028
|
-
function At(e, t) {
|
|
1029
|
-
e.min !== void 0 && t < e.min && p(e, "min", e.min), e.max !== void 0 && t > e.max && p(e, "max", e.max), e.precision !== void 0 && Rt(t) > e.precision && p(e, "precision", e.precision);
|
|
1030
|
-
}
|
|
1031
1066
|
function kt(e, t) {
|
|
1032
|
-
|
|
1067
|
+
e.min !== void 0 && t < e.min && p(e, "min", e.min), e.max !== void 0 && t > e.max && p(e, "max", e.max), e.precision !== void 0 && At(t) > e.precision && p(e, "precision", e.precision);
|
|
1033
1068
|
}
|
|
1034
|
-
function It(e) {
|
|
1035
|
-
|
|
1069
|
+
function It(e, t) {
|
|
1070
|
+
Oe(t) || p(e, "date"), e.min !== void 0 && t < e.min && p(e, "min", e.min), e.max !== void 0 && t > e.max && p(e, "max", e.max);
|
|
1036
1071
|
}
|
|
1037
1072
|
function $t(e) {
|
|
1038
|
-
[e.min, e.max].some((t) => t !== void 0 && !
|
|
1073
|
+
[e.min, e.max].some((t) => t !== void 0 && !Number.isFinite(t)) && p(e, "definition"), e.min !== void 0 && e.max !== void 0 && e.min > e.max && p(e, "definition"), e.precision !== void 0 && (!Number.isInteger(e.precision) || e.precision < 0 || e.precision > 15) && p(e, "definition");
|
|
1039
1074
|
}
|
|
1040
|
-
function Nt(e
|
|
1075
|
+
function Nt(e) {
|
|
1076
|
+
[e.min, e.max].some((t) => t !== void 0 && !Oe(t)) && p(e, "definition"), e.min !== void 0 && e.max !== void 0 && e.min > e.max && p(e, "definition");
|
|
1077
|
+
}
|
|
1078
|
+
function Lt(e, t) {
|
|
1041
1079
|
(!Array.isArray(t.options) || !t.options.length) && p(t, "definition");
|
|
1042
1080
|
const n = e.valueType === "text" ? "string" : e.valueType, r = /* @__PURE__ */ new Set();
|
|
1043
1081
|
for (const i of t.options)
|
|
1044
1082
|
(!i || typeof i.value !== n || typeof i.value == "number" && !Number.isFinite(i.value)) && p(t, "definition"), i.label !== void 0 && typeof i.label != "string" && p(t, "definition"), r.has(i.value) && p(t, "definition"), r.add(i.value);
|
|
1045
1083
|
}
|
|
1046
|
-
function
|
|
1084
|
+
function Dt(e) {
|
|
1047
1085
|
e.required !== void 0 && typeof e.required != "boolean" && p(e, "definition"), [e.label, e.hint, e.unit].some((t) => t !== void 0 && typeof t != "string") && p(e, "definition"), e.type === "boolean" && [e.trueLabel, e.falseLabel].some((t) => t !== void 0 && typeof t != "string") && p(e, "definition");
|
|
1048
1086
|
}
|
|
1049
|
-
function
|
|
1050
|
-
(!t || typeof t != "object" || Array.isArray(t) || !["text", "number", "boolean", "enum", "date"].includes(t.type)) && p(t ?? { type: "text" }, "definition"),
|
|
1087
|
+
function Ft(e, t) {
|
|
1088
|
+
(!t || typeof t != "object" || Array.isArray(t) || !["text", "number", "boolean", "enum", "date"].includes(t.type)) && p(t ?? { type: "text" }, "definition"), Dt(t), (t.type === "number" || t.type === "boolean") && e.valueType !== t.type && p(t, "type"), (t.type === "text" || t.type === "date") && e.valueType !== "text" && p(t, "type"), t.type === "number" && $t(t), t.type === "text" && t.maxLength !== void 0 && (!Number.isInteger(t.maxLength) || t.maxLength < 0) && p(t, "definition"), t.type === "date" && Nt(t), t.type === "enum" && Lt(e, t);
|
|
1051
1089
|
}
|
|
1052
|
-
function
|
|
1053
|
-
if (!e.editable) throw new
|
|
1054
|
-
n &&
|
|
1055
|
-
const r =
|
|
1056
|
-
return n ? (n.required && typeof r == "string" && !r.trim() && p(n, "required"), r === null || r === "" ? (n.required && p(n, "required"), r) : (n.type === "number" &&
|
|
1090
|
+
function Cn(e, t, n) {
|
|
1091
|
+
if (!e.editable) throw new Be("readonly");
|
|
1092
|
+
n && Ft(e, n);
|
|
1093
|
+
const r = Ge(e, t);
|
|
1094
|
+
return n ? (n.required && typeof r == "string" && !r.trim() && p(n, "required"), r === null || r === "" ? (n.required && p(n, "required"), r) : (n.type === "number" && kt(n, r), n.type === "date" && It(n, r), n.type === "text" && n.maxLength !== void 0 && [...String(r)].length > n.maxLength && p(n, "length", n.maxLength), n.type === "enum" && !n.options.some((i) => Object.is(i.value, r)) && p(n, "choice"), r)) : r;
|
|
1057
1095
|
}
|
|
1058
1096
|
class w extends Error {
|
|
1059
1097
|
constructor(t) {
|
|
1060
1098
|
super(`Report calculation: ${t}`), this.code = t, this.name = "ReportCalculationError";
|
|
1061
1099
|
}
|
|
1062
1100
|
}
|
|
1063
|
-
function
|
|
1101
|
+
function z(e) {
|
|
1064
1102
|
if (!e?.aborted) return;
|
|
1065
1103
|
const t = new Error("Calculation cancelled");
|
|
1066
1104
|
throw t.name = "AbortError", t;
|
|
@@ -1068,95 +1106,95 @@ function O(e) {
|
|
|
1068
1106
|
async function J(e, t = 1) {
|
|
1069
1107
|
const n = Math.floor(e.scanned / 2048);
|
|
1070
1108
|
if (e.scanned += t, e.scanned > e.maxScanned) throw new w("limit");
|
|
1071
|
-
|
|
1109
|
+
z(e.signal), Math.floor(e.scanned / 2048) > n && (await e.yieldToHost(), z(e.signal));
|
|
1072
1110
|
}
|
|
1073
1111
|
function de(e) {
|
|
1074
1112
|
return e.table?.role === "header" ? -Math.max(1, e.grid?.cells.length ?? 1) : e.table?.rowIndex ?? 0;
|
|
1075
1113
|
}
|
|
1076
|
-
function
|
|
1114
|
+
function be(e, t, n) {
|
|
1077
1115
|
if (![t.pageIndex, t.componentIndex, t.rowIndex, t.columnIndex].every((a) => Number.isSafeInteger(a) && a >= 0)) throw new w("selection");
|
|
1078
1116
|
const r = e.pages[t.pageIndex]?.components[t.componentIndex];
|
|
1079
1117
|
if (!r?.grid || t.rowIndex >= r.grid.cells.length) throw new w("selection");
|
|
1080
|
-
const i = r.grid.colWidthsMm?.length ?? r.grid.cells.reduce((a,
|
|
1118
|
+
const i = r.grid.colWidthsMm?.length ?? r.grid.cells.reduce((a, s) => Math.max(a, s.length), 1);
|
|
1081
1119
|
if (t.columnIndex >= i) throw new w("selection");
|
|
1082
|
-
const o = r.table,
|
|
1083
|
-
if (o &&
|
|
1084
|
-
const a =
|
|
1120
|
+
const o = r.table, l = e.pages[n.pageIndex]?.components[n.componentIndex]?.table;
|
|
1121
|
+
if (o && l && o.id === l.id) {
|
|
1122
|
+
const a = l.columnKeys.indexOf(o.columnKeys[t.columnIndex] ?? "");
|
|
1085
1123
|
if (a < 0) throw new w("selection");
|
|
1086
1124
|
return { grid: o.id, row: de(r) + t.rowIndex, column: a };
|
|
1087
1125
|
}
|
|
1088
1126
|
return { grid: `${t.pageIndex}:${t.componentIndex}`, row: t.rowIndex, column: t.columnIndex };
|
|
1089
1127
|
}
|
|
1090
|
-
function
|
|
1091
|
-
const r =
|
|
1128
|
+
function Ot(e, t, n) {
|
|
1129
|
+
const r = be(e, t.anchor, t.anchor), i = be(e, t.focus, t.anchor);
|
|
1092
1130
|
if (r.grid !== i.grid) throw new w("selection");
|
|
1093
1131
|
const o = (Math.abs(r.row - i.row) + 1) * (Math.abs(r.column - i.column) + 1);
|
|
1094
1132
|
if (!Number.isSafeInteger(o) || o > n) throw new w("limit");
|
|
1095
1133
|
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 };
|
|
1096
1134
|
}
|
|
1097
|
-
function
|
|
1135
|
+
function zt(e) {
|
|
1098
1136
|
if (!e) return !1;
|
|
1099
1137
|
const t = e.replace(/"[^"]*"|\\.|\[(?![hms]+\])[^\]]*\]/gi, "");
|
|
1100
1138
|
return /[ymdhs]/i.test(t);
|
|
1101
1139
|
}
|
|
1102
|
-
function
|
|
1103
|
-
if (e.valueType === "text" || e.valueType === "boolean" ||
|
|
1140
|
+
function Ht(e) {
|
|
1141
|
+
if (e.valueType === "text" || e.valueType === "boolean" || zt(e.numberFormat)) return null;
|
|
1104
1142
|
const t = e.value;
|
|
1105
1143
|
if (typeof t != "number" || !Number.isFinite(t)) return null;
|
|
1106
1144
|
if (Number.isInteger(t) && !Number.isSafeInteger(t)) throw new w("precision");
|
|
1107
1145
|
return t;
|
|
1108
1146
|
}
|
|
1109
|
-
function
|
|
1147
|
+
function Wt(e, t, n) {
|
|
1110
1148
|
if (e.seen.has(n)) return;
|
|
1111
1149
|
e.seen.add(n), e.selected++;
|
|
1112
|
-
const r = t ?
|
|
1150
|
+
const r = t ? Ht(t) : null;
|
|
1113
1151
|
r === null ? e.excluded++ : e.values.push(r);
|
|
1114
1152
|
}
|
|
1115
|
-
function
|
|
1153
|
+
function _t(e, t, n, r) {
|
|
1116
1154
|
return r.origin ? e.table?.id === r.origin.id : `${t}:${n}` === r.grid;
|
|
1117
1155
|
}
|
|
1118
1156
|
function jt(e, t, n) {
|
|
1119
1157
|
return n.origin ? n.origin.columnKeys.indexOf(e.table.columnKeys[t] ?? "") : t;
|
|
1120
1158
|
}
|
|
1121
|
-
function
|
|
1159
|
+
function Bt(e, t, n, r) {
|
|
1122
1160
|
const i = r.origin ? de(e) + t : t, o = jt(e, n, r);
|
|
1123
1161
|
return i < r.rowStart || i > r.rowEnd || o < r.columnStart || o > r.columnEnd ? null : `${r.grid}:${i}:${o}`;
|
|
1124
1162
|
}
|
|
1125
|
-
function
|
|
1163
|
+
function Gt(e, t) {
|
|
1126
1164
|
const n = t.origin ? de(e) : 0, r = Math.max(0, t.rowStart - n), i = Math.min(e.grid.cells.length, t.rowEnd - n + 1);
|
|
1127
1165
|
return i > r ? i : 0;
|
|
1128
1166
|
}
|
|
1129
|
-
async function
|
|
1167
|
+
async function Ut(e, t, n, r, i) {
|
|
1130
1168
|
const o = e.grid;
|
|
1131
1169
|
if (t > r.maxScanned) throw new w("limit");
|
|
1132
|
-
const
|
|
1133
|
-
if (
|
|
1170
|
+
const l = o.colWidthsMm?.length ?? o.cells.reduce((s, c) => Math.max(s, c.length), 1);
|
|
1171
|
+
if (l > r.maxScanned) throw new w("limit");
|
|
1134
1172
|
const a = /* @__PURE__ */ new Map();
|
|
1135
|
-
for (let
|
|
1136
|
-
|
|
1173
|
+
for (let s = 0; s < t; s++) {
|
|
1174
|
+
s > 0 && s % 2048 === 0 && (await r.yieldToHost(), z(r.signal));
|
|
1137
1175
|
let c = 0;
|
|
1138
|
-
for (const d of o.cells[
|
|
1139
|
-
for (await J(r); c <
|
|
1140
|
-
if (c >=
|
|
1141
|
-
const m = Math.max(1, Math.min(d?.colSpan ?? 1,
|
|
1176
|
+
for (const d of o.cells[s]) {
|
|
1177
|
+
for (await J(r); c < l && (a.get(c) ?? 0) > s; ) c++;
|
|
1178
|
+
if (c >= l) break;
|
|
1179
|
+
const m = Math.max(1, Math.min(d?.colSpan ?? 1, l - c)), h = Math.min(o.cells.length, s + Math.max(1, d?.rowSpan ?? 1));
|
|
1142
1180
|
m > 1 && await J(r, m - 1);
|
|
1143
1181
|
for (let f = c; f < c + m; f++) a.set(f, h);
|
|
1144
|
-
const
|
|
1145
|
-
|
|
1182
|
+
const g = Bt(e, s, c, n);
|
|
1183
|
+
g && Wt(i, d, g), c += m;
|
|
1146
1184
|
}
|
|
1147
1185
|
}
|
|
1148
1186
|
}
|
|
1149
|
-
async function
|
|
1187
|
+
async function Vt(e, t, n) {
|
|
1150
1188
|
const r = { values: [], seen: /* @__PURE__ */ new Set(), excluded: 0, selected: 0 };
|
|
1151
1189
|
for (let i = 0; i < e.pages.length; i++) {
|
|
1152
1190
|
await J(n);
|
|
1153
1191
|
const o = e.pages[i];
|
|
1154
|
-
for (let
|
|
1192
|
+
for (let l = 0; l < o.components.length; l++) {
|
|
1155
1193
|
await J(n);
|
|
1156
|
-
const a = o.components[
|
|
1157
|
-
if (!a.grid || !
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1194
|
+
const a = o.components[l];
|
|
1195
|
+
if (!a.grid || !_t(a, i, l, t) || a.table && a.table.role !== "body") continue;
|
|
1196
|
+
const s = Gt(a, t);
|
|
1197
|
+
s && await Ut(a, s, t, n, r);
|
|
1160
1198
|
}
|
|
1161
1199
|
}
|
|
1162
1200
|
return r;
|
|
@@ -1165,7 +1203,7 @@ function B(e) {
|
|
|
1165
1203
|
if (!Number.isFinite(e)) throw new w("overflow");
|
|
1166
1204
|
return e;
|
|
1167
1205
|
}
|
|
1168
|
-
function
|
|
1206
|
+
function qt(e) {
|
|
1169
1207
|
let t = 0, n = 0;
|
|
1170
1208
|
for (const r of e) {
|
|
1171
1209
|
const i = r - n, o = B(t + i);
|
|
@@ -1173,200 +1211,209 @@ function Ut(e) {
|
|
|
1173
1211
|
}
|
|
1174
1212
|
return t;
|
|
1175
1213
|
}
|
|
1176
|
-
async function
|
|
1214
|
+
async function ye(e, t) {
|
|
1177
1215
|
let n = [...e], r = new Array(e.length);
|
|
1178
1216
|
for (let o = 1; o < e.length; o *= 2) {
|
|
1179
|
-
for (let
|
|
1180
|
-
const a = Math.min(
|
|
1181
|
-
let c =
|
|
1182
|
-
for (let m =
|
|
1183
|
-
r[m] = d >=
|
|
1217
|
+
for (let l = 0; l < e.length; l += o * 2) {
|
|
1218
|
+
const a = Math.min(l + o, e.length), s = Math.min(l + o * 2, e.length);
|
|
1219
|
+
let c = l, d = a;
|
|
1220
|
+
for (let m = l; m < s; m++)
|
|
1221
|
+
r[m] = d >= s || c < a && n[c] <= n[d] ? n[c++] : n[d++], m % 2048 === 0 && (await t.yieldToHost(), z(t.signal));
|
|
1184
1222
|
}
|
|
1185
1223
|
[n, r] = [r, n];
|
|
1186
1224
|
}
|
|
1187
1225
|
const i = Math.floor(n.length / 2);
|
|
1188
1226
|
return n.length % 2 ? n[i] : B(n[i - 1] / 2 + n[i] / 2);
|
|
1189
1227
|
}
|
|
1190
|
-
function
|
|
1191
|
-
const t =
|
|
1228
|
+
function Yt(e) {
|
|
1229
|
+
const t = qt(e);
|
|
1192
1230
|
let n = 1 / 0, r = -1 / 0;
|
|
1193
1231
|
for (const i of e)
|
|
1194
1232
|
n = Math.min(n, i), r = Math.max(r, i);
|
|
1195
1233
|
return { SUM: t, AVERAGE: t / e.length, AVG: t / e.length, MIN: n, MAX: r, COUNT: e.length };
|
|
1196
1234
|
}
|
|
1197
|
-
function
|
|
1235
|
+
function Kt(e, t) {
|
|
1198
1236
|
if (typeof e != "string" || e.length > 256) throw new w("expression");
|
|
1199
1237
|
const n = e.toUpperCase().match(/(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?|[A-Z_]+|[()+\-*/]|\S/g) ?? [];
|
|
1200
1238
|
if (!n.length || n.length > 64) throw new w("expression");
|
|
1201
1239
|
let r = 0;
|
|
1202
1240
|
function i(a) {
|
|
1203
1241
|
if (a > 16) throw new w("expression");
|
|
1204
|
-
const
|
|
1205
|
-
if (
|
|
1206
|
-
if (
|
|
1242
|
+
const s = n[r++];
|
|
1243
|
+
if (s === "+" || s === "-") return (s === "-" ? -1 : 1) * i(a + 1);
|
|
1244
|
+
if (s === "(") {
|
|
1207
1245
|
const c = o(0, a + 1);
|
|
1208
1246
|
if (n[r++] !== ")") throw new w("expression");
|
|
1209
1247
|
return c;
|
|
1210
1248
|
}
|
|
1211
|
-
if (
|
|
1212
|
-
if (
|
|
1249
|
+
if (s && /^(?:SUM|AVERAGE|AVG|MIN|MAX|COUNT|MEDIAN)$/.test(s) && Object.prototype.hasOwnProperty.call(t, s)) return B(t[s]);
|
|
1250
|
+
if (s && /^(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?$/.test(s)) return B(Number(s));
|
|
1213
1251
|
throw new w("expression");
|
|
1214
1252
|
}
|
|
1215
|
-
function o(a,
|
|
1216
|
-
let c = i(
|
|
1253
|
+
function o(a, s) {
|
|
1254
|
+
let c = i(s);
|
|
1217
1255
|
for (; r < n.length; ) {
|
|
1218
1256
|
const d = n[r], m = d === "+" || d === "-" ? 1 : d === "*" || d === "/" ? 2 : 0;
|
|
1219
1257
|
if (!m || m < a) break;
|
|
1220
1258
|
r++;
|
|
1221
|
-
const h = o(m + 1,
|
|
1259
|
+
const h = o(m + 1, s + 1);
|
|
1222
1260
|
if (d === "/" && h === 0) throw new w("division");
|
|
1223
1261
|
c = B(d === "+" ? c + h : d === "-" ? c - h : d === "*" ? c * h : c / h);
|
|
1224
1262
|
}
|
|
1225
1263
|
return c;
|
|
1226
1264
|
}
|
|
1227
|
-
const
|
|
1265
|
+
const l = o(1, 0);
|
|
1228
1266
|
if (r !== n.length) throw new w("expression");
|
|
1229
|
-
return
|
|
1267
|
+
return l;
|
|
1230
1268
|
}
|
|
1231
|
-
function
|
|
1269
|
+
function Xt(e) {
|
|
1232
1270
|
const t = e.maxCells ?? 1e5, n = e.maxScannedCells ?? 2e5, r = e.precision ?? 2;
|
|
1233
1271
|
if (![t, n].every((i) => Number.isSafeInteger(i) && i >= 1 && i <= 2e6)) throw new w("limit");
|
|
1234
1272
|
if (!Number.isInteger(r) || r < 0 || r > 12) throw new w("precision");
|
|
1235
1273
|
return { maxCells: t, maxScanned: n, precision: r };
|
|
1236
1274
|
}
|
|
1237
|
-
async function
|
|
1238
|
-
const r =
|
|
1239
|
-
|
|
1240
|
-
const o = await
|
|
1241
|
-
if (!["sum", "average", "min", "max", "count", "median", "expression"].includes(
|
|
1275
|
+
async function Rn(e, t, n = {}) {
|
|
1276
|
+
const r = Xt(n), i = { scanned: 0, maxScanned: r.maxScanned, signal: n.signal, yieldToHost: n.yieldToHost ?? (() => new Promise((s) => setTimeout(s, 0))) };
|
|
1277
|
+
z(i.signal);
|
|
1278
|
+
const o = await Vt(e, Ot(e, t, r.maxCells), i), l = n.operation ?? "sum";
|
|
1279
|
+
if (!["sum", "average", "min", "max", "count", "median", "expression"].includes(l)) throw new w("expression");
|
|
1242
1280
|
let a = null;
|
|
1243
|
-
if (
|
|
1281
|
+
if (l === "count") a = o.values.length;
|
|
1244
1282
|
else if (o.values.length)
|
|
1245
|
-
if (
|
|
1283
|
+
if (l === "median") a = await ye(o.values, i);
|
|
1246
1284
|
else {
|
|
1247
|
-
const
|
|
1248
|
-
|
|
1285
|
+
const s = Yt(o.values);
|
|
1286
|
+
l === "expression" ? (/\bMEDIAN\b/i.test(n.expression ?? "") && (s.MEDIAN = await ye(o.values, i)), a = Kt(n.expression ?? "", s)) : a = s[l.toUpperCase()];
|
|
1249
1287
|
}
|
|
1250
|
-
if (
|
|
1288
|
+
if (z(i.signal), a !== null && Number.isInteger(a) && !Number.isSafeInteger(a)) throw new w("precision");
|
|
1251
1289
|
return { value: a, formatted: a === null ? "—" : a.toFixed(r.precision), numericCells: o.values.length, excludedCells: o.excluded, selectedCells: o.selected, precision: r.precision };
|
|
1252
1290
|
}
|
|
1253
1291
|
export {
|
|
1254
|
-
|
|
1255
|
-
|
|
1292
|
+
jn as CSS_DPI,
|
|
1293
|
+
kn as DEFAULT_BORDER_PT,
|
|
1256
1294
|
Z as DEFAULT_FONT_FAMILY,
|
|
1257
|
-
|
|
1258
|
-
|
|
1295
|
+
In as DEFAULT_FONT_PT,
|
|
1296
|
+
$n as DEFAULT_STROKE_COLOR,
|
|
1259
1297
|
ve as DEFAULT_TEXT_COLOR,
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1298
|
+
Nn as LINE_HEIGHT,
|
|
1299
|
+
Bn as MM_PER_INCH,
|
|
1300
|
+
Lr as OutputAssetError,
|
|
1301
|
+
Ue as OutputFidelityError,
|
|
1264
1302
|
K as PAPER_SIZES,
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1303
|
+
yt as PageBuilder,
|
|
1304
|
+
sr as PaginateCellLimitError,
|
|
1305
|
+
lr as PaginatePageLimitError,
|
|
1268
1306
|
qn as RENDER_PLAN_SCHEMA_VERSION,
|
|
1269
|
-
|
|
1307
|
+
zr as REPORT_TEMPLATE_DOCUMENT_VERSION,
|
|
1270
1308
|
w as ReportCalculationError,
|
|
1271
|
-
|
|
1309
|
+
Be as ReportCellEditError,
|
|
1272
1310
|
Pt as ReportCellFieldError,
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1311
|
+
Vr as ReportParamValidationError,
|
|
1312
|
+
cr as ReportSourceError,
|
|
1313
|
+
Hr as ReportTemplateError,
|
|
1314
|
+
N as ReportTemplateStoreError,
|
|
1315
|
+
Ln as SCHEMA_VERSION_MACH,
|
|
1316
|
+
bt as TemplateBuilder,
|
|
1317
|
+
ri as TreeRowLimitError,
|
|
1318
|
+
dr as applyReportCellEdit,
|
|
1319
|
+
mr as applyReportCellEditBatch,
|
|
1320
|
+
hr as applyReportEditResult,
|
|
1321
|
+
Kn as assertRenderPlan,
|
|
1283
1322
|
qr as assertReportParams,
|
|
1284
|
-
|
|
1285
|
-
|
|
1323
|
+
Rn as calculateReportSelection,
|
|
1324
|
+
nr as charWidthEm,
|
|
1286
1325
|
E as classOf,
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
ur as
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1326
|
+
xn as cloneReportTemplate,
|
|
1327
|
+
wn as columnsFromContract,
|
|
1328
|
+
dt as computePageWindow,
|
|
1329
|
+
gr as countTemplatePages,
|
|
1330
|
+
rr as createCanvasMeasurer,
|
|
1331
|
+
fn as createCanvasPager,
|
|
1332
|
+
ir as createHeuristicMeasurer,
|
|
1333
|
+
En as createLocalTemplateCatalog,
|
|
1334
|
+
Mn as createMemoryTemplateStore,
|
|
1335
|
+
yn as createProviderReport,
|
|
1336
|
+
ur as createReportCellEdit,
|
|
1337
|
+
fr as createReportCellEditBatch,
|
|
1338
|
+
pr as createReportCellResolver,
|
|
1339
|
+
wr as createReportEditSession,
|
|
1340
|
+
br as createReportSource,
|
|
1341
|
+
bn as createTableTemplate,
|
|
1342
|
+
pn as createTemplate,
|
|
1302
1343
|
vn as createTemplateManager,
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1344
|
+
Wr as createTemplateRegistry,
|
|
1345
|
+
ii as createTreeTable,
|
|
1346
|
+
er as datasetJsonSchema,
|
|
1347
|
+
yr as defineReport,
|
|
1348
|
+
_r as defineReportTemplate,
|
|
1349
|
+
vr as diffReportTemplates,
|
|
1350
|
+
Mr as estimateListLayoutCells,
|
|
1351
|
+
Fn as evalStyleRule,
|
|
1352
|
+
Kt as evaluateReportAggregateExpression,
|
|
1353
|
+
xr as formatReportCellEdit,
|
|
1354
|
+
Sn as formatReportClipboard,
|
|
1355
|
+
Yr as formatReportDateRange,
|
|
1356
|
+
On as formatValue,
|
|
1357
|
+
Er as getReportCellContext,
|
|
1358
|
+
Sr as getReportEditSession,
|
|
1316
1359
|
ae as heuristicMeasurer,
|
|
1317
|
-
|
|
1360
|
+
Fr as inspectOutputCapabilities,
|
|
1318
1361
|
ee as isImageBackedComponent,
|
|
1319
|
-
|
|
1320
|
-
|
|
1362
|
+
Kr as isReportDate,
|
|
1363
|
+
Xr as isReportMonth,
|
|
1364
|
+
Jr as isReportYear,
|
|
1365
|
+
Se as isRichText,
|
|
1321
1366
|
le as measurePageSizePx,
|
|
1322
|
-
|
|
1323
|
-
|
|
1367
|
+
ar as measureTextMm,
|
|
1368
|
+
xe as mergeComponentStyles,
|
|
1324
1369
|
ie as mmToPx,
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1370
|
+
Gn as mmToPxFactor,
|
|
1371
|
+
Tr as paginateTemplate,
|
|
1372
|
+
Cr as paginateTemplatePages,
|
|
1373
|
+
zn as parseDateLocal,
|
|
1374
|
+
Cn as parseReportCellFieldInput,
|
|
1375
|
+
Ge as parseReportCellInput,
|
|
1376
|
+
Tn as parseReportClipboard,
|
|
1377
|
+
Zr as parseReportDateRange,
|
|
1378
|
+
D as parseReportTemplate,
|
|
1379
|
+
mn as planFontSizePx,
|
|
1380
|
+
Rr as projectListColumns,
|
|
1381
|
+
O as ptToPx,
|
|
1382
|
+
Un as pxToMm,
|
|
1383
|
+
Pr as registerReportEditSession,
|
|
1384
|
+
Ar as relocateReportCellEdits,
|
|
1385
|
+
ke as renderComponent,
|
|
1386
|
+
at as renderPage,
|
|
1387
|
+
dn as renderPlan,
|
|
1388
|
+
gn as renderPlanToCanvas,
|
|
1343
1389
|
un as renderPlanToCanvasAsync,
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1390
|
+
hn as renderPlanToImages,
|
|
1391
|
+
kr as reportCellEditKey,
|
|
1392
|
+
G as reportOutputDiagnostics,
|
|
1393
|
+
Qr as reportParamsJsonSchema,
|
|
1394
|
+
Me as resolveBoxBorders,
|
|
1395
|
+
W as resolveFontSize,
|
|
1396
|
+
Ce as resolveGridLayout,
|
|
1351
1397
|
Q as resolveLineHeight,
|
|
1352
|
-
|
|
1398
|
+
Fe as resolvePaper,
|
|
1353
1399
|
oe as resolvePlanAssets,
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1400
|
+
j as resolveStroke,
|
|
1401
|
+
Ee as resolveTextColor,
|
|
1402
|
+
Ir as reviewReportTemplate,
|
|
1403
|
+
H as round,
|
|
1404
|
+
jr as serializeReportTemplate,
|
|
1405
|
+
$r as summarizeReportCellEdits,
|
|
1406
|
+
Hn as toExcelNumberFormat,
|
|
1407
|
+
Wn as toNumber,
|
|
1408
|
+
Xn as validateComponent,
|
|
1363
1409
|
je as validateDatasetRows,
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1410
|
+
Jn as validatePage,
|
|
1411
|
+
Zn as validateRenderPlan,
|
|
1412
|
+
Ft as validateReportCellFieldDefinition,
|
|
1413
|
+
ei as validateReportParamDefinitions,
|
|
1414
|
+
ti as validateReportParams,
|
|
1415
|
+
Br as validateReportTemplate,
|
|
1416
|
+
Gr as validateReportTemplateDocument,
|
|
1417
|
+
ai as validateTreeOptions,
|
|
1418
|
+
Te as wrapText
|
|
1372
1419
|
};
|