@agile-team/mach-report 2.17.0 → 2.18.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 (168) hide show
  1. package/README.md +18 -9
  2. package/dist/{ExcelBindingWizard-Bq6FYME6.cjs → ExcelBindingWizard-Czn3C2yE.cjs} +1 -1
  3. package/dist/{ExcelBindingWizard-Co1svTsw.js → ExcelBindingWizard-DMGZj6I6.js} +3 -3
  4. package/dist/ParamEditor-KzDQvbHY.js +732 -0
  5. package/dist/ParamEditor-oDfD8LgE.cjs +1 -0
  6. package/dist/{ReportBatchPanel-uQh06usx.js → ReportBatchPanel-BJK7PvZ4.js} +39 -39
  7. package/dist/ReportBatchPanel-DnmNRssu.cjs +1 -0
  8. package/dist/ReportParamPanel-mQkeN70Q.js +1020 -0
  9. package/dist/ReportParamPanel-sOANVRz-.cjs +1 -0
  10. package/dist/ReportPreview-BxWWTUL5.js +5583 -0
  11. package/dist/ReportPreview-Yf99omi3.cjs +6 -0
  12. package/dist/{ReportTemplateLibrary-TIL_Oj2l.js → ReportTemplateLibrary-BFjB08Wu.js} +1 -1
  13. package/dist/{ReportTemplateLibrary-CnP7_1pH.cjs → ReportTemplateLibrary-BO42QnWd.cjs} +1 -1
  14. package/dist/RuleEditor-CqxT1a-W.js +2337 -0
  15. package/dist/RuleEditor-D7YWigD9.cjs +1 -0
  16. package/dist/{TemplateOutlinePanel-BlLxRrfu.cjs → TemplateOutlinePanel-B0XX350V.cjs} +1 -1
  17. package/dist/{TemplateOutlinePanel-BouxsuqQ.js → TemplateOutlinePanel-zG0DrsIB.js} +2 -2
  18. package/dist/{TemplateReusePanel-yxsHSO40.cjs → TemplateReusePanel-BD0HSKp_.cjs} +1 -1
  19. package/dist/{TemplateReusePanel-BEACLPaN.js → TemplateReusePanel-Czwe5GbC.js} +2 -2
  20. package/dist/{TemplateReviewPanel-D9Cx0m2N.cjs → TemplateReviewPanel-CA5sdffM.cjs} +1 -1
  21. package/dist/{TemplateReviewPanel-B1OGRY2i.js → TemplateReviewPanel-NhmQI65C.js} +2 -2
  22. package/dist/analytics.cjs +1 -1
  23. package/dist/analytics.d.cts +100 -41
  24. package/dist/analytics.d.ts +100 -41
  25. package/dist/analytics.js +76 -141
  26. package/dist/artifact-integrity.json +108 -102
  27. package/dist/assets-2eC3mOcV.js +232 -0
  28. package/dist/assets-B0Hxn4l6.cjs +1 -0
  29. package/dist/{auto-DDHflI9v.cjs → auto-B0EZFIK1.cjs} +1 -1
  30. package/dist/{auto-BIOmtVhk.js → auto-BlchZ1b8.js} +19 -19
  31. package/dist/{batch-WzDIXJAt.js → batch-DGCt44XM.js} +1 -1
  32. package/dist/{batch-z6Aw5GEY.cjs → batch-DYcokH4v.cjs} +1 -1
  33. package/dist/charts-Dlv8j2AG.js +141 -0
  34. package/dist/charts-aCtoswXq.cjs +1 -0
  35. package/dist/codes.cjs +9 -9
  36. package/dist/codes.d.cts +54 -0
  37. package/dist/codes.d.ts +54 -0
  38. package/dist/codes.js +12097 -13668
  39. package/dist/column-visual-BpgQVWwT.js +238 -0
  40. package/dist/column-visual-CtYxnBCP.cjs +1 -0
  41. package/dist/component-tree-6TV7W6Yj.cjs +1 -0
  42. package/dist/component-tree-CvW4lzpv.js +67 -0
  43. package/dist/computed-4TnxzgIh.cjs +1 -0
  44. package/dist/computed-C8NRZQss.js +739 -0
  45. package/dist/data-bar-Ce38juRZ.cjs +1 -0
  46. package/dist/data-bar-PtjXhMgN.js +9 -0
  47. package/dist/designer--TKECSEc.cjs +2 -0
  48. package/dist/designer-d6hJS41w.js +5683 -0
  49. package/dist/designer.cjs +1 -1
  50. package/dist/designer.d.cts +710 -42
  51. package/dist/designer.d.ts +710 -42
  52. package/dist/designer.js +23 -20
  53. package/dist/{encoding-BFMFIc4r.cjs → encoding-B--eZpp1.cjs} +1 -1
  54. package/dist/{encoding-DP_Eaf0A.js → encoding-mctOLocI.js} +2 -2
  55. package/dist/{font-loader-7FWVlykp.cjs → font-loader-DBBJ5KE9.cjs} +1 -1
  56. package/dist/{font-loader-CQZowp0I.js → font-loader-DW8tIaNp.js} +1 -1
  57. package/dist/index-CPh6tqge.js +1575 -0
  58. package/dist/index-CUNw7dL9.cjs +1 -0
  59. package/dist/index.cjs +7 -7
  60. package/dist/index.d.cts +361 -15
  61. package/dist/index.d.ts +361 -15
  62. package/dist/index.js +876 -835
  63. package/dist/json-snapshot-By4ZVVUt.js +1967 -0
  64. package/dist/json-snapshot-jiXff4lc.cjs +2 -0
  65. package/dist/matrix-0hywp0-F.cjs +1 -0
  66. package/dist/matrix-Dy-tyY7E.js +381 -0
  67. package/dist/param-validation-C-8sRJLq.cjs +1 -0
  68. package/dist/param-validation-CnDEd2l-.js +333 -0
  69. package/dist/{pdf-l3ea86di.js → pdf-CKROKygt.js} +1851 -1849
  70. package/dist/{pdf-B8JouyYv.cjs → pdf-DqyxJ96U.cjs} +46 -46
  71. package/dist/pdf.cjs +1 -1
  72. package/dist/pdf.d.cts +54 -0
  73. package/dist/pdf.d.ts +54 -0
  74. package/dist/pdf.js +2 -2
  75. package/dist/{plugin-BBp74CQZ.js → plugin-ByjF2kiV.js} +5 -5
  76. package/dist/{plugin-CtFX9PFG.cjs → plugin-DM1M2wlI.cjs} +1 -1
  77. package/dist/prefill-B8H9qwE4.js +371 -0
  78. package/dist/prefill-D7EswyTI.cjs +1 -0
  79. package/dist/{prepared-CARicKYh.js → prepared-BE-4jfX5.js} +2 -2
  80. package/dist/{prepared-Ch1x_Gog.cjs → prepared-CGVphji3.cjs} +1 -1
  81. package/dist/{protocol-B5A2uom4.cjs → protocol-ByRVzzQG.cjs} +1 -1
  82. package/dist/{protocol-BaiWjq5w.js → protocol-Cr81vFSQ.js} +3 -3
  83. package/dist/{record-bindings-D4TuMzHs.js → record-bindings-DEJtmo3p.js} +67 -107
  84. package/dist/record-bindings-ehjnCDHt.cjs +1 -0
  85. package/dist/{region-binding-workflow-BNasF5kz.js → region-binding-workflow-CBg0l_tj.js} +1 -1
  86. package/dist/{region-binding-workflow-O2Cni3mF.cjs → region-binding-workflow-D05tOYn3.cjs} +1 -1
  87. package/dist/report-encoding-worker.cjs +1 -1
  88. package/dist/report-encoding-worker.js +1 -1
  89. package/dist/{report-params-B1RzkhJj.js → report-params-D9tBuM9B.js} +1 -1
  90. package/dist/{report-params-WDGrA4oP.cjs → report-params-VTg8MoCp.cjs} +1 -1
  91. package/dist/runtime-CDA6d263.cjs +1 -0
  92. package/dist/runtime-CEMvybO7.js +170 -0
  93. package/dist/sbom.cdx.json +1 -1
  94. package/dist/server/node.d.cts +75 -7
  95. package/dist/server/node.d.ts +75 -7
  96. package/dist/server-node.cjs +4 -4
  97. package/dist/server-node.js +2692 -1990
  98. package/dist/server.cjs +1 -1
  99. package/dist/server.d.cts +243 -28
  100. package/dist/server.d.ts +243 -28
  101. package/dist/server.js +28 -28
  102. package/dist/sha256-BDQ1Qk7A.js +158 -0
  103. package/dist/sha256-DgZAKXqI.cjs +1 -0
  104. package/dist/style.css +1 -1
  105. package/dist/template-bindings-Cg5oBLFT.cjs +1 -0
  106. package/dist/template-bindings-TKnXM7ll.js +62 -0
  107. package/dist/{template-catalog-wT1fNeAP.js → template-catalog-CmbWOJqy.js} +16 -16
  108. package/dist/{template-catalog-Dua8h9ZA.cjs → template-catalog-Utu4GP09.cjs} +1 -1
  109. package/dist/{template-fragments-BajTajb4.cjs → template-fragments-C_zSHJAa.cjs} +1 -1
  110. package/dist/{template-fragments-DmX5XK4N.js → template-fragments-DWgo9tlZ.js} +2 -2
  111. package/dist/{template-outline-BwRV_eRo.cjs → template-outline-DWkzZXVC.cjs} +1 -1
  112. package/dist/{template-outline-cnWfT_LK.js → template-outline-DiADphlq.js} +1 -1
  113. package/dist/{template-registry-u11fPd8D.js → template-registry-BIhIHOab.js} +319 -314
  114. package/dist/template-registry-DzWswQI5.cjs +1 -0
  115. package/dist/vue/async.d.cts +528 -33
  116. package/dist/vue/async.d.ts +528 -33
  117. package/dist/vue/index.d.cts +616 -64
  118. package/dist/vue/index.d.ts +616 -64
  119. package/dist/vue-async.cjs +1 -1
  120. package/dist/vue-async.js +3 -3
  121. package/dist/vue.cjs +1 -1
  122. package/dist/vue.js +94 -89
  123. package/dist/{workbook-session-DN5LSA5C.cjs → workbook-session-B94EwVa_.cjs} +1 -1
  124. package/dist/{workbook-session-B8pNW24X.js → workbook-session-BoScoOg-.js} +2 -2
  125. package/dist/worker.cjs +1 -1
  126. package/dist/worker.d.cts +75 -7
  127. package/dist/worker.d.ts +75 -7
  128. package/dist/worker.js +4 -4
  129. package/dist/xlsx.cjs +4 -4
  130. package/dist/xlsx.d.cts +120 -13
  131. package/dist/xlsx.d.ts +120 -13
  132. package/dist/xlsx.js +313 -279
  133. package/package.json +1 -1
  134. package/dist/ParamEditor-B5UZRgxv.cjs +0 -1
  135. package/dist/ParamEditor-DNNARyeB.js +0 -594
  136. package/dist/ReportBatchPanel-Ctvs2t_9.cjs +0 -1
  137. package/dist/ReportPreview-BdQawRh0.js +0 -4879
  138. package/dist/ReportPreview-CJC_-j2I.cjs +0 -6
  139. package/dist/RuleEditor-DkRjOLlr.js +0 -2141
  140. package/dist/RuleEditor-h5anGsDB.cjs +0 -1
  141. package/dist/assets-BIMVwjQe.js +0 -231
  142. package/dist/assets-Dfs2ElxI.cjs +0 -1
  143. package/dist/component-tree-Ca6YYfHq.js +0 -61
  144. package/dist/component-tree-DkGLEfZC.cjs +0 -1
  145. package/dist/computed-BW5a8QFk.js +0 -612
  146. package/dist/computed-C2GD3XcE.cjs +0 -1
  147. package/dist/config-Dg_o8e7m.cjs +0 -1
  148. package/dist/config-XQ4qrQ7Q.js +0 -844
  149. package/dist/designer-D9XAxqSc.js +0 -5178
  150. package/dist/designer-uCDo5XSK.cjs +0 -2
  151. package/dist/drill-ByN8COs_.cjs +0 -1
  152. package/dist/drill-CKW3Xtfa.js +0 -145
  153. package/dist/json-snapshot-D7PE1NsU.cjs +0 -2
  154. package/dist/json-snapshot-DYmEe3sO.js +0 -1779
  155. package/dist/matrix-JLAXlux-.js +0 -302
  156. package/dist/matrix-gTHpDTGm.cjs +0 -1
  157. package/dist/param-validation-C3HlcLLO.cjs +0 -1
  158. package/dist/param-validation-Do7Eg8Zv.js +0 -181
  159. package/dist/record-bindings-B86Sur_y.cjs +0 -1
  160. package/dist/runtime-DakRXui3.js +0 -170
  161. package/dist/runtime-dL5ygIfa.cjs +0 -1
  162. package/dist/sha256-BshdOkCC.cjs +0 -1
  163. package/dist/sha256-DTG-Gq8i.js +0 -157
  164. package/dist/template-bindings-C2SpvsMU.js +0 -58
  165. package/dist/template-bindings-CEtWyiLX.cjs +0 -1
  166. package/dist/template-registry-CpysHAxy.cjs +0 -1
  167. package/dist/tree-CLpxYbKa.cjs +0 -1
  168. package/dist/tree-DNJorJUf.js +0 -172
@@ -62,6 +62,23 @@ declare type ColumnFormat = {
62
62
  pattern?: string;
63
63
  };
64
64
 
65
+ declare type ColumnVisual = {
66
+ /** Defaults to the column field; never changes the cell's raw value or business identity. */
67
+ field?: string;
68
+ /** Numeric text requires explicit opt-in; formatting an identifier does not turn it into a measure. */
69
+ numeric?: "number" | "decimal";
70
+ min?: number;
71
+ max?: number;
72
+ } & ({
73
+ kind: "colorScale";
74
+ lowColor?: string;
75
+ highColor?: string;
76
+ } | {
77
+ kind: "dataBar";
78
+ color?: string;
79
+ negativeColor?: string;
80
+ });
81
+
65
82
  export declare function compareDecimal(a: DecimalValue, b: DecimalValue): number;
66
83
 
67
84
  /** A literal own field of the current label record; expressions and paths are not evaluated. */
@@ -155,6 +172,9 @@ export declare function createCrossTable(input: readonly Record<string, unknown>
155
172
  /** Multi-measure pivot shares dimensions and original rows; weighted totals never average averages. */
156
173
  export declare function createMatrixTable(input: readonly Record<string, unknown>[], options: MatrixTableOptions): MatrixTableResult;
157
174
 
175
+ /** One bounded scan, shared aggregate semantics; labels never coerce identifier source values. */
176
+ export declare function createReportChartData(rows: readonly Record<string, unknown>[], binding: ReportChartBinding, signal?: AbortSignal): ReportChartData;
177
+
158
178
  export declare interface CrossTableOptions {
159
179
  rowField: string;
160
180
  columnField: string;
@@ -221,38 +241,8 @@ export declare function getComputationMetadata(fields?: readonly {
221
241
  type: string;
222
242
  label?: string;
223
243
  }[];
224
- functions: readonly [{
225
- readonly name: "add";
226
- readonly minArgs: 2;
227
- readonly maxArgs: 256;
228
- readonly input: "numeric";
229
- readonly output: "numeric";
230
- }, {
231
- readonly name: "subtract";
232
- readonly minArgs: 2;
233
- readonly maxArgs: 2;
234
- readonly input: "numeric";
235
- readonly output: "numeric";
236
- }, {
237
- readonly name: "multiply";
238
- readonly minArgs: 2;
239
- readonly maxArgs: 256;
240
- readonly input: "numeric";
241
- readonly output: "numeric";
242
- }, {
243
- readonly name: "divide";
244
- readonly minArgs: 2;
245
- readonly maxArgs: 2;
246
- readonly input: "numeric";
247
- readonly output: "numeric";
248
- }, {
249
- readonly name: "coalesce";
250
- readonly minArgs: 2;
251
- readonly maxArgs: 256;
252
- readonly input: "scalar";
253
- readonly output: "scalar";
254
- }];
255
- operations: readonly ["add", "subtract", "multiply", "divide", "coalesce"];
244
+ functions: readonly ReportExpressionFunction[];
245
+ operations: ReportExpressionOperation[];
256
246
  aggregates: readonly ["sum", "count", "avg", "min", "max", "weightedAvg"];
257
247
  scopes: readonly ["row", "group", "dataset"];
258
248
  numericModes: readonly ["number", "decimal"];
@@ -268,6 +258,12 @@ export declare function getComputationMetadata(fields?: readonly {
268
258
  };
269
259
 
270
260
  declare interface GridCell {
261
+ /** Resolved visual only. Original value, text, editability and source are unchanged. */
262
+ dataBar?: {
263
+ start: number;
264
+ end: number;
265
+ color: string;
266
+ };
271
267
  /** Styled cell content; text remains a plain-text fallback. Imported rich cells are read-only. */
272
268
  richParagraphs?: RichParagraph[];
273
269
  text?: string;
@@ -311,6 +307,8 @@ declare interface ListColumn {
311
307
  format?: ColumnFormat;
312
308
  /** 条件格式规则(声明式,命中合并进单元格样式;如负数红字) */
313
309
  rules?: StyleRule[];
310
+ /** Optional resolved color scale or value-preserving data bar. */
311
+ visual?: ColumnVisual;
314
312
  /** 内容列编辑控制;仍需由预览显式开启 editing,不影响表头/小计只读规则。 */
315
313
  editable?: boolean;
316
314
  /** 空值列或特殊数据类型可显式声明编辑输入类型。 */
@@ -411,6 +409,8 @@ export declare function multiplyDecimal(a: DecimalValue, b: DecimalValue): Decim
411
409
  export declare function parseDecimal(input: unknown): DecimalValue;
412
410
 
413
411
  declare interface PlanComponent {
412
+ /** Template-only aggregate binding, expanded into shared primitives during layout. */
413
+ chartBinding?: ReportChartBinding;
414
414
  /** Optional QR/barcode encoding configuration; no encoder is loaded by the core. */
415
415
  code?: CodeOptions;
416
416
  /** Template-only binding; resolved and removed before constructing the output plan. */
@@ -479,8 +479,31 @@ declare interface ReportCellSource {
479
479
  sourceToken?: string;
480
480
  }
481
481
 
482
+ /** Serializable binding; data and authorization continue to come from the existing report source. */
483
+ export declare interface ReportChartBinding {
484
+ dataset: string;
485
+ categoryField: string;
486
+ measures: readonly ReportChartMeasure[];
487
+ type: ReportChartOptions["type"];
488
+ sort?: "asc" | "desc";
489
+ title?: string;
490
+ showValues?: boolean;
491
+ maxRows?: number;
492
+ maxCategories?: number;
493
+ }
494
+
495
+ export declare interface ReportChartData {
496
+ categories: string[];
497
+ series: ReportChartSeries[];
498
+ }
499
+
500
+ export declare interface ReportChartMeasure extends AggregateRequest {
501
+ label?: string;
502
+ color?: string;
503
+ }
504
+
482
505
  export declare interface ReportChartOptions {
483
- type: "bar" | "line";
506
+ type: "bar" | "line" | "stackedBar" | "percentBar";
484
507
  categories: readonly string[];
485
508
  series: readonly ReportChartSeries[];
486
509
  leftMm: number;
@@ -497,6 +520,17 @@ export declare interface ReportChartSeries {
497
520
  color?: string;
498
521
  }
499
522
 
523
+ declare interface ReportComparison {
524
+ field: string;
525
+ op: ">" | ">=" | "<" | "<=" | "==" | "!=" | "between" | "contains" | "isNull" | "isNotNull";
526
+ /** Legacy scalar thresholds remain supported. Use right for field-to-field comparisons. */
527
+ value?: ReportPredicateScalar;
528
+ right?: ReportPredicateOperand;
529
+ values?: readonly [ReportPredicateScalar, ReportPredicateScalar];
530
+ numeric?: "number" | "decimal";
531
+ valueType?: "number" | "decimal" | "text" | "date" | "boolean";
532
+ }
533
+
500
534
  export declare type ReportExpression = {
501
535
  field: string;
502
536
  } | {
@@ -506,10 +540,39 @@ export declare type ReportExpression = {
506
540
  field?: string;
507
541
  weightField?: string;
508
542
  } | {
509
- op: "add" | "subtract" | "multiply" | "divide" | "coalesce";
543
+ op: ReportExpressionOperation;
544
+ /** Required for if; args are [then, else], and only the selected branch is evaluated. */
545
+ condition?: ReportPredicate;
510
546
  args: readonly ReportExpression[];
511
547
  };
512
548
 
549
+ declare interface ReportExpressionFunction {
550
+ readonly name: ReportExpressionOperation;
551
+ readonly minArgs: number;
552
+ readonly maxArgs: number;
553
+ readonly input: string;
554
+ readonly output: string;
555
+ readonly example: string;
556
+ }
557
+
558
+ declare type ReportExpressionOperation = "add" | "subtract" | "multiply" | "divide" | "coalesce" | "if" | "round" | "abs" | "concat" | "trim" | "upper" | "lower" | "dateYear" | "dateMonth" | "dateDay";
559
+
560
+ declare type ReportPredicate = ReportComparison | {
561
+ all: readonly ReportPredicate[];
562
+ } | {
563
+ any: readonly ReportPredicate[];
564
+ } | {
565
+ not: ReportPredicate;
566
+ };
567
+
568
+ declare type ReportPredicateOperand = {
569
+ field: string;
570
+ } | {
571
+ value: ReportPredicateScalar;
572
+ };
573
+
574
+ declare type ReportPredicateScalar = string | number | boolean | null;
575
+
513
576
  declare interface RichParagraph {
514
577
  segments: RichSegment[];
515
578
  align?: ComponentStyle["align"];
@@ -528,13 +591,7 @@ declare interface RichSegment {
528
591
 
529
592
  /** 条件格式规则求值(声明式,见 ListColumn.rules) */
530
593
  declare interface StyleRule {
531
- when: {
532
- field: string;
533
- op: ">" | ">=" | "<" | "<=" | "==" | "!=";
534
- value: number | string;
535
- /** Explicit decimal comparisons retain decimal thresholds as text. */
536
- numeric?: "number" | "decimal";
537
- };
594
+ when: ReportPredicate;
538
595
  /** 命中时合并进单元格样式(color/bold/backgroundColor 等) */
539
596
  style: Record<string, unknown>;
540
597
  }
@@ -551,6 +608,8 @@ export declare function validateComputedFields(definitions: readonly ComputedFie
551
608
 
552
609
  export declare function validateMatrixOptions(options: MatrixTableOptions): void;
553
610
 
611
+ export declare function validateReportChartBinding(binding: ReportChartBinding): void;
612
+
554
613
  /** The same declarative formatting used by list columns, before any output backend. */
555
614
  declare type ValueFormat = ColumnFormat;
556
615
 
@@ -62,6 +62,23 @@ declare type ColumnFormat = {
62
62
  pattern?: string;
63
63
  };
64
64
 
65
+ declare type ColumnVisual = {
66
+ /** Defaults to the column field; never changes the cell's raw value or business identity. */
67
+ field?: string;
68
+ /** Numeric text requires explicit opt-in; formatting an identifier does not turn it into a measure. */
69
+ numeric?: "number" | "decimal";
70
+ min?: number;
71
+ max?: number;
72
+ } & ({
73
+ kind: "colorScale";
74
+ lowColor?: string;
75
+ highColor?: string;
76
+ } | {
77
+ kind: "dataBar";
78
+ color?: string;
79
+ negativeColor?: string;
80
+ });
81
+
65
82
  export declare function compareDecimal(a: DecimalValue, b: DecimalValue): number;
66
83
 
67
84
  /** A literal own field of the current label record; expressions and paths are not evaluated. */
@@ -155,6 +172,9 @@ export declare function createCrossTable(input: readonly Record<string, unknown>
155
172
  /** Multi-measure pivot shares dimensions and original rows; weighted totals never average averages. */
156
173
  export declare function createMatrixTable(input: readonly Record<string, unknown>[], options: MatrixTableOptions): MatrixTableResult;
157
174
 
175
+ /** One bounded scan, shared aggregate semantics; labels never coerce identifier source values. */
176
+ export declare function createReportChartData(rows: readonly Record<string, unknown>[], binding: ReportChartBinding, signal?: AbortSignal): ReportChartData;
177
+
158
178
  export declare interface CrossTableOptions {
159
179
  rowField: string;
160
180
  columnField: string;
@@ -221,38 +241,8 @@ export declare function getComputationMetadata(fields?: readonly {
221
241
  type: string;
222
242
  label?: string;
223
243
  }[];
224
- functions: readonly [{
225
- readonly name: "add";
226
- readonly minArgs: 2;
227
- readonly maxArgs: 256;
228
- readonly input: "numeric";
229
- readonly output: "numeric";
230
- }, {
231
- readonly name: "subtract";
232
- readonly minArgs: 2;
233
- readonly maxArgs: 2;
234
- readonly input: "numeric";
235
- readonly output: "numeric";
236
- }, {
237
- readonly name: "multiply";
238
- readonly minArgs: 2;
239
- readonly maxArgs: 256;
240
- readonly input: "numeric";
241
- readonly output: "numeric";
242
- }, {
243
- readonly name: "divide";
244
- readonly minArgs: 2;
245
- readonly maxArgs: 2;
246
- readonly input: "numeric";
247
- readonly output: "numeric";
248
- }, {
249
- readonly name: "coalesce";
250
- readonly minArgs: 2;
251
- readonly maxArgs: 256;
252
- readonly input: "scalar";
253
- readonly output: "scalar";
254
- }];
255
- operations: readonly ["add", "subtract", "multiply", "divide", "coalesce"];
244
+ functions: readonly ReportExpressionFunction[];
245
+ operations: ReportExpressionOperation[];
256
246
  aggregates: readonly ["sum", "count", "avg", "min", "max", "weightedAvg"];
257
247
  scopes: readonly ["row", "group", "dataset"];
258
248
  numericModes: readonly ["number", "decimal"];
@@ -268,6 +258,12 @@ export declare function getComputationMetadata(fields?: readonly {
268
258
  };
269
259
 
270
260
  declare interface GridCell {
261
+ /** Resolved visual only. Original value, text, editability and source are unchanged. */
262
+ dataBar?: {
263
+ start: number;
264
+ end: number;
265
+ color: string;
266
+ };
271
267
  /** Styled cell content; text remains a plain-text fallback. Imported rich cells are read-only. */
272
268
  richParagraphs?: RichParagraph[];
273
269
  text?: string;
@@ -311,6 +307,8 @@ declare interface ListColumn {
311
307
  format?: ColumnFormat;
312
308
  /** 条件格式规则(声明式,命中合并进单元格样式;如负数红字) */
313
309
  rules?: StyleRule[];
310
+ /** Optional resolved color scale or value-preserving data bar. */
311
+ visual?: ColumnVisual;
314
312
  /** 内容列编辑控制;仍需由预览显式开启 editing,不影响表头/小计只读规则。 */
315
313
  editable?: boolean;
316
314
  /** 空值列或特殊数据类型可显式声明编辑输入类型。 */
@@ -411,6 +409,8 @@ export declare function multiplyDecimal(a: DecimalValue, b: DecimalValue): Decim
411
409
  export declare function parseDecimal(input: unknown): DecimalValue;
412
410
 
413
411
  declare interface PlanComponent {
412
+ /** Template-only aggregate binding, expanded into shared primitives during layout. */
413
+ chartBinding?: ReportChartBinding;
414
414
  /** Optional QR/barcode encoding configuration; no encoder is loaded by the core. */
415
415
  code?: CodeOptions;
416
416
  /** Template-only binding; resolved and removed before constructing the output plan. */
@@ -479,8 +479,31 @@ declare interface ReportCellSource {
479
479
  sourceToken?: string;
480
480
  }
481
481
 
482
+ /** Serializable binding; data and authorization continue to come from the existing report source. */
483
+ export declare interface ReportChartBinding {
484
+ dataset: string;
485
+ categoryField: string;
486
+ measures: readonly ReportChartMeasure[];
487
+ type: ReportChartOptions["type"];
488
+ sort?: "asc" | "desc";
489
+ title?: string;
490
+ showValues?: boolean;
491
+ maxRows?: number;
492
+ maxCategories?: number;
493
+ }
494
+
495
+ export declare interface ReportChartData {
496
+ categories: string[];
497
+ series: ReportChartSeries[];
498
+ }
499
+
500
+ export declare interface ReportChartMeasure extends AggregateRequest {
501
+ label?: string;
502
+ color?: string;
503
+ }
504
+
482
505
  export declare interface ReportChartOptions {
483
- type: "bar" | "line";
506
+ type: "bar" | "line" | "stackedBar" | "percentBar";
484
507
  categories: readonly string[];
485
508
  series: readonly ReportChartSeries[];
486
509
  leftMm: number;
@@ -497,6 +520,17 @@ export declare interface ReportChartSeries {
497
520
  color?: string;
498
521
  }
499
522
 
523
+ declare interface ReportComparison {
524
+ field: string;
525
+ op: ">" | ">=" | "<" | "<=" | "==" | "!=" | "between" | "contains" | "isNull" | "isNotNull";
526
+ /** Legacy scalar thresholds remain supported. Use right for field-to-field comparisons. */
527
+ value?: ReportPredicateScalar;
528
+ right?: ReportPredicateOperand;
529
+ values?: readonly [ReportPredicateScalar, ReportPredicateScalar];
530
+ numeric?: "number" | "decimal";
531
+ valueType?: "number" | "decimal" | "text" | "date" | "boolean";
532
+ }
533
+
500
534
  export declare type ReportExpression = {
501
535
  field: string;
502
536
  } | {
@@ -506,10 +540,39 @@ export declare type ReportExpression = {
506
540
  field?: string;
507
541
  weightField?: string;
508
542
  } | {
509
- op: "add" | "subtract" | "multiply" | "divide" | "coalesce";
543
+ op: ReportExpressionOperation;
544
+ /** Required for if; args are [then, else], and only the selected branch is evaluated. */
545
+ condition?: ReportPredicate;
510
546
  args: readonly ReportExpression[];
511
547
  };
512
548
 
549
+ declare interface ReportExpressionFunction {
550
+ readonly name: ReportExpressionOperation;
551
+ readonly minArgs: number;
552
+ readonly maxArgs: number;
553
+ readonly input: string;
554
+ readonly output: string;
555
+ readonly example: string;
556
+ }
557
+
558
+ declare type ReportExpressionOperation = "add" | "subtract" | "multiply" | "divide" | "coalesce" | "if" | "round" | "abs" | "concat" | "trim" | "upper" | "lower" | "dateYear" | "dateMonth" | "dateDay";
559
+
560
+ declare type ReportPredicate = ReportComparison | {
561
+ all: readonly ReportPredicate[];
562
+ } | {
563
+ any: readonly ReportPredicate[];
564
+ } | {
565
+ not: ReportPredicate;
566
+ };
567
+
568
+ declare type ReportPredicateOperand = {
569
+ field: string;
570
+ } | {
571
+ value: ReportPredicateScalar;
572
+ };
573
+
574
+ declare type ReportPredicateScalar = string | number | boolean | null;
575
+
513
576
  declare interface RichParagraph {
514
577
  segments: RichSegment[];
515
578
  align?: ComponentStyle["align"];
@@ -528,13 +591,7 @@ declare interface RichSegment {
528
591
 
529
592
  /** 条件格式规则求值(声明式,见 ListColumn.rules) */
530
593
  declare interface StyleRule {
531
- when: {
532
- field: string;
533
- op: ">" | ">=" | "<" | "<=" | "==" | "!=";
534
- value: number | string;
535
- /** Explicit decimal comparisons retain decimal thresholds as text. */
536
- numeric?: "number" | "decimal";
537
- };
594
+ when: ReportPredicate;
538
595
  /** 命中时合并进单元格样式(color/bold/backgroundColor 等) */
539
596
  style: Record<string, unknown>;
540
597
  }
@@ -551,6 +608,8 @@ export declare function validateComputedFields(definitions: readonly ComputedFie
551
608
 
552
609
  export declare function validateMatrixOptions(options: MatrixTableOptions): void;
553
610
 
611
+ export declare function validateReportChartBinding(binding: ReportChartBinding): void;
612
+
554
613
  /** The same declarative formatting used by list columns, before any output backend. */
555
614
  declare type ValueFormat = ColumnFormat;
556
615