vant 3.5.0-beta.1 → 3.5.2
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/LICENSE +10 -0
- package/es/action-bar/ActionBar.d.ts +4 -0
- package/es/action-bar/ActionBar.mjs +13 -2
- package/es/action-bar/index.d.ts +3 -0
- package/es/calendar/Calendar.mjs +3 -0
- package/es/dialog/Dialog.d.ts +8 -0
- package/es/dialog/Dialog.mjs +6 -0
- package/es/dialog/function-call.d.ts +10 -0
- package/es/dialog/function-call.mjs +2 -0
- package/es/dialog/types.d.ts +3 -1
- package/es/field/Field.d.ts +3 -1
- package/es/field/Field.mjs +7 -1
- package/es/field/index.d.ts +3 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/picker/Picker.mjs +1 -1
- package/es/picker/PickerColumn.mjs +2 -0
- package/es/popup/Popup.mjs +1 -1
- package/es/pull-refresh/PullRefresh.d.ts +2 -1
- package/es/pull-refresh/PullRefresh.mjs +5 -1
- package/es/pull-refresh/index.d.ts +2 -1
- package/es/submit-bar/SubmitBar.d.ts +4 -0
- package/es/submit-bar/SubmitBar.mjs +13 -2
- package/es/submit-bar/index.d.ts +3 -0
- package/es/switch/Switch.mjs +2 -1
- package/es/toast/function-call.d.ts +5 -6
- package/es/toast/types.d.ts +10 -1
- package/es/uploader/Uploader.d.ts +3 -3
- package/es/uploader/index.d.ts +2 -2
- package/lib/action-bar/ActionBar.d.ts +4 -0
- package/lib/action-bar/ActionBar.js +12 -1
- package/lib/action-bar/index.d.ts +3 -0
- package/lib/calendar/Calendar.js +3 -0
- package/lib/dialog/Dialog.d.ts +8 -0
- package/lib/dialog/Dialog.js +6 -0
- package/lib/dialog/function-call.d.ts +10 -0
- package/lib/dialog/function-call.js +2 -0
- package/lib/dialog/types.d.ts +3 -1
- package/lib/field/Field.d.ts +3 -1
- package/lib/field/Field.js +7 -1
- package/lib/field/index.d.ts +3 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/picker/Picker.js +1 -1
- package/lib/picker/PickerColumn.js +2 -0
- package/lib/popup/Popup.js +1 -1
- package/lib/pull-refresh/PullRefresh.d.ts +2 -1
- package/lib/pull-refresh/PullRefresh.js +5 -1
- package/lib/pull-refresh/index.d.ts +2 -1
- package/lib/submit-bar/SubmitBar.d.ts +4 -0
- package/lib/submit-bar/SubmitBar.js +12 -1
- package/lib/submit-bar/index.d.ts +3 -0
- package/lib/switch/Switch.js +2 -1
- package/lib/toast/function-call.d.ts +5 -6
- package/lib/toast/types.d.ts +10 -1
- package/lib/uploader/Uploader.d.ts +3 -3
- package/lib/uploader/index.d.ts +2 -2
- package/lib/vant.cjs.js +72 -28
- package/lib/vant.es.js +73 -29
- package/lib/vant.js +73 -29
- package/lib/vant.min.js +1 -1
- package/package.json +3 -3
- package/vetur/attributes.json +212 -196
- package/vetur/tags.json +72 -68
- package/vetur/web-types.json +1061 -994
- package/lib/ssr.js +0 -7
- package/lib/ssr.mjs +0 -1
- package/lib/vant.cjs.min.js +0 -1
- package/lib/vant.es.min.js +0 -14649
package/LICENSE
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) Youzan
|
4
|
+
Copyright (c) Chen Jiahan and other contributors
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
7
|
+
|
8
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
9
|
+
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { type ExtractPropTypes } from 'vue';
|
2
2
|
export declare const ACTION_BAR_KEY: unique symbol;
|
3
3
|
declare const actionBarProps: {
|
4
|
+
placeholder: BooleanConstructor;
|
4
5
|
safeAreaInsetBottom: {
|
5
6
|
type: BooleanConstructor;
|
6
7
|
default: true;
|
@@ -8,16 +9,19 @@ declare const actionBarProps: {
|
|
8
9
|
};
|
9
10
|
export declare type ActionBarProps = ExtractPropTypes<typeof actionBarProps>;
|
10
11
|
declare const _default: import("vue").DefineComponent<{
|
12
|
+
placeholder: BooleanConstructor;
|
11
13
|
safeAreaInsetBottom: {
|
12
14
|
type: BooleanConstructor;
|
13
15
|
default: true;
|
14
16
|
};
|
15
17
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
18
|
+
placeholder: BooleanConstructor;
|
16
19
|
safeAreaInsetBottom: {
|
17
20
|
type: BooleanConstructor;
|
18
21
|
default: true;
|
19
22
|
};
|
20
23
|
}>>, {
|
24
|
+
placeholder: boolean;
|
21
25
|
safeAreaInsetBottom: boolean;
|
22
26
|
}>;
|
23
27
|
export default _default;
|
@@ -1,10 +1,12 @@
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
2
|
-
import { defineComponent } from "vue";
|
2
|
+
import { defineComponent, ref } from "vue";
|
3
3
|
import { truthProp, createNamespace } from "../utils/index.mjs";
|
4
4
|
import { useChildren } from "@vant/use";
|
5
|
+
import { usePlaceholder } from "../composables/use-placeholder.mjs";
|
5
6
|
const [name, bem] = createNamespace("action-bar");
|
6
7
|
const ACTION_BAR_KEY = Symbol(name);
|
7
8
|
const actionBarProps = {
|
9
|
+
placeholder: Boolean,
|
8
10
|
safeAreaInsetBottom: truthProp
|
9
11
|
};
|
10
12
|
var stdin_default = defineComponent({
|
@@ -13,18 +15,27 @@ var stdin_default = defineComponent({
|
|
13
15
|
setup(props, {
|
14
16
|
slots
|
15
17
|
}) {
|
18
|
+
const root = ref();
|
19
|
+
const renderPlaceholder = usePlaceholder(root, bem);
|
16
20
|
const {
|
17
21
|
linkChildren
|
18
22
|
} = useChildren(ACTION_BAR_KEY);
|
19
23
|
linkChildren();
|
20
|
-
|
24
|
+
const renderActionBar = () => {
|
21
25
|
var _a;
|
22
26
|
return _createVNode("div", {
|
27
|
+
"ref": root,
|
23
28
|
"class": [bem(), {
|
24
29
|
"van-safe-area-bottom": props.safeAreaInsetBottom
|
25
30
|
}]
|
26
31
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
27
32
|
};
|
33
|
+
return () => {
|
34
|
+
if (props.placeholder) {
|
35
|
+
return renderPlaceholder(renderActionBar);
|
36
|
+
}
|
37
|
+
return renderActionBar();
|
38
|
+
};
|
28
39
|
}
|
29
40
|
});
|
30
41
|
export {
|
package/es/action-bar/index.d.ts
CHANGED
@@ -1,14 +1,17 @@
|
|
1
1
|
export declare const ActionBar: import("../utils").WithInstall<import("vue").DefineComponent<{
|
2
|
+
placeholder: BooleanConstructor;
|
2
3
|
safeAreaInsetBottom: {
|
3
4
|
type: BooleanConstructor;
|
4
5
|
default: true;
|
5
6
|
};
|
6
7
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
8
|
+
placeholder: BooleanConstructor;
|
7
9
|
safeAreaInsetBottom: {
|
8
10
|
type: BooleanConstructor;
|
9
11
|
default: true;
|
10
12
|
};
|
11
13
|
}>>, {
|
14
|
+
placeholder: boolean;
|
12
15
|
safeAreaInsetBottom: boolean;
|
13
16
|
}>>;
|
14
17
|
export default ActionBar;
|
package/es/calendar/Calendar.mjs
CHANGED
@@ -112,6 +112,9 @@ var stdin_default = defineComponent({
|
|
112
112
|
const months = computed(() => {
|
113
113
|
const months2 = [];
|
114
114
|
const cursor = new Date(props.minDate);
|
115
|
+
if (props.lazyRender && !props.show && props.poppable) {
|
116
|
+
return months2;
|
117
|
+
}
|
115
118
|
cursor.setDate(1);
|
116
119
|
do {
|
117
120
|
months2.push(new Date(cursor));
|
package/es/dialog/Dialog.d.ts
CHANGED
@@ -45,8 +45,10 @@ declare const dialogProps: {
|
|
45
45
|
showCancelButton: BooleanConstructor;
|
46
46
|
cancelButtonText: StringConstructor;
|
47
47
|
cancelButtonColor: StringConstructor;
|
48
|
+
cancelButtonDisabled: BooleanConstructor;
|
48
49
|
confirmButtonText: StringConstructor;
|
49
50
|
confirmButtonColor: StringConstructor;
|
51
|
+
confirmButtonDisabled: BooleanConstructor;
|
50
52
|
showConfirmButton: {
|
51
53
|
type: BooleanConstructor;
|
52
54
|
default: true;
|
@@ -99,8 +101,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
99
101
|
showCancelButton: BooleanConstructor;
|
100
102
|
cancelButtonText: StringConstructor;
|
101
103
|
cancelButtonColor: StringConstructor;
|
104
|
+
cancelButtonDisabled: BooleanConstructor;
|
102
105
|
confirmButtonText: StringConstructor;
|
103
106
|
confirmButtonColor: StringConstructor;
|
107
|
+
confirmButtonDisabled: BooleanConstructor;
|
104
108
|
showConfirmButton: {
|
105
109
|
type: BooleanConstructor;
|
106
110
|
default: true;
|
@@ -151,8 +155,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
151
155
|
showCancelButton: BooleanConstructor;
|
152
156
|
cancelButtonText: StringConstructor;
|
153
157
|
cancelButtonColor: StringConstructor;
|
158
|
+
cancelButtonDisabled: BooleanConstructor;
|
154
159
|
confirmButtonText: StringConstructor;
|
155
160
|
confirmButtonColor: StringConstructor;
|
161
|
+
confirmButtonDisabled: BooleanConstructor;
|
156
162
|
showConfirmButton: {
|
157
163
|
type: BooleanConstructor;
|
158
164
|
default: true;
|
@@ -174,6 +180,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
174
180
|
closeOnPopstate: boolean;
|
175
181
|
allowHtml: boolean;
|
176
182
|
showCancelButton: boolean;
|
183
|
+
cancelButtonDisabled: boolean;
|
184
|
+
confirmButtonDisabled: boolean;
|
177
185
|
showConfirmButton: boolean;
|
178
186
|
}>;
|
179
187
|
export default _default;
|
package/es/dialog/Dialog.mjs
CHANGED
@@ -21,8 +21,10 @@ const dialogProps = extend({}, popupSharedProps, {
|
|
21
21
|
showCancelButton: Boolean,
|
22
22
|
cancelButtonText: String,
|
23
23
|
cancelButtonColor: String,
|
24
|
+
cancelButtonDisabled: Boolean,
|
24
25
|
confirmButtonText: String,
|
25
26
|
confirmButtonColor: String,
|
27
|
+
confirmButtonDisabled: Boolean,
|
26
28
|
showConfirmButton: truthProp,
|
27
29
|
closeOnClickOverlay: Boolean
|
28
30
|
});
|
@@ -143,6 +145,7 @@ var stdin_default = defineComponent({
|
|
143
145
|
color: props.cancelButtonColor
|
144
146
|
},
|
145
147
|
"loading": loading.cancel,
|
148
|
+
"disabled": props.cancelButtonDisabled,
|
146
149
|
"onClick": onCancel
|
147
150
|
}, null), props.showConfirmButton && _createVNode(Button, {
|
148
151
|
"size": "large",
|
@@ -154,6 +157,7 @@ var stdin_default = defineComponent({
|
|
154
157
|
color: props.confirmButtonColor
|
155
158
|
},
|
156
159
|
"loading": loading.confirm,
|
160
|
+
"disabled": props.confirmButtonDisabled,
|
157
161
|
"onClick": onConfirm
|
158
162
|
}, null)]);
|
159
163
|
const renderRoundButtons = () => _createVNode(ActionBar, {
|
@@ -165,6 +169,7 @@ var stdin_default = defineComponent({
|
|
165
169
|
"class": bem("cancel"),
|
166
170
|
"color": props.cancelButtonColor,
|
167
171
|
"loading": loading.cancel,
|
172
|
+
"disabled": props.cancelButtonDisabled,
|
168
173
|
"onClick": onCancel
|
169
174
|
}, null), props.showConfirmButton && _createVNode(ActionBarButton, {
|
170
175
|
"type": "danger",
|
@@ -172,6 +177,7 @@ var stdin_default = defineComponent({
|
|
172
177
|
"class": bem("confirm"),
|
173
178
|
"color": props.confirmButtonColor,
|
174
179
|
"loading": loading.confirm,
|
180
|
+
"disabled": props.confirmButtonDisabled,
|
175
181
|
"onClick": onConfirm
|
176
182
|
}, null)]
|
177
183
|
});
|
@@ -20,8 +20,10 @@ declare namespace Dialog {
|
|
20
20
|
messageAlign: string;
|
21
21
|
cancelButtonText: string;
|
22
22
|
cancelButtonColor: null;
|
23
|
+
cancelButtonDisabled: boolean;
|
23
24
|
confirmButtonText: string;
|
24
25
|
confirmButtonColor: null;
|
26
|
+
confirmButtonDisabled: boolean;
|
25
27
|
showConfirmButton: boolean;
|
26
28
|
showCancelButton: boolean;
|
27
29
|
closeOnPopstate: boolean;
|
@@ -45,8 +47,10 @@ declare namespace Dialog {
|
|
45
47
|
messageAlign: string;
|
46
48
|
cancelButtonText: string;
|
47
49
|
cancelButtonColor: null;
|
50
|
+
cancelButtonDisabled: boolean;
|
48
51
|
confirmButtonText: string;
|
49
52
|
confirmButtonColor: null;
|
53
|
+
confirmButtonDisabled: boolean;
|
50
54
|
showConfirmButton: boolean;
|
51
55
|
showCancelButton: boolean;
|
52
56
|
closeOnPopstate: boolean;
|
@@ -102,8 +106,10 @@ declare namespace Dialog {
|
|
102
106
|
showCancelButton: BooleanConstructor;
|
103
107
|
cancelButtonText: StringConstructor;
|
104
108
|
cancelButtonColor: StringConstructor;
|
109
|
+
cancelButtonDisabled: BooleanConstructor;
|
105
110
|
confirmButtonText: StringConstructor;
|
106
111
|
confirmButtonColor: StringConstructor;
|
112
|
+
confirmButtonDisabled: BooleanConstructor;
|
107
113
|
showConfirmButton: {
|
108
114
|
type: BooleanConstructor;
|
109
115
|
default: true;
|
@@ -154,8 +160,10 @@ declare namespace Dialog {
|
|
154
160
|
showCancelButton: BooleanConstructor;
|
155
161
|
cancelButtonText: StringConstructor;
|
156
162
|
cancelButtonColor: StringConstructor;
|
163
|
+
cancelButtonDisabled: BooleanConstructor;
|
157
164
|
confirmButtonText: StringConstructor;
|
158
165
|
confirmButtonColor: StringConstructor;
|
166
|
+
confirmButtonDisabled: BooleanConstructor;
|
159
167
|
showConfirmButton: {
|
160
168
|
type: BooleanConstructor;
|
161
169
|
default: true;
|
@@ -177,6 +185,8 @@ declare namespace Dialog {
|
|
177
185
|
closeOnPopstate: boolean;
|
178
186
|
allowHtml: boolean;
|
179
187
|
showCancelButton: boolean;
|
188
|
+
cancelButtonDisabled: boolean;
|
189
|
+
confirmButtonDisabled: boolean;
|
180
190
|
showConfirmButton: boolean;
|
181
191
|
}>>;
|
182
192
|
var install: (app: App<any>) => void;
|
@@ -52,8 +52,10 @@ Dialog.defaultOptions = {
|
|
52
52
|
messageAlign: "",
|
53
53
|
cancelButtonText: "",
|
54
54
|
cancelButtonColor: null,
|
55
|
+
cancelButtonDisabled: false,
|
55
56
|
confirmButtonText: "",
|
56
57
|
confirmButtonColor: null,
|
58
|
+
confirmButtonDisabled: false,
|
57
59
|
showConfirmButton: true,
|
58
60
|
showCancelButton: false,
|
59
61
|
closeOnPopstate: true,
|
package/es/dialog/types.d.ts
CHANGED
@@ -21,12 +21,14 @@ export declare type DialogOptions = {
|
|
21
21
|
overlayClass?: string;
|
22
22
|
overlayStyle?: CSSProperties;
|
23
23
|
closeOnPopstate?: boolean;
|
24
|
-
cancelButtonText?: string;
|
25
24
|
showCancelButton?: boolean;
|
26
25
|
showConfirmButton?: boolean;
|
26
|
+
cancelButtonText?: string;
|
27
27
|
cancelButtonColor?: string;
|
28
|
+
cancelButtonDisabled?: boolean;
|
28
29
|
confirmButtonText?: string;
|
29
30
|
confirmButtonColor?: string;
|
31
|
+
confirmButtonDisabled?: boolean;
|
30
32
|
closeOnClickOverlay?: boolean;
|
31
33
|
};
|
32
34
|
declare module '@vue/runtime-core' {
|
package/es/field/Field.d.ts
CHANGED
@@ -209,7 +209,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
209
209
|
type: BooleanConstructor;
|
210
210
|
default: null;
|
211
211
|
};
|
212
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
212
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
213
213
|
icon: StringConstructor;
|
214
214
|
size: PropType<import("../cell").CellSize>;
|
215
215
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -297,6 +297,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
297
297
|
onKeypress?: ((...args: any[]) => any) | undefined;
|
298
298
|
onClear?: ((...args: any[]) => any) | undefined;
|
299
299
|
"onClick-input"?: ((...args: any[]) => any) | undefined;
|
300
|
+
"onEnd-validate"?: ((...args: any[]) => any) | undefined;
|
301
|
+
"onStart-validate"?: ((...args: any[]) => any) | undefined;
|
300
302
|
"onClick-left-icon"?: ((...args: any[]) => any) | undefined;
|
301
303
|
"onClick-right-icon"?: ((...args: any[]) => any) | undefined;
|
302
304
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
package/es/field/Field.mjs
CHANGED
@@ -58,7 +58,7 @@ const fieldProps = extend({}, cellSharedProps, fieldSharedProps, {
|
|
58
58
|
var stdin_default = defineComponent({
|
59
59
|
name,
|
60
60
|
props: fieldProps,
|
61
|
-
emits: ["blur", "focus", "clear", "keypress", "click-input", "click-left-icon", "click-right-icon", "update:modelValue"],
|
61
|
+
emits: ["blur", "focus", "clear", "keypress", "click-input", "end-validate", "start-validate", "click-left-icon", "click-right-icon", "update:modelValue"],
|
62
62
|
setup(props, {
|
63
63
|
emit,
|
64
64
|
slots
|
@@ -132,18 +132,24 @@ var stdin_default = defineComponent({
|
|
132
132
|
state.status = "unvalidated";
|
133
133
|
state.validateMessage = "";
|
134
134
|
};
|
135
|
+
const endValidate = () => emit("end-validate", {
|
136
|
+
status: state.status
|
137
|
+
});
|
135
138
|
const validate = (rules = props.rules) => new Promise((resolve) => {
|
136
139
|
resetValidation();
|
137
140
|
if (rules) {
|
141
|
+
emit("start-validate");
|
138
142
|
runRules(rules).then(() => {
|
139
143
|
if (state.status === "failed") {
|
140
144
|
resolve({
|
141
145
|
name: props.name,
|
142
146
|
message: state.validateMessage
|
143
147
|
});
|
148
|
+
endValidate();
|
144
149
|
} else {
|
145
150
|
state.status = "passed";
|
146
151
|
resolve();
|
152
|
+
endValidate();
|
147
153
|
}
|
148
154
|
});
|
149
155
|
} else {
|
package/es/field/index.d.ts
CHANGED
@@ -81,7 +81,7 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
81
81
|
type: BooleanConstructor;
|
82
82
|
default: null;
|
83
83
|
};
|
84
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
84
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
85
85
|
icon: StringConstructor;
|
86
86
|
size: import("vue").PropType<import("..").CellSize>;
|
87
87
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -169,6 +169,8 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
169
169
|
onKeypress?: ((...args: any[]) => any) | undefined;
|
170
170
|
onClear?: ((...args: any[]) => any) | undefined;
|
171
171
|
"onClick-input"?: ((...args: any[]) => any) | undefined;
|
172
|
+
"onEnd-validate"?: ((...args: any[]) => any) | undefined;
|
173
|
+
"onStart-validate"?: ((...args: any[]) => any) | undefined;
|
172
174
|
"onClick-left-icon"?: ((...args: any[]) => any) | undefined;
|
173
175
|
"onClick-right-icon"?: ((...args: any[]) => any) | undefined;
|
174
176
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
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.2";
|
87
87
|
function install(app) {
|
88
88
|
const components = [
|
89
89
|
ActionBar,
|
package/es/picker/Picker.mjs
CHANGED
@@ -110,7 +110,7 @@ var stdin_default = defineComponent({
|
|
110
110
|
} else {
|
111
111
|
formattedColumns.value = columns;
|
112
112
|
}
|
113
|
-
hasOptions.value = formattedColumns.value.some((item) => item[columnsFieldNames.value.values] && item[columnsFieldNames.value.values].length !== 0);
|
113
|
+
hasOptions.value = formattedColumns.value.some((item) => item[columnsFieldNames.value.values] && item[columnsFieldNames.value.values].length !== 0) || children.some((item) => item.hasOptions);
|
114
114
|
};
|
115
115
|
const getIndexes = () => children.map((child) => child.state.index);
|
116
116
|
const setColumnValues = (index, options) => {
|
@@ -202,6 +202,7 @@ var stdin_default = defineComponent({
|
|
202
202
|
}
|
203
203
|
};
|
204
204
|
const getValue = () => state.options[state.index];
|
205
|
+
const hasOptions = () => state.options.length;
|
205
206
|
setIndex(state.index);
|
206
207
|
useParent(PICKER_KEY);
|
207
208
|
useExpose({
|
@@ -210,6 +211,7 @@ var stdin_default = defineComponent({
|
|
210
211
|
getValue,
|
211
212
|
setValue,
|
212
213
|
setOptions,
|
214
|
+
hasOptions,
|
213
215
|
stopMomentum
|
214
216
|
});
|
215
217
|
watch(() => props.initialOptions, setOptions);
|
package/es/popup/Popup.mjs
CHANGED
@@ -41,7 +41,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
41
41
|
type: (NumberConstructor | StringConstructor)[];
|
42
42
|
default: number;
|
43
43
|
};
|
44
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "refresh")[], "update:modelValue" | "refresh", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
44
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "refresh")[], "update:modelValue" | "change" | "refresh", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
45
45
|
disabled: BooleanConstructor;
|
46
46
|
modelValue: BooleanConstructor;
|
47
47
|
headHeight: {
|
@@ -62,6 +62,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
62
62
|
default: number;
|
63
63
|
};
|
64
64
|
}>> & {
|
65
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
65
66
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
66
67
|
onRefresh?: ((...args: any[]) => any) | undefined;
|
67
68
|
}, {
|
@@ -22,7 +22,7 @@ const pullRefreshProps = {
|
|
22
22
|
var stdin_default = defineComponent({
|
23
23
|
name,
|
24
24
|
props: pullRefreshProps,
|
25
|
-
emits: ["refresh", "update:modelValue"],
|
25
|
+
emits: ["change", "refresh", "update:modelValue"],
|
26
26
|
setup(props, {
|
27
27
|
emit,
|
28
28
|
slots
|
@@ -67,6 +67,10 @@ var stdin_default = defineComponent({
|
|
67
67
|
} else {
|
68
68
|
state.status = "loosing";
|
69
69
|
}
|
70
|
+
emit("change", {
|
71
|
+
status: state.status,
|
72
|
+
distance
|
73
|
+
});
|
70
74
|
};
|
71
75
|
const getStatusText = () => {
|
72
76
|
const {
|
@@ -18,7 +18,7 @@ export declare const PullRefresh: import("../utils").WithInstall<import("vue").D
|
|
18
18
|
type: (NumberConstructor | StringConstructor)[];
|
19
19
|
default: number;
|
20
20
|
};
|
21
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "refresh")[], "update:modelValue" | "refresh", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
21
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "refresh")[], "update:modelValue" | "change" | "refresh", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
22
22
|
disabled: BooleanConstructor;
|
23
23
|
modelValue: BooleanConstructor;
|
24
24
|
headHeight: {
|
@@ -39,6 +39,7 @@ export declare const PullRefresh: import("../utils").WithInstall<import("vue").D
|
|
39
39
|
default: number;
|
40
40
|
};
|
41
41
|
}>> & {
|
42
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
42
43
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
43
44
|
onRefresh?: ((...args: any[]) => any) | undefined;
|
44
45
|
}, {
|
@@ -20,6 +20,7 @@ declare const submitBarProps: {
|
|
20
20
|
};
|
21
21
|
buttonColor: StringConstructor;
|
22
22
|
suffixLabel: StringConstructor;
|
23
|
+
placeholder: BooleanConstructor;
|
23
24
|
decimalLength: {
|
24
25
|
type: (NumberConstructor | StringConstructor)[];
|
25
26
|
default: number;
|
@@ -49,6 +50,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
49
50
|
};
|
50
51
|
buttonColor: StringConstructor;
|
51
52
|
suffixLabel: StringConstructor;
|
53
|
+
placeholder: BooleanConstructor;
|
52
54
|
decimalLength: {
|
53
55
|
type: (NumberConstructor | StringConstructor)[];
|
54
56
|
default: number;
|
@@ -76,6 +78,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
76
78
|
};
|
77
79
|
buttonColor: StringConstructor;
|
78
80
|
suffixLabel: StringConstructor;
|
81
|
+
placeholder: BooleanConstructor;
|
79
82
|
decimalLength: {
|
80
83
|
type: (NumberConstructor | StringConstructor)[];
|
81
84
|
default: number;
|
@@ -88,6 +91,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
88
91
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
89
92
|
}, {
|
90
93
|
disabled: boolean;
|
94
|
+
placeholder: boolean;
|
91
95
|
safeAreaInsetBottom: boolean;
|
92
96
|
loading: boolean;
|
93
97
|
currency: string;
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
2
|
-
import { defineComponent } from "vue";
|
2
|
+
import { ref, defineComponent } from "vue";
|
3
3
|
import { truthProp, makeStringProp, makeNumericProp, createNamespace } from "../utils/index.mjs";
|
4
4
|
import { Icon } from "../icon/index.mjs";
|
5
5
|
import { Button } from "../button/index.mjs";
|
6
|
+
import { usePlaceholder } from "../composables/use-placeholder.mjs";
|
6
7
|
const [name, bem, t] = createNamespace("submit-bar");
|
7
8
|
const submitBarProps = {
|
8
9
|
tip: String,
|
@@ -17,6 +18,7 @@ const submitBarProps = {
|
|
17
18
|
buttonType: makeStringProp("danger"),
|
18
19
|
buttonColor: String,
|
19
20
|
suffixLabel: String,
|
21
|
+
placeholder: Boolean,
|
20
22
|
decimalLength: makeNumericProp(2),
|
21
23
|
safeAreaInsetBottom: truthProp
|
22
24
|
};
|
@@ -28,6 +30,8 @@ var stdin_default = defineComponent({
|
|
28
30
|
emit,
|
29
31
|
slots
|
30
32
|
}) {
|
33
|
+
const root = ref();
|
34
|
+
const renderPlaceholder = usePlaceholder(root, bem);
|
31
35
|
const renderText = () => {
|
32
36
|
const {
|
33
37
|
price,
|
@@ -87,9 +91,10 @@ var stdin_default = defineComponent({
|
|
87
91
|
"onClick": onClickButton
|
88
92
|
}, null);
|
89
93
|
};
|
90
|
-
|
94
|
+
const renderSubmitBar = () => {
|
91
95
|
var _a, _b;
|
92
96
|
return _createVNode("div", {
|
97
|
+
"ref": root,
|
93
98
|
"class": [bem(), {
|
94
99
|
"van-safe-area-bottom": props.safeAreaInsetBottom
|
95
100
|
}]
|
@@ -97,6 +102,12 @@ var stdin_default = defineComponent({
|
|
97
102
|
"class": bem("bar")
|
98
103
|
}, [(_b = slots.default) == null ? void 0 : _b.call(slots), renderText(), renderButton()])]);
|
99
104
|
};
|
105
|
+
return () => {
|
106
|
+
if (props.placeholder) {
|
107
|
+
return renderPlaceholder(renderSubmitBar);
|
108
|
+
}
|
109
|
+
return renderSubmitBar();
|
110
|
+
};
|
100
111
|
}
|
101
112
|
});
|
102
113
|
export {
|
package/es/submit-bar/index.d.ts
CHANGED
@@ -17,6 +17,7 @@ export declare const SubmitBar: import("../utils").WithInstall<import("vue").Def
|
|
17
17
|
};
|
18
18
|
buttonColor: StringConstructor;
|
19
19
|
suffixLabel: StringConstructor;
|
20
|
+
placeholder: BooleanConstructor;
|
20
21
|
decimalLength: {
|
21
22
|
type: (NumberConstructor | StringConstructor)[];
|
22
23
|
default: number;
|
@@ -44,6 +45,7 @@ export declare const SubmitBar: import("../utils").WithInstall<import("vue").Def
|
|
44
45
|
};
|
45
46
|
buttonColor: StringConstructor;
|
46
47
|
suffixLabel: StringConstructor;
|
48
|
+
placeholder: BooleanConstructor;
|
47
49
|
decimalLength: {
|
48
50
|
type: (NumberConstructor | StringConstructor)[];
|
49
51
|
default: number;
|
@@ -56,6 +58,7 @@ export declare const SubmitBar: import("../utils").WithInstall<import("vue").Def
|
|
56
58
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
57
59
|
}, {
|
58
60
|
disabled: boolean;
|
61
|
+
placeholder: boolean;
|
59
62
|
safeAreaInsetBottom: boolean;
|
60
63
|
loading: boolean;
|
61
64
|
currency: string;
|
package/es/switch/Switch.mjs
CHANGED
@@ -50,6 +50,7 @@ var stdin_default = defineComponent({
|
|
50
50
|
};
|
51
51
|
useCustomFieldValue(() => props.modelValue);
|
52
52
|
return () => {
|
53
|
+
var _a;
|
53
54
|
const {
|
54
55
|
size,
|
55
56
|
loading,
|
@@ -75,7 +76,7 @@ var stdin_default = defineComponent({
|
|
75
76
|
"onClick": onClick
|
76
77
|
}, [_createVNode("div", {
|
77
78
|
"class": bem("node")
|
78
|
-
}, [renderLoading()])]);
|
79
|
+
}, [renderLoading()]), (_a = slots.background) == null ? void 0 : _a.call(slots)]);
|
79
80
|
};
|
80
81
|
}
|
81
82
|
});
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import { type App } from 'vue';
|
2
|
-
import {
|
3
|
-
|
4
|
-
declare function Toast(options?: string | ToastOptions): ComponentInstance;
|
2
|
+
import type { ToastType, ToastOptions, ToastWrapperInstance } from './types';
|
3
|
+
declare function Toast(options?: string | ToastOptions): ToastWrapperInstance;
|
5
4
|
declare namespace Toast {
|
6
|
-
var loading: (options: string | ToastOptions) =>
|
7
|
-
var success: (options: string | ToastOptions) =>
|
8
|
-
var fail: (options: string | ToastOptions) =>
|
5
|
+
var loading: (options: string | ToastOptions) => ToastWrapperInstance;
|
6
|
+
var success: (options: string | ToastOptions) => ToastWrapperInstance;
|
7
|
+
var fail: (options: string | ToastOptions) => ToastWrapperInstance;
|
9
8
|
var clear: (all?: boolean | undefined) => void;
|
10
9
|
var setDefaultOptions: {
|
11
10
|
(options: ToastOptions): void;
|
package/es/toast/types.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Toast } from './function-call';
|
2
|
-
import type { TeleportProps } from 'vue';
|
2
|
+
import type { ComponentPublicInstance, TeleportProps } from 'vue';
|
3
3
|
import type { LoadingType } from '../loading';
|
4
4
|
import type { Numeric } from '../utils';
|
5
5
|
export declare type ToastType = 'text' | 'loading' | 'success' | 'fail' | 'html';
|
@@ -31,3 +31,12 @@ declare module '@vue/runtime-core' {
|
|
31
31
|
$toast: typeof Toast;
|
32
32
|
}
|
33
33
|
}
|
34
|
+
export declare type ToastWrapperInstance = ComponentPublicInstance<{
|
35
|
+
message: Numeric;
|
36
|
+
}, {
|
37
|
+
clear: () => void;
|
38
|
+
/**
|
39
|
+
* @private
|
40
|
+
*/
|
41
|
+
open: (props: Record<string, any>) => void;
|
42
|
+
}>;
|
@@ -54,7 +54,7 @@ declare const uploaderProps: {
|
|
54
54
|
type: BooleanConstructor;
|
55
55
|
default: true;
|
56
56
|
};
|
57
|
-
previewOptions: PropType<ImagePreviewOptions
|
57
|
+
previewOptions: PropType<Partial<ImagePreviewOptions>>;
|
58
58
|
previewFullImage: {
|
59
59
|
type: BooleanConstructor;
|
60
60
|
default: true;
|
@@ -116,7 +116,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
116
116
|
type: BooleanConstructor;
|
117
117
|
default: true;
|
118
118
|
};
|
119
|
-
previewOptions: PropType<ImagePreviewOptions
|
119
|
+
previewOptions: PropType<Partial<ImagePreviewOptions>>;
|
120
120
|
previewFullImage: {
|
121
121
|
type: BooleanConstructor;
|
122
122
|
default: true;
|
@@ -176,7 +176,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
176
176
|
type: BooleanConstructor;
|
177
177
|
default: true;
|
178
178
|
};
|
179
|
-
previewOptions: PropType<ImagePreviewOptions
|
179
|
+
previewOptions: PropType<Partial<ImagePreviewOptions>>;
|
180
180
|
previewFullImage: {
|
181
181
|
type: BooleanConstructor;
|
182
182
|
default: true;
|