@agile-team/mach-report 2.10.0 → 2.11.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 (111) hide show
  1. package/README.md +6 -2
  2. package/dist/ExcelBindingWizard-CjIiVox-.cjs +1 -0
  3. package/dist/ExcelBindingWizard-Dxm-K5HL.js +1240 -0
  4. package/dist/ParamEditor-D-Hf5xfO.cjs +1 -0
  5. package/dist/ParamEditor-DRGxzxeO.js +381 -0
  6. package/dist/ReportBatchPanel-BYgg0EDB.cjs +1 -0
  7. package/dist/ReportBatchPanel-Bby5yLzU.js +287 -0
  8. package/dist/ReportPreview-DWXROHBP.cjs +6 -0
  9. package/dist/ReportPreview-DiNXhQI0.js +4138 -0
  10. package/dist/ReportTemplateLibrary-C6CO7YCT.cjs +1 -0
  11. package/dist/ReportTemplateLibrary-DfzDXRvr.js +260 -0
  12. package/dist/RuleEditor-C2QsOHOs.cjs +1 -0
  13. package/dist/RuleEditor-D9wQHrkf.js +2024 -0
  14. package/dist/TemplateReviewPanel-BKofGrV9.js +222 -0
  15. package/dist/TemplateReviewPanel-DwtOcLue.cjs +1 -0
  16. package/dist/analytics.cjs +1 -1
  17. package/dist/analytics.d.cts +2 -0
  18. package/dist/analytics.d.ts +2 -0
  19. package/dist/analytics.js +29 -29
  20. package/dist/batch-Bt3Fd27Z.cjs +1 -0
  21. package/dist/batch-mRqhhhjt.js +364 -0
  22. package/dist/computed-Bvk0W15F.js +521 -0
  23. package/dist/computed-CGV2a809.cjs +1 -0
  24. package/dist/config-B612mw0x.js +525 -0
  25. package/dist/config-BRoLo2oj.cjs +1 -0
  26. package/dist/designer.cjs +2 -2
  27. package/dist/designer.d.cts +659 -9
  28. package/dist/designer.d.ts +659 -9
  29. package/dist/designer.js +2030 -1824
  30. package/dist/index.cjs +8 -8
  31. package/dist/index.d.cts +147 -3
  32. package/dist/index.d.ts +147 -3
  33. package/dist/index.js +639 -592
  34. package/dist/injection-keys-Db_DyLkm.cjs +1 -0
  35. package/dist/injection-keys-e85udZCp.js +7 -0
  36. package/dist/list-cell-BuYn4tGF.cjs +1 -0
  37. package/dist/{list-cell-Dxyi7DOw.js → list-cell-ClFra1zS.js} +54 -40
  38. package/dist/matrix-DVyWiYsd.cjs +1 -0
  39. package/dist/matrix-yZsGnldA.js +227 -0
  40. package/dist/param-validation-BlHHXs6u.js +153 -0
  41. package/dist/param-validation-DCK039V1.cjs +1 -0
  42. package/dist/pdf.cjs +25 -25
  43. package/dist/pdf.d.cts +3 -0
  44. package/dist/pdf.d.ts +3 -0
  45. package/dist/pdf.js +677 -677
  46. package/dist/plugin-BDTU4D94.cjs +1 -0
  47. package/dist/plugin-Cd5G2QQn.js +22 -0
  48. package/dist/region-binding-workflow-CXDmt9Bs.js +977 -0
  49. package/dist/region-binding-workflow-DhQvu1co.cjs +3 -0
  50. package/dist/{report-params-B_VCihAh.js → report-params-B44imUd4.js} +1 -1
  51. package/dist/{report-params-CjWrjPl6.cjs → report-params-SJfhKgaX.cjs} +1 -1
  52. package/dist/server/node.d.cts +5 -2
  53. package/dist/server/node.d.ts +5 -2
  54. package/dist/server-node.cjs +1 -1
  55. package/dist/server-node.js +87 -87
  56. package/dist/server.cjs +1 -1
  57. package/dist/server.d.cts +201 -2
  58. package/dist/server.d.ts +201 -2
  59. package/dist/server.js +557 -658
  60. package/dist/style.css +1 -1
  61. package/dist/template-registry-WNXdkiET.js +506 -0
  62. package/dist/template-registry-ukBGlm8N.cjs +1 -0
  63. package/dist/template-review-BXp2oyqg.cjs +1 -0
  64. package/dist/template-review-BdcXSYbx.js +1616 -0
  65. package/dist/tree-BX380Rr7.cjs +1 -0
  66. package/dist/tree-CqcQ99NM.js +172 -0
  67. package/dist/{validate-UUy9yP4K.js → validate-7s0yn6ii.js} +44 -44
  68. package/dist/validate-DsRiNw8h.cjs +1 -0
  69. package/dist/vue/async.d.cts +93 -4
  70. package/dist/vue/async.d.ts +93 -4
  71. package/dist/vue/index.d.cts +145 -7
  72. package/dist/vue/index.d.ts +145 -7
  73. package/dist/vue-async.cjs +1 -1
  74. package/dist/vue-async.js +5 -5
  75. package/dist/vue.cjs +1 -1
  76. package/dist/vue.js +116 -113
  77. package/dist/{workbook-session-B-bW5_yR.js → workbook-session-BKOTwcoq.js} +1 -1
  78. package/dist/{workbook-session-D7RtdNo0.cjs → workbook-session-CLYLhZWu.cjs} +1 -1
  79. package/dist/worker.cjs +1 -1
  80. package/dist/worker.d.cts +5 -2
  81. package/dist/worker.d.ts +5 -2
  82. package/dist/worker.js +1 -1
  83. package/dist/xlsx.cjs +3 -3
  84. package/dist/xlsx.d.cts +129 -2
  85. package/dist/xlsx.d.ts +129 -2
  86. package/dist/xlsx.js +336 -242
  87. package/package.json +1 -1
  88. package/dist/ExcelBindingWizard-CF7RplWm.cjs +0 -1
  89. package/dist/ExcelBindingWizard-qhwEderR.js +0 -842
  90. package/dist/ReportPreview-BE1tCHqE.js +0 -4604
  91. package/dist/ReportPreview-QKRKQOe3.cjs +0 -6
  92. package/dist/RuleEditor-BA36yIV6.js +0 -1723
  93. package/dist/RuleEditor-CczJ6mJm.cjs +0 -1
  94. package/dist/TemplateReviewPanel-CHi4Alqa.cjs +0 -1
  95. package/dist/TemplateReviewPanel-Dz0G5o83.js +0 -217
  96. package/dist/binding-preview-BWsdf_z2.cjs +0 -2
  97. package/dist/binding-preview-DILq0-0f.js +0 -649
  98. package/dist/decimal-CI1OAczk.js +0 -87
  99. package/dist/decimal-CQA0xJex.cjs +0 -1
  100. package/dist/list-cell-CyM1ZlRN.cjs +0 -1
  101. package/dist/matrix-BbXarwyk.js +0 -661
  102. package/dist/matrix-Cm65WLLP.cjs +0 -1
  103. package/dist/param-validation-BWNjLcN0.js +0 -116
  104. package/dist/param-validation-CiTxFeZ8.cjs +0 -1
  105. package/dist/plugin-CThk42vJ.cjs +0 -1
  106. package/dist/plugin-tGn7-5oF.js +0 -25
  107. package/dist/template-registry-CGWTLtIA.cjs +0 -1
  108. package/dist/template-registry-DzlQs3OF.js +0 -434
  109. package/dist/template-review-D1RoNCPw.cjs +0 -1
  110. package/dist/template-review-fnteXRng.js +0 -1473
  111. package/dist/validate-Bf6ccFr2.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";const s=require("./computed-CGV2a809.cjs");class g extends Error{constructor(r){super(`树节点超出行数预算 ${r}`),this.limit=r,this.code="tree-row-limit",this.name="TreeRowLimitError"}}function u(e,r,i,t){const n=e??r;if(!Number.isInteger(n)||n<1||n>i)throw new Error(`${t}应为 1–${i} 的整数`);return n}function w(e){return{rows:u(e.maxRows,1e5,1e6,"树行数预算"),depth:u(e.maxDepth,64,256,"树深度预算"),visits:u(e.maxAggregationVisits,1e6,1e7,"树聚合访问预算")}}function m(e){return typeof e=="string"&&!!e.trim()}function c(e){return m(e)&&!["__proto__","prototype","constructor"].includes(e)}function E(e){if(m(e)||typeof e=="number"&&Number.isFinite(e))return e;throw new Error("树节点业务键应为非空字符串或有限数字")}function p(e){return JSON.stringify([typeof e,e])}function F(e){return[e.idField,...e.input==="flat"?[e.parentField??""]:[e.childrenField??"children"]]}function y(e,r){const i=F(e);if(r?.some(t=>t.scope&&t.scope!=="row"||i.includes(t.field)))throw new Error("树形布局仅支持不覆盖结构键的当前行计算")}function h(e){if(!e?.aborted)return;const r=new Error("树报表处理已取消");throw r.name="AbortError",r}function k(e){const r=e.aggregates??[];if(!Array.isArray(r)||r.length>32)throw new Error("树聚合最多 32 项");if(e.parentValues!=="leaf-aggregate"&&r.length)throw new Error("树聚合需显式选择 leaf-aggregate 父级取值策略");if(e.parentValues==="leaf-aggregate"&&!r.length)throw new Error("叶子聚合策略至少需要一个聚合字段");const i=new Set;for(const t of r){if(!t||!c(t.field)||i.has(t.field))throw new Error("树聚合输出字段应安全、非空且唯一");for(const n of[t.valueField,t.weightField])if(n!==void 0&&!c(n))throw new Error("树聚合来源字段应安全且非空");if([...F(e),e.labelField].includes(t.field))throw new Error("树聚合不能覆盖结构键或标签字段");i.add(t.field),s.createAggregateAccumulator({...t,field:t.valueField??t.field})}}function N(e){if(!c(e.idField)||!c(e.labelField))throw new Error("树需要安全的业务键和标签字段");if(e.input==="flat"&&(!c(e.parentField)||e.parentField===e.idField))throw new Error("扁平树需要独立的父键字段");if(e.childrenField!==void 0&&!c(e.childrenField))throw new Error("子节点字段应安全且非空");if(e.input==="nested"&&[e.idField,e.labelField].includes(e.childrenField??"children"))throw new Error("子节点字段不能覆盖业务键或标签字段")}function v(e){if(!e||typeof e!="object"||!["flat","nested"].includes(e.input))throw new Error("树输入应为 flat 或 nested");if(N(e),e.orphan!==void 0&&!["error","root"].includes(e.orphan))throw new Error("树孤儿策略应为 error 或 root");if(e.parentValues!==void 0&&!["source","leaf-aggregate"].includes(e.parentValues))throw new Error("未知树父级取值策略");if(e.indentMm!==void 0&&(!Number.isFinite(e.indentMm)||e.indentMm<0||e.indentMm>20))throw new Error("树每级缩进应为 0–20 mm");w(e),k(e)}function A(e,r,i,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("树节点应为对象");if(i.size>=t.rows)throw new g(t.rows);const n=E(e[r.idField]),l=p(n);if(i.has(l))throw new Error(`树节点业务键重复:${String(n)}`);const o={original:e,row:e,key:n,depth:0,children:[]};return i.set(l,o),o}function $(e,r,i,t,n){for(const o of e)h(n),A(o,r,i,t);const l=[];for(const o of i.values()){h(n);const a=o.row[r.parentField];if(a==null){l.push(o);continue}const d=i.get(p(E(a)));if(!d){if(r.orphan!=="root")throw new Error(`树节点 ${String(o.key)} 的父节点不存在`);l.push(o);continue}if(d===o)throw new Error("树节点不能以自身为父节点");o.parent=d,d.children.push(o)}return l}function M(e,r,i,t,n){const l=[],o=[{rows:e,next:0}];for(;o.length;){h(n);const a=o[o.length-1];if(a.next>=a.rows.length){o.pop();continue}const d=A(a.rows[a.next++],r,i,t);if(d.parent=a.parent,d.depth=o.length-1,o.length>t.depth)throw new Error(`树节点超出深度预算 ${t.depth}`);(a.parent?.children??l).push(d);const f=d.row[r.childrenField??"children"];if(f!=null){if(!Array.isArray(f))throw new Error("嵌套树 children 字段应为数组");f.length&&o.push({rows:f,next:0,parent:d})}}return l}function V(e,r,i,t){const n=[],l=[{nodes:e,next:0}];for(;l.length;){h(t);const o=l[l.length-1];if(o.next>=o.nodes.length){l.pop();continue}if(l.length>i.depth)throw new Error(`树节点超出深度预算 ${i.depth}`);const a=o.nodes[o.next++];a.depth=l.length-1,n.push(a),a.children.length&&l.push({nodes:a.children,next:0})}if(n.length!==r)throw new Error("树父子关系存在循环");return n}function S(e,r,i,t){if(r.parentValues!=="leaf-aggregate")return;const n=r.aggregates,l=new Map;for(const a of e)a.children.length&&l.set(a,n.map(d=>s.createAggregateAccumulator({...d,field:d.valueField??d.field})));let o=0;for(const a of e)if(!a.children.length)for(let d=a.parent;d;d=d.parent){if(h(t),o+=n.length,o>i.visits)throw new Error(`树聚合超出访问预算 ${i.visits}`);for(const f of l.get(d))f.add(a.row)}for(const[a,d]of l)a.row={...a.row},n.forEach((f,T)=>{a.row[f.field]=d[T].value()})}function b(e,r,i){if(v(r),h(i),!Array.isArray(e))throw new Error("树数据应为节点数组");const t=w(r),n=new Map,l=r.input==="flat"?$(e,r,n,t,i):M(e,r,n,t,i);return V(l,n.size,t,i)}function x(e,r,i){return b(e,r,i).map(t=>t.original)}function O(e,r,i={}){const t=b(e,r,i.signal);if(y(r,i.computed?.fields),i.computed?.fields.length){const n=s.computeDataset(t.map(l=>l.row),{...i.computed,signal:i.signal}).rows;t.forEach((l,o)=>{l.row=n[o]})}return S(t,r,w(r),i.signal),{rows:t.map(n=>n.row),entries:t.map(n=>({row:n.row,original:n.original,key:n.key,depth:n.depth,hasChildren:!!n.children.length})),leaves:t.filter(n=>!n.children.length).map(n=>n.row)}}exports.TreeRowLimitError=g;exports.createTreeTable=O;exports.flattenTreeInput=x;exports.validateTreeComputed=y;exports.validateTreeOptions=v;
@@ -0,0 +1,172 @@
1
+ import { d as A, e as w } from "./computed-Bvk0W15F.js";
2
+ class b extends Error {
3
+ constructor(r) {
4
+ super(`树节点超出行数预算 ${r}`), this.limit = r, this.code = "tree-row-limit", this.name = "TreeRowLimitError";
5
+ }
6
+ }
7
+ function s(e, r, i, t) {
8
+ const n = e ?? r;
9
+ if (!Number.isInteger(n) || n < 1 || n > i) throw new Error(`${t}应为 1–${i} 的整数`);
10
+ return n;
11
+ }
12
+ function u(e) {
13
+ return { rows: s(e.maxRows, 1e5, 1e6, "树行数预算"), depth: s(e.maxDepth, 64, 256, "树深度预算"), visits: s(e.maxAggregationVisits, 1e6, 1e7, "树聚合访问预算") };
14
+ }
15
+ function g(e) {
16
+ return typeof e == "string" && !!e.trim();
17
+ }
18
+ function c(e) {
19
+ return g(e) && !["__proto__", "prototype", "constructor"].includes(e);
20
+ }
21
+ function m(e) {
22
+ if (g(e) || typeof e == "number" && Number.isFinite(e)) return e;
23
+ throw new Error("树节点业务键应为非空字符串或有限数字");
24
+ }
25
+ function E(e) {
26
+ return JSON.stringify([typeof e, e]);
27
+ }
28
+ function p(e) {
29
+ return [e.idField, ...e.input === "flat" ? [e.parentField ?? ""] : [e.childrenField ?? "children"]];
30
+ }
31
+ function k(e, r) {
32
+ const i = p(e);
33
+ if (r?.some((t) => t.scope && t.scope !== "row" || i.includes(t.field))) throw new Error("树形布局仅支持不覆盖结构键的当前行计算");
34
+ }
35
+ function h(e) {
36
+ if (!e?.aborted) return;
37
+ const r = new Error("树报表处理已取消");
38
+ throw r.name = "AbortError", r;
39
+ }
40
+ function N(e) {
41
+ const r = e.aggregates ?? [];
42
+ if (!Array.isArray(r) || r.length > 32) throw new Error("树聚合最多 32 项");
43
+ if (e.parentValues !== "leaf-aggregate" && r.length) throw new Error("树聚合需显式选择 leaf-aggregate 父级取值策略");
44
+ if (e.parentValues === "leaf-aggregate" && !r.length) throw new Error("叶子聚合策略至少需要一个聚合字段");
45
+ const i = /* @__PURE__ */ new Set();
46
+ for (const t of r) {
47
+ if (!t || !c(t.field) || i.has(t.field)) throw new Error("树聚合输出字段应安全、非空且唯一");
48
+ for (const n of [t.valueField, t.weightField]) if (n !== void 0 && !c(n)) throw new Error("树聚合来源字段应安全且非空");
49
+ if ([...p(e), e.labelField].includes(t.field)) throw new Error("树聚合不能覆盖结构键或标签字段");
50
+ i.add(t.field), w({ ...t, field: t.valueField ?? t.field });
51
+ }
52
+ }
53
+ function T(e) {
54
+ if (!c(e.idField) || !c(e.labelField)) throw new Error("树需要安全的业务键和标签字段");
55
+ if (e.input === "flat" && (!c(e.parentField) || e.parentField === e.idField)) throw new Error("扁平树需要独立的父键字段");
56
+ if (e.childrenField !== void 0 && !c(e.childrenField)) throw new Error("子节点字段应安全且非空");
57
+ if (e.input === "nested" && [e.idField, e.labelField].includes(e.childrenField ?? "children")) throw new Error("子节点字段不能覆盖业务键或标签字段");
58
+ }
59
+ function $(e) {
60
+ if (!e || typeof e != "object" || !["flat", "nested"].includes(e.input)) throw new Error("树输入应为 flat 或 nested");
61
+ if (T(e), e.orphan !== void 0 && !["error", "root"].includes(e.orphan)) throw new Error("树孤儿策略应为 error 或 root");
62
+ if (e.parentValues !== void 0 && !["source", "leaf-aggregate"].includes(e.parentValues)) throw new Error("未知树父级取值策略");
63
+ if (e.indentMm !== void 0 && (!Number.isFinite(e.indentMm) || e.indentMm < 0 || e.indentMm > 20)) throw new Error("树每级缩进应为 0–20 mm");
64
+ u(e), N(e);
65
+ }
66
+ function F(e, r, i, t) {
67
+ if (!e || typeof e != "object" || Array.isArray(e)) throw new Error("树节点应为对象");
68
+ if (i.size >= t.rows) throw new b(t.rows);
69
+ const n = m(e[r.idField]), l = E(n);
70
+ if (i.has(l)) throw new Error(`树节点业务键重复:${String(n)}`);
71
+ const o = { original: e, row: e, key: n, depth: 0, children: [] };
72
+ return i.set(l, o), o;
73
+ }
74
+ function M(e, r, i, t, n) {
75
+ for (const o of e)
76
+ h(n), F(o, r, i, t);
77
+ const l = [];
78
+ for (const o of i.values()) {
79
+ h(n);
80
+ const a = o.row[r.parentField];
81
+ if (a == null) {
82
+ l.push(o);
83
+ continue;
84
+ }
85
+ const f = i.get(E(m(a)));
86
+ if (!f) {
87
+ if (r.orphan !== "root") throw new Error(`树节点 ${String(o.key)} 的父节点不存在`);
88
+ l.push(o);
89
+ continue;
90
+ }
91
+ if (f === o) throw new Error("树节点不能以自身为父节点");
92
+ o.parent = f, f.children.push(o);
93
+ }
94
+ return l;
95
+ }
96
+ function V(e, r, i, t, n) {
97
+ const l = [], o = [{ rows: e, next: 0 }];
98
+ for (; o.length; ) {
99
+ h(n);
100
+ const a = o[o.length - 1];
101
+ if (a.next >= a.rows.length) {
102
+ o.pop();
103
+ continue;
104
+ }
105
+ const f = F(a.rows[a.next++], r, i, t);
106
+ if (f.parent = a.parent, f.depth = o.length - 1, o.length > t.depth) throw new Error(`树节点超出深度预算 ${t.depth}`);
107
+ (a.parent?.children ?? l).push(f);
108
+ const d = f.row[r.childrenField ?? "children"];
109
+ if (d != null) {
110
+ if (!Array.isArray(d)) throw new Error("嵌套树 children 字段应为数组");
111
+ d.length && o.push({ rows: d, next: 0, parent: f });
112
+ }
113
+ }
114
+ return l;
115
+ }
116
+ function x(e, r, i, t) {
117
+ const n = [], l = [{ nodes: e, next: 0 }];
118
+ for (; l.length; ) {
119
+ h(t);
120
+ const o = l[l.length - 1];
121
+ if (o.next >= o.nodes.length) {
122
+ l.pop();
123
+ continue;
124
+ }
125
+ if (l.length > i.depth) throw new Error(`树节点超出深度预算 ${i.depth}`);
126
+ const a = o.nodes[o.next++];
127
+ a.depth = l.length - 1, n.push(a), a.children.length && l.push({ nodes: a.children, next: 0 });
128
+ }
129
+ if (n.length !== r) throw new Error("树父子关系存在循环");
130
+ return n;
131
+ }
132
+ function S(e, r, i, t) {
133
+ if (r.parentValues !== "leaf-aggregate") return;
134
+ const n = r.aggregates, l = /* @__PURE__ */ new Map();
135
+ for (const a of e) a.children.length && l.set(a, n.map((f) => w({ ...f, field: f.valueField ?? f.field })));
136
+ let o = 0;
137
+ for (const a of e)
138
+ if (!a.children.length)
139
+ for (let f = a.parent; f; f = f.parent) {
140
+ if (h(t), o += n.length, o > i.visits) throw new Error(`树聚合超出访问预算 ${i.visits}`);
141
+ for (const d of l.get(f)) d.add(a.row);
142
+ }
143
+ for (const [a, f] of l)
144
+ a.row = { ...a.row }, n.forEach((d, v) => {
145
+ a.row[d.field] = f[v].value();
146
+ });
147
+ }
148
+ function y(e, r, i) {
149
+ if ($(r), h(i), !Array.isArray(e)) throw new Error("树数据应为节点数组");
150
+ const t = u(r), n = /* @__PURE__ */ new Map(), l = r.input === "flat" ? M(e, r, n, t, i) : V(e, r, n, t, i);
151
+ return x(l, n.size, t, i);
152
+ }
153
+ function O(e, r, i) {
154
+ return y(e, r, i).map((t) => t.original);
155
+ }
156
+ function R(e, r, i = {}) {
157
+ const t = y(e, r, i.signal);
158
+ if (k(r, i.computed?.fields), i.computed?.fields.length) {
159
+ const n = A(t.map((l) => l.row), { ...i.computed, signal: i.signal }).rows;
160
+ t.forEach((l, o) => {
161
+ l.row = n[o];
162
+ });
163
+ }
164
+ return S(t, r, u(r), i.signal), { rows: t.map((n) => n.row), entries: t.map((n) => ({ row: n.row, original: n.original, key: n.key, depth: n.depth, hasChildren: !!n.children.length })), leaves: t.filter((n) => !n.children.length).map((n) => n.row) };
165
+ }
166
+ export {
167
+ b as T,
168
+ k as a,
169
+ R as c,
170
+ O as f,
171
+ $ as v
172
+ };
@@ -1,25 +1,25 @@
1
1
  function c(e, i, s) {
2
2
  e.editable !== void 0 && typeof e.editable != "boolean" && s.push({ path: `${i}.editable`, message: "编辑控制应为布尔值" }), e.valueType !== void 0 && !["text", "number", "boolean"].includes(e.valueType) && s.push({ path: `${i}.valueType`, message: "编辑类型应为 text、number 或 boolean" });
3
3
  }
4
- function l(e, i, s) {
5
- c(e, i, s), e.derived !== void 0 && typeof e.derived != "boolean" && s.push({ path: `${i}.derived`, message: "派生结果标记应为布尔值" }), r(e.source, `${i}.source`, s, !0), e.formula !== void 0 && typeof e.formula != "string" && s.push({ path: `${i}.formula`, message: "单元格公式应为字符串" });
4
+ function y(e, i, s) {
5
+ c(e, i, s), e.indentMm !== void 0 && (typeof e.indentMm != "number" || !Number.isFinite(e.indentMm) || e.indentMm < 0) && s.push({ path: `${i}.indentMm`, message: "单元格缩进应为有限非负数" }), e.derived !== void 0 && typeof e.derived != "boolean" && s.push({ path: `${i}.derived`, message: "派生结果标记应为布尔值" }), g(e.source, `${i}.source`, s, !0), e.formula !== void 0 && typeof e.formula != "string" && s.push({ path: `${i}.formula`, message: "单元格公式应为字符串" });
6
6
  }
7
- function r(e, i, s, t = !1) {
7
+ function g(e, i, s, t = !1) {
8
8
  if (e === void 0) return;
9
9
  if (!e || typeof e != "object" || Array.isArray(e)) {
10
10
  s.push({ path: i, message: "业务来源应为对象" });
11
11
  return;
12
12
  }
13
- const a = e;
14
- for (const n of ["datasetId", ...t ? ["field"] : []])
15
- (typeof a[n] != "string" || !a[n].trim()) && s.push({ path: `${i}.${n}`, message: "业务标识应为非空字符串" });
16
- for (const n of ["rowKey", "revision"]) {
17
- const o = a[n];
18
- o === void 0 && !(t && n === "rowKey") || typeof o != "string" && !(typeof o == "number" && Number.isFinite(o)) && s.push({ path: `${i}.${n}`, message: "业务键及修订号应为字符串或有限数字" });
13
+ const n = e;
14
+ for (const a of ["datasetId", ...t ? ["field"] : []])
15
+ (typeof n[a] != "string" || !n[a].trim()) && s.push({ path: `${i}.${a}`, message: "业务标识应为非空字符串" });
16
+ for (const a of ["rowKey", "revision"]) {
17
+ const o = n[a];
18
+ o === void 0 && !(t && a === "rowKey") || typeof o != "string" && !(typeof o == "number" && Number.isFinite(o)) && s.push({ path: `${i}.${a}`, message: "业务键及修订号应为字符串或有限数字" });
19
19
  }
20
- a.sourceToken !== void 0 && typeof a.sourceToken != "string" && s.push({ path: `${i}.sourceToken`, message: "来源令牌应为字符串" });
20
+ n.sourceToken !== void 0 && typeof n.sourceToken != "string" && s.push({ path: `${i}.sourceToken`, message: "来源令牌应为字符串" });
21
21
  }
22
- const y = /* @__PURE__ */ new Set([
22
+ const $ = /* @__PURE__ */ new Set([
23
23
  "text",
24
24
  "image",
25
25
  "barcode",
@@ -32,20 +32,20 @@ const y = /* @__PURE__ */ new Set([
32
32
  function u(e) {
33
33
  return typeof e == "object" && e !== null && !Array.isArray(e);
34
34
  }
35
- function $(e, i, s, t) {
36
- const a = e[i];
37
- (typeof a != "number" || !Number.isFinite(a)) && t.push({ path: `${s}.${i}`, message: `应为有限数字,实际 ${JSON.stringify(a)}` });
35
+ function l(e, i, s, t) {
36
+ const n = e[i];
37
+ (typeof n != "number" || !Number.isFinite(n)) && t.push({ path: `${s}.${i}`, message: `应为有限数字,实际 ${JSON.stringify(n)}` });
38
38
  }
39
39
  function v(e, i, s) {
40
40
  if (e !== void 0) {
41
41
  const t = `${i}.table`;
42
42
  if (!u(e)) s.push({ path: t, message: "逻辑表来源应为对象" });
43
43
  else {
44
- r(e.source, `${t}.source`, s), (typeof e.id != "string" || !e.id.trim()) && s.push({ path: `${t}.id`, message: "逻辑表 ID 应为非空字符串" });
45
- const a = e.role;
46
- ["header", "body", "group-header", "subtotal", "grand-total"].includes(a) || s.push({ path: `${t}.role`, message: "未知逻辑表行角色" });
47
- const n = e.rowIndex;
48
- (typeof n != "number" || !Number.isInteger(n) || (a === "header" ? n !== -1 : n < 0)) && s.push({ path: `${t}.rowIndex`, message: "表头索引应为 -1,内容行索引应为非负整数" }), (!Array.isArray(e.columnKeys) || e.columnKeys.some((o) => typeof o != "string")) && s.push({ path: `${t}.columnKeys`, message: "逻辑列字段应为字符串数组" }), e.layout !== void 0 && e.layout !== "page" && e.layout !== "wide" && s.push({ path: `${t}.layout`, message: "布局应为 page 或 wide" }), e.title !== void 0 && typeof e.title != "string" && s.push({ path: `${t}.title`, message: "逻辑表名称应为字符串" });
44
+ g(e.source, `${t}.source`, s), (typeof e.id != "string" || !e.id.trim()) && s.push({ path: `${t}.id`, message: "逻辑表 ID 应为非空字符串" });
45
+ const n = e.role;
46
+ ["header", "body", "group-header", "subtotal", "grand-total"].includes(n) || s.push({ path: `${t}.role`, message: "未知逻辑表行角色" });
47
+ const a = e.rowIndex;
48
+ (typeof a != "number" || !Number.isInteger(a) || (n === "header" ? a !== -1 : a < 0)) && s.push({ path: `${t}.rowIndex`, message: "表头索引应为 -1,内容行索引应为非负整数" }), (!Array.isArray(e.columnKeys) || e.columnKeys.some((o) => typeof o != "string")) && s.push({ path: `${t}.columnKeys`, message: "逻辑列字段应为字符串数组" }), e.layout !== void 0 && e.layout !== "page" && e.layout !== "wide" && s.push({ path: `${t}.layout`, message: "布局应为 page 或 wide" }), e.title !== void 0 && typeof e.title != "string" && s.push({ path: `${t}.title`, message: "逻辑表名称应为字符串" });
49
49
  }
50
50
  }
51
51
  }
@@ -54,46 +54,46 @@ function A(e, i, s, t) {
54
54
  if (!u(e) || !Array.isArray(e.cells))
55
55
  s.push({ path: `${i}.grid.cells`, message: "grid.cells 应为二维数组" });
56
56
  else {
57
- const a = e.paddingMm;
58
- a !== void 0 && (typeof a != "number" || !Number.isFinite(a) || a < 0) && s.push({ path: `${i}.grid.paddingMm`, message: "单元格内距应为有限非负数" }), e.cells.forEach((n, o) => {
59
- if (!Array.isArray(n)) {
57
+ const n = e.paddingMm;
58
+ n !== void 0 && (typeof n != "number" || !Number.isFinite(n) || n < 0) && s.push({ path: `${i}.grid.paddingMm`, message: "单元格内距应为有限非负数" }), e.cells.forEach((a, o) => {
59
+ if (!Array.isArray(a)) {
60
60
  s.push({ path: `${i}.grid.cells.${o}`, message: "行应为数组" });
61
61
  return;
62
62
  }
63
- n.forEach((f, d) => {
63
+ a.forEach((f, d) => {
64
64
  if (f == null) return;
65
65
  const h = `${i}.grid.cells.${o}.${d}`;
66
66
  if (!u(f)) {
67
67
  s.push({ path: h, message: "网格单元格应为对象或 null" });
68
68
  return;
69
69
  }
70
- l(f, h, s), Array.isArray(f.children) && f.children.forEach((p, m) => {
71
- g(p, `${i}.grid.cells.${o}.${d}.children.${m}`, s, t);
70
+ y(f, h, s), Array.isArray(f.children) && f.children.forEach((m, p) => {
71
+ r(m, `${i}.grid.cells.${o}.${d}.children.${p}`, s, t);
72
72
  });
73
73
  });
74
74
  });
75
75
  }
76
76
  }
77
77
  function b(e, i, s) {
78
- e !== void 0 && (Array.isArray(e) ? e.forEach((t, a) => {
79
- (!u(t) || !Array.isArray(t.segments)) && s.push({ path: `${i}.richParagraphs.${a}`, message: "段落缺少 segments 数组" });
78
+ e !== void 0 && (Array.isArray(e) ? e.forEach((t, n) => {
79
+ (!u(t) || !Array.isArray(t.segments)) && s.push({ path: `${i}.richParagraphs.${n}`, message: "段落缺少 segments 数组" });
80
80
  }) : s.push({ path: `${i}.richParagraphs`, message: "richParagraphs 应为数组" }));
81
81
  }
82
- function g(e, i, s, t = []) {
82
+ function r(e, i, s, t = []) {
83
83
  if (!u(e)) {
84
84
  s.push({ path: i, message: "组件应为对象" });
85
85
  return;
86
86
  }
87
- const a = e.kind;
88
- typeof a != "string" ? s.push({ path: `${i}.kind`, message: "组件缺少 kind 字符串" }) : y.has(a) || t.push({
87
+ const n = e.kind;
88
+ typeof n != "string" ? s.push({ path: `${i}.kind`, message: "组件缺少 kind 字符串" }) : $.has(n) || t.push({
89
89
  path: `${i}.kind`,
90
- message: `未知组件类型 ${JSON.stringify(a)},将以兜底方式渲染`
90
+ message: `未知组件类型 ${JSON.stringify(n)},将以兜底方式渲染`
91
91
  });
92
- for (const n of ["leftMm", "topMm", "widthMm", "heightMm"])
93
- $(e, n, i, s);
92
+ for (const a of ["leftMm", "topMm", "widthMm", "heightMm"])
93
+ l(e, a, i, s);
94
94
  typeof e.leftMm == "number" && e.leftMm < -100 && s.push({ path: `${i}.leftMm`, message: "几何数值异常(leftMm<-100)" });
95
- for (const n of ["widthMm", "heightMm"])
96
- typeof e[n] == "number" && e[n] < 0 && s.push({ path: `${i}.${n}`, message: "组件尺寸不能为负数" });
95
+ for (const a of ["widthMm", "heightMm"])
96
+ typeof e[a] == "number" && e[a] < 0 && s.push({ path: `${i}.${a}`, message: "组件尺寸不能为负数" });
97
97
  v(e.table, i, s), e.pageAnchor !== void 0 && !["header", "footer"].includes(e.pageAnchor) && s.push({ path: `${i}.pageAnchor`, message: "页面锚点应为 header 或 footer" }), e.lineDirection !== void 0 && !["down", "up"].includes(e.lineDirection) && s.push({ path: `${i}.lineDirection`, message: "线段方向应为 down 或 up" }), A(e.grid, i, s, t), b(e.richParagraphs, i, s);
98
98
  }
99
99
  function M(e, i, s, t = []) {
@@ -101,11 +101,11 @@ function M(e, i, s, t = []) {
101
101
  s.push({ path: i, message: "页应为对象" });
102
102
  return;
103
103
  }
104
- const a = e.pageWidthMm, n = e.pageHeightMm;
105
- (typeof a != "number" || !Number.isFinite(a) || a <= 0) && s.push({ path: `${i}.pageWidthMm`, message: `页宽非法: ${JSON.stringify(a)}` }), (typeof n != "number" || !(n > 0 && n < 5e3)) && s.push({ path: `${i}.pageHeightMm`, message: `页高非法: ${JSON.stringify(n)}` }), e.layout !== void 0 && e.layout !== "page" && e.layout !== "wide" && s.push({ path: `${i}.layout`, message: "布局应为 page 或 wide" });
104
+ const n = e.pageWidthMm, a = e.pageHeightMm;
105
+ (typeof n != "number" || !Number.isFinite(n) || n <= 0) && s.push({ path: `${i}.pageWidthMm`, message: `页宽非法: ${JSON.stringify(n)}` }), (typeof a != "number" || !(a > 0 && a < 5e3)) && s.push({ path: `${i}.pageHeightMm`, message: `页高非法: ${JSON.stringify(a)}` }), e.layout !== void 0 && e.layout !== "page" && e.layout !== "wide" && s.push({ path: `${i}.layout`, message: "布局应为 page 或 wide" });
106
106
  const o = e.components;
107
107
  Array.isArray(o) ? Array.isArray(o) && o.forEach(
108
- (f, d) => g(f, `${i}.components.${d}`, s, t)
108
+ (f, d) => r(f, `${i}.components.${d}`, s, t)
109
109
  ) : s.push({ path: `${i}.components`, message: "components 应为数组" });
110
110
  }
111
111
  function w(e) {
@@ -116,17 +116,17 @@ function w(e) {
116
116
  message: e == null ? "渲染计划为空" : "渲染计划缺少 pages 数组"
117
117
  });
118
118
  else {
119
- t.forEach((n, o) => M(n, `$.pages.${o}`, i, s)), t.length > 2e3 && s.push({
119
+ t.forEach((a, o) => M(a, `$.pages.${o}`, i, s)), t.length > 2e3 && s.push({
120
120
  path: "$.pages",
121
121
  message: `页数异常大(${t.length} 页),渲染与打印耗时可能显著增加`
122
122
  });
123
- const a = t.reduce(
124
- (n, o) => n + (u(o) && Array.isArray(o.components) ? o.components.length : 0),
123
+ const n = t.reduce(
124
+ (a, o) => a + (u(o) && Array.isArray(o.components) ? o.components.length : 0),
125
125
  0
126
126
  );
127
- a > 5e4 && s.push({
127
+ n > 5e4 && s.push({
128
128
  path: "$.pages",
129
- message: `组件总数异常大(${a} 个),可能触发浏览器性能限制`
129
+ message: `组件总数异常大(${n} 个),可能触发浏览器性能限制`
130
130
  });
131
131
  }
132
132
  return { ok: i.length === 0, errors: i, warnings: s };
@@ -144,5 +144,5 @@ export {
144
144
  M as b,
145
145
  w as c,
146
146
  c as d,
147
- g as v
147
+ r as v
148
148
  };
@@ -0,0 +1 @@
1
+ "use strict";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 $(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,t=!1){if(e===void 0)return;if(!e||typeof e!="object"||Array.isArray(e)){i.push({path:s,message:"业务来源应为对象"});return}const a=e;for(const n of["datasetId",...t?["field"]:[]])(typeof a[n]!="string"||!a[n].trim())&&i.push({path:`${s}.${n}`,message:"业务标识应为非空字符串"});for(const n of["rowKey","revision"]){const o=a[n];o===void 0&&!(t&&n==="rowKey")||typeof o!="string"&&!(typeof o=="number"&&Number.isFinite(o))&&i.push({path:`${s}.${n}`,message:"业务键及修订号应为字符串或有限数字"})}a.sourceToken!==void 0&&typeof a.sourceToken!="string"&&i.push({path:`${s}.sourceToken`,message:"来源令牌应为字符串"})}const v=new Set(["text","image","barcode","qrcode","chart","line","rect","ellipse"]);function u(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function A(e,s,i,t){const a=e[s];(typeof a!="number"||!Number.isFinite(a))&&t.push({path:`${i}.${s}`,message:`应为有限数字,实际 ${JSON.stringify(a)}`})}function b(e,s,i){if(e!==void 0){const t=`${s}.table`;if(!u(e))i.push({path:t,message:"逻辑表来源应为对象"});else{m(e.source,`${t}.source`,i),(typeof e.id!="string"||!e.id.trim())&&i.push({path:`${t}.id`,message:"逻辑表 ID 应为非空字符串"});const a=e.role;["header","body","group-header","subtotal","grand-total"].includes(a)||i.push({path:`${t}.role`,message:"未知逻辑表行角色"});const n=e.rowIndex;(typeof n!="number"||!Number.isInteger(n)||(a==="header"?n!==-1:n<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:"逻辑表名称应为字符串"})}}}function M(e,s,i,t){if(e!==void 0)if(!u(e)||!Array.isArray(e.cells))i.push({path:`${s}.grid.cells`,message:"grid.cells 应为二维数组"});else{const a=e.paddingMm;a!==void 0&&(typeof a!="number"||!Number.isFinite(a)||a<0)&&i.push({path:`${s}.grid.paddingMm`,message:"单元格内距应为有限非负数"}),e.cells.forEach((n,o)=>{if(!Array.isArray(n)){i.push({path:`${s}.grid.cells.${o}`,message:"行应为数组"});return}n.forEach((f,d)=>{if(f==null)return;const r=`${s}.grid.cells.${o}.${d}`;if(!u(f)){i.push({path:r,message:"网格单元格应为对象或 null"});return}$(f,r,i),Array.isArray(f.children)&&f.children.forEach((l,y)=>{h(l,`${s}.grid.cells.${o}.${d}.children.${y}`,i,t)})})})}}function w(e,s,i){e!==void 0&&(Array.isArray(e)?e.forEach((t,a)=>{(!u(t)||!Array.isArray(t.segments))&&i.push({path:`${s}.richParagraphs.${a}`,message:"段落缺少 segments 数组"})}):i.push({path:`${s}.richParagraphs`,message:"richParagraphs 应为数组"}))}function h(e,s,i,t=[]){if(!u(e)){i.push({path:s,message:"组件应为对象"});return}const a=e.kind;typeof a!="string"?i.push({path:`${s}.kind`,message:"组件缺少 kind 字符串"}):v.has(a)||t.push({path:`${s}.kind`,message:`未知组件类型 ${JSON.stringify(a)},将以兜底方式渲染`});for(const n of["leftMm","topMm","widthMm","heightMm"])A(e,n,s,i);typeof e.leftMm=="number"&&e.leftMm<-100&&i.push({path:`${s}.leftMm`,message:"几何数值异常(leftMm<-100)"});for(const n of["widthMm","heightMm"])typeof e[n]=="number"&&e[n]<0&&i.push({path:`${s}.${n}`,message:"组件尺寸不能为负数"});b(e.table,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)}function p(e,s,i,t=[]){if(!u(e)){i.push({path:s,message:"页应为对象"});return}const a=e.pageWidthMm,n=e.pageHeightMm;(typeof a!="number"||!Number.isFinite(a)||a<=0)&&i.push({path:`${s}.pageWidthMm`,message:`页宽非法: ${JSON.stringify(a)}`}),(typeof n!="number"||!(n>0&&n<5e3))&&i.push({path:`${s}.pageHeightMm`,message:`页高非法: ${JSON.stringify(n)}`}),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((f,d)=>h(f,`${s}.components.${d}`,i,t)):i.push({path:`${s}.components`,message:"components 应为数组"})}function c(e){const s=[],i=[],t=u(e)?e.pages:void 0;if(u(e)&&e.requiresRecalculation!==void 0&&typeof e.requiresRecalculation!="boolean"&&s.push({path:"$.requiresRecalculation",message:"重算能力要求应为布尔值"}),!Array.isArray(t))s.push({path:"$.pages",message:e==null?"渲染计划为空":"渲染计划缺少 pages 数组"});else{t.forEach((n,o)=>p(n,`$.pages.${o}`,s,i)),t.length>2e3&&i.push({path:"$.pages",message:`页数异常大(${t.length} 页),渲染与打印耗时可能显著增加`});const a=t.reduce((n,o)=>n+(u(o)&&Array.isArray(o.components)?o.components.length:0),0);a>5e4&&i.push({path:"$.pages",message:`组件总数异常大(${a} 个),可能触发浏览器性能限制`})}return{ok:s.length===0,errors:s,warnings:i}}function k(e){const s=c(e);if(!s.ok){const i=s.errors.slice(0,3).map(t=>`${t.path}: ${t.message}`).join("; ");throw new Error(`渲染计划校验失败(${s.errors.length} 处): ${i}`)}return e.pages}exports.assertRenderPlan=k;exports.validateComponent=h;exports.validateEditableMetadata=g;exports.validatePage=p;exports.validateRenderPlan=c;
@@ -290,6 +290,8 @@ declare interface GridCell {
290
290
  value?: string | number | boolean | null;
291
291
  /** Excel 数字格式(例如 #,##0.00 / 0.00%),不改变 text。 */
292
292
  numberFormat?: string;
293
+ /** Physical left inset for hierarchical labels; raw value stays unchanged. */
294
+ indentMm?: number;
293
295
  /** 编辑输入类型;省略时只按原始值推断,数字字符串不会被转换为数值。 */
294
296
  valueType?: "text" | "number" | "boolean";
295
297
  /** 单元格级编辑控制;预览仍需显式开启 editing。 */
@@ -311,6 +313,8 @@ declare interface GridCell_2 {
311
313
  value?: string | number | boolean | null;
312
314
  /** Excel 数字格式(例如 #,##0.00 / 0.00%),不改变 text。 */
313
315
  numberFormat?: string;
316
+ /** Physical left inset for hierarchical labels; raw value stays unchanged. */
317
+ indentMm?: number;
314
318
  /** 编辑输入类型;省略时只按原始值推断,数字字符串不会被转换为数值。 */
315
319
  valueType?: "text" | "number" | "boolean";
316
320
  /** 单元格级编辑控制;预览仍需显式开启 editing。 */
@@ -332,6 +336,8 @@ declare interface GridCell_3 {
332
336
  value?: string | number | boolean | null;
333
337
  /** Excel 数字格式(例如 #,##0.00 / 0.00%),不改变 text。 */
334
338
  numberFormat?: string;
339
+ /** Physical left inset for hierarchical labels; raw value stays unchanged. */
340
+ indentMm?: number;
335
341
  /** 编辑输入类型;省略时只按原始值推断,数字字符串不会被转换为数值。 */
336
342
  valueType?: "text" | "number" | "boolean";
337
343
  /** 单元格级编辑控制;预览仍需显式开启 editing。 */
@@ -403,6 +409,8 @@ declare interface ListColumn_2 {
403
409
  }
404
410
  declare interface ListComponent {
405
411
  kind: "list";
412
+ /** Opaque serializable layout annotations; interpreted only by explicit optional adapters. */
413
+ meta?: Record<string, unknown>;
406
414
  id?: string;
407
415
  /** 宽表标记用于连续 Excel;不改变低层列表的列宽和分页算法。 */
408
416
  layout?: "page" | "wide";
@@ -412,6 +420,10 @@ declare interface ListComponent {
412
420
  topMm: number;
413
421
  widthMm: number;
414
422
  dataset: string;
423
+ /** Headerless record/region bindings do not allocate a synthetic list header. */
424
+ header?: boolean;
425
+ /** A fixed record region rejects multiple rows instead of dropping source data. */
426
+ cardinality?: "record";
415
427
  /** 数据集中稳定业务主键的字段名;省略时编辑仅有计划内坐标。 */
416
428
  rowKey?: string;
417
429
  revisionField?: string;
@@ -438,6 +450,8 @@ declare interface ListComponent {
438
450
  computed?: ComputedField[];
439
451
  /** Dynamic pivot of the current source dataset, with read-only derived identities. */
440
452
  matrix?: MatrixTableOptions;
453
+ /** Full ordered hierarchy; source parent values and descendant-leaf rollups are explicit. */
454
+ tree?: TreeTableOptions;
441
455
  /** Explicit row visibility; hidden rows do not participate in summaries. */
442
456
  rowVisibleWhen?: StyleRule["when"];
443
457
  /** Master/detail relation is keyed by business identity, never by display row index. */
@@ -447,6 +461,8 @@ declare interface ListComponent {
447
461
  }
448
462
  declare interface ListComponent_2 {
449
463
  kind: "list";
464
+ /** Opaque serializable layout annotations; interpreted only by explicit optional adapters. */
465
+ meta?: Record<string, unknown>;
450
466
  id?: string;
451
467
  /** 宽表标记用于连续 Excel;不改变低层列表的列宽和分页算法。 */
452
468
  layout?: "page" | "wide";
@@ -456,6 +472,10 @@ declare interface ListComponent_2 {
456
472
  topMm: number;
457
473
  widthMm: number;
458
474
  dataset: string;
475
+ /** Headerless record/region bindings do not allocate a synthetic list header. */
476
+ header?: boolean;
477
+ /** A fixed record region rejects multiple rows instead of dropping source data. */
478
+ cardinality?: "record";
459
479
  /** 数据集中稳定业务主键的字段名;省略时编辑仅有计划内坐标。 */
460
480
  rowKey?: string;
461
481
  revisionField?: string;
@@ -482,6 +502,8 @@ declare interface ListComponent_2 {
482
502
  computed?: ComputedField_2[];
483
503
  /** Dynamic pivot of the current source dataset, with read-only derived identities. */
484
504
  matrix?: MatrixTableOptions_2;
505
+ /** Full ordered hierarchy; source parent values and descendant-leaf rollups are explicit. */
506
+ tree?: TreeTableOptions_2;
485
507
  /** Explicit row visibility; hidden rows do not participate in summaries. */
486
508
  rowVisibleWhen?: StyleRule_2["when"];
487
509
  /** Master/detail relation is keyed by business identity, never by display row index. */
@@ -689,6 +711,8 @@ declare interface MachReportMessages extends Partial<ReportCalculationMessages>
689
711
  paramPromptDescription?: string;
690
712
  paramSelectPlaceholder?: string;
691
713
  paramTextPlaceholder?: string;
714
+ paramRangeStart?: string;
715
+ paramRangeEnd?: string;
692
716
  /** 可选搜索进度文案,旧完整 messages 对象无需新增字段。 */
693
717
  searching?: string;
694
718
  importExcel?: string;
@@ -1086,6 +1110,7 @@ declare interface PlanGrid_3 {
1086
1110
  paddingMm?: number;
1087
1111
  }
1088
1112
  declare interface PlanPage {
1113
+ meta?: Record<string, unknown>;
1089
1114
  /** wide 表示完整自然列宽;页面仅为预览的垂直窗口分段。 */
1090
1115
  layout?: "page" | "wide";
1091
1116
  pageWidthMm: number;
@@ -1435,6 +1460,20 @@ declare interface ReportFieldTarget {
1435
1460
  rowKey?: string | number;
1436
1461
  tableId?: string;
1437
1462
  }
1463
+ declare interface ReportFlowBand {
1464
+ /** Exact stable component IDs. Static components use nid, lists use id. */
1465
+ componentIds: string[];
1466
+ /** Source-template coordinates; following bands keep their original gap. */
1467
+ topMm: number;
1468
+ heightMm: number;
1469
+ }
1470
+ declare interface ReportFlowBand_2 {
1471
+ /** Exact stable component IDs. Static components use nid, lists use id. */
1472
+ componentIds: string[];
1473
+ /** Source-template coordinates; following bands keep their original gap. */
1474
+ topMm: number;
1475
+ heightMm: number;
1476
+ }
1438
1477
  declare interface ReportInteractionOptions {
1439
1478
  /** 只读选区计算,默认关闭;不写回业务值或执行导入的 Excel 公式。 */
1440
1479
  calculations?: boolean;
@@ -1455,13 +1494,19 @@ declare interface ReportOutputOptions {
1455
1494
  /** warn preserves supported output and shows diagnostics; strict rejects known fidelity loss. */
1456
1495
  fidelity?: "warn" | "strict";
1457
1496
  }
1497
+ declare interface ReportPageFlow {
1498
+ bands: ReportFlowBand[];
1499
+ }
1500
+ declare interface ReportPageFlow_2 {
1501
+ bands: ReportFlowBand_2[];
1502
+ }
1458
1503
  /** 报表参数定义(声明式,模板自描述参数面:渲染组件据此生成查询面板) */
1459
1504
  declare interface ReportParamDef {
1460
1505
  /** 参数名(传入 params,与数据集 SQL #{field} 绑定对应) */
1461
1506
  field: string;
1462
1507
  /** 显示名(缺省用 field) */
1463
1508
  label?: string;
1464
- type?: "text" | "number" | "date" | "select";
1509
+ type?: "text" | "number" | "date" | "month" | "year" | "dateRange" | "select";
1465
1510
  /** select 选项 */
1466
1511
  options?: Array<{
1467
1512
  label: string;
@@ -1470,7 +1515,7 @@ declare interface ReportParamDef {
1470
1515
  defaultValue?: string;
1471
1516
  required?: boolean;
1472
1517
  placeholder?: string;
1473
- /** 数字上下界;date 参数使用 YYYY-MM-DD 字符串(含边界)。 */
1518
+ /** 数字上下界;日期/月/年使用对应规范字符串;dateRange 对两端使用 YYYY-MM-DD 边界(含边界)。 */
1474
1519
  min?: number | string;
1475
1520
  max?: number | string;
1476
1521
  minLength?: number;
@@ -1482,7 +1527,7 @@ declare interface ReportParamDef_2 {
1482
1527
  field: string;
1483
1528
  /** 显示名(缺省用 field) */
1484
1529
  label?: string;
1485
- type?: "text" | "number" | "date" | "select";
1530
+ type?: "text" | "number" | "date" | "month" | "year" | "dateRange" | "select";
1486
1531
  /** select 选项 */
1487
1532
  options?: Array<{
1488
1533
  label: string;
@@ -1491,7 +1536,7 @@ declare interface ReportParamDef_2 {
1491
1536
  defaultValue?: string;
1492
1537
  required?: boolean;
1493
1538
  placeholder?: string;
1494
- /** 数字上下界;date 参数使用 YYYY-MM-DD 字符串(含边界)。 */
1539
+ /** 数字上下界;日期/月/年使用对应规范字符串;dateRange 对两端使用 YYYY-MM-DD 边界(含边界)。 */
1495
1540
  min?: number | string;
1496
1541
  max?: number | string;
1497
1542
  minLength?: number;
@@ -1703,6 +1748,9 @@ declare interface TemplatePage {
1703
1748
  marginLeftMm?: number;
1704
1749
  marginRightMm?: number;
1705
1750
  components: TemplateComponent[];
1751
+ /** Explicit vertical bands preserve source gaps as dynamic regions expand. */
1752
+ flow?: ReportPageFlow;
1753
+ meta?: Record<string, unknown>;
1706
1754
  }
1707
1755
  declare interface TemplatePage_2 {
1708
1756
  widthMm: number;
@@ -1714,6 +1762,9 @@ declare interface TemplatePage_2 {
1714
1762
  marginLeftMm?: number;
1715
1763
  marginRightMm?: number;
1716
1764
  components: TemplateComponent_2[];
1765
+ /** Explicit vertical bands preserve source gaps as dynamic regions expand. */
1766
+ flow?: ReportPageFlow_2;
1767
+ meta?: Record<string, unknown>;
1717
1768
  }
1718
1769
  /**
1719
1770
  * 文本测量与折行(分页/Canvas/PDF 共用的唯一折行真相源)。
@@ -1733,6 +1784,44 @@ declare interface TextMeasureOptions {
1733
1784
  declare interface TextMeasurer {
1734
1785
  measureMm(text: string, options: TextMeasureOptions): number;
1735
1786
  }
1787
+ /** A serialized tree contract. Sibling and root order follow input order. */
1788
+ declare interface TreeTableOptions {
1789
+ input: "flat" | "nested";
1790
+ idField: string;
1791
+ /** Flat roots have null/undefined parent values. */
1792
+ parentField?: string;
1793
+ /** Nested child arrays, defaults to children. Every node still needs an ID. */
1794
+ childrenField?: string;
1795
+ labelField: string;
1796
+ indentMm?: number;
1797
+ orphan?: "error" | "root";
1798
+ /** Source preserves parent values; leaf-aggregate derives only parents from descendant leaves. */
1799
+ parentValues?: "source" | "leaf-aggregate";
1800
+ aggregates?: AggregateDefinition[];
1801
+ maxRows?: number;
1802
+ maxDepth?: number;
1803
+ /** Bounded leaf-to-ancestor aggregate work; default one million. */
1804
+ maxAggregationVisits?: number;
1805
+ }
1806
+ /** A serialized tree contract. Sibling and root order follow input order. */
1807
+ declare interface TreeTableOptions_2 {
1808
+ input: "flat" | "nested";
1809
+ idField: string;
1810
+ /** Flat roots have null/undefined parent values. */
1811
+ parentField?: string;
1812
+ /** Nested child arrays, defaults to children. Every node still needs an ID. */
1813
+ childrenField?: string;
1814
+ labelField: string;
1815
+ indentMm?: number;
1816
+ orphan?: "error" | "root";
1817
+ /** Source preserves parent values; leaf-aggregate derives only parents from descendant leaves. */
1818
+ parentValues?: "source" | "leaf-aggregate";
1819
+ aggregates?: AggregateDefinition_2[];
1820
+ maxRows?: number;
1821
+ maxDepth?: number;
1822
+ /** Bounded leaf-to-ancestor aggregate work; default one million. */
1823
+ maxAggregationVisits?: number;
1824
+ }
1736
1825
  declare interface XlsxImageOptions {
1737
1826
  /** Decoded bytes per unique embedded image; default 16 MiB. */
1738
1827
  maxImageBytes?: number;