@agile-team/mach-report 2.13.0 → 2.15.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.
Files changed (260) hide show
  1. package/README.md +20 -7
  2. package/THIRD_PARTY_NOTICES.md +3 -1
  3. package/dist/ExcelBindingWizard-BKH1nGNS.js +1485 -0
  4. package/dist/ExcelBindingWizard-Bs43BGNp.cjs +1 -0
  5. package/dist/ParamEditor-Da4akw6V.cjs +1 -0
  6. package/dist/ParamEditor-DoAhzJsm.js +594 -0
  7. package/dist/{ReportBatchPanel-CW2HV9I8.js → ReportBatchPanel-BMf6boMA.js} +39 -39
  8. package/dist/ReportBatchPanel-wP9m9Pj1.cjs +1 -0
  9. package/dist/ReportPreview-ChV19HBp.js +4619 -0
  10. package/dist/ReportPreview-DbLvvOUT.cjs +6 -0
  11. package/dist/{ReportTemplateLibrary-BZB-XWjj.js → ReportTemplateLibrary-C9wutIiT.js} +1 -1
  12. package/dist/ReportTemplateLibrary-Sxr3eD0J.cjs +1 -0
  13. package/dist/RuleEditor-C_Clasvd.js +2037 -0
  14. package/dist/RuleEditor-XhGHK8DE.cjs +1 -0
  15. package/dist/TemplateOutlinePanel-D6Bkny59.js +96 -0
  16. package/dist/TemplateOutlinePanel-JTSR53vJ.cjs +1 -0
  17. package/dist/TemplateReusePanel-Kx35S0Ql.cjs +1 -0
  18. package/dist/TemplateReusePanel-rVuK1kTz.js +388 -0
  19. package/dist/TemplateReviewPanel-B0ar9_zf.js +592 -0
  20. package/dist/TemplateReviewPanel-Dn6X9UmY.cjs +1 -0
  21. package/dist/analytics.cjs +1 -1
  22. package/dist/analytics.d.cts +3 -1
  23. package/dist/analytics.d.ts +3 -1
  24. package/dist/analytics.js +154 -60
  25. package/dist/artifact-integrity.json +135 -0
  26. package/dist/assets-B9ImAi6_.cjs +1 -0
  27. package/dist/assets-DEaz4qsp.js +124 -0
  28. package/dist/batch-BaP6pWDE.cjs +1 -0
  29. package/dist/batch-BfZHN1do.js +220 -0
  30. package/dist/batch-CGyt-b2W.js +273 -0
  31. package/dist/batch-CLpELXBl.cjs +1 -0
  32. package/dist/capabilities-CAh2Nrue.cjs +1 -0
  33. package/dist/capabilities-DskCHs3V.js +69 -0
  34. package/dist/codes.d.cts +2 -0
  35. package/dist/codes.d.ts +2 -0
  36. package/dist/{computed-Bvk0W15F.js → computed-C-4C2S5h.js} +3 -3
  37. package/dist/config-BVsJXSqS.js +842 -0
  38. package/dist/config-D10us76d.cjs +1 -0
  39. package/dist/data-explanation-B8MZRYVS.js +16 -0
  40. package/dist/data-explanation-DE55G30w.cjs +1 -0
  41. package/dist/designer-2bDlcNXQ.js +5136 -0
  42. package/dist/designer-BT7XCdbW.cjs +2 -0
  43. package/dist/designer.cjs +1 -2
  44. package/dist/designer.d.cts +432 -17
  45. package/dist/designer.d.ts +432 -17
  46. package/dist/designer.js +21 -4312
  47. package/dist/drill-ByJviLXS.js +145 -0
  48. package/dist/drill-DYTxuL3A.cjs +1 -0
  49. package/dist/font-loader-B_UkxpzC.cjs +1 -0
  50. package/dist/font-loader-Q3bQjmrI.js +297 -0
  51. package/dist/index.cjs +8 -8
  52. package/dist/index.d.cts +239 -5
  53. package/dist/index.d.ts +239 -5
  54. package/dist/index.js +939 -893
  55. package/dist/json-snapshot-DFb2eWkf.js +1416 -0
  56. package/dist/json-snapshot-WWSGlaHG.cjs +2 -0
  57. package/dist/licenses/_bwip-js_generic-4.11.4.txt +24 -0
  58. package/dist/licenses/_fast-csv_format-4.3.5.txt +22 -0
  59. package/dist/licenses/_fast-csv_parse-4.3.6.txt +22 -0
  60. package/dist/licenses/_pdf-lib_fontkit-1.1.1.txt +326 -0
  61. package/dist/licenses/_pdf-lib_standard-fonts-1.0.0.txt +22 -0
  62. package/dist/licenses/_pdf-lib_upng-1.0.1.txt +22 -0
  63. package/dist/licenses/_types_node-14.18.63.txt +22 -0
  64. package/dist/licenses/_types_pako-2.0.3.txt +22 -0
  65. package/dist/licenses/_types_pegjs-0.10.6.txt +22 -0
  66. package/dist/licenses/archiver-5.3.2.txt +23 -0
  67. package/dist/licenses/archiver-utils-2.1.0.txt +23 -0
  68. package/dist/licenses/archiver-utils-3.0.4.txt +23 -0
  69. package/dist/licenses/async-3.2.6.txt +20 -0
  70. package/dist/licenses/balanced-match-1.0.2.txt +22 -0
  71. package/dist/licenses/base64-js-1.5.1.txt +22 -0
  72. package/dist/licenses/big-integer-1.6.52.txt +25 -0
  73. package/dist/licenses/binary-0.3.0.txt +178 -0
  74. package/dist/licenses/bl-4.1.0.txt +14 -0
  75. package/dist/licenses/bluebird-3.4.7.txt +22 -0
  76. package/dist/licenses/brace-expansion-1.1.21.txt +22 -0
  77. package/dist/licenses/brace-expansion-2.1.7.txt +22 -0
  78. package/dist/licenses/buffer-5.7.1.txt +22 -0
  79. package/dist/licenses/buffer-crc32-0.2.13.txt +20 -0
  80. package/dist/licenses/buffer-indexof-polyfill-1.0.2.txt +23 -0
  81. package/dist/licenses/buffers-0.1.1.txt +140 -0
  82. package/dist/licenses/chainsaw-0.1.0.txt +184 -0
  83. package/dist/licenses/compress-commons-4.1.2.txt +23 -0
  84. package/dist/licenses/concat-map-0.0.1.txt +19 -0
  85. package/dist/licenses/core-util-is-1.0.3.txt +20 -0
  86. package/dist/licenses/crc-32-1.2.2.txt +202 -0
  87. package/dist/licenses/crc32-stream-4.0.3.txt +23 -0
  88. package/dist/licenses/dayjs-1.11.23.txt +22 -0
  89. package/dist/licenses/duplexer2-0.1.4.txt +27 -0
  90. package/dist/licenses/end-of-stream-1.4.5.txt +22 -0
  91. package/dist/licenses/exceljs-4.4.0.txt +23 -0
  92. package/dist/licenses/fast-csv-4.3.6.txt +22 -0
  93. package/dist/licenses/fast-png-6.4.0.txt +22 -0
  94. package/dist/licenses/fs-constants-1.0.0.txt +22 -0
  95. package/dist/licenses/fs.realpath-1.0.0.txt +44 -0
  96. package/dist/licenses/fstream-1.0.12.txt +16 -0
  97. package/dist/licenses/glob-7.2.3.txt +22 -0
  98. package/dist/licenses/graceful-fs-4.2.11.txt +16 -0
  99. package/dist/licenses/ieee754-1.2.1.txt +12 -0
  100. package/dist/licenses/immediate-3.0.6.txt +21 -0
  101. package/dist/licenses/inflight-1.0.6.txt +16 -0
  102. package/dist/licenses/inherits-2.0.4.txt +17 -0
  103. package/dist/licenses/iobuffer-5.4.0.txt +23 -0
  104. package/dist/licenses/isarray-1.0.0.txt +61 -0
  105. package/dist/licenses/jszip-3.10.2.txt +652 -0
  106. package/dist/licenses/lazystream-1.0.1.txt +24 -0
  107. package/dist/licenses/lie-3.3.0.txt +8 -0
  108. package/dist/licenses/listenercount-1.0.1.txt +6 -0
  109. package/dist/licenses/lodash.defaults-4.2.0.txt +48 -0
  110. package/dist/licenses/lodash.difference-4.5.0.txt +48 -0
  111. package/dist/licenses/lodash.escaperegexp-4.1.2.txt +48 -0
  112. package/dist/licenses/lodash.flatten-4.4.0.txt +48 -0
  113. package/dist/licenses/lodash.groupby-4.6.0.txt +48 -0
  114. package/dist/licenses/lodash.isboolean-3.0.3.txt +23 -0
  115. package/dist/licenses/lodash.isequal-4.5.0.txt +48 -0
  116. package/dist/licenses/lodash.isfunction-3.0.9.txt +48 -0
  117. package/dist/licenses/lodash.isnil-4.0.0.txt +23 -0
  118. package/dist/licenses/lodash.isplainobject-4.0.6.txt +48 -0
  119. package/dist/licenses/lodash.isundefined-3.0.1.txt +23 -0
  120. package/dist/licenses/lodash.union-4.6.0.txt +48 -0
  121. package/dist/licenses/lodash.uniq-4.5.0.txt +48 -0
  122. package/dist/licenses/minimatch-3.1.5.txt +16 -0
  123. package/dist/licenses/minimatch-5.1.9.txt +16 -0
  124. package/dist/licenses/minimist-1.2.8.txt +19 -0
  125. package/dist/licenses/mkdirp-0.5.6.txt +22 -0
  126. package/dist/licenses/node-sql-parser-5.4.0.txt +202 -0
  127. package/dist/licenses/normalize-path-3.0.0.txt +22 -0
  128. package/dist/licenses/once-1.4.0.txt +16 -0
  129. package/dist/licenses/pako-1.0.11.txt +22 -0
  130. package/dist/licenses/pako-2.2.0.txt +22 -0
  131. package/dist/licenses/path-is-absolute-1.0.1.txt +22 -0
  132. package/dist/licenses/pdf-lib-1.17.1.txt +22 -0
  133. package/dist/licenses/process-nextick-args-2.0.1.txt +20 -0
  134. package/dist/licenses/readable-stream-2.3.8.txt +48 -0
  135. package/dist/licenses/readable-stream-3.6.2.txt +48 -0
  136. package/dist/licenses/readdir-glob-1.1.3.txt +202 -0
  137. package/dist/licenses/rimraf-2.7.1.txt +16 -0
  138. package/dist/licenses/safe-buffer-5.1.2.txt +22 -0
  139. package/dist/licenses/safe-buffer-5.2.1.txt +22 -0
  140. package/dist/licenses/saxes-5.0.1.txt +397 -0
  141. package/dist/licenses/setimmediate-1.0.5.txt +21 -0
  142. package/dist/licenses/string_decoder-1.1.1.txt +49 -0
  143. package/dist/licenses/string_decoder-1.3.0.txt +49 -0
  144. package/dist/licenses/tar-stream-2.2.0.txt +22 -0
  145. package/dist/licenses/tmp-0.2.7.txt +22 -0
  146. package/dist/licenses/traverse-0.3.9.txt +25 -0
  147. package/dist/licenses/tslib-1.14.1.txt +13 -0
  148. package/dist/licenses/unzipper-0.10.14.txt +26 -0
  149. package/dist/licenses/util-deprecate-1.0.2.txt +25 -0
  150. package/dist/licenses/uuid-11.1.1.txt +10 -0
  151. package/dist/licenses/wrappy-1.0.2.txt +16 -0
  152. package/dist/licenses/xmlchars-2.2.0.txt +19 -0
  153. package/dist/licenses/zip-stream-4.1.1.txt +23 -0
  154. package/dist/matrix-CGRGkn5s.js +112 -0
  155. package/dist/matrix-gEO7ZM_u.cjs +1 -0
  156. package/dist/media-B7vnpD8k.cjs +1 -0
  157. package/dist/media-Y90dHK9z.js +70 -0
  158. package/dist/param-validation-C3HlcLLO.cjs +1 -0
  159. package/dist/param-validation-Do7Eg8Zv.js +181 -0
  160. package/dist/pdf-BwNyeGpt.js +36352 -0
  161. package/dist/pdf-CvvrjPQg.cjs +103 -0
  162. package/dist/pdf.cjs +1 -101
  163. package/dist/pdf.d.cts +18 -3
  164. package/dist/pdf.d.ts +18 -3
  165. package/dist/pdf.js +9 -36579
  166. package/dist/plugin-Ca_XZG3l.js +22 -0
  167. package/dist/{plugin-DzS6pxTA.cjs → plugin-DHO7X8z2.cjs} +1 -1
  168. package/dist/prepared-CFy9B75C.cjs +1 -0
  169. package/dist/prepared-ajM-H-9B.js +69 -0
  170. package/dist/progress-B0ctFpKf.cjs +1 -0
  171. package/dist/progress-D-OTpEav.js +52 -0
  172. package/dist/{record-bindings-D-5jQlTj.js → record-bindings-Do_b3h4V.js} +1 -1
  173. package/dist/{region-binding-workflow-CcUq8W2Q.js → region-binding-workflow-BMhK_TjP.js} +1 -1
  174. package/dist/{region-binding-workflow-BzfbxRiR.cjs → region-binding-workflow-DIYJdCUr.cjs} +1 -1
  175. package/dist/{report-params-B44imUd4.js → report-params-B1RzkhJj.js} +1 -1
  176. package/dist/{report-params-SJfhKgaX.cjs → report-params-WDGrA4oP.cjs} +1 -1
  177. package/dist/sbom.cdx.json +3982 -0
  178. package/dist/server/node.d.cts +66 -12
  179. package/dist/server/node.d.ts +66 -12
  180. package/dist/server-node.cjs +1 -1
  181. package/dist/server-node.js +405 -381
  182. package/dist/server.cjs +1 -1
  183. package/dist/server.d.cts +878 -15
  184. package/dist/server.d.ts +878 -15
  185. package/dist/server.js +1034 -534
  186. package/dist/sha256-ArEYjaTI.cjs +1 -0
  187. package/dist/sha256-DPEuJ3nh.js +155 -0
  188. package/dist/style.css +1 -1
  189. package/dist/template-bindings-C2SpvsMU.js +58 -0
  190. package/dist/template-bindings-CEtWyiLX.cjs +1 -0
  191. package/dist/template-catalog-FJE_c9Qe.cjs +1 -0
  192. package/dist/template-catalog-j2B1MJlL.js +414 -0
  193. package/dist/template-fragments-BGbQLGlV.js +187 -0
  194. package/dist/template-fragments-DcKeiylI.cjs +1 -0
  195. package/dist/template-outline-BwRV_eRo.cjs +1 -0
  196. package/dist/template-outline-cnWfT_LK.js +88 -0
  197. package/dist/{template-registry-BjE1VS6g.js → template-registry-BtaKPELV.js} +364 -201
  198. package/dist/template-registry-Co1zPq5e.cjs +1 -0
  199. package/dist/textwrap-CWHyzkBH.cjs +4 -0
  200. package/dist/textwrap-DE1kgcJB.js +110 -0
  201. package/dist/{tree-CqcQ99NM.js → tree-CjVZLRw7.js} +1 -1
  202. package/dist/{useLocalDraft-C07SYRnC.js → useLocalDraft-BnhcxXk_.js} +1 -1
  203. package/dist/{useLocalDraft-Yiw1wFgI.cjs → useLocalDraft-CioIfDb6.cjs} +1 -1
  204. package/dist/vue/async.d.cts +190 -15
  205. package/dist/vue/async.d.ts +190 -15
  206. package/dist/vue/index.d.cts +274 -24
  207. package/dist/vue/index.d.ts +274 -24
  208. package/dist/vue-async.cjs +1 -1
  209. package/dist/vue-async.js +5 -5
  210. package/dist/vue.cjs +1 -1
  211. package/dist/vue.js +90 -81
  212. package/dist/{workbook-session-DNa2RHNG.cjs → workbook-session-Bjv1YCRK.cjs} +18 -18
  213. package/dist/{workbook-session-BPb3TMnT.js → workbook-session-BvToI-Fd.js} +5440 -5288
  214. package/dist/worker.cjs +1 -1
  215. package/dist/worker.d.cts +66 -12
  216. package/dist/worker.d.ts +66 -12
  217. package/dist/worker.js +61 -56
  218. package/dist/xlsx-node.cjs +34 -34
  219. package/dist/xlsx-node.js +878 -870
  220. package/dist/xlsx.cjs +3 -4
  221. package/dist/xlsx.d.cts +22 -10
  222. package/dist/xlsx.d.ts +22 -10
  223. package/dist/xlsx.js +261 -253
  224. package/package.json +2 -2
  225. package/dist/ExcelBindingWizard-CeAf4QSE.js +0 -1465
  226. package/dist/ExcelBindingWizard-y0mT-AHR.cjs +0 -1
  227. package/dist/ParamEditor-BLaE5q5W.js +0 -522
  228. package/dist/ParamEditor-MBBC7lUE.cjs +0 -1
  229. package/dist/ReportBatchPanel-Fp1ePFag.cjs +0 -1
  230. package/dist/ReportPreview-BN6fk7Wz.cjs +0 -6
  231. package/dist/ReportPreview-D2Jkyh1U.js +0 -4243
  232. package/dist/ReportTemplateLibrary-5fk5CQBO.cjs +0 -1
  233. package/dist/RuleEditor-ChRzNQuF.cjs +0 -1
  234. package/dist/RuleEditor-DzAmW5YH.js +0 -2024
  235. package/dist/TemplateReviewPanel-BKofGrV9.js +0 -222
  236. package/dist/TemplateReviewPanel-DwtOcLue.cjs +0 -1
  237. package/dist/assets-C2U-e-Sz.cjs +0 -4
  238. package/dist/assets-Q0wUwNrV.js +0 -217
  239. package/dist/batch-Bt3Fd27Z.cjs +0 -1
  240. package/dist/batch-mRqhhhjt.js +0 -364
  241. package/dist/capabilities-CK_7hizc.js +0 -63
  242. package/dist/capabilities-CsZ-pNHR.cjs +0 -1
  243. package/dist/config-Bb7RiIO5.cjs +0 -1
  244. package/dist/config-XVwG87IA.js +0 -529
  245. package/dist/matrix-DVyWiYsd.cjs +0 -1
  246. package/dist/matrix-yZsGnldA.js +0 -227
  247. package/dist/page-window-index-CIuT4BAv.js +0 -43
  248. package/dist/page-window-index-DEjnM6IB.cjs +0 -1
  249. package/dist/param-validation-BlHHXs6u.js +0 -153
  250. package/dist/param-validation-DCK039V1.cjs +0 -1
  251. package/dist/plugin-D4wizDXB.js +0 -22
  252. package/dist/progress-7OSZbFok.js +0 -39
  253. package/dist/progress-BnLiS5eH.cjs +0 -1
  254. package/dist/task-events-DQ276fn2.cjs +0 -1
  255. package/dist/task-events-Dpsvf_t2.js +0 -47
  256. package/dist/template-registry-D3SjENi6.cjs +0 -1
  257. package/dist/template-review-DGwWOoCv.cjs +0 -2
  258. package/dist/template-review-PgEe_Wr9.js +0 -1742
  259. package/dist/validate-BJ5HIWY8.cjs +0 -1
  260. package/dist/validate-DbgEM1Hh.js +0 -163
@@ -0,0 +1 @@
1
+ "use strict";const Q=require("./matrix-gEO7ZM_u.cjs"),L=require("./computed-CGV2a809.cjs"),Z=require("./render-plan-7xpGrCEl.cjs"),ee=require("./code-options-BUTChiZZ.cjs"),C=require("./param-validation-C3HlcLLO.cjs"),_=require("./tree-BX380Rr7.cjs");function te(e,i,t){e!==void 0&&(typeof e!="string"||!e.trim()||e.length>4096)&&t.push({path:i,message:"来源范围应为不超过 4096 字符的非空字符串"})}function D(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 ie(e,i,t){D(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:"派生结果标记应为布尔值"}),V(e.source,`${i}.source`,t,!0),e.formula!==void 0&&typeof e.formula!="string"&&t.push({path:`${i}.formula`,message:"单元格公式应为字符串"})}function V(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;te(n.sourceScope,`${i}.sourceScope`,t);for(const a of["datasetId",...s?["field"]:[]])(typeof n[a]!="string"||!n[a].trim())&&t.push({path:`${i}.${a}`,message:"业务标识应为非空字符串"});for(const a of["rowKey","revision"]){const o=n[a];o===void 0&&!(s&&a==="rowKey")||typeof o!="string"&&!(typeof o=="number"&&Number.isFinite(o))&&t.push({path:`${i}.${a}`,message:"业务键及修订号应为字符串或有限数字"})}n.sourceToken!==void 0&&typeof n.sourceToken!="string"&&t.push({path:`${i}.sourceToken`,message:"来源令牌应为字符串"})}const se=new Set(["text","image","barcode","qrcode","chart","line","rect","ellipse"]);function p(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ne(e,i,t,s){const n=e[i];(typeof n!="number"||!Number.isFinite(n))&&s.push({path:`${t}.${i}`,message:`应为有限数字,实际 ${JSON.stringify(n)}`})}function ae(e,i,t){if(e!==void 0){const s=`${i}.table`;if(!p(e))t.push({path:s,message:"逻辑表来源应为对象"});else{V(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 a=e.rowIndex;(typeof a!="number"||!Number.isInteger(a)||(n==="header"?a!==-1:a<0))&&t.push({path:`${s}.rowIndex`,message:"表头索引应为 -1,内容行索引应为非负整数"}),(!Array.isArray(e.columnKeys)||e.columnKeys.some(o=>typeof o!="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 oe(e,i,t,s){if(e!==void 0)if(!p(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((a,o)=>{if(!Array.isArray(a)){t.push({path:`${i}.grid.cells.${o}`,message:"行应为数组"});return}a.forEach((f,r)=>{if(f==null)return;const d=`${i}.grid.cells.${o}.${r}`;if(!p(f)){t.push({path:d,message:"网格单元格应为对象或 null"});return}ie(f,d,t),Array.isArray(f.children)&&f.children.forEach((u,g)=>{v(u,`${i}.grid.cells.${o}.${r}.children.${g}`,t,s)})})})}}function fe(e,i,t){e!==void 0&&(Array.isArray(e)?e.forEach((s,n)=>{(!p(s)||!Array.isArray(s.segments))&&t.push({path:`${i}.richParagraphs.${n}`,message:"段落缺少 segments 数组"})}):t.push({path:`${i}.richParagraphs`,message:"richParagraphs 应为数组"}))}function v(e,i,t,s=[]){if(!p(e)){t.push({path:i,message:"组件应为对象"});return}const n=e.kind;typeof n!="string"?t.push({path:`${i}.kind`,message:"组件缺少 kind 字符串"}):se.has(n)||s.push({path:`${i}.kind`,message:`未知组件类型 ${JSON.stringify(n)},将以兜底方式渲染`});for(const a of["leftMm","topMm","widthMm","heightMm"])ne(e,a,i,t);typeof e.leftMm=="number"&&e.leftMm<-100&&t.push({path:`${i}.leftMm`,message:"几何数值异常(leftMm<-100)"});for(const a of["widthMm","heightMm"])typeof e[a]=="number"&&e[a]<0&&t.push({path:`${i}.${a}`,message:"组件尺寸不能为负数"});ae(e.table,i,t),re(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"}),oe(e.grid,i,t,s),fe(e.richParagraphs,i,t)}function re(e,i,t,s){if(e!==void 0)for(const n of ee.codeOptionIssues(e,i))s.push({path:`${t}.code${n.path?`.${n.path}`:""}`,message:n.message})}function J(e,i,t){if(!p(e))return;e.binding!==void 0&&t.push({path:`${i}.binding`,message:"渲染计划不允许未解析字段绑定"});const s=e.grid;!p(s)||!Array.isArray(s.cells)||s.cells.forEach((n,a)=>{Array.isArray(n)&&n.forEach((o,f)=>{!p(o)||!Array.isArray(o.children)||o.children.forEach((r,d)=>J(r,`${i}.grid.cells.${a}.${f}.children.${d}`,t))})})}function j(e,i,t,s=[]){if(!p(e)){t.push({path:i,message:"页应为对象"});return}const n=e.pageWidthMm,a=e.pageHeightMm;(typeof n!="number"||!Number.isFinite(n)||n<=0)&&t.push({path:`${i}.pageWidthMm`,message:`页宽非法: ${JSON.stringify(n)}`}),(typeof a!="number"||!(a>0&&a<5e3))&&t.push({path:`${i}.pageHeightMm`,message:`页高非法: ${JSON.stringify(a)}`}),e.layout!==void 0&&e.layout!=="page"&&e.layout!=="wide"&&t.push({path:`${i}.layout`,message:"布局应为 page 或 wide"});const o=e.components;Array.isArray(o)?Array.isArray(o)&&o.forEach((f,r)=>{v(f,`${i}.components.${r}`,t,s),J(f,`${i}.components.${r}`,t)}):t.push({path:`${i}.components`,message:"components 应为数组"})}function K(e){const i=[],t=[],s=p(e)?e.pages:void 0;if(p(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{s.forEach((a,o)=>j(a,`$.pages.${o}`,i,t)),s.length>2e3&&t.push({path:"$.pages",message:`页数异常大(${s.length} 页),渲染与打印耗时可能显著增加`});const n=s.reduce((a,o)=>a+(p(o)&&Array.isArray(o.components)?o.components.length:0),0);n>5e4&&t.push({path:"$.pages",message:`组件总数异常大(${n} 个),可能触发浏览器性能限制`})}return{ok:i.length===0,errors:i,warnings:t}}function de(e){const i=K(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 T(e){return e.kind==="list"?e.id:e.nid}function ue(e){return e.kind==="list"?!1:e.pageAnchor!==void 0||e.kind==="text"&&typeof e.text=="string"&&/\{(?:page|totalPages)\}/.test(e.text)}function he(e,i){const t=e.filter(n=>i.componentIds.includes(T(n)??""));if(t.filter(n=>n.kind==="list"&&n.cardinality!=="record").length&&t.length!==1)throw new Error("纵向重复区域必须独占流式分段,不能与静态或单记录区域并排");for(const n of t){const a=n.kind==="list"?n.topMm+(n.rowHeightMm??0):n.topMm+n.heightMm;if(n.topMm<i.topMm-.001||a>i.topMm+i.heightMm+.001)throw new Error("流式分段应完整包含其组件的原始纵向范围")}}function me(e,i){if(!i)return e.map(s=>({components:[s]}));const t=new Map(e.map(s=>[T(s),s]));return i.bands.map(s=>({band:s,components:s.componentIds.map(n=>{const a=t.get(n);if(!a)throw new Error(`流式区域引用不存在的组件:${n}`);return a})}))}function H(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(ue(n))continue;const a=T(n);if(!a||t.has(a))throw new Error("流式排版组件应具有唯一标识");t.add(a)}if(ce(e,i,t,s),s.size!==t.size)throw new Error("流式排版必须显式包含每个非锚点组件")}function ce(e,i,t,s){let n=-1/0;for(const a of i.bands){if(!Number.isFinite(a.topMm)||!Number.isFinite(a.heightMm)||a.topMm<0||a.heightMm<=0||a.topMm<n-.001)throw new Error("流式区域应按原始位置排序,尺寸有效且不重叠");if(!Array.isArray(a.componentIds)||!a.componentIds.length)throw new Error("流式区域不能没有组件");for(const o of a.componentIds){if(!t.has(o)||s.has(o))throw new Error(`流式区域组件缺失、重复或包含页锚点:${o}`);s.add(o)}he(e,a),n=a.topMm+a.heightMm}}const ge=new Set(["__proto__","prototype","constructor"]);function l(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function N(e){return typeof e=="string"&&!!e.trim()&&!ge.has(e)}function k(e,i,t,s){for(const n of Object.keys(e))i.includes(n)||s.push({path:`${t}.${n}`,message:"存在未知配置字段"})}function pe(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}k(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 ye(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:"绑定仅支持独立文本、图片、条码与二维码组件"}),k(s,["field","format","prefix","suffix","emptyText"],n,t),N(s.field)||t.push({path:`${n}.field`,message:"绑定字段应为安全的非空字段名(按字面读取自有字段)"});for(const a of["prefix","suffix","emptyText"])s[a]!==void 0&&typeof s[a]!="string"&&t.push({path:`${n}.${a}`,message:"应为字符串"});pe(s.format,`${n}.format`,t),e.kind==="image"&&["format","prefix","suffix"].some(a=>s[a]!==void 0)&&t.push({path:n,message:"图片绑定直接读取 PNG/JPEG data URL,不支持文本格式或前后缀"})}function le(e,i){if(!l(e)){i.push({path:"$.repeat",message:"逐记录配置应为对象"});return}k(e,["dataset","rowKey","copies"],"$.repeat",i),N(e.dataset)||i.push({path:"$.repeat.dataset",message:"数据集应为安全的非空名称"}),e.rowKey!==void 0&&!N(e.rowKey)&&i.push({path:"$.repeat.rowKey",message:"业务主键应为安全的非空字段名"});const t=e.copies;t!==void 0&&(l(t)?(k(t,["field"],"$.repeat.copies",i),N(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 W(e,i,t,s){if(!l(e))return;ye(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((a,o)=>{Array.isArray(a)&&a.forEach((f,r)=>{l(f)&&Array.isArray(f.children)&&f.children.forEach((d,u)=>W(d,`${i}.grid.cells.${o}.${r}.children.${u}`,t,s))})})}function G(e,i){const t=e.repeat!==void 0;t&&le(e.repeat,i),Array.isArray(e.pages)&&e.pages.forEach((s,n)=>{if(!l(s))return;const a=`$.pages.${n}`;t&&(s.layout==="wide"||s.flow!==void 0)&&i.push({path:a,message:"逐记录标签仅支持固定尺寸页面,不支持宽表或流式分区"}),Array.isArray(s.components)&&s.components.forEach((o,f)=>{const r=`${a}.components.${f}`;if(W(o,r,t,i),!t||!l(o))return;const{leftMm:d,topMm:u,widthMm:g,heightMm:y}=o;[d,u,g,y,s.widthMm,s.heightMm].every(A=>typeof A=="number"&&Number.isFinite(A))&&(Number(d)<0||Number(u)<0||Number(d)+Number(g)>Number(s.widthMm)+.001||Number(u)+Number(y)>Number(s.heightMm)+.001)&&i.push({path:r,message:"标签组件超出纸张边界,请调整位置或尺寸"})})})}function U(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function R(e,i,t){if(e!==void 0){if(!U(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 q(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,a)=>{const o=`${i}.${a}`;if(!U(n)){t.push({path:o,message:"聚合应为对象"});return}const f=n.field;typeof f!="string"||!f.trim()||s.has(f)?t.push({path:`${o}.field`,message:"聚合输出字段应非空且唯一"}):s.add(f),n.numeric!==void 0&&n.numeric!=="number"&&n.numeric!=="decimal"&&t.push({path:`${o}.numeric`,message:"数值模式应为 number 或 decimal"}),n.digits!==void 0&&(!Number.isInteger(n.digits)||Number(n.digits)<0||Number(n.digits)>100)&&t.push({path:`${o}.digits`,message:"小数位应为 0–100 的整数"});try{L.createAggregateAccumulator({...n,field:n.valueField??f})}catch(r){t.push({path:o,message:r instanceof Error?r.message:String(r)})}})}function $e(e,i,t){if(e===void 0)return;const s=L.validateComputedFields(e);for(const n of s.errors)t.push({path:i,message:n})}function be(e,i,t){if(e!==void 0)try{Q.validateMatrixOptions(e)}catch(s){t.push({path:i,message:s instanceof Error?s.message:String(s)})}}function Ae(e,i,t){if(e.tree===void 0)return;const s=`${i}.tree`;try{_.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(a=>a&&a.field===n.labelField&&!a.hidden))throw new Error("树形布局需要可见的标签列");Array.isArray(e.computed)&&_.validateTreeComputed(n,e.computed)}catch(n){t.push({path:s,message:n instanceof Error?n.message:String(n)})}}const O="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 we=new Set(["__proto__","prototype","constructor"]),Me=new Set(["schemaVersion","id","name","revision","description","template"]),ve=new Set(["left","center","right","justify"]),E=2e5,Ne=64,P=1e7;function h(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ee(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 a=Object.keys(e);if(a.length!==e.length||a.some(o=>!/^(0|[1-9]\d*)$/.test(o)||Number(o)>=e.length))return t.push({path:i,message:"模板数组不能包含空位或额外属性"}),!1}return Object.getOwnPropertySymbols(e).length>0?(t.push({path:i,message:"模板不能包含 Symbol 键"}),!1):!0}function ke(e,i,t,s){return we.has(e)?(s.push({path:t,message:"模板不能包含可能污染原型的键"}),!1):i.get||i.set||!i.enumerable?(s.push({path:t,message:"模板不能包含访问器或不可枚举字段"}),!1):!0}function Se(e){return e===null||typeof e=="boolean"||typeof e=="number"&&Number.isFinite(e)}function F(e,i){const t=new Set;let s=0,n=0,a=!1;const o=(f,r,d)=>{if(!a){if(++s>E){s===E+1&&i.push({path:r,message:"模板超过 JSON 节点安全上限"});return}if(d>Ne){i.push({path:r,message:"模板嵌套层级过深"});return}if(typeof f=="string"){n+=f.length,n>P&&(a=!0,i.push({path:r,message:"模板文本超过 1000 万字符的安全上限"}));return}if(!Se(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(Ee(f,r,i)){t.add(f);for(const[u,g]of Object.entries(Object.getOwnPropertyDescriptors(f))){if(Array.isArray(f)&&u==="length")continue;const y=`${r}.${u}`;if(ke(u,g,y,i)&&o(g.value,y,d+1),s>E||a)break}t.delete(f)}}}};o(e,"$",0)}function m(e,i,t,s,n=!1){const a=e[i];a===void 0&&!n||(typeof a!="string"||n&&!a.trim())&&s.push({path:`${t}.${i}`,message:n?"应为非空字符串":"应为字符串"})}function c(e,i,t,s,n=0,a=!1){const o=e[i];o===void 0&&!a||(typeof o!="number"||!Number.isFinite(o)||o<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&&!ve.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 xe(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((a,o)=>{const f=`${i}.${o}`;if(!h(a)){t.push({path:f,message:"参数定义应为对象"});return}m(a,"field",f,t,!0),typeof a.field=="string"&&(s.has(a.field)&&t.push({path:`${f}.field`,message:"参数名重复"}),s.add(a.field)),a.type!==void 0&&!["text","number","date","month","year","dateRange","select"].includes(a.type)&&t.push({path:`${f}.type`,message:"未知参数类型"});for(const r of["label","defaultValue","placeholder"])m(a,r,f,t);b(a,"required",f,t);for(const r of["minLength","maxLength"]){const d=a[r];d!==void 0&&(typeof d!="number"||!Number.isSafeInteger(d)||d<0)&&t.push({path:`${f}.${r}`,message:"长度边界应为非负整数"})}Re(a,f,t),a.options!==void 0&&(Array.isArray(a.options)?a.options.forEach((r,d)=>{const u=`${f}.options.${d}`;if(!h(r))t.push({path:u,message:"选项应为对象"});else for(const g of["label","value"])typeof r[g]!="string"&&t.push({path:`${u}.${g}`,message:"选项标签与值应为字符串(允许空白选项)"})}):t.push({path:`${f}.options`,message:"选项应为数组"}))}),t.length===n&&t.push(...C.validateReportParamDefinitions(e).map(a=>({path:a.path.replace("$.paramDefs",i),message:a.message})))}function Re(e,i,t){for(const a of["min","max"]){const o=e[a];if(o===void 0)continue;C.isReportTemporalBound(e.type,o)||e.type==="number"&&typeof o=="number"&&Number.isFinite(o)||t.push({path:`${i}.${a}`,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 B(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 a=`${i}.${n}`;if(!h(s)){t.push({path:a,message:"列应为对象"});return}if(D(s,a,t),b(s,"hidden",a,t),R(s.visibleWhen,`${a}.visibleWhen`,t),typeof s.header!="string"&&t.push({path:`${a}.header`,message:"表头应为字符串(允许空白表头)"}),m(s,"field",a,t,!0),c(s,"widthMm",a,t,Number.MIN_VALUE,!0),$(s.style,`${a}.style`,t),$(s.headerStyle,`${a}.headerStyle`,t),M(s.align,`${a}.align`,t,!0),M(s.headerAlign,`${a}.headerAlign`,t),s.semanticRole!==void 0&&!["identifier","dimension","measure","date","text"].includes(s.semanticRole)&&t.push({path:`${a}.semanticRole`,message:"未知列语义"}),s.format!==void 0)if(!h(s.format)||!["number","percent","date"].includes(s.format.kind))t.push({path:`${a}.format`,message:"未知列格式"});else{const o=s.format.digits;o!==void 0&&(typeof o!="number"||!Number.isInteger(o)||o<0||o>100)&&t.push({path:`${a}.format.digits`,message:"小数位应为 0–100 的整数"}),b(s.format,"thousands",`${a}.format`,t),m(s.format,"pattern",`${a}.format`,t)}s.rules!==void 0&&(Array.isArray(s.rules)?s.rules.forEach((o,f)=>{const r=`${a}.rules.${f}`;if(!h(o)||!h(o.when)){t.push({path:r,message:"条件格式缺少 when 对象"});return}R(o.when,`${r}.when`,t),m(o.when,"field",`${r}.when`,t,!0),[">",">=","<","<=","==","!="].includes(o.when.op)||t.push({path:`${r}.when.op`,message:"未知条件运算符"}),typeof o.when.value!="number"&&typeof o.when.value!="string"&&t.push({path:`${r}.when.value`,message:"条件值应为数字或字符串"}),$(o.style,`${r}.style`,t)}):t.push({path:`${a}.rules`,message:"条件格式应为数组"}))})}function z(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),q(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 Te(e,i,t){if(!(e===void 0||typeof e=="boolean")){if(!h(e)){t.push({path:i,message:"合计应为布尔值或对象"});return}m(e,"label",i,t),q(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 Oe(e,i,t,s){const n={kind:"rect",leftMm:0,topMm:0,widthMm:1,heightMm:1,grid:e};if(v(n,t,s,[]),I(n,t,s),!h(e)||!Array.isArray(e.cells))return;const a=e.cells,o=Array.isArray(i)?i.length:0;if(a.length*o>E){s.push({path:t,message:"表头逻辑网格超过 20 万格安全上限"});return}e.cells.length||s.push({path:`${t}.cells`,message:"表头至少需要一行"}),Array.isArray(e.colWidthsMm)&&e.colWidthsMm.length!==o&&s.push({path:`${t}.colWidthsMm`,message:"表头列宽数量应与列表列数一致"}),Array.isArray(e.rowHeightsMm)&&e.rowHeightsMm.length!==e.cells.length&&s.push({path:`${t}.rowHeightsMm`,message:"表头行高数量应与行数一致"}),Pe(a,o,t,s)}function Pe(e,i,t,s){const n=new Set;e.forEach((a,o)=>{if(!Array.isArray(a))return;let f=0;a.forEach((r,d)=>{for(;n.has(`${o}:${f}`);)f++;const u=h(r)&&typeof r.colSpan=="number"?r.colSpan:1,g=h(r)&&typeof r.rowSpan=="number"?r.rowSpan:1;(f+u>i||o+g>e.length)&&s.push({path:`${t}.cells.${o}.${d}`,message:"表头合并区域超出表头边界"});for(let y=o;y<Math.min(e.length,o+g);y++)for(let A=f;A<Math.min(i,f+u);A++)n.has(`${y}:${A}`)&&s.push({path:`${t}.cells.${o}.${d}`,message:"表头合并区域重叠"}),n.add(`${y}:${A}`);f+=u})})}function Fe(e,i,t){if(Ae(e,i,t),$e(e.computed,`${i}.computed`,t),be(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 汇总,不能同时配置普通分组、总计或主从明细"}),R(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((a,o)=>z(a,`${i}.groups.${o}`,t))),e.detail===void 0)return;const s=e.detail,n=`${i}.detail`;if(!h(s)){t.push({path:n,message:"主从关联应为对象"});return}for(const a of["dataset","parentKey","foreignKey"])m(s,a,n,t,!0);for(const a of["rowKey","revisionField","sourceTokenField"])m(s,a,n,t,s[a]!==void 0);m(s,"label",n,t),b(s,"header",n,t),c(s,"rowHeightMm",n,t,Number.MIN_VALUE),B(s.columns,`${n}.columns`,t),s.unmatched!==void 0&&s.unmatched!=="error"&&s.unmatched!=="ignore"&&t.push({path:`${n}.unmatched`,message:"未关联明细策略应为 error 或 ignore"})}function Ie(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&&Oe(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"}),B(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),Fe(e,i,t),z(e.groupBy,`${i}.groupBy`,t),Te(e.grandTotal,`${i}.grandTotal`,t)}function I(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:"文本行应为字符串数组"}),Array.isArray(e.richParagraphs)&&e.richParagraphs.forEach((n,a)=>{if(!h(n))return;const o=`${i}.richParagraphs.${a}`;M(n.align,`${o}.align`,t);for(const f of["lineHeight","spaceBeforeMm","spaceAfterMm","indentMm"])c(n,f,o,t);Array.isArray(n.segments)&&n.segments.forEach((f,r)=>{const d=`${o}.segments.${r}`;if(!h(f)){t.push({path:d,message:"富文本片段应为对象"});return}f.kind!==void 0&&f.kind!=="text"&&f.kind!=="field"&&t.push({path:`${d}.kind`,message:"未知富文本片段类型"});for(const u of["text","field"])m(f,u,d,t);$(f.style,`${d}.style`,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 a=s[n];a!==void 0&&(!Array.isArray(a)||a.some(o=>typeof o!="number"||!Number.isFinite(o)||o<0))&&t.push({path:`${i}.grid.${n}`,message:"网格尺寸应为有限非负数字数组"})}Array.isArray(s.cells)&&s.cells.forEach((n,a)=>{Array.isArray(n)&&n.forEach((o,f)=>{const r=`${i}.grid.cells.${a}.${f}`;if(o!==null){if(!h(o)){t.push({path:r,message:"网格单元格应为对象或 null"});return}for(const d of["text","rawText","numberFormat"])m(o,d,r,t);for(const d of["colSpan","rowSpan"]){const u=o[d];u!==void 0&&(typeof u!="number"||!Number.isInteger(u)||u<=0)&&t.push({path:`${r}.${d}`,message:"跨度应为正整数"})}o.value!==void 0&&o.value!==null&&!["string","number","boolean"].includes(typeof o.value)&&t.push({path:`${r}.value`,message:"Excel 原始值应为字符串、数字、布尔值或 null"}),$(o.style,`${r}.style`,t),o.children!==void 0&&(Array.isArray(o.children)?o.children.forEach((d,u)=>{h(d)&&I(d,`${r}.children.${u}`,t)}):t.push({path:`${r}.children`,message:"嵌套组件应为数组"}))}})})}function _e(e,i,t){if(!(e.flow===void 0||!Array.isArray(e.components)))try{H(e.components,e.flow)}catch(s){t.push({path:`${i}.flow`,message:s instanceof Error?s.message:String(s)})}}function X(e){const i=[],t=[];return F(e,i),i.length?{ok:!1,errors:i,warnings:t}:(h(e)?(e.schemaVersion!==void 0&&e.schemaVersion!==Z.RENDER_PLAN_SCHEMA_VERSION&&i.push({path:"$.schemaVersion",message:"不支持的模板 schemaVersion"}),xe(e.params,"$.params",i),G(e,i),!Array.isArray(e.pages)||e.pages.length===0?i.push({path:"$.pages",message:"模板至少需要一页"}):e.pages.forEach((s,n)=>{const a=`$.pages.${n}`;if(!h(s)){i.push({path:a,message:"页应为对象"});return}c(s,"widthMm",a,i,Number.MIN_VALUE,!0),c(s,"heightMm",a,i,Number.MIN_VALUE,!0),s.layout!==void 0&&s.layout!=="page"&&s.layout!=="wide"&&i.push({path:`${a}.layout`,message:"布局应为 page 或 wide"}),typeof s.heightMm=="number"&&s.heightMm>=5e3&&i.push({path:`${a}.heightMm`,message:"页高应小于 5000mm"});for(const o of["marginTopMm","marginBottomMm","marginLeftMm","marginRightMm"])c(s,o,a,i);typeof s.widthMm=="number"&&Number(s.marginLeftMm??0)+Number(s.marginRightMm??0)>=s.widthMm&&i.push({path:a,message:"横向页边距占满页面"}),typeof s.heightMm=="number"&&Number(s.marginTopMm??0)+Number(s.marginBottomMm??0)>=s.heightMm&&i.push({path:a,message:"纵向页边距占满页面"}),Array.isArray(s.components)?s.components.forEach((o,f)=>{const r=`${a}.components.${f}`;h(o)&&o.kind==="list"?Ie(o,r,i):(v(o,r,i,t),h(o)&&I(o,r,i))}):i.push({path:`${a}.components`,message:"组件应为数组"}),_e(s,a,i)})):i.push({path:"$",message:"模板应为对象"}),{ok:i.length===0,errors:i,warnings:t})}function Y(e){const i=[],t=[];if(F(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))Me.has(n)||i.push({path:`$.${n}`,message:"模板文档存在未知字段;只保存模板与描述,不保存取数或业务数据"});e.schemaVersion!==O&&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=X(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 x(e){const i=Y(e);if(!i.ok)throw new w(i.errors)}function Le(e){const i=[];if(F(e,i),i.length)throw new w(i);const t={...e,schemaVersion:e.schemaVersion??O};return x(t),S(t)}function Ce(e){let i=e;if(typeof e=="string"){if(e.length>P)throw new w([{path:"$",message:"模板 JSON 超过 1000 万字符的导出/导入上限"}]);try{i=JSON.parse(e)}catch{throw new w([{path:"$",message:"模板 JSON 语法无效"}])}}return x(i),S(i)}function De(e){x(e);const i=JSON.stringify(e,null,2);if(i.length>P)throw new w([{path:"$",message:"模板 JSON 超过 1000 万字符的导出/导入上限"}]);return i}function S(e){return JSON.parse(JSON.stringify(e))}function Ve(e=[]){const i=new Map,t={get:s=>{const n=i.get(s);return n?S(n):void 0},list:()=>Array.from(i.values(),({template:s,...n})=>({...n})),register:(s,n={})=>{if(x(s),i.has(s.id)&&!n.replace)throw new w([{path:"$.id",message:`模板 ID ${s.id} 已注册;更新需显式 replace:true`}]);i.set(s.id,S(s))},remove:s=>i.delete(s)};for(const s of e)t.register(s);return t}exports.REPORT_TEMPLATE_DOCUMENT_VERSION=O;exports.ReportTemplateError=w;exports.assertRenderPlan=de;exports.createTemplateRegistry=Ve;exports.defineReportTemplate=Le;exports.parseReportTemplate=Ce;exports.reportFlowGroups=me;exports.serializeReportTemplate=De;exports.validateComponent=v;exports.validatePage=j;exports.validateRenderPlan=K;exports.validateReportPageFlow=H;exports.validateReportTemplate=X;exports.validateReportTemplateDocument=Y;exports.validateTemplateRepeat=G;
@@ -0,0 +1,4 @@
1
+ "use strict";const w=require("./defaults-xhmcLLrf.cjs"),M=/[\u3000-\u9fff\uff00-\uffef]/,s=new Uint8Array(128);{for(const t of"iljtf.,:;'`|!()[]")s[t.charCodeAt(0)]=1;for(const t of"mwMW@")s[t.charCodeAt(0)]=2;for(let t=48;t<=57;t++)s[t]=3;for(let t=65;t<=90;t++)s[t]=4;s[32]=5}const g=[.54,.26,.95,.59,.67,.3];function d(t){const e=t.charCodeAt(0);return e<128?g[s[e]]:M.test(t)?1:/[A-Z]/.test(t)?.67:.54}const o={measureMm(t,e){const{fontSizePt:i,bold:c=!1,letterSpacingPt:u=0}=e,r=25.4/72;let n=0;for(const h of t)n+=d(h);return c&&(n*=1.04),(n*i+u*Math.max(0,Array.from(t).length-1))*r}};function p(){return o}function A(t,e){return o.measureMm(t,e)}function x(t){let e;return{measureMm(i,c){if(e===void 0&&(e=t()),!e)return o.measureMm(i,c);const u=c.fontSizePt*96/72;e.font=`${c.italic?"italic ":""}${c.bold?"bold ":""}${u}px ${c.fontFamily??w.DEFAULT_FONT_FAMILY}`,"letterSpacing"in e&&(e.letterSpacing="0px");const r=(c.letterSpacingPt??0)*Math.max(0,Array.from(i).length-1);return e.measureText(i).width*25.4/96+r*25.4/72}}}function T(t,e,i){const c=[];let u="";const r=()=>{u&&(c.push({text:u,widthMm:i.measureMm(u,e),cjk:!1}),u="")};for(const n of t){if(n===`
2
+ `){r(),c.push({text:`
3
+ `,widthMm:0,cjk:!1,br:!0});continue}if(n===" "){r(),c.push({text:n,widthMm:i.measureMm(n,e),cjk:!1,space:!0});continue}if(M.test(n)){r(),c.push({text:n,widthMm:i.measureMm(n,e),cjk:!0});continue}u+=n}return r(),c}function S(t,e,i,c=o){if(!t)return[""];t=t.replace(/\r\n?/g,`
4
+ `);const u=[];let r="",n=0;const h=(i.letterSpacingPt??0)*25.4/72,a=()=>{u.push(r),r="",n=0};for(const f of T(t,i,c)){if(f.br){a();continue}const m=r.length>0?h:0;if(n+m+f.widthMm<=e){r+=f.text,n+=m+f.widthMm;continue}if(f.space){a();continue}if(f.cjk){r.length>0&&a(),r=f.text,n=f.widthMm;continue}if(r.length>0&&a(),f.widthMm<=e){r=f.text,n=f.widthMm;continue}for(const l of f.text)c.measureMm(r+l,i)>e&&r.length>0&&a(),r+=l,n=c.measureMm(r,i)}return a(),u}exports.charWidthEm=d;exports.createCanvasMeasurer=x;exports.createHeuristicMeasurer=p;exports.heuristicMeasurer=o;exports.measureTextMm=A;exports.wrapText=S;
@@ -0,0 +1,110 @@
1
+ import { D as M } from "./defaults-DXhiM1ZD.js";
2
+ const d = /[\u3000-\u9fff\uff00-\uffef]/, s = new Uint8Array(128);
3
+ {
4
+ for (const t of "iljtf.,:;'`|!()[]") s[t.charCodeAt(0)] = 1;
5
+ for (const t of "mwMW@") s[t.charCodeAt(0)] = 2;
6
+ for (let t = 48; t <= 57; t++) s[t] = 3;
7
+ for (let t = 65; t <= 90; t++) s[t] = 4;
8
+ s[32] = 5;
9
+ }
10
+ const w = [0.54, 0.26, 0.95, 0.59, 0.67, 0.3];
11
+ function g(t) {
12
+ const e = t.charCodeAt(0);
13
+ return e < 128 ? w[s[e]] : d.test(t) ? 1 : /[A-Z]/.test(t) ? 0.67 : 0.54;
14
+ }
15
+ const o = {
16
+ measureMm(t, e) {
17
+ const { fontSizePt: i, bold: c = !1, letterSpacingPt: f = 0 } = e, n = 25.4 / 72;
18
+ let r = 0;
19
+ for (const h of t)
20
+ r += g(h);
21
+ return c && (r *= 1.04), (r * i + f * Math.max(0, Array.from(t).length - 1)) * n;
22
+ }
23
+ };
24
+ function S() {
25
+ return o;
26
+ }
27
+ function T(t, e) {
28
+ return o.measureMm(t, e);
29
+ }
30
+ function b(t) {
31
+ let e;
32
+ return {
33
+ measureMm(i, c) {
34
+ if (e === void 0 && (e = t()), !e) return o.measureMm(i, c);
35
+ const f = c.fontSizePt * 96 / 72;
36
+ e.font = `${c.italic ? "italic " : ""}${c.bold ? "bold " : ""}${f}px ${c.fontFamily ?? M}`, "letterSpacing" in e && (e.letterSpacing = "0px");
37
+ const n = (c.letterSpacingPt ?? 0) * Math.max(0, Array.from(i).length - 1);
38
+ return e.measureText(i).width * 25.4 / 96 + n * 25.4 / 72;
39
+ }
40
+ };
41
+ }
42
+ function p(t, e, i) {
43
+ const c = [];
44
+ let f = "";
45
+ const n = () => {
46
+ f && (c.push({ text: f, widthMm: i.measureMm(f, e), cjk: !1 }), f = "");
47
+ };
48
+ for (const r of t) {
49
+ if (r === `
50
+ `) {
51
+ n(), c.push({ text: `
52
+ `, widthMm: 0, cjk: !1, br: !0 });
53
+ continue;
54
+ }
55
+ if (r === " ") {
56
+ n(), c.push({ text: r, widthMm: i.measureMm(r, e), cjk: !1, space: !0 });
57
+ continue;
58
+ }
59
+ if (d.test(r)) {
60
+ n(), c.push({ text: r, widthMm: i.measureMm(r, e), cjk: !0 });
61
+ continue;
62
+ }
63
+ f += r;
64
+ }
65
+ return n(), c;
66
+ }
67
+ function j(t, e, i, c = o) {
68
+ if (!t) return [""];
69
+ t = t.replace(/\r\n?/g, `
70
+ `);
71
+ const f = [];
72
+ let n = "", r = 0;
73
+ const h = (i.letterSpacingPt ?? 0) * 25.4 / 72, u = () => {
74
+ f.push(n), n = "", r = 0;
75
+ };
76
+ for (const a of p(t, i, c)) {
77
+ if (a.br) {
78
+ u();
79
+ continue;
80
+ }
81
+ const m = n.length > 0 ? h : 0;
82
+ if (r + m + a.widthMm <= e) {
83
+ n += a.text, r += m + a.widthMm;
84
+ continue;
85
+ }
86
+ if (a.space) {
87
+ u();
88
+ continue;
89
+ }
90
+ if (a.cjk) {
91
+ n.length > 0 && u(), n = a.text, r = a.widthMm;
92
+ continue;
93
+ }
94
+ if (n.length > 0 && u(), a.widthMm <= e) {
95
+ n = a.text, r = a.widthMm;
96
+ continue;
97
+ }
98
+ for (const l of a.text)
99
+ c.measureMm(n + l, i) > e && n.length > 0 && u(), n += l, r = c.measureMm(n, i);
100
+ }
101
+ return u(), f;
102
+ }
103
+ export {
104
+ b as a,
105
+ S as b,
106
+ g as c,
107
+ o as h,
108
+ T as m,
109
+ j as w
110
+ };
@@ -1,4 +1,4 @@
1
- import { d as A, e as w } from "./computed-Bvk0W15F.js";
1
+ import { e as A, c as w } from "./computed-C-4C2S5h.js";
2
2
  class b extends Error {
3
3
  constructor(r) {
4
4
  super(`树节点超出行数预算 ${r}`), this.limit = r, this.code = "tree-row-limit", this.name = "TreeRowLimitError";
@@ -4,7 +4,7 @@ function r(o) {
4
4
  function e() {
5
5
  n.value = t();
6
6
  }
7
- return e(), { pending: a, snapshot: t, accept: e };
7
+ return e(), { pending: a, snapshot: t, accept: e, baseline: n };
8
8
  }
9
9
  export {
10
10
  r as u
@@ -1 +1 @@
1
- "use strict";const c=require("vue");function a(s){const e=c.ref(""),t=()=>JSON.stringify(s()),u=c.computed(()=>e.value!==""&&t()!==e.value);function n(){e.value=t()}return n(),{pending:u,snapshot:t,accept:n}}exports.useLocalDraft=a;
1
+ "use strict";const c=require("vue");function a(s){const e=c.ref(""),t=()=>JSON.stringify(s()),u=c.computed(()=>e.value!==""&&t()!==e.value);function n(){e.value=t()}return n(),{pending:u,snapshot:t,accept:n,baseline:e}}exports.useLocalDraft=a;
@@ -29,7 +29,7 @@ declare interface AssetRenderBudget {
29
29
  /** Wall-clock budget, including adapters that ignore AbortSignal. Default 30 seconds. */
30
30
  maxDurationMs?: number;
31
31
  }
32
- declare interface AssetRenderOptions extends OutputDiagnosticOptions {
32
+ declare interface AssetRenderOptions extends OutputDiagnosticOptions, ImageMediaOptions {
33
33
  assetRenderers?: Partial<Record<ImageComponentKind, ComponentImageRenderer>>;
34
34
  assetBudget?: AssetRenderBudget;
35
35
  /** Default throw prevents an incomplete export; placeholder retains the component and emits diagnostics. */
@@ -432,6 +432,30 @@ declare interface GridCell_3 {
432
432
  style?: ComponentStyle_3;
433
433
  }
434
434
  declare type ImageComponentKind = "image" | "chart" | "barcode" | "qrcode";
435
+ /** Bounded binary image inspection shared by PDF, Excel and template import. No decoder is loaded. */
436
+ declare interface ImageMediaOptions {
437
+ maxImageBytes?: number;
438
+ maxTotalImageBytes?: number;
439
+ maxImages?: number;
440
+ /** Decoded pixels per unique image, default 16 million. */
441
+ maxImagePixels?: number;
442
+ /** Total decoded pixels for unique media, default 64 million. */
443
+ maxTotalImagePixels?: number;
444
+ /** Maximum source dimension, default 16384 pixels. */
445
+ maxImageDimension?: number;
446
+ }
447
+ /** Bounded binary image inspection shared by PDF, Excel and template import. No decoder is loaded. */
448
+ declare interface ImageMediaOptions_2 {
449
+ maxImageBytes?: number;
450
+ maxTotalImageBytes?: number;
451
+ maxImages?: number;
452
+ /** Decoded pixels per unique image, default 16 million. */
453
+ maxImagePixels?: number;
454
+ /** Total decoded pixels for unique media, default 64 million. */
455
+ maxTotalImagePixels?: number;
456
+ /** Maximum source dimension, default 16384 pixels. */
457
+ maxImageDimension?: number;
458
+ }
435
459
  /** auto:真实数字/显式数值格式居右,日期与布尔居中,其他内容居左。 */
436
460
  declare type ListAlignment = NonNullable<ComponentStyle["align"]> | "auto";
437
461
  /** auto:真实数字/显式数值格式居右,日期与布尔居中,其他内容居左。 */
@@ -681,6 +705,9 @@ declare interface MachReportConfig {
681
705
  }
682
706
  /** defaults 层可配置项(全部可选,均有内置缺省) */
683
707
  declare interface MachReportDefaults {
708
+ drill?: ReportDrillOptions;
709
+ loadParamOptions?: ReportParamOptionsLoader;
710
+ printOptions?: ReportPrintOptions;
684
711
  showExport?: boolean;
685
712
  showPrint?: boolean;
686
713
  showPdfWindow?: boolean;
@@ -727,7 +754,11 @@ declare type MachReportLogger = Pick<Console, "warn" | "info">;
727
754
  * - 优先级:组件 props > 路由级叠加 > preset > defaults(props 永远最高)
728
755
  */
729
756
  /** 工具栏与状态文案(默认简体中文;出海场景覆写) */
730
- declare interface MachReportMessages extends Partial<ReportCalculationMessages> {
757
+ declare interface MachReportMessages extends Partial<ReportCalculationMessages>, ReportPrintMessages, ReportParamOptionsMessages {
758
+ drillActions?: string;
759
+ drillOpening?: string;
760
+ drillMissingValue?: string;
761
+ drillFailed?: string;
731
762
  exportMenu?: string;
732
763
  exportMenuDescription?: string;
733
764
  clearSearch?: string;
@@ -738,6 +769,13 @@ declare interface MachReportMessages extends Partial<ReportCalculationMessages>
738
769
  pageJumpHint?: string;
739
770
  pagination?: string;
740
771
  recordNavigation?: string;
772
+ dataExplanation?: string;
773
+ dataExplanationHint?: string;
774
+ dataExplanationSearch?: string;
775
+ dataExplanationEmpty?: string;
776
+ dataMissingSource?: string;
777
+ dataNotApplicable?: string;
778
+ dataNotCalculable?: string;
741
779
  recordInfo?: string;
742
780
  prevRecord?: string;
743
781
  nextRecord?: string;
@@ -1005,7 +1043,7 @@ declare interface MatrixTableOptions_2 {
1005
1043
  maxCells?: number;
1006
1044
  }
1007
1045
  declare interface OutputDiagnostic {
1008
- code: "missing-image" | "unsupported-component" | "unsupported-image-format" | "unsupported-style" | "rich-text-flattened" | "nested-components-omitted" | "async-image-required" | "image-decode-failed" | "asset-render-failed" | "asset-budget-exceeded";
1046
+ code: "invalid-image-data" | "image-budget-exceeded" | "component-render-failed" | "unsupported-text" | "output-degraded" | "missing-image" | "unsupported-component" | "unsupported-image-format" | "unsupported-style" | "rich-text-flattened" | "nested-components-omitted" | "async-image-required" | "image-decode-failed" | "asset-render-failed" | "asset-budget-exceeded";
1009
1047
  severity: "warning";
1010
1048
  format: OutputFormat;
1011
1049
  pageIndex: number;
@@ -1017,7 +1055,7 @@ declare interface OutputDiagnostic {
1017
1055
  message: string;
1018
1056
  }
1019
1057
  declare interface OutputDiagnostic_2 {
1020
- code: "missing-image" | "unsupported-component" | "unsupported-image-format" | "unsupported-style" | "rich-text-flattened" | "nested-components-omitted" | "async-image-required" | "image-decode-failed" | "asset-render-failed" | "asset-budget-exceeded";
1058
+ code: "invalid-image-data" | "image-budget-exceeded" | "component-render-failed" | "unsupported-text" | "output-degraded" | "missing-image" | "unsupported-component" | "unsupported-image-format" | "unsupported-style" | "rich-text-flattened" | "nested-components-omitted" | "async-image-required" | "image-decode-failed" | "asset-render-failed" | "asset-budget-exceeded";
1021
1059
  severity: "warning";
1022
1060
  format: OutputFormat_2;
1023
1061
  pageIndex: number;
@@ -1391,6 +1429,8 @@ declare interface ReportCellSelection {
1391
1429
  }
1392
1430
  /** 可持久化的业务身份与计划坐标独立;权限及并发校验仍由业务服务器执行。 */
1393
1431
  declare interface ReportCellSource {
1432
+ /** Source identity across report occurrences; sharing must be explicitly declared. */
1433
+ sourceScope?: string;
1394
1434
  datasetId: string;
1395
1435
  rowKey: string | number;
1396
1436
  field: string;
@@ -1399,6 +1439,8 @@ declare interface ReportCellSource {
1399
1439
  }
1400
1440
  /** 可持久化的业务身份与计划坐标独立;权限及并发校验仍由业务服务器执行。 */
1401
1441
  declare interface ReportCellSource_2 {
1442
+ /** Source identity across report occurrences; sharing must be explicitly declared. */
1443
+ sourceScope?: string;
1402
1444
  datasetId: string;
1403
1445
  rowKey: string | number;
1404
1446
  field: string;
@@ -1407,6 +1449,8 @@ declare interface ReportCellSource_2 {
1407
1449
  }
1408
1450
  /** 可持久化的业务身份与计划坐标独立;权限及并发校验仍由业务服务器执行。 */
1409
1451
  declare interface ReportCellSource_3 {
1452
+ /** Source identity across report occurrences; sharing must be explicitly declared. */
1453
+ sourceScope?: string;
1410
1454
  datasetId: string;
1411
1455
  rowKey: string | number;
1412
1456
  field: string;
@@ -1430,7 +1474,27 @@ declare interface ReportCellTableIdentity_2 {
1430
1474
  declare type ReportCellValue = string | number | boolean | null;
1431
1475
  declare type ReportCellValue_2 = string | number | boolean | null;
1432
1476
  declare type ReportCellValueType = NonNullable<GridCell_2["valueType"]>;
1477
+ declare interface ReportDataTarget {
1478
+ datasetId: string;
1479
+ field: string;
1480
+ rowKey?: string | number;
1481
+ /** Use table identity when the same dataset appears in several tables. */
1482
+ tableId?: string;
1483
+ /** Assigned by the source/runtime when several reports share dataset names. */
1484
+ reportScope?: string;
1485
+ }
1486
+ declare interface ReportDataTarget_2 {
1487
+ datasetId: string;
1488
+ field: string;
1489
+ rowKey?: string | number;
1490
+ /** Use table identity when the same dataset appears in several tables. */
1491
+ tableId?: string;
1492
+ /** Assigned by the source/runtime when several reports share dataset names. */
1493
+ reportScope?: string;
1494
+ }
1433
1495
  declare interface ReportDefinition {
1496
+ /** Explicitly shared editable data identity. Omit to isolate each report occurrence. */
1497
+ sourceScope?: string;
1434
1498
  /** 静态模板或宿主提供的异步模板加载器;动态模板默认每次重新读取,不缓存版本。 */
1435
1499
  template: ReportTemplate | ReportTemplateLoader;
1436
1500
  /** 静态数据;load 存在时优先使用 load 的结果。 */
@@ -1450,8 +1514,54 @@ declare interface ReportDiagnostic {
1450
1514
  message: string;
1451
1515
  path?: string;
1452
1516
  severity: "warning" | "error" | "info";
1517
+ /** Optional explanation supplied by the business source, not inferred from blank cells. */
1518
+ valueState?: ReportValueState;
1519
+ target?: ReportDataTarget;
1453
1520
  }
1454
1521
  declare type ReportDiscardReason = "reload" | "import" | "replace" | "leave";
1522
+ /** Serializable action metadata. URLs, scripts and automatic navigation are deliberately absent. */
1523
+ declare interface ReportDrillAction {
1524
+ id: string;
1525
+ label: string;
1526
+ target: {
1527
+ field: string;
1528
+ datasetId?: string;
1529
+ reportScope?: string;
1530
+ roles?: readonly string[];
1531
+ };
1532
+ params?: Readonly<Record<string, ReportDrillBinding>>;
1533
+ }
1534
+ declare type ReportDrillBinding = {
1535
+ value: string | number | boolean;
1536
+ } | {
1537
+ from: "value" | "rowKey";
1538
+ } | {
1539
+ from: "query" | "field";
1540
+ field: string;
1541
+ };
1542
+ /** Trusted host-owned allowlist. Matching serialized metadata alone never executes an action. */
1543
+ declare interface ReportDrillOptions {
1544
+ actions: readonly ReportDrillAction[];
1545
+ open(request: ReportDrillRequest & {
1546
+ signal: AbortSignal;
1547
+ view: Readonly<{
1548
+ zoom: number;
1549
+ scrollTop: number;
1550
+ scrollLeft: number;
1551
+ }>;
1552
+ }): void | Promise<void>;
1553
+ }
1554
+ declare interface ReportDrillRequest {
1555
+ actionId: string;
1556
+ params: Readonly<Record<string, string>>;
1557
+ returnState: Readonly<ReportDrillReturnState>;
1558
+ }
1559
+ declare interface ReportDrillReturnState {
1560
+ params: Readonly<Record<string, string>>;
1561
+ address: Readonly<ReportCellAddress_2>;
1562
+ reportScope?: string;
1563
+ source?: Readonly<Pick<ReportCellSource_2, "sourceScope" | "datasetId" | "rowKey" | "field">>;
1564
+ }
1455
1565
  declare interface ReportEditBatch {
1456
1566
  /** Idempotency identity; the server should bind it to the exact payload. */
1457
1567
  requestId: string;
@@ -1533,7 +1643,8 @@ declare interface ReportFetchInput extends ReportTaskMonitoring {
1533
1643
  signal?: AbortSignal;
1534
1644
  /** 本次分页与计划告警;未提供时使用数据源配置的告警通道。 */
1535
1645
  onWarning?: (message: string) => void;
1536
- onQueryResult?: (reportId: string, result: ReportQueryResult) => void;
1646
+ /** Index scopes diagnostics when reports share datasets or a report ID is repeated. */
1647
+ onQueryResult?: (reportId: string, result: ReportQueryResult, reportIndex?: number) => void;
1537
1648
  }
1538
1649
  declare interface ReportFieldContract {
1539
1650
  field: string;
@@ -1554,6 +1665,7 @@ declare interface ReportFieldTarget {
1554
1665
  datasetId?: string;
1555
1666
  rowKey?: string | number;
1556
1667
  tableId?: string;
1668
+ reportScope?: string;
1557
1669
  }
1558
1670
  declare interface ReportFlowBand {
1559
1671
  /** Exact stable component IDs. Static components use nid, lists use id. */
@@ -1607,6 +1719,10 @@ declare interface ReportParamDef {
1607
1719
  label: string;
1608
1720
  value: string;
1609
1721
  }>;
1722
+ /** Opaque host-resolved source key. No URL, credentials or executable code is stored. */
1723
+ optionsSource?: string;
1724
+ /** Select dependencies must be declared parameters; changing a parent clears descendants. */
1725
+ dependsOn?: string[];
1610
1726
  defaultValue?: string;
1611
1727
  required?: boolean;
1612
1728
  placeholder?: string;
@@ -1628,6 +1744,10 @@ declare interface ReportParamDef_2 {
1628
1744
  label: string;
1629
1745
  value: string;
1630
1746
  }>;
1747
+ /** Opaque host-resolved source key. No URL, credentials or executable code is stored. */
1748
+ optionsSource?: string;
1749
+ /** Select dependencies must be declared parameters; changing a parent clears descendants. */
1750
+ dependsOn?: string[];
1631
1751
  defaultValue?: string;
1632
1752
  required?: boolean;
1633
1753
  placeholder?: string;
@@ -1643,7 +1763,30 @@ declare interface ReportParamIssue {
1643
1763
  field: string;
1644
1764
  message: string;
1645
1765
  }
1646
- declare type ReportParamIssueCode = "definition" | "required" | "type" | "option" | "minimum" | "maximum" | "minLength" | "maxLength";
1766
+ declare type ReportParamIssueCode = "definition" | "required" | "type" | "option" | "dependency" | "minimum" | "maximum" | "minLength" | "maxLength";
1767
+ declare interface ReportParamOption {
1768
+ readonly label: string;
1769
+ readonly value: string;
1770
+ }
1771
+ declare interface ReportParamOptionsInput {
1772
+ readonly source: string;
1773
+ readonly field: string;
1774
+ readonly query: string;
1775
+ /** Only declared dependencies, captured at request start. Never the mutable form. */
1776
+ readonly params: Readonly<Record<string, string>>;
1777
+ readonly signal: AbortSignal;
1778
+ readonly limit: number;
1779
+ }
1780
+ /** Resolve a trusted source key through the host's existing API/authentication. */
1781
+ declare type ReportParamOptionsLoader = (input: ReportParamOptionsInput) => Promise<readonly ReportParamOption[]>;
1782
+ declare interface ReportParamOptionsMessages {
1783
+ paramOptionsLoading?: string;
1784
+ paramOptionsEmpty?: string;
1785
+ paramOptionsFailed?: string;
1786
+ paramOptionsMissingLoader?: string;
1787
+ paramOptionsDependencies?: string;
1788
+ paramOptionsClear?: string;
1789
+ }
1647
1790
  declare interface ReportPreferencesAdapter {
1648
1791
  load(key: string): Partial<ReportPreviewPreferences> | null | Promise<Partial<ReportPreviewPreferences> | null>;
1649
1792
  save(key: string, value: Readonly<Partial<ReportPreviewPreferences>>): void | Promise<void>;
@@ -1654,7 +1797,13 @@ declare interface ReportPreferencesOptions {
1654
1797
  key: string;
1655
1798
  adapter: ReportPreferencesAdapter;
1656
1799
  }
1800
+ declare interface ReportPreviewDataTarget extends ReportDataTarget_2 {
1801
+ /** Added by the query adapter; isolates identical dataset/row/field identities across reports. */
1802
+ reportScope?: string;
1803
+ }
1657
1804
  declare interface ReportPreviewDiagnostic {
1805
+ valueState?: ReportValueState_2;
1806
+ target?: ReportPreviewDataTarget;
1658
1807
  code: string;
1659
1808
  severity: "warning" | "error" | "info";
1660
1809
  message: string;
@@ -1677,6 +1826,35 @@ declare interface ReportPreviewTask {
1677
1826
  }
1678
1827
  declare type ReportPreviewTaskStage = "query" | "validate" | "layout" | "assets" | "import" | "encode" | "download" | "print";
1679
1828
  declare type ReportPreviewTool = "search" | "thumbnails" | "zoom" | ReportExportFormat | "print" | "pdfWindow" | "editing" | "import";
1829
+ declare interface ReportPrintCalibration {
1830
+ offsetXmm?: number;
1831
+ offsetYmm?: number;
1832
+ }
1833
+ declare interface ReportPrintFont {
1834
+ /** Same family name used by the template. Sources are trusted application assets. */
1835
+ family: string;
1836
+ source: string;
1837
+ weight?: string;
1838
+ style?: "normal" | "italic" | "oblique";
1839
+ }
1840
+ declare interface ReportPrintMessages {
1841
+ printPrepareTimeout?: string;
1842
+ printImageFailed?: string;
1843
+ printFontFailed?: string;
1844
+ printPrepareFailed?: string;
1845
+ printCalibration?: string;
1846
+ printOffsetX?: string;
1847
+ printOffsetY?: string;
1848
+ printCalibrationTest?: string;
1849
+ printCalibrationHint?: string;
1850
+ }
1851
+ declare interface ReportPrintOptions {
1852
+ /** Defaults to 15 seconds for the entire font/image preparation stage. */
1853
+ resourceTimeoutMs?: number;
1854
+ fonts?: readonly ReportPrintFont[];
1855
+ /** Physical translation only; no scaling or mutation of the report data/plan. */
1856
+ calibration?: ReportPrintCalibration;
1857
+ }
1680
1858
  /** 查询是唯一基础能力;权限、HTTP、数据库和事务都留在宿主适配器内。 */
1681
1859
  declare interface ReportProvider {
1682
1860
  query(context: ReportLoadContext): ReportQueryResult | Promise<ReportQueryResult>;
@@ -1787,6 +1965,10 @@ declare interface ReportTemplateRepeat_2 {
1787
1965
  };
1788
1966
  }
1789
1967
  declare type ReportTemplateSummary = Omit<ReportTemplateDocument, "template">;
1968
+ /** Optional business explanations never replace raw data or schema validation. */
1969
+ declare type ReportValueState = "missing-source" | "not-applicable" | "not-calculable";
1970
+ /** Optional business explanations never replace raw data or schema validation. */
1971
+ declare type ReportValueState_2 = "missing-source" | "not-applicable" | "not-calculable";
1790
1972
  declare interface RichParagraph {
1791
1973
  segments: RichSegment[];
1792
1974
  align?: ComponentStyle["align"];
@@ -1945,21 +2127,14 @@ declare type ValueFormat = ColumnFormat;
1945
2127
  declare type ValueFormat_2 = ColumnFormat_2;
1946
2128
  /** The same declarative formatting used by list columns, before any output backend. */
1947
2129
  declare type ValueFormat_3 = ColumnFormat_3;
1948
- declare interface XlsxImageOptions {
1949
- /** Decoded bytes per unique embedded image; default 16 MiB. */
1950
- maxImageBytes?: number;
1951
- /** Total decoded bytes of unique images in this workbook; default 32 MiB. */
1952
- maxTotalImageBytes?: number;
1953
- /** Unique embedded media limit, default 1000; repeated placements reuse the same media. */
1954
- maxImages?: number;
1955
- }
2130
+ declare type XlsxImageOptions = ImageMediaOptions_2;
1956
2131
  /**
1957
2132
  * RenderPlan → xlsx 导出(B 端第二出口,对齐家族 @agile-team/mach-table-xlsx 路线):
1958
2133
  * - 网格组件 → 真表格:列宽(mm→Excel 宽度)、行高(mm→pt)、colSpan/rowSpan 合并、
1959
2134
  * 加粗/对齐/底色/字号直译(resolveGridLayout 复用单真相源几何)
1960
2135
  * - 文本组件 → 合并标题行(顺序流式输出,保字号/加粗/对齐;非像素级定位,
1961
2136
  * 目标是"财务能直接用的对账表"而非复刻版面)
1962
- * - 未支持组件、富文本专有内容与单元格嵌套组件跳过并计入 warnings
2137
+ * - 原生 richText 保留基础字形;未支持组件、段落专有排版与单元格嵌套组件计入 diagnostics / warnings
1963
2138
  */
1964
2139
  declare interface XlsxRenderOptions extends OutputDiagnosticOptions_2, XlsxImageOptions {
1965
2140
  /** 工作表命名(连续表默认使用标题,其余默认 "Sheet1" 起序)。 */