vant 4.9.3 → 4.9.5

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 (45) hide show
  1. package/es/calendar/Calendar.mjs +5 -3
  2. package/es/calendar/index.css +1 -1
  3. package/es/calendar/types.d.ts +2 -2
  4. package/es/field/Field.d.ts +8 -0
  5. package/es/field/Field.mjs +8 -1
  6. package/es/field/index.d.ts +4 -0
  7. package/es/index.d.ts +1 -1
  8. package/es/index.mjs +1 -1
  9. package/es/lazyload/vue-lazyload/index.d.ts +1 -1
  10. package/es/locale/lang/kk-KZ.d.ts +63 -0
  11. package/es/locale/lang/kk-KZ.mjs +81 -0
  12. package/es/overlay/Overlay.d.ts +3 -0
  13. package/es/overlay/Overlay.mjs +19 -8
  14. package/es/overlay/index.d.ts +2 -0
  15. package/es/search/Search.d.ts +6 -0
  16. package/es/search/index.d.ts +4 -0
  17. package/es/slider/Slider.d.ts +1 -1
  18. package/es/slider/index.d.ts +1 -1
  19. package/es/swipe-cell/SwipeCell.mjs +7 -3
  20. package/lib/calendar/Calendar.js +5 -3
  21. package/lib/calendar/index.css +1 -1
  22. package/lib/calendar/types.d.ts +2 -2
  23. package/lib/field/Field.d.ts +8 -0
  24. package/lib/field/Field.js +7 -0
  25. package/lib/field/index.d.ts +4 -0
  26. package/lib/index.css +1 -1
  27. package/lib/index.d.ts +1 -1
  28. package/lib/index.js +1 -1
  29. package/lib/lazyload/vue-lazyload/index.d.ts +1 -1
  30. package/lib/locale/lang/kk-KZ.d.ts +63 -0
  31. package/lib/locale/lang/kk-KZ.js +100 -0
  32. package/lib/overlay/Overlay.d.ts +3 -0
  33. package/lib/overlay/Overlay.js +18 -7
  34. package/lib/overlay/index.d.ts +2 -0
  35. package/lib/search/Search.d.ts +6 -0
  36. package/lib/search/index.d.ts +4 -0
  37. package/lib/slider/Slider.d.ts +1 -1
  38. package/lib/slider/index.d.ts +1 -1
  39. package/lib/swipe-cell/SwipeCell.js +7 -3
  40. package/lib/vant.cjs.js +38 -14
  41. package/lib/vant.es.js +39 -15
  42. package/lib/vant.js +38 -14
  43. package/lib/vant.min.js +2 -2
  44. package/lib/web-types.json +1 -1
  45. package/package.json +8 -8
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.3";
109
+ export const version: "4.9.5";
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.3";
229
+ const version = "4.9.5";
230
230
  function install(app) {
231
231
  const components = [
232
232
  import_action_bar.ActionBar,
@@ -44,7 +44,7 @@ export declare const Lazyload: {
44
44
  install(app: App, options?: LazyloadOptions): void;
45
45
  };
46
46
 
47
- declare module '@vue/runtime-core' {
47
+ declare module 'vue' {
48
48
  interface ComponentCustomProperties {
49
49
  $Lazyload: {
50
50
  $on: (event: string, handler: Callback) => void;
@@ -0,0 +1,63 @@
1
+ declare const _default: {
2
+ name: string;
3
+ tel: string;
4
+ save: string;
5
+ clear: string;
6
+ cancel: string;
7
+ confirm: string;
8
+ delete: string;
9
+ loading: string;
10
+ noCoupon: string;
11
+ nameEmpty: string;
12
+ addContact: string;
13
+ telInvalid: string;
14
+ vanCalendar: {
15
+ end: string;
16
+ start: string;
17
+ title: string;
18
+ weekdays: string[];
19
+ monthTitle: (year: number, month: number) => string;
20
+ rangePrompt: (maxRange: number) => string;
21
+ };
22
+ vanCascader: {
23
+ select: string;
24
+ };
25
+ vanPagination: {
26
+ prev: string;
27
+ next: string;
28
+ };
29
+ vanPullRefresh: {
30
+ pulling: string;
31
+ loosing: string;
32
+ };
33
+ vanSubmitBar: {
34
+ label: string;
35
+ };
36
+ vanCoupon: {
37
+ unlimited: string;
38
+ discount: (discount: number) => string;
39
+ condition: (condition: number) => string;
40
+ };
41
+ vanCouponCell: {
42
+ title: string;
43
+ count: (count: number) => string;
44
+ };
45
+ vanCouponList: {
46
+ exchange: string;
47
+ close: string;
48
+ enable: string;
49
+ disabled: string;
50
+ placeholder: string;
51
+ };
52
+ vanAddressEdit: {
53
+ area: string;
54
+ areaEmpty: string;
55
+ addressEmpty: string;
56
+ addressDetail: string;
57
+ defaultAddress: string;
58
+ };
59
+ vanAddressList: {
60
+ add: string;
61
+ };
62
+ };
63
+ export default _default;
@@ -0,0 +1,100 @@
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 name in all)
7
+ __defProp(target, name, { get: all[name], 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 stdin_default = {
24
+ name: "\u0410\u0442\u044B",
25
+ tel: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D",
26
+ save: "\u0421\u0430\u049B\u0442\u0430\u0443",
27
+ clear: "\u0422\u0430\u0437\u0430\u0440\u0442\u0443",
28
+ cancel: "\u0411\u0430\u0441\u0442\u0430\u0440\u0442\u0443",
29
+ confirm: "\u0420\u0430\u0441\u0442\u0430\u0443",
30
+ delete: "\u0416\u043E\u044E",
31
+ loading: "\u0416\u04AF\u043A\u0442\u0435\u043B\u0443\u0434\u0435...",
32
+ noCoupon: "\u041A\u0443\u043F\u043E\u043D\u0434\u0430\u0440 \u0436\u043E\u049B",
33
+ nameEmpty: "\u0410\u0442\u044B-\u0436\u04E9\u043D\u0456\u04A3\u0456\u0437\u0434\u0456 \u0442\u043E\u043B\u0442\u044B\u0440\u044B\u04A3\u044B\u0437",
34
+ addContact: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u0456 \u049B\u043E\u0441\u0443",
35
+ telInvalid: "\u0414\u04B1\u0440\u044B\u0441 \u0442\u0435\u043B\u0435\u0444\u043E\u043D \u043D\u04E9\u043C\u0456\u0440\u0456\u043D \u0442\u043E\u043B\u0442\u044B\u0440\u044B\u04A3\u044B\u0437",
36
+ vanCalendar: {
37
+ end: "\u0410\u044F\u049B\u0442\u0430\u043B\u0443 \u0443\u0430\u049B\u044B\u0442\u044B",
38
+ start: "\u0411\u0430\u0441\u0442\u0430\u0443 \u0443\u0430\u049B\u044B\u0442\u044B",
39
+ title: "\u041A\u04AF\u043D\u0434\u0456 \u0442\u0430\u04A3\u0434\u0430\u0443",
40
+ weekdays: ["\u0416\u0421", "\u0414\u0421", "\u0421\u0421", "\u0421\u0420", "\u0411\u0421", "\u0416\u041C", "\u0421\u0411"],
41
+ monthTitle: (year, month) => {
42
+ const monthNames = [
43
+ "\u049A\u0430\u04A3\u0442\u0430\u0440",
44
+ "\u0410\u049B\u043F\u0430\u043D",
45
+ "\u041D\u0430\u0443\u0440\u044B\u0437",
46
+ "\u0421\u04D9\u0443\u0456\u0440",
47
+ "\u041C\u0430\u043C\u044B\u0440",
48
+ "\u041C\u0430\u0443\u0441\u044B\u043C",
49
+ "\u0428\u0456\u043B\u0434\u0435",
50
+ "\u0422\u0430\u043C\u044B\u0437",
51
+ "\u049A\u044B\u0440\u043A\u04AF\u0439\u0435\u043A",
52
+ "\u049A\u0430\u0437\u0430\u043D",
53
+ "\u049A\u0430\u0440\u0430\u0448\u0430",
54
+ "\u0416\u0435\u043B\u0442\u043E\u049B\u0441\u0430\u043D"
55
+ ];
56
+ return `${year} ${monthNames[month - 1]}`;
57
+ },
58
+ rangePrompt: (maxRange) => `\u0422\u0435\u043A ${maxRange} \u043A\u04AF\u043D\u0433\u0435 \u0434\u0435\u0439\u0456\u043D \u0442\u0430\u04A3\u0434\u0430\u0439 \u0430\u043B\u0430\u0441\u044B\u0437`
59
+ },
60
+ vanCascader: {
61
+ select: "\u0422\u0430\u04A3\u0434\u0430\u04A3\u044B\u0437"
62
+ },
63
+ vanPagination: {
64
+ prev: "\u0410\u0440\u0442\u049B\u0430",
65
+ next: "\u0410\u043B\u0493\u0430"
66
+ },
67
+ vanPullRefresh: {
68
+ pulling: "\u0416\u0430\u04A3\u0430\u0440\u0442\u0443 \u04AF\u0448\u0456\u043D \u0442\u0430\u0440\u0442\u044B\u04A3\u044B\u0437...",
69
+ loosing: "\u0416\u0430\u04A3\u0430\u0440\u0442\u0443 \u04AF\u0448\u0456\u043D \u0436\u0456\u0431\u0435\u0440\u0456\u04A3\u0456\u0437..."
70
+ },
71
+ vanSubmitBar: {
72
+ label: "\u0416\u0430\u043B\u043F\u044B:"
73
+ },
74
+ vanCoupon: {
75
+ unlimited: "\u0422\u0430\u043B\u0430\u043F \u0436\u043E\u049B",
76
+ discount: (discount) => `${discount * 10}% \u0436\u0435\u04A3\u0456\u043B\u0434\u0456\u043A`,
77
+ condition: (condition) => `${condition} \u0442\u0435\u04A3\u0433\u0435\u0433\u0435 \u0436\u0435\u0442\u043A\u0435\u043D\u0434\u0435 \u049B\u043E\u043B \u0436\u0435\u0442\u0456\u043C\u0434\u0456`
78
+ },
79
+ vanCouponCell: {
80
+ title: "\u041A\u0443\u043F\u043E\u043D",
81
+ count: (count) => `${count} \u049B\u043E\u043B \u0436\u0435\u0442\u0456\u043C\u0434\u0456 \u043A\u0443\u043F\u043E\u043D`
82
+ },
83
+ vanCouponList: {
84
+ exchange: "\u0410\u0439\u044B\u0440\u0431\u0430\u0441\u0442\u0430\u0443",
85
+ close: "\u049A\u043E\u043B\u0434\u0430\u043D\u0431\u0430\u0443",
86
+ enable: "\u049A\u043E\u043B \u0436\u0435\u0442\u0456\u043C\u0434\u0456",
87
+ disabled: "\u049A\u043E\u043B\u0436\u0435\u0442\u0456\u043C\u0441\u0456\u0437",
88
+ placeholder: "\u0416\u0435\u04A3\u0456\u043B\u0434\u0456\u043A \u043A\u043E\u0434\u044B\u043D \u0435\u043D\u0433\u0456\u0437\u0456\u04A3\u0456\u0437"
89
+ },
90
+ vanAddressEdit: {
91
+ area: "\u0410\u0443\u043C\u0430\u049B",
92
+ areaEmpty: "\u0410\u0439\u043C\u0430\u049B\u0442\u044B \u0442\u0430\u04A3\u0434\u0430\u04A3\u044B\u0437",
93
+ addressEmpty: "\u0422\u043E\u043B\u044B\u049B \u043C\u0435\u043A\u0435\u043D-\u0436\u0430\u0439\u0434\u044B \u0442\u043E\u043B\u0442\u044B\u0440\u044B\u04A3\u044B\u0437",
94
+ addressDetail: "\u041C\u0435\u043A\u0435\u043D\u0436\u0430\u0439",
95
+ defaultAddress: "\u04D8\u0434\u0435\u043F\u043A\u0456 \u0436\u0435\u0442\u043A\u0456\u0437\u0443 \u043C\u0435\u043A\u0435\u043D\u0436\u0430\u0439\u044B \u0440\u0435\u0442\u0456\u043D\u0434\u0435 \u043E\u0440\u043D\u0430\u0442\u0443"
96
+ },
97
+ vanAddressList: {
98
+ add: "\u041C\u0435\u043A\u0435\u043D\u0436\u0430\u0439 \u049B\u043E\u0441\u0443"
99
+ }
100
+ };
@@ -13,6 +13,7 @@ export declare const overlayProps: {
13
13
  default: true;
14
14
  };
15
15
  customStyle: PropType<CSSProperties>;
16
+ teleport: PropType<string | import("vue").RendererElement | null | undefined>;
16
17
  };
17
18
  export type OverlayProps = ExtractPropTypes<typeof overlayProps>;
18
19
  declare const _default: import("vue").DefineComponent<{
@@ -29,6 +30,7 @@ declare const _default: import("vue").DefineComponent<{
29
30
  default: true;
30
31
  };
31
32
  customStyle: PropType<CSSProperties>;
33
+ teleport: PropType<string | import("vue").RendererElement | null | undefined>;
32
34
  }, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
33
35
  show: BooleanConstructor;
34
36
  zIndex: (NumberConstructor | StringConstructor)[];
@@ -43,6 +45,7 @@ declare const _default: import("vue").DefineComponent<{
43
45
  default: true;
44
46
  };
45
47
  customStyle: PropType<CSSProperties>;
48
+ teleport: PropType<string | import("vue").RendererElement | null | undefined>;
46
49
  }>>, {
47
50
  show: boolean;
48
51
  lockScroll: boolean;
@@ -34,7 +34,8 @@ const overlayProps = {
34
34
  className: import_utils.unknownProp,
35
35
  lockScroll: import_utils.truthProp,
36
36
  lazyRender: import_utils.truthProp,
37
- customStyle: Object
37
+ customStyle: Object,
38
+ teleport: [String, Object]
38
39
  };
39
40
  var stdin_default = (0, import_vue2.defineComponent)({
40
41
  name,
@@ -64,11 +65,21 @@ var stdin_default = (0, import_vue2.defineComponent)({
64
65
  (0, import_use.useEventListener)("touchmove", onTouchMove, {
65
66
  target: root
66
67
  });
67
- return () => (0, import_vue.createVNode)(import_vue2.Transition, {
68
- "name": "van-fade",
69
- "appear": true
70
- }, {
71
- default: renderOverlay
72
- });
68
+ return () => {
69
+ const Content = (0, import_vue.createVNode)(import_vue2.Transition, {
70
+ "name": "van-fade",
71
+ "appear": true
72
+ }, {
73
+ default: renderOverlay
74
+ });
75
+ if (props.teleport) {
76
+ return (0, import_vue.createVNode)(import_vue2.Teleport, {
77
+ "to": props.teleport
78
+ }, {
79
+ default: () => [Content]
80
+ });
81
+ }
82
+ return Content;
83
+ };
73
84
  }
74
85
  });
@@ -12,6 +12,7 @@ export declare const Overlay: import("../utils").WithInstall<import("vue").Defin
12
12
  default: true;
13
13
  };
14
14
  customStyle: import("vue").PropType<import("vue").CSSProperties>;
15
+ teleport: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
15
16
  }, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
16
17
  show: BooleanConstructor;
17
18
  zIndex: (NumberConstructor | StringConstructor)[];
@@ -26,6 +27,7 @@ export declare const Overlay: import("../utils").WithInstall<import("vue").Defin
26
27
  default: true;
27
28
  };
28
29
  customStyle: import("vue").PropType<import("vue").CSSProperties>;
30
+ teleport: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
29
31
  }>>, {
30
32
  show: boolean;
31
33
  lockScroll: boolean;
@@ -8,6 +8,8 @@ export declare const searchProps: {
8
8
  autofocus: BooleanConstructor;
9
9
  clearable: BooleanConstructor;
10
10
  maxlength: (NumberConstructor | StringConstructor)[];
11
+ max: NumberConstructor;
12
+ min: NumberConstructor;
11
13
  formatter: import("vue").PropType<(value: string) => string>;
12
14
  clearIcon: {
13
15
  type: import("vue").PropType<string>;
@@ -75,6 +77,8 @@ declare const _default: import("vue").DefineComponent<{
75
77
  autofocus: BooleanConstructor;
76
78
  clearable: BooleanConstructor;
77
79
  maxlength: (NumberConstructor | StringConstructor)[];
80
+ max: NumberConstructor;
81
+ min: NumberConstructor;
78
82
  formatter: import("vue").PropType<(value: string) => string>;
79
83
  clearIcon: {
80
84
  type: import("vue").PropType<string>;
@@ -140,6 +144,8 @@ declare const _default: import("vue").DefineComponent<{
140
144
  autofocus: BooleanConstructor;
141
145
  clearable: BooleanConstructor;
142
146
  maxlength: (NumberConstructor | StringConstructor)[];
147
+ max: NumberConstructor;
148
+ min: NumberConstructor;
143
149
  formatter: import("vue").PropType<(value: string) => string>;
144
150
  clearIcon: {
145
151
  type: import("vue").PropType<string>;
@@ -7,6 +7,8 @@ export declare const Search: import("../utils").WithInstall<import("vue").Define
7
7
  autofocus: BooleanConstructor;
8
8
  clearable: BooleanConstructor;
9
9
  maxlength: (NumberConstructor | StringConstructor)[];
10
+ max: NumberConstructor;
11
+ min: NumberConstructor;
10
12
  formatter: import("vue").PropType<(value: string) => string>;
11
13
  clearIcon: {
12
14
  type: import("vue").PropType<string>;
@@ -72,6 +74,8 @@ export declare const Search: import("../utils").WithInstall<import("vue").Define
72
74
  autofocus: BooleanConstructor;
73
75
  clearable: BooleanConstructor;
74
76
  maxlength: (NumberConstructor | StringConstructor)[];
77
+ max: NumberConstructor;
78
+ min: NumberConstructor;
75
79
  formatter: import("vue").PropType<(value: string) => string>;
76
80
  clearIcon: {
77
81
  type: import("vue").PropType<string>;
@@ -92,9 +92,9 @@ declare const _default: import("vue").DefineComponent<{
92
92
  max: string | number;
93
93
  disabled: boolean;
94
94
  vertical: boolean;
95
+ min: string | number;
95
96
  modelValue: SliderValue;
96
97
  readonly: boolean;
97
- min: string | number;
98
98
  step: string | number;
99
99
  }, {}>;
100
100
  export default _default;
@@ -61,9 +61,9 @@ export declare const Slider: import("../utils").WithInstall<import("vue").Define
61
61
  max: string | number;
62
62
  disabled: boolean;
63
63
  vertical: boolean;
64
+ min: string | number;
64
65
  modelValue: number | [number, number];
65
66
  readonly: boolean;
66
- min: string | number;
67
67
  step: string | number;
68
68
  }, {}>>;
69
69
  export default Slider;
@@ -123,7 +123,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
123
123
  }, 0);
124
124
  }
125
125
  };
126
- const onClick = (position = "outside") => {
126
+ const onClick = (position = "outside", event) => {
127
127
  if (isInBeforeClosing)
128
128
  return;
129
129
  emit("click", position);
@@ -131,6 +131,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
131
131
  isInBeforeClosing = true;
132
132
  (0, import_utils.callInterceptor)(props.beforeClose, {
133
133
  args: [{
134
+ event,
134
135
  name: props.name,
135
136
  position
136
137
  }],
@@ -147,7 +148,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
147
148
  if (stop) {
148
149
  event.stopPropagation();
149
150
  }
150
- onClick(position);
151
+ if (lockClick) {
152
+ return;
153
+ }
154
+ onClick(position, event);
151
155
  };
152
156
  const renderSideContent = (side, ref2) => {
153
157
  const contentSlot = slots[side];
@@ -163,7 +167,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
163
167
  open,
164
168
  close
165
169
  });
166
- (0, import_use.useClickAway)(root, () => onClick("outside"), {
170
+ (0, import_use.useClickAway)(root, (event) => onClick("outside", event), {
167
171
  eventName: "touchstart"
168
172
  });
169
173
  (0, import_use.useEventListener)("touchmove", onTouchMove, {
package/lib/vant.cjs.js CHANGED
@@ -1280,7 +1280,8 @@ const overlayProps = {
1280
1280
  className: unknownProp,
1281
1281
  lockScroll: truthProp,
1282
1282
  lazyRender: truthProp,
1283
- customStyle: Object
1283
+ customStyle: Object,
1284
+ teleport: [String, Object]
1284
1285
  };
1285
1286
  var stdin_default$1L = vue.defineComponent({
1286
1287
  name: name$1C,
@@ -1310,12 +1311,22 @@ var stdin_default$1L = vue.defineComponent({
1310
1311
  use.useEventListener("touchmove", onTouchMove, {
1311
1312
  target: root
1312
1313
  });
1313
- return () => vue.createVNode(vue.Transition, {
1314
- "name": "van-fade",
1315
- "appear": true
1316
- }, {
1317
- default: renderOverlay
1318
- });
1314
+ return () => {
1315
+ const Content = vue.createVNode(vue.Transition, {
1316
+ "name": "van-fade",
1317
+ "appear": true
1318
+ }, {
1319
+ default: renderOverlay
1320
+ });
1321
+ if (props2.teleport) {
1322
+ return vue.createVNode(vue.Teleport, {
1323
+ "to": props2.teleport
1324
+ }, {
1325
+ default: () => [Content]
1326
+ });
1327
+ }
1328
+ return Content;
1329
+ };
1319
1330
  }
1320
1331
  });
1321
1332
  const Overlay = withInstall(stdin_default$1L);
@@ -4070,6 +4081,8 @@ const fieldSharedProps = {
4070
4081
  autofocus: Boolean,
4071
4082
  clearable: Boolean,
4072
4083
  maxlength: numericProp,
4084
+ max: Number,
4085
+ min: Number,
4073
4086
  formatter: Function,
4074
4087
  clearIcon: makeStringProp("clear"),
4075
4088
  modelValue: makeNumericProp(""),
@@ -4267,12 +4280,17 @@ var stdin_default$1v = vue.defineComponent({
4267
4280
  return value;
4268
4281
  };
4269
4282
  const updateValue = (value, trigger = "onChange") => {
4283
+ var _a, _b;
4270
4284
  const originalValue = value;
4271
4285
  value = limitValueLength(value);
4272
4286
  const limitDiffLen = getStringLength(originalValue) - getStringLength(value);
4273
4287
  if (props2.type === "number" || props2.type === "digit") {
4274
4288
  const isNumber = props2.type === "number";
4275
4289
  value = formatNumber(value, isNumber, isNumber);
4290
+ if (trigger === "onBlur" && value !== "") {
4291
+ const adjustedValue = clamp(+value, (_a = props2.min) != null ? _a : -Infinity, (_b = props2.max) != null ? _b : Infinity);
4292
+ value = adjustedValue.toString();
4293
+ }
4276
4294
  }
4277
4295
  let formatterDiffLen = 0;
4278
4296
  if (props2.formatter && trigger === props2.formatTrigger) {
@@ -6926,6 +6944,9 @@ var stdin_default$1d = vue.defineComponent({
6926
6944
  if (!Array.isArray(defaultDate)) {
6927
6945
  defaultDate = [];
6928
6946
  }
6947
+ if (defaultDate.length === 1 && compareDay(defaultDate[0], now) === 1) {
6948
+ defaultDate = [];
6949
+ }
6929
6950
  const min = minDate.value;
6930
6951
  const max = maxDate.value;
6931
6952
  const start = limitDateRange(defaultDate[0] || now, min, max ? allowSameDay ? max : getPrevDay(max) : void 0);
@@ -7241,9 +7262,8 @@ var stdin_default$1d = vue.defineComponent({
7241
7262
  };
7242
7263
  vue.watch(() => props2.show, init);
7243
7264
  vue.watch(() => [props2.type, props2.minDate, props2.maxDate, props2.switchMode], () => reset(getInitialDate(currentDate.value)));
7244
- vue.watch(() => props2.defaultDate, (value = null) => {
7245
- currentDate.value = value;
7246
- scrollToCurrentDate();
7265
+ vue.watch(() => props2.defaultDate, (value) => {
7266
+ reset(value);
7247
7267
  });
7248
7268
  useExpose({
7249
7269
  reset,
@@ -14961,7 +14981,7 @@ var stdin_default$c = vue.defineComponent({
14961
14981
  }, 0);
14962
14982
  }
14963
14983
  };
14964
- const onClick = (position = "outside") => {
14984
+ const onClick = (position = "outside", event) => {
14965
14985
  if (isInBeforeClosing)
14966
14986
  return;
14967
14987
  emit("click", position);
@@ -14969,6 +14989,7 @@ var stdin_default$c = vue.defineComponent({
14969
14989
  isInBeforeClosing = true;
14970
14990
  callInterceptor(props2.beforeClose, {
14971
14991
  args: [{
14992
+ event,
14972
14993
  name: props2.name,
14973
14994
  position
14974
14995
  }],
@@ -14985,7 +15006,10 @@ var stdin_default$c = vue.defineComponent({
14985
15006
  if (stop) {
14986
15007
  event.stopPropagation();
14987
15008
  }
14988
- onClick(position);
15009
+ if (lockClick2) {
15010
+ return;
15011
+ }
15012
+ onClick(position, event);
14989
15013
  };
14990
15014
  const renderSideContent = (side, ref2) => {
14991
15015
  const contentSlot = slots[side];
@@ -15001,7 +15025,7 @@ var stdin_default$c = vue.defineComponent({
15001
15025
  open,
15002
15026
  close
15003
15027
  });
15004
- use.useClickAway(root, () => onClick("outside"), {
15028
+ use.useClickAway(root, (event) => onClick("outside", event), {
15005
15029
  eventName: "touchstart"
15006
15030
  });
15007
15031
  use.useEventListener("touchmove", onTouchMove, {
@@ -17045,7 +17069,7 @@ const Lazyload = {
17045
17069
  });
17046
17070
  }
17047
17071
  };
17048
- const version = "4.9.3";
17072
+ const version = "4.9.5";
17049
17073
  function install(app) {
17050
17074
  const components = [
17051
17075
  ActionBar,
package/lib/vant.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { unref, ref, reactive, inject, watch, onMounted, nextTick, createVNode, defineComponent, getCurrentInstance, computed, onActivated, onDeactivated, onBeforeUnmount, provide, watchEffect, mergeProps, Transition, withDirectives, vShow, Teleport, Fragment, onBeforeUpdate, Comment, createTextVNode, onUnmounted, createApp, resolveDirective, withKeys, onUpdated, Text, h } from "vue";
1
+ import { unref, ref, reactive, inject, watch, onMounted, nextTick, createVNode, defineComponent, getCurrentInstance, computed, onActivated, onDeactivated, onBeforeUnmount, provide, watchEffect, mergeProps, Transition, Teleport, withDirectives, vShow, Fragment, onBeforeUpdate, Comment, createTextVNode, onUnmounted, createApp, resolveDirective, withKeys, onUpdated, Text, h } from "vue";
2
2
  import { useWindowSize, useRect, useChildren, useParent, onMountedOrActivated, getScrollParent, useEventListener, cancelRaf, raf, useScrollParent, usePageVisibility, doubleRaf, CUSTOM_FIELD_INJECTION_KEY, useCustomFieldValue, inBrowser as inBrowser$1, useToggle, useCountDown, useClickAway } from "@vant/use";
3
3
  import { normalizeClass, stringifyStyle, normalizeStyle } from "@vue/shared";
4
4
  import { offsetModifier, createPopper } from "@vant/popperjs";
@@ -1278,7 +1278,8 @@ const overlayProps = {
1278
1278
  className: unknownProp,
1279
1279
  lockScroll: truthProp,
1280
1280
  lazyRender: truthProp,
1281
- customStyle: Object
1281
+ customStyle: Object,
1282
+ teleport: [String, Object]
1282
1283
  };
1283
1284
  var stdin_default$1L = defineComponent({
1284
1285
  name: name$1C,
@@ -1308,12 +1309,22 @@ var stdin_default$1L = defineComponent({
1308
1309
  useEventListener("touchmove", onTouchMove, {
1309
1310
  target: root
1310
1311
  });
1311
- return () => createVNode(Transition, {
1312
- "name": "van-fade",
1313
- "appear": true
1314
- }, {
1315
- default: renderOverlay
1316
- });
1312
+ return () => {
1313
+ const Content = createVNode(Transition, {
1314
+ "name": "van-fade",
1315
+ "appear": true
1316
+ }, {
1317
+ default: renderOverlay
1318
+ });
1319
+ if (props2.teleport) {
1320
+ return createVNode(Teleport, {
1321
+ "to": props2.teleport
1322
+ }, {
1323
+ default: () => [Content]
1324
+ });
1325
+ }
1326
+ return Content;
1327
+ };
1317
1328
  }
1318
1329
  });
1319
1330
  const Overlay = withInstall(stdin_default$1L);
@@ -4068,6 +4079,8 @@ const fieldSharedProps = {
4068
4079
  autofocus: Boolean,
4069
4080
  clearable: Boolean,
4070
4081
  maxlength: numericProp,
4082
+ max: Number,
4083
+ min: Number,
4071
4084
  formatter: Function,
4072
4085
  clearIcon: makeStringProp("clear"),
4073
4086
  modelValue: makeNumericProp(""),
@@ -4265,12 +4278,17 @@ var stdin_default$1v = defineComponent({
4265
4278
  return value;
4266
4279
  };
4267
4280
  const updateValue = (value, trigger = "onChange") => {
4281
+ var _a, _b;
4268
4282
  const originalValue = value;
4269
4283
  value = limitValueLength(value);
4270
4284
  const limitDiffLen = getStringLength(originalValue) - getStringLength(value);
4271
4285
  if (props2.type === "number" || props2.type === "digit") {
4272
4286
  const isNumber = props2.type === "number";
4273
4287
  value = formatNumber(value, isNumber, isNumber);
4288
+ if (trigger === "onBlur" && value !== "") {
4289
+ const adjustedValue = clamp(+value, (_a = props2.min) != null ? _a : -Infinity, (_b = props2.max) != null ? _b : Infinity);
4290
+ value = adjustedValue.toString();
4291
+ }
4274
4292
  }
4275
4293
  let formatterDiffLen = 0;
4276
4294
  if (props2.formatter && trigger === props2.formatTrigger) {
@@ -6924,6 +6942,9 @@ var stdin_default$1d = defineComponent({
6924
6942
  if (!Array.isArray(defaultDate)) {
6925
6943
  defaultDate = [];
6926
6944
  }
6945
+ if (defaultDate.length === 1 && compareDay(defaultDate[0], now) === 1) {
6946
+ defaultDate = [];
6947
+ }
6927
6948
  const min = minDate.value;
6928
6949
  const max = maxDate.value;
6929
6950
  const start = limitDateRange(defaultDate[0] || now, min, max ? allowSameDay ? max : getPrevDay(max) : void 0);
@@ -7239,9 +7260,8 @@ var stdin_default$1d = defineComponent({
7239
7260
  };
7240
7261
  watch(() => props2.show, init);
7241
7262
  watch(() => [props2.type, props2.minDate, props2.maxDate, props2.switchMode], () => reset(getInitialDate(currentDate.value)));
7242
- watch(() => props2.defaultDate, (value = null) => {
7243
- currentDate.value = value;
7244
- scrollToCurrentDate();
7263
+ watch(() => props2.defaultDate, (value) => {
7264
+ reset(value);
7245
7265
  });
7246
7266
  useExpose({
7247
7267
  reset,
@@ -14959,7 +14979,7 @@ var stdin_default$c = defineComponent({
14959
14979
  }, 0);
14960
14980
  }
14961
14981
  };
14962
- const onClick = (position = "outside") => {
14982
+ const onClick = (position = "outside", event) => {
14963
14983
  if (isInBeforeClosing)
14964
14984
  return;
14965
14985
  emit("click", position);
@@ -14967,6 +14987,7 @@ var stdin_default$c = defineComponent({
14967
14987
  isInBeforeClosing = true;
14968
14988
  callInterceptor(props2.beforeClose, {
14969
14989
  args: [{
14990
+ event,
14970
14991
  name: props2.name,
14971
14992
  position
14972
14993
  }],
@@ -14983,7 +15004,10 @@ var stdin_default$c = defineComponent({
14983
15004
  if (stop) {
14984
15005
  event.stopPropagation();
14985
15006
  }
14986
- onClick(position);
15007
+ if (lockClick2) {
15008
+ return;
15009
+ }
15010
+ onClick(position, event);
14987
15011
  };
14988
15012
  const renderSideContent = (side, ref2) => {
14989
15013
  const contentSlot = slots[side];
@@ -14999,7 +15023,7 @@ var stdin_default$c = defineComponent({
14999
15023
  open,
15000
15024
  close
15001
15025
  });
15002
- useClickAway(root, () => onClick("outside"), {
15026
+ useClickAway(root, (event) => onClick("outside", event), {
15003
15027
  eventName: "touchstart"
15004
15028
  });
15005
15029
  useEventListener("touchmove", onTouchMove, {
@@ -17043,7 +17067,7 @@ const Lazyload = {
17043
17067
  });
17044
17068
  }
17045
17069
  };
17046
- const version = "4.9.3";
17070
+ const version = "4.9.5";
17047
17071
  function install(app) {
17048
17072
  const components = [
17049
17073
  ActionBar,