@l1yp/file-viewer 0.1.0 → 0.1.1
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/README.md +1 -0
- package/dist/components/DocxNavigationPane.js +7 -0
- package/dist/components/DocxNavigationPane.vue.d.ts +23 -0
- package/dist/components/DocxNavigationPane.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/components/DocxViewer.js +1 -1
- package/dist/components/DocxViewer.vue_vue_type_script_setup_true_lang.js +70 -37
- package/dist/components/FileViewerBody.js +1 -1
- package/dist/components/FileViewerBody.vue.d.ts +5 -0
- package/dist/components/FileViewerBody.vue_vue_type_script_setup_true_lang.js +248 -247
- package/dist/components/PptxNavigationPane.js +7 -0
- package/dist/components/PptxNavigationPane.vue.d.ts +20 -0
- package/dist/components/PptxNavigationPane.vue_vue_type_script_setup_true_lang.js +118 -0
- package/dist/components/PptxViewer.js +1 -1
- package/dist/components/PptxViewer.vue_vue_type_script_setup_true_lang.js +64 -38
- package/dist/components/XlsxViewer.js +1 -1
- package/dist/components/XlsxViewer.vue_vue_type_script_setup_true_lang.js +299 -304
- package/dist/components/ZipBrowser.js +1 -1
- package/dist/components/ZipBrowser.vue.d.ts +3 -1
- package/dist/components/ZipBrowser.vue_vue_type_script_setup_true_lang.js +152 -122
- package/dist/composables/useElementNavigation.d.ts +21 -0
- package/dist/composables/useElementNavigation.js +61 -0
- package/dist/lib/archiveHtml.d.ts +49 -0
- package/dist/lib/archiveHtml.js +375 -0
- package/dist/lib/docxNavigation.d.ts +31 -0
- package/dist/lib/docxNavigation.js +63 -0
- package/dist/lib/pptxNavigation.d.ts +7 -0
- package/dist/lib/pptxNavigation.js +27 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@ var re = { class: "xv" }, ie = {
|
|
|
24
24
|
}, Ce = { class: "xv__status-right" }, we = {
|
|
25
25
|
key: 0,
|
|
26
26
|
class: "xv__tabbar"
|
|
27
|
-
}, Te = ["disabled"], Ee = ["title", "onClick"], De = ["disabled"],
|
|
27
|
+
}, Te = ["disabled"], Ee = ["title", "onClick"], De = ["disabled"], b = 42, x = 22, Oe = 20, ke = 24, Ae = 14, je = 9, S = /*@__PURE__*/ d({
|
|
28
28
|
__name: "XlsxViewer",
|
|
29
29
|
props: {
|
|
30
30
|
url: {},
|
|
@@ -32,121 +32,116 @@ var re = { class: "xv" }, ie = {
|
|
|
32
32
|
size: {}
|
|
33
33
|
},
|
|
34
34
|
setup(d) {
|
|
35
|
-
let
|
|
35
|
+
let S = d, C = g("loading"), Me = g(""), Ne = g(null), Pe = g(/* @__PURE__ */ new Map()), w = g(0), Fe = a(() => Ne.value?.sheets ?? []), T = a(() => Fe.value[w.value] ?? null), Ie = {
|
|
36
36
|
colW: {},
|
|
37
37
|
rowH: {},
|
|
38
38
|
revealCol: {},
|
|
39
39
|
revealRow: {},
|
|
40
40
|
revealAll: !1
|
|
41
|
-
},
|
|
42
|
-
function
|
|
43
|
-
let e =
|
|
41
|
+
}, E = g({}), D = a(() => E.value[w.value] ?? Ie);
|
|
42
|
+
function O() {
|
|
43
|
+
let e = E.value[w.value];
|
|
44
44
|
return e || (e = {
|
|
45
45
|
colW: {},
|
|
46
46
|
rowH: {},
|
|
47
47
|
revealCol: {},
|
|
48
48
|
revealRow: {},
|
|
49
49
|
revealAll: !1
|
|
50
|
-
},
|
|
50
|
+
}, E.value[w.value] = e), e;
|
|
51
51
|
}
|
|
52
|
-
let
|
|
53
|
-
let e =
|
|
52
|
+
let Le = a(() => {
|
|
53
|
+
let e = D.value;
|
|
54
54
|
return e.revealAll || Object.keys(e.colW).length > 0 || Object.keys(e.rowH).length > 0 || Object.keys(e.revealCol).length > 0 || Object.keys(e.revealRow).length > 0;
|
|
55
55
|
});
|
|
56
|
-
function
|
|
57
|
-
|
|
56
|
+
function Re() {
|
|
57
|
+
E.value[w.value] = {
|
|
58
58
|
colW: {},
|
|
59
59
|
rowH: {},
|
|
60
60
|
revealCol: {},
|
|
61
61
|
revealRow: {},
|
|
62
62
|
revealAll: !1
|
|
63
|
-
},
|
|
63
|
+
}, z();
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
let D = a(() => C.value?.colWidths.length ?? 0);
|
|
69
|
-
function O(e) {
|
|
70
|
-
return !!C.value?.colHidden[e - 1] && !T.value.revealAll && !T.value.revealCol[e];
|
|
71
|
-
}
|
|
72
|
-
function k(e) {
|
|
73
|
-
return !!C.value?.rows[e]?.hidden && !T.value.revealAll && !T.value.revealRow[e + 1];
|
|
65
|
+
function ze() {
|
|
66
|
+
O().revealAll = !D.value.revealAll, z();
|
|
74
67
|
}
|
|
68
|
+
let k = a(() => T.value?.colWidths.length ?? 0);
|
|
75
69
|
function A(e) {
|
|
76
|
-
return
|
|
70
|
+
return !!T.value?.colHidden[e - 1] && !D.value.revealAll && !D.value.revealCol[e];
|
|
77
71
|
}
|
|
78
72
|
function j(e) {
|
|
79
|
-
return
|
|
73
|
+
return !!T.value?.rows[e]?.hidden && !D.value.revealAll && !D.value.revealRow[e + 1];
|
|
74
|
+
}
|
|
75
|
+
function M(e) {
|
|
76
|
+
return A(e) ? 0 : D.value.colW[e] ?? T.value?.colWidths[e - 1] ?? 80;
|
|
77
|
+
}
|
|
78
|
+
function N(e) {
|
|
79
|
+
return j(e) ? 0 : D.value.rowH[e + 1] ?? T.value?.rows[e]?.height ?? Oe;
|
|
80
80
|
}
|
|
81
|
-
let
|
|
81
|
+
let Be = a(() => {
|
|
82
82
|
let t = [];
|
|
83
|
-
for (let n = 1; n <=
|
|
83
|
+
for (let n = 1; n <= k.value; n++) t.push(e(n));
|
|
84
84
|
return t;
|
|
85
|
-
}),
|
|
86
|
-
let e = [], t =
|
|
87
|
-
for (let n = 1; n <=
|
|
88
|
-
return e[
|
|
89
|
-
}),
|
|
90
|
-
let e =
|
|
91
|
-
for (let r = 0; r < e.length; r++) t[r + 1] = n, n +=
|
|
85
|
+
}), P = a(() => T.value?.frozenCols ?? 0), F = a(() => T.value?.frozenRows ?? 0), Ve = a(() => {
|
|
86
|
+
let e = [], t = b;
|
|
87
|
+
for (let n = 1; n <= k.value; n++) e[n] = t, t += M(n);
|
|
88
|
+
return e[k.value + 1] = t, e;
|
|
89
|
+
}), He = a(() => {
|
|
90
|
+
let e = T.value?.rows ?? [], t = [], n = x;
|
|
91
|
+
for (let r = 0; r < e.length; r++) t[r + 1] = n, n += N(r);
|
|
92
92
|
return t[e.length + 1] = n, t;
|
|
93
|
-
}),
|
|
94
|
-
function
|
|
95
|
-
let e =
|
|
93
|
+
}), Ue = g(null), I = g(null), L = g([]), R = g([]);
|
|
94
|
+
function We() {
|
|
95
|
+
let e = Ue.value;
|
|
96
96
|
if (!e) return;
|
|
97
|
-
let t = e.
|
|
98
|
-
for (let e = 1; e <=
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
r && (n[D.value + 1] = r.offsetLeft + r.offsetWidth);
|
|
104
|
-
let i = e.querySelectorAll("tbody > tr > th.xv__rowhead"), a = [];
|
|
105
|
-
for (let e = 0; e < i.length; e++) a[e + 1] = i[e].offsetTop;
|
|
106
|
-
let o = i[i.length - 1];
|
|
107
|
-
o && (a[i.length + 1] = o.offsetTop + o.offsetHeight), F.value = n, I.value = a;
|
|
97
|
+
let t = e.tHead?.rows[0], n = t?.cells, r = [], i = n?.[0]?.getBoundingClientRect().width ?? b;
|
|
98
|
+
for (let e = 1; e <= k.value; e++) r[e] = i, i += n?.[e]?.getBoundingClientRect().width ?? M(e);
|
|
99
|
+
r[k.value + 1] = i;
|
|
100
|
+
let a = e.tBodies[0]?.rows, o = [], s = t?.getBoundingClientRect().height ?? x, c = T.value?.rows.length ?? 0;
|
|
101
|
+
for (let e = 0; e < c; e++) o[e + 1] = s, s += a?.[e]?.getBoundingClientRect().height ?? N(e);
|
|
102
|
+
o[c + 1] = s, L.value = r, R.value = o;
|
|
108
103
|
}
|
|
109
|
-
function
|
|
110
|
-
f(
|
|
104
|
+
function z() {
|
|
105
|
+
L.value = [], R.value = [], f(We);
|
|
111
106
|
}
|
|
112
|
-
let
|
|
107
|
+
let B = (e) => L.value[e] ?? Ve.value[e], V = (e) => R.value[e] ?? He.value[e], Ge = a(() => {
|
|
113
108
|
let e = /* @__PURE__ */ new Map();
|
|
114
|
-
if (!
|
|
109
|
+
if (!T.value) return e;
|
|
115
110
|
let t = 0;
|
|
116
|
-
for (let n = 1; n <=
|
|
111
|
+
for (let n = 1; n <= k.value; n++) A(n) ? t ||= n : (t && e.set(n, {
|
|
117
112
|
start: t,
|
|
118
113
|
end: n - 1,
|
|
119
114
|
count: n - t
|
|
120
115
|
}), t = 0);
|
|
121
116
|
return e;
|
|
122
|
-
}),
|
|
123
|
-
let e = /* @__PURE__ */ new Map(), t =
|
|
124
|
-
for (let r = 0; r < t.length; r++)
|
|
117
|
+
}), Ke = a(() => {
|
|
118
|
+
let e = /* @__PURE__ */ new Map(), t = T.value?.rows ?? [], n = 0;
|
|
119
|
+
for (let r = 0; r < t.length; r++) j(r) ? n ||= r + 1 : (n && e.set(r, {
|
|
125
120
|
start: n,
|
|
126
121
|
end: r,
|
|
127
122
|
count: r + 1 - n
|
|
128
123
|
}), n = 0);
|
|
129
124
|
return e;
|
|
130
125
|
});
|
|
131
|
-
function
|
|
132
|
-
let t =
|
|
126
|
+
function qe(e) {
|
|
127
|
+
let t = O();
|
|
133
128
|
for (let n = e.start; n <= e.end; n++) t.revealCol[n] = !0;
|
|
134
|
-
|
|
129
|
+
z();
|
|
135
130
|
}
|
|
136
|
-
function
|
|
137
|
-
let t =
|
|
131
|
+
function Je(e) {
|
|
132
|
+
let t = O();
|
|
138
133
|
for (let n = e.start; n <= e.end; n++) t.revealRow[n] = !0;
|
|
139
|
-
|
|
134
|
+
z();
|
|
140
135
|
}
|
|
141
|
-
let
|
|
142
|
-
function
|
|
136
|
+
let Ye;
|
|
137
|
+
function Xe(e, t, n) {
|
|
143
138
|
if (typeof document > "u") {
|
|
144
139
|
let n = 0;
|
|
145
140
|
for (let r of e) n += r.codePointAt(0) > 11903 ? t : t * .6;
|
|
146
141
|
return n;
|
|
147
142
|
}
|
|
148
|
-
|
|
149
|
-
let r =
|
|
143
|
+
Ye === void 0 && (Ye = document.createElement("canvas").getContext("2d"));
|
|
144
|
+
let r = Ye;
|
|
150
145
|
if (!r) {
|
|
151
146
|
let n = 0;
|
|
152
147
|
for (let r of e) n += r.codePointAt(0) > 11903 ? t : t * .6;
|
|
@@ -154,26 +149,26 @@ var re = { class: "xv" }, ie = {
|
|
|
154
149
|
}
|
|
155
150
|
return r.font = `${n ? "700 " : ""}${t}px Calibri, 'Segoe UI', system-ui, sans-serif`, r.measureText(e).width;
|
|
156
151
|
}
|
|
157
|
-
let
|
|
158
|
-
let e = /* @__PURE__ */ new Map(), t =
|
|
152
|
+
let Ze = a(() => {
|
|
153
|
+
let e = /* @__PURE__ */ new Map(), t = T.value?.rows ?? [];
|
|
159
154
|
for (let n = 0; n < t.length; n++) {
|
|
160
155
|
let r = t[n].cells;
|
|
161
156
|
for (let t = 0; t < r.length; t++) {
|
|
162
157
|
let i = r[t];
|
|
163
|
-
if (!i.text.trim() || i.wrap ||
|
|
164
|
-
let a =
|
|
165
|
-
if (o <= a -
|
|
158
|
+
if (!i.text.trim() || i.wrap || A(i.col) || i.colSpan > 1 || i.rowSpan > 1) continue;
|
|
159
|
+
let a = M(i.col), o = Xe(i.text, i.fontSize ?? 16, i.bold);
|
|
160
|
+
if (o <= a - je) continue;
|
|
166
161
|
let s = 0, c = i.col + i.colSpan;
|
|
167
162
|
for (let e = t + 1; e < r.length; e++) {
|
|
168
163
|
let t = r[e];
|
|
169
164
|
if (t.col !== c || t.text.trim() !== "") break;
|
|
170
|
-
c = t.col + t.colSpan,
|
|
165
|
+
c = t.col + t.colSpan, A(t.col) || (s += M(t.col));
|
|
171
166
|
}
|
|
172
167
|
let l = 0, u = i.col;
|
|
173
168
|
for (let e = t - 1; e >= 0; e--) {
|
|
174
169
|
let t = r[e];
|
|
175
170
|
if (t.col + t.colSpan !== u || t.text.trim() !== "") break;
|
|
176
|
-
u = t.col,
|
|
171
|
+
u = t.col, A(t.col) || (l += M(t.col));
|
|
177
172
|
}
|
|
178
173
|
let d, f;
|
|
179
174
|
if (i.align === "right") d = Math.min(o, a + l), f = d - a;
|
|
@@ -190,107 +185,107 @@ var re = { class: "xv" }, ie = {
|
|
|
190
185
|
}
|
|
191
186
|
return e;
|
|
192
187
|
});
|
|
193
|
-
function
|
|
194
|
-
let n =
|
|
188
|
+
function Qe(e, t) {
|
|
189
|
+
let n = Ze.value.get(`${t}:${e.col}`);
|
|
195
190
|
if (n) return {
|
|
196
191
|
maxWidth: `${n.w}px`,
|
|
197
192
|
marginLeft: `${-n.left}px`,
|
|
198
193
|
textAlign: e.align ?? "left"
|
|
199
194
|
};
|
|
200
195
|
}
|
|
201
|
-
function
|
|
202
|
-
return
|
|
196
|
+
function $e(e) {
|
|
197
|
+
return P.value > 0 && e === P.value;
|
|
203
198
|
}
|
|
204
|
-
function
|
|
205
|
-
return
|
|
199
|
+
function et(e) {
|
|
200
|
+
return F.value > 0 && e + 1 === F.value;
|
|
206
201
|
}
|
|
207
|
-
function
|
|
208
|
-
let n = t + 1, r = e.col <=
|
|
202
|
+
function tt(e, t) {
|
|
203
|
+
let n = t + 1, r = e.col <= P.value, i = n <= F.value, a = {
|
|
209
204
|
color: e.color,
|
|
210
205
|
backgroundColor: e.bg,
|
|
211
|
-
textAlign:
|
|
206
|
+
textAlign: Ze.value.has(`${t}:${e.col}`) ? "left" : e.align,
|
|
212
207
|
verticalAlign: e.valign,
|
|
213
208
|
fontSize: e.fontSize ? `${e.fontSize}px` : void 0
|
|
214
209
|
};
|
|
215
|
-
return r && (a.left = `${
|
|
210
|
+
return r && (a.left = `${B(e.col)}px`), i && (a.top = `${V(n)}px`), (r || i) && (a.backgroundColor = e.bg || "#fff"), a;
|
|
216
211
|
}
|
|
217
|
-
function
|
|
218
|
-
return e + 1 <=
|
|
212
|
+
function nt(e) {
|
|
213
|
+
return e + 1 <= F.value ? { top: `${V(e + 1)}px` } : {};
|
|
219
214
|
}
|
|
220
|
-
function
|
|
221
|
-
return e <=
|
|
215
|
+
function rt(e) {
|
|
216
|
+
return e <= P.value ? { left: `${B(e)}px` } : {};
|
|
222
217
|
}
|
|
223
|
-
let
|
|
224
|
-
function
|
|
225
|
-
|
|
218
|
+
let H = null;
|
|
219
|
+
function it(e, t) {
|
|
220
|
+
H = {
|
|
226
221
|
kind: "col",
|
|
227
222
|
index: e,
|
|
228
223
|
startPos: t.clientX,
|
|
229
|
-
startSize:
|
|
224
|
+
startSize: M(e)
|
|
230
225
|
}, document.body.style.cursor = "col-resize";
|
|
231
226
|
}
|
|
232
|
-
function
|
|
233
|
-
|
|
227
|
+
function at(e, t) {
|
|
228
|
+
H = {
|
|
234
229
|
kind: "row",
|
|
235
230
|
index: e,
|
|
236
231
|
startPos: t.clientY,
|
|
237
|
-
startSize:
|
|
232
|
+
startSize: N(e - 1)
|
|
238
233
|
}, document.body.style.cursor = "row-resize";
|
|
239
234
|
}
|
|
240
|
-
function
|
|
241
|
-
if (!
|
|
242
|
-
let t =
|
|
243
|
-
|
|
235
|
+
function ot(e) {
|
|
236
|
+
if (!H) return;
|
|
237
|
+
let t = O();
|
|
238
|
+
H.kind === "col" ? t.colW[H.index] = Math.max(ke, Math.round(H.startSize + (e.clientX - H.startPos))) : t.rowH[H.index] = Math.max(Ae, Math.round(H.startSize + (e.clientY - H.startPos)));
|
|
244
239
|
}
|
|
245
|
-
function
|
|
246
|
-
|
|
240
|
+
function st() {
|
|
241
|
+
H && (H = null, document.body.style.cursor = "", z());
|
|
247
242
|
}
|
|
248
|
-
let
|
|
249
|
-
function
|
|
250
|
-
return
|
|
243
|
+
let U = g([]), W = !1, G = "cell";
|
|
244
|
+
function K() {
|
|
245
|
+
return U.value[U.value.length - 1] ?? null;
|
|
251
246
|
}
|
|
252
|
-
function
|
|
253
|
-
return Math.max(0, (
|
|
247
|
+
function ct() {
|
|
248
|
+
return Math.max(0, (T.value?.rows.length ?? 1) - 1);
|
|
254
249
|
}
|
|
255
|
-
function
|
|
256
|
-
return Math.max(1,
|
|
250
|
+
function lt() {
|
|
251
|
+
return Math.max(1, k.value);
|
|
257
252
|
}
|
|
258
|
-
let
|
|
259
|
-
function
|
|
260
|
-
return !!
|
|
253
|
+
let q = g(null);
|
|
254
|
+
function ut(e, t) {
|
|
255
|
+
return !!q.value && q.value.r === e && q.value.c === t;
|
|
261
256
|
}
|
|
262
|
-
function
|
|
263
|
-
if (
|
|
264
|
-
let e =
|
|
257
|
+
function dt(e, t, n, r, i) {
|
|
258
|
+
if (q.value = null, e.shiftKey && U.value.length) {
|
|
259
|
+
let e = U.value.slice();
|
|
265
260
|
e[e.length - 1] = {
|
|
266
261
|
a: i,
|
|
267
262
|
f: r,
|
|
268
263
|
kind: t
|
|
269
|
-
},
|
|
270
|
-
} else e.ctrlKey || e.metaKey ?
|
|
264
|
+
}, U.value = e;
|
|
265
|
+
} else e.ctrlKey || e.metaKey ? U.value = [...U.value, {
|
|
271
266
|
a: n,
|
|
272
267
|
f: r,
|
|
273
268
|
kind: t
|
|
274
|
-
}] :
|
|
269
|
+
}] : U.value = [{
|
|
275
270
|
a: n,
|
|
276
271
|
f: r,
|
|
277
272
|
kind: t
|
|
278
273
|
}];
|
|
279
|
-
|
|
274
|
+
W = !0, G = t, I.value?.focus({ preventScroll: !0 });
|
|
280
275
|
}
|
|
281
|
-
function
|
|
282
|
-
if (n.button !== 0 ||
|
|
276
|
+
function ft(e, t, n) {
|
|
277
|
+
if (n.button !== 0 || ut(e, t)) return;
|
|
283
278
|
let r = {
|
|
284
279
|
r: e,
|
|
285
280
|
c: t
|
|
286
281
|
};
|
|
287
|
-
|
|
282
|
+
dt(n, "cell", r, r, K()?.a ?? r);
|
|
288
283
|
}
|
|
289
|
-
function
|
|
290
|
-
|
|
284
|
+
function pt(e, t) {
|
|
285
|
+
q.value = {
|
|
291
286
|
r: e,
|
|
292
287
|
c: t
|
|
293
|
-
},
|
|
288
|
+
}, U.value = [{
|
|
294
289
|
a: {
|
|
295
290
|
r: e,
|
|
296
291
|
c: t
|
|
@@ -302,16 +297,16 @@ var re = { class: "xv" }, ie = {
|
|
|
302
297
|
kind: "cell"
|
|
303
298
|
}];
|
|
304
299
|
}
|
|
305
|
-
function
|
|
306
|
-
let n =
|
|
300
|
+
function mt(e, t) {
|
|
301
|
+
let n = U.value;
|
|
307
302
|
if (!n.length) return;
|
|
308
303
|
let r = n[n.length - 1], i;
|
|
309
|
-
i =
|
|
310
|
-
r:
|
|
304
|
+
i = G === "col" ? {
|
|
305
|
+
r: ct(),
|
|
311
306
|
c: t
|
|
312
|
-
} :
|
|
307
|
+
} : G === "row" ? {
|
|
313
308
|
r: e,
|
|
314
|
-
c:
|
|
309
|
+
c: lt()
|
|
315
310
|
} : {
|
|
316
311
|
r: e,
|
|
317
312
|
c: t
|
|
@@ -320,78 +315,78 @@ var re = { class: "xv" }, ie = {
|
|
|
320
315
|
a[a.length - 1] = {
|
|
321
316
|
a: r.a,
|
|
322
317
|
f: i,
|
|
323
|
-
kind:
|
|
324
|
-
},
|
|
318
|
+
kind: G
|
|
319
|
+
}, U.value = a;
|
|
325
320
|
}
|
|
326
|
-
function
|
|
327
|
-
|
|
321
|
+
function ht(e, t) {
|
|
322
|
+
W && mt(e, t);
|
|
328
323
|
}
|
|
329
|
-
function
|
|
330
|
-
|
|
324
|
+
function gt() {
|
|
325
|
+
W = !1;
|
|
331
326
|
}
|
|
332
|
-
function
|
|
333
|
-
t.button === 0 &&
|
|
327
|
+
function _t(e, t) {
|
|
328
|
+
t.button === 0 && dt(t, "col", {
|
|
334
329
|
r: 0,
|
|
335
330
|
c: e
|
|
336
331
|
}, {
|
|
337
|
-
r:
|
|
332
|
+
r: ct(),
|
|
338
333
|
c: e
|
|
339
334
|
}, {
|
|
340
335
|
r: 0,
|
|
341
|
-
c:
|
|
336
|
+
c: K()?.a.c ?? e
|
|
342
337
|
});
|
|
343
338
|
}
|
|
344
|
-
function
|
|
345
|
-
|
|
339
|
+
function vt(e) {
|
|
340
|
+
W && G === "col" && mt(0, e);
|
|
346
341
|
}
|
|
347
|
-
function
|
|
348
|
-
t.button === 0 &&
|
|
342
|
+
function yt(e, t) {
|
|
343
|
+
t.button === 0 && dt(t, "row", {
|
|
349
344
|
r: e,
|
|
350
345
|
c: 1
|
|
351
346
|
}, {
|
|
352
347
|
r: e,
|
|
353
|
-
c:
|
|
348
|
+
c: lt()
|
|
354
349
|
}, {
|
|
355
|
-
r:
|
|
350
|
+
r: K()?.a.r ?? e,
|
|
356
351
|
c: 1
|
|
357
352
|
});
|
|
358
353
|
}
|
|
359
|
-
function
|
|
360
|
-
|
|
354
|
+
function bt(e) {
|
|
355
|
+
W && G === "row" && mt(e, 1);
|
|
361
356
|
}
|
|
362
|
-
function
|
|
363
|
-
let n =
|
|
357
|
+
function xt(e, t) {
|
|
358
|
+
let n = T.value?.rows.length ?? 0, r = e;
|
|
364
359
|
for (let i = 0; i < n; i++) {
|
|
365
360
|
if (r += t, r < 0 || r >= n) return e;
|
|
366
|
-
if (!
|
|
361
|
+
if (!j(r)) return r;
|
|
367
362
|
}
|
|
368
363
|
return e;
|
|
369
364
|
}
|
|
370
|
-
function
|
|
371
|
-
let n =
|
|
365
|
+
function St(e, t) {
|
|
366
|
+
let n = k.value, r = e;
|
|
372
367
|
for (let i = 0; i < n; i++) {
|
|
373
368
|
if (r += t, r < 1 || r > n) return e;
|
|
374
|
-
if (!
|
|
369
|
+
if (!A(r)) return r;
|
|
375
370
|
}
|
|
376
371
|
return e;
|
|
377
372
|
}
|
|
378
|
-
function
|
|
373
|
+
function J(e, t) {
|
|
379
374
|
f(() => {
|
|
380
|
-
let n =
|
|
375
|
+
let n = I.value;
|
|
381
376
|
if (!n) return;
|
|
382
|
-
let r =
|
|
377
|
+
let r = B(t), i = B(t + 1), a = V(e + 1), o = V(e + 2);
|
|
383
378
|
if (r == null || i == null || a == null || o == null) return;
|
|
384
379
|
let s = 0;
|
|
385
|
-
for (let e = 1; e <=
|
|
380
|
+
for (let e = 1; e <= P.value; e++) s += M(e);
|
|
386
381
|
let c = 0;
|
|
387
|
-
for (let e = 0; e <
|
|
388
|
-
let l =
|
|
382
|
+
for (let e = 0; e < F.value; e++) c += N(e);
|
|
383
|
+
let l = b + s, u = x + c;
|
|
389
384
|
r - l < n.scrollLeft ? n.scrollLeft = r - l : i > n.scrollLeft + n.clientWidth && (n.scrollLeft = i - n.clientWidth), a - u < n.scrollTop ? n.scrollTop = a - u : o > n.scrollTop + n.clientHeight && (n.scrollTop = o - n.clientHeight);
|
|
390
385
|
});
|
|
391
386
|
}
|
|
392
|
-
function
|
|
393
|
-
if (
|
|
394
|
-
e.key === "Escape" && (
|
|
387
|
+
function Ct(e) {
|
|
388
|
+
if (q.value) {
|
|
389
|
+
e.key === "Escape" && (q.value = null, e.preventDefault());
|
|
395
390
|
return;
|
|
396
391
|
}
|
|
397
392
|
let t = {
|
|
@@ -399,10 +394,10 @@ var re = { class: "xv" }, ie = {
|
|
|
399
394
|
ArrowDown: [1, 0],
|
|
400
395
|
ArrowLeft: [0, -1],
|
|
401
396
|
ArrowRight: [0, 1]
|
|
402
|
-
}, n =
|
|
397
|
+
}, n = K();
|
|
403
398
|
if (e.key in t) {
|
|
404
399
|
if (e.preventDefault(), !n) {
|
|
405
|
-
|
|
400
|
+
U.value = [{
|
|
406
401
|
a: {
|
|
407
402
|
r: 0,
|
|
408
403
|
c: 1
|
|
@@ -412,11 +407,11 @@ var re = { class: "xv" }, ie = {
|
|
|
412
407
|
c: 1
|
|
413
408
|
},
|
|
414
409
|
kind: "cell"
|
|
415
|
-
}],
|
|
410
|
+
}], J(0, 1);
|
|
416
411
|
return;
|
|
417
412
|
}
|
|
418
|
-
let [r, i] = t[e.key], a = e.shiftKey ? n.f : n.a, o = r ?
|
|
419
|
-
|
|
413
|
+
let [r, i] = t[e.key], a = e.shiftKey ? n.f : n.a, o = r ? xt(a.r, r) : a.r, s = i ? St(a.c, i) : a.c;
|
|
414
|
+
U.value = e.shiftKey ? [{
|
|
420
415
|
a: n.a,
|
|
421
416
|
f: {
|
|
422
417
|
r: o,
|
|
@@ -433,12 +428,12 @@ var re = { class: "xv" }, ie = {
|
|
|
433
428
|
c: s
|
|
434
429
|
},
|
|
435
430
|
kind: "cell"
|
|
436
|
-
}],
|
|
431
|
+
}], J(o, s);
|
|
437
432
|
} else if (e.key === "Enter") {
|
|
438
433
|
if (!n) return;
|
|
439
434
|
e.preventDefault();
|
|
440
|
-
let t =
|
|
441
|
-
|
|
435
|
+
let t = xt(n.a.r, e.shiftKey ? -1 : 1);
|
|
436
|
+
U.value = [{
|
|
442
437
|
a: {
|
|
443
438
|
r: t,
|
|
444
439
|
c: n.a.c
|
|
@@ -448,12 +443,12 @@ var re = { class: "xv" }, ie = {
|
|
|
448
443
|
c: n.a.c
|
|
449
444
|
},
|
|
450
445
|
kind: "cell"
|
|
451
|
-
}],
|
|
446
|
+
}], J(t, n.a.c);
|
|
452
447
|
} else if (e.key === "Tab") {
|
|
453
448
|
if (!n) return;
|
|
454
449
|
e.preventDefault();
|
|
455
|
-
let t =
|
|
456
|
-
|
|
450
|
+
let t = St(n.a.c, e.shiftKey ? -1 : 1);
|
|
451
|
+
U.value = [{
|
|
457
452
|
a: {
|
|
458
453
|
r: n.a.r,
|
|
459
454
|
c: t
|
|
@@ -463,11 +458,11 @@ var re = { class: "xv" }, ie = {
|
|
|
463
458
|
c: t
|
|
464
459
|
},
|
|
465
460
|
kind: "cell"
|
|
466
|
-
}],
|
|
467
|
-
} else e.key === "Escape" && (
|
|
461
|
+
}], J(n.a.r, t);
|
|
462
|
+
} else e.key === "Escape" && (U.value = []);
|
|
468
463
|
}
|
|
469
|
-
let
|
|
470
|
-
let e = [], t =
|
|
464
|
+
let wt = a(() => {
|
|
465
|
+
let e = [], t = T.value?.rows ?? [];
|
|
471
466
|
for (let n = 0; n < t.length; n++) for (let r of t[n].cells) (r.colSpan > 1 || r.rowSpan > 1) && e.push({
|
|
472
467
|
r0: n,
|
|
473
468
|
r1: n + r.rowSpan - 1,
|
|
@@ -476,10 +471,10 @@ var re = { class: "xv" }, ie = {
|
|
|
476
471
|
});
|
|
477
472
|
return e;
|
|
478
473
|
});
|
|
479
|
-
function
|
|
474
|
+
function Tt(e) {
|
|
480
475
|
let t = Math.min(e.a.r, e.f.r), n = Math.max(e.a.r, e.f.r), r = Math.min(e.a.c, e.f.c), i = Math.max(e.a.c, e.f.c);
|
|
481
476
|
if (e.kind === "cell") {
|
|
482
|
-
let e =
|
|
477
|
+
let e = wt.value;
|
|
483
478
|
for (let a = 0; a <= e.length; a++) {
|
|
484
479
|
let a = !1;
|
|
485
480
|
for (let o of e) o.r0 > n || o.r1 < t || o.c0 > i || o.c1 < r || (o.r0 < t && (t = o.r0, a = !0), o.r1 > n && (n = o.r1, a = !0), o.c0 < r && (r = o.c0, a = !0), o.c1 > i && (i = o.c1, a = !0));
|
|
@@ -493,13 +488,13 @@ var re = { class: "xv" }, ie = {
|
|
|
493
488
|
maxC: i
|
|
494
489
|
};
|
|
495
490
|
}
|
|
496
|
-
let
|
|
497
|
-
let e =
|
|
498
|
-
return e ?
|
|
499
|
-
}),
|
|
491
|
+
let Y = a(() => U.value.map(Tt)), Et = a(() => {
|
|
492
|
+
let e = K();
|
|
493
|
+
return e ? Tt(e) : null;
|
|
494
|
+
}), Dt = a(() => {
|
|
500
495
|
let e = [];
|
|
501
|
-
for (let t of
|
|
502
|
-
let n =
|
|
496
|
+
for (let t of Y.value) {
|
|
497
|
+
let n = B(t.minC), r = B(t.maxC + 1), i = V(t.minR + 1), a = V(t.maxR + 2);
|
|
503
498
|
n == null || r == null || i == null || a == null || e.push({
|
|
504
499
|
left: `${n}px`,
|
|
505
500
|
top: `${i}px`,
|
|
@@ -509,23 +504,23 @@ var re = { class: "xv" }, ie = {
|
|
|
509
504
|
}
|
|
510
505
|
return e;
|
|
511
506
|
});
|
|
512
|
-
function
|
|
507
|
+
function Ot(e, t) {
|
|
513
508
|
let n = t, r = t + e.rowSpan - 1, i = e.col, a = e.col + e.colSpan - 1;
|
|
514
|
-
for (let e of
|
|
509
|
+
for (let e of Y.value) if (r >= e.minR && n <= e.maxR && a >= e.minC && i <= e.maxC) return !0;
|
|
515
510
|
return !1;
|
|
516
511
|
}
|
|
517
|
-
function
|
|
512
|
+
function kt(e) {
|
|
518
513
|
if (!e) return null;
|
|
519
514
|
let t = Number(e.replace(/,/g, "").trim());
|
|
520
515
|
return Number.isFinite(t) ? t : null;
|
|
521
516
|
}
|
|
522
|
-
let
|
|
523
|
-
let t =
|
|
517
|
+
let X = a(() => {
|
|
518
|
+
let t = T.value, n = Et.value;
|
|
524
519
|
if (!t || !n) return null;
|
|
525
520
|
let r = 0, i = 0;
|
|
526
521
|
for (let e = 0; e < t.rows.length; e++) for (let n of t.rows[e].cells) {
|
|
527
|
-
if (!
|
|
528
|
-
let t =
|
|
522
|
+
if (!Ot(n, e)) continue;
|
|
523
|
+
let t = kt(n.text);
|
|
529
524
|
t != null && (r += t, i++);
|
|
530
525
|
}
|
|
531
526
|
let a = (n.maxR - n.minR + 1) * (n.maxC - n.minC + 1);
|
|
@@ -537,186 +532,186 @@ var re = { class: "xv" }, ie = {
|
|
|
537
532
|
avg: i ? r / i : 0
|
|
538
533
|
};
|
|
539
534
|
});
|
|
540
|
-
function
|
|
535
|
+
function At(e) {
|
|
541
536
|
return (Math.round(e * 1e3) / 1e3).toLocaleString("en-US");
|
|
542
537
|
}
|
|
543
|
-
function
|
|
544
|
-
for (let t of
|
|
538
|
+
function jt(e) {
|
|
539
|
+
for (let t of Y.value) if (e >= t.minC && e <= t.maxC) return !0;
|
|
545
540
|
return !1;
|
|
546
541
|
}
|
|
547
|
-
function
|
|
548
|
-
for (let t of
|
|
542
|
+
function Mt(e) {
|
|
543
|
+
for (let t of Y.value) if (e >= t.minR && e <= t.maxR) return !0;
|
|
549
544
|
return !1;
|
|
550
545
|
}
|
|
551
|
-
function
|
|
552
|
-
return
|
|
546
|
+
function Nt(e, t) {
|
|
547
|
+
return T.value?.rows[e]?.cells.find((e) => e.col === t) ?? null;
|
|
553
548
|
}
|
|
554
|
-
let
|
|
555
|
-
let t =
|
|
549
|
+
let Pt = a(() => {
|
|
550
|
+
let t = K()?.a;
|
|
556
551
|
return t ? `${e(t.c)}${t.r + 1}` : "";
|
|
557
|
-
}),
|
|
558
|
-
let e =
|
|
552
|
+
}), Ft = a(() => {
|
|
553
|
+
let e = K()?.a;
|
|
559
554
|
if (!e) return "";
|
|
560
|
-
let t =
|
|
555
|
+
let t = Nt(e.r, e.c);
|
|
561
556
|
return t ? t.formula ? `=${t.formula}` : t.text : "";
|
|
562
|
-
}),
|
|
557
|
+
}), It = a(() => T.value ? Pe.value.get(T.value.name) ?? [] : []), Lt = a(() => It.value.map((e) => {
|
|
563
558
|
let t = e.anchor.fromCol + 1, n = e.anchor.fromRow + 1;
|
|
564
559
|
return {
|
|
565
560
|
chart: e,
|
|
566
|
-
left: (
|
|
567
|
-
top: (
|
|
561
|
+
left: (B(t) ?? B(k.value + 1) ?? b) + e.anchor.offX,
|
|
562
|
+
top: (V(n) ?? V((T.value?.rows.length ?? 0) + 1) ?? x) + e.anchor.offY,
|
|
568
563
|
width: e.anchor.wPx,
|
|
569
564
|
height: e.anchor.hPx
|
|
570
565
|
};
|
|
571
|
-
})),
|
|
572
|
-
function
|
|
573
|
-
let e =
|
|
566
|
+
})), Z = g(null), Q = g(!1), Rt = g(!0), zt = g(!1);
|
|
567
|
+
function $() {
|
|
568
|
+
let e = Z.value;
|
|
574
569
|
if (!e) {
|
|
575
|
-
|
|
570
|
+
Q.value = !1;
|
|
576
571
|
return;
|
|
577
572
|
}
|
|
578
573
|
let t = e.scrollWidth - e.clientWidth;
|
|
579
|
-
|
|
574
|
+
Q.value = t > 1, Rt.value = e.scrollLeft <= 1, zt.value = e.scrollLeft >= t - 1;
|
|
580
575
|
}
|
|
581
|
-
function
|
|
582
|
-
let t =
|
|
576
|
+
function Bt(e) {
|
|
577
|
+
let t = Z.value;
|
|
583
578
|
t && t.scrollBy({
|
|
584
579
|
left: e * Math.max(120, t.clientWidth * .7),
|
|
585
580
|
behavior: "smooth"
|
|
586
581
|
});
|
|
587
582
|
}
|
|
588
|
-
function
|
|
589
|
-
let t =
|
|
583
|
+
function Vt(e) {
|
|
584
|
+
let t = Z.value;
|
|
590
585
|
if (!t || t.scrollWidth <= t.clientWidth) return;
|
|
591
586
|
let n = Math.abs(e.deltaY) > Math.abs(e.deltaX) ? e.deltaY : e.deltaX;
|
|
592
|
-
n && (t.scrollLeft += n, e.preventDefault(),
|
|
587
|
+
n && (t.scrollLeft += n, e.preventDefault(), $());
|
|
593
588
|
}
|
|
594
|
-
function
|
|
589
|
+
function Ht() {
|
|
595
590
|
f(() => {
|
|
596
|
-
|
|
591
|
+
Z.value?.querySelector(".xv__tab--on")?.scrollIntoView({
|
|
597
592
|
inline: "nearest",
|
|
598
593
|
block: "nearest"
|
|
599
|
-
}),
|
|
594
|
+
}), $();
|
|
600
595
|
});
|
|
601
596
|
}
|
|
602
|
-
let
|
|
603
|
-
ne(
|
|
604
|
-
|
|
597
|
+
let Ut = null;
|
|
598
|
+
ne(Z, (e) => {
|
|
599
|
+
Ut?.disconnect(), e && typeof ResizeObserver < "u" && (Ut = new ResizeObserver($), Ut.observe(e), $());
|
|
605
600
|
});
|
|
606
601
|
async function Wt() {
|
|
607
|
-
if (!
|
|
608
|
-
|
|
609
|
-
let e =
|
|
602
|
+
if (!S.url) return;
|
|
603
|
+
C.value = "loading", Me.value = "", Ne.value = null, Pe.value = /* @__PURE__ */ new Map(), E.value = {}, U.value = [], q.value = null, w.value = 0, L.value = [], R.value = [];
|
|
604
|
+
let e = S.url;
|
|
610
605
|
try {
|
|
611
606
|
let r = await fetch(e);
|
|
612
607
|
if (!r.ok) throw Error(`HTTP ${r.status}`);
|
|
613
608
|
let i = await r.arrayBuffer();
|
|
614
|
-
if (
|
|
609
|
+
if (S.url !== e) return;
|
|
615
610
|
let a = await t(i);
|
|
616
|
-
if (
|
|
617
|
-
|
|
611
|
+
if (S.url !== e) return;
|
|
612
|
+
Ne.value = a, C.value = "ready", z();
|
|
618
613
|
try {
|
|
619
614
|
let t = await n(i);
|
|
620
|
-
|
|
615
|
+
S.url === e && (Pe.value = t, z());
|
|
621
616
|
} catch {}
|
|
622
617
|
} catch (e) {
|
|
623
|
-
|
|
618
|
+
Me.value = e instanceof Error ? e.message : String(e), C.value = "error";
|
|
624
619
|
}
|
|
625
620
|
}
|
|
626
|
-
ne(
|
|
627
|
-
|
|
628
|
-
let e =
|
|
629
|
-
e && (e.scrollTop = 0, e.scrollLeft = 0),
|
|
621
|
+
ne(w, () => {
|
|
622
|
+
U.value = [], q.value = null, L.value = [], R.value = [];
|
|
623
|
+
let e = I.value;
|
|
624
|
+
e && (e.scrollTop = 0, e.scrollLeft = 0), z(), Ht();
|
|
630
625
|
}), te(() => {
|
|
631
|
-
Wt(), window.addEventListener("mousemove",
|
|
626
|
+
Wt(), window.addEventListener("mousemove", ot), window.addEventListener("mouseup", Gt);
|
|
632
627
|
}), ee(() => {
|
|
633
|
-
window.removeEventListener("mousemove",
|
|
628
|
+
window.removeEventListener("mousemove", ot), window.removeEventListener("mouseup", Gt), Ut?.disconnect();
|
|
634
629
|
});
|
|
635
630
|
function Gt() {
|
|
636
|
-
|
|
631
|
+
st(), gt();
|
|
637
632
|
}
|
|
638
|
-
return ne(() =>
|
|
633
|
+
return ne(() => S.url, Wt), (e, t) => (h(), s("div", re, [C.value === "loading" ? (h(), s("p", ie, "正在解析表格…")) : C.value === "error" ? (h(), s("div", ae, [c("p", null, "解析失败:" + v(Me.value), 1), c("button", {
|
|
639
634
|
type: "button",
|
|
640
635
|
class: "xv__retry",
|
|
641
636
|
onClick: Wt
|
|
642
|
-
}, "重试")])) :
|
|
643
|
-
c("div", oe, [c("span", se, v(
|
|
637
|
+
}, "重试")])) : C.value === "ready" && T.value ? (h(), s(i, { key: 2 }, [
|
|
638
|
+
c("div", oe, [c("span", se, v(Pt.value || "—"), 1), c("span", ce, v(Ft.value), 1)]),
|
|
644
639
|
c("div", {
|
|
645
640
|
ref_key: "scrollEl",
|
|
646
|
-
ref:
|
|
641
|
+
ref: I,
|
|
647
642
|
class: "xv__scroll",
|
|
648
643
|
tabindex: "0",
|
|
649
|
-
onKeydown:
|
|
644
|
+
onKeydown: Ct
|
|
650
645
|
}, [c("div", le, [
|
|
651
646
|
c("table", {
|
|
652
647
|
ref_key: "tableEl",
|
|
653
|
-
ref:
|
|
648
|
+
ref: Ue,
|
|
654
649
|
class: "xv__table",
|
|
655
|
-
style: m({ width:
|
|
650
|
+
style: m({ width: Ve.value[k.value + 1] + "px" })
|
|
656
651
|
}, [
|
|
657
|
-
c("colgroup", null, [t[4] ||= c("col", { class: "xv__rowhead-col" }, null, -1), (h(!0), s(i, null, _(
|
|
652
|
+
c("colgroup", null, [t[4] ||= c("col", { class: "xv__rowhead-col" }, null, -1), (h(!0), s(i, null, _(k.value, (e) => (h(), s("col", {
|
|
658
653
|
key: e,
|
|
659
654
|
style: m({
|
|
660
|
-
width:
|
|
661
|
-
minWidth:
|
|
655
|
+
width: M(e) + "px",
|
|
656
|
+
minWidth: M(e) + "px"
|
|
662
657
|
})
|
|
663
658
|
}, null, 4))), 128))]),
|
|
664
|
-
c("thead", null, [c("tr", null, [t[5] ||= c("th", { class: "xv__corner" }, null, -1), (h(!0), s(i, null, _(
|
|
659
|
+
c("thead", null, [c("tr", null, [t[5] ||= c("th", { class: "xv__corner" }, null, -1), (h(!0), s(i, null, _(Be.value, (e, n) => (h(), s("th", {
|
|
665
660
|
key: n,
|
|
666
661
|
class: p(["xv__colhead", {
|
|
667
|
-
"xv__colhead--coll":
|
|
668
|
-
"xv__colhead--frz": n + 1 <=
|
|
669
|
-
"xv__colhead--frzedge":
|
|
670
|
-
"xv__colhead--sel":
|
|
662
|
+
"xv__colhead--coll": A(n + 1),
|
|
663
|
+
"xv__colhead--frz": n + 1 <= P.value,
|
|
664
|
+
"xv__colhead--frzedge": $e(n + 1),
|
|
665
|
+
"xv__colhead--sel": jt(n + 1)
|
|
671
666
|
}]),
|
|
672
|
-
style: m(
|
|
667
|
+
style: m(rt(n + 1)),
|
|
673
668
|
title: "点击选中整列 · 拖动选多列 · Shift 连选 · Ctrl 多选",
|
|
674
|
-
onMousedown: (e) =>
|
|
675
|
-
onMouseenter: (e) =>
|
|
669
|
+
onMousedown: (e) => _t(n + 1, e),
|
|
670
|
+
onMouseenter: (e) => vt(n + 1)
|
|
676
671
|
}, [
|
|
677
|
-
|
|
672
|
+
Ge.value.get(n + 1) ? (h(), s("button", {
|
|
678
673
|
key: 0,
|
|
679
674
|
type: "button",
|
|
680
675
|
class: "xv__expander xv__expander--col",
|
|
681
|
-
title: `展开 ${
|
|
676
|
+
title: `展开 ${Ge.value.get(n + 1).count} 个隐藏列`,
|
|
682
677
|
onMousedown: t[0] ||= y(() => {}, ["stop"]),
|
|
683
|
-
onClick: y((e) =>
|
|
678
|
+
onClick: y((e) => qe(Ge.value.get(n + 1)), ["stop"])
|
|
684
679
|
}, " ›‹ ", 40, de)) : o("", !0),
|
|
685
680
|
c("span", fe, v(e), 1),
|
|
686
681
|
c("span", {
|
|
687
682
|
class: "xv__col-resize",
|
|
688
683
|
title: "拖动调整列宽",
|
|
689
|
-
onMousedown: y((e) =>
|
|
684
|
+
onMousedown: y((e) => it(n + 1, e), ["stop", "prevent"])
|
|
690
685
|
}, null, 40, pe)
|
|
691
686
|
], 46, ue))), 128))])]),
|
|
692
|
-
c("tbody", null, [(h(!0), s(i, null, _(
|
|
687
|
+
c("tbody", null, [(h(!0), s(i, null, _(T.value.rows, (e, n) => (h(), s("tr", {
|
|
693
688
|
key: n,
|
|
694
|
-
class: p({ "xv__row--coll":
|
|
695
|
-
style: m({ height:
|
|
689
|
+
class: p({ "xv__row--coll": j(n) }),
|
|
690
|
+
style: m({ height: N(n) + "px" })
|
|
696
691
|
}, [c("th", {
|
|
697
692
|
class: p(["xv__rowhead", {
|
|
698
|
-
"xv__rowhead--frz": n + 1 <=
|
|
699
|
-
"xv__rowhead--frzedge":
|
|
700
|
-
"xv__rowhead--sel":
|
|
693
|
+
"xv__rowhead--frz": n + 1 <= F.value,
|
|
694
|
+
"xv__rowhead--frzedge": et(n),
|
|
695
|
+
"xv__rowhead--sel": Mt(n)
|
|
701
696
|
}]),
|
|
702
|
-
style: m(
|
|
697
|
+
style: m(nt(n)),
|
|
703
698
|
title: "点击选中整行 · 拖动选多行 · Shift 连选 · Ctrl 多选",
|
|
704
|
-
onMousedown: (e) =>
|
|
705
|
-
onMouseenter: (e) =>
|
|
699
|
+
onMousedown: (e) => yt(n, e),
|
|
700
|
+
onMouseenter: (e) => bt(n)
|
|
706
701
|
}, [
|
|
707
|
-
|
|
702
|
+
Ke.value.get(n) ? (h(), s("button", {
|
|
708
703
|
key: 0,
|
|
709
704
|
type: "button",
|
|
710
705
|
class: "xv__expander xv__expander--row",
|
|
711
|
-
title: `展开 ${
|
|
706
|
+
title: `展开 ${Ke.value.get(n).count} 个隐藏行`,
|
|
712
707
|
onMousedown: t[1] ||= y(() => {}, ["stop"]),
|
|
713
|
-
onClick: y((e) =>
|
|
708
|
+
onClick: y((e) => Je(Ke.value.get(n)), ["stop"])
|
|
714
709
|
}, " ⌄ ", 40, he)) : o("", !0),
|
|
715
710
|
c("span", ge, v(e.num), 1),
|
|
716
711
|
c("span", {
|
|
717
712
|
class: "xv__row-resize",
|
|
718
713
|
title: "拖动调整行高",
|
|
719
|
-
onMousedown: y((t) =>
|
|
714
|
+
onMousedown: y((t) => at(e.num, t), ["stop", "prevent"])
|
|
720
715
|
}, null, 40, _e)
|
|
721
716
|
], 46, me), (h(!0), s(i, null, _(e.cells, (e) => (h(), s("td", {
|
|
722
717
|
key: e.col,
|
|
@@ -730,32 +725,32 @@ var re = { class: "xv" }, ie = {
|
|
|
730
725
|
"xv__cell--br": e.br,
|
|
731
726
|
"xv__cell--bb": e.bb,
|
|
732
727
|
"xv__cell--bl": e.bl,
|
|
733
|
-
"xv__cell--coll":
|
|
734
|
-
"xv__cell--frz-col": e.col <=
|
|
735
|
-
"xv__cell--frz-row": n + 1 <=
|
|
736
|
-
"xv__cell--frzedge-col":
|
|
737
|
-
"xv__cell--frzedge-row":
|
|
738
|
-
"xv__cell--edit":
|
|
739
|
-
"xv__cell--spill":
|
|
740
|
-
"xv__cell--sel":
|
|
728
|
+
"xv__cell--coll": A(e.col),
|
|
729
|
+
"xv__cell--frz-col": e.col <= P.value,
|
|
730
|
+
"xv__cell--frz-row": n + 1 <= F.value,
|
|
731
|
+
"xv__cell--frzedge-col": $e(e.col),
|
|
732
|
+
"xv__cell--frzedge-row": et(n),
|
|
733
|
+
"xv__cell--edit": ut(n, e.col),
|
|
734
|
+
"xv__cell--spill": Ze.value.has(`${n}:${e.col}`),
|
|
735
|
+
"xv__cell--sel": Ot(e, n)
|
|
741
736
|
}]),
|
|
742
737
|
rowspan: e.rowSpan > 1 ? e.rowSpan : void 0,
|
|
743
738
|
colspan: e.colSpan > 1 ? e.colSpan : void 0,
|
|
744
|
-
style: m(
|
|
745
|
-
onMousedown: (t) =>
|
|
746
|
-
onMouseenter: (t) =>
|
|
747
|
-
onDblclick: (t) =>
|
|
739
|
+
style: m(tt(e, n)),
|
|
740
|
+
onMousedown: (t) => ft(n, e.col, t),
|
|
741
|
+
onMouseenter: (t) => ht(n, e.col),
|
|
742
|
+
onDblclick: (t) => pt(n, e.col)
|
|
748
743
|
}, [c("span", {
|
|
749
744
|
class: "xv__cellt",
|
|
750
|
-
style: m(
|
|
745
|
+
style: m(Qe(e, n))
|
|
751
746
|
}, v(e.text), 5)], 46, ve))), 128))], 6))), 128))])
|
|
752
747
|
], 4),
|
|
753
|
-
(h(!0), s(i, null, _(
|
|
748
|
+
(h(!0), s(i, null, _(Dt.value, (e, t) => (h(), s("div", {
|
|
754
749
|
key: t,
|
|
755
750
|
class: "xv__sel",
|
|
756
751
|
style: m(e)
|
|
757
752
|
}, null, 4))), 128)),
|
|
758
|
-
c("div", ye, [(h(!0), s(i, null, _(
|
|
753
|
+
c("div", ye, [(h(!0), s(i, null, _(Lt.value, (e, t) => (h(), s("div", {
|
|
759
754
|
key: t,
|
|
760
755
|
class: "xv__chart",
|
|
761
756
|
style: m({
|
|
@@ -766,49 +761,49 @@ var re = { class: "xv" }, ie = {
|
|
|
766
761
|
})
|
|
767
762
|
}, [u(r, { chart: e.chart }, null, 8, ["chart"])], 4))), 128))])
|
|
768
763
|
])], 544),
|
|
769
|
-
c("div", be, [
|
|
764
|
+
c("div", be, [X.value ? (h(), s("span", xe, [l(v(X.value.addr) + " ", 1), X.value.numCount > 0 ? (h(), s(i, { key: 0 }, [l(" · 计数 " + v(X.value.numCount) + " · 求和 " + v(At(X.value.sum)) + " ", 1), X.value.numCount > 1 ? (h(), s(i, { key: 0 }, [l(" · 平均 " + v(At(X.value.avg)), 1)], 64)) : o("", !0)], 64)) : o("", !0)])) : (h(), s("span", Se, "拖动 / 方向键选择 · Shift 连选 · Ctrl 多选 · 点击或拖动行列头选整行/列 · 双击编辑文本 · 拖行列头边缘调尺寸")), c("span", Ce, [c("button", {
|
|
770
765
|
type: "button",
|
|
771
|
-
class: p(["xv__status-btn", { "xv__status-btn--on":
|
|
772
|
-
onClick:
|
|
773
|
-
}, v(
|
|
766
|
+
class: p(["xv__status-btn", { "xv__status-btn--on": D.value.revealAll }]),
|
|
767
|
+
onClick: ze
|
|
768
|
+
}, v(D.value.revealAll ? "折叠隐藏行列" : "显示隐藏行列"), 3), Le.value ? (h(), s("button", {
|
|
774
769
|
key: 0,
|
|
775
770
|
type: "button",
|
|
776
771
|
class: "xv__status-btn",
|
|
777
|
-
onClick:
|
|
772
|
+
onClick: Re
|
|
778
773
|
}, " 复位 ")) : o("", !0)])]),
|
|
779
|
-
|
|
780
|
-
|
|
774
|
+
Fe.value.length > 1 ? (h(), s("div", we, [
|
|
775
|
+
Q.value ? (h(), s("button", {
|
|
781
776
|
key: 0,
|
|
782
777
|
type: "button",
|
|
783
778
|
class: "xv__tabscroll",
|
|
784
|
-
disabled:
|
|
779
|
+
disabled: Rt.value,
|
|
785
780
|
title: "向左滚动标签",
|
|
786
|
-
onClick: t[2] ||= (e) =>
|
|
781
|
+
onClick: t[2] ||= (e) => Bt(-1)
|
|
787
782
|
}, " ‹ ", 8, Te)) : o("", !0),
|
|
788
783
|
c("div", {
|
|
789
784
|
ref_key: "tabsEl",
|
|
790
|
-
ref:
|
|
785
|
+
ref: Z,
|
|
791
786
|
class: "xv__tabs",
|
|
792
|
-
onScroll:
|
|
793
|
-
onWheel:
|
|
794
|
-
}, [(h(!0), s(i, null, _(
|
|
787
|
+
onScroll: $,
|
|
788
|
+
onWheel: Vt
|
|
789
|
+
}, [(h(!0), s(i, null, _(Fe.value, (e, t) => (h(), s("button", {
|
|
795
790
|
key: t,
|
|
796
791
|
type: "button",
|
|
797
|
-
class: p(["xv__tab", { "xv__tab--on": t ===
|
|
792
|
+
class: p(["xv__tab", { "xv__tab--on": t === w.value }]),
|
|
798
793
|
title: e.name,
|
|
799
|
-
onClick: (e) =>
|
|
794
|
+
onClick: (e) => w.value = t
|
|
800
795
|
}, v(e.name), 11, Ee))), 128))], 544),
|
|
801
|
-
|
|
796
|
+
Q.value ? (h(), s("button", {
|
|
802
797
|
key: 1,
|
|
803
798
|
type: "button",
|
|
804
799
|
class: "xv__tabscroll",
|
|
805
|
-
disabled:
|
|
800
|
+
disabled: zt.value,
|
|
806
801
|
title: "向右滚动标签",
|
|
807
|
-
onClick: t[3] ||= (e) =>
|
|
802
|
+
onClick: t[3] ||= (e) => Bt(1)
|
|
808
803
|
}, " › ", 8, De)) : o("", !0)
|
|
809
804
|
])) : o("", !0)
|
|
810
805
|
], 64)) : o("", !0)]));
|
|
811
806
|
}
|
|
812
807
|
});
|
|
813
808
|
//#endregion
|
|
814
|
-
export {
|
|
809
|
+
export { S as default };
|