ooxml-excel-editor 1.2.0 → 1.3.0

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