@agile-team/mach-report 2.15.0 → 2.16.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 +14 -9
- package/dist/{ExcelBindingWizard-Bs43BGNp.cjs → ExcelBindingWizard-CP6h2x1f.cjs} +1 -1
- package/dist/{ExcelBindingWizard-BKH1nGNS.js → ExcelBindingWizard-HhB3hAJE.js} +3 -3
- package/dist/{ParamEditor-Da4akw6V.cjs → ParamEditor-CUQLgoxa.cjs} +1 -1
- package/dist/{ParamEditor-DoAhzJsm.js → ParamEditor-OKesP_nO.js} +1 -1
- package/dist/{ReportBatchPanel-wP9m9Pj1.cjs → ReportBatchPanel-cZCAMAwH.cjs} +1 -1
- package/dist/{ReportBatchPanel-BMf6boMA.js → ReportBatchPanel-ruxcbfY6.js} +3 -3
- package/dist/ReportPreview-BcDKCLiK.js +4834 -0
- package/dist/ReportPreview-Bk9nLfO9.cjs +6 -0
- package/dist/{ReportTemplateLibrary-Sxr3eD0J.cjs → ReportTemplateLibrary-BDlNT8JN.cjs} +1 -1
- package/dist/{ReportTemplateLibrary-C9wutIiT.js → ReportTemplateLibrary-DcwrH-63.js} +1 -1
- package/dist/{RuleEditor-XhGHK8DE.cjs → RuleEditor-BX5S8RSF.cjs} +1 -1
- package/dist/{RuleEditor-C_Clasvd.js → RuleEditor-CGl9XY2s.js} +2 -2
- package/dist/{TemplateOutlinePanel-JTSR53vJ.cjs → TemplateOutlinePanel-CGrT5DFN.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-D6Bkny59.js → TemplateOutlinePanel-SXCjaPKR.js} +1 -1
- package/dist/{TemplateReusePanel-Kx35S0Ql.cjs → TemplateReusePanel-6Z3wRFz8.cjs} +1 -1
- package/dist/{TemplateReusePanel-rVuK1kTz.js → TemplateReusePanel-lHLOS9Wn.js} +2 -2
- package/dist/{TemplateReviewPanel-B0ar9_zf.js → TemplateReviewPanel-CJ9PLc48.js} +1 -1
- package/dist/{TemplateReviewPanel-Dn6X9UmY.cjs → TemplateReviewPanel-Dpk7sLcF.cjs} +1 -1
- package/dist/analytics.d.cts +2 -0
- package/dist/analytics.d.ts +2 -0
- package/dist/artifact-integrity.json +99 -91
- package/dist/{assets-DEaz4qsp.js → assets-CqIbfbTr.js} +24 -22
- package/dist/assets-e4YSke8n.cjs +1 -0
- package/dist/auto-YR7a4BtF.js +240 -0
- package/dist/auto-uVBjX1j5.cjs +1 -0
- package/dist/{batch-BfZHN1do.js → batch-WzDIXJAt.js} +1 -1
- package/dist/{batch-CLpELXBl.cjs → batch-z6Aw5GEY.cjs} +1 -1
- package/dist/capabilities-DDwXr_cA.js +103 -0
- package/dist/capabilities-DNLyZdNw.cjs +1 -0
- package/dist/codes.d.cts +2 -0
- package/dist/codes.d.ts +2 -0
- package/dist/component-tree-Ca6YYfHq.js +61 -0
- package/dist/component-tree-DkGLEfZC.cjs +1 -0
- package/dist/config-Dg_o8e7m.cjs +1 -0
- package/dist/{config-BVsJXSqS.js → config-XQ4qrQ7Q.js} +66 -64
- package/dist/designer-BfQSahxq.js +5163 -0
- package/dist/designer-CPPdeM5_.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +53 -0
- package/dist/designer.d.ts +53 -0
- package/dist/designer.js +1 -1
- package/dist/diagnostic-notification-B9K9We3h.cjs +1 -0
- package/dist/diagnostic-notification-qGAYZdkB.js +7 -0
- package/dist/drill-CsdjgkRM.cjs +1 -0
- package/dist/{drill-ByJviLXS.js → drill-DIGsZfyB.js} +11 -11
- package/dist/encoding-BOGq4qYL.js +21 -0
- package/dist/encoding-BYF9ZTl9.cjs +1 -0
- package/dist/{font-loader-Q3bQjmrI.js → font-loader-CzI1GuBc.js} +1 -1
- package/dist/{font-loader-B_UkxpzC.cjs → font-loader-EKLzOJxf.cjs} +1 -1
- package/dist/index.cjs +7 -8
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +865 -834
- package/dist/json-snapshot-D6ioHth9.js +1702 -0
- package/dist/json-snapshot-DknkjvxP.cjs +2 -0
- package/dist/{pdf-CvvrjPQg.cjs → pdf-ByVCb1i6.cjs} +48 -50
- package/dist/{pdf-BwNyeGpt.js → pdf-DJ5S6ukC.js} +2737 -2749
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.d.cts +2 -0
- package/dist/pdf.d.ts +2 -0
- package/dist/pdf.js +2 -2
- package/dist/{plugin-Ca_XZG3l.js → plugin-C2j5_mhx.js} +1 -1
- package/dist/{plugin-DHO7X8z2.cjs → plugin-Dr39GBRG.cjs} +1 -1
- package/dist/prepared-DdrjLC7L.cjs +1 -0
- package/dist/prepared-DqtpvRTn.js +87 -0
- package/dist/progress-BXzlVbIp.js +29 -0
- package/dist/progress-DJBd9Rb9.cjs +1 -0
- package/dist/{progress-D-OTpEav.js → progress-Hc2vxoCs.js} +2 -2
- package/dist/protocol-BzwMP4Vw.cjs +1 -0
- package/dist/protocol-kt4Iy6-3.js +90 -0
- package/dist/{record-bindings-Do_b3h4V.js → record-bindings-CZWBJ1fU.js} +9 -10
- package/dist/record-bindings-DUX1VMlR.cjs +1 -0
- package/dist/{region-binding-workflow-BMhK_TjP.js → region-binding-workflow-CWNvIjkV.js} +1 -1
- package/dist/{region-binding-workflow-DIYJdCUr.cjs → region-binding-workflow-CqSMxQ4p.cjs} +1 -1
- package/dist/report-encoding-worker.cjs +1 -0
- package/dist/report-encoding-worker.d.ts +1 -0
- package/dist/report-encoding-worker.js +2 -0
- package/dist/rich-text-layout-ALlMoYOG.cjs +3 -0
- package/dist/rich-text-layout-Ct5WrY1g.js +102 -0
- package/dist/runtime-BjKBI530.js +168 -0
- package/dist/runtime-CBFEPKEs.cjs +1 -0
- package/dist/sbom.cdx.json +2 -2
- package/dist/server/node.d.cts +86 -1
- package/dist/server/node.d.ts +86 -1
- package/dist/server-node.cjs +5 -1
- package/dist/server-node.js +4558 -473
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +8 -1
- package/dist/server.d.ts +8 -1
- package/dist/server.js +634 -792
- package/dist/sha256-BshdOkCC.cjs +1 -0
- package/dist/sha256-DTG-Gq8i.js +157 -0
- package/dist/style-67OqfNed.js +73 -0
- package/dist/style-C22Pbv3T.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/{template-catalog-j2B1MJlL.js → template-catalog-BtR2JmCL.js} +9 -9
- package/dist/{template-catalog-FJE_c9Qe.cjs → template-catalog-C2NLdrwB.cjs} +1 -1
- package/dist/{template-fragments-DcKeiylI.cjs → template-fragments-BVsbxs4a.cjs} +1 -1
- package/dist/{template-fragments-BGbQLGlV.js → template-fragments-By0aZC1D.js} +2 -2
- package/dist/template-registry-C62vpv4a.cjs +1 -0
- package/dist/{template-registry-BtaKPELV.js → template-registry-Cw3vRTX2.js} +389 -321
- package/dist/{textwrap-DE1kgcJB.js → textwrap-BEIg2w8y.js} +1 -1
- package/dist/textwrap-BI-yJ6Wt.cjs +4 -0
- package/dist/vue/async.d.cts +66 -0
- package/dist/vue/async.d.ts +66 -0
- package/dist/vue/index.d.cts +89 -1
- package/dist/vue/index.d.ts +89 -1
- 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-BvToI-Fd.js → workbook-session-BeSO8PFB.js} +153 -140
- package/dist/{workbook-session-Bjv1YCRK.cjs → workbook-session-Cbts-22R.cjs} +12 -12
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +84 -1
- package/dist/worker.d.ts +84 -1
- package/dist/worker.js +12 -157
- package/dist/xlsx-node.cjs +33 -33
- package/dist/xlsx-node.js +1282 -1289
- package/dist/xlsx.cjs +4 -3
- package/dist/xlsx.d.cts +2 -0
- package/dist/xlsx.d.ts +2 -0
- package/dist/xlsx.js +297 -279
- package/package.json +6 -3
- package/dist/ReportPreview-ChV19HBp.js +0 -4619
- package/dist/ReportPreview-DbLvvOUT.cjs +0 -6
- package/dist/assets-B9ImAi6_.cjs +0 -1
- package/dist/batch-BaP6pWDE.cjs +0 -1
- package/dist/batch-CGyt-b2W.js +0 -273
- package/dist/capabilities-CAh2Nrue.cjs +0 -1
- package/dist/capabilities-DskCHs3V.js +0 -69
- package/dist/config-D10us76d.cjs +0 -1
- package/dist/data-explanation-B8MZRYVS.js +0 -16
- package/dist/data-explanation-DE55G30w.cjs +0 -1
- package/dist/defaults-DXhiM1ZD.js +0 -10
- package/dist/defaults-xhmcLLrf.cjs +0 -1
- package/dist/designer-2bDlcNXQ.js +0 -5136
- package/dist/designer-BT7XCdbW.cjs +0 -2
- package/dist/drill-DYTxuL3A.cjs +0 -1
- package/dist/grid-strokes-Cr7DwUux.cjs +0 -1
- package/dist/grid-strokes-DyyG1q_o.js +0 -53
- package/dist/json-snapshot-DFb2eWkf.js +0 -1416
- package/dist/json-snapshot-WWSGlaHG.cjs +0 -2
- package/dist/prepared-CFy9B75C.cjs +0 -1
- package/dist/prepared-ajM-H-9B.js +0 -69
- package/dist/record-bindings-By_UKZ2g.cjs +0 -1
- package/dist/render-plan-7xpGrCEl.cjs +0 -1
- package/dist/render-plan-Ck6koX9L.js +0 -13
- package/dist/sha256-ArEYjaTI.cjs +0 -1
- package/dist/sha256-DPEuJ3nh.js +0 -155
- package/dist/style-CQ1PK8ZB.js +0 -67
- package/dist/style-UgIJSA1F.cjs +0 -1
- package/dist/template-registry-Co1zPq5e.cjs +0 -1
- package/dist/textwrap-CWHyzkBH.cjs +0 -4
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as Kt, g as
|
|
3
|
-
import { R as
|
|
4
|
-
import { o as Ze, s as
|
|
5
|
-
import { c as
|
|
6
|
-
import { f as
|
|
1
|
+
import { b as ve, w as Ke, o as He, f as er } from "./progress-Hc2vxoCs.js";
|
|
2
|
+
import { c as Kt, g as gr } from "./_commonjsHelpers-DaMA6jEr.js";
|
|
3
|
+
import { R as yr } from "./component-tree-Ca6YYfHq.js";
|
|
4
|
+
import { o as Ze, s as cr, r as vr, t as Ge, u as wr, w as _r, x as xr, y as Sr, q as kr } from "./region-binding-workflow-CWNvIjkV.js";
|
|
5
|
+
import { c as Cr } from "./media-Y90dHK9z.js";
|
|
6
|
+
import { f as Er } from "./number-format-BA_KwrZe.js";
|
|
7
7
|
function $e(G) {
|
|
8
8
|
throw new Error('Could not dynamically require "' + G + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
9
9
|
}
|
|
10
10
|
var qe = { exports: {} };
|
|
11
11
|
var rr;
|
|
12
|
-
function
|
|
12
|
+
function Mr() {
|
|
13
13
|
return rr || (rr = 1, (function(G, tt) {
|
|
14
14
|
(function(s) {
|
|
15
15
|
G.exports = s();
|
|
@@ -17817,8 +17817,8 @@ function Er() {
|
|
|
17817
17817
|
case a:
|
|
17818
17818
|
var Se = S;
|
|
17819
17819
|
case t:
|
|
17820
|
-
var
|
|
17821
|
-
if (Se || (Se = M), se.size != Jt.size && !
|
|
17820
|
+
var Ie = 2 & ye;
|
|
17821
|
+
if (Se || (Se = M), se.size != Jt.size && !Ie) return !1;
|
|
17822
17822
|
var Fe = _e.get(se);
|
|
17823
17823
|
if (Fe) return Fe == Jt;
|
|
17824
17824
|
ye |= 1, _e.set(se, Jt);
|
|
@@ -17837,9 +17837,9 @@ function Er() {
|
|
|
17837
17837
|
}
|
|
17838
17838
|
}
|
|
17839
17839
|
return we ? (Ft || (Ft = new Tt()), (function(se, Jt, xe, Ee, Pe, ye) {
|
|
17840
|
-
var _e = 2 & Pe, Se = pe(se),
|
|
17841
|
-
if (
|
|
17842
|
-
for (var Oe =
|
|
17840
|
+
var _e = 2 & Pe, Se = pe(se), Ie = Se.length, Fe = pe(Jt).length;
|
|
17841
|
+
if (Ie != Fe && !_e) return !1;
|
|
17842
|
+
for (var Oe = Ie; Oe--; ) {
|
|
17843
17843
|
var ke = Se[Oe];
|
|
17844
17844
|
if (!(_e ? ke in Jt : $.call(Jt, ke))) return !1;
|
|
17845
17845
|
}
|
|
@@ -17847,7 +17847,7 @@ function Er() {
|
|
|
17847
17847
|
if (Qe && ye.get(Jt)) return Qe == Jt;
|
|
17848
17848
|
var Be = !0;
|
|
17849
17849
|
ye.set(se, Jt), ye.set(Jt, se);
|
|
17850
|
-
for (var We = _e; ++Oe <
|
|
17850
|
+
for (var We = _e; ++Oe < Ie; ) {
|
|
17851
17851
|
ke = Se[Oe];
|
|
17852
17852
|
var De = se[ke], Le = Jt[ke];
|
|
17853
17853
|
if (Ee) var tr = _e ? Ee(Le, De, ke, Jt, se, ye) : Ee(De, Le, ke, se, Jt, ye);
|
|
@@ -22572,16 +22572,16 @@ use chrome, FireFox or Internet Explorer 11`);
|
|
|
22572
22572
|
}));
|
|
22573
22573
|
})(qe)), qe.exports;
|
|
22574
22574
|
}
|
|
22575
|
-
var
|
|
22576
|
-
const
|
|
22577
|
-
function
|
|
22578
|
-
return (G < 1 ? G * 12 : G * 7 + 5) *
|
|
22575
|
+
var Tr = Mr();
|
|
22576
|
+
const Ar = /* @__PURE__ */ gr(Tr), hr = 25.4 / 96;
|
|
22577
|
+
function Rr(G) {
|
|
22578
|
+
return (G < 1 ? G * 12 : G * 7 + 5) * hr;
|
|
22579
22579
|
}
|
|
22580
|
-
function
|
|
22581
|
-
const tt = G /
|
|
22580
|
+
function Sn(G) {
|
|
22581
|
+
const tt = G / hr;
|
|
22582
22582
|
return tt < 12 ? tt / 12 : (tt - 5) / 7;
|
|
22583
22583
|
}
|
|
22584
|
-
function
|
|
22584
|
+
function Or(G, tt) {
|
|
22585
22585
|
const s = [0], C = [0];
|
|
22586
22586
|
for (const _ of G.columns) s.push(s[s.length - 1] + _);
|
|
22587
22587
|
for (let _ = tt.top; _ <= tt.bottom; _++) C.push(C[C.length - 1] + G.rowHeight(_));
|
|
@@ -22592,7 +22592,7 @@ function nr(G, tt, s) {
|
|
|
22592
22592
|
const C = s.columnOffsets[G.nativeCol - tt.left + 1] + G.nativeColOff / 36e3 * s.scale, _ = s.rowOffsets[G.nativeRow - tt.top + 1] + G.nativeRowOff / 36e3 * s.scale;
|
|
22593
22593
|
return { x: C, y: _ };
|
|
22594
22594
|
}
|
|
22595
|
-
function
|
|
22595
|
+
function jr(G, tt) {
|
|
22596
22596
|
const s = G.getImage(Number(tt));
|
|
22597
22597
|
if (!s || !["png", "jpeg", "jpg"].includes(s.extension)) return;
|
|
22598
22598
|
const C = s.extension === "png" ? "png" : "jpeg";
|
|
@@ -22602,20 +22602,20 @@ function Or(G, tt) {
|
|
|
22602
22602
|
for (let o = 0; o < _.length; o += 8192) d.push(String.fromCharCode(..._.subarray(o, o + 8192)));
|
|
22603
22603
|
return `data:image/${C};base64,${btoa(d.join(""))}`;
|
|
22604
22604
|
}
|
|
22605
|
-
function
|
|
22605
|
+
function Ir(G, tt, s, C) {
|
|
22606
22606
|
const _ = G.range.tl, d = nr(_, tt, s);
|
|
22607
22607
|
if (!d || _.nativeCol >= tt.right || _.nativeRow >= tt.bottom) return;
|
|
22608
22608
|
const o = G.range.br ? nr(G.range.br, tt, s) : void 0, a = G.range.ext, r = a ? a.width * 25.4 / 96 * s.scale : (o?.x ?? d.x) - d.x, t = a ? a.height * 25.4 / 96 * s.scale : (o?.y ?? d.y) - d.y, e = s.columnOffsets[s.columnOffsets.length - 1];
|
|
22609
22609
|
if (!(!Number.isFinite(r) || !Number.isFinite(t) || r <= 0 || t <= 0 || d.x + r > e + 0.01))
|
|
22610
22610
|
return { row: _.nativeRow + 1, rowOffset: _.nativeRowOff / 36e3 * s.scale, left: d.x, width: r, height: t, data: C, id: G.imageId };
|
|
22611
22611
|
}
|
|
22612
|
-
function
|
|
22612
|
+
function Nr(G, tt, s, C, _, d) {
|
|
22613
22613
|
const o = tt.getImages();
|
|
22614
22614
|
if (!o.length) return () => [];
|
|
22615
|
-
const a =
|
|
22615
|
+
const a = Or(C, s), r = /* @__PURE__ */ new Map(), t = [];
|
|
22616
22616
|
for (const [e, l] of o.entries()) {
|
|
22617
|
-
r.has(l.imageId) || r.set(l.imageId,
|
|
22618
|
-
const n = r.get(l.imageId), i = n ?
|
|
22617
|
+
r.has(l.imageId) || r.set(l.imageId, jr(G, l.imageId));
|
|
22618
|
+
const n = r.get(l.imageId), i = n ? Ir(l, s, a, d(n).dataUrl) : void 0;
|
|
22619
22619
|
i ? t.push({ ...i, id: `${i.id}:${e}` }) : _.add(`${tt.name}: 图片 ${l.imageId} 不在完整选区内或不是 PNG/JPEG,未导入;可扩大 range`);
|
|
22620
22620
|
}
|
|
22621
22621
|
return (e) => {
|
|
@@ -22641,7 +22641,7 @@ function Ir(G, tt, s, C, _, d) {
|
|
|
22641
22641
|
return l;
|
|
22642
22642
|
};
|
|
22643
22643
|
}
|
|
22644
|
-
function
|
|
22644
|
+
function kn(G, tt) {
|
|
22645
22645
|
const s = G.meta?.xlsxOverlay;
|
|
22646
22646
|
if (s === void 0) return;
|
|
22647
22647
|
if (!s || typeof s != "object") throw new Error("Excel 图片定位元数据无效");
|
|
@@ -22663,7 +22663,7 @@ function ir(G, tt) {
|
|
|
22663
22663
|
if (s.bottom > tt.limits.maxRows || s.right > tt.limits.maxColumns)
|
|
22664
22664
|
throw new Error(`Excel 源文件坐标 ${G} 超过加载行列上限;请先裁剪工作簿或显式提高 limits`);
|
|
22665
22665
|
}
|
|
22666
|
-
function
|
|
22666
|
+
function Pr(G, tt, s) {
|
|
22667
22667
|
const C = /^<(?:\w+:)?(\w+)\b/.exec(G)?.[1];
|
|
22668
22668
|
if (C === "c") {
|
|
22669
22669
|
const _ = Me(G, "r");
|
|
@@ -22683,17 +22683,17 @@ function Nr(G, tt, s) {
|
|
|
22683
22683
|
_ && Ze(_);
|
|
22684
22684
|
}
|
|
22685
22685
|
}
|
|
22686
|
-
function
|
|
22686
|
+
function Fr(G, tt) {
|
|
22687
22687
|
/^<(?:\w+:)?srcRect\b/.test(G) && ["l", "t", "r", "b"].some((s) => Number(Me(G, s) ?? 0) !== 0) && tt.add("Excel 图片裁剪暂不还原,导入保留完整图片;请在源文件中将裁剪结果保存为 PNG/JPEG"), /^<(?:\w+:)?xfrm\b/.test(G) && (Number(Me(G, "rot") ?? 0) !== 0 || ["flipH", "flipV"].some((s) => ["1", "true"].includes(Me(G, s) ?? ""))) && tt.add("Excel 图片旋转或翻转暂不还原,请先在源文件中保存变换后的 PNG/JPEG"), /^<(?:\w+:)?blip\b/.test(G) && /\blink\s*=/.test(G) && tt.add("Excel 外部图片链接不会访问或下载,请嵌入 PNG/JPEG 图片"), /^<(?:\w+:)?(?:sp|cxnSp)\b/.test(G) && tt.add("Excel 绘图形状与连接线暂不导入;可在源文件中转换为 PNG/JPEG");
|
|
22688
22688
|
}
|
|
22689
|
-
function
|
|
22689
|
+
function Br(G, tt, s, C, _, d) {
|
|
22690
22690
|
let o = "";
|
|
22691
22691
|
return (a, r = !1) => {
|
|
22692
22692
|
if (o += a, /<!DOCTYPE|<!ENTITY/i.test(o)) throw new Error("Excel XML 不允许外部实体或 DTD");
|
|
22693
22693
|
const t = /<[^>]*>/g;
|
|
22694
22694
|
let e, l = 0;
|
|
22695
22695
|
for (; e = t.exec(o); ) {
|
|
22696
|
-
if (s &&
|
|
22696
|
+
if (s && Pr(e[0], G, tt), d && Fr(e[0], d), C && /^<(?:\w+:)?xf\b/.test(e[0]) && ++tt.styles > 131072) throw new Error("Excel 样式数量超过安全加载上限");
|
|
22697
22697
|
if (_ && /^<(?:\w+:)?si\b/.test(e[0]) && ++tt.strings > 1e6) throw new Error("Excel 共享字符串数量超过安全加载上限");
|
|
22698
22698
|
l = t.lastIndex;
|
|
22699
22699
|
}
|
|
@@ -22702,7 +22702,7 @@ function Fr(G, tt, s, C, _, d) {
|
|
|
22702
22702
|
if (r && o) throw new Error("Excel XML 标签不完整");
|
|
22703
22703
|
};
|
|
22704
22704
|
}
|
|
22705
|
-
function
|
|
22705
|
+
function Dr(G, tt) {
|
|
22706
22706
|
const s = G.slice(tt.start, tt.start + tt.compressed), C = new Blob([s.buffer]).stream();
|
|
22707
22707
|
if (tt.method === 0) return C;
|
|
22708
22708
|
try {
|
|
@@ -22711,18 +22711,18 @@ function Br(G, tt) {
|
|
|
22711
22711
|
throw new Error("当前环境不支持安全 Excel 解压;请使用支持 DecompressionStream deflate-raw 的现代浏览器或 Node.js 22+");
|
|
22712
22712
|
}
|
|
22713
22713
|
}
|
|
22714
|
-
async function
|
|
22714
|
+
async function Lr(G, tt, s, C = {}, _) {
|
|
22715
22715
|
let d = 0;
|
|
22716
22716
|
const o = { cells: 0, rows: 0, mergedCells: 0, styles: 0, strings: 0 };
|
|
22717
22717
|
if (tt.filter((r) => /^xl\/worksheets\/[^/]+\.xml$/i.test(r.name)).length > s.limits.maxSheets) throw new Error("Excel 工作表数量超过导入上限");
|
|
22718
22718
|
for (const [r, t] of tt.entries()) {
|
|
22719
22719
|
ve(C.signal);
|
|
22720
|
-
const e =
|
|
22720
|
+
const e = Dr(G, t).getReader(), l = () => {
|
|
22721
22721
|
e.cancel(C.signal?.reason).catch(() => {
|
|
22722
22722
|
});
|
|
22723
22723
|
};
|
|
22724
22724
|
C.signal?.addEventListener("abort", l, { once: !0 }), C.signal?.aborted && l();
|
|
22725
|
-
const n = /^xl\/worksheets\/[^/]+\.xml$/i.test(t.name), i = /\.xml$/i.test(t.name) ?
|
|
22725
|
+
const n = /^xl\/worksheets\/[^/]+\.xml$/i.test(t.name), i = /\.xml$/i.test(t.name) ? Br(s, o, n, t.name === "xl/styles.xml", t.name === "xl/sharedStrings.xml", /^xl\/drawings\/[^/]+\.xml$/i.test(t.name) ? _ : void 0) : void 0, f = i ? new TextDecoder("utf-8", { fatal: !0 }) : void 0;
|
|
22726
22726
|
let c = 0;
|
|
22727
22727
|
try {
|
|
22728
22728
|
for (; ; ) {
|
|
@@ -22739,8 +22739,8 @@ async function Dr(G, tt, s, C = {}, _) {
|
|
|
22739
22739
|
await He({ signal: C.signal }, r + 1, tt.length);
|
|
22740
22740
|
}
|
|
22741
22741
|
}
|
|
22742
|
-
const
|
|
22743
|
-
async function
|
|
22742
|
+
const zr = 101010256, Ur = 33639248, $r = 67324752;
|
|
22743
|
+
async function Hr(G, tt, s) {
|
|
22744
22744
|
if (ve(s), G instanceof Uint8Array) {
|
|
22745
22745
|
if (G.byteLength > tt) throw new Error("Excel 文件超过导入大小上限");
|
|
22746
22746
|
return new Uint8Array(G);
|
|
@@ -22755,78 +22755,78 @@ async function $r(G, tt, s) {
|
|
|
22755
22755
|
}
|
|
22756
22756
|
throw new Error("Excel 导入需要 ArrayBuffer、Uint8Array 或 Blob");
|
|
22757
22757
|
}
|
|
22758
|
-
function
|
|
22758
|
+
function Vr(G) {
|
|
22759
22759
|
const tt = Math.max(0, G.byteLength - 65557);
|
|
22760
22760
|
for (let s = G.byteLength - 22; s >= tt; s--)
|
|
22761
|
-
if (G.getUint32(s, !0) ===
|
|
22761
|
+
if (G.getUint32(s, !0) === zr && s + 22 + G.getUint16(s + 20, !0) === G.byteLength) return s;
|
|
22762
22762
|
throw new Error("Excel 文件不是完整的 .xlsx ZIP 文件");
|
|
22763
22763
|
}
|
|
22764
|
-
function
|
|
22764
|
+
function Wr(G, tt) {
|
|
22765
22765
|
const s = G.getUint16(tt + 10, !0), C = G.getUint32(tt + 16, !0), _ = G.getUint32(tt + 12, !0);
|
|
22766
22766
|
if (G.getUint16(tt + 4, !0) + G.getUint16(tt + 6, !0) || G.getUint16(tt + 8, !0) !== s || s === 65535 || C === 4294967295 || _ === 4294967295)
|
|
22767
22767
|
throw new Error("不支持分卷或 ZIP64 Excel 文件");
|
|
22768
22768
|
if (s < 1 || s > 2048 || C + _ !== tt) throw new Error("Excel ZIP 目录无效或条目过多");
|
|
22769
22769
|
return { start: C, size: _, entries: s };
|
|
22770
22770
|
}
|
|
22771
|
-
function
|
|
22772
|
-
if (s + 46 > C || tt.getUint32(s, !0) !==
|
|
22771
|
+
function qr(G, tt, s, C, _) {
|
|
22772
|
+
if (s + 46 > C || tt.getUint32(s, !0) !== Ur) throw new Error("Excel ZIP 条目无效");
|
|
22773
22773
|
const d = tt.getUint16(s + 8, !0), o = tt.getUint16(s + 10, !0), a = tt.getUint16(s + 28, !0), r = s + 46 + a + tt.getUint16(s + 30, !0) + tt.getUint16(s + 32, !0), t = tt.getUint32(s + 42, !0), e = tt.getUint32(s + 20, !0), l = tt.getUint32(s + 24, !0);
|
|
22774
22774
|
if (r > C || t + 30 > G.length || d & 1 || ![0, 8].includes(o)) throw new Error("Excel ZIP 包含无效、加密或不支持的条目");
|
|
22775
|
-
if (l === 4294967295 || e === 4294967295 || tt.getUint32(t, !0) !==
|
|
22775
|
+
if (l === 4294967295 || e === 4294967295 || tt.getUint32(t, !0) !== $r) throw new Error("Excel ZIP 本地条目无效");
|
|
22776
22776
|
const n = t + 30 + tt.getUint16(t + 26, !0) + tt.getUint16(t + 28, !0);
|
|
22777
22777
|
if (n + e > _ || tt.getUint16(t + 8, !0) !== o || tt.getUint16(t + 6, !0) !== d) throw new Error("Excel ZIP 数据边界或压缩方式无效");
|
|
22778
22778
|
const i = new TextDecoder().decode(G.subarray(s + 46, s + 46 + a));
|
|
22779
22779
|
if (i.includes("\\") || i.split("/").includes("..") || i.startsWith("/")) throw new Error("Excel ZIP 包含不安全路径");
|
|
22780
22780
|
return { name: i, next: r, size: l, start: n, compressed: e, method: o };
|
|
22781
22781
|
}
|
|
22782
|
-
function
|
|
22782
|
+
function Xr(G, tt) {
|
|
22783
22783
|
/^xl\/charts\//.test(G) && tt.add("Excel 图表对象不作为图片导入;请在源文件中插入 PNG/JPEG 图片以保留静态图表外观"), /^xl\/pivot/.test(G) && tt.add("Excel 透视表仅导入已保存的单元格结果,不提供交互或重算"), /^xl\/externalLinks\//.test(G) && tt.add("Excel 外部链接不会访问或刷新,仅使用文件内已保存的结果"), /vbaProject|activeX|embeddings/i.test(G) && tt.add("Excel 宏、控件与嵌入对象不会执行或导入");
|
|
22784
22784
|
}
|
|
22785
|
-
async function
|
|
22786
|
-
const _ = await
|
|
22785
|
+
async function Zr(G, tt, s, C = {}) {
|
|
22786
|
+
const _ = await Hr(G, tt.limits.maxFileBytes, C.signal);
|
|
22787
22787
|
ve(C.signal);
|
|
22788
22788
|
const d = new DataView(_.buffer, _.byteOffset, _.byteLength);
|
|
22789
22789
|
if (_.length < 22) throw new Error("Excel 文件为空或格式无效;仅支持 .xlsx");
|
|
22790
|
-
const o =
|
|
22790
|
+
const o = Wr(d, Vr(d));
|
|
22791
22791
|
let a = o.start, r = 0;
|
|
22792
22792
|
const t = /* @__PURE__ */ new Set(), e = [];
|
|
22793
22793
|
for (let l = 0; l < o.entries; l++) {
|
|
22794
22794
|
ve(C.signal);
|
|
22795
|
-
const n =
|
|
22795
|
+
const n = qr(_, d, a, o.start + o.size, o.start);
|
|
22796
22796
|
if (t.has(n.name)) throw new Error("Excel ZIP 条目名称重复");
|
|
22797
22797
|
if (t.add(n.name), r += n.size, r > tt.limits.maxUncompressedBytes) throw new Error("Excel 解压后内容超过导入大小上限");
|
|
22798
|
-
|
|
22798
|
+
Xr(n.name, s), e.push(n), a = n.next;
|
|
22799
22799
|
}
|
|
22800
22800
|
if (a !== o.start + o.size || !t.has("xl/workbook.xml") || !t.has("[Content_Types].xml"))
|
|
22801
22801
|
throw new Error("文件不是受支持的 .xlsx 工作簿");
|
|
22802
|
-
return await
|
|
22802
|
+
return await Lr(_, e, tt, C, s), _;
|
|
22803
22803
|
}
|
|
22804
|
-
const
|
|
22805
|
-
function
|
|
22804
|
+
const Yr = 864e5;
|
|
22805
|
+
function Ne(G, tt = 2) {
|
|
22806
22806
|
return String(G).padStart(tt, "0");
|
|
22807
22807
|
}
|
|
22808
|
-
function
|
|
22808
|
+
function Kr(G, tt, s) {
|
|
22809
22809
|
const C = [], _ = tt.replace(/"([^"]*)"|\\(.)/g, (a, r, t) => (C.push(r ?? t ?? ""), `${C.length - 1}`)).replace(/\[\$[^\]]*\]/g, "");
|
|
22810
22810
|
if (/\[|ddd|mmm|AM\/PM/i.test(_))
|
|
22811
22811
|
return s(), G.toISOString().replace("T", " ").replace(/\.000Z$/, "");
|
|
22812
22812
|
let d = !1;
|
|
22813
22813
|
return _.replace(/yyyy|yy|mm|m|dd|d|hh|h|ss|s/gi, (a, r) => {
|
|
22814
22814
|
const t = a.toLowerCase();
|
|
22815
|
-
if (t.startsWith("y")) return t.length === 2 ?
|
|
22816
|
-
if (t.startsWith("d")) return
|
|
22815
|
+
if (t.startsWith("y")) return t.length === 2 ? Ne(G.getUTCFullYear() % 100) : String(G.getUTCFullYear());
|
|
22816
|
+
if (t.startsWith("d")) return Ne(G.getUTCDate(), t.length);
|
|
22817
22817
|
if (t.startsWith("h"))
|
|
22818
|
-
return d = !0,
|
|
22819
|
-
if (t.startsWith("s")) return
|
|
22818
|
+
return d = !0, Ne(G.getUTCHours(), t.length);
|
|
22819
|
+
if (t.startsWith("s")) return Ne(G.getUTCSeconds(), t.length);
|
|
22820
22820
|
const e = d || /^\s*:\s*s/i.test(_.slice(r + a.length));
|
|
22821
|
-
return
|
|
22821
|
+
return Ne(e ? G.getUTCMinutes() : G.getUTCMonth() + 1, t.length);
|
|
22822
22822
|
}).replace(/\uE000(\d+)\uE000/g, (a, r) => C[Number(r)] ?? "");
|
|
22823
22823
|
}
|
|
22824
|
-
function
|
|
22824
|
+
function Gr(G, tt, s) {
|
|
22825
22825
|
if (G == null) return { text: "", value: null };
|
|
22826
22826
|
if (G instanceof Date)
|
|
22827
|
-
return Number.isFinite(G.getTime()) ? { text:
|
|
22827
|
+
return Number.isFinite(G.getTime()) ? { text: Kr(G, tt || "yyyy-mm-dd", s), value: G.getTime() / Yr + 25569 } : (s(), { text: "", value: null });
|
|
22828
22828
|
if (typeof G == "number")
|
|
22829
|
-
return Number.isFinite(G) ? { text:
|
|
22829
|
+
return Number.isFinite(G) ? { text: Er(G, tt, s), value: G } : (s(), { text: String(G), value: null });
|
|
22830
22830
|
if (typeof G == "boolean") return { text: G ? "TRUE" : "FALSE", value: G };
|
|
22831
22831
|
if (typeof G == "string") return { text: G, value: G };
|
|
22832
22832
|
if ("error" in G) return { text: G.error, value: G.error };
|
|
@@ -22836,11 +22836,11 @@ function Kr(G, tt, s) {
|
|
|
22836
22836
|
}
|
|
22837
22837
|
return "text" in G ? { text: String(G.text), value: String(G.text) } : (s(), { text: "", value: null });
|
|
22838
22838
|
}
|
|
22839
|
-
function
|
|
22839
|
+
function Jr(G, tt) {
|
|
22840
22840
|
const s = (tt ?? "").replace(/"[^"]*"|\\.|\[[^\]]*\]/g, "");
|
|
22841
22841
|
return typeof G == "number" || G === null && /[0#?]/.test(s) ? "number" : typeof G == "boolean" ? "boolean" : "text";
|
|
22842
22842
|
}
|
|
22843
|
-
function
|
|
22843
|
+
function Qr(G, tt, s, C, _) {
|
|
22844
22844
|
let d;
|
|
22845
22845
|
try {
|
|
22846
22846
|
d = tt.formula;
|
|
@@ -22849,9 +22849,9 @@ function Jr(G, tt, s, C, _) {
|
|
|
22849
22849
|
}
|
|
22850
22850
|
Object.assign(G, { editable: !1, ...d ? { formula: d } : {} }), _.add(`${C}: 公式使用 Excel 已保存的计算结果并保持只读;修改其他单元格不会自动重算公式`), s == null && _.add(`${C}: 存在没有缓存结果的公式,显示为空;请先在 Excel 中计算并保存`);
|
|
22851
22851
|
}
|
|
22852
|
-
function
|
|
22853
|
-
const _ = G.numFmt, d = () => C.add(`${s}: 存在无法完整还原的自定义数字或日期格式,已保留原值和 numberFormat`), o = G.value, a = o && typeof o == "object" && ("formula" in o || "sharedFormula" in o), r = a ? G.result : o, t =
|
|
22854
|
-
return e.valueType =
|
|
22852
|
+
function tn(G, tt, s, C) {
|
|
22853
|
+
const _ = G.numFmt, d = () => C.add(`${s}: 存在无法完整还原的自定义数字或日期格式,已保留原值和 numberFormat`), o = G.value, a = o && typeof o == "object" && ("formula" in o || "sharedFormula" in o), r = a ? G.result : o, t = Gr(r, _, d), e = { ...t, editable: !0, ..._ ? { numberFormat: _ } : {} };
|
|
22854
|
+
return e.valueType = Jr(t.value, _), r instanceof Date && (Object.assign(e, { editable: !1 }), C.add(`${s}: 日期单元格保留 Excel 日期序列与格式,目前在预览中保持只读`), tt && C.add(`${s}: 1904 日期系统已统一转换为 1900 日期系统,保留相同日历日期`)), a && Qr(e, G, r, s, C), typeof e.text == "string" && /\{\{[^}]+\}\}/.test(e.text) && C.add(`${s}: {{字段}} 占位符按原文导入;动态业务数据需显式绑定,不会自动推断接口字段`), e;
|
|
22855
22855
|
}
|
|
22856
22856
|
const sr = ["FFFFFF", "000000", "E7E6E6", "44546A", "4472C4", "ED7D31", "A5A5A5", "FFC000", "5B9BD5", "70AD47", "0563C1", "954F72"], or = [
|
|
22857
22857
|
"000000",
|
|
@@ -22918,8 +22918,8 @@ const sr = ["FFFFFF", "000000", "E7E6E6", "44546A", "4472C4", "ED7D31", "A5A5A5"
|
|
|
22918
22918
|
"993366",
|
|
22919
22919
|
"333399",
|
|
22920
22920
|
"333333"
|
|
22921
|
-
],
|
|
22922
|
-
function
|
|
22921
|
+
], en = { hair: 0.25, dotted: 0.5, dashed: 0.5, thin: 0.5, medium: 1, thick: 1.5, double: 1 };
|
|
22922
|
+
function ar(G) {
|
|
22923
22923
|
const tt = G.model, s = /<(?:\w+:)?clrScheme\b[^>]*>([\s\S]*?)<\/(?:\w+:)?clrScheme>/.exec(tt.themes?.theme1 ?? "");
|
|
22924
22924
|
if (!s) return sr;
|
|
22925
22925
|
const C = [...s[1].matchAll(/<(?:\w+:)?(?:srgbClr|sysClr)\b[^>]*(?:val|lastClr)="([A-Fa-f0-9]{6})"[^>]*\/?\s*>/g)].map((_) => _[1].toUpperCase());
|
|
@@ -22931,7 +22931,7 @@ function Xe(G, tt = 0) {
|
|
|
22931
22931
|
return Math.max(0, Math.min(255, Math.round(_))).toString(16).padStart(2, "0");
|
|
22932
22932
|
}).join("").toUpperCase()}`;
|
|
22933
22933
|
}
|
|
22934
|
-
function
|
|
22934
|
+
function je(G, tt, s = () => {
|
|
22935
22935
|
}) {
|
|
22936
22936
|
if (!G) return;
|
|
22937
22937
|
const C = G.argb;
|
|
@@ -22946,7 +22946,7 @@ function rn(G, tt, s, C) {
|
|
|
22946
22946
|
const _ = [tt.top, tt.right, tt.bottom, tt.left], d = _.map((a) => !!a?.style);
|
|
22947
22947
|
[G.borderTop, G.borderRight, G.borderBottom, G.borderLeft] = d;
|
|
22948
22948
|
const o = _.filter((a) => a?.style);
|
|
22949
|
-
o.length && (G.borderColor =
|
|
22949
|
+
o.length && (G.borderColor = je(o[0]?.color, s, C) ?? "#000000", G.lineWidthPt = en[o[0].style] ?? 0.5, o.some((a) => a.style !== "thin" && a.style !== "medium" && a.style !== "thick") && C(), o.some((a) => je(a.color, s) !== je(o[0].color, s) || a.style !== o[0].style) && C(), tt.diagonal?.style && C());
|
|
22950
22950
|
}
|
|
22951
22951
|
function nn(G, tt, s) {
|
|
22952
22952
|
const C = tt.horizontal;
|
|
@@ -22955,11 +22955,11 @@ function nn(G, tt, s) {
|
|
|
22955
22955
|
function sn(G, tt, s, C) {
|
|
22956
22956
|
const _ = G.style, d = _.font ?? {}, o = { align: "left", verticalAlign: "bottom", fontFamily: d.name || "Calibri", fontSize: d.size || 11 };
|
|
22957
22957
|
d.bold !== void 0 && (o.bold = d.bold), d.italic !== void 0 && (o.italic = d.italic), d.underline !== void 0 && (o.underline = !!d.underline);
|
|
22958
|
-
const a = () => C.add(`${s}!${G.address}: 系统色按黑/白还原,未知颜色使用默认样式;请在 Excel 中指定明确 RGB 颜色`), r =
|
|
22958
|
+
const a = () => C.add(`${s}!${G.address}: 系统色按黑/白还原,未知颜色使用默认样式;请在 Excel 中指定明确 RGB 颜色`), r = je(d.color, tt, a);
|
|
22959
22959
|
r && (o.color = r);
|
|
22960
22960
|
const t = _.fill;
|
|
22961
22961
|
if (t?.type === "pattern" && t.pattern === "solid") {
|
|
22962
|
-
const e =
|
|
22962
|
+
const e = je(t.fgColor, tt, a);
|
|
22963
22963
|
e && (o.backgroundColor = e);
|
|
22964
22964
|
} else t && !(t.type === "pattern" && t.pattern === "none") && C.add(`${s}: 渐变或图案填充暂不支持,保留单元格内容`);
|
|
22965
22965
|
return rn(o, _.border ?? {}, tt, () => C.add(`${s}: 多种边线颜色、虚线、双线或对角线按单元格统一实线近似呈现`)), _.alignment && nn(o, _.alignment, () => C.add(`${s}: 部分旋转、缩进、收缩或分散对齐样式暂不支持`)), (d.strike || d.vertAlign) && C.add(`${s}: 删除线、上标或下标暂不支持`), o;
|
|
@@ -22980,6 +22980,16 @@ function on(G, tt, s, C = 1) {
|
|
|
22980
22980
|
return typeof r == "boolean" ? o.center : typeof r == "number" || r instanceof Date || t ? o.right : o.left;
|
|
22981
22981
|
};
|
|
22982
22982
|
}
|
|
22983
|
+
function an(G, tt, s, C, _) {
|
|
22984
|
+
return G.map((d) => {
|
|
22985
|
+
const o = d.font ?? {}, a = {};
|
|
22986
|
+
o.name && (a.fontFamily = o.name), o.size && (a.fontSize = o.size * _);
|
|
22987
|
+
for (const t of ["bold", "italic"]) o[t] !== void 0 && (a[t] = o[t]);
|
|
22988
|
+
o.underline !== void 0 && (a.underline = !!o.underline);
|
|
22989
|
+
const r = je(o.color, tt, () => s.add(`${C}: 富文本系统色/未知色按默认颜色还原`));
|
|
22990
|
+
return r && (a.color = r), (o.strike || o.vertAlign || typeof o.underline == "string" && o.underline !== "single") && s.add(`${C}: 富文本删除线、上下标或特殊下划线暂不支持`), { text: d.text, style: a };
|
|
22991
|
+
});
|
|
22992
|
+
}
|
|
22983
22993
|
const Ye = {
|
|
22984
22994
|
maxFileBytes: 20 * 1024 * 1024,
|
|
22985
22995
|
maxUncompressedBytes: 64 * 1024 * 1024,
|
|
@@ -22987,13 +22997,13 @@ const Ye = {
|
|
|
22987
22997
|
maxRows: 1e5,
|
|
22988
22998
|
maxColumns: 2048,
|
|
22989
22999
|
maxSheets: 32
|
|
22990
|
-
},
|
|
23000
|
+
}, lr = {
|
|
22991
23001
|
...Ye,
|
|
22992
23002
|
maxCells: 1e6,
|
|
22993
23003
|
maxRows: 1048576,
|
|
22994
23004
|
maxColumns: 16384
|
|
22995
23005
|
};
|
|
22996
|
-
function
|
|
23006
|
+
function dr(G) {
|
|
22997
23007
|
const tt = G.layout ?? "wide";
|
|
22998
23008
|
if (!["wide", "a3", "a4"].includes(tt)) throw new Error("Excel 导入 layout 仅支持 wide、a3、a4");
|
|
22999
23009
|
if (G.landscape !== void 0 && typeof G.landscape != "boolean") throw new Error("landscape 应为布尔值");
|
|
@@ -23004,8 +23014,8 @@ function hr(G) {
|
|
|
23004
23014
|
for (const _ of Object.keys(Ye)) {
|
|
23005
23015
|
const d = G.limits?.[_];
|
|
23006
23016
|
if (d !== void 0) {
|
|
23007
|
-
if (!Number.isInteger(d) || d < 1 || d >
|
|
23008
|
-
throw new Error(`${_} 应为 1 到 ${
|
|
23017
|
+
if (!Number.isInteger(d) || d < 1 || d > lr[_])
|
|
23018
|
+
throw new Error(`${_} 应为 1 到 ${lr[_]} 的整数`);
|
|
23009
23019
|
C[_] = d;
|
|
23010
23020
|
}
|
|
23011
23021
|
}
|
|
@@ -23022,8 +23032,8 @@ class Ve {
|
|
|
23022
23032
|
return [...this.messages, ...this.overflow ? ["其余导入告警已合并;请缩小范围进一步检查"] : []];
|
|
23023
23033
|
}
|
|
23024
23034
|
}
|
|
23025
|
-
const
|
|
23026
|
-
function
|
|
23035
|
+
const ln = 25.4 / 72;
|
|
23036
|
+
function un(G, tt) {
|
|
23027
23037
|
if (tt.sheets === void 0) return G.worksheets.filter((C) => C.state === "visible");
|
|
23028
23038
|
if (!Array.isArray(tt.sheets) || tt.sheets.length === 0) throw new Error("sheets 应为非空的工作表名称或一基位置数组");
|
|
23029
23039
|
const s = [];
|
|
@@ -23035,50 +23045,52 @@ function ln(G, tt) {
|
|
|
23035
23045
|
}
|
|
23036
23046
|
return s;
|
|
23037
23047
|
}
|
|
23038
|
-
function
|
|
23048
|
+
function pr(G, tt) {
|
|
23039
23049
|
if (typeof G.range == "string") return G.range;
|
|
23040
23050
|
if (G.range !== void 0) {
|
|
23041
23051
|
if (G.range === null || typeof G.range != "object" || Array.isArray(G.range)) throw new Error("range 应为 A1 范围或以工作表名为键的范围对象");
|
|
23042
23052
|
return Object.prototype.hasOwnProperty.call(G.range, tt) ? G.range[tt] : void 0;
|
|
23043
23053
|
}
|
|
23044
23054
|
}
|
|
23045
|
-
function
|
|
23055
|
+
function ur(G, tt, s) {
|
|
23046
23056
|
if (!Number.isFinite(G) || G < 0 || G > s) throw new Error(`${tt} 无效或超过尺寸上限`);
|
|
23047
23057
|
return Math.max(0.01, G);
|
|
23048
23058
|
}
|
|
23049
|
-
function
|
|
23059
|
+
function fn(G, tt, s, C) {
|
|
23050
23060
|
const _ = [];
|
|
23051
23061
|
for (let f = tt.left; f <= tt.right; f++) {
|
|
23052
23062
|
const c = G.getColumn(f);
|
|
23053
23063
|
c.hidden && C.add(`${G.name}: 隐藏行列按隐藏尺寸保留;需要编辑时请先在 Excel 中取消隐藏`);
|
|
23054
23064
|
const u = c.width ?? G.properties.defaultColWidth ?? 8.43;
|
|
23055
|
-
_.push(
|
|
23065
|
+
_.push(ur(c.hidden || u === 0 ? 0.01 : Rr(u), "Excel 列宽", 2e3));
|
|
23056
23066
|
}
|
|
23057
23067
|
const d = _.reduce((f, c) => f + c, 0), o = s.layout === "wide", a = s.layout === "a3" ? [297, 420] : [210, 297], r = o ? d : a[s.landscape ? 1 : 0], t = o ? 297 : a[s.landscape ? 0 : 1], e = o ? 0 : 10, l = r - 2 * e, n = o ? 1 : l / d;
|
|
23058
23068
|
!o && n < 0.5 && C.add(`${G.name}: 标准纸张列宽压缩较大;完整宽表建议使用 layout: 'wide'`);
|
|
23059
23069
|
const i = (f) => {
|
|
23060
23070
|
const c = G.getRow(f);
|
|
23061
|
-
return c.hidden && C.add(`${G.name}: 隐藏行列按隐藏尺寸保留;需要编辑时请先在 Excel 中取消隐藏`),
|
|
23071
|
+
return c.hidden && C.add(`${G.name}: 隐藏行列按隐藏尺寸保留;需要编辑时请先在 Excel 中取消隐藏`), ur(c.hidden ? 0.01 : (c.height ?? G.properties.defaultRowHeight ?? 15) * ln * n, "Excel 行高", 1e3);
|
|
23062
23072
|
};
|
|
23063
23073
|
return { width: l, pageWidth: r, pageHeight: t, margin: e, scale: n, columns: _.map((f) => f * n), rowHeight: i };
|
|
23064
23074
|
}
|
|
23065
|
-
function
|
|
23066
|
-
const { sheet: s, range: C, merges: _, style: d, date1904: o, warnings: a } = G,
|
|
23067
|
-
for (let
|
|
23068
|
-
const
|
|
23069
|
-
for (let
|
|
23070
|
-
const
|
|
23071
|
-
if (_.covered.has(
|
|
23072
|
-
const
|
|
23073
|
-
s.sheetProtection?.sheet === !0 &&
|
|
23074
|
-
const
|
|
23075
|
-
|
|
23075
|
+
function cn(G, tt) {
|
|
23076
|
+
const { sheet: s, range: C, merges: _, style: d, date1904: o, warnings: a, geometry: r } = G, t = [];
|
|
23077
|
+
for (let e = tt.top; e <= tt.bottom; e++) {
|
|
23078
|
+
const l = [];
|
|
23079
|
+
for (let n = C.left; n <= C.right; n++) {
|
|
23080
|
+
const i = `${e}:${n}`;
|
|
23081
|
+
if (_.covered.has(i)) continue;
|
|
23082
|
+
const f = s.getCell(e, n), c = tn(f, o, s.name, a);
|
|
23083
|
+
s.sheetProtection?.sheet === !0 && f.protection?.locked !== !1 && (c.editable = !1), c.style = d(f);
|
|
23084
|
+
const p = f.value;
|
|
23085
|
+
p && typeof p == "object" && "richText" in p && (c.richParagraphs = [{ segments: an(p.richText, G.theme, a, `${s.name}!${f.address}`, r.scale) }], c.editable = !1);
|
|
23086
|
+
const h = _.masters.get(i);
|
|
23087
|
+
h && (c.colSpan = h.right - h.left + 1, c.rowSpan = h.bottom - h.top + 1), l.push(c);
|
|
23076
23088
|
}
|
|
23077
|
-
|
|
23089
|
+
t.push(l);
|
|
23078
23090
|
}
|
|
23079
|
-
return
|
|
23091
|
+
return t;
|
|
23080
23092
|
}
|
|
23081
|
-
function
|
|
23093
|
+
function fr(G, tt, s, C) {
|
|
23082
23094
|
const { geometry: _, range: d, sheet: o, options: a } = G, r = Array.from({ length: tt.bottom - tt.top + 1 }, (t, e) => _.rowHeight(tt.top + e));
|
|
23083
23095
|
return {
|
|
23084
23096
|
kind: "rect",
|
|
@@ -23087,27 +23099,27 @@ function ur(G, tt, s, C) {
|
|
|
23087
23099
|
widthMm: _.width,
|
|
23088
23100
|
heightMm: r.reduce((t, e) => t + e, 0),
|
|
23089
23101
|
nid: `xlsx:${G.tableId}:${tt.top}`,
|
|
23090
|
-
grid: { cells:
|
|
23102
|
+
grid: { cells: cn(G, tt), colWidthsMm: _.columns, rowHeightsMm: r, paddingMm: 0.25 * _.scale },
|
|
23091
23103
|
table: {
|
|
23092
23104
|
id: G.tableId,
|
|
23093
23105
|
role: C ? "header" : "body",
|
|
23094
23106
|
rowIndex: C ? -1 : tt.top - G.headerBottom - 1,
|
|
23095
|
-
columnKeys: Array.from({ length: d.right - d.left + 1 }, (t, e) =>
|
|
23107
|
+
columnKeys: Array.from({ length: d.right - d.left + 1 }, (t, e) => kr(d.left + e)),
|
|
23096
23108
|
title: o.name,
|
|
23097
23109
|
layout: a.layout === "wide" ? "wide" : "page"
|
|
23098
23110
|
},
|
|
23099
23111
|
meta: { xlsxSheet: o.name, xlsxRange: Ge({ ...d, top: tt.top, bottom: tt.bottom }) }
|
|
23100
23112
|
};
|
|
23101
23113
|
}
|
|
23102
|
-
function
|
|
23114
|
+
function hn(G, tt) {
|
|
23103
23115
|
const { geometry: s, options: C, range: _, headerBottom: d } = G, o = [];
|
|
23104
23116
|
let a = s.margin;
|
|
23105
23117
|
if (tt.top === _.top) {
|
|
23106
|
-
const t =
|
|
23118
|
+
const t = fr(G, { top: tt.top, bottom: d }, a, !0);
|
|
23107
23119
|
o.push(t), a += t.heightMm;
|
|
23108
23120
|
}
|
|
23109
23121
|
const r = Math.max(tt.top, d + 1);
|
|
23110
|
-
return r <= tt.bottom && o.push(
|
|
23122
|
+
return r <= tt.bottom && o.push(fr(G, { top: r, bottom: tt.bottom }, a, !1)), {
|
|
23111
23123
|
widthMm: s.pageWidth,
|
|
23112
23124
|
heightMm: s.pageHeight,
|
|
23113
23125
|
layout: C.layout === "wide" ? "wide" : "page",
|
|
@@ -23118,39 +23130,40 @@ function cn(G, tt) {
|
|
|
23118
23130
|
components: o
|
|
23119
23131
|
};
|
|
23120
23132
|
}
|
|
23121
|
-
function
|
|
23133
|
+
function dn(G, tt) {
|
|
23122
23134
|
const s = G;
|
|
23123
23135
|
G.state !== "visible" && tt.add(`${G.name}: 已按显式选择导入隐藏工作表`), G.sheetProtection?.sheet === !0 && tt.add(`${G.name}: 已保留启用的工作表保护,锁定单元格在预览中保持只读`), s.conditionalFormattings?.length && tt.add(`${G.name}: 条件格式规则暂不执行,仅使用已保存的基础单元格样式`), G.autoFilter && tt.add(`${G.name}: Excel 筛选下拉与排序操作不导入,完整保留选区单元格`), Object.keys(s.dataValidations?.model ?? {}).length && tt.add(`${G.name}: Excel 数据验证与下拉输入规则不导入;业务校验应由宿主配置`);
|
|
23124
23136
|
}
|
|
23125
|
-
async function
|
|
23126
|
-
|
|
23127
|
-
const r =
|
|
23137
|
+
async function pn(G, tt, s, C, _, d, o, a) {
|
|
23138
|
+
dn(G, _);
|
|
23139
|
+
const r = wr(G, tt), t = _r(tt, r), e = fn(G, tt, C, _), l = tt.right - tt.left + 1, n = Math.max(1, Math.min(C.maxRowsPerPage, Math.floor(1e4 / l)));
|
|
23128
23140
|
if (t.some((p) => (p.bottom - p.top + 1) * l > Math.max(1e4, l)))
|
|
23129
23141
|
throw new Error(`${G.name}: 跨行合并区域超过单段单元格预算,请缩小范围或拆分合并区域`);
|
|
23130
|
-
const i =
|
|
23142
|
+
const i = xr(t, n, C.layout === "wide" ? 1 / 0 : e.pageHeight - e.margin * 2, e.rowHeight), f = {
|
|
23131
23143
|
sheet: G,
|
|
23132
23144
|
range: tt,
|
|
23133
23145
|
geometry: e,
|
|
23134
23146
|
options: C,
|
|
23135
23147
|
warnings: _,
|
|
23136
|
-
|
|
23137
|
-
|
|
23148
|
+
theme: ar(s),
|
|
23149
|
+
merges: Sr(r),
|
|
23150
|
+
style: on(ar(s), G.name, _, e.scale),
|
|
23138
23151
|
date1904: s.properties.date1904 === !0,
|
|
23139
23152
|
tableId: `xlsx:${d}:${G.name}`,
|
|
23140
23153
|
headerBottom: t[0].bottom
|
|
23141
|
-
}, c = [], u =
|
|
23154
|
+
}, c = [], u = Nr(s, G, tt, e, _, a);
|
|
23142
23155
|
for (const p of i) {
|
|
23143
23156
|
ve(o.signal);
|
|
23144
|
-
const h =
|
|
23157
|
+
const h = hn(f, p);
|
|
23145
23158
|
h.components.push(...u(p)), c.push(h), c.length % 8 === 0 && await He({ signal: o.signal }, c.length, i.length);
|
|
23146
23159
|
}
|
|
23147
23160
|
return c;
|
|
23148
23161
|
}
|
|
23149
23162
|
async function Je(G, tt, s) {
|
|
23150
23163
|
ve(tt.signal);
|
|
23151
|
-
const C =
|
|
23164
|
+
const C = dr(tt), _ = await Zr(G, C, s, tt);
|
|
23152
23165
|
ve(tt.signal);
|
|
23153
|
-
const d = new
|
|
23166
|
+
const d = new Ar.Workbook();
|
|
23154
23167
|
try {
|
|
23155
23168
|
await Ke(d.xlsx.load(_), tt.signal);
|
|
23156
23169
|
} catch {
|
|
@@ -23159,37 +23172,37 @@ async function Je(G, tt, s) {
|
|
|
23159
23172
|
if (ve(tt.signal), d.worksheets.length > C.limits.maxSheets) throw new Error("Excel 工作表数量超过导入上限");
|
|
23160
23173
|
return { workbook: d, resolved: C };
|
|
23161
23174
|
}
|
|
23162
|
-
function
|
|
23175
|
+
function mr(G, tt, s) {
|
|
23163
23176
|
const C = G.worksheets.map((_, d) => {
|
|
23164
|
-
const o =
|
|
23177
|
+
const o = cr(_, pr(tt, _.name));
|
|
23165
23178
|
return { name: _.name, index: d + 1, range: Ge(o), rowCount: o.bottom - o.top + 1, columnCount: o.right - o.left + 1, visible: _.state === "visible" };
|
|
23166
23179
|
});
|
|
23167
23180
|
return ve(tt.signal), { sheets: C, warnings: s.result() };
|
|
23168
23181
|
}
|
|
23169
|
-
async function
|
|
23182
|
+
async function Cn(G, tt = {}) {
|
|
23170
23183
|
const s = new Ve(), { workbook: C } = await Je(G, tt, s);
|
|
23171
|
-
return
|
|
23184
|
+
return mr(C, tt, s);
|
|
23172
23185
|
}
|
|
23173
|
-
async function
|
|
23186
|
+
async function En(G, tt = {}) {
|
|
23174
23187
|
const s = new Ve(), { workbook: C, resolved: _ } = await Je(G, tt, s);
|
|
23175
|
-
return
|
|
23188
|
+
return br(C, tt, _, s);
|
|
23176
23189
|
}
|
|
23177
|
-
async function
|
|
23178
|
-
const _ =
|
|
23190
|
+
async function br(G, tt, s, C) {
|
|
23191
|
+
const _ = Cr();
|
|
23179
23192
|
ve(tt.signal);
|
|
23180
|
-
const d =
|
|
23193
|
+
const d = un(G, tt);
|
|
23181
23194
|
if (!d.length) throw new Error("Excel 中没有可导入的可见工作表;可通过 sheets 显式选择隐藏工作表");
|
|
23182
|
-
const o = { schemaVersion:
|
|
23195
|
+
const o = { schemaVersion: yr, pages: [] }, a = [];
|
|
23183
23196
|
let r = s.limits.maxCells;
|
|
23184
23197
|
for (const t of d) {
|
|
23185
|
-
const e =
|
|
23186
|
-
r -=
|
|
23187
|
-
const l = G.worksheets.indexOf(t) + 1, n = await
|
|
23198
|
+
const e = cr(t, pr(tt, t.name));
|
|
23199
|
+
r -= vr(e, s, r);
|
|
23200
|
+
const l = G.worksheets.indexOf(t) + 1, n = await pn(t, e, G, s, C, l, tt, _);
|
|
23188
23201
|
a.push({ name: t.name, index: l, range: Ge(e), rowCount: e.bottom - e.top + 1, columnCount: e.right - e.left + 1, pageStart: o.pages.length, pageCount: n.length }), o.pages.push(...n), await He(tt, a.length, d.length);
|
|
23189
23202
|
}
|
|
23190
23203
|
return { template: o, warnings: C.result(), sheets: a };
|
|
23191
23204
|
}
|
|
23192
|
-
async function
|
|
23205
|
+
async function mn(G, tt = {}) {
|
|
23193
23206
|
const s = new Ve(), C = await Je(G, tt, s);
|
|
23194
23207
|
let _ = C.workbook, d = !1;
|
|
23195
23208
|
const o = new AbortController(), a = {
|
|
@@ -23207,14 +23220,14 @@ async function pn(G, tt = {}) {
|
|
|
23207
23220
|
get disposed() {
|
|
23208
23221
|
return _ === void 0;
|
|
23209
23222
|
},
|
|
23210
|
-
inspect: () =>
|
|
23223
|
+
inspect: () => mr(r(), a, s),
|
|
23211
23224
|
importTemplate: async (t = {}) => {
|
|
23212
23225
|
if (d) throw new Error("Excel 会话正在转换,请等待当前操作或取消后重试");
|
|
23213
23226
|
if (Object.prototype.hasOwnProperty.call(t, "limits")) throw new Error("Excel 会话预算应在 openExcelWorkbook 时配置");
|
|
23214
23227
|
const e = r(), l = new AbortController(), n = er(o.signal, l), i = er(t.signal, l);
|
|
23215
23228
|
d = !0;
|
|
23216
23229
|
try {
|
|
23217
|
-
const f = { ...a, ...t, signal: l.signal }, c = await
|
|
23230
|
+
const f = { ...a, ...t, signal: l.signal }, c = await br(e, f, dr(f), bn(s));
|
|
23218
23231
|
return ve(l.signal), r(), c;
|
|
23219
23232
|
} finally {
|
|
23220
23233
|
n(), i(), d = !1;
|
|
@@ -23225,21 +23238,21 @@ async function pn(G, tt = {}) {
|
|
|
23225
23238
|
}
|
|
23226
23239
|
};
|
|
23227
23240
|
}
|
|
23228
|
-
function
|
|
23241
|
+
function bn(G) {
|
|
23229
23242
|
const tt = new Ve();
|
|
23230
23243
|
return G.result().forEach((s) => tt.add(s)), tt;
|
|
23231
23244
|
}
|
|
23232
|
-
const
|
|
23245
|
+
const Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
23233
23246
|
__proto__: null,
|
|
23234
|
-
openExcelWorkbook:
|
|
23247
|
+
openExcelWorkbook: mn
|
|
23235
23248
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
23236
23249
|
export {
|
|
23237
|
-
|
|
23238
|
-
|
|
23239
|
-
|
|
23240
|
-
|
|
23241
|
-
|
|
23242
|
-
|
|
23243
|
-
|
|
23244
|
-
|
|
23250
|
+
Ar as E,
|
|
23251
|
+
En as a,
|
|
23252
|
+
Cn as b,
|
|
23253
|
+
Rr as e,
|
|
23254
|
+
kn as i,
|
|
23255
|
+
Sn as m,
|
|
23256
|
+
mn as o,
|
|
23257
|
+
Mn as w
|
|
23245
23258
|
};
|