dlzn-ui 2.0.114 → 2.0.116

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.
@@ -0,0 +1 @@
1
+ .ofv-fallback[data-v-844ab70e]{--ofv-surface:#fff;--ofv-text:#1c2333;--ofv-text-muted:#5b6478}
@@ -0,0 +1 @@
1
+ .ofv-pdf-embed{--epdf-scrollbar-thumb:#fff}.ofv-pdf-embed .scrollbar{width:16px!important}.ofv-pdf-embed .thumb{cursor:pointer}
@@ -0,0 +1 @@
1
+ .wrapper[data-v-b09c3328]>*{z-index:2}.file_viewer_dialog .ofv-root{--ofv-bg:transparent}.file_viewer_dialog .ofv-root:not(:has(.ofv-pdf-embed)){padding-inline:calc(var(--spacing,.25rem) * 36);padding-block:calc(var(--spacing,.25rem) * 28)}.file_viewer_dialog .ofv-root{border:none;font-family:inherit}:is(.file_viewer_dialog .ofv-root:has(.ofv-image-viewer) .ofv-host,.file_viewer_dialog .ofv-root:has(.ofv-image-viewer) .ofv-viewport,.file_viewer_dialog .ofv-root:has(.ofv-image-viewer) .ofv-image-stage){overflow:visible}.file_viewer_dialog .ofv-toolbar,.file_viewer_dialog .ofv-status-error,.file_viewer_dialog .ofv-image-info,.file_viewer_dialog .ofv-sheet>h3{display:none}.file_viewer_dialog .ofv-viewport:has(.ofv-office){flex-direction:column;justify-content:center;display:flex}.file_viewer_dialog .ofv-viewport:has(.ofv-pdf-embed){position:relative;overflow:hidden}.file_viewer_dialog .ofv-pdf-embed{position:absolute;inset:0}.file_viewer_dialog .ofv-office{min-height:auto}.file_viewer_dialog .ofv-office .ofv-table-scroll{max-height:calc(100vh - 358px)}.file_viewer_dialog .ofv-panel:empty{display:none}
@@ -14,3 +14,9 @@
14
14
  img {
15
15
  user-select: none;
16
16
  }
17
+
18
+ .empty_hidden {
19
+ &:empty {
20
+ display: none;
21
+ }
22
+ }
@@ -0,0 +1 @@
1
+ .t-dialog__position_fullscreen:has(.file_viewer_dialog){height:100%}.t-dialog.file_viewer_dialog{background-color:#0000;border:none}.t-dialog.file_viewer_dialog .t-dialog__body{height:100%;padding:0}
@@ -0,0 +1,32 @@
1
+ import { t as e } from "./plugin-vue_export-helper-Djzt4Yr7.mjs";
2
+ import { Fragment as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, openBlock as o, toDisplayString as s } from "vue";
3
+ import '../assets/Error-85lYG3y2.css';// ../../packages/dlzn-ui/plugins/autoImport/$fileView/Error.vue?vue&type=script&setup=true&lang.ts
4
+ var c = { class: "ofv-fallback absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2" }, l = { key: 0 }, u = {
5
+ key: 1,
6
+ class: "ofv-fallback-meta"
7
+ }, d = /*#__PURE__*/ e(/* @__PURE__ */ a({
8
+ __name: "Error",
9
+ props: {
10
+ file: {},
11
+ message: {},
12
+ type: {}
13
+ },
14
+ setup(e) {
15
+ return (a, d) => (o(), r("div", c, [
16
+ i("strong", null, s(e.type === "error" ? "文件打开失败" : "当前文件暂不支持在线预览"), 1),
17
+ e.message ? (o(), r("p", l, s(e.message), 1)) : n("v-if", !0),
18
+ e.file ? (o(), r("dl", u, [
19
+ d[1] ||= i("dt", null, "文件", -1),
20
+ i("dd", null, s(e.file.name), 1),
21
+ d[2] ||= i("dt", null, "格式", -1),
22
+ i("dd", null, s(e.file.extension), 1),
23
+ d[3] ||= i("dt", null, "MIME", -1),
24
+ i("dd", null, s(e.file.mimeType), 1),
25
+ d[4] ||= i("dt", null, "大小", -1),
26
+ i("dd", null, s(e.file.size ?? "未知"), 1),
27
+ e.file.url ? (o(), r(t, { key: 0 }, [d[0] ||= i("dt", null, "来源", -1), i("dd", null, s(e.file.url), 1)], 64)) : n("v-if", !0)
28
+ ])) : n("v-if", !0)
29
+ ]));
30
+ }
31
+ }), [["__scopeId", "data-v-844ab70e"]]);
32
+ export { d as t };
@@ -0,0 +1,4 @@
1
+ [diffend] Oversized file quarantined before diffing.
2
+ name: package/chunks/Index-D_wLB47O.mjs
3
+ size: 56008639 bytes
4
+ sha256: 7179525e95fbe3df05c76271beb294556919357e3f87644acd818f5cebc5609e
package/layout/Test.mjs CHANGED
@@ -3,12 +3,13 @@ import { t as i } from "../chunks/table-B9W03_lw.mjs";
3
3
  import { t as a } from "../chunks/tag-C3NJ7YFA.mjs";
4
4
  import "../components/table/index.mjs";
5
5
  import "../components/tag/index.mjs";
6
- import { createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, openBlock as d, ref as f, unref as p, withCtx as m } from "vue";
6
+ import o from "../plugins/autoImport/$fileView/index2.mjs";
7
+ import { createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, openBlock as f, ref as p, unref as m, withCtx as h } from "vue";
7
8
  // ../../packages/dlzn-ui/layout/Test.vue
8
- var h = /* @__PURE__ */ u({
9
+ var g = /* @__PURE__ */ d({
9
10
  __name: "Test",
10
- setup(u) {
11
- let h = [
11
+ setup(d) {
12
+ let g = [
12
13
  {
13
14
  component: "TColorPicker",
14
15
  model: "color"
@@ -23,12 +24,12 @@ var h = /* @__PURE__ */ u({
23
24
  multiple: !0,
24
25
  options: "systemDeptTree"
25
26
  }
26
- ], g = f([{
27
+ ], _ = p([{
27
28
  color: "#000000",
28
29
  number: 1234567890,
29
30
  tag: "0",
30
31
  url: "https://cos.wlinkai.com/38/202611/04/manual/8a242998-e81a-4419-8017-61ec8d376a7c.wav?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDYLn9BB5FLFPTbbSBmIj185pMguEew5B4%26q-sign-time%3D1794386718%3B1794390318%26q-key-time%3D1794386718%3B1794390318%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3Dfa477e30f44e327626183817b2405e5ce00ed86f"
31
- }]), _ = [
32
+ }]), v = [
32
33
  {
33
34
  cell: { component: "ColorPicker" },
34
35
  colKey: "color",
@@ -58,7 +59,7 @@ var h = /* @__PURE__ */ u({
58
59
  title: "Tag"
59
60
  }
60
61
  ];
61
- function v() {
62
+ function y() {
62
63
  e({
63
64
  body: "Are you sure you want to open the dialog?",
64
65
  onConfirmCallback: () => {
@@ -66,67 +67,74 @@ var h = /* @__PURE__ */ u({
66
67
  }
67
68
  });
68
69
  }
69
- let y = f(!0);
70
- return (e, u) => (d(), o("div", null, [s("div", null, [
71
- l(p(n), { items: h }),
72
- l(p(i), {
73
- columns: _,
74
- data: g.value
70
+ let b = p(!0);
71
+ function x() {
72
+ o([]);
73
+ }
74
+ return (e, o) => (f(), s("div", null, [c("div", null, [
75
+ u(m(n), { items: g }),
76
+ u(m(i), {
77
+ columns: v,
78
+ data: _.value
75
79
  }, null, 8, ["data"]),
76
- l(p(r), {
77
- visible: y.value,
78
- "onUpdate:visible": u[0] ||= (e) => y.value = e
80
+ u(m(r), {
81
+ visible: b.value,
82
+ "onUpdate:visible": o[0] ||= (e) => b.value = e
79
83
  }, {
80
- default: m(() => [...u[1] ||= [s("div", null, "qwqwe", -1)]]),
84
+ default: h(() => [...o[1] ||= [c("div", null, "qwqwe", -1)]]),
81
85
  _: 1
82
86
  }, 8, ["visible"]),
83
- l(p(t), { onClick: v }, {
84
- default: m(() => [...u[2] ||= [c("Open Dialog", -1)]]),
87
+ u(m(t), { onClick: y }, {
88
+ default: h(() => [...o[2] ||= [l("Open Dialog", -1)]]),
89
+ _: 1
90
+ }),
91
+ u(m(t), { onClick: x }, {
92
+ default: h(() => [...o[3] ||= [l("Open File Viewer", -1)]]),
85
93
  _: 1
86
94
  }),
87
- l(p(a), {
95
+ u(m(a), {
88
96
  "auto-color": "",
89
97
  "auto-icon": ""
90
98
  }, {
91
- default: m(() => [...u[3] ||= [c("初始", -1)]]),
99
+ default: h(() => [...o[4] ||= [l("初始", -1)]]),
92
100
  _: 1
93
101
  }),
94
- l(p(a), {
102
+ u(m(a), {
95
103
  "auto-color": "",
96
104
  "auto-icon": ""
97
105
  }, {
98
- default: m(() => [...u[4] ||= [c("执行中", -1)]]),
106
+ default: h(() => [...o[5] ||= [l("执行中", -1)]]),
99
107
  _: 1
100
108
  }),
101
- l(p(a), {
109
+ u(m(a), {
102
110
  "auto-color": "",
103
111
  "auto-icon": ""
104
112
  }, {
105
- default: m(() => [...u[5] ||= [c("完成", -1)]]),
113
+ default: h(() => [...o[6] ||= [l("完成", -1)]]),
106
114
  _: 1
107
115
  }),
108
- l(p(a), {
116
+ u(m(a), {
109
117
  "auto-color": "",
110
118
  "auto-icon": ""
111
119
  }, {
112
- default: m(() => [...u[6] ||= [c("取消", -1)]]),
120
+ default: h(() => [...o[7] ||= [l("取消", -1)]]),
113
121
  _: 1
114
122
  }),
115
- l(p(a), {
123
+ u(m(a), {
116
124
  "auto-color": "",
117
125
  "auto-icon": ""
118
126
  }, {
119
- default: m(() => [...u[7] ||= [c("暂停", -1)]]),
127
+ default: h(() => [...o[8] ||= [l("暂停", -1)]]),
120
128
  _: 1
121
129
  }),
122
- l(p(a), {
130
+ u(m(a), {
123
131
  "auto-color": "",
124
132
  "auto-icon": ""
125
133
  }, {
126
- default: m(() => [...u[8] ||= [c("过期", -1)]]),
134
+ default: h(() => [...o[9] ||= [l("过期", -1)]]),
127
135
  _: 1
128
136
  })
129
137
  ])]));
130
138
  }
131
139
  });
132
- export { h as default };
140
+ export { g as default };
@@ -26,6 +26,7 @@ interface GrainientProps {
26
26
  declare const __VLS_export: import('vue').DefineComponent<GrainientProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<GrainientProps> & Readonly<{}>, {
27
27
  className: string;
28
28
  zoom: number;
29
+ saturation: number;
29
30
  color1: string;
30
31
  color2: string;
31
32
  color3: string;
@@ -44,7 +45,6 @@ declare const __VLS_export: import('vue').DefineComponent<GrainientProps, {}, {}
44
45
  grainAnimated: boolean;
45
46
  contrast: number;
46
47
  gamma: number;
47
- saturation: number;
48
48
  centerX: number;
49
49
  centerY: number;
50
50
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
package/package.json CHANGED
@@ -90,9 +90,13 @@
90
90
  "@alova/adapter-xhr": "^2.3.3",
91
91
  "@alova/scene-vue": "^1.6.2",
92
92
  "@bprogress/core": "^1.3.4",
93
+ "@embedpdf/engine": "^3.4.0",
94
+ "@embedpdf/fonts-sc": "^1.0.0",
95
+ "@embedpdf/vue": "^3.4.0",
93
96
  "@fingerprintjs/fingerprintjs": "^5.3.0",
94
97
  "@formkit/auto-animate": "^0.10.2",
95
98
  "@iconify/vue": "^5.0.5",
99
+ "@open-file-viewer/core": "^1.0.0",
96
100
  "@types/file-saver": "^2.0.7",
97
101
  "croner": "^11.0.0",
98
102
  "cronstrue": "^3.38.0",
@@ -116,7 +120,7 @@
116
120
  "> 1%",
117
121
  "not dead"
118
122
  ],
119
- "version": "2.0.114",
123
+ "version": "2.0.116",
120
124
  "scripts": {
121
125
  "dev": "vite --config play/vite.config.ts"
122
126
  }
@@ -0,0 +1 @@
1
+ export { t as default } from "../../../chunks/Error-DMv0JysQ.mjs";
@@ -0,0 +1,9 @@
1
+ import { PreviewFile } from '@open-file-viewer/core';
2
+ type __VLS_Props = {
3
+ file?: PreviewFile;
4
+ message?: string;
5
+ type: 'error' | 'notSupport';
6
+ };
7
+ 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>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
@@ -0,0 +1,188 @@
1
+ import { n as e } from "../../../chunks/provider-BNvP0xrG.mjs";
2
+ import { t } from "../../../chunks/Error-DMv0JysQ.mjs";
3
+ import { pdfPlugin as n } from "./pdf/plugin.mjs";
4
+ import { t as r } from "../../../chunks/plugin-vue_export-helper-Djzt4Yr7.mjs";
5
+ import { createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, getCurrentInstance as d, onBeforeUnmount as f, onMounted as p, openBlock as m, ref as h, shallowRef as g, toDisplayString as _, unref as v, watch as y, withCtx as b } from "vue";
6
+ import { useResizeObserver as x } from "@vueuse/core";
7
+ import { archivePlugin as S, createViewer as C, imagePlugin as w, officePlugin as T, textPlugin as E } from "@open-file-viewer/core";
8
+ import "@open-file-viewer/core/style.css";
9
+ import '../../../assets/Index-DaVGVRCj.css';// ../../packages/dlzn-ui/plugins/autoImport/$fileView/Index.vue?vue&type=script&setup=true&lang.ts
10
+ var D = {
11
+ key: 3,
12
+ class: "absolute right-auto bottom-12 left-auto flex items-center gap-2"
13
+ }, O = {
14
+ key: 0,
15
+ class: "flex items-center gap-4 rounded-full bg-(--td-bg-color-component) px-6 py-2 whitespace-nowrap",
16
+ style: { "line-height": "32px" }
17
+ }, k = { key: 0 }, A = { key: 1 }, j = { class: "empty_hidden flex items-center rounded-full bg-(--td-bg-color-component) px-6 py-2 whitespace-nowrap" }, M = /*#__PURE__*/ r(/* @__PURE__ */ u({
18
+ __name: "Index",
19
+ props: {
20
+ index: { default: 0 },
21
+ sourceArray: {}
22
+ },
23
+ emits: ["close"],
24
+ setup(r, { emit: u }) {
25
+ let M = r, N = u, P = h(M.index), F = h("loading");
26
+ function I() {
27
+ N("close");
28
+ }
29
+ function L() {
30
+ P.value === M.sourceArray.length - 1 ? P.value = 0 : P.value++;
31
+ }
32
+ function R() {
33
+ P.value === 0 ? P.value = M.sourceArray.length - 1 : P.value--;
34
+ }
35
+ let z = h(null), B = h(null), V = null, H = h(null), U = h(null), W = g(null);
36
+ x(B, () => {
37
+ V?.resize();
38
+ });
39
+ let G = d();
40
+ return p(() => {
41
+ V = C({
42
+ container: z.value,
43
+ fallback: "custom",
44
+ files: M.sourceArray,
45
+ fit: "scale-down",
46
+ initialIndex: M.index,
47
+ locale: "zh-CN",
48
+ onError(e, t) {
49
+ W.value = {
50
+ error: e,
51
+ file: t
52
+ }, F.value = "error";
53
+ },
54
+ onLoad() {
55
+ F.value === "loading" && (F.value = "success");
56
+ },
57
+ onUnsupported() {
58
+ F.value = "unsupported";
59
+ },
60
+ plugins: [
61
+ w(),
62
+ n(G.appContext),
63
+ T(),
64
+ E(),
65
+ S()
66
+ ],
67
+ renderFallback(e) {
68
+ return U.value = e.file, { destroy() {
69
+ U.value = null;
70
+ } };
71
+ },
72
+ toolbar: { render(e) {
73
+ H.value = e;
74
+ } }
75
+ });
76
+ }), f(() => {
77
+ V?.destroy(), V = null, H.value = null, U.value = null;
78
+ }), y(P, (e) => {
79
+ V?.goTo(e), H.value?.clearSearch(), F.value = "loading";
80
+ }, { immediate: !0 }), (n, u) => (m(), o("div", {
81
+ ref_key: "wrapper",
82
+ ref: B,
83
+ class: "wrapper relative flex h-full justify-center"
84
+ }, [
85
+ l(v(e), {
86
+ class: "!absolute top-[10%] right-20",
87
+ icon: "mdi:close",
88
+ shape: "circle",
89
+ size: "large",
90
+ theme: "default",
91
+ variant: "base",
92
+ onClick: I
93
+ }),
94
+ r.sourceArray.length > 1 ? (m(), i(v(e), {
95
+ key: 0,
96
+ class: "!absolute top-1/2 left-20 -translate-y-1/2",
97
+ disabled: F.value === "loading",
98
+ icon: "grommet-icons:form-previous",
99
+ shape: "circle",
100
+ size: "large",
101
+ theme: "default",
102
+ variant: "base",
103
+ onClick: R
104
+ }, null, 8, ["disabled"])) : a("v-if", !0),
105
+ s("div", {
106
+ ref_key: "viewerContainer",
107
+ ref: z,
108
+ class: "relative !z-1 h-full"
109
+ }, null, 512),
110
+ U.value ? (m(), i(t, {
111
+ key: 1,
112
+ file: U.value,
113
+ type: "notSupport"
114
+ }, null, 8, ["file"])) : a("v-if", !0),
115
+ F.value === "error" ? (m(), i(t, {
116
+ key: 2,
117
+ file: W.value.file,
118
+ message: W.value.error.message,
119
+ type: "error"
120
+ }, null, 8, ["file", "message"])) : a("v-if", !0),
121
+ H.value ? (m(), o("div", D, [H.value.file?.name || H.value.length > 1 ? (m(), o("div", O, [H.value.file?.name ? (m(), o("span", k, _(H.value.file.name), 1)) : a("v-if", !0), H.value.length > 1 ? (m(), o("span", A, _(H.value.index + 1) + " / " + _(H.value.length), 1)) : a("v-if", !0)])) : a("v-if", !0), s("div", j, [
122
+ H.value.canCommand("zoom-out") ? (m(), i(v(e), {
123
+ key: 0,
124
+ icon: "akar-icons:zoom-out",
125
+ shape: "square",
126
+ theme: "default",
127
+ variant: "base",
128
+ onClick: u[0] ||= (e) => H.value.command("zoom-out")
129
+ })) : a("v-if", !0),
130
+ H.value.canCommand("zoom-reset") && H.value.zoomLabel ? (m(), i(v(e), {
131
+ key: 1,
132
+ class: "!px-1",
133
+ theme: "default",
134
+ variant: "base",
135
+ onClick: u[1] ||= (e) => H.value.command("zoom-reset")
136
+ }, {
137
+ default: b(() => [c(_(H.value.zoomLabel), 1)]),
138
+ _: 1
139
+ })) : a("v-if", !0),
140
+ H.value.canCommand("zoom-in") ? (m(), i(v(e), {
141
+ key: 2,
142
+ icon: "akar-icons:zoom-in",
143
+ shape: "square",
144
+ theme: "default",
145
+ variant: "base",
146
+ onClick: u[2] ||= (e) => H.value.command("zoom-in")
147
+ })) : a("v-if", !0),
148
+ H.value.canCommand("rotate-left") ? (m(), i(v(e), {
149
+ key: 3,
150
+ icon: "ant-design:rotate-left-outlined",
151
+ shape: "square",
152
+ theme: "default",
153
+ variant: "base",
154
+ onClick: u[3] ||= (e) => H.value.command("rotate-left")
155
+ })) : a("v-if", !0),
156
+ H.value.canCommand("rotate-right") ? (m(), i(v(e), {
157
+ key: 4,
158
+ icon: "ant-design:rotate-right-outlined",
159
+ shape: "square",
160
+ theme: "default",
161
+ variant: "base",
162
+ onClick: u[4] ||= (e) => H.value.command("rotate-right")
163
+ })) : a("v-if", !0),
164
+ a(" <TButton\n icon=\"famicons:print-outline\"\n shape=\"square\"\n theme=\"default\"\n variant=\"base\"\n @click=\"toolbarContext.print()\"\n ></TButton> "),
165
+ l(v(e), {
166
+ icon: "akar-icons:download",
167
+ shape: "square",
168
+ theme: "default",
169
+ variant: "base",
170
+ onClick: u[5] ||= (e) => H.value.download()
171
+ }),
172
+ a(" <TInput\n v-if=\"canSearch\"\n v-model=\"searchQuery\"\n borderless\n class=\"ml-2 !w-[260px]\"\n placeholder=\"搜索\"\n @change=\"handleSearchChange\"\n @enter=\"handleSearch\"\n />\n <span v-if=\"searchResult !== null\" class=\"ml-3 text-xs text-(--td-text-color-placeholder)\"\n >{{ searchResult }} 个结果</span\n > ")
173
+ ])])) : a("v-if", !0),
174
+ r.sourceArray.length > 1 ? (m(), i(v(e), {
175
+ key: 4,
176
+ class: "!absolute top-1/2 right-20 -translate-y-1/2",
177
+ disabled: F.value === "loading",
178
+ icon: "grommet-icons:form-next",
179
+ shape: "circle",
180
+ size: "large",
181
+ theme: "default",
182
+ variant: "base",
183
+ onClick: L
184
+ }, null, 8, ["disabled"])) : a("v-if", !0)
185
+ ], 512));
186
+ }
187
+ }), [["__scopeId", "data-v-b09c3328"]]);
188
+ export { M as default };
@@ -0,0 +1,13 @@
1
+ type __VLS_Props = {
2
+ index?: number;
3
+ sourceArray: string[];
4
+ };
5
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
6
+ close: () => any;
7
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
8
+ onClose?: (() => any) | undefined;
9
+ }>, {
10
+ index: number;
11
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: (sourceArray: string[]) => void;
2
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import { at as e } from "../../../chunks/provider-BNvP0xrG.mjs";
2
+ import t from "../$msg/index.mjs";
3
+ import { defineAsyncComponent as n, h as r } from "vue";
4
+ import '../../../assets/index-DLpIFnd2.css';// ../../packages/dlzn-ui/plugins/autoImport/$fileView/index.ts
5
+ var i = (i) => {
6
+ if (i.length === 0) {
7
+ t.warning("没有文件需要预览");
8
+ return;
9
+ }
10
+ let a = e({
11
+ body: () => r(n(() => import("./Index.mjs")), {
12
+ onClose: () => {
13
+ a.hide();
14
+ },
15
+ sourceArray: i
16
+ }),
17
+ closeBtn: !1,
18
+ closeOnEscKeydown: !0,
19
+ dialogClassName: "file_viewer_dialog",
20
+ footer: !1,
21
+ header: !1,
22
+ mode: "full-screen"
23
+ });
24
+ };
25
+ export { i as default };
@@ -0,0 +1 @@
1
+ export { t as default } from "../../../../chunks/Index-D_wLB47O.mjs";
@@ -0,0 +1,12 @@
1
+ import { StageCapability } from '@embedpdf/vue/stage';
2
+ import { PreviewFile } from '@open-file-viewer/core';
3
+ type __VLS_Props = {
4
+ file: PreviewFile;
5
+ onBind: (stage: StageCapability) => void;
6
+ onError: (bool: boolean) => void;
7
+ onLoading: (bool: boolean) => void;
8
+ onZoom: (zoom: number) => void;
9
+ };
10
+ 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>;
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { PreviewPlugin } from '@open-file-viewer/core';
2
+ import { AppContext } from 'vue';
3
+ export declare function pdfPlugin(appContext: AppContext): PreviewPlugin;
@@ -0,0 +1,48 @@
1
+ import { t as e } from "../../../../chunks/Index-D_wLB47O.mjs";
2
+ import { createVNode as t, ref as n, render as r } from "vue";
3
+ // ../../packages/dlzn-ui/plugins/autoImport/$fileView/pdf/plugin.ts
4
+ function i(i) {
5
+ return {
6
+ match(e) {
7
+ return e.mimeType === "application/pdf" || e.extension === "pdf";
8
+ },
9
+ name: "pdf",
10
+ render(a) {
11
+ if (a.signal?.aborted) return { destroy() {} };
12
+ let o = document.createElement("div");
13
+ o.className = "ofv-pdf-embed", a.viewport.append(o);
14
+ let s = null, c = null, l = n(!1), u = n(!1), d = (e) => {
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);
29
+ }
30
+ });
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
+ }
46
+ };
47
+ }
48
+ export { i as pdfPlugin };
@@ -38,6 +38,7 @@
38
38
  "cronstrue",
39
39
  "daterange",
40
40
  "dlzn",
41
+ "embedpdf",
41
42
  "Exclusify",
42
43
  "formkit",
43
44
  "iconify",