vant 3.5.0 → 3.5.3

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 (194) hide show
  1. package/LICENSE +10 -0
  2. package/README.md +13 -13
  3. package/changelog.generated.md +67 -0
  4. package/es/action-bar/ActionBar.d.ts +4 -0
  5. package/es/action-bar/ActionBar.mjs +13 -2
  6. package/es/action-bar/index.d.ts +3 -0
  7. package/es/button/index.less +1 -1
  8. package/es/calendar/Calendar.mjs +6 -1
  9. package/es/calendar/types.d.ts +1 -0
  10. package/es/cell/Cell.d.ts +1 -1
  11. package/es/cell/index.d.ts +1 -1
  12. package/es/collapse/Collapse.d.ts +8 -1
  13. package/es/collapse/Collapse.mjs +28 -1
  14. package/es/collapse/index.d.ts +1 -1
  15. package/es/collapse-item/CollapseItem.d.ts +1 -1
  16. package/es/collapse-item/CollapseItem.mjs +3 -1
  17. package/es/collapse-item/index.d.ts +1 -1
  18. package/es/collapse-item/index.less +1 -1
  19. package/es/composables/use-height.d.ts +1 -1
  20. package/es/composables/use-height.mjs +6 -2
  21. package/es/composables/use-placeholder.mjs +1 -1
  22. package/es/dialog/Dialog.d.ts +1 -1
  23. package/es/field/Field.d.ts +4 -2
  24. package/es/field/Field.mjs +7 -1
  25. package/es/field/index.d.ts +4 -2
  26. package/es/field/index.less +1 -1
  27. package/es/grid-item/index.less +1 -1
  28. package/es/index.d.ts +1 -1
  29. package/es/index.mjs +1 -1
  30. package/es/locale/index.d.ts +1 -1
  31. package/es/popover/Popover.mjs +17 -18
  32. package/es/popup/Popup.mjs +1 -1
  33. package/es/pull-refresh/PullRefresh.d.ts +2 -1
  34. package/es/pull-refresh/PullRefresh.mjs +5 -1
  35. package/es/pull-refresh/index.d.ts +2 -1
  36. package/es/sidebar-item/index.less +1 -1
  37. package/es/submit-bar/SubmitBar.d.ts +4 -0
  38. package/es/submit-bar/SubmitBar.mjs +13 -2
  39. package/es/submit-bar/index.d.ts +3 -0
  40. package/es/swipe/index.less +1 -1
  41. package/es/switch/index.less +1 -1
  42. package/es/toast/function-call.d.ts +5 -6
  43. package/es/toast/index.less +1 -1
  44. package/es/toast/types.d.ts +10 -1
  45. package/es/uploader/Uploader.d.ts +3 -3
  46. package/es/uploader/Uploader.mjs +1 -1
  47. package/es/uploader/index.d.ts +2 -2
  48. package/es/utils/basic.d.ts +3 -3
  49. package/es/utils/create.d.ts +1 -1
  50. package/lib/.DS_Store +0 -0
  51. package/lib/action-bar/.DS_Store +0 -0
  52. package/lib/action-bar/ActionBar.d.ts +4 -0
  53. package/lib/action-bar/ActionBar.js +12 -1
  54. package/lib/action-bar/index.d.ts +3 -0
  55. package/lib/action-bar-button/.DS_Store +0 -0
  56. package/lib/action-bar-icon/.DS_Store +0 -0
  57. package/lib/action-sheet/.DS_Store +0 -0
  58. package/lib/address-edit/.DS_Store +0 -0
  59. package/lib/address-list/.DS_Store +0 -0
  60. package/lib/area/.DS_Store +0 -0
  61. package/lib/badge/.DS_Store +0 -0
  62. package/lib/button/.DS_Store +0 -0
  63. package/lib/button/index.less +1 -1
  64. package/lib/calendar/.DS_Store +0 -0
  65. package/lib/calendar/Calendar.js +6 -1
  66. package/lib/calendar/types.d.ts +1 -0
  67. package/lib/card/.DS_Store +0 -0
  68. package/lib/cascader/.DS_Store +0 -0
  69. package/lib/cell/.DS_Store +0 -0
  70. package/lib/cell/Cell.d.ts +1 -1
  71. package/lib/cell/index.d.ts +1 -1
  72. package/lib/cell-group/.DS_Store +0 -0
  73. package/lib/checkbox/.DS_Store +0 -0
  74. package/lib/checkbox-group/.DS_Store +0 -0
  75. package/lib/circle/.DS_Store +0 -0
  76. package/lib/col/.DS_Store +0 -0
  77. package/lib/collapse/.DS_Store +0 -0
  78. package/lib/collapse/Collapse.d.ts +8 -1
  79. package/lib/collapse/Collapse.js +28 -1
  80. package/lib/collapse/index.d.ts +1 -1
  81. package/lib/collapse-item/.DS_Store +0 -0
  82. package/lib/collapse-item/CollapseItem.d.ts +1 -1
  83. package/lib/collapse-item/CollapseItem.js +3 -1
  84. package/lib/collapse-item/index.d.ts +1 -1
  85. package/lib/collapse-item/index.less +1 -1
  86. package/lib/composables/use-height.d.ts +1 -1
  87. package/lib/composables/use-height.js +6 -2
  88. package/lib/composables/use-placeholder.js +1 -1
  89. package/lib/config-provider/.DS_Store +0 -0
  90. package/lib/contact-card/.DS_Store +0 -0
  91. package/lib/contact-edit/.DS_Store +0 -0
  92. package/lib/contact-list/.DS_Store +0 -0
  93. package/lib/count-down/.DS_Store +0 -0
  94. package/lib/coupon/.DS_Store +0 -0
  95. package/lib/coupon-cell/.DS_Store +0 -0
  96. package/lib/coupon-list/.DS_Store +0 -0
  97. package/lib/datetime-picker/.DS_Store +0 -0
  98. package/lib/dialog/.DS_Store +0 -0
  99. package/lib/dialog/Dialog.d.ts +1 -1
  100. package/lib/divider/.DS_Store +0 -0
  101. package/lib/dropdown-item/.DS_Store +0 -0
  102. package/lib/dropdown-menu/.DS_Store +0 -0
  103. package/lib/empty/.DS_Store +0 -0
  104. package/lib/field/.DS_Store +0 -0
  105. package/lib/field/Field.d.ts +4 -2
  106. package/lib/field/Field.js +7 -1
  107. package/lib/field/index.d.ts +4 -2
  108. package/lib/field/index.less +1 -1
  109. package/lib/form/.DS_Store +0 -0
  110. package/lib/grid/.DS_Store +0 -0
  111. package/lib/grid-item/.DS_Store +0 -0
  112. package/lib/grid-item/index.less +1 -1
  113. package/lib/icon/.DS_Store +0 -0
  114. package/lib/image/.DS_Store +0 -0
  115. package/lib/image-preview/.DS_Store +0 -0
  116. package/lib/index-anchor/.DS_Store +0 -0
  117. package/lib/index-bar/.DS_Store +0 -0
  118. package/lib/index.d.ts +1 -1
  119. package/lib/index.js +1 -1
  120. package/lib/lazyload/.DS_Store +0 -0
  121. package/lib/list/.DS_Store +0 -0
  122. package/lib/loading/.DS_Store +0 -0
  123. package/lib/locale/.DS_Store +0 -0
  124. package/lib/locale/index.d.ts +1 -1
  125. package/lib/nav-bar/.DS_Store +0 -0
  126. package/lib/notice-bar/.DS_Store +0 -0
  127. package/lib/notify/.DS_Store +0 -0
  128. package/lib/number-keyboard/.DS_Store +0 -0
  129. package/lib/overlay/.DS_Store +0 -0
  130. package/lib/pagination/.DS_Store +0 -0
  131. package/lib/password-input/.DS_Store +0 -0
  132. package/lib/picker/.DS_Store +0 -0
  133. package/lib/popover/.DS_Store +0 -0
  134. package/lib/popover/Popover.js +17 -18
  135. package/lib/popup/.DS_Store +0 -0
  136. package/lib/popup/Popup.js +1 -1
  137. package/lib/progress/.DS_Store +0 -0
  138. package/lib/pull-refresh/.DS_Store +0 -0
  139. package/lib/pull-refresh/PullRefresh.d.ts +2 -1
  140. package/lib/pull-refresh/PullRefresh.js +5 -1
  141. package/lib/pull-refresh/index.d.ts +2 -1
  142. package/lib/radio/.DS_Store +0 -0
  143. package/lib/radio-group/.DS_Store +0 -0
  144. package/lib/rate/.DS_Store +0 -0
  145. package/lib/row/.DS_Store +0 -0
  146. package/lib/search/.DS_Store +0 -0
  147. package/lib/share-sheet/.DS_Store +0 -0
  148. package/lib/sidebar/.DS_Store +0 -0
  149. package/lib/sidebar-item/.DS_Store +0 -0
  150. package/lib/sidebar-item/index.less +1 -1
  151. package/lib/skeleton/.DS_Store +0 -0
  152. package/lib/slider/.DS_Store +0 -0
  153. package/lib/step/.DS_Store +0 -0
  154. package/lib/stepper/.DS_Store +0 -0
  155. package/lib/steps/.DS_Store +0 -0
  156. package/lib/sticky/.DS_Store +0 -0
  157. package/lib/submit-bar/.DS_Store +0 -0
  158. package/lib/submit-bar/SubmitBar.d.ts +4 -0
  159. package/lib/submit-bar/SubmitBar.js +12 -1
  160. package/lib/submit-bar/index.d.ts +3 -0
  161. package/lib/swipe/.DS_Store +0 -0
  162. package/lib/swipe/index.less +1 -1
  163. package/lib/swipe-cell/.DS_Store +0 -0
  164. package/lib/swipe-item/.DS_Store +0 -0
  165. package/lib/switch/.DS_Store +0 -0
  166. package/lib/switch/index.less +1 -1
  167. package/lib/tab/.DS_Store +0 -0
  168. package/lib/tabbar/.DS_Store +0 -0
  169. package/lib/tabbar-item/.DS_Store +0 -0
  170. package/lib/tabs/.DS_Store +0 -0
  171. package/lib/tag/.DS_Store +0 -0
  172. package/lib/toast/.DS_Store +0 -0
  173. package/lib/toast/function-call.d.ts +5 -6
  174. package/lib/toast/index.less +1 -1
  175. package/lib/toast/types.d.ts +10 -1
  176. package/lib/tree-select/.DS_Store +0 -0
  177. package/lib/uploader/.DS_Store +0 -0
  178. package/lib/uploader/Uploader.d.ts +3 -3
  179. package/lib/uploader/Uploader.js +1 -1
  180. package/lib/uploader/index.d.ts +2 -2
  181. package/lib/utils/basic.d.ts +3 -3
  182. package/lib/utils/create.d.ts +1 -1
  183. package/lib/vant.cjs.js +191 -52
  184. package/lib/vant.es.js +280 -51
  185. package/lib/vant.js +189 -50
  186. package/lib/vant.min.js +1 -1
  187. package/{vetur → lib}/web-types.json +1652 -1609
  188. package/package.json +9 -14
  189. package/lib/ssr.js +0 -7
  190. package/lib/ssr.mjs +0 -1
  191. package/lib/vant.cjs.min.js +0 -1
  192. package/lib/vant.es.min.js +0 -14660
  193. package/vetur/attributes.json +0 -3474
  194. package/vetur/tags.json +0 -1202
package/LICENSE ADDED
@@ -0,0 +1,10 @@
1
+ MIT License
2
+
3
+ Copyright (c) Youzan
4
+ Copyright (c) Chen Jiahan and other contributors
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9
+
10
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -4,21 +4,20 @@
4
4
 
5
5
  <h1 align="center">Vant</h1>
6
6
 
7
- <p align="center">Mobile UI Components built on Vue</p>
7
+ <p align="center">Lightweight Mobile UI Components built on Vue</p>
8
8
 
9
9
  <p align="center">
10
10
  <img src="https://img.shields.io/npm/v/vant?style=flat-square" alt="npm version" />
11
- <img src="https://img.shields.io/github/workflow/status/youzan/vant/CI/dev?style=flat-square" alt="CI Status" />
12
- <img src="https://img.shields.io/codecov/c/github/youzan/vant/dev.svg?style=flat-square&color=#4fc08d" alt="Coverage Status" />
11
+ <img src="https://img.shields.io/github/workflow/status/vant-ui/vant/CI/dev?style=flat-square" alt="CI Status" />
12
+ <img src="https://img.shields.io/codecov/c/github/vant-ui/vant/dev.svg?style=flat-square&color=#4fc08d" alt="Coverage Status" />
13
13
  <img src="https://img.shields.io/npm/dm/vant.svg?style=flat-square&color=#4fc08d" alt="downloads" />
14
- <img src="https://img.shields.io/jsdelivr/npm/hm/vant?style=flat-square" alt="Jsdelivr Hits">
15
14
  <img src="https://img.badgesize.io/https://unpkg.com/vant@3/lib/vant.min.js?compression=gzip&style=flat-square&label=gzip%20size&color=#4fc08d" alt="Gzip Size" />
16
15
  </p>
17
16
 
18
17
  <p align="center">
19
18
  🔥 <a href="https://vant-contrib.gitee.io/vant">文档网站(国内)</a>
20
19
  &nbsp;
21
- 🌈 <a href="https://youzan.github.io/vant">文档网站(GitHub)</a>
20
+ 🌈 <a href="https://vant-ui.github.io/vant">文档网站(GitHub)</a>
22
21
  &nbsp;
23
22
  🇨🇳 <a href="./README.zh-CN.md">中文版介绍</a>
24
23
  </p>
@@ -29,6 +28,7 @@
29
28
 
30
29
  - 🚀 1KB Component average size (min+gzip)
31
30
  - 🚀 70+ High quality components
31
+ - 🚀 Zero third-party dependencies
32
32
  - 💪 90%+ Unit test coverage
33
33
  - 💪 Written in TypeScript
34
34
  - 📖 Extensive documentation and demos
@@ -74,7 +74,7 @@ const app = createApp();
74
74
  app.use(Button);
75
75
  ```
76
76
 
77
- See more in [Quickstart](https://youzan.github.io/vant#/en-US/quickstart).
77
+ See more in [Quickstart](https://vant-ui.github.io/vant#/en-US/quickstart).
78
78
 
79
79
  ## Browser Support
80
80
 
@@ -86,11 +86,11 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
86
86
 
87
87
  | Project | Description |
88
88
  | --- | --- |
89
- | [vant-weapp](https://github.com/youzan/vant-weapp) | WeChat MiniProgram UI |
89
+ | [vant-weapp](https://github.com/vant-ui/vant-weapp) | WeChat MiniProgram UI |
90
90
  | [vant-demo](https://github.com/vant-ui/vant-demo) | Collection of Vant demos |
91
- | [vant-cli](https://github.com/youzan/vant/tree/dev/packages/vant-cli) | Scaffold for UI library |
92
- | [vant-icons](https://github.com/youzan/vant/tree/dev/packages/vant-icons) | Vant icons |
93
- | [vant-touch-emulator](https://github.com/youzan/vant/tree/dev/packages/vant-touch-emulator) | Using vant in desktop browsers |
91
+ | [vant-cli](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli) | Scaffold for UI library |
92
+ | [vant-icons](https://github.com/vant-ui/vant/tree/dev/packages/vant-icons) | Vant icons |
93
+ | [vant-touch-emulator](https://github.com/vant-ui/vant/tree/dev/packages/vant-touch-emulator) | Using vant in desktop browsers |
94
94
 
95
95
  ## Community Ecosystem
96
96
 
@@ -106,8 +106,8 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
106
106
 
107
107
  ## Links
108
108
 
109
- - [Documentation](https://youzan.github.io/vant)
110
- - [Changelog](https://youzan.github.io/vant#/en-US/changelog)
109
+ - [Documentation](https://vant-ui.github.io/vant)
110
+ - [Changelog](https://vant-ui.github.io/vant#/en-US/changelog)
111
111
  - [Gitter](https://gitter.im/vant-contrib/discuss?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
112
112
 
113
113
  ## Preview
@@ -128,7 +128,7 @@ Core contributors of Vant and Vant Weapp:
128
128
 
129
129
  Thanks to the following friends for their contributions to Vant:
130
130
 
131
- <a href="https://github.com/youzan/vant/graphs/contributors">
131
+ <a href="https://github.com/vant-ui/vant/graphs/contributors">
132
132
  <img src="https://opencollective.com/vant/contributors.svg?width=890&button=false" alt="contributors">
133
133
  </a>
134
134
 
@@ -0,0 +1,67 @@
1
+ ### [v3.5.3](https://github.com/vant-ui/vant/compare/v3.5.2...v3.5.3)
2
+
3
+ `2022-07-31`
4
+
5
+ **Bug Fixes**
6
+
7
+ - @vant-cli: compilation error when using setup syntactic sugar and including subcomponents [cb7512](https://github.com/vant-ui/vant/commit/cb751211f1184a7a36627b45290f84c64d656f5a)
8
+ - create-vant-cli-app: missing demo registration [#10839](https://github.com/vant-ui/vant/issues/10839)
9
+ - docs: fix button example type in documentation [#10850](https://github.com/vant-ui/vant/issues/10850)
10
+ - failed to get correct height of safe area element [#10827](https://github.com/vant-ui/vant/issues/10827)
11
+ - Popover: allow to dynamically set offset prop [#10840](https://github.com/vant-ui/vant/issues/10840)
12
+ - Uploader: should not preview failed images [#10790](https://github.com/vant-ui/vant/issues/10790)
13
+
14
+ **Document**
15
+
16
+ - changelog: @vant/cli@4.0.3 [#10772](https://github.com/vant-ui/vant/issues/10772)
17
+ - changelog: vant@3.5.2 [e5a3aa](https://github.com/vant-ui/vant/commit/e5a3aa103dcd087f091d757ad244179ad4a70f42)
18
+ - improve description of name and required props [#10841](https://github.com/vant-ui/vant/issues/10841)
19
+ - update readme [#10868](https://github.com/vant-ui/vant/issues/10868)
20
+ - update website domain [#10798](https://github.com/vant-ui/vant/issues/10798)
21
+
22
+ **Feature**
23
+
24
+ - @vant/cli: bump vite 3.0 [#10842](https://github.com/vant-ui/vant/issues/10842)
25
+ - Calendar: expose getSelectedDate method [419a8e](https://github.com/vant-ui/vant/commit/419a8e4f0e6454b9aac30d5800318deabec099cb)
26
+ - cli: support site.headHtml option [#10807](https://github.com/vant-ui/vant/issues/10807)
27
+ - Collapse: collapse add toggleAll method for issues #10818 [#10818](https://github.com/vant-ui/vant/issues/10818) [#10837](https://github.com/vant-ui/vant/issues/10837) [#10818](https://github.com/vant-ui/vant/issues/10818)
28
+
29
+ **perf**
30
+
31
+ - cli: improve cli boot time [#10780](https://github.com/vant-ui/vant/issues/10780)
32
+ - cli: replace lint-staged with nano-staged [#10778](https://github.com/vant-ui/vant/issues/10778)
33
+ - cli: replace ora with nanospinner [#10779](https://github.com/vant-ui/vant/issues/10779)
34
+
35
+ **refactor**
36
+
37
+ - @vant/cli: remove vetur configs [#10866](https://github.com/vant-ui/vant/issues/10866)
38
+
39
+ **release**
40
+
41
+ - @vant/cli 4.0.3 [e4fc6f](https://github.com/vant-ui/vant/commit/e4fc6f9081728d3f59ef8d60c18bc5e7fa72d571)
42
+ - create-vant-cli-app 2.0.1 [c628a6](https://github.com/vant-ui/vant/commit/c628a667703b38e3999e1953950a187e97a45efb)
43
+ ### [v3.5.2](https://github.com/vant-ui/vant/compare/v3.5.1...v3.5.2)
44
+
45
+ `2022-06-26`
46
+
47
+ **Bug Fixes**
48
+
49
+ - List: element with `overflow: overlay` style should be considered a scroll container [#10743](https://github.com/vant-ui/vant/issues/10743)
50
+
51
+ **Document**
52
+
53
+ - add guide of function component style [#10728](https://github.com/vant-ui/vant/issues/10728)
54
+ - changelog: 3.5.1 [ffefe3](https://github.com/vant-ui/vant/commit/ffefe3002f674f644b90f8fdfb04dc004a3a8c4f)
55
+ - Switch: fix custom node demo [#10720](https://github.com/vant-ui/vant/issues/10720)
56
+
57
+ **Feature**
58
+
59
+ - ActionBar: add placeholder prop [#10724](https://github.com/vant-ui/vant/issues/10724)
60
+ - cli: add build.bundleOptions config [#10751](https://github.com/vant-ui/vant/issues/10751)
61
+ - cli: add css.removeSourceFile config [#10750](https://github.com/vant-ui/vant/issues/10750)
62
+ - Field: add start-validate and end-validate event [#10726](https://github.com/vant-ui/vant/issues/10726)
63
+ - SubmitBar: add placeholder prop [#10725](https://github.com/vant-ui/vant/issues/10725)
64
+
65
+ **release**
66
+
67
+ - 3.5.2 [52957e](https://github.com/vant-ui/vant/commit/52957ec244f2e33fff7768c1a52e29fc6589019d)
@@ -1,6 +1,7 @@
1
1
  import { type ExtractPropTypes } from 'vue';
2
2
  export declare const ACTION_BAR_KEY: unique symbol;
3
3
  declare const actionBarProps: {
4
+ placeholder: BooleanConstructor;
4
5
  safeAreaInsetBottom: {
5
6
  type: BooleanConstructor;
6
7
  default: true;
@@ -8,16 +9,19 @@ declare const actionBarProps: {
8
9
  };
9
10
  export declare type ActionBarProps = ExtractPropTypes<typeof actionBarProps>;
10
11
  declare const _default: import("vue").DefineComponent<{
12
+ placeholder: BooleanConstructor;
11
13
  safeAreaInsetBottom: {
12
14
  type: BooleanConstructor;
13
15
  default: true;
14
16
  };
15
17
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
18
+ placeholder: BooleanConstructor;
16
19
  safeAreaInsetBottom: {
17
20
  type: BooleanConstructor;
18
21
  default: true;
19
22
  };
20
23
  }>>, {
24
+ placeholder: boolean;
21
25
  safeAreaInsetBottom: boolean;
22
26
  }>;
23
27
  export default _default;
@@ -1,10 +1,12 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
- import { defineComponent } from "vue";
2
+ import { defineComponent, ref } from "vue";
3
3
  import { truthProp, createNamespace } from "../utils/index.mjs";
4
4
  import { useChildren } from "@vant/use";
5
+ import { usePlaceholder } from "../composables/use-placeholder.mjs";
5
6
  const [name, bem] = createNamespace("action-bar");
6
7
  const ACTION_BAR_KEY = Symbol(name);
7
8
  const actionBarProps = {
9
+ placeholder: Boolean,
8
10
  safeAreaInsetBottom: truthProp
9
11
  };
10
12
  var stdin_default = defineComponent({
@@ -13,18 +15,27 @@ var stdin_default = defineComponent({
13
15
  setup(props, {
14
16
  slots
15
17
  }) {
18
+ const root = ref();
19
+ const renderPlaceholder = usePlaceholder(root, bem);
16
20
  const {
17
21
  linkChildren
18
22
  } = useChildren(ACTION_BAR_KEY);
19
23
  linkChildren();
20
- return () => {
24
+ const renderActionBar = () => {
21
25
  var _a;
22
26
  return _createVNode("div", {
27
+ "ref": root,
23
28
  "class": [bem(), {
24
29
  "van-safe-area-bottom": props.safeAreaInsetBottom
25
30
  }]
26
31
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
27
32
  };
33
+ return () => {
34
+ if (props.placeholder) {
35
+ return renderPlaceholder(renderActionBar);
36
+ }
37
+ return renderActionBar();
38
+ };
28
39
  }
29
40
  });
30
41
  export {
@@ -1,14 +1,17 @@
1
1
  export declare const ActionBar: import("../utils").WithInstall<import("vue").DefineComponent<{
2
+ placeholder: BooleanConstructor;
2
3
  safeAreaInsetBottom: {
3
4
  type: BooleanConstructor;
4
5
  default: true;
5
6
  };
6
7
  }, () => 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<{
8
+ placeholder: BooleanConstructor;
7
9
  safeAreaInsetBottom: {
8
10
  type: BooleanConstructor;
9
11
  default: true;
10
12
  };
11
13
  }>>, {
14
+ placeholder: boolean;
12
15
  safeAreaInsetBottom: boolean;
13
16
  }>>;
14
17
  export default ActionBar;
@@ -201,7 +201,7 @@
201
201
  height: 100%;
202
202
 
203
203
  // fix icon vertical align
204
- // see: https://github.com/youzan/vant/issues/7617
204
+ // see: https://github.com/vant-ui/vant/issues/7617
205
205
  &::before {
206
206
  content: ' ';
207
207
  }
@@ -112,6 +112,9 @@ var stdin_default = defineComponent({
112
112
  const months = computed(() => {
113
113
  const months2 = [];
114
114
  const cursor = new Date(props.minDate);
115
+ if (props.lazyRender && !props.show && props.poppable) {
116
+ return months2;
117
+ }
115
118
  cursor.setDate(1);
116
119
  do {
117
120
  months2.push(new Date(cursor));
@@ -130,6 +133,7 @@ var stdin_default = defineComponent({
130
133
  }
131
134
  return !currentDate.value;
132
135
  });
136
+ const getSelectedDate = () => currentDate.value;
133
137
  const onScroll = () => {
134
138
  const top = getScrollTop(bodyRef.value);
135
139
  const bottom = top + bodyHeight;
@@ -372,7 +376,8 @@ var stdin_default = defineComponent({
372
376
  });
373
377
  useExpose({
374
378
  reset,
375
- scrollToDate
379
+ scrollToDate,
380
+ getSelectedDate
376
381
  });
377
382
  onMountedOrActivated(init);
378
383
  return () => {
@@ -15,6 +15,7 @@ export declare type CalendarDayItem = {
15
15
  export declare type CalendarExpose = {
16
16
  reset: (date?: Date | Date[]) => void;
17
17
  scrollToDate: (targetDate: Date) => void;
18
+ getSelectedDate: () => Date | Date[] | null;
18
19
  };
19
20
  export declare type CalendarInstance = ComponentPublicInstance<CalendarProps, CalendarExpose>;
20
21
  export declare type CalendarMonthInstance = ComponentPublicInstance<CalendarMonthProps, {
package/es/cell/Cell.d.ts CHANGED
@@ -110,10 +110,10 @@ declare const _default: import("vue").DefineComponent<{
110
110
  replace: BooleanConstructor;
111
111
  }>>, {
112
112
  replace: boolean;
113
+ required: boolean;
113
114
  center: boolean;
114
115
  isLink: boolean;
115
116
  border: boolean;
116
- required: boolean;
117
117
  clickable: boolean | null;
118
118
  }>;
119
119
  export default _default;
@@ -54,10 +54,10 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
54
54
  replace: BooleanConstructor;
55
55
  }>>, {
56
56
  replace: boolean;
57
+ required: boolean;
57
58
  center: boolean;
58
59
  isLink: boolean;
59
60
  border: boolean;
60
- required: boolean;
61
61
  clickable: boolean | null;
62
62
  }>>;
63
63
  export default Cell;
@@ -1,9 +1,13 @@
1
- import { type PropType, type InjectionKey, type ExtractPropTypes } from 'vue';
1
+ import { type PropType, type InjectionKey, type ExtractPropTypes, type ComponentPublicInstance } from 'vue';
2
2
  import { type Numeric } from '../utils';
3
3
  export declare type CollapseProvide = {
4
4
  toggle: (name: Numeric, expanded: boolean) => void;
5
5
  isExpanded: (name: Numeric) => boolean;
6
6
  };
7
+ export declare type CollapseToggleAllOptions = boolean | {
8
+ expanded?: boolean;
9
+ skipDisabled?: boolean;
10
+ };
7
11
  export declare const COLLAPSE_KEY: InjectionKey<CollapseProvide>;
8
12
  declare const collapseProps: {
9
13
  border: {
@@ -17,6 +21,9 @@ declare const collapseProps: {
17
21
  };
18
22
  };
19
23
  export declare type CollapseProps = ExtractPropTypes<typeof collapseProps>;
24
+ export declare type CollapseInstance = ComponentPublicInstance<{
25
+ toggleAll: (options?: boolean | CollapseToggleAllOptions) => void;
26
+ }>;
20
27
  declare const _default: import("vue").DefineComponent<{
21
28
  border: {
22
29
  type: BooleanConstructor;
@@ -2,6 +2,7 @@ import { createVNode as _createVNode } from "vue";
2
2
  import { defineComponent } from "vue";
3
3
  import { truthProp, createNamespace, BORDER_TOP_BOTTOM } from "../utils/index.mjs";
4
4
  import { useChildren } from "@vant/use";
5
+ import { useExpose } from "../composables/use-expose.mjs";
5
6
  const [name, bem] = createNamespace("collapse");
6
7
  const COLLAPSE_KEY = Symbol(name);
7
8
  const collapseProps = {
@@ -32,7 +33,8 @@ var stdin_default = defineComponent({
32
33
  slots
33
34
  }) {
34
35
  const {
35
- linkChildren
36
+ linkChildren,
37
+ children
36
38
  } = useChildren(COLLAPSE_KEY);
37
39
  const updateName = (name2) => {
38
40
  emit("change", name2);
@@ -51,6 +53,28 @@ var stdin_default = defineComponent({
51
53
  updateName(modelValue.filter((activeName) => activeName !== name2));
52
54
  }
53
55
  };
56
+ const toggleAll = (options = {}) => {
57
+ if (props.accordion) {
58
+ return;
59
+ }
60
+ if (typeof options === "boolean") {
61
+ options = {
62
+ expanded: options
63
+ };
64
+ }
65
+ const {
66
+ expanded,
67
+ skipDisabled
68
+ } = options;
69
+ const expandedChildren = children.filter((item) => {
70
+ if (item.disabled && skipDisabled) {
71
+ return item.expanded.value;
72
+ }
73
+ return expanded != null ? expanded : !item.expanded.value;
74
+ });
75
+ const names = expandedChildren.map((item) => item.itemName.value);
76
+ updateName(names);
77
+ };
54
78
  const isExpanded = (name2) => {
55
79
  const {
56
80
  accordion,
@@ -61,6 +85,9 @@ var stdin_default = defineComponent({
61
85
  }
62
86
  return accordion ? modelValue === name2 : modelValue.includes(name2);
63
87
  };
88
+ useExpose({
89
+ toggleAll
90
+ });
64
91
  linkChildren({
65
92
  toggle,
66
93
  isExpanded
@@ -27,7 +27,7 @@ export declare const Collapse: import("../utils").WithInstall<import("vue").Defi
27
27
  accordion: boolean;
28
28
  }>>;
29
29
  export default Collapse;
30
- export type { CollapseProps } from './Collapse';
30
+ export type { CollapseProps, CollapseInstance, CollapseToggleAllOptions, } from './Collapse';
31
31
  declare module 'vue' {
32
32
  interface GlobalComponents {
33
33
  VanCollapse: typeof Collapse;
@@ -107,11 +107,11 @@ declare const _default: import("vue").DefineComponent<{
107
107
  default: true;
108
108
  };
109
109
  }>>, {
110
+ required: boolean;
110
111
  center: boolean;
111
112
  disabled: boolean;
112
113
  isLink: boolean;
113
114
  border: boolean;
114
- required: boolean;
115
115
  clickable: boolean | null;
116
116
  readonly: boolean;
117
117
  lazyRender: boolean;
@@ -120,7 +120,9 @@ var stdin_default = defineComponent({
120
120
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]), [[_vShow, show.value]]);
121
121
  });
122
122
  useExpose({
123
- toggle
123
+ toggle,
124
+ expanded,
125
+ itemName: name2
124
126
  });
125
127
  return () => _createVNode("div", {
126
128
  "class": [bem({
@@ -69,11 +69,11 @@ export declare const CollapseItem: import("../utils").WithInstall<import("vue").
69
69
  default: true;
70
70
  };
71
71
  }>>, {
72
+ required: boolean;
72
73
  center: boolean;
73
74
  disabled: boolean;
74
75
  isLink: boolean;
75
76
  border: boolean;
76
- required: boolean;
77
77
  clickable: boolean | null;
78
78
  readonly: boolean;
79
79
  lazyRender: boolean;
@@ -23,7 +23,7 @@
23
23
  &__title {
24
24
  .van-cell__right-icon::before {
25
25
  // using translateZ to fix safari rendering issues
26
- // see: https://github.com/youzan/vant/issues/8608
26
+ // see: https://github.com/vant-ui/vant/issues/8608
27
27
  transform: rotate(90deg) translateZ(0);
28
28
  transition: transform var(--van-collapse-item-transition-duration);
29
29
  }
@@ -1,2 +1,2 @@
1
1
  import { Ref } from 'vue';
2
- export declare const useHeight: (element: Element | Ref<Element | undefined>) => Ref<number | undefined>;
2
+ export declare const useHeight: (element: Element | Ref<Element | undefined>, withSafeArea?: boolean) => Ref<number | undefined>;
@@ -1,13 +1,17 @@
1
1
  import { useRect } from "@vant/use";
2
2
  import { ref, onMounted, nextTick } from "vue";
3
- const useHeight = (element) => {
3
+ const useHeight = (element, withSafeArea) => {
4
4
  const height = ref();
5
5
  const setHeight = () => {
6
6
  height.value = useRect(element).height;
7
7
  };
8
8
  onMounted(() => {
9
9
  nextTick(setHeight);
10
- setTimeout(setHeight, 100);
10
+ if (withSafeArea) {
11
+ for (let i = 1; i <= 3; i++) {
12
+ setTimeout(setHeight, 100 * i);
13
+ }
14
+ }
11
15
  });
12
16
  return height;
13
17
  };
@@ -1,7 +1,7 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
2
  import { useHeight } from "./use-height.mjs";
3
3
  function usePlaceholder(contentRef, bem) {
4
- const height = useHeight(contentRef);
4
+ const height = useHeight(contentRef, true);
5
5
  return (renderContent) => _createVNode("div", {
6
6
  "class": bem("placeholder"),
7
7
  "style": {
@@ -30,7 +30,7 @@ declare const dialogProps: {
30
30
  theme: PropType<DialogTheme>;
31
31
  width: (NumberConstructor | StringConstructor)[];
32
32
  message: PropType<DialogMessage>;
33
- callback: PropType<(action?: DialogAction | undefined) => void>;
33
+ callback: PropType<(action?: DialogAction) => void>;
34
34
  allowHtml: BooleanConstructor;
35
35
  className: PropType<unknown>;
36
36
  transition: {
@@ -209,7 +209,7 @@ declare const _default: import("vue").DefineComponent<{
209
209
  type: BooleanConstructor;
210
210
  default: null;
211
211
  };
212
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
212
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
213
213
  icon: StringConstructor;
214
214
  size: PropType<import("../cell").CellSize>;
215
215
  title: (NumberConstructor | StringConstructor)[];
@@ -297,17 +297,19 @@ declare const _default: import("vue").DefineComponent<{
297
297
  onKeypress?: ((...args: any[]) => any) | undefined;
298
298
  onClear?: ((...args: any[]) => any) | undefined;
299
299
  "onClick-input"?: ((...args: any[]) => any) | undefined;
300
+ "onEnd-validate"?: ((...args: any[]) => any) | undefined;
301
+ "onStart-validate"?: ((...args: any[]) => any) | undefined;
300
302
  "onClick-left-icon"?: ((...args: any[]) => any) | undefined;
301
303
  "onClick-right-icon"?: ((...args: any[]) => any) | undefined;
302
304
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
303
305
  }, {
304
306
  type: FieldType;
307
+ required: boolean;
305
308
  center: boolean;
306
309
  autofocus: boolean;
307
310
  disabled: boolean;
308
311
  isLink: boolean;
309
312
  border: boolean;
310
- required: boolean;
311
313
  clickable: boolean | null;
312
314
  clearable: boolean;
313
315
  clearIcon: string;
@@ -58,7 +58,7 @@ const fieldProps = extend({}, cellSharedProps, fieldSharedProps, {
58
58
  var stdin_default = defineComponent({
59
59
  name,
60
60
  props: fieldProps,
61
- emits: ["blur", "focus", "clear", "keypress", "click-input", "click-left-icon", "click-right-icon", "update:modelValue"],
61
+ emits: ["blur", "focus", "clear", "keypress", "click-input", "end-validate", "start-validate", "click-left-icon", "click-right-icon", "update:modelValue"],
62
62
  setup(props, {
63
63
  emit,
64
64
  slots
@@ -132,18 +132,24 @@ var stdin_default = defineComponent({
132
132
  state.status = "unvalidated";
133
133
  state.validateMessage = "";
134
134
  };
135
+ const endValidate = () => emit("end-validate", {
136
+ status: state.status
137
+ });
135
138
  const validate = (rules = props.rules) => new Promise((resolve) => {
136
139
  resetValidation();
137
140
  if (rules) {
141
+ emit("start-validate");
138
142
  runRules(rules).then(() => {
139
143
  if (state.status === "failed") {
140
144
  resolve({
141
145
  name: props.name,
142
146
  message: state.validateMessage
143
147
  });
148
+ endValidate();
144
149
  } else {
145
150
  state.status = "passed";
146
151
  resolve();
152
+ endValidate();
147
153
  }
148
154
  });
149
155
  } else {
@@ -81,7 +81,7 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
81
81
  type: BooleanConstructor;
82
82
  default: null;
83
83
  };
84
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
84
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
85
85
  icon: StringConstructor;
86
86
  size: import("vue").PropType<import("..").CellSize>;
87
87
  title: (NumberConstructor | StringConstructor)[];
@@ -169,17 +169,19 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
169
169
  onKeypress?: ((...args: any[]) => any) | undefined;
170
170
  onClear?: ((...args: any[]) => any) | undefined;
171
171
  "onClick-input"?: ((...args: any[]) => any) | undefined;
172
+ "onEnd-validate"?: ((...args: any[]) => any) | undefined;
173
+ "onStart-validate"?: ((...args: any[]) => any) | undefined;
172
174
  "onClick-left-icon"?: ((...args: any[]) => any) | undefined;
173
175
  "onClick-right-icon"?: ((...args: any[]) => any) | undefined;
174
176
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
175
177
  }, {
176
178
  type: import("./types").FieldType;
179
+ required: boolean;
177
180
  center: boolean;
178
181
  autofocus: boolean;
179
182
  disabled: boolean;
180
183
  isLink: boolean;
181
184
  border: boolean;
182
- required: boolean;
183
185
  clickable: boolean | null;
184
186
  clearable: boolean;
185
187
  clearIcon: string;
@@ -78,7 +78,7 @@
78
78
  background-color: transparent;
79
79
  border: 0;
80
80
  resize: none;
81
- // https://github.com/youzan/vant/pull/9418
81
+ // https://github.com/vant-ui/vant/pull/9418
82
82
  user-select: auto;
83
83
 
84
84
  &::placeholder {
@@ -25,7 +25,7 @@
25
25
  color: var(--van-grid-item-text-color);
26
26
  font-size: var(--van-grid-item-text-font-size);
27
27
  line-height: 1.5;
28
- // https://github.com/youzan/vant/issues/3894
28
+ // https://github.com/vant-ui/vant/issues/3894
29
29
  word-break: break-all;
30
30
  }
31
31
 
package/es/index.d.ts CHANGED
@@ -90,4 +90,4 @@ declare namespace _default {
90
90
  }
91
91
  export default _default;
92
92
  export function install(app: any): void;
93
- export const version: "3.5.0";
93
+ export const version: "3.5.3";
package/es/index.mjs CHANGED
@@ -83,7 +83,7 @@ import { Tag } from "./tag/index.mjs";
83
83
  import { Toast } from "./toast/index.mjs";
84
84
  import { TreeSelect } from "./tree-select/index.mjs";
85
85
  import { Uploader } from "./uploader/index.mjs";
86
- const version = "3.5.0";
86
+ const version = "3.5.3";
87
87
  function install(app) {
88
88
  const components = [
89
89
  ActionBar,