@work-zhanguo/light-file-preview 0.0.9 → 0.0.10

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.
@@ -1,4 +1,4 @@
1
- import { d as kt, g as ke, o as Nt, a as At, b as d, c as m, f as u, F as L, h as U, e as Ne, i as tt, t as b, n as H, r as M, j as pe } from "./vue2-CNyOC3tL.js";
1
+ import { d as kt, g as ke, o as Nt, a as At, b as d, c as m, f as u, F as L, h as U, e as Ne, i as tt, t as b, n as M, r as H, j as pe } from "./vue2-BEoHyqmm.js";
2
2
  import { r as Dt } from "./text-Bqxn_tMI.js";
3
3
  const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolbar" }, Tt = {
4
4
  key: 0,
@@ -8,10 +8,10 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
8
8
  }, Ot = ["onClick"], Bt = { class: "lfp-sheet__tab-label" }, Ft = { class: "lfp-sheet__tab-meta" }, Vt = {
9
9
  key: 1,
10
10
  class: "lfp-sheet__summary"
11
- }, Lt = { class: "lfp-sheet__summary-item" }, Ut = { class: "lfp-sheet__summary-item" }, Ht = {
11
+ }, Lt = { class: "lfp-sheet__summary-item" }, Ut = { class: "lfp-sheet__summary-item" }, Mt = {
12
12
  key: 0,
13
13
  class: "lfp-sheet__formula-bar"
14
- }, Mt = { class: "lfp-sheet__name-box" }, Wt = { class: "lfp-sheet__name-box-text" }, jt = { class: "lfp-sheet__formula-input" }, zt = { class: "lfp-sheet__formula-text" }, Pt = {
14
+ }, Ht = { class: "lfp-sheet__name-box" }, Wt = { class: "lfp-sheet__name-box-text" }, jt = { class: "lfp-sheet__formula-input" }, zt = { class: "lfp-sheet__formula-text" }, Pt = {
15
15
  key: 1,
16
16
  class: "lfp-hint"
17
17
  }, Kt = {
@@ -23,7 +23,7 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
23
23
  }, Xt = ["src", "alt"], eo = {
24
24
  key: 3,
25
25
  class: "lfp-sheet__empty"
26
- }, to = 32, oo = 20, W = 52, he = 40, He = 28, ot = 96, ro = /* @__PURE__ */ kt({
26
+ }, to = 28, oo = 14, W = 46, he = 28, Me = 24, ot = 64, ro = /* @__PURE__ */ kt({
27
27
  __name: "SheetRenderer",
28
28
  props: {
29
29
  source: {},
@@ -32,7 +32,7 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
32
32
  },
33
33
  emits: ["loading", "error"],
34
34
  setup(nt, { emit: st }) {
35
- const Ae = nt, De = st, Me = new AbortController(), Ee = M(0), j = M([]), C = M(""), Ie = M(null), Te = M(null), Oe = M([]), c = ke(() => j.value[Ee.value]), We = ke(() => {
35
+ const Ae = nt, De = st, He = new AbortController(), Ee = H(0), j = H([]), C = H(""), Ie = H(null), Te = H(null), Oe = H([]), c = ke(() => j.value[Ee.value]), We = ke(() => {
36
36
  var t;
37
37
  const e = c.value;
38
38
  return !e || !C.value ? null : (t = e.cellMap[C.value]) != null ? t : null;
@@ -111,13 +111,13 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
111
111
  }
112
112
  function qe(e) {
113
113
  const t = typeof (e == null ? void 0 : e.hpx) == "number" ? e.hpx : typeof (e == null ? void 0 : e.hpt) == "number" ? e.hpt * 1.3334 : void 0;
114
- return Math.max(t != null ? t : He, He);
114
+ return Math.max(t != null ? t : Me, Me);
115
115
  }
116
116
  function ut(e) {
117
117
  return { height: `${qe(e)}px` };
118
118
  }
119
119
  function Ze(e) {
120
- return typeof (e == null ? void 0 : e.wpx) == "number" ? Math.max(e.wpx, 72) : typeof (e == null ? void 0 : e.width) == "number" ? Math.max(e.width * 8, 72) : ot;
120
+ return typeof (e == null ? void 0 : e.wpx) == "number" ? Math.max(e.wpx, 42) : typeof (e == null ? void 0 : e.width) == "number" ? Math.max(Math.round(e.width * 7.2 + 5), 42) : ot;
121
121
  }
122
122
  function Je(e) {
123
123
  return `${Ze(e)}px`;
@@ -273,7 +273,7 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
273
273
  P.set(p, G), G += (g = s[R]) != null ? g : ot;
274
274
  }), o.forEach((p, R) => {
275
275
  var g;
276
- K.set(p, q), q += (g = r[R]) != null ? g : He;
276
+ K.set(p, q), q += (g = r[R]) != null ? g : Me;
277
277
  });
278
278
  const Z = G, B = q, Ce = [], $e = Array.from(x.getElementsByTagName("*")).filter(
279
279
  (p) => ["oneCellAnchor", "twoCellAnchor"].includes(p.localName)
@@ -390,7 +390,7 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
390
390
  var e;
391
391
  De("loading", !0), je();
392
392
  try {
393
- const t = await Dt(Ae.source, Me.signal), o = await import("./xlsx-j9Zzywas.js"), n = o.read(t, {
393
+ const t = await Dt(Ae.source, He.signal), o = await import("./xlsx-j9Zzywas.js"), n = o.read(t, {
394
394
  type: "array",
395
395
  cellStyles: !0,
396
396
  cellNF: !0,
@@ -416,7 +416,7 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
416
416
  return Nt(() => {
417
417
  _t();
418
418
  }), At(() => {
419
- Me.abort(), je();
419
+ He.abort(), je();
420
420
  }), (e, t) => (d(), m("div", Et, [
421
421
  u("div", It, [
422
422
  j.value.length > 1 ? (d(), m("div", Tt, [
@@ -441,8 +441,8 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
441
441
  ])
442
442
  ])) : Ne("", !0)
443
443
  ]),
444
- c.value ? (d(), m("div", Ht, [
445
- u("span", Mt, [
444
+ c.value ? (d(), m("div", Mt, [
445
+ u("span", Ht, [
446
446
  u("span", Wt, b(rt.value), 1),
447
447
  t[4] || (t[4] = u("span", {
448
448
  class: "lfp-sheet__name-box-caret",
@@ -460,11 +460,11 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
460
460
  u("table", qt, [
461
461
  u("colgroup", null, [
462
462
  u("col", {
463
- style: H({ width: `${W}px` })
463
+ style: M({ width: `${W}px` })
464
464
  }, null, 4),
465
465
  (d(!0), m(L, null, U(c.value.colWidths, (o, n) => (d(), m("col", {
466
466
  key: `col-width-${c.value.visibleColIndexes[n]}`,
467
- style: H({ width: `${o}px` })
467
+ style: M({ width: `${o}px` })
468
468
  }, null, 4))), 128))
469
469
  ]),
470
470
  u("tbody", null, [
@@ -486,7 +486,7 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
486
486
  (d(!0), m(L, null, U(c.value.rows, (o) => (d(), m("tr", {
487
487
  key: o.key,
488
488
  class: pe(["lfp-sheet__row", { "is-first-row": o.rowIndex === c.value.firstVisibleRow }]),
489
- style: H(o.style)
489
+ style: M(o.style)
490
490
  }, [
491
491
  u("th", {
492
492
  class: pe(["lfp-sheet__row-header", {
@@ -508,7 +508,7 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
508
508
  }),
509
509
  rowspan: n.rowSpan,
510
510
  colspan: n.colSpan,
511
- style: H(n.style),
511
+ style: M(n.style),
512
512
  title: n.formula ? `=${n.formula}` : n.value,
513
513
  tabindex: "0",
514
514
  onMouseenter: (r) => z(n.rowIndex, n.colIndex),
@@ -525,7 +525,7 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
525
525
  u("div", Yt, [
526
526
  (d(!0), m(L, null, U(c.value.images, (o) => (d(), m("div", {
527
527
  key: o.key,
528
- style: H({
528
+ style: M({
529
529
  left: `${o.left}px`,
530
530
  top: `${o.top}px`,
531
531
  width: `${o.width}px`,
@@ -537,7 +537,7 @@ const Et = { class: "lfp-document lfp-sheet" }, It = { class: "lfp-sheet__toolba
537
537
  class: "lfp-sheet__floating-image",
538
538
  src: o.src,
539
539
  alt: o.alt,
540
- style: H(o.frameStyle)
540
+ style: M(o.frameStyle)
541
541
  }, null, 12, Xt)
542
542
  ], 4))), 128))
543
543
  ])
@@ -1,4 +1,4 @@
1
- import { d as g, g as f, o as h, a as k, b as n, c as a, t as p, e as B, f as w, r as c } from "./vue2-CNyOC3tL.js";
1
+ import { d as g, g as f, o as h, a as k, b as n, c as a, t as p, e as B, f as w, r as c } from "./vue2-BEoHyqmm.js";
2
2
  import { a as M } from "./text-Bqxn_tMI.js";
3
3
  const C = { class: "lfp-document" }, T = {
4
4
  key: 0,
@@ -1,4 +1,4 @@
1
- import { d as n, b as l, c as o, f as t, t as s, u as i, k as r } from "./vue2-CNyOC3tL.js";
1
+ import { d as n, b as l, c as o, f as t, t as s, u as i, k as r } from "./vue2-BEoHyqmm.js";
2
2
  const d = { class: "lfp-empty" }, p = { class: "lfp-hint" }, c = /* @__PURE__ */ n({
3
3
  __name: "UnsupportedRenderer",
4
4
  props: {
@@ -1,4 +1,4 @@
1
- import { L as i, v as r } from "./vue2-CNyOC3tL.js";
1
+ import { L as i, v as r } from "./vue2-BEoHyqmm.js";
2
2
  export {
3
3
  i as LightFilePreviewVue2,
4
4
  r as default