ooxml-excel-editor 1.3.2 → 1.7.0

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