vant 3.5.3 → 3.6.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 (199) hide show
  1. package/README.md +4 -0
  2. package/changelog.generated.md +39 -42
  3. package/es/badge/Badge.mjs +1 -1
  4. package/es/calendar/Calendar.mjs +3 -4
  5. package/es/composables/use-global-z-index.d.ts +4 -0
  6. package/es/composables/use-global-z-index.mjs +9 -0
  7. package/es/composables/use-height.mjs +2 -0
  8. package/es/composables/use-lock-scroll.mjs +3 -1
  9. package/es/config-provider/ConfigProvider.d.ts +3 -0
  10. package/es/config-provider/ConfigProvider.mjs +8 -1
  11. package/es/config-provider/index.d.ts +2 -0
  12. package/es/dropdown-menu/DropdownMenu.mjs +2 -1
  13. package/es/empty/Empty.d.ts +1 -1
  14. package/es/empty/Empty.mjs +281 -16
  15. package/es/field/Field.mjs +4 -1
  16. package/es/field/types.d.ts +1 -0
  17. package/es/field/utils.d.ts +1 -0
  18. package/es/field/utils.mjs +8 -2
  19. package/es/image-preview/ImagePreviewItem.mjs +1 -1
  20. package/es/index-bar/IndexBar.mjs +3 -2
  21. package/es/index.d.ts +2 -1
  22. package/es/index.mjs +4 -1
  23. package/es/list/List.mjs +2 -1
  24. package/es/number-keyboard/NumberKeyboard.mjs +1 -2
  25. package/es/number-keyboard/NumberKeyboardKey.mjs +2 -2
  26. package/es/password-input/PasswordInput.mjs +1 -1
  27. package/es/picker/PickerColumn.mjs +1 -1
  28. package/es/popover/Popover.mjs +11 -9
  29. package/es/popup/Popup.mjs +6 -5
  30. package/es/pull-refresh/PullRefresh.mjs +7 -3
  31. package/es/rate/Rate.mjs +1 -1
  32. package/es/search/index.css +1 -1
  33. package/es/search/index.less +3 -1
  34. package/es/slider/Slider.mjs +1 -1
  35. package/es/space/Space.d.ts +48 -0
  36. package/es/space/Space.mjs +87 -0
  37. package/es/space/index.css +1 -0
  38. package/es/space/index.d.ts +37 -0
  39. package/es/space/index.less +38 -0
  40. package/es/space/index.mjs +8 -0
  41. package/es/space/style/index.d.ts +1 -0
  42. package/es/space/style/index.mjs +2 -0
  43. package/es/space/style/less.d.ts +1 -0
  44. package/es/space/style/less.mjs +2 -0
  45. package/es/stepper/Stepper.mjs +1 -1
  46. package/es/sticky/Sticky.mjs +2 -1
  47. package/es/swipe/Swipe.mjs +1 -1
  48. package/es/swipe-cell/SwipeCell.mjs +1 -1
  49. package/es/tabs/Tabs.mjs +12 -2
  50. package/es/tabs/TabsContent.mjs +4 -0
  51. package/es/vue-tsx-shim.d.ts +7 -0
  52. package/lib/badge/Badge.js +1 -1
  53. package/lib/calendar/Calendar.js +3 -4
  54. package/lib/composables/use-global-z-index.d.ts +4 -0
  55. package/lib/composables/use-global-z-index.js +28 -0
  56. package/lib/composables/use-height.js +2 -0
  57. package/lib/composables/use-lock-scroll.js +3 -1
  58. package/lib/config-provider/ConfigProvider.d.ts +3 -0
  59. package/lib/config-provider/ConfigProvider.js +7 -0
  60. package/lib/config-provider/index.d.ts +2 -0
  61. package/lib/dropdown-menu/DropdownMenu.js +2 -1
  62. package/lib/empty/Empty.d.ts +1 -1
  63. package/lib/empty/Empty.js +281 -16
  64. package/lib/field/Field.js +3 -0
  65. package/lib/field/types.d.ts +1 -0
  66. package/lib/field/utils.d.ts +1 -0
  67. package/lib/field/utils.js +8 -2
  68. package/lib/image-preview/ImagePreviewItem.js +1 -1
  69. package/lib/index-bar/IndexBar.js +3 -2
  70. package/lib/index.css +1 -1
  71. package/lib/index.d.ts +2 -1
  72. package/lib/index.js +4 -1
  73. package/lib/index.less +1 -0
  74. package/lib/list/List.js +2 -1
  75. package/lib/number-keyboard/NumberKeyboard.js +1 -2
  76. package/lib/number-keyboard/NumberKeyboardKey.js +2 -2
  77. package/lib/password-input/PasswordInput.js +1 -1
  78. package/lib/picker/PickerColumn.js +1 -1
  79. package/lib/popover/Popover.js +10 -8
  80. package/lib/popup/Popup.js +6 -5
  81. package/lib/pull-refresh/PullRefresh.js +6 -2
  82. package/lib/rate/Rate.js +1 -1
  83. package/lib/search/index.css +1 -1
  84. package/lib/search/index.less +3 -1
  85. package/lib/slider/Slider.js +1 -1
  86. package/lib/space/Space.d.ts +48 -0
  87. package/lib/space/Space.js +106 -0
  88. package/lib/space/index.css +1 -0
  89. package/lib/space/index.d.ts +37 -0
  90. package/lib/space/index.js +30 -0
  91. package/lib/space/index.less +38 -0
  92. package/lib/space/style/index.d.ts +1 -0
  93. package/lib/space/style/index.js +2 -0
  94. package/lib/space/style/less.d.ts +1 -0
  95. package/lib/space/style/less.js +2 -0
  96. package/lib/stepper/Stepper.js +1 -1
  97. package/lib/sticky/Sticky.js +2 -1
  98. package/lib/swipe/Swipe.js +1 -1
  99. package/lib/swipe-cell/SwipeCell.js +1 -1
  100. package/lib/tabs/Tabs.js +12 -2
  101. package/lib/tabs/TabsContent.js +4 -0
  102. package/lib/vant.cjs.js +1202 -1074
  103. package/lib/vant.es.js +1203 -1075
  104. package/lib/vant.js +1212 -1150
  105. package/lib/vant.min.js +1 -1
  106. package/lib/vue-tsx-shim.d.ts +7 -0
  107. package/lib/web-types.json +1189 -1117
  108. package/package.json +2 -2
  109. package/es/empty/Images.d.ts +0 -4
  110. package/es/empty/Images.mjs +0 -271
  111. package/lib/.DS_Store +0 -0
  112. package/lib/action-bar/.DS_Store +0 -0
  113. package/lib/action-bar-button/.DS_Store +0 -0
  114. package/lib/action-bar-icon/.DS_Store +0 -0
  115. package/lib/action-sheet/.DS_Store +0 -0
  116. package/lib/address-edit/.DS_Store +0 -0
  117. package/lib/address-list/.DS_Store +0 -0
  118. package/lib/area/.DS_Store +0 -0
  119. package/lib/badge/.DS_Store +0 -0
  120. package/lib/button/.DS_Store +0 -0
  121. package/lib/calendar/.DS_Store +0 -0
  122. package/lib/card/.DS_Store +0 -0
  123. package/lib/cascader/.DS_Store +0 -0
  124. package/lib/cell/.DS_Store +0 -0
  125. package/lib/cell-group/.DS_Store +0 -0
  126. package/lib/checkbox/.DS_Store +0 -0
  127. package/lib/checkbox-group/.DS_Store +0 -0
  128. package/lib/circle/.DS_Store +0 -0
  129. package/lib/col/.DS_Store +0 -0
  130. package/lib/collapse/.DS_Store +0 -0
  131. package/lib/collapse-item/.DS_Store +0 -0
  132. package/lib/config-provider/.DS_Store +0 -0
  133. package/lib/contact-card/.DS_Store +0 -0
  134. package/lib/contact-edit/.DS_Store +0 -0
  135. package/lib/contact-list/.DS_Store +0 -0
  136. package/lib/count-down/.DS_Store +0 -0
  137. package/lib/coupon/.DS_Store +0 -0
  138. package/lib/coupon-cell/.DS_Store +0 -0
  139. package/lib/coupon-list/.DS_Store +0 -0
  140. package/lib/datetime-picker/.DS_Store +0 -0
  141. package/lib/dialog/.DS_Store +0 -0
  142. package/lib/divider/.DS_Store +0 -0
  143. package/lib/dropdown-item/.DS_Store +0 -0
  144. package/lib/dropdown-menu/.DS_Store +0 -0
  145. package/lib/empty/.DS_Store +0 -0
  146. package/lib/empty/Images.d.ts +0 -4
  147. package/lib/empty/Images.js +0 -290
  148. package/lib/field/.DS_Store +0 -0
  149. package/lib/form/.DS_Store +0 -0
  150. package/lib/grid/.DS_Store +0 -0
  151. package/lib/grid-item/.DS_Store +0 -0
  152. package/lib/icon/.DS_Store +0 -0
  153. package/lib/image/.DS_Store +0 -0
  154. package/lib/image-preview/.DS_Store +0 -0
  155. package/lib/index-anchor/.DS_Store +0 -0
  156. package/lib/index-bar/.DS_Store +0 -0
  157. package/lib/lazyload/.DS_Store +0 -0
  158. package/lib/list/.DS_Store +0 -0
  159. package/lib/loading/.DS_Store +0 -0
  160. package/lib/locale/.DS_Store +0 -0
  161. package/lib/nav-bar/.DS_Store +0 -0
  162. package/lib/notice-bar/.DS_Store +0 -0
  163. package/lib/notify/.DS_Store +0 -0
  164. package/lib/number-keyboard/.DS_Store +0 -0
  165. package/lib/overlay/.DS_Store +0 -0
  166. package/lib/pagination/.DS_Store +0 -0
  167. package/lib/password-input/.DS_Store +0 -0
  168. package/lib/picker/.DS_Store +0 -0
  169. package/lib/popover/.DS_Store +0 -0
  170. package/lib/popup/.DS_Store +0 -0
  171. package/lib/progress/.DS_Store +0 -0
  172. package/lib/pull-refresh/.DS_Store +0 -0
  173. package/lib/radio/.DS_Store +0 -0
  174. package/lib/radio-group/.DS_Store +0 -0
  175. package/lib/rate/.DS_Store +0 -0
  176. package/lib/row/.DS_Store +0 -0
  177. package/lib/search/.DS_Store +0 -0
  178. package/lib/share-sheet/.DS_Store +0 -0
  179. package/lib/sidebar/.DS_Store +0 -0
  180. package/lib/sidebar-item/.DS_Store +0 -0
  181. package/lib/skeleton/.DS_Store +0 -0
  182. package/lib/slider/.DS_Store +0 -0
  183. package/lib/step/.DS_Store +0 -0
  184. package/lib/stepper/.DS_Store +0 -0
  185. package/lib/steps/.DS_Store +0 -0
  186. package/lib/sticky/.DS_Store +0 -0
  187. package/lib/submit-bar/.DS_Store +0 -0
  188. package/lib/swipe/.DS_Store +0 -0
  189. package/lib/swipe-cell/.DS_Store +0 -0
  190. package/lib/swipe-item/.DS_Store +0 -0
  191. package/lib/switch/.DS_Store +0 -0
  192. package/lib/tab/.DS_Store +0 -0
  193. package/lib/tabbar/.DS_Store +0 -0
  194. package/lib/tabbar-item/.DS_Store +0 -0
  195. package/lib/tabs/.DS_Store +0 -0
  196. package/lib/tag/.DS_Store +0 -0
  197. package/lib/toast/.DS_Store +0 -0
  198. package/lib/tree-select/.DS_Store +0 -0
  199. package/lib/uploader/.DS_Store +0 -0
@@ -15,8 +15,13 @@ function isEmptyValue(value) {
15
15
  return !value;
16
16
  }
17
17
  function runSyncRule(value, rule) {
18
- if (rule.required && isEmptyValue(value)) {
19
- return false;
18
+ if (isEmptyValue(value)) {
19
+ if (rule.required) {
20
+ return false;
21
+ }
22
+ if (rule.validateEmpty === false) {
23
+ return true;
24
+ }
20
25
  }
21
26
  if (rule.pattern && !rule.pattern.test(String(value))) {
22
27
  return false;
@@ -93,6 +98,7 @@ export {
93
98
  endComposing,
94
99
  getRuleMessage,
95
100
  getStringLength,
101
+ isEmptyValue,
96
102
  mapInputType,
97
103
  resizeTextarea,
98
104
  runRuleValidator,
@@ -225,7 +225,7 @@ var stdin_default = defineComponent({
225
225
  };
226
226
  return _createVNode(SwipeItem, {
227
227
  "class": bem("swipe-item"),
228
- "onTouchstart": onTouchStart,
228
+ "onTouchstartPassive": onTouchStart,
229
229
  "onTouchmove": onTouchMove,
230
230
  "onTouchend": onTouchEnd,
231
231
  "onTouchcancel": onTouchEnd
@@ -121,7 +121,8 @@ var stdin_default = defineComponent({
121
121
  nextTick(onScroll);
122
122
  };
123
123
  useEventListener("scroll", onScroll, {
124
- target: scrollParent
124
+ target: scrollParent,
125
+ passive: true
125
126
  });
126
127
  onMounted(init);
127
128
  watch(() => props.indexList, init);
@@ -196,7 +197,7 @@ var stdin_default = defineComponent({
196
197
  "class": bem("sidebar"),
197
198
  "style": sidebarStyle.value,
198
199
  "onClick": onClickSidebar,
199
- "onTouchstart": touch.start,
200
+ "onTouchstartPassive": touch.start,
200
201
  "onTouchmove": onTouchMove
201
202
  }, [renderIndexes()]);
202
203
  useExpose({
package/es/index.d.ts CHANGED
@@ -67,6 +67,7 @@ export * from "./sidebar";
67
67
  export * from "./sidebar-item";
68
68
  export * from "./skeleton";
69
69
  export * from "./slider";
70
+ export * from "./space";
70
71
  export * from "./step";
71
72
  export * from "./stepper";
72
73
  export * from "./steps";
@@ -90,4 +91,4 @@ declare namespace _default {
90
91
  }
91
92
  export default _default;
92
93
  export function install(app: any): void;
93
- export const version: "3.5.3";
94
+ export const version: "3.6.1";
package/es/index.mjs CHANGED
@@ -66,6 +66,7 @@ import { Sidebar } from "./sidebar/index.mjs";
66
66
  import { SidebarItem } from "./sidebar-item/index.mjs";
67
67
  import { Skeleton } from "./skeleton/index.mjs";
68
68
  import { Slider } from "./slider/index.mjs";
69
+ import { Space } from "./space/index.mjs";
69
70
  import { Step } from "./step/index.mjs";
70
71
  import { Stepper } from "./stepper/index.mjs";
71
72
  import { Steps } from "./steps/index.mjs";
@@ -83,7 +84,7 @@ import { Tag } from "./tag/index.mjs";
83
84
  import { Toast } from "./toast/index.mjs";
84
85
  import { TreeSelect } from "./tree-select/index.mjs";
85
86
  import { Uploader } from "./uploader/index.mjs";
86
- const version = "3.5.3";
87
+ const version = "3.6.1";
87
88
  function install(app) {
88
89
  const components = [
89
90
  ActionBar,
@@ -154,6 +155,7 @@ function install(app) {
154
155
  SidebarItem,
155
156
  Skeleton,
156
157
  Slider,
158
+ Space,
157
159
  Step,
158
160
  Stepper,
159
161
  Steps,
@@ -249,6 +251,7 @@ export * from "./sidebar/index.mjs";
249
251
  export * from "./sidebar-item/index.mjs";
250
252
  export * from "./skeleton/index.mjs";
251
253
  export * from "./slider/index.mjs";
254
+ export * from "./space/index.mjs";
252
255
  export * from "./step/index.mjs";
253
256
  export * from "./stepper/index.mjs";
254
257
  export * from "./steps/index.mjs";
package/es/list/List.mjs CHANGED
@@ -115,7 +115,8 @@ var stdin_default = defineComponent({
115
115
  check
116
116
  });
117
117
  useEventListener("scroll", check, {
118
- target: scrollParent
118
+ target: scrollParent,
119
+ passive: true
119
120
  });
120
121
  return () => {
121
122
  var _a;
@@ -204,9 +204,8 @@ var stdin_default = defineComponent({
204
204
  unfit: !props.safeAreaInsetBottom,
205
205
  "with-title": !!Title
206
206
  }),
207
- "onTouchstart": stopPropagation,
208
207
  "onAnimationend": onAnimationEnd,
209
- "onWebkitAnimationEnd": onAnimationEnd
208
+ "onTouchstartPassive": stopPropagation
210
209
  }, [Title, _createVNode("div", {
211
210
  "class": bem("body")
212
211
  }, [_createVNode("div", {
@@ -74,8 +74,8 @@ var stdin_default = defineComponent({
74
74
  "class": bem("wrapper", {
75
75
  wider: props.wider
76
76
  }),
77
- "onTouchstart": onTouchStart,
78
- "onTouchmove": onTouchMove,
77
+ "onTouchstartPassive": onTouchStart,
78
+ "onTouchmovePassive": onTouchMove,
79
79
  "onTouchend": onTouchEnd,
80
80
  "onTouchcancel": onTouchEnd
81
81
  }, [_createVNode("div", {
@@ -66,7 +66,7 @@ var stdin_default = defineComponent({
66
66
  "class": [bem("security"), {
67
67
  [BORDER_SURROUND]: !props.gutter
68
68
  }],
69
- "onTouchstart": onTouchStart
69
+ "onTouchstartPassive": onTouchStart
70
70
  }, [renderPoints()]), info && _createVNode("div", {
71
71
  "class": bem(props.errorInfo ? "error-info" : "info")
72
72
  }, [info])]);
@@ -218,7 +218,7 @@ var stdin_default = defineComponent({
218
218
  watch(() => props.defaultIndex, (value) => setIndex(value));
219
219
  return () => _createVNode("div", {
220
220
  "class": [bem(), props.className],
221
- "onTouchstart": onTouchStart,
221
+ "onTouchstartPassive": onTouchStart,
222
222
  "onTouchmove": onTouchMove,
223
223
  "onTouchend": onTouchEnd,
224
224
  "onTouchcancel": onTouchEnd
@@ -1,5 +1,5 @@
1
1
  import { mergeProps as _mergeProps, Fragment as _Fragment, createVNode as _createVNode } from "vue";
2
- import { ref, watch, nextTick, onMounted, onBeforeUnmount, defineComponent } from "vue";
2
+ import { ref, watch, nextTick, onMounted, watchEffect, onBeforeUnmount, defineComponent } from "vue";
3
3
  import { createPopper, offsetModifier } from "@vant/popperjs";
4
4
  import { pick, extend, truthProp, numericProp, unknownProp, BORDER_BOTTOM, makeArrayProp, makeStringProp, createNamespace } from "../utils/index.mjs";
5
5
  import { useClickAway } from "@vant/use";
@@ -41,6 +41,7 @@ var stdin_default = defineComponent({
41
41
  attrs
42
42
  }) {
43
43
  let popper;
44
+ const popupRef = ref();
44
45
  const wrapperRef = ref();
45
46
  const popoverRef = ref();
46
47
  const getPopoverOptions = () => ({
@@ -81,10 +82,6 @@ var stdin_default = defineComponent({
81
82
  updateShow(!props.show);
82
83
  }
83
84
  };
84
- const onTouchstart = (event) => {
85
- event.stopPropagation();
86
- emit("touchstart", event);
87
- };
88
85
  const onClickAction = (action, index) => {
89
86
  if (action.disabled) {
90
87
  return;
@@ -95,7 +92,7 @@ var stdin_default = defineComponent({
95
92
  }
96
93
  };
97
94
  const onClickAway = () => {
98
- if (props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
95
+ if (props.show && props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
99
96
  updateShow(false);
100
97
  }
101
98
  };
@@ -135,7 +132,13 @@ var stdin_default = defineComponent({
135
132
  "onClick": () => onClickAction(action, index)
136
133
  }, [renderActionContent(action, index)]);
137
134
  };
138
- onMounted(updateLocation);
135
+ onMounted(() => {
136
+ updateLocation();
137
+ watchEffect(() => {
138
+ var _a;
139
+ popupRef.value = (_a = popoverRef.value) == null ? void 0 : _a.popupRef.value;
140
+ });
141
+ });
139
142
  onBeforeUnmount(() => {
140
143
  if (popper) {
141
144
  popper.destroy();
@@ -143,7 +146,7 @@ var stdin_default = defineComponent({
143
146
  }
144
147
  });
145
148
  watch(() => [props.show, props.offset, props.placement], updateLocation);
146
- useClickAway(wrapperRef, onClickAway, {
149
+ useClickAway([wrapperRef, popupRef], onClickAway, {
147
150
  eventName: "touchstart"
148
151
  });
149
152
  return () => {
@@ -158,7 +161,6 @@ var stdin_default = defineComponent({
158
161
  "position": "",
159
162
  "transition": "van-popover-zoom",
160
163
  "lockScroll": false,
161
- "onTouchstart": onTouchstart,
162
164
  "onUpdate:show": updateShow
163
165
  }, attrs, pick(props, popupProps)), {
164
166
  default: () => [props.showArrow && _createVNode("div", {
@@ -7,6 +7,7 @@ import { useExpose } from "../composables/use-expose.mjs";
7
7
  import { useLockScroll } from "../composables/use-lock-scroll.mjs";
8
8
  import { useLazyRender } from "../composables/use-lazy-render.mjs";
9
9
  import { POPUP_TOGGLE_KEY } from "../composables/on-popup-reopen.mjs";
10
+ import { useGlobalZIndex } from "../composables/use-global-z-index.mjs";
10
11
  import { Icon } from "../icon/index.mjs";
11
12
  import { Overlay } from "../overlay/index.mjs";
12
13
  const popupProps = extend({}, popupSharedProps, {
@@ -22,7 +23,6 @@ const popupProps = extend({}, popupSharedProps, {
22
23
  safeAreaInsetBottom: Boolean
23
24
  });
24
25
  const [name, bem] = createNamespace("popup");
25
- let globalZIndex = 2e3;
26
26
  var stdin_default = defineComponent({
27
27
  name,
28
28
  inheritAttrs: false,
@@ -50,11 +50,8 @@ var stdin_default = defineComponent({
50
50
  });
51
51
  const open = () => {
52
52
  if (!opened) {
53
- if (props.zIndex !== void 0) {
54
- globalZIndex = +props.zIndex;
55
- }
56
53
  opened = true;
57
- zIndex.value = ++globalZIndex;
54
+ zIndex.value = props.zIndex !== void 0 ? +props.zIndex : useGlobalZIndex();
58
55
  emit("open");
59
56
  }
60
57
  };
@@ -83,6 +80,8 @@ var stdin_default = defineComponent({
83
80
  "zIndex": zIndex.value,
84
81
  "duration": props.duration,
85
82
  "customStyle": props.overlayStyle,
83
+ "role": props.closeOnClickOverlay ? "button" : void 0,
84
+ "tabindex": props.closeOnClickOverlay ? 0 : void 0,
86
85
  "onClick": onClickOverlay
87
86
  }, {
88
87
  default: slots["overlay-content"]
@@ -119,6 +118,8 @@ var stdin_default = defineComponent({
119
118
  return _withDirectives(_createVNode("div", _mergeProps({
120
119
  "ref": popupRef,
121
120
  "style": style.value,
121
+ "role": "dialog",
122
+ "tabindex": 0,
122
123
  "class": [bem({
123
124
  round,
124
125
  [position]: position
@@ -1,7 +1,7 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
2
  import { ref, watch, reactive, nextTick, defineComponent } from "vue";
3
3
  import { numericProp, getScrollTop, preventDefault, createNamespace, makeNumericProp } from "../utils/index.mjs";
4
- import { useScrollParent } from "@vant/use";
4
+ import { useEventListener, useScrollParent } from "@vant/use";
5
5
  import { useTouch } from "../composables/use-touch.mjs";
6
6
  import { Loading } from "../loading/index.mjs";
7
7
  const [name, bem, t] = createNamespace("pull-refresh");
@@ -29,6 +29,7 @@ var stdin_default = defineComponent({
29
29
  }) {
30
30
  let reachTop;
31
31
  const root = ref();
32
+ const track = ref();
32
33
  const scrollParent = useScrollParent(root);
33
34
  const state = reactive({
34
35
  status: "normal",
@@ -161,6 +162,9 @@ var stdin_default = defineComponent({
161
162
  setStatus(0, false);
162
163
  }
163
164
  });
165
+ useEventListener("touchmove", onTouchMove, {
166
+ target: track
167
+ });
164
168
  return () => {
165
169
  var _a;
166
170
  const trackStyle = {
@@ -171,10 +175,10 @@ var stdin_default = defineComponent({
171
175
  "ref": root,
172
176
  "class": bem()
173
177
  }, [_createVNode("div", {
178
+ "ref": track,
174
179
  "class": bem("track"),
175
180
  "style": trackStyle,
176
- "onTouchstart": onTouchStart,
177
- "onTouchmove": onTouchMove,
181
+ "onTouchstartPassive": onTouchStart,
178
182
  "onTouchend": onTouchEnd,
179
183
  "onTouchcancel": onTouchEnd
180
184
  }, [_createVNode("div", {
package/es/rate/Rate.mjs CHANGED
@@ -207,7 +207,7 @@ var stdin_default = defineComponent({
207
207
  "tabindex": props.disabled ? void 0 : 0,
208
208
  "aria-disabled": props.disabled,
209
209
  "aria-readonly": props.readonly,
210
- "onTouchstart": onTouchStart,
210
+ "onTouchstartPassive": onTouchStart,
211
211
  "onTouchmove": onTouchMove
212
212
  }, [list.value.map(renderStar)]);
213
213
  }
@@ -1 +1 @@
1
- :root{--van-search-padding: 10px var(--van-padding-sm);--van-search-background-color: var(--van-background-color-light);--van-search-content-background-color: var(--van-gray-1);--van-search-input-height: 34px;--van-search-label-padding: 0 5px;--van-search-label-color: var(--van-text-color);--van-search-label-font-size: var(--van-font-size-md);--van-search-left-icon-color: var(--van-gray-6);--van-search-action-padding: 0 var(--van-padding-xs);--van-search-action-text-color: var(--van-text-color);--van-search-action-font-size: var(--van-font-size-md)}.van-search{display:flex;align-items:center;box-sizing:border-box;padding:var(--van-search-padding);background:var(--van-search-background-color)}.van-search__content{display:flex;flex:1;padding-left:var(--van-padding-sm);background:var(--van-search-content-background-color);border-radius:var(--van-border-radius-sm)}.van-search__content--round{border-radius:var(--van-border-radius-max)}.van-search__label{padding:var(--van-search-label-padding);color:var(--van-search-label-color);font-size:var(--van-search-label-font-size);line-height:var(--van-search-input-height)}.van-search__field{flex:1;padding:5px var(--van-padding-xs) 5px 0;background-color:transparent}.van-search__field .van-field__left-icon{color:var(--van-search-left-icon-color)}.van-search--show-action{padding-right:0}.van-search input::-webkit-search-decoration,.van-search input::-webkit-search-cancel-button,.van-search input::-webkit-search-results-button,.van-search input::-webkit-search-results-decoration{display:none}.van-search__action{padding:var(--van-search-action-padding);color:var(--van-search-action-text-color);font-size:var(--van-search-action-font-size);line-height:var(--van-search-input-height);cursor:pointer;-webkit-user-select:none;user-select:none}.van-search__action:active{background-color:var(--van-active-color)}
1
+ :root{--van-search-padding: 10px var(--van-padding-sm);--van-search-background-color: var(--van-background-color-light);--van-search-content-background-color: var(--van-gray-1);--van-search-input-height: 34px;--van-search-label-padding: 0 5px;--van-search-label-color: var(--van-text-color);--van-search-label-font-size: var(--van-font-size-md);--van-search-left-icon-color: var(--van-gray-6);--van-search-action-padding: 0 var(--van-padding-xs);--van-search-action-text-color: var(--van-text-color);--van-search-action-font-size: var(--van-font-size-md)}.van-search{display:flex;align-items:center;box-sizing:border-box;padding:var(--van-search-padding);background:var(--van-search-background-color)}.van-search__content{display:flex;flex:1;padding-left:var(--van-padding-sm);background:var(--van-search-content-background-color);border-radius:var(--van-border-radius-sm)}.van-search__content--round{border-radius:var(--van-border-radius-max)}.van-search__label{padding:var(--van-search-label-padding);color:var(--van-search-label-color);font-size:var(--van-search-label-font-size);line-height:var(--van-search-input-height)}.van-search__field{flex:1;align-items:center;padding:0 var(--van-padding-xs) 0 0;height:var(--van-search-input-height);background-color:transparent}.van-search__field .van-field__left-icon{color:var(--van-search-left-icon-color)}.van-search--show-action{padding-right:0}.van-search input::-webkit-search-decoration,.van-search input::-webkit-search-cancel-button,.van-search input::-webkit-search-results-button,.van-search input::-webkit-search-results-decoration{display:none}.van-search__action{padding:var(--van-search-action-padding);color:var(--van-search-action-text-color);font-size:var(--van-search-action-font-size);line-height:var(--van-search-input-height);cursor:pointer;-webkit-user-select:none;user-select:none}.van-search__action:active{background-color:var(--van-active-color)}
@@ -42,7 +42,9 @@
42
42
 
43
43
  &__field {
44
44
  flex: 1;
45
- padding: 5px var(--van-padding-xs) 5px 0;
45
+ align-items: center;
46
+ padding: 0 var(--van-padding-xs) 0 0;
47
+ height: var(--van-search-input-height);
46
48
  background-color: transparent;
47
49
 
48
50
  .van-field__left-icon {
@@ -235,7 +235,7 @@ var stdin_default = defineComponent({
235
235
  "aria-disabled": props.disabled || void 0,
236
236
  "aria-readonly": props.readonly || void 0,
237
237
  "aria-orientation": props.vertical ? "vertical" : "horizontal",
238
- "onTouchstart": (event) => {
238
+ "onTouchstartPassive": (event) => {
239
239
  if (typeof index === "number") {
240
240
  buttonIndex = index;
241
241
  }
@@ -0,0 +1,48 @@
1
+ import { ExtractPropTypes, PropType } from 'vue';
2
+ export declare type SpaceSize = number | string;
3
+ export declare type SpaceAlign = 'start' | 'end' | 'center' | 'baseline';
4
+ declare const spaceProps: {
5
+ align: PropType<SpaceAlign>;
6
+ direction: {
7
+ type: PropType<"vertical" | "horizontal">;
8
+ default: string;
9
+ };
10
+ size: {
11
+ type: PropType<string | number | [SpaceSize, SpaceSize]>;
12
+ default: number;
13
+ };
14
+ wrap: BooleanConstructor;
15
+ fill: BooleanConstructor;
16
+ };
17
+ export declare type SpaceProps = ExtractPropTypes<typeof spaceProps>;
18
+ declare const _default: import("vue").DefineComponent<{
19
+ align: PropType<SpaceAlign>;
20
+ direction: {
21
+ type: PropType<"vertical" | "horizontal">;
22
+ default: string;
23
+ };
24
+ size: {
25
+ type: PropType<string | number | [SpaceSize, SpaceSize]>;
26
+ default: number;
27
+ };
28
+ wrap: BooleanConstructor;
29
+ fill: BooleanConstructor;
30
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
31
+ align: PropType<SpaceAlign>;
32
+ direction: {
33
+ type: PropType<"vertical" | "horizontal">;
34
+ default: string;
35
+ };
36
+ size: {
37
+ type: PropType<string | number | [SpaceSize, SpaceSize]>;
38
+ default: number;
39
+ };
40
+ wrap: BooleanConstructor;
41
+ fill: BooleanConstructor;
42
+ }>>, {
43
+ fill: boolean;
44
+ size: string | number | [SpaceSize, SpaceSize];
45
+ wrap: boolean;
46
+ direction: "vertical" | "horizontal";
47
+ }>;
48
+ export default _default;
@@ -0,0 +1,87 @@
1
+ import { createVNode as _createVNode } from "vue";
2
+ import { computed, defineComponent, Fragment } from "vue";
3
+ import { createNamespace } from "../utils/index.mjs";
4
+ const [name, bem] = createNamespace("space");
5
+ const spaceProps = {
6
+ align: String,
7
+ direction: {
8
+ type: String,
9
+ default: "horizontal"
10
+ },
11
+ size: {
12
+ type: [Number, String, Array],
13
+ default: 8
14
+ },
15
+ wrap: Boolean,
16
+ fill: Boolean
17
+ };
18
+ function filterEmpty(children = []) {
19
+ const nodes = [];
20
+ children.forEach((child) => {
21
+ if (Array.isArray(child)) {
22
+ nodes.push(...child);
23
+ } else if (child.type === Fragment) {
24
+ nodes.push(...filterEmpty(child.children));
25
+ } else {
26
+ nodes.push(child);
27
+ }
28
+ });
29
+ return nodes.filter((c) => {
30
+ var _a;
31
+ return !(c && (typeof Comment !== "undefined" && c.type === Comment || c.type === Fragment && ((_a = c.children) == null ? void 0 : _a.length) === 0 || c.type === Text && c.children.trim() === ""));
32
+ });
33
+ }
34
+ var stdin_default = defineComponent({
35
+ name,
36
+ props: spaceProps,
37
+ setup(props, {
38
+ slots
39
+ }) {
40
+ const mergedAlign = computed(() => {
41
+ var _a;
42
+ return (_a = props.align) != null ? _a : props.direction === "horizontal" ? "center" : "";
43
+ });
44
+ const getMargin = (size) => {
45
+ if (typeof size === "number") {
46
+ return size + "px";
47
+ }
48
+ return size;
49
+ };
50
+ const getMarginStyle = (isLast) => {
51
+ const style = {};
52
+ const marginRight = `${getMargin(Array.isArray(props.size) ? props.size[0] : props.size)}`;
53
+ const marginBottom = `${getMargin(Array.isArray(props.size) ? props.size[1] : props.size)}`;
54
+ if (isLast) {
55
+ return props.wrap ? {
56
+ marginBottom
57
+ } : {};
58
+ }
59
+ if (props.direction === "horizontal") {
60
+ style.marginRight = marginRight;
61
+ }
62
+ if (props.direction === "vertical" || props.wrap) {
63
+ style.marginBottom = marginBottom;
64
+ }
65
+ return style;
66
+ };
67
+ return () => {
68
+ var _a;
69
+ const children = filterEmpty((_a = slots.default) == null ? void 0 : _a.call(slots));
70
+ return _createVNode("div", {
71
+ "class": [bem({
72
+ [props.direction]: props.direction,
73
+ [`align-${mergedAlign.value}`]: mergedAlign.value,
74
+ wrap: props.wrap,
75
+ fill: props.fill
76
+ })]
77
+ }, [children.map((c, i) => _createVNode("div", {
78
+ "key": `item-${i}`,
79
+ "class": `${name}-item`,
80
+ "style": getMarginStyle(i === children.length - 1)
81
+ }, [c]))]);
82
+ };
83
+ }
84
+ });
85
+ export {
86
+ stdin_default as default
87
+ };
@@ -0,0 +1 @@
1
+ .van-space{display:inline-flex}.van-space--horizontal .van-space-item{display:flex;align-items:center}.van-space--vertical{flex-direction:column}.van-space--align-baseline{align-items:baseline}.van-space--align-start{align-items:flex-start}.van-space--align-end{align-items:flex-end}.van-space--align-center{align-items:center}.van-space--wrap{flex-wrap:wrap}.van-space--fill{display:flex}
@@ -0,0 +1,37 @@
1
+ export declare const Space: import("../utils").WithInstall<import("vue").DefineComponent<{
2
+ align: import("vue").PropType<import("./Space").SpaceAlign>;
3
+ direction: {
4
+ type: import("vue").PropType<"vertical" | "horizontal">;
5
+ default: string;
6
+ };
7
+ size: {
8
+ type: import("vue").PropType<string | number | [import("./Space").SpaceSize, import("./Space").SpaceSize]>;
9
+ default: number;
10
+ };
11
+ wrap: BooleanConstructor;
12
+ fill: BooleanConstructor;
13
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
14
+ align: import("vue").PropType<import("./Space").SpaceAlign>;
15
+ direction: {
16
+ type: import("vue").PropType<"vertical" | "horizontal">;
17
+ default: string;
18
+ };
19
+ size: {
20
+ type: import("vue").PropType<string | number | [import("./Space").SpaceSize, import("./Space").SpaceSize]>;
21
+ default: number;
22
+ };
23
+ wrap: BooleanConstructor;
24
+ fill: BooleanConstructor;
25
+ }>>, {
26
+ fill: boolean;
27
+ size: string | number | [import("./Space").SpaceSize, import("./Space").SpaceSize];
28
+ wrap: boolean;
29
+ direction: "vertical" | "horizontal";
30
+ }>>;
31
+ export default Space;
32
+ export type { SpaceProps, SpaceSize, SpaceAlign } from './Space';
33
+ declare module 'vue' {
34
+ interface GlobalComponents {
35
+ VanSpace: typeof Space;
36
+ }
37
+ }
@@ -0,0 +1,38 @@
1
+ .van-space {
2
+ display: inline-flex;
3
+
4
+ &--horizontal {
5
+ .van-space-item {
6
+ display: flex;
7
+ align-items: center;
8
+ }
9
+ }
10
+
11
+ &--vertical {
12
+ flex-direction: column;
13
+ }
14
+
15
+ &--align-baseline {
16
+ align-items: baseline;
17
+ }
18
+
19
+ &--align-start {
20
+ align-items: flex-start;
21
+ }
22
+
23
+ &--align-end {
24
+ align-items: flex-end;
25
+ }
26
+
27
+ &--align-center {
28
+ align-items: center;
29
+ }
30
+
31
+ &--wrap {
32
+ flex-wrap: wrap;
33
+ }
34
+
35
+ &--fill {
36
+ display: flex;
37
+ }
38
+ }
@@ -0,0 +1,8 @@
1
+ import { withInstall } from "../utils/index.mjs";
2
+ import _Space from "./Space.mjs";
3
+ const Space = withInstall(_Space);
4
+ var stdin_default = Space;
5
+ export {
6
+ Space,
7
+ stdin_default as default
8
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import "../../style/base.css";
2
+ import "../index.css";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import "../../style/base.less";
2
+ import "../index.less";
@@ -180,7 +180,7 @@ var stdin_default = defineComponent({
180
180
  actionType = type;
181
181
  onChange();
182
182
  },
183
- onTouchstart: () => {
183
+ onTouchstartPassive: () => {
184
184
  actionType = type;
185
185
  onTouchStart();
186
186
  },
@@ -97,7 +97,8 @@ var stdin_default = defineComponent({
97
97
  };
98
98
  watch(() => state.fixed, (value) => emit("change", value));
99
99
  useEventListener("scroll", onScroll, {
100
- target: scrollParent
100
+ target: scrollParent,
101
+ passive: true
101
102
  });
102
103
  useVisibilityChange(root, onScroll);
103
104
  return () => {
@@ -339,7 +339,7 @@ var stdin_default = defineComponent({
339
339
  "class": bem("track", {
340
340
  vertical: props.vertical
341
341
  }),
342
- "onTouchstart": onTouchStart,
342
+ "onTouchstartPassive": onTouchStart,
343
343
  "onTouchmove": onTouchMove,
344
344
  "onTouchend": onTouchEnd,
345
345
  "onTouchcancel": onTouchEnd
@@ -144,7 +144,7 @@ var stdin_default = defineComponent({
144
144
  "ref": root,
145
145
  "class": bem(),
146
146
  "onClick": getClickHandler("cell", lockClick),
147
- "onTouchstart": onTouchStart,
147
+ "onTouchstartPassive": onTouchStart,
148
148
  "onTouchmove": onTouchMove,
149
149
  "onTouchend": onTouchEnd,
150
150
  "onTouchcancel": onTouchEnd