vant 4.0.11 → 4.1.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/README.md +7 -3
- package/es/area/utils.mjs +2 -2
- package/es/back-top/BackTop.mjs +1 -1
- package/es/badge/Badge.mjs +1 -1
- package/es/button/Button.d.ts +1 -1
- package/es/button/index.d.ts +1 -1
- package/es/calendar/Calendar.mjs +2 -2
- package/es/calendar/utils.mjs +1 -1
- package/es/checkbox/Checkbox.mjs +1 -1
- package/es/date-picker/DatePicker.mjs +1 -1
- package/es/divider/Divider.d.ts +1 -1
- package/es/divider/index.d.ts +1 -1
- package/es/dropdown-item/DropdownItem.mjs +1 -0
- package/es/dropdown-menu/DropdownMenu.mjs +2 -2
- package/es/dropdown-menu/types.d.ts +1 -0
- package/es/field/Field.mjs +2 -2
- package/es/field/index.css +1 -1
- package/es/field/index.d.ts +1 -1
- package/es/field/types.d.ts +2 -2
- package/es/grid-item/GridItem.mjs +1 -1
- package/es/image-preview/ImagePreviewItem.mjs +3 -2
- package/es/index.d.ts +2 -1
- package/es/index.mjs +4 -1
- package/es/lazyload/vue-lazyload/index.mjs +5 -0
- package/es/lazyload/vue-lazyload/lazy-image.mjs +0 -1
- package/es/lazyload/vue-lazyload/lazy.mjs +81 -0
- package/es/lazyload/vue-lazyload/listener.mjs +45 -0
- package/es/list/List.mjs +3 -2
- package/es/locale/lang/uk-UA.mjs +15 -15
- package/es/number-keyboard/NumberKeyboard.mjs +1 -1
- package/es/password-input/PasswordInput.mjs +1 -1
- package/es/picker/Picker.mjs +1 -0
- package/es/popup/shared.mjs +12 -0
- package/es/progress/Progress.mjs +1 -1
- package/es/search/Search.mjs +4 -4
- package/es/slider/Slider.d.ts +1 -1
- package/es/slider/index.d.ts +1 -1
- package/es/stepper/Stepper.mjs +2 -2
- package/es/sticky/Sticky.mjs +2 -0
- package/es/swipe/Swipe.mjs +9 -4
- package/es/tabs/Tabs.mjs +1 -1
- package/es/tag/Tag.d.ts +1 -1
- package/es/tag/index.d.ts +1 -1
- package/es/text-ellipsis/TextEllipsis.d.ts +63 -0
- package/es/text-ellipsis/TextEllipsis.mjs +108 -0
- package/es/text-ellipsis/index.css +1 -0
- package/es/text-ellipsis/index.d.ts +51 -0
- package/es/text-ellipsis/index.mjs +10 -0
- package/es/text-ellipsis/style/index.d.ts +1 -0
- package/es/text-ellipsis/style/index.mjs +2 -0
- package/es/text-ellipsis/types.d.ts +3 -0
- package/es/text-ellipsis/types.mjs +0 -0
- package/es/tree-select/TreeSelect.mjs +4 -3
- package/es/uploader/Uploader.mjs +1 -1
- package/es/uploader/utils.mjs +2 -2
- package/lib/action-bar/index.js +4 -0
- package/lib/action-bar-button/index.js +4 -0
- package/lib/action-bar-icon/index.js +4 -0
- package/lib/action-sheet/index.js +4 -0
- package/lib/address-edit/AddressEdit.js +4 -0
- package/lib/address-edit/index.js +4 -0
- package/lib/address-list/AddressList.js +4 -0
- package/lib/address-list/index.js +4 -0
- package/lib/area/index.js +4 -0
- package/lib/area/utils.js +2 -2
- package/lib/back-top/BackTop.js +1 -1
- package/lib/back-top/index.js +4 -0
- package/lib/badge/Badge.js +1 -1
- package/lib/badge/index.js +4 -0
- package/lib/button/Button.d.ts +1 -1
- package/lib/button/index.d.ts +1 -1
- package/lib/button/index.js +4 -0
- package/lib/calendar/Calendar.js +6 -2
- package/lib/calendar/CalendarMonth.js +4 -0
- package/lib/calendar/index.js +4 -0
- package/lib/calendar/utils.js +1 -1
- package/lib/card/index.js +4 -0
- package/lib/cascader/index.js +4 -0
- package/lib/cell/index.js +4 -0
- package/lib/cell-group/index.js +4 -0
- package/lib/checkbox/Checkbox.js +5 -1
- package/lib/checkbox/index.js +4 -0
- package/lib/checkbox-group/index.js +4 -0
- package/lib/circle/index.js +4 -0
- package/lib/col/index.js +4 -0
- package/lib/collapse/index.js +4 -0
- package/lib/collapse-item/index.js +4 -0
- package/lib/config-provider/index.js +4 -0
- package/lib/contact-card/index.js +4 -0
- package/lib/contact-edit/index.js +4 -0
- package/lib/contact-list/index.js +4 -0
- package/lib/count-down/index.js +4 -0
- package/lib/coupon/index.js +4 -0
- package/lib/coupon-cell/index.js +4 -0
- package/lib/coupon-list/index.js +4 -0
- package/lib/date-picker/DatePicker.js +1 -1
- package/lib/date-picker/index.js +4 -0
- package/lib/dialog/function-call.js +4 -0
- package/lib/dialog/index.js +4 -0
- package/lib/divider/Divider.d.ts +1 -1
- package/lib/divider/index.d.ts +1 -1
- package/lib/divider/index.js +4 -0
- package/lib/dropdown-item/DropdownItem.js +1 -0
- package/lib/dropdown-item/index.js +4 -0
- package/lib/dropdown-menu/DropdownMenu.js +2 -2
- package/lib/dropdown-menu/index.js +4 -0
- package/lib/dropdown-menu/types.d.ts +1 -0
- package/lib/empty/index.js +4 -0
- package/lib/field/Field.js +2 -2
- package/lib/field/index.css +1 -1
- package/lib/field/index.d.ts +1 -1
- package/lib/field/index.js +4 -0
- package/lib/field/types.d.ts +2 -2
- package/lib/form/index.js +4 -0
- package/lib/grid/index.js +4 -0
- package/lib/grid-item/GridItem.js +1 -1
- package/lib/grid-item/index.js +4 -0
- package/lib/icon/index.js +4 -0
- package/lib/image/index.js +4 -0
- package/lib/image-preview/ImagePreview.js +4 -0
- package/lib/image-preview/ImagePreviewItem.js +3 -2
- package/lib/image-preview/function-call.js +4 -0
- package/lib/image-preview/index.js +4 -0
- package/lib/index-anchor/index.js +4 -0
- package/lib/index-bar/index.js +4 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +4 -1
- package/lib/lazyload/vue-lazyload/index.js +9 -0
- package/lib/lazyload/vue-lazyload/lazy-image.js +0 -1
- package/lib/lazyload/vue-lazyload/lazy.js +85 -0
- package/lib/lazyload/vue-lazyload/listener.js +45 -0
- package/lib/list/List.js +3 -2
- package/lib/list/index.js +4 -0
- package/lib/loading/index.js +4 -0
- package/lib/locale/index.js +4 -0
- package/lib/locale/lang/uk-UA.js +15 -15
- package/lib/nav-bar/index.js +4 -0
- package/lib/notice-bar/index.js +4 -0
- package/lib/notify/function-call.js +4 -0
- package/lib/notify/index.js +4 -0
- package/lib/number-keyboard/NumberKeyboard.js +5 -1
- package/lib/number-keyboard/index.js +4 -0
- package/lib/overlay/index.js +4 -0
- package/lib/pagination/index.js +4 -0
- package/lib/password-input/PasswordInput.js +1 -1
- package/lib/password-input/index.js +4 -0
- package/lib/picker/Picker.js +5 -0
- package/lib/picker/index.js +4 -0
- package/lib/picker-group/PickerGroup.js +4 -0
- package/lib/picker-group/index.js +4 -0
- package/lib/popover/index.js +4 -0
- package/lib/popup/index.js +4 -0
- package/lib/popup/shared.js +12 -0
- package/lib/progress/Progress.js +1 -1
- package/lib/progress/index.js +4 -0
- package/lib/pull-refresh/index.js +4 -0
- package/lib/radio/Radio.js +4 -0
- package/lib/radio/index.js +4 -0
- package/lib/radio-group/index.js +4 -0
- package/lib/rate/index.js +4 -0
- package/lib/row/index.js +4 -0
- package/lib/search/Search.js +4 -4
- package/lib/search/index.js +4 -0
- package/lib/share-sheet/index.js +4 -0
- package/lib/sidebar/index.js +4 -0
- package/lib/sidebar-item/index.js +4 -0
- package/lib/skeleton/Skeleton.js +4 -0
- package/lib/skeleton/index.js +4 -0
- package/lib/skeleton-avatar/index.js +4 -0
- package/lib/skeleton-image/index.js +4 -0
- package/lib/skeleton-paragraph/index.js +4 -0
- package/lib/skeleton-title/index.js +4 -0
- package/lib/slider/Slider.d.ts +1 -1
- package/lib/slider/index.d.ts +1 -1
- package/lib/slider/index.js +4 -0
- package/lib/space/index.js +4 -0
- package/lib/step/index.js +4 -0
- package/lib/stepper/Stepper.js +2 -2
- package/lib/stepper/index.js +4 -0
- package/lib/steps/index.js +4 -0
- package/lib/sticky/Sticky.js +2 -0
- package/lib/sticky/index.js +4 -0
- package/lib/submit-bar/index.js +4 -0
- package/lib/swipe/Swipe.js +9 -4
- package/lib/swipe/index.js +4 -0
- package/lib/swipe-cell/index.js +4 -0
- package/lib/swipe-item/index.js +4 -0
- package/lib/switch/index.js +4 -0
- package/lib/tab/index.js +4 -0
- package/lib/tabbar/index.js +4 -0
- package/lib/tabbar-item/index.js +4 -0
- package/lib/tabs/Tabs.js +5 -1
- package/lib/tabs/index.js +4 -0
- package/lib/tag/Tag.d.ts +1 -1
- package/lib/tag/index.d.ts +1 -1
- package/lib/tag/index.js +4 -0
- package/lib/text-ellipsis/TextEllipsis.d.ts +63 -0
- package/lib/text-ellipsis/TextEllipsis.js +127 -0
- package/lib/text-ellipsis/index.css +1 -0
- package/lib/text-ellipsis/index.d.ts +51 -0
- package/lib/text-ellipsis/index.js +39 -0
- package/lib/text-ellipsis/style/index.d.ts +1 -0
- package/lib/text-ellipsis/style/index.js +2 -0
- package/lib/text-ellipsis/types.d.ts +3 -0
- package/lib/text-ellipsis/types.js +15 -0
- package/lib/time-picker/index.js +4 -0
- package/lib/toast/function-call.js +4 -0
- package/lib/toast/index.js +4 -0
- package/lib/tree-select/TreeSelect.js +4 -3
- package/lib/tree-select/index.js +4 -0
- package/lib/uploader/Uploader.js +5 -1
- package/lib/uploader/index.js +4 -0
- package/lib/uploader/utils.js +2 -2
- package/lib/utils/create.js +4 -0
- package/lib/vant.cjs.js +1130 -872
- package/lib/vant.es.js +1130 -872
- package/lib/vant.js +1167 -879
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +5 -5
package/es/locale/lang/uk-UA.mjs
CHANGED
@@ -2,7 +2,7 @@ var stdin_default = {
|
|
2
2
|
name: "\u0406\u043C'\u044F",
|
3
3
|
tel: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D",
|
4
4
|
save: "\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438",
|
5
|
-
confirm: "\
|
5
|
+
confirm: "\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438",
|
6
6
|
cancel: "\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438",
|
7
7
|
delete: "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438",
|
8
8
|
loading: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F...",
|
@@ -12,30 +12,30 @@ var stdin_default = {
|
|
12
12
|
telInvalid: "\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0443",
|
13
13
|
vanCalendar: {
|
14
14
|
end: "\u041A\u0456\u043D\u0435\u0446\u044C",
|
15
|
-
start: "\u041F\u043E\u0447\u0430\u0442\
|
15
|
+
start: "\u041F\u043E\u0447\u0430\u0442\u043E\u043A",
|
16
16
|
title: "\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440",
|
17
17
|
weekdays: [
|
18
|
-
"\
|
19
|
-
"\
|
20
|
-
"\
|
21
|
-
"\
|
22
|
-
"\
|
23
|
-
"\
|
24
|
-
"\
|
18
|
+
"\u041D\u0434",
|
19
|
+
"\u041F\u043D",
|
20
|
+
"\u0412\u0442",
|
21
|
+
"\u0421\u0440",
|
22
|
+
"\u0427\u0442",
|
23
|
+
"\u041F\u0442",
|
24
|
+
"\u0421\u0431"
|
25
25
|
],
|
26
26
|
monthTitle: (year, month) => `${year}/${month}`,
|
27
|
-
rangePrompt: (maxRange) => `\
|
27
|
+
rangePrompt: (maxRange) => `\u041E\u0431\u0435\u0440\u0456\u0442\u044C \u043D\u0435 \u0431\u0456\u043B\u044C\u0448\u0435 \u043D\u0456\u0436 ${maxRange} \u0434\u043D\u0456\u0432`
|
28
28
|
},
|
29
29
|
vanCascader: {
|
30
|
-
select: "\
|
30
|
+
select: "\u041E\u0431\u0440\u0430\u0442\u0438"
|
31
31
|
},
|
32
32
|
vanPagination: {
|
33
|
-
prev: "\u041F\u043E\
|
33
|
+
prev: "\u041F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u0438\u0441\u044F",
|
34
34
|
next: "\u0414\u0430\u043B\u0456"
|
35
35
|
},
|
36
36
|
vanPullRefresh: {
|
37
37
|
pulling: "\u041F\u043E\u0442\u044F\u0433\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043E\u043D\u043E\u0432\u0438\u0442\u0438...",
|
38
|
-
loosing: "\
|
38
|
+
loosing: "\u0412\u0456\u0434\u043F\u0443\u0441\u0442\u0456\u0442\u044C, \u0449\u043E\u0431 \u043E\u043D\u043E\u0432\u0438\u0442\u0438..."
|
39
39
|
},
|
40
40
|
vanSubmitBar: {
|
41
41
|
label: "\u0423\u0441\u044C\u043E\u0433\u043E:"
|
@@ -54,11 +54,11 @@ var stdin_default = {
|
|
54
54
|
close: "\u0417\u0430\u043A\u0440\u0438\u0442\u0438",
|
55
55
|
enable: "\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u043E",
|
56
56
|
disabled: "\u041D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E",
|
57
|
-
placeholder: "\u041A\u043E\u0434 \u043A\u0443\u043F\u043E\u043D\
|
57
|
+
placeholder: "\u041A\u043E\u0434 \u043A\u0443\u043F\u043E\u043D\u0443"
|
58
58
|
},
|
59
59
|
vanAddressEdit: {
|
60
60
|
area: "\u041E\u0431\u043B\u0430\u0441\u0442\u044C",
|
61
|
-
areaEmpty: "\u0411\u0443\u0434\u044C \u043B\u0430\u0441\u043A\u0430, \
|
61
|
+
areaEmpty: "\u0411\u0443\u0434\u044C \u043B\u0430\u0441\u043A\u0430, \u043E\u0431\u0435\u0440\u0456\u0442\u044C \u0437\u043E\u043D\u0443 \u043F\u0440\u0438\u0439\u043E\u043C\u0443",
|
62
62
|
addressEmpty: "\u0410\u0434\u0440\u0435\u0441\u0430 \u043D\u0435 \u043C\u043E\u0436\u0435 \u0431\u0443\u0442\u0438 \u043F\u043E\u0440\u043E\u0436\u043D\u044C\u043E\u044E",
|
63
63
|
addressDetail: "\u0410\u0434\u0440\u0435\u0441\u0430",
|
64
64
|
defaultAddress: "\u0412\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0438 \u044F\u043A \u0430\u0434\u0440\u0435\u0441\u0443 \u0437\u0430 \u0437\u0430\u043C\u043E\u0432\u0447\u0443\u0432\u0430\u043D\u043D\u044F\u043C"
|
@@ -117,7 +117,7 @@ var stdin_default = defineComponent({
|
|
117
117
|
emit("update:modelValue", value.slice(0, value.length - 1));
|
118
118
|
} else if (type === "close") {
|
119
119
|
onClose();
|
120
|
-
} else if (value.length < props.maxlength) {
|
120
|
+
} else if (value.length < +props.maxlength) {
|
121
121
|
emit("input", text);
|
122
122
|
emit("update:modelValue", value + text);
|
123
123
|
}
|
@@ -27,10 +27,10 @@ var stdin_default = defineComponent({
|
|
27
27
|
const {
|
28
28
|
mask,
|
29
29
|
value,
|
30
|
-
length,
|
31
30
|
gutter,
|
32
31
|
focused
|
33
32
|
} = props;
|
33
|
+
const length = +props.length;
|
34
34
|
for (let i = 0; i < length; i++) {
|
35
35
|
const char = value[i];
|
36
36
|
const showBorder = i !== 0 && !gutter;
|
package/es/picker/Picker.mjs
CHANGED
@@ -164,6 +164,7 @@ var stdin_default = defineComponent({
|
|
164
164
|
watch(() => props.modelValue, (newValues) => {
|
165
165
|
if (!isSameValue(newValues, selectedValues.value) && !isSameValue(newValues, lastEmittedModelValue)) {
|
166
166
|
selectedValues.value = newValues.slice(0);
|
167
|
+
lastEmittedModelValue = newValues.slice(0);
|
167
168
|
}
|
168
169
|
}, {
|
169
170
|
deep: true
|
package/es/popup/shared.mjs
CHANGED
@@ -1,16 +1,28 @@
|
|
1
1
|
import { truthProp, unknownProp, numericProp } from "../utils/index.mjs";
|
2
2
|
const popupSharedProps = {
|
3
|
+
// whether to show popup
|
3
4
|
show: Boolean,
|
5
|
+
// z-index
|
4
6
|
zIndex: numericProp,
|
7
|
+
// whether to show overlay
|
5
8
|
overlay: truthProp,
|
9
|
+
// transition duration
|
6
10
|
duration: numericProp,
|
11
|
+
// teleport
|
7
12
|
teleport: [String, Object],
|
13
|
+
// prevent body scroll
|
8
14
|
lockScroll: truthProp,
|
15
|
+
// whether to lazy render
|
9
16
|
lazyRender: truthProp,
|
17
|
+
// callback function before close
|
10
18
|
beforeClose: Function,
|
19
|
+
// overlay custom style
|
11
20
|
overlayStyle: Object,
|
21
|
+
// overlay custom class name
|
12
22
|
overlayClass: unknownProp,
|
23
|
+
// Initial rendering animation
|
13
24
|
transitionAppear: Boolean,
|
25
|
+
// whether to close popup when overlay is clicked
|
14
26
|
closeOnClickOverlay: truthProp
|
15
27
|
};
|
16
28
|
const popupSharedPropKeys = Object.keys(
|
package/es/progress/Progress.mjs
CHANGED
package/es/search/Search.mjs
CHANGED
@@ -25,7 +25,7 @@ var stdin_default = defineComponent({
|
|
25
25
|
attrs
|
26
26
|
}) {
|
27
27
|
const id = useId();
|
28
|
-
const
|
28
|
+
const fieldRef = ref();
|
29
29
|
const onCancel = () => {
|
30
30
|
if (!slots.action) {
|
31
31
|
emit("update:modelValue", "");
|
@@ -61,11 +61,11 @@ var stdin_default = defineComponent({
|
|
61
61
|
};
|
62
62
|
const blur = () => {
|
63
63
|
var _a;
|
64
|
-
return (_a =
|
64
|
+
return (_a = fieldRef.value) == null ? void 0 : _a.blur();
|
65
65
|
};
|
66
66
|
const focus = () => {
|
67
67
|
var _a;
|
68
|
-
return (_a =
|
68
|
+
return (_a = fieldRef.value) == null ? void 0 : _a.focus();
|
69
69
|
};
|
70
70
|
const onBlur = (event) => emit("blur", event);
|
71
71
|
const onFocus = (event) => emit("focus", event);
|
@@ -80,7 +80,7 @@ var stdin_default = defineComponent({
|
|
80
80
|
});
|
81
81
|
const onInput = (value) => emit("update:modelValue", value);
|
82
82
|
return _createVNode(Field, _mergeProps({
|
83
|
-
"ref":
|
83
|
+
"ref": fieldRef,
|
84
84
|
"type": "search",
|
85
85
|
"class": bem("field"),
|
86
86
|
"border": false,
|
package/es/slider/Slider.d.ts
CHANGED
@@ -87,9 +87,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
87
87
|
onDragStart?: ((...args: any[]) => any) | undefined;
|
88
88
|
onDragEnd?: ((...args: any[]) => any) | undefined;
|
89
89
|
}, {
|
90
|
+
reverse: boolean;
|
90
91
|
range: boolean;
|
91
92
|
max: string | number;
|
92
|
-
reverse: boolean;
|
93
93
|
disabled: boolean;
|
94
94
|
modelValue: SliderValue;
|
95
95
|
readonly: boolean;
|
package/es/slider/index.d.ts
CHANGED
@@ -56,9 +56,9 @@ export declare const Slider: import("../utils").WithInstall<import("vue").Define
|
|
56
56
|
onDragStart?: ((...args: any[]) => any) | undefined;
|
57
57
|
onDragEnd?: ((...args: any[]) => any) | undefined;
|
58
58
|
}, {
|
59
|
+
reverse: boolean;
|
59
60
|
range: boolean;
|
60
61
|
max: string | number;
|
61
|
-
reverse: boolean;
|
62
62
|
disabled: boolean;
|
63
63
|
modelValue: number | [number, number];
|
64
64
|
readonly: boolean;
|
package/es/stepper/Stepper.mjs
CHANGED
@@ -68,8 +68,8 @@ var stdin_default = defineComponent({
|
|
68
68
|
let actionType;
|
69
69
|
const inputRef = ref();
|
70
70
|
const current = ref(getInitialValue());
|
71
|
-
const minusDisabled = computed(() => props.disabled || props.disableMinus || current.value <= +props.min);
|
72
|
-
const plusDisabled = computed(() => props.disabled || props.disablePlus || current.value >= +props.max);
|
71
|
+
const minusDisabled = computed(() => props.disabled || props.disableMinus || +current.value <= +props.min);
|
72
|
+
const plusDisabled = computed(() => props.disabled || props.disablePlus || +current.value >= +props.max);
|
73
73
|
const inputStyle = computed(() => ({
|
74
74
|
width: addUnit(props.inputWidth),
|
75
75
|
height: addUnit(props.buttonSize)
|
package/es/sticky/Sticky.mjs
CHANGED
@@ -24,7 +24,9 @@ var stdin_default = defineComponent({
|
|
24
24
|
const state = reactive({
|
25
25
|
fixed: false,
|
26
26
|
width: 0,
|
27
|
+
// root width
|
27
28
|
height: 0,
|
29
|
+
// root height
|
28
30
|
transform: 0
|
29
31
|
});
|
30
32
|
const offset = computed(() => unitToPx(props.position === "top" ? props.offsetTop : props.offsetBottom));
|
package/es/swipe/Swipe.mjs
CHANGED
@@ -165,7 +165,7 @@ var stdin_default = defineComponent({
|
|
165
165
|
const stopAutoplay = () => clearTimeout(autoplayTimer);
|
166
166
|
const autoplay = () => {
|
167
167
|
stopAutoplay();
|
168
|
-
if (props.autoplay > 0 && count.value > 1) {
|
168
|
+
if (+props.autoplay > 0 && count.value > 1) {
|
169
169
|
autoplayTimer = setTimeout(() => {
|
170
170
|
next();
|
171
171
|
autoplay();
|
@@ -210,7 +210,8 @@ var stdin_default = defineComponent({
|
|
210
210
|
const resize = () => initialize(state.active);
|
211
211
|
let touchStartTime;
|
212
212
|
const onTouchStart = (event) => {
|
213
|
-
if (!props.touchable ||
|
213
|
+
if (!props.touchable || // avoid resetting position on multi-finger touch
|
214
|
+
event.touches.length > 1)
|
214
215
|
return;
|
215
216
|
touch.start(event);
|
216
217
|
dragging = false;
|
@@ -229,7 +230,9 @@ var stdin_default = defineComponent({
|
|
229
230
|
offset: delta.value
|
230
231
|
});
|
231
232
|
if (!dragging) {
|
232
|
-
emit("dragStart"
|
233
|
+
emit("dragStart", {
|
234
|
+
index: activeIndicator.value
|
235
|
+
});
|
233
236
|
dragging = true;
|
234
237
|
}
|
235
238
|
}
|
@@ -262,7 +265,9 @@ var stdin_default = defineComponent({
|
|
262
265
|
}
|
263
266
|
dragging = false;
|
264
267
|
state.swiping = false;
|
265
|
-
emit("dragEnd"
|
268
|
+
emit("dragEnd", {
|
269
|
+
index: activeIndicator.value
|
270
|
+
});
|
266
271
|
autoplay();
|
267
272
|
};
|
268
273
|
const swipeTo = (index, options = {}) => {
|
package/es/tabs/Tabs.mjs
CHANGED
@@ -64,7 +64,7 @@ var stdin_default = defineComponent({
|
|
64
64
|
lineStyle: {},
|
65
65
|
currentIndex: -1
|
66
66
|
});
|
67
|
-
const scrollable = computed(() => children.length > props.swipeThreshold || !props.ellipsis || props.shrink);
|
67
|
+
const scrollable = computed(() => children.length > +props.swipeThreshold || !props.ellipsis || props.shrink);
|
68
68
|
const navStyle = computed(() => ({
|
69
69
|
borderColor: props.color,
|
70
70
|
background: props.background
|
package/es/tag/Tag.d.ts
CHANGED
package/es/tag/index.d.ts
CHANGED
@@ -36,8 +36,8 @@ export declare const Tag: import("../utils").WithInstall<import("vue").DefineCom
|
|
36
36
|
type: import("./types").TagType;
|
37
37
|
mark: boolean;
|
38
38
|
round: boolean;
|
39
|
-
show: boolean;
|
40
39
|
plain: boolean;
|
40
|
+
show: boolean;
|
41
41
|
closeable: boolean;
|
42
42
|
}>>;
|
43
43
|
export default Tag;
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import { type ExtractPropTypes } from 'vue';
|
2
|
+
export declare const textEllipsisProps: {
|
3
|
+
rows: {
|
4
|
+
type: (NumberConstructor | StringConstructor)[];
|
5
|
+
default: number;
|
6
|
+
};
|
7
|
+
content: {
|
8
|
+
type: import("vue").PropType<string>;
|
9
|
+
default: string;
|
10
|
+
};
|
11
|
+
expandText: {
|
12
|
+
type: import("vue").PropType<string>;
|
13
|
+
default: string;
|
14
|
+
};
|
15
|
+
collapseText: {
|
16
|
+
type: import("vue").PropType<string>;
|
17
|
+
default: string;
|
18
|
+
};
|
19
|
+
};
|
20
|
+
export type TextEllipsisProps = ExtractPropTypes<typeof textEllipsisProps>;
|
21
|
+
declare const _default: import("vue").DefineComponent<{
|
22
|
+
rows: {
|
23
|
+
type: (NumberConstructor | StringConstructor)[];
|
24
|
+
default: number;
|
25
|
+
};
|
26
|
+
content: {
|
27
|
+
type: import("vue").PropType<string>;
|
28
|
+
default: string;
|
29
|
+
};
|
30
|
+
expandText: {
|
31
|
+
type: import("vue").PropType<string>;
|
32
|
+
default: string;
|
33
|
+
};
|
34
|
+
collapseText: {
|
35
|
+
type: import("vue").PropType<string>;
|
36
|
+
default: string;
|
37
|
+
};
|
38
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "clickAction"[], "clickAction", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
39
|
+
rows: {
|
40
|
+
type: (NumberConstructor | StringConstructor)[];
|
41
|
+
default: number;
|
42
|
+
};
|
43
|
+
content: {
|
44
|
+
type: import("vue").PropType<string>;
|
45
|
+
default: string;
|
46
|
+
};
|
47
|
+
expandText: {
|
48
|
+
type: import("vue").PropType<string>;
|
49
|
+
default: string;
|
50
|
+
};
|
51
|
+
collapseText: {
|
52
|
+
type: import("vue").PropType<string>;
|
53
|
+
default: string;
|
54
|
+
};
|
55
|
+
}>> & {
|
56
|
+
onClickAction?: ((...args: any[]) => any) | undefined;
|
57
|
+
}, {
|
58
|
+
content: string;
|
59
|
+
rows: string | number;
|
60
|
+
expandText: string;
|
61
|
+
collapseText: string;
|
62
|
+
}>;
|
63
|
+
export default _default;
|
@@ -0,0 +1,108 @@
|
|
1
|
+
import { createVNode as _createVNode } from "vue";
|
2
|
+
import { ref, watch, onMounted, defineComponent } from "vue";
|
3
|
+
import { useEventListener } from "@vant/use";
|
4
|
+
import { makeNumericProp, makeStringProp, createNamespace } from "../utils/index.mjs";
|
5
|
+
const [name, bem] = createNamespace("text-ellipsis");
|
6
|
+
const textEllipsisProps = {
|
7
|
+
rows: makeNumericProp(1),
|
8
|
+
content: makeStringProp(""),
|
9
|
+
expandText: makeStringProp(""),
|
10
|
+
collapseText: makeStringProp("")
|
11
|
+
};
|
12
|
+
var stdin_default = defineComponent({
|
13
|
+
name,
|
14
|
+
props: textEllipsisProps,
|
15
|
+
emits: ["clickAction"],
|
16
|
+
setup(props, {
|
17
|
+
emit
|
18
|
+
}) {
|
19
|
+
const text = ref("");
|
20
|
+
const expanded = ref(false);
|
21
|
+
const hasAction = ref(false);
|
22
|
+
const root = ref();
|
23
|
+
const pxToNum = (value) => {
|
24
|
+
if (!value)
|
25
|
+
return 0;
|
26
|
+
const match = value.match(/^\d*(\.\d*)?/);
|
27
|
+
return match ? Number(match[0]) : 0;
|
28
|
+
};
|
29
|
+
const calcEllipsised = () => {
|
30
|
+
const cloneContainer = () => {
|
31
|
+
if (!root.value)
|
32
|
+
return;
|
33
|
+
const originStyle = window.getComputedStyle(root.value);
|
34
|
+
const container2 = document.createElement("div");
|
35
|
+
const styleNames = Array.prototype.slice.apply(originStyle);
|
36
|
+
styleNames.forEach((name2) => {
|
37
|
+
container2.style.setProperty(name2, originStyle.getPropertyValue(name2));
|
38
|
+
});
|
39
|
+
container2.style.position = "fixed";
|
40
|
+
container2.style.zIndex = "-9999";
|
41
|
+
container2.style.top = "-9999px";
|
42
|
+
container2.style.height = "auto";
|
43
|
+
container2.style.minHeight = "auto";
|
44
|
+
container2.style.maxHeight = "auto";
|
45
|
+
container2.innerText = props.content;
|
46
|
+
document.body.appendChild(container2);
|
47
|
+
return container2;
|
48
|
+
};
|
49
|
+
const calcEllipsisText = (container2, maxHeight2) => {
|
50
|
+
const {
|
51
|
+
content,
|
52
|
+
expandText
|
53
|
+
} = props;
|
54
|
+
const dot = "...";
|
55
|
+
let left = 0;
|
56
|
+
let right = content.length;
|
57
|
+
let res = -1;
|
58
|
+
while (left <= right) {
|
59
|
+
const mid = Math.floor((left + right) / 2);
|
60
|
+
container2.innerText = content.slice(0, mid) + dot + expandText;
|
61
|
+
if (container2.offsetHeight <= maxHeight2) {
|
62
|
+
left = mid + 1;
|
63
|
+
res = mid;
|
64
|
+
} else {
|
65
|
+
right = mid - 1;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
return content.slice(0, res) + dot;
|
69
|
+
};
|
70
|
+
const container = cloneContainer();
|
71
|
+
if (!container)
|
72
|
+
return;
|
73
|
+
const {
|
74
|
+
paddingBottom,
|
75
|
+
paddingTop,
|
76
|
+
lineHeight
|
77
|
+
} = container.style;
|
78
|
+
const maxHeight = (Number(props.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom);
|
79
|
+
if (maxHeight < container.offsetHeight) {
|
80
|
+
hasAction.value = true;
|
81
|
+
text.value = calcEllipsisText(container, maxHeight);
|
82
|
+
} else {
|
83
|
+
hasAction.value = false;
|
84
|
+
text.value = props.content;
|
85
|
+
}
|
86
|
+
document.body.removeChild(container);
|
87
|
+
};
|
88
|
+
const onClickAction = (event) => {
|
89
|
+
expanded.value = !expanded.value;
|
90
|
+
emit("clickAction", event);
|
91
|
+
};
|
92
|
+
const renderAction = () => _createVNode("span", {
|
93
|
+
"class": bem("action"),
|
94
|
+
"onClick": onClickAction
|
95
|
+
}, [expanded.value ? props.collapseText : props.expandText]);
|
96
|
+
onMounted(calcEllipsised);
|
97
|
+
watch(() => [props.content, props.rows], calcEllipsised);
|
98
|
+
useEventListener("resize", calcEllipsised);
|
99
|
+
return () => _createVNode("div", {
|
100
|
+
"ref": root,
|
101
|
+
"class": bem()
|
102
|
+
}, [expanded.value ? props.content : text.value, hasAction.value ? renderAction() : null]);
|
103
|
+
}
|
104
|
+
});
|
105
|
+
export {
|
106
|
+
stdin_default as default,
|
107
|
+
textEllipsisProps
|
108
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
:root{--van-text-ellipsis-line-height: 1.6;--van-text-ellipsis-action-color: var(--van-blue)}.van-text-ellipsis{line-height:var(--van-text-ellipsis-line-height);white-space:pre-wrap;word-break:break-word}.van-text-ellipsis__action{cursor:pointer;color:var(--van-text-ellipsis-action-color)}.van-text-ellipsis__action:active{opacity:var(--van-active-opacity)}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
export declare const TextEllipsis: import("../utils").WithInstall<import("vue").DefineComponent<{
|
2
|
+
rows: {
|
3
|
+
type: (NumberConstructor | StringConstructor)[];
|
4
|
+
default: number;
|
5
|
+
};
|
6
|
+
content: {
|
7
|
+
type: import("vue").PropType<string>;
|
8
|
+
default: string;
|
9
|
+
};
|
10
|
+
expandText: {
|
11
|
+
type: import("vue").PropType<string>;
|
12
|
+
default: string;
|
13
|
+
};
|
14
|
+
collapseText: {
|
15
|
+
type: import("vue").PropType<string>;
|
16
|
+
default: string;
|
17
|
+
};
|
18
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "clickAction"[], "clickAction", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
19
|
+
rows: {
|
20
|
+
type: (NumberConstructor | StringConstructor)[];
|
21
|
+
default: number;
|
22
|
+
};
|
23
|
+
content: {
|
24
|
+
type: import("vue").PropType<string>;
|
25
|
+
default: string;
|
26
|
+
};
|
27
|
+
expandText: {
|
28
|
+
type: import("vue").PropType<string>;
|
29
|
+
default: string;
|
30
|
+
};
|
31
|
+
collapseText: {
|
32
|
+
type: import("vue").PropType<string>;
|
33
|
+
default: string;
|
34
|
+
};
|
35
|
+
}>> & {
|
36
|
+
onClickAction?: ((...args: any[]) => any) | undefined;
|
37
|
+
}, {
|
38
|
+
content: string;
|
39
|
+
rows: string | number;
|
40
|
+
expandText: string;
|
41
|
+
collapseText: string;
|
42
|
+
}>>;
|
43
|
+
export default TextEllipsis;
|
44
|
+
export { textEllipsisProps } from './TextEllipsis';
|
45
|
+
export type { TextEllipsisProps } from './TextEllipsis';
|
46
|
+
export type { TextEllipsisThemeVars } from './types';
|
47
|
+
declare module 'vue' {
|
48
|
+
interface GlobalComponents {
|
49
|
+
VanTextEllipsis: typeof TextEllipsis;
|
50
|
+
}
|
51
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { withInstall } from "../utils/index.mjs";
|
2
|
+
import _TextEllipsis from "./TextEllipsis.mjs";
|
3
|
+
const TextEllipsis = withInstall(_TextEllipsis);
|
4
|
+
var stdin_default = TextEllipsis;
|
5
|
+
import { textEllipsisProps } from "./TextEllipsis.mjs";
|
6
|
+
export {
|
7
|
+
TextEllipsis,
|
8
|
+
stdin_default as default,
|
9
|
+
textEllipsisProps
|
10
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
File without changes
|
@@ -36,7 +36,7 @@ var stdin_default = defineComponent({
|
|
36
36
|
const index = activeId.indexOf(item.id);
|
37
37
|
if (index !== -1) {
|
38
38
|
activeId.splice(index, 1);
|
39
|
-
} else if (activeId.length < props.max) {
|
39
|
+
} else if (activeId.length < +props.max) {
|
40
40
|
activeId.push(item.id);
|
41
41
|
}
|
42
42
|
} else {
|
@@ -64,12 +64,13 @@ var stdin_default = defineComponent({
|
|
64
64
|
const renderSidebar = () => {
|
65
65
|
const Items = props.items.map((item) => _createVNode(SidebarItem, {
|
66
66
|
"dot": item.dot,
|
67
|
-
"title": item.text,
|
68
67
|
"badge": item.badge,
|
69
68
|
"class": [bem("nav-item"), item.className],
|
70
69
|
"disabled": item.disabled,
|
71
70
|
"onClick": onClickSidebarItem
|
72
|
-
},
|
71
|
+
}, {
|
72
|
+
title: () => slots["nav-text"] ? slots["nav-text"](item) : item.text
|
73
|
+
}));
|
73
74
|
return _createVNode(Sidebar, {
|
74
75
|
"class": bem("nav"),
|
75
76
|
"modelValue": props.mainActiveIndex,
|
package/es/uploader/Uploader.mjs
CHANGED
@@ -189,7 +189,7 @@ var stdin_default = defineComponent({
|
|
189
189
|
};
|
190
190
|
const onClickUpload = (event) => emit("clickUpload", event);
|
191
191
|
const renderUpload = () => {
|
192
|
-
if (props.modelValue.length >= props.maxCount) {
|
192
|
+
if (props.modelValue.length >= +props.maxCount) {
|
193
193
|
return;
|
194
194
|
}
|
195
195
|
const Input = props.readonly ? null : _createVNode("input", {
|
package/es/uploader/utils.mjs
CHANGED
@@ -23,7 +23,7 @@ function isOversize(items, maxSize) {
|
|
23
23
|
if (isFunction(maxSize)) {
|
24
24
|
return maxSize(item.file);
|
25
25
|
}
|
26
|
-
return item.file.size > maxSize;
|
26
|
+
return item.file.size > +maxSize;
|
27
27
|
}
|
28
28
|
return false;
|
29
29
|
});
|
@@ -40,7 +40,7 @@ function filterFiles(items, maxSize) {
|
|
40
40
|
});
|
41
41
|
return { valid, invalid };
|
42
42
|
}
|
43
|
-
const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
|
43
|
+
const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg|avif)/i;
|
44
44
|
const isImageUrl = (url) => IMAGE_REGEXP.test(url);
|
45
45
|
function isImageFile(item) {
|
46
46
|
if (item.isImage) {
|
package/lib/action-bar/index.js
CHANGED
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
17
17
|
return to;
|
18
18
|
};
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
21
25
|
mod
|
22
26
|
));
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
17
17
|
return to;
|
18
18
|
};
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
21
25
|
mod
|
22
26
|
));
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
17
17
|
return to;
|
18
18
|
};
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
21
25
|
mod
|
22
26
|
));
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
17
17
|
return to;
|
18
18
|
};
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
21
25
|
mod
|
22
26
|
));
|