@agile-team/mach-report 2.15.0 → 2.17.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 +21 -12
- package/dist/{ExcelBindingWizard-Bs43BGNp.cjs → ExcelBindingWizard-Bq6FYME6.cjs} +1 -1
- package/dist/{ExcelBindingWizard-BKH1nGNS.js → ExcelBindingWizard-Co1svTsw.js} +3 -3
- package/dist/{ParamEditor-Da4akw6V.cjs → ParamEditor-B5UZRgxv.cjs} +1 -1
- package/dist/{ParamEditor-DoAhzJsm.js → ParamEditor-DNNARyeB.js} +1 -1
- package/dist/{ReportBatchPanel-wP9m9Pj1.cjs → ReportBatchPanel-Ctvs2t_9.cjs} +1 -1
- package/dist/{ReportBatchPanel-BMf6boMA.js → ReportBatchPanel-uQh06usx.js} +3 -3
- package/dist/ReportPreview-BdQawRh0.js +4879 -0
- package/dist/ReportPreview-CJC_-j2I.cjs +6 -0
- package/dist/{ReportTemplateLibrary-Sxr3eD0J.cjs → ReportTemplateLibrary-CnP7_1pH.cjs} +1 -1
- package/dist/{ReportTemplateLibrary-C9wutIiT.js → ReportTemplateLibrary-TIL_Oj2l.js} +1 -1
- package/dist/RuleEditor-DkRjOLlr.js +2141 -0
- package/dist/RuleEditor-h5anGsDB.cjs +1 -0
- package/dist/{TemplateOutlinePanel-JTSR53vJ.cjs → TemplateOutlinePanel-BlLxRrfu.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-D6Bkny59.js → TemplateOutlinePanel-BouxsuqQ.js} +1 -1
- package/dist/{TemplateReusePanel-rVuK1kTz.js → TemplateReusePanel-BEACLPaN.js} +2 -2
- package/dist/{TemplateReusePanel-Kx35S0Ql.cjs → TemplateReusePanel-yxsHSO40.cjs} +1 -1
- package/dist/{TemplateReviewPanel-B0ar9_zf.js → TemplateReviewPanel-B1OGRY2i.js} +1 -1
- package/dist/{TemplateReviewPanel-Dn6X9UmY.cjs → TemplateReviewPanel-D9Cx0m2N.cjs} +1 -1
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.d.cts +65 -1
- package/dist/analytics.d.ts +65 -1
- package/dist/analytics.js +4 -4
- package/dist/artifact-integrity.json +105 -101
- package/dist/assets-BIMVwjQe.js +231 -0
- package/dist/assets-Dfs2ElxI.cjs +1 -0
- package/dist/auto-BIOmtVhk.js +240 -0
- package/dist/auto-DDHflI9v.cjs +1 -0
- package/dist/{batch-BfZHN1do.js → batch-WzDIXJAt.js} +1 -1
- package/dist/{batch-CLpELXBl.cjs → batch-z6Aw5GEY.cjs} +1 -1
- package/dist/codes.d.cts +2 -0
- package/dist/codes.d.ts +2 -0
- package/dist/component-tree-Ca6YYfHq.js +61 -0
- package/dist/component-tree-DkGLEfZC.cjs +1 -0
- package/dist/computed-BW5a8QFk.js +612 -0
- package/dist/computed-C2GD3XcE.cjs +1 -0
- package/dist/config-Dg_o8e7m.cjs +1 -0
- package/dist/{config-BVsJXSqS.js → config-XQ4qrQ7Q.js} +66 -64
- package/dist/dataset-DL83majE.js +161 -0
- package/dist/dataset-IrlXbUvh.cjs +1 -0
- package/dist/designer-D9XAxqSc.js +5178 -0
- package/dist/designer-uCDo5XSK.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +178 -3
- package/dist/designer.d.ts +178 -3
- package/dist/designer.js +1 -1
- package/dist/drill-ByN8COs_.cjs +1 -0
- package/dist/{drill-ByJviLXS.js → drill-CKW3Xtfa.js} +5 -5
- package/dist/encoding-BFMFIc4r.cjs +1 -0
- package/dist/encoding-DP_Eaf0A.js +21 -0
- package/dist/{font-loader-B_UkxpzC.cjs → font-loader-7FWVlykp.cjs} +1 -1
- package/dist/{font-loader-Q3bQjmrI.js → font-loader-CQZowp0I.js} +1 -1
- package/dist/index.cjs +8 -9
- package/dist/index.d.cts +175 -1
- package/dist/index.d.ts +175 -1
- package/dist/index.js +1343 -915
- package/dist/json-snapshot-D7PE1NsU.cjs +2 -0
- package/dist/json-snapshot-DYmEe3sO.js +1779 -0
- package/dist/matrix-JLAXlux-.js +302 -0
- package/dist/matrix-gTHpDTGm.cjs +1 -0
- package/dist/{pdf-CvvrjPQg.cjs → pdf-B8JouyYv.cjs} +48 -50
- package/dist/{pdf-BwNyeGpt.js → pdf-l3ea86di.js} +2734 -2748
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.d.cts +14 -0
- package/dist/pdf.d.ts +14 -0
- package/dist/pdf.js +2 -2
- package/dist/{plugin-Ca_XZG3l.js → plugin-BBp74CQZ.js} +1 -1
- package/dist/{plugin-DHO7X8z2.cjs → plugin-CtFX9PFG.cjs} +1 -1
- package/dist/prepared-CARicKYh.js +87 -0
- package/dist/prepared-Ch1x_Gog.cjs +1 -0
- package/dist/progress-BXzlVbIp.js +29 -0
- package/dist/progress-DJBd9Rb9.cjs +1 -0
- package/dist/{progress-D-OTpEav.js → progress-Hc2vxoCs.js} +2 -2
- package/dist/protocol-B5A2uom4.cjs +1 -0
- package/dist/protocol-BaiWjq5w.js +90 -0
- package/dist/record-bindings-B86Sur_y.cjs +1 -0
- package/dist/{record-bindings-Do_b3h4V.js → record-bindings-D4TuMzHs.js} +10 -11
- package/dist/{region-binding-workflow-BMhK_TjP.js → region-binding-workflow-BNasF5kz.js} +2 -2
- package/dist/{region-binding-workflow-DIYJdCUr.cjs → region-binding-workflow-O2Cni3mF.cjs} +1 -1
- package/dist/report-encoding-worker.cjs +1 -0
- package/dist/report-encoding-worker.d.ts +1 -0
- package/dist/report-encoding-worker.js +2 -0
- package/dist/rich-text-layout-ALlMoYOG.cjs +3 -0
- package/dist/rich-text-layout-Ct5WrY1g.js +102 -0
- package/dist/runtime-DakRXui3.js +170 -0
- package/dist/runtime-dL5ygIfa.cjs +1 -0
- package/dist/sbom.cdx.json +2 -2
- package/dist/server/node.d.cts +132 -1
- package/dist/server/node.d.ts +132 -1
- package/dist/server-node.cjs +5 -1
- package/dist/server-node.js +5177 -463
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +182 -2
- package/dist/server.d.ts +182 -2
- package/dist/server.js +918 -833
- package/dist/sha256-BshdOkCC.cjs +1 -0
- package/dist/sha256-DTG-Gq8i.js +157 -0
- package/dist/style-67OqfNed.js +73 -0
- package/dist/style-C22Pbv3T.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/template-catalog-Dua8h9ZA.cjs +1 -0
- package/dist/{template-catalog-j2B1MJlL.js → template-catalog-wT1fNeAP.js} +10 -10
- package/dist/{template-fragments-DcKeiylI.cjs → template-fragments-BajTajb4.cjs} +1 -1
- package/dist/{template-fragments-BGbQLGlV.js → template-fragments-DmX5XK4N.js} +2 -2
- package/dist/template-registry-CpysHAxy.cjs +1 -0
- package/dist/{template-registry-BtaKPELV.js → template-registry-u11fPd8D.js} +389 -321
- package/dist/{textwrap-DE1kgcJB.js → textwrap-BEIg2w8y.js} +1 -1
- package/dist/textwrap-BI-yJ6Wt.cjs +4 -0
- package/dist/{tree-BX380Rr7.cjs → tree-CLpxYbKa.cjs} +1 -1
- package/dist/{tree-CjVZLRw7.js → tree-DNJorJUf.js} +1 -1
- package/dist/vue/async.d.cts +174 -2
- package/dist/vue/async.d.ts +174 -2
- package/dist/vue/index.d.cts +218 -3
- package/dist/vue/index.d.ts +218 -3
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +7 -7
- package/dist/{workbook-session-BvToI-Fd.js → workbook-session-B8pNW24X.js} +153 -140
- package/dist/{workbook-session-Bjv1YCRK.cjs → workbook-session-DN5LSA5C.cjs} +12 -12
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +84 -1
- package/dist/worker.d.ts +84 -1
- package/dist/worker.js +12 -157
- package/dist/xlsx-node.cjs +33 -33
- package/dist/xlsx-node.js +1282 -1289
- package/dist/xlsx.cjs +4 -3
- package/dist/xlsx.d.cts +90 -2
- package/dist/xlsx.d.ts +90 -2
- package/dist/xlsx.js +279 -259
- package/package.json +6 -3
- package/dist/ReportPreview-ChV19HBp.js +0 -4619
- package/dist/ReportPreview-DbLvvOUT.cjs +0 -6
- package/dist/RuleEditor-C_Clasvd.js +0 -2037
- package/dist/RuleEditor-XhGHK8DE.cjs +0 -1
- package/dist/assets-B9ImAi6_.cjs +0 -1
- package/dist/assets-DEaz4qsp.js +0 -124
- package/dist/batch-BaP6pWDE.cjs +0 -1
- package/dist/batch-CGyt-b2W.js +0 -273
- package/dist/capabilities-CAh2Nrue.cjs +0 -1
- package/dist/capabilities-DskCHs3V.js +0 -69
- package/dist/computed-C-4C2S5h.js +0 -521
- package/dist/computed-CGV2a809.cjs +0 -1
- package/dist/config-D10us76d.cjs +0 -1
- package/dist/data-explanation-B8MZRYVS.js +0 -16
- package/dist/data-explanation-DE55G30w.cjs +0 -1
- package/dist/dataset-BkRmwgeJ.cjs +0 -1
- package/dist/dataset-H5pFuQGU.js +0 -121
- package/dist/defaults-DXhiM1ZD.js +0 -10
- package/dist/defaults-xhmcLLrf.cjs +0 -1
- package/dist/designer-2bDlcNXQ.js +0 -5136
- package/dist/designer-BT7XCdbW.cjs +0 -2
- package/dist/drill-DYTxuL3A.cjs +0 -1
- package/dist/grid-strokes-Cr7DwUux.cjs +0 -1
- package/dist/grid-strokes-DyyG1q_o.js +0 -53
- package/dist/json-snapshot-DFb2eWkf.js +0 -1416
- package/dist/json-snapshot-WWSGlaHG.cjs +0 -2
- package/dist/matrix-CGRGkn5s.js +0 -112
- package/dist/matrix-gEO7ZM_u.cjs +0 -1
- package/dist/prepared-CFy9B75C.cjs +0 -1
- package/dist/prepared-ajM-H-9B.js +0 -69
- package/dist/record-bindings-By_UKZ2g.cjs +0 -1
- package/dist/render-plan-7xpGrCEl.cjs +0 -1
- package/dist/render-plan-Ck6koX9L.js +0 -13
- package/dist/sha256-ArEYjaTI.cjs +0 -1
- package/dist/sha256-DPEuJ3nh.js +0 -155
- package/dist/style-CQ1PK8ZB.js +0 -67
- package/dist/style-UgIJSA1F.cjs +0 -1
- package/dist/template-catalog-FJE_c9Qe.cjs +0 -1
- package/dist/template-registry-Co1zPq5e.cjs +0 -1
- package/dist/textwrap-CWHyzkBH.cjs +0 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function u(e){throw new Error(`数据契约无效:${e}`)}function d(e){return typeof e=="string"&&e.trim().length>0&&e.length<=4096}function y(e){for(const n of["description","missingMeaning"])e[n]!==void 0&&!d(e[n])&&u(`${n} 应为 1–4096 位非空字符串`);e.aggregation!==void 0&&!["sum","avg","min","max","count","none"].includes(e.aggregation)&&u("未知字段聚合语义"),e.aggregation&&!["count","none"].includes(e.aggregation)&&!["number","decimal"].includes(e.type)&&u("数值聚合仅适用于 number/decimal"),e.format!==void 0&&l(e),e.calculation!==void 0&&(!e.calculation||!d(e.calculation.description)||!Array.isArray(e.calculation.dependsOn)||!e.calculation.dependsOn.length||e.calculation.dependsOn.length>256||e.calculation.dependsOn.some(n=>typeof n!="string"||!n.trim())||new Set(e.calculation.dependsOn).size!==e.calculation.dependsOn.length)&&u("计算说明需包含说明及 1–256 个唯一依赖字段")}function l(e){const n=e.format;if((!n||!["number","percent","date"].includes(n.kind))&&u("未知字段显示格式"),n.kind==="date"){(e.type!=="date"||n.pattern!==void 0&&(!d(n.pattern)||n.pattern.length>128))&&u("日期格式仅适用于日期,pattern 最多 128 位");return}["number","decimal"].includes(e.type)||u("数值显示格式仅适用于 number/decimal"),n.digits!==void 0&&(!Number.isSafeInteger(n.digits)||n.digits<0||n.digits>100)&&u("显示小数位应为 0–100 的整数"),n.kind==="number"&&n.thousands!==void 0&&typeof n.thousands!="boolean"&&u("thousands 应为布尔值")}function b(e){const n=new Map(e.map(i=>[i.field,i])),t=new Set;for(const i of e){const o=[{field:i.field,exit:!1}],m=new Set;for(;o.length;){const s=o.pop();if(s.exit){m.delete(s.field),t.add(s.field);continue}if(m.has(s.field)&&u("字段计算依赖存在循环"),t.has(s.field))continue;const r=n.get(s.field);r||u(`计算依赖字段未声明:${s.field}`),m.add(s.field),o.push({field:s.field,exit:!0});for(const c of r.calculation?.dependsOn??[])o.push({field:c,exit:!1})}}}const x=["text","number","boolean","date","decimal"],w=new Set(["__proto__","prototype","constructor"]);function a(e){throw new Error(`数据契约无效:${e}`)}function h(e){(!e||!Array.isArray(e.fields)||!e.fields.length||e.fields.length>2048)&&a("fields 应包含 1–2048 个字段");const n=new Set;for(const t of e.fields)(!t||typeof t.field!="string"||!t.field.trim()||w.has(t.field)||n.has(t.field))&&a("字段名应安全、非空且唯一"),n.add(t.field),x.includes(t.type)||a(`未知字段类型 ${t.type}`),k(t),$(t),y(t),v(t);L(e,n),b(e.fields)}function v(e){e.enum!==void 0&&(!Array.isArray(e.enum)||!e.enum.length||e.enum.some(n=>!f(n,e.type)))&&a("enum 应为匹配字段类型的非空标量数组")}function L(e,n){e.rowKey!==void 0&&((typeof e.rowKey!="string"||!e.rowKey.trim()||!n.has(e.rowKey))&&a("rowKey 应为引用已声明字段的非空字符串"),e.fields.find(t=>t.field===e.rowKey)?.type==="boolean"&&a("布尔字段不能作为业务主键"))}function $(e){for(const n of["label","unit"])e[n]!==void 0&&typeof e[n]!="string"&&a(`${n} 应为字符串`);for(const n of["required","nullable"])e[n]!==void 0&&typeof e[n]!="boolean"&&a(`${n} 应为布尔值`);e.semanticRole!==void 0&&!["identifier","dimension","measure","date","text"].includes(e.semanticRole)&&a("未知字段语义")}function k(e){for(const n of["min","max","minLength","maxLength"]){const t=e[n];t!==void 0&&(!Number.isFinite(t)||n.includes("Length")&&(!Number.isInteger(t)||t<0))&&a(`${n} 无效`)}e.min!==void 0&&e.max!==void 0&&e.min>e.max&&a("min 不能超过 max"),e.minLength!==void 0&&e.maxLength!==void 0&&e.minLength>e.maxLength&&a("minLength 不能超过 maxLength"),e.type!=="number"&&(e.min!==void 0||e.max!==void 0)&&a("min/max 仅适用于 number,精确小数文本需业务校验"),["number","boolean"].includes(e.type)&&(e.minLength!==void 0||e.maxLength!==void 0)&&a("长度约束仅适用于文本类型")}function S(e){const n=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!n)return!1;const t=Number(n[1]),i=Number(n[2]),o=Number(n[3]),m=t%4===0&&(t%100!==0||t%400===0);return t>0&&i>=1&&i<=12&&o>=1&&o<=[31,m?29:28,31,30,31,30,31,31,30,31,30,31][i-1]}function f(e,n){return n==="number"?typeof e=="number"&&Number.isFinite(e):n==="boolean"?typeof e=="boolean":typeof e!="string"?!1:n==="date"?S(e):n==="decimal"?e.length<=1e4&&/^-?(?:0|[1-9]\d*)(?:\.\d+)?$/.test(e):!0}function O(e,n){if(e==null)return n.required||e===null&&n.nullable===!1?{code:"required",message:"缺少必需字段值"}:void 0;if(!f(e,n.type))return{code:"type",message:`值应为 ${n.type},不会自动转换原始值`};if(n.enum&&!n.enum.includes(e))return{code:"enum",message:"值不在允许的枚举中"};if(typeof e=="number"&&(n.min!==void 0&&e<n.min||n.max!==void 0&&e>n.max))return{code:"range",message:"数值超出范围"};if(typeof e=="string"&&!K(e,n))return{code:"range",message:"文本长度超出范围"}}function K(e,n){if(n.minLength===void 0&&n.maxLength===void 0)return!0;let t=0;for(const i of e)t++;return(n.minLength===void 0||t>=n.minLength)&&(n.maxLength===void 0||t<=n.maxLength)}function g(e,n){const t=e??n;if(!Number.isInteger(t)||t<1)throw new Error("数据校验预算应为正整数");return t}function A(e,n,t){const i=Object.prototype.hasOwnProperty.call(e,n)?e[n]:void 0;if((typeof i!="string"||!i.trim())&&!(typeof i=="number"&&Number.isFinite(i)))return"业务主键应为非空字符串或有限数字";const o=JSON.stringify([typeof i,i]);if(t.has(o))return"业务主键重复";t.add(o)}function N(e,n,t={}){h(n);const i=t.path??"$.rows",o=[],m=g(t.maxIssues,100);if(!Array.isArray(e))return{ok:!1,issues:[{code:"row",path:i,message:"数据集应为对象数组"}]};if(e.length>g(t.maxRows,1e5)||e.length*n.fields.length>g(t.maxCells,2e6))return{ok:!1,issues:[{code:"budget",path:i,message:"数据校验超出行数或单元格预算"}]};const s=new Set;for(let r=0;r<e.length&&o.length<m;r++){const c=e[r];if(!c||typeof c!="object"||Array.isArray(c)){o.push({code:"row",path:`${i}[${r}]`,rowIndex:r,message:"行应为对象"});continue}R(c,n,r,i,s,o,m)}return{ok:o.length===0,issues:o}}function R(e,n,t,i,o,m,s){for(const r of n.fields){if(m.length>=s)return;const c=O(Object.prototype.hasOwnProperty.call(e,r.field)?e[r.field]:void 0,r);c&&m.push({...c,rowIndex:t,field:r.field,path:`${i}[${t}].${r.field}`})}if(n.rowKey&&m.length<s){const r=A(e,n.rowKey,o);r&&m.push({code:"row-key",path:`${i}[${t}].${n.rowKey}`,message:r,rowIndex:t,field:n.rowKey})}}function E(e){return h(e),{$schema:"https://json-schema.org/draft/2020-12/schema",type:"array",items:{type:"object",properties:Object.fromEntries(e.fields.map(t=>[t.field,M(t,t.field===e.rowKey)])),required:e.fields.filter(t=>t.required||t.field===e.rowKey).map(t=>t.field),additionalProperties:!0},...e.rowKey?{"x-report-rowKey":e.rowKey}:{}}}function M(e,n){const t=!n&&e.nullable!==!1&&!e.required;return{type:t?[p(e.type),"null"]:p(e.type),...e.label?{title:e.label}:{},...e.description?{description:e.description}:{},...e.type==="date"?{format:"date"}:{},...e.type==="decimal"?{pattern:"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"}:{},...e.enum?{enum:t?[...e.enum,null]:[...e.enum]}:{},...e.min===void 0?{}:{minimum:e.min},...e.max===void 0?{}:{maximum:e.max},...j(e,n),...n&&e.type==="text"?{pattern:"\\S"}:{},...e.unit?{"x-report-unit":e.unit}:{},...e.semanticRole?{"x-report-semanticRole":e.semanticRole}:{},...e.aggregation?{"x-report-aggregation":e.aggregation}:{},...e.format?{"x-report-format":{...e.format}}:{},...e.missingMeaning?{"x-report-missingMeaning":e.missingMeaning}:{},...e.calculation?{"x-report-calculation":{description:e.calculation.description,dependsOn:[...e.calculation.dependsOn]}}:{}}}function j(e,n){const t={};return(e.minLength!==void 0||n&&e.type!=="number")&&(t.minLength=Math.max(e.minLength??0,n?1:0)),e.type==="decimal"?t.maxLength=Math.min(e.maxLength??1e4,1e4):e.maxLength!==void 0&&(t.maxLength=e.maxLength),t}function p(e){return e==="text"||e==="date"||e==="decimal"?"string":e}exports.datasetJsonSchema=E;exports.validateDatasetRows=N;
|