vant 4.1.0 → 4.1.2
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 +13 -7
- 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 +4 -3
- 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/locale/lang/km-KH.d.ts +62 -0
- package/es/locale/lang/km-KH.mjs +64 -0
- 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 +13 -7
- 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 +4 -3
- 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/locale/lang/km-KH.d.ts +62 -0
- package/lib/locale/lang/km-KH.js +83 -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 +194 -40
- package/lib/vant.es.js +194 -40
- package/lib/vant.js +231 -47
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +11 -5
package/lib/vant.cjs.js
CHANGED
@@ -541,7 +541,7 @@ var stdin_default$1L = vue.defineComponent({
|
|
541
541
|
if (slots.content) {
|
542
542
|
return slots.content();
|
543
543
|
}
|
544
|
-
if (isDef(max) && isNumeric(content) && +content > max) {
|
544
|
+
if (isDef(max) && isNumeric(content) && +content > +max) {
|
545
545
|
return `${max}+`;
|
546
546
|
}
|
547
547
|
return content;
|
@@ -1048,17 +1048,29 @@ var stdin_default$1F = vue.defineComponent({
|
|
1048
1048
|
});
|
1049
1049
|
const ActionBarIcon = withInstall(stdin_default$1F);
|
1050
1050
|
const popupSharedProps = {
|
1051
|
+
// whether to show popup
|
1051
1052
|
show: Boolean,
|
1053
|
+
// z-index
|
1052
1054
|
zIndex: numericProp,
|
1055
|
+
// whether to show overlay
|
1053
1056
|
overlay: truthProp,
|
1057
|
+
// transition duration
|
1054
1058
|
duration: numericProp,
|
1059
|
+
// teleport
|
1055
1060
|
teleport: [String, Object],
|
1061
|
+
// prevent body scroll
|
1056
1062
|
lockScroll: truthProp,
|
1063
|
+
// whether to lazy render
|
1057
1064
|
lazyRender: truthProp,
|
1065
|
+
// callback function before close
|
1058
1066
|
beforeClose: Function,
|
1067
|
+
// overlay custom style
|
1059
1068
|
overlayStyle: Object,
|
1069
|
+
// overlay custom class name
|
1060
1070
|
overlayClass: unknownProp,
|
1071
|
+
// Initial rendering animation
|
1061
1072
|
transitionAppear: Boolean,
|
1073
|
+
// whether to close popup when overlay is clicked
|
1062
1074
|
closeOnClickOverlay: truthProp
|
1063
1075
|
};
|
1064
1076
|
const popupSharedPropKeys = Object.keys(
|
@@ -1945,7 +1957,9 @@ var stdin_default$1z = vue.defineComponent({
|
|
1945
1957
|
const state = vue.reactive({
|
1946
1958
|
fixed: false,
|
1947
1959
|
width: 0,
|
1960
|
+
// root width
|
1948
1961
|
height: 0,
|
1962
|
+
// root height
|
1949
1963
|
transform: 0
|
1950
1964
|
});
|
1951
1965
|
const offset = vue.computed(() => unitToPx(props.position === "top" ? props.offsetTop : props.offsetBottom));
|
@@ -2280,7 +2294,7 @@ var stdin_default$1x = vue.defineComponent({
|
|
2280
2294
|
const stopAutoplay = () => clearTimeout(autoplayTimer);
|
2281
2295
|
const autoplay = () => {
|
2282
2296
|
stopAutoplay();
|
2283
|
-
if (props.autoplay > 0 && count.value > 1) {
|
2297
|
+
if (+props.autoplay > 0 && count.value > 1) {
|
2284
2298
|
autoplayTimer = setTimeout(() => {
|
2285
2299
|
next();
|
2286
2300
|
autoplay();
|
@@ -2325,7 +2339,8 @@ var stdin_default$1x = vue.defineComponent({
|
|
2325
2339
|
const resize = () => initialize(state.active);
|
2326
2340
|
let touchStartTime;
|
2327
2341
|
const onTouchStart = (event) => {
|
2328
|
-
if (!props.touchable ||
|
2342
|
+
if (!props.touchable || // avoid resetting position on multi-finger touch
|
2343
|
+
event.touches.length > 1)
|
2329
2344
|
return;
|
2330
2345
|
touch.start(event);
|
2331
2346
|
dragging = false;
|
@@ -2597,7 +2612,7 @@ var stdin_default$1v = vue.defineComponent({
|
|
2597
2612
|
lineStyle: {},
|
2598
2613
|
currentIndex: -1
|
2599
2614
|
});
|
2600
|
-
const scrollable = vue.computed(() => children.length > props.swipeThreshold || !props.ellipsis || props.shrink);
|
2615
|
+
const scrollable = vue.computed(() => children.length > +props.swipeThreshold || !props.ellipsis || props.shrink);
|
2601
2616
|
const navStyle = vue.computed(() => ({
|
2602
2617
|
borderColor: props.color,
|
2603
2618
|
background: props.background
|
@@ -3297,6 +3312,7 @@ var stdin_default$1r = vue.defineComponent({
|
|
3297
3312
|
vue.watch(() => props.modelValue, (newValues) => {
|
3298
3313
|
if (!isSameValue(newValues, selectedValues.value) && !isSameValue(newValues, lastEmittedModelValue)) {
|
3299
3314
|
selectedValues.value = newValues.slice(0);
|
3315
|
+
lastEmittedModelValue = newValues.slice(0);
|
3300
3316
|
}
|
3301
3317
|
}, {
|
3302
3318
|
deep: true
|
@@ -3361,8 +3377,8 @@ function formatDataForCascade({
|
|
3361
3377
|
county_list: county = {},
|
3362
3378
|
province_list: province = {}
|
3363
3379
|
} = areaList;
|
3364
|
-
const showCity = columnsNum > 1;
|
3365
|
-
const showCounty = columnsNum > 2;
|
3380
|
+
const showCity = +columnsNum > 1;
|
3381
|
+
const showCounty = +columnsNum > 2;
|
3366
3382
|
const getProvinceChildren = () => {
|
3367
3383
|
if (showCity) {
|
3368
3384
|
return placeholder.length ? [
|
@@ -4017,7 +4033,7 @@ var stdin_default$1n = vue.defineComponent({
|
|
4017
4033
|
const {
|
4018
4034
|
maxlength
|
4019
4035
|
} = props;
|
4020
|
-
if (isDef(maxlength) && getStringLength(value) > maxlength) {
|
4036
|
+
if (isDef(maxlength) && getStringLength(value) > +maxlength) {
|
4021
4037
|
const modelValue = getModelValue();
|
4022
4038
|
if (modelValue && getStringLength(modelValue) === +maxlength) {
|
4023
4039
|
return modelValue;
|
@@ -4048,7 +4064,7 @@ var stdin_default$1n = vue.defineComponent({
|
|
4048
4064
|
maxlength
|
4049
4065
|
} = props;
|
4050
4066
|
value = formatter(value);
|
4051
|
-
if (isDef(maxlength) && getStringLength(value) > maxlength) {
|
4067
|
+
if (isDef(maxlength) && getStringLength(value) > +maxlength) {
|
4052
4068
|
value = cutString(value, +maxlength);
|
4053
4069
|
}
|
4054
4070
|
if (inputRef.value && state.focused) {
|
@@ -4113,12 +4129,12 @@ var stdin_default$1n = vue.defineComponent({
|
|
4113
4129
|
}
|
4114
4130
|
};
|
4115
4131
|
const onBlur = (event) => {
|
4116
|
-
if (getProp("readonly")) {
|
4117
|
-
return;
|
4118
|
-
}
|
4119
4132
|
state.focused = false;
|
4120
4133
|
updateValue(getModelValue(), "onBlur");
|
4121
4134
|
emit("blur", event);
|
4135
|
+
if (getProp("readonly")) {
|
4136
|
+
return;
|
4137
|
+
}
|
4122
4138
|
validateWithTrigger("onBlur");
|
4123
4139
|
vue.nextTick(adjustTextareaSize);
|
4124
4140
|
resetScroll();
|
@@ -4141,7 +4157,8 @@ var stdin_default$1n = vue.defineComponent({
|
|
4141
4157
|
});
|
4142
4158
|
const labelStyle = vue.computed(() => {
|
4143
4159
|
const labelWidth = getProp("labelWidth");
|
4144
|
-
|
4160
|
+
const labelAlign = getProp("labelAlign");
|
4161
|
+
if (labelWidth && labelAlign !== "top") {
|
4145
4162
|
return {
|
4146
4163
|
width: addUnit(labelWidth)
|
4147
4164
|
};
|
@@ -4251,6 +4268,8 @@ var stdin_default$1n = vue.defineComponent({
|
|
4251
4268
|
}
|
4252
4269
|
};
|
4253
4270
|
const renderLabel = () => {
|
4271
|
+
const labelWidth = getProp("labelWidth");
|
4272
|
+
const labelAlign = getProp("labelAlign");
|
4254
4273
|
const colon = getProp("colon") ? ":" : "";
|
4255
4274
|
if (slots.label) {
|
4256
4275
|
return [slots.label(), colon];
|
@@ -4258,7 +4277,10 @@ var stdin_default$1n = vue.defineComponent({
|
|
4258
4277
|
if (props.label) {
|
4259
4278
|
return vue.createVNode("label", {
|
4260
4279
|
"id": `${id}-label`,
|
4261
|
-
"for": getInputId()
|
4280
|
+
"for": getInputId(),
|
4281
|
+
"style": labelAlign === "top" && labelWidth ? {
|
4282
|
+
width: addUnit(labelWidth)
|
4283
|
+
} : void 0
|
4262
4284
|
}, [props.label + colon]);
|
4263
4285
|
}
|
4264
4286
|
};
|
@@ -5639,7 +5661,7 @@ var stdin_default$1c = vue.defineComponent({
|
|
5639
5661
|
});
|
5640
5662
|
};
|
5641
5663
|
const scroll = () => {
|
5642
|
-
show.value = scrollParent.value ? getScrollTop(scrollParent.value) >= props.offset : false;
|
5664
|
+
show.value = scrollParent.value ? getScrollTop(scrollParent.value) >= +props.offset : false;
|
5643
5665
|
};
|
5644
5666
|
const getTarget = () => {
|
5645
5667
|
const {
|
@@ -5725,7 +5747,7 @@ function getDayByOffset(date, offset) {
|
|
5725
5747
|
const getPrevDay = (date) => getDayByOffset(date, -1);
|
5726
5748
|
const getNextDay = (date) => getDayByOffset(date, 1);
|
5727
5749
|
const getToday = () => {
|
5728
|
-
const today = new Date();
|
5750
|
+
const today = /* @__PURE__ */ new Date();
|
5729
5751
|
today.setHours(0, 0, 0, 0);
|
5730
5752
|
return today;
|
5731
5753
|
};
|
@@ -6363,7 +6385,7 @@ var stdin_default$18 = vue.defineComponent({
|
|
6363
6385
|
rangePrompt,
|
6364
6386
|
showRangePrompt
|
6365
6387
|
} = props;
|
6366
|
-
if (maxRange && calcDateNum(date) > maxRange) {
|
6388
|
+
if (maxRange && calcDateNum(date) > +maxRange) {
|
6367
6389
|
if (showRangePrompt) {
|
6368
6390
|
showToast(rangePrompt || t$f("rangePrompt", maxRange));
|
6369
6391
|
}
|
@@ -6450,7 +6472,7 @@ var stdin_default$18 = vue.defineComponent({
|
|
6450
6472
|
if (selectedIndex !== -1) {
|
6451
6473
|
const [unselectedDate] = dates.splice(selectedIndex, 1);
|
6452
6474
|
emit("unselect", cloneDate(unselectedDate));
|
6453
|
-
} else if (props.maxRange && dates.length >= props.maxRange) {
|
6475
|
+
} else if (props.maxRange && dates.length >= +props.maxRange) {
|
6454
6476
|
showToast(props.rangePrompt || t$f("rangePrompt", props.maxRange));
|
6455
6477
|
} else {
|
6456
6478
|
select([...dates, date]);
|
@@ -7177,7 +7199,7 @@ var stdin_default$12 = vue.defineComponent({
|
|
7177
7199
|
} = parent.props;
|
7178
7200
|
const value = modelValue.slice();
|
7179
7201
|
if (checked2) {
|
7180
|
-
const overlimit = max && value.length >= max;
|
7202
|
+
const overlimit = max && value.length >= +max;
|
7181
7203
|
if (!overlimit && !value.includes(name2)) {
|
7182
7204
|
value.push(name2);
|
7183
7205
|
if (props.bindGroup) {
|
@@ -8657,7 +8679,7 @@ var stdin_default$R = vue.defineComponent({
|
|
8657
8679
|
}
|
8658
8680
|
});
|
8659
8681
|
const CouponList = withInstall(stdin_default$R);
|
8660
|
-
const currentYear = new Date().getFullYear();
|
8682
|
+
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
8661
8683
|
const [name$H] = createNamespace("date-picker");
|
8662
8684
|
const datePickerProps = extend({}, sharedProps, {
|
8663
8685
|
columnsType: {
|
@@ -9455,7 +9477,7 @@ var stdin_default$K = vue.defineComponent({
|
|
9455
9477
|
} else if (gutter) {
|
9456
9478
|
const gutterValue = addUnit(gutter);
|
9457
9479
|
style.paddingRight = gutterValue;
|
9458
|
-
if (index.value >= columnNum) {
|
9480
|
+
if (index.value >= +columnNum) {
|
9459
9481
|
style.marginTop = gutterValue;
|
9460
9482
|
}
|
9461
9483
|
}
|
@@ -9690,7 +9712,7 @@ var stdin_default$J = vue.defineComponent({
|
|
9690
9712
|
} = touch;
|
9691
9713
|
const moveX = deltaX.value + startMoveX;
|
9692
9714
|
const moveY = deltaY.value + startMoveY;
|
9693
|
-
if ((moveX > maxMoveX.value || moveX < -maxMoveX.value) && !isImageMoved) {
|
9715
|
+
if ((moveX > maxMoveX.value || moveX < -maxMoveX.value) && !isImageMoved && touch.isHorizontal()) {
|
9694
9716
|
state.moving = false;
|
9695
9717
|
return;
|
9696
9718
|
}
|
@@ -9756,8 +9778,9 @@ var stdin_default$J = vue.defineComponent({
|
|
9756
9778
|
if (state.scale < 1) {
|
9757
9779
|
resetScale();
|
9758
9780
|
}
|
9759
|
-
|
9760
|
-
|
9781
|
+
const maxZoom = +props.maxZoom;
|
9782
|
+
if (state.scale > maxZoom) {
|
9783
|
+
state.scale = maxZoom;
|
9761
9784
|
}
|
9762
9785
|
}
|
9763
9786
|
}
|
@@ -10360,13 +10383,14 @@ var stdin_default$F = vue.defineComponent({
|
|
10360
10383
|
const scrollParent = use.useScrollParent(root);
|
10361
10384
|
const check = () => {
|
10362
10385
|
vue.nextTick(() => {
|
10363
|
-
if (loading.value || props.finished || props.disabled || props.error ||
|
10386
|
+
if (loading.value || props.finished || props.disabled || props.error || // skip check when inside an inactive tab
|
10387
|
+
(tabStatus == null ? void 0 : tabStatus.value) === false) {
|
10364
10388
|
return;
|
10365
10389
|
}
|
10366
10390
|
const {
|
10367
|
-
offset,
|
10368
10391
|
direction
|
10369
10392
|
} = props;
|
10393
|
+
const offset = +props.offset;
|
10370
10394
|
const scrollParentRect = use.useRect(scrollParent);
|
10371
10395
|
if (!scrollParentRect.height || isHidden(root)) {
|
10372
10396
|
return;
|
@@ -10999,7 +11023,7 @@ var stdin_default$A = vue.defineComponent({
|
|
10999
11023
|
emit("update:modelValue", value.slice(0, value.length - 1));
|
11000
11024
|
} else if (type === "close") {
|
11001
11025
|
onClose();
|
11002
|
-
} else if (value.length < props.maxlength) {
|
11026
|
+
} else if (value.length < +props.maxlength) {
|
11003
11027
|
emit("input", text);
|
11004
11028
|
emit("update:modelValue", value + text);
|
11005
11029
|
}
|
@@ -11273,10 +11297,10 @@ var stdin_default$y = vue.defineComponent({
|
|
11273
11297
|
const {
|
11274
11298
|
mask,
|
11275
11299
|
value,
|
11276
|
-
length,
|
11277
11300
|
gutter,
|
11278
11301
|
focused
|
11279
11302
|
} = props;
|
11303
|
+
const length = +props.length;
|
11280
11304
|
for (let i = 0; i < length; i++) {
|
11281
11305
|
const char = value[i];
|
11282
11306
|
const showBorder = i !== 0 && !gutter;
|
@@ -11529,7 +11553,7 @@ const progressProps = {
|
|
11529
11553
|
percentage: {
|
11530
11554
|
type: numericProp,
|
11531
11555
|
default: 0,
|
11532
|
-
validator: (value) => value >= 0 && value <= 100
|
11556
|
+
validator: (value) => +value >= 0 && +value <= 100
|
11533
11557
|
}
|
11534
11558
|
};
|
11535
11559
|
var stdin_default$w = vue.defineComponent({
|
@@ -12003,7 +12027,7 @@ var stdin_default$t = vue.defineComponent({
|
|
12003
12027
|
attrs
|
12004
12028
|
}) {
|
12005
12029
|
const id = useId();
|
12006
|
-
const
|
12030
|
+
const fieldRef = vue.ref();
|
12007
12031
|
const onCancel = () => {
|
12008
12032
|
if (!slots.action) {
|
12009
12033
|
emit("update:modelValue", "");
|
@@ -12039,11 +12063,11 @@ var stdin_default$t = vue.defineComponent({
|
|
12039
12063
|
};
|
12040
12064
|
const blur = () => {
|
12041
12065
|
var _a;
|
12042
|
-
return (_a =
|
12066
|
+
return (_a = fieldRef.value) == null ? void 0 : _a.blur();
|
12043
12067
|
};
|
12044
12068
|
const focus = () => {
|
12045
12069
|
var _a;
|
12046
|
-
return (_a =
|
12070
|
+
return (_a = fieldRef.value) == null ? void 0 : _a.focus();
|
12047
12071
|
};
|
12048
12072
|
const onBlur = (event) => emit("blur", event);
|
12049
12073
|
const onFocus = (event) => emit("focus", event);
|
@@ -12058,7 +12082,7 @@ var stdin_default$t = vue.defineComponent({
|
|
12058
12082
|
});
|
12059
12083
|
const onInput = (value) => emit("update:modelValue", value);
|
12060
12084
|
return vue.createVNode(Field, vue.mergeProps({
|
12061
|
-
"ref":
|
12085
|
+
"ref": fieldRef,
|
12062
12086
|
"type": "search",
|
12063
12087
|
"class": bem$k("field"),
|
12064
12088
|
"border": false,
|
@@ -13031,8 +13055,8 @@ var stdin_default$d = vue.defineComponent({
|
|
13031
13055
|
let actionType;
|
13032
13056
|
const inputRef = vue.ref();
|
13033
13057
|
const current2 = vue.ref(getInitialValue());
|
13034
|
-
const minusDisabled = vue.computed(() => props.disabled || props.disableMinus || current2.value <= +props.min);
|
13035
|
-
const plusDisabled = vue.computed(() => props.disabled || props.disablePlus || current2.value >= +props.max);
|
13058
|
+
const minusDisabled = vue.computed(() => props.disabled || props.disableMinus || +current2.value <= +props.min);
|
13059
|
+
const plusDisabled = vue.computed(() => props.disabled || props.disablePlus || +current2.value >= +props.max);
|
13036
13060
|
const inputStyle = vue.computed(() => ({
|
13037
13061
|
width: addUnit(props.inputWidth),
|
13038
13062
|
height: addUnit(props.buttonSize)
|
@@ -13855,7 +13879,7 @@ var stdin_default$6 = vue.defineComponent({
|
|
13855
13879
|
const index = activeId.indexOf(item.id);
|
13856
13880
|
if (index !== -1) {
|
13857
13881
|
activeId.splice(index, 1);
|
13858
|
-
} else if (activeId.length < props.max) {
|
13882
|
+
} else if (activeId.length < +props.max) {
|
13859
13883
|
activeId.push(item.id);
|
13860
13884
|
}
|
13861
13885
|
} else {
|
@@ -13942,7 +13966,7 @@ function isOversize(items, maxSize) {
|
|
13942
13966
|
if (isFunction(maxSize)) {
|
13943
13967
|
return maxSize(item.file);
|
13944
13968
|
}
|
13945
|
-
return item.file.size > maxSize;
|
13969
|
+
return item.file.size > +maxSize;
|
13946
13970
|
}
|
13947
13971
|
return false;
|
13948
13972
|
});
|
@@ -13959,7 +13983,7 @@ function filterFiles(items, maxSize) {
|
|
13959
13983
|
});
|
13960
13984
|
return { valid, invalid };
|
13961
13985
|
}
|
13962
|
-
const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
|
13986
|
+
const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg|avif)/i;
|
13963
13987
|
const isImageUrl = (url) => IMAGE_REGEXP.test(url);
|
13964
13988
|
function isImageFile(item) {
|
13965
13989
|
if (item.isImage) {
|
@@ -14276,7 +14300,7 @@ var stdin_default$4 = vue.defineComponent({
|
|
14276
14300
|
};
|
14277
14301
|
const onClickUpload = (event) => emit("clickUpload", event);
|
14278
14302
|
const renderUpload = () => {
|
14279
|
-
if (props.modelValue.length >= props.maxCount) {
|
14303
|
+
if (props.modelValue.length >= +props.maxCount) {
|
14280
14304
|
return;
|
14281
14305
|
}
|
14282
14306
|
const Input = props.readonly ? null : vue.createVNode("input", {
|
@@ -14365,6 +14389,10 @@ class ReactiveListener {
|
|
14365
14389
|
this.initState();
|
14366
14390
|
this.render("loading", false);
|
14367
14391
|
}
|
14392
|
+
/*
|
14393
|
+
* init listener state
|
14394
|
+
* @return
|
14395
|
+
*/
|
14368
14396
|
initState() {
|
14369
14397
|
if ("dataset" in this.el) {
|
14370
14398
|
this.el.dataset.src = this.src;
|
@@ -14378,9 +14406,20 @@ class ReactiveListener {
|
|
14378
14406
|
rendered: false
|
14379
14407
|
};
|
14380
14408
|
}
|
14409
|
+
/*
|
14410
|
+
* record performance
|
14411
|
+
* @return
|
14412
|
+
*/
|
14381
14413
|
record(event) {
|
14382
14414
|
this.performanceData[event] = Date.now();
|
14383
14415
|
}
|
14416
|
+
/*
|
14417
|
+
* update image listener data
|
14418
|
+
* @param {String} image uri
|
14419
|
+
* @param {String} loading image uri
|
14420
|
+
* @param {String} error image uri
|
14421
|
+
* @return
|
14422
|
+
*/
|
14384
14423
|
update({ src, loading, error }) {
|
14385
14424
|
const oldSrc = this.src;
|
14386
14425
|
this.src = src;
|
@@ -14392,15 +14431,27 @@ class ReactiveListener {
|
|
14392
14431
|
this.initState();
|
14393
14432
|
}
|
14394
14433
|
}
|
14434
|
+
/*
|
14435
|
+
* check el is in view
|
14436
|
+
* @return {Boolean} el is in view
|
14437
|
+
*/
|
14395
14438
|
checkInView() {
|
14396
14439
|
const rect = use.useRect(this.el);
|
14397
14440
|
return rect.top < window.innerHeight * this.options.preLoad && rect.bottom > this.options.preLoadTop && rect.left < window.innerWidth * this.options.preLoad && rect.right > 0;
|
14398
14441
|
}
|
14442
|
+
/*
|
14443
|
+
* listener filter
|
14444
|
+
*/
|
14399
14445
|
filter() {
|
14400
14446
|
Object.keys(this.options.filter).forEach((key) => {
|
14401
14447
|
this.options.filter[key](this, this.options);
|
14402
14448
|
});
|
14403
14449
|
}
|
14450
|
+
/*
|
14451
|
+
* render loading first
|
14452
|
+
* @params cb:Function
|
14453
|
+
* @return
|
14454
|
+
*/
|
14404
14455
|
renderLoading(cb) {
|
14405
14456
|
this.state.loading = true;
|
14406
14457
|
loadImageAsync(
|
@@ -14423,6 +14474,10 @@ class ReactiveListener {
|
|
14423
14474
|
}
|
14424
14475
|
);
|
14425
14476
|
}
|
14477
|
+
/*
|
14478
|
+
* try load image and render it
|
14479
|
+
* @return
|
14480
|
+
*/
|
14426
14481
|
load(onFinish = noop) {
|
14427
14482
|
if (this.attempt > this.options.attempt - 1 && this.state.error) {
|
14428
14483
|
if (process.env.NODE_ENV !== "production" && !this.options.silent) {
|
@@ -14471,9 +14526,19 @@ class ReactiveListener {
|
|
14471
14526
|
);
|
14472
14527
|
});
|
14473
14528
|
}
|
14529
|
+
/*
|
14530
|
+
* render image
|
14531
|
+
* @param {String} state to render // ['loading', 'src', 'error']
|
14532
|
+
* @param {String} is form cache
|
14533
|
+
* @return
|
14534
|
+
*/
|
14474
14535
|
render(state, cache) {
|
14475
14536
|
this.elRenderer(this, state, cache);
|
14476
14537
|
}
|
14538
|
+
/*
|
14539
|
+
* output performance data
|
14540
|
+
* @return {Object} performance data
|
14541
|
+
*/
|
14477
14542
|
performance() {
|
14478
14543
|
let state = "loading";
|
14479
14544
|
let time = 0;
|
@@ -14489,6 +14554,10 @@ class ReactiveListener {
|
|
14489
14554
|
time
|
14490
14555
|
};
|
14491
14556
|
}
|
14557
|
+
/*
|
14558
|
+
* $destroy
|
14559
|
+
* @return
|
14560
|
+
*/
|
14492
14561
|
$destroy() {
|
14493
14562
|
this.el = null;
|
14494
14563
|
this.src = null;
|
@@ -14559,12 +14628,26 @@ function stdin_default$3() {
|
|
14559
14628
|
);
|
14560
14629
|
this.setMode(this.options.observer ? modeType.observer : modeType.event);
|
14561
14630
|
}
|
14631
|
+
/**
|
14632
|
+
* update config
|
14633
|
+
* @param {Object} config params
|
14634
|
+
* @return
|
14635
|
+
*/
|
14562
14636
|
config(options = {}) {
|
14563
14637
|
Object.assign(this.options, options);
|
14564
14638
|
}
|
14639
|
+
/**
|
14640
|
+
* output listener's load performance
|
14641
|
+
* @return {Array}
|
14642
|
+
*/
|
14565
14643
|
performance() {
|
14566
14644
|
return this.listeners.map((item) => item.performance());
|
14567
14645
|
}
|
14646
|
+
/*
|
14647
|
+
* add lazy component to queue
|
14648
|
+
* @param {Vue} vm lazy component instance
|
14649
|
+
* @return
|
14650
|
+
*/
|
14568
14651
|
addLazyBox(vm) {
|
14569
14652
|
this.listeners.push(vm);
|
14570
14653
|
if (use.inBrowser) {
|
@@ -14575,6 +14658,13 @@ function stdin_default$3() {
|
|
14575
14658
|
}
|
14576
14659
|
}
|
14577
14660
|
}
|
14661
|
+
/*
|
14662
|
+
* add image listener to queue
|
14663
|
+
* @param {DOM} el
|
14664
|
+
* @param {object} binding vue directive binding
|
14665
|
+
* @param {vnode} vnode vue directive vnode
|
14666
|
+
* @return
|
14667
|
+
*/
|
14578
14668
|
add(el, binding, vnode) {
|
14579
14669
|
if (this.listeners.some((item) => item.el === el)) {
|
14580
14670
|
this.update(el, binding);
|
@@ -14615,6 +14705,12 @@ function stdin_default$3() {
|
|
14615
14705
|
vue.nextTick(() => this.lazyLoadHandler());
|
14616
14706
|
});
|
14617
14707
|
}
|
14708
|
+
/**
|
14709
|
+
* update image src
|
14710
|
+
* @param {DOM} el
|
14711
|
+
* @param {object} vue directive binding
|
14712
|
+
* @return
|
14713
|
+
*/
|
14618
14714
|
update(el, binding, vnode) {
|
14619
14715
|
const value = this.valueFormatter(binding.value);
|
14620
14716
|
let { src } = value;
|
@@ -14636,6 +14732,11 @@ function stdin_default$3() {
|
|
14636
14732
|
this.lazyLoadHandler();
|
14637
14733
|
vue.nextTick(() => this.lazyLoadHandler());
|
14638
14734
|
}
|
14735
|
+
/**
|
14736
|
+
* remove listener form list
|
14737
|
+
* @param {DOM} el
|
14738
|
+
* @return
|
14739
|
+
*/
|
14639
14740
|
remove(el) {
|
14640
14741
|
if (!el)
|
14641
14742
|
return;
|
@@ -14648,6 +14749,11 @@ function stdin_default$3() {
|
|
14648
14749
|
existItem.$destroy();
|
14649
14750
|
}
|
14650
14751
|
}
|
14752
|
+
/*
|
14753
|
+
* remove lazy components form list
|
14754
|
+
* @param {Vue} vm Vue instance
|
14755
|
+
* @return
|
14756
|
+
*/
|
14651
14757
|
removeComponent(vm) {
|
14652
14758
|
if (!vm)
|
14653
14759
|
return;
|
@@ -14680,6 +14786,14 @@ function stdin_default$3() {
|
|
14680
14786
|
this.initIntersectionObserver();
|
14681
14787
|
}
|
14682
14788
|
}
|
14789
|
+
/*
|
14790
|
+
*** Private functions ***
|
14791
|
+
*/
|
14792
|
+
/*
|
14793
|
+
* add listener target
|
14794
|
+
* @param {DOM} el listener target
|
14795
|
+
* @return
|
14796
|
+
*/
|
14683
14797
|
addListenerTarget(el) {
|
14684
14798
|
if (!el)
|
14685
14799
|
return;
|
@@ -14698,6 +14812,11 @@ function stdin_default$3() {
|
|
14698
14812
|
}
|
14699
14813
|
return this.targetIndex;
|
14700
14814
|
}
|
14815
|
+
/*
|
14816
|
+
* remove listener target or reduce target childrenCount
|
14817
|
+
* @param {DOM} el or window
|
14818
|
+
* @return
|
14819
|
+
*/
|
14701
14820
|
removeListenerTarget(el) {
|
14702
14821
|
this.targets.forEach((target, index) => {
|
14703
14822
|
if (target.el === el) {
|
@@ -14710,6 +14829,12 @@ function stdin_default$3() {
|
|
14710
14829
|
}
|
14711
14830
|
});
|
14712
14831
|
}
|
14832
|
+
/*
|
14833
|
+
* add or remove eventlistener
|
14834
|
+
* @param {DOM} el DOM or Window
|
14835
|
+
* @param {boolean} start flag
|
14836
|
+
* @return
|
14837
|
+
*/
|
14713
14838
|
initListen(el, start) {
|
14714
14839
|
this.options.ListenEvents.forEach(
|
14715
14840
|
(evt) => (start ? on : off)(el, evt, this.lazyLoadHandler)
|
@@ -14750,6 +14875,10 @@ function stdin_default$3() {
|
|
14750
14875
|
this.Event.listeners[event].forEach((func) => func(context, inCache));
|
14751
14876
|
};
|
14752
14877
|
}
|
14878
|
+
/**
|
14879
|
+
* find nodes which in viewport and trigger load
|
14880
|
+
* @return
|
14881
|
+
*/
|
14753
14882
|
lazyLoadHandler() {
|
14754
14883
|
const freeList = [];
|
14755
14884
|
this.listeners.forEach((listener) => {
|
@@ -14766,6 +14895,11 @@ function stdin_default$3() {
|
|
14766
14895
|
item.$destroy();
|
14767
14896
|
});
|
14768
14897
|
}
|
14898
|
+
/**
|
14899
|
+
* init IntersectionObserver
|
14900
|
+
* set mode to observer
|
14901
|
+
* @return
|
14902
|
+
*/
|
14769
14903
|
initIntersectionObserver() {
|
14770
14904
|
if (!hasIntersectionObserver) {
|
14771
14905
|
return;
|
@@ -14780,6 +14914,10 @@ function stdin_default$3() {
|
|
14780
14914
|
});
|
14781
14915
|
}
|
14782
14916
|
}
|
14917
|
+
/**
|
14918
|
+
* init IntersectionObserver
|
14919
|
+
* @return
|
14920
|
+
*/
|
14783
14921
|
observerHandler(entries) {
|
14784
14922
|
entries.forEach((entry) => {
|
14785
14923
|
if (entry.isIntersecting) {
|
@@ -14793,6 +14931,13 @@ function stdin_default$3() {
|
|
14793
14931
|
}
|
14794
14932
|
});
|
14795
14933
|
}
|
14934
|
+
/**
|
14935
|
+
* set element attribute with image'url and state
|
14936
|
+
* @param {object} lazyload listener object
|
14937
|
+
* @param {string} state will be rendered
|
14938
|
+
* @param {bool} inCache is rendered from cache
|
14939
|
+
* @return
|
14940
|
+
*/
|
14796
14941
|
elRenderer(listener, state, cache) {
|
14797
14942
|
if (!listener.el)
|
14798
14943
|
return;
|
@@ -14824,6 +14969,11 @@ function stdin_default$3() {
|
|
14824
14969
|
el.dispatchEvent(event);
|
14825
14970
|
}
|
14826
14971
|
}
|
14972
|
+
/**
|
14973
|
+
* generate loading loaded error image url
|
14974
|
+
* @param {string} image's src
|
14975
|
+
* @return {object} image's loading, loaded, error url
|
14976
|
+
*/
|
14827
14977
|
valueFormatter(value) {
|
14828
14978
|
let src = value;
|
14829
14979
|
let { loading, error } = this.options;
|
@@ -15003,7 +15153,6 @@ var stdin_default$1 = (lazyManager) => ({
|
|
15003
15153
|
},
|
15004
15154
|
created() {
|
15005
15155
|
this.init();
|
15006
|
-
this.renderSrc = this.options.loading;
|
15007
15156
|
},
|
15008
15157
|
mounted() {
|
15009
15158
|
this.el = this.$el;
|
@@ -15053,6 +15202,11 @@ var stdin_default$1 = (lazyManager) => ({
|
|
15053
15202
|
}
|
15054
15203
|
});
|
15055
15204
|
const Lazyload = {
|
15205
|
+
/*
|
15206
|
+
* install function
|
15207
|
+
* @param {App} app
|
15208
|
+
* @param {object} options lazyload options
|
15209
|
+
*/
|
15056
15210
|
install(app, options = {}) {
|
15057
15211
|
const LazyClass = stdin_default$3();
|
15058
15212
|
const lazy = new LazyClass(options);
|
@@ -15076,7 +15230,7 @@ const Lazyload = {
|
|
15076
15230
|
});
|
15077
15231
|
}
|
15078
15232
|
};
|
15079
|
-
const version = "4.1.
|
15233
|
+
const version = "4.1.2";
|
15080
15234
|
function install(app) {
|
15081
15235
|
const components = [
|
15082
15236
|
ActionBar,
|