vant 4.8.11 → 4.9.0

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 (48) hide show
  1. package/README.md +7 -5
  2. package/es/calendar/Calendar.d.ts +16 -10
  3. package/es/calendar/Calendar.mjs +83 -53
  4. package/es/calendar/CalendarHeader.d.ts +16 -1
  5. package/es/calendar/CalendarHeader.mjs +71 -7
  6. package/es/calendar/CalendarMonth.d.ts +6 -24
  7. package/es/calendar/CalendarMonth.mjs +6 -4
  8. package/es/calendar/index.css +1 -1
  9. package/es/calendar/index.d.ts +11 -7
  10. package/es/calendar/types.d.ts +4 -0
  11. package/es/calendar/utils.d.ts +6 -0
  12. package/es/calendar/utils.mjs +20 -0
  13. package/es/highlight/Highlight.mjs +7 -0
  14. package/es/image-preview/ImagePreviewItem.mjs +2 -0
  15. package/es/index-bar/IndexBar.mjs +10 -2
  16. package/es/index.d.ts +1 -1
  17. package/es/index.mjs +1 -1
  18. package/es/picker-group/PickerGroup.d.ts +13 -0
  19. package/es/picker-group/PickerGroup.mjs +5 -4
  20. package/es/picker-group/index.d.ts +9 -0
  21. package/es/utils/basic.d.ts +1 -1
  22. package/lib/calendar/Calendar.d.ts +16 -10
  23. package/lib/calendar/Calendar.js +82 -52
  24. package/lib/calendar/CalendarHeader.d.ts +16 -1
  25. package/lib/calendar/CalendarHeader.js +68 -4
  26. package/lib/calendar/CalendarMonth.d.ts +6 -24
  27. package/lib/calendar/CalendarMonth.js +6 -4
  28. package/lib/calendar/index.css +1 -1
  29. package/lib/calendar/index.d.ts +11 -7
  30. package/lib/calendar/types.d.ts +4 -0
  31. package/lib/calendar/utils.d.ts +6 -0
  32. package/lib/calendar/utils.js +20 -0
  33. package/lib/highlight/Highlight.js +7 -0
  34. package/lib/image-preview/ImagePreviewItem.js +2 -0
  35. package/lib/index-bar/IndexBar.js +10 -2
  36. package/lib/index.css +1 -1
  37. package/lib/index.d.ts +1 -1
  38. package/lib/index.js +1 -1
  39. package/lib/picker-group/PickerGroup.d.ts +13 -0
  40. package/lib/picker-group/PickerGroup.js +4 -3
  41. package/lib/picker-group/index.d.ts +9 -0
  42. package/lib/utils/basic.d.ts +1 -1
  43. package/lib/vant.cjs.js +193 -66
  44. package/lib/vant.es.js +193 -66
  45. package/lib/vant.js +194 -67
  46. package/lib/vant.min.js +3 -3
  47. package/lib/web-types.json +1 -1
  48. package/package.json +15 -15
@@ -89,6 +89,13 @@ var stdin_default = (0, import_vue2.defineComponent)({
89
89
  return chunks2;
90
90
  }, []);
91
91
  const lastChunk = chunks[chunks.length - 1];
92
+ if (!lastChunk) {
93
+ chunks.push({
94
+ start: 0,
95
+ end: sourceString.length,
96
+ highlight: false
97
+ });
98
+ }
92
99
  if (lastChunk && lastChunk.end < sourceString.length) {
93
100
  chunks.push({
94
101
  start: lastChunk.end,
@@ -213,6 +213,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
213
213
  const checkClose = (event) => {
214
214
  var _a;
215
215
  const swipeItemEl = (_a = swipeItem.value) == null ? void 0 : _a.$el;
216
+ if (!swipeItemEl)
217
+ return;
216
218
  const imageEl = swipeItemEl.firstElementChild;
217
219
  const isClickOverlay = event.target === swipeItemEl;
218
220
  const isClickImage = imageEl == null ? void 0 : imageEl.contains(event.target);
@@ -108,7 +108,11 @@ var stdin_default = (0, import_vue2.defineComponent)({
108
108
  const match = getMatchAnchor(selectActiveIndex);
109
109
  if (match) {
110
110
  const rect = match.getRect(scrollParent.value, scrollParentRect);
111
- active = getActiveAnchor(rect.top, rects);
111
+ if (props.sticky && props.stickyOffsetTop) {
112
+ active = getActiveAnchor(rect.top - props.stickyOffsetTop, rects);
113
+ } else {
114
+ active = getActiveAnchor(rect.top, rects);
115
+ }
112
116
  }
113
117
  } else {
114
118
  active = getActiveAnchor(scrollTop, rects);
@@ -181,7 +185,11 @@ var stdin_default = (0, import_vue2.defineComponent)({
181
185
  return;
182
186
  }
183
187
  if (props.sticky && props.stickyOffsetTop) {
184
- (0, import_utils.setRootScrollTop)((0, import_utils.getRootScrollTop)() - props.stickyOffsetTop);
188
+ if ((0, import_utils.getRootScrollTop)() === offsetHeight - scrollParentRect.height) {
189
+ (0, import_utils.setRootScrollTop)((0, import_utils.getRootScrollTop)());
190
+ } else {
191
+ (0, import_utils.setRootScrollTop)((0, import_utils.getRootScrollTop)() - props.stickyOffsetTop);
192
+ }
185
193
  }
186
194
  emit("select", match.index);
187
195
  }