@lingshugroup/web-plus 1.0.37 → 1.0.38
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/README.md +1 -1
- package/lib/index.css +1 -1
- package/lib/index.css.br +0 -0
- package/lib/index.css.gz +0 -0
- package/lib/packages/ls-components/components/descriptions/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/descriptions/Index.vue/index.js +1 -1
- package/lib/packages/ls-components/components/descriptions/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/descriptions/Index.vue/index2.js +62 -60
- package/lib/packages/ls-components/components/descriptions/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/descriptions/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/composable/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_pdf/composable/index.js +43 -43
- package/lib/packages/ls-components/components/preview_pdf/composable/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/composable/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Annotation.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Annotation.vue/index.js +20 -20
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Annotation.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Annotation.vue/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/PdfItem.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_pdf/pdfs/PdfItem.vue/index.js +37 -37
- package/lib/packages/ls-components/components/preview_pdf/pdfs/PdfItem.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/PdfItem.vue/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Text.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Text.vue/index.js +12 -12
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Text.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Text.vue/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/XFA.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_pdf/pdfs/XFA.vue/index.js +6 -6
- package/lib/packages/ls-components/components/preview_pdf/pdfs/XFA.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/XFA.vue/index.js.gz +0 -0
- 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-
|
|
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-48e499ae"]]);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 s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-48e499ae"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var m=Object.defineProperty;var p=(c,o)=>m(c,"name",{value:o,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),C=,/* empty css */B=,/* empty css */_=,/* empty css */b=,/* empty css */h=,/* empty css */f=,/* empty css */S={class:"cell-item"},v=e.defineComponent({name:"LSDescriptions"}),D=e.defineComponent({...v,props:_.lsDescProp,setup(c){const o=e.useSlots(),l=c,k=e.ref({column:1}),d=e.ref(),y=b.useNamespace("descriptions").b();e.watch(()=>l.labelColor,async r=>{r&&s(r,1)},{deep:!0,immediate:!0}),e.watch(()=>l.labelBgColor,async r=>{r&&s(r,2)},{deep:!0,immediate:!0}),e.watch(()=>l.list,()=>{s(l.labelColor,2),s(l.labelBgColor,2)},{immediate:!0,deep:!0});async function s(r,u){var a;await e.nextTick(),(((a=d.value)==null?void 0:a.querySelectorAll(".el-descriptions__label"))||[]).forEach(t=>{u===1?t.style.color=r:u===2&&(t.style.backgroundColor=r)})}return p(s,"updateLabelStyle"),(r,u)=>{const i=f.ElDescriptionsItem,a=f.ElDescriptions;return e.openBlock(),e.createElementBlock("div",{ref_key:"lsDescRef",ref:d,class:e.normalizeClass([e.unref(y),`column-${r.$attrs.column||1}`,r.$attrs.title||r.$attrs.extra||e.unref(o).title||e.unref(o).extra?"":"no-header"])},[e.createVNode(a,e.mergeProps(e.unref(h.default)(e.unref(k),r.$attrs),{border:""}),{title:e.withCtx(()=>[e.renderSlot(r.$slots,"title",{},void 0,!0)]),extra:e.withCtx(()=>[e.renderSlot(r.$slots,"extra",{},void 0,!0)]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.list,(t,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[t.hide?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(i,{key:0,label:t==null?void 0:t.label},{label:e.withCtx(()=>{var n;return[e.createElementVNode("div",S,[(n=t.iconConfig)!=null&&n.name||e.unref(o).icon?(e.openBlock(),e.createBlock(C.default,e.mergeProps({key:0,ref_for:!0},t.iconConfig),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"icon",{},void 0,!0)]),_:2},1040)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t==null?void 0:t.label),1)])]}),default:e.withCtx(()=>{var n;return[t.type==="date"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.value?e.unref(B.default)(t.value).format(t.format||"YYYY-MM-DD HH:mm:ss"):"--"),1)],64)):t.type==="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(((n=t.propMap[t.value])==null?void 0:n.label)||"--"),1)],64)):t.type=="slot"?e.renderSlot(r.$slots,t.slotName,{key:2,data:t==null?void 0:t.value},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString((t==null?void 0:t.value)||"--"),1)],64))]}),_:2},1032,["label"]))],64))),128))]),_:3},16)],2)}}});exports.default=D;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var v = (y,
|
|
1
|
+
var L = Object.defineProperty;
|
|
2
|
+
var v = (y, a) => L(y, "name", { value: a, configurable: !0 });
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { defineComponent as S, useSlots as
|
|
6
|
+
import { defineComponent as S, useSlots as V, ref as g, watch as _, nextTick as Y, openBlock as r, createElementBlock as s, normalizeClass as w, unref as t, createVNode as M, mergeProps as D, withCtx as l, renderSlot as i, Fragment as d, renderList as A, createBlock as $, createElementVNode as H, createCommentVNode as h, createTextVNode as f, toDisplayString as m } from "vue";
|
|
7
7
|
import I from "../../icon/Index.vue/index.js";
|
|
8
8
|
import P from "../../../../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min/index.js";
|
|
9
9
|
import { lsDescProp as R } from "../types/index.js";
|
|
@@ -16,11 +16,11 @@ const F = { class: "cell-item" }, x = S({
|
|
|
16
16
|
...x,
|
|
17
17
|
props: R,
|
|
18
18
|
setup(y) {
|
|
19
|
-
const
|
|
19
|
+
const a = V(), n = y, N = g({
|
|
20
20
|
column: 1
|
|
21
|
-
}), k = g(),
|
|
21
|
+
}), k = g(), B = T("descriptions").b();
|
|
22
22
|
_(
|
|
23
|
-
() =>
|
|
23
|
+
() => n.labelColor,
|
|
24
24
|
async (o) => {
|
|
25
25
|
o && p(o, 1);
|
|
26
26
|
},
|
|
@@ -29,7 +29,7 @@ const F = { class: "cell-item" }, x = S({
|
|
|
29
29
|
immediate: !0
|
|
30
30
|
}
|
|
31
31
|
), _(
|
|
32
|
-
() =>
|
|
32
|
+
() => n.labelBgColor,
|
|
33
33
|
async (o) => {
|
|
34
34
|
o && p(o, 2);
|
|
35
35
|
},
|
|
@@ -38,9 +38,9 @@ const F = { class: "cell-item" }, x = S({
|
|
|
38
38
|
immediate: !0
|
|
39
39
|
}
|
|
40
40
|
), _(
|
|
41
|
-
() =>
|
|
41
|
+
() => n.list,
|
|
42
42
|
() => {
|
|
43
|
-
p(
|
|
43
|
+
p(n.labelColor, 2), p(n.labelBgColor, 2);
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
immediate: !0,
|
|
@@ -48,68 +48,70 @@ const F = { class: "cell-item" }, x = S({
|
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
50
|
async function p(o, b) {
|
|
51
|
-
var
|
|
52
|
-
await
|
|
51
|
+
var u;
|
|
52
|
+
await Y(), (((u = k.value) == null ? void 0 : u.querySelectorAll(".el-descriptions__label")) || []).forEach((e) => {
|
|
53
53
|
b === 1 ? e.style.color = o : b === 2 && (e.style.backgroundColor = o);
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
return v(p, "updateLabelStyle"), (o, b) => {
|
|
57
|
-
const C = q,
|
|
58
|
-
return r(),
|
|
57
|
+
const C = q, u = z;
|
|
58
|
+
return r(), s("div", {
|
|
59
59
|
ref_key: "lsDescRef",
|
|
60
60
|
ref: k,
|
|
61
|
-
class:
|
|
62
|
-
t(
|
|
61
|
+
class: w([
|
|
62
|
+
t(B),
|
|
63
63
|
`column-${o.$attrs.column || 1}`,
|
|
64
|
-
o.$attrs.title || o.$attrs.extra || t(
|
|
64
|
+
o.$attrs.title || o.$attrs.extra || t(a).title || t(a).extra ? "" : "no-header"
|
|
65
65
|
])
|
|
66
66
|
}, [
|
|
67
|
-
|
|
68
|
-
title:
|
|
69
|
-
|
|
67
|
+
M(u, D(t(j)(t(N), o.$attrs), { border: "" }), {
|
|
68
|
+
title: l(() => [
|
|
69
|
+
i(o.$slots, "title", {}, void 0, !0)
|
|
70
70
|
]),
|
|
71
|
-
extra:
|
|
72
|
-
|
|
71
|
+
extra: l(() => [
|
|
72
|
+
i(o.$slots, "extra", {}, void 0, !0)
|
|
73
73
|
]),
|
|
74
|
-
default:
|
|
75
|
-
(r(!0),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
74
|
+
default: l(() => [
|
|
75
|
+
(r(!0), s(d, null, A(o.list, (e, E) => (r(), s(d, { key: E }, [
|
|
76
|
+
e.hide ? h("", !0) : (r(), $(C, {
|
|
77
|
+
key: 0,
|
|
78
|
+
label: e == null ? void 0 : e.label
|
|
79
|
+
}, {
|
|
80
|
+
label: l(() => {
|
|
81
|
+
var c;
|
|
82
|
+
return [
|
|
83
|
+
H("div", F, [
|
|
84
|
+
(c = e.iconConfig) != null && c.name || t(a).icon ? (r(), $(I, D({
|
|
85
|
+
key: 0,
|
|
86
|
+
ref_for: !0
|
|
87
|
+
}, e.iconConfig), {
|
|
88
|
+
default: l(() => [
|
|
89
|
+
i(o.$slots, "icon", {}, void 0, !0)
|
|
90
|
+
]),
|
|
91
|
+
_: 2
|
|
92
|
+
}, 1040)) : h("", !0),
|
|
93
|
+
f(" " + m(e == null ? void 0 : e.label), 1)
|
|
94
|
+
])
|
|
95
|
+
];
|
|
96
|
+
}),
|
|
97
|
+
default: l(() => {
|
|
98
|
+
var c;
|
|
99
|
+
return [
|
|
100
|
+
e.type === "date" ? (r(), s(d, { key: 0 }, [
|
|
101
|
+
f(m(e.value ? t(P)(e.value).format(e.format || "YYYY-MM-DD HH:mm:ss") : "--"), 1)
|
|
102
|
+
], 64)) : e.type === "select" ? (r(), s(d, { key: 1 }, [
|
|
103
|
+
f(m(((c = e.propMap[e.value]) == null ? void 0 : c.label) || "--"), 1)
|
|
104
|
+
], 64)) : e.type == "slot" ? i(o.$slots, e.slotName, {
|
|
105
|
+
key: 2,
|
|
106
|
+
data: e == null ? void 0 : e.value
|
|
107
|
+
}, void 0, !0) : (r(), s(d, { key: 3 }, [
|
|
108
|
+
f(m((e == null ? void 0 : e.value) || "--"), 1)
|
|
109
|
+
], 64))
|
|
110
|
+
];
|
|
111
|
+
}),
|
|
112
|
+
_: 2
|
|
113
|
+
}, 1032, ["label"]))
|
|
114
|
+
], 64))), 128))
|
|
113
115
|
]),
|
|
114
116
|
_: 3
|
|
115
117
|
}, 16)
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var U=Object.defineProperty;var c=(s,r)=>U(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(u);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 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"}),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(x,"download");async function E(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 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&&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(E,"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:E,download:x,getPDFDestination:I,processLoadingTask:g}}c(q,"usePDF");exports.usePDF=q;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
var
|
|
2
|
-
var c = (r, s) =>
|
|
3
|
-
import
|
|
1
|
+
var U = Object.defineProperty;
|
|
2
|
+
var c = (r, s) => U(r, "name", { value: s, configurable: !0 });
|
|
3
|
+
import { GlobalWorkerOptions as S, getDocument as R } from "pdfjs-dist";
|
|
4
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
|
|
6
|
-
import { getDestinationArray as
|
|
5
|
+
import { shallowRef as y, isRef as N, watch as A } from "vue";
|
|
6
|
+
import { getDestinationArray as O, getDestinationRef as j, isSpecLike as B, getLocation as _ } from "../pdfs/destination/index.js";
|
|
7
7
|
import { createIframe as G, addStylesToIframe as J } from "../pdfs/miscellaneous/index.js";
|
|
8
|
-
function
|
|
9
|
-
|
|
8
|
+
function M(r) {
|
|
9
|
+
S.workerSrc = r;
|
|
10
10
|
}
|
|
11
|
-
c(
|
|
12
|
-
function
|
|
11
|
+
c(M, "configWorker");
|
|
12
|
+
function X(r, s = {
|
|
13
13
|
onProgress: void 0,
|
|
14
14
|
onPassword: void 0,
|
|
15
15
|
onError: void 0,
|
|
16
16
|
password: ""
|
|
17
17
|
}) {
|
|
18
|
-
var
|
|
19
|
-
(
|
|
20
|
-
const
|
|
21
|
-
function w(
|
|
22
|
-
|
|
23
|
-
const o =
|
|
18
|
+
var D;
|
|
19
|
+
(D = S) != null && D.workerSrc || M(F);
|
|
20
|
+
const h = y(), d = y(), P = y(0), b = y({});
|
|
21
|
+
function w(l) {
|
|
22
|
+
d.value && d.value.destroy();
|
|
23
|
+
const o = R(l);
|
|
24
24
|
if (s.onProgress && (o.onProgress = s.onProgress), s.onPassword)
|
|
25
25
|
o.onPassword = s.onPassword;
|
|
26
26
|
else if (s.password) {
|
|
@@ -31,9 +31,9 @@ function K(r, s = {
|
|
|
31
31
|
}
|
|
32
32
|
return o.promise.then(
|
|
33
33
|
async (e) => {
|
|
34
|
-
|
|
34
|
+
d.value = e, h.value = e.loadingTask, P.value = e.numPages;
|
|
35
35
|
const i = await e.getMetadata(), a = await e.getAttachments(), n = await e.getJSActions(), u = await e.getOutline();
|
|
36
|
-
|
|
36
|
+
b.value = {
|
|
37
37
|
metadata: i,
|
|
38
38
|
attachments: a,
|
|
39
39
|
javascript: n,
|
|
@@ -46,32 +46,32 @@ function K(r, s = {
|
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
c(w, "processLoadingTask");
|
|
49
|
-
async function
|
|
49
|
+
async function T(l) {
|
|
50
50
|
var t;
|
|
51
|
-
const o = await ((t =
|
|
51
|
+
const o = await ((t = h.value) == null ? void 0 : t.promise);
|
|
52
52
|
if (!o) return null;
|
|
53
|
-
const e = await
|
|
53
|
+
const e = await O(o, l), i = await j(o, e);
|
|
54
54
|
if (!i || !e) return null;
|
|
55
|
-
const a = await o.getPageIndex(i), n = e[1].name, u = e.slice(2), g =
|
|
55
|
+
const a = await o.getPageIndex(i), n = e[1].name, u = e.slice(2), g = B(u) ? _(n, u) : null;
|
|
56
56
|
return { pageIndex: a, location: g ?? { type: "Fit", spec: [] } };
|
|
57
57
|
}
|
|
58
|
-
c(
|
|
59
|
-
async function
|
|
58
|
+
c(T, "getPDFDestination");
|
|
59
|
+
async function x(l = "filename") {
|
|
60
60
|
var n;
|
|
61
|
-
if (!
|
|
62
|
-
const o = await ((n =
|
|
63
|
-
document.body.appendChild(a), a.href = i, a.download =
|
|
61
|
+
if (!d.value) throw new Error("Current PDFDocumentProxy have not loaded yet");
|
|
62
|
+
const o = await ((n = d.value) == null ? void 0 : n.saveDocument()), e = new Blob([o], { type: "application/pdf" }), i = URL.createObjectURL(e), a = document.createElement("a");
|
|
63
|
+
document.body.appendChild(a), a.href = i, a.download = l, a.style.display = "none", a.click(), setTimeout(() => {
|
|
64
64
|
URL.revokeObjectURL(i), document.body.removeChild(a);
|
|
65
65
|
}, 10);
|
|
66
66
|
}
|
|
67
|
-
c(
|
|
68
|
-
async function
|
|
69
|
-
var
|
|
70
|
-
if (!
|
|
71
|
-
const e = await ((
|
|
67
|
+
c(x, "download");
|
|
68
|
+
async function I(l = 150, o = "filename") {
|
|
69
|
+
var k, C;
|
|
70
|
+
if (!d.value) throw new Error("Current PDFDocumentProxy have not loaded yet");
|
|
71
|
+
const e = await ((k = d.value) == null ? void 0 : k.saveDocument()), a = await R(e.buffer).promise, n = l / 72, u = 96 / 72, g = await G(), t = g.contentWindow;
|
|
72
72
|
t.document.title = o;
|
|
73
|
-
const
|
|
74
|
-
for (const v of
|
|
73
|
+
const E = [...Array(a.numPages).keys()].map((v) => v + 1);
|
|
74
|
+
for (const v of E) {
|
|
75
75
|
const p = await a.getPage(v), m = p.getViewport({ scale: 1 });
|
|
76
76
|
v === 1 && J(
|
|
77
77
|
t,
|
|
@@ -86,23 +86,23 @@ function K(r, s = {
|
|
|
86
86
|
intent: "print",
|
|
87
87
|
transform: [n, 0, 0, n, 0, 0],
|
|
88
88
|
viewport: m
|
|
89
|
-
}).promise), (
|
|
89
|
+
}).promise), (C = L.getContext("2d")) == null || C.drawImage(f, 0, 0);
|
|
90
90
|
}
|
|
91
91
|
t == null || t.focus(), t == null || t.print(), document.body.removeChild(g);
|
|
92
92
|
}
|
|
93
|
-
return c(
|
|
93
|
+
return c(I, "print"), N(r) ? (r.value && w(r.value), A(r, () => {
|
|
94
94
|
r.value && w(r.value);
|
|
95
95
|
})) : r && w(r), {
|
|
96
|
-
pdf:
|
|
97
|
-
pages:
|
|
98
|
-
info:
|
|
99
|
-
print:
|
|
100
|
-
download:
|
|
101
|
-
getPDFDestination:
|
|
96
|
+
pdf: h,
|
|
97
|
+
pages: P,
|
|
98
|
+
info: b,
|
|
99
|
+
print: I,
|
|
100
|
+
download: x,
|
|
101
|
+
getPDFDestination: T,
|
|
102
102
|
processLoadingTask: w
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
c(
|
|
105
|
+
c(X, "usePDF");
|
|
106
106
|
export {
|
|
107
|
-
|
|
107
|
+
X as usePDF
|
|
108
108
|
};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var k=Object.defineProperty;var c=(p,v)=>k(p,"name",{value:v,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),T=require("pdfjs-dist"),m=require("../annotations/index.cjs"),L=require("../linkService/index.cjs"),O=i.defineComponent({__name:"Annotation",props:{page:{},viewport:{},document:{},annotationsFilter:{},annotationsMap:{},imageResourcesPath:{},hideForms:{type:Boolean},enableScripting:{type:Boolean},intent:{}},emits:["annotation","annotationLoaded"],setup(p,{emit:v}){const t=p,y=v,s=i.ref(),u=i.ref();function w(o){const e=m.annotationEventsHandler(o,t.document,u.value);Promise.resolve(e).then(n=>{n&&y("annotation",n)})}c(w,"annotationsEvents");async function E(){var e;return await((e=i.toRaw(t.document))==null?void 0:e.getFieldObjects())}c(E,"getFieldObjects");async function M(){var e;return await((e=i.toRaw(t.document))==null?void 0:e.hasJSActions())}c(M,"getHasJSActions");async function h(){const o=t.page;let e=await(o==null?void 0:o.getAnnotations({intent:t.intent}));if(t.annotationsFilter){const n=t.annotationsFilter;e=e.filter(r=>{const l=r.subtype,d=r.fieldType?`${l}.${r.fieldType}`:null;return(n==null?void 0:n.includes(l))||d!==null&&(n==null?void 0:n.includes(d))})}return e}c(h,"getAnnotations");async function S(){var b,A;(A=(b=s.value).replaceChildren)==null||A.call(b);for(const a of m.EVENTS_TO_HANDLER)s.value.removeEventListener(a,w);const o=i.toRaw(t.document),e=t.page,n=t.viewport;u.value=await h();const r=new Map([]);for(const a of u.value)if(a.subtype==="Widget"&&a.fieldType==="Btn"&&a.pushButton){const f=a.rect[2]-a.rect[0],F=a.rect[3]-a.rect[1],g=document.createElement("canvas");g.setAttribute("width",(f*n.scale).toString()),g.setAttribute("height",(F*n.scale).toString()),r.set(a.id,g)}const l=o.annotationStorage;if(t.annotationsMap)for(const[a,f]of Object.entries(t.annotationsMap))l.setValue(a,f);const d={accessibilityManager:void 0,annotationCanvasMap:r,div:s.value,page:e,viewport:n.clone({dontFlip:!0}),annotationEditorUIManager:null,l10n:null},_={annotations:u.value,viewport:n.clone({dontFlip:!0}),linkService:new L.SimpleLinkService,annotationCanvasMap:r,div:s.value,annotationStorage:l,renderForms:!t.hideForms,page:e,enableScripting:!1,hasJSActions:await M(),fieldObjects:await E(),downloadManager:null,imageResourcesPath:t.imageResourcesPath};new T.AnnotationLayer(d).render(_).then(async()=>{y("annotationLoaded",await h())});for(const a of m.EVENTS_TO_HANDLER)s.value.addEventListener(a,w)}return c(S,"render"),i.watch(()=>t.viewport,()=>{t.page&&t.viewport&&s.value&&S()}),i.onMounted(()=>{t.page&&t.viewport&&s.value&&S()}),(o,e)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"layer",ref:s,class:"annotationLayer",style:{display:"block"}},null,512))}});exports.default=O;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var L = Object.defineProperty;
|
|
2
2
|
var r = (d, p) => L(d, "name", { value: p, configurable: !0 });
|
|
3
|
-
import { defineComponent as O, ref as A, watch as
|
|
4
|
-
import
|
|
5
|
-
import { EVENTS_TO_HANDLER as
|
|
6
|
-
import { SimpleLinkService as
|
|
7
|
-
const
|
|
3
|
+
import { defineComponent as O, ref as A, watch as T, onMounted as j, openBlock as B, createElementBlock as H, toRaw as m } from "vue";
|
|
4
|
+
import { AnnotationLayer as P } from "pdfjs-dist";
|
|
5
|
+
import { EVENTS_TO_HANDLER as M, annotationEventsHandler as C } from "../annotations/index.js";
|
|
6
|
+
import { SimpleLinkService as J } from "../linkService/index.js";
|
|
7
|
+
const D = /* @__PURE__ */ O({
|
|
8
8
|
__name: "Annotation",
|
|
9
9
|
props: {
|
|
10
10
|
page: {},
|
|
@@ -21,22 +21,22 @@ const W = /* @__PURE__ */ O({
|
|
|
21
21
|
setup(d, { emit: p }) {
|
|
22
22
|
const t = d, g = p, i = A(), l = A();
|
|
23
23
|
function y(o) {
|
|
24
|
-
const n =
|
|
24
|
+
const n = C(o, t.document, l.value);
|
|
25
25
|
Promise.resolve(n).then((e) => {
|
|
26
26
|
e && g("annotation", e);
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
r(y, "annotationsEvents");
|
|
30
|
-
async function
|
|
30
|
+
async function E() {
|
|
31
31
|
var n;
|
|
32
32
|
return await ((n = m(t.document)) == null ? void 0 : n.getFieldObjects());
|
|
33
33
|
}
|
|
34
|
-
r(
|
|
35
|
-
async function
|
|
34
|
+
r(E, "getFieldObjects");
|
|
35
|
+
async function F() {
|
|
36
36
|
var n;
|
|
37
37
|
return await ((n = m(t.document)) == null ? void 0 : n.hasJSActions());
|
|
38
38
|
}
|
|
39
|
-
r(
|
|
39
|
+
r(F, "getHasJSActions");
|
|
40
40
|
async function w() {
|
|
41
41
|
const o = t.page;
|
|
42
42
|
let n = await (o == null ? void 0 : o.getAnnotations({ intent: t.intent }));
|
|
@@ -53,7 +53,7 @@ const W = /* @__PURE__ */ O({
|
|
|
53
53
|
async function h() {
|
|
54
54
|
var b, S;
|
|
55
55
|
(S = (b = i.value).replaceChildren) == null || S.call(b);
|
|
56
|
-
for (const a of
|
|
56
|
+
for (const a of M) i.value.removeEventListener(a, y);
|
|
57
57
|
const o = m(t.document), n = t.page, e = t.viewport;
|
|
58
58
|
l.value = await w();
|
|
59
59
|
const s = /* @__PURE__ */ new Map([]);
|
|
@@ -76,31 +76,31 @@ const W = /* @__PURE__ */ O({
|
|
|
76
76
|
}, k = {
|
|
77
77
|
annotations: l.value,
|
|
78
78
|
viewport: e.clone({ dontFlip: !0 }),
|
|
79
|
-
linkService: new
|
|
79
|
+
linkService: new J(),
|
|
80
80
|
annotationCanvasMap: s,
|
|
81
81
|
div: i.value,
|
|
82
82
|
annotationStorage: c,
|
|
83
83
|
renderForms: !t.hideForms,
|
|
84
84
|
page: n,
|
|
85
85
|
enableScripting: !1,
|
|
86
|
-
hasJSActions: await
|
|
87
|
-
fieldObjects: await
|
|
86
|
+
hasJSActions: await F(),
|
|
87
|
+
fieldObjects: await E(),
|
|
88
88
|
downloadManager: null,
|
|
89
89
|
imageResourcesPath: t.imageResourcesPath
|
|
90
90
|
};
|
|
91
|
-
new
|
|
91
|
+
new P(u).render(k).then(async () => {
|
|
92
92
|
g("annotationLoaded", await w());
|
|
93
93
|
});
|
|
94
|
-
for (const a of
|
|
94
|
+
for (const a of M) i.value.addEventListener(a, y);
|
|
95
95
|
}
|
|
96
|
-
return r(h, "render"),
|
|
96
|
+
return r(h, "render"), T(
|
|
97
97
|
() => t.viewport,
|
|
98
98
|
() => {
|
|
99
99
|
t.page && t.viewport && i.value && h();
|
|
100
100
|
}
|
|
101
|
-
),
|
|
101
|
+
), j(() => {
|
|
102
102
|
t.page && t.viewport && i.value && h();
|
|
103
|
-
}), (o, n) => (
|
|
103
|
+
}), (o, n) => (B(), H("div", {
|
|
104
104
|
ref_key: "layer",
|
|
105
105
|
ref: i,
|
|
106
106
|
class: "annotationLayer",
|
|
@@ -109,5 +109,5 @@ const W = /* @__PURE__ */ O({
|
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
111
|
export {
|
|
112
|
-
|
|
112
|
+
D as default
|
|
113
113
|
};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var D=Object.defineProperty;var
|
|
1
|
+
"use strict";var D=Object.defineProperty;var i=(x,k)=>D(x,"name",{value:k,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),A=require("pdfjs-dist"),z=;/* empty css */;/* empty css */const H=,/* empty css */X=;/* empty css */;/* empty css */const j=,/* empty css */I=o.defineComponent({name:"LSPdf"}),J=o.defineComponent({...I,props:{pdf:{},page:{default:1},scale:{default:1},rotation:{},fitParent:{type:Boolean},width:{},height:{},textLayer:{type:Boolean},imageResourcesPath:{},hideForms:{type:Boolean},intent:{default:"display"},annotationLayer:{type:Boolean},annotationsFilter:{},annotationsMap:{},watermarkText:{},watermarkOptions:{},highlightText:{},highlightOptions:{}},emits:["annotation","highlight","loaded","textLoaded","annotationLoaded","xfaLoaded","loadComplete","loadError","update:source"],setup(x,{expose:k,emit:S}){const n=x,s=S;o.watch(()=>n.pdf,()=>{W()},{immediate:!0,deep:!0});const p=o.ref(),g=o.ref(),P=o.ref(!1);let v;const u=o.computed(()=>({viewport:void 0,document:void 0,page:void 0})),b=o.computed(()=>({annotationsMap:n.annotationsMap,annotationsFilter:n.annotationsFilter,imageResourcesPath:n.imageResourcesPath,hideForms:n.hideForms,intent:n.intent})),T=o.computed(()=>({highlightText:n.highlightText,highlightOptions:n.highlightOptions}));function B(){return j.default({},{columns:4,rows:4,rotation:45,fontSize:18,color:"rgba(211, 210, 211, 0.4)"},n.watermarkOptions)}i(B,"getWatermarkOptionsWithDefaults");function _(a){if(!(typeof a=="number"&&a%90===0))return 0;const e=a/90;return e>4?_(a-360):e<0?_(a+360):a}i(_,"getRotation");function V(a){let e=n.scale;if(n.fitParent){const t=p.value.parentNode.clientWidth,r=a.getViewport({scale:1}).width;e=t/r}else if(n.width){const t=a.getViewport({scale:1}).width;e=n.width/t}else if(n.height){const t=a.getViewport({scale:1}).height;e=n.height/t}return e}i(V,"getScale");function E(a=1){if(!n.watermarkText)return;const e=L();if(!e)return;const t=e.getContext("2d");if(!t)return;const r=B(),c=n.watermarkText,l=r.columns,f=r.rows,d=l*f,m=r.rotation,y=r.fontSize*a;t.font=`${y}px Trebuchet MS`,t.fillStyle=r.color;for(let h=0;h<d;h++){const w=h%l*(e.width/l)+e.width/(l*2),q=Math.floor(h/l)*(e.height/f)+e.height/(f*2),$=t.measureText(c).width;t.save(),t.translate(w,q),t.rotate(-m*(Math.PI/180)),t.fillText(c,-$/2,y/2),t.restore()}}i(E,"paintWatermark");function L(){var e;let a=null;return(e=p.value)==null||e.childNodes.forEach(t=>{t.tagName==="CANVAS"&&(a=t)}),a}i(L,"getCurrentCanvas");function F(a){var c;let e;const t=L();t&&(t==null?void 0:t.getAttribute("role"))==="main"?e=t:(e=document.createElement("canvas"),e.style.display="block",e.setAttribute("dir","ltr"));const r=window.devicePixelRatio||1;return e.width=Math.floor(a.width*r),e.height=Math.floor(a.height*r),e.style.width=`${Math.floor(a.width)}px`,e.style.height=`${Math.floor(a.height)}px`,e.setAttribute("class","pdf-canvas"),(c=p.value)==null||c.style.setProperty("--scale-factor",`${a.scale}`),g.value.style.width=`${Math.floor(a.width)}px`,g.value.style.height=`${Math.floor(a.height)}px`,g.value.style.top="0",g.value.style.left="0",P.value=!0,e}i(F,"setupCanvas");function C(){v&&v.cancel()}i(C,"cancelRender");function M(a){var e;(e=o.toRaw(u.value.document))==null||e.getPage(a).then(t=>{var w;C();const r=t.getViewport(),c={scale:V(t),rotation:_((n.rotation||0)+r.rotation)},l=t.getViewport(c),f=L(),d=F(l),m=window.devicePixelRatio||1,y=m!==1?[m,0,0,m,0,0]:void 0,h={canvasContext:d.getContext("2d"),viewport:l,annotationMode:n.hideForms?A.AnnotationMode.ENABLE:A.AnnotationMode.ENABLE_FORMS,transform:y,intent:n.intent};(d==null?void 0:d.getAttribute("role"))!=="main"?f&&((w=p.value)==null||w.replaceChild(d,f)):d.removeAttribute("role"),u.value.page=t,u.value.viewport=l,v=t.render(h),v.promise.then(()=>{P.value=!1,E(l.scale),s("loaded",u.value.viewport),s("loadComplete")}).catch(()=>{s("loadError")})})}i(M,"renderPage");function N(a){a.promise&&a.promise.then(async e=>{u.value.document=e,M(n.page)})}i(N,"initDoc"),o.watch(()=>[n.page,n.scale,n.width,n.height,n.rotation,n.hideForms,n.intent],()=>{M(n.page)});function O(){M(n.page)}i(O,"reload");function R(){C()}i(R,"cancel");async function W(){if(n.pdf)try{N(n.pdf)}finally{}}return i(W,"initPdf"),k({reload:O,cancel:R}),(a,e)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"container",ref:p,style:{position:"relative",display:"block"}},[e[5]||(e[5]=o.createElementVNode("canvas",{dir:"ltr",style:{display:"block"},role:"main"},null,-1)),a.annotationLayer?(o.openBlock(),o.createBlock(z.default,o.mergeProps({key:0},{...o.unref(u),...o.unref(b)},{onAnnotation:e[0]||(e[0]=t=>s("annotation",t)),onAnnotationLoaded:e[1]||(e[1]=t=>s("annotationLoaded",t))}),null,16)):o.createCommentVNode("",!0),a.textLayer?(o.openBlock(),o.createBlock(H.default,o.mergeProps({key:1},{...o.unref(u),...o.unref(T)},{onHighlight:e[2]||(e[2]=t=>s("highlight",t)),onTextLoaded:e[3]||(e[3]=t=>s("textLoaded",t))}),null,16)):o.createCommentVNode("",!0),o.createVNode(X.default,o.mergeProps({...o.unref(u)},{onXfaLoaded:e[4]||(e[4]=t=>s("xfaLoaded"))}),null,16),o.withDirectives(o.createElementVNode("div",{ref_key:"loadingLayer",ref:g,style:{position:"absolute"}},[o.renderSlot(a.$slots,"default")],512),[[o.vShow,o.unref(P)]])],512))}});exports.default=J;
|