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.
Files changed (201) 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 +13 -7
  13. package/es/field/index.css +1 -1
  14. package/es/field/index.d.ts +1 -1
  15. package/es/field/types.d.ts +2 -2
  16. package/es/grid-item/GridItem.mjs +1 -1
  17. package/es/image-preview/ImagePreviewItem.mjs +4 -3
  18. package/es/index.d.ts +1 -1
  19. package/es/index.mjs +1 -1
  20. package/es/lazyload/vue-lazyload/index.mjs +5 -0
  21. package/es/lazyload/vue-lazyload/lazy-image.mjs +0 -1
  22. package/es/lazyload/vue-lazyload/lazy.mjs +81 -0
  23. package/es/lazyload/vue-lazyload/listener.mjs +45 -0
  24. package/es/list/List.mjs +3 -2
  25. package/es/locale/lang/km-KH.d.ts +62 -0
  26. package/es/locale/lang/km-KH.mjs +64 -0
  27. package/es/number-keyboard/NumberKeyboard.mjs +1 -1
  28. package/es/password-input/PasswordInput.mjs +1 -1
  29. package/es/picker/Picker.mjs +1 -0
  30. package/es/popup/shared.mjs +12 -0
  31. package/es/progress/Progress.mjs +1 -1
  32. package/es/search/Search.mjs +4 -4
  33. package/es/slider/Slider.d.ts +1 -1
  34. package/es/slider/index.d.ts +1 -1
  35. package/es/stepper/Stepper.mjs +2 -2
  36. package/es/sticky/Sticky.mjs +2 -0
  37. package/es/swipe/Swipe.mjs +3 -2
  38. package/es/tabs/Tabs.mjs +1 -1
  39. package/es/tag/Tag.d.ts +1 -1
  40. package/es/tag/index.d.ts +1 -1
  41. package/es/text-ellipsis/index.css +1 -1
  42. package/es/tree-select/TreeSelect.mjs +1 -1
  43. package/es/uploader/Uploader.mjs +1 -1
  44. package/es/uploader/utils.mjs +2 -2
  45. package/lib/action-bar/index.js +4 -0
  46. package/lib/action-bar-button/index.js +4 -0
  47. package/lib/action-bar-icon/index.js +4 -0
  48. package/lib/action-sheet/index.js +4 -0
  49. package/lib/address-edit/AddressEdit.js +4 -0
  50. package/lib/address-edit/index.js +4 -0
  51. package/lib/address-list/AddressList.js +4 -0
  52. package/lib/address-list/index.js +4 -0
  53. package/lib/area/index.js +4 -0
  54. package/lib/area/utils.js +2 -2
  55. package/lib/back-top/BackTop.js +1 -1
  56. package/lib/back-top/index.js +4 -0
  57. package/lib/badge/Badge.js +1 -1
  58. package/lib/badge/index.js +4 -0
  59. package/lib/button/Button.d.ts +1 -1
  60. package/lib/button/index.d.ts +1 -1
  61. package/lib/button/index.js +4 -0
  62. package/lib/calendar/Calendar.js +6 -2
  63. package/lib/calendar/CalendarMonth.js +4 -0
  64. package/lib/calendar/index.js +4 -0
  65. package/lib/calendar/utils.js +1 -1
  66. package/lib/card/index.js +4 -0
  67. package/lib/cascader/index.js +4 -0
  68. package/lib/cell/index.js +4 -0
  69. package/lib/cell-group/index.js +4 -0
  70. package/lib/checkbox/Checkbox.js +5 -1
  71. package/lib/checkbox/index.js +4 -0
  72. package/lib/checkbox-group/index.js +4 -0
  73. package/lib/circle/index.js +4 -0
  74. package/lib/col/index.js +4 -0
  75. package/lib/collapse/index.js +4 -0
  76. package/lib/collapse-item/index.js +4 -0
  77. package/lib/config-provider/index.js +4 -0
  78. package/lib/contact-card/index.js +4 -0
  79. package/lib/contact-edit/index.js +4 -0
  80. package/lib/contact-list/index.js +4 -0
  81. package/lib/count-down/index.js +4 -0
  82. package/lib/coupon/index.js +4 -0
  83. package/lib/coupon-cell/index.js +4 -0
  84. package/lib/coupon-list/index.js +4 -0
  85. package/lib/date-picker/DatePicker.js +1 -1
  86. package/lib/date-picker/index.js +4 -0
  87. package/lib/dialog/function-call.js +4 -0
  88. package/lib/dialog/index.js +4 -0
  89. package/lib/divider/Divider.d.ts +1 -1
  90. package/lib/divider/index.d.ts +1 -1
  91. package/lib/divider/index.js +4 -0
  92. package/lib/dropdown-item/index.js +4 -0
  93. package/lib/dropdown-menu/index.js +4 -0
  94. package/lib/empty/index.js +4 -0
  95. package/lib/field/Field.js +13 -7
  96. package/lib/field/index.css +1 -1
  97. package/lib/field/index.d.ts +1 -1
  98. package/lib/field/index.js +4 -0
  99. package/lib/field/types.d.ts +2 -2
  100. package/lib/form/index.js +4 -0
  101. package/lib/grid/index.js +4 -0
  102. package/lib/grid-item/GridItem.js +1 -1
  103. package/lib/grid-item/index.js +4 -0
  104. package/lib/icon/index.js +4 -0
  105. package/lib/image/index.js +4 -0
  106. package/lib/image-preview/ImagePreview.js +4 -0
  107. package/lib/image-preview/ImagePreviewItem.js +4 -3
  108. package/lib/image-preview/function-call.js +4 -0
  109. package/lib/image-preview/index.js +4 -0
  110. package/lib/index-anchor/index.js +4 -0
  111. package/lib/index-bar/index.js +4 -0
  112. package/lib/index.css +1 -1
  113. package/lib/index.d.ts +1 -1
  114. package/lib/index.js +1 -1
  115. package/lib/lazyload/vue-lazyload/index.js +9 -0
  116. package/lib/lazyload/vue-lazyload/lazy-image.js +0 -1
  117. package/lib/lazyload/vue-lazyload/lazy.js +85 -0
  118. package/lib/lazyload/vue-lazyload/listener.js +45 -0
  119. package/lib/list/List.js +3 -2
  120. package/lib/list/index.js +4 -0
  121. package/lib/loading/index.js +4 -0
  122. package/lib/locale/index.js +4 -0
  123. package/lib/locale/lang/km-KH.d.ts +62 -0
  124. package/lib/locale/lang/km-KH.js +83 -0
  125. package/lib/nav-bar/index.js +4 -0
  126. package/lib/notice-bar/index.js +4 -0
  127. package/lib/notify/function-call.js +4 -0
  128. package/lib/notify/index.js +4 -0
  129. package/lib/number-keyboard/NumberKeyboard.js +5 -1
  130. package/lib/number-keyboard/index.js +4 -0
  131. package/lib/overlay/index.js +4 -0
  132. package/lib/pagination/index.js +4 -0
  133. package/lib/password-input/PasswordInput.js +1 -1
  134. package/lib/password-input/index.js +4 -0
  135. package/lib/picker/Picker.js +5 -0
  136. package/lib/picker/index.js +4 -0
  137. package/lib/picker-group/PickerGroup.js +4 -0
  138. package/lib/picker-group/index.js +4 -0
  139. package/lib/popover/index.js +4 -0
  140. package/lib/popup/index.js +4 -0
  141. package/lib/popup/shared.js +12 -0
  142. package/lib/progress/Progress.js +1 -1
  143. package/lib/progress/index.js +4 -0
  144. package/lib/pull-refresh/index.js +4 -0
  145. package/lib/radio/Radio.js +4 -0
  146. package/lib/radio/index.js +4 -0
  147. package/lib/radio-group/index.js +4 -0
  148. package/lib/rate/index.js +4 -0
  149. package/lib/row/index.js +4 -0
  150. package/lib/search/Search.js +4 -4
  151. package/lib/search/index.js +4 -0
  152. package/lib/share-sheet/index.js +4 -0
  153. package/lib/sidebar/index.js +4 -0
  154. package/lib/sidebar-item/index.js +4 -0
  155. package/lib/skeleton/Skeleton.js +4 -0
  156. package/lib/skeleton/index.js +4 -0
  157. package/lib/skeleton-avatar/index.js +4 -0
  158. package/lib/skeleton-image/index.js +4 -0
  159. package/lib/skeleton-paragraph/index.js +4 -0
  160. package/lib/skeleton-title/index.js +4 -0
  161. package/lib/slider/Slider.d.ts +1 -1
  162. package/lib/slider/index.d.ts +1 -1
  163. package/lib/slider/index.js +4 -0
  164. package/lib/space/index.js +4 -0
  165. package/lib/step/index.js +4 -0
  166. package/lib/stepper/Stepper.js +2 -2
  167. package/lib/stepper/index.js +4 -0
  168. package/lib/steps/index.js +4 -0
  169. package/lib/sticky/Sticky.js +2 -0
  170. package/lib/sticky/index.js +4 -0
  171. package/lib/submit-bar/index.js +4 -0
  172. package/lib/swipe/Swipe.js +3 -2
  173. package/lib/swipe/index.js +4 -0
  174. package/lib/swipe-cell/index.js +4 -0
  175. package/lib/swipe-item/index.js +4 -0
  176. package/lib/switch/index.js +4 -0
  177. package/lib/tab/index.js +4 -0
  178. package/lib/tabbar/index.js +4 -0
  179. package/lib/tabbar-item/index.js +4 -0
  180. package/lib/tabs/Tabs.js +5 -1
  181. package/lib/tabs/index.js +4 -0
  182. package/lib/tag/Tag.d.ts +1 -1
  183. package/lib/tag/index.d.ts +1 -1
  184. package/lib/tag/index.js +4 -0
  185. package/lib/text-ellipsis/index.css +1 -1
  186. package/lib/text-ellipsis/index.js +4 -0
  187. package/lib/time-picker/index.js +4 -0
  188. package/lib/toast/function-call.js +4 -0
  189. package/lib/toast/index.js +4 -0
  190. package/lib/tree-select/TreeSelect.js +1 -1
  191. package/lib/tree-select/index.js +4 -0
  192. package/lib/uploader/Uploader.js +5 -1
  193. package/lib/uploader/index.js +4 -0
  194. package/lib/uploader/utils.js +2 -2
  195. package/lib/utils/create.js +4 -0
  196. package/lib/vant.cjs.js +194 -40
  197. package/lib/vant.es.js +194 -40
  198. package/lib/vant.js +231 -47
  199. package/lib/vant.min.js +1 -1
  200. package/lib/web-types.json +1 -1
  201. package/package.json +11 -5
package/lib/vant.es.js CHANGED
@@ -539,7 +539,7 @@ var stdin_default$1L = defineComponent({
539
539
  if (slots.content) {
540
540
  return slots.content();
541
541
  }
542
- if (isDef(max) && isNumeric(content) && +content > max) {
542
+ if (isDef(max) && isNumeric(content) && +content > +max) {
543
543
  return `${max}+`;
544
544
  }
545
545
  return content;
@@ -1046,17 +1046,29 @@ var stdin_default$1F = defineComponent({
1046
1046
  });
1047
1047
  const ActionBarIcon = withInstall(stdin_default$1F);
1048
1048
  const popupSharedProps = {
1049
+ // whether to show popup
1049
1050
  show: Boolean,
1051
+ // z-index
1050
1052
  zIndex: numericProp,
1053
+ // whether to show overlay
1051
1054
  overlay: truthProp,
1055
+ // transition duration
1052
1056
  duration: numericProp,
1057
+ // teleport
1053
1058
  teleport: [String, Object],
1059
+ // prevent body scroll
1054
1060
  lockScroll: truthProp,
1061
+ // whether to lazy render
1055
1062
  lazyRender: truthProp,
1063
+ // callback function before close
1056
1064
  beforeClose: Function,
1065
+ // overlay custom style
1057
1066
  overlayStyle: Object,
1067
+ // overlay custom class name
1058
1068
  overlayClass: unknownProp,
1069
+ // Initial rendering animation
1059
1070
  transitionAppear: Boolean,
1071
+ // whether to close popup when overlay is clicked
1060
1072
  closeOnClickOverlay: truthProp
1061
1073
  };
1062
1074
  const popupSharedPropKeys = Object.keys(
@@ -1943,7 +1955,9 @@ var stdin_default$1z = defineComponent({
1943
1955
  const state = reactive({
1944
1956
  fixed: false,
1945
1957
  width: 0,
1958
+ // root width
1946
1959
  height: 0,
1960
+ // root height
1947
1961
  transform: 0
1948
1962
  });
1949
1963
  const offset = computed(() => unitToPx(props.position === "top" ? props.offsetTop : props.offsetBottom));
@@ -2278,7 +2292,7 @@ var stdin_default$1x = defineComponent({
2278
2292
  const stopAutoplay = () => clearTimeout(autoplayTimer);
2279
2293
  const autoplay = () => {
2280
2294
  stopAutoplay();
2281
- if (props.autoplay > 0 && count.value > 1) {
2295
+ if (+props.autoplay > 0 && count.value > 1) {
2282
2296
  autoplayTimer = setTimeout(() => {
2283
2297
  next();
2284
2298
  autoplay();
@@ -2323,7 +2337,8 @@ var stdin_default$1x = defineComponent({
2323
2337
  const resize = () => initialize(state.active);
2324
2338
  let touchStartTime;
2325
2339
  const onTouchStart = (event) => {
2326
- if (!props.touchable || event.touches.length > 1)
2340
+ if (!props.touchable || // avoid resetting position on multi-finger touch
2341
+ event.touches.length > 1)
2327
2342
  return;
2328
2343
  touch.start(event);
2329
2344
  dragging = false;
@@ -2595,7 +2610,7 @@ var stdin_default$1v = defineComponent({
2595
2610
  lineStyle: {},
2596
2611
  currentIndex: -1
2597
2612
  });
2598
- const scrollable = computed(() => children.length > props.swipeThreshold || !props.ellipsis || props.shrink);
2613
+ const scrollable = computed(() => children.length > +props.swipeThreshold || !props.ellipsis || props.shrink);
2599
2614
  const navStyle = computed(() => ({
2600
2615
  borderColor: props.color,
2601
2616
  background: props.background
@@ -3295,6 +3310,7 @@ var stdin_default$1r = defineComponent({
3295
3310
  watch(() => props.modelValue, (newValues) => {
3296
3311
  if (!isSameValue(newValues, selectedValues.value) && !isSameValue(newValues, lastEmittedModelValue)) {
3297
3312
  selectedValues.value = newValues.slice(0);
3313
+ lastEmittedModelValue = newValues.slice(0);
3298
3314
  }
3299
3315
  }, {
3300
3316
  deep: true
@@ -3359,8 +3375,8 @@ function formatDataForCascade({
3359
3375
  county_list: county = {},
3360
3376
  province_list: province = {}
3361
3377
  } = areaList;
3362
- const showCity = columnsNum > 1;
3363
- const showCounty = columnsNum > 2;
3378
+ const showCity = +columnsNum > 1;
3379
+ const showCounty = +columnsNum > 2;
3364
3380
  const getProvinceChildren = () => {
3365
3381
  if (showCity) {
3366
3382
  return placeholder.length ? [
@@ -4015,7 +4031,7 @@ var stdin_default$1n = defineComponent({
4015
4031
  const {
4016
4032
  maxlength
4017
4033
  } = props;
4018
- if (isDef(maxlength) && getStringLength(value) > maxlength) {
4034
+ if (isDef(maxlength) && getStringLength(value) > +maxlength) {
4019
4035
  const modelValue = getModelValue();
4020
4036
  if (modelValue && getStringLength(modelValue) === +maxlength) {
4021
4037
  return modelValue;
@@ -4046,7 +4062,7 @@ var stdin_default$1n = defineComponent({
4046
4062
  maxlength
4047
4063
  } = props;
4048
4064
  value = formatter(value);
4049
- if (isDef(maxlength) && getStringLength(value) > maxlength) {
4065
+ if (isDef(maxlength) && getStringLength(value) > +maxlength) {
4050
4066
  value = cutString(value, +maxlength);
4051
4067
  }
4052
4068
  if (inputRef.value && state.focused) {
@@ -4111,12 +4127,12 @@ var stdin_default$1n = defineComponent({
4111
4127
  }
4112
4128
  };
4113
4129
  const onBlur = (event) => {
4114
- if (getProp("readonly")) {
4115
- return;
4116
- }
4117
4130
  state.focused = false;
4118
4131
  updateValue(getModelValue(), "onBlur");
4119
4132
  emit("blur", event);
4133
+ if (getProp("readonly")) {
4134
+ return;
4135
+ }
4120
4136
  validateWithTrigger("onBlur");
4121
4137
  nextTick(adjustTextareaSize);
4122
4138
  resetScroll();
@@ -4139,7 +4155,8 @@ var stdin_default$1n = defineComponent({
4139
4155
  });
4140
4156
  const labelStyle = computed(() => {
4141
4157
  const labelWidth = getProp("labelWidth");
4142
- if (labelWidth) {
4158
+ const labelAlign = getProp("labelAlign");
4159
+ if (labelWidth && labelAlign !== "top") {
4143
4160
  return {
4144
4161
  width: addUnit(labelWidth)
4145
4162
  };
@@ -4249,6 +4266,8 @@ var stdin_default$1n = defineComponent({
4249
4266
  }
4250
4267
  };
4251
4268
  const renderLabel = () => {
4269
+ const labelWidth = getProp("labelWidth");
4270
+ const labelAlign = getProp("labelAlign");
4252
4271
  const colon = getProp("colon") ? ":" : "";
4253
4272
  if (slots.label) {
4254
4273
  return [slots.label(), colon];
@@ -4256,7 +4275,10 @@ var stdin_default$1n = defineComponent({
4256
4275
  if (props.label) {
4257
4276
  return createVNode("label", {
4258
4277
  "id": `${id}-label`,
4259
- "for": getInputId()
4278
+ "for": getInputId(),
4279
+ "style": labelAlign === "top" && labelWidth ? {
4280
+ width: addUnit(labelWidth)
4281
+ } : void 0
4260
4282
  }, [props.label + colon]);
4261
4283
  }
4262
4284
  };
@@ -5637,7 +5659,7 @@ var stdin_default$1c = defineComponent({
5637
5659
  });
5638
5660
  };
5639
5661
  const scroll = () => {
5640
- show.value = scrollParent.value ? getScrollTop(scrollParent.value) >= props.offset : false;
5662
+ show.value = scrollParent.value ? getScrollTop(scrollParent.value) >= +props.offset : false;
5641
5663
  };
5642
5664
  const getTarget = () => {
5643
5665
  const {
@@ -5723,7 +5745,7 @@ function getDayByOffset(date, offset) {
5723
5745
  const getPrevDay = (date) => getDayByOffset(date, -1);
5724
5746
  const getNextDay = (date) => getDayByOffset(date, 1);
5725
5747
  const getToday = () => {
5726
- const today = new Date();
5748
+ const today = /* @__PURE__ */ new Date();
5727
5749
  today.setHours(0, 0, 0, 0);
5728
5750
  return today;
5729
5751
  };
@@ -6361,7 +6383,7 @@ var stdin_default$18 = defineComponent({
6361
6383
  rangePrompt,
6362
6384
  showRangePrompt
6363
6385
  } = props;
6364
- if (maxRange && calcDateNum(date) > maxRange) {
6386
+ if (maxRange && calcDateNum(date) > +maxRange) {
6365
6387
  if (showRangePrompt) {
6366
6388
  showToast(rangePrompt || t$f("rangePrompt", maxRange));
6367
6389
  }
@@ -6448,7 +6470,7 @@ var stdin_default$18 = defineComponent({
6448
6470
  if (selectedIndex !== -1) {
6449
6471
  const [unselectedDate] = dates.splice(selectedIndex, 1);
6450
6472
  emit("unselect", cloneDate(unselectedDate));
6451
- } else if (props.maxRange && dates.length >= props.maxRange) {
6473
+ } else if (props.maxRange && dates.length >= +props.maxRange) {
6452
6474
  showToast(props.rangePrompt || t$f("rangePrompt", props.maxRange));
6453
6475
  } else {
6454
6476
  select([...dates, date]);
@@ -7175,7 +7197,7 @@ var stdin_default$12 = defineComponent({
7175
7197
  } = parent.props;
7176
7198
  const value = modelValue.slice();
7177
7199
  if (checked2) {
7178
- const overlimit = max && value.length >= max;
7200
+ const overlimit = max && value.length >= +max;
7179
7201
  if (!overlimit && !value.includes(name2)) {
7180
7202
  value.push(name2);
7181
7203
  if (props.bindGroup) {
@@ -8655,7 +8677,7 @@ var stdin_default$R = defineComponent({
8655
8677
  }
8656
8678
  });
8657
8679
  const CouponList = withInstall(stdin_default$R);
8658
- const currentYear = new Date().getFullYear();
8680
+ const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
8659
8681
  const [name$H] = createNamespace("date-picker");
8660
8682
  const datePickerProps = extend({}, sharedProps, {
8661
8683
  columnsType: {
@@ -9453,7 +9475,7 @@ var stdin_default$K = defineComponent({
9453
9475
  } else if (gutter) {
9454
9476
  const gutterValue = addUnit(gutter);
9455
9477
  style.paddingRight = gutterValue;
9456
- if (index.value >= columnNum) {
9478
+ if (index.value >= +columnNum) {
9457
9479
  style.marginTop = gutterValue;
9458
9480
  }
9459
9481
  }
@@ -9688,7 +9710,7 @@ var stdin_default$J = defineComponent({
9688
9710
  } = touch;
9689
9711
  const moveX = deltaX.value + startMoveX;
9690
9712
  const moveY = deltaY.value + startMoveY;
9691
- if ((moveX > maxMoveX.value || moveX < -maxMoveX.value) && !isImageMoved) {
9713
+ if ((moveX > maxMoveX.value || moveX < -maxMoveX.value) && !isImageMoved && touch.isHorizontal()) {
9692
9714
  state.moving = false;
9693
9715
  return;
9694
9716
  }
@@ -9754,8 +9776,9 @@ var stdin_default$J = defineComponent({
9754
9776
  if (state.scale < 1) {
9755
9777
  resetScale();
9756
9778
  }
9757
- if (state.scale > props.maxZoom) {
9758
- state.scale = +props.maxZoom;
9779
+ const maxZoom = +props.maxZoom;
9780
+ if (state.scale > maxZoom) {
9781
+ state.scale = maxZoom;
9759
9782
  }
9760
9783
  }
9761
9784
  }
@@ -10358,13 +10381,14 @@ var stdin_default$F = defineComponent({
10358
10381
  const scrollParent = useScrollParent(root);
10359
10382
  const check = () => {
10360
10383
  nextTick(() => {
10361
- if (loading.value || props.finished || props.disabled || props.error || (tabStatus == null ? void 0 : tabStatus.value) === false) {
10384
+ if (loading.value || props.finished || props.disabled || props.error || // skip check when inside an inactive tab
10385
+ (tabStatus == null ? void 0 : tabStatus.value) === false) {
10362
10386
  return;
10363
10387
  }
10364
10388
  const {
10365
- offset,
10366
10389
  direction
10367
10390
  } = props;
10391
+ const offset = +props.offset;
10368
10392
  const scrollParentRect = useRect(scrollParent);
10369
10393
  if (!scrollParentRect.height || isHidden(root)) {
10370
10394
  return;
@@ -10997,7 +11021,7 @@ var stdin_default$A = defineComponent({
10997
11021
  emit("update:modelValue", value.slice(0, value.length - 1));
10998
11022
  } else if (type === "close") {
10999
11023
  onClose();
11000
- } else if (value.length < props.maxlength) {
11024
+ } else if (value.length < +props.maxlength) {
11001
11025
  emit("input", text);
11002
11026
  emit("update:modelValue", value + text);
11003
11027
  }
@@ -11271,10 +11295,10 @@ var stdin_default$y = defineComponent({
11271
11295
  const {
11272
11296
  mask,
11273
11297
  value,
11274
- length,
11275
11298
  gutter,
11276
11299
  focused
11277
11300
  } = props;
11301
+ const length = +props.length;
11278
11302
  for (let i = 0; i < length; i++) {
11279
11303
  const char = value[i];
11280
11304
  const showBorder = i !== 0 && !gutter;
@@ -11527,7 +11551,7 @@ const progressProps = {
11527
11551
  percentage: {
11528
11552
  type: numericProp,
11529
11553
  default: 0,
11530
- validator: (value) => value >= 0 && value <= 100
11554
+ validator: (value) => +value >= 0 && +value <= 100
11531
11555
  }
11532
11556
  };
11533
11557
  var stdin_default$w = defineComponent({
@@ -12001,7 +12025,7 @@ var stdin_default$t = defineComponent({
12001
12025
  attrs
12002
12026
  }) {
12003
12027
  const id = useId();
12004
- const filedRef = ref();
12028
+ const fieldRef = ref();
12005
12029
  const onCancel = () => {
12006
12030
  if (!slots.action) {
12007
12031
  emit("update:modelValue", "");
@@ -12037,11 +12061,11 @@ var stdin_default$t = defineComponent({
12037
12061
  };
12038
12062
  const blur = () => {
12039
12063
  var _a;
12040
- return (_a = filedRef.value) == null ? void 0 : _a.blur();
12064
+ return (_a = fieldRef.value) == null ? void 0 : _a.blur();
12041
12065
  };
12042
12066
  const focus = () => {
12043
12067
  var _a;
12044
- return (_a = filedRef.value) == null ? void 0 : _a.focus();
12068
+ return (_a = fieldRef.value) == null ? void 0 : _a.focus();
12045
12069
  };
12046
12070
  const onBlur = (event) => emit("blur", event);
12047
12071
  const onFocus = (event) => emit("focus", event);
@@ -12056,7 +12080,7 @@ var stdin_default$t = defineComponent({
12056
12080
  });
12057
12081
  const onInput = (value) => emit("update:modelValue", value);
12058
12082
  return createVNode(Field, mergeProps({
12059
- "ref": filedRef,
12083
+ "ref": fieldRef,
12060
12084
  "type": "search",
12061
12085
  "class": bem$k("field"),
12062
12086
  "border": false,
@@ -13029,8 +13053,8 @@ var stdin_default$d = defineComponent({
13029
13053
  let actionType;
13030
13054
  const inputRef = ref();
13031
13055
  const current2 = ref(getInitialValue());
13032
- const minusDisabled = computed(() => props.disabled || props.disableMinus || current2.value <= +props.min);
13033
- const plusDisabled = computed(() => props.disabled || props.disablePlus || current2.value >= +props.max);
13056
+ const minusDisabled = computed(() => props.disabled || props.disableMinus || +current2.value <= +props.min);
13057
+ const plusDisabled = computed(() => props.disabled || props.disablePlus || +current2.value >= +props.max);
13034
13058
  const inputStyle = computed(() => ({
13035
13059
  width: addUnit(props.inputWidth),
13036
13060
  height: addUnit(props.buttonSize)
@@ -13853,7 +13877,7 @@ var stdin_default$6 = defineComponent({
13853
13877
  const index = activeId.indexOf(item.id);
13854
13878
  if (index !== -1) {
13855
13879
  activeId.splice(index, 1);
13856
- } else if (activeId.length < props.max) {
13880
+ } else if (activeId.length < +props.max) {
13857
13881
  activeId.push(item.id);
13858
13882
  }
13859
13883
  } else {
@@ -13940,7 +13964,7 @@ function isOversize(items, maxSize) {
13940
13964
  if (isFunction(maxSize)) {
13941
13965
  return maxSize(item.file);
13942
13966
  }
13943
- return item.file.size > maxSize;
13967
+ return item.file.size > +maxSize;
13944
13968
  }
13945
13969
  return false;
13946
13970
  });
@@ -13957,7 +13981,7 @@ function filterFiles(items, maxSize) {
13957
13981
  });
13958
13982
  return { valid, invalid };
13959
13983
  }
13960
- const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
13984
+ const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg|avif)/i;
13961
13985
  const isImageUrl = (url) => IMAGE_REGEXP.test(url);
13962
13986
  function isImageFile(item) {
13963
13987
  if (item.isImage) {
@@ -14274,7 +14298,7 @@ var stdin_default$4 = defineComponent({
14274
14298
  };
14275
14299
  const onClickUpload = (event) => emit("clickUpload", event);
14276
14300
  const renderUpload = () => {
14277
- if (props.modelValue.length >= props.maxCount) {
14301
+ if (props.modelValue.length >= +props.maxCount) {
14278
14302
  return;
14279
14303
  }
14280
14304
  const Input = props.readonly ? null : createVNode("input", {
@@ -14363,6 +14387,10 @@ class ReactiveListener {
14363
14387
  this.initState();
14364
14388
  this.render("loading", false);
14365
14389
  }
14390
+ /*
14391
+ * init listener state
14392
+ * @return
14393
+ */
14366
14394
  initState() {
14367
14395
  if ("dataset" in this.el) {
14368
14396
  this.el.dataset.src = this.src;
@@ -14376,9 +14404,20 @@ class ReactiveListener {
14376
14404
  rendered: false
14377
14405
  };
14378
14406
  }
14407
+ /*
14408
+ * record performance
14409
+ * @return
14410
+ */
14379
14411
  record(event) {
14380
14412
  this.performanceData[event] = Date.now();
14381
14413
  }
14414
+ /*
14415
+ * update image listener data
14416
+ * @param {String} image uri
14417
+ * @param {String} loading image uri
14418
+ * @param {String} error image uri
14419
+ * @return
14420
+ */
14382
14421
  update({ src, loading, error }) {
14383
14422
  const oldSrc = this.src;
14384
14423
  this.src = src;
@@ -14390,15 +14429,27 @@ class ReactiveListener {
14390
14429
  this.initState();
14391
14430
  }
14392
14431
  }
14432
+ /*
14433
+ * check el is in view
14434
+ * @return {Boolean} el is in view
14435
+ */
14393
14436
  checkInView() {
14394
14437
  const rect = useRect(this.el);
14395
14438
  return rect.top < window.innerHeight * this.options.preLoad && rect.bottom > this.options.preLoadTop && rect.left < window.innerWidth * this.options.preLoad && rect.right > 0;
14396
14439
  }
14440
+ /*
14441
+ * listener filter
14442
+ */
14397
14443
  filter() {
14398
14444
  Object.keys(this.options.filter).forEach((key) => {
14399
14445
  this.options.filter[key](this, this.options);
14400
14446
  });
14401
14447
  }
14448
+ /*
14449
+ * render loading first
14450
+ * @params cb:Function
14451
+ * @return
14452
+ */
14402
14453
  renderLoading(cb) {
14403
14454
  this.state.loading = true;
14404
14455
  loadImageAsync(
@@ -14421,6 +14472,10 @@ class ReactiveListener {
14421
14472
  }
14422
14473
  );
14423
14474
  }
14475
+ /*
14476
+ * try load image and render it
14477
+ * @return
14478
+ */
14424
14479
  load(onFinish = noop) {
14425
14480
  if (this.attempt > this.options.attempt - 1 && this.state.error) {
14426
14481
  if (process.env.NODE_ENV !== "production" && !this.options.silent) {
@@ -14469,9 +14524,19 @@ class ReactiveListener {
14469
14524
  );
14470
14525
  });
14471
14526
  }
14527
+ /*
14528
+ * render image
14529
+ * @param {String} state to render // ['loading', 'src', 'error']
14530
+ * @param {String} is form cache
14531
+ * @return
14532
+ */
14472
14533
  render(state, cache) {
14473
14534
  this.elRenderer(this, state, cache);
14474
14535
  }
14536
+ /*
14537
+ * output performance data
14538
+ * @return {Object} performance data
14539
+ */
14475
14540
  performance() {
14476
14541
  let state = "loading";
14477
14542
  let time = 0;
@@ -14487,6 +14552,10 @@ class ReactiveListener {
14487
14552
  time
14488
14553
  };
14489
14554
  }
14555
+ /*
14556
+ * $destroy
14557
+ * @return
14558
+ */
14490
14559
  $destroy() {
14491
14560
  this.el = null;
14492
14561
  this.src = null;
@@ -14557,12 +14626,26 @@ function stdin_default$3() {
14557
14626
  );
14558
14627
  this.setMode(this.options.observer ? modeType.observer : modeType.event);
14559
14628
  }
14629
+ /**
14630
+ * update config
14631
+ * @param {Object} config params
14632
+ * @return
14633
+ */
14560
14634
  config(options = {}) {
14561
14635
  Object.assign(this.options, options);
14562
14636
  }
14637
+ /**
14638
+ * output listener's load performance
14639
+ * @return {Array}
14640
+ */
14563
14641
  performance() {
14564
14642
  return this.listeners.map((item) => item.performance());
14565
14643
  }
14644
+ /*
14645
+ * add lazy component to queue
14646
+ * @param {Vue} vm lazy component instance
14647
+ * @return
14648
+ */
14566
14649
  addLazyBox(vm) {
14567
14650
  this.listeners.push(vm);
14568
14651
  if (inBrowser$1) {
@@ -14573,6 +14656,13 @@ function stdin_default$3() {
14573
14656
  }
14574
14657
  }
14575
14658
  }
14659
+ /*
14660
+ * add image listener to queue
14661
+ * @param {DOM} el
14662
+ * @param {object} binding vue directive binding
14663
+ * @param {vnode} vnode vue directive vnode
14664
+ * @return
14665
+ */
14576
14666
  add(el, binding, vnode) {
14577
14667
  if (this.listeners.some((item) => item.el === el)) {
14578
14668
  this.update(el, binding);
@@ -14613,6 +14703,12 @@ function stdin_default$3() {
14613
14703
  nextTick(() => this.lazyLoadHandler());
14614
14704
  });
14615
14705
  }
14706
+ /**
14707
+ * update image src
14708
+ * @param {DOM} el
14709
+ * @param {object} vue directive binding
14710
+ * @return
14711
+ */
14616
14712
  update(el, binding, vnode) {
14617
14713
  const value = this.valueFormatter(binding.value);
14618
14714
  let { src } = value;
@@ -14634,6 +14730,11 @@ function stdin_default$3() {
14634
14730
  this.lazyLoadHandler();
14635
14731
  nextTick(() => this.lazyLoadHandler());
14636
14732
  }
14733
+ /**
14734
+ * remove listener form list
14735
+ * @param {DOM} el
14736
+ * @return
14737
+ */
14637
14738
  remove(el) {
14638
14739
  if (!el)
14639
14740
  return;
@@ -14646,6 +14747,11 @@ function stdin_default$3() {
14646
14747
  existItem.$destroy();
14647
14748
  }
14648
14749
  }
14750
+ /*
14751
+ * remove lazy components form list
14752
+ * @param {Vue} vm Vue instance
14753
+ * @return
14754
+ */
14649
14755
  removeComponent(vm) {
14650
14756
  if (!vm)
14651
14757
  return;
@@ -14678,6 +14784,14 @@ function stdin_default$3() {
14678
14784
  this.initIntersectionObserver();
14679
14785
  }
14680
14786
  }
14787
+ /*
14788
+ *** Private functions ***
14789
+ */
14790
+ /*
14791
+ * add listener target
14792
+ * @param {DOM} el listener target
14793
+ * @return
14794
+ */
14681
14795
  addListenerTarget(el) {
14682
14796
  if (!el)
14683
14797
  return;
@@ -14696,6 +14810,11 @@ function stdin_default$3() {
14696
14810
  }
14697
14811
  return this.targetIndex;
14698
14812
  }
14813
+ /*
14814
+ * remove listener target or reduce target childrenCount
14815
+ * @param {DOM} el or window
14816
+ * @return
14817
+ */
14699
14818
  removeListenerTarget(el) {
14700
14819
  this.targets.forEach((target, index) => {
14701
14820
  if (target.el === el) {
@@ -14708,6 +14827,12 @@ function stdin_default$3() {
14708
14827
  }
14709
14828
  });
14710
14829
  }
14830
+ /*
14831
+ * add or remove eventlistener
14832
+ * @param {DOM} el DOM or Window
14833
+ * @param {boolean} start flag
14834
+ * @return
14835
+ */
14711
14836
  initListen(el, start) {
14712
14837
  this.options.ListenEvents.forEach(
14713
14838
  (evt) => (start ? on : off)(el, evt, this.lazyLoadHandler)
@@ -14748,6 +14873,10 @@ function stdin_default$3() {
14748
14873
  this.Event.listeners[event].forEach((func) => func(context, inCache));
14749
14874
  };
14750
14875
  }
14876
+ /**
14877
+ * find nodes which in viewport and trigger load
14878
+ * @return
14879
+ */
14751
14880
  lazyLoadHandler() {
14752
14881
  const freeList = [];
14753
14882
  this.listeners.forEach((listener) => {
@@ -14764,6 +14893,11 @@ function stdin_default$3() {
14764
14893
  item.$destroy();
14765
14894
  });
14766
14895
  }
14896
+ /**
14897
+ * init IntersectionObserver
14898
+ * set mode to observer
14899
+ * @return
14900
+ */
14767
14901
  initIntersectionObserver() {
14768
14902
  if (!hasIntersectionObserver) {
14769
14903
  return;
@@ -14778,6 +14912,10 @@ function stdin_default$3() {
14778
14912
  });
14779
14913
  }
14780
14914
  }
14915
+ /**
14916
+ * init IntersectionObserver
14917
+ * @return
14918
+ */
14781
14919
  observerHandler(entries) {
14782
14920
  entries.forEach((entry) => {
14783
14921
  if (entry.isIntersecting) {
@@ -14791,6 +14929,13 @@ function stdin_default$3() {
14791
14929
  }
14792
14930
  });
14793
14931
  }
14932
+ /**
14933
+ * set element attribute with image'url and state
14934
+ * @param {object} lazyload listener object
14935
+ * @param {string} state will be rendered
14936
+ * @param {bool} inCache is rendered from cache
14937
+ * @return
14938
+ */
14794
14939
  elRenderer(listener, state, cache) {
14795
14940
  if (!listener.el)
14796
14941
  return;
@@ -14822,6 +14967,11 @@ function stdin_default$3() {
14822
14967
  el.dispatchEvent(event);
14823
14968
  }
14824
14969
  }
14970
+ /**
14971
+ * generate loading loaded error image url
14972
+ * @param {string} image's src
14973
+ * @return {object} image's loading, loaded, error url
14974
+ */
14825
14975
  valueFormatter(value) {
14826
14976
  let src = value;
14827
14977
  let { loading, error } = this.options;
@@ -15001,7 +15151,6 @@ var stdin_default$1 = (lazyManager) => ({
15001
15151
  },
15002
15152
  created() {
15003
15153
  this.init();
15004
- this.renderSrc = this.options.loading;
15005
15154
  },
15006
15155
  mounted() {
15007
15156
  this.el = this.$el;
@@ -15051,6 +15200,11 @@ var stdin_default$1 = (lazyManager) => ({
15051
15200
  }
15052
15201
  });
15053
15202
  const Lazyload = {
15203
+ /*
15204
+ * install function
15205
+ * @param {App} app
15206
+ * @param {object} options lazyload options
15207
+ */
15054
15208
  install(app, options = {}) {
15055
15209
  const LazyClass = stdin_default$3();
15056
15210
  const lazy = new LazyClass(options);
@@ -15074,7 +15228,7 @@ const Lazyload = {
15074
15228
  });
15075
15229
  }
15076
15230
  };
15077
- const version = "4.1.0";
15231
+ const version = "4.1.2";
15078
15232
  function install(app) {
15079
15233
  const components = [
15080
15234
  ActionBar,