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