@agile-team/mach-report 2.12.0 → 2.14.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 (97) hide show
  1. package/README.md +27 -3
  2. package/dist/ExcelBindingWizard-CLT2p7P3.cjs +1 -0
  3. package/dist/ExcelBindingWizard-CvsWR8Ga.js +1485 -0
  4. package/dist/{ParamEditor-BLaE5q5W.js → ParamEditor-CflQV3eQ.js} +191 -187
  5. package/dist/ParamEditor-vIDzvpPV.cjs +1 -0
  6. package/dist/ReportBatchPanel-DkxTzBkD.cjs +1 -0
  7. package/dist/{ReportBatchPanel-B5ClP9tm.js → ReportBatchPanel-LqVgiqp7.js} +3 -3
  8. package/dist/ReportPreview-CvbqLUzM.cjs +6 -0
  9. package/dist/ReportPreview-D_ywJ_-H.js +4533 -0
  10. package/dist/{ReportTemplateLibrary-BZB-XWjj.js → ReportTemplateLibrary-MjWEtc7X.js} +1 -1
  11. package/dist/ReportTemplateLibrary-cQ1sqNYo.cjs +1 -0
  12. package/dist/RuleEditor-BaR6xUiI.cjs +1 -0
  13. package/dist/RuleEditor-ChuXMlei.js +2037 -0
  14. package/dist/TemplateOutlinePanel-BHKP89Xz.cjs +1 -0
  15. package/dist/TemplateOutlinePanel-Dci6aRn1.js +96 -0
  16. package/dist/TemplateReusePanel-B7Gmyc1z.js +388 -0
  17. package/dist/TemplateReusePanel-CY5eO2Sh.cjs +1 -0
  18. package/dist/TemplateReviewPanel-DjlX3xpt.js +592 -0
  19. package/dist/TemplateReviewPanel-JvZe9_4G.cjs +1 -0
  20. package/dist/{batch-mRqhhhjt.js → batch-DzaTNLWI.js} +23 -16
  21. package/dist/batch-xMkqYiTr.cjs +1 -0
  22. package/dist/config-0UIohTS7.cjs +1 -0
  23. package/dist/{config-B612mw0x.js → config-Dt9NtCPl.js} +227 -186
  24. package/dist/data-explanation-BktvER5B.cjs +1 -0
  25. package/dist/data-explanation-C_J6jYNi.js +16 -0
  26. package/dist/designer-Ci1LizA9.js +5020 -0
  27. package/dist/designer-rtmVIIdN.cjs +2 -0
  28. package/dist/designer.cjs +1 -2
  29. package/dist/designer.d.cts +306 -3
  30. package/dist/designer.d.ts +306 -3
  31. package/dist/designer.js +21 -4266
  32. package/dist/font-loader-DHto6Lra.js +297 -0
  33. package/dist/font-loader-vhCT8znW.cjs +1 -0
  34. package/dist/index.cjs +8 -8
  35. package/dist/index.d.cts +182 -1
  36. package/dist/index.d.ts +182 -1
  37. package/dist/index.js +728 -628
  38. package/dist/{template-review-BzpcI-tR.js → json-snapshot-BeFT3Tso.js} +867 -637
  39. package/dist/json-snapshot-D1NTP2oI.cjs +2 -0
  40. package/dist/pdf-8UPQebOE.js +36288 -0
  41. package/dist/pdf-AyJGb22z.cjs +101 -0
  42. package/dist/pdf.cjs +1 -101
  43. package/dist/pdf.js +9 -36579
  44. package/dist/plugin-BGKf-Tqg.js +22 -0
  45. package/dist/{plugin-BDTU4D94.cjs → plugin-CktLH_Iy.cjs} +1 -1
  46. package/dist/{region-binding-workflow-CcUq8W2Q.js → region-binding-workflow-DEJbhpCv.js} +1 -1
  47. package/dist/server/node.d.cts +46 -11
  48. package/dist/server/node.d.ts +46 -11
  49. package/dist/server-node.cjs +1 -1
  50. package/dist/server-node.js +294 -280
  51. package/dist/server.cjs +1 -1
  52. package/dist/server.d.cts +107 -12
  53. package/dist/server.d.ts +107 -12
  54. package/dist/server.js +713 -453
  55. package/dist/style.css +1 -1
  56. package/dist/template-bindings-BJR4k7qZ.cjs +1 -0
  57. package/dist/template-bindings-Daui7hLF.js +252 -0
  58. package/dist/template-fragments-CLkGo6To.js +187 -0
  59. package/dist/template-fragments-DFUpq5QM.cjs +1 -0
  60. package/dist/template-outline-B3xVkzSv.cjs +1 -0
  61. package/dist/template-outline-CFenM1PV.js +88 -0
  62. package/dist/{template-registry-BjE1VS6g.js → template-registry-COXDEJEM.js} +1 -1
  63. package/dist/{useLocalDraft-C07SYRnC.js → useLocalDraft-BnhcxXk_.js} +1 -1
  64. package/dist/{useLocalDraft-Yiw1wFgI.cjs → useLocalDraft-CioIfDb6.cjs} +1 -1
  65. package/dist/{validate-DbgEM1Hh.js → validate-CkQBWCeg.js} +3 -3
  66. package/dist/vue/async.d.cts +72 -2
  67. package/dist/vue/async.d.ts +72 -2
  68. package/dist/vue/index.d.cts +124 -5
  69. package/dist/vue/index.d.ts +124 -5
  70. package/dist/vue-async.cjs +1 -1
  71. package/dist/vue-async.js +5 -5
  72. package/dist/vue.cjs +1 -1
  73. package/dist/vue.js +78 -71
  74. package/dist/{workbook-session-BPb3TMnT.js → workbook-session-BfK1yHOO.js} +1 -1
  75. package/dist/worker.cjs +1 -1
  76. package/dist/worker.d.cts +46 -11
  77. package/dist/worker.d.ts +46 -11
  78. package/dist/worker.js +59 -55
  79. package/dist/xlsx.js +3 -3
  80. package/package.json +1 -1
  81. package/dist/ExcelBindingWizard-CeAf4QSE.js +0 -1465
  82. package/dist/ExcelBindingWizard-y0mT-AHR.cjs +0 -1
  83. package/dist/ParamEditor-MBBC7lUE.cjs +0 -1
  84. package/dist/ReportBatchPanel-Dc-SDkYA.cjs +0 -1
  85. package/dist/ReportPreview-DWXROHBP.cjs +0 -6
  86. package/dist/ReportPreview-DiNXhQI0.js +0 -4138
  87. package/dist/ReportTemplateLibrary-5fk5CQBO.cjs +0 -1
  88. package/dist/RuleEditor-ChRzNQuF.cjs +0 -1
  89. package/dist/RuleEditor-DzAmW5YH.js +0 -2024
  90. package/dist/TemplateReviewPanel-BKofGrV9.js +0 -222
  91. package/dist/TemplateReviewPanel-DwtOcLue.cjs +0 -1
  92. package/dist/batch-Bt3Fd27Z.cjs +0 -1
  93. package/dist/config-BRoLo2oj.cjs +0 -1
  94. package/dist/plugin-Cd5G2QQn.js +0 -22
  95. package/dist/record-bindings-By_UKZ2g.cjs +0 -1
  96. package/dist/record-bindings-D-5jQlTj.js +0 -196
  97. package/dist/template-review-BfCC8Ng9.cjs +0 -2
@@ -681,6 +681,7 @@ declare interface MachReportConfig {
681
681
  }
682
682
  /** defaults 层可配置项(全部可选,均有内置缺省) */
683
683
  declare interface MachReportDefaults {
684
+ printOptions?: ReportPrintOptions;
684
685
  showExport?: boolean;
685
686
  showPrint?: boolean;
686
687
  showPdfWindow?: boolean;
@@ -727,7 +728,7 @@ declare type MachReportLogger = Pick<Console, "warn" | "info">;
727
728
  * - 优先级:组件 props > 路由级叠加 > preset > defaults(props 永远最高)
728
729
  */
729
730
  /** 工具栏与状态文案(默认简体中文;出海场景覆写) */
730
- declare interface MachReportMessages extends Partial<ReportCalculationMessages> {
731
+ declare interface MachReportMessages extends Partial<ReportCalculationMessages>, ReportPrintMessages {
731
732
  exportMenu?: string;
732
733
  exportMenuDescription?: string;
733
734
  clearSearch?: string;
@@ -737,6 +738,17 @@ declare interface MachReportMessages extends Partial<ReportCalculationMessages>
737
738
  pageJumpInvalid?: string;
738
739
  pageJumpHint?: string;
739
740
  pagination?: string;
741
+ recordNavigation?: string;
742
+ dataExplanation?: string;
743
+ dataExplanationHint?: string;
744
+ dataExplanationSearch?: string;
745
+ dataExplanationEmpty?: string;
746
+ dataMissingSource?: string;
747
+ dataNotApplicable?: string;
748
+ dataNotCalculable?: string;
749
+ recordInfo?: string;
750
+ prevRecord?: string;
751
+ nextRecord?: string;
740
752
  columnSearchHint?: string;
741
753
  columnSearchShortcut?: string;
742
754
  closeColumnDirectory?: string;
@@ -1426,6 +1438,20 @@ declare interface ReportCellTableIdentity_2 {
1426
1438
  declare type ReportCellValue = string | number | boolean | null;
1427
1439
  declare type ReportCellValue_2 = string | number | boolean | null;
1428
1440
  declare type ReportCellValueType = NonNullable<GridCell_2["valueType"]>;
1441
+ declare interface ReportDataTarget {
1442
+ datasetId: string;
1443
+ field: string;
1444
+ rowKey?: string | number;
1445
+ /** Use table identity when the same dataset appears in several tables. */
1446
+ tableId?: string;
1447
+ }
1448
+ declare interface ReportDataTarget_2 {
1449
+ datasetId: string;
1450
+ field: string;
1451
+ rowKey?: string | number;
1452
+ /** Use table identity when the same dataset appears in several tables. */
1453
+ tableId?: string;
1454
+ }
1429
1455
  declare interface ReportDefinition {
1430
1456
  /** 静态模板或宿主提供的异步模板加载器;动态模板默认每次重新读取,不缓存版本。 */
1431
1457
  template: ReportTemplate | ReportTemplateLoader;
@@ -1446,6 +1472,9 @@ declare interface ReportDiagnostic {
1446
1472
  message: string;
1447
1473
  path?: string;
1448
1474
  severity: "warning" | "error" | "info";
1475
+ /** Optional explanation supplied by the business source, not inferred from blank cells. */
1476
+ valueState?: ReportValueState;
1477
+ target?: ReportDataTarget;
1449
1478
  }
1450
1479
  declare type ReportDiscardReason = "reload" | "import" | "replace" | "leave";
1451
1480
  declare interface ReportEditBatch {
@@ -1529,7 +1558,8 @@ declare interface ReportFetchInput extends ReportTaskMonitoring {
1529
1558
  signal?: AbortSignal;
1530
1559
  /** 本次分页与计划告警;未提供时使用数据源配置的告警通道。 */
1531
1560
  onWarning?: (message: string) => void;
1532
- onQueryResult?: (reportId: string, result: ReportQueryResult) => void;
1561
+ /** Index scopes diagnostics when reports share datasets or a report ID is repeated. */
1562
+ onQueryResult?: (reportId: string, result: ReportQueryResult, reportIndex?: number) => void;
1533
1563
  }
1534
1564
  declare interface ReportFieldContract {
1535
1565
  field: string;
@@ -1550,6 +1580,7 @@ declare interface ReportFieldTarget {
1550
1580
  datasetId?: string;
1551
1581
  rowKey?: string | number;
1552
1582
  tableId?: string;
1583
+ reportScope?: string;
1553
1584
  }
1554
1585
  declare interface ReportFlowBand {
1555
1586
  /** Exact stable component IDs. Static components use nid, lists use id. */
@@ -1650,7 +1681,13 @@ declare interface ReportPreferencesOptions {
1650
1681
  key: string;
1651
1682
  adapter: ReportPreferencesAdapter;
1652
1683
  }
1684
+ declare interface ReportPreviewDataTarget extends ReportDataTarget_2 {
1685
+ /** Added by the query adapter; isolates identical dataset/row/field identities across reports. */
1686
+ reportScope?: string;
1687
+ }
1653
1688
  declare interface ReportPreviewDiagnostic {
1689
+ valueState?: ReportValueState_2;
1690
+ target?: ReportPreviewDataTarget;
1654
1691
  code: string;
1655
1692
  severity: "warning" | "error" | "info";
1656
1693
  message: string;
@@ -1673,6 +1710,35 @@ declare interface ReportPreviewTask {
1673
1710
  }
1674
1711
  declare type ReportPreviewTaskStage = "query" | "validate" | "layout" | "assets" | "import" | "encode" | "download" | "print";
1675
1712
  declare type ReportPreviewTool = "search" | "thumbnails" | "zoom" | ReportExportFormat | "print" | "pdfWindow" | "editing" | "import";
1713
+ declare interface ReportPrintCalibration {
1714
+ offsetXmm?: number;
1715
+ offsetYmm?: number;
1716
+ }
1717
+ declare interface ReportPrintFont {
1718
+ /** Same family name used by the template. Sources are trusted application assets. */
1719
+ family: string;
1720
+ source: string;
1721
+ weight?: string;
1722
+ style?: "normal" | "italic" | "oblique";
1723
+ }
1724
+ declare interface ReportPrintMessages {
1725
+ printPrepareTimeout?: string;
1726
+ printImageFailed?: string;
1727
+ printFontFailed?: string;
1728
+ printPrepareFailed?: string;
1729
+ printCalibration?: string;
1730
+ printOffsetX?: string;
1731
+ printOffsetY?: string;
1732
+ printCalibrationTest?: string;
1733
+ printCalibrationHint?: string;
1734
+ }
1735
+ declare interface ReportPrintOptions {
1736
+ /** Defaults to 15 seconds for the entire font/image preparation stage. */
1737
+ resourceTimeoutMs?: number;
1738
+ fonts?: readonly ReportPrintFont[];
1739
+ /** Physical translation only; no scaling or mutation of the report data/plan. */
1740
+ calibration?: ReportPrintCalibration;
1741
+ }
1676
1742
  /** 查询是唯一基础能力;权限、HTTP、数据库和事务都留在宿主适配器内。 */
1677
1743
  declare interface ReportProvider {
1678
1744
  query(context: ReportLoadContext): ReportQueryResult | Promise<ReportQueryResult>;
@@ -1783,6 +1849,10 @@ declare interface ReportTemplateRepeat_2 {
1783
1849
  };
1784
1850
  }
1785
1851
  declare type ReportTemplateSummary = Omit<ReportTemplateDocument, "template">;
1852
+ /** Optional business explanations never replace raw data or schema validation. */
1853
+ declare type ReportValueState = "missing-source" | "not-applicable" | "not-calculable";
1854
+ /** Optional business explanations never replace raw data or schema validation. */
1855
+ declare type ReportValueState_2 = "missing-source" | "not-applicable" | "not-calculable";
1786
1856
  declare interface RichParagraph {
1787
1857
  segments: RichSegment[];
1788
1858
  align?: ComponentStyle["align"];
@@ -681,6 +681,7 @@ declare interface MachReportConfig {
681
681
  }
682
682
  /** defaults 层可配置项(全部可选,均有内置缺省) */
683
683
  declare interface MachReportDefaults {
684
+ printOptions?: ReportPrintOptions;
684
685
  showExport?: boolean;
685
686
  showPrint?: boolean;
686
687
  showPdfWindow?: boolean;
@@ -727,7 +728,7 @@ declare type MachReportLogger = Pick<Console, "warn" | "info">;
727
728
  * - 优先级:组件 props > 路由级叠加 > preset > defaults(props 永远最高)
728
729
  */
729
730
  /** 工具栏与状态文案(默认简体中文;出海场景覆写) */
730
- declare interface MachReportMessages extends Partial<ReportCalculationMessages> {
731
+ declare interface MachReportMessages extends Partial<ReportCalculationMessages>, ReportPrintMessages {
731
732
  exportMenu?: string;
732
733
  exportMenuDescription?: string;
733
734
  clearSearch?: string;
@@ -737,6 +738,17 @@ declare interface MachReportMessages extends Partial<ReportCalculationMessages>
737
738
  pageJumpInvalid?: string;
738
739
  pageJumpHint?: string;
739
740
  pagination?: string;
741
+ recordNavigation?: string;
742
+ dataExplanation?: string;
743
+ dataExplanationHint?: string;
744
+ dataExplanationSearch?: string;
745
+ dataExplanationEmpty?: string;
746
+ dataMissingSource?: string;
747
+ dataNotApplicable?: string;
748
+ dataNotCalculable?: string;
749
+ recordInfo?: string;
750
+ prevRecord?: string;
751
+ nextRecord?: string;
740
752
  columnSearchHint?: string;
741
753
  columnSearchShortcut?: string;
742
754
  closeColumnDirectory?: string;
@@ -1426,6 +1438,20 @@ declare interface ReportCellTableIdentity_2 {
1426
1438
  declare type ReportCellValue = string | number | boolean | null;
1427
1439
  declare type ReportCellValue_2 = string | number | boolean | null;
1428
1440
  declare type ReportCellValueType = NonNullable<GridCell_2["valueType"]>;
1441
+ declare interface ReportDataTarget {
1442
+ datasetId: string;
1443
+ field: string;
1444
+ rowKey?: string | number;
1445
+ /** Use table identity when the same dataset appears in several tables. */
1446
+ tableId?: string;
1447
+ }
1448
+ declare interface ReportDataTarget_2 {
1449
+ datasetId: string;
1450
+ field: string;
1451
+ rowKey?: string | number;
1452
+ /** Use table identity when the same dataset appears in several tables. */
1453
+ tableId?: string;
1454
+ }
1429
1455
  declare interface ReportDefinition {
1430
1456
  /** 静态模板或宿主提供的异步模板加载器;动态模板默认每次重新读取,不缓存版本。 */
1431
1457
  template: ReportTemplate | ReportTemplateLoader;
@@ -1446,6 +1472,9 @@ declare interface ReportDiagnostic {
1446
1472
  message: string;
1447
1473
  path?: string;
1448
1474
  severity: "warning" | "error" | "info";
1475
+ /** Optional explanation supplied by the business source, not inferred from blank cells. */
1476
+ valueState?: ReportValueState;
1477
+ target?: ReportDataTarget;
1449
1478
  }
1450
1479
  declare type ReportDiscardReason = "reload" | "import" | "replace" | "leave";
1451
1480
  declare interface ReportEditBatch {
@@ -1529,7 +1558,8 @@ declare interface ReportFetchInput extends ReportTaskMonitoring {
1529
1558
  signal?: AbortSignal;
1530
1559
  /** 本次分页与计划告警;未提供时使用数据源配置的告警通道。 */
1531
1560
  onWarning?: (message: string) => void;
1532
- onQueryResult?: (reportId: string, result: ReportQueryResult) => void;
1561
+ /** Index scopes diagnostics when reports share datasets or a report ID is repeated. */
1562
+ onQueryResult?: (reportId: string, result: ReportQueryResult, reportIndex?: number) => void;
1533
1563
  }
1534
1564
  declare interface ReportFieldContract {
1535
1565
  field: string;
@@ -1550,6 +1580,7 @@ declare interface ReportFieldTarget {
1550
1580
  datasetId?: string;
1551
1581
  rowKey?: string | number;
1552
1582
  tableId?: string;
1583
+ reportScope?: string;
1553
1584
  }
1554
1585
  declare interface ReportFlowBand {
1555
1586
  /** Exact stable component IDs. Static components use nid, lists use id. */
@@ -1650,7 +1681,13 @@ declare interface ReportPreferencesOptions {
1650
1681
  key: string;
1651
1682
  adapter: ReportPreferencesAdapter;
1652
1683
  }
1684
+ declare interface ReportPreviewDataTarget extends ReportDataTarget_2 {
1685
+ /** Added by the query adapter; isolates identical dataset/row/field identities across reports. */
1686
+ reportScope?: string;
1687
+ }
1653
1688
  declare interface ReportPreviewDiagnostic {
1689
+ valueState?: ReportValueState_2;
1690
+ target?: ReportPreviewDataTarget;
1654
1691
  code: string;
1655
1692
  severity: "warning" | "error" | "info";
1656
1693
  message: string;
@@ -1673,6 +1710,35 @@ declare interface ReportPreviewTask {
1673
1710
  }
1674
1711
  declare type ReportPreviewTaskStage = "query" | "validate" | "layout" | "assets" | "import" | "encode" | "download" | "print";
1675
1712
  declare type ReportPreviewTool = "search" | "thumbnails" | "zoom" | ReportExportFormat | "print" | "pdfWindow" | "editing" | "import";
1713
+ declare interface ReportPrintCalibration {
1714
+ offsetXmm?: number;
1715
+ offsetYmm?: number;
1716
+ }
1717
+ declare interface ReportPrintFont {
1718
+ /** Same family name used by the template. Sources are trusted application assets. */
1719
+ family: string;
1720
+ source: string;
1721
+ weight?: string;
1722
+ style?: "normal" | "italic" | "oblique";
1723
+ }
1724
+ declare interface ReportPrintMessages {
1725
+ printPrepareTimeout?: string;
1726
+ printImageFailed?: string;
1727
+ printFontFailed?: string;
1728
+ printPrepareFailed?: string;
1729
+ printCalibration?: string;
1730
+ printOffsetX?: string;
1731
+ printOffsetY?: string;
1732
+ printCalibrationTest?: string;
1733
+ printCalibrationHint?: string;
1734
+ }
1735
+ declare interface ReportPrintOptions {
1736
+ /** Defaults to 15 seconds for the entire font/image preparation stage. */
1737
+ resourceTimeoutMs?: number;
1738
+ fonts?: readonly ReportPrintFont[];
1739
+ /** Physical translation only; no scaling or mutation of the report data/plan. */
1740
+ calibration?: ReportPrintCalibration;
1741
+ }
1676
1742
  /** 查询是唯一基础能力;权限、HTTP、数据库和事务都留在宿主适配器内。 */
1677
1743
  declare interface ReportProvider {
1678
1744
  query(context: ReportLoadContext): ReportQueryResult | Promise<ReportQueryResult>;
@@ -1783,6 +1849,10 @@ declare interface ReportTemplateRepeat_2 {
1783
1849
  };
1784
1850
  }
1785
1851
  declare type ReportTemplateSummary = Omit<ReportTemplateDocument, "template">;
1852
+ /** Optional business explanations never replace raw data or schema validation. */
1853
+ declare type ReportValueState = "missing-source" | "not-applicable" | "not-calculable";
1854
+ /** Optional business explanations never replace raw data or schema validation. */
1855
+ declare type ReportValueState_2 = "missing-source" | "not-applicable" | "not-calculable";
1786
1856
  declare interface RichParagraph {
1787
1857
  segments: RichSegment[];
1788
1858
  align?: ComponentStyle["align"];
@@ -70,6 +70,10 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
70
70
  type: PropType<AssetRenderOptions>;
71
71
  default: undefined;
72
72
  };
73
+ printOptions: {
74
+ type: PropType<ReportPrintOptions>;
75
+ default: undefined;
76
+ };
73
77
  /** 保留表头的零行业务结果;不改变计划和导出内容。 */
74
78
  emptyState: {
75
79
  type: PropType<boolean | ReportEmptyState>;
@@ -228,6 +232,10 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
228
232
  type: PropType<AssetRenderOptions>;
229
233
  default: undefined;
230
234
  };
235
+ printOptions: {
236
+ type: PropType<ReportPrintOptions>;
237
+ default: undefined;
238
+ };
231
239
  /** 保留表头的零行业务结果;不改变计划和导出内容。 */
232
240
  emptyState: {
233
241
  type: PropType<boolean | ReportEmptyState>;
@@ -301,6 +309,7 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
301
309
  showPdfWindow: boolean;
302
310
  showSettings: boolean;
303
311
  showParams: boolean;
312
+ printOptions: ReportPrintOptions;
304
313
  toolbar: MachReportToolbarOptions;
305
314
  interaction: ReportInteractionOptions;
306
315
  preferences: ReportPreferencesOptions;
@@ -318,8 +327,8 @@ declare const __VLS_component_2: DefineComponent<__VLS_Props, {
318
327
  focusSearch: () => void;
319
328
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
320
329
  export: (format: ReportExportFormat) => any;
321
- print: () => any;
322
330
  zoom: (mode: number | "fit") => any;
331
+ print: () => any;
323
332
  goto: (page: number) => any;
324
333
  "pdf-window": () => any;
325
334
  "search-input": (query: string) => any;
@@ -330,8 +339,8 @@ declare const __VLS_component_2: DefineComponent<__VLS_Props, {
330
339
  "settings-toggle": () => any;
331
340
  }, string, MachReportVuePublicProps, Readonly<__VLS_Props> & Readonly<{
332
341
  onExport?: ((format: ReportExportFormat) => any) | undefined;
333
- onPrint?: (() => any) | undefined;
334
342
  onZoom?: ((mode: number | "fit") => any) | undefined;
343
+ onPrint?: (() => any) | undefined;
335
344
  onGoto?: ((page: number) => any) | undefined;
336
345
  "onPdf-window"?: (() => any) | undefined;
337
346
  "onSearch-input"?: ((query: string) => any) | undefined;
@@ -469,7 +478,7 @@ declare interface AssetRenderOptions extends OutputDiagnosticOptions {
469
478
  signal?: AbortSignal;
470
479
  }
471
480
  /** 供 HTML/Word 导出的完整文档;打印路径逐页渲染,避免预先生成所有页。 */
472
- export declare function buildPrintDocument(p: RenderPlan): PrintHtmlResult;
481
+ export declare function buildPrintDocument(p: RenderPlan, options?: ReportPrintOptions): PrintHtmlResult;
473
482
  export declare function buildWordHtml(p: RenderPlan): {
474
483
  html: string;
475
484
  filename: string;
@@ -722,6 +731,8 @@ export declare function createFetchRequest(options?: FetchRequestOptions): HostR
722
731
  * 用于本地预览、离线场景和单测。
723
732
  */
724
733
  export declare function createLocalFetcher(entries: Record<string, LocalTemplateEntry> | ReportRegistry): PlanFetcher;
734
+ /** Independent physical test page. Its ruler is measured in millimetres, never CSS pixels. */
735
+ export declare function createPrintCalibrationPlan(widthMm: number, heightMm: number): RenderPlan_2;
725
736
  /** Explicit persistence bridge. Merely registering ReportProvider never enables editing or saving. */
726
737
  export declare function createProviderEditing(provider: ReportProvider, options: ProviderEditingOptions): ReportEditingOptions;
727
738
  /** Optional browser convenience adapter. Access errors are handled by the preview. */
@@ -740,6 +751,7 @@ declare interface DatasetValidationOptions {
740
751
  }
741
752
  export declare const DEFAULT_CALCULATION_MESSAGES: ReportCalculationMessages;
742
753
  export declare const DEFAULT_MESSAGES: MachReportMessages;
754
+ export declare const DEFAULT_PRINT_MESSAGES: Required<ReportPrintMessages>;
743
755
  export declare const DEFAULT_THEME: MachReportTheme;
744
756
  export declare interface DefaultPdfExporterOptions {
745
757
  /** 中文字体 URL(浏览器 fetch);空串跳过字体加载(西文报表) */
@@ -1367,6 +1379,7 @@ export declare interface MachReportController {
1367
1379
  }
1368
1380
  /** defaults 层可配置项(全部可选,均有内置缺省) */
1369
1381
  export declare interface MachReportDefaults {
1382
+ printOptions?: ReportPrintOptions;
1370
1383
  showExport?: boolean;
1371
1384
  showPrint?: boolean;
1372
1385
  showPdfWindow?: boolean;
@@ -1449,7 +1462,7 @@ export declare type MachReportLogger = Pick<Console, "warn" | "info">;
1449
1462
  * - 优先级:组件 props > 路由级叠加 > preset > defaults(props 永远最高)
1450
1463
  */
1451
1464
  /** 工具栏与状态文案(默认简体中文;出海场景覆写) */
1452
- export declare interface MachReportMessages extends Partial<ReportCalculationMessages> {
1465
+ export declare interface MachReportMessages extends Partial<ReportCalculationMessages>, ReportPrintMessages {
1453
1466
  exportMenu?: string;
1454
1467
  exportMenuDescription?: string;
1455
1468
  clearSearch?: string;
@@ -1459,6 +1472,17 @@ export declare interface MachReportMessages extends Partial<ReportCalculationMes
1459
1472
  pageJumpInvalid?: string;
1460
1473
  pageJumpHint?: string;
1461
1474
  pagination?: string;
1475
+ recordNavigation?: string;
1476
+ dataExplanation?: string;
1477
+ dataExplanationHint?: string;
1478
+ dataExplanationSearch?: string;
1479
+ dataExplanationEmpty?: string;
1480
+ dataMissingSource?: string;
1481
+ dataNotApplicable?: string;
1482
+ dataNotCalculable?: string;
1483
+ recordInfo?: string;
1484
+ prevRecord?: string;
1485
+ nextRecord?: string;
1462
1486
  columnSearchHint?: string;
1463
1487
  columnSearchShortcut?: string;
1464
1488
  closeColumnDirectory?: string;
@@ -1974,6 +1998,18 @@ declare interface PlanPage {
1974
1998
  marginRightMm?: number;
1975
1999
  components: PlanComponent[];
1976
2000
  }
2001
+ declare interface PlanPage_2 {
2002
+ meta?: Record<string, unknown>;
2003
+ /** wide 表示完整自然列宽;页面仅为预览的垂直窗口分段。 */
2004
+ layout?: "page" | "wide";
2005
+ pageWidthMm: number;
2006
+ pageHeightMm: number;
2007
+ marginTopMm?: number;
2008
+ marginBottomMm?: number;
2009
+ marginLeftMm?: number;
2010
+ marginRightMm?: number;
2011
+ components: PlanComponent_2[];
2012
+ }
1977
2013
  /** 列表的逻辑行来源;用于连续 Excel 重组,避免按文本猜测重复表头。 */
1978
2014
  declare interface PlanTableFragment {
1979
2015
  /** 在整个计划中唯一的逻辑表身份;同一表的分页片段共享身份。 */
@@ -2022,6 +2058,12 @@ declare interface PlanTableFragment_3 {
2022
2058
  rowKey?: string | number;
2023
2059
  };
2024
2060
  }
2061
+ /** Bounded concurrency, one stage timeout, and cancellation even for a hanging decoder. */
2062
+ export declare function preparePrintResources(doc: Document, options?: ReportPrintOptions, signal?: AbortSignal, base?: string): Promise<void>;
2063
+ export declare function printCalibration(options?: ReportPrintOptions): {
2064
+ x: number;
2065
+ y: number;
2066
+ };
2025
2067
  declare interface PrintHtmlResult {
2026
2068
  head: string;
2027
2069
  pageChunks: string[];
@@ -2034,6 +2076,8 @@ export declare function printPlans(plans: RenderPlan[], options?: {
2034
2076
  onProgress?: (done: number, total: number) => void;
2035
2077
  onError?: (message: string) => void;
2036
2078
  signal?: AbortSignal;
2079
+ printOptions?: ReportPrintOptions;
2080
+ messages?: ReportPrintMessages;
2037
2081
  }): Promise<void>;
2038
2082
  /**
2039
2083
  * 路由/布局级响应式叠加:就近提供配置层(如某路由关闭导出按钮)。
@@ -2055,6 +2099,12 @@ declare interface RenderPlan {
2055
2099
  requiresRecalculation?: boolean;
2056
2100
  pages: PlanPage[];
2057
2101
  }
2102
+ declare interface RenderPlan_2 {
2103
+ schemaVersion: string;
2104
+ /** 编辑需要模板重算上下文;跨 Worker/JSON 保留要求,但不声明本地会话可用。 */
2105
+ requiresRecalculation?: boolean;
2106
+ pages: PlanPage_2[];
2107
+ }
2058
2108
  export declare const REPORT_EXPORT_FORMATS: readonly ReportExportFormat[];
2059
2109
  export declare const REPORT_PREVIEW_TOOLS: readonly [
2060
2110
  "search",
@@ -2224,6 +2274,20 @@ declare interface ReportCellTableIdentity_2 {
2224
2274
  declare type ReportCellValue = string | number | boolean | null;
2225
2275
  declare type ReportCellValue_2 = string | number | boolean | null;
2226
2276
  declare type ReportCellValueType = NonNullable<GridCell_2["valueType"]>;
2277
+ declare interface ReportDataTarget {
2278
+ datasetId: string;
2279
+ field: string;
2280
+ rowKey?: string | number;
2281
+ /** Use table identity when the same dataset appears in several tables. */
2282
+ tableId?: string;
2283
+ }
2284
+ declare interface ReportDataTarget_2 {
2285
+ datasetId: string;
2286
+ field: string;
2287
+ rowKey?: string | number;
2288
+ /** Use table identity when the same dataset appears in several tables. */
2289
+ tableId?: string;
2290
+ }
2227
2291
  declare interface ReportDefinition {
2228
2292
  /** 静态模板或宿主提供的异步模板加载器;动态模板默认每次重新读取,不缓存版本。 */
2229
2293
  template: ReportTemplate_2 | ReportTemplateLoader;
@@ -2244,6 +2308,9 @@ declare interface ReportDiagnostic {
2244
2308
  message: string;
2245
2309
  path?: string;
2246
2310
  severity: "warning" | "error" | "info";
2311
+ /** Optional explanation supplied by the business source, not inferred from blank cells. */
2312
+ valueState?: ReportValueState;
2313
+ target?: ReportDataTarget;
2247
2314
  }
2248
2315
  export declare type ReportDiscardReason = "reload" | "import" | "replace" | "leave";
2249
2316
  declare interface ReportEditBatch {
@@ -2339,7 +2406,8 @@ declare interface ReportFetchInput extends ReportTaskMonitoring {
2339
2406
  signal?: AbortSignal;
2340
2407
  /** 本次分页与计划告警;未提供时使用数据源配置的告警通道。 */
2341
2408
  onWarning?: (message: string) => void;
2342
- onQueryResult?: (reportId: string, result: ReportQueryResult) => void;
2409
+ /** Index scopes diagnostics when reports share datasets or a report ID is repeated. */
2410
+ onQueryResult?: (reportId: string, result: ReportQueryResult, reportIndex?: number) => void;
2343
2411
  }
2344
2412
  declare interface ReportFieldContract {
2345
2413
  field: string;
@@ -2360,6 +2428,7 @@ export declare interface ReportFieldTarget {
2360
2428
  datasetId?: string;
2361
2429
  rowKey?: string | number;
2362
2430
  tableId?: string;
2431
+ reportScope?: string;
2363
2432
  }
2364
2433
  declare interface ReportFlowBand {
2365
2434
  /** Exact stable component IDs. Static components use nid, lists use id. */
@@ -2514,7 +2583,13 @@ export declare interface ReportPreferencesOptions {
2514
2583
  adapter: ReportPreferencesAdapter;
2515
2584
  }
2516
2585
  export declare const ReportPreview: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
2586
+ export declare interface ReportPreviewDataTarget extends ReportDataTarget_2 {
2587
+ /** Added by the query adapter; isolates identical dataset/row/field identities across reports. */
2588
+ reportScope?: string;
2589
+ }
2517
2590
  export declare interface ReportPreviewDiagnostic {
2591
+ valueState?: ReportValueState_2;
2592
+ target?: ReportPreviewDataTarget;
2518
2593
  code: string;
2519
2594
  severity: "warning" | "error" | "info";
2520
2595
  message: string;
@@ -2537,6 +2612,41 @@ export declare interface ReportPreviewTask {
2537
2612
  }
2538
2613
  export declare type ReportPreviewTaskStage = "query" | "validate" | "layout" | "assets" | "import" | "encode" | "download" | "print";
2539
2614
  export declare type ReportPreviewTool = "search" | "thumbnails" | "zoom" | ReportExportFormat | "print" | "pdfWindow" | "editing" | "import";
2615
+ export declare interface ReportPrintCalibration {
2616
+ offsetXmm?: number;
2617
+ offsetYmm?: number;
2618
+ }
2619
+ export declare interface ReportPrintFont {
2620
+ /** Same family name used by the template. Sources are trusted application assets. */
2621
+ family: string;
2622
+ source: string;
2623
+ weight?: string;
2624
+ style?: "normal" | "italic" | "oblique";
2625
+ }
2626
+ export declare interface ReportPrintMessages {
2627
+ printPrepareTimeout?: string;
2628
+ printImageFailed?: string;
2629
+ printFontFailed?: string;
2630
+ printPrepareFailed?: string;
2631
+ printCalibration?: string;
2632
+ printOffsetX?: string;
2633
+ printOffsetY?: string;
2634
+ printCalibrationTest?: string;
2635
+ printCalibrationHint?: string;
2636
+ }
2637
+ export declare interface ReportPrintOptions {
2638
+ /** Defaults to 15 seconds for the entire font/image preparation stage. */
2639
+ resourceTimeoutMs?: number;
2640
+ fonts?: readonly ReportPrintFont[];
2641
+ /** Physical translation only; no scaling or mutation of the report data/plan. */
2642
+ calibration?: ReportPrintCalibration;
2643
+ }
2644
+ export declare class ReportPrintResourceError extends Error {
2645
+ readonly kind: "image" | "font" | "timeout" | "config";
2646
+ readonly resource: string | number;
2647
+ readonly code = "print-resource";
2648
+ constructor(kind: "image" | "font" | "timeout" | "config", resource?: string | number);
2649
+ }
2540
2650
  /** 查询是唯一基础能力;权限、HTTP、数据库和事务都留在宿主适配器内。 */
2541
2651
  declare interface ReportProvider {
2542
2652
  query(context: ReportLoadContext): ReportQueryResult | Promise<ReportQueryResult>;
@@ -2669,6 +2779,10 @@ declare interface ReportTemplateRepeat_3 {
2669
2779
  }
2670
2780
  declare type ReportTemplateSummary = Omit<ReportTemplateDocument, "template">;
2671
2781
  export declare const ReportToolbar: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
2782
+ /** Optional business explanations never replace raw data or schema validation. */
2783
+ declare type ReportValueState = "missing-source" | "not-applicable" | "not-calculable";
2784
+ /** Optional business explanations never replace raw data or schema validation. */
2785
+ declare type ReportValueState_2 = "missing-source" | "not-applicable" | "not-calculable";
2672
2786
  /** 新消息保持可选,旧的完整文案对象也能获得新增能力的默认文案。 */
2673
2787
  export declare function resolveCalculationMessages(messages: Partial<ReportCalculationMessages>): ReportCalculationMessages;
2674
2788
  export declare function resolveConfig(config: MachReportConfig | null | undefined, presetName?: string): ResolvedConfig;
@@ -2688,6 +2802,7 @@ export declare type ResolvedConfig = Required<Pick<MachReportDefaults, "showExpo
2688
2802
  guardChanges: boolean;
2689
2803
  beforeDiscard?: ReportBeforeDiscard;
2690
2804
  output: ReportOutputOptions;
2805
+ printOptions?: ReportPrintOptions;
2691
2806
  };
2692
2807
  declare interface RichParagraph {
2693
2808
  segments: RichSegment[];
@@ -2732,6 +2847,7 @@ declare interface RichSegment_3 {
2732
2847
  style?: ComponentStyle_3;
2733
2848
  }
2734
2849
  export declare const SILENT_LOGGER: MachReportLogger;
2850
+ export declare function snapshotPrintOptions(options?: ReportPrintOptions): ReportPrintOptions;
2735
2851
  /** 条件格式规则求值(声明式,见 ListColumn.rules) */
2736
2852
  declare interface StyleRule {
2737
2853
  when: {
@@ -2916,12 +3032,15 @@ export declare function usePageWindow(plan: Ref<RenderPlan | null>, zoom: Ref<nu
2916
3032
  }[]>;
2917
3033
  makeScrollHandler: (currentPage: Ref<number>, pageCount: Ref<number>) => (vp: HTMLElement) => void;
2918
3034
  refreshViewport: (vp: HTMLElement | null) => void;
3035
+ scrollToPage: (vp: HTMLElement, index: number) => void;
2919
3036
  pageOffsetPx: (index: number) => number;
2920
3037
  destroy: () => void;
2921
3038
  };
2922
3039
  export declare function usePrintExport(plan: Ref<RenderPlan | null>, hooks: {
2923
3040
  /** 按导出开始时的配置快照处理,避免输出过程中跟随路由配置变化。 */
2924
3041
  getXlsxOptions?: () => XlsxRenderOptions;
3042
+ getPrintOptions?: () => ReportPrintOptions;
3043
+ getPrintMessages?: () => ReportPrintMessages;
2925
3044
  /** Flush the active editor and await source-backed calculation/persistence before capturing the output plan. */
2926
3045
  beforeOutput?: () => boolean | Promise<boolean>;
2927
3046
  getPdfExporter: () => PdfExporter;