@agile-team/mach-report 2.6.1 → 2.7.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 (61) hide show
  1. package/README.md +37 -4
  2. package/dist/ReportPreview-BdvoqdOd.cjs +6 -0
  3. package/dist/ReportPreview-COFkbeEM.js +3719 -0
  4. package/dist/{assets-NVA_sftu.js → assets-B9qJku3V.js} +54 -57
  5. package/dist/assets-RZan7EyL.cjs +1 -0
  6. package/dist/capabilities-joSutDF8.js +63 -0
  7. package/dist/capabilities-xGTpnPjJ.cjs +1 -0
  8. package/dist/designer.cjs +1 -1
  9. package/dist/designer.d.cts +869 -753
  10. package/dist/designer.d.ts +869 -753
  11. package/dist/designer.js +490 -234
  12. package/dist/index.cjs +8 -8
  13. package/dist/index.d.cts +86 -3
  14. package/dist/index.d.ts +86 -3
  15. package/dist/index.js +582 -508
  16. package/dist/pdf.cjs +30 -30
  17. package/dist/pdf.d.cts +11 -3
  18. package/dist/pdf.d.ts +11 -3
  19. package/dist/pdf.js +1501 -1500
  20. package/dist/{plugin-BqBkn_kI.cjs → plugin-9t_ZFwhz.cjs} +1 -1
  21. package/dist/{plugin-Ds10VnQO.js → plugin-s8Ay8kKk.js} +1 -1
  22. package/dist/progress-DD964VAB.js +102 -0
  23. package/dist/progress-KvhwXZ1Q.cjs +1 -0
  24. package/dist/{report-source-B9bENO0F.js → report-source-BXHNy_AD.js} +337 -332
  25. package/dist/report-source-CCAvFE3t.cjs +1 -0
  26. package/dist/server/node.d.cts +26 -3
  27. package/dist/server/node.d.ts +26 -3
  28. package/dist/server-node.cjs +1 -1
  29. package/dist/server-node.js +125 -92
  30. package/dist/server.cjs +1 -1
  31. package/dist/server.d.cts +28 -3
  32. package/dist/server.d.ts +28 -3
  33. package/dist/server.js +172 -164
  34. package/dist/style.css +1 -1
  35. package/dist/task-events-DQ276fn2.cjs +1 -0
  36. package/dist/task-events-Dpsvf_t2.js +47 -0
  37. package/dist/vue/async.d.cts +1507 -2083
  38. package/dist/vue/async.d.ts +1507 -2083
  39. package/dist/vue/index.d.cts +2376 -3310
  40. package/dist/vue/index.d.ts +2376 -3310
  41. package/dist/vue-async.cjs +1 -1
  42. package/dist/vue-async.js +3 -3
  43. package/dist/vue.cjs +1 -1
  44. package/dist/vue.js +131 -107
  45. package/dist/worker.cjs +1 -1
  46. package/dist/worker.d.cts +26 -3
  47. package/dist/worker.d.ts +26 -3
  48. package/dist/worker.js +110 -85
  49. package/dist/xlsx.cjs +14 -14
  50. package/dist/xlsx.d.cts +11 -3
  51. package/dist/xlsx.d.ts +11 -3
  52. package/dist/xlsx.js +656 -652
  53. package/package.json +2 -2
  54. package/dist/ReportPreview-Dk-28QAi.js +0 -2946
  55. package/dist/ReportPreview-FSvcBLjH.cjs +0 -6
  56. package/dist/assets-66UBlhES.cjs +0 -1
  57. package/dist/capabilities-CNjIirfo.js +0 -36
  58. package/dist/capabilities-D4xeVYSR.cjs +0 -1
  59. package/dist/grid-geometry-BNptEcMm.js +0 -65
  60. package/dist/grid-geometry-CZ_cYB6O.cjs +0 -1
  61. package/dist/report-source-BbNkkBDy.cjs +0 -1
@@ -1,753 +1,869 @@
1
- import { ComponentOptionsMixin } from 'vue';
2
- import { ComponentProvideOptions } from 'vue';
3
- import { DefineComponent } from 'vue';
4
- import { PublicProps } from 'vue';
5
-
6
- declare interface AssetRenderBudget {
7
- /** Maximum newly rendered assets, default 1000. Existing imageData is kept unchanged. */
8
- maxAssets?: number;
9
- /** Maximum image payload bytes per new asset, default 32 MiB. */
10
- maxImageBytes?: number;
11
- /** Maximum total image payload bytes for new assets, default 128 MiB. */
12
- maxTotalImageBytes?: number;
13
- /** Wall-clock budget, including adapters that ignore AbortSignal. Default 30 seconds. */
14
- maxDurationMs?: number;
15
- }
16
-
17
- declare interface AssetRenderOptions extends OutputDiagnosticOptions {
18
- assetRenderers?: Partial<Record<ImageComponentKind, ComponentImageRenderer>>;
19
- assetBudget?: AssetRenderBudget;
20
- /** Default throw prevents an incomplete export; placeholder retains the component and emits diagnostics. */
21
- assetFailure?: "throw" | "placeholder";
22
- signal?: AbortSignal;
23
- }
24
-
25
- /**
26
- * 列值格式化(声明式、JSON 可序列化)。
27
- * 在 paginate 的 cellText 出口统一消费:格式化发生在进 RenderPlan 之前,
28
- * 三后端(DOM/Canvas/PDF)零改动。
29
- *
30
- * 语义约定(v0.9 固化):
31
- * - number.digits 显式给出 → 精确保留(12.5 + digits:2 → "12.50")
32
- * - number.thousands 默认 false(千分位显式开启)
33
- * - date 字符串按"本地时区的日历日"解析(YYYY-MM-DD / YYYY/MM/DD 直取年月日,
34
- * 不经 Date 字符串构造——后者按 UTC 零点,负时区环境会少一天)
35
- */
36
-
37
- declare type ColumnFormat =
38
- | { kind: "number"; thousands?: boolean; digits?: number }
39
- | { kind: "percent"; digits?: number }
40
- | { kind: "date"; pattern?: string };
41
-
42
- declare interface ComponentImageContext {
43
- readonly component: Readonly<PlanComponent>;
44
- readonly pageIndex: number;
45
- readonly componentIndex: number;
46
- readonly componentPath: readonly number[];
47
- readonly signal: AbortSignal;
48
- }
49
-
50
- declare type ComponentImageRenderer = (context: ComponentImageContext) => string | Promise<string>;
51
-
52
- declare type ComponentKind =
53
- | "text"
54
- | "image"
55
- | "barcode"
56
- | "qrcode"
57
- | "chart"
58
- | "line"
59
- | "rect"
60
- | "ellipse";
61
-
62
- declare interface ComponentStyle {
63
- fontSizePx?: number;
64
- fontSize?: number;
65
- fontFamily?: string;
66
- bold?: boolean;
67
- italic?: boolean;
68
- underline?: boolean;
69
- color?: string;
70
- backgroundColor?: string;
71
- align?: "left" | "center" | "right" | "justify";
72
- verticalAlign?: "top" | "middle" | "bottom";
73
- lineColor?: string;
74
- borderColor?: string;
75
- lineWidthPt?: number;
76
- borderTop?: boolean;
77
- borderRight?: boolean;
78
- borderBottom?: boolean;
79
- borderLeft?: boolean;
80
- lineHeight?: number;
81
- letterSpacing?: number;
82
- opacity?: number;
83
- rotateDeg?: number;
84
- }
85
-
86
- declare type DatasetRows = Record<string, Record<string, unknown>[]>;
87
-
88
- /** Limits apply to the selected rectangular ranges, including their empty cells. */
89
- declare interface ExcelImportLimits {
90
- /** Compressed input, default 20 MiB. */
91
- maxFileBytes?: number;
92
- /** Declared ZIP uncompressed total, default 64 MiB. */
93
- maxUncompressedBytes?: number;
94
- /** Total selected cells across sheets, default 250,000; hard ceiling 1,000,000. */
95
- maxCells?: number;
96
- /** Rows per selected sheet, default 100,000; hard ceiling 1,048,576. */
97
- maxRows?: number;
98
- /** Columns per selected sheet, default 2,048; hard ceiling 16,384. */
99
- maxColumns?: number;
100
- /** Workbook sheets, default 32. */
101
- maxSheets?: number;
102
- }
103
-
104
- declare interface ExcelImportOptions {
105
- /** Sheet names or one-based workbook positions. Default: all visible sheets. */
106
- sheets?: Array<string | number>;
107
- /** A1 range for every sheet, or ranges keyed by exact sheet name. */
108
- range?: string | Record<string, string>;
109
- /** Wide preserves natural column widths. A3/A4 scale the complete width to paper. */
110
- layout?: "wide" | "a3" | "a4";
111
- /** Only applies to A3/A4; default landscape. */
112
- landscape?: boolean;
113
- /** Vertical preview segment limit, default 80, maximum 200. Merges remain intact. */
114
- maxRowsPerPage?: number;
115
- /** Optional resource limits; hard ceilings prevent unbounded allocations. */
116
- limits?: ExcelImportLimits;
117
- }
118
-
119
- declare interface GridCell {
120
- text?: string;
121
- rawText?: string;
122
- /** 原始值,仅供 Excel raw 模式消费;不参与预览、分页与 PDF 绘制。 */
123
- value?: string | number | boolean | null;
124
- /** Excel 数字格式(例如 #,##0.00 / 0.00%),不改变 text。 */
125
- numberFormat?: string;
126
- /** 编辑输入类型;省略时只按原始值推断,数字字符串不会被转换为数值。 */
127
- valueType?: "text" | "number" | "boolean";
128
- /** 单元格级编辑控制;预览仍需显式开启 editing。 */
129
- editable?: boolean;
130
- source?: ReportCellSource;
131
- /** Excel 公式保留元数据;当前引擎不计算公式,公式格始终只读。 */
132
- formula?: string;
133
- children?: PlanComponent[];
134
- colSpan?: number;
135
- rowSpan?: number;
136
- style?: ComponentStyle;
137
- }
138
-
139
- declare type ImageComponentKind = "image" | "chart" | "barcode" | "qrcode";
140
-
141
- /** auto:真实数字/显式数值格式居右,日期与布尔居中,其他内容居左。 */
142
- declare type ListAlignment = NonNullable<ComponentStyle["align"]> | "auto";
143
-
144
- declare interface ListColumn {
145
- header: string;
146
- field: string;
147
- widthMm: number;
148
- style?: ComponentStyle;
149
- /** 内容对齐,优先于 style.align;数值字符串不会自动判为数字。 */
150
- align?: ListAlignment;
151
- /** 独立的表头对齐,不改变内容对齐。 */
152
- headerAlign?: ComponentStyle["align"];
153
- /** 独立的表头样式,优先于列表级表头样式。 */
154
- headerStyle?: ComponentStyle;
155
- /** 值格式化(声明式):千分位/小数位、百分比、日期 pattern */
156
- format?: ColumnFormat;
157
- /** 条件格式规则(声明式,命中合并进单元格样式;如负数红字) */
158
- rules?: StyleRule[];
159
- /** 内容列编辑控制;仍需由预览显式开启 editing,不影响表头/小计只读规则。 */
160
- editable?: boolean;
161
- /** 空值列或特殊数据类型可显式声明编辑输入类型。 */
162
- valueType?: GridCell["valueType"];
163
- /** 字段语义用于 auto 对齐;明确声明编号,避免把数字编号当成度量。 */
164
- semanticRole?: "identifier" | "dimension" | "measure" | "date" | "text";
165
- }
166
-
167
- declare interface ListComponent {
168
- kind: "list";
169
- id?: string;
170
- /** 宽表标记用于连续 Excel;不改变低层列表的列宽和分页算法。 */
171
- layout?: "page" | "wide";
172
- /** 逻辑表名称,供 Excel Sheet 命名;不额外生成标题组件。 */
173
- title?: string;
174
- leftMm: number;
175
- topMm: number;
176
- widthMm: number;
177
- dataset: string;
178
- /** 数据集中稳定业务主键的字段名;省略时编辑仅有计划内坐标。 */
179
- rowKey?: string;
180
- revisionField?: string;
181
- sourceTokenField?: string;
182
- columns: ListColumn[];
183
- fontSizePt?: number;
184
- headerBold?: boolean;
185
- rowHeightMm?: number;
186
- paddingMm?: number;
187
- headerEveryPage?: boolean;
188
- headerBackgroundColor?: string;
189
- /** 内容默认对齐,列配置可覆盖;低层模板缺省仍为 left。 */
190
- align?: ListAlignment;
191
- /** 表头默认对齐,列配置可覆盖。 */
192
- headerAlign?: ComponentStyle["align"];
193
- headerStyle?: ComponentStyle;
194
- /** 可选多行合并表头;列宽按列表物理列对齐,供 Excel 业务模板复用。 */
195
- headerGrid?: PlanGrid;
196
- border?: boolean;
197
- /** 分组小计(组头/组尾小计/组头防孤行) */
198
- groupBy?: ListGroupBy;
199
- /** 末尾总合计行(依赖 groupBy.subtotal 或显式 fields) */
200
- grandTotal?: ListGrandTotal;
201
- }
202
-
203
- declare type ListGrandTotal =
204
- | boolean
205
- | {
206
- label?: string;
207
- style?: ComponentStyle;
208
- /** 合计列(缺省沿用 groupBy.subtotal) */
209
- fields?: string[];
210
- };
211
-
212
- /** 分组小计配置(声明式,见 ListComponent.groupBy) */
213
- declare interface ListGroupBy {
214
- /** 分组字段(值变化即切组) */
215
- field: string;
216
- /** 组头文案模板,{value} 占位(默认 "{value}") */
217
- headerTemplate?: string;
218
- headerStyle?: ComponentStyle;
219
- /** 需要小计的列字段(组尾输出合计行;数值列求和,其余输出首值/留空) */
220
- subtotal?: string[];
221
- subtotalStyle?: ComponentStyle;
222
- subtotalLabel?: string;
223
- /** 组头防孤行(默认 true:页尾放不下"组头+首行"时整体换页) */
224
- keepWithNext?: boolean;
225
- }
226
-
227
- /** defaults 层可配置项(全部可选,均有内置缺省) */
228
- declare interface MachReportDefaults {
229
- showExport?: boolean;
230
- showPrint?: boolean;
231
- showPdfWindow?: boolean;
232
- /** 设置入口默认显示;可在其中按需启用阅读及输出工具。 */
233
- showSettings?: boolean;
234
- toolbar?: MachReportToolbarOptions;
235
- interaction?: ReportInteractionOptions;
236
- preferences?: ReportPreferencesOptions;
237
- /** Prepare optional image/chart/QR/barcode adapters once for preview and all outputs. */
238
- assets?: AssetRenderOptions;
239
- /** 参数面板显隐(有参数定义且未显式关闭时显示;缺省 true) */
240
- showParams?: boolean;
241
- /** 页间距 px */
242
- gapPx?: number;
243
- /** PDF 导出中文字体 URL */
244
- pdfFontUrl?: string;
245
- theme?: Partial<MachReportTheme>;
246
- messages?: Partial<MachReportMessages>;
247
- /** 校验告警等内部日志通道(默认 console;静默传 { warn: () => {}, info: () => {} }) */
248
- logger?: MachReportLogger;
249
- preview?: MachReportPreviewOptions;
250
- /** Excel 出口配置,按字段继承;不配置使用导出器默认值。 */
251
- xlsx?: XlsxRenderOptions;
252
- /** 默认关闭;true 为本地草稿,对象可提供权限、校验和保存回调。 */
253
- editable?: boolean | ReportEditingOptions;
254
- /** 默认关闭;启用后提供导入按钮。ExcelJS 仅在导入时加载。 */
255
- excelImport?: boolean | ExcelImportOptions;
256
- }
257
-
258
- /** 日志通道(默认 console;可注入 noop 静默或上报 collector) */
259
- declare type MachReportLogger = Pick<Console, "warn" | "info">;
260
-
261
- /**
262
- * 配置中心(对齐 mach-table 的 defineMachTableConfig 体验):
263
- * - 应用级:app.use(machReportPlugin, { config: defineMachReportConfig({...}) })
264
- * - 路由级叠加:provideMachReportConfig(overlay)(响应式,就近覆盖)
265
- * - 优先级:组件 props > 路由级叠加 > preset > defaults(props 永远最高)
266
- */
267
-
268
- /** 工具栏与状态文案(默认简体中文;出海场景覆写) */
269
- declare interface MachReportMessages {
270
- title: string;
271
- prevPage: string;
272
- nextPage: string;
273
- /** 页码显示模板,{cur}/{total} 占位 */
274
- pageInfo: string;
275
- fitWidth: string;
276
- exportHtml: string;
277
- exportPdf: string;
278
- exportExcel: string;
279
- exportImage: string;
280
- exportWord: string;
281
- /** 导出进行中提示,{format} 占位 */
282
- exporting: string;
283
- print: string;
284
- pdfWindow: string;
285
- loading: string;
286
- empty: string;
287
- /** @deprecated 未被组件消费,将在下个大版本移除(保留仅为类型兼容) */
288
- errorPrefix: string;
289
- retry: string;
290
- /** 可选新增文案,保留旧完整文案对象兼容。 */
291
- pdfFontUnavailable?: string;
292
- /** 搜索框占位文案 */
293
- searchPlaceholder: string;
294
- /** 搜索命中计数,{cur}/{total} 占位 */
295
- matchInfo: string;
296
- /** 上/下一个命中 */
297
- prevMatch: string;
298
- nextMatch: string;
299
- /** 缩略图侧栏开关 */
300
- thumbnails: string;
301
- /** 参数面板 */
302
- paramsTitle: string;
303
- query: string;
304
- reset: string;
305
- /** 必填缺失提示({label} 占位) */
306
- paramRequired: string;
307
- paramInvalid?: string;
308
- paramPrompt?: string;
309
- paramPromptDescription?: string;
310
- paramSelectPlaceholder?: string;
311
- paramTextPlaceholder?: string;
312
- /** 可选搜索进度文案,旧完整 messages 对象无需新增字段。 */
313
- searching?: string;
314
- importExcel?: string;
315
- importing?: string;
316
- editCell?: string;
317
- editingHint?: string;
318
- saving?: string;
319
- editInvalidNumber?: string;
320
- editInvalidBoolean?: string;
321
- editConflict?: string;
322
- settings?: string;
323
- settingsDisplay?: string;
324
- settingsExport?: string;
325
- settingsData?: string;
326
- settingsUnavailable?: string;
327
- settingsReset?: string;
328
- settingsClose?: string;
329
- search?: string;
330
- closeSearch?: string;
331
- prevSearchMatch?: string;
332
- nextSearchMatch?: string;
333
- zoom?: string;
334
- settingsLocal?: string;
335
- editingLocal?: string;
336
- editingSaved?: string;
337
- importLocal?: string;
338
- emptyDescription?: string;
339
- undo?: string;
340
- redo?: string;
341
- restoreChanges?: string;
342
- changes?: string;
343
- changesCount?: string;
344
- changesEmpty?: string;
345
- changesBefore?: string;
346
- changesAfter?: string;
347
- editAtomicRequired?: string;
348
- clipboardLimit?: string;
349
- preferencesError?: string;
350
- freezeHeaders?: string;
351
- frozenColumns?: string;
352
- sections?: string;
353
- locateField?: string;
354
- locateFieldPlaceholder?: string;
355
- locateFieldMissing?: string;
356
- importSummary?: string;
357
- importPreserved?: string;
358
- importWarnings?: string;
359
- importReadOnly?: string;
360
- conflicts?: string;
361
- editReadOnly?: string;
362
- editMissing?: string;
363
- editDuplicate?: string;
364
- clipboardInvalid?: string;
365
- editSaved?: string;
366
- settingsPanes?: string;
367
- }
368
-
369
- /** 预览按需调优;默认已经启用正文/缩略图虚拟化及可取消的分片搜索。 */
370
- declare interface MachReportPreviewOptions {
371
- /** 视口前后额外保留的正文页数,默认 1,归一化到 0~10 的整数。 */
372
- overscanPages?: number;
373
- /** 搜索输入防抖毫秒,默认 200,归一化到 0~2000。 */
374
- searchDebounceMs?: number;
375
- }
376
-
377
- /** 主题变量(组件外壳注入的 --mrp-* CSS 自定义属性) */
378
- declare interface MachReportTheme {
379
- shellBg: string;
380
- shellFg: string;
381
- toolbarBg: string;
382
- toolbarBorder: string;
383
- toolbarFg: string;
384
- btnFg: string;
385
- btnBorder: string;
386
- btnHoverBg: string;
387
- btnHoverFg: string;
388
- btnActiveBg: string;
389
- }
390
-
391
- declare interface MachReportToolbarOptions {
392
- search?: boolean;
393
- thumbnails?: boolean;
394
- zoom?: boolean;
395
- /** 编辑能力由 editable 授权;此项仅设置初始交互偏好,默认 true(兼容旧行为)。 */
396
- editing?: boolean;
397
- /** 导入能力由 excelImport 授权;此项仅设置初始交互偏好,默认 true。 */
398
- excelImport?: boolean;
399
- /** 未传时显示全部已有出口;空数组表示不提供导出工具。 */
400
- exportFormats?: ReportExportFormat[];
401
- }
402
-
403
- declare interface OutputDiagnostic {
404
- code: "missing-image" | "unsupported-component" | "unsupported-image-format" | "rich-text-flattened" | "nested-components-omitted" | "async-image-required" | "image-decode-failed" | "asset-render-failed" | "asset-budget-exceeded";
405
- severity: "warning";
406
- format: OutputFormat;
407
- pageIndex: number;
408
- componentIndex: number;
409
- /** Nested grid child location as repeating [rowIndex, columnIndex, childIndex] triples. */
410
- componentPath?: readonly number[];
411
- kind: string;
412
- nid?: string;
413
- message: string;
414
- }
415
-
416
- declare interface OutputDiagnosticOptions {
417
- /** Structured fidelity diagnostics; rendering never silently invents missing content. */
418
- onDiagnostic?: (diagnostic: OutputDiagnostic) => void;
419
- }
420
-
421
- declare type OutputFormat = "dom" | "canvas" | "pdf" | "xlsx";
422
-
423
- declare interface PlanComponent {
424
- kind: ComponentKind;
425
- leftMm: number;
426
- topMm: number;
427
- widthMm: number;
428
- heightMm: number;
429
- nid?: string;
430
- rkey?: string;
431
- text?: string;
432
- rawText?: string;
433
- lines?: string[];
434
- richParagraphs?: RichParagraph[];
435
- imageData?: string;
436
- /** 明确指定线段方向;省略保持历史水平线行为。 */
437
- lineDirection?: "down" | "up";
438
- grid?: PlanGrid;
439
- table?: PlanTableFragment;
440
- style?: ComponentStyle;
441
- meta?: Record<string, unknown>;
442
- /** MachReport 扩展字段:未知 kind 的兜底渲染标记 */
443
- fallbackText?: string;
444
- }
445
-
446
- declare interface PlanGrid {
447
- /** 行内允许 null 空位;渲染器按空单元格处理 */
448
- cells: (GridCell | null)[][];
449
- colWidthsMm?: number[];
450
- rowHeightsMm?: number[];
451
- gapMm?: number;
452
- /** 单元格四边内距;旧静态网格默认 0.5mm,分页列表使用其真实测量内距。 */
453
- paddingMm?: number;
454
- }
455
-
456
- /** 列表的逻辑行来源;用于连续 Excel 重组,避免按文本猜测重复表头。 */
457
- declare interface PlanTableFragment {
458
- /** 在整个计划中唯一的逻辑表身份;同一表的分页片段共享身份。 */
459
- id: string;
460
- /** 表头固定 -1;其余行(包括组头/小计/总计)从 0 连续递增。 */
461
- rowIndex: number;
462
- role: "header" | "body" | "group-header" | "subtotal" | "grand-total";
463
- /** 按物理列顺序保存字段身份;不以表头显示文本判断列结构。 */
464
- columnKeys: string[];
465
- layout?: "page" | "wide";
466
- title?: string;
467
- /** 只有宿主声明稳定 rowKey 时生成,不能用显示顺序替代业务主键。 */
468
- source?: Omit<ReportCellSource, "field" | "rowKey"> & { rowKey?: string | number };
469
- }
470
-
471
- /** 预览中的物理坐标;合并单元格使用左上角坐标。 */
472
- declare interface ReportCellAddress {
473
- pageIndex: number;
474
- componentIndex: number;
475
- rowIndex: number;
476
- columnIndex: number;
477
- }
478
-
479
- declare interface ReportCellContext {
480
- address: ReportCellAddress;
481
- cell: Readonly<GridCell>;
482
- component: Readonly<PlanComponent>;
483
- value: ReportCellValue;
484
- valueType: ReportCellValueType;
485
- table?: ReportCellTableIdentity;
486
- /** Stable business identity. Physical row indices must never be used as database keys. */
487
- source?: Readonly<ReportCellSource>;
488
- editable: boolean;
489
- readOnlyReason?: ReportCellReadOnlyReason;
490
- }
491
-
492
- declare interface ReportCellEdit {
493
- address: ReportCellAddress;
494
- table?: ReportCellTableIdentity;
495
- source?: Readonly<ReportCellSource>;
496
- previousValue: ReportCellValue;
497
- previousText: string;
498
- value: ReportCellValue;
499
- text: string;
500
- }
501
-
502
- declare type ReportCellReadOnlyReason = "cell" | "formula" | "complex" | "structure";
503
-
504
- /** 可持久化的业务身份与计划坐标独立;权限及并发校验仍由业务服务器执行。 */
505
- declare interface ReportCellSource {
506
- datasetId: string;
507
- rowKey: string | number;
508
- field: string;
509
- revision?: string | number;
510
- sourceToken?: string;
511
- }
512
-
513
- declare interface ReportCellTableIdentity {
514
- id: string;
515
- /** 逻辑表行索引;跨分页的同一行保持不变。 */
516
- rowIndex: number;
517
- role: PlanTableFragment["role"];
518
- columnKey?: string;
519
- }
520
-
521
- declare type ReportCellValue = string | number | boolean | null;
522
-
523
- declare type ReportCellValueType = NonNullable<GridCell["valueType"]>;
524
-
525
- declare interface ReportEditBatch {
526
- /** Idempotency identity; the server should bind it to the exact payload. */
527
- requestId: string;
528
- edits: ReportCellEdit[];
529
- }
530
-
531
- declare interface ReportEditConflict {
532
- source?: Readonly<ReportCellSource>;
533
- address?: ReportCellAddress;
534
- message: string;
535
- currentValue?: ReportCellValue;
536
- revision?: string | number;
537
- }
538
-
539
- /** Opt in with true for local drafts, or provide host validation and persistence. */
540
- declare interface ReportEditingOptions {
541
- canEdit?(context: ReportCellContext): boolean;
542
- /** Return an error message or throw to reject the edit. */
543
- validate?(edit: Readonly<ReportCellEdit>, operation: ReportEditOperation): void | string | Promise<void | string>;
544
- /** Called before applying the change. A rejection leaves the current report untouched. */
545
- save?(edit: Readonly<ReportCellEdit>, operation: ReportEditOperation): void | ReportEditResult | Promise<void | ReportEditResult>;
546
- /** Must commit all edits in one server transaction. Required for multi-cell persisted edits. */
547
- saveBatch?(batch: Readonly<ReportEditBatch>, operation: ReportEditOperation): void | ReportEditResult | Promise<void | ReportEditResult>;
548
- /** Restrict persistence to plans that supply stable datasetId/rowKey/field metadata. */
549
- requireSource?: boolean;
550
- }
551
-
552
- declare interface ReportEditOperation {
553
- /** Reload, another import or unmount aborts the operation. Save adapters should forward this signal. */
554
- signal: AbortSignal;
555
- requestId?: string;
556
- action?: "edit" | "undo" | "redo" | "restore";
557
- }
558
-
559
- declare interface ReportEditResult {
560
- /** A successful result may advance concurrency tokens for the affected dataset. */
561
- revision?: string | number;
562
- sourceToken?: string;
563
- /** Any conflict rejects the entire client batch. A server must also transact atomically. */
564
- conflicts?: readonly ReportEditConflict[];
565
- }
566
-
567
- /** 输出能力仍由宿主授权;工具偏好只决定当前预览实例的可见与启用状态。 */
568
- declare type ReportExportFormat = "html" | "pdf" | "xlsx" | "png" | "word";
569
-
570
- declare interface ReportInteractionOptions {
571
- /** Screen-only frozen panes; exported geometry is unchanged. */
572
- freezeHeaders?: boolean;
573
- /** Leading identity columns, from 0 to 20. */
574
- frozenColumns?: number;
575
- /** Show workbook sheets / report sections when available. Default true. */
576
- navigation?: boolean;
577
- }
578
-
579
- /** 报表参数定义(声明式,模板自描述参数面:渲染组件据此生成查询面板) */
580
- declare interface ReportParamDef {
581
- /** 参数名(传入 params,与数据集 SQL #{field} 绑定对应) */
582
- field: string;
583
- /** 显示名(缺省用 field) */
584
- label?: string;
585
- type?: "text" | "number" | "date" | "select";
586
- /** select 选项 */
587
- options?: Array<{ label: string; value: string }>;
588
- defaultValue?: string;
589
- required?: boolean;
590
- placeholder?: string;
591
- /** 数字上下界;date 参数使用 YYYY-MM-DD 字符串(含边界)。 */
592
- min?: number | string;
593
- max?: number | string;
594
- minLength?: number;
595
- maxLength?: number;
596
- }
597
-
598
- declare interface ReportPreferencesAdapter {
599
- load(key: string): Partial<ReportPreviewPreferences> | null | Promise<Partial<ReportPreviewPreferences> | null>;
600
- save(key: string, value: Readonly<Partial<ReportPreviewPreferences>>): void | Promise<void>;
601
- remove?(key: string): void | Promise<void>;
602
- }
603
-
604
- declare interface ReportPreferencesOptions {
605
- /** Host-scoped key; do not share one key between unrelated users/tenants. */
606
- key: string;
607
- adapter: ReportPreferencesAdapter;
608
- }
609
-
610
- declare type ReportPreviewPreferences = Record<ReportPreviewTool, boolean>;
611
-
612
- declare type ReportPreviewTool = "search" | "thumbnails" | "zoom" | ReportExportFormat | "print" | "pdfWindow" | "editing" | "import";
613
-
614
- declare interface ReportTemplate {
615
- schemaVersion?: string;
616
- /** 参数定义(可选;宿主也可经 ReportPreview 的 paramDefs prop 提供,prop 优先) */
617
- params?: ReportParamDef[];
618
- pages: TemplatePage[];
619
- }
620
-
621
- /** 可存入数据库/文件的纯 JSON 模板;数据、接口与鉴权仍由宿主提供。 */
622
- declare interface ReportTemplateDocument {
623
- schemaVersion: "1.0";
624
- id: string;
625
- name: string;
626
- /** 宿主的发布版本/乐观锁标识,不由引擎自动递增。 */
627
- revision?: string;
628
- description?: string;
629
- template: ReportTemplate;
630
- }
631
-
632
- export declare const ReportTemplateEditor: DefineComponent<TemplateEditorOptions, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
633
- "update:modelValue": (document: ReportTemplateDocument) => any;
634
- saved: (document: ReportTemplateDocument) => any;
635
- }, string, PublicProps, Readonly<TemplateEditorOptions> & Readonly<{
636
- "onUpdate:modelValue"?: ((document: ReportTemplateDocument) => any) | undefined;
637
- onSaved?: ((document: ReportTemplateDocument) => any) | undefined;
638
- }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLElement>;
639
-
640
- declare interface RichParagraph {
641
- segments: RichSegment[];
642
- align?: ComponentStyle["align"];
643
- lineHeight?: number;
644
- spaceBeforeMm?: number;
645
- spaceAfterMm?: number;
646
- indentMm?: number;
647
- }
648
-
649
- declare interface RichSegment {
650
- kind?: "text" | "field";
651
- text?: string;
652
- field?: string;
653
- style?: ComponentStyle;
654
- }
655
-
656
- /** 条件格式规则求值(声明式,见 ListColumn.rules) */
657
- declare interface StyleRule {
658
- when: {
659
- field: string;
660
- op: ">" | ">=" | "<" | "<=" | "==" | "!=";
661
- value: number | string;
662
- };
663
- /** 命中时合并进单元格样式(color/bold/backgroundColor 等) */
664
- style: Record<string, unknown>;
665
- }
666
-
667
- /** 可选设计器独立文案,不把其依赖和配置强加给预览消费者。 */
668
- export declare const TEMPLATE_EDITOR_MESSAGES: {
669
- title: string;
670
- heading: string;
671
- unpublished: string;
672
- dirty: string;
673
- reset: string;
674
- saving: string;
675
- save: string;
676
- name: string;
677
- description: string;
678
- area: string;
679
- page: string;
680
- header: string;
681
- field: string;
682
- width: string;
683
- semantic: string;
684
- identifier: string;
685
- dimension: string;
686
- measure: string;
687
- date: string;
688
- text: string;
689
- bodyAlign: string;
690
- headerAlign: string;
691
- auto: string;
692
- left: string;
693
- center: string;
694
- right: string;
695
- justify: string;
696
- editable: string;
697
- json: string;
698
- applyJson: string;
699
- note: string;
700
- invalid: string;
701
- };
702
-
703
- declare type TemplateComponent = PlanComponent | ListComponent;
704
-
705
- export declare type TemplateEditorMessages = typeof TEMPLATE_EDITOR_MESSAGES;
706
-
707
- export declare interface TemplateEditorOptions {
708
- modelValue: ReportTemplateDocument;
709
- datasets?: DatasetRows;
710
- readonly?: boolean;
711
- messages?: Partial<TemplateEditorMessages>;
712
- preview?: Pick<MachReportDefaults, "showExport" | "showPrint" | "showPdfWindow" | "theme" | "assets" | "pdfFontUrl" | "toolbar">;
713
- save?: (document: ReportTemplateDocument, context: TemplateEditorSaveContext) => Promise<ReportTemplateDocument>;
714
- }
715
-
716
- export declare interface TemplateEditorSaveContext {
717
- expectedRevision?: string;
718
- signal: AbortSignal;
719
- }
720
-
721
- declare interface TemplatePage {
722
- widthMm: number;
723
- heightMm: number;
724
- /** 宽表保持全列自然宽度,页高只控制内部纵向分段。 */
725
- layout?: "page" | "wide";
726
- marginTopMm?: number;
727
- marginBottomMm?: number;
728
- marginLeftMm?: number;
729
- marginRightMm?: number;
730
- components: TemplateComponent[];
731
- }
732
-
733
- /**
734
- * RenderPlan → xlsx 导出(B 端第二出口,对齐家族 @agile-team/mach-table-xlsx 路线):
735
- * - 网格组件 → 真表格:列宽(mm→Excel 宽度)、行高(mm→pt)、colSpan/rowSpan 合并、
736
- * 加粗/对齐/底色/字号直译(resolveGridLayout 复用单真相源几何)
737
- * - 文本组件 → 合并标题行(顺序流式输出,保字号/加粗/对齐;非像素级定位,
738
- * 目标是"财务能直接用的对账表"而非复刻版面)
739
- * - 未支持组件、富文本专有内容与单元格嵌套组件跳过并计入 warnings
740
- */
741
-
742
- declare interface XlsxRenderOptions extends OutputDiagnosticOptions {
743
- /** 工作表命名(连续表默认使用标题,其余默认 "Sheet1" 起序)。 */
744
- sheetName?: (sheetIndex: number) => string;
745
- /** auto 默认将 wide 逻辑表合并为连续 Sheet;pages 保留逐页;continuous 要求明确的表来源。 */
746
- sheetMode?: "auto" | "pages" | "continuous";
747
- /** 宽表或连续表默认 raw,其余默认 text;显式配置可覆盖默认值。 */
748
- valueMode?: "text" | "raw";
749
- /** 连续表默认不限制打印纸型;显式 A3/A4/A5 仅设置打印适配,不改变 Excel 列宽。 */
750
- paperSize?: "auto" | "a3" | "a4" | "a5";
751
- }
752
-
753
- export { }
1
+ import { ComponentOptionsMixin } from 'vue';
2
+ import { DefineComponent } from 'vue';
3
+ declare interface AssetRenderBudget {
4
+ /** Maximum newly rendered assets, default 1000. Existing imageData is kept unchanged. */
5
+ maxAssets?: number;
6
+ /** Maximum image payload bytes per new asset, default 32 MiB. */
7
+ maxImageBytes?: number;
8
+ /** Maximum total image payload bytes for new assets, default 128 MiB. */
9
+ maxTotalImageBytes?: number;
10
+ /** Wall-clock budget, including adapters that ignore AbortSignal. Default 30 seconds. */
11
+ maxDurationMs?: number;
12
+ }
13
+ declare interface AssetRenderOptions extends OutputDiagnosticOptions {
14
+ assetRenderers?: Partial<Record<ImageComponentKind, ComponentImageRenderer>>;
15
+ assetBudget?: AssetRenderBudget;
16
+ /** Default throw prevents an incomplete export; placeholder retains the component and emits diagnostics. */
17
+ assetFailure?: "throw" | "placeholder";
18
+ signal?: AbortSignal;
19
+ }
20
+ /** 可选设计器独立文案,不把其依赖和配置强加给预览消费者。 */
21
+ declare const BASE_TEMPLATE_EDITOR_MESSAGES: {
22
+ title: string;
23
+ heading: string;
24
+ unpublished: string;
25
+ dirty: string;
26
+ reset: string;
27
+ saving: string;
28
+ save: string;
29
+ name: string;
30
+ description: string;
31
+ area: string;
32
+ page: string;
33
+ header: string;
34
+ field: string;
35
+ width: string;
36
+ semantic: string;
37
+ identifier: string;
38
+ dimension: string;
39
+ measure: string;
40
+ date: string;
41
+ text: string;
42
+ bodyAlign: string;
43
+ headerAlign: string;
44
+ auto: string;
45
+ left: string;
46
+ center: string;
47
+ right: string;
48
+ justify: string;
49
+ editable: string;
50
+ json: string;
51
+ applyJson: string;
52
+ note: string;
53
+ invalid: string;
54
+ };
55
+ /**
56
+ * 列值格式化(声明式、JSON 可序列化)。
57
+ * 在 paginate 的 cellText 出口统一消费:格式化发生在进 RenderPlan 之前,
58
+ * 三后端(DOM/Canvas/PDF)零改动。
59
+ *
60
+ * 语义约定(v0.9 固化):
61
+ * - number.digits 显式给出 → 精确保留(12.5 + digits:2 → "12.50")
62
+ * - number.thousands 默认 false(千分位显式开启)
63
+ * - date 字符串按"本地时区的日历日"解析(YYYY-MM-DD / YYYY/MM/DD 直取年月日,
64
+ * 不经 Date 字符串构造——后者按 UTC 零点,负时区环境会少一天)
65
+ */
66
+ declare type ColumnFormat = {
67
+ kind: "number";
68
+ thousands?: boolean;
69
+ digits?: number;
70
+ } | {
71
+ kind: "percent";
72
+ digits?: number;
73
+ } | {
74
+ kind: "date";
75
+ pattern?: string;
76
+ };
77
+ declare interface ComponentImageContext {
78
+ readonly component: Readonly<PlanComponent>;
79
+ readonly pageIndex: number;
80
+ readonly componentIndex: number;
81
+ readonly componentPath: readonly number[];
82
+ readonly signal: AbortSignal;
83
+ }
84
+ declare type ComponentImageRenderer = (context: ComponentImageContext) => string | Promise<string>;
85
+ declare type ComponentKind = "text" | "image" | "barcode" | "qrcode" | "chart" | "line" | "rect" | "ellipse";
86
+ declare interface ComponentStyle {
87
+ fontSizePx?: number;
88
+ fontSize?: number;
89
+ fontFamily?: string;
90
+ bold?: boolean;
91
+ italic?: boolean;
92
+ underline?: boolean;
93
+ color?: string;
94
+ backgroundColor?: string;
95
+ align?: "left" | "center" | "right" | "justify";
96
+ verticalAlign?: "top" | "middle" | "bottom";
97
+ lineColor?: string;
98
+ borderColor?: string;
99
+ lineWidthPt?: number;
100
+ borderTop?: boolean;
101
+ borderRight?: boolean;
102
+ borderBottom?: boolean;
103
+ borderLeft?: boolean;
104
+ lineHeight?: number;
105
+ letterSpacing?: number;
106
+ opacity?: number;
107
+ rotateDeg?: number;
108
+ }
109
+ declare type DatasetRows = Record<string, Record<string, unknown>[]>;
110
+ /** Limits apply to the selected rectangular ranges, including their empty cells. */
111
+ declare interface ExcelImportLimits {
112
+ /** Compressed input, default 20 MiB. */
113
+ maxFileBytes?: number;
114
+ /** Declared ZIP uncompressed total, default 64 MiB. */
115
+ maxUncompressedBytes?: number;
116
+ /** Total selected cells across sheets, default 250,000; hard ceiling 1,000,000. */
117
+ maxCells?: number;
118
+ /** Rows per selected sheet, default 100,000; hard ceiling 1,048,576. */
119
+ maxRows?: number;
120
+ /** Columns per selected sheet, default 2,048; hard ceiling 16,384. */
121
+ maxColumns?: number;
122
+ /** Workbook sheets, default 32. */
123
+ maxSheets?: number;
124
+ }
125
+ declare interface ExcelImportOptions extends OutputTaskOptions {
126
+ /** Sheet names or one-based workbook positions. Default: all visible sheets. */
127
+ sheets?: Array<string | number>;
128
+ /** A1 range for every sheet, or ranges keyed by exact sheet name. */
129
+ range?: string | Record<string, string>;
130
+ /** Wide preserves natural column widths. A3/A4 scale the complete width to paper. */
131
+ layout?: "wide" | "a3" | "a4";
132
+ /** Only applies to A3/A4; default landscape. */
133
+ landscape?: boolean;
134
+ /** Vertical preview segment limit, default 80, maximum 200. Merges remain intact. */
135
+ maxRowsPerPage?: number;
136
+ /** Optional resource limits; hard ceilings prevent unbounded allocations. */
137
+ limits?: ExcelImportLimits;
138
+ }
139
+ declare interface GridCell {
140
+ text?: string;
141
+ rawText?: string;
142
+ /** 原始值,仅供 Excel raw 模式消费;不参与预览、分页与 PDF 绘制。 */
143
+ value?: string | number | boolean | null;
144
+ /** Excel 数字格式(例如 #,##0.00 / 0.00%),不改变 text。 */
145
+ numberFormat?: string;
146
+ /** 编辑输入类型;省略时只按原始值推断,数字字符串不会被转换为数值。 */
147
+ valueType?: "text" | "number" | "boolean";
148
+ /** 单元格级编辑控制;预览仍需显式开启 editing。 */
149
+ editable?: boolean;
150
+ source?: ReportCellSource;
151
+ /** Excel 公式保留元数据;当前引擎不计算公式,公式格始终只读。 */
152
+ formula?: string;
153
+ children?: PlanComponent[];
154
+ colSpan?: number;
155
+ rowSpan?: number;
156
+ style?: ComponentStyle;
157
+ }
158
+ declare type ImageComponentKind = "image" | "chart" | "barcode" | "qrcode";
159
+ /** auto:真实数字/显式数值格式居右,日期与布尔居中,其他内容居左。 */
160
+ declare type ListAlignment = NonNullable<ComponentStyle["align"]> | "auto";
161
+ declare interface ListColumn {
162
+ header: string;
163
+ field: string;
164
+ widthMm: number;
165
+ style?: ComponentStyle;
166
+ /** 内容对齐,优先于 style.align;数值字符串不会自动判为数字。 */
167
+ align?: ListAlignment;
168
+ /** 独立的表头对齐,不改变内容对齐。 */
169
+ headerAlign?: ComponentStyle["align"];
170
+ /** 独立的表头样式,优先于列表级表头样式。 */
171
+ headerStyle?: ComponentStyle;
172
+ /** 值格式化(声明式):千分位/小数位、百分比、日期 pattern */
173
+ format?: ColumnFormat;
174
+ /** 条件格式规则(声明式,命中合并进单元格样式;如负数红字) */
175
+ rules?: StyleRule[];
176
+ /** 内容列编辑控制;仍需由预览显式开启 editing,不影响表头/小计只读规则。 */
177
+ editable?: boolean;
178
+ /** 空值列或特殊数据类型可显式声明编辑输入类型。 */
179
+ valueType?: GridCell["valueType"];
180
+ /** 字段语义用于 auto 对齐;明确声明编号,避免把数字编号当成度量。 */
181
+ semanticRole?: "identifier" | "dimension" | "measure" | "date" | "text";
182
+ }
183
+ declare interface ListComponent {
184
+ kind: "list";
185
+ id?: string;
186
+ /** 宽表标记用于连续 Excel;不改变低层列表的列宽和分页算法。 */
187
+ layout?: "page" | "wide";
188
+ /** 逻辑表名称,供 Excel Sheet 命名;不额外生成标题组件。 */
189
+ title?: string;
190
+ leftMm: number;
191
+ topMm: number;
192
+ widthMm: number;
193
+ dataset: string;
194
+ /** 数据集中稳定业务主键的字段名;省略时编辑仅有计划内坐标。 */
195
+ rowKey?: string;
196
+ revisionField?: string;
197
+ sourceTokenField?: string;
198
+ columns: ListColumn[];
199
+ fontSizePt?: number;
200
+ headerBold?: boolean;
201
+ rowHeightMm?: number;
202
+ paddingMm?: number;
203
+ headerEveryPage?: boolean;
204
+ headerBackgroundColor?: string;
205
+ /** 内容默认对齐,列配置可覆盖;低层模板缺省仍为 left。 */
206
+ align?: ListAlignment;
207
+ /** 表头默认对齐,列配置可覆盖。 */
208
+ headerAlign?: ComponentStyle["align"];
209
+ headerStyle?: ComponentStyle;
210
+ /** 可选多行合并表头;列宽按列表物理列对齐,供 Excel 业务模板复用。 */
211
+ headerGrid?: PlanGrid;
212
+ border?: boolean;
213
+ /** 分组小计(组头/组尾小计/组头防孤行) */
214
+ groupBy?: ListGroupBy;
215
+ /** 末尾总合计行(依赖 groupBy.subtotal 或显式 fields) */
216
+ grandTotal?: ListGrandTotal;
217
+ }
218
+ declare type ListGrandTotal = boolean | {
219
+ label?: string;
220
+ style?: ComponentStyle;
221
+ /** 合计列(缺省沿用 groupBy.subtotal) */
222
+ fields?: string[];
223
+ };
224
+ /** 分组小计配置(声明式,见 ListComponent.groupBy) */
225
+ declare interface ListGroupBy {
226
+ /** 分组字段(值变化即切组) */
227
+ field: string;
228
+ /** 组头文案模板,{value} 占位(默认 "{value}") */
229
+ headerTemplate?: string;
230
+ headerStyle?: ComponentStyle;
231
+ /** 需要小计的列字段(组尾输出合计行;数值列求和,其余输出首值/留空) */
232
+ subtotal?: string[];
233
+ subtotalStyle?: ComponentStyle;
234
+ subtotalLabel?: string;
235
+ /** 组头防孤行(默认 true:页尾放不下"组头+首行"时整体换页) */
236
+ keepWithNext?: boolean;
237
+ }
238
+ /** defaults 层可配置项(全部可选,均有内置缺省) */
239
+ declare interface MachReportDefaults {
240
+ showExport?: boolean;
241
+ showPrint?: boolean;
242
+ showPdfWindow?: boolean;
243
+ /** 设置入口默认显示;可在其中按需启用阅读及输出工具。 */
244
+ showSettings?: boolean;
245
+ toolbar?: MachReportToolbarOptions;
246
+ interaction?: ReportInteractionOptions;
247
+ preferences?: ReportPreferencesOptions;
248
+ /** Protect local input and drafts before replacing a report. Default true. */
249
+ guardChanges?: boolean;
250
+ beforeDiscard?: ReportBeforeDiscard;
251
+ output?: ReportOutputOptions;
252
+ /** Prepare optional image/chart/QR/barcode adapters once for preview and all outputs. */
253
+ assets?: AssetRenderOptions;
254
+ /** 参数面板显隐(有参数定义且未显式关闭时显示;缺省 true) */
255
+ showParams?: boolean;
256
+ /** 页间距 px */
257
+ gapPx?: number;
258
+ /** PDF 导出中文字体 URL */
259
+ pdfFontUrl?: string;
260
+ theme?: Partial<MachReportTheme>;
261
+ messages?: Partial<MachReportMessages>;
262
+ /** 校验告警等内部日志通道(默认 console;静默传 { warn: () => {}, info: () => {} }) */
263
+ logger?: MachReportLogger;
264
+ preview?: MachReportPreviewOptions;
265
+ /** Excel 出口配置,按字段继承;不配置使用导出器默认值。 */
266
+ xlsx?: XlsxRenderOptions;
267
+ /** 默认关闭;true 为本地草稿,对象可提供权限、校验和保存回调。 */
268
+ editable?: boolean | ReportEditingOptions;
269
+ /** 默认关闭;启用后提供导入按钮。ExcelJS 仅在导入时加载。 */
270
+ excelImport?: boolean | ExcelImportOptions;
271
+ }
272
+ /** 日志通道(默认 console;可注入 noop 静默或上报 collector) */
273
+ declare type MachReportLogger = Pick<Console, "warn" | "info">;
274
+ /**
275
+ * 配置中心(对齐 mach-table 的 defineMachTableConfig 体验):
276
+ * - 应用级:app.use(machReportPlugin, { config: defineMachReportConfig({...}) })
277
+ * - 路由级叠加:provideMachReportConfig(overlay)(响应式,就近覆盖)
278
+ * - 优先级:组件 props > 路由级叠加 > preset > defaults(props 永远最高)
279
+ */
280
+ /** 工具栏与状态文案(默认简体中文;出海场景覆写) */
281
+ declare interface MachReportMessages {
282
+ title: string;
283
+ prevPage: string;
284
+ nextPage: string;
285
+ /** 页码显示模板,{cur}/{total} 占位 */
286
+ pageInfo: string;
287
+ fitWidth: string;
288
+ exportHtml: string;
289
+ exportPdf: string;
290
+ exportExcel: string;
291
+ exportImage: string;
292
+ exportWord: string;
293
+ /** 导出进行中提示,{format} 占位 */
294
+ exporting: string;
295
+ print: string;
296
+ pdfWindow: string;
297
+ loading: string;
298
+ empty: string;
299
+ /** @deprecated 未被组件消费,将在下个大版本移除(保留仅为类型兼容) */
300
+ errorPrefix: string;
301
+ retry: string;
302
+ /** 可选新增文案,保留旧完整文案对象兼容。 */
303
+ pdfFontUnavailable?: string;
304
+ /** 搜索框占位文案 */
305
+ searchPlaceholder: string;
306
+ /** 搜索命中计数,{cur}/{total} 占位 */
307
+ matchInfo: string;
308
+ /** 上/下一个命中 */
309
+ prevMatch: string;
310
+ nextMatch: string;
311
+ /** 缩略图侧栏开关 */
312
+ thumbnails: string;
313
+ /** 参数面板 */
314
+ paramsTitle: string;
315
+ query: string;
316
+ reset: string;
317
+ /** 必填缺失提示({label} 占位) */
318
+ paramRequired: string;
319
+ paramInvalid?: string;
320
+ paramPrompt?: string;
321
+ paramPromptDescription?: string;
322
+ paramSelectPlaceholder?: string;
323
+ paramTextPlaceholder?: string;
324
+ /** 可选搜索进度文案,旧完整 messages 对象无需新增字段。 */
325
+ searching?: string;
326
+ importExcel?: string;
327
+ importing?: string;
328
+ editCell?: string;
329
+ editingHint?: string;
330
+ saving?: string;
331
+ editInvalidNumber?: string;
332
+ editInvalidBoolean?: string;
333
+ editConflict?: string;
334
+ settings?: string;
335
+ settingsDisplay?: string;
336
+ settingsExport?: string;
337
+ settingsData?: string;
338
+ settingsUnavailable?: string;
339
+ settingsReset?: string;
340
+ settingsClose?: string;
341
+ search?: string;
342
+ closeSearch?: string;
343
+ prevSearchMatch?: string;
344
+ nextSearchMatch?: string;
345
+ zoom?: string;
346
+ settingsLocal?: string;
347
+ editingLocal?: string;
348
+ editingSaved?: string;
349
+ importLocal?: string;
350
+ emptyDescription?: string;
351
+ undo?: string;
352
+ redo?: string;
353
+ restoreChanges?: string;
354
+ changes?: string;
355
+ changesCount?: string;
356
+ changesEmpty?: string;
357
+ changesBefore?: string;
358
+ changesAfter?: string;
359
+ editAtomicRequired?: string;
360
+ clipboardLimit?: string;
361
+ preferencesError?: string;
362
+ freezeHeaders?: string;
363
+ frozenColumns?: string;
364
+ sections?: string;
365
+ locateField?: string;
366
+ locateFieldPlaceholder?: string;
367
+ locateFieldMissing?: string;
368
+ importSummary?: string;
369
+ importPreserved?: string;
370
+ importWarnings?: string;
371
+ importReadOnly?: string;
372
+ conflicts?: string;
373
+ editReadOnly?: string;
374
+ editMissing?: string;
375
+ editDuplicate?: string;
376
+ clipboardInvalid?: string;
377
+ editSaved?: string;
378
+ settingsPanes?: string;
379
+ columnDirectory?: string;
380
+ columnSearch?: string;
381
+ columnNoMatches?: string;
382
+ columnResults?: string;
383
+ columnGroup?: string;
384
+ discardTitle?: string;
385
+ discardDescription?: string;
386
+ discardKeep?: string;
387
+ discardProceed?: string;
388
+ taskQuery?: string;
389
+ taskValidate?: string;
390
+ taskLayout?: string;
391
+ taskAssets?: string;
392
+ taskEncode?: string;
393
+ taskDownload?: string;
394
+ taskPrint?: string;
395
+ taskCancel?: string;
396
+ taskCancelled?: string;
397
+ diagnosticsTitle?: string;
398
+ diagnosticsSearch?: string;
399
+ diagnosticsMore?: string;
400
+ diagnosticsLocate?: string;
401
+ diagnosticsLocation?: string;
402
+ diagnosticsStrict?: string;
403
+ diagnosticsDetails?: string;
404
+ diagnosticMissingImage?: string;
405
+ diagnosticUnsupported?: string;
406
+ diagnosticUnsupportedStyle?: string;
407
+ diagnosticImageFormat?: string;
408
+ diagnosticRichText?: string;
409
+ diagnosticNested?: string;
410
+ diagnosticImageAsync?: string;
411
+ diagnosticImageDecode?: string;
412
+ diagnosticAssetFailed?: string;
413
+ diagnosticAssetBudget?: string;
414
+ }
415
+ /** 预览按需调优;默认已经启用正文/缩略图虚拟化及可取消的分片搜索。 */
416
+ declare interface MachReportPreviewOptions {
417
+ /** 视口前后额外保留的正文页数,默认 1,归一化到 0~10 的整数。 */
418
+ overscanPages?: number;
419
+ /** 搜索输入防抖毫秒,默认 200,归一化到 0~2000。 */
420
+ searchDebounceMs?: number;
421
+ }
422
+ /** 主题变量(组件外壳注入的 --mrp-* CSS 自定义属性) */
423
+ declare interface MachReportTheme {
424
+ shellBg: string;
425
+ shellFg: string;
426
+ toolbarBg: string;
427
+ toolbarBorder: string;
428
+ toolbarFg: string;
429
+ btnFg: string;
430
+ btnBorder: string;
431
+ btnHoverBg: string;
432
+ btnHoverFg: string;
433
+ btnActiveBg: string;
434
+ }
435
+ declare interface MachReportToolbarOptions {
436
+ search?: boolean;
437
+ thumbnails?: boolean;
438
+ zoom?: boolean;
439
+ /** 编辑能力由 editable 授权;此项仅设置初始交互偏好,默认 true(兼容旧行为)。 */
440
+ editing?: boolean;
441
+ /** 导入能力由 excelImport 授权;此项仅设置初始交互偏好,默认 true。 */
442
+ excelImport?: boolean;
443
+ /** 未传时显示全部已有出口;空数组表示不提供导出工具。 */
444
+ exportFormats?: ReportExportFormat[];
445
+ }
446
+ declare interface OutputDiagnostic {
447
+ code: "missing-image" | "unsupported-component" | "unsupported-image-format" | "unsupported-style" | "rich-text-flattened" | "nested-components-omitted" | "async-image-required" | "image-decode-failed" | "asset-render-failed" | "asset-budget-exceeded";
448
+ severity: "warning";
449
+ format: OutputFormat;
450
+ pageIndex: number;
451
+ componentIndex: number;
452
+ /** Nested grid child location as repeating [rowIndex, columnIndex, childIndex] triples. */
453
+ componentPath?: readonly number[];
454
+ kind: string;
455
+ nid?: string;
456
+ message: string;
457
+ }
458
+ declare interface OutputDiagnosticOptions extends OutputTaskOptions {
459
+ /** Structured fidelity diagnostics; rendering never silently invents missing content. */
460
+ onDiagnostic?: (diagnostic: OutputDiagnostic) => void;
461
+ /** Reject known unsupported content before creating an incomplete file. Default warn. */
462
+ fidelity?: "warn" | "strict";
463
+ }
464
+ declare type OutputFormat = "dom" | "canvas" | "pdf" | "xlsx";
465
+ /** Stage counts are exact completed units; encoding libraries may remain indeterminate. */
466
+ declare interface OutputTaskOptions {
467
+ signal?: AbortSignal;
468
+ onProgress?: (completed: number, total: number) => void;
469
+ }
470
+ declare interface PlanComponent {
471
+ kind: ComponentKind;
472
+ leftMm: number;
473
+ topMm: number;
474
+ widthMm: number;
475
+ heightMm: number;
476
+ nid?: string;
477
+ rkey?: string;
478
+ text?: string;
479
+ rawText?: string;
480
+ lines?: string[];
481
+ richParagraphs?: RichParagraph[];
482
+ imageData?: string;
483
+ /** 明确指定线段方向;省略保持历史水平线行为。 */
484
+ lineDirection?: "down" | "up";
485
+ grid?: PlanGrid;
486
+ table?: PlanTableFragment;
487
+ style?: ComponentStyle;
488
+ meta?: Record<string, unknown>;
489
+ /** MachReport 扩展字段:未知 kind 的兜底渲染标记 */
490
+ fallbackText?: string;
491
+ }
492
+ declare interface PlanGrid {
493
+ /** 行内允许 null 空位;渲染器按空单元格处理 */
494
+ cells: (GridCell | null)[][];
495
+ colWidthsMm?: number[];
496
+ rowHeightsMm?: number[];
497
+ gapMm?: number;
498
+ /** 单元格四边内距;旧静态网格默认 0.5mm,分页列表使用其真实测量内距。 */
499
+ paddingMm?: number;
500
+ }
501
+ /** 列表的逻辑行来源;用于连续 Excel 重组,避免按文本猜测重复表头。 */
502
+ declare interface PlanTableFragment {
503
+ /** 在整个计划中唯一的逻辑表身份;同一表的分页片段共享身份。 */
504
+ id: string;
505
+ /** 表头固定 -1;其余行(包括组头/小计/总计)从 0 连续递增。 */
506
+ rowIndex: number;
507
+ role: "header" | "body" | "group-header" | "subtotal" | "grand-total";
508
+ /** 按物理列顺序保存字段身份;不以表头显示文本判断列结构。 */
509
+ columnKeys: string[];
510
+ layout?: "page" | "wide";
511
+ title?: string;
512
+ /** 只有宿主声明稳定 rowKey 时生成,不能用显示顺序替代业务主键。 */
513
+ source?: Omit<ReportCellSource, "field" | "rowKey"> & {
514
+ rowKey?: string | number;
515
+ };
516
+ }
517
+ declare const PRODUCT_TEMPLATE_EDITOR_MESSAGES: {
518
+ undo: string;
519
+ redo: string;
520
+ columnsSearch: string;
521
+ columnsSelected: string;
522
+ selectVisible: string;
523
+ clearSelection: string;
524
+ noColumns: string;
525
+ batchBody: string;
526
+ batchHeader: string;
527
+ chooseAlignment: string;
528
+ discardTitle: string;
529
+ discardDescription: string;
530
+ keepEditing: string;
531
+ discard: string;
532
+ jsonPending: string;
533
+ };
534
+ /** Return false to keep the current report. Without a hook the preview asks inline. */
535
+ declare type ReportBeforeDiscard = (context: Readonly<ReportBeforeDiscardContext>) => boolean | Promise<boolean>;
536
+ declare interface ReportBeforeDiscardContext {
537
+ reason: ReportDiscardReason;
538
+ reportIds: readonly string[];
539
+ /** Local input or a local draft, never a synonym for persisted differences. */
540
+ pendingLocalChanges: true;
541
+ }
542
+ /** 预览中的物理坐标;合并单元格使用左上角坐标。 */
543
+ declare interface ReportCellAddress {
544
+ pageIndex: number;
545
+ componentIndex: number;
546
+ rowIndex: number;
547
+ columnIndex: number;
548
+ }
549
+ declare interface ReportCellChoice {
550
+ value: Exclude<ReportCellValue, null>;
551
+ label?: string;
552
+ }
553
+ declare interface ReportCellContext {
554
+ address: ReportCellAddress;
555
+ cell: Readonly<GridCell>;
556
+ component: Readonly<PlanComponent>;
557
+ value: ReportCellValue;
558
+ valueType: ReportCellValueType;
559
+ table?: ReportCellTableIdentity;
560
+ /** Stable business identity. Physical row indices must never be used as database keys. */
561
+ source?: Readonly<ReportCellSource>;
562
+ editable: boolean;
563
+ readOnlyReason?: ReportCellReadOnlyReason;
564
+ }
565
+ declare interface ReportCellEdit {
566
+ address: ReportCellAddress;
567
+ table?: ReportCellTableIdentity;
568
+ source?: Readonly<ReportCellSource>;
569
+ previousValue: ReportCellValue;
570
+ previousText: string;
571
+ value: ReportCellValue;
572
+ text: string;
573
+ }
574
+ declare interface ReportCellFieldBase {
575
+ /** Presentation only; it never grants write permission. */
576
+ label?: string;
577
+ hint?: string;
578
+ unit?: string;
579
+ required?: boolean;
580
+ }
581
+ declare type ReportCellFieldOptions = ReportCellFieldBase & ({
582
+ type: "text";
583
+ maxLength?: number;
584
+ } | {
585
+ type: "number";
586
+ min?: number;
587
+ max?: number;
588
+ precision?: number;
589
+ } | {
590
+ type: "boolean";
591
+ trueLabel?: string;
592
+ falseLabel?: string;
593
+ } | {
594
+ type: "enum";
595
+ options: readonly ReportCellChoice[];
596
+ } | {
597
+ type: "date";
598
+ min?: string;
599
+ max?: string;
600
+ });
601
+ declare type ReportCellReadOnlyReason = "cell" | "formula" | "complex" | "structure";
602
+ /** 可持久化的业务身份与计划坐标独立;权限及并发校验仍由业务服务器执行。 */
603
+ declare interface ReportCellSource {
604
+ datasetId: string;
605
+ rowKey: string | number;
606
+ field: string;
607
+ revision?: string | number;
608
+ sourceToken?: string;
609
+ }
610
+ declare interface ReportCellTableIdentity {
611
+ id: string;
612
+ /** 逻辑表行索引;跨分页的同一行保持不变。 */
613
+ rowIndex: number;
614
+ role: PlanTableFragment["role"];
615
+ columnKey?: string;
616
+ }
617
+ declare type ReportCellValue = string | number | boolean | null;
618
+ declare type ReportCellValueType = NonNullable<GridCell["valueType"]>;
619
+ declare type ReportDiscardReason = "reload" | "import" | "replace" | "leave";
620
+ declare interface ReportEditBatch {
621
+ /** Idempotency identity; the server should bind it to the exact payload. */
622
+ requestId: string;
623
+ edits: ReportCellEdit[];
624
+ }
625
+ declare interface ReportEditConflict {
626
+ source?: Readonly<ReportCellSource>;
627
+ address?: ReportCellAddress;
628
+ message: string;
629
+ currentValue?: ReportCellValue;
630
+ revision?: string | number;
631
+ }
632
+ /** Opt in with true for local drafts, or provide host validation and persistence. */
633
+ declare interface ReportEditingOptions {
634
+ /** Optional field controls, keyed by source.field / table.columnKey; a resolver supports dataset-specific rules. */
635
+ fields?: Readonly<Record<string, ReportCellFieldOptions>> | ((context: ReportCellContext) => ReportCellFieldOptions | undefined);
636
+ canEdit?(context: ReportCellContext): boolean;
637
+ /** Return an error message or throw to reject the edit. */
638
+ validate?(edit: Readonly<ReportCellEdit>, operation: ReportEditOperation): void | string | Promise<void | string>;
639
+ /** Called before applying the change. A rejection leaves the current report untouched. */
640
+ save?(edit: Readonly<ReportCellEdit>, operation: ReportEditOperation): void | ReportEditResult | Promise<void | ReportEditResult>;
641
+ /** Must commit all edits in one server transaction. Required for multi-cell persisted edits. */
642
+ saveBatch?(batch: Readonly<ReportEditBatch>, operation: ReportEditOperation): void | ReportEditResult | Promise<void | ReportEditResult>;
643
+ /** Restrict persistence to plans that supply stable datasetId/rowKey/field metadata. */
644
+ requireSource?: boolean;
645
+ }
646
+ declare interface ReportEditOperation {
647
+ /** Reload, another import or unmount aborts the operation. Save adapters should forward this signal. */
648
+ signal: AbortSignal;
649
+ requestId?: string;
650
+ action?: "edit" | "undo" | "redo" | "restore";
651
+ }
652
+ declare interface ReportEditResult {
653
+ /** A successful result may advance concurrency tokens for the affected dataset. */
654
+ revision?: string | number;
655
+ sourceToken?: string;
656
+ /** Any conflict rejects the entire client batch. A server must also transact atomically. */
657
+ conflicts?: readonly ReportEditConflict[];
658
+ }
659
+ /** 输出能力仍由宿主授权;工具偏好只决定当前预览实例的可见与启用状态。 */
660
+ declare type ReportExportFormat = "html" | "pdf" | "xlsx" | "png" | "word";
661
+ declare interface ReportInteractionOptions {
662
+ /** Screen-only frozen panes; exported geometry is unchanged. */
663
+ freezeHeaders?: boolean;
664
+ /** Leading identity columns, from 0 to 20. */
665
+ frozenColumns?: number;
666
+ /** Show workbook sheets / report sections when available. Default true. */
667
+ navigation?: boolean;
668
+ }
669
+ declare interface ReportOutputOptions {
670
+ /** warn preserves supported output and shows diagnostics; strict rejects known fidelity loss. */
671
+ fidelity?: "warn" | "strict";
672
+ }
673
+ /** 报表参数定义(声明式,模板自描述参数面:渲染组件据此生成查询面板) */
674
+ declare interface ReportParamDef {
675
+ /** 参数名(传入 params,与数据集 SQL #{field} 绑定对应) */
676
+ field: string;
677
+ /** 显示名(缺省用 field) */
678
+ label?: string;
679
+ type?: "text" | "number" | "date" | "select";
680
+ /** select 选项 */
681
+ options?: Array<{
682
+ label: string;
683
+ value: string;
684
+ }>;
685
+ defaultValue?: string;
686
+ required?: boolean;
687
+ placeholder?: string;
688
+ /** 数字上下界;date 参数使用 YYYY-MM-DD 字符串(含边界)。 */
689
+ min?: number | string;
690
+ max?: number | string;
691
+ minLength?: number;
692
+ maxLength?: number;
693
+ }
694
+ declare interface ReportPreferencesAdapter {
695
+ load(key: string): Partial<ReportPreviewPreferences> | null | Promise<Partial<ReportPreviewPreferences> | null>;
696
+ save(key: string, value: Readonly<Partial<ReportPreviewPreferences>>): void | Promise<void>;
697
+ remove?(key: string): void | Promise<void>;
698
+ }
699
+ declare interface ReportPreferencesOptions {
700
+ /** Host-scoped key; do not share one key between unrelated users/tenants. */
701
+ key: string;
702
+ adapter: ReportPreferencesAdapter;
703
+ }
704
+ declare type ReportPreviewPreferences = Record<ReportPreviewTool, boolean>;
705
+ declare type ReportPreviewTool = "search" | "thumbnails" | "zoom" | ReportExportFormat | "print" | "pdfWindow" | "editing" | "import";
706
+ declare interface ReportTemplate {
707
+ schemaVersion?: string;
708
+ /** 参数定义(可选;宿主也可经 ReportPreview 的 paramDefs prop 提供,prop 优先) */
709
+ params?: ReportParamDef[];
710
+ pages: TemplatePage[];
711
+ }
712
+ /** 可存入数据库/文件的纯 JSON 模板;数据、接口与鉴权仍由宿主提供。 */
713
+ declare interface ReportTemplateDocument {
714
+ schemaVersion: "1.0";
715
+ id: string;
716
+ name: string;
717
+ /** 宿主的发布版本/乐观锁标识,不由引擎自动递增。 */
718
+ revision?: string;
719
+ description?: string;
720
+ template: ReportTemplate;
721
+ }
722
+ export declare const ReportTemplateEditor: DefineComponent<TemplateEditorOptions, {
723
+ pendingLocalChanges: boolean;
724
+ guardChanges: (reason?: TemplateEditorBeforeDiscardContext["reason"], replacement?: ReportTemplateDocument) => Promise<boolean>;
725
+ reset: () => Promise<void>;
726
+ save: () => Promise<void>;
727
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
728
+ "update:modelValue": (document: ReportTemplateDocument) => any;
729
+ saved: (document: ReportTemplateDocument) => any;
730
+ }, string, MachReportVuePublicProps, Readonly<TemplateEditorOptions> & Readonly<{
731
+ "onUpdate:modelValue"?: ((document: ReportTemplateDocument) => any) | undefined;
732
+ onSaved?: ((document: ReportTemplateDocument) => any) | undefined;
733
+ }>, {}>;
734
+ declare interface RichParagraph {
735
+ segments: RichSegment[];
736
+ align?: ComponentStyle["align"];
737
+ lineHeight?: number;
738
+ spaceBeforeMm?: number;
739
+ spaceAfterMm?: number;
740
+ indentMm?: number;
741
+ }
742
+ declare interface RichSegment {
743
+ kind?: "text" | "field";
744
+ text?: string;
745
+ field?: string;
746
+ style?: ComponentStyle;
747
+ }
748
+ /** 条件格式规则求值(声明式,见 ListColumn.rules) */
749
+ declare interface StyleRule {
750
+ when: {
751
+ field: string;
752
+ op: ">" | ">=" | "<" | "<=" | "==" | "!=";
753
+ value: number | string;
754
+ };
755
+ /** 命中时合并进单元格样式(color/bold/backgroundColor 等) */
756
+ style: Record<string, unknown>;
757
+ }
758
+ export declare const TEMPLATE_EDITOR_MESSAGES: {
759
+ undo: string;
760
+ redo: string;
761
+ columnsSearch: string;
762
+ columnsSelected: string;
763
+ selectVisible: string;
764
+ clearSelection: string;
765
+ noColumns: string;
766
+ batchBody: string;
767
+ batchHeader: string;
768
+ chooseAlignment: string;
769
+ discardTitle: string;
770
+ discardDescription: string;
771
+ keepEditing: string;
772
+ discard: string;
773
+ jsonPending: string;
774
+ title: string;
775
+ heading: string;
776
+ unpublished: string;
777
+ dirty: string;
778
+ reset: string;
779
+ saving: string;
780
+ save: string;
781
+ name: string;
782
+ description: string;
783
+ area: string;
784
+ page: string;
785
+ header: string;
786
+ field: string;
787
+ width: string;
788
+ semantic: string;
789
+ identifier: string;
790
+ dimension: string;
791
+ measure: string;
792
+ date: string;
793
+ text: string;
794
+ bodyAlign: string;
795
+ headerAlign: string;
796
+ auto: string;
797
+ left: string;
798
+ center: string;
799
+ right: string;
800
+ justify: string;
801
+ editable: string;
802
+ json: string;
803
+ applyJson: string;
804
+ note: string;
805
+ invalid: string;
806
+ };
807
+ declare type TemplateComponent = PlanComponent | ListComponent;
808
+ export declare type TemplateEditorBeforeDiscard = (context: TemplateEditorBeforeDiscardContext) => boolean | Promise<boolean>;
809
+ export declare interface TemplateEditorBeforeDiscardContext {
810
+ reason: "reset" | "replace";
811
+ /** Independent snapshot of the current draft; it may contain invalid field values. */
812
+ document: ReportTemplateDocument;
813
+ replacement?: ReportTemplateDocument;
814
+ pendingLocalChanges: true;
815
+ }
816
+ export declare interface TemplateEditorController {
817
+ readonly pendingLocalChanges: boolean;
818
+ guardChanges(reason?: TemplateEditorBeforeDiscardContext["reason"], replacement?: ReportTemplateDocument): Promise<boolean>;
819
+ reset(): Promise<void>;
820
+ save(): Promise<void>;
821
+ }
822
+ /** Newly introduced labels are optional for existing complete message dictionaries. */
823
+ export declare type TemplateEditorMessages = typeof BASE_TEMPLATE_EDITOR_MESSAGES & Partial<typeof PRODUCT_TEMPLATE_EDITOR_MESSAGES>;
824
+ export declare interface TemplateEditorOptions {
825
+ modelValue: ReportTemplateDocument;
826
+ datasets?: DatasetRows;
827
+ readonly?: boolean;
828
+ messages?: Partial<TemplateEditorMessages>;
829
+ preview?: Pick<MachReportDefaults, "showExport" | "showPrint" | "showPdfWindow" | "theme" | "assets" | "pdfFontUrl" | "toolbar">;
830
+ beforeDiscard?: TemplateEditorBeforeDiscard;
831
+ save?: (document: ReportTemplateDocument, context: TemplateEditorSaveContext) => Promise<ReportTemplateDocument>;
832
+ }
833
+ export declare interface TemplateEditorSaveContext {
834
+ expectedRevision?: string;
835
+ signal: AbortSignal;
836
+ }
837
+ declare interface TemplatePage {
838
+ widthMm: number;
839
+ heightMm: number;
840
+ /** 宽表保持全列自然宽度,页高只控制内部纵向分段。 */
841
+ layout?: "page" | "wide";
842
+ marginTopMm?: number;
843
+ marginBottomMm?: number;
844
+ marginLeftMm?: number;
845
+ marginRightMm?: number;
846
+ components: TemplateComponent[];
847
+ }
848
+ /**
849
+ * RenderPlan → xlsx 导出(B 端第二出口,对齐家族 @agile-team/mach-table-xlsx 路线):
850
+ * - 网格组件 → 真表格:列宽(mm→Excel 宽度)、行高(mm→pt)、colSpan/rowSpan 合并、
851
+ * 加粗/对齐/底色/字号直译(resolveGridLayout 复用单真相源几何)
852
+ * - 文本组件 → 合并标题行(顺序流式输出,保字号/加粗/对齐;非像素级定位,
853
+ * 目标是"财务能直接用的对账表"而非复刻版面)
854
+ * - 未支持组件、富文本专有内容与单元格嵌套组件跳过并计入 warnings
855
+ */
856
+ declare interface XlsxRenderOptions extends OutputDiagnosticOptions {
857
+ /** 工作表命名(连续表默认使用标题,其余默认 "Sheet1" 起序)。 */
858
+ sheetName?: (sheetIndex: number) => string;
859
+ /** auto 默认将 wide 逻辑表合并为连续 Sheet;pages 保留逐页;continuous 要求明确的表来源。 */
860
+ sheetMode?: "auto" | "pages" | "continuous";
861
+ /** 宽表或连续表默认 raw,其余默认 text;显式配置可覆盖默认值。 */
862
+ valueMode?: "text" | "raw";
863
+ /** 连续表默认不限制打印纸型;显式 A3/A4/A5 仅设置打印适配,不改变 Excel 列宽。 */
864
+ paperSize?: "auto" | "a3" | "a4" | "a5";
865
+ }
866
+ export {};
867
+
868
+ /** Stable public attrs shared by supported Vue versions. */
869
+ type MachReportVuePublicProps = import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;