ooxml-excel-editor 1.2.0 → 1.3.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/CHANGELOG.md +79 -0
- package/README.md +58 -14
- package/dist/assets/exceljs.min-DH9BABny.js +23046 -0
- package/dist/assets/parse.worker-DIaMHX0x.js +2646 -0
- package/dist/chunks/{plugin-overlay-BBrNby8v.js → plugin-overlay-DLb6sRhU.js} +1424 -1384
- package/dist/chunks/toolbar-icons-BcnMin5s.js +223 -0
- package/dist/components/ExcelViewer.vue.d.ts +2 -0
- package/dist/core/edit/editor-context.d.ts +18 -3
- package/dist/core/edit/editor-host.d.ts +6 -1
- package/dist/core.js +1 -1
- package/dist/index.js +722 -742
- package/dist/react/ExcelViewer.d.ts +9 -0
- package/dist/react.js +610 -444
- package/dist/style.css +1 -1
- package/dist/vue2.css +1 -0
- package/dist/vue2.js +10433 -0
- package/package.json +18 -6
- package/dist/chunks/worker-client.stub-CJlmpAgJ.js +0 -190
package/dist/index.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { r as
|
|
3
|
-
import { D as
|
|
4
|
-
import { p as
|
|
5
|
-
import { definePlugin as
|
|
6
|
-
function
|
|
7
|
-
const d =
|
|
8
|
-
async function
|
|
9
|
-
d.value = !0, $.value = null, g.value &&
|
|
1
|
+
import { ref as C, shallowRef as ct, defineComponent as X, onBeforeUnmount as Oe, openBlock as v, createElementBlock as c, createElementVNode as n, createTextVNode as N, toDisplayString as E, createCommentVNode as F, withModifiers as He, Fragment as U, renderList as ce, computed as T, normalizeClass as B, reactive as Mt, withDirectives as V, vModelRadio as Me, vModelSelect as rt, vModelCheckbox as dt, onMounted as Ue, normalizeStyle as We, vModelText as cl, unref as h, nextTick as ve, watch as A, createBlock as ie, Teleport as fl, renderSlot as ee, createVNode as vt } from "vue";
|
|
2
|
+
import { r as ft, l as Rt, d as Pt, f as Dt, a as ml, h as Pe, V as pl, P as gl, g as bl, s as yl, b as kl, c as Cl, e as xl } from "./chunks/plugin-overlay-DLb6sRhU.js";
|
|
3
|
+
import { D as $s, j as Ss, k as Es, m as Ts, i as Fs, n as Is, o as Ms, q as Rs, t as Ps, u as Ds, v as As, p as zs } from "./chunks/plugin-overlay-DLb6sRhU.js";
|
|
4
|
+
import { p as At, s as Re, T as Be, a as wl, i as hl, j as $l } from "./chunks/toolbar-icons-BcnMin5s.js";
|
|
5
|
+
import { definePlugin as Ns } from "./core.js";
|
|
6
|
+
function Sl() {
|
|
7
|
+
const d = C(!1), $ = C(null), g = ct(null), o = C(null), y = ct(null);
|
|
8
|
+
async function b(f, p) {
|
|
9
|
+
d.value = !0, $.value = null, g.value && ft(g.value), g.value = null, y.value = null, o.value = { stage: "read", ratio: 0 };
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
}), r =
|
|
11
|
+
const a = await Rt(f, (z, P) => {
|
|
12
|
+
o.value = { stage: "read", ratio: P ? z / P : void 0 };
|
|
13
|
+
}), r = Pt(a);
|
|
14
14
|
if (r === "xls") throw new Error("这是旧版 .xls(BIFF) 或加密文件,本预览器只支持 .xlsx/.xlsm。");
|
|
15
15
|
if (r === "not-zip") throw new Error("文件不是有效的 .xlsx(非 ZIP 包)。");
|
|
16
16
|
if (r === "empty") throw new Error("文件为空。");
|
|
17
|
-
let
|
|
18
|
-
|
|
17
|
+
let I = await At(a, (z) => {
|
|
18
|
+
o.value = z;
|
|
19
19
|
});
|
|
20
|
-
p && (
|
|
21
|
-
} catch (
|
|
22
|
-
$.value =
|
|
20
|
+
p && (I = p(I) ?? I), Dt(I), y.value = a.slice(0), g.value = I;
|
|
21
|
+
} catch (a) {
|
|
22
|
+
$.value = a != null && a.message && /预览器|损坏|加密|为空|ZIP/.test(a.message) ? a.message : ml(a), console.error("[ooxml-preview] 解析失败:", a);
|
|
23
23
|
} finally {
|
|
24
|
-
d.value = !1,
|
|
24
|
+
d.value = !1, o.value = null;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
function u(f, p) {
|
|
28
|
-
g.value &&
|
|
28
|
+
g.value && ft(g.value), y.value = null, $.value = null, o.value = null, g.value = p ? p(f) ?? f : f;
|
|
29
29
|
}
|
|
30
|
-
return { loading: d, error: $, workbook: g, load:
|
|
30
|
+
return { loading: d, error: $, workbook: g, load: b, loadModel: u, progress: o, sourceBuffer: y };
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const El = { class: "toolbar" }, Tl = ["title"], Fl = {
|
|
33
33
|
key: 0,
|
|
34
34
|
class: "tpl"
|
|
35
|
-
},
|
|
35
|
+
}, Il = { class: "meta" }, Ml = { class: "export-wrap" }, Rl = {
|
|
36
36
|
key: 0,
|
|
37
37
|
class: "menu"
|
|
38
|
-
},
|
|
38
|
+
}, Pl = { class: "zoom" }, Dl = ["value"], Al = ["value"], zl = ["value"], Ll = /* @__PURE__ */ X({
|
|
39
39
|
__name: "ViewerToolbar",
|
|
40
40
|
props: {
|
|
41
41
|
fileName: {},
|
|
@@ -45,92 +45,92 @@ const wl = { class: "toolbar" }, $l = ["title"], Sl = {
|
|
|
45
45
|
},
|
|
46
46
|
emits: ["update:zoom", "export-image", "export-pdf", "export-pdf-vector", "print", "open-settings"],
|
|
47
47
|
setup(d, { emit: $ }) {
|
|
48
|
-
const g = $,
|
|
49
|
-
function
|
|
50
|
-
g("update:zoom", Math.min(3, Math.max(0.3,
|
|
48
|
+
const g = $, o = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
49
|
+
function y(a) {
|
|
50
|
+
g("update:zoom", Math.min(3, Math.max(0.3, a)));
|
|
51
51
|
}
|
|
52
|
-
const
|
|
52
|
+
const b = C(!1);
|
|
53
53
|
function u() {
|
|
54
|
-
|
|
54
|
+
b.value = !b.value;
|
|
55
55
|
}
|
|
56
|
-
function f(
|
|
57
|
-
|
|
56
|
+
function f(a) {
|
|
57
|
+
b.value = !1, g(a === "export-image" ? "export-image" : a === "export-pdf" ? "export-pdf" : a === "export-pdf-vector" ? "export-pdf-vector" : a === "print" ? "print" : "open-settings");
|
|
58
58
|
}
|
|
59
|
-
function p(
|
|
59
|
+
function p(a) {
|
|
60
60
|
var r;
|
|
61
|
-
(r =
|
|
61
|
+
(r = a.target) != null && r.closest(".export-wrap") || (b.value = !1);
|
|
62
62
|
}
|
|
63
63
|
return typeof document < "u" && document.addEventListener("click", p), Oe(() => {
|
|
64
64
|
typeof document < "u" && document.removeEventListener("click", p);
|
|
65
|
-
}), (
|
|
65
|
+
}), (a, r) => (v(), c("div", El, [
|
|
66
66
|
n("span", {
|
|
67
67
|
class: "file",
|
|
68
68
|
title: (d.fileName || "未命名工作簿") + (d.templateName ? " · 模板: " + d.templateName : "")
|
|
69
69
|
}, [
|
|
70
|
-
|
|
71
|
-
d.templateName ? (
|
|
72
|
-
], 8,
|
|
73
|
-
n("span",
|
|
70
|
+
N(E(d.fileName || "未命名工作簿"), 1),
|
|
71
|
+
d.templateName ? (v(), c("span", Fl, " · 模板: " + E(d.templateName), 1)) : F("", !0)
|
|
72
|
+
], 8, Tl),
|
|
73
|
+
n("span", Il, E(d.sheetCount) + " 个工作表", 1),
|
|
74
74
|
r[10] || (r[10] = n("div", { class: "spacer" }, null, -1)),
|
|
75
|
-
n("div",
|
|
75
|
+
n("div", Ml, [
|
|
76
76
|
n("button", {
|
|
77
77
|
class: "export-btn",
|
|
78
78
|
onClick: He(u, ["stop"]),
|
|
79
79
|
title: "导出 / 打印"
|
|
80
80
|
}, [...r[8] || (r[8] = [
|
|
81
|
-
|
|
81
|
+
N(" 导出 ", -1),
|
|
82
82
|
n("span", { class: "caret" }, "▾", -1)
|
|
83
83
|
])]),
|
|
84
|
-
|
|
84
|
+
b.value ? (v(), c("div", Rl, [
|
|
85
85
|
n("button", {
|
|
86
|
-
onClick: r[0] || (r[0] = (
|
|
86
|
+
onClick: r[0] || (r[0] = (I) => f("export-image"))
|
|
87
87
|
}, "导出为图片 (PNG)"),
|
|
88
88
|
n("button", {
|
|
89
|
-
onClick: r[1] || (r[1] = (
|
|
89
|
+
onClick: r[1] || (r[1] = (I) => f("export-pdf"))
|
|
90
90
|
}, "导出为 PDF (位图)"),
|
|
91
91
|
n("button", {
|
|
92
|
-
onClick: r[2] || (r[2] = (
|
|
92
|
+
onClick: r[2] || (r[2] = (I) => f("export-pdf-vector"))
|
|
93
93
|
}, "导出为 PDF (矢量·文字可选)"),
|
|
94
94
|
n("button", {
|
|
95
|
-
onClick: r[3] || (r[3] = (
|
|
95
|
+
onClick: r[3] || (r[3] = (I) => f("print"))
|
|
96
96
|
}, "打印…"),
|
|
97
97
|
r[9] || (r[9] = n("div", { class: "sep" }, null, -1)),
|
|
98
98
|
n("button", {
|
|
99
|
-
onClick: r[4] || (r[4] = (
|
|
99
|
+
onClick: r[4] || (r[4] = (I) => f("open-settings"))
|
|
100
100
|
}, "导出设置…")
|
|
101
|
-
])) :
|
|
101
|
+
])) : F("", !0)
|
|
102
102
|
]),
|
|
103
|
-
n("div",
|
|
103
|
+
n("div", Pl, [
|
|
104
104
|
n("button", {
|
|
105
|
-
onClick: r[5] || (r[5] = (
|
|
105
|
+
onClick: r[5] || (r[5] = (I) => y(d.zoom - 0.1)),
|
|
106
106
|
title: "缩小"
|
|
107
107
|
}, "−"),
|
|
108
108
|
n("select", {
|
|
109
109
|
value: d.zoom,
|
|
110
|
-
onChange: r[6] || (r[6] = (
|
|
110
|
+
onChange: r[6] || (r[6] = (I) => y(parseFloat(I.target.value)))
|
|
111
111
|
}, [
|
|
112
|
-
(
|
|
113
|
-
key:
|
|
114
|
-
value:
|
|
115
|
-
}, E(Math.round(
|
|
116
|
-
|
|
112
|
+
(v(), c(U, null, ce(o, (I) => n("option", {
|
|
113
|
+
key: I,
|
|
114
|
+
value: I
|
|
115
|
+
}, E(Math.round(I * 100)) + "%", 9, Al)), 64)),
|
|
116
|
+
o.includes(d.zoom) ? F("", !0) : (v(), c("option", {
|
|
117
117
|
key: 0,
|
|
118
118
|
value: d.zoom
|
|
119
|
-
}, E(Math.round(d.zoom * 100)) + "%", 9,
|
|
120
|
-
], 40,
|
|
119
|
+
}, E(Math.round(d.zoom * 100)) + "%", 9, zl))
|
|
120
|
+
], 40, Dl),
|
|
121
121
|
n("button", {
|
|
122
|
-
onClick: r[7] || (r[7] = (
|
|
122
|
+
onClick: r[7] || (r[7] = (I) => y(d.zoom + 0.1)),
|
|
123
123
|
title: "放大"
|
|
124
124
|
}, "+")
|
|
125
125
|
])
|
|
126
126
|
]));
|
|
127
127
|
}
|
|
128
|
-
}),
|
|
128
|
+
}), Z = (d, $) => {
|
|
129
129
|
const g = d.__vccOpts || d;
|
|
130
|
-
for (const [
|
|
131
|
-
g[
|
|
130
|
+
for (const [o, y] of $)
|
|
131
|
+
g[o] = y;
|
|
132
132
|
return g;
|
|
133
|
-
},
|
|
133
|
+
}, Nl = /* @__PURE__ */ Z(Ll, [["__scopeId", "data-v-eafc1f94"]]), Vl = { class: "sheet-tabs" }, Bl = ["onClick", "title"], Wl = /* @__PURE__ */ X({
|
|
134
134
|
__name: "SheetTabs",
|
|
135
135
|
props: {
|
|
136
136
|
workbook: {},
|
|
@@ -138,27 +138,27 @@ const wl = { class: "toolbar" }, $l = ["title"], Sl = {
|
|
|
138
138
|
},
|
|
139
139
|
emits: ["select"],
|
|
140
140
|
setup(d, { emit: $ }) {
|
|
141
|
-
const g = d,
|
|
142
|
-
return (
|
|
143
|
-
(
|
|
141
|
+
const g = d, o = $, y = T(() => g.workbook.sheets.filter((b) => b.state === "visible"));
|
|
142
|
+
return (b, u) => (v(), c("div", Vl, [
|
|
143
|
+
(v(!0), c(U, null, ce(y.value, (f) => (v(), c("button", {
|
|
144
144
|
key: f.index,
|
|
145
145
|
class: B(["tab", { active: f.index === d.active }]),
|
|
146
|
-
onClick: (p) =>
|
|
146
|
+
onClick: (p) => o("select", f.index),
|
|
147
147
|
title: f.name
|
|
148
|
-
}, E(f.name), 11,
|
|
148
|
+
}, E(f.name), 11, Bl))), 128))
|
|
149
149
|
]));
|
|
150
150
|
}
|
|
151
|
-
}),
|
|
151
|
+
}), Ol = /* @__PURE__ */ Z(Wl, [["__scopeId", "data-v-431b6f9c"]]), Hl = {
|
|
152
152
|
class: "dlg",
|
|
153
153
|
role: "dialog",
|
|
154
154
|
"aria-label": "导出设置"
|
|
155
|
-
},
|
|
155
|
+
}, Ul = { class: "dlg-head" }, _l = { class: "dlg-body" }, Kl = { class: "field" }, ql = { class: "opts" }, Jl = ["disabled"], jl = {
|
|
156
156
|
key: 0,
|
|
157
157
|
class: "hint"
|
|
158
|
-
},
|
|
158
|
+
}, Gl = {
|
|
159
159
|
key: 1,
|
|
160
160
|
class: "hint"
|
|
161
|
-
},
|
|
161
|
+
}, Xl = { class: "field" }, Zl = { class: "field" }, Ql = { class: "opts inline" }, Yl = { class: "field" }, en = { class: "opts" }, tn = { class: "field" }, ln = { class: "opts inline" }, nn = { class: "dlg-foot" }, sn = /* @__PURE__ */ X({
|
|
162
162
|
__name: "ExportDialog",
|
|
163
163
|
props: {
|
|
164
164
|
selection: {},
|
|
@@ -166,15 +166,15 @@ const wl = { class: "toolbar" }, $l = ["title"], Sl = {
|
|
|
166
166
|
},
|
|
167
167
|
emits: ["close", "export"],
|
|
168
168
|
setup(d, { emit: $ }) {
|
|
169
|
-
const g = d,
|
|
169
|
+
const g = d, o = $, y = T(() => {
|
|
170
170
|
const p = g.selection;
|
|
171
171
|
return !!p && !(p.top === p.bottom && p.left === p.right);
|
|
172
|
-
}),
|
|
172
|
+
}), b = T(() => {
|
|
173
173
|
const p = g.selection;
|
|
174
|
-
return p ? `${
|
|
174
|
+
return p ? `${Pe(p.left)}${p.top + 1}:${Pe(p.right)}${p.bottom + 1}` : "";
|
|
175
175
|
}), u = Mt({
|
|
176
176
|
action: "png",
|
|
177
|
-
scope:
|
|
177
|
+
scope: y.value ? "selection" : "sheet",
|
|
178
178
|
scale: 2,
|
|
179
179
|
includeHeaders: !1,
|
|
180
180
|
gridlines: !0,
|
|
@@ -184,186 +184,186 @@ const wl = { class: "toolbar" }, $l = ["title"], Sl = {
|
|
|
184
184
|
pdfVector: !1
|
|
185
185
|
});
|
|
186
186
|
function f(p) {
|
|
187
|
-
|
|
187
|
+
o("export", { ...u, action: p });
|
|
188
188
|
}
|
|
189
|
-
return (p,
|
|
189
|
+
return (p, a) => (v(), c("div", {
|
|
190
190
|
class: "dlg-mask",
|
|
191
|
-
onClick:
|
|
191
|
+
onClick: a[16] || (a[16] = He((r) => o("close"), ["self"]))
|
|
192
192
|
}, [
|
|
193
|
-
n("div",
|
|
194
|
-
n("div",
|
|
195
|
-
|
|
193
|
+
n("div", Hl, [
|
|
194
|
+
n("div", Ul, [
|
|
195
|
+
a[17] || (a[17] = n("span", null, "导出 / 打印设置", -1)),
|
|
196
196
|
n("button", {
|
|
197
197
|
class: "x",
|
|
198
|
-
onClick:
|
|
198
|
+
onClick: a[0] || (a[0] = (r) => o("close")),
|
|
199
199
|
title: "关闭"
|
|
200
200
|
}, "×")
|
|
201
201
|
]),
|
|
202
|
-
n("div",
|
|
203
|
-
n("div",
|
|
204
|
-
|
|
205
|
-
n("div",
|
|
202
|
+
n("div", _l, [
|
|
203
|
+
n("div", Kl, [
|
|
204
|
+
a[20] || (a[20] = n("label", { class: "lbl" }, "范围", -1)),
|
|
205
|
+
n("div", ql, [
|
|
206
206
|
n("label", {
|
|
207
|
-
class: B({ disabled: !
|
|
207
|
+
class: B({ disabled: !y.value })
|
|
208
208
|
}, [
|
|
209
|
-
|
|
209
|
+
V(n("input", {
|
|
210
210
|
type: "radio",
|
|
211
211
|
value: "selection",
|
|
212
|
-
"onUpdate:modelValue":
|
|
213
|
-
disabled: !
|
|
214
|
-
}, null, 8,
|
|
215
|
-
[
|
|
212
|
+
"onUpdate:modelValue": a[1] || (a[1] = (r) => u.scope = r),
|
|
213
|
+
disabled: !y.value
|
|
214
|
+
}, null, 8, Jl), [
|
|
215
|
+
[Me, u.scope]
|
|
216
216
|
]),
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
a[18] || (a[18] = N(" 当前选区 ", -1)),
|
|
218
|
+
y.value ? (v(), c("span", jl, E(b.value), 1)) : (v(), c("span", Gl, "(未选多格)"))
|
|
219
219
|
], 2),
|
|
220
220
|
n("label", null, [
|
|
221
|
-
|
|
221
|
+
V(n("input", {
|
|
222
222
|
type: "radio",
|
|
223
223
|
value: "sheet",
|
|
224
|
-
"onUpdate:modelValue":
|
|
224
|
+
"onUpdate:modelValue": a[2] || (a[2] = (r) => u.scope = r)
|
|
225
225
|
}, null, 512), [
|
|
226
|
-
[
|
|
226
|
+
[Me, u.scope]
|
|
227
227
|
]),
|
|
228
|
-
|
|
228
|
+
a[19] || (a[19] = N(" 当前工作表", -1))
|
|
229
229
|
]),
|
|
230
230
|
n("label", null, [
|
|
231
|
-
|
|
231
|
+
V(n("input", {
|
|
232
232
|
type: "radio",
|
|
233
233
|
value: "all",
|
|
234
|
-
"onUpdate:modelValue":
|
|
234
|
+
"onUpdate:modelValue": a[3] || (a[3] = (r) => u.scope = r)
|
|
235
235
|
}, null, 512), [
|
|
236
|
-
[
|
|
236
|
+
[Me, u.scope]
|
|
237
237
|
]),
|
|
238
|
-
|
|
238
|
+
N(" 全部工作表 (" + E(d.sheetCount) + ")", 1)
|
|
239
239
|
])
|
|
240
240
|
])
|
|
241
241
|
]),
|
|
242
|
-
n("div",
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
"onUpdate:modelValue":
|
|
246
|
-
}, [...
|
|
242
|
+
n("div", Xl, [
|
|
243
|
+
a[22] || (a[22] = n("label", { class: "lbl" }, "清晰度", -1)),
|
|
244
|
+
V(n("select", {
|
|
245
|
+
"onUpdate:modelValue": a[4] || (a[4] = (r) => u.scale = r)
|
|
246
|
+
}, [...a[21] || (a[21] = [
|
|
247
247
|
n("option", { value: 1 }, "标准 (1×)", -1),
|
|
248
248
|
n("option", { value: 2 }, "高清 (2×)", -1),
|
|
249
249
|
n("option", { value: 3 }, "超清 (3×)", -1)
|
|
250
250
|
])], 512), [
|
|
251
251
|
[
|
|
252
|
-
|
|
252
|
+
rt,
|
|
253
253
|
u.scale,
|
|
254
254
|
void 0,
|
|
255
255
|
{ number: !0 }
|
|
256
256
|
]
|
|
257
257
|
])
|
|
258
258
|
]),
|
|
259
|
-
n("div",
|
|
260
|
-
|
|
261
|
-
n("div",
|
|
259
|
+
n("div", Zl, [
|
|
260
|
+
a[25] || (a[25] = n("label", { class: "lbl" }, "内容", -1)),
|
|
261
|
+
n("div", Ql, [
|
|
262
262
|
n("label", null, [
|
|
263
|
-
|
|
263
|
+
V(n("input", {
|
|
264
264
|
type: "checkbox",
|
|
265
|
-
"onUpdate:modelValue":
|
|
265
|
+
"onUpdate:modelValue": a[5] || (a[5] = (r) => u.includeHeaders = r)
|
|
266
266
|
}, null, 512), [
|
|
267
|
-
[
|
|
267
|
+
[dt, u.includeHeaders]
|
|
268
268
|
]),
|
|
269
|
-
|
|
269
|
+
a[23] || (a[23] = N(" 含行列号", -1))
|
|
270
270
|
]),
|
|
271
271
|
n("label", null, [
|
|
272
|
-
|
|
272
|
+
V(n("input", {
|
|
273
273
|
type: "checkbox",
|
|
274
|
-
"onUpdate:modelValue":
|
|
274
|
+
"onUpdate:modelValue": a[6] || (a[6] = (r) => u.gridlines = r)
|
|
275
275
|
}, null, 512), [
|
|
276
|
-
[
|
|
276
|
+
[dt, u.gridlines]
|
|
277
277
|
]),
|
|
278
|
-
|
|
278
|
+
a[24] || (a[24] = N(" 网格线", -1))
|
|
279
279
|
])
|
|
280
280
|
])
|
|
281
281
|
]),
|
|
282
|
-
n("div",
|
|
283
|
-
|
|
284
|
-
n("div",
|
|
282
|
+
n("div", Yl, [
|
|
283
|
+
a[30] || (a[30] = n("label", { class: "lbl" }, "PDF 类型", -1)),
|
|
284
|
+
n("div", en, [
|
|
285
285
|
n("label", null, [
|
|
286
|
-
|
|
286
|
+
V(n("input", {
|
|
287
287
|
type: "radio",
|
|
288
288
|
value: !1,
|
|
289
|
-
"onUpdate:modelValue":
|
|
289
|
+
"onUpdate:modelValue": a[7] || (a[7] = (r) => u.pdfVector = r)
|
|
290
290
|
}, null, 512), [
|
|
291
|
-
[
|
|
291
|
+
[Me, u.pdfVector]
|
|
292
292
|
]),
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
a[26] || (a[26] = N(" 位图 ", -1)),
|
|
294
|
+
a[27] || (a[27] = n("span", { class: "hint" }, "(完整还原观感)", -1))
|
|
295
295
|
]),
|
|
296
296
|
n("label", null, [
|
|
297
|
-
|
|
297
|
+
V(n("input", {
|
|
298
298
|
type: "radio",
|
|
299
299
|
value: !0,
|
|
300
|
-
"onUpdate:modelValue":
|
|
300
|
+
"onUpdate:modelValue": a[8] || (a[8] = (r) => u.pdfVector = r)
|
|
301
301
|
}, null, 512), [
|
|
302
|
-
[
|
|
302
|
+
[Me, u.pdfVector]
|
|
303
303
|
]),
|
|
304
|
-
|
|
305
|
-
|
|
304
|
+
a[28] || (a[28] = N(" 矢量 ", -1)),
|
|
305
|
+
a[29] || (a[29] = n("span", { class: "hint" }, "(文字可选可搜·清晰·文件小;中文需注册字体,否则该格转图)", -1))
|
|
306
306
|
])
|
|
307
307
|
])
|
|
308
308
|
]),
|
|
309
|
-
n("div",
|
|
310
|
-
|
|
311
|
-
|
|
309
|
+
n("div", tn, [
|
|
310
|
+
a[34] || (a[34] = n("label", { class: "lbl" }, [
|
|
311
|
+
N("纸张 "),
|
|
312
312
|
n("span", { class: "hint" }, "(PDF/打印)")
|
|
313
313
|
], -1)),
|
|
314
|
-
n("div",
|
|
315
|
-
|
|
316
|
-
"onUpdate:modelValue":
|
|
317
|
-
}, [...
|
|
314
|
+
n("div", ln, [
|
|
315
|
+
V(n("select", {
|
|
316
|
+
"onUpdate:modelValue": a[9] || (a[9] = (r) => u.format = r)
|
|
317
|
+
}, [...a[31] || (a[31] = [
|
|
318
318
|
n("option", { value: "auto" }, "自动(跟随表)", -1),
|
|
319
319
|
n("option", { value: "a4" }, "A4", -1),
|
|
320
320
|
n("option", { value: "a3" }, "A3", -1),
|
|
321
321
|
n("option", { value: "letter" }, "Letter", -1)
|
|
322
322
|
])], 512), [
|
|
323
|
-
[
|
|
323
|
+
[rt, u.format]
|
|
324
324
|
]),
|
|
325
|
-
|
|
326
|
-
"onUpdate:modelValue":
|
|
327
|
-
}, [...
|
|
325
|
+
V(n("select", {
|
|
326
|
+
"onUpdate:modelValue": a[10] || (a[10] = (r) => u.orientation = r)
|
|
327
|
+
}, [...a[32] || (a[32] = [
|
|
328
328
|
n("option", { value: "auto" }, "方向: 自动", -1),
|
|
329
329
|
n("option", { value: "portrait" }, "纵向", -1),
|
|
330
330
|
n("option", { value: "landscape" }, "横向", -1)
|
|
331
331
|
])], 512), [
|
|
332
|
-
[
|
|
332
|
+
[rt, u.orientation]
|
|
333
333
|
]),
|
|
334
334
|
n("label", null, [
|
|
335
|
-
|
|
335
|
+
V(n("input", {
|
|
336
336
|
type: "checkbox",
|
|
337
|
-
"onUpdate:modelValue":
|
|
337
|
+
"onUpdate:modelValue": a[11] || (a[11] = (r) => u.fitToWidth = r)
|
|
338
338
|
}, null, 512), [
|
|
339
|
-
[
|
|
339
|
+
[dt, u.fitToWidth]
|
|
340
340
|
]),
|
|
341
|
-
|
|
341
|
+
a[33] || (a[33] = N(" 适应页宽", -1))
|
|
342
342
|
])
|
|
343
343
|
])
|
|
344
344
|
])
|
|
345
345
|
]),
|
|
346
|
-
n("div",
|
|
346
|
+
n("div", nn, [
|
|
347
347
|
n("button", {
|
|
348
348
|
class: "ghost",
|
|
349
|
-
onClick:
|
|
349
|
+
onClick: a[12] || (a[12] = (r) => o("close"))
|
|
350
350
|
}, "取消"),
|
|
351
|
-
|
|
351
|
+
a[35] || (a[35] = n("div", { class: "grow" }, null, -1)),
|
|
352
352
|
n("button", {
|
|
353
|
-
onClick:
|
|
353
|
+
onClick: a[13] || (a[13] = (r) => f("png"))
|
|
354
354
|
}, "导出 PNG"),
|
|
355
355
|
n("button", {
|
|
356
|
-
onClick:
|
|
356
|
+
onClick: a[14] || (a[14] = (r) => f("pdf"))
|
|
357
357
|
}, "导出 PDF"),
|
|
358
358
|
n("button", {
|
|
359
359
|
class: "primary",
|
|
360
|
-
onClick:
|
|
360
|
+
onClick: a[15] || (a[15] = (r) => f("print"))
|
|
361
361
|
}, "打印…")
|
|
362
362
|
])
|
|
363
363
|
])
|
|
364
364
|
]));
|
|
365
365
|
}
|
|
366
|
-
}),
|
|
366
|
+
}), an = /* @__PURE__ */ Z(sn, [["__scopeId", "data-v-544df24f"]]), on = ["value"], un = ["disabled"], rn = ["disabled"], dn = /* @__PURE__ */ X({
|
|
367
367
|
__name: "FindBar",
|
|
368
368
|
props: {
|
|
369
369
|
query: {},
|
|
@@ -374,69 +374,69 @@ const wl = { class: "toolbar" }, $l = ["title"], Sl = {
|
|
|
374
374
|
},
|
|
375
375
|
emits: ["update:query", "update:matchCase", "update:wholeCell", "next", "prev", "close"],
|
|
376
376
|
setup(d, { expose: $, emit: g }) {
|
|
377
|
-
const
|
|
377
|
+
const o = g, y = C(null);
|
|
378
378
|
Ue(() => {
|
|
379
379
|
var u;
|
|
380
|
-
return (u =
|
|
380
|
+
return (u = y.value) == null ? void 0 : u.focus();
|
|
381
381
|
});
|
|
382
|
-
function
|
|
382
|
+
function b(u) {
|
|
383
383
|
var f;
|
|
384
|
-
(u.ctrlKey || u.metaKey) && (u.key === "f" || u.key === "F") ? (u.preventDefault(), (f =
|
|
384
|
+
(u.ctrlKey || u.metaKey) && (u.key === "f" || u.key === "F") ? (u.preventDefault(), (f = y.value) == null || f.select()) : u.key === "Enter" ? (u.preventDefault(), u.shiftKey ? o("prev") : o("next")) : u.key === "Escape" && (u.preventDefault(), o("close"));
|
|
385
385
|
}
|
|
386
386
|
return $({ focus: () => {
|
|
387
387
|
var u;
|
|
388
|
-
return (u =
|
|
389
|
-
} }), (u, f) => (
|
|
388
|
+
return (u = y.value) == null ? void 0 : u.focus();
|
|
389
|
+
} }), (u, f) => (v(), c("div", {
|
|
390
390
|
class: "find-bar",
|
|
391
391
|
onKeydown: f[6] || (f[6] = He(() => {
|
|
392
392
|
}, ["stop"]))
|
|
393
393
|
}, [
|
|
394
394
|
n("input", {
|
|
395
395
|
ref_key: "inputEl",
|
|
396
|
-
ref:
|
|
396
|
+
ref: y,
|
|
397
397
|
class: "q",
|
|
398
398
|
type: "text",
|
|
399
399
|
placeholder: "查找…",
|
|
400
400
|
value: d.query,
|
|
401
|
-
onInput: f[0] || (f[0] = (p) =>
|
|
402
|
-
onKeydown:
|
|
403
|
-
}, null, 40,
|
|
401
|
+
onInput: f[0] || (f[0] = (p) => o("update:query", p.target.value)),
|
|
402
|
+
onKeydown: b
|
|
403
|
+
}, null, 40, on),
|
|
404
404
|
n("span", {
|
|
405
405
|
class: B(["count", { none: d.query && d.matchCount === 0 }])
|
|
406
406
|
}, E(d.matchCount ? `${d.current + 1}/${d.matchCount}` : d.query ? "无结果" : ""), 3),
|
|
407
407
|
n("button", {
|
|
408
408
|
class: B(["opt", { on: d.matchCase }]),
|
|
409
409
|
title: "区分大小写",
|
|
410
|
-
onClick: f[1] || (f[1] = (p) =>
|
|
410
|
+
onClick: f[1] || (f[1] = (p) => o("update:matchCase", !d.matchCase))
|
|
411
411
|
}, "Aa", 2),
|
|
412
412
|
n("button", {
|
|
413
413
|
class: B(["opt", { on: d.wholeCell }]),
|
|
414
414
|
title: "全字匹配(整格相等)",
|
|
415
|
-
onClick: f[2] || (f[2] = (p) =>
|
|
415
|
+
onClick: f[2] || (f[2] = (p) => o("update:wholeCell", !d.wholeCell))
|
|
416
416
|
}, "▢", 2),
|
|
417
417
|
n("button", {
|
|
418
418
|
class: "nav",
|
|
419
419
|
title: "上一个 (Shift+Enter)",
|
|
420
420
|
disabled: !d.matchCount,
|
|
421
|
-
onClick: f[3] || (f[3] = (p) =>
|
|
422
|
-
}, "▲", 8,
|
|
421
|
+
onClick: f[3] || (f[3] = (p) => o("prev"))
|
|
422
|
+
}, "▲", 8, un),
|
|
423
423
|
n("button", {
|
|
424
424
|
class: "nav",
|
|
425
425
|
title: "下一个 (Enter)",
|
|
426
426
|
disabled: !d.matchCount,
|
|
427
|
-
onClick: f[4] || (f[4] = (p) =>
|
|
428
|
-
}, "▼", 8,
|
|
427
|
+
onClick: f[4] || (f[4] = (p) => o("next"))
|
|
428
|
+
}, "▼", 8, rn),
|
|
429
429
|
n("button", {
|
|
430
430
|
class: "close",
|
|
431
431
|
title: "关闭 (Esc)",
|
|
432
|
-
onClick: f[5] || (f[5] = (p) =>
|
|
432
|
+
onClick: f[5] || (f[5] = (p) => o("close"))
|
|
433
433
|
}, "×")
|
|
434
434
|
], 32));
|
|
435
435
|
}
|
|
436
|
-
}),
|
|
436
|
+
}), vn = /* @__PURE__ */ Z(dn, [["__scopeId", "data-v-36abc020"]]), cn = { class: "sort" }, fn = { class: "all" }, mn = ["checked"], pn = { class: "list" }, gn = ["checked", "onChange"], bn = ["title"], yn = {
|
|
437
437
|
key: 0,
|
|
438
438
|
class: "empty"
|
|
439
|
-
},
|
|
439
|
+
}, kn = { class: "foot" }, Cn = /* @__PURE__ */ X({
|
|
440
440
|
__name: "FilterPopup",
|
|
441
441
|
props: {
|
|
442
442
|
values: {},
|
|
@@ -447,85 +447,85 @@ const wl = { class: "toolbar" }, $l = ["title"], Sl = {
|
|
|
447
447
|
},
|
|
448
448
|
emits: ["apply", "clear", "close", "sort"],
|
|
449
449
|
setup(d, { emit: $ }) {
|
|
450
|
-
const g = d,
|
|
451
|
-
const P =
|
|
452
|
-
return P ? g.values.filter((
|
|
453
|
-
}), f = T(() => u.value.length > 0 && u.value.every((P) =>
|
|
450
|
+
const g = d, o = $, y = C(""), b = Mt(new Set(g.selected.length ? g.selected : g.values)), u = T(() => {
|
|
451
|
+
const P = y.value.trim().toLowerCase();
|
|
452
|
+
return P ? g.values.filter((M) => M.toLowerCase().includes(P)) : g.values;
|
|
453
|
+
}), f = T(() => u.value.length > 0 && u.value.every((P) => b.has(P)));
|
|
454
454
|
function p(P) {
|
|
455
|
-
|
|
455
|
+
b.has(P) ? b.delete(P) : b.add(P);
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function a() {
|
|
458
458
|
const P = !f.value;
|
|
459
|
-
for (const
|
|
459
|
+
for (const M of u.value) P ? b.add(M) : b.delete(M);
|
|
460
460
|
}
|
|
461
461
|
function r() {
|
|
462
|
-
|
|
462
|
+
o("apply", [...b]);
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
function
|
|
466
|
-
|
|
464
|
+
const I = C(null);
|
|
465
|
+
function z(P) {
|
|
466
|
+
I.value && !I.value.contains(P.target) && o("close");
|
|
467
467
|
}
|
|
468
|
-
return Ue(() => setTimeout(() => document.addEventListener("mousedown",
|
|
468
|
+
return Ue(() => setTimeout(() => document.addEventListener("mousedown", z), 0)), Oe(() => document.removeEventListener("mousedown", z)), (P, M) => (v(), c("div", {
|
|
469
469
|
class: "filter-pop",
|
|
470
470
|
ref_key: "rootEl",
|
|
471
|
-
ref:
|
|
472
|
-
style:
|
|
473
|
-
onKeydown:
|
|
471
|
+
ref: I,
|
|
472
|
+
style: We({ left: d.x + "px", top: d.y + "px" }),
|
|
473
|
+
onKeydown: M[5] || (M[5] = He(() => {
|
|
474
474
|
}, ["stop"]))
|
|
475
475
|
}, [
|
|
476
|
-
n("div",
|
|
476
|
+
n("div", cn, [
|
|
477
477
|
n("button", {
|
|
478
478
|
class: B({ on: d.sortDir === "asc" }),
|
|
479
|
-
onClick:
|
|
479
|
+
onClick: M[0] || (M[0] = (k) => o("sort", "asc")),
|
|
480
480
|
title: "升序"
|
|
481
481
|
}, "↑ 升序", 2),
|
|
482
482
|
n("button", {
|
|
483
483
|
class: B({ on: d.sortDir === "desc" }),
|
|
484
|
-
onClick:
|
|
484
|
+
onClick: M[1] || (M[1] = (k) => o("sort", "desc")),
|
|
485
485
|
title: "降序"
|
|
486
486
|
}, "↓ 降序", 2)
|
|
487
487
|
]),
|
|
488
|
-
|
|
488
|
+
V(n("input", {
|
|
489
489
|
class: "search",
|
|
490
490
|
type: "text",
|
|
491
491
|
placeholder: "搜索…",
|
|
492
|
-
"onUpdate:modelValue":
|
|
492
|
+
"onUpdate:modelValue": M[2] || (M[2] = (k) => y.value = k)
|
|
493
493
|
}, null, 512), [
|
|
494
|
-
[
|
|
494
|
+
[cl, y.value]
|
|
495
495
|
]),
|
|
496
|
-
n("label",
|
|
496
|
+
n("label", fn, [
|
|
497
497
|
n("input", {
|
|
498
498
|
type: "checkbox",
|
|
499
499
|
checked: f.value,
|
|
500
|
-
onChange:
|
|
501
|
-
}, null, 40,
|
|
502
|
-
|
|
500
|
+
onChange: a
|
|
501
|
+
}, null, 40, mn),
|
|
502
|
+
M[6] || (M[6] = N(" (全选) ", -1))
|
|
503
503
|
]),
|
|
504
|
-
n("div",
|
|
505
|
-
(
|
|
504
|
+
n("div", pn, [
|
|
505
|
+
(v(!0), c(U, null, ce(u.value, (k) => (v(), c("label", {
|
|
506
506
|
key: k,
|
|
507
507
|
class: "row"
|
|
508
508
|
}, [
|
|
509
509
|
n("input", {
|
|
510
510
|
type: "checkbox",
|
|
511
|
-
checked:
|
|
512
|
-
onChange: (
|
|
513
|
-
}, null, 40,
|
|
511
|
+
checked: b.has(k),
|
|
512
|
+
onChange: (_) => p(k)
|
|
513
|
+
}, null, 40, gn),
|
|
514
514
|
n("span", {
|
|
515
515
|
class: "val",
|
|
516
516
|
title: k
|
|
517
|
-
}, E(k), 9,
|
|
517
|
+
}, E(k), 9, bn)
|
|
518
518
|
]))), 128)),
|
|
519
|
-
u.value.length ?
|
|
519
|
+
u.value.length ? F("", !0) : (v(), c("div", yn, "无匹配值"))
|
|
520
520
|
]),
|
|
521
|
-
n("div",
|
|
521
|
+
n("div", kn, [
|
|
522
522
|
n("button", {
|
|
523
523
|
class: "link",
|
|
524
|
-
onClick:
|
|
524
|
+
onClick: M[3] || (M[3] = (k) => o("clear"))
|
|
525
525
|
}, "清除筛选"),
|
|
526
|
-
|
|
526
|
+
M[7] || (M[7] = n("div", { class: "grow" }, null, -1)),
|
|
527
527
|
n("button", {
|
|
528
|
-
onClick:
|
|
528
|
+
onClick: M[4] || (M[4] = (k) => o("close"))
|
|
529
529
|
}, "取消"),
|
|
530
530
|
n("button", {
|
|
531
531
|
class: "primary",
|
|
@@ -534,44 +534,13 @@ const wl = { class: "toolbar" }, $l = ["title"], Sl = {
|
|
|
534
534
|
])
|
|
535
535
|
], 36));
|
|
536
536
|
}
|
|
537
|
-
}),
|
|
538
|
-
// 放大镜
|
|
539
|
-
find: '<circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.65" y2="16.65"/>',
|
|
540
|
-
// 漏斗
|
|
541
|
-
filter: '<path d="M3 5h18l-7 8.5V20l-4-2.2V13.5z"/>',
|
|
542
|
-
// 漏斗 + 斜杠(清除筛选)
|
|
543
|
-
"clear-filter": '<path d="M3 5h18l-7 8.5V20l-4-2.2V13.5z"/><line x1="3" y1="3" x2="21" y2="21"/>',
|
|
544
|
-
// 上下箭头(排序)
|
|
545
|
-
sort: '<path d="M7 16l3 3 3-3"/><line x1="10" y1="19" x2="10" y2="5"/><path d="M17 8l-3-3-3 3"/><line x1="14" y1="5" x2="14" y2="19"/>',
|
|
546
|
-
// 下载(导出)
|
|
547
|
-
export: '<line x1="12" y1="3" x2="12" y2="15"/><path d="M8 11l4 4 4-4"/><path d="M4 19h16"/>',
|
|
548
|
-
// 放大镜带 +
|
|
549
|
-
zoom: '<circle cx="10" cy="10" r="6"/><line x1="20" y1="20" x2="14.5" y2="14.5"/><line x1="10" y1="7.5" x2="10" y2="12.5"/><line x1="7.5" y1="10" x2="12.5" y2="10"/>',
|
|
550
|
-
// 两个叠框(复制)
|
|
551
|
-
copy: '<rect x="9" y="9" width="11" height="11" rx="1.5"/><path d="M5 15H4V5a1 1 0 0 1 1-1h10v1"/>',
|
|
552
|
-
// 十字线(冻结行列)
|
|
553
|
-
freeze: '<line x1="3" y1="9" x2="21" y2="9"/><line x1="9" y1="3" x2="9" y2="21"/>',
|
|
554
|
-
// 自动换行:两条文本线 + 折回箭头
|
|
555
|
-
"wrap-text": '<line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="18" x2="10" y2="18"/><path d="M3 12h15a3 3 0 0 1 0 6h-3"/><polyline points="17 15 14 18 17 21"/>',
|
|
556
|
-
// 模板:文档 + 排版网格
|
|
557
|
-
template: '<rect x="4" y="3" width="16" height="18" rx="1.5"/><line x1="4" y1="8" x2="20" y2="8"/><line x1="8" y1="12" x2="16" y2="12"/><line x1="8" y1="16" x2="16" y2="16"/>',
|
|
558
|
-
// 图片工具:山+太阳的图片框 + 小齿轮(批量转换)
|
|
559
|
-
"image-tools": '<rect x="3" y="4" width="14" height="14" rx="1.5"/><circle cx="8" cy="9" r="1.5"/><polyline points="3 16 7 12 11 16 14 13 17 16"/><path d="M19 19l2 2M19 21l2-2"/>',
|
|
560
|
-
// 三点(更多)
|
|
561
|
-
more: '<circle cx="5" cy="12" r="1.6" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.6" fill="currentColor" stroke="none"/><circle cx="19" cy="12" r="1.6" fill="currentColor" stroke="none"/>',
|
|
562
|
-
// 下拉小箭头
|
|
563
|
-
caret: '<path d="M6 9l6 6 6-6"/>'
|
|
564
|
-
};
|
|
565
|
-
function Ie(d) {
|
|
566
|
-
return '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">' + d + "</svg>";
|
|
567
|
-
}
|
|
568
|
-
const kn = { class: "tb-menu" }, xn = {
|
|
537
|
+
}), xn = /* @__PURE__ */ Z(Cn, [["__scopeId", "data-v-4b0bc283"]]), wn = { class: "tb-menu" }, hn = {
|
|
569
538
|
key: 0,
|
|
570
539
|
class: "sep"
|
|
571
|
-
},
|
|
540
|
+
}, $n = ["disabled", "onClick"], Sn = ["innerHTML"], En = {
|
|
572
541
|
key: 1,
|
|
573
542
|
class: "ic-e"
|
|
574
|
-
},
|
|
543
|
+
}, Tn = { class: "lb" }, Fn = /* @__PURE__ */ X({
|
|
575
544
|
__name: "ToolbarMenu",
|
|
576
545
|
props: {
|
|
577
546
|
items: {}
|
|
@@ -579,112 +548,112 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
579
548
|
emits: ["pick"],
|
|
580
549
|
setup(d, { emit: $ }) {
|
|
581
550
|
const g = $;
|
|
582
|
-
return (
|
|
583
|
-
(
|
|
584
|
-
key:
|
|
551
|
+
return (o, y) => (v(), c("div", wn, [
|
|
552
|
+
(v(!0), c(U, null, ce(d.items, (b) => (v(), c(U, {
|
|
553
|
+
key: b.id
|
|
585
554
|
}, [
|
|
586
|
-
|
|
555
|
+
b.type === "separator" ? (v(), c("div", hn)) : (v(), c("button", {
|
|
587
556
|
key: 1,
|
|
588
|
-
class: B(["mi", { active:
|
|
589
|
-
disabled:
|
|
590
|
-
onClick: (u) => g("pick",
|
|
557
|
+
class: B(["mi", { active: b.active }]),
|
|
558
|
+
disabled: b.disabled,
|
|
559
|
+
onClick: (u) => g("pick", b)
|
|
591
560
|
}, [
|
|
592
|
-
|
|
561
|
+
b.iconSvg ? (v(), c("span", {
|
|
593
562
|
key: 0,
|
|
594
563
|
class: "ic",
|
|
595
|
-
innerHTML:
|
|
596
|
-
}, null, 8,
|
|
597
|
-
n("span",
|
|
598
|
-
], 10,
|
|
564
|
+
innerHTML: h(Re)(b.iconSvg)
|
|
565
|
+
}, null, 8, Sn)) : b.icon ? (v(), c("span", En, E(b.icon), 1)) : F("", !0),
|
|
566
|
+
n("span", Tn, E(b.label || b.id), 1)
|
|
567
|
+
], 10, $n))
|
|
599
568
|
], 64))), 128))
|
|
600
569
|
]));
|
|
601
570
|
}
|
|
602
|
-
}),
|
|
571
|
+
}), Ft = /* @__PURE__ */ Z(Fn, [["__scopeId", "data-v-322e2c67"]]), In = {
|
|
603
572
|
key: 0,
|
|
604
573
|
class: "divider"
|
|
605
|
-
},
|
|
574
|
+
}, Mn = {
|
|
606
575
|
key: 1,
|
|
607
576
|
class: "tool"
|
|
608
|
-
},
|
|
577
|
+
}, Rn = ["innerHTML"], Pn = {
|
|
609
578
|
key: 1,
|
|
610
579
|
class: "ic-e"
|
|
611
|
-
},
|
|
580
|
+
}, Dn = {
|
|
612
581
|
key: 2,
|
|
613
582
|
class: "lb"
|
|
614
|
-
},
|
|
583
|
+
}, An = ["innerHTML"], zn = {
|
|
615
584
|
key: 0,
|
|
616
585
|
class: "divider"
|
|
617
|
-
},
|
|
586
|
+
}, Ln = {
|
|
618
587
|
key: 1,
|
|
619
588
|
class: "dd"
|
|
620
|
-
},
|
|
589
|
+
}, Nn = ["disabled", "title", "onClick"], Vn = ["innerHTML"], Bn = {
|
|
621
590
|
key: 1,
|
|
622
591
|
class: "ic-e"
|
|
623
|
-
},
|
|
592
|
+
}, Wn = {
|
|
624
593
|
key: 2,
|
|
625
594
|
class: "lb"
|
|
626
|
-
},
|
|
595
|
+
}, On = ["innerHTML"], Hn = {
|
|
627
596
|
key: 0,
|
|
628
597
|
class: "dd more"
|
|
629
|
-
},
|
|
598
|
+
}, Un = ["innerHTML"], _n = 46, It = 4, Kn = /* @__PURE__ */ X({
|
|
630
599
|
__name: "ActionToolbar",
|
|
631
600
|
props: {
|
|
632
601
|
items: {}
|
|
633
602
|
},
|
|
634
603
|
setup(d) {
|
|
635
|
-
const $ = d, g =
|
|
604
|
+
const $ = d, g = C(null), o = C(null), y = C([]), b = C(0), u = C(null);
|
|
636
605
|
function f() {
|
|
637
|
-
var
|
|
638
|
-
const
|
|
639
|
-
|
|
606
|
+
var L;
|
|
607
|
+
const w = o.value;
|
|
608
|
+
w && (y.value = Array.from(w.children).map((x) => x.offsetWidth), b.value = ((L = g.value) == null ? void 0 : L.clientWidth) ?? 0);
|
|
640
609
|
}
|
|
641
610
|
const p = T(() => {
|
|
642
|
-
const
|
|
643
|
-
if (!
|
|
644
|
-
let
|
|
611
|
+
const w = b.value, L = y.value;
|
|
612
|
+
if (!w || L.length !== $.items.length) return $.items.length;
|
|
613
|
+
let x = 0, ue = !0;
|
|
645
614
|
for (let O = 0; O < $.items.length; O++)
|
|
646
|
-
if (
|
|
615
|
+
if (x += L[O] + It, x > w) {
|
|
647
616
|
ue = !1;
|
|
648
617
|
break;
|
|
649
618
|
}
|
|
650
619
|
if (ue) return $.items.length;
|
|
651
|
-
let
|
|
652
|
-
for (let O = 0; O < $.items.length && (
|
|
653
|
-
|
|
654
|
-
return Math.max(0,
|
|
655
|
-
}),
|
|
656
|
-
function
|
|
657
|
-
u.value = u.value ===
|
|
620
|
+
let fe = _n, me = 0;
|
|
621
|
+
for (let O = 0; O < $.items.length && (fe += L[O] + It, !(fe > w)); O++)
|
|
622
|
+
me++;
|
|
623
|
+
return Math.max(0, me);
|
|
624
|
+
}), a = T(() => $.items.slice(0, p.value)), r = T(() => $.items.slice(p.value)), I = Be.more;
|
|
625
|
+
function z(w) {
|
|
626
|
+
u.value = u.value === w ? null : w;
|
|
658
627
|
}
|
|
659
|
-
function P(
|
|
660
|
-
var
|
|
661
|
-
|
|
628
|
+
function P(w) {
|
|
629
|
+
var L;
|
|
630
|
+
w.disabled || (L = w.onClick) == null || L.call(w);
|
|
662
631
|
}
|
|
663
|
-
function
|
|
664
|
-
var
|
|
665
|
-
|
|
632
|
+
function M(w) {
|
|
633
|
+
var L;
|
|
634
|
+
w.disabled || ((L = w.items) != null && L.length ? z(w.id) : (P(w), u.value = null));
|
|
666
635
|
}
|
|
667
|
-
function k(
|
|
668
|
-
P(
|
|
636
|
+
function k(w) {
|
|
637
|
+
P(w), u.value = null;
|
|
669
638
|
}
|
|
670
|
-
function
|
|
671
|
-
return
|
|
639
|
+
function _(w) {
|
|
640
|
+
return w.iconSvg ? Re(w.iconSvg) : null;
|
|
672
641
|
}
|
|
673
|
-
let
|
|
674
|
-
function te(
|
|
675
|
-
g.value && !g.value.contains(
|
|
642
|
+
let K = null;
|
|
643
|
+
function te(w) {
|
|
644
|
+
g.value && !g.value.contains(w.target) && (u.value = null);
|
|
676
645
|
}
|
|
677
646
|
return Ue(() => {
|
|
678
|
-
|
|
679
|
-
var
|
|
680
|
-
return
|
|
681
|
-
}), g.value &&
|
|
647
|
+
ve(f), K = new ResizeObserver(() => {
|
|
648
|
+
var w;
|
|
649
|
+
return b.value = ((w = g.value) == null ? void 0 : w.clientWidth) ?? 0;
|
|
650
|
+
}), g.value && K.observe(g.value), document.addEventListener("mousedown", te);
|
|
682
651
|
}), Oe(() => {
|
|
683
|
-
|
|
684
|
-
}),
|
|
685
|
-
() => $.items.map((
|
|
686
|
-
() =>
|
|
687
|
-
), (
|
|
652
|
+
K == null || K.disconnect(), document.removeEventListener("mousedown", te);
|
|
653
|
+
}), A(
|
|
654
|
+
() => $.items.map((w) => w.id + (w.label ?? "")).join("|"),
|
|
655
|
+
() => ve(f)
|
|
656
|
+
), (w, L) => (v(), c("div", {
|
|
688
657
|
class: "action-toolbar",
|
|
689
658
|
ref_key: "containerEl",
|
|
690
659
|
ref: g
|
|
@@ -692,82 +661,82 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
692
661
|
n("div", {
|
|
693
662
|
class: "measure",
|
|
694
663
|
ref_key: "measureEl",
|
|
695
|
-
ref:
|
|
664
|
+
ref: o,
|
|
696
665
|
"aria-hidden": "true"
|
|
697
666
|
}, [
|
|
698
|
-
(
|
|
699
|
-
key: "m" +
|
|
667
|
+
(v(!0), c(U, null, ce(d.items, (x) => (v(), c(U, {
|
|
668
|
+
key: "m" + x.id
|
|
700
669
|
}, [
|
|
701
|
-
|
|
702
|
-
|
|
670
|
+
x.type === "separator" ? (v(), c("span", In)) : (v(), c("button", Mn, [
|
|
671
|
+
_(x) ? (v(), c("span", {
|
|
703
672
|
key: 0,
|
|
704
673
|
class: "ic",
|
|
705
|
-
innerHTML:
|
|
706
|
-
}, null, 8,
|
|
707
|
-
|
|
708
|
-
|
|
674
|
+
innerHTML: _(x)
|
|
675
|
+
}, null, 8, Rn)) : x.icon ? (v(), c("span", Pn, E(x.icon), 1)) : F("", !0),
|
|
676
|
+
x.label ? (v(), c("span", Dn, E(x.label), 1)) : F("", !0),
|
|
677
|
+
x.items ? (v(), c("span", {
|
|
709
678
|
key: 3,
|
|
710
679
|
class: "caret",
|
|
711
|
-
innerHTML:
|
|
712
|
-
}, null, 8,
|
|
680
|
+
innerHTML: h(Re)(h(Be).caret)
|
|
681
|
+
}, null, 8, An)) : F("", !0)
|
|
713
682
|
]))
|
|
714
683
|
], 64))), 128))
|
|
715
684
|
], 512),
|
|
716
|
-
(
|
|
717
|
-
key:
|
|
685
|
+
(v(!0), c(U, null, ce(a.value, (x) => (v(), c(U, {
|
|
686
|
+
key: x.id
|
|
718
687
|
}, [
|
|
719
|
-
|
|
688
|
+
x.type === "separator" ? (v(), c("span", zn)) : (v(), c("div", Ln, [
|
|
720
689
|
n("button", {
|
|
721
|
-
class: B(["tool", { active:
|
|
722
|
-
disabled:
|
|
723
|
-
title:
|
|
724
|
-
onClick: (ue) =>
|
|
690
|
+
class: B(["tool", { active: x.active, open: u.value === x.id }]),
|
|
691
|
+
disabled: x.disabled,
|
|
692
|
+
title: x.title || x.label || x.id,
|
|
693
|
+
onClick: (ue) => M(x)
|
|
725
694
|
}, [
|
|
726
|
-
|
|
695
|
+
_(x) ? (v(), c("span", {
|
|
727
696
|
key: 0,
|
|
728
697
|
class: "ic",
|
|
729
|
-
innerHTML:
|
|
730
|
-
}, null, 8,
|
|
731
|
-
|
|
732
|
-
|
|
698
|
+
innerHTML: _(x)
|
|
699
|
+
}, null, 8, Vn)) : x.icon ? (v(), c("span", Bn, E(x.icon), 1)) : F("", !0),
|
|
700
|
+
x.label ? (v(), c("span", Wn, E(x.label), 1)) : F("", !0),
|
|
701
|
+
x.items ? (v(), c("span", {
|
|
733
702
|
key: 3,
|
|
734
703
|
class: "caret",
|
|
735
|
-
innerHTML:
|
|
736
|
-
}, null, 8,
|
|
737
|
-
], 10,
|
|
738
|
-
|
|
704
|
+
innerHTML: h(Re)(h(Be).caret)
|
|
705
|
+
}, null, 8, On)) : F("", !0)
|
|
706
|
+
], 10, Nn),
|
|
707
|
+
x.items && u.value === x.id ? (v(), ie(Ft, {
|
|
739
708
|
key: 0,
|
|
740
|
-
items:
|
|
709
|
+
items: x.items,
|
|
741
710
|
onPick: k
|
|
742
|
-
}, null, 8, ["items"])) :
|
|
711
|
+
}, null, 8, ["items"])) : F("", !0)
|
|
743
712
|
]))
|
|
744
713
|
], 64))), 128)),
|
|
745
|
-
r.value.length ? (
|
|
714
|
+
r.value.length ? (v(), c("div", Hn, [
|
|
746
715
|
n("button", {
|
|
747
716
|
class: B(["tool", { open: u.value === "__more" }]),
|
|
748
717
|
title: "更多",
|
|
749
|
-
onClick:
|
|
718
|
+
onClick: L[0] || (L[0] = (x) => z("__more"))
|
|
750
719
|
}, [
|
|
751
720
|
n("span", {
|
|
752
721
|
class: "ic",
|
|
753
|
-
innerHTML:
|
|
754
|
-
}, null, 8,
|
|
722
|
+
innerHTML: h(Re)(h(I))
|
|
723
|
+
}, null, 8, Un)
|
|
755
724
|
], 2),
|
|
756
|
-
u.value === "__more" ? (
|
|
725
|
+
u.value === "__more" ? (v(), ie(Ft, {
|
|
757
726
|
key: 0,
|
|
758
727
|
items: r.value,
|
|
759
728
|
onPick: k
|
|
760
|
-
}, null, 8, ["items"])) :
|
|
761
|
-
])) :
|
|
729
|
+
}, null, 8, ["items"])) : F("", !0)
|
|
730
|
+
])) : F("", !0)
|
|
762
731
|
], 512));
|
|
763
732
|
}
|
|
764
|
-
}),
|
|
733
|
+
}), qn = /* @__PURE__ */ Z(Kn, [["__scopeId", "data-v-0a4aa655"]]), Jn = {
|
|
765
734
|
key: 0,
|
|
766
735
|
class: "export-progress-overlay",
|
|
767
736
|
role: "dialog",
|
|
768
737
|
"aria-modal": "true",
|
|
769
738
|
"aria-live": "polite"
|
|
770
|
-
},
|
|
739
|
+
}, jn = { class: "card" }, Gn = { class: "title" }, Xn = { class: "row" }, Zn = { class: "pct" }, Qn = /* @__PURE__ */ X({
|
|
771
740
|
__name: "ExportProgressOverlay",
|
|
772
741
|
props: {
|
|
773
742
|
state: {},
|
|
@@ -775,7 +744,7 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
775
744
|
},
|
|
776
745
|
emits: ["cancel"],
|
|
777
746
|
setup(d, { emit: $ }) {
|
|
778
|
-
const g = $,
|
|
747
|
+
const g = $, o = {
|
|
779
748
|
render: "渲染中",
|
|
780
749
|
compose: "合成中",
|
|
781
750
|
paginate: "分页中",
|
|
@@ -783,53 +752,53 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
783
752
|
zip: "zip 压缩",
|
|
784
753
|
convert: "批量转换"
|
|
785
754
|
};
|
|
786
|
-
return (
|
|
787
|
-
var u, f, p,
|
|
788
|
-
return
|
|
789
|
-
d.busy ? (
|
|
790
|
-
n("div",
|
|
791
|
-
n("div",
|
|
755
|
+
return (y, b) => {
|
|
756
|
+
var u, f, p, a, r;
|
|
757
|
+
return v(), ie(fl, { to: "body" }, [
|
|
758
|
+
d.busy ? (v(), c("div", Jn, [
|
|
759
|
+
n("div", jn, [
|
|
760
|
+
n("div", Gn, E(((u = d.state) == null ? void 0 : u.label) || o[((f = d.state) == null ? void 0 : f.stage) ?? ""] || "处理中…"), 1),
|
|
792
761
|
n("div", {
|
|
793
762
|
class: B(["bar", { indeterminate: ((p = d.state) == null ? void 0 : p.ratio) == null }])
|
|
794
763
|
}, [
|
|
795
|
-
((
|
|
764
|
+
((a = d.state) == null ? void 0 : a.ratio) != null ? (v(), c("div", {
|
|
796
765
|
key: 0,
|
|
797
766
|
class: "fill",
|
|
798
|
-
style:
|
|
799
|
-
}, null, 4)) :
|
|
767
|
+
style: We({ width: Math.round((d.state.ratio ?? 0) * 100) + "%" })
|
|
768
|
+
}, null, 4)) : F("", !0)
|
|
800
769
|
], 2),
|
|
801
|
-
n("div",
|
|
802
|
-
n("span",
|
|
770
|
+
n("div", Xn, [
|
|
771
|
+
n("span", Zn, E(((r = d.state) == null ? void 0 : r.ratio) != null ? Math.round(d.state.ratio * 100) + "%" : "正在处理…"), 1),
|
|
803
772
|
n("button", {
|
|
804
773
|
class: "cancel",
|
|
805
|
-
onClick:
|
|
774
|
+
onClick: b[0] || (b[0] = (I) => g("cancel")),
|
|
806
775
|
title: "按 Esc 也可取消"
|
|
807
776
|
}, "取消")
|
|
808
777
|
])
|
|
809
778
|
])
|
|
810
|
-
])) :
|
|
779
|
+
])) : F("", !0)
|
|
811
780
|
]);
|
|
812
781
|
};
|
|
813
782
|
}
|
|
814
|
-
}),
|
|
783
|
+
}), Yn = /* @__PURE__ */ Z(Qn, [["__scopeId", "data-v-629027ad"]]), es = {
|
|
815
784
|
key: 2,
|
|
816
785
|
class: "formula-bar"
|
|
817
|
-
},
|
|
786
|
+
}, ts = { class: "addr" }, ls = ["value", "title"], ns = ["title"], ss = { class: "ov-slot" }, as = {
|
|
818
787
|
key: 3,
|
|
819
788
|
class: "state"
|
|
820
|
-
},
|
|
789
|
+
}, os = { class: "loader" }, is = { class: "loader-label" }, us = { key: 0 }, rs = { class: "loader-track" }, ds = {
|
|
821
790
|
key: 1,
|
|
822
791
|
class: "loader-fill indeterminate"
|
|
823
|
-
},
|
|
792
|
+
}, vs = {
|
|
824
793
|
key: 4,
|
|
825
794
|
class: "state error"
|
|
826
|
-
},
|
|
795
|
+
}, cs = {
|
|
827
796
|
key: 5,
|
|
828
797
|
class: "state hint"
|
|
829
|
-
},
|
|
798
|
+
}, fs = {
|
|
830
799
|
key: 3,
|
|
831
800
|
class: "status-bar"
|
|
832
|
-
},
|
|
801
|
+
}, ms = { class: "sel" }, ps = { key: 1 }, gs = /* @__PURE__ */ X({
|
|
833
802
|
__name: "ExcelViewer",
|
|
834
803
|
props: {
|
|
835
804
|
src: {},
|
|
@@ -860,314 +829,322 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
860
829
|
},
|
|
861
830
|
emits: ["rendered", "error", "progress", "cell-click", "cell-dblclick", "selection-change", "sheet-change", "hyperlink-click", "cell-change", "edit-start", "edit-commit", "dim-change", "dirty-change", "image-change", "struct-change", "permission-denied", "before-context-menu", "context-menu"],
|
|
862
831
|
setup(d, { expose: $, emit: g }) {
|
|
863
|
-
const
|
|
864
|
-
() => Object.assign({}, ...
|
|
865
|
-
), u = T(() => !!
|
|
832
|
+
const o = d, y = T(() => o.plugins ?? []), b = T(
|
|
833
|
+
() => Object.assign({}, ...y.value.map((e) => e.theme || {}), o.theme || {})
|
|
834
|
+
), u = T(() => !!o.cellStyle || y.value.some((e) => e.cellStyle));
|
|
866
835
|
function f(e, l, s) {
|
|
867
836
|
let i;
|
|
868
837
|
const m = (S) => {
|
|
869
838
|
const D = S == null ? void 0 : S(e, l, s);
|
|
870
839
|
D && (i = { ...i || {}, ...D });
|
|
871
840
|
};
|
|
872
|
-
for (const S of
|
|
873
|
-
return m(
|
|
841
|
+
for (const S of y.value) m(S.cellStyle);
|
|
842
|
+
return m(o.cellStyle), i;
|
|
874
843
|
}
|
|
875
844
|
function p(e) {
|
|
876
845
|
let l = e;
|
|
877
|
-
for (const s of
|
|
878
|
-
return
|
|
879
|
-
}
|
|
880
|
-
const
|
|
881
|
-
editable:
|
|
882
|
-
cellReadOnly:
|
|
883
|
-
readOnlyRanges:
|
|
884
|
-
editableTargets:
|
|
885
|
-
strictDimensions:
|
|
886
|
-
recalc:
|
|
887
|
-
formulaEngine:
|
|
846
|
+
for (const s of y.value) s.transformModel && (l = s.transformModel(l) ?? l);
|
|
847
|
+
return o.transformModel && (l = o.transformModel(l) ?? l), l;
|
|
848
|
+
}
|
|
849
|
+
const a = T(() => ({
|
|
850
|
+
editable: o.editable,
|
|
851
|
+
cellReadOnly: o.cellReadOnly,
|
|
852
|
+
readOnlyRanges: o.readOnlyRanges,
|
|
853
|
+
editableTargets: o.editableTargets,
|
|
854
|
+
strictDimensions: o.strictDimensions,
|
|
855
|
+
recalc: o.recalc,
|
|
856
|
+
formulaEngine: o.formulaEngine
|
|
888
857
|
}));
|
|
889
858
|
function r(e, l) {
|
|
890
859
|
var i, m;
|
|
891
|
-
const s = (i =
|
|
860
|
+
const s = (i = o.editor) == null ? void 0 : i.call(o, e, l);
|
|
892
861
|
if (s) return s;
|
|
893
|
-
for (const S of
|
|
862
|
+
for (const S of y.value) {
|
|
894
863
|
const D = (m = S.editor) == null ? void 0 : m.call(S, e, l);
|
|
895
864
|
if (D) return D;
|
|
896
865
|
}
|
|
897
866
|
}
|
|
898
|
-
const
|
|
899
|
-
function
|
|
900
|
-
return e ?
|
|
867
|
+
const I = T(() => !!o.editor || y.value.some((e) => e.editor)), z = g, { loading: P, error: M, workbook: k, load: _, loadModel: K, progress: te, sourceBuffer: w } = Sl();
|
|
868
|
+
function L(e) {
|
|
869
|
+
return e ? hl(e) ? e : $l(e, o.jsonOptions) : null;
|
|
901
870
|
}
|
|
902
|
-
const
|
|
871
|
+
const x = C(null), ue = C(null), fe = T(() => x.value ?? o.templateFile ?? null), me = T(() => ue.value ?? o.templateName ?? "");
|
|
903
872
|
function O(e, l) {
|
|
904
|
-
|
|
873
|
+
x.value = e, ue.value = l;
|
|
905
874
|
}
|
|
906
|
-
function
|
|
875
|
+
function mt() {
|
|
907
876
|
O(null, null);
|
|
908
877
|
}
|
|
909
|
-
const
|
|
910
|
-
function
|
|
878
|
+
const pt = C(null);
|
|
879
|
+
function zt() {
|
|
911
880
|
var e;
|
|
912
|
-
(e =
|
|
881
|
+
(e = pt.value) == null || e.click();
|
|
913
882
|
}
|
|
914
|
-
function
|
|
883
|
+
function Lt(e) {
|
|
915
884
|
var s;
|
|
916
885
|
const l = (s = e.target.files) == null ? void 0 : s[0];
|
|
917
886
|
l && (O(l, l.name), e.target.value = "");
|
|
918
887
|
}
|
|
919
|
-
const
|
|
888
|
+
const Nt = T(() => {
|
|
920
889
|
var e, l;
|
|
921
|
-
return
|
|
890
|
+
return o.fileName ? o.fileName : o.workbook ? "JSON 数据" : ((l = (e = k.value) == null ? void 0 : e.sheets[0]) == null ? void 0 : l.name) || "";
|
|
922
891
|
});
|
|
923
892
|
async function Vt(e) {
|
|
924
|
-
const l = await
|
|
893
|
+
const l = await Rt(e), s = Pt(l);
|
|
925
894
|
if (s === "xls") throw new Error("模板文件是旧版 .xls 或加密,仅支持 .xlsx/.xlsm");
|
|
926
895
|
if (s === "not-zip") throw new Error("模板文件不是有效的 .xlsx(非 ZIP 包)");
|
|
927
896
|
if (s === "empty") throw new Error("模板文件为空");
|
|
928
|
-
const i = await
|
|
929
|
-
return
|
|
897
|
+
const i = await At(l);
|
|
898
|
+
return Dt(i), i;
|
|
930
899
|
}
|
|
931
|
-
async function
|
|
932
|
-
const e =
|
|
933
|
-
if (
|
|
934
|
-
e && console.warn("[ooxml-excel-editor] :templateFile 只在 :workbook (JSON / 模型) 数据源下生效;xlsx 数据源已自带格式,模板已忽略."), await
|
|
900
|
+
async function gt() {
|
|
901
|
+
const e = fe.value, l = L(o.workbook);
|
|
902
|
+
if (o.src) {
|
|
903
|
+
e && console.warn("[ooxml-excel-editor] :templateFile 只在 :workbook (JSON / 模型) 数据源下生效;xlsx 数据源已自带格式,模板已忽略."), await _(o.src, p);
|
|
935
904
|
return;
|
|
936
905
|
}
|
|
937
906
|
if (l && e) {
|
|
938
907
|
try {
|
|
939
|
-
const s = await Vt(e), i =
|
|
940
|
-
|
|
908
|
+
const s = await Vt(e), i = wl(l, s);
|
|
909
|
+
K(i, p);
|
|
941
910
|
} catch (s) {
|
|
942
|
-
console.error("[ooxml-excel-editor] 模板加载失败,降级为纯 JSON 渲染:", s),
|
|
911
|
+
console.error("[ooxml-excel-editor] 模板加载失败,降级为纯 JSON 渲染:", s), K(l, p);
|
|
943
912
|
}
|
|
944
913
|
return;
|
|
945
914
|
}
|
|
946
915
|
if (l) {
|
|
947
|
-
|
|
916
|
+
K(l, p);
|
|
948
917
|
return;
|
|
949
918
|
}
|
|
950
|
-
e && await
|
|
919
|
+
e && await _(e, p);
|
|
951
920
|
}
|
|
952
|
-
const
|
|
921
|
+
const bt = T(() => {
|
|
953
922
|
const e = te.value;
|
|
954
923
|
return e ? e.stage === "read" ? "读取文件…" : e.stage === "parse" ? "解析中…" : "构建表格…" : "";
|
|
955
|
-
}),
|
|
924
|
+
}), pe = T(() => {
|
|
956
925
|
const e = te.value;
|
|
957
926
|
return e && e.ratio != null ? Math.round(e.ratio * 100) : null;
|
|
958
|
-
}),
|
|
927
|
+
}), q = C(0), J = C(1), Bt = C(null), ge = C(null), _e = C(null), le = C(null), Ke = C(null), qe = C(null), Je = C(null), je = C(null), re = ct(null), Wt = C({ scrollX: 0, scrollY: 0, width: 0, height: 0, zoom: 1 }), be = T(() => {
|
|
959
928
|
const e = k.value;
|
|
960
|
-
return e ? e.sheets[
|
|
961
|
-
}), ne =
|
|
929
|
+
return e ? e.sheets[q.value] ?? e.sheets[0] ?? null : null;
|
|
930
|
+
}), ne = C(0), Ge = C(null), Xe = C(null);
|
|
962
931
|
let t = null;
|
|
963
|
-
function
|
|
932
|
+
function De() {
|
|
964
933
|
t == null || t.render();
|
|
965
934
|
}
|
|
966
|
-
function
|
|
935
|
+
function Ot() {
|
|
967
936
|
t == null || t.measure();
|
|
968
937
|
}
|
|
969
938
|
function Ze() {
|
|
970
|
-
const e =
|
|
939
|
+
const e = be.value, l = k.value;
|
|
971
940
|
!e || !l || !t || (t.rebuild(e, l, J.value, {
|
|
972
|
-
theme:
|
|
941
|
+
theme: b.value,
|
|
973
942
|
cellStyle: u.value ? f : void 0,
|
|
974
|
-
cellImageFit:
|
|
975
|
-
readOnlyCellStyle:
|
|
943
|
+
cellImageFit: o.cellImageFit,
|
|
944
|
+
readOnlyCellStyle: o.readOnlyCellStyle
|
|
976
945
|
// Phase C 2026-06-08
|
|
977
|
-
}), t.setSourceBuffer(
|
|
946
|
+
}), t.setSourceBuffer(w.value));
|
|
978
947
|
}
|
|
979
|
-
function
|
|
948
|
+
function Ht() {
|
|
980
949
|
const e = le.value;
|
|
981
950
|
e && (se.value = null, t == null || t.setScroll(e.scrollLeft, e.scrollTop));
|
|
982
951
|
}
|
|
983
952
|
let ye = null;
|
|
984
953
|
Ue(() => {
|
|
985
|
-
|
|
954
|
+
Tt(), _e.value && ge.value && le.value && Ge.value && Xe.value && Ke.value && qe.value && Je.value && je.value && (t = new pl(
|
|
986
955
|
{
|
|
987
|
-
canvas:
|
|
988
|
-
renderArea:
|
|
956
|
+
canvas: _e.value,
|
|
957
|
+
renderArea: ge.value,
|
|
989
958
|
scroller: le.value,
|
|
990
959
|
spacer: Ge.value,
|
|
991
|
-
overlays: { main:
|
|
960
|
+
overlays: { main: Ke.value, frow: qe.value, fcol: Je.value, corner: je.value },
|
|
992
961
|
editorSlot: Xe.value
|
|
993
962
|
},
|
|
994
963
|
{
|
|
995
964
|
onRenderer: (e) => re.value = e,
|
|
996
965
|
onRenderTick: () => ne.value++,
|
|
997
|
-
onSelectionChange: () =>
|
|
966
|
+
onSelectionChange: () => Q.value++,
|
|
998
967
|
onCellClick: (e, l, s) => de("cell-click", { row: e, col: l, text: s }),
|
|
999
968
|
onCellDblClick: (e, l, s) => de("cell-dblclick", { row: e, col: l, text: s }),
|
|
1000
969
|
onHyperlink: (e, l) => {
|
|
1001
|
-
de("hyperlink-click", { url: e, cell: l }),
|
|
970
|
+
de("hyperlink-click", { url: e, cell: l }), o.openLinks && window.open(e, "_blank", "noopener");
|
|
1002
971
|
},
|
|
1003
972
|
onTooltip: (e) => se.value = e,
|
|
1004
|
-
onFindChange: () =>
|
|
1005
|
-
onFilterChange: () =>
|
|
973
|
+
onFindChange: () => nt.value++,
|
|
974
|
+
onFilterChange: () => st.value++,
|
|
1006
975
|
onEditEvent: (e, l) => de(e, l),
|
|
1007
976
|
onContextMenuBefore: (e) => {
|
|
1008
|
-
for (const l of
|
|
977
|
+
for (const l of y.value)
|
|
1009
978
|
if (l.contextMenu) {
|
|
1010
979
|
const s = l.contextMenu(e.ctx, e.items);
|
|
1011
980
|
Array.isArray(s) && e.items.splice(0, e.items.length, ...s);
|
|
1012
981
|
}
|
|
1013
|
-
|
|
982
|
+
o.contextMenu === !1 && e.preventDefault(), z("before-context-menu", e);
|
|
1014
983
|
},
|
|
1015
|
-
onContextMenuShow: (e) =>
|
|
984
|
+
onContextMenuShow: (e) => z("context-menu", e)
|
|
1016
985
|
}
|
|
1017
|
-
),
|
|
1018
|
-
|
|
1019
|
-
}),
|
|
986
|
+
), Wt.value = t.view, t.fileName = o.fileName, t.setEditConfig(a.value), t.setEditorResolver(I.value ? r : void 0), t.setLightboxEnabled(o.imageLightbox !== !1), t.setContextMenuTransform(typeof o.contextMenu == "function" ? o.contextMenu : null)), ut.value && (oe = new gl(ut.value)), gt(), ye = new ResizeObserver(() => {
|
|
987
|
+
Ot(), De();
|
|
988
|
+
}), ge.value && ye.observe(ge.value);
|
|
1020
989
|
}), Oe(() => {
|
|
1021
|
-
ye == null || ye.disconnect(), t == null || t.dispose(),
|
|
1022
|
-
}),
|
|
1023
|
-
|
|
1024
|
-
}),
|
|
990
|
+
ye == null || ye.disconnect(), t == null || t.dispose(), oe == null || oe.dispose(), Ve.forEach((e) => e()), k.value && ft(k.value);
|
|
991
|
+
}), A([() => o.src, () => o.workbook, () => o.templateFile, x], () => {
|
|
992
|
+
gt();
|
|
993
|
+
}), A(() => o.fileName, (e) => {
|
|
1025
994
|
t && (t.fileName = e);
|
|
1026
|
-
}),
|
|
995
|
+
}), A(a, (e) => t == null ? void 0 : t.setEditConfig(e)), A(() => o.contextMenu, (e) => t == null ? void 0 : t.setContextMenuTransform(typeof e == "function" ? e : null)), A([() => o.editor, y], () => t == null ? void 0 : t.setEditorResolver(I.value ? r : void 0)), A(() => o.cellImageFit, (e) => {
|
|
1027
996
|
e && (t == null || t.setCellImageFit(e));
|
|
1028
|
-
}),
|
|
1029
|
-
() => [
|
|
997
|
+
}), A(() => o.imageLightbox, (e) => t == null ? void 0 : t.setLightboxEnabled(e !== !1)), A(
|
|
998
|
+
() => [b.value, o.cellStyle, o.plugins],
|
|
1030
999
|
() => {
|
|
1031
1000
|
re.value && Ze();
|
|
1032
1001
|
},
|
|
1033
1002
|
{ deep: !0 }
|
|
1034
|
-
),
|
|
1035
|
-
e && (t == null || t.clearFilterState(),
|
|
1036
|
-
}),
|
|
1003
|
+
), A(() => o.plugins, () => Tt(), { deep: !1 }), A(k, async (e) => {
|
|
1004
|
+
e && (t == null || t.clearFilterState(), q.value = e.activeSheet, await ve(), Ze(), z("rendered", e));
|
|
1005
|
+
}), A(q, (e) => {
|
|
1037
1006
|
const l = k.value;
|
|
1038
1007
|
l != null && l.sheets[e] && de("sheet-change", { index: e, name: l.sheets[e].name });
|
|
1039
|
-
}),
|
|
1040
|
-
e &&
|
|
1041
|
-
}),
|
|
1042
|
-
e &&
|
|
1043
|
-
}),
|
|
1008
|
+
}), A(M, (e) => {
|
|
1009
|
+
e && z("error", e);
|
|
1010
|
+
}), A(te, (e) => {
|
|
1011
|
+
e && z("progress", e);
|
|
1012
|
+
}), A(q, async (e, l) => {
|
|
1044
1013
|
var s;
|
|
1045
|
-
l != null && (t == null || t.resetFilter((s = k.value) == null ? void 0 : s.sheets[l])), await
|
|
1046
|
-
}),
|
|
1047
|
-
const
|
|
1048
|
-
|
|
1014
|
+
l != null && (t == null || t.resetFilter((s = k.value) == null ? void 0 : s.sheets[l])), await ve(), Ze();
|
|
1015
|
+
}), A(J, (e) => t == null ? void 0 : t.setZoom(e));
|
|
1016
|
+
const Q = C(0), se = C(null), Y = T(() => (Q.value, re.value, (t == null ? void 0 : t.getSelection()) ?? null)), Qe = T(() => {
|
|
1017
|
+
Q.value;
|
|
1049
1018
|
const e = t == null ? void 0 : t.getActiveCell();
|
|
1050
|
-
return e ?
|
|
1019
|
+
return e ? Pe(e.col) + (e.row + 1) : "";
|
|
1051
1020
|
}), yt = T(() => {
|
|
1052
|
-
const e =
|
|
1053
|
-
return !e || e.top === e.bottom && e.left === e.right ? "" : `${
|
|
1054
|
-
}),
|
|
1055
|
-
|
|
1021
|
+
const e = Y.value;
|
|
1022
|
+
return !e || e.top === e.bottom && e.left === e.right ? "" : `${Pe(e.left)}${e.top + 1}:${Pe(e.right)}${e.bottom + 1}`;
|
|
1023
|
+
}), kt = T(() => {
|
|
1024
|
+
Q.value;
|
|
1056
1025
|
const e = re.value, l = t == null ? void 0 : t.getActiveCell();
|
|
1057
1026
|
return !e || !l ? "" : e.cellFormula(l.row, l.col) ?? e.cellText(l.row, l.col);
|
|
1058
|
-
}),
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1027
|
+
}), j = C(""), ke = C(!1), Ct = C(null);
|
|
1028
|
+
function Ye() {
|
|
1029
|
+
const e = Ct.value;
|
|
1030
|
+
e && (e.style.height = "auto", e.style.height = e.scrollHeight + "px");
|
|
1031
|
+
}
|
|
1032
|
+
function Ut(e) {
|
|
1033
|
+
j.value = e.target.value, Ye();
|
|
1034
|
+
}
|
|
1035
|
+
const _t = T(() => (Q.value, ne.value, !!(t != null && t.canEditActiveCell()))), Ae = T(() => (Q.value, ne.value, (t == null ? void 0 : t.getCellEditString()) ?? ""));
|
|
1036
|
+
A(Ae, (e) => {
|
|
1037
|
+
ke.value || (j.value = e);
|
|
1038
|
+
}, { immediate: !0 }), A(j, () => ve(Ye));
|
|
1039
|
+
function Kt() {
|
|
1040
|
+
ke.value = !0, j.value = Ae.value, ve(Ye);
|
|
1064
1041
|
}
|
|
1065
|
-
function
|
|
1042
|
+
function xt(e) {
|
|
1066
1043
|
var l;
|
|
1067
|
-
t == null || t.commitActiveCellValue(
|
|
1044
|
+
t == null || t.commitActiveCellValue(j.value, e), ke.value = !1, j.value = Ae.value, e === "down" && ((l = le.value) == null || l.focus());
|
|
1068
1045
|
}
|
|
1069
|
-
function
|
|
1046
|
+
function qt() {
|
|
1070
1047
|
var e;
|
|
1071
|
-
|
|
1048
|
+
ke.value = !1, j.value = Ae.value, (e = le.value) == null || e.focus();
|
|
1072
1049
|
}
|
|
1073
|
-
function
|
|
1074
|
-
|
|
1050
|
+
function Jt() {
|
|
1051
|
+
ke.value && xt();
|
|
1075
1052
|
}
|
|
1076
|
-
function
|
|
1077
|
-
e.stopPropagation(), e.key === "Enter" ? (e.preventDefault(),
|
|
1053
|
+
function jt(e) {
|
|
1054
|
+
e.stopPropagation(), e.key === "Enter" ? (e.preventDefault(), xt("down")) : e.key === "Escape" && (e.preventDefault(), qt());
|
|
1078
1055
|
}
|
|
1079
1056
|
const W = T(() => {
|
|
1080
|
-
|
|
1057
|
+
Q.value;
|
|
1081
1058
|
const e = re.value, l = (t == null ? void 0 : t.getSelection()) ?? null;
|
|
1082
1059
|
return e && l ? e.selectionStats(l) : null;
|
|
1083
1060
|
});
|
|
1084
1061
|
function ze(e) {
|
|
1085
1062
|
return isFinite(e) ? e.toLocaleString("en-US", { maximumFractionDigits: 2 }) : "—";
|
|
1086
1063
|
}
|
|
1087
|
-
function
|
|
1064
|
+
function Gt(e) {
|
|
1088
1065
|
t == null || t.onMouseDown(e);
|
|
1089
1066
|
}
|
|
1090
|
-
function
|
|
1067
|
+
function Xt(e) {
|
|
1091
1068
|
t == null || t.onContextMenu(e);
|
|
1092
1069
|
}
|
|
1093
|
-
function
|
|
1070
|
+
function Zt(e) {
|
|
1094
1071
|
t == null || t.onMouseMove(e);
|
|
1095
1072
|
}
|
|
1096
|
-
function
|
|
1073
|
+
function Qt(e) {
|
|
1097
1074
|
t == null || t.onMouseUp(e);
|
|
1098
1075
|
}
|
|
1099
|
-
function
|
|
1076
|
+
function Yt() {
|
|
1100
1077
|
t == null || t.onMouseLeave();
|
|
1101
1078
|
}
|
|
1102
|
-
function
|
|
1079
|
+
function el(e) {
|
|
1103
1080
|
t == null || t.onDblClick(e);
|
|
1104
1081
|
}
|
|
1105
|
-
function
|
|
1082
|
+
function tl(e) {
|
|
1106
1083
|
t == null || t.onKeyDown(e);
|
|
1107
1084
|
}
|
|
1108
|
-
|
|
1085
|
+
A(Y, (e) => {
|
|
1109
1086
|
const l = t == null ? void 0 : t.getActiveCell();
|
|
1110
1087
|
e && l && de("selection-change", { range: e, active: l });
|
|
1111
1088
|
});
|
|
1112
|
-
function
|
|
1089
|
+
function et(e, l) {
|
|
1113
1090
|
return (t == null ? void 0 : t.rectOf(e, l)) ?? null;
|
|
1114
1091
|
}
|
|
1115
|
-
function
|
|
1092
|
+
function tt(e) {
|
|
1116
1093
|
return (t == null ? void 0 : t.rectOfRange(e)) ?? null;
|
|
1117
1094
|
}
|
|
1118
|
-
const
|
|
1095
|
+
const Ce = C(null), Le = C(!1);
|
|
1119
1096
|
let xe = null;
|
|
1120
|
-
function
|
|
1097
|
+
function wt() {
|
|
1121
1098
|
xe == null || xe.abort();
|
|
1122
1099
|
}
|
|
1123
|
-
function
|
|
1124
|
-
if (
|
|
1100
|
+
function G(e, l) {
|
|
1101
|
+
if (o.exportProgress === !1) return l(e);
|
|
1125
1102
|
const s = new AbortController();
|
|
1126
|
-
xe = s, e != null && e.signal && (e.signal.aborted ? s.abort() : e.signal.addEventListener("abort", () => s.abort(), { once: !0 })),
|
|
1103
|
+
xe = s, e != null && e.signal && (e.signal.aborted ? s.abort() : e.signal.addEventListener("abort", () => s.abort(), { once: !0 })), Le.value = !0, Ce.value = null;
|
|
1127
1104
|
const m = { ...e ?? {}, onProgress: (S) => {
|
|
1128
1105
|
var D;
|
|
1129
|
-
|
|
1106
|
+
Ce.value = S, (D = e == null ? void 0 : e.onProgress) == null || D.call(e, S);
|
|
1130
1107
|
}, signal: s.signal };
|
|
1131
1108
|
return l(m).finally(() => {
|
|
1132
|
-
|
|
1109
|
+
Le.value = !1, Ce.value = null, xe = null;
|
|
1133
1110
|
});
|
|
1134
1111
|
}
|
|
1135
|
-
const
|
|
1136
|
-
async function
|
|
1112
|
+
const ll = (e) => G(e, (l) => t.exportImage(l)), we = (e) => G(e, (l) => t.downloadImage(l)), nl = (e) => G(e, (l) => t.exportPdf(l)), he = (e) => G(e, (l) => t.downloadPdf(l)), $e = (e) => G(e, (l) => t.print(l));
|
|
1113
|
+
async function ht() {
|
|
1137
1114
|
try {
|
|
1138
1115
|
await he();
|
|
1139
1116
|
} catch (e) {
|
|
1140
|
-
|
|
1117
|
+
lt(e);
|
|
1141
1118
|
}
|
|
1142
1119
|
}
|
|
1143
|
-
async function
|
|
1120
|
+
async function $t() {
|
|
1144
1121
|
try {
|
|
1145
1122
|
await he({ vector: !0 });
|
|
1146
1123
|
} catch (e) {
|
|
1147
|
-
|
|
1124
|
+
lt(e);
|
|
1148
1125
|
}
|
|
1149
1126
|
}
|
|
1150
|
-
function
|
|
1127
|
+
function lt(e) {
|
|
1151
1128
|
const l = (e == null ? void 0 : e.message) || String(e);
|
|
1152
|
-
console.error("[ooxml-excel-editor] 导出失败:", e),
|
|
1129
|
+
console.error("[ooxml-excel-editor] 导出失败:", e), z("error", l), typeof window < "u" && window.alert && window.alert(l);
|
|
1153
1130
|
}
|
|
1154
|
-
const
|
|
1155
|
-
function
|
|
1156
|
-
|
|
1131
|
+
const Se = C(!1), nt = C(0), Ee = T(() => (nt.value, (t == null ? void 0 : t.getFindState()) ?? { query: "", matchCase: !1, wholeCell: !1, count: 0, index: -1 }));
|
|
1132
|
+
function St() {
|
|
1133
|
+
Se.value = !0;
|
|
1157
1134
|
}
|
|
1158
|
-
function
|
|
1135
|
+
function Et() {
|
|
1159
1136
|
var e;
|
|
1160
|
-
|
|
1137
|
+
Se.value = !1, t == null || t.clearFind(), (e = le.value) == null || e.focus();
|
|
1161
1138
|
}
|
|
1162
|
-
function
|
|
1163
|
-
(e.ctrlKey || e.metaKey) && (e.key === "f" || e.key === "F") && (e.preventDefault(),
|
|
1139
|
+
function sl(e) {
|
|
1140
|
+
(e.ctrlKey || e.metaKey) && (e.key === "f" || e.key === "F") && (e.preventDefault(), St());
|
|
1164
1141
|
}
|
|
1165
|
-
const
|
|
1166
|
-
function
|
|
1142
|
+
const st = C(0), ae = T(() => (st.value, (t == null ? void 0 : t.getFilterPopup()) ?? null));
|
|
1143
|
+
function al() {
|
|
1167
1144
|
t == null || t.toggleAutoFilter();
|
|
1168
1145
|
}
|
|
1169
|
-
function
|
|
1170
|
-
const e =
|
|
1146
|
+
function ol() {
|
|
1147
|
+
const e = be.value, l = re.value;
|
|
1171
1148
|
if (!e || !l) return;
|
|
1172
1149
|
const s = e.freeze;
|
|
1173
1150
|
if (s.frozenRows || s.frozenCols)
|
|
@@ -1176,12 +1153,12 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1176
1153
|
const i = t == null ? void 0 : t.getActiveCell();
|
|
1177
1154
|
e.freeze = { frozenRows: i ? i.row : 1, frozenCols: i ? i.col : 0 };
|
|
1178
1155
|
}
|
|
1179
|
-
l.rebuildMetrics(), t == null || t.refreshContentSize(),
|
|
1156
|
+
l.rebuildMetrics(), t == null || t.refreshContentSize(), De();
|
|
1180
1157
|
}
|
|
1181
|
-
const
|
|
1182
|
-
async function
|
|
1183
|
-
|
|
1184
|
-
const l = e.scope === "all" ? "all" : "active", s = e.scope === "selection" ?
|
|
1158
|
+
const Te = C(!1);
|
|
1159
|
+
async function il(e) {
|
|
1160
|
+
Te.value = !1;
|
|
1161
|
+
const l = e.scope === "all" ? "all" : "active", s = e.scope === "selection" ? Y.value ?? void 0 : void 0, i = {
|
|
1185
1162
|
target: l,
|
|
1186
1163
|
range: s,
|
|
1187
1164
|
scale: e.scale,
|
|
@@ -1193,27 +1170,27 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1193
1170
|
fitToWidth: e.fitToWidth
|
|
1194
1171
|
};
|
|
1195
1172
|
try {
|
|
1196
|
-
e.action === "png" ? await
|
|
1173
|
+
e.action === "png" ? await we(i) : e.action === "pdf" ? await he({ ...i, ...m, vector: e.pdfVector }) : await $e({ ...i, ...m });
|
|
1197
1174
|
} catch (S) {
|
|
1198
|
-
|
|
1175
|
+
lt(S);
|
|
1199
1176
|
}
|
|
1200
1177
|
}
|
|
1201
|
-
function
|
|
1178
|
+
function ul(e) {
|
|
1202
1179
|
t == null || t.setSelectionRange(e);
|
|
1203
1180
|
}
|
|
1204
|
-
const
|
|
1205
|
-
load: (e) =>
|
|
1181
|
+
const Fe = {
|
|
1182
|
+
load: (e) => _(e, p),
|
|
1206
1183
|
getWorkbook: () => k.value,
|
|
1207
|
-
getActiveSheet: () =>
|
|
1184
|
+
getActiveSheet: () => q.value,
|
|
1208
1185
|
setActiveSheet: (e) => {
|
|
1209
1186
|
var l;
|
|
1210
|
-
(l = k.value) != null && l.sheets[e] && (
|
|
1187
|
+
(l = k.value) != null && l.sheets[e] && (q.value = e);
|
|
1211
1188
|
},
|
|
1212
|
-
getSelection: () =>
|
|
1213
|
-
setSelection:
|
|
1214
|
-
rectOf:
|
|
1215
|
-
rectOfRange:
|
|
1216
|
-
redraw: () =>
|
|
1189
|
+
getSelection: () => Y.value,
|
|
1190
|
+
setSelection: ul,
|
|
1191
|
+
rectOf: et,
|
|
1192
|
+
rectOfRange: tt,
|
|
1193
|
+
redraw: () => De(),
|
|
1217
1194
|
isCellEditable: (e, l) => (t == null ? void 0 : t.isCellEditable(e, l)) ?? !1,
|
|
1218
1195
|
setEditableTargets: (e) => t == null ? void 0 : t.setEditableTargets(e),
|
|
1219
1196
|
getEditableTargets: () => t == null ? void 0 : t.getEditableTargets(),
|
|
@@ -1247,11 +1224,11 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1247
1224
|
convertImageToCell: (e, l, s) => (t == null ? void 0 : t.convertImageToCell(e, l, s)) ?? !1,
|
|
1248
1225
|
convertImageToCellAuto: (e) => (t == null ? void 0 : t.convertImageToCellAuto(e)) ?? !1,
|
|
1249
1226
|
convertAllImagesToCells: (e) => (t == null ? void 0 : t.convertAllImagesToCells(e)) ?? 0,
|
|
1250
|
-
convertImagesInRangeToCell: (e) =>
|
|
1227
|
+
convertImagesInRangeToCell: (e) => G({}, async (l) => {
|
|
1251
1228
|
var s;
|
|
1252
1229
|
return (s = l.onProgress) == null || s.call(l, { stage: "convert", label: "选区浮动图批量嵌入…", ratio: void 0 }), (t == null ? void 0 : t.convertImagesInRangeToCell(e)) ?? 0;
|
|
1253
1230
|
}),
|
|
1254
|
-
convertCellImagesInRangeToFloat: (e, l) =>
|
|
1231
|
+
convertCellImagesInRangeToFloat: (e, l) => G({}, async (s) => {
|
|
1255
1232
|
var i;
|
|
1256
1233
|
return (i = s.onProgress) == null || i.call(s, { stage: "convert", label: "选区内嵌图批量浮动化…", ratio: void 0 }), (t == null ? void 0 : t.convertCellImagesInRangeToFloat(e, l)) ?? 0;
|
|
1257
1234
|
}),
|
|
@@ -1282,54 +1259,54 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1282
1259
|
getVirtualExtent: () => (t == null ? void 0 : t.getVirtualExtent()) ?? { rows: 0, cols: 0 },
|
|
1283
1260
|
isDirty: () => (t == null ? void 0 : t.isDirty()) ?? !1,
|
|
1284
1261
|
resetToOriginal: () => (t == null ? void 0 : t.resetToOriginal()) ?? !1,
|
|
1285
|
-
exportImage:
|
|
1286
|
-
downloadImage:
|
|
1287
|
-
exportPdf:
|
|
1262
|
+
exportImage: ll,
|
|
1263
|
+
downloadImage: we,
|
|
1264
|
+
exportPdf: nl,
|
|
1288
1265
|
downloadPdf: he,
|
|
1289
|
-
print:
|
|
1290
|
-
exportXlsx: (e) =>
|
|
1291
|
-
downloadXlsx: (e) =>
|
|
1266
|
+
print: $e,
|
|
1267
|
+
exportXlsx: (e) => G(e, (l) => t.exportXlsx(l)),
|
|
1268
|
+
downloadXlsx: (e) => G(e, (l) => t.downloadXlsx(l)),
|
|
1292
1269
|
exportJson: (e) => (t == null ? void 0 : t.exportJson(e)) ?? "{}",
|
|
1293
1270
|
downloadJson: (e) => t == null ? void 0 : t.downloadJson(e),
|
|
1294
1271
|
exportCsv: (e) => (t == null ? void 0 : t.exportCsv(e)) ?? "",
|
|
1295
1272
|
downloadCsv: (e) => t == null ? void 0 : t.downloadCsv(e),
|
|
1296
1273
|
// ---- 数据读取(委托独立函数,自动绑 date1904 + 默认当前表) ----
|
|
1297
1274
|
getCellValue: (e, l, s) => {
|
|
1298
|
-
const i =
|
|
1299
|
-
return i ?
|
|
1275
|
+
const i = Ie(s);
|
|
1276
|
+
return i ? xl(i, e, l) : null;
|
|
1300
1277
|
},
|
|
1301
1278
|
getCellText: (e, l, s) => {
|
|
1302
1279
|
var m;
|
|
1303
|
-
const i =
|
|
1304
|
-
return i ?
|
|
1280
|
+
const i = Ie(s);
|
|
1281
|
+
return i ? Cl(i, e, l, ((m = k.value) == null ? void 0 : m.date1904) ?? !1) : "";
|
|
1305
1282
|
},
|
|
1306
1283
|
getSheetData: (e, l) => {
|
|
1307
|
-
const s =
|
|
1308
|
-
return s ?
|
|
1284
|
+
const s = Ie(l);
|
|
1285
|
+
return s ? kl(s, at(e)) : [];
|
|
1309
1286
|
},
|
|
1310
1287
|
getSheetJSON: (e, l) => {
|
|
1311
|
-
const s =
|
|
1312
|
-
return s ?
|
|
1288
|
+
const s = Ie(l);
|
|
1289
|
+
return s ? yl(s, at(e)) : [];
|
|
1313
1290
|
},
|
|
1314
1291
|
getRangeData: (e, l, s) => {
|
|
1315
|
-
const i =
|
|
1316
|
-
return i ?
|
|
1292
|
+
const i = Ie(s);
|
|
1293
|
+
return i ? bl(i, e, at(l)) : [];
|
|
1317
1294
|
}
|
|
1318
1295
|
};
|
|
1319
|
-
function
|
|
1296
|
+
function Ie(e) {
|
|
1320
1297
|
const l = k.value;
|
|
1321
|
-
return l ? l.sheets[e ??
|
|
1298
|
+
return l ? l.sheets[e ?? q.value] ?? null : null;
|
|
1322
1299
|
}
|
|
1323
|
-
function
|
|
1300
|
+
function at(e) {
|
|
1324
1301
|
var l;
|
|
1325
1302
|
return { ...e, date1904: ((l = k.value) == null ? void 0 : l.date1904) ?? !1 };
|
|
1326
1303
|
}
|
|
1327
|
-
$(
|
|
1328
|
-
const H = (e) =>
|
|
1304
|
+
$(Fe);
|
|
1305
|
+
const H = (e) => Be[e];
|
|
1329
1306
|
function R(e) {
|
|
1330
1307
|
return { kind: "builtin", ...e };
|
|
1331
1308
|
}
|
|
1332
|
-
function
|
|
1309
|
+
function rl(e) {
|
|
1333
1310
|
var l, s, i;
|
|
1334
1311
|
switch (e) {
|
|
1335
1312
|
case "find":
|
|
@@ -1338,8 +1315,8 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1338
1315
|
iconSvg: H("find"),
|
|
1339
1316
|
label: "查找",
|
|
1340
1317
|
title: "查找 (Ctrl+F)",
|
|
1341
|
-
active:
|
|
1342
|
-
onClick: () =>
|
|
1318
|
+
active: Se.value,
|
|
1319
|
+
onClick: () => Se.value ? Et() : St()
|
|
1343
1320
|
});
|
|
1344
1321
|
case "filter":
|
|
1345
1322
|
return R({
|
|
@@ -1347,8 +1324,8 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1347
1324
|
iconSvg: H("filter"),
|
|
1348
1325
|
label: "筛选",
|
|
1349
1326
|
title: "切换自动筛选",
|
|
1350
|
-
active: !!((l =
|
|
1351
|
-
onClick:
|
|
1327
|
+
active: !!((l = be.value) != null && l.autoFilterRange),
|
|
1328
|
+
onClick: al
|
|
1352
1329
|
});
|
|
1353
1330
|
case "clear-filter":
|
|
1354
1331
|
return R({
|
|
@@ -1365,7 +1342,7 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1365
1342
|
iconSvg: H("copy"),
|
|
1366
1343
|
label: "复制",
|
|
1367
1344
|
title: "复制选区 (Ctrl+C)",
|
|
1368
|
-
disabled: !
|
|
1345
|
+
disabled: !Y.value,
|
|
1369
1346
|
onClick: () => void (t == null ? void 0 : t.copySelection())
|
|
1370
1347
|
});
|
|
1371
1348
|
case "wrap-text": {
|
|
@@ -1376,12 +1353,12 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1376
1353
|
label: "自动换行",
|
|
1377
1354
|
title: "自动换行(选区,WPS 风格 toggle)",
|
|
1378
1355
|
active: m === "all",
|
|
1379
|
-
disabled: !
|
|
1356
|
+
disabled: !Y.value || !o.editable,
|
|
1380
1357
|
onClick: () => void (t == null ? void 0 : t.toggleWrapTextOnSelection())
|
|
1381
1358
|
});
|
|
1382
1359
|
}
|
|
1383
1360
|
case "template": {
|
|
1384
|
-
const m = !!
|
|
1361
|
+
const m = !!fe.value, S = me.value, D = !!o.src && !o.workbook;
|
|
1385
1362
|
return R({
|
|
1386
1363
|
id: e,
|
|
1387
1364
|
iconSvg: H("template"),
|
|
@@ -1395,33 +1372,33 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1395
1372
|
label: (m ? "" : "✓ ") + "默认渲染",
|
|
1396
1373
|
title: "不套模板,数据按默认样式渲染",
|
|
1397
1374
|
disabled: !m,
|
|
1398
|
-
onClick:
|
|
1375
|
+
onClick: mt
|
|
1399
1376
|
}),
|
|
1400
1377
|
R({ id: "tpl-sep", type: "separator" }),
|
|
1401
1378
|
R({
|
|
1402
1379
|
id: "tpl-import",
|
|
1403
1380
|
label: "导入 .xlsx 模板…",
|
|
1404
1381
|
title: "选一份 .xlsx,把它的 styling(边框/字体/列宽/合并/freeze) 套到当前 JSON 数据上;模板的文字内容会被丢弃",
|
|
1405
|
-
onClick:
|
|
1382
|
+
onClick: zt
|
|
1406
1383
|
}),
|
|
1407
1384
|
R({
|
|
1408
1385
|
id: "tpl-clear",
|
|
1409
1386
|
label: "清除模板",
|
|
1410
1387
|
title: "切回默认样式渲染",
|
|
1411
1388
|
disabled: !m,
|
|
1412
|
-
onClick:
|
|
1389
|
+
onClick: mt
|
|
1413
1390
|
})
|
|
1414
1391
|
]
|
|
1415
1392
|
});
|
|
1416
1393
|
}
|
|
1417
1394
|
case "image-tools": {
|
|
1418
|
-
const m =
|
|
1395
|
+
const m = Y.value, S = t == null ? void 0 : t.getActiveCell(), D = (((s = be.value) == null ? void 0 : s.images.length) ?? 0) > 0;
|
|
1419
1396
|
return R({
|
|
1420
1397
|
id: e,
|
|
1421
1398
|
iconSvg: H("image-tools"),
|
|
1422
1399
|
label: "图片工具",
|
|
1423
1400
|
title: "浮动图 ⇄ 单元格内嵌图(WPS DISPIMG)互转",
|
|
1424
|
-
disabled: !
|
|
1401
|
+
disabled: !o.editable,
|
|
1425
1402
|
items: [
|
|
1426
1403
|
R({
|
|
1427
1404
|
id: "img-sel-to-cell",
|
|
@@ -1456,14 +1433,14 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1456
1433
|
});
|
|
1457
1434
|
}
|
|
1458
1435
|
case "freeze": {
|
|
1459
|
-
const m = (i =
|
|
1436
|
+
const m = (i = be.value) == null ? void 0 : i.freeze;
|
|
1460
1437
|
return R({
|
|
1461
1438
|
id: e,
|
|
1462
1439
|
iconSvg: H("freeze"),
|
|
1463
1440
|
label: "冻结",
|
|
1464
1441
|
title: "冻结/取消冻结(在活动单元格)",
|
|
1465
1442
|
active: !!(m && (m.frozenRows || m.frozenCols)),
|
|
1466
|
-
onClick:
|
|
1443
|
+
onClick: ol
|
|
1467
1444
|
});
|
|
1468
1445
|
}
|
|
1469
1446
|
case "export":
|
|
@@ -1473,12 +1450,12 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1473
1450
|
label: "导出",
|
|
1474
1451
|
title: "导出 / 打印",
|
|
1475
1452
|
items: [
|
|
1476
|
-
R({ id: "export-png", label: "导出为图片 (PNG)", onClick: () => void
|
|
1477
|
-
R({ id: "export-pdf", label: "导出为 PDF (位图)", onClick:
|
|
1478
|
-
R({ id: "export-pdf-vector", label: "导出为 PDF (矢量·文字可选)", onClick:
|
|
1479
|
-
R({ id: "export-print", label: "打印…", onClick: () => void
|
|
1453
|
+
R({ id: "export-png", label: "导出为图片 (PNG)", onClick: () => void we() }),
|
|
1454
|
+
R({ id: "export-pdf", label: "导出为 PDF (位图)", onClick: ht }),
|
|
1455
|
+
R({ id: "export-pdf-vector", label: "导出为 PDF (矢量·文字可选)", onClick: $t }),
|
|
1456
|
+
R({ id: "export-print", label: "打印…", onClick: () => void $e() }),
|
|
1480
1457
|
R({ id: "export-sep", type: "separator" }),
|
|
1481
|
-
R({ id: "export-settings", label: "导出设置…", onClick: () =>
|
|
1458
|
+
R({ id: "export-settings", label: "导出设置…", onClick: () => Te.value = !0 })
|
|
1482
1459
|
]
|
|
1483
1460
|
});
|
|
1484
1461
|
case "zoom":
|
|
@@ -1504,121 +1481,124 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1504
1481
|
icon: e.icon,
|
|
1505
1482
|
label: e.label,
|
|
1506
1483
|
title: e.title,
|
|
1507
|
-
active: !!((s = e.active) != null && s.call(e,
|
|
1508
|
-
disabled: !!((i = e.disabled) != null && i.call(e,
|
|
1509
|
-
onClick: e.onClick ? () => e.onClick(
|
|
1484
|
+
active: !!((s = e.active) != null && s.call(e, Fe)),
|
|
1485
|
+
disabled: !!((i = e.disabled) != null && i.call(e, Fe)),
|
|
1486
|
+
onClick: e.onClick ? () => e.onClick(Fe) : void 0,
|
|
1510
1487
|
items: (m = e.items) == null ? void 0 : m.map((S) => ot(S, l)),
|
|
1511
1488
|
kind: l
|
|
1512
1489
|
};
|
|
1513
1490
|
}
|
|
1514
|
-
const
|
|
1515
|
-
if (ne.value,
|
|
1516
|
-
const e = Array.isArray(
|
|
1491
|
+
const it = T(() => {
|
|
1492
|
+
if (ne.value, Q.value, nt.value, st.value, o.toolbar === !1) return [];
|
|
1493
|
+
const e = Array.isArray(o.toolbar) ? o.toolbar : ["find", "filter"], l = [];
|
|
1517
1494
|
for (const s of e)
|
|
1518
1495
|
if (typeof s == "string")
|
|
1519
1496
|
if (s === "separator" || s === "|") l.push({ id: "sep-" + l.length, type: "separator", kind: "builtin" });
|
|
1520
1497
|
else {
|
|
1521
|
-
const i =
|
|
1498
|
+
const i = rl(s);
|
|
1522
1499
|
i && l.push(i);
|
|
1523
1500
|
}
|
|
1524
1501
|
else
|
|
1525
1502
|
l.push(ot(s, "custom"));
|
|
1526
|
-
for (const s of
|
|
1503
|
+
for (const s of y.value)
|
|
1527
1504
|
for (const i of s.toolbar ?? []) l.push(ot(i, "plugin"));
|
|
1528
1505
|
return l;
|
|
1529
|
-
}),
|
|
1530
|
-
let
|
|
1506
|
+
}), dl = T(() => o.toolbar !== !1 && it.value.length > 0), Ne = /* @__PURE__ */ new Map();
|
|
1507
|
+
let Ve = [];
|
|
1531
1508
|
function de(e, l) {
|
|
1532
1509
|
var s;
|
|
1533
|
-
|
|
1510
|
+
z(e, l), (s = Ne.get(e)) == null || s.forEach((i) => i(l));
|
|
1534
1511
|
}
|
|
1535
|
-
function
|
|
1512
|
+
function Tt() {
|
|
1536
1513
|
var s;
|
|
1537
|
-
|
|
1514
|
+
Ve.forEach((i) => i()), Ve = [], Ne.clear();
|
|
1538
1515
|
const e = (i, m) => {
|
|
1539
|
-
let S =
|
|
1540
|
-
S ||
|
|
1541
|
-
}, l = { viewer:
|
|
1542
|
-
for (const i of
|
|
1516
|
+
let S = Ne.get(i);
|
|
1517
|
+
S || Ne.set(i, S = /* @__PURE__ */ new Set()), S.add(m);
|
|
1518
|
+
}, l = { viewer: Fe, on: e, redraw: () => De() };
|
|
1519
|
+
for (const i of y.value) {
|
|
1543
1520
|
if (i.events)
|
|
1544
1521
|
for (const [S, D] of Object.entries(i.events)) D && e(S, D);
|
|
1545
1522
|
const m = (s = i.setup) == null ? void 0 : s.call(i, l);
|
|
1546
|
-
typeof m == "function" &&
|
|
1523
|
+
typeof m == "function" && Ve.push(m);
|
|
1547
1524
|
}
|
|
1548
1525
|
}
|
|
1549
|
-
const
|
|
1550
|
-
let
|
|
1551
|
-
function
|
|
1552
|
-
const e = { rectOf:
|
|
1553
|
-
|
|
1526
|
+
const ut = C(null);
|
|
1527
|
+
let oe = null;
|
|
1528
|
+
function vl() {
|
|
1529
|
+
const e = { rectOf: et, rectOfRange: tt, tick: ne.value, workbook: k.value };
|
|
1530
|
+
oe == null || oe.render(y.value, e);
|
|
1554
1531
|
}
|
|
1555
|
-
return
|
|
1532
|
+
return A([ne, y], vl, { flush: "post" }), (e, l) => (v(), c("div", {
|
|
1556
1533
|
class: "excel-viewer",
|
|
1557
1534
|
ref_key: "rootEl",
|
|
1558
|
-
ref:
|
|
1559
|
-
onKeydown:
|
|
1535
|
+
ref: Bt,
|
|
1536
|
+
onKeydown: sl
|
|
1560
1537
|
}, [
|
|
1561
|
-
|
|
1538
|
+
h(k) ? ee(e.$slots, "header", {
|
|
1562
1539
|
key: 0,
|
|
1563
|
-
workbook:
|
|
1540
|
+
workbook: h(k),
|
|
1564
1541
|
zoom: J.value,
|
|
1565
1542
|
setZoom: (s) => J.value = s,
|
|
1566
|
-
downloadImage:
|
|
1543
|
+
downloadImage: we,
|
|
1567
1544
|
downloadPdf: he,
|
|
1568
|
-
print:
|
|
1545
|
+
print: $e
|
|
1569
1546
|
}, () => [
|
|
1570
|
-
|
|
1571
|
-
"file-name":
|
|
1572
|
-
"template-name":
|
|
1573
|
-
"sheet-count":
|
|
1547
|
+
vt(Nl, {
|
|
1548
|
+
"file-name": Nt.value,
|
|
1549
|
+
"template-name": me.value,
|
|
1550
|
+
"sheet-count": h(k).sheets.filter((s) => s.state === "visible").length,
|
|
1574
1551
|
zoom: J.value,
|
|
1575
1552
|
"onUpdate:zoom": l[0] || (l[0] = (s) => J.value = s),
|
|
1576
|
-
onExportImage: l[1] || (l[1] = (s) =>
|
|
1577
|
-
onExportPdf:
|
|
1578
|
-
onExportPdfVector:
|
|
1579
|
-
onPrint: l[2] || (l[2] = (s) =>
|
|
1580
|
-
onOpenSettings: l[3] || (l[3] = (s) =>
|
|
1553
|
+
onExportImage: l[1] || (l[1] = (s) => we()),
|
|
1554
|
+
onExportPdf: ht,
|
|
1555
|
+
onExportPdfVector: $t,
|
|
1556
|
+
onPrint: l[2] || (l[2] = (s) => $e()),
|
|
1557
|
+
onOpenSettings: l[3] || (l[3] = (s) => Te.value = !0)
|
|
1581
1558
|
}, null, 8, ["file-name", "template-name", "sheet-count", "zoom"])
|
|
1582
|
-
], !0) :
|
|
1583
|
-
|
|
1559
|
+
], !0) : F("", !0),
|
|
1560
|
+
h(k) && dl.value ? ee(e.$slots, "toolbar", {
|
|
1584
1561
|
key: 1,
|
|
1585
|
-
items:
|
|
1562
|
+
items: it.value
|
|
1586
1563
|
}, () => [
|
|
1587
|
-
|
|
1588
|
-
], !0) :
|
|
1589
|
-
|
|
1590
|
-
n("span",
|
|
1591
|
-
l[
|
|
1592
|
-
|
|
1564
|
+
vt(qn, { items: it.value }, null, 8, ["items"])
|
|
1565
|
+
], !0) : F("", !0),
|
|
1566
|
+
h(k) ? (v(), c("div", es, [
|
|
1567
|
+
n("span", ts, E(Qe.value || "—"), 1),
|
|
1568
|
+
l[15] || (l[15] = n("span", { class: "fx" }, "fx", -1)),
|
|
1569
|
+
_t.value ? (v(), c("textarea", {
|
|
1593
1570
|
key: 0,
|
|
1571
|
+
ref_key: "fbEl",
|
|
1572
|
+
ref: Ct,
|
|
1594
1573
|
class: "content content-input",
|
|
1595
|
-
value:
|
|
1596
|
-
title:
|
|
1574
|
+
value: j.value,
|
|
1575
|
+
title: j.value,
|
|
1576
|
+
rows: "1",
|
|
1597
1577
|
spellcheck: "false",
|
|
1598
|
-
onFocus:
|
|
1599
|
-
onInput:
|
|
1600
|
-
onKeydown:
|
|
1601
|
-
onBlur:
|
|
1602
|
-
}, null, 40,
|
|
1578
|
+
onFocus: Kt,
|
|
1579
|
+
onInput: Ut,
|
|
1580
|
+
onKeydown: jt,
|
|
1581
|
+
onBlur: Jt
|
|
1582
|
+
}, null, 40, ls)) : (v(), c("span", {
|
|
1603
1583
|
key: 1,
|
|
1604
1584
|
class: "content",
|
|
1605
|
-
title:
|
|
1606
|
-
}, E(
|
|
1607
|
-
])) :
|
|
1585
|
+
title: kt.value
|
|
1586
|
+
}, E(kt.value), 9, ns))
|
|
1587
|
+
])) : F("", !0),
|
|
1608
1588
|
n("div", {
|
|
1609
1589
|
class: "render-area",
|
|
1610
1590
|
ref_key: "renderAreaEl",
|
|
1611
|
-
ref:
|
|
1591
|
+
ref: ge
|
|
1612
1592
|
}, [
|
|
1613
1593
|
n("canvas", {
|
|
1614
1594
|
ref_key: "canvasEl",
|
|
1615
|
-
ref:
|
|
1595
|
+
ref: _e,
|
|
1616
1596
|
class: "grid-canvas"
|
|
1617
1597
|
}, null, 512),
|
|
1618
1598
|
n("div", {
|
|
1619
1599
|
class: "ov",
|
|
1620
1600
|
ref_key: "ovMain",
|
|
1621
|
-
ref:
|
|
1601
|
+
ref: Ke
|
|
1622
1602
|
}, null, 512),
|
|
1623
1603
|
n("div", {
|
|
1624
1604
|
class: "ov",
|
|
@@ -1628,7 +1608,7 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1628
1608
|
n("div", {
|
|
1629
1609
|
class: "ov",
|
|
1630
1610
|
ref_key: "ovFRow",
|
|
1631
|
-
ref:
|
|
1611
|
+
ref: qe
|
|
1632
1612
|
}, null, 512),
|
|
1633
1613
|
n("div", {
|
|
1634
1614
|
class: "ov",
|
|
@@ -1640,14 +1620,14 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1640
1620
|
ref_key: "scrollerEl",
|
|
1641
1621
|
ref: le,
|
|
1642
1622
|
tabindex: "0",
|
|
1643
|
-
onScroll:
|
|
1644
|
-
onMousedown:
|
|
1645
|
-
onMousemove:
|
|
1646
|
-
onMouseup:
|
|
1647
|
-
onMouseleave:
|
|
1648
|
-
onDblclick:
|
|
1649
|
-
onKeydown:
|
|
1650
|
-
onContextmenu:
|
|
1623
|
+
onScroll: Ht,
|
|
1624
|
+
onMousedown: Gt,
|
|
1625
|
+
onMousemove: Zt,
|
|
1626
|
+
onMouseup: Qt,
|
|
1627
|
+
onMouseleave: Yt,
|
|
1628
|
+
onDblclick: el,
|
|
1629
|
+
onKeydown: tl,
|
|
1630
|
+
onContextmenu: Xt
|
|
1651
1631
|
}, [
|
|
1652
1632
|
n("div", {
|
|
1653
1633
|
class: "spacer",
|
|
@@ -1655,69 +1635,69 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1655
1635
|
ref: Ge
|
|
1656
1636
|
}, null, 512)
|
|
1657
1637
|
], 544),
|
|
1658
|
-
|
|
1638
|
+
Se.value && h(k) ? (v(), ie(vn, {
|
|
1659
1639
|
key: 0,
|
|
1660
|
-
query:
|
|
1661
|
-
"match-count":
|
|
1662
|
-
current:
|
|
1663
|
-
"match-case":
|
|
1664
|
-
"whole-cell":
|
|
1665
|
-
"onUpdate:query": l[
|
|
1640
|
+
query: Ee.value.query,
|
|
1641
|
+
"match-count": Ee.value.count,
|
|
1642
|
+
current: Ee.value.index,
|
|
1643
|
+
"match-case": Ee.value.matchCase,
|
|
1644
|
+
"whole-cell": Ee.value.wholeCell,
|
|
1645
|
+
"onUpdate:query": l[4] || (l[4] = (s) => {
|
|
1666
1646
|
var i;
|
|
1667
|
-
return (i =
|
|
1647
|
+
return (i = h(t)) == null ? void 0 : i.setFindQuery(s);
|
|
1668
1648
|
}),
|
|
1669
|
-
"onUpdate:matchCase": l[
|
|
1649
|
+
"onUpdate:matchCase": l[5] || (l[5] = (s) => {
|
|
1670
1650
|
var i;
|
|
1671
|
-
return (i =
|
|
1651
|
+
return (i = h(t)) == null ? void 0 : i.setFindMatchCase(s);
|
|
1672
1652
|
}),
|
|
1673
|
-
"onUpdate:wholeCell": l[
|
|
1653
|
+
"onUpdate:wholeCell": l[6] || (l[6] = (s) => {
|
|
1674
1654
|
var i;
|
|
1675
|
-
return (i =
|
|
1655
|
+
return (i = h(t)) == null ? void 0 : i.setFindWholeCell(s);
|
|
1676
1656
|
}),
|
|
1677
|
-
onNext: l[
|
|
1657
|
+
onNext: l[7] || (l[7] = (s) => {
|
|
1678
1658
|
var i;
|
|
1679
|
-
return (i =
|
|
1659
|
+
return (i = h(t)) == null ? void 0 : i.findNext();
|
|
1680
1660
|
}),
|
|
1681
|
-
onPrev: l[
|
|
1661
|
+
onPrev: l[8] || (l[8] = (s) => {
|
|
1682
1662
|
var i;
|
|
1683
|
-
return (i =
|
|
1663
|
+
return (i = h(t)) == null ? void 0 : i.findPrev();
|
|
1684
1664
|
}),
|
|
1685
|
-
onClose:
|
|
1686
|
-
}, null, 8, ["query", "match-count", "current", "match-case", "whole-cell"])) :
|
|
1687
|
-
|
|
1665
|
+
onClose: Et
|
|
1666
|
+
}, null, 8, ["query", "match-count", "current", "match-case", "whole-cell"])) : F("", !0),
|
|
1667
|
+
ae.value ? (v(), ie(xn, {
|
|
1688
1668
|
key: 1,
|
|
1689
|
-
values:
|
|
1690
|
-
selected:
|
|
1691
|
-
x:
|
|
1692
|
-
y:
|
|
1693
|
-
"sort-dir":
|
|
1694
|
-
onApply: l[
|
|
1669
|
+
values: ae.value.values,
|
|
1670
|
+
selected: ae.value.selected,
|
|
1671
|
+
x: ae.value.x,
|
|
1672
|
+
y: ae.value.y,
|
|
1673
|
+
"sort-dir": ae.value.sortDir,
|
|
1674
|
+
onApply: l[9] || (l[9] = (s) => {
|
|
1695
1675
|
var i;
|
|
1696
|
-
return (i =
|
|
1676
|
+
return (i = h(t)) == null ? void 0 : i.applyFilterSelection(s);
|
|
1697
1677
|
}),
|
|
1698
|
-
onClear: l[
|
|
1678
|
+
onClear: l[10] || (l[10] = (s) => {
|
|
1699
1679
|
var i;
|
|
1700
|
-
return (i =
|
|
1680
|
+
return (i = h(t)) == null ? void 0 : i.clearFilterColumn();
|
|
1701
1681
|
}),
|
|
1702
|
-
onClose: l[
|
|
1682
|
+
onClose: l[11] || (l[11] = (s) => {
|
|
1703
1683
|
var i;
|
|
1704
|
-
return (i =
|
|
1684
|
+
return (i = h(t)) == null ? void 0 : i.closeFilterPopup();
|
|
1705
1685
|
}),
|
|
1706
|
-
onSort: l[
|
|
1686
|
+
onSort: l[12] || (l[12] = (s) => {
|
|
1707
1687
|
var m, S, D;
|
|
1708
|
-
const i = (m =
|
|
1709
|
-
(S =
|
|
1688
|
+
const i = (m = ae.value) == null ? void 0 : m.col;
|
|
1689
|
+
(S = h(t)) == null || S.closeFilterPopup(), i != null && ((D = h(t)) == null || D.sortColumn(i, s));
|
|
1710
1690
|
})
|
|
1711
|
-
}, null, 8, ["values", "selected", "x", "y", "sort-dir"])) :
|
|
1712
|
-
n("div",
|
|
1691
|
+
}, null, 8, ["values", "selected", "x", "y", "sort-dir"])) : F("", !0),
|
|
1692
|
+
n("div", ss, [
|
|
1713
1693
|
ee(e.$slots, "overlay", {
|
|
1714
|
-
rectOf:
|
|
1715
|
-
rectOfRange:
|
|
1694
|
+
rectOf: et,
|
|
1695
|
+
rectOfRange: tt,
|
|
1716
1696
|
tick: ne.value
|
|
1717
1697
|
}, void 0, !0),
|
|
1718
1698
|
n("div", {
|
|
1719
1699
|
ref_key: "pluginOvEl",
|
|
1720
|
-
ref:
|
|
1700
|
+
ref: ut
|
|
1721
1701
|
}, null, 512)
|
|
1722
1702
|
]),
|
|
1723
1703
|
n("div", {
|
|
@@ -1725,117 +1705,117 @@ const kn = { class: "tb-menu" }, xn = {
|
|
|
1725
1705
|
ref_key: "editorSlotEl",
|
|
1726
1706
|
ref: Xe
|
|
1727
1707
|
}, null, 512),
|
|
1728
|
-
se.value ? (
|
|
1708
|
+
se.value ? (v(), c("div", {
|
|
1729
1709
|
key: 2,
|
|
1730
1710
|
class: B(["cell-tooltip", se.value.kind]),
|
|
1731
|
-
style:
|
|
1732
|
-
}, E(se.value.text), 7)) :
|
|
1733
|
-
|
|
1711
|
+
style: We({ left: se.value.x + "px", top: se.value.y + "px" })
|
|
1712
|
+
}, E(se.value.text), 7)) : F("", !0),
|
|
1713
|
+
h(P) ? (v(), c("div", as, [
|
|
1734
1714
|
ee(e.$slots, "loading", {
|
|
1735
|
-
progress:
|
|
1736
|
-
label:
|
|
1737
|
-
pct:
|
|
1715
|
+
progress: h(te),
|
|
1716
|
+
label: bt.value,
|
|
1717
|
+
pct: pe.value
|
|
1738
1718
|
}, () => [
|
|
1739
|
-
n("div",
|
|
1740
|
-
n("div",
|
|
1741
|
-
|
|
1742
|
-
|
|
1719
|
+
n("div", os, [
|
|
1720
|
+
n("div", is, [
|
|
1721
|
+
N(E(bt.value), 1),
|
|
1722
|
+
pe.value != null ? (v(), c("span", us, E(pe.value) + "%", 1)) : F("", !0)
|
|
1743
1723
|
]),
|
|
1744
|
-
n("div",
|
|
1745
|
-
|
|
1724
|
+
n("div", rs, [
|
|
1725
|
+
pe.value != null ? (v(), c("div", {
|
|
1746
1726
|
key: 0,
|
|
1747
1727
|
class: "loader-fill",
|
|
1748
|
-
style:
|
|
1749
|
-
}, null, 4)) : (
|
|
1728
|
+
style: We({ width: pe.value + "%" })
|
|
1729
|
+
}, null, 4)) : (v(), c("div", ds))
|
|
1750
1730
|
])
|
|
1751
1731
|
])
|
|
1752
1732
|
], !0)
|
|
1753
|
-
])) :
|
|
1754
|
-
ee(e.$slots, "error", { error:
|
|
1755
|
-
|
|
1733
|
+
])) : h(M) ? (v(), c("div", vs, [
|
|
1734
|
+
ee(e.$slots, "error", { error: h(M) }, () => [
|
|
1735
|
+
N("解析失败:" + E(h(M)), 1)
|
|
1756
1736
|
], !0)
|
|
1757
|
-
])) :
|
|
1737
|
+
])) : h(k) ? F("", !0) : (v(), c("div", cs, [
|
|
1758
1738
|
ee(e.$slots, "empty", {}, () => [
|
|
1759
|
-
l[
|
|
1739
|
+
l[16] || (l[16] = N("拖入或选择一个 .xlsx 文件", -1))
|
|
1760
1740
|
], !0)
|
|
1761
1741
|
]))
|
|
1762
1742
|
], 512),
|
|
1763
|
-
|
|
1743
|
+
h(k) ? (v(), c("div", fs, [
|
|
1764
1744
|
ee(e.$slots, "statusbar", {
|
|
1765
1745
|
stats: W.value,
|
|
1766
1746
|
range: yt.value || Qe.value
|
|
1767
1747
|
}, () => [
|
|
1768
|
-
n("span",
|
|
1769
|
-
l[
|
|
1770
|
-
W.value && W.value.numCount > 0 ? (
|
|
1748
|
+
n("span", ms, E(yt.value || Qe.value), 1),
|
|
1749
|
+
l[17] || (l[17] = n("div", { class: "grow" }, null, -1)),
|
|
1750
|
+
W.value && W.value.numCount > 0 ? (v(), c(U, { key: 0 }, [
|
|
1771
1751
|
n("span", null, "计数 " + E(W.value.count), 1),
|
|
1772
1752
|
n("span", null, "求和 " + E(ze(W.value.sum)), 1),
|
|
1773
1753
|
n("span", null, "平均 " + E(ze(W.value.avg)), 1),
|
|
1774
1754
|
n("span", null, "最大 " + E(ze(W.value.max)), 1),
|
|
1775
1755
|
n("span", null, "最小 " + E(ze(W.value.min)), 1)
|
|
1776
|
-
], 64)) : W.value && W.value.count > 0 ? (
|
|
1756
|
+
], 64)) : W.value && W.value.count > 0 ? (v(), c("span", ps, "计数 " + E(W.value.count), 1)) : F("", !0)
|
|
1777
1757
|
], !0)
|
|
1778
|
-
])) :
|
|
1779
|
-
|
|
1758
|
+
])) : F("", !0),
|
|
1759
|
+
h(k) ? (v(), ie(Ol, {
|
|
1780
1760
|
key: 4,
|
|
1781
|
-
workbook:
|
|
1782
|
-
active:
|
|
1783
|
-
onSelect: l[
|
|
1784
|
-
}, null, 8, ["workbook", "active"])) :
|
|
1785
|
-
|
|
1761
|
+
workbook: h(k),
|
|
1762
|
+
active: q.value,
|
|
1763
|
+
onSelect: l[13] || (l[13] = (s) => q.value = s)
|
|
1764
|
+
}, null, 8, ["workbook", "active"])) : F("", !0),
|
|
1765
|
+
Te.value && h(k) ? (v(), ie(an, {
|
|
1786
1766
|
key: 5,
|
|
1787
|
-
selection:
|
|
1788
|
-
"sheet-count":
|
|
1789
|
-
onClose: l[
|
|
1790
|
-
onExport:
|
|
1791
|
-
}, null, 8, ["selection", "sheet-count"])) :
|
|
1767
|
+
selection: Y.value,
|
|
1768
|
+
"sheet-count": h(k).sheets.filter((s) => s.state === "visible").length,
|
|
1769
|
+
onClose: l[14] || (l[14] = (s) => Te.value = !1),
|
|
1770
|
+
onExport: il
|
|
1771
|
+
}, null, 8, ["selection", "sheet-count"])) : F("", !0),
|
|
1792
1772
|
n("input", {
|
|
1793
1773
|
ref_key: "templateInputEl",
|
|
1794
|
-
ref:
|
|
1774
|
+
ref: pt,
|
|
1795
1775
|
type: "file",
|
|
1796
1776
|
accept: ".xlsx,.xlsm",
|
|
1797
1777
|
hidden: "",
|
|
1798
|
-
onChange:
|
|
1778
|
+
onChange: Lt
|
|
1799
1779
|
}, null, 544),
|
|
1800
1780
|
d.exportProgress !== !1 ? ee(e.$slots, "export-progress", {
|
|
1801
1781
|
key: 6,
|
|
1802
|
-
state:
|
|
1803
|
-
busy:
|
|
1804
|
-
cancel:
|
|
1782
|
+
state: Ce.value,
|
|
1783
|
+
busy: Le.value,
|
|
1784
|
+
cancel: wt
|
|
1805
1785
|
}, () => [
|
|
1806
|
-
|
|
1807
|
-
state:
|
|
1808
|
-
busy:
|
|
1809
|
-
onCancel:
|
|
1786
|
+
vt(Yn, {
|
|
1787
|
+
state: Ce.value,
|
|
1788
|
+
busy: Le.value,
|
|
1789
|
+
onCancel: wt
|
|
1810
1790
|
}, null, 8, ["state", "busy"])
|
|
1811
|
-
], !0) :
|
|
1791
|
+
], !0) : F("", !0)
|
|
1812
1792
|
], 544));
|
|
1813
1793
|
}
|
|
1814
|
-
}),
|
|
1794
|
+
}), bs = /* @__PURE__ */ Z(gs, [["__scopeId", "data-v-80983538"]]), xs = {
|
|
1815
1795
|
install(d) {
|
|
1816
|
-
d.component("ExcelViewer",
|
|
1796
|
+
d.component("ExcelViewer", bs);
|
|
1817
1797
|
}
|
|
1818
1798
|
};
|
|
1819
1799
|
export {
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1800
|
+
$s as DEFAULT_THEME,
|
|
1801
|
+
bs as ExcelViewer,
|
|
1802
|
+
Ss as canvasToBlob,
|
|
1803
|
+
Es as canvasToDataURL,
|
|
1804
|
+
Ts as cellDisplayText,
|
|
1805
|
+
Fs as cellKey,
|
|
1806
|
+
xs as default,
|
|
1807
|
+
Ns as definePlugin,
|
|
1808
|
+
Is as downloadBlob,
|
|
1809
|
+
Ms as formatValue,
|
|
1810
|
+
Rs as getCell,
|
|
1811
|
+
Ps as getCellStyle,
|
|
1812
|
+
Cl as getCellText,
|
|
1813
|
+
xl as getCellValue,
|
|
1814
|
+
bl as getRangeData,
|
|
1815
|
+
kl as getSheetData,
|
|
1816
|
+
Ds as getWorkbookJSON,
|
|
1817
|
+
Rt as loadArrayBuffer,
|
|
1818
|
+
As as mergeTheme,
|
|
1819
|
+
zs as parseWorkbook,
|
|
1820
|
+
yl as sheetToJSON
|
|
1841
1821
|
};
|