@agile-team/mach-report 2.16.0 → 2.17.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 +10 -6
- package/dist/{ExcelBindingWizard-CP6h2x1f.cjs → ExcelBindingWizard-Bq6FYME6.cjs} +1 -1
- package/dist/{ExcelBindingWizard-HhB3hAJE.js → ExcelBindingWizard-Co1svTsw.js} +3 -3
- package/dist/{ParamEditor-CUQLgoxa.cjs → ParamEditor-B5UZRgxv.cjs} +1 -1
- package/dist/{ParamEditor-OKesP_nO.js → ParamEditor-DNNARyeB.js} +1 -1
- package/dist/{ReportBatchPanel-cZCAMAwH.cjs → ReportBatchPanel-Ctvs2t_9.cjs} +1 -1
- package/dist/{ReportBatchPanel-ruxcbfY6.js → ReportBatchPanel-uQh06usx.js} +1 -1
- package/dist/ReportPreview-BdQawRh0.js +4879 -0
- package/dist/ReportPreview-CJC_-j2I.cjs +6 -0
- package/dist/{ReportTemplateLibrary-BDlNT8JN.cjs → ReportTemplateLibrary-CnP7_1pH.cjs} +1 -1
- package/dist/{ReportTemplateLibrary-DcwrH-63.js → ReportTemplateLibrary-TIL_Oj2l.js} +1 -1
- package/dist/RuleEditor-DkRjOLlr.js +2141 -0
- package/dist/RuleEditor-h5anGsDB.cjs +1 -0
- package/dist/{TemplateOutlinePanel-CGrT5DFN.cjs → TemplateOutlinePanel-BlLxRrfu.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-SXCjaPKR.js → TemplateOutlinePanel-BouxsuqQ.js} +1 -1
- package/dist/{TemplateReusePanel-lHLOS9Wn.js → TemplateReusePanel-BEACLPaN.js} +2 -2
- package/dist/{TemplateReusePanel-6Z3wRFz8.cjs → TemplateReusePanel-yxsHSO40.cjs} +1 -1
- package/dist/{TemplateReviewPanel-CJ9PLc48.js → TemplateReviewPanel-B1OGRY2i.js} +1 -1
- package/dist/{TemplateReviewPanel-Dpk7sLcF.cjs → TemplateReviewPanel-D9Cx0m2N.cjs} +1 -1
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.d.cts +63 -1
- package/dist/analytics.d.ts +63 -1
- package/dist/analytics.js +4 -4
- package/dist/artifact-integrity.json +86 -90
- package/dist/assets-BIMVwjQe.js +231 -0
- package/dist/assets-Dfs2ElxI.cjs +1 -0
- package/dist/{auto-YR7a4BtF.js → auto-BIOmtVhk.js} +14 -14
- package/dist/{auto-uVBjX1j5.cjs → auto-DDHflI9v.cjs} +1 -1
- package/dist/computed-BW5a8QFk.js +612 -0
- package/dist/computed-C2GD3XcE.cjs +1 -0
- package/dist/dataset-DL83majE.js +161 -0
- package/dist/dataset-IrlXbUvh.cjs +1 -0
- package/dist/{designer-BfQSahxq.js → designer-D9XAxqSc.js} +1194 -1179
- package/dist/designer-uCDo5XSK.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +125 -3
- package/dist/designer.d.ts +125 -3
- package/dist/designer.js +1 -1
- package/dist/{drill-CsdjgkRM.cjs → drill-ByN8COs_.cjs} +1 -1
- package/dist/{drill-DIGsZfyB.js → drill-CKW3Xtfa.js} +11 -11
- package/dist/{encoding-BYF9ZTl9.cjs → encoding-BFMFIc4r.cjs} +1 -1
- package/dist/{encoding-BOGq4qYL.js → encoding-DP_Eaf0A.js} +2 -2
- package/dist/{font-loader-EKLzOJxf.cjs → font-loader-7FWVlykp.cjs} +1 -1
- package/dist/{font-loader-CzI1GuBc.js → font-loader-CQZowp0I.js} +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +173 -1
- package/dist/index.d.ts +173 -1
- package/dist/index.js +1205 -808
- package/dist/json-snapshot-D7PE1NsU.cjs +2 -0
- package/dist/{json-snapshot-D6ioHth9.js → json-snapshot-DYmEe3sO.js} +769 -692
- package/dist/matrix-JLAXlux-.js +302 -0
- package/dist/matrix-gTHpDTGm.cjs +1 -0
- package/dist/{pdf-ByVCb1i6.cjs → pdf-B8JouyYv.cjs} +47 -47
- package/dist/{pdf-DJ5S6ukC.js → pdf-l3ea86di.js} +13 -15
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.d.cts +12 -0
- package/dist/pdf.d.ts +12 -0
- package/dist/pdf.js +2 -2
- package/dist/{plugin-C2j5_mhx.js → plugin-BBp74CQZ.js} +1 -1
- package/dist/{plugin-Dr39GBRG.cjs → plugin-CtFX9PFG.cjs} +1 -1
- package/dist/{prepared-DqtpvRTn.js → prepared-CARicKYh.js} +1 -1
- package/dist/{prepared-DdrjLC7L.cjs → prepared-Ch1x_Gog.cjs} +1 -1
- package/dist/{protocol-BzwMP4Vw.cjs → protocol-B5A2uom4.cjs} +1 -1
- package/dist/{protocol-kt4Iy6-3.js → protocol-BaiWjq5w.js} +3 -3
- package/dist/{record-bindings-DUX1VMlR.cjs → record-bindings-B86Sur_y.cjs} +1 -1
- package/dist/{record-bindings-CZWBJ1fU.js → record-bindings-D4TuMzHs.js} +1 -1
- package/dist/{region-binding-workflow-CWNvIjkV.js → region-binding-workflow-BNasF5kz.js} +2 -2
- package/dist/{region-binding-workflow-CqSMxQ4p.cjs → region-binding-workflow-O2Cni3mF.cjs} +1 -1
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/runtime-DakRXui3.js +170 -0
- package/dist/runtime-dL5ygIfa.cjs +1 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server/node.d.cts +46 -0
- package/dist/server/node.d.ts +46 -0
- package/dist/server-node.cjs +4 -4
- package/dist/server-node.js +2540 -1911
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +174 -1
- package/dist/server.d.ts +174 -1
- package/dist/server.js +787 -544
- package/dist/style.css +1 -1
- package/dist/template-catalog-Dua8h9ZA.cjs +1 -0
- package/dist/{template-catalog-BtR2JmCL.js → template-catalog-wT1fNeAP.js} +4 -4
- package/dist/{template-fragments-BVsbxs4a.cjs → template-fragments-BajTajb4.cjs} +1 -1
- package/dist/{template-fragments-By0aZC1D.js → template-fragments-DmX5XK4N.js} +1 -1
- package/dist/{template-registry-C62vpv4a.cjs → template-registry-CpysHAxy.cjs} +1 -1
- package/dist/{template-registry-Cw3vRTX2.js → template-registry-u11fPd8D.js} +5 -5
- package/dist/{tree-BX380Rr7.cjs → tree-CLpxYbKa.cjs} +1 -1
- package/dist/{tree-CjVZLRw7.js → tree-DNJorJUf.js} +1 -1
- package/dist/vue/async.d.cts +108 -2
- package/dist/vue/async.d.ts +108 -2
- package/dist/vue/index.d.cts +130 -3
- package/dist/vue/index.d.ts +130 -3
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +4 -4
- package/dist/{workbook-session-BeSO8PFB.js → workbook-session-B8pNW24X.js} +1 -1
- package/dist/{workbook-session-Cbts-22R.cjs → workbook-session-DN5LSA5C.cjs} +1 -1
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.d.cts +88 -2
- package/dist/xlsx.d.ts +88 -2
- package/dist/xlsx.js +232 -230
- package/package.json +1 -1
- package/dist/ReportPreview-BcDKCLiK.js +0 -4834
- package/dist/ReportPreview-Bk9nLfO9.cjs +0 -6
- package/dist/RuleEditor-BX5S8RSF.cjs +0 -1
- package/dist/RuleEditor-CGl9XY2s.js +0 -2037
- package/dist/assets-CqIbfbTr.js +0 -126
- package/dist/assets-e4YSke8n.cjs +0 -1
- package/dist/capabilities-DDwXr_cA.js +0 -103
- package/dist/capabilities-DNLyZdNw.cjs +0 -1
- package/dist/computed-C-4C2S5h.js +0 -521
- package/dist/computed-CGV2a809.cjs +0 -1
- package/dist/dataset-BkRmwgeJ.cjs +0 -1
- package/dist/dataset-H5pFuQGU.js +0 -121
- package/dist/designer-CPPdeM5_.cjs +0 -2
- package/dist/diagnostic-notification-B9K9We3h.cjs +0 -1
- package/dist/diagnostic-notification-qGAYZdkB.js +0 -7
- package/dist/json-snapshot-DknkjvxP.cjs +0 -2
- package/dist/matrix-CGRGkn5s.js +0 -112
- package/dist/matrix-gEO7ZM_u.cjs +0 -1
- package/dist/runtime-BjKBI530.js +0 -168
- package/dist/runtime-CBFEPKEs.cjs +0 -1
- package/dist/template-catalog-C2NLdrwB.cjs +0 -1
|
@@ -1,36 +1,96 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { r as
|
|
3
|
-
import { w as
|
|
4
|
-
import { R as E, g as
|
|
5
|
-
import { e as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { f as
|
|
13
|
-
import {
|
|
14
|
-
|
|
1
|
+
import { R as Q } from "./component-tree-Ca6YYfHq.js";
|
|
2
|
+
import { r as Z, L as ge, b as $t, i as Rt, f as N, D as Ce } from "./style-67OqfNed.js";
|
|
3
|
+
import { w as J, h as Oe } from "./textwrap-BEIg2w8y.js";
|
|
4
|
+
import { c as Fe, R as E, g as Ae, b as It, i as Et, e as H, l as he, t as Ne, h as Ke, f as je, j as Ct, k as Ot } from "./record-bindings-D4TuMzHs.js";
|
|
5
|
+
import { e as Le, b as Ft, k as At, r as Nt } from "./computed-BW5a8QFk.js";
|
|
6
|
+
import { c as Kt, e as jt } from "./matrix-JLAXlux-.js";
|
|
7
|
+
import { r as ee } from "./grid-geometry-BNptEcMm.js";
|
|
8
|
+
import { f as He, a as Lt, c as Ht } from "./tree-DNJorJUf.js";
|
|
9
|
+
import { i as Dt, r as Gt, j as Bt, b as De, v as Wt, R as Vt } from "./template-registry-u11fPd8D.js";
|
|
10
|
+
import { g as Jt } from "./report-params-B1RzkhJj.js";
|
|
11
|
+
import { a as Te } from "./param-validation-Do7Eg8Zv.js";
|
|
12
|
+
import { f as zt, i as _t } from "./number-format-BA_KwrZe.js";
|
|
13
|
+
import { v as Ge, d as qt } from "./dataset-DL83majE.js";
|
|
14
|
+
const Ut = 4096, Pe = 128 * 1024;
|
|
15
|
+
function Xt(e) {
|
|
16
|
+
const t = /* @__PURE__ */ new Map();
|
|
17
|
+
let r = 0;
|
|
18
|
+
return { measureMm(o, n) {
|
|
19
|
+
const a = JSON.stringify([o, n.fontSizePt, n.fontFamily, n.bold, n.italic, n.letterSpacingPt]), s = t.get(a);
|
|
20
|
+
if (s !== void 0)
|
|
21
|
+
return t.delete(a), t.set(a, s), s;
|
|
22
|
+
const i = e.measureMm(o, n);
|
|
23
|
+
if (Number.isFinite(i) && a.length <= Pe) {
|
|
24
|
+
for (; t.size >= Ut || r + a.length > Pe; ) {
|
|
25
|
+
const c = t.keys().next().value;
|
|
26
|
+
r -= c.length, t.delete(c);
|
|
27
|
+
}
|
|
28
|
+
t.set(a, i), r += a.length;
|
|
29
|
+
}
|
|
30
|
+
return i;
|
|
31
|
+
} };
|
|
32
|
+
}
|
|
33
|
+
function Yt(e, t) {
|
|
34
|
+
return { member: "body", subtotal: "subtotal", total: "grand-total" }[e?.rows.get(t)?.kind ?? "member"];
|
|
35
|
+
}
|
|
36
|
+
function Qt(e) {
|
|
37
|
+
const t = e.matrix;
|
|
38
|
+
if (!t.hierarchy) return t;
|
|
39
|
+
const r = new Map(e.columns.map((n) => [n.field, n.header])), o = { sum: "求和", count: "计数", avg: "平均", min: "最小", max: "最大", weightedAvg: "加权平均" };
|
|
40
|
+
return { ...t, hierarchy: {
|
|
41
|
+
...t.hierarchy,
|
|
42
|
+
row: { ...t.hierarchy.row, labels: t.hierarchy.row?.labels ?? t.rowFields.map((n) => r.get(n) ?? n) },
|
|
43
|
+
column: { ...t.hierarchy.column, labels: t.hierarchy.column?.labels ?? t.columnFields.map((n) => r.get(n) ?? n) }
|
|
44
|
+
}, measures: t.measures.map((n) => {
|
|
45
|
+
const a = r.get(n.field) ?? r.get(n.valueField ?? n.field);
|
|
46
|
+
return n.label === void 0 && a ? { ...n, label: `${a}(${o[n.op]})` } : n;
|
|
47
|
+
}) };
|
|
48
|
+
}
|
|
49
|
+
function Zt(e, t) {
|
|
50
|
+
if (!e.matrix) return { list: e, rows: t };
|
|
51
|
+
if (e.detail || e.groupBy || e.groups?.length || e.grandTotal) throw new Error("矩阵不能同时配置普通分组、总计或主从明细");
|
|
52
|
+
const r = Kt(t, Qt(e)), o = 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" })), n = { ...e, columns: o, headerGrid: r.headerGrid, rowKey: void 0, revisionField: void 0, sourceTokenField: void 0 };
|
|
53
|
+
e.layout === "wide" && (n.widthMm = o.reduce((i, c) => i + c.widthMm, 0));
|
|
54
|
+
const a = r.metadata, s = a ? { rows: new WeakMap(r.rows.map((i, c) => [i, a.rows[c]])), header: {
|
|
55
|
+
columns: a.columns,
|
|
56
|
+
rowFields: a.rowFields,
|
|
57
|
+
rowLabels: a.rowLabels,
|
|
58
|
+
columnFields: a.columnFields,
|
|
59
|
+
columnLabels: a.columnLabels
|
|
60
|
+
} } : void 0;
|
|
61
|
+
return { list: n, rows: r.rows, ...s ? { matrix: s } : {} };
|
|
62
|
+
}
|
|
63
|
+
function er(e, t) {
|
|
64
|
+
if (!e.matrix?.hierarchy || !e.headerGrid) return e.headerGrid;
|
|
65
|
+
const r = e.paddingMm ?? 1, o = e.headerGrid.cells.map(() => e.rowHeightMm ?? 0), n = e.columns.map((c) => c.widthMm), a = ee({ ...e.headerGrid, colWidthsMm: n }, n.reduce((c, l) => c + l, 0), o.length), s = /* @__PURE__ */ new WeakMap();
|
|
66
|
+
for (const { cell: c, ci: l, ri: d, widthMm: f } of a.cells) {
|
|
67
|
+
const u = { ...Fe(e, e.columns[l]), ...c.style }, m = Z(u).fontSizePt, g = (J(c.text ?? "", Math.max(1, f - r * 2), { fontSizePt: m, fontFamily: u.fontFamily, bold: u.bold, italic: u.italic, letterSpacingPt: u.letterSpacing }, t).length * m * (u.lineHeight ?? ge) * 25.4 / 72 + r * 2) / (c.rowSpan ?? 1);
|
|
68
|
+
for (let p = d; p < d + (c.rowSpan ?? 1); p++) o[p] = Math.max(o[p] ?? 0, g);
|
|
69
|
+
s.set(c, u);
|
|
70
|
+
}
|
|
71
|
+
const i = e.headerGrid.cells.map((c) => c.map((l) => l ? { ...l, style: s.get(l) } : null));
|
|
72
|
+
return { ...e.headerGrid, cells: i, rowHeightsMm: o };
|
|
73
|
+
}
|
|
74
|
+
function tr(e, t, r) {
|
|
15
75
|
const o = /* @__PURE__ */ new Set(), n = e.cells.map((a, s) => {
|
|
16
76
|
const i = [];
|
|
17
77
|
let c = 0;
|
|
18
|
-
for (const
|
|
78
|
+
for (const l of a) {
|
|
19
79
|
for (; o.has(`${s}:${c}`); ) c++;
|
|
20
|
-
const
|
|
80
|
+
const d = l?.colSpan ?? 1, f = l?.rowSpan ?? 1;
|
|
21
81
|
let u = 0;
|
|
22
|
-
for (let m = c; m < c +
|
|
82
|
+
for (let m = c; m < c + d; m++) {
|
|
23
83
|
t.has(m) && u++;
|
|
24
84
|
for (let h = s + 1; h < s + f; h++)
|
|
25
85
|
o.add(`${h}:${m}`);
|
|
26
86
|
}
|
|
27
|
-
u && i.push(
|
|
87
|
+
u && i.push(l ? { ...l, colSpan: u } : null), c += d;
|
|
28
88
|
}
|
|
29
89
|
return i;
|
|
30
90
|
});
|
|
31
91
|
return { ...e, cells: n, colWidthsMm: r };
|
|
32
92
|
}
|
|
33
|
-
function
|
|
93
|
+
function rr(e) {
|
|
34
94
|
if (!e.columns.some((o) => o.hidden)) return e;
|
|
35
95
|
const t = /* @__PURE__ */ new Set(), r = e.columns.filter((o, n) => o.hidden ? !1 : (t.add(n), !0));
|
|
36
96
|
if (!r.length) throw new Error("列表至少需要一列可见列");
|
|
@@ -38,7 +98,7 @@ function zt(e) {
|
|
|
38
98
|
...e,
|
|
39
99
|
columns: r,
|
|
40
100
|
...e.headerGrid ? {
|
|
41
|
-
headerGrid:
|
|
101
|
+
headerGrid: tr(
|
|
42
102
|
e.headerGrid,
|
|
43
103
|
t,
|
|
44
104
|
r.map((o) => o.widthMm)
|
|
@@ -46,34 +106,34 @@ function zt(e) {
|
|
|
46
106
|
} : {}
|
|
47
107
|
};
|
|
48
108
|
}
|
|
49
|
-
function*
|
|
109
|
+
function* or(e) {
|
|
50
110
|
const { page: t } = e;
|
|
51
|
-
|
|
111
|
+
Dt(t.components, t.flow);
|
|
52
112
|
let r = 0, o = 0;
|
|
53
|
-
for (const n of
|
|
113
|
+
for (const n of Gt(t.components, t.flow)) {
|
|
54
114
|
e.active();
|
|
55
|
-
const a = n.band, s = n.components.some((
|
|
115
|
+
const a = n.band, s = n.components.some((d) => d.kind === "list" && d.cardinality !== "record"), i = s ? 0 : n.components.reduce((d, f) => Math.max(d, f.topMm - a.topMm + (f.kind === "list" ? e.height(f) : f.heightMm)), a.heightMm);
|
|
56
116
|
let c = Math.max(e.top(), o + a.topMm - r);
|
|
57
117
|
if (!s && i > e.bottom() - e.top() + 1e-3) throw new Error(`静态区域 ${a.componentIds.join(",")} 高度超出单页可用范围`);
|
|
58
118
|
!s && c + i > e.bottom() + 1e-3 && (e.nextPage(), yield* e.takePages(), e.active(), c = e.top());
|
|
59
|
-
let
|
|
60
|
-
for (const
|
|
61
|
-
const f = c +
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}), e.active()) : e.append({ ...
|
|
119
|
+
let l = c + i;
|
|
120
|
+
for (const d of n.components) {
|
|
121
|
+
const f = c + d.topMm - a.topMm;
|
|
122
|
+
d.kind === "list" ? (yield* e.list(d, f, (u) => {
|
|
123
|
+
l = s ? u : Math.max(l, u);
|
|
124
|
+
}), e.active()) : e.append({ ...d, topMm: f });
|
|
65
125
|
}
|
|
66
|
-
o =
|
|
126
|
+
o = l, r = a.topMm + a.heightMm;
|
|
67
127
|
}
|
|
68
128
|
}
|
|
69
|
-
function
|
|
129
|
+
function nr(e) {
|
|
70
130
|
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));
|
|
71
131
|
}
|
|
72
|
-
function
|
|
73
|
-
return e.pages.some((t) => t.components.some((r) => r.kind === "list" &&
|
|
132
|
+
function te(e) {
|
|
133
|
+
return e.pages.some((t) => t.components.some((r) => r.kind === "list" && nr(r)));
|
|
74
134
|
}
|
|
75
|
-
const
|
|
76
|
-
function
|
|
135
|
+
const ar = 512, ke = 256 * 1024;
|
|
136
|
+
function sr() {
|
|
77
137
|
const e = /* @__PURE__ */ new Map();
|
|
78
138
|
let t = 0, r;
|
|
79
139
|
return (o, n, a, s) => {
|
|
@@ -81,18 +141,18 @@ function Xt() {
|
|
|
81
141
|
const i = JSON.stringify([o, n, a.fontSizePt, a.fontFamily, a.bold, a.italic, a.letterSpacingPt]), c = e.get(i);
|
|
82
142
|
if (c)
|
|
83
143
|
return e.delete(i), e.set(i, c), c.lines.slice();
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
86
|
-
for (; e.size >=
|
|
144
|
+
const l = J(o, n, a, s), d = i.length + l.reduce((f, u) => f + u.length, 0);
|
|
145
|
+
if (d <= ke) {
|
|
146
|
+
for (; e.size >= ar || t + d > ke; ) {
|
|
87
147
|
const f = e.keys().next().value;
|
|
88
148
|
t -= e.get(f).units, e.delete(f);
|
|
89
149
|
}
|
|
90
|
-
e.set(i, { lines:
|
|
150
|
+
e.set(i, { lines: l.slice(), units: d }), t += d;
|
|
91
151
|
}
|
|
92
|
-
return
|
|
152
|
+
return l;
|
|
93
153
|
};
|
|
94
154
|
}
|
|
95
|
-
class
|
|
155
|
+
class K extends Error {
|
|
96
156
|
constructor(t, r) {
|
|
97
157
|
super(`报表页数超出上限 ${t}(至少 ${r} 页)`), this.limit = t, this.actual = r, this.code = "page-limit", this.name = "PaginatePageLimitError";
|
|
98
158
|
}
|
|
@@ -102,98 +162,98 @@ class D extends Error {
|
|
|
102
162
|
super(`报表单元格数量超出上限 ${t}(至少 ${r} 格)`), this.limit = t, this.actual = r, this.code = "cell-limit", this.name = "PaginateCellLimitError";
|
|
103
163
|
}
|
|
104
164
|
}
|
|
105
|
-
const
|
|
106
|
-
function
|
|
165
|
+
const ir = 1e4, $e = 25e4;
|
|
166
|
+
function pe(e) {
|
|
107
167
|
if (e?.aborted) throw e.reason ?? new DOMException("标签生成已取消", "AbortError");
|
|
108
168
|
}
|
|
109
|
-
function
|
|
110
|
-
const o = typeof e.copies == "object" ?
|
|
169
|
+
function Be(e, t, r) {
|
|
170
|
+
const o = typeof e.copies == "object" ? Ae(t, e.copies.field, r) : e.copies ?? 1;
|
|
111
171
|
if (typeof o != "number" || !Number.isSafeInteger(o) || o < 1 || o > 1e3) throw new E(`$.datasets.${r.dataset}[${r.rowIndex}]`, "每条记录复制数必须是 1..1000 的数值型整数", r.rowIndex, typeof e.copies == "object" ? e.copies.field : void 0);
|
|
112
172
|
return o;
|
|
113
173
|
}
|
|
114
|
-
function
|
|
174
|
+
function We(e, t, r) {
|
|
115
175
|
if (e.rowKey === void 0) return;
|
|
116
|
-
const o =
|
|
176
|
+
const o = Ae(t, e.rowKey, r);
|
|
117
177
|
if (typeof o == "string" && o.trim() || typeof o == "number" && Number.isFinite(o)) return o;
|
|
118
178
|
throw new E(`$.datasets.${r.dataset}[${r.rowIndex}].${e.rowKey}`, "业务主键必须是非空字符串或有限数字", r.rowIndex, e.rowKey);
|
|
119
179
|
}
|
|
120
|
-
function
|
|
180
|
+
function cr(e) {
|
|
121
181
|
const t = (r) => 1 + (r.grid?.cells.reduce((o, n) => o + 1 + n.length + n.reduce((a, s) => a + (s?.children?.reduce((i, c) => i + t(c), 0) ?? 0), 0), 0) ?? 0);
|
|
122
182
|
return e.pages.reduce((r, o) => r + o.components.reduce((n, a) => n + t(a), 0), 0);
|
|
123
183
|
}
|
|
124
|
-
function
|
|
184
|
+
function lr(e, t, r) {
|
|
125
185
|
const o = e.repeat, n = Object.prototype.hasOwnProperty.call(t, o.dataset) ? t[o.dataset] : void 0;
|
|
126
186
|
if (!Array.isArray(n)) throw new E(`$.datasets.${o.dataset}`, "逐记录标签数据集缺失,应提供对象数组(允许空数组)");
|
|
127
|
-
const a = /* @__PURE__ */ new Set(), s = r.maxPages ??
|
|
128
|
-
let c = 0,
|
|
129
|
-
for (const [
|
|
130
|
-
if (
|
|
131
|
-
const u = { rowIndex:
|
|
187
|
+
const a = /* @__PURE__ */ new Set(), s = r.maxPages ?? ir, i = cr(e);
|
|
188
|
+
let c = 0, l = 0;
|
|
189
|
+
for (const [d, f] of n.entries()) {
|
|
190
|
+
if (pe(r.signal), !f || typeof f != "object" || Array.isArray(f)) throw new E(`$.datasets.${o.dataset}[${d}]`, "标签记录应为对象", d);
|
|
191
|
+
const u = { rowIndex: d, dataset: o.dataset }, m = We(o, f, u);
|
|
132
192
|
if (m !== void 0) {
|
|
133
193
|
const g = JSON.stringify([typeof m, m]);
|
|
134
|
-
if (a.has(g)) throw new E(`$.datasets.${o.dataset}[${
|
|
194
|
+
if (a.has(g)) throw new E(`$.datasets.${o.dataset}[${d}].${o.rowKey}`, "业务主键重复;请先确认记录来源,避免重复打印标签", d, o.rowKey);
|
|
135
195
|
a.add(g);
|
|
136
196
|
}
|
|
137
|
-
const h =
|
|
138
|
-
if (c += h * e.pages.length,
|
|
139
|
-
if (
|
|
197
|
+
const h = Be(o, f, u);
|
|
198
|
+
if (c += h * e.pages.length, l += h * i, c > s) throw new K(s, c);
|
|
199
|
+
if (l > $e) throw new E("$.repeat", `标签组件总量(含网格行、槽位及嵌套组件)超过安全预算 ${$e},请分批生成`, d);
|
|
140
200
|
}
|
|
141
201
|
return n;
|
|
142
202
|
}
|
|
143
|
-
function
|
|
203
|
+
function dr(e, t, r) {
|
|
144
204
|
if (!e.binding) return e;
|
|
145
|
-
const { binding: o, ...n } = e, a =
|
|
205
|
+
const { binding: o, ...n } = e, a = It(o, t.row, t);
|
|
146
206
|
if (e.kind === "image") {
|
|
147
207
|
if (!a) return;
|
|
148
|
-
if (
|
|
208
|
+
if (!Et(a)) throw new E(`${r}.binding`, "图片字段只接受 PNG/JPEG base64 data URL;业务 URL 应由宿主安全加载后转换", t.rowIndex, o.field);
|
|
149
209
|
return { ...n, imageData: a };
|
|
150
210
|
}
|
|
151
211
|
return e.kind === "barcode" || e.kind === "qrcode" ? (delete n.imageData, { ...n, code: { ...n.code, value: a }, fallbackText: a }) : (delete n.lines, delete n.richParagraphs, { ...n, text: a });
|
|
152
212
|
}
|
|
153
|
-
function
|
|
213
|
+
function ur(e, t, r) {
|
|
154
214
|
if (e.kind !== "text" || e.grid || e.richParagraphs?.length) return e;
|
|
155
|
-
const o = e.style ?? {}, n =
|
|
215
|
+
const o = e.style ?? {}, n = Z(o).fontSizePt, a = e.text ?? e.lines?.join(`
|
|
156
216
|
`) ?? "";
|
|
157
217
|
if (a.length > 16384) throw new E(r, "标签文本超过 16384 字符预算,请缩小字段内容", t.rowIndex);
|
|
158
|
-
const s = t.wrapText(a, e.widthMm, { fontSizePt: n, bold: o.bold, italic: o.italic, fontFamily: o.fontFamily, letterSpacingPt: o.letterSpacing }, t.options.measurer ??
|
|
218
|
+
const s = t.wrapText(a, e.widthMm, { fontSizePt: n, bold: o.bold, italic: o.italic, fontFamily: o.fontFamily, letterSpacingPt: o.letterSpacing }, t.options.measurer ?? Oe), i = s.length * n * $t(o) * 25.4 / 72;
|
|
159
219
|
if (i > e.heightMm + 0.05) throw new E(r, `标签文字需要约 ${i.toFixed(2)}mm 高,超出 ${e.heightMm}mm;请增大文本区域、减少内容或调整字号`, t.rowIndex, e.binding?.field);
|
|
160
220
|
return { ...e, lines: s };
|
|
161
221
|
}
|
|
162
|
-
function
|
|
163
|
-
|
|
164
|
-
const o =
|
|
222
|
+
function Ve(e, t, r) {
|
|
223
|
+
pe(t.options.signal);
|
|
224
|
+
const o = dr(e, t, r);
|
|
165
225
|
if (!o) return;
|
|
166
226
|
let n = o.grid;
|
|
167
|
-
return n && (n = { ...n, cells: n.cells.map((a, s) => a.map((i, c) => i?.children?.length ? { ...i, children: i.children.flatMap((
|
|
168
|
-
const f =
|
|
227
|
+
return n && (n = { ...n, cells: n.cells.map((a, s) => a.map((i, c) => i?.children?.length ? { ...i, children: i.children.flatMap((l, d) => {
|
|
228
|
+
const f = Ve(l, t, `${r}.grid.cells.${s}.${c}.children.${d}`);
|
|
169
229
|
return f ? [f] : [];
|
|
170
|
-
}) } : i)) }),
|
|
230
|
+
}) } : i)) }), ur(n === o.grid ? o : { ...o, grid: n }, t, r);
|
|
171
231
|
}
|
|
172
|
-
function
|
|
232
|
+
function fr(e, t, r, o, n, a) {
|
|
173
233
|
return {
|
|
174
234
|
...e,
|
|
175
235
|
components: e.components.flatMap((s, i) => {
|
|
176
|
-
const c =
|
|
236
|
+
const c = Ve(s, r, `$.pages.${t}.components.${i}`);
|
|
177
237
|
return c ? [{ ...c, meta: { ...c.meta, labelSource: { pageIndex: t, componentIndex: i } } }] : [];
|
|
178
238
|
}),
|
|
179
239
|
meta: { ...e.meta, record: { dataset: r.dataset, rowIndex: r.rowIndex, ...a === void 0 ? {} : { rowKey: a }, copyIndex: o, copyCount: n, templatePageIndex: t } }
|
|
180
240
|
};
|
|
181
241
|
}
|
|
182
|
-
function*
|
|
242
|
+
function* mr(e, t, r) {
|
|
183
243
|
const o = [];
|
|
184
|
-
if (
|
|
244
|
+
if (Bt(e, o), o.length) throw new E(o[0].path, o[0].message);
|
|
185
245
|
if (!e.repeat) {
|
|
186
246
|
for (const [i, c] of e.pages.entries()) yield { page: c, pageIndex: i };
|
|
187
247
|
return;
|
|
188
248
|
}
|
|
189
|
-
const n = e.repeat, a =
|
|
249
|
+
const n = e.repeat, a = lr(e, t, r), s = sr();
|
|
190
250
|
for (const [i, c] of a.entries()) {
|
|
191
|
-
const
|
|
192
|
-
for (let u = 0; u <
|
|
193
|
-
|
|
251
|
+
const l = { row: c, rowIndex: i, dataset: n.dataset, options: r, wrapText: s }, d = Be(n, c, l), f = We(n, c, l);
|
|
252
|
+
for (let u = 0; u < d; u++) for (const [m, h] of e.pages.entries())
|
|
253
|
+
pe(r.signal), yield { page: fr(h, m, l, u, d, f), pageIndex: m };
|
|
194
254
|
}
|
|
195
255
|
}
|
|
196
|
-
function
|
|
256
|
+
function gr(e) {
|
|
197
257
|
return {
|
|
198
258
|
widthMm: e.widthMm,
|
|
199
259
|
heightMm: e.heightMm,
|
|
@@ -204,67 +264,67 @@ function nr(e) {
|
|
|
204
264
|
components: []
|
|
205
265
|
};
|
|
206
266
|
}
|
|
207
|
-
function
|
|
267
|
+
function U(e, t) {
|
|
208
268
|
const r = t.heightMm - (e.layout === "wide" ? t.marginBottomMm : e.marginBottomMm ?? t.marginBottomMm);
|
|
209
269
|
return e.components.reduce((o, n) => n.kind !== "list" && n.pageAnchor === "footer" ? Math.min(o, n.topMm) : o, r);
|
|
210
270
|
}
|
|
211
|
-
function
|
|
271
|
+
function B(e) {
|
|
212
272
|
return e.components.reduce((t, r) => r.kind !== "list" && r.pageAnchor === "header" ? Math.max(t, r.topMm + r.heightMm) : t, 0);
|
|
213
273
|
}
|
|
214
|
-
function
|
|
274
|
+
function Je(e, t) {
|
|
215
275
|
let r = e.textMetrics.get(t);
|
|
216
276
|
if (!r) {
|
|
217
|
-
const o =
|
|
277
|
+
const o = Z(t).fontSizePt;
|
|
218
278
|
r = {
|
|
219
279
|
measureOptions: {
|
|
220
280
|
fontSizePt: o,
|
|
221
|
-
fontFamily: t.fontFamily ??
|
|
281
|
+
fontFamily: t.fontFamily ?? Ce,
|
|
222
282
|
italic: t.italic,
|
|
223
283
|
bold: t.bold,
|
|
224
284
|
letterSpacingPt: t.letterSpacing
|
|
225
285
|
},
|
|
226
|
-
lineMm: o * (t.lineHeight ??
|
|
286
|
+
lineMm: o * (t.lineHeight ?? ge) * 25.4 / 72
|
|
227
287
|
}, e.textMetrics.set(t, r);
|
|
228
288
|
}
|
|
229
289
|
return r;
|
|
230
290
|
}
|
|
231
|
-
function
|
|
291
|
+
function hr(e) {
|
|
232
292
|
if (e === null || typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e)) return e;
|
|
233
293
|
}
|
|
234
|
-
function
|
|
235
|
-
const r = e.fontSizePt ??
|
|
236
|
-
...
|
|
294
|
+
function we(e, t) {
|
|
295
|
+
const r = e.fontSizePt ?? Rt, o = e.paddingMm ?? 1, n = e.columns.map((g) => g.align ?? g.style?.align ?? e.align ?? "left"), a = e.columns.map((g, p) => ({
|
|
296
|
+
...N({
|
|
237
297
|
fontSize: r,
|
|
238
298
|
verticalAlign: "middle"
|
|
239
299
|
}, g.style),
|
|
240
|
-
align: n[
|
|
241
|
-
})), s = a.map((g,
|
|
242
|
-
const
|
|
243
|
-
if (
|
|
244
|
-
left:
|
|
245
|
-
center:
|
|
246
|
-
right:
|
|
300
|
+
align: n[p] === "auto" ? "left" : n[p]
|
|
301
|
+
})), s = a.map((g, p) => n[p] === "auto" ? { left: g, center: { ...g, align: "center" }, right: { ...g, align: "right" } } : void 0), i = e.columns.map((g, p) => g.rules?.map((b) => {
|
|
302
|
+
const M = s[p];
|
|
303
|
+
if (M) return {
|
|
304
|
+
left: N(M.left, b.style),
|
|
305
|
+
center: N(M.center, b.style),
|
|
306
|
+
right: N(M.right, b.style)
|
|
247
307
|
};
|
|
248
|
-
const T =
|
|
308
|
+
const T = N(a[p], b.style);
|
|
249
309
|
return { left: T, center: T, right: T };
|
|
250
|
-
})), c = e.columns.map((g) =>
|
|
251
|
-
let
|
|
252
|
-
for (let g = 0; g <
|
|
253
|
-
const
|
|
254
|
-
|
|
310
|
+
})), c = e.columns.map((g) => Fe(e, g)), l = e.columns.map((g) => g.header);
|
|
311
|
+
let d = e.rowHeightMm ?? 0;
|
|
312
|
+
for (let g = 0; g < l.length; g++) {
|
|
313
|
+
const p = c[g], b = Z(p).fontSizePt, M = J(
|
|
314
|
+
l[g],
|
|
255
315
|
e.columns[g].widthMm - o * 2,
|
|
256
|
-
{ fontSizePt:
|
|
316
|
+
{ fontSizePt: b, fontFamily: p.fontFamily ?? Ce, italic: p.italic, bold: p.bold, letterSpacingPt: p.letterSpacing },
|
|
257
317
|
t
|
|
258
|
-
), T =
|
|
259
|
-
|
|
318
|
+
), T = b * (p.lineHeight ?? ge) * 25.4 / 72;
|
|
319
|
+
d = Math.max(d, Math.max(M.length, 1) * T + o * 2);
|
|
260
320
|
}
|
|
261
|
-
const f =
|
|
321
|
+
const f = l.map((g, p) => ({
|
|
262
322
|
text: g,
|
|
263
|
-
style: c[
|
|
264
|
-
})), u = e.border === !1 ? { borderTop: !1, borderRight: !1, borderBottom: !1, borderLeft: !1 } : { borderBottom: !0, borderLeft: !0, borderRight: !0, borderTop: !0 }, m = e.columns.map((g) => g.widthMm), h =
|
|
323
|
+
style: c[p]
|
|
324
|
+
})), u = e.border === !1 ? { borderTop: !1, borderRight: !1, borderBottom: !1, borderLeft: !1 } : { borderBottom: !0, borderLeft: !0, borderRight: !0, borderTop: !0 }, m = e.columns.map((g) => g.widthMm), h = pr(er(e, t), m, {
|
|
265
325
|
cells: [f],
|
|
266
326
|
colWidthsMm: m,
|
|
267
|
-
rowHeightsMm: [
|
|
327
|
+
rowHeightsMm: [d],
|
|
268
328
|
paddingMm: o
|
|
269
329
|
});
|
|
270
330
|
return {
|
|
@@ -274,23 +334,23 @@ function he(e, t) {
|
|
|
274
334
|
autoStyles: s,
|
|
275
335
|
ruleStyles: i,
|
|
276
336
|
textMetrics: /* @__PURE__ */ new WeakMap(),
|
|
277
|
-
numberFormats: e.columns.map((g) =>
|
|
337
|
+
numberFormats: e.columns.map((g) => Ne(g.format)),
|
|
278
338
|
derivedFields: new Set(e.computed?.map((g) => g.field)),
|
|
279
339
|
borderStyle: u,
|
|
280
|
-
headerHeightMm: h.rowHeightsMm.reduce((g,
|
|
340
|
+
headerHeightMm: h.rowHeightsMm.reduce((g, p) => g + p, 0),
|
|
281
341
|
headerGrid: h,
|
|
282
342
|
colWidthsMm: m,
|
|
283
343
|
columns: e.columns
|
|
284
344
|
};
|
|
285
345
|
}
|
|
286
|
-
function
|
|
346
|
+
function pr(e, t, r) {
|
|
287
347
|
if (!e) return r;
|
|
288
348
|
if (!e.cells.length) throw new Error("自定义列表表头至少需要一行");
|
|
289
349
|
const o = e.rowHeightsMm ?? e.cells.map(() => r.rowHeightsMm[0]);
|
|
290
350
|
if (o.length !== e.cells.length || o.some((n) => !Number.isFinite(n) || n <= 0)) throw new Error("自定义列表表头行高无效");
|
|
291
351
|
return { ...e, colWidthsMm: t, rowHeightsMm: o };
|
|
292
352
|
}
|
|
293
|
-
function
|
|
353
|
+
function wr(e, t, r) {
|
|
294
354
|
const o = t.format?.kind === "number" || t.format?.kind === "percent";
|
|
295
355
|
t.valueType !== void 0 ? e.valueType = t.valueType : o && (e.valueType = "number"), t.editable !== void 0 && (e.editable = t.editable), (typeof e.value == "number" || e.value == null) && r !== void 0 && (e.numberFormat = r);
|
|
296
356
|
}
|
|
@@ -299,42 +359,43 @@ function W(e, t, r) {
|
|
|
299
359
|
let a = e.rowHeightFloorMm;
|
|
300
360
|
const s = new Array(o.length);
|
|
301
361
|
for (let i = 0; i < o.length; i++) {
|
|
302
|
-
const c = o[i],
|
|
303
|
-
let f = e.autoStyles[i]?.[
|
|
362
|
+
const c = o[i], l = c.visibleWhen && !H(t, c.visibleWhen) ? null : t[c.field], d = e.autoStyles[i] ? Ke(l, c.format, c.semanticRole) : "left";
|
|
363
|
+
let f = e.autoStyles[i]?.[d] ?? e.cellStyles[i];
|
|
304
364
|
if (c.rules)
|
|
305
|
-
for (let
|
|
306
|
-
const T = c.rules[
|
|
365
|
+
for (let M = 0; M < c.rules.length; M++) {
|
|
366
|
+
const T = c.rules[M];
|
|
307
367
|
if (H(t, T.when)) {
|
|
308
|
-
f = e.ruleStyles[i][
|
|
368
|
+
f = e.ruleStyles[i][M][d];
|
|
309
369
|
break;
|
|
310
370
|
}
|
|
311
371
|
}
|
|
312
|
-
const u = c.format ?
|
|
313
|
-
f =
|
|
314
|
-
const h =
|
|
372
|
+
const u = c.format ? je(l, c.format) : he(l), m = yr(e, c, n);
|
|
373
|
+
f = br(e, c, f, n);
|
|
374
|
+
const h = Je(e, f), g = J(u, Math.max(1, c.widthMm - e.paddingMm * 2 - m), h.measureOptions, r);
|
|
315
375
|
a = Math.max(a, g.length * h.lineMm + e.paddingMm * 2);
|
|
316
|
-
const
|
|
317
|
-
|
|
376
|
+
const p = hr(l), b = { text: u, style: f };
|
|
377
|
+
p !== void 0 && (b.value = p), wr(b, c, e.numberFormats[i]), Mr(b, c, e, n, m), e.derivedFields.has(c.field) && (b.derived = !0, b.editable = !1), c.visibleWhen && l === null && !H(t, c.visibleWhen) && (b.editable = !1), s[i] = b;
|
|
318
378
|
}
|
|
319
379
|
return {
|
|
320
380
|
grid: { cells: [s], colWidthsMm: e.colWidthsMm, rowHeightsMm: [a], paddingMm: e.paddingMm },
|
|
321
|
-
heightMm: a
|
|
381
|
+
heightMm: a,
|
|
382
|
+
...e.matrix ? { meta: { matrix: { row: e.matrix.rows.get(t) } } } : {}
|
|
322
383
|
};
|
|
323
384
|
}
|
|
324
|
-
function
|
|
325
|
-
return !r || t.field !== e.tree.list.tree.labelField ? 0 :
|
|
385
|
+
function yr(e, t, r) {
|
|
386
|
+
return !r || t.field !== e.tree.list.tree.labelField ? 0 : Ct(e.tree.list, t, r, e.paddingMm);
|
|
326
387
|
}
|
|
327
|
-
function
|
|
388
|
+
function br(e, t, r, o) {
|
|
328
389
|
return !o || t.field !== e.tree.list.tree.labelField || r.align === "left" ? r : { ...r, align: "left" };
|
|
329
390
|
}
|
|
330
|
-
function
|
|
331
|
-
o && (n && (e.indentMm = n),
|
|
391
|
+
function Mr(e, t, r, o, n = 0) {
|
|
392
|
+
o && (n && (e.indentMm = n), Ot(e, t, o, r.tree.list));
|
|
332
393
|
}
|
|
333
|
-
function
|
|
394
|
+
function ze(e) {
|
|
334
395
|
if (e != null && typeof e != "string" && typeof e != "boolean" && !(typeof e == "number" && Number.isFinite(e))) throw new Error("分组字段应为有限 JSON 标量");
|
|
335
396
|
return JSON.stringify([typeof e, e ?? null]);
|
|
336
397
|
}
|
|
337
|
-
function*
|
|
398
|
+
function* _e(e, t, r = 0) {
|
|
338
399
|
const o = t[r];
|
|
339
400
|
if (!o) {
|
|
340
401
|
for (const a of e) yield { kind: "row", row: a };
|
|
@@ -342,51 +403,51 @@ function* Ve(e, t, r = 0) {
|
|
|
342
403
|
}
|
|
343
404
|
const n = /* @__PURE__ */ new Map();
|
|
344
405
|
for (const a of e) {
|
|
345
|
-
const s =
|
|
406
|
+
const s = ze(a[o.field]), i = n.get(s);
|
|
346
407
|
i ? i.push(a) : n.set(s, [a]);
|
|
347
408
|
}
|
|
348
409
|
for (const a of n.values())
|
|
349
|
-
yield { kind: "groupHeader", label: (o.headerTemplate ?? "{value}").replace(/\{value\}/g,
|
|
410
|
+
yield { kind: "groupHeader", label: (o.headerTemplate ?? "{value}").replace(/\{value\}/g, he(a[0][o.field])), firstRow: a[0], group: o, depth: r, rows: a }, yield* _e(a, t, r + 1), (o.subtotal?.length || o.aggregates?.length) && (yield { kind: "subtotal", label: o.subtotalLabel ?? "小计", rows: a, group: o, depth: r }), yield { kind: "groupEnd", depth: r };
|
|
350
411
|
}
|
|
351
|
-
function
|
|
412
|
+
function qe(e, t, r, o = []) {
|
|
352
413
|
const n = [...r.filter((a) => !o.some((s) => s.field === a)).map((a) => ({ field: a, op: "sum" })), ...o];
|
|
353
414
|
return new Map(n.map((a) => {
|
|
354
|
-
const s = e.find((c) => c.field === a.field)?.format ?? { kind: "number", thousands: !0 }, i =
|
|
355
|
-
return [a.field, { text:
|
|
415
|
+
const s = e.find((c) => c.field === a.field)?.format ?? { kind: "number", thousands: !0 }, i = Ft(t, { ...a, field: a.valueField ?? a.field });
|
|
416
|
+
return [a.field, { text: je(i, s), ...i === null ? {} : { value: i }, ...typeof i == "number" ? { numberFormat: Ne(s) } : {} }];
|
|
356
417
|
}));
|
|
357
418
|
}
|
|
358
|
-
function
|
|
419
|
+
function Ue(e, t) {
|
|
359
420
|
const r = e.findIndex((o) => t.includes(o.field));
|
|
360
421
|
return r < 0 ? 1 : r;
|
|
361
422
|
}
|
|
362
|
-
function
|
|
363
|
-
const s = [], i = Math.max(0, Math.min(a, e.columns.length)), c =
|
|
423
|
+
function G(e, t, r, o, n, a) {
|
|
424
|
+
const s = [], i = Math.max(0, Math.min(a, e.columns.length)), c = N({ fontSize: e.fontSizePt }, n);
|
|
364
425
|
i && s.push({ text: r, colSpan: i, style: { bold: !0, ...c } });
|
|
365
426
|
for (let u = i; u < e.columns.length; u++) {
|
|
366
427
|
const m = e.columns[u], h = o.get(m.field), g = e.autoStyles[u]?.[Ke(h?.value, m.format)] ?? e.cellStyles[u];
|
|
367
|
-
s.push({ ...h, text: h?.text ?? "", style:
|
|
428
|
+
s.push({ ...h, text: h?.text ?? "", style: N(g, n) });
|
|
368
429
|
}
|
|
369
|
-
const
|
|
430
|
+
const l = { text: r, colSpan: e.columns.length, style: { bold: !0, ...c } }, d = i ? [s] : [[l], s], f = d.map((u) => vr(e, u, t));
|
|
370
431
|
return {
|
|
371
|
-
grid: { cells:
|
|
432
|
+
grid: { cells: d, colWidthsMm: e.colWidthsMm, rowHeightsMm: f, paddingMm: e.paddingMm },
|
|
372
433
|
heightMm: f.reduce((u, m) => u + m, 0)
|
|
373
434
|
};
|
|
374
435
|
}
|
|
375
|
-
function
|
|
436
|
+
function vr(e, t, r) {
|
|
376
437
|
let o = e.rowHeightFloorMm, n = 0;
|
|
377
438
|
for (const a of t) {
|
|
378
439
|
let s = 0;
|
|
379
440
|
const i = n + (a.colSpan ?? 1);
|
|
380
441
|
for (; n < i; n++) s += e.colWidthsMm[n] ?? 0;
|
|
381
|
-
const c =
|
|
382
|
-
o = Math.max(o,
|
|
442
|
+
const c = Je(e, a.style), l = J(a.text ?? "", s - e.paddingMm * 2, c.measureOptions, r);
|
|
443
|
+
o = Math.max(o, l.length * c.lineMm + e.paddingMm * 2);
|
|
383
444
|
}
|
|
384
445
|
return o;
|
|
385
446
|
}
|
|
386
|
-
function
|
|
387
|
-
const { templatePage: o, current: n, warnings: a, nextId: s, pushCurrent: i } = r, c = () =>
|
|
447
|
+
function Sr(e, t, r) {
|
|
448
|
+
const { templatePage: o, current: n, warnings: a, nextId: s, pushCurrent: i } = r, c = () => U(o, n), l = Math.max(n.marginTopMm, B(o)), d = o.layout === "wide" ? B(o) : l, f = {
|
|
388
449
|
id: r.tableId,
|
|
389
|
-
columnKeys: e.columns.map((
|
|
450
|
+
columnKeys: e.columns.map((w) => w.field),
|
|
390
451
|
...e.layout === void 0 ? {} : { layout: e.layout },
|
|
391
452
|
...e.title === void 0 ? {} : { title: e.title }
|
|
392
453
|
}, u = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), h = {
|
|
@@ -399,54 +460,54 @@ function fr(e, t, r) {
|
|
|
399
460
|
nid: s("listh"),
|
|
400
461
|
table: { ...f, role: "header", rowIndex: -1 },
|
|
401
462
|
style: t.borderStyle,
|
|
402
|
-
...e.meta ? { meta: e.meta } : {}
|
|
403
|
-
}, g = (
|
|
404
|
-
if (r.flow && e.header !== !1 && t.headerHeightMm > c() -
|
|
405
|
-
let
|
|
406
|
-
e.header !== !1 && (g(
|
|
407
|
-
function
|
|
408
|
-
const
|
|
409
|
-
return (e.header !== !1 && e.headerEveryPage !== !1 ?
|
|
463
|
+
...e.meta || t.matrix ? { meta: { ...e.meta, ...t.matrix ? { matrix: t.matrix.header } : {} } } : {}
|
|
464
|
+
}, g = (w) => n.components.push({ ...h, topMm: w });
|
|
465
|
+
if (r.flow && e.header !== !1 && t.headerHeightMm > c() - l + 1e-3) throw new Error(`流式列表 ${e.id ?? e.dataset} 的表头高度超出单页可用范围`);
|
|
466
|
+
let p = Math.max(r.startTop ?? e.topMm, l);
|
|
467
|
+
e.header !== !1 && (g(p), p += t.headerHeightMm + r.mmPerRow);
|
|
468
|
+
function b() {
|
|
469
|
+
const w = Math.max(r.flow || o.layout === "wide" ? 0 : e.topMm, d);
|
|
470
|
+
return (e.header !== !1 && e.headerEveryPage !== !1 ? w + t.headerHeightMm : d) + [...m.values()].reduce((x, k) => x + k.heightMm, 0);
|
|
410
471
|
}
|
|
411
|
-
function
|
|
412
|
-
const
|
|
413
|
-
return Math.min(o.heightMm -
|
|
472
|
+
function M() {
|
|
473
|
+
const w = o.layout === "wide" ? 0 : n.marginBottomMm;
|
|
474
|
+
return Math.min(o.heightMm - w, U(o, n)) - b();
|
|
414
475
|
}
|
|
415
|
-
function T(
|
|
416
|
-
if (
|
|
476
|
+
function T(w) {
|
|
477
|
+
if (p + w <= c()) return;
|
|
417
478
|
i(), n.components = [], n.heightMm = o.heightMm, o.layout === "wide" && (n.marginTopMm = 0, n.marginBottomMm = 0);
|
|
418
|
-
const
|
|
419
|
-
e.header !== !1 && e.headerEveryPage !== !1 ? (g(
|
|
420
|
-
for (const x of m.values())
|
|
479
|
+
const v = Math.max(r.flow || o.layout === "wide" ? 0 : e.topMm, d);
|
|
480
|
+
e.header !== !1 && e.headerEveryPage !== !1 ? (g(v), p = v + t.headerHeightMm) : p = d;
|
|
481
|
+
for (const x of m.values()) A(x, "listgr", "group-header");
|
|
421
482
|
}
|
|
422
|
-
function S(
|
|
423
|
-
const
|
|
424
|
-
if (r.flow &&
|
|
425
|
-
|
|
483
|
+
function S(w, v, x, k) {
|
|
484
|
+
const $ = M();
|
|
485
|
+
if (r.flow && w.heightMm > $ + 1e-3) throw new Error(`流式列表 ${e.id ?? e.dataset} 的单行高度超出单页可用范围`);
|
|
486
|
+
w.heightMm > $ && a.push(`列表 ${e.id ?? e.dataset} 行高 ${w.heightMm.toFixed(2)}mm 超出单页可用高度 ${$.toFixed(2)}mm,预览与打印可能截断内容`), T(w.heightMm), A(w, v, x, k);
|
|
426
487
|
}
|
|
427
|
-
function
|
|
428
|
-
const
|
|
429
|
-
x !== "header" && u.set(
|
|
488
|
+
function A(w, v, x, k) {
|
|
489
|
+
const $ = w.table?.id ?? f.id, F = x === "header" ? -1 : u.get($) ?? 0;
|
|
490
|
+
x !== "header" && u.set($, F + w.grid.cells.length), n.components.push({
|
|
430
491
|
kind: "rect",
|
|
431
492
|
leftMm: e.leftMm,
|
|
432
|
-
topMm:
|
|
493
|
+
topMm: p,
|
|
433
494
|
widthMm: e.widthMm,
|
|
434
|
-
heightMm:
|
|
435
|
-
grid:
|
|
436
|
-
nid: s(
|
|
437
|
-
table: { ...f, ...
|
|
495
|
+
heightMm: w.heightMm,
|
|
496
|
+
grid: w.grid,
|
|
497
|
+
nid: s(v),
|
|
498
|
+
table: { ...f, ...w.table, role: x, rowIndex: F, ...k ? { source: k } : {} },
|
|
438
499
|
style: t.borderStyle,
|
|
439
|
-
...e.meta ? { meta: e.meta } : {}
|
|
440
|
-
}),
|
|
500
|
+
...e.meta || w.meta ? { meta: { ...e.meta, ...w.meta } } : {}
|
|
501
|
+
}), p += w.heightMm;
|
|
441
502
|
}
|
|
442
|
-
function O(
|
|
443
|
-
|
|
503
|
+
function O(w) {
|
|
504
|
+
w <= M() && T(w);
|
|
444
505
|
}
|
|
445
|
-
return { keepTogether: O, placeGridRow: S, setGroupHeader: (
|
|
446
|
-
|
|
447
|
-
}, bottom: () =>
|
|
506
|
+
return { keepTogether: O, placeGridRow: S, setGroupHeader: (w, v) => {
|
|
507
|
+
v ? m.set(w, v) : m.delete(w);
|
|
508
|
+
}, bottom: () => p };
|
|
448
509
|
}
|
|
449
|
-
function
|
|
510
|
+
function xr(e, t) {
|
|
450
511
|
if (!e.rowKey) return;
|
|
451
512
|
const r = t[e.rowKey];
|
|
452
513
|
if ((typeof r != "string" || !r.trim()) && !(typeof r == "number" && Number.isFinite(r)))
|
|
@@ -456,26 +517,26 @@ function mr(e, t) {
|
|
|
456
517
|
if (n !== void 0 && typeof n != "string") throw new Error("来源令牌应为字符串");
|
|
457
518
|
return { datasetId: e.dataset, rowKey: r, ...o === void 0 ? {} : { revision: o }, ...n === void 0 ? {} : { sourceToken: n } };
|
|
458
519
|
}
|
|
459
|
-
function
|
|
520
|
+
function re(e, t) {
|
|
460
521
|
const r = /* @__PURE__ */ new Map();
|
|
461
522
|
if (!e.rowKey) return r;
|
|
462
523
|
const o = /* @__PURE__ */ new Set();
|
|
463
524
|
for (const n of t) {
|
|
464
|
-
const a =
|
|
525
|
+
const a = xr(e, n), s = JSON.stringify(a.rowKey);
|
|
465
526
|
if (o.has(s)) throw new Error(`数据集 ${e.dataset} 的业务主键重复:${String(a.rowKey)}`);
|
|
466
527
|
o.add(s), r.set(n, a);
|
|
467
528
|
}
|
|
468
529
|
return r;
|
|
469
530
|
}
|
|
470
|
-
function
|
|
531
|
+
function Tr(e, t, r, o, n) {
|
|
471
532
|
if (!e.grandTotal) return;
|
|
472
|
-
const a = typeof e.grandTotal == "object" ? e.grandTotal : void 0, s =
|
|
533
|
+
const a = typeof e.grandTotal == "object" ? e.grandTotal : void 0, s = oe(e)[0], i = a?.fields ?? s?.subtotal ?? [], c = a?.aggregates ?? s?.aggregates ?? [];
|
|
473
534
|
if (i.length === 0 && c.length === 0) {
|
|
474
535
|
o.warnings.push(`列表 ${e.id ?? ""} 配置了 grandTotal 但未提供合计字段(groupBy.subtotal 或 grandTotal.fields)`);
|
|
475
536
|
return;
|
|
476
537
|
}
|
|
477
|
-
const
|
|
478
|
-
n.placeGridRow(
|
|
538
|
+
const l = G(r, o.measurer, a?.label ?? "合计", qe(e.columns, t, i, c), a?.style ?? {}, Ue(e.columns, [...i, ...c.map((d) => d.field)]));
|
|
539
|
+
n.placeGridRow(l, "listgt", "grand-total");
|
|
479
540
|
}
|
|
480
541
|
function V(e) {
|
|
481
542
|
if (e?.aborted) {
|
|
@@ -483,147 +544,141 @@ function V(e) {
|
|
|
483
544
|
throw t.name = "AbortError", t;
|
|
484
545
|
}
|
|
485
546
|
}
|
|
486
|
-
function
|
|
547
|
+
function oe(e) {
|
|
487
548
|
const t = e.groups ?? (e.groupBy ? [e.groupBy] : []);
|
|
488
549
|
if (t.length > 16) throw new Error("列表最多支持 16 级分组");
|
|
489
550
|
return t;
|
|
490
551
|
}
|
|
491
|
-
function
|
|
492
|
-
const t =
|
|
552
|
+
function ye(e) {
|
|
553
|
+
const t = rr(e), r = t.columns.reduce((n, a) => n + a.widthMm, 0), o = r > t.widthMm ? t.widthMm / r : 1;
|
|
493
554
|
return o === 1 ? t : { ...t, columns: t.columns.map((n) => ({ ...n, widthMm: n.widthMm * o })) };
|
|
494
555
|
}
|
|
495
|
-
function
|
|
556
|
+
function Pr(e, t, r) {
|
|
496
557
|
const o = e.detail;
|
|
497
558
|
if (!o) return;
|
|
498
559
|
const n = /* @__PURE__ */ new Set();
|
|
499
|
-
for (const
|
|
500
|
-
const
|
|
501
|
-
if (n.has(
|
|
502
|
-
n.add(
|
|
560
|
+
for (const l of t) {
|
|
561
|
+
const d = de(l[o.parentKey]);
|
|
562
|
+
if (n.has(d)) throw new Error("主从明细的主表关联键重复");
|
|
563
|
+
n.add(d);
|
|
503
564
|
}
|
|
504
565
|
const a = r.datasets[o.dataset] ?? [], s = /* @__PURE__ */ new Map(), i = [];
|
|
505
|
-
for (const
|
|
506
|
-
const
|
|
507
|
-
if (!
|
|
508
|
-
const f =
|
|
566
|
+
for (const l of a) {
|
|
567
|
+
const d = l[o.foreignKey];
|
|
568
|
+
if (!Xe(d) && o.unmatched === "ignore") continue;
|
|
569
|
+
const f = de(d);
|
|
509
570
|
if (!n.has(f)) {
|
|
510
571
|
if (o.unmatched !== "ignore") throw new Error(`明细数据集 ${o.dataset} 存在未关联的业务键`);
|
|
511
572
|
continue;
|
|
512
573
|
}
|
|
513
574
|
const u = s.get(f);
|
|
514
|
-
u ? u.push(
|
|
575
|
+
u ? u.push(l) : s.set(f, [l]), i.push(l);
|
|
515
576
|
}
|
|
516
|
-
const c =
|
|
517
|
-
return { list: c, inter: { ...
|
|
577
|
+
const c = ye({ ...e, id: `${e.id ?? e.dataset}:detail`, dataset: o.dataset, rowKey: o.rowKey, revisionField: o.revisionField, sourceTokenField: o.sourceTokenField, computed: void 0, columns: o.columns, headerGrid: void 0, rowHeightMm: o.rowHeightMm ?? e.rowHeightMm, detail: void 0 });
|
|
578
|
+
return { list: c, inter: { ...we(c, r.measurer), rowHeightFloorMm: c.rowHeightMm ?? 0 }, rows: s, sources: re(c, i) };
|
|
518
579
|
}
|
|
519
|
-
function
|
|
580
|
+
function Xe(e) {
|
|
520
581
|
return typeof e == "string" && !!e.trim() || typeof e == "number" && Number.isFinite(e);
|
|
521
582
|
}
|
|
522
|
-
function
|
|
523
|
-
if (!
|
|
524
|
-
return
|
|
583
|
+
function de(e) {
|
|
584
|
+
if (!Xe(e)) throw new Error("主从关联键必须是非空字符串或有限数字");
|
|
585
|
+
return ze(e);
|
|
525
586
|
}
|
|
526
|
-
function*
|
|
587
|
+
function* kr(e, t, r, o, n) {
|
|
527
588
|
if (!r) return;
|
|
528
|
-
const a = r.rows.get(
|
|
589
|
+
const a = r.rows.get(de(t[e.detail.parentKey])) ?? [];
|
|
529
590
|
if (!a.length) return;
|
|
530
591
|
const s = { id: `${o.tableId}:detail`, columnKeys: r.list.columns.map((i) => i.field), title: e.detail.label };
|
|
531
|
-
e.detail.label && n.placeGridRow({ ...
|
|
592
|
+
e.detail.label && n.placeGridRow({ ...G(r.inter, o.measurer, e.detail.label, /* @__PURE__ */ new Map(), {}, r.list.columns.length), table: s }, "listdl", "group-header"), e.detail.header !== !1 && n.placeGridRow({ grid: r.inter.headerGrid, heightMm: r.inter.headerHeightMm, table: s }, "listdh", "header"), yield* o.takePages();
|
|
532
593
|
for (const i of a)
|
|
533
594
|
V(o.signal), n.placeGridRow({ ...W(r.inter, i, o.measurer), table: s }, "listdr", "body", r.sources.get(i)), yield* o.takePages();
|
|
534
595
|
}
|
|
535
|
-
function
|
|
536
|
-
if (!e.matrix) return { list: e, rows: t };
|
|
537
|
-
if (e.detail || e.groupBy || e.groups?.length || e.grandTotal) throw new Error("矩阵不能同时配置普通分组、总计或主从明细");
|
|
538
|
-
const r = Ot(t, e.matrix), o = r.columns.map((a, s) => ({ ...a, widthMm: s === 0 ? e.matrix.rowWidthMm ?? 40 : e.matrix.columnWidthMm ?? 28, editable: !1, align: s === 0 ? "center" : "right" })), n = { ...e, columns: o, headerGrid: void 0, rowKey: void 0, revisionField: void 0, sourceTokenField: void 0 };
|
|
539
|
-
return e.layout === "wide" && (n.widthMm = o.reduce((a, s) => a + s.widthMm, 0)), { list: n, rows: r.rows };
|
|
540
|
-
}
|
|
541
|
-
function qe(e) {
|
|
596
|
+
function Ye(e) {
|
|
542
597
|
if (e.matrix || e.detail || e.groups?.length || e.groupBy || e.rowVisibleWhen) throw new Error("树形布局不能同时配置普通分组、矩阵、主从或行可见条件");
|
|
543
598
|
if (e.rowKey && e.rowKey !== e.tree.idField) throw new Error("树形布局的 rowKey 应与 idField 一致");
|
|
544
599
|
if (!e.columns.some((t) => t.field === e.tree.labelField && !t.hidden)) throw new Error("树形布局需要可见的标签列");
|
|
545
|
-
|
|
600
|
+
Lt(e.tree, e.computed);
|
|
546
601
|
}
|
|
547
|
-
function
|
|
548
|
-
|
|
549
|
-
const o =
|
|
602
|
+
function $r(e, t, r) {
|
|
603
|
+
Ye(e);
|
|
604
|
+
const o = Ht(t, e.tree, { signal: r.signal, computed: e.computed?.length ? { fields: e.computed, formula: r.formula } : void 0 }), n = { ...e, rowKey: e.tree.idField }, a = re(n, o.entries.map((c) => c.original)), s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new WeakMap();
|
|
550
605
|
for (const c of o.entries)
|
|
551
606
|
s.set(c.row, a.get(c.original)), i.set(c.row, c);
|
|
552
607
|
return { list: n, rows: o.rows, sources: s, treeRows: i, totalRows: o.leaves };
|
|
553
608
|
}
|
|
554
|
-
function
|
|
609
|
+
function Rr(e, t) {
|
|
555
610
|
if (e.cardinality === "record") {
|
|
556
611
|
if (t.length > 1) throw new Error(`单记录区域 ${e.id ?? e.dataset} 仅允许 0 或 1 行数据`);
|
|
557
612
|
if (e.tree || e.matrix || e.detail || e.groups?.length || e.groupBy || e.grandTotal || e.rowVisibleWhen) throw new Error("单记录区域不能配置树、矩阵、主从、分组、总计或行过滤");
|
|
558
613
|
if (!t.length) return { list: { ...e, columns: e.columns.map((r) => ({ ...r, editable: !1 })) }, rows: [{}], sources: /* @__PURE__ */ new Map() };
|
|
559
614
|
}
|
|
560
615
|
}
|
|
561
|
-
function
|
|
616
|
+
function Qe(e, t, r) {
|
|
562
617
|
const o = r.prepared.get(e);
|
|
563
618
|
if (o) return o;
|
|
564
|
-
const n =
|
|
619
|
+
const n = Rr(e, t);
|
|
565
620
|
if (n)
|
|
566
621
|
return r.prepared.set(e, n), n;
|
|
567
622
|
if (e.tree) {
|
|
568
|
-
const c =
|
|
623
|
+
const c = $r(e, t, r);
|
|
569
624
|
return r.prepared.set(e, c), c;
|
|
570
625
|
}
|
|
571
|
-
let a = e.computed?.length ?
|
|
572
|
-
const s = a === t ? void 0 : new Map(a.map((c,
|
|
626
|
+
let a = e.computed?.length ? Le(t, { fields: e.computed, signal: r.signal, formula: r.formula }).rows : t;
|
|
627
|
+
const s = a === t ? void 0 : new Map(a.map((c, l) => [c, t[l]]));
|
|
573
628
|
e.rowVisibleWhen && (a = a.filter((c) => H(c, e.rowVisibleWhen)));
|
|
574
|
-
const i =
|
|
629
|
+
const i = Zt(e, a);
|
|
575
630
|
if (!e.matrix) {
|
|
576
|
-
const c =
|
|
577
|
-
i.sources = s ? new Map(a.map((
|
|
631
|
+
const c = re(e, s ? a.map((l) => s.get(l)) : a);
|
|
632
|
+
i.sources = s ? new Map(a.map((l) => [l, c.get(s.get(l))])) : c;
|
|
578
633
|
}
|
|
579
634
|
return r.prepared.set(e, i), i;
|
|
580
635
|
}
|
|
581
|
-
function
|
|
636
|
+
function Ir(e, t, r, o) {
|
|
582
637
|
if (!o.flow) return;
|
|
583
|
-
const { current: n, templatePage: a } = o, s = Math.max(n.marginTopMm,
|
|
584
|
-
i + c <=
|
|
638
|
+
const { current: n, templatePage: a } = o, s = Math.max(n.marginTopMm, B(a)), i = Math.max(o.startTop ?? e.topMm, s), c = (e.header === !1 ? 0 : t.headerHeightMm) + (r[0] ? W(t, r[0], o.measurer).heightMm : 0);
|
|
639
|
+
i + c <= U(a, n) + 1e-3 || i <= s + 1e-3 || (o.pushCurrent(), n.components = [], n.heightMm = a.heightMm, a.layout === "wide" && (n.marginTopMm = 0, n.marginBottomMm = 0), o.startTop = Math.max(n.marginTopMm, B(a)));
|
|
585
640
|
}
|
|
586
|
-
function*
|
|
587
|
-
const o =
|
|
641
|
+
function* Er(e, t, r) {
|
|
642
|
+
const o = Qe(e, t, r), n = o.rows;
|
|
588
643
|
e = o.list, e.layout === "wide" && (r.current.widthMm = Math.max(r.current.widthMm, e.leftMm + e.widthMm + r.current.marginRightMm));
|
|
589
|
-
const a = o.sources ??
|
|
590
|
-
|
|
591
|
-
const
|
|
644
|
+
const a = o.sources ?? re(e, n), s = ye(e), i = oe(s), c = { ...we(s, r.measurer), rowHeightFloorMm: s.rowHeightMm ?? 0, matrix: o.matrix, ...o.treeRows ? { tree: { list: s, rows: o.treeRows } } : {} };
|
|
645
|
+
Ir(s, c, n, r);
|
|
646
|
+
const l = Sr(s, c, r), d = Pr(s, n, r);
|
|
592
647
|
let f;
|
|
593
|
-
for (const u of
|
|
648
|
+
for (const u of _e(n, i)) {
|
|
594
649
|
if (V(r.signal), u.kind === "row")
|
|
595
|
-
|
|
650
|
+
l.placeGridRow(f ?? W(c, u.row, r.measurer), "listr", Yt(o.matrix, u.row), a.get(u.row)), f = void 0, yield* r.takePages(), yield* kr(s, u.row, d, r, l);
|
|
596
651
|
else if (u.kind === "groupHeader") {
|
|
597
|
-
const m =
|
|
652
|
+
const m = G(c, r.measurer, u.label, /* @__PURE__ */ new Map(), u.group.headerStyle ?? {}, s.columns.length);
|
|
598
653
|
f ??= W(c, u.firstRow, r.measurer);
|
|
599
|
-
const h = i.slice(u.depth + 1).reduce((g,
|
|
600
|
-
u.group.keepWithNext !== !1 &&
|
|
654
|
+
const h = i.slice(u.depth + 1).reduce((g, p) => g + G(c, r.measurer, (p.headerTemplate ?? "{value}").replace(/\{value\}/g, he(u.firstRow[p.field])), /* @__PURE__ */ new Map(), p.headerStyle ?? {}, s.columns.length).heightMm, 0);
|
|
655
|
+
u.group.keepWithNext !== !1 && l.keepTogether(m.heightMm + h + f.heightMm), l.placeGridRow(m, "listg", "group-header"), u.group.repeatHeader && l.setGroupHeader(u.depth, m);
|
|
601
656
|
} else if (u.kind === "subtotal") {
|
|
602
|
-
const m = u.group.subtotal ?? [], h = u.group.aggregates ?? [], g =
|
|
603
|
-
|
|
604
|
-
} else
|
|
657
|
+
const m = u.group.subtotal ?? [], h = u.group.aggregates ?? [], g = G(c, r.measurer, u.label, qe(s.columns, u.rows, m, h), u.group.subtotalStyle ?? {}, Ue(s.columns, [...m, ...h.map((p) => p.field)]));
|
|
658
|
+
l.placeGridRow(g, "listst", "subtotal");
|
|
659
|
+
} else l.setGroupHeader(u.depth);
|
|
605
660
|
yield* r.takePages();
|
|
606
661
|
}
|
|
607
|
-
|
|
662
|
+
Tr(s, o.totalRows ?? n, c, r, l), r.finished?.(l.bottom()), yield* r.takePages();
|
|
608
663
|
}
|
|
609
|
-
function
|
|
664
|
+
function ne(e) {
|
|
610
665
|
return e.kind !== "list" && (e.pageAnchor !== void 0 || e.kind === "text" && typeof e.text == "string" && (e.text.includes("{page}") || e.text.includes("{totalPages}")));
|
|
611
666
|
}
|
|
612
|
-
function
|
|
667
|
+
function ae(e, t) {
|
|
613
668
|
return {
|
|
614
669
|
...e,
|
|
615
670
|
...e.text === void 0 ? {} : { text: t(e.text) },
|
|
616
671
|
...e.lines ? { lines: e.lines.map(t) } : {},
|
|
617
672
|
...e.richParagraphs ? { richParagraphs: e.richParagraphs.map((r) => ({ ...r, segments: r.segments.map((o) => ({ ...o, ...o.text === void 0 ? {} : { text: t(o.text) } })) })) } : {},
|
|
618
|
-
...e.grid ? { grid: { ...e.grid, cells: e.grid.cells.map((r) => r.map((o) => o ? { ...o, ...o.text === void 0 ? {} : { text: t(o.text) }, ...o.children ? { children: o.children.map((n) =>
|
|
673
|
+
...e.grid ? { grid: { ...e.grid, cells: e.grid.cells.map((r) => r.map((o) => o ? { ...o, ...o.text === void 0 ? {} : { text: t(o.text) }, ...o.children ? { children: o.children.map((n) => ae(n, t)) } : {} } : null)) } } : {}
|
|
619
674
|
};
|
|
620
675
|
}
|
|
621
|
-
function
|
|
676
|
+
function Cr(e) {
|
|
622
677
|
let t = !1;
|
|
623
|
-
for (const r of e.pages) for (const o of r.components)
|
|
678
|
+
for (const r of e.pages) for (const o of r.components) ne(o) && ae(o, (n) => (n.includes("{totalPages}") && (t = !0), n));
|
|
624
679
|
return t;
|
|
625
680
|
}
|
|
626
|
-
function
|
|
681
|
+
function Or(e, t, r, o, n, a) {
|
|
627
682
|
const s = {
|
|
628
683
|
pageWidthMm: t.widthMm,
|
|
629
684
|
pageHeightMm: t.heightMm,
|
|
@@ -635,40 +690,40 @@ function xr(e, t, r, o, n, a) {
|
|
|
635
690
|
components: t.components,
|
|
636
691
|
...e.meta ? { meta: e.meta } : {}
|
|
637
692
|
}, i = (c) => {
|
|
638
|
-
const
|
|
639
|
-
return a === void 0 ?
|
|
693
|
+
const l = c.replace(/\{page\}/g, String(o));
|
|
694
|
+
return a === void 0 ? l : l.replace(/\{totalPages\}/g, String(a));
|
|
640
695
|
};
|
|
641
|
-
for (const c of r) s.components.push(
|
|
696
|
+
for (const c of r) s.components.push(ae(c, i));
|
|
642
697
|
if (e.layout === "wide") {
|
|
643
|
-
const c = s.components.reduce((
|
|
698
|
+
const c = s.components.reduce((l, d) => Math.max(l, d.topMm + d.heightMm), 0);
|
|
644
699
|
s.marginBottomMm = n ? e.marginBottomMm ?? 0 : 0, s.pageHeightMm = Math.max(1, c + s.marginBottomMm);
|
|
645
700
|
}
|
|
646
701
|
return s;
|
|
647
702
|
}
|
|
648
|
-
function
|
|
649
|
-
return e.cells.reduce((t, r) => t + r.reduce((o, n) => o + (n ? 1 + (n.children?.reduce((a, s) => a +
|
|
703
|
+
function be(e) {
|
|
704
|
+
return e.cells.reduce((t, r) => t + r.reduce((o, n) => o + (n ? 1 + (n.children?.reduce((a, s) => a + Ze(s), 0) ?? 0) : 0), 0), 0);
|
|
650
705
|
}
|
|
651
|
-
function
|
|
652
|
-
return e.grid ?
|
|
706
|
+
function Ze(e) {
|
|
707
|
+
return e.grid ? be(e.grid) : 0;
|
|
653
708
|
}
|
|
654
|
-
function
|
|
709
|
+
function Me(e) {
|
|
655
710
|
for (const t of ["maxPages", "maxCells", "knownTotalPages"]) if (e[t] !== void 0 && (!Number.isSafeInteger(e[t]) || e[t] < 1)) throw new RangeError(`${t} 应为正安全整数`);
|
|
656
711
|
}
|
|
657
|
-
function
|
|
658
|
-
const r =
|
|
712
|
+
function Fr(e, t) {
|
|
713
|
+
const r = Qe(e, t.datasets[e.dataset] ?? [], t), o = ye(r.list), n = { ...we(o, t.measurer), rowHeightFloorMm: o.rowHeightMm ?? 0 };
|
|
659
714
|
return (o.header === !1 ? 0 : n.headerHeightMm) + r.rows.reduce((a, s) => a + W(n, s, t.measurer).heightMm, 0);
|
|
660
715
|
}
|
|
661
|
-
function*
|
|
716
|
+
function* Ar(e) {
|
|
662
717
|
const { templatePage: t, current: r } = e, o = new Map(t.components.map((a, s) => [a, s])), n = (a, s, i) => {
|
|
663
718
|
const c = e.datasets[a.dataset];
|
|
664
|
-
return Array.isArray(c) || e.warnings.push(`数据集 ${a.dataset} 未提供数据,列表 ${a.id ?? ""} 输出为空`),
|
|
719
|
+
return Array.isArray(c) || e.warnings.push(`数据集 ${a.dataset} 未提供数据,列表 ${a.id ?? ""} 输出为空`), Er(a, Array.isArray(c) ? c : [], { ...e, tableId: `${e.tableId}:${o.get(a)}`, startTop: s, finished: i, flow: !!t.flow });
|
|
665
720
|
};
|
|
666
721
|
if (t.flow) {
|
|
667
|
-
yield*
|
|
722
|
+
yield* or({
|
|
668
723
|
page: t,
|
|
669
724
|
active: () => V(e.signal),
|
|
670
|
-
top: () => Math.max(r.marginTopMm,
|
|
671
|
-
bottom: () =>
|
|
725
|
+
top: () => Math.max(r.marginTopMm, B(t)),
|
|
726
|
+
bottom: () => U(t, r),
|
|
672
727
|
append: (a) => {
|
|
673
728
|
r.components.push(a);
|
|
674
729
|
},
|
|
@@ -676,128 +731,128 @@ function* Pr(e) {
|
|
|
676
731
|
e.pushCurrent(), r.components = [], r.heightMm = t.heightMm, t.layout === "wide" && (r.marginTopMm = 0, r.marginBottomMm = 0);
|
|
677
732
|
},
|
|
678
733
|
takePages: e.takePages,
|
|
679
|
-
height: (a) =>
|
|
734
|
+
height: (a) => Fr(a, e),
|
|
680
735
|
list: n
|
|
681
736
|
});
|
|
682
737
|
return;
|
|
683
738
|
}
|
|
684
739
|
for (const a of t.components)
|
|
685
|
-
|
|
740
|
+
ne(a) || (a.kind === "list" ? yield* n(a) : r.components.push(a));
|
|
686
741
|
}
|
|
687
|
-
function*
|
|
742
|
+
function* X(e, t, r, o, n, a = /* @__PURE__ */ new WeakMap()) {
|
|
688
743
|
let s = 0, i = 0, c = 0;
|
|
689
|
-
const d = (
|
|
690
|
-
for (const { pageIndex:
|
|
744
|
+
const l = Xt(r.measurer ?? Oe), d = (f) => `${f}_${(++s).toString(36)}`;
|
|
745
|
+
for (const { pageIndex: f, page: u } of mr(e, t, r)) {
|
|
691
746
|
V(r.signal);
|
|
692
|
-
const
|
|
693
|
-
let
|
|
694
|
-
const
|
|
695
|
-
if (V(r.signal), r.maxPages !== void 0 && i >= r.maxPages) throw new
|
|
696
|
-
if (r.maxCells !== void 0 && (c += [...
|
|
747
|
+
const m = gr(u), h = u.components.filter(ne);
|
|
748
|
+
let g = [];
|
|
749
|
+
const p = (M = !1) => {
|
|
750
|
+
if (V(r.signal), r.maxPages !== void 0 && i >= r.maxPages) throw new K(r.maxPages, i + 1);
|
|
751
|
+
if (r.maxCells !== void 0 && (c += [...m.components, ...h].reduce((T, S) => T + Ze(S), 0), c > r.maxCells))
|
|
697
752
|
throw new D(r.maxCells, c);
|
|
698
|
-
|
|
699
|
-
},
|
|
700
|
-
const
|
|
701
|
-
return
|
|
753
|
+
g.push(Or(u, m, h, ++i, M, n));
|
|
754
|
+
}, b = () => {
|
|
755
|
+
const M = g;
|
|
756
|
+
return g = [], M;
|
|
702
757
|
};
|
|
703
|
-
yield*
|
|
704
|
-
templatePage:
|
|
705
|
-
current:
|
|
758
|
+
yield* Ar({
|
|
759
|
+
templatePage: u,
|
|
760
|
+
current: m,
|
|
706
761
|
warnings: o,
|
|
707
762
|
nextId: d,
|
|
708
|
-
pushCurrent:
|
|
709
|
-
takePages:
|
|
763
|
+
pushCurrent: p,
|
|
764
|
+
takePages: b,
|
|
710
765
|
datasets: t,
|
|
711
766
|
signal: r.signal,
|
|
712
767
|
formula: r.formula,
|
|
713
768
|
prepared: a,
|
|
714
|
-
measurer:
|
|
769
|
+
measurer: l,
|
|
715
770
|
mmPerRow: r.mmPerRow ?? 0,
|
|
716
|
-
tableId: `table:${
|
|
717
|
-
}),
|
|
771
|
+
tableId: `table:${f}`
|
|
772
|
+
}), p(!0), yield* b();
|
|
718
773
|
}
|
|
719
774
|
}
|
|
720
|
-
function
|
|
721
|
-
|
|
775
|
+
function Ao(e, t, r = {}) {
|
|
776
|
+
Me(r);
|
|
722
777
|
let o = 0;
|
|
723
|
-
for (const n of
|
|
778
|
+
for (const n of X(e, t, { ...r, onWarning: void 0 }, [])) o++;
|
|
724
779
|
return o;
|
|
725
780
|
}
|
|
726
|
-
function*
|
|
727
|
-
|
|
728
|
-
const o =
|
|
781
|
+
function* Nr(e, t, r = {}) {
|
|
782
|
+
Me(r);
|
|
783
|
+
const o = Cr(e), n = /* @__PURE__ */ new WeakMap();
|
|
729
784
|
let a = r.knownTotalPages;
|
|
730
785
|
if (o && a === void 0) {
|
|
731
786
|
a = 0;
|
|
732
|
-
for (const c of
|
|
787
|
+
for (const c of X(e, t, r, [], void 0, n)) a++;
|
|
733
788
|
}
|
|
734
789
|
const s = [];
|
|
735
790
|
let i = 0;
|
|
736
|
-
for (const c of
|
|
791
|
+
for (const c of X(e, t, r, s, a, n)) {
|
|
737
792
|
for (; i < s.length; i++) r.onWarning?.(s[i]);
|
|
738
793
|
yield c;
|
|
739
794
|
}
|
|
740
795
|
}
|
|
741
|
-
function
|
|
796
|
+
function et(e, t, r = {}) {
|
|
742
797
|
const o = typeof r == "number" ? { mmPerRow: r } : r;
|
|
743
|
-
|
|
744
|
-
const n = [], a = [...
|
|
745
|
-
for (const s of a) s.components = s.components.map((i) =>
|
|
746
|
-
return n.forEach((s) => o.onWarning?.(s)), { plan: { schemaVersion:
|
|
798
|
+
Me(o);
|
|
799
|
+
const n = [], a = [...X(e, t, o, n, o.knownTotalPages)];
|
|
800
|
+
for (const s of a) s.components = s.components.map((i) => ne(i) ? ae(i, (c) => c.replace(/\{totalPages\}/g, String(a.length))) : i);
|
|
801
|
+
return n.forEach((s) => o.onWarning?.(s)), { plan: { schemaVersion: Q, ...te(e) ? { requiresRecalculation: !0 } : {}, pages: a }, warnings: n };
|
|
747
802
|
}
|
|
748
|
-
function
|
|
803
|
+
function Kr(e) {
|
|
749
804
|
const t = e.columns.find((a) => !a.hidden)?.field;
|
|
750
805
|
if (!t) return { groups: 0, total: 0 };
|
|
751
|
-
const r =
|
|
806
|
+
const r = oe(e), o = (a = [], s = []) => a.includes(t) || s.some((i) => i.field === t), n = typeof e.grandTotal == "object" ? e.grandTotal : void 0;
|
|
752
807
|
return { groups: r.filter((a) => o(a.subtotal, a.aggregates)).length, total: Number(o(n?.fields ?? r[0]?.subtotal, n?.aggregates ?? r[0]?.aggregates)) };
|
|
753
808
|
}
|
|
754
|
-
function
|
|
755
|
-
|
|
756
|
-
const o =
|
|
809
|
+
function jr(e, t, r) {
|
|
810
|
+
Ye(e);
|
|
811
|
+
const o = He(t[e.dataset] ?? [], e.tree, r), n = e.columns.filter((s) => !s.hidden).length, a = e.header === !1 ? 0 : e.headerGrid ? be(e.headerGrid) : n;
|
|
757
812
|
return o.length * n + a + +!!e.grandTotal * 2 * n;
|
|
758
813
|
}
|
|
759
|
-
function
|
|
760
|
-
if (e.tree) return
|
|
814
|
+
function No(e, t, r = {}) {
|
|
815
|
+
if (e.tree) return jr(e, t, r.signal);
|
|
761
816
|
if (e.matrix) {
|
|
762
817
|
let c = t[e.dataset] ?? [];
|
|
763
|
-
e.computed?.length && (c =
|
|
764
|
-
const
|
|
765
|
-
return
|
|
818
|
+
e.computed?.length && (c = Le(c, { fields: e.computed, ...r }).rows), e.rowVisibleWhen && (c = c.filter((d) => H(d, e.rowVisibleWhen)));
|
|
819
|
+
const l = jt(c, e.matrix);
|
|
820
|
+
return l.cells + (e.header === !1 ? 0 : l.columnCount * (e.matrix.hierarchy ? e.matrix.columnFields.length + 1 : 1));
|
|
766
821
|
}
|
|
767
|
-
const o = t[e.dataset]?.length ?? 0, n = e.columns.filter((c) => !c.hidden).length, a =
|
|
822
|
+
const o = t[e.dataset]?.length ?? 0, n = e.columns.filter((c) => !c.hidden).length, a = oe(e).length, s = Kr(e);
|
|
768
823
|
let i = (o * (1 + 2 * a + s.groups) + +!!e.grandTotal * (1 + s.total)) * n;
|
|
769
|
-
if (i += e.header === !1 ? 0 : e.headerGrid ?
|
|
770
|
-
const c = t[e.detail.dataset]?.length ?? 0,
|
|
771
|
-
i += (c + o * (+(e.detail.header !== !1) + +!!e.detail.label)) *
|
|
824
|
+
if (i += e.header === !1 ? 0 : e.headerGrid ? be(e.headerGrid) : n, e.cardinality === "record" && o === 0 && (i += n), e.detail) {
|
|
825
|
+
const c = t[e.detail.dataset]?.length ?? 0, l = e.detail.columns.filter((d) => !d.hidden).length;
|
|
826
|
+
i += (c + o * (+(e.detail.header !== !1) + +!!e.detail.label)) * l;
|
|
772
827
|
}
|
|
773
828
|
if (!Number.isSafeInteger(i)) throw new RangeError("报表单元格估算超出安全整数预算");
|
|
774
829
|
return i;
|
|
775
830
|
}
|
|
776
|
-
function
|
|
831
|
+
function tt(e) {
|
|
777
832
|
return !e || typeof e != "object" ? !1 : [e.pageIndex, e.componentIndex, e.rowIndex, e.columnIndex].every((t) => Number.isInteger(t) && t >= 0);
|
|
778
833
|
}
|
|
779
|
-
function
|
|
834
|
+
function rt(e, t, r) {
|
|
780
835
|
const o = e.grid;
|
|
781
836
|
if (!o) return null;
|
|
782
837
|
const n = o.cells[t];
|
|
783
838
|
if (!n) return null;
|
|
784
|
-
const s =
|
|
839
|
+
const s = ee(o, e.widthMm, e.heightMm).cells.filter((c) => c.ri === t).findIndex((c) => c.ci === r), i = n[s];
|
|
785
840
|
return i ? { cell: i, sourceColumnIndex: s } : null;
|
|
786
841
|
}
|
|
787
|
-
function
|
|
842
|
+
function Lr(e) {
|
|
788
843
|
return e.value !== void 0 ? e.value : e.rawText ?? e.text ?? null;
|
|
789
844
|
}
|
|
790
|
-
function
|
|
845
|
+
function Hr(e, t) {
|
|
791
846
|
return e.valueType ? e.valueType : typeof t == "number" ? "number" : typeof t == "boolean" ? "boolean" : t === null && e.numberFormat && /[0#?]/.test(e.numberFormat) ? "number" : "text";
|
|
792
847
|
}
|
|
793
|
-
function
|
|
848
|
+
function Dr(e, t) {
|
|
794
849
|
if (e.derived) return "derived";
|
|
795
850
|
if (e.editable === !1) return "cell";
|
|
796
851
|
if (e.formula !== void 0) return "formula";
|
|
797
852
|
if (e.children?.length || e.richParagraphs?.length) return "complex";
|
|
798
853
|
if (t.table && t.table.role !== "body" && e.editable !== !0) return "structure";
|
|
799
854
|
}
|
|
800
|
-
function
|
|
855
|
+
function Gr(e, t) {
|
|
801
856
|
const r = e.table;
|
|
802
857
|
if (r)
|
|
803
858
|
return {
|
|
@@ -807,100 +862,100 @@ function Or(e, t) {
|
|
|
807
862
|
columnKey: r.columnKeys[t.columnIndex]
|
|
808
863
|
};
|
|
809
864
|
}
|
|
810
|
-
function
|
|
865
|
+
function Br(e, t, r) {
|
|
811
866
|
if (e.derived) return;
|
|
812
867
|
if (e.source) return { ...e.source };
|
|
813
868
|
const o = t.table?.source, n = t.table?.columnKeys[r.columnIndex];
|
|
814
869
|
if (!(!o || o.rowKey === void 0 || n === void 0))
|
|
815
870
|
return { ...o, rowKey: o.rowKey, field: n };
|
|
816
871
|
}
|
|
817
|
-
function
|
|
818
|
-
const o =
|
|
872
|
+
function ot(e, t, r) {
|
|
873
|
+
const o = Lr(r), n = Dr(r, e);
|
|
819
874
|
return {
|
|
820
875
|
address: { ...t },
|
|
821
876
|
cell: r,
|
|
822
877
|
component: e,
|
|
823
878
|
value: o,
|
|
824
|
-
valueType:
|
|
825
|
-
table:
|
|
826
|
-
source:
|
|
879
|
+
valueType: Hr(r, o),
|
|
880
|
+
table: Gr(e, t),
|
|
881
|
+
source: Br(r, e, t),
|
|
827
882
|
editable: n === void 0,
|
|
828
883
|
readOnlyReason: n
|
|
829
884
|
};
|
|
830
885
|
}
|
|
831
|
-
function
|
|
832
|
-
if (!
|
|
886
|
+
function ve(e, t) {
|
|
887
|
+
if (!tt(t)) return null;
|
|
833
888
|
const r = e.pages[t.pageIndex]?.components[t.componentIndex];
|
|
834
889
|
if (!r) return null;
|
|
835
|
-
const o =
|
|
836
|
-
return o ?
|
|
890
|
+
const o = rt(r, t.rowIndex, t.columnIndex);
|
|
891
|
+
return o ? ot(r, t, o.cell) : null;
|
|
837
892
|
}
|
|
838
893
|
function j(e) {
|
|
839
894
|
const t = /* @__PURE__ */ new Map();
|
|
840
895
|
return (r) => {
|
|
841
|
-
if (!
|
|
896
|
+
if (!tt(r)) return null;
|
|
842
897
|
const o = e.pages[r.pageIndex]?.components[r.componentIndex];
|
|
843
898
|
if (!o?.grid) return null;
|
|
844
899
|
let n = t.get(o);
|
|
845
900
|
if (!n) {
|
|
846
901
|
const s = /* @__PURE__ */ new Map();
|
|
847
902
|
n = /* @__PURE__ */ new Map();
|
|
848
|
-
for (const i of
|
|
903
|
+
for (const i of ee(o.grid, o.widthMm, o.heightMm).cells) {
|
|
849
904
|
const c = s.get(i.ri) ?? 0;
|
|
850
905
|
s.set(i.ri, c + 1);
|
|
851
|
-
const
|
|
852
|
-
|
|
906
|
+
const l = o.grid.cells[i.ri]?.[c];
|
|
907
|
+
l && n.set(`${i.ri}:${i.ci}`, l);
|
|
853
908
|
}
|
|
854
909
|
t.set(o, n);
|
|
855
910
|
}
|
|
856
911
|
const a = n.get(`${r.rowIndex}:${r.columnIndex}`);
|
|
857
|
-
return a ?
|
|
912
|
+
return a ? ot(o, r, a) : null;
|
|
858
913
|
};
|
|
859
914
|
}
|
|
860
|
-
class
|
|
915
|
+
class y extends Error {
|
|
861
916
|
constructor(t) {
|
|
862
917
|
super(`Invalid report cell edit: ${t}`), this.code = t, this.name = "ReportCellEditError";
|
|
863
918
|
}
|
|
864
919
|
}
|
|
865
|
-
function
|
|
920
|
+
function Wr(e, t) {
|
|
866
921
|
let r = e.trim();
|
|
867
922
|
const o = t && r.endsWith("%");
|
|
868
|
-
if (o && (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
|
|
923
|
+
if (o && (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 y("number");
|
|
869
924
|
return Number(r) / (o ? 100 : 1);
|
|
870
925
|
}
|
|
871
|
-
function
|
|
926
|
+
function Vr(e, t) {
|
|
872
927
|
if (e === null || typeof e == "string" && e.trim() === "") return null;
|
|
873
|
-
if (typeof e != "string" && typeof e != "number") throw new
|
|
874
|
-
const r = typeof e == "number" ? e :
|
|
875
|
-
if (!Number.isFinite(r) || Number.isInteger(r) && !Number.isSafeInteger(r)) throw new
|
|
928
|
+
if (typeof e != "string" && typeof e != "number") throw new y("number");
|
|
929
|
+
const r = typeof e == "number" ? e : Wr(e, _t(t.cell.numberFormat));
|
|
930
|
+
if (!Number.isFinite(r) || Number.isInteger(r) && !Number.isSafeInteger(r)) throw new y("number");
|
|
876
931
|
return r;
|
|
877
932
|
}
|
|
878
|
-
function
|
|
933
|
+
function Jr(e) {
|
|
879
934
|
if (e === null || typeof e == "string" && e.trim() === "") return null;
|
|
880
935
|
if (typeof e == "boolean") return e;
|
|
881
936
|
const t = String(e).trim().toLowerCase();
|
|
882
937
|
if (["true", "yes", "是", "1"].includes(t)) return !0;
|
|
883
938
|
if (["false", "no", "否", "0"].includes(t)) return !1;
|
|
884
|
-
throw new
|
|
939
|
+
throw new y("boolean");
|
|
885
940
|
}
|
|
886
|
-
function
|
|
887
|
-
return e.valueType === "number" ?
|
|
941
|
+
function nt(e, t) {
|
|
942
|
+
return e.valueType === "number" ? Vr(t, e) : e.valueType === "boolean" ? Jr(t) : t === null ? null : String(t);
|
|
888
943
|
}
|
|
889
|
-
function
|
|
944
|
+
function zr(e, t) {
|
|
890
945
|
const r = t.cell.text, n = [["是", "否"], ["TRUE", "FALSE"], ["True", "False"], ["true", "false"], ["1", "0"]].find((a) => a.includes(r ?? ""));
|
|
891
946
|
return n ? n[e ? 0 : 1] : String(e);
|
|
892
947
|
}
|
|
893
|
-
function
|
|
894
|
-
return t === null ? "" : typeof t == "boolean" ?
|
|
948
|
+
function z(e, t) {
|
|
949
|
+
return t === null ? "" : typeof t == "boolean" ? zr(t, e) : typeof t == "number" ? zt(t, e.cell.numberFormat) : String(t);
|
|
895
950
|
}
|
|
896
|
-
function
|
|
897
|
-
const o =
|
|
898
|
-
if (!o) throw new
|
|
899
|
-
return
|
|
951
|
+
function Ko(e, t, r) {
|
|
952
|
+
const o = ve(e, t);
|
|
953
|
+
if (!o) throw new y("missing");
|
|
954
|
+
return _(o, r);
|
|
900
955
|
}
|
|
901
|
-
function
|
|
902
|
-
if (!e.editable) throw new
|
|
903
|
-
const r =
|
|
956
|
+
function _(e, t) {
|
|
957
|
+
if (!e.editable) throw new y("readonly");
|
|
958
|
+
const r = nt(e, t);
|
|
904
959
|
return {
|
|
905
960
|
address: { ...e.address },
|
|
906
961
|
table: e.table,
|
|
@@ -908,58 +963,58 @@ function z(e, t) {
|
|
|
908
963
|
previousValue: e.value,
|
|
909
964
|
previousText: e.cell.text ?? "",
|
|
910
965
|
value: r,
|
|
911
|
-
text:
|
|
966
|
+
text: z(e, r)
|
|
912
967
|
};
|
|
913
968
|
}
|
|
914
|
-
function
|
|
969
|
+
function _r(e, t) {
|
|
915
970
|
const r = e.table, o = t.table;
|
|
916
971
|
return !r || !o || r.columnKey === void 0 ? !1 : r.id === o.id && r.rowIndex === o.rowIndex && r.role === o.role && r.columnKey === o.columnKey;
|
|
917
972
|
}
|
|
918
|
-
function
|
|
919
|
-
const o = e.grid, { rowIndex: n, columnIndex: a } = t.address, s =
|
|
920
|
-
return c[s.sourceColumnIndex] =
|
|
973
|
+
function at(e, t, r) {
|
|
974
|
+
const o = e.grid, { rowIndex: n, columnIndex: a } = t.address, s = rt(e, n, a), i = [...o.cells], c = [...i[n]], l = z(t, r.value), d = { ...s.cell, value: r.value, text: l, rawText: l };
|
|
975
|
+
return c[s.sourceColumnIndex] = d, i[n] = c, { ...e, grid: { ...o, cells: i } };
|
|
921
976
|
}
|
|
922
|
-
function
|
|
977
|
+
function qr(e, t) {
|
|
923
978
|
const r = e.table?.columnKeys, o = t.table?.columnKey;
|
|
924
979
|
return r && o !== void 0 ? r.flatMap((n, a) => n === o ? [a] : []) : [];
|
|
925
980
|
}
|
|
926
|
-
function
|
|
981
|
+
function Ur(e, t, r, o, n, a) {
|
|
927
982
|
const s = t.table, i = n.table;
|
|
928
983
|
if (!s || !i || s.id !== i.id || s.role !== i.role || !t.grid) return t;
|
|
929
984
|
const c = i.rowIndex - s.rowIndex;
|
|
930
985
|
if (c < 0 || c >= t.grid.cells.length) return t;
|
|
931
|
-
let
|
|
932
|
-
for (const
|
|
933
|
-
const f =
|
|
934
|
-
f?.editable &&
|
|
986
|
+
let l = t;
|
|
987
|
+
for (const d of qr(t, n)) {
|
|
988
|
+
const f = ve(e, { pageIndex: r, componentIndex: o, rowIndex: c, columnIndex: d });
|
|
989
|
+
f?.editable && _r(n, f) && (l = at(l, f, a));
|
|
935
990
|
}
|
|
936
|
-
return
|
|
991
|
+
return l;
|
|
937
992
|
}
|
|
938
|
-
function
|
|
993
|
+
function Xr(e, t, r, o, n, a) {
|
|
939
994
|
const s = n.address;
|
|
940
|
-
return n.table?.columnKey !== void 0 ?
|
|
995
|
+
return n.table?.columnKey !== void 0 ? Ur(e, t, r, o, n, a) : s.pageIndex === r && s.componentIndex === o ? at(t, n, a) : t;
|
|
941
996
|
}
|
|
942
|
-
function
|
|
997
|
+
function Se(e, t) {
|
|
943
998
|
const r = t.source;
|
|
944
999
|
if (!r) return !1;
|
|
945
1000
|
const o = e.source;
|
|
946
1001
|
return !o || ["sourceScope", "datasetId", "rowKey", "field", "revision", "sourceToken"].some((n) => !Object.is(o[n], r[n]));
|
|
947
1002
|
}
|
|
948
|
-
function
|
|
949
|
-
const r =
|
|
950
|
-
if (!r) throw new
|
|
951
|
-
if (!r.editable) throw new
|
|
952
|
-
if (
|
|
953
|
-
if (!Object.is(r.value, t.previousValue) || (r.cell.text ?? "") !== t.previousText) throw new
|
|
954
|
-
const o =
|
|
1003
|
+
function jo(e, t) {
|
|
1004
|
+
const r = ve(e, t.address);
|
|
1005
|
+
if (!r) throw new y("missing");
|
|
1006
|
+
if (!r.editable) throw new y("readonly");
|
|
1007
|
+
if (Se(r, t)) throw new y("conflict");
|
|
1008
|
+
if (!Object.is(r.value, t.previousValue) || (r.cell.text ?? "") !== t.previousText) throw new y("conflict");
|
|
1009
|
+
const o = nt(r, t.value), n = { ...t, value: o, text: z(r, o) };
|
|
955
1010
|
if (Object.is(o, r.value) && n.text === r.cell.text) return e;
|
|
956
1011
|
const a = e.pages.map((s, i) => {
|
|
957
|
-
const c = s.components.map((
|
|
958
|
-
return c.every((
|
|
1012
|
+
const c = s.components.map((l, d) => Xr(e, l, i, d, r, n));
|
|
1013
|
+
return c.every((l, d) => l === s.components[d]) ? s : { ...s, components: c };
|
|
959
1014
|
});
|
|
960
1015
|
return { ...e, pages: a };
|
|
961
1016
|
}
|
|
962
|
-
function
|
|
1017
|
+
function st(e) {
|
|
963
1018
|
const t = [];
|
|
964
1019
|
for (const r of e.template.pages) for (const o of r.components)
|
|
965
1020
|
o.kind === "list" && (t.push(o.tree ? { ...o, rowKey: o.tree.idField } : o), o.detail && t.push({ ...o.detail, relation: { detail: o.detail, parentRows: e.datasets[o.dataset] ?? [] } }));
|
|
@@ -968,61 +1023,65 @@ function ot(e) {
|
|
|
968
1023
|
function L(e) {
|
|
969
1024
|
return JSON.stringify([e.sourceScope, e.datasetId]);
|
|
970
1025
|
}
|
|
971
|
-
function
|
|
1026
|
+
function Re(e) {
|
|
972
1027
|
return JSON.stringify([e.sourceScope, e.datasetId, e.rowKey]);
|
|
973
1028
|
}
|
|
974
|
-
function
|
|
1029
|
+
function it(e) {
|
|
975
1030
|
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
|
|
976
1031
|
return e.forEach((o, n) => {
|
|
977
|
-
for (const a of
|
|
1032
|
+
for (const a of st(o)) {
|
|
978
1033
|
if (!a.rowKey) continue;
|
|
979
1034
|
const s = a.relation, i = s ? new Set(s.parentRows.map((c) => JSON.stringify(c[s.detail.parentKey]))) : void 0;
|
|
980
|
-
(o.datasets[a.dataset] ?? []).forEach((c,
|
|
1035
|
+
(o.datasets[a.dataset] ?? []).forEach((c, l) => {
|
|
981
1036
|
if (s && !i.has(JSON.stringify(c[s.detail.foreignKey]))) return;
|
|
982
|
-
const
|
|
983
|
-
if (typeof
|
|
984
|
-
const f = `${n}:${a.dataset}:${
|
|
1037
|
+
const d = c[a.rowKey];
|
|
1038
|
+
if (typeof d != "string" && typeof d != "number") return;
|
|
1039
|
+
const f = `${n}:${a.dataset}:${l}:${a.rowKey}`;
|
|
985
1040
|
if (r.has(f)) return;
|
|
986
1041
|
r.add(f);
|
|
987
|
-
const u =
|
|
988
|
-
m.push({ partIndex: n, dataset: a.dataset, rowIndex:
|
|
1042
|
+
const u = Re({ sourceScope: o.sourceScope, datasetId: a.dataset, rowKey: d }), m = t.get(u) ?? [];
|
|
1043
|
+
m.push({ partIndex: n, dataset: a.dataset, rowIndex: l, row: c, binding: a }), t.set(u, m);
|
|
989
1044
|
});
|
|
990
1045
|
}
|
|
991
1046
|
}), (o) => {
|
|
992
|
-
const n = t.get(
|
|
993
|
-
if (!n?.length) throw new
|
|
994
|
-
if (new Set(n.map((a) => `${a.partIndex}:${a.dataset}`)).size !== n.length) throw new
|
|
1047
|
+
const n = t.get(Re(o));
|
|
1048
|
+
if (!n?.length) throw new y("missing");
|
|
1049
|
+
if (new Set(n.map((a) => `${a.partIndex}:${a.dataset}`)).size !== n.length) throw new y("conflict");
|
|
995
1050
|
return n;
|
|
996
1051
|
};
|
|
997
1052
|
}
|
|
998
|
-
function
|
|
1053
|
+
function ct(e, t) {
|
|
999
1054
|
const r = e.map((n) => ({ ...n, datasets: { ...n.datasets } })), o = /* @__PURE__ */ new Set();
|
|
1000
1055
|
for (const { row: n, field: a, value: s } of t) {
|
|
1001
|
-
const i = r[n.partIndex], c =
|
|
1056
|
+
const i = r[n.partIndex], c = JSON.stringify([n.partIndex, n.dataset]);
|
|
1002
1057
|
o.has(c) || (i.datasets[n.dataset] = [...i.datasets[n.dataset]], o.add(c)), i.datasets[n.dataset][n.rowIndex] = { ...i.datasets[n.dataset][n.rowIndex], [a]: s };
|
|
1003
1058
|
}
|
|
1059
|
+
for (const n of o) {
|
|
1060
|
+
const [a, s] = JSON.parse(n);
|
|
1061
|
+
At(e[a].datasets[s], r[a].datasets[s]);
|
|
1062
|
+
}
|
|
1004
1063
|
return r;
|
|
1005
1064
|
}
|
|
1006
|
-
function
|
|
1065
|
+
function Yr(e, t, r) {
|
|
1007
1066
|
const o = [], n = /* @__PURE__ */ new Set();
|
|
1008
1067
|
return e.forEach((a, s) => {
|
|
1009
|
-
for (const i of
|
|
1010
|
-
t.has(L({ sourceScope: a.sourceScope, datasetId: i.dataset })) && (a.datasets[i.dataset] ?? []).forEach((c,
|
|
1011
|
-
const
|
|
1068
|
+
for (const i of st(a))
|
|
1069
|
+
t.has(L({ sourceScope: a.sourceScope, datasetId: i.dataset })) && (a.datasets[i.dataset] ?? []).forEach((c, l) => {
|
|
1070
|
+
const d = { partIndex: s, dataset: i.dataset, rowIndex: l, row: c, binding: i };
|
|
1012
1071
|
for (const [f, u] of [[i.revisionField, r.revision], [i.sourceTokenField, r.sourceToken]]) {
|
|
1013
1072
|
if (!f || u === void 0) continue;
|
|
1014
|
-
const m = `${s}:${i.dataset}:${
|
|
1015
|
-
n.has(m) || (n.add(m), o.push({ row:
|
|
1073
|
+
const m = `${s}:${i.dataset}:${l}:${f}`;
|
|
1074
|
+
n.has(m) || (n.add(m), o.push({ row: d, field: f, value: u }));
|
|
1016
1075
|
}
|
|
1017
1076
|
});
|
|
1018
1077
|
}), o;
|
|
1019
1078
|
}
|
|
1020
|
-
function
|
|
1079
|
+
function Qr(e, t, r) {
|
|
1021
1080
|
if (!r || r.revision === void 0 && r.sourceToken === void 0) return e;
|
|
1022
1081
|
const o = new Set(t.edits.flatMap((n) => n.source ? [L(n.source)] : []));
|
|
1023
|
-
return
|
|
1082
|
+
return lt(e, new Map([...o].map((n) => [n, r])));
|
|
1024
1083
|
}
|
|
1025
|
-
function
|
|
1084
|
+
function lt(e, t) {
|
|
1026
1085
|
if (!t.size) return e;
|
|
1027
1086
|
function r(a) {
|
|
1028
1087
|
const s = a.datasetId && t.get(L({ ...a, datasetId: a.datasetId }));
|
|
@@ -1030,15 +1089,15 @@ function st(e, t) {
|
|
|
1030
1089
|
}
|
|
1031
1090
|
function o(a) {
|
|
1032
1091
|
const s = a.map((i) => {
|
|
1033
|
-
const c = i.table?.source ? r(i.table.source) : void 0,
|
|
1092
|
+
const c = i.table?.source ? r(i.table.source) : void 0, l = i.table && c !== i.table.source ? { ...i.table, source: c } : i.table, d = i.grid?.cells.map((u) => {
|
|
1034
1093
|
const m = u.map((h) => {
|
|
1035
1094
|
if (!h) return h;
|
|
1036
|
-
const g = h.source ? r(h.source) : void 0,
|
|
1037
|
-
return g === h.source &&
|
|
1095
|
+
const g = h.source ? r(h.source) : void 0, p = h.children ? o(h.children) : void 0;
|
|
1096
|
+
return g === h.source && p === h.children ? h : { ...h, source: g, children: p };
|
|
1038
1097
|
});
|
|
1039
1098
|
return m.some((h, g) => h !== u[g]) ? m : u;
|
|
1040
|
-
}), f = i.grid &&
|
|
1041
|
-
return
|
|
1099
|
+
}), f = i.grid && d?.some((u, m) => u !== i.grid.cells[m]) ? { ...i.grid, cells: d } : i.grid;
|
|
1100
|
+
return l !== i.table || f !== i.grid ? { ...i, table: l, grid: f } : i;
|
|
1042
1101
|
});
|
|
1043
1102
|
return s.some((i, c) => i !== a[c]) ? s : a;
|
|
1044
1103
|
}
|
|
@@ -1048,35 +1107,35 @@ function st(e, t) {
|
|
|
1048
1107
|
});
|
|
1049
1108
|
return n.some((a, s) => a !== e.pages[s]) ? { ...e, pages: n } : e;
|
|
1050
1109
|
}
|
|
1051
|
-
function
|
|
1110
|
+
function Zr(e) {
|
|
1052
1111
|
return JSON.stringify([e.pageIndex, e.componentIndex, e.rowIndex, e.columnIndex]);
|
|
1053
1112
|
}
|
|
1054
|
-
function
|
|
1113
|
+
function Ie(e) {
|
|
1055
1114
|
const t = e.table;
|
|
1056
|
-
return t?.columnKey !== void 0 ? JSON.stringify([t.id, t.role, t.rowIndex, t.columnKey]) :
|
|
1115
|
+
return t?.columnKey !== void 0 ? JSON.stringify([t.id, t.role, t.rowIndex, t.columnKey]) : Zr(e.address);
|
|
1057
1116
|
}
|
|
1058
|
-
function
|
|
1117
|
+
function eo(e, t) {
|
|
1059
1118
|
if (!t.length) return e;
|
|
1060
|
-
const r = new Map(t.map((c) => [
|
|
1061
|
-
function s(c,
|
|
1119
|
+
const r = new Map(t.map((c) => [Ie(c), c])), o = new Set(t.flatMap((c) => c.table ? [c.table.id] : [])), n = new Set(t.map((c) => `${c.address.pageIndex}:${c.address.componentIndex}`)), a = j(e);
|
|
1120
|
+
function s(c, l, d) {
|
|
1062
1121
|
const f = c.grid;
|
|
1063
|
-
if (!f || !n.has(`${
|
|
1122
|
+
if (!f || !n.has(`${l}:${d}`) && !o.has(c.table?.id ?? "")) return c;
|
|
1064
1123
|
const u = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
1065
|
-
for (const h of
|
|
1124
|
+
for (const h of ee(f, c.widthMm, c.heightMm).cells) {
|
|
1066
1125
|
const g = m.get(h.ri) ?? 0;
|
|
1067
1126
|
m.set(h.ri, g + 1);
|
|
1068
|
-
const
|
|
1069
|
-
if (!
|
|
1070
|
-
const
|
|
1071
|
-
Object.is(
|
|
1127
|
+
const p = a({ pageIndex: l, componentIndex: d, rowIndex: h.ri, columnIndex: h.ci }), b = p && r.get(Ie(p));
|
|
1128
|
+
if (!b || !p.editable) continue;
|
|
1129
|
+
const M = u.get(h.ri) ?? [...f.cells[h.ri]], T = z(p, b.value);
|
|
1130
|
+
Object.is(p.value, b.value) && T === p.cell.text || (M[g] = { ...h.cell, value: b.value, text: T, rawText: T }, u.set(h.ri, M));
|
|
1072
1131
|
}
|
|
1073
1132
|
return u.size ? { ...c, grid: { ...f, cells: f.cells.map((h, g) => u.get(g) ?? h) } } : c;
|
|
1074
1133
|
}
|
|
1075
|
-
const i = e.pages.map((c,
|
|
1076
|
-
const
|
|
1077
|
-
return
|
|
1134
|
+
const i = e.pages.map((c, l) => {
|
|
1135
|
+
const d = c.components.map((f, u) => s(f, l, u));
|
|
1136
|
+
return d.every((f, u) => f === c.components[u]) ? c : { ...c, components: d };
|
|
1078
1137
|
});
|
|
1079
|
-
return i.every((c,
|
|
1138
|
+
return i.every((c, l) => c === e.pages[l]) ? e : { ...e, pages: i };
|
|
1080
1139
|
}
|
|
1081
1140
|
function C(e) {
|
|
1082
1141
|
const t = e.source;
|
|
@@ -1086,31 +1145,31 @@ function C(e) {
|
|
|
1086
1145
|
const o = e.address;
|
|
1087
1146
|
return JSON.stringify([o.pageIndex, o.componentIndex, o.rowIndex, o.columnIndex]);
|
|
1088
1147
|
}
|
|
1089
|
-
function
|
|
1090
|
-
if (typeof r != "string" || !r.trim() || !Array.isArray(t)) throw new
|
|
1091
|
-
if (t.length > 1e4) throw new
|
|
1148
|
+
function Lo(e, t, r) {
|
|
1149
|
+
if (typeof r != "string" || !r.trim() || !Array.isArray(t)) throw new y("missing");
|
|
1150
|
+
if (t.length > 1e4) throw new y("limit");
|
|
1092
1151
|
const o = /* @__PURE__ */ new Set(), n = j(e), a = t.map(({ address: s, value: i }) => {
|
|
1093
1152
|
const c = n(s);
|
|
1094
|
-
if (!c) throw new
|
|
1095
|
-
const
|
|
1096
|
-
if (o.has(
|
|
1097
|
-
return o.add(
|
|
1153
|
+
if (!c) throw new y("missing");
|
|
1154
|
+
const l = _(c, i), d = C(l);
|
|
1155
|
+
if (o.has(d)) throw new y("duplicate");
|
|
1156
|
+
return o.add(d), l;
|
|
1098
1157
|
});
|
|
1099
1158
|
return { requestId: r, edits: a };
|
|
1100
1159
|
}
|
|
1101
|
-
function
|
|
1102
|
-
if (t.edits.length > 1e4) throw new
|
|
1160
|
+
function Ho(e, t) {
|
|
1161
|
+
if (t.edits.length > 1e4) throw new y("limit");
|
|
1103
1162
|
const r = j(e), o = /* @__PURE__ */ new Set(), n = t.edits.map((a) => {
|
|
1104
1163
|
const s = r(a.address);
|
|
1105
|
-
if (!s) throw new
|
|
1164
|
+
if (!s) throw new y("missing");
|
|
1106
1165
|
const i = C(a);
|
|
1107
|
-
if (o.has(i)) throw new
|
|
1108
|
-
if (o.add(i),
|
|
1109
|
-
return
|
|
1166
|
+
if (o.has(i)) throw new y("duplicate");
|
|
1167
|
+
if (o.add(i), Se(s, a) || !Object.is(s.value, a.previousValue) || (s.cell.text ?? "") !== a.previousText) throw new y("conflict");
|
|
1168
|
+
return _(s, a.value);
|
|
1110
1169
|
});
|
|
1111
|
-
return
|
|
1170
|
+
return eo(e, n);
|
|
1112
1171
|
}
|
|
1113
|
-
function
|
|
1172
|
+
function Do(e) {
|
|
1114
1173
|
const t = /* @__PURE__ */ new Map();
|
|
1115
1174
|
for (const r of e) {
|
|
1116
1175
|
const o = C(r), n = t.get(o), a = n ? { ...r, previousValue: n.previousValue, previousText: n.previousText } : { ...r };
|
|
@@ -1118,48 +1177,49 @@ function Oo(e) {
|
|
|
1118
1177
|
}
|
|
1119
1178
|
return [...t.values()];
|
|
1120
1179
|
}
|
|
1121
|
-
function
|
|
1180
|
+
function dt(e) {
|
|
1122
1181
|
const t = /* @__PURE__ */ new Map(), r = j(e);
|
|
1123
1182
|
return e.pages.forEach((o, n) => o.components.forEach((a, s) => {
|
|
1124
1183
|
if (!(!a.grid || a.table?.role !== "body"))
|
|
1125
1184
|
for (let i = 0; i < a.grid.cells.length; i++) for (let c = 0; c < a.table.columnKeys.length; c++) {
|
|
1126
|
-
const
|
|
1127
|
-
|
|
1185
|
+
const l = r({ pageIndex: n, componentIndex: s, rowIndex: i, columnIndex: c });
|
|
1186
|
+
l?.source && l.editable && t.set(C(l), l);
|
|
1128
1187
|
}
|
|
1129
1188
|
})), t;
|
|
1130
1189
|
}
|
|
1131
|
-
function
|
|
1132
|
-
const o =
|
|
1190
|
+
function Go(e, t, r) {
|
|
1191
|
+
const o = dt(e), n = j(e);
|
|
1133
1192
|
return t.map((a) => {
|
|
1134
1193
|
const s = a.source ? o.get(C(a)) : n(a.address);
|
|
1135
|
-
if (!s || C(s) !== C(a)) throw new
|
|
1194
|
+
if (!s || C(s) !== C(a)) throw new y("missing");
|
|
1136
1195
|
return { address: { ...s.address }, value: a[r] };
|
|
1137
1196
|
});
|
|
1138
1197
|
}
|
|
1139
|
-
function
|
|
1140
|
-
if (++e.nodes > 1e6 || t > 128) throw new
|
|
1198
|
+
function ut(e, t) {
|
|
1199
|
+
if (++e.nodes > 1e6 || t > 128) throw new y("limit");
|
|
1141
1200
|
}
|
|
1142
|
-
function
|
|
1201
|
+
function Y(e, t) {
|
|
1143
1202
|
const r = Object.getOwnPropertyDescriptor(e, t);
|
|
1144
|
-
if (!r || r.get || r.set) throw new
|
|
1203
|
+
if (!r || r.get || r.set) throw new y("conflict");
|
|
1145
1204
|
return r.value;
|
|
1146
1205
|
}
|
|
1147
|
-
function
|
|
1148
|
-
if (Object.getOwnPropertyDescriptor(e, "toJSON")) throw new
|
|
1206
|
+
function ft(e) {
|
|
1207
|
+
if (Object.getOwnPropertyDescriptor(e, "toJSON")) throw new y("conflict");
|
|
1149
1208
|
const t = Object.getPrototypeOf(e);
|
|
1150
|
-
if (
|
|
1209
|
+
if (Array.isArray(e) && (t !== Array.prototype || Object.keys(e).length !== e.length)) throw new y("conflict");
|
|
1210
|
+
if (!(e instanceof Date) && !Array.isArray(e) && t !== Object.prototype && t !== null) throw new y("conflict");
|
|
1151
1211
|
for (const r of Reflect.ownKeys(e))
|
|
1152
1212
|
if (!(Array.isArray(e) && r === "length")) {
|
|
1153
|
-
if (typeof r == "symbol" || !Object.getOwnPropertyDescriptor(e, r)?.enumerable) throw new
|
|
1154
|
-
if (e instanceof Date || Array.isArray(e) && !/^(0|[1-9]\d*)$/.test(r)) throw new
|
|
1213
|
+
if (typeof r == "symbol" || !Object.getOwnPropertyDescriptor(e, r)?.enumerable) throw new y("conflict");
|
|
1214
|
+
if (e instanceof Date || Array.isArray(e) && !/^(0|[1-9]\d*)$/.test(r)) throw new y("conflict");
|
|
1155
1215
|
}
|
|
1156
1216
|
}
|
|
1157
|
-
function
|
|
1158
|
-
if (
|
|
1217
|
+
function mt(e, t, r, o, n) {
|
|
1218
|
+
if (ut(o, n), typeof e == "function" || typeof e == "symbol") throw new y("conflict");
|
|
1159
1219
|
if (e === null || typeof e != "object") return;
|
|
1160
|
-
if (
|
|
1220
|
+
if (ft(e), r.has(e)) throw new y("conflict");
|
|
1161
1221
|
r.add(e);
|
|
1162
|
-
const a = Object.keys(e), s = a.map((i) =>
|
|
1222
|
+
const a = Object.keys(e), s = a.map((i) => Y(e, i));
|
|
1163
1223
|
t.push({
|
|
1164
1224
|
object: e,
|
|
1165
1225
|
prototype: Object.getPrototypeOf(e),
|
|
@@ -1168,87 +1228,96 @@ function dt(e, t, r, o, n) {
|
|
|
1168
1228
|
...e instanceof Date ? { date: Date.prototype.getTime.call(e) } : {},
|
|
1169
1229
|
...Array.isArray(e) ? { length: e.length } : {}
|
|
1170
1230
|
});
|
|
1171
|
-
for (const i of s)
|
|
1231
|
+
for (const i of s) mt(i, t, r, o, n + 1);
|
|
1172
1232
|
r.delete(e);
|
|
1173
1233
|
}
|
|
1174
|
-
function
|
|
1234
|
+
function to(e) {
|
|
1175
1235
|
const { object: t, keys: r, values: o } = e;
|
|
1176
|
-
if (
|
|
1236
|
+
if (ft(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;
|
|
1177
1237
|
const n = Object.keys(t);
|
|
1178
|
-
return n.length === r.length && r.every((a, s) => n[s] === a && Object.is(
|
|
1238
|
+
return n.length === r.length && r.every((a, s) => n[s] === a && Object.is(Y(t, a), o[s]));
|
|
1179
1239
|
}
|
|
1180
|
-
function
|
|
1240
|
+
function ro(e) {
|
|
1181
1241
|
const t = [];
|
|
1182
|
-
return
|
|
1242
|
+
return mt(e, t, /* @__PURE__ */ new Set(), { nodes: 0 }, 0), () => {
|
|
1183
1243
|
try {
|
|
1184
|
-
return t.every(
|
|
1244
|
+
return t.every(to);
|
|
1185
1245
|
} catch {
|
|
1186
1246
|
return !1;
|
|
1187
1247
|
}
|
|
1188
1248
|
};
|
|
1189
1249
|
}
|
|
1190
|
-
function
|
|
1191
|
-
|
|
1250
|
+
function ue(e, t, r) {
|
|
1251
|
+
if (ut(t, r), e === null || typeof e != "object") return e;
|
|
1252
|
+
if (e instanceof Date) return new Date(Date.prototype.getTime.call(e));
|
|
1253
|
+
if (Array.isArray(e)) {
|
|
1254
|
+
const o = [];
|
|
1255
|
+
for (let n = 0; n < e.length; n++) o[n] = ue(Y(e, String(n)), t, r + 1);
|
|
1256
|
+
return o;
|
|
1257
|
+
}
|
|
1258
|
+
return Object.fromEntries(Object.keys(e).map((o) => [o, ue(Y(e, o), t, r + 1)]));
|
|
1192
1259
|
}
|
|
1193
|
-
function
|
|
1194
|
-
|
|
1260
|
+
function oo(e) {
|
|
1261
|
+
const t = ue(e, { nodes: 0 }, 0);
|
|
1262
|
+
for (const r of t) for (const o of Object.values(r.datasets)) Nt(o);
|
|
1263
|
+
return t;
|
|
1195
1264
|
}
|
|
1196
|
-
async function
|
|
1265
|
+
async function gt(e, t, r = {}) {
|
|
1197
1266
|
const o = [], n = { ...r, knownTotalPages: void 0 };
|
|
1198
|
-
for (const a of
|
|
1267
|
+
for (const a of Nr(e, t, n))
|
|
1199
1268
|
o.push(a), o.length % 8 === 0 && await new Promise((s) => setTimeout(s, 0));
|
|
1200
1269
|
if (r.signal?.aborted) {
|
|
1201
1270
|
const a = new Error("报表重算已取消");
|
|
1202
1271
|
throw a.name = "AbortError", a;
|
|
1203
1272
|
}
|
|
1204
|
-
return { schemaVersion:
|
|
1273
|
+
return { schemaVersion: Q, ...te(e) ? { requiresRecalculation: !0 } : {}, pages: o };
|
|
1205
1274
|
}
|
|
1206
|
-
const
|
|
1207
|
-
function
|
|
1208
|
-
return
|
|
1275
|
+
const fe = /* @__PURE__ */ new WeakMap();
|
|
1276
|
+
function Bo(e) {
|
|
1277
|
+
return fe.get(e);
|
|
1209
1278
|
}
|
|
1210
|
-
function
|
|
1279
|
+
function q(e) {
|
|
1211
1280
|
if (e?.aborted) {
|
|
1212
1281
|
const t = new Error("报表重算已取消");
|
|
1213
1282
|
throw t.name = "AbortError", t;
|
|
1214
1283
|
}
|
|
1215
1284
|
}
|
|
1216
|
-
function
|
|
1285
|
+
function ht(e, t) {
|
|
1217
1286
|
return e[t] === void 0 ? "" : e[t];
|
|
1218
1287
|
}
|
|
1219
|
-
function
|
|
1220
|
-
if (t.edits.length > 1e4) throw new
|
|
1288
|
+
function no(e, t) {
|
|
1289
|
+
if (t.edits.length > 1e4) throw new y("limit");
|
|
1221
1290
|
const r = j(e), o = /* @__PURE__ */ new Set(), n = [], a = t.edits.map((s) => {
|
|
1222
1291
|
const i = r(s.address);
|
|
1223
|
-
if (!i?.source) throw new
|
|
1292
|
+
if (!i?.source) throw new y("missing");
|
|
1224
1293
|
const c = C(s);
|
|
1225
|
-
if (o.has(c)) throw new
|
|
1226
|
-
if (o.add(c),
|
|
1227
|
-
return n.push(i),
|
|
1294
|
+
if (o.has(c)) throw new y("duplicate");
|
|
1295
|
+
if (o.add(c), Se(i, s) || !Object.is(i.value, s.previousValue) || (i.cell.text ?? "") !== s.previousText) throw new y("conflict");
|
|
1296
|
+
return n.push(i), _(i, s.value);
|
|
1228
1297
|
});
|
|
1229
1298
|
return { batch: { requestId: t.requestId, edits: a }, contexts: n };
|
|
1230
1299
|
}
|
|
1231
|
-
function
|
|
1232
|
-
const r =
|
|
1300
|
+
function ao(e, t) {
|
|
1301
|
+
const r = it(e);
|
|
1233
1302
|
return t.flatMap((o) => {
|
|
1234
|
-
if (!o.source) throw new
|
|
1303
|
+
if (!o.source) throw new y("missing");
|
|
1235
1304
|
return r(o.source).map((n) => {
|
|
1236
|
-
if (!Object.is(
|
|
1237
|
-
if (n.binding.rowKey === o.source.field) throw new
|
|
1305
|
+
if (!Object.is(ht(n.row, o.source.field), o.previousValue)) throw new y("conflict");
|
|
1306
|
+
if (n.binding.rowKey === o.source.field) throw new y("readonly");
|
|
1238
1307
|
return { row: n, field: o.source.field, value: o.value };
|
|
1239
1308
|
});
|
|
1240
1309
|
});
|
|
1241
1310
|
}
|
|
1242
|
-
function
|
|
1311
|
+
function le(e, t, r) {
|
|
1243
1312
|
const o = { ...e, value: t, source: { ...e.source, ...r?.revision === void 0 ? {} : { revision: r.revision }, ...r?.sourceToken === void 0 ? {} : { sourceToken: r.sourceToken } } };
|
|
1244
|
-
return o.cell = { ...e.cell, value: o.value, text:
|
|
1313
|
+
return o.cell = { ...e.cell, value: o.value, text: z(o, o.value) }, o;
|
|
1245
1314
|
}
|
|
1246
|
-
function
|
|
1315
|
+
function so(e, t, r) {
|
|
1247
1316
|
if (!r || r.revision === void 0 && r.sourceToken === void 0) return [...e];
|
|
1248
1317
|
const o = new Set(t.edits.flatMap((n) => n.source ? [L(n.source)] : []));
|
|
1249
|
-
return
|
|
1318
|
+
return ct(e, Yr(e, o, r));
|
|
1250
1319
|
}
|
|
1251
|
-
function
|
|
1320
|
+
function io(e, t, r) {
|
|
1252
1321
|
const o = new Set(t.edits.map((n) => L(n.source)));
|
|
1253
1322
|
for (const n of o) e.set(n, {
|
|
1254
1323
|
...e.get(n),
|
|
@@ -1257,31 +1326,31 @@ function Qr(e, t, r) {
|
|
|
1257
1326
|
});
|
|
1258
1327
|
return o;
|
|
1259
1328
|
}
|
|
1260
|
-
function
|
|
1329
|
+
function pt(e, t) {
|
|
1261
1330
|
let r = t.parts;
|
|
1262
1331
|
const o = t.rebuild;
|
|
1263
|
-
let n =
|
|
1332
|
+
let n = ro(r), a = e, s;
|
|
1264
1333
|
const i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
|
|
1265
|
-
function
|
|
1266
|
-
if (u !== a) throw new
|
|
1334
|
+
function l(u) {
|
|
1335
|
+
if (u !== a) throw new y("conflict");
|
|
1267
1336
|
if (s) return s;
|
|
1268
|
-
if (!n?.()) throw new
|
|
1269
|
-
return
|
|
1337
|
+
if (!n?.()) throw new y("conflict");
|
|
1338
|
+
return oo(r);
|
|
1270
1339
|
}
|
|
1271
|
-
async function
|
|
1272
|
-
|
|
1273
|
-
const
|
|
1274
|
-
|
|
1340
|
+
async function d(u, m, h, g = {}) {
|
|
1341
|
+
q(g.signal), m = { requestId: m.requestId, edits: m.edits.map((S) => ({ ...S, address: { ...S.address }, source: S.source ? { ...S.source } : void 0, table: S.table ? { ...S.table } : void 0 })) }, h = h.map((S) => ({ ...S, address: { ...S.address }, source: S.source ? { ...S.source } : void 0, table: S.table ? { ...S.table } : void 0, cell: { ...S.cell } })), await new Promise((S) => setTimeout(S, 0)), q(g.signal);
|
|
1342
|
+
const p = l(u), b = ct(p, ao(p, m.edits)), M = lt(await o(b, g.signal), c);
|
|
1343
|
+
q(g.signal);
|
|
1275
1344
|
let T = !1;
|
|
1276
|
-
return { plan:
|
|
1277
|
-
if (
|
|
1278
|
-
if (S?.conflicts?.length) throw new
|
|
1279
|
-
const
|
|
1345
|
+
return { plan: M, commit(S) {
|
|
1346
|
+
if (q(g.signal), T || a !== u) throw new y("conflict");
|
|
1347
|
+
if (S?.conflicts?.length) throw new y("conflict");
|
|
1348
|
+
const A = so(b, m, S), O = Qr(M, m, S);
|
|
1280
1349
|
if (S) {
|
|
1281
|
-
const I =
|
|
1282
|
-
for (const [
|
|
1350
|
+
const I = io(c, m, S);
|
|
1351
|
+
for (const [w, v] of i) I.has(L(v.source)) && i.set(w, le(v, v.value, S));
|
|
1283
1352
|
}
|
|
1284
|
-
return h.forEach((I,
|
|
1353
|
+
return h.forEach((I, w) => i.set(C(I), le(I, m.edits[w].value, S))), T = !0, s = A, r = void 0, n = void 0, a = O, fe.set(a, f), a;
|
|
1285
1354
|
} };
|
|
1286
1355
|
}
|
|
1287
1356
|
const f = {
|
|
@@ -1289,35 +1358,35 @@ function mt(e, t) {
|
|
|
1289
1358
|
return a;
|
|
1290
1359
|
},
|
|
1291
1360
|
async prepare(u, m, h) {
|
|
1292
|
-
const g =
|
|
1293
|
-
return
|
|
1361
|
+
const g = no(u, m);
|
|
1362
|
+
return d(u, g.batch, g.contexts, h);
|
|
1294
1363
|
},
|
|
1295
|
-
async prepareHistory(u, m, h, g,
|
|
1296
|
-
if (!g.trim() || m.length > 1e4) throw new
|
|
1297
|
-
const
|
|
1298
|
-
if (!
|
|
1299
|
-
const x = C(
|
|
1300
|
-
if (S.has(x)) throw new
|
|
1364
|
+
async prepareHistory(u, m, h, g, p) {
|
|
1365
|
+
if (!g.trim() || m.length > 1e4) throw new y("limit");
|
|
1366
|
+
const b = l(u), M = it(b), T = dt(u), S = /* @__PURE__ */ new Set(), O = m.map((v) => {
|
|
1367
|
+
if (!v.source) throw new y("missing");
|
|
1368
|
+
const x = C(v);
|
|
1369
|
+
if (S.has(x)) throw new y("duplicate");
|
|
1301
1370
|
S.add(x);
|
|
1302
|
-
const
|
|
1303
|
-
if (
|
|
1304
|
-
const
|
|
1305
|
-
return
|
|
1306
|
-
}).map((
|
|
1307
|
-
return { batch: I, contexts:
|
|
1371
|
+
const k = T.get(x) ?? i.get(x);
|
|
1372
|
+
if (!k?.source) throw new y("missing");
|
|
1373
|
+
const $ = M(k.source)[0];
|
|
1374
|
+
return le(k, ht($.row, k.source.field));
|
|
1375
|
+
}).map((v, x) => ({ context: v, edit: _(v, m[x][h]) })).filter(({ edit: v }) => !Object.is(v.previousValue, v.value)), I = { requestId: g, edits: O.map(({ edit: v }) => v) }, w = O.map(({ context: v }) => v);
|
|
1376
|
+
return { batch: I, contexts: w, prepared: await d(u, I, w, p) };
|
|
1308
1377
|
}
|
|
1309
1378
|
};
|
|
1310
|
-
return
|
|
1379
|
+
return fe.set(e, f), f;
|
|
1311
1380
|
}
|
|
1312
|
-
function
|
|
1313
|
-
const t =
|
|
1314
|
-
return
|
|
1381
|
+
function Wo(e) {
|
|
1382
|
+
const t = et(e.template, e.datasets, e.pagination).plan;
|
|
1383
|
+
return pt(t, { parts: [{ template: e.template, datasets: e.datasets }], rebuild: (r, o) => gt(r[0].template, r[0].datasets, { ...e.pagination, signal: o }) });
|
|
1315
1384
|
}
|
|
1316
|
-
let
|
|
1317
|
-
function
|
|
1318
|
-
return `report-${Date.now()}-${++
|
|
1385
|
+
let co = 0;
|
|
1386
|
+
function lo() {
|
|
1387
|
+
return `report-${Date.now()}-${++co}`;
|
|
1319
1388
|
}
|
|
1320
|
-
function
|
|
1389
|
+
function Ee(e, t, r) {
|
|
1321
1390
|
if (!r?.aborted)
|
|
1322
1391
|
try {
|
|
1323
1392
|
const o = e?.({ ...t });
|
|
@@ -1326,14 +1395,14 @@ function Re(e, t, r) {
|
|
|
1326
1395
|
} catch {
|
|
1327
1396
|
}
|
|
1328
1397
|
}
|
|
1329
|
-
function
|
|
1330
|
-
const t = e.taskId ??
|
|
1331
|
-
|
|
1398
|
+
function uo(e) {
|
|
1399
|
+
const t = e.taskId ?? lo(), r = (o, n, a) => {
|
|
1400
|
+
Ee(e.onEvent, { taskId: t, ...e.correlationId === void 0 ? {} : { correlationId: e.correlationId }, stage: o, status: n, ...a === void 0 ? {} : { reportId: a } }, e.signal);
|
|
1332
1401
|
};
|
|
1333
1402
|
return {
|
|
1334
1403
|
taskId: t,
|
|
1335
1404
|
progress(o, n, a) {
|
|
1336
|
-
|
|
1405
|
+
Ee(e.onEvent, { taskId: t, ...e.correlationId === void 0 ? {} : { correlationId: e.correlationId }, stage: o, status: "started", completed: n, total: a }, e.signal);
|
|
1337
1406
|
},
|
|
1338
1407
|
async run(o, n, a) {
|
|
1339
1408
|
r(o, "started", a);
|
|
@@ -1355,18 +1424,25 @@ function to(e) {
|
|
|
1355
1424
|
}
|
|
1356
1425
|
};
|
|
1357
1426
|
}
|
|
1358
|
-
function
|
|
1427
|
+
function wt(e) {
|
|
1359
1428
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
1360
1429
|
const t = e, r = (o) => typeof o == "string" && o.trim().length > 0 && o.length <= 256;
|
|
1361
1430
|
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);
|
|
1362
1431
|
}
|
|
1363
|
-
function
|
|
1432
|
+
function fo(e) {
|
|
1364
1433
|
return e === "missing-source" || e === "not-applicable" || e === "not-calculable";
|
|
1365
1434
|
}
|
|
1366
|
-
function
|
|
1367
|
-
return e.target !== void 0 && !
|
|
1435
|
+
function mo(e) {
|
|
1436
|
+
return e.target !== void 0 && !wt(e.target) ? !1 : e.valueState === void 0 || fo(e.valueState) && e.target !== void 0;
|
|
1437
|
+
}
|
|
1438
|
+
function Vo(e, t) {
|
|
1439
|
+
if (Ge([], e), !wt(t)) throw new Error("数据说明目标无效");
|
|
1440
|
+
const r = e.fields.find((n) => n.field === t.field);
|
|
1441
|
+
if (!r) throw new Error("数据说明字段未在契约中声明");
|
|
1442
|
+
const o = [];
|
|
1443
|
+
return r.description && o.push({ code: "field-definition", severity: "info", message: r.description, target: { ...t } }), r.calculation && o.push({ code: "field-calculation", severity: "info", message: r.calculation.description, target: { ...t } }), o;
|
|
1368
1444
|
}
|
|
1369
|
-
function
|
|
1445
|
+
function yt(e, t, r = {}) {
|
|
1370
1446
|
const o = /* @__PURE__ */ new Map();
|
|
1371
1447
|
for (const a of e.pages) for (const s of a.components) {
|
|
1372
1448
|
if (s.kind !== "list" || s.tree?.input !== "nested") continue;
|
|
@@ -1378,26 +1454,26 @@ function gt(e, t, r = {}) {
|
|
|
1378
1454
|
const n = { ...t };
|
|
1379
1455
|
for (const [a, s] of o) {
|
|
1380
1456
|
const i = Math.min(s.maxRows ?? 1e5, r.maxRows ?? 1 / 0);
|
|
1381
|
-
n[a] =
|
|
1457
|
+
n[a] = He(t[a] ?? [], { ...s, maxRows: i }, r.signal);
|
|
1382
1458
|
}
|
|
1383
1459
|
return n;
|
|
1384
1460
|
}
|
|
1385
|
-
function
|
|
1386
|
-
return Object.values(
|
|
1461
|
+
function Jo(e, t, r = {}) {
|
|
1462
|
+
return Object.values(yt(e, t, r)).reduce((o, n) => o + n.length, 0);
|
|
1387
1463
|
}
|
|
1388
|
-
function
|
|
1389
|
-
const o =
|
|
1464
|
+
function zo(e, t, r) {
|
|
1465
|
+
const o = qt(r), n = e?.pages.flatMap((i) => i.components).find((i) => i.kind === "list" && i.dataset === t && i.tree?.input === "nested");
|
|
1390
1466
|
if (!n || n.kind !== "list" || !n.tree) return o;
|
|
1391
1467
|
const a = o.items, s = n.tree.childrenField ?? "children";
|
|
1392
1468
|
return { ...o, items: { $ref: "#/$defs/treeNode" }, $defs: { treeNode: { ...a, properties: { ...a.properties, [s]: { anyOf: [{ type: "null" }, { type: "array", items: { $ref: "#/$defs/treeNode" } }] } } } } };
|
|
1393
1469
|
}
|
|
1394
|
-
function
|
|
1470
|
+
function bt(e, t) {
|
|
1395
1471
|
return JSON.stringify([e, t]);
|
|
1396
1472
|
}
|
|
1397
|
-
function
|
|
1398
|
-
return r === void 0 ?
|
|
1473
|
+
function Mt(e, t, r) {
|
|
1474
|
+
return r === void 0 ? bt(e, t) : JSON.stringify(["shared", r]);
|
|
1399
1475
|
}
|
|
1400
|
-
function
|
|
1476
|
+
function vt(e, t, r) {
|
|
1401
1477
|
return e.map((o) => {
|
|
1402
1478
|
const n = o.table ? {
|
|
1403
1479
|
...o.table,
|
|
@@ -1406,7 +1482,7 @@ function wt(e, t, r) {
|
|
|
1406
1482
|
} : void 0, a = o.grid?.cells.map((s) => s.map((i) => !i || !i.source && !i.children ? i : {
|
|
1407
1483
|
...i,
|
|
1408
1484
|
...i.source ? { source: { ...i.source, sourceScope: t } } : {},
|
|
1409
|
-
...i.children ? { children:
|
|
1485
|
+
...i.children ? { children: vt(i.children, t, r) } : {}
|
|
1410
1486
|
}));
|
|
1411
1487
|
return n || a ? {
|
|
1412
1488
|
...o,
|
|
@@ -1415,7 +1491,7 @@ function wt(e, t, r) {
|
|
|
1415
1491
|
} : o;
|
|
1416
1492
|
});
|
|
1417
1493
|
}
|
|
1418
|
-
function
|
|
1494
|
+
function _o(e) {
|
|
1419
1495
|
if (!("mapData" in e)) return e;
|
|
1420
1496
|
const { load: t, mapData: r, ...o } = e;
|
|
1421
1497
|
return { ...o, load: async (n) => {
|
|
@@ -1433,17 +1509,17 @@ class P extends Error {
|
|
|
1433
1509
|
super(r), this.name = "ReportSourceError", this.code = t, this.cause = o;
|
|
1434
1510
|
}
|
|
1435
1511
|
}
|
|
1436
|
-
function
|
|
1512
|
+
function se(e) {
|
|
1437
1513
|
const t = new Error("报表加载已取消");
|
|
1438
1514
|
return t.name = "AbortError", Object.defineProperty(t, "cause", { value: e.reason }), t;
|
|
1439
1515
|
}
|
|
1440
1516
|
function R(e) {
|
|
1441
|
-
if (e?.aborted) throw
|
|
1517
|
+
if (e?.aborted) throw se(e);
|
|
1442
1518
|
}
|
|
1443
|
-
function
|
|
1519
|
+
function me(e, t) {
|
|
1444
1520
|
return t ? new Promise((r, o) => {
|
|
1445
1521
|
const n = () => t.removeEventListener("abort", a), a = () => {
|
|
1446
|
-
n(), o(
|
|
1522
|
+
n(), o(se(t));
|
|
1447
1523
|
};
|
|
1448
1524
|
t.addEventListener("abort", a, { once: !0 }), t.aborted && a(), Promise.resolve(e).then(
|
|
1449
1525
|
(s) => {
|
|
@@ -1455,75 +1531,75 @@ function de(e, t) {
|
|
|
1455
1531
|
);
|
|
1456
1532
|
}) : Promise.resolve(e);
|
|
1457
1533
|
}
|
|
1458
|
-
function
|
|
1534
|
+
function go(e, t) {
|
|
1459
1535
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1460
1536
|
throw new P("validate", `报表 ${t} 的数据集应为对象`);
|
|
1461
1537
|
for (const [r, o] of Object.entries(e))
|
|
1462
1538
|
if (!Array.isArray(o) || o.some((n) => !n || typeof n != "object" || Array.isArray(n)))
|
|
1463
1539
|
throw new P("validate", `报表 ${t} 的数据集 ${r} 应为对象数组`);
|
|
1464
1540
|
}
|
|
1465
|
-
async function
|
|
1541
|
+
async function ho(e, t, r) {
|
|
1466
1542
|
const { reportId: o, signal: n } = t;
|
|
1467
1543
|
try {
|
|
1468
|
-
const a = await
|
|
1544
|
+
const a = await me(e(t), n);
|
|
1469
1545
|
R(n);
|
|
1470
|
-
const s =
|
|
1546
|
+
const s = Wt(a);
|
|
1471
1547
|
if (!s.ok)
|
|
1472
1548
|
throw new P("validate", `报表 ${o} 模板校验失败:${s.errors.slice(0, 3).map((i) => `${i.path}: ${i.message}`).join("; ")}`);
|
|
1473
1549
|
return r.push(...s.warnings.map((i) => `${o}: ${i.path}: ${i.message}`)), a;
|
|
1474
1550
|
} catch (a) {
|
|
1475
|
-
throw n?.aborted ?
|
|
1551
|
+
throw n?.aborted ? se(n) : a instanceof P ? a : a instanceof Vt ? new P("validate", `报表 ${o} 模板校验失败:${a.message}`, a) : new P("fetch", `报表 ${o} 模板加载失败:${a instanceof Error ? a.message : String(a)}`, a);
|
|
1476
1552
|
}
|
|
1477
1553
|
}
|
|
1478
|
-
async function
|
|
1554
|
+
async function po(e, t, r, o) {
|
|
1479
1555
|
const n = t.signal;
|
|
1480
1556
|
let a;
|
|
1481
1557
|
try {
|
|
1482
|
-
if (e.load) a = await
|
|
1558
|
+
if (e.load) a = await me(e.load(t), n);
|
|
1483
1559
|
else if (e.provider) {
|
|
1484
|
-
const s = await
|
|
1485
|
-
R(n),
|
|
1560
|
+
const s = await me(e.provider.query(t), n);
|
|
1561
|
+
R(n), wo(s, r), a = s.datasets, o?.(r, s);
|
|
1486
1562
|
} else a = e.datasets ?? {};
|
|
1487
1563
|
} catch (s) {
|
|
1488
|
-
throw n?.aborted ?
|
|
1564
|
+
throw n?.aborted ? se(n) : s instanceof P ? s : new P("fetch", `报表 ${r} 取数失败:${s instanceof Error ? s.message : String(s)}`, s);
|
|
1489
1565
|
}
|
|
1490
1566
|
return R(n), a;
|
|
1491
1567
|
}
|
|
1492
|
-
function
|
|
1568
|
+
function wo(e, t) {
|
|
1493
1569
|
if (!e || typeof e != "object" || Array.isArray(e)) throw new P("validate", `报表 ${t} Provider 应返回 datasets 结果对象`);
|
|
1494
1570
|
for (const r of ["revision", "sourceToken"])
|
|
1495
1571
|
if (e[r] !== void 0 && typeof e[r] != "string") throw new P("validate", `报表 ${t} Provider ${r} 应为字符串`);
|
|
1496
1572
|
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))))
|
|
1497
1573
|
throw new P("validate", `报表 ${t} Provider diagnostics 不符合结构化诊断契约`);
|
|
1498
|
-
if (e.diagnostics?.some((r) => !
|
|
1574
|
+
if (e.diagnostics?.some((r) => !mo(r)))
|
|
1499
1575
|
throw new P("validate", `报表 ${t} Provider 数据说明缺少有效的字段身份或值状态`);
|
|
1500
1576
|
}
|
|
1501
|
-
function
|
|
1577
|
+
function yo(e, t, r, o, n) {
|
|
1502
1578
|
try {
|
|
1503
|
-
t =
|
|
1579
|
+
t = yt(o, t, { maxRows: e.dataValidation?.maxRows, signal: n });
|
|
1504
1580
|
} catch (a) {
|
|
1505
1581
|
throw new P("validate", `报表 ${r} 树形数据无效:${a instanceof Error ? a.message : String(a)}`, a);
|
|
1506
1582
|
}
|
|
1507
1583
|
for (const [a, s] of Object.entries(e.dataSchema ?? {})) {
|
|
1508
1584
|
let i;
|
|
1509
1585
|
try {
|
|
1510
|
-
i =
|
|
1586
|
+
i = Ge(Object.prototype.hasOwnProperty.call(t, a) ? t[a] : void 0, s, { ...e.dataValidation, path: `$.datasets.${a}` });
|
|
1511
1587
|
} catch (c) {
|
|
1512
1588
|
throw new P("config", `报表 ${r} 数据集 ${a} 字段契约配置无效`, c);
|
|
1513
1589
|
}
|
|
1514
1590
|
if (!i.ok) throw new P("validate", `报表 ${r} 数据集 ${a} 不符合字段契约:${i.issues[0]?.message}`, { issues: i.issues });
|
|
1515
1591
|
}
|
|
1516
1592
|
}
|
|
1517
|
-
function
|
|
1593
|
+
function St(e, t) {
|
|
1518
1594
|
if (!e.repeat) return !1;
|
|
1519
1595
|
const r = Object.prototype.hasOwnProperty.call(t, e.repeat.dataset) ? t[e.repeat.dataset] : void 0;
|
|
1520
1596
|
return Array.isArray(r) && r.length === 0;
|
|
1521
1597
|
}
|
|
1522
|
-
function
|
|
1598
|
+
function xt(e) {
|
|
1523
1599
|
const t = (r) => r.grid?.cells.reduce((o, n) => o + n.reduce((a, s) => a + (s ? 1 + (s.children?.reduce((i, c) => i + t(c), 0) ?? 0) : 0), 0), 0) ?? 0;
|
|
1524
1600
|
return e.pages.reduce((r, o) => r + o.components.reduce((n, a) => n + t(a), 0), 0);
|
|
1525
1601
|
}
|
|
1526
|
-
function
|
|
1602
|
+
function Tt(e, t, r, o) {
|
|
1527
1603
|
return {
|
|
1528
1604
|
...e,
|
|
1529
1605
|
signal: o ?? e?.signal,
|
|
@@ -1531,45 +1607,45 @@ function Mt(e, t, r, o) {
|
|
|
1531
1607
|
...r === void 0 ? {} : { maxCells: Math.max(1, Math.min(r, e?.maxCells ?? r)) }
|
|
1532
1608
|
};
|
|
1533
1609
|
}
|
|
1534
|
-
function
|
|
1610
|
+
function bo(e, t, r, o, n, a) {
|
|
1535
1611
|
const s = n.maxPages === void 0 ? void 0 : n.maxPages - n.usedPages, i = n.maxCells === void 0 ? void 0 : n.maxCells - n.usedCells;
|
|
1536
1612
|
try {
|
|
1537
|
-
if (s !== void 0 && s < 1 && e.pages.length && !
|
|
1538
|
-
const c =
|
|
1539
|
-
if (i !== void 0 &&
|
|
1540
|
-
return { ...
|
|
1613
|
+
if (s !== void 0 && s < 1 && e.pages.length && !St(e, t)) throw new K(0, 1);
|
|
1614
|
+
const c = Tt(r.pagination, s, i, a), l = et(e, t, c), d = xt(l.plan);
|
|
1615
|
+
if (i !== void 0 && d > i) throw new D(i, d);
|
|
1616
|
+
return { ...l, cells: d };
|
|
1541
1617
|
} catch (c) {
|
|
1542
|
-
let
|
|
1543
|
-
throw c instanceof
|
|
1618
|
+
let l = c;
|
|
1619
|
+
throw c instanceof K && n.maxPages !== void 0 && c.limit === s && (l = new K(n.maxPages, n.usedPages + c.actual)), c instanceof D && n.maxCells !== void 0 && (l = new D(n.maxCells, n.usedCells + c.actual)), new P("validate", `报表 ${o} 排版失败:${l instanceof Error ? l.message : String(l)}`, l);
|
|
1544
1620
|
}
|
|
1545
1621
|
}
|
|
1546
|
-
function
|
|
1622
|
+
function Pt(e, t, r, o, n) {
|
|
1547
1623
|
const a = /* @__PURE__ */ new Map(), s = (i) => {
|
|
1548
1624
|
let c = a.get(i);
|
|
1549
1625
|
return c === void 0 && (c = JSON.stringify([r, o, i]), a.set(i, c)), c;
|
|
1550
1626
|
};
|
|
1551
1627
|
for (const i of t.pages) e.push({
|
|
1552
1628
|
...i,
|
|
1553
|
-
meta: { ...i.meta, reportScope:
|
|
1554
|
-
components:
|
|
1629
|
+
meta: { ...i.meta, reportScope: bt(r, o) },
|
|
1630
|
+
components: vt(i.components, n ?? Mt(r, o), s)
|
|
1555
1631
|
});
|
|
1556
1632
|
}
|
|
1557
|
-
async function
|
|
1633
|
+
async function Mo(e, t, r, o, n) {
|
|
1558
1634
|
const a = [];
|
|
1559
1635
|
let s = 0;
|
|
1560
|
-
for (const [
|
|
1636
|
+
for (const [l, d] of e.entries()) {
|
|
1561
1637
|
R(n);
|
|
1562
1638
|
const f = o.maxPages === void 0 ? void 0 : o.maxPages - a.length, u = o.maxCells === void 0 ? void 0 : o.maxCells - s;
|
|
1563
|
-
if (f !== void 0 && f < 1 &&
|
|
1564
|
-
const m = await
|
|
1565
|
-
if (s +=
|
|
1566
|
-
|
|
1639
|
+
if (f !== void 0 && f < 1 && d.template.pages.length && !St(d.template, d.datasets)) throw new K(o.maxPages, a.length + 1);
|
|
1640
|
+
const m = await gt(d.template, d.datasets, Tt(t[l]?.pagination, f, u, n));
|
|
1641
|
+
if (s += xt(m), o.maxCells !== void 0 && s > o.maxCells) throw new D(o.maxCells, s);
|
|
1642
|
+
Pt(a, m, l, r[l], d.sourceScope);
|
|
1567
1643
|
}
|
|
1568
|
-
const i = { schemaVersion:
|
|
1644
|
+
const i = { schemaVersion: Q, ...e.some((l) => te(l.template)) ? { requiresRecalculation: !0 } : {}, pages: a }, c = De(i);
|
|
1569
1645
|
if (!c.ok) throw new P("validate", `重算渲染计划校验失败:${c.errors[0]?.message}`);
|
|
1570
1646
|
return i;
|
|
1571
1647
|
}
|
|
1572
|
-
function
|
|
1648
|
+
function qo(e, t = {}) {
|
|
1573
1649
|
if (t.maxPages !== void 0 && (!Number.isSafeInteger(t.maxPages) || t.maxPages < 1)) throw new P("config", "maxPages 应为正安全整数");
|
|
1574
1650
|
if (t.maxCells !== void 0 && (!Number.isSafeInteger(t.maxCells) || t.maxCells < 1)) throw new P("config", "maxCells 应为正安全整数");
|
|
1575
1651
|
function r(n) {
|
|
@@ -1578,125 +1654,126 @@ function Ho(e, t = {}) {
|
|
|
1578
1654
|
if (a.sourceScope !== void 0 && (typeof a.sourceScope != "string" || !a.sourceScope.trim() || a.sourceScope.length > 512)) throw new P("config", "sourceScope 应为不超过 512 字符的非空字符串");
|
|
1579
1655
|
return a;
|
|
1580
1656
|
}
|
|
1581
|
-
return Object.assign(async ({ reportIds: n, params: a, signal: s, onWarning: i, onQueryResult: c, ...
|
|
1657
|
+
return Object.assign(async ({ reportIds: n, params: a, signal: s, onWarning: i, onQueryResult: c, ...l }) => {
|
|
1582
1658
|
R(s);
|
|
1583
|
-
const
|
|
1659
|
+
const d = uo({ ...l, signal: s }), f = [...n], u = { ...a };
|
|
1584
1660
|
if (f.length === 0) throw new P("config", "缺少报表 ID");
|
|
1585
|
-
const m = f.map(r), h =
|
|
1586
|
-
|
|
1661
|
+
const m = f.map(r), h = d.runSync("validate", () => m.map((w) => Te(
|
|
1662
|
+
w.params ?? (typeof w.template == "function" ? [] : w.template.params) ?? [],
|
|
1587
1663
|
u
|
|
1588
|
-
))), g = [],
|
|
1589
|
-
let
|
|
1590
|
-
const
|
|
1591
|
-
for (const [
|
|
1664
|
+
))), g = [], p = [];
|
|
1665
|
+
let b = 0;
|
|
1666
|
+
const M = [];
|
|
1667
|
+
for (const [w, v] of m.entries()) {
|
|
1592
1668
|
R(s);
|
|
1593
|
-
const x = f[
|
|
1594
|
-
|
|
1595
|
-
const F = await
|
|
1596
|
-
|
|
1597
|
-
|
|
1669
|
+
const x = f[w], k = { reportId: x, params: h[w], signal: s }, $ = typeof v.template == "function" ? await d.run("query", () => ho(v.template, k, M), x) : v.template;
|
|
1670
|
+
k.params = d.runSync("validate", () => Te(v.params ?? $.params ?? [], k.params), x);
|
|
1671
|
+
const F = await d.run("query", () => po(v, k, x, (ce, kt) => c?.(ce, kt, w)), x);
|
|
1672
|
+
d.runSync("validate", () => {
|
|
1673
|
+
go(F, x), t.onDatasets?.(x, F, $), yo(v, F, x, $, s);
|
|
1598
1674
|
}, x), R(s);
|
|
1599
|
-
const
|
|
1600
|
-
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1675
|
+
const ie = d.runSync("layout", () => bo($, F, v, x, { maxPages: t.maxPages, usedPages: g.length, maxCells: t.maxCells, usedCells: b }, s), x);
|
|
1676
|
+
b += ie.cells;
|
|
1677
|
+
const xe = Mt(w, x, v.sourceScope);
|
|
1678
|
+
p.push({ template: $, datasets: F, sourceScope: xe }), Pt(g, ie.plan, w, x, xe), M.push(...ie.warnings.map((ce) => `${x}: ${ce}`));
|
|
1603
1679
|
}
|
|
1604
1680
|
R(s);
|
|
1605
|
-
const T = { schemaVersion:
|
|
1606
|
-
const
|
|
1607
|
-
if (!
|
|
1608
|
-
return
|
|
1681
|
+
const T = { schemaVersion: Q, ...p.some((w) => te(w.template)) ? { requiresRecalculation: !0 } : {}, pages: g }, S = d.runSync("validate", () => {
|
|
1682
|
+
const w = De(T);
|
|
1683
|
+
if (!w.ok) throw new P("validate", `渲染计划校验失败:${w.errors.slice(0, 3).map((v) => `${v.path}: ${v.message}`).join("; ")}`);
|
|
1684
|
+
return w;
|
|
1609
1685
|
});
|
|
1610
|
-
|
|
1611
|
-
const
|
|
1686
|
+
M.push(...S.warnings.map((w) => `${w.path}: ${w.message}`));
|
|
1687
|
+
const A = m.map((w) => ({ ...w, pagination: { ...w.pagination } })), O = { maxPages: t.maxPages, maxCells: t.maxCells };
|
|
1612
1688
|
try {
|
|
1613
|
-
|
|
1689
|
+
pt(T, { parts: p, rebuild: (w, v) => Mo(w, A, f, O, v) });
|
|
1614
1690
|
} catch {
|
|
1615
|
-
|
|
1691
|
+
M.push("来源数据无法建立本地重算口径;当前预览仅支持计划内编辑,请使用可序列化模板数据启用规则重算");
|
|
1616
1692
|
}
|
|
1617
|
-
const I = i ?? t.onWarning ?? ((
|
|
1618
|
-
for (const
|
|
1619
|
-
R(s), I(
|
|
1693
|
+
const I = i ?? t.onWarning ?? ((w) => console.warn("[mach-report]", w));
|
|
1694
|
+
for (const w of M)
|
|
1695
|
+
R(s), I(w);
|
|
1620
1696
|
return R(s), T;
|
|
1621
1697
|
}, {
|
|
1622
|
-
getParamDefs: (n) =>
|
|
1698
|
+
getParamDefs: (n) => Jt(e, n)
|
|
1623
1699
|
});
|
|
1624
1700
|
}
|
|
1625
|
-
function
|
|
1701
|
+
function Uo(e, t) {
|
|
1626
1702
|
const r = t.maxNodes ?? 1e6;
|
|
1627
|
-
if (![t.maxBytes, r].every((
|
|
1703
|
+
if (![t.maxBytes, r].every((d) => Number.isSafeInteger(d) && d > 0)) throw t.error("budget", "快照预算应为正安全整数");
|
|
1628
1704
|
let o = 0, n = 0;
|
|
1629
1705
|
const a = /* @__PURE__ */ new Set();
|
|
1630
|
-
function s(
|
|
1631
|
-
if (n +=
|
|
1706
|
+
function s(d) {
|
|
1707
|
+
if (n += d, n > t.maxBytes) throw t.error("budget", "快照超过字节预算");
|
|
1632
1708
|
}
|
|
1633
|
-
function i(
|
|
1709
|
+
function i(d, f) {
|
|
1634
1710
|
if (++o > r || f > 64) throw t.error("budget", "快照节点或深度超过预算");
|
|
1635
|
-
if (o % 1024 === 0 && t.check?.(), typeof
|
|
1636
|
-
return s(
|
|
1637
|
-
if (
|
|
1638
|
-
return s(String(
|
|
1639
|
-
if (!
|
|
1640
|
-
return c(
|
|
1711
|
+
if (o % 1024 === 0 && t.check?.(), typeof d == "string")
|
|
1712
|
+
return s(d.length + 2), d;
|
|
1713
|
+
if (d === null || typeof d == "boolean" || typeof d == "number" && Number.isFinite(d))
|
|
1714
|
+
return s(String(d).length), d;
|
|
1715
|
+
if (!d || typeof d != "object" || a.has(d)) throw t.error("input", "快照应为无循环的有限 JSON 值");
|
|
1716
|
+
return c(d, f);
|
|
1641
1717
|
}
|
|
1642
|
-
function c(
|
|
1643
|
-
const u = Array.isArray(
|
|
1644
|
-
if (m !== (u ? Array.prototype : Object.prototype) && !(m === null && !u) || Object.getOwnPropertySymbols(
|
|
1645
|
-
const h = Object.getOwnPropertyNames(
|
|
1646
|
-
if (u && (h.length !==
|
|
1647
|
-
a.add(
|
|
1718
|
+
function c(d, f) {
|
|
1719
|
+
const u = Array.isArray(d), m = Object.getPrototypeOf(d);
|
|
1720
|
+
if (m !== (u ? Array.prototype : Object.prototype) && !(m === null && !u) || Object.getOwnPropertySymbols(d).length) throw t.error("input", "快照应为普通 JSON 对象");
|
|
1721
|
+
const h = Object.getOwnPropertyNames(d).filter((b) => !(u && b === "length"));
|
|
1722
|
+
if (u && (h.length !== d.length || h.some((b, M) => b !== String(M)))) throw t.error("input", "快照数组应为连续数组");
|
|
1723
|
+
a.add(d), s(2);
|
|
1648
1724
|
const g = /* @__PURE__ */ Object.create(null);
|
|
1649
|
-
let
|
|
1650
|
-
for (const
|
|
1651
|
-
const
|
|
1652
|
-
if (
|
|
1653
|
-
|
|
1725
|
+
let p = 0;
|
|
1726
|
+
for (const b of h) {
|
|
1727
|
+
const M = Object.getOwnPropertyDescriptor(d, b);
|
|
1728
|
+
if (M.get || M.set || !M.enumerable || ["__proto__", "constructor", "prototype"].includes(b)) throw t.error("input", "快照不允许访问器或危险键");
|
|
1729
|
+
M.value === void 0 && !u || (s((p++ ? 1 : 0) + (u ? 0 : b.length + 3)), g[b] = i(M.value === void 0 ? null : M.value, f + 1));
|
|
1654
1730
|
}
|
|
1655
|
-
return a.delete(
|
|
1731
|
+
return a.delete(d), u ? h.map((b) => g[b]) : g;
|
|
1656
1732
|
}
|
|
1657
1733
|
t.check?.();
|
|
1658
|
-
const
|
|
1659
|
-
if (new TextEncoder().encode(
|
|
1660
|
-
return JSON.parse(
|
|
1734
|
+
const l = JSON.stringify(i(e, 0));
|
|
1735
|
+
if (new TextEncoder().encode(l).byteLength > t.maxBytes) throw t.error("budget", "快照超过字节预算");
|
|
1736
|
+
return JSON.parse(l);
|
|
1661
1737
|
}
|
|
1662
1738
|
export {
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1739
|
+
pt as A,
|
|
1740
|
+
Go as B,
|
|
1741
|
+
C,
|
|
1742
|
+
ir as D,
|
|
1743
|
+
Do as E,
|
|
1744
|
+
Ee as F,
|
|
1745
|
+
yt as G,
|
|
1746
|
+
Jo as H,
|
|
1747
|
+
uo as I,
|
|
1748
|
+
zo as J,
|
|
1749
|
+
lo as K,
|
|
1750
|
+
bt as L,
|
|
1674
1751
|
D as P,
|
|
1675
1752
|
P as R,
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1753
|
+
y as a,
|
|
1754
|
+
K as b,
|
|
1755
|
+
jo as c,
|
|
1756
|
+
_o as d,
|
|
1757
|
+
Ho as e,
|
|
1758
|
+
Qr as f,
|
|
1759
|
+
lt as g,
|
|
1760
|
+
Ao as h,
|
|
1761
|
+
Ko as i,
|
|
1762
|
+
Lo as j,
|
|
1686
1763
|
j as k,
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1764
|
+
Wo as l,
|
|
1765
|
+
qo as m,
|
|
1766
|
+
No as n,
|
|
1767
|
+
Vo as o,
|
|
1768
|
+
nt as p,
|
|
1769
|
+
z as q,
|
|
1770
|
+
ve as r,
|
|
1771
|
+
Uo as s,
|
|
1772
|
+
Bo as t,
|
|
1773
|
+
mo as u,
|
|
1774
|
+
wt as v,
|
|
1775
|
+
fo as w,
|
|
1776
|
+
et as x,
|
|
1777
|
+
Nr as y,
|
|
1778
|
+
rr as z
|
|
1702
1779
|
};
|