vant 4.3.2 → 4.4.0
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/es/address-edit/AddressEdit.mjs +1 -0
- package/es/area/Area.d.ts +6 -8
- package/es/area/Area.mjs +1 -1
- package/es/area/index.d.ts +4 -6
- package/es/back-top/BackTop.d.ts +1 -1
- package/es/back-top/BackTop.mjs +6 -3
- package/es/back-top/index.css +1 -1
- package/es/back-top/index.d.ts +1 -1
- package/es/barrage/Barrage.d.ts +93 -0
- package/es/barrage/Barrage.mjs +134 -0
- package/es/barrage/index.css +1 -0
- package/es/barrage/index.d.ts +69 -0
- package/es/barrage/index.mjs +10 -0
- package/es/barrage/style/index.d.ts +1 -0
- package/es/barrage/style/index.mjs +2 -0
- package/es/barrage/types.d.ts +7 -0
- package/es/barrage/types.mjs +0 -0
- package/es/cascader/Cascader.mjs +14 -0
- package/es/contact-list/ContactList.mjs +1 -1
- package/es/contact-list/index.css +1 -1
- package/es/date-picker/DatePicker.mjs +5 -2
- package/es/dialog/index.css +1 -1
- package/es/divider/Divider.d.ts +4 -0
- package/es/divider/Divider.mjs +4 -2
- package/es/divider/index.css +1 -1
- package/es/divider/index.d.ts +3 -0
- package/es/image-preview/ImagePreviewItem.mjs +28 -15
- package/es/index.d.ts +2 -1
- package/es/index.mjs +4 -1
- package/es/notice-bar/NoticeBar.d.ts +1 -1
- package/es/notice-bar/index.d.ts +1 -1
- package/es/signature/Signature.d.ts +13 -0
- package/es/signature/Signature.mjs +24 -8
- package/es/signature/index.css +1 -1
- package/es/signature/index.d.ts +9 -0
- package/es/uploader/Uploader.d.ts +6 -1
- package/es/uploader/Uploader.mjs +25 -10
- package/es/uploader/UploaderPreviewItem.d.ts +5 -1
- package/es/uploader/UploaderPreviewItem.mjs +6 -3
- package/es/uploader/index.d.ts +5 -1
- package/es/uploader/types.d.ts +1 -0
- package/lib/address-edit/AddressEdit.js +1 -0
- package/lib/area/Area.d.ts +6 -8
- package/lib/area/Area.js +1 -1
- package/lib/area/index.d.ts +4 -6
- package/lib/back-top/BackTop.d.ts +1 -1
- package/lib/back-top/BackTop.js +6 -3
- package/lib/back-top/index.css +1 -1
- package/lib/back-top/index.d.ts +1 -1
- package/lib/barrage/Barrage.d.ts +93 -0
- package/lib/barrage/Barrage.js +153 -0
- package/lib/barrage/index.css +1 -0
- package/lib/barrage/index.d.ts +69 -0
- package/lib/barrage/index.js +39 -0
- package/lib/barrage/style/index.d.ts +1 -0
- package/lib/barrage/style/index.js +2 -0
- package/lib/barrage/types.d.ts +7 -0
- package/lib/barrage/types.js +15 -0
- package/lib/cascader/Cascader.js +14 -0
- package/lib/contact-list/ContactList.js +1 -1
- package/lib/contact-list/index.css +1 -1
- package/lib/date-picker/DatePicker.js +5 -2
- package/lib/dialog/index.css +1 -1
- package/lib/divider/Divider.d.ts +4 -0
- package/lib/divider/Divider.js +4 -2
- package/lib/divider/index.css +1 -1
- package/lib/divider/index.d.ts +3 -0
- package/lib/image-preview/ImagePreviewItem.js +28 -15
- package/lib/index.css +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +4 -1
- package/lib/notice-bar/NoticeBar.d.ts +1 -1
- package/lib/notice-bar/index.d.ts +1 -1
- package/lib/signature/Signature.d.ts +13 -0
- package/lib/signature/Signature.js +23 -7
- package/lib/signature/index.css +1 -1
- package/lib/signature/index.d.ts +9 -0
- package/lib/uploader/Uploader.d.ts +6 -1
- package/lib/uploader/Uploader.js +25 -10
- package/lib/uploader/UploaderPreviewItem.d.ts +5 -1
- package/lib/uploader/UploaderPreviewItem.js +6 -3
- package/lib/uploader/index.d.ts +5 -1
- package/lib/uploader/types.d.ts +1 -0
- package/lib/vant.cjs.js +523 -324
- package/lib/vant.es.js +523 -324
- package/lib/vant.js +523 -324
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +1 -1
package/es/uploader/types.d.ts
CHANGED
@@ -196,6 +196,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
196
196
|
};
|
197
197
|
return (0, import_vue.withDirectives)((0, import_vue.createVNode)(import_cell.Cell, {
|
198
198
|
"center": true,
|
199
|
+
"border": false,
|
199
200
|
"title": t("defaultAddress"),
|
200
201
|
"class": bem("default")
|
201
202
|
}, slots2), [[import_vue.vShow, !hideBottomFields.value]]);
|
package/lib/area/Area.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { type PropType, type ExtractPropTypes } from 'vue';
|
2
2
|
import type { AreaList } from './types';
|
3
|
-
export declare const areaProps: {
|
3
|
+
export declare const areaProps: import("../utils").Writeable<Pick<{
|
4
4
|
loading: BooleanConstructor;
|
5
5
|
readonly: BooleanConstructor;
|
6
6
|
allowHtml: BooleanConstructor;
|
@@ -24,7 +24,7 @@ export declare const areaProps: {
|
|
24
24
|
title: StringConstructor;
|
25
25
|
cancelButtonText: StringConstructor;
|
26
26
|
confirmButtonText: StringConstructor;
|
27
|
-
} & {
|
27
|
+
}, "title" | "readonly" | "loading" | "optionHeight" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText">> & {
|
28
28
|
modelValue: StringConstructor;
|
29
29
|
columnsNum: {
|
30
30
|
type: (NumberConstructor | StringConstructor)[];
|
@@ -40,7 +40,7 @@ export declare const areaProps: {
|
|
40
40
|
};
|
41
41
|
};
|
42
42
|
export type AreaProps = ExtractPropTypes<typeof areaProps>;
|
43
|
-
declare const _default: import("vue").DefineComponent<{
|
43
|
+
declare const _default: import("vue").DefineComponent<import("../utils").Writeable<Pick<{
|
44
44
|
loading: BooleanConstructor;
|
45
45
|
readonly: BooleanConstructor;
|
46
46
|
allowHtml: BooleanConstructor;
|
@@ -64,7 +64,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
64
64
|
title: StringConstructor;
|
65
65
|
cancelButtonText: StringConstructor;
|
66
66
|
confirmButtonText: StringConstructor;
|
67
|
-
} & {
|
67
|
+
}, "title" | "readonly" | "loading" | "optionHeight" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText">> & {
|
68
68
|
modelValue: StringConstructor;
|
69
69
|
columnsNum: {
|
70
70
|
type: (NumberConstructor | StringConstructor)[];
|
@@ -78,7 +78,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
78
78
|
type: PropType<AreaList>;
|
79
79
|
default: () => {};
|
80
80
|
};
|
81
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
81
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<import("../utils").Writeable<Pick<{
|
82
82
|
loading: BooleanConstructor;
|
83
83
|
readonly: BooleanConstructor;
|
84
84
|
allowHtml: BooleanConstructor;
|
@@ -102,7 +102,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
102
102
|
title: StringConstructor;
|
103
103
|
cancelButtonText: StringConstructor;
|
104
104
|
confirmButtonText: StringConstructor;
|
105
|
-
} & {
|
105
|
+
}, "title" | "readonly" | "loading" | "optionHeight" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText">> & {
|
106
106
|
modelValue: StringConstructor;
|
107
107
|
columnsNum: {
|
108
108
|
type: (NumberConstructor | StringConstructor)[];
|
@@ -124,9 +124,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
124
124
|
}, {
|
125
125
|
readonly: boolean;
|
126
126
|
loading: boolean;
|
127
|
-
allowHtml: boolean;
|
128
127
|
optionHeight: string | number;
|
129
|
-
showToolbar: boolean;
|
130
128
|
swipeDuration: string | number;
|
131
129
|
visibleOptionNum: string | number;
|
132
130
|
columnsNum: string | number;
|
package/lib/area/Area.js
CHANGED
@@ -29,7 +29,7 @@ var import_utils2 = require("./utils");
|
|
29
29
|
var import_use_expose = require("../composables/use-expose");
|
30
30
|
var import_picker = require("../picker");
|
31
31
|
const [name, bem] = (0, import_utils.createNamespace)("area");
|
32
|
-
const areaProps = (0, import_utils.extend)({}, import_Picker.pickerSharedProps, {
|
32
|
+
const areaProps = (0, import_utils.extend)({}, (0, import_utils.pick)(import_Picker.pickerSharedProps, import_utils2.INHERIT_PROPS), {
|
33
33
|
modelValue: String,
|
34
34
|
columnsNum: (0, import_utils.makeNumericProp)(3),
|
35
35
|
columnsPlaceholder: (0, import_utils.makeArrayProp)(),
|
package/lib/area/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export declare const Area: import("../utils").WithInstall<import("vue").DefineComponent<{
|
1
|
+
export declare const Area: import("../utils").WithInstall<import("vue").DefineComponent<import("../utils").Writeable<Pick<{
|
2
2
|
loading: BooleanConstructor;
|
3
3
|
readonly: BooleanConstructor;
|
4
4
|
allowHtml: BooleanConstructor;
|
@@ -22,7 +22,7 @@ export declare const Area: import("../utils").WithInstall<import("vue").DefineCo
|
|
22
22
|
title: StringConstructor;
|
23
23
|
cancelButtonText: StringConstructor;
|
24
24
|
confirmButtonText: StringConstructor;
|
25
|
-
} & {
|
25
|
+
}, "title" | "readonly" | "loading" | "optionHeight" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText">> & {
|
26
26
|
modelValue: StringConstructor;
|
27
27
|
columnsNum: {
|
28
28
|
type: (NumberConstructor | StringConstructor)[];
|
@@ -36,7 +36,7 @@ export declare const Area: import("../utils").WithInstall<import("vue").DefineCo
|
|
36
36
|
type: import("vue").PropType<import("./types").AreaList>;
|
37
37
|
default: () => {};
|
38
38
|
};
|
39
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
39
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<import("../utils").Writeable<Pick<{
|
40
40
|
loading: BooleanConstructor;
|
41
41
|
readonly: BooleanConstructor;
|
42
42
|
allowHtml: BooleanConstructor;
|
@@ -60,7 +60,7 @@ export declare const Area: import("../utils").WithInstall<import("vue").DefineCo
|
|
60
60
|
title: StringConstructor;
|
61
61
|
cancelButtonText: StringConstructor;
|
62
62
|
confirmButtonText: StringConstructor;
|
63
|
-
} & {
|
63
|
+
}, "title" | "readonly" | "loading" | "optionHeight" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText">> & {
|
64
64
|
modelValue: StringConstructor;
|
65
65
|
columnsNum: {
|
66
66
|
type: (NumberConstructor | StringConstructor)[];
|
@@ -82,9 +82,7 @@ export declare const Area: import("../utils").WithInstall<import("vue").DefineCo
|
|
82
82
|
}, {
|
83
83
|
readonly: boolean;
|
84
84
|
loading: boolean;
|
85
|
-
allowHtml: boolean;
|
86
85
|
optionHeight: string | number;
|
87
|
-
showToolbar: boolean;
|
88
86
|
swipeDuration: string | number;
|
89
87
|
visibleOptionNum: string | number;
|
90
88
|
columnsNum: string | number;
|
@@ -29,7 +29,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
29
29
|
type: PropType<string | import("vue").RendererElement | null | undefined>;
|
30
30
|
default: string;
|
31
31
|
};
|
32
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
32
|
+
}, () => JSX.Element | JSX.Element[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
33
33
|
right: (NumberConstructor | StringConstructor)[];
|
34
34
|
bottom: (NumberConstructor | StringConstructor)[];
|
35
35
|
zIndex: (NumberConstructor | StringConstructor)[];
|
package/lib/back-top/BackTop.js
CHANGED
@@ -99,7 +99,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
99
99
|
(0, import_vue2.watch)(() => props.target, updateTarget);
|
100
100
|
return () => {
|
101
101
|
const Content = (0, import_vue.createVNode)("div", (0, import_vue.mergeProps)({
|
102
|
-
"ref": root,
|
102
|
+
"ref": !props.teleport ? root : void 0,
|
103
103
|
"class": bem({
|
104
104
|
active: show.value
|
105
105
|
}),
|
@@ -110,11 +110,14 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
110
110
|
"class": bem("icon")
|
111
111
|
}, null)]);
|
112
112
|
if (props.teleport) {
|
113
|
-
return (0, import_vue.createVNode)(
|
113
|
+
return [(0, import_vue.createVNode)("div", {
|
114
|
+
"ref": root,
|
115
|
+
"class": bem("placeholder")
|
116
|
+
}, null), (0, import_vue.createVNode)(import_vue2.Teleport, {
|
114
117
|
"to": props.teleport
|
115
118
|
}, {
|
116
119
|
default: () => [Content]
|
117
|
-
});
|
120
|
+
})];
|
118
121
|
}
|
119
122
|
return Content;
|
120
123
|
};
|
package/lib/back-top/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:root{--van-back-top-size: 40px;--van-back-top-right: 30px;--van-back-top-bottom: 40px;--van-back-top-z-index: 100;--van-back-top-icon-size: 20px;--van-back-top-text-color: #fff;--van-back-top-background: var(--van-blue)}.van-back-top{position:fixed;display:flex;align-items:center;justify-content:center;width:var(--van-back-top-size);height:var(--van-back-top-size);right:var(--van-back-top-right);bottom:var(--van-back-top-bottom);z-index:var(--van-back-top-z-index);cursor:pointer;color:var(--van-back-top-text-color);border-radius:var(--van-radius-max);box-shadow:0 2px 8px rgba(0,0,0,.12);transform:scale(0);transition:var(--van-duration-base) cubic-bezier(.25,.8,.5,1);background-color:var(--van-back-top-background)}.van-back-top:active{opacity:var(--van-active-opacity)}.van-back-top--active{transform:scale(1)}.van-back-top__icon{font-size:var(--van-back-top-icon-size);font-weight:var(--van-font-bold)}
|
1
|
+
:root{--van-back-top-size: 40px;--van-back-top-right: 30px;--van-back-top-bottom: 40px;--van-back-top-z-index: 100;--van-back-top-icon-size: 20px;--van-back-top-text-color: #fff;--van-back-top-background: var(--van-blue)}.van-back-top{position:fixed;display:flex;align-items:center;justify-content:center;width:var(--van-back-top-size);height:var(--van-back-top-size);right:var(--van-back-top-right);bottom:var(--van-back-top-bottom);z-index:var(--van-back-top-z-index);cursor:pointer;color:var(--van-back-top-text-color);border-radius:var(--van-radius-max);box-shadow:0 2px 8px rgba(0,0,0,.12);transform:scale(0);transition:var(--van-duration-base) cubic-bezier(.25,.8,.5,1);background-color:var(--van-back-top-background)}.van-back-top:active{opacity:var(--van-active-opacity)}.van-back-top__placeholder{display:none}.van-back-top--active{transform:scale(1)}.van-back-top__icon{font-size:var(--van-back-top-icon-size);font-weight:var(--van-font-bold)}
|
package/lib/back-top/index.d.ts
CHANGED
@@ -12,7 +12,7 @@ export declare const BackTop: import("../utils").WithInstall<import("vue").Defin
|
|
12
12
|
type: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
|
13
13
|
default: string;
|
14
14
|
};
|
15
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
15
|
+
}, () => JSX.Element | JSX.Element[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
16
16
|
right: (NumberConstructor | StringConstructor)[];
|
17
17
|
bottom: (NumberConstructor | StringConstructor)[];
|
18
18
|
zIndex: (NumberConstructor | StringConstructor)[];
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import { type ExtractPropTypes } from 'vue';
|
2
|
+
export interface BarrageItem {
|
3
|
+
id: string | number;
|
4
|
+
text: string | number;
|
5
|
+
}
|
6
|
+
export declare const barrageProps: {
|
7
|
+
top: {
|
8
|
+
type: (NumberConstructor | StringConstructor)[];
|
9
|
+
default: number;
|
10
|
+
};
|
11
|
+
rows: {
|
12
|
+
type: (NumberConstructor | StringConstructor)[];
|
13
|
+
default: number;
|
14
|
+
};
|
15
|
+
duration: {
|
16
|
+
type: (NumberConstructor | StringConstructor)[];
|
17
|
+
default: number;
|
18
|
+
};
|
19
|
+
autoPlay: {
|
20
|
+
type: BooleanConstructor;
|
21
|
+
default: true;
|
22
|
+
};
|
23
|
+
delay: {
|
24
|
+
type: NumberConstructor;
|
25
|
+
default: number;
|
26
|
+
};
|
27
|
+
modelValue: {
|
28
|
+
type: import("vue").PropType<BarrageItem[]>;
|
29
|
+
default: () => never[];
|
30
|
+
};
|
31
|
+
};
|
32
|
+
export type BarrageProps = ExtractPropTypes<typeof barrageProps>;
|
33
|
+
declare const _default: import("vue").DefineComponent<{
|
34
|
+
top: {
|
35
|
+
type: (NumberConstructor | StringConstructor)[];
|
36
|
+
default: number;
|
37
|
+
};
|
38
|
+
rows: {
|
39
|
+
type: (NumberConstructor | StringConstructor)[];
|
40
|
+
default: number;
|
41
|
+
};
|
42
|
+
duration: {
|
43
|
+
type: (NumberConstructor | StringConstructor)[];
|
44
|
+
default: number;
|
45
|
+
};
|
46
|
+
autoPlay: {
|
47
|
+
type: BooleanConstructor;
|
48
|
+
default: true;
|
49
|
+
};
|
50
|
+
delay: {
|
51
|
+
type: NumberConstructor;
|
52
|
+
default: number;
|
53
|
+
};
|
54
|
+
modelValue: {
|
55
|
+
type: import("vue").PropType<BarrageItem[]>;
|
56
|
+
default: () => never[];
|
57
|
+
};
|
58
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
59
|
+
top: {
|
60
|
+
type: (NumberConstructor | StringConstructor)[];
|
61
|
+
default: number;
|
62
|
+
};
|
63
|
+
rows: {
|
64
|
+
type: (NumberConstructor | StringConstructor)[];
|
65
|
+
default: number;
|
66
|
+
};
|
67
|
+
duration: {
|
68
|
+
type: (NumberConstructor | StringConstructor)[];
|
69
|
+
default: number;
|
70
|
+
};
|
71
|
+
autoPlay: {
|
72
|
+
type: BooleanConstructor;
|
73
|
+
default: true;
|
74
|
+
};
|
75
|
+
delay: {
|
76
|
+
type: NumberConstructor;
|
77
|
+
default: number;
|
78
|
+
};
|
79
|
+
modelValue: {
|
80
|
+
type: import("vue").PropType<BarrageItem[]>;
|
81
|
+
default: () => never[];
|
82
|
+
};
|
83
|
+
}>> & {
|
84
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
85
|
+
}, {
|
86
|
+
top: string | number;
|
87
|
+
modelValue: BarrageItem[];
|
88
|
+
rows: string | number;
|
89
|
+
duration: string | number;
|
90
|
+
autoPlay: boolean;
|
91
|
+
delay: number;
|
92
|
+
}>;
|
93
|
+
export default _default;
|
@@ -0,0 +1,153 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __export = (target, all) => {
|
6
|
+
for (var name2 in all)
|
7
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
8
|
+
};
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
11
|
+
for (let key of __getOwnPropNames(from))
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
14
|
+
}
|
15
|
+
return to;
|
16
|
+
};
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
18
|
+
var __async = (__this, __arguments, generator) => {
|
19
|
+
return new Promise((resolve, reject) => {
|
20
|
+
var fulfilled = (value) => {
|
21
|
+
try {
|
22
|
+
step(generator.next(value));
|
23
|
+
} catch (e) {
|
24
|
+
reject(e);
|
25
|
+
}
|
26
|
+
};
|
27
|
+
var rejected = (value) => {
|
28
|
+
try {
|
29
|
+
step(generator.throw(value));
|
30
|
+
} catch (e) {
|
31
|
+
reject(e);
|
32
|
+
}
|
33
|
+
};
|
34
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
35
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
36
|
+
});
|
37
|
+
};
|
38
|
+
var stdin_exports = {};
|
39
|
+
__export(stdin_exports, {
|
40
|
+
barrageProps: () => barrageProps,
|
41
|
+
default: () => stdin_default
|
42
|
+
});
|
43
|
+
module.exports = __toCommonJS(stdin_exports);
|
44
|
+
var import_vue = require("vue");
|
45
|
+
var import_vue2 = require("vue");
|
46
|
+
var import_use_expose = require("../composables/use-expose");
|
47
|
+
var import_utils = require("../utils");
|
48
|
+
const barrageProps = {
|
49
|
+
top: (0, import_utils.makeNumericProp)(10),
|
50
|
+
rows: (0, import_utils.makeNumericProp)(4),
|
51
|
+
duration: (0, import_utils.makeNumericProp)(4e3),
|
52
|
+
autoPlay: import_utils.truthProp,
|
53
|
+
delay: (0, import_utils.makeNumberProp)(300),
|
54
|
+
modelValue: (0, import_utils.makeArrayProp)()
|
55
|
+
};
|
56
|
+
const [name, bem] = (0, import_utils.createNamespace)("barrage");
|
57
|
+
var stdin_default = (0, import_vue2.defineComponent)({
|
58
|
+
name,
|
59
|
+
props: barrageProps,
|
60
|
+
emits: ["update:modelValue"],
|
61
|
+
setup(props, {
|
62
|
+
emit,
|
63
|
+
slots
|
64
|
+
}) {
|
65
|
+
const barrageWrapper = (0, import_vue2.ref)();
|
66
|
+
const className = bem("item");
|
67
|
+
const total = (0, import_vue2.ref)(0);
|
68
|
+
const barrageItems = [];
|
69
|
+
const createBarrageItem = (text, delay = props.delay) => {
|
70
|
+
const item = document.createElement("span");
|
71
|
+
item.className = className;
|
72
|
+
item.innerText = String(text);
|
73
|
+
item.style.animationDuration = `${props.duration}ms`;
|
74
|
+
item.style.animationDelay = `${delay}ms`;
|
75
|
+
item.style.animationName = "van-barrage";
|
76
|
+
item.style.animationTimingFunction = "linear";
|
77
|
+
return item;
|
78
|
+
};
|
79
|
+
const isInitBarrage = (0, import_vue2.ref)(true);
|
80
|
+
const isPlay = (0, import_vue2.ref)(props.autoPlay);
|
81
|
+
const appendBarrageItem = ({
|
82
|
+
id,
|
83
|
+
text
|
84
|
+
}, i) => {
|
85
|
+
var _a;
|
86
|
+
const item = createBarrageItem(text, isInitBarrage.value ? i * props.delay : void 0);
|
87
|
+
if (!props.autoPlay && isPlay.value === false) {
|
88
|
+
item.style.animationPlayState = "paused";
|
89
|
+
}
|
90
|
+
(_a = barrageWrapper.value) == null ? void 0 : _a.append(item);
|
91
|
+
total.value++;
|
92
|
+
const top = (total.value - 1) % +props.rows * item.offsetHeight + +props.top;
|
93
|
+
item.style.top = `${top}px`;
|
94
|
+
item.dataset.id = String(id);
|
95
|
+
barrageItems.push(item);
|
96
|
+
item.addEventListener("animationend", () => {
|
97
|
+
emit("update:modelValue", [...props.modelValue].filter((v) => String(v.id) !== item.dataset.id));
|
98
|
+
});
|
99
|
+
};
|
100
|
+
const updateBarrages = (newValue, oldValue) => {
|
101
|
+
const map = new Map(oldValue.map((item) => [item.id, item]));
|
102
|
+
newValue.forEach((item, i) => {
|
103
|
+
if (map.has(item.id)) {
|
104
|
+
map.delete(item.id);
|
105
|
+
} else {
|
106
|
+
appendBarrageItem(item, i);
|
107
|
+
}
|
108
|
+
});
|
109
|
+
map.forEach((item) => {
|
110
|
+
const index = barrageItems.findIndex((span) => span.dataset.id === String(item.id));
|
111
|
+
if (index > -1) {
|
112
|
+
barrageItems[index].remove();
|
113
|
+
barrageItems.splice(index, 1);
|
114
|
+
}
|
115
|
+
});
|
116
|
+
isInitBarrage.value = false;
|
117
|
+
};
|
118
|
+
(0, import_vue2.watch)(() => props.modelValue.slice(), (newValue, oldValue) => updateBarrages(newValue != null ? newValue : [], oldValue != null ? oldValue : []), {
|
119
|
+
deep: true
|
120
|
+
});
|
121
|
+
const rootStyle = (0, import_vue2.ref)({});
|
122
|
+
(0, import_vue2.onMounted)(() => __async(this, null, function* () {
|
123
|
+
var _a;
|
124
|
+
rootStyle.value["--move-distance"] = `-${(_a = barrageWrapper.value) == null ? void 0 : _a.offsetWidth}px`;
|
125
|
+
yield (0, import_vue2.nextTick)();
|
126
|
+
updateBarrages(props.modelValue, []);
|
127
|
+
}));
|
128
|
+
const play = () => {
|
129
|
+
isPlay.value = true;
|
130
|
+
barrageItems.forEach((item) => {
|
131
|
+
item.style.animationPlayState = "running";
|
132
|
+
});
|
133
|
+
};
|
134
|
+
const pause = () => {
|
135
|
+
isPlay.value = false;
|
136
|
+
barrageItems.forEach((item) => {
|
137
|
+
item.style.animationPlayState = "paused";
|
138
|
+
});
|
139
|
+
};
|
140
|
+
(0, import_use_expose.useExpose)({
|
141
|
+
play,
|
142
|
+
pause
|
143
|
+
});
|
144
|
+
return () => {
|
145
|
+
var _a;
|
146
|
+
return (0, import_vue.createVNode)("div", {
|
147
|
+
"class": bem(),
|
148
|
+
"ref": barrageWrapper,
|
149
|
+
"style": rootStyle.value
|
150
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
151
|
+
};
|
152
|
+
}
|
153
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
:root{--van-barrage-font-size: 16px;--van-barrage-space: 10px;--van-barrage-font: inherit;--van-barrage-color: var(--van-white)}.van-barrage{position:relative;overflow:hidden}.van-barrage__item{position:absolute;top:0;right:0;z-index:99;padding-bottom:var(--van-barrage-space);opacity:.75;line-height:1;font-size:var(--van-barrage-font-size);font-family:var(--van-barrage-font);font-weight:700;white-space:nowrap;color:var(--van-barrage-color);text-shadow:1px 0 1px #000000,0 1px 1px #000000,0 -1px 1px #000000,-1px 0 1px #000000;-webkit-user-select:none;user-select:none;will-change:transform;transform:translate(110%)}@keyframes van-barrage{0%{transform:translate(110%)}to{transform:translate(var(--move-distance))}}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
export declare const Barrage: import("../utils").WithInstall<import("vue").DefineComponent<{
|
2
|
+
top: {
|
3
|
+
type: (NumberConstructor | StringConstructor)[];
|
4
|
+
default: number;
|
5
|
+
};
|
6
|
+
rows: {
|
7
|
+
type: (NumberConstructor | StringConstructor)[];
|
8
|
+
default: number;
|
9
|
+
};
|
10
|
+
duration: {
|
11
|
+
type: (NumberConstructor | StringConstructor)[];
|
12
|
+
default: number;
|
13
|
+
};
|
14
|
+
autoPlay: {
|
15
|
+
type: BooleanConstructor;
|
16
|
+
default: true;
|
17
|
+
};
|
18
|
+
delay: {
|
19
|
+
type: NumberConstructor;
|
20
|
+
default: number;
|
21
|
+
};
|
22
|
+
modelValue: {
|
23
|
+
type: import("vue").PropType<import("./Barrage").BarrageItem[]>;
|
24
|
+
default: () => never[];
|
25
|
+
};
|
26
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
27
|
+
top: {
|
28
|
+
type: (NumberConstructor | StringConstructor)[];
|
29
|
+
default: number;
|
30
|
+
};
|
31
|
+
rows: {
|
32
|
+
type: (NumberConstructor | StringConstructor)[];
|
33
|
+
default: number;
|
34
|
+
};
|
35
|
+
duration: {
|
36
|
+
type: (NumberConstructor | StringConstructor)[];
|
37
|
+
default: number;
|
38
|
+
};
|
39
|
+
autoPlay: {
|
40
|
+
type: BooleanConstructor;
|
41
|
+
default: true;
|
42
|
+
};
|
43
|
+
delay: {
|
44
|
+
type: NumberConstructor;
|
45
|
+
default: number;
|
46
|
+
};
|
47
|
+
modelValue: {
|
48
|
+
type: import("vue").PropType<import("./Barrage").BarrageItem[]>;
|
49
|
+
default: () => never[];
|
50
|
+
};
|
51
|
+
}>> & {
|
52
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
53
|
+
}, {
|
54
|
+
top: string | number;
|
55
|
+
modelValue: import("./Barrage").BarrageItem[];
|
56
|
+
rows: string | number;
|
57
|
+
duration: string | number;
|
58
|
+
autoPlay: boolean;
|
59
|
+
delay: number;
|
60
|
+
}>>;
|
61
|
+
export default Barrage;
|
62
|
+
export { barrageProps } from './Barrage';
|
63
|
+
export type { BarrageProps, BarrageItem } from './Barrage';
|
64
|
+
export type { BarrageInstance } from './types';
|
65
|
+
declare module 'vue' {
|
66
|
+
interface GlobalComponents {
|
67
|
+
VanBarrage: typeof Barrage;
|
68
|
+
}
|
69
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all)
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
25
|
+
mod
|
26
|
+
));
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
28
|
+
var stdin_exports = {};
|
29
|
+
__export(stdin_exports, {
|
30
|
+
Barrage: () => Barrage,
|
31
|
+
barrageProps: () => import_Barrage2.barrageProps,
|
32
|
+
default: () => stdin_default
|
33
|
+
});
|
34
|
+
module.exports = __toCommonJS(stdin_exports);
|
35
|
+
var import_utils = require("../utils");
|
36
|
+
var import_Barrage = __toESM(require("./Barrage"));
|
37
|
+
var import_Barrage2 = require("./Barrage");
|
38
|
+
const Barrage = (0, import_utils.withInstall)(import_Barrage.default);
|
39
|
+
var stdin_default = Barrage;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
7
|
+
for (let key of __getOwnPropNames(from))
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
10
|
+
}
|
11
|
+
return to;
|
12
|
+
};
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
14
|
+
var stdin_exports = {};
|
15
|
+
module.exports = __toCommonJS(stdin_exports);
|
package/lib/cascader/Cascader.js
CHANGED
@@ -24,6 +24,7 @@ module.exports = __toCommonJS(stdin_exports);
|
|
24
24
|
var import_vue = require("vue");
|
25
25
|
var import_vue2 = require("vue");
|
26
26
|
var import_utils = require("../utils");
|
27
|
+
var import_use_refs = require("../composables/use-refs");
|
27
28
|
var import_tab = require("../tab");
|
28
29
|
var import_tabs = require("../tabs");
|
29
30
|
var import_icon = require("../icon");
|
@@ -50,6 +51,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
50
51
|
}) {
|
51
52
|
const tabs = (0, import_vue2.ref)([]);
|
52
53
|
const activeTab = (0, import_vue2.ref)(0);
|
54
|
+
const [selectedElementRefs, setSelectedElementRefs] = (0, import_use_refs.useRefs)();
|
53
55
|
const {
|
54
56
|
text: textKey,
|
55
57
|
value: valueKey,
|
@@ -168,6 +170,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
168
170
|
selected
|
169
171
|
}) : (0, import_vue.createVNode)("span", null, [option[textKey]]);
|
170
172
|
return (0, import_vue.createVNode)("li", {
|
173
|
+
"ref": selected ? setSelectedElementRefs(tabIndex) : void 0,
|
171
174
|
"role": "menuitemradio",
|
172
175
|
"class": [bem("option", {
|
173
176
|
selected,
|
@@ -224,7 +227,18 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
224
227
|
}, {
|
225
228
|
default: () => [tabs.value.map(renderTab)]
|
226
229
|
});
|
230
|
+
const scrollIntoView = (el) => {
|
231
|
+
const scrollParent = el.parentElement;
|
232
|
+
if (scrollParent) {
|
233
|
+
scrollParent.scrollTop = el.offsetTop - (scrollParent.offsetHeight - el.offsetHeight) / 2;
|
234
|
+
}
|
235
|
+
};
|
227
236
|
updateTabs();
|
237
|
+
(0, import_vue2.watch)(activeTab, (value) => {
|
238
|
+
const el = selectedElementRefs.value[value];
|
239
|
+
if (el)
|
240
|
+
scrollIntoView(el);
|
241
|
+
});
|
228
242
|
(0, import_vue2.watch)(() => props.options, updateTabs, {
|
229
243
|
deep: true
|
230
244
|
});
|
@@ -52,7 +52,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
52
52
|
const renderRightIcon = () => (0, import_vue.createVNode)(import_radio.Radio, {
|
53
53
|
"class": bem("radio"),
|
54
54
|
"name": item.id,
|
55
|
-
"iconSize":
|
55
|
+
"iconSize": 18
|
56
56
|
}, null);
|
57
57
|
const renderEditIcon = () => (0, import_vue.createVNode)(import_icon.Icon, {
|
58
58
|
"name": "edit",
|
@@ -1 +1 @@
|
|
1
|
-
:root{--van-contact-list-edit-icon-size: 16px;--van-contact-list-add-button-z-index: 999;--van-contact-list-radio-color: var(--van-primary-color);--van-contact-list-item-padding: var(--van-padding-md)}.van-contact-list{box-sizing:border-box;height:100%;padding-
|
1
|
+
:root{--van-contact-list-padding: var(--van-padding-sm) var(--van-padding-sm) 80px;--van-contact-list-edit-icon-size: 16px;--van-contact-list-add-button-z-index: 999;--van-contact-list-radio-color: var(--van-primary-color);--van-contact-list-item-padding: var(--van-padding-md)}.van-contact-list{box-sizing:border-box;height:100%;padding:var(--van-contact-list-padding)}.van-contact-list__item{padding:var(--van-contact-list-item-padding)}.van-contact-list__item-title{display:flex;align-items:center;padding-right:var(--van-padding-xl);padding-left:var(--van-padding-xs)}.van-contact-list__item-tag{flex:none;margin-left:var(--van-padding-xs);padding-top:0;padding-bottom:0;line-height:1.4em}.van-contact-list__group{box-sizing:border-box;height:100%;overflow-y:scroll;-webkit-overflow-scrolling:touch;border-radius:var(--van-radius-lg)}.van-contact-list__edit{font-size:var(--van-contact-list-edit-icon-size)}.van-contact-list__radio .van-radio__icon--checked .van-icon{background-color:var(--van-contact-list-radio-color);border-color:var(--van-contact-list-radio-color)}.van-contact-list__bottom{position:fixed;right:0;bottom:0;left:0;z-index:var(--van-contact-list-add-button-z-index);padding-left:var(--van-padding-md);padding-right:var(--van-padding-md);background-color:var(--van-background-2)}.van-contact-list__add{height:40px;margin:5px 0}
|