@agile-team/mach-report 2.2.0 → 2.3.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 +54 -10
- package/dist/ReportPreview-B-mwUSk9.cjs +6 -0
- package/dist/ReportPreview-DKjr4cwO.js +1688 -0
- package/dist/defaults-D4o0NCLo.js +9 -0
- package/dist/defaults-DOO1yHwx.cjs +1 -0
- package/dist/grid-geometry-Dw7BlENr.js +130 -0
- package/dist/grid-geometry-bkciiZ4Q.cjs +1 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +37 -5
- package/dist/index.d.ts +37 -5
- package/dist/index.js +1163 -1037
- package/dist/pdf.cjs +48 -48
- package/dist/pdf.d.cts +18 -0
- package/dist/pdf.d.ts +18 -0
- package/dist/pdf.js +5605 -5575
- package/dist/{plugin-BMoMUxrw.cjs → plugin-2lqgTX26.cjs} +1 -1
- package/dist/{plugin-CAcNe0FT.js → plugin-5R00MJQs.js} +1 -1
- package/dist/render-plan-CfJ3wf1l.cjs +1 -0
- package/dist/render-plan-I9AHvQv7.js +13 -0
- package/dist/sql.cjs +42 -42
- package/dist/sql.js +1366 -1363
- package/dist/style.css +1 -1
- package/dist/textwrap-nH0UYU6D.js +108 -0
- package/dist/textwrap-oD-t4b4B.cjs +4 -0
- package/dist/vue/async.d.cts +33 -7
- package/dist/vue/async.d.ts +33 -7
- package/dist/vue/index.d.cts +36 -10
- package/dist/vue/index.d.ts +36 -10
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +4 -4
- package/dist/xlsx.cjs +24 -24
- package/dist/xlsx.d.cts +24 -4
- package/dist/xlsx.d.ts +24 -4
- package/dist/xlsx.js +8287 -8166
- package/package.json +1 -1
- package/dist/ReportPreview-BWrQCj9M.js +0 -1643
- package/dist/ReportPreview-DY0PGGqF.cjs +0 -6
- package/dist/grid-geometry-DBH9ExuY.cjs +0 -1
- package/dist/grid-geometry-DONcjshk.js +0 -130
- package/dist/textwrap-DdaewxAd.js +0 -117
- package/dist/textwrap-DqiFwAV3.cjs +0 -3
package/dist/vue/index.d.ts
CHANGED
|
@@ -173,13 +173,13 @@ onWarning?: ((message: string) => any) | undefined;
|
|
|
173
173
|
height: string;
|
|
174
174
|
gapPx: number;
|
|
175
175
|
params: Record<string, string>;
|
|
176
|
+
reportId: string | string[] | null;
|
|
176
177
|
debug: boolean;
|
|
177
178
|
showExport: boolean;
|
|
178
179
|
showPrint: boolean;
|
|
179
180
|
showPdfWindow: boolean;
|
|
180
181
|
showParams: boolean;
|
|
181
182
|
messages: Partial<MachReportMessages>;
|
|
182
|
-
reportId: string | string[] | null;
|
|
183
183
|
autoLoad: boolean;
|
|
184
184
|
preset: string;
|
|
185
185
|
paramDefs: ReportParamDef[] | undefined;
|
|
@@ -405,6 +405,10 @@ declare interface ListColumn {
|
|
|
405
405
|
declare interface ListComponent {
|
|
406
406
|
kind: "list";
|
|
407
407
|
id?: string;
|
|
408
|
+
/** 宽表标记用于连续 Excel;不改变低层列表的列宽和分页算法。 */
|
|
409
|
+
layout?: "page" | "wide";
|
|
410
|
+
/** 逻辑表名称,供 Excel Sheet 命名;不额外生成标题组件。 */
|
|
411
|
+
title?: string;
|
|
408
412
|
leftMm: number;
|
|
409
413
|
topMm: number;
|
|
410
414
|
widthMm: number;
|
|
@@ -724,13 +728,13 @@ export declare const MachReportPreview: {
|
|
|
724
728
|
height: string;
|
|
725
729
|
gapPx: number;
|
|
726
730
|
params: Record<string, string>;
|
|
731
|
+
reportId: string | string[] | null;
|
|
727
732
|
debug: boolean;
|
|
728
733
|
showExport: boolean;
|
|
729
734
|
showPrint: boolean;
|
|
730
735
|
showPdfWindow: boolean;
|
|
731
736
|
showParams: boolean;
|
|
732
737
|
messages: Partial<MachReportMessages>;
|
|
733
|
-
reportId: string | string[] | null;
|
|
734
738
|
autoLoad: boolean;
|
|
735
739
|
preset: string;
|
|
736
740
|
paramDefs: ReportParamDef[] | undefined;
|
|
@@ -825,13 +829,13 @@ export declare const MachReportPreview: {
|
|
|
825
829
|
height: string;
|
|
826
830
|
gapPx: number;
|
|
827
831
|
params: Record<string, string>;
|
|
832
|
+
reportId: string | string[] | null;
|
|
828
833
|
debug: boolean;
|
|
829
834
|
showExport: boolean;
|
|
830
835
|
showPrint: boolean;
|
|
831
836
|
showPdfWindow: boolean;
|
|
832
837
|
showParams: boolean;
|
|
833
838
|
messages: Partial<MachReportMessages>;
|
|
834
|
-
reportId: string | string[] | null;
|
|
835
839
|
autoLoad: boolean;
|
|
836
840
|
preset: string;
|
|
837
841
|
paramDefs: ReportParamDef[] | undefined;
|
|
@@ -926,13 +930,13 @@ warning: (message: string) => any;
|
|
|
926
930
|
height: string;
|
|
927
931
|
gapPx: number;
|
|
928
932
|
params: Record<string, string>;
|
|
933
|
+
reportId: string | string[] | null;
|
|
929
934
|
debug: boolean;
|
|
930
935
|
showExport: boolean;
|
|
931
936
|
showPrint: boolean;
|
|
932
937
|
showPdfWindow: boolean;
|
|
933
938
|
showParams: boolean;
|
|
934
939
|
messages: Partial<MachReportMessages>;
|
|
935
|
-
reportId: string | string[] | null;
|
|
936
940
|
autoLoad: boolean;
|
|
937
941
|
preset: string;
|
|
938
942
|
paramDefs: ReportParamDef[] | undefined;
|
|
@@ -1035,6 +1039,7 @@ declare interface PlanComponent {
|
|
|
1035
1039
|
richParagraphs?: RichParagraph[];
|
|
1036
1040
|
imageData?: string;
|
|
1037
1041
|
grid?: PlanGrid;
|
|
1042
|
+
table?: PlanTableFragment;
|
|
1038
1043
|
style?: ComponentStyle;
|
|
1039
1044
|
meta?: Record<string, unknown>;
|
|
1040
1045
|
/** MachReport 扩展字段:未知 kind 的兜底渲染标记 */
|
|
@@ -1052,6 +1057,8 @@ declare interface PlanGrid {
|
|
|
1052
1057
|
colWidthsMm?: number[];
|
|
1053
1058
|
rowHeightsMm?: number[];
|
|
1054
1059
|
gapMm?: number;
|
|
1060
|
+
/** 单元格四边内距;旧静态网格默认 0.5mm,分页列表使用其真实测量内距。 */
|
|
1061
|
+
paddingMm?: number;
|
|
1055
1062
|
}
|
|
1056
1063
|
|
|
1057
1064
|
export declare class PlanLoadError extends Error {
|
|
@@ -1059,6 +1066,8 @@ export declare class PlanLoadError extends Error {
|
|
|
1059
1066
|
}
|
|
1060
1067
|
|
|
1061
1068
|
declare interface PlanPage {
|
|
1069
|
+
/** wide 表示完整自然列宽;页面仅为预览的垂直窗口分段。 */
|
|
1070
|
+
layout?: "page" | "wide";
|
|
1062
1071
|
pageWidthMm: number;
|
|
1063
1072
|
pageHeightMm: number;
|
|
1064
1073
|
marginTopMm?: number;
|
|
@@ -1068,6 +1077,19 @@ declare interface PlanPage {
|
|
|
1068
1077
|
components: PlanComponent[];
|
|
1069
1078
|
}
|
|
1070
1079
|
|
|
1080
|
+
/** 列表的逻辑行来源;用于连续 Excel 重组,避免按文本猜测重复表头。 */
|
|
1081
|
+
declare interface PlanTableFragment {
|
|
1082
|
+
/** 在整个计划中唯一的逻辑表身份;同一表的分页片段共享身份。 */
|
|
1083
|
+
id: string;
|
|
1084
|
+
/** 表头固定 -1;其余行(包括组头/小计/总计)从 0 连续递增。 */
|
|
1085
|
+
rowIndex: number;
|
|
1086
|
+
role: "header" | "body" | "group-header" | "subtotal" | "grand-total";
|
|
1087
|
+
/** 按物理列顺序保存字段身份;不以表头显示文本判断列结构。 */
|
|
1088
|
+
columnKeys: string[];
|
|
1089
|
+
layout?: "page" | "wide";
|
|
1090
|
+
title?: string;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1071
1093
|
declare function print_2(): Promise<void>;
|
|
1072
1094
|
|
|
1073
1095
|
declare interface PrintHtmlResult {
|
|
@@ -1244,6 +1266,8 @@ declare type TemplateComponent = PlanComponent | ListComponent;
|
|
|
1244
1266
|
declare interface TemplatePage {
|
|
1245
1267
|
widthMm: number;
|
|
1246
1268
|
heightMm: number;
|
|
1269
|
+
/** 宽表保持全列自然宽度,页高只控制内部纵向分段。 */
|
|
1270
|
+
layout?: "page" | "wide";
|
|
1247
1271
|
marginTopMm?: number;
|
|
1248
1272
|
marginBottomMm?: number;
|
|
1249
1273
|
marginLeftMm?: number;
|
|
@@ -1340,8 +1364,8 @@ export declare function useReportPreview(): MachReportController | null;
|
|
|
1340
1364
|
|
|
1341
1365
|
/**
|
|
1342
1366
|
* 缩放状态(transform: scale 方案):
|
|
1343
|
-
* - fit
|
|
1344
|
-
* - raw
|
|
1367
|
+
* - fit 模式:按视口宽自适应,超宽表也能完整缩入视口
|
|
1368
|
+
* - raw 模式:固定百分比(30%~300%)
|
|
1345
1369
|
* transform 而非 CSS zoom:标准属性、跨浏览器、零重排。
|
|
1346
1370
|
*/
|
|
1347
1371
|
export declare function useZoom(getFitInputs: () => {
|
|
@@ -1363,11 +1387,13 @@ export declare function useZoom(getFitInputs: () => {
|
|
|
1363
1387
|
* - 未支持组件、富文本专有内容与单元格嵌套组件跳过并计入 warnings
|
|
1364
1388
|
*/
|
|
1365
1389
|
declare interface XlsxRenderOptions {
|
|
1366
|
-
/**
|
|
1367
|
-
sheetName?: (
|
|
1368
|
-
/**
|
|
1390
|
+
/** 工作表命名(连续表默认使用标题,其余默认 "Sheet1" 起序)。 */
|
|
1391
|
+
sheetName?: (sheetIndex: number) => string;
|
|
1392
|
+
/** auto 默认将 wide 逻辑表合并为连续 Sheet;pages 保留逐页;continuous 要求明确的表来源。 */
|
|
1393
|
+
sheetMode?: "auto" | "pages" | "continuous";
|
|
1394
|
+
/** 宽表或连续表默认 raw,其余默认 text;显式配置可覆盖默认值。 */
|
|
1369
1395
|
valueMode?: "text" | "raw";
|
|
1370
|
-
/**
|
|
1396
|
+
/** 连续表默认不限制打印纸型;显式 A3/A4/A5 仅设置打印适配,不改变 Excel 列宽。 */
|
|
1371
1397
|
paperSize?: "auto" | "a3" | "a4" | "a5";
|
|
1372
1398
|
}
|
|
1373
1399
|
|
package/dist/vue-async.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./plugin-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./plugin-2lqgTX26.cjs");function i(){return Promise.resolve().then(()=>require("./ReportPreview-B-mwUSk9.cjs")).then(e=>e.ReportPreview$1)}const t={install(e,o={}){r.machReportPlugin.install(e,o)}};exports.MachReportPreview=r.MachReportPreview;exports.default=t;exports.machReportAsyncPlugin=t;exports.preloadMachReport=i;
|
package/dist/vue-async.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { m as o } from "./plugin-
|
|
2
|
-
import { M as l } from "./plugin-
|
|
1
|
+
import { m as o } from "./plugin-5R00MJQs.js";
|
|
2
|
+
import { M as l } from "./plugin-5R00MJQs.js";
|
|
3
3
|
function a() {
|
|
4
|
-
return import("./ReportPreview-
|
|
4
|
+
return import("./ReportPreview-DKjr4cwO.js").then((t) => t.s);
|
|
5
5
|
}
|
|
6
6
|
const n = {
|
|
7
7
|
install(t, r = {}) {
|
package/dist/vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@agile-team/mach-report"),e=require("./ReportPreview-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@agile-team/mach-report"),e=require("./ReportPreview-B-mwUSk9.cjs"),c=require("./plugin-2lqgTX26.cjs"),s=require("vue");function p(r){const o=u.createReportSource(r),i=async n=>{if(n.reportIds.length===0)throw new e.PlanLoadError("缺少报表 ID");for(const t of n.reportIds)if(!Object.prototype.hasOwnProperty.call(r,t)||!r[t])throw new e.PlanLoadError(`本地模板 ${t} 不存在`);return o(n)};return i.getParamDefs=o.getParamDefs,i}const l=Object.freeze({loading:!1,hasPlan:!1,pageCount:0,currentPage:1,exporting:null,printing:!1,canExport:!1,canPrint:!1,error:null,pdfFont:Object.freeze({status:"unchecked",fontUrl:""})});function P(){const r=s.shallowRef(null),o=()=>r.value?.state??l,i=Object.freeze({get loading(){return o().loading},get hasPlan(){return o().hasPlan},get pageCount(){return o().pageCount},get currentPage(){return o().currentPage},get exporting(){return o().exporting},get printing(){return o().printing},get canExport(){return o().canExport},get canPrint(){return o().canPrint},get error(){return o().error},get pdfFont(){return o().pdfFont}});function n(){if(!r.value)throw new e.MachReportError("config","报表预览尚未挂载,请在 ready 后调用控制器");return r.value}return{ref(t){const a=t;r.value=a&&typeof a.reload=="function"&&typeof a.print=="function"&&typeof a.exportAs=="function"&&typeof a.openPdfWindow=="function"&&typeof a.gotoPage=="function"&&typeof a.setParams=="function"?a:null},ready:s.computed(()=>r.value!==null),state:i,async checkPdfFont(){const t=n();return t.checkPdfFont?t.checkPdfFont():{status:"unverified",fontUrl:"",message:"旧自定义控制器未提供字体检查,请由宿主确认字体配置"}},async reload(){await n().reload()},async print(){await n().print()},async exportAs(t){await n().exportAs(t)},openPdfWindow(){n().openPdfWindow()},gotoPage(t){n().gotoPage(t)},async setParams(t,a){await n().setParams(t,a)}}}function f(){return s.inject(c.MACH_REPORT_CONTROLLER_KEY,null)}exports.DEFAULT_MESSAGES=e.DEFAULT_MESSAGES;exports.DEFAULT_THEME=e.DEFAULT_THEME;exports.MachReportError=e.MachReportError;exports.PlanLoadError=e.PlanLoadError;exports.ReportParamPanel=e.ReportParamPanel;exports.ReportPreview=e.ReportPreview;exports.ReportToolbar=e.ReportToolbar;exports.SILENT_LOGGER=e.SILENT_LOGGER;exports.buildPrintDocument=e.buildPrintDocument;exports.buildWordHtml=e.buildWordHtml;exports.createDefaultPdfExporter=e.createDefaultPdfExporter;exports.createFetchRequest=e.createFetchRequest;exports.defineMachReportConfig=e.defineMachReportConfig;exports.defineMachReportPreset=e.defineMachReportPreset;exports.joinReportIds=e.joinReportIds;exports.normalizeReportIds=e.normalizeReportIds;exports.printPlans=e.printPlans;exports.provideMachReportConfig=e.provideMachReportConfig;exports.resolveConfig=e.resolveConfig;exports.themeToCssVars=e.themeToCssVars;exports.toErrorDetail=e.toErrorDetail;exports.useMachReportConfig=e.useMachReportConfig;exports.usePageWindow=e.usePageWindow;exports.usePrintExport=e.usePrintExport;exports.useZoom=e.useZoom;exports.MACH_REPORT_CONFIG_KEY=c.MACH_REPORT_CONFIG_KEY;exports.MACH_REPORT_CONTROLLER_KEY=c.MACH_REPORT_CONTROLLER_KEY;exports.MACH_REPORT_FETCHER_KEY=c.MACH_REPORT_FETCHER_KEY;exports.MACH_REPORT_PDF_EXPORTER_KEY=c.MACH_REPORT_PDF_EXPORTER_KEY;exports.MachReportPreview=c.MachReportPreview;exports.machReportPlugin=c.machReportPlugin;exports.createLocalFetcher=p;exports.useMachReport=P;exports.useReportPreview=f;Object.keys(u).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(exports,r)&&Object.defineProperty(exports,r,{enumerable:!0,get:()=>u[r]})});
|
package/dist/vue.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createReportSource as c } from "@agile-team/mach-report";
|
|
2
2
|
export * from "@agile-team/mach-report";
|
|
3
|
-
import { P as s, M as i } from "./ReportPreview-
|
|
4
|
-
import { D as M, a as T, R as x, b as O, c as F, S as v, d as A, e as D, f as b, g as L, h as S, i as j, j as H, n as I, p as k, k as W, r as Y, t as z, l as G, u as K, m as U, o as N, q } from "./ReportPreview-
|
|
5
|
-
import { a as f } from "./plugin-
|
|
6
|
-
import { b as X, c as Z, d as $, M as B, m as J } from "./plugin-
|
|
3
|
+
import { P as s, M as i } from "./ReportPreview-DKjr4cwO.js";
|
|
4
|
+
import { D as M, a as T, R as x, b as O, c as F, S as v, d as A, e as D, f as b, g as L, h as S, i as j, j as H, n as I, p as k, k as W, r as Y, t as z, l as G, u as K, m as U, o as N, q } from "./ReportPreview-DKjr4cwO.js";
|
|
5
|
+
import { a as f } from "./plugin-5R00MJQs.js";
|
|
6
|
+
import { b as X, c as Z, d as $, M as B, m as J } from "./plugin-5R00MJQs.js";
|
|
7
7
|
import { shallowRef as u, computed as p, inject as l } from "vue";
|
|
8
8
|
function m(n) {
|
|
9
9
|
const t = c(n), a = async (r) => {
|