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.
Files changed (195) hide show
  1. package/es/area/utils.mjs +2 -2
  2. package/es/back-top/BackTop.mjs +1 -1
  3. package/es/badge/Badge.mjs +1 -1
  4. package/es/button/Button.d.ts +1 -1
  5. package/es/button/index.d.ts +1 -1
  6. package/es/calendar/Calendar.mjs +2 -2
  7. package/es/calendar/utils.mjs +1 -1
  8. package/es/checkbox/Checkbox.mjs +1 -1
  9. package/es/date-picker/DatePicker.mjs +1 -1
  10. package/es/divider/Divider.d.ts +1 -1
  11. package/es/divider/index.d.ts +1 -1
  12. package/es/field/Field.mjs +2 -2
  13. package/es/field/index.d.ts +1 -1
  14. package/es/field/types.d.ts +2 -2
  15. package/es/grid-item/GridItem.mjs +1 -1
  16. package/es/image-preview/ImagePreviewItem.mjs +3 -2
  17. package/es/index.d.ts +1 -1
  18. package/es/index.mjs +1 -1
  19. package/es/lazyload/vue-lazyload/index.mjs +5 -0
  20. package/es/lazyload/vue-lazyload/lazy-image.mjs +0 -1
  21. package/es/lazyload/vue-lazyload/lazy.mjs +81 -0
  22. package/es/lazyload/vue-lazyload/listener.mjs +45 -0
  23. package/es/list/List.mjs +3 -2
  24. package/es/number-keyboard/NumberKeyboard.mjs +1 -1
  25. package/es/password-input/PasswordInput.mjs +1 -1
  26. package/es/picker/Picker.mjs +1 -0
  27. package/es/popup/shared.mjs +12 -0
  28. package/es/progress/Progress.mjs +1 -1
  29. package/es/search/Search.mjs +4 -4
  30. package/es/slider/Slider.d.ts +1 -1
  31. package/es/slider/index.d.ts +1 -1
  32. package/es/stepper/Stepper.mjs +2 -2
  33. package/es/sticky/Sticky.mjs +2 -0
  34. package/es/swipe/Swipe.mjs +3 -2
  35. package/es/tabs/Tabs.mjs +1 -1
  36. package/es/tag/Tag.d.ts +1 -1
  37. package/es/tag/index.d.ts +1 -1
  38. package/es/text-ellipsis/index.css +1 -1
  39. package/es/tree-select/TreeSelect.mjs +1 -1
  40. package/es/uploader/Uploader.mjs +1 -1
  41. package/es/uploader/utils.mjs +2 -2
  42. package/lib/action-bar/index.js +4 -0
  43. package/lib/action-bar-button/index.js +4 -0
  44. package/lib/action-bar-icon/index.js +4 -0
  45. package/lib/action-sheet/index.js +4 -0
  46. package/lib/address-edit/AddressEdit.js +4 -0
  47. package/lib/address-edit/index.js +4 -0
  48. package/lib/address-list/AddressList.js +4 -0
  49. package/lib/address-list/index.js +4 -0
  50. package/lib/area/index.js +4 -0
  51. package/lib/area/utils.js +2 -2
  52. package/lib/back-top/BackTop.js +1 -1
  53. package/lib/back-top/index.js +4 -0
  54. package/lib/badge/Badge.js +1 -1
  55. package/lib/badge/index.js +4 -0
  56. package/lib/button/Button.d.ts +1 -1
  57. package/lib/button/index.d.ts +1 -1
  58. package/lib/button/index.js +4 -0
  59. package/lib/calendar/Calendar.js +6 -2
  60. package/lib/calendar/CalendarMonth.js +4 -0
  61. package/lib/calendar/index.js +4 -0
  62. package/lib/calendar/utils.js +1 -1
  63. package/lib/card/index.js +4 -0
  64. package/lib/cascader/index.js +4 -0
  65. package/lib/cell/index.js +4 -0
  66. package/lib/cell-group/index.js +4 -0
  67. package/lib/checkbox/Checkbox.js +5 -1
  68. package/lib/checkbox/index.js +4 -0
  69. package/lib/checkbox-group/index.js +4 -0
  70. package/lib/circle/index.js +4 -0
  71. package/lib/col/index.js +4 -0
  72. package/lib/collapse/index.js +4 -0
  73. package/lib/collapse-item/index.js +4 -0
  74. package/lib/config-provider/index.js +4 -0
  75. package/lib/contact-card/index.js +4 -0
  76. package/lib/contact-edit/index.js +4 -0
  77. package/lib/contact-list/index.js +4 -0
  78. package/lib/count-down/index.js +4 -0
  79. package/lib/coupon/index.js +4 -0
  80. package/lib/coupon-cell/index.js +4 -0
  81. package/lib/coupon-list/index.js +4 -0
  82. package/lib/date-picker/DatePicker.js +1 -1
  83. package/lib/date-picker/index.js +4 -0
  84. package/lib/dialog/function-call.js +4 -0
  85. package/lib/dialog/index.js +4 -0
  86. package/lib/divider/Divider.d.ts +1 -1
  87. package/lib/divider/index.d.ts +1 -1
  88. package/lib/divider/index.js +4 -0
  89. package/lib/dropdown-item/index.js +4 -0
  90. package/lib/dropdown-menu/index.js +4 -0
  91. package/lib/empty/index.js +4 -0
  92. package/lib/field/Field.js +2 -2
  93. package/lib/field/index.d.ts +1 -1
  94. package/lib/field/index.js +4 -0
  95. package/lib/field/types.d.ts +2 -2
  96. package/lib/form/index.js +4 -0
  97. package/lib/grid/index.js +4 -0
  98. package/lib/grid-item/GridItem.js +1 -1
  99. package/lib/grid-item/index.js +4 -0
  100. package/lib/icon/index.js +4 -0
  101. package/lib/image/index.js +4 -0
  102. package/lib/image-preview/ImagePreview.js +4 -0
  103. package/lib/image-preview/ImagePreviewItem.js +3 -2
  104. package/lib/image-preview/function-call.js +4 -0
  105. package/lib/image-preview/index.js +4 -0
  106. package/lib/index-anchor/index.js +4 -0
  107. package/lib/index-bar/index.js +4 -0
  108. package/lib/index.css +1 -1
  109. package/lib/index.d.ts +1 -1
  110. package/lib/index.js +1 -1
  111. package/lib/lazyload/vue-lazyload/index.js +9 -0
  112. package/lib/lazyload/vue-lazyload/lazy-image.js +0 -1
  113. package/lib/lazyload/vue-lazyload/lazy.js +85 -0
  114. package/lib/lazyload/vue-lazyload/listener.js +45 -0
  115. package/lib/list/List.js +3 -2
  116. package/lib/list/index.js +4 -0
  117. package/lib/loading/index.js +4 -0
  118. package/lib/locale/index.js +4 -0
  119. package/lib/nav-bar/index.js +4 -0
  120. package/lib/notice-bar/index.js +4 -0
  121. package/lib/notify/function-call.js +4 -0
  122. package/lib/notify/index.js +4 -0
  123. package/lib/number-keyboard/NumberKeyboard.js +5 -1
  124. package/lib/number-keyboard/index.js +4 -0
  125. package/lib/overlay/index.js +4 -0
  126. package/lib/pagination/index.js +4 -0
  127. package/lib/password-input/PasswordInput.js +1 -1
  128. package/lib/password-input/index.js +4 -0
  129. package/lib/picker/Picker.js +5 -0
  130. package/lib/picker/index.js +4 -0
  131. package/lib/picker-group/PickerGroup.js +4 -0
  132. package/lib/picker-group/index.js +4 -0
  133. package/lib/popover/index.js +4 -0
  134. package/lib/popup/index.js +4 -0
  135. package/lib/popup/shared.js +12 -0
  136. package/lib/progress/Progress.js +1 -1
  137. package/lib/progress/index.js +4 -0
  138. package/lib/pull-refresh/index.js +4 -0
  139. package/lib/radio/Radio.js +4 -0
  140. package/lib/radio/index.js +4 -0
  141. package/lib/radio-group/index.js +4 -0
  142. package/lib/rate/index.js +4 -0
  143. package/lib/row/index.js +4 -0
  144. package/lib/search/Search.js +4 -4
  145. package/lib/search/index.js +4 -0
  146. package/lib/share-sheet/index.js +4 -0
  147. package/lib/sidebar/index.js +4 -0
  148. package/lib/sidebar-item/index.js +4 -0
  149. package/lib/skeleton/Skeleton.js +4 -0
  150. package/lib/skeleton/index.js +4 -0
  151. package/lib/skeleton-avatar/index.js +4 -0
  152. package/lib/skeleton-image/index.js +4 -0
  153. package/lib/skeleton-paragraph/index.js +4 -0
  154. package/lib/skeleton-title/index.js +4 -0
  155. package/lib/slider/Slider.d.ts +1 -1
  156. package/lib/slider/index.d.ts +1 -1
  157. package/lib/slider/index.js +4 -0
  158. package/lib/space/index.js +4 -0
  159. package/lib/step/index.js +4 -0
  160. package/lib/stepper/Stepper.js +2 -2
  161. package/lib/stepper/index.js +4 -0
  162. package/lib/steps/index.js +4 -0
  163. package/lib/sticky/Sticky.js +2 -0
  164. package/lib/sticky/index.js +4 -0
  165. package/lib/submit-bar/index.js +4 -0
  166. package/lib/swipe/Swipe.js +3 -2
  167. package/lib/swipe/index.js +4 -0
  168. package/lib/swipe-cell/index.js +4 -0
  169. package/lib/swipe-item/index.js +4 -0
  170. package/lib/switch/index.js +4 -0
  171. package/lib/tab/index.js +4 -0
  172. package/lib/tabbar/index.js +4 -0
  173. package/lib/tabbar-item/index.js +4 -0
  174. package/lib/tabs/Tabs.js +5 -1
  175. package/lib/tabs/index.js +4 -0
  176. package/lib/tag/Tag.d.ts +1 -1
  177. package/lib/tag/index.d.ts +1 -1
  178. package/lib/tag/index.js +4 -0
  179. package/lib/text-ellipsis/index.css +1 -1
  180. package/lib/text-ellipsis/index.js +4 -0
  181. package/lib/time-picker/index.js +4 -0
  182. package/lib/toast/function-call.js +4 -0
  183. package/lib/toast/index.js +4 -0
  184. package/lib/tree-select/TreeSelect.js +1 -1
  185. package/lib/tree-select/index.js +4 -0
  186. package/lib/uploader/Uploader.js +5 -1
  187. package/lib/uploader/index.js +4 -0
  188. package/lib/uploader/utils.js +2 -2
  189. package/lib/utils/create.js +4 -0
  190. package/lib/vant.cjs.js +182 -34
  191. package/lib/vant.es.js +182 -34
  192. package/lib/vant.js +219 -41
  193. package/lib/vant.min.js +1 -1
  194. package/lib/web-types.json +1 -1
  195. package/package.json +5 -5
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -52,7 +52,7 @@ function isOversize(items, maxSize) {
52
52
  if ((0, import_utils.isFunction)(maxSize)) {
53
53
  return maxSize(item.file);
54
54
  }
55
- return item.file.size > maxSize;
55
+ return item.file.size > +maxSize;
56
56
  }
57
57
  return false;
58
58
  });
@@ -69,7 +69,7 @@ function filterFiles(items, maxSize) {
69
69
  });
70
70
  return { valid, invalid };
71
71
  }
72
- const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
72
+ const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg|avif)/i;
73
73
  const isImageUrl = (url) => IMAGE_REGEXP.test(url);
74
74
  function isImageFile(item) {
75
75
  if (item.isImage) {
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
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 || event.touches.length > 1)
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) {
@@ -5639,7 +5655,7 @@ var stdin_default$1c = vue.defineComponent({
5639
5655
  });
5640
5656
  };
5641
5657
  const scroll = () => {
5642
- show.value = scrollParent.value ? getScrollTop(scrollParent.value) >= props.offset : false;
5658
+ show.value = scrollParent.value ? getScrollTop(scrollParent.value) >= +props.offset : false;
5643
5659
  };
5644
5660
  const getTarget = () => {
5645
5661
  const {
@@ -5725,7 +5741,7 @@ function getDayByOffset(date, offset) {
5725
5741
  const getPrevDay = (date) => getDayByOffset(date, -1);
5726
5742
  const getNextDay = (date) => getDayByOffset(date, 1);
5727
5743
  const getToday = () => {
5728
- const today = new Date();
5744
+ const today = /* @__PURE__ */ new Date();
5729
5745
  today.setHours(0, 0, 0, 0);
5730
5746
  return today;
5731
5747
  };
@@ -6363,7 +6379,7 @@ var stdin_default$18 = vue.defineComponent({
6363
6379
  rangePrompt,
6364
6380
  showRangePrompt
6365
6381
  } = props;
6366
- if (maxRange && calcDateNum(date) > maxRange) {
6382
+ if (maxRange && calcDateNum(date) > +maxRange) {
6367
6383
  if (showRangePrompt) {
6368
6384
  showToast(rangePrompt || t$f("rangePrompt", maxRange));
6369
6385
  }
@@ -6450,7 +6466,7 @@ var stdin_default$18 = vue.defineComponent({
6450
6466
  if (selectedIndex !== -1) {
6451
6467
  const [unselectedDate] = dates.splice(selectedIndex, 1);
6452
6468
  emit("unselect", cloneDate(unselectedDate));
6453
- } else if (props.maxRange && dates.length >= props.maxRange) {
6469
+ } else if (props.maxRange && dates.length >= +props.maxRange) {
6454
6470
  showToast(props.rangePrompt || t$f("rangePrompt", props.maxRange));
6455
6471
  } else {
6456
6472
  select([...dates, date]);
@@ -7177,7 +7193,7 @@ var stdin_default$12 = vue.defineComponent({
7177
7193
  } = parent.props;
7178
7194
  const value = modelValue.slice();
7179
7195
  if (checked2) {
7180
- const overlimit = max && value.length >= max;
7196
+ const overlimit = max && value.length >= +max;
7181
7197
  if (!overlimit && !value.includes(name2)) {
7182
7198
  value.push(name2);
7183
7199
  if (props.bindGroup) {
@@ -8657,7 +8673,7 @@ var stdin_default$R = vue.defineComponent({
8657
8673
  }
8658
8674
  });
8659
8675
  const CouponList = withInstall(stdin_default$R);
8660
- const currentYear = new Date().getFullYear();
8676
+ const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
8661
8677
  const [name$H] = createNamespace("date-picker");
8662
8678
  const datePickerProps = extend({}, sharedProps, {
8663
8679
  columnsType: {
@@ -9455,7 +9471,7 @@ var stdin_default$K = vue.defineComponent({
9455
9471
  } else if (gutter) {
9456
9472
  const gutterValue = addUnit(gutter);
9457
9473
  style.paddingRight = gutterValue;
9458
- if (index.value >= columnNum) {
9474
+ if (index.value >= +columnNum) {
9459
9475
  style.marginTop = gutterValue;
9460
9476
  }
9461
9477
  }
@@ -9756,8 +9772,9 @@ var stdin_default$J = vue.defineComponent({
9756
9772
  if (state.scale < 1) {
9757
9773
  resetScale();
9758
9774
  }
9759
- if (state.scale > props.maxZoom) {
9760
- state.scale = +props.maxZoom;
9775
+ const maxZoom = +props.maxZoom;
9776
+ if (state.scale > maxZoom) {
9777
+ state.scale = maxZoom;
9761
9778
  }
9762
9779
  }
9763
9780
  }
@@ -10360,13 +10377,14 @@ var stdin_default$F = vue.defineComponent({
10360
10377
  const scrollParent = use.useScrollParent(root);
10361
10378
  const check = () => {
10362
10379
  vue.nextTick(() => {
10363
- if (loading.value || props.finished || props.disabled || props.error || (tabStatus == null ? void 0 : tabStatus.value) === false) {
10380
+ if (loading.value || props.finished || props.disabled || props.error || // skip check when inside an inactive tab
10381
+ (tabStatus == null ? void 0 : tabStatus.value) === false) {
10364
10382
  return;
10365
10383
  }
10366
10384
  const {
10367
- offset,
10368
10385
  direction
10369
10386
  } = props;
10387
+ const offset = +props.offset;
10370
10388
  const scrollParentRect = use.useRect(scrollParent);
10371
10389
  if (!scrollParentRect.height || isHidden(root)) {
10372
10390
  return;
@@ -10999,7 +11017,7 @@ var stdin_default$A = vue.defineComponent({
10999
11017
  emit("update:modelValue", value.slice(0, value.length - 1));
11000
11018
  } else if (type === "close") {
11001
11019
  onClose();
11002
- } else if (value.length < props.maxlength) {
11020
+ } else if (value.length < +props.maxlength) {
11003
11021
  emit("input", text);
11004
11022
  emit("update:modelValue", value + text);
11005
11023
  }
@@ -11273,10 +11291,10 @@ var stdin_default$y = vue.defineComponent({
11273
11291
  const {
11274
11292
  mask,
11275
11293
  value,
11276
- length,
11277
11294
  gutter,
11278
11295
  focused
11279
11296
  } = props;
11297
+ const length = +props.length;
11280
11298
  for (let i = 0; i < length; i++) {
11281
11299
  const char = value[i];
11282
11300
  const showBorder = i !== 0 && !gutter;
@@ -11529,7 +11547,7 @@ const progressProps = {
11529
11547
  percentage: {
11530
11548
  type: numericProp,
11531
11549
  default: 0,
11532
- validator: (value) => value >= 0 && value <= 100
11550
+ validator: (value) => +value >= 0 && +value <= 100
11533
11551
  }
11534
11552
  };
11535
11553
  var stdin_default$w = vue.defineComponent({
@@ -12003,7 +12021,7 @@ var stdin_default$t = vue.defineComponent({
12003
12021
  attrs
12004
12022
  }) {
12005
12023
  const id = useId();
12006
- const filedRef = vue.ref();
12024
+ const fieldRef = vue.ref();
12007
12025
  const onCancel = () => {
12008
12026
  if (!slots.action) {
12009
12027
  emit("update:modelValue", "");
@@ -12039,11 +12057,11 @@ var stdin_default$t = vue.defineComponent({
12039
12057
  };
12040
12058
  const blur = () => {
12041
12059
  var _a;
12042
- return (_a = filedRef.value) == null ? void 0 : _a.blur();
12060
+ return (_a = fieldRef.value) == null ? void 0 : _a.blur();
12043
12061
  };
12044
12062
  const focus = () => {
12045
12063
  var _a;
12046
- return (_a = filedRef.value) == null ? void 0 : _a.focus();
12064
+ return (_a = fieldRef.value) == null ? void 0 : _a.focus();
12047
12065
  };
12048
12066
  const onBlur = (event) => emit("blur", event);
12049
12067
  const onFocus = (event) => emit("focus", event);
@@ -12058,7 +12076,7 @@ var stdin_default$t = vue.defineComponent({
12058
12076
  });
12059
12077
  const onInput = (value) => emit("update:modelValue", value);
12060
12078
  return vue.createVNode(Field, vue.mergeProps({
12061
- "ref": filedRef,
12079
+ "ref": fieldRef,
12062
12080
  "type": "search",
12063
12081
  "class": bem$k("field"),
12064
12082
  "border": false,
@@ -13031,8 +13049,8 @@ var stdin_default$d = vue.defineComponent({
13031
13049
  let actionType;
13032
13050
  const inputRef = vue.ref();
13033
13051
  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);
13052
+ const minusDisabled = vue.computed(() => props.disabled || props.disableMinus || +current2.value <= +props.min);
13053
+ const plusDisabled = vue.computed(() => props.disabled || props.disablePlus || +current2.value >= +props.max);
13036
13054
  const inputStyle = vue.computed(() => ({
13037
13055
  width: addUnit(props.inputWidth),
13038
13056
  height: addUnit(props.buttonSize)
@@ -13855,7 +13873,7 @@ var stdin_default$6 = vue.defineComponent({
13855
13873
  const index = activeId.indexOf(item.id);
13856
13874
  if (index !== -1) {
13857
13875
  activeId.splice(index, 1);
13858
- } else if (activeId.length < props.max) {
13876
+ } else if (activeId.length < +props.max) {
13859
13877
  activeId.push(item.id);
13860
13878
  }
13861
13879
  } else {
@@ -13942,7 +13960,7 @@ function isOversize(items, maxSize) {
13942
13960
  if (isFunction(maxSize)) {
13943
13961
  return maxSize(item.file);
13944
13962
  }
13945
- return item.file.size > maxSize;
13963
+ return item.file.size > +maxSize;
13946
13964
  }
13947
13965
  return false;
13948
13966
  });
@@ -13959,7 +13977,7 @@ function filterFiles(items, maxSize) {
13959
13977
  });
13960
13978
  return { valid, invalid };
13961
13979
  }
13962
- const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
13980
+ const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg|avif)/i;
13963
13981
  const isImageUrl = (url) => IMAGE_REGEXP.test(url);
13964
13982
  function isImageFile(item) {
13965
13983
  if (item.isImage) {
@@ -14276,7 +14294,7 @@ var stdin_default$4 = vue.defineComponent({
14276
14294
  };
14277
14295
  const onClickUpload = (event) => emit("clickUpload", event);
14278
14296
  const renderUpload = () => {
14279
- if (props.modelValue.length >= props.maxCount) {
14297
+ if (props.modelValue.length >= +props.maxCount) {
14280
14298
  return;
14281
14299
  }
14282
14300
  const Input = props.readonly ? null : vue.createVNode("input", {
@@ -14365,6 +14383,10 @@ class ReactiveListener {
14365
14383
  this.initState();
14366
14384
  this.render("loading", false);
14367
14385
  }
14386
+ /*
14387
+ * init listener state
14388
+ * @return
14389
+ */
14368
14390
  initState() {
14369
14391
  if ("dataset" in this.el) {
14370
14392
  this.el.dataset.src = this.src;
@@ -14378,9 +14400,20 @@ class ReactiveListener {
14378
14400
  rendered: false
14379
14401
  };
14380
14402
  }
14403
+ /*
14404
+ * record performance
14405
+ * @return
14406
+ */
14381
14407
  record(event) {
14382
14408
  this.performanceData[event] = Date.now();
14383
14409
  }
14410
+ /*
14411
+ * update image listener data
14412
+ * @param {String} image uri
14413
+ * @param {String} loading image uri
14414
+ * @param {String} error image uri
14415
+ * @return
14416
+ */
14384
14417
  update({ src, loading, error }) {
14385
14418
  const oldSrc = this.src;
14386
14419
  this.src = src;
@@ -14392,15 +14425,27 @@ class ReactiveListener {
14392
14425
  this.initState();
14393
14426
  }
14394
14427
  }
14428
+ /*
14429
+ * check el is in view
14430
+ * @return {Boolean} el is in view
14431
+ */
14395
14432
  checkInView() {
14396
14433
  const rect = use.useRect(this.el);
14397
14434
  return rect.top < window.innerHeight * this.options.preLoad && rect.bottom > this.options.preLoadTop && rect.left < window.innerWidth * this.options.preLoad && rect.right > 0;
14398
14435
  }
14436
+ /*
14437
+ * listener filter
14438
+ */
14399
14439
  filter() {
14400
14440
  Object.keys(this.options.filter).forEach((key) => {
14401
14441
  this.options.filter[key](this, this.options);
14402
14442
  });
14403
14443
  }
14444
+ /*
14445
+ * render loading first
14446
+ * @params cb:Function
14447
+ * @return
14448
+ */
14404
14449
  renderLoading(cb) {
14405
14450
  this.state.loading = true;
14406
14451
  loadImageAsync(
@@ -14423,6 +14468,10 @@ class ReactiveListener {
14423
14468
  }
14424
14469
  );
14425
14470
  }
14471
+ /*
14472
+ * try load image and render it
14473
+ * @return
14474
+ */
14426
14475
  load(onFinish = noop) {
14427
14476
  if (this.attempt > this.options.attempt - 1 && this.state.error) {
14428
14477
  if (process.env.NODE_ENV !== "production" && !this.options.silent) {
@@ -14471,9 +14520,19 @@ class ReactiveListener {
14471
14520
  );
14472
14521
  });
14473
14522
  }
14523
+ /*
14524
+ * render image
14525
+ * @param {String} state to render // ['loading', 'src', 'error']
14526
+ * @param {String} is form cache
14527
+ * @return
14528
+ */
14474
14529
  render(state, cache) {
14475
14530
  this.elRenderer(this, state, cache);
14476
14531
  }
14532
+ /*
14533
+ * output performance data
14534
+ * @return {Object} performance data
14535
+ */
14477
14536
  performance() {
14478
14537
  let state = "loading";
14479
14538
  let time = 0;
@@ -14489,6 +14548,10 @@ class ReactiveListener {
14489
14548
  time
14490
14549
  };
14491
14550
  }
14551
+ /*
14552
+ * $destroy
14553
+ * @return
14554
+ */
14492
14555
  $destroy() {
14493
14556
  this.el = null;
14494
14557
  this.src = null;
@@ -14559,12 +14622,26 @@ function stdin_default$3() {
14559
14622
  );
14560
14623
  this.setMode(this.options.observer ? modeType.observer : modeType.event);
14561
14624
  }
14625
+ /**
14626
+ * update config
14627
+ * @param {Object} config params
14628
+ * @return
14629
+ */
14562
14630
  config(options = {}) {
14563
14631
  Object.assign(this.options, options);
14564
14632
  }
14633
+ /**
14634
+ * output listener's load performance
14635
+ * @return {Array}
14636
+ */
14565
14637
  performance() {
14566
14638
  return this.listeners.map((item) => item.performance());
14567
14639
  }
14640
+ /*
14641
+ * add lazy component to queue
14642
+ * @param {Vue} vm lazy component instance
14643
+ * @return
14644
+ */
14568
14645
  addLazyBox(vm) {
14569
14646
  this.listeners.push(vm);
14570
14647
  if (use.inBrowser) {
@@ -14575,6 +14652,13 @@ function stdin_default$3() {
14575
14652
  }
14576
14653
  }
14577
14654
  }
14655
+ /*
14656
+ * add image listener to queue
14657
+ * @param {DOM} el
14658
+ * @param {object} binding vue directive binding
14659
+ * @param {vnode} vnode vue directive vnode
14660
+ * @return
14661
+ */
14578
14662
  add(el, binding, vnode) {
14579
14663
  if (this.listeners.some((item) => item.el === el)) {
14580
14664
  this.update(el, binding);
@@ -14615,6 +14699,12 @@ function stdin_default$3() {
14615
14699
  vue.nextTick(() => this.lazyLoadHandler());
14616
14700
  });
14617
14701
  }
14702
+ /**
14703
+ * update image src
14704
+ * @param {DOM} el
14705
+ * @param {object} vue directive binding
14706
+ * @return
14707
+ */
14618
14708
  update(el, binding, vnode) {
14619
14709
  const value = this.valueFormatter(binding.value);
14620
14710
  let { src } = value;
@@ -14636,6 +14726,11 @@ function stdin_default$3() {
14636
14726
  this.lazyLoadHandler();
14637
14727
  vue.nextTick(() => this.lazyLoadHandler());
14638
14728
  }
14729
+ /**
14730
+ * remove listener form list
14731
+ * @param {DOM} el
14732
+ * @return
14733
+ */
14639
14734
  remove(el) {
14640
14735
  if (!el)
14641
14736
  return;
@@ -14648,6 +14743,11 @@ function stdin_default$3() {
14648
14743
  existItem.$destroy();
14649
14744
  }
14650
14745
  }
14746
+ /*
14747
+ * remove lazy components form list
14748
+ * @param {Vue} vm Vue instance
14749
+ * @return
14750
+ */
14651
14751
  removeComponent(vm) {
14652
14752
  if (!vm)
14653
14753
  return;
@@ -14680,6 +14780,14 @@ function stdin_default$3() {
14680
14780
  this.initIntersectionObserver();
14681
14781
  }
14682
14782
  }
14783
+ /*
14784
+ *** Private functions ***
14785
+ */
14786
+ /*
14787
+ * add listener target
14788
+ * @param {DOM} el listener target
14789
+ * @return
14790
+ */
14683
14791
  addListenerTarget(el) {
14684
14792
  if (!el)
14685
14793
  return;
@@ -14698,6 +14806,11 @@ function stdin_default$3() {
14698
14806
  }
14699
14807
  return this.targetIndex;
14700
14808
  }
14809
+ /*
14810
+ * remove listener target or reduce target childrenCount
14811
+ * @param {DOM} el or window
14812
+ * @return
14813
+ */
14701
14814
  removeListenerTarget(el) {
14702
14815
  this.targets.forEach((target, index) => {
14703
14816
  if (target.el === el) {
@@ -14710,6 +14823,12 @@ function stdin_default$3() {
14710
14823
  }
14711
14824
  });
14712
14825
  }
14826
+ /*
14827
+ * add or remove eventlistener
14828
+ * @param {DOM} el DOM or Window
14829
+ * @param {boolean} start flag
14830
+ * @return
14831
+ */
14713
14832
  initListen(el, start) {
14714
14833
  this.options.ListenEvents.forEach(
14715
14834
  (evt) => (start ? on : off)(el, evt, this.lazyLoadHandler)
@@ -14750,6 +14869,10 @@ function stdin_default$3() {
14750
14869
  this.Event.listeners[event].forEach((func) => func(context, inCache));
14751
14870
  };
14752
14871
  }
14872
+ /**
14873
+ * find nodes which in viewport and trigger load
14874
+ * @return
14875
+ */
14753
14876
  lazyLoadHandler() {
14754
14877
  const freeList = [];
14755
14878
  this.listeners.forEach((listener) => {
@@ -14766,6 +14889,11 @@ function stdin_default$3() {
14766
14889
  item.$destroy();
14767
14890
  });
14768
14891
  }
14892
+ /**
14893
+ * init IntersectionObserver
14894
+ * set mode to observer
14895
+ * @return
14896
+ */
14769
14897
  initIntersectionObserver() {
14770
14898
  if (!hasIntersectionObserver) {
14771
14899
  return;
@@ -14780,6 +14908,10 @@ function stdin_default$3() {
14780
14908
  });
14781
14909
  }
14782
14910
  }
14911
+ /**
14912
+ * init IntersectionObserver
14913
+ * @return
14914
+ */
14783
14915
  observerHandler(entries) {
14784
14916
  entries.forEach((entry) => {
14785
14917
  if (entry.isIntersecting) {
@@ -14793,6 +14925,13 @@ function stdin_default$3() {
14793
14925
  }
14794
14926
  });
14795
14927
  }
14928
+ /**
14929
+ * set element attribute with image'url and state
14930
+ * @param {object} lazyload listener object
14931
+ * @param {string} state will be rendered
14932
+ * @param {bool} inCache is rendered from cache
14933
+ * @return
14934
+ */
14796
14935
  elRenderer(listener, state, cache) {
14797
14936
  if (!listener.el)
14798
14937
  return;
@@ -14824,6 +14963,11 @@ function stdin_default$3() {
14824
14963
  el.dispatchEvent(event);
14825
14964
  }
14826
14965
  }
14966
+ /**
14967
+ * generate loading loaded error image url
14968
+ * @param {string} image's src
14969
+ * @return {object} image's loading, loaded, error url
14970
+ */
14827
14971
  valueFormatter(value) {
14828
14972
  let src = value;
14829
14973
  let { loading, error } = this.options;
@@ -15003,7 +15147,6 @@ var stdin_default$1 = (lazyManager) => ({
15003
15147
  },
15004
15148
  created() {
15005
15149
  this.init();
15006
- this.renderSrc = this.options.loading;
15007
15150
  },
15008
15151
  mounted() {
15009
15152
  this.el = this.$el;
@@ -15053,6 +15196,11 @@ var stdin_default$1 = (lazyManager) => ({
15053
15196
  }
15054
15197
  });
15055
15198
  const Lazyload = {
15199
+ /*
15200
+ * install function
15201
+ * @param {App} app
15202
+ * @param {object} options lazyload options
15203
+ */
15056
15204
  install(app, options = {}) {
15057
15205
  const LazyClass = stdin_default$3();
15058
15206
  const lazy = new LazyClass(options);
@@ -15076,7 +15224,7 @@ const Lazyload = {
15076
15224
  });
15077
15225
  }
15078
15226
  };
15079
- const version = "4.1.0";
15227
+ const version = "4.1.1";
15080
15228
  function install(app) {
15081
15229
  const components = [
15082
15230
  ActionBar,