@agile-team/mach-report 2.23.1 → 2.24.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 +8 -2
- package/dist/{ExcelBindingWizard-BrTmdo7f.cjs → ExcelBindingWizard-BV12hGiK.cjs} +1 -1
- package/dist/{ExcelBindingWizard-CcDMLO8Q.js → ExcelBindingWizard-Cy_lPjWV.js} +3 -3
- package/dist/ParamEditor-DenKjvKu.cjs +1 -0
- package/dist/ParamEditor-PyOqHzzw.js +750 -0
- package/dist/{ReportBatchPanel-CJB67WNd.js → ReportBatchPanel-8EFtMrKk.js} +2 -2
- package/dist/{ReportBatchPanel-CHxBtG9R.cjs → ReportBatchPanel-pQ6d0yqJ.cjs} +1 -1
- package/dist/ReportLabelStudio-B_KF3Zc_.cjs +1 -0
- package/dist/{ReportLabelStudio-Tplc1TLJ.js → ReportLabelStudio-HUeo2TsU.js} +68 -68
- package/dist/ReportParamPanel-8xR85nz-.cjs +1 -0
- package/dist/{ReportParamPanel-GI43aGa0.js → ReportParamPanel-DA-YpkvC.js} +328 -298
- package/dist/ReportPreview-CyUXJSVX.cjs +6 -0
- package/dist/ReportPreview-_wTJnsG1.js +7120 -0
- package/dist/{ReportTemplateLibrary-BFQIX0sg.cjs → ReportTemplateLibrary-CjArKxRG.cjs} +1 -1
- package/dist/{ReportTemplateLibrary-KqX4E2sN.js → ReportTemplateLibrary-DH8jl9IF.js} +28 -28
- package/dist/RuleEditor-Bmj98oC4.cjs +1 -0
- package/dist/{RuleEditor-OPX1awrH.js → RuleEditor-GDydlEHz.js} +846 -834
- package/dist/{TemplateOutlinePanel-CVYKVLv_.cjs → TemplateOutlinePanel-B554_qk1.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-DQS-eOs6.js → TemplateOutlinePanel-DjPqzU9h.js} +10 -10
- package/dist/{TemplateReusePanel-CY6O93Zk.cjs → TemplateReusePanel-D0628OYc.cjs} +1 -1
- package/dist/{TemplateReusePanel-DKXiFTyB.js → TemplateReusePanel-DtYbCN7U.js} +2 -2
- package/dist/TemplateReviewPanel-CSwvCz3f.cjs +1 -0
- package/dist/TemplateReviewPanel-D_FR4ISq.js +602 -0
- package/dist/artifact-integrity.json +94 -94
- package/dist/assets-B4AJIOTB.cjs +1 -0
- package/dist/assets-D0FbszhB.js +137 -0
- package/dist/{auto-BB99S802.js → auto-BksreoKc.js} +5 -5
- package/dist/auto-C3mGqzJ8.cjs +1 -0
- package/dist/capabilities-CTwlcl8q.cjs +1 -0
- package/dist/capabilities-lqDEZSq5.js +121 -0
- package/dist/data-bar-2NLRzOCQ.cjs +1 -0
- package/dist/{data-bar-IkI6VvMQ.js → data-bar-BnGtnJ82.js} +1 -1
- package/dist/designer-BNf7NWd6.js +7589 -0
- package/dist/designer-DWnZZ_ej.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +137 -4
- package/dist/designer.d.ts +137 -4
- package/dist/designer.js +5 -5
- package/dist/diagnostic-collector-1sqd7DQP.js +355 -0
- package/dist/diagnostic-collector-D3rlvxm3.cjs +1 -0
- package/dist/{dom-JWrchIre.js → dom-C90cTM6Y.js} +4 -4
- package/dist/dom-CxOkm_Sy.cjs +1 -0
- package/dist/{encoding-7lquyj0w.cjs → encoding-CkziAnZI.cjs} +1 -1
- package/dist/{encoding-CEd-dq9A.js → encoding-DSc9zv2F.js} +2 -2
- package/dist/{font-loader-D8pI87fL.cjs → font-loader-D-znWNWS.cjs} +1 -1
- package/dist/{font-loader-CNWXomuV.js → font-loader-i7lZbqH_.js} +1 -1
- package/dist/{grid-strokes-EoY66L2f.js → grid-strokes-BPiV1WHe.js} +1 -1
- package/dist/grid-strokes-DYf-6DMl.cjs +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +46 -7
- package/dist/index.d.ts +46 -7
- package/dist/index.js +69 -68
- package/dist/{json-snapshot-BRnzKudk.js → json-snapshot-BJWZNryO.js} +919 -791
- package/dist/json-snapshot-C7QZrRBf.cjs +2 -0
- package/dist/{pdf-CJToa81Z.js → pdf-0_5XiTCx.js} +2499 -2492
- package/dist/{pdf-DpMkW72B.cjs → pdf-DWuq6uxx.cjs} +31 -31
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.d.cts +18 -0
- package/dist/pdf.d.ts +18 -0
- package/dist/pdf.js +2 -2
- package/dist/{plugin-_BkUVc2z.js → plugin-B1ydqEmS.js} +1 -1
- package/dist/{plugin-BWTp-X7b.cjs → plugin-BQBz2vLG.cjs} +1 -1
- package/dist/prefill-2p9wrpn9.cjs +1 -0
- package/dist/{prefill-CWGdnqQd.js → prefill-Cuzh1wxf.js} +13 -13
- package/dist/prepared-CVbgO9KR.js +128 -0
- package/dist/prepared-DAwe8Il2.cjs +1 -0
- package/dist/protocol-BOri9qJL.js +105 -0
- package/dist/protocol-DD5dHSz-.cjs +1 -0
- package/dist/record-bindings-CAyM5tGg.cjs +1 -0
- package/dist/{record-bindings-DatJZv_e.js → record-bindings-fhav-NLG.js} +1 -1
- package/dist/{region-binding-workflow-DjrXuR1q.js → region-binding-workflow-Cm4mqhih.js} +2 -2
- package/dist/{region-binding-workflow-l7NGfagJ.cjs → region-binding-workflow-DWCUgjZl.cjs} +1 -1
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/rich-text-layout-X9YOz1JD.cjs +3 -0
- package/dist/{rich-text-layout-Ciwa6D2o.js → rich-text-layout-YJHtCWQI.js} +1 -1
- package/dist/runtime-BpSAgOw1.js +201 -0
- package/dist/runtime-Cd2UTnwe.cjs +1 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server/node.d.cts +55 -7
- package/dist/server/node.d.ts +55 -7
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +2721 -2430
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +47 -12
- package/dist/server.d.ts +47 -12
- package/dist/server.js +8 -8
- package/dist/style.css +1 -1
- package/dist/{template-catalog-DtrtT1FY.cjs → template-catalog--yBX169M.cjs} +1 -1
- package/dist/{template-catalog-CRuZL3pi.js → template-catalog-Bu7s7ReF.js} +3 -3
- package/dist/template-fragments-5EzVn7bm.cjs +1 -0
- package/dist/{template-fragments-CPpGpQoz.js → template-fragments-Di2vDFnx.js} +2 -2
- package/dist/{template-registry-O0hNIOfB.js → template-registry-BCBF2b8j.js} +10 -10
- package/dist/template-registry-Bnh5aEYf.cjs +1 -0
- package/dist/textwrap-BPFxhpOw.cjs +4 -0
- package/dist/{textwrap-D4ZksyMK.js → textwrap-CmVkhMhx.js} +1 -1
- package/dist/vue/async.d.cts +97 -18
- package/dist/vue/async.d.ts +97 -18
- package/dist/vue/index.d.cts +127 -28
- package/dist/vue/index.d.ts +127 -28
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +192 -162
- package/dist/{workbook-session-C9ZmCBwY.js → workbook-session-B6P_-5a4.js} +2 -2
- package/dist/{workbook-session-C6-SrnCT.cjs → workbook-session-BnPK3T58.cjs} +1 -1
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +55 -7
- package/dist/worker.d.ts +55 -7
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.d.cts +18 -1
- package/dist/xlsx.d.ts +18 -1
- package/dist/xlsx.js +279 -272
- package/package.json +1 -1
- package/dist/ParamEditor-BGjovFUe.js +0 -737
- package/dist/ParamEditor-CeNp4_zQ.cjs +0 -1
- package/dist/ReportLabelStudio-g8PkqJWn.cjs +0 -1
- package/dist/ReportParamPanel-C7fZTllk.cjs +0 -1
- package/dist/ReportPreview-BoGBGyRr.cjs +0 -6
- package/dist/ReportPreview-QLONCyci.js +0 -6257
- package/dist/RuleEditor-BZUP9yvL.cjs +0 -1
- package/dist/TemplateReviewPanel-DbeNC8Ms.cjs +0 -1
- package/dist/TemplateReviewPanel-Dijwm9YE.js +0 -593
- package/dist/assets-D2gHc4Mz.cjs +0 -1
- package/dist/assets-T_gDeFaz.js +0 -132
- package/dist/auto-BrPWo7Xm.cjs +0 -1
- package/dist/capabilities-DiBj4Qgl.cjs +0 -1
- package/dist/capabilities-pg7j7VLT.js +0 -106
- package/dist/data-bar-CeZuFmYl.cjs +0 -1
- package/dist/designer-BZoVWTgl.js +0 -7172
- package/dist/designer-zS2uKJmY.cjs +0 -2
- package/dist/dom-ChE5D-L-.cjs +0 -1
- package/dist/grid-strokes-Be24LGuV.cjs +0 -1
- package/dist/json-snapshot-DNiIbpOr.cjs +0 -2
- package/dist/prefill-PaAy6wLk.cjs +0 -1
- package/dist/prepared-CJy_qk7d.js +0 -94
- package/dist/prepared-D0yCSxSO.cjs +0 -1
- package/dist/progress-ByiOxUD3.js +0 -250
- package/dist/progress-WomPRP3B.cjs +0 -1
- package/dist/protocol-BG16rz6D.js +0 -90
- package/dist/protocol-wzhl1Fim.cjs +0 -1
- package/dist/record-bindings-MBxbeBsi.cjs +0 -1
- package/dist/rich-text-layout-DK7A_a5r.cjs +0 -3
- package/dist/runtime-DYMOS_gz.cjs +0 -1
- package/dist/runtime-PiCax9zQ.js +0 -171
- package/dist/template-fragments-GVjpew_q.cjs +0 -1
- package/dist/template-registry-DI59PXVK.cjs +0 -1
- package/dist/textwrap-DEHqAjKZ.cjs +0 -4
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
import { w as
|
|
3
|
-
import { e as
|
|
4
|
-
import { d as
|
|
5
|
-
import { c as
|
|
6
|
-
import { f as
|
|
7
|
-
import { j as
|
|
8
|
-
import { g as
|
|
9
|
-
import { a as
|
|
10
|
-
import { f as
|
|
11
|
-
import { v as
|
|
12
|
-
const
|
|
13
|
-
function
|
|
1
|
+
import { r as q, a as Z, L as xe, b as zt, R as Pe, j as Jt, m as H, D as ke } from "./diagnostic-collector-1sqd7DQP.js";
|
|
2
|
+
import { w as B, h as re } from "./textwrap-CmVkhMhx.js";
|
|
3
|
+
import { e as Ce, n as G, b as Te, q as D, s as _t, t as qt } from "./computed-f3pOqWLX.js";
|
|
4
|
+
import { d as Xe, R as F, f as U, k as Ye, b as Ut, i as Xt, v as Ee, c as Yt, P as ne, l as Re, t as Qe, m as Ze, h as et, n as Qt, o as Zt, D as er, e as pe } from "./record-bindings-fhav-NLG.js";
|
|
5
|
+
import { c as tr, e as rr } from "./matrix-C6e_r_vp.js";
|
|
6
|
+
import { f as tt, d as nr, e as or, c as rt } from "./template-serialization-CWmHq7lX.js";
|
|
7
|
+
import { j as ar, r as sr, k as ir, b as Ie, v as cr, R as lr } from "./template-registry-BCBF2b8j.js";
|
|
8
|
+
import { g as dr } from "./report-params-D9tBuM9B.js";
|
|
9
|
+
import { a as Be } from "./param-validation-CnDEd2l-.js";
|
|
10
|
+
import { f as ur, i as fr } from "./number-format-BA_KwrZe.js";
|
|
11
|
+
import { v as nt, d as mr } from "./dataset-DL83majE.js";
|
|
12
|
+
const hr = 4096, Ge = 128 * 1024;
|
|
13
|
+
function gr(e) {
|
|
14
14
|
const t = /* @__PURE__ */ new Map();
|
|
15
15
|
let r = 0;
|
|
16
16
|
return { measureMm(n, o) {
|
|
@@ -18,8 +18,8 @@ function mr(e) {
|
|
|
18
18
|
if (s !== void 0)
|
|
19
19
|
return t.delete(a), t.set(a, s), s;
|
|
20
20
|
const i = e.measureMm(n, o);
|
|
21
|
-
if (Number.isFinite(i) && a.length <=
|
|
22
|
-
for (; t.size >=
|
|
21
|
+
if (Number.isFinite(i) && a.length <= Ge) {
|
|
22
|
+
for (; t.size >= hr || r + a.length > Ge; ) {
|
|
23
23
|
const c = t.keys().next().value;
|
|
24
24
|
r -= c.length, t.delete(c);
|
|
25
25
|
}
|
|
@@ -28,10 +28,10 @@ function mr(e) {
|
|
|
28
28
|
return i;
|
|
29
29
|
} };
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function pr(e, t) {
|
|
32
32
|
return { member: "body", subtotal: "subtotal", total: "grand-total" }[e?.rows.get(t)?.kind ?? "member"];
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function wr(e) {
|
|
35
35
|
const t = e.matrix;
|
|
36
36
|
if (!t.hierarchy) return t;
|
|
37
37
|
const r = new Map(e.columns.map((o) => [o.field, o.header])), n = { sum: "求和", count: "计数", avg: "平均", min: "最小", max: "最大", weightedAvg: "加权平均" };
|
|
@@ -44,10 +44,10 @@ function gr(e) {
|
|
|
44
44
|
return o.label === void 0 && a ? { ...o, label: `${a}(${n[o.op]})` } : o;
|
|
45
45
|
}) };
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function yr(e, t) {
|
|
48
48
|
if (!e.matrix) return { list: e, rows: t };
|
|
49
49
|
if (e.detail || e.groupBy || e.groups?.length || e.grandTotal) throw new Error("矩阵不能同时配置普通分组、总计或主从明细");
|
|
50
|
-
const r =
|
|
50
|
+
const r = tr(t, wr(e)), n = r.columns.map((i) => ({ ...i, widthMm: i.semanticRole === "dimension" ? e.matrix.rowWidthMm ?? 40 : e.matrix.columnWidthMm ?? 28, editable: !1, align: i.semanticRole === "dimension" ? "center" : "right" })), o = { ...e, columns: n, headerGrid: r.headerGrid, rowKey: void 0, revisionField: void 0, sourceTokenField: void 0 };
|
|
51
51
|
e.layout === "wide" && (o.widthMm = n.reduce((i, c) => i + c.widthMm, 0));
|
|
52
52
|
const a = r.metadata, s = a ? { rows: new WeakMap(r.rows.map((i, c) => [i, a.rows[c]])), header: {
|
|
53
53
|
columns: a.columns,
|
|
@@ -58,18 +58,18 @@ function pr(e, t) {
|
|
|
58
58
|
} } : void 0;
|
|
59
59
|
return { list: o, rows: r.rows, ...s ? { matrix: s } : {} };
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function br(e, t) {
|
|
62
62
|
if (!e.matrix?.hierarchy || !e.headerGrid) return e.headerGrid;
|
|
63
|
-
const r = e.paddingMm ?? 1, n = e.headerGrid.cells.map(() => e.rowHeightMm ?? 0), o = e.columns.map((c) => c.widthMm), a =
|
|
63
|
+
const r = e.paddingMm ?? 1, n = e.headerGrid.cells.map(() => e.rowHeightMm ?? 0), o = e.columns.map((c) => c.widthMm), a = q({ ...e.headerGrid, colWidthsMm: o }, o.reduce((c, l) => c + l, 0), n.length), s = /* @__PURE__ */ new WeakMap();
|
|
64
64
|
for (const { cell: c, ci: l, ri: u, widthMm: f } of a.cells) {
|
|
65
|
-
const d = { ...
|
|
66
|
-
for (let
|
|
65
|
+
const d = { ...Xe(e, e.columns[l]), ...c.style }, m = Z(d).fontSizePt, b = (B(c.text ?? "", Math.max(1, f - r * 2), { fontSizePt: m, fontFamily: d.fontFamily, bold: d.bold, italic: d.italic, letterSpacingPt: d.letterSpacing }, t).length * m * (d.lineHeight ?? xe) * 25.4 / 72 + r * 2) / (c.rowSpan ?? 1);
|
|
66
|
+
for (let w = u; w < u + (c.rowSpan ?? 1); w++) n[w] = Math.max(n[w] ?? 0, b);
|
|
67
67
|
s.set(c, d);
|
|
68
68
|
}
|
|
69
69
|
const i = e.headerGrid.cells.map((c) => c.map((l) => l ? { ...l, style: s.get(l) } : null));
|
|
70
70
|
return { ...e.headerGrid, cells: i, rowHeightsMm: n };
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function vr(e, t, r) {
|
|
73
73
|
const n = /* @__PURE__ */ new Set(), o = e.cells.map((a, s) => {
|
|
74
74
|
const i = [];
|
|
75
75
|
let c = 0;
|
|
@@ -77,10 +77,10 @@ function yr(e, t, r) {
|
|
|
77
77
|
for (; n.has(`${s}:${c}`); ) c++;
|
|
78
78
|
const u = l?.colSpan ?? 1, f = l?.rowSpan ?? 1;
|
|
79
79
|
let d = 0;
|
|
80
|
-
for (let
|
|
81
|
-
t.has(
|
|
82
|
-
for (let
|
|
83
|
-
n.add(`${
|
|
80
|
+
for (let m = c; m < c + u; m++) {
|
|
81
|
+
t.has(m) && d++;
|
|
82
|
+
for (let h = s + 1; h < s + f; h++)
|
|
83
|
+
n.add(`${h}:${m}`);
|
|
84
84
|
}
|
|
85
85
|
d && i.push(l ? { ...l, colSpan: d } : null), c += u;
|
|
86
86
|
}
|
|
@@ -88,7 +88,7 @@ function yr(e, t, r) {
|
|
|
88
88
|
});
|
|
89
89
|
return { ...e, cells: o, colWidthsMm: r };
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function Mr(e) {
|
|
92
92
|
if (!e.columns.some((n) => n.hidden)) return e;
|
|
93
93
|
const t = /* @__PURE__ */ new Set(), r = e.columns.filter((n, o) => n.hidden ? !1 : (t.add(o), !0));
|
|
94
94
|
if (!r.length) throw new Error("列表至少需要一列可见列");
|
|
@@ -96,7 +96,7 @@ function br(e) {
|
|
|
96
96
|
...e,
|
|
97
97
|
columns: r,
|
|
98
98
|
...e.headerGrid ? {
|
|
99
|
-
headerGrid:
|
|
99
|
+
headerGrid: vr(
|
|
100
100
|
e.headerGrid,
|
|
101
101
|
t,
|
|
102
102
|
r.map((n) => n.widthMm)
|
|
@@ -104,11 +104,11 @@ function br(e) {
|
|
|
104
104
|
} : {}
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
function*
|
|
107
|
+
function* Sr(e) {
|
|
108
108
|
const { page: t } = e;
|
|
109
|
-
|
|
109
|
+
ar(t.components, t.flow);
|
|
110
110
|
let r = 0, n = 0;
|
|
111
|
-
for (const o of
|
|
111
|
+
for (const o of sr(t.components, t.flow)) {
|
|
112
112
|
e.active();
|
|
113
113
|
const a = o.band, s = o.components.some((u) => u.kind === "list" && u.cardinality !== "record"), i = s ? 0 : o.components.reduce((u, f) => Math.max(u, f.topMm - a.topMm + (f.kind === "list" ? e.height(f) : f.heightMm)), a.heightMm);
|
|
114
114
|
let c = Math.max(e.top(), n + a.topMm - r);
|
|
@@ -124,14 +124,14 @@ function* vr(e) {
|
|
|
124
124
|
n = l, r = a.topMm + a.heightMm;
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function xr(e) {
|
|
128
128
|
return !!(e.computed?.length || e.groups?.length || e.groupBy || e.grandTotal || e.rowVisibleWhen || e.matrix || e.tree || e.detail || e.columns.some((t) => t.rules?.length || t.visibleWhen || t.visual));
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
return e.pages.some((t) => t.components.some((r) => r.kind === "list" ?
|
|
130
|
+
function $e(e) {
|
|
131
|
+
return e.pages.some((t) => t.components.some((r) => r.kind === "list" ? xr(r) : !!r.chartBinding));
|
|
132
132
|
}
|
|
133
|
-
const
|
|
134
|
-
function
|
|
133
|
+
const Pr = 512, We = 256 * 1024;
|
|
134
|
+
function kr() {
|
|
135
135
|
const e = /* @__PURE__ */ new Map();
|
|
136
136
|
let t = 0, r;
|
|
137
137
|
return (n, o, a, s) => {
|
|
@@ -139,9 +139,9 @@ function xr() {
|
|
|
139
139
|
const i = JSON.stringify([n, o, a.fontSizePt, a.fontFamily, a.bold, a.italic, a.letterSpacingPt]), c = e.get(i);
|
|
140
140
|
if (c)
|
|
141
141
|
return e.delete(i), e.set(i, c), c.lines.slice();
|
|
142
|
-
const l =
|
|
143
|
-
if (u <=
|
|
144
|
-
for (; e.size >=
|
|
142
|
+
const l = B(n, o, a, s), u = i.length + l.reduce((f, d) => f + d.length, 0);
|
|
143
|
+
if (u <= We) {
|
|
144
|
+
for (; e.size >= Pr || t + u > We; ) {
|
|
145
145
|
const f = e.keys().next().value;
|
|
146
146
|
t -= e.get(f).units, e.delete(f);
|
|
147
147
|
}
|
|
@@ -150,98 +150,98 @@ function xr() {
|
|
|
150
150
|
return l;
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
const Cr = 1e4,
|
|
154
|
-
function
|
|
153
|
+
const Cr = 1e4, Ve = 25e4;
|
|
154
|
+
function Fe(e) {
|
|
155
155
|
if (e?.aborted) throw e.reason ?? new DOMException("标签生成已取消", "AbortError");
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
const n = typeof e.copies == "object" ?
|
|
159
|
-
if (typeof n != "number" || !Number.isSafeInteger(n) || n < 1 || n > 1e3) throw new
|
|
157
|
+
function ot(e, t, r) {
|
|
158
|
+
const n = typeof e.copies == "object" ? Ye(t, e.copies.field, r) : e.copies ?? 1;
|
|
159
|
+
if (typeof n != "number" || !Number.isSafeInteger(n) || n < 1 || n > 1e3) throw new F(`$.datasets.${r.dataset}[${r.rowIndex}]`, "每条记录复制数必须是 1..1000 的数值型整数", r.rowIndex, typeof e.copies == "object" ? e.copies.field : void 0);
|
|
160
160
|
return n;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function at(e, t, r) {
|
|
163
163
|
if (e.rowKey === void 0) return;
|
|
164
|
-
const n =
|
|
164
|
+
const n = Ye(t, e.rowKey, r);
|
|
165
165
|
if (typeof n == "string" && n.trim() || typeof n == "number" && Number.isFinite(n)) return n;
|
|
166
|
-
throw new
|
|
166
|
+
throw new F(`$.datasets.${r.dataset}[${r.rowIndex}].${e.rowKey}`, "业务主键必须是非空字符串或有限数字", r.rowIndex, e.rowKey);
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function Tr(e) {
|
|
169
169
|
const t = (r) => 1 + (r.grid?.cells.reduce((n, o) => n + 1 + o.length + o.reduce((a, s) => a + (s?.children?.reduce((i, c) => i + t(c), 0) ?? 0), 0), 0) ?? 0);
|
|
170
170
|
return e.pages.reduce((r, n) => r + n.components.reduce((o, a) => o + t(a), 0), 0);
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function Er(e, t, r) {
|
|
173
173
|
const n = e.repeat, o = Object.prototype.hasOwnProperty.call(t, n.dataset) ? t[n.dataset] : void 0;
|
|
174
|
-
if (!Array.isArray(o)) throw new
|
|
175
|
-
const a = /* @__PURE__ */ new Set(), s = r.maxPages ?? Cr, i =
|
|
174
|
+
if (!Array.isArray(o)) throw new F(`$.datasets.${n.dataset}`, "逐记录标签数据集缺失,应提供对象数组(允许空数组)");
|
|
175
|
+
const a = /* @__PURE__ */ new Set(), s = r.maxPages ?? Cr, i = Tr(e);
|
|
176
176
|
let c = 0, l = 0;
|
|
177
177
|
for (const [u, f] of o.entries()) {
|
|
178
|
-
if (
|
|
179
|
-
const d = { rowIndex: u, dataset: n.dataset },
|
|
180
|
-
if (
|
|
181
|
-
const
|
|
182
|
-
if (a.has(
|
|
183
|
-
a.add(
|
|
178
|
+
if (Fe(r.signal), !f || typeof f != "object" || Array.isArray(f)) throw new F(`$.datasets.${n.dataset}[${u}]`, "标签记录应为对象", u);
|
|
179
|
+
const d = { rowIndex: u, dataset: n.dataset }, m = at(n, f, d);
|
|
180
|
+
if (m !== void 0) {
|
|
181
|
+
const b = JSON.stringify([typeof m, m]);
|
|
182
|
+
if (a.has(b)) throw new F(`$.datasets.${n.dataset}[${u}].${n.rowKey}`, "业务主键重复;请先确认记录来源,避免重复打印标签", u, n.rowKey);
|
|
183
|
+
a.add(b);
|
|
184
184
|
}
|
|
185
|
-
const
|
|
186
|
-
if (c +=
|
|
187
|
-
if (l >
|
|
185
|
+
const h = ot(n, f, d);
|
|
186
|
+
if (c += h * e.pages.length, l += h * i, c > s) throw new U(s, c);
|
|
187
|
+
if (l > Ve) throw new F("$.repeat", `标签组件总量(含网格行、槽位及嵌套组件)超过安全预算 ${Ve},请分批生成`, u);
|
|
188
188
|
}
|
|
189
189
|
return o;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function Rr(e, t, r) {
|
|
192
192
|
if (!e.binding) return e;
|
|
193
|
-
const { binding: n, ...o } = e, a =
|
|
193
|
+
const { binding: n, ...o } = e, a = Ut(n, t.row, t);
|
|
194
194
|
if (e.kind === "image") {
|
|
195
195
|
if (!a) return;
|
|
196
|
-
if (!
|
|
196
|
+
if (!Xt(a)) throw new F(`${r}.binding`, "图片字段只接受 PNG/JPEG base64 data URL;业务 URL 应由宿主安全加载后转换", t.rowIndex, n.field);
|
|
197
197
|
return { ...o, imageData: a };
|
|
198
198
|
}
|
|
199
199
|
return e.kind === "barcode" || e.kind === "qrcode" ? (delete o.imageData, { ...o, code: { ...o.code, value: a }, fallbackText: a }) : (delete o.lines, delete o.richParagraphs, { ...o, text: a });
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function Ir(e, t, r) {
|
|
202
202
|
if (e.kind !== "text" || e.grid || e.richParagraphs?.length) return e;
|
|
203
|
-
const n = e.style ?? {}, o =
|
|
203
|
+
const n = e.style ?? {}, o = Z(n).fontSizePt, a = e.text ?? e.lines?.join(`
|
|
204
204
|
`) ?? "";
|
|
205
|
-
if (a.length > 16384) throw new
|
|
206
|
-
const s = t.wrapText(a, e.widthMm, { fontSizePt: o, bold: n.bold, italic: n.italic, fontFamily: n.fontFamily, letterSpacingPt: n.letterSpacing }, t.options.measurer ??
|
|
207
|
-
if (i > e.heightMm + 0.05) throw new
|
|
205
|
+
if (a.length > 16384) throw new F(r, "标签文本超过 16384 字符预算,请缩小字段内容", t.rowIndex);
|
|
206
|
+
const s = t.wrapText(a, e.widthMm, { fontSizePt: o, bold: n.bold, italic: n.italic, fontFamily: n.fontFamily, letterSpacingPt: n.letterSpacing }, t.options.measurer ?? re), i = s.length * o * zt(n) * 25.4 / 72;
|
|
207
|
+
if (i > e.heightMm + 0.05) throw new F(r, `标签文字需要约 ${i.toFixed(2)}mm 高,超出 ${e.heightMm}mm;请增大文本区域、减少内容或调整字号`, t.rowIndex, e.binding?.field);
|
|
208
208
|
return { ...e, lines: s };
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
|
|
212
|
-
const n =
|
|
210
|
+
function st(e, t, r) {
|
|
211
|
+
Fe(t.options.signal);
|
|
212
|
+
const n = Rr(e, t, r);
|
|
213
213
|
if (!n) return;
|
|
214
214
|
let o = n.grid;
|
|
215
215
|
return o && (o = { ...o, cells: o.cells.map((a, s) => a.map((i, c) => i?.children?.length ? { ...i, children: i.children.flatMap((l, u) => {
|
|
216
|
-
const f =
|
|
216
|
+
const f = st(l, t, `${r}.grid.cells.${s}.${c}.children.${u}`);
|
|
217
217
|
return f ? [f] : [];
|
|
218
|
-
}) } : i)) }),
|
|
218
|
+
}) } : i)) }), Ir(o === n.grid ? n : { ...n, grid: o }, t, r);
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function $r(e, t, r, n, o, a) {
|
|
221
221
|
return {
|
|
222
222
|
...e,
|
|
223
223
|
components: e.components.flatMap((s, i) => {
|
|
224
|
-
const c =
|
|
224
|
+
const c = st(s, r, `$.pages.${t}.components.${i}`);
|
|
225
225
|
return c ? [{ ...c, meta: { ...c.meta, labelSource: { pageIndex: t, componentIndex: i } } }] : [];
|
|
226
226
|
}),
|
|
227
227
|
meta: { ...e.meta, record: { dataset: r.dataset, rowIndex: r.rowIndex, ...a === void 0 ? {} : { rowKey: a }, copyIndex: n, copyCount: o, templatePageIndex: t } }
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
|
-
function*
|
|
230
|
+
function* Fr(e, t, r) {
|
|
231
231
|
const n = [];
|
|
232
|
-
if (
|
|
232
|
+
if (ir(e, n), n.length) throw new F(n[0].path, n[0].message);
|
|
233
233
|
if (!e.repeat) {
|
|
234
234
|
for (const [i, c] of e.pages.entries()) yield { page: c, pageIndex: i };
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
|
-
const o = e.repeat, a =
|
|
237
|
+
const o = e.repeat, a = Er(e, t, r), s = kr();
|
|
238
238
|
for (const [i, c] of a.entries()) {
|
|
239
|
-
const l = { row: c, rowIndex: i, dataset: o.dataset, options: r, wrapText: s }, u =
|
|
240
|
-
for (let d = 0; d < u; d++) for (const [
|
|
241
|
-
|
|
239
|
+
const l = { row: c, rowIndex: i, dataset: o.dataset, options: r, wrapText: s }, u = ot(o, c, l), f = at(o, c, l);
|
|
240
|
+
for (let d = 0; d < u; d++) for (const [m, h] of e.pages.entries())
|
|
241
|
+
Fe(r.signal), yield { page: $r(h, m, l, d, u, f), pageIndex: m };
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Or(e) {
|
|
245
245
|
return {
|
|
246
246
|
widthMm: e.widthMm,
|
|
247
247
|
heightMm: e.heightMm,
|
|
@@ -252,119 +252,119 @@ function $r(e) {
|
|
|
252
252
|
components: []
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function oe(e, t) {
|
|
256
256
|
const r = t.heightMm - (e.layout === "wide" ? t.marginBottomMm : e.marginBottomMm ?? t.marginBottomMm);
|
|
257
257
|
return e.components.reduce((n, o) => o.kind !== "list" && o.pageAnchor === "footer" ? Math.min(n, o.topMm) : n, r);
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function X(e) {
|
|
260
260
|
return e.components.reduce((t, r) => r.kind !== "list" && r.pageAnchor === "header" ? Math.max(t, r.topMm + r.heightMm) : t, 0);
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function it(e, t) {
|
|
263
263
|
let r = e.textMetrics.get(t);
|
|
264
264
|
if (!r) {
|
|
265
|
-
const n =
|
|
265
|
+
const n = Z(t).fontSizePt;
|
|
266
266
|
r = {
|
|
267
267
|
measureOptions: {
|
|
268
268
|
fontSizePt: n,
|
|
269
|
-
fontFamily: t.fontFamily ??
|
|
269
|
+
fontFamily: t.fontFamily ?? ke,
|
|
270
270
|
italic: t.italic,
|
|
271
271
|
bold: t.bold,
|
|
272
272
|
letterSpacingPt: t.letterSpacing
|
|
273
273
|
},
|
|
274
|
-
lineMm: n * (t.lineHeight ??
|
|
274
|
+
lineMm: n * (t.lineHeight ?? xe) * 25.4 / 72
|
|
275
275
|
}, e.textMetrics.set(t, r);
|
|
276
276
|
}
|
|
277
277
|
return r;
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function Ar(e) {
|
|
280
280
|
if (e === null || typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e)) return e;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
const o = e.fontSizePt ??
|
|
284
|
-
...
|
|
282
|
+
function Oe(e, t, r = [], n) {
|
|
283
|
+
const o = e.fontSizePt ?? Jt, a = e.paddingMm ?? 1, s = e.columns.map((y) => y.align ?? y.style?.align ?? e.align ?? "left"), i = e.columns.map((y, g) => ({
|
|
284
|
+
...H({
|
|
285
285
|
fontSize: o,
|
|
286
286
|
verticalAlign: "middle"
|
|
287
|
-
},
|
|
288
|
-
align: s[
|
|
289
|
-
})), c = i.map((
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
292
|
-
left:
|
|
293
|
-
center:
|
|
294
|
-
right:
|
|
287
|
+
}, y.style),
|
|
288
|
+
align: s[g] === "auto" ? "left" : s[g]
|
|
289
|
+
})), c = i.map((y, g) => s[g] === "auto" ? { left: y, center: { ...y, align: "center" }, right: { ...y, align: "right" } } : void 0), l = e.columns.map((y, g) => y.rules?.map((S) => {
|
|
290
|
+
const C = c[g];
|
|
291
|
+
if (C) return {
|
|
292
|
+
left: H(C.left, S.style),
|
|
293
|
+
center: H(C.center, S.style),
|
|
294
|
+
right: H(C.right, S.style)
|
|
295
295
|
};
|
|
296
|
-
const T =
|
|
296
|
+
const T = H(i[g], S.style);
|
|
297
297
|
return { left: T, center: T, right: T };
|
|
298
|
-
})), u = e.columns.map((
|
|
298
|
+
})), u = e.columns.map((y) => Xe(e, y)), f = e.columns.map((y) => y.header);
|
|
299
299
|
let d = e.rowHeightMm ?? 0;
|
|
300
|
-
for (let
|
|
301
|
-
const
|
|
302
|
-
f[
|
|
303
|
-
e.columns[
|
|
304
|
-
{ fontSizePt:
|
|
300
|
+
for (let y = 0; y < f.length; y++) {
|
|
301
|
+
const g = u[y], S = Z(g).fontSizePt, C = B(
|
|
302
|
+
f[y],
|
|
303
|
+
e.columns[y].widthMm - a * 2,
|
|
304
|
+
{ fontSizePt: S, fontFamily: g.fontFamily ?? ke, italic: g.italic, bold: g.bold, letterSpacingPt: g.letterSpacing },
|
|
305
305
|
t
|
|
306
|
-
), T =
|
|
307
|
-
d = Math.max(d, Math.max(
|
|
308
|
-
}
|
|
309
|
-
const
|
|
310
|
-
text:
|
|
311
|
-
style: u[
|
|
312
|
-
})),
|
|
313
|
-
cells: [
|
|
314
|
-
colWidthsMm:
|
|
306
|
+
), T = S * (g.lineHeight ?? xe) * 25.4 / 72;
|
|
307
|
+
d = Math.max(d, Math.max(C.length, 1) * T + a * 2);
|
|
308
|
+
}
|
|
309
|
+
const m = f.map((y, g) => ({
|
|
310
|
+
text: y,
|
|
311
|
+
style: u[g]
|
|
312
|
+
})), h = e.border === !1 ? { borderTop: !1, borderRight: !1, borderBottom: !1, borderLeft: !1 } : { borderBottom: !0, borderLeft: !0, borderRight: !0, borderTop: !0 }, b = e.columns.map((y) => y.widthMm), w = Kr(br(e, t), b, {
|
|
313
|
+
cells: [m],
|
|
314
|
+
colWidthsMm: b,
|
|
315
315
|
rowHeightsMm: [d],
|
|
316
316
|
paddingMm: a
|
|
317
317
|
});
|
|
318
318
|
return {
|
|
319
319
|
fontSizePt: o,
|
|
320
320
|
paddingMm: a,
|
|
321
|
-
visuals:
|
|
322
|
-
visibility: e.columns.map((
|
|
323
|
-
ruleReaders: e.columns.map((
|
|
321
|
+
visuals: or(e.columns, r, n),
|
|
322
|
+
visibility: e.columns.map((y) => y.visibleWhen ? G(y.visibleWhen) : void 0),
|
|
323
|
+
ruleReaders: e.columns.map((y) => y.rules?.map((g) => G(g.when))),
|
|
324
324
|
cellStyles: i,
|
|
325
325
|
autoStyles: c,
|
|
326
326
|
ruleStyles: l,
|
|
327
327
|
textMetrics: /* @__PURE__ */ new WeakMap(),
|
|
328
|
-
numberFormats: e.columns.map((
|
|
329
|
-
derivedFields: new Set(e.computed?.map((
|
|
330
|
-
borderStyle:
|
|
331
|
-
headerHeightMm:
|
|
332
|
-
headerGrid:
|
|
333
|
-
colWidthsMm:
|
|
328
|
+
numberFormats: e.columns.map((y) => Qe(y.format)),
|
|
329
|
+
derivedFields: new Set(e.computed?.map((y) => y.field)),
|
|
330
|
+
borderStyle: h,
|
|
331
|
+
headerHeightMm: w.rowHeightsMm.reduce((y, g) => y + g, 0),
|
|
332
|
+
headerGrid: w,
|
|
333
|
+
colWidthsMm: b,
|
|
334
334
|
columns: e.columns
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function Kr(e, t, r) {
|
|
338
338
|
if (!e) return r;
|
|
339
339
|
if (!e.cells.length) throw new Error("自定义列表表头至少需要一行");
|
|
340
340
|
const n = e.rowHeightsMm ?? e.cells.map(() => r.rowHeightsMm[0]);
|
|
341
341
|
if (n.length !== e.cells.length || n.some((o) => !Number.isFinite(o) || o <= 0)) throw new Error("自定义列表表头行高无效");
|
|
342
342
|
return { ...e, colWidthsMm: t, rowHeightsMm: n };
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function Nr(e, t, r) {
|
|
345
345
|
const n = t.format?.kind === "number" || t.format?.kind === "percent";
|
|
346
346
|
t.valueType !== void 0 ? e.valueType = t.valueType : n && (e.valueType = "number"), t.editable !== void 0 && (e.editable = t.editable), (typeof e.value == "number" || e.value == null) && r !== void 0 && (e.numberFormat = r);
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function Y(e, t, r) {
|
|
349
349
|
const n = e.columns, o = e.tree?.rows.get(t);
|
|
350
350
|
let a = e.rowHeightFloorMm;
|
|
351
351
|
const s = new Array(n.length);
|
|
352
352
|
for (let i = 0; i < n.length; i++) {
|
|
353
|
-
const c = n[i], l = e.visibility[i]?.(t) !== !1, u = l ? t[c.field] : null, f = e.autoStyles[i] ?
|
|
353
|
+
const c = n[i], l = e.visibility[i]?.(t) !== !1, u = l ? t[c.field] : null, f = e.autoStyles[i] ? Ze(u, c.format, c.semanticRole) : "left";
|
|
354
354
|
let d = e.autoStyles[i]?.[f] ?? e.cellStyles[i];
|
|
355
355
|
if (c.rules) {
|
|
356
|
-
for (let
|
|
357
|
-
if (e.ruleReaders[i][
|
|
358
|
-
d = e.ruleStyles[i][
|
|
356
|
+
for (let S = 0; S < c.rules.length; S++)
|
|
357
|
+
if (e.ruleReaders[i][S](t)) {
|
|
358
|
+
d = e.ruleStyles[i][S][f];
|
|
359
359
|
break;
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
const
|
|
363
|
-
d =
|
|
364
|
-
const
|
|
365
|
-
a = Math.max(a,
|
|
366
|
-
const
|
|
367
|
-
u != null && e.visuals[i]?.apply(
|
|
362
|
+
const m = c.format ? et(u, c.format) : Re(u), h = jr(e, c, o);
|
|
363
|
+
d = Lr(e, c, d, o);
|
|
364
|
+
const b = it(e, d), w = B(m, Math.max(1, c.widthMm - e.paddingMm * 2 - h), b.measureOptions, r);
|
|
365
|
+
a = Math.max(a, w.length * b.lineMm + e.paddingMm * 2);
|
|
366
|
+
const y = Ar(u), g = { text: m, style: d };
|
|
367
|
+
u != null && e.visuals[i]?.apply(g, t), y !== void 0 && (g.value = y), Nr(g, c, e.numberFormats[i]), Hr(g, c, e, o, h), e.derivedFields.has(c.field) && (g.derived = !0, g.editable = !1), l || (g.editable = !1), s[i] = g;
|
|
368
368
|
}
|
|
369
369
|
return {
|
|
370
370
|
grid: { cells: [s], colWidthsMm: e.colWidthsMm, rowHeightsMm: [a], paddingMm: e.paddingMm },
|
|
@@ -372,20 +372,20 @@ function z(e, t, r) {
|
|
|
372
372
|
...e.matrix ? { meta: { matrix: { row: e.matrix.rows.get(t) } } } : {}
|
|
373
373
|
};
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
return !r || t.field !== e.tree.list.tree.labelField ? 0 :
|
|
375
|
+
function jr(e, t, r) {
|
|
376
|
+
return !r || t.field !== e.tree.list.tree.labelField ? 0 : Qt(e.tree.list, t, r, e.paddingMm);
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function Lr(e, t, r, n) {
|
|
379
379
|
return !n || t.field !== e.tree.list.tree.labelField || r.align === "left" ? r : { ...r, align: "left" };
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
n && (o && (e.indentMm = o),
|
|
381
|
+
function Hr(e, t, r, n, o = 0) {
|
|
382
|
+
n && (o && (e.indentMm = o), Zt(e, t, n, r.tree.list));
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function ct(e) {
|
|
385
385
|
if (e != null && typeof e != "string" && typeof e != "boolean" && !(typeof e == "number" && Number.isFinite(e))) throw new Error("分组字段应为有限 JSON 标量");
|
|
386
386
|
return JSON.stringify([typeof e, e ?? null]);
|
|
387
387
|
}
|
|
388
|
-
function*
|
|
388
|
+
function* lt(e, t, r = 0) {
|
|
389
389
|
const n = t[r];
|
|
390
390
|
if (!n) {
|
|
391
391
|
for (const a of e) yield { kind: "row", row: a };
|
|
@@ -393,54 +393,54 @@ function* at(e, t, r = 0) {
|
|
|
393
393
|
}
|
|
394
394
|
const o = /* @__PURE__ */ new Map();
|
|
395
395
|
for (const a of e) {
|
|
396
|
-
const s =
|
|
396
|
+
const s = ct(a[n.field]), i = o.get(s);
|
|
397
397
|
i ? i.push(a) : o.set(s, [a]);
|
|
398
398
|
}
|
|
399
399
|
for (const a of o.values())
|
|
400
|
-
yield { kind: "groupHeader", label: (n.headerTemplate ?? "{value}").replace(/\{value\}/g,
|
|
400
|
+
yield { kind: "groupHeader", label: (n.headerTemplate ?? "{value}").replace(/\{value\}/g, Re(a[0][n.field])), firstRow: a[0], group: n, depth: r, rows: a }, yield* lt(a, t, r + 1), (n.subtotal?.length || n.aggregates?.length) && (yield { kind: "subtotal", label: n.subtotalLabel ?? "小计", rows: a, group: n, depth: r }), yield { kind: "groupEnd", depth: r };
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function dt(e, t, r, n = []) {
|
|
403
403
|
const o = [...r.filter((a) => !n.some((s) => s.field === a)).map((a) => ({ field: a, op: "sum" })), ...n];
|
|
404
404
|
return new Map(o.map((a) => {
|
|
405
|
-
const s = e.find((c) => c.field === a.field)?.format ?? { kind: "number", thousands: !0 }, i =
|
|
406
|
-
return [a.field, { text:
|
|
405
|
+
const s = e.find((c) => c.field === a.field)?.format ?? { kind: "number", thousands: !0 }, i = Te(t, { ...a, field: a.valueField ?? a.field });
|
|
406
|
+
return [a.field, { text: et(i, s), ...i === null ? {} : { value: i }, ...typeof i == "number" ? { numberFormat: Qe(s) } : {} }];
|
|
407
407
|
}));
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function ut(e, t) {
|
|
410
410
|
const r = e.findIndex((n) => t.includes(n.field));
|
|
411
411
|
return r < 0 ? 1 : r;
|
|
412
412
|
}
|
|
413
|
-
function
|
|
414
|
-
const s = [], i = Math.max(0, Math.min(a, e.columns.length)), c =
|
|
413
|
+
function _(e, t, r, n, o, a) {
|
|
414
|
+
const s = [], i = Math.max(0, Math.min(a, e.columns.length)), c = H({ fontSize: e.fontSizePt }, o);
|
|
415
415
|
i && s.push({ text: r, colSpan: i, style: { bold: !0, ...c } });
|
|
416
416
|
for (let d = i; d < e.columns.length; d++) {
|
|
417
|
-
const
|
|
418
|
-
s.push({ ...
|
|
417
|
+
const m = e.columns[d], h = n.get(m.field), b = e.autoStyles[d]?.[Ze(h?.value, m.format)] ?? e.cellStyles[d];
|
|
418
|
+
s.push({ ...h, text: h?.text ?? "", style: H(b, o) });
|
|
419
419
|
}
|
|
420
|
-
const l = { text: r, colSpan: e.columns.length, style: { bold: !0, ...c } }, u = i ? [s] : [[l], s], f = u.map((d) =>
|
|
420
|
+
const l = { text: r, colSpan: e.columns.length, style: { bold: !0, ...c } }, u = i ? [s] : [[l], s], f = u.map((d) => Dr(e, d, t));
|
|
421
421
|
return {
|
|
422
422
|
grid: { cells: u, colWidthsMm: e.colWidthsMm, rowHeightsMm: f, paddingMm: e.paddingMm },
|
|
423
|
-
heightMm: f.reduce((d,
|
|
423
|
+
heightMm: f.reduce((d, m) => d + m, 0)
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function Dr(e, t, r) {
|
|
427
427
|
let n = e.rowHeightFloorMm, o = 0;
|
|
428
428
|
for (const a of t) {
|
|
429
429
|
let s = 0;
|
|
430
430
|
const i = o + (a.colSpan ?? 1);
|
|
431
431
|
for (; o < i; o++) s += e.colWidthsMm[o] ?? 0;
|
|
432
|
-
const c =
|
|
432
|
+
const c = it(e, a.style), l = B(a.text ?? "", s - e.paddingMm * 2, c.measureOptions, r);
|
|
433
433
|
n = Math.max(n, l.length * c.lineMm + e.paddingMm * 2);
|
|
434
434
|
}
|
|
435
435
|
return n;
|
|
436
436
|
}
|
|
437
|
-
function
|
|
438
|
-
const { templatePage: n, current: o, warnings: a, nextId: s, pushCurrent: i } = r, c = () =>
|
|
437
|
+
function Br(e, t, r) {
|
|
438
|
+
const { templatePage: n, current: o, warnings: a, nextId: s, pushCurrent: i } = r, c = () => oe(n, o), l = Math.max(o.marginTopMm, X(n)), u = n.layout === "wide" ? X(n) : l, f = {
|
|
439
439
|
id: r.tableId,
|
|
440
|
-
columnKeys: e.columns.map((
|
|
440
|
+
columnKeys: e.columns.map((p) => p.field),
|
|
441
441
|
...e.layout === void 0 ? {} : { layout: e.layout },
|
|
442
442
|
...e.title === void 0 ? {} : { title: e.title }
|
|
443
|
-
}, d = /* @__PURE__ */ new Map(),
|
|
443
|
+
}, d = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), h = {
|
|
444
444
|
kind: "rect",
|
|
445
445
|
leftMm: e.leftMm,
|
|
446
446
|
topMm: 0,
|
|
@@ -451,53 +451,53 @@ function Hr(e, t, r) {
|
|
|
451
451
|
table: { ...f, role: "header", rowIndex: -1 },
|
|
452
452
|
style: t.borderStyle,
|
|
453
453
|
...e.meta || t.matrix ? { meta: { ...e.meta, ...t.matrix ? { matrix: t.matrix.header } : {} } } : {}
|
|
454
|
-
},
|
|
454
|
+
}, b = (p) => o.components.push({ ...h, topMm: p });
|
|
455
455
|
if (r.flow && e.header !== !1 && t.headerHeightMm > c() - l + 1e-3) throw new Error(`流式列表 ${e.id ?? e.dataset} 的表头高度超出单页可用范围`);
|
|
456
|
-
let
|
|
457
|
-
e.header !== !1 && (
|
|
458
|
-
function w() {
|
|
459
|
-
const g = Math.max(r.flow || n.layout === "wide" ? 0 : e.topMm, u);
|
|
460
|
-
return (e.header !== !1 && e.headerEveryPage !== !1 ? g + t.headerHeightMm : u) + [...h.values()].reduce((S, E) => S + E.heightMm, 0);
|
|
461
|
-
}
|
|
456
|
+
let w = Math.max(r.startTop ?? e.topMm, l);
|
|
457
|
+
e.header !== !1 && (b(w), w += t.headerHeightMm + r.mmPerRow);
|
|
462
458
|
function y() {
|
|
463
|
-
const
|
|
464
|
-
return
|
|
459
|
+
const p = Math.max(r.flow || n.layout === "wide" ? 0 : e.topMm, u);
|
|
460
|
+
return (e.header !== !1 && e.headerEveryPage !== !1 ? p + t.headerHeightMm : u) + [...m.values()].reduce((x, R) => x + R.heightMm, 0);
|
|
461
|
+
}
|
|
462
|
+
function g() {
|
|
463
|
+
const p = n.layout === "wide" ? 0 : o.marginBottomMm;
|
|
464
|
+
return Math.min(n.heightMm - p, oe(n, o)) - y();
|
|
465
465
|
}
|
|
466
|
-
function
|
|
467
|
-
if (
|
|
466
|
+
function S(p) {
|
|
467
|
+
if (w + p <= c()) return;
|
|
468
468
|
i(), o.components = [], o.heightMm = n.heightMm, n.layout === "wide" && (o.marginTopMm = 0, o.marginBottomMm = 0);
|
|
469
|
-
const
|
|
470
|
-
e.header !== !1 && e.headerEveryPage !== !1 ? (
|
|
471
|
-
for (const
|
|
472
|
-
}
|
|
473
|
-
function
|
|
474
|
-
const
|
|
475
|
-
if (r.flow &&
|
|
476
|
-
|
|
477
|
-
}
|
|
478
|
-
function T(
|
|
479
|
-
const
|
|
480
|
-
|
|
469
|
+
const P = Math.max(r.flow || n.layout === "wide" ? 0 : e.topMm, u);
|
|
470
|
+
e.header !== !1 && e.headerEveryPage !== !1 ? (b(P), w = P + t.headerHeightMm) : w = u;
|
|
471
|
+
for (const x of m.values()) T(x, "listgr", "group-header");
|
|
472
|
+
}
|
|
473
|
+
function C(p, P, x, R) {
|
|
474
|
+
const v = g();
|
|
475
|
+
if (r.flow && p.heightMm > v + 1e-3) throw new Error(`流式列表 ${e.id ?? e.dataset} 的单行高度超出单页可用范围`);
|
|
476
|
+
p.heightMm > v && a.push(`列表 ${e.id ?? e.dataset} 行高 ${p.heightMm.toFixed(2)}mm 超出单页可用高度 ${v.toFixed(2)}mm,预览与打印可能截断内容`), S(p.heightMm), T(p, P, x, R);
|
|
477
|
+
}
|
|
478
|
+
function T(p, P, x, R) {
|
|
479
|
+
const v = p.table?.id ?? f.id, E = x === "header" ? -1 : d.get(v) ?? 0;
|
|
480
|
+
x !== "header" && d.set(v, E + p.grid.cells.length), o.components.push({
|
|
481
481
|
kind: "rect",
|
|
482
482
|
leftMm: e.leftMm,
|
|
483
|
-
topMm:
|
|
483
|
+
topMm: w,
|
|
484
484
|
widthMm: e.widthMm,
|
|
485
|
-
heightMm:
|
|
486
|
-
grid:
|
|
487
|
-
nid: s(
|
|
488
|
-
table: { ...f, ...
|
|
485
|
+
heightMm: p.heightMm,
|
|
486
|
+
grid: p.grid,
|
|
487
|
+
nid: s(P),
|
|
488
|
+
table: { ...f, ...p.table, role: x, rowIndex: E, ...R ? { source: R } : {} },
|
|
489
489
|
style: t.borderStyle,
|
|
490
|
-
...e.meta ||
|
|
491
|
-
}),
|
|
490
|
+
...e.meta || p.meta ? { meta: { ...e.meta, ...p.meta } } : {}
|
|
491
|
+
}), w += p.heightMm;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
494
|
-
|
|
493
|
+
function $(p) {
|
|
494
|
+
p <= g() && S(p);
|
|
495
495
|
}
|
|
496
|
-
return { keepTogether:
|
|
497
|
-
|
|
498
|
-
}, bottom: () =>
|
|
496
|
+
return { keepTogether: $, placeGridRow: C, setGroupHeader: (p, P) => {
|
|
497
|
+
P ? m.set(p, P) : m.delete(p);
|
|
498
|
+
}, bottom: () => w };
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function Gr(e, t) {
|
|
501
501
|
if (!e.rowKey) return;
|
|
502
502
|
const r = t[e.rowKey];
|
|
503
503
|
if ((typeof r != "string" || !r.trim()) && !(typeof r == "number" && Number.isFinite(r)))
|
|
@@ -507,56 +507,56 @@ function Dr(e, t) {
|
|
|
507
507
|
if (o !== void 0 && typeof o != "string") throw new Error("来源令牌应为字符串");
|
|
508
508
|
return { datasetId: e.dataset, rowKey: r, ...n === void 0 ? {} : { revision: n }, ...o === void 0 ? {} : { sourceToken: o } };
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function ce(e, t) {
|
|
511
511
|
const r = /* @__PURE__ */ new Map();
|
|
512
512
|
if (!e.rowKey) return r;
|
|
513
513
|
const n = /* @__PURE__ */ new Set();
|
|
514
514
|
for (const o of t) {
|
|
515
|
-
const a =
|
|
515
|
+
const a = Gr(e, o), s = JSON.stringify(a.rowKey);
|
|
516
516
|
if (n.has(s)) throw new Error(`数据集 ${e.dataset} 的业务主键重复:${String(a.rowKey)}`);
|
|
517
517
|
n.add(s), r.set(o, a);
|
|
518
518
|
}
|
|
519
519
|
return r;
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function Wr(e, t, r, n, o) {
|
|
522
522
|
if (!e.grandTotal) return;
|
|
523
|
-
const a = typeof e.grandTotal == "object" ? e.grandTotal : void 0, s =
|
|
523
|
+
const a = typeof e.grandTotal == "object" ? e.grandTotal : void 0, s = le(e)[0], i = a?.fields ?? s?.subtotal ?? [], c = a?.aggregates ?? s?.aggregates ?? [];
|
|
524
524
|
if (i.length === 0 && c.length === 0) {
|
|
525
525
|
n.warnings.push(`列表 ${e.id ?? ""} 配置了 grandTotal 但未提供合计字段(groupBy.subtotal 或 grandTotal.fields)`);
|
|
526
526
|
return;
|
|
527
527
|
}
|
|
528
|
-
const l =
|
|
528
|
+
const l = _(r, n.measurer, a?.label ?? "合计", dt(e.columns, t, i, c), a?.style ?? {}, ut(e.columns, [...i, ...c.map((u) => u.field)]));
|
|
529
529
|
o.placeGridRow(l, "listgt", "grand-total");
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function j(e) {
|
|
532
532
|
if (e?.aborted) {
|
|
533
533
|
const t = new Error("报表排版已取消");
|
|
534
534
|
throw t.name = "AbortError", t;
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function le(e) {
|
|
538
538
|
const t = e.groups ?? (e.groupBy ? [e.groupBy] : []);
|
|
539
539
|
if (t.length > 16) throw new Error("列表最多支持 16 级分组");
|
|
540
540
|
return t;
|
|
541
541
|
}
|
|
542
|
-
function
|
|
543
|
-
const t =
|
|
542
|
+
function Ae(e) {
|
|
543
|
+
const t = Mr(e), r = t.columns.reduce((o, a) => o + a.widthMm, 0), n = r > t.widthMm ? t.widthMm / r : 1;
|
|
544
544
|
return n === 1 ? t : { ...t, columns: t.columns.map((o) => ({ ...o, widthMm: o.widthMm * n })) };
|
|
545
545
|
}
|
|
546
|
-
function
|
|
546
|
+
function Vr(e, t, r) {
|
|
547
547
|
const n = e.detail;
|
|
548
548
|
if (!n) return;
|
|
549
549
|
const o = /* @__PURE__ */ new Set();
|
|
550
550
|
for (const l of t) {
|
|
551
|
-
const u =
|
|
551
|
+
const u = we(l[n.parentKey]);
|
|
552
552
|
if (o.has(u)) throw new Error("主从明细的主表关联键重复");
|
|
553
553
|
o.add(u);
|
|
554
554
|
}
|
|
555
555
|
const a = r.datasets[n.dataset] ?? [], s = /* @__PURE__ */ new Map(), i = [];
|
|
556
556
|
for (const l of a) {
|
|
557
557
|
const u = l[n.foreignKey];
|
|
558
|
-
if (!
|
|
559
|
-
const f =
|
|
558
|
+
if (!ft(u) && n.unmatched === "ignore") continue;
|
|
559
|
+
const f = we(u);
|
|
560
560
|
if (!o.has(f)) {
|
|
561
561
|
if (n.unmatched !== "ignore") throw new Error(`明细数据集 ${n.dataset} 存在未关联的业务键`);
|
|
562
562
|
continue;
|
|
@@ -564,111 +564,111 @@ function Gr(e, t, r) {
|
|
|
564
564
|
const d = s.get(f);
|
|
565
565
|
d ? d.push(l) : s.set(f, [l]), i.push(l);
|
|
566
566
|
}
|
|
567
|
-
const c =
|
|
568
|
-
return { list: c, inter: { ...
|
|
567
|
+
const c = Ae({ ...e, id: `${e.id ?? e.dataset}:detail`, dataset: n.dataset, rowKey: n.rowKey, revisionField: n.revisionField, sourceTokenField: n.sourceTokenField, computed: void 0, columns: n.columns, headerGrid: void 0, rowHeightMm: n.rowHeightMm ?? e.rowHeightMm, detail: void 0 });
|
|
568
|
+
return { list: c, inter: { ...Oe(c, r.measurer, i, r.signal), rowHeightFloorMm: c.rowHeightMm ?? 0 }, rows: s, sources: ce(c, i) };
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function ft(e) {
|
|
571
571
|
return typeof e == "string" && !!e.trim() || typeof e == "number" && Number.isFinite(e);
|
|
572
572
|
}
|
|
573
|
-
function
|
|
574
|
-
if (!
|
|
575
|
-
return
|
|
573
|
+
function we(e) {
|
|
574
|
+
if (!ft(e)) throw new Error("主从关联键必须是非空字符串或有限数字");
|
|
575
|
+
return ct(e);
|
|
576
576
|
}
|
|
577
|
-
function*
|
|
577
|
+
function* zr(e, t, r, n, o) {
|
|
578
578
|
if (!r) return;
|
|
579
|
-
const a = r.rows.get(
|
|
579
|
+
const a = r.rows.get(we(t[e.detail.parentKey])) ?? [];
|
|
580
580
|
if (!a.length) return;
|
|
581
581
|
const s = { id: `${n.tableId}:detail`, columnKeys: r.list.columns.map((i) => i.field), title: e.detail.label };
|
|
582
|
-
e.detail.label && o.placeGridRow({ ...
|
|
582
|
+
e.detail.label && o.placeGridRow({ ..._(r.inter, n.measurer, e.detail.label, /* @__PURE__ */ new Map(), {}, r.list.columns.length), table: s }, "listdl", "group-header"), e.detail.header !== !1 && o.placeGridRow({ grid: r.inter.headerGrid, heightMm: r.inter.headerHeightMm, table: s }, "listdh", "header"), yield* n.takePages();
|
|
583
583
|
for (const i of a)
|
|
584
|
-
|
|
584
|
+
j(n.signal), o.placeGridRow({ ...Y(r.inter, i, n.measurer), table: s }, "listdr", "body", r.sources.get(i)), yield* n.takePages();
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function mt(e) {
|
|
587
587
|
if (e.matrix || e.detail || e.groups?.length || e.groupBy || e.rowVisibleWhen) throw new Error("树形布局不能同时配置普通分组、矩阵、主从或行可见条件");
|
|
588
588
|
if (e.rowKey && e.rowKey !== e.tree.idField) throw new Error("树形布局的 rowKey 应与 idField 一致");
|
|
589
589
|
if (!e.columns.some((t) => t.field === e.tree.labelField && !t.hidden)) throw new Error("树形布局需要可见的标签列");
|
|
590
|
-
|
|
590
|
+
nr(e.tree, e.computed);
|
|
591
591
|
}
|
|
592
|
-
function
|
|
593
|
-
|
|
594
|
-
const n =
|
|
592
|
+
function Jr(e, t, r) {
|
|
593
|
+
mt(e);
|
|
594
|
+
const n = rt(t, e.tree, { signal: r.signal, computed: e.computed?.length ? { fields: e.computed, formula: r.formula } : void 0 }), o = { ...e, rowKey: e.tree.idField }, a = ce(o, n.entries.map((c) => c.original)), s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new WeakMap();
|
|
595
595
|
for (const c of n.entries)
|
|
596
596
|
s.set(c.row, a.get(c.original)), i.set(c.row, c);
|
|
597
597
|
return { list: o, rows: n.rows, sources: s, treeRows: i, totalRows: n.leaves };
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function _r(e, t) {
|
|
600
600
|
if (e.cardinality === "record") {
|
|
601
601
|
if (t.length > 1) throw new Error(`单记录区域 ${e.id ?? e.dataset} 仅允许 0 或 1 行数据`);
|
|
602
602
|
if (e.tree || e.matrix || e.detail || e.groups?.length || e.groupBy || e.grandTotal || e.rowVisibleWhen) throw new Error("单记录区域不能配置树、矩阵、主从、分组、总计或行过滤");
|
|
603
603
|
if (!t.length) return { list: { ...e, columns: e.columns.map((r) => ({ ...r, editable: !1 })) }, rows: [{}], sources: /* @__PURE__ */ new Map() };
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function ht(e, t, r) {
|
|
607
607
|
const n = r.prepared.get(e);
|
|
608
608
|
if (n) return n;
|
|
609
|
-
const o =
|
|
609
|
+
const o = _r(e, t);
|
|
610
610
|
if (o)
|
|
611
611
|
return r.prepared.set(e, o), o;
|
|
612
612
|
if (e.tree) {
|
|
613
|
-
const c =
|
|
613
|
+
const c = Jr(e, t, r);
|
|
614
614
|
return r.prepared.set(e, c), c;
|
|
615
615
|
}
|
|
616
|
-
let a = e.computed?.length ?
|
|
616
|
+
let a = e.computed?.length ? Ce(t, { fields: e.computed, signal: r.signal, formula: r.formula }).rows : t;
|
|
617
617
|
const s = a === t ? void 0 : new Map(a.map((c, l) => [c, t[l]]));
|
|
618
|
-
e.rowVisibleWhen && (a = a.filter(
|
|
619
|
-
const i =
|
|
618
|
+
e.rowVisibleWhen && (a = a.filter(G(e.rowVisibleWhen)));
|
|
619
|
+
const i = yr(e, a);
|
|
620
620
|
if (!e.matrix) {
|
|
621
|
-
const c =
|
|
621
|
+
const c = ce(e, s ? a.map((l) => s.get(l)) : a);
|
|
622
622
|
i.sources = s ? new Map(a.map((l) => [l, c.get(s.get(l))])) : c;
|
|
623
623
|
}
|
|
624
624
|
return r.prepared.set(e, i), i;
|
|
625
625
|
}
|
|
626
|
-
function
|
|
626
|
+
function qr(e, t, r, n) {
|
|
627
627
|
if (!n.flow) return;
|
|
628
|
-
const { current: o, templatePage: a } = n, s = Math.max(o.marginTopMm,
|
|
629
|
-
i + c <=
|
|
628
|
+
const { current: o, templatePage: a } = n, s = Math.max(o.marginTopMm, X(a)), i = Math.max(n.startTop ?? e.topMm, s), c = (e.header === !1 ? 0 : t.headerHeightMm) + (r[0] ? Y(t, r[0], n.measurer).heightMm : 0);
|
|
629
|
+
i + c <= oe(a, o) + 1e-3 || i <= s + 1e-3 || (n.pushCurrent(), o.components = [], o.heightMm = a.heightMm, a.layout === "wide" && (o.marginTopMm = 0, o.marginBottomMm = 0), n.startTop = Math.max(o.marginTopMm, X(a)));
|
|
630
630
|
}
|
|
631
|
-
function*
|
|
632
|
-
const n =
|
|
631
|
+
function* Ur(e, t, r) {
|
|
632
|
+
const n = ht(e, t, r), o = n.rows;
|
|
633
633
|
e = n.list, e.layout === "wide" && (r.current.widthMm = Math.max(r.current.widthMm, e.leftMm + e.widthMm + r.current.marginRightMm));
|
|
634
|
-
const a = n.sources ??
|
|
635
|
-
|
|
636
|
-
const l =
|
|
634
|
+
const a = n.sources ?? ce(e, o), s = Ae(e), i = le(s), c = { ...Oe(s, r.measurer, o, r.signal), rowHeightFloorMm: s.rowHeightMm ?? 0, matrix: n.matrix, ...n.treeRows ? { tree: { list: s, rows: n.treeRows } } : {} };
|
|
635
|
+
qr(s, c, o, r);
|
|
636
|
+
const l = Br(s, c, r), u = Vr(s, o, r);
|
|
637
637
|
let f;
|
|
638
|
-
for (const d of
|
|
639
|
-
if (
|
|
640
|
-
l.placeGridRow(f ??
|
|
638
|
+
for (const d of lt(o, i)) {
|
|
639
|
+
if (j(r.signal), d.kind === "row")
|
|
640
|
+
l.placeGridRow(f ?? Y(c, d.row, r.measurer), "listr", pr(n.matrix, d.row), a.get(d.row)), f = void 0, yield* r.takePages(), yield* zr(s, d.row, u, r, l);
|
|
641
641
|
else if (d.kind === "groupHeader") {
|
|
642
|
-
const
|
|
643
|
-
f ??=
|
|
644
|
-
const
|
|
645
|
-
d.group.keepWithNext !== !1 && l.keepTogether(
|
|
642
|
+
const m = _(c, r.measurer, d.label, /* @__PURE__ */ new Map(), d.group.headerStyle ?? {}, s.columns.length);
|
|
643
|
+
f ??= Y(c, d.firstRow, r.measurer);
|
|
644
|
+
const h = i.slice(d.depth + 1).reduce((b, w) => b + _(c, r.measurer, (w.headerTemplate ?? "{value}").replace(/\{value\}/g, Re(d.firstRow[w.field])), /* @__PURE__ */ new Map(), w.headerStyle ?? {}, s.columns.length).heightMm, 0);
|
|
645
|
+
d.group.keepWithNext !== !1 && l.keepTogether(m.heightMm + h + f.heightMm), l.placeGridRow(m, "listg", "group-header"), d.group.repeatHeader && l.setGroupHeader(d.depth, m);
|
|
646
646
|
} else if (d.kind === "subtotal") {
|
|
647
|
-
const
|
|
648
|
-
l.placeGridRow(
|
|
647
|
+
const m = d.group.subtotal ?? [], h = d.group.aggregates ?? [], b = _(c, r.measurer, d.label, dt(s.columns, d.rows, m, h), d.group.subtotalStyle ?? {}, ut(s.columns, [...m, ...h.map((w) => w.field)]));
|
|
648
|
+
l.placeGridRow(b, "listst", "subtotal");
|
|
649
649
|
} else l.setGroupHeader(d.depth);
|
|
650
650
|
yield* r.takePages();
|
|
651
651
|
}
|
|
652
|
-
|
|
652
|
+
Wr(s, n.totalRows ?? o, c, r, l), r.finished?.(l.bottom()), yield* r.takePages();
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function de(e) {
|
|
655
655
|
return e.kind !== "list" && (e.pageAnchor !== void 0 || e.kind === "text" && typeof e.text == "string" && (e.text.includes("{page}") || e.text.includes("{totalPages}")));
|
|
656
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function ue(e, t) {
|
|
658
658
|
return {
|
|
659
659
|
...e,
|
|
660
660
|
...e.text === void 0 ? {} : { text: t(e.text) },
|
|
661
661
|
...e.lines ? { lines: e.lines.map(t) } : {},
|
|
662
662
|
...e.richParagraphs ? { richParagraphs: e.richParagraphs.map((r) => ({ ...r, segments: r.segments.map((n) => ({ ...n, ...n.text === void 0 ? {} : { text: t(n.text) } })) })) } : {},
|
|
663
|
-
...e.grid ? { grid: { ...e.grid, cells: e.grid.cells.map((r) => r.map((n) => n ? { ...n, ...n.text === void 0 ? {} : { text: t(n.text) }, ...n.children ? { children: n.children.map((o) =>
|
|
663
|
+
...e.grid ? { grid: { ...e.grid, cells: e.grid.cells.map((r) => r.map((n) => n ? { ...n, ...n.text === void 0 ? {} : { text: t(n.text) }, ...n.children ? { children: n.children.map((o) => ue(o, t)) } : {} } : null)) } } : {}
|
|
664
664
|
};
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function Xr(e) {
|
|
667
667
|
let t = !1;
|
|
668
|
-
for (const r of e.pages) for (const n of r.components)
|
|
668
|
+
for (const r of e.pages) for (const n of r.components) de(n) && ue(n, (o) => (o.includes("{totalPages}") && (t = !0), o));
|
|
669
669
|
return t;
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function Yr(e, t, r, n, o, a) {
|
|
672
672
|
const s = {
|
|
673
673
|
pageWidthMm: t.widthMm,
|
|
674
674
|
pageHeightMm: t.heightMm,
|
|
@@ -683,38 +683,38 @@ function Ur(e, t, r, n, o, a) {
|
|
|
683
683
|
const l = c.replace(/\{page\}/g, String(n));
|
|
684
684
|
return a === void 0 ? l : l.replace(/\{totalPages\}/g, String(a));
|
|
685
685
|
};
|
|
686
|
-
for (const c of r) s.components.push(
|
|
686
|
+
for (const c of r) s.components.push(ue(c, i));
|
|
687
687
|
if (e.layout === "wide") {
|
|
688
688
|
const c = s.components.reduce((l, u) => Math.max(l, u.topMm + u.heightMm), 0);
|
|
689
689
|
s.marginBottomMm = o ? e.marginBottomMm ?? 0 : 0, s.pageHeightMm = Math.max(1, c + s.marginBottomMm);
|
|
690
690
|
}
|
|
691
691
|
return s;
|
|
692
692
|
}
|
|
693
|
-
function
|
|
694
|
-
return e.cells.reduce((t, r) => t + r.reduce((n, o) => n + (o ? 1 + (o.children?.reduce((a, s) => a +
|
|
693
|
+
function Ke(e) {
|
|
694
|
+
return e.cells.reduce((t, r) => t + r.reduce((n, o) => n + (o ? 1 + (o.children?.reduce((a, s) => a + gt(s), 0) ?? 0) : 0), 0), 0);
|
|
695
695
|
}
|
|
696
|
-
function
|
|
697
|
-
return e.grid ?
|
|
696
|
+
function gt(e) {
|
|
697
|
+
return e.grid ? Ke(e.grid) : 0;
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function fe(e) {
|
|
700
700
|
for (const t of ["maxPages", "maxCells", "knownTotalPages"]) if (e[t] !== void 0 && (!Number.isSafeInteger(e[t]) || e[t] < 1)) throw new RangeError(`${t} 应为正安全整数`);
|
|
701
|
-
|
|
701
|
+
Ee(e.maxChartComponents);
|
|
702
702
|
}
|
|
703
|
-
function
|
|
704
|
-
const r =
|
|
705
|
-
return (n.header === !1 ? 0 : o.headerHeightMm) + r.rows.reduce((a, s) => a +
|
|
703
|
+
function Qr(e, t) {
|
|
704
|
+
const r = ht(e, t.datasets[e.dataset] ?? [], t), n = Ae(r.list), o = { ...Oe(n, t.measurer, r.rows, t.signal), rowHeightFloorMm: n.rowHeightMm ?? 0 };
|
|
705
|
+
return (n.header === !1 ? 0 : o.headerHeightMm) + r.rows.reduce((a, s) => a + Y(o, s, t.measurer).heightMm, 0);
|
|
706
706
|
}
|
|
707
|
-
function*
|
|
707
|
+
function* Zr(e) {
|
|
708
708
|
const { templatePage: t, current: r } = e, n = new Map(t.components.map((a, s) => [a, s])), o = (a, s, i) => {
|
|
709
709
|
const c = e.datasets[a.dataset];
|
|
710
|
-
return Array.isArray(c) || e.warnings.push(`数据集 ${a.dataset} 未提供数据,列表 ${a.id ?? ""} 输出为空`),
|
|
710
|
+
return Array.isArray(c) || e.warnings.push(`数据集 ${a.dataset} 未提供数据,列表 ${a.id ?? ""} 输出为空`), Ur(a, Array.isArray(c) ? c : [], { ...e, tableId: `${e.tableId}:${n.get(a)}`, startTop: s, finished: i, flow: !!t.flow });
|
|
711
711
|
};
|
|
712
712
|
if (t.flow) {
|
|
713
|
-
yield*
|
|
713
|
+
yield* Sr({
|
|
714
714
|
page: t,
|
|
715
|
-
active: () =>
|
|
716
|
-
top: () => Math.max(r.marginTopMm,
|
|
717
|
-
bottom: () =>
|
|
715
|
+
active: () => j(e.signal),
|
|
716
|
+
top: () => Math.max(r.marginTopMm, X(t)),
|
|
717
|
+
bottom: () => oe(t, r),
|
|
718
718
|
append: (a) => {
|
|
719
719
|
r.components.push(...e.resolveChart(a));
|
|
720
720
|
},
|
|
@@ -722,37 +722,37 @@ function* Yr(e) {
|
|
|
722
722
|
e.pushCurrent(), r.components = [], r.heightMm = t.heightMm, t.layout === "wide" && (r.marginTopMm = 0, r.marginBottomMm = 0);
|
|
723
723
|
},
|
|
724
724
|
takePages: e.takePages,
|
|
725
|
-
height: (a) =>
|
|
725
|
+
height: (a) => Qr(a, e),
|
|
726
726
|
list: o
|
|
727
727
|
});
|
|
728
728
|
return;
|
|
729
729
|
}
|
|
730
730
|
for (const a of t.components)
|
|
731
|
-
|
|
731
|
+
de(a) || (a.kind === "list" ? yield* o(a) : r.components.push(...e.resolveChart(a)));
|
|
732
732
|
}
|
|
733
|
-
function*
|
|
733
|
+
function* Q(e, t, r, n, o, a = /* @__PURE__ */ new WeakMap(), s) {
|
|
734
734
|
let i = 0, c = 0, l = 0;
|
|
735
|
-
const u =
|
|
736
|
-
for (const { pageIndex:
|
|
737
|
-
|
|
738
|
-
const
|
|
739
|
-
let
|
|
740
|
-
const
|
|
741
|
-
if (
|
|
742
|
-
if (r.maxCells !== void 0 && (l += [...
|
|
743
|
-
throw new
|
|
744
|
-
|
|
745
|
-
},
|
|
746
|
-
const
|
|
747
|
-
return
|
|
735
|
+
const u = gr(r.measurer ?? re), f = Yt(t, r.signal, r.maxChartComponents), d = (m) => `${m}_${(++i).toString(36)}`;
|
|
736
|
+
for (const { pageIndex: m, page: h } of Fr(e, t, r)) {
|
|
737
|
+
j(r.signal);
|
|
738
|
+
const b = Or(h), w = h.components.filter(de);
|
|
739
|
+
let y = [];
|
|
740
|
+
const g = (C = !1) => {
|
|
741
|
+
if (j(r.signal), r.maxPages !== void 0 && c >= r.maxPages) throw new U(r.maxPages, c + 1);
|
|
742
|
+
if (r.maxCells !== void 0 && (l += [...b.components, ...w].reduce((T, $) => T + gt($), 0), l > r.maxCells))
|
|
743
|
+
throw new ne(r.maxCells, l);
|
|
744
|
+
y.push(Yr(h, b, w, ++c, C, o));
|
|
745
|
+
}, S = () => {
|
|
746
|
+
const C = y;
|
|
747
|
+
return y = [], C;
|
|
748
748
|
};
|
|
749
|
-
yield*
|
|
750
|
-
templatePage:
|
|
751
|
-
current:
|
|
749
|
+
yield* Zr({
|
|
750
|
+
templatePage: h,
|
|
751
|
+
current: b,
|
|
752
752
|
warnings: n,
|
|
753
753
|
nextId: d,
|
|
754
|
-
pushCurrent:
|
|
755
|
-
takePages:
|
|
754
|
+
pushCurrent: g,
|
|
755
|
+
takePages: S,
|
|
756
756
|
datasets: t,
|
|
757
757
|
resolveChart: f,
|
|
758
758
|
signal: r.signal,
|
|
@@ -760,135 +760,135 @@ function* J(e, t, r, n, o, a = /* @__PURE__ */ new WeakMap(), s) {
|
|
|
760
760
|
prepared: a,
|
|
761
761
|
measurer: u,
|
|
762
762
|
mmPerRow: r.mmPerRow ?? 0,
|
|
763
|
-
tableId: `table:${
|
|
764
|
-
}),
|
|
763
|
+
tableId: `table:${m}`
|
|
764
|
+
}), g(!0), yield* S();
|
|
765
765
|
}
|
|
766
766
|
s && (s.chartComponents = f.used());
|
|
767
767
|
}
|
|
768
|
-
function
|
|
769
|
-
|
|
768
|
+
function xo(e, t, r = {}) {
|
|
769
|
+
fe(r);
|
|
770
770
|
let n = 0;
|
|
771
|
-
for (const o of
|
|
771
|
+
for (const o of Q(e, t, { ...r, onWarning: void 0 }, [])) n++;
|
|
772
772
|
return n;
|
|
773
773
|
}
|
|
774
|
-
function*
|
|
775
|
-
yield*
|
|
774
|
+
function* Po(e, t, r = {}) {
|
|
775
|
+
yield* en(e, t, r);
|
|
776
776
|
}
|
|
777
|
-
function*
|
|
778
|
-
|
|
779
|
-
const o =
|
|
777
|
+
function* en(e, t, r, n) {
|
|
778
|
+
fe(r);
|
|
779
|
+
const o = Xr(e), a = /* @__PURE__ */ new WeakMap();
|
|
780
780
|
let s = r.knownTotalPages;
|
|
781
781
|
if (o && s === void 0) {
|
|
782
782
|
s = 0;
|
|
783
|
-
for (const l of
|
|
783
|
+
for (const l of Q(e, t, r, [], void 0, a)) s++;
|
|
784
784
|
}
|
|
785
785
|
const i = [];
|
|
786
786
|
let c = 0;
|
|
787
|
-
for (const l of
|
|
787
|
+
for (const l of Q(e, t, r, i, s, a, n)) {
|
|
788
788
|
for (; c < i.length; c++) r.onWarning?.(i[c]);
|
|
789
789
|
yield l;
|
|
790
790
|
}
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function pt(e, t, r = {}) {
|
|
793
793
|
const n = typeof r == "number" ? { mmPerRow: r } : r;
|
|
794
|
-
|
|
795
|
-
const o = [], a = { chartComponents: 0 }, s = [...
|
|
796
|
-
return
|
|
794
|
+
fe(n);
|
|
795
|
+
const o = [], a = { chartComponents: 0 }, s = [...Q(e, t, n, o, n.knownTotalPages, void 0, a)];
|
|
796
|
+
return yt(e, n, s, o, a);
|
|
797
797
|
}
|
|
798
|
-
async function
|
|
799
|
-
|
|
798
|
+
async function wt(e, t, r = {}) {
|
|
799
|
+
fe(r), j(r.signal);
|
|
800
800
|
const n = [], o = [], a = { chartComponents: 0 };
|
|
801
801
|
let s = performance.now(), i = 0;
|
|
802
|
-
for (const c of
|
|
803
|
-
o.push(c), (++i >= 8 || performance.now() - s >= 8) && (await new Promise((l) => setTimeout(l, 0)),
|
|
804
|
-
return
|
|
802
|
+
for (const c of Q(e, t, r, n, r.knownTotalPages, void 0, a))
|
|
803
|
+
o.push(c), (++i >= 8 || performance.now() - s >= 8) && (await new Promise((l) => setTimeout(l, 0)), j(r.signal), s = performance.now(), i = 0);
|
|
804
|
+
return j(r.signal), yt(e, r, o, n, a);
|
|
805
805
|
}
|
|
806
|
-
function
|
|
807
|
-
for (const a of r) a.components = a.components.map((s) =>
|
|
808
|
-
return n.forEach((a) => t.onWarning?.(a)), { plan: { schemaVersion:
|
|
806
|
+
function yt(e, t, r, n, o) {
|
|
807
|
+
for (const a of r) a.components = a.components.map((s) => de(s) ? ue(s, (i) => i.replace(/\{totalPages\}/g, String(r.length))) : s);
|
|
808
|
+
return n.forEach((a) => t.onWarning?.(a)), { plan: { schemaVersion: Pe, ...$e(e) ? { requiresRecalculation: !0 } : {}, pages: r }, warnings: n, ...o };
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function tn(e) {
|
|
811
811
|
const t = e.columns.find((a) => !a.hidden)?.field;
|
|
812
812
|
if (!t) return { groups: 0, total: 0 };
|
|
813
|
-
const r =
|
|
813
|
+
const r = le(e), n = (a = [], s = []) => a.includes(t) || s.some((i) => i.field === t), o = typeof e.grandTotal == "object" ? e.grandTotal : void 0;
|
|
814
814
|
return { groups: r.filter((a) => n(a.subtotal, a.aggregates)).length, total: Number(n(o?.fields ?? r[0]?.subtotal, o?.aggregates ?? r[0]?.aggregates)) };
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
|
|
818
|
-
const n =
|
|
816
|
+
function rn(e, t, r) {
|
|
817
|
+
mt(e);
|
|
818
|
+
const n = tt(t[e.dataset] ?? [], e.tree, r), o = e.columns.filter((s) => !s.hidden).length, a = e.header === !1 ? 0 : e.headerGrid ? Ke(e.headerGrid) : o;
|
|
819
819
|
return n.length * o + a + +!!e.grandTotal * 2 * o;
|
|
820
820
|
}
|
|
821
|
-
function
|
|
822
|
-
if (e.tree) return
|
|
821
|
+
function ko(e, t, r = {}) {
|
|
822
|
+
if (e.tree) return rn(e, t, r.signal);
|
|
823
823
|
if (e.matrix) {
|
|
824
824
|
let c = t[e.dataset] ?? [];
|
|
825
|
-
e.computed?.length && (c =
|
|
826
|
-
const l =
|
|
825
|
+
e.computed?.length && (c = Ce(c, { fields: e.computed, ...r }).rows), e.rowVisibleWhen && (c = c.filter(G(e.rowVisibleWhen)));
|
|
826
|
+
const l = rr(c, e.matrix);
|
|
827
827
|
return l.cells + (e.header === !1 ? 0 : l.columnCount * (e.matrix.hierarchy ? e.matrix.columnFields.length + 1 : 1));
|
|
828
828
|
}
|
|
829
|
-
const n = t[e.dataset]?.length ?? 0, o = e.columns.filter((c) => !c.hidden).length, a =
|
|
829
|
+
const n = t[e.dataset]?.length ?? 0, o = e.columns.filter((c) => !c.hidden).length, a = le(e).length, s = tn(e);
|
|
830
830
|
let i = (n * (1 + 2 * a + s.groups) + +!!e.grandTotal * (1 + s.total)) * o;
|
|
831
|
-
if (i += e.header === !1 ? 0 : e.headerGrid ?
|
|
831
|
+
if (i += e.header === !1 ? 0 : e.headerGrid ? Ke(e.headerGrid) : o, e.cardinality === "record" && n === 0 && (i += o), e.detail) {
|
|
832
832
|
const c = t[e.detail.dataset]?.length ?? 0, l = e.detail.columns.filter((u) => !u.hidden).length;
|
|
833
833
|
i += (c + n * (+(e.detail.header !== !1) + +!!e.detail.label)) * l;
|
|
834
834
|
}
|
|
835
835
|
if (!Number.isSafeInteger(i)) throw new RangeError("报表单元格估算超出安全整数预算");
|
|
836
836
|
return i;
|
|
837
837
|
}
|
|
838
|
-
class
|
|
838
|
+
class nn extends Error {
|
|
839
839
|
constructor(t) {
|
|
840
840
|
super(t.map((r) => r.message).join(";")), this.issues = t, this.name = "ReportValidationError";
|
|
841
841
|
}
|
|
842
842
|
}
|
|
843
|
-
function
|
|
843
|
+
function ze(e, t, r) {
|
|
844
844
|
if (!Number.isSafeInteger(e) || e < 1 || e > r) throw new Error(`校验 ${t} 超出预算`);
|
|
845
845
|
return e;
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function on(e) {
|
|
848
848
|
if (e.aggregates && e.scope !== "dataset") throw new Error("仅数据集规则允许汇总");
|
|
849
849
|
if (e.aggregates && (!Array.isArray(e.aggregates) || e.aggregates.length > 64)) throw new Error("校验汇总最多 64 项");
|
|
850
850
|
const t = /* @__PURE__ */ new Set();
|
|
851
851
|
for (const r of e.aggregates ?? []) {
|
|
852
|
-
if (
|
|
853
|
-
t.add(r.field), r.valueField !== void 0 &&
|
|
852
|
+
if (D(r.field), t.has(r.field)) throw new Error("校验汇总字段重复");
|
|
853
|
+
t.add(r.field), r.valueField !== void 0 && D(r.valueField), r.weightField !== void 0 && D(r.weightField), Te([], { ...r, field: r.valueField ?? r.field });
|
|
854
854
|
}
|
|
855
855
|
}
|
|
856
|
-
function
|
|
856
|
+
function bt(e) {
|
|
857
857
|
if (!Array.isArray(e) || e.length > 256 || Object.keys(e).length !== e.length) throw new Error("校验规则最多 256 条且不允许空位");
|
|
858
858
|
const t = /* @__PURE__ */ new Set();
|
|
859
859
|
return e.map((r) => {
|
|
860
860
|
if (!r || typeof r != "object") throw new Error("校验规则应为声明式对象");
|
|
861
|
-
if (
|
|
862
|
-
if (t.add(r.id), r.field !== void 0 &&
|
|
861
|
+
if (D(r.id), t.has(r.id)) throw new Error("校验规则 id 重复");
|
|
862
|
+
if (t.add(r.id), r.field !== void 0 && D(r.field), r.dataset !== void 0 && D(r.dataset), typeof r.message != "string" || !r.message.trim() || r.message.length > 2048) throw new Error("校验规则需要有界提示文案");
|
|
863
863
|
if (r.severity !== void 0 && !["error", "warning"].includes(r.severity)) throw new Error("未知校验严重程度");
|
|
864
864
|
if (r.scope !== void 0 && !["row", "dataset"].includes(r.scope)) throw new Error("未知校验范围");
|
|
865
|
-
|
|
866
|
-
const n = { nodes: 0 }, o =
|
|
865
|
+
on(r);
|
|
866
|
+
const n = { nodes: 0 }, o = G(r.assert, n), a = r.when ? G(r.when, n) : void 0;
|
|
867
867
|
return { rule: r, assert: o, when: a, checks: n.nodes };
|
|
868
868
|
});
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function Je(e) {
|
|
871
871
|
if (e?.aborted) {
|
|
872
872
|
const t = new Error("报表校验已取消");
|
|
873
873
|
throw t.name = "AbortError", t;
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function an(e, t, r, n) {
|
|
877
877
|
const o = n && Object.prototype.hasOwnProperty.call(t, n) ? t[n] : void 0;
|
|
878
878
|
if (o !== void 0 && typeof o != "string" && !(typeof o == "number" && Number.isFinite(o))) throw new Error("校验定位需要稳定的文本或数值业务键");
|
|
879
879
|
return { ruleId: e.id, rowIndex: r, ...o === void 0 ? {} : { rowKey: o }, field: e.field, severity: e.severity ?? "error", message: e.message };
|
|
880
880
|
}
|
|
881
|
-
function
|
|
881
|
+
function sn(e, t) {
|
|
882
882
|
const r = t.computed?.length ? { fields: t.computed, formula: t.formula, signal: t.signal } : void 0;
|
|
883
883
|
if (t.tree) {
|
|
884
|
-
const o =
|
|
884
|
+
const o = rt(e, t.tree, { signal: t.signal, computed: r });
|
|
885
885
|
if (o.rows.length > 1e5) throw new Error("校验展开后数据最多 100000 行");
|
|
886
886
|
return { rows: o.rows, summaryRows: o.leaves, rowKey: t.tree.idField };
|
|
887
887
|
}
|
|
888
|
-
const n = r ?
|
|
888
|
+
const n = r ? Ce(e, r).rows : e;
|
|
889
889
|
return { rows: n, summaryRows: n, rowKey: t.rowKey };
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function cn(e, t) {
|
|
892
892
|
const r = /* @__PURE__ */ new Set();
|
|
893
893
|
e.forEach((n) => {
|
|
894
894
|
if (!n || typeof n != "object" || Array.isArray(n)) throw new Error("校验数据行应为对象");
|
|
@@ -899,49 +899,49 @@ function an(e, t) {
|
|
|
899
899
|
r.add(o);
|
|
900
900
|
});
|
|
901
901
|
}
|
|
902
|
-
function
|
|
903
|
-
return
|
|
902
|
+
function Co(e, t) {
|
|
903
|
+
return vt(e, t, { checks: 0 });
|
|
904
904
|
}
|
|
905
|
-
function
|
|
905
|
+
function vt(e, t, r) {
|
|
906
906
|
if (!Array.isArray(e) || e.length > 1e5) throw new Error("校验数据最多 100000 行");
|
|
907
|
-
|
|
908
|
-
const n =
|
|
909
|
-
t.rowKey !== void 0 &&
|
|
910
|
-
const a =
|
|
911
|
-
|
|
912
|
-
const l =
|
|
907
|
+
Je(t.signal);
|
|
908
|
+
const n = ze(t.maxChecks ?? 2e6, "maxChecks", 1e7), o = ze(t.maxIssues ?? 1e3, "maxIssues", 1e4);
|
|
909
|
+
t.rowKey !== void 0 && D(t.rowKey);
|
|
910
|
+
const a = sn(e, t), { rows: s, summaryRows: i, rowKey: c } = a;
|
|
911
|
+
cn(s, c);
|
|
912
|
+
const l = bt(t.rules), u = l.reduce((d, m) => d + (m.rule.scope === "dataset" ? m.checks + i.length * (m.rule.aggregates?.length ?? 0) : s.length * m.checks), 0);
|
|
913
913
|
if (r.checks += u, r.checks > n) throw new Error("整批校验超出 maxChecks 预算");
|
|
914
914
|
const f = [];
|
|
915
915
|
for (const d of l)
|
|
916
|
-
(d.rule.scope === "dataset" ? [Object.fromEntries((d.rule.aggregates ?? []).map((
|
|
917
|
-
if (
|
|
918
|
-
if (!(d.when && !d.when(
|
|
916
|
+
(d.rule.scope === "dataset" ? [Object.fromEntries((d.rule.aggregates ?? []).map((h) => [h.field, Te(i, { ...h, field: h.valueField ?? h.field })]))] : s).forEach((h, b) => {
|
|
917
|
+
if (Je(t.signal), !h || typeof h != "object" || Array.isArray(h)) throw new Error("校验数据行应为对象");
|
|
918
|
+
if (!(d.when && !d.when(h) || d.assert(h))) {
|
|
919
919
|
if (f.length >= o) throw new Error("校验问题超出 maxIssues 预算,请缩小范围");
|
|
920
|
-
f.push(
|
|
920
|
+
f.push(an(d.rule, h, d.rule.scope === "dataset" ? void 0 : b, d.rule.scope === "dataset" ? void 0 : c));
|
|
921
921
|
}
|
|
922
922
|
});
|
|
923
923
|
return f;
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function ln(e, t = "allow") {
|
|
926
926
|
if (!["allow", "block"].includes(t)) throw new Error("未知校验警告策略");
|
|
927
927
|
if (!Array.isArray(e) || e.length > 1e4 || e.some((r) => !r || !["error", "warning"].includes(r.severity) || typeof r.ruleId != "string" || !r.ruleId.trim() || typeof r.message != "string" || !r.message.trim())) throw new Error("校验问题结构无效");
|
|
928
|
-
if (e.some((r) => r.severity === "error" || t === "block")) throw new
|
|
928
|
+
if (e.some((r) => r.severity === "error" || t === "block")) throw new nn(e);
|
|
929
929
|
}
|
|
930
|
-
function
|
|
930
|
+
function _e(e, t, r) {
|
|
931
931
|
const n = e.get(t);
|
|
932
932
|
if (n && JSON.stringify(n) !== JSON.stringify(r)) throw new Error("同一数据集的校验计算/业务键存在歧义,请统一绑定");
|
|
933
933
|
e.set(t, r);
|
|
934
934
|
}
|
|
935
|
-
function
|
|
936
|
-
|
|
935
|
+
function dn(e, t, r, n = []) {
|
|
936
|
+
bt(t.rules);
|
|
937
937
|
const o = [], a = { checks: 0 };
|
|
938
938
|
for (const [i, c] of e.entries()) {
|
|
939
939
|
const l = /* @__PURE__ */ new Map();
|
|
940
940
|
for (const u of c.template.pages) for (const f of u.components)
|
|
941
|
-
f.kind === "list" && (
|
|
941
|
+
f.kind === "list" && (_e(l, f.dataset, { rowKey: f.tree?.idField ?? f.rowKey, computed: f.computed, tree: f.tree }), f.detail && _e(l, f.detail.dataset, { rowKey: f.detail.rowKey }));
|
|
942
942
|
for (const [u, f] of l) {
|
|
943
|
-
const d = t.rules.filter((
|
|
944
|
-
if (d.length && (o.push(...
|
|
943
|
+
const d = t.rules.filter((m) => !m.dataset || m.dataset === u);
|
|
944
|
+
if (d.length && (o.push(...vt(c.datasets[u] ?? [], { ...t, rules: d, ...f, formula: n[i], signal: r }, a).map((m) => ({ ...m, dataset: u, sourceScope: c.sourceScope }))), o.length > (t.maxIssues ?? 1e3)))
|
|
945
945
|
throw new Error("整批候选校验问题超出 maxIssues 预算");
|
|
946
946
|
}
|
|
947
947
|
}
|
|
@@ -949,31 +949,31 @@ function cn(e, t, r, n = []) {
|
|
|
949
949
|
if (t.rules.some((i) => i.dataset && !s.has(i.dataset))) throw new Error("校验目标数据集不存在");
|
|
950
950
|
return o;
|
|
951
951
|
}
|
|
952
|
-
function
|
|
952
|
+
function Mt(e) {
|
|
953
953
|
return !e || typeof e != "object" ? !1 : [e.pageIndex, e.componentIndex, e.rowIndex, e.columnIndex].every((t) => Number.isInteger(t) && t >= 0);
|
|
954
954
|
}
|
|
955
|
-
function
|
|
955
|
+
function St(e, t, r) {
|
|
956
956
|
const n = e.grid;
|
|
957
957
|
if (!n) return null;
|
|
958
958
|
const o = n.cells[t];
|
|
959
959
|
if (!o) return null;
|
|
960
|
-
const s =
|
|
960
|
+
const s = q(n, e.widthMm, e.heightMm).cells.filter((c) => c.ri === t).findIndex((c) => c.ci === r), i = o[s];
|
|
961
961
|
return i ? { cell: i, sourceColumnIndex: s } : null;
|
|
962
962
|
}
|
|
963
|
-
function
|
|
963
|
+
function un(e) {
|
|
964
964
|
return e.value !== void 0 ? e.value : e.rawText ?? e.text ?? null;
|
|
965
965
|
}
|
|
966
|
-
function
|
|
966
|
+
function fn(e, t) {
|
|
967
967
|
return e.valueType ? e.valueType : typeof t == "number" ? "number" : typeof t == "boolean" ? "boolean" : t === null && e.numberFormat && /[0#?]/.test(e.numberFormat) ? "number" : "text";
|
|
968
968
|
}
|
|
969
|
-
function
|
|
969
|
+
function mn(e, t) {
|
|
970
970
|
if (e.derived) return "derived";
|
|
971
971
|
if (e.editable === !1) return "cell";
|
|
972
972
|
if (e.formula !== void 0) return "formula";
|
|
973
973
|
if (e.children?.length || e.richParagraphs?.length) return "complex";
|
|
974
974
|
if (t.table && t.table.role !== "body" && e.editable !== !0) return "structure";
|
|
975
975
|
}
|
|
976
|
-
function
|
|
976
|
+
function hn(e, t) {
|
|
977
977
|
const r = e.table;
|
|
978
978
|
if (r)
|
|
979
979
|
return {
|
|
@@ -983,75 +983,94 @@ function fn(e, t) {
|
|
|
983
983
|
columnKey: r.columnKeys[t.columnIndex]
|
|
984
984
|
};
|
|
985
985
|
}
|
|
986
|
-
function
|
|
986
|
+
function gn(e, t, r) {
|
|
987
987
|
if (e.derived) return;
|
|
988
988
|
if (e.source) return { ...e.source };
|
|
989
989
|
const n = t.table?.source, o = t.table?.columnKeys[r.columnIndex];
|
|
990
990
|
if (!(!n || n.rowKey === void 0 || o === void 0))
|
|
991
991
|
return { ...n, rowKey: n.rowKey, field: o };
|
|
992
992
|
}
|
|
993
|
-
function
|
|
994
|
-
const n =
|
|
993
|
+
function ye(e, t, r) {
|
|
994
|
+
const n = un(r), o = mn(r, e);
|
|
995
995
|
return {
|
|
996
996
|
address: { ...t },
|
|
997
997
|
cell: r,
|
|
998
998
|
component: e,
|
|
999
999
|
value: n,
|
|
1000
|
-
valueType:
|
|
1001
|
-
table:
|
|
1002
|
-
source:
|
|
1000
|
+
valueType: fn(r, n),
|
|
1001
|
+
table: hn(e, t),
|
|
1002
|
+
source: gn(r, e, t),
|
|
1003
1003
|
editable: o === void 0,
|
|
1004
1004
|
readOnlyReason: o
|
|
1005
1005
|
};
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1008
|
-
if (!
|
|
1007
|
+
function Ne(e, t) {
|
|
1008
|
+
if (!Mt(t)) return null;
|
|
1009
1009
|
const r = e.pages[t.pageIndex]?.components[t.componentIndex];
|
|
1010
1010
|
if (!r) return null;
|
|
1011
|
-
const n =
|
|
1012
|
-
return n ?
|
|
1011
|
+
const n = St(r, t.rowIndex, t.columnIndex);
|
|
1012
|
+
return n ? ye(r, t, n.cell) : null;
|
|
1013
1013
|
}
|
|
1014
|
-
function
|
|
1015
|
-
const
|
|
1016
|
-
|
|
1017
|
-
if (!
|
|
1018
|
-
|
|
1019
|
-
if (!
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
s.set(i.ri, c + 1);
|
|
1027
|
-
const l = n.grid.cells[i.ri]?.[c];
|
|
1028
|
-
l && o.set(`${i.ri}:${i.ci}`, l);
|
|
1014
|
+
function pn(e, t = !0) {
|
|
1015
|
+
const r = /* @__PURE__ */ new Map();
|
|
1016
|
+
function n(i) {
|
|
1017
|
+
if (!i.grid) return;
|
|
1018
|
+
let c = r.get(i);
|
|
1019
|
+
if (!c) {
|
|
1020
|
+
const l = q(i.grid, i.widthMm, i.heightMm), u = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
1021
|
+
for (const d of l.cells) {
|
|
1022
|
+
const m = u.get(d.ri) ?? 0;
|
|
1023
|
+
u.set(d.ri, m + 1);
|
|
1024
|
+
const h = i.grid.cells[d.ri]?.[m];
|
|
1025
|
+
h && f.set(`${d.ri}:${d.ci}`, h);
|
|
1029
1026
|
}
|
|
1030
|
-
t.set(
|
|
1027
|
+
c = { layout: t ? l : void 0, cells: f }, r.set(i, c);
|
|
1031
1028
|
}
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1029
|
+
return c;
|
|
1030
|
+
}
|
|
1031
|
+
function o(i) {
|
|
1032
|
+
if (!Mt(i)) return null;
|
|
1033
|
+
const c = e.pages[i.pageIndex]?.components[i.componentIndex];
|
|
1034
|
+
if (!c) return null;
|
|
1035
|
+
const l = n(c)?.cells.get(`${i.rowIndex}:${i.columnIndex}`);
|
|
1036
|
+
return l ? ye(c, i, l) : null;
|
|
1037
|
+
}
|
|
1038
|
+
function* a(i, c) {
|
|
1039
|
+
const l = e.pages[i]?.components[c], u = l && n(l);
|
|
1040
|
+
if (u)
|
|
1041
|
+
for (const f of s(l).cells) {
|
|
1042
|
+
const d = u.cells.get(`${f.ri}:${f.ci}`);
|
|
1043
|
+
d && (yield ye(l, { pageIndex: i, componentIndex: c, rowIndex: f.ri, columnIndex: f.ci }, d));
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
function s(i) {
|
|
1047
|
+
const c = n(i);
|
|
1048
|
+
return c && (c.layout ?? q(i.grid, i.widthMm, i.heightMm));
|
|
1049
|
+
}
|
|
1050
|
+
return { resolve: o, entries: a, layout: s };
|
|
1051
|
+
}
|
|
1052
|
+
function W(e) {
|
|
1053
|
+
return pn(e, !1).resolve;
|
|
1035
1054
|
}
|
|
1036
1055
|
class M extends Error {
|
|
1037
1056
|
constructor(t) {
|
|
1038
1057
|
super(`Invalid report cell edit: ${t}`), this.code = t, this.name = "ReportCellEditError";
|
|
1039
1058
|
}
|
|
1040
1059
|
}
|
|
1041
|
-
function
|
|
1060
|
+
function wn(e, t) {
|
|
1042
1061
|
let r = e.trim();
|
|
1043
1062
|
const n = t && r.endsWith("%");
|
|
1044
1063
|
if (n && (r = r.slice(0, -1).trim()), /^[+-]?\d{1,3}(?:,\d{3})+(?:\.\d*)?(?:[eE][+-]?\d+)?$/.test(r) && (r = r.replace(/,/g, "")), !/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(r)) throw new M("number");
|
|
1045
1064
|
return Number(r) / (n ? 100 : 1);
|
|
1046
1065
|
}
|
|
1047
|
-
function
|
|
1066
|
+
function yn(e, t) {
|
|
1048
1067
|
if (e === null || typeof e == "string" && e.trim() === "") return null;
|
|
1049
1068
|
if (typeof e != "string" && typeof e != "number") throw new M("number");
|
|
1050
|
-
const r = typeof e == "number" ? e :
|
|
1069
|
+
const r = typeof e == "number" ? e : wn(e, fr(t.cell.numberFormat));
|
|
1051
1070
|
if (!Number.isFinite(r) || Number.isInteger(r) && !Number.isSafeInteger(r)) throw new M("number");
|
|
1052
1071
|
return r;
|
|
1053
1072
|
}
|
|
1054
|
-
function
|
|
1073
|
+
function bn(e) {
|
|
1055
1074
|
if (e === null || typeof e == "string" && e.trim() === "") return null;
|
|
1056
1075
|
if (typeof e == "boolean") return e;
|
|
1057
1076
|
const t = String(e).trim().toLowerCase();
|
|
@@ -1059,24 +1078,24 @@ function pn(e) {
|
|
|
1059
1078
|
if (["false", "no", "否", "0"].includes(t)) return !1;
|
|
1060
1079
|
throw new M("boolean");
|
|
1061
1080
|
}
|
|
1062
|
-
function
|
|
1063
|
-
return e.valueType === "number" ?
|
|
1081
|
+
function xt(e, t) {
|
|
1082
|
+
return e.valueType === "number" ? yn(t, e) : e.valueType === "boolean" ? bn(t) : t === null ? null : String(t);
|
|
1064
1083
|
}
|
|
1065
|
-
function
|
|
1084
|
+
function vn(e, t) {
|
|
1066
1085
|
const r = t.cell.text, o = [["是", "否"], ["TRUE", "FALSE"], ["True", "False"], ["true", "false"], ["1", "0"]].find((a) => a.includes(r ?? ""));
|
|
1067
1086
|
return o ? o[e ? 0 : 1] : String(e);
|
|
1068
1087
|
}
|
|
1069
|
-
function
|
|
1070
|
-
return t === null ? "" : typeof t == "boolean" ?
|
|
1088
|
+
function ee(e, t) {
|
|
1089
|
+
return t === null ? "" : typeof t == "boolean" ? vn(t, e) : typeof t == "number" ? ur(t, e.cell.numberFormat) : String(t);
|
|
1071
1090
|
}
|
|
1072
|
-
function
|
|
1073
|
-
const n =
|
|
1091
|
+
function To(e, t, r) {
|
|
1092
|
+
const n = Ne(e, t);
|
|
1074
1093
|
if (!n) throw new M("missing");
|
|
1075
|
-
return
|
|
1094
|
+
return te(n, r);
|
|
1076
1095
|
}
|
|
1077
|
-
function
|
|
1096
|
+
function te(e, t) {
|
|
1078
1097
|
if (!e.editable) throw new M("readonly");
|
|
1079
|
-
const r =
|
|
1098
|
+
const r = xt(e, t);
|
|
1080
1099
|
return {
|
|
1081
1100
|
address: { ...e.address },
|
|
1082
1101
|
table: e.table,
|
|
@@ -1084,73 +1103,73 @@ function U(e, t) {
|
|
|
1084
1103
|
previousValue: e.value,
|
|
1085
1104
|
previousText: e.cell.text ?? "",
|
|
1086
1105
|
value: r,
|
|
1087
|
-
text:
|
|
1106
|
+
text: ee(e, r)
|
|
1088
1107
|
};
|
|
1089
1108
|
}
|
|
1090
|
-
function
|
|
1109
|
+
function Mn(e, t) {
|
|
1091
1110
|
const r = e.table, n = t.table;
|
|
1092
1111
|
return !r || !n || r.columnKey === void 0 ? !1 : r.id === n.id && r.rowIndex === n.rowIndex && r.role === n.role && r.columnKey === n.columnKey;
|
|
1093
1112
|
}
|
|
1094
|
-
function
|
|
1095
|
-
const n = e.grid, { rowIndex: o, columnIndex: a } = t.address, s =
|
|
1113
|
+
function Pt(e, t, r) {
|
|
1114
|
+
const n = e.grid, { rowIndex: o, columnIndex: a } = t.address, s = St(e, o, a), i = [...n.cells], c = [...i[o]], l = ee(t, r.value), u = { ...s.cell, value: r.value, text: l, rawText: l };
|
|
1096
1115
|
return c[s.sourceColumnIndex] = u, i[o] = c, { ...e, grid: { ...n, cells: i } };
|
|
1097
1116
|
}
|
|
1098
|
-
function
|
|
1117
|
+
function Sn(e, t) {
|
|
1099
1118
|
const r = e.table?.columnKeys, n = t.table?.columnKey;
|
|
1100
1119
|
return r && n !== void 0 ? r.flatMap((o, a) => o === n ? [a] : []) : [];
|
|
1101
1120
|
}
|
|
1102
|
-
function
|
|
1121
|
+
function xn(e, t, r, n, o, a) {
|
|
1103
1122
|
const s = t.table, i = o.table;
|
|
1104
1123
|
if (!s || !i || s.id !== i.id || s.role !== i.role || !t.grid) return t;
|
|
1105
1124
|
const c = i.rowIndex - s.rowIndex;
|
|
1106
1125
|
if (c < 0 || c >= t.grid.cells.length) return t;
|
|
1107
1126
|
let l = t;
|
|
1108
|
-
for (const u of
|
|
1109
|
-
const f =
|
|
1110
|
-
f?.editable &&
|
|
1127
|
+
for (const u of Sn(t, o)) {
|
|
1128
|
+
const f = Ne(e, { pageIndex: r, componentIndex: n, rowIndex: c, columnIndex: u });
|
|
1129
|
+
f?.editable && Mn(o, f) && (l = Pt(l, f, a));
|
|
1111
1130
|
}
|
|
1112
1131
|
return l;
|
|
1113
1132
|
}
|
|
1114
|
-
function
|
|
1133
|
+
function Pn(e, t, r, n, o, a) {
|
|
1115
1134
|
const s = o.address;
|
|
1116
|
-
return o.table?.columnKey !== void 0 ?
|
|
1135
|
+
return o.table?.columnKey !== void 0 ? xn(e, t, r, n, o, a) : s.pageIndex === r && s.componentIndex === n ? Pt(t, o, a) : t;
|
|
1117
1136
|
}
|
|
1118
|
-
function
|
|
1137
|
+
function je(e, t) {
|
|
1119
1138
|
const r = t.source;
|
|
1120
1139
|
if (!r) return !1;
|
|
1121
1140
|
const n = e.source;
|
|
1122
1141
|
return !n || ["sourceScope", "datasetId", "rowKey", "field", "revision", "sourceToken"].some((o) => !Object.is(n[o], r[o]));
|
|
1123
1142
|
}
|
|
1124
|
-
function
|
|
1125
|
-
const r =
|
|
1143
|
+
function Eo(e, t) {
|
|
1144
|
+
const r = Ne(e, t.address);
|
|
1126
1145
|
if (!r) throw new M("missing");
|
|
1127
1146
|
if (!r.editable) throw new M("readonly");
|
|
1128
|
-
if (
|
|
1147
|
+
if (je(r, t)) throw new M("conflict");
|
|
1129
1148
|
if (!Object.is(r.value, t.previousValue) || (r.cell.text ?? "") !== t.previousText) throw new M("conflict");
|
|
1130
|
-
const n =
|
|
1149
|
+
const n = xt(r, t.value), o = { ...t, value: n, text: ee(r, n) };
|
|
1131
1150
|
if (Object.is(n, r.value) && o.text === r.cell.text) return e;
|
|
1132
1151
|
const a = e.pages.map((s, i) => {
|
|
1133
|
-
const c = s.components.map((l, u) =>
|
|
1152
|
+
const c = s.components.map((l, u) => Pn(e, l, i, u, r, o));
|
|
1134
1153
|
return c.every((l, u) => l === s.components[u]) ? s : { ...s, components: c };
|
|
1135
1154
|
});
|
|
1136
1155
|
return { ...e, pages: a };
|
|
1137
1156
|
}
|
|
1138
|
-
function
|
|
1157
|
+
function kt(e) {
|
|
1139
1158
|
const t = [];
|
|
1140
1159
|
for (const r of e.template.pages) for (const n of r.components)
|
|
1141
1160
|
n.kind === "list" && (t.push(n.tree ? { ...n, rowKey: n.tree.idField } : n), n.detail && t.push({ ...n.detail, relation: { detail: n.detail, parentRows: e.datasets[n.dataset] ?? [] } }));
|
|
1142
1161
|
return t;
|
|
1143
1162
|
}
|
|
1144
|
-
function
|
|
1163
|
+
function V(e) {
|
|
1145
1164
|
return JSON.stringify([e.sourceScope, e.datasetId]);
|
|
1146
1165
|
}
|
|
1147
|
-
function
|
|
1166
|
+
function ae(e) {
|
|
1148
1167
|
return JSON.stringify([e.sourceScope, e.datasetId, e.rowKey]);
|
|
1149
1168
|
}
|
|
1150
|
-
function
|
|
1169
|
+
function Ct(e) {
|
|
1151
1170
|
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
|
|
1152
1171
|
return e.forEach((n, o) => {
|
|
1153
|
-
for (const a of
|
|
1172
|
+
for (const a of kt(n)) {
|
|
1154
1173
|
if (!a.rowKey) continue;
|
|
1155
1174
|
const s = a.relation, i = s ? new Set(s.parentRows.map((c) => JSON.stringify(c[s.detail.parentKey]))) : void 0;
|
|
1156
1175
|
(n.datasets[a.dataset] ?? []).forEach((c, l) => {
|
|
@@ -1160,18 +1179,18 @@ function xt(e) {
|
|
|
1160
1179
|
const f = `${o}:${a.dataset}:${l}:${a.rowKey}`;
|
|
1161
1180
|
if (r.has(f)) return;
|
|
1162
1181
|
r.add(f);
|
|
1163
|
-
const d =
|
|
1164
|
-
|
|
1182
|
+
const d = ae({ sourceScope: n.sourceScope, datasetId: a.dataset, rowKey: u }), m = t.get(d) ?? [];
|
|
1183
|
+
m.push({ partIndex: o, dataset: a.dataset, rowIndex: l, row: c, binding: a }), t.set(d, m);
|
|
1165
1184
|
});
|
|
1166
1185
|
}
|
|
1167
1186
|
}), (n) => {
|
|
1168
|
-
const o = t.get(
|
|
1187
|
+
const o = t.get(ae(n));
|
|
1169
1188
|
if (!o?.length) throw new M("missing");
|
|
1170
1189
|
if (new Set(o.map((a) => `${a.partIndex}:${a.dataset}`)).size !== o.length) throw new M("conflict");
|
|
1171
1190
|
return o;
|
|
1172
1191
|
};
|
|
1173
1192
|
}
|
|
1174
|
-
function
|
|
1193
|
+
function Tt(e, t) {
|
|
1175
1194
|
const r = e.map((o) => ({ ...o, datasets: { ...o.datasets } })), n = /* @__PURE__ */ new Set();
|
|
1176
1195
|
for (const { row: o, field: a, value: s } of t) {
|
|
1177
1196
|
const i = r[o.partIndex], c = JSON.stringify([o.partIndex, o.dataset]);
|
|
@@ -1179,45 +1198,45 @@ function Ct(e, t) {
|
|
|
1179
1198
|
}
|
|
1180
1199
|
for (const o of n) {
|
|
1181
1200
|
const [a, s] = JSON.parse(o);
|
|
1182
|
-
|
|
1201
|
+
_t(e[a].datasets[s], r[a].datasets[s]);
|
|
1183
1202
|
}
|
|
1184
1203
|
return r;
|
|
1185
1204
|
}
|
|
1186
|
-
function
|
|
1205
|
+
function kn(e, t, r) {
|
|
1187
1206
|
const n = [], o = /* @__PURE__ */ new Set();
|
|
1188
1207
|
return e.forEach((a, s) => {
|
|
1189
|
-
for (const i of
|
|
1190
|
-
t.has(
|
|
1208
|
+
for (const i of kt(a))
|
|
1209
|
+
t.has(V({ sourceScope: a.sourceScope, datasetId: i.dataset })) && (a.datasets[i.dataset] ?? []).forEach((c, l) => {
|
|
1191
1210
|
const u = { partIndex: s, dataset: i.dataset, rowIndex: l, row: c, binding: i };
|
|
1192
1211
|
for (const [f, d] of [[i.revisionField, r.revision], [i.sourceTokenField, r.sourceToken]]) {
|
|
1193
1212
|
if (!f || d === void 0) continue;
|
|
1194
|
-
const
|
|
1195
|
-
o.has(
|
|
1213
|
+
const m = `${s}:${i.dataset}:${l}:${f}`;
|
|
1214
|
+
o.has(m) || (o.add(m), n.push({ row: u, field: f, value: d }));
|
|
1196
1215
|
}
|
|
1197
1216
|
});
|
|
1198
1217
|
}), n;
|
|
1199
1218
|
}
|
|
1200
|
-
function
|
|
1219
|
+
function Cn(e, t, r) {
|
|
1201
1220
|
if (!r || r.revision === void 0 && r.sourceToken === void 0) return e;
|
|
1202
|
-
const n = new Set(t.edits.flatMap((o) => o.source ? [
|
|
1203
|
-
return
|
|
1221
|
+
const n = new Set(t.edits.flatMap((o) => o.source ? [V(o.source)] : []));
|
|
1222
|
+
return Et(e, new Map([...n].map((o) => [o, r])));
|
|
1204
1223
|
}
|
|
1205
|
-
function
|
|
1224
|
+
function Et(e, t) {
|
|
1206
1225
|
if (!t.size) return e;
|
|
1207
1226
|
function r(a) {
|
|
1208
|
-
const s = a.datasetId && t.get(
|
|
1227
|
+
const s = a.datasetId && t.get(V({ ...a, datasetId: a.datasetId }));
|
|
1209
1228
|
return !s || (s.revision === void 0 || Object.is(s.revision, a.revision)) && (s.sourceToken === void 0 || s.sourceToken === a.sourceToken) ? a : { ...a, ...s.revision !== void 0 ? { revision: s.revision } : {}, ...s.sourceToken !== void 0 ? { sourceToken: s.sourceToken } : {} };
|
|
1210
1229
|
}
|
|
1211
1230
|
function n(a) {
|
|
1212
1231
|
const s = a.map((i) => {
|
|
1213
1232
|
const c = i.table?.source ? r(i.table.source) : void 0, l = i.table && c !== i.table.source ? { ...i.table, source: c } : i.table, u = i.grid?.cells.map((d) => {
|
|
1214
|
-
const
|
|
1215
|
-
if (!
|
|
1216
|
-
const
|
|
1217
|
-
return
|
|
1233
|
+
const m = d.map((h) => {
|
|
1234
|
+
if (!h) return h;
|
|
1235
|
+
const b = h.source ? r(h.source) : void 0, w = h.children ? n(h.children) : void 0;
|
|
1236
|
+
return b === h.source && w === h.children ? h : { ...h, source: b, children: w };
|
|
1218
1237
|
});
|
|
1219
|
-
return
|
|
1220
|
-
}), f = i.grid && u?.some((d,
|
|
1238
|
+
return m.some((h, b) => h !== d[b]) ? m : d;
|
|
1239
|
+
}), f = i.grid && u?.some((d, m) => d !== i.grid.cells[m]) ? { ...i.grid, cells: u } : i.grid;
|
|
1221
1240
|
return l !== i.table || f !== i.grid ? { ...i, table: l, grid: f } : i;
|
|
1222
1241
|
});
|
|
1223
1242
|
return s.some((i, c) => i !== a[c]) ? s : a;
|
|
@@ -1228,29 +1247,29 @@ function kt(e, t) {
|
|
|
1228
1247
|
});
|
|
1229
1248
|
return o.some((a, s) => a !== e.pages[s]) ? { ...e, pages: o } : e;
|
|
1230
1249
|
}
|
|
1231
|
-
function
|
|
1250
|
+
function Tn(e) {
|
|
1232
1251
|
return JSON.stringify([e.pageIndex, e.componentIndex, e.rowIndex, e.columnIndex]);
|
|
1233
1252
|
}
|
|
1234
|
-
function
|
|
1253
|
+
function qe(e) {
|
|
1235
1254
|
const t = e.table;
|
|
1236
|
-
return t?.columnKey !== void 0 ? JSON.stringify([t.id, t.role, t.rowIndex, t.columnKey]) :
|
|
1255
|
+
return t?.columnKey !== void 0 ? JSON.stringify([t.id, t.role, t.rowIndex, t.columnKey]) : Tn(e.address);
|
|
1237
1256
|
}
|
|
1238
|
-
function
|
|
1257
|
+
function En(e, t) {
|
|
1239
1258
|
if (!t.length) return e;
|
|
1240
|
-
const r = new Map(t.map((c) => [
|
|
1259
|
+
const r = new Map(t.map((c) => [qe(c), c])), n = new Set(t.flatMap((c) => c.table ? [c.table.id] : [])), o = new Set(t.map((c) => `${c.address.pageIndex}:${c.address.componentIndex}`)), a = W(e);
|
|
1241
1260
|
function s(c, l, u) {
|
|
1242
1261
|
const f = c.grid;
|
|
1243
1262
|
if (!f || !o.has(`${l}:${u}`) && !n.has(c.table?.id ?? "")) return c;
|
|
1244
|
-
const d = /* @__PURE__ */ new Map(),
|
|
1245
|
-
for (const
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
-
const
|
|
1249
|
-
if (!
|
|
1250
|
-
const
|
|
1251
|
-
Object.is(
|
|
1263
|
+
const d = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
1264
|
+
for (const h of q(f, c.widthMm, c.heightMm).cells) {
|
|
1265
|
+
const b = m.get(h.ri) ?? 0;
|
|
1266
|
+
m.set(h.ri, b + 1);
|
|
1267
|
+
const w = a({ pageIndex: l, componentIndex: u, rowIndex: h.ri, columnIndex: h.ci }), y = w && r.get(qe(w));
|
|
1268
|
+
if (!y || !w.editable) continue;
|
|
1269
|
+
const g = d.get(h.ri) ?? [...f.cells[h.ri]], S = ee(w, y.value);
|
|
1270
|
+
Object.is(w.value, y.value) && S === w.cell.text || (g[b] = { ...h.cell, value: y.value, text: S, rawText: S }, d.set(h.ri, g));
|
|
1252
1271
|
}
|
|
1253
|
-
return d.size ? { ...c, grid: { ...f, cells: f.cells.map((
|
|
1272
|
+
return d.size ? { ...c, grid: { ...f, cells: f.cells.map((h, b) => d.get(b) ?? h) } } : c;
|
|
1254
1273
|
}
|
|
1255
1274
|
const i = e.pages.map((c, l) => {
|
|
1256
1275
|
const u = c.components.map((f, d) => s(f, l, d));
|
|
@@ -1258,7 +1277,7 @@ function kn(e, t) {
|
|
|
1258
1277
|
});
|
|
1259
1278
|
return i.every((c, l) => c === e.pages[l]) ? e : { ...e, pages: i };
|
|
1260
1279
|
}
|
|
1261
|
-
function
|
|
1280
|
+
function O(e) {
|
|
1262
1281
|
const t = e.source;
|
|
1263
1282
|
if (t) return JSON.stringify([t.sourceScope, t.datasetId, t.rowKey, t.field]);
|
|
1264
1283
|
const r = e.table;
|
|
@@ -1266,65 +1285,65 @@ function F(e) {
|
|
|
1266
1285
|
const n = e.address;
|
|
1267
1286
|
return JSON.stringify([n.pageIndex, n.componentIndex, n.rowIndex, n.columnIndex]);
|
|
1268
1287
|
}
|
|
1269
|
-
function
|
|
1288
|
+
function Ro(e, t, r) {
|
|
1270
1289
|
if (typeof r != "string" || !r.trim() || !Array.isArray(t)) throw new M("missing");
|
|
1271
1290
|
if (t.length > 1e4) throw new M("limit");
|
|
1272
|
-
const n = /* @__PURE__ */ new Set(), o =
|
|
1291
|
+
const n = /* @__PURE__ */ new Set(), o = W(e), a = t.map(({ address: s, value: i }) => {
|
|
1273
1292
|
const c = o(s);
|
|
1274
1293
|
if (!c) throw new M("missing");
|
|
1275
|
-
const l =
|
|
1294
|
+
const l = te(c, i), u = O(l);
|
|
1276
1295
|
if (n.has(u)) throw new M("duplicate");
|
|
1277
1296
|
return n.add(u), l;
|
|
1278
1297
|
});
|
|
1279
1298
|
return { requestId: r, edits: a };
|
|
1280
1299
|
}
|
|
1281
|
-
function
|
|
1300
|
+
function Io(e, t) {
|
|
1282
1301
|
if (t.edits.length > 1e4) throw new M("limit");
|
|
1283
|
-
const r =
|
|
1302
|
+
const r = W(e), n = /* @__PURE__ */ new Set(), o = t.edits.map((a) => {
|
|
1284
1303
|
const s = r(a.address);
|
|
1285
1304
|
if (!s) throw new M("missing");
|
|
1286
|
-
const i =
|
|
1305
|
+
const i = O(a);
|
|
1287
1306
|
if (n.has(i)) throw new M("duplicate");
|
|
1288
|
-
if (n.add(i),
|
|
1289
|
-
return
|
|
1307
|
+
if (n.add(i), je(s, a) || !Object.is(s.value, a.previousValue) || (s.cell.text ?? "") !== a.previousText) throw new M("conflict");
|
|
1308
|
+
return te(s, a.value);
|
|
1290
1309
|
});
|
|
1291
|
-
return
|
|
1310
|
+
return En(e, o);
|
|
1292
1311
|
}
|
|
1293
|
-
function
|
|
1312
|
+
function $o(e) {
|
|
1294
1313
|
const t = /* @__PURE__ */ new Map();
|
|
1295
1314
|
for (const r of e) {
|
|
1296
|
-
const n =
|
|
1315
|
+
const n = O(r), o = t.get(n), a = o ? { ...r, previousValue: o.previousValue, previousText: o.previousText } : { ...r };
|
|
1297
1316
|
Object.is(a.previousValue, a.value) ? t.delete(n) : t.set(n, a);
|
|
1298
1317
|
}
|
|
1299
1318
|
return [...t.values()];
|
|
1300
1319
|
}
|
|
1301
|
-
function
|
|
1302
|
-
const t = /* @__PURE__ */ new Map(), r =
|
|
1320
|
+
function Rt(e) {
|
|
1321
|
+
const t = /* @__PURE__ */ new Map(), r = W(e);
|
|
1303
1322
|
return e.pages.forEach((n, o) => n.components.forEach((a, s) => {
|
|
1304
1323
|
if (!(!a.grid || a.table?.role !== "body"))
|
|
1305
1324
|
for (let i = 0; i < a.grid.cells.length; i++) for (let c = 0; c < a.table.columnKeys.length; c++) {
|
|
1306
1325
|
const l = r({ pageIndex: o, componentIndex: s, rowIndex: i, columnIndex: c });
|
|
1307
|
-
l?.source && l.editable && t.set(
|
|
1326
|
+
l?.source && l.editable && t.set(O(l), l);
|
|
1308
1327
|
}
|
|
1309
1328
|
})), t;
|
|
1310
1329
|
}
|
|
1311
|
-
function
|
|
1312
|
-
const n =
|
|
1330
|
+
function Fo(e, t, r) {
|
|
1331
|
+
const n = Rt(e), o = W(e);
|
|
1313
1332
|
return t.map((a) => {
|
|
1314
|
-
const s = a.source ? n.get(
|
|
1315
|
-
if (!s ||
|
|
1333
|
+
const s = a.source ? n.get(O(a)) : o(a.address);
|
|
1334
|
+
if (!s || O(s) !== O(a)) throw new M("missing");
|
|
1316
1335
|
return { address: { ...s.address }, value: a[r] };
|
|
1317
1336
|
});
|
|
1318
1337
|
}
|
|
1319
|
-
function
|
|
1338
|
+
function It(e, t) {
|
|
1320
1339
|
if (++e.nodes > 1e6 || t > 128) throw new M("limit");
|
|
1321
1340
|
}
|
|
1322
|
-
function
|
|
1341
|
+
function se(e, t) {
|
|
1323
1342
|
const r = Object.getOwnPropertyDescriptor(e, t);
|
|
1324
1343
|
if (!r || r.get || r.set) throw new M("conflict");
|
|
1325
1344
|
return r.value;
|
|
1326
1345
|
}
|
|
1327
|
-
function
|
|
1346
|
+
function Le(e) {
|
|
1328
1347
|
if (Object.getOwnPropertyDescriptor(e, "toJSON")) throw new M("conflict");
|
|
1329
1348
|
const t = Object.getPrototypeOf(e);
|
|
1330
1349
|
if (Array.isArray(e) && (t !== Array.prototype || Object.keys(e).length !== e.length)) throw new M("conflict");
|
|
@@ -1335,114 +1354,216 @@ function $e(e) {
|
|
|
1335
1354
|
if (e instanceof Date || Array.isArray(e) && !/^(0|[1-9]\d*)$/.test(r)) throw new M("conflict");
|
|
1336
1355
|
}
|
|
1337
1356
|
}
|
|
1338
|
-
function
|
|
1339
|
-
if (
|
|
1357
|
+
function $t(e, t, r, n, o, a) {
|
|
1358
|
+
if (It(n, o), typeof e == "function" || typeof e == "symbol") throw new M("conflict");
|
|
1340
1359
|
if (e === null || typeof e != "object") return;
|
|
1341
|
-
if (
|
|
1342
|
-
|
|
1343
|
-
|
|
1360
|
+
if (Le(e), r.has(e)) throw new M("conflict");
|
|
1361
|
+
if (a?.has(e)) return;
|
|
1362
|
+
a?.add(e), r.add(e);
|
|
1363
|
+
const s = Object.keys(e), i = s.map((c) => se(e, c));
|
|
1344
1364
|
t.push({
|
|
1345
1365
|
object: e,
|
|
1346
1366
|
prototype: Object.getPrototypeOf(e),
|
|
1347
|
-
keys:
|
|
1348
|
-
values:
|
|
1367
|
+
keys: s,
|
|
1368
|
+
values: i,
|
|
1349
1369
|
...e instanceof Date ? { date: Date.prototype.getTime.call(e) } : {},
|
|
1350
1370
|
...Array.isArray(e) ? { length: e.length } : {}
|
|
1351
1371
|
});
|
|
1352
|
-
for (const
|
|
1372
|
+
for (const c of i) $t(c, t, r, n, o + 1, a);
|
|
1353
1373
|
r.delete(e);
|
|
1354
1374
|
}
|
|
1355
|
-
function
|
|
1375
|
+
function Rn(e) {
|
|
1356
1376
|
const { object: t, keys: r, values: n } = e;
|
|
1357
|
-
if (
|
|
1377
|
+
if (Le(t), Object.getPrototypeOf(t) !== e.prototype || Object.getOwnPropertyDescriptor(t, "toJSON") || e.date !== void 0 && !Object.is(Date.prototype.getTime.call(t), e.date) || e.length !== void 0 && t.length !== e.length) return !1;
|
|
1358
1378
|
const o = Object.keys(t);
|
|
1359
|
-
return o.length === r.length && r.every((a, s) => o[s] === a && Object.is(
|
|
1379
|
+
return o.length === r.length && r.every((a, s) => o[s] === a && Object.is(se(t, a), n[s]));
|
|
1360
1380
|
}
|
|
1361
|
-
function
|
|
1362
|
-
|
|
1363
|
-
|
|
1381
|
+
function In(e) {
|
|
1382
|
+
return Ft(e);
|
|
1383
|
+
}
|
|
1384
|
+
function $n(e) {
|
|
1385
|
+
return Ft(e, /* @__PURE__ */ new Set());
|
|
1386
|
+
}
|
|
1387
|
+
function Ft(e, t) {
|
|
1388
|
+
const r = [];
|
|
1389
|
+
return $t(e, r, /* @__PURE__ */ new Set(), { nodes: 0 }, 0, t), () => {
|
|
1364
1390
|
try {
|
|
1365
|
-
return
|
|
1391
|
+
return r.every(Rn);
|
|
1366
1392
|
} catch {
|
|
1367
1393
|
return !1;
|
|
1368
1394
|
}
|
|
1369
1395
|
};
|
|
1370
1396
|
}
|
|
1371
|
-
function
|
|
1372
|
-
if (
|
|
1397
|
+
function ie(e, t, r, n = !1) {
|
|
1398
|
+
if (It(t, r), n) {
|
|
1373
1399
|
if (typeof e == "function" || typeof e == "symbol") throw new M("conflict");
|
|
1374
|
-
e !== null && typeof e == "object" &&
|
|
1400
|
+
e !== null && typeof e == "object" && Le(e);
|
|
1375
1401
|
}
|
|
1376
1402
|
if (e === null || typeof e != "object") return e;
|
|
1377
1403
|
if (e instanceof Date) return new Date(Date.prototype.getTime.call(e));
|
|
1378
1404
|
if (Array.isArray(e)) {
|
|
1379
1405
|
const o = [];
|
|
1380
|
-
for (let a = 0; a < e.length; a++) o[a] =
|
|
1406
|
+
for (let a = 0; a < e.length; a++) o[a] = ie(se(e, String(a)), t, r + 1, n);
|
|
1381
1407
|
return o;
|
|
1382
1408
|
}
|
|
1383
|
-
return Object.fromEntries(Object.keys(e).map((o) => [o,
|
|
1409
|
+
return Object.fromEntries(Object.keys(e).map((o) => [o, ie(se(e, o), t, r + 1, n)]));
|
|
1384
1410
|
}
|
|
1385
|
-
function
|
|
1386
|
-
return
|
|
1411
|
+
function Fn(e) {
|
|
1412
|
+
return ie(e, { nodes: 0 }, 0, !0);
|
|
1387
1413
|
}
|
|
1388
|
-
function
|
|
1389
|
-
const t =
|
|
1390
|
-
for (const r of t) for (const n of Object.values(r.datasets))
|
|
1414
|
+
function On(e) {
|
|
1415
|
+
const t = ie(e, { nodes: 0 }, 0);
|
|
1416
|
+
for (const r of t) for (const n of Object.values(r.datasets)) qt(n);
|
|
1391
1417
|
return t;
|
|
1392
1418
|
}
|
|
1393
|
-
async function
|
|
1394
|
-
return (await
|
|
1419
|
+
async function An(e, t, r = {}) {
|
|
1420
|
+
return (await Ot(e, t, r)).plan;
|
|
1395
1421
|
}
|
|
1396
|
-
async function
|
|
1397
|
-
return
|
|
1422
|
+
async function Ot(e, t, r = {}) {
|
|
1423
|
+
return wt(e, t, { ...r, knownTotalPages: void 0 });
|
|
1398
1424
|
}
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
return he.get(e);
|
|
1425
|
+
function Kn(e) {
|
|
1426
|
+
return e.computed || e.groupBy || e.groups || e.grandTotal || e.tree || e.matrix || e.detail || e.rowVisibleWhen || e.headerGrid ? !1 : e.columns.every((t) => !t.format && !t.rules && !t.visibleWhen && !t.visual);
|
|
1402
1427
|
}
|
|
1403
|
-
function
|
|
1428
|
+
function Nn(e, t) {
|
|
1429
|
+
return e.length !== t.length || t.some((r) => r?.measurer || r?.formula || r?.mmPerRow || r?.knownTotalPages !== void 0) ? !1 : e.every((r) => !r.template.repeat && r.template.pages.every((n) => !n.flow && n.components.every((o) => o.kind === "list" ? Kn(o) : !o.binding && !o.chartBinding && !o.grid && !o.table && !o.richParagraphs)));
|
|
1430
|
+
}
|
|
1431
|
+
function jn(e) {
|
|
1432
|
+
const t = /* @__PURE__ */ new Map();
|
|
1433
|
+
for (const r of e) {
|
|
1434
|
+
if (!r.source || typeof r.value != "string" || typeof r.previousValue != "string" || r.previousText !== r.previousValue || ![r.previousValue, r.value].every((a) => a.trim().length && a.length <= 16384 && !/[\r\n]/.test(a))) return null;
|
|
1435
|
+
const n = ae(r.source), o = t.get(n) ?? /* @__PURE__ */ new Map();
|
|
1436
|
+
o.set(r.source.field, r), t.set(n, o);
|
|
1437
|
+
}
|
|
1438
|
+
return t;
|
|
1439
|
+
}
|
|
1440
|
+
function He(e) {
|
|
1441
|
+
return !e.source && !e.formula && !e.derived && !e.richParagraphs && !e.children && !e.dataBar && !e.numberFormat && !e.colSpan && !e.rowSpan && !e.indentMm && !e.style?.rotateDeg;
|
|
1442
|
+
}
|
|
1443
|
+
function Ln(e) {
|
|
1444
|
+
return e.pages.every((t) => t.components.every((r) => !r.grid || r.grid.cells.every((n) => n.every((o) => !!o && He(o)))));
|
|
1445
|
+
}
|
|
1446
|
+
function Hn(e, t, r, n) {
|
|
1447
|
+
if (!He(e) || e.value !== t.previousValue || e.text !== t.previousText) return !1;
|
|
1448
|
+
const o = r - n * 2, a = e.style, s = Z(a).fontSizePt;
|
|
1449
|
+
if (!Number.isFinite(o) || o < 1 || !Number.isFinite(s) || s <= 0) return !1;
|
|
1450
|
+
const i = { fontSizePt: s, fontFamily: a?.fontFamily ?? ke, italic: a?.italic, bold: a?.bold, letterSpacingPt: a?.letterSpacing };
|
|
1451
|
+
return B(t.previousText, o, i, re).length === B(t.value, o, i, re).length;
|
|
1452
|
+
}
|
|
1453
|
+
function Dn(e, t) {
|
|
1454
|
+
const r = e.colWidthsMm;
|
|
1455
|
+
if (!r || r.length !== e.cells[0].length || r.length !== t.table.columnKeys.length) return !1;
|
|
1456
|
+
const n = r.reduce((o, a) => o + a, 0);
|
|
1457
|
+
return Number.isFinite(n) && Math.abs(n - t.widthMm) <= Math.max(1e-7, n * 1e-10);
|
|
1458
|
+
}
|
|
1459
|
+
function Bn(e, t, r) {
|
|
1460
|
+
const n = e.table?.source;
|
|
1461
|
+
if (e.table?.role !== "body" || n?.rowKey === void 0) return e;
|
|
1462
|
+
const o = t.get(ae({ ...n, rowKey: n.rowKey }));
|
|
1463
|
+
if (!o) return e;
|
|
1464
|
+
const a = e.grid;
|
|
1465
|
+
if (!a || a.cells.length !== 1 || !Dn(a, e) || e.style?.rotateDeg) return null;
|
|
1466
|
+
const s = a.cells[0], i = [...s];
|
|
1467
|
+
for (let c = 0; c < s.length; c++) {
|
|
1468
|
+
const l = s[c];
|
|
1469
|
+
if (!l || !He(l)) return null;
|
|
1470
|
+
const u = o.get(e.table.columnKeys[c]);
|
|
1471
|
+
if (u) {
|
|
1472
|
+
if (!Hn(l, u, a.colWidthsMm[c], a.paddingMm ?? 0.5)) return null;
|
|
1473
|
+
i[c] = { ...l, value: u.value, text: u.value }, r.add(u);
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
return i.some((c, l) => c !== s[l]) ? { ...e, grid: { ...a, cells: [i] } } : e;
|
|
1477
|
+
}
|
|
1478
|
+
async function Gn(e, t, r) {
|
|
1479
|
+
const n = jn(t);
|
|
1480
|
+
if (!n || !t.length) return null;
|
|
1481
|
+
const o = /* @__PURE__ */ new Set(), a = [];
|
|
1482
|
+
let s = 0;
|
|
1483
|
+
for (const c of e.pages) {
|
|
1484
|
+
const l = [];
|
|
1485
|
+
for (const u of c.components) {
|
|
1486
|
+
if (r?.aborted) return null;
|
|
1487
|
+
const f = Bn(u, n, o);
|
|
1488
|
+
if (!f) return null;
|
|
1489
|
+
l.push(f), ++s % 128 === 0 && await new Promise((d) => setTimeout(d, 0));
|
|
1490
|
+
}
|
|
1491
|
+
a.push(l.some((u, f) => u !== c.components[f]) ? { ...c, components: l } : c);
|
|
1492
|
+
}
|
|
1493
|
+
if (o.size !== t.length) return null;
|
|
1494
|
+
const i = { ...e, pages: a };
|
|
1495
|
+
return Ie(i).ok ? i : null;
|
|
1496
|
+
}
|
|
1497
|
+
function Wn(e, t, r) {
|
|
1498
|
+
let n = Nn(t, r), o = e, a;
|
|
1499
|
+
function s(c) {
|
|
1500
|
+
if (o = c, a = void 0, !!n) {
|
|
1501
|
+
if (!Ln(c)) {
|
|
1502
|
+
n = !1;
|
|
1503
|
+
return;
|
|
1504
|
+
}
|
|
1505
|
+
try {
|
|
1506
|
+
a = $n(c);
|
|
1507
|
+
} catch {
|
|
1508
|
+
n = !1;
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
s(e);
|
|
1513
|
+
async function i(c, l, u) {
|
|
1514
|
+
if (!n || c !== o || !a?.()) return null;
|
|
1515
|
+
const f = a, d = await Gn(c, l, u);
|
|
1516
|
+
return d && f() ? { plan: d, unchanged: f } : null;
|
|
1517
|
+
}
|
|
1518
|
+
return { candidate: i, publish: s };
|
|
1519
|
+
}
|
|
1520
|
+
const be = /* @__PURE__ */ new WeakMap();
|
|
1521
|
+
function Oo(e) {
|
|
1522
|
+
return be.get(e);
|
|
1523
|
+
}
|
|
1524
|
+
function J(e) {
|
|
1404
1525
|
if (e?.aborted) {
|
|
1405
1526
|
const t = new Error("报表重算已取消");
|
|
1406
1527
|
throw t.name = "AbortError", t;
|
|
1407
1528
|
}
|
|
1408
1529
|
}
|
|
1409
|
-
function
|
|
1530
|
+
function At(e, t) {
|
|
1410
1531
|
return e[t] === void 0 ? "" : e[t];
|
|
1411
1532
|
}
|
|
1412
|
-
function
|
|
1533
|
+
function Vn(e, t) {
|
|
1413
1534
|
if (t.edits.length > 1e4) throw new M("limit");
|
|
1414
|
-
const r =
|
|
1535
|
+
const r = W(e), n = /* @__PURE__ */ new Set(), o = [], a = t.edits.map((s) => {
|
|
1415
1536
|
const i = r(s.address);
|
|
1416
1537
|
if (!i?.source) throw new M("missing");
|
|
1417
|
-
const c =
|
|
1538
|
+
const c = O(s);
|
|
1418
1539
|
if (n.has(c)) throw new M("duplicate");
|
|
1419
|
-
if (n.add(c),
|
|
1420
|
-
return o.push(i),
|
|
1540
|
+
if (n.add(c), je(i, s) || !Object.is(i.value, s.previousValue) || (i.cell.text ?? "") !== s.previousText) throw new M("conflict");
|
|
1541
|
+
return o.push(i), te(i, s.value);
|
|
1421
1542
|
});
|
|
1422
1543
|
return { batch: { requestId: t.requestId, edits: a }, contexts: o };
|
|
1423
1544
|
}
|
|
1424
|
-
function
|
|
1425
|
-
const r =
|
|
1545
|
+
function zn(e, t) {
|
|
1546
|
+
const r = Ct(e);
|
|
1426
1547
|
return t.flatMap((n) => {
|
|
1427
1548
|
if (!n.source) throw new M("missing");
|
|
1428
1549
|
return r(n.source).map((o) => {
|
|
1429
|
-
if (!Object.is(
|
|
1550
|
+
if (!Object.is(At(o.row, n.source.field), n.previousValue)) throw new M("conflict");
|
|
1430
1551
|
if (o.binding.rowKey === n.source.field) throw new M("readonly");
|
|
1431
1552
|
return { row: o, field: n.source.field, value: n.value };
|
|
1432
1553
|
});
|
|
1433
1554
|
});
|
|
1434
1555
|
}
|
|
1435
|
-
function
|
|
1556
|
+
function he(e, t, r) {
|
|
1436
1557
|
const n = { ...e, value: t, source: { ...e.source, ...r?.revision === void 0 ? {} : { revision: r.revision }, ...r?.sourceToken === void 0 ? {} : { sourceToken: r.sourceToken } } };
|
|
1437
|
-
return n.cell = { ...e.cell, value: n.value, text:
|
|
1558
|
+
return n.cell = { ...e.cell, value: n.value, text: ee(n, n.value) }, n;
|
|
1438
1559
|
}
|
|
1439
|
-
function
|
|
1560
|
+
function Jn(e, t, r) {
|
|
1440
1561
|
if (!r || r.revision === void 0 && r.sourceToken === void 0) return [...e];
|
|
1441
|
-
const n = new Set(t.edits.flatMap((o) => o.source ? [
|
|
1442
|
-
return
|
|
1562
|
+
const n = new Set(t.edits.flatMap((o) => o.source ? [V(o.source)] : []));
|
|
1563
|
+
return Tt(e, kn(e, n, r));
|
|
1443
1564
|
}
|
|
1444
|
-
function
|
|
1445
|
-
const n = new Set(t.edits.map((o) =>
|
|
1565
|
+
function _n(e, t, r) {
|
|
1566
|
+
const n = new Set(t.edits.map((o) => V(o.source)));
|
|
1446
1567
|
for (const o of n) e.set(o, {
|
|
1447
1568
|
...e.get(o),
|
|
1448
1569
|
...r.revision !== void 0 ? { revision: r.revision } : {},
|
|
@@ -1450,74 +1571,80 @@ function An(e, t, r) {
|
|
|
1450
1571
|
});
|
|
1451
1572
|
return n;
|
|
1452
1573
|
}
|
|
1453
|
-
function
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1574
|
+
function Ao(e, t) {
|
|
1575
|
+
return De(e, t);
|
|
1576
|
+
}
|
|
1577
|
+
function De(e, t, r) {
|
|
1578
|
+
let n = t.parts;
|
|
1579
|
+
const o = t.rebuild, a = [...t.validationFormulas ?? []], s = r ? Wn(e, n, r) : void 0;
|
|
1580
|
+
let i = In(n), c = e, l;
|
|
1581
|
+
const u = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
1582
|
+
function d(b) {
|
|
1583
|
+
if (b !== c) throw new M("conflict");
|
|
1584
|
+
if (l) return l;
|
|
1585
|
+
if (!i?.()) throw new M("conflict");
|
|
1586
|
+
return On(n);
|
|
1587
|
+
}
|
|
1588
|
+
async function m(b, w, y, g = {}) {
|
|
1589
|
+
J(g.signal), w = { requestId: w.requestId, edits: w.edits.map((v) => ({ ...v, address: { ...v.address }, source: v.source ? { ...v.source } : void 0, table: v.table ? { ...v.table } : void 0 })) }, y = y.map((v) => ({ ...v, address: { ...v.address }, source: v.source ? { ...v.source } : void 0, table: v.table ? { ...v.table } : void 0, cell: { ...v.cell } })), await new Promise((v) => setTimeout(v, 0)), J(g.signal);
|
|
1590
|
+
const S = d(b), C = Tt(S, zn(S, w.edits)), T = await s?.candidate(b, w.edits, g.signal);
|
|
1591
|
+
J(g.signal);
|
|
1592
|
+
const $ = Et(T?.plan ?? await o(C, g.signal), f);
|
|
1593
|
+
J(g.signal);
|
|
1594
|
+
let N = !1, p = [], P = "allow", x = !1;
|
|
1595
|
+
function R(v) {
|
|
1596
|
+
return x = !0, p = Object.freeze(dn(C, v, g.signal, a).map((E) => Object.freeze({ ...E }))), x = !1, P = v.warningPolicy ?? "allow", p;
|
|
1471
1597
|
}
|
|
1472
|
-
return
|
|
1473
|
-
return
|
|
1474
|
-
}, validate:
|
|
1475
|
-
if (
|
|
1476
|
-
if (
|
|
1477
|
-
if (
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1598
|
+
return g.validation && R(g.validation), { plan: $, get validationIssues() {
|
|
1599
|
+
return p;
|
|
1600
|
+
}, validate: R, commit(v) {
|
|
1601
|
+
if (J(g.signal), N || c !== b) throw new M("conflict");
|
|
1602
|
+
if (T && !T.unchanged()) throw new M("conflict");
|
|
1603
|
+
if (v?.conflicts?.length) throw new M("conflict");
|
|
1604
|
+
if (x) throw new Error("候选规则校验未完成,不能提交");
|
|
1605
|
+
ln(p, P);
|
|
1606
|
+
const E = Jn(C, w, v), A = Cn($, w, v);
|
|
1607
|
+
if (v) {
|
|
1608
|
+
const K = _n(f, w, v);
|
|
1609
|
+
for (const [z, L] of u) K.has(V(L.source)) && u.set(z, he(L, L.value, v));
|
|
1483
1610
|
}
|
|
1484
|
-
return
|
|
1611
|
+
return y.forEach((K, z) => u.set(O(K), he(K, w.edits[z].value, v))), N = !0, l = E, n = void 0, i = void 0, c = A, s?.publish(c), be.set(c, h), c;
|
|
1485
1612
|
} };
|
|
1486
1613
|
}
|
|
1487
|
-
const
|
|
1614
|
+
const h = {
|
|
1488
1615
|
get plan() {
|
|
1489
|
-
return
|
|
1616
|
+
return c;
|
|
1490
1617
|
},
|
|
1491
|
-
async prepare(
|
|
1492
|
-
const
|
|
1493
|
-
return
|
|
1618
|
+
async prepare(b, w, y) {
|
|
1619
|
+
const g = Vn(b, w);
|
|
1620
|
+
return m(b, g.batch, g.contexts, y);
|
|
1494
1621
|
},
|
|
1495
|
-
async prepareHistory(
|
|
1496
|
-
if (!
|
|
1497
|
-
const
|
|
1498
|
-
if (!
|
|
1499
|
-
const E =
|
|
1500
|
-
if (
|
|
1501
|
-
|
|
1502
|
-
const
|
|
1503
|
-
if (!
|
|
1504
|
-
const
|
|
1505
|
-
return
|
|
1506
|
-
}).map((
|
|
1507
|
-
return { batch:
|
|
1622
|
+
async prepareHistory(b, w, y, g, S) {
|
|
1623
|
+
if (!g.trim() || w.length > 1e4) throw new M("limit");
|
|
1624
|
+
const C = d(b), T = Ct(C), $ = Rt(b), N = /* @__PURE__ */ new Set(), P = w.map((v) => {
|
|
1625
|
+
if (!v.source) throw new M("missing");
|
|
1626
|
+
const E = O(v);
|
|
1627
|
+
if (N.has(E)) throw new M("duplicate");
|
|
1628
|
+
N.add(E);
|
|
1629
|
+
const A = $.get(E) ?? u.get(E);
|
|
1630
|
+
if (!A?.source) throw new M("missing");
|
|
1631
|
+
const K = T(A.source)[0];
|
|
1632
|
+
return he(A, At(K.row, A.source.field));
|
|
1633
|
+
}).map((v, E) => ({ context: v, edit: te(v, w[E][y]) })).filter(({ edit: v }) => !Object.is(v.previousValue, v.value)), x = { requestId: g, edits: P.map(({ edit: v }) => v) }, R = P.map(({ context: v }) => v);
|
|
1634
|
+
return { batch: x, contexts: R, prepared: await m(b, x, R, S) };
|
|
1508
1635
|
}
|
|
1509
1636
|
};
|
|
1510
|
-
return
|
|
1637
|
+
return be.set(e, h), h;
|
|
1511
1638
|
}
|
|
1512
|
-
function
|
|
1513
|
-
const t =
|
|
1514
|
-
return
|
|
1639
|
+
function Ko(e) {
|
|
1640
|
+
const t = pt(e.template, e.datasets, e.pagination).plan;
|
|
1641
|
+
return De(t, { validationFormulas: [e.pagination?.formula], parts: [{ template: e.template, datasets: e.datasets }], rebuild: (r, n) => An(r[0].template, r[0].datasets, { ...e.pagination, signal: n }) }, [e.pagination]);
|
|
1515
1642
|
}
|
|
1516
|
-
let
|
|
1517
|
-
function
|
|
1518
|
-
return `report-${Date.now()}-${++
|
|
1643
|
+
let qn = 0;
|
|
1644
|
+
function Un() {
|
|
1645
|
+
return `report-${Date.now()}-${++qn}`;
|
|
1519
1646
|
}
|
|
1520
|
-
function
|
|
1647
|
+
function Ue(e, t, r) {
|
|
1521
1648
|
if (!r?.aborted)
|
|
1522
1649
|
try {
|
|
1523
1650
|
const n = e?.({ ...t });
|
|
@@ -1526,14 +1653,14 @@ function Ge(e, t, r) {
|
|
|
1526
1653
|
} catch {
|
|
1527
1654
|
}
|
|
1528
1655
|
}
|
|
1529
|
-
function
|
|
1530
|
-
const t = e.taskId ??
|
|
1531
|
-
|
|
1656
|
+
function Xn(e) {
|
|
1657
|
+
const t = e.taskId ?? Un(), r = (n, o, a) => {
|
|
1658
|
+
Ue(e.onEvent, { taskId: t, ...e.correlationId === void 0 ? {} : { correlationId: e.correlationId }, stage: n, status: o, ...a === void 0 ? {} : { reportId: a } }, e.signal);
|
|
1532
1659
|
};
|
|
1533
1660
|
return {
|
|
1534
1661
|
taskId: t,
|
|
1535
1662
|
progress(n, o, a) {
|
|
1536
|
-
|
|
1663
|
+
Ue(e.onEvent, { taskId: t, ...e.correlationId === void 0 ? {} : { correlationId: e.correlationId }, stage: n, status: "started", completed: o, total: a }, e.signal);
|
|
1537
1664
|
},
|
|
1538
1665
|
async run(n, o, a) {
|
|
1539
1666
|
r(n, "started", a);
|
|
@@ -1555,25 +1682,25 @@ function Nn(e) {
|
|
|
1555
1682
|
}
|
|
1556
1683
|
};
|
|
1557
1684
|
}
|
|
1558
|
-
function
|
|
1685
|
+
function Kt(e) {
|
|
1559
1686
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
1560
1687
|
const t = e, r = (n) => typeof n == "string" && n.trim().length > 0 && n.length <= 256;
|
|
1561
1688
|
return !r(t.datasetId) || !r(t.field) || t.tableId !== void 0 && !r(t.tableId) || t.reportScope !== void 0 && (typeof t.reportScope != "string" || !t.reportScope.trim() || t.reportScope.length > 4096) ? !1 : t.rowKey === void 0 ? !0 : typeof t.rowKey == "string" ? t.rowKey.trim().length > 0 && t.rowKey.length <= 1024 : typeof t.rowKey == "number" && Number.isFinite(t.rowKey);
|
|
1562
1689
|
}
|
|
1563
|
-
function
|
|
1690
|
+
function Yn(e) {
|
|
1564
1691
|
return e === "missing-source" || e === "not-applicable" || e === "not-calculable";
|
|
1565
1692
|
}
|
|
1566
|
-
function
|
|
1567
|
-
return e.target !== void 0 && !
|
|
1693
|
+
function Qn(e) {
|
|
1694
|
+
return e.target !== void 0 && !Kt(e.target) ? !1 : e.valueState === void 0 || Yn(e.valueState) && e.target !== void 0;
|
|
1568
1695
|
}
|
|
1569
|
-
function
|
|
1570
|
-
if (
|
|
1696
|
+
function No(e, t) {
|
|
1697
|
+
if (nt([], e), !Kt(t)) throw new Error("数据说明目标无效");
|
|
1571
1698
|
const r = e.fields.find((o) => o.field === t.field);
|
|
1572
1699
|
if (!r) throw new Error("数据说明字段未在契约中声明");
|
|
1573
1700
|
const n = [];
|
|
1574
1701
|
return r.description && n.push({ code: "field-definition", severity: "info", message: r.description, target: { ...t } }), r.calculation && n.push({ code: "field-calculation", severity: "info", message: r.calculation.description, target: { ...t } }), n;
|
|
1575
1702
|
}
|
|
1576
|
-
function
|
|
1703
|
+
function Nt(e, t, r = {}) {
|
|
1577
1704
|
const n = /* @__PURE__ */ new Map();
|
|
1578
1705
|
for (const a of e.pages) for (const s of a.components) {
|
|
1579
1706
|
if (s.kind !== "list" || s.tree?.input !== "nested") continue;
|
|
@@ -1585,26 +1712,26 @@ function Ot(e, t, r = {}) {
|
|
|
1585
1712
|
const o = { ...t };
|
|
1586
1713
|
for (const [a, s] of n) {
|
|
1587
1714
|
const i = Math.min(s.maxRows ?? 1e5, r.maxRows ?? 1 / 0);
|
|
1588
|
-
o[a] =
|
|
1715
|
+
o[a] = tt(t[a] ?? [], { ...s, maxRows: i }, r.signal);
|
|
1589
1716
|
}
|
|
1590
1717
|
return o;
|
|
1591
1718
|
}
|
|
1592
|
-
function
|
|
1593
|
-
return Object.values(
|
|
1719
|
+
function jo(e, t, r = {}) {
|
|
1720
|
+
return Object.values(Nt(e, t, r)).reduce((n, o) => n + o.length, 0);
|
|
1594
1721
|
}
|
|
1595
|
-
function
|
|
1596
|
-
const n =
|
|
1722
|
+
function Lo(e, t, r) {
|
|
1723
|
+
const n = mr(r), o = e?.pages.flatMap((i) => i.components).find((i) => i.kind === "list" && i.dataset === t && i.tree?.input === "nested");
|
|
1597
1724
|
if (!o || o.kind !== "list" || !o.tree) return n;
|
|
1598
1725
|
const a = n.items, s = o.tree.childrenField ?? "children";
|
|
1599
1726
|
return { ...n, items: { $ref: "#/$defs/treeNode" }, $defs: { treeNode: { ...a, properties: { ...a.properties, [s]: { anyOf: [{ type: "null" }, { type: "array", items: { $ref: "#/$defs/treeNode" } }] } } } } };
|
|
1600
1727
|
}
|
|
1601
|
-
function
|
|
1728
|
+
function jt(e, t) {
|
|
1602
1729
|
return JSON.stringify([e, t]);
|
|
1603
1730
|
}
|
|
1604
|
-
function
|
|
1605
|
-
return r === void 0 ?
|
|
1731
|
+
function Lt(e, t, r) {
|
|
1732
|
+
return r === void 0 ? jt(e, t) : JSON.stringify(["shared", r]);
|
|
1606
1733
|
}
|
|
1607
|
-
function
|
|
1734
|
+
function Ht(e, t, r) {
|
|
1608
1735
|
return e.map((n) => {
|
|
1609
1736
|
const o = n.table ? {
|
|
1610
1737
|
...n.table,
|
|
@@ -1613,7 +1740,7 @@ function jt(e, t, r) {
|
|
|
1613
1740
|
} : void 0, a = n.grid?.cells.map((s) => s.map((i) => !i || !i.source && !i.children ? i : {
|
|
1614
1741
|
...i,
|
|
1615
1742
|
...i.source ? { source: { ...i.source, sourceScope: t } } : {},
|
|
1616
|
-
...i.children ? { children:
|
|
1743
|
+
...i.children ? { children: Ht(i.children, t, r) } : {}
|
|
1617
1744
|
}));
|
|
1618
1745
|
return o || a ? {
|
|
1619
1746
|
...n,
|
|
@@ -1622,46 +1749,46 @@ function jt(e, t, r) {
|
|
|
1622
1749
|
} : n;
|
|
1623
1750
|
});
|
|
1624
1751
|
}
|
|
1625
|
-
function
|
|
1626
|
-
return
|
|
1752
|
+
function ve(e) {
|
|
1753
|
+
return Ee(e.maxChartComponents), { maxPages: e.maxPages, maxCells: e.maxCells, maxChartComponents: e.maxChartComponents ?? er, usedPages: 0, usedCells: 0, usedChartComponents: 0 };
|
|
1627
1754
|
}
|
|
1628
|
-
function
|
|
1755
|
+
function Zn(e, t) {
|
|
1629
1756
|
if (!e.repeat) return !1;
|
|
1630
1757
|
const r = Object.prototype.hasOwnProperty.call(t, e.repeat.dataset) ? t[e.repeat.dataset] : void 0;
|
|
1631
1758
|
return Array.isArray(r) && r.length === 0;
|
|
1632
1759
|
}
|
|
1633
|
-
function
|
|
1760
|
+
function eo(e) {
|
|
1634
1761
|
const t = (r) => r.grid?.cells.reduce((n, o) => n + o.reduce((a, s) => a + (s ? 1 + (s.children?.reduce((i, c) => i + t(c), 0) ?? 0) : 0), 0), 0) ?? 0;
|
|
1635
1762
|
return e.pages.reduce((r, n) => r + n.components.reduce((o, a) => o + t(a), 0), 0);
|
|
1636
1763
|
}
|
|
1637
|
-
function
|
|
1764
|
+
function Me(e, t) {
|
|
1638
1765
|
return e === void 0 ? void 0 : e - t;
|
|
1639
1766
|
}
|
|
1640
|
-
function
|
|
1767
|
+
function ge(e, t) {
|
|
1641
1768
|
return e === void 0 ? t : Math.max(1, Math.min(e, t ?? e));
|
|
1642
1769
|
}
|
|
1643
|
-
function
|
|
1644
|
-
|
|
1645
|
-
const a =
|
|
1646
|
-
if (a !== void 0 && a < 1 && r.pages.length && !
|
|
1647
|
-
if (s < 1 && r.pages.some((i) => i.components.some((c) => c.kind !== "list" && c.chartBinding))) throw new
|
|
1770
|
+
function Dt(e, t, r, n, o) {
|
|
1771
|
+
Ee(e?.maxChartComponents);
|
|
1772
|
+
const a = Me(t.maxPages, t.usedPages), s = t.maxChartComponents - t.usedChartComponents;
|
|
1773
|
+
if (a !== void 0 && a < 1 && r.pages.length && !Zn(r, n)) throw new U(0, 1);
|
|
1774
|
+
if (s < 1 && r.pages.some((i) => i.components.some((c) => c.kind !== "list" && c.chartBinding))) throw new pe(s, 1);
|
|
1648
1775
|
return {
|
|
1649
1776
|
...e,
|
|
1650
1777
|
signal: o ?? e?.signal,
|
|
1651
|
-
maxPages:
|
|
1652
|
-
maxCells:
|
|
1653
|
-
maxChartComponents:
|
|
1778
|
+
maxPages: ge(a, e?.maxPages),
|
|
1779
|
+
maxCells: ge(Me(t.maxCells, t.usedCells), e?.maxCells),
|
|
1780
|
+
maxChartComponents: ge(s, e?.maxChartComponents)
|
|
1654
1781
|
};
|
|
1655
1782
|
}
|
|
1656
|
-
function
|
|
1657
|
-
const r =
|
|
1658
|
-
if (n !== void 0 && r > n) throw new
|
|
1783
|
+
function Bt(e, t) {
|
|
1784
|
+
const r = eo(t.plan), n = Me(e.maxCells, e.usedCells);
|
|
1785
|
+
if (n !== void 0 && r > n) throw new ne(n, r);
|
|
1659
1786
|
e.usedPages += t.plan.pages.length, e.usedCells += r, e.usedChartComponents += t.chartComponents;
|
|
1660
1787
|
}
|
|
1661
|
-
function
|
|
1662
|
-
return e instanceof
|
|
1788
|
+
function Gt(e, t) {
|
|
1789
|
+
return e instanceof U && t.maxPages !== void 0 && (e.limit === t.maxPages - t.usedPages || e.limit === 0) ? new U(t.maxPages, t.usedPages + e.actual) : e instanceof ne && t.maxCells !== void 0 ? new ne(t.maxCells, t.usedCells + e.actual) : e instanceof pe && e.limit === t.maxChartComponents - t.usedChartComponents ? new pe(t.maxChartComponents, t.usedChartComponents + e.estimated) : e;
|
|
1663
1790
|
}
|
|
1664
|
-
function
|
|
1791
|
+
function Ho(e) {
|
|
1665
1792
|
if (!("mapData" in e)) return e;
|
|
1666
1793
|
const { load: t, mapData: r, ...n } = e;
|
|
1667
1794
|
return { ...n, load: async (o) => {
|
|
@@ -1670,26 +1797,26 @@ function ko(e) {
|
|
|
1670
1797
|
try {
|
|
1671
1798
|
return r(a, o);
|
|
1672
1799
|
} catch (s) {
|
|
1673
|
-
throw new
|
|
1800
|
+
throw new k("validate", `报表 ${o.reportId} 数据映射失败`, s);
|
|
1674
1801
|
}
|
|
1675
1802
|
} };
|
|
1676
1803
|
}
|
|
1677
|
-
class
|
|
1804
|
+
class k extends Error {
|
|
1678
1805
|
constructor(t, r, n) {
|
|
1679
1806
|
super(r), this.name = "ReportSourceError", this.code = t, this.cause = n;
|
|
1680
1807
|
}
|
|
1681
1808
|
}
|
|
1682
|
-
function
|
|
1809
|
+
function me(e) {
|
|
1683
1810
|
const t = new Error("报表加载已取消");
|
|
1684
1811
|
return t.name = "AbortError", Object.defineProperty(t, "cause", { value: e.reason }), t;
|
|
1685
1812
|
}
|
|
1686
1813
|
function I(e) {
|
|
1687
|
-
if (e?.aborted) throw
|
|
1814
|
+
if (e?.aborted) throw me(e);
|
|
1688
1815
|
}
|
|
1689
|
-
function
|
|
1816
|
+
function Se(e, t) {
|
|
1690
1817
|
return t ? new Promise((r, n) => {
|
|
1691
1818
|
const o = () => t.removeEventListener("abort", a), a = () => {
|
|
1692
|
-
o(), n(
|
|
1819
|
+
o(), n(me(t));
|
|
1693
1820
|
};
|
|
1694
1821
|
t.addEventListener("abort", a, { once: !0 }), t.aborted && a(), Promise.resolve(e).then(
|
|
1695
1822
|
(s) => {
|
|
@@ -1701,174 +1828,174 @@ function we(e, t) {
|
|
|
1701
1828
|
);
|
|
1702
1829
|
}) : Promise.resolve(e);
|
|
1703
1830
|
}
|
|
1704
|
-
function
|
|
1831
|
+
function to(e, t) {
|
|
1705
1832
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1706
|
-
throw new
|
|
1833
|
+
throw new k("validate", `报表 ${t} 的数据集应为对象`);
|
|
1707
1834
|
for (const [r, n] of Object.entries(e))
|
|
1708
1835
|
if (!Array.isArray(n) || n.some((o) => !o || typeof o != "object" || Array.isArray(o)))
|
|
1709
|
-
throw new
|
|
1836
|
+
throw new k("validate", `报表 ${t} 的数据集 ${r} 应为对象数组`);
|
|
1710
1837
|
}
|
|
1711
|
-
async function
|
|
1838
|
+
async function ro(e, t, r) {
|
|
1712
1839
|
const { reportId: n, signal: o } = t;
|
|
1713
1840
|
try {
|
|
1714
|
-
const a = await
|
|
1841
|
+
const a = await Se(e(t), o);
|
|
1715
1842
|
I(o);
|
|
1716
|
-
const s =
|
|
1843
|
+
const s = cr(a);
|
|
1717
1844
|
if (!s.ok)
|
|
1718
|
-
throw new
|
|
1845
|
+
throw new k("validate", `报表 ${n} 模板校验失败:${s.errors.slice(0, 3).map((i) => `${i.path}: ${i.message}`).join("; ")}`);
|
|
1719
1846
|
return r.push(...s.warnings.map((i) => `${n}: ${i.path}: ${i.message}`)), a;
|
|
1720
1847
|
} catch (a) {
|
|
1721
|
-
throw o?.aborted ?
|
|
1848
|
+
throw o?.aborted ? me(o) : a instanceof k ? a : a instanceof lr ? new k("validate", `报表 ${n} 模板校验失败:${a.message}`, a) : new k("fetch", `报表 ${n} 模板加载失败:${a instanceof Error ? a.message : String(a)}`, a);
|
|
1722
1849
|
}
|
|
1723
1850
|
}
|
|
1724
|
-
async function
|
|
1851
|
+
async function no(e, t, r, n) {
|
|
1725
1852
|
const o = t.signal;
|
|
1726
1853
|
let a;
|
|
1727
1854
|
try {
|
|
1728
|
-
if (e.load) a = await
|
|
1855
|
+
if (e.load) a = await Se(e.load(t), o);
|
|
1729
1856
|
else if (e.provider) {
|
|
1730
|
-
const s = await
|
|
1731
|
-
I(o),
|
|
1857
|
+
const s = await Se(e.provider.query(t), o);
|
|
1858
|
+
I(o), oo(s, r), a = s.datasets, n?.(r, s);
|
|
1732
1859
|
} else a = e.datasets ?? {};
|
|
1733
1860
|
} catch (s) {
|
|
1734
|
-
throw o?.aborted ?
|
|
1861
|
+
throw o?.aborted ? me(o) : s instanceof k ? s : new k("fetch", `报表 ${r} 取数失败:${s instanceof Error ? s.message : String(s)}`, s);
|
|
1735
1862
|
}
|
|
1736
1863
|
return I(o), a;
|
|
1737
1864
|
}
|
|
1738
|
-
function
|
|
1739
|
-
if (!e || typeof e != "object" || Array.isArray(e)) throw new
|
|
1865
|
+
function oo(e, t) {
|
|
1866
|
+
if (!e || typeof e != "object" || Array.isArray(e)) throw new k("validate", `报表 ${t} Provider 应返回 datasets 结果对象`);
|
|
1740
1867
|
for (const r of ["revision", "sourceToken"])
|
|
1741
|
-
if (e[r] !== void 0 && typeof e[r] != "string") throw new
|
|
1868
|
+
if (e[r] !== void 0 && typeof e[r] != "string") throw new k("validate", `报表 ${t} Provider ${r} 应为字符串`);
|
|
1742
1869
|
if (e.diagnostics !== void 0 && (!Array.isArray(e.diagnostics) || e.diagnostics.some((r) => !r || typeof r.code != "string" || typeof r.message != "string" || !["info", "warning", "error"].includes(r.severity))))
|
|
1743
|
-
throw new
|
|
1744
|
-
if (e.diagnostics?.some((r) => !
|
|
1745
|
-
throw new
|
|
1870
|
+
throw new k("validate", `报表 ${t} Provider diagnostics 不符合结构化诊断契约`);
|
|
1871
|
+
if (e.diagnostics?.some((r) => !Qn(r)))
|
|
1872
|
+
throw new k("validate", `报表 ${t} Provider 数据说明缺少有效的字段身份或值状态`);
|
|
1746
1873
|
}
|
|
1747
|
-
function
|
|
1874
|
+
function ao(e, t, r, n, o) {
|
|
1748
1875
|
try {
|
|
1749
|
-
t =
|
|
1876
|
+
t = Nt(n, t, { maxRows: e.dataValidation?.maxRows, signal: o });
|
|
1750
1877
|
} catch (a) {
|
|
1751
|
-
throw new
|
|
1878
|
+
throw new k("validate", `报表 ${r} 树形数据无效:${a instanceof Error ? a.message : String(a)}`, a);
|
|
1752
1879
|
}
|
|
1753
1880
|
for (const [a, s] of Object.entries(e.dataSchema ?? {})) {
|
|
1754
1881
|
let i;
|
|
1755
1882
|
try {
|
|
1756
|
-
i =
|
|
1883
|
+
i = nt(Object.prototype.hasOwnProperty.call(t, a) ? t[a] : void 0, s, { ...e.dataValidation, path: `$.datasets.${a}` });
|
|
1757
1884
|
} catch (c) {
|
|
1758
|
-
throw new
|
|
1885
|
+
throw new k("config", `报表 ${r} 数据集 ${a} 字段契约配置无效`, c);
|
|
1759
1886
|
}
|
|
1760
|
-
if (!i.ok) throw new
|
|
1887
|
+
if (!i.ok) throw new k("validate", `报表 ${r} 数据集 ${a} 不符合字段契约:${i.issues[0]?.message}`, { issues: i.issues });
|
|
1761
1888
|
}
|
|
1762
1889
|
}
|
|
1763
|
-
async function
|
|
1890
|
+
async function so(e, t, r, n, o) {
|
|
1764
1891
|
try {
|
|
1765
1892
|
let a;
|
|
1766
1893
|
try {
|
|
1767
|
-
a =
|
|
1894
|
+
a = Fn(e);
|
|
1768
1895
|
} catch {
|
|
1769
1896
|
}
|
|
1770
|
-
const s = a ?? e, i =
|
|
1771
|
-
return
|
|
1897
|
+
const s = a ?? e, i = Dt(t.pagination, n, s.template, s.datasets, o), c = a ? await wt(s.template, s.datasets, i) : pt(s.template, s.datasets, i);
|
|
1898
|
+
return Bt(n, c), { result: c, part: s };
|
|
1772
1899
|
} catch (a) {
|
|
1773
1900
|
I(o);
|
|
1774
|
-
const s =
|
|
1775
|
-
throw new
|
|
1901
|
+
const s = Gt(a, n);
|
|
1902
|
+
throw new k("validate", `报表 ${r} 排版失败:${s instanceof Error ? s.message : String(s)}`, s);
|
|
1776
1903
|
}
|
|
1777
1904
|
}
|
|
1778
|
-
function
|
|
1905
|
+
function Wt(e, t, r, n, o) {
|
|
1779
1906
|
const a = /* @__PURE__ */ new Map(), s = (i) => {
|
|
1780
1907
|
let c = a.get(i);
|
|
1781
1908
|
return c === void 0 && (c = JSON.stringify([r, n, i]), a.set(i, c)), c;
|
|
1782
1909
|
};
|
|
1783
1910
|
for (const i of t.pages) e.push({
|
|
1784
1911
|
...i,
|
|
1785
|
-
meta: { ...i.meta, reportScope:
|
|
1786
|
-
components:
|
|
1912
|
+
meta: { ...i.meta, reportScope: jt(r, n) },
|
|
1913
|
+
components: Ht(i.components, o ?? Lt(r, n), s)
|
|
1787
1914
|
});
|
|
1788
1915
|
}
|
|
1789
|
-
async function
|
|
1790
|
-
const a = [], s =
|
|
1916
|
+
async function io(e, t, r, n, o) {
|
|
1917
|
+
const a = [], s = ve(n);
|
|
1791
1918
|
for (const [l, u] of e.entries()) {
|
|
1792
1919
|
I(o);
|
|
1793
1920
|
try {
|
|
1794
|
-
const f = await
|
|
1795
|
-
|
|
1921
|
+
const f = await Ot(u.template, u.datasets, Dt(t[l]?.pagination, s, u.template, u.datasets, o));
|
|
1922
|
+
Bt(s, f), Wt(a, f.plan, l, r[l], u.sourceScope);
|
|
1796
1923
|
} catch (f) {
|
|
1797
|
-
throw
|
|
1924
|
+
throw Gt(f, s);
|
|
1798
1925
|
}
|
|
1799
1926
|
}
|
|
1800
|
-
const i = { schemaVersion:
|
|
1801
|
-
if (!c.ok) throw new
|
|
1927
|
+
const i = { schemaVersion: Pe, ...e.some((l) => $e(l.template)) ? { requiresRecalculation: !0 } : {}, pages: a }, c = Ie(i);
|
|
1928
|
+
if (!c.ok) throw new k("validate", `重算渲染计划校验失败:${c.errors[0]?.message}`);
|
|
1802
1929
|
return i;
|
|
1803
1930
|
}
|
|
1804
|
-
function
|
|
1805
|
-
if (t.maxPages !== void 0 && (!Number.isSafeInteger(t.maxPages) || t.maxPages < 1)) throw new
|
|
1806
|
-
if (t.maxCells !== void 0 && (!Number.isSafeInteger(t.maxCells) || t.maxCells < 1)) throw new
|
|
1931
|
+
function Do(e, t = {}) {
|
|
1932
|
+
if (t.maxPages !== void 0 && (!Number.isSafeInteger(t.maxPages) || t.maxPages < 1)) throw new k("config", "maxPages 应为正安全整数");
|
|
1933
|
+
if (t.maxCells !== void 0 && (!Number.isSafeInteger(t.maxCells) || t.maxCells < 1)) throw new k("config", "maxCells 应为正安全整数");
|
|
1807
1934
|
try {
|
|
1808
|
-
|
|
1935
|
+
ve(t);
|
|
1809
1936
|
} catch (o) {
|
|
1810
|
-
throw new
|
|
1937
|
+
throw new k("config", "maxChartComponents 应为 1..1000000 的安全整数", o);
|
|
1811
1938
|
}
|
|
1812
1939
|
function r(o) {
|
|
1813
1940
|
const a = Object.prototype.hasOwnProperty.call(e, o) ? e[o] : void 0;
|
|
1814
|
-
if (!a) throw new
|
|
1815
|
-
if (a.sourceScope !== void 0 && (typeof a.sourceScope != "string" || !a.sourceScope.trim() || a.sourceScope.length > 512)) throw new
|
|
1941
|
+
if (!a) throw new k("config", `未注册报表 ${o}`);
|
|
1942
|
+
if (a.sourceScope !== void 0 && (typeof a.sourceScope != "string" || !a.sourceScope.trim() || a.sourceScope.length > 512)) throw new k("config", "sourceScope 应为不超过 512 字符的非空字符串");
|
|
1816
1943
|
return a;
|
|
1817
1944
|
}
|
|
1818
1945
|
return Object.assign(async ({ reportIds: o, params: a, signal: s, onWarning: i, onQueryResult: c, ...l }) => {
|
|
1819
1946
|
I(s);
|
|
1820
|
-
const u =
|
|
1821
|
-
if (f.length === 0) throw new
|
|
1822
|
-
const
|
|
1823
|
-
|
|
1947
|
+
const u = Xn({ ...l, signal: s }), f = [...o], d = { ...a };
|
|
1948
|
+
if (f.length === 0) throw new k("config", "缺少报表 ID");
|
|
1949
|
+
const m = f.map(r), h = u.runSync("validate", () => m.map((p) => Be(
|
|
1950
|
+
p.params ?? (typeof p.template == "function" ? [] : p.template.params) ?? [],
|
|
1824
1951
|
d
|
|
1825
|
-
))),
|
|
1826
|
-
for (const [
|
|
1952
|
+
))), b = [], w = [], y = ve(t), g = [];
|
|
1953
|
+
for (const [p, P] of m.entries()) {
|
|
1827
1954
|
I(s);
|
|
1828
|
-
const
|
|
1829
|
-
|
|
1830
|
-
const
|
|
1955
|
+
const x = f[p], R = { reportId: x, params: h[p], signal: s }, v = typeof P.template == "function" ? await u.run("query", () => ro(P.template, R, g), x) : P.template;
|
|
1956
|
+
R.params = u.runSync("validate", () => Be(P.params ?? v.params ?? [], R.params), x);
|
|
1957
|
+
const E = await u.run("query", () => no(P, R, x, (L, Vt) => c?.(L, Vt, p)), x);
|
|
1831
1958
|
u.runSync("validate", () => {
|
|
1832
|
-
|
|
1833
|
-
},
|
|
1834
|
-
const
|
|
1835
|
-
|
|
1959
|
+
to(E, x), t.onDatasets?.(x, E, v), ao(P, E, x, v, s);
|
|
1960
|
+
}, x), I(s);
|
|
1961
|
+
const A = Lt(p, x, P.sourceScope), { result: K, part: z } = await u.run("layout", () => so({ template: v, datasets: E, sourceScope: A }, P, x, y, s), x);
|
|
1962
|
+
w.push(z), Wt(b, K.plan, p, x, A), g.push(...K.warnings.map((L) => `${x}: ${L}`));
|
|
1836
1963
|
}
|
|
1837
1964
|
I(s);
|
|
1838
|
-
const
|
|
1839
|
-
const
|
|
1840
|
-
if (!
|
|
1841
|
-
return
|
|
1965
|
+
const S = { schemaVersion: Pe, ...w.some((p) => $e(p.template)) ? { requiresRecalculation: !0 } : {}, pages: b }, C = u.runSync("validate", () => {
|
|
1966
|
+
const p = Ie(S);
|
|
1967
|
+
if (!p.ok) throw new k("validate", `渲染计划校验失败:${p.errors.slice(0, 3).map((P) => `${P.path}: ${P.message}`).join("; ")}`);
|
|
1968
|
+
return p;
|
|
1842
1969
|
});
|
|
1843
|
-
|
|
1844
|
-
const T =
|
|
1970
|
+
g.push(...C.warnings.map((p) => `${p.path}: ${p.message}`));
|
|
1971
|
+
const T = m.map((p) => ({ ...p, pagination: { ...p.pagination } })), $ = { maxPages: t.maxPages, maxCells: t.maxCells, maxChartComponents: t.maxChartComponents };
|
|
1845
1972
|
try {
|
|
1846
|
-
|
|
1973
|
+
De(S, { parts: w, validationFormulas: T.map((p) => p.pagination?.formula), rebuild: (p, P) => io(p, T, f, $, P) }, T.map((p) => p.pagination));
|
|
1847
1974
|
} catch {
|
|
1848
|
-
|
|
1975
|
+
g.push("来源数据无法建立本地重算口径;当前预览仅支持计划内编辑,请使用可序列化模板数据启用规则重算");
|
|
1849
1976
|
}
|
|
1850
|
-
const
|
|
1851
|
-
for (const
|
|
1852
|
-
I(s),
|
|
1853
|
-
return I(s),
|
|
1977
|
+
const N = i ?? t.onWarning ?? ((p) => console.warn("[mach-report]", p));
|
|
1978
|
+
for (const p of g)
|
|
1979
|
+
I(s), N(p);
|
|
1980
|
+
return I(s), S;
|
|
1854
1981
|
}, {
|
|
1855
|
-
getParamDefs: (o) =>
|
|
1982
|
+
getParamDefs: (o) => dr(e, o)
|
|
1856
1983
|
});
|
|
1857
1984
|
}
|
|
1858
|
-
const
|
|
1859
|
-
function
|
|
1985
|
+
const co = /* @__PURE__ */ new Set([8, 9, 10, 12, 13]);
|
|
1986
|
+
function lo(e, t) {
|
|
1860
1987
|
const r = Array.isArray(e), n = Object.getPrototypeOf(e);
|
|
1861
1988
|
if (n !== (r ? Array.prototype : Object.prototype) && !(n === null && !r) || Object.getOwnPropertySymbols(e).length) throw t("input", "快照应为普通 JSON 对象");
|
|
1862
1989
|
const o = Object.getOwnPropertyNames(e).filter((a) => !(r && a === "length"));
|
|
1863
1990
|
if (r && (o.length !== e.length || o.some((a, s) => a !== String(s)))) throw t("input", "快照数组应为连续数组");
|
|
1864
1991
|
return { array: r, keys: o };
|
|
1865
1992
|
}
|
|
1866
|
-
function
|
|
1993
|
+
function uo(e) {
|
|
1867
1994
|
if (/^[\u0020-\u007e]*$/.test(e) && !/["\\]/.test(e)) return e.length + 2;
|
|
1868
1995
|
let t = 2;
|
|
1869
1996
|
for (let r = 0; r < e.length; r++) {
|
|
1870
1997
|
const n = e.charCodeAt(r);
|
|
1871
|
-
if (n < 32) t +=
|
|
1998
|
+
if (n < 32) t += co.has(n) ? 2 : 6;
|
|
1872
1999
|
else if (n === 34 || n === 92) t += 2;
|
|
1873
2000
|
else if (n < 128) t++;
|
|
1874
2001
|
else if (n < 2048) t += 2;
|
|
@@ -1879,92 +2006,93 @@ function Yn(e) {
|
|
|
1879
2006
|
}
|
|
1880
2007
|
return t;
|
|
1881
2008
|
}
|
|
1882
|
-
function
|
|
2009
|
+
function Bo(e, t) {
|
|
1883
2010
|
const r = t.maxNodes ?? 1e6;
|
|
1884
2011
|
if (![t.maxBytes, r].every((d) => Number.isSafeInteger(d) && d > 0)) throw t.error("budget", "快照预算应为正安全整数");
|
|
1885
2012
|
let n = 0, o = 0;
|
|
1886
2013
|
const a = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Map();
|
|
1887
2014
|
function i(d) {
|
|
1888
2015
|
if (d.length + 2 > t.maxBytes - o) throw t.error("budget", "快照超过字节预算");
|
|
1889
|
-
const
|
|
1890
|
-
if (
|
|
1891
|
-
const
|
|
1892
|
-
return d.length <= 256 && s.size < 4096 && s.set(d,
|
|
2016
|
+
const m = s.get(d);
|
|
2017
|
+
if (m !== void 0) return m;
|
|
2018
|
+
const h = uo(d);
|
|
2019
|
+
return d.length <= 256 && s.size < 4096 && s.set(d, h), h;
|
|
1893
2020
|
}
|
|
1894
2021
|
function c(d) {
|
|
1895
2022
|
if (o += d, o > t.maxBytes) throw t.error("budget", "快照超过字节预算");
|
|
1896
2023
|
}
|
|
1897
|
-
function l(d,
|
|
1898
|
-
if (++n > r ||
|
|
2024
|
+
function l(d, m) {
|
|
2025
|
+
if (++n > r || m > 64) throw t.error("budget", "快照节点或深度超过预算");
|
|
1899
2026
|
if (n % 1024 === 0 && t.check?.(), typeof d == "string")
|
|
1900
2027
|
return c(i(d)), d;
|
|
1901
2028
|
if (d === null || typeof d == "boolean" || typeof d == "number" && Number.isFinite(d))
|
|
1902
2029
|
return c(String(d).length), typeof d == "number" && Object.is(d, -0) ? 0 : d;
|
|
1903
2030
|
if (!d || typeof d != "object" || a.has(d)) throw t.error("input", "快照应为无循环的有限 JSON 值");
|
|
1904
|
-
return u(d,
|
|
2031
|
+
return u(d, m);
|
|
1905
2032
|
}
|
|
1906
|
-
function u(d,
|
|
1907
|
-
const { array:
|
|
2033
|
+
function u(d, m) {
|
|
2034
|
+
const { array: h, keys: b } = lo(d, t.error);
|
|
1908
2035
|
a.add(d), c(2);
|
|
1909
|
-
const
|
|
1910
|
-
let
|
|
1911
|
-
for (const
|
|
1912
|
-
const
|
|
1913
|
-
if (
|
|
1914
|
-
if (
|
|
1915
|
-
c((
|
|
1916
|
-
const
|
|
1917
|
-
|
|
2036
|
+
const w = h ? [] : {};
|
|
2037
|
+
let y = 0;
|
|
2038
|
+
for (const g of b) {
|
|
2039
|
+
const S = Object.getOwnPropertyDescriptor(d, g);
|
|
2040
|
+
if (S.get || S.set || !S.enumerable || ["__proto__", "constructor", "prototype"].includes(g)) throw t.error("input", "快照不允许访问器或危险键");
|
|
2041
|
+
if (S.value === void 0 && !h) continue;
|
|
2042
|
+
c((y++ ? 1 : 0) + (h ? 0 : i(g) + 1));
|
|
2043
|
+
const C = l(S.value === void 0 ? null : S.value, m + 1);
|
|
2044
|
+
g in w ? Object.defineProperty(w, g, { value: C, enumerable: !0, configurable: !0, writable: !0 }) : w[g] = C;
|
|
1918
2045
|
}
|
|
1919
|
-
return a.delete(d),
|
|
2046
|
+
return a.delete(d), w;
|
|
1920
2047
|
}
|
|
1921
2048
|
t.check?.();
|
|
1922
2049
|
const f = l(e, 0);
|
|
1923
2050
|
return t.check?.(), f;
|
|
1924
2051
|
}
|
|
1925
2052
|
export {
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
2053
|
+
Mr as A,
|
|
2054
|
+
Ao as B,
|
|
2055
|
+
Fo as C,
|
|
1929
2056
|
Cr as D,
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
2057
|
+
O as E,
|
|
2058
|
+
$o as F,
|
|
2059
|
+
Co as G,
|
|
2060
|
+
Ue as H,
|
|
2061
|
+
Nt as I,
|
|
2062
|
+
jo as J,
|
|
2063
|
+
pn as K,
|
|
2064
|
+
Lt as L,
|
|
2065
|
+
jt as M,
|
|
2066
|
+
Un as N,
|
|
2067
|
+
je as O,
|
|
2068
|
+
te as P,
|
|
2069
|
+
Xn as Q,
|
|
2070
|
+
k as R,
|
|
2071
|
+
Lo as S,
|
|
1944
2072
|
M as a,
|
|
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
|
-
|
|
2073
|
+
nn as b,
|
|
2074
|
+
Eo as c,
|
|
2075
|
+
Ho as d,
|
|
2076
|
+
Io as e,
|
|
2077
|
+
Cn as f,
|
|
2078
|
+
Et as g,
|
|
2079
|
+
ln as h,
|
|
2080
|
+
xo as i,
|
|
2081
|
+
To as j,
|
|
2082
|
+
Ro as k,
|
|
2083
|
+
W as l,
|
|
2084
|
+
Ko as m,
|
|
2085
|
+
Do as n,
|
|
2086
|
+
ko as o,
|
|
2087
|
+
xt as p,
|
|
2088
|
+
No as q,
|
|
2089
|
+
ee as r,
|
|
2090
|
+
Bo as s,
|
|
2091
|
+
Ne as t,
|
|
2092
|
+
Oo as u,
|
|
2093
|
+
Qn as v,
|
|
2094
|
+
Kt as w,
|
|
2095
|
+
Yn as x,
|
|
2096
|
+
pt as y,
|
|
2097
|
+
Po as z
|
|
1970
2098
|
};
|