@lingshugroup/web-plus 1.7.9 → 1.7.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.
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-4bd2bd33"]]);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-083051d7"]]);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-4bd2bd33"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-083051d7"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1 +1 @@
1
- "use strict";var D=Object.defineProperty;var n=(p,m)=>D(p,"name",{value:m,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),T=,/* empty css */$=,/* empty css */E=,/* empty css */I=,/* empty css */M=,/* empty css */F={class:"opt-wrap"},j={key:0,class:"page-wrap"},O={class:"num-wrap"},A={key:1,class:"size-wrap"},G={class:"num-wrap"},H={class:"pdf-content"},J={key:1,class:"infinite-list-wrapper",style:{overflow:"auto"}},K=["infinite-scroll-disabled"],Q=e.defineComponent({name:"LSPdf"}),R=e.defineComponent({...Q,props:{source:{},onClose:{},showSize:{type:Boolean,default:!0}},emits:["annotation","highlight","loaded","textLoaded","annotationLoaded","xfaLoaded","loadComplete","loadError","update:source"],setup(p,{emit:m}){const v=T.useNamespace("pdf"),B=v.b(),_=e.ref(void 0),l=e.ref(1),a=e.ref(0),t=e.ref(1),i=e.ref(!0),C=e.ref(!1),c=p,k=m;e.watch(()=>c.source,()=>{b()},{immediate:!0,deep:!0});const V=e.computed(()=>i.value?"取消分页":"分页展示");async function b(){if(c.source)try{const{pdf:r,processLoadingTask:o,pages:s}=$.usePDF(c.source,{onError:d});await o(c.source),_.value=r.value,a.value=s.value,g()}catch{d()}finally{C.value=!0}}n(b,"initPdf");const h=n(()=>{C.value=!1,c.onClose&&c.onClose(),k("update:source")},"closeFunc");function w(){l.value>1&&l.value--}n(w,"prevPdf");function P(){l.value<a.value&&l.value++}n(P,"nextPdf");function N(r){r===0?t.value=t.value>.25?t.value-.25:t.value:t.value=t.value<2?t.value+.25:t.value}n(N,"scalePdf");const y=e.ref(!1),u=e.ref(0),S=n(()=>{if(u.value>=a.value){y.value=!0;return}u.value++},"load");function L(){i.value=!i.value,i.value||(y.value=!1,u.value=a.value>10?10:a.value)}n(L,"changePagition");function g(){k("loadComplete")}n(g,"loadComplete");function d(){k("loadError")}return n(d,"loadError"),(r,o)=>{const s=e.resolveComponent("LSButton"),x=e.resolveComponent("LSIcon"),z=I.ElScrollbar,q=M.ElInfiniteScroll;return e.unref(C)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(B))},[e.createElementVNode("div",F,[e.unref(i)?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(s,{type:"primary",size:"small",disabled:e.unref(l)==1,onClick:w},{default:e.withCtx(()=>o[2]||(o[2]=[e.createTextVNode("上一页")])),_:1},8,["disabled"]),e.createElementVNode("span",O,e.toDisplayString(e.unref(l))+" / "+e.toDisplayString(e.unref(a)),1),e.createVNode(s,{type:"primary",size:"small",disabled:e.unref(l)==e.unref(a),onClick:P},{default:e.withCtx(()=>o[3]||(o[3]=[e.createTextVNode("下一页")])),_:1},8,["disabled"])])):e.createCommentVNode("",!0),r.showSize?(e.openBlock(),e.createElementBlock("div",A,[e.createVNode(s,{type:"primary",icon:"Minus",size:"small",disabled:e.unref(t)==.25,onClick:o[0]||(o[0]=f=>N(0))},null,8,["disabled"]),e.createElementVNode("span",G,e.toDisplayString(e.unref(t)*100)+"%",1),e.createVNode(s,{type:"primary",icon:"Plus",size:"small",disabled:e.unref(t)==2,onClick:o[1]||(o[1]=f=>N(1))},null,8,["disabled"])])):e.createCommentVNode("",!0),e.createVNode(s,{type:"primary",size:"small",onClick:L},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(V)),1)]),_:1}),e.createElementVNode("span",{class:e.normalizeClass([e.unref(v).e("btn"),e.unref(v).e("close")]),onClick:h},[e.createVNode(x,{name:"Close",size:26})],2)]),e.createElementVNode("div",H,[e.unref(i)?(e.openBlock(),e.createBlock(E.default,e.mergeProps({key:0},r.$attrs,{pdf:e.unref(_),page:e.unref(l),scale:e.unref(t),onLoadComplete:g,onLoadError:d}),null,16,["pdf","page","scale"])):(e.openBlock(),e.createElementBlock("div",J,[e.createVNode(z,{height:"calc(100vh - 48px)"},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("ul",{"infinite-scroll-disabled":e.unref(y),class:"infinite-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),f=>(e.openBlock(),e.createElementBlock("li",{key:f,class:"infinite-list-item"},[e.createVNode(E.default,e.mergeProps({ref_for:!0},r.$attrs,{pdf:e.unref(_),page:f,scale:e.unref(t),onLoadComplete:g,onLoadError:d}),null,16,["pdf","page","scale"])]))),128))],8,K)),[[q,S]])]),_:1})]))])],2)):e.createCommentVNode("",!0)}}});exports.default=R;
1
+ "use strict";var D=Object.defineProperty;var n=(p,m)=>D(p,"name",{value:m,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),M=,/* empty css */T=,/* empty css */h=,/* empty css */$=,/* empty css */I=,/* empty css */F={class:"opt-wrap"},j={key:0,class:"page-wrap"},O={class:"num-wrap"},U={key:1,class:"size-wrap"},A={class:"num-wrap"},G={class:"pdf-content"},H={key:1,class:"infinite-list-wrapper",style:{overflow:"auto"}},J=["infinite-scroll-disabled"],K=e.defineComponent({name:"LSPdf"}),Q=e.defineComponent({...K,props:{source:{},onClose:{},showSize:{type:Boolean,default:!0},cMapUrlPath:{}},emits:["annotation","highlight","loaded","textLoaded","annotationLoaded","xfaLoaded","loadComplete","loadError","update:source"],setup(p,{emit:m}){const v=M.useNamespace("pdf"),E=v.b(),_=e.ref(void 0),l=e.ref(1),a=e.ref(0),t=e.ref(1),c=e.ref(!0),C=e.ref(!1),r=p,k=m;e.watch(()=>r.source,()=>{V()},{immediate:!0,deep:!0});const B=e.computed(()=>c.value?"取消分页":"分页展示");async function V(){if(r.source)try{const{pdf:s,processLoadingTask:o,pages:i}=T.usePDF(r.source,r.cMapUrlPath,{onError:d});await o(r.source),_.value=s.value,a.value=i.value,g()}catch{d()}finally{C.value=!0}}n(V,"initPdf");const b=n(()=>{C.value=!1,r.onClose&&r.onClose(),k("update:source")},"closeFunc");function P(){l.value>1&&l.value--}n(P,"prevPdf");function w(){l.value<a.value&&l.value++}n(w,"nextPdf");function N(s){s===0?t.value=t.value>.25?t.value-.25:t.value:t.value=t.value<2?t.value+.25:t.value}n(N,"scalePdf");const y=e.ref(!1),u=e.ref(0),S=n(()=>{if(u.value>=a.value){y.value=!0;return}u.value++},"load");function L(){c.value=!c.value,c.value||(y.value=!1,u.value=a.value>10?10:a.value)}n(L,"changePagition");function g(){k("loadComplete")}n(g,"loadComplete");function d(){k("loadError")}return n(d,"loadError"),(s,o)=>{const i=e.resolveComponent("LSButton"),x=e.resolveComponent("LSIcon"),z=$.ElScrollbar,q=I.ElInfiniteScroll;return e.unref(C)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(E))},[e.createElementVNode("div",F,[e.unref(c)?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(i,{type:"primary",size:"small",disabled:e.unref(l)==1,onClick:P},{default:e.withCtx(()=>o[2]||(o[2]=[e.createTextVNode("上一页")])),_:1},8,["disabled"]),e.createElementVNode("span",O,e.toDisplayString(e.unref(l))+" / "+e.toDisplayString(e.unref(a)),1),e.createVNode(i,{type:"primary",size:"small",disabled:e.unref(l)==e.unref(a),onClick:w},{default:e.withCtx(()=>o[3]||(o[3]=[e.createTextVNode("下一页")])),_:1},8,["disabled"])])):e.createCommentVNode("",!0),s.showSize?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(i,{type:"primary",icon:"Minus",size:"small",disabled:e.unref(t)==.25,onClick:o[0]||(o[0]=f=>N(0))},null,8,["disabled"]),e.createElementVNode("span",A,e.toDisplayString(e.unref(t)*100)+"%",1),e.createVNode(i,{type:"primary",icon:"Plus",size:"small",disabled:e.unref(t)==2,onClick:o[1]||(o[1]=f=>N(1))},null,8,["disabled"])])):e.createCommentVNode("",!0),e.createVNode(i,{type:"primary",size:"small",onClick:L},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(B)),1)]),_:1}),e.createElementVNode("span",{class:e.normalizeClass([e.unref(v).e("btn"),e.unref(v).e("close")]),onClick:b},[e.createVNode(x,{name:"Close",size:26})],2)]),e.createElementVNode("div",G,[e.unref(c)?(e.openBlock(),e.createBlock(h.default,e.mergeProps({key:0},s.$attrs,{pdf:e.unref(_),page:e.unref(l),scale:e.unref(t),onLoadComplete:g,onLoadError:d}),null,16,["pdf","page","scale"])):(e.openBlock(),e.createElementBlock("div",H,[e.createVNode(z,{height:"calc(100vh - 48px)"},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("ul",{"infinite-scroll-disabled":e.unref(y),class:"infinite-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),f=>(e.openBlock(),e.createElementBlock("li",{key:f,class:"infinite-list-item"},[e.createVNode(h.default,e.mergeProps({ref_for:!0},s.$attrs,{pdf:e.unref(_),page:f,scale:e.unref(t),onLoadComplete:g,onLoadError:d}),null,16,["pdf","page","scale"])]))),128))],8,J)),[[q,S]])]),_:1})]))])],2)):e.createCommentVNode("",!0)}}});exports.default=Q;
@@ -1,15 +1,15 @@
1
- var Q = Object.defineProperty;
2
- var l = (k, b) => Q(k, "name", { value: b, configurable: !0 });
1
+ var K = Object.defineProperty;
2
+ var l = (h, k) => K(h, "name", { value: k, configurable: !0 });
3
3
  /* empty css */
4
4
  /* empty css */
5
5
  /* empty css */
6
- import { defineComponent as F, ref as a, watch as R, computed as U, resolveComponent as N, unref as e, openBlock as n, createElementBlock as d, normalizeClass as $, createElementVNode as m, createVNode as i, withCtx as C, createTextVNode as S, toDisplayString as g, createCommentVNode as x, createBlock as W, mergeProps as V, withDirectives as X, Fragment as Y, renderList as Z } from "vue";
6
+ import { defineComponent as D, ref as s, watch as Q, computed as R, resolveComponent as N, unref as e, openBlock as n, createElementBlock as p, normalizeClass as $, createElementVNode as m, createVNode as i, withCtx as C, createTextVNode as S, toDisplayString as g, createCommentVNode as x, createBlock as W, mergeProps as M, withDirectives as X, Fragment as Y, renderList as Z } from "vue";
7
7
  import { useNamespace as ee } from "../../_hooks/useNamespace/index.js";
8
8
  import { usePDF as oe } from "../composable/index.js";
9
- import D from "../pdfs/PdfItem.vue/index.js";
9
+ import V from "../pdfs/PdfItem.vue/index.js";
10
10
  import { ElScrollbar as te } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/scrollbar/index/index.js";
11
11
  import { ElInfiniteScroll as le } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/infinite-scroll/index/index.js";
12
- const se = { class: "opt-wrap" }, ae = {
12
+ const ae = { class: "opt-wrap" }, se = {
13
13
  key: 0,
14
14
  class: "page-wrap"
15
15
  }, ne = { class: "num-wrap" }, ie = {
@@ -19,69 +19,70 @@ const se = { class: "opt-wrap" }, ae = {
19
19
  key: 1,
20
20
  class: "infinite-list-wrapper",
21
21
  style: { overflow: "auto" }
22
- }, de = ["infinite-scroll-disabled"], pe = F({
22
+ }, de = ["infinite-scroll-disabled"], pe = D({
23
23
  name: "LSPdf"
24
- }), we = /* @__PURE__ */ F({
24
+ }), we = /* @__PURE__ */ D({
25
25
  ...pe,
26
26
  props: {
27
27
  source: {},
28
28
  onClose: {},
29
- showSize: { type: Boolean, default: !0 }
29
+ showSize: { type: Boolean, default: !0 },
30
+ cMapUrlPath: {}
30
31
  },
31
32
  emits: ["annotation", "highlight", "loaded", "textLoaded", "annotationLoaded", "xfaLoaded", "loadComplete", "loadError", "update:source"],
32
- setup(k, { emit: b }) {
33
- const h = ee("pdf"), I = h.b(), w = a(void 0), s = a(1), r = a(0), o = a(1), p = a(!0), L = a(!1), f = k, P = b;
34
- R(
35
- () => f.source,
33
+ setup(h, { emit: k }) {
34
+ const b = ee("pdf"), F = b.b(), w = s(void 0), a = s(1), r = s(0), o = s(1), f = s(!0), L = s(!1), c = h, P = k;
35
+ Q(
36
+ () => c.source,
36
37
  () => {
37
- M();
38
+ T();
38
39
  },
39
40
  {
40
41
  immediate: !0,
41
42
  deep: !0
42
43
  }
43
44
  );
44
- const T = U(() => p.value ? "取消分页" : "分页展示");
45
- async function M() {
46
- if (f.source)
45
+ const I = R(() => f.value ? "取消分页" : "分页展示");
46
+ async function T() {
47
+ if (c.source)
47
48
  try {
48
- const { pdf: c, processLoadingTask: t, pages: u } = oe(f.source, {
49
+ const { pdf: u, processLoadingTask: t, pages: d } = oe(c.source, c.cMapUrlPath, {
49
50
  onError: _
50
51
  });
51
- await t(f.source), w.value = c.value, r.value = u.value, E();
52
+ await t(c.source), w.value = u.value, r.value = d.value, E();
52
53
  } catch {
53
54
  _();
54
55
  } finally {
55
56
  L.value = !0;
56
57
  }
57
58
  }
58
- l(M, "initPdf");
59
- const j = /* @__PURE__ */ l(() => {
60
- L.value = !1, f.onClose && f.onClose(), P("update:source");
59
+ l(T, "initPdf");
60
+ const U = /* @__PURE__ */ l(() => {
61
+ L.value = !1, c.onClose && c.onClose(), P("update:source");
61
62
  }, "closeFunc");
62
- function O() {
63
- s.value > 1 && s.value--;
63
+ function j() {
64
+ a.value > 1 && a.value--;
64
65
  }
65
- l(O, "prevPdf");
66
- function q() {
67
- s.value < r.value && s.value++;
66
+ l(j, "prevPdf");
67
+ function O() {
68
+ a.value < r.value && a.value++;
68
69
  }
69
- l(q, "nextPdf");
70
- function B(c) {
71
- c === 0 ? o.value = o.value > 0.25 ? o.value - 0.25 : o.value : o.value = o.value < 2 ? o.value + 0.25 : o.value;
70
+ l(O, "nextPdf");
71
+ function B(u) {
72
+ u === 0 ? o.value = o.value > 0.25 ? o.value - 0.25 : o.value : o.value = o.value < 2 ? o.value + 0.25 : o.value;
72
73
  }
73
74
  l(B, "scalePdf");
74
- const z = a(!1), v = a(0), A = /* @__PURE__ */ l(() => {
75
+ const z = s(!1), v = s(0), q = /* @__PURE__ */ l(() => {
75
76
  if (v.value >= r.value) {
76
77
  z.value = !0;
77
78
  return;
78
79
  }
79
80
  v.value++;
80
81
  }, "load");
81
- function G() {
82
- p.value = !p.value, p.value || (z.value = !1, v.value = r.value > 10 ? 10 : r.value);
82
+ function A() {
83
+ f.value = !f.value, f.value || (z.value = !1, v.value = r.value > 10 ? 10 : r.value);
83
84
  }
84
- l(G, "changePagition");
85
+ l(A, "changePagition");
85
86
  function E() {
86
87
  P("loadComplete");
87
88
  }
@@ -89,31 +90,31 @@ const se = { class: "opt-wrap" }, ae = {
89
90
  function _() {
90
91
  P("loadError");
91
92
  }
92
- return l(_, "loadError"), (c, t) => {
93
- const u = N("LSButton"), H = N("LSIcon"), J = te, K = le;
94
- return e(L) ? (n(), d("div", {
93
+ return l(_, "loadError"), (u, t) => {
94
+ const d = N("LSButton"), G = N("LSIcon"), H = te, J = le;
95
+ return e(L) ? (n(), p("div", {
95
96
  key: 0,
96
- class: $(e(I))
97
+ class: $(e(F))
97
98
  }, [
98
- m("div", se, [
99
- e(p) ? (n(), d("div", ae, [
100
- i(u, {
99
+ m("div", ae, [
100
+ e(f) ? (n(), p("div", se, [
101
+ i(d, {
101
102
  type: "primary",
102
103
  size: "small",
103
- disabled: e(s) == 1,
104
- onClick: O
104
+ disabled: e(a) == 1,
105
+ onClick: j
105
106
  }, {
106
107
  default: C(() => t[2] || (t[2] = [
107
108
  S("上一页")
108
109
  ])),
109
110
  _: 1
110
111
  }, 8, ["disabled"]),
111
- m("span", ne, g(e(s)) + " / " + g(e(r)), 1),
112
- i(u, {
112
+ m("span", ne, g(e(a)) + " / " + g(e(r)), 1),
113
+ i(d, {
113
114
  type: "primary",
114
115
  size: "small",
115
- disabled: e(s) == e(r),
116
- onClick: q
116
+ disabled: e(a) == e(r),
117
+ onClick: O
117
118
  }, {
118
119
  default: C(() => t[3] || (t[3] = [
119
120
  S("下一页")
@@ -121,8 +122,8 @@ const se = { class: "opt-wrap" }, ae = {
121
122
  _: 1
122
123
  }, 8, ["disabled"])
123
124
  ])) : x("", !0),
124
- c.showSize ? (n(), d("div", ie, [
125
- i(u, {
125
+ u.showSize ? (n(), p("div", ie, [
126
+ i(d, {
126
127
  type: "primary",
127
128
  icon: "Minus",
128
129
  size: "small",
@@ -130,7 +131,7 @@ const se = { class: "opt-wrap" }, ae = {
130
131
  onClick: t[0] || (t[0] = (y) => B(0))
131
132
  }, null, 8, ["disabled"]),
132
133
  m("span", re, g(e(o) * 100) + "%", 1),
133
- i(u, {
134
+ i(d, {
134
135
  type: "primary",
135
136
  icon: "Plus",
136
137
  size: "small",
@@ -138,45 +139,45 @@ const se = { class: "opt-wrap" }, ae = {
138
139
  onClick: t[1] || (t[1] = (y) => B(1))
139
140
  }, null, 8, ["disabled"])
140
141
  ])) : x("", !0),
141
- i(u, {
142
+ i(d, {
142
143
  type: "primary",
143
144
  size: "small",
144
- onClick: G
145
+ onClick: A
145
146
  }, {
146
147
  default: C(() => [
147
- S(g(e(T)), 1)
148
+ S(g(e(I)), 1)
148
149
  ]),
149
150
  _: 1
150
151
  }),
151
152
  m("span", {
152
- class: $([e(h).e("btn"), e(h).e("close")]),
153
- onClick: j
153
+ class: $([e(b).e("btn"), e(b).e("close")]),
154
+ onClick: U
154
155
  }, [
155
- i(H, {
156
+ i(G, {
156
157
  name: "Close",
157
158
  size: 26
158
159
  })
159
160
  ], 2)
160
161
  ]),
161
162
  m("div", ce, [
162
- e(p) ? (n(), W(D, V({ key: 0 }, c.$attrs, {
163
+ e(f) ? (n(), W(V, M({ key: 0 }, u.$attrs, {
163
164
  pdf: e(w),
164
- page: e(s),
165
+ page: e(a),
165
166
  scale: e(o),
166
167
  onLoadComplete: E,
167
168
  onLoadError: _
168
- }), null, 16, ["pdf", "page", "scale"])) : (n(), d("div", ue, [
169
- i(J, { height: "calc(100vh - 48px)" }, {
169
+ }), null, 16, ["pdf", "page", "scale"])) : (n(), p("div", ue, [
170
+ i(H, { height: "calc(100vh - 48px)" }, {
170
171
  default: C(() => [
171
- X((n(), d("ul", {
172
+ X((n(), p("ul", {
172
173
  "infinite-scroll-disabled": e(z),
173
174
  class: "infinite-list"
174
175
  }, [
175
- (n(!0), d(Y, null, Z(e(v), (y) => (n(), d("li", {
176
+ (n(!0), p(Y, null, Z(e(v), (y) => (n(), p("li", {
176
177
  key: y,
177
178
  class: "infinite-list-item"
178
179
  }, [
179
- i(D, V({ ref_for: !0 }, c.$attrs, {
180
+ i(V, M({ ref_for: !0 }, u.$attrs, {
180
181
  pdf: e(w),
181
182
  page: y,
182
183
  scale: e(o),
@@ -185,7 +186,7 @@ const se = { class: "opt-wrap" }, ae = {
185
186
  }), null, 16, ["pdf", "page", "scale"])
186
187
  ]))), 128))
187
188
  ], 8, de)), [
188
- [K, A]
189
+ [J, q]
189
190
  ])
190
191
  ]),
191
192
  _: 1
@@ -1 +1 @@
1
- "use strict";var F=Object.defineProperty;var c=(s,r)=>F(s,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("pdfjs-dist"),N=require("../../../../../node_modules/.pnpm/pdfjs-dist@4.8.69/node_modules/pdfjs-dist/build/pdf.worker.min/index.cjs"),f=require("vue"),h=require("../pdfs/destination/index.cjs"),L=require("../pdfs/miscellaneous/index.cjs");function O(s){P.GlobalWorkerOptions.workerSrc=s}c(O,"configWorker");function q(s,r={onProgress:void 0,onPassword:void 0,onError:void 0,password:""}){var R;(R=P.GlobalWorkerOptions)!=null&&R.workerSrc||O(N.default);const b=f.shallowRef(),l=f.shallowRef(),D=f.shallowRef(0),k=f.shallowRef({});function g(u){l.value&&l.value.destroy();const o=P.getDocument({url:u,cMapUrl:"/cmaps/",cMapPacked:!0});if(r.onProgress&&(o.onProgress=r.onProgress),r.onPassword)o.onPassword=r.onPassword;else if(r.password){const e=c(i=>{i(r.password??"")},"onPassword");o.onPassword=e}return o.promise.then(async e=>{l.value=e,b.value=e.loadingTask,D.value=e.numPages;const i=await e.getMetadata(),a=await e.getAttachments(),n=await e.getJSActions(),d=await e.getOutline();k.value={metadata:i,attachments:a,javascript:n,outline:d}},e=>{typeof r.onError=="function"&&r.onError(e)})}c(g,"processLoadingTask");async function I(u){var t;const o=await((t=b.value)==null?void 0:t.promise);if(!o)return null;const e=await h.getDestinationArray(o,u),i=await h.getDestinationRef(o,e);if(!i||!e)return null;const a=await o.getPageIndex(i),n=e[1].name,d=e.slice(2),v=h.isSpecLike(d)?h.getLocation(n,d):null;return{pageIndex:a,location:v??{type:"Fit",spec:[]}}}c(I,"getPDFDestination");async function U(u="filename"){var n;if(!l.value)throw new Error("Current PDFDocumentProxy have not loaded yet");const o=await((n=l.value)==null?void 0:n.saveDocument()),e=new Blob([o],{type:"application/pdf"}),i=URL.createObjectURL(e),a=document.createElement("a");document.body.appendChild(a),a.href=i,a.download=u,a.style.display="none",a.click(),setTimeout(()=>{URL.revokeObjectURL(i),document.body.removeChild(a)},10)}c(U,"download");async function x(u=150,o="filename"){var S,C;if(!l.value)throw new Error("Current PDFDocumentProxy have not loaded yet");const e=await((S=l.value)==null?void 0:S.saveDocument()),a=await P.getDocument(e.buffer).promise,n=u/72,d=96/72,v=await L.createIframe(),t=v.contentWindow;t.document.title=o;const E=[...Array(a.numPages).keys()].map(p=>p+1);for(const p of E){const y=await a.getPage(p),m=y.getViewport({scale:1});p===1&&L.addStylesToIframe(t,m.width*n/d,m.height*n/d);const w=document.createElement("canvas");w.width=m.width*n,w.height=m.height*n;const T=w.cloneNode();t==null||t.document.body.appendChild(T),await(y==null?void 0:y.render({canvasContext:w.getContext("2d"),intent:"print",transform:[n,0,0,n,0,0],viewport:m}).promise),(C=T.getContext("2d"))==null||C.drawImage(w,0,0)}t==null||t.focus(),t==null||t.print(),document.body.removeChild(v)}return c(x,"print"),f.isRef(s)?(s.value&&g(s.value),f.watch(s,()=>{s.value&&g(s.value)})):s&&g(s),{pdf:b,pages:D,info:k,print:x,download:U,getPDFDestination:I,processLoadingTask:g}}c(q,"usePDF");exports.usePDF=q;
1
+ "use strict";var N=Object.defineProperty;var c=(s,b)=>N(s,"name",{value:b,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("pdfjs-dist"),O=require("../../../../../node_modules/.pnpm/pdfjs-dist@4.8.69/node_modules/pdfjs-dist/build/pdf.worker.min/index.cjs"),f=require("vue"),h=require("../pdfs/destination/index.cjs"),I=require("../pdfs/miscellaneous/index.cjs");function q(s){P.GlobalWorkerOptions.workerSrc=s}c(q,"configWorker");function A(s,b,i={onProgress:void 0,onPassword:void 0,onError:void 0,password:""}){var S;(S=P.GlobalWorkerOptions)!=null&&S.workerSrc||q(O.default);const D=f.shallowRef(),l=f.shallowRef(),k=f.shallowRef(0),R=f.shallowRef({});function g(u){l.value&&l.value.destroy();const o=P.getDocument({url:u,cMapUrl:b,cMapPacked:!0});if(i.onProgress&&(o.onProgress=i.onProgress),i.onPassword)o.onPassword=i.onPassword;else if(i.password){const e=c(r=>{r(i.password??"")},"onPassword");o.onPassword=e}return o.promise.then(async e=>{l.value=e,D.value=e.loadingTask,k.value=e.numPages;const r=await e.getMetadata(),a=await e.getAttachments(),n=await e.getJSActions(),d=await e.getOutline();R.value={metadata:r,attachments:a,javascript:n,outline:d}},e=>{typeof i.onError=="function"&&i.onError(e)})}c(g,"processLoadingTask");async function U(u){var t;const o=await((t=D.value)==null?void 0:t.promise);if(!o)return null;const e=await h.getDestinationArray(o,u),r=await h.getDestinationRef(o,e);if(!r||!e)return null;const a=await o.getPageIndex(r),n=e[1].name,d=e.slice(2),v=h.isSpecLike(d)?h.getLocation(n,d):null;return{pageIndex:a,location:v??{type:"Fit",spec:[]}}}c(U,"getPDFDestination");async function x(u="filename"){var n;if(!l.value)throw new Error("Current PDFDocumentProxy have not loaded yet");const o=await((n=l.value)==null?void 0:n.saveDocument()),e=new Blob([o],{type:"application/pdf"}),r=URL.createObjectURL(e),a=document.createElement("a");document.body.appendChild(a),a.href=r,a.download=u,a.style.display="none",a.click(),setTimeout(()=>{URL.revokeObjectURL(r),document.body.removeChild(a)},10)}c(x,"download");async function E(u=150,o="filename"){var C,T;if(!l.value)throw new Error("Current PDFDocumentProxy have not loaded yet");const e=await((C=l.value)==null?void 0:C.saveDocument()),a=await P.getDocument(e.buffer).promise,n=u/72,d=96/72,v=await I.createIframe(),t=v.contentWindow;t.document.title=o;const F=[...Array(a.numPages).keys()].map(p=>p+1);for(const p of F){const y=await a.getPage(p),m=y.getViewport({scale:1});p===1&&I.addStylesToIframe(t,m.width*n/d,m.height*n/d);const w=document.createElement("canvas");w.width=m.width*n,w.height=m.height*n;const L=w.cloneNode();t==null||t.document.body.appendChild(L),await(y==null?void 0:y.render({canvasContext:w.getContext("2d"),intent:"print",transform:[n,0,0,n,0,0],viewport:m}).promise),(T=L.getContext("2d"))==null||T.drawImage(w,0,0)}t==null||t.focus(),t==null||t.print(),document.body.removeChild(v)}return c(E,"print"),f.isRef(s)?(s.value&&g(s.value),f.watch(s,()=>{s.value&&g(s.value)})):s&&g(s),{pdf:D,pages:k,info:R,print:E,download:x,getPDFDestination:U,processLoadingTask:g}}c(A,"usePDF");exports.usePDF=A;
@@ -1,112 +1,112 @@
1
- var E = Object.defineProperty;
2
- var c = (r, s) => E(r, "name", { value: s, configurable: !0 });
3
- import { GlobalWorkerOptions as S, getDocument as R } from "pdfjs-dist";
4
- import F from "../../../../../node_modules/.pnpm/pdfjs-dist@4.8.69/node_modules/pdfjs-dist/build/pdf.worker.min/index.js";
5
- import { shallowRef as y, isRef as N, watch as A } from "vue";
6
- import { getDestinationArray as O, getDestinationRef as j, isSpecLike as M, getLocation as B } from "../pdfs/destination/index.js";
7
- import { createIframe as _, addStylesToIframe as G } from "../pdfs/miscellaneous/index.js";
8
- function J(r) {
9
- S.workerSrc = r;
1
+ var F = Object.defineProperty;
2
+ var c = (r, h) => F(r, "name", { value: h, configurable: !0 });
3
+ import { GlobalWorkerOptions as T, getDocument as S } from "pdfjs-dist";
4
+ import N from "../../../../../node_modules/.pnpm/pdfjs-dist@4.8.69/node_modules/pdfjs-dist/build/pdf.worker.min/index.js";
5
+ import { shallowRef as y, isRef as A, watch as O } from "vue";
6
+ import { getDestinationArray as j, getDestinationRef as M, isSpecLike as B, getLocation as _ } from "../pdfs/destination/index.js";
7
+ import { createIframe as G, addStylesToIframe as J } from "../pdfs/miscellaneous/index.js";
8
+ function V(r) {
9
+ T.workerSrc = r;
10
10
  }
11
- c(J, "configWorker");
12
- function X(r, s = {
11
+ c(V, "configWorker");
12
+ function Y(r, h, i = {
13
13
  onProgress: void 0,
14
14
  onPassword: void 0,
15
15
  onError: void 0,
16
16
  password: ""
17
17
  }) {
18
- var D;
19
- (D = S) != null && D.workerSrc || J(F);
20
- const h = y(), l = y(), P = y(0), b = y({});
18
+ var k;
19
+ (k = T) != null && k.workerSrc || V(N);
20
+ const P = y(), l = y(), b = y(0), D = y({});
21
21
  function w(d) {
22
22
  l.value && l.value.destroy();
23
- const o = R({
23
+ const o = S({
24
24
  url: d,
25
- cMapUrl: "/cmaps/",
25
+ cMapUrl: h,
26
26
  cMapPacked: !0
27
27
  });
28
- if (s.onProgress && (o.onProgress = s.onProgress), s.onPassword)
29
- o.onPassword = s.onPassword;
30
- else if (s.password) {
31
- const e = /* @__PURE__ */ c((i) => {
32
- i(s.password ?? "");
28
+ if (i.onProgress && (o.onProgress = i.onProgress), i.onPassword)
29
+ o.onPassword = i.onPassword;
30
+ else if (i.password) {
31
+ const e = /* @__PURE__ */ c((s) => {
32
+ s(i.password ?? "");
33
33
  }, "onPassword");
34
34
  o.onPassword = e;
35
35
  }
36
36
  return o.promise.then(
37
37
  async (e) => {
38
- l.value = e, h.value = e.loadingTask, P.value = e.numPages;
39
- const i = await e.getMetadata(), a = await e.getAttachments(), n = await e.getJSActions(), u = await e.getOutline();
40
- b.value = {
41
- metadata: i,
38
+ l.value = e, P.value = e.loadingTask, b.value = e.numPages;
39
+ const s = await e.getMetadata(), a = await e.getAttachments(), n = await e.getJSActions(), u = await e.getOutline();
40
+ D.value = {
41
+ metadata: s,
42
42
  attachments: a,
43
43
  javascript: n,
44
44
  outline: u
45
45
  };
46
46
  },
47
47
  (e) => {
48
- typeof s.onError == "function" && s.onError(e);
48
+ typeof i.onError == "function" && i.onError(e);
49
49
  }
50
50
  );
51
51
  }
52
52
  c(w, "processLoadingTask");
53
- async function T(d) {
53
+ async function x(d) {
54
54
  var t;
55
- const o = await ((t = h.value) == null ? void 0 : t.promise);
55
+ const o = await ((t = P.value) == null ? void 0 : t.promise);
56
56
  if (!o) return null;
57
- const e = await O(o, d), i = await j(o, e);
58
- if (!i || !e) return null;
59
- const a = await o.getPageIndex(i), n = e[1].name, u = e.slice(2), p = M(u) ? B(n, u) : null;
60
- return { pageIndex: a, location: p ?? { type: "Fit", spec: [] } };
57
+ const e = await j(o, d), s = await M(o, e);
58
+ if (!s || !e) return null;
59
+ const a = await o.getPageIndex(s), n = e[1].name, u = e.slice(2), g = B(u) ? _(n, u) : null;
60
+ return { pageIndex: a, location: g ?? { type: "Fit", spec: [] } };
61
61
  }
62
- c(T, "getPDFDestination");
63
- async function x(d = "filename") {
62
+ c(x, "getPDFDestination");
63
+ async function I(d = "filename") {
64
64
  var n;
65
65
  if (!l.value) throw new Error("Current PDFDocumentProxy have not loaded yet");
66
- const o = await ((n = l.value) == null ? void 0 : n.saveDocument()), e = new Blob([o], { type: "application/pdf" }), i = URL.createObjectURL(e), a = document.createElement("a");
67
- document.body.appendChild(a), a.href = i, a.download = d, a.style.display = "none", a.click(), setTimeout(() => {
68
- URL.revokeObjectURL(i), document.body.removeChild(a);
66
+ const o = await ((n = l.value) == null ? void 0 : n.saveDocument()), e = new Blob([o], { type: "application/pdf" }), s = URL.createObjectURL(e), a = document.createElement("a");
67
+ document.body.appendChild(a), a.href = s, a.download = d, a.style.display = "none", a.click(), setTimeout(() => {
68
+ URL.revokeObjectURL(s), document.body.removeChild(a);
69
69
  }, 10);
70
70
  }
71
- c(x, "download");
72
- async function I(d = 150, o = "filename") {
73
- var k, C;
71
+ c(I, "download");
72
+ async function U(d = 150, o = "filename") {
73
+ var C, L;
74
74
  if (!l.value) throw new Error("Current PDFDocumentProxy have not loaded yet");
75
- const e = await ((k = l.value) == null ? void 0 : k.saveDocument()), a = await R(e.buffer).promise, n = d / 72, u = 96 / 72, p = await _(), t = p.contentWindow;
75
+ const e = await ((C = l.value) == null ? void 0 : C.saveDocument()), a = await S(e.buffer).promise, n = d / 72, u = 96 / 72, g = await G(), t = g.contentWindow;
76
76
  t.document.title = o;
77
- const U = [...Array(a.numPages).keys()].map((g) => g + 1);
78
- for (const g of U) {
79
- const v = await a.getPage(g), m = v.getViewport({ scale: 1 });
80
- g === 1 && G(
77
+ const E = [...Array(a.numPages).keys()].map((p) => p + 1);
78
+ for (const p of E) {
79
+ const v = await a.getPage(p), m = v.getViewport({ scale: 1 });
80
+ p === 1 && J(
81
81
  t,
82
82
  m.width * n / u,
83
83
  m.height * n / u
84
84
  );
85
85
  const f = document.createElement("canvas");
86
86
  f.width = m.width * n, f.height = m.height * n;
87
- const L = f.cloneNode();
88
- t == null || t.document.body.appendChild(L), await (v == null ? void 0 : v.render({
87
+ const R = f.cloneNode();
88
+ t == null || t.document.body.appendChild(R), await (v == null ? void 0 : v.render({
89
89
  canvasContext: f.getContext("2d"),
90
90
  intent: "print",
91
91
  transform: [n, 0, 0, n, 0, 0],
92
92
  viewport: m
93
- }).promise), (C = L.getContext("2d")) == null || C.drawImage(f, 0, 0);
93
+ }).promise), (L = R.getContext("2d")) == null || L.drawImage(f, 0, 0);
94
94
  }
95
- t == null || t.focus(), t == null || t.print(), document.body.removeChild(p);
95
+ t == null || t.focus(), t == null || t.print(), document.body.removeChild(g);
96
96
  }
97
- return c(I, "print"), N(r) ? (r.value && w(r.value), A(r, () => {
97
+ return c(U, "print"), A(r) ? (r.value && w(r.value), O(r, () => {
98
98
  r.value && w(r.value);
99
99
  })) : r && w(r), {
100
- pdf: h,
101
- pages: P,
102
- info: b,
103
- print: I,
104
- download: x,
105
- getPDFDestination: T,
100
+ pdf: P,
101
+ pages: b,
102
+ info: D,
103
+ print: U,
104
+ download: I,
105
+ getPDFDestination: x,
106
106
  processLoadingTask: w
107
107
  };
108
108
  }
109
- c(X, "usePDF");
109
+ c(Y, "usePDF");
110
110
  export {
111
- X as usePDF
111
+ Y as usePDF
112
112
  };
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  source: string;
4
4
  onClose: Function;
5
5
  showSize?: boolean;
6
+ cMapUrlPath: string;
6
7
  };
7
8
  declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
8
9
  [x: string]: any;
@@ -19,7 +19,7 @@ import { PDFDocumentLoadingTask } from 'pdfjs-dist/types/src/display/api';
19
19
  * @param {UsePDFParameters} options
20
20
  * UsePDF object parameters
21
21
  */
22
- export declare function usePDF(src: PDFSrc | Ref<PDFSrc>, options?: PDFOptions): {
22
+ export declare function usePDF(src: PDFSrc | Ref<PDFSrc>, cMapUrlPath: string, options?: PDFOptions): {
23
23
  pdf: ShallowRef< PDFDocumentLoadingTask | undefined, PDFDocumentLoadingTask | undefined>;
24
24
  pages: ShallowRef<number, number>;
25
25
  info: ShallowRef<{}, {}> | ShallowRef<PDFInfo, PDFInfo>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingshugroup/web-plus",
3
- "version": "1.7.9",
3
+ "version": "1.7.10",
4
4
  "description": "零数科技前端UI组件库(Vue3)",
5
5
  "type": "module",
6
6
  "main": "./lib/index/index.cjs",