vant 3.6.2 → 3.6.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/3.x/packages/vant-cli) | Scaffold for UI library |
96
+ | [vant-icons](https://github.com/vant-ui/vant/tree/3.x/packages/vant-icons) | Vant icons |
97
+ | [vant-touch-emulator](https://github.com/vant-ui/vant/tree/3.x/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,51 +1,46 @@
1
- ### [v3.6.2](https://github.com/vant-ui/vant/compare/v3.6.1...v3.6.2)
1
+ ### [v3.6.4](https://github.com/vant-ui/vant/compare/v3.6.3...v3.6.4)
2
2
 
3
- `2022-09-04`
3
+ `2022-10-07`
4
4
 
5
5
  **Bug Fixes**
6
6
 
7
- - @vant/cli: add passive for global touchstart [#10979](https://github.com/vant-ui/vant/issues/10979)
8
- - area-data: update counties of Daxinganling region [#11000](https://github.com/vant-ui/vant/issues/11000)
9
- - Calendar: allow default date to be maxDate when enable allowSameDay [#10976](https://github.com/vant-ui/vant/issues/10976)
10
- - Calendar: range type defaultDate when set allowSameDay [#10971](https://github.com/vant-ui/vant/issues/10971)
11
- - indexBar: index-bar not positioned correctly when scrolled to the bottom [#10994](https://github.com/vant-ui/vant/issues/10994)
12
- - reduce passive event warning of touchmove event [#10975](https://github.com/vant-ui/vant/issues/10975)
13
- - Swipe: should not prevent touch move when reach edge [#10980](https://github.com/vant-ui/vant/issues/10980)
7
+ - Tabs: incorrect nav scroll animation in some cases [#11116](https://github.com/vant-ui/vant/issues/11116)
8
+ - Tabs: scroll position when using nav-bottom slot [#11115](https://github.com/vant-ui/vant/issues/11115)
14
9
 
15
10
  **Document**
16
11
 
17
- - add function component style guide [#11003](https://github.com/vant-ui/vant/issues/11003)
18
- - add nuxt 3 guide [#10977](https://github.com/vant-ui/vant/issues/10977)
19
- - changelog: 3.6.1 [6a7376](https://github.com/vant-ui/vant/commit/6a7376d15d20bdd1641422ff2cb1c317fc987e89)
20
- - fix card overflow issue [#10988](https://github.com/vant-ui/vant/issues/10988)
21
- - prefer using externalVue in nuxt 3 [#10978](https://github.com/vant-ui/vant/issues/10978)
22
- - update quickstart guide [#11006](https://github.com/vant-ui/vant/issues/11006)
12
+ - add faq of uni-app [#11114](https://github.com/vant-ui/vant/issues/11114)
13
+ - changelog: vant@3.6.3 [#11086](https://github.com/vant-ui/vant/issues/11086)
14
+ - fix website redirect [#11097](https://github.com/vant-ui/vant/issues/11097)
23
15
 
24
- **release**
16
+ **perf**
25
17
 
26
- - @vant/area-data 1.3.2 [94c5af](https://github.com/vant-ui/vant/commit/94c5afe65caa97188fe3a800c52c629c1416ff41)
27
- ### [v3.6.1](https://github.com/vant-ui/vant/compare/v3.6.0...v3.6.1)
18
+ - cli: code split documents [#11111](https://github.com/vant-ui/vant/issues/11111)
19
+ ### [v3.6.3](https://github.com/vant-ui/vant/compare/v3.6.2...v3.6.3)
28
20
 
29
- `2022-08-24`
21
+ `2022-09-24`
30
22
 
31
23
  **Bug Fixes**
32
24
 
33
- - reduce passive event warning of touchstart event [#10954](https://github.com/vant-ui/vant/issues/10954)
34
- - Tabs: resize not work for swipeable tabs [#10964](https://github.com/vant-ui/vant/issues/10964)
25
+ - @vant/cli: failed to build types of sfc [#11012](https://github.com/vant-ui/vant/issues/11012)
26
+ - Tabs: incorrect scroll position in some cases [#11085](https://github.com/vant-ui/vant/issues/11085)
27
+ - Tabs: incorrect scroll position when inited [#11059](https://github.com/vant-ui/vant/issues/11059)
28
+ - utils: avoid getting unexpected value [#11010](https://github.com/vant-ui/vant/issues/11010)
35
29
 
36
30
  **Document**
37
31
 
38
- - changelog: vant@3.6.0 [667034](https://github.com/vant-ui/vant/commit/667034322ed4e1c39fd014e83d8661a1ff891ee0)
39
- - NoticeBar: disable swipe drag in demo [#10950](https://github.com/vant-ui/vant/issues/10950)
32
+ - changelog: @vant/cli 4.0.4 [1b08f8](https://github.com/vant-ui/vant/commit/1b08f84ac6dc84cb3cea93f7816a4fcd5f5c2293)
33
+ - changelog: vant@3.6.2 [#11008](https://github.com/vant-ui/vant/issues/11008)
34
+ - switch dev branch to v4 [99833f](https://github.com/vant-ui/vant/commit/99833f218508d0177c886ba5756536563a926e25)
35
+ - update links [#11041](https://github.com/vant-ui/vant/issues/11041)
36
+ - update links for 3.x branch [2d4782](https://github.com/vant-ui/vant/commit/2d47824ae76a1b14715332d336f8e767c674a334)
40
37
 
41
- **perf**
38
+ **Feature**
42
39
 
43
- - add correct passive flag to improve scroll performance [#10951](https://github.com/vant-ui/vant/issues/10951)
40
+ - Dialog: message-align can be justify [#11014](https://github.com/vant-ui/vant/issues/11014)
41
+ - Image: add block prop [#11022](https://github.com/vant-ui/vant/issues/11022)
44
42
 
45
43
  **release**
46
44
 
47
- - 3.6.1 [2cca63](https://github.com/vant-ui/vant/commit/2cca63080868beb1b64bedddd004d8f13bc64d4a)
48
-
49
- **Types**
50
-
51
- - @vant/use: improve useEventListener typing [#10952](https://github.com/vant-ui/vant/issues/10952)
45
+ - @vant/cli 4.0.4 [f0d3e0](https://github.com/vant-ui/vant/commit/f0d3e04fba4ecb05d7893d290d48089e860e3ee6)
46
+ - 3.6.3 [808ae4](https://github.com/vant-ui/vant/commit/808ae4a0760339e7903df7318b5a5514e328fff4)
@@ -1 +1 @@
1
- :root{--van-dialog-width: 320px;--van-dialog-small-screen-width: 90%;--van-dialog-font-size: var(--van-font-size-lg);--van-dialog-transition: var(--van-animation-duration-base);--van-dialog-border-radius: 16px;--van-dialog-background-color: var(--van-background-color-light);--van-dialog-header-font-weight: var(--van-font-weight-bold);--van-dialog-header-line-height: 24px;--van-dialog-header-padding-top: 26px;--van-dialog-header-isolated-padding: var(--van-padding-lg) 0;--van-dialog-message-padding: var(--van-padding-lg);--van-dialog-message-font-size: var(--van-font-size-md);--van-dialog-message-line-height: var(--van-line-height-md);--van-dialog-message-max-height: 60vh;--van-dialog-has-title-message-text-color: var(--van-gray-7);--van-dialog-has-title-message-padding-top: var(--van-padding-xs);--van-dialog-button-height: 48px;--van-dialog-round-button-height: 36px;--van-dialog-confirm-button-text-color: var(--van-danger-color)}.van-dialog{top:45%;left:50%;width:var(--van-dialog-width);overflow:hidden;font-size:var(--van-dialog-font-size);background:var(--van-dialog-background-color);border-radius:var(--van-dialog-border-radius);-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:var(--van-dialog-transition);transition-property:transform,opacity}@media (max-width: 321px){.van-dialog{width:var(--van-dialog-small-screen-width)}}.van-dialog__header{padding-top:var(--van-dialog-header-padding-top);font-weight:var(--van-dialog-header-font-weight);line-height:var(--van-dialog-header-line-height);text-align:center}.van-dialog__header--isolated{padding:var(--van-dialog-header-isolated-padding)}.van-dialog__content--isolated{display:flex;align-items:center;min-height:104px}.van-dialog__message{flex:1;max-height:var(--van-dialog-message-max-height);padding:26px var(--van-dialog-message-padding);overflow-y:auto;font-size:var(--van-dialog-message-font-size);line-height:var(--van-dialog-message-line-height);white-space:pre-wrap;text-align:center;word-wrap:break-word;-webkit-overflow-scrolling:touch}.van-dialog__message--has-title{padding-top:var(--van-dialog-has-title-message-padding-top);color:var(--van-dialog-has-title-message-text-color)}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__footer{display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.van-dialog__confirm,.van-dialog__cancel{flex:1;height:var(--van-dialog-button-height);margin:0;border:0}.van-dialog__confirm,.van-dialog__confirm:active{color:var(--van-dialog-confirm-button-text-color)}.van-dialog--round-button .van-dialog__footer{position:relative;height:auto;padding:var(--van-padding-xs) var(--van-padding-lg) var(--van-padding-md)}.van-dialog--round-button .van-dialog__message{padding-bottom:var(--van-padding-md);color:var(--van-text-color)}.van-dialog--round-button .van-dialog__confirm,.van-dialog--round-button .van-dialog__cancel{height:var(--van-dialog-round-button-height)}.van-dialog--round-button .van-dialog__confirm{color:var(--van-white)}.van-dialog-bounce-enter-from{transform:translate3d(-50%,-50%,0) scale(.7);opacity:0}.van-dialog-bounce-leave-active{transform:translate3d(-50%,-50%,0) scale(.9);opacity:0}
1
+ :root{--van-dialog-width: 320px;--van-dialog-small-screen-width: 90%;--van-dialog-font-size: var(--van-font-size-lg);--van-dialog-transition: var(--van-animation-duration-base);--van-dialog-border-radius: 16px;--van-dialog-background-color: var(--van-background-color-light);--van-dialog-header-font-weight: var(--van-font-weight-bold);--van-dialog-header-line-height: 24px;--van-dialog-header-padding-top: 26px;--van-dialog-header-isolated-padding: var(--van-padding-lg) 0;--van-dialog-message-padding: var(--van-padding-lg);--van-dialog-message-font-size: var(--van-font-size-md);--van-dialog-message-line-height: var(--van-line-height-md);--van-dialog-message-max-height: 60vh;--van-dialog-has-title-message-text-color: var(--van-gray-7);--van-dialog-has-title-message-padding-top: var(--van-padding-xs);--van-dialog-button-height: 48px;--van-dialog-round-button-height: 36px;--van-dialog-confirm-button-text-color: var(--van-danger-color)}.van-dialog{top:45%;left:50%;width:var(--van-dialog-width);overflow:hidden;font-size:var(--van-dialog-font-size);background:var(--van-dialog-background-color);border-radius:var(--van-dialog-border-radius);-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:var(--van-dialog-transition);transition-property:transform,opacity}@media (max-width: 321px){.van-dialog{width:var(--van-dialog-small-screen-width)}}.van-dialog__header{padding-top:var(--van-dialog-header-padding-top);font-weight:var(--van-dialog-header-font-weight);line-height:var(--van-dialog-header-line-height);text-align:center}.van-dialog__header--isolated{padding:var(--van-dialog-header-isolated-padding)}.van-dialog__content--isolated{display:flex;align-items:center;min-height:104px}.van-dialog__message{flex:1;max-height:var(--van-dialog-message-max-height);padding:26px var(--van-dialog-message-padding);overflow-y:auto;font-size:var(--van-dialog-message-font-size);line-height:var(--van-dialog-message-line-height);white-space:pre-wrap;text-align:center;word-wrap:break-word;-webkit-overflow-scrolling:touch}.van-dialog__message--has-title{padding-top:var(--van-dialog-has-title-message-padding-top);color:var(--van-dialog-has-title-message-text-color)}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__message--justify{text-align:justify}.van-dialog__footer{display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.van-dialog__confirm,.van-dialog__cancel{flex:1;height:var(--van-dialog-button-height);margin:0;border:0}.van-dialog__confirm,.van-dialog__confirm:active{color:var(--van-dialog-confirm-button-text-color)}.van-dialog--round-button .van-dialog__footer{position:relative;height:auto;padding:var(--van-padding-xs) var(--van-padding-lg) var(--van-padding-md)}.van-dialog--round-button .van-dialog__message{padding-bottom:var(--van-padding-md);color:var(--van-text-color)}.van-dialog--round-button .van-dialog__confirm,.van-dialog--round-button .van-dialog__cancel{height:var(--van-dialog-round-button-height)}.van-dialog--round-button .van-dialog__confirm{color:var(--van-white)}.van-dialog-bounce-enter-from{transform:translate3d(-50%,-50%,0) scale(.7);opacity:0}.van-dialog-bounce-leave-active{transform:translate3d(-50%,-50%,0) scale(.9);opacity:0}
@@ -83,6 +83,10 @@
83
83
  &--right {
84
84
  text-align: right;
85
85
  }
86
+
87
+ &--justify {
88
+ text-align: justify;
89
+ }
86
90
  }
87
91
 
88
92
  &__footer {
@@ -4,7 +4,7 @@ import type { Interceptor, Numeric } from '../utils';
4
4
  export declare type DialogTheme = 'default' | 'round-button';
5
5
  export declare type DialogAction = 'confirm' | 'cancel';
6
6
  export declare type DialogMessage = string | (() => JSX.Element);
7
- export declare type DialogMessageAlign = 'left' | 'center' | 'right';
7
+ export declare type DialogMessageAlign = 'left' | 'center' | 'right' | 'justify';
8
8
  export declare type DialogOptions = {
9
9
  title?: string;
10
10
  width?: Numeric;
@@ -7,6 +7,7 @@ declare const imageProps: {
7
7
  fit: PropType<ImageFit>;
8
8
  position: PropType<string>;
9
9
  round: BooleanConstructor;
10
+ block: BooleanConstructor;
10
11
  width: (NumberConstructor | StringConstructor)[];
11
12
  height: (NumberConstructor | StringConstructor)[];
12
13
  radius: (NumberConstructor | StringConstructor)[];
@@ -37,6 +38,7 @@ declare const _default: import("vue").DefineComponent<{
37
38
  fit: PropType<ImageFit>;
38
39
  position: PropType<string>;
39
40
  round: BooleanConstructor;
41
+ block: BooleanConstructor;
40
42
  width: (NumberConstructor | StringConstructor)[];
41
43
  height: (NumberConstructor | StringConstructor)[];
42
44
  radius: (NumberConstructor | StringConstructor)[];
@@ -65,6 +67,7 @@ declare const _default: import("vue").DefineComponent<{
65
67
  fit: PropType<ImageFit>;
66
68
  position: PropType<string>;
67
69
  round: BooleanConstructor;
70
+ block: BooleanConstructor;
68
71
  width: (NumberConstructor | StringConstructor)[];
69
72
  height: (NumberConstructor | StringConstructor)[];
70
73
  radius: (NumberConstructor | StringConstructor)[];
@@ -93,6 +96,7 @@ declare const _default: import("vue").DefineComponent<{
93
96
  }, {
94
97
  round: boolean;
95
98
  showError: boolean;
99
+ block: boolean;
96
100
  lazyLoad: boolean;
97
101
  errorIcon: string;
98
102
  showLoading: boolean;
@@ -9,6 +9,7 @@ const imageProps = {
9
9
  fit: String,
10
10
  position: String,
11
11
  round: Boolean,
12
+ block: Boolean,
12
13
  width: numericProp,
13
14
  height: numericProp,
14
15
  radius: numericProp,
@@ -137,7 +138,8 @@ var stdin_default = defineComponent({
137
138
  var _a;
138
139
  return _createVNode("div", {
139
140
  "class": bem({
140
- round: props.round
141
+ round: props.round,
142
+ block: props.block
141
143
  }),
142
144
  "style": style.value
143
145
  }, [renderImage(), renderPlaceholder(), (_a = slots.default) == null ? void 0 : _a.call(slots)]);
@@ -1 +1 @@
1
- :root{--van-image-placeholder-text-color: var(--van-text-color-2);--van-image-placeholder-font-size: var(--van-font-size-md);--van-image-placeholder-background-color: var(--van-background-color);--van-image-loading-icon-size: 32px;--van-image-loading-icon-color: var(--van-gray-4);--van-image-error-icon-size: 32px;--van-image-error-icon-color: var(--van-gray-4)}.van-image{position:relative;display:inline-block}.van-image--round{overflow:hidden;border-radius:var(--van-border-radius-max)}.van-image--round .van-image__img{border-radius:inherit}.van-image__img,.van-image__error,.van-image__loading{display:block;width:100%;height:100%}.van-image__error,.van-image__loading{position:absolute;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--van-image-placeholder-text-color);font-size:var(--van-image-placeholder-font-size);background:var(--van-image-placeholder-background-color)}.van-image__loading-icon{color:var(--van-image-loading-icon-color);font-size:var(--van-image-loading-icon-size)}.van-image__error-icon{color:var(--van-image-error-icon-color);font-size:var(--van-image-error-icon-size)}
1
+ :root{--van-image-placeholder-text-color: var(--van-text-color-2);--van-image-placeholder-font-size: var(--van-font-size-md);--van-image-placeholder-background-color: var(--van-background-color);--van-image-loading-icon-size: 32px;--van-image-loading-icon-color: var(--van-gray-4);--van-image-error-icon-size: 32px;--van-image-error-icon-color: var(--van-gray-4)}.van-image{position:relative;display:inline-block}.van-image--round{overflow:hidden;border-radius:var(--van-border-radius-max)}.van-image--round .van-image__img{border-radius:inherit}.van-image--block{display:block}.van-image__img,.van-image__error,.van-image__loading{display:block;width:100%;height:100%}.van-image__error,.van-image__loading{position:absolute;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--van-image-placeholder-text-color);font-size:var(--van-image-placeholder-font-size);background:var(--van-image-placeholder-background-color)}.van-image__loading-icon{color:var(--van-image-loading-icon-color);font-size:var(--van-image-loading-icon-size)}.van-image__error-icon{color:var(--van-image-error-icon-color);font-size:var(--van-image-error-icon-size)}
@@ -4,6 +4,7 @@ export declare const Image: import("../utils").WithInstall<import("vue").DefineC
4
4
  fit: import("vue").PropType<import("./Image").ImageFit>;
5
5
  position: import("vue").PropType<string>;
6
6
  round: BooleanConstructor;
7
+ block: BooleanConstructor;
7
8
  width: (NumberConstructor | StringConstructor)[];
8
9
  height: (NumberConstructor | StringConstructor)[];
9
10
  radius: (NumberConstructor | StringConstructor)[];
@@ -32,6 +33,7 @@ export declare const Image: import("../utils").WithInstall<import("vue").DefineC
32
33
  fit: import("vue").PropType<import("./Image").ImageFit>;
33
34
  position: import("vue").PropType<string>;
34
35
  round: BooleanConstructor;
36
+ block: BooleanConstructor;
35
37
  width: (NumberConstructor | StringConstructor)[];
36
38
  height: (NumberConstructor | StringConstructor)[];
37
39
  radius: (NumberConstructor | StringConstructor)[];
@@ -60,6 +62,7 @@ export declare const Image: import("../utils").WithInstall<import("vue").DefineC
60
62
  }, {
61
63
  round: boolean;
62
64
  showError: boolean;
65
+ block: boolean;
63
66
  lazyLoad: boolean;
64
67
  errorIcon: string;
65
68
  showLoading: boolean;
@@ -23,6 +23,10 @@
23
23
  }
24
24
  }
25
25
 
26
+ &--block {
27
+ display: block;
28
+ }
29
+
26
30
  &__img,
27
31
  &__error,
28
32
  &__loading {
package/es/index.d.ts CHANGED
@@ -91,4 +91,4 @@ declare namespace _default {
91
91
  }
92
92
  export default _default;
93
93
  export function install(app: any): void;
94
- export const version: "3.6.2";
94
+ export const version: "3.6.4";
package/es/index.mjs CHANGED
@@ -84,7 +84,7 @@ import { Tag } from "./tag/index.mjs";
84
84
  import { Toast } from "./toast/index.mjs";
85
85
  import { TreeSelect } from "./tree-select/index.mjs";
86
86
  import { Uploader } from "./uploader/index.mjs";
87
- const version = "3.6.2";
87
+ const version = "3.6.4";
88
88
  function install(app) {
89
89
  const components = [
90
90
  ActionBar,
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
@@ -143,7 +143,7 @@ var stdin_default = defineComponent({
143
143
  index += diff;
144
144
  }
145
145
  };
146
- const setCurrentIndex = (currentIndex) => {
146
+ const setCurrentIndex = (currentIndex, skipScrollIntoView) => {
147
147
  const newIndex = findAvailableTab(currentIndex);
148
148
  if (!isDef(newIndex)) {
149
149
  return;
@@ -151,18 +151,27 @@ var stdin_default = defineComponent({
151
151
  const newTab = children[newIndex];
152
152
  const newName = getTabName(newTab, newIndex);
153
153
  const shouldEmitChange = state.currentIndex !== null;
154
- state.currentIndex = newIndex;
154
+ if (state.currentIndex !== newIndex) {
155
+ state.currentIndex = newIndex;
156
+ if (!skipScrollIntoView) {
157
+ scrollIntoView();
158
+ }
159
+ setLine();
160
+ }
155
161
  if (newName !== props.active) {
156
162
  emit("update:active", newName);
157
163
  if (shouldEmitChange) {
158
164
  emit("change", newName, newTab.title);
159
165
  }
160
166
  }
167
+ if (stickyFixed && !props.scrollspy) {
168
+ setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
169
+ }
161
170
  };
162
- const setCurrentIndexByName = (name2) => {
171
+ const setCurrentIndexByName = (name2, skipScrollIntoView) => {
163
172
  const matched = children.find((tab, index2) => getTabName(tab, index2) === name2);
164
173
  const index = matched ? children.indexOf(matched) : 0;
165
- setCurrentIndex(index);
174
+ setCurrentIndex(index, skipScrollIntoView);
166
175
  };
167
176
  const scrollToCurrentContent = (immediate = false) => {
168
177
  if (props.scrollspy) {
@@ -256,13 +265,14 @@ var stdin_default = defineComponent({
256
265
  }
257
266
  };
258
267
  const renderHeader = () => {
259
- var _a2, _b2;
268
+ var _a2, _b2, _c;
260
269
  const {
261
270
  type,
262
- border
271
+ border,
272
+ sticky
263
273
  } = props;
264
- return _createVNode("div", {
265
- "ref": wrapRef,
274
+ const Header = [_createVNode("div", {
275
+ "ref": sticky ? void 0 : wrapRef,
266
276
  "class": [bem("wrap"), {
267
277
  [BORDER_TOP_BOTTOM]: type === "line" && border
268
278
  }]
@@ -275,7 +285,13 @@ var stdin_default = defineComponent({
275
285
  }]),
276
286
  "style": navStyle.value,
277
287
  "aria-orientation": "horizontal"
278
- }, [(_a2 = slots["nav-left"]) == null ? void 0 : _a2.call(slots), renderNav(), renderLine(), (_b2 = slots["nav-right"]) == null ? void 0 : _b2.call(slots)])]);
288
+ }, [(_a2 = slots["nav-left"]) == null ? void 0 : _a2.call(slots), renderNav(), renderLine(), (_b2 = slots["nav-right"]) == null ? void 0 : _b2.call(slots)])]), (_c = slots["nav-bottom"]) == null ? void 0 : _c.call(slots)];
289
+ if (sticky) {
290
+ return _createVNode("div", {
291
+ "ref": wrapRef
292
+ }, [Header]);
293
+ }
294
+ return Header;
279
295
  };
280
296
  watch([() => props.color, windowWidth], setLine);
281
297
  watch(() => props.active, (value) => {
@@ -292,15 +308,8 @@ var stdin_default = defineComponent({
292
308
  });
293
309
  }
294
310
  });
295
- watch(() => state.currentIndex, () => {
296
- scrollIntoView();
297
- setLine();
298
- if (stickyFixed && !props.scrollspy) {
299
- setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
300
- }
301
- });
302
311
  const init = () => {
303
- setCurrentIndexByName(props.active);
312
+ setCurrentIndexByName(props.active, true);
304
313
  nextTick(() => {
305
314
  state.inited = true;
306
315
  if (wrapRef.value) {
@@ -336,37 +345,31 @@ var stdin_default = defineComponent({
336
345
  currentName,
337
346
  scrollIntoView
338
347
  });
339
- return () => {
340
- var _a2;
341
- return _createVNode("div", {
342
- "ref": root,
343
- "class": bem([props.type])
344
- }, [props.sticky ? _createVNode(Sticky, {
345
- "container": root.value,
346
- "offsetTop": offsetTopPx.value,
347
- "onScroll": onStickyScroll
348
- }, {
349
- default: () => {
350
- var _a3;
351
- return [renderHeader(), (_a3 = slots["nav-bottom"]) == null ? void 0 : _a3.call(slots)];
352
- }
353
- }) : [renderHeader(), (_a2 = slots["nav-bottom"]) == null ? void 0 : _a2.call(slots)], _createVNode(TabsContent, {
354
- "ref": contentRef,
355
- "count": children.length,
356
- "inited": state.inited,
357
- "animated": props.animated,
358
- "duration": props.duration,
359
- "swipeable": props.swipeable,
360
- "lazyRender": props.lazyRender,
361
- "currentIndex": state.currentIndex,
362
- "onChange": setCurrentIndex
363
- }, {
364
- default: () => {
365
- var _a3;
366
- return [(_a3 = slots.default) == null ? void 0 : _a3.call(slots)];
367
- }
368
- })]);
369
- };
348
+ return () => _createVNode("div", {
349
+ "ref": root,
350
+ "class": bem([props.type])
351
+ }, [props.sticky ? _createVNode(Sticky, {
352
+ "container": root.value,
353
+ "offsetTop": offsetTopPx.value,
354
+ "onScroll": onStickyScroll
355
+ }, {
356
+ default: () => [renderHeader()]
357
+ }) : renderHeader(), _createVNode(TabsContent, {
358
+ "ref": contentRef,
359
+ "count": children.length,
360
+ "inited": state.inited,
361
+ "animated": props.animated,
362
+ "duration": props.duration,
363
+ "swipeable": props.swipeable,
364
+ "lazyRender": props.lazyRender,
365
+ "currentIndex": state.currentIndex,
366
+ "onChange": setCurrentIndex
367
+ }, {
368
+ default: () => {
369
+ var _a2;
370
+ return [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)];
371
+ }
372
+ })]);
370
373
  }
371
374
  });
372
375
  export {
@@ -1,3 +1,4 @@
1
+ import { isObject } from "./validate.mjs";
1
2
  function noop() {
2
3
  }
3
4
  const extend = Object.assign;
@@ -7,7 +8,7 @@ function get(object, path) {
7
8
  let result = object;
8
9
  keys.forEach((key) => {
9
10
  var _a;
10
- result = (_a = result[key]) != null ? _a : "";
11
+ result = isObject(result) ? (_a = result[key]) != null ? _a : "" : "";
11
12
  });
12
13
  return result;
13
14
  }
@@ -1 +1 @@
1
- :root{--van-dialog-width: 320px;--van-dialog-small-screen-width: 90%;--van-dialog-font-size: var(--van-font-size-lg);--van-dialog-transition: var(--van-animation-duration-base);--van-dialog-border-radius: 16px;--van-dialog-background-color: var(--van-background-color-light);--van-dialog-header-font-weight: var(--van-font-weight-bold);--van-dialog-header-line-height: 24px;--van-dialog-header-padding-top: 26px;--van-dialog-header-isolated-padding: var(--van-padding-lg) 0;--van-dialog-message-padding: var(--van-padding-lg);--van-dialog-message-font-size: var(--van-font-size-md);--van-dialog-message-line-height: var(--van-line-height-md);--van-dialog-message-max-height: 60vh;--van-dialog-has-title-message-text-color: var(--van-gray-7);--van-dialog-has-title-message-padding-top: var(--van-padding-xs);--van-dialog-button-height: 48px;--van-dialog-round-button-height: 36px;--van-dialog-confirm-button-text-color: var(--van-danger-color)}.van-dialog{top:45%;left:50%;width:var(--van-dialog-width);overflow:hidden;font-size:var(--van-dialog-font-size);background:var(--van-dialog-background-color);border-radius:var(--van-dialog-border-radius);-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:var(--van-dialog-transition);transition-property:transform,opacity}@media (max-width: 321px){.van-dialog{width:var(--van-dialog-small-screen-width)}}.van-dialog__header{padding-top:var(--van-dialog-header-padding-top);font-weight:var(--van-dialog-header-font-weight);line-height:var(--van-dialog-header-line-height);text-align:center}.van-dialog__header--isolated{padding:var(--van-dialog-header-isolated-padding)}.van-dialog__content--isolated{display:flex;align-items:center;min-height:104px}.van-dialog__message{flex:1;max-height:var(--van-dialog-message-max-height);padding:26px var(--van-dialog-message-padding);overflow-y:auto;font-size:var(--van-dialog-message-font-size);line-height:var(--van-dialog-message-line-height);white-space:pre-wrap;text-align:center;word-wrap:break-word;-webkit-overflow-scrolling:touch}.van-dialog__message--has-title{padding-top:var(--van-dialog-has-title-message-padding-top);color:var(--van-dialog-has-title-message-text-color)}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__footer{display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.van-dialog__confirm,.van-dialog__cancel{flex:1;height:var(--van-dialog-button-height);margin:0;border:0}.van-dialog__confirm,.van-dialog__confirm:active{color:var(--van-dialog-confirm-button-text-color)}.van-dialog--round-button .van-dialog__footer{position:relative;height:auto;padding:var(--van-padding-xs) var(--van-padding-lg) var(--van-padding-md)}.van-dialog--round-button .van-dialog__message{padding-bottom:var(--van-padding-md);color:var(--van-text-color)}.van-dialog--round-button .van-dialog__confirm,.van-dialog--round-button .van-dialog__cancel{height:var(--van-dialog-round-button-height)}.van-dialog--round-button .van-dialog__confirm{color:var(--van-white)}.van-dialog-bounce-enter-from{transform:translate3d(-50%,-50%,0) scale(.7);opacity:0}.van-dialog-bounce-leave-active{transform:translate3d(-50%,-50%,0) scale(.9);opacity:0}
1
+ :root{--van-dialog-width: 320px;--van-dialog-small-screen-width: 90%;--van-dialog-font-size: var(--van-font-size-lg);--van-dialog-transition: var(--van-animation-duration-base);--van-dialog-border-radius: 16px;--van-dialog-background-color: var(--van-background-color-light);--van-dialog-header-font-weight: var(--van-font-weight-bold);--van-dialog-header-line-height: 24px;--van-dialog-header-padding-top: 26px;--van-dialog-header-isolated-padding: var(--van-padding-lg) 0;--van-dialog-message-padding: var(--van-padding-lg);--van-dialog-message-font-size: var(--van-font-size-md);--van-dialog-message-line-height: var(--van-line-height-md);--van-dialog-message-max-height: 60vh;--van-dialog-has-title-message-text-color: var(--van-gray-7);--van-dialog-has-title-message-padding-top: var(--van-padding-xs);--van-dialog-button-height: 48px;--van-dialog-round-button-height: 36px;--van-dialog-confirm-button-text-color: var(--van-danger-color)}.van-dialog{top:45%;left:50%;width:var(--van-dialog-width);overflow:hidden;font-size:var(--van-dialog-font-size);background:var(--van-dialog-background-color);border-radius:var(--van-dialog-border-radius);-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:var(--van-dialog-transition);transition-property:transform,opacity}@media (max-width: 321px){.van-dialog{width:var(--van-dialog-small-screen-width)}}.van-dialog__header{padding-top:var(--van-dialog-header-padding-top);font-weight:var(--van-dialog-header-font-weight);line-height:var(--van-dialog-header-line-height);text-align:center}.van-dialog__header--isolated{padding:var(--van-dialog-header-isolated-padding)}.van-dialog__content--isolated{display:flex;align-items:center;min-height:104px}.van-dialog__message{flex:1;max-height:var(--van-dialog-message-max-height);padding:26px var(--van-dialog-message-padding);overflow-y:auto;font-size:var(--van-dialog-message-font-size);line-height:var(--van-dialog-message-line-height);white-space:pre-wrap;text-align:center;word-wrap:break-word;-webkit-overflow-scrolling:touch}.van-dialog__message--has-title{padding-top:var(--van-dialog-has-title-message-padding-top);color:var(--van-dialog-has-title-message-text-color)}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__message--justify{text-align:justify}.van-dialog__footer{display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.van-dialog__confirm,.van-dialog__cancel{flex:1;height:var(--van-dialog-button-height);margin:0;border:0}.van-dialog__confirm,.van-dialog__confirm:active{color:var(--van-dialog-confirm-button-text-color)}.van-dialog--round-button .van-dialog__footer{position:relative;height:auto;padding:var(--van-padding-xs) var(--van-padding-lg) var(--van-padding-md)}.van-dialog--round-button .van-dialog__message{padding-bottom:var(--van-padding-md);color:var(--van-text-color)}.van-dialog--round-button .van-dialog__confirm,.van-dialog--round-button .van-dialog__cancel{height:var(--van-dialog-round-button-height)}.van-dialog--round-button .van-dialog__confirm{color:var(--van-white)}.van-dialog-bounce-enter-from{transform:translate3d(-50%,-50%,0) scale(.7);opacity:0}.van-dialog-bounce-leave-active{transform:translate3d(-50%,-50%,0) scale(.9);opacity:0}
@@ -83,6 +83,10 @@
83
83
  &--right {
84
84
  text-align: right;
85
85
  }
86
+
87
+ &--justify {
88
+ text-align: justify;
89
+ }
86
90
  }
87
91
 
88
92
  &__footer {
@@ -4,7 +4,7 @@ import type { Interceptor, Numeric } from '../utils';
4
4
  export declare type DialogTheme = 'default' | 'round-button';
5
5
  export declare type DialogAction = 'confirm' | 'cancel';
6
6
  export declare type DialogMessage = string | (() => JSX.Element);
7
- export declare type DialogMessageAlign = 'left' | 'center' | 'right';
7
+ export declare type DialogMessageAlign = 'left' | 'center' | 'right' | 'justify';
8
8
  export declare type DialogOptions = {
9
9
  title?: string;
10
10
  width?: Numeric;
@@ -7,6 +7,7 @@ declare const imageProps: {
7
7
  fit: PropType<ImageFit>;
8
8
  position: PropType<string>;
9
9
  round: BooleanConstructor;
10
+ block: BooleanConstructor;
10
11
  width: (NumberConstructor | StringConstructor)[];
11
12
  height: (NumberConstructor | StringConstructor)[];
12
13
  radius: (NumberConstructor | StringConstructor)[];
@@ -37,6 +38,7 @@ declare const _default: import("vue").DefineComponent<{
37
38
  fit: PropType<ImageFit>;
38
39
  position: PropType<string>;
39
40
  round: BooleanConstructor;
41
+ block: BooleanConstructor;
40
42
  width: (NumberConstructor | StringConstructor)[];
41
43
  height: (NumberConstructor | StringConstructor)[];
42
44
  radius: (NumberConstructor | StringConstructor)[];
@@ -65,6 +67,7 @@ declare const _default: import("vue").DefineComponent<{
65
67
  fit: PropType<ImageFit>;
66
68
  position: PropType<string>;
67
69
  round: BooleanConstructor;
70
+ block: BooleanConstructor;
68
71
  width: (NumberConstructor | StringConstructor)[];
69
72
  height: (NumberConstructor | StringConstructor)[];
70
73
  radius: (NumberConstructor | StringConstructor)[];
@@ -93,6 +96,7 @@ declare const _default: import("vue").DefineComponent<{
93
96
  }, {
94
97
  round: boolean;
95
98
  showError: boolean;
99
+ block: boolean;
96
100
  lazyLoad: boolean;
97
101
  errorIcon: string;
98
102
  showLoading: boolean;
@@ -31,6 +31,7 @@ const imageProps = {
31
31
  fit: String,
32
32
  position: String,
33
33
  round: Boolean,
34
+ block: Boolean,
34
35
  width: import_utils.numericProp,
35
36
  height: import_utils.numericProp,
36
37
  radius: import_utils.numericProp,
@@ -159,7 +160,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
159
160
  var _a;
160
161
  return (0, import_vue.createVNode)("div", {
161
162
  "class": bem({
162
- round: props.round
163
+ round: props.round,
164
+ block: props.block
163
165
  }),
164
166
  "style": style.value
165
167
  }, [renderImage(), renderPlaceholder(), (_a = slots.default) == null ? void 0 : _a.call(slots)]);
@@ -1 +1 @@
1
- :root{--van-image-placeholder-text-color: var(--van-text-color-2);--van-image-placeholder-font-size: var(--van-font-size-md);--van-image-placeholder-background-color: var(--van-background-color);--van-image-loading-icon-size: 32px;--van-image-loading-icon-color: var(--van-gray-4);--van-image-error-icon-size: 32px;--van-image-error-icon-color: var(--van-gray-4)}.van-image{position:relative;display:inline-block}.van-image--round{overflow:hidden;border-radius:var(--van-border-radius-max)}.van-image--round .van-image__img{border-radius:inherit}.van-image__img,.van-image__error,.van-image__loading{display:block;width:100%;height:100%}.van-image__error,.van-image__loading{position:absolute;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--van-image-placeholder-text-color);font-size:var(--van-image-placeholder-font-size);background:var(--van-image-placeholder-background-color)}.van-image__loading-icon{color:var(--van-image-loading-icon-color);font-size:var(--van-image-loading-icon-size)}.van-image__error-icon{color:var(--van-image-error-icon-color);font-size:var(--van-image-error-icon-size)}
1
+ :root{--van-image-placeholder-text-color: var(--van-text-color-2);--van-image-placeholder-font-size: var(--van-font-size-md);--van-image-placeholder-background-color: var(--van-background-color);--van-image-loading-icon-size: 32px;--van-image-loading-icon-color: var(--van-gray-4);--van-image-error-icon-size: 32px;--van-image-error-icon-color: var(--van-gray-4)}.van-image{position:relative;display:inline-block}.van-image--round{overflow:hidden;border-radius:var(--van-border-radius-max)}.van-image--round .van-image__img{border-radius:inherit}.van-image--block{display:block}.van-image__img,.van-image__error,.van-image__loading{display:block;width:100%;height:100%}.van-image__error,.van-image__loading{position:absolute;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--van-image-placeholder-text-color);font-size:var(--van-image-placeholder-font-size);background:var(--van-image-placeholder-background-color)}.van-image__loading-icon{color:var(--van-image-loading-icon-color);font-size:var(--van-image-loading-icon-size)}.van-image__error-icon{color:var(--van-image-error-icon-color);font-size:var(--van-image-error-icon-size)}
@@ -4,6 +4,7 @@ export declare const Image: import("../utils").WithInstall<import("vue").DefineC
4
4
  fit: import("vue").PropType<import("./Image").ImageFit>;
5
5
  position: import("vue").PropType<string>;
6
6
  round: BooleanConstructor;
7
+ block: BooleanConstructor;
7
8
  width: (NumberConstructor | StringConstructor)[];
8
9
  height: (NumberConstructor | StringConstructor)[];
9
10
  radius: (NumberConstructor | StringConstructor)[];
@@ -32,6 +33,7 @@ export declare const Image: import("../utils").WithInstall<import("vue").DefineC
32
33
  fit: import("vue").PropType<import("./Image").ImageFit>;
33
34
  position: import("vue").PropType<string>;
34
35
  round: BooleanConstructor;
36
+ block: BooleanConstructor;
35
37
  width: (NumberConstructor | StringConstructor)[];
36
38
  height: (NumberConstructor | StringConstructor)[];
37
39
  radius: (NumberConstructor | StringConstructor)[];
@@ -60,6 +62,7 @@ export declare const Image: import("../utils").WithInstall<import("vue").DefineC
60
62
  }, {
61
63
  round: boolean;
62
64
  showError: boolean;
65
+ block: boolean;
63
66
  lazyLoad: boolean;
64
67
  errorIcon: string;
65
68
  showLoading: boolean;
@@ -23,6 +23,10 @@
23
23
  }
24
24
  }
25
25
 
26
+ &--block {
27
+ display: block;
28
+ }
29
+
26
30
  &__img,
27
31
  &__error,
28
32
  &__loading {