vant 3.5.0 → 3.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +10 -0
- package/README.md +13 -13
- package/changelog.generated.md +67 -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/button/index.less +1 -1
- package/es/calendar/Calendar.mjs +6 -1
- package/es/calendar/types.d.ts +1 -0
- package/es/cell/Cell.d.ts +1 -1
- package/es/cell/index.d.ts +1 -1
- package/es/collapse/Collapse.d.ts +8 -1
- package/es/collapse/Collapse.mjs +28 -1
- package/es/collapse/index.d.ts +1 -1
- package/es/collapse-item/CollapseItem.d.ts +1 -1
- package/es/collapse-item/CollapseItem.mjs +3 -1
- package/es/collapse-item/index.d.ts +1 -1
- package/es/collapse-item/index.less +1 -1
- package/es/composables/use-height.d.ts +1 -1
- package/es/composables/use-height.mjs +6 -2
- package/es/composables/use-placeholder.mjs +1 -1
- package/es/dialog/Dialog.d.ts +1 -1
- package/es/field/Field.d.ts +4 -2
- package/es/field/Field.mjs +7 -1
- package/es/field/index.d.ts +4 -2
- package/es/field/index.less +1 -1
- package/es/grid-item/index.less +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/locale/index.d.ts +1 -1
- package/es/popover/Popover.mjs +17 -18
- package/es/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/sidebar-item/index.less +1 -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/swipe/index.less +1 -1
- package/es/switch/index.less +1 -1
- package/es/toast/function-call.d.ts +5 -6
- package/es/toast/index.less +1 -1
- package/es/toast/types.d.ts +10 -1
- package/es/uploader/Uploader.d.ts +3 -3
- package/es/uploader/Uploader.mjs +1 -1
- package/es/uploader/index.d.ts +2 -2
- package/es/utils/basic.d.ts +3 -3
- package/es/utils/create.d.ts +1 -1
- package/lib/.DS_Store +0 -0
- package/lib/action-bar/.DS_Store +0 -0
- package/lib/action-bar/ActionBar.d.ts +4 -0
- package/lib/action-bar/ActionBar.js +12 -1
- package/lib/action-bar/index.d.ts +3 -0
- package/lib/action-bar-button/.DS_Store +0 -0
- package/lib/action-bar-icon/.DS_Store +0 -0
- package/lib/action-sheet/.DS_Store +0 -0
- package/lib/address-edit/.DS_Store +0 -0
- package/lib/address-list/.DS_Store +0 -0
- package/lib/area/.DS_Store +0 -0
- package/lib/badge/.DS_Store +0 -0
- package/lib/button/.DS_Store +0 -0
- package/lib/button/index.less +1 -1
- package/lib/calendar/.DS_Store +0 -0
- package/lib/calendar/Calendar.js +6 -1
- package/lib/calendar/types.d.ts +1 -0
- package/lib/card/.DS_Store +0 -0
- package/lib/cascader/.DS_Store +0 -0
- package/lib/cell/.DS_Store +0 -0
- package/lib/cell/Cell.d.ts +1 -1
- package/lib/cell/index.d.ts +1 -1
- package/lib/cell-group/.DS_Store +0 -0
- package/lib/checkbox/.DS_Store +0 -0
- package/lib/checkbox-group/.DS_Store +0 -0
- package/lib/circle/.DS_Store +0 -0
- package/lib/col/.DS_Store +0 -0
- package/lib/collapse/.DS_Store +0 -0
- package/lib/collapse/Collapse.d.ts +8 -1
- package/lib/collapse/Collapse.js +28 -1
- package/lib/collapse/index.d.ts +1 -1
- package/lib/collapse-item/.DS_Store +0 -0
- package/lib/collapse-item/CollapseItem.d.ts +1 -1
- package/lib/collapse-item/CollapseItem.js +3 -1
- package/lib/collapse-item/index.d.ts +1 -1
- package/lib/collapse-item/index.less +1 -1
- package/lib/composables/use-height.d.ts +1 -1
- package/lib/composables/use-height.js +6 -2
- package/lib/composables/use-placeholder.js +1 -1
- package/lib/config-provider/.DS_Store +0 -0
- package/lib/contact-card/.DS_Store +0 -0
- package/lib/contact-edit/.DS_Store +0 -0
- package/lib/contact-list/.DS_Store +0 -0
- package/lib/count-down/.DS_Store +0 -0
- package/lib/coupon/.DS_Store +0 -0
- package/lib/coupon-cell/.DS_Store +0 -0
- package/lib/coupon-list/.DS_Store +0 -0
- package/lib/datetime-picker/.DS_Store +0 -0
- package/lib/dialog/.DS_Store +0 -0
- package/lib/dialog/Dialog.d.ts +1 -1
- package/lib/divider/.DS_Store +0 -0
- package/lib/dropdown-item/.DS_Store +0 -0
- package/lib/dropdown-menu/.DS_Store +0 -0
- package/lib/empty/.DS_Store +0 -0
- package/lib/field/.DS_Store +0 -0
- package/lib/field/Field.d.ts +4 -2
- package/lib/field/Field.js +7 -1
- package/lib/field/index.d.ts +4 -2
- package/lib/field/index.less +1 -1
- package/lib/form/.DS_Store +0 -0
- package/lib/grid/.DS_Store +0 -0
- package/lib/grid-item/.DS_Store +0 -0
- package/lib/grid-item/index.less +1 -1
- package/lib/icon/.DS_Store +0 -0
- package/lib/image/.DS_Store +0 -0
- package/lib/image-preview/.DS_Store +0 -0
- package/lib/index-anchor/.DS_Store +0 -0
- package/lib/index-bar/.DS_Store +0 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/lazyload/.DS_Store +0 -0
- package/lib/list/.DS_Store +0 -0
- package/lib/loading/.DS_Store +0 -0
- package/lib/locale/.DS_Store +0 -0
- package/lib/locale/index.d.ts +1 -1
- package/lib/nav-bar/.DS_Store +0 -0
- package/lib/notice-bar/.DS_Store +0 -0
- package/lib/notify/.DS_Store +0 -0
- package/lib/number-keyboard/.DS_Store +0 -0
- package/lib/overlay/.DS_Store +0 -0
- package/lib/pagination/.DS_Store +0 -0
- package/lib/password-input/.DS_Store +0 -0
- package/lib/picker/.DS_Store +0 -0
- package/lib/popover/.DS_Store +0 -0
- package/lib/popover/Popover.js +17 -18
- package/lib/popup/.DS_Store +0 -0
- package/lib/popup/Popup.js +1 -1
- package/lib/progress/.DS_Store +0 -0
- package/lib/pull-refresh/.DS_Store +0 -0
- 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/radio/.DS_Store +0 -0
- package/lib/radio-group/.DS_Store +0 -0
- package/lib/rate/.DS_Store +0 -0
- package/lib/row/.DS_Store +0 -0
- package/lib/search/.DS_Store +0 -0
- package/lib/share-sheet/.DS_Store +0 -0
- package/lib/sidebar/.DS_Store +0 -0
- package/lib/sidebar-item/.DS_Store +0 -0
- package/lib/sidebar-item/index.less +1 -1
- package/lib/skeleton/.DS_Store +0 -0
- package/lib/slider/.DS_Store +0 -0
- package/lib/step/.DS_Store +0 -0
- package/lib/stepper/.DS_Store +0 -0
- package/lib/steps/.DS_Store +0 -0
- package/lib/sticky/.DS_Store +0 -0
- package/lib/submit-bar/.DS_Store +0 -0
- package/lib/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/swipe/.DS_Store +0 -0
- package/lib/swipe/index.less +1 -1
- package/lib/swipe-cell/.DS_Store +0 -0
- package/lib/swipe-item/.DS_Store +0 -0
- package/lib/switch/.DS_Store +0 -0
- package/lib/switch/index.less +1 -1
- package/lib/tab/.DS_Store +0 -0
- package/lib/tabbar/.DS_Store +0 -0
- package/lib/tabbar-item/.DS_Store +0 -0
- package/lib/tabs/.DS_Store +0 -0
- package/lib/tag/.DS_Store +0 -0
- package/lib/toast/.DS_Store +0 -0
- package/lib/toast/function-call.d.ts +5 -6
- package/lib/toast/index.less +1 -1
- package/lib/toast/types.d.ts +10 -1
- package/lib/tree-select/.DS_Store +0 -0
- package/lib/uploader/.DS_Store +0 -0
- package/lib/uploader/Uploader.d.ts +3 -3
- package/lib/uploader/Uploader.js +1 -1
- package/lib/uploader/index.d.ts +2 -2
- package/lib/utils/basic.d.ts +3 -3
- package/lib/utils/create.d.ts +1 -1
- package/lib/vant.cjs.js +191 -52
- package/lib/vant.es.js +280 -51
- package/lib/vant.js +189 -50
- package/lib/vant.min.js +1 -1
- package/{vetur → lib}/web-types.json +1652 -1609
- package/package.json +9 -14
- 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 -14660
- package/vetur/attributes.json +0 -3474
- package/vetur/tags.json +0 -1202
@@ -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;
|
Binary file
|
package/lib/swipe/index.less
CHANGED
Binary file
|
Binary file
|
Binary file
|
package/lib/switch/index.less
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
left: 0;
|
34
34
|
width: var(--van-switch-node-size);
|
35
35
|
height: var(--van-switch-node-size);
|
36
|
-
// https://github.com/
|
36
|
+
// https://github.com/vant-ui/vant/issues/9839
|
37
37
|
font-size: inherit;
|
38
38
|
background: var(--van-switch-node-background-color);
|
39
39
|
border-radius: 100%;
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -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/index.less
CHANGED
@@ -38,7 +38,7 @@
|
|
38
38
|
// allow newline character
|
39
39
|
white-space: pre-wrap;
|
40
40
|
text-align: center;
|
41
|
-
// https://github.com/
|
41
|
+
// https://github.com/vant-ui/vant/issues/8959
|
42
42
|
word-break: break-all;
|
43
43
|
background: var(--van-toast-background-color);
|
44
44
|
border-radius: var(--van-toast-border-radius);
|
package/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
|
+
}>;
|
Binary file
|
Binary file
|
@@ -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;
|
package/lib/uploader/Uploader.js
CHANGED
@@ -172,7 +172,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
172
172
|
if (props.previewFullImage) {
|
173
173
|
const imageFiles = props.modelValue.filter(import_utils2.isImageFile);
|
174
174
|
const images = imageFiles.map((item2) => {
|
175
|
-
if (item2.file && !item2.url) {
|
175
|
+
if (item2.file && !item2.url && item2.status !== "failed") {
|
176
176
|
item2.url = URL.createObjectURL(item2.file);
|
177
177
|
urls.push(item2.url);
|
178
178
|
}
|
package/lib/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;
|
package/lib/utils/basic.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { ComponentPublicInstance } from 'vue';
|
2
2
|
export declare function noop(): void;
|
3
3
|
export declare const extend: {
|
4
|
-
<T, U>(target: T, source: U): T & U;
|
5
|
-
<T_1, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
6
|
-
<T_2, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
4
|
+
<T extends {}, U>(target: T, source: U): T & U;
|
5
|
+
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
6
|
+
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
7
7
|
(target: object, ...sources: any[]): any;
|
8
8
|
};
|
9
9
|
export declare const inBrowser: boolean;
|
package/lib/utils/create.d.ts
CHANGED
@@ -12,6 +12,6 @@ export declare type Mods = Mod | Mod[];
|
|
12
12
|
* b('text', { disabled }) // 'button__text button__text--disabled'
|
13
13
|
* b(['disabled', 'primary']) // 'button button--disabled button--primary'
|
14
14
|
*/
|
15
|
-
export declare function createBEM(name: string): (el?: Mods
|
15
|
+
export declare function createBEM(name: string): (el?: Mods, mods?: Mods) => Mods;
|
16
16
|
export declare type BEM = ReturnType<typeof createBEM>;
|
17
17
|
export declare function createNamespace(name: string): readonly [string, (el?: Mods | undefined, mods?: Mods | undefined) => Mods, (path: string, ...args: unknown[]) => any];
|