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/es/uploader/index.d.ts
CHANGED
@@ -50,7 +50,7 @@ export declare const Uploader: import("../utils").WithInstall<import("vue").Defi
|
|
50
50
|
type: BooleanConstructor;
|
51
51
|
default: true;
|
52
52
|
};
|
53
|
-
previewOptions: import("vue").PropType<import("..").ImagePreviewOptions
|
53
|
+
previewOptions: import("vue").PropType<Partial<import("..").ImagePreviewOptions>>;
|
54
54
|
previewFullImage: {
|
55
55
|
type: BooleanConstructor;
|
56
56
|
default: true;
|
@@ -110,7 +110,7 @@ export declare const Uploader: import("../utils").WithInstall<import("vue").Defi
|
|
110
110
|
type: BooleanConstructor;
|
111
111
|
default: true;
|
112
112
|
};
|
113
|
-
previewOptions: import("vue").PropType<import("..").ImagePreviewOptions
|
113
|
+
previewOptions: import("vue").PropType<Partial<import("..").ImagePreviewOptions>>;
|
114
114
|
previewFullImage: {
|
115
115
|
type: BooleanConstructor;
|
116
116
|
default: true;
|
@@ -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;
|
@@ -25,9 +25,11 @@ var import_vue = require("vue");
|
|
25
25
|
var import_vue2 = require("vue");
|
26
26
|
var import_utils = require("../utils");
|
27
27
|
var import_use = require("@vant/use");
|
28
|
+
var import_use_placeholder = require("../composables/use-placeholder");
|
28
29
|
const [name, bem] = (0, import_utils.createNamespace)("action-bar");
|
29
30
|
const ACTION_BAR_KEY = Symbol(name);
|
30
31
|
const actionBarProps = {
|
32
|
+
placeholder: Boolean,
|
31
33
|
safeAreaInsetBottom: import_utils.truthProp
|
32
34
|
};
|
33
35
|
var stdin_default = (0, import_vue2.defineComponent)({
|
@@ -36,17 +38,26 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
36
38
|
setup(props, {
|
37
39
|
slots
|
38
40
|
}) {
|
41
|
+
const root = (0, import_vue2.ref)();
|
42
|
+
const renderPlaceholder = (0, import_use_placeholder.usePlaceholder)(root, bem);
|
39
43
|
const {
|
40
44
|
linkChildren
|
41
45
|
} = (0, import_use.useChildren)(ACTION_BAR_KEY);
|
42
46
|
linkChildren();
|
43
|
-
|
47
|
+
const renderActionBar = () => {
|
44
48
|
var _a;
|
45
49
|
return (0, import_vue.createVNode)("div", {
|
50
|
+
"ref": root,
|
46
51
|
"class": [bem(), {
|
47
52
|
"van-safe-area-bottom": props.safeAreaInsetBottom
|
48
53
|
}]
|
49
54
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
50
55
|
};
|
56
|
+
return () => {
|
57
|
+
if (props.placeholder) {
|
58
|
+
return renderPlaceholder(renderActionBar);
|
59
|
+
}
|
60
|
+
return renderActionBar();
|
61
|
+
};
|
51
62
|
}
|
52
63
|
});
|
@@ -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/lib/calendar/Calendar.js
CHANGED
@@ -137,6 +137,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
137
137
|
const months = (0, import_vue2.computed)(() => {
|
138
138
|
const months2 = [];
|
139
139
|
const cursor = new Date(props.minDate);
|
140
|
+
if (props.lazyRender && !props.show && props.poppable) {
|
141
|
+
return months2;
|
142
|
+
}
|
140
143
|
cursor.setDate(1);
|
141
144
|
do {
|
142
145
|
months2.push(new Date(cursor));
|
package/lib/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/lib/dialog/Dialog.js
CHANGED
@@ -43,8 +43,10 @@ const dialogProps = (0, import_utils.extend)({}, import_shared.popupSharedProps,
|
|
43
43
|
showCancelButton: Boolean,
|
44
44
|
cancelButtonText: String,
|
45
45
|
cancelButtonColor: String,
|
46
|
+
cancelButtonDisabled: Boolean,
|
46
47
|
confirmButtonText: String,
|
47
48
|
confirmButtonColor: String,
|
49
|
+
confirmButtonDisabled: Boolean,
|
48
50
|
showConfirmButton: import_utils.truthProp,
|
49
51
|
closeOnClickOverlay: Boolean
|
50
52
|
});
|
@@ -165,6 +167,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
165
167
|
color: props.cancelButtonColor
|
166
168
|
},
|
167
169
|
"loading": loading.cancel,
|
170
|
+
"disabled": props.cancelButtonDisabled,
|
168
171
|
"onClick": onCancel
|
169
172
|
}, null), props.showConfirmButton && (0, import_vue.createVNode)(import_button.Button, {
|
170
173
|
"size": "large",
|
@@ -176,6 +179,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
176
179
|
color: props.confirmButtonColor
|
177
180
|
},
|
178
181
|
"loading": loading.confirm,
|
182
|
+
"disabled": props.confirmButtonDisabled,
|
179
183
|
"onClick": onConfirm
|
180
184
|
}, null)]);
|
181
185
|
const renderRoundButtons = () => (0, import_vue.createVNode)(import_action_bar.ActionBar, {
|
@@ -187,6 +191,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
187
191
|
"class": bem("cancel"),
|
188
192
|
"color": props.cancelButtonColor,
|
189
193
|
"loading": loading.cancel,
|
194
|
+
"disabled": props.cancelButtonDisabled,
|
190
195
|
"onClick": onCancel
|
191
196
|
}, null), props.showConfirmButton && (0, import_vue.createVNode)(import_action_bar_button.ActionBarButton, {
|
192
197
|
"type": "danger",
|
@@ -194,6 +199,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
194
199
|
"class": bem("confirm"),
|
195
200
|
"color": props.confirmButtonColor,
|
196
201
|
"loading": loading.confirm,
|
202
|
+
"disabled": props.confirmButtonDisabled,
|
197
203
|
"onClick": onConfirm
|
198
204
|
}, null)]
|
199
205
|
});
|
@@ -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;
|
@@ -77,8 +77,10 @@ Dialog.defaultOptions = {
|
|
77
77
|
messageAlign: "",
|
78
78
|
cancelButtonText: "",
|
79
79
|
cancelButtonColor: null,
|
80
|
+
cancelButtonDisabled: false,
|
80
81
|
confirmButtonText: "",
|
81
82
|
confirmButtonColor: null,
|
83
|
+
confirmButtonDisabled: false,
|
82
84
|
showConfirmButton: true,
|
83
85
|
showCancelButton: false,
|
84
86
|
closeOnPopstate: true,
|
package/lib/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/lib/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/lib/field/Field.js
CHANGED
@@ -81,7 +81,7 @@ const fieldProps = (0, import_utils.extend)({}, import_Cell.cellSharedProps, fie
|
|
81
81
|
var stdin_default = (0, import_vue2.defineComponent)({
|
82
82
|
name,
|
83
83
|
props: fieldProps,
|
84
|
-
emits: ["blur", "focus", "clear", "keypress", "click-input", "click-left-icon", "click-right-icon", "update:modelValue"],
|
84
|
+
emits: ["blur", "focus", "clear", "keypress", "click-input", "end-validate", "start-validate", "click-left-icon", "click-right-icon", "update:modelValue"],
|
85
85
|
setup(props, {
|
86
86
|
emit,
|
87
87
|
slots
|
@@ -155,18 +155,24 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
155
155
|
state.status = "unvalidated";
|
156
156
|
state.validateMessage = "";
|
157
157
|
};
|
158
|
+
const endValidate = () => emit("end-validate", {
|
159
|
+
status: state.status
|
160
|
+
});
|
158
161
|
const validate = (rules = props.rules) => new Promise((resolve) => {
|
159
162
|
resetValidation();
|
160
163
|
if (rules) {
|
164
|
+
emit("start-validate");
|
161
165
|
runRules(rules).then(() => {
|
162
166
|
if (state.status === "failed") {
|
163
167
|
resolve({
|
164
168
|
name: props.name,
|
165
169
|
message: state.validateMessage
|
166
170
|
});
|
171
|
+
endValidate();
|
167
172
|
} else {
|
168
173
|
state.status = "passed";
|
169
174
|
resolve();
|
175
|
+
endValidate();
|
170
176
|
}
|
171
177
|
});
|
172
178
|
} else {
|
package/lib/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/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
@@ -194,7 +194,7 @@ __reExport(stdin_exports, require("./tag"), module.exports);
|
|
194
194
|
__reExport(stdin_exports, require("./toast"), module.exports);
|
195
195
|
__reExport(stdin_exports, require("./tree-select"), module.exports);
|
196
196
|
__reExport(stdin_exports, require("./uploader"), module.exports);
|
197
|
-
const version = "3.5.
|
197
|
+
const version = "3.5.2";
|
198
198
|
function install(app) {
|
199
199
|
const components = [
|
200
200
|
import_action_bar.ActionBar,
|
package/lib/picker/Picker.js
CHANGED
@@ -136,7 +136,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
136
136
|
} else {
|
137
137
|
formattedColumns.value = columns;
|
138
138
|
}
|
139
|
-
hasOptions.value = formattedColumns.value.some((item) => item[columnsFieldNames.value.values] && item[columnsFieldNames.value.values].length !== 0);
|
139
|
+
hasOptions.value = formattedColumns.value.some((item) => item[columnsFieldNames.value.values] && item[columnsFieldNames.value.values].length !== 0) || children.some((item) => item.hasOptions);
|
140
140
|
};
|
141
141
|
const getIndexes = () => children.map((child) => child.state.index);
|
142
142
|
const setColumnValues = (index, options) => {
|
@@ -225,6 +225,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
225
225
|
}
|
226
226
|
};
|
227
227
|
const getValue = () => state.options[state.index];
|
228
|
+
const hasOptions = () => state.options.length;
|
228
229
|
setIndex(state.index);
|
229
230
|
(0, import_use.useParent)(PICKER_KEY);
|
230
231
|
(0, import_use_expose.useExpose)({
|
@@ -233,6 +234,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
233
234
|
getValue,
|
234
235
|
setValue,
|
235
236
|
setOptions,
|
237
|
+
hasOptions,
|
236
238
|
stopMomentum
|
237
239
|
});
|
238
240
|
(0, import_vue2.watch)(() => props.initialOptions, setOptions);
|
package/lib/popup/Popup.js
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
|
}, {
|
@@ -44,7 +44,7 @@ const pullRefreshProps = {
|
|
44
44
|
var stdin_default = (0, import_vue2.defineComponent)({
|
45
45
|
name,
|
46
46
|
props: pullRefreshProps,
|
47
|
-
emits: ["refresh", "update:modelValue"],
|
47
|
+
emits: ["change", "refresh", "update:modelValue"],
|
48
48
|
setup(props, {
|
49
49
|
emit,
|
50
50
|
slots
|
@@ -89,6 +89,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
89
89
|
} else {
|
90
90
|
state.status = "loosing";
|
91
91
|
}
|
92
|
+
emit("change", {
|
93
|
+
status: state.status,
|
94
|
+
distance
|
95
|
+
});
|
92
96
|
};
|
93
97
|
const getStatusText = () => {
|
94
98
|
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;
|
@@ -25,6 +25,7 @@ var import_vue2 = require("vue");
|
|
25
25
|
var import_utils = require("../utils");
|
26
26
|
var import_icon = require("../icon");
|
27
27
|
var import_button = require("../button");
|
28
|
+
var import_use_placeholder = require("../composables/use-placeholder");
|
28
29
|
const [name, bem, t] = (0, import_utils.createNamespace)("submit-bar");
|
29
30
|
const submitBarProps = {
|
30
31
|
tip: String,
|
@@ -39,6 +40,7 @@ const submitBarProps = {
|
|
39
40
|
buttonType: (0, import_utils.makeStringProp)("danger"),
|
40
41
|
buttonColor: String,
|
41
42
|
suffixLabel: String,
|
43
|
+
placeholder: Boolean,
|
42
44
|
decimalLength: (0, import_utils.makeNumericProp)(2),
|
43
45
|
safeAreaInsetBottom: import_utils.truthProp
|
44
46
|
};
|
@@ -50,6 +52,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
50
52
|
emit,
|
51
53
|
slots
|
52
54
|
}) {
|
55
|
+
const root = (0, import_vue2.ref)();
|
56
|
+
const renderPlaceholder = (0, import_use_placeholder.usePlaceholder)(root, bem);
|
53
57
|
const renderText = () => {
|
54
58
|
const {
|
55
59
|
price,
|
@@ -109,9 +113,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
109
113
|
"onClick": onClickButton
|
110
114
|
}, null);
|
111
115
|
};
|
112
|
-
|
116
|
+
const renderSubmitBar = () => {
|
113
117
|
var _a, _b;
|
114
118
|
return (0, import_vue.createVNode)("div", {
|
119
|
+
"ref": root,
|
115
120
|
"class": [bem(), {
|
116
121
|
"van-safe-area-bottom": props.safeAreaInsetBottom
|
117
122
|
}]
|
@@ -119,5 +124,11 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
119
124
|
"class": bem("bar")
|
120
125
|
}, [(_b = slots.default) == null ? void 0 : _b.call(slots), renderText(), renderButton()])]);
|
121
126
|
};
|
127
|
+
return () => {
|
128
|
+
if (props.placeholder) {
|
129
|
+
return renderPlaceholder(renderSubmitBar);
|
130
|
+
}
|
131
|
+
return renderSubmitBar();
|
132
|
+
};
|
122
133
|
}
|
123
134
|
});
|
@@ -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/lib/switch/Switch.js
CHANGED
@@ -72,6 +72,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
72
72
|
};
|
73
73
|
(0, import_use.useCustomFieldValue)(() => props.modelValue);
|
74
74
|
return () => {
|
75
|
+
var _a;
|
75
76
|
const {
|
76
77
|
size,
|
77
78
|
loading,
|
@@ -97,7 +98,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
97
98
|
"onClick": onClick
|
98
99
|
}, [(0, import_vue.createVNode)("div", {
|
99
100
|
"class": bem("node")
|
100
|
-
}, [renderLoading()])]);
|
101
|
+
}, [renderLoading()]), (_a = slots.background) == null ? void 0 : _a.call(slots)]);
|
101
102
|
};
|
102
103
|
}
|
103
104
|
});
|
@@ -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/lib/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;
|