@silurus/ooxml 0.72.0 → 0.72.2
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/dist/{docx-BPF-eH0O.js → docx-wLLJuetI.js} +2646 -2175
- package/dist/docx.mjs +2 -2
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{find-cursor-DTrEBxjE.js → find-cursor-DBifiZop.js} +949 -923
- package/dist/{highlight-rect-B--cPQOV.js → highlight-rect-DTgfiJgA.js} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/{pptx-BMxDfEYI.js → pptx-D3L4FQfI.js} +113 -107
- package/dist/pptx.mjs +2 -2
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/render-worker-host-B5esxBj-.js +27 -0
- package/dist/render-worker-host-BzhGwe0I.js +27 -0
- package/dist/render-worker-host-Cg60RAG_.js +27 -0
- package/dist/{segments-Da-soh2U.js → segments--0hIQLXB.js} +1 -1
- package/dist/types/docx.d.ts +30 -0
- package/dist/types/index.d.ts +45 -0
- package/dist/types/pptx.d.ts +11 -0
- package/dist/types/xlsx.d.ts +3 -0
- package/dist/{visible-index-5hdq_oAL.js → visible-index-DSN5XPnm.js} +1 -1
- package/dist/{xlsx-bwQD8c1Q.js → xlsx-BWEqRZ25.js} +344 -337
- package/dist/xlsx.mjs +2 -2
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/render-worker-host-DL_kkykF.js +0 -27
- package/dist/render-worker-host-S0HOWgs0.js +0 -27
- package/dist/render-worker-host-l8yqDUfE.js +0 -27
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as e, At as t, B as n, Bt as r, C as i, Dt as a, E as o, Et as s, Ft as c, G as l, H as u, Ht as d, I as f, It as p, J as m, Jt as h, K as g, L as _, Lt as v, M as y, Mt as b, N as x, Nt as S, O as C, Ot as w, P as T, Pt as E, S as D, T as O, Tt as k, U as A, Ut as j, V as M, W as N, Xt as P, Yt as F, _ as ee, _t as I, b as L, bt as R, ct as z, d as B, f as V, gt as H, h as U, i as te, it as W, j as ne, jt as G, kt as re, l as ie, lt as ae, m as oe, n as se, nt as ce, o as le, p as ue, pt as K, q as de, qt as fe, r as q, t as pe, tt as me, v as he, w as J, wt as ge, x as _e, y as ve, z as ye, zt as be } from "./find-cursor-
|
|
2
|
-
import { a as xe, i as Se, n as Ce, r as we, t as Te } from "./visible-index-
|
|
1
|
+
import { $ as e, At as t, B as n, Bt as r, C as i, Dt as a, E as o, Et as s, Ft as c, G as l, H as u, Ht as d, I as f, It as p, J as m, Jt as h, K as g, L as _, Lt as v, M as y, Mt as b, N as x, Nt as S, O as C, Ot as w, P as T, Pt as E, S as D, T as O, Tt as k, U as A, Ut as j, V as M, W as N, Xt as P, Yt as F, _ as ee, _t as I, b as L, bt as R, ct as z, d as B, f as V, gt as H, h as U, i as te, it as W, j as ne, jt as G, kt as re, l as ie, lt as ae, m as oe, n as se, nt as ce, o as le, p as ue, pt as K, q as de, qt as fe, r as q, t as pe, tt as me, v as he, w as J, wt as ge, x as _e, y as ve, z as ye, zt as be } from "./find-cursor-DBifiZop.js";
|
|
2
|
+
import { a as xe, i as Se, n as Ce, r as we, t as Te } from "./visible-index-DSN5XPnm.js";
|
|
3
3
|
import { t as Ee } from "./mathjax-Dk_JzbFj.js";
|
|
4
|
-
import { t as De } from "./segments
|
|
4
|
+
import { t as De } from "./segments--0hIQLXB.js";
|
|
5
5
|
//#region packages/core/src/sparkline/renderer.ts
|
|
6
6
|
function Oe(e, t, n) {
|
|
7
7
|
let { values: r } = n;
|
|
@@ -1485,7 +1485,10 @@ var On = 11, kn = 8;
|
|
|
1485
1485
|
function An(e, t, n) {
|
|
1486
1486
|
return n - e - t;
|
|
1487
1487
|
}
|
|
1488
|
-
|
|
1488
|
+
function jn(e, t, n, r) {
|
|
1489
|
+
return r ? An(e, t, n) : e;
|
|
1490
|
+
}
|
|
1491
|
+
var Mn = "#7a7a7a", Nn = /* @__PURE__ */ new Map(), Pn = {
|
|
1489
1492
|
"meiryo ui": {
|
|
1490
1493
|
10: 8,
|
|
1491
1494
|
11: 8
|
|
@@ -1495,11 +1498,11 @@ var jn = "#7a7a7a", Mn = /* @__PURE__ */ new Map(), Nn = {
|
|
|
1495
1498
|
11: 8
|
|
1496
1499
|
}
|
|
1497
1500
|
};
|
|
1498
|
-
function
|
|
1499
|
-
let n = `${e}:${t}`, r =
|
|
1501
|
+
function Fn(e, t) {
|
|
1502
|
+
let n = `${e}:${t}`, r = Nn.get(n);
|
|
1500
1503
|
if (r !== void 0) return r;
|
|
1501
|
-
let i =
|
|
1502
|
-
if (i !== void 0) return
|
|
1504
|
+
let i = Pn[e.toLowerCase()]?.[Math.round(t)];
|
|
1505
|
+
if (i !== void 0) return Nn.set(n, i), i;
|
|
1503
1506
|
let a = t * G, o = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1) : typeof document < "u" ? document.createElement("canvas") : null;
|
|
1504
1507
|
if (!o) return kn;
|
|
1505
1508
|
let s = o.getContext("2d");
|
|
@@ -1511,24 +1514,24 @@ function Pn(e, t) {
|
|
|
1511
1514
|
t > c && (c = t);
|
|
1512
1515
|
}
|
|
1513
1516
|
let l = Math.round(c) || kn;
|
|
1514
|
-
return
|
|
1517
|
+
return Nn.set(n, l), l;
|
|
1515
1518
|
}
|
|
1516
1519
|
function Z(e) {
|
|
1517
|
-
return !e.defaultFontFamily || !e.defaultFontSize ? kn :
|
|
1520
|
+
return !e.defaultFontFamily || !e.defaultFontSize ? kn : Fn(e.defaultFontFamily, e.defaultFontSize);
|
|
1518
1521
|
}
|
|
1519
1522
|
function Q(e, t = kn) {
|
|
1520
1523
|
return Math.trunc((256 * e + Math.trunc(128 / t)) / 256 * t);
|
|
1521
1524
|
}
|
|
1522
|
-
function
|
|
1525
|
+
function In(e, t = kn) {
|
|
1523
1526
|
return e / t;
|
|
1524
1527
|
}
|
|
1525
1528
|
function $(e) {
|
|
1526
1529
|
return Math.round(e * G);
|
|
1527
1530
|
}
|
|
1528
|
-
function
|
|
1531
|
+
function Ln(e) {
|
|
1529
1532
|
return e / G;
|
|
1530
1533
|
}
|
|
1531
|
-
function
|
|
1534
|
+
function Rn(e, t, n, r, i, a, o) {
|
|
1532
1535
|
if (!(i <= 0 || a <= 0)) {
|
|
1533
1536
|
if (o) {
|
|
1534
1537
|
let a = e.createLinearGradient(n, r, n + i, r);
|
|
@@ -1537,7 +1540,7 @@ function Ln(e, t, n, r, i, a, o) {
|
|
|
1537
1540
|
e.fillRect(n, r, i, a);
|
|
1538
1541
|
}
|
|
1539
1542
|
}
|
|
1540
|
-
function
|
|
1543
|
+
function zn(e) {
|
|
1541
1544
|
switch (e) {
|
|
1542
1545
|
case "solid": return 1;
|
|
1543
1546
|
case "darkGray": return .75;
|
|
@@ -1560,7 +1563,7 @@ function Rn(e) {
|
|
|
1560
1563
|
default: return 1;
|
|
1561
1564
|
}
|
|
1562
1565
|
}
|
|
1563
|
-
var
|
|
1566
|
+
var Bn = /* @__PURE__ */ new Map(), Vn = {
|
|
1564
1567
|
gray0625: [
|
|
1565
1568
|
128,
|
|
1566
1569
|
0,
|
|
@@ -1722,15 +1725,15 @@ var zn = /* @__PURE__ */ new Map(), Bn = {
|
|
|
1722
1725
|
153
|
|
1723
1726
|
]
|
|
1724
1727
|
};
|
|
1725
|
-
function
|
|
1728
|
+
function Hn(e, t, n, r) {
|
|
1726
1729
|
let i = e.getTransform(), a = Math.max(1, Math.round(Math.hypot(i.a, i.b))), o = Math.max(1, Math.round(Math.hypot(i.c, i.d))), s = `${t}|${n}|${r}|${a}|${o}`;
|
|
1727
|
-
if (
|
|
1728
|
-
let c =
|
|
1729
|
-
if (!c) return
|
|
1730
|
+
if (Bn.has(s)) return Bn.get(s);
|
|
1731
|
+
let c = Vn[t];
|
|
1732
|
+
if (!c) return Bn.set(s, null), null;
|
|
1730
1733
|
let l = c.length, u = k(l, l);
|
|
1731
|
-
if (!u) return
|
|
1734
|
+
if (!u) return Bn.set(s, null), null;
|
|
1732
1735
|
let d = u.getContext("2d");
|
|
1733
|
-
if (!d) return
|
|
1736
|
+
if (!d) return Bn.set(s, null), null;
|
|
1734
1737
|
d.fillStyle = R(r), d.fillRect(0, 0, l, l), d.fillStyle = R(n);
|
|
1735
1738
|
for (let e = 0; e < l; e++) {
|
|
1736
1739
|
let t = c[e];
|
|
@@ -1741,23 +1744,23 @@ function Vn(e, t, n, r) {
|
|
|
1741
1744
|
let e = new DOMMatrix();
|
|
1742
1745
|
e.scaleSelf(1 / a, 1 / o), f.setTransform(e);
|
|
1743
1746
|
}
|
|
1744
|
-
return
|
|
1747
|
+
return Bn.set(s, f), f;
|
|
1745
1748
|
}
|
|
1746
|
-
function
|
|
1747
|
-
if (t.gradient && t.gradient.stops.length > 0) return e.fillStyle =
|
|
1749
|
+
function Un(e, t, n, r, i, a) {
|
|
1750
|
+
if (t.gradient && t.gradient.stops.length > 0) return e.fillStyle = Wn(e, t.gradient, n, r, i, a), e.fillRect(n, r, i, a), !0;
|
|
1748
1751
|
let o = t.patternType;
|
|
1749
1752
|
if (!o || o === "none") return !1;
|
|
1750
1753
|
let s = t.fgColor ?? "000000", c = t.bgColor ?? "FFFFFF";
|
|
1751
1754
|
if (o === "solid") return e.fillStyle = R(s), e.fillRect(n, r, i, a), !0;
|
|
1752
|
-
let l =
|
|
1755
|
+
let l = Hn(e, o, s, c);
|
|
1753
1756
|
if (l) e.fillStyle = l;
|
|
1754
1757
|
else {
|
|
1755
|
-
let t =
|
|
1756
|
-
e.fillStyle = t >= 1 ? R(s) :
|
|
1758
|
+
let t = zn(o);
|
|
1759
|
+
e.fillStyle = t >= 1 ? R(s) : qn(s, c, t);
|
|
1757
1760
|
}
|
|
1758
1761
|
return e.fillRect(n, r, i, a), !0;
|
|
1759
1762
|
}
|
|
1760
|
-
function
|
|
1763
|
+
function Wn(e, t, n, r, i, a) {
|
|
1761
1764
|
let o;
|
|
1762
1765
|
if (t.gradientType === "path") {
|
|
1763
1766
|
let s = n + i * (t.left + (1 - t.right - t.left) / 2), c = r + a * (t.top + (1 - t.bottom - t.top) / 2), l = Math.hypot(Math.max(s - n, n + i - s), Math.max(c - r, r + a - c));
|
|
@@ -1772,28 +1775,28 @@ function Un(e, t, n, r, i, a) {
|
|
|
1772
1775
|
}
|
|
1773
1776
|
return o;
|
|
1774
1777
|
}
|
|
1775
|
-
var
|
|
1776
|
-
function
|
|
1778
|
+
var Gn = _n;
|
|
1779
|
+
function Kn(e, t, n, r, i) {
|
|
1777
1780
|
let a = Math.max(4, Math.min(8, Math.min(r, i) * .18));
|
|
1778
1781
|
e.save(), e.fillStyle = "#D40000", e.beginPath(), e.moveTo(t + r - a, n), e.lineTo(t + r, n), e.lineTo(t + r, n + a), e.closePath(), e.fill(), e.restore();
|
|
1779
1782
|
}
|
|
1780
|
-
function
|
|
1783
|
+
function qn(e, t, n) {
|
|
1781
1784
|
let r = e.replace("#", ""), i = t.replace("#", ""), a = parseInt(r.slice(0, 2), 16), o = parseInt(r.slice(2, 4), 16), s = parseInt(r.slice(4, 6), 16), c = parseInt(i.slice(0, 2), 16), l = parseInt(i.slice(2, 4), 16), u = parseInt(i.slice(4, 6), 16), d = Math.min(1, Math.max(0, n));
|
|
1782
1785
|
return `rgb(${Math.round(a * d + c * (1 - d))},${Math.round(o * d + l * (1 - d))},${Math.round(s * d + u * (1 - d))})`;
|
|
1783
1786
|
}
|
|
1784
|
-
function
|
|
1787
|
+
function Jn(e, t, n = 1, r) {
|
|
1785
1788
|
let i = Math.round(e * G * n * t);
|
|
1786
1789
|
return r ? Math.max(i, Math.round(le(r, e * G * t))) : i;
|
|
1787
1790
|
}
|
|
1788
|
-
function
|
|
1791
|
+
function Yn(e, t = 1) {
|
|
1789
1792
|
return `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${Math.max(1, Math.round(e.size * G * t))}px ${Dn(e.name)}`;
|
|
1790
1793
|
}
|
|
1791
|
-
function
|
|
1794
|
+
function Xn(e, t, n, r, i, a, o, s, c, l) {
|
|
1792
1795
|
if (t.length === 0) return;
|
|
1793
1796
|
let u = n?.fontId ?? 0, d = a.fonts[u] ?? a.fonts[0];
|
|
1794
1797
|
if (!d) return;
|
|
1795
1798
|
let f = n?.alignment ?? "left";
|
|
1796
|
-
e.save(), e.font =
|
|
1799
|
+
e.save(), e.font = Yn(d, c), e.textBaseline = "top", e.textAlign = "left", e.fillStyle = l;
|
|
1797
1800
|
let p = s + Math.round(2 * c);
|
|
1798
1801
|
if (f === "noControl") {
|
|
1799
1802
|
let n = o;
|
|
@@ -1801,7 +1804,7 @@ function Yn(e, t, n, r, i, a, o, s, c, l) {
|
|
|
1801
1804
|
e.restore();
|
|
1802
1805
|
return;
|
|
1803
1806
|
}
|
|
1804
|
-
let m = Re(t, r, o, f, (t) =>
|
|
1807
|
+
let m = Re(t, r, o, f, (t) => Zn(e, t, i));
|
|
1805
1808
|
for (let t of m) {
|
|
1806
1809
|
let n = e.measureText(t.text).width, r = [...t.text];
|
|
1807
1810
|
if (t.spread === "distribute" && r.length > 1 && n < t.width) {
|
|
@@ -1817,13 +1820,13 @@ function Yn(e, t, n, r, i, a, o, s, c, l) {
|
|
|
1817
1820
|
}
|
|
1818
1821
|
e.restore();
|
|
1819
1822
|
}
|
|
1820
|
-
function
|
|
1823
|
+
function Zn(e, t, n) {
|
|
1821
1824
|
let r = e.font;
|
|
1822
1825
|
e.font = n;
|
|
1823
1826
|
let i = e.measureText(t).width;
|
|
1824
1827
|
return e.font = r, i;
|
|
1825
1828
|
}
|
|
1826
|
-
function
|
|
1829
|
+
function Qn(e, t, n, r, i, a, o = 1) {
|
|
1827
1830
|
if (e.save(), e.strokeStyle = i, e.lineWidth = .5, e.beginPath(), a) {
|
|
1828
1831
|
let i = r - 1, a = r + 1, s = i + N(i, .5, o), c = a + N(a, .5, o);
|
|
1829
1832
|
e.moveTo(t, s), e.lineTo(n, s), e.moveTo(t, c), e.lineTo(n, c);
|
|
@@ -1833,7 +1836,7 @@ function Zn(e, t, n, r, i, a, o = 1) {
|
|
|
1833
1836
|
}
|
|
1834
1837
|
e.stroke(), e.restore();
|
|
1835
1838
|
}
|
|
1836
|
-
function
|
|
1839
|
+
function $n(e, t) {
|
|
1837
1840
|
let n = t.font;
|
|
1838
1841
|
return n ? {
|
|
1839
1842
|
bold: n.bold,
|
|
@@ -1847,7 +1850,7 @@ function Qn(e, t) {
|
|
|
1847
1850
|
vertAlign: n.vertAlign
|
|
1848
1851
|
} : e;
|
|
1849
1852
|
}
|
|
1850
|
-
function
|
|
1853
|
+
function er(e, t) {
|
|
1851
1854
|
let n = e.cellXfs[t] ?? e.cellXfs[0] ?? {
|
|
1852
1855
|
fontId: 0,
|
|
1853
1856
|
fillId: 0,
|
|
@@ -1881,17 +1884,17 @@ function $n(e, t) {
|
|
|
1881
1884
|
xf: n
|
|
1882
1885
|
};
|
|
1883
1886
|
}
|
|
1884
|
-
function
|
|
1887
|
+
function tr(e, t, n) {
|
|
1885
1888
|
let r = [];
|
|
1886
|
-
for (let i of t.split("\n")) r.push(...
|
|
1889
|
+
for (let i of t.split("\n")) r.push(...ar(e, i, n));
|
|
1887
1890
|
return r;
|
|
1888
1891
|
}
|
|
1889
|
-
function
|
|
1892
|
+
function nr(e, t) {
|
|
1890
1893
|
if (e.length === 0 || t.length === 0) return 0;
|
|
1891
1894
|
let n = [...e, ...t], r = e.length;
|
|
1892
1895
|
return r - f(n, r, _, 1);
|
|
1893
1896
|
}
|
|
1894
|
-
function
|
|
1897
|
+
function rr(e, t) {
|
|
1895
1898
|
let n = t;
|
|
1896
1899
|
for (; n < e.length;) {
|
|
1897
1900
|
let t = e[e.length - n - 1], r = e[e.length - n], i = t?.codePointAt(0), a = r?.codePointAt(0);
|
|
@@ -1900,7 +1903,7 @@ function nr(e, t) {
|
|
|
1900
1903
|
}
|
|
1901
1904
|
return n >= e.length ? t : n;
|
|
1902
1905
|
}
|
|
1903
|
-
function
|
|
1906
|
+
function ir(e, t) {
|
|
1904
1907
|
if (e.length === 0 || t.length === 0) return 0;
|
|
1905
1908
|
let n = t[0].codePointAt(0), r = e.length - 1, i = e[r].codePointAt(0);
|
|
1906
1909
|
if (i === void 0 || n === void 0 || i === 8203 || n === 8203 || !y(i, n)) return 0;
|
|
@@ -1911,7 +1914,7 @@ function rr(e, t) {
|
|
|
1911
1914
|
}
|
|
1912
1915
|
return r === 0 ? 0 : e.length - r;
|
|
1913
1916
|
}
|
|
1914
|
-
function
|
|
1917
|
+
function ar(e, t, n) {
|
|
1915
1918
|
let r = [], i = [], a = 0;
|
|
1916
1919
|
for (; a < t.length;) {
|
|
1917
1920
|
let e = t[a], n = e.codePointAt(0) ?? 0;
|
|
@@ -1947,7 +1950,7 @@ function ir(e, t, n) {
|
|
|
1947
1950
|
else {
|
|
1948
1951
|
let e = t.replace(/^ +/, "");
|
|
1949
1952
|
e === "" && (e = t);
|
|
1950
|
-
let n = [...o], i =
|
|
1953
|
+
let n = [...o], i = nr(n, [...e]);
|
|
1951
1954
|
if (i > 0) {
|
|
1952
1955
|
let t = n.length - i;
|
|
1953
1956
|
r.push(n.slice(0, t).join("")), o = n.slice(t).join("") + e;
|
|
@@ -1956,7 +1959,7 @@ function ir(e, t, n) {
|
|
|
1956
1959
|
}
|
|
1957
1960
|
return r.push(o), r;
|
|
1958
1961
|
}
|
|
1959
|
-
function
|
|
1962
|
+
function or(e, t, n, r, i) {
|
|
1960
1963
|
let a = [], s = [], c = 0, l = 0, u = null, d = n.size, f = n.name, p = 0, m = () => {
|
|
1961
1964
|
s.length !== 0 && (a.push({
|
|
1962
1965
|
segments: s,
|
|
@@ -1977,17 +1980,17 @@ function ar(e, t, n, r, i) {
|
|
|
1977
1980
|
m();
|
|
1978
1981
|
}, g = (t, n) => {
|
|
1979
1982
|
if (!t) return;
|
|
1980
|
-
d = n.size, f = n.name, e.font =
|
|
1983
|
+
d = n.size, f = n.name, e.font = Yn(cr(n), r);
|
|
1981
1984
|
let a = e.measureText(t).width;
|
|
1982
1985
|
if (s.length > 0 && c + a > i) {
|
|
1983
|
-
let i = s.flatMap((e) => [...e.text]), a =
|
|
1984
|
-
a > 0 ? a =
|
|
1986
|
+
let i = s.flatMap((e) => [...e.text]), a = nr(i, [...t]);
|
|
1987
|
+
a > 0 ? a = rr(i, a) : !J(t) && !J(s[s.length - 1]?.text ?? "") && !/^\s/u.test(t) && !/\s$/u.test(i.at(-1) ?? "") && (a = ir(i, [...t]));
|
|
1985
1988
|
let o = s[s.length - 1], d = [...o.text];
|
|
1986
1989
|
a > d.length && (a = d.length);
|
|
1987
1990
|
let f = null;
|
|
1988
1991
|
if (a > 0) {
|
|
1989
1992
|
let t = d.slice(0, d.length - a), n = d.slice(d.length - a);
|
|
1990
|
-
if (e.font =
|
|
1993
|
+
if (e.font = Yn(cr(o.font), r), t.length === 0) s.pop();
|
|
1991
1994
|
else {
|
|
1992
1995
|
let n = t.join("");
|
|
1993
1996
|
o.text = n, o.width = e.measureText(n).width;
|
|
@@ -1999,7 +2002,7 @@ function ar(e, t, n, r, i) {
|
|
|
1999
2002
|
width: e.measureText(i).width
|
|
2000
2003
|
};
|
|
2001
2004
|
}
|
|
2002
|
-
m(), f && (s.push(f), c += f.width, f.font.size > l && (l = f.font.size, u = f.font.name)), e.font =
|
|
2005
|
+
m(), f && (s.push(f), c += f.width, f.font.size > l && (l = f.font.size, u = f.font.name)), e.font = Yn(cr(n), r);
|
|
2003
2006
|
}
|
|
2004
2007
|
s.push({
|
|
2005
2008
|
text: t,
|
|
@@ -2012,7 +2015,7 @@ function ar(e, t, n, r, i) {
|
|
|
2012
2015
|
g(t, n);
|
|
2013
2016
|
return;
|
|
2014
2017
|
}
|
|
2015
|
-
e.font =
|
|
2018
|
+
e.font = Yn(cr(n), r);
|
|
2016
2019
|
let s = (t) => e.measureText(t).width, l = C(t), u = t.length, d = 0;
|
|
2017
2020
|
for (; d < u;) {
|
|
2018
2021
|
let e = i - c, r = O(t, a, d, e, s, l);
|
|
@@ -2028,7 +2031,7 @@ function ar(e, t, n, r, i) {
|
|
|
2028
2031
|
}
|
|
2029
2032
|
};
|
|
2030
2033
|
for (let e of t) {
|
|
2031
|
-
let t =
|
|
2034
|
+
let t = $n(n, e), r = [], i = 0;
|
|
2032
2035
|
for (; i < e.text.length;) {
|
|
2033
2036
|
let t = e.text[i], n = t.codePointAt(0) ?? 0;
|
|
2034
2037
|
if (n === 10) r.push("\n"), i += 1;
|
|
@@ -2051,7 +2054,7 @@ function ar(e, t, n, r, i) {
|
|
|
2051
2054
|
}
|
|
2052
2055
|
return (s.length > 0 || a.length > 0) && h(), a;
|
|
2053
2056
|
}
|
|
2054
|
-
function
|
|
2057
|
+
function sr(e, t, n) {
|
|
2055
2058
|
return e === "middle" ? {
|
|
2056
2059
|
underline: t + Math.round(n * .55),
|
|
2057
2060
|
strike: t
|
|
@@ -2063,13 +2066,13 @@ function or(e, t, n) {
|
|
|
2063
2066
|
strike: t + Math.round(n * .5)
|
|
2064
2067
|
};
|
|
2065
2068
|
}
|
|
2066
|
-
function
|
|
2069
|
+
function cr(e) {
|
|
2067
2070
|
return e.vertAlign === "superscript" || e.vertAlign === "subscript" ? {
|
|
2068
2071
|
...e,
|
|
2069
2072
|
size: e.size * .65
|
|
2070
2073
|
} : e;
|
|
2071
2074
|
}
|
|
2072
|
-
function
|
|
2075
|
+
function lr(e, t, n, r, i, a, o, s) {
|
|
2073
2076
|
e.textAlign = "left", e.textBaseline = i;
|
|
2074
2077
|
let c = s.needBidi ? gn(t, s.baseRtl ?? !1) : null, l = e, u = n;
|
|
2075
2078
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -2077,18 +2080,18 @@ function cr(e, t, n, r, i, a, o, s) {
|
|
|
2077
2080
|
if (c) try {
|
|
2078
2081
|
l.direction = c.rtl[d] ? "rtl" : "ltr";
|
|
2079
2082
|
} catch {}
|
|
2080
|
-
let f = t[d], p =
|
|
2081
|
-
e.font =
|
|
2083
|
+
let f = t[d], p = cr(f.font);
|
|
2084
|
+
e.font = Yn(p, a);
|
|
2082
2085
|
let m = s.fontColor ?? f.font.color;
|
|
2083
2086
|
e.fillStyle = m ? R(m) : "#000000";
|
|
2084
|
-
let h =
|
|
2087
|
+
let h = Jn(f.font.size, a), g = 0;
|
|
2085
2088
|
f.font.vertAlign === "superscript" ? g = -Math.round(h * .35) : f.font.vertAlign === "subscript" && (g = Math.round(h * .1)), e.fillText(f.text, u, r + g);
|
|
2086
|
-
let _ =
|
|
2089
|
+
let _ = Jn(p.size, a);
|
|
2087
2090
|
if (f.font.underline || f.font.strike) {
|
|
2088
|
-
let t =
|
|
2091
|
+
let t = sr(i, r, _);
|
|
2089
2092
|
if (f.font.underline) {
|
|
2090
2093
|
let n = m ? R(m) : "#000000", r = f.font.underlineStyle === "double" || f.font.underlineStyle === "doubleAccounting";
|
|
2091
|
-
|
|
2094
|
+
Qn(e, u, u + f.width, t.underline + g, n, r, o);
|
|
2092
2095
|
}
|
|
2093
2096
|
if (f.font.strike) {
|
|
2094
2097
|
let n = t.strike + g, r = n + N(n, .5, o);
|
|
@@ -2101,10 +2104,10 @@ function cr(e, t, n, r, i, a, o, s) {
|
|
|
2101
2104
|
l.direction = "ltr";
|
|
2102
2105
|
} catch {}
|
|
2103
2106
|
}
|
|
2104
|
-
function
|
|
2107
|
+
function ur(e, t, n, r, i, a, o, s, c) {
|
|
2105
2108
|
let { alignH: l, cx: u, cellW: d, leftPad: f, paddingX: p } = r, m = t.map((t) => {
|
|
2106
|
-
let r =
|
|
2107
|
-
return e.font =
|
|
2109
|
+
let r = $n(n, t);
|
|
2110
|
+
return e.font = Yn(cr(r), i), {
|
|
2108
2111
|
text: t.text,
|
|
2109
2112
|
font: r,
|
|
2110
2113
|
width: e.measureText(t.text).width
|
|
@@ -2112,17 +2115,17 @@ function lr(e, t, n, r, i, a, o, s, c) {
|
|
|
2112
2115
|
}), h = m.reduce((e, t) => e + t.width, 0), g;
|
|
2113
2116
|
g = l === "right" ? u + d - p - h : l === "center" ? u + d / 2 - h / 2 : u + f;
|
|
2114
2117
|
let { needBidi: _, baseRtl: v } = hn(o.readingOrder, m.map((e) => e.text).join(""));
|
|
2115
|
-
|
|
2118
|
+
lr(e, m, g, s, c, i, a, {
|
|
2116
2119
|
fontColor: o.fontColor,
|
|
2117
2120
|
needBidi: _,
|
|
2118
2121
|
baseRtl: v
|
|
2119
2122
|
});
|
|
2120
2123
|
}
|
|
2121
|
-
function
|
|
2124
|
+
function dr(e, t, n, r, i, a, o = {}) {
|
|
2122
2125
|
let { alignV: s, cy: c, cellH: l, paddingY: u } = r, d, f;
|
|
2123
|
-
s === "top" ? (f = "top", d = c + u) : s === "center" ? (f = "middle", d = c + l / 2) : (f = "bottom", d = c + l - u),
|
|
2126
|
+
s === "top" ? (f = "top", d = c + u) : s === "center" ? (f = "middle", d = c + l / 2) : (f = "bottom", d = c + l - u), ur(e, t, n, r, i, a, o, d, f);
|
|
2124
2127
|
}
|
|
2125
|
-
function
|
|
2128
|
+
function fr(e, t, n, r, i, a, o = {}) {
|
|
2126
2129
|
let { alignV: s, cy: c, cellH: l, paddingY: u } = r, d = [[]];
|
|
2127
2130
|
for (let e of t) {
|
|
2128
2131
|
let t = e.text.split("\n");
|
|
@@ -2138,39 +2141,39 @@ function dr(e, t, n, r, i, a, o = {}) {
|
|
|
2138
2141
|
};
|
|
2139
2142
|
let t = 0, r = null;
|
|
2140
2143
|
for (let i of e) {
|
|
2141
|
-
let e =
|
|
2144
|
+
let e = $n(n, i);
|
|
2142
2145
|
e.size > t && (t = e.size, r = e.name), f = e.size, p = e.name;
|
|
2143
2146
|
}
|
|
2144
2147
|
return {
|
|
2145
2148
|
pt: t,
|
|
2146
2149
|
family: r
|
|
2147
2150
|
};
|
|
2148
|
-
}).map((e) =>
|
|
2151
|
+
}).map((e) => Jn(e.pt, i, 1.2, e.family ?? void 0)), h = m.reduce((e, t) => e + t, 0), g;
|
|
2149
2152
|
g = s === "top" ? c + u : s === "center" ? c + (l - h) / 2 : c + l - h - u;
|
|
2150
2153
|
for (let t = 0; t < d.length; t++) {
|
|
2151
2154
|
let s = d[t];
|
|
2152
|
-
s.length > 0 &&
|
|
2155
|
+
s.length > 0 && ur(e, s, n, r, i, a, o, g, "top"), g += m[t];
|
|
2153
2156
|
}
|
|
2154
2157
|
}
|
|
2155
|
-
function fr(e, t, n, r, i, a, o = {}) {
|
|
2156
|
-
t.some((e) => e.text.includes("\n")) ? dr(e, t, n, r, i, a, o) : ur(e, t, n, r, i, a, o);
|
|
2157
|
-
}
|
|
2158
2158
|
function pr(e, t, n, r, i, a, o = {}) {
|
|
2159
|
-
|
|
2159
|
+
t.some((e) => e.text.includes("\n")) ? fr(e, t, n, r, i, a, o) : dr(e, t, n, r, i, a, o);
|
|
2160
|
+
}
|
|
2161
|
+
function mr(e, t, n, r, i, a, o = {}) {
|
|
2162
|
+
let { alignH: s, alignV: c, cx: l, cy: u, cellW: d, cellH: f, leftPad: p, paddingX: m, paddingY: h } = r, g = or(e, t, n, i, d - p - m), _ = g.reduce((e, t) => e + Jn(t.maxFontSize, i, 1.2, t.maxFontFamily ?? void 0), 0), v;
|
|
2160
2163
|
v = c === "top" ? u + h : c === "center" ? u + (f - _) / 2 : u + f - _ - h;
|
|
2161
2164
|
let y = t.map((e) => e.text).join("").split("\n").map((e) => hn(o.readingOrder, e));
|
|
2162
2165
|
for (let t of g) {
|
|
2163
2166
|
let n = t.segments.reduce((e, t) => e + t.width, 0), r;
|
|
2164
2167
|
r = s === "right" ? l + d - m - n : s === "center" ? l + d / 2 - n / 2 : l + p;
|
|
2165
2168
|
let { needBidi: c, baseRtl: u } = y[t.para];
|
|
2166
|
-
|
|
2169
|
+
lr(e, t.segments, r, v, "top", i, a, {
|
|
2167
2170
|
fontColor: o.fontColor,
|
|
2168
2171
|
needBidi: c,
|
|
2169
2172
|
baseRtl: u
|
|
2170
|
-
}), v +=
|
|
2173
|
+
}), v += Jn(t.maxFontSize, i, 1.2, t.maxFontFamily ?? void 0);
|
|
2171
2174
|
}
|
|
2172
2175
|
}
|
|
2173
|
-
function
|
|
2176
|
+
function hr(e) {
|
|
2174
2177
|
let t = "";
|
|
2175
2178
|
for (; e > 0;) {
|
|
2176
2179
|
let n = (e - 1) % 26;
|
|
@@ -2178,38 +2181,38 @@ function mr(e) {
|
|
|
2178
2181
|
}
|
|
2179
2182
|
return t;
|
|
2180
2183
|
}
|
|
2181
|
-
var
|
|
2184
|
+
var gr = [
|
|
2182
2185
|
"#FF0000",
|
|
2183
2186
|
"#FFFF00",
|
|
2184
2187
|
"#00B050"
|
|
2185
|
-
],
|
|
2188
|
+
], _r = [
|
|
2186
2189
|
"#FF0000",
|
|
2187
2190
|
"#FF6600",
|
|
2188
2191
|
"#FFFF00",
|
|
2189
2192
|
"#00B050"
|
|
2190
|
-
],
|
|
2193
|
+
], vr = [
|
|
2191
2194
|
"#FF0000",
|
|
2192
2195
|
"#FF6600",
|
|
2193
2196
|
"#FFFF00",
|
|
2194
2197
|
"#92D050",
|
|
2195
2198
|
"#00B050"
|
|
2196
2199
|
];
|
|
2197
|
-
function
|
|
2200
|
+
function yr(e, t, n, r, i, a) {
|
|
2198
2201
|
if (t === "NoIcons") return;
|
|
2199
|
-
let o = t || "3TrafficLights1", s = parseInt(o[0]) || 3, c = s === 5 ?
|
|
2202
|
+
let o = t || "3TrafficLights1", s = parseInt(o[0]) || 3, c = s === 5 ? vr : s === 4 ? _r : gr, l = c[Math.max(0, Math.min(n, c.length - 1))];
|
|
2200
2203
|
if (e.save(), e.fillStyle = l, o.includes("Arrow")) {
|
|
2201
2204
|
let t = a / 2;
|
|
2202
2205
|
e.beginPath(), n === s - 1 ? (e.moveTo(r + t, i), e.lineTo(r + a, i + a), e.lineTo(r, i + a)) : n === 0 ? (e.moveTo(r, i), e.lineTo(r + a, i), e.lineTo(r + t, i + a)) : (e.moveTo(r, i + a * .3), e.lineTo(r + a, i + t), e.lineTo(r, i + a * .7)), e.closePath(), e.fill();
|
|
2203
2206
|
} else o.includes("Flag") ? (e.beginPath(), e.moveTo(r, i), e.lineTo(r + a, i), e.lineTo(r, i + a), e.closePath(), e.fill()) : (e.beginPath(), e.arc(r + a / 2, i + a / 2, a / 2, 0, Math.PI * 2), e.fill());
|
|
2204
2207
|
e.restore();
|
|
2205
2208
|
}
|
|
2206
|
-
function
|
|
2209
|
+
function br(e, t, n, r, i) {
|
|
2207
2210
|
let a = Math.max(6, Math.round(Math.min(r, i) * .45)), o = t + r - a - 1, s = n + i - a - 1;
|
|
2208
2211
|
e.save(), e.fillStyle = "#D0D0D0", e.fillRect(o, s, a, a), e.fillStyle = "#444444";
|
|
2209
2212
|
let c = a * .55, l = o + (a - c) / 2, u = s + (a - c * .5) / 2;
|
|
2210
2213
|
e.beginPath(), e.moveTo(l, u), e.lineTo(l + c, u), e.lineTo(l + c / 2, u + c * .5), e.closePath(), e.fill(), e.restore();
|
|
2211
2214
|
}
|
|
2212
|
-
function
|
|
2215
|
+
function xr(e) {
|
|
2213
2216
|
let t = /* @__PURE__ */ new Map();
|
|
2214
2217
|
for (let n of e.tables ?? []) {
|
|
2215
2218
|
if (!n.styleName) continue;
|
|
@@ -2237,7 +2240,7 @@ function br(e) {
|
|
|
2237
2240
|
}
|
|
2238
2241
|
return t;
|
|
2239
2242
|
}
|
|
2240
|
-
function
|
|
2243
|
+
function Sr(e, t, n, r) {
|
|
2241
2244
|
let i = t?.border?.horizontal, a = t?.border?.top, o = t?.border?.bottom, s = t?.border?.left, c = t?.border?.right, l = n?.border?.bottom, u = n?.border?.top;
|
|
2242
2245
|
if (i || a || o || s || c || l || u) {
|
|
2243
2246
|
let t = {
|
|
@@ -2258,7 +2261,7 @@ function xr(e, t, n, r) {
|
|
|
2258
2261
|
topEdge: e.isTopEdge
|
|
2259
2262
|
};
|
|
2260
2263
|
}
|
|
2261
|
-
function
|
|
2264
|
+
function Cr(e) {
|
|
2262
2265
|
let t = /* @__PURE__ */ new Map();
|
|
2263
2266
|
for (let n of e.sparklineGroups ?? []) {
|
|
2264
2267
|
let e = Infinity, r = -Infinity;
|
|
@@ -2295,13 +2298,13 @@ function Sr(e) {
|
|
|
2295
2298
|
}
|
|
2296
2299
|
return t;
|
|
2297
2300
|
}
|
|
2298
|
-
function
|
|
2301
|
+
function wr(e) {
|
|
2299
2302
|
let t = e.replace("#", "");
|
|
2300
2303
|
if (t.length < 6) return "#F2F2F2";
|
|
2301
2304
|
let n = parseInt(t.slice(0, 2), 16), r = parseInt(t.slice(2, 4), 16), i = parseInt(t.slice(4, 6), 16), a = (e) => Math.round(e * .2 + 255 * .8), o = (e) => e.toString(16).padStart(2, "0").toUpperCase();
|
|
2302
2305
|
return `#${o(a(n))}${o(a(r))}${o(a(i))}`;
|
|
2303
2306
|
}
|
|
2304
|
-
function
|
|
2307
|
+
function Tr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
2305
2308
|
if (f <= 0 || p <= 0) return;
|
|
2306
2309
|
let { styles: m, cellMap: h, mergeAnchorMap: g, mergeSkipSet: _, cfContext: v, cs: y, dpr: b } = t, x = i.length, S = a.length, C = (e, n) => t.rtl ? An(e, n, t.canvasW) : e, w = [], T = -o;
|
|
2307
2310
|
for (let e = 0; e < x; e++) w.push(T), T += i[e];
|
|
@@ -2330,13 +2333,13 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2330
2333
|
}
|
|
2331
2334
|
let h = d.totalW, g = d.totalH;
|
|
2332
2335
|
f = C(f, h);
|
|
2333
|
-
let _ = `${a}:${u}`, T = t.cellMap.get(_), { font: D, fill: O, border: k, xf: j } =
|
|
2334
|
-
if (
|
|
2336
|
+
let _ = `${a}:${u}`, T = t.cellMap.get(_), { font: D, fill: O, border: k, xf: j } = er(m, T?.styleIndex ?? 0), M = fn(T, a, u, v, m.dxfs ?? []);
|
|
2337
|
+
if (Un(e, M.fill ?? O, f, p, h, g), M.dataBar && M.dataBar.ratio > 0) {
|
|
2335
2338
|
let t = Math.max(0, (h - 4) * M.dataBar.ratio);
|
|
2336
|
-
|
|
2339
|
+
Rn(e, M.dataBar.color, f + 2, p + 2, t, g - 4, M.dataBar.gradient);
|
|
2337
2340
|
}
|
|
2338
|
-
let N = Gr(
|
|
2339
|
-
if (A.push(() =>
|
|
2341
|
+
let N = Kr(Gr(k, a, u, d.right, d.bottom, t.cellMap, m), M.border);
|
|
2342
|
+
if (A.push(() => qr(e, N, f, p, h, g, b)), !T) continue;
|
|
2340
2343
|
let P = xt(T, m, M.numFmt, t.worksheet.date1904), F = P.text;
|
|
2341
2344
|
if (!F || F === "0" && t.worksheet.showZeros === !1) continue;
|
|
2342
2345
|
let ee = D.bold || !!M.fontBold, I = D.italic || !!M.fontItalic, L = D.underline || !!M.fontUnderline, z = D.strike || !!M.fontStrike, B = ee !== D.bold || I !== D.italic || L !== D.underline || z !== D.strike ? {
|
|
@@ -2346,7 +2349,7 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2346
2349
|
underline: L,
|
|
2347
2350
|
strike: z
|
|
2348
2351
|
} : D;
|
|
2349
|
-
e.font =
|
|
2352
|
+
e.font = Yn(B, y);
|
|
2350
2353
|
let V = t.hyperlinkMap.get(_) ? "#0563C1" : M.fontColor ?? P.color ?? D.color;
|
|
2351
2354
|
e.fillStyle = V ? R(V) : "#000000";
|
|
2352
2355
|
let H = T.value.type === "number", U = j.alignH ?? (H ? "right" : "left"), te = j.alignV ?? "bottom", W = j.indent ? Math.round(j.indent * 3 * t.mdw) : 0, ne = 3 + (U === "left" || !j.alignH ? W : 0);
|
|
@@ -2354,7 +2357,7 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2354
2357
|
let G;
|
|
2355
2358
|
U === "right" ? (G = f + h - 3, e.textAlign = "right") : U === "center" ? (G = f + h / 2, e.textAlign = "center") : (G = f + ne, e.textAlign = "left");
|
|
2356
2359
|
let re = T.value.type === "text" ? T.value.runs : void 0, ie = re && re.length > 0;
|
|
2357
|
-
if (j.wrapText && ie)
|
|
2360
|
+
if (j.wrapText && ie) mr(e, re, B, {
|
|
2358
2361
|
alignH: U,
|
|
2359
2362
|
alignV: te,
|
|
2360
2363
|
cx: f,
|
|
@@ -2369,10 +2372,10 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2369
2372
|
readingOrder: j.readingOrder
|
|
2370
2373
|
});
|
|
2371
2374
|
else if (j.wrapText) {
|
|
2372
|
-
let t =
|
|
2375
|
+
let t = tr(e, F, h - ne - 3), n = Jn(D.size, y, 1.2, D.name ?? void 0), r = t.length * n, i;
|
|
2373
2376
|
i = te === "top" ? p + 2 : te === "center" ? p + (g - r) / 2 : p + g - r - 2, e.textBaseline = "top";
|
|
2374
2377
|
for (let r = 0; r < t.length; r++) e.fillText(t[r], G, i + r * n);
|
|
2375
|
-
} else if (ie)
|
|
2378
|
+
} else if (ie) pr(e, re, B, {
|
|
2376
2379
|
alignH: U,
|
|
2377
2380
|
alignV: te,
|
|
2378
2381
|
cx: f,
|
|
@@ -2408,7 +2411,7 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2408
2411
|
let i = `${s}:${r + e}`;
|
|
2409
2412
|
if (!_.has(i) && !g.has(i)) {
|
|
2410
2413
|
let e = h.get(i);
|
|
2411
|
-
t =
|
|
2414
|
+
t = er(m, e?.styleIndex ?? 0).xf.alignH === "centerContinuous", n = !!(e && e.value && e.value.type !== "empty");
|
|
2412
2415
|
}
|
|
2413
2416
|
}
|
|
2414
2417
|
t ? n && P >= 0 && e > P ? (F(e), P = e) : P < 0 && (P = e) : F(e);
|
|
@@ -2418,10 +2421,10 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2418
2421
|
if (l + d <= u || l >= u + f) continue;
|
|
2419
2422
|
let p = `${s}:${a}`;
|
|
2420
2423
|
if (_.has(p)) continue;
|
|
2421
|
-
let E = g.get(p), P = E ? E.totalW : d, F = E ? E.totalH : T, I = C(l, P), L = h.get(p), { font: z, fill: B, border: V, xf: H } =
|
|
2422
|
-
if (
|
|
2424
|
+
let E = g.get(p), P = E ? E.totalW : d, F = E ? E.totalH : T, I = C(l, P), L = h.get(p), { font: z, fill: B, border: V, xf: H } = er(m, L?.styleIndex ?? 0), U = fn(L, s, a, v, m.dxfs ?? []), te = U.fill ?? B, W = t.tableStyleMap.get(p), ne = m.dxfs ?? [], G = (e) => e == null ? void 0 : ne[e], re = G(W?.wholeTableDxf), ie = G(W?.headerRowDxf), ae = G(W?.totalRowDxf), oe = G(W?.firstColumnDxf), se = G(W?.lastColumnDxf), ce = G(W?.stripeDxf), le = W?.isHeader && ie?.fill?.fgColor ? ie : W?.isTotals && ae?.fill?.fgColor ? ae : W?.isLastCol && se?.fill?.fgColor ? se : W?.isFirstCol && oe?.fill?.fgColor ? oe : ce?.fill?.fgColor ? ce : !W?.isHeader && !W?.isTotals && re?.fill?.fgColor ? re : void 0;
|
|
2425
|
+
if (Un(e, te, I, S, P, F) || (W && le?.fill?.fgColor ? (e.fillStyle = R(le.fill.fgColor), e.fillRect(I, S, P, F)) : W && !W.isCustom && W.isBanded && (e.fillStyle = wr(W.accent), e.fillRect(I, S, P, F))), t.commentCells.has(p) && Kn(e, I, S, P, F), U.dataBar && U.dataBar.ratio > 0) {
|
|
2423
2426
|
let t = Math.max(0, (P - 4) * U.dataBar.ratio);
|
|
2424
|
-
|
|
2427
|
+
Rn(e, U.dataBar.color, I + 2, S + 2, t, F - 4, U.dataBar.gradient);
|
|
2425
2428
|
}
|
|
2426
2429
|
let ue = t.sparklineMap.get(p);
|
|
2427
2430
|
if (ue && Oe(e, {
|
|
@@ -2445,26 +2448,26 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2445
2448
|
}
|
|
2446
2449
|
e.stroke();
|
|
2447
2450
|
}
|
|
2448
|
-
let K =
|
|
2451
|
+
let K = Kr(E ? Gr(V, s, a, E.right, E.bottom, h, m) : V, U.border);
|
|
2449
2452
|
(O.has(n) || M.has(n)) && (K = {
|
|
2450
2453
|
...K,
|
|
2451
2454
|
left: M.has(n) ? null : K.left,
|
|
2452
2455
|
right: O.has(n) ? null : K.right
|
|
2453
2456
|
});
|
|
2454
|
-
let de = h.get(`${s - 1}:${a}`), fe = de ?
|
|
2457
|
+
let de = h.get(`${s - 1}:${a}`), fe = de ? er(m, de.styleIndex ?? 0).border.bottom : null;
|
|
2455
2458
|
if (fe?.style && (o === 0 || K.top?.style) && (K = {
|
|
2456
2459
|
...K,
|
|
2457
|
-
top:
|
|
2460
|
+
top: Zr(K.top, fe)
|
|
2458
2461
|
}), !M.has(n)) {
|
|
2459
|
-
let e = h.get(`${s}:${a - 1}`), t = e ?
|
|
2462
|
+
let e = h.get(`${s}:${a - 1}`), t = e ? er(m, e.styleIndex ?? 0).border.right : null;
|
|
2460
2463
|
t?.style && (n === 0 || K.left?.style) && (K = {
|
|
2461
2464
|
...K,
|
|
2462
|
-
left:
|
|
2465
|
+
left: Zr(K.left, t)
|
|
2463
2466
|
});
|
|
2464
2467
|
}
|
|
2465
|
-
let q = W ?
|
|
2468
|
+
let q = W ? Sr(W, re, ie, a) : null, pe = t.autoFilterCells.has(p), me = () => {
|
|
2466
2469
|
if (q) {
|
|
2467
|
-
if (q.kind === "dxf")
|
|
2470
|
+
if (q.kind === "dxf") qr(e, q.border, I, S, P, F, b);
|
|
2468
2471
|
else if (q.kind === "accent") {
|
|
2469
2472
|
let t = .5 / b;
|
|
2470
2473
|
if (e.strokeStyle = q.color, e.lineWidth = q.lineWidth, e.beginPath(), e.moveTo(I, S + F - t), e.lineTo(I + P, S + F - t), q.topEdge) {
|
|
@@ -2474,15 +2477,15 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2474
2477
|
e.stroke();
|
|
2475
2478
|
}
|
|
2476
2479
|
}
|
|
2477
|
-
pe &&
|
|
2480
|
+
pe && br(e, I, S, d, F);
|
|
2478
2481
|
};
|
|
2479
2482
|
if (E) {
|
|
2480
2483
|
let t = K;
|
|
2481
|
-
A.push(() =>
|
|
2484
|
+
A.push(() => qr(e, t, I, S, P, F, b)), me();
|
|
2482
2485
|
} else {
|
|
2483
2486
|
let t = K;
|
|
2484
2487
|
j.push(() => {
|
|
2485
|
-
|
|
2488
|
+
qr(e, t, I, S, P, F, b), me();
|
|
2486
2489
|
});
|
|
2487
2490
|
}
|
|
2488
2491
|
if (!L) continue;
|
|
@@ -2495,7 +2498,7 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2495
2498
|
underline: d,
|
|
2496
2499
|
strike: f
|
|
2497
2500
|
} : z;
|
|
2498
|
-
e.font =
|
|
2501
|
+
e.font = Yn(v, y);
|
|
2499
2502
|
let C = t.hyperlinkMap.get(p), w = o?.font?.color ?? null, T = C ? "#0563C1" : U.fontColor ?? he.color ?? w ?? z.color;
|
|
2500
2503
|
e.fillStyle = T ? R(T) : "#000000";
|
|
2501
2504
|
let O = L.value.type === "number", k = H.alignH ?? (O ? "right" : "left"), A = H.alignV ?? "bottom", j = H.indent ? Math.round(H.indent * 3 * t.mdw) : 0, M = U.iconSet ? Math.max(8, Math.round(Math.min(P, F) * .55)) : 0, B = M > 0 ? M + 4 : 0, V = 3 + (k === "left" || !H.alignH ? j : 0) + B, te = P, ne = I, G = n;
|
|
@@ -2503,7 +2506,7 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2503
2506
|
let t = `${s}:${r + e}`;
|
|
2504
2507
|
if (_.has(t) || g.has(t)) break;
|
|
2505
2508
|
let n = h.get(t);
|
|
2506
|
-
if (n && n.value.type !== "empty" ||
|
|
2509
|
+
if (n && n.value.type !== "empty" || er(m, n?.styleIndex ?? 0).xf.alignH !== "centerContinuous") break;
|
|
2507
2510
|
te += i[e], G = e;
|
|
2508
2511
|
}
|
|
2509
2512
|
let le = k === "centerContinuous" ? ne : I, ue = k === "centerContinuous" ? te : P, K = J.includes("\n");
|
|
@@ -2548,8 +2551,8 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2548
2551
|
let q, pe;
|
|
2549
2552
|
k === "right" ? (q = I + P - 3, pe = "right") : k === "center" ? (q = I + P / 2, pe = "center") : k === "centerContinuous" ? (q = ne + te / 2, pe = "center") : k === "distributed" || k === "justify" && !H.wrapText && !K ? (q = I + 3, pe = "left") : (q = I + V, pe = "left");
|
|
2550
2553
|
let me = H.textRotation ?? 0, ge = me === 255, _e = me > 0 && me !== 255;
|
|
2551
|
-
if (U.iconSet && M > 0 && (e.save(), e.beginPath(), e.rect(I, S, P, F), e.clip(),
|
|
2552
|
-
let t =
|
|
2554
|
+
if (U.iconSet && M > 0 && (e.save(), e.beginPath(), e.rect(I, S, P, F), e.clip(), yr(e, U.iconSet.name, U.iconSet.index, I + 2, S + (F - M) / 2, M), e.restore()), e.save(), e.beginPath(), e.rect(le, S, ue, F), e.clip(), ge) {
|
|
2555
|
+
let t = Jn(z.size, y, 1.1), n = [...J].length * t, r = A === "top" ? S + 2 : A === "center" ? S + (F - n) / 2 : S + F - n - 2;
|
|
2553
2556
|
e.textAlign = "center", e.textBaseline = "top";
|
|
2554
2557
|
for (let n of J) {
|
|
2555
2558
|
let i = n.codePointAt(0) ?? 0, a = D(i) && ee(e, i);
|
|
@@ -2577,7 +2580,7 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2577
2580
|
e.direction = pn(H.readingOrder, J) ? "rtl" : "ltr";
|
|
2578
2581
|
} catch {}
|
|
2579
2582
|
let ve = L.value.type === "text" ? L.value.runs : void 0, ye = ve && ve.length > 0;
|
|
2580
|
-
if (H.wrapText && ye)
|
|
2583
|
+
if (H.wrapText && ye) mr(e, ve, v, {
|
|
2581
2584
|
alignH: k,
|
|
2582
2585
|
alignV: A,
|
|
2583
2586
|
cx: I,
|
|
@@ -2592,10 +2595,10 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2592
2595
|
readingOrder: H.readingOrder
|
|
2593
2596
|
});
|
|
2594
2597
|
else if (H.wrapText) {
|
|
2595
|
-
let t =
|
|
2598
|
+
let t = tr(e, J, P - V - 3), n = Jn(z.size, y, 1.2, z.name ?? void 0), r = t.length * n, i;
|
|
2596
2599
|
A === "top" ? (i = S + 2, e.textBaseline = "top") : A === "center" ? (i = S + (F - r) / 2, e.textBaseline = "top") : (i = S + F - r - 2, e.textBaseline = "top");
|
|
2597
2600
|
for (let r = 0; r < t.length; r++) e.fillText(t[r], q, i + r * n);
|
|
2598
|
-
} else if (ye)
|
|
2601
|
+
} else if (ye) pr(e, ve, v, {
|
|
2599
2602
|
alignH: k,
|
|
2600
2603
|
alignV: A,
|
|
2601
2604
|
cx: I,
|
|
@@ -2610,30 +2613,30 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2610
2613
|
readingOrder: H.readingOrder
|
|
2611
2614
|
});
|
|
2612
2615
|
else {
|
|
2613
|
-
let t = v.vertAlign, n =
|
|
2616
|
+
let t = v.vertAlign, n = Jn(z.size, y), r = 0;
|
|
2614
2617
|
t === "superscript" ? r = -Math.round(n * .35) : t === "subscript" && (r = Math.round(n * .1));
|
|
2615
2618
|
let i = t ? {
|
|
2616
2619
|
...v,
|
|
2617
2620
|
size: v.size * .65
|
|
2618
2621
|
} : v;
|
|
2619
|
-
t && (e.font =
|
|
2622
|
+
t && (e.font = Yn(i, y));
|
|
2620
2623
|
let a = null, o = () => a ??= e.measureText(J), s = () => {
|
|
2621
2624
|
let e = Math.min(o().width, ue - V - 3);
|
|
2622
2625
|
return {
|
|
2623
2626
|
x: k === "right" ? I + P - 3 - e : k === "center" ? I + P / 2 - e / 2 : I + V,
|
|
2624
2627
|
width: e
|
|
2625
2628
|
};
|
|
2626
|
-
}, c =
|
|
2629
|
+
}, c = Jn(i.size, y);
|
|
2627
2630
|
if (v.underline || C) {
|
|
2628
2631
|
let { x: t, width: n } = s(), i = (A === "top" ? S + 2 + c + 1 : A === "center" ? S + F / 2 + Math.round(c * .55) : S + F - 2 + 1) + r, a = C ? "#0563C1" : T ? R(T) : "#000000", o = v.underlineStyle === "double" || v.underlineStyle === "doubleAccounting";
|
|
2629
|
-
|
|
2632
|
+
Qn(e, t, t + n, i, a, o, b);
|
|
2630
2633
|
}
|
|
2631
2634
|
if (v.strike) {
|
|
2632
2635
|
let { x: t, width: n } = s(), i = (A === "top" ? S + 2 + Math.round(c * .5) : A === "center" ? S + F / 2 : S + F - 2 - Math.round(c * .35)) + r, a = i + N(i, .5, b);
|
|
2633
2636
|
e.save(), e.strokeStyle = T ? R(T) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(t, a), e.lineTo(t + n, a), e.stroke(), e.restore();
|
|
2634
2637
|
}
|
|
2635
2638
|
if (J.includes("\n")) {
|
|
2636
|
-
let t = J.split("\n"), n =
|
|
2639
|
+
let t = J.split("\n"), n = Jn(z.size, y, 1.2, z.name ?? void 0), i = t.length * n, a;
|
|
2637
2640
|
A === "top" ? (a = S + 2, e.textBaseline = "top") : A === "center" ? (a = S + (F - i) / 2, e.textBaseline = "top") : (a = S + F - i - 2, e.textBaseline = "top");
|
|
2638
2641
|
for (let i = 0; i < t.length; i++) e.fillText(t[i], q, a + i * n + r);
|
|
2639
2642
|
} else {
|
|
@@ -2643,10 +2646,10 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2643
2646
|
}
|
|
2644
2647
|
let be = L.value.type === "text" ? L.value.phoneticRuns : void 0;
|
|
2645
2648
|
if (L.showPhonetic && be && be.length > 0 && !J.includes("\n")) {
|
|
2646
|
-
let t =
|
|
2649
|
+
let t = Yn(v, y), n = Zn(e, J, t), r;
|
|
2647
2650
|
r = k === "right" ? I + P - 3 - n : k === "center" ? I + P / 2 - n / 2 : I + V;
|
|
2648
2651
|
let i = T ? R(T) : "#000000";
|
|
2649
|
-
|
|
2652
|
+
Xn(e, be, L.value.type === "text" ? L.value.phoneticPr : void 0, J, t, m, r, S, y, i);
|
|
2650
2653
|
}
|
|
2651
2654
|
e.restore(), J && t.onTextRun && t.onTextRun({
|
|
2652
2655
|
text: J,
|
|
@@ -2665,9 +2668,9 @@ function wr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2665
2668
|
for (let e of k) e();
|
|
2666
2669
|
e.restore();
|
|
2667
2670
|
}
|
|
2668
|
-
var
|
|
2669
|
-
function
|
|
2670
|
-
let t =
|
|
2671
|
+
var Er = /* @__PURE__ */ new WeakMap();
|
|
2672
|
+
function Dr(e) {
|
|
2673
|
+
let t = Er.get(e);
|
|
2671
2674
|
if (t) return t;
|
|
2672
2675
|
let n = /* @__PURE__ */ new Map();
|
|
2673
2676
|
for (let t of e.rows) for (let e of t.cells) n.set(`${e.row}:${e.col}`, e);
|
|
@@ -2682,7 +2685,7 @@ function Er(e) {
|
|
|
2682
2685
|
for (let t of e.hyperlinks ?? []) t.url && a.set(`${t.row}:${t.col}`, t.url);
|
|
2683
2686
|
let o = /* @__PURE__ */ new Set();
|
|
2684
2687
|
for (let t of e.commentRefs ?? []) {
|
|
2685
|
-
let e =
|
|
2688
|
+
let e = Gn(t);
|
|
2686
2689
|
e && o.add(`${e.row}:${e.col}`);
|
|
2687
2690
|
}
|
|
2688
2691
|
let s = {
|
|
@@ -2692,12 +2695,12 @@ function Er(e) {
|
|
|
2692
2695
|
autoFilterCells: i,
|
|
2693
2696
|
hyperlinkMap: a,
|
|
2694
2697
|
commentCells: o,
|
|
2695
|
-
tableStyleMap:
|
|
2696
|
-
sparklineMap:
|
|
2698
|
+
tableStyleMap: xr(e),
|
|
2699
|
+
sparklineMap: Cr(e)
|
|
2697
2700
|
};
|
|
2698
|
-
return
|
|
2701
|
+
return Er.set(e, s), s;
|
|
2699
2702
|
}
|
|
2700
|
-
function
|
|
2703
|
+
function Or(e, t, n, r, i = {}) {
|
|
2701
2704
|
let a = i.dpr ?? 1, o = i.cellScale ?? 1, s = Z(t), c = e.canvas.width / a, l = e.canvas.height / a;
|
|
2702
2705
|
e.clearRect(0, 0, c, l), e.fillStyle = "#ffffff", e.fillRect(0, 0, c, l);
|
|
2703
2706
|
let u = (e) => Math.round(e * o), d = u(50), f = u(22), { row: p, col: m, rows: h, cols: g } = r, _ = (i.scrollOffsetX ?? 0) * o, v = (i.scrollOffsetY ?? 0) * o, y = i.freezeRows ?? 0, b = i.freezeCols ?? 0, x = [];
|
|
@@ -2708,7 +2711,7 @@ function Dr(e, t, n, r, i = {}) {
|
|
|
2708
2711
|
for (let e = m; e < m + g; e++) T.push(u(Q(t.colWidths[e] ?? t.defaultColWidth, s)));
|
|
2709
2712
|
let E = [];
|
|
2710
2713
|
for (let e = p; e < p + h; e++) E.push(u($(t.rowHeights[e] ?? t.defaultRowHeight)));
|
|
2711
|
-
let { cellMap: D, cfContext: O, mergeSkipSet: k, autoFilterCells: A, hyperlinkMap: j, commentCells: M, tableStyleMap: P, sparklineMap: F } =
|
|
2714
|
+
let { cellMap: D, cfContext: O, mergeSkipSet: k, autoFilterCells: A, hyperlinkMap: j, commentCells: M, tableStyleMap: P, sparklineMap: F } = Dr(t), ee = /* @__PURE__ */ new Map();
|
|
2712
2715
|
for (let e of t.mergeCells ?? []) {
|
|
2713
2716
|
let n = 0;
|
|
2714
2717
|
for (let r = e.left; r <= e.right; r++) n += u(Q(t.colWidths[r] ?? t.defaultColWidth, s));
|
|
@@ -2748,20 +2751,20 @@ function Dr(e, t, n, r, i = {}) {
|
|
|
2748
2751
|
rtl: t.rightToLeft === !0,
|
|
2749
2752
|
canvasW: c
|
|
2750
2753
|
}, L = d, R = f, z = L + C, B = R + w, V = Math.max(0, c - z), H = Math.max(0, l - B);
|
|
2751
|
-
y > 0 && b > 0 &&
|
|
2754
|
+
y > 0 && b > 0 && Tr(e, I, 1, 1, x, S, 0, 0, L, R, L, R, C, w), y > 0 && Tr(e, I, 1, m, T, S, _, 0, z, R, z, R, V, w), b > 0 && Tr(e, I, p, 1, x, E, 0, v, L, B, L, B, C, H), Tr(e, I, p, m, T, E, _, v, z, B, z, B, V, H), t.images && t.images.length > 0 && i.loadedImages && Mr(e, t, i.loadedImages, o, p, m, _, v, z, B, V, H, t.rightToLeft === !0, c), t.shapeGroups && t.shapeGroups.length > 0 && Nr(e, t, o, p, m, _, v, z, B, V, H, i.loadedImages, t.rightToLeft === !0, c), t.charts && t.charts.length > 0 && Qr(e, t, o, p, m, _, v, z, B, V, H, t.rightToLeft === !0, c), t.slicers && t.slicers.length > 0 && di(e, t, o, p, m, _, v, z, B, V, H, t.rightToLeft === !0, c), kr(e, c, l, p, m, h, g, T, E, _, v, x, S, C, w, d, f, o, a, i.selectedRowRange ?? null, i.selectedColRange ?? null, t.rightToLeft === !0);
|
|
2752
2755
|
let U = t.rightToLeft === !0;
|
|
2753
2756
|
if (y > 0) {
|
|
2754
|
-
e.save(), e.strokeStyle =
|
|
2757
|
+
e.save(), e.strokeStyle = Mn, e.lineWidth = .5, e.beginPath();
|
|
2755
2758
|
let t = B + N(B, .5, a);
|
|
2756
2759
|
U ? (e.moveTo(0, t), e.lineTo(c - d, t)) : (e.moveTo(d, t), e.lineTo(c, t)), e.stroke(), e.restore();
|
|
2757
2760
|
}
|
|
2758
2761
|
if (b > 0) {
|
|
2759
|
-
e.save(), e.strokeStyle =
|
|
2762
|
+
e.save(), e.strokeStyle = Mn, e.lineWidth = .5, e.beginPath();
|
|
2760
2763
|
let t = U ? c - z : z, n = t + N(t, .5, a);
|
|
2761
2764
|
e.moveTo(n, f), e.lineTo(n, l), e.stroke(), e.restore();
|
|
2762
2765
|
}
|
|
2763
2766
|
}
|
|
2764
|
-
function
|
|
2767
|
+
function kr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x) {
|
|
2765
2768
|
let S = "#f8f9fa", C = "#e8eaed", w = "#caddf6", T = "#c8ccd0", E = "#5b9bd5", D = "#444", O = (e) => !b || e < b.start || e > b.end ? S : b.strong ? w : C, k = (e) => !b || e < b.start || e > b.end ? T : b.strong ? E : T, A = (e) => !y || e < y.start || e > y.end ? S : y.strong ? w : C, j = (e) => !y || e < y.start || e > y.end ? T : y.strong ? E : T, M = `${Math.max(1, Math.round(11 * _))}px ${Cn}`, P = h + p, F = g + m, ee = .5 / v, I = (e, n) => x ? An(e, n, t) : e, L = x ? t - h : 0;
|
|
2766
2769
|
e.fillStyle = S, e.fillRect(L, 0, h, g), e.strokeStyle = T, e.lineWidth = .5, e.beginPath();
|
|
2767
2770
|
let R = L + N(L, .5, v), z = N(0, .5, v);
|
|
@@ -2770,7 +2773,7 @@ function Or(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x) {
|
|
|
2770
2773
|
let i = I(n, r);
|
|
2771
2774
|
e.fillStyle = O(t), e.fillRect(i, 0, r, g), e.strokeStyle = k(t), e.lineWidth = .5, e.beginPath();
|
|
2772
2775
|
let a = i + N(i, .5, v), o = N(0, .5, v);
|
|
2773
|
-
e.moveTo(a, 0), e.lineTo(a, g), e.moveTo(i, g - ee), e.lineTo(i + r, g - ee), e.moveTo(i, o), e.lineTo(i + r, o), e.stroke(), e.fillStyle = D, e.textAlign = "center", e.textBaseline = "middle", e.fillText(
|
|
2776
|
+
e.moveTo(a, 0), e.lineTo(a, g), e.moveTo(i, g - ee), e.lineTo(i + r, g - ee), e.moveTo(i, o), e.lineTo(i + r, o), e.stroke(), e.fillStyle = D, e.textAlign = "center", e.textBaseline = "middle", e.fillText(hr(t), i + r / 2, g / 2);
|
|
2774
2777
|
}, V = (t, n, r) => {
|
|
2775
2778
|
let i = L;
|
|
2776
2779
|
e.fillStyle = A(t), e.fillRect(i, n, h, r), e.strokeStyle = j(t), e.lineWidth = .5, e.beginPath();
|
|
@@ -2805,59 +2808,63 @@ function Or(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x) {
|
|
|
2805
2808
|
}
|
|
2806
2809
|
e.restore();
|
|
2807
2810
|
}
|
|
2808
|
-
function
|
|
2811
|
+
function Ar(e, t, n) {
|
|
2809
2812
|
let r = Z(e), i = 0;
|
|
2810
2813
|
for (let a = 1; a < t; a++) i += Math.round(Q(e.colWidths[a] ?? e.defaultColWidth, r) * n);
|
|
2811
2814
|
return i;
|
|
2812
2815
|
}
|
|
2813
|
-
function
|
|
2816
|
+
function jr(e, t, n) {
|
|
2814
2817
|
let r = 0;
|
|
2815
2818
|
for (let i = 1; i < t; i++) r += Math.round($(e.rowHeights[i] ?? e.defaultRowHeight) * n);
|
|
2816
2819
|
return r;
|
|
2817
2820
|
}
|
|
2818
|
-
function
|
|
2821
|
+
function Mr(n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
2819
2822
|
if (f <= 0 || p <= 0) return;
|
|
2820
|
-
let
|
|
2821
|
-
n.save(), n.beginPath()
|
|
2823
|
+
let g = Ar(r, s, a), _ = jr(r, o, a);
|
|
2824
|
+
n.save(), n.beginPath();
|
|
2825
|
+
let v = jn(u, f, h, m);
|
|
2826
|
+
n.rect(v, d, f, p), n.clip();
|
|
2822
2827
|
for (let o of r.images) {
|
|
2823
2828
|
let s = i.get(bn(o.imagePath, o.duotone));
|
|
2824
2829
|
if (!s) continue;
|
|
2825
|
-
let
|
|
2826
|
-
if (o.editAs === "oneCell" && o.nativeExtCx > 0 && o.nativeExtCy > 0)
|
|
2830
|
+
let y = o.fromCol + 1, b = o.fromRow + 1, x = Ar(r, y, a) + o.fromColOff * a / t, S = jr(r, b, a) + o.fromRowOff * a / t, C, w;
|
|
2831
|
+
if (o.editAs === "oneCell" && o.nativeExtCx > 0 && o.nativeExtCy > 0) C = o.nativeExtCx * a / t, w = o.nativeExtCy * a / t;
|
|
2827
2832
|
else {
|
|
2828
|
-
let e = o.toCol + 1, n = o.toRow + 1, i =
|
|
2829
|
-
|
|
2833
|
+
let e = o.toCol + 1, n = o.toRow + 1, i = Ar(r, e, a) + o.toColOff * a / t, s = jr(r, n, a) + o.toRowOff * a / t;
|
|
2834
|
+
C = i - x, w = s - S;
|
|
2830
2835
|
}
|
|
2831
|
-
if (
|
|
2832
|
-
let
|
|
2833
|
-
|
|
2836
|
+
if (C <= 0 || w <= 0) continue;
|
|
2837
|
+
let T = jn(u + (x - g) - c, C, h, m), E = d + (S - _) - l;
|
|
2838
|
+
T + C < v || T > v + f || E + w < d || E > d + p || (o.alpha != null && o.alpha < 1 ? (n.save(), n.globalAlpha = o.alpha, e(n, s, o.srcRect, T, E, C, w), n.restore()) : e(n, s, o.srcRect, T, E, C, w));
|
|
2834
2839
|
}
|
|
2835
2840
|
n.restore();
|
|
2836
2841
|
}
|
|
2837
|
-
function
|
|
2842
|
+
function Nr(e, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
2838
2843
|
if (u <= 0 || d <= 0) return;
|
|
2839
|
-
let
|
|
2840
|
-
if (!
|
|
2841
|
-
let
|
|
2842
|
-
e.save(), e.beginPath()
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2844
|
+
let h = n.shapeGroups;
|
|
2845
|
+
if (!h || h.length === 0) return;
|
|
2846
|
+
let g = Ar(n, a, r), _ = jr(n, i, r);
|
|
2847
|
+
e.save(), e.beginPath();
|
|
2848
|
+
let v = jn(c, u, m, p);
|
|
2849
|
+
e.rect(v, l, u, d), e.clip();
|
|
2850
|
+
for (let i of h) {
|
|
2851
|
+
let a = i.fromCol + 1, h = i.fromRow + 1, y = Ar(n, a, r) + i.fromColOff * r / t, b = jr(n, h, r) + i.fromRowOff * r / t, x, S;
|
|
2852
|
+
if (i.editAs === "oneCell" && i.nativeExtCx > 0 && i.nativeExtCy > 0) x = i.nativeExtCx * r / t, S = i.nativeExtCy * r / t;
|
|
2846
2853
|
else {
|
|
2847
|
-
let e = i.toCol + 1, a = i.toRow + 1, o =
|
|
2848
|
-
|
|
2854
|
+
let e = i.toCol + 1, a = i.toRow + 1, o = Ar(n, e, r) + i.toColOff * r / t, s = jr(n, a, r) + i.toRowOff * r / t;
|
|
2855
|
+
x = o - y, S = s - b;
|
|
2849
2856
|
}
|
|
2850
|
-
if (
|
|
2851
|
-
let
|
|
2852
|
-
if (!(
|
|
2853
|
-
let n =
|
|
2854
|
-
a <= 0 || o <= 0 ||
|
|
2857
|
+
if (x <= 0 || S <= 0) continue;
|
|
2858
|
+
let C = jn(c + (y - g) - o, x, m, p), w = l + (b - _) - s;
|
|
2859
|
+
if (!(C + x < v || C > v + u) && !(w + S < l || w > l + d)) for (let t of i.shapes) {
|
|
2860
|
+
let n = C + t.x * x, i = w + t.y * S, a = t.w * x, o = t.h * S;
|
|
2861
|
+
a <= 0 || o <= 0 || Pr(e, t, n, i, a, o, r, f);
|
|
2855
2862
|
}
|
|
2856
2863
|
}
|
|
2857
2864
|
e.restore();
|
|
2858
2865
|
}
|
|
2859
|
-
function
|
|
2860
|
-
if (n.save(), r.rot
|
|
2866
|
+
function Pr(n, r, i, a, o, s, c, l) {
|
|
2867
|
+
if (n.save(), r.rot !== 0 || r.flipH || r.flipV ? (n.translate(i + o / 2, a + s / 2), n.rotate(r.rot * Math.PI / 180), n.scale(r.flipH ? -1 : 1, r.flipV ? -1 : 1), n.translate(-o / 2, -s / 2)) : n.translate(i, a), r.geom.type === "custom") for (let e of r.geom.paths) {
|
|
2861
2868
|
if (e.w <= 0 || e.h <= 0) continue;
|
|
2862
2869
|
let t = o / e.w, i = s / e.h;
|
|
2863
2870
|
n.beginPath();
|
|
@@ -2894,13 +2901,13 @@ function Nr(n, r, i, a, o, s, c, l) {
|
|
|
2894
2901
|
n.closePath(), a = l, c = u;
|
|
2895
2902
|
break;
|
|
2896
2903
|
}
|
|
2897
|
-
|
|
2904
|
+
Wr(n, r);
|
|
2898
2905
|
}
|
|
2899
2906
|
else if (r.geom.type === "preset") {
|
|
2900
2907
|
let e = r.fillColor ?? null, i = r.strokeColor && r.strokeWidth > 0 ? () => {
|
|
2901
2908
|
n.strokeStyle = r.strokeColor, n.lineWidth = Math.max(.5, r.strokeWidth / t), n.stroke();
|
|
2902
2909
|
} : null;
|
|
2903
|
-
K(n, r.geom.name, 0, 0, o, s, r.geom.adj ?? [], e, i, () => {}) || (n.beginPath(), n.rect(0, 0, o, s),
|
|
2910
|
+
K(n, r.geom.name, 0, 0, o, s, r.geom.adj ?? [], e, i, () => {}) || (n.beginPath(), n.rect(0, 0, o, s), Wr(n, r));
|
|
2904
2911
|
} else if (r.geom.type === "image") {
|
|
2905
2912
|
let t = l?.get(bn(r.geom.imagePath, r.geom.duotone));
|
|
2906
2913
|
if (t) {
|
|
@@ -2908,10 +2915,10 @@ function Nr(n, r, i, a, o, s, c, l) {
|
|
|
2908
2915
|
i != null && i < 1 ? (n.save(), n.globalAlpha = i, e(n, t, r.geom.srcRect, 0, 0, o, s), n.restore()) : e(n, t, r.geom.srcRect, 0, 0, o, s);
|
|
2909
2916
|
}
|
|
2910
2917
|
}
|
|
2911
|
-
r.text &&
|
|
2918
|
+
r.text && Ur(n, r.text, o, s, c), n.restore();
|
|
2912
2919
|
}
|
|
2913
|
-
var
|
|
2914
|
-
function
|
|
2920
|
+
var Fr = /* @__PURE__ */ new WeakMap();
|
|
2921
|
+
function Ir(e, t) {
|
|
2915
2922
|
let n = e.tinted.get(t);
|
|
2916
2923
|
if (n) return n;
|
|
2917
2924
|
let r = e.img.naturalWidth || 1, i = e.img.naturalHeight || 1, a = document.createElement("canvas");
|
|
@@ -2919,18 +2926,18 @@ function Fr(e, t) {
|
|
|
2919
2926
|
let o = a.getContext("2d");
|
|
2920
2927
|
return o ? (o.drawImage(e.img, 0, 0, r, i), o.globalCompositeOperation = "source-in", o.fillStyle = t, o.fillRect(0, 0, r, i), e.tinted.set(t, a), a) : e.img;
|
|
2921
2928
|
}
|
|
2922
|
-
function
|
|
2929
|
+
function Lr(e) {
|
|
2923
2930
|
let t = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`, n = new Image();
|
|
2924
2931
|
return new Promise((e, r) => {
|
|
2925
2932
|
n.onload = () => e(n), n.onerror = r, n.src = t;
|
|
2926
2933
|
});
|
|
2927
2934
|
}
|
|
2928
|
-
var
|
|
2929
|
-
function
|
|
2930
|
-
let r = Math.max(1, Math.round(t *
|
|
2935
|
+
var Rr = 256;
|
|
2936
|
+
function zr(e, t, n) {
|
|
2937
|
+
let r = Math.max(1, Math.round(t * Rr)), i = Math.max(1, Math.round(n * Rr));
|
|
2931
2938
|
return e.replace(/<svg([^>]*?)>/, (e, t) => `<svg${t.replace(/\s(?:width|height)="[^"]*"/g, "")} width="${r}" height="${i}">`);
|
|
2932
2939
|
}
|
|
2933
|
-
function
|
|
2940
|
+
function Br(e) {
|
|
2934
2941
|
let t = [];
|
|
2935
2942
|
for (let n of e.shapeGroups ?? []) for (let e of n.shapes) for (let n of e.text?.paragraphs ?? []) for (let e of n.runs) e.type === "math" && t.push({
|
|
2936
2943
|
nodes: e.nodes,
|
|
@@ -2938,17 +2945,17 @@ function zr(e) {
|
|
|
2938
2945
|
});
|
|
2939
2946
|
return t;
|
|
2940
2947
|
}
|
|
2941
|
-
function
|
|
2942
|
-
for (let t of e.shapeGroups ?? []) for (let e of t.shapes) for (let t of e.text?.paragraphs ?? []) for (let e of t.runs) if (e.type === "math" && !
|
|
2948
|
+
function Vr(e) {
|
|
2949
|
+
for (let t of e.shapeGroups ?? []) for (let e of t.shapes) for (let t of e.text?.paragraphs ?? []) for (let e of t.runs) if (e.type === "math" && !Fr.has(e.nodes)) return !0;
|
|
2943
2950
|
return !1;
|
|
2944
2951
|
}
|
|
2945
|
-
async function
|
|
2946
|
-
let n =
|
|
2952
|
+
async function Hr(e, t) {
|
|
2953
|
+
let n = Br(e).filter((e) => !Fr.has(e.nodes));
|
|
2947
2954
|
if (n.length !== 0) {
|
|
2948
2955
|
await t.loadMathJax();
|
|
2949
|
-
for (let e of n) if (!
|
|
2950
|
-
let n = await t.mathMLToSvg(de(e.nodes, e.display)), r = await
|
|
2951
|
-
|
|
2956
|
+
for (let e of n) if (!Fr.has(e.nodes)) try {
|
|
2957
|
+
let n = await t.mathMLToSvg(de(e.nodes, e.display)), r = await Lr(zr(Ee(n.svg, "#000000"), n.widthEm, n.ascentEm + n.descentEm));
|
|
2958
|
+
Fr.set(e.nodes, {
|
|
2952
2959
|
img: r,
|
|
2953
2960
|
widthEm: n.widthEm,
|
|
2954
2961
|
ascentEm: n.ascentEm,
|
|
@@ -2958,7 +2965,7 @@ async function Vr(e, t) {
|
|
|
2958
2965
|
} catch {}
|
|
2959
2966
|
}
|
|
2960
2967
|
}
|
|
2961
|
-
function
|
|
2968
|
+
function Ur(e, n, r, i, a) {
|
|
2962
2969
|
if (r <= 0 || i <= 0 || n.paragraphs.length === 0) return;
|
|
2963
2970
|
let o = n.lIns / t * a, s = n.rIns / t * a, c = n.tIns / t * a, l = n.bIns / t * a, u = Math.max(0, r - o - s), d = Math.max(0, i - c - l);
|
|
2964
2971
|
if (u <= 0 || d <= 0) return;
|
|
@@ -2999,7 +3006,7 @@ function Hr(e, n, r, i, a) {
|
|
|
2999
3006
|
continue;
|
|
3000
3007
|
}
|
|
3001
3008
|
if (t.type === "math") {
|
|
3002
|
-
let e =
|
|
3009
|
+
let e = Fr.get(t.nodes);
|
|
3003
3010
|
if (!e) continue;
|
|
3004
3011
|
let n = (t.fontSize ?? (E || On)) * G * a, r = e.widthEm * n, s = e.ascentEm * n, c = e.descentEm * n, l = t.color ?? "#000000";
|
|
3005
3012
|
if (t.display) {
|
|
@@ -3092,7 +3099,7 @@ function Hr(e, n, r, i, a) {
|
|
|
3092
3099
|
for (let r of t.segs) {
|
|
3093
3100
|
if (r.kind === "text") e.font = r.font, e.fillStyle = r.color, e.fillText(r.text, i, n);
|
|
3094
3101
|
else {
|
|
3095
|
-
let t =
|
|
3102
|
+
let t = Ir(r.render, r.color);
|
|
3096
3103
|
e.drawImage(t, i, n - r.ascent, r.w, r.ascent + r.descent);
|
|
3097
3104
|
}
|
|
3098
3105
|
i += r.w;
|
|
@@ -3105,15 +3112,15 @@ function Hr(e, n, r, i, a) {
|
|
|
3105
3112
|
v += t.height;
|
|
3106
3113
|
}
|
|
3107
3114
|
}
|
|
3108
|
-
function
|
|
3115
|
+
function Wr(e, n) {
|
|
3109
3116
|
n.fillColor && (e.fillStyle = n.fillColor, e.fill()), n.strokeColor && n.strokeWidth > 0 && (e.strokeStyle = n.strokeColor, e.lineWidth = Math.max(.5, n.strokeWidth / t), e.stroke());
|
|
3110
3117
|
}
|
|
3111
|
-
function
|
|
3118
|
+
function Gr(e, t, n, r, i, a, o) {
|
|
3112
3119
|
if (r === n && i === t) return e;
|
|
3113
3120
|
let s = (e, r) => {
|
|
3114
3121
|
if (e === t && r === n) return null;
|
|
3115
3122
|
let i = a.get(`${e}:${r}`);
|
|
3116
|
-
return i ?
|
|
3123
|
+
return i ? er(o, i.styleIndex ?? 0).border : null;
|
|
3117
3124
|
}, c = s(t, r), l = s(i, n), u = s(i, r), d = (e, ...t) => {
|
|
3118
3125
|
if (e?.style) return e;
|
|
3119
3126
|
for (let e of t) if (e?.style) return e;
|
|
@@ -3128,7 +3135,7 @@ function Wr(e, t, n, r, i, a, o) {
|
|
|
3128
3135
|
diagonalDown: e.diagonalDown ?? null
|
|
3129
3136
|
};
|
|
3130
3137
|
}
|
|
3131
|
-
function
|
|
3138
|
+
function Kr(e, t) {
|
|
3132
3139
|
if (!t) return e;
|
|
3133
3140
|
let n = (e, t) => t && t.style ? t : e ?? null;
|
|
3134
3141
|
return {
|
|
@@ -3140,7 +3147,7 @@ function Gr(e, t) {
|
|
|
3140
3147
|
diagonalDown: n(e.diagonalDown, t.diagonalDown)
|
|
3141
3148
|
};
|
|
3142
3149
|
}
|
|
3143
|
-
function
|
|
3150
|
+
function qr(e, t, n, r, i, a, o = 1) {
|
|
3144
3151
|
let s = [
|
|
3145
3152
|
{
|
|
3146
3153
|
edge: t.top,
|
|
@@ -3212,15 +3219,15 @@ function Kr(e, t, n, r, i, a, o = 1) {
|
|
|
3212
3219
|
continue;
|
|
3213
3220
|
}
|
|
3214
3221
|
e.beginPath(), e.strokeStyle = s;
|
|
3215
|
-
let p =
|
|
3222
|
+
let p = Jr(t.style);
|
|
3216
3223
|
e.lineWidth = p;
|
|
3217
|
-
let m =
|
|
3224
|
+
let m = Yr(t.style);
|
|
3218
3225
|
e.setLineDash(m);
|
|
3219
3226
|
let h = f === "v" ? N(c, p, o) : 0, g = f === "h" ? N(l, p, o) : 0;
|
|
3220
3227
|
e.moveTo(c + h, l + g), e.lineTo(u + h, d + g), e.stroke(), e.setLineDash([]);
|
|
3221
3228
|
}
|
|
3222
3229
|
}
|
|
3223
|
-
function
|
|
3230
|
+
function Jr(e) {
|
|
3224
3231
|
switch (e) {
|
|
3225
3232
|
case "thick": return 3;
|
|
3226
3233
|
case "medium":
|
|
@@ -3232,10 +3239,10 @@ function qr(e) {
|
|
|
3232
3239
|
default: return 1;
|
|
3233
3240
|
}
|
|
3234
3241
|
}
|
|
3235
|
-
function
|
|
3242
|
+
function Yr(e) {
|
|
3236
3243
|
return ge(e);
|
|
3237
3244
|
}
|
|
3238
|
-
function
|
|
3245
|
+
function Xr(e) {
|
|
3239
3246
|
switch (e) {
|
|
3240
3247
|
case "double": return 13;
|
|
3241
3248
|
case "thick": return 12;
|
|
@@ -3253,62 +3260,62 @@ function Yr(e) {
|
|
|
3253
3260
|
default: return 0;
|
|
3254
3261
|
}
|
|
3255
3262
|
}
|
|
3256
|
-
function
|
|
3257
|
-
let n =
|
|
3263
|
+
function Zr(e, t) {
|
|
3264
|
+
let n = Xr(e?.style), r = Xr(t?.style);
|
|
3258
3265
|
return n === 0 && r === 0 ? null : n >= r ? e ?? null : t ?? null;
|
|
3259
3266
|
}
|
|
3260
|
-
function
|
|
3267
|
+
function Qr(e, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
3261
3268
|
if (u <= 0 || d <= 0) return;
|
|
3262
|
-
let
|
|
3269
|
+
let m = Ar(n, a, r), h = jr(n, i, r), g = jn(c, u, p, f);
|
|
3263
3270
|
for (let i of n.charts) {
|
|
3264
|
-
let a = i.fromCol + 1,
|
|
3265
|
-
if (
|
|
3266
|
-
let
|
|
3267
|
-
if (
|
|
3268
|
-
e.save(), e.beginPath(), e.rect(
|
|
3269
|
-
let
|
|
3271
|
+
let a = i.fromCol + 1, _ = i.fromRow + 1, v = i.toCol + 1, y = i.toRow + 1, b = Ar(n, a, r) + i.fromColOff * r / t, x = jr(n, _, r) + i.fromRowOff * r / t, S = Ar(n, v, r) + i.toColOff * r / t, C = jr(n, y, r) + i.toRowOff * r / t, w = S - b, T = C - x;
|
|
3272
|
+
if (w <= 0 || T <= 0) continue;
|
|
3273
|
+
let E = jn(c + (b - m) - o, w, p, f), D = l + (x - h) - s;
|
|
3274
|
+
if (E + w < g || E > g + u || D + T < l || D > l + d) continue;
|
|
3275
|
+
e.save(), e.beginPath(), e.rect(g, l, u, d), e.clip();
|
|
3276
|
+
let O = G * r;
|
|
3270
3277
|
I(e, i.chart, {
|
|
3271
|
-
x:
|
|
3272
|
-
y:
|
|
3273
|
-
w
|
|
3274
|
-
h:
|
|
3275
|
-
},
|
|
3278
|
+
x: E,
|
|
3279
|
+
y: D,
|
|
3280
|
+
w,
|
|
3281
|
+
h: T
|
|
3282
|
+
}, O), e.restore();
|
|
3276
3283
|
}
|
|
3277
3284
|
}
|
|
3278
|
-
var
|
|
3279
|
-
function
|
|
3285
|
+
var $r = "600 12px \"Meiryo UI\", \"Segoe UI\", sans-serif", ei = "11px \"Meiryo UI\", \"Segoe UI\", sans-serif", ti = "#FFFFFF", ni = "#BFBFBF", ri = "#F2F2F2", ii = "#404040", ai = "#FFFFFF", oi = "#000000", si = "#A5A5A5", ci = "#E7E6E6", li = "#A6A6A6", ui = "#C6C6C6";
|
|
3286
|
+
function di(e, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
3280
3287
|
if (u <= 0 || d <= 0) return;
|
|
3281
|
-
let
|
|
3282
|
-
if (!
|
|
3283
|
-
let
|
|
3284
|
-
for (let i of
|
|
3285
|
-
let a = i.fromCol + 1,
|
|
3286
|
-
if (
|
|
3287
|
-
let
|
|
3288
|
-
|
|
3289
|
-
}
|
|
3290
|
-
}
|
|
3291
|
-
function
|
|
3292
|
-
e.fillStyle =
|
|
3288
|
+
let m = n.slicers;
|
|
3289
|
+
if (!m) return;
|
|
3290
|
+
let h = Ar(n, a, r), g = jr(n, i, r), _ = jn(c, u, p, f);
|
|
3291
|
+
for (let i of m) {
|
|
3292
|
+
let a = i.fromCol + 1, m = i.fromRow + 1, v = i.toCol + 1, y = i.toRow + 1, b = Ar(n, a, r) + i.fromColOff * r / t, x = jr(n, m, r) + i.fromRowOff * r / t, S = Ar(n, v, r) + i.toColOff * r / t, C = jr(n, y, r) + i.toRowOff * r / t, w = S - b, T = C - x;
|
|
3293
|
+
if (w <= 0 || T <= 0) continue;
|
|
3294
|
+
let E = jn(c + (b - h) - o, w, p, f), D = l + (x - g) - s;
|
|
3295
|
+
E + w < _ || E > _ + u || D + T < l || D > l + d || (e.save(), e.beginPath(), e.rect(_, l, u, d), e.clip(), fi(e, i.caption, i.items, E, D, w, T, r), e.restore());
|
|
3296
|
+
}
|
|
3297
|
+
}
|
|
3298
|
+
function fi(e, t, n, r, i, a, o, s) {
|
|
3299
|
+
e.fillStyle = ti, e.fillRect(r, i, a, o), e.strokeStyle = ni, e.lineWidth = 1, e.strokeRect(r + .5, i + .5, a - 1, o - 1);
|
|
3293
3300
|
let c = Math.max(20 * s, 14);
|
|
3294
|
-
e.fillStyle =
|
|
3301
|
+
e.fillStyle = ri, e.fillRect(r + 1, i + 1, a - 2, c), e.fillStyle = ii, e.font = pi($r, s), e.textBaseline = "middle", e.textAlign = "left";
|
|
3295
3302
|
let l = 6 * s;
|
|
3296
|
-
if (
|
|
3303
|
+
if (mi(e, t, r + l, i + c / 2 + 1, a - 2 * l), n.length === 0) return;
|
|
3297
3304
|
let u = Math.max(1, Math.round(2 * s)), d = 4 * s, f = r + d, p = i + c + d, m = a - 2 * d, h = o - c - 2 * d;
|
|
3298
3305
|
if (m <= 0 || h <= 0) return;
|
|
3299
3306
|
let g = Math.max(18 * s, 16), _ = Math.max(1, Math.floor((h + u) / (g + u))), v = Math.min(n.length, _), y = Math.min(g, (h - u * (v - 1)) / v);
|
|
3300
3307
|
if (y <= 0) return;
|
|
3301
|
-
e.font =
|
|
3308
|
+
e.font = pi(ei, s);
|
|
3302
3309
|
let b = 8 * s;
|
|
3303
3310
|
for (let t = 0; t < v; t++) {
|
|
3304
3311
|
let r = n[t], i = p + t * (y + u), a = r.selected;
|
|
3305
|
-
e.fillStyle = a ?
|
|
3312
|
+
e.fillStyle = a ? ai : ci, e.fillRect(f, i, m, y), e.strokeStyle = a ? si : ui, e.lineWidth = 1, e.strokeRect(f + .5, i + .5, m - 1, y - 1), e.fillStyle = a ? oi : li, mi(e, r.name, f + b, i + y / 2 + 1, m - 2 * b);
|
|
3306
3313
|
}
|
|
3307
3314
|
}
|
|
3308
|
-
function
|
|
3315
|
+
function pi(e, t) {
|
|
3309
3316
|
return e.replace(/(\d+(?:\.\d+)?)px/, (e, n) => `${Math.round(Number(n) * t)}px`);
|
|
3310
3317
|
}
|
|
3311
|
-
function
|
|
3318
|
+
function mi(e, t, n, r, i) {
|
|
3312
3319
|
if (i <= 0) return;
|
|
3313
3320
|
let a = t;
|
|
3314
3321
|
if (e.measureText(a).width > i) {
|
|
@@ -3319,7 +3326,7 @@ function pi(e, t, n, r, i) {
|
|
|
3319
3326
|
}
|
|
3320
3327
|
//#endregion
|
|
3321
3328
|
//#region packages/xlsx/src/render-orchestrator.ts
|
|
3322
|
-
async function
|
|
3329
|
+
async function hi(e, t, n, r, i = 0, a = 0, o = null, s = null, c) {
|
|
3323
3330
|
let l = t === "image/svg+xml", u = me(t, o, i, a), d = () => xe(e, t, s, r, {
|
|
3324
3331
|
widthPt: u.widthPt,
|
|
3325
3332
|
heightPt: u.heightPt,
|
|
@@ -3335,7 +3342,7 @@ async function mi(e, t, n, r, i = 0, a = 0, o = null, s = null, c) {
|
|
|
3335
3342
|
}
|
|
3336
3343
|
return l ? ae(e, r) : d();
|
|
3337
3344
|
}
|
|
3338
|
-
async function
|
|
3345
|
+
async function gi(e, t, n, r) {
|
|
3339
3346
|
if (!n) return;
|
|
3340
3347
|
let i = n, a = /* @__PURE__ */ new Map();
|
|
3341
3348
|
if (e.images) for (let t of e.images) a.set(bn(t.imagePath, t.duotone), {
|
|
@@ -3358,24 +3365,24 @@ async function hi(e, t, n, r) {
|
|
|
3358
3365
|
});
|
|
3359
3366
|
a.size !== 0 && await Promise.all([...a.entries()].map(async ([e, n]) => {
|
|
3360
3367
|
try {
|
|
3361
|
-
let a = await
|
|
3368
|
+
let a = await hi(n.imagePath, n.mimeType, n.svgImagePath, i, n.widthPt, n.heightPt, n.srcRect, n.duotone, r?.offscreenFactory);
|
|
3362
3369
|
t.set(e, a);
|
|
3363
3370
|
} catch {
|
|
3364
3371
|
t.delete(e);
|
|
3365
3372
|
}
|
|
3366
3373
|
}));
|
|
3367
3374
|
}
|
|
3368
|
-
async function
|
|
3375
|
+
async function _i(e, t, n, r = {}) {
|
|
3369
3376
|
let i = r.fetchImage ? ce(r.fetchImage) : void 0;
|
|
3370
3377
|
try {
|
|
3371
|
-
await
|
|
3378
|
+
await vi(e, t, n, r);
|
|
3372
3379
|
} finally {
|
|
3373
3380
|
i?.();
|
|
3374
3381
|
}
|
|
3375
3382
|
}
|
|
3376
|
-
async function
|
|
3383
|
+
async function vi(e, t, n, r = {}) {
|
|
3377
3384
|
let { ws: i, styles: a, imageCache: o } = e;
|
|
3378
|
-
await
|
|
3385
|
+
await gi(i, o, r.fetchImage), e.math && Vr(i) && await Hr(i, e.math);
|
|
3379
3386
|
let s = r.dpr ?? l(), c = g(t) ? t.clientWidth || 800 : t.width, u = g(t) ? t.clientHeight || 600 : t.height, d = r.width ?? c, f = r.height ?? u, p = A(d * s, f * s), m = p.clamped ? s * p.scale : s, h = p.width, _ = p.height;
|
|
3380
3387
|
if (t.width !== h && (t.width = h), t.height !== _ && (t.height = _), g(t)) {
|
|
3381
3388
|
let e = `${d}px`, n = `${f}px`;
|
|
@@ -3383,16 +3390,16 @@ async function _i(e, t, n, r = {}) {
|
|
|
3383
3390
|
}
|
|
3384
3391
|
let v = t.getContext("2d");
|
|
3385
3392
|
if (v.setTransform(m, 0, 0, m, 0, 0), i.parseError) {
|
|
3386
|
-
|
|
3393
|
+
yi(v, d, f, i.name, i.parseError);
|
|
3387
3394
|
return;
|
|
3388
3395
|
}
|
|
3389
|
-
|
|
3396
|
+
Or(v, i, a, n, {
|
|
3390
3397
|
...r,
|
|
3391
3398
|
dpr: m,
|
|
3392
3399
|
loadedImages: o
|
|
3393
3400
|
});
|
|
3394
3401
|
}
|
|
3395
|
-
function
|
|
3402
|
+
function yi(e, t, n, r, i) {
|
|
3396
3403
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
3397
3404
|
let a = t / 2, o = Math.min(t, n), s = Math.max(20, o * .1);
|
|
3398
3405
|
e.fillStyle = "#b23b3b", e.textAlign = "center", e.textBaseline = "middle", e.font = `${s}px sans-serif`, e.fillText("⚠", a, n * .32);
|
|
@@ -3412,23 +3419,23 @@ function vi(e, t, n, r, i) {
|
|
|
3412
3419
|
}
|
|
3413
3420
|
//#endregion
|
|
3414
3421
|
//#region packages/xlsx/src/google-fonts.ts
|
|
3415
|
-
var
|
|
3422
|
+
var bi = {
|
|
3416
3423
|
...r,
|
|
3417
3424
|
...E
|
|
3418
3425
|
};
|
|
3419
|
-
function*
|
|
3426
|
+
function* xi(e) {
|
|
3420
3427
|
for (let t of e?.sharedStrings ?? []) if (t.runs && t.runs.length > 0) for (let e of t.runs) yield e.text;
|
|
3421
3428
|
else yield t.text;
|
|
3422
3429
|
}
|
|
3423
|
-
function
|
|
3430
|
+
function Si(e) {
|
|
3424
3431
|
let t = /* @__PURE__ */ new Set(), n = null;
|
|
3425
3432
|
for (let r of e?.styles?.fonts ?? []) r.name && (t.add(r.name), n ??= p(r.name));
|
|
3426
|
-
for (let r of be(
|
|
3433
|
+
for (let r of be(xi(e), n)) t.add(r);
|
|
3427
3434
|
return t;
|
|
3428
3435
|
}
|
|
3429
3436
|
//#endregion
|
|
3430
3437
|
//#region packages/xlsx/src/shared-strings.ts
|
|
3431
|
-
function
|
|
3438
|
+
function Ci(e, t) {
|
|
3432
3439
|
for (let n of e.rows) for (let e of n.cells) {
|
|
3433
3440
|
let n = e.value;
|
|
3434
3441
|
if (n.type === "shared") {
|
|
@@ -3447,7 +3454,7 @@ function Si(e, t) {
|
|
|
3447
3454
|
}
|
|
3448
3455
|
return e;
|
|
3449
3456
|
}
|
|
3450
|
-
function
|
|
3457
|
+
function wi(e) {
|
|
3451
3458
|
let t = (e ?? "").trim();
|
|
3452
3459
|
if (!t) return {
|
|
3453
3460
|
kind: "unresolved",
|
|
@@ -3486,7 +3493,7 @@ function Ci(e) {
|
|
|
3486
3493
|
formula: t
|
|
3487
3494
|
};
|
|
3488
3495
|
}
|
|
3489
|
-
function
|
|
3496
|
+
function Ti(e, t) {
|
|
3490
3497
|
if (e.kind === "inline") return {
|
|
3491
3498
|
kind: "values",
|
|
3492
3499
|
values: e.values
|
|
@@ -3505,7 +3512,7 @@ function wi(e, t) {
|
|
|
3505
3512
|
values: n
|
|
3506
3513
|
};
|
|
3507
3514
|
}
|
|
3508
|
-
function
|
|
3515
|
+
function Ei(e) {
|
|
3509
3516
|
let { cell: t, panel: n, viewport: r, rtl: i } = e, a = t.y + t.h + 2, o = t.y - 2 - n.h, s;
|
|
3510
3517
|
s = a + n.h <= r.h ? a : o >= 0 ? o : a, s = Math.max(0, Math.min(s, r.h - n.h));
|
|
3511
3518
|
let c = i ? t.x + t.w - n.w : t.x;
|
|
@@ -3516,7 +3523,7 @@ function Ti(e) {
|
|
|
3516
3523
|
}
|
|
3517
3524
|
//#endregion
|
|
3518
3525
|
//#region packages/xlsx/src/workbook.ts
|
|
3519
|
-
var
|
|
3526
|
+
var Di = class e {
|
|
3520
3527
|
worker;
|
|
3521
3528
|
bridge;
|
|
3522
3529
|
parsedWorkbook = null;
|
|
@@ -3550,7 +3557,7 @@ var Ei = class e {
|
|
|
3550
3557
|
i = await e.arrayBuffer();
|
|
3551
3558
|
} else i = t;
|
|
3552
3559
|
i = h(await fe(i, n.password));
|
|
3553
|
-
let a = new e(r === "worker" ? (await import("./render-worker-host-
|
|
3560
|
+
let a = new e(r === "worker" ? (await import("./render-worker-host-Cg60RAG_.js")).createRenderWorker() : new Pe(), r, n.wasmUrl);
|
|
3554
3561
|
return await a._load(i, n), a;
|
|
3555
3562
|
}
|
|
3556
3563
|
async _load(e, t = {}) {
|
|
@@ -3573,7 +3580,7 @@ var Ei = class e {
|
|
|
3573
3580
|
this.parsedWorkbook = JSON.parse(new TextDecoder().decode(new Uint8Array(e)));
|
|
3574
3581
|
}
|
|
3575
3582
|
let r = this.parsedWorkbook?.workbook.parseError;
|
|
3576
|
-
r && console.warn(`[ooxml] xlsx opened with a degraded part: ${r}`), this._mode === "main" && t.useGoogleFonts && (this.googleFontFaces = await d(
|
|
3583
|
+
r && console.warn(`[ooxml] xlsx opened with a degraded part: ${r}`), this._mode === "main" && t.useGoogleFonts && (this.googleFontFaces = await d(Si(this.parsedWorkbook), bi));
|
|
3577
3584
|
}
|
|
3578
3585
|
get sheetNames() {
|
|
3579
3586
|
return this.parsedWorkbook?.workbook.sheets.map((e) => e.name) ?? [];
|
|
@@ -3608,7 +3615,7 @@ var Ei = class e {
|
|
|
3608
3615
|
let { worksheetJson: e } = r;
|
|
3609
3616
|
i = JSON.parse(new TextDecoder().decode(new Uint8Array(e)));
|
|
3610
3617
|
}
|
|
3611
|
-
return
|
|
3618
|
+
return Ci(i, this.parsedWorkbook.sharedStrings), this.sheetCache.set(e, i), i;
|
|
3612
3619
|
}
|
|
3613
3620
|
async getImage(e, t) {
|
|
3614
3621
|
let n = this.imageBlobCache.get(e);
|
|
@@ -3631,8 +3638,8 @@ var Ei = class e {
|
|
|
3631
3638
|
}
|
|
3632
3639
|
async resolveValidationList(e, t) {
|
|
3633
3640
|
if (!this.parsedWorkbook) throw Error("Workbook not loaded");
|
|
3634
|
-
let n =
|
|
3635
|
-
if (n.kind !== "range") return
|
|
3641
|
+
let n = wi(t);
|
|
3642
|
+
if (n.kind !== "range") return Ti(n, () => null);
|
|
3636
3643
|
let r = e;
|
|
3637
3644
|
if (n.sheet) {
|
|
3638
3645
|
let e = this.sheetNames.findIndex((e) => e.toLowerCase() === n.sheet?.toLowerCase());
|
|
@@ -3644,7 +3651,7 @@ var Ei = class e {
|
|
|
3644
3651
|
}
|
|
3645
3652
|
let i = await this.getWorksheet(r), a = this.parsedWorkbook.styles, o = /* @__PURE__ */ new Map();
|
|
3646
3653
|
for (let e of i.rows) for (let t of e.cells) o.set(`${t.row}:${t.col}`, t);
|
|
3647
|
-
return
|
|
3654
|
+
return Ti(n, (e, t) => {
|
|
3648
3655
|
let n = o.get(`${e}:${t}`);
|
|
3649
3656
|
return n ? bt(n, a, null, i.date1904) : null;
|
|
3650
3657
|
});
|
|
@@ -3655,7 +3662,7 @@ var Ei = class e {
|
|
|
3655
3662
|
async renderViewport(e, t, n, r = {}) {
|
|
3656
3663
|
if (this._mode === "worker") throw Error("renderViewport(canvas) is unavailable in mode: 'worker'; use renderViewportToBitmap() and paint it via an ImageBitmapRenderingContext");
|
|
3657
3664
|
if (!this.parsedWorkbook) throw Error("Workbook not loaded");
|
|
3658
|
-
return
|
|
3665
|
+
return _i({
|
|
3659
3666
|
ws: this.sheetCache.get(t) ?? await this.getWorksheet(t),
|
|
3660
3667
|
styles: this.parsedWorkbook.styles,
|
|
3661
3668
|
imageCache: this.imageCache,
|
|
@@ -3689,7 +3696,7 @@ var Ei = class e {
|
|
|
3689
3696
|
};
|
|
3690
3697
|
//#endregion
|
|
3691
3698
|
//#region packages/xlsx/src/data-validation.ts
|
|
3692
|
-
function
|
|
3699
|
+
function Oi(e, t, n) {
|
|
3693
3700
|
if (!e) return !1;
|
|
3694
3701
|
for (let r of e.split(/\s+/)) {
|
|
3695
3702
|
if (!r) continue;
|
|
@@ -3706,14 +3713,14 @@ function Di(e, t, n) {
|
|
|
3706
3713
|
}
|
|
3707
3714
|
return !1;
|
|
3708
3715
|
}
|
|
3709
|
-
function
|
|
3716
|
+
function ki(e, t, n) {
|
|
3710
3717
|
if (!e) return null;
|
|
3711
|
-
for (let r of e) if (r.validationType === "list" &&
|
|
3718
|
+
for (let r of e) if (r.validationType === "list" && Oi(r.sqref, t, n)) return r;
|
|
3712
3719
|
return null;
|
|
3713
3720
|
}
|
|
3714
3721
|
//#endregion
|
|
3715
3722
|
//#region packages/xlsx/src/find.ts
|
|
3716
|
-
var
|
|
3723
|
+
var Ai = class {
|
|
3717
3724
|
_matches = [];
|
|
3718
3725
|
_active = -1;
|
|
3719
3726
|
constructor(e, t, n) {
|
|
@@ -3793,7 +3800,7 @@ var ki = class {
|
|
|
3793
3800
|
} : null;
|
|
3794
3801
|
}
|
|
3795
3802
|
};
|
|
3796
|
-
function
|
|
3803
|
+
function ji(e) {
|
|
3797
3804
|
let { cell: t, popup: n, viewport: r, rtl: i } = e, a = t.x + t.w + 8, o = t.x - 8 - n.w, s = a + n.w <= r.w, c = o >= 0, l;
|
|
3798
3805
|
l = i ? c ? o : s ? a : o : s ? a : c ? o : a, l = Math.max(0, Math.min(l, r.w - n.w));
|
|
3799
3806
|
let u = t.y;
|
|
@@ -3802,10 +3809,10 @@ function Ai(e) {
|
|
|
3802
3809
|
top: u
|
|
3803
3810
|
};
|
|
3804
3811
|
}
|
|
3805
|
-
function
|
|
3812
|
+
function Mi(e) {
|
|
3806
3813
|
return e > 0 ? (e + 1) * 19 : 0;
|
|
3807
3814
|
}
|
|
3808
|
-
function
|
|
3815
|
+
function Ni(e, t) {
|
|
3809
3816
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
|
|
3810
3817
|
for (let t of e) t.level > 0 && n.set(t.index, t.level), t.collapsed && r.set(t.index, !0), t.index > i && (i = t.index), t.level > a && (a = t.level);
|
|
3811
3818
|
let o = i, s = [];
|
|
@@ -3819,15 +3826,15 @@ function Mi(e, t) {
|
|
|
3819
3826
|
for (let i = 1; i <= o + 1; i++) c(i) >= e ? n ? n.end = i : n = {
|
|
3820
3827
|
start: i,
|
|
3821
3828
|
end: i
|
|
3822
|
-
} : n &&= (s.push(
|
|
3823
|
-
n && s.push(
|
|
3829
|
+
} : n &&= (s.push(Pi(e, n, t, r, c)), null);
|
|
3830
|
+
n && s.push(Pi(e, n, t, r, c));
|
|
3824
3831
|
}
|
|
3825
3832
|
return {
|
|
3826
3833
|
maxLevel: a,
|
|
3827
3834
|
groups: s
|
|
3828
3835
|
};
|
|
3829
3836
|
}
|
|
3830
|
-
function
|
|
3837
|
+
function Pi(e, t, n, r, i) {
|
|
3831
3838
|
let a = null;
|
|
3832
3839
|
if (n) {
|
|
3833
3840
|
let n = t.end + 1;
|
|
@@ -3845,7 +3852,7 @@ function Ni(e, t, n, r, i) {
|
|
|
3845
3852
|
collapsed: o
|
|
3846
3853
|
};
|
|
3847
3854
|
}
|
|
3848
|
-
function
|
|
3855
|
+
function Fi(e, t) {
|
|
3849
3856
|
let n = !e.collapsed, r = /* @__PURE__ */ new Map();
|
|
3850
3857
|
for (let e of t) r.set(e.index, e);
|
|
3851
3858
|
let i = [], a = [];
|
|
@@ -3853,7 +3860,7 @@ function Pi(e, t) {
|
|
|
3853
3860
|
else {
|
|
3854
3861
|
let n = /* @__PURE__ */ new Set();
|
|
3855
3862
|
for (let r of t) r.index >= e.start && r.index <= e.end && r.collapsed && n.add(r.index);
|
|
3856
|
-
for (let t = e.start; t <= e.end; t++)
|
|
3863
|
+
for (let t = e.start; t <= e.end; t++) Ii(t, e, r, n) || a.push(t);
|
|
3857
3864
|
}
|
|
3858
3865
|
return {
|
|
3859
3866
|
hide: i,
|
|
@@ -3861,7 +3868,7 @@ function Pi(e, t) {
|
|
|
3861
3868
|
nowCollapsed: n
|
|
3862
3869
|
};
|
|
3863
3870
|
}
|
|
3864
|
-
function
|
|
3871
|
+
function Ii(e, t, n, r) {
|
|
3865
3872
|
let i = n.get(e)?.level ?? 0;
|
|
3866
3873
|
if (i <= t.level) return !1;
|
|
3867
3874
|
for (let e of r) {
|
|
@@ -3870,7 +3877,7 @@ function Fi(e, t, n, r) {
|
|
|
3870
3877
|
}
|
|
3871
3878
|
return !1;
|
|
3872
3879
|
}
|
|
3873
|
-
function
|
|
3880
|
+
function Li(e, t) {
|
|
3874
3881
|
let n = [], r = [];
|
|
3875
3882
|
for (let i of e) i.level >= t ? n.push(i.index) : r.push(i.index);
|
|
3876
3883
|
return {
|
|
@@ -3878,7 +3885,7 @@ function Ii(e, t) {
|
|
|
3878
3885
|
show: r
|
|
3879
3886
|
};
|
|
3880
3887
|
}
|
|
3881
|
-
function
|
|
3888
|
+
function Ri(e) {
|
|
3882
3889
|
let t = [];
|
|
3883
3890
|
for (let n of e.rows) {
|
|
3884
3891
|
let e = n.outlineLevel ?? 0, r = n.collapsed ?? !1;
|
|
@@ -3891,7 +3898,7 @@ function Li(e) {
|
|
|
3891
3898
|
}
|
|
3892
3899
|
return t;
|
|
3893
3900
|
}
|
|
3894
|
-
function
|
|
3901
|
+
function zi(e) {
|
|
3895
3902
|
let t = e.colOutlineLevels ?? {}, n = e.colCollapsed ?? {}, r = e.colHidden ?? {}, i = /* @__PURE__ */ new Set();
|
|
3896
3903
|
for (let e of Object.keys(t)) i.add(Number(e));
|
|
3897
3904
|
for (let e of Object.keys(n)) i.add(Number(e));
|
|
@@ -3904,19 +3911,19 @@ function Ri(e) {
|
|
|
3904
3911
|
});
|
|
3905
3912
|
return a;
|
|
3906
3913
|
}
|
|
3907
|
-
function
|
|
3914
|
+
function Bi(e, t) {
|
|
3908
3915
|
let n = e.outlinePr;
|
|
3909
3916
|
return n ? t === "row" ? n.summaryBelow : n.summaryRight : !0;
|
|
3910
3917
|
}
|
|
3911
3918
|
//#endregion
|
|
3912
3919
|
//#region packages/xlsx/src/viewer.ts
|
|
3913
|
-
var
|
|
3914
|
-
function
|
|
3915
|
-
if (typeof document > "u" || !document.head || document.head.querySelector(`style[${
|
|
3920
|
+
var Vi = 150, Hi = 280, Ui = 200, Wi = 240, Gi = 200, Ki = 30, qi = 1, Ji = .45, Yi = "data-xlsx-viewer-styles", Xi = ".xlsx-tab-strip::-webkit-scrollbar{display:none}.xlsx-tab-nav{background:transparent;transition:background 0.1s;}.xlsx-tab-nav:hover{background:rgba(0,0,0,0.08);}.xlsx-zoom-slider{-webkit-appearance:none;appearance:none;background:transparent;height:15px;margin:0;}.xlsx-zoom-slider::-webkit-slider-runnable-track{height:4px;background:#c4c4c4;border-radius:2px;}.xlsx-zoom-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:12px;height:12px;margin-top:-4px;border-radius:50%;background:#808080;cursor:pointer;}.xlsx-zoom-slider:hover::-webkit-slider-thumb{background:#5f5f5f;}.xlsx-zoom-slider::-moz-range-track{height:4px;background:#c4c4c4;border-radius:2px;}.xlsx-zoom-slider::-moz-range-thumb{width:12px;height:12px;border:none;border-radius:50%;background:#808080;cursor:pointer;}";
|
|
3921
|
+
function Zi() {
|
|
3922
|
+
if (typeof document > "u" || !document.head || document.head.querySelector(`style[${Yi}]`)) return;
|
|
3916
3923
|
let e = document.createElement("style");
|
|
3917
|
-
e.setAttribute(
|
|
3924
|
+
e.setAttribute(Yi, ""), e.textContent = Xi, document.head.appendChild(e);
|
|
3918
3925
|
}
|
|
3919
|
-
var
|
|
3926
|
+
var Qi = class {
|
|
3920
3927
|
idxs;
|
|
3921
3928
|
cumDelta;
|
|
3922
3929
|
constructor(e, t, n, r) {
|
|
@@ -3957,28 +3964,28 @@ var Zi = class {
|
|
|
3957
3964
|
sizeOf(e) {
|
|
3958
3965
|
return this.offsetOf(e + 1) - this.offsetOf(e);
|
|
3959
3966
|
}
|
|
3960
|
-
},
|
|
3961
|
-
function
|
|
3967
|
+
}, $i = "#1a73e8", ea = 4, ta = 5;
|
|
3968
|
+
function na(e, t, n, r) {
|
|
3962
3969
|
for (let { index: i, edge: a } of t) if (!(a <= r) && Math.abs(e - a) <= n) return i;
|
|
3963
3970
|
return null;
|
|
3964
3971
|
}
|
|
3965
|
-
function
|
|
3972
|
+
function ra(e) {
|
|
3966
3973
|
return {
|
|
3967
3974
|
border: `2px solid ${e}`,
|
|
3968
3975
|
background: `color-mix(in srgb, ${e} 8%, transparent)`
|
|
3969
3976
|
};
|
|
3970
3977
|
}
|
|
3971
|
-
var
|
|
3972
|
-
function
|
|
3973
|
-
let n =
|
|
3978
|
+
var ia = /* @__PURE__ */ new WeakMap();
|
|
3979
|
+
function aa(e, t) {
|
|
3980
|
+
let n = ia.get(e);
|
|
3974
3981
|
if (n) return n;
|
|
3975
3982
|
let r = {
|
|
3976
|
-
col: new
|
|
3977
|
-
row: new
|
|
3983
|
+
col: new Qi(e.colWidths, Q(e.defaultColWidth, t), (e) => Q(e, t), 16384),
|
|
3984
|
+
row: new Qi(e.rowHeights, $(e.defaultRowHeight), (e) => $(e), 1048576)
|
|
3978
3985
|
};
|
|
3979
|
-
return
|
|
3986
|
+
return ia.set(e, r), r;
|
|
3980
3987
|
}
|
|
3981
|
-
var
|
|
3988
|
+
var oa = class {
|
|
3982
3989
|
wb = null;
|
|
3983
3990
|
wrapper;
|
|
3984
3991
|
canvas;
|
|
@@ -4045,15 +4052,15 @@ var aa = class {
|
|
|
4045
4052
|
constructor(e, t = {}) {
|
|
4046
4053
|
this.opts = t, this._mode = t.mode ?? "main", this._hiddenSheetMode = t.hiddenSheetMode ?? "show", this.wrapper = document.createElement("div"), this.wrapper.style.cssText = "position:relative;width:100%;height:100%;border:1px solid #c8ccd0;background:#fff;box-sizing:border-box;font-family:sans-serif;display:flex;flex-direction:column;", this.gridRegion = document.createElement("div"), this.gridRegion.style.cssText = "position:relative;flex:1;min-height:0;overflow:hidden;";
|
|
4047
4054
|
let n = "position:absolute;top:0;left:0;z-index:3;display:none;background:#f5f5f5;";
|
|
4048
|
-
this.cornerGutter = document.createElement("canvas"), this.cornerGutter.style.cssText = n, this.cornerGutter.setAttribute("data-xlsx-outline", "corner"), this.colGutter = document.createElement("canvas"), this.colGutter.style.cssText = n, this.colGutter.setAttribute("data-xlsx-outline", "col"), this.rowGutter = document.createElement("canvas"), this.rowGutter.style.cssText = n, this.rowGutter.setAttribute("data-xlsx-outline", "row"), this.canvasArea = document.createElement("div"), this.canvasArea.style.cssText = "position:absolute;inset:0;overflow:hidden;", this.canvas = document.createElement("canvas"), this.canvas.style.cssText = "position:absolute;top:0;left:0;z-index:0;display:block;", this._mode === "worker" && (this._bitmapCtx = this.canvas.getContext("bitmaprenderer")), this.selectionOverlay = document.createElement("div"), this.selectionOverlay.style.cssText = "position:absolute;top:0;left:0;z-index:1;pointer-events:none;overflow:hidden;width:100%;height:100%;", this.findOverlay = document.createElement("div"), this.findOverlay.style.cssText = "position:absolute;top:0;left:0;z-index:1;pointer-events:none;overflow:hidden;width:100%;height:100%;", this.scrollHost = document.createElement("div"), this.scrollHost.style.cssText = "position:absolute;inset:0;overflow:auto;z-index:2;background:transparent;", this.spacer = document.createElement("div"), this.spacer.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;", this.scrollHost.appendChild(this.spacer), this.commentPopup = document.createElement("div"), this.commentPopup.style.cssText = `position:absolute;z-index:3;pointer-events:none;display:none;max-width:${
|
|
4055
|
+
this.cornerGutter = document.createElement("canvas"), this.cornerGutter.style.cssText = n, this.cornerGutter.setAttribute("data-xlsx-outline", "corner"), this.colGutter = document.createElement("canvas"), this.colGutter.style.cssText = n, this.colGutter.setAttribute("data-xlsx-outline", "col"), this.rowGutter = document.createElement("canvas"), this.rowGutter.style.cssText = n, this.rowGutter.setAttribute("data-xlsx-outline", "row"), this.canvasArea = document.createElement("div"), this.canvasArea.style.cssText = "position:absolute;inset:0;overflow:hidden;", this.canvas = document.createElement("canvas"), this.canvas.style.cssText = "position:absolute;top:0;left:0;z-index:0;display:block;", this._mode === "worker" && (this._bitmapCtx = this.canvas.getContext("bitmaprenderer")), this.selectionOverlay = document.createElement("div"), this.selectionOverlay.style.cssText = "position:absolute;top:0;left:0;z-index:1;pointer-events:none;overflow:hidden;width:100%;height:100%;", this.findOverlay = document.createElement("div"), this.findOverlay.style.cssText = "position:absolute;top:0;left:0;z-index:1;pointer-events:none;overflow:hidden;width:100%;height:100%;", this.scrollHost = document.createElement("div"), this.scrollHost.style.cssText = "position:absolute;inset:0;overflow:auto;z-index:2;background:transparent;", this.spacer = document.createElement("div"), this.spacer.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;", this.scrollHost.appendChild(this.spacer), this.commentPopup = document.createElement("div"), this.commentPopup.style.cssText = `position:absolute;z-index:3;pointer-events:none;display:none;max-width:${Hi}px;max-height:${Ui}px;overflow:hidden;box-sizing:border-box;padding:6px 8px;background:#fffbcc;border:1px solid #b8b8a0;box-shadow:1px 2px 5px rgba(0,0,0,0.25);font:12px/1.4 sans-serif;color:#222;white-space:pre-wrap;word-break:break-word;`, this.validationPanel = document.createElement("div"), this.validationPanel.setAttribute("data-xlsx-validation-panel", ""), this.validationPanel.style.cssText = `position:absolute;z-index:4;pointer-events:auto;display:none;min-width:80px;max-width:${Wi}px;max-height:${Gi}px;overflow-y:auto;box-sizing:border-box;background:#fff;border:1px solid #7f7f7f;box-shadow:1px 2px 5px rgba(0,0,0,0.25);font:12px/1.4 sans-serif;color:#222;`, this.validationPanel.addEventListener("wheel", (e) => e.stopPropagation()), this.canvasArea.appendChild(this.canvas), this.canvasArea.appendChild(this.selectionOverlay), this.canvasArea.appendChild(this.findOverlay), this.canvasArea.appendChild(this.scrollHost), this.canvasArea.appendChild(this.commentPopup), this.canvasArea.appendChild(this.validationPanel);
|
|
4049
4056
|
let r = Math.round(50 * (this.opts.cellScale ?? 1));
|
|
4050
|
-
this.tabBar = document.createElement("div"), this.tabBar.style.cssText = `display:flex;align-items:flex-end;height:${
|
|
4057
|
+
this.tabBar = document.createElement("div"), this.tabBar.style.cssText = `display:flex;align-items:flex-end;height:${Ki}px;flex-shrink:0;background:#f0f0f0;border-top:1px solid #c8ccd0;`, this.navPrev = this.makeNavButton("◀", "Scroll tabs left", () => this.scrollTabs(-1)), this.navNext = this.makeNavButton("▶", "Scroll tabs right", () => this.scrollTabs(1)), this.navPrev.dataset.xlsxTabNav = "prev", this.navNext.dataset.xlsxTabNav = "next";
|
|
4051
4058
|
let i = document.createElement("div");
|
|
4052
|
-
i.style.cssText = `display:flex;flex-shrink:0;width:${r}px;height:100%;`, i.appendChild(this.navPrev), i.appendChild(this.navNext), this.navGroup = i, this.tabStrip = document.createElement("div"), this.tabStrip.style.cssText = `position:relative;display:flex;align-items:flex-end;flex:1;min-width:0;height:100%;margin-left:${
|
|
4059
|
+
i.style.cssText = `display:flex;flex-shrink:0;width:${r}px;height:100%;`, i.appendChild(this.navPrev), i.appendChild(this.navNext), this.navGroup = i, this.tabStrip = document.createElement("div"), this.tabStrip.style.cssText = `position:relative;display:flex;align-items:flex-end;flex:1;min-width:0;height:100%;margin-left:${qi}px;overflow-x:auto;overflow-y:hidden;gap:${qi}px;scrollbar-width:none;`, this.tabStrip.classList.add("xlsx-tab-strip"), Zi(), this.tabStrip.addEventListener("scroll", () => this.updateNavButtons()), this.tabBar.appendChild(i), this.tabBar.appendChild(this.tabStrip), this.opts.showZoomSlider !== !1 && this.tabBar.appendChild(this.buildZoomControl()), this.gridRegion.appendChild(this.canvasArea), this.wrapper.appendChild(this.gridRegion), this.wrapper.appendChild(this.tabBar), e.appendChild(this.wrapper), this.rowGutter.addEventListener("pointerdown", (e) => this.onGutterPointerDown(e, "row")), this.colGutter.addEventListener("pointerdown", (e) => this.onGutterPointerDown(e, "col")), this.scrollHost.addEventListener("scroll", () => {
|
|
4053
4060
|
this.pendingTap = null, this.hideCommentPopup(), this.hideValidationPanel(), this.scrollHost.clientWidth > 0 && (this.effectiveH = this.effectiveScrollLeft), this.scheduleRender(), this.updateSelectionOverlay(), this.updateFindOverlay();
|
|
4054
4061
|
}), this.resizeObserver = new ResizeObserver(() => {
|
|
4055
4062
|
this.reanchorHorizontalScroll(), this.layoutGutters(), this.scheduleRender(), this.updateSelectionOverlay(), this.updateFindOverlay(), this.updateNavButtons();
|
|
4056
|
-
}), this.resizeObserver.observe(this.gridRegion), this.setupSelectionEvents(), this._find = new
|
|
4063
|
+
}), this.resizeObserver.observe(this.gridRegion), this.setupSelectionEvents(), this._find = new Ai(() => this.sheetCount, (e) => this.wb?.sheetNames[e] ?? "", (e) => this._collectSheetCells(e));
|
|
4057
4064
|
}
|
|
4058
4065
|
async _collectSheetCells(e) {
|
|
4059
4066
|
let t = this.wb;
|
|
@@ -4072,7 +4079,7 @@ var aa = class {
|
|
|
4072
4079
|
async load(e) {
|
|
4073
4080
|
let t = ++this._loadGen, n = this.wb;
|
|
4074
4081
|
try {
|
|
4075
|
-
let r = await
|
|
4082
|
+
let r = await Di.load(e, {
|
|
4076
4083
|
useGoogleFonts: this.opts.useGoogleFonts,
|
|
4077
4084
|
maxZipEntryBytes: this.opts.maxZipEntryBytes,
|
|
4078
4085
|
workerTimeoutMs: this.opts.workerTimeoutMs,
|
|
@@ -4103,12 +4110,12 @@ var aa = class {
|
|
|
4103
4110
|
this.currentSheet = e, this.scrollHost.scrollTop = 0, this.anchorCell = null, this.activeCell = null, this.selectionMode = "cells", this.hideCommentPopup(), this.hideValidationPanel(), this.updateSelectionOverlay(), this.updateTabActive(e), this.currentWorksheet = await this.workbook.getWorksheet(e), this.buildCommentMap(this.currentWorksheet), this.buildHyperlinkMap(this.currentWorksheet), this.buildOutline(this.currentWorksheet), this.layoutGutters(), this.updateSpacerSize(this.currentWorksheet), this.resetHorizontalScroll(), await this.renderCurrentSheet(), this.updateFindOverlay(), this.opts.onSheetChange?.(e, this.workbook.sheetNames.length);
|
|
4104
4111
|
}
|
|
4105
4112
|
buildOutline(e) {
|
|
4106
|
-
this.stashedRowHeights.clear(), this.stashedColWidths.clear(), this.rowOutlineBands =
|
|
4107
|
-
let t =
|
|
4113
|
+
this.stashedRowHeights.clear(), this.stashedColWidths.clear(), this.rowOutlineBands = Ri(e), this.colOutlineBands = zi(e);
|
|
4114
|
+
let t = Ni(this.rowOutlineBands, Bi(e, "row")), n = Ni(this.colOutlineBands, Bi(e, "col"));
|
|
4108
4115
|
this.rowOutline = t.maxLevel > 0 ? t : null, this.colOutline = n.maxLevel > 0 ? n : null;
|
|
4109
4116
|
}
|
|
4110
4117
|
layoutGutters() {
|
|
4111
|
-
let e = this.opts.cellScale ?? 1, t = this.rowOutline ? Math.round(
|
|
4118
|
+
let e = this.opts.cellScale ?? 1, t = this.rowOutline ? Math.round(Mi(this.rowOutline.maxLevel) * e) : 0, n = this.colOutline ? Math.round(Mi(this.colOutline.maxLevel) * e) : 0;
|
|
4112
4119
|
this.gutter = {
|
|
4113
4120
|
w: t,
|
|
4114
4121
|
h: n
|
|
@@ -4212,7 +4219,7 @@ var aa = class {
|
|
|
4212
4219
|
applyGroupToggle(e, t) {
|
|
4213
4220
|
let n = this.currentWorksheet;
|
|
4214
4221
|
if (!n) return;
|
|
4215
|
-
let { hide: r, show: i, nowCollapsed: a } =
|
|
4222
|
+
let { hide: r, show: i, nowCollapsed: a } = Fi(e, t === "row" ? this.rowOutlineBands : this.colOutlineBands);
|
|
4216
4223
|
for (let e of r) this.setBandHidden(t, e, !0);
|
|
4217
4224
|
for (let e of i) this.setBandHidden(t, e, !1);
|
|
4218
4225
|
e.summary != null && this.setBandCollapsed(t, e.summary, a), this.afterOutlineMutation(n);
|
|
@@ -4220,7 +4227,7 @@ var aa = class {
|
|
|
4220
4227
|
applyLevelButton(e, t) {
|
|
4221
4228
|
let n = this.currentWorksheet;
|
|
4222
4229
|
if (!n) return;
|
|
4223
|
-
let { hide: r, show: i } =
|
|
4230
|
+
let { hide: r, show: i } = Li(t === "row" ? this.rowOutlineBands : this.colOutlineBands, e);
|
|
4224
4231
|
for (let e of r) this.setBandHidden(t, e, !0);
|
|
4225
4232
|
for (let e of i) this.setBandHidden(t, e, !1);
|
|
4226
4233
|
let a = t === "row" ? this.rowOutline : this.colOutline;
|
|
@@ -4266,11 +4273,11 @@ var aa = class {
|
|
|
4266
4273
|
} else r.colCollapsed = r.colCollapsed ?? {}, n ? r.colCollapsed[t] = !0 : delete r.colCollapsed[t];
|
|
4267
4274
|
}
|
|
4268
4275
|
afterOutlineMutation(e) {
|
|
4269
|
-
|
|
4276
|
+
ia.delete(e), this.buildOutlineLayoutOnly(e), this.updateSpacerSize(e), this.updateSelectionOverlay(), this.scheduleRender();
|
|
4270
4277
|
}
|
|
4271
4278
|
buildOutlineLayoutOnly(e) {
|
|
4272
|
-
this.rowOutlineBands =
|
|
4273
|
-
let t =
|
|
4279
|
+
this.rowOutlineBands = Ri(e), this.colOutlineBands = zi(e);
|
|
4280
|
+
let t = Ni(this.rowOutlineBands, Bi(e, "row")), n = Ni(this.colOutlineBands, Bi(e, "col"));
|
|
4274
4281
|
this.rowOutline = t.maxLevel > 0 ? t : null, this.colOutline = n.maxLevel > 0 ? n : null;
|
|
4275
4282
|
}
|
|
4276
4283
|
get isRtl() {
|
|
@@ -4340,7 +4347,7 @@ var aa = class {
|
|
|
4340
4347
|
}
|
|
4341
4348
|
if (h === -1) return null;
|
|
4342
4349
|
} else {
|
|
4343
|
-
let e = c - d + this.scrollHost.scrollTop / r, t =
|
|
4350
|
+
let e = c - d + this.scrollHost.scrollTop / r, t = aa(n, Z(n)).row.scrollableIndexAt(e, l + 1);
|
|
4344
4351
|
if (t === null) return null;
|
|
4345
4352
|
h = t;
|
|
4346
4353
|
}
|
|
@@ -4354,7 +4361,7 @@ var aa = class {
|
|
|
4354
4361
|
}
|
|
4355
4362
|
if (g === -1) return null;
|
|
4356
4363
|
} else {
|
|
4357
|
-
let e = s - p + this.effectiveScrollLeft / r, t =
|
|
4364
|
+
let e = s - p + this.effectiveScrollLeft / r, t = aa(n, Z(n)).col.scrollableIndexAt(e, u + 1);
|
|
4358
4365
|
if (t === null) return null;
|
|
4359
4366
|
g = t;
|
|
4360
4367
|
}
|
|
@@ -4374,7 +4381,7 @@ var aa = class {
|
|
|
4374
4381
|
} else {
|
|
4375
4382
|
let e = 0;
|
|
4376
4383
|
for (let t = 1; t <= l; t++) e += o(t);
|
|
4377
|
-
let s = a(50) + e, c = this.effectiveScrollLeft / r, d =
|
|
4384
|
+
let s = a(50) + e, c = this.effectiveScrollLeft / r, d = aa(n, i).col, { index: f, partial: p } = d.indexAt(c + d.offsetOf(l + 1)), m = s - p * r;
|
|
4378
4385
|
if (t >= f) for (let e = f; e < t; e++) m += o(e);
|
|
4379
4386
|
else for (let e = t; e < f; e++) m -= o(e);
|
|
4380
4387
|
u = m;
|
|
@@ -4387,7 +4394,7 @@ var aa = class {
|
|
|
4387
4394
|
} else {
|
|
4388
4395
|
let t = 0;
|
|
4389
4396
|
for (let e = 1; e <= c; e++) t += s(e);
|
|
4390
|
-
let o = a(22) + t, l = this.scrollHost.scrollTop / r, u =
|
|
4397
|
+
let o = a(22) + t, l = this.scrollHost.scrollTop / r, u = aa(n, i).row, { index: f, partial: p } = u.indexAt(l + u.offsetOf(c + 1)), m = o - p * r;
|
|
4391
4398
|
if (e >= f) for (let t = f; t < e; t++) m += s(t);
|
|
4392
4399
|
else for (let t = e; t < f; t++) m -= s(t);
|
|
4393
4400
|
d = m;
|
|
@@ -4439,7 +4446,7 @@ var aa = class {
|
|
|
4439
4446
|
};
|
|
4440
4447
|
return null;
|
|
4441
4448
|
}
|
|
4442
|
-
let a = e - t + this.scrollHost.scrollTop / r, s =
|
|
4449
|
+
let a = e - t + this.scrollHost.scrollTop / r, s = aa(n, Z(n)).row.scrollableIndexAt(a, l + 1);
|
|
4443
4450
|
return s === null ? null : {
|
|
4444
4451
|
kind: "row",
|
|
4445
4452
|
row: s
|
|
@@ -4460,7 +4467,7 @@ var aa = class {
|
|
|
4460
4467
|
};
|
|
4461
4468
|
return null;
|
|
4462
4469
|
}
|
|
4463
|
-
let m = d - f + this.effectiveScrollLeft / r, h =
|
|
4470
|
+
let m = d - f + this.effectiveScrollLeft / r, h = aa(n, Z(n)).col.scrollableIndexAt(m, u + 1);
|
|
4464
4471
|
return h === null ? null : {
|
|
4465
4472
|
kind: "col",
|
|
4466
4473
|
col: h
|
|
@@ -4482,7 +4489,7 @@ var aa = class {
|
|
|
4482
4489
|
edge: t.x + t.w
|
|
4483
4490
|
}));
|
|
4484
4491
|
}
|
|
4485
|
-
let o =
|
|
4492
|
+
let o = na(a, i, ea, s);
|
|
4486
4493
|
return o === null ? null : {
|
|
4487
4494
|
kind: "col",
|
|
4488
4495
|
index: o,
|
|
@@ -4502,7 +4509,7 @@ var aa = class {
|
|
|
4502
4509
|
edge: t.y + t.h
|
|
4503
4510
|
}));
|
|
4504
4511
|
}
|
|
4505
|
-
let a =
|
|
4512
|
+
let a = na(o, i, ea, c);
|
|
4506
4513
|
return a === null ? null : {
|
|
4507
4514
|
kind: "row",
|
|
4508
4515
|
index: a,
|
|
@@ -4517,13 +4524,13 @@ var aa = class {
|
|
|
4517
4524
|
if (!n || !r) return;
|
|
4518
4525
|
let i = this.opts.cellScale ?? 1, a = this.canvasArea.getBoundingClientRect();
|
|
4519
4526
|
if (n.kind === "col") {
|
|
4520
|
-
let t = this.screenX(e - a.left, 0), o = Math.max(
|
|
4521
|
-
r.colWidths[n.index] =
|
|
4527
|
+
let t = this.screenX(e - a.left, 0), o = Math.max(ta, Math.round((t - n.originScaled) / i));
|
|
4528
|
+
r.colWidths[n.index] = In(o, n.mdw), this.recordSizeOverride("col", n.index);
|
|
4522
4529
|
} else {
|
|
4523
|
-
let e = t - a.top, o = Math.max(
|
|
4524
|
-
r.rowHeights[n.index] =
|
|
4530
|
+
let e = t - a.top, o = Math.max(ta, Math.round((e - n.originScaled) / i));
|
|
4531
|
+
r.rowHeights[n.index] = Ln(o), this.recordSizeOverride("row", n.index);
|
|
4525
4532
|
}
|
|
4526
|
-
|
|
4533
|
+
ia.delete(r), this.updateSpacerSize(r), this.updateSelectionOverlay(), this.scheduleRender();
|
|
4527
4534
|
}
|
|
4528
4535
|
setSelectionColor(e) {
|
|
4529
4536
|
this.opts.selectionColor = e, this.updateSelectionOverlay();
|
|
@@ -4592,13 +4599,13 @@ var aa = class {
|
|
|
4592
4599
|
l < a && (d -= a - l, l = a), u < o && (f -= o - u, u = o);
|
|
4593
4600
|
let h = a + c, g = o + s;
|
|
4594
4601
|
if (m > r && l < h && (d -= h - l, l = h), p > n && u < g && (f -= g - u, u = g), d <= 0 || f <= 0) return;
|
|
4595
|
-
let _ = this.screenX(l, d), { border: v, background: y } =
|
|
4602
|
+
let _ = this.screenX(l, d), { border: v, background: y } = ra(this.opts.selectionColor ?? $i), b = document.createElement("div");
|
|
4596
4603
|
b.style.cssText = `position:absolute;left:${_}px;top:${u}px;width:${d}px;height:${f}px;box-sizing:border-box;border:${v};background:${y};pointer-events:none;`, this.selectionOverlay.appendChild(b), this.maybeDrawValidationDropdown();
|
|
4597
4604
|
}
|
|
4598
4605
|
maybeDrawValidationDropdown() {
|
|
4599
4606
|
if (this.validationArrowRect = null, this.selectionMode !== "cells") return;
|
|
4600
4607
|
let e = this.currentWorksheet, t = this.activeCell;
|
|
4601
|
-
if (!e || !t || !
|
|
4608
|
+
if (!e || !t || !ki(e.dataValidations, t.row, t.col)) return;
|
|
4602
4609
|
let n = this.getCellRect(t.row, t.col);
|
|
4603
4610
|
if (!n) return;
|
|
4604
4611
|
let r = this.opts.cellScale ?? 1, i = Math.round(50 * r), a = Math.round(22 * r), o = Math.max(14, Math.min(n.h, 22 * r)), s = n.x + n.w, c = n.y;
|
|
@@ -4621,7 +4628,7 @@ var aa = class {
|
|
|
4621
4628
|
for (let t = 1; t <= o; t++) s += n(Q(e.colWidths[t] ?? e.defaultColWidth, Z(e)));
|
|
4622
4629
|
let c = 0;
|
|
4623
4630
|
for (let t = 1; t <= a; t++) c += n($(e.rowHeights[t] ?? e.defaultRowHeight));
|
|
4624
|
-
let l = r + s, u = i + c, d =
|
|
4631
|
+
let l = r + s, u = i + c, d = ra("#ffb300"), f = ra("#fb8c00");
|
|
4625
4632
|
for (let e of this._find.sheetHighlights(this.currentSheet)) {
|
|
4626
4633
|
let t = this.getCellRect(e.row, e.col);
|
|
4627
4634
|
if (!t) continue;
|
|
@@ -4653,7 +4660,7 @@ var aa = class {
|
|
|
4653
4660
|
_scrollCellIntoView(e, t) {
|
|
4654
4661
|
let n = this.currentWorksheet;
|
|
4655
4662
|
if (!n) return;
|
|
4656
|
-
let r = this.opts.cellScale ?? 1, i = Z(n), a =
|
|
4663
|
+
let r = this.opts.cellScale ?? 1, i = Z(n), a = aa(n, i), o = n.freezeRows ?? 0, s = n.freezeCols ?? 0;
|
|
4657
4664
|
if (e > o) {
|
|
4658
4665
|
let t = Math.round(22 * r), i = 0;
|
|
4659
4666
|
for (let e = 1; e <= o; e++) i += Math.round($(n.rowHeights[e] ?? n.defaultRowHeight) * r);
|
|
@@ -4675,7 +4682,7 @@ var aa = class {
|
|
|
4675
4682
|
this.hideValidationPanel();
|
|
4676
4683
|
return;
|
|
4677
4684
|
}
|
|
4678
|
-
let r =
|
|
4685
|
+
let r = ki(e.dataValidations, t.row, t.col);
|
|
4679
4686
|
r && this.openValidationPanel(t, r.formula1);
|
|
4680
4687
|
}
|
|
4681
4688
|
async openValidationPanel(e, t) {
|
|
@@ -4714,7 +4721,7 @@ var aa = class {
|
|
|
4714
4721
|
if (!t) return;
|
|
4715
4722
|
let n = this.screenX(t.x, t.w);
|
|
4716
4723
|
this.validationPanel.style.left = "-9999px", this.validationPanel.style.top = "-9999px", this.validationPanel.style.display = "block";
|
|
4717
|
-
let r =
|
|
4724
|
+
let r = Ei({
|
|
4718
4725
|
cell: {
|
|
4719
4726
|
x: n,
|
|
4720
4727
|
y: t.y,
|
|
@@ -4790,7 +4797,7 @@ var aa = class {
|
|
|
4790
4797
|
}
|
|
4791
4798
|
this.commentPopupKey !== t && (this.hideCommentPopup(), this.commentPopupKey = t, this.commentPopupTimer = setTimeout(() => {
|
|
4792
4799
|
this.commentPopupTimer = null, this.renderCommentPopup(e, n);
|
|
4793
|
-
},
|
|
4800
|
+
}, Vi));
|
|
4794
4801
|
}
|
|
4795
4802
|
renderCommentPopup(e, t) {
|
|
4796
4803
|
let n = this.getCellRect(e.row, e.col);
|
|
@@ -4803,7 +4810,7 @@ var aa = class {
|
|
|
4803
4810
|
r.textContent = t.text, this.commentPopup.appendChild(r);
|
|
4804
4811
|
let i = this.screenX(n.x, n.w);
|
|
4805
4812
|
this.commentPopup.style.left = "-9999px", this.commentPopup.style.top = "-9999px", this.commentPopup.style.display = "block";
|
|
4806
|
-
let a =
|
|
4813
|
+
let a = ji({
|
|
4807
4814
|
cell: {
|
|
4808
4815
|
x: i,
|
|
4809
4816
|
y: n.y,
|
|
@@ -5022,12 +5029,12 @@ var aa = class {
|
|
|
5022
5029
|
}
|
|
5023
5030
|
}
|
|
5024
5031
|
tabStyle(e, t) {
|
|
5025
|
-
let n =
|
|
5032
|
+
let n = Ki - 2, r = Ki - 5, i = t ? `box-shadow:inset 0 -${e ? 2 : 3}px 0 0 ${t};` : "";
|
|
5026
5033
|
return e ? `display:inline-block;flex:none;padding:0 14px;position:relative;border:1px solid #c8ccd0;border-bottom:none;border-radius:3px 3px 0 0;cursor:pointer;white-space:nowrap;max-width:160px;overflow:hidden;text-overflow:ellipsis;outline:none;box-sizing:border-box;height:${n}px;font-size:13px;background:#fff;color:#000;border-bottom:1px solid #fff;font-weight:600;top:1px;` + i : `display:inline-block;flex:none;padding:0 14px;position:relative;border:1px solid #c8ccd0;border-bottom:none;border-radius:3px 3px 0 0;cursor:pointer;white-space:nowrap;max-width:160px;overflow:hidden;text-overflow:ellipsis;outline:none;box-sizing:border-box;height:${r}px;font-size:11px;background:#e0e0e0;color:#555;` + i;
|
|
5027
5034
|
}
|
|
5028
5035
|
tabCss(e, t) {
|
|
5029
5036
|
let n = this.tabStyle(t, this.tabColors[e]);
|
|
5030
|
-
return this._hiddenSheetMode !== "show" && this.wb?.isHidden(e) && (n += this._hiddenSheetMode === "skip" ? "display:none;" : `opacity:${
|
|
5037
|
+
return this._hiddenSheetMode !== "show" && this.wb?.isHidden(e) && (n += this._hiddenSheetMode === "skip" ? "display:none;" : `opacity:${Ji};`), n;
|
|
5031
5038
|
}
|
|
5032
5039
|
buildZoomControl() {
|
|
5033
5040
|
let e = this.opts.zoomMin ?? .1, t = this.opts.zoomMax ?? 4, n = this.opts.cellScale ?? 1, r = document.createElement("div");
|
|
@@ -5147,7 +5154,7 @@ var aa = class {
|
|
|
5147
5154
|
for (let t = 1; t <= s; t++) c += Q(e.colWidths[t] ?? e.defaultColWidth, Z(e));
|
|
5148
5155
|
let l = 0;
|
|
5149
5156
|
for (let t = 1; t <= o; t++) l += $(e.rowHeights[t] ?? e.defaultRowHeight);
|
|
5150
|
-
let u = this.effectiveScrollLeft / i, d = this.scrollHost.scrollTop / i, f =
|
|
5157
|
+
let u = this.effectiveScrollLeft / i, d = this.scrollHost.scrollTop / i, f = aa(e, Z(e)), { index: p, partial: m } = f.col.indexAt(u + f.col.offsetOf(s + 1)), { index: h, partial: g } = f.row.indexAt(d + f.row.offsetOf(o + 1)), _ = t / i - 50 - c, v = n / i - 22 - l, y = 0;
|
|
5151
5158
|
{
|
|
5152
5159
|
let t = -m, n = p;
|
|
5153
5160
|
for (; t < _ + m && n <= 16384;) t += Q(e.colWidths[n] ?? e.defaultColWidth, Z(e)), y++, n++;
|
|
@@ -5257,13 +5264,13 @@ var aa = class {
|
|
|
5257
5264
|
destroy() {
|
|
5258
5265
|
this._destroyed = !0, this._loadGen++, this.resizeObserver?.disconnect(), this._rafId !== null && typeof cancelAnimationFrame == "function" && (cancelAnimationFrame(this._rafId), this._rafId = null), this._renderSeq++, this.hideCommentPopup(), this.hideValidationPanel(), this.keydownHandler && document.removeEventListener("keydown", this.keydownHandler), this._find.invalidate(), this.wb?.destroy(), this.wrapper.remove();
|
|
5259
5266
|
}
|
|
5260
|
-
},
|
|
5267
|
+
}, sa = /* @__PURE__ */ P({
|
|
5261
5268
|
OoxmlError: () => F,
|
|
5262
|
-
XlsxViewer: () =>
|
|
5263
|
-
XlsxWorkbook: () =>
|
|
5269
|
+
XlsxViewer: () => oa,
|
|
5270
|
+
XlsxWorkbook: () => Di,
|
|
5264
5271
|
autoResize: () => H,
|
|
5265
5272
|
openExternalHyperlink: () => ie,
|
|
5266
|
-
resolveSharedStrings: () =>
|
|
5273
|
+
resolveSharedStrings: () => Ci
|
|
5267
5274
|
});
|
|
5268
5275
|
//#endregion
|
|
5269
|
-
export {
|
|
5276
|
+
export { Ci as i, oa as n, Di as r, sa as t };
|