vant 4.8.9 → 4.8.11
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/coupon-cell/CouponCell.d.ts +11 -11
- package/es/coupon-cell/CouponCell.mjs +22 -29
- package/es/coupon-cell/index.d.ts +3 -3
- package/es/coupon-list/CouponList.d.ts +26 -16
- package/es/coupon-list/CouponList.mjs +14 -13
- package/es/coupon-list/index.d.ts +9 -2
- package/es/dropdown-item/DropdownItem.mjs +10 -3
- package/es/dropdown-item/index.css +1 -1
- package/es/dropdown-item/types.d.ts +1 -0
- package/es/dropdown-menu/index.css +1 -1
- package/es/dropdown-menu/types.d.ts +1 -0
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/lib/coupon-cell/CouponCell.d.ts +11 -11
- package/lib/coupon-cell/CouponCell.js +22 -29
- package/lib/coupon-cell/index.d.ts +3 -3
- package/lib/coupon-list/CouponList.d.ts +26 -16
- package/lib/coupon-list/CouponList.js +13 -12
- package/lib/coupon-list/index.d.ts +9 -2
- package/lib/dropdown-item/DropdownItem.js +10 -3
- package/lib/dropdown-item/index.css +1 -1
- package/lib/dropdown-item/types.d.ts +1 -0
- package/lib/dropdown-menu/index.css +1 -1
- package/lib/dropdown-menu/types.d.ts +1 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/vant.cjs.js +50 -49
- package/lib/vant.es.js +50 -49
- package/lib/vant.js +50 -49
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +6 -6
@@ -1,16 +1,16 @@
|
|
1
|
-
import { type ExtractPropTypes } from 'vue';
|
1
|
+
import { type PropType, type ExtractPropTypes } from 'vue';
|
2
2
|
import { CouponInfo } from '../coupon';
|
3
3
|
export declare const couponListProps: {
|
4
4
|
code: {
|
5
|
-
type:
|
5
|
+
type: PropType<string>;
|
6
6
|
default: string;
|
7
7
|
};
|
8
8
|
coupons: {
|
9
|
-
type:
|
9
|
+
type: PropType<CouponInfo[]>;
|
10
10
|
default: () => never[];
|
11
11
|
};
|
12
12
|
currency: {
|
13
|
-
type:
|
13
|
+
type: PropType<string>;
|
14
14
|
default: string;
|
15
15
|
};
|
16
16
|
showCount: {
|
@@ -18,11 +18,10 @@ export declare const couponListProps: {
|
|
18
18
|
default: true;
|
19
19
|
};
|
20
20
|
emptyImage: StringConstructor;
|
21
|
-
chosenCoupon: (NumberConstructor | ArrayConstructor)[];
|
22
21
|
enabledTitle: StringConstructor;
|
23
22
|
disabledTitle: StringConstructor;
|
24
23
|
disabledCoupons: {
|
25
|
-
type:
|
24
|
+
type: PropType<CouponInfo[]>;
|
26
25
|
default: () => never[];
|
27
26
|
};
|
28
27
|
showExchangeBar: {
|
@@ -46,19 +45,23 @@ export declare const couponListProps: {
|
|
46
45
|
};
|
47
46
|
exchangeButtonLoading: BooleanConstructor;
|
48
47
|
exchangeButtonDisabled: BooleanConstructor;
|
48
|
+
chosenCoupon: {
|
49
|
+
type: PropType<number | number[]>;
|
50
|
+
default: number;
|
51
|
+
};
|
49
52
|
};
|
50
53
|
export type CouponListProps = ExtractPropTypes<typeof couponListProps>;
|
51
54
|
declare const _default: import("vue").DefineComponent<{
|
52
55
|
code: {
|
53
|
-
type:
|
56
|
+
type: PropType<string>;
|
54
57
|
default: string;
|
55
58
|
};
|
56
59
|
coupons: {
|
57
|
-
type:
|
60
|
+
type: PropType<CouponInfo[]>;
|
58
61
|
default: () => never[];
|
59
62
|
};
|
60
63
|
currency: {
|
61
|
-
type:
|
64
|
+
type: PropType<string>;
|
62
65
|
default: string;
|
63
66
|
};
|
64
67
|
showCount: {
|
@@ -66,11 +69,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
66
69
|
default: true;
|
67
70
|
};
|
68
71
|
emptyImage: StringConstructor;
|
69
|
-
chosenCoupon: (NumberConstructor | ArrayConstructor)[];
|
70
72
|
enabledTitle: StringConstructor;
|
71
73
|
disabledTitle: StringConstructor;
|
72
74
|
disabledCoupons: {
|
73
|
-
type:
|
75
|
+
type: PropType<CouponInfo[]>;
|
74
76
|
default: () => never[];
|
75
77
|
};
|
76
78
|
showExchangeBar: {
|
@@ -94,17 +96,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
94
96
|
};
|
95
97
|
exchangeButtonLoading: BooleanConstructor;
|
96
98
|
exchangeButtonDisabled: BooleanConstructor;
|
99
|
+
chosenCoupon: {
|
100
|
+
type: PropType<number | number[]>;
|
101
|
+
default: number;
|
102
|
+
};
|
97
103
|
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "exchange" | "update:code")[], "change" | "exchange" | "update:code", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
98
104
|
code: {
|
99
|
-
type:
|
105
|
+
type: PropType<string>;
|
100
106
|
default: string;
|
101
107
|
};
|
102
108
|
coupons: {
|
103
|
-
type:
|
109
|
+
type: PropType<CouponInfo[]>;
|
104
110
|
default: () => never[];
|
105
111
|
};
|
106
112
|
currency: {
|
107
|
-
type:
|
113
|
+
type: PropType<string>;
|
108
114
|
default: string;
|
109
115
|
};
|
110
116
|
showCount: {
|
@@ -112,11 +118,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
112
118
|
default: true;
|
113
119
|
};
|
114
120
|
emptyImage: StringConstructor;
|
115
|
-
chosenCoupon: (NumberConstructor | ArrayConstructor)[];
|
116
121
|
enabledTitle: StringConstructor;
|
117
122
|
disabledTitle: StringConstructor;
|
118
123
|
disabledCoupons: {
|
119
|
-
type:
|
124
|
+
type: PropType<CouponInfo[]>;
|
120
125
|
default: () => never[];
|
121
126
|
};
|
122
127
|
showExchangeBar: {
|
@@ -140,6 +145,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
140
145
|
};
|
141
146
|
exchangeButtonLoading: BooleanConstructor;
|
142
147
|
exchangeButtonDisabled: BooleanConstructor;
|
148
|
+
chosenCoupon: {
|
149
|
+
type: PropType<number | number[]>;
|
150
|
+
default: number;
|
151
|
+
};
|
143
152
|
}>> & {
|
144
153
|
onChange?: ((...args: any[]) => any) | undefined;
|
145
154
|
onExchange?: ((...args: any[]) => any) | undefined;
|
@@ -148,6 +157,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
148
157
|
code: string;
|
149
158
|
currency: string;
|
150
159
|
coupons: CouponInfo[];
|
160
|
+
chosenCoupon: number | number[];
|
151
161
|
showCount: boolean;
|
152
162
|
disabledCoupons: CouponInfo[];
|
153
163
|
showExchangeBar: boolean;
|
@@ -39,7 +39,6 @@ const couponListProps = {
|
|
39
39
|
currency: (0, import_utils.makeStringProp)("\xA5"),
|
40
40
|
showCount: import_utils.truthProp,
|
41
41
|
emptyImage: String,
|
42
|
-
chosenCoupon: [Number, Array],
|
43
42
|
enabledTitle: String,
|
44
43
|
disabledTitle: String,
|
45
44
|
disabledCoupons: (0, import_utils.makeArrayProp)(),
|
@@ -51,7 +50,11 @@ const couponListProps = {
|
|
51
50
|
exchangeButtonText: String,
|
52
51
|
displayedCouponIndex: (0, import_utils.makeNumberProp)(-1),
|
53
52
|
exchangeButtonLoading: Boolean,
|
54
|
-
exchangeButtonDisabled: Boolean
|
53
|
+
exchangeButtonDisabled: Boolean,
|
54
|
+
chosenCoupon: {
|
55
|
+
type: [Number, Array],
|
56
|
+
default: -1
|
57
|
+
}
|
55
58
|
};
|
56
59
|
var stdin_default = (0, import_vue2.defineComponent)({
|
57
60
|
name,
|
@@ -119,18 +122,16 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
119
122
|
};
|
120
123
|
const renderCouponTab = () => {
|
121
124
|
const {
|
122
|
-
coupons
|
125
|
+
coupons,
|
126
|
+
chosenCoupon
|
123
127
|
} = props;
|
124
128
|
const count = props.showCount ? ` (${coupons.length})` : "";
|
125
129
|
const title = (props.enabledTitle || t("enable")) + count;
|
126
|
-
const
|
127
|
-
|
128
|
-
|
129
|
-
if (index === -1) {
|
130
|
-
return [...unrefChosenCoupon, value];
|
130
|
+
const updateChosenCoupon = (currentValues = [], value = 0) => {
|
131
|
+
if (currentValues.includes(value)) {
|
132
|
+
return currentValues.filter((item) => item !== value);
|
131
133
|
}
|
132
|
-
|
133
|
-
return [...unrefChosenCoupon];
|
134
|
+
return [...currentValues, value];
|
134
135
|
};
|
135
136
|
return (0, import_vue.createVNode)(import_tab.Tab, {
|
136
137
|
"title": title
|
@@ -148,9 +149,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
148
149
|
"key": coupon.id,
|
149
150
|
"ref": setCouponRefs(index),
|
150
151
|
"coupon": coupon,
|
151
|
-
"chosen": Array.isArray(
|
152
|
+
"chosen": Array.isArray(chosenCoupon) ? chosenCoupon.includes(index) : index === chosenCoupon,
|
152
153
|
"currency": props.currency,
|
153
|
-
"onClick": () => emit("change", Array.isArray(
|
154
|
+
"onClick": () => emit("change", Array.isArray(chosenCoupon) ? updateChosenCoupon(chosenCoupon, index) : index)
|
154
155
|
}, null)), !coupons.length && renderEmpty(), (_a = slots["list-footer"]) == null ? void 0 : _a.call(slots)])];
|
155
156
|
}
|
156
157
|
});
|
@@ -16,7 +16,6 @@ export declare const CouponList: import("../utils").WithInstall<import("vue").De
|
|
16
16
|
default: true;
|
17
17
|
};
|
18
18
|
emptyImage: StringConstructor;
|
19
|
-
chosenCoupon: (NumberConstructor | ArrayConstructor)[];
|
20
19
|
enabledTitle: StringConstructor;
|
21
20
|
disabledTitle: StringConstructor;
|
22
21
|
disabledCoupons: {
|
@@ -44,6 +43,10 @@ export declare const CouponList: import("../utils").WithInstall<import("vue").De
|
|
44
43
|
};
|
45
44
|
exchangeButtonLoading: BooleanConstructor;
|
46
45
|
exchangeButtonDisabled: BooleanConstructor;
|
46
|
+
chosenCoupon: {
|
47
|
+
type: import("vue").PropType<number | number[]>;
|
48
|
+
default: number;
|
49
|
+
};
|
47
50
|
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "exchange" | "update:code")[], "change" | "exchange" | "update:code", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
48
51
|
code: {
|
49
52
|
type: import("vue").PropType<string>;
|
@@ -62,7 +65,6 @@ export declare const CouponList: import("../utils").WithInstall<import("vue").De
|
|
62
65
|
default: true;
|
63
66
|
};
|
64
67
|
emptyImage: StringConstructor;
|
65
|
-
chosenCoupon: (NumberConstructor | ArrayConstructor)[];
|
66
68
|
enabledTitle: StringConstructor;
|
67
69
|
disabledTitle: StringConstructor;
|
68
70
|
disabledCoupons: {
|
@@ -90,6 +92,10 @@ export declare const CouponList: import("../utils").WithInstall<import("vue").De
|
|
90
92
|
};
|
91
93
|
exchangeButtonLoading: BooleanConstructor;
|
92
94
|
exchangeButtonDisabled: BooleanConstructor;
|
95
|
+
chosenCoupon: {
|
96
|
+
type: import("vue").PropType<number | number[]>;
|
97
|
+
default: number;
|
98
|
+
};
|
93
99
|
}>> & {
|
94
100
|
onChange?: ((...args: any[]) => any) | undefined;
|
95
101
|
onExchange?: ((...args: any[]) => any) | undefined;
|
@@ -98,6 +104,7 @@ export declare const CouponList: import("../utils").WithInstall<import("vue").De
|
|
98
104
|
code: string;
|
99
105
|
currency: string;
|
100
106
|
coupons: import("..").CouponInfo[];
|
107
|
+
chosenCoupon: number | number[];
|
101
108
|
showCount: boolean;
|
102
109
|
disabledCoupons: import("..").CouponInfo[];
|
103
110
|
showExchangeBar: boolean;
|
@@ -104,8 +104,14 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
104
104
|
const {
|
105
105
|
activeColor
|
106
106
|
} = parent.props;
|
107
|
+
const {
|
108
|
+
disabled
|
109
|
+
} = option;
|
107
110
|
const active = option.value === props.modelValue;
|
108
111
|
const onClick = () => {
|
112
|
+
if (disabled) {
|
113
|
+
return;
|
114
|
+
}
|
109
115
|
state.showPopup = false;
|
110
116
|
if (option.value !== props.modelValue) {
|
111
117
|
emit("update:modelValue", option.value);
|
@@ -116,7 +122,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
116
122
|
if (active) {
|
117
123
|
return (0, import_vue.createVNode)(import_icon.Icon, {
|
118
124
|
"class": bem("icon"),
|
119
|
-
"color": activeColor,
|
125
|
+
"color": disabled ? void 0 : activeColor,
|
120
126
|
"name": "success"
|
121
127
|
}, null);
|
122
128
|
}
|
@@ -127,13 +133,14 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
127
133
|
"icon": option.icon,
|
128
134
|
"title": option.text,
|
129
135
|
"class": bem("option", {
|
130
|
-
active
|
136
|
+
active,
|
137
|
+
disabled
|
131
138
|
}),
|
132
139
|
"style": {
|
133
140
|
color: active ? activeColor : ""
|
134
141
|
},
|
135
142
|
"tabindex": active ? 0 : -1,
|
136
|
-
"clickable":
|
143
|
+
"clickable": !disabled,
|
137
144
|
"onClick": onClick
|
138
145
|
}, {
|
139
146
|
value: renderIcon
|
@@ -1 +1 @@
|
|
1
|
-
:root,:host{--van-dropdown-item-z-index: 10}.van-dropdown-item{position:fixed;right:0;left:0;z-index:var(--van-dropdown-item-z-index);overflow:hidden}.van-dropdown-item__icon{display:block;line-height:inherit}.van-dropdown-item__option{text-align:left}.van-dropdown-item__option--active,.van-dropdown-item__option--active .van-dropdown-item__icon{color:var(--van-dropdown-menu-option-active-color)}.van-dropdown-item--up{top:0}.van-dropdown-item--down{bottom:0}.van-dropdown-item__content{position:absolute;max-height:var(--van-dropdown-menu-content-max-height)}
|
1
|
+
:root,:host{--van-dropdown-item-z-index: 10}.van-dropdown-item{position:fixed;right:0;left:0;z-index:var(--van-dropdown-item-z-index);overflow:hidden}.van-dropdown-item__icon{display:block;line-height:inherit}.van-dropdown-item__option{text-align:left}.van-dropdown-item__option--active,.van-dropdown-item__option--active .van-dropdown-item__icon{color:var(--van-dropdown-menu-option-active-color)}.van-dropdown-item__option--disabled,.van-dropdown-item__option--disabled .van-dropdown-item__icon{color:var(--van-dropdown-menu-option-disabled-color)}.van-dropdown-item--up{top:0}.van-dropdown-item--down{bottom:0}.van-dropdown-item__content{position:absolute;max-height:var(--van-dropdown-menu-content-max-height)}
|
@@ -3,6 +3,7 @@ import type { VNode, ComponentPublicInstance } from 'vue';
|
|
3
3
|
import type { Numeric } from '../utils';
|
4
4
|
export type DropdownItemOptionValue = Numeric | boolean;
|
5
5
|
export type DropdownItemOption = {
|
6
|
+
disabled?: boolean;
|
6
7
|
text: string;
|
7
8
|
icon?: string;
|
8
9
|
value: DropdownItemOptionValue;
|
@@ -1 +1 @@
|
|
1
|
-
:root,:host{--van-dropdown-menu-height: 48px;--van-dropdown-menu-background: var(--van-background-2);--van-dropdown-menu-shadow: 0 2px 12px rgba(100, 101, 102, .12);--van-dropdown-menu-title-font-size: 15px;--van-dropdown-menu-title-text-color: var(--van-text-color);--van-dropdown-menu-title-active-text-color: var(--van-primary-color);--van-dropdown-menu-title-disabled-text-color: var(--van-text-color-2);--van-dropdown-menu-title-padding: 0 var(--van-padding-xs);--van-dropdown-menu-title-line-height: var(--van-line-height-lg);--van-dropdown-menu-option-active-color: var(--van-primary-color);--van-dropdown-menu-content-max-height: 80%}.van-dropdown-menu{-webkit-user-select:none;user-select:none}.van-dropdown-menu__bar{position:relative;display:flex;height:var(--van-dropdown-menu-height);background:var(--van-dropdown-menu-background);box-shadow:var(--van-dropdown-menu-shadow)}.van-dropdown-menu__bar--opened{z-index:calc(var(--van-dropdown-item-z-index) + 1)}.van-dropdown-menu__bar--scrollable{padding-left:var(--van-padding-base);padding-right:var(--van-padding-xs);overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}.van-dropdown-menu__bar--scrollable::-webkit-scrollbar{display:none}.van-dropdown-menu__item{display:flex;flex:1;align-items:center;justify-content:center;min-width:0}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--van-dropdown-menu-title-disabled-text-color)}.van-dropdown-menu__item--grow{flex:1 0 auto;padding-left:var(--van-padding-base);padding-right:var(--van-padding-sm)}.van-dropdown-menu__title{position:relative;box-sizing:border-box;max-width:100%;padding:var(--van-dropdown-menu-title-padding);color:var(--van-dropdown-menu-title-text-color);font-size:var(--van-dropdown-menu-title-font-size);line-height:var(--van-dropdown-menu-title-line-height)}.van-dropdown-menu__title:after{position:absolute;top:50%;right:-4px;margin-top:-5px;border:3px solid;border-color:transparent transparent var(--van-gray-4) var(--van-gray-4);transform:rotate(-45deg);opacity:.8;content:""}.van-dropdown-menu__title--active{color:var(--van-dropdown-menu-title-active-text-color)}.van-dropdown-menu__title--active:after{border-color:transparent transparent currentColor currentColor}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}
|
1
|
+
:root,:host{--van-dropdown-menu-height: 48px;--van-dropdown-menu-background: var(--van-background-2);--van-dropdown-menu-shadow: 0 2px 12px rgba(100, 101, 102, .12);--van-dropdown-menu-title-font-size: 15px;--van-dropdown-menu-title-text-color: var(--van-text-color);--van-dropdown-menu-title-active-text-color: var(--van-primary-color);--van-dropdown-menu-title-disabled-text-color: var(--van-text-color-2);--van-dropdown-menu-title-padding: 0 var(--van-padding-xs);--van-dropdown-menu-title-line-height: var(--van-line-height-lg);--van-dropdown-menu-option-active-color: var(--van-primary-color);--van-dropdown-menu-option-disabled-color: var(--van-text-color-3);--van-dropdown-menu-content-max-height: 80%}.van-dropdown-menu{-webkit-user-select:none;user-select:none}.van-dropdown-menu__bar{position:relative;display:flex;height:var(--van-dropdown-menu-height);background:var(--van-dropdown-menu-background);box-shadow:var(--van-dropdown-menu-shadow)}.van-dropdown-menu__bar--opened{z-index:calc(var(--van-dropdown-item-z-index) + 1)}.van-dropdown-menu__bar--scrollable{padding-left:var(--van-padding-base);padding-right:var(--van-padding-xs);overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}.van-dropdown-menu__bar--scrollable::-webkit-scrollbar{display:none}.van-dropdown-menu__item{display:flex;flex:1;align-items:center;justify-content:center;min-width:0}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--van-dropdown-menu-title-disabled-text-color)}.van-dropdown-menu__item--grow{flex:1 0 auto;padding-left:var(--van-padding-base);padding-right:var(--van-padding-sm)}.van-dropdown-menu__title{position:relative;box-sizing:border-box;max-width:100%;padding:var(--van-dropdown-menu-title-padding);color:var(--van-dropdown-menu-title-text-color);font-size:var(--van-dropdown-menu-title-font-size);line-height:var(--van-dropdown-menu-title-line-height)}.van-dropdown-menu__title:after{position:absolute;top:50%;right:-4px;margin-top:-5px;border:3px solid;border-color:transparent transparent var(--van-gray-4) var(--van-gray-4);transform:rotate(-45deg);opacity:.8;content:""}.van-dropdown-menu__title--active{color:var(--van-dropdown-menu-title-active-text-color)}.van-dropdown-menu__title--active:after{border-color:transparent transparent currentColor currentColor}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}
|