vant 4.0.0-rc.4 → 4.0.0-rc.6
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/calendar/Calendar.mjs +10 -3
- package/es/calendar/CalendarHeader.d.ts +2 -0
- package/es/calendar/CalendarHeader.mjs +5 -1
- package/es/cell/Cell.d.ts +17 -0
- package/es/cell/Cell.mjs +11 -4
- package/es/cell/index.d.ts +9 -0
- package/es/collapse-item/CollapseItem.d.ts +13 -0
- package/es/collapse-item/index.d.ts +9 -0
- package/es/coupon/index.css +1 -1
- package/es/coupon-list/index.css +1 -1
- package/es/date-picker/DatePicker.mjs +4 -1
- package/es/date-picker/utils.d.ts +1 -0
- package/es/date-picker/utils.mjs +11 -0
- package/es/field/Field.d.ts +13 -0
- package/es/field/Field.mjs +3 -3
- package/es/field/index.css +1 -1
- package/es/field/index.d.ts +9 -0
- package/es/field/types.d.ts +1 -1
- package/es/image-preview/ImagePreview.mjs +3 -1
- package/es/image-preview/ImagePreviewItem.mjs +7 -2
- package/es/image-preview/index.css +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/loading/Loading.mjs +8 -4
- package/es/nav-bar/NavBar.d.ts +13 -0
- package/es/nav-bar/NavBar.mjs +4 -3
- package/es/nav-bar/index.d.ts +9 -0
- package/es/stepper/Stepper.d.ts +13 -0
- package/es/stepper/Stepper.mjs +4 -3
- package/es/stepper/index.d.ts +9 -0
- package/es/swipe/Swipe.mjs +1 -1
- package/es/tabs/Tabs.mjs +44 -41
- package/es/time-picker/TimePicker.mjs +4 -3
- package/es/toast/Toast.d.ts +4 -1
- package/es/toast/Toast.mjs +2 -1
- package/es/toast/index.css +1 -1
- package/es/toast/index.d.ts +3 -1
- package/es/toast/types.d.ts +2 -0
- package/lib/calendar/Calendar.js +10 -3
- package/lib/calendar/CalendarHeader.d.ts +2 -0
- package/lib/calendar/CalendarHeader.js +5 -1
- package/lib/cell/Cell.d.ts +17 -0
- package/lib/cell/Cell.js +10 -3
- package/lib/cell/index.d.ts +9 -0
- package/lib/collapse-item/CollapseItem.d.ts +13 -0
- package/lib/collapse-item/index.d.ts +9 -0
- package/lib/coupon/index.css +1 -1
- package/lib/coupon-list/index.css +1 -1
- package/lib/date-picker/DatePicker.js +3 -0
- package/lib/date-picker/utils.d.ts +1 -0
- package/lib/date-picker/utils.js +11 -0
- package/lib/field/Field.d.ts +13 -0
- package/lib/field/Field.js +3 -3
- package/lib/field/index.css +1 -1
- package/lib/field/index.d.ts +9 -0
- package/lib/field/types.d.ts +1 -1
- package/lib/image-preview/ImagePreview.js +3 -1
- package/lib/image-preview/ImagePreviewItem.js +7 -2
- package/lib/image-preview/index.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/loading/Loading.js +8 -4
- package/lib/nav-bar/NavBar.d.ts +13 -0
- package/lib/nav-bar/NavBar.js +4 -3
- package/lib/nav-bar/index.d.ts +9 -0
- package/lib/stepper/Stepper.d.ts +13 -0
- package/lib/stepper/Stepper.js +4 -3
- package/lib/stepper/index.d.ts +9 -0
- package/lib/swipe/Swipe.js +1 -1
- package/lib/tabs/Tabs.js +44 -41
- package/lib/time-picker/TimePicker.js +3 -2
- package/lib/toast/Toast.d.ts +4 -1
- package/lib/toast/Toast.js +2 -1
- package/lib/toast/index.css +1 -1
- package/lib/toast/index.d.ts +3 -1
- package/lib/toast/types.d.ts +2 -0
- package/lib/vant.cjs.js +118 -69
- package/lib/vant.es.js +118 -69
- package/lib/vant.js +118 -69
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +671 -633
- package/package.json +2 -2
- package/changelog.generated.md +0 -59
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
@@ -200,7 +200,7 @@ __reExport(stdin_exports, require("./time-picker"), module.exports);
|
|
200
200
|
__reExport(stdin_exports, require("./toast"), module.exports);
|
201
201
|
__reExport(stdin_exports, require("./tree-select"), module.exports);
|
202
202
|
__reExport(stdin_exports, require("./uploader"), module.exports);
|
203
|
-
const version = "4.0.0-rc.
|
203
|
+
const version = "4.0.0-rc.6";
|
204
204
|
function install(app) {
|
205
205
|
const components = [
|
206
206
|
import_action_bar.ActionBar,
|
package/lib/loading/Loading.js
CHANGED
@@ -54,6 +54,13 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
54
54
|
const spinnerStyle = (0, import_vue2.computed)(() => (0, import_utils.extend)({
|
55
55
|
color: props.color
|
56
56
|
}, (0, import_utils.getSizeStyle)(props.size)));
|
57
|
+
const renderIcon = () => {
|
58
|
+
const DefaultIcon = props.type === "spinner" ? SpinIcon : CircularIcon;
|
59
|
+
return (0, import_vue.createVNode)("span", {
|
60
|
+
"class": bem("spinner", props.type),
|
61
|
+
"style": spinnerStyle.value
|
62
|
+
}, [slots.icon ? slots.icon() : DefaultIcon]);
|
63
|
+
};
|
57
64
|
const renderText = () => {
|
58
65
|
var _a;
|
59
66
|
if (slots.default) {
|
@@ -77,10 +84,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
77
84
|
}]),
|
78
85
|
"aria-live": "polite",
|
79
86
|
"aria-busy": true
|
80
|
-
}, [(
|
81
|
-
"class": bem("spinner", type),
|
82
|
-
"style": spinnerStyle.value
|
83
|
-
}, [type === "spinner" ? SpinIcon : CircularIcon]), renderText()]);
|
87
|
+
}, [renderIcon(), renderText()]);
|
84
88
|
};
|
85
89
|
}
|
86
90
|
});
|
package/lib/nav-bar/NavBar.d.ts
CHANGED
@@ -12,6 +12,10 @@ export declare const navBarProps: {
|
|
12
12
|
leftArrow: BooleanConstructor;
|
13
13
|
placeholder: BooleanConstructor;
|
14
14
|
safeAreaInsetTop: BooleanConstructor;
|
15
|
+
clickable: {
|
16
|
+
type: BooleanConstructor;
|
17
|
+
default: true;
|
18
|
+
};
|
15
19
|
};
|
16
20
|
export declare type NavBarProps = ExtractPropTypes<typeof navBarProps>;
|
17
21
|
declare const _default: import("vue").DefineComponent<{
|
@@ -27,6 +31,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
27
31
|
leftArrow: BooleanConstructor;
|
28
32
|
placeholder: BooleanConstructor;
|
29
33
|
safeAreaInsetTop: BooleanConstructor;
|
34
|
+
clickable: {
|
35
|
+
type: BooleanConstructor;
|
36
|
+
default: true;
|
37
|
+
};
|
30
38
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clickLeft" | "clickRight")[], "clickLeft" | "clickRight", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
31
39
|
title: StringConstructor;
|
32
40
|
fixed: BooleanConstructor;
|
@@ -40,12 +48,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
40
48
|
leftArrow: BooleanConstructor;
|
41
49
|
placeholder: BooleanConstructor;
|
42
50
|
safeAreaInsetTop: BooleanConstructor;
|
51
|
+
clickable: {
|
52
|
+
type: BooleanConstructor;
|
53
|
+
default: true;
|
54
|
+
};
|
43
55
|
}>> & {
|
44
56
|
onClickLeft?: ((...args: any[]) => any) | undefined;
|
45
57
|
onClickRight?: ((...args: any[]) => any) | undefined;
|
46
58
|
}, {
|
47
59
|
fixed: boolean;
|
48
60
|
border: boolean;
|
61
|
+
clickable: boolean;
|
49
62
|
placeholder: boolean;
|
50
63
|
safeAreaInsetTop: boolean;
|
51
64
|
leftArrow: boolean;
|
package/lib/nav-bar/NavBar.js
CHANGED
@@ -36,7 +36,8 @@ const navBarProps = {
|
|
36
36
|
rightText: String,
|
37
37
|
leftArrow: Boolean,
|
38
38
|
placeholder: Boolean,
|
39
|
-
safeAreaInsetTop: Boolean
|
39
|
+
safeAreaInsetTop: Boolean,
|
40
|
+
clickable: import_utils.truthProp
|
40
41
|
};
|
41
42
|
var stdin_default = (0, import_vue2.defineComponent)({
|
42
43
|
name,
|
@@ -91,12 +92,12 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
91
92
|
}, [(0, import_vue.createVNode)("div", {
|
92
93
|
"class": bem("content")
|
93
94
|
}, [hasLeft && (0, import_vue.createVNode)("div", {
|
94
|
-
"class": [bem("left"), import_utils.HAPTICS_FEEDBACK],
|
95
|
+
"class": [bem("left"), props.clickable ? import_utils.HAPTICS_FEEDBACK : ""],
|
95
96
|
"onClick": onClickLeft
|
96
97
|
}, [renderLeft()]), (0, import_vue.createVNode)("div", {
|
97
98
|
"class": [bem("title"), "van-ellipsis"]
|
98
99
|
}, [slots.title ? slots.title() : title]), hasRight && (0, import_vue.createVNode)("div", {
|
99
|
-
"class": [bem("right"), import_utils.HAPTICS_FEEDBACK],
|
100
|
+
"class": [bem("right"), props.clickable ? import_utils.HAPTICS_FEEDBACK : ""],
|
100
101
|
"onClick": onClickRight
|
101
102
|
}, [renderRight()])])]);
|
102
103
|
};
|
package/lib/nav-bar/index.d.ts
CHANGED
@@ -11,6 +11,10 @@ export declare const NavBar: import("../utils").WithInstall<import("vue").Define
|
|
11
11
|
leftArrow: BooleanConstructor;
|
12
12
|
placeholder: BooleanConstructor;
|
13
13
|
safeAreaInsetTop: BooleanConstructor;
|
14
|
+
clickable: {
|
15
|
+
type: BooleanConstructor;
|
16
|
+
default: true;
|
17
|
+
};
|
14
18
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clickLeft" | "clickRight")[], "clickLeft" | "clickRight", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
15
19
|
title: StringConstructor;
|
16
20
|
fixed: BooleanConstructor;
|
@@ -24,12 +28,17 @@ export declare const NavBar: import("../utils").WithInstall<import("vue").Define
|
|
24
28
|
leftArrow: BooleanConstructor;
|
25
29
|
placeholder: BooleanConstructor;
|
26
30
|
safeAreaInsetTop: BooleanConstructor;
|
31
|
+
clickable: {
|
32
|
+
type: BooleanConstructor;
|
33
|
+
default: true;
|
34
|
+
};
|
27
35
|
}>> & {
|
28
36
|
onClickLeft?: ((...args: any[]) => any) | undefined;
|
29
37
|
onClickRight?: ((...args: any[]) => any) | undefined;
|
30
38
|
}, {
|
31
39
|
fixed: boolean;
|
32
40
|
border: boolean;
|
41
|
+
clickable: boolean;
|
33
42
|
placeholder: boolean;
|
34
43
|
safeAreaInsetTop: boolean;
|
35
44
|
leftArrow: boolean;
|
package/lib/stepper/Stepper.d.ts
CHANGED
@@ -37,6 +37,10 @@ export declare const stepperProps: {
|
|
37
37
|
type: BooleanConstructor;
|
38
38
|
default: true;
|
39
39
|
};
|
40
|
+
autoFixed: {
|
41
|
+
type: BooleanConstructor;
|
42
|
+
default: true;
|
43
|
+
};
|
40
44
|
allowEmpty: BooleanConstructor;
|
41
45
|
modelValue: (NumberConstructor | StringConstructor)[];
|
42
46
|
inputWidth: (NumberConstructor | StringConstructor)[];
|
@@ -89,6 +93,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
89
93
|
type: BooleanConstructor;
|
90
94
|
default: true;
|
91
95
|
};
|
96
|
+
autoFixed: {
|
97
|
+
type: BooleanConstructor;
|
98
|
+
default: true;
|
99
|
+
};
|
92
100
|
allowEmpty: BooleanConstructor;
|
93
101
|
modelValue: (NumberConstructor | StringConstructor)[];
|
94
102
|
inputWidth: (NumberConstructor | StringConstructor)[];
|
@@ -139,6 +147,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
139
147
|
type: BooleanConstructor;
|
140
148
|
default: true;
|
141
149
|
};
|
150
|
+
autoFixed: {
|
151
|
+
type: BooleanConstructor;
|
152
|
+
default: true;
|
153
|
+
};
|
142
154
|
allowEmpty: BooleanConstructor;
|
143
155
|
modelValue: (NumberConstructor | StringConstructor)[];
|
144
156
|
inputWidth: (NumberConstructor | StringConstructor)[];
|
@@ -172,6 +184,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
172
184
|
showMinus: boolean;
|
173
185
|
showInput: boolean;
|
174
186
|
longPress: boolean;
|
187
|
+
autoFixed: boolean;
|
175
188
|
allowEmpty: boolean;
|
176
189
|
disablePlus: boolean;
|
177
190
|
disableMinus: boolean;
|
package/lib/stepper/Stepper.js
CHANGED
@@ -41,6 +41,7 @@ const stepperProps = {
|
|
41
41
|
showMinus: import_utils.truthProp,
|
42
42
|
showInput: import_utils.truthProp,
|
43
43
|
longPress: import_utils.truthProp,
|
44
|
+
autoFixed: import_utils.truthProp,
|
44
45
|
allowEmpty: Boolean,
|
45
46
|
modelValue: import_utils.numericProp,
|
46
47
|
inputWidth: import_utils.numericProp,
|
@@ -60,7 +61,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
60
61
|
setup(props, {
|
61
62
|
emit
|
62
63
|
}) {
|
63
|
-
const format = (value) => {
|
64
|
+
const format = (value, autoFixed = true) => {
|
64
65
|
const {
|
65
66
|
min,
|
66
67
|
max,
|
@@ -73,7 +74,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
73
74
|
value = (0, import_utils.formatNumber)(String(value), !props.integer);
|
74
75
|
value = value === "" ? 0 : +value;
|
75
76
|
value = Number.isNaN(value) ? +min : value;
|
76
|
-
value = Math.max(Math.min(+max, value), +min);
|
77
|
+
value = autoFixed ? Math.max(Math.min(+max, value), +min) : value;
|
77
78
|
if ((0, import_utils.isDef)(decimalLength)) {
|
78
79
|
value = value.toFixed(+decimalLength);
|
79
80
|
}
|
@@ -157,7 +158,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
157
158
|
};
|
158
159
|
const onBlur = (event) => {
|
159
160
|
const input = event.target;
|
160
|
-
const value = format(input.value);
|
161
|
+
const value = format(input.value, props.autoFixed);
|
161
162
|
input.value = String(value);
|
162
163
|
current.value = value;
|
163
164
|
(0, import_vue2.nextTick)(() => {
|
package/lib/stepper/index.d.ts
CHANGED
@@ -34,6 +34,10 @@ export declare const Stepper: import("../utils").WithInstall<import("vue").Defin
|
|
34
34
|
type: BooleanConstructor;
|
35
35
|
default: true;
|
36
36
|
};
|
37
|
+
autoFixed: {
|
38
|
+
type: BooleanConstructor;
|
39
|
+
default: true;
|
40
|
+
};
|
37
41
|
allowEmpty: BooleanConstructor;
|
38
42
|
modelValue: (NumberConstructor | StringConstructor)[];
|
39
43
|
inputWidth: (NumberConstructor | StringConstructor)[];
|
@@ -84,6 +88,10 @@ export declare const Stepper: import("../utils").WithInstall<import("vue").Defin
|
|
84
88
|
type: BooleanConstructor;
|
85
89
|
default: true;
|
86
90
|
};
|
91
|
+
autoFixed: {
|
92
|
+
type: BooleanConstructor;
|
93
|
+
default: true;
|
94
|
+
};
|
87
95
|
allowEmpty: BooleanConstructor;
|
88
96
|
modelValue: (NumberConstructor | StringConstructor)[];
|
89
97
|
inputWidth: (NumberConstructor | StringConstructor)[];
|
@@ -117,6 +125,7 @@ export declare const Stepper: import("../utils").WithInstall<import("vue").Defin
|
|
117
125
|
showMinus: boolean;
|
118
126
|
showInput: boolean;
|
119
127
|
longPress: boolean;
|
128
|
+
autoFixed: boolean;
|
120
129
|
allowEmpty: boolean;
|
121
130
|
disablePlus: boolean;
|
122
131
|
disableMinus: boolean;
|
package/lib/swipe/Swipe.js
CHANGED
@@ -78,7 +78,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
78
78
|
}
|
79
79
|
return 0;
|
80
80
|
});
|
81
|
-
const maxCount = (0, import_vue2.computed)(() => Math.ceil(Math.abs(minOffset.value) / size.value));
|
81
|
+
const maxCount = (0, import_vue2.computed)(() => size.value ? Math.ceil(Math.abs(minOffset.value) / size.value) : count.value);
|
82
82
|
const trackSize = (0, import_vue2.computed)(() => count.value * size.value);
|
83
83
|
const activeIndicator = (0, import_vue2.computed)(() => (state.active + count.value) % count.value);
|
84
84
|
const isCorrectDirection = (0, import_vue2.computed)(() => {
|
package/lib/tabs/Tabs.js
CHANGED
@@ -171,17 +171,19 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
171
171
|
const newTab = children[newIndex];
|
172
172
|
const newName = getTabName(newTab, newIndex);
|
173
173
|
const shouldEmitChange = state.currentIndex !== null;
|
174
|
-
state.currentIndex
|
174
|
+
if (state.currentIndex !== newIndex) {
|
175
|
+
state.currentIndex = newIndex;
|
176
|
+
if (!skipScrollIntoView) {
|
177
|
+
scrollIntoView();
|
178
|
+
}
|
179
|
+
setLine();
|
180
|
+
}
|
175
181
|
if (newName !== props.active) {
|
176
182
|
emit("update:active", newName);
|
177
183
|
if (shouldEmitChange) {
|
178
184
|
emit("change", newName, newTab.title);
|
179
185
|
}
|
180
186
|
}
|
181
|
-
if (!skipScrollIntoView) {
|
182
|
-
scrollIntoView();
|
183
|
-
}
|
184
|
-
setLine();
|
185
187
|
if (stickyFixed && !props.scrollspy) {
|
186
188
|
(0, import_utils.setRootScrollTop)(Math.ceil((0, import_utils.getElementTop)(root.value) - offsetTopPx.value));
|
187
189
|
}
|
@@ -280,13 +282,14 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
280
282
|
}
|
281
283
|
};
|
282
284
|
const renderHeader = () => {
|
283
|
-
var _a, _b;
|
285
|
+
var _a, _b, _c;
|
284
286
|
const {
|
285
287
|
type,
|
286
|
-
border
|
288
|
+
border,
|
289
|
+
sticky
|
287
290
|
} = props;
|
288
|
-
|
289
|
-
"ref": wrapRef,
|
291
|
+
const Header = [(0, import_vue.createVNode)("div", {
|
292
|
+
"ref": sticky ? void 0 : wrapRef,
|
290
293
|
"class": [bem("wrap"), {
|
291
294
|
[import_utils.BORDER_TOP_BOTTOM]: type === "line" && border
|
292
295
|
}]
|
@@ -299,7 +302,13 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
299
302
|
}]),
|
300
303
|
"style": navStyle.value,
|
301
304
|
"aria-orientation": "horizontal"
|
302
|
-
}, [(_a = slots["nav-left"]) == null ? void 0 : _a.call(slots), renderNav(), renderLine(), (_b = slots["nav-right"]) == null ? void 0 : _b.call(slots)])]);
|
305
|
+
}, [(_a = slots["nav-left"]) == null ? void 0 : _a.call(slots), renderNav(), renderLine(), (_b = slots["nav-right"]) == null ? void 0 : _b.call(slots)])]), (_c = slots["nav-bottom"]) == null ? void 0 : _c.call(slots)];
|
306
|
+
if (sticky) {
|
307
|
+
return (0, import_vue.createVNode)("div", {
|
308
|
+
"ref": wrapRef
|
309
|
+
}, [Header]);
|
310
|
+
}
|
311
|
+
return Header;
|
303
312
|
};
|
304
313
|
(0, import_vue2.watch)([() => props.color, import_utils.windowWidth], setLine);
|
305
314
|
(0, import_vue2.watch)(() => props.active, (value) => {
|
@@ -353,36 +362,30 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
353
362
|
currentName,
|
354
363
|
scrollIntoView
|
355
364
|
});
|
356
|
-
return () => {
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
default: () => {
|
382
|
-
var _a2;
|
383
|
-
return [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)];
|
384
|
-
}
|
385
|
-
})]);
|
386
|
-
};
|
365
|
+
return () => (0, import_vue.createVNode)("div", {
|
366
|
+
"ref": root,
|
367
|
+
"class": bem([props.type])
|
368
|
+
}, [props.sticky ? (0, import_vue.createVNode)(import_sticky.Sticky, {
|
369
|
+
"container": root.value,
|
370
|
+
"offsetTop": offsetTopPx.value,
|
371
|
+
"onScroll": onStickyScroll
|
372
|
+
}, {
|
373
|
+
default: () => [renderHeader()]
|
374
|
+
}) : renderHeader(), (0, import_vue.createVNode)(import_TabsContent.default, {
|
375
|
+
"ref": contentRef,
|
376
|
+
"count": children.length,
|
377
|
+
"inited": state.inited,
|
378
|
+
"animated": props.animated,
|
379
|
+
"duration": props.duration,
|
380
|
+
"swipeable": props.swipeable,
|
381
|
+
"lazyRender": props.lazyRender,
|
382
|
+
"currentIndex": state.currentIndex,
|
383
|
+
"onChange": setCurrentIndex
|
384
|
+
}, {
|
385
|
+
default: () => {
|
386
|
+
var _a;
|
387
|
+
return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
|
388
|
+
}
|
389
|
+
})]);
|
387
390
|
}
|
388
391
|
});
|
@@ -68,13 +68,14 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
68
68
|
if (!(0, import_utils.isSameValue)(newValues, props.modelValue)) {
|
69
69
|
emit("update:modelValue", newValues);
|
70
70
|
}
|
71
|
-
}, {
|
72
|
-
immediate: true
|
73
71
|
});
|
74
72
|
(0, import_vue2.watch)(() => props.modelValue, (newValues) => {
|
73
|
+
newValues = (0, import_utils2.formatValueRange)(newValues, columns.value);
|
75
74
|
if (!(0, import_utils.isSameValue)(newValues, currentValues.value)) {
|
76
75
|
currentValues.value = newValues;
|
77
76
|
}
|
77
|
+
}, {
|
78
|
+
immediate: true
|
78
79
|
});
|
79
80
|
const onChange = (...args) => emit("change", ...args);
|
80
81
|
const onCancel = (...args) => emit("cancel", ...args);
|
package/lib/toast/Toast.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { type PropType, type CSSProperties, type ExtractPropTypes } from 'vue';
|
2
2
|
import { LoadingType } from '../loading';
|
3
|
-
import type { ToastType, ToastPosition } from './types';
|
3
|
+
import type { ToastType, ToastPosition, ToastWordBreak } from './types';
|
4
4
|
export declare const toastProps: {
|
5
5
|
icon: StringConstructor;
|
6
6
|
show: BooleanConstructor;
|
@@ -20,6 +20,7 @@ export declare const toastProps: {
|
|
20
20
|
default: ToastPosition;
|
21
21
|
};
|
22
22
|
teleport: PropType<string | import("vue").RendererElement | null | undefined>;
|
23
|
+
wordBreak: PropType<ToastWordBreak>;
|
23
24
|
className: PropType<unknown>;
|
24
25
|
iconPrefix: StringConstructor;
|
25
26
|
transition: {
|
@@ -53,6 +54,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
53
54
|
default: ToastPosition;
|
54
55
|
};
|
55
56
|
teleport: PropType<string | import("vue").RendererElement | null | undefined>;
|
57
|
+
wordBreak: PropType<ToastWordBreak>;
|
56
58
|
className: PropType<unknown>;
|
57
59
|
iconPrefix: StringConstructor;
|
58
60
|
transition: {
|
@@ -84,6 +86,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
84
86
|
default: ToastPosition;
|
85
87
|
};
|
86
88
|
teleport: PropType<string | import("vue").RendererElement | null | undefined>;
|
89
|
+
wordBreak: PropType<ToastWordBreak>;
|
87
90
|
className: PropType<unknown>;
|
88
91
|
iconPrefix: StringConstructor;
|
89
92
|
transition: {
|
package/lib/toast/Toast.js
CHANGED
@@ -40,6 +40,7 @@ const toastProps = {
|
|
40
40
|
duration: (0, import_utils.makeNumberProp)(2e3),
|
41
41
|
position: (0, import_utils.makeStringProp)("middle"),
|
42
42
|
teleport: [String, Object],
|
43
|
+
wordBreak: String,
|
43
44
|
className: import_utils.unknownProp,
|
44
45
|
iconPrefix: String,
|
45
46
|
transition: (0, import_utils.makeStringProp)("van-fade"),
|
@@ -131,7 +132,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
131
132
|
(0, import_vue2.onMounted)(toggleClickable);
|
132
133
|
(0, import_vue2.onUnmounted)(toggleClickable);
|
133
134
|
return () => (0, import_vue.createVNode)(import_popup.Popup, (0, import_vue.mergeProps)({
|
134
|
-
"class": [bem([props.position, {
|
135
|
+
"class": [bem([props.position, props.wordBreak === "normal" ? "break-normal" : props.wordBreak, {
|
135
136
|
[props.type]: !props.icon
|
136
137
|
}]), props.className],
|
137
138
|
"lockScroll": false,
|
package/lib/toast/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:root{--van-toast-max-width: 70%;--van-toast-font-size: var(--van-font-size-md);--van-toast-text-color: var(--van-white);--van-toast-loading-icon-color: var(--van-white);--van-toast-line-height: var(--van-line-height-md);--van-toast-radius: var(--van-radius-lg);--van-toast-background: rgba(0, 0, 0, .7);--van-toast-icon-size: 36px;--van-toast-text-min-width: 96px;--van-toast-text-padding: var(--van-padding-xs) var(--van-padding-sm);--van-toast-default-padding: var(--van-padding-md);--van-toast-default-width: 88px;--van-toast-default-min-height: 88px;--van-toast-position-top-distance: 20%;--van-toast-position-bottom-distance: 20%}.van-toast{display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:content-box;transition:all var(--van-duration-fast);width:var(--van-toast-default-width);max-width:var(--van-toast-max-width);min-height:var(--van-toast-default-min-height);padding:var(--van-toast-default-padding);color:var(--van-toast-text-color);font-size:var(--van-toast-font-size);line-height:var(--van-toast-line-height);white-space:pre-wrap;
|
1
|
+
:root{--van-toast-max-width: 70%;--van-toast-font-size: var(--van-font-size-md);--van-toast-text-color: var(--van-white);--van-toast-loading-icon-color: var(--van-white);--van-toast-line-height: var(--van-line-height-md);--van-toast-radius: var(--van-radius-lg);--van-toast-background: rgba(0, 0, 0, .7);--van-toast-icon-size: 36px;--van-toast-text-min-width: 96px;--van-toast-text-padding: var(--van-padding-xs) var(--van-padding-sm);--van-toast-default-padding: var(--van-padding-md);--van-toast-default-width: 88px;--van-toast-default-min-height: 88px;--van-toast-position-top-distance: 20%;--van-toast-position-bottom-distance: 20%}.van-toast{display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:content-box;transition:all var(--van-duration-fast);width:var(--van-toast-default-width);max-width:var(--van-toast-max-width);min-height:var(--van-toast-default-min-height);padding:var(--van-toast-default-padding);color:var(--van-toast-text-color);font-size:var(--van-toast-font-size);line-height:var(--van-toast-line-height);white-space:pre-wrap;word-break:break-all;text-align:center;background:var(--van-toast-background);border-radius:var(--van-toast-radius)}.van-toast--break-normal{word-break:normal;word-wrap:normal}.van-toast--break-word{word-break:normal;word-wrap:break-word}.van-toast--unclickable{overflow:hidden;cursor:not-allowed}.van-toast--unclickable *{pointer-events:none}.van-toast--text,.van-toast--html{width:-webkit-fit-content;width:fit-content;min-width:var(--van-toast-text-min-width);min-height:0;padding:var(--van-toast-text-padding)}.van-toast--text .van-toast__text,.van-toast--html .van-toast__text{margin-top:0}.van-toast--top{top:var(--van-toast-position-top-distance)}.van-toast--bottom{top:auto;bottom:var(--van-toast-position-bottom-distance)}.van-toast__icon{font-size:var(--van-toast-icon-size)}.van-toast__loading{padding:var(--van-padding-base);color:var(--van-toast-loading-icon-color)}.van-toast__text{margin-top:var(--van-padding-xs)}
|
package/lib/toast/index.d.ts
CHANGED
@@ -17,6 +17,7 @@ export declare const Toast: import("../utils").WithInstall<import("vue").DefineC
|
|
17
17
|
default: import("./types").ToastPosition;
|
18
18
|
};
|
19
19
|
teleport: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
|
20
|
+
wordBreak: import("vue").PropType<import("./types").ToastWordBreak>;
|
20
21
|
className: import("vue").PropType<unknown>;
|
21
22
|
iconPrefix: StringConstructor;
|
22
23
|
transition: {
|
@@ -48,6 +49,7 @@ export declare const Toast: import("../utils").WithInstall<import("vue").DefineC
|
|
48
49
|
default: import("./types").ToastPosition;
|
49
50
|
};
|
50
51
|
teleport: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
|
52
|
+
wordBreak: import("vue").PropType<import("./types").ToastWordBreak>;
|
51
53
|
className: import("vue").PropType<unknown>;
|
52
54
|
iconPrefix: StringConstructor;
|
53
55
|
transition: {
|
@@ -77,7 +79,7 @@ export default Toast;
|
|
77
79
|
export { toastProps } from './Toast';
|
78
80
|
export { showToast, closeToast, showFailToast, showLoadingToast, showSuccessToast, allowMultipleToast, setToastDefaultOptions, resetToastDefaultOptions, } from './function-call';
|
79
81
|
export type { ToastProps } from './Toast';
|
80
|
-
export type { ToastType, ToastOptions, ToastPosition, ToastThemeVars, } from './types';
|
82
|
+
export type { ToastType, ToastOptions, ToastPosition, ToastThemeVars, ToastWordBreak, } from './types';
|
81
83
|
declare module 'vue' {
|
82
84
|
interface GlobalComponents {
|
83
85
|
VanToast: typeof Toast;
|
package/lib/toast/types.d.ts
CHANGED
@@ -3,6 +3,7 @@ import type { LoadingType } from '../loading';
|
|
3
3
|
import type { Numeric } from '../utils';
|
4
4
|
export declare type ToastType = 'text' | 'loading' | 'success' | 'fail' | 'html';
|
5
5
|
export declare type ToastPosition = 'top' | 'middle' | 'bottom';
|
6
|
+
export declare type ToastWordBreak = 'break-all' | 'break-word' | 'normal';
|
6
7
|
export declare type ToastOptions = {
|
7
8
|
icon?: string;
|
8
9
|
type?: ToastType;
|
@@ -18,6 +19,7 @@ export declare type ToastOptions = {
|
|
18
19
|
className?: unknown;
|
19
20
|
transition?: string;
|
20
21
|
iconPrefix?: string;
|
22
|
+
wordBreak?: ToastWordBreak;
|
21
23
|
loadingType?: LoadingType;
|
22
24
|
forbidClick?: boolean;
|
23
25
|
closeOnClick?: boolean;
|