@agile-team/mach-report 2.22.0 → 2.23.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.
- package/README.md +7 -6
- package/dist/{ExcelBindingWizard-CZyppD7I.js → ExcelBindingWizard-D4FLind-.js} +3 -3
- package/dist/{ExcelBindingWizard-CW79I6Gl.cjs → ExcelBindingWizard-D4RS5Bpg.cjs} +1 -1
- package/dist/{ParamEditor-CiYCJI0b.cjs → ParamEditor-C-6C9rd2.cjs} +1 -1
- package/dist/{ParamEditor-DQit-Gdf.js → ParamEditor-CASZt-Ma.js} +2 -2
- package/dist/{ReportBatchPanel-DKTpV7MU.js → ReportBatchPanel-Bq7t8a5r.js} +2 -2
- package/dist/{ReportBatchPanel-Db6TAfG5.cjs → ReportBatchPanel-YVj5IO5y.cjs} +1 -1
- package/dist/ReportLabelStudio-Cqhita1b.cjs +1 -0
- package/dist/{ReportLabelStudio-BYnRqmje.js → ReportLabelStudio-Dj7GXhuv.js} +295 -292
- package/dist/ReportParamPanel-DZbFVmDL.cjs +1 -0
- package/dist/{ReportParamPanel-BHSKVL8k.js → ReportParamPanel-Dgmqro1Y.js} +93 -79
- package/dist/ReportPreview-DeWzG8jQ.js +6257 -0
- package/dist/ReportPreview-FFIryrIr.cjs +6 -0
- package/dist/{ReportTemplateLibrary-DEXH07ND.cjs → ReportTemplateLibrary-BaWodmpm.cjs} +1 -1
- package/dist/{ReportTemplateLibrary-BZuKn0YK.js → ReportTemplateLibrary-DdAAAD2I.js} +1 -1
- package/dist/{RuleEditor-CIQn547x.js → RuleEditor-D2UwQGF6.js} +59 -59
- package/dist/{RuleEditor-zSUmPjKa.cjs → RuleEditor-DcT9xI1v.cjs} +1 -1
- package/dist/TemplateOutlinePanel-CUHFFiNM.cjs +1 -0
- package/dist/{TemplateOutlinePanel-D0PgOSQE.js → TemplateOutlinePanel-DrT7XN0m.js} +2 -2
- package/dist/{TemplateReusePanel-BKlAEF8-.js → TemplateReusePanel-4eejkNqi.js} +2 -2
- package/dist/{TemplateReusePanel-DAy_Hwqz.cjs → TemplateReusePanel-DZMyiX5I.cjs} +1 -1
- package/dist/{TemplateReviewPanel-div-EH_m.js → TemplateReviewPanel-BIhNLeNw.js} +2 -2
- package/dist/{TemplateReviewPanel-CowmHaQQ.cjs → TemplateReviewPanel-DnYImiXu.cjs} +1 -1
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.js +26 -26
- package/dist/artifact-integrity.json +106 -104
- package/dist/assets-D2gHc4Mz.cjs +1 -0
- package/dist/assets-T_gDeFaz.js +132 -0
- package/dist/auto-4pK9HePf.cjs +1 -0
- package/dist/auto-CTIJ6PnR.js +257 -0
- package/dist/capabilities-DiBj4Qgl.cjs +1 -0
- package/dist/capabilities-pg7j7VLT.js +106 -0
- package/dist/charts-Cjw5AYkg.cjs +1 -0
- package/dist/{charts-Dlv8j2AG.js → charts-CxJZ0XaY.js} +1 -1
- package/dist/computed-DK6BruFz.cjs +1 -0
- package/dist/{computed-C8NRZQss.js → computed-f3pOqWLX.js} +381 -301
- package/dist/data-bar-CeZuFmYl.cjs +1 -0
- package/dist/{data-bar-8baGYEZ9.js → data-bar-IkI6VvMQ.js} +1 -1
- package/dist/designer-DhrE7jzw.js +7169 -0
- package/dist/designer-IAZu6kBX.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +98 -45
- package/dist/designer.d.ts +98 -45
- package/dist/designer.js +3 -3
- package/dist/dom-ChE5D-L-.cjs +1 -0
- package/dist/dom-JWrchIre.js +452 -0
- package/dist/dom-cell-address-DLD1mkTB.cjs +1 -0
- package/dist/dom-cell-address-Fn-8nk7D.js +11 -0
- package/dist/{encoding-ncQAvyOv.cjs → encoding-BefcaHdp.cjs} +1 -1
- package/dist/{encoding-DbnhbwI8.js → encoding-CL6rXEkR.js} +2 -2
- package/dist/{font-loader-Di0lQKFf.js → font-loader-BT5baV-o.js} +1 -1
- package/dist/{font-loader-BB372_XN.cjs → font-loader-Ga51c2VC.cjs} +1 -1
- package/dist/grid-strokes-Be24LGuV.cjs +1 -0
- package/dist/grid-strokes-EoY66L2f.js +53 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +944 -1259
- package/dist/json-snapshot-1tvQNzQE.cjs +2 -0
- package/dist/{json-snapshot-DvQbZlD7.js → json-snapshot-OqkPyUk5.js} +763 -776
- package/dist/matrix-B8QWbsGM.cjs +1 -0
- package/dist/matrix-C6e_r_vp.js +302 -0
- package/dist/{pdf-CARdBcuw.cjs → pdf-HiEeXe9H.cjs} +42 -42
- package/dist/{pdf-DmlnL5eB.js → pdf-aobetCsy.js} +20 -20
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.js +2 -2
- package/dist/{plugin-AcAQ2m9X.cjs → plugin-BFANt-i8.cjs} +1 -1
- package/dist/{plugin-w5Nyt08U.js → plugin-DeYYAL6F.js} +1 -1
- package/dist/{prefill-BXBxx5We.js → prefill-Dk4C6S5R.js} +21 -21
- package/dist/prefill-DsUD5OoK.cjs +1 -0
- package/dist/prepared-DCIxhKFo.js +94 -0
- package/dist/prepared-Dv-XM3i1.cjs +1 -0
- package/dist/progress-ByiOxUD3.js +250 -0
- package/dist/progress-WomPRP3B.cjs +1 -0
- package/dist/{protocol-C9ZaylID.cjs → protocol-B9YgfQ_d.cjs} +1 -1
- package/dist/{protocol-fjaeKkjf.js → protocol-DxeUKGYG.js} +3 -3
- package/dist/record-bindings-DatJZv_e.js +200 -0
- package/dist/record-bindings-MBxbeBsi.cjs +1 -0
- package/dist/{region-binding-workflow-aA8nxmkZ.js → region-binding-workflow-DjrXuR1q.js} +2 -2
- package/dist/{region-binding-workflow-BiJQ7NU6.cjs → region-binding-workflow-l7NGfagJ.cjs} +2 -2
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/rich-text-layout-Ciwa6D2o.js +52 -0
- package/dist/rich-text-layout-DK7A_a5r.cjs +3 -0
- package/dist/{runtime-BTtpjF3D.js → runtime-75Y5Oq5B.js} +52 -51
- package/dist/runtime-DKlGd_D4.cjs +1 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +1642 -1586
- package/dist/server.cjs +1 -1
- package/dist/server.js +24 -24
- package/dist/style.css +1 -1
- package/dist/{template-catalog-JSxSqk5y.js → template-catalog--cjxzgH7.js} +17 -17
- package/dist/template-catalog-CoT7jm_6.cjs +1 -0
- package/dist/{template-fragments-D2JFj7Du.js → template-fragments-CPpGpQoz.js} +12 -12
- package/dist/template-fragments-GVjpew_q.cjs +1 -0
- package/dist/template-registry-DI59PXVK.cjs +1 -0
- package/dist/{template-registry-Do1Uav2Z.js → template-registry-O0hNIOfB.js} +17 -17
- package/dist/{template-serialization-CU4n_Miu.js → template-serialization-CWmHq7lX.js} +1 -1
- package/dist/{template-serialization-CgqBo6s-.cjs → template-serialization-CqQY4zDg.cjs} +1 -1
- package/dist/{textwrap-CkGjRFT3.js → textwrap-BIjtEWmq.js} +1 -1
- package/dist/textwrap-Cy7o1hIR.cjs +4 -0
- package/dist/vue/async.d.cts +24 -0
- package/dist/vue/async.d.ts +24 -0
- package/dist/vue/index.d.cts +25 -1
- package/dist/vue/index.d.ts +25 -1
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +52 -47
- package/dist/{workbook-session-BvEBRRMz.cjs → workbook-session-C6-SrnCT.cjs} +4 -4
- package/dist/{workbook-session-f0wVlzst.js → workbook-session-C9ZmCBwY.js} +15 -16
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.js +184 -179
- package/package.json +1 -1
- package/dist/ReportLabelStudio-B0i9ohQj.cjs +0 -1
- package/dist/ReportParamPanel-lngONOEz.cjs +0 -1
- package/dist/ReportPreview-BDgKssYR.js +0 -5887
- package/dist/ReportPreview-Dw-4icG6.cjs +0 -6
- package/dist/TemplateOutlinePanel-B5SfGYVN.cjs +0 -1
- package/dist/assets-CxHunY_9.js +0 -232
- package/dist/assets-vbjAGgk8.cjs +0 -1
- package/dist/auto-DcUHlKob.cjs +0 -1
- package/dist/auto-moShblh1.js +0 -240
- package/dist/charts-aCtoswXq.cjs +0 -1
- package/dist/component-tree-1_QCiQJX.js +0 -67
- package/dist/component-tree-BjZIp6w9.cjs +0 -1
- package/dist/computed-4TnxzgIh.cjs +0 -1
- package/dist/data-bar-YltqGTaC.cjs +0 -1
- package/dist/designer-B7jJeAeG.js +0 -6914
- package/dist/designer-BWQVpJeN.cjs +0 -2
- package/dist/grid-geometry-D3SJgWFv.js +0 -136
- package/dist/grid-geometry-D8ReblRV.cjs +0 -1
- package/dist/json-snapshot-nyV63AbB.cjs +0 -2
- package/dist/matrix-0hywp0-F.cjs +0 -1
- package/dist/matrix-Dy-tyY7E.js +0 -381
- package/dist/prefill-DUvejVt1.cjs +0 -1
- package/dist/prepared-YXy-fVLw.cjs +0 -1
- package/dist/prepared-rXCKqdHY.js +0 -88
- package/dist/progress-B0ctFpKf.cjs +0 -1
- package/dist/progress-Hc2vxoCs.js +0 -52
- package/dist/record-bindings-Ct1HkPrc.cjs +0 -1
- package/dist/record-bindings-VZGS-Qd8.js +0 -155
- package/dist/rich-text-layout-K48VHUoW.cjs +0 -3
- package/dist/rich-text-layout-wxBhnAS7.js +0 -102
- package/dist/runtime-Dq0LUsyS.cjs +0 -1
- package/dist/template-catalog-CLAM4w7H.cjs +0 -1
- package/dist/template-fragments-Ca25Jt7e.cjs +0 -1
- package/dist/template-outline-CDWXptuj.js +0 -88
- package/dist/template-outline-K4jGhATu.cjs +0 -1
- package/dist/template-registry-CWnuGqyP.cjs +0 -1
- package/dist/textwrap-OTOUMr4f.cjs +0 -4
package/dist/designer.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("vue");const E=require("./designer-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("vue");const E=require("./designer-IAZu6kBX.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;exports.useTemplateWorkbench=E.useTemplateWorkbench;
|
package/dist/designer.d.cts
CHANGED
|
@@ -91,6 +91,48 @@ declare interface AssetRenderOptions extends OutputDiagnosticOptions, ImageMedia
|
|
|
91
91
|
assetFailure?: "throw" | "placeholder";
|
|
92
92
|
signal?: AbortSignal;
|
|
93
93
|
}
|
|
94
|
+
declare const BASE_INSERT_MESSAGES: {
|
|
95
|
+
readonly add: "添加内容";
|
|
96
|
+
readonly title: "添加到当前版面";
|
|
97
|
+
readonly text: "说明文字";
|
|
98
|
+
readonly textHint: "添加标题、备注或说明";
|
|
99
|
+
readonly field: "业务字段";
|
|
100
|
+
readonly columnField: "添加表格字段";
|
|
101
|
+
readonly fieldHint: "选择字段后立即显示真实内容";
|
|
102
|
+
readonly image: "图片或 Logo";
|
|
103
|
+
readonly imageHint: "使用 PNG 或 JPEG 图片";
|
|
104
|
+
readonly qrcode: "二维码";
|
|
105
|
+
readonly barcode: "条形码";
|
|
106
|
+
readonly codeHint: "绑定记录编号或填写编码内容";
|
|
107
|
+
readonly list: "明细表";
|
|
108
|
+
readonly listHint: "从当前字段契约建立表格";
|
|
109
|
+
readonly chart: "图表";
|
|
110
|
+
readonly recordCount: "记录数";
|
|
111
|
+
readonly chartHint: "选择分类与数值字段";
|
|
112
|
+
readonly rect: "装饰色块";
|
|
113
|
+
readonly rectHint: "辅助分区与突出信息";
|
|
114
|
+
readonly search: "搜索业务字段";
|
|
115
|
+
readonly noFields: "没有匹配的字段";
|
|
116
|
+
readonly close: "关闭添加内容";
|
|
117
|
+
readonly back: "返回内容类型";
|
|
118
|
+
readonly duplicate: "复制组件";
|
|
119
|
+
readonly newPage: "当前版面空间不足或含动态明细,内容已放到新增版面,可撤销恢复。";
|
|
120
|
+
readonly newPageTitle: "需要新增一个版面";
|
|
121
|
+
readonly newPageDescription: "当前版面没有足够空间,将新增同规格的 {width} × {height} mm 版面放置内容。";
|
|
122
|
+
readonly reportPageImpact: "模板版面 {before} → {after}。最终输出页数由明细分页决定。";
|
|
123
|
+
readonly labelPageImpact: "每份标签 {before} → {after} 个版面。每条记录的输出都会增加一个版面。";
|
|
124
|
+
readonly labelCountImpact: "按当前设计样本,标签数 {before} → {after} 张。";
|
|
125
|
+
readonly newPageConfirm: "新增版面并添加";
|
|
126
|
+
readonly newPageCancel: "取消添加";
|
|
127
|
+
readonly newPagePending: "请先确认或取消新增版面,再预览或保存。";
|
|
128
|
+
readonly contentTooLarge: "内容尺寸大于当前纸张的可用区域,请先调整纸张或内容尺寸。内容没有被缩小或添加。";
|
|
129
|
+
readonly addColumn: "添加字段列";
|
|
130
|
+
readonly removeColumn: "删除当前列";
|
|
131
|
+
readonly removeLast: "至少保留一列";
|
|
132
|
+
readonly dependentColumn: "此字段仍被合计、规则或表头引用,请先调整相关配置。";
|
|
133
|
+
readonly assetPending: "请完成图片或编码内容配置,再预览或保存。";
|
|
134
|
+
readonly fieldsUnavailable: "当前模板尚无可绑定的数据字段。";
|
|
135
|
+
};
|
|
94
136
|
/** 可选设计器独立文案,不把其依赖和配置强加给预览消费者。 */
|
|
95
137
|
declare const BASE_TEMPLATE_EDITOR_MESSAGES: {
|
|
96
138
|
title: string;
|
|
@@ -126,6 +168,17 @@ declare const BASE_TEMPLATE_EDITOR_MESSAGES: {
|
|
|
126
168
|
note: string;
|
|
127
169
|
invalid: string;
|
|
128
170
|
};
|
|
171
|
+
declare const BATCH_INSERT_MESSAGES: {
|
|
172
|
+
readonly selectField: "选择字段";
|
|
173
|
+
readonly addSelected: "添加选中项";
|
|
174
|
+
readonly selectedCount: "已选 {count} 项";
|
|
175
|
+
readonly batchHint: "可一次选择最多 100 个字段,确认版面影响后统一添加。";
|
|
176
|
+
readonly batchTitle: "确认添加字段";
|
|
177
|
+
readonly batchDescription: "将按选择顺序添加 {count} 个字段,本次操作可一次撤销。";
|
|
178
|
+
readonly batchWidth: "表格宽度 {before} → {after} mm。";
|
|
179
|
+
readonly batchFixedWidth: "保持表格宽度 {width} mm,所有列按比例分配宽度。";
|
|
180
|
+
readonly batchConfirm: "确认添加";
|
|
181
|
+
};
|
|
129
182
|
declare interface BrowserReportWorker {
|
|
130
183
|
postMessage(value: unknown, transfer?: Transferable[]): void;
|
|
131
184
|
terminate(): void;
|
|
@@ -137,6 +190,8 @@ declare interface BrowserReportWorker {
|
|
|
137
190
|
declare interface CanvasSelection {
|
|
138
191
|
/** Ctrl/Command/Shift toggles the selection without changing the report schema. */
|
|
139
192
|
additive?: boolean;
|
|
193
|
+
/** Activate a member without collapsing the current multi-selection. */
|
|
194
|
+
preserve?: boolean;
|
|
140
195
|
pageIndex: number;
|
|
141
196
|
componentIndex: number;
|
|
142
197
|
}
|
|
@@ -485,54 +540,14 @@ export declare const DESIGNER_GUIDE_MESSAGES: {
|
|
|
485
540
|
readonly reviewHint: "校验字段依赖、样例结果与输出限制";
|
|
486
541
|
readonly result: "预览确认效果后保存模板;高级 JSON 保留给需要时使用。";
|
|
487
542
|
};
|
|
488
|
-
declare const DESIGNER_INSERT_MESSAGES: {
|
|
489
|
-
readonly add: "添加内容";
|
|
490
|
-
readonly title: "添加到当前版面";
|
|
491
|
-
readonly text: "说明文字";
|
|
492
|
-
readonly textHint: "添加标题、备注或说明";
|
|
493
|
-
readonly field: "业务字段";
|
|
494
|
-
readonly columnField: "添加表格字段";
|
|
495
|
-
readonly fieldHint: "选择字段后立即显示真实内容";
|
|
496
|
-
readonly image: "图片或 Logo";
|
|
497
|
-
readonly imageHint: "使用 PNG 或 JPEG 图片";
|
|
498
|
-
readonly qrcode: "二维码";
|
|
499
|
-
readonly barcode: "条形码";
|
|
500
|
-
readonly codeHint: "绑定记录编号或填写编码内容";
|
|
501
|
-
readonly list: "明细表";
|
|
502
|
-
readonly listHint: "从当前字段契约建立表格";
|
|
503
|
-
readonly chart: "图表";
|
|
504
|
-
readonly recordCount: "记录数";
|
|
505
|
-
readonly chartHint: "选择分类与数值字段";
|
|
506
|
-
readonly rect: "装饰色块";
|
|
507
|
-
readonly rectHint: "辅助分区与突出信息";
|
|
508
|
-
readonly search: "搜索业务字段";
|
|
509
|
-
readonly noFields: "没有匹配的字段";
|
|
510
|
-
readonly close: "关闭添加内容";
|
|
511
|
-
readonly back: "返回内容类型";
|
|
512
|
-
readonly duplicate: "复制组件";
|
|
513
|
-
readonly newPage: "当前版面空间不足或含动态明细,内容已放到新增版面,可撤销恢复。";
|
|
514
|
-
readonly newPageTitle: "需要新增一个版面";
|
|
515
|
-
readonly newPageDescription: "当前版面没有足够空间,将新增同规格的 {width} × {height} mm 版面放置内容。";
|
|
516
|
-
readonly reportPageImpact: "模板版面 {before} → {after}。最终输出页数由明细分页决定。";
|
|
517
|
-
readonly labelPageImpact: "每份标签 {before} → {after} 个版面。每条记录的输出都会增加一个版面。";
|
|
518
|
-
readonly labelCountImpact: "按当前设计样本,标签数 {before} → {after} 张。";
|
|
519
|
-
readonly newPageConfirm: "新增版面并添加";
|
|
520
|
-
readonly newPageCancel: "取消添加";
|
|
521
|
-
readonly newPagePending: "请先确认或取消新增版面,再预览或保存。";
|
|
522
|
-
readonly contentTooLarge: "内容尺寸大于当前纸张的可用区域,请先调整纸张或内容尺寸。内容没有被缩小或添加。";
|
|
523
|
-
readonly addColumn: "添加字段列";
|
|
524
|
-
readonly removeColumn: "删除当前列";
|
|
525
|
-
readonly removeLast: "至少保留一列";
|
|
526
|
-
readonly dependentColumn: "此字段仍被合计、规则或表头引用,请先调整相关配置。";
|
|
527
|
-
readonly assetPending: "请完成图片或编码内容配置,再预览或保存。";
|
|
528
|
-
readonly fieldsUnavailable: "当前模板尚无可绑定的数据字段。";
|
|
529
|
-
};
|
|
530
543
|
export declare type DesignerGuideMessages = {
|
|
531
544
|
[K in keyof typeof DESIGNER_GUIDE_MESSAGES]: string;
|
|
532
545
|
};
|
|
533
546
|
export declare type DesignerInsertMessages = {
|
|
534
|
-
[K in keyof typeof
|
|
535
|
-
}
|
|
547
|
+
[K in keyof typeof BASE_INSERT_MESSAGES]: string;
|
|
548
|
+
} & Partial<{
|
|
549
|
+
[K in keyof typeof BATCH_INSERT_MESSAGES]: string;
|
|
550
|
+
}>;
|
|
536
551
|
/** Optional wizard labels remain independent of the general designer configuration. */
|
|
537
552
|
export declare const EXCEL_BINDING_MESSAGES: {
|
|
538
553
|
recoveredMapping: string;
|
|
@@ -1580,6 +1595,20 @@ declare interface MachReportMessages extends Partial<ReportCalculationMessages>,
|
|
|
1580
1595
|
importing?: string;
|
|
1581
1596
|
editCell?: string;
|
|
1582
1597
|
editingHint?: string;
|
|
1598
|
+
editCellEditable?: string;
|
|
1599
|
+
editCellReadOnly?: string;
|
|
1600
|
+
editCellFormula?: string;
|
|
1601
|
+
editCellProtected?: string;
|
|
1602
|
+
editCellComplex?: string;
|
|
1603
|
+
editCellStructure?: string;
|
|
1604
|
+
editCellDerived?: string;
|
|
1605
|
+
editCellPermission?: string;
|
|
1606
|
+
editCellBusy?: string;
|
|
1607
|
+
editHistoryLimited?: string;
|
|
1608
|
+
changesSearch?: string;
|
|
1609
|
+
changesAllDatasets?: string;
|
|
1610
|
+
changesNoMatches?: string;
|
|
1611
|
+
changesRange?: string;
|
|
1583
1612
|
saving?: string;
|
|
1584
1613
|
editInvalidNumber?: string;
|
|
1585
1614
|
editInvalidBoolean?: string;
|
|
@@ -1767,6 +1796,20 @@ declare interface MachReportMessages_2 extends Partial<ReportCalculationMessages
|
|
|
1767
1796
|
importing?: string;
|
|
1768
1797
|
editCell?: string;
|
|
1769
1798
|
editingHint?: string;
|
|
1799
|
+
editCellEditable?: string;
|
|
1800
|
+
editCellReadOnly?: string;
|
|
1801
|
+
editCellFormula?: string;
|
|
1802
|
+
editCellProtected?: string;
|
|
1803
|
+
editCellComplex?: string;
|
|
1804
|
+
editCellStructure?: string;
|
|
1805
|
+
editCellDerived?: string;
|
|
1806
|
+
editCellPermission?: string;
|
|
1807
|
+
editCellBusy?: string;
|
|
1808
|
+
editHistoryLimited?: string;
|
|
1809
|
+
changesSearch?: string;
|
|
1810
|
+
changesAllDatasets?: string;
|
|
1811
|
+
changesNoMatches?: string;
|
|
1812
|
+
changesRange?: string;
|
|
1770
1813
|
saving?: string;
|
|
1771
1814
|
editInvalidNumber?: string;
|
|
1772
1815
|
editInvalidBoolean?: string;
|
|
@@ -3117,11 +3160,21 @@ declare interface ReportEditConflict {
|
|
|
3117
3160
|
currentValue?: ReportCellValue;
|
|
3118
3161
|
revision?: string | number;
|
|
3119
3162
|
}
|
|
3163
|
+
declare interface ReportEditHistoryOptions {
|
|
3164
|
+
/** Retained undo/redo transactions. Default 100. Zero disables undo retention. */
|
|
3165
|
+
maxSteps?: number;
|
|
3166
|
+
/** Conservative retained transaction size in bytes. Default 8 MiB. */
|
|
3167
|
+
maxBytes?: number;
|
|
3168
|
+
}
|
|
3120
3169
|
/** Opt in with true for local drafts, or provide host validation and persistence. */
|
|
3121
3170
|
declare interface ReportEditingOptions {
|
|
3122
3171
|
/** Optional field controls, keyed by source.field / table.columnKey; a resolver supports dataset-specific rules. */
|
|
3123
3172
|
fields?: Readonly<Record<string, ReportCellFieldOptions>> | ((context: ReportCellContext) => ReportCellFieldOptions | undefined);
|
|
3124
3173
|
canEdit?(context: ReportCellContext): boolean;
|
|
3174
|
+
/** Optional explanation when canEdit rejects a cell. Does not grant editing access. */
|
|
3175
|
+
readOnlyReason?(context: ReportCellContext): string | undefined;
|
|
3176
|
+
/** Bounds undo/redo retention. Net differences and getChanges remain complete. */
|
|
3177
|
+
history?: ReportEditHistoryOptions;
|
|
3125
3178
|
/** Return an error message or throw to reject the edit. */
|
|
3126
3179
|
validate?(edit: Readonly<ReportCellEdit>, operation: ReportEditOperation): void | string | Promise<void | string>;
|
|
3127
3180
|
/** Same declarative rules can be run in Node via validateReportDataset. Requires a source-backed session. */
|
|
@@ -4951,7 +5004,7 @@ declare interface TreeTableOptions_3 {
|
|
|
4951
5004
|
export declare function useTemplateWorkbench(options: TemplateWorkbenchOptions): {
|
|
4952
5005
|
operating: Ref<boolean>;
|
|
4953
5006
|
busy: ComputedRef<boolean>;
|
|
4954
|
-
error: ShallowRef<unknown
|
|
5007
|
+
error: ShallowRef<unknown>;
|
|
4955
5008
|
run: <T>(action: (context: TemplateWorkbenchTaskContext) => T | Promise<T>) => Promise<T | undefined>;
|
|
4956
5009
|
guardChanges: () => Promise<boolean>;
|
|
4957
5010
|
apply: () => Promise<boolean>;
|
package/dist/designer.d.ts
CHANGED
|
@@ -91,6 +91,48 @@ declare interface AssetRenderOptions extends OutputDiagnosticOptions, ImageMedia
|
|
|
91
91
|
assetFailure?: "throw" | "placeholder";
|
|
92
92
|
signal?: AbortSignal;
|
|
93
93
|
}
|
|
94
|
+
declare const BASE_INSERT_MESSAGES: {
|
|
95
|
+
readonly add: "添加内容";
|
|
96
|
+
readonly title: "添加到当前版面";
|
|
97
|
+
readonly text: "说明文字";
|
|
98
|
+
readonly textHint: "添加标题、备注或说明";
|
|
99
|
+
readonly field: "业务字段";
|
|
100
|
+
readonly columnField: "添加表格字段";
|
|
101
|
+
readonly fieldHint: "选择字段后立即显示真实内容";
|
|
102
|
+
readonly image: "图片或 Logo";
|
|
103
|
+
readonly imageHint: "使用 PNG 或 JPEG 图片";
|
|
104
|
+
readonly qrcode: "二维码";
|
|
105
|
+
readonly barcode: "条形码";
|
|
106
|
+
readonly codeHint: "绑定记录编号或填写编码内容";
|
|
107
|
+
readonly list: "明细表";
|
|
108
|
+
readonly listHint: "从当前字段契约建立表格";
|
|
109
|
+
readonly chart: "图表";
|
|
110
|
+
readonly recordCount: "记录数";
|
|
111
|
+
readonly chartHint: "选择分类与数值字段";
|
|
112
|
+
readonly rect: "装饰色块";
|
|
113
|
+
readonly rectHint: "辅助分区与突出信息";
|
|
114
|
+
readonly search: "搜索业务字段";
|
|
115
|
+
readonly noFields: "没有匹配的字段";
|
|
116
|
+
readonly close: "关闭添加内容";
|
|
117
|
+
readonly back: "返回内容类型";
|
|
118
|
+
readonly duplicate: "复制组件";
|
|
119
|
+
readonly newPage: "当前版面空间不足或含动态明细,内容已放到新增版面,可撤销恢复。";
|
|
120
|
+
readonly newPageTitle: "需要新增一个版面";
|
|
121
|
+
readonly newPageDescription: "当前版面没有足够空间,将新增同规格的 {width} × {height} mm 版面放置内容。";
|
|
122
|
+
readonly reportPageImpact: "模板版面 {before} → {after}。最终输出页数由明细分页决定。";
|
|
123
|
+
readonly labelPageImpact: "每份标签 {before} → {after} 个版面。每条记录的输出都会增加一个版面。";
|
|
124
|
+
readonly labelCountImpact: "按当前设计样本,标签数 {before} → {after} 张。";
|
|
125
|
+
readonly newPageConfirm: "新增版面并添加";
|
|
126
|
+
readonly newPageCancel: "取消添加";
|
|
127
|
+
readonly newPagePending: "请先确认或取消新增版面,再预览或保存。";
|
|
128
|
+
readonly contentTooLarge: "内容尺寸大于当前纸张的可用区域,请先调整纸张或内容尺寸。内容没有被缩小或添加。";
|
|
129
|
+
readonly addColumn: "添加字段列";
|
|
130
|
+
readonly removeColumn: "删除当前列";
|
|
131
|
+
readonly removeLast: "至少保留一列";
|
|
132
|
+
readonly dependentColumn: "此字段仍被合计、规则或表头引用,请先调整相关配置。";
|
|
133
|
+
readonly assetPending: "请完成图片或编码内容配置,再预览或保存。";
|
|
134
|
+
readonly fieldsUnavailable: "当前模板尚无可绑定的数据字段。";
|
|
135
|
+
};
|
|
94
136
|
/** 可选设计器独立文案,不把其依赖和配置强加给预览消费者。 */
|
|
95
137
|
declare const BASE_TEMPLATE_EDITOR_MESSAGES: {
|
|
96
138
|
title: string;
|
|
@@ -126,6 +168,17 @@ declare const BASE_TEMPLATE_EDITOR_MESSAGES: {
|
|
|
126
168
|
note: string;
|
|
127
169
|
invalid: string;
|
|
128
170
|
};
|
|
171
|
+
declare const BATCH_INSERT_MESSAGES: {
|
|
172
|
+
readonly selectField: "选择字段";
|
|
173
|
+
readonly addSelected: "添加选中项";
|
|
174
|
+
readonly selectedCount: "已选 {count} 项";
|
|
175
|
+
readonly batchHint: "可一次选择最多 100 个字段,确认版面影响后统一添加。";
|
|
176
|
+
readonly batchTitle: "确认添加字段";
|
|
177
|
+
readonly batchDescription: "将按选择顺序添加 {count} 个字段,本次操作可一次撤销。";
|
|
178
|
+
readonly batchWidth: "表格宽度 {before} → {after} mm。";
|
|
179
|
+
readonly batchFixedWidth: "保持表格宽度 {width} mm,所有列按比例分配宽度。";
|
|
180
|
+
readonly batchConfirm: "确认添加";
|
|
181
|
+
};
|
|
129
182
|
declare interface BrowserReportWorker {
|
|
130
183
|
postMessage(value: unknown, transfer?: Transferable[]): void;
|
|
131
184
|
terminate(): void;
|
|
@@ -137,6 +190,8 @@ declare interface BrowserReportWorker {
|
|
|
137
190
|
declare interface CanvasSelection {
|
|
138
191
|
/** Ctrl/Command/Shift toggles the selection without changing the report schema. */
|
|
139
192
|
additive?: boolean;
|
|
193
|
+
/** Activate a member without collapsing the current multi-selection. */
|
|
194
|
+
preserve?: boolean;
|
|
140
195
|
pageIndex: number;
|
|
141
196
|
componentIndex: number;
|
|
142
197
|
}
|
|
@@ -485,54 +540,14 @@ export declare const DESIGNER_GUIDE_MESSAGES: {
|
|
|
485
540
|
readonly reviewHint: "校验字段依赖、样例结果与输出限制";
|
|
486
541
|
readonly result: "预览确认效果后保存模板;高级 JSON 保留给需要时使用。";
|
|
487
542
|
};
|
|
488
|
-
declare const DESIGNER_INSERT_MESSAGES: {
|
|
489
|
-
readonly add: "添加内容";
|
|
490
|
-
readonly title: "添加到当前版面";
|
|
491
|
-
readonly text: "说明文字";
|
|
492
|
-
readonly textHint: "添加标题、备注或说明";
|
|
493
|
-
readonly field: "业务字段";
|
|
494
|
-
readonly columnField: "添加表格字段";
|
|
495
|
-
readonly fieldHint: "选择字段后立即显示真实内容";
|
|
496
|
-
readonly image: "图片或 Logo";
|
|
497
|
-
readonly imageHint: "使用 PNG 或 JPEG 图片";
|
|
498
|
-
readonly qrcode: "二维码";
|
|
499
|
-
readonly barcode: "条形码";
|
|
500
|
-
readonly codeHint: "绑定记录编号或填写编码内容";
|
|
501
|
-
readonly list: "明细表";
|
|
502
|
-
readonly listHint: "从当前字段契约建立表格";
|
|
503
|
-
readonly chart: "图表";
|
|
504
|
-
readonly recordCount: "记录数";
|
|
505
|
-
readonly chartHint: "选择分类与数值字段";
|
|
506
|
-
readonly rect: "装饰色块";
|
|
507
|
-
readonly rectHint: "辅助分区与突出信息";
|
|
508
|
-
readonly search: "搜索业务字段";
|
|
509
|
-
readonly noFields: "没有匹配的字段";
|
|
510
|
-
readonly close: "关闭添加内容";
|
|
511
|
-
readonly back: "返回内容类型";
|
|
512
|
-
readonly duplicate: "复制组件";
|
|
513
|
-
readonly newPage: "当前版面空间不足或含动态明细,内容已放到新增版面,可撤销恢复。";
|
|
514
|
-
readonly newPageTitle: "需要新增一个版面";
|
|
515
|
-
readonly newPageDescription: "当前版面没有足够空间,将新增同规格的 {width} × {height} mm 版面放置内容。";
|
|
516
|
-
readonly reportPageImpact: "模板版面 {before} → {after}。最终输出页数由明细分页决定。";
|
|
517
|
-
readonly labelPageImpact: "每份标签 {before} → {after} 个版面。每条记录的输出都会增加一个版面。";
|
|
518
|
-
readonly labelCountImpact: "按当前设计样本,标签数 {before} → {after} 张。";
|
|
519
|
-
readonly newPageConfirm: "新增版面并添加";
|
|
520
|
-
readonly newPageCancel: "取消添加";
|
|
521
|
-
readonly newPagePending: "请先确认或取消新增版面,再预览或保存。";
|
|
522
|
-
readonly contentTooLarge: "内容尺寸大于当前纸张的可用区域,请先调整纸张或内容尺寸。内容没有被缩小或添加。";
|
|
523
|
-
readonly addColumn: "添加字段列";
|
|
524
|
-
readonly removeColumn: "删除当前列";
|
|
525
|
-
readonly removeLast: "至少保留一列";
|
|
526
|
-
readonly dependentColumn: "此字段仍被合计、规则或表头引用,请先调整相关配置。";
|
|
527
|
-
readonly assetPending: "请完成图片或编码内容配置,再预览或保存。";
|
|
528
|
-
readonly fieldsUnavailable: "当前模板尚无可绑定的数据字段。";
|
|
529
|
-
};
|
|
530
543
|
export declare type DesignerGuideMessages = {
|
|
531
544
|
[K in keyof typeof DESIGNER_GUIDE_MESSAGES]: string;
|
|
532
545
|
};
|
|
533
546
|
export declare type DesignerInsertMessages = {
|
|
534
|
-
[K in keyof typeof
|
|
535
|
-
}
|
|
547
|
+
[K in keyof typeof BASE_INSERT_MESSAGES]: string;
|
|
548
|
+
} & Partial<{
|
|
549
|
+
[K in keyof typeof BATCH_INSERT_MESSAGES]: string;
|
|
550
|
+
}>;
|
|
536
551
|
/** Optional wizard labels remain independent of the general designer configuration. */
|
|
537
552
|
export declare const EXCEL_BINDING_MESSAGES: {
|
|
538
553
|
recoveredMapping: string;
|
|
@@ -1580,6 +1595,20 @@ declare interface MachReportMessages extends Partial<ReportCalculationMessages>,
|
|
|
1580
1595
|
importing?: string;
|
|
1581
1596
|
editCell?: string;
|
|
1582
1597
|
editingHint?: string;
|
|
1598
|
+
editCellEditable?: string;
|
|
1599
|
+
editCellReadOnly?: string;
|
|
1600
|
+
editCellFormula?: string;
|
|
1601
|
+
editCellProtected?: string;
|
|
1602
|
+
editCellComplex?: string;
|
|
1603
|
+
editCellStructure?: string;
|
|
1604
|
+
editCellDerived?: string;
|
|
1605
|
+
editCellPermission?: string;
|
|
1606
|
+
editCellBusy?: string;
|
|
1607
|
+
editHistoryLimited?: string;
|
|
1608
|
+
changesSearch?: string;
|
|
1609
|
+
changesAllDatasets?: string;
|
|
1610
|
+
changesNoMatches?: string;
|
|
1611
|
+
changesRange?: string;
|
|
1583
1612
|
saving?: string;
|
|
1584
1613
|
editInvalidNumber?: string;
|
|
1585
1614
|
editInvalidBoolean?: string;
|
|
@@ -1767,6 +1796,20 @@ declare interface MachReportMessages_2 extends Partial<ReportCalculationMessages
|
|
|
1767
1796
|
importing?: string;
|
|
1768
1797
|
editCell?: string;
|
|
1769
1798
|
editingHint?: string;
|
|
1799
|
+
editCellEditable?: string;
|
|
1800
|
+
editCellReadOnly?: string;
|
|
1801
|
+
editCellFormula?: string;
|
|
1802
|
+
editCellProtected?: string;
|
|
1803
|
+
editCellComplex?: string;
|
|
1804
|
+
editCellStructure?: string;
|
|
1805
|
+
editCellDerived?: string;
|
|
1806
|
+
editCellPermission?: string;
|
|
1807
|
+
editCellBusy?: string;
|
|
1808
|
+
editHistoryLimited?: string;
|
|
1809
|
+
changesSearch?: string;
|
|
1810
|
+
changesAllDatasets?: string;
|
|
1811
|
+
changesNoMatches?: string;
|
|
1812
|
+
changesRange?: string;
|
|
1770
1813
|
saving?: string;
|
|
1771
1814
|
editInvalidNumber?: string;
|
|
1772
1815
|
editInvalidBoolean?: string;
|
|
@@ -3117,11 +3160,21 @@ declare interface ReportEditConflict {
|
|
|
3117
3160
|
currentValue?: ReportCellValue;
|
|
3118
3161
|
revision?: string | number;
|
|
3119
3162
|
}
|
|
3163
|
+
declare interface ReportEditHistoryOptions {
|
|
3164
|
+
/** Retained undo/redo transactions. Default 100. Zero disables undo retention. */
|
|
3165
|
+
maxSteps?: number;
|
|
3166
|
+
/** Conservative retained transaction size in bytes. Default 8 MiB. */
|
|
3167
|
+
maxBytes?: number;
|
|
3168
|
+
}
|
|
3120
3169
|
/** Opt in with true for local drafts, or provide host validation and persistence. */
|
|
3121
3170
|
declare interface ReportEditingOptions {
|
|
3122
3171
|
/** Optional field controls, keyed by source.field / table.columnKey; a resolver supports dataset-specific rules. */
|
|
3123
3172
|
fields?: Readonly<Record<string, ReportCellFieldOptions>> | ((context: ReportCellContext) => ReportCellFieldOptions | undefined);
|
|
3124
3173
|
canEdit?(context: ReportCellContext): boolean;
|
|
3174
|
+
/** Optional explanation when canEdit rejects a cell. Does not grant editing access. */
|
|
3175
|
+
readOnlyReason?(context: ReportCellContext): string | undefined;
|
|
3176
|
+
/** Bounds undo/redo retention. Net differences and getChanges remain complete. */
|
|
3177
|
+
history?: ReportEditHistoryOptions;
|
|
3125
3178
|
/** Return an error message or throw to reject the edit. */
|
|
3126
3179
|
validate?(edit: Readonly<ReportCellEdit>, operation: ReportEditOperation): void | string | Promise<void | string>;
|
|
3127
3180
|
/** Same declarative rules can be run in Node via validateReportDataset. Requires a source-backed session. */
|
|
@@ -4951,7 +5004,7 @@ declare interface TreeTableOptions_3 {
|
|
|
4951
5004
|
export declare function useTemplateWorkbench(options: TemplateWorkbenchOptions): {
|
|
4952
5005
|
operating: Ref<boolean>;
|
|
4953
5006
|
busy: ComputedRef<boolean>;
|
|
4954
|
-
error: ShallowRef<unknown
|
|
5007
|
+
error: ShallowRef<unknown>;
|
|
4955
5008
|
run: <T>(action: (context: TemplateWorkbenchTaskContext) => T | Promise<T>) => Promise<T | undefined>;
|
|
4956
5009
|
guardChanges: () => Promise<boolean>;
|
|
4957
5010
|
apply: () => Promise<boolean>;
|
package/dist/designer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "vue";
|
|
2
|
-
import { C as e,
|
|
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 o, j as i, k as p, l as G, m as L, n as P, o as n, a as m, b as I, p as D, T as O, q as d, r as C, s as u, t as B, v as U } from "./designer-DhrE7jzw.js";
|
|
3
3
|
export {
|
|
4
4
|
e as COLUMN_VISUAL_MESSAGES,
|
|
5
5
|
s as ChartBindingInspector,
|
|
@@ -21,8 +21,8 @@ export {
|
|
|
21
21
|
m as TEMPLATE_LIBRARY_MESSAGES,
|
|
22
22
|
I as TEMPLATE_PRODUCT_MESSAGES,
|
|
23
23
|
D as TEMPLATE_RECOVERY_MESSAGES,
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
O as TEMPLATE_REVIEW_MESSAGES,
|
|
25
|
+
d as TemplateOutlinePanel,
|
|
26
26
|
C as TemplateReusePanel,
|
|
27
27
|
u as TemplateReviewPanel,
|
|
28
28
|
B as createTemplateDraftStorage,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const z=require("./template-serialization-CqQY4zDg.cjs"),V=require("./data-bar-CeZuFmYl.cjs"),B=require("./dom-cell-address-DLD1mkTB.cjs"),f=require("./progress-WomPRP3B.cjs"),D=require("./grid-strokes-Be24LGuV.cjs"),R=require("./capabilities-DiBj4Qgl.cjs");function F(e){const t=/\.pages\[(\d+)\](?:\.components\[(\d+)\])?/.exec(e);return t?{pageIndex:Number(t[1]),...t[2]===void 0?{}:{componentIndex:Number(t[2])}}:{}}function q(e,t,r){return z.collectTemplateDatasetBindings(e).filter(n=>n.dataset===t).flatMap(n=>n.fields.filter(o=>o.field===r).map(o=>({...o,...F(o.path),dataset:t,kind:/\.computed\[/.test(o.path)?"calculation":/\.columns\[\d+\]\.field$/.test(o.path)?"display":"binding"})))}function j(e,t){const r=e.kind==="list"?e.title||e.dataset:e.binding?.field||e.text||e.nid;return`${e.kind} · ${(r||String(t+1)).replace(/\s+/g," ").slice(0,80)}`}function K(e){const t=z.collectTemplateDatasetBindings(e),r=new Map;for(const o of t)for(const l of o.fields){const a=/^\$\.template\.pages\[\d+\]\.components\[\d+\]/.exec(l.path)?.[0];if(!a)continue;const s=r.get(a)??[];s.push({...l,dataset:o.dataset}),r.set(a,s)}const n=[];return e.pages.forEach((o,l)=>{const a=`$.template.pages[${l}]`;n.push({path:a,pageIndex:l,kind:"page",depth:0,title:typeof o.meta?.title=="string"?o.meta.title:`${l+1} · ${o.widthMm} × ${o.heightMm} mm`}),o.components.forEach((s,i)=>{const d=`${a}.components[${i}]`,h={pageIndex:l,componentIndex:i};n.push({path:d,...h,depth:1,kind:"component",title:j(s,i)}),s.kind==="list"&&(s.columns.forEach((m,p)=>n.push({path:`${d}.columns[${p}].field`,...h,depth:2,kind:"field",title:`${m.header} · ${m.field}`,field:m.field,dataset:s.dataset})),s.computed?.forEach((m,p)=>n.push({path:`${d}.computed[${p}]`,...h,depth:2,kind:"calculation",title:m.field,field:m.field,dataset:s.dataset})));const c=new Set;for(const m of r.get(d)??[])/\.columns\[\d+\]\.field$/.test(m.path)||c.has(m.path)||(c.add(m.path),n.push({...m,...h,depth:2,kind:"binding",title:m.field}))})}),n}function M(e,t,r){let n=0,o=e.length;for(;n<o;){const l=n+o>>>1;r(e[l])<t?n=l+1:o=l}return n}function L(e){if(![e.leftMm,e.topMm,e.widthMm,e.heightMm].every(Number.isFinite)||e.widthMm<0||e.heightMm<0)throw new RangeError("Preview viewport must have finite coordinates and nonnegative dimensions.");return e}function U(e){const t=e.rows.map(()=>[]);for(const r of e.cells){const n=Math.min(t.length,r.ri+(r.cell.rowSpan??1));for(let o=r.ri;o<n;o++)t[o].push(r)}for(const r of t)r.sort((n,o)=>n.xMm-o.xMm);return{cells(r){L(r);const n=new Set,o=r.topMm+r.heightMm,l=r.leftMm+r.widthMm;let a=M(e.rows,r.topMm,s=>s.pos+s.size);for(;a<t.length&&e.rows[a].pos<=o;){const s=t[a++];let i=M(s,r.leftMm,d=>d.xMm+d.widthMm);for(;i<s.length&&s[i].xMm<=l;)n.add(s[i++])}return[...n].sort((s,i)=>s.ri-i.ri||s.ci-i.ci)}}}function _(e){const t=["h","v"].map(r=>e.filter(n=>n.kind===r).sort((n,o)=>n.pos-o.pos));return r=>{const n=[];return t.forEach((o,l)=>{const a=l===0?r.topMm:r.leftMm,s=a+(l===0?r.heightMm:r.widthMm),i=l===0?r.leftMm:r.topMm,d=i+(l===0?r.widthMm:r.heightMm);let h=M(o,a,c=>c.pos);for(;h<o.length&&o[h].pos<=s;){const c=o[h++];c.to>=i&&c.from<=d&&n.push(c)}}),n}}function W(){const e=[];return{mount(t){e.push(ee(t))},update(t,r,n,o){L(t);let l=!1;for(const a of e)l=a.update(t,a.component===r?n:void 0,o)||l;return l}}}function X(e,t){const r=Math.max(8,e.widthMm/4),n=Math.max(8,e.heightMm/4);return{leftMm:e.leftMm-t.leftMm-r,topMm:e.topMm-t.topMm-n,widthMm:e.widthMm+2*r,heightMm:e.heightMm+2*n}}function Y(e,t,r){let n=t.get(r);return n||(n=e.table.ownerDocument.createElement("tr"),n.className=e.rowClass,n.setAttribute("role","row"),n.setAttribute("aria-rowindex",String(r+1)),n.style.cssText="all:unset;display:contents;box-sizing:border-box",t.set(r,n)),n}function J(e,t,r,n){const o=new Set(t),l=new Set(t.map(i=>i.ri)),a=new Map;for(const[i,d]of r)if(!o.has(i)){d.remove(),r.delete(i);const h=e.reuseKey?.(i);if(h!==void 0){const c=a.get(h)??[];c.push(d),a.set(h,c)}}for(const[i,d]of n)l.has(i)||(d.remove(),n.delete(i));for(const i of t){let d=r.get(i);if(!d){const c=e.reuseKey?.(i),m=c===void 0?void 0:a.get(c)?.pop();d=m&&e.reuseCell?.(m,i)?m:e.drawCell(i),d.setAttribute("aria-colindex",String(i.ci+1)),r.set(i,d)}const h=Y(e,n,i.ri);d.parentElement!==h&&h.appendChild(d)}const s=new Map;for(const i of t){const d=s.get(i.ri)??[];d.push(r.get(i)),s.set(i.ri,d)}for(const[i,d]of s)A(n.get(i),d);A(e.body,[...l].sort((i,d)=>i-d).map(i=>n.get(i)))}function A(e,t){let r=e.firstElementChild;for(const n of t)n===r?r=r.nextElementSibling:e.insertBefore(n,r)}function Q(e,t){return e.table?.role==="header"?e.heightMm:t.rows[0]?.size??0}function Z(e,t,r,n){const o=[e],l=n.freezeHeaders&&(r.table?.role==="header"||!r.table),a=Q(r,t);l&&o.push({...e,topMm:0,heightMm:Math.max(0,a-1e-4)});const s=Math.max(0,Math.min(20,Math.floor(n.frozenColumns??0)))||0;if(!s||!t.columns.length)return o;const i=t.columns[Math.min(s,t.columns.length)-1],d={...e,leftMm:0,widthMm:Math.max(0,i.pos+i.size-1e-4)};return o.push(d),l&&o.push({...d,topMm:0,heightMm:Math.max(0,a-1e-4)}),o}function ee(e){const t=f.resolveGridLayout(e.grid,e.component.widthMm,e.component.heightMm),r=new Map(t.cells.map(h=>[`${h.ri}:${h.ci}`,h])),n=U(t),o=new Map,l=new Map,a=_(D.resolveGridStrokes(t,e.component));e.table.setAttribute("aria-rowcount",String(t.rows.length)),e.table.setAttribute("aria-colcount",String(t.columns.length));let s="",i="";function d(h,c){const m=new Set;for(const p of Z(h,t,e.component,c??{}))for(const w of n.cells(p))m.add(w);return[...m]}return{component:e.component,update(h,c,m){const p=X(h,e.component),w=d(p,m),y=c&&r.get(`${c.rowIndex}:${c.columnIndex}`);y&&!w.includes(y)&&w.push(y),w.sort((b,$)=>b.ri-$.ri||b.ci-$.ci);const C=w.map(b=>`${b.ri}:${b.ci}`).join(";"),S=a(p),v=S.map(b=>`${b.kind}:${b.pos}:${b.from}:${b.to}`).join(";"),E=C!==s,T=v!==i;return E&&(s=C,J(e,w,o,l)),T&&(i=v,e.edgeHost.replaceChildren(...e.drawEdges(S))),E||T}}}const G=new WeakMap,te={root:"mr-root",page:"mr-page",comp:"mr-comp",text:"mr-text",lines:"mr-lines",line:"mr-line",rich:"mr-rich",paragraph:"mr-paragraph",segment:"mr-segment",image:"mr-image",shape:"mr-shape",grid:"mr-grid",row:"mr-row",cell:"mr-cell",unknown:"mr-unknown"};function g(e,t){return t?.classNames?.[e]??te[e]}class ne{constructor(){this.props=[]}add(t,r){return r==null||r===!1||r===""?this:(this.props.push([t,String(r)]),this)}mm(t,r,n,o=2){return this.add(t,`${f.round(f.mmToPx(r,n),o)}px`)}toString(){let t="";for(const[r,n]of this.props)t+=`${r}:${n};`;return t}applyTo(t){const r=this.toString();r&&(t.style.cssText=r)}}function u(e,t="unset"){return new ne().add("all",t).add("display",e).add("box-sizing","border-box")}function H(e,t,r){e.add("color",t.color).add("font-family",t.fontFamily).add("font-weight",t.bold!=null?t.bold?"700":"400":void 0).add("font-style",t.italic!=null?t.italic?"italic":"normal":void 0).add("text-decoration",t.underline!=null?t.underline?"underline":"none":void 0).add("letter-spacing",t.letterSpacing!=null?`${t.letterSpacing}pt`:void 0).add("line-height",String(f.resolveLineHeight(t))).add("text-align",t.align);const n=f.resolveFontSize(t,r);e.add("font-size",`${f.round(n.fontSizePx,2)}px`)}function re(e,t,r){const n=t.style??{};H(e,n,r);const o=!t.grid&&(t.kind==="ellipse"||t.kind==="line");e.add("background-color",o?void 0:n.backgroundColor).add("opacity",n.opacity!=null?String(n.opacity):void 0).add("transform",n.rotateDeg?`rotate(${n.rotateDeg}deg)`:void 0)}function P(e,t,r,n,o,l){const a=e.cell,s=l.createElement("td");s.className=g("cell",o),B.setDomCellAddress(s,e.ri,e.ci),s.setAttribute("role",t.table?.role==="header"?"columnheader":"cell"),a.colSpan&&(s.colSpan=a.colSpan),a.rowSpan&&(s.rowSpan=a.rowSpan);const i=f.mergeComponentStyles(t.style,a.style),d=u("block").add("position","absolute").mm("left",e.xMm,n).mm("top",e.yMm,n).mm("width",e.widthMm,n).mm("height",e.heightMm,n).add("background-color",i.backgroundColor).add("vertical-align",i.verticalAlign??"middle");H(d,i,n),d.applyTo(s);const h=V.dataBarBox(a.dataBar,e.widthMm,e.heightMm,r);if(h){const m=l.createElement("div");m.className="mr-cell-data-bar",m.setAttribute("aria-hidden","true"),u("block").add("position","absolute").mm("left",h.x,n).mm("top",h.y,n).mm("width",h.width,n).mm("height",h.height,n).add("background-color",h.color).add("opacity","0.35").add("pointer-events","none").applyTo(m),s.appendChild(m)}const c=l.createElement("div");c.className="mr-cell-content",u("flex").add("position","absolute").mm("left",r+(a.indentMm??0),n).mm("right",r,n).mm("top",r,n).mm("bottom",r,n).add("flex-direction","column").add("justify-content",i.verticalAlign==="top"?"flex-start":i.verticalAlign==="bottom"?"flex-end":"center").add("overflow-wrap","anywhere").add("overflow","hidden").applyTo(c),a.richParagraphs?.length?c.appendChild(I({...t,kind:"text",richParagraphs:a.richParagraphs},n,o,l)):a.text!=null&&c.append(a.text);for(const m of a.children??[])c.appendChild(x(m,n,o,l));return s.insertBefore(c,s.firstChild),s}function oe(e,t,r,n){return O(D.resolveGridStrokes(e,t),r,n)}function ie(e){const t=e.cell;if(!(t.children?.length||t.richParagraphs?.length||t.dataBar||(t.colSpan??1)!==1||(t.rowSpan??1)!==1))return JSON.stringify([t.style,t.indentMm])}function le(e,t,r){if(e.style.position!=="absolute"||e.style.zIndex||e.style.transform||e.children.length!==1)return!1;const n=e.firstElementChild;return!(n instanceof HTMLElement)||n.className!=="mr-cell-content"?!1:(B.setDomCellAddress(e,t.ri,t.ci),e.style.left=`${f.round(f.mmToPx(t.xMm,r),2)}px`,e.style.top=`${f.round(f.mmToPx(t.yMm,r),2)}px`,e.style.width=`${f.round(f.mmToPx(t.widthMm,r),2)}px`,e.style.height=`${f.round(f.mmToPx(t.heightMm,r),2)}px`,n.textContent=t.cell.text??"",!0)}function O(e,t,r){return e.map(n=>{const o=`${f.round(n.widthPt*t/72,2)}px solid ${n.color}`,l=r.createElement("div");l.className="mr-grid-edge",l.setAttribute("aria-hidden","true");const a=n.kind==="h";return u("block").add("position","absolute").add("pointer-events","none").mm("left",a?n.from:n.pos,t).mm("top",a?n.pos:n.from,t).mm("width",a?n.to-n.from:0,t).mm("height",a?0:n.to-n.from,t).add(a?"border-top":"border-left",o).applyTo(l),l})}function ae(e,t,r,n,o){const l=o.createElement("table");l.className=g("grid",n),l.setAttribute("role","table"),u("block").add("position","relative").add("width","100%").add("height","100%").applyTo(l);const a=o.createElement("tbody");u("contents").applyTo(a),l.appendChild(a);const s=t.style?.rotateDeg?void 0:G.get(n);if(s){const c=o.createElement("div");u("block").add("position","relative").add("width","100%").add("height","100%").applyTo(c);const m=o.createElement("div");return u("contents").applyTo(m),m.setAttribute("aria-hidden","true"),s.mount({grid:e,component:t,table:l,rowClass:g("row",n),body:a,edgeHost:m,drawCell:p=>P(p,t,e.paddingMm??.5,r,{...n},o),reuseKey:ie,reuseCell:(p,w)=>le(p,w,r),drawEdges:p=>O(p,r,o)}),c.append(l,m),c}const i=f.resolveGridLayout(e,t.widthMm,t.heightMm),d=e.cells.map(()=>{const c=o.createElement("tr");return c.className=g("row",n),c.setAttribute("role","row"),u("contents").applyTo(c),a.appendChild(c),c});for(const c of i.cells)d[c.ri].appendChild(P(c,t,e.paddingMm??.5,r,n,o));const h=o.createElement("div");return u("block").add("position","relative").add("width","100%").add("height","100%").applyTo(h),h.append(l,...oe(i,t,r,o)),h}function se(e,t,r,n){const o=n.createElement("div");o.className=g("paragraph",r),u("block").add("text-align",e.align).add("line-height",e.lineHeight!=null?String(e.lineHeight):void 0).mm("margin-top",e.spaceBeforeMm??0,t).mm("margin-bottom",e.spaceAfterMm??0,t).mm("text-indent",e.indentMm??0,t).applyTo(o);for(const l of e.segments||[]){const a=n.createElement("span");a.className=g("segment",r),a.textContent=l.kind==="field"?l.field??"":l.text??"";const s=u("inline");if(l.style){const i=l.style;s.add("color",i.color).add("background-color",i.backgroundColor).add("font-family",i.fontFamily).add("line-height",i.lineHeight).add("letter-spacing",i.letterSpacing==null?void 0:`${i.letterSpacing*t/72}px`).add("font-weight",i.bold!=null?i.bold?"700":"400":void 0).add("font-style",i.italic!=null?i.italic?"italic":"normal":void 0).add("text-decoration",i.underline!=null?i.underline?"underline":"none":void 0),(i.fontSize!=null||i.fontSizePx!=null)&&s.add("font-size",`${f.round(f.resolveFontSize(i,t).fontSizePx,2)}px`)}s.applyTo(a),o.appendChild(a)}return o}function I(e,t,r,n){if(f.isRichText(e)){const o=n.createElement("div");o.className=g("rich",r),u("block").applyTo(o);for(const l of e.richParagraphs)o.appendChild(se(l,t,r,n));return o}if(Array.isArray(e.lines)&&e.lines.length>0){const o=n.createElement("div");o.className=g("lines",r),u("block").applyTo(o);for(const l of e.lines){const a=n.createElement("div");a.className=g("line",r),a.textContent=l,u("block").add("white-space","pre").add("min-height","1lh").applyTo(a),o.appendChild(a)}return o}return e.text??""}function de(e,t,r,n){const o=n.createElement("div");o.className=g("text",r);const l=e.style||{};return u("flex").add("width","100%").add("height","100%").add("flex-direction","column").add("justify-content",l.verticalAlign==="middle"?"center":l.verticalAlign==="bottom"?"flex-end":"flex-start").add("overflow-wrap","anywhere").add("overflow","hidden").applyTo(o),o.append(I(e,t,r,n)),o}function ce(e,t,r){const n=r.createElement("img");return n.className=g("image",t),n.src=e.imageData,u("block").add("width","100%").add("height","100%").add("object-fit","contain").applyTo(n),n.alt=e.kind,n}function N(e,t,r,n){const o=n.createElement("div");o.className=g("shape",r);const l=e.style||{},a=f.resolveStroke(l),s=f.resolveBoxBorders(l),i=`${f.round(a.widthPt*t/72,2)}px solid ${a.color}`,d=u("block");return e.grid?d.add("position","relative"):e.kind==="rect"?(s.top&&d.add("border-top",i),s.right&&d.add("border-right",i),s.bottom&&d.add("border-bottom",i),s.left&&d.add("border-left",i)):e.kind==="ellipse"?(d.add("border-radius","50%"),s.inner&&d.add("border",i),l.backgroundColor&&d.add("background-color",l.backgroundColor)):e.kind==="line"&&d.add("height","0").add("border-top",i),d.add("box-sizing","border-box").add("width","100%").add("height","100%"),d.applyTo(o),o}function he(e,t,r){const n=r.createElementNS("http://www.w3.org/2000/svg","svg"),o=f.mmToPx(e.widthMm,t),l=f.mmToPx(e.heightMm,t);n.setAttribute("width",String(Math.max(1,o))),n.setAttribute("height",String(Math.max(1,l))),n.setAttribute("aria-hidden","true"),n.style.overflow="visible",n.style.display="block";const a=r.createElementNS("http://www.w3.org/2000/svg","line");a.setAttribute("x1","0"),a.setAttribute("x2",String(o)),a.setAttribute("y1",e.lineDirection==="up"?String(l):"0"),a.setAttribute("y2",e.lineDirection==="up"?"0":String(l));const s=f.resolveStroke({...e.style,borderColor:e.style?.lineColor??e.style?.borderColor});return a.setAttribute("stroke",s.color),a.setAttribute("stroke-width",String(s.widthPt*t/72)),n.appendChild(a),n}function x(e,t,r,n){const o=n.createElement("div");o.className=`${g("comp",r)} mr-kind-${e.kind}`;const l=u("block").add("position","absolute").mm("left",e.leftMm,t).mm("top",e.topMm,t).mm("width",e.widthMm,t).mm("height",e.heightMm,t).add("box-sizing","border-box");if(re(l,e,t),l.applyTo(o),f.isImageBackedComponent(e))return o.appendChild(ce(e,r,n)),o;if(e.kind==="text")return o.appendChild(de(e,t,r,n)),o;if(e.grid){const s=N(e,t,r,n);return s.appendChild(ae(e.grid,e,t,r,n)),o.appendChild(s),o}if(e.kind==="line"&&e.lineDirection)return o.appendChild(he(e,t,n)),o;if(e.kind==="line"||e.kind==="rect"||e.kind==="ellipse")return o.appendChild(N(e,t,r,n)),o;const a=n.createElement("div");return a.className=g("unknown",r),u("block").applyTo(a),a.textContent=e.fallbackText??`[${e.kind}]`,a.dataset.mrUnsupported=e.kind,a.setAttribute("role","note"),o.appendChild(a),o}function k(e,t,r,n){const o=n.createElement("div");return o.className=g("page",r),u("block","initial").add("position","relative").add("font-family",f.DEFAULT_FONT_FAMILY).add("font-size",`${f.round(f.resolveFontSize(void 0,t).fontSizePx,2)}px`).add("line-height",String(f.resolveLineHeight(void 0))).add("white-space","pre-wrap").add("direction","ltr").mm("width",e.pageWidthMm,t).mm("height",e.pageHeightMm,t).add("background-color","#fff").add("color",f.DEFAULT_TEXT_COLOR).add("overflow","hidden").add("box-sizing","border-box").applyTo(o),e.components.forEach((l,a)=>{const s=x(l,t,r,n);s.dataset.mrComponentIndex=String(a),o.appendChild(s)}),o}function me(e,t,r={}){const n=r.dpi??96;R.reportOutputDiagnostics(e,"dom",r);const o=t.createElement("div");return o.className=g("root",r),u("block").applyTo(o),o.dataset.schemaVersion=e.schemaVersion,e.pages.forEach(l=>{o.appendChild(k(l,n,r,t))}),o}function fe(e,t,r,n){const o={...r},l=W();return G.set(o,l),{element:k(e,t,o,n),update(s,i,d){return l.update(s,i&&e.components[i.componentIndex],i,d)}}}exports.classOf=g;exports.collectTemplateOutline=K;exports.createPageViewportRenderer=fe;exports.inspectTemplateFieldUsage=q;exports.renderComponent=x;exports.renderPage=k;exports.renderPlan=me;exports.templatePathLocation=F;
|