vant 3.3.0 → 3.3.3
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/address-edit/AddressEdit.js +1 -2
- package/es/calendar/Calendar.js +8 -14
- package/es/calendar/CalendarMonth.js +11 -10
- package/es/calendar/types.d.ts +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/locale/lang/pt-BR.d.ts +73 -0
- package/es/locale/lang/pt-BR.js +72 -0
- package/es/swipe/Swipe.js +8 -2
- package/es/swipe/index.css +1 -1
- package/es/swipe/index.less +2 -0
- package/es/tab/Tab.js +1 -1
- package/es/tabbar-item/TabbarItem.js +5 -3
- package/es/uploader/Uploader.js +13 -2
- package/lib/address-edit/AddressEdit.js +1 -2
- package/lib/calendar/Calendar.js +8 -14
- package/lib/calendar/CalendarMonth.js +11 -10
- package/lib/calendar/types.d.ts +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/lang/pt-BR.d.ts +73 -0
- package/lib/locale/lang/pt-BR.js +77 -0
- package/lib/swipe/Swipe.js +8 -2
- package/lib/swipe/index.css +1 -1
- package/lib/swipe/index.less +2 -0
- package/lib/tab/Tab.js +1 -1
- package/lib/tabbar-item/TabbarItem.js +5 -3
- package/lib/uploader/Uploader.js +12 -1
- package/lib/vant.cjs.js +14417 -0
- package/lib/vant.cjs.min.js +1 -0
- package/lib/vant.es.js +174 -1243
- package/lib/vant.es.min.js +174 -1243
- package/lib/vant.js +39 -27
- package/lib/vant.min.js +1 -1
- package/package.json +23 -8
- package/vetur/attributes.json +28 -28
- package/vetur/tags.json +11 -11
- package/vetur/web-types.json +120 -120
package/lib/vant.js
CHANGED
@@ -4060,8 +4060,7 @@
|
|
4060
4060
|
"text": props.saveButtonText || t$h("save"),
|
4061
4061
|
"class": bem$16("button"),
|
4062
4062
|
"loading": props.isSaving,
|
4063
|
-
"nativeType": "submit"
|
4064
|
-
"onClick": onSave
|
4063
|
+
"nativeType": "submit"
|
4065
4064
|
}, null), props.showDelete && vue.createVNode(Button, {
|
4066
4065
|
"block": true,
|
4067
4066
|
"round": true,
|
@@ -4744,13 +4743,6 @@
|
|
4744
4743
|
var totalDay = vue.computed(() => getMonthEndDay(props.date.getFullYear(), props.date.getMonth() + 1));
|
4745
4744
|
var shouldRender = vue.computed(() => visible.value || !props.lazyRender);
|
4746
4745
|
var getTitle = () => title.value;
|
4747
|
-
var scrollIntoView = (body) => {
|
4748
|
-
var el = props.showSubtitle ? daysRef.value : monthRef.value;
|
4749
|
-
if (el) {
|
4750
|
-
var scrollTop = useRect(el).top - useRect(body).top + body.scrollTop;
|
4751
|
-
setScrollTop(body, scrollTop);
|
4752
|
-
}
|
4753
|
-
};
|
4754
4746
|
var getMultipleDayType = (day) => {
|
4755
4747
|
var isSelected = (date) => props.currentDate.some((item) => compareDay(item, date) === 0);
|
4756
4748
|
if (isSelected(day)) {
|
@@ -4871,6 +4863,15 @@
|
|
4871
4863
|
return days2;
|
4872
4864
|
});
|
4873
4865
|
var disabledDays = vue.computed(() => days.value.filter((day) => day.type === "disabled"));
|
4866
|
+
var scrollToDate = (body, targetDate) => {
|
4867
|
+
if (daysRef.value) {
|
4868
|
+
var daysRect = useRect(daysRef.value);
|
4869
|
+
var totalRows = placeholders.value.length;
|
4870
|
+
var currentRow = Math.ceil((targetDate.getDate() + offset2.value) / 7);
|
4871
|
+
var rowOffset = (currentRow - 1) * daysRect.height / totalRows;
|
4872
|
+
setScrollTop(body, daysRect.top + rowOffset + body.scrollTop - useRect(body).top);
|
4873
|
+
}
|
4874
|
+
};
|
4874
4875
|
var renderDay = (item, index2) => vue.createVNode(CalendarDay, {
|
4875
4876
|
"item": item,
|
4876
4877
|
"index": index2,
|
@@ -4888,7 +4889,7 @@
|
|
4888
4889
|
getTitle,
|
4889
4890
|
getHeight: () => height2.value,
|
4890
4891
|
setVisible,
|
4891
|
-
|
4892
|
+
scrollToDate,
|
4892
4893
|
disabledDays
|
4893
4894
|
});
|
4894
4895
|
return () => vue.createVNode("div", {
|
@@ -5121,7 +5122,7 @@
|
|
5121
5122
|
months.value.some((month, index2) => {
|
5122
5123
|
if (compareMonth(month, targetDate) === 0) {
|
5123
5124
|
if (bodyRef.value) {
|
5124
|
-
monthRefs.value[index2].
|
5125
|
+
monthRefs.value[index2].scrollToDate(bodyRef.value, targetDate);
|
5125
5126
|
}
|
5126
5127
|
return true;
|
5127
5128
|
}
|
@@ -5130,7 +5131,7 @@
|
|
5130
5131
|
onScroll();
|
5131
5132
|
});
|
5132
5133
|
};
|
5133
|
-
var
|
5134
|
+
var scrollToCurrentDate = () => {
|
5134
5135
|
if (props.poppable && !props.show) {
|
5135
5136
|
return;
|
5136
5137
|
}
|
@@ -5147,7 +5148,7 @@
|
|
5147
5148
|
}
|
5148
5149
|
raf(() => {
|
5149
5150
|
bodyHeight = Math.floor(useRect(bodyRef).height);
|
5150
|
-
|
5151
|
+
scrollToCurrentDate();
|
5151
5152
|
});
|
5152
5153
|
};
|
5153
5154
|
var reset = function(date) {
|
@@ -5155,7 +5156,7 @@
|
|
5155
5156
|
date = getInitialDate();
|
5156
5157
|
}
|
5157
5158
|
currentDate.value = date;
|
5158
|
-
|
5159
|
+
scrollToCurrentDate();
|
5159
5160
|
};
|
5160
5161
|
var checkRange = (date) => {
|
5161
5162
|
var {
|
@@ -5184,11 +5185,7 @@
|
|
5184
5185
|
if (complete && props.type === "range") {
|
5185
5186
|
var valid = checkRange(date);
|
5186
5187
|
if (!valid) {
|
5187
|
-
|
5188
|
-
setCurrentDate([date[0], getDayByOffset(date[0], +props.maxRange - 1)]);
|
5189
|
-
} else {
|
5190
|
-
setCurrentDate(date);
|
5191
|
-
}
|
5188
|
+
setCurrentDate([date[0], getDayByOffset(date[0], +props.maxRange - 1)]);
|
5192
5189
|
return;
|
5193
5190
|
}
|
5194
5191
|
}
|
@@ -5321,7 +5318,7 @@
|
|
5321
5318
|
value = null;
|
5322
5319
|
}
|
5323
5320
|
currentDate.value = value;
|
5324
|
-
|
5321
|
+
scrollToCurrentDate();
|
5325
5322
|
});
|
5326
5323
|
useExpose({
|
5327
5324
|
reset,
|
@@ -6057,8 +6054,11 @@
|
|
6057
6054
|
var onTouchMove = (event) => {
|
6058
6055
|
if (props.touchable && state.swiping) {
|
6059
6056
|
touch.move(event);
|
6060
|
-
|
6057
|
+
var shouldPrevent = isCorrectDirection.value || touch.offsetY.value > touch.offsetX.value === props.vertical;
|
6058
|
+
if (shouldPrevent) {
|
6061
6059
|
preventDefault(event, props.stopPropagation);
|
6060
|
+
}
|
6061
|
+
if (isCorrectDirection.value) {
|
6062
6062
|
move({
|
6063
6063
|
offset: delta.value
|
6064
6064
|
});
|
@@ -6712,7 +6712,7 @@
|
|
6712
6712
|
return vue.createVNode(SwipeItem, {
|
6713
6713
|
"id": id,
|
6714
6714
|
"role": "tabpanel",
|
6715
|
-
"class": bem$T("
|
6715
|
+
"class": bem$T("panel-wrapper", {
|
6716
6716
|
inactive: !active.value
|
6717
6717
|
}),
|
6718
6718
|
"tabindex": active.value ? 0 : -1,
|
@@ -14814,9 +14814,11 @@
|
|
14814
14814
|
var config = isObject(to) ? to : {
|
14815
14815
|
path: to
|
14816
14816
|
};
|
14817
|
-
|
14818
|
-
|
14819
|
-
|
14817
|
+
return !!$route.matched.find((val) => {
|
14818
|
+
var pathMatched = "path" in config && config.path === val.path;
|
14819
|
+
var nameMatched = "name" in config && config.name === val.name;
|
14820
|
+
return pathMatched || nameMatched;
|
14821
|
+
});
|
14820
14822
|
}
|
14821
14823
|
return ((_props$name = props.name) != null ? _props$name : index2.value) === modelValue;
|
14822
14824
|
});
|
@@ -15183,6 +15185,7 @@
|
|
15183
15185
|
slots
|
15184
15186
|
} = _ref;
|
15185
15187
|
var inputRef = vue.ref();
|
15188
|
+
var urls = [];
|
15186
15189
|
var getDetail = function(index2) {
|
15187
15190
|
if (index2 === void 0) {
|
15188
15191
|
index2 = props.modelValue.length;
|
@@ -15289,7 +15292,13 @@
|
|
15289
15292
|
var previewImage = (item) => {
|
15290
15293
|
if (props.previewFullImage) {
|
15291
15294
|
var imageFiles = props.modelValue.filter(isImageFile);
|
15292
|
-
var images = imageFiles.map((item2) =>
|
15295
|
+
var images = imageFiles.map((item2) => {
|
15296
|
+
if (item2.file && !item2.url) {
|
15297
|
+
item2.url = URL.createObjectURL(item2.file);
|
15298
|
+
urls.push(item2.url);
|
15299
|
+
}
|
15300
|
+
return item2.url;
|
15301
|
+
}).filter(Boolean);
|
15293
15302
|
imagePreview = ImagePreview(extend({
|
15294
15303
|
images,
|
15295
15304
|
startPosition: imageFiles.indexOf(item),
|
@@ -15365,6 +15374,9 @@
|
|
15365
15374
|
inputRef.value.click();
|
15366
15375
|
}
|
15367
15376
|
};
|
15377
|
+
vue.onBeforeUnmount(() => {
|
15378
|
+
urls.forEach((url) => URL.revokeObjectURL(url));
|
15379
|
+
});
|
15368
15380
|
useExpose({
|
15369
15381
|
chooseFile,
|
15370
15382
|
closeImagePreview
|
@@ -15380,7 +15392,7 @@
|
|
15380
15392
|
}
|
15381
15393
|
});
|
15382
15394
|
var Uploader = withInstall(_Uploader);
|
15383
|
-
var version = "3.3.
|
15395
|
+
var version = "3.3.3";
|
15384
15396
|
function install(app) {
|
15385
15397
|
var components = [ActionBar, ActionBarButton, ActionBarIcon, ActionSheet, AddressEdit, AddressList, Area, Badge, Button, Calendar, Card, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Circle, Col, Collapse, CollapseItem, ConfigProvider, ContactCard, ContactEdit, ContactList, CountDown, Coupon, CouponCell, CouponList, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, Form, Grid, GridItem, Icon, Image$1, ImagePreview, IndexAnchor, IndexBar, List, Loading, Locale, NavBar, NoticeBar, Notify, NumberKeyboard, Overlay, Pagination, PasswordInput, Picker, Popover, Popup, Progress, PullRefresh, Radio, RadioGroup, Rate, Row, Search, ShareSheet, Sidebar, SidebarItem, Skeleton, Slider, Step, Stepper, Steps, Sticky, SubmitBar, Swipe, SwipeCell, SwipeItem, Switch, Tab, Tabbar, TabbarItem, Tabs, Tag, Toast, TreeSelect, Uploader];
|
15386
15398
|
components.forEach((item) => {
|