@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.
- package/README.md +20 -7
- package/THIRD_PARTY_NOTICES.md +3 -1
- package/dist/ExcelBindingWizard-BKH1nGNS.js +1485 -0
- package/dist/ExcelBindingWizard-Bs43BGNp.cjs +1 -0
- package/dist/ParamEditor-Da4akw6V.cjs +1 -0
- package/dist/ParamEditor-DoAhzJsm.js +594 -0
- package/dist/{ReportBatchPanel-CW2HV9I8.js → ReportBatchPanel-BMf6boMA.js} +39 -39
- package/dist/ReportBatchPanel-wP9m9Pj1.cjs +1 -0
- package/dist/ReportPreview-ChV19HBp.js +4619 -0
- package/dist/ReportPreview-DbLvvOUT.cjs +6 -0
- package/dist/{ReportTemplateLibrary-BZB-XWjj.js → ReportTemplateLibrary-C9wutIiT.js} +1 -1
- package/dist/ReportTemplateLibrary-Sxr3eD0J.cjs +1 -0
- package/dist/RuleEditor-C_Clasvd.js +2037 -0
- package/dist/RuleEditor-XhGHK8DE.cjs +1 -0
- package/dist/TemplateOutlinePanel-D6Bkny59.js +96 -0
- package/dist/TemplateOutlinePanel-JTSR53vJ.cjs +1 -0
- package/dist/TemplateReusePanel-Kx35S0Ql.cjs +1 -0
- package/dist/TemplateReusePanel-rVuK1kTz.js +388 -0
- package/dist/TemplateReviewPanel-B0ar9_zf.js +592 -0
- package/dist/TemplateReviewPanel-Dn6X9UmY.cjs +1 -0
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.d.cts +3 -1
- package/dist/analytics.d.ts +3 -1
- package/dist/analytics.js +154 -60
- package/dist/artifact-integrity.json +135 -0
- package/dist/assets-B9ImAi6_.cjs +1 -0
- package/dist/assets-DEaz4qsp.js +124 -0
- package/dist/batch-BaP6pWDE.cjs +1 -0
- package/dist/batch-BfZHN1do.js +220 -0
- package/dist/batch-CGyt-b2W.js +273 -0
- package/dist/batch-CLpELXBl.cjs +1 -0
- package/dist/capabilities-CAh2Nrue.cjs +1 -0
- package/dist/capabilities-DskCHs3V.js +69 -0
- package/dist/codes.d.cts +2 -0
- package/dist/codes.d.ts +2 -0
- package/dist/{computed-Bvk0W15F.js → computed-C-4C2S5h.js} +3 -3
- package/dist/config-BVsJXSqS.js +842 -0
- package/dist/config-D10us76d.cjs +1 -0
- package/dist/data-explanation-B8MZRYVS.js +16 -0
- package/dist/data-explanation-DE55G30w.cjs +1 -0
- package/dist/designer-2bDlcNXQ.js +5136 -0
- package/dist/designer-BT7XCdbW.cjs +2 -0
- package/dist/designer.cjs +1 -2
- package/dist/designer.d.cts +432 -17
- package/dist/designer.d.ts +432 -17
- package/dist/designer.js +21 -4312
- package/dist/drill-ByJviLXS.js +145 -0
- package/dist/drill-DYTxuL3A.cjs +1 -0
- package/dist/font-loader-B_UkxpzC.cjs +1 -0
- package/dist/font-loader-Q3bQjmrI.js +297 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +239 -5
- package/dist/index.d.ts +239 -5
- package/dist/index.js +939 -893
- package/dist/json-snapshot-DFb2eWkf.js +1416 -0
- package/dist/json-snapshot-WWSGlaHG.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-BwNyeGpt.js +36352 -0
- package/dist/pdf-CvvrjPQg.cjs +103 -0
- package/dist/pdf.cjs +1 -101
- package/dist/pdf.d.cts +18 -3
- package/dist/pdf.d.ts +18 -3
- package/dist/pdf.js +9 -36579
- package/dist/plugin-Ca_XZG3l.js +22 -0
- package/dist/{plugin-DzS6pxTA.cjs → plugin-DHO7X8z2.cjs} +1 -1
- package/dist/prepared-CFy9B75C.cjs +1 -0
- package/dist/prepared-ajM-H-9B.js +69 -0
- package/dist/progress-B0ctFpKf.cjs +1 -0
- package/dist/progress-D-OTpEav.js +52 -0
- package/dist/{record-bindings-D-5jQlTj.js → record-bindings-Do_b3h4V.js} +1 -1
- package/dist/{region-binding-workflow-CcUq8W2Q.js → region-binding-workflow-BMhK_TjP.js} +1 -1
- package/dist/{region-binding-workflow-BzfbxRiR.cjs → region-binding-workflow-DIYJdCUr.cjs} +1 -1
- 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/sbom.cdx.json +3982 -0
- package/dist/server/node.d.cts +66 -12
- package/dist/server/node.d.ts +66 -12
- package/dist/server-node.cjs +1 -1
- package/dist/server-node.js +405 -381
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +878 -15
- package/dist/server.d.ts +878 -15
- package/dist/server.js +1034 -534
- package/dist/sha256-ArEYjaTI.cjs +1 -0
- package/dist/sha256-DPEuJ3nh.js +155 -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-FJE_c9Qe.cjs +1 -0
- package/dist/template-catalog-j2B1MJlL.js +414 -0
- package/dist/template-fragments-BGbQLGlV.js +187 -0
- package/dist/template-fragments-DcKeiylI.cjs +1 -0
- package/dist/template-outline-BwRV_eRo.cjs +1 -0
- package/dist/template-outline-cnWfT_LK.js +88 -0
- package/dist/{template-registry-BjE1VS6g.js → template-registry-BtaKPELV.js} +364 -201
- package/dist/template-registry-Co1zPq5e.cjs +1 -0
- package/dist/textwrap-CWHyzkBH.cjs +4 -0
- package/dist/textwrap-DE1kgcJB.js +110 -0
- package/dist/{tree-CqcQ99NM.js → tree-CjVZLRw7.js} +1 -1
- package/dist/{useLocalDraft-C07SYRnC.js → useLocalDraft-BnhcxXk_.js} +1 -1
- package/dist/{useLocalDraft-Yiw1wFgI.cjs → useLocalDraft-CioIfDb6.cjs} +1 -1
- package/dist/vue/async.d.cts +190 -15
- package/dist/vue/async.d.ts +190 -15
- package/dist/vue/index.d.cts +274 -24
- package/dist/vue/index.d.ts +274 -24
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +5 -5
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +90 -81
- package/dist/{workbook-session-DNa2RHNG.cjs → workbook-session-Bjv1YCRK.cjs} +18 -18
- package/dist/{workbook-session-BPb3TMnT.js → workbook-session-BvToI-Fd.js} +5440 -5288
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +66 -12
- package/dist/worker.d.ts +66 -12
- package/dist/worker.js +61 -56
- package/dist/xlsx-node.cjs +34 -34
- package/dist/xlsx-node.js +878 -870
- package/dist/xlsx.cjs +3 -4
- package/dist/xlsx.d.cts +22 -10
- package/dist/xlsx.d.ts +22 -10
- package/dist/xlsx.js +261 -253
- package/package.json +2 -2
- package/dist/ExcelBindingWizard-CeAf4QSE.js +0 -1465
- package/dist/ExcelBindingWizard-y0mT-AHR.cjs +0 -1
- package/dist/ParamEditor-BLaE5q5W.js +0 -522
- package/dist/ParamEditor-MBBC7lUE.cjs +0 -1
- package/dist/ReportBatchPanel-Fp1ePFag.cjs +0 -1
- package/dist/ReportPreview-BN6fk7Wz.cjs +0 -6
- package/dist/ReportPreview-D2Jkyh1U.js +0 -4243
- package/dist/ReportTemplateLibrary-5fk5CQBO.cjs +0 -1
- package/dist/RuleEditor-ChRzNQuF.cjs +0 -1
- package/dist/RuleEditor-DzAmW5YH.js +0 -2024
- package/dist/TemplateReviewPanel-BKofGrV9.js +0 -222
- package/dist/TemplateReviewPanel-DwtOcLue.cjs +0 -1
- package/dist/assets-C2U-e-Sz.cjs +0 -4
- package/dist/assets-Q0wUwNrV.js +0 -217
- package/dist/batch-Bt3Fd27Z.cjs +0 -1
- package/dist/batch-mRqhhhjt.js +0 -364
- package/dist/capabilities-CK_7hizc.js +0 -63
- package/dist/capabilities-CsZ-pNHR.cjs +0 -1
- package/dist/config-Bb7RiIO5.cjs +0 -1
- package/dist/config-XVwG87IA.js +0 -529
- 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/plugin-D4wizDXB.js +0 -22
- package/dist/progress-7OSZbFok.js +0 -39
- package/dist/progress-BnLiS5eH.cjs +0 -1
- package/dist/task-events-DQ276fn2.cjs +0 -1
- package/dist/task-events-Dpsvf_t2.js +0 -47
- package/dist/template-registry-D3SjENi6.cjs +0 -1
- package/dist/template-review-DGwWOoCv.cjs +0 -2
- package/dist/template-review-PgEe_Wr9.js +0 -1742
- package/dist/validate-BJ5HIWY8.cjs +0 -1
- package/dist/validate-DbgEM1Hh.js +0 -163
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const v=require("./code-options-BUTChiZZ.cjs");function g(e,s,i){e.editable!==void 0&&typeof e.editable!="boolean"&&i.push({path:`${s}.editable`,message:"编辑控制应为布尔值"}),e.valueType!==void 0&&!["text","number","boolean"].includes(e.valueType)&&i.push({path:`${s}.valueType`,message:"编辑类型应为 text、number 或 boolean"})}function A(e,s,i){g(e,s,i),e.indentMm!==void 0&&(typeof e.indentMm!="number"||!Number.isFinite(e.indentMm)||e.indentMm<0)&&i.push({path:`${s}.indentMm`,message:"单元格缩进应为有限非负数"}),e.derived!==void 0&&typeof e.derived!="boolean"&&i.push({path:`${s}.derived`,message:"派生结果标记应为布尔值"}),m(e.source,`${s}.source`,i,!0),e.formula!==void 0&&typeof e.formula!="string"&&i.push({path:`${s}.formula`,message:"单元格公式应为字符串"})}function m(e,s,i,n=!1){if(e===void 0)return;if(!e||typeof e!="object"||Array.isArray(e)){i.push({path:s,message:"业务来源应为对象"});return}const t=e;for(const a of["datasetId",...n?["field"]:[]])(typeof t[a]!="string"||!t[a].trim())&&i.push({path:`${s}.${a}`,message:"业务标识应为非空字符串"});for(const a of["rowKey","revision"]){const o=t[a];o===void 0&&!(n&&a==="rowKey")||typeof o!="string"&&!(typeof o=="number"&&Number.isFinite(o))&&i.push({path:`${s}.${a}`,message:"业务键及修订号应为字符串或有限数字"})}t.sourceToken!==void 0&&typeof t.sourceToken!="string"&&i.push({path:`${s}.sourceToken`,message:"来源令牌应为字符串"})}const b=new Set(["text","image","barcode","qrcode","chart","line","rect","ellipse"]);function d(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function M(e,s,i,n){const t=e[s];(typeof t!="number"||!Number.isFinite(t))&&n.push({path:`${i}.${s}`,message:`应为有限数字,实际 ${JSON.stringify(t)}`})}function w(e,s,i){if(e!==void 0){const n=`${s}.table`;if(!d(e))i.push({path:n,message:"逻辑表来源应为对象"});else{m(e.source,`${n}.source`,i),(typeof e.id!="string"||!e.id.trim())&&i.push({path:`${n}.id`,message:"逻辑表 ID 应为非空字符串"});const t=e.role;["header","body","group-header","subtotal","grand-total"].includes(t)||i.push({path:`${n}.role`,message:"未知逻辑表行角色"});const a=e.rowIndex;(typeof a!="number"||!Number.isInteger(a)||(t==="header"?a!==-1:a<0))&&i.push({path:`${n}.rowIndex`,message:"表头索引应为 -1,内容行索引应为非负整数"}),(!Array.isArray(e.columnKeys)||e.columnKeys.some(o=>typeof o!="string"))&&i.push({path:`${n}.columnKeys`,message:"逻辑列字段应为字符串数组"}),e.layout!==void 0&&e.layout!=="page"&&e.layout!=="wide"&&i.push({path:`${n}.layout`,message:"布局应为 page 或 wide"}),e.title!==void 0&&typeof e.title!="string"&&i.push({path:`${n}.title`,message:"逻辑表名称应为字符串"})}}}function k(e,s,i,n){if(e!==void 0)if(!d(e)||!Array.isArray(e.cells))i.push({path:`${s}.grid.cells`,message:"grid.cells 应为二维数组"});else{const t=e.paddingMm;t!==void 0&&(typeof t!="number"||!Number.isFinite(t)||t<0)&&i.push({path:`${s}.grid.paddingMm`,message:"单元格内距应为有限非负数"}),e.cells.forEach((a,o)=>{if(!Array.isArray(a)){i.push({path:`${s}.grid.cells.${o}`,message:"行应为数组"});return}a.forEach((u,f)=>{if(u==null)return;const r=`${s}.grid.cells.${o}.${f}`;if(!d(u)){i.push({path:r,message:"网格单元格应为对象或 null"});return}A(u,r,i),Array.isArray(u.children)&&u.children.forEach((y,$)=>{h(y,`${s}.grid.cells.${o}.${f}.children.${$}`,i,n)})})})}}function N(e,s,i){e!==void 0&&(Array.isArray(e)?e.forEach((n,t)=>{(!d(n)||!Array.isArray(n.segments))&&i.push({path:`${s}.richParagraphs.${t}`,message:"段落缺少 segments 数组"})}):i.push({path:`${s}.richParagraphs`,message:"richParagraphs 应为数组"}))}function h(e,s,i,n=[]){if(!d(e)){i.push({path:s,message:"组件应为对象"});return}const t=e.kind;typeof t!="string"?i.push({path:`${s}.kind`,message:"组件缺少 kind 字符串"}):b.has(t)||n.push({path:`${s}.kind`,message:`未知组件类型 ${JSON.stringify(t)},将以兜底方式渲染`});for(const a of["leftMm","topMm","widthMm","heightMm"])M(e,a,s,i);typeof e.leftMm=="number"&&e.leftMm<-100&&i.push({path:`${s}.leftMm`,message:"几何数值异常(leftMm<-100)"});for(const a of["widthMm","heightMm"])typeof e[a]=="number"&&e[a]<0&&i.push({path:`${s}.${a}`,message:"组件尺寸不能为负数"});w(e.table,s,i),E(e.code,t,s,i),e.pageAnchor!==void 0&&!["header","footer"].includes(e.pageAnchor)&&i.push({path:`${s}.pageAnchor`,message:"页面锚点应为 header 或 footer"}),e.lineDirection!==void 0&&!["down","up"].includes(e.lineDirection)&&i.push({path:`${s}.lineDirection`,message:"线段方向应为 down 或 up"}),k(e.grid,s,i,n),N(e.richParagraphs,s,i)}function E(e,s,i,n){if(e!==void 0)for(const t of v.codeOptionIssues(e,s))n.push({path:`${i}.code${t.path?`.${t.path}`:""}`,message:t.message})}function p(e,s,i){if(!d(e))return;e.binding!==void 0&&i.push({path:`${s}.binding`,message:"渲染计划不允许未解析字段绑定"});const n=e.grid;!d(n)||!Array.isArray(n.cells)||n.cells.forEach((t,a)=>{Array.isArray(t)&&t.forEach((o,u)=>{!d(o)||!Array.isArray(o.children)||o.children.forEach((f,r)=>p(f,`${s}.grid.cells.${a}.${u}.children.${r}`,i))})})}function c(e,s,i,n=[]){if(!d(e)){i.push({path:s,message:"页应为对象"});return}const t=e.pageWidthMm,a=e.pageHeightMm;(typeof t!="number"||!Number.isFinite(t)||t<=0)&&i.push({path:`${s}.pageWidthMm`,message:`页宽非法: ${JSON.stringify(t)}`}),(typeof a!="number"||!(a>0&&a<5e3))&&i.push({path:`${s}.pageHeightMm`,message:`页高非法: ${JSON.stringify(a)}`}),e.layout!==void 0&&e.layout!=="page"&&e.layout!=="wide"&&i.push({path:`${s}.layout`,message:"布局应为 page 或 wide"});const o=e.components;Array.isArray(o)?Array.isArray(o)&&o.forEach((u,f)=>{h(u,`${s}.components.${f}`,i,n),p(u,`${s}.components.${f}`,i)}):i.push({path:`${s}.components`,message:"components 应为数组"})}function l(e){const s=[],i=[],n=d(e)?e.pages:void 0;if(d(e)&&e.requiresRecalculation!==void 0&&typeof e.requiresRecalculation!="boolean"&&s.push({path:"$.requiresRecalculation",message:"重算能力要求应为布尔值"}),!Array.isArray(n))s.push({path:"$.pages",message:e==null?"渲染计划为空":"渲染计划缺少 pages 数组"});else{n.forEach((a,o)=>c(a,`$.pages.${o}`,s,i)),n.length>2e3&&i.push({path:"$.pages",message:`页数异常大(${n.length} 页),渲染与打印耗时可能显著增加`});const t=n.reduce((a,o)=>a+(d(o)&&Array.isArray(o.components)?o.components.length:0),0);t>5e4&&i.push({path:"$.pages",message:`组件总数异常大(${t} 个),可能触发浏览器性能限制`})}return{ok:s.length===0,errors:s,warnings:i}}function P(e){const s=l(e);if(!s.ok){const i=s.errors.slice(0,3).map(n=>`${n.path}: ${n.message}`).join("; ");throw new Error(`渲染计划校验失败(${s.errors.length} 处): ${i}`)}return e.pages}exports.assertRenderPlan=P;exports.validateComponent=h;exports.validateEditableMetadata=g;exports.validatePage=c;exports.validateRenderPlan=l;
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { c as y } from "./code-options-BKXXY7NI.js";
|
|
2
|
-
function $(e, s, i) {
|
|
3
|
-
e.editable !== void 0 && typeof e.editable != "boolean" && i.push({ path: `${s}.editable`, message: "编辑控制应为布尔值" }), e.valueType !== void 0 && !["text", "number", "boolean"].includes(e.valueType) && i.push({ path: `${s}.valueType`, message: "编辑类型应为 text、number 或 boolean" });
|
|
4
|
-
}
|
|
5
|
-
function l(e, s, i) {
|
|
6
|
-
$(e, s, i), e.indentMm !== void 0 && (typeof e.indentMm != "number" || !Number.isFinite(e.indentMm) || e.indentMm < 0) && i.push({ path: `${s}.indentMm`, message: "单元格缩进应为有限非负数" }), e.derived !== void 0 && typeof e.derived != "boolean" && i.push({ path: `${s}.derived`, message: "派生结果标记应为布尔值" }), h(e.source, `${s}.source`, i, !0), e.formula !== void 0 && typeof e.formula != "string" && i.push({ path: `${s}.formula`, message: "单元格公式应为字符串" });
|
|
7
|
-
}
|
|
8
|
-
function h(e, s, i, t = !1) {
|
|
9
|
-
if (e === void 0) return;
|
|
10
|
-
if (!e || typeof e != "object" || Array.isArray(e)) {
|
|
11
|
-
i.push({ path: s, message: "业务来源应为对象" });
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const n = e;
|
|
15
|
-
for (const a of ["datasetId", ...t ? ["field"] : []])
|
|
16
|
-
(typeof n[a] != "string" || !n[a].trim()) && i.push({ path: `${s}.${a}`, message: "业务标识应为非空字符串" });
|
|
17
|
-
for (const a of ["rowKey", "revision"]) {
|
|
18
|
-
const o = n[a];
|
|
19
|
-
o === void 0 && !(t && a === "rowKey") || typeof o != "string" && !(typeof o == "number" && Number.isFinite(o)) && i.push({ path: `${s}.${a}`, message: "业务键及修订号应为字符串或有限数字" });
|
|
20
|
-
}
|
|
21
|
-
n.sourceToken !== void 0 && typeof n.sourceToken != "string" && i.push({ path: `${s}.sourceToken`, message: "来源令牌应为字符串" });
|
|
22
|
-
}
|
|
23
|
-
const v = /* @__PURE__ */ new Set([
|
|
24
|
-
"text",
|
|
25
|
-
"image",
|
|
26
|
-
"barcode",
|
|
27
|
-
"qrcode",
|
|
28
|
-
"chart",
|
|
29
|
-
"line",
|
|
30
|
-
"rect",
|
|
31
|
-
"ellipse"
|
|
32
|
-
]);
|
|
33
|
-
function f(e) {
|
|
34
|
-
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
35
|
-
}
|
|
36
|
-
function A(e, s, i, t) {
|
|
37
|
-
const n = e[s];
|
|
38
|
-
(typeof n != "number" || !Number.isFinite(n)) && t.push({ path: `${i}.${s}`, message: `应为有限数字,实际 ${JSON.stringify(n)}` });
|
|
39
|
-
}
|
|
40
|
-
function b(e, s, i) {
|
|
41
|
-
if (e !== void 0) {
|
|
42
|
-
const t = `${s}.table`;
|
|
43
|
-
if (!f(e)) i.push({ path: t, message: "逻辑表来源应为对象" });
|
|
44
|
-
else {
|
|
45
|
-
h(e.source, `${t}.source`, i), (typeof e.id != "string" || !e.id.trim()) && i.push({ path: `${t}.id`, message: "逻辑表 ID 应为非空字符串" });
|
|
46
|
-
const n = e.role;
|
|
47
|
-
["header", "body", "group-header", "subtotal", "grand-total"].includes(n) || i.push({ path: `${t}.role`, message: "未知逻辑表行角色" });
|
|
48
|
-
const a = e.rowIndex;
|
|
49
|
-
(typeof a != "number" || !Number.isInteger(a) || (n === "header" ? a !== -1 : a < 0)) && i.push({ path: `${t}.rowIndex`, message: "表头索引应为 -1,内容行索引应为非负整数" }), (!Array.isArray(e.columnKeys) || e.columnKeys.some((o) => typeof o != "string")) && i.push({ path: `${t}.columnKeys`, message: "逻辑列字段应为字符串数组" }), e.layout !== void 0 && e.layout !== "page" && e.layout !== "wide" && i.push({ path: `${t}.layout`, message: "布局应为 page 或 wide" }), e.title !== void 0 && typeof e.title != "string" && i.push({ path: `${t}.title`, message: "逻辑表名称应为字符串" });
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function M(e, s, i, t) {
|
|
54
|
-
if (e !== void 0)
|
|
55
|
-
if (!f(e) || !Array.isArray(e.cells))
|
|
56
|
-
i.push({ path: `${s}.grid.cells`, message: "grid.cells 应为二维数组" });
|
|
57
|
-
else {
|
|
58
|
-
const n = e.paddingMm;
|
|
59
|
-
n !== void 0 && (typeof n != "number" || !Number.isFinite(n) || n < 0) && i.push({ path: `${s}.grid.paddingMm`, message: "单元格内距应为有限非负数" }), e.cells.forEach((a, o) => {
|
|
60
|
-
if (!Array.isArray(a)) {
|
|
61
|
-
i.push({ path: `${s}.grid.cells.${o}`, message: "行应为数组" });
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
a.forEach((u, d) => {
|
|
65
|
-
if (u == null) return;
|
|
66
|
-
const r = `${s}.grid.cells.${o}.${d}`;
|
|
67
|
-
if (!f(u)) {
|
|
68
|
-
i.push({ path: r, message: "网格单元格应为对象或 null" });
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
l(u, r, i), Array.isArray(u.children) && u.children.forEach((p, c) => {
|
|
72
|
-
g(p, `${s}.grid.cells.${o}.${d}.children.${c}`, i, t);
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function w(e, s, i) {
|
|
79
|
-
e !== void 0 && (Array.isArray(e) ? e.forEach((t, n) => {
|
|
80
|
-
(!f(t) || !Array.isArray(t.segments)) && i.push({ path: `${s}.richParagraphs.${n}`, message: "段落缺少 segments 数组" });
|
|
81
|
-
}) : i.push({ path: `${s}.richParagraphs`, message: "richParagraphs 应为数组" }));
|
|
82
|
-
}
|
|
83
|
-
function g(e, s, i, t = []) {
|
|
84
|
-
if (!f(e)) {
|
|
85
|
-
i.push({ path: s, message: "组件应为对象" });
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
const n = e.kind;
|
|
89
|
-
typeof n != "string" ? i.push({ path: `${s}.kind`, message: "组件缺少 kind 字符串" }) : v.has(n) || t.push({
|
|
90
|
-
path: `${s}.kind`,
|
|
91
|
-
message: `未知组件类型 ${JSON.stringify(n)},将以兜底方式渲染`
|
|
92
|
-
});
|
|
93
|
-
for (const a of ["leftMm", "topMm", "widthMm", "heightMm"])
|
|
94
|
-
A(e, a, s, i);
|
|
95
|
-
typeof e.leftMm == "number" && e.leftMm < -100 && i.push({ path: `${s}.leftMm`, message: "几何数值异常(leftMm<-100)" });
|
|
96
|
-
for (const a of ["widthMm", "heightMm"])
|
|
97
|
-
typeof e[a] == "number" && e[a] < 0 && i.push({ path: `${s}.${a}`, message: "组件尺寸不能为负数" });
|
|
98
|
-
b(e.table, s, i), k(e.code, n, s, i), e.pageAnchor !== void 0 && !["header", "footer"].includes(e.pageAnchor) && i.push({ path: `${s}.pageAnchor`, message: "页面锚点应为 header 或 footer" }), e.lineDirection !== void 0 && !["down", "up"].includes(e.lineDirection) && i.push({ path: `${s}.lineDirection`, message: "线段方向应为 down 或 up" }), M(e.grid, s, i, t), w(e.richParagraphs, s, i);
|
|
99
|
-
}
|
|
100
|
-
function k(e, s, i, t) {
|
|
101
|
-
if (e !== void 0)
|
|
102
|
-
for (const n of y(e, s)) t.push({ path: `${i}.code${n.path ? `.${n.path}` : ""}`, message: n.message });
|
|
103
|
-
}
|
|
104
|
-
function m(e, s, i) {
|
|
105
|
-
if (!f(e)) return;
|
|
106
|
-
e.binding !== void 0 && i.push({ path: `${s}.binding`, message: "渲染计划不允许未解析字段绑定" });
|
|
107
|
-
const t = e.grid;
|
|
108
|
-
!f(t) || !Array.isArray(t.cells) || t.cells.forEach((n, a) => {
|
|
109
|
-
Array.isArray(n) && n.forEach((o, u) => {
|
|
110
|
-
!f(o) || !Array.isArray(o.children) || o.children.forEach((d, r) => m(d, `${s}.grid.cells.${a}.${u}.children.${r}`, i));
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
function N(e, s, i, t = []) {
|
|
115
|
-
if (!f(e)) {
|
|
116
|
-
i.push({ path: s, message: "页应为对象" });
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
const n = e.pageWidthMm, a = e.pageHeightMm;
|
|
120
|
-
(typeof n != "number" || !Number.isFinite(n) || n <= 0) && i.push({ path: `${s}.pageWidthMm`, message: `页宽非法: ${JSON.stringify(n)}` }), (typeof a != "number" || !(a > 0 && a < 5e3)) && i.push({ path: `${s}.pageHeightMm`, message: `页高非法: ${JSON.stringify(a)}` }), e.layout !== void 0 && e.layout !== "page" && e.layout !== "wide" && i.push({ path: `${s}.layout`, message: "布局应为 page 或 wide" });
|
|
121
|
-
const o = e.components;
|
|
122
|
-
Array.isArray(o) ? Array.isArray(o) && o.forEach((u, d) => {
|
|
123
|
-
g(u, `${s}.components.${d}`, i, t), m(u, `${s}.components.${d}`, i);
|
|
124
|
-
}) : i.push({ path: `${s}.components`, message: "components 应为数组" });
|
|
125
|
-
}
|
|
126
|
-
function E(e) {
|
|
127
|
-
const s = [], i = [], t = f(e) ? e.pages : void 0;
|
|
128
|
-
if (f(e) && e.requiresRecalculation !== void 0 && typeof e.requiresRecalculation != "boolean" && s.push({ path: "$.requiresRecalculation", message: "重算能力要求应为布尔值" }), !Array.isArray(t))
|
|
129
|
-
s.push({
|
|
130
|
-
path: "$.pages",
|
|
131
|
-
message: e == null ? "渲染计划为空" : "渲染计划缺少 pages 数组"
|
|
132
|
-
});
|
|
133
|
-
else {
|
|
134
|
-
t.forEach((a, o) => N(a, `$.pages.${o}`, s, i)), t.length > 2e3 && i.push({
|
|
135
|
-
path: "$.pages",
|
|
136
|
-
message: `页数异常大(${t.length} 页),渲染与打印耗时可能显著增加`
|
|
137
|
-
});
|
|
138
|
-
const n = t.reduce(
|
|
139
|
-
(a, o) => a + (f(o) && Array.isArray(o.components) ? o.components.length : 0),
|
|
140
|
-
0
|
|
141
|
-
);
|
|
142
|
-
n > 5e4 && i.push({
|
|
143
|
-
path: "$.pages",
|
|
144
|
-
message: `组件总数异常大(${n} 个),可能触发浏览器性能限制`
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
return { ok: s.length === 0, errors: s, warnings: i };
|
|
148
|
-
}
|
|
149
|
-
function I(e) {
|
|
150
|
-
const s = E(e);
|
|
151
|
-
if (!s.ok) {
|
|
152
|
-
const i = s.errors.slice(0, 3).map((t) => `${t.path}: ${t.message}`).join("; ");
|
|
153
|
-
throw new Error(`渲染计划校验失败(${s.errors.length} 处): ${i}`);
|
|
154
|
-
}
|
|
155
|
-
return e.pages;
|
|
156
|
-
}
|
|
157
|
-
export {
|
|
158
|
-
I as a,
|
|
159
|
-
N as b,
|
|
160
|
-
E as c,
|
|
161
|
-
$ as d,
|
|
162
|
-
g as v
|
|
163
|
-
};
|