vant 3.5.2 → 3.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -13
- package/changelog.generated.md +67 -0
- package/es/button/index.less +1 -1
- package/es/calendar/Calendar.mjs +3 -1
- package/es/calendar/types.d.ts +1 -0
- package/es/cell/Cell.d.ts +1 -1
- package/es/cell/index.d.ts +1 -1
- package/es/collapse/Collapse.d.ts +8 -1
- package/es/collapse/Collapse.mjs +28 -1
- package/es/collapse/index.d.ts +1 -1
- package/es/collapse-item/CollapseItem.d.ts +1 -1
- package/es/collapse-item/CollapseItem.mjs +3 -1
- package/es/collapse-item/index.d.ts +1 -1
- package/es/collapse-item/index.less +1 -1
- package/es/composables/use-height.d.ts +1 -1
- package/es/composables/use-height.mjs +6 -2
- package/es/composables/use-placeholder.mjs +1 -1
- package/es/dialog/Dialog.d.ts +1 -1
- package/es/field/Field.d.ts +1 -1
- package/es/field/index.d.ts +1 -1
- package/es/field/index.less +1 -1
- package/es/grid-item/index.less +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/locale/index.d.ts +1 -1
- package/es/popover/Popover.mjs +17 -18
- package/es/sidebar-item/index.less +1 -1
- package/es/swipe/index.less +1 -1
- package/es/switch/index.less +1 -1
- package/es/toast/index.less +1 -1
- package/es/uploader/Uploader.mjs +1 -1
- package/es/utils/basic.d.ts +3 -3
- package/es/utils/create.d.ts +1 -1
- package/lib/.DS_Store +0 -0
- package/lib/action-bar/.DS_Store +0 -0
- package/lib/action-bar-button/.DS_Store +0 -0
- package/lib/action-bar-icon/.DS_Store +0 -0
- package/lib/action-sheet/.DS_Store +0 -0
- package/lib/address-edit/.DS_Store +0 -0
- package/lib/address-list/.DS_Store +0 -0
- package/lib/area/.DS_Store +0 -0
- package/lib/badge/.DS_Store +0 -0
- package/lib/button/.DS_Store +0 -0
- package/lib/button/index.less +1 -1
- package/lib/calendar/.DS_Store +0 -0
- package/lib/calendar/Calendar.js +3 -1
- package/lib/calendar/types.d.ts +1 -0
- package/lib/card/.DS_Store +0 -0
- package/lib/cascader/.DS_Store +0 -0
- package/lib/cell/.DS_Store +0 -0
- package/lib/cell/Cell.d.ts +1 -1
- package/lib/cell/index.d.ts +1 -1
- package/lib/cell-group/.DS_Store +0 -0
- package/lib/checkbox/.DS_Store +0 -0
- package/lib/checkbox-group/.DS_Store +0 -0
- package/lib/circle/.DS_Store +0 -0
- package/lib/col/.DS_Store +0 -0
- package/lib/collapse/.DS_Store +0 -0
- package/lib/collapse/Collapse.d.ts +8 -1
- package/lib/collapse/Collapse.js +28 -1
- package/lib/collapse/index.d.ts +1 -1
- package/lib/collapse-item/.DS_Store +0 -0
- package/lib/collapse-item/CollapseItem.d.ts +1 -1
- package/lib/collapse-item/CollapseItem.js +3 -1
- package/lib/collapse-item/index.d.ts +1 -1
- package/lib/collapse-item/index.less +1 -1
- package/lib/composables/use-height.d.ts +1 -1
- package/lib/composables/use-height.js +6 -2
- package/lib/composables/use-placeholder.js +1 -1
- package/lib/config-provider/.DS_Store +0 -0
- package/lib/contact-card/.DS_Store +0 -0
- package/lib/contact-edit/.DS_Store +0 -0
- package/lib/contact-list/.DS_Store +0 -0
- package/lib/count-down/.DS_Store +0 -0
- package/lib/coupon/.DS_Store +0 -0
- package/lib/coupon-cell/.DS_Store +0 -0
- package/lib/coupon-list/.DS_Store +0 -0
- package/lib/datetime-picker/.DS_Store +0 -0
- package/lib/dialog/.DS_Store +0 -0
- package/lib/dialog/Dialog.d.ts +1 -1
- package/lib/divider/.DS_Store +0 -0
- package/lib/dropdown-item/.DS_Store +0 -0
- package/lib/dropdown-menu/.DS_Store +0 -0
- package/lib/empty/.DS_Store +0 -0
- package/lib/field/.DS_Store +0 -0
- package/lib/field/Field.d.ts +1 -1
- package/lib/field/index.d.ts +1 -1
- package/lib/field/index.less +1 -1
- package/lib/form/.DS_Store +0 -0
- package/lib/grid/.DS_Store +0 -0
- package/lib/grid-item/.DS_Store +0 -0
- package/lib/grid-item/index.less +1 -1
- package/lib/icon/.DS_Store +0 -0
- package/lib/image/.DS_Store +0 -0
- package/lib/image-preview/.DS_Store +0 -0
- package/lib/index-anchor/.DS_Store +0 -0
- package/lib/index-bar/.DS_Store +0 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/lazyload/.DS_Store +0 -0
- package/lib/list/.DS_Store +0 -0
- package/lib/loading/.DS_Store +0 -0
- package/lib/locale/.DS_Store +0 -0
- package/lib/locale/index.d.ts +1 -1
- package/lib/nav-bar/.DS_Store +0 -0
- package/lib/notice-bar/.DS_Store +0 -0
- package/lib/notify/.DS_Store +0 -0
- package/lib/number-keyboard/.DS_Store +0 -0
- package/lib/overlay/.DS_Store +0 -0
- package/lib/pagination/.DS_Store +0 -0
- package/lib/password-input/.DS_Store +0 -0
- package/lib/picker/.DS_Store +0 -0
- package/lib/popover/.DS_Store +0 -0
- package/lib/popover/Popover.js +17 -18
- package/lib/popup/.DS_Store +0 -0
- package/lib/progress/.DS_Store +0 -0
- package/lib/pull-refresh/.DS_Store +0 -0
- package/lib/radio/.DS_Store +0 -0
- package/lib/radio-group/.DS_Store +0 -0
- package/lib/rate/.DS_Store +0 -0
- package/lib/row/.DS_Store +0 -0
- package/lib/search/.DS_Store +0 -0
- package/lib/share-sheet/.DS_Store +0 -0
- package/lib/sidebar/.DS_Store +0 -0
- package/lib/sidebar-item/.DS_Store +0 -0
- package/lib/sidebar-item/index.less +1 -1
- package/lib/skeleton/.DS_Store +0 -0
- package/lib/slider/.DS_Store +0 -0
- package/lib/step/.DS_Store +0 -0
- package/lib/stepper/.DS_Store +0 -0
- package/lib/steps/.DS_Store +0 -0
- package/lib/sticky/.DS_Store +0 -0
- package/lib/submit-bar/.DS_Store +0 -0
- package/lib/swipe/.DS_Store +0 -0
- package/lib/swipe/index.less +1 -1
- package/lib/swipe-cell/.DS_Store +0 -0
- package/lib/swipe-item/.DS_Store +0 -0
- package/lib/switch/.DS_Store +0 -0
- package/lib/switch/index.less +1 -1
- package/lib/tab/.DS_Store +0 -0
- package/lib/tabbar/.DS_Store +0 -0
- package/lib/tabbar-item/.DS_Store +0 -0
- package/lib/tabs/.DS_Store +0 -0
- package/lib/tag/.DS_Store +0 -0
- package/lib/toast/.DS_Store +0 -0
- package/lib/toast/index.less +1 -1
- package/lib/tree-select/.DS_Store +0 -0
- package/lib/uploader/.DS_Store +0 -0
- package/lib/uploader/Uploader.js +1 -1
- package/lib/utils/basic.d.ts +3 -3
- package/lib/utils/create.d.ts +1 -1
- package/lib/vant.cjs.js +136 -30
- package/lib/vant.es.js +224 -28
- package/lib/vant.js +133 -27
- package/lib/vant.min.js +1 -1
- package/{vetur → lib}/web-types.json +1369 -1369
- package/package.json +9 -14
- package/vetur/attributes.json +0 -3482
- package/vetur/tags.json +0 -1204
package/README.md
CHANGED
@@ -4,21 +4,20 @@
|
|
4
4
|
|
5
5
|
<h1 align="center">Vant</h1>
|
6
6
|
|
7
|
-
<p align="center">Mobile UI Components built on Vue</p>
|
7
|
+
<p align="center">Lightweight Mobile UI Components built on Vue</p>
|
8
8
|
|
9
9
|
<p align="center">
|
10
10
|
<img src="https://img.shields.io/npm/v/vant?style=flat-square" alt="npm version" />
|
11
|
-
<img src="https://img.shields.io/github/workflow/status/
|
12
|
-
<img src="https://img.shields.io/codecov/c/github/
|
11
|
+
<img src="https://img.shields.io/github/workflow/status/vant-ui/vant/CI/dev?style=flat-square" alt="CI Status" />
|
12
|
+
<img src="https://img.shields.io/codecov/c/github/vant-ui/vant/dev.svg?style=flat-square&color=#4fc08d" alt="Coverage Status" />
|
13
13
|
<img src="https://img.shields.io/npm/dm/vant.svg?style=flat-square&color=#4fc08d" alt="downloads" />
|
14
|
-
<img src="https://img.shields.io/jsdelivr/npm/hm/vant?style=flat-square" alt="Jsdelivr Hits">
|
15
14
|
<img src="https://img.badgesize.io/https://unpkg.com/vant@3/lib/vant.min.js?compression=gzip&style=flat-square&label=gzip%20size&color=#4fc08d" alt="Gzip Size" />
|
16
15
|
</p>
|
17
16
|
|
18
17
|
<p align="center">
|
19
18
|
🔥 <a href="https://vant-contrib.gitee.io/vant">文档网站(国内)</a>
|
20
19
|
|
21
|
-
🌈 <a href="https://
|
20
|
+
🌈 <a href="https://vant-ui.github.io/vant">文档网站(GitHub)</a>
|
22
21
|
|
23
22
|
🇨🇳 <a href="./README.zh-CN.md">中文版介绍</a>
|
24
23
|
</p>
|
@@ -29,6 +28,7 @@
|
|
29
28
|
|
30
29
|
- 🚀 1KB Component average size (min+gzip)
|
31
30
|
- 🚀 70+ High quality components
|
31
|
+
- 🚀 Zero third-party dependencies
|
32
32
|
- 💪 90%+ Unit test coverage
|
33
33
|
- 💪 Written in TypeScript
|
34
34
|
- 📖 Extensive documentation and demos
|
@@ -74,7 +74,7 @@ const app = createApp();
|
|
74
74
|
app.use(Button);
|
75
75
|
```
|
76
76
|
|
77
|
-
See more in [Quickstart](https://
|
77
|
+
See more in [Quickstart](https://vant-ui.github.io/vant#/en-US/quickstart).
|
78
78
|
|
79
79
|
## Browser Support
|
80
80
|
|
@@ -86,11 +86,11 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
|
|
86
86
|
|
87
87
|
| Project | Description |
|
88
88
|
| --- | --- |
|
89
|
-
| [vant-weapp](https://github.com/
|
89
|
+
| [vant-weapp](https://github.com/vant-ui/vant-weapp) | WeChat MiniProgram UI |
|
90
90
|
| [vant-demo](https://github.com/vant-ui/vant-demo) | Collection of Vant demos |
|
91
|
-
| [vant-cli](https://github.com/
|
92
|
-
| [vant-icons](https://github.com/
|
93
|
-
| [vant-touch-emulator](https://github.com/
|
91
|
+
| [vant-cli](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli) | Scaffold for UI library |
|
92
|
+
| [vant-icons](https://github.com/vant-ui/vant/tree/dev/packages/vant-icons) | Vant icons |
|
93
|
+
| [vant-touch-emulator](https://github.com/vant-ui/vant/tree/dev/packages/vant-touch-emulator) | Using vant in desktop browsers |
|
94
94
|
|
95
95
|
## Community Ecosystem
|
96
96
|
|
@@ -106,8 +106,8 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
|
|
106
106
|
|
107
107
|
## Links
|
108
108
|
|
109
|
-
- [Documentation](https://
|
110
|
-
- [Changelog](https://
|
109
|
+
- [Documentation](https://vant-ui.github.io/vant)
|
110
|
+
- [Changelog](https://vant-ui.github.io/vant#/en-US/changelog)
|
111
111
|
- [Gitter](https://gitter.im/vant-contrib/discuss?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
|
112
112
|
|
113
113
|
## Preview
|
@@ -128,7 +128,7 @@ Core contributors of Vant and Vant Weapp:
|
|
128
128
|
|
129
129
|
Thanks to the following friends for their contributions to Vant:
|
130
130
|
|
131
|
-
<a href="https://github.com/
|
131
|
+
<a href="https://github.com/vant-ui/vant/graphs/contributors">
|
132
132
|
<img src="https://opencollective.com/vant/contributors.svg?width=890&button=false" alt="contributors">
|
133
133
|
</a>
|
134
134
|
|
@@ -0,0 +1,67 @@
|
|
1
|
+
### [v3.5.3](https://github.com/vant-ui/vant/compare/v3.5.2...v3.5.3)
|
2
|
+
|
3
|
+
`2022-07-31`
|
4
|
+
|
5
|
+
**Bug Fixes**
|
6
|
+
|
7
|
+
- @vant-cli: compilation error when using setup syntactic sugar and including subcomponents [cb7512](https://github.com/vant-ui/vant/commit/cb751211f1184a7a36627b45290f84c64d656f5a)
|
8
|
+
- create-vant-cli-app: missing demo registration [#10839](https://github.com/vant-ui/vant/issues/10839)
|
9
|
+
- docs: fix button example type in documentation [#10850](https://github.com/vant-ui/vant/issues/10850)
|
10
|
+
- failed to get correct height of safe area element [#10827](https://github.com/vant-ui/vant/issues/10827)
|
11
|
+
- Popover: allow to dynamically set offset prop [#10840](https://github.com/vant-ui/vant/issues/10840)
|
12
|
+
- Uploader: should not preview failed images [#10790](https://github.com/vant-ui/vant/issues/10790)
|
13
|
+
|
14
|
+
**Document**
|
15
|
+
|
16
|
+
- changelog: @vant/cli@4.0.3 [#10772](https://github.com/vant-ui/vant/issues/10772)
|
17
|
+
- changelog: vant@3.5.2 [e5a3aa](https://github.com/vant-ui/vant/commit/e5a3aa103dcd087f091d757ad244179ad4a70f42)
|
18
|
+
- improve description of name and required props [#10841](https://github.com/vant-ui/vant/issues/10841)
|
19
|
+
- update readme [#10868](https://github.com/vant-ui/vant/issues/10868)
|
20
|
+
- update website domain [#10798](https://github.com/vant-ui/vant/issues/10798)
|
21
|
+
|
22
|
+
**Feature**
|
23
|
+
|
24
|
+
- @vant/cli: bump vite 3.0 [#10842](https://github.com/vant-ui/vant/issues/10842)
|
25
|
+
- Calendar: expose getSelectedDate method [419a8e](https://github.com/vant-ui/vant/commit/419a8e4f0e6454b9aac30d5800318deabec099cb)
|
26
|
+
- cli: support site.headHtml option [#10807](https://github.com/vant-ui/vant/issues/10807)
|
27
|
+
- Collapse: collapse add toggleAll method for issues #10818 [#10818](https://github.com/vant-ui/vant/issues/10818) [#10837](https://github.com/vant-ui/vant/issues/10837) [#10818](https://github.com/vant-ui/vant/issues/10818)
|
28
|
+
|
29
|
+
**perf**
|
30
|
+
|
31
|
+
- cli: improve cli boot time [#10780](https://github.com/vant-ui/vant/issues/10780)
|
32
|
+
- cli: replace lint-staged with nano-staged [#10778](https://github.com/vant-ui/vant/issues/10778)
|
33
|
+
- cli: replace ora with nanospinner [#10779](https://github.com/vant-ui/vant/issues/10779)
|
34
|
+
|
35
|
+
**refactor**
|
36
|
+
|
37
|
+
- @vant/cli: remove vetur configs [#10866](https://github.com/vant-ui/vant/issues/10866)
|
38
|
+
|
39
|
+
**release**
|
40
|
+
|
41
|
+
- @vant/cli 4.0.3 [e4fc6f](https://github.com/vant-ui/vant/commit/e4fc6f9081728d3f59ef8d60c18bc5e7fa72d571)
|
42
|
+
- create-vant-cli-app 2.0.1 [c628a6](https://github.com/vant-ui/vant/commit/c628a667703b38e3999e1953950a187e97a45efb)
|
43
|
+
### [v3.5.2](https://github.com/vant-ui/vant/compare/v3.5.1...v3.5.2)
|
44
|
+
|
45
|
+
`2022-06-26`
|
46
|
+
|
47
|
+
**Bug Fixes**
|
48
|
+
|
49
|
+
- List: element with `overflow: overlay` style should be considered a scroll container [#10743](https://github.com/vant-ui/vant/issues/10743)
|
50
|
+
|
51
|
+
**Document**
|
52
|
+
|
53
|
+
- add guide of function component style [#10728](https://github.com/vant-ui/vant/issues/10728)
|
54
|
+
- changelog: 3.5.1 [ffefe3](https://github.com/vant-ui/vant/commit/ffefe3002f674f644b90f8fdfb04dc004a3a8c4f)
|
55
|
+
- Switch: fix custom node demo [#10720](https://github.com/vant-ui/vant/issues/10720)
|
56
|
+
|
57
|
+
**Feature**
|
58
|
+
|
59
|
+
- ActionBar: add placeholder prop [#10724](https://github.com/vant-ui/vant/issues/10724)
|
60
|
+
- cli: add build.bundleOptions config [#10751](https://github.com/vant-ui/vant/issues/10751)
|
61
|
+
- cli: add css.removeSourceFile config [#10750](https://github.com/vant-ui/vant/issues/10750)
|
62
|
+
- Field: add start-validate and end-validate event [#10726](https://github.com/vant-ui/vant/issues/10726)
|
63
|
+
- SubmitBar: add placeholder prop [#10725](https://github.com/vant-ui/vant/issues/10725)
|
64
|
+
|
65
|
+
**release**
|
66
|
+
|
67
|
+
- 3.5.2 [52957e](https://github.com/vant-ui/vant/commit/52957ec244f2e33fff7768c1a52e29fc6589019d)
|
package/es/button/index.less
CHANGED
package/es/calendar/Calendar.mjs
CHANGED
@@ -133,6 +133,7 @@ var stdin_default = defineComponent({
|
|
133
133
|
}
|
134
134
|
return !currentDate.value;
|
135
135
|
});
|
136
|
+
const getSelectedDate = () => currentDate.value;
|
136
137
|
const onScroll = () => {
|
137
138
|
const top = getScrollTop(bodyRef.value);
|
138
139
|
const bottom = top + bodyHeight;
|
@@ -375,7 +376,8 @@ var stdin_default = defineComponent({
|
|
375
376
|
});
|
376
377
|
useExpose({
|
377
378
|
reset,
|
378
|
-
scrollToDate
|
379
|
+
scrollToDate,
|
380
|
+
getSelectedDate
|
379
381
|
});
|
380
382
|
onMountedOrActivated(init);
|
381
383
|
return () => {
|
package/es/calendar/types.d.ts
CHANGED
@@ -15,6 +15,7 @@ export declare type CalendarDayItem = {
|
|
15
15
|
export declare type CalendarExpose = {
|
16
16
|
reset: (date?: Date | Date[]) => void;
|
17
17
|
scrollToDate: (targetDate: Date) => void;
|
18
|
+
getSelectedDate: () => Date | Date[] | null;
|
18
19
|
};
|
19
20
|
export declare type CalendarInstance = ComponentPublicInstance<CalendarProps, CalendarExpose>;
|
20
21
|
export declare type CalendarMonthInstance = ComponentPublicInstance<CalendarMonthProps, {
|
package/es/cell/Cell.d.ts
CHANGED
@@ -110,10 +110,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
110
110
|
replace: BooleanConstructor;
|
111
111
|
}>>, {
|
112
112
|
replace: boolean;
|
113
|
+
required: boolean;
|
113
114
|
center: boolean;
|
114
115
|
isLink: boolean;
|
115
116
|
border: boolean;
|
116
|
-
required: boolean;
|
117
117
|
clickable: boolean | null;
|
118
118
|
}>;
|
119
119
|
export default _default;
|
package/es/cell/index.d.ts
CHANGED
@@ -54,10 +54,10 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
|
|
54
54
|
replace: BooleanConstructor;
|
55
55
|
}>>, {
|
56
56
|
replace: boolean;
|
57
|
+
required: boolean;
|
57
58
|
center: boolean;
|
58
59
|
isLink: boolean;
|
59
60
|
border: boolean;
|
60
|
-
required: boolean;
|
61
61
|
clickable: boolean | null;
|
62
62
|
}>>;
|
63
63
|
export default Cell;
|
@@ -1,9 +1,13 @@
|
|
1
|
-
import { type PropType, type InjectionKey, type ExtractPropTypes } from 'vue';
|
1
|
+
import { type PropType, type InjectionKey, type ExtractPropTypes, type ComponentPublicInstance } from 'vue';
|
2
2
|
import { type Numeric } from '../utils';
|
3
3
|
export declare type CollapseProvide = {
|
4
4
|
toggle: (name: Numeric, expanded: boolean) => void;
|
5
5
|
isExpanded: (name: Numeric) => boolean;
|
6
6
|
};
|
7
|
+
export declare type CollapseToggleAllOptions = boolean | {
|
8
|
+
expanded?: boolean;
|
9
|
+
skipDisabled?: boolean;
|
10
|
+
};
|
7
11
|
export declare const COLLAPSE_KEY: InjectionKey<CollapseProvide>;
|
8
12
|
declare const collapseProps: {
|
9
13
|
border: {
|
@@ -17,6 +21,9 @@ declare const collapseProps: {
|
|
17
21
|
};
|
18
22
|
};
|
19
23
|
export declare type CollapseProps = ExtractPropTypes<typeof collapseProps>;
|
24
|
+
export declare type CollapseInstance = ComponentPublicInstance<{
|
25
|
+
toggleAll: (options?: boolean | CollapseToggleAllOptions) => void;
|
26
|
+
}>;
|
20
27
|
declare const _default: import("vue").DefineComponent<{
|
21
28
|
border: {
|
22
29
|
type: BooleanConstructor;
|
package/es/collapse/Collapse.mjs
CHANGED
@@ -2,6 +2,7 @@ import { createVNode as _createVNode } from "vue";
|
|
2
2
|
import { defineComponent } from "vue";
|
3
3
|
import { truthProp, createNamespace, BORDER_TOP_BOTTOM } from "../utils/index.mjs";
|
4
4
|
import { useChildren } from "@vant/use";
|
5
|
+
import { useExpose } from "../composables/use-expose.mjs";
|
5
6
|
const [name, bem] = createNamespace("collapse");
|
6
7
|
const COLLAPSE_KEY = Symbol(name);
|
7
8
|
const collapseProps = {
|
@@ -32,7 +33,8 @@ var stdin_default = defineComponent({
|
|
32
33
|
slots
|
33
34
|
}) {
|
34
35
|
const {
|
35
|
-
linkChildren
|
36
|
+
linkChildren,
|
37
|
+
children
|
36
38
|
} = useChildren(COLLAPSE_KEY);
|
37
39
|
const updateName = (name2) => {
|
38
40
|
emit("change", name2);
|
@@ -51,6 +53,28 @@ var stdin_default = defineComponent({
|
|
51
53
|
updateName(modelValue.filter((activeName) => activeName !== name2));
|
52
54
|
}
|
53
55
|
};
|
56
|
+
const toggleAll = (options = {}) => {
|
57
|
+
if (props.accordion) {
|
58
|
+
return;
|
59
|
+
}
|
60
|
+
if (typeof options === "boolean") {
|
61
|
+
options = {
|
62
|
+
expanded: options
|
63
|
+
};
|
64
|
+
}
|
65
|
+
const {
|
66
|
+
expanded,
|
67
|
+
skipDisabled
|
68
|
+
} = options;
|
69
|
+
const expandedChildren = children.filter((item) => {
|
70
|
+
if (item.disabled && skipDisabled) {
|
71
|
+
return item.expanded.value;
|
72
|
+
}
|
73
|
+
return expanded != null ? expanded : !item.expanded.value;
|
74
|
+
});
|
75
|
+
const names = expandedChildren.map((item) => item.itemName.value);
|
76
|
+
updateName(names);
|
77
|
+
};
|
54
78
|
const isExpanded = (name2) => {
|
55
79
|
const {
|
56
80
|
accordion,
|
@@ -61,6 +85,9 @@ var stdin_default = defineComponent({
|
|
61
85
|
}
|
62
86
|
return accordion ? modelValue === name2 : modelValue.includes(name2);
|
63
87
|
};
|
88
|
+
useExpose({
|
89
|
+
toggleAll
|
90
|
+
});
|
64
91
|
linkChildren({
|
65
92
|
toggle,
|
66
93
|
isExpanded
|
package/es/collapse/index.d.ts
CHANGED
@@ -27,7 +27,7 @@ export declare const Collapse: import("../utils").WithInstall<import("vue").Defi
|
|
27
27
|
accordion: boolean;
|
28
28
|
}>>;
|
29
29
|
export default Collapse;
|
30
|
-
export type { CollapseProps } from './Collapse';
|
30
|
+
export type { CollapseProps, CollapseInstance, CollapseToggleAllOptions, } from './Collapse';
|
31
31
|
declare module 'vue' {
|
32
32
|
interface GlobalComponents {
|
33
33
|
VanCollapse: typeof Collapse;
|
@@ -107,11 +107,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
107
107
|
default: true;
|
108
108
|
};
|
109
109
|
}>>, {
|
110
|
+
required: boolean;
|
110
111
|
center: boolean;
|
111
112
|
disabled: boolean;
|
112
113
|
isLink: boolean;
|
113
114
|
border: boolean;
|
114
|
-
required: boolean;
|
115
115
|
clickable: boolean | null;
|
116
116
|
readonly: boolean;
|
117
117
|
lazyRender: boolean;
|
@@ -120,7 +120,9 @@ var stdin_default = defineComponent({
|
|
120
120
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]), [[_vShow, show.value]]);
|
121
121
|
});
|
122
122
|
useExpose({
|
123
|
-
toggle
|
123
|
+
toggle,
|
124
|
+
expanded,
|
125
|
+
itemName: name2
|
124
126
|
});
|
125
127
|
return () => _createVNode("div", {
|
126
128
|
"class": [bem({
|
@@ -69,11 +69,11 @@ export declare const CollapseItem: import("../utils").WithInstall<import("vue").
|
|
69
69
|
default: true;
|
70
70
|
};
|
71
71
|
}>>, {
|
72
|
+
required: boolean;
|
72
73
|
center: boolean;
|
73
74
|
disabled: boolean;
|
74
75
|
isLink: boolean;
|
75
76
|
border: boolean;
|
76
|
-
required: boolean;
|
77
77
|
clickable: boolean | null;
|
78
78
|
readonly: boolean;
|
79
79
|
lazyRender: boolean;
|
@@ -23,7 +23,7 @@
|
|
23
23
|
&__title {
|
24
24
|
.van-cell__right-icon::before {
|
25
25
|
// using translateZ to fix safari rendering issues
|
26
|
-
// see: https://github.com/
|
26
|
+
// see: https://github.com/vant-ui/vant/issues/8608
|
27
27
|
transform: rotate(90deg) translateZ(0);
|
28
28
|
transition: transform var(--van-collapse-item-transition-duration);
|
29
29
|
}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { Ref } from 'vue';
|
2
|
-
export declare const useHeight: (element: Element | Ref<Element | undefined
|
2
|
+
export declare const useHeight: (element: Element | Ref<Element | undefined>, withSafeArea?: boolean) => Ref<number | undefined>;
|
@@ -1,13 +1,17 @@
|
|
1
1
|
import { useRect } from "@vant/use";
|
2
2
|
import { ref, onMounted, nextTick } from "vue";
|
3
|
-
const useHeight = (element) => {
|
3
|
+
const useHeight = (element, withSafeArea) => {
|
4
4
|
const height = ref();
|
5
5
|
const setHeight = () => {
|
6
6
|
height.value = useRect(element).height;
|
7
7
|
};
|
8
8
|
onMounted(() => {
|
9
9
|
nextTick(setHeight);
|
10
|
-
|
10
|
+
if (withSafeArea) {
|
11
|
+
for (let i = 1; i <= 3; i++) {
|
12
|
+
setTimeout(setHeight, 100 * i);
|
13
|
+
}
|
14
|
+
}
|
11
15
|
});
|
12
16
|
return height;
|
13
17
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
2
2
|
import { useHeight } from "./use-height.mjs";
|
3
3
|
function usePlaceholder(contentRef, bem) {
|
4
|
-
const height = useHeight(contentRef);
|
4
|
+
const height = useHeight(contentRef, true);
|
5
5
|
return (renderContent) => _createVNode("div", {
|
6
6
|
"class": bem("placeholder"),
|
7
7
|
"style": {
|
package/es/dialog/Dialog.d.ts
CHANGED
@@ -30,7 +30,7 @@ declare const dialogProps: {
|
|
30
30
|
theme: PropType<DialogTheme>;
|
31
31
|
width: (NumberConstructor | StringConstructor)[];
|
32
32
|
message: PropType<DialogMessage>;
|
33
|
-
callback: PropType<(action?: DialogAction
|
33
|
+
callback: PropType<(action?: DialogAction) => void>;
|
34
34
|
allowHtml: BooleanConstructor;
|
35
35
|
className: PropType<unknown>;
|
36
36
|
transition: {
|
package/es/field/Field.d.ts
CHANGED
@@ -304,12 +304,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
304
304
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
305
305
|
}, {
|
306
306
|
type: FieldType;
|
307
|
+
required: boolean;
|
307
308
|
center: boolean;
|
308
309
|
autofocus: boolean;
|
309
310
|
disabled: boolean;
|
310
311
|
isLink: boolean;
|
311
312
|
border: boolean;
|
312
|
-
required: boolean;
|
313
313
|
clickable: boolean | null;
|
314
314
|
clearable: boolean;
|
315
315
|
clearIcon: string;
|
package/es/field/index.d.ts
CHANGED
@@ -176,12 +176,12 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
176
176
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
177
177
|
}, {
|
178
178
|
type: import("./types").FieldType;
|
179
|
+
required: boolean;
|
179
180
|
center: boolean;
|
180
181
|
autofocus: boolean;
|
181
182
|
disabled: boolean;
|
182
183
|
isLink: boolean;
|
183
184
|
border: boolean;
|
184
|
-
required: boolean;
|
185
185
|
clickable: boolean | null;
|
186
186
|
clearable: boolean;
|
187
187
|
clearIcon: string;
|
package/es/field/index.less
CHANGED
package/es/grid-item/index.less
CHANGED
package/es/index.d.ts
CHANGED
package/es/index.mjs
CHANGED
@@ -83,7 +83,7 @@ import { Tag } from "./tag/index.mjs";
|
|
83
83
|
import { Toast } from "./toast/index.mjs";
|
84
84
|
import { TreeSelect } from "./tree-select/index.mjs";
|
85
85
|
import { Uploader } from "./uploader/index.mjs";
|
86
|
-
const version = "3.5.
|
86
|
+
const version = "3.5.3";
|
87
87
|
function install(app) {
|
88
88
|
const components = [
|
89
89
|
ActionBar,
|
package/es/locale/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
declare type Message = Record<string, any>;
|
2
2
|
export declare const Locale: {
|
3
3
|
messages(): Message;
|
4
|
-
use(newLang: string, newMessages?: Message
|
4
|
+
use(newLang: string, newMessages?: Message): void;
|
5
5
|
add(newMessages?: Message): void;
|
6
6
|
};
|
7
7
|
export default Locale;
|
package/es/popover/Popover.mjs
CHANGED
@@ -43,22 +43,23 @@ var stdin_default = defineComponent({
|
|
43
43
|
let popper;
|
44
44
|
const wrapperRef = ref();
|
45
45
|
const popoverRef = ref();
|
46
|
+
const getPopoverOptions = () => ({
|
47
|
+
placement: props.placement,
|
48
|
+
modifiers: [{
|
49
|
+
name: "computeStyles",
|
50
|
+
options: {
|
51
|
+
adaptive: false,
|
52
|
+
gpuAcceleration: false
|
53
|
+
}
|
54
|
+
}, extend({}, offsetModifier, {
|
55
|
+
options: {
|
56
|
+
offset: props.offset
|
57
|
+
}
|
58
|
+
})]
|
59
|
+
});
|
46
60
|
const createPopperInstance = () => {
|
47
61
|
if (wrapperRef.value && popoverRef.value) {
|
48
|
-
return createPopper(wrapperRef.value, popoverRef.value.popupRef.value,
|
49
|
-
placement: props.placement,
|
50
|
-
modifiers: [{
|
51
|
-
name: "computeStyles",
|
52
|
-
options: {
|
53
|
-
adaptive: false,
|
54
|
-
gpuAcceleration: false
|
55
|
-
}
|
56
|
-
}, extend({}, offsetModifier, {
|
57
|
-
options: {
|
58
|
-
offset: props.offset
|
59
|
-
}
|
60
|
-
})]
|
61
|
-
});
|
62
|
+
return createPopper(wrapperRef.value, popoverRef.value.popupRef.value, getPopoverOptions());
|
62
63
|
}
|
63
64
|
return null;
|
64
65
|
};
|
@@ -70,9 +71,7 @@ var stdin_default = defineComponent({
|
|
70
71
|
if (!popper) {
|
71
72
|
popper = createPopperInstance();
|
72
73
|
} else {
|
73
|
-
popper.setOptions(
|
74
|
-
placement: props.placement
|
75
|
-
});
|
74
|
+
popper.setOptions(getPopoverOptions());
|
76
75
|
}
|
77
76
|
});
|
78
77
|
};
|
@@ -143,7 +142,7 @@ var stdin_default = defineComponent({
|
|
143
142
|
popper = null;
|
144
143
|
}
|
145
144
|
});
|
146
|
-
watch(() => [props.show, props.placement], updateLocation);
|
145
|
+
watch(() => [props.show, props.offset, props.placement], updateLocation);
|
147
146
|
useClickAway(wrapperRef, onClickAway, {
|
148
147
|
eventName: "touchstart"
|
149
148
|
});
|
package/es/swipe/index.less
CHANGED
package/es/switch/index.less
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
left: 0;
|
34
34
|
width: var(--van-switch-node-size);
|
35
35
|
height: var(--van-switch-node-size);
|
36
|
-
// https://github.com/
|
36
|
+
// https://github.com/vant-ui/vant/issues/9839
|
37
37
|
font-size: inherit;
|
38
38
|
background: var(--van-switch-node-background-color);
|
39
39
|
border-radius: 100%;
|
package/es/toast/index.less
CHANGED
@@ -38,7 +38,7 @@
|
|
38
38
|
// allow newline character
|
39
39
|
white-space: pre-wrap;
|
40
40
|
text-align: center;
|
41
|
-
// https://github.com/
|
41
|
+
// https://github.com/vant-ui/vant/issues/8959
|
42
42
|
word-break: break-all;
|
43
43
|
background: var(--van-toast-background-color);
|
44
44
|
border-radius: var(--van-toast-border-radius);
|
package/es/uploader/Uploader.mjs
CHANGED
@@ -147,7 +147,7 @@ var stdin_default = defineComponent({
|
|
147
147
|
if (props.previewFullImage) {
|
148
148
|
const imageFiles = props.modelValue.filter(isImageFile);
|
149
149
|
const images = imageFiles.map((item2) => {
|
150
|
-
if (item2.file && !item2.url) {
|
150
|
+
if (item2.file && !item2.url && item2.status !== "failed") {
|
151
151
|
item2.url = URL.createObjectURL(item2.file);
|
152
152
|
urls.push(item2.url);
|
153
153
|
}
|
package/es/utils/basic.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { ComponentPublicInstance } from 'vue';
|
2
2
|
export declare function noop(): void;
|
3
3
|
export declare const extend: {
|
4
|
-
<T, U>(target: T, source: U): T & U;
|
5
|
-
<T_1, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
6
|
-
<T_2, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
4
|
+
<T extends {}, U>(target: T, source: U): T & U;
|
5
|
+
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
6
|
+
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
7
7
|
(target: object, ...sources: any[]): any;
|
8
8
|
};
|
9
9
|
export declare const inBrowser: boolean;
|
package/es/utils/create.d.ts
CHANGED
@@ -12,6 +12,6 @@ export declare type Mods = Mod | Mod[];
|
|
12
12
|
* b('text', { disabled }) // 'button__text button__text--disabled'
|
13
13
|
* b(['disabled', 'primary']) // 'button button--disabled button--primary'
|
14
14
|
*/
|
15
|
-
export declare function createBEM(name: string): (el?: Mods
|
15
|
+
export declare function createBEM(name: string): (el?: Mods, mods?: Mods) => Mods;
|
16
16
|
export declare type BEM = ReturnType<typeof createBEM>;
|
17
17
|
export declare function createNamespace(name: string): readonly [string, (el?: Mods | undefined, mods?: Mods | undefined) => Mods, (path: string, ...args: unknown[]) => any];
|
package/lib/.DS_Store
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
package/lib/button/index.less
CHANGED
Binary file
|