ooxml-excel-editor 1.3.3 → 1.11.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 +283 -0
- package/README.md +52 -11
- package/dist/chunks/index-CeTZbV_m.js +13673 -0
- package/dist/chunks/{index.es-D9BGYyEt.js → index.es-CNm6wZK8.js} +1 -1
- package/dist/chunks/{index.es-n6H_ncuE.js → index.es-DF0q70BO.js} +1 -1
- package/dist/chunks/{jspdf.es.min-B6-ocR7J.js → jspdf.es.min-65KuNx_3.js} +2 -2
- package/dist/chunks/{jspdf.es.min-Dbn0akWf.js → jspdf.es.min-Bo8KrqZO.js} +2 -2
- package/dist/chunks/plugin-overlay-C_fL02Qc.js +12128 -0
- package/dist/chunks/{toolbar-icons-fOm95ASq.js → toolbar-icons-BjwdJDiN.js} +60 -65
- package/dist/components/ExcelViewer.vue.d.ts +46 -1
- package/dist/components/FindBar.vue.d.ts +8 -0
- package/dist/core/edit/autofill.d.ts +10 -0
- package/dist/core/edit/clipboard-html.d.ts +12 -0
- package/dist/core/edit/clipboard-snapshot.d.ts +76 -0
- package/dist/core/edit/commands.d.ts +9 -1
- package/dist/core/edit/context-menu.d.ts +14 -1
- package/dist/core/edit/data-validation.d.ts +15 -0
- package/dist/core/edit/edit-controller.d.ts +33 -2
- package/dist/core/edit/editor-context.d.ts +5 -2
- package/dist/core/edit/paste-behavior.d.ts +33 -0
- package/dist/core/edit/types.d.ts +26 -0
- package/dist/core/export/exporter.d.ts +2 -0
- package/dist/core/export/pivot-tables.d.ts +17 -0
- package/dist/core/export/xlsx-writer.d.ts +6 -0
- package/dist/core/index.d.ts +4 -2
- package/dist/core/model/mutations.d.ts +4 -0
- package/dist/core/model/types.d.ts +113 -2
- package/dist/core/parser/pivot-parser.d.ts +3 -0
- package/dist/core/plugin.d.ts +69 -5
- package/dist/core/render/canvas-renderer.d.ts +28 -0
- package/dist/core/render/pivot-toggle.d.ts +13 -0
- package/dist/core/viewer/comment-dialog-host.d.ts +16 -0
- package/dist/core/viewer/conditional-format-dialog-host.d.ts +30 -0
- package/dist/core/viewer/controller.d.ts +140 -8
- package/dist/core/viewer/number-format-dialog-host.d.ts +25 -0
- package/dist/core/viewer/overlay-manager.d.ts +1 -0
- package/dist/core/viewer/paste-config-host.d.ts +12 -0
- package/dist/core/viewer/pivot-dialog-host.d.ts +48 -0
- package/dist/core/viewer/readonly-prompt-host.d.ts +23 -0
- package/dist/core/viewer/validation-prompt-host.d.ts +25 -0
- package/dist/core.js +67 -64
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1110 -925
- package/dist/react/ExcelViewer.d.ts +41 -4
- package/dist/react.js +835 -628
- package/dist/style.css +1 -1
- package/dist/vue2.css +1 -1
- package/dist/vue2.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/index-6q8kSGQg.js +0 -10575
- package/dist/chunks/plugin-overlay-BUrPrpT2.js +0 -9146
package/dist/index.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
var yl = Object.defineProperty, kl = Object.defineProperties;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var f in
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var f of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
import { ref as
|
|
14
|
-
import { r as bt, l as Nt, d as Vt, f as
|
|
15
|
-
import {
|
|
16
|
-
import { p as
|
|
17
|
-
import { definePlugin as
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
async function
|
|
21
|
-
var
|
|
22
|
-
|
|
2
|
+
var xl = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var Dt = Object.getOwnPropertySymbols;
|
|
4
|
+
var wl = Object.prototype.hasOwnProperty, hl = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var At = (u, C, f) => C in u ? yl(u, C, { enumerable: !0, configurable: !0, writable: !0, value: f }) : u[C] = f, W = (u, C) => {
|
|
6
|
+
for (var f in C || (C = {}))
|
|
7
|
+
wl.call(C, f) && At(u, f, C[f]);
|
|
8
|
+
if (Dt)
|
|
9
|
+
for (var f of Dt(C))
|
|
10
|
+
hl.call(C, f) && At(u, f, C[f]);
|
|
11
|
+
return u;
|
|
12
|
+
}, ge = (u, C) => kl(u, xl(C));
|
|
13
|
+
import { ref as k, shallowRef as gt, defineComponent as ee, onBeforeUnmount as qe, openBlock as r, createElementBlock as c, createElementVNode as s, createTextVNode as N, toDisplayString as I, createCommentVNode as R, withModifiers as Je, Fragment as _, renderList as ye, computed as M, normalizeClass as H, reactive as Lt, withDirectives as O, vModelRadio as ze, vModelSelect as ft, vModelCheckbox as mt, onMounted as je, normalizeStyle as Ke, vModelText as $l, unref as $, nextTick as be, watch as B, createBlock as ve, Teleport as Sl, renderSlot as se, createVNode as pt } from "vue";
|
|
14
|
+
import { r as bt, l as Nt, d as Vt, f as Wt, a as El, h as Ce, V as Tl, P as Fl, D as Il, g as Ml, s as Rl, b as Pl, c as Dl, e as Al } from "./chunks/plugin-overlay-C_fL02Qc.js";
|
|
15
|
+
import { j as Us, k as Ks, n as qs, o as Js, i as js, q as _s, t as Zs, u as Gs, v as Xs, w as Qs, x as Ys, p as ea } from "./chunks/plugin-overlay-C_fL02Qc.js";
|
|
16
|
+
import { p as Ot, s as Be, T as Ue, a as zl, i as Bl, j as Ll } from "./chunks/toolbar-icons-BjwdJDiN.js";
|
|
17
|
+
import { definePlugin as la } from "./core.js";
|
|
18
|
+
function Nl() {
|
|
19
|
+
const u = k(!1), C = k(null), f = gt(null), o = k(null), y = gt(null);
|
|
20
|
+
async function b(m, v) {
|
|
21
|
+
var i;
|
|
22
|
+
u.value = !0, C.value = null, f.value && bt(f.value), f.value = null, y.value = null, o.value = { stage: "read", ratio: 0 };
|
|
23
23
|
try {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
}),
|
|
27
|
-
if (
|
|
28
|
-
if (
|
|
29
|
-
if (
|
|
30
|
-
let z = await
|
|
31
|
-
|
|
24
|
+
const d = await Nt(m, (D, F) => {
|
|
25
|
+
o.value = { stage: "read", ratio: F ? D / F : void 0 };
|
|
26
|
+
}), P = Vt(d);
|
|
27
|
+
if (P === "xls") throw new Error("这是旧版 .xls(BIFF) 或加密文件,本预览器只支持 .xlsx/.xlsm。");
|
|
28
|
+
if (P === "not-zip") throw new Error("文件不是有效的 .xlsx(非 ZIP 包)。");
|
|
29
|
+
if (P === "empty") throw new Error("文件为空。");
|
|
30
|
+
let z = await Ot(d, (D) => {
|
|
31
|
+
o.value = D;
|
|
32
32
|
});
|
|
33
|
-
|
|
34
|
-
} catch (
|
|
35
|
-
|
|
33
|
+
v && (z = (i = v(z)) != null ? i : z), Wt(z), y.value = d.slice(0), f.value = z;
|
|
34
|
+
} catch (d) {
|
|
35
|
+
C.value = d != null && d.message && /预览器|损坏|加密|为空|ZIP/.test(d.message) ? d.message : El(d), console.error("[ooxml-preview] 解析失败:", d);
|
|
36
36
|
} finally {
|
|
37
|
-
|
|
37
|
+
u.value = !1, o.value = null;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
var
|
|
42
|
-
f.value && bt(f.value), y.value = null,
|
|
40
|
+
function g(m, v) {
|
|
41
|
+
var i;
|
|
42
|
+
f.value && bt(f.value), y.value = null, C.value = null, o.value = null, f.value = v && (i = v(m)) != null ? i : m;
|
|
43
43
|
}
|
|
44
|
-
return { loading:
|
|
44
|
+
return { loading: u, error: C, workbook: f, load: b, loadModel: g, progress: o, sourceBuffer: y };
|
|
45
45
|
}
|
|
46
|
-
const
|
|
46
|
+
const Vl = { class: "toolbar" }, Wl = ["title"], Ol = {
|
|
47
47
|
key: 0,
|
|
48
48
|
class: "tpl"
|
|
49
|
-
},
|
|
49
|
+
}, Hl = { class: "meta" }, Ul = { class: "export-wrap" }, Kl = {
|
|
50
50
|
key: 0,
|
|
51
51
|
class: "menu"
|
|
52
|
-
},
|
|
52
|
+
}, ql = { class: "zoom" }, Jl = ["value"], jl = ["value"], _l = ["value"], Zl = /* @__PURE__ */ ee({
|
|
53
53
|
__name: "ViewerToolbar",
|
|
54
54
|
props: {
|
|
55
55
|
fileName: {},
|
|
@@ -58,135 +58,135 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
58
58
|
zoom: {}
|
|
59
59
|
},
|
|
60
60
|
emits: ["update:zoom", "export-image", "export-pdf", "export-pdf-vector", "print", "open-settings"],
|
|
61
|
-
setup(
|
|
62
|
-
const f =
|
|
63
|
-
function y(
|
|
64
|
-
f("update:zoom", Math.min(3, Math.max(0.3,
|
|
61
|
+
setup(u, { emit: C }) {
|
|
62
|
+
const f = C, o = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
63
|
+
function y(i) {
|
|
64
|
+
f("update:zoom", Math.min(3, Math.max(0.3, i)));
|
|
65
65
|
}
|
|
66
|
-
const
|
|
67
|
-
function
|
|
68
|
-
|
|
66
|
+
const b = k(!1);
|
|
67
|
+
function g() {
|
|
68
|
+
b.value = !b.value;
|
|
69
69
|
}
|
|
70
|
-
function m(
|
|
71
|
-
|
|
70
|
+
function m(i) {
|
|
71
|
+
b.value = !1, f(i === "export-image" ? "export-image" : i === "export-pdf" ? "export-pdf" : i === "export-pdf-vector" ? "export-pdf-vector" : i === "print" ? "print" : "open-settings");
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
var
|
|
75
|
-
(
|
|
73
|
+
function v(i) {
|
|
74
|
+
var d;
|
|
75
|
+
(d = i.target) != null && d.closest(".export-wrap") || (b.value = !1);
|
|
76
76
|
}
|
|
77
|
-
return typeof document != "undefined" && document.addEventListener("click",
|
|
78
|
-
typeof document != "undefined" && document.removeEventListener("click",
|
|
79
|
-
}), (
|
|
77
|
+
return typeof document != "undefined" && document.addEventListener("click", v), qe(() => {
|
|
78
|
+
typeof document != "undefined" && document.removeEventListener("click", v);
|
|
79
|
+
}), (i, d) => (r(), c("div", Vl, [
|
|
80
80
|
s("span", {
|
|
81
81
|
class: "file",
|
|
82
|
-
title: (
|
|
82
|
+
title: (u.fileName || "未命名工作簿") + (u.templateName ? " · 模板: " + u.templateName : "")
|
|
83
83
|
}, [
|
|
84
|
-
N(
|
|
85
|
-
|
|
86
|
-
], 8,
|
|
87
|
-
s("span",
|
|
88
|
-
|
|
89
|
-
s("div",
|
|
84
|
+
N(I(u.fileName || "未命名工作簿"), 1),
|
|
85
|
+
u.templateName ? (r(), c("span", Ol, " · 模板: " + I(u.templateName), 1)) : R("", !0)
|
|
86
|
+
], 8, Wl),
|
|
87
|
+
s("span", Hl, I(u.sheetCount) + " 个工作表", 1),
|
|
88
|
+
d[10] || (d[10] = s("div", { class: "spacer" }, null, -1)),
|
|
89
|
+
s("div", Ul, [
|
|
90
90
|
s("button", {
|
|
91
91
|
class: "export-btn",
|
|
92
|
-
onClick:
|
|
92
|
+
onClick: Je(g, ["stop"]),
|
|
93
93
|
title: "导出 / 打印"
|
|
94
|
-
}, [...
|
|
94
|
+
}, [...d[8] || (d[8] = [
|
|
95
95
|
N(" 导出 ", -1),
|
|
96
96
|
s("span", { class: "caret" }, "▾", -1)
|
|
97
97
|
])]),
|
|
98
|
-
|
|
98
|
+
b.value ? (r(), c("div", Kl, [
|
|
99
99
|
s("button", {
|
|
100
|
-
onClick:
|
|
100
|
+
onClick: d[0] || (d[0] = (P) => m("export-image"))
|
|
101
101
|
}, "导出为图片 (PNG)"),
|
|
102
102
|
s("button", {
|
|
103
|
-
onClick:
|
|
103
|
+
onClick: d[1] || (d[1] = (P) => m("export-pdf"))
|
|
104
104
|
}, "导出为 PDF (位图)"),
|
|
105
105
|
s("button", {
|
|
106
|
-
onClick:
|
|
106
|
+
onClick: d[2] || (d[2] = (P) => m("export-pdf-vector"))
|
|
107
107
|
}, "导出为 PDF (矢量·文字可选)"),
|
|
108
108
|
s("button", {
|
|
109
|
-
onClick:
|
|
109
|
+
onClick: d[3] || (d[3] = (P) => m("print"))
|
|
110
110
|
}, "打印…"),
|
|
111
|
-
|
|
111
|
+
d[9] || (d[9] = s("div", { class: "sep" }, null, -1)),
|
|
112
112
|
s("button", {
|
|
113
|
-
onClick:
|
|
113
|
+
onClick: d[4] || (d[4] = (P) => m("open-settings"))
|
|
114
114
|
}, "导出设置…")
|
|
115
|
-
])) :
|
|
115
|
+
])) : R("", !0)
|
|
116
116
|
]),
|
|
117
|
-
s("div",
|
|
117
|
+
s("div", ql, [
|
|
118
118
|
s("button", {
|
|
119
|
-
onClick:
|
|
119
|
+
onClick: d[5] || (d[5] = (P) => y(u.zoom - 0.1)),
|
|
120
120
|
title: "缩小"
|
|
121
121
|
}, "−"),
|
|
122
122
|
s("select", {
|
|
123
|
-
value:
|
|
124
|
-
onChange:
|
|
123
|
+
value: u.zoom,
|
|
124
|
+
onChange: d[6] || (d[6] = (P) => y(parseFloat(P.target.value)))
|
|
125
125
|
}, [
|
|
126
|
-
(
|
|
127
|
-
key:
|
|
128
|
-
value:
|
|
129
|
-
},
|
|
130
|
-
|
|
126
|
+
(r(), c(_, null, ye(o, (P) => s("option", {
|
|
127
|
+
key: P,
|
|
128
|
+
value: P
|
|
129
|
+
}, I(Math.round(P * 100)) + "%", 9, jl)), 64)),
|
|
130
|
+
o.includes(u.zoom) ? R("", !0) : (r(), c("option", {
|
|
131
131
|
key: 0,
|
|
132
|
-
value:
|
|
133
|
-
},
|
|
134
|
-
], 40,
|
|
132
|
+
value: u.zoom
|
|
133
|
+
}, I(Math.round(u.zoom * 100)) + "%", 9, _l))
|
|
134
|
+
], 40, Jl),
|
|
135
135
|
s("button", {
|
|
136
|
-
onClick:
|
|
136
|
+
onClick: d[7] || (d[7] = (P) => y(u.zoom + 0.1)),
|
|
137
137
|
title: "放大"
|
|
138
138
|
}, "+")
|
|
139
139
|
])
|
|
140
140
|
]));
|
|
141
141
|
}
|
|
142
|
-
}),
|
|
143
|
-
const f =
|
|
144
|
-
for (const [
|
|
145
|
-
f[
|
|
142
|
+
}), te = (u, C) => {
|
|
143
|
+
const f = u.__vccOpts || u;
|
|
144
|
+
for (const [o, y] of C)
|
|
145
|
+
f[o] = y;
|
|
146
146
|
return f;
|
|
147
|
-
},
|
|
147
|
+
}, Gl = /* @__PURE__ */ te(Zl, [["__scopeId", "data-v-eafc1f94"]]), Xl = { class: "sheet-tabs" }, Ql = ["onClick", "title"], Yl = /* @__PURE__ */ ee({
|
|
148
148
|
__name: "SheetTabs",
|
|
149
149
|
props: {
|
|
150
150
|
workbook: {},
|
|
151
151
|
active: {}
|
|
152
152
|
},
|
|
153
153
|
emits: ["select"],
|
|
154
|
-
setup(
|
|
155
|
-
const f =
|
|
156
|
-
return (
|
|
157
|
-
(
|
|
154
|
+
setup(u, { emit: C }) {
|
|
155
|
+
const f = u, o = C, y = M(() => f.workbook.sheets.filter((b) => b.state === "visible"));
|
|
156
|
+
return (b, g) => (r(), c("div", Xl, [
|
|
157
|
+
(r(!0), c(_, null, ye(y.value, (m) => (r(), c("button", {
|
|
158
158
|
key: m.index,
|
|
159
|
-
class:
|
|
160
|
-
onClick: (
|
|
159
|
+
class: H(["tab", { active: m.index === u.active }]),
|
|
160
|
+
onClick: (v) => o("select", m.index),
|
|
161
161
|
title: m.name
|
|
162
|
-
},
|
|
162
|
+
}, I(m.name), 11, Ql))), 128))
|
|
163
163
|
]));
|
|
164
164
|
}
|
|
165
|
-
}),
|
|
165
|
+
}), en = /* @__PURE__ */ te(Yl, [["__scopeId", "data-v-431b6f9c"]]), tn = {
|
|
166
166
|
class: "dlg",
|
|
167
167
|
role: "dialog",
|
|
168
168
|
"aria-label": "导出设置"
|
|
169
|
-
},
|
|
169
|
+
}, ln = { class: "dlg-head" }, nn = { class: "dlg-body" }, sn = { class: "field" }, an = { class: "opts" }, on = ["disabled"], un = {
|
|
170
170
|
key: 0,
|
|
171
171
|
class: "hint"
|
|
172
|
-
},
|
|
172
|
+
}, dn = {
|
|
173
173
|
key: 1,
|
|
174
174
|
class: "hint"
|
|
175
|
-
},
|
|
175
|
+
}, rn = { class: "field" }, vn = { class: "field" }, cn = { class: "opts inline" }, fn = { class: "field" }, mn = { class: "opts" }, pn = { class: "field" }, gn = { class: "opts inline" }, bn = { class: "dlg-foot" }, Cn = /* @__PURE__ */ ee({
|
|
176
176
|
__name: "ExportDialog",
|
|
177
177
|
props: {
|
|
178
178
|
selection: {},
|
|
179
179
|
sheetCount: {}
|
|
180
180
|
},
|
|
181
181
|
emits: ["close", "export"],
|
|
182
|
-
setup(
|
|
183
|
-
const f =
|
|
184
|
-
const
|
|
185
|
-
return !!
|
|
186
|
-
}),
|
|
187
|
-
const
|
|
188
|
-
return
|
|
189
|
-
}),
|
|
182
|
+
setup(u, { emit: C }) {
|
|
183
|
+
const f = u, o = C, y = M(() => {
|
|
184
|
+
const v = f.selection;
|
|
185
|
+
return !!v && !(v.top === v.bottom && v.left === v.right);
|
|
186
|
+
}), b = M(() => {
|
|
187
|
+
const v = f.selection;
|
|
188
|
+
return v ? `${Ce(v.left)}${v.top + 1}:${Ce(v.right)}${v.bottom + 1}` : "";
|
|
189
|
+
}), g = Lt({
|
|
190
190
|
action: "png",
|
|
191
191
|
scope: y.value ? "selection" : "sheet",
|
|
192
192
|
scale: 2,
|
|
@@ -197,260 +197,292 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
197
197
|
fitToWidth: !0,
|
|
198
198
|
pdfVector: !1
|
|
199
199
|
});
|
|
200
|
-
function m(
|
|
201
|
-
|
|
200
|
+
function m(v) {
|
|
201
|
+
o("export", ge(W({}, g), { action: v }));
|
|
202
202
|
}
|
|
203
|
-
return (
|
|
203
|
+
return (v, i) => (r(), c("div", {
|
|
204
204
|
class: "dlg-mask",
|
|
205
|
-
onClick:
|
|
205
|
+
onClick: i[16] || (i[16] = Je((d) => o("close"), ["self"]))
|
|
206
206
|
}, [
|
|
207
|
-
s("div",
|
|
208
|
-
s("div",
|
|
209
|
-
|
|
207
|
+
s("div", tn, [
|
|
208
|
+
s("div", ln, [
|
|
209
|
+
i[17] || (i[17] = s("span", null, "导出 / 打印设置", -1)),
|
|
210
210
|
s("button", {
|
|
211
211
|
class: "x",
|
|
212
|
-
onClick:
|
|
212
|
+
onClick: i[0] || (i[0] = (d) => o("close")),
|
|
213
213
|
title: "关闭"
|
|
214
214
|
}, "×")
|
|
215
215
|
]),
|
|
216
|
-
s("div",
|
|
217
|
-
s("div",
|
|
218
|
-
|
|
219
|
-
s("div",
|
|
216
|
+
s("div", nn, [
|
|
217
|
+
s("div", sn, [
|
|
218
|
+
i[20] || (i[20] = s("label", { class: "lbl" }, "范围", -1)),
|
|
219
|
+
s("div", an, [
|
|
220
220
|
s("label", {
|
|
221
|
-
class:
|
|
221
|
+
class: H({ disabled: !y.value })
|
|
222
222
|
}, [
|
|
223
|
-
|
|
223
|
+
O(s("input", {
|
|
224
224
|
type: "radio",
|
|
225
225
|
value: "selection",
|
|
226
|
-
"onUpdate:modelValue":
|
|
226
|
+
"onUpdate:modelValue": i[1] || (i[1] = (d) => g.scope = d),
|
|
227
227
|
disabled: !y.value
|
|
228
|
-
}, null, 8,
|
|
229
|
-
[
|
|
228
|
+
}, null, 8, on), [
|
|
229
|
+
[ze, g.scope]
|
|
230
230
|
]),
|
|
231
|
-
|
|
232
|
-
y.value ? (
|
|
231
|
+
i[18] || (i[18] = N(" 当前选区 ", -1)),
|
|
232
|
+
y.value ? (r(), c("span", un, I(b.value), 1)) : (r(), c("span", dn, "(未选多格)"))
|
|
233
233
|
], 2),
|
|
234
234
|
s("label", null, [
|
|
235
|
-
|
|
235
|
+
O(s("input", {
|
|
236
236
|
type: "radio",
|
|
237
237
|
value: "sheet",
|
|
238
|
-
"onUpdate:modelValue":
|
|
238
|
+
"onUpdate:modelValue": i[2] || (i[2] = (d) => g.scope = d)
|
|
239
239
|
}, null, 512), [
|
|
240
|
-
[
|
|
240
|
+
[ze, g.scope]
|
|
241
241
|
]),
|
|
242
|
-
|
|
242
|
+
i[19] || (i[19] = N(" 当前工作表", -1))
|
|
243
243
|
]),
|
|
244
244
|
s("label", null, [
|
|
245
|
-
|
|
245
|
+
O(s("input", {
|
|
246
246
|
type: "radio",
|
|
247
247
|
value: "all",
|
|
248
|
-
"onUpdate:modelValue":
|
|
248
|
+
"onUpdate:modelValue": i[3] || (i[3] = (d) => g.scope = d)
|
|
249
249
|
}, null, 512), [
|
|
250
|
-
[
|
|
250
|
+
[ze, g.scope]
|
|
251
251
|
]),
|
|
252
|
-
N(" 全部工作表 (" +
|
|
252
|
+
N(" 全部工作表 (" + I(u.sheetCount) + ")", 1)
|
|
253
253
|
])
|
|
254
254
|
])
|
|
255
255
|
]),
|
|
256
|
-
s("div",
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
"onUpdate:modelValue":
|
|
260
|
-
}, [...
|
|
256
|
+
s("div", rn, [
|
|
257
|
+
i[22] || (i[22] = s("label", { class: "lbl" }, "清晰度", -1)),
|
|
258
|
+
O(s("select", {
|
|
259
|
+
"onUpdate:modelValue": i[4] || (i[4] = (d) => g.scale = d)
|
|
260
|
+
}, [...i[21] || (i[21] = [
|
|
261
261
|
s("option", { value: 1 }, "标准 (1×)", -1),
|
|
262
262
|
s("option", { value: 2 }, "高清 (2×)", -1),
|
|
263
263
|
s("option", { value: 3 }, "超清 (3×)", -1)
|
|
264
264
|
])], 512), [
|
|
265
265
|
[
|
|
266
266
|
ft,
|
|
267
|
-
|
|
267
|
+
g.scale,
|
|
268
268
|
void 0,
|
|
269
269
|
{ number: !0 }
|
|
270
270
|
]
|
|
271
271
|
])
|
|
272
272
|
]),
|
|
273
|
-
s("div",
|
|
274
|
-
|
|
275
|
-
s("div",
|
|
273
|
+
s("div", vn, [
|
|
274
|
+
i[25] || (i[25] = s("label", { class: "lbl" }, "内容", -1)),
|
|
275
|
+
s("div", cn, [
|
|
276
276
|
s("label", null, [
|
|
277
|
-
|
|
277
|
+
O(s("input", {
|
|
278
278
|
type: "checkbox",
|
|
279
|
-
"onUpdate:modelValue":
|
|
279
|
+
"onUpdate:modelValue": i[5] || (i[5] = (d) => g.includeHeaders = d)
|
|
280
280
|
}, null, 512), [
|
|
281
|
-
[mt,
|
|
281
|
+
[mt, g.includeHeaders]
|
|
282
282
|
]),
|
|
283
|
-
|
|
283
|
+
i[23] || (i[23] = N(" 含行列号", -1))
|
|
284
284
|
]),
|
|
285
285
|
s("label", null, [
|
|
286
|
-
|
|
286
|
+
O(s("input", {
|
|
287
287
|
type: "checkbox",
|
|
288
|
-
"onUpdate:modelValue":
|
|
288
|
+
"onUpdate:modelValue": i[6] || (i[6] = (d) => g.gridlines = d)
|
|
289
289
|
}, null, 512), [
|
|
290
|
-
[mt,
|
|
290
|
+
[mt, g.gridlines]
|
|
291
291
|
]),
|
|
292
|
-
|
|
292
|
+
i[24] || (i[24] = N(" 网格线", -1))
|
|
293
293
|
])
|
|
294
294
|
])
|
|
295
295
|
]),
|
|
296
|
-
s("div",
|
|
297
|
-
|
|
298
|
-
s("div",
|
|
296
|
+
s("div", fn, [
|
|
297
|
+
i[30] || (i[30] = s("label", { class: "lbl" }, "PDF 类型", -1)),
|
|
298
|
+
s("div", mn, [
|
|
299
299
|
s("label", null, [
|
|
300
|
-
|
|
300
|
+
O(s("input", {
|
|
301
301
|
type: "radio",
|
|
302
302
|
value: !1,
|
|
303
|
-
"onUpdate:modelValue":
|
|
303
|
+
"onUpdate:modelValue": i[7] || (i[7] = (d) => g.pdfVector = d)
|
|
304
304
|
}, null, 512), [
|
|
305
|
-
[
|
|
305
|
+
[ze, g.pdfVector]
|
|
306
306
|
]),
|
|
307
|
-
|
|
308
|
-
|
|
307
|
+
i[26] || (i[26] = N(" 位图 ", -1)),
|
|
308
|
+
i[27] || (i[27] = s("span", { class: "hint" }, "(完整还原观感)", -1))
|
|
309
309
|
]),
|
|
310
310
|
s("label", null, [
|
|
311
|
-
|
|
311
|
+
O(s("input", {
|
|
312
312
|
type: "radio",
|
|
313
313
|
value: !0,
|
|
314
|
-
"onUpdate:modelValue":
|
|
314
|
+
"onUpdate:modelValue": i[8] || (i[8] = (d) => g.pdfVector = d)
|
|
315
315
|
}, null, 512), [
|
|
316
|
-
[
|
|
316
|
+
[ze, g.pdfVector]
|
|
317
317
|
]),
|
|
318
|
-
|
|
319
|
-
|
|
318
|
+
i[28] || (i[28] = N(" 矢量 ", -1)),
|
|
319
|
+
i[29] || (i[29] = s("span", { class: "hint" }, "(文字可选可搜·清晰·文件小;中文需注册字体,否则该格转图)", -1))
|
|
320
320
|
])
|
|
321
321
|
])
|
|
322
322
|
]),
|
|
323
|
-
s("div",
|
|
324
|
-
|
|
323
|
+
s("div", pn, [
|
|
324
|
+
i[34] || (i[34] = s("label", { class: "lbl" }, [
|
|
325
325
|
N("纸张 "),
|
|
326
326
|
s("span", { class: "hint" }, "(PDF/打印)")
|
|
327
327
|
], -1)),
|
|
328
|
-
s("div",
|
|
329
|
-
|
|
330
|
-
"onUpdate:modelValue":
|
|
331
|
-
}, [...
|
|
328
|
+
s("div", gn, [
|
|
329
|
+
O(s("select", {
|
|
330
|
+
"onUpdate:modelValue": i[9] || (i[9] = (d) => g.format = d)
|
|
331
|
+
}, [...i[31] || (i[31] = [
|
|
332
332
|
s("option", { value: "auto" }, "自动(跟随表)", -1),
|
|
333
333
|
s("option", { value: "a4" }, "A4", -1),
|
|
334
334
|
s("option", { value: "a3" }, "A3", -1),
|
|
335
335
|
s("option", { value: "letter" }, "Letter", -1)
|
|
336
336
|
])], 512), [
|
|
337
|
-
[ft,
|
|
337
|
+
[ft, g.format]
|
|
338
338
|
]),
|
|
339
|
-
|
|
340
|
-
"onUpdate:modelValue":
|
|
341
|
-
}, [...
|
|
339
|
+
O(s("select", {
|
|
340
|
+
"onUpdate:modelValue": i[10] || (i[10] = (d) => g.orientation = d)
|
|
341
|
+
}, [...i[32] || (i[32] = [
|
|
342
342
|
s("option", { value: "auto" }, "方向: 自动", -1),
|
|
343
343
|
s("option", { value: "portrait" }, "纵向", -1),
|
|
344
344
|
s("option", { value: "landscape" }, "横向", -1)
|
|
345
345
|
])], 512), [
|
|
346
|
-
[ft,
|
|
346
|
+
[ft, g.orientation]
|
|
347
347
|
]),
|
|
348
348
|
s("label", null, [
|
|
349
|
-
|
|
349
|
+
O(s("input", {
|
|
350
350
|
type: "checkbox",
|
|
351
|
-
"onUpdate:modelValue":
|
|
351
|
+
"onUpdate:modelValue": i[11] || (i[11] = (d) => g.fitToWidth = d)
|
|
352
352
|
}, null, 512), [
|
|
353
|
-
[mt,
|
|
353
|
+
[mt, g.fitToWidth]
|
|
354
354
|
]),
|
|
355
|
-
|
|
355
|
+
i[33] || (i[33] = N(" 适应页宽", -1))
|
|
356
356
|
])
|
|
357
357
|
])
|
|
358
358
|
])
|
|
359
359
|
]),
|
|
360
|
-
s("div",
|
|
360
|
+
s("div", bn, [
|
|
361
361
|
s("button", {
|
|
362
362
|
class: "ghost",
|
|
363
|
-
onClick:
|
|
363
|
+
onClick: i[12] || (i[12] = (d) => o("close"))
|
|
364
364
|
}, "取消"),
|
|
365
|
-
|
|
365
|
+
i[35] || (i[35] = s("div", { class: "grow" }, null, -1)),
|
|
366
366
|
s("button", {
|
|
367
|
-
onClick:
|
|
367
|
+
onClick: i[13] || (i[13] = (d) => m("png"))
|
|
368
368
|
}, "导出 PNG"),
|
|
369
369
|
s("button", {
|
|
370
|
-
onClick:
|
|
370
|
+
onClick: i[14] || (i[14] = (d) => m("pdf"))
|
|
371
371
|
}, "导出 PDF"),
|
|
372
372
|
s("button", {
|
|
373
373
|
class: "primary",
|
|
374
|
-
onClick:
|
|
374
|
+
onClick: i[15] || (i[15] = (d) => m("print"))
|
|
375
375
|
}, "打印…")
|
|
376
376
|
])
|
|
377
377
|
])
|
|
378
378
|
]));
|
|
379
379
|
}
|
|
380
|
-
}),
|
|
380
|
+
}), yn = /* @__PURE__ */ te(Cn, [["__scopeId", "data-v-544df24f"]]), kn = { class: "row" }, xn = ["value"], wn = ["disabled"], hn = ["disabled"], $n = {
|
|
381
|
+
key: 0,
|
|
382
|
+
class: "row replace-row"
|
|
383
|
+
}, Sn = ["value"], En = ["disabled"], Tn = ["disabled"], Fn = /* @__PURE__ */ ee({
|
|
381
384
|
__name: "FindBar",
|
|
382
385
|
props: {
|
|
383
386
|
query: {},
|
|
384
387
|
matchCount: {},
|
|
385
388
|
current: {},
|
|
386
389
|
matchCase: { type: Boolean },
|
|
387
|
-
wholeCell: { type: Boolean }
|
|
390
|
+
wholeCell: { type: Boolean },
|
|
391
|
+
editable: { type: Boolean },
|
|
392
|
+
replace: {}
|
|
388
393
|
},
|
|
389
|
-
emits: ["update:query", "update:matchCase", "update:wholeCell", "next", "prev", "close"],
|
|
390
|
-
setup(
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
var d;
|
|
394
|
-
return (d = y.value) == null ? void 0 : d.focus();
|
|
395
|
-
});
|
|
396
|
-
function g(d) {
|
|
394
|
+
emits: ["update:query", "update:matchCase", "update:wholeCell", "update:replace", "next", "prev", "replace-one", "replace-all", "close"],
|
|
395
|
+
setup(u, { expose: C, emit: f }) {
|
|
396
|
+
const o = f, y = k(null);
|
|
397
|
+
je(() => {
|
|
397
398
|
var m;
|
|
398
|
-
|
|
399
|
+
return (m = y.value) == null ? void 0 : m.focus();
|
|
400
|
+
});
|
|
401
|
+
function b(m) {
|
|
402
|
+
var v;
|
|
403
|
+
(m.ctrlKey || m.metaKey) && (m.key === "f" || m.key === "F") ? (m.preventDefault(), (v = y.value) == null || v.select()) : m.key === "Enter" ? (m.preventDefault(), m.shiftKey ? o("prev") : o("next")) : m.key === "Escape" && (m.preventDefault(), o("close"));
|
|
399
404
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
405
|
+
function g(m) {
|
|
406
|
+
m.key === "Enter" ? (m.preventDefault(), o("replace-one")) : m.key === "Escape" && (m.preventDefault(), o("close"));
|
|
407
|
+
}
|
|
408
|
+
return C({ focus: () => {
|
|
409
|
+
var m;
|
|
410
|
+
return (m = y.value) == null ? void 0 : m.focus();
|
|
411
|
+
} }), (m, v) => (r(), c("div", {
|
|
404
412
|
class: "find-bar",
|
|
405
|
-
onKeydown:
|
|
413
|
+
onKeydown: v[9] || (v[9] = Je(() => {
|
|
406
414
|
}, ["stop"]))
|
|
407
415
|
}, [
|
|
408
|
-
s("
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
416
|
+
s("div", kn, [
|
|
417
|
+
s("input", {
|
|
418
|
+
ref_key: "inputEl",
|
|
419
|
+
ref: y,
|
|
420
|
+
class: "q",
|
|
421
|
+
type: "text",
|
|
422
|
+
placeholder: "查找…",
|
|
423
|
+
value: u.query,
|
|
424
|
+
onInput: v[0] || (v[0] = (i) => o("update:query", i.target.value)),
|
|
425
|
+
onKeydown: b
|
|
426
|
+
}, null, 40, xn),
|
|
427
|
+
s("span", {
|
|
428
|
+
class: H(["count", { none: u.query && u.matchCount === 0 }])
|
|
429
|
+
}, I(u.matchCount ? `${u.current + 1}/${u.matchCount}` : u.query ? "无结果" : ""), 3),
|
|
430
|
+
s("button", {
|
|
431
|
+
class: H(["opt", { on: u.matchCase }]),
|
|
432
|
+
title: "区分大小写",
|
|
433
|
+
onClick: v[1] || (v[1] = (i) => o("update:matchCase", !u.matchCase))
|
|
434
|
+
}, "Aa", 2),
|
|
435
|
+
s("button", {
|
|
436
|
+
class: H(["opt", { on: u.wholeCell }]),
|
|
437
|
+
title: "全字匹配(整格相等)",
|
|
438
|
+
onClick: v[2] || (v[2] = (i) => o("update:wholeCell", !u.wholeCell))
|
|
439
|
+
}, "▢", 2),
|
|
440
|
+
s("button", {
|
|
441
|
+
class: "nav",
|
|
442
|
+
title: "上一个 (Shift+Enter)",
|
|
443
|
+
disabled: !u.matchCount,
|
|
444
|
+
onClick: v[3] || (v[3] = (i) => o("prev"))
|
|
445
|
+
}, "▲", 8, wn),
|
|
446
|
+
s("button", {
|
|
447
|
+
class: "nav",
|
|
448
|
+
title: "下一个 (Enter)",
|
|
449
|
+
disabled: !u.matchCount,
|
|
450
|
+
onClick: v[4] || (v[4] = (i) => o("next"))
|
|
451
|
+
}, "▼", 8, hn),
|
|
452
|
+
s("button", {
|
|
453
|
+
class: "close",
|
|
454
|
+
title: "关闭 (Esc)",
|
|
455
|
+
onClick: v[5] || (v[5] = (i) => o("close"))
|
|
456
|
+
}, "×")
|
|
457
|
+
]),
|
|
458
|
+
u.editable ? (r(), c("div", $n, [
|
|
459
|
+
s("input", {
|
|
460
|
+
class: "q",
|
|
461
|
+
type: "text",
|
|
462
|
+
placeholder: "替换为…",
|
|
463
|
+
value: u.replace,
|
|
464
|
+
onInput: v[6] || (v[6] = (i) => o("update:replace", i.target.value)),
|
|
465
|
+
onKeydown: g
|
|
466
|
+
}, null, 40, Sn),
|
|
467
|
+
s("button", {
|
|
468
|
+
class: "rep",
|
|
469
|
+
title: "替换当前并查找下一个",
|
|
470
|
+
disabled: !u.matchCount,
|
|
471
|
+
onClick: v[7] || (v[7] = (i) => o("replace-one"))
|
|
472
|
+
}, "替换", 8, En),
|
|
473
|
+
s("button", {
|
|
474
|
+
class: "rep",
|
|
475
|
+
title: "全部替换",
|
|
476
|
+
disabled: !u.matchCount,
|
|
477
|
+
onClick: v[8] || (v[8] = (i) => o("replace-all"))
|
|
478
|
+
}, "全部替换", 8, Tn)
|
|
479
|
+
])) : R("", !0)
|
|
448
480
|
], 32));
|
|
449
481
|
}
|
|
450
|
-
}),
|
|
482
|
+
}), In = /* @__PURE__ */ te(Fn, [["__scopeId", "data-v-7c933ccd"]]), Mn = { class: "sort" }, Rn = { class: "all" }, Pn = ["checked"], Dn = { class: "list" }, An = ["checked", "onChange"], zn = ["title"], Bn = {
|
|
451
483
|
key: 0,
|
|
452
484
|
class: "empty"
|
|
453
|
-
},
|
|
485
|
+
}, Ln = { class: "foot" }, Nn = /* @__PURE__ */ ee({
|
|
454
486
|
__name: "FilterPopup",
|
|
455
487
|
props: {
|
|
456
488
|
values: {},
|
|
@@ -460,217 +492,217 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
460
492
|
sortDir: {}
|
|
461
493
|
},
|
|
462
494
|
emits: ["apply", "clear", "close", "sort"],
|
|
463
|
-
setup(
|
|
464
|
-
const f =
|
|
495
|
+
setup(u, { emit: C }) {
|
|
496
|
+
const f = u, o = C, y = k(""), b = Lt(new Set(f.selected.length ? f.selected : f.values)), g = M(() => {
|
|
465
497
|
const D = y.value.trim().toLowerCase();
|
|
466
|
-
return D ? f.values.filter((
|
|
467
|
-
}), m =
|
|
468
|
-
function
|
|
469
|
-
|
|
498
|
+
return D ? f.values.filter((F) => F.toLowerCase().includes(D)) : f.values;
|
|
499
|
+
}), m = M(() => g.value.length > 0 && g.value.every((D) => b.has(D)));
|
|
500
|
+
function v(D) {
|
|
501
|
+
b.has(D) ? b.delete(D) : b.add(D);
|
|
470
502
|
}
|
|
471
|
-
function
|
|
503
|
+
function i() {
|
|
472
504
|
const D = !m.value;
|
|
473
|
-
for (const
|
|
505
|
+
for (const F of g.value) D ? b.add(F) : b.delete(F);
|
|
474
506
|
}
|
|
475
|
-
function
|
|
476
|
-
|
|
507
|
+
function d() {
|
|
508
|
+
o("apply", [...b]);
|
|
477
509
|
}
|
|
478
|
-
const
|
|
510
|
+
const P = k(null);
|
|
479
511
|
function z(D) {
|
|
480
|
-
|
|
512
|
+
P.value && !P.value.contains(D.target) && o("close");
|
|
481
513
|
}
|
|
482
|
-
return
|
|
514
|
+
return je(() => setTimeout(() => document.addEventListener("mousedown", z), 0)), qe(() => document.removeEventListener("mousedown", z)), (D, F) => (r(), c("div", {
|
|
483
515
|
class: "filter-pop",
|
|
484
516
|
ref_key: "rootEl",
|
|
485
|
-
ref:
|
|
486
|
-
style:
|
|
487
|
-
onKeydown:
|
|
517
|
+
ref: P,
|
|
518
|
+
style: Ke({ left: u.x + "px", top: u.y + "px" }),
|
|
519
|
+
onKeydown: F[5] || (F[5] = Je(() => {
|
|
488
520
|
}, ["stop"]))
|
|
489
521
|
}, [
|
|
490
|
-
s("div",
|
|
522
|
+
s("div", Mn, [
|
|
491
523
|
s("button", {
|
|
492
|
-
class:
|
|
493
|
-
onClick:
|
|
524
|
+
class: H({ on: u.sortDir === "asc" }),
|
|
525
|
+
onClick: F[0] || (F[0] = (x) => o("sort", "asc")),
|
|
494
526
|
title: "升序"
|
|
495
527
|
}, "↑ 升序", 2),
|
|
496
528
|
s("button", {
|
|
497
|
-
class:
|
|
498
|
-
onClick:
|
|
529
|
+
class: H({ on: u.sortDir === "desc" }),
|
|
530
|
+
onClick: F[1] || (F[1] = (x) => o("sort", "desc")),
|
|
499
531
|
title: "降序"
|
|
500
532
|
}, "↓ 降序", 2)
|
|
501
533
|
]),
|
|
502
|
-
|
|
534
|
+
O(s("input", {
|
|
503
535
|
class: "search",
|
|
504
536
|
type: "text",
|
|
505
537
|
placeholder: "搜索…",
|
|
506
|
-
"onUpdate:modelValue":
|
|
538
|
+
"onUpdate:modelValue": F[2] || (F[2] = (x) => y.value = x)
|
|
507
539
|
}, null, 512), [
|
|
508
|
-
[
|
|
540
|
+
[$l, y.value]
|
|
509
541
|
]),
|
|
510
|
-
s("label",
|
|
542
|
+
s("label", Rn, [
|
|
511
543
|
s("input", {
|
|
512
544
|
type: "checkbox",
|
|
513
545
|
checked: m.value,
|
|
514
|
-
onChange:
|
|
515
|
-
}, null, 40,
|
|
516
|
-
|
|
546
|
+
onChange: i
|
|
547
|
+
}, null, 40, Pn),
|
|
548
|
+
F[6] || (F[6] = N(" (全选) ", -1))
|
|
517
549
|
]),
|
|
518
|
-
s("div",
|
|
519
|
-
(
|
|
520
|
-
key:
|
|
550
|
+
s("div", Dn, [
|
|
551
|
+
(r(!0), c(_, null, ye(g.value, (x) => (r(), c("label", {
|
|
552
|
+
key: x,
|
|
521
553
|
class: "row"
|
|
522
554
|
}, [
|
|
523
555
|
s("input", {
|
|
524
556
|
type: "checkbox",
|
|
525
|
-
checked:
|
|
526
|
-
onChange: (
|
|
527
|
-
}, null, 40,
|
|
557
|
+
checked: b.has(x),
|
|
558
|
+
onChange: (Z) => v(x)
|
|
559
|
+
}, null, 40, An),
|
|
528
560
|
s("span", {
|
|
529
561
|
class: "val",
|
|
530
|
-
title:
|
|
531
|
-
},
|
|
562
|
+
title: x
|
|
563
|
+
}, I(x), 9, zn)
|
|
532
564
|
]))), 128)),
|
|
533
|
-
|
|
565
|
+
g.value.length ? R("", !0) : (r(), c("div", Bn, "无匹配值"))
|
|
534
566
|
]),
|
|
535
|
-
s("div",
|
|
567
|
+
s("div", Ln, [
|
|
536
568
|
s("button", {
|
|
537
569
|
class: "link",
|
|
538
|
-
onClick:
|
|
570
|
+
onClick: F[3] || (F[3] = (x) => o("clear"))
|
|
539
571
|
}, "清除筛选"),
|
|
540
|
-
|
|
572
|
+
F[7] || (F[7] = s("div", { class: "grow" }, null, -1)),
|
|
541
573
|
s("button", {
|
|
542
|
-
onClick:
|
|
574
|
+
onClick: F[4] || (F[4] = (x) => o("close"))
|
|
543
575
|
}, "取消"),
|
|
544
576
|
s("button", {
|
|
545
577
|
class: "primary",
|
|
546
|
-
onClick:
|
|
578
|
+
onClick: d
|
|
547
579
|
}, "确定")
|
|
548
580
|
])
|
|
549
581
|
], 36));
|
|
550
582
|
}
|
|
551
|
-
}),
|
|
583
|
+
}), Vn = /* @__PURE__ */ te(Nn, [["__scopeId", "data-v-4b0bc283"]]), Wn = { class: "tb-menu" }, On = {
|
|
552
584
|
key: 0,
|
|
553
585
|
class: "sep"
|
|
554
|
-
},
|
|
586
|
+
}, Hn = ["disabled", "onClick"], Un = ["innerHTML"], Kn = {
|
|
555
587
|
key: 1,
|
|
556
588
|
class: "ic-e"
|
|
557
|
-
},
|
|
589
|
+
}, qn = { class: "lb" }, Jn = /* @__PURE__ */ ee({
|
|
558
590
|
__name: "ToolbarMenu",
|
|
559
591
|
props: {
|
|
560
592
|
items: {}
|
|
561
593
|
},
|
|
562
594
|
emits: ["pick"],
|
|
563
|
-
setup(
|
|
564
|
-
const f =
|
|
565
|
-
return (
|
|
566
|
-
(
|
|
567
|
-
key:
|
|
595
|
+
setup(u, { emit: C }) {
|
|
596
|
+
const f = C;
|
|
597
|
+
return (o, y) => (r(), c("div", Wn, [
|
|
598
|
+
(r(!0), c(_, null, ye(u.items, (b) => (r(), c(_, {
|
|
599
|
+
key: b.id
|
|
568
600
|
}, [
|
|
569
|
-
|
|
601
|
+
b.type === "separator" ? (r(), c("div", On)) : (r(), c("button", {
|
|
570
602
|
key: 1,
|
|
571
|
-
class:
|
|
572
|
-
disabled:
|
|
573
|
-
onClick: (
|
|
603
|
+
class: H(["mi", { active: b.active }]),
|
|
604
|
+
disabled: b.disabled,
|
|
605
|
+
onClick: (g) => f("pick", b)
|
|
574
606
|
}, [
|
|
575
|
-
|
|
607
|
+
b.iconSvg ? (r(), c("span", {
|
|
576
608
|
key: 0,
|
|
577
609
|
class: "ic",
|
|
578
|
-
innerHTML:
|
|
579
|
-
}, null, 8,
|
|
580
|
-
s("span",
|
|
581
|
-
], 10,
|
|
610
|
+
innerHTML: $(Be)(b.iconSvg)
|
|
611
|
+
}, null, 8, Un)) : b.icon ? (r(), c("span", Kn, I(b.icon), 1)) : R("", !0),
|
|
612
|
+
s("span", qn, I(b.label || b.id), 1)
|
|
613
|
+
], 10, Hn))
|
|
582
614
|
], 64))), 128))
|
|
583
615
|
]));
|
|
584
616
|
}
|
|
585
|
-
}),
|
|
617
|
+
}), zt = /* @__PURE__ */ te(Jn, [["__scopeId", "data-v-322e2c67"]]), jn = {
|
|
586
618
|
key: 0,
|
|
587
619
|
class: "divider"
|
|
588
|
-
},
|
|
620
|
+
}, _n = {
|
|
589
621
|
key: 1,
|
|
590
622
|
class: "tool"
|
|
591
|
-
},
|
|
623
|
+
}, Zn = ["innerHTML"], Gn = {
|
|
592
624
|
key: 1,
|
|
593
625
|
class: "ic-e"
|
|
594
|
-
},
|
|
626
|
+
}, Xn = {
|
|
595
627
|
key: 2,
|
|
596
628
|
class: "lb"
|
|
597
|
-
},
|
|
629
|
+
}, Qn = ["innerHTML"], Yn = {
|
|
598
630
|
key: 0,
|
|
599
631
|
class: "divider"
|
|
600
|
-
},
|
|
632
|
+
}, es = {
|
|
601
633
|
key: 1,
|
|
602
634
|
class: "dd"
|
|
603
|
-
},
|
|
635
|
+
}, ts = ["disabled", "title", "onClick"], ls = ["innerHTML"], ns = {
|
|
604
636
|
key: 1,
|
|
605
637
|
class: "ic-e"
|
|
606
|
-
},
|
|
638
|
+
}, ss = {
|
|
607
639
|
key: 2,
|
|
608
640
|
class: "lb"
|
|
609
|
-
},
|
|
641
|
+
}, as = ["innerHTML"], os = {
|
|
610
642
|
key: 0,
|
|
611
643
|
class: "dd more"
|
|
612
|
-
},
|
|
644
|
+
}, is = ["innerHTML"], us = 46, Bt = 4, ds = /* @__PURE__ */ ee({
|
|
613
645
|
__name: "ActionToolbar",
|
|
614
646
|
props: {
|
|
615
647
|
items: {}
|
|
616
648
|
},
|
|
617
|
-
setup(
|
|
618
|
-
const
|
|
649
|
+
setup(u) {
|
|
650
|
+
const C = u, f = k(null), o = k(null), y = k([]), b = k(0), g = k(null);
|
|
619
651
|
function m() {
|
|
620
|
-
var A,
|
|
621
|
-
const
|
|
622
|
-
|
|
623
|
-
}
|
|
624
|
-
const
|
|
625
|
-
const
|
|
626
|
-
if (
|
|
627
|
-
let
|
|
628
|
-
for (let
|
|
629
|
-
if (
|
|
630
|
-
|
|
652
|
+
var A, w;
|
|
653
|
+
const S = o.value;
|
|
654
|
+
S && (y.value = Array.from(S.children).map((le) => le.offsetWidth), b.value = (w = (A = f.value) == null ? void 0 : A.clientWidth) != null ? w : 0);
|
|
655
|
+
}
|
|
656
|
+
const v = M(() => {
|
|
657
|
+
const S = b.value, A = y.value;
|
|
658
|
+
if (!S || A.length !== C.items.length) return C.items.length;
|
|
659
|
+
let w = 0, le = !0;
|
|
660
|
+
for (let K = 0; K < C.items.length; K++)
|
|
661
|
+
if (w += A[K] + Bt, w > S) {
|
|
662
|
+
le = !1;
|
|
631
663
|
break;
|
|
632
664
|
}
|
|
633
|
-
if (
|
|
634
|
-
let
|
|
635
|
-
for (let
|
|
636
|
-
|
|
637
|
-
return Math.max(0,
|
|
638
|
-
}),
|
|
639
|
-
function z(
|
|
640
|
-
|
|
641
|
-
}
|
|
642
|
-
function D(
|
|
665
|
+
if (le) return C.items.length;
|
|
666
|
+
let ke = us, xe = 0;
|
|
667
|
+
for (let K = 0; K < C.items.length && (ke += A[K] + Bt, !(ke > S)); K++)
|
|
668
|
+
xe++;
|
|
669
|
+
return Math.max(0, xe);
|
|
670
|
+
}), i = M(() => C.items.slice(0, v.value)), d = M(() => C.items.slice(v.value)), P = Ue.more;
|
|
671
|
+
function z(S) {
|
|
672
|
+
g.value = g.value === S ? null : S;
|
|
673
|
+
}
|
|
674
|
+
function D(S) {
|
|
643
675
|
var A;
|
|
644
|
-
|
|
676
|
+
S.disabled || (A = S.onClick) == null || A.call(S);
|
|
645
677
|
}
|
|
646
|
-
function
|
|
678
|
+
function F(S) {
|
|
647
679
|
var A;
|
|
648
|
-
|
|
649
|
-
}
|
|
650
|
-
function
|
|
651
|
-
D(
|
|
652
|
-
}
|
|
653
|
-
function
|
|
654
|
-
return
|
|
655
|
-
}
|
|
656
|
-
let
|
|
657
|
-
function
|
|
658
|
-
f.value && !f.value.contains(
|
|
659
|
-
}
|
|
660
|
-
return
|
|
661
|
-
|
|
662
|
-
var
|
|
663
|
-
return
|
|
664
|
-
}), f.value &&
|
|
665
|
-
}),
|
|
666
|
-
|
|
667
|
-
}),
|
|
668
|
-
() =>
|
|
680
|
+
S.disabled || ((A = S.items) != null && A.length ? z(S.id) : (D(S), g.value = null));
|
|
681
|
+
}
|
|
682
|
+
function x(S) {
|
|
683
|
+
D(S), g.value = null;
|
|
684
|
+
}
|
|
685
|
+
function Z(S) {
|
|
686
|
+
return S.iconSvg ? Be(S.iconSvg) : null;
|
|
687
|
+
}
|
|
688
|
+
let G = null;
|
|
689
|
+
function ae(S) {
|
|
690
|
+
f.value && !f.value.contains(S.target) && (g.value = null);
|
|
691
|
+
}
|
|
692
|
+
return je(() => {
|
|
693
|
+
be(m), G = new ResizeObserver(() => {
|
|
694
|
+
var S, A;
|
|
695
|
+
return b.value = (A = (S = f.value) == null ? void 0 : S.clientWidth) != null ? A : 0;
|
|
696
|
+
}), f.value && G.observe(f.value), document.addEventListener("mousedown", ae);
|
|
697
|
+
}), qe(() => {
|
|
698
|
+
G == null || G.disconnect(), document.removeEventListener("mousedown", ae);
|
|
699
|
+
}), B(
|
|
700
|
+
() => C.items.map((S) => {
|
|
669
701
|
var A;
|
|
670
|
-
return
|
|
702
|
+
return S.id + ((A = S.label) != null ? A : "");
|
|
671
703
|
}).join("|"),
|
|
672
|
-
() =>
|
|
673
|
-
), (
|
|
704
|
+
() => be(m)
|
|
705
|
+
), (S, A) => (r(), c("div", {
|
|
674
706
|
class: "action-toolbar",
|
|
675
707
|
ref_key: "containerEl",
|
|
676
708
|
ref: f
|
|
@@ -678,90 +710,90 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
678
710
|
s("div", {
|
|
679
711
|
class: "measure",
|
|
680
712
|
ref_key: "measureEl",
|
|
681
|
-
ref:
|
|
713
|
+
ref: o,
|
|
682
714
|
"aria-hidden": "true"
|
|
683
715
|
}, [
|
|
684
|
-
(
|
|
685
|
-
key: "m" +
|
|
716
|
+
(r(!0), c(_, null, ye(u.items, (w) => (r(), c(_, {
|
|
717
|
+
key: "m" + w.id
|
|
686
718
|
}, [
|
|
687
|
-
|
|
688
|
-
|
|
719
|
+
w.type === "separator" ? (r(), c("span", jn)) : (r(), c("button", _n, [
|
|
720
|
+
Z(w) ? (r(), c("span", {
|
|
689
721
|
key: 0,
|
|
690
722
|
class: "ic",
|
|
691
|
-
innerHTML:
|
|
692
|
-
}, null, 8,
|
|
693
|
-
|
|
694
|
-
|
|
723
|
+
innerHTML: Z(w)
|
|
724
|
+
}, null, 8, Zn)) : w.icon ? (r(), c("span", Gn, I(w.icon), 1)) : R("", !0),
|
|
725
|
+
w.label ? (r(), c("span", Xn, I(w.label), 1)) : R("", !0),
|
|
726
|
+
w.items ? (r(), c("span", {
|
|
695
727
|
key: 3,
|
|
696
728
|
class: "caret",
|
|
697
|
-
innerHTML:
|
|
698
|
-
}, null, 8,
|
|
729
|
+
innerHTML: $(Be)($(Ue).caret)
|
|
730
|
+
}, null, 8, Qn)) : R("", !0)
|
|
699
731
|
]))
|
|
700
732
|
], 64))), 128))
|
|
701
733
|
], 512),
|
|
702
|
-
(
|
|
703
|
-
key:
|
|
734
|
+
(r(!0), c(_, null, ye(i.value, (w) => (r(), c(_, {
|
|
735
|
+
key: w.id
|
|
704
736
|
}, [
|
|
705
|
-
|
|
737
|
+
w.type === "separator" ? (r(), c("span", Yn)) : (r(), c("div", es, [
|
|
706
738
|
s("button", {
|
|
707
|
-
class:
|
|
708
|
-
disabled:
|
|
709
|
-
title:
|
|
710
|
-
onClick: (
|
|
739
|
+
class: H(["tool", { active: w.active, open: g.value === w.id }]),
|
|
740
|
+
disabled: w.disabled,
|
|
741
|
+
title: w.title || w.label || w.id,
|
|
742
|
+
onClick: (le) => F(w)
|
|
711
743
|
}, [
|
|
712
|
-
|
|
744
|
+
Z(w) ? (r(), c("span", {
|
|
713
745
|
key: 0,
|
|
714
746
|
class: "ic",
|
|
715
|
-
innerHTML:
|
|
716
|
-
}, null, 8,
|
|
717
|
-
|
|
718
|
-
|
|
747
|
+
innerHTML: Z(w)
|
|
748
|
+
}, null, 8, ls)) : w.icon ? (r(), c("span", ns, I(w.icon), 1)) : R("", !0),
|
|
749
|
+
w.label ? (r(), c("span", ss, I(w.label), 1)) : R("", !0),
|
|
750
|
+
w.items ? (r(), c("span", {
|
|
719
751
|
key: 3,
|
|
720
752
|
class: "caret",
|
|
721
|
-
innerHTML:
|
|
722
|
-
}, null, 8,
|
|
723
|
-
], 10,
|
|
724
|
-
|
|
753
|
+
innerHTML: $(Be)($(Ue).caret)
|
|
754
|
+
}, null, 8, as)) : R("", !0)
|
|
755
|
+
], 10, ts),
|
|
756
|
+
w.items && g.value === w.id ? (r(), ve(zt, {
|
|
725
757
|
key: 0,
|
|
726
|
-
items:
|
|
727
|
-
onPick:
|
|
728
|
-
}, null, 8, ["items"])) :
|
|
758
|
+
items: w.items,
|
|
759
|
+
onPick: x
|
|
760
|
+
}, null, 8, ["items"])) : R("", !0)
|
|
729
761
|
]))
|
|
730
762
|
], 64))), 128)),
|
|
731
|
-
|
|
763
|
+
d.value.length ? (r(), c("div", os, [
|
|
732
764
|
s("button", {
|
|
733
|
-
class:
|
|
765
|
+
class: H(["tool", { open: g.value === "__more" }]),
|
|
734
766
|
title: "更多",
|
|
735
|
-
onClick: A[0] || (A[0] = (
|
|
767
|
+
onClick: A[0] || (A[0] = (w) => z("__more"))
|
|
736
768
|
}, [
|
|
737
769
|
s("span", {
|
|
738
770
|
class: "ic",
|
|
739
|
-
innerHTML:
|
|
740
|
-
}, null, 8,
|
|
771
|
+
innerHTML: $(Be)($(P))
|
|
772
|
+
}, null, 8, is)
|
|
741
773
|
], 2),
|
|
742
|
-
|
|
774
|
+
g.value === "__more" ? (r(), ve(zt, {
|
|
743
775
|
key: 0,
|
|
744
|
-
items:
|
|
745
|
-
onPick:
|
|
746
|
-
}, null, 8, ["items"])) :
|
|
747
|
-
])) :
|
|
776
|
+
items: d.value,
|
|
777
|
+
onPick: x
|
|
778
|
+
}, null, 8, ["items"])) : R("", !0)
|
|
779
|
+
])) : R("", !0)
|
|
748
780
|
], 512));
|
|
749
781
|
}
|
|
750
|
-
}),
|
|
782
|
+
}), rs = /* @__PURE__ */ te(ds, [["__scopeId", "data-v-0a4aa655"]]), vs = {
|
|
751
783
|
key: 0,
|
|
752
784
|
class: "export-progress-overlay",
|
|
753
785
|
role: "dialog",
|
|
754
786
|
"aria-modal": "true",
|
|
755
787
|
"aria-live": "polite"
|
|
756
|
-
},
|
|
788
|
+
}, cs = { class: "card" }, fs = { class: "title" }, ms = { class: "row" }, ps = { class: "pct" }, gs = /* @__PURE__ */ ee({
|
|
757
789
|
__name: "ExportProgressOverlay",
|
|
758
790
|
props: {
|
|
759
791
|
state: {},
|
|
760
792
|
busy: { type: Boolean }
|
|
761
793
|
},
|
|
762
794
|
emits: ["cancel"],
|
|
763
|
-
setup(
|
|
764
|
-
const f =
|
|
795
|
+
setup(u, { emit: C }) {
|
|
796
|
+
const f = C, o = {
|
|
765
797
|
render: "渲染中",
|
|
766
798
|
compose: "合成中",
|
|
767
799
|
paginate: "分页中",
|
|
@@ -769,53 +801,53 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
769
801
|
zip: "zip 压缩",
|
|
770
802
|
convert: "批量转换"
|
|
771
803
|
};
|
|
772
|
-
return (y,
|
|
773
|
-
var
|
|
774
|
-
return
|
|
775
|
-
|
|
776
|
-
s("div",
|
|
777
|
-
s("div",
|
|
804
|
+
return (y, b) => {
|
|
805
|
+
var g, m, v, i, d, P, z;
|
|
806
|
+
return r(), ve(Sl, { to: "body" }, [
|
|
807
|
+
u.busy ? (r(), c("div", vs, [
|
|
808
|
+
s("div", cs, [
|
|
809
|
+
s("div", fs, I(((g = u.state) == null ? void 0 : g.label) || o[(v = (m = u.state) == null ? void 0 : m.stage) != null ? v : ""] || "处理中…"), 1),
|
|
778
810
|
s("div", {
|
|
779
|
-
class:
|
|
811
|
+
class: H(["bar", { indeterminate: ((i = u.state) == null ? void 0 : i.ratio) == null }])
|
|
780
812
|
}, [
|
|
781
|
-
((
|
|
813
|
+
((d = u.state) == null ? void 0 : d.ratio) != null ? (r(), c("div", {
|
|
782
814
|
key: 0,
|
|
783
815
|
class: "fill",
|
|
784
|
-
style:
|
|
785
|
-
}, null, 4)) :
|
|
816
|
+
style: Ke({ width: Math.round(((P = u.state.ratio) != null ? P : 0) * 100) + "%" })
|
|
817
|
+
}, null, 4)) : R("", !0)
|
|
786
818
|
], 2),
|
|
787
|
-
s("div",
|
|
788
|
-
s("span",
|
|
819
|
+
s("div", ms, [
|
|
820
|
+
s("span", ps, I(((z = u.state) == null ? void 0 : z.ratio) != null ? Math.round(u.state.ratio * 100) + "%" : "正在处理…"), 1),
|
|
789
821
|
s("button", {
|
|
790
822
|
class: "cancel",
|
|
791
|
-
onClick:
|
|
823
|
+
onClick: b[0] || (b[0] = (D) => f("cancel")),
|
|
792
824
|
title: "按 Esc 也可取消"
|
|
793
825
|
}, "取消")
|
|
794
826
|
])
|
|
795
827
|
])
|
|
796
|
-
])) :
|
|
828
|
+
])) : R("", !0)
|
|
797
829
|
]);
|
|
798
830
|
};
|
|
799
831
|
}
|
|
800
|
-
}),
|
|
832
|
+
}), bs = /* @__PURE__ */ te(gs, [["__scopeId", "data-v-629027ad"]]), Cs = {
|
|
801
833
|
key: 2,
|
|
802
834
|
class: "formula-bar"
|
|
803
|
-
},
|
|
835
|
+
}, ys = { class: "addr" }, ks = ["value", "title"], xs = ["title"], ws = { class: "ov-slot" }, hs = {
|
|
804
836
|
key: 3,
|
|
805
837
|
class: "state"
|
|
806
|
-
},
|
|
838
|
+
}, $s = { class: "loader" }, Ss = { class: "loader-label" }, Es = { key: 0 }, Ts = { class: "loader-track" }, Fs = {
|
|
807
839
|
key: 1,
|
|
808
840
|
class: "loader-fill indeterminate"
|
|
809
|
-
},
|
|
841
|
+
}, Is = {
|
|
810
842
|
key: 4,
|
|
811
843
|
class: "state error"
|
|
812
|
-
},
|
|
844
|
+
}, Ms = {
|
|
813
845
|
key: 5,
|
|
814
846
|
class: "state hint"
|
|
815
|
-
},
|
|
847
|
+
}, Rs = {
|
|
816
848
|
key: 3,
|
|
817
849
|
class: "status-bar"
|
|
818
|
-
},
|
|
850
|
+
}, Ps = { class: "sel" }, Ds = { key: 1 }, As = /* @__PURE__ */ ee({
|
|
819
851
|
__name: "ExcelViewer",
|
|
820
852
|
props: {
|
|
821
853
|
src: {},
|
|
@@ -833,6 +865,8 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
833
865
|
plugins: {},
|
|
834
866
|
toolbar: { type: [Boolean, Array], default: !0 },
|
|
835
867
|
editable: { type: Boolean },
|
|
868
|
+
pivotTable: { type: Boolean },
|
|
869
|
+
conditionalFormat: { type: Boolean },
|
|
836
870
|
cellReadOnly: {},
|
|
837
871
|
readOnlyRanges: {},
|
|
838
872
|
editableTargets: {},
|
|
@@ -841,286 +875,296 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
841
875
|
editor: {},
|
|
842
876
|
recalc: { type: Boolean },
|
|
843
877
|
formulaEngine: {},
|
|
878
|
+
pasteBehavior: {},
|
|
879
|
+
readOnlyPrompt: {},
|
|
844
880
|
exportProgress: { type: Boolean, default: !0 },
|
|
845
881
|
contextMenu: { type: [Boolean, Function], default: void 0 }
|
|
846
882
|
},
|
|
847
883
|
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"],
|
|
848
|
-
setup(
|
|
849
|
-
const
|
|
884
|
+
setup(u, { expose: C, emit: f }) {
|
|
885
|
+
const o = u, y = M(() => {
|
|
850
886
|
var e;
|
|
851
|
-
return (e =
|
|
852
|
-
}),
|
|
853
|
-
() => Object.assign({}, ...y.value.map((e) => e.theme || {}),
|
|
854
|
-
),
|
|
887
|
+
return (e = o.plugins) != null ? e : [];
|
|
888
|
+
}), b = M(
|
|
889
|
+
() => Object.assign({}, ...y.value.map((e) => e.theme || {}), o.theme || {})
|
|
890
|
+
), g = M(() => !!o.cellStyle || y.value.some((e) => e.cellStyle));
|
|
855
891
|
function m(e, l, n) {
|
|
856
892
|
let a;
|
|
857
|
-
const h = (
|
|
858
|
-
const
|
|
859
|
-
|
|
893
|
+
const h = (T) => {
|
|
894
|
+
const p = T == null ? void 0 : T(e, l, n);
|
|
895
|
+
p && (a = W(W({}, a || {}), p));
|
|
860
896
|
};
|
|
861
|
-
for (const
|
|
862
|
-
return h(
|
|
897
|
+
for (const T of y.value) h(T.cellStyle);
|
|
898
|
+
return h(o.cellStyle), a;
|
|
863
899
|
}
|
|
864
|
-
function
|
|
900
|
+
function v(e) {
|
|
865
901
|
var n, a;
|
|
866
902
|
let l = e;
|
|
867
903
|
for (const h of y.value) h.transformModel && (l = (n = h.transformModel(l)) != null ? n : l);
|
|
868
|
-
return
|
|
869
|
-
}
|
|
870
|
-
const
|
|
871
|
-
editable:
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
904
|
+
return o.transformModel && (l = (a = o.transformModel(l)) != null ? a : l), l;
|
|
905
|
+
}
|
|
906
|
+
const i = M(() => ({
|
|
907
|
+
editable: o.editable,
|
|
908
|
+
pivotTable: o.pivotTable,
|
|
909
|
+
conditionalFormat: o.conditionalFormat,
|
|
910
|
+
cellReadOnly: o.cellReadOnly,
|
|
911
|
+
readOnlyRanges: o.readOnlyRanges,
|
|
912
|
+
editableTargets: o.editableTargets,
|
|
913
|
+
strictDimensions: o.strictDimensions,
|
|
914
|
+
recalc: o.recalc,
|
|
915
|
+
formulaEngine: o.formulaEngine,
|
|
916
|
+
pasteBehavior: o.pasteBehavior,
|
|
917
|
+
readOnlyPrompt: o.readOnlyPrompt
|
|
878
918
|
}));
|
|
879
|
-
function
|
|
919
|
+
function d(e, l) {
|
|
880
920
|
var a, h;
|
|
881
|
-
const n = (a =
|
|
921
|
+
const n = (a = o.editor) == null ? void 0 : a.call(o, e, l);
|
|
882
922
|
if (n) return n;
|
|
883
|
-
for (const
|
|
884
|
-
const
|
|
885
|
-
if (
|
|
923
|
+
for (const T of y.value) {
|
|
924
|
+
const p = (h = T.editor) == null ? void 0 : h.call(T, e, l);
|
|
925
|
+
if (p) return p;
|
|
886
926
|
}
|
|
887
927
|
}
|
|
888
|
-
const
|
|
928
|
+
const P = M(() => !!o.editor || y.value.some((e) => e.editor)), z = f, { loading: D, error: F, workbook: x, load: Z, loadModel: G, progress: ae, sourceBuffer: S } = Nl();
|
|
889
929
|
function A(e) {
|
|
890
|
-
return e ?
|
|
930
|
+
return e ? Bl(e) ? e : Ll(e, o.jsonOptions) : null;
|
|
891
931
|
}
|
|
892
|
-
const
|
|
932
|
+
const w = k(null), le = k(null), ke = M(() => {
|
|
893
933
|
var e, l;
|
|
894
|
-
return (l = (e =
|
|
895
|
-
}),
|
|
934
|
+
return (l = (e = w.value) != null ? e : o.templateFile) != null ? l : null;
|
|
935
|
+
}), xe = M(() => {
|
|
896
936
|
var e, l;
|
|
897
|
-
return (l = (e =
|
|
937
|
+
return (l = (e = le.value) != null ? e : o.templateName) != null ? l : "";
|
|
898
938
|
});
|
|
899
|
-
function
|
|
900
|
-
|
|
939
|
+
function K(e, l) {
|
|
940
|
+
w.value = e, le.value = l;
|
|
901
941
|
}
|
|
902
|
-
function
|
|
903
|
-
|
|
942
|
+
function Ct() {
|
|
943
|
+
K(null, null);
|
|
904
944
|
}
|
|
905
|
-
const
|
|
945
|
+
const yt = k(null);
|
|
906
946
|
function Ht() {
|
|
907
947
|
var e;
|
|
908
|
-
(e =
|
|
948
|
+
(e = yt.value) == null || e.click();
|
|
909
949
|
}
|
|
910
|
-
function
|
|
950
|
+
function Ut(e) {
|
|
911
951
|
var n;
|
|
912
952
|
const l = (n = e.target.files) == null ? void 0 : n[0];
|
|
913
|
-
l && (
|
|
953
|
+
l && (K(l, l.name), e.target.value = "");
|
|
914
954
|
}
|
|
915
|
-
const
|
|
955
|
+
const Kt = M(() => {
|
|
916
956
|
var e, l;
|
|
917
|
-
return
|
|
957
|
+
return o.fileName ? o.fileName : o.workbook ? "JSON 数据" : ((l = (e = x.value) == null ? void 0 : e.sheets[0]) == null ? void 0 : l.name) || "";
|
|
918
958
|
});
|
|
919
|
-
async function
|
|
959
|
+
async function qt(e) {
|
|
920
960
|
const l = await Nt(e), n = Vt(l);
|
|
921
961
|
if (n === "xls") throw new Error("模板文件是旧版 .xls 或加密,仅支持 .xlsx/.xlsm");
|
|
922
962
|
if (n === "not-zip") throw new Error("模板文件不是有效的 .xlsx(非 ZIP 包)");
|
|
923
963
|
if (n === "empty") throw new Error("模板文件为空");
|
|
924
|
-
const a = await
|
|
925
|
-
return
|
|
964
|
+
const a = await Ot(l);
|
|
965
|
+
return Wt(a), a;
|
|
926
966
|
}
|
|
927
|
-
async function
|
|
928
|
-
const e =
|
|
929
|
-
if (
|
|
930
|
-
e && console.warn("[ooxml-excel-editor] :templateFile 只在 :workbook (JSON / 模型) 数据源下生效;xlsx 数据源已自带格式,模板已忽略."), await
|
|
967
|
+
async function kt() {
|
|
968
|
+
const e = ke.value, l = A(o.workbook);
|
|
969
|
+
if (o.src) {
|
|
970
|
+
e && console.warn("[ooxml-excel-editor] :templateFile 只在 :workbook (JSON / 模型) 数据源下生效;xlsx 数据源已自带格式,模板已忽略."), await Z(o.src, v);
|
|
931
971
|
return;
|
|
932
972
|
}
|
|
933
973
|
if (l && e) {
|
|
934
974
|
try {
|
|
935
|
-
const n = await
|
|
936
|
-
|
|
975
|
+
const n = await qt(e), a = zl(l, n);
|
|
976
|
+
G(a, v);
|
|
937
977
|
} catch (n) {
|
|
938
|
-
console.error("[ooxml-excel-editor] 模板加载失败,降级为纯 JSON 渲染:", n),
|
|
978
|
+
console.error("[ooxml-excel-editor] 模板加载失败,降级为纯 JSON 渲染:", n), G(l, v);
|
|
939
979
|
}
|
|
940
980
|
return;
|
|
941
981
|
}
|
|
942
982
|
if (l) {
|
|
943
|
-
|
|
983
|
+
G(l, v);
|
|
944
984
|
return;
|
|
945
985
|
}
|
|
946
|
-
e && await
|
|
986
|
+
e && await Z(e, v);
|
|
947
987
|
}
|
|
948
|
-
const xt =
|
|
949
|
-
const e =
|
|
988
|
+
const xt = M(() => {
|
|
989
|
+
const e = ae.value;
|
|
950
990
|
return e ? e.stage === "read" ? "读取文件…" : e.stage === "parse" ? "解析中…" : "构建表格…" : "";
|
|
951
|
-
}),
|
|
952
|
-
const e =
|
|
991
|
+
}), we = M(() => {
|
|
992
|
+
const e = ae.value;
|
|
953
993
|
return e && e.ratio != null ? Math.round(e.ratio * 100) : null;
|
|
954
|
-
}),
|
|
994
|
+
}), q = k(0), wt = k(0), X = k(1), Jt = k(null), he = k(null), _e = k(null), oe = k(null), Ze = k(null), Ge = k(null), Xe = k(null), Qe = k(null), ce = gt(null), jt = k({ scrollX: 0, scrollY: 0, width: 0, height: 0, zoom: 1 }), fe = M(() => {
|
|
955
995
|
var l, n;
|
|
956
|
-
const e =
|
|
957
|
-
return e && (n = (l = e.sheets[
|
|
958
|
-
}),
|
|
996
|
+
const e = x.value;
|
|
997
|
+
return e && (n = (l = e.sheets[q.value]) != null ? l : e.sheets[0]) != null ? n : null;
|
|
998
|
+
}), ie = k(0), Ye = k(null), et = k(null);
|
|
959
999
|
let t = null;
|
|
960
|
-
function
|
|
1000
|
+
function Le() {
|
|
961
1001
|
t == null || t.render();
|
|
962
1002
|
}
|
|
963
|
-
function
|
|
1003
|
+
function _t() {
|
|
964
1004
|
t == null || t.measure();
|
|
965
1005
|
}
|
|
966
1006
|
function tt() {
|
|
967
|
-
const e =
|
|
968
|
-
!e || !l || !t || (t.rebuild(e, l,
|
|
969
|
-
theme:
|
|
970
|
-
cellStyle:
|
|
971
|
-
cellImageFit:
|
|
972
|
-
readOnlyCellStyle:
|
|
1007
|
+
const e = fe.value, l = x.value;
|
|
1008
|
+
!e || !l || !t || (t.rebuild(e, l, X.value, {
|
|
1009
|
+
theme: b.value,
|
|
1010
|
+
cellStyle: g.value ? m : void 0,
|
|
1011
|
+
cellImageFit: o.cellImageFit,
|
|
1012
|
+
readOnlyCellStyle: o.readOnlyCellStyle
|
|
973
1013
|
// Phase C 2026-06-08
|
|
974
|
-
}), t.setSourceBuffer(
|
|
1014
|
+
}), t.setSourceBuffer(S.value));
|
|
975
1015
|
}
|
|
976
|
-
function
|
|
977
|
-
const e =
|
|
978
|
-
e && (
|
|
1016
|
+
function Zt() {
|
|
1017
|
+
const e = oe.value;
|
|
1018
|
+
e && (ue.value = null, t == null || t.setScroll(e.scrollLeft, e.scrollTop));
|
|
979
1019
|
}
|
|
980
|
-
let
|
|
981
|
-
|
|
982
|
-
|
|
1020
|
+
let $e = null;
|
|
1021
|
+
je(() => {
|
|
1022
|
+
Pt(), _e.value && he.value && oe.value && Ye.value && et.value && Ze.value && Ge.value && Xe.value && Qe.value && (t = new Tl(
|
|
983
1023
|
{
|
|
984
|
-
canvas:
|
|
985
|
-
renderArea:
|
|
986
|
-
scroller:
|
|
1024
|
+
canvas: _e.value,
|
|
1025
|
+
renderArea: he.value,
|
|
1026
|
+
scroller: oe.value,
|
|
987
1027
|
spacer: Ye.value,
|
|
988
|
-
overlays: { main:
|
|
1028
|
+
overlays: { main: Ze.value, frow: Ge.value, fcol: Xe.value, corner: Qe.value },
|
|
989
1029
|
editorSlot: et.value
|
|
990
1030
|
},
|
|
991
1031
|
{
|
|
992
|
-
onRenderer: (e) =>
|
|
993
|
-
onRenderTick: () =>
|
|
994
|
-
onSelectionChange: () =>
|
|
995
|
-
onCellClick: (e, l, n) =>
|
|
996
|
-
onCellDblClick: (e, l, n) =>
|
|
1032
|
+
onRenderer: (e) => ce.value = e,
|
|
1033
|
+
onRenderTick: () => ie.value++,
|
|
1034
|
+
onSelectionChange: () => ne.value++,
|
|
1035
|
+
onCellClick: (e, l, n) => pe("cell-click", { row: e, col: l, text: n }),
|
|
1036
|
+
onCellDblClick: (e, l, n) => pe("cell-dblclick", { row: e, col: l, text: n }),
|
|
997
1037
|
onHyperlink: (e, l) => {
|
|
998
|
-
|
|
1038
|
+
pe("hyperlink-click", { url: e, cell: l }), o.openLinks && window.open(e, "_blank", "noopener");
|
|
999
1039
|
},
|
|
1000
|
-
onTooltip: (e) =>
|
|
1040
|
+
onTooltip: (e) => ue.value = e,
|
|
1001
1041
|
onFindChange: () => it.value++,
|
|
1002
1042
|
onFilterChange: () => ut.value++,
|
|
1003
|
-
|
|
1043
|
+
onActiveSheetChange: (e) => {
|
|
1044
|
+
q.value = e, wt.value++;
|
|
1045
|
+
},
|
|
1046
|
+
// core 新增表(透视新建工作表)→ 顶版本号让 SheetTabs 重读(workbook 是 shallowRef,push 不自动通知)
|
|
1047
|
+
onEditEvent: (e, l) => pe(e, l),
|
|
1004
1048
|
onContextMenuBefore: (e) => {
|
|
1005
1049
|
for (const l of y.value)
|
|
1006
1050
|
if (l.contextMenu) {
|
|
1007
1051
|
const n = l.contextMenu(e.ctx, e.items);
|
|
1008
1052
|
Array.isArray(n) && e.items.splice(0, e.items.length, ...n);
|
|
1009
1053
|
}
|
|
1010
|
-
|
|
1054
|
+
o.contextMenu === !1 && e.preventDefault(), z("before-context-menu", e);
|
|
1011
1055
|
},
|
|
1012
1056
|
onContextMenuShow: (e) => z("context-menu", e)
|
|
1013
1057
|
}
|
|
1014
|
-
),
|
|
1015
|
-
|
|
1016
|
-
}),
|
|
1017
|
-
}),
|
|
1018
|
-
|
|
1019
|
-
}),
|
|
1020
|
-
|
|
1021
|
-
}),
|
|
1058
|
+
), jt.value = t.view, t.fileName = o.fileName, t.setEditConfig(i.value), t.setEditorResolver(P.value ? d : void 0), t.setLightboxEnabled(o.imageLightbox !== !1), t.setContextMenuTransform(typeof o.contextMenu == "function" ? o.contextMenu : null)), ct.value && (re = new Fl(ct.value)), kt(), $e = new ResizeObserver(() => {
|
|
1059
|
+
_t(), Le();
|
|
1060
|
+
}), he.value && $e.observe(he.value);
|
|
1061
|
+
}), qe(() => {
|
|
1062
|
+
$e == null || $e.disconnect(), t == null || t.dispose(), re == null || re.dispose(), He.forEach((e) => e()), x.value && bt(x.value);
|
|
1063
|
+
}), B([() => o.src, () => o.workbook, () => o.templateFile, w], () => {
|
|
1064
|
+
kt();
|
|
1065
|
+
}), B(() => o.fileName, (e) => {
|
|
1022
1066
|
t && (t.fileName = e);
|
|
1023
|
-
}),
|
|
1067
|
+
}), B(i, (e) => t == null ? void 0 : t.setEditConfig(e)), B(() => o.contextMenu, (e) => t == null ? void 0 : t.setContextMenuTransform(typeof e == "function" ? e : null)), B([() => o.editor, y], () => t == null ? void 0 : t.setEditorResolver(P.value ? d : void 0)), B(() => o.cellImageFit, (e) => {
|
|
1024
1068
|
e && (t == null || t.setCellImageFit(e));
|
|
1025
|
-
}),
|
|
1026
|
-
() => [
|
|
1069
|
+
}), B(() => o.imageLightbox, (e) => t == null ? void 0 : t.setLightboxEnabled(e !== !1)), B(
|
|
1070
|
+
() => [b.value, o.cellStyle, o.plugins],
|
|
1027
1071
|
() => {
|
|
1028
|
-
|
|
1072
|
+
ce.value && tt();
|
|
1029
1073
|
},
|
|
1030
1074
|
{ deep: !0 }
|
|
1031
|
-
),
|
|
1032
|
-
e && (t == null || t.clearFilterState(),
|
|
1033
|
-
}),
|
|
1034
|
-
const l =
|
|
1035
|
-
l != null && l.sheets[e] &&
|
|
1036
|
-
}),
|
|
1075
|
+
), B(() => o.plugins, () => Pt(), { deep: !1 }), B(x, async (e) => {
|
|
1076
|
+
e && (t == null || t.clearFilterState(), q.value = e.activeSheet, await be(), tt(), z("rendered", e));
|
|
1077
|
+
}), B(q, (e) => {
|
|
1078
|
+
const l = x.value;
|
|
1079
|
+
l != null && l.sheets[e] && pe("sheet-change", { index: e, name: l.sheets[e].name });
|
|
1080
|
+
}), B(F, (e) => {
|
|
1037
1081
|
e && z("error", e);
|
|
1038
|
-
}),
|
|
1082
|
+
}), B(ae, (e) => {
|
|
1039
1083
|
e && z("progress", e);
|
|
1040
|
-
}),
|
|
1084
|
+
}), B(q, async (e, l) => {
|
|
1041
1085
|
var n;
|
|
1042
|
-
l != null && (t == null || t.resetFilter((n =
|
|
1043
|
-
}),
|
|
1044
|
-
const
|
|
1086
|
+
l != null && (t == null || t.resetFilter((n = x.value) == null ? void 0 : n.sheets[l])), await be(), tt();
|
|
1087
|
+
}), B(X, (e) => t == null ? void 0 : t.setZoom(e));
|
|
1088
|
+
const ne = k(0), ue = k(null), J = M(() => {
|
|
1045
1089
|
var e;
|
|
1046
|
-
return
|
|
1047
|
-
}), lt =
|
|
1048
|
-
|
|
1090
|
+
return ne.value, ce.value, (e = t == null ? void 0 : t.getSelection()) != null ? e : null;
|
|
1091
|
+
}), lt = M(() => {
|
|
1092
|
+
ne.value;
|
|
1049
1093
|
const e = t == null ? void 0 : t.getActiveCell();
|
|
1050
|
-
return e ?
|
|
1051
|
-
}),
|
|
1052
|
-
const e =
|
|
1053
|
-
return !e || e.top === e.bottom && e.left === e.right ? "" : `${
|
|
1054
|
-
}),
|
|
1094
|
+
return e ? Ce(e.col) + (e.row + 1) : "";
|
|
1095
|
+
}), ht = M(() => {
|
|
1096
|
+
const e = J.value;
|
|
1097
|
+
return !e || e.top === e.bottom && e.left === e.right ? "" : `${Ce(e.left)}${e.top + 1}:${Ce(e.right)}${e.bottom + 1}`;
|
|
1098
|
+
}), $t = M(() => {
|
|
1055
1099
|
var n;
|
|
1056
|
-
|
|
1057
|
-
const e =
|
|
1100
|
+
ne.value;
|
|
1101
|
+
const e = ce.value, l = t == null ? void 0 : t.getActiveCell();
|
|
1058
1102
|
return !e || !l ? "" : (n = e.cellFormula(l.row, l.col)) != null ? n : e.cellText(l.row, l.col);
|
|
1059
|
-
}),
|
|
1103
|
+
}), Q = k(""), Se = k(!1), St = k(null);
|
|
1060
1104
|
function nt() {
|
|
1061
|
-
const e =
|
|
1105
|
+
const e = St.value;
|
|
1062
1106
|
e && (e.style.height = "auto", e.style.height = e.scrollHeight + "px");
|
|
1063
1107
|
}
|
|
1064
1108
|
function Gt(e) {
|
|
1065
|
-
|
|
1109
|
+
Q.value = e.target.value, nt();
|
|
1066
1110
|
}
|
|
1067
|
-
const Xt =
|
|
1111
|
+
const Xt = M(() => (ne.value, ie.value, !!(t != null && t.canEditActiveCell()))), Ne = M(() => {
|
|
1068
1112
|
var e;
|
|
1069
|
-
return
|
|
1113
|
+
return ne.value, ie.value, (e = t == null ? void 0 : t.getCellEditString()) != null ? e : "";
|
|
1070
1114
|
});
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
}, { immediate: !0 }),
|
|
1074
|
-
function
|
|
1075
|
-
|
|
1115
|
+
B(Ne, (e) => {
|
|
1116
|
+
Se.value || (Q.value = e);
|
|
1117
|
+
}, { immediate: !0 }), B(Q, () => be(nt));
|
|
1118
|
+
function Qt() {
|
|
1119
|
+
Se.value = !0, Q.value = Ne.value, be(nt);
|
|
1076
1120
|
}
|
|
1077
|
-
function
|
|
1121
|
+
function Et(e) {
|
|
1078
1122
|
var l;
|
|
1079
|
-
t == null || t.commitActiveCellValue(
|
|
1123
|
+
t == null || t.commitActiveCellValue(Q.value, e), Se.value = !1, Q.value = Ne.value, e === "down" && ((l = oe.value) == null || l.focus());
|
|
1080
1124
|
}
|
|
1081
|
-
function
|
|
1125
|
+
function Yt() {
|
|
1082
1126
|
var e;
|
|
1083
|
-
|
|
1127
|
+
Se.value = !1, Q.value = Ne.value, (e = oe.value) == null || e.focus();
|
|
1084
1128
|
}
|
|
1085
|
-
function
|
|
1086
|
-
|
|
1129
|
+
function el() {
|
|
1130
|
+
Se.value && Et();
|
|
1087
1131
|
}
|
|
1088
|
-
function
|
|
1089
|
-
e.stopPropagation(), e.key === "Enter" ? (e.preventDefault(),
|
|
1132
|
+
function tl(e) {
|
|
1133
|
+
e.stopPropagation(), e.key === "Enter" ? (e.preventDefault(), Et("down")) : e.key === "Escape" && (e.preventDefault(), Yt());
|
|
1090
1134
|
}
|
|
1091
|
-
const
|
|
1135
|
+
const U = M(() => {
|
|
1092
1136
|
var n;
|
|
1093
|
-
|
|
1094
|
-
const e =
|
|
1137
|
+
ne.value;
|
|
1138
|
+
const e = ce.value, l = (n = t == null ? void 0 : t.getSelection()) != null ? n : null;
|
|
1095
1139
|
return e && l ? e.selectionStats(l) : null;
|
|
1096
1140
|
});
|
|
1097
|
-
function
|
|
1141
|
+
function Ve(e) {
|
|
1098
1142
|
return isFinite(e) ? e.toLocaleString("en-US", { maximumFractionDigits: 2 }) : "—";
|
|
1099
1143
|
}
|
|
1100
|
-
function
|
|
1144
|
+
function ll(e) {
|
|
1101
1145
|
t == null || t.onMouseDown(e);
|
|
1102
1146
|
}
|
|
1103
|
-
function
|
|
1147
|
+
function nl(e) {
|
|
1104
1148
|
t == null || t.onContextMenu(e);
|
|
1105
1149
|
}
|
|
1106
|
-
function
|
|
1150
|
+
function sl(e) {
|
|
1107
1151
|
t == null || t.onMouseMove(e);
|
|
1108
1152
|
}
|
|
1109
|
-
function
|
|
1153
|
+
function al(e) {
|
|
1110
1154
|
t == null || t.onMouseUp(e);
|
|
1111
1155
|
}
|
|
1112
|
-
function
|
|
1156
|
+
function ol() {
|
|
1113
1157
|
t == null || t.onMouseLeave();
|
|
1114
1158
|
}
|
|
1115
|
-
function
|
|
1159
|
+
function il(e) {
|
|
1116
1160
|
t == null || t.onDblClick(e);
|
|
1117
1161
|
}
|
|
1118
|
-
function
|
|
1162
|
+
function ul(e) {
|
|
1119
1163
|
t == null || t.onKeyDown(e);
|
|
1120
1164
|
}
|
|
1121
|
-
|
|
1165
|
+
B(J, (e) => {
|
|
1122
1166
|
const l = t == null ? void 0 : t.getActiveCell();
|
|
1123
|
-
e && l &&
|
|
1167
|
+
e && l && pe("selection-change", { range: e, active: l });
|
|
1124
1168
|
});
|
|
1125
1169
|
function st(e, l) {
|
|
1126
1170
|
var n;
|
|
@@ -1130,34 +1174,34 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
1130
1174
|
var l;
|
|
1131
1175
|
return (l = t == null ? void 0 : t.rectOfRange(e)) != null ? l : null;
|
|
1132
1176
|
}
|
|
1133
|
-
const
|
|
1134
|
-
let
|
|
1135
|
-
function
|
|
1136
|
-
|
|
1177
|
+
const Ee = k(null), We = k(!1);
|
|
1178
|
+
let Te = null;
|
|
1179
|
+
function Tt() {
|
|
1180
|
+
Te == null || Te.abort();
|
|
1137
1181
|
}
|
|
1138
|
-
function
|
|
1139
|
-
if (
|
|
1182
|
+
function Y(e, l) {
|
|
1183
|
+
if (o.exportProgress === !1) return l(e);
|
|
1140
1184
|
const n = new AbortController();
|
|
1141
|
-
|
|
1142
|
-
const a = (
|
|
1143
|
-
var
|
|
1144
|
-
|
|
1145
|
-
}, h =
|
|
1185
|
+
Te = n, e != null && e.signal && (e.signal.aborted ? n.abort() : e.signal.addEventListener("abort", () => n.abort(), { once: !0 })), We.value = !0, Ee.value = null;
|
|
1186
|
+
const a = (T) => {
|
|
1187
|
+
var p;
|
|
1188
|
+
Ee.value = T, (p = e == null ? void 0 : e.onProgress) == null || p.call(e, T);
|
|
1189
|
+
}, h = ge(W({}, e != null ? e : {}), { onProgress: a, signal: n.signal });
|
|
1146
1190
|
return l(h).finally(() => {
|
|
1147
|
-
We.value = !1,
|
|
1191
|
+
We.value = !1, Ee.value = null, Te = null;
|
|
1148
1192
|
});
|
|
1149
1193
|
}
|
|
1150
|
-
const
|
|
1151
|
-
async function
|
|
1194
|
+
const dl = (e) => Y(e, (l) => t.exportImage(l)), Fe = (e) => Y(e, (l) => t.downloadImage(l)), rl = (e) => Y(e, (l) => t.exportPdf(l)), Ie = (e) => Y(e, (l) => t.downloadPdf(l)), Me = (e) => Y(e, (l) => t.print(l));
|
|
1195
|
+
async function Ft() {
|
|
1152
1196
|
try {
|
|
1153
|
-
await
|
|
1197
|
+
await Ie();
|
|
1154
1198
|
} catch (e) {
|
|
1155
1199
|
ot(e);
|
|
1156
1200
|
}
|
|
1157
1201
|
}
|
|
1158
|
-
async function
|
|
1202
|
+
async function It() {
|
|
1159
1203
|
try {
|
|
1160
|
-
await
|
|
1204
|
+
await Ie({ vector: !0 });
|
|
1161
1205
|
} catch (e) {
|
|
1162
1206
|
ot(e);
|
|
1163
1207
|
}
|
|
@@ -1166,29 +1210,29 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
1166
1210
|
const l = (e == null ? void 0 : e.message) || String(e);
|
|
1167
1211
|
console.error("[ooxml-excel-editor] 导出失败:", e), z("error", l), typeof window != "undefined" && window.alert && window.alert(l);
|
|
1168
1212
|
}
|
|
1169
|
-
const
|
|
1213
|
+
const Re = k(!1), it = k(0), me = M(() => {
|
|
1170
1214
|
var e;
|
|
1171
|
-
return it.value, (e = t == null ? void 0 : t.getFindState()) != null ? e : { query: "", matchCase: !1, wholeCell: !1, count: 0, index: -1 };
|
|
1215
|
+
return it.value, (e = t == null ? void 0 : t.getFindState()) != null ? e : { query: "", matchCase: !1, wholeCell: !1, count: 0, index: -1, replace: "" };
|
|
1172
1216
|
});
|
|
1173
|
-
function It() {
|
|
1174
|
-
Fe.value = !0;
|
|
1175
|
-
}
|
|
1176
1217
|
function Mt() {
|
|
1218
|
+
Re.value = !0;
|
|
1219
|
+
}
|
|
1220
|
+
function Rt() {
|
|
1177
1221
|
var e;
|
|
1178
|
-
|
|
1222
|
+
Re.value = !1, t == null || t.clearFind(), (e = oe.value) == null || e.focus();
|
|
1179
1223
|
}
|
|
1180
|
-
function
|
|
1181
|
-
(e.ctrlKey || e.metaKey) && (e.key === "f" || e.key === "F") && (e.preventDefault(),
|
|
1224
|
+
function vl(e) {
|
|
1225
|
+
(e.ctrlKey || e.metaKey) && (e.key === "f" || e.key === "F") && (e.preventDefault(), Mt());
|
|
1182
1226
|
}
|
|
1183
|
-
const ut =
|
|
1227
|
+
const ut = k(0), de = M(() => {
|
|
1184
1228
|
var e;
|
|
1185
1229
|
return ut.value, (e = t == null ? void 0 : t.getFilterPopup()) != null ? e : null;
|
|
1186
1230
|
});
|
|
1187
|
-
function
|
|
1231
|
+
function cl() {
|
|
1188
1232
|
t == null || t.toggleAutoFilter();
|
|
1189
1233
|
}
|
|
1190
|
-
function
|
|
1191
|
-
const e =
|
|
1234
|
+
function fl() {
|
|
1235
|
+
const e = fe.value, l = ce.value;
|
|
1192
1236
|
if (!e || !l) return;
|
|
1193
1237
|
const n = e.freeze;
|
|
1194
1238
|
if (n.frozenRows || n.frozenCols)
|
|
@@ -1197,49 +1241,113 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
1197
1241
|
const a = t == null ? void 0 : t.getActiveCell();
|
|
1198
1242
|
e.freeze = { frozenRows: a ? a.row : 1, frozenCols: a ? a.col : 0 };
|
|
1199
1243
|
}
|
|
1200
|
-
l.rebuildMetrics(), t == null || t.refreshContentSize(),
|
|
1244
|
+
l.rebuildMetrics(), t == null || t.refreshContentSize(), Le();
|
|
1201
1245
|
}
|
|
1202
|
-
const
|
|
1203
|
-
async function
|
|
1204
|
-
var
|
|
1205
|
-
|
|
1206
|
-
const l = e.scope === "all" ? "all" : "active", n = e.scope === "selection" && (
|
|
1246
|
+
const Pe = k(!1);
|
|
1247
|
+
async function ml(e) {
|
|
1248
|
+
var T;
|
|
1249
|
+
Pe.value = !1;
|
|
1250
|
+
const l = e.scope === "all" ? "all" : "active", n = e.scope === "selection" && (T = J.value) != null ? T : void 0, a = {
|
|
1207
1251
|
target: l,
|
|
1208
1252
|
range: n,
|
|
1209
1253
|
scale: e.scale,
|
|
1210
1254
|
includeHeaders: e.includeHeaders,
|
|
1211
1255
|
gridlines: e.gridlines
|
|
1212
|
-
}, h =
|
|
1256
|
+
}, h = ge(W(W({}, e.format !== "auto" ? { format: e.format } : {}), e.orientation !== "auto" ? { orientation: e.orientation } : {}), {
|
|
1213
1257
|
fitToWidth: e.fitToWidth
|
|
1214
1258
|
});
|
|
1215
1259
|
try {
|
|
1216
|
-
e.action === "png" ? await
|
|
1217
|
-
} catch (
|
|
1218
|
-
ot(
|
|
1260
|
+
e.action === "png" ? await Fe(a) : e.action === "pdf" ? await Ie(ge(W(W({}, a), h), { vector: e.pdfVector })) : await Me(W(W({}, a), h));
|
|
1261
|
+
} catch (p) {
|
|
1262
|
+
ot(p);
|
|
1219
1263
|
}
|
|
1220
1264
|
}
|
|
1221
|
-
function
|
|
1265
|
+
function pl(e) {
|
|
1222
1266
|
t == null || t.setSelectionRange(e);
|
|
1223
1267
|
}
|
|
1224
|
-
const
|
|
1225
|
-
load: (e) =>
|
|
1226
|
-
getWorkbook: () =>
|
|
1227
|
-
getActiveSheet: () =>
|
|
1268
|
+
const De = {
|
|
1269
|
+
load: (e) => Z(e, v),
|
|
1270
|
+
getWorkbook: () => x.value,
|
|
1271
|
+
getActiveSheet: () => q.value,
|
|
1228
1272
|
setActiveSheet: (e) => {
|
|
1229
1273
|
var l;
|
|
1230
|
-
(l =
|
|
1274
|
+
(l = x.value) != null && l.sheets[e] && (q.value = e);
|
|
1275
|
+
},
|
|
1276
|
+
getSelection: () => J.value,
|
|
1277
|
+
setSelection: pl,
|
|
1278
|
+
scrollToCell: (e, l, n) => {
|
|
1279
|
+
var a;
|
|
1280
|
+
return (a = t == null ? void 0 : t.scrollToCell(e, l, n)) != null ? a : !1;
|
|
1231
1281
|
},
|
|
1232
|
-
getSelection: () => te.value,
|
|
1233
|
-
setSelection: ml,
|
|
1234
1282
|
rectOf: st,
|
|
1235
1283
|
rectOfRange: at,
|
|
1236
|
-
redraw: () =>
|
|
1284
|
+
redraw: () => Le(),
|
|
1237
1285
|
isCellEditable: (e, l) => {
|
|
1238
1286
|
var n;
|
|
1239
1287
|
return (n = t == null ? void 0 : t.isCellEditable(e, l)) != null ? n : !1;
|
|
1240
1288
|
},
|
|
1241
1289
|
setEditableTargets: (e) => t == null ? void 0 : t.setEditableTargets(e),
|
|
1242
1290
|
getEditableTargets: () => t == null ? void 0 : t.getEditableTargets(),
|
|
1291
|
+
sortActiveColumn: (e) => {
|
|
1292
|
+
var l;
|
|
1293
|
+
return (l = t == null ? void 0 : t.sortActiveColumn(e)) != null ? l : !1;
|
|
1294
|
+
},
|
|
1295
|
+
createPivotTable: (e) => {
|
|
1296
|
+
var l;
|
|
1297
|
+
return (l = t == null ? void 0 : t.createPivotTable(e)) != null ? l : !1;
|
|
1298
|
+
},
|
|
1299
|
+
createPivotTableFromSelection: (e) => {
|
|
1300
|
+
var l;
|
|
1301
|
+
return (l = t == null ? void 0 : t.createPivotTableFromSelection(e)) != null ? l : !1;
|
|
1302
|
+
},
|
|
1303
|
+
openPivotTableDialog: () => {
|
|
1304
|
+
var e;
|
|
1305
|
+
return (e = t == null ? void 0 : t.openPivotTableDialog()) != null ? e : !1;
|
|
1306
|
+
},
|
|
1307
|
+
getConditionalRules: () => {
|
|
1308
|
+
var e;
|
|
1309
|
+
return (e = t == null ? void 0 : t.getConditionalRules()) != null ? e : [];
|
|
1310
|
+
},
|
|
1311
|
+
addConditionalRule: (e) => {
|
|
1312
|
+
var l;
|
|
1313
|
+
return (l = t == null ? void 0 : t.addConditionalRule(e)) != null ? l : !1;
|
|
1314
|
+
},
|
|
1315
|
+
updateConditionalRule: (e, l) => {
|
|
1316
|
+
var n;
|
|
1317
|
+
return (n = t == null ? void 0 : t.updateConditionalRule(e, l)) != null ? n : !1;
|
|
1318
|
+
},
|
|
1319
|
+
removeConditionalRule: (e) => {
|
|
1320
|
+
var l;
|
|
1321
|
+
return (l = t == null ? void 0 : t.removeConditionalRule(e)) != null ? l : !1;
|
|
1322
|
+
},
|
|
1323
|
+
setConditionalRules: (e) => {
|
|
1324
|
+
var l;
|
|
1325
|
+
return (l = t == null ? void 0 : t.setConditionalRules(e)) != null ? l : !1;
|
|
1326
|
+
},
|
|
1327
|
+
openConditionalFormatDialog: () => {
|
|
1328
|
+
var e;
|
|
1329
|
+
return (e = t == null ? void 0 : t.openConditionalFormatDialog()) != null ? e : !1;
|
|
1330
|
+
},
|
|
1331
|
+
setSelectionNumberFormat: (e) => {
|
|
1332
|
+
var l;
|
|
1333
|
+
return (l = t == null ? void 0 : t.setSelectionNumberFormat(e)) != null ? l : !1;
|
|
1334
|
+
},
|
|
1335
|
+
openNumberFormatDialog: () => {
|
|
1336
|
+
var e;
|
|
1337
|
+
return (e = t == null ? void 0 : t.openNumberFormatDialog()) != null ? e : !1;
|
|
1338
|
+
},
|
|
1339
|
+
getCellComment: (e, l) => {
|
|
1340
|
+
var n;
|
|
1341
|
+
return (n = t == null ? void 0 : t.getCellComment(e, l)) != null ? n : "";
|
|
1342
|
+
},
|
|
1343
|
+
setCellComment: (e, l, n) => {
|
|
1344
|
+
var a;
|
|
1345
|
+
return (a = t == null ? void 0 : t.setCellComment(e, l, n)) != null ? a : !1;
|
|
1346
|
+
},
|
|
1347
|
+
openCommentEditor: (e, l) => {
|
|
1348
|
+
var n;
|
|
1349
|
+
return (n = t == null ? void 0 : t.openCommentEditor(e, l)) != null ? n : !1;
|
|
1350
|
+
},
|
|
1243
1351
|
editCell: (e, l, n) => {
|
|
1244
1352
|
var a;
|
|
1245
1353
|
return (a = t == null ? void 0 : t.editCell(e, l, n)) != null ? a : !1;
|
|
@@ -1292,9 +1400,18 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
1292
1400
|
var n;
|
|
1293
1401
|
return (n = t == null ? void 0 : t.pasteText(e, l)) != null ? n : !1;
|
|
1294
1402
|
},
|
|
1295
|
-
pasteRichHtml: (e, l) => {
|
|
1296
|
-
var
|
|
1297
|
-
return (
|
|
1403
|
+
pasteRichHtml: (e, l, n) => {
|
|
1404
|
+
var a;
|
|
1405
|
+
return (a = t == null ? void 0 : t.pasteRichHtml(e, l, n)) != null ? a : !1;
|
|
1406
|
+
},
|
|
1407
|
+
getPasteBehavior: () => {
|
|
1408
|
+
var e;
|
|
1409
|
+
return (e = t == null ? void 0 : t.getPasteBehavior()) != null ? e : Il;
|
|
1410
|
+
},
|
|
1411
|
+
setPasteBehavior: (e) => t == null ? void 0 : t.setPasteBehavior(e),
|
|
1412
|
+
openPasteConfigDialog: () => {
|
|
1413
|
+
var e;
|
|
1414
|
+
return (e = t == null ? void 0 : t.openPasteConfigDialog()) != null ? e : !1;
|
|
1298
1415
|
},
|
|
1299
1416
|
pasteImageBlob: (e, l) => {
|
|
1300
1417
|
var n;
|
|
@@ -1354,11 +1471,11 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
1354
1471
|
var l;
|
|
1355
1472
|
return (l = t == null ? void 0 : t.convertAllImagesToCells(e)) != null ? l : 0;
|
|
1356
1473
|
},
|
|
1357
|
-
convertImagesInRangeToCell: (e) =>
|
|
1474
|
+
convertImagesInRangeToCell: (e) => Y({}, async (l) => {
|
|
1358
1475
|
var n, a;
|
|
1359
1476
|
return (n = l.onProgress) == null || n.call(l, { stage: "convert", label: "选区浮动图批量嵌入…", ratio: void 0 }), (a = t == null ? void 0 : t.convertImagesInRangeToCell(e)) != null ? a : 0;
|
|
1360
1477
|
}),
|
|
1361
|
-
convertCellImagesInRangeToFloat: (e, l) =>
|
|
1478
|
+
convertCellImagesInRangeToFloat: (e, l) => Y({}, async (n) => {
|
|
1362
1479
|
var a, h;
|
|
1363
1480
|
return (a = n.onProgress) == null || a.call(n, { stage: "convert", label: "选区内嵌图批量浮动化…", ratio: void 0 }), (h = t == null ? void 0 : t.convertCellImagesInRangeToFloat(e, l)) != null ? h : 0;
|
|
1364
1481
|
}),
|
|
@@ -1455,13 +1572,13 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
1455
1572
|
var e;
|
|
1456
1573
|
return (e = t == null ? void 0 : t.resetToOriginal()) != null ? e : !1;
|
|
1457
1574
|
},
|
|
1458
|
-
exportImage:
|
|
1459
|
-
downloadImage:
|
|
1575
|
+
exportImage: dl,
|
|
1576
|
+
downloadImage: Fe,
|
|
1460
1577
|
exportPdf: rl,
|
|
1461
|
-
downloadPdf:
|
|
1462
|
-
print:
|
|
1463
|
-
exportXlsx: (e) =>
|
|
1464
|
-
downloadXlsx: (e) =>
|
|
1578
|
+
downloadPdf: Ie,
|
|
1579
|
+
print: Me,
|
|
1580
|
+
exportXlsx: (e) => Y(e, (l) => t.exportXlsx(l)),
|
|
1581
|
+
downloadXlsx: (e) => Y(e, (l) => t.downloadXlsx(l)),
|
|
1465
1582
|
exportJson: (e) => {
|
|
1466
1583
|
var l;
|
|
1467
1584
|
return (l = t == null ? void 0 : t.exportJson(e)) != null ? l : "{}";
|
|
@@ -1474,208 +1591,262 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
1474
1591
|
downloadCsv: (e) => t == null ? void 0 : t.downloadCsv(e),
|
|
1475
1592
|
// ---- 数据读取(委托独立函数,自动绑 date1904 + 默认当前表) ----
|
|
1476
1593
|
getCellValue: (e, l, n) => {
|
|
1477
|
-
const a =
|
|
1478
|
-
return a ?
|
|
1594
|
+
const a = Ae(n);
|
|
1595
|
+
return a ? Al(a, e, l) : null;
|
|
1479
1596
|
},
|
|
1480
1597
|
getCellText: (e, l, n) => {
|
|
1481
|
-
var h,
|
|
1482
|
-
const a =
|
|
1483
|
-
return a ?
|
|
1598
|
+
var h, T;
|
|
1599
|
+
const a = Ae(n);
|
|
1600
|
+
return a ? Dl(a, e, l, (T = (h = x.value) == null ? void 0 : h.date1904) != null ? T : !1) : "";
|
|
1484
1601
|
},
|
|
1485
1602
|
getSheetData: (e, l) => {
|
|
1486
|
-
const n =
|
|
1487
|
-
return n ?
|
|
1603
|
+
const n = Ae(l);
|
|
1604
|
+
return n ? Pl(n, dt(e)) : [];
|
|
1488
1605
|
},
|
|
1489
1606
|
getSheetJSON: (e, l) => {
|
|
1490
|
-
const n =
|
|
1491
|
-
return n ?
|
|
1607
|
+
const n = Ae(l);
|
|
1608
|
+
return n ? Rl(n, dt(e)) : [];
|
|
1492
1609
|
},
|
|
1493
1610
|
getRangeData: (e, l, n) => {
|
|
1494
|
-
const a =
|
|
1495
|
-
return a ?
|
|
1611
|
+
const a = Ae(n);
|
|
1612
|
+
return a ? Ml(a, e, dt(l)) : [];
|
|
1496
1613
|
}
|
|
1497
1614
|
};
|
|
1498
|
-
function
|
|
1615
|
+
function Ae(e) {
|
|
1499
1616
|
var n;
|
|
1500
|
-
const l =
|
|
1501
|
-
return l && (n = l.sheets[e != null ? e :
|
|
1617
|
+
const l = x.value;
|
|
1618
|
+
return l && (n = l.sheets[e != null ? e : q.value]) != null ? n : null;
|
|
1502
1619
|
}
|
|
1503
|
-
function
|
|
1620
|
+
function dt(e) {
|
|
1504
1621
|
var l, n;
|
|
1505
|
-
return
|
|
1622
|
+
return ge(W({}, e), { date1904: (n = (l = x.value) == null ? void 0 : l.date1904) != null ? n : !1 });
|
|
1506
1623
|
}
|
|
1507
|
-
|
|
1508
|
-
const
|
|
1509
|
-
function
|
|
1510
|
-
return
|
|
1624
|
+
C(De);
|
|
1625
|
+
const V = (e) => Ue[e];
|
|
1626
|
+
function E(e) {
|
|
1627
|
+
return W({ kind: "builtin" }, e);
|
|
1511
1628
|
}
|
|
1512
|
-
function
|
|
1513
|
-
var l, n, a, h,
|
|
1629
|
+
function gl(e) {
|
|
1630
|
+
var l, n, a, h, T;
|
|
1514
1631
|
switch (e) {
|
|
1515
1632
|
case "find":
|
|
1516
|
-
return
|
|
1633
|
+
return E({
|
|
1517
1634
|
id: e,
|
|
1518
|
-
iconSvg:
|
|
1635
|
+
iconSvg: V("find"),
|
|
1519
1636
|
label: "查找",
|
|
1520
1637
|
title: "查找 (Ctrl+F)",
|
|
1521
|
-
active:
|
|
1522
|
-
onClick: () =>
|
|
1638
|
+
active: Re.value,
|
|
1639
|
+
onClick: () => Re.value ? Rt() : Mt()
|
|
1523
1640
|
});
|
|
1524
1641
|
case "filter":
|
|
1525
|
-
return
|
|
1642
|
+
return E({
|
|
1526
1643
|
id: e,
|
|
1527
|
-
iconSvg:
|
|
1644
|
+
iconSvg: V("filter"),
|
|
1528
1645
|
label: "筛选",
|
|
1529
1646
|
title: "切换自动筛选",
|
|
1530
|
-
active: !!((l =
|
|
1531
|
-
onClick:
|
|
1647
|
+
active: !!((l = fe.value) != null && l.autoFilterRange),
|
|
1648
|
+
onClick: cl
|
|
1532
1649
|
});
|
|
1533
1650
|
case "clear-filter":
|
|
1534
|
-
return
|
|
1651
|
+
return E({
|
|
1535
1652
|
id: e,
|
|
1536
|
-
iconSvg:
|
|
1653
|
+
iconSvg: V("clear-filter"),
|
|
1537
1654
|
label: "清除筛选",
|
|
1538
1655
|
title: "清除当前表全部筛选",
|
|
1539
1656
|
disabled: !(t != null && t.hasFilters()),
|
|
1540
1657
|
onClick: () => t == null ? void 0 : t.clearAllFilters()
|
|
1541
1658
|
});
|
|
1659
|
+
case "sort": {
|
|
1660
|
+
const p = t == null ? void 0 : t.getSortState(), L = t == null ? void 0 : t.getActiveCell(), j = !L || !fe.value;
|
|
1661
|
+
return E({
|
|
1662
|
+
id: e,
|
|
1663
|
+
iconSvg: V("sort"),
|
|
1664
|
+
label: "排序",
|
|
1665
|
+
title: L ? `按 ${Ce(L.col)} 列排序` : "选中一个单元格后按该列排序",
|
|
1666
|
+
active: !!(L && (p == null ? void 0 : p.col) === L.col && p.dir),
|
|
1667
|
+
disabled: j,
|
|
1668
|
+
items: [
|
|
1669
|
+
E({
|
|
1670
|
+
id: "sort-asc",
|
|
1671
|
+
label: "升序 (A → Z / 小 → 大)",
|
|
1672
|
+
active: !!(L && (p == null ? void 0 : p.col) === L.col && p.dir === "asc"),
|
|
1673
|
+
disabled: j,
|
|
1674
|
+
onClick: () => t == null ? void 0 : t.sortActiveColumn("asc")
|
|
1675
|
+
}),
|
|
1676
|
+
E({
|
|
1677
|
+
id: "sort-desc",
|
|
1678
|
+
label: "降序 (Z → A / 大 → 小)",
|
|
1679
|
+
active: !!(L && (p == null ? void 0 : p.col) === L.col && p.dir === "desc"),
|
|
1680
|
+
disabled: j,
|
|
1681
|
+
onClick: () => t == null ? void 0 : t.sortActiveColumn("desc")
|
|
1682
|
+
})
|
|
1683
|
+
]
|
|
1684
|
+
});
|
|
1685
|
+
}
|
|
1542
1686
|
case "copy":
|
|
1543
|
-
return
|
|
1687
|
+
return E({
|
|
1544
1688
|
id: e,
|
|
1545
|
-
iconSvg:
|
|
1689
|
+
iconSvg: V("copy"),
|
|
1546
1690
|
label: "复制",
|
|
1547
1691
|
title: "复制选区 (Ctrl+C)",
|
|
1548
|
-
disabled: !
|
|
1692
|
+
disabled: !J.value,
|
|
1549
1693
|
onClick: () => void (t == null ? void 0 : t.copySelection())
|
|
1550
1694
|
});
|
|
1695
|
+
case "pivot-table":
|
|
1696
|
+
return o.pivotTable ? E({
|
|
1697
|
+
id: e,
|
|
1698
|
+
iconSvg: V("pivot-table"),
|
|
1699
|
+
label: "透视表",
|
|
1700
|
+
title: "选择字段并基于当前选区创建静态透视汇总表",
|
|
1701
|
+
disabled: !J.value || !o.editable,
|
|
1702
|
+
onClick: () => t == null ? void 0 : t.openPivotTableDialog()
|
|
1703
|
+
}) : null;
|
|
1704
|
+
case "conditional-format":
|
|
1705
|
+
return o.conditionalFormat ? E({
|
|
1706
|
+
id: e,
|
|
1707
|
+
iconSvg: V("conditional-format"),
|
|
1708
|
+
label: "条件格式",
|
|
1709
|
+
title: "管理条件格式规则(新建/编辑/删除;新建套到当前选区)",
|
|
1710
|
+
disabled: !o.editable,
|
|
1711
|
+
onClick: () => t == null ? void 0 : t.openConditionalFormatDialog()
|
|
1712
|
+
}) : null;
|
|
1713
|
+
case "number-format":
|
|
1714
|
+
return E({
|
|
1715
|
+
id: e,
|
|
1716
|
+
iconSvg: V("number-format"),
|
|
1717
|
+
label: "数字格式",
|
|
1718
|
+
title: "设置单元格数字格式(数值/货币/百分比/日期/自定义)",
|
|
1719
|
+
disabled: !J.value || !o.editable,
|
|
1720
|
+
onClick: () => t == null ? void 0 : t.openNumberFormatDialog()
|
|
1721
|
+
});
|
|
1551
1722
|
case "wrap-text": {
|
|
1552
|
-
const
|
|
1553
|
-
return
|
|
1723
|
+
const p = (n = t == null ? void 0 : t.getSelectionWrapState()) != null ? n : "none";
|
|
1724
|
+
return E({
|
|
1554
1725
|
id: e,
|
|
1555
|
-
iconSvg:
|
|
1726
|
+
iconSvg: V("wrap-text"),
|
|
1556
1727
|
label: "自动换行",
|
|
1557
1728
|
title: "自动换行(选区,WPS 风格 toggle)",
|
|
1558
|
-
active:
|
|
1559
|
-
disabled: !
|
|
1729
|
+
active: p === "all",
|
|
1730
|
+
disabled: !J.value || !o.editable,
|
|
1560
1731
|
onClick: () => void (t == null ? void 0 : t.toggleWrapTextOnSelection())
|
|
1561
1732
|
});
|
|
1562
1733
|
}
|
|
1563
1734
|
case "template": {
|
|
1564
|
-
const
|
|
1565
|
-
return
|
|
1735
|
+
const p = !!ke.value, L = xe.value, j = !!o.src && !o.workbook;
|
|
1736
|
+
return E({
|
|
1566
1737
|
id: e,
|
|
1567
|
-
iconSvg:
|
|
1738
|
+
iconSvg: V("template"),
|
|
1568
1739
|
label: "模板",
|
|
1569
|
-
title:
|
|
1570
|
-
active:
|
|
1571
|
-
disabled:
|
|
1740
|
+
title: j ? "模板仅对 JSON / 模型数据源生效;当前是 .xlsx 数据源,模板不可用" : p ? `模板已加载:${L || "(未命名)"}` : "为 JSON / 模型数据源套用 .xlsx 模板的样式(边框 / 字体 / 列宽 / 合并 等);模板的文字内容会被丢弃",
|
|
1741
|
+
active: p,
|
|
1742
|
+
disabled: j,
|
|
1572
1743
|
items: [
|
|
1573
|
-
|
|
1744
|
+
E({
|
|
1574
1745
|
id: "tpl-default",
|
|
1575
|
-
label: (
|
|
1746
|
+
label: (p ? "" : "✓ ") + "默认渲染",
|
|
1576
1747
|
title: "不套模板,数据按默认样式渲染",
|
|
1577
|
-
disabled: !
|
|
1578
|
-
onClick:
|
|
1748
|
+
disabled: !p,
|
|
1749
|
+
onClick: Ct
|
|
1579
1750
|
}),
|
|
1580
|
-
|
|
1581
|
-
|
|
1751
|
+
E({ id: "tpl-sep", type: "separator" }),
|
|
1752
|
+
E({
|
|
1582
1753
|
id: "tpl-import",
|
|
1583
1754
|
label: "导入 .xlsx 模板…",
|
|
1584
1755
|
title: "选一份 .xlsx,把它的 styling(边框/字体/列宽/合并/freeze) 套到当前 JSON 数据上;模板的文字内容会被丢弃",
|
|
1585
1756
|
onClick: Ht
|
|
1586
1757
|
}),
|
|
1587
|
-
|
|
1758
|
+
E({
|
|
1588
1759
|
id: "tpl-clear",
|
|
1589
1760
|
label: "清除模板",
|
|
1590
1761
|
title: "切回默认样式渲染",
|
|
1591
|
-
disabled: !
|
|
1592
|
-
onClick:
|
|
1762
|
+
disabled: !p,
|
|
1763
|
+
onClick: Ct
|
|
1593
1764
|
})
|
|
1594
1765
|
]
|
|
1595
1766
|
});
|
|
1596
1767
|
}
|
|
1597
1768
|
case "image-tools": {
|
|
1598
|
-
const
|
|
1599
|
-
return
|
|
1769
|
+
const p = J.value, L = t == null ? void 0 : t.getActiveCell(), j = ((h = (a = fe.value) == null ? void 0 : a.images.length) != null ? h : 0) > 0;
|
|
1770
|
+
return E({
|
|
1600
1771
|
id: e,
|
|
1601
|
-
iconSvg:
|
|
1772
|
+
iconSvg: V("image-tools"),
|
|
1602
1773
|
label: "图片工具",
|
|
1603
1774
|
title: "浮动图 ⇄ 单元格内嵌图(WPS DISPIMG)互转",
|
|
1604
|
-
disabled: !
|
|
1775
|
+
disabled: !o.editable,
|
|
1605
1776
|
items: [
|
|
1606
|
-
|
|
1777
|
+
E({
|
|
1607
1778
|
id: "img-sel-to-cell",
|
|
1608
1779
|
label: "选区:浮动 → 嵌入",
|
|
1609
1780
|
title: '把选区里"中心格在选区内"的浮动图,就近嵌入',
|
|
1610
|
-
disabled: !
|
|
1611
|
-
onClick: () =>
|
|
1781
|
+
disabled: !p || !j,
|
|
1782
|
+
onClick: () => p && (t == null ? void 0 : t.convertImagesInRangeToCell(p))
|
|
1612
1783
|
}),
|
|
1613
|
-
|
|
1784
|
+
E({
|
|
1614
1785
|
id: "img-sel-to-float",
|
|
1615
1786
|
label: "选区:嵌入 → 浮动",
|
|
1616
1787
|
title: "把选区内所有 DISPIMG 格拎成浮动图",
|
|
1617
|
-
disabled: !
|
|
1618
|
-
onClick: () =>
|
|
1788
|
+
disabled: !p,
|
|
1789
|
+
onClick: () => p && (t == null ? void 0 : t.convertCellImagesInRangeToFloat(p))
|
|
1619
1790
|
}),
|
|
1620
|
-
|
|
1621
|
-
|
|
1791
|
+
E({ id: "img-sep", type: "separator" }),
|
|
1792
|
+
E({
|
|
1622
1793
|
id: "img-all-to-cell",
|
|
1623
1794
|
label: "整表:浮动 → 嵌入",
|
|
1624
1795
|
title: "全表浮动图按几何就近嵌入各自单元格",
|
|
1625
|
-
disabled: !
|
|
1796
|
+
disabled: !j,
|
|
1626
1797
|
onClick: () => t == null ? void 0 : t.convertAllImagesToCells()
|
|
1627
1798
|
}),
|
|
1628
|
-
|
|
1799
|
+
E({
|
|
1629
1800
|
id: "img-col-to-cell",
|
|
1630
1801
|
label: "整列:浮动 → 嵌入(活动列)",
|
|
1631
1802
|
title: "把中心落在活动列的浮动图就近嵌入",
|
|
1632
|
-
disabled: !
|
|
1633
|
-
onClick: () =>
|
|
1803
|
+
disabled: !j || !L,
|
|
1804
|
+
onClick: () => L && (t == null ? void 0 : t.convertAllImagesToCells(L.col))
|
|
1634
1805
|
})
|
|
1635
1806
|
]
|
|
1636
1807
|
});
|
|
1637
1808
|
}
|
|
1638
1809
|
case "freeze": {
|
|
1639
|
-
const
|
|
1640
|
-
return
|
|
1810
|
+
const p = (T = fe.value) == null ? void 0 : T.freeze;
|
|
1811
|
+
return E({
|
|
1641
1812
|
id: e,
|
|
1642
|
-
iconSvg:
|
|
1813
|
+
iconSvg: V("freeze"),
|
|
1643
1814
|
label: "冻结",
|
|
1644
1815
|
title: "冻结/取消冻结(在活动单元格)",
|
|
1645
|
-
active: !!(
|
|
1646
|
-
onClick:
|
|
1816
|
+
active: !!(p && (p.frozenRows || p.frozenCols)),
|
|
1817
|
+
onClick: fl
|
|
1647
1818
|
});
|
|
1648
1819
|
}
|
|
1649
1820
|
case "export":
|
|
1650
|
-
return
|
|
1821
|
+
return E({
|
|
1651
1822
|
id: e,
|
|
1652
|
-
iconSvg:
|
|
1823
|
+
iconSvg: V("export"),
|
|
1653
1824
|
label: "导出",
|
|
1654
1825
|
title: "导出 / 打印",
|
|
1655
1826
|
items: [
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1827
|
+
E({ id: "export-png", label: "导出为图片 (PNG)", onClick: () => void Fe() }),
|
|
1828
|
+
E({ id: "export-pdf", label: "导出为 PDF (位图)", onClick: Ft }),
|
|
1829
|
+
E({ id: "export-pdf-vector", label: "导出为 PDF (矢量·文字可选)", onClick: It }),
|
|
1830
|
+
E({ id: "export-print", label: "打印…", onClick: () => void Me() }),
|
|
1831
|
+
E({ id: "export-sep", type: "separator" }),
|
|
1832
|
+
E({ id: "export-settings", label: "导出设置…", onClick: () => Pe.value = !0 })
|
|
1662
1833
|
]
|
|
1663
1834
|
});
|
|
1664
1835
|
case "zoom":
|
|
1665
|
-
return
|
|
1836
|
+
return E({
|
|
1666
1837
|
id: e,
|
|
1667
|
-
iconSvg:
|
|
1668
|
-
label: Math.round(
|
|
1838
|
+
iconSvg: V("zoom"),
|
|
1839
|
+
label: Math.round(X.value * 100) + "%",
|
|
1669
1840
|
title: "缩放",
|
|
1670
1841
|
items: [50, 75, 100, 125, 150, 200].map(
|
|
1671
|
-
(
|
|
1842
|
+
(p) => E({ id: "zoom-" + p, label: p + "%", active: Math.round(X.value * 100) === p, onClick: () => X.value = p / 100 })
|
|
1672
1843
|
)
|
|
1673
1844
|
});
|
|
1674
1845
|
default:
|
|
1675
1846
|
return null;
|
|
1676
1847
|
}
|
|
1677
1848
|
}
|
|
1678
|
-
function
|
|
1849
|
+
function rt(e, l) {
|
|
1679
1850
|
var n, a, h;
|
|
1680
1851
|
return {
|
|
1681
1852
|
id: e.id,
|
|
@@ -1684,135 +1855,135 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
1684
1855
|
icon: e.icon,
|
|
1685
1856
|
label: e.label,
|
|
1686
1857
|
title: e.title,
|
|
1687
|
-
active: !!((n = e.active) != null && n.call(e,
|
|
1688
|
-
disabled: !!((a = e.disabled) != null && a.call(e,
|
|
1689
|
-
onClick: e.onClick ? () => e.onClick(
|
|
1690
|
-
items: (h = e.items) == null ? void 0 : h.map((
|
|
1858
|
+
active: !!((n = e.active) != null && n.call(e, De)),
|
|
1859
|
+
disabled: !!((a = e.disabled) != null && a.call(e, De)),
|
|
1860
|
+
onClick: e.onClick ? () => e.onClick(De) : void 0,
|
|
1861
|
+
items: (h = e.items) == null ? void 0 : h.map((T) => rt(T, l)),
|
|
1691
1862
|
kind: l
|
|
1692
1863
|
};
|
|
1693
1864
|
}
|
|
1694
|
-
const vt =
|
|
1865
|
+
const vt = M(() => {
|
|
1695
1866
|
var n;
|
|
1696
|
-
if (
|
|
1697
|
-
const e = Array.isArray(
|
|
1867
|
+
if (ie.value, ne.value, it.value, ut.value, o.toolbar === !1) return [];
|
|
1868
|
+
const e = Array.isArray(o.toolbar) ? o.toolbar : ["find", "filter", "sort"], l = [];
|
|
1698
1869
|
for (const a of e)
|
|
1699
1870
|
if (typeof a == "string")
|
|
1700
1871
|
if (a === "separator" || a === "|") l.push({ id: "sep-" + l.length, type: "separator", kind: "builtin" });
|
|
1701
1872
|
else {
|
|
1702
|
-
const h =
|
|
1873
|
+
const h = gl(a);
|
|
1703
1874
|
h && l.push(h);
|
|
1704
1875
|
}
|
|
1705
1876
|
else
|
|
1706
|
-
l.push(
|
|
1877
|
+
l.push(rt(a, "custom"));
|
|
1707
1878
|
for (const a of y.value)
|
|
1708
|
-
for (const h of (n = a.toolbar) != null ? n : []) l.push(
|
|
1879
|
+
for (const h of (n = a.toolbar) != null ? n : []) l.push(rt(h, "plugin"));
|
|
1709
1880
|
return l;
|
|
1710
|
-
}),
|
|
1711
|
-
let
|
|
1712
|
-
function
|
|
1881
|
+
}), bl = M(() => o.toolbar !== !1 && vt.value.length > 0), Oe = /* @__PURE__ */ new Map();
|
|
1882
|
+
let He = [];
|
|
1883
|
+
function pe(e, l) {
|
|
1713
1884
|
var n;
|
|
1714
|
-
z(e, l), (n =
|
|
1885
|
+
z(e, l), (n = Oe.get(e)) == null || n.forEach((a) => a(l));
|
|
1715
1886
|
}
|
|
1716
|
-
function
|
|
1887
|
+
function Pt() {
|
|
1717
1888
|
var n;
|
|
1718
|
-
|
|
1889
|
+
He.forEach((a) => a()), He = [], Oe.clear();
|
|
1719
1890
|
const e = (a, h) => {
|
|
1720
|
-
let
|
|
1721
|
-
|
|
1722
|
-
}, l = { viewer:
|
|
1891
|
+
let T = Oe.get(a);
|
|
1892
|
+
T || Oe.set(a, T = /* @__PURE__ */ new Set()), T.add(h);
|
|
1893
|
+
}, l = { viewer: De, on: e, redraw: () => Le() };
|
|
1723
1894
|
for (const a of y.value) {
|
|
1724
1895
|
if (a.events)
|
|
1725
|
-
for (const [
|
|
1896
|
+
for (const [T, p] of Object.entries(a.events)) p && e(T, p);
|
|
1726
1897
|
const h = (n = a.setup) == null ? void 0 : n.call(a, l);
|
|
1727
|
-
typeof h == "function" &&
|
|
1898
|
+
typeof h == "function" && He.push(h);
|
|
1728
1899
|
}
|
|
1729
1900
|
}
|
|
1730
|
-
const ct =
|
|
1731
|
-
let
|
|
1732
|
-
function
|
|
1733
|
-
const e = { rectOf: st, rectOfRange: at, tick:
|
|
1734
|
-
|
|
1901
|
+
const ct = k(null);
|
|
1902
|
+
let re = null;
|
|
1903
|
+
function Cl() {
|
|
1904
|
+
const e = { rectOf: st, rectOfRange: at, tick: ie.value, workbook: x.value };
|
|
1905
|
+
re == null || re.render(y.value, e);
|
|
1735
1906
|
}
|
|
1736
|
-
return
|
|
1907
|
+
return B([ie, y], Cl, { flush: "post" }), (e, l) => (r(), c("div", {
|
|
1737
1908
|
class: "excel-viewer",
|
|
1738
1909
|
ref_key: "rootEl",
|
|
1739
|
-
ref:
|
|
1740
|
-
onKeydown:
|
|
1910
|
+
ref: Jt,
|
|
1911
|
+
onKeydown: vl
|
|
1741
1912
|
}, [
|
|
1742
|
-
|
|
1913
|
+
$(x) ? se(e.$slots, "header", {
|
|
1743
1914
|
key: 0,
|
|
1744
|
-
workbook:
|
|
1745
|
-
zoom:
|
|
1746
|
-
setZoom: (n) =>
|
|
1747
|
-
downloadImage:
|
|
1748
|
-
downloadPdf:
|
|
1749
|
-
print:
|
|
1915
|
+
workbook: $(x),
|
|
1916
|
+
zoom: X.value,
|
|
1917
|
+
setZoom: (n) => X.value = n,
|
|
1918
|
+
downloadImage: Fe,
|
|
1919
|
+
downloadPdf: Ie,
|
|
1920
|
+
print: Me
|
|
1750
1921
|
}, () => [
|
|
1751
|
-
pt(
|
|
1752
|
-
"file-name":
|
|
1753
|
-
"template-name":
|
|
1754
|
-
"sheet-count":
|
|
1755
|
-
zoom:
|
|
1756
|
-
"onUpdate:zoom": l[0] || (l[0] = (n) =>
|
|
1757
|
-
onExportImage: l[1] || (l[1] = (n) =>
|
|
1758
|
-
onExportPdf:
|
|
1759
|
-
onExportPdfVector:
|
|
1760
|
-
onPrint: l[2] || (l[2] = (n) =>
|
|
1761
|
-
onOpenSettings: l[3] || (l[3] = (n) =>
|
|
1922
|
+
pt(Gl, {
|
|
1923
|
+
"file-name": Kt.value,
|
|
1924
|
+
"template-name": xe.value,
|
|
1925
|
+
"sheet-count": $(x).sheets.filter((n) => n.state === "visible").length,
|
|
1926
|
+
zoom: X.value,
|
|
1927
|
+
"onUpdate:zoom": l[0] || (l[0] = (n) => X.value = n),
|
|
1928
|
+
onExportImage: l[1] || (l[1] = (n) => Fe()),
|
|
1929
|
+
onExportPdf: Ft,
|
|
1930
|
+
onExportPdfVector: It,
|
|
1931
|
+
onPrint: l[2] || (l[2] = (n) => Me()),
|
|
1932
|
+
onOpenSettings: l[3] || (l[3] = (n) => Pe.value = !0)
|
|
1762
1933
|
}, null, 8, ["file-name", "template-name", "sheet-count", "zoom"])
|
|
1763
|
-
], !0) :
|
|
1764
|
-
|
|
1934
|
+
], !0) : R("", !0),
|
|
1935
|
+
$(x) && bl.value ? se(e.$slots, "toolbar", {
|
|
1765
1936
|
key: 1,
|
|
1766
1937
|
items: vt.value
|
|
1767
1938
|
}, () => [
|
|
1768
|
-
pt(
|
|
1769
|
-
], !0) :
|
|
1770
|
-
|
|
1771
|
-
s("span",
|
|
1772
|
-
l[
|
|
1773
|
-
Xt.value ? (
|
|
1939
|
+
pt(rs, { items: vt.value }, null, 8, ["items"])
|
|
1940
|
+
], !0) : R("", !0),
|
|
1941
|
+
$(x) ? (r(), c("div", Cs, [
|
|
1942
|
+
s("span", ys, I(lt.value || "—"), 1),
|
|
1943
|
+
l[18] || (l[18] = s("span", { class: "fx" }, "fx", -1)),
|
|
1944
|
+
Xt.value ? (r(), c("textarea", {
|
|
1774
1945
|
key: 0,
|
|
1775
1946
|
ref_key: "fbEl",
|
|
1776
|
-
ref:
|
|
1947
|
+
ref: St,
|
|
1777
1948
|
class: "content content-input",
|
|
1778
|
-
value:
|
|
1779
|
-
title:
|
|
1949
|
+
value: Q.value,
|
|
1950
|
+
title: Q.value,
|
|
1780
1951
|
rows: "1",
|
|
1781
1952
|
spellcheck: "false",
|
|
1782
|
-
onFocus:
|
|
1953
|
+
onFocus: Qt,
|
|
1783
1954
|
onInput: Gt,
|
|
1784
|
-
onKeydown:
|
|
1785
|
-
onBlur:
|
|
1786
|
-
}, null, 40,
|
|
1955
|
+
onKeydown: tl,
|
|
1956
|
+
onBlur: el
|
|
1957
|
+
}, null, 40, ks)) : (r(), c("span", {
|
|
1787
1958
|
key: 1,
|
|
1788
1959
|
class: "content",
|
|
1789
|
-
title:
|
|
1790
|
-
},
|
|
1791
|
-
])) :
|
|
1960
|
+
title: $t.value
|
|
1961
|
+
}, I($t.value), 9, xs))
|
|
1962
|
+
])) : R("", !0),
|
|
1792
1963
|
s("div", {
|
|
1793
1964
|
class: "render-area",
|
|
1794
1965
|
ref_key: "renderAreaEl",
|
|
1795
|
-
ref:
|
|
1966
|
+
ref: he
|
|
1796
1967
|
}, [
|
|
1797
1968
|
s("canvas", {
|
|
1798
1969
|
ref_key: "canvasEl",
|
|
1799
|
-
ref:
|
|
1970
|
+
ref: _e,
|
|
1800
1971
|
class: "grid-canvas"
|
|
1801
1972
|
}, null, 512),
|
|
1802
1973
|
s("div", {
|
|
1803
1974
|
class: "ov",
|
|
1804
1975
|
ref_key: "ovMain",
|
|
1805
|
-
ref:
|
|
1976
|
+
ref: Ze
|
|
1806
1977
|
}, null, 512),
|
|
1807
1978
|
s("div", {
|
|
1808
1979
|
class: "ov",
|
|
1809
1980
|
ref_key: "ovFCol",
|
|
1810
|
-
ref:
|
|
1981
|
+
ref: Xe
|
|
1811
1982
|
}, null, 512),
|
|
1812
1983
|
s("div", {
|
|
1813
1984
|
class: "ov",
|
|
1814
1985
|
ref_key: "ovFRow",
|
|
1815
|
-
ref:
|
|
1986
|
+
ref: Ge
|
|
1816
1987
|
}, null, 512),
|
|
1817
1988
|
s("div", {
|
|
1818
1989
|
class: "ov",
|
|
@@ -1822,16 +1993,16 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
1822
1993
|
s("div", {
|
|
1823
1994
|
class: "scroller",
|
|
1824
1995
|
ref_key: "scrollerEl",
|
|
1825
|
-
ref:
|
|
1996
|
+
ref: oe,
|
|
1826
1997
|
tabindex: "0",
|
|
1827
|
-
onScroll:
|
|
1828
|
-
onMousedown:
|
|
1829
|
-
onMousemove:
|
|
1830
|
-
onMouseup:
|
|
1831
|
-
onMouseleave:
|
|
1832
|
-
onDblclick:
|
|
1833
|
-
onKeydown:
|
|
1834
|
-
onContextmenu:
|
|
1998
|
+
onScroll: Zt,
|
|
1999
|
+
onMousedown: ll,
|
|
2000
|
+
onMousemove: sl,
|
|
2001
|
+
onMouseup: al,
|
|
2002
|
+
onMouseleave: ol,
|
|
2003
|
+
onDblclick: il,
|
|
2004
|
+
onKeydown: ul,
|
|
2005
|
+
onContextmenu: nl
|
|
1835
2006
|
}, [
|
|
1836
2007
|
s("div", {
|
|
1837
2008
|
class: "spacer",
|
|
@@ -1839,65 +2010,79 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
1839
2010
|
ref: Ye
|
|
1840
2011
|
}, null, 512)
|
|
1841
2012
|
], 544),
|
|
1842
|
-
|
|
2013
|
+
Re.value && $(x) ? (r(), ve(In, {
|
|
1843
2014
|
key: 0,
|
|
1844
|
-
query:
|
|
1845
|
-
"match-count":
|
|
1846
|
-
current:
|
|
1847
|
-
"match-case":
|
|
1848
|
-
"whole-cell":
|
|
2015
|
+
query: me.value.query,
|
|
2016
|
+
"match-count": me.value.count,
|
|
2017
|
+
current: me.value.index,
|
|
2018
|
+
"match-case": me.value.matchCase,
|
|
2019
|
+
"whole-cell": me.value.wholeCell,
|
|
2020
|
+
editable: !!o.editable,
|
|
2021
|
+
replace: me.value.replace,
|
|
1849
2022
|
"onUpdate:query": l[4] || (l[4] = (n) => {
|
|
1850
2023
|
var a;
|
|
1851
|
-
return (a =
|
|
2024
|
+
return (a = $(t)) == null ? void 0 : a.setFindQuery(n);
|
|
1852
2025
|
}),
|
|
1853
2026
|
"onUpdate:matchCase": l[5] || (l[5] = (n) => {
|
|
1854
2027
|
var a;
|
|
1855
|
-
return (a =
|
|
2028
|
+
return (a = $(t)) == null ? void 0 : a.setFindMatchCase(n);
|
|
1856
2029
|
}),
|
|
1857
2030
|
"onUpdate:wholeCell": l[6] || (l[6] = (n) => {
|
|
1858
2031
|
var a;
|
|
1859
|
-
return (a =
|
|
2032
|
+
return (a = $(t)) == null ? void 0 : a.setFindWholeCell(n);
|
|
2033
|
+
}),
|
|
2034
|
+
"onUpdate:replace": l[7] || (l[7] = (n) => {
|
|
2035
|
+
var a;
|
|
2036
|
+
return (a = $(t)) == null ? void 0 : a.setFindReplace(n);
|
|
2037
|
+
}),
|
|
2038
|
+
onNext: l[8] || (l[8] = (n) => {
|
|
2039
|
+
var a;
|
|
2040
|
+
return (a = $(t)) == null ? void 0 : a.findNext();
|
|
2041
|
+
}),
|
|
2042
|
+
onPrev: l[9] || (l[9] = (n) => {
|
|
2043
|
+
var a;
|
|
2044
|
+
return (a = $(t)) == null ? void 0 : a.findPrev();
|
|
1860
2045
|
}),
|
|
1861
|
-
|
|
2046
|
+
onReplaceOne: l[10] || (l[10] = (n) => {
|
|
1862
2047
|
var a;
|
|
1863
|
-
return (a =
|
|
2048
|
+
return (a = $(t)) == null ? void 0 : a.replaceCurrent();
|
|
1864
2049
|
}),
|
|
1865
|
-
|
|
2050
|
+
onReplaceAll: l[11] || (l[11] = (n) => {
|
|
1866
2051
|
var a;
|
|
1867
|
-
return (a =
|
|
2052
|
+
return (a = $(t)) == null ? void 0 : a.replaceAll();
|
|
1868
2053
|
}),
|
|
1869
|
-
onClose:
|
|
1870
|
-
}, null, 8, ["query", "match-count", "current", "match-case", "whole-cell"])) :
|
|
1871
|
-
|
|
2054
|
+
onClose: Rt
|
|
2055
|
+
}, null, 8, ["query", "match-count", "current", "match-case", "whole-cell", "editable", "replace"])) : R("", !0),
|
|
2056
|
+
de.value ? (r(), ve(Vn, {
|
|
1872
2057
|
key: 1,
|
|
1873
|
-
values:
|
|
1874
|
-
selected:
|
|
1875
|
-
x:
|
|
1876
|
-
y:
|
|
1877
|
-
"sort-dir":
|
|
1878
|
-
onApply: l[
|
|
2058
|
+
values: de.value.values,
|
|
2059
|
+
selected: de.value.selected,
|
|
2060
|
+
x: de.value.x,
|
|
2061
|
+
y: de.value.y,
|
|
2062
|
+
"sort-dir": de.value.sortDir,
|
|
2063
|
+
onApply: l[12] || (l[12] = (n) => {
|
|
1879
2064
|
var a;
|
|
1880
|
-
return (a =
|
|
2065
|
+
return (a = $(t)) == null ? void 0 : a.applyFilterSelection(n);
|
|
1881
2066
|
}),
|
|
1882
|
-
onClear: l[
|
|
2067
|
+
onClear: l[13] || (l[13] = (n) => {
|
|
1883
2068
|
var a;
|
|
1884
|
-
return (a =
|
|
2069
|
+
return (a = $(t)) == null ? void 0 : a.clearFilterColumn();
|
|
1885
2070
|
}),
|
|
1886
|
-
onClose: l[
|
|
2071
|
+
onClose: l[14] || (l[14] = (n) => {
|
|
1887
2072
|
var a;
|
|
1888
|
-
return (a =
|
|
2073
|
+
return (a = $(t)) == null ? void 0 : a.closeFilterPopup();
|
|
1889
2074
|
}),
|
|
1890
|
-
onSort: l[
|
|
1891
|
-
var h,
|
|
1892
|
-
const a = (h =
|
|
1893
|
-
(
|
|
2075
|
+
onSort: l[15] || (l[15] = (n) => {
|
|
2076
|
+
var h, T, p;
|
|
2077
|
+
const a = (h = de.value) == null ? void 0 : h.col;
|
|
2078
|
+
(T = $(t)) == null || T.closeFilterPopup(), a != null && ((p = $(t)) == null || p.sortColumn(a, n));
|
|
1894
2079
|
})
|
|
1895
|
-
}, null, 8, ["values", "selected", "x", "y", "sort-dir"])) :
|
|
1896
|
-
s("div",
|
|
1897
|
-
|
|
2080
|
+
}, null, 8, ["values", "selected", "x", "y", "sort-dir"])) : R("", !0),
|
|
2081
|
+
s("div", ws, [
|
|
2082
|
+
se(e.$slots, "overlay", {
|
|
1898
2083
|
rectOf: st,
|
|
1899
2084
|
rectOfRange: at,
|
|
1900
|
-
tick:
|
|
2085
|
+
tick: ie.value
|
|
1901
2086
|
}, void 0, !0),
|
|
1902
2087
|
s("div", {
|
|
1903
2088
|
ref_key: "pluginOvEl",
|
|
@@ -1909,117 +2094,117 @@ const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
|
1909
2094
|
ref_key: "editorSlotEl",
|
|
1910
2095
|
ref: et
|
|
1911
2096
|
}, null, 512),
|
|
1912
|
-
|
|
2097
|
+
ue.value ? (r(), c("div", {
|
|
1913
2098
|
key: 2,
|
|
1914
|
-
class:
|
|
1915
|
-
style:
|
|
1916
|
-
},
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
progress:
|
|
2099
|
+
class: H(["cell-tooltip", ue.value.kind]),
|
|
2100
|
+
style: Ke({ left: ue.value.x + "px", top: ue.value.y + "px" })
|
|
2101
|
+
}, I(ue.value.text), 7)) : R("", !0),
|
|
2102
|
+
$(D) ? (r(), c("div", hs, [
|
|
2103
|
+
se(e.$slots, "loading", {
|
|
2104
|
+
progress: $(ae),
|
|
1920
2105
|
label: xt.value,
|
|
1921
|
-
pct:
|
|
2106
|
+
pct: we.value
|
|
1922
2107
|
}, () => [
|
|
1923
|
-
s("div",
|
|
1924
|
-
s("div",
|
|
1925
|
-
N(
|
|
1926
|
-
|
|
2108
|
+
s("div", $s, [
|
|
2109
|
+
s("div", Ss, [
|
|
2110
|
+
N(I(xt.value), 1),
|
|
2111
|
+
we.value != null ? (r(), c("span", Es, I(we.value) + "%", 1)) : R("", !0)
|
|
1927
2112
|
]),
|
|
1928
|
-
s("div",
|
|
1929
|
-
|
|
2113
|
+
s("div", Ts, [
|
|
2114
|
+
we.value != null ? (r(), c("div", {
|
|
1930
2115
|
key: 0,
|
|
1931
2116
|
class: "loader-fill",
|
|
1932
|
-
style:
|
|
1933
|
-
}, null, 4)) : (
|
|
2117
|
+
style: Ke({ width: we.value + "%" })
|
|
2118
|
+
}, null, 4)) : (r(), c("div", Fs))
|
|
1934
2119
|
])
|
|
1935
2120
|
])
|
|
1936
2121
|
], !0)
|
|
1937
|
-
])) :
|
|
1938
|
-
|
|
1939
|
-
N("解析失败:" +
|
|
2122
|
+
])) : $(F) ? (r(), c("div", Is, [
|
|
2123
|
+
se(e.$slots, "error", { error: $(F) }, () => [
|
|
2124
|
+
N("解析失败:" + I($(F)), 1)
|
|
1940
2125
|
], !0)
|
|
1941
|
-
])) :
|
|
1942
|
-
|
|
1943
|
-
l[
|
|
2126
|
+
])) : $(x) ? R("", !0) : (r(), c("div", Ms, [
|
|
2127
|
+
se(e.$slots, "empty", {}, () => [
|
|
2128
|
+
l[19] || (l[19] = N("拖入或选择一个 .xlsx 文件", -1))
|
|
1944
2129
|
], !0)
|
|
1945
2130
|
]))
|
|
1946
2131
|
], 512),
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
stats:
|
|
1950
|
-
range:
|
|
2132
|
+
$(x) ? (r(), c("div", Rs, [
|
|
2133
|
+
se(e.$slots, "statusbar", {
|
|
2134
|
+
stats: U.value,
|
|
2135
|
+
range: ht.value || lt.value
|
|
1951
2136
|
}, () => [
|
|
1952
|
-
s("span",
|
|
1953
|
-
l[
|
|
1954
|
-
|
|
1955
|
-
s("span", null, "计数 " +
|
|
1956
|
-
s("span", null, "求和 " +
|
|
1957
|
-
s("span", null, "平均 " +
|
|
1958
|
-
s("span", null, "最大 " +
|
|
1959
|
-
s("span", null, "最小 " +
|
|
1960
|
-
], 64)) :
|
|
2137
|
+
s("span", Ps, I(ht.value || lt.value), 1),
|
|
2138
|
+
l[20] || (l[20] = s("div", { class: "grow" }, null, -1)),
|
|
2139
|
+
U.value && U.value.numCount > 0 ? (r(), c(_, { key: 0 }, [
|
|
2140
|
+
s("span", null, "计数 " + I(U.value.count), 1),
|
|
2141
|
+
s("span", null, "求和 " + I(Ve(U.value.sum)), 1),
|
|
2142
|
+
s("span", null, "平均 " + I(Ve(U.value.avg)), 1),
|
|
2143
|
+
s("span", null, "最大 " + I(Ve(U.value.max)), 1),
|
|
2144
|
+
s("span", null, "最小 " + I(Ve(U.value.min)), 1)
|
|
2145
|
+
], 64)) : U.value && U.value.count > 0 ? (r(), c("span", Ds, "计数 " + I(U.value.count), 1)) : R("", !0)
|
|
1961
2146
|
], !0)
|
|
1962
|
-
])) :
|
|
1963
|
-
|
|
1964
|
-
key:
|
|
1965
|
-
workbook:
|
|
1966
|
-
active:
|
|
1967
|
-
onSelect: l[
|
|
1968
|
-
}, null, 8, ["workbook", "active"])) :
|
|
1969
|
-
|
|
2147
|
+
])) : R("", !0),
|
|
2148
|
+
$(x) ? (r(), ve(en, {
|
|
2149
|
+
key: wt.value,
|
|
2150
|
+
workbook: $(x),
|
|
2151
|
+
active: q.value,
|
|
2152
|
+
onSelect: l[16] || (l[16] = (n) => q.value = n)
|
|
2153
|
+
}, null, 8, ["workbook", "active"])) : R("", !0),
|
|
2154
|
+
Pe.value && $(x) ? (r(), ve(yn, {
|
|
1970
2155
|
key: 5,
|
|
1971
|
-
selection:
|
|
1972
|
-
"sheet-count":
|
|
1973
|
-
onClose: l[
|
|
1974
|
-
onExport:
|
|
1975
|
-
}, null, 8, ["selection", "sheet-count"])) :
|
|
2156
|
+
selection: J.value,
|
|
2157
|
+
"sheet-count": $(x).sheets.filter((n) => n.state === "visible").length,
|
|
2158
|
+
onClose: l[17] || (l[17] = (n) => Pe.value = !1),
|
|
2159
|
+
onExport: ml
|
|
2160
|
+
}, null, 8, ["selection", "sheet-count"])) : R("", !0),
|
|
1976
2161
|
s("input", {
|
|
1977
2162
|
ref_key: "templateInputEl",
|
|
1978
|
-
ref:
|
|
2163
|
+
ref: yt,
|
|
1979
2164
|
type: "file",
|
|
1980
2165
|
accept: ".xlsx,.xlsm",
|
|
1981
2166
|
hidden: "",
|
|
1982
|
-
onChange:
|
|
2167
|
+
onChange: Ut
|
|
1983
2168
|
}, null, 544),
|
|
1984
|
-
|
|
2169
|
+
u.exportProgress !== !1 ? se(e.$slots, "export-progress", {
|
|
1985
2170
|
key: 6,
|
|
1986
|
-
state:
|
|
2171
|
+
state: Ee.value,
|
|
1987
2172
|
busy: We.value,
|
|
1988
|
-
cancel:
|
|
2173
|
+
cancel: Tt
|
|
1989
2174
|
}, () => [
|
|
1990
|
-
pt(
|
|
1991
|
-
state:
|
|
2175
|
+
pt(bs, {
|
|
2176
|
+
state: Ee.value,
|
|
1992
2177
|
busy: We.value,
|
|
1993
|
-
onCancel:
|
|
2178
|
+
onCancel: Tt
|
|
1994
2179
|
}, null, 8, ["state", "busy"])
|
|
1995
|
-
], !0) :
|
|
2180
|
+
], !0) : R("", !0)
|
|
1996
2181
|
], 544));
|
|
1997
2182
|
}
|
|
1998
|
-
}),
|
|
1999
|
-
install(
|
|
2000
|
-
|
|
2183
|
+
}), zs = /* @__PURE__ */ te(As, [["__scopeId", "data-v-cb45e8ec"]]), Ws = {
|
|
2184
|
+
install(u) {
|
|
2185
|
+
u.component("ExcelViewer", zs);
|
|
2001
2186
|
}
|
|
2002
2187
|
};
|
|
2003
2188
|
export {
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2189
|
+
Us as DEFAULT_THEME,
|
|
2190
|
+
zs as ExcelViewer,
|
|
2191
|
+
Ks as canvasToBlob,
|
|
2192
|
+
qs as canvasToDataURL,
|
|
2193
|
+
Js as cellDisplayText,
|
|
2194
|
+
js as cellKey,
|
|
2195
|
+
Ws as default,
|
|
2196
|
+
la as definePlugin,
|
|
2197
|
+
_s as downloadBlob,
|
|
2198
|
+
Zs as formatValue,
|
|
2199
|
+
Gs as getCell,
|
|
2200
|
+
Xs as getCellStyle,
|
|
2201
|
+
Dl as getCellText,
|
|
2202
|
+
Al as getCellValue,
|
|
2203
|
+
Ml as getRangeData,
|
|
2204
|
+
Pl as getSheetData,
|
|
2205
|
+
Qs as getWorkbookJSON,
|
|
2021
2206
|
Nt as loadArrayBuffer,
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2207
|
+
Ys as mergeTheme,
|
|
2208
|
+
ea as parseWorkbook,
|
|
2209
|
+
Rl as sheetToJSON
|
|
2025
2210
|
};
|