vant 4.9.0 → 4.9.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 (80) hide show
  1. package/README.md +5 -4
  2. package/es/action-bar-button/ActionBarButton.d.ts +3 -3
  3. package/es/action-bar-button/index.d.ts +2 -2
  4. package/es/action-bar-icon/ActionBarIcon.d.ts +3 -3
  5. package/es/action-bar-icon/index.d.ts +2 -2
  6. package/es/address-list/AddressList.d.ts +13 -13
  7. package/es/address-list/AddressList.mjs +20 -4
  8. package/es/address-list/AddressListItem.d.ts +3 -0
  9. package/es/address-list/AddressListItem.mjs +19 -7
  10. package/es/address-list/index.d.ts +2 -2
  11. package/es/address-list/style/index.mjs +1 -0
  12. package/es/area/utils.mjs +3 -3
  13. package/es/button/Button.d.ts +3 -3
  14. package/es/button/index.d.ts +2 -2
  15. package/es/card/Card.mjs +3 -3
  16. package/es/cell/Cell.d.ts +3 -3
  17. package/es/cell/index.d.ts +2 -2
  18. package/es/composables/use-route.d.ts +1 -2
  19. package/es/floating-panel/FloatingPanel.mjs +11 -5
  20. package/es/form/Form.d.ts +3 -0
  21. package/es/form/Form.mjs +9 -2
  22. package/es/form/index.d.ts +2 -0
  23. package/es/grid-item/GridItem.d.ts +3 -3
  24. package/es/grid-item/index.d.ts +2 -2
  25. package/es/index.d.ts +1 -1
  26. package/es/index.mjs +1 -1
  27. package/es/notify/types.d.ts +3 -0
  28. package/es/sidebar-item/SidebarItem.d.ts +3 -3
  29. package/es/sidebar-item/index.d.ts +2 -2
  30. package/es/stepper/Stepper.mjs +1 -0
  31. package/es/tab/Tab.d.ts +3 -3
  32. package/es/tab/index.d.ts +2 -2
  33. package/es/tabbar-item/TabbarItem.d.ts +3 -3
  34. package/es/tabbar-item/index.d.ts +2 -2
  35. package/es/tabs/index.css +1 -1
  36. package/es/tabs/utils.mjs +3 -1
  37. package/es/uploader/index.d.ts +1 -1
  38. package/lib/action-bar-button/ActionBarButton.d.ts +3 -3
  39. package/lib/action-bar-button/index.d.ts +2 -2
  40. package/lib/action-bar-icon/ActionBarIcon.d.ts +3 -3
  41. package/lib/action-bar-icon/index.d.ts +2 -2
  42. package/lib/address-list/AddressList.d.ts +13 -13
  43. package/lib/address-list/AddressList.js +19 -3
  44. package/lib/address-list/AddressListItem.d.ts +3 -0
  45. package/lib/address-list/AddressListItem.js +19 -7
  46. package/lib/address-list/index.d.ts +2 -2
  47. package/lib/address-list/style/index.js +1 -0
  48. package/lib/area/utils.js +3 -3
  49. package/lib/button/Button.d.ts +3 -3
  50. package/lib/button/index.d.ts +2 -2
  51. package/lib/card/Card.js +2 -2
  52. package/lib/cell/Cell.d.ts +3 -3
  53. package/lib/cell/index.d.ts +2 -2
  54. package/lib/composables/use-route.d.ts +1 -2
  55. package/lib/floating-panel/FloatingPanel.js +11 -5
  56. package/lib/form/Form.d.ts +3 -0
  57. package/lib/form/Form.js +9 -2
  58. package/lib/form/index.d.ts +2 -0
  59. package/lib/grid-item/GridItem.d.ts +3 -3
  60. package/lib/grid-item/index.d.ts +2 -2
  61. package/lib/index.css +1 -1
  62. package/lib/index.d.ts +1 -1
  63. package/lib/index.js +1 -1
  64. package/lib/notify/types.d.ts +3 -0
  65. package/lib/sidebar-item/SidebarItem.d.ts +3 -3
  66. package/lib/sidebar-item/index.d.ts +2 -2
  67. package/lib/stepper/Stepper.js +1 -0
  68. package/lib/tab/Tab.d.ts +3 -3
  69. package/lib/tab/index.d.ts +2 -2
  70. package/lib/tabbar-item/TabbarItem.d.ts +3 -3
  71. package/lib/tabbar-item/index.d.ts +2 -2
  72. package/lib/tabs/index.css +1 -1
  73. package/lib/tabs/utils.js +3 -1
  74. package/lib/uploader/index.d.ts +1 -1
  75. package/lib/vant.cjs.js +342 -300
  76. package/lib/vant.es.js +342 -300
  77. package/lib/vant.js +344 -302
  78. package/lib/vant.min.js +3 -3
  79. package/lib/web-types.json +1 -1
  80. package/package.json +15 -15
@@ -1,5 +1,5 @@
1
1
  export declare const Button: import("../utils").WithInstall<import("vue").DefineComponent<{
2
- to: import("vue").PropType<import("vue-router").RouteLocationRaw>;
2
+ to: import("vue").PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
3
3
  url: StringConstructor;
4
4
  replace: BooleanConstructor;
5
5
  } & {
@@ -38,7 +38,7 @@ export declare const Button: import("../utils").WithInstall<import("vue").Define
38
38
  default: import("./types").ButtonIconPosition;
39
39
  };
40
40
  }, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
41
- to: import("vue").PropType<import("vue-router").RouteLocationRaw>;
41
+ to: import("vue").PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
42
42
  url: StringConstructor;
43
43
  replace: BooleanConstructor;
44
44
  } & {
package/lib/card/Card.js CHANGED
@@ -107,9 +107,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
107
107
  "class": bem("price-currency")
108
108
  }, [props.currency]), (0, import_vue.createVNode)("span", {
109
109
  "class": bem("price-integer")
110
- }, [priceArr[0]]), (0, import_vue.createTextVNode)("."), (0, import_vue.createVNode)("span", {
110
+ }, [priceArr[0]]), priceArr.length > 1 && (0, import_vue.createVNode)(import_vue.Fragment, null, [(0, import_vue.createTextVNode)("."), (0, import_vue.createVNode)("span", {
111
111
  "class": bem("price-decimal")
112
- }, [priceArr[1]])]);
112
+ }, [priceArr[1]])])]);
113
113
  };
114
114
  return () => {
115
115
  var _a, _b, _c;
@@ -63,7 +63,7 @@ export declare const cellProps: {
63
63
  default: null;
64
64
  };
65
65
  } & {
66
- to: PropType<import("vue-router").RouteLocationRaw>;
66
+ to: PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
67
67
  url: StringConstructor;
68
68
  replace: BooleanConstructor;
69
69
  };
@@ -99,7 +99,7 @@ declare const _default: import("vue").DefineComponent<{
99
99
  default: null;
100
100
  };
101
101
  } & {
102
- to: PropType<import("vue-router").RouteLocationRaw>;
102
+ to: PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
103
103
  url: StringConstructor;
104
104
  replace: BooleanConstructor;
105
105
  }, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
@@ -133,7 +133,7 @@ declare const _default: import("vue").DefineComponent<{
133
133
  default: null;
134
134
  };
135
135
  } & {
136
- to: PropType<import("vue-router").RouteLocationRaw>;
136
+ to: PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
137
137
  url: StringConstructor;
138
138
  replace: BooleanConstructor;
139
139
  }>>, {
@@ -29,7 +29,7 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
29
29
  default: null;
30
30
  };
31
31
  } & {
32
- to: import("vue").PropType<import("vue-router").RouteLocationRaw>;
32
+ to: import("vue").PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
33
33
  url: StringConstructor;
34
34
  replace: BooleanConstructor;
35
35
  }, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -63,7 +63,7 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
63
63
  default: null;
64
64
  };
65
65
  } & {
66
- to: import("vue").PropType<import("vue-router").RouteLocationRaw>;
66
+ to: import("vue").PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
67
67
  url: StringConstructor;
68
68
  replace: BooleanConstructor;
69
69
  }>>, {
@@ -2,9 +2,8 @@
2
2
  * Vue Router support
3
3
  */
4
4
  import { type PropType, type ExtractPropTypes, type ComponentPublicInstance } from 'vue';
5
- import type { RouteLocationRaw } from 'vue-router';
6
5
  export declare const routeProps: {
7
- to: PropType<RouteLocationRaw>;
6
+ to: PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
8
7
  url: StringConstructor;
9
8
  replace: BooleanConstructor;
10
9
  };
@@ -125,6 +125,16 @@ var stdin_default = (0, import_vue2.defineComponent)({
125
125
  (0, import_use.useEventListener)("touchmove", onTouchmove, {
126
126
  target: rootRef
127
127
  });
128
+ const renderHeader = () => {
129
+ if (slots.header) {
130
+ return slots.header();
131
+ }
132
+ return (0, import_vue.createVNode)("div", {
133
+ "class": bem("header")
134
+ }, [(0, import_vue.createVNode)("div", {
135
+ "class": bem("header-bar")
136
+ }, null)]);
137
+ };
128
138
  return () => {
129
139
  var _a;
130
140
  return (0, import_vue.createVNode)("div", {
@@ -136,11 +146,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
136
146
  "onTouchstartPassive": onTouchstart,
137
147
  "onTouchend": onTouchend,
138
148
  "onTouchcancel": onTouchend
139
- }, [(0, import_vue.createVNode)("div", {
140
- "class": bem("header")
141
- }, [(0, import_vue.createVNode)("div", {
142
- "class": bem("header-bar")
143
- }, null)]), (0, import_vue.createVNode)("div", {
149
+ }, [renderHeader(), (0, import_vue.createVNode)("div", {
144
150
  "class": bem("content"),
145
151
  "ref": contentRef
146
152
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]);
@@ -10,6 +10,7 @@ export declare const formProps: {
10
10
  labelAlign: PropType<FieldTextAlign>;
11
11
  inputAlign: PropType<FieldTextAlign>;
12
12
  scrollToError: BooleanConstructor;
13
+ scrollToErrorPosition: PropType<ScrollLogicalPosition>;
13
14
  validateFirst: BooleanConstructor;
14
15
  submitOnEnter: {
15
16
  type: BooleanConstructor;
@@ -36,6 +37,7 @@ declare const _default: import("vue").DefineComponent<{
36
37
  labelAlign: PropType<FieldTextAlign>;
37
38
  inputAlign: PropType<FieldTextAlign>;
38
39
  scrollToError: BooleanConstructor;
40
+ scrollToErrorPosition: PropType<ScrollLogicalPosition>;
39
41
  validateFirst: BooleanConstructor;
40
42
  submitOnEnter: {
41
43
  type: BooleanConstructor;
@@ -60,6 +62,7 @@ declare const _default: import("vue").DefineComponent<{
60
62
  labelAlign: PropType<FieldTextAlign>;
61
63
  inputAlign: PropType<FieldTextAlign>;
62
64
  scrollToError: BooleanConstructor;
65
+ scrollToErrorPosition: PropType<ScrollLogicalPosition>;
63
66
  validateFirst: BooleanConstructor;
64
67
  submitOnEnter: {
65
68
  type: BooleanConstructor;
package/lib/form/Form.js CHANGED
@@ -37,6 +37,7 @@ const formProps = {
37
37
  labelAlign: String,
38
38
  inputAlign: String,
39
39
  scrollToError: Boolean,
40
+ scrollToErrorPosition: String,
40
41
  validateFirst: Boolean,
41
42
  submitOnEnter: import_utils.truthProp,
42
43
  showErrorMessage: import_utils.truthProp,
@@ -150,8 +151,14 @@ var stdin_default = (0, import_vue2.defineComponent)({
150
151
  values,
151
152
  errors
152
153
  });
153
- if (props.scrollToError && errors[0].name) {
154
- scrollToField(errors[0].name);
154
+ const {
155
+ scrollToError,
156
+ scrollToErrorPosition
157
+ } = props;
158
+ if (scrollToError && errors[0].name) {
159
+ scrollToField(errors[0].name, scrollToErrorPosition ? {
160
+ block: scrollToErrorPosition
161
+ } : void 0);
155
162
  }
156
163
  });
157
164
  };
@@ -9,6 +9,7 @@ export declare const Form: import("../utils").WithInstall<import("vue").DefineCo
9
9
  labelAlign: import("vue").PropType<import("..").FieldTextAlign>;
10
10
  inputAlign: import("vue").PropType<import("..").FieldTextAlign>;
11
11
  scrollToError: BooleanConstructor;
12
+ scrollToErrorPosition: import("vue").PropType<ScrollLogicalPosition>;
12
13
  validateFirst: BooleanConstructor;
13
14
  submitOnEnter: {
14
15
  type: BooleanConstructor;
@@ -33,6 +34,7 @@ export declare const Form: import("../utils").WithInstall<import("vue").DefineCo
33
34
  labelAlign: import("vue").PropType<import("..").FieldTextAlign>;
34
35
  inputAlign: import("vue").PropType<import("..").FieldTextAlign>;
35
36
  scrollToError: BooleanConstructor;
37
+ scrollToErrorPosition: import("vue").PropType<ScrollLogicalPosition>;
36
38
  validateFirst: BooleanConstructor;
37
39
  submitOnEnter: {
38
40
  type: BooleanConstructor;
@@ -1,7 +1,7 @@
1
1
  import { type PropType, type ExtractPropTypes } from 'vue';
2
2
  import { type BadgeProps } from '../badge';
3
3
  export declare const gridItemProps: {
4
- to: PropType<import("vue-router").RouteLocationRaw>;
4
+ to: PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
5
5
  url: StringConstructor;
6
6
  replace: BooleanConstructor;
7
7
  } & {
@@ -15,7 +15,7 @@ export declare const gridItemProps: {
15
15
  };
16
16
  export type GridItemProps = ExtractPropTypes<typeof gridItemProps>;
17
17
  declare const _default: import("vue").DefineComponent<{
18
- to: PropType<import("vue-router").RouteLocationRaw>;
18
+ to: PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
19
19
  url: StringConstructor;
20
20
  replace: BooleanConstructor;
21
21
  } & {
@@ -27,7 +27,7 @@ declare const _default: import("vue").DefineComponent<{
27
27
  iconPrefix: StringConstructor;
28
28
  badgeProps: PropType<Partial<BadgeProps>>;
29
29
  }, (() => import("vue/jsx-runtime").JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
30
- to: PropType<import("vue-router").RouteLocationRaw>;
30
+ to: PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
31
31
  url: StringConstructor;
32
32
  replace: BooleanConstructor;
33
33
  } & {
@@ -1,5 +1,5 @@
1
1
  export declare const GridItem: import("../utils").WithInstall<import("vue").DefineComponent<{
2
- to: import("vue").PropType<import("vue-router").RouteLocationRaw>;
2
+ to: import("vue").PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
3
3
  url: StringConstructor;
4
4
  replace: BooleanConstructor;
5
5
  } & {
@@ -11,7 +11,7 @@ export declare const GridItem: import("../utils").WithInstall<import("vue").Defi
11
11
  iconPrefix: StringConstructor;
12
12
  badgeProps: import("vue").PropType<Partial<import("..").BadgeProps>>;
13
13
  }, (() => import("vue/jsx-runtime").JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
14
- to: import("vue").PropType<import("vue-router").RouteLocationRaw>;
14
+ to: import("vue").PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
15
15
  url: StringConstructor;
16
16
  replace: BooleanConstructor;
17
17
  } & {