@agile-team/mach-report 2.5.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -14
- package/dist/ReportPreview-Dk-28QAi.js +2946 -0
- package/dist/ReportPreview-FSvcBLjH.cjs +6 -0
- package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/analytics.cjs +1 -0
- package/dist/analytics.d.cts +276 -0
- package/dist/analytics.d.ts +276 -0
- package/dist/analytics.js +223 -0
- package/dist/assets-66UBlhES.cjs +1 -0
- package/dist/assets-NVA_sftu.js +163 -0
- package/dist/capabilities-CNjIirfo.js +36 -0
- package/dist/capabilities-D4xeVYSR.cjs +1 -0
- package/dist/designer.cjs +1 -0
- package/dist/designer.d.cts +753 -0
- package/dist/designer.d.ts +753 -0
- package/dist/designer.js +372 -0
- package/dist/grid-geometry-BNptEcMm.js +65 -0
- package/dist/grid-geometry-CZ_cYB6O.cjs +1 -0
- package/dist/index.cjs +8 -5
- package/dist/index.d.cts +413 -8
- package/dist/index.d.ts +413 -8
- package/dist/index.js +1016 -1501
- package/dist/param-validation-BWNjLcN0.js +116 -0
- package/dist/param-validation-CiTxFeZ8.cjs +1 -0
- package/dist/pdf.cjs +48 -48
- package/dist/pdf.d.cts +111 -1
- package/dist/pdf.d.ts +111 -1
- package/dist/pdf.js +3931 -3868
- package/dist/{plugin-DMPLDpBY.cjs → plugin-BqBkn_kI.cjs} +1 -1
- package/dist/{plugin-DDLcFWlk.js → plugin-Ds10VnQO.js} +2 -2
- package/dist/render-plan-CckPEQyf.cjs +1 -0
- package/dist/{render-plan-CXBWRog4.js → render-plan-uzZYYSy1.js} +11 -10
- package/dist/report-params-B_VCihAh.js +12 -0
- package/dist/report-params-CjWrjPl6.cjs +1 -0
- package/dist/report-source-B9bENO0F.js +750 -0
- package/dist/report-source-BbNkkBDy.cjs +1 -0
- package/dist/server/node.d.cts +297 -0
- package/dist/server/node.d.ts +297 -0
- package/dist/server-node.cjs +1 -0
- package/dist/server-node.js +270 -0
- package/dist/server.cjs +1 -0
- package/dist/server.d.cts +643 -0
- package/dist/server.d.ts +643 -0
- package/dist/server.js +237 -0
- package/dist/style-CpwiOPyB.cjs +1 -0
- package/dist/style-Dv5o_x6b.js +67 -0
- package/dist/style.css +1 -1
- package/dist/template-registry-DWExx0gU.cjs +1 -0
- package/dist/template-registry-NpOakidD.js +354 -0
- package/dist/textwrap-CnGsEum6.cjs +4 -0
- package/dist/textwrap-DOl04hCQ.js +110 -0
- package/dist/validate-DfHPD8wX.cjs +1 -0
- package/dist/validate-S6CgIm5d.js +148 -0
- package/dist/vue/async.d.cts +602 -57
- package/dist/vue/async.d.ts +602 -57
- package/dist/vue/index.d.cts +1074 -111
- package/dist/vue/index.d.ts +1074 -111
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +167 -82
- package/dist/worker.cjs +1 -0
- package/dist/worker.d.cts +302 -0
- package/dist/worker.d.ts +302 -0
- package/dist/worker.js +133 -0
- package/dist/xlsx/node.d.cts +47 -0
- package/dist/xlsx/node.d.ts +47 -0
- package/dist/xlsx-node.cjs +221 -0
- package/dist/xlsx-node.js +36409 -0
- package/dist/xlsx.cjs +20 -20
- package/dist/xlsx.d.cts +78 -1
- package/dist/xlsx.d.ts +78 -1
- package/dist/xlsx.js +5974 -5831
- package/package.json +62 -2
- package/dist/ReportPreview-CBKLI--k.js +0 -2188
- package/dist/ReportPreview-ClM8h0pM.cjs +0 -6
- package/dist/grid-geometry-BNIvw52m.cjs +0 -1
- package/dist/grid-geometry-C8hGoe9o.js +0 -130
- package/dist/render-plan-CCTL4F9v.cjs +0 -1
- package/dist/report-params-B3Fia6JO.js +0 -10
- package/dist/report-params-D1gZ1DME.cjs +0 -1
- package/dist/textwrap-nH0UYU6D.js +0 -108
- package/dist/textwrap-oD-t4b4B.cjs +0 -4
package/dist/vue/async.d.cts
CHANGED
|
@@ -13,6 +13,25 @@ import { PropType } from 'vue';
|
|
|
13
13
|
import { PublicProps } from 'vue';
|
|
14
14
|
import { VNodeProps } from 'vue';
|
|
15
15
|
|
|
16
|
+
declare interface AssetRenderBudget {
|
|
17
|
+
/** Maximum newly rendered assets, default 1000. Existing imageData is kept unchanged. */
|
|
18
|
+
maxAssets?: number;
|
|
19
|
+
/** Maximum image payload bytes per new asset, default 32 MiB. */
|
|
20
|
+
maxImageBytes?: number;
|
|
21
|
+
/** Maximum total image payload bytes for new assets, default 128 MiB. */
|
|
22
|
+
maxTotalImageBytes?: number;
|
|
23
|
+
/** Wall-clock budget, including adapters that ignore AbortSignal. Default 30 seconds. */
|
|
24
|
+
maxDurationMs?: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare interface AssetRenderOptions extends OutputDiagnosticOptions {
|
|
28
|
+
assetRenderers?: Partial<Record<ImageComponentKind, ComponentImageRenderer>>;
|
|
29
|
+
assetBudget?: AssetRenderBudget;
|
|
30
|
+
/** Default throw prevents an incomplete export; placeholder retains the component and emits diagnostics. */
|
|
31
|
+
assetFailure?: "throw" | "placeholder";
|
|
32
|
+
signal?: AbortSignal;
|
|
33
|
+
}
|
|
34
|
+
|
|
16
35
|
/**
|
|
17
36
|
* 列值格式化(声明式、JSON 可序列化)。
|
|
18
37
|
* 在 paginate 的 cellText 出口统一消费:格式化发生在进 RenderPlan 之前,
|
|
@@ -53,6 +72,16 @@ declare type ColumnFormat_2 = {
|
|
|
53
72
|
pattern?: string;
|
|
54
73
|
};
|
|
55
74
|
|
|
75
|
+
declare interface ComponentImageContext {
|
|
76
|
+
readonly component: Readonly<PlanComponent>;
|
|
77
|
+
readonly pageIndex: number;
|
|
78
|
+
readonly componentIndex: number;
|
|
79
|
+
readonly componentPath: readonly number[];
|
|
80
|
+
readonly signal: AbortSignal;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare type ComponentImageRenderer = (context: ComponentImageContext) => string | Promise<string>;
|
|
84
|
+
|
|
56
85
|
declare type ComponentKind =
|
|
57
86
|
| "text"
|
|
58
87
|
| "image"
|
|
@@ -139,8 +168,12 @@ declare interface ComponentStyle_3 {
|
|
|
139
168
|
rotateDeg?: number;
|
|
140
169
|
}
|
|
141
170
|
|
|
171
|
+
declare interface DatasetContract { fields: readonly ReportFieldContract[]; rowKey?: string }
|
|
172
|
+
|
|
142
173
|
declare type DatasetRows = Record<string, Record<string, unknown>[]>;
|
|
143
174
|
|
|
175
|
+
declare interface DatasetValidationOptions { path?: string; maxRows?: number; maxCells?: number; maxIssues?: number }
|
|
176
|
+
|
|
144
177
|
declare interface ExcelImportedSheet {
|
|
145
178
|
name: string;
|
|
146
179
|
/** Original, one-based workbook position. */
|
|
@@ -232,6 +265,7 @@ declare interface GridCell {
|
|
|
232
265
|
valueType?: "text" | "number" | "boolean";
|
|
233
266
|
/** 单元格级编辑控制;预览仍需显式开启 editing。 */
|
|
234
267
|
editable?: boolean;
|
|
268
|
+
source?: ReportCellSource;
|
|
235
269
|
/** Excel 公式保留元数据;当前引擎不计算公式,公式格始终只读。 */
|
|
236
270
|
formula?: string;
|
|
237
271
|
children?: PlanComponent[];
|
|
@@ -251,6 +285,7 @@ declare interface GridCell_2 {
|
|
|
251
285
|
valueType?: "text" | "number" | "boolean";
|
|
252
286
|
/** 单元格级编辑控制;预览仍需显式开启 editing。 */
|
|
253
287
|
editable?: boolean;
|
|
288
|
+
source?: ReportCellSource_2;
|
|
254
289
|
/** Excel 公式保留元数据;当前引擎不计算公式,公式格始终只读。 */
|
|
255
290
|
formula?: string;
|
|
256
291
|
children?: PlanComponent_2[];
|
|
@@ -270,6 +305,7 @@ declare interface GridCell_3 {
|
|
|
270
305
|
valueType?: "text" | "number" | "boolean";
|
|
271
306
|
/** 单元格级编辑控制;预览仍需显式开启 editing。 */
|
|
272
307
|
editable?: boolean;
|
|
308
|
+
source?: ReportCellSource_3;
|
|
273
309
|
/** Excel 公式保留元数据;当前引擎不计算公式,公式格始终只读。 */
|
|
274
310
|
formula?: string;
|
|
275
311
|
children?: PlanComponent_3[];
|
|
@@ -278,6 +314,8 @@ declare interface GridCell_3 {
|
|
|
278
314
|
style?: ComponentStyle_3;
|
|
279
315
|
}
|
|
280
316
|
|
|
317
|
+
declare type ImageComponentKind = "image" | "chart" | "barcode" | "qrcode";
|
|
318
|
+
|
|
281
319
|
/** auto:真实数字/显式数值格式居右,日期与布尔居中,其他内容居左。 */
|
|
282
320
|
declare type ListAlignment = NonNullable<ComponentStyle["align"]> | "auto";
|
|
283
321
|
|
|
@@ -303,6 +341,8 @@ declare interface ListColumn {
|
|
|
303
341
|
editable?: boolean;
|
|
304
342
|
/** 空值列或特殊数据类型可显式声明编辑输入类型。 */
|
|
305
343
|
valueType?: GridCell["valueType"];
|
|
344
|
+
/** 字段语义用于 auto 对齐;明确声明编号,避免把数字编号当成度量。 */
|
|
345
|
+
semanticRole?: "identifier" | "dimension" | "measure" | "date" | "text";
|
|
306
346
|
}
|
|
307
347
|
|
|
308
348
|
declare interface ListColumn_2 {
|
|
@@ -324,6 +364,8 @@ declare interface ListColumn_2 {
|
|
|
324
364
|
editable?: boolean;
|
|
325
365
|
/** 空值列或特殊数据类型可显式声明编辑输入类型。 */
|
|
326
366
|
valueType?: GridCell_3["valueType"];
|
|
367
|
+
/** 字段语义用于 auto 对齐;明确声明编号,避免把数字编号当成度量。 */
|
|
368
|
+
semanticRole?: "identifier" | "dimension" | "measure" | "date" | "text";
|
|
327
369
|
}
|
|
328
370
|
|
|
329
371
|
declare interface ListComponent {
|
|
@@ -337,6 +379,10 @@ declare interface ListComponent {
|
|
|
337
379
|
topMm: number;
|
|
338
380
|
widthMm: number;
|
|
339
381
|
dataset: string;
|
|
382
|
+
/** 数据集中稳定业务主键的字段名;省略时编辑仅有计划内坐标。 */
|
|
383
|
+
rowKey?: string;
|
|
384
|
+
revisionField?: string;
|
|
385
|
+
sourceTokenField?: string;
|
|
340
386
|
columns: ListColumn[];
|
|
341
387
|
fontSizePt?: number;
|
|
342
388
|
headerBold?: boolean;
|
|
@@ -349,6 +395,8 @@ declare interface ListComponent {
|
|
|
349
395
|
/** 表头默认对齐,列配置可覆盖。 */
|
|
350
396
|
headerAlign?: ComponentStyle["align"];
|
|
351
397
|
headerStyle?: ComponentStyle;
|
|
398
|
+
/** 可选多行合并表头;列宽按列表物理列对齐,供 Excel 业务模板复用。 */
|
|
399
|
+
headerGrid?: PlanGrid;
|
|
352
400
|
border?: boolean;
|
|
353
401
|
/** 分组小计(组头/组尾小计/组头防孤行) */
|
|
354
402
|
groupBy?: ListGroupBy;
|
|
@@ -367,6 +415,10 @@ declare interface ListComponent_2 {
|
|
|
367
415
|
topMm: number;
|
|
368
416
|
widthMm: number;
|
|
369
417
|
dataset: string;
|
|
418
|
+
/** 数据集中稳定业务主键的字段名;省略时编辑仅有计划内坐标。 */
|
|
419
|
+
rowKey?: string;
|
|
420
|
+
revisionField?: string;
|
|
421
|
+
sourceTokenField?: string;
|
|
370
422
|
columns: ListColumn_2[];
|
|
371
423
|
fontSizePt?: number;
|
|
372
424
|
headerBold?: boolean;
|
|
@@ -379,6 +431,8 @@ declare interface ListComponent_2 {
|
|
|
379
431
|
/** 表头默认对齐,列配置可覆盖。 */
|
|
380
432
|
headerAlign?: ComponentStyle_3["align"];
|
|
381
433
|
headerStyle?: ComponentStyle_3;
|
|
434
|
+
/** 可选多行合并表头;列宽按列表物理列对齐,供 Excel 业务模板复用。 */
|
|
435
|
+
headerGrid?: PlanGrid_3;
|
|
382
436
|
border?: boolean;
|
|
383
437
|
/** 分组小计(组头/组尾小计/组头防孤行) */
|
|
384
438
|
groupBy?: ListGroupBy_2;
|
|
@@ -453,6 +507,10 @@ declare interface MachReportDefaults {
|
|
|
453
507
|
/** 设置入口默认显示;可在其中按需启用阅读及输出工具。 */
|
|
454
508
|
showSettings?: boolean;
|
|
455
509
|
toolbar?: MachReportToolbarOptions;
|
|
510
|
+
interaction?: ReportInteractionOptions;
|
|
511
|
+
preferences?: ReportPreferencesOptions;
|
|
512
|
+
/** Prepare optional image/chart/QR/barcode adapters once for preview and all outputs. */
|
|
513
|
+
assets?: AssetRenderOptions;
|
|
456
514
|
/** 参数面板显隐(有参数定义且未显式关闭时显示;缺省 true) */
|
|
457
515
|
showParams?: boolean;
|
|
458
516
|
/** 页间距 px */
|
|
@@ -526,6 +584,11 @@ declare interface MachReportMessages {
|
|
|
526
584
|
reset: string;
|
|
527
585
|
/** 必填缺失提示({label} 占位) */
|
|
528
586
|
paramRequired: string;
|
|
587
|
+
paramInvalid?: string;
|
|
588
|
+
paramPrompt?: string;
|
|
589
|
+
paramPromptDescription?: string;
|
|
590
|
+
paramSelectPlaceholder?: string;
|
|
591
|
+
paramTextPlaceholder?: string;
|
|
529
592
|
/** 可选搜索进度文案,旧完整 messages 对象无需新增字段。 */
|
|
530
593
|
searching?: string;
|
|
531
594
|
importExcel?: string;
|
|
@@ -544,12 +607,43 @@ declare interface MachReportMessages {
|
|
|
544
607
|
settingsReset?: string;
|
|
545
608
|
settingsClose?: string;
|
|
546
609
|
search?: string;
|
|
610
|
+
closeSearch?: string;
|
|
611
|
+
prevSearchMatch?: string;
|
|
612
|
+
nextSearchMatch?: string;
|
|
547
613
|
zoom?: string;
|
|
548
614
|
settingsLocal?: string;
|
|
549
615
|
editingLocal?: string;
|
|
550
616
|
editingSaved?: string;
|
|
551
617
|
importLocal?: string;
|
|
552
618
|
emptyDescription?: string;
|
|
619
|
+
undo?: string;
|
|
620
|
+
redo?: string;
|
|
621
|
+
restoreChanges?: string;
|
|
622
|
+
changes?: string;
|
|
623
|
+
changesCount?: string;
|
|
624
|
+
changesEmpty?: string;
|
|
625
|
+
changesBefore?: string;
|
|
626
|
+
changesAfter?: string;
|
|
627
|
+
editAtomicRequired?: string;
|
|
628
|
+
clipboardLimit?: string;
|
|
629
|
+
preferencesError?: string;
|
|
630
|
+
freezeHeaders?: string;
|
|
631
|
+
frozenColumns?: string;
|
|
632
|
+
sections?: string;
|
|
633
|
+
locateField?: string;
|
|
634
|
+
locateFieldPlaceholder?: string;
|
|
635
|
+
locateFieldMissing?: string;
|
|
636
|
+
importSummary?: string;
|
|
637
|
+
importPreserved?: string;
|
|
638
|
+
importWarnings?: string;
|
|
639
|
+
importReadOnly?: string;
|
|
640
|
+
conflicts?: string;
|
|
641
|
+
editReadOnly?: string;
|
|
642
|
+
editMissing?: string;
|
|
643
|
+
editDuplicate?: string;
|
|
644
|
+
clipboardInvalid?: string;
|
|
645
|
+
editSaved?: string;
|
|
646
|
+
settingsPanes?: string;
|
|
553
647
|
}
|
|
554
648
|
|
|
555
649
|
declare interface MachReportPluginOptions {
|
|
@@ -611,6 +705,18 @@ export declare const MachReportPreview: {
|
|
|
611
705
|
type: PropType<MachReportToolbarOptions>;
|
|
612
706
|
default: undefined;
|
|
613
707
|
};
|
|
708
|
+
interaction: {
|
|
709
|
+
type: PropType<ReportInteractionOptions>;
|
|
710
|
+
default: undefined;
|
|
711
|
+
};
|
|
712
|
+
preferences: {
|
|
713
|
+
type: PropType<ReportPreferencesOptions>;
|
|
714
|
+
default: undefined;
|
|
715
|
+
};
|
|
716
|
+
assets: {
|
|
717
|
+
type: PropType<AssetRenderOptions>;
|
|
718
|
+
default: undefined;
|
|
719
|
+
};
|
|
614
720
|
emptyState: {
|
|
615
721
|
type: PropType<boolean | ReportEmptyState>;
|
|
616
722
|
default: boolean;
|
|
@@ -652,37 +758,46 @@ export declare const MachReportPreview: {
|
|
|
652
758
|
default: null;
|
|
653
759
|
};
|
|
654
760
|
}>> & Readonly<{
|
|
761
|
+
onWarning?: ((message: string) => any) | undefined;
|
|
655
762
|
onError?: ((message: string, detail?: {
|
|
656
763
|
code: string;
|
|
657
764
|
cause?: unknown;
|
|
658
765
|
} | undefined) => any) | undefined;
|
|
659
766
|
onLoaded?: ((pageCount: number) => any) | undefined;
|
|
660
|
-
|
|
661
|
-
"onCell-edit"?: ((edit: ReportCellEdit_2) => any) | undefined;
|
|
767
|
+
"onCell-edit"?: ((edit: ReportCellEdit) => any) | undefined;
|
|
662
768
|
"onTemplate-import"?: ((result: ExcelImportResult) => any) | undefined;
|
|
663
769
|
"onPreferences-change"?: ((preferences: Readonly<ReportPreviewPreferences>) => any) | undefined;
|
|
664
770
|
}>, {
|
|
665
|
-
reload: () => Promise<void>;
|
|
666
|
-
print: () => Promise<void>;
|
|
667
|
-
exportAs: (format: string) => Promise<void>;
|
|
668
|
-
openPdfWindow: () => void;
|
|
669
|
-
gotoPage: (n: number) => void;
|
|
670
|
-
setParams: (values: Record<string, string>, opts?: {
|
|
671
|
-
reload?: boolean;
|
|
672
|
-
}) => Promise<void>;
|
|
673
|
-
checkPdfFont: () => Promise<PdfFontCheckResult>;
|
|
674
|
-
importExcel: (input: ArrayBuffer | Uint8Array | Blob, options?: ExcelImportOptions_2) => Promise<ExcelImportResult | null>;
|
|
675
|
-
getPlan: () => RenderPlan | null;
|
|
676
|
-
getChanges: () => ReportCellEdit_2[];
|
|
677
771
|
state: ComputedRef<MachReportState>;
|
|
772
|
+
checkPdfFont?(): Promise<PdfFontCheckResult>;
|
|
773
|
+
reload(): Promise<void>;
|
|
774
|
+
print(): Promise<void>;
|
|
775
|
+
exportAs(format: string): Promise<void> | void;
|
|
776
|
+
openPdfWindow(): void;
|
|
777
|
+
gotoPage(page: number): void;
|
|
778
|
+
setParams(values: Record<string, string>, opts?: {
|
|
779
|
+
reload?: boolean;
|
|
780
|
+
}): Promise<void> | void;
|
|
781
|
+
importExcel?(input: ArrayBuffer | Uint8Array | Blob, options?: ExcelImportOptions_2): Promise<ExcelImportResult | null>;
|
|
782
|
+
getPlan?(): RenderPlan | null;
|
|
783
|
+
getChanges?(): ReportCellEdit[];
|
|
784
|
+
getDifferences?(): ReportCellEdit[];
|
|
785
|
+
undo?(): Promise<boolean>;
|
|
786
|
+
redo?(): Promise<boolean>;
|
|
787
|
+
restoreChanges?(): Promise<boolean>;
|
|
788
|
+
getSelection?(): ReportCellSelection | null;
|
|
789
|
+
focusCell?(address: ReportCellAddress, extend?: boolean): Promise<boolean>;
|
|
790
|
+
focusField?(target: ReportFieldTarget): Promise<boolean>;
|
|
791
|
+
copySelection?(): string;
|
|
792
|
+
pasteSelection?(text: string): Promise<boolean>;
|
|
678
793
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
794
|
+
warning: (message: string) => any;
|
|
679
795
|
error: (message: string, detail?: {
|
|
680
796
|
code: string;
|
|
681
797
|
cause?: unknown;
|
|
682
798
|
} | undefined) => any;
|
|
683
799
|
loaded: (pageCount: number) => any;
|
|
684
|
-
|
|
685
|
-
"cell-edit": (edit: ReportCellEdit_2) => any;
|
|
800
|
+
"cell-edit": (edit: ReportCellEdit) => any;
|
|
686
801
|
"template-import": (result: ExcelImportResult) => any;
|
|
687
802
|
"preferences-change": (preferences: Readonly<ReportPreviewPreferences>) => any;
|
|
688
803
|
}, PublicProps, {
|
|
@@ -698,6 +813,9 @@ export declare const MachReportPreview: {
|
|
|
698
813
|
showSettings: boolean;
|
|
699
814
|
showParams: boolean;
|
|
700
815
|
toolbar: MachReportToolbarOptions;
|
|
816
|
+
interaction: ReportInteractionOptions;
|
|
817
|
+
preferences: ReportPreferencesOptions;
|
|
818
|
+
assets: AssetRenderOptions;
|
|
701
819
|
messages: Partial<MachReportMessages>;
|
|
702
820
|
excelImport: boolean | ExcelImportOptions_2;
|
|
703
821
|
autoLoad: boolean;
|
|
@@ -706,6 +824,145 @@ export declare const MachReportPreview: {
|
|
|
706
824
|
paramDefs: ReportParamDef[] | undefined;
|
|
707
825
|
fetcher: PlanFetcher | null;
|
|
708
826
|
}, true, {}, {}, { [K in keyof GlobalComponents]: GlobalComponents[K] }, { [K in keyof GlobalDirectives]: GlobalDirectives[K] }, string, {
|
|
827
|
+
paramPanelRef: CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
828
|
+
defs: ReportParamDef[];
|
|
829
|
+
modelValue: Record<string, string>;
|
|
830
|
+
messages: MachReportMessages;
|
|
831
|
+
attempted: boolean;
|
|
832
|
+
issues?: readonly ReportParamIssue[];
|
|
833
|
+
}> & Readonly<{
|
|
834
|
+
onReset?: (() => any) | undefined;
|
|
835
|
+
onQuery?: (() => any) | undefined;
|
|
836
|
+
"onUpdate:modelValue"?: ((value: Record<string, string>) => any) | undefined;
|
|
837
|
+
}>, {
|
|
838
|
+
focusInvalid: () => void;
|
|
839
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
840
|
+
reset: () => any;
|
|
841
|
+
query: () => any;
|
|
842
|
+
"update:modelValue": (value: Record<string, string>) => any;
|
|
843
|
+
}, PublicProps, {}, false, {}, {}, { [K in keyof GlobalComponents]: GlobalComponents[K] }, { [K in keyof GlobalDirectives]: GlobalDirectives[K] }, string, {
|
|
844
|
+
root: HTMLDivElement;
|
|
845
|
+
}, HTMLDivElement, ComponentProvideOptions, {
|
|
846
|
+
P: {};
|
|
847
|
+
B: {};
|
|
848
|
+
D: {};
|
|
849
|
+
C: {};
|
|
850
|
+
M: {};
|
|
851
|
+
Defaults: {};
|
|
852
|
+
}, Readonly<{
|
|
853
|
+
defs: ReportParamDef[];
|
|
854
|
+
modelValue: Record<string, string>;
|
|
855
|
+
messages: MachReportMessages;
|
|
856
|
+
attempted: boolean;
|
|
857
|
+
issues?: readonly ReportParamIssue[];
|
|
858
|
+
}> & Readonly<{
|
|
859
|
+
onReset?: (() => any) | undefined;
|
|
860
|
+
onQuery?: (() => any) | undefined;
|
|
861
|
+
"onUpdate:modelValue"?: ((value: Record<string, string>) => any) | undefined;
|
|
862
|
+
}>, {
|
|
863
|
+
focusInvalid: () => void;
|
|
864
|
+
}, {}, {}, {}, {}> | null;
|
|
865
|
+
toolbarRef: CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
866
|
+
pageCount: number;
|
|
867
|
+
currentPage: number;
|
|
868
|
+
zoomMode: "fit" | "raw";
|
|
869
|
+
zoom: number;
|
|
870
|
+
showExport: boolean;
|
|
871
|
+
showPrint: boolean;
|
|
872
|
+
showPdfWindow: boolean;
|
|
873
|
+
messages: MachReportMessages;
|
|
874
|
+
search: {
|
|
875
|
+
visible: boolean;
|
|
876
|
+
query: string;
|
|
877
|
+
matchIndex: number;
|
|
878
|
+
matchCount: number;
|
|
879
|
+
searching?: boolean;
|
|
880
|
+
};
|
|
881
|
+
thumbsVisible: boolean;
|
|
882
|
+
showImport?: boolean;
|
|
883
|
+
showSearch?: boolean;
|
|
884
|
+
showThumbnails?: boolean;
|
|
885
|
+
showZoom?: boolean;
|
|
886
|
+
exportFormats?: readonly ReportExportFormat[];
|
|
887
|
+
showSettings?: boolean;
|
|
888
|
+
settingsOpen?: boolean;
|
|
889
|
+
busy?: boolean;
|
|
890
|
+
}> & Readonly<{
|
|
891
|
+
onExport?: ((format: "pdf" | "xlsx" | "html" | "png" | "word") => any) | undefined;
|
|
892
|
+
onPrint?: (() => any) | undefined;
|
|
893
|
+
onZoom?: ((mode: number | "fit") => any) | undefined;
|
|
894
|
+
onGoto?: ((page: number) => any) | undefined;
|
|
895
|
+
"onPdf-window"?: (() => any) | undefined;
|
|
896
|
+
"onSearch-input"?: ((query: string) => any) | undefined;
|
|
897
|
+
"onSearch-nav"?: ((dir: 1 | -1) => any) | undefined;
|
|
898
|
+
"onSearch-toggle"?: (() => any) | undefined;
|
|
899
|
+
"onThumbs-toggle"?: (() => any) | undefined;
|
|
900
|
+
"onImport-excel"?: (() => any) | undefined;
|
|
901
|
+
"onSettings-toggle"?: (() => any) | undefined;
|
|
902
|
+
}>, {
|
|
903
|
+
focusSearch: () => void;
|
|
904
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
905
|
+
export: (format: "pdf" | "xlsx" | "html" | "png" | "word") => any;
|
|
906
|
+
print: () => any;
|
|
907
|
+
zoom: (mode: number | "fit") => any;
|
|
908
|
+
goto: (page: number) => any;
|
|
909
|
+
"pdf-window": () => any;
|
|
910
|
+
"search-input": (query: string) => any;
|
|
911
|
+
"search-nav": (dir: 1 | -1) => any;
|
|
912
|
+
"search-toggle": () => any;
|
|
913
|
+
"thumbs-toggle": () => any;
|
|
914
|
+
"import-excel": () => any;
|
|
915
|
+
"settings-toggle": () => any;
|
|
916
|
+
}, PublicProps, {}, false, {}, {}, { [K in keyof GlobalComponents]: GlobalComponents[K] }, { [K in keyof GlobalDirectives]: GlobalDirectives[K] }, string, {
|
|
917
|
+
searchInputRef: HTMLInputElement;
|
|
918
|
+
searchToggleRef: HTMLButtonElement;
|
|
919
|
+
}, HTMLDivElement, ComponentProvideOptions, {
|
|
920
|
+
P: {};
|
|
921
|
+
B: {};
|
|
922
|
+
D: {};
|
|
923
|
+
C: {};
|
|
924
|
+
M: {};
|
|
925
|
+
Defaults: {};
|
|
926
|
+
}, Readonly<{
|
|
927
|
+
pageCount: number;
|
|
928
|
+
currentPage: number;
|
|
929
|
+
zoomMode: "fit" | "raw";
|
|
930
|
+
zoom: number;
|
|
931
|
+
showExport: boolean;
|
|
932
|
+
showPrint: boolean;
|
|
933
|
+
showPdfWindow: boolean;
|
|
934
|
+
messages: MachReportMessages;
|
|
935
|
+
search: {
|
|
936
|
+
visible: boolean;
|
|
937
|
+
query: string;
|
|
938
|
+
matchIndex: number;
|
|
939
|
+
matchCount: number;
|
|
940
|
+
searching?: boolean;
|
|
941
|
+
};
|
|
942
|
+
thumbsVisible: boolean;
|
|
943
|
+
showImport?: boolean;
|
|
944
|
+
showSearch?: boolean;
|
|
945
|
+
showThumbnails?: boolean;
|
|
946
|
+
showZoom?: boolean;
|
|
947
|
+
exportFormats?: readonly ReportExportFormat[];
|
|
948
|
+
showSettings?: boolean;
|
|
949
|
+
settingsOpen?: boolean;
|
|
950
|
+
busy?: boolean;
|
|
951
|
+
}> & Readonly<{
|
|
952
|
+
onExport?: ((format: "pdf" | "xlsx" | "html" | "png" | "word") => any) | undefined;
|
|
953
|
+
onPrint?: (() => any) | undefined;
|
|
954
|
+
onZoom?: ((mode: number | "fit") => any) | undefined;
|
|
955
|
+
onGoto?: ((page: number) => any) | undefined;
|
|
956
|
+
"onPdf-window"?: (() => any) | undefined;
|
|
957
|
+
"onSearch-input"?: ((query: string) => any) | undefined;
|
|
958
|
+
"onSearch-nav"?: ((dir: 1 | -1) => any) | undefined;
|
|
959
|
+
"onSearch-toggle"?: (() => any) | undefined;
|
|
960
|
+
"onThumbs-toggle"?: (() => any) | undefined;
|
|
961
|
+
"onImport-excel"?: (() => any) | undefined;
|
|
962
|
+
"onSettings-toggle"?: (() => any) | undefined;
|
|
963
|
+
}>, {
|
|
964
|
+
focusSearch: () => void;
|
|
965
|
+
}, {}, {}, {}, {}> | null;
|
|
709
966
|
importInputRef: HTMLInputElement;
|
|
710
967
|
viewportRef: HTMLDivElement;
|
|
711
968
|
containerRef: HTMLDivElement;
|
|
@@ -754,6 +1011,18 @@ export declare const MachReportPreview: {
|
|
|
754
1011
|
type: PropType<MachReportToolbarOptions>;
|
|
755
1012
|
default: undefined;
|
|
756
1013
|
};
|
|
1014
|
+
interaction: {
|
|
1015
|
+
type: PropType<ReportInteractionOptions>;
|
|
1016
|
+
default: undefined;
|
|
1017
|
+
};
|
|
1018
|
+
preferences: {
|
|
1019
|
+
type: PropType<ReportPreferencesOptions>;
|
|
1020
|
+
default: undefined;
|
|
1021
|
+
};
|
|
1022
|
+
assets: {
|
|
1023
|
+
type: PropType<AssetRenderOptions>;
|
|
1024
|
+
default: undefined;
|
|
1025
|
+
};
|
|
757
1026
|
emptyState: {
|
|
758
1027
|
type: PropType<boolean | ReportEmptyState>;
|
|
759
1028
|
default: boolean;
|
|
@@ -795,29 +1064,38 @@ export declare const MachReportPreview: {
|
|
|
795
1064
|
default: null;
|
|
796
1065
|
};
|
|
797
1066
|
}>> & Readonly<{
|
|
1067
|
+
onWarning?: ((message: string) => any) | undefined;
|
|
798
1068
|
onError?: ((message: string, detail?: {
|
|
799
1069
|
code: string;
|
|
800
1070
|
cause?: unknown;
|
|
801
1071
|
} | undefined) => any) | undefined;
|
|
802
1072
|
onLoaded?: ((pageCount: number) => any) | undefined;
|
|
803
|
-
|
|
804
|
-
"onCell-edit"?: ((edit: ReportCellEdit_2) => any) | undefined;
|
|
1073
|
+
"onCell-edit"?: ((edit: ReportCellEdit) => any) | undefined;
|
|
805
1074
|
"onTemplate-import"?: ((result: ExcelImportResult) => any) | undefined;
|
|
806
1075
|
"onPreferences-change"?: ((preferences: Readonly<ReportPreviewPreferences>) => any) | undefined;
|
|
807
1076
|
}>, {
|
|
808
|
-
reload: () => Promise<void>;
|
|
809
|
-
print: () => Promise<void>;
|
|
810
|
-
exportAs: (format: string) => Promise<void>;
|
|
811
|
-
openPdfWindow: () => void;
|
|
812
|
-
gotoPage: (n: number) => void;
|
|
813
|
-
setParams: (values: Record<string, string>, opts?: {
|
|
814
|
-
reload?: boolean;
|
|
815
|
-
}) => Promise<void>;
|
|
816
|
-
checkPdfFont: () => Promise<PdfFontCheckResult>;
|
|
817
|
-
importExcel: (input: ArrayBuffer | Uint8Array | Blob, options?: ExcelImportOptions_2) => Promise<ExcelImportResult | null>;
|
|
818
|
-
getPlan: () => RenderPlan | null;
|
|
819
|
-
getChanges: () => ReportCellEdit_2[];
|
|
820
1077
|
state: ComputedRef<MachReportState>;
|
|
1078
|
+
checkPdfFont?(): Promise<PdfFontCheckResult>;
|
|
1079
|
+
reload(): Promise<void>;
|
|
1080
|
+
print(): Promise<void>;
|
|
1081
|
+
exportAs(format: string): Promise<void> | void;
|
|
1082
|
+
openPdfWindow(): void;
|
|
1083
|
+
gotoPage(page: number): void;
|
|
1084
|
+
setParams(values: Record<string, string>, opts?: {
|
|
1085
|
+
reload?: boolean;
|
|
1086
|
+
}): Promise<void> | void;
|
|
1087
|
+
importExcel?(input: ArrayBuffer | Uint8Array | Blob, options?: ExcelImportOptions_2): Promise<ExcelImportResult | null>;
|
|
1088
|
+
getPlan?(): RenderPlan | null;
|
|
1089
|
+
getChanges?(): ReportCellEdit[];
|
|
1090
|
+
getDifferences?(): ReportCellEdit[];
|
|
1091
|
+
undo?(): Promise<boolean>;
|
|
1092
|
+
redo?(): Promise<boolean>;
|
|
1093
|
+
restoreChanges?(): Promise<boolean>;
|
|
1094
|
+
getSelection?(): ReportCellSelection | null;
|
|
1095
|
+
focusCell?(address: ReportCellAddress, extend?: boolean): Promise<boolean>;
|
|
1096
|
+
focusField?(target: ReportFieldTarget): Promise<boolean>;
|
|
1097
|
+
copySelection?(): string;
|
|
1098
|
+
pasteSelection?(text: string): Promise<boolean>;
|
|
821
1099
|
}, {}, {}, {}, {
|
|
822
1100
|
editable: boolean | ReportEditingOptions;
|
|
823
1101
|
height: string;
|
|
@@ -831,6 +1109,9 @@ export declare const MachReportPreview: {
|
|
|
831
1109
|
showSettings: boolean;
|
|
832
1110
|
showParams: boolean;
|
|
833
1111
|
toolbar: MachReportToolbarOptions;
|
|
1112
|
+
interaction: ReportInteractionOptions;
|
|
1113
|
+
preferences: ReportPreferencesOptions;
|
|
1114
|
+
assets: AssetRenderOptions;
|
|
834
1115
|
messages: Partial<MachReportMessages>;
|
|
835
1116
|
excelImport: boolean | ExcelImportOptions_2;
|
|
836
1117
|
autoLoad: boolean;
|
|
@@ -879,6 +1160,18 @@ toolbar: {
|
|
|
879
1160
|
type: PropType<MachReportToolbarOptions>;
|
|
880
1161
|
default: undefined;
|
|
881
1162
|
};
|
|
1163
|
+
interaction: {
|
|
1164
|
+
type: PropType<ReportInteractionOptions>;
|
|
1165
|
+
default: undefined;
|
|
1166
|
+
};
|
|
1167
|
+
preferences: {
|
|
1168
|
+
type: PropType<ReportPreferencesOptions>;
|
|
1169
|
+
default: undefined;
|
|
1170
|
+
};
|
|
1171
|
+
assets: {
|
|
1172
|
+
type: PropType<AssetRenderOptions>;
|
|
1173
|
+
default: undefined;
|
|
1174
|
+
};
|
|
882
1175
|
emptyState: {
|
|
883
1176
|
type: PropType<boolean | ReportEmptyState>;
|
|
884
1177
|
default: boolean;
|
|
@@ -920,37 +1213,46 @@ type: PropType<PlanFetcher | null>;
|
|
|
920
1213
|
default: null;
|
|
921
1214
|
};
|
|
922
1215
|
}>> & Readonly<{
|
|
1216
|
+
onWarning?: ((message: string) => any) | undefined;
|
|
923
1217
|
onError?: ((message: string, detail?: {
|
|
924
1218
|
code: string;
|
|
925
1219
|
cause?: unknown;
|
|
926
1220
|
} | undefined) => any) | undefined;
|
|
927
1221
|
onLoaded?: ((pageCount: number) => any) | undefined;
|
|
928
|
-
|
|
929
|
-
"onCell-edit"?: ((edit: ReportCellEdit_2) => any) | undefined;
|
|
1222
|
+
"onCell-edit"?: ((edit: ReportCellEdit) => any) | undefined;
|
|
930
1223
|
"onTemplate-import"?: ((result: ExcelImportResult) => any) | undefined;
|
|
931
1224
|
"onPreferences-change"?: ((preferences: Readonly<ReportPreviewPreferences>) => any) | undefined;
|
|
932
1225
|
}>, {
|
|
933
|
-
reload: () => Promise<void>;
|
|
934
|
-
print: () => Promise<void>;
|
|
935
|
-
exportAs: (format: string) => Promise<void>;
|
|
936
|
-
openPdfWindow: () => void;
|
|
937
|
-
gotoPage: (n: number) => void;
|
|
938
|
-
setParams: (values: Record<string, string>, opts?: {
|
|
939
|
-
reload?: boolean;
|
|
940
|
-
}) => Promise<void>;
|
|
941
|
-
checkPdfFont: () => Promise<PdfFontCheckResult>;
|
|
942
|
-
importExcel: (input: ArrayBuffer | Uint8Array | Blob, options?: ExcelImportOptions_2) => Promise<ExcelImportResult | null>;
|
|
943
|
-
getPlan: () => RenderPlan | null;
|
|
944
|
-
getChanges: () => ReportCellEdit_2[];
|
|
945
1226
|
state: ComputedRef<MachReportState>;
|
|
1227
|
+
checkPdfFont?(): Promise<PdfFontCheckResult>;
|
|
1228
|
+
reload(): Promise<void>;
|
|
1229
|
+
print(): Promise<void>;
|
|
1230
|
+
exportAs(format: string): Promise<void> | void;
|
|
1231
|
+
openPdfWindow(): void;
|
|
1232
|
+
gotoPage(page: number): void;
|
|
1233
|
+
setParams(values: Record<string, string>, opts?: {
|
|
1234
|
+
reload?: boolean;
|
|
1235
|
+
}): Promise<void> | void;
|
|
1236
|
+
importExcel?(input: ArrayBuffer | Uint8Array | Blob, options?: ExcelImportOptions_2): Promise<ExcelImportResult | null>;
|
|
1237
|
+
getPlan?(): RenderPlan | null;
|
|
1238
|
+
getChanges?(): ReportCellEdit[];
|
|
1239
|
+
getDifferences?(): ReportCellEdit[];
|
|
1240
|
+
undo?(): Promise<boolean>;
|
|
1241
|
+
redo?(): Promise<boolean>;
|
|
1242
|
+
restoreChanges?(): Promise<boolean>;
|
|
1243
|
+
getSelection?(): ReportCellSelection | null;
|
|
1244
|
+
focusCell?(address: ReportCellAddress, extend?: boolean): Promise<boolean>;
|
|
1245
|
+
focusField?(target: ReportFieldTarget): Promise<boolean>;
|
|
1246
|
+
copySelection?(): string;
|
|
1247
|
+
pasteSelection?(text: string): Promise<boolean>;
|
|
946
1248
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
1249
|
+
warning: (message: string) => any;
|
|
947
1250
|
error: (message: string, detail?: {
|
|
948
1251
|
code: string;
|
|
949
1252
|
cause?: unknown;
|
|
950
1253
|
} | undefined) => any;
|
|
951
1254
|
loaded: (pageCount: number) => any;
|
|
952
|
-
|
|
953
|
-
"cell-edit": (edit: ReportCellEdit_2) => any;
|
|
1255
|
+
"cell-edit": (edit: ReportCellEdit) => any;
|
|
954
1256
|
"template-import": (result: ExcelImportResult) => any;
|
|
955
1257
|
"preferences-change": (preferences: Readonly<ReportPreviewPreferences>) => any;
|
|
956
1258
|
}, string, {
|
|
@@ -966,6 +1268,9 @@ showPdfWindow: boolean;
|
|
|
966
1268
|
showSettings: boolean;
|
|
967
1269
|
showParams: boolean;
|
|
968
1270
|
toolbar: MachReportToolbarOptions;
|
|
1271
|
+
interaction: ReportInteractionOptions;
|
|
1272
|
+
preferences: ReportPreferencesOptions;
|
|
1273
|
+
assets: AssetRenderOptions;
|
|
969
1274
|
messages: Partial<MachReportMessages>;
|
|
970
1275
|
excelImport: boolean | ExcelImportOptions_2;
|
|
971
1276
|
autoLoad: boolean;
|
|
@@ -1005,6 +1310,10 @@ declare interface MachReportState {
|
|
|
1005
1310
|
readonly saving?: boolean;
|
|
1006
1311
|
readonly importing?: boolean;
|
|
1007
1312
|
readonly dirty?: boolean;
|
|
1313
|
+
readonly canUndo?: boolean;
|
|
1314
|
+
readonly canRedo?: boolean;
|
|
1315
|
+
readonly changeCount?: number;
|
|
1316
|
+
readonly selection?: Readonly<ReportCellSelection> | null;
|
|
1008
1317
|
}
|
|
1009
1318
|
|
|
1010
1319
|
declare interface MachReportStateError {
|
|
@@ -1039,11 +1348,53 @@ declare interface MachReportToolbarOptions {
|
|
|
1039
1348
|
exportFormats?: ReportExportFormat[];
|
|
1040
1349
|
}
|
|
1041
1350
|
|
|
1351
|
+
declare interface OutputDiagnostic {
|
|
1352
|
+
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";
|
|
1353
|
+
severity: "warning";
|
|
1354
|
+
format: OutputFormat;
|
|
1355
|
+
pageIndex: number;
|
|
1356
|
+
componentIndex: number;
|
|
1357
|
+
/** Nested grid child location as repeating [rowIndex, columnIndex, childIndex] triples. */
|
|
1358
|
+
componentPath?: readonly number[];
|
|
1359
|
+
kind: string;
|
|
1360
|
+
nid?: string;
|
|
1361
|
+
message: string;
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
declare interface OutputDiagnostic_2 {
|
|
1365
|
+
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";
|
|
1366
|
+
severity: "warning";
|
|
1367
|
+
format: OutputFormat_2;
|
|
1368
|
+
pageIndex: number;
|
|
1369
|
+
componentIndex: number;
|
|
1370
|
+
/** Nested grid child location as repeating [rowIndex, columnIndex, childIndex] triples. */
|
|
1371
|
+
componentPath?: readonly number[];
|
|
1372
|
+
kind: string;
|
|
1373
|
+
nid?: string;
|
|
1374
|
+
message: string;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
declare interface OutputDiagnosticOptions {
|
|
1378
|
+
/** Structured fidelity diagnostics; rendering never silently invents missing content. */
|
|
1379
|
+
onDiagnostic?: (diagnostic: OutputDiagnostic) => void;
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
declare interface OutputDiagnosticOptions_2 {
|
|
1383
|
+
/** Structured fidelity diagnostics; rendering never silently invents missing content. */
|
|
1384
|
+
onDiagnostic?: (diagnostic: OutputDiagnostic_2) => void;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
declare type OutputFormat = "dom" | "canvas" | "pdf" | "xlsx";
|
|
1388
|
+
|
|
1389
|
+
declare type OutputFormat_2 = "dom" | "canvas" | "pdf" | "xlsx";
|
|
1390
|
+
|
|
1042
1391
|
declare interface PaginateOptions {
|
|
1043
1392
|
/** 每行额外占高(mm),压测专用钩子 */
|
|
1044
1393
|
mmPerRow?: number;
|
|
1045
1394
|
/** 文本测量器(默认启发式;浏览器端可注入 canvas 测量校准) */
|
|
1046
1395
|
measurer?: TextMeasurer;
|
|
1396
|
+
/** 可选页数上限;在追加超限页前终止,避免先分配全部页面再检查。 */
|
|
1397
|
+
maxPages?: number;
|
|
1047
1398
|
}
|
|
1048
1399
|
|
|
1049
1400
|
/** PDF 导出器:RenderPlan → PDF 字节;第二参数可上报非致命保真告警。 */
|
|
@@ -1076,6 +1427,8 @@ declare interface PlanComponent {
|
|
|
1076
1427
|
lines?: string[];
|
|
1077
1428
|
richParagraphs?: RichParagraph[];
|
|
1078
1429
|
imageData?: string;
|
|
1430
|
+
/** 明确指定线段方向;省略保持历史水平线行为。 */
|
|
1431
|
+
lineDirection?: "down" | "up";
|
|
1079
1432
|
grid?: PlanGrid;
|
|
1080
1433
|
table?: PlanTableFragment;
|
|
1081
1434
|
style?: ComponentStyle;
|
|
@@ -1097,6 +1450,8 @@ declare interface PlanComponent_2 {
|
|
|
1097
1450
|
lines?: string[];
|
|
1098
1451
|
richParagraphs?: RichParagraph_2[];
|
|
1099
1452
|
imageData?: string;
|
|
1453
|
+
/** 明确指定线段方向;省略保持历史水平线行为。 */
|
|
1454
|
+
lineDirection?: "down" | "up";
|
|
1100
1455
|
grid?: PlanGrid_2;
|
|
1101
1456
|
table?: PlanTableFragment_2;
|
|
1102
1457
|
style?: ComponentStyle_2;
|
|
@@ -1118,6 +1473,8 @@ declare interface PlanComponent_3 {
|
|
|
1118
1473
|
lines?: string[];
|
|
1119
1474
|
richParagraphs?: RichParagraph_3[];
|
|
1120
1475
|
imageData?: string;
|
|
1476
|
+
/** 明确指定线段方向;省略保持历史水平线行为。 */
|
|
1477
|
+
lineDirection?: "down" | "up";
|
|
1121
1478
|
grid?: PlanGrid_3;
|
|
1122
1479
|
table?: PlanTableFragment_3;
|
|
1123
1480
|
style?: ComponentStyle_3;
|
|
@@ -1184,6 +1541,8 @@ declare interface PlanTableFragment {
|
|
|
1184
1541
|
columnKeys: string[];
|
|
1185
1542
|
layout?: "page" | "wide";
|
|
1186
1543
|
title?: string;
|
|
1544
|
+
/** 只有宿主声明稳定 rowKey 时生成,不能用显示顺序替代业务主键。 */
|
|
1545
|
+
source?: Omit<ReportCellSource, "field" | "rowKey"> & { rowKey?: string | number };
|
|
1187
1546
|
}
|
|
1188
1547
|
|
|
1189
1548
|
/** 列表的逻辑行来源;用于连续 Excel 重组,避免按文本猜测重复表头。 */
|
|
@@ -1197,6 +1556,10 @@ declare interface PlanTableFragment_2 {
|
|
|
1197
1556
|
columnKeys: string[];
|
|
1198
1557
|
layout?: "page" | "wide";
|
|
1199
1558
|
title?: string;
|
|
1559
|
+
/** 只有宿主声明稳定 rowKey 时生成,不能用显示顺序替代业务主键。 */
|
|
1560
|
+
source?: Omit<ReportCellSource_2, "field" | "rowKey"> & {
|
|
1561
|
+
rowKey?: string | number;
|
|
1562
|
+
};
|
|
1200
1563
|
}
|
|
1201
1564
|
|
|
1202
1565
|
/** 列表的逻辑行来源;用于连续 Excel 重组,避免按文本猜测重复表头。 */
|
|
@@ -1210,6 +1573,10 @@ declare interface PlanTableFragment_3 {
|
|
|
1210
1573
|
columnKeys: string[];
|
|
1211
1574
|
layout?: "page" | "wide";
|
|
1212
1575
|
title?: string;
|
|
1576
|
+
/** 只有宿主声明稳定 rowKey 时生成,不能用显示顺序替代业务主键。 */
|
|
1577
|
+
source?: Omit<ReportCellSource_3, "field" | "rowKey"> & {
|
|
1578
|
+
rowKey?: string | number;
|
|
1579
|
+
};
|
|
1213
1580
|
}
|
|
1214
1581
|
|
|
1215
1582
|
/** 预取组件分片(路由 hover / 空闲时调用,正式渲染零等待) */
|
|
@@ -1220,8 +1587,6 @@ declare interface RenderPlan {
|
|
|
1220
1587
|
pages: PlanPage[];
|
|
1221
1588
|
}
|
|
1222
1589
|
|
|
1223
|
-
declare const REPORT_PREVIEW_TOOLS: readonly ["search", "thumbnails", "zoom", ...ReportExportFormat[], "print", "pdfWindow", "editing", "import"];
|
|
1224
|
-
|
|
1225
1590
|
/** 预览中的物理坐标;合并单元格使用左上角坐标。 */
|
|
1226
1591
|
declare interface ReportCellAddress {
|
|
1227
1592
|
pageIndex: number;
|
|
@@ -1239,12 +1604,14 @@ declare interface ReportCellAddress_2 {
|
|
|
1239
1604
|
}
|
|
1240
1605
|
|
|
1241
1606
|
declare interface ReportCellContext {
|
|
1242
|
-
address:
|
|
1607
|
+
address: ReportCellAddress_2;
|
|
1243
1608
|
cell: Readonly<GridCell_2>;
|
|
1244
1609
|
component: Readonly<PlanComponent_2>;
|
|
1245
|
-
value:
|
|
1610
|
+
value: ReportCellValue_2;
|
|
1246
1611
|
valueType: ReportCellValueType;
|
|
1247
|
-
table?:
|
|
1612
|
+
table?: ReportCellTableIdentity_2;
|
|
1613
|
+
/** Stable business identity. Physical row indices must never be used as database keys. */
|
|
1614
|
+
source?: Readonly<ReportCellSource_2>;
|
|
1248
1615
|
editable: boolean;
|
|
1249
1616
|
readOnlyReason?: ReportCellReadOnlyReason;
|
|
1250
1617
|
}
|
|
@@ -1252,6 +1619,7 @@ declare interface ReportCellContext {
|
|
|
1252
1619
|
declare interface ReportCellEdit {
|
|
1253
1620
|
address: ReportCellAddress;
|
|
1254
1621
|
table?: ReportCellTableIdentity;
|
|
1622
|
+
source?: Readonly<ReportCellSource>;
|
|
1255
1623
|
previousValue: ReportCellValue;
|
|
1256
1624
|
previousText: string;
|
|
1257
1625
|
value: ReportCellValue;
|
|
@@ -1261,6 +1629,7 @@ declare interface ReportCellEdit {
|
|
|
1261
1629
|
declare interface ReportCellEdit_2 {
|
|
1262
1630
|
address: ReportCellAddress_2;
|
|
1263
1631
|
table?: ReportCellTableIdentity_2;
|
|
1632
|
+
source?: Readonly<ReportCellSource_2>;
|
|
1264
1633
|
previousValue: ReportCellValue_2;
|
|
1265
1634
|
previousText: string;
|
|
1266
1635
|
value: ReportCellValue_2;
|
|
@@ -1269,11 +1638,43 @@ declare interface ReportCellEdit_2 {
|
|
|
1269
1638
|
|
|
1270
1639
|
declare type ReportCellReadOnlyReason = "cell" | "formula" | "complex" | "structure";
|
|
1271
1640
|
|
|
1641
|
+
declare interface ReportCellSelection {
|
|
1642
|
+
anchor: ReportCellAddress;
|
|
1643
|
+
focus: ReportCellAddress;
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
/** 可持久化的业务身份与计划坐标独立;权限及并发校验仍由业务服务器执行。 */
|
|
1647
|
+
declare interface ReportCellSource {
|
|
1648
|
+
datasetId: string;
|
|
1649
|
+
rowKey: string | number;
|
|
1650
|
+
field: string;
|
|
1651
|
+
revision?: string | number;
|
|
1652
|
+
sourceToken?: string;
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
/** 可持久化的业务身份与计划坐标独立;权限及并发校验仍由业务服务器执行。 */
|
|
1656
|
+
declare interface ReportCellSource_2 {
|
|
1657
|
+
datasetId: string;
|
|
1658
|
+
rowKey: string | number;
|
|
1659
|
+
field: string;
|
|
1660
|
+
revision?: string | number;
|
|
1661
|
+
sourceToken?: string;
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
/** 可持久化的业务身份与计划坐标独立;权限及并发校验仍由业务服务器执行。 */
|
|
1665
|
+
declare interface ReportCellSource_3 {
|
|
1666
|
+
datasetId: string;
|
|
1667
|
+
rowKey: string | number;
|
|
1668
|
+
field: string;
|
|
1669
|
+
revision?: string | number;
|
|
1670
|
+
sourceToken?: string;
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1272
1673
|
declare interface ReportCellTableIdentity {
|
|
1273
1674
|
id: string;
|
|
1274
1675
|
/** 逻辑表行索引;跨分页的同一行保持不变。 */
|
|
1275
1676
|
rowIndex: number;
|
|
1276
|
-
role:
|
|
1677
|
+
role: PlanTableFragment["role"];
|
|
1277
1678
|
columnKey?: string;
|
|
1278
1679
|
}
|
|
1279
1680
|
|
|
@@ -1281,7 +1682,7 @@ declare interface ReportCellTableIdentity_2 {
|
|
|
1281
1682
|
id: string;
|
|
1282
1683
|
/** 逻辑表行索引;跨分页的同一行保持不变。 */
|
|
1283
1684
|
rowIndex: number;
|
|
1284
|
-
role:
|
|
1685
|
+
role: PlanTableFragment_2["role"];
|
|
1285
1686
|
columnKey?: string;
|
|
1286
1687
|
}
|
|
1287
1688
|
|
|
@@ -1297,23 +1698,58 @@ declare interface ReportDefinition {
|
|
|
1297
1698
|
/** 静态数据;load 存在时优先使用 load 的结果。 */
|
|
1298
1699
|
datasets?: DatasetRows;
|
|
1299
1700
|
load?: (context: ReportLoadContext) => DatasetRows | Promise<DatasetRows>;
|
|
1701
|
+
/** 可选统一适配器;load 存在时仍优先 load,兼容已有定义。 */
|
|
1702
|
+
provider?: ReportProvider;
|
|
1703
|
+
/** 可选业务数据契约;声明的数据集缺失或字段不合法时,在分页前给出结构化错误。 */
|
|
1704
|
+
dataSchema?: Record<string, DatasetContract>;
|
|
1705
|
+
dataValidation?: Pick<DatasetValidationOptions, "maxRows" | "maxCells" | "maxIssues">;
|
|
1300
1706
|
/** 覆盖模板参数定义;动态模板应在此声明查询面板元数据,避免查询前先请求模板。 */
|
|
1301
1707
|
params?: ReportParamDef[];
|
|
1302
1708
|
pagination?: PaginateOptions;
|
|
1303
1709
|
}
|
|
1304
1710
|
|
|
1711
|
+
declare interface ReportDiagnostic { code: string; message: string; path?: string; severity: "warning" | "error" | "info" }
|
|
1712
|
+
|
|
1713
|
+
declare interface ReportEditBatch {
|
|
1714
|
+
/** Idempotency identity; the server should bind it to the exact payload. */
|
|
1715
|
+
requestId: string;
|
|
1716
|
+
edits: ReportCellEdit_2[];
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
declare interface ReportEditConflict {
|
|
1720
|
+
source?: Readonly<ReportCellSource_2>;
|
|
1721
|
+
address?: ReportCellAddress_2;
|
|
1722
|
+
message: string;
|
|
1723
|
+
currentValue?: ReportCellValue_2;
|
|
1724
|
+
revision?: string | number;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1305
1727
|
/** Opt in with true for local drafts, or provide host validation and persistence. */
|
|
1306
1728
|
declare interface ReportEditingOptions {
|
|
1307
1729
|
canEdit?(context: ReportCellContext): boolean;
|
|
1308
1730
|
/** Return an error message or throw to reject the edit. */
|
|
1309
|
-
validate?(edit: Readonly<
|
|
1731
|
+
validate?(edit: Readonly<ReportCellEdit_2>, operation: ReportEditOperation): void | string | Promise<void | string>;
|
|
1310
1732
|
/** Called before applying the change. A rejection leaves the current report untouched. */
|
|
1311
|
-
save?(edit: Readonly<
|
|
1733
|
+
save?(edit: Readonly<ReportCellEdit_2>, operation: ReportEditOperation): void | ReportEditResult | Promise<void | ReportEditResult>;
|
|
1734
|
+
/** Must commit all edits in one server transaction. Required for multi-cell persisted edits. */
|
|
1735
|
+
saveBatch?(batch: Readonly<ReportEditBatch>, operation: ReportEditOperation): void | ReportEditResult | Promise<void | ReportEditResult>;
|
|
1736
|
+
/** Restrict persistence to plans that supply stable datasetId/rowKey/field metadata. */
|
|
1737
|
+
requireSource?: boolean;
|
|
1312
1738
|
}
|
|
1313
1739
|
|
|
1314
1740
|
declare interface ReportEditOperation {
|
|
1315
1741
|
/** Reload, another import or unmount aborts the operation. Save adapters should forward this signal. */
|
|
1316
1742
|
signal: AbortSignal;
|
|
1743
|
+
requestId?: string;
|
|
1744
|
+
action?: "edit" | "undo" | "redo" | "restore";
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
declare interface ReportEditResult {
|
|
1748
|
+
/** A successful result may advance concurrency tokens for the affected dataset. */
|
|
1749
|
+
revision?: string | number;
|
|
1750
|
+
sourceToken?: string;
|
|
1751
|
+
/** Any conflict rejects the entire client batch. A server must also transact atomically. */
|
|
1752
|
+
conflicts?: readonly ReportEditConflict[];
|
|
1317
1753
|
}
|
|
1318
1754
|
|
|
1319
1755
|
/** 报表含表头但业务行为空时,由接入方明确声明;组件不推测业务数据。 */
|
|
@@ -1337,6 +1773,35 @@ declare interface ReportFetchInput {
|
|
|
1337
1773
|
signal?: AbortSignal;
|
|
1338
1774
|
/** 本次分页与计划告警;未提供时使用数据源配置的告警通道。 */
|
|
1339
1775
|
onWarning?: (message: string) => void;
|
|
1776
|
+
onQueryResult?: (reportId: string, result: ReportQueryResult) => void;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
declare interface ReportFieldContract {
|
|
1780
|
+
field: string;
|
|
1781
|
+
label?: string;
|
|
1782
|
+
type: "text" | "number" | "boolean" | "date" | "decimal";
|
|
1783
|
+
required?: boolean;
|
|
1784
|
+
nullable?: boolean;
|
|
1785
|
+
enum?: readonly (string | number | boolean)[];
|
|
1786
|
+
min?: number; max?: number;
|
|
1787
|
+
minLength?: number; maxLength?: number;
|
|
1788
|
+
semanticRole?: "identifier" | "dimension" | "measure" | "date" | "text";
|
|
1789
|
+
unit?: string;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
declare interface ReportFieldTarget {
|
|
1793
|
+
field: string;
|
|
1794
|
+
datasetId?: string;
|
|
1795
|
+
rowKey?: string | number;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
declare interface ReportInteractionOptions {
|
|
1799
|
+
/** Screen-only frozen panes; exported geometry is unchanged. */
|
|
1800
|
+
freezeHeaders?: boolean;
|
|
1801
|
+
/** Leading identity columns, from 0 to 20. */
|
|
1802
|
+
frozenColumns?: number;
|
|
1803
|
+
/** Show workbook sheets / report sections when available. Default true. */
|
|
1804
|
+
navigation?: boolean;
|
|
1340
1805
|
}
|
|
1341
1806
|
|
|
1342
1807
|
/** 取数与排版共同使用的请求上下文;取消只影响本次调用。 */
|
|
@@ -1358,6 +1823,11 @@ declare interface ReportParamDef {
|
|
|
1358
1823
|
defaultValue?: string;
|
|
1359
1824
|
required?: boolean;
|
|
1360
1825
|
placeholder?: string;
|
|
1826
|
+
/** 数字上下界;date 参数使用 YYYY-MM-DD 字符串(含边界)。 */
|
|
1827
|
+
min?: number | string;
|
|
1828
|
+
max?: number | string;
|
|
1829
|
+
minLength?: number;
|
|
1830
|
+
maxLength?: number;
|
|
1361
1831
|
}
|
|
1362
1832
|
|
|
1363
1833
|
/** 报表参数定义(声明式,模板自描述参数面:渲染组件据此生成查询面板) */
|
|
@@ -1375,14 +1845,69 @@ declare interface ReportParamDef_2 {
|
|
|
1375
1845
|
defaultValue?: string;
|
|
1376
1846
|
required?: boolean;
|
|
1377
1847
|
placeholder?: string;
|
|
1848
|
+
/** 数字上下界;date 参数使用 YYYY-MM-DD 字符串(含边界)。 */
|
|
1849
|
+
min?: number | string;
|
|
1850
|
+
max?: number | string;
|
|
1851
|
+
minLength?: number;
|
|
1852
|
+
maxLength?: number;
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
declare interface ReportParamIssue { code: ReportParamIssueCode; path: string; field: string; message: string }
|
|
1856
|
+
|
|
1857
|
+
declare type ReportParamIssueCode = "definition" | "required" | "type" | "option" | "minimum" | "maximum" | "minLength" | "maxLength";
|
|
1858
|
+
|
|
1859
|
+
declare interface ReportPreferencesAdapter {
|
|
1860
|
+
load(key: string): Partial<ReportPreviewPreferences> | null | Promise<Partial<ReportPreviewPreferences> | null>;
|
|
1861
|
+
save(key: string, value: Readonly<Partial<ReportPreviewPreferences>>): void | Promise<void>;
|
|
1862
|
+
remove?(key: string): void | Promise<void>;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
declare interface ReportPreferencesOptions {
|
|
1866
|
+
/** Host-scoped key; do not share one key between unrelated users/tenants. */
|
|
1867
|
+
key: string;
|
|
1868
|
+
adapter: ReportPreferencesAdapter;
|
|
1378
1869
|
}
|
|
1379
1870
|
|
|
1380
1871
|
declare type ReportPreviewPreferences = Record<ReportPreviewTool, boolean>;
|
|
1381
1872
|
|
|
1382
|
-
declare type ReportPreviewTool =
|
|
1873
|
+
declare type ReportPreviewTool = "search" | "thumbnails" | "zoom" | ReportExportFormat | "print" | "pdfWindow" | "editing" | "import";
|
|
1874
|
+
|
|
1875
|
+
/** 查询是唯一基础能力;权限、HTTP、数据库和事务都留在宿主适配器内。 */
|
|
1876
|
+
declare interface ReportProvider {
|
|
1877
|
+
query(context: ReportLoadContext): ReportQueryResult | Promise<ReportQueryResult>;
|
|
1878
|
+
save?(input: ReportSaveInput): ReportSaveResult | Promise<ReportSaveResult>;
|
|
1879
|
+
export?(input: ReportProviderExportInput): ReportProviderExportResult | Promise<ReportProviderExportResult>;
|
|
1880
|
+
templates?: ReportTemplateProvider;
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
declare interface ReportProviderExportInput extends ReportLoadContext { format: "pdf" | "xlsx" }
|
|
1884
|
+
|
|
1885
|
+
declare interface ReportProviderExportResult { bytes: Uint8Array; contentType: string; fileName?: string; diagnostics?: ReportDiagnostic[] }
|
|
1886
|
+
|
|
1887
|
+
declare interface ReportQueryResult {
|
|
1888
|
+
datasets: DatasetRows;
|
|
1889
|
+
revision?: string;
|
|
1890
|
+
sourceToken?: string;
|
|
1891
|
+
diagnostics?: ReportDiagnostic[];
|
|
1892
|
+
}
|
|
1383
1893
|
|
|
1384
1894
|
declare type ReportRegistry = Record<string, ReportDefinition>;
|
|
1385
1895
|
|
|
1896
|
+
declare interface ReportSaveInput extends ReportLoadContext {
|
|
1897
|
+
requestId: string;
|
|
1898
|
+
expectedRevision?: string;
|
|
1899
|
+
sourceToken?: string;
|
|
1900
|
+
edits: readonly ReportCellEdit[];
|
|
1901
|
+
action?: "edit" | "undo" | "redo" | "restore";
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
declare interface ReportSaveResult {
|
|
1905
|
+
revision: string;
|
|
1906
|
+
sourceToken?: string;
|
|
1907
|
+
conflicts?: Array<{ editIndex: number; code: string; message: string }>;
|
|
1908
|
+
diagnostics?: ReportDiagnostic[];
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1386
1911
|
declare interface ReportTemplate {
|
|
1387
1912
|
schemaVersion?: string;
|
|
1388
1913
|
/** 参数定义(可选;宿主也可经 ReportPreview 的 paramDefs prop 提供,prop 优先) */
|
|
@@ -1397,8 +1922,26 @@ declare interface ReportTemplate_2 {
|
|
|
1397
1922
|
pages: TemplatePage_2[];
|
|
1398
1923
|
}
|
|
1399
1924
|
|
|
1925
|
+
/** 可存入数据库/文件的纯 JSON 模板;数据、接口与鉴权仍由宿主提供。 */
|
|
1926
|
+
declare interface ReportTemplateDocument {
|
|
1927
|
+
schemaVersion: "1.0";
|
|
1928
|
+
id: string;
|
|
1929
|
+
name: string;
|
|
1930
|
+
/** 宿主的发布版本/乐观锁标识,不由引擎自动递增。 */
|
|
1931
|
+
revision?: string;
|
|
1932
|
+
description?: string;
|
|
1933
|
+
template: ReportTemplate;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1400
1936
|
declare type ReportTemplateLoader = (context: ReportLoadContext) => ReportTemplate | Promise<ReportTemplate>;
|
|
1401
1937
|
|
|
1938
|
+
declare interface ReportTemplateProvider {
|
|
1939
|
+
list(context: { signal?: AbortSignal }): Promise<ReportTemplateSummary[]>;
|
|
1940
|
+
get(id: string, context: { signal?: AbortSignal }): Promise<ReportTemplateDocument | undefined>;
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
declare type ReportTemplateSummary = Omit<ReportTemplateDocument, "template">;
|
|
1944
|
+
|
|
1402
1945
|
declare interface RichParagraph {
|
|
1403
1946
|
segments: RichSegment[];
|
|
1404
1947
|
align?: ComponentStyle["align"];
|
|
@@ -1507,7 +2050,9 @@ declare interface TemplatePage_2 {
|
|
|
1507
2050
|
|
|
1508
2051
|
declare interface TextMeasureOptions {
|
|
1509
2052
|
fontSizePt: number;
|
|
2053
|
+
fontFamily?: string;
|
|
1510
2054
|
bold?: boolean;
|
|
2055
|
+
italic?: boolean;
|
|
1511
2056
|
letterSpacingPt?: number;
|
|
1512
2057
|
}
|
|
1513
2058
|
|
|
@@ -1524,7 +2069,7 @@ declare interface TextMeasurer {
|
|
|
1524
2069
|
* 目标是"财务能直接用的对账表"而非复刻版面)
|
|
1525
2070
|
* - 未支持组件、富文本专有内容与单元格嵌套组件跳过并计入 warnings
|
|
1526
2071
|
*/
|
|
1527
|
-
declare interface XlsxRenderOptions {
|
|
2072
|
+
declare interface XlsxRenderOptions extends OutputDiagnosticOptions_2 {
|
|
1528
2073
|
/** 工作表命名(连续表默认使用标题,其余默认 "Sheet1" 起序)。 */
|
|
1529
2074
|
sheetName?: (sheetIndex: number) => string;
|
|
1530
2075
|
/** auto 默认将 wide 逻辑表合并为连续 Sheet;pages 保留逐页;continuous 要求明确的表来源。 */
|