@work-zhanguo/light-file-preview 0.0.9 → 0.0.10
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 +2 -1
- package/dist/{SheetRenderer-CXOjo3C1.js → SheetRenderer-BKPeruxM.js} +78 -78
- package/dist/{UnsupportedRenderer-DA6ZSyt7.js → UnsupportedRenderer-BRF9UR6f.js} +1 -1
- package/dist/{index-CZ37tDnP.js → index-oYHcrPrC.js} +1 -1
- package/dist/light-file-preview.js +1 -1
- package/dist/light-file-preview.umd.cjs +1 -1
- package/dist/standalone/light-file-preview.iife.js +1 -1
- package/dist/standalone/style.css +1 -1
- package/dist/style.css +1 -1
- package/dist/vue2/{DocxRenderer-pUvnG-5n.js → DocxRenderer-Bk-5tRGu.js} +1 -1
- package/dist/vue2/{PdfRenderer-BDChtpiV.js → PdfRenderer-DBwkkyLH.js} +1 -1
- package/dist/vue2/{SheetRenderer-BATFlzFf.js → SheetRenderer-CwHe3Zbi.js} +18 -18
- package/dist/vue2/{TextRenderer-Bg2LfLu7.js → TextRenderer-D9n2ML4j.js} +1 -1
- package/dist/vue2/{UnsupportedRenderer-CljMmiGZ.js → UnsupportedRenderer-DZ7IShnW.js} +1 -1
- package/dist/vue2/light-file-preview-vue2.js +1 -1
- package/dist/vue2/light-file-preview-vue2.umd.cjs +1 -1
- package/dist/vue2/{vue2-CNyOC3tL.js → vue2-BEoHyqmm.js} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
用于业务系统里的附件预览,支持传入文件路径、远程地址和本地文件,接入方式尽量保持简单。
|
|
10
10
|
|
|
11
|
-
当前版本:`0.0.
|
|
11
|
+
当前版本:`0.0.10`
|
|
12
12
|
|
|
13
13
|
最近更新:
|
|
14
14
|
|
|
15
|
+
- `0.0.10`:优化 `xlsx` 预览密度,降低默认列宽和行高,减少横向滚动距离,整体样式更接近 Office
|
|
15
16
|
- `0.0.9`:优化 `xlsx` 图片锚点尺寸和裁切边界,补充更接近 Excel 的公式栏名字框与编辑条样式
|
|
16
17
|
- `0.0.8`:优化 `xlsx` 预览,补充工作表页签、首行首列编号区、冻结观感、单元格 hover / 选中高亮,并补充组件属性说明
|
|
17
18
|
- `0.0.7`:修复 Vue2 `vue-cli / webpack4` 项目引入 PDF 预览时报 `import.meta.url`、`process.getBuiltinModule` 解析错误
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as kt, ref as L, computed as ke, onMounted as Nt, onBeforeUnmount as At, openBlock as d, createElementBlock as m, createElementVNode as u, Fragment as U, renderList as
|
|
1
|
+
import { defineComponent as kt, ref as L, computed as ke, onMounted as Nt, onBeforeUnmount as At, openBlock as d, createElementBlock as m, createElementVNode as u, Fragment as U, renderList as M, normalizeClass as pe, toDisplayString as b, createCommentVNode as Ne, createTextVNode as tt, normalizeStyle as H } from "vue";
|
|
2
2
|
import { r as Dt } from "./text-Bqxn_tMI.js";
|
|
3
3
|
const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolbar" }, Tt = {
|
|
4
4
|
key: 0,
|
|
@@ -8,10 +8,10 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
8
8
|
}, Ot = ["onClick"], Bt = { class: "lfp-sheet__tab-label" }, Ft = { class: "lfp-sheet__tab-meta" }, Vt = {
|
|
9
9
|
key: 1,
|
|
10
10
|
class: "lfp-sheet__summary"
|
|
11
|
-
}, Lt = { class: "lfp-sheet__summary-item" }, Ut = { class: "lfp-sheet__summary-item" },
|
|
11
|
+
}, Lt = { class: "lfp-sheet__summary-item" }, Ut = { class: "lfp-sheet__summary-item" }, Mt = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "lfp-sheet__formula-bar"
|
|
14
|
-
},
|
|
14
|
+
}, Ht = { class: "lfp-sheet__name-box" }, Wt = { class: "lfp-sheet__name-box-text" }, jt = { class: "lfp-sheet__formula-input" }, zt = { class: "lfp-sheet__formula-text" }, Pt = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "lfp-hint"
|
|
17
17
|
}, Kt = {
|
|
@@ -23,7 +23,7 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
23
23
|
}, Xt = ["src", "alt"], eo = {
|
|
24
24
|
key: 3,
|
|
25
25
|
class: "lfp-sheet__empty"
|
|
26
|
-
}, to =
|
|
26
|
+
}, to = 28, oo = 14, W = 46, he = 28, Me = 24, ot = 64, so = /* @__PURE__ */ kt({
|
|
27
27
|
__name: "SheetRenderer",
|
|
28
28
|
props: {
|
|
29
29
|
source: {},
|
|
@@ -31,12 +31,12 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
31
31
|
maxCols: {}
|
|
32
32
|
},
|
|
33
33
|
emits: ["loading", "error"],
|
|
34
|
-
setup(nt, { emit:
|
|
35
|
-
const Ae = nt, De =
|
|
34
|
+
setup(nt, { emit: rt }) {
|
|
35
|
+
const Ae = nt, De = rt, He = new AbortController(), Ee = L(0), j = L([]), C = L(""), Ie = L(null), Te = L(null), Oe = L([]), c = ke(() => j.value[Ee.value]), We = ke(() => {
|
|
36
36
|
var t;
|
|
37
37
|
const e = c.value;
|
|
38
38
|
return !e || !C.value ? null : (t = e.cellMap[C.value]) != null ? t : null;
|
|
39
|
-
}),
|
|
39
|
+
}), st = ke(() => {
|
|
40
40
|
var e, t;
|
|
41
41
|
return (t = (e = We.value) == null ? void 0 : e.address) != null ? t : "A1";
|
|
42
42
|
}), lt = ke(() => {
|
|
@@ -103,21 +103,21 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
103
103
|
return `#${o}`;
|
|
104
104
|
}
|
|
105
105
|
function be(e, t, o) {
|
|
106
|
-
var
|
|
106
|
+
var r;
|
|
107
107
|
if (!o)
|
|
108
108
|
return;
|
|
109
|
-
const n = ct(o.style),
|
|
110
|
-
n && (t === "left" ? e.borderLeft = `${n} ${
|
|
109
|
+
const n = ct(o.style), s = (r = ge(o.color)) != null ? r : "rgba(31, 44, 61, 0.12)";
|
|
110
|
+
n && (t === "left" ? e.borderLeft = `${n} ${s}` : t === "right" ? e.borderRight = `${n} ${s}` : t === "top" ? e.borderTop = `${n} ${s}` : t === "bottom" && (e.borderBottom = `${n} ${s}`));
|
|
111
111
|
}
|
|
112
112
|
function qe(e) {
|
|
113
113
|
const t = typeof (e == null ? void 0 : e.hpx) == "number" ? e.hpx : typeof (e == null ? void 0 : e.hpt) == "number" ? e.hpt * 1.3334 : void 0;
|
|
114
|
-
return Math.max(t != null ? t :
|
|
114
|
+
return Math.max(t != null ? t : Me, Me);
|
|
115
115
|
}
|
|
116
116
|
function ut(e) {
|
|
117
117
|
return { height: `${qe(e)}px` };
|
|
118
118
|
}
|
|
119
119
|
function Ze(e) {
|
|
120
|
-
return typeof (e == null ? void 0 : e.wpx) == "number" ? Math.max(e.wpx,
|
|
120
|
+
return typeof (e == null ? void 0 : e.wpx) == "number" ? Math.max(e.wpx, 42) : typeof (e == null ? void 0 : e.width) == "number" ? Math.max(Math.round(e.width * 7.2 + 5), 42) : ot;
|
|
121
121
|
}
|
|
122
122
|
function Je(e) {
|
|
123
123
|
return `${Ze(e)}px`;
|
|
@@ -133,30 +133,30 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
133
133
|
const n = {};
|
|
134
134
|
if (o ? (n.minWidth = o, n.width = o) : t && (n.minWidth = t, n.width = t), !(e != null && e.s) || typeof e.s != "object")
|
|
135
135
|
return n;
|
|
136
|
-
const
|
|
137
|
-
return a && (
|
|
136
|
+
const s = e.s.fill, r = e.s.font, l = e.s.border, a = (f = ge(s == null ? void 0 : s.fgColor)) != null ? f : ge(s == null ? void 0 : s.bgColor), h = ge(r == null ? void 0 : r.color);
|
|
137
|
+
return a && (s == null ? void 0 : s.patternType) !== "none" && (n.backgroundColor = a), h && (n.color = h), r != null && r.bold && (n.fontWeight = "700"), r != null && r.italic && (n.fontStyle = "italic"), r != null && r.underline && (n.textDecoration = "underline"), typeof (r == null ? void 0 : r.sz) == "number" && (n.fontSize = `${r.sz}px`), typeof (r == null ? void 0 : r.name) == "string" && r.name.trim() && (n.fontFamily = r.name), Object.assign(n, ft(e.s.alignment)), be(n, "left", l == null ? void 0 : l.left), be(n, "right", l == null ? void 0 : l.right), be(n, "top", l == null ? void 0 : l.top), be(n, "bottom", l == null ? void 0 : l.bottom), n;
|
|
138
138
|
}
|
|
139
139
|
function mt(e, t) {
|
|
140
140
|
var o, n;
|
|
141
141
|
return t ? typeof t.w == "string" ? t.w : (o = e.utils) != null && o.format_cell ? String(e.utils.format_cell(t, (n = t.v) != null ? n : "")) : t.v != null ? String(t.v) : typeof t.f == "string" && t.f.trim() ? `=${t.f}` : "" : "";
|
|
142
142
|
}
|
|
143
143
|
function pt(e, t, o) {
|
|
144
|
-
const n = /* @__PURE__ */ new Set(),
|
|
145
|
-
for (const
|
|
146
|
-
const l = t.filter((f) => f >=
|
|
144
|
+
const n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Map();
|
|
145
|
+
for (const r of e) {
|
|
146
|
+
const l = t.filter((f) => f >= r.s.r && f <= r.e.r), a = o.filter((f) => f >= r.s.c && f <= r.e.c);
|
|
147
147
|
if (!l.length || !a.length)
|
|
148
148
|
continue;
|
|
149
|
-
const h = `${
|
|
150
|
-
|
|
149
|
+
const h = `${r.s.r}:${r.s.c}`;
|
|
150
|
+
s.set(h, {
|
|
151
151
|
rowSpan: l.length,
|
|
152
152
|
colSpan: a.length,
|
|
153
153
|
colsInRange: a
|
|
154
154
|
});
|
|
155
155
|
for (const f of l)
|
|
156
156
|
for (const _ of a)
|
|
157
|
-
f ===
|
|
157
|
+
f === r.s.r && _ === r.s.c || n.add(`${f}:${_}`);
|
|
158
158
|
}
|
|
159
|
-
return { coveredCells: n, mergeStarts:
|
|
159
|
+
return { coveredCells: n, mergeStarts: s };
|
|
160
160
|
}
|
|
161
161
|
function Qe(e) {
|
|
162
162
|
return e ? e instanceof Uint8Array ? e : e instanceof ArrayBuffer ? new Uint8Array(e) : typeof e == "string" ? new TextEncoder().encode(e) : null : null;
|
|
@@ -184,8 +184,8 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
184
184
|
return e && (o = Array.from(e.getElementsByTagName("*")).find((n) => n.localName === t)) != null ? o : null;
|
|
185
185
|
}
|
|
186
186
|
function S(e, t) {
|
|
187
|
-
var
|
|
188
|
-
const o = (
|
|
187
|
+
var s, r;
|
|
188
|
+
const o = (r = (s = ye(e, t)) == null ? void 0 : s.textContent) != null ? r : "", n = Number.parseInt(o, 10);
|
|
189
189
|
return Number.isFinite(n) ? n : 0;
|
|
190
190
|
}
|
|
191
191
|
function Ye(e) {
|
|
@@ -198,38 +198,38 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
198
198
|
const o = e.split("/");
|
|
199
199
|
o.pop();
|
|
200
200
|
const n = t.split("/");
|
|
201
|
-
for (const
|
|
202
|
-
!
|
|
201
|
+
for (const s of n)
|
|
202
|
+
!s || s === "." || (s === ".." ? o.pop() : o.push(s));
|
|
203
203
|
return o.join("/");
|
|
204
204
|
}
|
|
205
205
|
function Ve(e, t) {
|
|
206
|
-
var
|
|
207
|
-
const o = ve((
|
|
206
|
+
var r;
|
|
207
|
+
const o = ve((r = e[t]) == null ? void 0 : r.content), n = _e(o);
|
|
208
208
|
if (!n)
|
|
209
209
|
return {};
|
|
210
|
-
const
|
|
210
|
+
const s = {};
|
|
211
211
|
for (const l of Array.from(n.getElementsByTagName("*"))) {
|
|
212
212
|
if (l.localName !== "Relationship")
|
|
213
213
|
continue;
|
|
214
214
|
const a = l.getAttribute("Id"), h = l.getAttribute("Target");
|
|
215
|
-
a && h && (
|
|
215
|
+
a && h && (s[a] = h);
|
|
216
216
|
}
|
|
217
|
-
return
|
|
217
|
+
return s;
|
|
218
218
|
}
|
|
219
219
|
function ht(e) {
|
|
220
|
-
var
|
|
221
|
-
const t = "xl/workbook.xml", o = _e(ve((
|
|
220
|
+
var s;
|
|
221
|
+
const t = "xl/workbook.xml", o = _e(ve((s = e[t]) == null ? void 0 : s.content));
|
|
222
222
|
if (!o)
|
|
223
223
|
return [];
|
|
224
224
|
const n = Ve(e, "xl/_rels/workbook.xml.rels");
|
|
225
|
-
return Array.from(o.getElementsByTagName("*")).filter((
|
|
225
|
+
return Array.from(o.getElementsByTagName("*")).filter((r) => r.localName === "sheet").map((r) => {
|
|
226
226
|
var a, h, f, _;
|
|
227
|
-
const l = (h = (a =
|
|
227
|
+
const l = (h = (a = r.getAttribute("r:id")) != null ? a : r.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id")) != null ? h : "";
|
|
228
228
|
return {
|
|
229
|
-
name: (f =
|
|
229
|
+
name: (f = r.getAttribute("name")) != null ? f : "",
|
|
230
230
|
path: Fe(t, (_ = n[l]) != null ? _ : "")
|
|
231
231
|
};
|
|
232
|
-
}).filter((
|
|
232
|
+
}).filter((r) => r.name && r.path);
|
|
233
233
|
}
|
|
234
234
|
function gt(e) {
|
|
235
235
|
var o;
|
|
@@ -240,20 +240,20 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
240
240
|
return e / 9525;
|
|
241
241
|
}
|
|
242
242
|
function we(e, t, o, n) {
|
|
243
|
-
var
|
|
244
|
-
let
|
|
243
|
+
var r;
|
|
244
|
+
let s = n;
|
|
245
245
|
for (let l = 0; l < e.length; l += 1) {
|
|
246
246
|
if (e[l] === o)
|
|
247
|
-
return
|
|
248
|
-
|
|
247
|
+
return s;
|
|
248
|
+
s += (r = t[l]) != null ? r : 0;
|
|
249
249
|
}
|
|
250
250
|
return null;
|
|
251
251
|
}
|
|
252
252
|
function xe(e, t, o) {
|
|
253
253
|
return Math.min(Math.max(e, t), o);
|
|
254
254
|
}
|
|
255
|
-
function bt(e, t, o, n,
|
|
256
|
-
var Re, J, Q, Y, X, ee, te, oe, ne,
|
|
255
|
+
function bt(e, t, o, n, s, r) {
|
|
256
|
+
var Re, J, Q, Y, X, ee, te, oe, ne, re, se, le, ie;
|
|
257
257
|
const l = _e(ve((Re = e[t]) == null ? void 0 : Re.content));
|
|
258
258
|
if (!l)
|
|
259
259
|
return [];
|
|
@@ -270,10 +270,10 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
270
270
|
let G = W, q = he;
|
|
271
271
|
n.forEach((p, R) => {
|
|
272
272
|
var g;
|
|
273
|
-
P.set(p, G), G += (g =
|
|
273
|
+
P.set(p, G), G += (g = r[R]) != null ? g : ot;
|
|
274
274
|
}), o.forEach((p, R) => {
|
|
275
275
|
var g;
|
|
276
|
-
K.set(p, q), q += (g =
|
|
276
|
+
K.set(p, q), q += (g = s[R]) != null ? g : Me;
|
|
277
277
|
});
|
|
278
278
|
const Z = G, B = q, Ce = [], $e = Array.from(x.getElementsByTagName("*")).filter(
|
|
279
279
|
(p) => ["oneCellAnchor", "twoCellAnchor"].includes(p.localName)
|
|
@@ -285,17 +285,17 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
285
285
|
const ae = Fe(_, (oe = $[i]) != null ? oe : ""), A = Qe((ne = e[ae]) == null ? void 0 : ne.content);
|
|
286
286
|
if (!A)
|
|
287
287
|
continue;
|
|
288
|
-
const D = ye(p, "from"), ce = S(D, "col"), ue = S(D, "row"), fe = we(n,
|
|
288
|
+
const D = ye(p, "from"), ce = S(D, "col"), ue = S(D, "row"), fe = we(n, r, ce, W), de = we(o, s, ue, he);
|
|
289
289
|
if (fe == null || de == null)
|
|
290
290
|
continue;
|
|
291
291
|
const Se = O(S(D, "colOff")), E = O(S(D, "rowOff")), k = fe + Se, I = de + E;
|
|
292
292
|
let y = 160, v = 120;
|
|
293
293
|
if (p.localName === "twoCellAnchor") {
|
|
294
|
-
const w = ye(p, "to"), wt = S(w, "col"), xt = S(w, "row"), Ct = O(S(w, "colOff")), $t = O(S(w, "rowOff")), Le = we(n,
|
|
294
|
+
const w = ye(p, "to"), wt = S(w, "col"), xt = S(w, "row"), Ct = O(S(w, "colOff")), $t = O(S(w, "rowOff")), Le = we(n, r, wt, W), Ue = we(o, s, xt, he), Rt = (Le != null ? Le : Z) + Ct, St = (Ue != null ? Ue : B) + $t;
|
|
295
295
|
y = Math.max(Rt - k, 32), v = Math.max(St - I, 32);
|
|
296
296
|
} else {
|
|
297
297
|
const w = ye(p, "ext");
|
|
298
|
-
y = Math.max(O(Number.parseInt((
|
|
298
|
+
y = Math.max(O(Number.parseInt((re = w == null ? void 0 : w.getAttribute("cx")) != null ? re : "0", 10)), 32), v = Math.max(O(Number.parseInt((se = w == null ? void 0 : w.getAttribute("cy")) != null ? se : "0", 10)), 32);
|
|
299
299
|
}
|
|
300
300
|
const F = xe(k, W, Z), T = xe(I, he, B), N = xe(k + y, W, Z), V = xe(I + v, he, B), me = N - F, Xe = V - T;
|
|
301
301
|
if (me <= 6 || Xe <= 6)
|
|
@@ -321,9 +321,9 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
321
321
|
}
|
|
322
322
|
return Ce;
|
|
323
323
|
}
|
|
324
|
-
function vt(e, t, o, n,
|
|
325
|
-
var J, Q, Y, X, ee, te, oe, ne,
|
|
326
|
-
const
|
|
324
|
+
function vt(e, t, o, n, s) {
|
|
325
|
+
var J, Q, Y, X, ee, te, oe, ne, re, se, le, ie, p, R, g;
|
|
326
|
+
const r = (J = o["!ref"]) != null ? J : "A1", l = e.utils.decode_range(r), a = Math.max(Math.min(Ae.maxRows, Math.max(l.e.r + 1, to)), 1), h = Math.max(Math.min(Ae.maxCols, Math.max(l.e.c + 1, oo)), 1), f = [], _ = [], x = [], $ = [], P = [], K = [];
|
|
327
327
|
for (let i = 0; i <= l.e.r; i += 1)
|
|
328
328
|
(Y = (Q = o["!rows"]) == null ? void 0 : Q[i]) != null && Y.hidden || f.push(i);
|
|
329
329
|
for (let i = 0; i <= l.e.c; i += 1)
|
|
@@ -331,7 +331,7 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
331
331
|
for (let i = 0; i < a; i += 1)
|
|
332
332
|
(oe = (te = o["!rows"]) == null ? void 0 : te[i]) != null && oe.hidden || (x.push(i), P.push(qe((ne = o["!rows"]) == null ? void 0 : ne[i])));
|
|
333
333
|
for (let i = 0; i < h; i += 1)
|
|
334
|
-
(
|
|
334
|
+
(se = (re = o["!cols"]) == null ? void 0 : re[i]) != null && se.hidden || ($.push(i), K.push(Ze((le = o["!cols"]) == null ? void 0 : le[i])));
|
|
335
335
|
const G = (ie = o["!merges"]) != null ? ie : [], { coveredCells: q, mergeStarts: Z } = pt(G, x, $), B = {}, Ce = x.map((i) => {
|
|
336
336
|
var ce, ue, fe, de, Se;
|
|
337
337
|
const ae = (ce = o["!rows"]) == null ? void 0 : ce[i], A = ut(ae), D = [];
|
|
@@ -368,7 +368,7 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
368
368
|
cells: D,
|
|
369
369
|
style: A
|
|
370
370
|
};
|
|
371
|
-
}), $e = (p =
|
|
371
|
+
}), $e = (p = s[t]) != null ? p : "", Re = $e ? bt(n, $e, x, $, P, K) : [];
|
|
372
372
|
return {
|
|
373
373
|
name: t,
|
|
374
374
|
rows: Ce,
|
|
@@ -390,20 +390,20 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
390
390
|
var e;
|
|
391
391
|
De("loading", !0), je();
|
|
392
392
|
try {
|
|
393
|
-
const t = await Dt(Ae.source,
|
|
393
|
+
const t = await Dt(Ae.source, He.signal), o = await import("./xlsx-j9Zzywas.js"), n = o.read(t, {
|
|
394
394
|
type: "array",
|
|
395
395
|
cellStyles: !0,
|
|
396
396
|
cellNF: !0,
|
|
397
397
|
cellText: !0,
|
|
398
398
|
cellFormula: !0,
|
|
399
399
|
bookFiles: !0
|
|
400
|
-
}),
|
|
400
|
+
}), s = (e = n.files) != null ? e : {}, r = ht(s), l = Object.fromEntries(r.map((a) => [a.name, a.path]));
|
|
401
401
|
j.value = n.SheetNames.map(
|
|
402
402
|
(a) => vt(
|
|
403
403
|
o,
|
|
404
404
|
a,
|
|
405
405
|
n.Sheets[a],
|
|
406
|
-
|
|
406
|
+
s,
|
|
407
407
|
l
|
|
408
408
|
)
|
|
409
409
|
), ze(0);
|
|
@@ -416,15 +416,15 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
416
416
|
return Nt(() => {
|
|
417
417
|
_t();
|
|
418
418
|
}), At(() => {
|
|
419
|
-
|
|
419
|
+
He.abort(), je();
|
|
420
420
|
}), (e, t) => (d(), m("div", Et, [
|
|
421
421
|
u("div", It, [
|
|
422
422
|
j.value.length > 1 ? (d(), m("div", Tt, [
|
|
423
|
-
(d(!0), m(U, null,
|
|
423
|
+
(d(!0), m(U, null, M(j.value, (o, n) => (d(), m("button", {
|
|
424
424
|
key: o.name,
|
|
425
425
|
class: pe(["lfp-sheet__tab", { "is-active": n === Ee.value }]),
|
|
426
426
|
type: "button",
|
|
427
|
-
onClick: (
|
|
427
|
+
onClick: (s) => ze(n)
|
|
428
428
|
}, [
|
|
429
429
|
u("span", Bt, b(o.name), 1),
|
|
430
430
|
u("span", Ft, b(o.totalRows) + " × " + b(o.totalCols), 1)
|
|
@@ -441,9 +441,9 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
441
441
|
])
|
|
442
442
|
])) : Ne("", !0)
|
|
443
443
|
]),
|
|
444
|
-
c.value ? (d(), m("div",
|
|
445
|
-
u("span",
|
|
446
|
-
u("span", Wt, b(
|
|
444
|
+
c.value ? (d(), m("div", Mt, [
|
|
445
|
+
u("span", Ht, [
|
|
446
|
+
u("span", Wt, b(st.value), 1),
|
|
447
447
|
t[4] || (t[4] = u("span", {
|
|
448
448
|
class: "lfp-sheet__name-box-caret",
|
|
449
449
|
"aria-hidden": "true"
|
|
@@ -460,11 +460,11 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
460
460
|
u("table", qt, [
|
|
461
461
|
u("colgroup", null, [
|
|
462
462
|
u("col", {
|
|
463
|
-
style:
|
|
463
|
+
style: H({ width: `${W}px` })
|
|
464
464
|
}, null, 4),
|
|
465
|
-
(d(!0), m(U, null,
|
|
465
|
+
(d(!0), m(U, null, M(c.value.colWidths, (o, n) => (d(), m("col", {
|
|
466
466
|
key: `col-width-${c.value.visibleColIndexes[n]}`,
|
|
467
|
-
style:
|
|
467
|
+
style: H({ width: `${o}px` })
|
|
468
468
|
}, null, 4))), 128))
|
|
469
469
|
]),
|
|
470
470
|
u("tbody", null, [
|
|
@@ -474,7 +474,7 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
474
474
|
scope: "col",
|
|
475
475
|
"aria-label": "表格左上角"
|
|
476
476
|
}, null, -1)),
|
|
477
|
-
(d(!0), m(U, null,
|
|
477
|
+
(d(!0), m(U, null, M(c.value.visibleColIndexes, (o) => (d(), m("th", {
|
|
478
478
|
key: `col-header-${o}`,
|
|
479
479
|
class: pe(["lfp-sheet__col-header", {
|
|
480
480
|
"is-first-data-col": o === c.value.firstVisibleCol,
|
|
@@ -483,10 +483,10 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
483
483
|
scope: "col"
|
|
484
484
|
}, b(it(o)), 3))), 128))
|
|
485
485
|
]),
|
|
486
|
-
(d(!0), m(U, null,
|
|
486
|
+
(d(!0), m(U, null, M(c.value.rows, (o) => (d(), m("tr", {
|
|
487
487
|
key: o.key,
|
|
488
488
|
class: pe(["lfp-sheet__row", { "is-first-row": o.rowIndex === c.value.firstVisibleRow }]),
|
|
489
|
-
style:
|
|
489
|
+
style: H(o.style)
|
|
490
490
|
}, [
|
|
491
491
|
u("th", {
|
|
492
492
|
class: pe(["lfp-sheet__row-header", {
|
|
@@ -495,7 +495,7 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
495
495
|
}]),
|
|
496
496
|
scope: "row"
|
|
497
497
|
}, b(o.rowIndex + 1), 3),
|
|
498
|
-
(d(!0), m(U, null,
|
|
498
|
+
(d(!0), m(U, null, M(o.cells, (n) => (d(), m("td", {
|
|
499
499
|
key: n.key,
|
|
500
500
|
class: pe({
|
|
501
501
|
"is-first-row": n.rowIndex === c.value.firstVisibleRow,
|
|
@@ -508,14 +508,14 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
508
508
|
}),
|
|
509
509
|
rowspan: n.rowSpan,
|
|
510
510
|
colspan: n.colSpan,
|
|
511
|
-
style:
|
|
511
|
+
style: H(n.style),
|
|
512
512
|
title: n.formula ? `=${n.formula}` : n.value,
|
|
513
513
|
tabindex: "0",
|
|
514
|
-
onMouseenter: (
|
|
515
|
-
onMouseleave: t[0] || (t[0] = (
|
|
516
|
-
onFocus: (
|
|
517
|
-
onBlur: t[1] || (t[1] = (
|
|
518
|
-
onClick: (
|
|
514
|
+
onMouseenter: (s) => z(n.rowIndex, n.colIndex),
|
|
515
|
+
onMouseleave: t[0] || (t[0] = (s) => z(null, null)),
|
|
516
|
+
onFocus: (s) => z(n.rowIndex, n.colIndex),
|
|
517
|
+
onBlur: t[1] || (t[1] = (s) => z(null, null)),
|
|
518
|
+
onClick: (s) => at(n.key)
|
|
519
519
|
}, [
|
|
520
520
|
u("span", Qt, b(n.value), 1)
|
|
521
521
|
], 46, Jt))), 128))
|
|
@@ -523,9 +523,9 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
523
523
|
])
|
|
524
524
|
]),
|
|
525
525
|
u("div", Yt, [
|
|
526
|
-
(d(!0), m(U, null,
|
|
526
|
+
(d(!0), m(U, null, M(c.value.images, (o) => (d(), m("div", {
|
|
527
527
|
key: o.key,
|
|
528
|
-
style:
|
|
528
|
+
style: H({
|
|
529
529
|
left: `${o.left}px`,
|
|
530
530
|
top: `${o.top}px`,
|
|
531
531
|
width: `${o.width}px`,
|
|
@@ -537,7 +537,7 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
537
537
|
class: "lfp-sheet__floating-image",
|
|
538
538
|
src: o.src,
|
|
539
539
|
alt: o.alt,
|
|
540
|
-
style:
|
|
540
|
+
style: H(o.frameStyle)
|
|
541
541
|
}, null, 12, Xt)
|
|
542
542
|
], 4))), 128))
|
|
543
543
|
])
|
|
@@ -547,5 +547,5 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
|
|
|
547
547
|
}
|
|
548
548
|
});
|
|
549
549
|
export {
|
|
550
|
-
|
|
550
|
+
so as default
|
|
551
551
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as o, openBlock as l, createElementBlock as a, createElementVNode as t, toDisplayString as i, unref as r } from "vue";
|
|
2
|
-
import { d as s } from "./index-
|
|
2
|
+
import { d as s } from "./index-oYHcrPrC.js";
|
|
3
3
|
const d = { class: "lfp-empty" }, p = { class: "lfp-hint" }, c = /* @__PURE__ */ o({
|
|
4
4
|
__name: "UnsupportedRenderer",
|
|
5
5
|
props: {
|
|
@@ -77,7 +77,7 @@ const ee = ["aria-modal"], te = {
|
|
|
77
77
|
},
|
|
78
78
|
emits: ["update:visible", "error"],
|
|
79
79
|
setup(e, { emit: t }) {
|
|
80
|
-
const o = h(() => import("./PdfRenderer-Due2M5cA.js")), c = h(() => import("./TextRenderer-KUhpnf63.js")), i = h(() => import("./DocxRenderer-DogNhBLd.js")), p = h(() => import("./SheetRenderer-
|
|
80
|
+
const o = h(() => import("./PdfRenderer-Due2M5cA.js")), c = h(() => import("./TextRenderer-KUhpnf63.js")), i = h(() => import("./DocxRenderer-DogNhBLd.js")), p = h(() => import("./SheetRenderer-BKPeruxM.js")), d = h(() => import("./UnsupportedRenderer-BRF9UR6f.js")), l = e, D = t, f = U(null), j = U(!1), L = U(""), n = U(I(l.source, l.fileName)), m = w(() => Q(n.value.name)), N = w(() => l.fileName || n.value.name || l.dialogTitle), b = w(() => l.mode === "dialog"), O = w(() => b.value ? l.visible : !0), T = w(() => m.value === "image" ? "img" : m.value === "video" ? "video" : m.value === "audio" ? "audio" : null);
|
|
81
81
|
Z(
|
|
82
82
|
() => [l.source, l.fileName],
|
|
83
83
|
() => {
|