vant 4.0.0-beta.0 → 4.0.0-beta.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 (131) hide show
  1. package/README.md +13 -9
  2. package/changelog.generated.md +191 -150
  3. package/es/badge/Badge.mjs +1 -1
  4. package/es/calendar/Calendar.mjs +3 -4
  5. package/es/collapse/Collapse.d.ts +8 -1
  6. package/es/collapse/Collapse.mjs +28 -1
  7. package/es/collapse/index.d.ts +1 -1
  8. package/es/collapse-item/CollapseItem.mjs +3 -1
  9. package/es/composables/use-global-z-index.d.ts +4 -0
  10. package/es/composables/use-global-z-index.mjs +9 -0
  11. package/es/composables/use-height.d.ts +1 -1
  12. package/es/composables/use-height.mjs +8 -2
  13. package/es/composables/use-lock-scroll.mjs +3 -1
  14. package/es/composables/use-placeholder.mjs +1 -1
  15. package/es/config-provider/ConfigProvider.d.ts +13 -3
  16. package/es/config-provider/ConfigProvider.mjs +25 -9
  17. package/es/config-provider/index.d.ts +8 -2
  18. package/es/dialog/index.css +1 -1
  19. package/es/dropdown-menu/DropdownMenu.mjs +2 -1
  20. package/es/empty/Empty.d.ts +1 -1
  21. package/es/empty/Empty.mjs +281 -16
  22. package/es/field/Field.mjs +4 -1
  23. package/es/field/types.d.ts +1 -0
  24. package/es/field/utils.d.ts +1 -0
  25. package/es/field/utils.mjs +8 -2
  26. package/es/image-preview/ImagePreviewItem.mjs +1 -1
  27. package/es/image-preview/index.css +1 -1
  28. package/es/index-bar/IndexBar.mjs +3 -2
  29. package/es/index.d.ts +2 -1
  30. package/es/index.mjs +4 -1
  31. package/es/list/List.mjs +2 -1
  32. package/es/number-keyboard/NumberKeyboard.mjs +1 -2
  33. package/es/number-keyboard/NumberKeyboardKey.mjs +2 -2
  34. package/es/password-input/PasswordInput.mjs +1 -1
  35. package/es/picker/Picker.d.ts +2 -1
  36. package/es/picker/Picker.mjs +9 -2
  37. package/es/picker/PickerColumn.d.ts +2 -1
  38. package/es/picker/PickerColumn.mjs +5 -4
  39. package/es/picker/index.d.ts +2 -1
  40. package/es/popover/Popover.mjs +28 -27
  41. package/es/popup/Popup.mjs +6 -5
  42. package/es/popup/index.css +1 -1
  43. package/es/pull-refresh/PullRefresh.mjs +7 -3
  44. package/es/rate/Rate.mjs +1 -1
  45. package/es/search/index.css +1 -1
  46. package/es/slider/Slider.mjs +1 -1
  47. package/es/space/Space.d.ts +48 -0
  48. package/es/space/Space.mjs +87 -0
  49. package/es/space/index.css +1 -0
  50. package/es/space/index.d.ts +37 -0
  51. package/es/space/index.mjs +8 -0
  52. package/es/space/style/index.d.ts +1 -0
  53. package/es/space/style/index.mjs +2 -0
  54. package/es/stepper/Stepper.mjs +1 -1
  55. package/es/sticky/Sticky.mjs +2 -1
  56. package/es/swipe/Swipe.mjs +1 -1
  57. package/es/swipe-cell/SwipeCell.mjs +1 -1
  58. package/es/tabs/Tabs.mjs +12 -2
  59. package/es/tabs/TabsContent.mjs +4 -0
  60. package/es/vue-tsx-shim.d.ts +7 -0
  61. package/lib/badge/Badge.js +1 -1
  62. package/lib/calendar/Calendar.js +3 -4
  63. package/lib/collapse/Collapse.d.ts +8 -1
  64. package/lib/collapse/Collapse.js +28 -1
  65. package/lib/collapse/index.d.ts +1 -1
  66. package/lib/collapse-item/CollapseItem.js +3 -1
  67. package/lib/composables/use-global-z-index.d.ts +4 -0
  68. package/lib/composables/use-global-z-index.js +28 -0
  69. package/lib/composables/use-height.d.ts +1 -1
  70. package/lib/composables/use-height.js +8 -2
  71. package/lib/composables/use-lock-scroll.js +3 -1
  72. package/lib/composables/use-placeholder.js +1 -1
  73. package/lib/config-provider/ConfigProvider.d.ts +13 -3
  74. package/lib/config-provider/ConfigProvider.js +23 -7
  75. package/lib/config-provider/index.d.ts +8 -2
  76. package/lib/dialog/index.css +1 -1
  77. package/lib/dropdown-menu/DropdownMenu.js +2 -1
  78. package/lib/empty/Empty.d.ts +1 -1
  79. package/lib/empty/Empty.js +281 -16
  80. package/lib/field/Field.js +3 -0
  81. package/lib/field/types.d.ts +1 -0
  82. package/lib/field/utils.d.ts +1 -0
  83. package/lib/field/utils.js +8 -2
  84. package/lib/image-preview/ImagePreviewItem.js +1 -1
  85. package/lib/image-preview/index.css +1 -1
  86. package/lib/index-bar/IndexBar.js +3 -2
  87. package/lib/index.css +1 -1
  88. package/lib/index.d.ts +2 -1
  89. package/lib/index.js +4 -1
  90. package/lib/list/List.js +2 -1
  91. package/lib/number-keyboard/NumberKeyboard.js +1 -2
  92. package/lib/number-keyboard/NumberKeyboardKey.js +2 -2
  93. package/lib/password-input/PasswordInput.js +1 -1
  94. package/lib/picker/Picker.d.ts +2 -1
  95. package/lib/picker/Picker.js +9 -2
  96. package/lib/picker/PickerColumn.d.ts +2 -1
  97. package/lib/picker/PickerColumn.js +5 -4
  98. package/lib/picker/index.d.ts +2 -1
  99. package/lib/popover/Popover.js +27 -26
  100. package/lib/popup/Popup.js +6 -5
  101. package/lib/popup/index.css +1 -1
  102. package/lib/pull-refresh/PullRefresh.js +6 -2
  103. package/lib/rate/Rate.js +1 -1
  104. package/lib/search/index.css +1 -1
  105. package/lib/slider/Slider.js +1 -1
  106. package/lib/space/Space.d.ts +48 -0
  107. package/lib/space/Space.js +106 -0
  108. package/lib/space/index.css +1 -0
  109. package/lib/space/index.d.ts +37 -0
  110. package/lib/space/index.js +30 -0
  111. package/lib/space/style/index.d.ts +1 -0
  112. package/lib/space/style/index.js +2 -0
  113. package/lib/stepper/Stepper.js +1 -1
  114. package/lib/sticky/Sticky.js +2 -1
  115. package/lib/swipe/Swipe.js +1 -1
  116. package/lib/swipe-cell/SwipeCell.js +1 -1
  117. package/lib/tabs/Tabs.js +12 -2
  118. package/lib/tabs/TabsContent.js +4 -0
  119. package/lib/vant.cjs.js +1332 -1101
  120. package/lib/vant.es.js +1440 -1100
  121. package/lib/vant.js +1285 -1102
  122. package/lib/vant.min.js +1 -1
  123. package/lib/vue-tsx-shim.d.ts +7 -0
  124. package/{vetur → lib}/web-types.json +2304 -2203
  125. package/package.json +6 -11
  126. package/es/empty/Images.d.ts +0 -4
  127. package/es/empty/Images.mjs +0 -271
  128. package/lib/empty/Images.d.ts +0 -4
  129. package/lib/empty/Images.js +0 -290
  130. package/vetur/attributes.json +0 -3530
  131. package/vetur/tags.json +0 -1212
package/lib/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";
@@ -91,4 +92,4 @@ declare namespace _default {
91
92
  }
92
93
  export default _default;
93
94
  export function install(app: any): void;
94
- export const version: "4.0.0-beta.0";
95
+ export const version: "4.0.0-beta.1";
package/lib/index.js CHANGED
@@ -91,6 +91,7 @@ var import_sidebar = require("./sidebar");
91
91
  var import_sidebar_item = require("./sidebar-item");
92
92
  var import_skeleton = require("./skeleton");
93
93
  var import_slider = require("./slider");
94
+ var import_space = require("./space");
94
95
  var import_step = require("./step");
95
96
  var import_stepper = require("./stepper");
96
97
  var import_steps = require("./steps");
@@ -178,6 +179,7 @@ __reExport(stdin_exports, require("./sidebar"), module.exports);
178
179
  __reExport(stdin_exports, require("./sidebar-item"), module.exports);
179
180
  __reExport(stdin_exports, require("./skeleton"), module.exports);
180
181
  __reExport(stdin_exports, require("./slider"), module.exports);
182
+ __reExport(stdin_exports, require("./space"), module.exports);
181
183
  __reExport(stdin_exports, require("./step"), module.exports);
182
184
  __reExport(stdin_exports, require("./stepper"), module.exports);
183
185
  __reExport(stdin_exports, require("./steps"), module.exports);
@@ -196,7 +198,7 @@ __reExport(stdin_exports, require("./time-picker"), module.exports);
196
198
  __reExport(stdin_exports, require("./toast"), module.exports);
197
199
  __reExport(stdin_exports, require("./tree-select"), module.exports);
198
200
  __reExport(stdin_exports, require("./uploader"), module.exports);
199
- const version = "4.0.0-beta.0";
201
+ const version = "4.0.0-beta.1";
200
202
  function install(app) {
201
203
  const components = [
202
204
  import_action_bar.ActionBar,
@@ -267,6 +269,7 @@ function install(app) {
267
269
  import_sidebar_item.SidebarItem,
268
270
  import_skeleton.Skeleton,
269
271
  import_slider.Slider,
272
+ import_space.Space,
270
273
  import_step.Step,
271
274
  import_stepper.Stepper,
272
275
  import_steps.Steps,
package/lib/list/List.js CHANGED
@@ -137,7 +137,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
137
137
  check
138
138
  });
139
139
  (0, import_use.useEventListener)("scroll", check, {
140
- target: scrollParent
140
+ target: scrollParent,
141
+ passive: true
141
142
  });
142
143
  return () => {
143
144
  var _a;
@@ -229,9 +229,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
229
229
  unfit: !props.safeAreaInsetBottom,
230
230
  "with-title": !!Title
231
231
  }),
232
- "onTouchstart": import_utils.stopPropagation,
233
232
  "onAnimationend": onAnimationEnd,
234
- "onWebkitAnimationEnd": onAnimationEnd
233
+ "onTouchstartPassive": import_utils.stopPropagation
235
234
  }, [Title, (0, import_vue.createVNode)("div", {
236
235
  "class": bem("body")
237
236
  }, [(0, import_vue.createVNode)("div", {
@@ -96,8 +96,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
96
96
  "class": bem("wrapper", {
97
97
  wider: props.wider
98
98
  }),
99
- "onTouchstart": onTouchStart,
100
- "onTouchmove": onTouchMove,
99
+ "onTouchstartPassive": onTouchStart,
100
+ "onTouchmovePassive": onTouchMove,
101
101
  "onTouchend": onTouchEnd,
102
102
  "onTouchcancel": onTouchEnd
103
103
  }, [(0, import_vue.createVNode)("div", {
@@ -88,7 +88,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
88
88
  "class": [bem("security"), {
89
89
  [import_utils.BORDER_SURROUND]: !props.gutter
90
90
  }],
91
- "onTouchstart": onTouchStart
91
+ "onTouchstartPassive": onTouchStart
92
92
  }, [renderPoints()]), info && (0, import_vue.createVNode)("div", {
93
93
  "class": bem(props.errorInfo ? "error-info" : "info")
94
94
  }, [info])]);
@@ -101,7 +101,7 @@ declare const _default: import("vue").DefineComponent<{
101
101
  default: PickerToolbarPosition;
102
102
  };
103
103
  columnsFieldNames: PropType<PickerFieldNames>;
104
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "cancel" | "confirm")[], "update:modelValue" | "change" | "cancel" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
104
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "cancel" | "clickOption" | "confirm")[], "update:modelValue" | "change" | "cancel" | "clickOption" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
105
105
  title: StringConstructor;
106
106
  loading: BooleanConstructor;
107
107
  readonly: BooleanConstructor;
@@ -142,6 +142,7 @@ declare const _default: import("vue").DefineComponent<{
142
142
  onChange?: ((...args: any[]) => any) | undefined;
143
143
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
144
144
  onCancel?: ((...args: any[]) => any) | undefined;
145
+ onClickOption?: ((...args: any[]) => any) | undefined;
145
146
  onConfirm?: ((...args: any[]) => any) | undefined;
146
147
  }, {
147
148
  modelValue: Numeric[];
@@ -54,7 +54,7 @@ const pickerProps = (0, import_utils.extend)({}, pickerSharedProps, {
54
54
  var stdin_default = (0, import_vue2.defineComponent)({
55
55
  name,
56
56
  props: pickerProps,
57
- emits: ["confirm", "cancel", "change", "update:modelValue"],
57
+ emits: ["confirm", "cancel", "change", "clickOption", "update:modelValue"],
58
58
  setup(props, {
59
59
  emit,
60
60
  slots
@@ -106,6 +106,12 @@ var stdin_default = (0, import_vue2.defineComponent)({
106
106
  selectedOptions: selectedOptions.value
107
107
  });
108
108
  };
109
+ const onClickOption = (currentOption, columnIndex) => emit("clickOption", {
110
+ columnIndex,
111
+ currentOption,
112
+ selectedValues: selectedValues.value,
113
+ selectedOptions: selectedOptions.value
114
+ });
109
115
  const confirm = () => {
110
116
  children.forEach((child) => child.stopMomentum());
111
117
  emit("confirm", {
@@ -159,7 +165,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
159
165
  "optionHeight": optionHeight.value,
160
166
  "swipeDuration": props.swipeDuration,
161
167
  "visibleOptionNum": props.visibleOptionNum,
162
- "onChange": (value) => onChange(value, columnIndex)
168
+ "onChange": (value) => onChange(value, columnIndex),
169
+ "onClickOption": (option) => onClickOption(option, columnIndex)
163
170
  }, {
164
171
  option: slots.option
165
172
  }));
@@ -25,7 +25,7 @@ declare const _default: import("vue").DefineComponent<{
25
25
  type: (NumberConstructor | StringConstructor)[];
26
26
  required: true;
27
27
  };
28
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
28
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "clickOption")[], "change" | "clickOption", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
29
29
  value: (NumberConstructor | StringConstructor)[];
30
30
  fields: {
31
31
  type: PropType<Required<PickerFieldNames>>;
@@ -51,6 +51,7 @@ declare const _default: import("vue").DefineComponent<{
51
51
  };
52
52
  }>> & {
53
53
  onChange?: ((...args: any[]) => any) | undefined;
54
+ onClickOption?: ((...args: any[]) => any) | undefined;
54
55
  }, {
55
56
  readonly: boolean;
56
57
  allowHtml: boolean;
@@ -45,7 +45,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
45
45
  swipeDuration: (0, import_utils.makeRequiredProp)(import_utils.numericProp),
46
46
  visibleOptionNum: (0, import_utils.makeRequiredProp)(import_utils.numericProp)
47
47
  },
48
- emits: ["change"],
48
+ emits: ["change", "clickOption"],
49
49
  setup(props, {
50
50
  emit,
51
51
  slots
@@ -77,13 +77,14 @@ var stdin_default = (0, import_vue2.defineComponent)({
77
77
  }
78
78
  currentOffset.value = offset;
79
79
  };
80
- const onClickItem = (index) => {
80
+ const onClickOption = (index) => {
81
81
  if (moving || props.readonly) {
82
82
  return;
83
83
  }
84
84
  transitionEndTrigger = null;
85
85
  currentDuration.value = DEFAULT_DURATION;
86
86
  updateValueByIndex(index);
87
+ emit("clickOption", props.options[index]);
87
88
  };
88
89
  const getIndexByOffset = (offset) => (0, import_utils.clamp)(Math.round(-offset / props.optionHeight), 0, count() - 1);
89
90
  const momentum = (distance, duration) => {
@@ -168,7 +169,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
168
169
  disabled,
169
170
  selected: value === props.value
170
171
  }), option.className],
171
- onClick: () => onClickItem(index)
172
+ onClick: () => onClickOption(index)
172
173
  };
173
174
  const childData = {
174
175
  class: "van-ellipsis",
@@ -189,7 +190,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
189
190
  });
190
191
  return () => (0, import_vue.createVNode)("div", {
191
192
  "class": bem(),
192
- "onTouchstart": onTouchStart,
193
+ "onTouchstartPassive": onTouchStart,
193
194
  "onTouchmove": onTouchMove,
194
195
  "onTouchend": onTouchEnd,
195
196
  "onTouchcancel": onTouchEnd
@@ -36,7 +36,7 @@ export declare const Picker: import("../utils").WithInstall<import("vue").Define
36
36
  default: import("./types").PickerToolbarPosition;
37
37
  };
38
38
  columnsFieldNames: import("vue").PropType<import("./types").PickerFieldNames>;
39
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "cancel" | "confirm")[], "update:modelValue" | "change" | "cancel" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
39
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "cancel" | "clickOption" | "confirm")[], "update:modelValue" | "change" | "cancel" | "clickOption" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
40
40
  title: StringConstructor;
41
41
  loading: BooleanConstructor;
42
42
  readonly: BooleanConstructor;
@@ -77,6 +77,7 @@ export declare const Picker: import("../utils").WithInstall<import("vue").Define
77
77
  onChange?: ((...args: any[]) => any) | undefined;
78
78
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
79
79
  onCancel?: ((...args: any[]) => any) | undefined;
80
+ onClickOption?: ((...args: any[]) => any) | undefined;
80
81
  onConfirm?: ((...args: any[]) => any) | undefined;
81
82
  }, {
82
83
  modelValue: import("../utils").Numeric[];
@@ -63,24 +63,26 @@ var stdin_default = (0, import_vue2.defineComponent)({
63
63
  attrs
64
64
  }) {
65
65
  let popper;
66
+ const popupRef = (0, import_vue2.ref)();
66
67
  const wrapperRef = (0, import_vue2.ref)();
67
68
  const popoverRef = (0, import_vue2.ref)();
69
+ const getPopoverOptions = () => ({
70
+ placement: props.placement,
71
+ modifiers: [{
72
+ name: "computeStyles",
73
+ options: {
74
+ adaptive: false,
75
+ gpuAcceleration: false
76
+ }
77
+ }, (0, import_utils.extend)({}, import_popperjs.offsetModifier, {
78
+ options: {
79
+ offset: props.offset
80
+ }
81
+ })]
82
+ });
68
83
  const createPopperInstance = () => {
69
84
  if (wrapperRef.value && popoverRef.value) {
70
- return (0, import_popperjs.createPopper)(wrapperRef.value, popoverRef.value.popupRef.value, {
71
- placement: props.placement,
72
- modifiers: [{
73
- name: "computeStyles",
74
- options: {
75
- adaptive: false,
76
- gpuAcceleration: false
77
- }
78
- }, (0, import_utils.extend)({}, import_popperjs.offsetModifier, {
79
- options: {
80
- offset: props.offset
81
- }
82
- })]
83
- });
85
+ return (0, import_popperjs.createPopper)(wrapperRef.value, popoverRef.value.popupRef.value, getPopoverOptions());
84
86
  }
85
87
  return null;
86
88
  };
@@ -92,9 +94,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
92
94
  if (!popper) {
93
95
  popper = createPopperInstance();
94
96
  } else {
95
- popper.setOptions({
96
- placement: props.placement
97
- });
97
+ popper.setOptions(getPopoverOptions());
98
98
  }
99
99
  });
100
100
  };
@@ -104,10 +104,6 @@ var stdin_default = (0, import_vue2.defineComponent)({
104
104
  updateShow(!props.show);
105
105
  }
106
106
  };
107
- const onTouchstart = (event) => {
108
- event.stopPropagation();
109
- emit("touchstart", event);
110
- };
111
107
  const onClickAction = (action, index) => {
112
108
  if (action.disabled) {
113
109
  return;
@@ -118,7 +114,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
118
114
  }
119
115
  };
120
116
  const onClickAway = () => {
121
- if (props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
117
+ if (props.show && props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
122
118
  updateShow(false);
123
119
  }
124
120
  };
@@ -158,15 +154,21 @@ var stdin_default = (0, import_vue2.defineComponent)({
158
154
  "onClick": () => onClickAction(action, index)
159
155
  }, [renderActionContent(action, index)]);
160
156
  };
161
- (0, import_vue2.onMounted)(updateLocation);
157
+ (0, import_vue2.onMounted)(() => {
158
+ updateLocation();
159
+ (0, import_vue2.watchEffect)(() => {
160
+ var _a;
161
+ popupRef.value = (_a = popoverRef.value) == null ? void 0 : _a.popupRef.value;
162
+ });
163
+ });
162
164
  (0, import_vue2.onBeforeUnmount)(() => {
163
165
  if (popper) {
164
166
  popper.destroy();
165
167
  popper = null;
166
168
  }
167
169
  });
168
- (0, import_vue2.watch)(() => [props.show, props.placement], updateLocation);
169
- (0, import_use.useClickAway)(wrapperRef, onClickAway, {
170
+ (0, import_vue2.watch)(() => [props.show, props.offset, props.placement], updateLocation);
171
+ (0, import_use.useClickAway)([wrapperRef, popupRef], onClickAway, {
170
172
  eventName: "touchstart"
171
173
  });
172
174
  return () => {
@@ -181,7 +183,6 @@ var stdin_default = (0, import_vue2.defineComponent)({
181
183
  "position": "",
182
184
  "transition": "van-popover-zoom",
183
185
  "lockScroll": false,
184
- "onTouchstart": onTouchstart,
185
186
  "onUpdate:show": updateShow
186
187
  }, attrs, (0, import_utils.pick)(props, popupProps)), {
187
188
  default: () => [props.showArrow && (0, import_vue.createVNode)("div", {
@@ -29,6 +29,7 @@ var import_use_expose = require("../composables/use-expose");
29
29
  var import_use_lock_scroll = require("../composables/use-lock-scroll");
30
30
  var import_use_lazy_render = require("../composables/use-lazy-render");
31
31
  var import_on_popup_reopen = require("../composables/on-popup-reopen");
32
+ var import_use_global_z_index = require("../composables/use-global-z-index");
32
33
  var import_icon = require("../icon");
33
34
  var import_overlay = require("../overlay");
34
35
  const popupProps = (0, import_utils.extend)({}, import_shared.popupSharedProps, {
@@ -44,7 +45,6 @@ const popupProps = (0, import_utils.extend)({}, import_shared.popupSharedProps,
44
45
  safeAreaInsetBottom: Boolean
45
46
  });
46
47
  const [name, bem] = (0, import_utils.createNamespace)("popup");
47
- let globalZIndex = 2e3;
48
48
  var stdin_default = (0, import_vue2.defineComponent)({
49
49
  name,
50
50
  inheritAttrs: false,
@@ -72,11 +72,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
72
72
  });
73
73
  const open = () => {
74
74
  if (!opened) {
75
- if (props.zIndex !== void 0) {
76
- globalZIndex = +props.zIndex;
77
- }
78
75
  opened = true;
79
- zIndex.value = ++globalZIndex;
76
+ zIndex.value = props.zIndex !== void 0 ? +props.zIndex : (0, import_use_global_z_index.useGlobalZIndex)();
80
77
  emit("open");
81
78
  }
82
79
  };
@@ -105,6 +102,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
105
102
  "zIndex": zIndex.value,
106
103
  "duration": props.duration,
107
104
  "customStyle": props.overlayStyle,
105
+ "role": props.closeOnClickOverlay ? "button" : void 0,
106
+ "tabindex": props.closeOnClickOverlay ? 0 : void 0,
108
107
  "onClick": onClickOverlay
109
108
  }, {
110
109
  default: slots["overlay-content"]
@@ -141,6 +140,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
141
140
  return (0, import_vue.withDirectives)((0, import_vue.createVNode)("div", (0, import_vue.mergeProps)({
142
141
  "ref": popupRef,
143
142
  "style": style.value,
143
+ "role": "dialog",
144
+ "tabindex": 0,
144
145
  "class": [bem({
145
146
  round,
146
147
  [position]: position
@@ -1 +1 @@
1
- body{--van-popup-background: var(--van-background-2);--van-popup-transition: transform var(--van-duration-base);--van-popup-round-radius: 16px;--van-popup-close-icon-size: 22px;--van-popup-close-icon-color: var(--van-gray-5);--van-popup-close-icon-margin: 16px;--van-popup-close-icon-z-index: 1}.van-overflow-hidden{overflow:hidden!important}.van-popup{position:fixed;max-height:100%;overflow-y:auto;background:var(--van-popup-background);transition:var(--van-popup-transition);-webkit-overflow-scrolling:touch}.van-popup--center{top:50%;left:50%;transform:translate3d(-50%,-50%,0)}.van-popup--center.van-popup--round{border-radius:var(--van-popup-round-radius)}.van-popup--top{top:0;left:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--van-popup-round-radius) var(--van-popup-round-radius)}.van-popup--right{top:50%;right:0;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--van-popup-round-radius) 0 0 var(--van-popup-round-radius)}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--van-popup-round-radius) var(--van-popup-round-radius) 0 0}.van-popup--left{top:50%;left:0;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--van-popup-round-radius) var(--van-popup-round-radius) 0}.van-popup-slide-top-enter-active,.van-popup-slide-left-enter-active,.van-popup-slide-right-enter-active,.van-popup-slide-bottom-enter-active{transition-timing-function:var(--van-ease-out)}.van-popup-slide-top-leave-active,.van-popup-slide-left-leave-active,.van-popup-slide-right-leave-active,.van-popup-slide-bottom-leave-active{transition-timing-function:var(--van-ease-in)}.van-popup-slide-top-enter-from,.van-popup-slide-top-leave-active{transform:translate3d(0,-100%,0)}.van-popup-slide-right-enter-from,.van-popup-slide-right-leave-active{transform:translate3d(100%,-50%,0)}.van-popup-slide-bottom-enter-from,.van-popup-slide-bottom-leave-active{transform:translate3d(0,100%,0)}.van-popup-slide-left-enter-from,.van-popup-slide-left-leave-active{transform:translate3d(-100%,-50%,0)}.van-popup__close-icon{position:absolute;z-index:var(--van-popup-close-icon-z-index);color:var(--van-popup-close-icon-color);font-size:var(--van-popup-close-icon-size)}.van-popup__close-icon--top-left{top:var(--van-popup-close-icon-margin);left:var(--van-popup-close-icon-margin)}.van-popup__close-icon--top-right{top:var(--van-popup-close-icon-margin);right:var(--van-popup-close-icon-margin)}.van-popup__close-icon--bottom-left{bottom:var(--van-popup-close-icon-margin);left:var(--van-popup-close-icon-margin)}.van-popup__close-icon--bottom-right{right:var(--van-popup-close-icon-margin);bottom:var(--van-popup-close-icon-margin)}
1
+ body{--van-popup-background: var(--van-background-2);--van-popup-transition: transform var(--van-duration-base);--van-popup-round-radius: 16px;--van-popup-close-icon-size: 22px;--van-popup-close-icon-color: var(--van-gray-5);--van-popup-close-icon-margin: 16px;--van-popup-close-icon-z-index: 1}.van-overflow-hidden{overflow:hidden!important}.van-popup{position:fixed;max-height:100%;overflow-y:auto;box-sizing:border-box;background:var(--van-popup-background);transition:var(--van-popup-transition);-webkit-overflow-scrolling:touch}.van-popup--center{top:50%;left:0;right:0;width:-webkit-fit-content;width:fit-content;max-width:calc(100vw - var(--van-padding-md) * 2);margin:0 auto;transform:translateY(-50%)}.van-popup--center.van-popup--round{border-radius:var(--van-popup-round-radius)}.van-popup--top{top:0;left:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--van-popup-round-radius) var(--van-popup-round-radius)}.van-popup--right{top:50%;right:0;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--van-popup-round-radius) 0 0 var(--van-popup-round-radius)}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--van-popup-round-radius) var(--van-popup-round-radius) 0 0}.van-popup--left{top:50%;left:0;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--van-popup-round-radius) var(--van-popup-round-radius) 0}.van-popup-slide-top-enter-active,.van-popup-slide-left-enter-active,.van-popup-slide-right-enter-active,.van-popup-slide-bottom-enter-active{transition-timing-function:var(--van-ease-out)}.van-popup-slide-top-leave-active,.van-popup-slide-left-leave-active,.van-popup-slide-right-leave-active,.van-popup-slide-bottom-leave-active{transition-timing-function:var(--van-ease-in)}.van-popup-slide-top-enter-from,.van-popup-slide-top-leave-active{transform:translate3d(0,-100%,0)}.van-popup-slide-right-enter-from,.van-popup-slide-right-leave-active{transform:translate3d(100%,-50%,0)}.van-popup-slide-bottom-enter-from,.van-popup-slide-bottom-leave-active{transform:translate3d(0,100%,0)}.van-popup-slide-left-enter-from,.van-popup-slide-left-leave-active{transform:translate3d(-100%,-50%,0)}.van-popup__close-icon{position:absolute;z-index:var(--van-popup-close-icon-z-index);color:var(--van-popup-close-icon-color);font-size:var(--van-popup-close-icon-size)}.van-popup__close-icon--top-left{top:var(--van-popup-close-icon-margin);left:var(--van-popup-close-icon-margin)}.van-popup__close-icon--top-right{top:var(--van-popup-close-icon-margin);right:var(--van-popup-close-icon-margin)}.van-popup__close-icon--bottom-left{bottom:var(--van-popup-close-icon-margin);left:var(--van-popup-close-icon-margin)}.van-popup__close-icon--bottom-right{right:var(--van-popup-close-icon-margin);bottom:var(--van-popup-close-icon-margin)}
@@ -51,6 +51,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
51
51
  }) {
52
52
  let reachTop;
53
53
  const root = (0, import_vue2.ref)();
54
+ const track = (0, import_vue2.ref)();
54
55
  const scrollParent = (0, import_use.useScrollParent)(root);
55
56
  const state = (0, import_vue2.reactive)({
56
57
  status: "normal",
@@ -183,6 +184,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
183
184
  setStatus(0, false);
184
185
  }
185
186
  });
187
+ (0, import_use.useEventListener)("touchmove", onTouchMove, {
188
+ target: track
189
+ });
186
190
  return () => {
187
191
  var _a;
188
192
  const trackStyle = {
@@ -193,10 +197,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
193
197
  "ref": root,
194
198
  "class": bem()
195
199
  }, [(0, import_vue.createVNode)("div", {
200
+ "ref": track,
196
201
  "class": bem("track"),
197
202
  "style": trackStyle,
198
- "onTouchstart": onTouchStart,
199
- "onTouchmove": onTouchMove,
203
+ "onTouchstartPassive": onTouchStart,
200
204
  "onTouchend": onTouchEnd,
201
205
  "onTouchcancel": onTouchEnd
202
206
  }, [(0, import_vue.createVNode)("div", {
package/lib/rate/Rate.js CHANGED
@@ -229,7 +229,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
229
229
  "tabindex": props.disabled ? void 0 : 0,
230
230
  "aria-disabled": props.disabled,
231
231
  "aria-readonly": props.readonly,
232
- "onTouchstart": onTouchStart,
232
+ "onTouchstartPassive": onTouchStart,
233
233
  "onTouchmove": onTouchMove
234
234
  }, [list.value.map(renderStar)]);
235
235
  }
@@ -1 +1 @@
1
- body{--van-search-padding: 10px var(--van-padding-sm);--van-search-background: var(--van-background-2);--van-search-content-background: var(--van-background);--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)}.van-search__content{display:flex;flex:1;padding-left:var(--van-padding-sm);background:var(--van-search-content-background);border-radius:var(--van-radius-sm)}.van-search__content--round{border-radius:var(--van-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
+ body{--van-search-padding: 10px var(--van-padding-sm);--van-search-background: var(--van-background-2);--van-search-content-background: var(--van-background);--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)}.van-search__content{display:flex;flex:1;padding-left:var(--van-padding-sm);background:var(--van-search-content-background);border-radius:var(--van-radius-sm)}.van-search__content--round{border-radius:var(--van-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)}
@@ -256,7 +256,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
256
256
  "aria-disabled": props.disabled || void 0,
257
257
  "aria-readonly": props.readonly || void 0,
258
258
  "aria-orientation": props.vertical ? "vertical" : "horizontal",
259
- "onTouchstart": (event) => {
259
+ "onTouchstartPassive": (event) => {
260
260
  if (typeof index === "number") {
261
261
  buttonIndex = index;
262
262
  }
@@ -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,106 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name2 in all)
7
+ __defProp(target, name2, { get: all[name2], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var stdin_exports = {};
19
+ __export(stdin_exports, {
20
+ default: () => stdin_default
21
+ });
22
+ module.exports = __toCommonJS(stdin_exports);
23
+ var import_vue = require("vue");
24
+ var import_vue2 = require("vue");
25
+ var import_utils = require("../utils");
26
+ const [name, bem] = (0, import_utils.createNamespace)("space");
27
+ const spaceProps = {
28
+ align: String,
29
+ direction: {
30
+ type: String,
31
+ default: "horizontal"
32
+ },
33
+ size: {
34
+ type: [Number, String, Array],
35
+ default: 8
36
+ },
37
+ wrap: Boolean,
38
+ fill: Boolean
39
+ };
40
+ function filterEmpty(children = []) {
41
+ const nodes = [];
42
+ children.forEach((child) => {
43
+ if (Array.isArray(child)) {
44
+ nodes.push(...child);
45
+ } else if (child.type === import_vue2.Fragment) {
46
+ nodes.push(...filterEmpty(child.children));
47
+ } else {
48
+ nodes.push(child);
49
+ }
50
+ });
51
+ return nodes.filter((c) => {
52
+ var _a;
53
+ return !(c && (typeof Comment !== "undefined" && c.type === Comment || c.type === import_vue2.Fragment && ((_a = c.children) == null ? void 0 : _a.length) === 0 || c.type === Text && c.children.trim() === ""));
54
+ });
55
+ }
56
+ var stdin_default = (0, import_vue2.defineComponent)({
57
+ name,
58
+ props: spaceProps,
59
+ setup(props, {
60
+ slots
61
+ }) {
62
+ const mergedAlign = (0, import_vue2.computed)(() => {
63
+ var _a;
64
+ return (_a = props.align) != null ? _a : props.direction === "horizontal" ? "center" : "";
65
+ });
66
+ const getMargin = (size) => {
67
+ if (typeof size === "number") {
68
+ return size + "px";
69
+ }
70
+ return size;
71
+ };
72
+ const getMarginStyle = (isLast) => {
73
+ const style = {};
74
+ const marginRight = `${getMargin(Array.isArray(props.size) ? props.size[0] : props.size)}`;
75
+ const marginBottom = `${getMargin(Array.isArray(props.size) ? props.size[1] : props.size)}`;
76
+ if (isLast) {
77
+ return props.wrap ? {
78
+ marginBottom
79
+ } : {};
80
+ }
81
+ if (props.direction === "horizontal") {
82
+ style.marginRight = marginRight;
83
+ }
84
+ if (props.direction === "vertical" || props.wrap) {
85
+ style.marginBottom = marginBottom;
86
+ }
87
+ return style;
88
+ };
89
+ return () => {
90
+ var _a;
91
+ const children = filterEmpty((_a = slots.default) == null ? void 0 : _a.call(slots));
92
+ return (0, import_vue.createVNode)("div", {
93
+ "class": [bem({
94
+ [props.direction]: props.direction,
95
+ [`align-${mergedAlign.value}`]: mergedAlign.value,
96
+ wrap: props.wrap,
97
+ fill: props.fill
98
+ })]
99
+ }, [children.map((c, i) => (0, import_vue.createVNode)("div", {
100
+ "key": `item-${i}`,
101
+ "class": `${name}-item`,
102
+ "style": getMarginStyle(i === children.length - 1)
103
+ }, [c]))]);
104
+ };
105
+ }
106
+ });
@@ -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
+ }