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