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
package/lib/vant.js CHANGED
@@ -930,7 +930,7 @@
930
930
  if (slots.content) {
931
931
  return slots.content();
932
932
  }
933
- if (isDef(max) && isNumeric(content) && +content > max) {
933
+ if (isDef(max) && isNumeric(content) && +content > +max) {
934
934
  return `${max}+`;
935
935
  }
936
936
  return content;
@@ -1437,17 +1437,29 @@
1437
1437
  });
1438
1438
  const ActionBarIcon = withInstall(stdin_default$1F);
1439
1439
  const popupSharedProps = {
1440
+ // whether to show popup
1440
1441
  show: Boolean,
1442
+ // z-index
1441
1443
  zIndex: numericProp,
1444
+ // whether to show overlay
1442
1445
  overlay: truthProp,
1446
+ // transition duration
1443
1447
  duration: numericProp,
1448
+ // teleport
1444
1449
  teleport: [String, Object],
1450
+ // prevent body scroll
1445
1451
  lockScroll: truthProp,
1452
+ // whether to lazy render
1446
1453
  lazyRender: truthProp,
1454
+ // callback function before close
1447
1455
  beforeClose: Function,
1456
+ // overlay custom style
1448
1457
  overlayStyle: Object,
1458
+ // overlay custom class name
1449
1459
  overlayClass: unknownProp,
1460
+ // Initial rendering animation
1450
1461
  transitionAppear: Boolean,
1462
+ // whether to close popup when overlay is clicked
1451
1463
  closeOnClickOverlay: truthProp
1452
1464
  };
1453
1465
  const popupSharedPropKeys = Object.keys(
@@ -2331,7 +2343,9 @@
2331
2343
  const state = vue.reactive({
2332
2344
  fixed: false,
2333
2345
  width: 0,
2346
+ // root width
2334
2347
  height: 0,
2348
+ // root height
2335
2349
  transform: 0
2336
2350
  });
2337
2351
  const offset2 = vue.computed(() => unitToPx(props.position === "top" ? props.offsetTop : props.offsetBottom));
@@ -2666,7 +2680,7 @@
2666
2680
  const stopAutoplay = () => clearTimeout(autoplayTimer);
2667
2681
  const autoplay = () => {
2668
2682
  stopAutoplay();
2669
- if (props.autoplay > 0 && count.value > 1) {
2683
+ if (+props.autoplay > 0 && count.value > 1) {
2670
2684
  autoplayTimer = setTimeout(() => {
2671
2685
  next();
2672
2686
  autoplay();
@@ -2711,7 +2725,8 @@
2711
2725
  const resize = () => initialize(state.active);
2712
2726
  let touchStartTime;
2713
2727
  const onTouchStart = (event) => {
2714
- if (!props.touchable || event.touches.length > 1)
2728
+ if (!props.touchable || // avoid resetting position on multi-finger touch
2729
+ event.touches.length > 1)
2715
2730
  return;
2716
2731
  touch.start(event);
2717
2732
  dragging = false;
@@ -2983,7 +2998,7 @@
2983
2998
  lineStyle: {},
2984
2999
  currentIndex: -1
2985
3000
  });
2986
- const scrollable = vue.computed(() => children.length > props.swipeThreshold || !props.ellipsis || props.shrink);
3001
+ const scrollable = vue.computed(() => children.length > +props.swipeThreshold || !props.ellipsis || props.shrink);
2987
3002
  const navStyle = vue.computed(() => ({
2988
3003
  borderColor: props.color,
2989
3004
  background: props.background
@@ -3677,6 +3692,7 @@
3677
3692
  vue.watch(() => props.modelValue, (newValues) => {
3678
3693
  if (!isSameValue(newValues, selectedValues.value) && !isSameValue(newValues, lastEmittedModelValue)) {
3679
3694
  selectedValues.value = newValues.slice(0);
3695
+ lastEmittedModelValue = newValues.slice(0);
3680
3696
  }
3681
3697
  }, {
3682
3698
  deep: true
@@ -3741,8 +3757,8 @@
3741
3757
  county_list: county = {},
3742
3758
  province_list: province = {}
3743
3759
  } = areaList;
3744
- const showCity = columnsNum > 1;
3745
- const showCounty = columnsNum > 2;
3760
+ const showCity = +columnsNum > 1;
3761
+ const showCounty = +columnsNum > 2;
3746
3762
  const getProvinceChildren = () => {
3747
3763
  if (showCity) {
3748
3764
  return placeholder.length ? [
@@ -4397,7 +4413,7 @@
4397
4413
  const {
4398
4414
  maxlength
4399
4415
  } = props;
4400
- if (isDef(maxlength) && getStringLength(value) > maxlength) {
4416
+ if (isDef(maxlength) && getStringLength(value) > +maxlength) {
4401
4417
  const modelValue = getModelValue();
4402
4418
  if (modelValue && getStringLength(modelValue) === +maxlength) {
4403
4419
  return modelValue;
@@ -4428,7 +4444,7 @@
4428
4444
  maxlength
4429
4445
  } = props;
4430
4446
  value = formatter(value);
4431
- if (isDef(maxlength) && getStringLength(value) > maxlength) {
4447
+ if (isDef(maxlength) && getStringLength(value) > +maxlength) {
4432
4448
  value = cutString(value, +maxlength);
4433
4449
  }
4434
4450
  if (inputRef.value && state.focused) {
@@ -6019,7 +6035,7 @@
6019
6035
  });
6020
6036
  };
6021
6037
  const scroll = () => {
6022
- show.value = scrollParent.value ? getScrollTop(scrollParent.value) >= props.offset : false;
6038
+ show.value = scrollParent.value ? getScrollTop(scrollParent.value) >= +props.offset : false;
6023
6039
  };
6024
6040
  const getTarget = () => {
6025
6041
  const {
@@ -6102,7 +6118,7 @@
6102
6118
  const getPrevDay = (date) => getDayByOffset(date, -1);
6103
6119
  const getNextDay = (date) => getDayByOffset(date, 1);
6104
6120
  const getToday = () => {
6105
- const today = new Date();
6121
+ const today = /* @__PURE__ */ new Date();
6106
6122
  today.setHours(0, 0, 0, 0);
6107
6123
  return today;
6108
6124
  };
@@ -6740,7 +6756,7 @@
6740
6756
  rangePrompt,
6741
6757
  showRangePrompt
6742
6758
  } = props;
6743
- if (maxRange && calcDateNum(date) > maxRange) {
6759
+ if (maxRange && calcDateNum(date) > +maxRange) {
6744
6760
  if (showRangePrompt) {
6745
6761
  showToast(rangePrompt || t$f("rangePrompt", maxRange));
6746
6762
  }
@@ -6827,7 +6843,7 @@
6827
6843
  if (selectedIndex !== -1) {
6828
6844
  const [unselectedDate] = dates.splice(selectedIndex, 1);
6829
6845
  emit("unselect", cloneDate(unselectedDate));
6830
- } else if (props.maxRange && dates.length >= props.maxRange) {
6846
+ } else if (props.maxRange && dates.length >= +props.maxRange) {
6831
6847
  showToast(props.rangePrompt || t$f("rangePrompt", props.maxRange));
6832
6848
  } else {
6833
6849
  select([...dates, date]);
@@ -7554,7 +7570,7 @@
7554
7570
  } = parent.props;
7555
7571
  const value = modelValue.slice();
7556
7572
  if (checked2) {
7557
- const overlimit = max && value.length >= max;
7573
+ const overlimit = max && value.length >= +max;
7558
7574
  if (!overlimit && !value.includes(name2)) {
7559
7575
  value.push(name2);
7560
7576
  if (props.bindGroup) {
@@ -9017,7 +9033,7 @@
9017
9033
  }
9018
9034
  });
9019
9035
  const CouponList = withInstall(stdin_default$R);
9020
- const currentYear = new Date().getFullYear();
9036
+ const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
9021
9037
  const [name$H] = createNamespace("date-picker");
9022
9038
  const datePickerProps = extend({}, sharedProps, {
9023
9039
  columnsType: {
@@ -9806,7 +9822,7 @@
9806
9822
  } else if (gutter) {
9807
9823
  const gutterValue = addUnit(gutter);
9808
9824
  style.paddingRight = gutterValue;
9809
- if (index.value >= columnNum) {
9825
+ if (index.value >= +columnNum) {
9810
9826
  style.marginTop = gutterValue;
9811
9827
  }
9812
9828
  }
@@ -10107,8 +10123,9 @@
10107
10123
  if (state.scale < 1) {
10108
10124
  resetScale();
10109
10125
  }
10110
- if (state.scale > props.maxZoom) {
10111
- state.scale = +props.maxZoom;
10126
+ const maxZoom = +props.maxZoom;
10127
+ if (state.scale > maxZoom) {
10128
+ state.scale = maxZoom;
10112
10129
  }
10113
10130
  }
10114
10131
  }
@@ -10708,13 +10725,14 @@
10708
10725
  const scrollParent = useScrollParent(root);
10709
10726
  const check = () => {
10710
10727
  vue.nextTick(() => {
10711
- if (loading.value || props.finished || props.disabled || props.error || (tabStatus == null ? void 0 : tabStatus.value) === false) {
10728
+ if (loading.value || props.finished || props.disabled || props.error || // skip check when inside an inactive tab
10729
+ (tabStatus == null ? void 0 : tabStatus.value) === false) {
10712
10730
  return;
10713
10731
  }
10714
10732
  const {
10715
- offset: offset2,
10716
10733
  direction
10717
10734
  } = props;
10735
+ const offset2 = +props.offset;
10718
10736
  const scrollParentRect = useRect(scrollParent);
10719
10737
  if (!scrollParentRect.height || isHidden(root)) {
10720
10738
  return;
@@ -11347,7 +11365,7 @@
11347
11365
  emit("update:modelValue", value.slice(0, value.length - 1));
11348
11366
  } else if (type === "close") {
11349
11367
  onClose();
11350
- } else if (value.length < props.maxlength) {
11368
+ } else if (value.length < +props.maxlength) {
11351
11369
  emit("input", text);
11352
11370
  emit("update:modelValue", value + text);
11353
11371
  }
@@ -11621,10 +11639,10 @@
11621
11639
  const {
11622
11640
  mask,
11623
11641
  value,
11624
- length,
11625
11642
  gutter,
11626
11643
  focused
11627
11644
  } = props;
11645
+ const length = +props.length;
11628
11646
  for (let i = 0; i < length; i++) {
11629
11647
  const char = value[i];
11630
11648
  const showBorder = i !== 0 && !gutter;
@@ -11764,7 +11782,10 @@
11764
11782
  return element ? (element.nodeName || "").toLowerCase() : null;
11765
11783
  }
11766
11784
  function getDocumentElement(element) {
11767
- return ((isElement(element) ? element.ownerDocument : element.document) || window.document).documentElement;
11785
+ return ((isElement(element) ? element.ownerDocument : (
11786
+ // $FlowFixMe[prop-missing]
11787
+ element.document
11788
+ )) || window.document).documentElement;
11768
11789
  }
11769
11790
  function getWindowScrollBarX(element) {
11770
11791
  return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
@@ -11799,7 +11820,8 @@
11799
11820
  y: 0
11800
11821
  };
11801
11822
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
11802
- if (getNodeName(offsetParent) !== "body" || isScrollParent(documentElement)) {
11823
+ if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
11824
+ isScrollParent(documentElement)) {
11803
11825
  scroll = getNodeScroll(offsetParent);
11804
11826
  }
11805
11827
  if (isHTMLElement(offsetParent)) {
@@ -11838,7 +11860,16 @@
11838
11860
  if (getNodeName(element) === "html") {
11839
11861
  return element;
11840
11862
  }
11841
- return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element);
11863
+ return (
11864
+ // this is a quicker (but less type safe) way to save quite some bytes from the bundle
11865
+ // $FlowFixMe[incompatible-return]
11866
+ // $FlowFixMe[prop-missing]
11867
+ element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
11868
+ element.parentNode || // DOM Element detected
11869
+ (isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
11870
+ // $FlowFixMe[incompatible-call]: HTMLElement is a Node
11871
+ getDocumentElement(element)
11872
+ );
11842
11873
  }
11843
11874
  function getScrollParent(node) {
11844
11875
  if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
@@ -11859,13 +11890,17 @@
11859
11890
  var win = getWindow(scrollParent);
11860
11891
  var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
11861
11892
  var updatedList = list.concat(target);
11862
- return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target)));
11893
+ return isBody ? updatedList : (
11894
+ // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
11895
+ updatedList.concat(listScrollParents(getParentNode(target)))
11896
+ );
11863
11897
  }
11864
11898
  function isTableElement(element) {
11865
11899
  return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
11866
11900
  }
11867
11901
  function getTrueOffsetParent(element) {
11868
- if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
11902
+ if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
11903
+ getComputedStyle(element).position === "fixed") {
11869
11904
  return null;
11870
11905
  }
11871
11906
  return element.offsetParent;
@@ -12205,6 +12240,11 @@
12205
12240
  runModifierEffects();
12206
12241
  return instance2.update();
12207
12242
  },
12243
+ // Sync update – it will always be executed, even if not necessary. This
12244
+ // is useful for low frequency updates where sync behavior simplifies the
12245
+ // logic.
12246
+ // For high frequency updates (e.g. `resize` and `scroll` events), always
12247
+ // prefer the async Popper#update method
12208
12248
  forceUpdate: function forceUpdate() {
12209
12249
  if (isDestroyed) {
12210
12250
  return;
@@ -12250,6 +12290,8 @@
12250
12290
  }
12251
12291
  }
12252
12292
  },
12293
+ // Async and optimistically optimized update – it will not be executed if
12294
+ // not necessary (debounced to run at most once-per-tick)
12253
12295
  update: debounce(function() {
12254
12296
  return new Promise(function(resolve) {
12255
12297
  instance2.forceUpdate();
@@ -12396,13 +12438,19 @@
12396
12438
  offsetParent = offsetParent;
12397
12439
  if (placement === top || (placement === left || placement === right) && variation === end) {
12398
12440
  sideY = bottom;
12399
- var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp];
12441
+ var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : (
12442
+ // $FlowFixMe[prop-missing]
12443
+ offsetParent[heightProp]
12444
+ );
12400
12445
  y -= offsetY - popperRect.height;
12401
12446
  y *= gpuAcceleration ? 1 : -1;
12402
12447
  }
12403
12448
  if (placement === left || (placement === top || placement === bottom) && variation === end) {
12404
12449
  sideX = right;
12405
- var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp];
12450
+ var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : (
12451
+ // $FlowFixMe[prop-missing]
12452
+ offsetParent[widthProp]
12453
+ );
12406
12454
  x -= offsetX - popperRect.width;
12407
12455
  x *= gpuAcceleration ? 1 : -1;
12408
12456
  }
@@ -12786,7 +12834,7 @@
12786
12834
  percentage: {
12787
12835
  type: numericProp,
12788
12836
  default: 0,
12789
- validator: (value) => value >= 0 && value <= 100
12837
+ validator: (value) => +value >= 0 && +value <= 100
12790
12838
  }
12791
12839
  };
12792
12840
  var stdin_default$w = vue.defineComponent({
@@ -13260,7 +13308,7 @@
13260
13308
  attrs
13261
13309
  }) {
13262
13310
  const id = useId();
13263
- const filedRef = vue.ref();
13311
+ const fieldRef = vue.ref();
13264
13312
  const onCancel = () => {
13265
13313
  if (!slots.action) {
13266
13314
  emit("update:modelValue", "");
@@ -13296,11 +13344,11 @@
13296
13344
  };
13297
13345
  const blur = () => {
13298
13346
  var _a;
13299
- return (_a = filedRef.value) == null ? void 0 : _a.blur();
13347
+ return (_a = fieldRef.value) == null ? void 0 : _a.blur();
13300
13348
  };
13301
13349
  const focus = () => {
13302
13350
  var _a;
13303
- return (_a = filedRef.value) == null ? void 0 : _a.focus();
13351
+ return (_a = fieldRef.value) == null ? void 0 : _a.focus();
13304
13352
  };
13305
13353
  const onBlur = (event) => emit("blur", event);
13306
13354
  const onFocus = (event) => emit("focus", event);
@@ -13315,7 +13363,7 @@
13315
13363
  });
13316
13364
  const onInput = (value) => emit("update:modelValue", value);
13317
13365
  return vue.createVNode(Field, vue.mergeProps({
13318
- "ref": filedRef,
13366
+ "ref": fieldRef,
13319
13367
  "type": "search",
13320
13368
  "class": bem$k("field"),
13321
13369
  "border": false,
@@ -14282,8 +14330,8 @@
14282
14330
  let actionType;
14283
14331
  const inputRef = vue.ref();
14284
14332
  const current2 = vue.ref(getInitialValue());
14285
- const minusDisabled = vue.computed(() => props.disabled || props.disableMinus || current2.value <= +props.min);
14286
- const plusDisabled = vue.computed(() => props.disabled || props.disablePlus || current2.value >= +props.max);
14333
+ const minusDisabled = vue.computed(() => props.disabled || props.disableMinus || +current2.value <= +props.min);
14334
+ const plusDisabled = vue.computed(() => props.disabled || props.disablePlus || +current2.value >= +props.max);
14287
14335
  const inputStyle = vue.computed(() => ({
14288
14336
  width: addUnit(props.inputWidth),
14289
14337
  height: addUnit(props.buttonSize)
@@ -15100,7 +15148,7 @@
15100
15148
  const index = activeId.indexOf(item.id);
15101
15149
  if (index !== -1) {
15102
15150
  activeId.splice(index, 1);
15103
- } else if (activeId.length < props.max) {
15151
+ } else if (activeId.length < +props.max) {
15104
15152
  activeId.push(item.id);
15105
15153
  }
15106
15154
  } else {
@@ -15187,7 +15235,7 @@
15187
15235
  if (isFunction(maxSize)) {
15188
15236
  return maxSize(item.file);
15189
15237
  }
15190
- return item.file.size > maxSize;
15238
+ return item.file.size > +maxSize;
15191
15239
  }
15192
15240
  return false;
15193
15241
  });
@@ -15204,7 +15252,7 @@
15204
15252
  });
15205
15253
  return { valid, invalid };
15206
15254
  }
15207
- const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
15255
+ const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg|avif)/i;
15208
15256
  const isImageUrl = (url) => IMAGE_REGEXP.test(url);
15209
15257
  function isImageFile(item) {
15210
15258
  if (item.isImage) {
@@ -15521,7 +15569,7 @@
15521
15569
  };
15522
15570
  const onClickUpload = (event) => emit("clickUpload", event);
15523
15571
  const renderUpload = () => {
15524
- if (props.modelValue.length >= props.maxCount) {
15572
+ if (props.modelValue.length >= +props.maxCount) {
15525
15573
  return;
15526
15574
  }
15527
15575
  const Input = props.readonly ? null : vue.createVNode("input", {
@@ -15610,6 +15658,10 @@
15610
15658
  this.initState();
15611
15659
  this.render("loading", false);
15612
15660
  }
15661
+ /*
15662
+ * init listener state
15663
+ * @return
15664
+ */
15613
15665
  initState() {
15614
15666
  if ("dataset" in this.el) {
15615
15667
  this.el.dataset.src = this.src;
@@ -15623,9 +15675,20 @@
15623
15675
  rendered: false
15624
15676
  };
15625
15677
  }
15678
+ /*
15679
+ * record performance
15680
+ * @return
15681
+ */
15626
15682
  record(event) {
15627
15683
  this.performanceData[event] = Date.now();
15628
15684
  }
15685
+ /*
15686
+ * update image listener data
15687
+ * @param {String} image uri
15688
+ * @param {String} loading image uri
15689
+ * @param {String} error image uri
15690
+ * @return
15691
+ */
15629
15692
  update({ src, loading, error }) {
15630
15693
  const oldSrc = this.src;
15631
15694
  this.src = src;
@@ -15637,15 +15700,27 @@
15637
15700
  this.initState();
15638
15701
  }
15639
15702
  }
15703
+ /*
15704
+ * check el is in view
15705
+ * @return {Boolean} el is in view
15706
+ */
15640
15707
  checkInView() {
15641
15708
  const rect = useRect(this.el);
15642
15709
  return rect.top < window.innerHeight * this.options.preLoad && rect.bottom > this.options.preLoadTop && rect.left < window.innerWidth * this.options.preLoad && rect.right > 0;
15643
15710
  }
15711
+ /*
15712
+ * listener filter
15713
+ */
15644
15714
  filter() {
15645
15715
  Object.keys(this.options.filter).forEach((key) => {
15646
15716
  this.options.filter[key](this, this.options);
15647
15717
  });
15648
15718
  }
15719
+ /*
15720
+ * render loading first
15721
+ * @params cb:Function
15722
+ * @return
15723
+ */
15649
15724
  renderLoading(cb) {
15650
15725
  this.state.loading = true;
15651
15726
  loadImageAsync(
@@ -15664,6 +15739,10 @@
15664
15739
  }
15665
15740
  );
15666
15741
  }
15742
+ /*
15743
+ * try load image and render it
15744
+ * @return
15745
+ */
15667
15746
  load(onFinish = noop) {
15668
15747
  if (this.attempt > this.options.attempt - 1 && this.state.error) {
15669
15748
  onFinish();
@@ -15707,9 +15786,19 @@
15707
15786
  );
15708
15787
  });
15709
15788
  }
15789
+ /*
15790
+ * render image
15791
+ * @param {String} state to render // ['loading', 'src', 'error']
15792
+ * @param {String} is form cache
15793
+ * @return
15794
+ */
15710
15795
  render(state, cache) {
15711
15796
  this.elRenderer(this, state, cache);
15712
15797
  }
15798
+ /*
15799
+ * output performance data
15800
+ * @return {Object} performance data
15801
+ */
15713
15802
  performance() {
15714
15803
  let state = "loading";
15715
15804
  let time = 0;
@@ -15725,6 +15814,10 @@
15725
15814
  time
15726
15815
  };
15727
15816
  }
15817
+ /*
15818
+ * $destroy
15819
+ * @return
15820
+ */
15728
15821
  $destroy() {
15729
15822
  this.el = null;
15730
15823
  this.src = null;
@@ -15795,12 +15888,26 @@
15795
15888
  );
15796
15889
  this.setMode(this.options.observer ? modeType.observer : modeType.event);
15797
15890
  }
15891
+ /**
15892
+ * update config
15893
+ * @param {Object} config params
15894
+ * @return
15895
+ */
15798
15896
  config(options = {}) {
15799
15897
  Object.assign(this.options, options);
15800
15898
  }
15899
+ /**
15900
+ * output listener's load performance
15901
+ * @return {Array}
15902
+ */
15801
15903
  performance() {
15802
15904
  return this.listeners.map((item) => item.performance());
15803
15905
  }
15906
+ /*
15907
+ * add lazy component to queue
15908
+ * @param {Vue} vm lazy component instance
15909
+ * @return
15910
+ */
15804
15911
  addLazyBox(vm) {
15805
15912
  this.listeners.push(vm);
15806
15913
  if (inBrowser) {
@@ -15811,6 +15918,13 @@
15811
15918
  }
15812
15919
  }
15813
15920
  }
15921
+ /*
15922
+ * add image listener to queue
15923
+ * @param {DOM} el
15924
+ * @param {object} binding vue directive binding
15925
+ * @param {vnode} vnode vue directive vnode
15926
+ * @return
15927
+ */
15814
15928
  add(el, binding, vnode) {
15815
15929
  if (this.listeners.some((item) => item.el === el)) {
15816
15930
  this.update(el, binding);
@@ -15851,6 +15965,12 @@
15851
15965
  vue.nextTick(() => this.lazyLoadHandler());
15852
15966
  });
15853
15967
  }
15968
+ /**
15969
+ * update image src
15970
+ * @param {DOM} el
15971
+ * @param {object} vue directive binding
15972
+ * @return
15973
+ */
15854
15974
  update(el, binding, vnode) {
15855
15975
  const value = this.valueFormatter(binding.value);
15856
15976
  let { src } = value;
@@ -15872,6 +15992,11 @@
15872
15992
  this.lazyLoadHandler();
15873
15993
  vue.nextTick(() => this.lazyLoadHandler());
15874
15994
  }
15995
+ /**
15996
+ * remove listener form list
15997
+ * @param {DOM} el
15998
+ * @return
15999
+ */
15875
16000
  remove(el) {
15876
16001
  if (!el)
15877
16002
  return;
@@ -15884,6 +16009,11 @@
15884
16009
  existItem.$destroy();
15885
16010
  }
15886
16011
  }
16012
+ /*
16013
+ * remove lazy components form list
16014
+ * @param {Vue} vm Vue instance
16015
+ * @return
16016
+ */
15887
16017
  removeComponent(vm) {
15888
16018
  if (!vm)
15889
16019
  return;
@@ -15916,6 +16046,14 @@
15916
16046
  this.initIntersectionObserver();
15917
16047
  }
15918
16048
  }
16049
+ /*
16050
+ *** Private functions ***
16051
+ */
16052
+ /*
16053
+ * add listener target
16054
+ * @param {DOM} el listener target
16055
+ * @return
16056
+ */
15919
16057
  addListenerTarget(el) {
15920
16058
  if (!el)
15921
16059
  return;
@@ -15934,6 +16072,11 @@
15934
16072
  }
15935
16073
  return this.targetIndex;
15936
16074
  }
16075
+ /*
16076
+ * remove listener target or reduce target childrenCount
16077
+ * @param {DOM} el or window
16078
+ * @return
16079
+ */
15937
16080
  removeListenerTarget(el) {
15938
16081
  this.targets.forEach((target, index) => {
15939
16082
  if (target.el === el) {
@@ -15946,6 +16089,12 @@
15946
16089
  }
15947
16090
  });
15948
16091
  }
16092
+ /*
16093
+ * add or remove eventlistener
16094
+ * @param {DOM} el DOM or Window
16095
+ * @param {boolean} start flag
16096
+ * @return
16097
+ */
15949
16098
  initListen(el, start2) {
15950
16099
  this.options.ListenEvents.forEach(
15951
16100
  (evt) => (start2 ? on : off)(el, evt, this.lazyLoadHandler)
@@ -15986,6 +16135,10 @@
15986
16135
  this.Event.listeners[event].forEach((func) => func(context, inCache));
15987
16136
  };
15988
16137
  }
16138
+ /**
16139
+ * find nodes which in viewport and trigger load
16140
+ * @return
16141
+ */
15989
16142
  lazyLoadHandler() {
15990
16143
  const freeList = [];
15991
16144
  this.listeners.forEach((listener) => {
@@ -16002,6 +16155,11 @@
16002
16155
  item.$destroy();
16003
16156
  });
16004
16157
  }
16158
+ /**
16159
+ * init IntersectionObserver
16160
+ * set mode to observer
16161
+ * @return
16162
+ */
16005
16163
  initIntersectionObserver() {
16006
16164
  if (!hasIntersectionObserver) {
16007
16165
  return;
@@ -16016,6 +16174,10 @@
16016
16174
  });
16017
16175
  }
16018
16176
  }
16177
+ /**
16178
+ * init IntersectionObserver
16179
+ * @return
16180
+ */
16019
16181
  observerHandler(entries) {
16020
16182
  entries.forEach((entry) => {
16021
16183
  if (entry.isIntersecting) {
@@ -16029,6 +16191,13 @@
16029
16191
  }
16030
16192
  });
16031
16193
  }
16194
+ /**
16195
+ * set element attribute with image'url and state
16196
+ * @param {object} lazyload listener object
16197
+ * @param {string} state will be rendered
16198
+ * @param {bool} inCache is rendered from cache
16199
+ * @return
16200
+ */
16032
16201
  elRenderer(listener, state, cache) {
16033
16202
  if (!listener.el)
16034
16203
  return;
@@ -16060,6 +16229,11 @@
16060
16229
  el.dispatchEvent(event);
16061
16230
  }
16062
16231
  }
16232
+ /**
16233
+ * generate loading loaded error image url
16234
+ * @param {string} image's src
16235
+ * @return {object} image's loading, loaded, error url
16236
+ */
16063
16237
  valueFormatter(value) {
16064
16238
  let src = value;
16065
16239
  let { loading, error } = this.options;
@@ -16236,7 +16410,6 @@
16236
16410
  },
16237
16411
  created() {
16238
16412
  this.init();
16239
- this.renderSrc = this.options.loading;
16240
16413
  },
16241
16414
  mounted() {
16242
16415
  this.el = this.$el;
@@ -16281,6 +16454,11 @@
16281
16454
  }
16282
16455
  });
16283
16456
  const Lazyload = {
16457
+ /*
16458
+ * install function
16459
+ * @param {App} app
16460
+ * @param {object} options lazyload options
16461
+ */
16284
16462
  install(app, options = {}) {
16285
16463
  const LazyClass = stdin_default$3();
16286
16464
  const lazy = new LazyClass(options);
@@ -16304,7 +16482,7 @@
16304
16482
  });
16305
16483
  }
16306
16484
  };
16307
- const version = "4.1.0";
16485
+ const version = "4.1.1";
16308
16486
  function install(app) {
16309
16487
  const components = [
16310
16488
  ActionBar,