vant 3.6.1 → 3.6.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/README.md +4 -5
- package/changelog.generated.md +33 -43
- package/es/action-bar/ActionBar.d.ts +1 -1
- package/es/action-bar/index.d.ts +1 -1
- package/es/action-bar-button/ActionBarButton.d.ts +1 -1
- package/es/action-bar-button/index.d.ts +1 -1
- package/es/action-bar-icon/ActionBarIcon.d.ts +1 -1
- package/es/action-bar-icon/index.d.ts +1 -1
- package/es/badge/Badge.d.ts +1 -1
- package/es/badge/index.d.ts +1 -1
- package/es/calendar/Calendar.mjs +4 -3
- package/es/cell/Cell.d.ts +1 -1
- package/es/cell/index.d.ts +1 -1
- package/es/cell-group/CellGroup.d.ts +1 -1
- package/es/cell-group/index.d.ts +1 -1
- package/es/col/Col.d.ts +1 -1
- package/es/col/index.d.ts +1 -1
- package/es/collapse-item/CollapseItem.d.ts +1 -1
- package/es/collapse-item/index.d.ts +1 -1
- package/es/composables/use-lazy-render.mjs +9 -5
- package/es/composables/use-lock-scroll.mjs +4 -1
- package/es/composables/use-visibility-change.mjs +6 -3
- package/es/config-provider/ConfigProvider.d.ts +1 -1
- package/es/config-provider/index.d.ts +1 -1
- package/es/coupon/Coupon.d.ts +1 -1
- package/es/coupon/index.d.ts +1 -1
- package/es/coupon/utils.mjs +3 -1
- package/es/coupon-cell/CouponCell.d.ts +1 -1
- package/es/coupon-cell/index.d.ts +1 -1
- package/es/datetime-picker/DatetimePicker.d.ts +1 -1
- package/es/datetime-picker/index.d.ts +1 -1
- package/es/dialog/index.css +1 -1
- package/es/dialog/index.less +4 -0
- package/es/dialog/types.d.ts +1 -1
- package/es/divider/Divider.d.ts +1 -1
- package/es/divider/index.d.ts +1 -1
- package/es/dropdown-item/DropdownItem.d.ts +2 -2
- package/es/dropdown-item/index.d.ts +2 -2
- package/es/dropdown-menu/DropdownMenu.d.ts +1 -1
- package/es/dropdown-menu/index.d.ts +1 -1
- package/es/empty/Empty.d.ts +1 -1
- package/es/empty/index.d.ts +1 -1
- package/es/field/Field.mjs +10 -3
- package/es/grid/Grid.d.ts +1 -1
- package/es/grid/index.d.ts +1 -1
- package/es/grid-item/GridItem.d.ts +1 -1
- package/es/grid-item/index.d.ts +1 -1
- package/es/icon/Icon.d.ts +1 -1
- package/es/icon/index.d.ts +1 -1
- package/es/image/Image.d.ts +4 -0
- package/es/image/Image.mjs +3 -1
- package/es/image/index.css +1 -1
- package/es/image/index.d.ts +3 -0
- package/es/image/index.less +4 -0
- package/es/image-preview/ImagePreviewItem.mjs +10 -2
- package/es/index-anchor/IndexAnchor.d.ts +1 -1
- package/es/index-anchor/index.d.ts +1 -1
- package/es/index-bar/IndexBar.mjs +7 -3
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/lazyload/vue-lazyload/lazy-component.mjs +4 -1
- package/es/lazyload/vue-lazyload/lazy-container.mjs +11 -7
- package/es/lazyload/vue-lazyload/lazy-image.mjs +24 -14
- package/es/lazyload/vue-lazyload/lazy.mjs +11 -3
- package/es/lazyload/vue-lazyload/listener.mjs +45 -33
- package/es/lazyload/vue-lazyload/util.mjs +4 -1
- package/es/loading/Loading.d.ts +1 -1
- package/es/loading/index.d.ts +1 -1
- package/es/number-keyboard/NumberKeyboard.d.ts +1 -1
- package/es/number-keyboard/index.d.ts +1 -1
- package/es/overlay/Overlay.d.ts +1 -1
- package/es/overlay/Overlay.mjs +13 -6
- package/es/overlay/index.d.ts +1 -1
- package/es/picker/Picker.mjs +7 -3
- package/es/picker/PickerColumn.mjs +6 -2
- package/es/popup/Popup.d.ts +2 -2
- package/es/popup/index.d.ts +2 -2
- package/es/popup/shared.mjs +3 -1
- package/es/progress/Progress.d.ts +1 -1
- package/es/progress/index.d.ts +1 -1
- package/es/rate/Rate.mjs +5 -3
- package/es/row/Row.d.ts +1 -1
- package/es/row/index.d.ts +1 -1
- package/es/skeleton/Skeleton.d.ts +1 -1
- package/es/skeleton/index.d.ts +1 -1
- package/es/slider/Slider.mjs +6 -2
- package/es/space/Space.d.ts +1 -1
- package/es/space/index.d.ts +1 -1
- package/es/step/Step.d.ts +1 -1
- package/es/step/index.d.ts +1 -1
- package/es/swipe/Swipe.mjs +13 -6
- package/es/swipe-cell/SwipeCell.d.ts +2 -2
- package/es/swipe-cell/SwipeCell.mjs +4 -2
- package/es/swipe-cell/index.d.ts +2 -2
- package/es/swipe-item/SwipeItem.d.ts +1 -1
- package/es/swipe-item/index.d.ts +1 -1
- package/es/tab/Tab.d.ts +1 -1
- package/es/tab/Tab.mjs +12 -2
- package/es/tab/index.d.ts +1 -1
- package/es/tabs/Tabs.d.ts +1 -1
- package/es/tabs/Tabs.mjs +11 -11
- package/es/tabs/TabsTitle.d.ts +1 -1
- package/es/tabs/index.d.ts +1 -1
- package/es/utils/basic.mjs +2 -1
- package/es/utils/create.mjs +8 -2
- package/es/utils/with-install.d.ts +2 -2
- package/es/utils/with-install.mjs +4 -2
- package/lib/action-bar/ActionBar.d.ts +1 -1
- package/lib/action-bar/index.d.ts +1 -1
- package/lib/action-bar/index.js +4 -1
- package/lib/action-bar-button/ActionBarButton.d.ts +1 -1
- package/lib/action-bar-button/index.d.ts +1 -1
- package/lib/action-bar-button/index.js +4 -1
- package/lib/action-bar-icon/ActionBarIcon.d.ts +1 -1
- package/lib/action-bar-icon/index.d.ts +1 -1
- package/lib/action-bar-icon/index.js +4 -1
- package/lib/action-sheet/index.js +4 -1
- package/lib/address-edit/AddressEdit.js +4 -1
- package/lib/address-edit/index.js +4 -1
- package/lib/address-list/AddressList.js +4 -1
- package/lib/address-list/index.js +4 -1
- package/lib/area/index.js +4 -1
- package/lib/badge/Badge.d.ts +1 -1
- package/lib/badge/index.d.ts +1 -1
- package/lib/badge/index.js +4 -1
- package/lib/button/index.js +4 -1
- package/lib/calendar/Calendar.js +8 -4
- package/lib/calendar/CalendarMonth.js +4 -1
- package/lib/calendar/index.js +4 -1
- package/lib/card/index.js +4 -1
- package/lib/cascader/index.js +4 -1
- package/lib/cell/Cell.d.ts +1 -1
- package/lib/cell/index.d.ts +1 -1
- package/lib/cell/index.js +4 -1
- package/lib/cell-group/CellGroup.d.ts +1 -1
- package/lib/cell-group/index.d.ts +1 -1
- package/lib/cell-group/index.js +4 -1
- package/lib/checkbox/Checkbox.js +4 -1
- package/lib/checkbox/index.js +4 -1
- package/lib/checkbox-group/index.js +4 -1
- package/lib/circle/index.js +4 -1
- package/lib/col/Col.d.ts +1 -1
- package/lib/col/index.d.ts +1 -1
- package/lib/col/index.js +4 -1
- package/lib/collapse/index.js +4 -1
- package/lib/collapse-item/CollapseItem.d.ts +1 -1
- package/lib/collapse-item/index.d.ts +1 -1
- package/lib/collapse-item/index.js +4 -1
- package/lib/composables/use-lazy-render.js +9 -5
- package/lib/composables/use-lock-scroll.js +4 -1
- package/lib/composables/use-visibility-change.js +6 -3
- package/lib/config-provider/ConfigProvider.d.ts +1 -1
- package/lib/config-provider/index.d.ts +1 -1
- package/lib/config-provider/index.js +4 -1
- package/lib/contact-card/index.js +4 -1
- package/lib/contact-edit/index.js +4 -1
- package/lib/contact-list/index.js +4 -1
- package/lib/count-down/index.js +4 -1
- package/lib/coupon/Coupon.d.ts +1 -1
- package/lib/coupon/index.d.ts +1 -1
- package/lib/coupon/index.js +4 -1
- package/lib/coupon/utils.js +3 -1
- package/lib/coupon-cell/CouponCell.d.ts +1 -1
- package/lib/coupon-cell/index.d.ts +1 -1
- package/lib/coupon-cell/index.js +4 -1
- package/lib/coupon-list/index.js +4 -1
- package/lib/datetime-picker/DatetimePicker.d.ts +1 -1
- package/lib/datetime-picker/DatetimePicker.js +4 -1
- package/lib/datetime-picker/index.d.ts +1 -1
- package/lib/datetime-picker/index.js +4 -1
- package/lib/dialog/function-call.js +4 -1
- package/lib/dialog/index.css +1 -1
- package/lib/dialog/index.less +4 -0
- package/lib/dialog/types.d.ts +1 -1
- package/lib/divider/Divider.d.ts +1 -1
- package/lib/divider/index.d.ts +1 -1
- package/lib/divider/index.js +4 -1
- package/lib/dropdown-item/DropdownItem.d.ts +2 -2
- package/lib/dropdown-item/index.d.ts +2 -2
- package/lib/dropdown-item/index.js +4 -1
- package/lib/dropdown-menu/DropdownMenu.d.ts +1 -1
- package/lib/dropdown-menu/index.d.ts +1 -1
- package/lib/dropdown-menu/index.js +4 -1
- package/lib/empty/Empty.d.ts +1 -1
- package/lib/empty/index.d.ts +1 -1
- package/lib/empty/index.js +4 -1
- package/lib/field/Field.js +9 -2
- package/lib/field/index.js +4 -1
- package/lib/form/index.js +4 -1
- package/lib/grid/Grid.d.ts +1 -1
- package/lib/grid/index.d.ts +1 -1
- package/lib/grid/index.js +4 -1
- package/lib/grid-item/GridItem.d.ts +1 -1
- package/lib/grid-item/index.d.ts +1 -1
- package/lib/grid-item/index.js +4 -1
- package/lib/icon/Icon.d.ts +1 -1
- package/lib/icon/index.d.ts +1 -1
- package/lib/icon/index.js +4 -1
- package/lib/image/Image.d.ts +4 -0
- package/lib/image/Image.js +3 -1
- package/lib/image/index.css +1 -1
- package/lib/image/index.d.ts +3 -0
- package/lib/image/index.js +4 -1
- package/lib/image/index.less +4 -0
- package/lib/image-preview/ImagePreview.js +4 -1
- package/lib/image-preview/ImagePreviewItem.js +9 -1
- package/lib/image-preview/function-call.js +4 -1
- package/lib/index-anchor/IndexAnchor.d.ts +1 -1
- package/lib/index-anchor/index.d.ts +1 -1
- package/lib/index-anchor/index.js +4 -1
- package/lib/index-bar/IndexBar.js +7 -3
- package/lib/index-bar/index.js +4 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/lazyload/vue-lazyload/index.js +4 -1
- package/lib/lazyload/vue-lazyload/lazy-component.js +4 -1
- package/lib/lazyload/vue-lazyload/lazy-container.js +11 -7
- package/lib/lazyload/vue-lazyload/lazy-image.js +24 -14
- package/lib/lazyload/vue-lazyload/lazy.js +15 -4
- package/lib/lazyload/vue-lazyload/listener.js +45 -33
- package/lib/lazyload/vue-lazyload/util.js +4 -1
- package/lib/list/index.js +4 -1
- package/lib/loading/Loading.d.ts +1 -1
- package/lib/loading/index.d.ts +1 -1
- package/lib/loading/index.js +4 -1
- package/lib/locale/index.js +4 -1
- package/lib/nav-bar/index.js +4 -1
- package/lib/notice-bar/index.js +4 -1
- package/lib/notify/function-call.js +4 -1
- package/lib/number-keyboard/NumberKeyboard.d.ts +1 -1
- package/lib/number-keyboard/NumberKeyboard.js +4 -1
- package/lib/number-keyboard/index.d.ts +1 -1
- package/lib/number-keyboard/index.js +4 -1
- package/lib/overlay/Overlay.d.ts +1 -1
- package/lib/overlay/Overlay.js +11 -4
- package/lib/overlay/index.d.ts +1 -1
- package/lib/overlay/index.js +4 -1
- package/lib/pagination/index.js +4 -1
- package/lib/password-input/index.js +4 -1
- package/lib/picker/Picker.js +10 -3
- package/lib/picker/PickerColumn.js +5 -1
- package/lib/picker/index.js +4 -1
- package/lib/popover/index.js +4 -1
- package/lib/popup/Popup.d.ts +2 -2
- package/lib/popup/index.d.ts +2 -2
- package/lib/popup/index.js +4 -1
- package/lib/popup/shared.js +3 -1
- package/lib/progress/Progress.d.ts +1 -1
- package/lib/progress/index.d.ts +1 -1
- package/lib/progress/index.js +4 -1
- package/lib/pull-refresh/index.js +4 -1
- package/lib/radio/Radio.js +4 -1
- package/lib/radio/index.js +4 -1
- package/lib/radio-group/index.js +4 -1
- package/lib/rate/Rate.js +4 -2
- package/lib/rate/index.js +4 -1
- package/lib/row/Row.d.ts +1 -1
- package/lib/row/index.d.ts +1 -1
- package/lib/row/index.js +4 -1
- package/lib/search/index.js +4 -1
- package/lib/share-sheet/index.js +4 -1
- package/lib/sidebar/index.js +4 -1
- package/lib/sidebar-item/index.js +4 -1
- package/lib/skeleton/Skeleton.d.ts +1 -1
- package/lib/skeleton/index.d.ts +1 -1
- package/lib/skeleton/index.js +4 -1
- package/lib/slider/Slider.js +5 -1
- package/lib/slider/index.js +4 -1
- package/lib/space/Space.d.ts +1 -1
- package/lib/space/index.d.ts +1 -1
- package/lib/space/index.js +4 -1
- package/lib/step/Step.d.ts +1 -1
- package/lib/step/index.d.ts +1 -1
- package/lib/step/index.js +4 -1
- package/lib/stepper/index.js +4 -1
- package/lib/steps/index.js +4 -1
- package/lib/sticky/index.js +4 -1
- package/lib/submit-bar/index.js +4 -1
- package/lib/swipe/Swipe.js +12 -5
- package/lib/swipe/index.js +4 -1
- package/lib/swipe-cell/SwipeCell.d.ts +2 -2
- package/lib/swipe-cell/SwipeCell.js +3 -1
- package/lib/swipe-cell/index.d.ts +2 -2
- package/lib/swipe-cell/index.js +4 -1
- package/lib/swipe-item/SwipeItem.d.ts +1 -1
- package/lib/swipe-item/index.d.ts +1 -1
- package/lib/swipe-item/index.js +4 -1
- package/lib/switch/index.js +4 -1
- package/lib/tab/Tab.d.ts +1 -1
- package/lib/tab/Tab.js +11 -1
- package/lib/tab/index.d.ts +1 -1
- package/lib/tab/index.js +4 -1
- package/lib/tabbar/index.js +4 -1
- package/lib/tabbar-item/index.js +4 -1
- package/lib/tabs/Tabs.d.ts +1 -1
- package/lib/tabs/Tabs.js +15 -12
- package/lib/tabs/TabsTitle.d.ts +1 -1
- package/lib/tabs/index.d.ts +1 -1
- package/lib/tabs/index.js +4 -1
- package/lib/tag/index.js +4 -1
- package/lib/toast/function-call.js +4 -1
- package/lib/tree-select/index.js +4 -1
- package/lib/uploader/Uploader.js +4 -1
- package/lib/uploader/index.js +4 -1
- package/lib/utils/basic.js +2 -1
- package/lib/utils/create.js +12 -3
- package/lib/utils/with-install.d.ts +2 -2
- package/lib/utils/with-install.js +4 -2
- package/lib/vant.cjs.js +248 -126
- package/lib/vant.es.js +248 -126
- package/lib/vant.js +290 -151
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1389 -1379
- package/package.json +8 -7
package/lib/vant.js
CHANGED
@@ -2,6 +2,17 @@
|
|
2
2
|
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue")) : typeof define === "function" && define.amd ? define(["exports", "vue"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.vant = {}, global.Vue));
|
3
3
|
})(this, function(exports2, vue) {
|
4
4
|
"use strict";
|
5
|
+
const isDef = (val) => val !== void 0 && val !== null;
|
6
|
+
const isFunction = (val) => typeof val === "function";
|
7
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
8
|
+
const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
9
|
+
const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
|
10
|
+
function isMobile(value) {
|
11
|
+
value = value.replace(/[^-|\d]/g, "");
|
12
|
+
return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
|
13
|
+
}
|
14
|
+
const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
|
15
|
+
const isIOS$1 = () => inBrowser$1 ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
|
5
16
|
function noop() {
|
6
17
|
}
|
7
18
|
const extend = Object.assign;
|
@@ -11,7 +22,7 @@
|
|
11
22
|
let result = object;
|
12
23
|
keys.forEach((key) => {
|
13
24
|
var _a;
|
14
|
-
result = (_a = result[key]) != null ? _a : "";
|
25
|
+
result = isObject(result) ? (_a = result[key]) != null ? _a : "" : "";
|
15
26
|
});
|
16
27
|
return result;
|
17
28
|
}
|
@@ -132,7 +143,9 @@
|
|
132
143
|
}
|
133
144
|
function sortChildren(parent, publicChildren, internalChildren) {
|
134
145
|
const vnodes = flattenVNodes(parent.subTree.children);
|
135
|
-
internalChildren.sort(
|
146
|
+
internalChildren.sort(
|
147
|
+
(a, b) => vnodes.indexOf(a.vnode) - vnodes.indexOf(b.vnode)
|
148
|
+
);
|
136
149
|
const orderedPublicChildren = internalChildren.map((item) => item.proxy);
|
137
150
|
publicChildren.sort((a, b) => {
|
138
151
|
const indexA = orderedPublicChildren.indexOf(a);
|
@@ -157,12 +170,18 @@
|
|
157
170
|
publicChildren.splice(index, 1);
|
158
171
|
internalChildren.splice(index, 1);
|
159
172
|
};
|
160
|
-
vue.provide(
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
173
|
+
vue.provide(
|
174
|
+
key,
|
175
|
+
Object.assign(
|
176
|
+
{
|
177
|
+
link,
|
178
|
+
unlink,
|
179
|
+
children: publicChildren,
|
180
|
+
internalChildren
|
181
|
+
},
|
182
|
+
value
|
183
|
+
)
|
184
|
+
);
|
166
185
|
};
|
167
186
|
return {
|
168
187
|
children: publicChildren,
|
@@ -410,17 +429,6 @@
|
|
410
429
|
});
|
411
430
|
}
|
412
431
|
}
|
413
|
-
const isDef = (val) => val !== void 0 && val !== null;
|
414
|
-
const isFunction = (val) => typeof val === "function";
|
415
|
-
const isObject = (val) => val !== null && typeof val === "object";
|
416
|
-
const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
417
|
-
const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
|
418
|
-
function isMobile(value) {
|
419
|
-
value = value.replace(/[^-|\d]/g, "");
|
420
|
-
return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
|
421
|
-
}
|
422
|
-
const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
|
423
|
-
const isIOS$1 = () => inBrowser$1 ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
|
424
432
|
function getScrollTop(el) {
|
425
433
|
const top2 = "scrollTop" in el ? el.scrollTop : el.pageYOffset;
|
426
434
|
return Math.max(top2, 0);
|
@@ -691,9 +699,15 @@
|
|
691
699
|
return ` ${name2}--${mods}`;
|
692
700
|
}
|
693
701
|
if (Array.isArray(mods)) {
|
694
|
-
return mods.reduce(
|
702
|
+
return mods.reduce(
|
703
|
+
(ret, item) => ret + genBem(name2, item),
|
704
|
+
""
|
705
|
+
);
|
695
706
|
}
|
696
|
-
return Object.keys(mods).reduce(
|
707
|
+
return Object.keys(mods).reduce(
|
708
|
+
(ret, key) => ret + (mods[key] ? genBem(name2, key) : ""),
|
709
|
+
""
|
710
|
+
);
|
697
711
|
}
|
698
712
|
function createBEM(name2) {
|
699
713
|
return (el, mods) => {
|
@@ -749,8 +763,10 @@
|
|
749
763
|
function withInstall(options) {
|
750
764
|
options.install = (app) => {
|
751
765
|
const { name: name2 } = options;
|
752
|
-
|
753
|
-
|
766
|
+
if (name2) {
|
767
|
+
app.component(name2, options);
|
768
|
+
app.component(camelize(`-${name2}`), options);
|
769
|
+
}
|
754
770
|
};
|
755
771
|
return options;
|
756
772
|
}
|
@@ -1379,7 +1395,9 @@
|
|
1379
1395
|
transitionAppear: Boolean,
|
1380
1396
|
closeOnClickOverlay: truthProp
|
1381
1397
|
};
|
1382
|
-
const popupSharedPropKeys = Object.keys(
|
1398
|
+
const popupSharedPropKeys = Object.keys(
|
1399
|
+
popupSharedProps
|
1400
|
+
);
|
1383
1401
|
function getDirection(x, y) {
|
1384
1402
|
if (x > y) {
|
1385
1403
|
return "horizontal";
|
@@ -1446,7 +1464,10 @@
|
|
1446
1464
|
const onTouchMove = (event) => {
|
1447
1465
|
touch.move(event);
|
1448
1466
|
const direction = touch.deltaY.value > 0 ? DIRECTION_DOWN : DIRECTION_UP;
|
1449
|
-
const el = getScrollParent$1(
|
1467
|
+
const el = getScrollParent$1(
|
1468
|
+
event.target,
|
1469
|
+
rootRef.value
|
1470
|
+
);
|
1450
1471
|
const { scrollHeight, offsetHeight, scrollTop } = el;
|
1451
1472
|
let status = "11";
|
1452
1473
|
if (scrollTop === 0) {
|
@@ -1487,11 +1508,15 @@
|
|
1487
1508
|
}
|
1488
1509
|
function useLazyRender(show) {
|
1489
1510
|
const inited = vue.ref(false);
|
1490
|
-
vue.watch(
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1511
|
+
vue.watch(
|
1512
|
+
show,
|
1513
|
+
(value) => {
|
1514
|
+
if (value) {
|
1515
|
+
inited.value = value;
|
1516
|
+
}
|
1517
|
+
},
|
1518
|
+
{ immediate: true }
|
1519
|
+
);
|
1495
1520
|
return (render) => () => inited.value ? render() : null;
|
1496
1521
|
}
|
1497
1522
|
const [name$1n, bem$1j] = createNamespace("overlay");
|
@@ -1510,9 +1535,12 @@
|
|
1510
1535
|
setup(props, {
|
1511
1536
|
slots
|
1512
1537
|
}) {
|
1538
|
+
const root = vue.ref();
|
1513
1539
|
const lazyRender = useLazyRender(() => props.show || !props.lazyRender);
|
1514
|
-
const
|
1515
|
-
|
1540
|
+
const onTouchMove = (event) => {
|
1541
|
+
if (props.lockScroll) {
|
1542
|
+
preventDefault(event, true);
|
1543
|
+
}
|
1516
1544
|
};
|
1517
1545
|
const renderOverlay = lazyRender(() => {
|
1518
1546
|
var _a;
|
@@ -1521,11 +1549,14 @@
|
|
1521
1549
|
style.animationDuration = `${props.duration}s`;
|
1522
1550
|
}
|
1523
1551
|
return vue.withDirectives(vue.createVNode("div", {
|
1552
|
+
"ref": root,
|
1524
1553
|
"style": style,
|
1525
|
-
"class": [bem$1j(), props.className]
|
1526
|
-
"onTouchmove": props.lockScroll ? preventTouchMove : noop
|
1554
|
+
"class": [bem$1j(), props.className]
|
1527
1555
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), [[vue.vShow, props.show]]);
|
1528
1556
|
});
|
1557
|
+
useEventListener("touchmove", onTouchMove, {
|
1558
|
+
target: root
|
1559
|
+
});
|
1529
1560
|
return () => vue.createVNode(vue.Transition, {
|
1530
1561
|
"name": "van-fade",
|
1531
1562
|
"appear": true
|
@@ -1901,6 +1932,7 @@
|
|
1901
1932
|
let touchStartTime;
|
1902
1933
|
let momentumOffset;
|
1903
1934
|
let transitionEndTrigger;
|
1935
|
+
const root = vue.ref();
|
1904
1936
|
const wrapper = vue.ref();
|
1905
1937
|
const state = vue.reactive({
|
1906
1938
|
index: props.defaultIndex,
|
@@ -2076,10 +2108,13 @@
|
|
2076
2108
|
});
|
2077
2109
|
vue.watch(() => props.initialOptions, setOptions);
|
2078
2110
|
vue.watch(() => props.defaultIndex, (value) => setIndex(value));
|
2111
|
+
useEventListener("touchmove", onTouchMove, {
|
2112
|
+
target: root
|
2113
|
+
});
|
2079
2114
|
return () => vue.createVNode("div", {
|
2115
|
+
"ref": root,
|
2080
2116
|
"class": [bem$1g(), props.className],
|
2081
2117
|
"onTouchstartPassive": onTouchStart,
|
2082
|
-
"onTouchmove": onTouchMove,
|
2083
2118
|
"onTouchend": onTouchEnd,
|
2084
2119
|
"onTouchcancel": onTouchEnd
|
2085
2120
|
}, [vue.createVNode("ul", {
|
@@ -2123,6 +2158,7 @@
|
|
2123
2158
|
slots
|
2124
2159
|
}) {
|
2125
2160
|
const hasOptions = vue.ref(false);
|
2161
|
+
const columnsRef = vue.ref();
|
2126
2162
|
const formattedColumns = vue.ref([]);
|
2127
2163
|
const columnsFieldNames = vue.computed(() => {
|
2128
2164
|
const {
|
@@ -2359,14 +2395,17 @@
|
|
2359
2395
|
height: `${wrapHeight}px`
|
2360
2396
|
};
|
2361
2397
|
return vue.createVNode("div", {
|
2398
|
+
"ref": columnsRef,
|
2362
2399
|
"class": bem$1f("columns"),
|
2363
|
-
"style": columnsStyle
|
2364
|
-
"onTouchmove": preventDefault
|
2400
|
+
"style": columnsStyle
|
2365
2401
|
}, [renderColumnItems(), renderMask(wrapHeight)]);
|
2366
2402
|
};
|
2367
2403
|
vue.watch(() => props.columns, format2, {
|
2368
2404
|
immediate: true
|
2369
2405
|
});
|
2406
|
+
useEventListener("touchmove", preventDefault, {
|
2407
|
+
target: columnsRef
|
2408
|
+
});
|
2370
2409
|
useExpose({
|
2371
2410
|
confirm,
|
2372
2411
|
getValues,
|
@@ -3041,6 +3080,7 @@
|
|
3041
3080
|
validateMessage: ""
|
3042
3081
|
});
|
3043
3082
|
const inputRef = vue.ref();
|
3083
|
+
const clearIconRef = vue.ref();
|
3044
3084
|
const customValue = vue.ref();
|
3045
3085
|
const {
|
3046
3086
|
parent: form
|
@@ -3356,9 +3396,9 @@
|
|
3356
3396
|
const renderFieldBody = () => [vue.createVNode("div", {
|
3357
3397
|
"class": bem$1b("body")
|
3358
3398
|
}, [renderInput(), showClear.value && vue.createVNode(Icon, {
|
3399
|
+
"ref": clearIconRef,
|
3359
3400
|
"name": props.clearIcon,
|
3360
|
-
"class": bem$1b("clear")
|
3361
|
-
"onTouchstart": onClear
|
3401
|
+
"class": bem$1b("clear")
|
3362
3402
|
}, null), renderRightIcon(), slots.button && vue.createVNode("div", {
|
3363
3403
|
"class": bem$1b("button")
|
3364
3404
|
}, [slots.button()])]), renderWordLimit(), renderMessage()];
|
@@ -3385,6 +3425,12 @@
|
|
3385
3425
|
updateValue(getModelValue(), props.formatTrigger);
|
3386
3426
|
vue.nextTick(adjustTextareaSize);
|
3387
3427
|
});
|
3428
|
+
useEventListener("touchstart", onClear, {
|
3429
|
+
target: vue.computed(() => {
|
3430
|
+
var _a;
|
3431
|
+
return (_a = clearIconRef.value) == null ? void 0 : _a.$el;
|
3432
|
+
})
|
3433
|
+
});
|
3388
3434
|
return () => {
|
3389
3435
|
const disabled = getProp("disabled");
|
3390
3436
|
const labelAlign = getProp("labelAlign");
|
@@ -5105,7 +5151,8 @@
|
|
5105
5151
|
const {
|
5106
5152
|
type,
|
5107
5153
|
minDate,
|
5108
|
-
maxDate
|
5154
|
+
maxDate,
|
5155
|
+
allowSameDay
|
5109
5156
|
} = props;
|
5110
5157
|
if (defaultDate === null) {
|
5111
5158
|
return defaultDate;
|
@@ -5115,8 +5162,8 @@
|
|
5115
5162
|
if (!Array.isArray(defaultDate)) {
|
5116
5163
|
defaultDate = [];
|
5117
5164
|
}
|
5118
|
-
const start2 = limitDateRange(defaultDate[0] || now, minDate, getPrevDay(maxDate));
|
5119
|
-
const end2 = limitDateRange(defaultDate[1] || now, getNextDay(minDate));
|
5165
|
+
const start2 = limitDateRange(defaultDate[0] || now, minDate, allowSameDay ? maxDate : getPrevDay(maxDate));
|
5166
|
+
const end2 = limitDateRange(defaultDate[1] || now, allowSameDay ? minDate : getNextDay(minDate));
|
5120
5167
|
return [start2, end2];
|
5121
5168
|
}
|
5122
5169
|
if (type === "multiple") {
|
@@ -5435,6 +5482,7 @@
|
|
5435
5482
|
fit: String,
|
5436
5483
|
position: String,
|
5437
5484
|
round: Boolean,
|
5485
|
+
block: Boolean,
|
5438
5486
|
width: numericProp,
|
5439
5487
|
height: numericProp,
|
5440
5488
|
radius: numericProp,
|
@@ -5563,7 +5611,8 @@
|
|
5563
5611
|
var _a;
|
5564
5612
|
return vue.createVNode("div", {
|
5565
5613
|
"class": bem$10({
|
5566
|
-
round: props.round
|
5614
|
+
round: props.round,
|
5615
|
+
block: props.block
|
5567
5616
|
}),
|
5568
5617
|
"style": style.value
|
5569
5618
|
}, [renderImage(), renderPlaceholder(), (_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
@@ -5725,9 +5774,12 @@
|
|
5725
5774
|
if (!inBrowser$1 || !window.IntersectionObserver) {
|
5726
5775
|
return;
|
5727
5776
|
}
|
5728
|
-
const observer = new IntersectionObserver(
|
5729
|
-
|
5730
|
-
|
5777
|
+
const observer = new IntersectionObserver(
|
5778
|
+
(entries) => {
|
5779
|
+
onChange(entries[0].intersectionRatio > 0);
|
5780
|
+
},
|
5781
|
+
{ root: document.body }
|
5782
|
+
);
|
5731
5783
|
const observe = () => {
|
5732
5784
|
if (target.value) {
|
5733
5785
|
observer.observe(target.value);
|
@@ -5963,6 +6015,7 @@
|
|
5963
6015
|
slots
|
5964
6016
|
}) {
|
5965
6017
|
const root = vue.ref();
|
6018
|
+
const track = vue.ref();
|
5966
6019
|
const state = vue.reactive({
|
5967
6020
|
rect: null,
|
5968
6021
|
width: 0,
|
@@ -6149,10 +6202,13 @@
|
|
6149
6202
|
if (props.touchable && state.swiping) {
|
6150
6203
|
touch.move(event);
|
6151
6204
|
if (isCorrectDirection.value) {
|
6152
|
-
|
6153
|
-
|
6154
|
-
|
6155
|
-
|
6205
|
+
const isEdgeTouch = !props.loop && (state.active === 0 && delta.value > 0 || state.active === count.value - 1 && delta.value < 0);
|
6206
|
+
if (!isEdgeTouch) {
|
6207
|
+
preventDefault(event, props.stopPropagation);
|
6208
|
+
move({
|
6209
|
+
offset: delta.value
|
6210
|
+
});
|
6211
|
+
}
|
6156
6212
|
}
|
6157
6213
|
}
|
6158
6214
|
};
|
@@ -6262,18 +6318,21 @@
|
|
6262
6318
|
onPopupReopen(() => initialize(state.active));
|
6263
6319
|
vue.onDeactivated(stopAutoplay);
|
6264
6320
|
vue.onBeforeUnmount(stopAutoplay);
|
6321
|
+
useEventListener("touchmove", onTouchMove, {
|
6322
|
+
target: track
|
6323
|
+
});
|
6265
6324
|
return () => {
|
6266
6325
|
var _a;
|
6267
6326
|
return vue.createVNode("div", {
|
6268
6327
|
"ref": root,
|
6269
6328
|
"class": bem$Y()
|
6270
6329
|
}, [vue.createVNode("div", {
|
6330
|
+
"ref": track,
|
6271
6331
|
"style": trackStyle.value,
|
6272
6332
|
"class": bem$Y("track", {
|
6273
6333
|
vertical: props.vertical
|
6274
6334
|
}),
|
6275
6335
|
"onTouchstartPassive": onTouchStart,
|
6276
|
-
"onTouchmove": onTouchMove,
|
6277
6336
|
"onTouchend": onTouchEnd,
|
6278
6337
|
"onTouchcancel": onTouchEnd
|
6279
6338
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), renderIndicator()]);
|
@@ -6463,7 +6522,7 @@
|
|
6463
6522
|
index += diff;
|
6464
6523
|
}
|
6465
6524
|
};
|
6466
|
-
const setCurrentIndex = (currentIndex) => {
|
6525
|
+
const setCurrentIndex = (currentIndex, skipScrollIntoView) => {
|
6467
6526
|
const newIndex = findAvailableTab(currentIndex);
|
6468
6527
|
if (!isDef(newIndex)) {
|
6469
6528
|
return;
|
@@ -6478,11 +6537,18 @@
|
|
6478
6537
|
emit("change", newName, newTab.title);
|
6479
6538
|
}
|
6480
6539
|
}
|
6540
|
+
if (!skipScrollIntoView) {
|
6541
|
+
scrollIntoView();
|
6542
|
+
}
|
6543
|
+
setLine();
|
6544
|
+
if (stickyFixed && !props.scrollspy) {
|
6545
|
+
setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
|
6546
|
+
}
|
6481
6547
|
};
|
6482
|
-
const setCurrentIndexByName = (name2) => {
|
6548
|
+
const setCurrentIndexByName = (name2, skipScrollIntoView) => {
|
6483
6549
|
const matched = children.find((tab, index2) => getTabName(tab, index2) === name2);
|
6484
6550
|
const index = matched ? children.indexOf(matched) : 0;
|
6485
|
-
setCurrentIndex(index);
|
6551
|
+
setCurrentIndex(index, skipScrollIntoView);
|
6486
6552
|
};
|
6487
6553
|
const scrollToCurrentContent = (immediate = false) => {
|
6488
6554
|
if (props.scrollspy) {
|
@@ -6612,15 +6678,8 @@
|
|
6612
6678
|
});
|
6613
6679
|
}
|
6614
6680
|
});
|
6615
|
-
vue.watch(() => state.currentIndex, () => {
|
6616
|
-
scrollIntoView();
|
6617
|
-
setLine();
|
6618
|
-
if (stickyFixed && !props.scrollspy) {
|
6619
|
-
setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
|
6620
|
-
}
|
6621
|
-
});
|
6622
6681
|
const init = () => {
|
6623
|
-
setCurrentIndexByName(props.active);
|
6682
|
+
setCurrentIndexByName(props.active, true);
|
6624
6683
|
vue.nextTick(() => {
|
6625
6684
|
state.inited = true;
|
6626
6685
|
if (wrapRef.value) {
|
@@ -6807,6 +6866,16 @@
|
|
6807
6866
|
}
|
6808
6867
|
return isActive;
|
6809
6868
|
});
|
6869
|
+
const hasInactiveClass = vue.ref(!active.value);
|
6870
|
+
vue.watch(active, (val) => {
|
6871
|
+
if (val) {
|
6872
|
+
hasInactiveClass.value = false;
|
6873
|
+
} else {
|
6874
|
+
doubleRaf(() => {
|
6875
|
+
hasInactiveClass.value = true;
|
6876
|
+
});
|
6877
|
+
}
|
6878
|
+
});
|
6810
6879
|
vue.watch(() => props.title, () => {
|
6811
6880
|
parent.setLine();
|
6812
6881
|
parent.scrollIntoView();
|
@@ -6830,7 +6899,7 @@
|
|
6830
6899
|
"id": id,
|
6831
6900
|
"role": "tabpanel",
|
6832
6901
|
"class": bem$U("panel-wrapper", {
|
6833
|
-
inactive:
|
6902
|
+
inactive: hasInactiveClass.value
|
6834
6903
|
}),
|
6835
6904
|
"tabindex": active.value ? 0 : -1,
|
6836
6905
|
"aria-hidden": !active.value,
|
@@ -8053,7 +8122,9 @@
|
|
8053
8122
|
const CountDown = withInstall(stdin_default$O);
|
8054
8123
|
function getDate(timeStamp) {
|
8055
8124
|
const date = new Date(timeStamp * 1e3);
|
8056
|
-
return `${date.getFullYear()}.${padZero(date.getMonth() + 1)}.${padZero(
|
8125
|
+
return `${date.getFullYear()}.${padZero(date.getMonth() + 1)}.${padZero(
|
8126
|
+
date.getDate()
|
8127
|
+
)}`;
|
8057
8128
|
}
|
8058
8129
|
const formatDiscount = (discount) => (discount / 10).toFixed(discount % 10 === 0 ? 0 : 1);
|
8059
8130
|
const formatAmount = (amount) => (amount / 100).toFixed(amount % 100 === 0 ? 0 : amount % 10 === 0 ? 1 : 2);
|
@@ -9852,6 +9923,7 @@
|
|
9852
9923
|
displayHeight: 0
|
9853
9924
|
});
|
9854
9925
|
const touch = useTouch();
|
9926
|
+
const swipeItem = vue.ref();
|
9855
9927
|
const vertical = vue.computed(() => {
|
9856
9928
|
const {
|
9857
9929
|
rootWidth,
|
@@ -10037,6 +10109,12 @@
|
|
10037
10109
|
resetScale();
|
10038
10110
|
}
|
10039
10111
|
});
|
10112
|
+
useEventListener("touchmove", onTouchMove, {
|
10113
|
+
target: vue.computed(() => {
|
10114
|
+
var _a;
|
10115
|
+
return (_a = swipeItem.value) == null ? void 0 : _a.$el;
|
10116
|
+
})
|
10117
|
+
});
|
10040
10118
|
return () => {
|
10041
10119
|
const imageSlots = {
|
10042
10120
|
loading: () => vue.createVNode(Loading, {
|
@@ -10044,9 +10122,9 @@
|
|
10044
10122
|
}, null)
|
10045
10123
|
};
|
10046
10124
|
return vue.createVNode(SwipeItem, {
|
10125
|
+
"ref": swipeItem,
|
10047
10126
|
"class": bem$v("swipe-item"),
|
10048
10127
|
"onTouchstartPassive": onTouchStart,
|
10049
|
-
"onTouchmove": onTouchMove,
|
10050
10128
|
"onTouchend": onTouchEnd,
|
10051
10129
|
"onTouchcancel": onTouchEnd
|
10052
10130
|
}, {
|
@@ -10300,6 +10378,7 @@
|
|
10300
10378
|
slots
|
10301
10379
|
}) {
|
10302
10380
|
const root = vue.ref();
|
10381
|
+
const sidebar = vue.ref();
|
10303
10382
|
const activeAnchor = vue.ref("");
|
10304
10383
|
const touch = useTouch();
|
10305
10384
|
const scrollParent = useScrollParent(root);
|
@@ -10419,11 +10498,11 @@
|
|
10419
10498
|
const {
|
10420
10499
|
offsetHeight
|
10421
10500
|
} = document.documentElement;
|
10501
|
+
match.$el.scrollIntoView();
|
10422
10502
|
if (scrollTop === offsetHeight - scrollParentRect.height) {
|
10423
10503
|
onScroll();
|
10424
10504
|
return;
|
10425
10505
|
}
|
10426
|
-
match.$el.scrollIntoView();
|
10427
10506
|
if (props.sticky && props.stickyOffsetTop) {
|
10428
10507
|
setRootScrollTop(getRootScrollTop() - props.stickyOffsetTop);
|
10429
10508
|
}
|
@@ -10463,15 +10542,18 @@
|
|
10463
10542
|
}
|
10464
10543
|
};
|
10465
10544
|
const renderSidebar = () => vue.createVNode("div", {
|
10545
|
+
"ref": sidebar,
|
10466
10546
|
"class": bem$t("sidebar"),
|
10467
10547
|
"style": sidebarStyle.value,
|
10468
10548
|
"onClick": onClickSidebar,
|
10469
|
-
"onTouchstartPassive": touch.start
|
10470
|
-
"onTouchmove": onTouchMove
|
10549
|
+
"onTouchstartPassive": touch.start
|
10471
10550
|
}, [renderIndexes()]);
|
10472
10551
|
useExpose({
|
10473
10552
|
scrollTo
|
10474
10553
|
});
|
10554
|
+
useEventListener("touchmove", onTouchMove, {
|
10555
|
+
target: sidebar
|
10556
|
+
});
|
10475
10557
|
return () => {
|
10476
10558
|
var _a;
|
10477
10559
|
return vue.createVNode("div", {
|
@@ -11576,32 +11658,47 @@
|
|
11576
11658
|
return node instanceof OwnElement || node instanceof ShadowRoot;
|
11577
11659
|
}
|
11578
11660
|
var round = Math.round;
|
11579
|
-
function
|
11661
|
+
function getUAString() {
|
11662
|
+
var uaData = navigator.userAgentData;
|
11663
|
+
if (uaData != null && uaData.brands) {
|
11664
|
+
return uaData.brands.map(function(item) {
|
11665
|
+
return item.brand + "/" + item.version;
|
11666
|
+
}).join(" ");
|
11667
|
+
}
|
11668
|
+
return navigator.userAgent;
|
11669
|
+
}
|
11670
|
+
function isLayoutViewport() {
|
11671
|
+
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
11672
|
+
}
|
11673
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
11580
11674
|
if (includeScale === void 0) {
|
11581
11675
|
includeScale = false;
|
11582
11676
|
}
|
11583
|
-
|
11677
|
+
if (isFixedStrategy === void 0) {
|
11678
|
+
isFixedStrategy = false;
|
11679
|
+
}
|
11680
|
+
var clientRect = element.getBoundingClientRect();
|
11584
11681
|
var scaleX = 1;
|
11585
11682
|
var scaleY = 1;
|
11586
|
-
if (isHTMLElement(element)
|
11587
|
-
|
11588
|
-
|
11589
|
-
|
11590
|
-
|
11591
|
-
|
11592
|
-
|
11593
|
-
|
11594
|
-
|
11595
|
-
|
11683
|
+
if (includeScale && isHTMLElement(element)) {
|
11684
|
+
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
11685
|
+
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
11686
|
+
}
|
11687
|
+
var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
|
11688
|
+
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
11689
|
+
var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
11690
|
+
var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
11691
|
+
var width2 = clientRect.width / scaleX;
|
11692
|
+
var height2 = clientRect.height / scaleY;
|
11596
11693
|
return {
|
11597
|
-
width:
|
11598
|
-
height:
|
11599
|
-
top:
|
11600
|
-
right:
|
11601
|
-
bottom:
|
11602
|
-
left:
|
11603
|
-
x
|
11604
|
-
y
|
11694
|
+
width: width2,
|
11695
|
+
height: height2,
|
11696
|
+
top: y,
|
11697
|
+
right: x + width2,
|
11698
|
+
bottom: y + height2,
|
11699
|
+
left: x,
|
11700
|
+
x,
|
11701
|
+
y
|
11605
11702
|
};
|
11606
11703
|
}
|
11607
11704
|
function getWindowScroll(node) {
|
@@ -11655,7 +11752,7 @@
|
|
11655
11752
|
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
11656
11753
|
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
11657
11754
|
var documentElement = getDocumentElement(offsetParent);
|
11658
|
-
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
|
11755
|
+
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
11659
11756
|
var scroll = {
|
11660
11757
|
scrollLeft: 0,
|
11661
11758
|
scrollTop: 0
|
@@ -11737,8 +11834,8 @@
|
|
11737
11834
|
return element.offsetParent;
|
11738
11835
|
}
|
11739
11836
|
function getContainingBlock(element) {
|
11740
|
-
var isFirefox =
|
11741
|
-
var isIE =
|
11837
|
+
var isFirefox = /firefox/i.test(getUAString());
|
11838
|
+
var isIE = /Trident/i.test(getUAString());
|
11742
11839
|
if (isIE && isHTMLElement(element)) {
|
11743
11840
|
var elementCss = getComputedStyle(element);
|
11744
11841
|
if (elementCss.position === "fixed") {
|
@@ -13061,6 +13158,9 @@
|
|
13061
13158
|
}, null)]);
|
13062
13159
|
};
|
13063
13160
|
useCustomFieldValue(() => props.modelValue);
|
13161
|
+
useEventListener("touchmove", onTouchMove, {
|
13162
|
+
target: groupRef
|
13163
|
+
});
|
13064
13164
|
return () => vue.createVNode("div", {
|
13065
13165
|
"ref": groupRef,
|
13066
13166
|
"role": "radiogroup",
|
@@ -13071,8 +13171,7 @@
|
|
13071
13171
|
"tabindex": props.disabled ? void 0 : 0,
|
13072
13172
|
"aria-disabled": props.disabled,
|
13073
13173
|
"aria-readonly": props.readonly,
|
13074
|
-
"onTouchstartPassive": onTouchStart
|
13075
|
-
"onTouchmove": onTouchMove
|
13174
|
+
"onTouchstartPassive": onTouchStart
|
13076
13175
|
}, [list.value.map(renderStar)]);
|
13077
13176
|
}
|
13078
13177
|
});
|
@@ -13508,6 +13607,7 @@
|
|
13508
13607
|
let current2;
|
13509
13608
|
let startValue;
|
13510
13609
|
const root = vue.ref();
|
13610
|
+
const slider = vue.ref();
|
13511
13611
|
const dragStatus = vue.ref();
|
13512
13612
|
const touch = useTouch();
|
13513
13613
|
const scope = vue.computed(() => Number(props.max) - Number(props.min));
|
@@ -13700,6 +13800,7 @@
|
|
13700
13800
|
const renderButton = (index) => {
|
13701
13801
|
const current22 = typeof index === "number" ? props.modelValue[index] : props.modelValue;
|
13702
13802
|
return vue.createVNode("div", {
|
13803
|
+
"ref": slider,
|
13703
13804
|
"role": "slider",
|
13704
13805
|
"class": getButtonClassName(index),
|
13705
13806
|
"tabindex": props.disabled ? void 0 : 0,
|
@@ -13715,7 +13816,6 @@
|
|
13715
13816
|
}
|
13716
13817
|
onTouchStart(event);
|
13717
13818
|
},
|
13718
|
-
"onTouchmove": onTouchMove,
|
13719
13819
|
"onTouchend": onTouchEnd,
|
13720
13820
|
"onTouchcancel": onTouchEnd,
|
13721
13821
|
"onClick": stopPropagation
|
@@ -13723,6 +13823,9 @@
|
|
13723
13823
|
};
|
13724
13824
|
updateValue(props.modelValue);
|
13725
13825
|
useCustomFieldValue(() => props.modelValue);
|
13826
|
+
useEventListener("touchmove", onTouchMove, {
|
13827
|
+
target: slider
|
13828
|
+
});
|
13726
13829
|
return () => vue.createVNode("div", {
|
13727
13830
|
"ref": root,
|
13728
13831
|
"style": wrapperStyle.value,
|
@@ -14444,6 +14547,9 @@
|
|
14444
14547
|
useClickAway(root, () => onClick("outside"), {
|
14445
14548
|
eventName: "touchstart"
|
14446
14549
|
});
|
14550
|
+
useEventListener("touchmove", onTouchMove, {
|
14551
|
+
target: root
|
14552
|
+
});
|
14447
14553
|
return () => {
|
14448
14554
|
var _a;
|
14449
14555
|
const wrapperStyle = {
|
@@ -14455,7 +14561,6 @@
|
|
14455
14561
|
"class": bem$4(),
|
14456
14562
|
"onClick": getClickHandler("cell", lockClick2),
|
14457
14563
|
"onTouchstartPassive": onTouchStart,
|
14458
|
-
"onTouchmove": onTouchMove,
|
14459
14564
|
"onTouchend": onTouchEnd,
|
14460
14565
|
"onTouchcancel": onTouchEnd
|
14461
14566
|
}, [vue.createVNode("div", {
|
@@ -15186,7 +15291,10 @@
|
|
15186
15291
|
tmpWidth = 999998;
|
15187
15292
|
} else {
|
15188
15293
|
tmpSrc = item.substr(0, spaceIndex);
|
15189
|
-
tmpWidth = parseInt(
|
15294
|
+
tmpWidth = parseInt(
|
15295
|
+
item.substr(spaceIndex + 1, item.length - spaceIndex - 2),
|
15296
|
+
10
|
15297
|
+
);
|
15190
15298
|
}
|
15191
15299
|
return [tmpWidth, tmpSrc];
|
15192
15300
|
});
|
@@ -15377,17 +15485,21 @@
|
|
15377
15485
|
}
|
15378
15486
|
renderLoading(cb) {
|
15379
15487
|
this.state.loading = true;
|
15380
|
-
loadImageAsync(
|
15381
|
-
|
15382
|
-
|
15383
|
-
|
15384
|
-
|
15385
|
-
|
15386
|
-
|
15387
|
-
|
15388
|
-
|
15389
|
-
|
15390
|
-
|
15488
|
+
loadImageAsync(
|
15489
|
+
{
|
15490
|
+
src: this.loading,
|
15491
|
+
cors: this.cors
|
15492
|
+
},
|
15493
|
+
() => {
|
15494
|
+
this.render("loading", false);
|
15495
|
+
this.state.loading = false;
|
15496
|
+
cb();
|
15497
|
+
},
|
15498
|
+
() => {
|
15499
|
+
cb();
|
15500
|
+
this.state.loading = false;
|
15501
|
+
}
|
15502
|
+
);
|
15391
15503
|
}
|
15392
15504
|
load(onFinish = noop) {
|
15393
15505
|
if (this.attempt > this.options.attempt - 1 && this.state.error) {
|
@@ -15407,25 +15519,29 @@
|
|
15407
15519
|
this.attempt++;
|
15408
15520
|
(_b = (_a = this.options.adapter).beforeLoad) == null ? void 0 : _b.call(_a, this, this.options);
|
15409
15521
|
this.record("loadStart");
|
15410
|
-
loadImageAsync(
|
15411
|
-
|
15412
|
-
|
15413
|
-
|
15414
|
-
|
15415
|
-
|
15416
|
-
|
15417
|
-
|
15418
|
-
|
15419
|
-
|
15420
|
-
|
15421
|
-
|
15422
|
-
|
15423
|
-
|
15424
|
-
|
15425
|
-
|
15426
|
-
|
15427
|
-
|
15428
|
-
|
15522
|
+
loadImageAsync(
|
15523
|
+
{
|
15524
|
+
src: this.src,
|
15525
|
+
cors: this.cors
|
15526
|
+
},
|
15527
|
+
(data) => {
|
15528
|
+
this.naturalHeight = data.naturalHeight;
|
15529
|
+
this.naturalWidth = data.naturalWidth;
|
15530
|
+
this.state.loaded = true;
|
15531
|
+
this.state.error = false;
|
15532
|
+
this.record("loadEnd");
|
15533
|
+
this.render("loaded", false);
|
15534
|
+
this.state.rendered = true;
|
15535
|
+
this.imageCache.add(this.src);
|
15536
|
+
onFinish();
|
15537
|
+
},
|
15538
|
+
(err) => {
|
15539
|
+
!this.options.silent && console.error(err);
|
15540
|
+
this.state.error = true;
|
15541
|
+
this.state.loaded = false;
|
15542
|
+
this.render("error", false);
|
15543
|
+
}
|
15544
|
+
);
|
15429
15545
|
});
|
15430
15546
|
}
|
15431
15547
|
render(state, cache) {
|
@@ -15510,7 +15626,10 @@
|
|
15510
15626
|
};
|
15511
15627
|
this.initEvent();
|
15512
15628
|
this.imageCache = new ImageCache({ max: 200 });
|
15513
|
-
this.lazyLoadHandler = throttle(
|
15629
|
+
this.lazyLoadHandler = throttle(
|
15630
|
+
this.lazyLoadHandler.bind(this),
|
15631
|
+
this.options.throttleWait
|
15632
|
+
);
|
15514
15633
|
this.setMode(this.options.observer ? modeType.observer : modeType.event);
|
15515
15634
|
}
|
15516
15635
|
config(options = {}) {
|
@@ -15665,7 +15784,9 @@
|
|
15665
15784
|
});
|
15666
15785
|
}
|
15667
15786
|
initListen(el, start2) {
|
15668
|
-
this.options.ListenEvents.forEach(
|
15787
|
+
this.options.ListenEvents.forEach(
|
15788
|
+
(evt) => (start2 ? on : off)(el, evt, this.lazyLoadHandler)
|
15789
|
+
);
|
15669
15790
|
}
|
15670
15791
|
initEvent() {
|
15671
15792
|
this.Event = {
|
@@ -15722,7 +15843,10 @@
|
|
15722
15843
|
if (!hasIntersectionObserver) {
|
15723
15844
|
return;
|
15724
15845
|
}
|
15725
|
-
this.observer = new IntersectionObserver(
|
15846
|
+
this.observer = new IntersectionObserver(
|
15847
|
+
this.observerHandler.bind(this),
|
15848
|
+
this.options.observerOptions
|
15849
|
+
);
|
15726
15850
|
if (this.listeners.length) {
|
15727
15851
|
this.listeners.forEach((listener) => {
|
15728
15852
|
this.observer.observe(listener.el);
|
@@ -15798,7 +15922,10 @@
|
|
15798
15922
|
},
|
15799
15923
|
emits: ["show"],
|
15800
15924
|
render() {
|
15801
|
-
return vue.h(
|
15925
|
+
return vue.h(
|
15926
|
+
this.tag,
|
15927
|
+
this.show && this.$slots.default ? this.$slots.default() : null
|
15928
|
+
);
|
15802
15929
|
},
|
15803
15930
|
data() {
|
15804
15931
|
return {
|
@@ -15850,13 +15977,17 @@
|
|
15850
15977
|
this.options = Object.assign({}, defaultOptions, binding.value);
|
15851
15978
|
const imgs = this.getImgs();
|
15852
15979
|
imgs.forEach((el2) => {
|
15853
|
-
this.lazy.add(
|
15854
|
-
|
15855
|
-
|
15856
|
-
|
15857
|
-
|
15858
|
-
|
15859
|
-
|
15980
|
+
this.lazy.add(
|
15981
|
+
el2,
|
15982
|
+
Object.assign({}, this.binding, {
|
15983
|
+
value: {
|
15984
|
+
src: "dataset" in el2 ? el2.dataset.src : el2.getAttribute("data-src"),
|
15985
|
+
error: ("dataset" in el2 ? el2.dataset.error : el2.getAttribute("data-error")) || this.options.error,
|
15986
|
+
loading: ("dataset" in el2 ? el2.dataset.loading : el2.getAttribute("data-loading")) || this.options.loading
|
15987
|
+
}
|
15988
|
+
}),
|
15989
|
+
this.vnode
|
15990
|
+
);
|
15860
15991
|
});
|
15861
15992
|
}
|
15862
15993
|
getImgs() {
|
@@ -15907,11 +16038,15 @@
|
|
15907
16038
|
}
|
15908
16039
|
},
|
15909
16040
|
render(h) {
|
15910
|
-
return h(
|
15911
|
-
|
15912
|
-
|
15913
|
-
|
15914
|
-
|
16041
|
+
return h(
|
16042
|
+
this.tag,
|
16043
|
+
{
|
16044
|
+
attrs: {
|
16045
|
+
src: this.renderSrc
|
16046
|
+
}
|
16047
|
+
},
|
16048
|
+
this.$slots.default
|
16049
|
+
);
|
15915
16050
|
},
|
15916
16051
|
data() {
|
15917
16052
|
return {
|
@@ -15968,14 +16103,18 @@
|
|
15968
16103
|
return;
|
15969
16104
|
}
|
15970
16105
|
const { src } = this.options;
|
15971
|
-
loadImageAsync(
|
15972
|
-
|
15973
|
-
|
15974
|
-
|
15975
|
-
|
15976
|
-
|
15977
|
-
|
15978
|
-
|
16106
|
+
loadImageAsync(
|
16107
|
+
{ src },
|
16108
|
+
({ src: src2 }) => {
|
16109
|
+
this.renderSrc = src2;
|
16110
|
+
this.state.loaded = true;
|
16111
|
+
},
|
16112
|
+
() => {
|
16113
|
+
this.state.attempt++;
|
16114
|
+
this.renderSrc = this.options.error;
|
16115
|
+
this.state.error = true;
|
16116
|
+
}
|
16117
|
+
);
|
15979
16118
|
}
|
15980
16119
|
}
|
15981
16120
|
});
|
@@ -16003,7 +16142,7 @@
|
|
16003
16142
|
});
|
16004
16143
|
}
|
16005
16144
|
};
|
16006
|
-
const version = "3.6.
|
16145
|
+
const version = "3.6.3";
|
16007
16146
|
function install(app) {
|
16008
16147
|
const components = [
|
16009
16148
|
ActionBar,
|