vft 0.0.514 → 0.0.515
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/es/components/image/image.vue2.js +25 -24
- package/es/components/image/index.d.ts +9 -0
- package/es/components/image/types.d.ts +2 -0
- package/es/components/image-viewer/image-viewer.vue.d.ts +1 -12
- package/es/components/image-viewer/types.d.ts +22 -0
- package/es/components/md-comment/md-comment.vue2.js +50 -28
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/image/image.vue2.cjs +1 -1
- package/lib/components/image/index.d.ts +9 -0
- package/lib/components/image/types.d.ts +2 -0
- package/lib/components/image-viewer/image-viewer.vue.d.ts +1 -12
- package/lib/components/image-viewer/types.d.ts +22 -0
- package/lib/components/md-comment/md-comment.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +3 -3
- package/web-types.json +1 -1
|
@@ -13,7 +13,7 @@ import "../../hooks/use-z-index/index.js";
|
|
|
13
13
|
const ue = ["src", "loading"], ce = { key: 0 }, de = T({
|
|
14
14
|
name: "vft-image",
|
|
15
15
|
inheritAttrs: !1
|
|
16
|
-
}),
|
|
16
|
+
}), xe = /* @__PURE__ */ T({
|
|
17
17
|
...de,
|
|
18
18
|
props: {
|
|
19
19
|
hideOnClickModal: { type: Boolean, default: !1 },
|
|
@@ -27,41 +27,42 @@ const ue = ["src", "loading"], ce = { key: 0 }, de = T({
|
|
|
27
27
|
zIndex: {},
|
|
28
28
|
initialIndex: { default: 0 },
|
|
29
29
|
infinite: { type: Boolean, default: !0 },
|
|
30
|
-
closeOnPressEscape: { type: Boolean, default: !0 }
|
|
30
|
+
closeOnPressEscape: { type: Boolean, default: !0 },
|
|
31
|
+
zoomRate: { default: 1.2 }
|
|
31
32
|
},
|
|
32
33
|
emits: ["load", "error", "switch", "close", "show"],
|
|
33
34
|
setup(e, { expose: $, emit: b }) {
|
|
34
35
|
const c = b, i = se("image");
|
|
35
36
|
let C = "";
|
|
36
37
|
const M = W(), O = te(), w = o(), r = o(!1), n = o(!0), h = o(!1), m = o(), a = o(), H = v && "loading" in HTMLImageElement.prototype;
|
|
37
|
-
let z,
|
|
38
|
+
let z, S;
|
|
38
39
|
const F = d(() => M.style), N = d(() => v && e.fit ? { objectFit: e.fit } : {}), g = d(() => Array.isArray(e.previewSrcList) && e.previewSrcList.length > 0), P = d(() => {
|
|
39
40
|
let t = e.initialIndex;
|
|
40
41
|
return e.initialIndex > e.previewSrcList.length - 1 && (t = 0), t;
|
|
41
|
-
}),
|
|
42
|
+
}), p = d(() => e.loading === "eager" ? !1 : !H && e.loading === "lazy" || e.lazy), L = () => {
|
|
42
43
|
v && (n.value = !0, r.value = !1, w.value = e.src);
|
|
43
44
|
};
|
|
44
45
|
function D(t) {
|
|
45
46
|
n.value = !1, r.value = !1, c("load", t);
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
+
function R(t) {
|
|
48
49
|
n.value = !1, r.value = !0, c("error", t);
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
+
function x() {
|
|
51
52
|
le(m.value, a.value) && (L(), B());
|
|
52
53
|
}
|
|
53
|
-
const
|
|
54
|
+
const I = oe(x, 200);
|
|
54
55
|
async function E() {
|
|
55
56
|
v && (await ee(), ne(e.scrollContainer) ? a.value = e.scrollContainer : ae(e.scrollContainer) && e.scrollContainer !== "" ? a.value = document.querySelector(e.scrollContainer) ?? void 0 : m.value && (a.value = ie(m.value)), a.value && (z = V(
|
|
56
57
|
a,
|
|
57
58
|
"scroll",
|
|
58
|
-
|
|
59
|
-
), setTimeout(() =>
|
|
59
|
+
I
|
|
60
|
+
), setTimeout(() => x(), 100)));
|
|
60
61
|
}
|
|
61
62
|
function B() {
|
|
62
|
-
!v || !a.value || !
|
|
63
|
+
!v || !a.value || !I || (z?.(), a.value = void 0);
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
+
function Y(t) {
|
|
65
66
|
if (t.ctrlKey) {
|
|
66
67
|
if (t.deltaY < 0)
|
|
67
68
|
return t.preventDefault(), !1;
|
|
@@ -69,24 +70,24 @@ const ue = ["src", "loading"], ce = { key: 0 }, de = T({
|
|
|
69
70
|
return t.preventDefault(), !1;
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
-
g.value && (
|
|
73
|
+
function j() {
|
|
74
|
+
g.value && (S = V("wheel", Y, {
|
|
74
75
|
passive: !1
|
|
75
76
|
}), C = document.body.style.overflow, document.body.style.overflow = "hidden", h.value = !0, c("show"));
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
78
|
+
function q() {
|
|
79
|
+
console.log(11122), S?.(), document.body.style.overflow = C, h.value = !1, c("close");
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function K(t) {
|
|
81
82
|
c("switch", t);
|
|
82
83
|
}
|
|
83
84
|
return G(
|
|
84
85
|
() => e.src,
|
|
85
86
|
() => {
|
|
86
|
-
|
|
87
|
+
p.value ? (n.value = !0, r.value = !1, B(), E()) : L();
|
|
87
88
|
}
|
|
88
89
|
), J(() => {
|
|
89
|
-
|
|
90
|
+
p.value ? E() : L();
|
|
90
91
|
}), $({
|
|
91
92
|
isLoading: n
|
|
92
93
|
}), (t, fe) => (s(), f("div", {
|
|
@@ -104,9 +105,9 @@ const ue = ["src", "loading"], ce = { key: 0 }, de = T({
|
|
|
104
105
|
g.value && l(i).e("preview"),
|
|
105
106
|
n.value && l(i).is("loading")
|
|
106
107
|
],
|
|
107
|
-
onClick:
|
|
108
|
+
onClick: j,
|
|
108
109
|
onLoad: D,
|
|
109
|
-
onError:
|
|
110
|
+
onError: R,
|
|
110
111
|
alt: ""
|
|
111
112
|
}), null, 16, ue)) : u("", !0),
|
|
112
113
|
n.value || r.value ? (s(), f("div", {
|
|
@@ -129,13 +130,13 @@ const ue = ["src", "loading"], ce = { key: 0 }, de = T({
|
|
|
129
130
|
"z-index": e.zIndex,
|
|
130
131
|
"initial-index": P.value,
|
|
131
132
|
infinite: e.infinite,
|
|
132
|
-
"zoom-rate":
|
|
133
|
+
"zoom-rate": e.zoomRate,
|
|
133
134
|
"url-list": e.previewSrcList,
|
|
134
135
|
"hide-on-click-modal": e.hideOnClickModal,
|
|
135
136
|
teleported: e.previewTeleported,
|
|
136
137
|
"close-on-press-escape": e.closeOnPressEscape,
|
|
137
|
-
onClose:
|
|
138
|
-
onSwitch:
|
|
138
|
+
onClose: q,
|
|
139
|
+
onSwitch: K
|
|
139
140
|
}, {
|
|
140
141
|
default: _(() => [
|
|
141
142
|
t.$slots.viewer ? (s(), f("div", ce, [
|
|
@@ -149,5 +150,5 @@ const ue = ["src", "loading"], ce = { key: 0 }, de = T({
|
|
|
149
150
|
}
|
|
150
151
|
});
|
|
151
152
|
export {
|
|
152
|
-
|
|
153
|
+
xe as default
|
|
153
154
|
};
|
|
@@ -36,6 +36,9 @@ export declare const VftImage: import("vft/es/utils").SFCWithInstall<{
|
|
|
36
36
|
closeOnPressEscape: {
|
|
37
37
|
type: import("vue").PropType<boolean>;
|
|
38
38
|
};
|
|
39
|
+
zoomRate: {
|
|
40
|
+
type: import("vue").PropType<number>;
|
|
41
|
+
};
|
|
39
42
|
}>> & Readonly<{
|
|
40
43
|
onSwitch?: ((...args: any[]) => any) | undefined;
|
|
41
44
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -94,6 +97,9 @@ export declare const VftImage: import("vft/es/utils").SFCWithInstall<{
|
|
|
94
97
|
closeOnPressEscape: {
|
|
95
98
|
type: import("vue").PropType<boolean>;
|
|
96
99
|
};
|
|
100
|
+
zoomRate: {
|
|
101
|
+
type: import("vue").PropType<number>;
|
|
102
|
+
};
|
|
97
103
|
}>> & Readonly<{
|
|
98
104
|
onSwitch?: ((...args: any[]) => any) | undefined;
|
|
99
105
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -143,6 +149,9 @@ export declare const VftImage: import("vft/es/utils").SFCWithInstall<{
|
|
|
143
149
|
closeOnPressEscape: {
|
|
144
150
|
type: import("vue").PropType<boolean>;
|
|
145
151
|
};
|
|
152
|
+
zoomRate: {
|
|
153
|
+
type: import("vue").PropType<number>;
|
|
154
|
+
};
|
|
146
155
|
}>> & Readonly<{
|
|
147
156
|
onSwitch?: ((...args: any[]) => any) | undefined;
|
|
148
157
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
urlList?: string[];
|
|
3
|
-
zIndex?: number;
|
|
4
|
-
initialIndex?: number;
|
|
5
|
-
infinite?: boolean;
|
|
6
|
-
hideOnClickModal?: boolean;
|
|
7
|
-
teleported?: boolean;
|
|
8
|
-
closeOnPressEscape?: boolean;
|
|
9
|
-
zoomRate?: number;
|
|
10
|
-
referrerpolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'same-origin' | 'origin' | 'strict-origin' | 'origin-when-cross-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
11
|
-
crossorigin?: 'anonymous' | 'use-credentials';
|
|
12
|
-
}
|
|
1
|
+
import type { ImageViewerProps } from './types';
|
|
13
2
|
declare function setActiveItem(index: number): void;
|
|
14
3
|
declare function __VLS_template(): {
|
|
15
4
|
default?(_: {}): any;
|
|
@@ -1 +1,23 @@
|
|
|
1
1
|
export type ImageViewerAction = 'zoomIn' | 'zoomOut' | 'clockwise' | 'anticlockwise';
|
|
2
|
+
export interface ImageViewerProps {
|
|
3
|
+
/** 图片地址列表 */
|
|
4
|
+
urlList?: string[];
|
|
5
|
+
/** 层级 */
|
|
6
|
+
zIndex?: number;
|
|
7
|
+
/** 初始预览的下标 */
|
|
8
|
+
initialIndex?: number;
|
|
9
|
+
/** 是否循环切换 */
|
|
10
|
+
infinite?: boolean;
|
|
11
|
+
/** 点击遮罩层是否关闭 */
|
|
12
|
+
hideOnClickModal?: boolean;
|
|
13
|
+
/** 是否将节点 teleport 到 body */
|
|
14
|
+
teleported?: boolean;
|
|
15
|
+
/** 是否支持 Esc 关闭 */
|
|
16
|
+
closeOnPressEscape?: boolean;
|
|
17
|
+
/** 缩放倍率(每次滚轮/按钮放大缩小的步长) */
|
|
18
|
+
zoomRate?: number;
|
|
19
|
+
/** referrer policy */
|
|
20
|
+
referrerpolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'same-origin' | 'origin' | 'strict-origin' | 'origin-when-cross-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
21
|
+
/** crossorigin */
|
|
22
|
+
crossorigin?: 'anonymous' | 'use-credentials';
|
|
23
|
+
}
|
|
@@ -1,41 +1,63 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as m, onMounted as r, nextTick as c, onBeforeUnmount as a, openBlock as l, createElementBlock as s, normalizeClass as p, unref as i, createElementVNode as u } from "vue";
|
|
2
2
|
import "@vueuse/core";
|
|
3
3
|
import "@vft/utils";
|
|
4
4
|
import "../config-provider/hooks/use-global-config.js";
|
|
5
5
|
import "lodash-es";
|
|
6
6
|
import "../form/index.js";
|
|
7
|
-
import { useNamespace as
|
|
7
|
+
import { useNamespace as d } from "../../hooks/use-namespace/index.js";
|
|
8
8
|
import "../../hooks/use-model-toggle/index.js";
|
|
9
9
|
import "@popperjs/core";
|
|
10
10
|
import "../../hooks/use-z-index/index.js";
|
|
11
|
-
import { init as
|
|
12
|
-
const
|
|
11
|
+
import { init as f } from "@waline/client";
|
|
12
|
+
const w = ["id"], _ = m({
|
|
13
13
|
name: "vft-md-comment"
|
|
14
|
-
}), C = /* @__PURE__ */
|
|
15
|
-
...
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
14
|
+
}), C = /* @__PURE__ */ m({
|
|
15
|
+
..._,
|
|
16
|
+
setup(j) {
|
|
17
|
+
const t = d("md-comment");
|
|
18
|
+
let e = null;
|
|
19
|
+
return r(async () => {
|
|
20
|
+
await c();
|
|
21
|
+
const n = `#${t.e("waline")}`, o = document.querySelector(n);
|
|
22
|
+
if (o) {
|
|
23
|
+
if (o.innerHTML && (o.innerHTML = ""), e) {
|
|
24
|
+
try {
|
|
25
|
+
e.destroy();
|
|
26
|
+
} catch {
|
|
27
|
+
}
|
|
28
|
+
e = null;
|
|
29
|
+
}
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
e = f({
|
|
32
|
+
el: n,
|
|
33
|
+
serverURL: "https://waline.wflynn.cn/",
|
|
34
|
+
pageview: !0,
|
|
35
|
+
reaction: !0,
|
|
36
|
+
emoji: [
|
|
37
|
+
"//unpkg.com/@waline/emojis@1.1.0/weibo",
|
|
38
|
+
"//unpkg.com/@waline/emojis@1.1.0/bilibili",
|
|
39
|
+
"//unpkg.com/@waline/emojis@1.1.0/bmoji",
|
|
40
|
+
"//unpkg.com/@waline/emojis@1.1.0/qq",
|
|
41
|
+
"//unpkg.com/@waline/emojis@1.1.0/tieba",
|
|
42
|
+
"//unpkg.com/@waline/emojis@1.1.0/tw-emoji"
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
}, 0);
|
|
46
|
+
}
|
|
47
|
+
}), a(() => {
|
|
48
|
+
if (e) {
|
|
49
|
+
try {
|
|
50
|
+
e.destroy();
|
|
51
|
+
} catch {
|
|
52
|
+
}
|
|
53
|
+
e = null;
|
|
54
|
+
}
|
|
55
|
+
}), (n, o) => (l(), s("div", {
|
|
56
|
+
class: p(i(t).b())
|
|
35
57
|
}, [
|
|
36
|
-
|
|
37
|
-
id:
|
|
38
|
-
}, null, 8,
|
|
58
|
+
u("div", {
|
|
59
|
+
id: i(t).e("waline")
|
|
60
|
+
}, null, 8, w)
|
|
39
61
|
], 2));
|
|
40
62
|
}
|
|
41
63
|
});
|
package/es/package.json.d.ts
CHANGED
package/es/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),$=require("@vft/use"),c=require("@vft/utils"),H=require("../image-viewer/index.cjs"),o=require("@vueuse/core");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");const P=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const F=["src","loading"],j={key:0},D=e.defineComponent({name:"vft-image",inheritAttrs:!1}),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),$=require("@vft/use"),c=require("@vft/utils"),H=require("../image-viewer/index.cjs"),o=require("@vueuse/core");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");const P=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const F=["src","loading"],j={key:0},D=e.defineComponent({name:"vft-image",inheritAttrs:!1}),R=e.defineComponent({...D,props:{hideOnClickModal:{type:Boolean,default:!1},src:{default:""},fit:{default:""},loading:{},lazy:{type:Boolean},scrollContainer:{},previewSrcList:{default:()=>[]},previewTeleported:{type:Boolean,default:!1},zIndex:{},initialIndex:{default:0},infinite:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},zoomRate:{default:1.2}},emits:["load","error","switch","close","show"],setup(t,{expose:S,emit:B}){const s=B,a=P.useNamespace("image");let y="";const E=e.useAttrs(),q=$.useAttrs(),d=e.ref(),i=e.ref(!1),n=e.ref(!0),f=e.ref(!1),u=e.ref(),r=e.ref(),V=o.isClient&&"loading"in HTMLImageElement.prototype;let w,C;const x=e.computed(()=>E.style),p=e.computed(()=>o.isClient&&t.fit?{objectFit:t.fit}:{}),v=e.computed(()=>Array.isArray(t.previewSrcList)&&t.previewSrcList.length>0),I=e.computed(()=>{let l=t.initialIndex;return t.initialIndex>t.previewSrcList.length-1&&(l=0),l}),h=e.computed(()=>t.loading==="eager"?!1:!V&&t.loading==="lazy"||t.lazy),m=()=>{o.isClient&&(n.value=!0,i.value=!1,d.value=t.src)};function N(l){n.value=!1,i.value=!1,s("load",l)}function b(l){n.value=!1,i.value=!0,s("error",l)}function g(){c.isInContainer(u.value,r.value)&&(m(),z())}const k=o.useThrottleFn(g,200);async function L(){o.isClient&&(await e.nextTick(),c.isElement(t.scrollContainer)?r.value=t.scrollContainer:c.isString(t.scrollContainer)&&t.scrollContainer!==""?r.value=document.querySelector(t.scrollContainer)??void 0:u.value&&(r.value=c.getScrollContainer(u.value)),r.value&&(w=o.useEventListener(r,"scroll",k),setTimeout(()=>g(),100)))}function z(){!o.isClient||!r.value||!k||(w?.(),r.value=void 0)}function M(l){if(l.ctrlKey){if(l.deltaY<0)return l.preventDefault(),!1;if(l.deltaY>0)return l.preventDefault(),!1}}function T(){v.value&&(C=o.useEventListener("wheel",M,{passive:!1}),y=document.body.style.overflow,document.body.style.overflow="hidden",f.value=!0,s("show"))}function A(){console.log(11122),C?.(),document.body.style.overflow=y,f.value=!1,s("close")}function O(l){s("switch",l)}return e.watch(()=>t.src,()=>{h.value?(n.value=!0,i.value=!1,z(),L()):m()}),e.onMounted(()=>{h.value?L():m()}),S({isLoading:n}),(l,Y)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"container",ref:u,class:e.normalizeClass([e.unref(a).b(),l.$attrs.class]),style:e.normalizeStyle(x.value)},[d.value!==void 0&&!i.value?(e.openBlock(),e.createElementBlock("img",e.mergeProps({key:0},e.unref(q),{src:d.value,loading:t.loading,style:p.value,class:[e.unref(a).e("inner"),v.value&&e.unref(a).e("preview"),n.value&&e.unref(a).is("loading")],onClick:T,onLoad:N,onError:b,alt:""}),null,16,F)):e.createCommentVNode("",!0),n.value||i.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(a).e("wrapper"))},[n.value?e.renderSlot(l.$slots,"placeholder",{key:0},()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("placeholder"))},null,2)]):i.value?e.renderSlot(l.$slots,"error",{key:1},()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("error"))},"加载失败",2)]):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[f.value?(e.openBlock(),e.createBlock(e.unref(H.VftImageViewer),{key:0,"z-index":t.zIndex,"initial-index":I.value,infinite:t.infinite,"zoom-rate":t.zoomRate,"url-list":t.previewSrcList,"hide-on-click-modal":t.hideOnClickModal,teleported:t.previewTeleported,"close-on-press-escape":t.closeOnPressEscape,onClose:A,onSwitch:O},{default:e.withCtx(()=>[l.$slots.viewer?(e.openBlock(),e.createElementBlock("div",j,[e.renderSlot(l.$slots,"viewer")])):e.createCommentVNode("",!0)]),_:3},8,["z-index","initial-index","infinite","zoom-rate","url-list","hide-on-click-modal","teleported","close-on-press-escape"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],6))}});exports.default=R;
|
|
@@ -36,6 +36,9 @@ export declare const VftImage: import("vft/es/utils").SFCWithInstall<{
|
|
|
36
36
|
closeOnPressEscape: {
|
|
37
37
|
type: import("vue").PropType<boolean>;
|
|
38
38
|
};
|
|
39
|
+
zoomRate: {
|
|
40
|
+
type: import("vue").PropType<number>;
|
|
41
|
+
};
|
|
39
42
|
}>> & Readonly<{
|
|
40
43
|
onSwitch?: ((...args: any[]) => any) | undefined;
|
|
41
44
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -94,6 +97,9 @@ export declare const VftImage: import("vft/es/utils").SFCWithInstall<{
|
|
|
94
97
|
closeOnPressEscape: {
|
|
95
98
|
type: import("vue").PropType<boolean>;
|
|
96
99
|
};
|
|
100
|
+
zoomRate: {
|
|
101
|
+
type: import("vue").PropType<number>;
|
|
102
|
+
};
|
|
97
103
|
}>> & Readonly<{
|
|
98
104
|
onSwitch?: ((...args: any[]) => any) | undefined;
|
|
99
105
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -143,6 +149,9 @@ export declare const VftImage: import("vft/es/utils").SFCWithInstall<{
|
|
|
143
149
|
closeOnPressEscape: {
|
|
144
150
|
type: import("vue").PropType<boolean>;
|
|
145
151
|
};
|
|
152
|
+
zoomRate: {
|
|
153
|
+
type: import("vue").PropType<number>;
|
|
154
|
+
};
|
|
146
155
|
}>> & Readonly<{
|
|
147
156
|
onSwitch?: ((...args: any[]) => any) | undefined;
|
|
148
157
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
urlList?: string[];
|
|
3
|
-
zIndex?: number;
|
|
4
|
-
initialIndex?: number;
|
|
5
|
-
infinite?: boolean;
|
|
6
|
-
hideOnClickModal?: boolean;
|
|
7
|
-
teleported?: boolean;
|
|
8
|
-
closeOnPressEscape?: boolean;
|
|
9
|
-
zoomRate?: number;
|
|
10
|
-
referrerpolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'same-origin' | 'origin' | 'strict-origin' | 'origin-when-cross-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
11
|
-
crossorigin?: 'anonymous' | 'use-credentials';
|
|
12
|
-
}
|
|
1
|
+
import type { ImageViewerProps } from './types';
|
|
13
2
|
declare function setActiveItem(index: number): void;
|
|
14
3
|
declare function __VLS_template(): {
|
|
15
4
|
default?(_: {}): any;
|
|
@@ -1 +1,23 @@
|
|
|
1
1
|
export type ImageViewerAction = 'zoomIn' | 'zoomOut' | 'clockwise' | 'anticlockwise';
|
|
2
|
+
export interface ImageViewerProps {
|
|
3
|
+
/** 图片地址列表 */
|
|
4
|
+
urlList?: string[];
|
|
5
|
+
/** 层级 */
|
|
6
|
+
zIndex?: number;
|
|
7
|
+
/** 初始预览的下标 */
|
|
8
|
+
initialIndex?: number;
|
|
9
|
+
/** 是否循环切换 */
|
|
10
|
+
infinite?: boolean;
|
|
11
|
+
/** 点击遮罩层是否关闭 */
|
|
12
|
+
hideOnClickModal?: boolean;
|
|
13
|
+
/** 是否将节点 teleport 到 body */
|
|
14
|
+
teleported?: boolean;
|
|
15
|
+
/** 是否支持 Esc 关闭 */
|
|
16
|
+
closeOnPressEscape?: boolean;
|
|
17
|
+
/** 缩放倍率(每次滚轮/按钮放大缩小的步长) */
|
|
18
|
+
zoomRate?: number;
|
|
19
|
+
/** referrer policy */
|
|
20
|
+
referrerpolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'same-origin' | 'origin' | 'strict-origin' | 'origin-when-cross-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
21
|
+
/** crossorigin */
|
|
22
|
+
crossorigin?: 'anonymous' | 'use-credentials';
|
|
23
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");const r=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const u=require("@waline/client"),c=["id"],l=e.defineComponent({name:"vft-md-comment"}),s=e.defineComponent({...l,setup(a){const o=r.useNamespace("md-comment");let n=null;return e.onMounted(async()=>{await e.nextTick();const i=`#${o.e("waline")}`,t=document.querySelector(i);if(t){if(t.innerHTML&&(t.innerHTML=""),n){try{n.destroy()}catch{}n=null}setTimeout(()=>{n=u.init({el:i,serverURL:"https://waline.wflynn.cn/",pageview:!0,reaction:!0,emoji:["//unpkg.com/@waline/emojis@1.1.0/weibo","//unpkg.com/@waline/emojis@1.1.0/bilibili","//unpkg.com/@waline/emojis@1.1.0/bmoji","//unpkg.com/@waline/emojis@1.1.0/qq","//unpkg.com/@waline/emojis@1.1.0/tieba","//unpkg.com/@waline/emojis@1.1.0/tw-emoji"]})},0)}}),e.onBeforeUnmount(()=>{if(n){try{n.destroy()}catch{}n=null}}),(i,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(o).b())},[e.createElementVNode("div",{id:e.unref(o).e("waline")},null,8,c)],2))}});exports.default=s;
|
package/lib/package.json.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.515";exports.version=e;
|
package/lib/package.json.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.515",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"resize-detector": "0.3.0",
|
|
57
57
|
"sortablejs": "1.15.0",
|
|
58
58
|
"photoswipe": "5.4.4",
|
|
59
|
-
"@vft/router": "0.0.73",
|
|
60
59
|
"@vft/constants": "0.0.83",
|
|
60
|
+
"@vft/use": "0.0.96",
|
|
61
61
|
"@vft/store": "0.0.78",
|
|
62
|
+
"@vft/router": "0.0.73",
|
|
62
63
|
"@vft/utils": "0.0.161",
|
|
63
|
-
"@vft/use": "0.0.96",
|
|
64
64
|
"@vft/directives": "0.0.36"
|
|
65
65
|
},
|
|
66
66
|
"vetur": {
|