@agile-team/mach-report 2.19.0 → 2.20.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 (54) hide show
  1. package/README.md +19 -4
  2. package/dist/ExcelBindingWizard-B7aeRg46.cjs +1 -0
  3. package/dist/{ExcelBindingWizard-xJIYmnZ_.js → ExcelBindingWizard-Chn6ZC2-.js} +350 -350
  4. package/dist/ParamEditor-BdFMa1CX.cjs +1 -0
  5. package/dist/{ParamEditor-D1wWemaf.js → ParamEditor-o-7E7WZZ.js} +10 -10
  6. package/dist/{ReportBatchPanel-B88R-fME.js → ReportBatchPanel-CNJ4Useq.js} +2 -2
  7. package/dist/{ReportBatchPanel-BkJFqeEW.cjs → ReportBatchPanel-DVpmB7tG.cjs} +1 -1
  8. package/dist/ReportLabelStudio-Drsm9sAS.cjs +1 -0
  9. package/dist/ReportLabelStudio-r8VFnhGQ.js +589 -0
  10. package/dist/ReportParamPanel-CVpK8mFc.cjs +1 -0
  11. package/dist/{ReportParamPanel-mQkeN70Q.js → ReportParamPanel-peB-KEmm.js} +10 -2
  12. package/dist/{ReportPreview-BUr8GQUW.js → ReportPreview-CGcxwkAn.js} +2255 -2133
  13. package/dist/ReportPreview-hlwvZ1wf.cjs +6 -0
  14. package/dist/{ReportTemplateLibrary-BOh2MgjQ.cjs → ReportTemplateLibrary-DjjyZnZB.cjs} +1 -1
  15. package/dist/{ReportTemplateLibrary-BGELmgd3.js → ReportTemplateLibrary-DyIJhJjX.js} +1 -1
  16. package/dist/RuleEditor-BVuRn_OQ.cjs +1 -0
  17. package/dist/{RuleEditor-CoLqgehG.js → RuleEditor-BeknHHOD.js} +176 -172
  18. package/dist/{TemplateOutlinePanel-DU95loB-.js → TemplateOutlinePanel-Bv8CxbXS.js} +1 -1
  19. package/dist/{TemplateOutlinePanel-DiG8tRRe.cjs → TemplateOutlinePanel-D6TXg1aV.cjs} +1 -1
  20. package/dist/{TemplateReusePanel-DE1KSD6c.js → TemplateReusePanel-CfousvPY.js} +1 -1
  21. package/dist/{TemplateReusePanel-G-Y299wc.cjs → TemplateReusePanel-wrSbd_mr.cjs} +1 -1
  22. package/dist/{TemplateReviewPanel-KQx9ts0D.cjs → TemplateReviewPanel-BKFcSbTh.cjs} +1 -1
  23. package/dist/{TemplateReviewPanel-vqFJ_Y9o.js → TemplateReviewPanel-F2tqWNLO.js} +1 -1
  24. package/dist/artifact-integrity.json +36 -36
  25. package/dist/designer-B52ddmHO.js +6676 -0
  26. package/dist/designer-Dtsw_rh7.cjs +2 -0
  27. package/dist/designer.cjs +1 -1
  28. package/dist/designer.d.cts +142 -5
  29. package/dist/designer.d.ts +142 -5
  30. package/dist/designer.js +1 -1
  31. package/dist/{plugin-4VuL38Nc.cjs → plugin-BMsIIJDh.cjs} +1 -1
  32. package/dist/{plugin-YWHcI3t4.js → plugin-Co1oKD7T.js} +1 -1
  33. package/dist/sbom.cdx.json +1 -1
  34. package/dist/server.cjs +1 -1
  35. package/dist/server.js +1 -1
  36. package/dist/style.css +1 -1
  37. package/dist/vue/async.d.cts +8 -0
  38. package/dist/vue/async.d.ts +8 -0
  39. package/dist/vue/index.d.cts +10 -2
  40. package/dist/vue/index.d.ts +10 -2
  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 +5 -5
  45. package/package.json +1 -1
  46. package/dist/ExcelBindingWizard-UHSApSG9.cjs +0 -1
  47. package/dist/ParamEditor-BZb-okUd.cjs +0 -1
  48. package/dist/ReportLabelStudio-B4WZ2XNN.js +0 -239
  49. package/dist/ReportLabelStudio-BN-fYNCr.cjs +0 -1
  50. package/dist/ReportParamPanel-sOANVRz-.cjs +0 -1
  51. package/dist/ReportPreview-D7PvKzs3.cjs +0 -6
  52. package/dist/RuleEditor-XaLcCdTb.cjs +0 -1
  53. package/dist/designer-CyKXBhQg.cjs +0 -2
  54. package/dist/designer-fVvpYg8H.js +0 -5824
package/dist/designer.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("vue");const E=require("./designer-CyKXBhQg.cjs");exports.COLUMN_VISUAL_MESSAGES=E.COLUMN_VISUAL_MESSAGES;exports.ChartBindingInspector=E.ChartBindingInspector;exports.ColumnVisualEditor=E.ColumnVisualEditor;exports.DESIGNER_GUIDE_MESSAGES=E.DESIGNER_GUIDE_MESSAGES;exports.EXCEL_BINDING_MESSAGES=E.EXCEL_BINDING_MESSAGES;exports.ExcelBindingWizard=E.ExcelBindingWizard;exports.LABEL_STUDIO_MESSAGES=E.LABEL_STUDIO_MESSAGES;exports.PARAM_EDITOR_MESSAGES=E.PARAM_EDITOR_MESSAGES;exports.ParamEditor=E.ParamEditor;exports.REPORT_BATCH_MESSAGES=E.REPORT_BATCH_MESSAGES;exports.RULE_EDITOR_MESSAGES=E.DEFAULT_RULE_EDITOR_MESSAGES;exports.ReportBatchPanel=E.ReportBatchPanel;exports.ReportLabelStudio=E.ReportLabelStudio;exports.ReportTemplateEditor=E.ReportTemplateEditor;exports.ReportTemplateLibrary=E.ReportTemplateLibrary;exports.RuleEditor=E.RuleEditor;exports.TEMPLATE_EDITOR_MESSAGES=E.TEMPLATE_EDITOR_MESSAGES;exports.TEMPLATE_LIBRARY_MESSAGES=E.TEMPLATE_LIBRARY_MESSAGES;exports.TEMPLATE_PRODUCT_MESSAGES=E.TEMPLATE_PRODUCT_MESSAGES;exports.TEMPLATE_RECOVERY_MESSAGES=E.TEMPLATE_RECOVERY_MESSAGES;exports.TEMPLATE_REVIEW_MESSAGES=E.TEMPLATE_REVIEW_MESSAGES;exports.TemplateOutlinePanel=E.TemplateOutlinePanel;exports.TemplateReusePanel=E.TemplateReusePanel;exports.TemplateReviewPanel=E.TemplateReviewPanel;exports.createTemplateDraftStorage=E.createTemplateDraftStorage;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("vue");const E=require("./designer-Dtsw_rh7.cjs");exports.COLUMN_VISUAL_MESSAGES=E.COLUMN_VISUAL_MESSAGES;exports.ChartBindingInspector=E.ChartBindingInspector;exports.ColumnVisualEditor=E.ColumnVisualEditor;exports.DESIGNER_GUIDE_MESSAGES=E.DESIGNER_GUIDE_MESSAGES;exports.EXCEL_BINDING_MESSAGES=E.EXCEL_BINDING_MESSAGES;exports.ExcelBindingWizard=E.ExcelBindingWizard;exports.LABEL_STUDIO_MESSAGES=E.LABEL_STUDIO_MESSAGES;exports.PARAM_EDITOR_MESSAGES=E.PARAM_EDITOR_MESSAGES;exports.ParamEditor=E.ParamEditor;exports.REPORT_BATCH_MESSAGES=E.REPORT_BATCH_MESSAGES;exports.RULE_EDITOR_MESSAGES=E.DEFAULT_RULE_EDITOR_MESSAGES;exports.ReportBatchPanel=E.ReportBatchPanel;exports.ReportLabelStudio=E.ReportLabelStudio;exports.ReportTemplateEditor=E.ReportTemplateEditor;exports.ReportTemplateLibrary=E.ReportTemplateLibrary;exports.RuleEditor=E.RuleEditor;exports.TEMPLATE_EDITOR_MESSAGES=E.TEMPLATE_EDITOR_MESSAGES;exports.TEMPLATE_LIBRARY_MESSAGES=E.TEMPLATE_LIBRARY_MESSAGES;exports.TEMPLATE_PRODUCT_MESSAGES=E.TEMPLATE_PRODUCT_MESSAGES;exports.TEMPLATE_RECOVERY_MESSAGES=E.TEMPLATE_RECOVERY_MESSAGES;exports.TEMPLATE_REVIEW_MESSAGES=E.TEMPLATE_REVIEW_MESSAGES;exports.TemplateOutlinePanel=E.TemplateOutlinePanel;exports.TemplateReusePanel=E.TemplateReusePanel;exports.TemplateReviewPanel=E.TemplateReviewPanel;exports.createTemplateDraftStorage=E.createTemplateDraftStorage;
@@ -483,9 +483,45 @@ export declare const DESIGNER_GUIDE_MESSAGES: {
483
483
  readonly reviewHint: "校验字段依赖、样例结果与输出限制";
484
484
  readonly result: "预览确认效果后保存模板;高级 JSON 保留给需要时使用。";
485
485
  };
486
+ declare const DESIGNER_INSERT_MESSAGES: {
487
+ readonly add: "添加内容";
488
+ readonly title: "添加到当前版面";
489
+ readonly text: "说明文字";
490
+ readonly textHint: "添加标题、备注或说明";
491
+ readonly field: "业务字段";
492
+ readonly columnField: "添加表格字段";
493
+ readonly fieldHint: "选择字段后立即显示真实内容";
494
+ readonly image: "图片或 Logo";
495
+ readonly imageHint: "使用 PNG 或 JPEG 图片";
496
+ readonly qrcode: "二维码";
497
+ readonly barcode: "条形码";
498
+ readonly codeHint: "绑定记录编号或填写编码内容";
499
+ readonly list: "明细表";
500
+ readonly listHint: "从当前字段契约建立表格";
501
+ readonly chart: "图表";
502
+ readonly recordCount: "记录数";
503
+ readonly chartHint: "选择分类与数值字段";
504
+ readonly rect: "装饰色块";
505
+ readonly rectHint: "辅助分区与突出信息";
506
+ readonly search: "搜索业务字段";
507
+ readonly noFields: "没有匹配的字段";
508
+ readonly close: "关闭添加内容";
509
+ readonly back: "返回内容类型";
510
+ readonly duplicate: "复制组件";
511
+ readonly newPage: "当前版面空间不足或含动态明细,内容已放到新增版面,可撤销恢复。";
512
+ readonly addColumn: "添加字段列";
513
+ readonly removeColumn: "删除当前列";
514
+ readonly removeLast: "至少保留一列";
515
+ readonly dependentColumn: "此字段仍被合计、规则或表头引用,请先调整相关配置。";
516
+ readonly assetPending: "请完成图片或编码内容配置,再预览或保存。";
517
+ readonly fieldsUnavailable: "当前模板尚无可绑定的数据字段。";
518
+ };
486
519
  export declare type DesignerGuideMessages = {
487
520
  [K in keyof typeof DESIGNER_GUIDE_MESSAGES]: string;
488
521
  };
522
+ export declare type DesignerInsertMessages = {
523
+ [K in keyof typeof DESIGNER_INSERT_MESSAGES]: string;
524
+ };
489
525
  /** Optional wizard labels remain independent of the general designer configuration. */
490
526
  export declare const EXCEL_BINDING_MESSAGES: {
491
527
  recoveredMapping: string;
@@ -934,9 +970,10 @@ export declare const LABEL_STUDIO_MESSAGES: {
934
970
  readonly faces: "个版面";
935
971
  readonly labels: "张标签";
936
972
  readonly session: "当前会话模板";
937
- readonly flow: "选择记录 → 设计标签 → 预览并打印";
973
+ readonly flow: "成品预览 · 按记录生成";
974
+ readonly designHint: "设计使用前 3 条样本 · 完整记录用于预览和打印";
938
975
  readonly guide: "使用指引";
939
- readonly help: "在画布点选文字或码图,再设置绑定字段;在“模板”中调整纸张与份数。";
976
+ readonly help: "先选成品样式与显示字段即可使用。需要追加内容或自由排版时,进入设计标签。";
940
977
  readonly size: "纸张与份数";
941
978
  readonly bindings: "字段与码图";
942
979
  readonly count: "条记录";
@@ -946,18 +983,55 @@ export declare const LABEL_STUDIO_MESSAGES: {
946
983
  readonly printHint: "先试打一张,使用同规格纸张与 100% 比例核对尺寸和扫码。";
947
984
  readonly empty: "暂无可打印记录";
948
985
  readonly save: "保存标签模板";
986
+ readonly layout: "成品样式";
987
+ readonly materialPreset: "物料卡";
988
+ readonly pairedPreset: "双版标识";
989
+ readonly warehousePreset: "仓储标签";
990
+ readonly fields: "显示字段";
991
+ readonly findField: "查找业务字段";
992
+ readonly noFields: "没有匹配的字段";
993
+ readonly fieldLimit: "最多显示 5 个字段,取消已选项后可继续选择。";
994
+ readonly removeField: "取消字段";
995
+ readonly fieldSearchHint: "每次显示前 30 项,可搜索完整字段目录。";
996
+ readonly brand: "标题与品牌";
997
+ readonly brandName: "主标题";
998
+ readonly brandTagline: "副标题(可选)";
999
+ readonly applyLayout: "更新标签";
1000
+ readonly restoreConfiguration: "还原轻配置";
1001
+ readonly choosePreset: "请选择成品样式后更新标签,或还原轻配置继续使用当前模板。";
1002
+ readonly discardTitle: "保留标签修改";
1003
+ readonly discardDescription: "标签设计或轻配置存在未保存的修改,继续将丢弃这些修改。";
1004
+ readonly keepEditing: "继续编辑";
1005
+ readonly discard: "丢弃并继续";
1006
+ readonly reflowHint: "按所选样式重新排版,可在设计中撤销恢复。";
1007
+ readonly customTemplate: "自定义模板";
1008
+ readonly readyTemplate: "成品模板 · 可直接打印";
949
1009
  };
950
1010
  /** Named business row interfaces and readonly arrays need no index signature or conversion. */
951
1011
  declare type LabelReportRows = readonly object[];
1012
+ export declare interface LabelStudioBrand {
1013
+ name?: string;
1014
+ tagline?: string;
1015
+ /** Portable image data shared by preview, PDF and image output. */
1016
+ logoData?: string;
1017
+ }
952
1018
  export declare interface LabelStudioController {
953
1019
  readonly busy?: boolean;
1020
+ readonly pendingLocalChanges?: boolean;
954
1021
  guardChanges(): Promise<boolean>;
955
1022
  prepare(): Promise<ReportTemplateDocument | undefined>;
956
1023
  }
1024
+ export declare interface LabelStudioLayout {
1025
+ preset?: LabelStudioPreset;
1026
+ brand?: LabelStudioBrand;
1027
+ fields?: readonly string[];
1028
+ }
957
1029
  export declare type LabelStudioMessages = {
958
1030
  [K in keyof typeof LABEL_STUDIO_MESSAGES]: string;
959
1031
  };
960
- export declare interface LabelStudioOptions {
1032
+ export declare interface LabelStudioOptions extends LabelStudioLayout {
1033
+ /** A host-owned completion action may replace the inner draft-save button. */
1034
+ showSave?: boolean;
961
1035
  rows: LabelReportRows;
962
1036
  schema: DatasetContract;
963
1037
  title?: string;
@@ -968,6 +1042,7 @@ export declare interface LabelStudioOptions {
968
1042
  beforeDiscard?: TemplateEditorOptions["beforeDiscard"];
969
1043
  messages?: Partial<LabelStudioMessages>;
970
1044
  }
1045
+ export declare type LabelStudioPreset = "material" | "paired" | "warehouse";
971
1046
  /** auto:真实数字/显式数值格式居右,日期与布尔居中,其他内容居左。 */
972
1047
  declare type ListAlignment = NonNullable<ComponentStyle["align"]> | "auto";
973
1048
  /** auto:真实数字/显式数值格式居右,日期与布尔居中,其他内容居左。 */
@@ -2534,6 +2609,14 @@ declare interface ReportCalculationMessages {
2534
2609
  calculationErrorDivision: string;
2535
2610
  calculationErrorOverflow: string;
2536
2611
  calculationErrorPrecision: string;
2612
+ calculationSummary?: string;
2613
+ calculationAdvanced?: string;
2614
+ calculationClose?: string;
2615
+ calculationPending?: string;
2616
+ calculationSummarySum?: string;
2617
+ calculationSummaryAverage?: string;
2618
+ calculationSummaryCount?: string;
2619
+ calculationMixedColumns?: string;
2537
2620
  }
2538
2621
  declare interface ReportCalculationMessages_2 {
2539
2622
  calculationTitle: string;
@@ -2563,6 +2646,14 @@ declare interface ReportCalculationMessages_2 {
2563
2646
  calculationErrorDivision: string;
2564
2647
  calculationErrorOverflow: string;
2565
2648
  calculationErrorPrecision: string;
2649
+ calculationSummary?: string;
2650
+ calculationAdvanced?: string;
2651
+ calculationClose?: string;
2652
+ calculationPending?: string;
2653
+ calculationSummarySum?: string;
2654
+ calculationSummaryAverage?: string;
2655
+ calculationSummaryCount?: string;
2656
+ calculationMixedColumns?: string;
2566
2657
  }
2567
2658
  declare interface ReportCandidateValidationOptions extends Pick<ReportDatasetValidationOptions, "rules" | "maxChecks" | "maxIssues"> {
2568
2659
  /** Warnings are visible and allowed by default; block explicitly when required by business policy. */
@@ -3193,11 +3284,14 @@ export declare const ReportLabelStudio: DefineComponent<LabelStudioOptions, {
3193
3284
  guardChanges: () => Promise<boolean>;
3194
3285
  prepare: () => Promise<ReportTemplateDocument_3 | undefined>;
3195
3286
  busy: boolean;
3287
+ pendingLocalChanges: boolean;
3196
3288
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
3197
3289
  "update:modelValue": (document: ReportTemplateDocument_3) => any;
3198
3290
  }, string, MachReportVuePublicProps, Readonly<LabelStudioOptions> & Readonly<{
3199
3291
  "onUpdate:modelValue"?: ((document: ReportTemplateDocument_3) => any) | undefined;
3200
- }>, {}>;
3292
+ }>, {
3293
+ showSave: boolean;
3294
+ }>;
3201
3295
  declare interface ReportOutputOptions {
3202
3296
  /** warn preserves supported output and shows diagnostics; strict rejects known fidelity loss. */
3203
3297
  fidelity?: "warn" | "strict";
@@ -3562,6 +3656,11 @@ declare interface ReportTemplateDocument_3 {
3562
3656
  }
3563
3657
  export declare const ReportTemplateEditor: DefineComponent<TemplateEditorOptions, {
3564
3658
  openPanel: typeof openPanel;
3659
+ applyTemplate: (template: ReportTemplate) => boolean;
3660
+ undo: () => void;
3661
+ redo: () => void;
3662
+ canUndo: boolean;
3663
+ canRedo: boolean;
3565
3664
  canApply: boolean;
3566
3665
  saveReason: string;
3567
3666
  pendingLocalChanges: boolean;
@@ -3569,18 +3668,21 @@ export declare const ReportTemplateEditor: DefineComponent<TemplateEditorOptions
3569
3668
  blocked: boolean;
3570
3669
  guardChanges: (reason?: TemplateEditorBeforeDiscardContext["reason"], replacement?: ReportTemplateDocument) => Promise<boolean>;
3571
3670
  reset: () => Promise<void>;
3572
- save: () => Promise<void>;
3671
+ save: typeof saveDocument;
3573
3672
  insertComponent: (component: TemplateComponent) => boolean;
3574
3673
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
3575
3674
  "update:modelValue": (document: ReportTemplateDocument) => any;
3576
3675
  saved: (document: ReportTemplateDocument) => any;
3577
3676
  "excel-bound": (result: ExcelBindingWizardApply) => any;
3677
+ "update:mode": (mode: "preview" | "design") => any;
3578
3678
  }, string, MachReportVuePublicProps, Readonly<TemplateEditorOptions> & Readonly<{
3579
3679
  "onUpdate:modelValue"?: ((document: ReportTemplateDocument) => any) | undefined;
3580
3680
  onSaved?: ((document: ReportTemplateDocument) => any) | undefined;
3581
3681
  "onExcel-bound"?: ((result: ExcelBindingWizardApply) => any) | undefined;
3682
+ "onUpdate:mode"?: ((mode: "preview" | "design") => any) | undefined;
3582
3683
  }>, {
3583
3684
  showSave: boolean;
3685
+ showModeSwitch: boolean;
3584
3686
  }>;
3585
3687
  declare interface ReportTemplateFixture {
3586
3688
  name: string;
@@ -3909,6 +4011,7 @@ export declare interface RuleEditorOptions {
3909
4011
  readonly?: boolean;
3910
4012
  messages?: Partial<RuleEditorMessages>;
3911
4013
  }
4014
+ declare function saveDocument(): Promise<void>;
3912
4015
  /** 条件格式规则求值(声明式,见 ListColumn.rules) */
3913
4016
  declare interface StyleRule {
3914
4017
  when: ReportPredicate;
@@ -4445,6 +4548,11 @@ export declare interface TemplateEditorController {
4445
4548
  openPanel?(target: TemplateEditorPanel): void;
4446
4549
  /** Insert a native/registered component through validation, geometry constraints and undo history. */
4447
4550
  insertComponent(component: TemplateComponent): boolean;
4551
+ applyTemplate?(template: ReportTemplate): boolean;
4552
+ undo?(): void;
4553
+ redo?(): void;
4554
+ readonly canUndo?: boolean;
4555
+ readonly canRedo?: boolean;
4448
4556
  readonly canApply?: boolean;
4449
4557
  readonly saveReason?: string;
4450
4558
  readonly pendingLocalChanges: boolean;
@@ -4459,6 +4567,11 @@ export declare type TemplateEditorMessages = typeof BASE_TEMPLATE_EDITOR_MESSAGE
4459
4567
  export declare interface TemplateEditorOptions extends TemplateEditorConflictOptions {
4460
4568
  /** Hide the duplicate save action when the host already provides an apply/save footer. */
4461
4569
  showSave?: boolean;
4570
+ /** Host-controlled view for an editor embedded inside a studio. */
4571
+ mode?: "design" | "preview";
4572
+ showModeSwitch?: boolean;
4573
+ capabilities?: Partial<Record<"params" | "excel" | "rules" | "review" | "advanced" | "outline" | "reuse", boolean>>;
4574
+ insertionMessages?: Partial<DesignerInsertMessages>;
4462
4575
  guideMessages?: Partial<DesignerGuideMessages>;
4463
4576
  /** Opt-in declaration-only recovery. Scope should include project and account identity. */
4464
4577
  draftStorage?: TemplateDraftStorage;
@@ -4604,6 +4717,30 @@ export declare interface TemplateToolDraft {
4604
4717
  baseline: string;
4605
4718
  value: string;
4606
4719
  }
4720
+ export declare type TemplateTotalsMessages = typeof TOTALS_MESSAGES;
4721
+ declare const TOTALS_MESSAGES: {
4722
+ title: string;
4723
+ field: string;
4724
+ operation: string;
4725
+ position: string;
4726
+ tableEnd: string;
4727
+ groupEnd: string;
4728
+ add: string;
4729
+ remove: string;
4730
+ sum: string;
4731
+ avg: string;
4732
+ count: string;
4733
+ noFields: string;
4734
+ scope: string;
4735
+ groupScope: string;
4736
+ saved: string;
4737
+ empty: string;
4738
+ advanced: string;
4739
+ complex: string;
4740
+ unconfigured: string;
4741
+ configured: string;
4742
+ update: string;
4743
+ };
4607
4744
  /** A serialized tree contract. Sibling and root order follow input order. */
4608
4745
  declare interface TreeTableOptions {
4609
4746
  input: "flat" | "nested";
@@ -483,9 +483,45 @@ export declare const DESIGNER_GUIDE_MESSAGES: {
483
483
  readonly reviewHint: "校验字段依赖、样例结果与输出限制";
484
484
  readonly result: "预览确认效果后保存模板;高级 JSON 保留给需要时使用。";
485
485
  };
486
+ declare const DESIGNER_INSERT_MESSAGES: {
487
+ readonly add: "添加内容";
488
+ readonly title: "添加到当前版面";
489
+ readonly text: "说明文字";
490
+ readonly textHint: "添加标题、备注或说明";
491
+ readonly field: "业务字段";
492
+ readonly columnField: "添加表格字段";
493
+ readonly fieldHint: "选择字段后立即显示真实内容";
494
+ readonly image: "图片或 Logo";
495
+ readonly imageHint: "使用 PNG 或 JPEG 图片";
496
+ readonly qrcode: "二维码";
497
+ readonly barcode: "条形码";
498
+ readonly codeHint: "绑定记录编号或填写编码内容";
499
+ readonly list: "明细表";
500
+ readonly listHint: "从当前字段契约建立表格";
501
+ readonly chart: "图表";
502
+ readonly recordCount: "记录数";
503
+ readonly chartHint: "选择分类与数值字段";
504
+ readonly rect: "装饰色块";
505
+ readonly rectHint: "辅助分区与突出信息";
506
+ readonly search: "搜索业务字段";
507
+ readonly noFields: "没有匹配的字段";
508
+ readonly close: "关闭添加内容";
509
+ readonly back: "返回内容类型";
510
+ readonly duplicate: "复制组件";
511
+ readonly newPage: "当前版面空间不足或含动态明细,内容已放到新增版面,可撤销恢复。";
512
+ readonly addColumn: "添加字段列";
513
+ readonly removeColumn: "删除当前列";
514
+ readonly removeLast: "至少保留一列";
515
+ readonly dependentColumn: "此字段仍被合计、规则或表头引用,请先调整相关配置。";
516
+ readonly assetPending: "请完成图片或编码内容配置,再预览或保存。";
517
+ readonly fieldsUnavailable: "当前模板尚无可绑定的数据字段。";
518
+ };
486
519
  export declare type DesignerGuideMessages = {
487
520
  [K in keyof typeof DESIGNER_GUIDE_MESSAGES]: string;
488
521
  };
522
+ export declare type DesignerInsertMessages = {
523
+ [K in keyof typeof DESIGNER_INSERT_MESSAGES]: string;
524
+ };
489
525
  /** Optional wizard labels remain independent of the general designer configuration. */
490
526
  export declare const EXCEL_BINDING_MESSAGES: {
491
527
  recoveredMapping: string;
@@ -934,9 +970,10 @@ export declare const LABEL_STUDIO_MESSAGES: {
934
970
  readonly faces: "个版面";
935
971
  readonly labels: "张标签";
936
972
  readonly session: "当前会话模板";
937
- readonly flow: "选择记录 → 设计标签 → 预览并打印";
973
+ readonly flow: "成品预览 · 按记录生成";
974
+ readonly designHint: "设计使用前 3 条样本 · 完整记录用于预览和打印";
938
975
  readonly guide: "使用指引";
939
- readonly help: "在画布点选文字或码图,再设置绑定字段;在“模板”中调整纸张与份数。";
976
+ readonly help: "先选成品样式与显示字段即可使用。需要追加内容或自由排版时,进入设计标签。";
940
977
  readonly size: "纸张与份数";
941
978
  readonly bindings: "字段与码图";
942
979
  readonly count: "条记录";
@@ -946,18 +983,55 @@ export declare const LABEL_STUDIO_MESSAGES: {
946
983
  readonly printHint: "先试打一张,使用同规格纸张与 100% 比例核对尺寸和扫码。";
947
984
  readonly empty: "暂无可打印记录";
948
985
  readonly save: "保存标签模板";
986
+ readonly layout: "成品样式";
987
+ readonly materialPreset: "物料卡";
988
+ readonly pairedPreset: "双版标识";
989
+ readonly warehousePreset: "仓储标签";
990
+ readonly fields: "显示字段";
991
+ readonly findField: "查找业务字段";
992
+ readonly noFields: "没有匹配的字段";
993
+ readonly fieldLimit: "最多显示 5 个字段,取消已选项后可继续选择。";
994
+ readonly removeField: "取消字段";
995
+ readonly fieldSearchHint: "每次显示前 30 项,可搜索完整字段目录。";
996
+ readonly brand: "标题与品牌";
997
+ readonly brandName: "主标题";
998
+ readonly brandTagline: "副标题(可选)";
999
+ readonly applyLayout: "更新标签";
1000
+ readonly restoreConfiguration: "还原轻配置";
1001
+ readonly choosePreset: "请选择成品样式后更新标签,或还原轻配置继续使用当前模板。";
1002
+ readonly discardTitle: "保留标签修改";
1003
+ readonly discardDescription: "标签设计或轻配置存在未保存的修改,继续将丢弃这些修改。";
1004
+ readonly keepEditing: "继续编辑";
1005
+ readonly discard: "丢弃并继续";
1006
+ readonly reflowHint: "按所选样式重新排版,可在设计中撤销恢复。";
1007
+ readonly customTemplate: "自定义模板";
1008
+ readonly readyTemplate: "成品模板 · 可直接打印";
949
1009
  };
950
1010
  /** Named business row interfaces and readonly arrays need no index signature or conversion. */
951
1011
  declare type LabelReportRows = readonly object[];
1012
+ export declare interface LabelStudioBrand {
1013
+ name?: string;
1014
+ tagline?: string;
1015
+ /** Portable image data shared by preview, PDF and image output. */
1016
+ logoData?: string;
1017
+ }
952
1018
  export declare interface LabelStudioController {
953
1019
  readonly busy?: boolean;
1020
+ readonly pendingLocalChanges?: boolean;
954
1021
  guardChanges(): Promise<boolean>;
955
1022
  prepare(): Promise<ReportTemplateDocument | undefined>;
956
1023
  }
1024
+ export declare interface LabelStudioLayout {
1025
+ preset?: LabelStudioPreset;
1026
+ brand?: LabelStudioBrand;
1027
+ fields?: readonly string[];
1028
+ }
957
1029
  export declare type LabelStudioMessages = {
958
1030
  [K in keyof typeof LABEL_STUDIO_MESSAGES]: string;
959
1031
  };
960
- export declare interface LabelStudioOptions {
1032
+ export declare interface LabelStudioOptions extends LabelStudioLayout {
1033
+ /** A host-owned completion action may replace the inner draft-save button. */
1034
+ showSave?: boolean;
961
1035
  rows: LabelReportRows;
962
1036
  schema: DatasetContract;
963
1037
  title?: string;
@@ -968,6 +1042,7 @@ export declare interface LabelStudioOptions {
968
1042
  beforeDiscard?: TemplateEditorOptions["beforeDiscard"];
969
1043
  messages?: Partial<LabelStudioMessages>;
970
1044
  }
1045
+ export declare type LabelStudioPreset = "material" | "paired" | "warehouse";
971
1046
  /** auto:真实数字/显式数值格式居右,日期与布尔居中,其他内容居左。 */
972
1047
  declare type ListAlignment = NonNullable<ComponentStyle["align"]> | "auto";
973
1048
  /** auto:真实数字/显式数值格式居右,日期与布尔居中,其他内容居左。 */
@@ -2534,6 +2609,14 @@ declare interface ReportCalculationMessages {
2534
2609
  calculationErrorDivision: string;
2535
2610
  calculationErrorOverflow: string;
2536
2611
  calculationErrorPrecision: string;
2612
+ calculationSummary?: string;
2613
+ calculationAdvanced?: string;
2614
+ calculationClose?: string;
2615
+ calculationPending?: string;
2616
+ calculationSummarySum?: string;
2617
+ calculationSummaryAverage?: string;
2618
+ calculationSummaryCount?: string;
2619
+ calculationMixedColumns?: string;
2537
2620
  }
2538
2621
  declare interface ReportCalculationMessages_2 {
2539
2622
  calculationTitle: string;
@@ -2563,6 +2646,14 @@ declare interface ReportCalculationMessages_2 {
2563
2646
  calculationErrorDivision: string;
2564
2647
  calculationErrorOverflow: string;
2565
2648
  calculationErrorPrecision: string;
2649
+ calculationSummary?: string;
2650
+ calculationAdvanced?: string;
2651
+ calculationClose?: string;
2652
+ calculationPending?: string;
2653
+ calculationSummarySum?: string;
2654
+ calculationSummaryAverage?: string;
2655
+ calculationSummaryCount?: string;
2656
+ calculationMixedColumns?: string;
2566
2657
  }
2567
2658
  declare interface ReportCandidateValidationOptions extends Pick<ReportDatasetValidationOptions, "rules" | "maxChecks" | "maxIssues"> {
2568
2659
  /** Warnings are visible and allowed by default; block explicitly when required by business policy. */
@@ -3193,11 +3284,14 @@ export declare const ReportLabelStudio: DefineComponent<LabelStudioOptions, {
3193
3284
  guardChanges: () => Promise<boolean>;
3194
3285
  prepare: () => Promise<ReportTemplateDocument_3 | undefined>;
3195
3286
  busy: boolean;
3287
+ pendingLocalChanges: boolean;
3196
3288
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
3197
3289
  "update:modelValue": (document: ReportTemplateDocument_3) => any;
3198
3290
  }, string, MachReportVuePublicProps, Readonly<LabelStudioOptions> & Readonly<{
3199
3291
  "onUpdate:modelValue"?: ((document: ReportTemplateDocument_3) => any) | undefined;
3200
- }>, {}>;
3292
+ }>, {
3293
+ showSave: boolean;
3294
+ }>;
3201
3295
  declare interface ReportOutputOptions {
3202
3296
  /** warn preserves supported output and shows diagnostics; strict rejects known fidelity loss. */
3203
3297
  fidelity?: "warn" | "strict";
@@ -3562,6 +3656,11 @@ declare interface ReportTemplateDocument_3 {
3562
3656
  }
3563
3657
  export declare const ReportTemplateEditor: DefineComponent<TemplateEditorOptions, {
3564
3658
  openPanel: typeof openPanel;
3659
+ applyTemplate: (template: ReportTemplate) => boolean;
3660
+ undo: () => void;
3661
+ redo: () => void;
3662
+ canUndo: boolean;
3663
+ canRedo: boolean;
3565
3664
  canApply: boolean;
3566
3665
  saveReason: string;
3567
3666
  pendingLocalChanges: boolean;
@@ -3569,18 +3668,21 @@ export declare const ReportTemplateEditor: DefineComponent<TemplateEditorOptions
3569
3668
  blocked: boolean;
3570
3669
  guardChanges: (reason?: TemplateEditorBeforeDiscardContext["reason"], replacement?: ReportTemplateDocument) => Promise<boolean>;
3571
3670
  reset: () => Promise<void>;
3572
- save: () => Promise<void>;
3671
+ save: typeof saveDocument;
3573
3672
  insertComponent: (component: TemplateComponent) => boolean;
3574
3673
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
3575
3674
  "update:modelValue": (document: ReportTemplateDocument) => any;
3576
3675
  saved: (document: ReportTemplateDocument) => any;
3577
3676
  "excel-bound": (result: ExcelBindingWizardApply) => any;
3677
+ "update:mode": (mode: "preview" | "design") => any;
3578
3678
  }, string, MachReportVuePublicProps, Readonly<TemplateEditorOptions> & Readonly<{
3579
3679
  "onUpdate:modelValue"?: ((document: ReportTemplateDocument) => any) | undefined;
3580
3680
  onSaved?: ((document: ReportTemplateDocument) => any) | undefined;
3581
3681
  "onExcel-bound"?: ((result: ExcelBindingWizardApply) => any) | undefined;
3682
+ "onUpdate:mode"?: ((mode: "preview" | "design") => any) | undefined;
3582
3683
  }>, {
3583
3684
  showSave: boolean;
3685
+ showModeSwitch: boolean;
3584
3686
  }>;
3585
3687
  declare interface ReportTemplateFixture {
3586
3688
  name: string;
@@ -3909,6 +4011,7 @@ export declare interface RuleEditorOptions {
3909
4011
  readonly?: boolean;
3910
4012
  messages?: Partial<RuleEditorMessages>;
3911
4013
  }
4014
+ declare function saveDocument(): Promise<void>;
3912
4015
  /** 条件格式规则求值(声明式,见 ListColumn.rules) */
3913
4016
  declare interface StyleRule {
3914
4017
  when: ReportPredicate;
@@ -4445,6 +4548,11 @@ export declare interface TemplateEditorController {
4445
4548
  openPanel?(target: TemplateEditorPanel): void;
4446
4549
  /** Insert a native/registered component through validation, geometry constraints and undo history. */
4447
4550
  insertComponent(component: TemplateComponent): boolean;
4551
+ applyTemplate?(template: ReportTemplate): boolean;
4552
+ undo?(): void;
4553
+ redo?(): void;
4554
+ readonly canUndo?: boolean;
4555
+ readonly canRedo?: boolean;
4448
4556
  readonly canApply?: boolean;
4449
4557
  readonly saveReason?: string;
4450
4558
  readonly pendingLocalChanges: boolean;
@@ -4459,6 +4567,11 @@ export declare type TemplateEditorMessages = typeof BASE_TEMPLATE_EDITOR_MESSAGE
4459
4567
  export declare interface TemplateEditorOptions extends TemplateEditorConflictOptions {
4460
4568
  /** Hide the duplicate save action when the host already provides an apply/save footer. */
4461
4569
  showSave?: boolean;
4570
+ /** Host-controlled view for an editor embedded inside a studio. */
4571
+ mode?: "design" | "preview";
4572
+ showModeSwitch?: boolean;
4573
+ capabilities?: Partial<Record<"params" | "excel" | "rules" | "review" | "advanced" | "outline" | "reuse", boolean>>;
4574
+ insertionMessages?: Partial<DesignerInsertMessages>;
4462
4575
  guideMessages?: Partial<DesignerGuideMessages>;
4463
4576
  /** Opt-in declaration-only recovery. Scope should include project and account identity. */
4464
4577
  draftStorage?: TemplateDraftStorage;
@@ -4604,6 +4717,30 @@ export declare interface TemplateToolDraft {
4604
4717
  baseline: string;
4605
4718
  value: string;
4606
4719
  }
4720
+ export declare type TemplateTotalsMessages = typeof TOTALS_MESSAGES;
4721
+ declare const TOTALS_MESSAGES: {
4722
+ title: string;
4723
+ field: string;
4724
+ operation: string;
4725
+ position: string;
4726
+ tableEnd: string;
4727
+ groupEnd: string;
4728
+ add: string;
4729
+ remove: string;
4730
+ sum: string;
4731
+ avg: string;
4732
+ count: string;
4733
+ noFields: string;
4734
+ scope: string;
4735
+ groupScope: string;
4736
+ saved: string;
4737
+ empty: string;
4738
+ advanced: string;
4739
+ complex: string;
4740
+ unconfigured: string;
4741
+ configured: string;
4742
+ update: string;
4743
+ };
4607
4744
  /** A serialized tree contract. Sibling and root order follow input order. */
4608
4745
  declare interface TreeTableOptions {
4609
4746
  input: "flat" | "nested";
package/dist/designer.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "vue";
2
- import { C as e, d as s, e as t, f as T, E as _, g as A, L as R, P as r, h as M, R as l, D as i, i as o, j as G, c as L, k as p, l as P, m as n, a as I, b as m, n as D, T as d, o as O, p as C, q as B, r as u } from "./designer-fVvpYg8H.js";
2
+ import { C as e, e as s, f as t, g as T, E as _, h as A, L as R, P as r, i as M, R as l, D as i, j as o, k as G, d as L, l as p, m as P, n, a as I, b as m, o as D, T as d, p as O, q as C, r as B, s as u } from "./designer-B52ddmHO.js";
3
3
  export {
4
4
  e as COLUMN_VISUAL_MESSAGES,
5
5
  s as ChartBindingInspector,
@@ -1 +1 @@
1
- "use strict";var R=Object.create;var f=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var d=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty;var m=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of P(e))!p.call(r,o)&&o!==t&&f(r,o,{get:()=>e[o],enumerable:!(n=u(e,o))||n.enumerable});return r};var E=(r,e,t)=>(t=r!=null?R(d(r)):{},m(e||!r||!r.__esModule?f(t,"default",{value:r,enumerable:!0}):t,r));const l=require("vue"),i=require("./injection-keys-Db_DyLkm.cjs"),h=require("./report-params-VTg8MoCp.cjs"),s=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./ReportPreview-D7PvKzs3.cjs")).then(r=>r.ReportPreview$1)),v={install(r,e={}){let t=e.fetcher;if(!t&&e.reports){const n=e.reports;let o;t=async c=>(o??=import("@agile-team/mach-report").then(({createReportSource:a})=>a(n)),(await o)(c)),t.getParamDefs=c=>h.getReportParamDefs(n,c)}t&&r.provide(i.MACH_REPORT_FETCHER_KEY,t),e.pdfExporter&&r.provide(i.MACH_REPORT_PDF_EXPORTER_KEY,e.pdfExporter),r.provide(i.MACH_REPORT_CONFIG_KEY,l.computed(()=>{if(e.pdfFontUrl===void 0)return e.config??null;const n=e.config??{defaults:{},presets:{}};return{...n,defaults:{...n.defaults,pdfFontUrl:e.pdfFontUrl}}})),e.globalComponent!==!1&&!r.component("MachReportPreview")&&r.component("MachReportPreview",s)}};exports.MachReportPreview=s;exports.machReportPlugin=v;
1
+ "use strict";var R=Object.create;var f=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var d=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty;var m=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of P(e))!p.call(r,o)&&o!==t&&f(r,o,{get:()=>e[o],enumerable:!(n=u(e,o))||n.enumerable});return r};var E=(r,e,t)=>(t=r!=null?R(d(r)):{},m(e||!r||!r.__esModule?f(t,"default",{value:r,enumerable:!0}):t,r));const l=require("vue"),i=require("./injection-keys-Db_DyLkm.cjs"),h=require("./report-params-VTg8MoCp.cjs"),s=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./ReportPreview-hlwvZ1wf.cjs")).then(r=>r.ReportPreview$1)),v={install(r,e={}){let t=e.fetcher;if(!t&&e.reports){const n=e.reports;let o;t=async c=>(o??=import("@agile-team/mach-report").then(({createReportSource:a})=>a(n)),(await o)(c)),t.getParamDefs=c=>h.getReportParamDefs(n,c)}t&&r.provide(i.MACH_REPORT_FETCHER_KEY,t),e.pdfExporter&&r.provide(i.MACH_REPORT_PDF_EXPORTER_KEY,e.pdfExporter),r.provide(i.MACH_REPORT_CONFIG_KEY,l.computed(()=>{if(e.pdfFontUrl===void 0)return e.config??null;const n=e.config??{defaults:{},presets:{}};return{...n,defaults:{...n.defaults,pdfFontUrl:e.pdfFontUrl}}})),e.globalComponent!==!1&&!r.component("MachReportPreview")&&r.component("MachReportPreview",s)}};exports.MachReportPreview=s;exports.machReportPlugin=v;
@@ -1,7 +1,7 @@
1
1
  import { defineAsyncComponent as c, computed as m } from "vue";
2
2
  import { b as i, c as l, a as d } from "./injection-keys-e85udZCp.js";
3
3
  import { g as s } from "./report-params-D9tBuM9B.js";
4
- const p = c(() => import("./ReportPreview-BUr8GQUW.js").then((r) => r.v)), _ = {
4
+ const p = c(() => import("./ReportPreview-CGcxwkAn.js").then((r) => r.v)), _ = {
5
5
  install(r, e = {}) {
6
6
  let t = e.fetcher;
7
7
  if (!t && e.reports) {
@@ -6,7 +6,7 @@
6
6
  "component": {
7
7
  "type": "library",
8
8
  "name": "@agile-team/mach-report",
9
- "version": "2.19.0"
9
+ "version": "2.20.0"
10
10
  },
11
11
  "properties": [
12
12
  {