ooxml-excel-editor 1.3.2 → 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 +25 -3
- package/dist/chunks/{index-Cu1G47bB.js → index-6q8kSGQg.js} +84 -84
- package/dist/chunks/{index.es-aesXm4JC.js → index.es-D9BGYyEt.js} +1 -1
- package/dist/chunks/{jspdf.es.min-DMfUtFJC.js → jspdf.es.min-Dbn0akWf.js} +2 -2
- package/dist/vue2.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,11 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
本项目遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/) 与 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
-
## [1.3.
|
|
5
|
+
## [1.3.3] - 2026-06-09
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**Vue 2.6 真实兼容修复合集** — 1.3.2 上线后消费方 Vue 2.6.12 + vue-cli 4 (webpack 4) 项目验证暴露两个 Vue 2.6 特有 bug (函数 ref 不支持 / `ctx.expose` shim 语义不同), 1.3.3 一并修掉. **现在 Vue 2.6 / 2.7 / Vue 3 三个版本都真正可用**.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
> 1.3.2 已发布到 npm, 但 Vue 2.6 仍不可用 — 1.3.3 是必须升的真兼容补丁.
|
|
10
|
+
|
|
11
|
+
### 修复
|
|
12
|
+
|
|
13
|
+
#### Vue 2.6 上 `$refs.viewer.*` 命令式 API 全拿不到
|
|
14
|
+
|
|
15
|
+
**根因**: 之前用 `expose?.(viewerApi)` 暴露 60+ 命令式方法 (load / getSelection / setStyle / downloadXlsx / beginEdit / commitActiveCellValue / undo / ...). Vue 3 / Vue 2.7 原生 expose 走标准路径 OK, **但 Vue 2.6 + @vue/composition-api 1.7.x shim 下 `ctx.expose` 的语义是"暴露 setup 返回值的指定 key"** —— 本组件 setup 返回的是 render function (没有可暴露的 key), shim 下 expose() 是 no-op. 消费方 `this.$refs.viewer.downloadXlsx(...)` 全部 `undefined is not a function`.
|
|
16
|
+
|
|
17
|
+
**修复** ([src/vue2/ExcelViewer.ts](src/vue2/ExcelViewer.ts)): 在 Vue 2 下用 `Object.assign(vm, viewerApi)` 直接挂到 Vue 2 instance proxy (Vue 2 instance 是普通对象, 可 assign). Vue 3 仍走 `expose()`. 通过 `vm._isVue` 检测 Vue 2 (Vue 3 instance proxy 没这个 flag):
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
expose?.(viewerApi)
|
|
21
|
+
if (vm && (vm as any)._isVue) {
|
|
22
|
+
Object.assign(vm, viewerApi)
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**验证 (Vue 2.6.12 + composition-api 1.7.2 真实环境)**:
|
|
27
|
+
- `$refs.viewer.{getWorkbook, getActiveSheet, getSelection, setSelection, getCellText, getSheetJSON, beginEdit, commitActiveCellValue, isCellEditable, downloadXlsx, downloadJson, undo, canUndo}` 13 个核心方法 `typeof === 'function'` ✓
|
|
28
|
+
- `getWorkbook()` 真返工作簿 (3 sheets, 销售报表) ✓
|
|
29
|
+
- 编辑流: `beginEdit(0,0) → isEditing=true → commitActiveCellValue('VUE26_OK', 'down')` → 单元格值变 "VUE26_OK" ✓
|
|
30
|
+
- `undo()` → 恢复 "2026 年度销售汇总" ✓
|
|
31
|
+
- 0 控制台错误 ✓
|
|
10
32
|
|
|
11
33
|
#### Vue 2.6 上 renderArea / fb / templateInput 三个 DOM 全拿不到 → canvas 不挂
|
|
12
34
|
|
|
@@ -837,7 +837,7 @@ var rl = function(n) {
|
|
|
837
837
|
r ? r == 3 ? (o = ((o & 15) << 18 | (n[t++] & 63) << 12 | (n[t++] & 63) << 6 | n[t++] & 63) - 65536, e += String.fromCharCode(55296 | o >> 10, 56320 | o & 1023)) : r & 1 ? e += String.fromCharCode((o & 31) << 6 | n[t++] & 63) : e += String.fromCharCode((o & 15) << 12 | (n[t++] & 63) << 6 | n[t++] & 63) : e += String.fromCharCode(o);
|
|
838
838
|
}
|
|
839
839
|
};
|
|
840
|
-
function
|
|
840
|
+
function at(n, e) {
|
|
841
841
|
var t;
|
|
842
842
|
if (jo)
|
|
843
843
|
return jo.encode(n);
|
|
@@ -911,7 +911,7 @@ function cl(n, e) {
|
|
|
911
911
|
ui(n, "", t, e);
|
|
912
912
|
var r = 0, i = 0;
|
|
913
913
|
for (var l in t) {
|
|
914
|
-
var s = t[l], a = s[0], f = s[1], c = f.level == 0 ? 0 : 8, h =
|
|
914
|
+
var s = t[l], a = s[0], f = s[1], c = f.level == 0 ? 0 : 8, h = at(l), u = h.length, g = f.comment, v = g && at(g), w = v && v.length, b = no(f.extra);
|
|
915
915
|
u > 65535 && he(11);
|
|
916
916
|
var m = c ? tl(a, f) : a, y = m.length, C = Qs();
|
|
917
917
|
C.p(a), o.push(hi(f, {
|
|
@@ -2668,7 +2668,7 @@ const fr = {
|
|
|
2668
2668
|
// A4 210x297
|
|
2669
2669
|
70: "a4"
|
|
2670
2670
|
// ISO A4 (部分写法)
|
|
2671
|
-
},
|
|
2671
|
+
}, rt = 25.4;
|
|
2672
2672
|
function zl(n) {
|
|
2673
2673
|
var l, s, a, f, c, h;
|
|
2674
2674
|
const e = n.pageSetup;
|
|
@@ -2677,12 +2677,12 @@ function zl(n) {
|
|
|
2677
2677
|
(e.orientation === "portrait" || e.orientation === "landscape") && (t.orientation = e.orientation), typeof e.paperSize == "number" && fr[e.paperSize] && (t.paperFormat = fr[e.paperSize]), typeof e.scale == "number" && e.scale > 0 && (t.scale = e.scale), e.fitToPage && (t.fitToPage = !0), typeof e.fitToWidth == "number" && (t.fitToWidth = e.fitToWidth), typeof e.fitToHeight == "number" && (t.fitToHeight = e.fitToHeight);
|
|
2678
2678
|
const o = e.margins;
|
|
2679
2679
|
if (o && typeof o == "object" && (t.margins = {
|
|
2680
|
-
top: ((l = o.top) != null ? l : 0.75) *
|
|
2681
|
-
bottom: ((s = o.bottom) != null ? s : 0.75) *
|
|
2682
|
-
left: ((a = o.left) != null ? a : 0.7) *
|
|
2683
|
-
right: ((f = o.right) != null ? f : 0.7) *
|
|
2684
|
-
header: ((c = o.header) != null ? c : 0.3) *
|
|
2685
|
-
footer: ((h = o.footer) != null ? h : 0.3) *
|
|
2680
|
+
top: ((l = o.top) != null ? l : 0.75) * rt,
|
|
2681
|
+
bottom: ((s = o.bottom) != null ? s : 0.75) * rt,
|
|
2682
|
+
left: ((a = o.left) != null ? a : 0.7) * rt,
|
|
2683
|
+
right: ((f = o.right) != null ? f : 0.7) * rt,
|
|
2684
|
+
header: ((c = o.header) != null ? c : 0.3) * rt,
|
|
2685
|
+
footer: ((h = o.footer) != null ? h : 0.3) * rt
|
|
2686
2686
|
}), typeof e.printArea == "string" && e.printArea.trim()) {
|
|
2687
2687
|
const u = e.printArea.split(",")[0], g = Ke(uo(u));
|
|
2688
2688
|
g && (t.printArea = g);
|
|
@@ -3529,7 +3529,7 @@ function Fa(n) {
|
|
|
3529
3529
|
};
|
|
3530
3530
|
}
|
|
3531
3531
|
function Ia(n) {
|
|
3532
|
-
const e =
|
|
3532
|
+
const e = ft(n);
|
|
3533
3533
|
return /(\[?[hms]+\]?|y+|d+|am\/pm|a\/p)/i.test(e) && !/E[+-]/.test(e);
|
|
3534
3534
|
}
|
|
3535
3535
|
function Ra(n, e) {
|
|
@@ -3564,7 +3564,7 @@ function Na(n, e) {
|
|
|
3564
3564
|
const o = Ua(n, "%");
|
|
3565
3565
|
o > 0 && (t *= Math.pow(100, o));
|
|
3566
3566
|
const r = Va(n);
|
|
3567
|
-
return r > 0 && (t /= Math.pow(1e3, r)), /[eE][+-]?0+/.test(
|
|
3567
|
+
return r > 0 && (t /= Math.pow(1e3, r)), /[eE][+-]?0+/.test(ft(n)) ? za(n, t) : /[#0]*\s*[?#]+\/[?#0]+/.test(ft(n)) ? Oa(n, t) : Pa(n, t);
|
|
3568
3568
|
}
|
|
3569
3569
|
function Pa(n, e) {
|
|
3570
3570
|
var w;
|
|
@@ -3615,7 +3615,7 @@ function Ha(n, e) {
|
|
|
3615
3615
|
return r || (o += e), o;
|
|
3616
3616
|
}
|
|
3617
3617
|
function za(n, e) {
|
|
3618
|
-
const t = /([0#.,]+)[eE]([+-]?)(0+)/.exec(
|
|
3618
|
+
const t = /([0#.,]+)[eE]([+-]?)(0+)/.exec(ft(n)), o = t ? ((t[1].split(".")[1] || "").match(/[0#]/g) || []).length : 2, r = t ? t[2] : "+";
|
|
3619
3619
|
let i = e.toExponential(o);
|
|
3620
3620
|
return i = i.replace("e", "E"), r === "+" && (i = i.replace("E", "E+").replace("E+-", "E-").replace("E++", "E+")), i.replace(/E([+-])(\d+)/, (l, s, a) => `E${s}${a.padStart(t ? t[3].length : 2, "0")}`);
|
|
3621
3621
|
}
|
|
@@ -3783,11 +3783,11 @@ function Er(n) {
|
|
|
3783
3783
|
}
|
|
3784
3784
|
return n instanceof Date ? n.toISOString() : String(n);
|
|
3785
3785
|
}
|
|
3786
|
-
function
|
|
3786
|
+
function ft(n) {
|
|
3787
3787
|
return n.replace(/"[^"]*"/g, "").replace(/\\./g, "");
|
|
3788
3788
|
}
|
|
3789
3789
|
function _a(n) {
|
|
3790
|
-
return
|
|
3790
|
+
return ft(n).replace(/\[[^\]]*\]/g, "");
|
|
3791
3791
|
}
|
|
3792
3792
|
function po(n) {
|
|
3793
3793
|
let e = "";
|
|
@@ -3816,7 +3816,7 @@ function po(n) {
|
|
|
3816
3816
|
return e;
|
|
3817
3817
|
}
|
|
3818
3818
|
function Ua(n, e) {
|
|
3819
|
-
return (
|
|
3819
|
+
return (ft(n).match(new RegExp("\\" + e, "g")) || []).length;
|
|
3820
3820
|
}
|
|
3821
3821
|
function Va(n) {
|
|
3822
3822
|
const e = po(n), t = /[0#?](,+)$/.exec(e);
|
|
@@ -4122,7 +4122,7 @@ function me(n, e) {
|
|
|
4122
4122
|
l = o((a = e.extWidthEmu) != null ? a : 0) || 120 * t, s = o((f = e.extHeightEmu) != null ? f : 0) || 90 * t;
|
|
4123
4123
|
return { left: r, top: i, width: l, height: s };
|
|
4124
4124
|
}
|
|
4125
|
-
function
|
|
4125
|
+
function it(n) {
|
|
4126
4126
|
if (typeof n == "number") return [n];
|
|
4127
4127
|
if (Array.isArray(n)) return n.slice();
|
|
4128
4128
|
const e = Math.min(n.from, n.to), t = Math.max(n.from, n.to), o = [];
|
|
@@ -5421,7 +5421,7 @@ function Hc(n, e = "png", t = 0.92) {
|
|
|
5421
5421
|
);
|
|
5422
5422
|
});
|
|
5423
5423
|
}
|
|
5424
|
-
function
|
|
5424
|
+
function lt(n, e) {
|
|
5425
5425
|
const t = URL.createObjectURL(n), o = document.createElement("a");
|
|
5426
5426
|
o.href = t, o.download = e, document.body.appendChild(o), o.click(), o.remove(), setTimeout(() => URL.revokeObjectURL(t), 4e3);
|
|
5427
5427
|
}
|
|
@@ -5482,7 +5482,7 @@ class zc {
|
|
|
5482
5482
|
var t;
|
|
5483
5483
|
try {
|
|
5484
5484
|
const o = await (await fetch(e.src)).blob(), r = (((t = e.mime) == null ? void 0 : t.split("/")[1]) || "png").replace("jpeg", "jpg").replace("svg+xml", "svg");
|
|
5485
|
-
|
|
5485
|
+
lt(o, e.fileName || `image.${r}`);
|
|
5486
5486
|
} catch (o) {
|
|
5487
5487
|
}
|
|
5488
5488
|
}
|
|
@@ -5498,7 +5498,7 @@ function Lr(n) {
|
|
|
5498
5498
|
const e = document.createElement("button");
|
|
5499
5499
|
return e.textContent = n, e.style.cssText = "padding:6px 12px;border:none;border-radius:6px;background:rgba(255,255,255,.92);color:#1f2329;font:13px/1.4 -apple-system,'Segoe UI',sans-serif;cursor:pointer;", e;
|
|
5500
5500
|
}
|
|
5501
|
-
const
|
|
5501
|
+
const ct = 1.18, Pe = 3;
|
|
5502
5502
|
function ke(n, e = 1) {
|
|
5503
5503
|
const t = n.italic ? "italic " : "", o = n.bold ? "bold " : "", r = Math.max(1, n.size * e * (96 / 72));
|
|
5504
5504
|
return `${t}${o}${r.toFixed(1)}px ${Oc(n.name)}, sans-serif`;
|
|
@@ -5549,7 +5549,7 @@ const Bc = (n) => {
|
|
|
5549
5549
|
const e = n.snapshot.style, t = e == null ? void 0 : e.fill, o = t && t.type !== "none" && (h = (c = t.fgColor) != null ? c : t.bgColor) != null ? h : "#fff", r = document.createElement("textarea");
|
|
5550
5550
|
r.className = "ooxml-cell-editor", r.value = (u = n.initialText) != null ? u : n.snapshot.text, r.rows = 1, r.style.cssText = "box-sizing:border-box;border:2px solid #21a366;outline:none;padding:0 3px;margin:0;font-family:sans-serif;resize:none;overflow:auto;white-space:pre-wrap;word-break:break-word;", r.style.background = o;
|
|
5551
5551
|
const i = (g = e == null ? void 0 : e.font) != null && g.size ? e.font.size * Wc : 14;
|
|
5552
|
-
r.style.fontSize = i + "px", r.style.lineHeight =
|
|
5552
|
+
r.style.fontSize = i + "px", r.style.lineHeight = ct.toString(), (v = e == null ? void 0 : e.font) != null && v.bold && (r.style.fontWeight = "bold"), (w = e == null ? void 0 : e.font) != null && w.italic && (r.style.fontStyle = "italic"), (b = e == null ? void 0 : e.font) != null && b.color && (r.style.color = e.font.color), r.style.textAlign = (e == null ? void 0 : e.hAlign) === "center" ? "center" : (e == null ? void 0 : e.hAlign) === "right" ? "right" : "left";
|
|
5553
5553
|
let l = !1;
|
|
5554
5554
|
const s = (m) => {
|
|
5555
5555
|
l || (l = !0, n.commit(r.value, m));
|
|
@@ -5565,7 +5565,7 @@ const Bc = (n) => {
|
|
|
5565
5565
|
function f(m) {
|
|
5566
5566
|
const y = $c();
|
|
5567
5567
|
if (!y || m <= 0) return 0;
|
|
5568
|
-
const C = e != null && e.font ? ke(e.font, 1) : `${i.toFixed(1)}px sans-serif`, k = Math.max(10, m - 2 * Pe - 4), I = Qt(y, r.value || " ", C, k), F = i *
|
|
5568
|
+
const C = e != null && e.font ? ke(e.font, 1) : `${i.toFixed(1)}px sans-serif`, k = Math.max(10, m - 2 * Pe - 4), I = Qt(y, r.value || " ", C, k), F = i * ct;
|
|
5569
5569
|
return Math.ceil(I.length * F + 4 + 2);
|
|
5570
5570
|
}
|
|
5571
5571
|
return setTimeout(() => {
|
|
@@ -5832,7 +5832,7 @@ function Gc(n, e, t, o, r) {
|
|
|
5832
5832
|
`).length;
|
|
5833
5833
|
}
|
|
5834
5834
|
if (l < 2) return 0;
|
|
5835
|
-
const s = t.font.size * on *
|
|
5835
|
+
const s = t.font.size * on * ct;
|
|
5836
5836
|
return (l - 1) * s;
|
|
5837
5837
|
}
|
|
5838
5838
|
function qc() {
|
|
@@ -6011,7 +6011,7 @@ class Oi {
|
|
|
6011
6011
|
if (l.row !== e || l.type === "empty" || this.merges.rangeOf(e, l.col)) continue;
|
|
6012
6012
|
const s = this.styleOf(l), a = this.cellText(e, l.col);
|
|
6013
6013
|
if (!a) continue;
|
|
6014
|
-
const f = s.font.size * (96 / 72) *
|
|
6014
|
+
const f = s.font.size * (96 / 72) * ct;
|
|
6015
6015
|
let c = 1;
|
|
6016
6016
|
if (s.wrapText) {
|
|
6017
6017
|
const u = this.metrics.zoom, g = this.metrics.colWidth(l.col) / u - Pe * 2;
|
|
@@ -6361,7 +6361,7 @@ class Oi {
|
|
|
6361
6361
|
} else
|
|
6362
6362
|
E = [w];
|
|
6363
6363
|
h.font = R;
|
|
6364
|
-
const S = t.font.size * f * (96 / 72) *
|
|
6364
|
+
const S = t.font.size * f * (96 / 72) * ct, M = S * E.length, A = a - 2 * u, N = M > A;
|
|
6365
6365
|
let z;
|
|
6366
6366
|
t.vAlign === "top" || N ? z = l + u + S * 0.78 : t.vAlign === "middle" ? z = l + (a - M) / 2 + S * 0.78 : z = l + a - u - M + S * 0.78, h.textAlign = "left", h.textBaseline = "alphabetic";
|
|
6367
6367
|
const X = t.indent * 8 * f;
|
|
@@ -6420,7 +6420,7 @@ class Oi {
|
|
|
6420
6420
|
const v = Xn(t.hAlign, !1);
|
|
6421
6421
|
let w = o + f;
|
|
6422
6422
|
v === "center" ? w = o + (i - u) / 2 : v === "right" && (w = o + i - f - u);
|
|
6423
|
-
const b = h.size * s * (96 / 72) * 0.72, m = h.size * s * (96 / 72) *
|
|
6423
|
+
const b = h.size * s * (96 / 72) * 0.72, m = h.size * s * (96 / 72) * ct;
|
|
6424
6424
|
let y;
|
|
6425
6425
|
t.vAlign === "top" ? y = r + f + b : t.vAlign === "middle" ? y = r + (l - m) / 2 + b : y = r + l - f - m + b, a.save(), a.beginPath(), a.rect(o, r, i, l), a.clip(), a.textBaseline = "alphabetic", a.textAlign = "left";
|
|
6426
6426
|
for (let k = 0; k < c.length && (a.font = g[k], a.fillStyle = ((C = c[k].font) == null ? void 0 : C.color) || h.color, a.fillText(c[k].text, w, y), w += a.measureText(c[k].text).width, !(w > o + i + 50)); k++)
|
|
@@ -6835,7 +6835,7 @@ async function af() {
|
|
|
6835
6835
|
try {
|
|
6836
6836
|
const e = await import(
|
|
6837
6837
|
/* @vite-ignore */
|
|
6838
|
-
"./jspdf.es.min-
|
|
6838
|
+
"./jspdf.es.min-Dbn0akWf.js"
|
|
6839
6839
|
).then((t) => t.j);
|
|
6840
6840
|
return e.jsPDF || ((n = e.default) == null ? void 0 : n.jsPDF) || e.default || e;
|
|
6841
6841
|
} catch (e) {
|
|
@@ -6891,7 +6891,7 @@ async function ff() {
|
|
|
6891
6891
|
try {
|
|
6892
6892
|
const e = await import(
|
|
6893
6893
|
/* @vite-ignore */
|
|
6894
|
-
"./jspdf.es.min-
|
|
6894
|
+
"./jspdf.es.min-Dbn0akWf.js"
|
|
6895
6895
|
).then((t) => t.j);
|
|
6896
6896
|
return e.jsPDF || ((n = e.default) == null ? void 0 : n.jsPDF) || e.default || e;
|
|
6897
6897
|
} catch (e) {
|
|
@@ -7029,7 +7029,7 @@ function vf(n, e, t, o, r, i, l, s, a) {
|
|
|
7029
7029
|
n.setFillColor(S, M, A), n.rect(t + l, o + l, R, i - 2 * l, "F");
|
|
7030
7030
|
}
|
|
7031
7031
|
}
|
|
7032
|
-
|
|
7032
|
+
st(n, f.borders.top, t, o, t + r, o), st(n, f.borders.bottom, t, o + i, t + r, o + i), st(n, f.borders.left, t, o, t, o + i), st(n, f.borders.right, t + r, o, t + r, o + i), f.borders.diagonal && (f.borders.diagonalDown || f.borders.diagonalUp) && (f.borders.diagonalDown && st(n, f.borders.diagonal, t, o, t + r, o + i), f.borders.diagonalUp && st(n, f.borders.diagonal, t, o + i, t + r, o));
|
|
7033
7033
|
let h = 0;
|
|
7034
7034
|
c != null && c.icon && (bf(n, c.icon, t + 1.5 * l, o + i / 2, Math.min(i * 0.32, 2.2 * l)), h = 5 * l);
|
|
7035
7035
|
const u = e.text;
|
|
@@ -7079,7 +7079,7 @@ function bf(n, e, t, o, r) {
|
|
|
7079
7079
|
let a;
|
|
7080
7080
|
i.includes("TrafficLights") || i.includes("Signs") || i.includes("Symbols") ? a = l[Math.min(e.level, 2)] : a = [Math.round(214 - 123 * s), Math.round(59 + 100 * s), 59], n.setFillColor(a[0], a[1], a[2]), n.circle(t, o, r, "F");
|
|
7081
7081
|
}
|
|
7082
|
-
function
|
|
7082
|
+
function st(n, e, t, o, r, i) {
|
|
7083
7083
|
var f;
|
|
7084
7084
|
if (!e || !e.style || e.style === "none") return;
|
|
7085
7085
|
const [l, s, a] = St(e.color || "#000000");
|
|
@@ -7220,14 +7220,14 @@ function zf(n, e) {
|
|
|
7220
7220
|
}), Ct(
|
|
7221
7221
|
r,
|
|
7222
7222
|
"xl/cellimages.xml",
|
|
7223
|
-
|
|
7223
|
+
at(
|
|
7224
7224
|
`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
7225
7225
|
<etc:cellImages xmlns:etc="http://www.wps.cn/officeDocument/2017/etCustomData" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">` + l.join("") + "</etc:cellImages>"
|
|
7226
7226
|
)
|
|
7227
7227
|
), Ct(
|
|
7228
7228
|
r,
|
|
7229
7229
|
"xl/_rels/cellimages.xml.rels",
|
|
7230
|
-
|
|
7230
|
+
at(
|
|
7231
7231
|
`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
7232
7232
|
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">` + i.join("") + "</Relationships>"
|
|
7233
7233
|
)
|
|
@@ -7240,7 +7240,7 @@ function zf(n, e) {
|
|
|
7240
7240
|
let h = "";
|
|
7241
7241
|
for (const [u, g] of c)
|
|
7242
7242
|
new RegExp(`Extension="${u}"`, "i").test(f) || (h += `<Default Extension="${u}" ContentType="${g}"/>`);
|
|
7243
|
-
f.includes("/xl/cellimages.xml") || (h += `<Override PartName="/xl/cellimages.xml" ContentType="${Rf}"/>`), h && (f = f.replace("</Types>", h + "</Types>")), Ct(r, s,
|
|
7243
|
+
f.includes("/xl/cellimages.xml") || (h += `<Override PartName="/xl/cellimages.xml" ContentType="${Rf}"/>`), h && (f = f.replace("</Types>", h + "</Types>")), Ct(r, s, at(f));
|
|
7244
7244
|
}
|
|
7245
7245
|
const a = "xl/_rels/workbook.xml.rels";
|
|
7246
7246
|
if (r[a]) {
|
|
@@ -7252,7 +7252,7 @@ function zf(n, e) {
|
|
|
7252
7252
|
f = f.replace(
|
|
7253
7253
|
"</Relationships>",
|
|
7254
7254
|
`<Relationship Id="${h}" Type="${Af}" Target="cellimages.xml"/></Relationships>`
|
|
7255
|
-
), Ct(r, a,
|
|
7255
|
+
), Ct(r, a, at(f));
|
|
7256
7256
|
}
|
|
7257
7257
|
}
|
|
7258
7258
|
return cl(r);
|
|
@@ -7633,7 +7633,7 @@ class Df {
|
|
|
7633
7633
|
async downloadImage(e = {}) {
|
|
7634
7634
|
var r;
|
|
7635
7635
|
const t = await this.exportImage(e), o = e.type === "jpeg" ? "jpg" : e.type === "webp" ? "webp" : "png";
|
|
7636
|
-
|
|
7636
|
+
lt(t, (r = e.fileName) != null ? r : `${this.baseName()}.${o}`);
|
|
7637
7637
|
}
|
|
7638
7638
|
/** 导出为 PDF Blob(每个目标表分页;需可选依赖 jspdf)。未显式指定的页面参数取自工作表 pageSetup。
|
|
7639
7639
|
* 支持 `onProgress` 分阶段(render/compose/paginate/write)报进度 + `signal` 取消(标准 AbortSignal)。 */
|
|
@@ -7667,7 +7667,7 @@ class Df {
|
|
|
7667
7667
|
async downloadPdf(e = {}) {
|
|
7668
7668
|
var o;
|
|
7669
7669
|
const t = await this.exportPdf(e);
|
|
7670
|
-
|
|
7670
|
+
lt(t, (o = e.fileName) != null ? o : `${this.baseName()}.pdf`);
|
|
7671
7671
|
}
|
|
7672
7672
|
/** 打开系统打印(可在对话框另存为 PDF)。页面参数同样默认取自 pageSetup。 */
|
|
7673
7673
|
async print(e = {}) {
|
|
@@ -7691,7 +7691,7 @@ class Df {
|
|
|
7691
7691
|
return If(t, e);
|
|
7692
7692
|
}
|
|
7693
7693
|
downloadJson(e) {
|
|
7694
|
-
|
|
7694
|
+
lt(new Blob([this.exportJson(e)], { type: "application/json" }), `${this.baseName()}.json`);
|
|
7695
7695
|
}
|
|
7696
7696
|
/** 一张表 → CSV 文本(默认活动表、格式化显示值)。 */
|
|
7697
7697
|
exportCsv(e = {}) {
|
|
@@ -7702,7 +7702,7 @@ class Df {
|
|
|
7702
7702
|
return Ff(o, { format: e.format, date1904: t.date1904 });
|
|
7703
7703
|
}
|
|
7704
7704
|
downloadCsv(e = {}) {
|
|
7705
|
-
|
|
7705
|
+
lt(new Blob(["\uFEFF" + this.exportCsv(e)], { type: "text/csv;charset=utf-8" }), `${this.baseName()}.csv`);
|
|
7706
7706
|
}
|
|
7707
7707
|
/** 整簿 → .xlsx Blob(默认从模型重建;`fidelity:'overlay'` 重载原件叠加编辑,保真更高)。 */
|
|
7708
7708
|
exportXlsx(e) {
|
|
@@ -7717,7 +7717,7 @@ class Df {
|
|
|
7717
7717
|
return Bf(t, o);
|
|
7718
7718
|
}
|
|
7719
7719
|
async downloadXlsx(e) {
|
|
7720
|
-
|
|
7720
|
+
lt(await this.exportXlsx(e), `${this.baseName()}.xlsx`);
|
|
7721
7721
|
}
|
|
7722
7722
|
}
|
|
7723
7723
|
const qr = "(空白)";
|
|
@@ -7907,14 +7907,14 @@ class _f {
|
|
|
7907
7907
|
setColumnWidth(e, t) {
|
|
7908
7908
|
const o = this.sheet;
|
|
7909
7909
|
if (!o) return 0;
|
|
7910
|
-
const r =
|
|
7910
|
+
const r = it(e);
|
|
7911
7911
|
return this.edit.setDimensions("col", r, t, (i) => Le(o, "col", i, this.editCfg));
|
|
7912
7912
|
}
|
|
7913
7913
|
/** 程序化设行高 (px, 模型单位/非缩放). 同 setColumnWidth, 维度 = 'row'. */
|
|
7914
7914
|
setRowHeight(e, t) {
|
|
7915
7915
|
const o = this.sheet;
|
|
7916
7916
|
if (!o) return 0;
|
|
7917
|
-
const r =
|
|
7917
|
+
const r = it(e);
|
|
7918
7918
|
return this.edit.setDimensions("row", r, t, (i) => Le(o, "row", i, this.editCfg));
|
|
7919
7919
|
}
|
|
7920
7920
|
/**
|
|
@@ -7925,7 +7925,7 @@ class _f {
|
|
|
7925
7925
|
autoFitColumns(e) {
|
|
7926
7926
|
const t = this.sheet, o = this.renderer;
|
|
7927
7927
|
if (!t || !o) return 0;
|
|
7928
|
-
const r = e === void 0 ? Array.from({ length: t.dimension.cols }, (c, h) => h) :
|
|
7928
|
+
const r = e === void 0 ? Array.from({ length: t.dimension.cols }, (c, h) => h) : it(e), i = r.filter((c) => c >= 0 && Le(t, "col", c, this.editCfg)), l = r.filter((c) => c >= 0 && !Le(t, "col", c, this.editCfg));
|
|
7929
7929
|
if (l.length && this.hooks.onEditEvent("permission-denied", { reason: "dimension", cells: [], dims: { axis: "col", indices: l }, message: `${l.length} 列未覆盖白名单,autoFit 跳过` }), !i.length) return 0;
|
|
7930
7930
|
if (i.length === 1)
|
|
7931
7931
|
return this.autoFitColumn(i[0]), 1;
|
|
@@ -7942,7 +7942,7 @@ class _f {
|
|
|
7942
7942
|
autoFitRows(e) {
|
|
7943
7943
|
const t = this.sheet, o = this.renderer;
|
|
7944
7944
|
if (!t || !o) return 0;
|
|
7945
|
-
const r = e === void 0 ? Array.from({ length: t.dimension.rows }, (c, h) => h) :
|
|
7945
|
+
const r = e === void 0 ? Array.from({ length: t.dimension.rows }, (c, h) => h) : it(e), i = r.filter((c) => c >= 0 && Le(t, "row", c, this.editCfg)), l = r.filter((c) => c >= 0 && !Le(t, "row", c, this.editCfg));
|
|
7946
7946
|
if (l.length && this.hooks.onEditEvent("permission-denied", { reason: "dimension", cells: [], dims: { axis: "row", indices: l }, message: `${l.length} 行未覆盖白名单,autoFit 跳过` }), !i.length) return 0;
|
|
7947
7947
|
if (i.length === 1)
|
|
7948
7948
|
return this.autoFitRow(i[0]), 1;
|
|
@@ -7962,14 +7962,14 @@ class _f {
|
|
|
7962
7962
|
resetColumnWidth(e) {
|
|
7963
7963
|
const t = this.sheet;
|
|
7964
7964
|
if (!t) return 0;
|
|
7965
|
-
const o =
|
|
7965
|
+
const o = it(e);
|
|
7966
7966
|
return this.edit.resetDimensions("col", o, (r) => Le(t, "col", r, this.editCfg));
|
|
7967
7967
|
}
|
|
7968
7968
|
/** 重置行高到默认. 同 resetColumnWidth, 维度 = 'row'. */
|
|
7969
7969
|
resetRowHeight(e) {
|
|
7970
7970
|
const t = this.sheet;
|
|
7971
7971
|
if (!t) return 0;
|
|
7972
|
-
const o =
|
|
7972
|
+
const o = it(e);
|
|
7973
7973
|
return this.edit.resetDimensions("row", o, (r) => Le(t, "row", r, this.editCfg));
|
|
7974
7974
|
}
|
|
7975
7975
|
/** 公式引擎是否已就绪(recalc 开启 + 异步 warm 完成);未开重算恒 false。 */
|
|
@@ -9441,7 +9441,7 @@ const Kf = Es({
|
|
|
9441
9441
|
}
|
|
9442
9442
|
}
|
|
9443
9443
|
const To = re(() => !!n.editor || ge.value.some((d) => d.editor)), P = Ts(null);
|
|
9444
|
-
let
|
|
9444
|
+
let ht = null, tt = null;
|
|
9445
9445
|
const It = /* @__PURE__ */ new Map();
|
|
9446
9446
|
let Rt = [];
|
|
9447
9447
|
function we(d, p) {
|
|
@@ -9487,7 +9487,7 @@ const Kf = Es({
|
|
|
9487
9487
|
const d = (T, H) => {
|
|
9488
9488
|
let B = It.get(T);
|
|
9489
9489
|
B || It.set(T, B = /* @__PURE__ */ new Set()), B.add(H);
|
|
9490
|
-
}, p = { viewer:
|
|
9490
|
+
}, p = { viewer: nt, on: d, redraw: () => {
|
|
9491
9491
|
var T;
|
|
9492
9492
|
return (T = P.value) == null ? void 0 : T.render();
|
|
9493
9493
|
} };
|
|
@@ -9593,10 +9593,10 @@ const Kf = Es({
|
|
|
9593
9593
|
onContextMenuShow: (H) => we("context-menu", H)
|
|
9594
9594
|
}
|
|
9595
9595
|
);
|
|
9596
|
-
T.fileName = n.fileName, T.setEditConfig(So.value), T.setEditorResolver(To.value ? ko : void 0), T.setLightboxEnabled(n.imageLightbox !== !1), T.setContextMenuTransform(typeof n.contextMenu == "function" ? n.contextMenu : null), P.value = T, tt = new As(m), Fo(), Mo(),
|
|
9596
|
+
T.fileName = n.fileName, T.setEditConfig(So.value), T.setEditorResolver(To.value ? ko : void 0), T.setLightboxEnabled(n.imageLightbox !== !1), T.setContextMenuTransform(typeof n.contextMenu == "function" ? n.contextMenu : null), P.value = T, tt = new As(m), Fo(), Mo(), ht = new ResizeObserver(() => {
|
|
9597
9597
|
var H, B;
|
|
9598
9598
|
(H = P.value) == null || H.measure(), (B = P.value) == null || B.render();
|
|
9599
|
-
}),
|
|
9599
|
+
}), ht.observe(d), typeof document != "undefined" && document.addEventListener("click", G);
|
|
9600
9600
|
});
|
|
9601
9601
|
}), ae(() => [n.src, n.workbook, n.templateFile, J.value], () => {
|
|
9602
9602
|
P.value && Mo();
|
|
@@ -9637,7 +9637,7 @@ const Kf = Es({
|
|
|
9637
9637
|
d && we("progress", d);
|
|
9638
9638
|
}), ae(A, () => Vi()), Fs(() => {
|
|
9639
9639
|
var d;
|
|
9640
|
-
|
|
9640
|
+
ht == null || ht.disconnect(), (d = P.value) == null || d.dispose(), tt == null || tt.dispose(), Rt.forEach((p) => p()), k.value && Jn(k.value), typeof document != "undefined" && document.removeEventListener("click", G);
|
|
9641
9641
|
});
|
|
9642
9642
|
const Ve = re(() => {
|
|
9643
9643
|
var d, p;
|
|
@@ -9659,7 +9659,7 @@ const Kf = Es({
|
|
|
9659
9659
|
function At(d) {
|
|
9660
9660
|
return isFinite(d) ? d.toLocaleString("en-US", { maximumFractionDigits: 2 }) : "—";
|
|
9661
9661
|
}
|
|
9662
|
-
const Ae = te(""),
|
|
9662
|
+
const Ae = te(""), ut = te(!1), Xi = re(() => {
|
|
9663
9663
|
var d;
|
|
9664
9664
|
return N.value, !!((d = P.value) != null && d.canEditActiveCell());
|
|
9665
9665
|
}), Nt = re(() => {
|
|
@@ -9672,38 +9672,38 @@ const Kf = Es({
|
|
|
9672
9672
|
return !d || !p ? "" : (H = d.cellFormula(p.row, p.col)) != null ? H : d.cellText(p.row, p.col);
|
|
9673
9673
|
});
|
|
9674
9674
|
ae(Nt, (d) => {
|
|
9675
|
-
|
|
9675
|
+
ut.value || (Ae.value = d);
|
|
9676
9676
|
}, { immediate: !0 }), ae(Ae, () => vt(cn));
|
|
9677
9677
|
function cn() {
|
|
9678
9678
|
const d = s.value;
|
|
9679
9679
|
d && (d.style.height = "auto", d.style.height = d.scrollHeight + "px");
|
|
9680
9680
|
}
|
|
9681
9681
|
function Yi() {
|
|
9682
|
-
|
|
9682
|
+
ut.value = !0, Ae.value = Nt.value, vt(cn);
|
|
9683
9683
|
}
|
|
9684
9684
|
function Ao(d) {
|
|
9685
9685
|
var p;
|
|
9686
|
-
(p = P.value) == null || p.commitActiveCellValue(Ae.value, d),
|
|
9686
|
+
(p = P.value) == null || p.commitActiveCellValue(Ae.value, d), ut.value = !1, Ae.value = Nt.value, d === "down" && (c == null || c.focus());
|
|
9687
9687
|
}
|
|
9688
9688
|
function Gi() {
|
|
9689
|
-
|
|
9689
|
+
ut.value = !1, Ae.value = Nt.value, c == null || c.focus();
|
|
9690
9690
|
}
|
|
9691
9691
|
function qi() {
|
|
9692
|
-
|
|
9692
|
+
ut.value && Ao();
|
|
9693
9693
|
}
|
|
9694
9694
|
function Ji(d) {
|
|
9695
9695
|
d.stopPropagation(), d.key === "Enter" && !d.shiftKey ? (d.preventDefault(), Ao("down")) : d.key === "Escape" && (d.preventDefault(), Gi());
|
|
9696
9696
|
}
|
|
9697
|
-
const
|
|
9697
|
+
const dt = te(!1), Ki = re(() => {
|
|
9698
9698
|
var d, p;
|
|
9699
9699
|
return z.value, (p = (d = P.value) == null ? void 0 : d.getFindState()) != null ? p : { query: "", matchCase: !1, wholeCell: !1, count: 0, index: -1 };
|
|
9700
9700
|
});
|
|
9701
9701
|
function No() {
|
|
9702
|
-
|
|
9702
|
+
dt.value = !0;
|
|
9703
9703
|
}
|
|
9704
9704
|
function fn() {
|
|
9705
9705
|
var d;
|
|
9706
|
-
|
|
9706
|
+
dt.value = !1, (d = P.value) == null || d.clearFind(), c == null || c.focus();
|
|
9707
9707
|
}
|
|
9708
9708
|
function Zi() {
|
|
9709
9709
|
var d;
|
|
@@ -9715,7 +9715,7 @@ const Kf = Es({
|
|
|
9715
9715
|
function es() {
|
|
9716
9716
|
U == null || U.abort();
|
|
9717
9717
|
}
|
|
9718
|
-
function
|
|
9718
|
+
function gt(d, p) {
|
|
9719
9719
|
if (n.exportProgress === !1) return p(d);
|
|
9720
9720
|
const x = new AbortController();
|
|
9721
9721
|
U = x, d != null && d.signal && (d.signal.aborted ? x.abort() : d.signal.addEventListener("abort", () => x.abort(), { once: !0 })), j.value = !0, O.value = null;
|
|
@@ -9727,10 +9727,10 @@ const Kf = Es({
|
|
|
9727
9727
|
j.value = !1, O.value = null, U = null;
|
|
9728
9728
|
});
|
|
9729
9729
|
}
|
|
9730
|
-
const ts = (d) =>
|
|
9730
|
+
const ts = (d) => gt(d, (p) => P.value.exportImage(p)), Pt = (d) => gt(d, (p) => P.value.downloadImage(p)), ns = (d) => gt(d, (p) => P.value.exportPdf(p)), mt = (d) => gt(d, (p) => P.value.downloadPdf(p)), Ht = (d) => gt(d, (p) => P.value.print(p));
|
|
9731
9731
|
async function Po() {
|
|
9732
9732
|
try {
|
|
9733
|
-
await
|
|
9733
|
+
await mt();
|
|
9734
9734
|
} catch (d) {
|
|
9735
9735
|
zt(d);
|
|
9736
9736
|
}
|
|
@@ -9748,7 +9748,7 @@ const Kf = Es({
|
|
|
9748
9748
|
fitToWidth: d.fitToWidth
|
|
9749
9749
|
});
|
|
9750
9750
|
try {
|
|
9751
|
-
d.action === "png" ? await Pt(T) : d.action === "pdf" ? await
|
|
9751
|
+
d.action === "png" ? await Pt(T) : d.action === "pdf" ? await mt(Z($($({}, T), H), { vector: d.pdfVector })) : await Ht($($({}, T), H));
|
|
9752
9752
|
} catch (_) {
|
|
9753
9753
|
zt(_);
|
|
9754
9754
|
}
|
|
@@ -9770,7 +9770,7 @@ const Kf = Es({
|
|
|
9770
9770
|
function hn() {
|
|
9771
9771
|
J.value = null, de.value = null;
|
|
9772
9772
|
}
|
|
9773
|
-
function
|
|
9773
|
+
function pt(d) {
|
|
9774
9774
|
var x;
|
|
9775
9775
|
const p = k.value;
|
|
9776
9776
|
return p && (x = p.sheets[d != null ? d : S.value]) != null ? x : null;
|
|
@@ -9779,7 +9779,7 @@ const Kf = Es({
|
|
|
9779
9779
|
var p, x;
|
|
9780
9780
|
return Z($({}, d), { date1904: (x = (p = k.value) == null ? void 0 : p.date1904) != null ? x : !1 });
|
|
9781
9781
|
}
|
|
9782
|
-
const
|
|
9782
|
+
const nt = {
|
|
9783
9783
|
load: (d) => I(d, et),
|
|
9784
9784
|
getWorkbook: () => k.value,
|
|
9785
9785
|
getActiveSheet: () => S.value,
|
|
@@ -10055,7 +10055,7 @@ const Kf = Es({
|
|
|
10055
10055
|
exportImage: ts,
|
|
10056
10056
|
downloadImage: Pt,
|
|
10057
10057
|
exportPdf: ns,
|
|
10058
|
-
downloadPdf:
|
|
10058
|
+
downloadPdf: mt,
|
|
10059
10059
|
print: Ht,
|
|
10060
10060
|
exportXlsx: (d) => P.value.exportXlsx(d),
|
|
10061
10061
|
downloadXlsx: (d) => P.value.downloadXlsx(d),
|
|
@@ -10076,30 +10076,30 @@ const Kf = Es({
|
|
|
10076
10076
|
return (p = P.value) == null ? void 0 : p.downloadCsv(d);
|
|
10077
10077
|
},
|
|
10078
10078
|
getCellValue: (d, p, x) => {
|
|
10079
|
-
const T =
|
|
10079
|
+
const T = pt(x);
|
|
10080
10080
|
return T ? ki(T, d, p) : null;
|
|
10081
10081
|
},
|
|
10082
10082
|
getCellText: (d, p, x) => {
|
|
10083
10083
|
var H, B;
|
|
10084
|
-
const T =
|
|
10084
|
+
const T = pt(x);
|
|
10085
10085
|
return T ? Ti(T, d, p, (B = (H = k.value) == null ? void 0 : H.date1904) != null ? B : !1) : "";
|
|
10086
10086
|
},
|
|
10087
10087
|
getSheetData: (d, p) => {
|
|
10088
|
-
const x =
|
|
10088
|
+
const x = pt(p);
|
|
10089
10089
|
return x ? Mi(x, un(d)) : [];
|
|
10090
10090
|
},
|
|
10091
10091
|
getSheetJSON: (d, p) => {
|
|
10092
|
-
const x =
|
|
10092
|
+
const x = pt(p);
|
|
10093
10093
|
return x ? Fi(x, un(d)) : [];
|
|
10094
10094
|
},
|
|
10095
10095
|
getRangeData: (d, p, x) => {
|
|
10096
|
-
const T =
|
|
10096
|
+
const T = pt(x);
|
|
10097
10097
|
return T ? Ja(T, d, un(p)) : [];
|
|
10098
10098
|
},
|
|
10099
10099
|
openTemplateFilePicker: Ho,
|
|
10100
10100
|
clearRuntimeTemplate: hn
|
|
10101
10101
|
};
|
|
10102
|
-
t == null || t(
|
|
10102
|
+
t == null || t(nt), r && r._isVue && Object.assign(r, nt);
|
|
10103
10103
|
function dn() {
|
|
10104
10104
|
const d = k.value;
|
|
10105
10105
|
return d ? d.sheets.map((p, x) => ({ s: p, i: x })).filter(({ s: p }) => p.state === "visible") : [];
|
|
@@ -10125,7 +10125,7 @@ const Kf = Es({
|
|
|
10125
10125
|
const p = P.value, x = (T = k.value) == null ? void 0 : T.sheets[S.value];
|
|
10126
10126
|
switch (d) {
|
|
10127
10127
|
case "find":
|
|
10128
|
-
return q({ id: d, iconSvg: xe("find"), label: "查找", title: "查找 (Ctrl+F)", active:
|
|
10128
|
+
return q({ id: d, iconSvg: xe("find"), label: "查找", title: "查找 (Ctrl+F)", active: dt.value, onClick: () => dt.value ? fn() : No() });
|
|
10129
10129
|
case "filter":
|
|
10130
10130
|
return q({ id: d, iconSvg: xe("filter"), label: "筛选", title: "切换自动筛选", active: !!(x != null && x.autoFilterRange), onClick: Zi });
|
|
10131
10131
|
case "clear-filter":
|
|
@@ -10183,7 +10183,7 @@ const Kf = Es({
|
|
|
10183
10183
|
items: [
|
|
10184
10184
|
q({ id: "export-png", label: "导出为图片 (PNG)", onClick: () => void Pt() }),
|
|
10185
10185
|
q({ id: "export-pdf", label: "导出为 PDF (位图)", onClick: Po }),
|
|
10186
|
-
q({ id: "export-pdf-vector", label: "导出为 PDF (矢量·文字可选)", onClick: () => void
|
|
10186
|
+
q({ id: "export-pdf-vector", label: "导出为 PDF (矢量·文字可选)", onClick: () => void mt({ vector: !0 }).catch(zt) }),
|
|
10187
10187
|
q({ id: "export-print", label: "打印…", onClick: () => void Ht() }),
|
|
10188
10188
|
q({ id: "export-sep", type: "separator" }),
|
|
10189
10189
|
q({ id: "export-settings", label: "导出设置…", onClick: () => {
|
|
@@ -10207,9 +10207,9 @@ const Kf = Es({
|
|
|
10207
10207
|
function gn(d, p) {
|
|
10208
10208
|
var T;
|
|
10209
10209
|
const x = { kind: p, id: d.id, type: d.type, icon: d.icon, label: d.label, title: d.title };
|
|
10210
|
-
return d.active && (x.active = !!d.active(
|
|
10210
|
+
return d.active && (x.active = !!d.active(nt)), d.disabled && (x.disabled = !!d.disabled(nt)), d.onClick && (x.onClick = () => {
|
|
10211
10211
|
var H;
|
|
10212
|
-
return (H = d.onClick) == null ? void 0 : H.call(d,
|
|
10212
|
+
return (H = d.onClick) == null ? void 0 : H.call(d, nt);
|
|
10213
10213
|
}), (T = d.items) != null && T.length && (x.items = d.items.map((H) => gn(H, p))), x;
|
|
10214
10214
|
}
|
|
10215
10215
|
const zo = re(() => {
|
|
@@ -10253,7 +10253,7 @@ const Kf = Es({
|
|
|
10253
10253
|
const d = Ze.value, p = Re.value, x = [0.5, 0.75, 1, 1.25, 1.5, 2], T = le.value === "__header-export", H = [
|
|
10254
10254
|
q({ id: "h-png", label: "导出为图片 (PNG)", onClick: () => void Pt() }),
|
|
10255
10255
|
q({ id: "h-pdf", label: "导出为 PDF (位图)", onClick: Po }),
|
|
10256
|
-
q({ id: "h-pdf-vec", label: "导出为 PDF (矢量·文字可选)", onClick: () => void
|
|
10256
|
+
q({ id: "h-pdf-vec", label: "导出为 PDF (矢量·文字可选)", onClick: () => void mt({ vector: !0 }).catch(zt) }),
|
|
10257
10257
|
q({ id: "h-print", label: "打印…", onClick: () => void Ht() }),
|
|
10258
10258
|
q({ id: "h-sep", type: "separator" }),
|
|
10259
10259
|
q({ id: "h-settings", label: "导出设置…", onClick: () => {
|
|
@@ -10357,7 +10357,7 @@ const Kf = Es({
|
|
|
10357
10357
|
}, p.name)));
|
|
10358
10358
|
}
|
|
10359
10359
|
function us() {
|
|
10360
|
-
if (!k.value || !
|
|
10360
|
+
if (!k.value || !dt.value) return null;
|
|
10361
10361
|
const d = Ki.value, p = P.value;
|
|
10362
10362
|
return L("div", { key: "findbar", class: "ov-findbar" }, [
|
|
10363
10363
|
L("input", {
|
|
@@ -10419,19 +10419,19 @@ const Kf = Es({
|
|
|
10419
10419
|
Y.value = !1;
|
|
10420
10420
|
}, B = (ve) => {
|
|
10421
10421
|
os(Z($({}, K), { action: ve }));
|
|
10422
|
-
}, _ = (ve,
|
|
10422
|
+
}, _ = (ve, ot, je, wt, Xe, Wo) => L("label", {
|
|
10423
10423
|
class: { disabled: !!Wo }
|
|
10424
10424
|
}, [
|
|
10425
10425
|
L("input", {
|
|
10426
10426
|
attrs: { type: "radio", name: ve, value: String(je), disabled: Wo ? "disabled" : void 0 },
|
|
10427
|
-
domProps: { checked: K[
|
|
10427
|
+
domProps: { checked: K[ot] === je },
|
|
10428
10428
|
on: { change: () => {
|
|
10429
|
-
K[
|
|
10429
|
+
K[ot] = je;
|
|
10430
10430
|
} }
|
|
10431
10431
|
}),
|
|
10432
10432
|
" " + wt,
|
|
10433
10433
|
Xe ? L("span", { class: "hint" }, " " + Xe) : null
|
|
10434
|
-
]), ee = (ve,
|
|
10434
|
+
]), ee = (ve, ot) => L("label", [
|
|
10435
10435
|
L("input", {
|
|
10436
10436
|
attrs: { type: "checkbox" },
|
|
10437
10437
|
domProps: { checked: K[ve] },
|
|
@@ -10439,14 +10439,14 @@ const Kf = Es({
|
|
|
10439
10439
|
K[ve] = je.target.checked;
|
|
10440
10440
|
} }
|
|
10441
10441
|
}),
|
|
10442
|
-
" " +
|
|
10443
|
-
]), fe = (ve,
|
|
10442
|
+
" " + ot
|
|
10443
|
+
]), fe = (ve, ot, je = !1) => L("select", {
|
|
10444
10444
|
domProps: { value: String(K[ve]) },
|
|
10445
10445
|
on: { change: (wt) => {
|
|
10446
10446
|
const Xe = wt.target.value;
|
|
10447
10447
|
K[ve] = je ? Number(Xe) : Xe;
|
|
10448
10448
|
} }
|
|
10449
|
-
},
|
|
10449
|
+
}, ot.map(([wt, Xe]) => L("option", { domProps: { value: String(wt) } }, Xe)));
|
|
10450
10450
|
return L("div", {
|
|
10451
10451
|
key: "export-dlg",
|
|
10452
10452
|
class: "ov-dlg-mask",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Yh = Object.defineProperty;
|
|
2
2
|
var Jh = (n, e, t) => e in n ? Yh(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var xe = (n, e, t) => Jh(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { z as ko } from "./index-
|
|
4
|
+
import { z as ko } from "./index-6q8kSGQg.js";
|
|
5
5
|
function _e(n) {
|
|
6
6
|
"@babel/helpers - typeof";
|
|
7
7
|
return _e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
@@ -8911,7 +8911,7 @@ endobj\r
|
|
|
8911
8911
|
var d = c.getContext("2d");
|
|
8912
8912
|
d.fillStyle = "#fff", d.fillRect(0, 0, c.width, c.height);
|
|
8913
8913
|
var m = { ignoreMouse: !0, ignoreAnimation: !0, ignoreDimensions: !0 }, A = this;
|
|
8914
|
-
return ($t.canvg ? Promise.resolve($t.canvg) : import("./index.es-
|
|
8914
|
+
return ($t.canvg ? Promise.resolve($t.canvg) : import("./index.es-D9BGYyEt.js")).catch(function(P) {
|
|
8915
8915
|
return Promise.reject(new Error("Could not load canvg: " + P));
|
|
8916
8916
|
}).then(function(P) {
|
|
8917
8917
|
return P.default ? P.default : P;
|
package/dist/vue2.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ooxml-excel-editor",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "High-fidelity OOXML (.xlsx) preview & editor — canvas renderer, framework-agnostic core with Vue 3, Vue 2 and React shells (1:1 UI across all shells). Read-only by default; opt-in editing with undo/redo, formula recalc, and export back to .xlsx/JSON/CSV.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|