vant 3.6.3 → 3.6.5
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/image-preview/ImagePreview.mjs +3 -1
- package/es/image-preview/ImagePreviewItem.mjs +7 -2
- package/es/image-preview/index.css +1 -1
- package/es/image-preview/index.less +4 -2
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/lazyload/vue-lazyload/lazy-image.mjs +5 -5
- package/es/tabs/Tabs.mjs +44 -41
- package/lib/image-preview/ImagePreview.js +3 -1
- package/lib/image-preview/ImagePreviewItem.js +7 -2
- package/lib/image-preview/index.css +1 -1
- package/lib/image-preview/index.less +4 -2
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/lazyload/vue-lazyload/lazy-image.js +6 -6
- package/lib/tabs/Tabs.js +44 -41
- package/lib/vant.cjs.js +60 -51
- package/lib/vant.es.js +60 -51
- package/lib/vant.js +60 -51
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1948 -1944
- package/package.json +1 -1
- package/changelog.generated.md +0 -54
@@ -20,7 +20,8 @@ var stdin_default = defineComponent({
|
|
20
20
|
},
|
21
21
|
emits: ["scale", "close"],
|
22
22
|
setup(props, {
|
23
|
-
emit
|
23
|
+
emit,
|
24
|
+
slots
|
24
25
|
}) {
|
25
26
|
const state = reactive({
|
26
27
|
scale: 1,
|
@@ -238,7 +239,11 @@ var stdin_default = defineComponent({
|
|
238
239
|
"onTouchend": onTouchEnd,
|
239
240
|
"onTouchcancel": onTouchEnd
|
240
241
|
}, {
|
241
|
-
default: () => [_createVNode(
|
242
|
+
default: () => [slots.image ? _createVNode("div", {
|
243
|
+
"class": bem("image-wrap")
|
244
|
+
}, [slots.image({
|
245
|
+
src: props.src
|
246
|
+
})]) : _createVNode(Image, {
|
242
247
|
"src": props.src,
|
243
248
|
"fit": "contain",
|
244
249
|
"class": bem("image", {
|
@@ -1 +1 @@
|
|
1
|
-
:root{--van-image-preview-index-text-color: var(--van-white);--van-image-preview-index-font-size: var(--van-font-size-md);--van-image-preview-index-line-height: var(--van-line-height-md);--van-image-preview-index-text-shadow: 0 1px 1px var(--van-gray-8);--van-image-preview-overlay-background-color: rgba(0, 0, 0, .9);--van-image-preview-close-icon-size: 22px;--van-image-preview-close-icon-color: var(--van-gray-5);--van-image-preview-close-icon-margin: var(--van-padding-md);--van-image-preview-close-icon-z-index: 1}.van-image-preview{position:fixed;top:0;left:0;width:100%;height:100%;background-color:transparent;transform:none}.van-image-preview__swipe{height:100%}.van-image-preview__swipe-item{display:flex;align-items:center;justify-content:center;overflow:hidden}.van-image-preview__cover{position:absolute;top:0;left:0}.van-image-preview__image{width:100%;transition-property:transform}.van-image-preview__image--vertical{width:auto;height:100%}.van-image-preview__image img{-webkit-user-drag:none}.van-image-preview__image .van-image__error{top:30%;height:40%}.van-image-preview__image .van-image__error-icon{font-size:36px}.van-image-preview__image .van-image__loading{background-color:transparent}.van-image-preview__index{position:absolute;top:var(--van-padding-md);left:50%;color:var(--van-image-preview-index-text-color);font-size:var(--van-image-preview-index-font-size);line-height:var(--van-image-preview-index-line-height);text-shadow:var(--van-image-preview-index-text-shadow);transform:translate(-50%)}.van-image-preview__overlay{background:var(--van-image-preview-overlay-background-color)}.van-image-preview__close-icon{position:absolute;z-index:var(--van-image-preview-close-icon-z-index);color:var(--van-image-preview-close-icon-color);font-size:var(--van-image-preview-close-icon-size)}.van-image-preview__close-icon--top-left{top:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--top-right{top:var(--van-image-preview-close-icon-margin);right:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-left{bottom:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-right{right:var(--van-image-preview-close-icon-margin);bottom:var(--van-image-preview-close-icon-margin)}
|
1
|
+
:root{--van-image-preview-index-text-color: var(--van-white);--van-image-preview-index-font-size: var(--van-font-size-md);--van-image-preview-index-line-height: var(--van-line-height-md);--van-image-preview-index-text-shadow: 0 1px 1px var(--van-gray-8);--van-image-preview-overlay-background-color: rgba(0, 0, 0, .9);--van-image-preview-close-icon-size: 22px;--van-image-preview-close-icon-color: var(--van-gray-5);--van-image-preview-close-icon-margin: var(--van-padding-md);--van-image-preview-close-icon-z-index: 1}.van-image-preview{position:fixed;top:0;left:0;width:100%;height:100%;background-color:transparent;transform:none}.van-image-preview__swipe{height:100%}.van-image-preview__swipe-item{display:flex;align-items:center;justify-content:center;overflow:hidden}.van-image-preview__cover{position:absolute;top:0;left:0}.van-image-preview__image,.van-image-preview__image-wrap{width:100%;transition-property:transform}.van-image-preview__image--vertical,.van-image-preview__image-wrap--vertical{width:auto;height:100%}.van-image-preview__image img,.van-image-preview__image-wrap img,.van-image-preview__image video,.van-image-preview__image-wrap video{-webkit-user-drag:none}.van-image-preview__image .van-image__error,.van-image-preview__image-wrap .van-image__error{top:30%;height:40%}.van-image-preview__image .van-image__error-icon,.van-image-preview__image-wrap .van-image__error-icon{font-size:36px}.van-image-preview__image .van-image__loading,.van-image-preview__image-wrap .van-image__loading{background-color:transparent}.van-image-preview__index{position:absolute;top:var(--van-padding-md);left:50%;color:var(--van-image-preview-index-text-color);font-size:var(--van-image-preview-index-font-size);line-height:var(--van-image-preview-index-line-height);text-shadow:var(--van-image-preview-index-text-shadow);transform:translate(-50%)}.van-image-preview__overlay{background:var(--van-image-preview-overlay-background-color)}.van-image-preview__close-icon{position:absolute;z-index:var(--van-image-preview-close-icon-z-index);color:var(--van-image-preview-close-icon-color);font-size:var(--van-image-preview-close-icon-size)}.van-image-preview__close-icon--top-left{top:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--top-right{top:var(--van-image-preview-close-icon-margin);right:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-left{bottom:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-right{right:var(--van-image-preview-close-icon-margin);bottom:var(--van-image-preview-close-icon-margin)}
|
@@ -38,7 +38,8 @@
|
|
38
38
|
left: 0;
|
39
39
|
}
|
40
40
|
|
41
|
-
&__image
|
41
|
+
&__image,
|
42
|
+
&__image-wrap {
|
42
43
|
width: 100%;
|
43
44
|
transition-property: transform;
|
44
45
|
|
@@ -47,7 +48,8 @@
|
|
47
48
|
height: 100%;
|
48
49
|
}
|
49
50
|
|
50
|
-
img
|
51
|
+
img,
|
52
|
+
video {
|
51
53
|
// disable desktop browser image drag
|
52
54
|
-webkit-user-drag: none;
|
53
55
|
}
|
package/es/index.d.ts
CHANGED
package/es/index.mjs
CHANGED
@@ -84,7 +84,7 @@ import { Tag } from "./tag/index.mjs";
|
|
84
84
|
import { Toast } from "./toast/index.mjs";
|
85
85
|
import { TreeSelect } from "./tree-select/index.mjs";
|
86
86
|
import { Uploader } from "./uploader/index.mjs";
|
87
|
-
const version = "3.6.
|
87
|
+
const version = "3.6.5";
|
88
88
|
function install(app) {
|
89
89
|
const components = [
|
90
90
|
ActionBar,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { useRect } from "@vant/use";
|
2
2
|
import { loadImageAsync } from "./util.mjs";
|
3
3
|
import { noop } from "../../utils/index.mjs";
|
4
|
+
import { h } from "vue";
|
4
5
|
var stdin_default = (lazyManager) => ({
|
5
6
|
props: {
|
6
7
|
src: [String, Object],
|
@@ -9,15 +10,14 @@ var stdin_default = (lazyManager) => ({
|
|
9
10
|
default: "img"
|
10
11
|
}
|
11
12
|
},
|
12
|
-
render(
|
13
|
+
render() {
|
14
|
+
var _a, _b;
|
13
15
|
return h(
|
14
16
|
this.tag,
|
15
17
|
{
|
16
|
-
|
17
|
-
src: this.renderSrc
|
18
|
-
}
|
18
|
+
src: this.renderSrc
|
19
19
|
},
|
20
|
-
this.$slots.default
|
20
|
+
(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)
|
21
21
|
);
|
22
22
|
},
|
23
23
|
data() {
|
package/es/tabs/Tabs.mjs
CHANGED
@@ -151,17 +151,19 @@ var stdin_default = defineComponent({
|
|
151
151
|
const newTab = children[newIndex];
|
152
152
|
const newName = getTabName(newTab, newIndex);
|
153
153
|
const shouldEmitChange = state.currentIndex !== null;
|
154
|
-
state.currentIndex
|
154
|
+
if (state.currentIndex !== newIndex) {
|
155
|
+
state.currentIndex = newIndex;
|
156
|
+
if (!skipScrollIntoView) {
|
157
|
+
scrollIntoView();
|
158
|
+
}
|
159
|
+
setLine();
|
160
|
+
}
|
155
161
|
if (newName !== props.active) {
|
156
162
|
emit("update:active", newName);
|
157
163
|
if (shouldEmitChange) {
|
158
164
|
emit("change", newName, newTab.title);
|
159
165
|
}
|
160
166
|
}
|
161
|
-
if (!skipScrollIntoView) {
|
162
|
-
scrollIntoView();
|
163
|
-
}
|
164
|
-
setLine();
|
165
167
|
if (stickyFixed && !props.scrollspy) {
|
166
168
|
setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
|
167
169
|
}
|
@@ -263,13 +265,14 @@ var stdin_default = defineComponent({
|
|
263
265
|
}
|
264
266
|
};
|
265
267
|
const renderHeader = () => {
|
266
|
-
var _a2, _b2;
|
268
|
+
var _a2, _b2, _c;
|
267
269
|
const {
|
268
270
|
type,
|
269
|
-
border
|
271
|
+
border,
|
272
|
+
sticky
|
270
273
|
} = props;
|
271
|
-
|
272
|
-
"ref": wrapRef,
|
274
|
+
const Header = [_createVNode("div", {
|
275
|
+
"ref": sticky ? void 0 : wrapRef,
|
273
276
|
"class": [bem("wrap"), {
|
274
277
|
[BORDER_TOP_BOTTOM]: type === "line" && border
|
275
278
|
}]
|
@@ -282,7 +285,13 @@ var stdin_default = defineComponent({
|
|
282
285
|
}]),
|
283
286
|
"style": navStyle.value,
|
284
287
|
"aria-orientation": "horizontal"
|
285
|
-
}, [(_a2 = slots["nav-left"]) == null ? void 0 : _a2.call(slots), renderNav(), renderLine(), (_b2 = slots["nav-right"]) == null ? void 0 : _b2.call(slots)])]);
|
288
|
+
}, [(_a2 = slots["nav-left"]) == null ? void 0 : _a2.call(slots), renderNav(), renderLine(), (_b2 = slots["nav-right"]) == null ? void 0 : _b2.call(slots)])]), (_c = slots["nav-bottom"]) == null ? void 0 : _c.call(slots)];
|
289
|
+
if (sticky) {
|
290
|
+
return _createVNode("div", {
|
291
|
+
"ref": wrapRef
|
292
|
+
}, [Header]);
|
293
|
+
}
|
294
|
+
return Header;
|
286
295
|
};
|
287
296
|
watch([() => props.color, windowWidth], setLine);
|
288
297
|
watch(() => props.active, (value) => {
|
@@ -336,37 +345,31 @@ var stdin_default = defineComponent({
|
|
336
345
|
currentName,
|
337
346
|
scrollIntoView
|
338
347
|
});
|
339
|
-
return () => {
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
default: () => {
|
365
|
-
var _a3;
|
366
|
-
return [(_a3 = slots.default) == null ? void 0 : _a3.call(slots)];
|
367
|
-
}
|
368
|
-
})]);
|
369
|
-
};
|
348
|
+
return () => _createVNode("div", {
|
349
|
+
"ref": root,
|
350
|
+
"class": bem([props.type])
|
351
|
+
}, [props.sticky ? _createVNode(Sticky, {
|
352
|
+
"container": root.value,
|
353
|
+
"offsetTop": offsetTopPx.value,
|
354
|
+
"onScroll": onStickyScroll
|
355
|
+
}, {
|
356
|
+
default: () => [renderHeader()]
|
357
|
+
}) : renderHeader(), _createVNode(TabsContent, {
|
358
|
+
"ref": contentRef,
|
359
|
+
"count": children.length,
|
360
|
+
"inited": state.inited,
|
361
|
+
"animated": props.animated,
|
362
|
+
"duration": props.duration,
|
363
|
+
"swipeable": props.swipeable,
|
364
|
+
"lazyRender": props.lazyRender,
|
365
|
+
"currentIndex": state.currentIndex,
|
366
|
+
"onChange": setCurrentIndex
|
367
|
+
}, {
|
368
|
+
default: () => {
|
369
|
+
var _a2;
|
370
|
+
return [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)];
|
371
|
+
}
|
372
|
+
})]);
|
370
373
|
}
|
371
374
|
});
|
372
375
|
export {
|
@@ -131,7 +131,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
131
131
|
"rootHeight": state.rootHeight,
|
132
132
|
"onScale": emitScale,
|
133
133
|
"onClose": emitClose
|
134
|
-
},
|
134
|
+
}, {
|
135
|
+
image: slots.image
|
136
|
+
}))]
|
135
137
|
});
|
136
138
|
const renderClose = () => {
|
137
139
|
if (props.closeable) {
|
@@ -42,7 +42,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
42
42
|
},
|
43
43
|
emits: ["scale", "close"],
|
44
44
|
setup(props, {
|
45
|
-
emit
|
45
|
+
emit,
|
46
|
+
slots
|
46
47
|
}) {
|
47
48
|
const state = (0, import_vue2.reactive)({
|
48
49
|
scale: 1,
|
@@ -260,7 +261,11 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
260
261
|
"onTouchend": onTouchEnd,
|
261
262
|
"onTouchcancel": onTouchEnd
|
262
263
|
}, {
|
263
|
-
default: () => [(0, import_vue.createVNode)(
|
264
|
+
default: () => [slots.image ? (0, import_vue.createVNode)("div", {
|
265
|
+
"class": bem("image-wrap")
|
266
|
+
}, [slots.image({
|
267
|
+
src: props.src
|
268
|
+
})]) : (0, import_vue.createVNode)(import_image.Image, {
|
264
269
|
"src": props.src,
|
265
270
|
"fit": "contain",
|
266
271
|
"class": bem("image", {
|
@@ -1 +1 @@
|
|
1
|
-
:root{--van-image-preview-index-text-color: var(--van-white);--van-image-preview-index-font-size: var(--van-font-size-md);--van-image-preview-index-line-height: var(--van-line-height-md);--van-image-preview-index-text-shadow: 0 1px 1px var(--van-gray-8);--van-image-preview-overlay-background-color: rgba(0, 0, 0, .9);--van-image-preview-close-icon-size: 22px;--van-image-preview-close-icon-color: var(--van-gray-5);--van-image-preview-close-icon-margin: var(--van-padding-md);--van-image-preview-close-icon-z-index: 1}.van-image-preview{position:fixed;top:0;left:0;width:100%;height:100%;background-color:transparent;transform:none}.van-image-preview__swipe{height:100%}.van-image-preview__swipe-item{display:flex;align-items:center;justify-content:center;overflow:hidden}.van-image-preview__cover{position:absolute;top:0;left:0}.van-image-preview__image{width:100%;transition-property:transform}.van-image-preview__image--vertical{width:auto;height:100%}.van-image-preview__image img{-webkit-user-drag:none}.van-image-preview__image .van-image__error{top:30%;height:40%}.van-image-preview__image .van-image__error-icon{font-size:36px}.van-image-preview__image .van-image__loading{background-color:transparent}.van-image-preview__index{position:absolute;top:var(--van-padding-md);left:50%;color:var(--van-image-preview-index-text-color);font-size:var(--van-image-preview-index-font-size);line-height:var(--van-image-preview-index-line-height);text-shadow:var(--van-image-preview-index-text-shadow);transform:translate(-50%)}.van-image-preview__overlay{background:var(--van-image-preview-overlay-background-color)}.van-image-preview__close-icon{position:absolute;z-index:var(--van-image-preview-close-icon-z-index);color:var(--van-image-preview-close-icon-color);font-size:var(--van-image-preview-close-icon-size)}.van-image-preview__close-icon--top-left{top:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--top-right{top:var(--van-image-preview-close-icon-margin);right:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-left{bottom:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-right{right:var(--van-image-preview-close-icon-margin);bottom:var(--van-image-preview-close-icon-margin)}
|
1
|
+
:root{--van-image-preview-index-text-color: var(--van-white);--van-image-preview-index-font-size: var(--van-font-size-md);--van-image-preview-index-line-height: var(--van-line-height-md);--van-image-preview-index-text-shadow: 0 1px 1px var(--van-gray-8);--van-image-preview-overlay-background-color: rgba(0, 0, 0, .9);--van-image-preview-close-icon-size: 22px;--van-image-preview-close-icon-color: var(--van-gray-5);--van-image-preview-close-icon-margin: var(--van-padding-md);--van-image-preview-close-icon-z-index: 1}.van-image-preview{position:fixed;top:0;left:0;width:100%;height:100%;background-color:transparent;transform:none}.van-image-preview__swipe{height:100%}.van-image-preview__swipe-item{display:flex;align-items:center;justify-content:center;overflow:hidden}.van-image-preview__cover{position:absolute;top:0;left:0}.van-image-preview__image,.van-image-preview__image-wrap{width:100%;transition-property:transform}.van-image-preview__image--vertical,.van-image-preview__image-wrap--vertical{width:auto;height:100%}.van-image-preview__image img,.van-image-preview__image-wrap img,.van-image-preview__image video,.van-image-preview__image-wrap video{-webkit-user-drag:none}.van-image-preview__image .van-image__error,.van-image-preview__image-wrap .van-image__error{top:30%;height:40%}.van-image-preview__image .van-image__error-icon,.van-image-preview__image-wrap .van-image__error-icon{font-size:36px}.van-image-preview__image .van-image__loading,.van-image-preview__image-wrap .van-image__loading{background-color:transparent}.van-image-preview__index{position:absolute;top:var(--van-padding-md);left:50%;color:var(--van-image-preview-index-text-color);font-size:var(--van-image-preview-index-font-size);line-height:var(--van-image-preview-index-line-height);text-shadow:var(--van-image-preview-index-text-shadow);transform:translate(-50%)}.van-image-preview__overlay{background:var(--van-image-preview-overlay-background-color)}.van-image-preview__close-icon{position:absolute;z-index:var(--van-image-preview-close-icon-z-index);color:var(--van-image-preview-close-icon-color);font-size:var(--van-image-preview-close-icon-size)}.van-image-preview__close-icon--top-left{top:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--top-right{top:var(--van-image-preview-close-icon-margin);right:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-left{bottom:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-right{right:var(--van-image-preview-close-icon-margin);bottom:var(--van-image-preview-close-icon-margin)}
|
@@ -38,7 +38,8 @@
|
|
38
38
|
left: 0;
|
39
39
|
}
|
40
40
|
|
41
|
-
&__image
|
41
|
+
&__image,
|
42
|
+
&__image-wrap {
|
42
43
|
width: 100%;
|
43
44
|
transition-property: transform;
|
44
45
|
|
@@ -47,7 +48,8 @@
|
|
47
48
|
height: 100%;
|
48
49
|
}
|
49
50
|
|
50
|
-
img
|
51
|
+
img,
|
52
|
+
video {
|
51
53
|
// disable desktop browser image drag
|
52
54
|
-webkit-user-drag: none;
|
53
55
|
}
|