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/index.d.ts
CHANGED
package/lib/index.js
CHANGED
@@ -782,7 +782,7 @@ Object.keys(_uploader).forEach(function (key) {
|
|
782
782
|
if (key in exports && exports[key] === _uploader[key]) return;
|
783
783
|
exports[key] = _uploader[key];
|
784
784
|
});
|
785
|
-
var version = '3.3.
|
785
|
+
var version = '3.3.3';
|
786
786
|
exports.version = version;
|
787
787
|
|
788
788
|
function install(app) {
|
@@ -0,0 +1,73 @@
|
|
1
|
+
declare const _default: {
|
2
|
+
name: string;
|
3
|
+
tel: string;
|
4
|
+
save: string;
|
5
|
+
confirm: string;
|
6
|
+
cancel: string;
|
7
|
+
delete: string;
|
8
|
+
loading: string;
|
9
|
+
noCoupon: string;
|
10
|
+
nameEmpty: string;
|
11
|
+
telInvalid: string;
|
12
|
+
vanCalendar: {
|
13
|
+
end: string;
|
14
|
+
start: string;
|
15
|
+
title: string;
|
16
|
+
startEnd: string;
|
17
|
+
weekdays: string[];
|
18
|
+
monthTitle: (year: number, month: number) => string;
|
19
|
+
rangePrompt: (maxRange: number) => string;
|
20
|
+
};
|
21
|
+
vanCascader: {
|
22
|
+
select: string;
|
23
|
+
};
|
24
|
+
vanContactCard: {
|
25
|
+
addText: string;
|
26
|
+
};
|
27
|
+
vanContactList: {
|
28
|
+
addText: string;
|
29
|
+
};
|
30
|
+
vanPagination: {
|
31
|
+
prev: string;
|
32
|
+
next: string;
|
33
|
+
};
|
34
|
+
vanPullRefresh: {
|
35
|
+
pulling: string;
|
36
|
+
loosing: string;
|
37
|
+
};
|
38
|
+
vanSubmitBar: {
|
39
|
+
label: string;
|
40
|
+
};
|
41
|
+
vanCoupon: {
|
42
|
+
unlimited: string;
|
43
|
+
discount: (discount: number) => string;
|
44
|
+
condition: (condition: number) => string;
|
45
|
+
};
|
46
|
+
vanCouponCell: {
|
47
|
+
title: string;
|
48
|
+
count: (count: number) => string;
|
49
|
+
};
|
50
|
+
vanCouponList: {
|
51
|
+
exchange: string;
|
52
|
+
close: string;
|
53
|
+
enable: string;
|
54
|
+
disabled: string;
|
55
|
+
placeholder: string;
|
56
|
+
};
|
57
|
+
vanAddressEdit: {
|
58
|
+
area: string;
|
59
|
+
postal: string;
|
60
|
+
areaEmpty: string;
|
61
|
+
addressEmpty: string;
|
62
|
+
postalEmpty: string;
|
63
|
+
defaultAddress: string;
|
64
|
+
};
|
65
|
+
vanAddressEditDetail: {
|
66
|
+
label: string;
|
67
|
+
placeholder: string;
|
68
|
+
};
|
69
|
+
vanAddressList: {
|
70
|
+
add: string;
|
71
|
+
};
|
72
|
+
};
|
73
|
+
export default _default;
|
@@ -0,0 +1,77 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports.default = void 0;
|
5
|
+
var _default = {
|
6
|
+
name: 'Nome',
|
7
|
+
tel: 'Fone',
|
8
|
+
save: 'Salvar',
|
9
|
+
confirm: 'Confirmar',
|
10
|
+
cancel: 'Cancelar',
|
11
|
+
delete: 'Excluir',
|
12
|
+
loading: 'Carregando...',
|
13
|
+
noCoupon: 'Nenhum cupom',
|
14
|
+
nameEmpty: 'Por favor, preencha o nome',
|
15
|
+
telInvalid: 'Telefone em formato inválido',
|
16
|
+
vanCalendar: {
|
17
|
+
end: 'Fim',
|
18
|
+
start: 'Início',
|
19
|
+
title: 'Calendário',
|
20
|
+
startEnd: 'Início/Fim',
|
21
|
+
weekdays: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'],
|
22
|
+
monthTitle: (year, month) => month + "/" + year,
|
23
|
+
rangePrompt: maxRange => "Escolha no m\xE1ximo " + maxRange + " dias"
|
24
|
+
},
|
25
|
+
vanCascader: {
|
26
|
+
select: 'Selecione'
|
27
|
+
},
|
28
|
+
vanContactCard: {
|
29
|
+
addText: 'Adicionar informações de contato'
|
30
|
+
},
|
31
|
+
vanContactList: {
|
32
|
+
addText: 'Adicionar novo contato'
|
33
|
+
},
|
34
|
+
vanPagination: {
|
35
|
+
prev: 'Anterior',
|
36
|
+
next: 'Próximo'
|
37
|
+
},
|
38
|
+
vanPullRefresh: {
|
39
|
+
pulling: 'Puxe para atualizar...',
|
40
|
+
loosing: 'Solte para atualizar...'
|
41
|
+
},
|
42
|
+
vanSubmitBar: {
|
43
|
+
label: 'Total:'
|
44
|
+
},
|
45
|
+
vanCoupon: {
|
46
|
+
unlimited: 'Ilimitado',
|
47
|
+
discount: discount => discount * 10 + "% de desconto",
|
48
|
+
condition: condition => "Pelo menos " + condition
|
49
|
+
},
|
50
|
+
vanCouponCell: {
|
51
|
+
title: 'Cupom',
|
52
|
+
count: count => "Voc\xEA possui " + count + " cupom(ns)"
|
53
|
+
},
|
54
|
+
vanCouponList: {
|
55
|
+
exchange: 'Usar',
|
56
|
+
close: 'Fechar',
|
57
|
+
enable: 'Disponível',
|
58
|
+
disabled: 'Indisponível',
|
59
|
+
placeholder: 'Código do cupom'
|
60
|
+
},
|
61
|
+
vanAddressEdit: {
|
62
|
+
area: 'Área',
|
63
|
+
postal: 'CEP',
|
64
|
+
areaEmpty: 'Por favor, selecione uma área de recebimento',
|
65
|
+
addressEmpty: 'Endereço não pode ser vazio',
|
66
|
+
postalEmpty: 'CEP inválido',
|
67
|
+
defaultAddress: 'Usar como endereço padrão'
|
68
|
+
},
|
69
|
+
vanAddressEditDetail: {
|
70
|
+
label: 'Endereço',
|
71
|
+
placeholder: 'Endereço'
|
72
|
+
},
|
73
|
+
vanAddressList: {
|
74
|
+
add: 'Adicionar novo endereço'
|
75
|
+
}
|
76
|
+
};
|
77
|
+
exports.default = _default;
|
package/lib/swipe/Swipe.js
CHANGED
@@ -270,10 +270,16 @@ var _default = (0, _vue.defineComponent)({
|
|
270
270
|
|
271
271
|
var onTouchMove = event => {
|
272
272
|
if (props.touchable && state.swiping) {
|
273
|
-
touch.move(event);
|
273
|
+
touch.move(event); // if user starting to touchmove, prevent the event bubbling to
|
274
|
+
// avoid affecting the parent components
|
274
275
|
|
275
|
-
|
276
|
+
var shouldPrevent = isCorrectDirection.value || touch.offsetY.value > touch.offsetX.value === props.vertical;
|
277
|
+
|
278
|
+
if (shouldPrevent) {
|
276
279
|
(0, _utils.preventDefault)(event, props.stopPropagation);
|
280
|
+
}
|
281
|
+
|
282
|
+
if (isCorrectDirection.value) {
|
277
283
|
move({
|
278
284
|
offset: delta.value
|
279
285
|
});
|
package/lib/swipe/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:root{--van-swipe-indicator-size:6px;--van-swipe-indicator-margin:var(--van-padding-sm);--van-swipe-indicator-active-opacity:1;--van-swipe-indicator-inactive-opacity:0.3;--van-swipe-indicator-active-background-color:var(--van-primary-color);--van-swipe-indicator-inactive-background-color:var(--van-border-color)}.van-swipe{position:relative;overflow:hidden;cursor:-webkit-grab;cursor:grab;-webkit-user-select:none;user-select:none}.van-swipe__track{display:flex;height:100%}.van-swipe__track--vertical{flex-direction:column}.van-swipe__indicators{position:absolute;bottom:var(--van-swipe-indicator-margin);left:50%;display:flex;transform:translateX(-50%)}.van-swipe__indicators--vertical{top:50%;bottom:auto;left:var(--van-swipe-indicator-margin);flex-direction:column;transform:translateY(-50%)}.van-swipe__indicators--vertical .van-swipe__indicator:not(:last-child){margin-bottom:var(--van-swipe-indicator-size)}.van-swipe__indicator{width:var(--van-swipe-indicator-size);height:var(--van-swipe-indicator-size);background-color:var(--van-swipe-indicator-inactive-background-color);border-radius:100%;opacity:var(--van-swipe-indicator-inactive-opacity);transition:opacity var(--van-animation-duration-fast),background-color var(--van-animation-duration-fast)}.van-swipe__indicator:not(:last-child){margin-right:var(--van-swipe-indicator-size)}.van-swipe__indicator--active{background-color:var(--van-swipe-indicator-active-background-color);opacity:var(--van-swipe-indicator-active-opacity)}
|
1
|
+
:root{--van-swipe-indicator-size:6px;--van-swipe-indicator-margin:var(--van-padding-sm);--van-swipe-indicator-active-opacity:1;--van-swipe-indicator-inactive-opacity:0.3;--van-swipe-indicator-active-background-color:var(--van-primary-color);--van-swipe-indicator-inactive-background-color:var(--van-border-color)}.van-swipe{position:relative;overflow:hidden;transform:translateZ(0);cursor:-webkit-grab;cursor:grab;-webkit-user-select:none;user-select:none}.van-swipe__track{display:flex;height:100%}.van-swipe__track--vertical{flex-direction:column}.van-swipe__indicators{position:absolute;bottom:var(--van-swipe-indicator-margin);left:50%;display:flex;transform:translateX(-50%)}.van-swipe__indicators--vertical{top:50%;bottom:auto;left:var(--van-swipe-indicator-margin);flex-direction:column;transform:translateY(-50%)}.van-swipe__indicators--vertical .van-swipe__indicator:not(:last-child){margin-bottom:var(--van-swipe-indicator-size)}.van-swipe__indicator{width:var(--van-swipe-indicator-size);height:var(--van-swipe-indicator-size);background-color:var(--van-swipe-indicator-inactive-background-color);border-radius:100%;opacity:var(--van-swipe-indicator-inactive-opacity);transition:opacity var(--van-animation-duration-fast),background-color var(--van-animation-duration-fast)}.van-swipe__indicator:not(:last-child){margin-right:var(--van-swipe-indicator-size)}.van-swipe__indicator--active{background-color:var(--van-swipe-indicator-active-background-color);opacity:var(--van-swipe-indicator-active-opacity)}
|
package/lib/swipe/index.less
CHANGED
package/lib/tab/Tab.js
CHANGED
@@ -108,7 +108,7 @@ var _default = (0, _vue.defineComponent)({
|
|
108
108
|
return (0, _vue.createVNode)(_swipeItem.SwipeItem, {
|
109
109
|
"id": id,
|
110
110
|
"role": "tabpanel",
|
111
|
-
"class": bem('
|
111
|
+
"class": bem('panel-wrapper', {
|
112
112
|
inactive: !active.value
|
113
113
|
}),
|
114
114
|
"tabindex": active.value ? 0 : -1,
|
@@ -72,9 +72,11 @@ var _default = (0, _vue.defineComponent)({
|
|
72
72
|
var config = (0, _utils.isObject)(to) ? to : {
|
73
73
|
path: to
|
74
74
|
};
|
75
|
-
|
76
|
-
|
77
|
-
|
75
|
+
return !!$route.matched.find(val => {
|
76
|
+
var pathMatched = 'path' in config && config.path === val.path;
|
77
|
+
var nameMatched = 'name' in config && config.name === val.name;
|
78
|
+
return pathMatched || nameMatched;
|
79
|
+
});
|
78
80
|
}
|
79
81
|
|
80
82
|
return ((_props$name = props.name) != null ? _props$name : index.value) === modelValue;
|
package/lib/uploader/Uploader.js
CHANGED
@@ -64,6 +64,7 @@ var _default = (0, _vue.defineComponent)({
|
|
64
64
|
slots
|
65
65
|
} = _ref;
|
66
66
|
var inputRef = (0, _vue.ref)();
|
67
|
+
var urls = [];
|
67
68
|
|
68
69
|
var getDetail = function (index) {
|
69
70
|
if (index === void 0) {
|
@@ -196,7 +197,14 @@ var _default = (0, _vue.defineComponent)({
|
|
196
197
|
var previewImage = item => {
|
197
198
|
if (props.previewFullImage) {
|
198
199
|
var imageFiles = props.modelValue.filter(_utils2.isImageFile);
|
199
|
-
var images = imageFiles.map(item =>
|
200
|
+
var images = imageFiles.map(item => {
|
201
|
+
if (item.file && !item.url) {
|
202
|
+
item.url = URL.createObjectURL(item.file);
|
203
|
+
urls.push(item.url);
|
204
|
+
}
|
205
|
+
|
206
|
+
return item.url;
|
207
|
+
}).filter(Boolean);
|
200
208
|
imagePreview = (0, _imagePreview.ImagePreview)((0, _utils.extend)({
|
201
209
|
images,
|
202
210
|
startPosition: imageFiles.indexOf(item),
|
@@ -283,6 +291,9 @@ var _default = (0, _vue.defineComponent)({
|
|
283
291
|
}
|
284
292
|
};
|
285
293
|
|
294
|
+
(0, _vue.onBeforeUnmount)(() => {
|
295
|
+
urls.forEach(url => URL.revokeObjectURL(url));
|
296
|
+
});
|
286
297
|
(0, _useExpose.useExpose)({
|
287
298
|
chooseFile,
|
288
299
|
closeImagePreview
|