@agile-team/mach-report 0.7.0 → 0.9.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 +107 -0
- package/dist/ReportPreview-BFTfls8h.js +923 -0
- package/dist/ReportPreview-D6VHDUvR.cjs +6 -0
- package/dist/format.d.ts +48 -0
- package/dist/grid-geometry-BXpOxznT.cjs +1 -0
- package/dist/grid-geometry-Bs8QXz1X.js +65 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +858 -660
- package/dist/layout/paginate.d.ts +30 -2
- package/dist/pdf.cjs +46 -46
- package/dist/pdf.js +8 -7
- package/dist/{plugin-Cl-IqCqx.cjs → plugin-9eBK7khj.cjs} +1 -1
- package/dist/{plugin-Dp3kKWiQ.js → plugin-vi2GjP43.js} +3 -3
- package/dist/style-6ihHKVCM.js +192 -0
- package/dist/style-Xq08-IsV.cjs +3 -0
- package/dist/style.css +1 -1
- package/dist/vue/ReportPreview.d.ts +13 -0
- package/dist/vue/ReportToolbar.d.ts +20 -3
- package/dist/vue/async.d.cts +16 -0
- package/dist/vue/async.d.ts +16 -0
- package/dist/vue/composables/useHighlight.d.ts +8 -0
- package/dist/vue/composables/usePageWindow.d.ts +0 -3
- package/dist/vue/composables/usePrintExport.d.ts +8 -0
- package/dist/vue/composables/useReportSearch.d.ts +72 -0
- package/dist/vue/config.d.ts +17 -1
- package/dist/vue/plugin.d.ts +16 -0
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +35 -33
- package/dist/xlsx/render-xlsx.d.ts +20 -0
- package/dist/xlsx.cjs +30 -0
- package/dist/xlsx.d.cts +5 -0
- package/dist/xlsx.d.ts +5 -0
- package/dist/xlsx.js +22648 -0
- package/package.json +15 -2
- package/dist/ReportPreview-CrVeTKu1.cjs +0 -6
- package/dist/ReportPreview-DgsOdO4y.js +0 -559
- package/dist/style-B3vxGDZd.cjs +0 -3
- package/dist/style-B7Xfo5I-.js +0 -255
package/dist/style-B7Xfo5I-.js
DELETED
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
const U = 1.35, W = 10.5, V = 0.75, N = "#333333", O = "#000000", v = "1.0.0-mach", K = "mach-local", G = "jh4j-compatible", J = 25.4, q = 96;
|
|
2
|
-
function b(t = 96) {
|
|
3
|
-
return t / 25.4;
|
|
4
|
-
}
|
|
5
|
-
function Z(t, n = 96) {
|
|
6
|
-
return (t || 0) * b(n);
|
|
7
|
-
}
|
|
8
|
-
function X(t, n = 96) {
|
|
9
|
-
return t / b(n);
|
|
10
|
-
}
|
|
11
|
-
function F(t, n = 96) {
|
|
12
|
-
return t * n / 72;
|
|
13
|
-
}
|
|
14
|
-
function Q(t, n) {
|
|
15
|
-
const a = 10 ** n;
|
|
16
|
-
return Math.round(t * a) / a;
|
|
17
|
-
}
|
|
18
|
-
const Y = {
|
|
19
|
-
a3: { widthMm: 297, heightMm: 420 },
|
|
20
|
-
a4: { widthMm: 210, heightMm: 297 },
|
|
21
|
-
a5: { widthMm: 148, heightMm: 210 },
|
|
22
|
-
b4: { widthMm: 250, heightMm: 353 },
|
|
23
|
-
b5: { widthMm: 176, heightMm: 250 }
|
|
24
|
-
}, j = v;
|
|
25
|
-
function tt(t) {
|
|
26
|
-
if (t && t.code != null && t.code !== 200)
|
|
27
|
-
throw new Error(String(t.message || "渲染计划加载失败"));
|
|
28
|
-
const n = t?.data?.pages;
|
|
29
|
-
return {
|
|
30
|
-
schemaVersion: j,
|
|
31
|
-
pages: Array.isArray(n) ? n : []
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
function nt(t) {
|
|
35
|
-
return (t.kind === "image" || t.kind === "barcode" || t.kind === "qrcode" || t.kind === "chart") && !!t.imageData;
|
|
36
|
-
}
|
|
37
|
-
function et(t) {
|
|
38
|
-
return t.kind === "text" && Array.isArray(t.richParagraphs) && t.richParagraphs.length > 0;
|
|
39
|
-
}
|
|
40
|
-
const D = /[\u3000-\u9fff\uff00-\uffef]/, S = new Uint8Array(128);
|
|
41
|
-
{
|
|
42
|
-
for (const t of "iljtf.,:;'`|!()[]") S[t.charCodeAt(0)] = 1;
|
|
43
|
-
for (const t of "mwMW@") S[t.charCodeAt(0)] = 2;
|
|
44
|
-
for (let t = 48; t <= 57; t++) S[t] = 3;
|
|
45
|
-
for (let t = 65; t <= 90; t++) S[t] = 4;
|
|
46
|
-
S[32] = 5;
|
|
47
|
-
}
|
|
48
|
-
const y = [0.54, 0.26, 0.95, 0.59, 0.67, 0.3];
|
|
49
|
-
function B(t) {
|
|
50
|
-
const n = t.charCodeAt(0);
|
|
51
|
-
return n < 128 ? y[S[n]] : D.test(t) ? 1 : /[A-Z]/.test(t) ? 0.67 : 0.54;
|
|
52
|
-
}
|
|
53
|
-
const P = {
|
|
54
|
-
measureMm(t, n) {
|
|
55
|
-
const { fontSizePt: a, bold: c = !1, letterSpacingPt: u = 0 } = n, o = 25.4 / 72;
|
|
56
|
-
let i = 0;
|
|
57
|
-
for (const r of t)
|
|
58
|
-
i += B(r);
|
|
59
|
-
return c && (i *= 1.04), (i * a + u * t.length) * o;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
function ot() {
|
|
63
|
-
return P;
|
|
64
|
-
}
|
|
65
|
-
function rt(t, n) {
|
|
66
|
-
return P.measureMm(t, n);
|
|
67
|
-
}
|
|
68
|
-
function st(t) {
|
|
69
|
-
let n;
|
|
70
|
-
return {
|
|
71
|
-
measureMm(a, c) {
|
|
72
|
-
if (n === void 0 && (n = t()), !n) return P.measureMm(a, c);
|
|
73
|
-
const u = c.fontSizePt * 96 / 72;
|
|
74
|
-
return n.font = `${c.bold ? "bold " : ""}${u}px sans-serif`, n.measureText(a).width * 25.4 / 96;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
function $(t, n, a) {
|
|
79
|
-
const c = [];
|
|
80
|
-
let u = "", o = 0;
|
|
81
|
-
const i = () => {
|
|
82
|
-
u && (c.push({ text: u, widthMm: o, cjk: !1 }), u = "", o = 0);
|
|
83
|
-
};
|
|
84
|
-
for (const r of t) {
|
|
85
|
-
if (r === `
|
|
86
|
-
`) {
|
|
87
|
-
i(), c.push({ text: `
|
|
88
|
-
`, widthMm: 0, cjk: !1, br: !0 });
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
91
|
-
if (r === " ") {
|
|
92
|
-
i(), c.push({ text: r, widthMm: a.measureMm(r, n), cjk: !1, space: !0 });
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
|
-
if (D.test(r)) {
|
|
96
|
-
i(), c.push({ text: r, widthMm: a.measureMm(r, n), cjk: !0 });
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
99
|
-
u += r, o += a.measureMm(r, n);
|
|
100
|
-
}
|
|
101
|
-
return i(), c;
|
|
102
|
-
}
|
|
103
|
-
function ct(t, n, a, c = P) {
|
|
104
|
-
if (!t) return [""];
|
|
105
|
-
const u = [];
|
|
106
|
-
let o = "", i = 0;
|
|
107
|
-
const r = () => {
|
|
108
|
-
u.push(o), o = "", i = 0;
|
|
109
|
-
};
|
|
110
|
-
for (const h of $(t, a, c)) {
|
|
111
|
-
if (h.br) {
|
|
112
|
-
r();
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
if (i + h.widthMm <= n) {
|
|
116
|
-
o += h.text, i += h.widthMm;
|
|
117
|
-
continue;
|
|
118
|
-
}
|
|
119
|
-
if (h.space) {
|
|
120
|
-
r();
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
if (h.cjk) {
|
|
124
|
-
o.length > 0 && r(), o = h.text, i = h.widthMm;
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
if (o.length > 0 && r(), h.widthMm <= n) {
|
|
128
|
-
o = h.text, i = h.widthMm;
|
|
129
|
-
continue;
|
|
130
|
-
}
|
|
131
|
-
for (const M of h.text) {
|
|
132
|
-
const w = c.measureMm(M, a);
|
|
133
|
-
i + w > n && o.length > 0 && r(), o += M, i += w;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return r(), u;
|
|
137
|
-
}
|
|
138
|
-
function k(t, n) {
|
|
139
|
-
const a = t.length;
|
|
140
|
-
if (a === 0) return [];
|
|
141
|
-
const c = t.reduce((r, h) => r + h, 0), u = c > 0 && n > 0 ? n / c : 1, o = [];
|
|
142
|
-
let i = 0;
|
|
143
|
-
for (let r = 0; r < a; r++) {
|
|
144
|
-
const h = Math.max(0, t[r] * u);
|
|
145
|
-
o.push({ pos: i, size: h }), i += h;
|
|
146
|
-
}
|
|
147
|
-
return o;
|
|
148
|
-
}
|
|
149
|
-
function at(t, n, a) {
|
|
150
|
-
const c = t.cells ?? [], u = Math.max(c.length, 1), o = t.colWidthsMm?.length ?? Math.max(1, ...c.map((e) => Array.isArray(e) ? e.length : 0)), i = t.colWidthsMm?.length ? k(t.colWidthsMm, n) : Array.from({ length: o }, (e, s) => ({
|
|
151
|
-
pos: n * s / o,
|
|
152
|
-
size: n / o
|
|
153
|
-
})), r = (e) => e <= 0 ? 0 : e >= o ? i[i.length - 1].pos + i[i.length - 1].size : i[e].pos, h = t.rowHeightsMm?.length ? k(t.rowHeightsMm, a) : Array.from({ length: u }, (e, s) => ({
|
|
154
|
-
pos: a * s / u,
|
|
155
|
-
size: a / u
|
|
156
|
-
})), M = (e) => e <= 0 ? 0 : e >= u ? h[h.length - 1].pos + h[h.length - 1].size : h[e].pos, w = /* @__PURE__ */ new Set(), A = (e, s) => `${e}:${s}`, T = [], x = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set(), C = (e, s) => `v${e}:${s}`, R = (e, s) => `h${e}:${s}`;
|
|
157
|
-
c.forEach((e, s) => {
|
|
158
|
-
if (!Array.isArray(e)) return;
|
|
159
|
-
let f = 0;
|
|
160
|
-
for (const m of e) {
|
|
161
|
-
for (; f < o && w.has(A(s, f)); ) f++;
|
|
162
|
-
if (f >= o) break;
|
|
163
|
-
const H = Math.max(1, Math.min(m?.colSpan ?? 1, o - f)), z = Math.max(1, m?.rowSpan ?? 1), _ = Math.min(u, s + z), g = Math.min(o, f + H);
|
|
164
|
-
for (let l = s; l < _; l++)
|
|
165
|
-
for (let d = f; d < g; d++)
|
|
166
|
-
w.add(A(l, d));
|
|
167
|
-
for (let l = f + 1; l < g; l++)
|
|
168
|
-
for (let d = s; d < _; d++) x.add(C(l, d));
|
|
169
|
-
for (let l = s + 1; l < _; l++)
|
|
170
|
-
for (let d = f; d < g; d++) p.add(R(l, d));
|
|
171
|
-
const L = r(f), I = M(s);
|
|
172
|
-
T.push({
|
|
173
|
-
ri: s,
|
|
174
|
-
ci: f,
|
|
175
|
-
cell: m ?? {},
|
|
176
|
-
xMm: L,
|
|
177
|
-
yMm: I,
|
|
178
|
-
widthMm: r(g) - L,
|
|
179
|
-
heightMm: M(_) - I
|
|
180
|
-
}), f = g;
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
const E = [];
|
|
184
|
-
for (let e = 1; e < o; e++) {
|
|
185
|
-
let s = -1;
|
|
186
|
-
for (let f = 0; f <= u; f++) {
|
|
187
|
-
const m = f < u && !x.has(C(e, f));
|
|
188
|
-
m && s < 0 && (s = f), !m && s >= 0 && (E.push({ kind: "v", pos: r(e), from: M(s), to: M(f) }), s = -1);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
for (let e = 1; e < u; e++) {
|
|
192
|
-
let s = -1;
|
|
193
|
-
for (let f = 0; f <= o; f++) {
|
|
194
|
-
const m = f < o && !p.has(R(e, f));
|
|
195
|
-
m && s < 0 && (s = f), !m && s >= 0 && (E.push({ kind: "h", pos: M(e), from: r(s), to: r(f) }), s = -1);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
return { columns: i, rows: h, cells: T, edges: E };
|
|
199
|
-
}
|
|
200
|
-
function it(t, n = 96, a = 10.5) {
|
|
201
|
-
if (t?.fontSizePx != null)
|
|
202
|
-
return { fontSizePt: t.fontSizePx * 72 / n, fontSizePx: t.fontSizePx };
|
|
203
|
-
const c = t?.fontSize ?? a;
|
|
204
|
-
return { fontSizePt: c, fontSizePx: F(c, n) };
|
|
205
|
-
}
|
|
206
|
-
function ft(t, n = N) {
|
|
207
|
-
return {
|
|
208
|
-
color: t?.borderColor ?? t?.lineColor ?? n,
|
|
209
|
-
widthPt: t?.lineWidthPt ?? 0.75
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
function ut(t, n = O) {
|
|
213
|
-
return t?.color ?? n;
|
|
214
|
-
}
|
|
215
|
-
function ht(t) {
|
|
216
|
-
return t?.lineHeight ?? 1.35;
|
|
217
|
-
}
|
|
218
|
-
function lt(t) {
|
|
219
|
-
const n = t?.borderTop !== !1, a = t?.borderRight !== !1, c = t?.borderBottom !== !1, u = t?.borderLeft !== !1;
|
|
220
|
-
return { top: n, right: a, bottom: c, left: u, inner: n || a || c || u };
|
|
221
|
-
}
|
|
222
|
-
export {
|
|
223
|
-
q as C,
|
|
224
|
-
W as D,
|
|
225
|
-
U as L,
|
|
226
|
-
J as M,
|
|
227
|
-
Y as P,
|
|
228
|
-
j as R,
|
|
229
|
-
G as S,
|
|
230
|
-
it as a,
|
|
231
|
-
et as b,
|
|
232
|
-
ft as c,
|
|
233
|
-
lt as d,
|
|
234
|
-
ht as e,
|
|
235
|
-
ut as f,
|
|
236
|
-
at as g,
|
|
237
|
-
P as h,
|
|
238
|
-
nt as i,
|
|
239
|
-
O as j,
|
|
240
|
-
V as k,
|
|
241
|
-
N as l,
|
|
242
|
-
Z as m,
|
|
243
|
-
K as n,
|
|
244
|
-
v as o,
|
|
245
|
-
F as p,
|
|
246
|
-
B as q,
|
|
247
|
-
Q as r,
|
|
248
|
-
st as s,
|
|
249
|
-
ot as t,
|
|
250
|
-
rt as u,
|
|
251
|
-
b as v,
|
|
252
|
-
ct as w,
|
|
253
|
-
X as x,
|
|
254
|
-
tt as y
|
|
255
|
-
};
|