vant 4.0.0-rc.3 → 4.0.0-rc.4

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.
package/README.md CHANGED
@@ -92,16 +92,15 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
92
92
  | --- | --- |
93
93
  | [vant-weapp](https://github.com/vant-ui/vant-weapp) | WeChat MiniProgram UI |
94
94
  | [vant-demo](https://github.com/vant-ui/vant-demo) | Collection of Vant demos |
95
- | [vant-cli](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli) | Scaffold for UI library |
96
- | [vant-icons](https://github.com/vant-ui/vant/tree/dev/packages/vant-icons) | Vant icons |
97
- | [vant-touch-emulator](https://github.com/vant-ui/vant/tree/dev/packages/vant-touch-emulator) | Using vant in desktop browsers |
95
+ | [vant-cli](https://github.com/vant-ui/vant/tree/main/packages/vant-cli) | Scaffold for UI library |
96
+ | [vant-icons](https://github.com/vant-ui/vant/tree/main/packages/vant-icons) | Vant icons |
97
+ | [vant-touch-emulator](https://github.com/vant-ui/vant/tree/main/packages/vant-touch-emulator) | Using vant in desktop browsers |
98
98
 
99
99
  ## Community Ecosystem
100
100
 
101
101
  | Project | Description |
102
102
  | --- | --- |
103
103
  | [3lang3/react-vant](https://github.com/3lang3/react-vant) | React mobile UI Components based on Vant |
104
- | [rc-ui-lib](https://github.com/rancui/rc-ui-lib) | React mobile UI Components based on Vant |
105
104
  | [vant-aliapp](https://github.com/ant-move/Vant-Aliapp) | Alipay MiniProgram UI |
106
105
  | [taroify](https://gitee.com/mallfoundry/taroify) | Vant Taro |
107
106
  | [vant-theme](https://github.com/Aisen60/vant-theme) | Online theme preview built on Vant UI |
@@ -112,7 +111,7 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
112
111
 
113
112
  - [Documentation](https://vant-ui.github.io/vant)
114
113
  - [Changelog](https://vant-ui.github.io/vant#/en-US/changelog)
115
- - [Gitter](https://gitter.im/vant-contrib/discuss?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
114
+ - [Discussions](https://github.com/vant-ui/vant/discussions)
116
115
 
117
116
  ## Preview
118
117
 
@@ -1,3 +1,35 @@
1
+ ### [v4.0.0-rc.4](https://github.com/vant-ui/vant/compare/v4.0.0-rc.3...v4.0.0-rc.4)
2
+
3
+ `2022-09-25`
4
+
5
+ **Bug Fixes**
6
+
7
+ - cli: downgrade vite version to fix the website [#11087](https://github.com/vant-ui/vant/issues/11087)
8
+ - cli: should remove light theme class in dark mode [#11039](https://github.com/vant-ui/vant/issues/11039)
9
+ - Tabs: incorrect scroll position in some cases [#11085](https://github.com/vant-ui/vant/issues/11085)
10
+ - Tabs: incorrect scroll position when inited [#11059](https://github.com/vant-ui/vant/issues/11059)
11
+
12
+ **Document**
13
+
14
+ - Cascader: update field-names type [#11052](https://github.com/vant-ui/vant/issues/11052)
15
+ - changelog: vant@4.0.0-rc.3 [#11038](https://github.com/vant-ui/vant/issues/11038)
16
+ - improve dark theme guide [#11040](https://github.com/vant-ui/vant/issues/11040)
17
+ - PickerGroup: fix TimePicker link error [#11053](https://github.com/vant-ui/vant/issues/11053)
18
+ - update links [#11041](https://github.com/vant-ui/vant/issues/11041)
19
+
20
+ **Feature**
21
+
22
+ - Field: add message param to 'end-validate' method [#11080](https://github.com/vant-ui/vant/issues/11080)
23
+
24
+ **perf**
25
+
26
+ - improve the type of setTimeout [#11069](https://github.com/vant-ui/vant/issues/11069)
27
+ - move @vant/icons to dev dependencies [#11075](https://github.com/vant-ui/vant/issues/11075)
28
+
29
+ **release**
30
+
31
+ - @vant/cli 5.0.0-beta.0 [#11082](https://github.com/vant-ui/vant/issues/11082)
32
+ - vant@1.4.3 [#11076](https://github.com/vant-ui/vant/issues/11076)
1
33
  ### [v4.0.0-rc.3](https://github.com/vant-ui/vant/compare/v4.0.0-rc.2...v4.0.0-rc.3)
2
34
 
3
35
  `2022-09-12`
@@ -19,29 +51,9 @@
19
51
  **release**
20
52
 
21
53
  - @vant/popperjs 1.3.0 [16c1f3](https://github.com/vant-ui/vant/commit/16c1f35135d93090ad7b129a73a0569203c3825d)
54
+ - 4.0.0-rc.3 [5509ca](https://github.com/vant-ui/vant/commit/5509ca0d1dec6a819df69295dda2d7b59fbd3328)
22
55
 
23
56
  **Types**
24
57
 
25
58
  - some theme vars can be number type [#11037](https://github.com/vant-ui/vant/issues/11037)
26
59
  - Toast: fix missing global components type [#11033](https://github.com/vant-ui/vant/issues/11033)
27
- ### [v4.0.0-rc.2](https://github.com/vant-ui/vant/compare/v4.0.0-rc.1...v4.0.0-rc.2)
28
-
29
- `2022-09-11`
30
-
31
- **Bug Fixes**
32
-
33
- - attach css variables to :root element [#11026](https://github.com/vant-ui/vant/issues/11026)
34
- - Dialog: incorrect transform behavior [#11028](https://github.com/vant-ui/vant/issues/11028)
35
-
36
- **Document**
37
-
38
- - changelog: vant@4.0.0-rc.1 [#11025](https://github.com/vant-ui/vant/issues/11025)
39
- - fix legacy css variables in demo [b6f2eb](https://github.com/vant-ui/vant/commit/b6f2eb3e2a101e8dbae14d7649f98afa514af539)
40
-
41
- **release**
42
-
43
- - 4.0.0-rc.2 [bcae14](https://github.com/vant-ui/vant/commit/bcae14d7cbfcf623bf56a21a5d51bc5b7f1baa67)
44
-
45
- **style**
46
-
47
- - Empty: fix opacity in dark mode [#11027](https://github.com/vant-ui/vant/issues/11027)
@@ -137,7 +137,8 @@ var stdin_default = defineComponent({
137
137
  state.validateMessage = "";
138
138
  };
139
139
  const endValidate = () => emit("endValidate", {
140
- status: state.status
140
+ status: state.status,
141
+ message: state.validateMessage
141
142
  });
142
143
  const validate = (rules = props.rules) => new Promise((resolve) => {
143
144
  resetValidation();
package/es/index.d.ts CHANGED
@@ -93,4 +93,4 @@ declare namespace _default {
93
93
  }
94
94
  export default _default;
95
95
  export function install(app: any): void;
96
- export const version: "4.0.0-rc.3";
96
+ export const version: "4.0.0-rc.4";
package/es/index.mjs CHANGED
@@ -86,7 +86,7 @@ import { TimePicker } from "./time-picker/index.mjs";
86
86
  import { Toast } from "./toast/index.mjs";
87
87
  import { TreeSelect } from "./tree-select/index.mjs";
88
88
  import { Uploader } from "./uploader/index.mjs";
89
- const version = "4.0.0-rc.3";
89
+ const version = "4.0.0-rc.4";
90
90
  function install(app) {
91
91
  const components = [
92
92
  ActionBar,
@@ -52,7 +52,7 @@ function showNotify(options) {
52
52
  instance.open(options);
53
53
  clearTimeout(timer);
54
54
  if (options.duration > 0) {
55
- timer = window.setTimeout(closeNotify, options.duration);
55
+ timer = setTimeout(closeNotify, options.duration);
56
56
  }
57
57
  return instance;
58
58
  }
package/es/tab/Tab.mjs CHANGED
@@ -2,7 +2,7 @@ import { withDirectives as _withDirectives, vShow as _vShow, createVNode as _cre
2
2
  import { ref, watch, provide, computed, nextTick, defineComponent } from "vue";
3
3
  import { extend, truthProp, unknownProp, numericProp, createNamespace } from "../utils/index.mjs";
4
4
  import { TABS_KEY } from "../tabs/Tabs.mjs";
5
- import { useParent } from "@vant/use";
5
+ import { doubleRaf, useParent } from "@vant/use";
6
6
  import { useId } from "../composables/use-id.mjs";
7
7
  import { useExpose } from "../composables/use-expose.mjs";
8
8
  import { routeProps } from "../composables/use-route.mjs";
@@ -56,6 +56,16 @@ var stdin_default = defineComponent({
56
56
  }
57
57
  return isActive;
58
58
  });
59
+ const hasInactiveClass = ref(!active.value);
60
+ watch(active, (val) => {
61
+ if (val) {
62
+ hasInactiveClass.value = false;
63
+ } else {
64
+ doubleRaf(() => {
65
+ hasInactiveClass.value = true;
66
+ });
67
+ }
68
+ });
59
69
  watch(() => props.title, () => {
60
70
  parent.setLine();
61
71
  parent.scrollIntoView();
@@ -79,7 +89,7 @@ var stdin_default = defineComponent({
79
89
  "id": id,
80
90
  "role": "tabpanel",
81
91
  "class": bem("panel-wrapper", {
82
- inactive: !active.value
92
+ inactive: hasInactiveClass.value
83
93
  }),
84
94
  "tabindex": active.value ? 0 : -1,
85
95
  "aria-hidden": !active.value,
package/es/tabs/Tabs.mjs CHANGED
@@ -133,7 +133,7 @@ var stdin_default = defineComponent({
133
133
  index += diff;
134
134
  }
135
135
  };
136
- const setCurrentIndex = (currentIndex) => {
136
+ const setCurrentIndex = (currentIndex, skipScrollIntoView) => {
137
137
  const newIndex = findAvailableTab(currentIndex);
138
138
  if (!isDef(newIndex)) {
139
139
  return;
@@ -148,11 +148,18 @@ var stdin_default = defineComponent({
148
148
  emit("change", newName, newTab.title);
149
149
  }
150
150
  }
151
+ if (!skipScrollIntoView) {
152
+ scrollIntoView();
153
+ }
154
+ setLine();
155
+ if (stickyFixed && !props.scrollspy) {
156
+ setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
157
+ }
151
158
  };
152
- const setCurrentIndexByName = (name2) => {
159
+ const setCurrentIndexByName = (name2, skipScrollIntoView) => {
153
160
  const matched = children.find((tab, index2) => getTabName(tab, index2) === name2);
154
161
  const index = matched ? children.indexOf(matched) : 0;
155
- setCurrentIndex(index);
162
+ setCurrentIndex(index, skipScrollIntoView);
156
163
  };
157
164
  const scrollToCurrentContent = (immediate = false) => {
158
165
  if (props.scrollspy) {
@@ -279,15 +286,8 @@ var stdin_default = defineComponent({
279
286
  });
280
287
  }
281
288
  });
282
- watch(() => state.currentIndex, () => {
283
- scrollIntoView();
284
- setLine();
285
- if (stickyFixed && !props.scrollspy) {
286
- setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
287
- }
288
- });
289
289
  const init = () => {
290
- setCurrentIndexByName(props.active);
290
+ setCurrentIndexByName(props.active, true);
291
291
  nextTick(() => {
292
292
  state.inited = true;
293
293
  if (wrapRef.value) {
@@ -161,7 +161,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
161
161
  state.validateMessage = "";
162
162
  };
163
163
  const endValidate = () => emit("endValidate", {
164
- status: state.status
164
+ status: state.status,
165
+ message: state.validateMessage
165
166
  });
166
167
  const validate = (rules = props.rules) => new Promise((resolve) => {
167
168
  resetValidation();
package/lib/index.d.ts CHANGED
@@ -93,4 +93,4 @@ declare namespace _default {
93
93
  }
94
94
  export default _default;
95
95
  export function install(app: any): void;
96
- export const version: "4.0.0-rc.3";
96
+ export const version: "4.0.0-rc.4";
package/lib/index.js CHANGED
@@ -200,7 +200,7 @@ __reExport(stdin_exports, require("./time-picker"), module.exports);
200
200
  __reExport(stdin_exports, require("./toast"), module.exports);
201
201
  __reExport(stdin_exports, require("./tree-select"), module.exports);
202
202
  __reExport(stdin_exports, require("./uploader"), module.exports);
203
- const version = "4.0.0-rc.3";
203
+ const version = "4.0.0-rc.4";
204
204
  function install(app) {
205
205
  const components = [
206
206
  import_action_bar.ActionBar,
@@ -83,7 +83,7 @@ function showNotify(options) {
83
83
  instance.open(options);
84
84
  clearTimeout(timer);
85
85
  if (options.duration > 0) {
86
- timer = window.setTimeout(closeNotify, options.duration);
86
+ timer = setTimeout(closeNotify, options.duration);
87
87
  }
88
88
  return instance;
89
89
  }
package/lib/tab/Tab.js CHANGED
@@ -79,6 +79,16 @@ var stdin_default = (0, import_vue2.defineComponent)({
79
79
  }
80
80
  return isActive;
81
81
  });
82
+ const hasInactiveClass = (0, import_vue2.ref)(!active.value);
83
+ (0, import_vue2.watch)(active, (val) => {
84
+ if (val) {
85
+ hasInactiveClass.value = false;
86
+ } else {
87
+ (0, import_use.doubleRaf)(() => {
88
+ hasInactiveClass.value = true;
89
+ });
90
+ }
91
+ });
82
92
  (0, import_vue2.watch)(() => props.title, () => {
83
93
  parent.setLine();
84
94
  parent.scrollIntoView();
@@ -102,7 +112,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
102
112
  "id": id,
103
113
  "role": "tabpanel",
104
114
  "class": bem("panel-wrapper", {
105
- inactive: !active.value
115
+ inactive: hasInactiveClass.value
106
116
  }),
107
117
  "tabindex": active.value ? 0 : -1,
108
118
  "aria-hidden": !active.value,
package/lib/tabs/Tabs.js CHANGED
@@ -163,7 +163,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
163
163
  index += diff;
164
164
  }
165
165
  };
166
- const setCurrentIndex = (currentIndex) => {
166
+ const setCurrentIndex = (currentIndex, skipScrollIntoView) => {
167
167
  const newIndex = findAvailableTab(currentIndex);
168
168
  if (!(0, import_utils.isDef)(newIndex)) {
169
169
  return;
@@ -178,11 +178,18 @@ var stdin_default = (0, import_vue2.defineComponent)({
178
178
  emit("change", newName, newTab.title);
179
179
  }
180
180
  }
181
+ if (!skipScrollIntoView) {
182
+ scrollIntoView();
183
+ }
184
+ setLine();
185
+ if (stickyFixed && !props.scrollspy) {
186
+ (0, import_utils.setRootScrollTop)(Math.ceil((0, import_utils.getElementTop)(root.value) - offsetTopPx.value));
187
+ }
181
188
  };
182
- const setCurrentIndexByName = (name2) => {
189
+ const setCurrentIndexByName = (name2, skipScrollIntoView) => {
183
190
  const matched = children.find((tab, index2) => getTabName(tab, index2) === name2);
184
191
  const index = matched ? children.indexOf(matched) : 0;
185
- setCurrentIndex(index);
192
+ setCurrentIndex(index, skipScrollIntoView);
186
193
  };
187
194
  const scrollToCurrentContent = (immediate = false) => {
188
195
  if (props.scrollspy) {
@@ -309,15 +316,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
309
316
  });
310
317
  }
311
318
  });
312
- (0, import_vue2.watch)(() => state.currentIndex, () => {
313
- scrollIntoView();
314
- setLine();
315
- if (stickyFixed && !props.scrollspy) {
316
- (0, import_utils.setRootScrollTop)(Math.ceil((0, import_utils.getElementTop)(root.value) - offsetTopPx.value));
317
- }
318
- });
319
319
  const init = () => {
320
- setCurrentIndexByName(props.active);
320
+ setCurrentIndexByName(props.active, true);
321
321
  (0, import_vue2.nextTick)(() => {
322
322
  state.inited = true;
323
323
  if (wrapRef.value) {
package/lib/vant.cjs.js CHANGED
@@ -2635,7 +2635,7 @@ var stdin_default$1m = vue.defineComponent({
2635
2635
  index += diff;
2636
2636
  }
2637
2637
  };
2638
- const setCurrentIndex = (currentIndex) => {
2638
+ const setCurrentIndex = (currentIndex, skipScrollIntoView) => {
2639
2639
  const newIndex = findAvailableTab(currentIndex);
2640
2640
  if (!isDef(newIndex)) {
2641
2641
  return;
@@ -2650,11 +2650,18 @@ var stdin_default$1m = vue.defineComponent({
2650
2650
  emit("change", newName, newTab.title);
2651
2651
  }
2652
2652
  }
2653
+ if (!skipScrollIntoView) {
2654
+ scrollIntoView();
2655
+ }
2656
+ setLine();
2657
+ if (stickyFixed && !props.scrollspy) {
2658
+ setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
2659
+ }
2653
2660
  };
2654
- const setCurrentIndexByName = (name2) => {
2661
+ const setCurrentIndexByName = (name2, skipScrollIntoView) => {
2655
2662
  const matched = children.find((tab, index2) => getTabName(tab, index2) === name2);
2656
2663
  const index = matched ? children.indexOf(matched) : 0;
2657
- setCurrentIndex(index);
2664
+ setCurrentIndex(index, skipScrollIntoView);
2658
2665
  };
2659
2666
  const scrollToCurrentContent = (immediate = false) => {
2660
2667
  if (props.scrollspy) {
@@ -2781,15 +2788,8 @@ var stdin_default$1m = vue.defineComponent({
2781
2788
  });
2782
2789
  }
2783
2790
  });
2784
- vue.watch(() => state.currentIndex, () => {
2785
- scrollIntoView();
2786
- setLine();
2787
- if (stickyFixed && !props.scrollspy) {
2788
- setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
2789
- }
2790
- });
2791
2791
  const init = () => {
2792
- setCurrentIndexByName(props.active);
2792
+ setCurrentIndexByName(props.active, true);
2793
2793
  vue.nextTick(() => {
2794
2794
  state.inited = true;
2795
2795
  if (wrapRef.value) {
@@ -2982,6 +2982,16 @@ var stdin_default$1k = vue.defineComponent({
2982
2982
  }
2983
2983
  return isActive;
2984
2984
  });
2985
+ const hasInactiveClass = vue.ref(!active.value);
2986
+ vue.watch(active, (val) => {
2987
+ if (val) {
2988
+ hasInactiveClass.value = false;
2989
+ } else {
2990
+ use.doubleRaf(() => {
2991
+ hasInactiveClass.value = true;
2992
+ });
2993
+ }
2994
+ });
2985
2995
  vue.watch(() => props.title, () => {
2986
2996
  parent.setLine();
2987
2997
  parent.scrollIntoView();
@@ -3005,7 +3015,7 @@ var stdin_default$1k = vue.defineComponent({
3005
3015
  "id": id,
3006
3016
  "role": "tabpanel",
3007
3017
  "class": bem$18("panel-wrapper", {
3008
- inactive: !active.value
3018
+ inactive: hasInactiveClass.value
3009
3019
  }),
3010
3020
  "tabindex": active.value ? 0 : -1,
3011
3021
  "aria-hidden": !active.value,
@@ -3891,7 +3901,8 @@ var stdin_default$1e = vue.defineComponent({
3891
3901
  state.validateMessage = "";
3892
3902
  };
3893
3903
  const endValidate = () => emit("endValidate", {
3894
- status: state.status
3904
+ status: state.status,
3905
+ message: state.validateMessage
3895
3906
  });
3896
3907
  const validate = (rules = props.rules) => new Promise((resolve) => {
3897
3908
  resetValidation();
@@ -10322,7 +10333,7 @@ function showNotify(options) {
10322
10333
  instance.open(options);
10323
10334
  clearTimeout(timer);
10324
10335
  if (options.duration > 0) {
10325
- timer = window.setTimeout(closeNotify, options.duration);
10336
+ timer = setTimeout(closeNotify, options.duration);
10326
10337
  }
10327
10338
  return instance;
10328
10339
  }
@@ -14541,7 +14552,7 @@ const Lazyload = {
14541
14552
  });
14542
14553
  }
14543
14554
  };
14544
- const version = "4.0.0-rc.3";
14555
+ const version = "4.0.0-rc.4";
14545
14556
  function install(app) {
14546
14557
  const components = [
14547
14558
  ActionBar,
package/lib/vant.es.js CHANGED
@@ -2633,7 +2633,7 @@ var stdin_default$1m = defineComponent({
2633
2633
  index += diff;
2634
2634
  }
2635
2635
  };
2636
- const setCurrentIndex = (currentIndex) => {
2636
+ const setCurrentIndex = (currentIndex, skipScrollIntoView) => {
2637
2637
  const newIndex = findAvailableTab(currentIndex);
2638
2638
  if (!isDef(newIndex)) {
2639
2639
  return;
@@ -2648,11 +2648,18 @@ var stdin_default$1m = defineComponent({
2648
2648
  emit("change", newName, newTab.title);
2649
2649
  }
2650
2650
  }
2651
+ if (!skipScrollIntoView) {
2652
+ scrollIntoView();
2653
+ }
2654
+ setLine();
2655
+ if (stickyFixed && !props.scrollspy) {
2656
+ setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
2657
+ }
2651
2658
  };
2652
- const setCurrentIndexByName = (name2) => {
2659
+ const setCurrentIndexByName = (name2, skipScrollIntoView) => {
2653
2660
  const matched = children.find((tab, index2) => getTabName(tab, index2) === name2);
2654
2661
  const index = matched ? children.indexOf(matched) : 0;
2655
- setCurrentIndex(index);
2662
+ setCurrentIndex(index, skipScrollIntoView);
2656
2663
  };
2657
2664
  const scrollToCurrentContent = (immediate = false) => {
2658
2665
  if (props.scrollspy) {
@@ -2779,15 +2786,8 @@ var stdin_default$1m = defineComponent({
2779
2786
  });
2780
2787
  }
2781
2788
  });
2782
- watch(() => state.currentIndex, () => {
2783
- scrollIntoView();
2784
- setLine();
2785
- if (stickyFixed && !props.scrollspy) {
2786
- setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
2787
- }
2788
- });
2789
2789
  const init = () => {
2790
- setCurrentIndexByName(props.active);
2790
+ setCurrentIndexByName(props.active, true);
2791
2791
  nextTick(() => {
2792
2792
  state.inited = true;
2793
2793
  if (wrapRef.value) {
@@ -2980,6 +2980,16 @@ var stdin_default$1k = defineComponent({
2980
2980
  }
2981
2981
  return isActive;
2982
2982
  });
2983
+ const hasInactiveClass = ref(!active.value);
2984
+ watch(active, (val) => {
2985
+ if (val) {
2986
+ hasInactiveClass.value = false;
2987
+ } else {
2988
+ doubleRaf(() => {
2989
+ hasInactiveClass.value = true;
2990
+ });
2991
+ }
2992
+ });
2983
2993
  watch(() => props.title, () => {
2984
2994
  parent.setLine();
2985
2995
  parent.scrollIntoView();
@@ -3003,7 +3013,7 @@ var stdin_default$1k = defineComponent({
3003
3013
  "id": id,
3004
3014
  "role": "tabpanel",
3005
3015
  "class": bem$18("panel-wrapper", {
3006
- inactive: !active.value
3016
+ inactive: hasInactiveClass.value
3007
3017
  }),
3008
3018
  "tabindex": active.value ? 0 : -1,
3009
3019
  "aria-hidden": !active.value,
@@ -3889,7 +3899,8 @@ var stdin_default$1e = defineComponent({
3889
3899
  state.validateMessage = "";
3890
3900
  };
3891
3901
  const endValidate = () => emit("endValidate", {
3892
- status: state.status
3902
+ status: state.status,
3903
+ message: state.validateMessage
3893
3904
  });
3894
3905
  const validate = (rules = props.rules) => new Promise((resolve) => {
3895
3906
  resetValidation();
@@ -10320,7 +10331,7 @@ function showNotify(options) {
10320
10331
  instance.open(options);
10321
10332
  clearTimeout(timer);
10322
10333
  if (options.duration > 0) {
10323
- timer = window.setTimeout(closeNotify, options.duration);
10334
+ timer = setTimeout(closeNotify, options.duration);
10324
10335
  }
10325
10336
  return instance;
10326
10337
  }
@@ -14539,7 +14550,7 @@ const Lazyload = {
14539
14550
  });
14540
14551
  }
14541
14552
  };
14542
- const version = "4.0.0-rc.3";
14553
+ const version = "4.0.0-rc.4";
14543
14554
  function install(app) {
14544
14555
  const components = [
14545
14556
  ActionBar,
package/lib/vant.js CHANGED
@@ -2999,7 +2999,7 @@
2999
2999
  index += diff;
3000
3000
  }
3001
3001
  };
3002
- const setCurrentIndex = (currentIndex) => {
3002
+ const setCurrentIndex = (currentIndex, skipScrollIntoView) => {
3003
3003
  const newIndex = findAvailableTab(currentIndex);
3004
3004
  if (!isDef(newIndex)) {
3005
3005
  return;
@@ -3014,11 +3014,18 @@
3014
3014
  emit("change", newName, newTab.title);
3015
3015
  }
3016
3016
  }
3017
+ if (!skipScrollIntoView) {
3018
+ scrollIntoView();
3019
+ }
3020
+ setLine();
3021
+ if (stickyFixed && !props.scrollspy) {
3022
+ setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
3023
+ }
3017
3024
  };
3018
- const setCurrentIndexByName = (name2) => {
3025
+ const setCurrentIndexByName = (name2, skipScrollIntoView) => {
3019
3026
  const matched = children.find((tab, index2) => getTabName(tab, index2) === name2);
3020
3027
  const index = matched ? children.indexOf(matched) : 0;
3021
- setCurrentIndex(index);
3028
+ setCurrentIndex(index, skipScrollIntoView);
3022
3029
  };
3023
3030
  const scrollToCurrentContent = (immediate = false) => {
3024
3031
  if (props.scrollspy) {
@@ -3145,15 +3152,8 @@
3145
3152
  });
3146
3153
  }
3147
3154
  });
3148
- vue.watch(() => state.currentIndex, () => {
3149
- scrollIntoView();
3150
- setLine();
3151
- if (stickyFixed && !props.scrollspy) {
3152
- setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
3153
- }
3154
- });
3155
3155
  const init = () => {
3156
- setCurrentIndexByName(props.active);
3156
+ setCurrentIndexByName(props.active, true);
3157
3157
  vue.nextTick(() => {
3158
3158
  state.inited = true;
3159
3159
  if (wrapRef.value) {
@@ -3340,6 +3340,16 @@
3340
3340
  }
3341
3341
  return isActive;
3342
3342
  });
3343
+ const hasInactiveClass = vue.ref(!active.value);
3344
+ vue.watch(active, (val) => {
3345
+ if (val) {
3346
+ hasInactiveClass.value = false;
3347
+ } else {
3348
+ doubleRaf(() => {
3349
+ hasInactiveClass.value = true;
3350
+ });
3351
+ }
3352
+ });
3343
3353
  vue.watch(() => props.title, () => {
3344
3354
  parent.setLine();
3345
3355
  parent.scrollIntoView();
@@ -3363,7 +3373,7 @@
3363
3373
  "id": id,
3364
3374
  "role": "tabpanel",
3365
3375
  "class": bem$18("panel-wrapper", {
3366
- inactive: !active.value
3376
+ inactive: hasInactiveClass.value
3367
3377
  }),
3368
3378
  "tabindex": active.value ? 0 : -1,
3369
3379
  "aria-hidden": !active.value,
@@ -4249,7 +4259,8 @@
4249
4259
  state.validateMessage = "";
4250
4260
  };
4251
4261
  const endValidate = () => emit("endValidate", {
4252
- status: state.status
4262
+ status: state.status,
4263
+ message: state.validateMessage
4253
4264
  });
4254
4265
  const validate = (rules = props.rules) => new Promise((resolve) => {
4255
4266
  resetValidation();
@@ -10654,7 +10665,7 @@
10654
10665
  instance.open(options);
10655
10666
  clearTimeout(timer);
10656
10667
  if (options.duration > 0) {
10657
- timer = window.setTimeout(closeNotify, options.duration);
10668
+ timer = setTimeout(closeNotify, options.duration);
10658
10669
  }
10659
10670
  return instance;
10660
10671
  }
@@ -15756,7 +15767,7 @@
15756
15767
  });
15757
15768
  }
15758
15769
  };
15759
- const version = "4.0.0-rc.3";
15770
+ const version = "4.0.0-rc.4";
15760
15771
  function install(app) {
15761
15772
  const components = [
15762
15773
  ActionBar,