ooxml-excel-editor 1.3.1 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.js CHANGED
@@ -1,8 +1,20 @@
1
- import { jsx as a, jsxs as g, Fragment as qt } from "react/jsx-runtime";
2
- import { useState as y, useRef as v, useCallback as wt, forwardRef as Qt, useEffect as E, useReducer as Yt, useLayoutEffect as It, useImperativeHandle as en } from "react";
3
- import { p as Tt, s as De, i as tn, j as nn, a as rn, T as ln } from "./chunks/toolbar-icons-BcnMin5s.js";
4
- import { r as yt, l as Pt, d as Mt, f as At, a as on, V as cn, P as an, g as Rt, s as Et, b as Ft, c as kt, e as Nt, h as Oe } from "./chunks/plugin-overlay-DLb6sRhU.js";
5
- const sn = {
1
+ var fn = Object.defineProperty, mn = Object.defineProperties;
2
+ var Cn = Object.getOwnPropertyDescriptors;
3
+ var zt = Object.getOwnPropertySymbols;
4
+ var hn = Object.prototype.hasOwnProperty, vn = Object.prototype.propertyIsEnumerable;
5
+ var Ot = (d, c, x) => c in d ? fn(d, c, { enumerable: !0, configurable: !0, writable: !0, value: x }) : d[c] = x, V = (d, c) => {
6
+ for (var x in c || (c = {}))
7
+ hn.call(c, x) && Ot(d, x, c[x]);
8
+ if (zt)
9
+ for (var x of zt(c))
10
+ vn.call(c, x) && Ot(d, x, c[x]);
11
+ return d;
12
+ }, ne = (d, c) => mn(d, Cn(c));
13
+ import { jsx as i, jsxs as m, Fragment as xn } from "react/jsx-runtime";
14
+ import { useState as R, useRef as v, useCallback as Wt, forwardRef as bn, useEffect as F, useReducer as pn, useLayoutEffect as Lt, useImperativeHandle as Sn } from "react";
15
+ import { p as $t, s as Oe, i as wn, j as In, a as yn, T as Rn } from "./chunks/toolbar-icons-fOm95ASq.js";
16
+ import { r as Ht, l as Xt, d as jt, f as Ut, a as En, V as Fn, P as kn, g as Bt, s as Vt, b as Jt, c as _t, e as Kt, h as We } from "./chunks/plugin-overlay-BUrPrpT2.js";
17
+ const Nn = {
6
18
  render: "渲染中",
7
19
  compose: "合成中",
8
20
  paginate: "分页中",
@@ -10,106 +22,110 @@ const sn = {
10
22
  zip: "zip 压缩",
11
23
  convert: "批量转换"
12
24
  };
13
- function un({
14
- state: f,
25
+ function Tn({
26
+ state: d,
15
27
  busy: c,
16
- onCancel: k
28
+ onCancel: x
17
29
  }) {
30
+ var s;
18
31
  if (!c) return null;
19
- const w = f == null ? void 0 : f.ratio, T = (f == null ? void 0 : f.label) || sn[(f == null ? void 0 : f.stage) ?? ""] || "处理中…";
20
- return /* @__PURE__ */ a("div", { className: "rxl-export-progress", role: "dialog", "aria-modal": "true", "aria-live": "polite", children: /* @__PURE__ */ g("div", { className: "card", children: [
21
- /* @__PURE__ */ a("div", { className: "title", children: T }),
22
- /* @__PURE__ */ a("div", { className: "bar" + (w == null ? " indeterminate" : ""), children: w != null ? /* @__PURE__ */ a("div", { className: "fill", style: { width: Math.round(w * 100) + "%" } }) : null }),
23
- /* @__PURE__ */ g("div", { className: "row", children: [
24
- /* @__PURE__ */ a("span", { className: "pct", children: w != null ? Math.round(w * 100) + "%" : "正在处理…" }),
25
- /* @__PURE__ */ a("button", { className: "cancel", onClick: k, title: "按 Esc 也可取消", children: "取消" })
32
+ const I = d == null ? void 0 : d.ratio, T = (d == null ? void 0 : d.label) || Nn[(s = d == null ? void 0 : d.stage) != null ? s : ""] || "处理中…";
33
+ return /* @__PURE__ */ i("div", { className: "rxl-export-progress", role: "dialog", "aria-modal": "true", "aria-live": "polite", children: /* @__PURE__ */ m("div", { className: "card", children: [
34
+ /* @__PURE__ */ i("div", { className: "title", children: T }),
35
+ /* @__PURE__ */ i("div", { className: "bar" + (I == null ? " indeterminate" : ""), children: I != null ? /* @__PURE__ */ i("div", { className: "fill", style: { width: Math.round(I * 100) + "%" } }) : null }),
36
+ /* @__PURE__ */ m("div", { className: "row", children: [
37
+ /* @__PURE__ */ i("span", { className: "pct", children: I != null ? Math.round(I * 100) + "%" : "正在处理…" }),
38
+ /* @__PURE__ */ i("button", { className: "cancel", onClick: x, title: "按 Esc 也可取消", children: "取消" })
26
39
  ] })
27
40
  ] }) });
28
41
  }
29
- function dn() {
30
- const [f, c] = y(!1), [k, w] = y(null), [T, s] = y(null), [F, A] = y(null), [Y, K] = y(null), W = v(null), N = wt(async (p, L) => {
31
- c(!0), w(null), W.current && yt(W.current), W.current = null, s(null), K(null), A({ stage: "read", ratio: 0 });
42
+ function Mn() {
43
+ const [d, c] = R(!1), [x, I] = R(null), [T, s] = R(null), [k, z] = R(null), [re, j] = R(null), H = v(null), N = Wt(async (S, J) => {
44
+ var O;
45
+ c(!0), I(null), H.current && Ht(H.current), H.current = null, s(null), j(null), z({ stage: "read", ratio: 0 });
32
46
  try {
33
- const I = await Pt(
34
- p,
35
- (X, ee) => A({ stage: "read", ratio: ee ? X / ee : void 0 })
36
- ), D = Mt(I);
37
- if (D === "xls") throw new Error("这是旧版 .xls(BIFF) 或加密文件,本预览器只支持 .xlsx/.xlsm。");
38
- if (D === "not-zip") throw new Error("文件不是有效的 .xlsx(非 ZIP 包)。");
39
- if (D === "empty") throw new Error("文件为空。");
40
- let H = await Tt(I, (X) => A(X));
41
- L && (H = L(H) ?? H), At(H), K(I.slice(0)), W.current = H, s(H);
42
- } catch (I) {
43
- const D = I == null ? void 0 : I.message;
44
- w(D && /预览器|损坏|加密|为空|ZIP/.test(D) ? D : on(I)), console.error("[ooxml-preview] 解析失败:", I);
47
+ const y = await Xt(
48
+ S,
49
+ (Z, _) => z({ stage: "read", ratio: _ ? Z / _ : void 0 })
50
+ ), M = jt(y);
51
+ if (M === "xls") throw new Error("这是旧版 .xls(BIFF) 或加密文件,本预览器只支持 .xlsx/.xlsm。");
52
+ if (M === "not-zip") throw new Error("文件不是有效的 .xlsx(非 ZIP 包)。");
53
+ if (M === "empty") throw new Error("文件为空。");
54
+ let B = await $t(y, (Z) => z(Z));
55
+ J && (B = (O = J(B)) != null ? O : B), Ut(B), j(y.slice(0)), H.current = B, s(B);
56
+ } catch (y) {
57
+ const M = y == null ? void 0 : y.message;
58
+ I(M && /预览器|损坏|加密|为空|ZIP/.test(M) ? M : En(y)), console.error("[ooxml-preview] 解析失败:", y);
45
59
  } finally {
46
- c(!1), A(null);
60
+ c(!1), z(null);
47
61
  }
48
- }, []), $ = wt((p, L) => {
49
- W.current && yt(W.current), K(null), w(null), A(null);
50
- const I = L ? L(p) ?? p : p;
51
- W.current = I, s(I);
62
+ }, []), U = Wt((S, J) => {
63
+ var y;
64
+ H.current && Ht(H.current), j(null), I(null), z(null);
65
+ const O = J && (y = J(S)) != null ? y : S;
66
+ H.current = O, s(O);
52
67
  }, []);
53
- return { loading: f, error: k, workbook: T, progress: F, load: N, loadModel: $, sourceBuffer: Y };
68
+ return { loading: d, error: x, workbook: T, progress: k, load: N, loadModel: U, sourceBuffer: re };
54
69
  }
55
- function me(f) {
56
- return isFinite(f) ? f.toLocaleString("en-US", { maximumFractionDigits: 2 }) : "—";
70
+ function he(d) {
71
+ return isFinite(d) ? d.toLocaleString("en-US", { maximumFractionDigits: 2 }) : "—";
57
72
  }
58
- const vn = Qt(function(c, k) {
59
- var it;
60
- const { loading: w, error: T, workbook: s, progress: F, load: A, loadModel: Y, sourceBuffer: K } = dn(), W = (e) => e ? tn(e) ? e : nn(e, c.jsonOptions) : null, [N, $] = y(0), [p, L] = y(1), [I, D] = y(null), [H, X] = y(null), ee = I ?? c.templateFile ?? null, te = H ?? c.templateName ?? "", ze = () => {
61
- D(null), X(null);
62
- }, We = v(null), Dt = () => {
73
+ const Ln = bn(function(c, x) {
74
+ var dt, gt, ft, mt, Ct, ht, vt, xt, bt, pt, St, wt;
75
+ const { loading: I, error: T, workbook: s, progress: k, load: z, loadModel: re, sourceBuffer: j } = Mn(), H = (e) => e ? wn(e) ? e : In(e, c.jsonOptions) : null, [N, U] = R(0), [S, J] = R(1), [O, y] = R(null), [M, B] = R(null), Z = (dt = O != null ? O : c.templateFile) != null ? dt : null, _ = (gt = M != null ? M : c.templateName) != null ? gt : "", Le = () => {
76
+ y(null), B(null);
77
+ }, He = v(null), Zt = () => {
63
78
  var e;
64
- return (e = We.current) == null ? void 0 : e.click();
65
- }, Ot = (e) => {
79
+ return (e = He.current) == null ? void 0 : e.click();
80
+ }, Gt = (e) => {
66
81
  var n;
67
82
  const t = (n = e.target.files) == null ? void 0 : n[0];
68
- t && (D(t), X(t.name), e.target.value = "");
69
- }, Le = c.fileName || (c.workbook ? "JSON 数据" : ((it = s == null ? void 0 : s.sheets[0]) == null ? void 0 : it.name) || ""), [Ce, he] = y(!1), [se, j] = y(null);
70
- E(() => {
71
- if (typeof document > "u") return;
83
+ t && (y(t), B(t.name), e.target.value = "");
84
+ }, Be = c.fileName || (c.workbook ? "JSON 数据" : ((ft = s == null ? void 0 : s.sheets[0]) == null ? void 0 : ft.name) || ""), [ve, xe] = R(!1), [ue, G] = R(null);
85
+ F(() => {
86
+ if (typeof document == "undefined") return;
72
87
  const e = (t) => {
73
88
  var n;
74
- (n = t.target) != null && n.closest("[data-tb-menu]") || j(null);
89
+ (n = t.target) != null && n.closest("[data-tb-menu]") || G(null);
75
90
  };
76
91
  return document.addEventListener("click", e), () => document.removeEventListener("click", e);
77
92
  }, []);
78
- const [, B] = Yt((e) => e + 1, 0), [zt, He] = y(""), ne = v(!1), Be = v(null), Ve = () => {
79
- const e = Be.current;
93
+ const [, K] = pn((e) => e + 1, 0), [qt, Ve] = R(""), le = v(!1), Je = v(null), _e = () => {
94
+ const e = Je.current;
80
95
  e && (e.style.height = "auto", e.style.height = e.scrollHeight + "px");
81
96
  };
82
- E(() => {
83
- Ve();
97
+ F(() => {
98
+ _e();
84
99
  });
85
- const Je = v(null), _e = v(null), U = v(null), Ke = v(null), ve = v(null), xe = v(null), be = v(null), pe = v(null), r = v(null), Se = v(null), we = v(null), Ie = v(null), ie = v(null), ye = v(/* @__PURE__ */ new Map()), u = v(c);
86
- u.current = c;
87
- const ue = c.plugins ?? [], Z = v(ue);
88
- Z.current = ue;
89
- const G = v(s);
90
- G.current = s;
91
- const Re = v(N);
92
- Re.current = N;
93
- function Wt() {
94
- const e = Z.current, t = Object.assign({}, ...e.map((o) => o.theme || {}), u.current.theme || {}), n = e.map((o) => o.cellStyle).filter(Boolean);
95
- u.current.cellStyle && n.push(u.current.cellStyle);
96
- const l = n.length ? (o, m, i) => {
97
- let d;
98
- for (const x of n) {
99
- const S = x(o, m, i);
100
- S && (d = { ...d || {}, ...S });
100
+ const Ke = v(null), $e = v(null), q = v(null), Xe = v(null), be = v(null), pe = v(null), Se = v(null), we = v(null), l = v(null), Ie = v(null), ye = v(null), Re = v(null), de = v(null), Ee = v(/* @__PURE__ */ new Map()), g = v(c);
101
+ g.current = c;
102
+ const ge = (mt = c.plugins) != null ? mt : [], Q = v(ge);
103
+ Q.current = ge;
104
+ const Y = v(s);
105
+ Y.current = s;
106
+ const Fe = v(N);
107
+ Fe.current = N;
108
+ function Qt() {
109
+ const e = Q.current, t = Object.assign({}, ...e.map((o) => o.theme || {}), g.current.theme || {}), n = e.map((o) => o.cellStyle).filter(Boolean);
110
+ g.current.cellStyle && n.push(g.current.cellStyle);
111
+ const r = n.length ? (o, u, a) => {
112
+ let f;
113
+ for (const b of n) {
114
+ const w = b(o, u, a);
115
+ w && (f = V(V({}, f || {}), w));
101
116
  }
102
- return d;
117
+ return f;
103
118
  } : void 0;
104
- return { theme: t, cellStyle: l, cellImageFit: u.current.cellImageFit, readOnlyCellStyle: u.current.readOnlyCellStyle };
119
+ return { theme: t, cellStyle: r, cellImageFit: g.current.cellImageFit, readOnlyCellStyle: g.current.readOnlyCellStyle };
105
120
  }
106
- function q(e) {
121
+ function ee(e) {
122
+ var n, r;
107
123
  let t = e;
108
- for (const n of Z.current) n.transformModel && (t = n.transformModel(t) ?? t);
109
- return u.current.transformModel && (t = u.current.transformModel(t) ?? t), t;
124
+ for (const o of Q.current) o.transformModel && (t = (n = o.transformModel(t)) != null ? n : t);
125
+ return g.current.transformModel && (t = (r = g.current.transformModel(t)) != null ? r : t), t;
110
126
  }
111
- function $e() {
112
- const e = u.current;
127
+ function je() {
128
+ const e = g.current;
113
129
  return {
114
130
  editable: e.editable,
115
131
  cellReadOnly: e.cellReadOnly,
@@ -120,897 +136,901 @@ const vn = Qt(function(c, k) {
120
136
  formulaEngine: e.formulaEngine
121
137
  };
122
138
  }
123
- function Xe() {
124
- if (u.current.editor || Z.current.some((t) => t.editor))
139
+ function Ue() {
140
+ if (g.current.editor || Q.current.some((t) => t.editor))
125
141
  return (t, n) => {
126
- var o, m, i;
127
- const l = (m = (o = u.current).editor) == null ? void 0 : m.call(o, t, n);
128
- if (l) return l;
129
- for (const d of Z.current) {
130
- const x = (i = d.editor) == null ? void 0 : i.call(d, t, n);
131
- if (x) return x;
142
+ var o, u, a;
143
+ const r = (u = (o = g.current).editor) == null ? void 0 : u.call(o, t, n);
144
+ if (r) return r;
145
+ for (const f of Q.current) {
146
+ const b = (a = f.editor) == null ? void 0 : a.call(f, t, n);
147
+ if (b) return b;
132
148
  }
133
149
  };
134
150
  }
135
- const Q = (e, t) => {
151
+ const te = (e, t) => {
136
152
  var n;
137
- return (n = ye.current.get(e)) == null ? void 0 : n.forEach((l) => l(t));
138
- }, re = (e) => {
139
- var n, l;
140
- const t = String((e == null ? void 0 : e.message) ?? e);
141
- console.error("[ooxml-excel-editor] 导出失败:", e), (l = (n = u.current).onError) == null || l.call(n, t), typeof window < "u" && window.alert && window.alert(t);
142
- }, [je, Ee] = y(null), [Ue, Ze] = y(!1), Fe = v(null), Ge = () => {
153
+ return (n = Ee.current.get(e)) == null ? void 0 : n.forEach((r) => r(t));
154
+ }, oe = (e) => {
155
+ var n, r, o;
156
+ const t = String((n = e == null ? void 0 : e.message) != null ? n : e);
157
+ console.error("[ooxml-excel-editor] 导出失败:", e), (o = (r = g.current).onError) == null || o.call(r, t), typeof window != "undefined" && window.alert && window.alert(t);
158
+ }, [Ze, ke] = R(null), [Ge, qe] = R(!1), Ne = v(null), Qe = () => {
143
159
  var e;
144
- return (e = Fe.current) == null ? void 0 : e.abort();
160
+ return (e = Ne.current) == null ? void 0 : e.abort();
145
161
  };
146
- function b(e, t) {
147
- if (u.current.exportProgress === !1) return t(e);
162
+ function p(e, t) {
163
+ if (g.current.exportProgress === !1) return t(e);
148
164
  const n = new AbortController();
149
- Fe.current = n, e != null && e.signal && (e.signal.aborted ? n.abort() : e.signal.addEventListener("abort", () => n.abort(), { once: !0 })), Ze(!0), Ee(null);
150
- const o = { ...e ?? {}, onProgress: (m) => {
151
- var i;
152
- Ee(m), (i = e == null ? void 0 : e.onProgress) == null || i.call(e, m);
153
- }, signal: n.signal };
165
+ Ne.current = n, e != null && e.signal && (e.signal.aborted ? n.abort() : e.signal.addEventListener("abort", () => n.abort(), { once: !0 })), qe(!0), ke(null);
166
+ const r = (u) => {
167
+ var a;
168
+ ke(u), (a = e == null ? void 0 : e.onProgress) == null || a.call(e, u);
169
+ }, o = ne(V({}, e != null ? e : {}), { onProgress: r, signal: n.signal });
154
170
  return t(o).finally(() => {
155
- Ze(!1), Ee(null), Fe.current = null;
171
+ qe(!1), ke(null), Ne.current = null;
156
172
  });
157
173
  }
158
- function ke() {
159
- const e = ie.current, t = r.current;
174
+ function Te() {
175
+ const e = de.current, t = l.current;
160
176
  if (!e || !t) return;
161
177
  const n = {
162
- rectOf: (l, o) => t.rectOf(l, o),
163
- rectOfRange: (l) => t.rectOfRange(l),
178
+ rectOf: (r, o) => t.rectOf(r, o),
179
+ rectOfRange: (r) => t.rectOfRange(r),
164
180
  tick: 0,
165
- workbook: G.current
181
+ workbook: Y.current
166
182
  };
167
- e.render(Z.current, n);
183
+ e.render(Q.current, n);
168
184
  }
169
- It(() => {
170
- const e = _e.current, t = Je.current, n = U.current, l = Ke.current;
171
- if (!e || !t || !n || !l || !Ie.current || !ve.current || !xe.current || !be.current || !pe.current) return;
172
- const o = new cn(
185
+ Lt(() => {
186
+ const e = $e.current, t = Ke.current, n = q.current, r = Xe.current;
187
+ if (!e || !t || !n || !r || !Re.current || !be.current || !pe.current || !Se.current || !we.current) return;
188
+ const o = new Fn(
173
189
  {
174
190
  canvas: e,
175
191
  renderArea: t,
176
192
  scroller: n,
177
- spacer: l,
178
- overlays: { main: ve.current, frow: xe.current, fcol: be.current, corner: pe.current },
179
- editorSlot: Ie.current
193
+ spacer: r,
194
+ overlays: { main: be.current, frow: pe.current, fcol: Se.current, corner: we.current },
195
+ editorSlot: Re.current
180
196
  },
181
197
  {
182
- onRenderer: () => B(),
183
- onRenderTick: () => ke(),
198
+ onRenderer: () => K(),
199
+ onRenderTick: () => Te(),
184
200
  // 插件 overlay 随每帧重定位(纯 DOM,不触发 React 重渲)
185
- onSelectionChange: () => B(),
186
- onCellClick: (i, d, x) => {
187
- var M, _;
188
- const S = { row: i, col: d, text: x };
189
- (_ = (M = u.current).onCellClick) == null || _.call(M, S), Q("cell-click", S);
201
+ onSelectionChange: () => K(),
202
+ onCellClick: (a, f, b) => {
203
+ var A, D;
204
+ const w = { row: a, col: f, text: b };
205
+ (D = (A = g.current).onCellClick) == null || D.call(A, w), te("cell-click", w);
190
206
  },
191
- onCellDblClick: (i, d, x) => {
192
- var M, _;
193
- const S = { row: i, col: d, text: x };
194
- (_ = (M = u.current).onCellDblClick) == null || _.call(M, S), Q("cell-dblclick", S);
207
+ onCellDblClick: (a, f, b) => {
208
+ var A, D;
209
+ const w = { row: a, col: f, text: b };
210
+ (D = (A = g.current).onCellDblClick) == null || D.call(A, w), te("cell-dblclick", w);
195
211
  },
196
- onHyperlink: (i, d) => {
197
- var x, S;
198
- (S = (x = u.current).onHyperlinkClick) == null || S.call(x, { url: i, cell: d }), Q("hyperlink-click", { url: i, cell: d }), u.current.openLinks !== !1 && window.open(i, "_blank", "noopener");
212
+ onHyperlink: (a, f) => {
213
+ var b, w;
214
+ (w = (b = g.current).onHyperlinkClick) == null || w.call(b, { url: a, cell: f }), te("hyperlink-click", { url: a, cell: f }), g.current.openLinks !== !1 && window.open(a, "_blank", "noopener");
199
215
  },
200
- onTooltip: (i) => {
201
- Se.current = i, B();
216
+ onTooltip: (a) => {
217
+ Ie.current = a, K();
202
218
  },
203
- onFindChange: () => B(),
204
- onFilterChange: () => B(),
205
- onEditEvent: (i, d) => {
206
- var x, S, M, _, ut, dt, gt, ft, mt, Ct, ht, vt, xt, bt, pt, St;
207
- i === "cell-change" ? (B(), (S = (x = u.current).onCellChange) == null || S.call(x, d)) : i === "edit-start" ? (_ = (M = u.current).onEditStart) == null || _.call(M, d) : i === "edit-commit" ? (dt = (ut = u.current).onEditCommit) == null || dt.call(ut, d) : i === "dim-change" ? (ft = (gt = u.current).onDimChange) == null || ft.call(gt, d) : i === "dirty-change" ? (Ct = (mt = u.current).onDirtyChange) == null || Ct.call(mt, d) : i === "image-change" ? (vt = (ht = u.current).onImageChange) == null || vt.call(ht, d) : i === "struct-change" ? (bt = (xt = u.current).onStructChange) == null || bt.call(xt, d) : i === "permission-denied" && ((St = (pt = u.current).onPermissionDenied) == null || St.call(pt, d)), Q(i, d);
219
+ onFindChange: () => K(),
220
+ onFilterChange: () => K(),
221
+ onEditEvent: (a, f) => {
222
+ var b, w, A, D, It, yt, Rt, Et, Ft, kt, Nt, Tt, Mt, Pt, At, Dt;
223
+ a === "cell-change" ? (K(), (w = (b = g.current).onCellChange) == null || w.call(b, f)) : a === "edit-start" ? (D = (A = g.current).onEditStart) == null || D.call(A, f) : a === "edit-commit" ? (yt = (It = g.current).onEditCommit) == null || yt.call(It, f) : a === "dim-change" ? (Et = (Rt = g.current).onDimChange) == null || Et.call(Rt, f) : a === "dirty-change" ? (kt = (Ft = g.current).onDirtyChange) == null || kt.call(Ft, f) : a === "image-change" ? (Tt = (Nt = g.current).onImageChange) == null || Tt.call(Nt, f) : a === "struct-change" ? (Pt = (Mt = g.current).onStructChange) == null || Pt.call(Mt, f) : a === "permission-denied" && ((Dt = (At = g.current).onPermissionDenied) == null || Dt.call(At, f)), te(a, f);
208
224
  },
209
- onContextMenuBefore: (i) => {
210
- var d, x;
211
- for (const S of u.current.plugins ?? [])
212
- if (S.contextMenu) {
213
- const M = S.contextMenu(i.ctx, i.items);
214
- Array.isArray(M) && i.items.splice(0, i.items.length, ...M);
225
+ onContextMenuBefore: (a) => {
226
+ var f, b, w;
227
+ for (const A of (f = g.current.plugins) != null ? f : [])
228
+ if (A.contextMenu) {
229
+ const D = A.contextMenu(a.ctx, a.items);
230
+ Array.isArray(D) && a.items.splice(0, a.items.length, ...D);
215
231
  }
216
- (x = (d = u.current).onBeforeContextMenu) == null || x.call(d, i), u.current.contextMenu === !1 && i.preventDefault();
232
+ (w = (b = g.current).onBeforeContextMenu) == null || w.call(b, a), g.current.contextMenu === !1 && a.preventDefault();
217
233
  },
218
- onContextMenuShow: (i) => {
219
- var d, x;
220
- return (x = (d = u.current).onContextMenuShow) == null ? void 0 : x.call(d, i);
234
+ onContextMenuShow: (a) => {
235
+ var f, b;
236
+ return (b = (f = g.current).onContextMenuShow) == null ? void 0 : b.call(f, a);
221
237
  }
222
238
  }
223
239
  );
224
- o.fileName = u.current.fileName, o.setEditConfig($e()), o.setEditorResolver(Xe()), o.setContextMenuTransform(typeof u.current.contextMenu == "function" ? u.current.contextMenu : null), o.setLightboxEnabled(u.current.imageLightbox !== !1), r.current = o, we.current && (ie.current = new an(we.current));
225
- const m = new ResizeObserver(() => {
240
+ o.fileName = g.current.fileName, o.setEditConfig(je()), o.setEditorResolver(Ue()), o.setContextMenuTransform(typeof g.current.contextMenu == "function" ? g.current.contextMenu : null), o.setLightboxEnabled(g.current.imageLightbox !== !1), l.current = o, ye.current && (de.current = new kn(ye.current));
241
+ const u = new ResizeObserver(() => {
226
242
  o.measure(), o.render();
227
243
  });
228
- return m.observe(t), () => {
229
- var i;
230
- m.disconnect(), o.dispose(), (i = ie.current) == null || i.dispose(), ie.current = null, r.current = null;
244
+ return u.observe(t), () => {
245
+ var a;
246
+ u.disconnect(), o.dispose(), (a = de.current) == null || a.dispose(), de.current = null, l.current = null;
231
247
  };
232
- }, []), E(() => {
233
- const e = ee, t = W(c.workbook);
248
+ }, []), F(() => {
249
+ const e = Z, t = H(c.workbook);
234
250
  async function n(o) {
235
- const m = await Pt(o), i = Mt(m);
236
- if (i === "xls") throw new Error("模板文件是旧版 .xls 或加密,仅支持 .xlsx/.xlsm");
237
- if (i === "not-zip") throw new Error("模板文件不是有效的 .xlsx(非 ZIP 包)");
238
- if (i === "empty") throw new Error("模板文件为空");
239
- const d = await Tt(m);
240
- return At(d), d;
251
+ const u = await Xt(o), a = jt(u);
252
+ if (a === "xls") throw new Error("模板文件是旧版 .xls 或加密,仅支持 .xlsx/.xlsm");
253
+ if (a === "not-zip") throw new Error("模板文件不是有效的 .xlsx(非 ZIP 包)");
254
+ if (a === "empty") throw new Error("模板文件为空");
255
+ const f = await $t(u);
256
+ return Ut(f), f;
241
257
  }
242
- async function l() {
258
+ async function r() {
243
259
  if (c.src) {
244
- e && console.warn("[ooxml-excel-editor] templateFile 只在 workbook (JSON / 模型) 数据源下生效;xlsx 数据源已自带格式,模板已忽略."), await A(c.src, q);
260
+ e && console.warn("[ooxml-excel-editor] templateFile 只在 workbook (JSON / 模型) 数据源下生效;xlsx 数据源已自带格式,模板已忽略."), await z(c.src, ee);
245
261
  return;
246
262
  }
247
263
  if (t && e) {
248
264
  try {
249
- const o = await n(e), m = rn(t, o);
250
- Y(m, q);
265
+ const o = await n(e), u = yn(t, o);
266
+ re(u, ee);
251
267
  } catch (o) {
252
- console.error("[ooxml-excel-editor] 模板加载失败,降级为纯 JSON 渲染:", o), Y(t, q);
268
+ console.error("[ooxml-excel-editor] 模板加载失败,降级为纯 JSON 渲染:", o), re(t, ee);
253
269
  }
254
270
  return;
255
271
  }
256
272
  if (t) {
257
- Y(t, q);
273
+ re(t, ee);
258
274
  return;
259
275
  }
260
- e && await A(e, q);
276
+ e && await z(e, ee);
261
277
  }
262
- l();
263
- }, [c.src, c.workbook, c.templateFile, I]), E(() => {
264
- r.current && (r.current.fileName = c.fileName);
265
- }, [c.fileName]), E(() => {
278
+ r();
279
+ }, [c.src, c.workbook, c.templateFile, O]), F(() => {
280
+ l.current && (l.current.fileName = c.fileName);
281
+ }, [c.fileName]), F(() => {
266
282
  var e;
267
- (e = r.current) == null || e.setEditConfig($e());
268
- }, [c.editable, c.cellReadOnly, c.readOnlyRanges, c.editableTargets, c.strictDimensions, c.recalc, c.formulaEngine]), E(() => {
283
+ (e = l.current) == null || e.setEditConfig(je());
284
+ }, [c.editable, c.cellReadOnly, c.readOnlyRanges, c.editableTargets, c.strictDimensions, c.recalc, c.formulaEngine]), F(() => {
269
285
  var e;
270
- (e = r.current) == null || e.setContextMenuTransform(
286
+ (e = l.current) == null || e.setContextMenuTransform(
271
287
  typeof c.contextMenu == "function" ? c.contextMenu : null
272
288
  );
273
- }, [c.contextMenu]), E(() => {
289
+ }, [c.contextMenu]), F(() => {
274
290
  var e;
275
- (e = r.current) == null || e.setEditorResolver(Xe());
276
- }, [c.editor, c.plugins]), E(() => {
291
+ (e = l.current) == null || e.setEditorResolver(Ue());
292
+ }, [c.editor, c.plugins]), F(() => {
277
293
  var e;
278
- c.cellImageFit && ((e = r.current) == null || e.setCellImageFit(c.cellImageFit));
279
- }, [c.cellImageFit]), E(() => {
294
+ c.cellImageFit && ((e = l.current) == null || e.setCellImageFit(c.cellImageFit));
295
+ }, [c.cellImageFit]), F(() => {
280
296
  var e;
281
- (e = r.current) == null || e.setLightboxEnabled(c.imageLightbox !== !1);
282
- }, [c.imageLightbox]), E(() => {
297
+ (e = l.current) == null || e.setLightboxEnabled(c.imageLightbox !== !1);
298
+ }, [c.imageLightbox]), F(() => {
283
299
  var e, t;
284
- s && ($(s.activeSheet), (t = (e = u.current).onRendered) == null || t.call(e, s));
285
- }, [s]), E(() => {
300
+ s && (U(s.activeSheet), (t = (e = g.current).onRendered) == null || t.call(e, s));
301
+ }, [s]), F(() => {
286
302
  var e, t;
287
- T && ((t = (e = u.current).onError) == null || t.call(e, T));
288
- }, [T]), It(() => {
289
- var l, o;
290
- const e = r.current;
303
+ T && ((t = (e = g.current).onError) == null || t.call(e, T));
304
+ }, [T]), Lt(() => {
305
+ var r, o, u, a;
306
+ const e = l.current;
291
307
  if (!e || !s) return;
292
- const t = s.sheets[N] ?? s.sheets[0] ?? null;
308
+ const t = (o = (r = s.sheets[N]) != null ? r : s.sheets[0]) != null ? o : null;
293
309
  if (!t) return;
294
- e.rebuild(t, s, p, Wt()), e.setSourceBuffer(K), ke();
310
+ e.rebuild(t, s, S, Qt()), e.setSourceBuffer(j), Te();
295
311
  const n = { index: N, name: t.name };
296
- (o = (l = u.current).onSheetChange) == null || o.call(l, n), Q("sheet-change", n);
297
- }, [s, N, c.theme, c.cellStyle, c.plugins, K]), E(() => {
312
+ (a = (u = g.current).onSheetChange) == null || a.call(u, n), te("sheet-change", n);
313
+ }, [s, N, c.theme, c.cellStyle, c.plugins, j]), F(() => {
298
314
  var e;
299
- (e = r.current) == null || e.setZoom(p);
300
- }, [p]);
301
- const qe = v("");
302
- E(() => {
303
- var o, m;
304
- const e = r.current;
315
+ (e = l.current) == null || e.setZoom(S);
316
+ }, [S]);
317
+ const Ye = v("");
318
+ F(() => {
319
+ var o, u;
320
+ const e = l.current;
305
321
  if (!e) return;
306
- const t = e.getSelection(), n = e.getActiveCell(), l = t && n ? `${t.top},${t.left},${t.bottom},${t.right}` : "";
307
- if (l && l !== qe.current && n) {
308
- qe.current = l;
309
- const i = { range: t, active: n };
310
- (m = (o = u.current).onSelectionChange) == null || m.call(o, i), Q("selection-change", i);
322
+ const t = e.getSelection(), n = e.getActiveCell(), r = t && n ? `${t.top},${t.left},${t.bottom},${t.right}` : "";
323
+ if (r && r !== Ye.current && n) {
324
+ Ye.current = r;
325
+ const a = { range: t, active: n };
326
+ (u = (o = g.current).onSelectionChange) == null || u.call(o, a), te("selection-change", a);
311
327
  }
312
328
  });
313
- const le = (e) => (s == null ? void 0 : s.sheets[e ?? N]) ?? null, Qe = (s == null ? void 0 : s.date1904) ?? !1, Ne = (e) => ({ ...e, date1904: Qe });
314
- en(
315
- k,
329
+ const ce = (e) => {
330
+ var t;
331
+ return (t = s == null ? void 0 : s.sheets[e != null ? e : N]) != null ? t : null;
332
+ }, et = (Ct = s == null ? void 0 : s.date1904) != null ? Ct : !1, Me = (e) => ne(V({}, e), { date1904: et });
333
+ Sn(
334
+ x,
316
335
  () => ({
317
- load: (e) => A(e, c.transformModel),
336
+ load: (e) => z(e, c.transformModel),
318
337
  getWorkbook: () => s,
319
338
  getActiveSheet: () => N,
320
- setActiveSheet: (e) => (s == null ? void 0 : s.sheets[e]) && $(e),
339
+ setActiveSheet: (e) => (s == null ? void 0 : s.sheets[e]) && U(e),
321
340
  getSelection: () => {
322
- var e;
323
- return ((e = r.current) == null ? void 0 : e.getSelection()) ?? null;
341
+ var e, t;
342
+ return (t = (e = l.current) == null ? void 0 : e.getSelection()) != null ? t : null;
324
343
  },
325
344
  setSelection: (e) => {
326
345
  var t;
327
- return (t = r.current) == null ? void 0 : t.setSelectionRange(e);
346
+ return (t = l.current) == null ? void 0 : t.setSelectionRange(e);
328
347
  },
329
348
  rectOf: (e, t) => {
330
- var n;
331
- return ((n = r.current) == null ? void 0 : n.rectOf(e, t)) ?? null;
349
+ var n, r;
350
+ return (r = (n = l.current) == null ? void 0 : n.rectOf(e, t)) != null ? r : null;
332
351
  },
333
352
  rectOfRange: (e) => {
334
- var t;
335
- return ((t = r.current) == null ? void 0 : t.rectOfRange(e)) ?? null;
353
+ var t, n;
354
+ return (n = (t = l.current) == null ? void 0 : t.rectOfRange(e)) != null ? n : null;
336
355
  },
337
356
  redraw: () => {
338
357
  var e;
339
- return (e = r.current) == null ? void 0 : e.render();
358
+ return (e = l.current) == null ? void 0 : e.render();
340
359
  },
341
360
  isCellEditable: (e, t) => {
342
- var n;
343
- return ((n = r.current) == null ? void 0 : n.isCellEditable(e, t)) ?? !1;
361
+ var n, r;
362
+ return (r = (n = l.current) == null ? void 0 : n.isCellEditable(e, t)) != null ? r : !1;
344
363
  },
345
364
  setEditableTargets: (e) => {
346
365
  var t;
347
- return (t = r.current) == null ? void 0 : t.setEditableTargets(e);
366
+ return (t = l.current) == null ? void 0 : t.setEditableTargets(e);
348
367
  },
349
368
  getEditableTargets: () => {
350
369
  var e;
351
- return (e = r.current) == null ? void 0 : e.getEditableTargets();
370
+ return (e = l.current) == null ? void 0 : e.getEditableTargets();
352
371
  },
353
372
  editCell: (e, t, n) => {
354
- var l;
355
- return ((l = r.current) == null ? void 0 : l.editCell(e, t, n)) ?? !1;
373
+ var r, o;
374
+ return (o = (r = l.current) == null ? void 0 : r.editCell(e, t, n)) != null ? o : !1;
356
375
  },
357
376
  editRange: (e, t) => {
358
- var n;
359
- return ((n = r.current) == null ? void 0 : n.editRange(e, t)) ?? !1;
377
+ var n, r;
378
+ return (r = (n = l.current) == null ? void 0 : n.editRange(e, t)) != null ? r : !1;
360
379
  },
361
380
  clearRange: (e) => {
362
- var t;
363
- return ((t = r.current) == null ? void 0 : t.clearRange(e)) ?? !1;
381
+ var t, n;
382
+ return (n = (t = l.current) == null ? void 0 : t.clearRange(e)) != null ? n : !1;
364
383
  },
365
384
  setStyle: (e, t) => {
366
- var n;
367
- return ((n = r.current) == null ? void 0 : n.setStyle(e, t)) ?? !1;
385
+ var n, r;
386
+ return (r = (n = l.current) == null ? void 0 : n.setStyle(e, t)) != null ? r : !1;
368
387
  },
369
388
  getActiveFillColor: () => {
370
- var e;
371
- return ((e = r.current) == null ? void 0 : e.getActiveFillColor()) ?? "#FFFFFF";
389
+ var e, t;
390
+ return (t = (e = l.current) == null ? void 0 : e.getActiveFillColor()) != null ? t : "#FFFFFF";
372
391
  },
373
392
  getActiveFontColor: () => {
374
- var e;
375
- return ((e = r.current) == null ? void 0 : e.getActiveFontColor()) ?? "#000000";
393
+ var e, t;
394
+ return (t = (e = l.current) == null ? void 0 : e.getActiveFontColor()) != null ? t : "#000000";
376
395
  },
377
396
  setSelectionFill: (e) => {
378
- var t;
379
- return ((t = r.current) == null ? void 0 : t.setSelectionFill(e)) ?? !1;
397
+ var t, n;
398
+ return (n = (t = l.current) == null ? void 0 : t.setSelectionFill(e)) != null ? n : !1;
380
399
  },
381
400
  setSelectionFontColor: (e) => {
382
- var t;
383
- return ((t = r.current) == null ? void 0 : t.setSelectionFontColor(e)) ?? !1;
401
+ var t, n;
402
+ return (n = (t = l.current) == null ? void 0 : t.setSelectionFontColor(e)) != null ? n : !1;
384
403
  },
385
404
  getSelectionWrapState: () => {
386
- var e;
387
- return ((e = r.current) == null ? void 0 : e.getSelectionWrapState()) ?? "none";
405
+ var e, t;
406
+ return (t = (e = l.current) == null ? void 0 : e.getSelectionWrapState()) != null ? t : "none";
388
407
  },
389
408
  toggleWrapTextOnSelection: () => {
390
- var e;
391
- return ((e = r.current) == null ? void 0 : e.toggleWrapTextOnSelection()) ?? !1;
409
+ var e, t;
410
+ return (t = (e = l.current) == null ? void 0 : e.toggleWrapTextOnSelection()) != null ? t : !1;
392
411
  },
393
412
  mergeCells: (e) => {
394
- var t;
395
- return ((t = r.current) == null ? void 0 : t.mergeCells(e)) ?? !1;
413
+ var t, n;
414
+ return (n = (t = l.current) == null ? void 0 : t.mergeCells(e)) != null ? n : !1;
396
415
  },
397
416
  unmergeCells: (e) => {
398
- var t;
399
- return ((t = r.current) == null ? void 0 : t.unmergeCells(e)) ?? !1;
417
+ var t, n;
418
+ return (n = (t = l.current) == null ? void 0 : t.unmergeCells(e)) != null ? n : !1;
400
419
  },
401
420
  pasteText: (e, t) => {
402
- var n;
403
- return ((n = r.current) == null ? void 0 : n.pasteText(e, t)) ?? !1;
421
+ var n, r;
422
+ return (r = (n = l.current) == null ? void 0 : n.pasteText(e, t)) != null ? r : !1;
404
423
  },
405
424
  pasteRichHtml: (e, t) => {
406
- var n;
407
- return ((n = r.current) == null ? void 0 : n.pasteRichHtml(e, t)) ?? !1;
425
+ var n, r;
426
+ return (r = (n = l.current) == null ? void 0 : n.pasteRichHtml(e, t)) != null ? r : !1;
408
427
  },
409
428
  pasteImageBlob: (e, t) => {
410
- var n;
411
- return ((n = r.current) == null ? void 0 : n.pasteImageBlob(e, t)) ?? Promise.resolve(!1);
429
+ var n, r;
430
+ return (r = (n = l.current) == null ? void 0 : n.pasteImageBlob(e, t)) != null ? r : Promise.resolve(!1);
412
431
  },
413
432
  getImages: () => {
414
- var e;
415
- return ((e = r.current) == null ? void 0 : e.getImages()) ?? [];
433
+ var e, t;
434
+ return (t = (e = l.current) == null ? void 0 : e.getImages()) != null ? t : [];
416
435
  },
417
436
  addImage: (e) => {
418
- var t;
419
- return ((t = r.current) == null ? void 0 : t.addImage(e)) ?? -1;
437
+ var t, n;
438
+ return (n = (t = l.current) == null ? void 0 : t.addImage(e)) != null ? n : -1;
420
439
  },
421
440
  removeImage: (e) => {
422
- var t;
423
- return ((t = r.current) == null ? void 0 : t.removeImage(e)) ?? !1;
441
+ var t, n;
442
+ return (n = (t = l.current) == null ? void 0 : t.removeImage(e)) != null ? n : !1;
424
443
  },
425
444
  moveImage: (e, t, n) => {
426
- var l;
427
- return ((l = r.current) == null ? void 0 : l.moveImage(e, t, n)) ?? !1;
445
+ var r, o;
446
+ return (o = (r = l.current) == null ? void 0 : r.moveImage(e, t, n)) != null ? o : !1;
428
447
  },
429
448
  resizeImage: (e, t, n) => {
430
- var l;
431
- return ((l = r.current) == null ? void 0 : l.resizeImage(e, t, n)) ?? !1;
449
+ var r, o;
450
+ return (o = (r = l.current) == null ? void 0 : r.resizeImage(e, t, n)) != null ? o : !1;
432
451
  },
433
452
  getCellImages: () => {
434
- var e;
435
- return ((e = r.current) == null ? void 0 : e.getCellImages()) ?? [];
453
+ var e, t;
454
+ return (t = (e = l.current) == null ? void 0 : e.getCellImages()) != null ? t : [];
436
455
  },
437
456
  getCellImageAt: (e, t) => {
438
- var n;
439
- return ((n = r.current) == null ? void 0 : n.getCellImageAt(e, t)) ?? null;
457
+ var n, r;
458
+ return (r = (n = l.current) == null ? void 0 : n.getCellImageAt(e, t)) != null ? r : null;
440
459
  },
441
460
  openImageLightbox: (e, t, n) => {
442
- var l;
443
- return (l = r.current) == null ? void 0 : l.openImageLightbox(e, t, n);
461
+ var r;
462
+ return (r = l.current) == null ? void 0 : r.openImageLightbox(e, t, n);
444
463
  },
445
464
  getCellEditString: () => {
446
- var e;
447
- return ((e = r.current) == null ? void 0 : e.getCellEditString()) ?? "";
465
+ var e, t;
466
+ return (t = (e = l.current) == null ? void 0 : e.getCellEditString()) != null ? t : "";
448
467
  },
449
468
  canEditActiveCell: () => {
450
- var e;
451
- return ((e = r.current) == null ? void 0 : e.canEditActiveCell()) ?? !1;
469
+ var e, t;
470
+ return (t = (e = l.current) == null ? void 0 : e.canEditActiveCell()) != null ? t : !1;
452
471
  },
453
472
  commitActiveCellValue: (e, t) => {
454
- var n;
455
- return ((n = r.current) == null ? void 0 : n.commitActiveCellValue(e, t)) ?? !1;
473
+ var n, r;
474
+ return (r = (n = l.current) == null ? void 0 : n.commitActiveCellValue(e, t)) != null ? r : !1;
456
475
  },
457
476
  setCellImageFit: (e) => {
458
477
  var t;
459
- return (t = r.current) == null ? void 0 : t.setCellImageFit(e);
478
+ return (t = l.current) == null ? void 0 : t.setCellImageFit(e);
460
479
  },
461
480
  convertImageToCell: (e, t, n) => {
462
- var l;
463
- return ((l = r.current) == null ? void 0 : l.convertImageToCell(e, t, n)) ?? !1;
481
+ var r, o;
482
+ return (o = (r = l.current) == null ? void 0 : r.convertImageToCell(e, t, n)) != null ? o : !1;
464
483
  },
465
484
  convertImageToCellAuto: (e) => {
466
- var t;
467
- return ((t = r.current) == null ? void 0 : t.convertImageToCellAuto(e)) ?? !1;
485
+ var t, n;
486
+ return (n = (t = l.current) == null ? void 0 : t.convertImageToCellAuto(e)) != null ? n : !1;
468
487
  },
469
488
  convertAllImagesToCells: (e) => {
470
- var t;
471
- return ((t = r.current) == null ? void 0 : t.convertAllImagesToCells(e)) ?? 0;
489
+ var t, n;
490
+ return (n = (t = l.current) == null ? void 0 : t.convertAllImagesToCells(e)) != null ? n : 0;
472
491
  },
473
- convertImagesInRangeToCell: (e) => b({}, async (t) => {
474
- var n, l;
475
- return (n = t.onProgress) == null || n.call(t, { stage: "convert", label: "选区浮动图批量嵌入…" }), ((l = r.current) == null ? void 0 : l.convertImagesInRangeToCell(e)) ?? 0;
492
+ convertImagesInRangeToCell: (e) => p({}, async (t) => {
493
+ var n, r, o;
494
+ return (n = t.onProgress) == null || n.call(t, { stage: "convert", label: "选区浮动图批量嵌入…" }), (o = (r = l.current) == null ? void 0 : r.convertImagesInRangeToCell(e)) != null ? o : 0;
476
495
  }),
477
- convertCellImagesInRangeToFloat: (e, t) => b({}, async (n) => {
478
- var l, o;
479
- return (l = n.onProgress) == null || l.call(n, { stage: "convert", label: "选区内嵌图批量浮动化…" }), ((o = r.current) == null ? void 0 : o.convertCellImagesInRangeToFloat(e, t)) ?? 0;
496
+ convertCellImagesInRangeToFloat: (e, t) => p({}, async (n) => {
497
+ var r, o, u;
498
+ return (r = n.onProgress) == null || r.call(n, { stage: "convert", label: "选区内嵌图批量浮动化…" }), (u = (o = l.current) == null ? void 0 : o.convertCellImagesInRangeToFloat(e, t)) != null ? u : 0;
480
499
  }),
481
500
  openContextMenu: (e, t, n) => {
482
- var l;
483
- return (l = r.current) == null ? void 0 : l.openContextMenu(e, t, n);
501
+ var r;
502
+ return (r = l.current) == null ? void 0 : r.openContextMenu(e, t, n);
484
503
  },
485
504
  closeContextMenu: () => {
486
505
  var e;
487
- return (e = r.current) == null ? void 0 : e.closeContextMenu();
506
+ return (e = l.current) == null ? void 0 : e.closeContextMenu();
488
507
  },
489
508
  convertCellImageToFloat: (e, t, n) => {
490
- var l;
491
- return ((l = r.current) == null ? void 0 : l.convertCellImageToFloat(e, t, n)) ?? !1;
509
+ var r, o;
510
+ return (o = (r = l.current) == null ? void 0 : r.convertCellImageToFloat(e, t, n)) != null ? o : !1;
492
511
  },
493
512
  insertRows: (e, t) => {
494
- var n;
495
- return ((n = r.current) == null ? void 0 : n.insertRows(e, t)) ?? !1;
513
+ var n, r;
514
+ return (r = (n = l.current) == null ? void 0 : n.insertRows(e, t)) != null ? r : !1;
496
515
  },
497
516
  deleteRows: (e, t) => {
498
- var n;
499
- return ((n = r.current) == null ? void 0 : n.deleteRows(e, t)) ?? !1;
517
+ var n, r;
518
+ return (r = (n = l.current) == null ? void 0 : n.deleteRows(e, t)) != null ? r : !1;
500
519
  },
501
520
  insertCols: (e, t) => {
502
- var n;
503
- return ((n = r.current) == null ? void 0 : n.insertCols(e, t)) ?? !1;
521
+ var n, r;
522
+ return (r = (n = l.current) == null ? void 0 : n.insertCols(e, t)) != null ? r : !1;
504
523
  },
505
524
  deleteCols: (e, t) => {
506
- var n;
507
- return ((n = r.current) == null ? void 0 : n.deleteCols(e, t)) ?? !1;
525
+ var n, r;
526
+ return (r = (n = l.current) == null ? void 0 : n.deleteCols(e, t)) != null ? r : !1;
508
527
  },
509
528
  undo: () => {
510
529
  var e;
511
- return (e = r.current) == null ? void 0 : e.undo();
530
+ return (e = l.current) == null ? void 0 : e.undo();
512
531
  },
513
532
  redo: () => {
514
533
  var e;
515
- return (e = r.current) == null ? void 0 : e.redo();
534
+ return (e = l.current) == null ? void 0 : e.redo();
516
535
  },
517
536
  canUndo: () => {
518
- var e;
519
- return ((e = r.current) == null ? void 0 : e.canUndo()) ?? !1;
537
+ var e, t;
538
+ return (t = (e = l.current) == null ? void 0 : e.canUndo()) != null ? t : !1;
520
539
  },
521
540
  canRedo: () => {
522
- var e;
523
- return ((e = r.current) == null ? void 0 : e.canRedo()) ?? !1;
541
+ var e, t;
542
+ return (t = (e = l.current) == null ? void 0 : e.canRedo()) != null ? t : !1;
524
543
  },
525
544
  getEditingCell: () => {
526
- var e;
527
- return ((e = r.current) == null ? void 0 : e.getEditingCell()) ?? null;
545
+ var e, t;
546
+ return (t = (e = l.current) == null ? void 0 : e.getEditingCell()) != null ? t : null;
528
547
  },
529
548
  getCellSnapshot: (e, t) => {
530
- var n;
531
- return ((n = r.current) == null ? void 0 : n.getCellSnapshot(e, t)) ?? null;
549
+ var n, r;
550
+ return (r = (n = l.current) == null ? void 0 : n.getCellSnapshot(e, t)) != null ? r : null;
532
551
  },
533
552
  inspectCell: (e, t) => {
534
- var n;
535
- return ((n = r.current) == null ? void 0 : n.inspectCell(e, t)) ?? null;
553
+ var n, r;
554
+ return (r = (n = l.current) == null ? void 0 : n.inspectCell(e, t)) != null ? r : null;
536
555
  },
537
556
  beginEdit: (e, t) => {
538
- var n;
539
- return ((n = r.current) == null ? void 0 : n.beginEdit(e, t)) ?? !1;
557
+ var n, r;
558
+ return (r = (n = l.current) == null ? void 0 : n.beginEdit(e, t)) != null ? r : !1;
540
559
  },
541
560
  cancelEdit: () => {
542
561
  var e;
543
- return (e = r.current) == null ? void 0 : e.cancelEdit();
562
+ return (e = l.current) == null ? void 0 : e.cancelEdit();
544
563
  },
545
564
  isEditing: () => {
546
- var e;
547
- return ((e = r.current) == null ? void 0 : e.isEditing()) ?? !1;
565
+ var e, t;
566
+ return (t = (e = l.current) == null ? void 0 : e.isEditing()) != null ? t : !1;
548
567
  },
549
568
  setColumnWidth: (e, t) => {
550
- var n;
551
- return ((n = r.current) == null ? void 0 : n.setColumnWidth(e, t)) ?? 0;
569
+ var n, r;
570
+ return (r = (n = l.current) == null ? void 0 : n.setColumnWidth(e, t)) != null ? r : 0;
552
571
  },
553
572
  setRowHeight: (e, t) => {
554
- var n;
555
- return ((n = r.current) == null ? void 0 : n.setRowHeight(e, t)) ?? 0;
573
+ var n, r;
574
+ return (r = (n = l.current) == null ? void 0 : n.setRowHeight(e, t)) != null ? r : 0;
556
575
  },
557
576
  autoFitColumns: (e) => {
558
- var t;
559
- return ((t = r.current) == null ? void 0 : t.autoFitColumns(e)) ?? 0;
577
+ var t, n;
578
+ return (n = (t = l.current) == null ? void 0 : t.autoFitColumns(e)) != null ? n : 0;
560
579
  },
561
580
  autoFitRows: (e) => {
562
- var t;
563
- return ((t = r.current) == null ? void 0 : t.autoFitRows(e)) ?? 0;
581
+ var t, n;
582
+ return (n = (t = l.current) == null ? void 0 : t.autoFitRows(e)) != null ? n : 0;
564
583
  },
565
584
  resetColumnWidth: (e) => {
566
- var t;
567
- return ((t = r.current) == null ? void 0 : t.resetColumnWidth(e)) ?? 0;
585
+ var t, n;
586
+ return (n = (t = l.current) == null ? void 0 : t.resetColumnWidth(e)) != null ? n : 0;
568
587
  },
569
588
  resetRowHeight: (e) => {
570
- var t;
571
- return ((t = r.current) == null ? void 0 : t.resetRowHeight(e)) ?? 0;
589
+ var t, n;
590
+ return (n = (t = l.current) == null ? void 0 : t.resetRowHeight(e)) != null ? n : 0;
572
591
  },
573
592
  isRecalcReady: () => {
574
- var e;
575
- return ((e = r.current) == null ? void 0 : e.isRecalcReady()) ?? !1;
593
+ var e, t;
594
+ return (t = (e = l.current) == null ? void 0 : e.isRecalcReady()) != null ? t : !1;
576
595
  },
577
596
  getVirtualExtent: () => {
578
- var e;
579
- return ((e = r.current) == null ? void 0 : e.getVirtualExtent()) ?? { rows: 0, cols: 0 };
597
+ var e, t;
598
+ return (t = (e = l.current) == null ? void 0 : e.getVirtualExtent()) != null ? t : { rows: 0, cols: 0 };
580
599
  },
581
600
  isDirty: () => {
582
- var e;
583
- return ((e = r.current) == null ? void 0 : e.isDirty()) ?? !1;
601
+ var e, t;
602
+ return (t = (e = l.current) == null ? void 0 : e.isDirty()) != null ? t : !1;
584
603
  },
585
604
  resetToOriginal: () => {
586
- var e;
587
- return ((e = r.current) == null ? void 0 : e.resetToOriginal()) ?? !1;
588
- },
589
- exportImage: (e) => b(e, (t) => r.current.exportImage(t)),
590
- downloadImage: (e) => b(e, (t) => r.current.downloadImage(t)),
591
- exportPdf: (e) => b(e, (t) => r.current.exportPdf(t)),
592
- downloadPdf: (e) => b(e, (t) => r.current.downloadPdf(t)),
593
- print: (e) => b(e, (t) => r.current.print(t)),
594
- exportXlsx: (e) => b(e, (t) => r.current.exportXlsx(t)),
595
- downloadXlsx: (e) => b(e, (t) => r.current.downloadXlsx(t)),
605
+ var e, t;
606
+ return (t = (e = l.current) == null ? void 0 : e.resetToOriginal()) != null ? t : !1;
607
+ },
608
+ exportImage: (e) => p(e, (t) => l.current.exportImage(t)),
609
+ downloadImage: (e) => p(e, (t) => l.current.downloadImage(t)),
610
+ exportPdf: (e) => p(e, (t) => l.current.exportPdf(t)),
611
+ downloadPdf: (e) => p(e, (t) => l.current.downloadPdf(t)),
612
+ print: (e) => p(e, (t) => l.current.print(t)),
613
+ exportXlsx: (e) => p(e, (t) => l.current.exportXlsx(t)),
614
+ downloadXlsx: (e) => p(e, (t) => l.current.downloadXlsx(t)),
596
615
  exportJson: (e) => {
597
- var t;
598
- return ((t = r.current) == null ? void 0 : t.exportJson(e)) ?? "{}";
616
+ var t, n;
617
+ return (n = (t = l.current) == null ? void 0 : t.exportJson(e)) != null ? n : "{}";
599
618
  },
600
619
  downloadJson: (e) => {
601
620
  var t;
602
- return (t = r.current) == null ? void 0 : t.downloadJson(e);
621
+ return (t = l.current) == null ? void 0 : t.downloadJson(e);
603
622
  },
604
623
  exportCsv: (e) => {
605
- var t;
606
- return ((t = r.current) == null ? void 0 : t.exportCsv(e)) ?? "";
624
+ var t, n;
625
+ return (n = (t = l.current) == null ? void 0 : t.exportCsv(e)) != null ? n : "";
607
626
  },
608
627
  downloadCsv: (e) => {
609
628
  var t;
610
- return (t = r.current) == null ? void 0 : t.downloadCsv(e);
629
+ return (t = l.current) == null ? void 0 : t.downloadCsv(e);
611
630
  },
612
631
  getCellValue: (e, t, n) => {
613
- const l = le(n);
614
- return l ? Nt(l, e, t) : null;
632
+ const r = ce(n);
633
+ return r ? Kt(r, e, t) : null;
615
634
  },
616
635
  getCellText: (e, t, n) => {
617
- const l = le(n);
618
- return l ? kt(l, e, t, Qe) : "";
636
+ const r = ce(n);
637
+ return r ? _t(r, e, t, et) : "";
619
638
  },
620
639
  getSheetData: (e, t) => {
621
- const n = le(t);
622
- return n ? Ft(n, Ne(e)) : [];
640
+ const n = ce(t);
641
+ return n ? Jt(n, Me(e)) : [];
623
642
  },
624
643
  getSheetJSON: (e, t) => {
625
- const n = le(t);
626
- return n ? Et(n, Ne(e)) : [];
644
+ const n = ce(t);
645
+ return n ? Vt(n, Me(e)) : [];
627
646
  },
628
647
  getRangeData: (e, t, n) => {
629
- const l = le(n);
630
- return l ? Rt(l, e, Ne(t)) : [];
648
+ const r = ce(n);
649
+ return r ? Bt(r, e, Me(t)) : [];
631
650
  }
632
651
  }),
633
652
  // eslint-disable-next-line react-hooks/exhaustive-deps
634
653
  [s, N]
635
654
  );
636
- const oe = (e) => {
637
- var t;
638
- return ((t = G.current) == null ? void 0 : t.sheets[e ?? Re.current]) ?? null;
639
- }, de = () => {
640
- var e;
641
- return ((e = G.current) == null ? void 0 : e.date1904) ?? !1;
642
- }, ge = v({
643
- load: (e) => A(e, q),
644
- getWorkbook: () => G.current,
645
- getActiveSheet: () => Re.current,
655
+ const ae = (e) => {
656
+ var t, n;
657
+ return (n = (t = Y.current) == null ? void 0 : t.sheets[e != null ? e : Fe.current]) != null ? n : null;
658
+ }, fe = () => {
659
+ var e, t;
660
+ return (t = (e = Y.current) == null ? void 0 : e.date1904) != null ? t : !1;
661
+ }, me = v({
662
+ load: (e) => z(e, ee),
663
+ getWorkbook: () => Y.current,
664
+ getActiveSheet: () => Fe.current,
646
665
  setActiveSheet: (e) => {
647
666
  var t;
648
- (t = G.current) != null && t.sheets[e] && $(e);
667
+ (t = Y.current) != null && t.sheets[e] && U(e);
649
668
  },
650
669
  getSelection: () => {
651
- var e;
652
- return ((e = r.current) == null ? void 0 : e.getSelection()) ?? null;
670
+ var e, t;
671
+ return (t = (e = l.current) == null ? void 0 : e.getSelection()) != null ? t : null;
653
672
  },
654
673
  setSelection: (e) => {
655
674
  var t;
656
- return (t = r.current) == null ? void 0 : t.setSelectionRange(e);
675
+ return (t = l.current) == null ? void 0 : t.setSelectionRange(e);
657
676
  },
658
677
  rectOf: (e, t) => {
659
- var n;
660
- return ((n = r.current) == null ? void 0 : n.rectOf(e, t)) ?? null;
678
+ var n, r;
679
+ return (r = (n = l.current) == null ? void 0 : n.rectOf(e, t)) != null ? r : null;
661
680
  },
662
681
  rectOfRange: (e) => {
663
- var t;
664
- return ((t = r.current) == null ? void 0 : t.rectOfRange(e)) ?? null;
682
+ var t, n;
683
+ return (n = (t = l.current) == null ? void 0 : t.rectOfRange(e)) != null ? n : null;
665
684
  },
666
685
  redraw: () => {
667
686
  var e;
668
- return (e = r.current) == null ? void 0 : e.render();
687
+ return (e = l.current) == null ? void 0 : e.render();
669
688
  },
670
689
  isCellEditable: (e, t) => {
671
- var n;
672
- return ((n = r.current) == null ? void 0 : n.isCellEditable(e, t)) ?? !1;
690
+ var n, r;
691
+ return (r = (n = l.current) == null ? void 0 : n.isCellEditable(e, t)) != null ? r : !1;
673
692
  },
674
693
  setEditableTargets: (e) => {
675
694
  var t;
676
- return (t = r.current) == null ? void 0 : t.setEditableTargets(e);
695
+ return (t = l.current) == null ? void 0 : t.setEditableTargets(e);
677
696
  },
678
697
  getEditableTargets: () => {
679
698
  var e;
680
- return (e = r.current) == null ? void 0 : e.getEditableTargets();
699
+ return (e = l.current) == null ? void 0 : e.getEditableTargets();
681
700
  },
682
701
  editCell: (e, t, n) => {
683
- var l;
684
- return ((l = r.current) == null ? void 0 : l.editCell(e, t, n)) ?? !1;
702
+ var r, o;
703
+ return (o = (r = l.current) == null ? void 0 : r.editCell(e, t, n)) != null ? o : !1;
685
704
  },
686
705
  editRange: (e, t) => {
687
- var n;
688
- return ((n = r.current) == null ? void 0 : n.editRange(e, t)) ?? !1;
706
+ var n, r;
707
+ return (r = (n = l.current) == null ? void 0 : n.editRange(e, t)) != null ? r : !1;
689
708
  },
690
709
  clearRange: (e) => {
691
- var t;
692
- return ((t = r.current) == null ? void 0 : t.clearRange(e)) ?? !1;
710
+ var t, n;
711
+ return (n = (t = l.current) == null ? void 0 : t.clearRange(e)) != null ? n : !1;
693
712
  },
694
713
  setStyle: (e, t) => {
695
- var n;
696
- return ((n = r.current) == null ? void 0 : n.setStyle(e, t)) ?? !1;
714
+ var n, r;
715
+ return (r = (n = l.current) == null ? void 0 : n.setStyle(e, t)) != null ? r : !1;
697
716
  },
698
717
  getActiveFillColor: () => {
699
- var e;
700
- return ((e = r.current) == null ? void 0 : e.getActiveFillColor()) ?? "#FFFFFF";
718
+ var e, t;
719
+ return (t = (e = l.current) == null ? void 0 : e.getActiveFillColor()) != null ? t : "#FFFFFF";
701
720
  },
702
721
  getActiveFontColor: () => {
703
- var e;
704
- return ((e = r.current) == null ? void 0 : e.getActiveFontColor()) ?? "#000000";
722
+ var e, t;
723
+ return (t = (e = l.current) == null ? void 0 : e.getActiveFontColor()) != null ? t : "#000000";
705
724
  },
706
725
  setSelectionFill: (e) => {
707
- var t;
708
- return ((t = r.current) == null ? void 0 : t.setSelectionFill(e)) ?? !1;
726
+ var t, n;
727
+ return (n = (t = l.current) == null ? void 0 : t.setSelectionFill(e)) != null ? n : !1;
709
728
  },
710
729
  setSelectionFontColor: (e) => {
711
- var t;
712
- return ((t = r.current) == null ? void 0 : t.setSelectionFontColor(e)) ?? !1;
730
+ var t, n;
731
+ return (n = (t = l.current) == null ? void 0 : t.setSelectionFontColor(e)) != null ? n : !1;
713
732
  },
714
733
  getSelectionWrapState: () => {
715
- var e;
716
- return ((e = r.current) == null ? void 0 : e.getSelectionWrapState()) ?? "none";
734
+ var e, t;
735
+ return (t = (e = l.current) == null ? void 0 : e.getSelectionWrapState()) != null ? t : "none";
717
736
  },
718
737
  toggleWrapTextOnSelection: () => {
719
- var e;
720
- return ((e = r.current) == null ? void 0 : e.toggleWrapTextOnSelection()) ?? !1;
738
+ var e, t;
739
+ return (t = (e = l.current) == null ? void 0 : e.toggleWrapTextOnSelection()) != null ? t : !1;
721
740
  },
722
741
  mergeCells: (e) => {
723
- var t;
724
- return ((t = r.current) == null ? void 0 : t.mergeCells(e)) ?? !1;
742
+ var t, n;
743
+ return (n = (t = l.current) == null ? void 0 : t.mergeCells(e)) != null ? n : !1;
725
744
  },
726
745
  unmergeCells: (e) => {
727
- var t;
728
- return ((t = r.current) == null ? void 0 : t.unmergeCells(e)) ?? !1;
746
+ var t, n;
747
+ return (n = (t = l.current) == null ? void 0 : t.unmergeCells(e)) != null ? n : !1;
729
748
  },
730
749
  pasteText: (e, t) => {
731
- var n;
732
- return ((n = r.current) == null ? void 0 : n.pasteText(e, t)) ?? !1;
750
+ var n, r;
751
+ return (r = (n = l.current) == null ? void 0 : n.pasteText(e, t)) != null ? r : !1;
733
752
  },
734
753
  pasteRichHtml: (e, t) => {
735
- var n;
736
- return ((n = r.current) == null ? void 0 : n.pasteRichHtml(e, t)) ?? !1;
754
+ var n, r;
755
+ return (r = (n = l.current) == null ? void 0 : n.pasteRichHtml(e, t)) != null ? r : !1;
737
756
  },
738
757
  pasteImageBlob: (e, t) => {
739
- var n;
740
- return ((n = r.current) == null ? void 0 : n.pasteImageBlob(e, t)) ?? Promise.resolve(!1);
758
+ var n, r;
759
+ return (r = (n = l.current) == null ? void 0 : n.pasteImageBlob(e, t)) != null ? r : Promise.resolve(!1);
741
760
  },
742
761
  getImages: () => {
743
- var e;
744
- return ((e = r.current) == null ? void 0 : e.getImages()) ?? [];
762
+ var e, t;
763
+ return (t = (e = l.current) == null ? void 0 : e.getImages()) != null ? t : [];
745
764
  },
746
765
  addImage: (e) => {
747
- var t;
748
- return ((t = r.current) == null ? void 0 : t.addImage(e)) ?? -1;
766
+ var t, n;
767
+ return (n = (t = l.current) == null ? void 0 : t.addImage(e)) != null ? n : -1;
749
768
  },
750
769
  removeImage: (e) => {
751
- var t;
752
- return ((t = r.current) == null ? void 0 : t.removeImage(e)) ?? !1;
770
+ var t, n;
771
+ return (n = (t = l.current) == null ? void 0 : t.removeImage(e)) != null ? n : !1;
753
772
  },
754
773
  moveImage: (e, t, n) => {
755
- var l;
756
- return ((l = r.current) == null ? void 0 : l.moveImage(e, t, n)) ?? !1;
774
+ var r, o;
775
+ return (o = (r = l.current) == null ? void 0 : r.moveImage(e, t, n)) != null ? o : !1;
757
776
  },
758
777
  resizeImage: (e, t, n) => {
759
- var l;
760
- return ((l = r.current) == null ? void 0 : l.resizeImage(e, t, n)) ?? !1;
778
+ var r, o;
779
+ return (o = (r = l.current) == null ? void 0 : r.resizeImage(e, t, n)) != null ? o : !1;
761
780
  },
762
781
  getCellImages: () => {
763
- var e;
764
- return ((e = r.current) == null ? void 0 : e.getCellImages()) ?? [];
782
+ var e, t;
783
+ return (t = (e = l.current) == null ? void 0 : e.getCellImages()) != null ? t : [];
765
784
  },
766
785
  getCellImageAt: (e, t) => {
767
- var n;
768
- return ((n = r.current) == null ? void 0 : n.getCellImageAt(e, t)) ?? null;
786
+ var n, r;
787
+ return (r = (n = l.current) == null ? void 0 : n.getCellImageAt(e, t)) != null ? r : null;
769
788
  },
770
789
  openImageLightbox: (e, t, n) => {
771
- var l;
772
- return (l = r.current) == null ? void 0 : l.openImageLightbox(e, t, n);
790
+ var r;
791
+ return (r = l.current) == null ? void 0 : r.openImageLightbox(e, t, n);
773
792
  },
774
793
  getCellEditString: () => {
775
- var e;
776
- return ((e = r.current) == null ? void 0 : e.getCellEditString()) ?? "";
794
+ var e, t;
795
+ return (t = (e = l.current) == null ? void 0 : e.getCellEditString()) != null ? t : "";
777
796
  },
778
797
  canEditActiveCell: () => {
779
- var e;
780
- return ((e = r.current) == null ? void 0 : e.canEditActiveCell()) ?? !1;
798
+ var e, t;
799
+ return (t = (e = l.current) == null ? void 0 : e.canEditActiveCell()) != null ? t : !1;
781
800
  },
782
801
  commitActiveCellValue: (e, t) => {
783
- var n;
784
- return ((n = r.current) == null ? void 0 : n.commitActiveCellValue(e, t)) ?? !1;
802
+ var n, r;
803
+ return (r = (n = l.current) == null ? void 0 : n.commitActiveCellValue(e, t)) != null ? r : !1;
785
804
  },
786
805
  setCellImageFit: (e) => {
787
806
  var t;
788
- return (t = r.current) == null ? void 0 : t.setCellImageFit(e);
807
+ return (t = l.current) == null ? void 0 : t.setCellImageFit(e);
789
808
  },
790
809
  convertImageToCell: (e, t, n) => {
791
- var l;
792
- return ((l = r.current) == null ? void 0 : l.convertImageToCell(e, t, n)) ?? !1;
810
+ var r, o;
811
+ return (o = (r = l.current) == null ? void 0 : r.convertImageToCell(e, t, n)) != null ? o : !1;
793
812
  },
794
813
  convertImageToCellAuto: (e) => {
795
- var t;
796
- return ((t = r.current) == null ? void 0 : t.convertImageToCellAuto(e)) ?? !1;
814
+ var t, n;
815
+ return (n = (t = l.current) == null ? void 0 : t.convertImageToCellAuto(e)) != null ? n : !1;
797
816
  },
798
817
  convertAllImagesToCells: (e) => {
799
- var t;
800
- return ((t = r.current) == null ? void 0 : t.convertAllImagesToCells(e)) ?? 0;
818
+ var t, n;
819
+ return (n = (t = l.current) == null ? void 0 : t.convertAllImagesToCells(e)) != null ? n : 0;
801
820
  },
802
- convertImagesInRangeToCell: (e) => b({}, async (t) => {
803
- var n, l;
804
- return (n = t.onProgress) == null || n.call(t, { stage: "convert", label: "选区浮动图批量嵌入…" }), ((l = r.current) == null ? void 0 : l.convertImagesInRangeToCell(e)) ?? 0;
821
+ convertImagesInRangeToCell: (e) => p({}, async (t) => {
822
+ var n, r, o;
823
+ return (n = t.onProgress) == null || n.call(t, { stage: "convert", label: "选区浮动图批量嵌入…" }), (o = (r = l.current) == null ? void 0 : r.convertImagesInRangeToCell(e)) != null ? o : 0;
805
824
  }),
806
- convertCellImagesInRangeToFloat: (e, t) => b({}, async (n) => {
807
- var l, o;
808
- return (l = n.onProgress) == null || l.call(n, { stage: "convert", label: "选区内嵌图批量浮动化…" }), ((o = r.current) == null ? void 0 : o.convertCellImagesInRangeToFloat(e, t)) ?? 0;
825
+ convertCellImagesInRangeToFloat: (e, t) => p({}, async (n) => {
826
+ var r, o, u;
827
+ return (r = n.onProgress) == null || r.call(n, { stage: "convert", label: "选区内嵌图批量浮动化…" }), (u = (o = l.current) == null ? void 0 : o.convertCellImagesInRangeToFloat(e, t)) != null ? u : 0;
809
828
  }),
810
829
  openContextMenu: (e, t, n) => {
811
- var l;
812
- return (l = r.current) == null ? void 0 : l.openContextMenu(e, t, n);
830
+ var r;
831
+ return (r = l.current) == null ? void 0 : r.openContextMenu(e, t, n);
813
832
  },
814
833
  closeContextMenu: () => {
815
834
  var e;
816
- return (e = r.current) == null ? void 0 : e.closeContextMenu();
835
+ return (e = l.current) == null ? void 0 : e.closeContextMenu();
817
836
  },
818
837
  convertCellImageToFloat: (e, t, n) => {
819
- var l;
820
- return ((l = r.current) == null ? void 0 : l.convertCellImageToFloat(e, t, n)) ?? !1;
838
+ var r, o;
839
+ return (o = (r = l.current) == null ? void 0 : r.convertCellImageToFloat(e, t, n)) != null ? o : !1;
821
840
  },
822
841
  insertRows: (e, t) => {
823
- var n;
824
- return ((n = r.current) == null ? void 0 : n.insertRows(e, t)) ?? !1;
842
+ var n, r;
843
+ return (r = (n = l.current) == null ? void 0 : n.insertRows(e, t)) != null ? r : !1;
825
844
  },
826
845
  deleteRows: (e, t) => {
827
- var n;
828
- return ((n = r.current) == null ? void 0 : n.deleteRows(e, t)) ?? !1;
846
+ var n, r;
847
+ return (r = (n = l.current) == null ? void 0 : n.deleteRows(e, t)) != null ? r : !1;
829
848
  },
830
849
  insertCols: (e, t) => {
831
- var n;
832
- return ((n = r.current) == null ? void 0 : n.insertCols(e, t)) ?? !1;
850
+ var n, r;
851
+ return (r = (n = l.current) == null ? void 0 : n.insertCols(e, t)) != null ? r : !1;
833
852
  },
834
853
  deleteCols: (e, t) => {
835
- var n;
836
- return ((n = r.current) == null ? void 0 : n.deleteCols(e, t)) ?? !1;
854
+ var n, r;
855
+ return (r = (n = l.current) == null ? void 0 : n.deleteCols(e, t)) != null ? r : !1;
837
856
  },
838
857
  undo: () => {
839
858
  var e;
840
- return (e = r.current) == null ? void 0 : e.undo();
859
+ return (e = l.current) == null ? void 0 : e.undo();
841
860
  },
842
861
  redo: () => {
843
862
  var e;
844
- return (e = r.current) == null ? void 0 : e.redo();
863
+ return (e = l.current) == null ? void 0 : e.redo();
845
864
  },
846
865
  canUndo: () => {
847
- var e;
848
- return ((e = r.current) == null ? void 0 : e.canUndo()) ?? !1;
866
+ var e, t;
867
+ return (t = (e = l.current) == null ? void 0 : e.canUndo()) != null ? t : !1;
849
868
  },
850
869
  canRedo: () => {
851
- var e;
852
- return ((e = r.current) == null ? void 0 : e.canRedo()) ?? !1;
870
+ var e, t;
871
+ return (t = (e = l.current) == null ? void 0 : e.canRedo()) != null ? t : !1;
853
872
  },
854
873
  getEditingCell: () => {
855
- var e;
856
- return ((e = r.current) == null ? void 0 : e.getEditingCell()) ?? null;
874
+ var e, t;
875
+ return (t = (e = l.current) == null ? void 0 : e.getEditingCell()) != null ? t : null;
857
876
  },
858
877
  getCellSnapshot: (e, t) => {
859
- var n;
860
- return ((n = r.current) == null ? void 0 : n.getCellSnapshot(e, t)) ?? null;
878
+ var n, r;
879
+ return (r = (n = l.current) == null ? void 0 : n.getCellSnapshot(e, t)) != null ? r : null;
861
880
  },
862
881
  inspectCell: (e, t) => {
863
- var n;
864
- return ((n = r.current) == null ? void 0 : n.inspectCell(e, t)) ?? null;
882
+ var n, r;
883
+ return (r = (n = l.current) == null ? void 0 : n.inspectCell(e, t)) != null ? r : null;
865
884
  },
866
885
  beginEdit: (e, t) => {
867
- var n;
868
- return ((n = r.current) == null ? void 0 : n.beginEdit(e, t)) ?? !1;
886
+ var n, r;
887
+ return (r = (n = l.current) == null ? void 0 : n.beginEdit(e, t)) != null ? r : !1;
869
888
  },
870
889
  cancelEdit: () => {
871
890
  var e;
872
- return (e = r.current) == null ? void 0 : e.cancelEdit();
891
+ return (e = l.current) == null ? void 0 : e.cancelEdit();
873
892
  },
874
893
  isEditing: () => {
875
- var e;
876
- return ((e = r.current) == null ? void 0 : e.isEditing()) ?? !1;
894
+ var e, t;
895
+ return (t = (e = l.current) == null ? void 0 : e.isEditing()) != null ? t : !1;
877
896
  },
878
897
  setColumnWidth: (e, t) => {
879
- var n;
880
- return ((n = r.current) == null ? void 0 : n.setColumnWidth(e, t)) ?? 0;
898
+ var n, r;
899
+ return (r = (n = l.current) == null ? void 0 : n.setColumnWidth(e, t)) != null ? r : 0;
881
900
  },
882
901
  setRowHeight: (e, t) => {
883
- var n;
884
- return ((n = r.current) == null ? void 0 : n.setRowHeight(e, t)) ?? 0;
902
+ var n, r;
903
+ return (r = (n = l.current) == null ? void 0 : n.setRowHeight(e, t)) != null ? r : 0;
885
904
  },
886
905
  autoFitColumns: (e) => {
887
- var t;
888
- return ((t = r.current) == null ? void 0 : t.autoFitColumns(e)) ?? 0;
906
+ var t, n;
907
+ return (n = (t = l.current) == null ? void 0 : t.autoFitColumns(e)) != null ? n : 0;
889
908
  },
890
909
  autoFitRows: (e) => {
891
- var t;
892
- return ((t = r.current) == null ? void 0 : t.autoFitRows(e)) ?? 0;
910
+ var t, n;
911
+ return (n = (t = l.current) == null ? void 0 : t.autoFitRows(e)) != null ? n : 0;
893
912
  },
894
913
  resetColumnWidth: (e) => {
895
- var t;
896
- return ((t = r.current) == null ? void 0 : t.resetColumnWidth(e)) ?? 0;
914
+ var t, n;
915
+ return (n = (t = l.current) == null ? void 0 : t.resetColumnWidth(e)) != null ? n : 0;
897
916
  },
898
917
  resetRowHeight: (e) => {
899
- var t;
900
- return ((t = r.current) == null ? void 0 : t.resetRowHeight(e)) ?? 0;
918
+ var t, n;
919
+ return (n = (t = l.current) == null ? void 0 : t.resetRowHeight(e)) != null ? n : 0;
901
920
  },
902
921
  isRecalcReady: () => {
903
- var e;
904
- return ((e = r.current) == null ? void 0 : e.isRecalcReady()) ?? !1;
922
+ var e, t;
923
+ return (t = (e = l.current) == null ? void 0 : e.isRecalcReady()) != null ? t : !1;
905
924
  },
906
925
  getVirtualExtent: () => {
907
- var e;
908
- return ((e = r.current) == null ? void 0 : e.getVirtualExtent()) ?? { rows: 0, cols: 0 };
926
+ var e, t;
927
+ return (t = (e = l.current) == null ? void 0 : e.getVirtualExtent()) != null ? t : { rows: 0, cols: 0 };
909
928
  },
910
929
  isDirty: () => {
911
- var e;
912
- return ((e = r.current) == null ? void 0 : e.isDirty()) ?? !1;
930
+ var e, t;
931
+ return (t = (e = l.current) == null ? void 0 : e.isDirty()) != null ? t : !1;
913
932
  },
914
933
  resetToOriginal: () => {
915
- var e;
916
- return ((e = r.current) == null ? void 0 : e.resetToOriginal()) ?? !1;
917
- },
918
- exportImage: (e) => b(e, (t) => r.current.exportImage(t)),
919
- downloadImage: (e) => b(e, (t) => r.current.downloadImage(t)),
920
- exportPdf: (e) => b(e, (t) => r.current.exportPdf(t)),
921
- downloadPdf: (e) => b(e, (t) => r.current.downloadPdf(t)),
922
- print: (e) => b(e, (t) => r.current.print(t)),
923
- exportXlsx: (e) => b(e, (t) => r.current.exportXlsx(t)),
924
- downloadXlsx: (e) => b(e, (t) => r.current.downloadXlsx(t)),
934
+ var e, t;
935
+ return (t = (e = l.current) == null ? void 0 : e.resetToOriginal()) != null ? t : !1;
936
+ },
937
+ exportImage: (e) => p(e, (t) => l.current.exportImage(t)),
938
+ downloadImage: (e) => p(e, (t) => l.current.downloadImage(t)),
939
+ exportPdf: (e) => p(e, (t) => l.current.exportPdf(t)),
940
+ downloadPdf: (e) => p(e, (t) => l.current.downloadPdf(t)),
941
+ print: (e) => p(e, (t) => l.current.print(t)),
942
+ exportXlsx: (e) => p(e, (t) => l.current.exportXlsx(t)),
943
+ downloadXlsx: (e) => p(e, (t) => l.current.downloadXlsx(t)),
925
944
  exportJson: (e) => {
926
- var t;
927
- return ((t = r.current) == null ? void 0 : t.exportJson(e)) ?? "{}";
945
+ var t, n;
946
+ return (n = (t = l.current) == null ? void 0 : t.exportJson(e)) != null ? n : "{}";
928
947
  },
929
948
  downloadJson: (e) => {
930
949
  var t;
931
- return (t = r.current) == null ? void 0 : t.downloadJson(e);
950
+ return (t = l.current) == null ? void 0 : t.downloadJson(e);
932
951
  },
933
952
  exportCsv: (e) => {
934
- var t;
935
- return ((t = r.current) == null ? void 0 : t.exportCsv(e)) ?? "";
953
+ var t, n;
954
+ return (n = (t = l.current) == null ? void 0 : t.exportCsv(e)) != null ? n : "";
936
955
  },
937
956
  downloadCsv: (e) => {
938
957
  var t;
939
- return (t = r.current) == null ? void 0 : t.downloadCsv(e);
958
+ return (t = l.current) == null ? void 0 : t.downloadCsv(e);
940
959
  },
941
960
  getCellValue: (e, t, n) => {
942
- const l = oe(n);
943
- return l ? Nt(l, e, t) : null;
961
+ const r = ae(n);
962
+ return r ? Kt(r, e, t) : null;
944
963
  },
945
964
  getCellText: (e, t, n) => {
946
- const l = oe(n);
947
- return l ? kt(l, e, t, de()) : "";
965
+ const r = ae(n);
966
+ return r ? _t(r, e, t, fe()) : "";
948
967
  },
949
968
  getSheetData: (e, t) => {
950
- const n = oe(t);
951
- return n ? Ft(n, { ...e, date1904: de() }) : [];
969
+ const n = ae(t);
970
+ return n ? Jt(n, ne(V({}, e), { date1904: fe() })) : [];
952
971
  },
953
972
  getSheetJSON: (e, t) => {
954
- const n = oe(t);
955
- return n ? Et(n, { ...e, date1904: de() }) : [];
973
+ const n = ae(t);
974
+ return n ? Vt(n, ne(V({}, e), { date1904: fe() })) : [];
956
975
  },
957
976
  getRangeData: (e, t, n) => {
958
- const l = oe(n);
959
- return l ? Rt(l, e, { ...t, date1904: de() }) : [];
977
+ const r = ae(n);
978
+ return r ? Bt(r, e, ne(V({}, t), { date1904: fe() })) : [];
960
979
  }
961
980
  }).current;
962
- E(() => {
963
- var l;
964
- const e = /* @__PURE__ */ new Map(), t = [], n = (o, m) => {
965
- let i = e.get(o);
966
- i || e.set(o, i = /* @__PURE__ */ new Set()), i.add(m);
981
+ F(() => {
982
+ var r;
983
+ const e = /* @__PURE__ */ new Map(), t = [], n = (o, u) => {
984
+ let a = e.get(o);
985
+ a || e.set(o, a = /* @__PURE__ */ new Set()), a.add(u);
967
986
  };
968
- for (const o of ue) {
987
+ for (const o of ge) {
969
988
  if (o.events)
970
- for (const [i, d] of Object.entries(o.events)) d && n(i, d);
971
- const m = (l = o.setup) == null ? void 0 : l.call(o, { viewer: ge, on: n, redraw: () => {
972
- var i;
973
- return (i = r.current) == null ? void 0 : i.render();
989
+ for (const [a, f] of Object.entries(o.events)) f && n(a, f);
990
+ const u = (r = o.setup) == null ? void 0 : r.call(o, { viewer: me, on: n, redraw: () => {
991
+ var a;
992
+ return (a = l.current) == null ? void 0 : a.render();
974
993
  } });
975
- typeof m == "function" && t.push(m);
994
+ typeof u == "function" && t.push(u);
976
995
  }
977
- return ye.current = e, ke(), () => {
978
- t.forEach((o) => o()), ye.current = /* @__PURE__ */ new Map();
996
+ return Ee.current = e, Te(), () => {
997
+ t.forEach((o) => o()), Ee.current = /* @__PURE__ */ new Map();
979
998
  };
980
999
  }, [c.plugins]);
981
- const Lt = (e) => {
982
- (e.ctrlKey || e.metaKey) && (e.key === "f" || e.key === "F") && (e.preventDefault(), he(!0));
983
- }, Te = () => {
1000
+ const Yt = (e) => {
1001
+ (e.ctrlKey || e.metaKey) && (e.key === "f" || e.key === "F") && (e.preventDefault(), xe(!0));
1002
+ }, Pe = () => {
984
1003
  var e, t;
985
- he(!1), (e = r.current) == null || e.clearFind(), (t = U.current) == null || t.focus();
986
- }, Ht = () => {
1004
+ xe(!1), (e = l.current) == null || e.clearFind(), (t = q.current) == null || t.focus();
1005
+ }, en = () => {
987
1006
  var t;
988
- const e = U.current;
989
- e && (Se.current = null, (t = r.current) == null || t.setScroll(e.scrollLeft, e.scrollTop));
990
- }, h = r.current, ce = (h == null ? void 0 : h.renderer) ?? null, V = (h == null ? void 0 : h.getActiveCell()) ?? null, R = (h == null ? void 0 : h.getSelection()) ?? null, Ye = V ? Oe(V.col) + (V.row + 1) : "", et = ce && V ? ce.cellFormula(V.row, V.col) ?? ce.cellText(V.row, V.col) : "", Bt = !!(h != null && h.canEditActiveCell()), Vt = (h == null ? void 0 : h.getCellEditString()) ?? "", Pe = ne.current ? zt : Vt, Jt = () => {
991
- ne.current = !0, He((h == null ? void 0 : h.getCellEditString()) ?? "");
992
- }, tt = (e) => {
1007
+ const e = q.current;
1008
+ e && (Ie.current = null, (t = l.current) == null || t.setScroll(e.scrollLeft, e.scrollTop));
1009
+ }, h = l.current, se = (ht = h == null ? void 0 : h.renderer) != null ? ht : null, $ = (vt = h == null ? void 0 : h.getActiveCell()) != null ? vt : null, E = (xt = h == null ? void 0 : h.getSelection()) != null ? xt : null, tt = $ ? We($.col) + ($.row + 1) : "", nt = se && $ ? (bt = se.cellFormula($.row, $.col)) != null ? bt : se.cellText($.row, $.col) : "", tn = !!(h != null && h.canEditActiveCell()), nn = (pt = h == null ? void 0 : h.getCellEditString()) != null ? pt : "", Ae = le.current ? qt : nn, rn = () => {
1010
+ var e;
1011
+ le.current = !0, Ve((e = h == null ? void 0 : h.getCellEditString()) != null ? e : "");
1012
+ }, rt = (e) => {
993
1013
  var t;
994
- h == null || h.commitActiveCellValue(Pe, e), ne.current = !1, e === "down" && ((t = U.current) == null || t.focus()), B();
995
- }, _t = () => {
1014
+ h == null || h.commitActiveCellValue(Ae, e), le.current = !1, e === "down" && ((t = q.current) == null || t.focus()), K();
1015
+ }, ln = () => {
996
1016
  var e;
997
- ne.current = !1, (e = U.current) == null || e.focus(), B();
998
- }, Kt = () => {
999
- ne.current && tt();
1000
- }, $t = (e) => {
1001
- e.stopPropagation(), e.key === "Enter" ? (e.preventDefault(), tt("down")) : e.key === "Escape" && (e.preventDefault(), _t());
1002
- }, Xt = R && !(R.top === R.bottom && R.left === R.right) ? `${Oe(R.left)}${R.top + 1}:${Oe(R.right)}${R.bottom + 1}` : "", O = ce && R ? ce.selectionStats(R) : null, fe = (h == null ? void 0 : h.getFindState()) ?? { query: "", count: 0, index: -1 }, P = (e) => ln[e], C = (e) => ({ kind: "builtin", ...e }), z = s == null ? void 0 : s.sheets[N], nt = () => {
1017
+ le.current = !1, (e = q.current) == null || e.focus(), K();
1018
+ }, on = () => {
1019
+ le.current && rt();
1020
+ }, cn = (e) => {
1021
+ e.stopPropagation(), e.key === "Enter" ? (e.preventDefault(), rt("down")) : e.key === "Escape" && (e.preventDefault(), ln());
1022
+ }, an = E && !(E.top === E.bottom && E.left === E.right) ? `${We(E.left)}${E.top + 1}:${We(E.right)}${E.bottom + 1}` : "", W = se && E ? se.selectionStats(E) : null, Ce = (St = h == null ? void 0 : h.getFindState()) != null ? St : { query: "", count: 0, index: -1 }, P = (e) => Rn[e], C = (e) => V({ kind: "builtin" }, e), L = s == null ? void 0 : s.sheets[N], lt = () => {
1003
1023
  var e;
1004
- return void ((e = r.current) == null ? void 0 : e.downloadPdf().catch(re));
1005
- }, rt = () => {
1024
+ return void ((e = l.current) == null ? void 0 : e.downloadPdf().catch(oe));
1025
+ }, ot = () => {
1006
1026
  var e;
1007
- return void ((e = r.current) == null ? void 0 : e.downloadPdf({ vector: !0 }).catch(re));
1008
- }, lt = () => {
1027
+ return void ((e = l.current) == null ? void 0 : e.downloadPdf({ vector: !0 }).catch(oe));
1028
+ }, ct = () => {
1009
1029
  var e;
1010
- return void ((e = r.current) == null ? void 0 : e.print().catch(re));
1011
- }, jt = () => {
1012
- var l;
1013
- const e = z, t = r.current;
1030
+ return void ((e = l.current) == null ? void 0 : e.print().catch(oe));
1031
+ }, sn = () => {
1032
+ var r;
1033
+ const e = L, t = l.current;
1014
1034
  if (!e || !t) return;
1015
1035
  const n = e.freeze;
1016
1036
  if (n.frozenRows || n.frozenCols) e.freeze = { frozenRows: 0, frozenCols: 0 };
@@ -1018,42 +1038,43 @@ const vn = Qt(function(c, k) {
1018
1038
  const o = t.getActiveCell();
1019
1039
  e.freeze = { frozenRows: o ? o.row : 1, frozenCols: o ? o.col : 0 };
1020
1040
  }
1021
- (l = t.renderer) == null || l.rebuildMetrics(), t.refreshContentSize(), t.render();
1041
+ (r = t.renderer) == null || r.rebuildMetrics(), t.refreshContentSize(), t.render();
1022
1042
  };
1023
- function Ut(e) {
1024
- const t = r.current;
1043
+ function un(e) {
1044
+ var n, r;
1045
+ const t = l.current;
1025
1046
  switch (e) {
1026
1047
  case "find":
1027
- return C({ id: e, iconSvg: P("find"), label: "查找", title: "查找 (Ctrl+F)", active: Ce, onClick: () => Ce ? Te() : he(!0) });
1048
+ return C({ id: e, iconSvg: P("find"), label: "查找", title: "查找 (Ctrl+F)", active: ve, onClick: () => ve ? Pe() : xe(!0) });
1028
1049
  case "filter":
1029
- return C({ id: e, iconSvg: P("filter"), label: "筛选", title: "切换自动筛选", active: !!(z != null && z.autoFilterRange), onClick: () => t == null ? void 0 : t.toggleAutoFilter() });
1050
+ return C({ id: e, iconSvg: P("filter"), label: "筛选", title: "切换自动筛选", active: !!(L != null && L.autoFilterRange), onClick: () => t == null ? void 0 : t.toggleAutoFilter() });
1030
1051
  case "clear-filter":
1031
1052
  return C({ id: e, iconSvg: P("clear-filter"), label: "清除筛选", title: "清除当前表全部筛选", disabled: !(t != null && t.hasFilters()), onClick: () => t == null ? void 0 : t.clearAllFilters() });
1032
1053
  case "copy":
1033
- return C({ id: e, iconSvg: P("copy"), label: "复制", title: "复制选区 (Ctrl+C)", disabled: !R, onClick: () => void (t == null ? void 0 : t.copySelection()) });
1054
+ return C({ id: e, iconSvg: P("copy"), label: "复制", title: "复制选区 (Ctrl+C)", disabled: !E, onClick: () => void (t == null ? void 0 : t.copySelection()) });
1034
1055
  case "wrap-text": {
1035
- const n = (t == null ? void 0 : t.getSelectionWrapState()) ?? "none";
1036
- return C({ id: e, iconSvg: P("wrap-text"), label: "自动换行", title: "自动换行(选区,WPS 风格 toggle)", active: n === "all", disabled: !R || !c.editable, onClick: () => void (t == null ? void 0 : t.toggleWrapTextOnSelection()) });
1056
+ const o = (n = t == null ? void 0 : t.getSelectionWrapState()) != null ? n : "none";
1057
+ return C({ id: e, iconSvg: P("wrap-text"), label: "自动换行", title: "自动换行(选区,WPS 风格 toggle)", active: o === "all", disabled: !E || !c.editable, onClick: () => void (t == null ? void 0 : t.toggleWrapTextOnSelection()) });
1037
1058
  }
1038
1059
  case "template": {
1039
- const n = !!ee, l = te, o = !!c.src && !c.workbook;
1060
+ const o = !!Z, u = _, a = !!c.src && !c.workbook;
1040
1061
  return C({
1041
1062
  id: e,
1042
1063
  iconSvg: P("template"),
1043
1064
  label: "模板",
1044
- title: o ? "模板仅对 JSON / 模型数据源生效;当前是 .xlsx 数据源,模板不可用" : n ? `模板已加载:${l || "(未命名)"}` : "为 JSON / 模型数据源套用 .xlsx 模板的样式;模板的文字内容会被丢弃",
1045
- active: n,
1046
- disabled: o,
1065
+ title: a ? "模板仅对 JSON / 模型数据源生效;当前是 .xlsx 数据源,模板不可用" : o ? `模板已加载:${u || "(未命名)"}` : "为 JSON / 模型数据源套用 .xlsx 模板的样式;模板的文字内容会被丢弃",
1066
+ active: o,
1067
+ disabled: a,
1047
1068
  items: [
1048
- C({ id: "tpl-default", label: (n ? "" : "✓ ") + "默认渲染", title: "不套模板,数据按默认样式渲染", disabled: !n, onClick: ze }),
1069
+ C({ id: "tpl-default", label: (o ? "" : "✓ ") + "默认渲染", title: "不套模板,数据按默认样式渲染", disabled: !o, onClick: Le }),
1049
1070
  C({ id: "tpl-sep", type: "separator" }),
1050
- C({ id: "tpl-import", label: "导入 .xlsx 模板…", title: "选一份 .xlsx, 把它的 styling 套到当前 JSON 数据上", onClick: Dt }),
1051
- C({ id: "tpl-clear", label: "清除模板", title: "切回默认样式渲染", disabled: !n, onClick: ze })
1071
+ C({ id: "tpl-import", label: "导入 .xlsx 模板…", title: "选一份 .xlsx, 把它的 styling 套到当前 JSON 数据上", onClick: Zt }),
1072
+ C({ id: "tpl-clear", label: "清除模板", title: "切回默认样式渲染", disabled: !o, onClick: Le })
1052
1073
  ]
1053
1074
  });
1054
1075
  }
1055
1076
  case "image-tools": {
1056
- const n = R, l = t == null ? void 0 : t.getActiveCell(), o = ((z == null ? void 0 : z.images.length) ?? 0) > 0;
1077
+ const o = E, u = t == null ? void 0 : t.getActiveCell(), a = ((r = L == null ? void 0 : L.images.length) != null ? r : 0) > 0;
1057
1078
  return C({
1058
1079
  id: e,
1059
1080
  iconSvg: P("image-tools"),
@@ -1061,17 +1082,17 @@ const vn = Qt(function(c, k) {
1061
1082
  title: "浮动图 ⇄ 单元格内嵌图(WPS DISPIMG)互转",
1062
1083
  disabled: !c.editable,
1063
1084
  items: [
1064
- C({ id: "img-sel-to-cell", label: "选区:浮动 → 嵌入", title: '把选区里"中心格在选区内"的浮动图就近嵌入', disabled: !n || !o, onClick: () => n && (t == null ? void 0 : t.convertImagesInRangeToCell(n)) }),
1065
- C({ id: "img-sel-to-float", label: "选区:嵌入 → 浮动", title: "把选区内所有 DISPIMG 格拎成浮动图", disabled: !n, onClick: () => n && (t == null ? void 0 : t.convertCellImagesInRangeToFloat(n)) }),
1085
+ C({ id: "img-sel-to-cell", label: "选区:浮动 → 嵌入", title: '把选区里"中心格在选区内"的浮动图就近嵌入', disabled: !o || !a, onClick: () => o && (t == null ? void 0 : t.convertImagesInRangeToCell(o)) }),
1086
+ C({ id: "img-sel-to-float", label: "选区:嵌入 → 浮动", title: "把选区内所有 DISPIMG 格拎成浮动图", disabled: !o, onClick: () => o && (t == null ? void 0 : t.convertCellImagesInRangeToFloat(o)) }),
1066
1087
  C({ id: "img-sep", type: "separator" }),
1067
- C({ id: "img-all-to-cell", label: "整表:浮动 → 嵌入", title: "全表浮动图按几何就近嵌入各自单元格", disabled: !o, onClick: () => t == null ? void 0 : t.convertAllImagesToCells() }),
1068
- C({ id: "img-col-to-cell", label: "整列:浮动 → 嵌入(活动列)", title: "把中心落在活动列的浮动图就近嵌入", disabled: !o || !l, onClick: () => l && (t == null ? void 0 : t.convertAllImagesToCells(l.col)) })
1088
+ C({ id: "img-all-to-cell", label: "整表:浮动 → 嵌入", title: "全表浮动图按几何就近嵌入各自单元格", disabled: !a, onClick: () => t == null ? void 0 : t.convertAllImagesToCells() }),
1089
+ C({ id: "img-col-to-cell", label: "整列:浮动 → 嵌入(活动列)", title: "把中心落在活动列的浮动图就近嵌入", disabled: !a || !u, onClick: () => u && (t == null ? void 0 : t.convertAllImagesToCells(u.col)) })
1069
1090
  ]
1070
1091
  });
1071
1092
  }
1072
1093
  case "freeze": {
1073
- const n = z == null ? void 0 : z.freeze;
1074
- return C({ id: e, iconSvg: P("freeze"), label: "冻结", title: "冻结/取消冻结(在活动单元格)", active: !!(n && (n.frozenRows || n.frozenCols)), onClick: jt });
1094
+ const o = L == null ? void 0 : L.freeze;
1095
+ return C({ id: e, iconSvg: P("freeze"), label: "冻结", title: "冻结/取消冻结(在活动单元格)", active: !!(o && (o.frozenRows || o.frozenCols)), onClick: sn });
1075
1096
  }
1076
1097
  case "export":
1077
1098
  return C({
@@ -1080,362 +1101,363 @@ const vn = Qt(function(c, k) {
1080
1101
  label: "导出",
1081
1102
  title: "导出 / 打印",
1082
1103
  items: [
1083
- C({ id: "export-png", label: "导出为图片 (PNG)", onClick: () => void (t == null ? void 0 : t.downloadImage().catch(re)) }),
1084
- C({ id: "export-pdf", label: "导出为 PDF (位图)", onClick: nt }),
1085
- C({ id: "export-pdf-vector", label: "导出为 PDF (矢量·文字可选)", onClick: rt }),
1086
- C({ id: "export-print", label: "打印…", onClick: lt })
1104
+ C({ id: "export-png", label: "导出为图片 (PNG)", onClick: () => void (t == null ? void 0 : t.downloadImage().catch(oe)) }),
1105
+ C({ id: "export-pdf", label: "导出为 PDF (位图)", onClick: lt }),
1106
+ C({ id: "export-pdf-vector", label: "导出为 PDF (矢量·文字可选)", onClick: ot }),
1107
+ C({ id: "export-print", label: "打印…", onClick: ct })
1087
1108
  ]
1088
1109
  });
1089
1110
  case "zoom":
1090
1111
  return C({
1091
1112
  id: e,
1092
1113
  iconSvg: P("zoom"),
1093
- label: Math.round(p * 100) + "%",
1114
+ label: Math.round(S * 100) + "%",
1094
1115
  title: "缩放",
1095
- items: [50, 75, 100, 125, 150, 200].map((n) => C({ id: "zoom-" + n, label: n + "%", active: Math.round(p * 100) === n, onClick: () => L(n / 100) }))
1116
+ items: [50, 75, 100, 125, 150, 200].map((o) => C({ id: "zoom-" + o, label: o + "%", active: Math.round(S * 100) === o, onClick: () => J(o / 100) }))
1096
1117
  });
1097
1118
  }
1098
1119
  return null;
1099
1120
  }
1100
- function Me(e, t) {
1101
- var l;
1121
+ function De(e, t) {
1122
+ var r;
1102
1123
  const n = { kind: t, id: e.id, type: e.type, icon: e.icon, label: e.label, title: e.title };
1103
- return e.active && (n.active = !!e.active(ge)), e.disabled && (n.disabled = !!e.disabled(ge)), e.onClick && (n.onClick = () => {
1124
+ return e.active && (n.active = !!e.active(me)), e.disabled && (n.disabled = !!e.disabled(me)), e.onClick && (n.onClick = () => {
1104
1125
  var o;
1105
- return (o = e.onClick) == null ? void 0 : o.call(e, ge);
1106
- }), (l = e.items) != null && l.length && (n.items = e.items.map((o) => Me(o, t))), n;
1126
+ return (o = e.onClick) == null ? void 0 : o.call(e, me);
1127
+ }), (r = e.items) != null && r.length && (n.items = e.items.map((o) => De(o, t))), n;
1107
1128
  }
1108
- const ot = (() => {
1129
+ const at = (() => {
1130
+ var n;
1109
1131
  if (c.toolbar === !1) return [];
1110
1132
  const e = Array.isArray(c.toolbar) ? c.toolbar : ["find", "filter"], t = [];
1111
- for (const n of e)
1112
- if (typeof n == "string")
1113
- if (n === "separator" || n === "|") t.push({ id: "sep-" + t.length, type: "separator", kind: "builtin" });
1133
+ for (const r of e)
1134
+ if (typeof r == "string")
1135
+ if (r === "separator" || r === "|") t.push({ id: "sep-" + t.length, type: "separator", kind: "builtin" });
1114
1136
  else {
1115
- const l = Ut(n);
1116
- l && t.push(l);
1137
+ const o = un(r);
1138
+ o && t.push(o);
1117
1139
  }
1118
1140
  else
1119
- t.push(Me(n, "custom"));
1120
- for (const n of ue) for (const l of n.toolbar ?? []) t.push(Me(l, "plugin"));
1141
+ t.push(De(r, "custom"));
1142
+ for (const r of ge) for (const o of (n = r.toolbar) != null ? n : []) t.push(De(o, "plugin"));
1121
1143
  return t;
1122
- })(), Zt = c.toolbar !== !1 && ot.length > 0, Gt = s ? s.sheets.filter((e) => e.state === "visible").length : 0, ct = [0.5, 0.75, 1, 1.25, 1.5, 2], Ae = (e) => L(Math.min(3, Math.max(0.3, e))), at = ({ items: e, onPick: t, className: n = "rxl-tb-menu" }) => /* @__PURE__ */ a("div", { className: n, "data-tb-menu": "true", children: e.map((l) => l.type === "separator" ? /* @__PURE__ */ a("div", { className: "sep" }, l.id) : /* @__PURE__ */ g(
1144
+ })(), dn = c.toolbar !== !1 && at.length > 0, gn = s ? s.sheets.filter((e) => e.state === "visible").length : 0, st = [0.5, 0.75, 1, 1.25, 1.5, 2], ze = (e) => J(Math.min(3, Math.max(0.3, e))), it = ({ items: e, onPick: t, className: n = "rxl-tb-menu" }) => /* @__PURE__ */ i("div", { className: n, "data-tb-menu": "true", children: e.map((r) => r.type === "separator" ? /* @__PURE__ */ i("div", { className: "sep" }, r.id) : /* @__PURE__ */ m(
1123
1145
  "button",
1124
1146
  {
1125
- className: "mi" + (l.active ? " active" : ""),
1126
- disabled: !!l.disabled,
1127
- title: l.title,
1147
+ className: "mi" + (r.active ? " active" : ""),
1148
+ disabled: !!r.disabled,
1149
+ title: r.title,
1128
1150
  onClick: (o) => {
1129
- o.stopPropagation(), l.disabled || t(l);
1151
+ o.stopPropagation(), r.disabled || t(r);
1130
1152
  },
1131
1153
  children: [
1132
- l.iconSvg ? /* @__PURE__ */ a("span", { className: "ic", dangerouslySetInnerHTML: { __html: De(l.iconSvg) } }) : l.icon ? /* @__PURE__ */ a("span", { className: "ic-e", children: l.icon }) : null,
1133
- /* @__PURE__ */ a("span", { className: "lb", children: l.label || l.id })
1154
+ r.iconSvg ? /* @__PURE__ */ i("span", { className: "ic", dangerouslySetInnerHTML: { __html: Oe(r.iconSvg) } }) : r.icon ? /* @__PURE__ */ i("span", { className: "ic-e", children: r.icon }) : null,
1155
+ /* @__PURE__ */ i("span", { className: "lb", children: r.label || r.id })
1134
1156
  ]
1135
1157
  },
1136
- l.id
1137
- )) }), J = (h == null ? void 0 : h.getFilterPopup()) ?? null, ae = Se.current, st = s ? s.sheets.map((e, t) => ({ s: e, i: t })).filter(({ s: e }) => e.state === "visible") : [];
1138
- return /* @__PURE__ */ g("div", { className: "rxl" + (c.className ? " " + c.className : ""), style: c.style, onKeyDown: Lt, children: [
1139
- /* @__PURE__ */ a("input", { ref: We, type: "file", accept: ".xlsx,.xlsm", hidden: !0, onChange: Ot }),
1140
- s && /* @__PURE__ */ g("div", { className: "rxl-toolbar", children: [
1141
- /* @__PURE__ */ g("span", { className: "file", title: Le + (te ? " · 模板: " + te : ""), children: [
1142
- Le || "未命名工作簿",
1143
- te && /* @__PURE__ */ g("span", { className: "tpl", children: [
1158
+ r.id
1159
+ )) }), X = (wt = h == null ? void 0 : h.getFilterPopup()) != null ? wt : null, ie = Ie.current, ut = s ? s.sheets.map((e, t) => ({ s: e, i: t })).filter(({ s: e }) => e.state === "visible") : [];
1160
+ return /* @__PURE__ */ m("div", { className: "rxl" + (c.className ? " " + c.className : ""), style: c.style, onKeyDown: Yt, children: [
1161
+ /* @__PURE__ */ i("input", { ref: He, type: "file", accept: ".xlsx,.xlsm", hidden: !0, onChange: Gt }),
1162
+ s && /* @__PURE__ */ m("div", { className: "rxl-toolbar", children: [
1163
+ /* @__PURE__ */ m("span", { className: "file", title: Be + (_ ? " · 模板: " + _ : ""), children: [
1164
+ Be || "未命名工作簿",
1165
+ _ && /* @__PURE__ */ m("span", { className: "tpl", children: [
1144
1166
  " · 模板: ",
1145
- te
1167
+ _
1146
1168
  ] })
1147
1169
  ] }),
1148
- /* @__PURE__ */ g("span", { className: "meta", children: [
1149
- Gt,
1170
+ /* @__PURE__ */ m("span", { className: "meta", children: [
1171
+ gn,
1150
1172
  " 个工作表"
1151
1173
  ] }),
1152
- /* @__PURE__ */ a("div", { className: "spacer" }),
1153
- /* @__PURE__ */ g("div", { className: "rxl-export-wrap", "data-tb-menu": "true", children: [
1154
- /* @__PURE__ */ g(
1174
+ /* @__PURE__ */ i("div", { className: "spacer" }),
1175
+ /* @__PURE__ */ m("div", { className: "rxl-export-wrap", "data-tb-menu": "true", children: [
1176
+ /* @__PURE__ */ m(
1155
1177
  "button",
1156
1178
  {
1157
- className: "rxl-export-btn" + (se === "__header-export" ? " open" : ""),
1179
+ className: "rxl-export-btn" + (ue === "__header-export" ? " open" : ""),
1158
1180
  onClick: (e) => {
1159
- e.stopPropagation(), j(se === "__header-export" ? null : "__header-export");
1181
+ e.stopPropagation(), G(ue === "__header-export" ? null : "__header-export");
1160
1182
  },
1161
1183
  title: "导出 / 打印",
1162
1184
  children: [
1163
1185
  "导出 ",
1164
- /* @__PURE__ */ a("span", { className: "caret", children: "▾" })
1186
+ /* @__PURE__ */ i("span", { className: "caret", children: "▾" })
1165
1187
  ]
1166
1188
  }
1167
1189
  ),
1168
- se === "__header-export" && /* @__PURE__ */ a(
1169
- at,
1190
+ ue === "__header-export" && /* @__PURE__ */ i(
1191
+ it,
1170
1192
  {
1171
1193
  items: [
1172
1194
  C({ id: "h-png", label: "导出为图片 (PNG)", onClick: () => {
1173
1195
  var e;
1174
- return void ((e = r.current) == null ? void 0 : e.downloadImage().catch(re));
1196
+ return void ((e = l.current) == null ? void 0 : e.downloadImage().catch(oe));
1175
1197
  } }),
1176
- C({ id: "h-pdf", label: "导出为 PDF (位图)", onClick: nt }),
1177
- C({ id: "h-pdf-vec", label: "导出为 PDF (矢量·文字可选)", onClick: rt }),
1178
- C({ id: "h-print", label: "打印…", onClick: lt })
1198
+ C({ id: "h-pdf", label: "导出为 PDF (位图)", onClick: lt }),
1199
+ C({ id: "h-pdf-vec", label: "导出为 PDF (矢量·文字可选)", onClick: ot }),
1200
+ C({ id: "h-print", label: "打印…", onClick: ct })
1179
1201
  ],
1180
1202
  onPick: (e) => {
1181
1203
  var t;
1182
- j(null), (t = e.onClick) == null || t.call(e);
1204
+ G(null), (t = e.onClick) == null || t.call(e);
1183
1205
  },
1184
1206
  className: "rxl-tb-menu header-menu"
1185
1207
  }
1186
1208
  )
1187
1209
  ] }),
1188
- /* @__PURE__ */ g("div", { className: "rxl-zoom", children: [
1189
- /* @__PURE__ */ a("button", { onClick: () => Ae(p - 0.1), title: "缩小", children: "−" }),
1190
- /* @__PURE__ */ g("select", { value: p, onChange: (e) => Ae(parseFloat(e.target.value)), children: [
1191
- ct.map((e) => /* @__PURE__ */ g("option", { value: e, children: [
1210
+ /* @__PURE__ */ m("div", { className: "rxl-zoom", children: [
1211
+ /* @__PURE__ */ i("button", { onClick: () => ze(S - 0.1), title: "缩小", children: "−" }),
1212
+ /* @__PURE__ */ m("select", { value: S, onChange: (e) => ze(parseFloat(e.target.value)), children: [
1213
+ st.map((e) => /* @__PURE__ */ m("option", { value: e, children: [
1192
1214
  Math.round(e * 100),
1193
1215
  "%"
1194
1216
  ] }, e)),
1195
- !ct.includes(p) && /* @__PURE__ */ g("option", { value: p, children: [
1196
- Math.round(p * 100),
1217
+ !st.includes(S) && /* @__PURE__ */ m("option", { value: S, children: [
1218
+ Math.round(S * 100),
1197
1219
  "%"
1198
1220
  ] }, "cur")
1199
1221
  ] }),
1200
- /* @__PURE__ */ a("button", { onClick: () => Ae(p + 0.1), title: "放大", children: "+" })
1222
+ /* @__PURE__ */ i("button", { onClick: () => ze(S + 0.1), title: "放大", children: "+" })
1201
1223
  ] })
1202
1224
  ] }),
1203
- s && Zt && /* @__PURE__ */ a("div", { className: "rxl-action-toolbar", children: ot.map((e) => {
1204
- var l;
1205
- if (e.type === "separator") return /* @__PURE__ */ a("span", { className: "rxl-at-divider" }, e.id);
1206
- const t = !!((l = e.items) != null && l.length), n = se === e.id;
1207
- return /* @__PURE__ */ g("div", { className: "rxl-at-dd", "data-tb-menu": "true", children: [
1208
- /* @__PURE__ */ g(
1225
+ s && dn && /* @__PURE__ */ i("div", { className: "rxl-action-toolbar", children: at.map((e) => {
1226
+ var r;
1227
+ if (e.type === "separator") return /* @__PURE__ */ i("span", { className: "rxl-at-divider" }, e.id);
1228
+ const t = !!((r = e.items) != null && r.length), n = ue === e.id;
1229
+ return /* @__PURE__ */ m("div", { className: "rxl-at-dd", "data-tb-menu": "true", children: [
1230
+ /* @__PURE__ */ m(
1209
1231
  "button",
1210
1232
  {
1211
1233
  className: "rxl-at-tool" + (e.active ? " active" : "") + (n ? " open" : ""),
1212
1234
  disabled: !!e.disabled,
1213
1235
  title: e.title || e.label || e.id,
1214
1236
  onClick: (o) => {
1215
- var m;
1216
- o.stopPropagation(), !e.disabled && (t ? j(n ? null : e.id) : ((m = e.onClick) == null || m.call(e), j(null)));
1237
+ var u;
1238
+ o.stopPropagation(), !e.disabled && (t ? G(n ? null : e.id) : ((u = e.onClick) == null || u.call(e), G(null)));
1217
1239
  },
1218
1240
  children: [
1219
- e.iconSvg ? /* @__PURE__ */ a("span", { className: "rxl-at-ic", dangerouslySetInnerHTML: { __html: De(e.iconSvg) } }) : e.icon ? /* @__PURE__ */ a("span", { className: "rxl-at-ic-e", children: e.icon }) : null,
1220
- e.label && /* @__PURE__ */ a("span", { className: "rxl-at-lb", children: e.label }),
1221
- t && /* @__PURE__ */ a("span", { className: "rxl-at-caret", dangerouslySetInnerHTML: { __html: De(P("caret")) } })
1241
+ e.iconSvg ? /* @__PURE__ */ i("span", { className: "rxl-at-ic", dangerouslySetInnerHTML: { __html: Oe(e.iconSvg) } }) : e.icon ? /* @__PURE__ */ i("span", { className: "rxl-at-ic-e", children: e.icon }) : null,
1242
+ e.label && /* @__PURE__ */ i("span", { className: "rxl-at-lb", children: e.label }),
1243
+ t && /* @__PURE__ */ i("span", { className: "rxl-at-caret", dangerouslySetInnerHTML: { __html: Oe(P("caret")) } })
1222
1244
  ]
1223
1245
  }
1224
1246
  ),
1225
- t && n && /* @__PURE__ */ a(
1226
- at,
1247
+ t && n && /* @__PURE__ */ i(
1248
+ it,
1227
1249
  {
1228
1250
  items: e.items,
1229
1251
  onPick: (o) => {
1230
- var m;
1231
- j(null), (m = o.onClick) == null || m.call(o);
1252
+ var u;
1253
+ G(null), (u = o.onClick) == null || u.call(o);
1232
1254
  }
1233
1255
  }
1234
1256
  )
1235
1257
  ] }, e.id);
1236
1258
  }) }),
1237
- s && /* @__PURE__ */ g("div", { className: "rxl-formula-bar", children: [
1238
- /* @__PURE__ */ a("span", { className: "addr", children: Ye || "—" }),
1239
- /* @__PURE__ */ a("span", { className: "fx", children: "fx" }),
1240
- Bt ? /* @__PURE__ */ a(
1259
+ s && /* @__PURE__ */ m("div", { className: "rxl-formula-bar", children: [
1260
+ /* @__PURE__ */ i("span", { className: "addr", children: tt || "—" }),
1261
+ /* @__PURE__ */ i("span", { className: "fx", children: "fx" }),
1262
+ tn ? /* @__PURE__ */ i(
1241
1263
  "textarea",
1242
1264
  {
1243
- ref: Be,
1265
+ ref: Je,
1244
1266
  className: "content content-input",
1245
- value: Pe,
1246
- title: Pe,
1267
+ value: Ae,
1268
+ title: Ae,
1247
1269
  rows: 1,
1248
1270
  spellCheck: !1,
1249
- onFocus: Jt,
1271
+ onFocus: rn,
1250
1272
  onChange: (e) => {
1251
- He(e.target.value), Ve();
1273
+ Ve(e.target.value), _e();
1252
1274
  },
1253
- onKeyDown: $t,
1254
- onBlur: Kt
1275
+ onKeyDown: cn,
1276
+ onBlur: on
1255
1277
  }
1256
- ) : /* @__PURE__ */ a("span", { className: "content", title: et, children: et })
1278
+ ) : /* @__PURE__ */ i("span", { className: "content", title: nt, children: nt })
1257
1279
  ] }),
1258
- /* @__PURE__ */ g("div", { className: "rxl-render-area", ref: Je, children: [
1259
- /* @__PURE__ */ a("canvas", { ref: _e, className: "rxl-canvas" }),
1260
- /* @__PURE__ */ a("div", { className: "rxl-ov", ref: ve }),
1261
- /* @__PURE__ */ a("div", { className: "rxl-ov", ref: be }),
1262
- /* @__PURE__ */ a("div", { className: "rxl-ov", ref: xe }),
1263
- /* @__PURE__ */ a("div", { className: "rxl-ov", ref: pe }),
1264
- /* @__PURE__ */ a(
1280
+ /* @__PURE__ */ m("div", { className: "rxl-render-area", ref: Ke, children: [
1281
+ /* @__PURE__ */ i("canvas", { ref: $e, className: "rxl-canvas" }),
1282
+ /* @__PURE__ */ i("div", { className: "rxl-ov", ref: be }),
1283
+ /* @__PURE__ */ i("div", { className: "rxl-ov", ref: Se }),
1284
+ /* @__PURE__ */ i("div", { className: "rxl-ov", ref: pe }),
1285
+ /* @__PURE__ */ i("div", { className: "rxl-ov", ref: we }),
1286
+ /* @__PURE__ */ i(
1265
1287
  "div",
1266
1288
  {
1267
1289
  className: "rxl-scroller",
1268
- ref: U,
1290
+ ref: q,
1269
1291
  tabIndex: 0,
1270
- onScroll: Ht,
1292
+ onScroll: en,
1271
1293
  onMouseDown: (e) => {
1272
1294
  var t;
1273
- return (t = r.current) == null ? void 0 : t.onMouseDown(e.nativeEvent);
1295
+ return (t = l.current) == null ? void 0 : t.onMouseDown(e.nativeEvent);
1274
1296
  },
1275
1297
  onMouseMove: (e) => {
1276
1298
  var t;
1277
- return (t = r.current) == null ? void 0 : t.onMouseMove(e.nativeEvent);
1299
+ return (t = l.current) == null ? void 0 : t.onMouseMove(e.nativeEvent);
1278
1300
  },
1279
1301
  onMouseUp: (e) => {
1280
1302
  var t;
1281
- return (t = r.current) == null ? void 0 : t.onMouseUp(e.nativeEvent);
1303
+ return (t = l.current) == null ? void 0 : t.onMouseUp(e.nativeEvent);
1282
1304
  },
1283
1305
  onMouseLeave: () => {
1284
1306
  var e;
1285
- return (e = r.current) == null ? void 0 : e.onMouseLeave();
1307
+ return (e = l.current) == null ? void 0 : e.onMouseLeave();
1286
1308
  },
1287
1309
  onDoubleClick: (e) => {
1288
1310
  var t;
1289
- return (t = r.current) == null ? void 0 : t.onDblClick(e.nativeEvent);
1311
+ return (t = l.current) == null ? void 0 : t.onDblClick(e.nativeEvent);
1290
1312
  },
1291
1313
  onKeyDown: (e) => {
1292
1314
  var t;
1293
- return (t = r.current) == null ? void 0 : t.onKeyDown(e.nativeEvent);
1315
+ return (t = l.current) == null ? void 0 : t.onKeyDown(e.nativeEvent);
1294
1316
  },
1295
1317
  onContextMenu: (e) => {
1296
1318
  var t;
1297
- return (t = r.current) == null ? void 0 : t.onContextMenu(e.nativeEvent);
1319
+ return (t = l.current) == null ? void 0 : t.onContextMenu(e.nativeEvent);
1298
1320
  },
1299
- children: /* @__PURE__ */ a("div", { className: "rxl-spacer", ref: Ke })
1321
+ children: /* @__PURE__ */ i("div", { className: "rxl-spacer", ref: Xe })
1300
1322
  }
1301
1323
  ),
1302
- /* @__PURE__ */ a("div", { className: "rxl-ov-slot", children: /* @__PURE__ */ a("div", { ref: we }) }),
1303
- /* @__PURE__ */ a("div", { className: "rxl-editor-slot", ref: Ie }),
1304
- Ce && s && /* @__PURE__ */ g("div", { className: "rxl-findbar", children: [
1305
- /* @__PURE__ */ a(
1324
+ /* @__PURE__ */ i("div", { className: "rxl-ov-slot", children: /* @__PURE__ */ i("div", { ref: ye }) }),
1325
+ /* @__PURE__ */ i("div", { className: "rxl-editor-slot", ref: Re }),
1326
+ ve && s && /* @__PURE__ */ m("div", { className: "rxl-findbar", children: [
1327
+ /* @__PURE__ */ i(
1306
1328
  "input",
1307
1329
  {
1308
1330
  autoFocus: !0,
1309
1331
  placeholder: "查找…",
1310
- value: fe.query,
1332
+ value: Ce.query,
1311
1333
  onChange: (e) => {
1312
1334
  var t;
1313
- return (t = r.current) == null ? void 0 : t.setFindQuery(e.target.value);
1335
+ return (t = l.current) == null ? void 0 : t.setFindQuery(e.target.value);
1314
1336
  },
1315
1337
  onKeyDown: (e) => {
1316
1338
  var t, n;
1317
- e.key === "Enter" ? e.shiftKey ? (t = r.current) == null || t.findPrev() : (n = r.current) == null || n.findNext() : e.key === "Escape" && Te();
1339
+ e.key === "Enter" ? e.shiftKey ? (t = l.current) == null || t.findPrev() : (n = l.current) == null || n.findNext() : e.key === "Escape" && Pe();
1318
1340
  }
1319
1341
  }
1320
1342
  ),
1321
- /* @__PURE__ */ a("span", { className: "count", children: fe.count ? `${fe.index + 1}/${fe.count}` : "无结果" }),
1322
- /* @__PURE__ */ a("button", { onClick: () => {
1343
+ /* @__PURE__ */ i("span", { className: "count", children: Ce.count ? `${Ce.index + 1}/${Ce.count}` : "无结果" }),
1344
+ /* @__PURE__ */ i("button", { onClick: () => {
1323
1345
  var e;
1324
- return (e = r.current) == null ? void 0 : e.findPrev();
1346
+ return (e = l.current) == null ? void 0 : e.findPrev();
1325
1347
  }, children: "↑" }),
1326
- /* @__PURE__ */ a("button", { onClick: () => {
1348
+ /* @__PURE__ */ i("button", { onClick: () => {
1327
1349
  var e;
1328
- return (e = r.current) == null ? void 0 : e.findNext();
1350
+ return (e = l.current) == null ? void 0 : e.findNext();
1329
1351
  }, children: "↓" }),
1330
- /* @__PURE__ */ a("button", { onClick: Te, children: "✕" })
1352
+ /* @__PURE__ */ i("button", { onClick: Pe, children: "✕" })
1331
1353
  ] }),
1332
- J && /* @__PURE__ */ a(
1333
- gn,
1354
+ X && /* @__PURE__ */ i(
1355
+ Pn,
1334
1356
  {
1335
- values: J.values,
1336
- selected: J.selected,
1337
- x: J.x,
1338
- y: J.y,
1339
- sortDir: J.sortDir,
1357
+ values: X.values,
1358
+ selected: X.selected,
1359
+ x: X.x,
1360
+ y: X.y,
1361
+ sortDir: X.sortDir,
1340
1362
  onApply: (e) => {
1341
1363
  var t;
1342
- return (t = r.current) == null ? void 0 : t.applyFilterSelection(e);
1364
+ return (t = l.current) == null ? void 0 : t.applyFilterSelection(e);
1343
1365
  },
1344
1366
  onClear: () => {
1345
1367
  var e;
1346
- return (e = r.current) == null ? void 0 : e.clearFilterColumn();
1368
+ return (e = l.current) == null ? void 0 : e.clearFilterColumn();
1347
1369
  },
1348
1370
  onClose: () => {
1349
1371
  var e;
1350
- return (e = r.current) == null ? void 0 : e.closeFilterPopup();
1372
+ return (e = l.current) == null ? void 0 : e.closeFilterPopup();
1351
1373
  },
1352
1374
  onSort: (e) => {
1353
- var n, l;
1354
- const t = J.col;
1355
- (n = r.current) == null || n.closeFilterPopup(), (l = r.current) == null || l.sortColumn(t, e);
1375
+ var n, r;
1376
+ const t = X.col;
1377
+ (n = l.current) == null || n.closeFilterPopup(), (r = l.current) == null || r.sortColumn(t, e);
1356
1378
  }
1357
1379
  },
1358
- J.col
1380
+ X.col
1359
1381
  ),
1360
- ae && /* @__PURE__ */ a("div", { className: "rxl-tooltip " + ae.kind, style: { left: ae.x, top: ae.y }, children: ae.text }),
1361
- w && /* @__PURE__ */ a("div", { className: "rxl-state", children: (F == null ? void 0 : F.stage) === "read" ? "读取文件…" : (F == null ? void 0 : F.stage) === "parse" ? "解析中…" : "构建表格…" }),
1362
- !w && T && /* @__PURE__ */ g("div", { className: "rxl-state error", children: [
1382
+ ie && /* @__PURE__ */ i("div", { className: "rxl-tooltip " + ie.kind, style: { left: ie.x, top: ie.y }, children: ie.text }),
1383
+ I && /* @__PURE__ */ i("div", { className: "rxl-state", children: (k == null ? void 0 : k.stage) === "read" ? "读取文件…" : (k == null ? void 0 : k.stage) === "parse" ? "解析中…" : "构建表格…" }),
1384
+ !I && T && /* @__PURE__ */ m("div", { className: "rxl-state error", children: [
1363
1385
  "解析失败:",
1364
1386
  T
1365
1387
  ] }),
1366
- !w && !s && /* @__PURE__ */ a("div", { className: "rxl-state", children: "拖入或选择一个 .xlsx 文件" })
1388
+ !I && !s && /* @__PURE__ */ i("div", { className: "rxl-state", children: "拖入或选择一个 .xlsx 文件" })
1367
1389
  ] }),
1368
- s && /* @__PURE__ */ g("div", { className: "rxl-status-bar", children: [
1369
- /* @__PURE__ */ a("span", { style: { color: "#888" }, children: Xt || Ye }),
1370
- /* @__PURE__ */ a("div", { className: "grow" }),
1371
- O && O.numCount > 0 ? /* @__PURE__ */ g(qt, { children: [
1372
- /* @__PURE__ */ g("span", { children: [
1390
+ s && /* @__PURE__ */ m("div", { className: "rxl-status-bar", children: [
1391
+ /* @__PURE__ */ i("span", { style: { color: "#888" }, children: an || tt }),
1392
+ /* @__PURE__ */ i("div", { className: "grow" }),
1393
+ W && W.numCount > 0 ? /* @__PURE__ */ m(xn, { children: [
1394
+ /* @__PURE__ */ m("span", { children: [
1373
1395
  "计数 ",
1374
- O.count
1396
+ W.count
1375
1397
  ] }),
1376
- /* @__PURE__ */ g("span", { children: [
1398
+ /* @__PURE__ */ m("span", { children: [
1377
1399
  "求和 ",
1378
- me(O.sum)
1400
+ he(W.sum)
1379
1401
  ] }),
1380
- /* @__PURE__ */ g("span", { children: [
1402
+ /* @__PURE__ */ m("span", { children: [
1381
1403
  "平均 ",
1382
- me(O.avg)
1404
+ he(W.avg)
1383
1405
  ] }),
1384
- /* @__PURE__ */ g("span", { children: [
1406
+ /* @__PURE__ */ m("span", { children: [
1385
1407
  "最大 ",
1386
- me(O.max)
1408
+ he(W.max)
1387
1409
  ] }),
1388
- /* @__PURE__ */ g("span", { children: [
1410
+ /* @__PURE__ */ m("span", { children: [
1389
1411
  "最小 ",
1390
- me(O.min)
1412
+ he(W.min)
1391
1413
  ] })
1392
- ] }) : O && O.count > 0 ? /* @__PURE__ */ g("span", { children: [
1414
+ ] }) : W && W.count > 0 ? /* @__PURE__ */ m("span", { children: [
1393
1415
  "计数 ",
1394
- O.count
1416
+ W.count
1395
1417
  ] }) : null
1396
1418
  ] }),
1397
- s && st.length > 0 && /* @__PURE__ */ a("div", { className: "rxl-tabs", children: st.map(({ s: e, i: t }) => /* @__PURE__ */ a("button", { className: t === N ? "active" : "", onClick: () => $(t), children: e.name }, t)) }),
1398
- c.exportProgress !== !1 && (c.renderExportProgress ? c.renderExportProgress({ state: je, busy: Ue, cancel: Ge }) : /* @__PURE__ */ a(un, { state: je, busy: Ue, onCancel: Ge }))
1419
+ s && ut.length > 0 && /* @__PURE__ */ i("div", { className: "rxl-tabs", children: ut.map(({ s: e, i: t }) => /* @__PURE__ */ i("button", { className: t === N ? "active" : "", onClick: () => U(t), children: e.name }, t)) }),
1420
+ c.exportProgress !== !1 && (c.renderExportProgress ? c.renderExportProgress({ state: Ze, busy: Ge, cancel: Qe }) : /* @__PURE__ */ i(Tn, { state: Ze, busy: Ge, onCancel: Qe }))
1399
1421
  ] });
1400
1422
  });
1401
- function gn(f) {
1402
- const c = f.selected.length ? new Set(f.selected) : new Set(f.values), [k, w] = y(c), T = (s) => {
1403
- const F = new Set(k);
1404
- F.has(s) ? F.delete(s) : F.add(s), w(F);
1423
+ function Pn(d) {
1424
+ const c = d.selected.length ? new Set(d.selected) : new Set(d.values), [x, I] = R(c), T = (s) => {
1425
+ const k = new Set(x);
1426
+ k.has(s) ? k.delete(s) : k.add(s), I(k);
1405
1427
  };
1406
- return /* @__PURE__ */ g("div", { className: "rxl-filterpop", style: { left: f.x, top: f.y }, children: [
1407
- /* @__PURE__ */ g("div", { className: "sort", children: [
1408
- /* @__PURE__ */ a("button", { className: f.sortDir === "asc" ? "on" : "", onClick: () => f.onSort("asc"), children: "↑ 升序" }),
1409
- /* @__PURE__ */ a("button", { className: f.sortDir === "desc" ? "on" : "", onClick: () => f.onSort("desc"), children: "↓ 降序" })
1428
+ return /* @__PURE__ */ m("div", { className: "rxl-filterpop", style: { left: d.x, top: d.y }, children: [
1429
+ /* @__PURE__ */ m("div", { className: "sort", children: [
1430
+ /* @__PURE__ */ i("button", { className: d.sortDir === "asc" ? "on" : "", onClick: () => d.onSort("asc"), children: "↑ 升序" }),
1431
+ /* @__PURE__ */ i("button", { className: d.sortDir === "desc" ? "on" : "", onClick: () => d.onSort("desc"), children: "↓ 降序" })
1410
1432
  ] }),
1411
- /* @__PURE__ */ g("div", { className: "list", children: [
1412
- /* @__PURE__ */ g("label", { children: [
1413
- /* @__PURE__ */ a(
1433
+ /* @__PURE__ */ m("div", { className: "list", children: [
1434
+ /* @__PURE__ */ m("label", { children: [
1435
+ /* @__PURE__ */ i(
1414
1436
  "input",
1415
1437
  {
1416
1438
  type: "checkbox",
1417
- checked: k.size === f.values.length,
1439
+ checked: x.size === d.values.length,
1418
1440
  ref: (s) => {
1419
- s && (s.indeterminate = k.size > 0 && k.size < f.values.length);
1441
+ s && (s.indeterminate = x.size > 0 && x.size < d.values.length);
1420
1442
  },
1421
- onChange: (s) => w(s.target.checked ? new Set(f.values) : /* @__PURE__ */ new Set())
1443
+ onChange: (s) => I(s.target.checked ? new Set(d.values) : /* @__PURE__ */ new Set())
1422
1444
  }
1423
1445
  ),
1424
1446
  "(全选)"
1425
1447
  ] }),
1426
- f.values.map((s) => /* @__PURE__ */ g("label", { children: [
1427
- /* @__PURE__ */ a("input", { type: "checkbox", checked: k.has(s), onChange: () => T(s) }),
1448
+ d.values.map((s) => /* @__PURE__ */ m("label", { children: [
1449
+ /* @__PURE__ */ i("input", { type: "checkbox", checked: x.has(s), onChange: () => T(s) }),
1428
1450
  s
1429
1451
  ] }, s))
1430
1452
  ] }),
1431
- /* @__PURE__ */ g("div", { className: "foot", children: [
1432
- /* @__PURE__ */ a("button", { onClick: f.onClear, children: "清除" }),
1433
- /* @__PURE__ */ a("button", { onClick: () => f.onApply([...k]), children: "确定" }),
1434
- /* @__PURE__ */ a("button", { onClick: f.onClose, children: "取消" })
1453
+ /* @__PURE__ */ m("div", { className: "foot", children: [
1454
+ /* @__PURE__ */ i("button", { onClick: d.onClear, children: "清除" }),
1455
+ /* @__PURE__ */ i("button", { onClick: () => d.onApply([...x]), children: "确定" }),
1456
+ /* @__PURE__ */ i("button", { onClick: d.onClose, children: "取消" })
1435
1457
  ] })
1436
1458
  ] });
1437
1459
  }
1438
1460
  export {
1439
- vn as ExcelViewer,
1440
- dn as useExcelDocument
1461
+ Ln as ExcelViewer,
1462
+ Mn as useExcelDocument
1441
1463
  };