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
package/lib/index.d.ts CHANGED
@@ -106,4 +106,4 @@ declare namespace _default {
106
106
  }
107
107
  export default _default;
108
108
  export function install(app: any): void;
109
- export const version: "4.9.0";
109
+ export const version: "4.9.2";
package/lib/index.js CHANGED
@@ -226,7 +226,7 @@ __reExport(stdin_exports, require("./toast"), module.exports);
226
226
  __reExport(stdin_exports, require("./tree-select"), module.exports);
227
227
  __reExport(stdin_exports, require("./uploader"), module.exports);
228
228
  __reExport(stdin_exports, require("./watermark"), module.exports);
229
- const version = "4.9.0";
229
+ const version = "4.9.2";
230
230
  function install(app) {
231
231
  const components = [
232
232
  import_action_bar.ActionBar,
@@ -1,3 +1,4 @@
1
+ import type { TeleportProps } from 'vue';
1
2
  import type { Numeric } from '../utils';
2
3
  export type NotifyMessage = Numeric;
3
4
  export type NotifyType = 'primary' | 'success' | 'danger' | 'warning';
@@ -7,10 +8,12 @@ export type NotifyOptions = {
7
8
  color?: string;
8
9
  message?: NotifyMessage;
9
10
  duration?: number;
11
+ zIndex?: number;
10
12
  position?: NotifyPosition;
11
13
  className?: unknown;
12
14
  background?: string;
13
15
  lockScroll?: boolean;
16
+ teleport?: TeleportProps['to'];
14
17
  onClick?: (event: MouseEvent) => void;
15
18
  onClose?: () => void;
16
19
  onOpened?: () => void;
@@ -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 sidebarItemProps: {
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
  } & {
@@ -13,7 +13,7 @@ export declare const sidebarItemProps: {
13
13
  };
14
14
  export type SidebarItemProps = ExtractPropTypes<typeof sidebarItemProps>;
15
15
  declare const _default: import("vue").DefineComponent<{
16
- to: PropType<import("vue-router").RouteLocationRaw>;
16
+ to: PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
17
17
  url: StringConstructor;
18
18
  replace: BooleanConstructor;
19
19
  } & {
@@ -23,7 +23,7 @@ declare const _default: import("vue").DefineComponent<{
23
23
  disabled: BooleanConstructor;
24
24
  badgeProps: PropType<Partial<BadgeProps>>;
25
25
  }, (() => import("vue/jsx-runtime").JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").PublicProps, Readonly<ExtractPropTypes<{
26
- to: PropType<import("vue-router").RouteLocationRaw>;
26
+ to: PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
27
27
  url: StringConstructor;
28
28
  replace: BooleanConstructor;
29
29
  } & {
@@ -1,5 +1,5 @@
1
1
  export declare const SidebarItem: 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
  } & {
@@ -9,7 +9,7 @@ export declare const SidebarItem: import("../utils").WithInstall<import("vue").D
9
9
  disabled: BooleanConstructor;
10
10
  badgeProps: import("vue").PropType<Partial<import("..").BadgeProps>>;
11
11
  }, (() => import("vue/jsx-runtime").JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
12
- to: import("vue").PropType<import("vue-router").RouteLocationRaw>;
12
+ to: import("vue").PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
13
13
  url: StringConstructor;
14
14
  replace: BooleanConstructor;
15
15
  } & {
@@ -246,6 +246,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
246
246
  "readonly": props.disableInput,
247
247
  "inputmode": props.integer ? "numeric" : "decimal",
248
248
  "placeholder": props.placeholder,
249
+ "autocomplete": "off",
249
250
  "aria-valuemax": props.max,
250
251
  "aria-valuemin": props.min,
251
252
  "aria-valuenow": current.value,
package/lib/tab/Tab.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type PropType, type CSSProperties, type ExtractPropTypes } from 'vue';
2
2
  export declare const tabProps: {
3
- to: PropType<import("vue-router").RouteLocationRaw>;
3
+ to: PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
4
4
  url: StringConstructor;
5
5
  replace: BooleanConstructor;
6
6
  } & {
@@ -18,7 +18,7 @@ export declare const tabProps: {
18
18
  };
19
19
  export type TabProps = ExtractPropTypes<typeof tabProps>;
20
20
  declare const _default: import("vue").DefineComponent<{
21
- to: PropType<import("vue-router").RouteLocationRaw>;
21
+ to: PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
22
22
  url: StringConstructor;
23
23
  replace: BooleanConstructor;
24
24
  } & {
@@ -34,7 +34,7 @@ declare const _default: import("vue").DefineComponent<{
34
34
  default: true;
35
35
  };
36
36
  }, (() => import("vue/jsx-runtime").JSX.Element | undefined) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
37
- to: PropType<import("vue-router").RouteLocationRaw>;
37
+ to: PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
38
38
  url: StringConstructor;
39
39
  replace: BooleanConstructor;
40
40
  } & {
@@ -1,5 +1,5 @@
1
1
  export declare const Tab: 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
  } & {
@@ -15,7 +15,7 @@ export declare const Tab: import("../utils").WithInstall<import("vue").DefineCom
15
15
  default: true;
16
16
  };
17
17
  }, (() => import("vue/jsx-runtime").JSX.Element | undefined) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
- to: import("vue").PropType<import("vue-router").RouteLocationRaw>;
18
+ to: import("vue").PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
19
19
  url: StringConstructor;
20
20
  replace: BooleanConstructor;
21
21
  } & {
@@ -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 tabbarItemProps: {
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
  } & {
@@ -14,7 +14,7 @@ export declare const tabbarItemProps: {
14
14
  };
15
15
  export type TabbarItemProps = ExtractPropTypes<typeof tabbarItemProps>;
16
16
  declare const _default: import("vue").DefineComponent<{
17
- to: PropType<import("vue-router").RouteLocationRaw>;
17
+ to: PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
18
18
  url: StringConstructor;
19
19
  replace: BooleanConstructor;
20
20
  } & {
@@ -25,7 +25,7 @@ declare const _default: import("vue").DefineComponent<{
25
25
  badgeProps: PropType<Partial<BadgeProps>>;
26
26
  iconPrefix: StringConstructor;
27
27
  }, (() => import("vue/jsx-runtime").JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").PublicProps, Readonly<ExtractPropTypes<{
28
- to: PropType<import("vue-router").RouteLocationRaw>;
28
+ to: PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
29
29
  url: StringConstructor;
30
30
  replace: BooleanConstructor;
31
31
  } & {
@@ -1,5 +1,5 @@
1
1
  export declare const TabbarItem: 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
  } & {
@@ -10,7 +10,7 @@ export declare const TabbarItem: import("../utils").WithInstall<import("vue").De
10
10
  badgeProps: import("vue").PropType<Partial<import("..").BadgeProps>>;
11
11
  iconPrefix: StringConstructor;
12
12
  }, (() => import("vue/jsx-runtime").JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
- to: import("vue").PropType<import("vue-router").RouteLocationRaw>;
13
+ to: import("vue").PropType<string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric>;
14
14
  url: StringConstructor;
15
15
  replace: BooleanConstructor;
16
16
  } & {
@@ -1 +1 @@
1
- :root,:host{--van-tab-text-color: var(--van-gray-7);--van-tab-active-text-color: var(--van-text-color);--van-tab-disabled-text-color: var(--van-text-color-3);--van-tab-font-size: var(--van-font-size-md);--van-tab-line-height: var(--van-line-height-md);--van-tabs-default-color: var(--van-primary-color);--van-tabs-line-height: 44px;--van-tabs-card-height: 30px;--van-tabs-nav-background: var(--van-background-2);--van-tabs-bottom-bar-width: 40px;--van-tabs-bottom-bar-height: 3px;--van-tabs-bottom-bar-color: var(--van-primary-color)}.van-tab{position:relative;display:flex;flex:1;align-items:center;justify-content:center;box-sizing:border-box;padding:0 var(--van-padding-base);color:var(--van-tab-text-color);font-size:var(--van-tab-font-size);line-height:var(--van-tab-line-height);cursor:pointer}.van-tab--active{color:var(--van-tab-active-text-color);font-weight:var(--van-font-bold)}.van-tab--disabled{color:var(--van-tab-disabled-text-color);cursor:not-allowed}.van-tab--grow{flex:1 0 auto;padding:0 var(--van-padding-sm)}.van-tab--shrink{flex:none;padding:0 var(--van-padding-xs)}.van-tab--card{color:var(--van-tabs-default-color);border-right:var(--van-border-width) solid var(--van-tabs-default-color)}.van-tab--card:last-child{border-right:none}.van-tab--card.van-tab--active{color:var(--van-white);background-color:var(--van-tabs-default-color)}.van-tab--card--disabled{color:var(--van-tab-disabled-text-color)}.van-tab__text--ellipsis{display:-webkit-box;overflow:hidden;-webkit-line-clamp:1;-webkit-box-orient:vertical}.van-tabs{position:relative}.van-tabs__wrap{overflow:hidden}.van-tabs__wrap--page-top{position:fixed}.van-tabs__wrap--content-bottom{top:auto;bottom:0}.van-tabs__nav{position:relative;display:flex;background:var(--van-tabs-nav-background);-webkit-user-select:none;user-select:none}.van-tabs__nav--complete{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}.van-tabs__nav--complete::-webkit-scrollbar{display:none}.van-tabs__nav--line{box-sizing:content-box;height:100%;padding-bottom:15px}.van-tabs__nav--line.van-tabs__nav--shrink,.van-tabs__nav--line.van-tabs__nav--complete{padding-right:var(--van-padding-xs);padding-left:var(--van-padding-xs)}.van-tabs__nav--card{box-sizing:border-box;height:var(--van-tabs-card-height);margin:0 var(--van-padding-md);border:var(--van-border-width) solid var(--van-tabs-default-color);border-radius:var(--van-radius-sm)}.van-tabs__nav--card.van-tabs__nav--shrink{display:inline-flex}.van-tabs__line{position:absolute;bottom:15px;left:0;z-index:1;width:var(--van-tabs-bottom-bar-width);height:var(--van-tabs-bottom-bar-height);background:var(--van-tabs-bottom-bar-color);border-radius:var(--van-tabs-bottom-bar-height)}.van-tabs__track{position:relative;display:flex;width:100%;height:100%;will-change:left}.van-tabs__content--animated{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:var(--van-tabs-line-height)}.van-tabs--card>.van-tabs__wrap{height:var(--van-tabs-card-height)}
1
+ :root,:host{--van-tab-text-color: var(--van-gray-7);--van-tab-active-text-color: var(--van-text-color);--van-tab-disabled-text-color: var(--van-text-color-3);--van-tab-font-size: var(--van-font-size-md);--van-tab-line-height: var(--van-line-height-md);--van-tabs-default-color: var(--van-primary-color);--van-tabs-line-height: 44px;--van-tabs-card-height: 30px;--van-tabs-nav-background: var(--van-background-2);--van-tabs-bottom-bar-width: 40px;--van-tabs-bottom-bar-height: 3px;--van-tabs-bottom-bar-color: var(--van-primary-color)}.van-tab{position:relative;display:flex;flex:1;align-items:center;justify-content:center;box-sizing:border-box;padding:0 var(--van-padding-base);color:var(--van-tab-text-color);font-size:var(--van-tab-font-size);line-height:var(--van-tab-line-height);cursor:pointer}.van-tab--active{color:var(--van-tab-active-text-color);font-weight:var(--van-font-bold)}.van-tab--disabled{color:var(--van-tab-disabled-text-color);cursor:not-allowed}.van-tab--grow{flex:1 0 auto;padding:0 var(--van-padding-sm)}.van-tab--shrink{flex:none;padding:0 var(--van-padding-xs)}.van-tab--card{color:var(--van-tabs-default-color);border-right:var(--van-border-width) solid var(--van-tabs-default-color)}.van-tab--card:last-child{border-right:none}.van-tab--card.van-tab--active{color:var(--van-white);background-color:var(--van-tabs-default-color)}.van-tab--card.van-tab--disabled{color:var(--van-tab-disabled-text-color)}.van-tab__text--ellipsis{display:-webkit-box;overflow:hidden;-webkit-line-clamp:1;-webkit-box-orient:vertical}.van-tabs{position:relative}.van-tabs__wrap{overflow:hidden}.van-tabs__wrap--page-top{position:fixed}.van-tabs__wrap--content-bottom{top:auto;bottom:0}.van-tabs__nav{position:relative;display:flex;background:var(--van-tabs-nav-background);-webkit-user-select:none;user-select:none}.van-tabs__nav--complete{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}.van-tabs__nav--complete::-webkit-scrollbar{display:none}.van-tabs__nav--line{box-sizing:content-box;height:100%;padding-bottom:15px}.van-tabs__nav--line.van-tabs__nav--shrink,.van-tabs__nav--line.van-tabs__nav--complete{padding-right:var(--van-padding-xs);padding-left:var(--van-padding-xs)}.van-tabs__nav--card{box-sizing:border-box;height:var(--van-tabs-card-height);margin:0 var(--van-padding-md);border:var(--van-border-width) solid var(--van-tabs-default-color);border-radius:var(--van-radius-sm)}.van-tabs__nav--card.van-tabs__nav--shrink{display:inline-flex}.van-tabs__line{position:absolute;bottom:15px;left:0;z-index:1;width:var(--van-tabs-bottom-bar-width);height:var(--van-tabs-bottom-bar-height);background:var(--van-tabs-bottom-bar-color);border-radius:var(--van-tabs-bottom-bar-height)}.van-tabs__track{position:relative;display:flex;width:100%;height:100%;will-change:left}.van-tabs__content--animated{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:var(--van-tabs-line-height)}.van-tabs--card>.van-tabs__wrap{height:var(--van-tabs-card-height)}
package/lib/tabs/utils.js CHANGED
@@ -28,11 +28,13 @@ function scrollLeftTo(scroller, to, duration) {
28
28
  let count = 0;
29
29
  const from = scroller.scrollLeft;
30
30
  const frames = duration === 0 ? 1 : Math.round(duration * 1e3 / 16);
31
+ let scrollLeft = from;
31
32
  function cancel() {
32
33
  (0, import_use.cancelRaf)(rafId);
33
34
  }
34
35
  function animate() {
35
- scroller.scrollLeft += (to - from) / frames;
36
+ scrollLeft += (to - from) / frames;
37
+ scroller.scrollLeft = scrollLeft;
36
38
  if (++count < frames) {
37
39
  rafId = (0, import_use.raf)(animate);
38
40
  }
@@ -151,7 +151,7 @@ export declare const Uploader: import("../utils").WithInstall<import("vue").Defi
151
151
  export default Uploader;
152
152
  export { uploaderProps } from './Uploader';
153
153
  export type { UploaderProps };
154
- export type { UploaderInstance, UploaderThemeVars, UploaderResultType, UploaderFileListItem, } from './types';
154
+ export type { UploaderInstance, UploaderThemeVars, UploaderResultType, UploaderFileListItem, UploaderBeforeRead, UploaderAfterRead, } from './types';
155
155
  declare module 'vue' {
156
156
  interface GlobalComponents {
157
157
  VanUploader: typeof Uploader;