@agile-team/mach-report 2.0.0 → 2.2.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/LICENSE +2 -4
- package/LICENSING.md +15 -0
- package/README.md +317 -76
- package/dist/ReportPreview-BWrQCj9M.js +1643 -0
- package/dist/ReportPreview-DY0PGGqF.cjs +6 -0
- package/dist/grid-geometry-DBH9ExuY.cjs +1 -0
- package/dist/grid-geometry-DONcjshk.js +130 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +806 -13
- package/dist/index.d.ts +806 -13
- package/dist/index.js +1170 -653
- package/dist/page-window-index-CIuT4BAv.js +43 -0
- package/dist/page-window-index-DEjnM6IB.cjs +1 -0
- package/dist/pdf.cjs +48 -48
- package/dist/pdf.d.cts +159 -6
- package/dist/pdf.d.ts +159 -6
- package/dist/pdf.js +3542 -3466
- package/dist/plugin-BMoMUxrw.cjs +1 -0
- package/dist/plugin-CAcNe0FT.js +25 -0
- package/dist/report-params-B3Fia6JO.js +10 -0
- package/dist/report-params-D1gZ1DME.cjs +1 -0
- package/dist/sql.cjs +65 -64
- package/dist/sql.d.cts +109 -5
- package/dist/sql.d.ts +109 -5
- package/dist/sql.js +7947 -7922
- package/dist/style.css +1 -1
- package/dist/textwrap-DdaewxAd.js +117 -0
- package/dist/textwrap-DqiFwAV3.cjs +3 -0
- package/dist/vue/async.d.cts +820 -320
- package/dist/vue/async.d.ts +820 -320
- package/dist/vue/index.d.cts +1374 -14
- package/dist/vue/index.d.ts +1374 -14
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +11 -12
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +129 -49
- package/dist/xlsx.cjs +21 -21
- package/dist/xlsx.d.cts +2300 -5
- package/dist/xlsx.d.ts +2300 -5
- package/dist/xlsx.js +6390 -6347
- package/package.json +8 -3
- package/dist/ReportPreview-Cr0IH1Rz.cjs +0 -6
- package/dist/ReportPreview-DwknBgsJ.js +0 -1266
- package/dist/builder/template-builder.d.ts +0 -69
- package/dist/defaults.d.ts +0 -23
- package/dist/format.d.ts +0 -48
- package/dist/grid-geometry-BXpOxznT.cjs +0 -1
- package/dist/grid-geometry-Bs8QXz1X.js +0 -65
- package/dist/layout/paginate.d.ts +0 -97
- package/dist/layout/textwrap.d.ts +0 -36
- package/dist/pdf/font-loader.d.ts +0 -6
- package/dist/pdf/index.d.ts +0 -2
- package/dist/pdf/render-pdf.d.ts +0 -25
- package/dist/plugin-Cj3c2wJc.cjs +0 -1
- package/dist/plugin-DJf_6_fl.js +0 -18
- package/dist/render/canvas.d.ts +0 -76
- package/dist/render/dom.d.ts +0 -10
- package/dist/render/grid-geometry.d.ts +0 -41
- package/dist/render/style.d.ts +0 -33
- package/dist/render/window.d.ts +0 -23
- package/dist/schema/render-plan.d.ts +0 -88
- package/dist/schema/validate.d.ts +0 -15
- package/dist/sql/ast-check.d.ts +0 -14
- package/dist/sql/compile.d.ts +0 -31
- package/dist/sql/expr.d.ts +0 -21
- package/dist/sql/index.d.ts +0 -4
- package/dist/sql/tokenizer.d.ts +0 -25
- package/dist/style-CFZ-HE2s.cjs +0 -3
- package/dist/style-DnmtG7Gl.js +0 -180
- package/dist/units.d.ts +0 -11
- package/dist/vue/ReportParamPanel.d.ts +0 -19
- package/dist/vue/ReportPreview.d.ts +0 -200
- package/dist/vue/ReportToolbar.d.ts +0 -42
- package/dist/vue/adapters.d.ts +0 -34
- package/dist/vue/composables/useHighlight.d.ts +0 -8
- package/dist/vue/composables/usePageWindow.d.ts +0 -25
- package/dist/vue/composables/usePrintExport.d.ts +0 -40
- package/dist/vue/composables/useReportSearch.d.ts +0 -73
- package/dist/vue/composables/useZoom.d.ts +0 -15
- package/dist/vue/config.d.ts +0 -108
- package/dist/vue/controller.d.ts +0 -29
- package/dist/vue/errors.d.ts +0 -16
- package/dist/vue/injection-keys.d.ts +0 -14
- package/dist/vue/local-adapter.d.ts +0 -11
- package/dist/vue/pdf-exporter.d.ts +0 -13
- package/dist/vue/plugin.d.ts +0 -332
- package/dist/xlsx/render-xlsx.d.ts +0 -20
package/dist/vue-async.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./plugin-BMoMUxrw.cjs");function i(){return Promise.resolve().then(()=>require("./ReportPreview-DY0PGGqF.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,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return import("./ReportPreview-DwknBgsJ.js").then((t) => t.s);
|
|
1
|
+
import { m as o } from "./plugin-CAcNe0FT.js";
|
|
2
|
+
import { M as l } from "./plugin-CAcNe0FT.js";
|
|
3
|
+
function a() {
|
|
4
|
+
return import("./ReportPreview-BWrQCj9M.js").then((t) => t.s);
|
|
6
5
|
}
|
|
7
|
-
const
|
|
8
|
-
install(t,
|
|
9
|
-
|
|
6
|
+
const n = {
|
|
7
|
+
install(t, r = {}) {
|
|
8
|
+
o.install(t, r);
|
|
10
9
|
}
|
|
11
10
|
};
|
|
12
11
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
l as MachReportPreview,
|
|
13
|
+
n as default,
|
|
14
|
+
n as machReportAsyncPlugin,
|
|
15
|
+
a as preloadMachReport
|
|
17
16
|
};
|
package/dist/vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@agile-team/mach-report"),e=require("./ReportPreview-DY0PGGqF.cjs"),c=require("./plugin-BMoMUxrw.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,57 +1,137 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { M as
|
|
5
|
-
import { a as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
for (const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { createReportSource as c } from "@agile-team/mach-report";
|
|
2
|
+
export * from "@agile-team/mach-report";
|
|
3
|
+
import { P as s, M as i } from "./ReportPreview-BWrQCj9M.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-BWrQCj9M.js";
|
|
5
|
+
import { a as f } from "./plugin-CAcNe0FT.js";
|
|
6
|
+
import { b as X, c as Z, d as $, M as B, m as J } from "./plugin-CAcNe0FT.js";
|
|
7
|
+
import { shallowRef as u, computed as p, inject as l } from "vue";
|
|
8
|
+
function m(n) {
|
|
9
|
+
const t = c(n), a = async (r) => {
|
|
10
|
+
if (r.reportIds.length === 0) throw new s("缺少报表 ID");
|
|
11
|
+
for (const e of r.reportIds)
|
|
12
|
+
if (!Object.prototype.hasOwnProperty.call(n, e) || !n[e])
|
|
13
|
+
throw new s(`本地模板 ${e} 不存在`);
|
|
14
|
+
return t(r);
|
|
15
|
+
};
|
|
16
|
+
return a.getParamDefs = t.getParamDefs, a;
|
|
17
|
+
}
|
|
18
|
+
const P = Object.freeze({
|
|
19
|
+
loading: !1,
|
|
20
|
+
hasPlan: !1,
|
|
21
|
+
pageCount: 0,
|
|
22
|
+
currentPage: 1,
|
|
23
|
+
exporting: null,
|
|
24
|
+
printing: !1,
|
|
25
|
+
canExport: !1,
|
|
26
|
+
canPrint: !1,
|
|
27
|
+
error: null,
|
|
28
|
+
pdfFont: Object.freeze({ status: "unchecked", fontUrl: "" })
|
|
29
|
+
});
|
|
30
|
+
function h() {
|
|
31
|
+
const n = u(null), t = () => n.value?.state ?? P, a = Object.freeze({
|
|
32
|
+
get loading() {
|
|
33
|
+
return t().loading;
|
|
34
|
+
},
|
|
35
|
+
get hasPlan() {
|
|
36
|
+
return t().hasPlan;
|
|
37
|
+
},
|
|
38
|
+
get pageCount() {
|
|
39
|
+
return t().pageCount;
|
|
40
|
+
},
|
|
41
|
+
get currentPage() {
|
|
42
|
+
return t().currentPage;
|
|
43
|
+
},
|
|
44
|
+
get exporting() {
|
|
45
|
+
return t().exporting;
|
|
46
|
+
},
|
|
47
|
+
get printing() {
|
|
48
|
+
return t().printing;
|
|
49
|
+
},
|
|
50
|
+
get canExport() {
|
|
51
|
+
return t().canExport;
|
|
52
|
+
},
|
|
53
|
+
get canPrint() {
|
|
54
|
+
return t().canPrint;
|
|
55
|
+
},
|
|
56
|
+
get error() {
|
|
57
|
+
return t().error;
|
|
58
|
+
},
|
|
59
|
+
get pdfFont() {
|
|
60
|
+
return t().pdfFont;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
function r() {
|
|
64
|
+
if (!n.value)
|
|
65
|
+
throw new i("config", "报表预览尚未挂载,请在 ready 后调用控制器");
|
|
66
|
+
return n.value;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
ref(e) {
|
|
70
|
+
const o = e;
|
|
71
|
+
n.value = o && typeof o.reload == "function" && typeof o.print == "function" && typeof o.exportAs == "function" && typeof o.openPdfWindow == "function" && typeof o.gotoPage == "function" && typeof o.setParams == "function" ? o : null;
|
|
72
|
+
},
|
|
73
|
+
ready: p(() => n.value !== null),
|
|
74
|
+
state: a,
|
|
75
|
+
async checkPdfFont() {
|
|
76
|
+
const e = r();
|
|
77
|
+
return e.checkPdfFont ? e.checkPdfFont() : { status: "unverified", fontUrl: "", message: "旧自定义控制器未提供字体检查,请由宿主确认字体配置" };
|
|
78
|
+
},
|
|
79
|
+
async reload() {
|
|
80
|
+
await r().reload();
|
|
81
|
+
},
|
|
82
|
+
async print() {
|
|
83
|
+
await r().print();
|
|
84
|
+
},
|
|
85
|
+
async exportAs(e) {
|
|
86
|
+
await r().exportAs(e);
|
|
87
|
+
},
|
|
88
|
+
openPdfWindow() {
|
|
89
|
+
r().openPdfWindow();
|
|
90
|
+
},
|
|
91
|
+
gotoPage(e) {
|
|
92
|
+
r().gotoPage(e);
|
|
93
|
+
},
|
|
94
|
+
async setParams(e, o) {
|
|
95
|
+
await r().setParams(e, o);
|
|
16
96
|
}
|
|
17
|
-
return { schemaVersion: R, pages: r };
|
|
18
97
|
};
|
|
19
98
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
99
|
+
function w() {
|
|
100
|
+
return l(f, null);
|
|
22
101
|
}
|
|
23
102
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
103
|
+
M as DEFAULT_MESSAGES,
|
|
104
|
+
T as DEFAULT_THEME,
|
|
105
|
+
X as MACH_REPORT_CONFIG_KEY,
|
|
106
|
+
f as MACH_REPORT_CONTROLLER_KEY,
|
|
107
|
+
Z as MACH_REPORT_FETCHER_KEY,
|
|
108
|
+
$ as MACH_REPORT_PDF_EXPORTER_KEY,
|
|
109
|
+
i as MachReportError,
|
|
110
|
+
B as MachReportPreview,
|
|
32
111
|
s as PlanLoadError,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
112
|
+
x as ReportParamPanel,
|
|
113
|
+
O as ReportPreview,
|
|
114
|
+
F as ReportToolbar,
|
|
115
|
+
v as SILENT_LOGGER,
|
|
116
|
+
A as buildPrintDocument,
|
|
117
|
+
D as buildWordHtml,
|
|
118
|
+
b as createDefaultPdfExporter,
|
|
119
|
+
L as createFetchRequest,
|
|
120
|
+
m as createLocalFetcher,
|
|
42
121
|
S as defineMachReportConfig,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
122
|
+
j as defineMachReportPreset,
|
|
123
|
+
H as joinReportIds,
|
|
124
|
+
J as machReportPlugin,
|
|
125
|
+
I as normalizeReportIds,
|
|
126
|
+
k as printPlans,
|
|
127
|
+
W as provideMachReportConfig,
|
|
128
|
+
Y as resolveConfig,
|
|
129
|
+
z as themeToCssVars,
|
|
130
|
+
G as toErrorDetail,
|
|
131
|
+
h as useMachReport,
|
|
132
|
+
K as useMachReportConfig,
|
|
133
|
+
U as usePageWindow,
|
|
134
|
+
N as usePrintExport,
|
|
135
|
+
w as useReportPreview,
|
|
136
|
+
q as useZoom
|
|
57
137
|
};
|