vant 3.5.3 → 3.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/README.md +4 -0
  2. package/changelog.generated.md +39 -42
  3. package/es/badge/Badge.mjs +1 -1
  4. package/es/calendar/Calendar.mjs +3 -4
  5. package/es/composables/use-global-z-index.d.ts +4 -0
  6. package/es/composables/use-global-z-index.mjs +9 -0
  7. package/es/composables/use-height.mjs +2 -0
  8. package/es/composables/use-lock-scroll.mjs +3 -1
  9. package/es/config-provider/ConfigProvider.d.ts +3 -0
  10. package/es/config-provider/ConfigProvider.mjs +8 -1
  11. package/es/config-provider/index.d.ts +2 -0
  12. package/es/dropdown-menu/DropdownMenu.mjs +2 -1
  13. package/es/empty/Empty.d.ts +1 -1
  14. package/es/empty/Empty.mjs +281 -16
  15. package/es/field/Field.mjs +4 -1
  16. package/es/field/types.d.ts +1 -0
  17. package/es/field/utils.d.ts +1 -0
  18. package/es/field/utils.mjs +8 -2
  19. package/es/image-preview/ImagePreviewItem.mjs +1 -1
  20. package/es/index-bar/IndexBar.mjs +3 -2
  21. package/es/index.d.ts +2 -1
  22. package/es/index.mjs +4 -1
  23. package/es/list/List.mjs +2 -1
  24. package/es/number-keyboard/NumberKeyboard.mjs +1 -2
  25. package/es/number-keyboard/NumberKeyboardKey.mjs +2 -2
  26. package/es/password-input/PasswordInput.mjs +1 -1
  27. package/es/picker/PickerColumn.mjs +1 -1
  28. package/es/popover/Popover.mjs +11 -9
  29. package/es/popup/Popup.mjs +6 -5
  30. package/es/pull-refresh/PullRefresh.mjs +7 -3
  31. package/es/rate/Rate.mjs +1 -1
  32. package/es/search/index.css +1 -1
  33. package/es/search/index.less +3 -1
  34. package/es/slider/Slider.mjs +1 -1
  35. package/es/space/Space.d.ts +48 -0
  36. package/es/space/Space.mjs +87 -0
  37. package/es/space/index.css +1 -0
  38. package/es/space/index.d.ts +37 -0
  39. package/es/space/index.less +38 -0
  40. package/es/space/index.mjs +8 -0
  41. package/es/space/style/index.d.ts +1 -0
  42. package/es/space/style/index.mjs +2 -0
  43. package/es/space/style/less.d.ts +1 -0
  44. package/es/space/style/less.mjs +2 -0
  45. package/es/stepper/Stepper.mjs +1 -1
  46. package/es/sticky/Sticky.mjs +2 -1
  47. package/es/swipe/Swipe.mjs +1 -1
  48. package/es/swipe-cell/SwipeCell.mjs +1 -1
  49. package/es/tabs/Tabs.mjs +12 -2
  50. package/es/tabs/TabsContent.mjs +4 -0
  51. package/es/vue-tsx-shim.d.ts +7 -0
  52. package/lib/badge/Badge.js +1 -1
  53. package/lib/calendar/Calendar.js +3 -4
  54. package/lib/composables/use-global-z-index.d.ts +4 -0
  55. package/lib/composables/use-global-z-index.js +28 -0
  56. package/lib/composables/use-height.js +2 -0
  57. package/lib/composables/use-lock-scroll.js +3 -1
  58. package/lib/config-provider/ConfigProvider.d.ts +3 -0
  59. package/lib/config-provider/ConfigProvider.js +7 -0
  60. package/lib/config-provider/index.d.ts +2 -0
  61. package/lib/dropdown-menu/DropdownMenu.js +2 -1
  62. package/lib/empty/Empty.d.ts +1 -1
  63. package/lib/empty/Empty.js +281 -16
  64. package/lib/field/Field.js +3 -0
  65. package/lib/field/types.d.ts +1 -0
  66. package/lib/field/utils.d.ts +1 -0
  67. package/lib/field/utils.js +8 -2
  68. package/lib/image-preview/ImagePreviewItem.js +1 -1
  69. package/lib/index-bar/IndexBar.js +3 -2
  70. package/lib/index.css +1 -1
  71. package/lib/index.d.ts +2 -1
  72. package/lib/index.js +4 -1
  73. package/lib/index.less +1 -0
  74. package/lib/list/List.js +2 -1
  75. package/lib/number-keyboard/NumberKeyboard.js +1 -2
  76. package/lib/number-keyboard/NumberKeyboardKey.js +2 -2
  77. package/lib/password-input/PasswordInput.js +1 -1
  78. package/lib/picker/PickerColumn.js +1 -1
  79. package/lib/popover/Popover.js +10 -8
  80. package/lib/popup/Popup.js +6 -5
  81. package/lib/pull-refresh/PullRefresh.js +6 -2
  82. package/lib/rate/Rate.js +1 -1
  83. package/lib/search/index.css +1 -1
  84. package/lib/search/index.less +3 -1
  85. package/lib/slider/Slider.js +1 -1
  86. package/lib/space/Space.d.ts +48 -0
  87. package/lib/space/Space.js +106 -0
  88. package/lib/space/index.css +1 -0
  89. package/lib/space/index.d.ts +37 -0
  90. package/lib/space/index.js +30 -0
  91. package/lib/space/index.less +38 -0
  92. package/lib/space/style/index.d.ts +1 -0
  93. package/lib/space/style/index.js +2 -0
  94. package/lib/space/style/less.d.ts +1 -0
  95. package/lib/space/style/less.js +2 -0
  96. package/lib/stepper/Stepper.js +1 -1
  97. package/lib/sticky/Sticky.js +2 -1
  98. package/lib/swipe/Swipe.js +1 -1
  99. package/lib/swipe-cell/SwipeCell.js +1 -1
  100. package/lib/tabs/Tabs.js +12 -2
  101. package/lib/tabs/TabsContent.js +4 -0
  102. package/lib/vant.cjs.js +1202 -1074
  103. package/lib/vant.es.js +1203 -1075
  104. package/lib/vant.js +1212 -1150
  105. package/lib/vant.min.js +1 -1
  106. package/lib/vue-tsx-shim.d.ts +7 -0
  107. package/lib/web-types.json +1189 -1117
  108. package/package.json +2 -2
  109. package/es/empty/Images.d.ts +0 -4
  110. package/es/empty/Images.mjs +0 -271
  111. package/lib/.DS_Store +0 -0
  112. package/lib/action-bar/.DS_Store +0 -0
  113. package/lib/action-bar-button/.DS_Store +0 -0
  114. package/lib/action-bar-icon/.DS_Store +0 -0
  115. package/lib/action-sheet/.DS_Store +0 -0
  116. package/lib/address-edit/.DS_Store +0 -0
  117. package/lib/address-list/.DS_Store +0 -0
  118. package/lib/area/.DS_Store +0 -0
  119. package/lib/badge/.DS_Store +0 -0
  120. package/lib/button/.DS_Store +0 -0
  121. package/lib/calendar/.DS_Store +0 -0
  122. package/lib/card/.DS_Store +0 -0
  123. package/lib/cascader/.DS_Store +0 -0
  124. package/lib/cell/.DS_Store +0 -0
  125. package/lib/cell-group/.DS_Store +0 -0
  126. package/lib/checkbox/.DS_Store +0 -0
  127. package/lib/checkbox-group/.DS_Store +0 -0
  128. package/lib/circle/.DS_Store +0 -0
  129. package/lib/col/.DS_Store +0 -0
  130. package/lib/collapse/.DS_Store +0 -0
  131. package/lib/collapse-item/.DS_Store +0 -0
  132. package/lib/config-provider/.DS_Store +0 -0
  133. package/lib/contact-card/.DS_Store +0 -0
  134. package/lib/contact-edit/.DS_Store +0 -0
  135. package/lib/contact-list/.DS_Store +0 -0
  136. package/lib/count-down/.DS_Store +0 -0
  137. package/lib/coupon/.DS_Store +0 -0
  138. package/lib/coupon-cell/.DS_Store +0 -0
  139. package/lib/coupon-list/.DS_Store +0 -0
  140. package/lib/datetime-picker/.DS_Store +0 -0
  141. package/lib/dialog/.DS_Store +0 -0
  142. package/lib/divider/.DS_Store +0 -0
  143. package/lib/dropdown-item/.DS_Store +0 -0
  144. package/lib/dropdown-menu/.DS_Store +0 -0
  145. package/lib/empty/.DS_Store +0 -0
  146. package/lib/empty/Images.d.ts +0 -4
  147. package/lib/empty/Images.js +0 -290
  148. package/lib/field/.DS_Store +0 -0
  149. package/lib/form/.DS_Store +0 -0
  150. package/lib/grid/.DS_Store +0 -0
  151. package/lib/grid-item/.DS_Store +0 -0
  152. package/lib/icon/.DS_Store +0 -0
  153. package/lib/image/.DS_Store +0 -0
  154. package/lib/image-preview/.DS_Store +0 -0
  155. package/lib/index-anchor/.DS_Store +0 -0
  156. package/lib/index-bar/.DS_Store +0 -0
  157. package/lib/lazyload/.DS_Store +0 -0
  158. package/lib/list/.DS_Store +0 -0
  159. package/lib/loading/.DS_Store +0 -0
  160. package/lib/locale/.DS_Store +0 -0
  161. package/lib/nav-bar/.DS_Store +0 -0
  162. package/lib/notice-bar/.DS_Store +0 -0
  163. package/lib/notify/.DS_Store +0 -0
  164. package/lib/number-keyboard/.DS_Store +0 -0
  165. package/lib/overlay/.DS_Store +0 -0
  166. package/lib/pagination/.DS_Store +0 -0
  167. package/lib/password-input/.DS_Store +0 -0
  168. package/lib/picker/.DS_Store +0 -0
  169. package/lib/popover/.DS_Store +0 -0
  170. package/lib/popup/.DS_Store +0 -0
  171. package/lib/progress/.DS_Store +0 -0
  172. package/lib/pull-refresh/.DS_Store +0 -0
  173. package/lib/radio/.DS_Store +0 -0
  174. package/lib/radio-group/.DS_Store +0 -0
  175. package/lib/rate/.DS_Store +0 -0
  176. package/lib/row/.DS_Store +0 -0
  177. package/lib/search/.DS_Store +0 -0
  178. package/lib/share-sheet/.DS_Store +0 -0
  179. package/lib/sidebar/.DS_Store +0 -0
  180. package/lib/sidebar-item/.DS_Store +0 -0
  181. package/lib/skeleton/.DS_Store +0 -0
  182. package/lib/slider/.DS_Store +0 -0
  183. package/lib/step/.DS_Store +0 -0
  184. package/lib/stepper/.DS_Store +0 -0
  185. package/lib/steps/.DS_Store +0 -0
  186. package/lib/sticky/.DS_Store +0 -0
  187. package/lib/submit-bar/.DS_Store +0 -0
  188. package/lib/swipe/.DS_Store +0 -0
  189. package/lib/swipe-cell/.DS_Store +0 -0
  190. package/lib/swipe-item/.DS_Store +0 -0
  191. package/lib/switch/.DS_Store +0 -0
  192. package/lib/tab/.DS_Store +0 -0
  193. package/lib/tabbar/.DS_Store +0 -0
  194. package/lib/tabbar-item/.DS_Store +0 -0
  195. package/lib/tabs/.DS_Store +0 -0
  196. package/lib/tag/.DS_Store +0 -0
  197. package/lib/toast/.DS_Store +0 -0
  198. package/lib/tree-select/.DS_Store +0 -0
  199. package/lib/uploader/.DS_Store +0 -0
package/README.md CHANGED
@@ -67,10 +67,14 @@ pnpm add vant
67
67
 
68
68
  ```js
69
69
  import { createApp } from 'vue';
70
+ // 1. Import the components you need
70
71
  import { Button } from 'vant';
72
+ // 2. Import the components style
71
73
  import 'vant/lib/index.css';
72
74
 
73
75
  const app = createApp();
76
+
77
+ // 3. Register the components you need
74
78
  app.use(Button);
75
79
  ```
76
80
 
@@ -1,67 +1,64 @@
1
- ### [v3.5.3](https://github.com/vant-ui/vant/compare/v3.5.2...v3.5.3)
1
+ ### [v3.6.1](https://github.com/vant-ui/vant/compare/v3.6.0...v3.6.1)
2
2
 
3
- `2022-07-31`
3
+ `2022-08-24`
4
4
 
5
5
  **Bug Fixes**
6
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)
7
+ - reduce passive event warning of touchstart event [#10954](https://github.com/vant-ui/vant/issues/10954)
8
+ - Tabs: resize not work for swipeable tabs [#10964](https://github.com/vant-ui/vant/issues/10964)
13
9
 
14
10
  **Document**
15
11
 
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)
12
+ - changelog: vant@3.6.0 [667034](https://github.com/vant-ui/vant/commit/667034322ed4e1c39fd014e83d8661a1ff891ee0)
13
+ - NoticeBar: disable swipe drag in demo [#10950](https://github.com/vant-ui/vant/issues/10950)
28
14
 
29
15
  **perf**
30
16
 
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)
17
+ - add correct passive flag to improve scroll performance [#10951](https://github.com/vant-ui/vant/issues/10951)
34
18
 
35
- **refactor**
36
-
37
- - @vant/cli: remove vetur configs [#10866](https://github.com/vant-ui/vant/issues/10866)
38
-
39
- **release**
19
+ **Types**
40
20
 
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)
21
+ - @vant/use: improve useEventListener typing [#10952](https://github.com/vant-ui/vant/issues/10952)
22
+ ### [v3.6.0](https://github.com/vant-ui/vant/compare/v3.5.3...v3.6.0)
44
23
 
45
- `2022-06-26`
24
+ `2022-08-21`
46
25
 
47
26
  **Bug Fixes**
48
27
 
49
- - List: element with `overflow: overlay` style should be considered a scroll container [#10743](https://github.com/vant-ui/vant/issues/10743)
28
+ - @vant/cli: should replace NODE_ENV in vite v3 [#10887](https://github.com/vant-ui/vant/issues/10887)
29
+ - Calendar: content disappeared when hiding [#10910](https://github.com/vant-ui/vant/issues/10910)
30
+ - Calendar: fix reading getFullYear error [#10908](https://github.com/vant-ui/vant/issues/10908)
31
+ - Calendar: reading getFullYear error in some cases [#10909](https://github.com/vant-ui/vant/issues/10909)
32
+ - Empty: generate unique id to avoid render issue [#10943](https://github.com/vant-ui/vant/issues/10943)
33
+ - incorrect tag name in WebStorm [#10946](https://github.com/vant-ui/vant/issues/10946)
34
+ - Popover: can not scroll inside popup [#10949](https://github.com/vant-ui/vant/issues/10949)
35
+ - PullRefresh: remove passive event warning [#10938](https://github.com/vant-ui/vant/issues/10938)
36
+ - Search: --van-search-input-height var not work [#10911](https://github.com/vant-ui/vant/issues/10911)
50
37
 
51
38
  **Document**
52
39
 
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)
40
+ - add import tips [#10941](https://github.com/vant-ui/vant/issues/10941)
41
+ - add tips in advanced-usage.zh-CN.md [#10927](https://github.com/vant-ui/vant/issues/10927)
42
+ - changelog: 3.5.4 [961f70](https://github.com/vant-ui/vant/commit/961f70d523b723c864d99dceb2be1a19ec506d03)
43
+ - changelog: vant@3.5.3 [#10869](https://github.com/vant-ui/vant/issues/10869)
44
+ - Form: fix the type of rule trigger option [#10912](https://github.com/vant-ui/vant/issues/10912)
45
+ - import quick start document [#10945](https://github.com/vant-ui/vant/issues/10945)
46
+ - Search: fix action-text type [#10936](https://github.com/vant-ui/vant/issues/10936)
47
+ - Search: fix action-text type [#10935](https://github.com/vant-ui/vant/issues/10935)
48
+ - Space: add version tip [#10886](https://github.com/vant-ui/vant/issues/10886)
56
49
 
57
50
  **Feature**
58
51
 
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)
52
+ - @vant/use: useClickAway support multiple targets [#10948](https://github.com/vant-ui/vant/issues/10948)
53
+ - Badge: fix the problem mentioned at README. [#10921](https://github.com/vant-ui/vant/issues/10921)
54
+ - ConfigProvider: add z-index prop [#10915](https://github.com/vant-ui/vant/issues/10915)
55
+ - Form: add validateEmpty option of rule [#10913](https://github.com/vant-ui/vant/issues/10913)
56
+ - Popup: add role and tabindex for a11y [#10894](https://github.com/vant-ui/vant/issues/10894)
57
+ - Space: add new component space [#10857](https://github.com/vant-ui/vant/issues/10857)
58
+ - touch-emulator: support .mjs extension [#10888](https://github.com/vant-ui/vant/issues/10888)
64
59
 
65
60
  **release**
66
61
 
67
- - 3.5.2 [52957e](https://github.com/vant-ui/vant/commit/52957ec244f2e33fff7768c1a52e29fc6589019d)
62
+ - @vant/use 1.4.2 [326880](https://github.com/vant-ui/vant/commit/326880a4e19f8ab8ffe6042a8cc968cc03b02616)
63
+ - 3.5.4 [cfdb5c](https://github.com/vant-ui/vant/commit/cfdb5c1fbe496f6a064ab8bebe7f1ae8734490c0)
64
+ - 3.6.0 [8d51f9](https://github.com/vant-ui/vant/commit/8d51f9e08ea5833b4b27077c61727924c9112f0b)
@@ -26,7 +26,7 @@ var stdin_default = defineComponent({
26
26
  content,
27
27
  showZero
28
28
  } = props;
29
- return isDef(content) && content !== "" && (showZero || content !== 0);
29
+ return isDef(content) && content !== "" && (showZero || content !== 0 && content !== "0");
30
30
  };
31
31
  const renderContent = () => {
32
32
  const {
@@ -112,9 +112,6 @@ 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
- }
118
115
  cursor.setDate(1);
119
116
  do {
120
117
  months2.push(new Date(cursor));
@@ -192,7 +189,9 @@ var stdin_default = defineComponent({
192
189
  }
193
190
  if (currentDate.value) {
194
191
  const targetDate = props.type === "single" ? currentDate.value : currentDate.value[0];
195
- scrollToDate(targetDate);
192
+ if (isDate(targetDate)) {
193
+ scrollToDate(targetDate);
194
+ }
196
195
  } else {
197
196
  raf(onScroll);
198
197
  }
@@ -0,0 +1,4 @@
1
+ /** the global z-index is automatically incremented after reading */
2
+ export declare const useGlobalZIndex: () => number;
3
+ /** reset the global z-index */
4
+ export declare const setGlobalZIndex: (val: number) => void;
@@ -0,0 +1,9 @@
1
+ let globalZIndex = 2e3;
2
+ const useGlobalZIndex = () => ++globalZIndex;
3
+ const setGlobalZIndex = (val) => {
4
+ globalZIndex = val;
5
+ };
6
+ export {
7
+ setGlobalZIndex,
8
+ useGlobalZIndex
9
+ };
@@ -1,5 +1,6 @@
1
1
  import { useRect } from "@vant/use";
2
2
  import { ref, onMounted, nextTick } from "vue";
3
+ import { onPopupReopen } from "./on-popup-reopen.mjs";
3
4
  const useHeight = (element, withSafeArea) => {
4
5
  const height = ref();
5
6
  const setHeight = () => {
@@ -13,6 +14,7 @@ const useHeight = (element, withSafeArea) => {
13
14
  }
14
15
  }
15
16
  });
17
+ onPopupReopen(() => nextTick(setHeight));
16
18
  return height;
17
19
  };
18
20
  export {
@@ -6,9 +6,11 @@ let totalLockCount = 0;
6
6
  const BODY_LOCK_CLASS = "van-overflow-hidden";
7
7
  function useLockScroll(rootRef, shouldLock) {
8
8
  const touch = useTouch();
9
+ const DIRECTION_UP = "01";
10
+ const DIRECTION_DOWN = "10";
9
11
  const onTouchMove = (event) => {
10
12
  touch.move(event);
11
- const direction = touch.deltaY.value > 0 ? "10" : "01";
13
+ const direction = touch.deltaY.value > 0 ? DIRECTION_DOWN : DIRECTION_UP;
12
14
  const el = getScrollParent(event.target, rootRef.value);
13
15
  const { scrollHeight, offsetHeight, scrollTop } = el;
14
16
  let status = "11";
@@ -9,6 +9,7 @@ declare const configProviderProps: {
9
9
  type: PropType<keyof HTMLElementTagNameMap>;
10
10
  default: keyof HTMLElementTagNameMap;
11
11
  };
12
+ zIndex: NumberConstructor;
12
13
  themeVars: PropType<Record<string, Numeric>>;
13
14
  iconPrefix: StringConstructor;
14
15
  };
@@ -18,6 +19,7 @@ declare const _default: import("vue").DefineComponent<{
18
19
  type: PropType<keyof HTMLElementTagNameMap>;
19
20
  default: keyof HTMLElementTagNameMap;
20
21
  };
22
+ zIndex: NumberConstructor;
21
23
  themeVars: PropType<Record<string, Numeric>>;
22
24
  iconPrefix: StringConstructor;
23
25
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
@@ -25,6 +27,7 @@ declare const _default: import("vue").DefineComponent<{
25
27
  type: PropType<keyof HTMLElementTagNameMap>;
26
28
  default: keyof HTMLElementTagNameMap;
27
29
  };
30
+ zIndex: NumberConstructor;
28
31
  themeVars: PropType<Record<string, Numeric>>;
29
32
  iconPrefix: StringConstructor;
30
33
  }>>, {
@@ -1,10 +1,12 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
- import { provide, computed, defineComponent } from "vue";
2
+ import { provide, computed, watchEffect, defineComponent } from "vue";
3
3
  import { kebabCase, makeStringProp, createNamespace } from "../utils/index.mjs";
4
+ import { setGlobalZIndex } from "../composables/use-global-z-index.mjs";
4
5
  const [name, bem] = createNamespace("config-provider");
5
6
  const CONFIG_PROVIDER_KEY = Symbol(name);
6
7
  const configProviderProps = {
7
8
  tag: makeStringProp("div"),
9
+ zIndex: Number,
8
10
  themeVars: Object,
9
11
  iconPrefix: String
10
12
  };
@@ -27,6 +29,11 @@ var stdin_default = defineComponent({
27
29
  }
28
30
  });
29
31
  provide(CONFIG_PROVIDER_KEY, props);
32
+ watchEffect(() => {
33
+ if (props.zIndex !== void 0) {
34
+ setGlobalZIndex(props.zIndex);
35
+ }
36
+ });
30
37
  return () => _createVNode(props.tag, {
31
38
  "class": bem(),
32
39
  "style": style.value
@@ -3,6 +3,7 @@ export declare const ConfigProvider: import("../utils").WithInstall<import("vue"
3
3
  type: import("vue").PropType<keyof HTMLElementTagNameMap>;
4
4
  default: keyof HTMLElementTagNameMap;
5
5
  };
6
+ zIndex: NumberConstructor;
6
7
  themeVars: import("vue").PropType<Record<string, import("../utils").Numeric>>;
7
8
  iconPrefix: StringConstructor;
8
9
  }, () => 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<{
@@ -10,6 +11,7 @@ export declare const ConfigProvider: import("../utils").WithInstall<import("vue"
10
11
  type: import("vue").PropType<keyof HTMLElementTagNameMap>;
11
12
  default: keyof HTMLElementTagNameMap;
12
13
  };
14
+ zIndex: NumberConstructor;
13
15
  themeVars: import("vue").PropType<Record<string, import("../utils").Numeric>>;
14
16
  iconPrefix: StringConstructor;
15
17
  }>>, {
@@ -112,7 +112,8 @@ var stdin_default = defineComponent({
112
112
  });
113
113
  useClickAway(root, onClickAway);
114
114
  useEventListener("scroll", onScroll, {
115
- target: scrollParent
115
+ target: scrollParent,
116
+ passive: true
116
117
  });
117
118
  return () => {
118
119
  var _a;
@@ -1,4 +1,4 @@
1
- import { PropType, type ExtractPropTypes } from 'vue';
1
+ import { type PropType, type ExtractPropTypes } from 'vue';
2
2
  import { Numeric } from '../utils';
3
3
  declare const emptyProps: {
4
4
  image: {
@@ -1,14 +1,8 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
2
  import { defineComponent } from "vue";
3
+ import { useId } from "../composables/use-id.mjs";
3
4
  import { getSizeStyle, makeStringProp, createNamespace } from "../utils/index.mjs";
4
- import { renderError, renderSearch, renderNetwork, renderMaterial } from "./Images.mjs";
5
5
  const [name, bem] = createNamespace("empty");
6
- const PRESET_IMAGES = {
7
- error: renderError,
8
- search: renderSearch,
9
- network: renderNetwork,
10
- default: renderMaterial
11
- };
12
6
  const emptyProps = {
13
7
  image: makeStringProp("default"),
14
8
  imageSize: [Number, String, Array],
@@ -20,15 +14,6 @@ var stdin_default = defineComponent({
20
14
  setup(props, {
21
15
  slots
22
16
  }) {
23
- const renderImage = () => {
24
- var _a;
25
- if (slots.image) {
26
- return slots.image();
27
- }
28
- return ((_a = PRESET_IMAGES[props.image]) == null ? void 0 : _a.call(PRESET_IMAGES)) || _createVNode("img", {
29
- "src": props.image
30
- }, null);
31
- };
32
17
  const renderDescription = () => {
33
18
  const description = slots.description ? slots.description() : props.description;
34
19
  if (description) {
@@ -44,6 +29,286 @@ var stdin_default = defineComponent({
44
29
  }, [slots.default()]);
45
30
  }
46
31
  };
32
+ const baseId = useId();
33
+ const getId = (num) => `${baseId}-${num}`;
34
+ const getUrlById = (num) => `url(#${getId(num)})`;
35
+ const renderStop = (color, offset, opacity) => _createVNode("stop", {
36
+ "stop-color": color,
37
+ "offset": `${offset}%`,
38
+ "stop-opacity": opacity
39
+ }, null);
40
+ const renderStops = (fromColor, toColor) => [renderStop(fromColor, 0), renderStop(toColor, 100)];
41
+ const renderShadow = (id) => [_createVNode("defs", null, [_createVNode("radialGradient", {
42
+ "id": getId(id),
43
+ "cx": "50%",
44
+ "cy": "54%",
45
+ "fx": "50%",
46
+ "fy": "54%",
47
+ "r": "297%",
48
+ "gradientTransform": "matrix(-.16 0 0 -.33 .58 .72)"
49
+ }, [renderStop("#EBEDF0", 0), renderStop("#F2F3F5", 100, 0.3)])]), _createVNode("ellipse", {
50
+ "fill": getUrlById(id),
51
+ "opacity": ".8",
52
+ "cx": "80",
53
+ "cy": "140",
54
+ "rx": "46",
55
+ "ry": "8"
56
+ }, null)];
57
+ const renderBuilding = () => [_createVNode("defs", null, [_createVNode("linearGradient", {
58
+ "id": getId("a"),
59
+ "x1": "64%",
60
+ "y1": "100%",
61
+ "x2": "64%"
62
+ }, [renderStop("#FFF", 0, 0.5), renderStop("#F2F3F5", 100)])]), _createVNode("g", {
63
+ "opacity": ".8"
64
+ }, [_createVNode("path", {
65
+ "d": "M36 131V53H16v20H2v58h34z",
66
+ "fill": getUrlById("a")
67
+ }, null), _createVNode("path", {
68
+ "d": "M123 15h22v14h9v77h-31V15z",
69
+ "fill": getUrlById("a")
70
+ }, null)])];
71
+ const renderCloud = () => [_createVNode("defs", null, [_createVNode("linearGradient", {
72
+ "id": getId("b"),
73
+ "x1": "64%",
74
+ "y1": "97%",
75
+ "x2": "64%",
76
+ "y2": "0%"
77
+ }, [renderStop("#F2F3F5", 0, 0.3), renderStop("#F2F3F5", 100)])]), _createVNode("g", {
78
+ "opacity": ".8"
79
+ }, [_createVNode("path", {
80
+ "d": "M87 6c3 0 7 3 8 6a8 8 0 1 1-1 16H80a7 7 0 0 1-8-6c0-4 3-7 6-7 0-5 4-9 9-9Z",
81
+ "fill": getUrlById("b")
82
+ }, null), _createVNode("path", {
83
+ "d": "M19 23c2 0 3 1 4 3 2 0 4 2 4 4a4 4 0 0 1-4 3v1h-7v-1l-1 1c-2 0-3-2-3-4 0-1 1-3 3-3 0-2 2-4 4-4Z",
84
+ "fill": getUrlById("b")
85
+ }, null)])];
86
+ const renderNetwork = () => _createVNode("svg", {
87
+ "viewBox": "0 0 160 160"
88
+ }, [_createVNode("defs", null, [_createVNode("linearGradient", {
89
+ "id": getId(1),
90
+ "x1": "64%",
91
+ "y1": "100%",
92
+ "x2": "64%"
93
+ }, [renderStop("#FFF", 0, 0.5), renderStop("#F2F3F5", 100)]), _createVNode("linearGradient", {
94
+ "id": getId(2),
95
+ "x1": "50%",
96
+ "x2": "50%",
97
+ "y2": "84%"
98
+ }, [renderStop("#EBEDF0", 0), renderStop("#DCDEE0", 100, 0)]), _createVNode("linearGradient", {
99
+ "id": getId(3),
100
+ "x1": "100%",
101
+ "x2": "100%",
102
+ "y2": "100%"
103
+ }, [renderStops("#EAEDF0", "#DCDEE0")]), _createVNode("radialGradient", {
104
+ "id": getId(4),
105
+ "cx": "50%",
106
+ "cy": "0%",
107
+ "fx": "50%",
108
+ "fy": "0%",
109
+ "r": "100%",
110
+ "gradientTransform": "matrix(0 1 -.54 0 .5 -.5)"
111
+ }, [renderStop("#EBEDF0", 0), renderStop("#FFF", 100, 0)])]), _createVNode("g", {
112
+ "fill": "none"
113
+ }, [renderBuilding(), _createVNode("path", {
114
+ "fill": getUrlById(4),
115
+ "d": "M0 139h160v21H0z"
116
+ }, null), _createVNode("path", {
117
+ "d": "M80 54a7 7 0 0 1 3 13v27l-2 2h-2a2 2 0 0 1-2-2V67a7 7 0 0 1 3-13z",
118
+ "fill": getUrlById(2)
119
+ }, null), _createVNode("g", {
120
+ "opacity": ".6",
121
+ "stroke-linecap": "round",
122
+ "stroke-width": "7"
123
+ }, [_createVNode("path", {
124
+ "d": "M64 47a19 19 0 0 0-5 13c0 5 2 10 5 13",
125
+ "stroke": getUrlById(3)
126
+ }, null), _createVNode("path", {
127
+ "d": "M53 36a34 34 0 0 0 0 48",
128
+ "stroke": getUrlById(3)
129
+ }, null), _createVNode("path", {
130
+ "d": "M95 73a19 19 0 0 0 6-13c0-5-2-9-6-13",
131
+ "stroke": getUrlById(3)
132
+ }, null), _createVNode("path", {
133
+ "d": "M106 84a34 34 0 0 0 0-48",
134
+ "stroke": getUrlById(3)
135
+ }, null)]), _createVNode("g", {
136
+ "transform": "translate(31 105)"
137
+ }, [_createVNode("rect", {
138
+ "fill": "#EBEDF0",
139
+ "width": "98",
140
+ "height": "34",
141
+ "rx": "2"
142
+ }, null), _createVNode("rect", {
143
+ "fill": "#FFF",
144
+ "x": "9",
145
+ "y": "8",
146
+ "width": "80",
147
+ "height": "18",
148
+ "rx": "1.1"
149
+ }, null), _createVNode("rect", {
150
+ "fill": "#EBEDF0",
151
+ "x": "15",
152
+ "y": "12",
153
+ "width": "18",
154
+ "height": "6",
155
+ "rx": "1.1"
156
+ }, null)])])]);
157
+ const renderMaterial = () => _createVNode("svg", {
158
+ "viewBox": "0 0 160 160"
159
+ }, [_createVNode("defs", null, [_createVNode("linearGradient", {
160
+ "x1": "50%",
161
+ "x2": "50%",
162
+ "y2": "100%",
163
+ "id": getId(5)
164
+ }, [renderStops("#F2F3F5", "#DCDEE0")]), _createVNode("linearGradient", {
165
+ "x1": "95%",
166
+ "y1": "48%",
167
+ "x2": "5.5%",
168
+ "y2": "51%",
169
+ "id": getId(6)
170
+ }, [renderStops("#EAEDF1", "#DCDEE0")]), _createVNode("linearGradient", {
171
+ "y1": "45%",
172
+ "x2": "100%",
173
+ "y2": "54%",
174
+ "id": getId(7)
175
+ }, [renderStops("#EAEDF1", "#DCDEE0")])]), renderBuilding(), renderCloud(), _createVNode("g", {
176
+ "transform": "translate(36 50)",
177
+ "fill": "none"
178
+ }, [_createVNode("g", {
179
+ "transform": "translate(8)"
180
+ }, [_createVNode("rect", {
181
+ "fill": "#EBEDF0",
182
+ "opacity": ".6",
183
+ "x": "38",
184
+ "y": "13",
185
+ "width": "36",
186
+ "height": "53",
187
+ "rx": "2"
188
+ }, null), _createVNode("rect", {
189
+ "fill": getUrlById(5),
190
+ "width": "64",
191
+ "height": "66",
192
+ "rx": "2"
193
+ }, null), _createVNode("rect", {
194
+ "fill": "#FFF",
195
+ "x": "6",
196
+ "y": "6",
197
+ "width": "52",
198
+ "height": "55",
199
+ "rx": "1"
200
+ }, null), _createVNode("g", {
201
+ "transform": "translate(15 17)",
202
+ "fill": getUrlById(6)
203
+ }, [_createVNode("rect", {
204
+ "width": "34",
205
+ "height": "6",
206
+ "rx": "1"
207
+ }, null), _createVNode("path", {
208
+ "d": "M0 14h34v6H0z"
209
+ }, null), _createVNode("rect", {
210
+ "y": "28",
211
+ "width": "34",
212
+ "height": "6",
213
+ "rx": "1"
214
+ }, null)])]), _createVNode("rect", {
215
+ "fill": getUrlById(7),
216
+ "y": "61",
217
+ "width": "88",
218
+ "height": "28",
219
+ "rx": "1"
220
+ }, null), _createVNode("rect", {
221
+ "fill": "#F7F8FA",
222
+ "x": "29",
223
+ "y": "72",
224
+ "width": "30",
225
+ "height": "6",
226
+ "rx": "1"
227
+ }, null)])]);
228
+ const renderError = () => _createVNode("svg", {
229
+ "viewBox": "0 0 160 160"
230
+ }, [_createVNode("defs", null, [_createVNode("linearGradient", {
231
+ "x1": "50%",
232
+ "x2": "50%",
233
+ "y2": "100%",
234
+ "id": getId(8)
235
+ }, [renderStops("#EAEDF1", "#DCDEE0")])]), renderBuilding(), renderCloud(), renderShadow("c"), _createVNode("path", {
236
+ "d": "m59 60 21 21 21-21h3l9 9v3L92 93l21 21v3l-9 9h-3l-21-21-21 21h-3l-9-9v-3l21-21-21-21v-3l9-9h3Z",
237
+ "fill": getUrlById(8)
238
+ }, null)]);
239
+ const renderSearch = () => _createVNode("svg", {
240
+ "viewBox": "0 0 160 160"
241
+ }, [_createVNode("defs", null, [_createVNode("linearGradient", {
242
+ "x1": "50%",
243
+ "y1": "100%",
244
+ "x2": "50%",
245
+ "id": getId(9)
246
+ }, [renderStops("#EEE", "#D8D8D8")]), _createVNode("linearGradient", {
247
+ "x1": "100%",
248
+ "y1": "50%",
249
+ "y2": "50%",
250
+ "id": getId(10)
251
+ }, [renderStops("#F2F3F5", "#DCDEE0")]), _createVNode("linearGradient", {
252
+ "x1": "50%",
253
+ "x2": "50%",
254
+ "y2": "100%",
255
+ "id": getId(11)
256
+ }, [renderStops("#F2F3F5", "#DCDEE0")]), _createVNode("linearGradient", {
257
+ "x1": "50%",
258
+ "x2": "50%",
259
+ "y2": "100%",
260
+ "id": getId(12)
261
+ }, [renderStops("#FFF", "#F7F8FA")])]), renderBuilding(), renderCloud(), renderShadow("d"), _createVNode("g", {
262
+ "transform": "rotate(-45 113 -4)",
263
+ "fill": "none"
264
+ }, [_createVNode("rect", {
265
+ "fill": getUrlById(9),
266
+ "x": "24",
267
+ "y": "52.8",
268
+ "width": "5.8",
269
+ "height": "19",
270
+ "rx": "1"
271
+ }, null), _createVNode("rect", {
272
+ "fill": getUrlById(10),
273
+ "x": "22.1",
274
+ "y": "67.3",
275
+ "width": "9.9",
276
+ "height": "28",
277
+ "rx": "1"
278
+ }, null), _createVNode("circle", {
279
+ "stroke": getUrlById(11),
280
+ "stroke-width": "8",
281
+ "cx": "27",
282
+ "cy": "27",
283
+ "r": "27"
284
+ }, null), _createVNode("circle", {
285
+ "fill": getUrlById(12),
286
+ "cx": "27",
287
+ "cy": "27",
288
+ "r": "16"
289
+ }, null), _createVNode("path", {
290
+ "d": "M37 7c-8 0-15 5-16 12",
291
+ "stroke": getUrlById(11),
292
+ "stroke-width": "3",
293
+ "opacity": ".5",
294
+ "stroke-linecap": "round",
295
+ "transform": "rotate(45 29 13)"
296
+ }, null)])]);
297
+ const renderImage = () => {
298
+ var _a;
299
+ if (slots.image) {
300
+ return slots.image();
301
+ }
302
+ const PRESET_IMAGES = {
303
+ error: renderError,
304
+ search: renderSearch,
305
+ network: renderNetwork,
306
+ default: renderMaterial
307
+ };
308
+ return ((_a = PRESET_IMAGES[props.image]) == null ? void 0 : _a.call(PRESET_IMAGES)) || _createVNode("img", {
309
+ "src": props.image
310
+ }, null);
311
+ };
47
312
  return () => _createVNode("div", {
48
313
  "class": bem()
49
314
  }, [_createVNode("div", {
@@ -1,7 +1,7 @@
1
1
  import { createTextVNode as _createTextVNode, mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
2
2
  import { ref, watch, provide, computed, nextTick, reactive, onMounted, defineComponent } from "vue";
3
3
  import { isDef, extend, addUnit, toArray, FORM_KEY, numericProp, unknownProp, resetScroll, formatNumber, preventDefault, makeStringProp, makeNumericProp, createNamespace } from "../utils/index.mjs";
4
- import { cutString, runSyncRule, endComposing, mapInputType, startComposing, getRuleMessage, resizeTextarea, getStringLength, runRuleValidator } from "./utils.mjs";
4
+ import { cutString, runSyncRule, endComposing, mapInputType, isEmptyValue, startComposing, getRuleMessage, resizeTextarea, getStringLength, runRuleValidator } from "./utils.mjs";
5
5
  import { cellSharedProps } from "../cell/Cell.mjs";
6
6
  import { CUSTOM_FIELD_INJECTION_KEY, useParent } from "@vant/use";
7
7
  import { useId } from "../composables/use-id.mjs";
@@ -117,6 +117,9 @@ var stdin_default = defineComponent({
117
117
  return;
118
118
  }
119
119
  if (rule.validator) {
120
+ if (isEmptyValue(value) && rule.validateEmpty === false) {
121
+ return;
122
+ }
120
123
  return runRuleValidator(value, rule).then((result) => {
121
124
  if (result && typeof result === "string") {
122
125
  state.status = "failed";
@@ -23,6 +23,7 @@ export declare type FieldRule = {
23
23
  required?: boolean;
24
24
  validator?: FieldRuleValidator;
25
25
  formatter?: FiledRuleFormatter;
26
+ validateEmpty?: boolean;
26
27
  };
27
28
  export declare type FieldValidationStatus = 'passed' | 'failed' | 'unvalidated';
28
29
  export declare type FieldFormSharedProps = 'colon' | 'disabled' | 'readonly' | 'labelWidth' | 'labelAlign' | 'inputAlign' | 'errorMessageAlign';
@@ -1,5 +1,6 @@
1
1
  import { HTMLAttributes, InputHTMLAttributes } from 'vue';
2
2
  import type { FieldRule, FieldType, FieldAutosizeConfig } from './types';
3
+ export declare function isEmptyValue(value: unknown): boolean;
3
4
  export declare function runSyncRule(value: unknown, rule: FieldRule): boolean;
4
5
  export declare function runRuleValidator(value: unknown, rule: FieldRule): Promise<unknown>;
5
6
  export declare function getRuleMessage(value: unknown, rule: FieldRule): string;