vant 4.0.0-rc.3 → 4.0.0-rc.5
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 +4 -5
- package/changelog.generated.md +47 -23
- package/es/date-picker/DatePicker.mjs +4 -1
- package/es/date-picker/utils.d.ts +1 -0
- package/es/date-picker/utils.mjs +11 -0
- package/es/field/Field.mjs +5 -4
- package/es/field/index.css +1 -1
- package/es/field/types.d.ts +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/loading/Loading.mjs +8 -4
- package/es/nav-bar/NavBar.d.ts +13 -0
- package/es/nav-bar/NavBar.mjs +4 -3
- package/es/nav-bar/index.d.ts +9 -0
- package/es/notify/function-call.mjs +1 -1
- package/es/stepper/Stepper.d.ts +13 -0
- package/es/stepper/Stepper.mjs +4 -3
- package/es/stepper/index.d.ts +9 -0
- package/es/tab/Tab.mjs +12 -2
- package/es/tabs/Tabs.mjs +51 -48
- package/es/time-picker/TimePicker.mjs +4 -3
- package/lib/date-picker/DatePicker.js +3 -0
- package/lib/date-picker/utils.d.ts +1 -0
- package/lib/date-picker/utils.js +11 -0
- package/lib/field/Field.js +5 -4
- package/lib/field/index.css +1 -1
- package/lib/field/types.d.ts +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/loading/Loading.js +8 -4
- package/lib/nav-bar/NavBar.d.ts +13 -0
- package/lib/nav-bar/NavBar.js +4 -3
- package/lib/nav-bar/index.d.ts +9 -0
- package/lib/notify/function-call.js +1 -1
- package/lib/stepper/Stepper.d.ts +13 -0
- package/lib/stepper/Stepper.js +4 -3
- package/lib/stepper/index.d.ts +9 -0
- package/lib/tab/Tab.js +11 -1
- package/lib/tabs/Tabs.js +51 -48
- package/lib/time-picker/TimePicker.js +3 -2
- package/lib/vant.cjs.js +101 -67
- package/lib/vant.es.js +101 -67
- package/lib/vant.js +101 -67
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +523 -499
- package/package.json +5 -5
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/
|
96
|
-
| [vant-icons](https://github.com/vant-ui/vant/tree/
|
97
|
-
| [vant-touch-emulator](https://github.com/vant-ui/vant/tree/
|
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
|
-
- [
|
114
|
+
- [Discussions](https://github.com/vant-ui/vant/discussions)
|
116
115
|
|
117
116
|
## Preview
|
118
117
|
|
package/changelog.generated.md
CHANGED
@@ -1,47 +1,71 @@
|
|
1
|
-
### [v4.0.0-rc.
|
1
|
+
### [v4.0.0-rc.5](https://github.com/vant-ui/vant/compare/v4.0.0-rc.4...v4.0.0-rc.5)
|
2
2
|
|
3
|
-
`2022-
|
3
|
+
`2022-10-07`
|
4
|
+
|
5
|
+
**Bug Fixes**
|
6
|
+
|
7
|
+
- cli: duplicate vue in first dev [#11120](https://github.com/vant-ui/vant/issues/11120)
|
8
|
+
- DatePicker: format value when exceed max date [#11122](https://github.com/vant-ui/vant/issues/11122)
|
9
|
+
- Field: icon position when label align is top [#11112](https://github.com/vant-ui/vant/issues/11112)
|
10
|
+
- Tabs: incorrect nav scroll animation in some cases [#11116](https://github.com/vant-ui/vant/issues/11116)
|
11
|
+
- Tabs: scroll position when using nav-bottom slot [#11115](https://github.com/vant-ui/vant/issues/11115)
|
4
12
|
|
5
13
|
**Document**
|
6
14
|
|
7
|
-
-
|
8
|
-
-
|
15
|
+
- add faq of uni-app [#11114](https://github.com/vant-ui/vant/issues/11114)
|
16
|
+
- changelog: @vant/cli 5.0.1 [#11118](https://github.com/vant-ui/vant/issues/11118)
|
17
|
+
- changelog: vant@4.0.0-rc.4 [#11088](https://github.com/vant-ui/vant/issues/11088)
|
18
|
+
- Field: add label-align demo [#11121](https://github.com/vant-ui/vant/issues/11121)
|
19
|
+
- fix website redirect [#11097](https://github.com/vant-ui/vant/issues/11097)
|
20
|
+
- Navbar: update clickable description [#11110](https://github.com/vant-ui/vant/issues/11110)
|
9
21
|
|
10
22
|
**Feature**
|
11
23
|
|
12
|
-
- add
|
13
|
-
-
|
24
|
+
- add label-position:top for field and form [#11102](https://github.com/vant-ui/vant/issues/11102)
|
25
|
+
- cli: bump jest v29 [#11117](https://github.com/vant-ui/vant/issues/11117)
|
26
|
+
- cli: using @vant/cli v5 in template [#11119](https://github.com/vant-ui/vant/issues/11119)
|
27
|
+
- Loading: add icon slot [#11109](https://github.com/vant-ui/vant/issues/11109)
|
28
|
+
- nav-bar: add clickable prop to nav-bar component [#11048](https://github.com/vant-ui/vant/issues/11048)
|
29
|
+
- Stepper: add auto-fixed prop [#11071](https://github.com/vant-ui/vant/issues/11071)
|
14
30
|
|
15
31
|
**perf**
|
16
32
|
|
17
|
-
-
|
33
|
+
- cli: code split documents [#11111](https://github.com/vant-ui/vant/issues/11111)
|
18
34
|
|
19
35
|
**release**
|
20
36
|
|
21
|
-
- @vant/
|
37
|
+
- @vant/cli 5.0.1 [843c16](https://github.com/vant-ui/vant/commit/843c167376eee77c763b705a18052ac2ac28692a)
|
38
|
+
- @vant/cli 5.0.2 [d49c1f](https://github.com/vant-ui/vant/commit/d49c1fb94aeb0167cba56092d29c63ad3c1c9358)
|
39
|
+
### [v4.0.0-rc.4](https://github.com/vant-ui/vant/compare/v4.0.0-rc.3...v4.0.0-rc.4)
|
22
40
|
|
23
|
-
|
24
|
-
|
25
|
-
- some theme vars can be number type [#11037](https://github.com/vant-ui/vant/issues/11037)
|
26
|
-
- 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`
|
41
|
+
`2022-09-25`
|
30
42
|
|
31
43
|
**Bug Fixes**
|
32
44
|
|
33
|
-
-
|
34
|
-
-
|
45
|
+
- cli: downgrade vite version to fix the website [#11087](https://github.com/vant-ui/vant/issues/11087)
|
46
|
+
- cli: should remove light theme class in dark mode [#11039](https://github.com/vant-ui/vant/issues/11039)
|
47
|
+
- Tabs: incorrect scroll position in some cases [#11085](https://github.com/vant-ui/vant/issues/11085)
|
48
|
+
- Tabs: incorrect scroll position when inited [#11059](https://github.com/vant-ui/vant/issues/11059)
|
35
49
|
|
36
50
|
**Document**
|
37
51
|
|
38
|
-
-
|
39
|
-
-
|
52
|
+
- Cascader: update field-names type [#11052](https://github.com/vant-ui/vant/issues/11052)
|
53
|
+
- changelog: vant@4.0.0-rc.3 [#11038](https://github.com/vant-ui/vant/issues/11038)
|
54
|
+
- improve dark theme guide [#11040](https://github.com/vant-ui/vant/issues/11040)
|
55
|
+
- PickerGroup: fix TimePicker link error [#11053](https://github.com/vant-ui/vant/issues/11053)
|
56
|
+
- update links [#11041](https://github.com/vant-ui/vant/issues/11041)
|
40
57
|
|
41
|
-
**
|
58
|
+
**Feature**
|
59
|
+
|
60
|
+
- Field: add message param to 'end-validate' method [#11080](https://github.com/vant-ui/vant/issues/11080)
|
42
61
|
|
43
|
-
|
62
|
+
**perf**
|
44
63
|
|
45
|
-
|
64
|
+
- improve the type of setTimeout [#11069](https://github.com/vant-ui/vant/issues/11069)
|
65
|
+
- move @vant/icons to dev dependencies [#11075](https://github.com/vant-ui/vant/issues/11075)
|
66
|
+
|
67
|
+
**release**
|
46
68
|
|
47
|
-
-
|
69
|
+
- @vant/cli 5.0.0-beta.0 [#11082](https://github.com/vant-ui/vant/issues/11082)
|
70
|
+
- 4.0.0-rc.4 [6d2705](https://github.com/vant-ui/vant/commit/6d2705f578190d2af76419e50bb8dd2f4f084ed9)
|
71
|
+
- vant@1.4.3 [#11076](https://github.com/vant-ui/vant/issues/11076)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
2
2
|
import { ref, watch, computed, defineComponent } from "vue";
|
3
3
|
import { pick, extend, isDate, isSameValue, createNamespace } from "../utils/index.mjs";
|
4
|
-
import { genOptions, sharedProps, getMonthEndDay, pickerInheritKeys } from "./utils.mjs";
|
4
|
+
import { genOptions, sharedProps, getMonthEndDay, pickerInheritKeys, formatValueRange } from "./utils.mjs";
|
5
5
|
import { Picker } from "../picker/index.mjs";
|
6
6
|
const currentYear = new Date().getFullYear();
|
7
7
|
const [name] = createNamespace("date-picker");
|
@@ -89,9 +89,12 @@ var stdin_default = defineComponent({
|
|
89
89
|
}
|
90
90
|
});
|
91
91
|
watch(() => props.modelValue, (newValues) => {
|
92
|
+
newValues = formatValueRange(newValues, columns.value);
|
92
93
|
if (!isSameValue(newValues, currentValues.value)) {
|
93
94
|
currentValues.value = newValues;
|
94
95
|
}
|
96
|
+
}, {
|
97
|
+
immediate: true
|
95
98
|
});
|
96
99
|
const onChange = (...args) => emit("change", ...args);
|
97
100
|
const onCancel = (...args) => emit("cancel", ...args);
|
@@ -41,4 +41,5 @@ export declare const pickerInheritKeys: ("title" | "readonly" | "loading" | "all
|
|
41
41
|
export declare function times<T>(n: number, iteratee: (index: number) => T): T[];
|
42
42
|
export declare const getMonthEndDay: (year: number, month: number) => number;
|
43
43
|
export declare const genOptions: <T extends string>(min: number, max: number, type: T, formatter: Formatter, filter?: Filter) => PickerOption[];
|
44
|
+
export declare const formatValueRange: (values: string[], columns: PickerOption[]) => string[];
|
44
45
|
export {};
|
package/es/date-picker/utils.mjs
CHANGED
@@ -31,7 +31,18 @@ const genOptions = (min, max, type, formatter, filter) => {
|
|
31
31
|
});
|
32
32
|
return filter ? filter(type, options) : options;
|
33
33
|
};
|
34
|
+
const formatValueRange = (values, columns) => values.map((value, index) => {
|
35
|
+
const column = columns[index];
|
36
|
+
if (column.length) {
|
37
|
+
const maxValue = +column[column.length - 1].value;
|
38
|
+
if (+value > maxValue) {
|
39
|
+
return String(maxValue);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
return value;
|
43
|
+
});
|
34
44
|
export {
|
45
|
+
formatValueRange,
|
35
46
|
genOptions,
|
36
47
|
getMonthEndDay,
|
37
48
|
pickerInheritKeys,
|
package/es/field/Field.mjs
CHANGED
@@ -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();
|
@@ -426,9 +427,9 @@ var stdin_default = defineComponent({
|
|
426
427
|
const labelAlign = getProp("labelAlign");
|
427
428
|
const Label = renderLabel();
|
428
429
|
const LeftIcon = renderLeftIcon();
|
430
|
+
const renderTitle = () => labelAlign === "top" ? [LeftIcon, Label] : Label;
|
429
431
|
return _createVNode(Cell, {
|
430
432
|
"size": props.size,
|
431
|
-
"icon": props.leftIcon,
|
432
433
|
"class": bem({
|
433
434
|
error: showError.value,
|
434
435
|
disabled,
|
@@ -445,8 +446,8 @@ var stdin_default = defineComponent({
|
|
445
446
|
}]), props.labelClass],
|
446
447
|
"arrowDirection": props.arrowDirection
|
447
448
|
}, {
|
448
|
-
icon: LeftIcon ? () => LeftIcon : null,
|
449
|
-
title: Label
|
449
|
+
icon: LeftIcon && labelAlign !== "top" ? () => LeftIcon : null,
|
450
|
+
title: Label || labelAlign === "top" ? renderTitle : null,
|
450
451
|
value: renderFieldBody,
|
451
452
|
extra: slots.extra
|
452
453
|
});
|
package/es/field/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:root{--van-field-label-width: 6.2em;--van-field-label-color: var(--van-text-color);--van-field-label-margin-right: var(--van-padding-sm);--van-field-input-text-color: var(--van-text-color);--van-field-input-error-text-color: var(--van-danger-color);--van-field-input-disabled-text-color: var(--van-text-color-3);--van-field-placeholder-text-color: var(--van-text-color-3);--van-field-icon-size: 16px;--van-field-clear-icon-size: 16px;--van-field-clear-icon-color: var(--van-gray-5);--van-field-right-icon-color: var(--van-gray-6);--van-field-error-message-color: var(--van-danger-color);--van-field-error-message-font-size: 12px;--van-field-text-area-min-height: 60px;--van-field-word-limit-color: var(--van-gray-7);--van-field-word-limit-font-size: var(--van-font-size-sm);--van-field-word-limit-line-height: 16px;--van-field-disabled-text-color: var(--van-text-color-3);--van-field-required-mark-color: var(--van-red)}.van-field__label{flex:none;box-sizing:border-box;width:var(--van-field-label-width);margin-right:var(--van-field-label-margin-right);color:var(--van-field-label-color);text-align:left;word-wrap:break-word}.van-field__label--center{text-align:center}.van-field__label--right{text-align:right}.van-field__label--required:before{margin-right:2px;color:var(--van-field-required-mark-color);content:"*"}.van-field--disabled .van-field__label{color:var(--van-field-disabled-text-color)}.van-field__value{overflow:visible}.van-field__body{display:flex;align-items:center}.van-field__control{display:block;box-sizing:border-box;width:100%;min-width:0;margin:0;padding:0;color:var(--van-field-input-text-color);line-height:inherit;text-align:left;background-color:transparent;border:0;resize:none;-webkit-user-select:auto;user-select:auto}.van-field__control::-webkit-input-placeholder{color:var(--van-field-placeholder-text-color)}.van-field__control::placeholder{color:var(--van-field-placeholder-text-color)}.van-field__control:disabled{color:var(--van-field-input-disabled-text-color);cursor:not-allowed;opacity:1;-webkit-text-fill-color:var(--van-field-input-disabled-text-color)}.van-field__control:read-only{cursor:default}.van-field__control--center{justify-content:center;text-align:center}.van-field__control--right{justify-content:flex-end;text-align:right}.van-field__control--custom{display:flex;align-items:center;min-height:var(--van-cell-line-height)}.van-field__control--error::-webkit-input-placeholder{color:var(--van-field-input-error-text-color);-webkit-text-fill-color:currentColor}.van-field__control--error,.van-field__control--error::placeholder{color:var(--van-field-input-error-text-color);-webkit-text-fill-color:currentColor}.van-field__control--min-height{min-height:var(--van-field-text-area-min-height)}.van-field__control[type=date],.van-field__control[type=time],.van-field__control[type=datetime-local]{min-height:var(--van-cell-line-height)}.van-field__control[type=search]{-webkit-appearance:none}.van-field__clear,.van-field__icon,.van-field__button,.van-field__right-icon{flex-shrink:0}.van-field__clear,.van-field__right-icon{margin-right:calc(var(--van-padding-xs) * -1);padding:0 var(--van-padding-xs);line-height:inherit}.van-field__clear{color:var(--van-field-clear-icon-color);font-size:var(--van-field-clear-icon-size);cursor:pointer}.van-field__left-icon .van-icon,.van-field__right-icon .van-icon{display:block;font-size:var(--van-field-icon-size);line-height:inherit}.van-field__left-icon{margin-right:var(--van-padding-base)}.van-field__right-icon{color:var(--van-field-right-icon-color)}.van-field__button{padding-left:var(--van-padding-xs)}.van-field__error-message{color:var(--van-field-error-message-color);font-size:var(--van-field-error-message-font-size);text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{margin-top:var(--van-padding-base);color:var(--van-field-word-limit-color);font-size:var(--van-field-word-limit-font-size);line-height:var(--van-field-word-limit-line-height);text-align:right}
|
1
|
+
:root{--van-field-label-width: 6.2em;--van-field-label-color: var(--van-text-color);--van-field-label-margin-right: var(--van-padding-sm);--van-field-input-text-color: var(--van-text-color);--van-field-input-error-text-color: var(--van-danger-color);--van-field-input-disabled-text-color: var(--van-text-color-3);--van-field-placeholder-text-color: var(--van-text-color-3);--van-field-icon-size: 16px;--van-field-clear-icon-size: 16px;--van-field-clear-icon-color: var(--van-gray-5);--van-field-right-icon-color: var(--van-gray-6);--van-field-error-message-color: var(--van-danger-color);--van-field-error-message-font-size: 12px;--van-field-text-area-min-height: 60px;--van-field-word-limit-color: var(--van-gray-7);--van-field-word-limit-font-size: var(--van-font-size-sm);--van-field-word-limit-line-height: 16px;--van-field-disabled-text-color: var(--van-text-color-3);--van-field-required-mark-color: var(--van-red)}.van-field{flex-wrap:wrap}.van-field__label{flex:none;box-sizing:border-box;width:var(--van-field-label-width);margin-right:var(--van-field-label-margin-right);color:var(--van-field-label-color);text-align:left;word-wrap:break-word}.van-field__label--center{text-align:center}.van-field__label--right{text-align:right}.van-field__label--top{display:flex;width:100%;text-align:left;margin-bottom:var(--van-padding-base)}.van-field__label--required:before{margin-right:2px;color:var(--van-field-required-mark-color);content:"*"}.van-field--disabled .van-field__label{color:var(--van-field-disabled-text-color)}.van-field__value{overflow:visible}.van-field__body{display:flex;align-items:center}.van-field__control{display:block;box-sizing:border-box;width:100%;min-width:0;margin:0;padding:0;color:var(--van-field-input-text-color);line-height:inherit;text-align:left;background-color:transparent;border:0;resize:none;-webkit-user-select:auto;user-select:auto}.van-field__control::-webkit-input-placeholder{color:var(--van-field-placeholder-text-color)}.van-field__control::placeholder{color:var(--van-field-placeholder-text-color)}.van-field__control:disabled{color:var(--van-field-input-disabled-text-color);cursor:not-allowed;opacity:1;-webkit-text-fill-color:var(--van-field-input-disabled-text-color)}.van-field__control:read-only{cursor:default}.van-field__control--center{justify-content:center;text-align:center}.van-field__control--right{justify-content:flex-end;text-align:right}.van-field__control--custom{display:flex;align-items:center;min-height:var(--van-cell-line-height)}.van-field__control--error::-webkit-input-placeholder{color:var(--van-field-input-error-text-color);-webkit-text-fill-color:currentColor}.van-field__control--error,.van-field__control--error::placeholder{color:var(--van-field-input-error-text-color);-webkit-text-fill-color:currentColor}.van-field__control--min-height{min-height:var(--van-field-text-area-min-height)}.van-field__control[type=date],.van-field__control[type=time],.van-field__control[type=datetime-local]{min-height:var(--van-cell-line-height)}.van-field__control[type=search]{-webkit-appearance:none}.van-field__clear,.van-field__icon,.van-field__button,.van-field__right-icon{flex-shrink:0}.van-field__clear,.van-field__right-icon{margin-right:calc(var(--van-padding-xs) * -1);padding:0 var(--van-padding-xs);line-height:inherit}.van-field__clear{color:var(--van-field-clear-icon-color);font-size:var(--van-field-clear-icon-size);cursor:pointer}.van-field__left-icon .van-icon,.van-field__right-icon .van-icon{display:block;font-size:var(--van-field-icon-size);line-height:inherit}.van-field__left-icon{margin-right:var(--van-padding-base)}.van-field__right-icon{color:var(--van-field-right-icon-color)}.van-field__button{padding-left:var(--van-padding-xs)}.van-field__error-message{color:var(--van-field-error-message-color);font-size:var(--van-field-error-message-font-size);text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{margin-top:var(--van-padding-base);color:var(--van-field-word-limit-color);font-size:var(--van-field-word-limit-font-size);line-height:var(--van-field-word-limit-line-height);text-align:right}
|
package/es/field/types.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { ComputedRef, ComponentPublicInstance } from 'vue';
|
2
2
|
import type { FieldProps } from './Field';
|
3
3
|
export declare type FieldType = 'tel' | 'url' | 'date' | 'file' | 'text' | 'time' | 'week' | 'color' | 'digit' | 'email' | 'image' | 'month' | 'radio' | 'range' | 'reset' | 'button' | 'hidden' | 'number' | 'search' | 'submit' | 'checkbox' | 'password' | 'textarea' | 'datetime-local';
|
4
|
-
export declare type FieldTextAlign = 'left' | 'center' | 'right';
|
4
|
+
export declare type FieldTextAlign = 'left' | 'center' | 'right' | 'top';
|
5
5
|
export declare type FieldClearTrigger = 'always' | 'focus';
|
6
6
|
export declare type FieldFormatTrigger = 'onBlur' | 'onChange';
|
7
7
|
export declare type FieldValidateTrigger = 'onBlur' | 'onChange' | 'onSubmit';
|
package/es/index.d.ts
CHANGED
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.
|
89
|
+
const version = "4.0.0-rc.5";
|
90
90
|
function install(app) {
|
91
91
|
const components = [
|
92
92
|
ActionBar,
|
package/es/loading/Loading.mjs
CHANGED
@@ -31,6 +31,13 @@ var stdin_default = defineComponent({
|
|
31
31
|
const spinnerStyle = computed(() => extend({
|
32
32
|
color: props.color
|
33
33
|
}, getSizeStyle(props.size)));
|
34
|
+
const renderIcon = () => {
|
35
|
+
const DefaultIcon = props.type === "spinner" ? SpinIcon : CircularIcon;
|
36
|
+
return _createVNode("span", {
|
37
|
+
"class": bem("spinner", props.type),
|
38
|
+
"style": spinnerStyle.value
|
39
|
+
}, [slots.icon ? slots.icon() : DefaultIcon]);
|
40
|
+
};
|
34
41
|
const renderText = () => {
|
35
42
|
var _a;
|
36
43
|
if (slots.default) {
|
@@ -54,10 +61,7 @@ var stdin_default = defineComponent({
|
|
54
61
|
}]),
|
55
62
|
"aria-live": "polite",
|
56
63
|
"aria-busy": true
|
57
|
-
}, [
|
58
|
-
"class": bem("spinner", type),
|
59
|
-
"style": spinnerStyle.value
|
60
|
-
}, [type === "spinner" ? SpinIcon : CircularIcon]), renderText()]);
|
64
|
+
}, [renderIcon(), renderText()]);
|
61
65
|
};
|
62
66
|
}
|
63
67
|
});
|
package/es/nav-bar/NavBar.d.ts
CHANGED
@@ -12,6 +12,10 @@ export declare const navBarProps: {
|
|
12
12
|
leftArrow: BooleanConstructor;
|
13
13
|
placeholder: BooleanConstructor;
|
14
14
|
safeAreaInsetTop: BooleanConstructor;
|
15
|
+
clickable: {
|
16
|
+
type: BooleanConstructor;
|
17
|
+
default: true;
|
18
|
+
};
|
15
19
|
};
|
16
20
|
export declare type NavBarProps = ExtractPropTypes<typeof navBarProps>;
|
17
21
|
declare const _default: import("vue").DefineComponent<{
|
@@ -27,6 +31,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
27
31
|
leftArrow: BooleanConstructor;
|
28
32
|
placeholder: BooleanConstructor;
|
29
33
|
safeAreaInsetTop: BooleanConstructor;
|
34
|
+
clickable: {
|
35
|
+
type: BooleanConstructor;
|
36
|
+
default: true;
|
37
|
+
};
|
30
38
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clickLeft" | "clickRight")[], "clickLeft" | "clickRight", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
31
39
|
title: StringConstructor;
|
32
40
|
fixed: BooleanConstructor;
|
@@ -40,12 +48,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
40
48
|
leftArrow: BooleanConstructor;
|
41
49
|
placeholder: BooleanConstructor;
|
42
50
|
safeAreaInsetTop: BooleanConstructor;
|
51
|
+
clickable: {
|
52
|
+
type: BooleanConstructor;
|
53
|
+
default: true;
|
54
|
+
};
|
43
55
|
}>> & {
|
44
56
|
onClickLeft?: ((...args: any[]) => any) | undefined;
|
45
57
|
onClickRight?: ((...args: any[]) => any) | undefined;
|
46
58
|
}, {
|
47
59
|
fixed: boolean;
|
48
60
|
border: boolean;
|
61
|
+
clickable: boolean;
|
49
62
|
placeholder: boolean;
|
50
63
|
safeAreaInsetTop: boolean;
|
51
64
|
leftArrow: boolean;
|
package/es/nav-bar/NavBar.mjs
CHANGED
@@ -13,7 +13,8 @@ const navBarProps = {
|
|
13
13
|
rightText: String,
|
14
14
|
leftArrow: Boolean,
|
15
15
|
placeholder: Boolean,
|
16
|
-
safeAreaInsetTop: Boolean
|
16
|
+
safeAreaInsetTop: Boolean,
|
17
|
+
clickable: truthProp
|
17
18
|
};
|
18
19
|
var stdin_default = defineComponent({
|
19
20
|
name,
|
@@ -68,12 +69,12 @@ var stdin_default = defineComponent({
|
|
68
69
|
}, [_createVNode("div", {
|
69
70
|
"class": bem("content")
|
70
71
|
}, [hasLeft && _createVNode("div", {
|
71
|
-
"class": [bem("left"), HAPTICS_FEEDBACK],
|
72
|
+
"class": [bem("left"), props.clickable ? HAPTICS_FEEDBACK : ""],
|
72
73
|
"onClick": onClickLeft
|
73
74
|
}, [renderLeft()]), _createVNode("div", {
|
74
75
|
"class": [bem("title"), "van-ellipsis"]
|
75
76
|
}, [slots.title ? slots.title() : title]), hasRight && _createVNode("div", {
|
76
|
-
"class": [bem("right"), HAPTICS_FEEDBACK],
|
77
|
+
"class": [bem("right"), props.clickable ? HAPTICS_FEEDBACK : ""],
|
77
78
|
"onClick": onClickRight
|
78
79
|
}, [renderRight()])])]);
|
79
80
|
};
|
package/es/nav-bar/index.d.ts
CHANGED
@@ -11,6 +11,10 @@ export declare const NavBar: import("../utils").WithInstall<import("vue").Define
|
|
11
11
|
leftArrow: BooleanConstructor;
|
12
12
|
placeholder: BooleanConstructor;
|
13
13
|
safeAreaInsetTop: BooleanConstructor;
|
14
|
+
clickable: {
|
15
|
+
type: BooleanConstructor;
|
16
|
+
default: true;
|
17
|
+
};
|
14
18
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clickLeft" | "clickRight")[], "clickLeft" | "clickRight", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
15
19
|
title: StringConstructor;
|
16
20
|
fixed: BooleanConstructor;
|
@@ -24,12 +28,17 @@ export declare const NavBar: import("../utils").WithInstall<import("vue").Define
|
|
24
28
|
leftArrow: BooleanConstructor;
|
25
29
|
placeholder: BooleanConstructor;
|
26
30
|
safeAreaInsetTop: BooleanConstructor;
|
31
|
+
clickable: {
|
32
|
+
type: BooleanConstructor;
|
33
|
+
default: true;
|
34
|
+
};
|
27
35
|
}>> & {
|
28
36
|
onClickLeft?: ((...args: any[]) => any) | undefined;
|
29
37
|
onClickRight?: ((...args: any[]) => any) | undefined;
|
30
38
|
}, {
|
31
39
|
fixed: boolean;
|
32
40
|
border: boolean;
|
41
|
+
clickable: boolean;
|
33
42
|
placeholder: boolean;
|
34
43
|
safeAreaInsetTop: boolean;
|
35
44
|
leftArrow: boolean;
|
package/es/stepper/Stepper.d.ts
CHANGED
@@ -37,6 +37,10 @@ export declare const stepperProps: {
|
|
37
37
|
type: BooleanConstructor;
|
38
38
|
default: true;
|
39
39
|
};
|
40
|
+
autoFixed: {
|
41
|
+
type: BooleanConstructor;
|
42
|
+
default: true;
|
43
|
+
};
|
40
44
|
allowEmpty: BooleanConstructor;
|
41
45
|
modelValue: (NumberConstructor | StringConstructor)[];
|
42
46
|
inputWidth: (NumberConstructor | StringConstructor)[];
|
@@ -89,6 +93,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
89
93
|
type: BooleanConstructor;
|
90
94
|
default: true;
|
91
95
|
};
|
96
|
+
autoFixed: {
|
97
|
+
type: BooleanConstructor;
|
98
|
+
default: true;
|
99
|
+
};
|
92
100
|
allowEmpty: BooleanConstructor;
|
93
101
|
modelValue: (NumberConstructor | StringConstructor)[];
|
94
102
|
inputWidth: (NumberConstructor | StringConstructor)[];
|
@@ -139,6 +147,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
139
147
|
type: BooleanConstructor;
|
140
148
|
default: true;
|
141
149
|
};
|
150
|
+
autoFixed: {
|
151
|
+
type: BooleanConstructor;
|
152
|
+
default: true;
|
153
|
+
};
|
142
154
|
allowEmpty: BooleanConstructor;
|
143
155
|
modelValue: (NumberConstructor | StringConstructor)[];
|
144
156
|
inputWidth: (NumberConstructor | StringConstructor)[];
|
@@ -172,6 +184,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
172
184
|
showMinus: boolean;
|
173
185
|
showInput: boolean;
|
174
186
|
longPress: boolean;
|
187
|
+
autoFixed: boolean;
|
175
188
|
allowEmpty: boolean;
|
176
189
|
disablePlus: boolean;
|
177
190
|
disableMinus: boolean;
|
package/es/stepper/Stepper.mjs
CHANGED
@@ -18,6 +18,7 @@ const stepperProps = {
|
|
18
18
|
showMinus: truthProp,
|
19
19
|
showInput: truthProp,
|
20
20
|
longPress: truthProp,
|
21
|
+
autoFixed: truthProp,
|
21
22
|
allowEmpty: Boolean,
|
22
23
|
modelValue: numericProp,
|
23
24
|
inputWidth: numericProp,
|
@@ -37,7 +38,7 @@ var stdin_default = defineComponent({
|
|
37
38
|
setup(props, {
|
38
39
|
emit
|
39
40
|
}) {
|
40
|
-
const format = (value) => {
|
41
|
+
const format = (value, autoFixed = true) => {
|
41
42
|
const {
|
42
43
|
min,
|
43
44
|
max,
|
@@ -50,7 +51,7 @@ var stdin_default = defineComponent({
|
|
50
51
|
value = formatNumber(String(value), !props.integer);
|
51
52
|
value = value === "" ? 0 : +value;
|
52
53
|
value = Number.isNaN(value) ? +min : value;
|
53
|
-
value = Math.max(Math.min(+max, value), +min);
|
54
|
+
value = autoFixed ? Math.max(Math.min(+max, value), +min) : value;
|
54
55
|
if (isDef(decimalLength)) {
|
55
56
|
value = value.toFixed(+decimalLength);
|
56
57
|
}
|
@@ -134,7 +135,7 @@ var stdin_default = defineComponent({
|
|
134
135
|
};
|
135
136
|
const onBlur = (event) => {
|
136
137
|
const input = event.target;
|
137
|
-
const value = format(input.value);
|
138
|
+
const value = format(input.value, props.autoFixed);
|
138
139
|
input.value = String(value);
|
139
140
|
current.value = value;
|
140
141
|
nextTick(() => {
|
package/es/stepper/index.d.ts
CHANGED
@@ -34,6 +34,10 @@ export declare const Stepper: import("../utils").WithInstall<import("vue").Defin
|
|
34
34
|
type: BooleanConstructor;
|
35
35
|
default: true;
|
36
36
|
};
|
37
|
+
autoFixed: {
|
38
|
+
type: BooleanConstructor;
|
39
|
+
default: true;
|
40
|
+
};
|
37
41
|
allowEmpty: BooleanConstructor;
|
38
42
|
modelValue: (NumberConstructor | StringConstructor)[];
|
39
43
|
inputWidth: (NumberConstructor | StringConstructor)[];
|
@@ -84,6 +88,10 @@ export declare const Stepper: import("../utils").WithInstall<import("vue").Defin
|
|
84
88
|
type: BooleanConstructor;
|
85
89
|
default: true;
|
86
90
|
};
|
91
|
+
autoFixed: {
|
92
|
+
type: BooleanConstructor;
|
93
|
+
default: true;
|
94
|
+
};
|
87
95
|
allowEmpty: BooleanConstructor;
|
88
96
|
modelValue: (NumberConstructor | StringConstructor)[];
|
89
97
|
inputWidth: (NumberConstructor | StringConstructor)[];
|
@@ -117,6 +125,7 @@ export declare const Stepper: import("../utils").WithInstall<import("vue").Defin
|
|
117
125
|
showMinus: boolean;
|
118
126
|
showInput: boolean;
|
119
127
|
longPress: boolean;
|
128
|
+
autoFixed: boolean;
|
120
129
|
allowEmpty: boolean;
|
121
130
|
disablePlus: boolean;
|
122
131
|
disableMinus: boolean;
|
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:
|
92
|
+
inactive: hasInactiveClass.value
|
83
93
|
}),
|
84
94
|
"tabindex": active.value ? 0 : -1,
|
85
95
|
"aria-hidden": !active.value,
|