@agile-team/mach-report 2.14.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 +26 -16
- package/THIRD_PARTY_NOTICES.md +3 -1
- package/dist/{ExcelBindingWizard-CLT2p7P3.cjs → ExcelBindingWizard-CP6h2x1f.cjs} +1 -1
- package/dist/{ExcelBindingWizard-CvsWR8Ga.js → ExcelBindingWizard-HhB3hAJE.js} +3 -3
- package/dist/ParamEditor-CUQLgoxa.cjs +1 -0
- package/dist/ParamEditor-OKesP_nO.js +594 -0
- package/dist/{ReportBatchPanel-DkxTzBkD.cjs → ReportBatchPanel-cZCAMAwH.cjs} +1 -1
- package/dist/{ReportBatchPanel-LqVgiqp7.js → ReportBatchPanel-ruxcbfY6.js} +39 -39
- package/dist/ReportPreview-BcDKCLiK.js +4834 -0
- package/dist/ReportPreview-Bk9nLfO9.cjs +6 -0
- package/dist/{ReportTemplateLibrary-cQ1sqNYo.cjs → ReportTemplateLibrary-BDlNT8JN.cjs} +1 -1
- package/dist/{ReportTemplateLibrary-MjWEtc7X.js → ReportTemplateLibrary-DcwrH-63.js} +1 -1
- package/dist/{RuleEditor-BaR6xUiI.cjs → RuleEditor-BX5S8RSF.cjs} +1 -1
- package/dist/{RuleEditor-ChuXMlei.js → RuleEditor-CGl9XY2s.js} +5 -5
- package/dist/{TemplateOutlinePanel-BHKP89Xz.cjs → TemplateOutlinePanel-CGrT5DFN.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-Dci6aRn1.js → TemplateOutlinePanel-SXCjaPKR.js} +2 -2
- package/dist/{TemplateReusePanel-CY5eO2Sh.cjs → TemplateReusePanel-6Z3wRFz8.cjs} +1 -1
- package/dist/{TemplateReusePanel-B7Gmyc1z.js → TemplateReusePanel-lHLOS9Wn.js} +2 -2
- package/dist/{TemplateReviewPanel-DjlX3xpt.js → TemplateReviewPanel-CJ9PLc48.js} +2 -2
- package/dist/{TemplateReviewPanel-JvZe9_4G.cjs → TemplateReviewPanel-Dpk7sLcF.cjs} +1 -1
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.d.cts +5 -1
- package/dist/analytics.d.ts +5 -1
- package/dist/analytics.js +154 -60
- package/dist/artifact-integrity.json +143 -0
- package/dist/assets-CqIbfbTr.js +126 -0
- package/dist/assets-e4YSke8n.cjs +1 -0
- package/dist/auto-YR7a4BtF.js +240 -0
- package/dist/auto-uVBjX1j5.cjs +1 -0
- package/dist/batch-WzDIXJAt.js +220 -0
- package/dist/batch-z6Aw5GEY.cjs +1 -0
- package/dist/capabilities-DDwXr_cA.js +103 -0
- package/dist/capabilities-DNLyZdNw.cjs +1 -0
- package/dist/codes.d.cts +4 -0
- package/dist/codes.d.ts +4 -0
- package/dist/component-tree-Ca6YYfHq.js +61 -0
- package/dist/component-tree-DkGLEfZC.cjs +1 -0
- package/dist/{computed-Bvk0W15F.js → computed-C-4C2S5h.js} +3 -3
- package/dist/config-Dg_o8e7m.cjs +1 -0
- package/dist/config-XQ4qrQ7Q.js +844 -0
- 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 +197 -16
- package/dist/designer.d.ts +197 -16
- 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-DIGsZfyB.js +145 -0
- package/dist/encoding-BOGq4qYL.js +21 -0
- package/dist/encoding-BYF9ZTl9.cjs +1 -0
- package/dist/{font-loader-DHto6Lra.js → font-loader-CzI1GuBc.js} +1 -1
- package/dist/{font-loader-vhCT8znW.cjs → font-loader-EKLzOJxf.cjs} +1 -1
- package/dist/index.cjs +8 -9
- package/dist/index.d.cts +84 -4
- package/dist/index.d.ts +84 -4
- package/dist/index.js +829 -833
- package/dist/json-snapshot-D6ioHth9.js +1702 -0
- package/dist/json-snapshot-DknkjvxP.cjs +2 -0
- package/dist/licenses/_bwip-js_generic-4.11.4.txt +24 -0
- package/dist/licenses/_fast-csv_format-4.3.5.txt +22 -0
- package/dist/licenses/_fast-csv_parse-4.3.6.txt +22 -0
- package/dist/licenses/_pdf-lib_fontkit-1.1.1.txt +326 -0
- package/dist/licenses/_pdf-lib_standard-fonts-1.0.0.txt +22 -0
- package/dist/licenses/_pdf-lib_upng-1.0.1.txt +22 -0
- package/dist/licenses/_types_node-14.18.63.txt +22 -0
- package/dist/licenses/_types_pako-2.0.3.txt +22 -0
- package/dist/licenses/_types_pegjs-0.10.6.txt +22 -0
- package/dist/licenses/archiver-5.3.2.txt +23 -0
- package/dist/licenses/archiver-utils-2.1.0.txt +23 -0
- package/dist/licenses/archiver-utils-3.0.4.txt +23 -0
- package/dist/licenses/async-3.2.6.txt +20 -0
- package/dist/licenses/balanced-match-1.0.2.txt +22 -0
- package/dist/licenses/base64-js-1.5.1.txt +22 -0
- package/dist/licenses/big-integer-1.6.52.txt +25 -0
- package/dist/licenses/binary-0.3.0.txt +178 -0
- package/dist/licenses/bl-4.1.0.txt +14 -0
- package/dist/licenses/bluebird-3.4.7.txt +22 -0
- package/dist/licenses/brace-expansion-1.1.21.txt +22 -0
- package/dist/licenses/brace-expansion-2.1.7.txt +22 -0
- package/dist/licenses/buffer-5.7.1.txt +22 -0
- package/dist/licenses/buffer-crc32-0.2.13.txt +20 -0
- package/dist/licenses/buffer-indexof-polyfill-1.0.2.txt +23 -0
- package/dist/licenses/buffers-0.1.1.txt +140 -0
- package/dist/licenses/chainsaw-0.1.0.txt +184 -0
- package/dist/licenses/compress-commons-4.1.2.txt +23 -0
- package/dist/licenses/concat-map-0.0.1.txt +19 -0
- package/dist/licenses/core-util-is-1.0.3.txt +20 -0
- package/dist/licenses/crc-32-1.2.2.txt +202 -0
- package/dist/licenses/crc32-stream-4.0.3.txt +23 -0
- package/dist/licenses/dayjs-1.11.23.txt +22 -0
- package/dist/licenses/duplexer2-0.1.4.txt +27 -0
- package/dist/licenses/end-of-stream-1.4.5.txt +22 -0
- package/dist/licenses/exceljs-4.4.0.txt +23 -0
- package/dist/licenses/fast-csv-4.3.6.txt +22 -0
- package/dist/licenses/fast-png-6.4.0.txt +22 -0
- package/dist/licenses/fs-constants-1.0.0.txt +22 -0
- package/dist/licenses/fs.realpath-1.0.0.txt +44 -0
- package/dist/licenses/fstream-1.0.12.txt +16 -0
- package/dist/licenses/glob-7.2.3.txt +22 -0
- package/dist/licenses/graceful-fs-4.2.11.txt +16 -0
- package/dist/licenses/ieee754-1.2.1.txt +12 -0
- package/dist/licenses/immediate-3.0.6.txt +21 -0
- package/dist/licenses/inflight-1.0.6.txt +16 -0
- package/dist/licenses/inherits-2.0.4.txt +17 -0
- package/dist/licenses/iobuffer-5.4.0.txt +23 -0
- package/dist/licenses/isarray-1.0.0.txt +61 -0
- package/dist/licenses/jszip-3.10.2.txt +652 -0
- package/dist/licenses/lazystream-1.0.1.txt +24 -0
- package/dist/licenses/lie-3.3.0.txt +8 -0
- package/dist/licenses/listenercount-1.0.1.txt +6 -0
- package/dist/licenses/lodash.defaults-4.2.0.txt +48 -0
- package/dist/licenses/lodash.difference-4.5.0.txt +48 -0
- package/dist/licenses/lodash.escaperegexp-4.1.2.txt +48 -0
- package/dist/licenses/lodash.flatten-4.4.0.txt +48 -0
- package/dist/licenses/lodash.groupby-4.6.0.txt +48 -0
- package/dist/licenses/lodash.isboolean-3.0.3.txt +23 -0
- package/dist/licenses/lodash.isequal-4.5.0.txt +48 -0
- package/dist/licenses/lodash.isfunction-3.0.9.txt +48 -0
- package/dist/licenses/lodash.isnil-4.0.0.txt +23 -0
- package/dist/licenses/lodash.isplainobject-4.0.6.txt +48 -0
- package/dist/licenses/lodash.isundefined-3.0.1.txt +23 -0
- package/dist/licenses/lodash.union-4.6.0.txt +48 -0
- package/dist/licenses/lodash.uniq-4.5.0.txt +48 -0
- package/dist/licenses/minimatch-3.1.5.txt +16 -0
- package/dist/licenses/minimatch-5.1.9.txt +16 -0
- package/dist/licenses/minimist-1.2.8.txt +19 -0
- package/dist/licenses/mkdirp-0.5.6.txt +22 -0
- package/dist/licenses/node-sql-parser-5.4.0.txt +202 -0
- package/dist/licenses/normalize-path-3.0.0.txt +22 -0
- package/dist/licenses/once-1.4.0.txt +16 -0
- package/dist/licenses/pako-1.0.11.txt +22 -0
- package/dist/licenses/pako-2.2.0.txt +22 -0
- package/dist/licenses/path-is-absolute-1.0.1.txt +22 -0
- package/dist/licenses/pdf-lib-1.17.1.txt +22 -0
- package/dist/licenses/process-nextick-args-2.0.1.txt +20 -0
- package/dist/licenses/readable-stream-2.3.8.txt +48 -0
- package/dist/licenses/readable-stream-3.6.2.txt +48 -0
- package/dist/licenses/readdir-glob-1.1.3.txt +202 -0
- package/dist/licenses/rimraf-2.7.1.txt +16 -0
- package/dist/licenses/safe-buffer-5.1.2.txt +22 -0
- package/dist/licenses/safe-buffer-5.2.1.txt +22 -0
- package/dist/licenses/saxes-5.0.1.txt +397 -0
- package/dist/licenses/setimmediate-1.0.5.txt +21 -0
- package/dist/licenses/string_decoder-1.1.1.txt +49 -0
- package/dist/licenses/string_decoder-1.3.0.txt +49 -0
- package/dist/licenses/tar-stream-2.2.0.txt +22 -0
- package/dist/licenses/tmp-0.2.7.txt +22 -0
- package/dist/licenses/traverse-0.3.9.txt +25 -0
- package/dist/licenses/tslib-1.14.1.txt +13 -0
- package/dist/licenses/unzipper-0.10.14.txt +26 -0
- package/dist/licenses/util-deprecate-1.0.2.txt +25 -0
- package/dist/licenses/uuid-11.1.1.txt +10 -0
- package/dist/licenses/wrappy-1.0.2.txt +16 -0
- package/dist/licenses/xmlchars-2.2.0.txt +19 -0
- package/dist/licenses/zip-stream-4.1.1.txt +23 -0
- package/dist/matrix-CGRGkn5s.js +112 -0
- package/dist/matrix-gEO7ZM_u.cjs +1 -0
- package/dist/media-B7vnpD8k.cjs +1 -0
- package/dist/media-Y90dHK9z.js +70 -0
- package/dist/param-validation-C3HlcLLO.cjs +1 -0
- package/dist/param-validation-Do7Eg8Zv.js +181 -0
- package/dist/{pdf-AyJGb22z.cjs → pdf-ByVCb1i6.cjs} +49 -49
- package/dist/{pdf-8UPQebOE.js → pdf-DJ5S6ukC.js} +4924 -4872
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.d.cts +20 -3
- package/dist/pdf.d.ts +20 -3
- package/dist/pdf.js +2 -2
- package/dist/{plugin-BGKf-Tqg.js → plugin-C2j5_mhx.js} +2 -2
- package/dist/{plugin-CktLH_Iy.cjs → plugin-Dr39GBRG.cjs} +1 -1
- package/dist/prepared-DdrjLC7L.cjs +1 -0
- package/dist/prepared-DqtpvRTn.js +87 -0
- package/dist/progress-B0ctFpKf.cjs +1 -0
- package/dist/progress-BXzlVbIp.js +29 -0
- package/dist/progress-DJBd9Rb9.cjs +1 -0
- package/dist/progress-Hc2vxoCs.js +52 -0
- package/dist/protocol-BzwMP4Vw.cjs +1 -0
- package/dist/protocol-kt4Iy6-3.js +90 -0
- package/dist/record-bindings-CZWBJ1fU.js +195 -0
- package/dist/record-bindings-DUX1VMlR.cjs +1 -0
- package/dist/{region-binding-workflow-DEJbhpCv.js → region-binding-workflow-CWNvIjkV.js} +1 -1
- package/dist/{region-binding-workflow-BzfbxRiR.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/{report-params-B44imUd4.js → report-params-B1RzkhJj.js} +1 -1
- package/dist/{report-params-SJfhKgaX.cjs → report-params-WDGrA4oP.cjs} +1 -1
- 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 +3982 -0
- package/dist/server/node.d.cts +106 -2
- package/dist/server/node.d.ts +106 -2
- package/dist/server-node.cjs +5 -1
- package/dist/server-node.js +4634 -539
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +780 -5
- package/dist/server.d.ts +780 -5
- package/dist/server.js +773 -691
- 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-bindings-C2SpvsMU.js +58 -0
- package/dist/template-bindings-CEtWyiLX.cjs +1 -0
- package/dist/template-catalog-BtR2JmCL.js +414 -0
- package/dist/template-catalog-C2NLdrwB.cjs +1 -0
- package/dist/{template-fragments-DFUpq5QM.cjs → template-fragments-BVsbxs4a.cjs} +1 -1
- package/dist/{template-fragments-CLkGo6To.js → template-fragments-By0aZC1D.js} +21 -21
- package/dist/{template-outline-B3xVkzSv.cjs → template-outline-BwRV_eRo.cjs} +1 -1
- package/dist/{template-outline-CFenM1PV.js → template-outline-cnWfT_LK.js} +3 -3
- package/dist/template-registry-C62vpv4a.cjs +1 -0
- package/dist/template-registry-Cw3vRTX2.js +801 -0
- package/dist/textwrap-BEIg2w8y.js +110 -0
- package/dist/textwrap-BI-yJ6Wt.cjs +4 -0
- package/dist/{tree-CqcQ99NM.js → tree-CjVZLRw7.js} +1 -1
- package/dist/vue/async.d.cts +189 -14
- package/dist/vue/async.d.ts +189 -14
- package/dist/vue/index.d.cts +246 -22
- package/dist/vue/index.d.ts +246 -22
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +80 -78
- package/dist/{workbook-session-BfK1yHOO.js → workbook-session-BeSO8PFB.js} +5460 -5295
- package/dist/{workbook-session-DNa2RHNG.cjs → workbook-session-Cbts-22R.cjs} +19 -19
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +104 -2
- package/dist/worker.d.ts +104 -2
- package/dist/worker.js +12 -156
- package/dist/xlsx-node.cjs +35 -35
- package/dist/xlsx-node.js +2138 -2137
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.d.cts +24 -10
- package/dist/xlsx.d.ts +24 -10
- package/dist/xlsx.js +303 -277
- package/package.json +7 -4
- package/dist/ParamEditor-CflQV3eQ.js +0 -526
- package/dist/ParamEditor-vIDzvpPV.cjs +0 -1
- package/dist/ReportPreview-CvbqLUzM.cjs +0 -6
- package/dist/ReportPreview-D_ywJ_-H.js +0 -4533
- package/dist/assets-C2U-e-Sz.cjs +0 -4
- package/dist/assets-Q0wUwNrV.js +0 -217
- package/dist/batch-DzaTNLWI.js +0 -371
- package/dist/batch-xMkqYiTr.cjs +0 -1
- package/dist/capabilities-CK_7hizc.js +0 -63
- package/dist/capabilities-CsZ-pNHR.cjs +0 -1
- package/dist/config-0UIohTS7.cjs +0 -1
- package/dist/config-Dt9NtCPl.js +0 -566
- package/dist/data-explanation-BktvER5B.cjs +0 -1
- package/dist/data-explanation-C_J6jYNi.js +0 -16
- package/dist/defaults-DXhiM1ZD.js +0 -10
- package/dist/defaults-xhmcLLrf.cjs +0 -1
- package/dist/designer-Ci1LizA9.js +0 -5020
- package/dist/designer-rtmVIIdN.cjs +0 -2
- package/dist/grid-strokes-Cr7DwUux.cjs +0 -1
- package/dist/grid-strokes-DyyG1q_o.js +0 -53
- package/dist/json-snapshot-BeFT3Tso.js +0 -1952
- package/dist/json-snapshot-D1NTP2oI.cjs +0 -2
- package/dist/matrix-DVyWiYsd.cjs +0 -1
- package/dist/matrix-yZsGnldA.js +0 -227
- package/dist/page-window-index-CIuT4BAv.js +0 -43
- package/dist/page-window-index-DEjnM6IB.cjs +0 -1
- package/dist/param-validation-BlHHXs6u.js +0 -153
- package/dist/param-validation-DCK039V1.cjs +0 -1
- package/dist/progress-7OSZbFok.js +0 -39
- package/dist/progress-BnLiS5eH.cjs +0 -1
- package/dist/render-plan-7xpGrCEl.cjs +0 -1
- package/dist/render-plan-Ck6koX9L.js +0 -13
- package/dist/style-CQ1PK8ZB.js +0 -67
- package/dist/style-UgIJSA1F.cjs +0 -1
- package/dist/task-events-DQ276fn2.cjs +0 -1
- package/dist/task-events-Dpsvf_t2.js +0 -47
- package/dist/template-bindings-BJR4k7qZ.cjs +0 -1
- package/dist/template-bindings-Daui7hLF.js +0 -252
- package/dist/template-registry-COXDEJEM.js +0 -570
- package/dist/template-registry-D3SjENi6.cjs +0 -1
- package/dist/validate-BJ5HIWY8.cjs +0 -1
- package/dist/validate-CkQBWCeg.js +0 -163
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as u } from "./template-bindings-C2SpvsMU.js";
|
|
2
2
|
function $(e) {
|
|
3
3
|
const s = /\.pages\[(\d+)\](?:\.components\[(\d+)\])?/.exec(e);
|
|
4
4
|
return s ? {
|
|
@@ -16,7 +16,7 @@ function k(e, s, n) {
|
|
|
16
16
|
}))
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function m(e, s) {
|
|
20
20
|
const n = e.kind === "list" ? e.title || e.dataset : e.binding?.field || e.text || e.nid;
|
|
21
21
|
return `${e.kind} · ${(n || String(s + 1)).replace(/\s+/g, " ").slice(0, 80)}`;
|
|
22
22
|
}
|
|
@@ -47,7 +47,7 @@ function b(e) {
|
|
|
47
47
|
...o,
|
|
48
48
|
depth: 1,
|
|
49
49
|
kind: "component",
|
|
50
|
-
title:
|
|
50
|
+
title: m(d, h)
|
|
51
51
|
}), d.kind === "list" && (d.columns.forEach(
|
|
52
52
|
(i, p) => a.push({
|
|
53
53
|
path: `${f}.columns[${p}].field`,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const oe=require("./matrix-gEO7ZM_u.cjs"),H=require("./computed-CGV2a809.cjs"),x=require("./component-tree-DkGLEfZC.cjs"),ae=require("./code-options-BUTChiZZ.cjs"),J=require("./param-validation-C3HlcLLO.cjs"),j=require("./tree-BX380Rr7.cjs");function fe(e,i,t){e!==void 0&&(typeof e!="string"||!e.trim()||e.length>4096)&&t.push({path:i,message:"来源范围应为不超过 4096 字符的非空字符串"})}function W(e,i,t){e.editable!==void 0&&typeof e.editable!="boolean"&&t.push({path:`${i}.editable`,message:"编辑控制应为布尔值"}),e.valueType!==void 0&&!["text","number","boolean"].includes(e.valueType)&&t.push({path:`${i}.valueType`,message:"编辑类型应为 text、number 或 boolean"})}function re(e,i,t){W(e,i,t),e.indentMm!==void 0&&(typeof e.indentMm!="number"||!Number.isFinite(e.indentMm)||e.indentMm<0)&&t.push({path:`${i}.indentMm`,message:"单元格缩进应为有限非负数"}),e.derived!==void 0&&typeof e.derived!="boolean"&&t.push({path:`${i}.derived`,message:"派生结果标记应为布尔值"}),G(e.source,`${i}.source`,t,!0),e.formula!==void 0&&typeof e.formula!="string"&&t.push({path:`${i}.formula`,message:"单元格公式应为字符串"})}function G(e,i,t,s=!1){if(e===void 0)return;if(!e||typeof e!="object"||Array.isArray(e)){t.push({path:i,message:"业务来源应为对象"});return}const n=e;fe(n.sourceScope,`${i}.sourceScope`,t);for(const o of["datasetId",...s?["field"]:[]])(typeof n[o]!="string"||!n[o].trim())&&t.push({path:`${i}.${o}`,message:"业务标识应为非空字符串"});for(const o of["rowKey","revision"]){const a=n[o];a===void 0&&!(s&&o==="rowKey")||typeof a!="string"&&!(typeof a=="number"&&Number.isFinite(a))&&t.push({path:`${i}.${o}`,message:"业务键及修订号应为字符串或有限数字"})}n.sourceToken!==void 0&&typeof n.sourceToken!="string"&&t.push({path:`${i}.sourceToken`,message:"来源令牌应为字符串"})}const de=new Set(["text","image","barcode","qrcode","chart","line","rect","ellipse"]);function g(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function k(e){return e===null?"null":typeof e=="string"?JSON.stringify(e.slice(0,120)):["number","boolean","undefined"].includes(typeof e)?String(e):`[${typeof e}]`}function ue(e,i,t,s){const n=e[i];(typeof n!="number"||!Number.isFinite(n))&&s.push({path:`${t}.${i}`,message:`应为有限数字,实际 ${k(n)}`})}function he(e,i,t){if(e!==void 0){const s=`${i}.table`;if(!g(e))t.push({path:s,message:"逻辑表来源应为对象"});else{G(e.source,`${s}.source`,t),(typeof e.id!="string"||!e.id.trim())&&t.push({path:`${s}.id`,message:"逻辑表 ID 应为非空字符串"});const n=e.role;["header","body","group-header","subtotal","grand-total"].includes(n)||t.push({path:`${s}.role`,message:"未知逻辑表行角色"});const o=e.rowIndex;(typeof o!="number"||!Number.isInteger(o)||(n==="header"?o!==-1:o<0))&&t.push({path:`${s}.rowIndex`,message:"表头索引应为 -1,内容行索引应为非负整数"}),(!Array.isArray(e.columnKeys)||e.columnKeys.some(a=>typeof a!="string"))&&t.push({path:`${s}.columnKeys`,message:"逻辑列字段应为字符串数组"}),e.layout!==void 0&&e.layout!=="page"&&e.layout!=="wide"&&t.push({path:`${s}.layout`,message:"布局应为 page 或 wide"}),e.title!==void 0&&typeof e.title!="string"&&t.push({path:`${s}.title`,message:"逻辑表名称应为字符串"})}}}function me(e,i,t,s){if(e!==void 0)if(!g(e)||!Array.isArray(e.cells))t.push({path:`${i}.grid.cells`,message:"grid.cells 应为二维数组"});else{const n=e.paddingMm;n!==void 0&&(typeof n!="number"||!Number.isFinite(n)||n<0)&&t.push({path:`${i}.grid.paddingMm`,message:"单元格内距应为有限非负数"}),e.cells.forEach((o,a)=>{if(!Array.isArray(o)){t.push({path:`${i}.grid.cells.${a}`,message:"行应为数组"});return}o.forEach((f,r)=>{if(f==null)return;const d=`${i}.grid.cells.${a}.${r}`;if(!g(f)){t.push({path:d,message:"网格单元格应为对象或 null"});return}re(f,d,t),U(f.richParagraphs,d,t),Array.isArray(f.children)&&f.children.forEach((u,p)=>{I(u,`${i}.grid.cells.${a}.${r}.children.${p}`,t,s)})})})}}function S(e,i,t,s){e!==void 0&&!i.includes(e)&&s.push({path:t,message:"未知富文本属性值"})}function O(e,i,t,s,n=0){for(const o of i){const a=e[o];a!==void 0&&(typeof a!="number"||!Number.isFinite(a)||a<n)&&s.push({path:`${t}.${o}`,message:"富文本数值应为范围内有限数字"})}}function ce(e,i,t){if(e!==void 0){if(!g(e)){t.push({path:i,message:"富文本样式应为对象"});return}for(const s of["fontFamily","color","backgroundColor","lineColor","borderColor"])e[s]!==void 0&&typeof e[s]!="string"&&t.push({path:`${i}.${s}`,message:"富文本样式应为字符串"});for(const s of["bold","italic","underline","borderTop","borderRight","borderBottom","borderLeft"])e[s]!==void 0&&typeof e[s]!="boolean"&&t.push({path:`${i}.${s}`,message:"富文本样式应为布尔值"});O(e,["fontSize","fontSizePx","lineWidthPt","lineHeight","opacity"],i,t),O(e,["letterSpacing","rotateDeg"],i,t,-1/0),typeof e.opacity=="number"&&e.opacity>1&&t.push({path:`${i}.opacity`,message:"透明度不能大于1"}),S(e.align,["left","center","right","justify"],`${i}.align`,t),S(e.verticalAlign,["top","middle","bottom"],`${i}.verticalAlign`,t)}}function ge(e,i,t){if(!g(e)){t.push({path:i,message:"富文本片段应为对象"});return}S(e.kind,["text","field"],`${i}.kind`,t);for(const s of["text","field"])e[s]!==void 0&&typeof e[s]!="string"&&t.push({path:`${i}.${s}`,message:"富文本内容应为字符串"});ce(e.style,`${i}.style`,t)}function U(e,i,t){if(e!==void 0){if(!Array.isArray(e)){t.push({path:`${i}.richParagraphs`,message:"richParagraphs 应为数组"});return}e.forEach((s,n)=>{const o=`${i}.richParagraphs.${n}`;if(!g(s)||!Array.isArray(s.segments)){t.push({path:o,message:"段落缺少 segments 数组"});return}S(s.align,["left","center","right","justify"],`${o}.align`,t),O(s,["lineHeight","spaceBeforeMm","spaceAfterMm","indentMm"],o,t),s.segments.forEach((a,f)=>ge(a,`${o}.segments.${f}`,t))})}}function F(e,i,t,s=[]){const n=x.componentTreeIssue([e],i);if(n){t.push(n);return}I(e,i,t,s)}function I(e,i,t,s=[]){if(!g(e)){t.push({path:i,message:"组件应为对象"});return}const n=e.kind;typeof n!="string"?t.push({path:`${i}.kind`,message:"组件缺少 kind 字符串"}):de.has(n)||s.push({path:`${i}.kind`,message:`未知组件类型 ${k(n)},将以兜底方式渲染`});for(const o of["leftMm","topMm","widthMm","heightMm"])ue(e,o,i,t);typeof e.leftMm=="number"&&e.leftMm<-100&&t.push({path:`${i}.leftMm`,message:"几何数值异常(leftMm<-100)"});for(const o of["widthMm","heightMm"])typeof e[o]=="number"&&e[o]<0&&t.push({path:`${i}.${o}`,message:"组件尺寸不能为负数"});he(e.table,i,t),pe(e.code,n,i,t),e.pageAnchor!==void 0&&!["header","footer"].includes(e.pageAnchor)&&t.push({path:`${i}.pageAnchor`,message:"页面锚点应为 header 或 footer"}),e.lineDirection!==void 0&&!["down","up"].includes(e.lineDirection)&&t.push({path:`${i}.lineDirection`,message:"线段方向应为 down 或 up"}),me(e.grid,i,t,s),U(e.richParagraphs,i,t)}function pe(e,i,t,s){if(e!==void 0)for(const n of ae.codeOptionIssues(e,i))s.push({path:`${t}.code${n.path?`.${n.path}`:""}`,message:n.message})}function q(e,i,t){if(!g(e))return;e.binding!==void 0&&t.push({path:`${i}.binding`,message:"渲染计划不允许未解析字段绑定"});const s=e.grid;!g(s)||!Array.isArray(s.cells)||s.cells.forEach((n,o)=>{Array.isArray(n)&&n.forEach((a,f)=>{!g(a)||!Array.isArray(a.children)||a.children.forEach((r,d)=>q(r,`${i}.grid.cells.${o}.${f}.children.${d}`,t))})})}function B(e,i,t,s=[]){if(!g(e)){t.push({path:i,message:"页应为对象"});return}const n=e.pageWidthMm,o=e.pageHeightMm;(typeof n!="number"||!Number.isFinite(n)||n<=0)&&t.push({path:`${i}.pageWidthMm`,message:`页宽非法: ${k(n)}`}),(typeof o!="number"||!(o>0&&o<5e3))&&t.push({path:`${i}.pageHeightMm`,message:`页高非法: ${k(o)}`}),e.layout!==void 0&&e.layout!=="page"&&e.layout!=="wide"&&t.push({path:`${i}.layout`,message:"布局应为 page 或 wide"});const a=e.components;if(!Array.isArray(a))t.push({path:`${i}.components`,message:"components 应为数组"});else if(Array.isArray(a)){const f=x.componentTreeIssue(a,`${i}.components`);if(f){t.push(f);return}a.forEach((r,d)=>{I(r,`${i}.components.${d}`,t,s),q(r,`${i}.components.${d}`,t)})}}function z(e){const i=[],t=[],s=g(e)?e.pages:void 0;if(g(e)&&e.requiresRecalculation!==void 0&&typeof e.requiresRecalculation!="boolean"&&i.push({path:"$.requiresRecalculation",message:"重算能力要求应为布尔值"}),!Array.isArray(s))i.push({path:"$.pages",message:e==null?"渲染计划为空":"渲染计划缺少 pages 数组"});else{const n=x.renderTreeIssue(s);if(n)return{ok:!1,errors:[...i,n],warnings:t};s.forEach((a,f)=>B(a,`$.pages.${f}`,i,t)),s.length>2e3&&t.push({path:"$.pages",message:`页数异常大(${s.length} 页),渲染与打印耗时可能显著增加`});const o=s.reduce((a,f)=>a+(g(f)&&Array.isArray(f.components)?f.components.length:0),0);o>5e4&&t.push({path:"$.pages",message:`组件总数异常大(${o} 个),可能触发浏览器性能限制`})}return{ok:i.length===0,errors:i,warnings:t}}function ye(e){const i=z(e);if(!i.ok){const t=i.errors.slice(0,3).map(s=>`${s.path}: ${s.message}`).join("; ");throw new Error(`渲染计划校验失败(${i.errors.length} 处): ${t}`)}return e.pages}function _(e){return e.kind==="list"?e.id:e.nid}function le(e){return e.kind==="list"?!1:e.pageAnchor!==void 0||e.kind==="text"&&typeof e.text=="string"&&/\{(?:page|totalPages)\}/.test(e.text)}function $e(e,i){const t=e.filter(n=>i.componentIds.includes(_(n)??""));if(t.filter(n=>n.kind==="list"&&n.cardinality!=="record").length&&t.length!==1)throw new Error("纵向重复区域必须独占流式分段,不能与静态或单记录区域并排");for(const n of t){const o=n.kind==="list"?n.topMm+(n.rowHeightMm??0):n.topMm+n.heightMm;if(n.topMm<i.topMm-.001||o>i.topMm+i.heightMm+.001)throw new Error("流式分段应完整包含其组件的原始纵向范围")}}function be(e,i){if(!i)return e.map(s=>({components:[s]}));const t=new Map(e.map(s=>[_(s),s]));return i.bands.map(s=>({band:s,components:s.componentIds.map(n=>{const o=t.get(n);if(!o)throw new Error(`流式区域引用不存在的组件:${n}`);return o})}))}function X(e,i){if(!i||!Array.isArray(i.bands)||!i.bands.length||i.bands.length>1e4)throw new Error("流式排版应包含 1–10000 个区域");const t=new Set,s=new Set;for(const n of e){if(le(n))continue;const o=_(n);if(!o||t.has(o))throw new Error("流式排版组件应具有唯一标识");t.add(o)}if(Ae(e,i,t,s),s.size!==t.size)throw new Error("流式排版必须显式包含每个非锚点组件")}function Ae(e,i,t,s){let n=-1/0;for(const o of i.bands){if(!Number.isFinite(o.topMm)||!Number.isFinite(o.heightMm)||o.topMm<0||o.heightMm<=0||o.topMm<n-.001)throw new Error("流式区域应按原始位置排序,尺寸有效且不重叠");if(!Array.isArray(o.componentIds)||!o.componentIds.length)throw new Error("流式区域不能没有组件");for(const a of o.componentIds){if(!t.has(a)||s.has(a))throw new Error(`流式区域组件缺失、重复或包含页锚点:${a}`);s.add(a)}$e(e,o),n=o.topMm+o.heightMm}}const we=new Set(["__proto__","prototype","constructor"]);function l(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function E(e){return typeof e=="string"&&!!e.trim()&&!we.has(e)}function v(e,i,t,s){for(const n of Object.keys(e))i.includes(n)||s.push({path:`${t}.${n}`,message:"存在未知配置字段"})}function Me(e,i,t){if(e!==void 0){if(!l(e)||!["number","percent","date"].includes(String(e.kind))){t.push({path:i,message:"绑定格式应为 number、percent 或 date"});return}v(e,e.kind==="date"?["kind","pattern"]:e.kind==="number"?["kind","digits","thousands"]:["kind","digits"],i,t),e.digits!==void 0&&(!Number.isInteger(e.digits)||Number(e.digits)<0||Number(e.digits)>100)&&t.push({path:`${i}.digits`,message:"精度应为 0..100 整数"}),e.thousands!==void 0&&typeof e.thousands!="boolean"&&t.push({path:`${i}.thousands`,message:"千分位开关应为布尔值"}),e.pattern!==void 0&&typeof e.pattern!="string"&&t.push({path:`${i}.pattern`,message:"日期格式应为字符串"})}}function Ee(e,i,t){const s=e.binding;if(s===void 0)return;const n=`${i}.binding`;if(!l(s)){t.push({path:n,message:"字段绑定应为对象"});return}(!["text","image","barcode","qrcode"].includes(String(e.kind))||e.grid!==void 0)&&t.push({path:n,message:"绑定仅支持独立文本、图片、条码与二维码组件"}),v(s,["field","format","prefix","suffix","emptyText"],n,t),E(s.field)||t.push({path:`${n}.field`,message:"绑定字段应为安全的非空字段名(按字面读取自有字段)"});for(const o of["prefix","suffix","emptyText"])s[o]!==void 0&&typeof s[o]!="string"&&t.push({path:`${n}.${o}`,message:"应为字符串"});Me(s.format,`${n}.format`,t),e.kind==="image"&&["format","prefix","suffix"].some(o=>s[o]!==void 0)&&t.push({path:n,message:"图片绑定直接读取 PNG/JPEG data URL,不支持文本格式或前后缀"})}function Ne(e,i){if(!l(e)){i.push({path:"$.repeat",message:"逐记录配置应为对象"});return}v(e,["dataset","rowKey","copies"],"$.repeat",i),E(e.dataset)||i.push({path:"$.repeat.dataset",message:"数据集应为安全的非空名称"}),e.rowKey!==void 0&&!E(e.rowKey)&&i.push({path:"$.repeat.rowKey",message:"业务主键应为安全的非空字段名"});const t=e.copies;t!==void 0&&(l(t)?(v(t,["field"],"$.repeat.copies",i),E(t.field)||i.push({path:"$.repeat.copies.field",message:"复制数字段应为安全的非空字段名"})):(!Number.isSafeInteger(t)||Number(t)<1||Number(t)>1e3)&&i.push({path:"$.repeat.copies",message:"每条记录复制数应为 1..1000 整数"}))}function Y(e,i,t,s){if(!l(e))return;Ee(e,i,s),e.binding!==void 0&&!t&&s.push({path:`${i}.binding`,message:"字段绑定需要模板 repeat 数据集;普通报表请使用列表字段"}),t&&e.kind==="list"&&s.push({path:i,message:"逐记录标签使用固定组件;动态列表请使用普通报表模板"});const n=e.grid;l(n)&&Array.isArray(n.cells)&&n.cells.forEach((o,a)=>{Array.isArray(o)&&o.forEach((f,r)=>{l(f)&&Array.isArray(f.children)&&f.children.forEach((d,u)=>Y(d,`${i}.grid.cells.${a}.${r}.children.${u}`,t,s))})})}function Q(e,i){const t=e.repeat!==void 0;t&&Ne(e.repeat,i),Array.isArray(e.pages)&&e.pages.forEach((s,n)=>{if(!l(s))return;const o=`$.pages.${n}`;t&&(s.layout==="wide"||s.flow!==void 0)&&i.push({path:o,message:"逐记录标签仅支持固定尺寸页面,不支持宽表或流式分区"}),Array.isArray(s.components)&&s.components.forEach((a,f)=>{const r=`${o}.components.${f}`;if(Y(a,r,t,i),!t||!l(a))return;const{leftMm:d,topMm:u,widthMm:p,heightMm:y}=a;[d,u,p,y,s.widthMm,s.heightMm].every(A=>typeof A=="number"&&Number.isFinite(A))&&(Number(d)<0||Number(u)<0||Number(d)+Number(p)>Number(s.widthMm)+.001||Number(u)+Number(y)>Number(s.heightMm)+.001)&&i.push({path:r,message:"标签组件超出纸张边界,请调整位置或尺寸"})})})}function Z(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function P(e,i,t){if(e!==void 0){if(!Z(e)){t.push({path:i,message:"条件应为对象"});return}(typeof e.field!="string"||!e.field.trim())&&t.push({path:`${i}.field`,message:"条件需要字段"}),e.numeric!==void 0&&e.numeric!=="number"&&e.numeric!=="decimal"&&t.push({path:`${i}.numeric`,message:"未知条件数值模式"}),[">",">=","<","<=","==","!="].includes(e.op)||t.push({path:`${i}.op`,message:"未知条件运算符"}),typeof e.value!="string"&&!(typeof e.value=="number"&&Number.isFinite(e.value))&&t.push({path:`${i}.value`,message:"条件值应为字符串或有限数字"})}}function ee(e,i,t){if(e===void 0)return;if(!Array.isArray(e)||e.length>2048){t.push({path:i,message:"聚合应为数组且最多 2048 项"});return}const s=new Set;e.forEach((n,o)=>{const a=`${i}.${o}`;if(!Z(n)){t.push({path:a,message:"聚合应为对象"});return}const f=n.field;typeof f!="string"||!f.trim()||s.has(f)?t.push({path:`${a}.field`,message:"聚合输出字段应非空且唯一"}):s.add(f),n.numeric!==void 0&&n.numeric!=="number"&&n.numeric!=="decimal"&&t.push({path:`${a}.numeric`,message:"数值模式应为 number 或 decimal"}),n.digits!==void 0&&(!Number.isInteger(n.digits)||Number(n.digits)<0||Number(n.digits)>100)&&t.push({path:`${a}.digits`,message:"小数位应为 0–100 的整数"});try{H.createAggregateAccumulator({...n,field:n.valueField??f})}catch(r){t.push({path:a,message:r instanceof Error?r.message:String(r)})}})}function ke(e,i,t){if(e===void 0)return;const s=H.validateComputedFields(e);for(const n of s.errors)t.push({path:i,message:n})}function Se(e,i,t){if(e!==void 0)try{oe.validateMatrixOptions(e)}catch(s){t.push({path:i,message:s instanceof Error?s.message:String(s)})}}function ve(e,i,t){if(e.tree===void 0)return;const s=`${i}.tree`;try{j.validateTreeOptions(e.tree);const n=e.tree;if(e.matrix||e.detail||e.groupBy||Array.isArray(e.groups)&&e.groups.length||e.rowVisibleWhen)throw new Error("树形布局不能同时配置普通分组、矩阵、主从或行可见条件");if(e.rowKey!==void 0&&e.rowKey!==n.idField)throw new Error("树形 rowKey 应与 idField 一致");if(!Array.isArray(e.columns)||!e.columns.some(o=>o&&o.field===n.labelField&&!o.hidden))throw new Error("树形布局需要可见的标签列");Array.isArray(e.computed)&&j.validateTreeComputed(n,e.computed)}catch(n){t.push({path:s,message:n instanceof Error?n.message:String(n)})}}const L="1.0";class w extends Error{constructor(i){super(`模板校验失败:${i.slice(0,3).map(t=>`${t.path}: ${t.message}`).join("; ")}`),this.errors=i,this.name="ReportTemplateError"}}const Re=new Set(["__proto__","prototype","constructor"]),xe=new Set(["schemaVersion","id","name","revision","description","template"]),Te=new Set(["left","center","right","justify"]),N=2e5,Oe=64,C=1e7;function h(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Pe(e,i,t){const s=Object.getPrototypeOf(e),n=Array.isArray(e);if(n?s!==Array.prototype:s!==Object.prototype&&s!==null)return t.push({path:i,message:"模板对象必须使用普通 JSON 对象原型"}),!1;if(n){const o=Object.keys(e);if(o.length!==e.length||o.some(a=>!/^(0|[1-9]\d*)$/.test(a)||Number(a)>=e.length))return t.push({path:i,message:"模板数组不能包含空位或额外属性"}),!1}return Object.getOwnPropertySymbols(e).length>0?(t.push({path:i,message:"模板不能包含 Symbol 键"}),!1):!0}function Fe(e,i,t,s){return Re.has(e)?(s.push({path:t,message:"模板不能包含可能污染原型的键"}),!1):i.get||i.set||!i.enumerable?(s.push({path:t,message:"模板不能包含访问器或不可枚举字段"}),!1):!0}function Ie(e){return e===null||typeof e=="boolean"||typeof e=="number"&&Number.isFinite(e)}function D(e,i){const t=new Set;let s=0,n=0,o=!1;const a=(f,r,d)=>{if(!o){if(++s>N){s===N+1&&i.push({path:r,message:"模板超过 JSON 节点安全上限"});return}if(d>Oe){i.push({path:r,message:"模板嵌套层级过深"});return}if(typeof f=="string"){n+=f.length,n>C&&(o=!0,i.push({path:r,message:"模板文本超过 1000 万字符的安全上限"}));return}if(!Ie(f)){if(!f||typeof f!="object"){i.push({path:r,message:"模板只允许 JSON 值,不允许函数、undefined 或非有限数字"});return}if(t.has(f)){i.push({path:r,message:"模板不能包含循环引用"});return}if(Pe(f,r,i)){t.add(f);for(const[u,p]of Object.entries(Object.getOwnPropertyDescriptors(f))){if(Array.isArray(f)&&u==="length")continue;const y=`${r}.${u}`;if(Fe(u,p,y,i)&&a(p.value,y,d+1),s>N||o)break}t.delete(f)}}}};a(e,"$",0)}function m(e,i,t,s,n=!1){const o=e[i];o===void 0&&!n||(typeof o!="string"||n&&!o.trim())&&s.push({path:`${t}.${i}`,message:n?"应为非空字符串":"应为字符串"})}function c(e,i,t,s,n=0,o=!1){const a=e[i];a===void 0&&!o||(typeof a!="number"||!Number.isFinite(a)||a<n)&&s.push({path:`${t}.${i}`,message:`应为大于等于 ${n} 的有限数字`})}function b(e,i,t,s){e[i]!==void 0&&typeof e[i]!="boolean"&&s.push({path:`${t}.${i}`,message:"应为布尔值"})}function M(e,i,t,s=!1){e!==void 0&&!Te.has(e)&&!(s&&e==="auto")&&t.push({path:i,message:`未知对齐方式${s?"(支持 auto)":""}`})}function $(e,i,t){if(e!==void 0){if(!h(e)){t.push({path:i,message:"样式应为对象"});return}M(e.align,`${i}.align`,t),e.verticalAlign!==void 0&&!["top","middle","bottom"].includes(e.verticalAlign)&&t.push({path:`${i}.verticalAlign`,message:"未知垂直对齐方式"});for(const s of["fontSize","fontSizePx","lineWidthPt","lineHeight"])c(e,s,i,t);for(const s of["letterSpacing","rotateDeg"])c(e,s,i,t,-1/0);c(e,"opacity",i,t),typeof e.opacity=="number"&&e.opacity>1&&t.push({path:`${i}.opacity`,message:"透明度不能大于 1"});for(const s of["bold","italic","underline","borderTop","borderRight","borderBottom","borderLeft"])b(e,s,i,t);for(const s of["fontFamily","color","backgroundColor","lineColor","borderColor"])m(e,s,i,t)}}function _e(e,i,t){if(e===void 0)return;if(!Array.isArray(e)){t.push({path:i,message:"参数定义应为数组"});return}const s=new Set,n=t.length;e.forEach((o,a)=>{const f=`${i}.${a}`;if(!h(o)){t.push({path:f,message:"参数定义应为对象"});return}m(o,"field",f,t,!0),typeof o.field=="string"&&(s.has(o.field)&&t.push({path:`${f}.field`,message:"参数名重复"}),s.add(o.field)),o.type!==void 0&&!["text","number","date","month","year","dateRange","select"].includes(o.type)&&t.push({path:`${f}.type`,message:"未知参数类型"});for(const r of["label","defaultValue","placeholder"])m(o,r,f,t);b(o,"required",f,t);for(const r of["minLength","maxLength"]){const d=o[r];d!==void 0&&(typeof d!="number"||!Number.isSafeInteger(d)||d<0)&&t.push({path:`${f}.${r}`,message:"长度边界应为非负整数"})}Le(o,f,t),o.options!==void 0&&(Array.isArray(o.options)?o.options.forEach((r,d)=>{const u=`${f}.options.${d}`;if(!h(r))t.push({path:u,message:"选项应为对象"});else for(const p of["label","value"])typeof r[p]!="string"&&t.push({path:`${u}.${p}`,message:"选项标签与值应为字符串(允许空白选项)"})}):t.push({path:`${f}.options`,message:"选项应为数组"}))}),t.length===n&&t.push(...J.validateReportParamDefinitions(e).map(o=>({path:o.path.replace("$.paramDefs",i),message:o.message})))}function Le(e,i,t){for(const o of["min","max"]){const a=e[o];if(a===void 0)continue;J.isReportTemporalBound(e.type,a)||e.type==="number"&&typeof a=="number"&&Number.isFinite(a)||t.push({path:`${i}.${o}`,message:"数字使用有限数字边界,日期/月/年使用对应规范字符串边界"})}const s=typeof e.min=="number"&&typeof e.max=="number"&&e.min>e.max,n=typeof e.min=="string"&&typeof e.max=="string"&&e.min>e.max;(s||n)&&t.push({path:i,message:"最小边界不能大于最大边界"}),typeof e.minLength=="number"&&typeof e.maxLength=="number"&&e.minLength>e.maxLength&&t.push({path:i,message:"最小长度不能大于最大长度"})}function te(e,i,t){if(!Array.isArray(e)||e.length===0){t.push({path:i,message:"列表至少需要一列"});return}e.every(s=>h(s)&&s.hidden===!0)&&t.push({path:i,message:"列表至少需要一列可见列"}),e.forEach((s,n)=>{const o=`${i}.${n}`;if(!h(s)){t.push({path:o,message:"列应为对象"});return}if(W(s,o,t),b(s,"hidden",o,t),P(s.visibleWhen,`${o}.visibleWhen`,t),typeof s.header!="string"&&t.push({path:`${o}.header`,message:"表头应为字符串(允许空白表头)"}),m(s,"field",o,t,!0),c(s,"widthMm",o,t,Number.MIN_VALUE,!0),$(s.style,`${o}.style`,t),$(s.headerStyle,`${o}.headerStyle`,t),M(s.align,`${o}.align`,t,!0),M(s.headerAlign,`${o}.headerAlign`,t),s.semanticRole!==void 0&&!["identifier","dimension","measure","date","text"].includes(s.semanticRole)&&t.push({path:`${o}.semanticRole`,message:"未知列语义"}),s.format!==void 0)if(!h(s.format)||!["number","percent","date"].includes(s.format.kind))t.push({path:`${o}.format`,message:"未知列格式"});else{const a=s.format.digits;a!==void 0&&(typeof a!="number"||!Number.isInteger(a)||a<0||a>100)&&t.push({path:`${o}.format.digits`,message:"小数位应为 0–100 的整数"}),b(s.format,"thousands",`${o}.format`,t),m(s.format,"pattern",`${o}.format`,t)}s.rules!==void 0&&(Array.isArray(s.rules)?s.rules.forEach((a,f)=>{const r=`${o}.rules.${f}`;if(!h(a)||!h(a.when)){t.push({path:r,message:"条件格式缺少 when 对象"});return}P(a.when,`${r}.when`,t),m(a.when,"field",`${r}.when`,t,!0),[">",">=","<","<=","==","!="].includes(a.when.op)||t.push({path:`${r}.when.op`,message:"未知条件运算符"}),typeof a.when.value!="number"&&typeof a.when.value!="string"&&t.push({path:`${r}.when.value`,message:"条件值应为数字或字符串"}),$(a.style,`${r}.style`,t)}):t.push({path:`${o}.rules`,message:"条件格式应为数组"}))})}function ie(e,i,t){if(e!==void 0){if(!h(e)){t.push({path:i,message:"分组应为对象"});return}m(e,"field",i,t,!0);for(const s of["headerTemplate","subtotalLabel"])m(e,s,i,t);for(const s of["headerStyle","subtotalStyle"])$(e[s],`${i}.${s}`,t);b(e,"keepWithNext",i,t),b(e,"repeatHeader",i,t),ee(e.aggregates,`${i}.aggregates`,t),e.subtotal!==void 0&&(!Array.isArray(e.subtotal)||e.subtotal.some(s=>typeof s!="string"))&&t.push({path:`${i}.subtotal`,message:"小计字段应为字符串数组"})}}function Ce(e,i,t){if(!(e===void 0||typeof e=="boolean")){if(!h(e)){t.push({path:i,message:"合计应为布尔值或对象"});return}m(e,"label",i,t),ee(e.aggregates,`${i}.aggregates`,t),$(e.style,`${i}.style`,t),e.fields!==void 0&&(!Array.isArray(e.fields)||e.fields.some(s=>typeof s!="string"))&&t.push({path:`${i}.fields`,message:"合计字段应为字符串数组"})}}function De(e,i,t,s){const n={kind:"rect",leftMm:0,topMm:0,widthMm:1,heightMm:1,grid:e};if(F(n,t,s,[]),V(n,t,s),!h(e)||!Array.isArray(e.cells))return;const o=e.cells,a=Array.isArray(i)?i.length:0;if(o.length*a>N){s.push({path:t,message:"表头逻辑网格超过 20 万格安全上限"});return}e.cells.length||s.push({path:`${t}.cells`,message:"表头至少需要一行"}),Array.isArray(e.colWidthsMm)&&e.colWidthsMm.length!==a&&s.push({path:`${t}.colWidthsMm`,message:"表头列宽数量应与列表列数一致"}),Array.isArray(e.rowHeightsMm)&&e.rowHeightsMm.length!==e.cells.length&&s.push({path:`${t}.rowHeightsMm`,message:"表头行高数量应与行数一致"}),Ve(o,a,t,s)}function Ve(e,i,t,s){const n=new Set;e.forEach((o,a)=>{if(!Array.isArray(o))return;let f=0;o.forEach((r,d)=>{for(;n.has(`${a}:${f}`);)f++;const u=h(r)&&typeof r.colSpan=="number"?r.colSpan:1,p=h(r)&&typeof r.rowSpan=="number"?r.rowSpan:1;(f+u>i||a+p>e.length)&&s.push({path:`${t}.cells.${a}.${d}`,message:"表头合并区域超出表头边界"});for(let y=a;y<Math.min(e.length,a+p);y++)for(let A=f;A<Math.min(i,f+u);A++)n.has(`${y}:${A}`)&&s.push({path:`${t}.cells.${a}.${d}`,message:"表头合并区域重叠"}),n.add(`${y}:${A}`);f+=u})})}function je(e,i,t){if(ve(e,i,t),ke(e.computed,`${i}.computed`,t),Se(e.matrix,`${i}.matrix`,t),e.matrix&&(e.detail||e.groupBy||Array.isArray(e.groups)&&e.groups.length||e.grandTotal)&&t.push({path:`${i}.matrix`,message:"矩阵请使用自身 totals 汇总,不能同时配置普通分组、总计或主从明细"}),P(e.rowVisibleWhen,`${i}.rowVisibleWhen`,t),e.groups!==void 0&&(!Array.isArray(e.groups)||e.groups.length>16?t.push({path:`${i}.groups`,message:"分组应为数组,最多 16 级"}):e.groups.forEach((o,a)=>ie(o,`${i}.groups.${a}`,t))),e.detail===void 0)return;const s=e.detail,n=`${i}.detail`;if(!h(s)){t.push({path:n,message:"主从关联应为对象"});return}for(const o of["dataset","parentKey","foreignKey"])m(s,o,n,t,!0);for(const o of["rowKey","revisionField","sourceTokenField"])m(s,o,n,t,s[o]!==void 0);m(s,"label",n,t),b(s,"header",n,t),c(s,"rowHeightMm",n,t,Number.MIN_VALUE),te(s.columns,`${n}.columns`,t),s.unmatched!==void 0&&s.unmatched!=="error"&&s.unmatched!=="ignore"&&t.push({path:`${n}.unmatched`,message:"未关联明细策略应为 error 或 ignore"})}function Ke(e,i,t){for(const s of["leftMm","topMm"])c(e,s,i,t,-1/0,!0);c(e,"widthMm",i,t,Number.MIN_VALUE,!0),m(e,"dataset",i,t,!0),m(e,"title",i,t);for(const s of["rowKey","revisionField","sourceTokenField"])m(e,s,i,t,e[s]!==void 0);e.headerGrid!==void 0&&De(e.headerGrid,e.columns,`${i}.headerGrid`,t),e.layout!==void 0&&e.layout!=="page"&&e.layout!=="wide"&&t.push({path:`${i}.layout`,message:"布局应为 page 或 wide"}),te(e.columns,`${i}.columns`,t);for(const s of["fontSizePt","rowHeightMm"])c(e,s,i,t,Number.MIN_VALUE);c(e,"paddingMm",i,t);for(const s of["header","headerBold","headerEveryPage","border"])b(e,s,i,t);e.cardinality!==void 0&&e.cardinality!=="record"&&t.push({path:`${i}.cardinality`,message:"单记录区域类型应为 record"}),m(e,"headerBackgroundColor",i,t),M(e.align,`${i}.align`,t,!0),M(e.headerAlign,`${i}.headerAlign`,t),$(e.headerStyle,`${i}.headerStyle`,t),je(e,i,t),ie(e.groupBy,`${i}.groupBy`,t),Ce(e.grandTotal,`${i}.grandTotal`,t)}function K(e,i,t){Array.isArray(e.richParagraphs)&&e.richParagraphs.forEach((s,n)=>{if(!h(s))return;const o=`${i}.richParagraphs.${n}`;M(s.align,`${o}.align`,t);for(const a of["lineHeight","spaceBeforeMm","spaceAfterMm","indentMm"])c(s,a,o,t);Array.isArray(s.segments)&&s.segments.forEach((a,f)=>{const r=`${o}.segments.${f}`;if(!h(a)){t.push({path:r,message:"富文本片段应为对象"});return}a.kind!==void 0&&a.kind!=="text"&&a.kind!=="field"&&t.push({path:`${r}.kind`,message:"未知富文本片段类型"});for(const d of["text","field"])m(a,d,r,t);$(a.style,`${r}.style`,t)})})}function V(e,i,t){$(e.style,`${i}.style`,t);for(const n of["text","rawText","imageData","fallbackText","nid","rkey"])m(e,n,i,t);if(e.lines!==void 0&&(!Array.isArray(e.lines)||e.lines.some(n=>typeof n!="string"))&&t.push({path:`${i}.lines`,message:"文本行应为字符串数组"}),K(e,i,t),!h(e.grid))return;const s=e.grid;c(s,"gapMm",`${i}.grid`,t),c(s,"paddingMm",`${i}.grid`,t);for(const n of["colWidthsMm","rowHeightsMm"]){const o=s[n];o!==void 0&&(!Array.isArray(o)||o.some(a=>typeof a!="number"||!Number.isFinite(a)||a<0))&&t.push({path:`${i}.grid.${n}`,message:"网格尺寸应为有限非负数字数组"})}Array.isArray(s.cells)&&s.cells.forEach((n,o)=>{Array.isArray(n)&&n.forEach((a,f)=>{const r=`${i}.grid.cells.${o}.${f}`;if(a!==null){if(!h(a)){t.push({path:r,message:"网格单元格应为对象或 null"});return}for(const d of["text","rawText","numberFormat"])m(a,d,r,t);for(const d of["colSpan","rowSpan"]){const u=a[d];u!==void 0&&(typeof u!="number"||!Number.isInteger(u)||u<=0)&&t.push({path:`${r}.${d}`,message:"跨度应为正整数"})}a.value!==void 0&&a.value!==null&&!["string","number","boolean"].includes(typeof a.value)&&t.push({path:`${r}.value`,message:"Excel 原始值应为字符串、数字、布尔值或 null"}),$(a.style,`${r}.style`,t),K(a,r,t),a.children!==void 0&&(Array.isArray(a.children)?a.children.forEach((d,u)=>{h(d)&&V(d,`${r}.children.${u}`,t)}):t.push({path:`${r}.children`,message:"嵌套组件应为数组"}))}})})}function He(e,i,t){if(!(e.flow===void 0||!Array.isArray(e.components)))try{X(e.components,e.flow)}catch(s){t.push({path:`${i}.flow`,message:s instanceof Error?s.message:String(s)})}}function se(e){const i=[],t=[];return D(e,i),i.length?{ok:!1,errors:i,warnings:t}:(h(e)?(e.schemaVersion!==void 0&&e.schemaVersion!==x.RENDER_PLAN_SCHEMA_VERSION&&i.push({path:"$.schemaVersion",message:"不支持的模板 schemaVersion"}),_e(e.params,"$.params",i),Q(e,i),!Array.isArray(e.pages)||e.pages.length===0?i.push({path:"$.pages",message:"模板至少需要一页"}):e.pages.forEach((s,n)=>{const o=`$.pages.${n}`;if(!h(s)){i.push({path:o,message:"页应为对象"});return}c(s,"widthMm",o,i,Number.MIN_VALUE,!0),c(s,"heightMm",o,i,Number.MIN_VALUE,!0),s.layout!==void 0&&s.layout!=="page"&&s.layout!=="wide"&&i.push({path:`${o}.layout`,message:"布局应为 page 或 wide"}),typeof s.heightMm=="number"&&s.heightMm>=5e3&&i.push({path:`${o}.heightMm`,message:"页高应小于 5000mm"});for(const a of["marginTopMm","marginBottomMm","marginLeftMm","marginRightMm"])c(s,a,o,i);typeof s.widthMm=="number"&&Number(s.marginLeftMm??0)+Number(s.marginRightMm??0)>=s.widthMm&&i.push({path:o,message:"横向页边距占满页面"}),typeof s.heightMm=="number"&&Number(s.marginTopMm??0)+Number(s.marginBottomMm??0)>=s.heightMm&&i.push({path:o,message:"纵向页边距占满页面"}),Array.isArray(s.components)?s.components.forEach((a,f)=>{const r=`${o}.components.${f}`;h(a)&&a.kind==="list"?Ke(a,r,i):(F(a,r,i,t),h(a)&&V(a,r,i))}):i.push({path:`${o}.components`,message:"组件应为数组"}),He(s,o,i)})):i.push({path:"$",message:"模板应为对象"}),{ok:i.length===0,errors:i,warnings:t})}function ne(e){const i=[],t=[];if(D(e,i),i.length)return{ok:!1,errors:i,warnings:t};if(!h(e))i.push({path:"$",message:"模板文档应为对象"});else{for(const n of Object.keys(e))xe.has(n)||i.push({path:`$.${n}`,message:"模板文档存在未知字段;只保存模板与描述,不保存取数或业务数据"});e.schemaVersion!==L&&i.push({path:"$.schemaVersion",message:"不支持的模板文档版本"});for(const n of["id","name"])m(e,n,"$",i,!0);for(const n of["revision","description"])m(e,n,"$",i);const s=se(e.template);i.push(...s.errors.map(n=>({...n,path:`$.template${n.path.slice(1)}`}))),t.push(...s.warnings.map(n=>({...n,path:`$.template${n.path.slice(1)}`})))}return{ok:i.length===0,errors:i,warnings:t}}function T(e){const i=ne(e);if(!i.ok)throw new w(i.errors)}function Je(e){const i=[];if(D(e,i),i.length)throw new w(i);const t={...e,schemaVersion:e.schemaVersion??L};return T(t),R(t)}function We(e){let i=e;if(typeof e=="string"){if(e.length>C)throw new w([{path:"$",message:"模板 JSON 超过 1000 万字符的导出/导入上限"}]);try{i=JSON.parse(e)}catch{throw new w([{path:"$",message:"模板 JSON 语法无效"}])}}return T(i),R(i)}function Ge(e){T(e);const i=JSON.stringify(e,null,2);if(i.length>C)throw new w([{path:"$",message:"模板 JSON 超过 1000 万字符的导出/导入上限"}]);return i}function R(e){return JSON.parse(JSON.stringify(e))}function Ue(e=[]){const i=new Map,t={get:s=>{const n=i.get(s);return n?R(n):void 0},list:()=>Array.from(i.values(),({template:s,...n})=>({...n})),register:(s,n={})=>{if(T(s),i.has(s.id)&&!n.replace)throw new w([{path:"$.id",message:`模板 ID ${s.id} 已注册;更新需显式 replace:true`}]);i.set(s.id,R(s))},remove:s=>i.delete(s)};for(const s of e)t.register(s);return t}exports.REPORT_TEMPLATE_DOCUMENT_VERSION=L;exports.ReportTemplateError=w;exports.assertRenderPlan=ye;exports.createTemplateRegistry=Ue;exports.defineReportTemplate=Je;exports.parseReportTemplate=We;exports.reportFlowGroups=be;exports.serializeReportTemplate=Ge;exports.validateComponent=F;exports.validatePage=B;exports.validateRenderPlan=z;exports.validateReportPageFlow=X;exports.validateReportTemplate=se;exports.validateReportTemplateDocument=ne;exports.validateTemplateRepeat=Q;
|