vant 3.3.6 → 3.3.7
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/badge/Badge.d.ts +12 -0
- package/es/badge/Badge.js +4 -3
- package/es/badge/index.css +1 -1
- package/es/badge/index.d.ts +8 -1
- package/es/badge/index.less +22 -1
- package/es/calendar/Calendar.d.ts +2 -2
- package/es/calendar/index.d.ts +2 -2
- package/es/datetime-picker/DatePicker.js +2 -2
- package/es/datetime-picker/TimePicker.js +2 -2
- package/es/datetime-picker/utils.d.ts +2 -0
- package/es/datetime-picker/utils.js +17 -1
- package/es/field/Field.js +5 -5
- package/es/field/utils.d.ts +2 -0
- package/es/field/utils.js +9 -0
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/pagination/Pagination.js +3 -3
- package/es/popup/Popup.d.ts +2 -2
- package/es/popup/index.d.ts +2 -2
- package/es/toast/Toast.d.ts +2 -2
- package/lib/badge/Badge.d.ts +12 -0
- package/lib/badge/Badge.js +4 -3
- package/lib/badge/index.css +1 -1
- package/lib/badge/index.d.ts +8 -1
- package/lib/badge/index.less +22 -1
- package/lib/calendar/Calendar.d.ts +2 -2
- package/lib/calendar/index.d.ts +2 -2
- package/lib/datetime-picker/DatePicker.js +1 -1
- package/lib/datetime-picker/TimePicker.js +1 -1
- package/lib/datetime-picker/utils.d.ts +2 -0
- package/lib/datetime-picker/utils.js +22 -3
- package/lib/field/Field.js +4 -4
- package/lib/field/utils.d.ts +2 -0
- package/lib/field/utils.js +13 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/pagination/Pagination.js +3 -3
- package/lib/popup/Popup.d.ts +2 -2
- package/lib/popup/index.d.ts +2 -2
- package/lib/toast/Toast.d.ts +2 -2
- package/lib/vant.cjs.js +34 -13
- package/lib/vant.cjs.min.js +1 -1
- package/lib/vant.es.js +34 -13
- package/lib/vant.es.min.js +34 -13
- package/lib/vant.js +202 -55
- package/lib/vant.min.js +1 -1
- package/package.json +14 -12
- package/vetur/attributes.json +89 -85
- package/vetur/tags.json +26 -25
- package/vetur/web-types.json +217 -207
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.7';
|
786
786
|
exports.version = version;
|
787
787
|
|
788
788
|
function install(app) {
|
@@ -127,7 +127,7 @@ var _default = (0, _vue.defineComponent)({
|
|
127
127
|
}, [(0, _vue.createVNode)("button", {
|
128
128
|
"type": "button",
|
129
129
|
"disabled": disabled,
|
130
|
-
"onClick": () => updateModelValue(modelValue - 1)
|
130
|
+
"onClick": () => updateModelValue(modelValue - 1, true)
|
131
131
|
}, [slot ? slot() : props.prevText || t('prev')])]);
|
132
132
|
};
|
133
133
|
|
@@ -147,7 +147,7 @@ var _default = (0, _vue.defineComponent)({
|
|
147
147
|
}, [(0, _vue.createVNode)("button", {
|
148
148
|
"type": "button",
|
149
149
|
"disabled": disabled,
|
150
|
-
"onClick": () => updateModelValue(modelValue + 1)
|
150
|
+
"onClick": () => updateModelValue(modelValue + 1, true)
|
151
151
|
}, [slot ? slot() : props.nextText || t('next')])]);
|
152
152
|
};
|
153
153
|
|
@@ -159,7 +159,7 @@ var _default = (0, _vue.defineComponent)({
|
|
159
159
|
}, [(0, _vue.createVNode)("button", {
|
160
160
|
"type": "button",
|
161
161
|
"aria-current": page.active || undefined,
|
162
|
-
"onClick": () => updateModelValue(page.number)
|
162
|
+
"onClick": () => updateModelValue(page.number, true)
|
163
163
|
}, [slots.page ? slots.page(page) : page.text])]));
|
164
164
|
|
165
165
|
return () => (0, _vue.createVNode)("nav", {
|
package/lib/popup/Popup.d.ts
CHANGED
@@ -114,6 +114,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
114
114
|
closeIconPosition?: unknown;
|
115
115
|
safeAreaInsetBottom?: unknown;
|
116
116
|
} & {
|
117
|
+
position: PopupPosition;
|
117
118
|
round: boolean;
|
118
119
|
safeAreaInsetBottom: boolean;
|
119
120
|
overlay: boolean;
|
@@ -122,7 +123,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
122
123
|
lazyRender: boolean;
|
123
124
|
transitionAppear: boolean;
|
124
125
|
closeOnClickOverlay: boolean;
|
125
|
-
position: PopupPosition;
|
126
126
|
closeIcon: string;
|
127
127
|
closeable: boolean;
|
128
128
|
closeOnPopstate: boolean;
|
@@ -145,6 +145,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
145
145
|
"onClick-overlay"?: ((...args: any[]) => any) | undefined;
|
146
146
|
"onClick-close-icon"?: ((...args: any[]) => any) | undefined;
|
147
147
|
}, {
|
148
|
+
position: PopupPosition;
|
148
149
|
round: boolean;
|
149
150
|
safeAreaInsetBottom: boolean;
|
150
151
|
overlay: boolean;
|
@@ -153,7 +154,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
153
154
|
lazyRender: boolean;
|
154
155
|
transitionAppear: boolean;
|
155
156
|
closeOnClickOverlay: boolean;
|
156
|
-
position: PopupPosition;
|
157
157
|
closeIcon: string;
|
158
158
|
closeable: boolean;
|
159
159
|
closeOnPopstate: boolean;
|
package/lib/popup/index.d.ts
CHANGED
@@ -65,6 +65,7 @@ export declare const Popup: import("../utils").WithInstall<import("vue").DefineC
|
|
65
65
|
closeIconPosition?: unknown;
|
66
66
|
safeAreaInsetBottom?: unknown;
|
67
67
|
} & {
|
68
|
+
position: import("./Popup").PopupPosition;
|
68
69
|
round: boolean;
|
69
70
|
safeAreaInsetBottom: boolean;
|
70
71
|
overlay: boolean;
|
@@ -73,7 +74,6 @@ export declare const Popup: import("../utils").WithInstall<import("vue").DefineC
|
|
73
74
|
lazyRender: boolean;
|
74
75
|
transitionAppear: boolean;
|
75
76
|
closeOnClickOverlay: boolean;
|
76
|
-
position: import("./Popup").PopupPosition;
|
77
77
|
closeIcon: string;
|
78
78
|
closeable: boolean;
|
79
79
|
closeOnPopstate: boolean;
|
@@ -96,6 +96,7 @@ export declare const Popup: import("../utils").WithInstall<import("vue").DefineC
|
|
96
96
|
"onClick-overlay"?: ((...args: any[]) => any) | undefined;
|
97
97
|
"onClick-close-icon"?: ((...args: any[]) => any) | undefined;
|
98
98
|
}, {
|
99
|
+
position: import("./Popup").PopupPosition;
|
99
100
|
round: boolean;
|
100
101
|
safeAreaInsetBottom: boolean;
|
101
102
|
overlay: boolean;
|
@@ -104,7 +105,6 @@ export declare const Popup: import("../utils").WithInstall<import("vue").DefineC
|
|
104
105
|
lazyRender: boolean;
|
105
106
|
transitionAppear: boolean;
|
106
107
|
closeOnClickOverlay: boolean;
|
107
|
-
position: import("./Popup").PopupPosition;
|
108
108
|
closeIcon: string;
|
109
109
|
closeable: boolean;
|
110
110
|
closeOnPopstate: boolean;
|
package/lib/toast/Toast.d.ts
CHANGED
@@ -83,11 +83,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
83
83
|
closeOnClickOverlay?: unknown;
|
84
84
|
} & {
|
85
85
|
type: ToastType;
|
86
|
+
position: ToastPosition;
|
86
87
|
overlay: boolean;
|
87
88
|
show: boolean;
|
88
89
|
duration: number;
|
89
90
|
closeOnClickOverlay: boolean;
|
90
|
-
position: ToastPosition;
|
91
91
|
transition: string;
|
92
92
|
forbidClick: boolean;
|
93
93
|
closeOnClick: boolean;
|
@@ -104,11 +104,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
104
104
|
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
105
105
|
}, {
|
106
106
|
type: ToastType;
|
107
|
+
position: ToastPosition;
|
107
108
|
overlay: boolean;
|
108
109
|
show: boolean;
|
109
110
|
duration: number;
|
110
111
|
closeOnClickOverlay: boolean;
|
111
|
-
position: ToastPosition;
|
112
112
|
transition: string;
|
113
113
|
forbidClick: boolean;
|
114
114
|
closeOnClick: boolean;
|
package/lib/vant.cjs.js
CHANGED
@@ -479,7 +479,8 @@ var badgeProps = {
|
|
479
479
|
color: String,
|
480
480
|
offset: Array,
|
481
481
|
content: numericProp,
|
482
|
-
showZero: truthProp
|
482
|
+
showZero: truthProp,
|
483
|
+
position: makeStringProp("top-right")
|
483
484
|
};
|
484
485
|
var _Badge = vue.defineComponent({
|
485
486
|
name: name$1t,
|
@@ -537,10 +538,10 @@ var _Badge = vue.defineComponent({
|
|
537
538
|
var renderBadge = () => {
|
538
539
|
if (hasContent() || props.dot) {
|
539
540
|
return vue.createVNode("div", {
|
540
|
-
"class": bem$1p({
|
541
|
+
"class": bem$1p([props.position, {
|
541
542
|
dot: props.dot,
|
542
543
|
fixed: !!slots.default
|
543
|
-
}),
|
544
|
+
}]),
|
544
545
|
"style": style.value
|
545
546
|
}, [renderContent()]);
|
546
547
|
}
|
@@ -2556,6 +2557,12 @@ function mapInputType(type) {
|
|
2556
2557
|
type
|
2557
2558
|
};
|
2558
2559
|
}
|
2560
|
+
function getStringLength(str) {
|
2561
|
+
return [...str].length;
|
2562
|
+
}
|
2563
|
+
function cutString(str, maxlength) {
|
2564
|
+
return [...str].slice(0, maxlength).join("");
|
2565
|
+
}
|
2559
2566
|
var current = 0;
|
2560
2567
|
function useId() {
|
2561
2568
|
var vm = vue.getCurrentInstance();
|
@@ -2730,12 +2737,12 @@ var _Field = vue.defineComponent({
|
|
2730
2737
|
var {
|
2731
2738
|
maxlength
|
2732
2739
|
} = props;
|
2733
|
-
if (isDef(maxlength) && value
|
2740
|
+
if (isDef(maxlength) && getStringLength(value) > maxlength) {
|
2734
2741
|
var modelValue = getModelValue();
|
2735
|
-
if (modelValue && modelValue
|
2742
|
+
if (modelValue && getStringLength(modelValue) === +maxlength) {
|
2736
2743
|
return modelValue;
|
2737
2744
|
}
|
2738
|
-
return value
|
2745
|
+
return cutString(value, +maxlength);
|
2739
2746
|
}
|
2740
2747
|
return value;
|
2741
2748
|
};
|
@@ -2899,7 +2906,7 @@ var _Field = vue.defineComponent({
|
|
2899
2906
|
};
|
2900
2907
|
var renderWordLimit = () => {
|
2901
2908
|
if (props.showWordLimit && props.maxlength) {
|
2902
|
-
var count = getModelValue()
|
2909
|
+
var count = getStringLength(getModelValue());
|
2903
2910
|
return vue.createVNode("div", {
|
2904
2911
|
"class": bem$1a("word-limit")
|
2905
2912
|
}, [vue.createVNode("span", {
|
@@ -4225,6 +4232,20 @@ function getTrueValue(value) {
|
|
4225
4232
|
return parseInt(value, 10);
|
4226
4233
|
}
|
4227
4234
|
var getMonthEndDay = (year, month) => 32 - new Date(year, month - 1, 32).getDate();
|
4235
|
+
var proxyPickerMethods = (picker, callback) => {
|
4236
|
+
var methods = ["setValues", "setIndexes", "setColumnIndex", "setColumnValue"];
|
4237
|
+
return new Proxy(picker, {
|
4238
|
+
get: (target, prop) => {
|
4239
|
+
if (methods.includes(prop)) {
|
4240
|
+
return function() {
|
4241
|
+
target[prop](...arguments);
|
4242
|
+
callback();
|
4243
|
+
};
|
4244
|
+
}
|
4245
|
+
return target[prop];
|
4246
|
+
}
|
4247
|
+
});
|
4248
|
+
};
|
4228
4249
|
var useHeight = (element) => {
|
4229
4250
|
var height = vue.ref();
|
4230
4251
|
vue.onMounted(() => vue.nextTick(() => {
|
@@ -7959,7 +7980,7 @@ var TimePicker = vue.defineComponent({
|
|
7959
7980
|
}
|
7960
7981
|
});
|
7961
7982
|
useExpose({
|
7962
|
-
getPicker: () => picker.value
|
7983
|
+
getPicker: () => picker.value && proxyPickerMethods(picker.value, updateInnerValue)
|
7963
7984
|
});
|
7964
7985
|
return () => vue.createVNode(Picker, vue.mergeProps({
|
7965
7986
|
"ref": picker,
|
@@ -8202,7 +8223,7 @@ var DatePicker = vue.defineComponent({
|
|
8202
8223
|
}
|
8203
8224
|
});
|
8204
8225
|
useExpose({
|
8205
|
-
getPicker: () => picker.value
|
8226
|
+
getPicker: () => picker.value && proxyPickerMethods(picker.value, updateInnerValue)
|
8206
8227
|
});
|
8207
8228
|
return () => vue.createVNode(Picker, vue.mergeProps({
|
8208
8229
|
"ref": picker,
|
@@ -11642,7 +11663,7 @@ var _Pagination = vue.defineComponent({
|
|
11642
11663
|
}, [vue.createVNode("button", {
|
11643
11664
|
"type": "button",
|
11644
11665
|
"disabled": disabled,
|
11645
|
-
"onClick": () => updateModelValue(modelValue - 1)
|
11666
|
+
"onClick": () => updateModelValue(modelValue - 1, true)
|
11646
11667
|
}, [slot ? slot() : props.prevText || t$5("prev")])]);
|
11647
11668
|
};
|
11648
11669
|
var renderNextButton = () => {
|
@@ -11661,7 +11682,7 @@ var _Pagination = vue.defineComponent({
|
|
11661
11682
|
}, [vue.createVNode("button", {
|
11662
11683
|
"type": "button",
|
11663
11684
|
"disabled": disabled,
|
11664
|
-
"onClick": () => updateModelValue(modelValue + 1)
|
11685
|
+
"onClick": () => updateModelValue(modelValue + 1, true)
|
11665
11686
|
}, [slot ? slot() : props.nextText || t$5("next")])]);
|
11666
11687
|
};
|
11667
11688
|
var renderPages = () => pages.value.map((page) => vue.createVNode("li", {
|
@@ -11672,7 +11693,7 @@ var _Pagination = vue.defineComponent({
|
|
11672
11693
|
}, [vue.createVNode("button", {
|
11673
11694
|
"type": "button",
|
11674
11695
|
"aria-current": page.active || void 0,
|
11675
|
-
"onClick": () => updateModelValue(page.number)
|
11696
|
+
"onClick": () => updateModelValue(page.number, true)
|
11676
11697
|
}, [slots.page ? slots.page(page) : page.text])]));
|
11677
11698
|
return () => vue.createVNode("nav", {
|
11678
11699
|
"role": "navigation",
|
@@ -14311,7 +14332,7 @@ var _Uploader = vue.defineComponent({
|
|
14311
14332
|
}
|
14312
14333
|
});
|
14313
14334
|
var Uploader = withInstall(_Uploader);
|
14314
|
-
var version = "3.3.
|
14335
|
+
var version = "3.3.7";
|
14315
14336
|
function install(app) {
|
14316
14337
|
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];
|
14317
14338
|
components.forEach((item) => {
|