Comparing version 4.7.1 to 4.7.2
@@ -38,2 +38,6 @@ import { type PropType, type CSSProperties, type ExtractPropTypes } from 'vue'; | ||
beforeClose: PropType<Interceptor>; | ||
doubleScale: { | ||
type: BooleanConstructor; | ||
default: true; | ||
}; | ||
overlayClass: PropType<unknown>; | ||
@@ -99,2 +103,6 @@ overlayStyle: PropType<CSSProperties>; | ||
beforeClose: PropType<Interceptor>; | ||
doubleScale: { | ||
type: BooleanConstructor; | ||
default: true; | ||
}; | ||
overlayClass: PropType<unknown>; | ||
@@ -158,2 +166,6 @@ overlayStyle: PropType<CSSProperties>; | ||
beforeClose: PropType<Interceptor>; | ||
doubleScale: { | ||
type: BooleanConstructor; | ||
default: true; | ||
}; | ||
overlayClass: PropType<unknown>; | ||
@@ -204,2 +216,3 @@ overlayStyle: PropType<CSSProperties>; | ||
maxZoom: string | number; | ||
doubleScale: boolean; | ||
images: string[]; | ||
@@ -206,0 +219,0 @@ showIndex: boolean; |
@@ -22,2 +22,3 @@ declare const _default: import("vue").DefineComponent<{ | ||
disableZoom: BooleanConstructor; | ||
doubleScale: BooleanConstructor; | ||
closeOnClickOverlay: BooleanConstructor; | ||
@@ -45,2 +46,3 @@ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "scale" | "longPress")[], "close" | "scale" | "longPress", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ | ||
disableZoom: BooleanConstructor; | ||
doubleScale: BooleanConstructor; | ||
closeOnClickOverlay: BooleanConstructor; | ||
@@ -55,3 +57,4 @@ }>> & { | ||
disableZoom: boolean; | ||
doubleScale: boolean; | ||
}, {}>; | ||
export default _default; |
@@ -36,2 +36,6 @@ import type { ImagePreviewProps } from './ImagePreview'; | ||
beforeClose: import("vue").PropType<import("../utils").Interceptor>; | ||
doubleScale: { | ||
type: BooleanConstructor; | ||
default: true; | ||
}; | ||
overlayClass: import("vue").PropType<unknown>; | ||
@@ -95,2 +99,6 @@ overlayStyle: import("vue").PropType<import("vue").CSSProperties>; | ||
beforeClose: import("vue").PropType<import("../utils").Interceptor>; | ||
doubleScale: { | ||
type: BooleanConstructor; | ||
default: true; | ||
}; | ||
overlayClass: import("vue").PropType<unknown>; | ||
@@ -141,2 +149,3 @@ overlayStyle: import("vue").PropType<import("vue").CSSProperties>; | ||
maxZoom: string | number; | ||
doubleScale: boolean; | ||
images: string[]; | ||
@@ -143,0 +152,0 @@ showIndex: boolean; |
@@ -18,2 +18,3 @@ import type { CSSProperties, TeleportProps, ComponentPublicInstance } from 'vue'; | ||
beforeClose?: Interceptor; | ||
doubleScale?: boolean; | ||
overlayStyle?: CSSProperties; | ||
@@ -20,0 +21,0 @@ overlayClass?: unknown; |
@@ -108,2 +108,2 @@ export * from "./action-bar"; | ||
export function install(app: any): void; | ||
export const version: "4.7.1"; | ||
export const version: "4.7.2"; |
@@ -53,2 +53,3 @@ var __create = Object.create; | ||
beforeClose: void 0, | ||
doubleScale: true, | ||
overlayStyle: void 0, | ||
@@ -55,0 +56,0 @@ overlayClass: void 0, |
@@ -38,2 +38,6 @@ import { type PropType, type CSSProperties, type ExtractPropTypes } from 'vue'; | ||
beforeClose: PropType<Interceptor>; | ||
doubleScale: { | ||
type: BooleanConstructor; | ||
default: true; | ||
}; | ||
overlayClass: PropType<unknown>; | ||
@@ -99,2 +103,6 @@ overlayStyle: PropType<CSSProperties>; | ||
beforeClose: PropType<Interceptor>; | ||
doubleScale: { | ||
type: BooleanConstructor; | ||
default: true; | ||
}; | ||
overlayClass: PropType<unknown>; | ||
@@ -158,2 +166,6 @@ overlayStyle: PropType<CSSProperties>; | ||
beforeClose: PropType<Interceptor>; | ||
doubleScale: { | ||
type: BooleanConstructor; | ||
default: true; | ||
}; | ||
overlayClass: PropType<unknown>; | ||
@@ -204,2 +216,3 @@ overlayStyle: PropType<CSSProperties>; | ||
maxZoom: string | number; | ||
doubleScale: boolean; | ||
images: string[]; | ||
@@ -206,0 +219,0 @@ showIndex: boolean; |
@@ -58,2 +58,3 @@ var __create = Object.create; | ||
beforeClose: Function, | ||
doubleScale: import_utils.truthProp, | ||
overlayClass: import_utils.unknownProp, | ||
@@ -150,2 +151,3 @@ overlayStyle: Object, | ||
"disableZoom": state.disableZoom, | ||
"doubleScale": props.doubleScale, | ||
"closeOnClickOverlay": props.closeOnClickOverlay, | ||
@@ -152,0 +154,0 @@ "onScale": emitScale, |
@@ -22,2 +22,3 @@ declare const _default: import("vue").DefineComponent<{ | ||
disableZoom: BooleanConstructor; | ||
doubleScale: BooleanConstructor; | ||
closeOnClickOverlay: BooleanConstructor; | ||
@@ -45,2 +46,3 @@ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "scale" | "longPress")[], "close" | "scale" | "longPress", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ | ||
disableZoom: BooleanConstructor; | ||
doubleScale: BooleanConstructor; | ||
closeOnClickOverlay: BooleanConstructor; | ||
@@ -55,3 +57,4 @@ }>> & { | ||
disableZoom: boolean; | ||
doubleScale: boolean; | ||
}, {}>; | ||
export default _default; |
@@ -48,2 +48,3 @@ var __defProp = Object.defineProperty; | ||
disableZoom: Boolean, | ||
doubleScale: Boolean, | ||
closeOnClickOverlay: Boolean | ||
@@ -222,14 +223,18 @@ }, | ||
if (deltaTime < TAP_TIME) { | ||
if (doubleTapTimer) { | ||
clearTimeout(doubleTapTimer); | ||
doubleTapTimer = null; | ||
toggleScale(); | ||
if (props.doubleScale) { | ||
if (doubleTapTimer) { | ||
clearTimeout(doubleTapTimer); | ||
doubleTapTimer = null; | ||
toggleScale(); | ||
} else { | ||
if (!props.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) { | ||
return; | ||
} | ||
doubleTapTimer = setTimeout(() => { | ||
emit("close"); | ||
doubleTapTimer = null; | ||
}, TAP_TIME); | ||
} | ||
} else { | ||
if (!props.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) { | ||
return; | ||
} | ||
doubleTapTimer = setTimeout(() => { | ||
emit("close"); | ||
doubleTapTimer = null; | ||
}, TAP_TIME); | ||
emit("close"); | ||
} | ||
@@ -236,0 +241,0 @@ } else if (deltaTime > import_utils.LONG_PRESS_START_TIME) { |
@@ -36,2 +36,6 @@ import type { ImagePreviewProps } from './ImagePreview'; | ||
beforeClose: import("vue").PropType<import("../utils").Interceptor>; | ||
doubleScale: { | ||
type: BooleanConstructor; | ||
default: true; | ||
}; | ||
overlayClass: import("vue").PropType<unknown>; | ||
@@ -95,2 +99,6 @@ overlayStyle: import("vue").PropType<import("vue").CSSProperties>; | ||
beforeClose: import("vue").PropType<import("../utils").Interceptor>; | ||
doubleScale: { | ||
type: BooleanConstructor; | ||
default: true; | ||
}; | ||
overlayClass: import("vue").PropType<unknown>; | ||
@@ -141,2 +149,3 @@ overlayStyle: import("vue").PropType<import("vue").CSSProperties>; | ||
maxZoom: string | number; | ||
doubleScale: boolean; | ||
images: string[]; | ||
@@ -143,0 +152,0 @@ showIndex: boolean; |
@@ -18,2 +18,3 @@ import type { CSSProperties, TeleportProps, ComponentPublicInstance } from 'vue'; | ||
beforeClose?: Interceptor; | ||
doubleScale?: boolean; | ||
overlayStyle?: CSSProperties; | ||
@@ -20,0 +21,0 @@ overlayClass?: unknown; |
@@ -108,2 +108,2 @@ export * from "./action-bar"; | ||
export function install(app: any): void; | ||
export const version: "4.7.1"; | ||
export const version: "4.7.2"; |
@@ -227,3 +227,3 @@ var __defProp = Object.defineProperty; | ||
__reExport(stdin_exports, require("./watermark"), module.exports); | ||
const version = "4.7.1"; | ||
const version = "4.7.2"; | ||
function install(app) { | ||
@@ -230,0 +230,0 @@ const components = [ |
@@ -53,17 +53,18 @@ var __defProp = Object.defineProperty; | ||
const wrapRef = (0, import_vue2.ref)(); | ||
const state = (0, import_vue2.reactive)({ | ||
width: 0, | ||
height: 0, | ||
ctx: null, | ||
ratio: import_utils.inBrowser ? window.devicePixelRatio : 1 | ||
const ctx = (0, import_vue2.computed)(() => { | ||
if (!canvasRef.value) | ||
return null; | ||
return canvasRef.value.getContext("2d"); | ||
}); | ||
const isRenderCanvas = import_utils.inBrowser ? hasCanvasSupport() : true; | ||
let canvasWidth = 0; | ||
let canvasHeight = 0; | ||
let canvasRect; | ||
const isRenderCanvas = import_utils.inBrowser ? hasCanvasSupport() : true; | ||
const touchStart = () => { | ||
if (!state.ctx) { | ||
if (!ctx.value) { | ||
return false; | ||
} | ||
state.ctx.beginPath(); | ||
state.ctx.lineWidth = props.lineWidth * state.ratio; | ||
state.ctx.strokeStyle = props.penColor; | ||
ctx.value.beginPath(); | ||
ctx.value.lineWidth = props.lineWidth; | ||
ctx.value.strokeStyle = props.penColor; | ||
canvasRect = (0, import_use.useRect)(canvasRef); | ||
@@ -73,4 +74,3 @@ emit("start"); | ||
const touchMove = (event) => { | ||
var _a, _b; | ||
if (!state.ctx) { | ||
if (!ctx.value) { | ||
return false; | ||
@@ -80,8 +80,8 @@ } | ||
const touch = event.touches[0]; | ||
const mouseX = (touch.clientX - ((canvasRect == null ? void 0 : canvasRect.left) || 0)) * state.ratio; | ||
const mouseY = (touch.clientY - ((canvasRect == null ? void 0 : canvasRect.top) || 0)) * state.ratio; | ||
state.ctx.lineCap = "round"; | ||
state.ctx.lineJoin = "round"; | ||
(_a = state.ctx) == null ? void 0 : _a.lineTo(mouseX, mouseY); | ||
(_b = state.ctx) == null ? void 0 : _b.stroke(); | ||
const mouseX = touch.clientX - ((canvasRect == null ? void 0 : canvasRect.left) || 0); | ||
const mouseY = touch.clientY - ((canvasRect == null ? void 0 : canvasRect.top) || 0); | ||
ctx.value.lineCap = "round"; | ||
ctx.value.lineJoin = "round"; | ||
ctx.value.lineTo(mouseX, mouseY); | ||
ctx.value.stroke(); | ||
emit("signing", event); | ||
@@ -103,6 +103,6 @@ }; | ||
}; | ||
const setCanvasBgColor = (ctx) => { | ||
if (ctx && props.backgroundColor) { | ||
ctx.fillStyle = props.backgroundColor; | ||
ctx.fillRect(0, 0, state.width, state.height); | ||
const setCanvasBgColor = (ctx2) => { | ||
if (ctx2 && props.backgroundColor) { | ||
ctx2.fillStyle = props.backgroundColor; | ||
ctx2.fillRect(0, 0, canvasWidth, canvasHeight); | ||
} | ||
@@ -127,6 +127,6 @@ }; | ||
const clear = () => { | ||
if (state.ctx) { | ||
state.ctx.clearRect(0, 0, state.width, state.height); | ||
state.ctx.closePath(); | ||
setCanvasBgColor(state.ctx); | ||
if (ctx.value) { | ||
ctx.value.clearRect(0, 0, canvasWidth, canvasHeight); | ||
ctx.value.closePath(); | ||
setCanvasBgColor(ctx.value); | ||
} | ||
@@ -137,9 +137,9 @@ emit("clear"); | ||
var _a, _b, _c; | ||
if (isRenderCanvas) { | ||
state.ctx = (_a = canvasRef.value) == null ? void 0 : _a.getContext("2d"); | ||
state.width = (((_b = wrapRef.value) == null ? void 0 : _b.offsetWidth) || 0) * state.ratio; | ||
state.height = (((_c = wrapRef.value) == null ? void 0 : _c.offsetHeight) || 0) * state.ratio; | ||
(0, import_vue2.nextTick)(() => { | ||
setCanvasBgColor(state.ctx); | ||
}); | ||
if (isRenderCanvas && canvasRef.value) { | ||
const canvas = canvasRef.value; | ||
const dpr = import_utils.inBrowser ? window.devicePixelRatio : 1; | ||
canvasWidth = canvas.width = (((_a = wrapRef.value) == null ? void 0 : _a.offsetWidth) || 0) * dpr; | ||
canvasHeight = canvas.height = (((_b = wrapRef.value) == null ? void 0 : _b.offsetHeight) || 0) * dpr; | ||
(_c = ctx.value) == null ? void 0 : _c.scale(dpr, dpr); | ||
setCanvasBgColor(ctx.value); | ||
} | ||
@@ -154,4 +154,2 @@ }); | ||
"ref": canvasRef, | ||
"width": state.width, | ||
"height": state.height, | ||
"onTouchstartPassive": touchStart, | ||
@@ -158,0 +156,0 @@ "onTouchmove": touchMove, |
@@ -83,2 +83,3 @@ var __create = Object.create; | ||
const reuploadIndex = (0, import_vue2.ref)(-1); | ||
const isReuploading = (0, import_vue2.ref)(false); | ||
const getDetail = (index = props.modelValue.length) => ({ | ||
@@ -220,5 +221,12 @@ name: props.name, | ||
const reuploadImage = (index) => { | ||
chooseFile(); | ||
isReuploading.value = true; | ||
reuploadIndex.value = index; | ||
(0, import_vue2.nextTick)(() => chooseFile()); | ||
}; | ||
const onInputClick = () => { | ||
if (!isReuploading.value) { | ||
reuploadIndex.value = -1; | ||
} | ||
isReuploading.value = false; | ||
}; | ||
const renderPreviewItem = (item, index) => { | ||
@@ -255,3 +263,4 @@ const needPickData = ["imageFit", "deletable", "reupload", "previewSize", "beforeDelete"]; | ||
"disabled": props.disabled, | ||
"onChange": onChange | ||
"onChange": onChange, | ||
"onClick": onInputClick | ||
}, null); | ||
@@ -258,0 +267,0 @@ if (slots.default) { |
{ | ||
"name": "vant", | ||
"version": "4.7.1", | ||
"version": "4.7.2", | ||
"description": "Mobile UI Components built on Vue", | ||
@@ -58,6 +58,6 @@ "main": "lib/vant.cjs.js", | ||
"vue-router": "^4.1.6", | ||
"@vant/area-data": "1.5.0", | ||
"@vant/cli": "6.2.0", | ||
"@vant/eslint-config": "4.0.0", | ||
"@vant/cli": "6.2.0", | ||
"@vant/area-data": "1.5.0", | ||
"@vant/icons": "3.0.0" | ||
"@vant/icons": "3.0.2" | ||
}, | ||
@@ -64,0 +64,0 @@ "sideEffects": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5769469
150094