vant 3.4.6 → 3.4.7
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/changelog.generated.md +39 -50
- package/es/address-list/AddressListItem.d.ts +3 -2
- package/es/address-list/AddressListItem.js +1 -1
- package/es/badge/Badge.d.ts +4 -3
- package/es/badge/index.d.ts +2 -2
- package/es/calendar/Calendar.js +1 -1
- package/es/calendar/types.d.ts +2 -1
- package/es/cascader/types.d.ts +2 -1
- package/es/checkbox/Checker.d.ts +2 -1
- package/es/collapse/Collapse.d.ts +7 -6
- package/es/collapse/index.d.ts +3 -3
- package/es/composables/use-touch.js +1 -1
- package/es/config-provider/ConfigProvider.d.ts +4 -3
- package/es/config-provider/index.d.ts +2 -2
- package/es/contact-list/ContactList.d.ts +3 -2
- package/es/coupon/Coupon.d.ts +2 -1
- package/es/coupon-list/CouponList.d.ts +3 -13
- package/es/coupon-list/CouponList.js +9 -7
- package/es/coupon-list/index.css +1 -1
- package/es/coupon-list/index.d.ts +2 -9
- package/es/coupon-list/index.less +4 -16
- package/es/coupon-list/style/index.js +1 -0
- package/es/coupon-list/style/less.js +1 -0
- package/es/coupon-list/var.less +0 -1
- package/es/datetime-picker/DatePicker.js +1 -2
- package/es/dialog/types.d.ts +2 -2
- package/es/dropdown-item/types.d.ts +2 -1
- package/es/index-bar/IndexBar.d.ts +5 -4
- package/es/index-bar/IndexBar.js +25 -4
- package/es/index-bar/index.d.ts +3 -3
- package/es/index-bar/types.d.ts +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/locale/lang/is-IS.d.ts +64 -0
- package/es/locale/lang/is-IS.js +74 -0
- package/es/locale/lang/la-LA.d.ts +64 -0
- package/es/locale/lang/la-LA.js +66 -0
- package/es/locale/lang/sv-SE.d.ts +64 -0
- package/es/locale/lang/sv-SE.js +66 -0
- package/es/notify/types.d.ts +2 -1
- package/es/number-keyboard/NumberKeyboard.js +10 -1
- package/es/picker/types.d.ts +3 -2
- package/es/progress/Progress.d.ts +4 -3
- package/es/progress/index.d.ts +2 -2
- package/es/skeleton/Skeleton.d.ts +5 -4
- package/es/skeleton/index.d.ts +3 -3
- package/es/tabbar/Tabbar.d.ts +2 -2
- package/es/tabs/Tabs.d.ts +1 -1
- package/es/tabs/Tabs.js +1 -0
- package/es/tabs/types.d.ts +5 -4
- package/es/toast/types.d.ts +3 -2
- package/es/tree-select/TreeSelect.d.ts +7 -6
- package/es/tree-select/index.d.ts +3 -3
- package/es/uploader/Uploader.d.ts +4 -4
- package/es/uploader/Uploader.js +2 -2
- package/es/uploader/UploaderPreviewItem.d.ts +3 -3
- package/es/uploader/UploaderPreviewItem.js +9 -6
- package/es/uploader/index.d.ts +2 -2
- package/es/uploader/types.d.ts +5 -5
- package/es/utils/basic.d.ts +1 -0
- package/es/utils/format.d.ts +7 -6
- package/es/utils/format.js +6 -0
- package/es/utils/validate.d.ts +2 -1
- package/lib/address-list/AddressListItem.d.ts +3 -2
- package/lib/badge/Badge.d.ts +4 -3
- package/lib/badge/index.d.ts +2 -2
- package/lib/calendar/Calendar.js +1 -1
- package/lib/calendar/types.d.ts +2 -1
- package/lib/cascader/types.d.ts +2 -1
- package/lib/checkbox/Checker.d.ts +2 -1
- package/lib/collapse/Collapse.d.ts +7 -6
- package/lib/collapse/index.d.ts +3 -3
- package/lib/composables/use-touch.js +1 -1
- package/lib/config-provider/ConfigProvider.d.ts +4 -3
- package/lib/config-provider/index.d.ts +2 -2
- package/lib/contact-list/ContactList.d.ts +3 -2
- package/lib/coupon/Coupon.d.ts +2 -1
- package/lib/coupon-list/CouponList.d.ts +3 -13
- package/lib/coupon-list/CouponList.js +9 -7
- package/lib/coupon-list/index.css +1 -1
- package/lib/coupon-list/index.d.ts +2 -9
- package/lib/coupon-list/index.less +4 -16
- package/lib/coupon-list/style/index.js +1 -0
- package/lib/coupon-list/style/less.js +1 -0
- package/lib/coupon-list/var.less +0 -1
- package/lib/datetime-picker/DatePicker.js +1 -2
- package/lib/dialog/types.d.ts +2 -2
- package/lib/dropdown-item/types.d.ts +2 -1
- package/lib/index-bar/IndexBar.d.ts +5 -4
- package/lib/index-bar/IndexBar.js +25 -4
- package/lib/index-bar/index.d.ts +3 -3
- package/lib/index-bar/types.d.ts +2 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.less +2 -2
- package/lib/locale/lang/is-IS.d.ts +64 -0
- package/lib/locale/lang/is-IS.js +98 -0
- package/lib/locale/lang/la-LA.d.ts +64 -0
- package/lib/locale/lang/la-LA.js +90 -0
- package/lib/locale/lang/sv-SE.d.ts +64 -0
- package/lib/locale/lang/sv-SE.js +90 -0
- package/lib/notify/types.d.ts +2 -1
- package/lib/number-keyboard/NumberKeyboard.js +10 -1
- package/lib/picker/types.d.ts +3 -2
- package/lib/progress/Progress.d.ts +4 -3
- package/lib/progress/index.d.ts +2 -2
- package/lib/skeleton/Skeleton.d.ts +5 -4
- package/lib/skeleton/index.d.ts +3 -3
- package/lib/tabbar/Tabbar.d.ts +2 -2
- package/lib/tabs/Tabs.d.ts +1 -1
- package/lib/tabs/Tabs.js +1 -0
- package/lib/tabs/types.d.ts +5 -4
- package/lib/toast/types.d.ts +3 -2
- package/lib/tree-select/TreeSelect.d.ts +7 -6
- package/lib/tree-select/index.d.ts +3 -3
- package/lib/uploader/Uploader.d.ts +4 -4
- package/lib/uploader/Uploader.js +1 -1
- package/lib/uploader/UploaderPreviewItem.d.ts +3 -3
- package/lib/uploader/UploaderPreviewItem.js +9 -6
- package/lib/uploader/index.d.ts +2 -2
- package/lib/uploader/types.d.ts +5 -5
- package/lib/utils/basic.d.ts +1 -0
- package/lib/utils/format.d.ts +7 -6
- package/lib/utils/format.js +6 -0
- package/lib/utils/validate.d.ts +2 -1
- package/lib/vant.cjs.js +269 -229
- package/lib/vant.cjs.min.js +1 -1
- package/lib/vant.es.js +269 -229
- package/lib/vant.es.min.js +269 -229
- package/lib/vant.js +269 -229
- package/lib/vant.min.js +1 -1
- package/package.json +1 -1
- package/vetur/attributes.json +641 -638
- package/vetur/tags.json +227 -227
- package/vetur/web-types.json +2160 -2158
@@ -1,4 +1,5 @@
|
|
1
1
|
import { type PropType, type ExtractPropTypes } from 'vue';
|
2
|
+
import { type Numeric } from '../utils';
|
2
3
|
export declare type SkeletonAvatarShape = 'square' | 'round';
|
3
4
|
declare const skeletonProps: {
|
4
5
|
row: {
|
@@ -23,7 +24,7 @@ declare const skeletonProps: {
|
|
23
24
|
default: SkeletonAvatarShape;
|
24
25
|
};
|
25
26
|
rowWidth: {
|
26
|
-
type: PropType<
|
27
|
+
type: PropType<Numeric | Numeric[]>;
|
27
28
|
default: string;
|
28
29
|
};
|
29
30
|
};
|
@@ -51,7 +52,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
51
52
|
default: SkeletonAvatarShape;
|
52
53
|
};
|
53
54
|
rowWidth: {
|
54
|
-
type: PropType<
|
55
|
+
type: PropType<Numeric | Numeric[]>;
|
55
56
|
default: string;
|
56
57
|
};
|
57
58
|
}, () => JSX.Element | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
@@ -79,7 +80,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
79
80
|
default: SkeletonAvatarShape;
|
80
81
|
};
|
81
82
|
rowWidth: {
|
82
|
-
type: PropType<
|
83
|
+
type: PropType<Numeric | Numeric[]>;
|
83
84
|
default: string;
|
84
85
|
};
|
85
86
|
}>>, {
|
@@ -90,6 +91,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
90
91
|
row: string | number;
|
91
92
|
avatar: boolean;
|
92
93
|
avatarShape: SkeletonAvatarShape;
|
93
|
-
rowWidth:
|
94
|
+
rowWidth: Numeric | Numeric[];
|
94
95
|
}>;
|
95
96
|
export default _default;
|
package/es/skeleton/index.d.ts
CHANGED
@@ -21,7 +21,7 @@ export declare const Skeleton: import("../utils").WithInstall<import("vue").Defi
|
|
21
21
|
default: import("./Skeleton").SkeletonAvatarShape;
|
22
22
|
};
|
23
23
|
rowWidth: {
|
24
|
-
type: import("vue").PropType<
|
24
|
+
type: import("vue").PropType<import("../utils").Numeric | import("../utils").Numeric[]>;
|
25
25
|
default: string;
|
26
26
|
};
|
27
27
|
}, () => JSX.Element | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
@@ -49,7 +49,7 @@ export declare const Skeleton: import("../utils").WithInstall<import("vue").Defi
|
|
49
49
|
default: import("./Skeleton").SkeletonAvatarShape;
|
50
50
|
};
|
51
51
|
rowWidth: {
|
52
|
-
type: import("vue").PropType<
|
52
|
+
type: import("vue").PropType<import("../utils").Numeric | import("../utils").Numeric[]>;
|
53
53
|
default: string;
|
54
54
|
};
|
55
55
|
}>>, {
|
@@ -60,7 +60,7 @@ export declare const Skeleton: import("../utils").WithInstall<import("vue").Defi
|
|
60
60
|
row: string | number;
|
61
61
|
avatar: boolean;
|
62
62
|
avatarShape: import("./Skeleton").SkeletonAvatarShape;
|
63
|
-
rowWidth:
|
63
|
+
rowWidth: import("../utils").Numeric | import("../utils").Numeric[];
|
64
64
|
}>>;
|
65
65
|
export default Skeleton;
|
66
66
|
export type { SkeletonProps, SkeletonAvatarShape } from './Skeleton';
|
package/es/tabbar/Tabbar.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { type PropType, type InjectionKey, type ExtractPropTypes } from 'vue';
|
2
|
-
import { Interceptor } from '../utils';
|
2
|
+
import { type Numeric, type Interceptor } from '../utils';
|
3
3
|
declare const tabbarProps: {
|
4
4
|
route: BooleanConstructor;
|
5
5
|
fixed: {
|
@@ -27,7 +27,7 @@ declare const tabbarProps: {
|
|
27
27
|
export declare type TabbarProps = ExtractPropTypes<typeof tabbarProps>;
|
28
28
|
export declare type TabbarProvide = {
|
29
29
|
props: TabbarProps;
|
30
|
-
setActive: (active:
|
30
|
+
setActive: (active: Numeric, afterChange: () => void) => void;
|
31
31
|
};
|
32
32
|
export declare const TABBAR_KEY: InjectionKey<TabbarProvide>;
|
33
33
|
declare const _default: import("vue").DefineComponent<{
|
package/es/tabs/Tabs.d.ts
CHANGED
package/es/tabs/Tabs.js
CHANGED
package/es/tabs/types.d.ts
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
import type { ComponentPublicInstance, ComputedRef } from 'vue';
|
2
|
+
import type { Numeric } from '../utils';
|
2
3
|
import type { TabsProps } from './Tabs';
|
3
4
|
export declare type TabsType = 'line' | 'card';
|
4
5
|
export declare type TabsClickTabEventParams = {
|
5
|
-
name:
|
6
|
+
name: Numeric;
|
6
7
|
title: string;
|
7
8
|
event: MouseEvent;
|
8
9
|
disabled: boolean;
|
@@ -11,12 +12,12 @@ export declare type TabsProvide = {
|
|
11
12
|
id: string;
|
12
13
|
props: TabsProps;
|
13
14
|
setLine: () => void;
|
14
|
-
onRendered: (name:
|
15
|
+
onRendered: (name: Numeric, title?: string) => void;
|
15
16
|
scrollIntoView: (immediate?: boolean) => void;
|
16
|
-
currentName: ComputedRef<
|
17
|
+
currentName: ComputedRef<Numeric | undefined>;
|
17
18
|
};
|
18
19
|
export declare type TabsExpose = {
|
19
20
|
resize: () => void;
|
20
|
-
scrollTo: (name:
|
21
|
+
scrollTo: (name: Numeric) => void;
|
21
22
|
};
|
22
23
|
export declare type TabsInstance = ComponentPublicInstance<TabsProps, TabsExpose>;
|
package/es/toast/types.d.ts
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
import { Toast } from './function-call';
|
2
2
|
import type { TeleportProps } from 'vue';
|
3
3
|
import type { LoadingType } from '../loading';
|
4
|
+
import type { Numeric } from '../utils';
|
4
5
|
export declare type ToastType = 'text' | 'loading' | 'success' | 'fail' | 'html';
|
5
6
|
export declare type ToastPosition = 'top' | 'middle' | 'bottom';
|
6
7
|
export declare type ToastOptions = {
|
7
8
|
icon?: string;
|
8
9
|
type?: ToastType;
|
9
10
|
mask?: boolean;
|
10
|
-
message?:
|
11
|
+
message?: Numeric;
|
11
12
|
onClose?: () => void;
|
12
13
|
onOpened?: () => void;
|
13
14
|
overlay?: boolean;
|
14
15
|
duration?: number;
|
15
16
|
teleport?: TeleportProps['to'];
|
16
|
-
iconSize?:
|
17
|
+
iconSize?: Numeric;
|
17
18
|
position?: ToastPosition;
|
18
19
|
className?: unknown;
|
19
20
|
transition?: string;
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import { type PropType, type ExtractPropTypes } from 'vue';
|
2
|
+
import { type Numeric } from '../utils';
|
2
3
|
export declare type TreeSelectChild = {
|
3
|
-
id:
|
4
|
+
id: Numeric;
|
4
5
|
text: string;
|
5
6
|
disabled?: boolean;
|
6
7
|
};
|
7
8
|
export declare type TreeSelectItem = {
|
8
9
|
dot?: boolean;
|
9
10
|
text: string;
|
10
|
-
badge?:
|
11
|
+
badge?: Numeric;
|
11
12
|
children?: TreeSelectChild[];
|
12
13
|
disabled?: boolean;
|
13
14
|
className?: unknown;
|
@@ -34,7 +35,7 @@ declare const treeSelectProps: {
|
|
34
35
|
default: number;
|
35
36
|
};
|
36
37
|
activeId: {
|
37
|
-
type: PropType<
|
38
|
+
type: PropType<Numeric | Numeric[]>;
|
38
39
|
default: number;
|
39
40
|
};
|
40
41
|
};
|
@@ -61,7 +62,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
61
62
|
default: number;
|
62
63
|
};
|
63
64
|
activeId: {
|
64
|
-
type: PropType<
|
65
|
+
type: PropType<Numeric | Numeric[]>;
|
65
66
|
default: number;
|
66
67
|
};
|
67
68
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click-item" | "click-nav" | "update:activeId" | "update:mainActiveIndex")[], "click-item" | "click-nav" | "update:activeId" | "update:mainActiveIndex", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
@@ -86,7 +87,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
86
87
|
default: number;
|
87
88
|
};
|
88
89
|
activeId: {
|
89
|
-
type: PropType<
|
90
|
+
type: PropType<Numeric | Numeric[]>;
|
90
91
|
default: number;
|
91
92
|
};
|
92
93
|
}>> & {
|
@@ -100,6 +101,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
100
101
|
items: TreeSelectItem[];
|
101
102
|
selectedIcon: string;
|
102
103
|
mainActiveIndex: string | number;
|
103
|
-
activeId:
|
104
|
+
activeId: Numeric | Numeric[];
|
104
105
|
}>;
|
105
106
|
export default _default;
|
@@ -20,7 +20,7 @@ export declare const TreeSelect: import("../utils").WithInstall<import("vue").De
|
|
20
20
|
default: number;
|
21
21
|
};
|
22
22
|
activeId: {
|
23
|
-
type: import("vue").PropType<
|
23
|
+
type: import("vue").PropType<import("../utils").Numeric | import("../utils").Numeric[]>;
|
24
24
|
default: number;
|
25
25
|
};
|
26
26
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click-item" | "click-nav" | "update:activeId" | "update:mainActiveIndex")[], "click-item" | "click-nav" | "update:activeId" | "update:mainActiveIndex", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -45,7 +45,7 @@ export declare const TreeSelect: import("../utils").WithInstall<import("vue").De
|
|
45
45
|
default: number;
|
46
46
|
};
|
47
47
|
activeId: {
|
48
|
-
type: import("vue").PropType<
|
48
|
+
type: import("vue").PropType<import("../utils").Numeric | import("../utils").Numeric[]>;
|
49
49
|
default: number;
|
50
50
|
};
|
51
51
|
}>> & {
|
@@ -59,7 +59,7 @@ export declare const TreeSelect: import("../utils").WithInstall<import("vue").De
|
|
59
59
|
items: import("./TreeSelect").TreeSelectItem[];
|
60
60
|
selectedIcon: string;
|
61
61
|
mainActiveIndex: string | number;
|
62
|
-
activeId:
|
62
|
+
activeId: import("../utils").Numeric | import("../utils").Numeric[];
|
63
63
|
}>>;
|
64
64
|
export default TreeSelect;
|
65
65
|
export type { TreeSelectItem, TreeSelectChild, TreeSelectProps, } from './TreeSelect';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { type PropType, type ExtractPropTypes } from 'vue';
|
2
|
-
import { Interceptor } from '../utils';
|
2
|
+
import { Interceptor, type Numeric } from '../utils';
|
3
3
|
import { type ImagePreviewOptions } from '../image-preview';
|
4
4
|
import type { ImageFit } from '../image';
|
5
5
|
import type { UploaderMaxSize, UploaderAfterRead, UploaderBeforeRead, UploaderResultType, UploaderFileListItem } from './types';
|
@@ -49,7 +49,7 @@ declare const uploaderProps: {
|
|
49
49
|
};
|
50
50
|
beforeRead: PropType<UploaderBeforeRead>;
|
51
51
|
beforeDelete: PropType<Interceptor>;
|
52
|
-
previewSize:
|
52
|
+
previewSize: PropType<Numeric | [Numeric, Numeric]>;
|
53
53
|
previewImage: {
|
54
54
|
type: BooleanConstructor;
|
55
55
|
default: true;
|
@@ -111,7 +111,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
111
111
|
};
|
112
112
|
beforeRead: PropType<UploaderBeforeRead>;
|
113
113
|
beforeDelete: PropType<Interceptor>;
|
114
|
-
previewSize:
|
114
|
+
previewSize: PropType<Numeric | [Numeric, Numeric]>;
|
115
115
|
previewImage: {
|
116
116
|
type: BooleanConstructor;
|
117
117
|
default: true;
|
@@ -171,7 +171,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
171
171
|
};
|
172
172
|
beforeRead: PropType<UploaderBeforeRead>;
|
173
173
|
beforeDelete: PropType<Interceptor>;
|
174
|
-
previewSize:
|
174
|
+
previewSize: PropType<Numeric | [Numeric, Numeric]>;
|
175
175
|
previewImage: {
|
176
176
|
type: BooleanConstructor;
|
177
177
|
default: true;
|
package/es/uploader/Uploader.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
2
2
|
import { ref, reactive, defineComponent, onBeforeUnmount } from "vue";
|
3
|
-
import { pick, extend, isPromise, truthProp,
|
3
|
+
import { pick, extend, isPromise, truthProp, getSizeStyle, makeArrayProp, makeStringProp, makeNumericProp } from "../utils";
|
4
4
|
import { bem, name, toArray, isOversize, filterFiles, isImageFile, readFileContent } from "./utils";
|
5
5
|
import { useCustomFieldValue } from "@vant/use";
|
6
6
|
import { useExpose } from "../composables/use-expose";
|
@@ -26,7 +26,7 @@ const uploaderProps = {
|
|
26
26
|
modelValue: makeArrayProp(),
|
27
27
|
beforeRead: Function,
|
28
28
|
beforeDelete: Function,
|
29
|
-
previewSize:
|
29
|
+
previewSize: [Number, String, Array],
|
30
30
|
previewImage: truthProp,
|
31
31
|
previewOptions: Object,
|
32
32
|
previewFullImage: truthProp,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { type PropType } from 'vue';
|
2
|
-
import { Interceptor } from '../utils';
|
2
|
+
import { type Numeric, type Interceptor } from '../utils';
|
3
3
|
import { ImageFit } from '../image';
|
4
4
|
import type { UploaderFileListItem } from './types';
|
5
5
|
declare const _default: import("vue").DefineComponent<{
|
@@ -12,7 +12,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
12
12
|
imageFit: PropType<ImageFit>;
|
13
13
|
lazyLoad: BooleanConstructor;
|
14
14
|
deletable: BooleanConstructor;
|
15
|
-
previewSize:
|
15
|
+
previewSize: PropType<Numeric | [Numeric, Numeric]>;
|
16
16
|
beforeDelete: PropType<Interceptor>;
|
17
17
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("delete" | "preview")[], "delete" | "preview", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
18
18
|
name: (NumberConstructor | StringConstructor)[];
|
@@ -24,7 +24,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
24
24
|
imageFit: PropType<ImageFit>;
|
25
25
|
lazyLoad: BooleanConstructor;
|
26
26
|
deletable: BooleanConstructor;
|
27
|
-
previewSize:
|
27
|
+
previewSize: PropType<Numeric | [Numeric, Numeric]>;
|
28
28
|
beforeDelete: PropType<Interceptor>;
|
29
29
|
}>> & {
|
30
30
|
onDelete?: ((...args: any[]) => any) | undefined;
|
@@ -13,7 +13,7 @@ var stdin_default = defineComponent({
|
|
13
13
|
imageFit: String,
|
14
14
|
lazyLoad: Boolean,
|
15
15
|
deletable: Boolean,
|
16
|
-
previewSize:
|
16
|
+
previewSize: [Number, String, Array],
|
17
17
|
beforeDelete: Function
|
18
18
|
},
|
19
19
|
emits: ["delete", "preview"],
|
@@ -87,16 +87,19 @@ var stdin_default = defineComponent({
|
|
87
87
|
};
|
88
88
|
const renderPreview = () => {
|
89
89
|
const {
|
90
|
-
item
|
90
|
+
item,
|
91
|
+
lazyLoad,
|
92
|
+
imageFit,
|
93
|
+
previewSize
|
91
94
|
} = props;
|
92
95
|
if (isImageFile(item)) {
|
93
96
|
return _createVNode(Image, {
|
94
|
-
"fit":
|
97
|
+
"fit": imageFit,
|
95
98
|
"src": item.content || item.url,
|
96
99
|
"class": bem("preview-image"),
|
97
|
-
"width":
|
98
|
-
"height":
|
99
|
-
"lazyLoad":
|
100
|
+
"width": Array.isArray(previewSize) ? previewSize[0] : previewSize,
|
101
|
+
"height": Array.isArray(previewSize) ? previewSize[1] : previewSize,
|
102
|
+
"lazyLoad": lazyLoad,
|
100
103
|
"onClick": onPreview
|
101
104
|
}, {
|
102
105
|
default: renderCover
|
package/es/uploader/index.d.ts
CHANGED
@@ -45,7 +45,7 @@ export declare const Uploader: import("../utils").WithInstall<import("vue").Defi
|
|
45
45
|
};
|
46
46
|
beforeRead: import("vue").PropType<import("./types").UploaderBeforeRead>;
|
47
47
|
beforeDelete: import("vue").PropType<import("../utils").Interceptor>;
|
48
|
-
previewSize: (
|
48
|
+
previewSize: import("vue").PropType<import("../utils").Numeric | [import("../utils").Numeric, import("../utils").Numeric]>;
|
49
49
|
previewImage: {
|
50
50
|
type: BooleanConstructor;
|
51
51
|
default: true;
|
@@ -105,7 +105,7 @@ export declare const Uploader: import("../utils").WithInstall<import("vue").Defi
|
|
105
105
|
};
|
106
106
|
beforeRead: import("vue").PropType<import("./types").UploaderBeforeRead>;
|
107
107
|
beforeDelete: import("vue").PropType<import("../utils").Interceptor>;
|
108
|
-
previewSize: (
|
108
|
+
previewSize: import("vue").PropType<import("../utils").Numeric | [import("../utils").Numeric, import("../utils").Numeric]>;
|
109
109
|
previewImage: {
|
110
110
|
type: BooleanConstructor;
|
111
111
|
default: true;
|
package/es/uploader/types.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ComponentPublicInstance } from 'vue';
|
2
2
|
import type { ImageFit } from '../image';
|
3
|
-
import type { Interceptor } from '../utils';
|
3
|
+
import type { Numeric, Interceptor } from '../utils';
|
4
4
|
import type { UploaderProps } from './Uploader';
|
5
5
|
export declare type UploaderResultType = 'dataUrl' | 'text' | 'file';
|
6
6
|
export declare type UploaderFileListItem = {
|
@@ -12,16 +12,16 @@ export declare type UploaderFileListItem = {
|
|
12
12
|
message?: string;
|
13
13
|
imageFit?: ImageFit;
|
14
14
|
deletable?: boolean;
|
15
|
-
previewSize?:
|
15
|
+
previewSize?: Numeric;
|
16
16
|
beforeDelete?: Interceptor;
|
17
17
|
};
|
18
|
-
export declare type UploaderMaxSize =
|
18
|
+
export declare type UploaderMaxSize = Numeric | ((file: File) => boolean);
|
19
19
|
export declare type UploaderBeforeRead = (file: File | File[], detail: {
|
20
|
-
name:
|
20
|
+
name: Numeric;
|
21
21
|
index: number;
|
22
22
|
}) => boolean | undefined | Promise<File | File[] | undefined>;
|
23
23
|
export declare type UploaderAfterRead = (items: UploaderFileListItem | UploaderFileListItem[], detail: {
|
24
|
-
name:
|
24
|
+
name: Numeric;
|
25
25
|
index: number;
|
26
26
|
}) => void;
|
27
27
|
export declare type UploaderExpose = {
|
package/es/utils/basic.d.ts
CHANGED
@@ -7,6 +7,7 @@ export declare const extend: {
|
|
7
7
|
(target: object, ...sources: any[]): any;
|
8
8
|
};
|
9
9
|
export declare const inBrowser: boolean;
|
10
|
+
export declare type Numeric = number | string;
|
10
11
|
export declare type ComponentInstance = ComponentPublicInstance<{}, any>;
|
11
12
|
export declare function get(object: any, path: string): any;
|
12
13
|
export declare type Writeable<T> = {
|
package/es/utils/format.d.ts
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
import { CSSProperties } from 'vue';
|
2
|
-
|
3
|
-
export declare function
|
4
|
-
export declare function
|
5
|
-
export declare function
|
1
|
+
import type { CSSProperties } from 'vue';
|
2
|
+
import { type Numeric } from './basic';
|
3
|
+
export declare function addUnit(value?: Numeric): string | undefined;
|
4
|
+
export declare function getSizeStyle(originSize?: Numeric | Numeric[]): CSSProperties | undefined;
|
5
|
+
export declare function getZIndexStyle(zIndex?: Numeric): CSSProperties;
|
6
|
+
export declare function unitToPx(value: Numeric): number;
|
6
7
|
export declare const camelize: (str: string) => string;
|
7
8
|
export declare const kebabCase: (str: string) => string;
|
8
|
-
export declare function padZero(num:
|
9
|
+
export declare function padZero(num: Numeric, targetLength?: number): string;
|
9
10
|
/** clamps number within the inclusive lower and upper bounds */
|
10
11
|
export declare const clamp: (num: number, min: number, max: number) => number;
|
11
12
|
export declare function formatNumber(value: string, allowDot?: boolean, allowMinus?: boolean): string;
|
package/es/utils/format.js
CHANGED
@@ -9,6 +9,12 @@ function addUnit(value) {
|
|
9
9
|
}
|
10
10
|
function getSizeStyle(originSize) {
|
11
11
|
if (isDef(originSize)) {
|
12
|
+
if (Array.isArray(originSize)) {
|
13
|
+
return {
|
14
|
+
width: addUnit(originSize[0]),
|
15
|
+
height: addUnit(originSize[1])
|
16
|
+
};
|
17
|
+
}
|
12
18
|
const size = addUnit(originSize);
|
13
19
|
return {
|
14
20
|
width: size,
|
package/es/utils/validate.d.ts
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
+
import { type Numeric } from './basic';
|
1
2
|
export declare const isDef: <T>(val: T) => val is NonNullable<T>;
|
2
3
|
export declare const isFunction: (val: unknown) => val is Function;
|
3
4
|
export declare const isObject: (val: unknown) => val is Record<any, any>;
|
4
5
|
export declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
|
5
6
|
export declare const isDate: (val: unknown) => val is Date;
|
6
7
|
export declare function isMobile(value: string): boolean;
|
7
|
-
export declare const isNumeric: (val:
|
8
|
+
export declare const isNumeric: (val: Numeric) => val is string;
|
8
9
|
export declare const isIOS: () => boolean;
|
package/lib/badge/Badge.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { type PropType, type ExtractPropTypes } from 'vue';
|
2
|
+
import { type Numeric } from '../utils';
|
2
3
|
export declare type BadgePosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
3
4
|
declare const badgeProps: {
|
4
5
|
dot: BooleanConstructor;
|
@@ -8,7 +9,7 @@ declare const badgeProps: {
|
|
8
9
|
default: keyof HTMLElementTagNameMap;
|
9
10
|
};
|
10
11
|
color: StringConstructor;
|
11
|
-
offset: PropType<[
|
12
|
+
offset: PropType<[Numeric, Numeric]>;
|
12
13
|
content: (NumberConstructor | StringConstructor)[];
|
13
14
|
showZero: {
|
14
15
|
type: BooleanConstructor;
|
@@ -28,7 +29,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
28
29
|
default: keyof HTMLElementTagNameMap;
|
29
30
|
};
|
30
31
|
color: StringConstructor;
|
31
|
-
offset: PropType<[
|
32
|
+
offset: PropType<[Numeric, Numeric]>;
|
32
33
|
content: (NumberConstructor | StringConstructor)[];
|
33
34
|
showZero: {
|
34
35
|
type: BooleanConstructor;
|
@@ -46,7 +47,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
46
47
|
default: keyof HTMLElementTagNameMap;
|
47
48
|
};
|
48
49
|
color: StringConstructor;
|
49
|
-
offset: PropType<[
|
50
|
+
offset: PropType<[Numeric, Numeric]>;
|
50
51
|
content: (NumberConstructor | StringConstructor)[];
|
51
52
|
showZero: {
|
52
53
|
type: BooleanConstructor;
|
package/lib/badge/index.d.ts
CHANGED
@@ -6,7 +6,7 @@ export declare const Badge: import("../utils").WithInstall<import("vue").DefineC
|
|
6
6
|
default: keyof HTMLElementTagNameMap;
|
7
7
|
};
|
8
8
|
color: StringConstructor;
|
9
|
-
offset: import("vue").PropType<[
|
9
|
+
offset: import("vue").PropType<[import("../utils").Numeric, import("../utils").Numeric]>;
|
10
10
|
content: (NumberConstructor | StringConstructor)[];
|
11
11
|
showZero: {
|
12
12
|
type: BooleanConstructor;
|
@@ -24,7 +24,7 @@ export declare const Badge: import("../utils").WithInstall<import("vue").DefineC
|
|
24
24
|
default: keyof HTMLElementTagNameMap;
|
25
25
|
};
|
26
26
|
color: StringConstructor;
|
27
|
-
offset: import("vue").PropType<[
|
27
|
+
offset: import("vue").PropType<[import("../utils").Numeric, import("../utils").Numeric]>;
|
28
28
|
content: (NumberConstructor | StringConstructor)[];
|
29
29
|
showZero: {
|
30
30
|
type: BooleanConstructor;
|
package/lib/calendar/Calendar.js
CHANGED
@@ -230,8 +230,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
230
230
|
}
|
231
231
|
(0, import_use.raf)(() => {
|
232
232
|
bodyHeight = Math.floor((0, import_use.useRect)(bodyRef).height);
|
233
|
-
scrollToCurrentDate();
|
234
233
|
});
|
234
|
+
scrollToCurrentDate();
|
235
235
|
};
|
236
236
|
const reset = (date = getInitialDate()) => {
|
237
237
|
currentDate.value = date;
|
package/lib/calendar/types.d.ts
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
import type { ComponentPublicInstance, ComputedRef, Ref } from 'vue';
|
2
|
+
import type { Numeric } from '../utils';
|
2
3
|
import type { CalendarProps } from './Calendar';
|
3
4
|
import type { CalendarMonthProps } from './CalendarMonth';
|
4
5
|
export declare type CalendarType = 'single' | 'range' | 'multiple';
|
5
6
|
export declare type CalendarDayType = '' | 'start' | 'start-end' | 'middle' | 'end' | 'selected' | 'multiple-middle' | 'multiple-selected' | 'disabled' | 'placeholder';
|
6
7
|
export declare type CalendarDayItem = {
|
7
8
|
date?: Date;
|
8
|
-
text?:
|
9
|
+
text?: Numeric;
|
9
10
|
type?: CalendarDayType;
|
10
11
|
topInfo?: string;
|
11
12
|
className?: unknown;
|
package/lib/cascader/types.d.ts
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
import { type PropType } from 'vue';
|
2
|
+
import { type Numeric } from '../utils';
|
2
3
|
export declare type CheckerShape = 'square' | 'round';
|
3
4
|
export declare type CheckerDirection = 'horizontal' | 'vertical';
|
4
5
|
export declare type CheckerLabelPosition = 'left' | 'right';
|
5
6
|
export declare type CheckerParent = {
|
6
7
|
props: {
|
7
8
|
disabled?: boolean;
|
8
|
-
iconSize?:
|
9
|
+
iconSize?: Numeric;
|
9
10
|
direction?: CheckerDirection;
|
10
11
|
checkedColor?: string;
|
11
12
|
};
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { type PropType, type InjectionKey, type ExtractPropTypes } from 'vue';
|
2
|
+
import { type Numeric } from '../utils';
|
2
3
|
export declare type CollapseProvide = {
|
3
|
-
toggle: (name:
|
4
|
-
isExpanded: (name:
|
4
|
+
toggle: (name: Numeric, expanded: boolean) => void;
|
5
|
+
isExpanded: (name: Numeric) => boolean;
|
5
6
|
};
|
6
7
|
export declare const COLLAPSE_KEY: InjectionKey<CollapseProvide>;
|
7
8
|
declare const collapseProps: {
|
@@ -11,7 +12,7 @@ declare const collapseProps: {
|
|
11
12
|
};
|
12
13
|
accordion: BooleanConstructor;
|
13
14
|
modelValue: {
|
14
|
-
type: PropType<
|
15
|
+
type: PropType<Numeric | Numeric[]>;
|
15
16
|
default: string;
|
16
17
|
};
|
17
18
|
};
|
@@ -23,7 +24,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
23
24
|
};
|
24
25
|
accordion: BooleanConstructor;
|
25
26
|
modelValue: {
|
26
|
-
type: PropType<
|
27
|
+
type: PropType<Numeric | Numeric[]>;
|
27
28
|
default: string;
|
28
29
|
};
|
29
30
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
@@ -33,7 +34,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
33
34
|
};
|
34
35
|
accordion: BooleanConstructor;
|
35
36
|
modelValue: {
|
36
|
-
type: PropType<
|
37
|
+
type: PropType<Numeric | Numeric[]>;
|
37
38
|
default: string;
|
38
39
|
};
|
39
40
|
}>> & {
|
@@ -41,7 +42,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
41
42
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
42
43
|
}, {
|
43
44
|
border: boolean;
|
44
|
-
modelValue:
|
45
|
+
modelValue: Numeric | Numeric[];
|
45
46
|
accordion: boolean;
|
46
47
|
}>;
|
47
48
|
export default _default;
|
package/lib/collapse/index.d.ts
CHANGED
@@ -5,7 +5,7 @@ export declare const Collapse: import("../utils").WithInstall<import("vue").Defi
|
|
5
5
|
};
|
6
6
|
accordion: BooleanConstructor;
|
7
7
|
modelValue: {
|
8
|
-
type: import("vue").PropType<
|
8
|
+
type: import("vue").PropType<import("../utils").Numeric | import("../utils").Numeric[]>;
|
9
9
|
default: string;
|
10
10
|
};
|
11
11
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -15,7 +15,7 @@ export declare const Collapse: import("../utils").WithInstall<import("vue").Defi
|
|
15
15
|
};
|
16
16
|
accordion: BooleanConstructor;
|
17
17
|
modelValue: {
|
18
|
-
type: import("vue").PropType<
|
18
|
+
type: import("vue").PropType<import("../utils").Numeric | import("../utils").Numeric[]>;
|
19
19
|
default: string;
|
20
20
|
};
|
21
21
|
}>> & {
|
@@ -23,7 +23,7 @@ export declare const Collapse: import("../utils").WithInstall<import("vue").Defi
|
|
23
23
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
24
24
|
}, {
|
25
25
|
border: boolean;
|
26
|
-
modelValue:
|
26
|
+
modelValue: import("../utils").Numeric | import("../utils").Numeric[];
|
27
27
|
accordion: boolean;
|
28
28
|
}>>;
|
29
29
|
export default Collapse;
|