vant 4.0.0-alpha.0 → 4.0.0-alpha.1
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/changelog.generated.md +197 -0
- package/es/calendar/Calendar.d.ts +4 -0
- package/es/calendar/Calendar.js +2 -0
- package/es/calendar/index.css +1 -1
- package/es/calendar/index.d.ts +3 -0
- package/es/calendar/index.less +1 -0
- package/es/config-provider/ConfigProvider.js +2 -0
- package/es/date-picker/DatePicker.js +1 -1
- package/es/dialog/index.css +1 -1
- package/es/dialog/index.less +2 -0
- package/es/index-bar/IndexBar.js +25 -4
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/locale/lang/la-LA.d.ts +64 -0
- package/es/locale/lang/la-LA.js +66 -0
- package/es/nav-bar/NavBar.d.ts +1 -1
- package/es/nav-bar/NavBar.js +3 -3
- package/es/nav-bar/index.d.ts +1 -1
- package/es/picker/index.css +1 -1
- package/es/picker/index.less +1 -0
- package/es/popup/Popup.d.ts +4 -0
- package/es/popup/Popup.js +3 -0
- package/es/popup/index.d.ts +3 -0
- package/es/skeleton/Skeleton.js +6 -4
- package/es/style/base.css +1 -1
- package/es/style/base.less +5 -0
- package/es/swipe-cell/SwipeCell.js +1 -1
- package/es/toast/Toast.js +1 -0
- package/lib/calendar/Calendar.d.ts +4 -0
- package/lib/calendar/Calendar.js +2 -0
- package/lib/calendar/index.css +1 -1
- package/lib/calendar/index.d.ts +3 -0
- package/lib/calendar/index.less +1 -0
- package/lib/config-provider/ConfigProvider.js +2 -0
- package/lib/date-picker/DatePicker.js +1 -1
- package/lib/dialog/index.css +1 -1
- package/lib/dialog/index.less +2 -0
- package/lib/index-bar/IndexBar.js +25 -4
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/lang/la-LA.d.ts +64 -0
- package/lib/locale/lang/la-LA.js +90 -0
- package/lib/nav-bar/NavBar.d.ts +1 -1
- package/lib/nav-bar/NavBar.js +3 -3
- package/lib/nav-bar/index.d.ts +1 -1
- package/lib/picker/index.css +1 -1
- package/lib/picker/index.less +1 -0
- package/lib/popup/Popup.d.ts +4 -0
- package/lib/popup/Popup.js +3 -0
- package/lib/popup/index.d.ts +3 -0
- package/lib/skeleton/Skeleton.js +5 -3
- package/lib/style/base.css +1 -1
- package/lib/style/base.less +5 -0
- package/lib/swipe-cell/SwipeCell.js +1 -1
- package/lib/toast/Toast.js +1 -0
- package/lib/vant.cjs.js +44 -13
- package/lib/vant.cjs.min.js +1 -1
- package/lib/vant.es.js +44 -13
- package/lib/vant.es.min.js +44 -13
- package/lib/vant.js +44 -13
- package/lib/vant.min.js +1 -1
- package/package.json +2 -2
- package/vetur/attributes.json +203 -195
- package/vetur/tags.json +70 -68
- package/vetur/web-types.json +644 -624
package/lib/vant.es.js
CHANGED
@@ -560,6 +560,8 @@ var stdin_default$1y = defineComponent({
|
|
560
560
|
watch(() => props.theme, (newVal, oldVal) => {
|
561
561
|
document.body.classList.remove(`van-theme-${oldVal}`);
|
562
562
|
document.body.classList.add(`van-theme-${newVal}`);
|
563
|
+
}, {
|
564
|
+
immediate: true
|
563
565
|
});
|
564
566
|
}
|
565
567
|
provide(CONFIG_PROVIDER_KEY, props);
|
@@ -1134,6 +1136,7 @@ const popupProps$2 = extend({}, popupSharedProps, {
|
|
1134
1136
|
iconPrefix: String,
|
1135
1137
|
closeOnPopstate: Boolean,
|
1136
1138
|
closeIconPosition: makeStringProp("top-right"),
|
1139
|
+
safeAreaInsetTop: Boolean,
|
1137
1140
|
safeAreaInsetBottom: Boolean
|
1138
1141
|
});
|
1139
1142
|
const [name$1k, bem$1g] = createNamespace("popup");
|
@@ -1228,6 +1231,7 @@ var stdin_default$1r = defineComponent({
|
|
1228
1231
|
const {
|
1229
1232
|
round,
|
1230
1233
|
position,
|
1234
|
+
safeAreaInsetTop,
|
1231
1235
|
safeAreaInsetBottom
|
1232
1236
|
} = props;
|
1233
1237
|
return withDirectives(createVNode("div", mergeProps({
|
@@ -1237,6 +1241,7 @@ var stdin_default$1r = defineComponent({
|
|
1237
1241
|
round,
|
1238
1242
|
[position]: position
|
1239
1243
|
}), {
|
1244
|
+
"van-safe-area-top": safeAreaInsetTop,
|
1240
1245
|
"van-safe-area-bottom": safeAreaInsetBottom
|
1241
1246
|
}],
|
1242
1247
|
"onKeydown": onKeydown
|
@@ -2906,6 +2911,7 @@ var stdin_default$1j = defineComponent({
|
|
2906
2911
|
} = props;
|
2907
2912
|
if (isDef(message) && message !== "") {
|
2908
2913
|
return type === "html" ? createVNode("div", {
|
2914
|
+
"key": 0,
|
2909
2915
|
"class": bem$18("text"),
|
2910
2916
|
"innerHTML": String(message)
|
2911
2917
|
}, null) : createVNode("div", {
|
@@ -4393,6 +4399,7 @@ const calendarProps = {
|
|
4393
4399
|
showRangePrompt: truthProp,
|
4394
4400
|
confirmDisabledText: String,
|
4395
4401
|
closeOnClickOverlay: truthProp,
|
4402
|
+
safeAreaInsetTop: Boolean,
|
4396
4403
|
safeAreaInsetBottom: truthProp,
|
4397
4404
|
minDate: {
|
4398
4405
|
type: Date,
|
@@ -4741,6 +4748,7 @@ var stdin_default$16 = defineComponent({
|
|
4741
4748
|
"closeable": props.showTitle || props.showSubtitle,
|
4742
4749
|
"teleport": props.teleport,
|
4743
4750
|
"closeOnPopstate": props.closeOnPopstate,
|
4751
|
+
"safeAreaInsetTop": props.safeAreaInsetTop,
|
4744
4752
|
"closeOnClickOverlay": props.closeOnClickOverlay,
|
4745
4753
|
"onUpdate:show": updateShow
|
4746
4754
|
}, {
|
@@ -7713,7 +7721,7 @@ var stdin_default$I = defineComponent({
|
|
7713
7721
|
}
|
7714
7722
|
});
|
7715
7723
|
watch(() => props.modelValue, (newValues) => {
|
7716
|
-
if (isSameValue(newValues, currentValues.value)) {
|
7724
|
+
if (!isSameValue(newValues, currentValues.value)) {
|
7717
7725
|
currentValues.value = newValues;
|
7718
7726
|
}
|
7719
7727
|
});
|
@@ -9120,6 +9128,7 @@ var stdin_default$y = defineComponent({
|
|
9120
9128
|
children,
|
9121
9129
|
linkChildren
|
9122
9130
|
} = useChildren(INDEX_BAR_KEY);
|
9131
|
+
let selectActiveIndex;
|
9123
9132
|
linkChildren({
|
9124
9133
|
props
|
9125
9134
|
});
|
@@ -9147,6 +9156,7 @@ var stdin_default$y = defineComponent({
|
|
9147
9156
|
}
|
9148
9157
|
return -1;
|
9149
9158
|
};
|
9159
|
+
const getMatchAnchor = (index) => children.find((item) => String(item.index) === index);
|
9150
9160
|
const onScroll = () => {
|
9151
9161
|
if (isHidden(root)) {
|
9152
9162
|
return;
|
@@ -9158,7 +9168,16 @@ var stdin_default$y = defineComponent({
|
|
9158
9168
|
const scrollTop = getScrollTop(scrollParent.value);
|
9159
9169
|
const scrollParentRect = useRect(scrollParent);
|
9160
9170
|
const rects = children.map((item) => item.getRect(scrollParent.value, scrollParentRect));
|
9161
|
-
|
9171
|
+
let active = -1;
|
9172
|
+
if (selectActiveIndex) {
|
9173
|
+
const match = getMatchAnchor(selectActiveIndex);
|
9174
|
+
if (match) {
|
9175
|
+
const rect = match.getRect(scrollParent.value, scrollParentRect);
|
9176
|
+
active = getActiveAnchor(rect.top, rects);
|
9177
|
+
}
|
9178
|
+
} else {
|
9179
|
+
active = getActiveAnchor(scrollTop, rects);
|
9180
|
+
}
|
9162
9181
|
activeAnchor.value = indexList[active];
|
9163
9182
|
if (sticky) {
|
9164
9183
|
children.forEach((item, index) => {
|
@@ -9177,7 +9196,7 @@ var stdin_default$y = defineComponent({
|
|
9177
9196
|
if (index === active) {
|
9178
9197
|
state.active = true;
|
9179
9198
|
state.top = Math.max(props.stickyOffsetTop, rects[index].top - scrollTop) + scrollParentRect.top;
|
9180
|
-
} else if (index === active - 1) {
|
9199
|
+
} else if (index === active - 1 && selectActiveIndex === "") {
|
9181
9200
|
const activeItemTop = rects[active].top - scrollTop;
|
9182
9201
|
state.active = activeItemTop > 0;
|
9183
9202
|
state.top = activeItemTop + scrollParentRect.top - rects[index].height;
|
@@ -9186,6 +9205,7 @@ var stdin_default$y = defineComponent({
|
|
9186
9205
|
}
|
9187
9206
|
});
|
9188
9207
|
}
|
9208
|
+
selectActiveIndex = "";
|
9189
9209
|
};
|
9190
9210
|
const init = () => {
|
9191
9211
|
nextTick(onScroll);
|
@@ -9211,9 +9231,18 @@ var stdin_default$y = defineComponent({
|
|
9211
9231
|
}, [index]);
|
9212
9232
|
});
|
9213
9233
|
const scrollTo = (index) => {
|
9214
|
-
|
9215
|
-
const match =
|
9234
|
+
selectActiveIndex = String(index);
|
9235
|
+
const match = getMatchAnchor(selectActiveIndex);
|
9216
9236
|
if (match) {
|
9237
|
+
const scrollTop = getScrollTop(scrollParent.value);
|
9238
|
+
const scrollParentRect = useRect(scrollParent);
|
9239
|
+
const {
|
9240
|
+
offsetHeight
|
9241
|
+
} = document.documentElement;
|
9242
|
+
if (scrollTop === offsetHeight - scrollParentRect.height) {
|
9243
|
+
onScroll();
|
9244
|
+
return;
|
9245
|
+
}
|
9217
9246
|
match.$el.scrollIntoView();
|
9218
9247
|
if (props.sticky && props.stickyOffsetTop) {
|
9219
9248
|
setRootScrollTop(getRootScrollTop() - props.stickyOffsetTop);
|
@@ -9547,10 +9576,10 @@ var stdin_default$v = defineComponent({
|
|
9547
9576
|
"ref": navBarRef,
|
9548
9577
|
"style": style,
|
9549
9578
|
"class": [bem$p({
|
9550
|
-
fixed
|
9551
|
-
"safe-area-inset-top": props.safeAreaInsetTop
|
9579
|
+
fixed
|
9552
9580
|
}), {
|
9553
|
-
[BORDER_BOTTOM]: border
|
9581
|
+
[BORDER_BOTTOM]: border,
|
9582
|
+
"van-safe-area-top": props.safeAreaInsetTop
|
9554
9583
|
}]
|
9555
9584
|
}, [createVNode("div", {
|
9556
9585
|
"class": bem$p("content")
|
@@ -11271,9 +11300,11 @@ const skeletonProps = {
|
|
11271
11300
|
};
|
11272
11301
|
var stdin_default$g = defineComponent({
|
11273
11302
|
name: name$b,
|
11303
|
+
inheritAttrs: false,
|
11274
11304
|
props: skeletonProps,
|
11275
11305
|
setup(props, {
|
11276
|
-
slots
|
11306
|
+
slots,
|
11307
|
+
attrs
|
11277
11308
|
}) {
|
11278
11309
|
const renderAvatar = () => {
|
11279
11310
|
if (props.avatar) {
|
@@ -11316,12 +11347,12 @@ var stdin_default$g = defineComponent({
|
|
11316
11347
|
if (!props.loading) {
|
11317
11348
|
return (_a = slots.default) == null ? void 0 : _a.call(slots);
|
11318
11349
|
}
|
11319
|
-
return createVNode("div", {
|
11350
|
+
return createVNode("div", mergeProps({
|
11320
11351
|
"class": bem$a({
|
11321
11352
|
animate: props.animate,
|
11322
11353
|
round: props.round
|
11323
11354
|
})
|
11324
|
-
}, [renderAvatar(), createVNode("div", {
|
11355
|
+
}, attrs), [renderAvatar(), createVNode("div", {
|
11325
11356
|
"class": bem$a("content")
|
11326
11357
|
}, [renderTitle(), renderRows()])]);
|
11327
11358
|
};
|
@@ -12211,7 +12242,7 @@ var stdin_default$a = defineComponent({
|
|
12211
12242
|
return createVNode("div", {
|
12212
12243
|
"ref": root,
|
12213
12244
|
"class": bem$4(),
|
12214
|
-
"onClick": getClickHandler("cell"),
|
12245
|
+
"onClick": getClickHandler("cell", lockClick2),
|
12215
12246
|
"onTouchstart": onTouchStart,
|
12216
12247
|
"onTouchmove": onTouchMove,
|
12217
12248
|
"onTouchend": onTouchEnd,
|
@@ -13822,7 +13853,7 @@ const Lazyload = {
|
|
13822
13853
|
});
|
13823
13854
|
}
|
13824
13855
|
};
|
13825
|
-
const version = "4.0.0-alpha.
|
13856
|
+
const version = "4.0.0-alpha.1";
|
13826
13857
|
function install(app) {
|
13827
13858
|
const components = [
|
13828
13859
|
ActionBar,
|
package/lib/vant.es.min.js
CHANGED
@@ -560,6 +560,8 @@ var stdin_default$1y = defineComponent({
|
|
560
560
|
watch(() => props.theme, (newVal, oldVal) => {
|
561
561
|
document.body.classList.remove(`van-theme-${oldVal}`);
|
562
562
|
document.body.classList.add(`van-theme-${newVal}`);
|
563
|
+
}, {
|
564
|
+
immediate: true
|
563
565
|
});
|
564
566
|
}
|
565
567
|
provide(CONFIG_PROVIDER_KEY, props);
|
@@ -1134,6 +1136,7 @@ const popupProps$2 = extend({}, popupSharedProps, {
|
|
1134
1136
|
iconPrefix: String,
|
1135
1137
|
closeOnPopstate: Boolean,
|
1136
1138
|
closeIconPosition: makeStringProp("top-right"),
|
1139
|
+
safeAreaInsetTop: Boolean,
|
1137
1140
|
safeAreaInsetBottom: Boolean
|
1138
1141
|
});
|
1139
1142
|
const [name$1k, bem$1g] = createNamespace("popup");
|
@@ -1228,6 +1231,7 @@ var stdin_default$1r = defineComponent({
|
|
1228
1231
|
const {
|
1229
1232
|
round,
|
1230
1233
|
position,
|
1234
|
+
safeAreaInsetTop,
|
1231
1235
|
safeAreaInsetBottom
|
1232
1236
|
} = props;
|
1233
1237
|
return withDirectives(createVNode("div", mergeProps({
|
@@ -1237,6 +1241,7 @@ var stdin_default$1r = defineComponent({
|
|
1237
1241
|
round,
|
1238
1242
|
[position]: position
|
1239
1243
|
}), {
|
1244
|
+
"van-safe-area-top": safeAreaInsetTop,
|
1240
1245
|
"van-safe-area-bottom": safeAreaInsetBottom
|
1241
1246
|
}],
|
1242
1247
|
"onKeydown": onKeydown
|
@@ -2906,6 +2911,7 @@ var stdin_default$1j = defineComponent({
|
|
2906
2911
|
} = props;
|
2907
2912
|
if (isDef(message) && message !== "") {
|
2908
2913
|
return type === "html" ? createVNode("div", {
|
2914
|
+
"key": 0,
|
2909
2915
|
"class": bem$18("text"),
|
2910
2916
|
"innerHTML": String(message)
|
2911
2917
|
}, null) : createVNode("div", {
|
@@ -4393,6 +4399,7 @@ const calendarProps = {
|
|
4393
4399
|
showRangePrompt: truthProp,
|
4394
4400
|
confirmDisabledText: String,
|
4395
4401
|
closeOnClickOverlay: truthProp,
|
4402
|
+
safeAreaInsetTop: Boolean,
|
4396
4403
|
safeAreaInsetBottom: truthProp,
|
4397
4404
|
minDate: {
|
4398
4405
|
type: Date,
|
@@ -4741,6 +4748,7 @@ var stdin_default$16 = defineComponent({
|
|
4741
4748
|
"closeable": props.showTitle || props.showSubtitle,
|
4742
4749
|
"teleport": props.teleport,
|
4743
4750
|
"closeOnPopstate": props.closeOnPopstate,
|
4751
|
+
"safeAreaInsetTop": props.safeAreaInsetTop,
|
4744
4752
|
"closeOnClickOverlay": props.closeOnClickOverlay,
|
4745
4753
|
"onUpdate:show": updateShow
|
4746
4754
|
}, {
|
@@ -7713,7 +7721,7 @@ var stdin_default$I = defineComponent({
|
|
7713
7721
|
}
|
7714
7722
|
});
|
7715
7723
|
watch(() => props.modelValue, (newValues) => {
|
7716
|
-
if (isSameValue(newValues, currentValues.value)) {
|
7724
|
+
if (!isSameValue(newValues, currentValues.value)) {
|
7717
7725
|
currentValues.value = newValues;
|
7718
7726
|
}
|
7719
7727
|
});
|
@@ -9120,6 +9128,7 @@ var stdin_default$y = defineComponent({
|
|
9120
9128
|
children,
|
9121
9129
|
linkChildren
|
9122
9130
|
} = useChildren(INDEX_BAR_KEY);
|
9131
|
+
let selectActiveIndex;
|
9123
9132
|
linkChildren({
|
9124
9133
|
props
|
9125
9134
|
});
|
@@ -9147,6 +9156,7 @@ var stdin_default$y = defineComponent({
|
|
9147
9156
|
}
|
9148
9157
|
return -1;
|
9149
9158
|
};
|
9159
|
+
const getMatchAnchor = (index) => children.find((item) => String(item.index) === index);
|
9150
9160
|
const onScroll = () => {
|
9151
9161
|
if (isHidden(root)) {
|
9152
9162
|
return;
|
@@ -9158,7 +9168,16 @@ var stdin_default$y = defineComponent({
|
|
9158
9168
|
const scrollTop = getScrollTop(scrollParent.value);
|
9159
9169
|
const scrollParentRect = useRect(scrollParent);
|
9160
9170
|
const rects = children.map((item) => item.getRect(scrollParent.value, scrollParentRect));
|
9161
|
-
|
9171
|
+
let active = -1;
|
9172
|
+
if (selectActiveIndex) {
|
9173
|
+
const match = getMatchAnchor(selectActiveIndex);
|
9174
|
+
if (match) {
|
9175
|
+
const rect = match.getRect(scrollParent.value, scrollParentRect);
|
9176
|
+
active = getActiveAnchor(rect.top, rects);
|
9177
|
+
}
|
9178
|
+
} else {
|
9179
|
+
active = getActiveAnchor(scrollTop, rects);
|
9180
|
+
}
|
9162
9181
|
activeAnchor.value = indexList[active];
|
9163
9182
|
if (sticky) {
|
9164
9183
|
children.forEach((item, index) => {
|
@@ -9177,7 +9196,7 @@ var stdin_default$y = defineComponent({
|
|
9177
9196
|
if (index === active) {
|
9178
9197
|
state.active = true;
|
9179
9198
|
state.top = Math.max(props.stickyOffsetTop, rects[index].top - scrollTop) + scrollParentRect.top;
|
9180
|
-
} else if (index === active - 1) {
|
9199
|
+
} else if (index === active - 1 && selectActiveIndex === "") {
|
9181
9200
|
const activeItemTop = rects[active].top - scrollTop;
|
9182
9201
|
state.active = activeItemTop > 0;
|
9183
9202
|
state.top = activeItemTop + scrollParentRect.top - rects[index].height;
|
@@ -9186,6 +9205,7 @@ var stdin_default$y = defineComponent({
|
|
9186
9205
|
}
|
9187
9206
|
});
|
9188
9207
|
}
|
9208
|
+
selectActiveIndex = "";
|
9189
9209
|
};
|
9190
9210
|
const init = () => {
|
9191
9211
|
nextTick(onScroll);
|
@@ -9211,9 +9231,18 @@ var stdin_default$y = defineComponent({
|
|
9211
9231
|
}, [index]);
|
9212
9232
|
});
|
9213
9233
|
const scrollTo = (index) => {
|
9214
|
-
|
9215
|
-
const match =
|
9234
|
+
selectActiveIndex = String(index);
|
9235
|
+
const match = getMatchAnchor(selectActiveIndex);
|
9216
9236
|
if (match) {
|
9237
|
+
const scrollTop = getScrollTop(scrollParent.value);
|
9238
|
+
const scrollParentRect = useRect(scrollParent);
|
9239
|
+
const {
|
9240
|
+
offsetHeight
|
9241
|
+
} = document.documentElement;
|
9242
|
+
if (scrollTop === offsetHeight - scrollParentRect.height) {
|
9243
|
+
onScroll();
|
9244
|
+
return;
|
9245
|
+
}
|
9217
9246
|
match.$el.scrollIntoView();
|
9218
9247
|
if (props.sticky && props.stickyOffsetTop) {
|
9219
9248
|
setRootScrollTop(getRootScrollTop() - props.stickyOffsetTop);
|
@@ -9547,10 +9576,10 @@ var stdin_default$v = defineComponent({
|
|
9547
9576
|
"ref": navBarRef,
|
9548
9577
|
"style": style,
|
9549
9578
|
"class": [bem$p({
|
9550
|
-
fixed
|
9551
|
-
"safe-area-inset-top": props.safeAreaInsetTop
|
9579
|
+
fixed
|
9552
9580
|
}), {
|
9553
|
-
[BORDER_BOTTOM]: border
|
9581
|
+
[BORDER_BOTTOM]: border,
|
9582
|
+
"van-safe-area-top": props.safeAreaInsetTop
|
9554
9583
|
}]
|
9555
9584
|
}, [createVNode("div", {
|
9556
9585
|
"class": bem$p("content")
|
@@ -11271,9 +11300,11 @@ const skeletonProps = {
|
|
11271
11300
|
};
|
11272
11301
|
var stdin_default$g = defineComponent({
|
11273
11302
|
name: name$b,
|
11303
|
+
inheritAttrs: false,
|
11274
11304
|
props: skeletonProps,
|
11275
11305
|
setup(props, {
|
11276
|
-
slots
|
11306
|
+
slots,
|
11307
|
+
attrs
|
11277
11308
|
}) {
|
11278
11309
|
const renderAvatar = () => {
|
11279
11310
|
if (props.avatar) {
|
@@ -11316,12 +11347,12 @@ var stdin_default$g = defineComponent({
|
|
11316
11347
|
if (!props.loading) {
|
11317
11348
|
return (_a = slots.default) == null ? void 0 : _a.call(slots);
|
11318
11349
|
}
|
11319
|
-
return createVNode("div", {
|
11350
|
+
return createVNode("div", mergeProps({
|
11320
11351
|
"class": bem$a({
|
11321
11352
|
animate: props.animate,
|
11322
11353
|
round: props.round
|
11323
11354
|
})
|
11324
|
-
}, [renderAvatar(), createVNode("div", {
|
11355
|
+
}, attrs), [renderAvatar(), createVNode("div", {
|
11325
11356
|
"class": bem$a("content")
|
11326
11357
|
}, [renderTitle(), renderRows()])]);
|
11327
11358
|
};
|
@@ -12211,7 +12242,7 @@ var stdin_default$a = defineComponent({
|
|
12211
12242
|
return createVNode("div", {
|
12212
12243
|
"ref": root,
|
12213
12244
|
"class": bem$4(),
|
12214
|
-
"onClick": getClickHandler("cell"),
|
12245
|
+
"onClick": getClickHandler("cell", lockClick2),
|
12215
12246
|
"onTouchstart": onTouchStart,
|
12216
12247
|
"onTouchmove": onTouchMove,
|
12217
12248
|
"onTouchend": onTouchEnd,
|
@@ -13822,7 +13853,7 @@ const Lazyload = {
|
|
13822
13853
|
});
|
13823
13854
|
}
|
13824
13855
|
};
|
13825
|
-
const version = "4.0.0-alpha.
|
13856
|
+
const version = "4.0.0-alpha.1";
|
13826
13857
|
function install(app) {
|
13827
13858
|
const components = [
|
13828
13859
|
ActionBar,
|
package/lib/vant.js
CHANGED
@@ -914,6 +914,8 @@
|
|
914
914
|
vue.watch(() => props.theme, (newVal, oldVal) => {
|
915
915
|
document.body.classList.remove(`van-theme-${oldVal}`);
|
916
916
|
document.body.classList.add(`van-theme-${newVal}`);
|
917
|
+
}, {
|
918
|
+
immediate: true
|
917
919
|
});
|
918
920
|
}
|
919
921
|
vue.provide(CONFIG_PROVIDER_KEY, props);
|
@@ -1488,6 +1490,7 @@
|
|
1488
1490
|
iconPrefix: String,
|
1489
1491
|
closeOnPopstate: Boolean,
|
1490
1492
|
closeIconPosition: makeStringProp("top-right"),
|
1493
|
+
safeAreaInsetTop: Boolean,
|
1491
1494
|
safeAreaInsetBottom: Boolean
|
1492
1495
|
});
|
1493
1496
|
const [name$1k, bem$1g] = createNamespace("popup");
|
@@ -1582,6 +1585,7 @@
|
|
1582
1585
|
const {
|
1583
1586
|
round: round2,
|
1584
1587
|
position,
|
1588
|
+
safeAreaInsetTop,
|
1585
1589
|
safeAreaInsetBottom
|
1586
1590
|
} = props;
|
1587
1591
|
return vue.withDirectives(vue.createVNode("div", vue.mergeProps({
|
@@ -1591,6 +1595,7 @@
|
|
1591
1595
|
round: round2,
|
1592
1596
|
[position]: position
|
1593
1597
|
}), {
|
1598
|
+
"van-safe-area-top": safeAreaInsetTop,
|
1594
1599
|
"van-safe-area-bottom": safeAreaInsetBottom
|
1595
1600
|
}],
|
1596
1601
|
"onKeydown": onKeydown
|
@@ -3260,6 +3265,7 @@
|
|
3260
3265
|
} = props;
|
3261
3266
|
if (isDef(message) && message !== "") {
|
3262
3267
|
return type === "html" ? vue.createVNode("div", {
|
3268
|
+
"key": 0,
|
3263
3269
|
"class": bem$18("text"),
|
3264
3270
|
"innerHTML": String(message)
|
3265
3271
|
}, null) : vue.createVNode("div", {
|
@@ -4747,6 +4753,7 @@
|
|
4747
4753
|
showRangePrompt: truthProp,
|
4748
4754
|
confirmDisabledText: String,
|
4749
4755
|
closeOnClickOverlay: truthProp,
|
4756
|
+
safeAreaInsetTop: Boolean,
|
4750
4757
|
safeAreaInsetBottom: truthProp,
|
4751
4758
|
minDate: {
|
4752
4759
|
type: Date,
|
@@ -5095,6 +5102,7 @@
|
|
5095
5102
|
"closeable": props.showTitle || props.showSubtitle,
|
5096
5103
|
"teleport": props.teleport,
|
5097
5104
|
"closeOnPopstate": props.closeOnPopstate,
|
5105
|
+
"safeAreaInsetTop": props.safeAreaInsetTop,
|
5098
5106
|
"closeOnClickOverlay": props.closeOnClickOverlay,
|
5099
5107
|
"onUpdate:show": updateShow
|
5100
5108
|
}, {
|
@@ -8067,7 +8075,7 @@
|
|
8067
8075
|
}
|
8068
8076
|
});
|
8069
8077
|
vue.watch(() => props.modelValue, (newValues) => {
|
8070
|
-
if (isSameValue(newValues, currentValues.value)) {
|
8078
|
+
if (!isSameValue(newValues, currentValues.value)) {
|
8071
8079
|
currentValues.value = newValues;
|
8072
8080
|
}
|
8073
8081
|
});
|
@@ -9474,6 +9482,7 @@
|
|
9474
9482
|
children,
|
9475
9483
|
linkChildren
|
9476
9484
|
} = useChildren(INDEX_BAR_KEY);
|
9485
|
+
let selectActiveIndex;
|
9477
9486
|
linkChildren({
|
9478
9487
|
props
|
9479
9488
|
});
|
@@ -9501,6 +9510,7 @@
|
|
9501
9510
|
}
|
9502
9511
|
return -1;
|
9503
9512
|
};
|
9513
|
+
const getMatchAnchor = (index) => children.find((item) => String(item.index) === index);
|
9504
9514
|
const onScroll = () => {
|
9505
9515
|
if (isHidden(root)) {
|
9506
9516
|
return;
|
@@ -9512,7 +9522,16 @@
|
|
9512
9522
|
const scrollTop = getScrollTop(scrollParent.value);
|
9513
9523
|
const scrollParentRect = useRect(scrollParent);
|
9514
9524
|
const rects = children.map((item) => item.getRect(scrollParent.value, scrollParentRect));
|
9515
|
-
|
9525
|
+
let active = -1;
|
9526
|
+
if (selectActiveIndex) {
|
9527
|
+
const match = getMatchAnchor(selectActiveIndex);
|
9528
|
+
if (match) {
|
9529
|
+
const rect = match.getRect(scrollParent.value, scrollParentRect);
|
9530
|
+
active = getActiveAnchor(rect.top, rects);
|
9531
|
+
}
|
9532
|
+
} else {
|
9533
|
+
active = getActiveAnchor(scrollTop, rects);
|
9534
|
+
}
|
9516
9535
|
activeAnchor.value = indexList[active];
|
9517
9536
|
if (sticky) {
|
9518
9537
|
children.forEach((item, index) => {
|
@@ -9531,7 +9550,7 @@
|
|
9531
9550
|
if (index === active) {
|
9532
9551
|
state.active = true;
|
9533
9552
|
state.top = Math.max(props.stickyOffsetTop, rects[index].top - scrollTop) + scrollParentRect.top;
|
9534
|
-
} else if (index === active - 1) {
|
9553
|
+
} else if (index === active - 1 && selectActiveIndex === "") {
|
9535
9554
|
const activeItemTop = rects[active].top - scrollTop;
|
9536
9555
|
state.active = activeItemTop > 0;
|
9537
9556
|
state.top = activeItemTop + scrollParentRect.top - rects[index].height;
|
@@ -9540,6 +9559,7 @@
|
|
9540
9559
|
}
|
9541
9560
|
});
|
9542
9561
|
}
|
9562
|
+
selectActiveIndex = "";
|
9543
9563
|
};
|
9544
9564
|
const init = () => {
|
9545
9565
|
vue.nextTick(onScroll);
|
@@ -9565,9 +9585,18 @@
|
|
9565
9585
|
}, [index]);
|
9566
9586
|
});
|
9567
9587
|
const scrollTo = (index) => {
|
9568
|
-
|
9569
|
-
const match =
|
9588
|
+
selectActiveIndex = String(index);
|
9589
|
+
const match = getMatchAnchor(selectActiveIndex);
|
9570
9590
|
if (match) {
|
9591
|
+
const scrollTop = getScrollTop(scrollParent.value);
|
9592
|
+
const scrollParentRect = useRect(scrollParent);
|
9593
|
+
const {
|
9594
|
+
offsetHeight
|
9595
|
+
} = document.documentElement;
|
9596
|
+
if (scrollTop === offsetHeight - scrollParentRect.height) {
|
9597
|
+
onScroll();
|
9598
|
+
return;
|
9599
|
+
}
|
9571
9600
|
match.$el.scrollIntoView();
|
9572
9601
|
if (props.sticky && props.stickyOffsetTop) {
|
9573
9602
|
setRootScrollTop(getRootScrollTop() - props.stickyOffsetTop);
|
@@ -9901,10 +9930,10 @@
|
|
9901
9930
|
"ref": navBarRef,
|
9902
9931
|
"style": style,
|
9903
9932
|
"class": [bem$p({
|
9904
|
-
fixed
|
9905
|
-
"safe-area-inset-top": props.safeAreaInsetTop
|
9933
|
+
fixed
|
9906
9934
|
}), {
|
9907
|
-
[BORDER_BOTTOM]: border
|
9935
|
+
[BORDER_BOTTOM]: border,
|
9936
|
+
"van-safe-area-top": props.safeAreaInsetTop
|
9908
9937
|
}]
|
9909
9938
|
}, [vue.createVNode("div", {
|
9910
9939
|
"class": bem$p("content")
|
@@ -12482,9 +12511,11 @@
|
|
12482
12511
|
};
|
12483
12512
|
var stdin_default$g = vue.defineComponent({
|
12484
12513
|
name: name$b,
|
12514
|
+
inheritAttrs: false,
|
12485
12515
|
props: skeletonProps,
|
12486
12516
|
setup(props, {
|
12487
|
-
slots
|
12517
|
+
slots,
|
12518
|
+
attrs
|
12488
12519
|
}) {
|
12489
12520
|
const renderAvatar = () => {
|
12490
12521
|
if (props.avatar) {
|
@@ -12527,12 +12558,12 @@
|
|
12527
12558
|
if (!props.loading) {
|
12528
12559
|
return (_a = slots.default) == null ? void 0 : _a.call(slots);
|
12529
12560
|
}
|
12530
|
-
return vue.createVNode("div", {
|
12561
|
+
return vue.createVNode("div", vue.mergeProps({
|
12531
12562
|
"class": bem$a({
|
12532
12563
|
animate: props.animate,
|
12533
12564
|
round: props.round
|
12534
12565
|
})
|
12535
|
-
}, [renderAvatar(), vue.createVNode("div", {
|
12566
|
+
}, attrs), [renderAvatar(), vue.createVNode("div", {
|
12536
12567
|
"class": bem$a("content")
|
12537
12568
|
}, [renderTitle(), renderRows()])]);
|
12538
12569
|
};
|
@@ -13422,7 +13453,7 @@
|
|
13422
13453
|
return vue.createVNode("div", {
|
13423
13454
|
"ref": root,
|
13424
13455
|
"class": bem$4(),
|
13425
|
-
"onClick": getClickHandler("cell"),
|
13456
|
+
"onClick": getClickHandler("cell", lockClick2),
|
13426
13457
|
"onTouchstart": onTouchStart,
|
13427
13458
|
"onTouchmove": onTouchMove,
|
13428
13459
|
"onTouchend": onTouchEnd,
|
@@ -15033,7 +15064,7 @@
|
|
15033
15064
|
});
|
15034
15065
|
}
|
15035
15066
|
};
|
15036
|
-
const version = "4.0.0-alpha.
|
15067
|
+
const version = "4.0.0-alpha.1";
|
15037
15068
|
function install(app) {
|
15038
15069
|
const components = [
|
15039
15070
|
ActionBar,
|