@lingshugroup/web-plus 2.4.0 → 2.4.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.
Files changed (58) hide show
  1. package/lib/index.css +1 -1
  2. package/lib/index.css.br +0 -0
  3. package/lib/index.css.gz +0 -0
  4. package/lib/packages/ls-components/components/icon/Index.vue/index.cjs +1 -1
  5. package/lib/packages/ls-components/components/icon/Index.vue/index.js +2 -2
  6. package/lib/packages/ls-components/components/icon/Index.vue/index2.cjs +1 -1
  7. package/lib/packages/ls-components/components/icon/Index.vue/index2.js +16 -15
  8. package/lib/packages/ls-components/components/icon/Index.vue/index2.js.br +0 -0
  9. package/lib/packages/ls-components/components/icon/Index.vue/index2.js.gz +0 -0
  10. package/lib/packages/ls-components/components/preview_docx/Docx.vue/index.cjs +1 -1
  11. package/lib/packages/ls-components/components/preview_docx/Docx.vue/index.js +2 -2
  12. package/lib/packages/ls-components/components/preview_docx/Docx.vue/index2.cjs +1 -1
  13. package/lib/packages/ls-components/components/preview_docx/Docx.vue/index2.js +54 -39
  14. package/lib/packages/ls-components/components/preview_docx/Docx.vue/index2.js.br +0 -0
  15. package/lib/packages/ls-components/components/preview_docx/Docx.vue/index2.js.gz +0 -0
  16. package/lib/packages/ls-components/components/preview_docx/Index.vue/index.cjs +1 -1
  17. package/lib/packages/ls-components/components/preview_docx/Index.vue/index.js +2 -2
  18. package/lib/packages/ls-components/components/preview_docx/Index.vue/index2.cjs +1 -1
  19. package/lib/packages/ls-components/components/preview_docx/Index.vue/index2.js +30 -27
  20. package/lib/packages/ls-components/components/preview_docx/Index.vue/index2.js.br +0 -0
  21. package/lib/packages/ls-components/components/preview_docx/Index.vue/index2.js.gz +0 -0
  22. package/lib/packages/ls-components/components/preview_image/Image.vue/index.cjs +1 -1
  23. package/lib/packages/ls-components/components/preview_image/Image.vue/index.js +2 -2
  24. package/lib/packages/ls-components/components/preview_image/Image.vue/index2.cjs +1 -1
  25. package/lib/packages/ls-components/components/preview_image/Image.vue/index2.js +132 -131
  26. package/lib/packages/ls-components/components/preview_image/Image.vue/index2.js.br +0 -0
  27. package/lib/packages/ls-components/components/preview_image/Image.vue/index2.js.gz +0 -0
  28. package/lib/packages/ls-components/components/preview_image/Index.vue/index.cjs +1 -1
  29. package/lib/packages/ls-components/components/preview_image/Index.vue/index.js +2 -2
  30. package/lib/packages/ls-components/components/preview_image/Index.vue/index2.cjs +1 -1
  31. package/lib/packages/ls-components/components/preview_image/Index.vue/index2.js +33 -30
  32. package/lib/packages/ls-components/components/preview_image/Index.vue/index2.js.br +0 -0
  33. package/lib/packages/ls-components/components/preview_image/Index.vue/index2.js.gz +0 -0
  34. package/lib/packages/ls-components/components/preview_pdf/Index.vue/index.cjs +1 -1
  35. package/lib/packages/ls-components/components/preview_pdf/Index.vue/index.js +1 -1
  36. package/lib/packages/ls-components/components/preview_pdf/Index.vue/index2.cjs +1 -1
  37. package/lib/packages/ls-components/components/preview_pdf/Index.vue/index2.js +31 -27
  38. package/lib/packages/ls-components/components/preview_pdf/Index.vue/index2.js.br +0 -0
  39. package/lib/packages/ls-components/components/preview_pdf/Index.vue/index2.js.gz +0 -0
  40. package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index.cjs +1 -1
  41. package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index.js +3 -3
  42. package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.cjs +1 -1
  43. package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.js +132 -116
  44. package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.js.br +0 -0
  45. package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.js.gz +0 -0
  46. package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index.cjs +1 -1
  47. package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index.js +3 -3
  48. package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index2.cjs +1 -1
  49. package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index2.js +25 -22
  50. package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index2.js.br +0 -0
  51. package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index2.js.gz +0 -0
  52. package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index.cjs +1 -1
  53. package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index.js +1 -1
  54. package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index2.cjs +1 -1
  55. package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index2.js +124 -108
  56. package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index2.js.br +0 -0
  57. package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index2.js.gz +0 -0
  58. package/package.json +1 -1
package/lib/index.css.br CHANGED
Binary file
package/lib/index.css.gz CHANGED
Binary file
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=/* empty css */u=t.default(e.default,[["__scopeId","data-v-03839341"]]);exports.default=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=/* empty css */u=t.default(e.default,[["__scopeId","data-v-3a0f2635"]]);exports.default=u;
@@ -1,7 +1,7 @@
1
1
  import o from "./index2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
4
- const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-03839341"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3a0f2635"]]);
5
5
  export {
6
- _ as default
6
+ m as default
7
7
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */const e=require("vue"),s=require("@iconify/vue"),c=/* empty css */t=/* empty css */i=/* empty css */a=e.defineComponent({name:"LSIcon"}),u=e.defineComponent({...a,props:t.lsIconProps,setup(m){const n=e.useSlots(),l=c.useNamespace("icon").b();return(o,p)=>{const r=i.ElIcon;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(l))},[o.type==1&&o.name?(e.openBlock(),e.createBlock(e.unref(s.Icon),{key:0,icon:o.name,class:"icon-iconify",width:o.width,height:o.height,color:o.color},null,8,["icon","width","height","color"])):o.type==2&&o.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.name),{key:1,class:"icon-svg",width:o.width,height:o.height,fill:o.color,src:o.src},null,8,["width","height","fill","src"])):o.name?(e.openBlock(),e.createBlock(r,{key:2,size:o.size,color:o.color},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.name),{color:o.color},null,8,["color"]))]),_:1},8,["size","color"])):e.createCommentVNode("",!0),e.unref(n).default?e.renderSlot(o.$slots,"default",{key:3},void 0,!0):e.createCommentVNode("",!0)],2)}}});exports.default=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */const e=require("vue"),r=require("@iconify/vue"),c=/* empty css */t=/* empty css */i=/* empty css */a=e.defineComponent({name:"LSIcon"}),u=e.defineComponent({...a,props:t.lsIconProps,setup(m){const n=e.useSlots(),s=c.useNamespace("icon").b();return(o,p)=>{const l=i.ElIcon;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(s))},[o.type==1&&o.name?(e.openBlock(),e.createBlock(e.unref(r.Icon),{key:0,icon:o.name,class:"icon-iconify",width:o.width,height:o.height,color:o.color},null,8,["icon","width","height","color"])):o.type==2&&o.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.name),{key:1,class:"icon-svg",width:o.width,height:o.height,fill:o.color,src:o.src},null,8,["width","height","fill","src"])):o.name?(e.openBlock(),e.createBlock(l,{key:2,size:o.size,color:o.color,class:e.normalizeClass(o.$attrs.class)},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.name),{color:o.color},null,8,["color"]))]),_:1},8,["size","color","class"])):e.createCommentVNode("",!0),e.unref(n).default?e.renderSlot(o.$slots,"default",{key:3},void 0,!0):e.createCommentVNode("",!0)],2)}}});exports.default=u;
@@ -1,50 +1,51 @@
1
1
  /* empty css */
2
- import { defineComponent as i, useSlots as a, createElementBlock as h, openBlock as e, normalizeClass as p, unref as l, createBlock as n, createCommentVNode as r, renderSlot as u, resolveDynamicComponent as s, withCtx as d } from "vue";
2
+ import { defineComponent as t, useSlots as h, createElementBlock as p, openBlock as e, normalizeClass as n, unref as l, createBlock as s, createCommentVNode as r, renderSlot as u, resolveDynamicComponent as i, withCtx as d } from "vue";
3
3
  import { Icon as f } from "@iconify/vue";
4
4
  import { useNamespace as y } from "../../_hooks/useNamespace/index.js";
5
5
  import { lsIconProps as g } from "../types/index.js";
6
6
  import { ElIcon as k } from "../../../../../node_modules/.pnpm/element-plus@2.10.7_vue@3.5.18_typescript@5.9.2_/node_modules/element-plus/es/components/icon/index/index.js";
7
- const w = i({
7
+ const w = t({
8
8
  name: "LSIcon"
9
- }), D = /* @__PURE__ */ i({
9
+ }), b = /* @__PURE__ */ t({
10
10
  ...w,
11
11
  props: g,
12
12
  setup(C) {
13
- const t = a(), m = y("icon").b();
13
+ const a = h(), c = y("icon").b();
14
14
  return (o, z) => {
15
- const c = k;
16
- return e(), h("div", {
17
- class: p(l(m))
15
+ const m = k;
16
+ return e(), p("div", {
17
+ class: n(l(c))
18
18
  }, [
19
- o.type == 1 && o.name ? (e(), n(l(f), {
19
+ o.type == 1 && o.name ? (e(), s(l(f), {
20
20
  key: 0,
21
21
  icon: o.name,
22
22
  class: "icon-iconify",
23
23
  width: o.width,
24
24
  height: o.height,
25
25
  color: o.color
26
- }, null, 8, ["icon", "width", "height", "color"])) : o.type == 2 && o.name ? (e(), n(s(o.name), {
26
+ }, null, 8, ["icon", "width", "height", "color"])) : o.type == 2 && o.name ? (e(), s(i(o.name), {
27
27
  key: 1,
28
28
  class: "icon-svg",
29
29
  width: o.width,
30
30
  height: o.height,
31
31
  fill: o.color,
32
32
  src: o.src
33
- }, null, 8, ["width", "height", "fill", "src"])) : o.name ? (e(), n(c, {
33
+ }, null, 8, ["width", "height", "fill", "src"])) : o.name ? (e(), s(m, {
34
34
  key: 2,
35
35
  size: o.size,
36
- color: o.color
36
+ color: o.color,
37
+ class: n(o.$attrs.class)
37
38
  }, {
38
39
  default: d(() => [
39
- (e(), n(s(o.name), { color: o.color }, null, 8, ["color"]))
40
+ (e(), s(i(o.name), { color: o.color }, null, 8, ["color"]))
40
41
  ]),
41
42
  _: 1
42
- }, 8, ["size", "color"])) : r("", !0),
43
- l(t).default ? u(o.$slots, "default", { key: 3 }, void 0, !0) : r("", !0)
43
+ }, 8, ["size", "color", "class"])) : r("", !0),
44
+ l(a).default ? u(o.$slots, "default", { key: 3 }, void 0, !0) : r("", !0)
44
45
  ], 2);
45
46
  };
46
47
  }
47
48
  });
48
49
  export {
49
- D as default
50
+ b as default
50
51
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=/* empty css */u=t.default(e.default,[["__scopeId","data-v-fc6d0e6d"]]);exports.default=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=/* empty css */u=t.default(e.default,[["__scopeId","data-v-1a817d2e"]]);exports.default=u;
@@ -1,7 +1,7 @@
1
1
  import o from "./index2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fc6d0e6d"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1a817d2e"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1 +1 @@
1
- "use strict";var _=Object.defineProperty;var s=(t,n)=>_(t,"name",{value:n,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=/* empty css */C=/* empty css */i=/* empty css */q=;/* empty css */;/* empty css */;/* empty css */;/* empty css */const h=/* empty css */E=e.defineComponent({name:"LSDocx"}),v=e.defineComponent({...E,props:C.docxProps,emits:i.previewEmits,setup(t,{emit:n}){const c=g.useNamespace("docx"),l=c.b(),d=s(()=>Promise.resolve().then(()=>require("../../../../../node_modules/.pnpm/docx-preview@0.3.6/node_modules/docx-preview/dist/docx-preview/index.cjs")),"docxPromise"),a=t,o=n,u=e.ref();e.watch(()=>a.source,r=>{r&&m(r)},{immediate:!0,deep:!0});async function m(r){if(!r||!q.isArrayBuffer(r)){h.ElMessage.error(i.fileEmpty),o("loadError");return}(await d()).renderAsync(r,u.value,u.value,{className:"docx",inWrapper:!0,ignoreWidth:!1,ignoreHeight:!0,ignoreFonts:!1,breakPages:!0,ignoreLastRenderedPageBreak:!0,experimental:!1,trimXmlDeclaration:!0,useBase64URL:!1,renderChanges:!1,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,debug:!1}).then(()=>{o("loadComplete")}).catch(()=>{o("loadError")})}s(m,"updateDocx");const p=s(()=>{a.onClose&&a.onClose(),o("update:source",[])},"closeFunc");return(r,f)=>{const x=e.resolveComponent("LSIcon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(l))},[e.createElementVNode("span",{class:e.normalizeClass([e.unref(c).e("btn"),e.unref(c).e("close")]),onClick:p},[e.createVNode(x,{name:"Close",size:24,color:"#FFF"})],2),e.createElementVNode("div",{ref_key:"docxRef",ref:u},null,512)],2)}}});exports.default=v;
1
+ "use strict";var h=Object.defineProperty;var t=(a,c)=>h(a,"name",{value:c,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=/* empty css */q=/* empty css */m=/* empty css */E=;/* empty css */;/* empty css */;/* empty css */;/* empty css */const F=/* empty css */y=e.defineComponent({name:"LSDocx"}),v=e.defineComponent({...y,props:q.docxProps,emits:m.previewEmits,setup(a,{emit:c}){const r=k.useNamespace("docx"),f=r.b(),p=t(()=>Promise.resolve().then(()=>require("../../../../../node_modules/.pnpm/docx-preview@0.3.6/node_modules/docx-preview/dist/docx-preview/index.cjs")),"docxPromise"),l=a,n=c,s=e.useAttrs(),g=e.computed(()=>s["has-download"]||s.hasDownload),u=e.computed(()=>s["download-loading"]||s.downloadLoading||!1),d=e.ref();e.watch(()=>l.source,o=>{o&&C(o)},{immediate:!0,deep:!0});async function C(o){if(!o||!E.isArrayBuffer(o)){F.ElMessage.error(m.fileEmpty),n("loadError");return}(await p()).renderAsync(o,d.value,d.value,{className:"docx",inWrapper:!0,ignoreWidth:!1,ignoreHeight:!0,ignoreFonts:!1,breakPages:!0,ignoreLastRenderedPageBreak:!0,experimental:!1,trimXmlDeclaration:!0,useBase64URL:!1,renderChanges:!1,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,debug:!1}).then(()=>{n("loadComplete")}).catch(()=>{n("loadError")})}t(C,"updateDocx");const w=t(()=>{l.onClose&&l.onClose(),n("update:source",[])},"closeFunc");function x(){n("download",s.downloadData)}return t(x,"onDownload"),(o,_)=>{const i=e.resolveComponent("LSIcon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(f))},[e.createElementVNode("span",{class:e.normalizeClass([e.unref(r).e("btn"),e.unref(r).e("close")]),onClick:w},[e.createVNode(i,{name:"Close",size:24,color:"#FFF"})],2),e.unref(g)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(r).e("btn"),e.unref(r).e("download")]),onClick:x},[e.createVNode(i,{class:e.normalizeClass({"is-loading":e.unref(u)}),name:`${e.unref(u)?"Loading":"Download"}`,size:24,color:"#FFF"},null,8,["class","name"])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"docxRef",ref:d},null,512)],2)}}});exports.default=v;
@@ -1,38 +1,38 @@
1
- var C = Object.defineProperty;
2
- var r = (t, s) => C(t, "name", { value: s, configurable: !0 });
3
- import { defineComponent as d, ref as E, watch as h, resolveComponent as F, createElementBlock as k, openBlock as y, normalizeClass as m, unref as i, createElementVNode as l, createVNode as B } from "vue";
4
- import { useNamespace as L } from "../../_hooks/useNamespace/index.js";
5
- import { docxProps as b } from "../types/index.js";
6
- import { previewEmits as N, fileEmpty as P } from "../../_constants/previewType/index.js";
7
- import { isArrayBuffer as R } from "../../_utils/check/index.js";
1
+ var y = Object.defineProperty;
2
+ var s = (c, d) => y(c, "name", { value: d, configurable: !0 });
3
+ import { defineComponent as C, useAttrs as b, computed as p, ref as B, watch as N, resolveComponent as P, createElementBlock as f, openBlock as g, normalizeClass as a, unref as e, createElementVNode as w, createCommentVNode as R, createVNode as x } from "vue";
4
+ import { useNamespace as v } from "../../_hooks/useNamespace/index.js";
5
+ import { docxProps as z } from "../types/index.js";
6
+ import { previewEmits as A, fileEmpty as S } from "../../_constants/previewType/index.js";
7
+ import { isArrayBuffer as V } from "../../_utils/check/index.js";
8
8
  /* empty css */
9
9
  /* empty css */
10
10
  /* empty css */
11
- import { ElMessage as v } from "../../../../../node_modules/.pnpm/element-plus@2.10.7_vue@3.5.18_typescript@5.9.2_/node_modules/element-plus/es/components/message/index/index.js";
12
- const w = d({
11
+ import { ElMessage as H } from "../../../../../node_modules/.pnpm/element-plus@2.10.7_vue@3.5.18_typescript@5.9.2_/node_modules/element-plus/es/components/message/index/index.js";
12
+ const I = C({
13
13
  name: "LSDocx"
14
- }), X = /* @__PURE__ */ d({
15
- ...w,
16
- props: b,
17
- emits: N,
18
- setup(t, { emit: s }) {
19
- const n = L("docx"), p = n.b(), u = /* @__PURE__ */ r(() => import("../../../../../node_modules/.pnpm/docx-preview@0.3.6/node_modules/docx-preview/dist/docx-preview/index.js"), "docxPromise"), c = t, o = s, a = E();
20
- h(
21
- () => c.source,
22
- (e) => {
23
- e && f(e);
14
+ }), O = /* @__PURE__ */ C({
15
+ ...I,
16
+ props: z,
17
+ emits: A,
18
+ setup(c, { emit: d }) {
19
+ const r = v("docx"), _ = r.b(), h = /* @__PURE__ */ s(() => import("../../../../../node_modules/.pnpm/docx-preview@0.3.6/node_modules/docx-preview/dist/docx-preview/index.js"), "docxPromise"), l = c, n = d, t = b(), F = p(() => t["has-download"] || t.hasDownload), m = p(() => t["download-loading"] || t.downloadLoading || !1), i = B();
20
+ N(
21
+ () => l.source,
22
+ (o) => {
23
+ o && k(o);
24
24
  },
25
25
  {
26
26
  immediate: !0,
27
27
  deep: !0
28
28
  }
29
29
  );
30
- async function f(e) {
31
- if (!e || !R(e)) {
32
- v.error(P), o("loadError");
30
+ async function k(o) {
31
+ if (!o || !V(o)) {
32
+ H.error(S), n("loadError");
33
33
  return;
34
34
  }
35
- (await u()).renderAsync(e, a.value, a.value, {
35
+ (await h()).renderAsync(o, i.value, i.value, {
36
36
  className: "docx",
37
37
  //class name/prefix for default and document style classes
38
38
  inWrapper: !0,
@@ -66,38 +66,53 @@ const w = d({
66
66
  debug: !1
67
67
  //enables additional logging
68
68
  }).then(() => {
69
- o("loadComplete");
69
+ n("loadComplete");
70
70
  }).catch(() => {
71
- o("loadError");
71
+ n("loadError");
72
72
  });
73
73
  }
74
- r(f, "updateDocx");
75
- const x = /* @__PURE__ */ r(() => {
76
- c.onClose && c.onClose(), o("update:source", []);
74
+ s(k, "updateDocx");
75
+ const D = /* @__PURE__ */ s(() => {
76
+ l.onClose && l.onClose(), n("update:source", []);
77
77
  }, "closeFunc");
78
- return (e, _) => {
79
- const g = F("LSIcon");
80
- return y(), k("div", {
81
- class: m(i(p))
78
+ function E() {
79
+ n("download", t.downloadData);
80
+ }
81
+ return s(E, "onDownload"), (o, L) => {
82
+ const u = P("LSIcon");
83
+ return g(), f("div", {
84
+ class: a(e(_))
82
85
  }, [
83
- l("span", {
84
- class: m([i(n).e("btn"), i(n).e("close")]),
85
- onClick: x
86
+ w("span", {
87
+ class: a([e(r).e("btn"), e(r).e("close")]),
88
+ onClick: D
86
89
  }, [
87
- B(g, {
90
+ x(u, {
88
91
  name: "Close",
89
92
  size: 24,
90
93
  color: "#FFF"
91
94
  })
92
95
  ], 2),
93
- l("div", {
96
+ e(F) ? (g(), f("span", {
97
+ key: 0,
98
+ class: a([e(r).e("btn"), e(r).e("download")]),
99
+ onClick: E
100
+ }, [
101
+ x(u, {
102
+ class: a({ "is-loading": e(m) }),
103
+ name: `${e(m) ? "Loading" : "Download"}`,
104
+ size: 24,
105
+ color: "#FFF"
106
+ }, null, 8, ["class", "name"])
107
+ ], 2)) : R("", !0),
108
+ w("div", {
94
109
  ref_key: "docxRef",
95
- ref: a
110
+ ref: i
96
111
  }, null, 512)
97
112
  ], 2);
98
113
  };
99
114
  }
100
115
  });
101
116
  export {
102
- X as default
117
+ O as default
103
118
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=/* empty css */u=t.default(e.default,[["__scopeId","data-v-32195920"]]);exports.default=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=/* empty css */u=t.default(e.default,[["__scopeId","data-v-a3df1ad0"]]);exports.default=u;
@@ -1,7 +1,7 @@
1
1
  import o from "./index2.js";
2
2
  /* empty css */
3
3
  import r from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
4
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-32195920"]]);
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-a3df1ad0"]]);
5
5
  export {
6
- m as default
6
+ e as default
7
7
  };
@@ -1 +1 @@
1
- "use strict";var y=Object.defineProperty;var l=(r,a)=>y(r,"name",{value:a,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */const e=require("vue"),c=/* empty css */L=/* empty css */_=/* empty css */q=/* empty css */v=/* empty css */B=e.defineComponent({name:"LSPreviewDocx"}),E=e.defineComponent({...B,name:"LSPreviewDocx",components:{LSDocx:c.default},inheritAttrs:!1,props:e.mergeModels(_.lsPreviewProp,{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["loadComplete","loadError"],["update:modelValue"]),setup(r,{emit:a}){const u=a,d=r,n=e.useModel(r,"modelValue"),{comClass:w,defAttrs:i,closeLoading:m,watermarkStyle:C}=L.default(d,n),p=l(()=>{m(),u("loadComplete")},"loadComplete"),f=l(()=>{m(),u("loadError")},"loadError");function P(o){var s,t,k,g;d.hideOnClickModal&&(o.target===o.currentTarget||(t=(s=o==null?void 0:o.target)==null?void 0:s.className)!=null&&t.includes&&((g=(k=o==null?void 0:o.target)==null?void 0:k.className)!=null&&g.includes("docx-wrapper")))&&(n.value=!1)}return l(P,"closePreview"),(o,s)=>{const t=q.ElWatermark;return n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(w)),onClick:P},[o.showWatermark?(e.openBlock(),e.createBlock(t,e.mergeProps({key:0},o.watermarkOption,{style:e.unref(C)}),{default:e.withCtx(()=>[e.createVNode(c.default,e.mergeProps(e.unref(v.default)(e.unref(i),o.$attrs),{onLoadComplete:p,onLoadError:f}),null,16)]),_:1},16,["style"])):(e.openBlock(),e.createBlock(c.default,e.mergeProps({key:1},e.unref(v.default)(e.unref(i),o.$attrs),{onLoadComplete:p,onLoadError:f}),null,16))],2)):e.createCommentVNode("",!0)}}});exports.default=E;
1
+ "use strict";var y=Object.defineProperty;var l=(r,a)=>y(r,"name",{value:a,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */const e=require("vue"),c=/* empty css */_=/* empty css */E=/* empty css */L=/* empty css */w=/* empty css */q={class:"ls-preview-extra"},B=e.defineComponent({name:"LSPreviewDocx"}),M=e.defineComponent({...B,name:"LSPreviewDocx",components:{LSDocx:c.default},inheritAttrs:!1,props:e.mergeModels(E.lsPreviewProp,{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["loadComplete","loadError"],["update:modelValue"]),setup(r,{emit:a}){const d=a,i=r,n=e.useModel(r,"modelValue"),{comClass:g,defAttrs:u,closeLoading:m,watermarkStyle:C}=_.default(i,n),p=l(()=>{m(),d("loadComplete")},"loadComplete"),f=l(()=>{m(),d("loadError")},"loadError");function P(o){var s,t,k,v;i.hideOnClickModal&&(o.target===o.currentTarget||(t=(s=o==null?void 0:o.target)==null?void 0:s.className)!=null&&t.includes&&((v=(k=o==null?void 0:o.target)==null?void 0:k.className)!=null&&v.includes("docx-wrapper")))&&(n.value=!1)}return l(P,"closePreview"),(o,s)=>{const t=L.ElWatermark;return n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(g)),onClick:P},[o.showWatermark?(e.openBlock(),e.createBlock(t,e.mergeProps({key:0},o.watermarkOption,{style:e.unref(C)}),{default:e.withCtx(()=>[e.createVNode(c.default,e.mergeProps(e.unref(w.default)(e.unref(u),o.$attrs),{onLoadComplete:p,onLoadError:f}),null,16)]),_:1},16,["style"])):(e.openBlock(),e.createBlock(c.default,e.mergeProps({key:1},e.unref(w.default)(e.unref(u),o.$attrs),{onLoadComplete:p,onLoadError:f}),null,16)),e.createElementVNode("div",q,[e.renderSlot(o.$slots,"extra",{},void 0,!0)])],2)):e.createCommentVNode("",!0)}}});exports.default=M;
@@ -1,22 +1,22 @@
1
1
  var h = Object.defineProperty;
2
2
  var a = (r, l) => h(r, "name", { value: l, configurable: !0 });
3
3
  /* empty css */
4
- import { defineComponent as E, mergeModels as g, useModel as B, createElementBlock as M, createCommentVNode as N, openBlock as n, normalizeClass as S, unref as o, createBlock as L, mergeProps as i, withCtx as x, createVNode as D } from "vue";
5
- import c from "../Docx.vue/index.js";
6
- import A from "../../_hooks/usePreviewHook/index.js";
7
- import { lsPreviewProp as O } from "../../_constants/previewType/index.js";
8
- import { ElWatermark as W } from "../../../../../node_modules/.pnpm/element-plus@2.10.7_vue@3.5.18_typescript@5.9.2_/node_modules/element-plus/es/components/watermark/index/index.js";
9
- import y from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
10
- const $ = E({
4
+ import { defineComponent as y, mergeModels as g, useModel as N, createElementBlock as S, createCommentVNode as x, openBlock as n, normalizeClass as B, unref as o, createBlock as E, createElementVNode as M, mergeProps as i, withCtx as D, createVNode as $, renderSlot as A } from "vue";
5
+ import d from "../Docx.vue/index.js";
6
+ import O from "../../_hooks/usePreviewHook/index.js";
7
+ import { lsPreviewProp as W } from "../../_constants/previewType/index.js";
8
+ import { ElWatermark as b } from "../../../../../node_modules/.pnpm/element-plus@2.10.7_vue@3.5.18_typescript@5.9.2_/node_modules/element-plus/es/components/watermark/index/index.js";
9
+ import L from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
10
+ const z = { class: "ls-preview-extra" }, H = y({
11
11
  name: "LSPreviewDocx"
12
- }), I = /* @__PURE__ */ E({
13
- ...$,
12
+ }), Q = /* @__PURE__ */ y({
13
+ ...H,
14
14
  name: "LSPreviewDocx",
15
15
  components: {
16
- LSDocx: c
16
+ LSDocx: d
17
17
  },
18
18
  inheritAttrs: !1,
19
- props: /* @__PURE__ */ g(O, {
19
+ props: /* @__PURE__ */ g(W, {
20
20
  modelValue: {
21
21
  type: Boolean
22
22
  },
@@ -24,38 +24,41 @@ const $ = E({
24
24
  }),
25
25
  emits: /* @__PURE__ */ g(["loadComplete", "loadError"], ["update:modelValue"]),
26
26
  setup(r, { emit: l }) {
27
- const d = l, p = r, m = B(r, "modelValue"), { comClass: P, defAttrs: u, closeLoading: f, watermarkStyle: V } = A(p, m), k = /* @__PURE__ */ a(() => {
28
- f(), d("loadComplete");
27
+ const c = l, p = r, s = N(r, "modelValue"), { comClass: P, defAttrs: u, closeLoading: f, watermarkStyle: V } = O(p, s), k = /* @__PURE__ */ a(() => {
28
+ f(), c("loadComplete");
29
29
  }, "loadComplete"), w = /* @__PURE__ */ a(() => {
30
- f(), d("loadError");
30
+ f(), c("loadError");
31
31
  }, "loadError");
32
32
  function _(e) {
33
- var s, t, C, v;
34
- p.hideOnClickModal && (e.target === e.currentTarget || (t = (s = e == null ? void 0 : e.target) == null ? void 0 : s.className) != null && t.includes && ((v = (C = e == null ? void 0 : e.target) == null ? void 0 : C.className) != null && v.includes("docx-wrapper"))) && (m.value = !1);
33
+ var m, t, v, C;
34
+ p.hideOnClickModal && (e.target === e.currentTarget || (t = (m = e == null ? void 0 : e.target) == null ? void 0 : m.className) != null && t.includes && ((C = (v = e == null ? void 0 : e.target) == null ? void 0 : v.className) != null && C.includes("docx-wrapper"))) && (s.value = !1);
35
35
  }
36
- return a(_, "closePreview"), (e, s) => {
37
- const t = W;
38
- return m.value ? (n(), M("div", {
36
+ return a(_, "closePreview"), (e, m) => {
37
+ const t = b;
38
+ return s.value ? (n(), S("div", {
39
39
  key: 0,
40
- class: S(o(P)),
40
+ class: B(o(P)),
41
41
  onClick: _
42
42
  }, [
43
- e.showWatermark ? (n(), L(t, i({ key: 0 }, e.watermarkOption, { style: o(V) }), {
44
- default: x(() => [
45
- D(c, i(o(y)(o(u), e.$attrs), {
43
+ e.showWatermark ? (n(), E(t, i({ key: 0 }, e.watermarkOption, { style: o(V) }), {
44
+ default: D(() => [
45
+ $(d, i(o(L)(o(u), e.$attrs), {
46
46
  onLoadComplete: k,
47
47
  onLoadError: w
48
48
  }), null, 16)
49
49
  ]),
50
50
  _: 1
51
- }, 16, ["style"])) : (n(), L(c, i({ key: 1 }, o(y)(o(u), e.$attrs), {
51
+ }, 16, ["style"])) : (n(), E(d, i({ key: 1 }, o(L)(o(u), e.$attrs), {
52
52
  onLoadComplete: k,
53
53
  onLoadError: w
54
- }), null, 16))
55
- ], 2)) : N("", !0);
54
+ }), null, 16)),
55
+ M("div", z, [
56
+ A(e.$slots, "extra", {}, void 0, !0)
57
+ ])
58
+ ], 2)) : x("", !0);
56
59
  };
57
60
  }
58
61
  });
59
62
  export {
60
- I as default
63
+ Q as default
61
64
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=/* empty css */u=t.default(e.default,[["__scopeId","data-v-5062cdd1"]]);exports.default=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=/* empty css */u=t.default(e.default,[["__scopeId","data-v-fbf0760a"]]);exports.default=u;
@@ -1,7 +1,7 @@
1
1
  import o from "./index2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5062cdd1"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fbf0760a"]]);
5
5
  export {
6
- p as default
6
+ r as default
7
7
  };
@@ -1 +1 @@
1
- "use strict";var te=Object.defineProperty;var a=(z,V)=>te(z,"name",{value:V,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),F=require("../../../../../node_modules/.pnpm/@vueuse_core@12.8.2_typescript@5.9.2/node_modules/@vueuse/core/index/index.cjs"),oe=require("../../_hooks/useNamespace/index.cjs"),se=require("../../_hooks/useZIndex/index.cjs"),E=require("../../_constants/aria/index.cjs"),h=require("../../_utils/check/index.cjs"),ae=require("../../_utils/types/index.cjs"),re=require("../types/index.cjs"),le=require("../../_constants/previewType/index.cjs"),d=require("../../icon/Index.vue/index.cjs"),D=require("../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/throttle/index.cjs"),j=require("../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.cjs"),ie=["src"],ce=["src"],ue=e.defineComponent({name:"LSImage"}),de=e.defineComponent({...ue,props:re.imageViewerProps,emits:le.previewEmits,setup(z,{expose:V,emit:Z}){const v={CONTAIN:{name:"FullScreen"},ORIGINAL:{name:"ScaleToOriginal"}},H=h.isFirefox()?"DOMMouseScroll":"mousewheel",l=z,w=Z,S=e.useAttrs(),s=oe.useNamespace("image"),{nextZIndex:P}=se.useZIndex(),I=e.ref(),T=e.ref([]),B=e.effectScope(),k=e.ref(!0),f=e.ref(l.initialIndex),N=e.shallowRef(v.CONTAIN),r=e.reactive({scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1,width:"auto",height:"auto",objectFit:"contain"}),G=e.computed(()=>{const{source:n}=l||{};return h.isString(n)||n.length<=1}),L=e.computed(()=>f.value===0),M=e.computed(()=>{const n=l.source;return f.value===n.length-1}),W=e.computed(()=>(l.source||{})[f.value]),q=e.computed(()=>{const{scale:n,deg:o,offsetX:t,offsetY:i,enableTransition:u,width:b,height:x,objectFit:C}=r;let m=t/n,p=i/n;switch(o%360){case 90:case-270:[m,p]=[p,-m];break;case 180:case-180:[m,p]=[-m,-p];break;case 270:case-90:[m,p]=[-p,m];break}const g={transform:`scale(${n}) rotate(${o}deg) translate(${m}px, ${p}px)`,transition:u?"transform .3s":""};return N.value.name===v.CONTAIN.name&&(g.maxWidth=g.maxHeight="100%"),g.width=b,g.height=x,g.objectFit=C,g}),J=e.computed(()=>h.isNumber(l.zIndex)?l.zIndex:P()),K=a(()=>{l.onClose&&l.onClose(),w("update:source",[])},"closeFunc");function y(){U(),K()}a(y,"hide");function Q(){const n=D.default(t=>{switch(t.code){case E.EVENT_CODE.esc:l.closeOnPressEscape&&y();break;case E.EVENT_CODE.space:X();break;case E.EVENT_CODE.left:Y();break;case E.EVENT_CODE.up:c("zoomIn");break;case E.EVENT_CODE.right:_();break;case E.EVENT_CODE.down:c("zoomOut");break}}),o=D.default(t=>{(t.wheelDelta?t.wheelDelta:-t.detail)>0?c("zoomIn",{zoomRate:1.2,enableTransition:!1}):c("zoomOut",{zoomRate:1.2,enableTransition:!1})});B.run(()=>{F.useEventListener(document,"keydown",n),F.useEventListener(document,H,o)})}a(Q,"registerEventListener");function U(){B.stop()}a(U,"unregisterEventListener");function $(){k.value=!1,w("loadComplete")}a($,"handleImgLoad");function A(n){k.value=!1,n.target.alt="ls.image.error",w("loadError")}a(A,"handleImgError");function R(n){if(k.value||n.button!==0||!I.value)return;r.enableTransition=!1;const{offsetX:o,offsetY:t}=r,i=n.pageX,u=n.pageY,b=D.default(C=>{r.offsetX=o+C.pageX-i,r.offsetY=t+C.pageY-u}),x=F.useEventListener(document,"mousemove",b);F.useEventListener(document,"mouseup",()=>{x()}),n.preventDefault()}a(R,"handleMouseDown");function ee(){j.default(r,{scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1,width:"auto",height:"auto",objectFit:"contain"})}a(ee,"reset");function ne(){j.default(r,{scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1,width:"100%",height:"100%",objectFit:"contain"})}a(ne,"fullScreen");function X(){if(k.value)return;const n=ae.keysOf(v),o=Object.values(v),t=N.value.name,u=(o.findIndex(b=>b.name===t)+1)%n.length;N.value=v[n[u]],t===v.CONTAIN.name?ne():ee()}a(X,"toggleMode");function O(n){const t=l.source.length;f.value=(n+t)%t}a(O,"setActiveItem");function Y(){L.value&&!l.infinite||O(f.value-1)}a(Y,"prev");function _(){M.value&&!l.infinite||O(f.value+1)}a(_,"next");function c(n,o={}){if(k.value)return;const{zoomRate:t,rotateDeg:i,enableTransition:u}={zoomRate:1.4,rotateDeg:90,enableTransition:!0,...o};switch(n){case"zoomOut":r.scale>.2&&(r.scale=Number.parseFloat((r.scale/t).toFixed(3)));break;case"zoomIn":r.scale<7&&(r.scale=Number.parseFloat((r.scale*t).toFixed(3)));break;case"clockwise":r.deg+=i;break;case"anticlockwise":r.deg-=i;break;case"download":w("download",S.downloadData);break}r.enableTransition=u}return a(c,"handleActions"),e.watch(W,()=>{e.nextTick(()=>{const n=T.value[0];n!=null&&n.complete||(k.value=!0)})}),e.watch(f,n=>{w("switch",n)}),e.onMounted(()=>{var n,o;Q(),(o=(n=I.value)==null?void 0:n.focus)==null||o.call(n)}),V({setActiveItem:O}),(n,o)=>(e.openBlock(),e.createElementBlock("div",null,[(e.openBlock(),e.createBlock(e.Teleport,{to:"body",disabled:!n.teleported},[e.createVNode(e.Transition,{name:"viewer-fade",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"wrapper",ref:I,tabindex:-1,class:e.normalizeClass(e.unref(s).e("wrapper")),style:e.normalizeStyle({zIndex:e.unref(J)})},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(s).e("mask")),onClick:o[0]||(o[0]=e.withModifiers(t=>n.hideOnClickModal&&y(),["self"]))},null,2),e.createElementVNode("span",{class:e.normalizeClass([e.unref(s).e("btn"),e.unref(s).e("close")]),onClick:y},[e.createVNode(d.default,{name:"Close",size:24,color:"#FFF"})],2),e.unref(G)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",{class:e.normalizeClass([e.unref(s).e("btn"),e.unref(s).e("prev"),e.unref(s).is("disabled",!n.infinite&&e.unref(L))]),onClick:Y},[e.createVNode(d.default,{name:"ArrowLeft",size:24,color:"#FFF"})],2),e.createElementVNode("span",{class:e.normalizeClass([e.unref(s).e("btn"),e.unref(s).e("next"),e.unref(s).is("disabled",!n.infinite&&e.unref(M))]),onClick:_},[e.createVNode(d.default,{name:"ArrowRight",size:24,color:"#FFF"})],2)],64)),e.createElementVNode("div",{class:e.normalizeClass([e.unref(s).e("btn"),e.unref(s).e("actions")])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(s).e("actions__inner"))},[e.createVNode(d.default,{name:"ZoomOut",size:24,color:"#FFF",onClick:o[1]||(o[1]=t=>c("zoomOut"))}),e.createVNode(d.default,{name:"ZoomIn",size:24,color:"#FFF",onClick:o[2]||(o[2]=t=>c("zoomIn"))}),e.createElementVNode("i",{class:e.normalizeClass(e.unref(s).e("actions__divider"))},null,2),e.createVNode(d.default,{name:e.unref(N).name,size:24,color:"#FFF",onClick:X},null,8,["name"]),e.createElementVNode("i",{class:e.normalizeClass(e.unref(s).e("actions__divider"))},null,2),e.createVNode(d.default,{name:"RefreshLeft",size:24,color:"#FFF",onClick:o[3]||(o[3]=t=>c("anticlockwise"))}),e.createVNode(d.default,{name:"RefreshRight",size:24,color:"#FFF",onClick:o[4]||(o[4]=t=>c("clockwise"))}),e.unref(S).hasDownload?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("i",{class:e.normalizeClass(e.unref(s).e("actions__divider"))},null,2),e.createVNode(d.default,{name:"Download",size:24,color:"#FFF",onClick:o[5]||(o[5]=t=>c("download"))})],64)):e.createCommentVNode("",!0)],2)],2),n.source?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(s).e("canvas"))},[e.unref(h.isArray)(n.source)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.source,(t,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("img",{ref_for:!0,ref:a(u=>e.unref(T)[i]=u,"ref"),key:t,src:t,style:e.normalizeStyle(e.unref(q)),class:e.normalizeClass(e.unref(s).e("img")),onLoad:$,onError:A,onMousedown:R},null,46,ie)),[[e.vShow,i===e.unref(f)]])),128)):(e.openBlock(),e.createElementBlock("img",{ref:a(t=>e.unref(T)[0]=t,"ref"),key:n.source,src:n.source,style:e.normalizeStyle(e.unref(q)),class:e.normalizeClass(e.unref(s).e("img")),onLoad:$,onError:A,onMousedown:R},null,46,ce))],2)):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"viewer",{},void 0,!0),e.renderSlot(n.$slots,"default",{},void 0,!0)],6)]),_:3})],8,["disabled"]))]))}});exports.default=de;
1
+ "use strict";var oe=Object.defineProperty;var a=(V,I)=>oe(V,"name",{value:I,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../../../../../node_modules/.pnpm/@vueuse_core@12.8.2_typescript@5.9.2/node_modules/@vueuse/core/index/index.cjs"),se=require("../../_hooks/useNamespace/index.cjs"),ae=require("../../_hooks/useZIndex/index.cjs"),w=require("../../_constants/aria/index.cjs"),z=require("../../_utils/check/index.cjs"),re=require("../../_utils/types/index.cjs"),le=require("../types/index.cjs"),ie=require("../../_constants/previewType/index.cjs"),d=require("../../icon/Index.vue/index.cjs"),D=require("../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/throttle/index.cjs"),Z=require("../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.cjs"),ce=["src"],ue=["src"],de=e.defineComponent({name:"LSImage"}),fe=e.defineComponent({...de,props:le.imageViewerProps,emits:ie.previewEmits,setup(V,{expose:I,emit:H}){const v={CONTAIN:{name:"FullScreen"},ORIGINAL:{name:"ScaleToOriginal"}},P=z.isFirefox()?"DOMMouseScroll":"mousewheel",l=V,E=H,C=e.useAttrs(),S=e.computed(()=>C["download-loading"]||C.downloadLoading||!1),s=se.useNamespace("image"),{nextZIndex:G}=ae.useZIndex(),T=e.ref(),y=e.ref([]),B=e.effectScope(),g=e.ref(!0),f=e.ref(l.initialIndex),N=e.shallowRef(v.CONTAIN),r=e.reactive({scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1,width:"auto",height:"auto",objectFit:"contain"}),W=e.computed(()=>{const{source:n}=l||{};return z.isString(n)||n.length<=1}),M=e.computed(()=>f.value===0),$=e.computed(()=>{const n=l.source;return f.value===n.length-1}),J=e.computed(()=>(l.source||{})[f.value]),q=e.computed(()=>{const{scale:n,deg:o,offsetX:t,offsetY:i,enableTransition:u,width:b,height:L,objectFit:F}=r;let m=t/n,p=i/n;switch(o%360){case 90:case-270:[m,p]=[p,-m];break;case 180:case-180:[m,p]=[-m,-p];break;case 270:case-90:[m,p]=[-p,m];break}const k={transform:`scale(${n}) rotate(${o}deg) translate(${m}px, ${p}px)`,transition:u?"transform .3s":""};return N.value.name===v.CONTAIN.name&&(k.maxWidth=k.maxHeight="100%"),k.width=b,k.height=L,k.objectFit=F,k}),K=e.computed(()=>z.isNumber(l.zIndex)?l.zIndex:G()),Q=a(()=>{l.onClose&&l.onClose(),E("update:source",[])},"closeFunc");function O(){ee(),Q()}a(O,"hide");function U(){const n=D.default(t=>{switch(t.code){case w.EVENT_CODE.esc:l.closeOnPressEscape&&O();break;case w.EVENT_CODE.space:Y();break;case w.EVENT_CODE.left:_();break;case w.EVENT_CODE.up:c("zoomIn");break;case w.EVENT_CODE.right:j();break;case w.EVENT_CODE.down:c("zoomOut");break}}),o=D.default(t=>{(t.wheelDelta?t.wheelDelta:-t.detail)>0?c("zoomIn",{zoomRate:1.2,enableTransition:!1}):c("zoomOut",{zoomRate:1.2,enableTransition:!1})});B.run(()=>{h.useEventListener(document,"keydown",n),h.useEventListener(document,P,o)})}a(U,"registerEventListener");function ee(){B.stop()}a(ee,"unregisterEventListener");function A(){g.value=!1,E("loadComplete")}a(A,"handleImgLoad");function R(n){g.value=!1,n.target.alt="ls.image.error",E("loadError")}a(R,"handleImgError");function X(n){if(g.value||n.button!==0||!T.value)return;r.enableTransition=!1;const{offsetX:o,offsetY:t}=r,i=n.pageX,u=n.pageY,b=D.default(F=>{r.offsetX=o+F.pageX-i,r.offsetY=t+F.pageY-u}),L=h.useEventListener(document,"mousemove",b);h.useEventListener(document,"mouseup",()=>{L()}),n.preventDefault()}a(X,"handleMouseDown");function ne(){Z.default(r,{scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1,width:"auto",height:"auto",objectFit:"contain"})}a(ne,"reset");function te(){Z.default(r,{scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1,width:"100%",height:"100%",objectFit:"contain"})}a(te,"fullScreen");function Y(){if(g.value)return;const n=re.keysOf(v),o=Object.values(v),t=N.value.name,u=(o.findIndex(b=>b.name===t)+1)%n.length;N.value=v[n[u]],t===v.CONTAIN.name?te():ne()}a(Y,"toggleMode");function x(n){const t=l.source.length;f.value=(n+t)%t}a(x,"setActiveItem");function _(){M.value&&!l.infinite||x(f.value-1)}a(_,"prev");function j(){$.value&&!l.infinite||x(f.value+1)}a(j,"next");function c(n,o={}){if(g.value)return;const{zoomRate:t,rotateDeg:i,enableTransition:u}={zoomRate:1.4,rotateDeg:90,enableTransition:!0,...o};switch(n){case"zoomOut":r.scale>.2&&(r.scale=Number.parseFloat((r.scale/t).toFixed(3)));break;case"zoomIn":r.scale<7&&(r.scale=Number.parseFloat((r.scale*t).toFixed(3)));break;case"clockwise":r.deg+=i;break;case"anticlockwise":r.deg-=i;break;case"download":E("download",C.downloadData);break}r.enableTransition=u}return a(c,"handleActions"),e.watch(J,()=>{e.nextTick(()=>{const n=y.value[0];n!=null&&n.complete||(g.value=!0)})}),e.watch(f,n=>{E("switch",n)}),e.onMounted(()=>{var n,o;U(),(o=(n=T.value)==null?void 0:n.focus)==null||o.call(n)}),I({setActiveItem:x}),(n,o)=>(e.openBlock(),e.createElementBlock("div",null,[(e.openBlock(),e.createBlock(e.Teleport,{to:"body",disabled:!n.teleported},[e.createVNode(e.Transition,{name:"viewer-fade",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"wrapper",ref:T,tabindex:-1,class:e.normalizeClass(e.unref(s).e("wrapper")),style:e.normalizeStyle({zIndex:e.unref(K)})},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(s).e("mask")),onClick:o[0]||(o[0]=e.withModifiers(t=>n.hideOnClickModal&&O(),["self"]))},null,2),e.createElementVNode("span",{class:e.normalizeClass([e.unref(s).e("btn"),e.unref(s).e("close")]),onClick:O},[e.createVNode(d.default,{name:"Close",size:24,color:"#FFF"})],2),e.unref(W)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",{class:e.normalizeClass([e.unref(s).e("btn"),e.unref(s).e("prev"),e.unref(s).is("disabled",!n.infinite&&e.unref(M))]),onClick:_},[e.createVNode(d.default,{name:"ArrowLeft",size:24,color:"#FFF"})],2),e.createElementVNode("span",{class:e.normalizeClass([e.unref(s).e("btn"),e.unref(s).e("next"),e.unref(s).is("disabled",!n.infinite&&e.unref($))]),onClick:j},[e.createVNode(d.default,{name:"ArrowRight",size:24,color:"#FFF"})],2)],64)),e.createElementVNode("div",{class:e.normalizeClass([e.unref(s).e("btn"),e.unref(s).e("actions")])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(s).e("actions__inner"))},[e.createVNode(d.default,{name:"ZoomOut",size:24,color:"#FFF",onClick:o[1]||(o[1]=t=>c("zoomOut"))}),e.createVNode(d.default,{name:"ZoomIn",size:24,color:"#FFF",onClick:o[2]||(o[2]=t=>c("zoomIn"))}),e.createElementVNode("i",{class:e.normalizeClass(e.unref(s).e("actions__divider"))},null,2),e.createVNode(d.default,{name:e.unref(N).name,size:24,color:"#FFF",onClick:Y},null,8,["name"]),e.createElementVNode("i",{class:e.normalizeClass(e.unref(s).e("actions__divider"))},null,2),e.createVNode(d.default,{name:"RefreshLeft",size:24,color:"#FFF",onClick:o[3]||(o[3]=t=>c("anticlockwise"))}),e.createVNode(d.default,{name:"RefreshRight",size:24,color:"#FFF",onClick:o[4]||(o[4]=t=>c("clockwise"))}),e.unref(C).hasDownload?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("i",{class:e.normalizeClass(e.unref(s).e("actions__divider"))},null,2),e.createVNode(d.default,{class:e.normalizeClass({"is-loading":e.unref(S)}),name:`${e.unref(S)?"Loading":"Download"}`,size:24,color:"#FFF",onClick:o[5]||(o[5]=t=>c("download"))},null,8,["class","name"])],64)):e.createCommentVNode("",!0)],2)],2),n.source?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(s).e("canvas"))},[e.unref(z.isArray)(n.source)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.source,(t,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("img",{ref_for:!0,ref:a(u=>e.unref(y)[i]=u,"ref"),key:t,src:t,style:e.normalizeStyle(e.unref(q)),class:e.normalizeClass(e.unref(s).e("img")),onLoad:A,onError:R,onMousedown:X},null,46,ce)),[[e.vShow,i===e.unref(f)]])),128)):(e.openBlock(),e.createElementBlock("img",{ref:a(t=>e.unref(y)[0]=t,"ref"),key:n.source,src:n.source,style:e.normalizeStyle(e.unref(q)),class:e.normalizeClass(e.unref(s).e("img")),onLoad:A,onError:R,onMousedown:X},null,46,ue))],2)):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"viewer",{},void 0,!0),e.renderSlot(n.$slots,"default",{},void 0,!0)],6)]),_:3})],8,["disabled"]))]))}});exports.default=fe;