dlzn-ui 2.0.117 → 2.0.119
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/package.json
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
[diffend] Oversized file quarantined before diffing.
|
|
2
|
+
name: package/plugins/autoImport/$fileView/pdf/Index.mjs
|
|
3
|
+
size: 56008979 bytes
|
|
4
|
+
sha256: 795cfef467056412f4fe0757381a15a062542bf904bd0bb6b8863c4b600088fa
|
|
@@ -3,8 +3,10 @@ import { PreviewFile } from '@open-file-viewer/core';
|
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
file: PreviewFile;
|
|
5
5
|
onBind: (stage: StageCapability) => void;
|
|
6
|
+
onDefault: (bool: boolean) => void;
|
|
6
7
|
onError: (bool: boolean) => void;
|
|
7
|
-
|
|
8
|
+
onFallback: (bool: boolean) => void;
|
|
9
|
+
onLocked: (bool: boolean) => void;
|
|
8
10
|
onZoom: (zoom: number) => void;
|
|
9
11
|
};
|
|
10
12
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,48 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createVNode as t, ref as n, render as r } from "vue";
|
|
1
|
+
import { createVNode as e, defineAsyncComponent as t, ref as n, render as r, watch as i } from "vue";
|
|
3
2
|
// ../../packages/dlzn-ui/plugins/autoImport/$fileView/pdf/plugin.ts
|
|
4
|
-
function
|
|
3
|
+
function a(a) {
|
|
5
4
|
return {
|
|
6
5
|
match(e) {
|
|
7
6
|
return e.mimeType === "application/pdf" || e.extension === "pdf";
|
|
8
7
|
},
|
|
9
8
|
name: "pdf",
|
|
10
|
-
render(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
s !== null && (e === "width" ? s.fitWidth() : s.zoomTo(1));
|
|
16
|
-
}, f = t(e, {
|
|
17
|
-
file: a.file,
|
|
18
|
-
onBind(e) {
|
|
19
|
-
s = e, d(a.options.fit), a.options.zoom !== 1 && s.zoomTo(a.options.zoom), c !== null && (s.goToPage(c - 1), c = null), a.toolbar?.setZoom(s.getZoomLevel());
|
|
20
|
-
},
|
|
21
|
-
onError(e) {
|
|
22
|
-
l.value = e;
|
|
23
|
-
},
|
|
24
|
-
onLoading(e) {
|
|
25
|
-
u.value = e, a.setLoading(e);
|
|
26
|
-
},
|
|
27
|
-
onZoom(e) {
|
|
28
|
-
a.toolbar?.setZoom(e);
|
|
9
|
+
render(o) {
|
|
10
|
+
return new Promise((s) => {
|
|
11
|
+
if (o.signal?.aborted) {
|
|
12
|
+
s({ destroy() {} });
|
|
13
|
+
return;
|
|
29
14
|
}
|
|
15
|
+
let c = document.createElement("div");
|
|
16
|
+
c.className = "ofv-pdf-embed", o.viewport.append(c);
|
|
17
|
+
let l = null, u = null, d = n(!1), f = n(!0), p = (e) => {
|
|
18
|
+
l !== null && (e === "width" ? l.fitWidth() : l.zoomTo(1));
|
|
19
|
+
}, m = e(t(() => import("./Index.mjs")), {
|
|
20
|
+
file: o.file,
|
|
21
|
+
onBind(e) {
|
|
22
|
+
l = e, p(o.options.fit), o.options.zoom !== 1 && l.zoomTo(o.options.zoom), u !== null && (l.goToPage(u - 1), u = null), o.toolbar?.setZoom(l.getZoomLevel());
|
|
23
|
+
},
|
|
24
|
+
onDefault(e) {
|
|
25
|
+
d.value = e, e && (f.value = !1);
|
|
26
|
+
},
|
|
27
|
+
onError(e) {
|
|
28
|
+
e && (f.value = !1);
|
|
29
|
+
},
|
|
30
|
+
onFallback() {},
|
|
31
|
+
onLocked(e) {
|
|
32
|
+
e && (f.value = !1);
|
|
33
|
+
},
|
|
34
|
+
onZoom(e) {
|
|
35
|
+
o.toolbar?.setZoom(e);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
m.appContext = a, r(m, c), i(f, (e) => {
|
|
39
|
+
e || s({
|
|
40
|
+
canCommand(e) {
|
|
41
|
+
return d.value ? e === "zoom-in" || e === "zoom-out" || e === "zoom-reset" || e === "rotate-left" || e === "rotate-right" : !1;
|
|
42
|
+
},
|
|
43
|
+
command(e) {
|
|
44
|
+
return d.value ? e === "zoom-in" ? (l.zoomIn(), !0) : e === "zoom-out" ? (l.zoomOut(), !0) : e === "zoom-reset" ? (l.setViewRotation(0), p(o.options.fit), !0) : e === "rotate-right" ? (l.rotateViewBy(90), !0) : e === "rotate-left" && (l.rotateViewBy(-90), !0) : !1;
|
|
45
|
+
},
|
|
46
|
+
destroy() {
|
|
47
|
+
l = null, r(null, c), c.remove();
|
|
48
|
+
},
|
|
49
|
+
goToPage(e) {
|
|
50
|
+
return l === null ? (u = e, !0) : (l.goToPage(e - 1), !0);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
});
|
|
30
54
|
});
|
|
31
|
-
return f.appContext = i, r(f, o), {
|
|
32
|
-
canCommand(e) {
|
|
33
|
-
return s === null || l.value || u.value ? !1 : e === "zoom-in" || e === "zoom-out" || e === "zoom-reset" || e === "rotate-left" || e === "rotate-right";
|
|
34
|
-
},
|
|
35
|
-
command(e) {
|
|
36
|
-
return s === null || l.value || u.value ? !1 : e === "zoom-in" ? (s.zoomIn(), !0) : e === "zoom-out" ? (s.zoomOut(), !0) : e === "zoom-reset" ? (s.setViewRotation(0), d(a.options.fit), !0) : e === "rotate-right" ? (s.rotateViewBy(90), !0) : e === "rotate-left" && (s.rotateViewBy(-90), !0);
|
|
37
|
-
},
|
|
38
|
-
destroy() {
|
|
39
|
-
s = null, r(null, o), o.remove();
|
|
40
|
-
},
|
|
41
|
-
goToPage(e) {
|
|
42
|
-
return s === null ? (c = e, !0) : (s.goToPage(e - 1), !0);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
55
|
}
|
|
46
56
|
};
|
|
47
57
|
}
|
|
48
|
-
export {
|
|
58
|
+
export { a as pdfPlugin };
|