ooxml-excel-editor 1.3.3 → 1.11.0

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