vant 4.1.0 → 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/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/field/Field.mjs +2 -2
- 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 +1 -1
- package/es/index.mjs +1 -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/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 +3 -2
- 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/index.css +1 -1
- package/es/tree-select/TreeSelect.mjs +1 -1
- 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/index.js +4 -0
- package/lib/dropdown-menu/index.js +4 -0
- package/lib/empty/index.js +4 -0
- package/lib/field/Field.js +2 -2
- 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 +1 -1
- package/lib/index.js +1 -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/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 +3 -2
- 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/index.css +1 -1
- package/lib/text-ellipsis/index.js +4 -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 +1 -1
- 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 +182 -34
- package/lib/vant.es.js +182 -34
- package/lib/vant.js +219 -41
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +5 -5
package/lib/vant.es.js
CHANGED
@@ -539,7 +539,7 @@ var stdin_default$1L = defineComponent({
|
|
539
539
|
if (slots.content) {
|
540
540
|
return slots.content();
|
541
541
|
}
|
542
|
-
if (isDef(max) && isNumeric(content) && +content > max) {
|
542
|
+
if (isDef(max) && isNumeric(content) && +content > +max) {
|
543
543
|
return `${max}+`;
|
544
544
|
}
|
545
545
|
return content;
|
@@ -1046,17 +1046,29 @@ var stdin_default$1F = defineComponent({
|
|
1046
1046
|
});
|
1047
1047
|
const ActionBarIcon = withInstall(stdin_default$1F);
|
1048
1048
|
const popupSharedProps = {
|
1049
|
+
// whether to show popup
|
1049
1050
|
show: Boolean,
|
1051
|
+
// z-index
|
1050
1052
|
zIndex: numericProp,
|
1053
|
+
// whether to show overlay
|
1051
1054
|
overlay: truthProp,
|
1055
|
+
// transition duration
|
1052
1056
|
duration: numericProp,
|
1057
|
+
// teleport
|
1053
1058
|
teleport: [String, Object],
|
1059
|
+
// prevent body scroll
|
1054
1060
|
lockScroll: truthProp,
|
1061
|
+
// whether to lazy render
|
1055
1062
|
lazyRender: truthProp,
|
1063
|
+
// callback function before close
|
1056
1064
|
beforeClose: Function,
|
1065
|
+
// overlay custom style
|
1057
1066
|
overlayStyle: Object,
|
1067
|
+
// overlay custom class name
|
1058
1068
|
overlayClass: unknownProp,
|
1069
|
+
// Initial rendering animation
|
1059
1070
|
transitionAppear: Boolean,
|
1071
|
+
// whether to close popup when overlay is clicked
|
1060
1072
|
closeOnClickOverlay: truthProp
|
1061
1073
|
};
|
1062
1074
|
const popupSharedPropKeys = Object.keys(
|
@@ -1943,7 +1955,9 @@ var stdin_default$1z = defineComponent({
|
|
1943
1955
|
const state = reactive({
|
1944
1956
|
fixed: false,
|
1945
1957
|
width: 0,
|
1958
|
+
// root width
|
1946
1959
|
height: 0,
|
1960
|
+
// root height
|
1947
1961
|
transform: 0
|
1948
1962
|
});
|
1949
1963
|
const offset = computed(() => unitToPx(props.position === "top" ? props.offsetTop : props.offsetBottom));
|
@@ -2278,7 +2292,7 @@ var stdin_default$1x = defineComponent({
|
|
2278
2292
|
const stopAutoplay = () => clearTimeout(autoplayTimer);
|
2279
2293
|
const autoplay = () => {
|
2280
2294
|
stopAutoplay();
|
2281
|
-
if (props.autoplay > 0 && count.value > 1) {
|
2295
|
+
if (+props.autoplay > 0 && count.value > 1) {
|
2282
2296
|
autoplayTimer = setTimeout(() => {
|
2283
2297
|
next();
|
2284
2298
|
autoplay();
|
@@ -2323,7 +2337,8 @@ var stdin_default$1x = defineComponent({
|
|
2323
2337
|
const resize = () => initialize(state.active);
|
2324
2338
|
let touchStartTime;
|
2325
2339
|
const onTouchStart = (event) => {
|
2326
|
-
if (!props.touchable ||
|
2340
|
+
if (!props.touchable || // avoid resetting position on multi-finger touch
|
2341
|
+
event.touches.length > 1)
|
2327
2342
|
return;
|
2328
2343
|
touch.start(event);
|
2329
2344
|
dragging = false;
|
@@ -2595,7 +2610,7 @@ var stdin_default$1v = defineComponent({
|
|
2595
2610
|
lineStyle: {},
|
2596
2611
|
currentIndex: -1
|
2597
2612
|
});
|
2598
|
-
const scrollable = computed(() => children.length > props.swipeThreshold || !props.ellipsis || props.shrink);
|
2613
|
+
const scrollable = computed(() => children.length > +props.swipeThreshold || !props.ellipsis || props.shrink);
|
2599
2614
|
const navStyle = computed(() => ({
|
2600
2615
|
borderColor: props.color,
|
2601
2616
|
background: props.background
|
@@ -3295,6 +3310,7 @@ var stdin_default$1r = defineComponent({
|
|
3295
3310
|
watch(() => props.modelValue, (newValues) => {
|
3296
3311
|
if (!isSameValue(newValues, selectedValues.value) && !isSameValue(newValues, lastEmittedModelValue)) {
|
3297
3312
|
selectedValues.value = newValues.slice(0);
|
3313
|
+
lastEmittedModelValue = newValues.slice(0);
|
3298
3314
|
}
|
3299
3315
|
}, {
|
3300
3316
|
deep: true
|
@@ -3359,8 +3375,8 @@ function formatDataForCascade({
|
|
3359
3375
|
county_list: county = {},
|
3360
3376
|
province_list: province = {}
|
3361
3377
|
} = areaList;
|
3362
|
-
const showCity = columnsNum > 1;
|
3363
|
-
const showCounty = columnsNum > 2;
|
3378
|
+
const showCity = +columnsNum > 1;
|
3379
|
+
const showCounty = +columnsNum > 2;
|
3364
3380
|
const getProvinceChildren = () => {
|
3365
3381
|
if (showCity) {
|
3366
3382
|
return placeholder.length ? [
|
@@ -4015,7 +4031,7 @@ var stdin_default$1n = defineComponent({
|
|
4015
4031
|
const {
|
4016
4032
|
maxlength
|
4017
4033
|
} = props;
|
4018
|
-
if (isDef(maxlength) && getStringLength(value) > maxlength) {
|
4034
|
+
if (isDef(maxlength) && getStringLength(value) > +maxlength) {
|
4019
4035
|
const modelValue = getModelValue();
|
4020
4036
|
if (modelValue && getStringLength(modelValue) === +maxlength) {
|
4021
4037
|
return modelValue;
|
@@ -4046,7 +4062,7 @@ var stdin_default$1n = defineComponent({
|
|
4046
4062
|
maxlength
|
4047
4063
|
} = props;
|
4048
4064
|
value = formatter(value);
|
4049
|
-
if (isDef(maxlength) && getStringLength(value) > maxlength) {
|
4065
|
+
if (isDef(maxlength) && getStringLength(value) > +maxlength) {
|
4050
4066
|
value = cutString(value, +maxlength);
|
4051
4067
|
}
|
4052
4068
|
if (inputRef.value && state.focused) {
|
@@ -5637,7 +5653,7 @@ var stdin_default$1c = defineComponent({
|
|
5637
5653
|
});
|
5638
5654
|
};
|
5639
5655
|
const scroll = () => {
|
5640
|
-
show.value = scrollParent.value ? getScrollTop(scrollParent.value) >= props.offset : false;
|
5656
|
+
show.value = scrollParent.value ? getScrollTop(scrollParent.value) >= +props.offset : false;
|
5641
5657
|
};
|
5642
5658
|
const getTarget = () => {
|
5643
5659
|
const {
|
@@ -5723,7 +5739,7 @@ function getDayByOffset(date, offset) {
|
|
5723
5739
|
const getPrevDay = (date) => getDayByOffset(date, -1);
|
5724
5740
|
const getNextDay = (date) => getDayByOffset(date, 1);
|
5725
5741
|
const getToday = () => {
|
5726
|
-
const today = new Date();
|
5742
|
+
const today = /* @__PURE__ */ new Date();
|
5727
5743
|
today.setHours(0, 0, 0, 0);
|
5728
5744
|
return today;
|
5729
5745
|
};
|
@@ -6361,7 +6377,7 @@ var stdin_default$18 = defineComponent({
|
|
6361
6377
|
rangePrompt,
|
6362
6378
|
showRangePrompt
|
6363
6379
|
} = props;
|
6364
|
-
if (maxRange && calcDateNum(date) > maxRange) {
|
6380
|
+
if (maxRange && calcDateNum(date) > +maxRange) {
|
6365
6381
|
if (showRangePrompt) {
|
6366
6382
|
showToast(rangePrompt || t$f("rangePrompt", maxRange));
|
6367
6383
|
}
|
@@ -6448,7 +6464,7 @@ var stdin_default$18 = defineComponent({
|
|
6448
6464
|
if (selectedIndex !== -1) {
|
6449
6465
|
const [unselectedDate] = dates.splice(selectedIndex, 1);
|
6450
6466
|
emit("unselect", cloneDate(unselectedDate));
|
6451
|
-
} else if (props.maxRange && dates.length >= props.maxRange) {
|
6467
|
+
} else if (props.maxRange && dates.length >= +props.maxRange) {
|
6452
6468
|
showToast(props.rangePrompt || t$f("rangePrompt", props.maxRange));
|
6453
6469
|
} else {
|
6454
6470
|
select([...dates, date]);
|
@@ -7175,7 +7191,7 @@ var stdin_default$12 = defineComponent({
|
|
7175
7191
|
} = parent.props;
|
7176
7192
|
const value = modelValue.slice();
|
7177
7193
|
if (checked2) {
|
7178
|
-
const overlimit = max && value.length >= max;
|
7194
|
+
const overlimit = max && value.length >= +max;
|
7179
7195
|
if (!overlimit && !value.includes(name2)) {
|
7180
7196
|
value.push(name2);
|
7181
7197
|
if (props.bindGroup) {
|
@@ -8655,7 +8671,7 @@ var stdin_default$R = defineComponent({
|
|
8655
8671
|
}
|
8656
8672
|
});
|
8657
8673
|
const CouponList = withInstall(stdin_default$R);
|
8658
|
-
const currentYear = new Date().getFullYear();
|
8674
|
+
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
8659
8675
|
const [name$H] = createNamespace("date-picker");
|
8660
8676
|
const datePickerProps = extend({}, sharedProps, {
|
8661
8677
|
columnsType: {
|
@@ -9453,7 +9469,7 @@ var stdin_default$K = defineComponent({
|
|
9453
9469
|
} else if (gutter) {
|
9454
9470
|
const gutterValue = addUnit(gutter);
|
9455
9471
|
style.paddingRight = gutterValue;
|
9456
|
-
if (index.value >= columnNum) {
|
9472
|
+
if (index.value >= +columnNum) {
|
9457
9473
|
style.marginTop = gutterValue;
|
9458
9474
|
}
|
9459
9475
|
}
|
@@ -9754,8 +9770,9 @@ var stdin_default$J = defineComponent({
|
|
9754
9770
|
if (state.scale < 1) {
|
9755
9771
|
resetScale();
|
9756
9772
|
}
|
9757
|
-
|
9758
|
-
|
9773
|
+
const maxZoom = +props.maxZoom;
|
9774
|
+
if (state.scale > maxZoom) {
|
9775
|
+
state.scale = maxZoom;
|
9759
9776
|
}
|
9760
9777
|
}
|
9761
9778
|
}
|
@@ -10358,13 +10375,14 @@ var stdin_default$F = defineComponent({
|
|
10358
10375
|
const scrollParent = useScrollParent(root);
|
10359
10376
|
const check = () => {
|
10360
10377
|
nextTick(() => {
|
10361
|
-
if (loading.value || props.finished || props.disabled || props.error ||
|
10378
|
+
if (loading.value || props.finished || props.disabled || props.error || // skip check when inside an inactive tab
|
10379
|
+
(tabStatus == null ? void 0 : tabStatus.value) === false) {
|
10362
10380
|
return;
|
10363
10381
|
}
|
10364
10382
|
const {
|
10365
|
-
offset,
|
10366
10383
|
direction
|
10367
10384
|
} = props;
|
10385
|
+
const offset = +props.offset;
|
10368
10386
|
const scrollParentRect = useRect(scrollParent);
|
10369
10387
|
if (!scrollParentRect.height || isHidden(root)) {
|
10370
10388
|
return;
|
@@ -10997,7 +11015,7 @@ var stdin_default$A = defineComponent({
|
|
10997
11015
|
emit("update:modelValue", value.slice(0, value.length - 1));
|
10998
11016
|
} else if (type === "close") {
|
10999
11017
|
onClose();
|
11000
|
-
} else if (value.length < props.maxlength) {
|
11018
|
+
} else if (value.length < +props.maxlength) {
|
11001
11019
|
emit("input", text);
|
11002
11020
|
emit("update:modelValue", value + text);
|
11003
11021
|
}
|
@@ -11271,10 +11289,10 @@ var stdin_default$y = defineComponent({
|
|
11271
11289
|
const {
|
11272
11290
|
mask,
|
11273
11291
|
value,
|
11274
|
-
length,
|
11275
11292
|
gutter,
|
11276
11293
|
focused
|
11277
11294
|
} = props;
|
11295
|
+
const length = +props.length;
|
11278
11296
|
for (let i = 0; i < length; i++) {
|
11279
11297
|
const char = value[i];
|
11280
11298
|
const showBorder = i !== 0 && !gutter;
|
@@ -11527,7 +11545,7 @@ const progressProps = {
|
|
11527
11545
|
percentage: {
|
11528
11546
|
type: numericProp,
|
11529
11547
|
default: 0,
|
11530
|
-
validator: (value) => value >= 0 && value <= 100
|
11548
|
+
validator: (value) => +value >= 0 && +value <= 100
|
11531
11549
|
}
|
11532
11550
|
};
|
11533
11551
|
var stdin_default$w = defineComponent({
|
@@ -12001,7 +12019,7 @@ var stdin_default$t = defineComponent({
|
|
12001
12019
|
attrs
|
12002
12020
|
}) {
|
12003
12021
|
const id = useId();
|
12004
|
-
const
|
12022
|
+
const fieldRef = ref();
|
12005
12023
|
const onCancel = () => {
|
12006
12024
|
if (!slots.action) {
|
12007
12025
|
emit("update:modelValue", "");
|
@@ -12037,11 +12055,11 @@ var stdin_default$t = defineComponent({
|
|
12037
12055
|
};
|
12038
12056
|
const blur = () => {
|
12039
12057
|
var _a;
|
12040
|
-
return (_a =
|
12058
|
+
return (_a = fieldRef.value) == null ? void 0 : _a.blur();
|
12041
12059
|
};
|
12042
12060
|
const focus = () => {
|
12043
12061
|
var _a;
|
12044
|
-
return (_a =
|
12062
|
+
return (_a = fieldRef.value) == null ? void 0 : _a.focus();
|
12045
12063
|
};
|
12046
12064
|
const onBlur = (event) => emit("blur", event);
|
12047
12065
|
const onFocus = (event) => emit("focus", event);
|
@@ -12056,7 +12074,7 @@ var stdin_default$t = defineComponent({
|
|
12056
12074
|
});
|
12057
12075
|
const onInput = (value) => emit("update:modelValue", value);
|
12058
12076
|
return createVNode(Field, mergeProps({
|
12059
|
-
"ref":
|
12077
|
+
"ref": fieldRef,
|
12060
12078
|
"type": "search",
|
12061
12079
|
"class": bem$k("field"),
|
12062
12080
|
"border": false,
|
@@ -13029,8 +13047,8 @@ var stdin_default$d = defineComponent({
|
|
13029
13047
|
let actionType;
|
13030
13048
|
const inputRef = ref();
|
13031
13049
|
const current2 = ref(getInitialValue());
|
13032
|
-
const minusDisabled = computed(() => props.disabled || props.disableMinus || current2.value <= +props.min);
|
13033
|
-
const plusDisabled = computed(() => props.disabled || props.disablePlus || current2.value >= +props.max);
|
13050
|
+
const minusDisabled = computed(() => props.disabled || props.disableMinus || +current2.value <= +props.min);
|
13051
|
+
const plusDisabled = computed(() => props.disabled || props.disablePlus || +current2.value >= +props.max);
|
13034
13052
|
const inputStyle = computed(() => ({
|
13035
13053
|
width: addUnit(props.inputWidth),
|
13036
13054
|
height: addUnit(props.buttonSize)
|
@@ -13853,7 +13871,7 @@ var stdin_default$6 = defineComponent({
|
|
13853
13871
|
const index = activeId.indexOf(item.id);
|
13854
13872
|
if (index !== -1) {
|
13855
13873
|
activeId.splice(index, 1);
|
13856
|
-
} else if (activeId.length < props.max) {
|
13874
|
+
} else if (activeId.length < +props.max) {
|
13857
13875
|
activeId.push(item.id);
|
13858
13876
|
}
|
13859
13877
|
} else {
|
@@ -13940,7 +13958,7 @@ function isOversize(items, maxSize) {
|
|
13940
13958
|
if (isFunction(maxSize)) {
|
13941
13959
|
return maxSize(item.file);
|
13942
13960
|
}
|
13943
|
-
return item.file.size > maxSize;
|
13961
|
+
return item.file.size > +maxSize;
|
13944
13962
|
}
|
13945
13963
|
return false;
|
13946
13964
|
});
|
@@ -13957,7 +13975,7 @@ function filterFiles(items, maxSize) {
|
|
13957
13975
|
});
|
13958
13976
|
return { valid, invalid };
|
13959
13977
|
}
|
13960
|
-
const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
|
13978
|
+
const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg|avif)/i;
|
13961
13979
|
const isImageUrl = (url) => IMAGE_REGEXP.test(url);
|
13962
13980
|
function isImageFile(item) {
|
13963
13981
|
if (item.isImage) {
|
@@ -14274,7 +14292,7 @@ var stdin_default$4 = defineComponent({
|
|
14274
14292
|
};
|
14275
14293
|
const onClickUpload = (event) => emit("clickUpload", event);
|
14276
14294
|
const renderUpload = () => {
|
14277
|
-
if (props.modelValue.length >= props.maxCount) {
|
14295
|
+
if (props.modelValue.length >= +props.maxCount) {
|
14278
14296
|
return;
|
14279
14297
|
}
|
14280
14298
|
const Input = props.readonly ? null : createVNode("input", {
|
@@ -14363,6 +14381,10 @@ class ReactiveListener {
|
|
14363
14381
|
this.initState();
|
14364
14382
|
this.render("loading", false);
|
14365
14383
|
}
|
14384
|
+
/*
|
14385
|
+
* init listener state
|
14386
|
+
* @return
|
14387
|
+
*/
|
14366
14388
|
initState() {
|
14367
14389
|
if ("dataset" in this.el) {
|
14368
14390
|
this.el.dataset.src = this.src;
|
@@ -14376,9 +14398,20 @@ class ReactiveListener {
|
|
14376
14398
|
rendered: false
|
14377
14399
|
};
|
14378
14400
|
}
|
14401
|
+
/*
|
14402
|
+
* record performance
|
14403
|
+
* @return
|
14404
|
+
*/
|
14379
14405
|
record(event) {
|
14380
14406
|
this.performanceData[event] = Date.now();
|
14381
14407
|
}
|
14408
|
+
/*
|
14409
|
+
* update image listener data
|
14410
|
+
* @param {String} image uri
|
14411
|
+
* @param {String} loading image uri
|
14412
|
+
* @param {String} error image uri
|
14413
|
+
* @return
|
14414
|
+
*/
|
14382
14415
|
update({ src, loading, error }) {
|
14383
14416
|
const oldSrc = this.src;
|
14384
14417
|
this.src = src;
|
@@ -14390,15 +14423,27 @@ class ReactiveListener {
|
|
14390
14423
|
this.initState();
|
14391
14424
|
}
|
14392
14425
|
}
|
14426
|
+
/*
|
14427
|
+
* check el is in view
|
14428
|
+
* @return {Boolean} el is in view
|
14429
|
+
*/
|
14393
14430
|
checkInView() {
|
14394
14431
|
const rect = useRect(this.el);
|
14395
14432
|
return rect.top < window.innerHeight * this.options.preLoad && rect.bottom > this.options.preLoadTop && rect.left < window.innerWidth * this.options.preLoad && rect.right > 0;
|
14396
14433
|
}
|
14434
|
+
/*
|
14435
|
+
* listener filter
|
14436
|
+
*/
|
14397
14437
|
filter() {
|
14398
14438
|
Object.keys(this.options.filter).forEach((key) => {
|
14399
14439
|
this.options.filter[key](this, this.options);
|
14400
14440
|
});
|
14401
14441
|
}
|
14442
|
+
/*
|
14443
|
+
* render loading first
|
14444
|
+
* @params cb:Function
|
14445
|
+
* @return
|
14446
|
+
*/
|
14402
14447
|
renderLoading(cb) {
|
14403
14448
|
this.state.loading = true;
|
14404
14449
|
loadImageAsync(
|
@@ -14421,6 +14466,10 @@ class ReactiveListener {
|
|
14421
14466
|
}
|
14422
14467
|
);
|
14423
14468
|
}
|
14469
|
+
/*
|
14470
|
+
* try load image and render it
|
14471
|
+
* @return
|
14472
|
+
*/
|
14424
14473
|
load(onFinish = noop) {
|
14425
14474
|
if (this.attempt > this.options.attempt - 1 && this.state.error) {
|
14426
14475
|
if (process.env.NODE_ENV !== "production" && !this.options.silent) {
|
@@ -14469,9 +14518,19 @@ class ReactiveListener {
|
|
14469
14518
|
);
|
14470
14519
|
});
|
14471
14520
|
}
|
14521
|
+
/*
|
14522
|
+
* render image
|
14523
|
+
* @param {String} state to render // ['loading', 'src', 'error']
|
14524
|
+
* @param {String} is form cache
|
14525
|
+
* @return
|
14526
|
+
*/
|
14472
14527
|
render(state, cache) {
|
14473
14528
|
this.elRenderer(this, state, cache);
|
14474
14529
|
}
|
14530
|
+
/*
|
14531
|
+
* output performance data
|
14532
|
+
* @return {Object} performance data
|
14533
|
+
*/
|
14475
14534
|
performance() {
|
14476
14535
|
let state = "loading";
|
14477
14536
|
let time = 0;
|
@@ -14487,6 +14546,10 @@ class ReactiveListener {
|
|
14487
14546
|
time
|
14488
14547
|
};
|
14489
14548
|
}
|
14549
|
+
/*
|
14550
|
+
* $destroy
|
14551
|
+
* @return
|
14552
|
+
*/
|
14490
14553
|
$destroy() {
|
14491
14554
|
this.el = null;
|
14492
14555
|
this.src = null;
|
@@ -14557,12 +14620,26 @@ function stdin_default$3() {
|
|
14557
14620
|
);
|
14558
14621
|
this.setMode(this.options.observer ? modeType.observer : modeType.event);
|
14559
14622
|
}
|
14623
|
+
/**
|
14624
|
+
* update config
|
14625
|
+
* @param {Object} config params
|
14626
|
+
* @return
|
14627
|
+
*/
|
14560
14628
|
config(options = {}) {
|
14561
14629
|
Object.assign(this.options, options);
|
14562
14630
|
}
|
14631
|
+
/**
|
14632
|
+
* output listener's load performance
|
14633
|
+
* @return {Array}
|
14634
|
+
*/
|
14563
14635
|
performance() {
|
14564
14636
|
return this.listeners.map((item) => item.performance());
|
14565
14637
|
}
|
14638
|
+
/*
|
14639
|
+
* add lazy component to queue
|
14640
|
+
* @param {Vue} vm lazy component instance
|
14641
|
+
* @return
|
14642
|
+
*/
|
14566
14643
|
addLazyBox(vm) {
|
14567
14644
|
this.listeners.push(vm);
|
14568
14645
|
if (inBrowser$1) {
|
@@ -14573,6 +14650,13 @@ function stdin_default$3() {
|
|
14573
14650
|
}
|
14574
14651
|
}
|
14575
14652
|
}
|
14653
|
+
/*
|
14654
|
+
* add image listener to queue
|
14655
|
+
* @param {DOM} el
|
14656
|
+
* @param {object} binding vue directive binding
|
14657
|
+
* @param {vnode} vnode vue directive vnode
|
14658
|
+
* @return
|
14659
|
+
*/
|
14576
14660
|
add(el, binding, vnode) {
|
14577
14661
|
if (this.listeners.some((item) => item.el === el)) {
|
14578
14662
|
this.update(el, binding);
|
@@ -14613,6 +14697,12 @@ function stdin_default$3() {
|
|
14613
14697
|
nextTick(() => this.lazyLoadHandler());
|
14614
14698
|
});
|
14615
14699
|
}
|
14700
|
+
/**
|
14701
|
+
* update image src
|
14702
|
+
* @param {DOM} el
|
14703
|
+
* @param {object} vue directive binding
|
14704
|
+
* @return
|
14705
|
+
*/
|
14616
14706
|
update(el, binding, vnode) {
|
14617
14707
|
const value = this.valueFormatter(binding.value);
|
14618
14708
|
let { src } = value;
|
@@ -14634,6 +14724,11 @@ function stdin_default$3() {
|
|
14634
14724
|
this.lazyLoadHandler();
|
14635
14725
|
nextTick(() => this.lazyLoadHandler());
|
14636
14726
|
}
|
14727
|
+
/**
|
14728
|
+
* remove listener form list
|
14729
|
+
* @param {DOM} el
|
14730
|
+
* @return
|
14731
|
+
*/
|
14637
14732
|
remove(el) {
|
14638
14733
|
if (!el)
|
14639
14734
|
return;
|
@@ -14646,6 +14741,11 @@ function stdin_default$3() {
|
|
14646
14741
|
existItem.$destroy();
|
14647
14742
|
}
|
14648
14743
|
}
|
14744
|
+
/*
|
14745
|
+
* remove lazy components form list
|
14746
|
+
* @param {Vue} vm Vue instance
|
14747
|
+
* @return
|
14748
|
+
*/
|
14649
14749
|
removeComponent(vm) {
|
14650
14750
|
if (!vm)
|
14651
14751
|
return;
|
@@ -14678,6 +14778,14 @@ function stdin_default$3() {
|
|
14678
14778
|
this.initIntersectionObserver();
|
14679
14779
|
}
|
14680
14780
|
}
|
14781
|
+
/*
|
14782
|
+
*** Private functions ***
|
14783
|
+
*/
|
14784
|
+
/*
|
14785
|
+
* add listener target
|
14786
|
+
* @param {DOM} el listener target
|
14787
|
+
* @return
|
14788
|
+
*/
|
14681
14789
|
addListenerTarget(el) {
|
14682
14790
|
if (!el)
|
14683
14791
|
return;
|
@@ -14696,6 +14804,11 @@ function stdin_default$3() {
|
|
14696
14804
|
}
|
14697
14805
|
return this.targetIndex;
|
14698
14806
|
}
|
14807
|
+
/*
|
14808
|
+
* remove listener target or reduce target childrenCount
|
14809
|
+
* @param {DOM} el or window
|
14810
|
+
* @return
|
14811
|
+
*/
|
14699
14812
|
removeListenerTarget(el) {
|
14700
14813
|
this.targets.forEach((target, index) => {
|
14701
14814
|
if (target.el === el) {
|
@@ -14708,6 +14821,12 @@ function stdin_default$3() {
|
|
14708
14821
|
}
|
14709
14822
|
});
|
14710
14823
|
}
|
14824
|
+
/*
|
14825
|
+
* add or remove eventlistener
|
14826
|
+
* @param {DOM} el DOM or Window
|
14827
|
+
* @param {boolean} start flag
|
14828
|
+
* @return
|
14829
|
+
*/
|
14711
14830
|
initListen(el, start) {
|
14712
14831
|
this.options.ListenEvents.forEach(
|
14713
14832
|
(evt) => (start ? on : off)(el, evt, this.lazyLoadHandler)
|
@@ -14748,6 +14867,10 @@ function stdin_default$3() {
|
|
14748
14867
|
this.Event.listeners[event].forEach((func) => func(context, inCache));
|
14749
14868
|
};
|
14750
14869
|
}
|
14870
|
+
/**
|
14871
|
+
* find nodes which in viewport and trigger load
|
14872
|
+
* @return
|
14873
|
+
*/
|
14751
14874
|
lazyLoadHandler() {
|
14752
14875
|
const freeList = [];
|
14753
14876
|
this.listeners.forEach((listener) => {
|
@@ -14764,6 +14887,11 @@ function stdin_default$3() {
|
|
14764
14887
|
item.$destroy();
|
14765
14888
|
});
|
14766
14889
|
}
|
14890
|
+
/**
|
14891
|
+
* init IntersectionObserver
|
14892
|
+
* set mode to observer
|
14893
|
+
* @return
|
14894
|
+
*/
|
14767
14895
|
initIntersectionObserver() {
|
14768
14896
|
if (!hasIntersectionObserver) {
|
14769
14897
|
return;
|
@@ -14778,6 +14906,10 @@ function stdin_default$3() {
|
|
14778
14906
|
});
|
14779
14907
|
}
|
14780
14908
|
}
|
14909
|
+
/**
|
14910
|
+
* init IntersectionObserver
|
14911
|
+
* @return
|
14912
|
+
*/
|
14781
14913
|
observerHandler(entries) {
|
14782
14914
|
entries.forEach((entry) => {
|
14783
14915
|
if (entry.isIntersecting) {
|
@@ -14791,6 +14923,13 @@ function stdin_default$3() {
|
|
14791
14923
|
}
|
14792
14924
|
});
|
14793
14925
|
}
|
14926
|
+
/**
|
14927
|
+
* set element attribute with image'url and state
|
14928
|
+
* @param {object} lazyload listener object
|
14929
|
+
* @param {string} state will be rendered
|
14930
|
+
* @param {bool} inCache is rendered from cache
|
14931
|
+
* @return
|
14932
|
+
*/
|
14794
14933
|
elRenderer(listener, state, cache) {
|
14795
14934
|
if (!listener.el)
|
14796
14935
|
return;
|
@@ -14822,6 +14961,11 @@ function stdin_default$3() {
|
|
14822
14961
|
el.dispatchEvent(event);
|
14823
14962
|
}
|
14824
14963
|
}
|
14964
|
+
/**
|
14965
|
+
* generate loading loaded error image url
|
14966
|
+
* @param {string} image's src
|
14967
|
+
* @return {object} image's loading, loaded, error url
|
14968
|
+
*/
|
14825
14969
|
valueFormatter(value) {
|
14826
14970
|
let src = value;
|
14827
14971
|
let { loading, error } = this.options;
|
@@ -15001,7 +15145,6 @@ var stdin_default$1 = (lazyManager) => ({
|
|
15001
15145
|
},
|
15002
15146
|
created() {
|
15003
15147
|
this.init();
|
15004
|
-
this.renderSrc = this.options.loading;
|
15005
15148
|
},
|
15006
15149
|
mounted() {
|
15007
15150
|
this.el = this.$el;
|
@@ -15051,6 +15194,11 @@ var stdin_default$1 = (lazyManager) => ({
|
|
15051
15194
|
}
|
15052
15195
|
});
|
15053
15196
|
const Lazyload = {
|
15197
|
+
/*
|
15198
|
+
* install function
|
15199
|
+
* @param {App} app
|
15200
|
+
* @param {object} options lazyload options
|
15201
|
+
*/
|
15054
15202
|
install(app, options = {}) {
|
15055
15203
|
const LazyClass = stdin_default$3();
|
15056
15204
|
const lazy = new LazyClass(options);
|
@@ -15074,7 +15222,7 @@ const Lazyload = {
|
|
15074
15222
|
});
|
15075
15223
|
}
|
15076
15224
|
};
|
15077
|
-
const version = "4.1.
|
15225
|
+
const version = "4.1.1";
|
15078
15226
|
function install(app) {
|
15079
15227
|
const components = [
|
15080
15228
|
ActionBar,
|