ooxml-excel-editor 1.3.1 → 1.3.2

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