@agile-team/mach-report 2.24.0 → 2.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/dist/{ExcelBindingWizard-Cy_lPjWV.js → ExcelBindingWizard-bs3F4dD8.js} +3 -3
- package/dist/{ExcelBindingWizard-BV12hGiK.cjs → ExcelBindingWizard-jSdjBtWw.cjs} +1 -1
- package/dist/{ParamEditor-PyOqHzzw.js → ParamEditor-B7YVD28E.js} +2 -2
- package/dist/{ParamEditor-DenKjvKu.cjs → ParamEditor-CGfaweYX.cjs} +1 -1
- package/dist/{ReportBatchPanel-pQ6d0yqJ.cjs → ReportBatchPanel-BRJt0TXp.cjs} +1 -1
- package/dist/{ReportBatchPanel-8EFtMrKk.js → ReportBatchPanel-BTKHtLTW.js} +2 -2
- package/dist/{ReportLabelStudio-B_KF3Zc_.cjs → ReportLabelStudio-BvK_WBke.cjs} +1 -1
- package/dist/{ReportLabelStudio-HUeo2TsU.js → ReportLabelStudio-CZwqyO3t.js} +3 -3
- package/dist/{ReportParamPanel-8xR85nz-.cjs → ReportParamPanel-B27IGJjk.cjs} +1 -1
- package/dist/{ReportParamPanel-DA-YpkvC.js → ReportParamPanel-DGXzBzl2.js} +1 -1
- package/dist/{ReportPreview-_wTJnsG1.js → ReportPreview-CnxaDTCO.js} +2392 -2342
- package/dist/ReportPreview-DqFBcsJQ.cjs +6 -0
- package/dist/{ReportTemplateLibrary-DH8jl9IF.js → ReportTemplateLibrary-C7sB0Jay.js} +1 -1
- package/dist/{ReportTemplateLibrary-CjArKxRG.cjs → ReportTemplateLibrary-ClwxhnC0.cjs} +1 -1
- package/dist/{RuleEditor-GDydlEHz.js → RuleEditor-CsDGFaWz.js} +3 -4
- package/dist/{RuleEditor-Bmj98oC4.cjs → RuleEditor-D-OdaGdR.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-DjPqzU9h.js → TemplateOutlinePanel-CXOT7d1r.js} +2 -2
- package/dist/{TemplateOutlinePanel-B554_qk1.cjs → TemplateOutlinePanel-DAqR9zQi.cjs} +1 -1
- package/dist/{TemplateReusePanel-DtYbCN7U.js → TemplateReusePanel-Dcfx3Hba.js} +2 -2
- package/dist/{TemplateReusePanel-D0628OYc.cjs → TemplateReusePanel-ygIi-Ajz.cjs} +1 -1
- package/dist/{TemplateReviewPanel-D_FR4ISq.js → TemplateReviewPanel-COU8FqPq.js} +1 -1
- package/dist/{TemplateReviewPanel-CSwvCz3f.cjs → TemplateReviewPanel-DyGULVxr.cjs} +1 -1
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.d.cts +1 -1
- package/dist/analytics.d.ts +1 -1
- package/dist/analytics.js +2 -2
- package/dist/artifact-integrity.json +102 -102
- package/dist/{assets-B4AJIOTB.cjs → assets-BYdpkTIt.cjs} +1 -1
- package/dist/{assets-D0FbszhB.js → assets-C4MIvzQ4.js} +2 -2
- package/dist/{auto-BksreoKc.js → auto-D7x7QsWD.js} +10 -10
- package/dist/{auto-C3mGqzJ8.cjs → auto-mPK9W0y5.cjs} +1 -1
- package/dist/{capabilities-lqDEZSq5.js → capabilities-CN_kSVjO.js} +7 -7
- package/dist/{capabilities-CTwlcl8q.cjs → capabilities-D4nfhcvB.cjs} +1 -1
- package/dist/cell-style-B6Qffrx8.js +37 -0
- package/dist/cell-style-y_uh1pZp.cjs +1 -0
- package/dist/{data-bar-BnGtnJ82.js → data-bar-Bfh54sT4.js} +1 -1
- package/dist/{data-bar-2NLRzOCQ.cjs → data-bar-DzceAVeR.cjs} +1 -1
- package/dist/{designer-BNf7NWd6.js → designer-B597ZdC0.js} +2254 -2248
- package/dist/designer-DFIdv_n7.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +6 -6
- package/dist/designer.d.ts +6 -6
- package/dist/designer.js +1 -1
- package/dist/diagnostic-collector-gB07PHy2.js +392 -0
- package/dist/diagnostic-collector-wASg6Fzs.cjs +1 -0
- package/dist/dom-CXWMmwh-.cjs +1 -0
- package/dist/{dom-C90cTM6Y.js → dom-DxdCMLzs.js} +185 -185
- package/dist/{encoding-DSc9zv2F.js → encoding-Amq3XrtU.js} +2 -2
- package/dist/{encoding-CkziAnZI.cjs → encoding-DRVXs5xm.cjs} +1 -1
- package/dist/{font-loader-i7lZbqH_.js → font-loader-D4NLIKJL.js} +1 -1
- package/dist/{font-loader-D-znWNWS.cjs → font-loader-p_SyTvqt.cjs} +1 -1
- package/dist/{grid-strokes-BPiV1WHe.js → grid-strokes-DkZEZvcI.js} +1 -1
- package/dist/{grid-strokes-DYf-6DMl.cjs → grid-strokes-RFMR91jn.cjs} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +137 -137
- package/dist/{json-snapshot-BJWZNryO.js → json-snapshot-CBVWZvyC.js} +662 -615
- package/dist/json-snapshot-DCFEtfFw.cjs +2 -0
- package/dist/matrix-DUYPRL7t.cjs +1 -0
- package/dist/{matrix-C6e_r_vp.js → matrix-b6T291xo.js} +120 -104
- package/dist/{pdf-DWuq6uxx.cjs → pdf-C060D5UY.cjs} +2 -2
- package/dist/{pdf-0_5XiTCx.js → pdf-DU8HelKd.js} +17 -17
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.js +2 -2
- package/dist/{plugin-B1ydqEmS.js → plugin-BdCplNe1.js} +1 -1
- package/dist/{plugin-BQBz2vLG.cjs → plugin-DHe8y5pD.cjs} +1 -1
- package/dist/{prefill-Cuzh1wxf.js → prefill-Buy4NJ15.js} +2 -2
- package/dist/{prefill-2p9wrpn9.cjs → prefill-Cw4ZYGXZ.cjs} +1 -1
- package/dist/{prepared-DAwe8Il2.cjs → prepared-BlNeOjoO.cjs} +1 -1
- package/dist/{prepared-CVbgO9KR.js → prepared-CBJ7BkK0.js} +2 -2
- package/dist/protocol-BU_4sXP0.cjs +1 -0
- package/dist/protocol-CB19KXGr.js +96 -0
- package/dist/record-bindings-B7djSjNs.cjs +1 -0
- package/dist/{record-bindings-fhav-NLG.js → record-bindings-Cv7lFiof.js} +47 -47
- package/dist/{region-binding-workflow-Cm4mqhih.js → region-binding-workflow-EYxvUYJ-.js} +2 -2
- package/dist/{region-binding-workflow-DWCUgjZl.cjs → region-binding-workflow-NdkMSFCh.cjs} +1 -1
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/{rich-text-layout-YJHtCWQI.js → rich-text-layout-Ch_N0Ubu.js} +1 -1
- package/dist/{rich-text-layout-X9YOz1JD.cjs → rich-text-layout-yJGuThtC.cjs} +1 -1
- package/dist/runtime-B5d_lQNQ.js +227 -0
- package/dist/runtime-BRx8Agqr.cjs +1 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +1891 -1793
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +8 -8
- package/dist/style.css +1 -1
- package/dist/{template-catalog-Bu7s7ReF.js → template-catalog-CM6U_RlD.js} +3 -3
- package/dist/{template-catalog--yBX169M.cjs → template-catalog-Cj66M84u.cjs} +1 -1
- package/dist/{template-fragments-Di2vDFnx.js → template-fragments-BDxdCuMD.js} +2 -2
- package/dist/{template-fragments-5EzVn7bm.cjs → template-fragments-DbKdxI1z.cjs} +1 -1
- package/dist/template-registry-B-AK1oam.cjs +1 -0
- package/dist/{template-registry-BCBF2b8j.js → template-registry-DeVgwEZj.js} +145 -144
- package/dist/{textwrap-CmVkhMhx.js → textwrap-BywMBMXM.js} +1 -1
- package/dist/{textwrap-BPFxhpOw.cjs → textwrap-LhJkHWb1.cjs} +1 -1
- package/dist/vue/async.d.cts +4 -4
- package/dist/vue/async.d.ts +4 -4
- package/dist/vue/index.d.cts +6 -6
- package/dist/vue/index.d.ts +6 -6
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +7 -7
- package/dist/{workbook-session-B6P_-5a4.js → workbook-session-B6hRjTyX.js} +106 -107
- package/dist/{workbook-session-BnPK3T58.cjs → workbook-session-BclW7KKH.cjs} +3 -3
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +4 -4
- package/dist/xlsx/node.d.cts +30 -1
- package/dist/xlsx/node.d.ts +30 -1
- package/dist/xlsx-node.cjs +42 -42
- package/dist/xlsx-node.js +3908 -3889
- package/dist/xlsx.cjs +2 -2
- package/dist/xlsx.d.cts +2 -2
- package/dist/xlsx.d.ts +2 -2
- package/dist/xlsx.js +151 -151
- package/package.json +1 -1
- package/dist/ReportPreview-CyUXJSVX.cjs +0 -6
- package/dist/designer-DWnZZ_ej.cjs +0 -2
- package/dist/diagnostic-collector-1sqd7DQP.js +0 -355
- package/dist/diagnostic-collector-D3rlvxm3.cjs +0 -1
- package/dist/dom-CxOkm_Sy.cjs +0 -1
- package/dist/json-snapshot-C7QZrRBf.cjs +0 -2
- package/dist/matrix-B8QWbsGM.cjs +0 -1
- package/dist/progress-BXzlVbIp.js +0 -29
- package/dist/progress-DJBd9Rb9.cjs +0 -1
- package/dist/protocol-BOri9qJL.js +0 -105
- package/dist/protocol-DD5dHSz-.cjs +0 -1
- package/dist/record-bindings-CAyM5tGg.cjs +0 -1
- package/dist/runtime-BpSAgOw1.js +0 -201
- package/dist/runtime-Cd2UTnwe.cjs +0 -1
- package/dist/template-registry-Bnh5aEYf.cjs +0 -1
package/dist/xlsx.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { v, m as
|
|
2
|
-
import { e as
|
|
3
|
-
import { d as
|
|
4
|
-
import { e as
|
|
5
|
-
import { a as
|
|
6
|
-
import { c as
|
|
7
|
-
import { c as
|
|
8
|
-
import { r as
|
|
9
|
-
import { s as
|
|
10
|
-
import { b as
|
|
11
|
-
function
|
|
12
|
-
const t =
|
|
1
|
+
import { y as v, m as b, a as W, r as R, b as T, A as M, v as U, o as F, B as A, i as C } from "./diagnostic-collector-gB07PHy2.js";
|
|
2
|
+
import { e as X } from "./index-CPh6tqge.js";
|
|
3
|
+
import { d as K } from "./data-bar-Bfh54sT4.js";
|
|
4
|
+
import { e as J, E as V, m as I, i as q } from "./workbook-session-B6hRjTyX.js";
|
|
5
|
+
import { a as et, b as tt, o as nt } from "./workbook-session-B6hRjTyX.js";
|
|
6
|
+
import { c as Q } from "./media-Y90dHK9z.js";
|
|
7
|
+
import { c as Y } from "./capabilities-CN_kSVjO.js";
|
|
8
|
+
import { r as Z } from "./assets-C4MIvzQ4.js";
|
|
9
|
+
import { s as ee, a as te } from "./workbook-sheets-D4M7XXBh.js";
|
|
10
|
+
import { b as it, c as ot, a as at, d as st, e as lt, f as ct, g as dt, h as ht, p as ft, i as gt, v as ut, j as mt, k as wt, l as xt, m as pt, n as Mt } from "./region-binding-workflow-EYxvUYJ-.js";
|
|
11
|
+
function ne(e) {
|
|
12
|
+
const t = X({ width: 1, height: 1, channels: 4, depth: 8, data: new Uint8Array([1, 3, 5].map((o) => parseInt(e.slice(o, o + 2), 16)).concat(89)) });
|
|
13
13
|
return `data:image/png;base64,${btoa(String.fromCharCode(...t))}`;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function re(e, t, o) {
|
|
16
16
|
const n = /* @__PURE__ */ new Map();
|
|
17
17
|
let i = 0;
|
|
18
18
|
return (a, r, s, l) => {
|
|
19
|
-
const c =
|
|
19
|
+
const c = K(r.cell.dataBar, r.widthMm, r.heightMm, l);
|
|
20
20
|
if (!c) return;
|
|
21
21
|
if (++i > t) throw new Error(`Excel 数据条超过 ${t} 个绘图预算,请缩小范围或调整 maxDataBars`);
|
|
22
22
|
let d = n.get(c.color);
|
|
23
|
-
d || (d =
|
|
23
|
+
d || (d = ne(c.color), n.set(c.color, d)), i === 1 && o.push("数据条为静态半透明视觉快照,保留原始单元格值;Excel 编辑不会重算条形,绘图叠加文字的混色与预览可能略有差异。"), e.write(a, { kind: "image", leftMm: 0, topMm: 0, widthMm: c.width, heightMm: c.height, imageData: d }, s, { leftMm: r.xMm + c.x, offsetMm: c.y });
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
async function
|
|
26
|
+
async function ie(e, t, o) {
|
|
27
27
|
const n = e.pages.flatMap((r) => r.components), i = v(o);
|
|
28
28
|
let a = 0;
|
|
29
29
|
for (; n.length; ) {
|
|
@@ -36,28 +36,28 @@ async function re(e, t, o) {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function z(e, t) {
|
|
40
40
|
return { richText: e.flatMap((o, n) => [
|
|
41
41
|
...n ? [{ text: `
|
|
42
42
|
` }] : [],
|
|
43
43
|
...o.segments.map((i) => {
|
|
44
|
-
const a =
|
|
44
|
+
const a = b(t, i.style), r = a.color?.replace(/^#/, "");
|
|
45
45
|
return { text: i.kind === "field" ? i.field ?? "" : i.text ?? "", font: { name: a.fontFamily, bold: a.bold, italic: a.italic, underline: a.underline, size: W(a).fontSizePt, .../^[a-f\d]{6}$/i.test(r ?? "") ? { color: { argb: `FF${r.toUpperCase()}` } } : {} } };
|
|
46
46
|
})
|
|
47
47
|
]) };
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function oe(e, t) {
|
|
50
50
|
const o = e.children?.filter((a) => a.kind === "text" && !a.grid) ?? [];
|
|
51
51
|
if (!e.richParagraphs?.length && !o.length) return;
|
|
52
|
-
const n =
|
|
52
|
+
const n = b(t, e.style), i = e.richParagraphs?.length ? [...e.richParagraphs] : e.text ? [{ segments: [{ text: e.text }] }] : [];
|
|
53
53
|
for (const a of o) {
|
|
54
|
-
const r =
|
|
54
|
+
const r = b(n, a.style), s = a.richParagraphs?.length ? a.richParagraphs : [{ segments: [{ text: a.lines?.join(`
|
|
55
55
|
`) ?? a.text ?? "" }] }];
|
|
56
|
-
for (const l of s) i.push({ ...l, segments: l.segments.map((c) => ({ ...c, style:
|
|
56
|
+
for (const l of s) i.push({ ...l, segments: l.segments.map((c) => ({ ...c, style: b(r, c.style) })) });
|
|
57
57
|
}
|
|
58
|
-
return
|
|
58
|
+
return z(i, n);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function ae(e, t, o) {
|
|
61
61
|
let n = o * 72 / 25.4;
|
|
62
62
|
if (!Number.isFinite(n) || t + Math.ceil(n / 409) - 1 > 1048576) throw new Error("Excel 图片占位超过工作表行数上限");
|
|
63
63
|
for (; n > 0; ) {
|
|
@@ -67,18 +67,18 @@ function oe(e, t, o) {
|
|
|
67
67
|
}
|
|
68
68
|
return t;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function se(e, t, o) {
|
|
71
71
|
let n = Math.round(t * 36e3), i = 0;
|
|
72
72
|
if (!Number.isSafeInteger(n)) throw new Error("Excel 图片锚点超出安全坐标范围");
|
|
73
73
|
for (e.properties.defaultColWidth ??= 8.43; i < 16384; ) {
|
|
74
|
-
const a = e.getColumn(i + 1).width ?? e.properties.defaultColWidth, r = Math.round(
|
|
74
|
+
const a = e.getColumn(i + 1).width ?? e.properties.defaultColWidth, r = Math.round(J(a) * 36e3);
|
|
75
75
|
if (!Number.isSafeInteger(r) || r <= 0) throw new Error("Excel 图片锚点所在列宽无效");
|
|
76
76
|
if (n < r) return { col: i + n / r, row: o - 1, nativeCol: i, nativeColOff: n, nativeRow: o - 1, nativeRowOff: 0 };
|
|
77
77
|
n -= r, i++;
|
|
78
78
|
}
|
|
79
79
|
throw new Error("Excel 图片锚点超过16384列上限");
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function le(e, t, o) {
|
|
82
82
|
let n = o * 72 / 25.4;
|
|
83
83
|
if (!Number.isFinite(n) || Math.abs(n) > 1048576 * 409) throw new Error("Excel 图片纵向偏移超过工作表范围");
|
|
84
84
|
const i = (a) => {
|
|
@@ -91,8 +91,8 @@ function se(e, t, o) {
|
|
|
91
91
|
if (t > 1048576 || n < 0) throw new Error("Excel 图片移动到工作表边界之外");
|
|
92
92
|
return { nativeRow: t - 1, nativeRowOff: Math.round(n * 25.4 / 72 * 36e3) };
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
const n =
|
|
94
|
+
function ce(e, t, o) {
|
|
95
|
+
const n = Q(t), i = /* @__PURE__ */ new Map();
|
|
96
96
|
return { write(a, r, s, l) {
|
|
97
97
|
if (![r.widthMm, r.heightMm, r.leftMm].every(Number.isFinite) || r.widthMm < 0 || r.heightMm < 0 || r.leftMm < 0) throw new Error("Excel 图片尺寸无效");
|
|
98
98
|
if (!r.widthMm || !r.heightMm) return s;
|
|
@@ -101,43 +101,43 @@ function le(e, t, o) {
|
|
|
101
101
|
const c = n(r.imageData);
|
|
102
102
|
let d = i.get(c.dataUrl);
|
|
103
103
|
d === void 0 && (d = e.addImage({ base64: c.dataUrl, extension: c.extension }), i.set(c.dataUrl, d));
|
|
104
|
-
const h = l ? s :
|
|
104
|
+
const h = l ? s : ae(a, s, r.heightMm);
|
|
105
105
|
return a.addImage(d, {
|
|
106
|
-
tl: { ...
|
|
106
|
+
tl: { ...se(a, l?.leftMm ?? r.leftMm, s), ...l ? le(a, s, l.offsetMm) : {} },
|
|
107
107
|
ext: { width: r.widthMm * 96 / 25.4, height: r.heightMm * 96 / 25.4 },
|
|
108
108
|
editAs: "oneCell"
|
|
109
109
|
}), h;
|
|
110
110
|
} };
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function D(e) {
|
|
113
113
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function N(e, t) {
|
|
116
116
|
const o = e.meta?.xlsxFlow;
|
|
117
117
|
if (o === void 0) return;
|
|
118
|
-
if (!
|
|
118
|
+
if (!D(o) || o.version !== "1.0" || !Number.isSafeInteger(o.columnStart) || Number(o.columnStart) < 0) throw new Error("Excel 多区域几何标记无效,不能按列序猜测输出");
|
|
119
119
|
if (!e.grid) throw new Error("Excel 多区域输出只接受显式网格组件");
|
|
120
120
|
const n = o, i = e.grid.colWidthsMm;
|
|
121
121
|
if (!i?.length || n.columnStart + i.length > t.length || i.some((a, r) => Math.abs(a - t[n.columnStart + r]) > 1e-3)) throw new Error("Excel 多区域列位置与网格列宽不一致");
|
|
122
122
|
return n;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function L(e) {
|
|
125
125
|
const t = e.meta?.xlsxFlow;
|
|
126
126
|
if (t === void 0) {
|
|
127
127
|
if (e.components.some((n) => n.meta?.xlsxFlow !== void 0)) throw new Error("Excel 多区域页面缺少完整列几何标记");
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
|
-
const o =
|
|
130
|
+
const o = de(t, e.meta?.reportScope);
|
|
131
131
|
for (const n of e.components) {
|
|
132
|
-
const i =
|
|
132
|
+
const i = N(n, o.widths);
|
|
133
133
|
if (!i) throw new Error("Excel 多区域页面混入没有区域几何的组件,请使用独立页面模板");
|
|
134
134
|
const a = o.widths.slice(0, i.columnStart).reduce((s, l) => s + l, e.marginLeftMm ?? 0), r = n.grid.colWidthsMm.reduce((s, l) => s + l, 0);
|
|
135
135
|
if (Math.abs(a - n.leftMm) > 0.01 || Math.abs(r - n.widthMm) > 0.01) throw new Error("Excel 多区域标记与真实横向位置不一致");
|
|
136
136
|
}
|
|
137
137
|
return o;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
if (!
|
|
139
|
+
function de(e, t) {
|
|
140
|
+
if (!D(e) || e.version !== "1.0" || typeof e.sheet != "string" || !e.sheet.trim() || typeof e.templateId != "string" || !e.templateId.trim()) throw new Error("Excel 多区域工作表标识无效");
|
|
141
141
|
if (!Array.isArray(e.fullWidthsMm) || !e.fullWidthsMm.length || e.fullWidthsMm.length > 16384 || e.fullWidthsMm.some((o) => typeof o != "number" || !Number.isFinite(o) || o <= 0 || o > 2e3)) throw new Error("Excel 多区域完整列宽无效");
|
|
142
142
|
if (t !== void 0 && (typeof t != "string" || !t.trim())) throw new Error("Excel 多区域报表命名空间无效");
|
|
143
143
|
return { key: JSON.stringify([t ?? e.templateId, e.sheet]), sheet: e.sheet, widths: e.fullWidthsMm };
|
|
@@ -145,17 +145,17 @@ function ce(e, t) {
|
|
|
145
145
|
function S(e) {
|
|
146
146
|
return Math.round(e * 1e6) / 1e6;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function he(e, t, o, n, i) {
|
|
149
149
|
return e.components.filter((a) => n ? a.pageAnchor === "header" ? t === 0 : a.pageAnchor === "footer" ? t === o - 1 : a.table?.role !== "header" ? !0 : i.has(a.table.id) ? !1 : (i.add(a.table.id), !0) : !0);
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function fe(e, t, o, n) {
|
|
152
152
|
const i = e.components.filter((r) => !t.includes(r) && r.table?.role === "header"), a = t.filter((r) => !r.pageAnchor).reduce((r, s) => Math.max(r, s.topMm + s.heightMm), e.marginTopMm ?? 0);
|
|
153
153
|
return t.map((r) => {
|
|
154
154
|
let s = r.topMm;
|
|
155
|
-
return o && r.pageAnchor === "footer" && (s = a), s -= i.filter((l) => l.topMm + l.heightMm <= s + 1e-3).reduce((l, c) => l + c.heightMm, 0), { component: r, layout: R(r.grid, r.widthMm, r.heightMm), top: s, column:
|
|
155
|
+
return o && r.pageAnchor === "footer" && (s = a), s -= i.filter((l) => l.topMm + l.heightMm <= s + 1e-3).reduce((l, c) => l + c.heightMm, 0), { component: r, layout: R(r.grid, r.widthMm, r.heightMm), top: s, column: N(r, n).columnStart };
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function ge(e, t, o) {
|
|
159
159
|
const n = t.length - 1;
|
|
160
160
|
if (n * o.length > 1e6) throw new Error("Excel 多区域单页超过 100 万几何单元格,请减小预览分页高度或列数");
|
|
161
161
|
const i = new Map(t.map((s, l) => [s, l])), a = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
@@ -167,7 +167,7 @@ function fe(e, t, o) {
|
|
|
167
167
|
if (r.has(w)) throw new Error("Excel 多区域实际单元格互相覆盖,已终止输出,未覆盖已有内容");
|
|
168
168
|
r.set(w, f);
|
|
169
169
|
}
|
|
170
|
-
a.set(f, { ...l.cell, style:
|
|
170
|
+
a.set(f, { ...l.cell, style: T(s.component.style, l.cell), rowSpan: d - c, colSpan: u - h });
|
|
171
171
|
}
|
|
172
172
|
return Array.from({ length: n }, (s, l) => {
|
|
173
173
|
const c = [];
|
|
@@ -178,43 +178,43 @@ function fe(e, t, o) {
|
|
|
178
178
|
return c;
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function ue(e, t) {
|
|
182
182
|
const o = /* @__PURE__ */ new Set(), n = [];
|
|
183
183
|
let i;
|
|
184
184
|
for (const [a, { page: r }] of e.entries()) {
|
|
185
|
-
const s =
|
|
185
|
+
const s = L(r);
|
|
186
186
|
if (i && (s.key !== i.key || s.widths.length !== i.widths.length || s.widths.some((f, g) => Math.abs(f - i.widths[g]) > 1e-3))) throw new Error("Excel 多区域分页的工作表或列结构不一致");
|
|
187
187
|
i ??= s;
|
|
188
|
-
const l =
|
|
188
|
+
const l = he(r, a, e.length, t, o), c = fe(r, l, t, s.widths);
|
|
189
189
|
if (!c.length) continue;
|
|
190
|
-
const d = [...new Set(c.flatMap((f) => [...f.layout.rows.map((g) => S(f.top + g.pos)), S(f.top + f.component.heightMm)]))].sort((f, g) => f - g), h =
|
|
190
|
+
const d = [...new Set(c.flatMap((f) => [...f.layout.rows.map((g) => S(f.top + g.pos)), S(f.top + f.component.heightMm)]))].sort((f, g) => f - g), h = ge(c, d, s.widths), u = d.slice(1).map((f, g) => f - d[g]);
|
|
191
191
|
n.push({ kind: "rect", leftMm: 0, topMm: 0, widthMm: s.widths.reduce((f, g) => f + g, 0), heightMm: u.reduce((f, g) => f + g, 0), grid: { cells: h, colWidthsMm: s.widths, rowHeightsMm: u } });
|
|
192
192
|
}
|
|
193
193
|
return n;
|
|
194
194
|
}
|
|
195
|
-
const
|
|
196
|
-
function
|
|
195
|
+
const O = 72 / 25.4, me = 32767, we = 253;
|
|
196
|
+
function p(e, t) {
|
|
197
197
|
if (typeof e != "string") return;
|
|
198
|
-
if (e.length >
|
|
198
|
+
if (e.length > me)
|
|
199
199
|
throw new Error(`Excel 单元格 ${t} 最多支持 32767 个字符,无法无损导出;内容未裁剪`);
|
|
200
200
|
let o = 0;
|
|
201
201
|
for (let n = 0; n < e.length; n++)
|
|
202
|
-
if (e.charCodeAt(n) === 10 && ++o >
|
|
202
|
+
if (e.charCodeAt(n) === 10 && ++o > we)
|
|
203
203
|
throw new Error(`Excel 单元格 ${t} 最多支持 253 个换行,无法无损导出;内容未改写`);
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function E(e) {
|
|
206
206
|
if (!e) return;
|
|
207
207
|
const t = e.replace("#", "");
|
|
208
208
|
return /^[0-9a-fA-F]{6}$/.test(t) ? `FF${t.toUpperCase()}` : void 0;
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function j(e, t = {}) {
|
|
211
211
|
e.font = {
|
|
212
212
|
name: t.fontFamily,
|
|
213
213
|
bold: t.bold === !0,
|
|
214
214
|
italic: t.italic === !0,
|
|
215
215
|
underline: t.underline === !0,
|
|
216
216
|
size: W(t).fontSizePt,
|
|
217
|
-
color:
|
|
217
|
+
color: E(t.color) ? { argb: E(t.color) } : void 0
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
220
|
const y = {
|
|
@@ -222,29 +222,29 @@ const y = {
|
|
|
222
222
|
a4: { width: 210, height: 297, code: 9 },
|
|
223
223
|
a5: { width: 148, height: 210, code: 11 }
|
|
224
224
|
};
|
|
225
|
-
function
|
|
225
|
+
function xe(e, t, o, n) {
|
|
226
226
|
if (t && t !== "auto") return y[t].code;
|
|
227
227
|
const i = Math.min(e.pageWidthMm, e.pageHeightMm), a = Math.max(e.pageWidthMm, e.pageHeightMm), r = Object.values(y).find((s) => Math.abs(i - s.width) <= 1 && Math.abs(a - s.height) <= 1);
|
|
228
228
|
return r ? r.code : (n.push(`page ${o + 1}: 自定义纸张 ${e.pageWidthMm}×${e.pageHeightMm}mm 无对应 Excel 纸型,打印设置回退 A4;可显式配置 paperSize`), y.a4.code);
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function pe(e, t, o, n) {
|
|
231
231
|
const i = typeof t.text == "string" ? t.text : "";
|
|
232
232
|
if (o !== "raw" || !Object.prototype.hasOwnProperty.call(t, "value")) {
|
|
233
|
-
|
|
233
|
+
p(i, e.address), e.value = i;
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
236
|
const a = t.value;
|
|
237
237
|
if (a === null || typeof a == "string" || typeof a == "boolean" || typeof a == "number" && Number.isFinite(a)) {
|
|
238
|
-
|
|
238
|
+
p(a, e.address), e.value = a, t.numberFormat && (e.numFmt = t.numberFormat);
|
|
239
239
|
return;
|
|
240
240
|
}
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
function pe(e) {
|
|
244
|
-
const t = N(e);
|
|
245
|
-
return t ? { id: `xlsx-flow:${t.key}`, title: t.sheet, wide: !0, flow: !0 } : Me(e);
|
|
241
|
+
p(i, e.address), e.value = i, n.push(`原始单元格值无效,已保留显示文本:${e.address}`);
|
|
246
242
|
}
|
|
247
243
|
function Me(e) {
|
|
244
|
+
const t = L(e);
|
|
245
|
+
return t ? { id: `xlsx-flow:${t.key}`, title: t.sheet, wide: !0, flow: !0 } : Ee(e);
|
|
246
|
+
}
|
|
247
|
+
function Ee(e) {
|
|
248
248
|
const o = e.components.filter((n) => n.table !== void 0)[0]?.table;
|
|
249
249
|
if (!(!o || typeof o.id != "string" || !o.id.trim() || !Array.isArray(o.columnKeys) || !o.columnKeys.length)) {
|
|
250
250
|
for (const n of e.components) {
|
|
@@ -257,7 +257,7 @@ function Me(e) {
|
|
|
257
257
|
return { id: o.id, title: o.title, wide: o.layout === "wide" || e.layout === "wide" };
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function be(e, t) {
|
|
261
261
|
const o = /* @__PURE__ */ new Set();
|
|
262
262
|
for (const [n, i] of e.pages.entries())
|
|
263
263
|
if (!t[n])
|
|
@@ -268,8 +268,8 @@ function Ee(e, t) {
|
|
|
268
268
|
function k(e) {
|
|
269
269
|
return e.layout === "wide" || e.components.some((t) => t.table?.layout === "wide");
|
|
270
270
|
}
|
|
271
|
-
function
|
|
272
|
-
const n = [], i = e.pages.map(
|
|
271
|
+
function ye(e, t, o) {
|
|
272
|
+
const n = [], i = e.pages.map(Me), a = be(e, i);
|
|
273
273
|
for (const [r, s] of e.pages.entries()) {
|
|
274
274
|
const l = i[r], c = l && !a.has(l.id), d = t === "pages" || !c ? void 0 : l;
|
|
275
275
|
if (t === "continuous" && !d)
|
|
@@ -281,11 +281,11 @@ function be(e, t, o) {
|
|
|
281
281
|
}
|
|
282
282
|
return n;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function P(e, t, o) {
|
|
285
285
|
return !e || e.length === t.length && e.every((n, i) => o(n, t[i]));
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
const i = e.table, a = t.columns.map((l) => l.size), r =
|
|
287
|
+
function Se(e, t, o, n) {
|
|
288
|
+
const i = e.table, a = t.columns.map((l) => l.size), r = P(n.keys, i.columnKeys, (l, c) => l === c), s = P(n.widths, a, (l, c) => Math.abs(l - c) <= 1e-3);
|
|
289
289
|
if (i.columnKeys.length !== a.length || !r || !s)
|
|
290
290
|
throw new Error(`page ${o + 1}: 连续 Excel 逻辑表 ${i.id} 的列结构或列宽不一致`);
|
|
291
291
|
if (n.keys ??= i.columnKeys, n.widths ??= a, i.role === "header") {
|
|
@@ -297,16 +297,16 @@ function ye(e, t, o, n) {
|
|
|
297
297
|
n.expectedRow += t.rows.length;
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function ve(e, t) {
|
|
301
301
|
const o = { expectedRow: 0, headerSeen: !1 };
|
|
302
302
|
for (const { page: n, index: i } of e.pages)
|
|
303
303
|
for (const a of n.components) {
|
|
304
304
|
const r = t.get(a);
|
|
305
|
-
a.table && r &&
|
|
305
|
+
a.table && r && Se(a, r, i, o);
|
|
306
306
|
}
|
|
307
307
|
if (!o.headerSeen) throw new Error("连续 Excel 逻辑表缺少明确表头来源");
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function Ce(e, t, o) {
|
|
310
310
|
let n = (e?.replace(/[\\/*?:[\]]/g, " ").replace(/\s+/g, " ").trim() || `Sheet${t + 1}`).slice(0, 31).replace(/^'+|'+$/g, "").trim() || `Sheet${t + 1}`;
|
|
311
311
|
n.toLowerCase() === "history" && (n += " 报表");
|
|
312
312
|
let i = n, a = 1;
|
|
@@ -316,7 +316,7 @@ function ve(e, t, o) {
|
|
|
316
316
|
}
|
|
317
317
|
return o.add(i.toLowerCase()), i;
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function ke(e) {
|
|
320
320
|
const t = /* @__PURE__ */ new Set();
|
|
321
321
|
function o(n, i, a, r) {
|
|
322
322
|
return n <= i ? n : (t.has(a) || (e.push(r), t.add(a)), i);
|
|
@@ -326,8 +326,8 @@ function Ce(e) {
|
|
|
326
326
|
row: (n) => o(n, 409, "row", "Excel 行高上限为 409pt,超高行已收敛至 409pt;单元格值完整保留,显示范围可能受限")
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
|
-
async function
|
|
330
|
-
const o = e.flow ?
|
|
329
|
+
async function Be(e, t) {
|
|
330
|
+
const o = e.flow ? ue(e.pages, e.continuous).map((r) => ({ comp: r, pageIndex: e.pages[0].index })) : e.pages.flatMap(({ page: r, index: s }, l) => r.components.filter((c) => !e.continuous || (c.pageAnchor !== "header" || l === 0) && (c.pageAnchor !== "footer" || l === e.pages.length - 1)).map((c) => ({ comp: c, pageIndex: s }))), n = /* @__PURE__ */ new Map();
|
|
331
331
|
let i = 1, a = 0;
|
|
332
332
|
for (const { comp: r } of o)
|
|
333
333
|
if (r.grid) {
|
|
@@ -339,17 +339,17 @@ async function ke(e, t) {
|
|
|
339
339
|
if (i > 16384) throw new Error("Excel 最多支持 16384 列,无法无损导出此报表");
|
|
340
340
|
return { components: o, grids: n, columnCount: i, textWidthMm: a };
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function $e(e, t, o) {
|
|
343
343
|
const { page: n, index: i } = e.pages[0], a = t !== void 0 && t !== "auto";
|
|
344
344
|
return (e.continuous || k(n)) && !a ? {} : { pageSetup: {
|
|
345
|
-
paperSize:
|
|
345
|
+
paperSize: xe(n, t, i, o),
|
|
346
346
|
orientation: n.pageWidthMm > n.pageHeightMm ? "landscape" : "portrait",
|
|
347
347
|
fitToPage: !0,
|
|
348
348
|
...e.continuous ? { fitToWidth: 1, fitToHeight: 0 } : {}
|
|
349
349
|
} };
|
|
350
350
|
}
|
|
351
|
-
function
|
|
352
|
-
const t =
|
|
351
|
+
function Ae(e) {
|
|
352
|
+
const t = E(e.borderColor ?? e.lineColor), o = { style: "thin", ...t ? { color: { argb: t } } : {} };
|
|
353
353
|
return {
|
|
354
354
|
...e.borderTop !== !1 ? { top: o } : {},
|
|
355
355
|
...e.borderLeft !== !1 ? { left: o } : {},
|
|
@@ -359,58 +359,58 @@ function $e(e) {
|
|
|
359
359
|
}
|
|
360
360
|
function Pe(e, t) {
|
|
361
361
|
e.alignment = { horizontal: t.align ?? "left", vertical: t.verticalAlign ?? "middle", wrapText: !0 };
|
|
362
|
-
const o =
|
|
363
|
-
o && (e.fill = { type: "pattern", pattern: "solid", fgColor: { argb: o } }), e.border =
|
|
362
|
+
const o = E(t.backgroundColor);
|
|
363
|
+
o && (e.fill = { type: "pattern", pattern: "solid", fgColor: { argb: o } }), e.border = Ae(t), j(e, t);
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function We(e, t) {
|
|
366
366
|
for (const [o, n] of t.columns.entries()) {
|
|
367
|
-
const i = e.sheet.getColumn(o + 1), a = e.limits.column(
|
|
367
|
+
const i = e.sheet.getColumn(o + 1), a = e.limits.column(I(n.size));
|
|
368
368
|
(i.width == null || i.width < a) && (i.width = a);
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
function
|
|
371
|
+
function Re(e, t, o) {
|
|
372
372
|
for (const [n, i] of t.rows.entries()) {
|
|
373
|
-
const a = e.sheet.getRow(o + n), r = e.limits.row(i.size *
|
|
373
|
+
const a = e.sheet.getRow(o + n), r = e.limits.row(i.size * O);
|
|
374
374
|
(a.height == null || a.height < r) && (a.height = r);
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function Te(e, t, o, n) {
|
|
378
378
|
const i = Math.max(1, Math.min(t.cell.colSpan ?? 1, o.columns.length - t.ci)), a = Math.max(1, Math.min(t.cell.rowSpan ?? 1, o.rows.length - t.ri));
|
|
379
379
|
(i > 1 || a > 1) && e.mergeCells(n + t.ri, t.ci + 1, n + t.ri + a - 1, t.ci + i);
|
|
380
380
|
}
|
|
381
|
-
async function
|
|
381
|
+
async function Fe(e, t, o, n) {
|
|
382
382
|
if (n + o.rows.length - 1 > 1048576) throw new Error("Excel 最多支持 1048576 行,无法无损导出此报表");
|
|
383
|
-
|
|
383
|
+
Re(e, o, n);
|
|
384
384
|
for (const i of o.cells) {
|
|
385
385
|
const a = e.sheet.getCell(n + i.ri, i.ci + 1);
|
|
386
|
-
|
|
387
|
-
const r =
|
|
388
|
-
r && (
|
|
386
|
+
pe(a, i.cell, e.valueMode, e.warnings);
|
|
387
|
+
const r = oe(i.cell, t.style);
|
|
388
|
+
r && (p(r.richText.map((c) => c.text).join(""), a.address), a.value = r);
|
|
389
389
|
const s = t.grid?.paddingMm ?? 0.5;
|
|
390
390
|
e.dataBars(e.sheet, i, n + i.ri, s);
|
|
391
391
|
for (const c of i.cell.children ?? [])
|
|
392
392
|
C(c) && !c.grid && e.images.write(e.sheet, c, n + i.ri, { leftMm: i.xMm + s + (i.cell.indentMm ?? 0) + c.leftMm, offsetMm: s + c.topMm });
|
|
393
|
-
Pe(a,
|
|
393
|
+
Pe(a, T(t.style, i.cell)), i.cell.indentMm && (a.alignment = { ...a.alignment, indent: Math.min(250, Math.max(1, Math.round(i.cell.indentMm / 2.5))) }), Te(e.sheet, i, o, n);
|
|
394
394
|
const l = e.schedule();
|
|
395
395
|
l && await l;
|
|
396
396
|
}
|
|
397
397
|
return n + o.rows.length;
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function Ie(e, t, o, n) {
|
|
400
400
|
const i = Array.isArray(t.lines) && t.lines.length > 0 ? t.lines.join(`
|
|
401
401
|
`) : t.text ?? "", a = e.sheet.getRow(o), r = a.getCell(1);
|
|
402
|
-
t.richParagraphs?.length ||
|
|
403
|
-
const s =
|
|
404
|
-
return s && (r.fill = { type: "pattern", pattern: "solid", fgColor: { argb: s } }),
|
|
402
|
+
t.richParagraphs?.length || p(i, r.address), r.value = t.richParagraphs?.length ? z(t.richParagraphs, t.style) : i, typeof r.value == "object" && r.value && "richText" in r.value && p(r.value.richText.map((l) => l.text).join(""), r.address), r.alignment = { horizontal: t.style?.align ?? "left", vertical: t.style?.verticalAlign ?? "middle", wrapText: !0 };
|
|
403
|
+
const s = E(t.style?.backgroundColor);
|
|
404
|
+
return s && (r.fill = { type: "pattern", pattern: "solid", fgColor: { argb: s } }), j(r, t.style), n > 1 && e.sheet.mergeCells(o, 1, o, n), a.height = e.limits.row(t.heightMm * O), o + 1;
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function ze(e, t, o) {
|
|
407
407
|
const n = t + o - 1;
|
|
408
408
|
e.views = [{ state: "frozen", ySplit: n, xSplit: 0 }], e.pageSetup.printTitlesRow = `1:${n}`;
|
|
409
409
|
}
|
|
410
|
-
async function
|
|
411
|
-
!t.grids.size && t.textWidthMm > 0 && (e.sheet.getColumn(1).width = e.limits.column(
|
|
410
|
+
async function De(e, t, o, n) {
|
|
411
|
+
!t.grids.size && t.textWidthMm > 0 && (e.sheet.getColumn(1).width = e.limits.column(I(t.textWidthMm)));
|
|
412
412
|
for (const r of t.grids.values()) {
|
|
413
|
-
|
|
413
|
+
We(e, r);
|
|
414
414
|
const s = e.schedule(r.columns.length);
|
|
415
415
|
s && await s;
|
|
416
416
|
}
|
|
@@ -421,17 +421,17 @@ async function ze(e, t, o, n) {
|
|
|
421
421
|
if (i > 1048576) throw new Error("Excel 最多支持 1048576 行,无法无损导出此报表");
|
|
422
422
|
const c = t.grids.get(r);
|
|
423
423
|
if (c)
|
|
424
|
-
l && (
|
|
424
|
+
l && (ze(e.sheet, i, c.rows.length), a = !0), i = await Fe(e, r, c, i);
|
|
425
425
|
else if (r.kind === "text")
|
|
426
|
-
i =
|
|
426
|
+
i = Ie(e, r, i, t.columnCount);
|
|
427
427
|
else if (C(r)) {
|
|
428
|
-
const d =
|
|
428
|
+
const d = q(r, o), h = n.write(e.sheet, r, d?.row ?? i, d);
|
|
429
429
|
d || (i = h);
|
|
430
430
|
} else
|
|
431
431
|
e.warnings.push(`page ${s + 1} ${r.nid ?? r.kind}: 组件类型 ${r.kind} 暂不支持 xlsx 导出,已跳过`);
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function Ne(e) {
|
|
435
435
|
if (e.maxDataBars !== void 0 && (!Number.isSafeInteger(e.maxDataBars) || e.maxDataBars < 0 || e.maxDataBars > 1e5)) throw new Error("xlsx maxDataBars 必须是 0–100000 的整数");
|
|
436
436
|
if (e.valueMode !== void 0 && e.valueMode !== "text" && e.valueMode !== "raw")
|
|
437
437
|
throw new Error("xlsx valueMode 必须是 text 或 raw");
|
|
@@ -440,35 +440,35 @@ function De(e) {
|
|
|
440
440
|
if (e.sheetMode !== void 0 && !["auto", "pages", "continuous"].includes(e.sheetMode))
|
|
441
441
|
throw new Error("xlsx sheetMode 必须是 auto、pages 或 continuous");
|
|
442
442
|
}
|
|
443
|
-
function
|
|
444
|
-
const n =
|
|
443
|
+
function Le(e, t, o) {
|
|
444
|
+
const n = Y(e, "xlsx", t, o);
|
|
445
445
|
return { diagnostics: n.entries, ...t.diagnosticLimit === void 0 ? {} : { diagnosticSummary: n.snapshot() } };
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function Oe(e, t, o, n, i) {
|
|
448
448
|
return { workbook: e, warnings: t.entries, ...i === void 0 ? {} : { warningCount: t.total }, ...o, ...n.length ? { notes: n } : {} };
|
|
449
449
|
}
|
|
450
|
-
async function
|
|
451
|
-
const o =
|
|
452
|
-
|
|
453
|
-
const i = t.assetRegistry || t.assetRenderers ? await
|
|
450
|
+
async function je(e, t = {}) {
|
|
451
|
+
const o = ee(t.additionalSheets), n = te(t.sheetNames);
|
|
452
|
+
Ne(t), M(t.signal);
|
|
453
|
+
const i = t.assetRegistry || t.assetRenderers ? await Z(e, { ...t, format: "xlsx" }) : { plan: e, diagnostics: [] };
|
|
454
454
|
e = i.plan;
|
|
455
|
-
const a =
|
|
456
|
-
await
|
|
457
|
-
const r = new
|
|
455
|
+
const a = Le(e, t, i);
|
|
456
|
+
await ie(e, t.maxDataBars ?? 1e4, t);
|
|
457
|
+
const r = new V.Workbook(), s = U(t.diagnosticLimit), l = ce(r, t, s), c = [], d = re(l, t.maxDataBars ?? 1e4, c), h = ke(s), u = ye(e, t.sheetMode, s), f = u.length + (o?.length ?? 0), g = /* @__PURE__ */ new Set(), x = v(t);
|
|
458
458
|
for (const [w, m] of u.entries()) {
|
|
459
|
-
const B = await
|
|
460
|
-
m.continuous && !m.flow &&
|
|
461
|
-
const
|
|
459
|
+
const B = await Be(m, x);
|
|
460
|
+
m.continuous && !m.flow && ve(m, B.grids);
|
|
461
|
+
const G = m.pages[0].page, $ = n?.[w] ?? t.sheetName?.(w) ?? Ce(m.title, w, g);
|
|
462
462
|
g.add($.toLowerCase());
|
|
463
|
-
const
|
|
464
|
-
|
|
463
|
+
const H = r.addWorksheet($, $e(m, t.paperSize, s)), _ = t.valueMode ?? (k(G) || m.continuous || m.flow ? "raw" : "text");
|
|
464
|
+
M(t.signal), await De({ sheet: H, warnings: s, limits: h, valueMode: _, schedule: x, images: l, dataBars: d }, B, m.continuous, l), await F(t, w + 1, f);
|
|
465
465
|
}
|
|
466
|
-
return await
|
|
466
|
+
return await Ge(r, o, t, u.length, f), Oe(r, s, a, c, t.diagnosticLimit);
|
|
467
467
|
}
|
|
468
|
-
async function
|
|
468
|
+
async function Ge(e, t = [], o, n, i) {
|
|
469
469
|
const a = v(o);
|
|
470
470
|
for (const r of t) {
|
|
471
|
-
if (
|
|
471
|
+
if (M(o.signal), e.worksheets.some((l) => l.name.toLowerCase() === r.name.toLowerCase())) throw new TypeError(`附加工作表名称已被报表使用 ${r.name}`);
|
|
472
472
|
const s = e.addWorksheet(r.name);
|
|
473
473
|
r.columnWidths && (s.columns = r.columnWidths.map((l) => ({ width: l })));
|
|
474
474
|
for (const l of r.rows) {
|
|
@@ -477,39 +477,39 @@ async function je(e, t = [], o, n, i) {
|
|
|
477
477
|
const d = a(l.length);
|
|
478
478
|
d && await d;
|
|
479
479
|
}
|
|
480
|
-
await
|
|
480
|
+
await F(o, ++n, i);
|
|
481
481
|
}
|
|
482
|
-
|
|
482
|
+
M(o.signal);
|
|
483
483
|
}
|
|
484
|
-
async function
|
|
484
|
+
async function Qe(e, t = {}) {
|
|
485
485
|
let o = 1;
|
|
486
486
|
const n = t.onProgress ? (r, s) => {
|
|
487
|
-
o = s + 1,
|
|
488
|
-
} : void 0, i = await
|
|
489
|
-
|
|
487
|
+
o = s + 1, A(t, r, o);
|
|
488
|
+
} : void 0, i = await je(e, { ...t, onProgress: n });
|
|
489
|
+
M(t.signal);
|
|
490
490
|
const a = await i.workbook.xlsx.writeBuffer();
|
|
491
|
-
return
|
|
491
|
+
return M(t.signal), A(t, o, o), { ...i, buffer: a };
|
|
492
492
|
}
|
|
493
493
|
export {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
494
|
+
it as bindExcelTemplate,
|
|
495
|
+
ot as createExcelBindingDocument,
|
|
496
|
+
at as createExcelBindingSession,
|
|
497
|
+
st as createExcelRegionBindingDocument,
|
|
498
|
+
lt as createExcelRegionBindingSession,
|
|
499
|
+
ct as excelBindingCellRange,
|
|
500
|
+
dt as excelBindingRowRange,
|
|
501
|
+
ht as getExcelSheetWindow,
|
|
502
|
+
et as importExcelTemplate,
|
|
503
|
+
tt as inspectExcelWorkbook,
|
|
504
|
+
nt as openExcelWorkbook,
|
|
505
|
+
ft as parseExcelBindingSession,
|
|
506
|
+
gt as parseExcelRegionBindingSession,
|
|
507
|
+
je as renderPlanToWorkbook,
|
|
508
|
+
Qe as renderPlanToXlsx,
|
|
509
|
+
ut as validateExcelBindingFields,
|
|
510
|
+
mt as validateExcelBindingRecipe,
|
|
511
|
+
wt as validateExcelBindingRegions,
|
|
512
|
+
xt as validateExcelRegionBindings,
|
|
513
|
+
pt as validateExcelRegionFields,
|
|
514
|
+
Mt as validateExcelRegionGeometry
|
|
515
515
|
};
|