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/es/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/es/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/es/stepper/Stepper.mjs
CHANGED
@@ -18,6 +18,7 @@ const stepperProps = {
|
|
18
18
|
showMinus: truthProp,
|
19
19
|
showInput: truthProp,
|
20
20
|
longPress: truthProp,
|
21
|
+
autoFixed: truthProp,
|
21
22
|
allowEmpty: Boolean,
|
22
23
|
modelValue: numericProp,
|
23
24
|
inputWidth: numericProp,
|
@@ -37,7 +38,7 @@ var stdin_default = defineComponent({
|
|
37
38
|
setup(props, {
|
38
39
|
emit
|
39
40
|
}) {
|
40
|
-
const format = (value) => {
|
41
|
+
const format = (value, autoFixed = true) => {
|
41
42
|
const {
|
42
43
|
min,
|
43
44
|
max,
|
@@ -50,7 +51,7 @@ var stdin_default = defineComponent({
|
|
50
51
|
value = formatNumber(String(value), !props.integer);
|
51
52
|
value = value === "" ? 0 : +value;
|
52
53
|
value = Number.isNaN(value) ? +min : value;
|
53
|
-
value = Math.max(Math.min(+max, value), +min);
|
54
|
+
value = autoFixed ? Math.max(Math.min(+max, value), +min) : value;
|
54
55
|
if (isDef(decimalLength)) {
|
55
56
|
value = value.toFixed(+decimalLength);
|
56
57
|
}
|
@@ -134,7 +135,7 @@ var stdin_default = defineComponent({
|
|
134
135
|
};
|
135
136
|
const onBlur = (event) => {
|
136
137
|
const input = event.target;
|
137
|
-
const value = format(input.value);
|
138
|
+
const value = format(input.value, props.autoFixed);
|
138
139
|
input.value = String(value);
|
139
140
|
current.value = value;
|
140
141
|
nextTick(() => {
|
package/es/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/es/swipe/Swipe.mjs
CHANGED
@@ -54,7 +54,7 @@ var stdin_default = defineComponent({
|
|
54
54
|
}
|
55
55
|
return 0;
|
56
56
|
});
|
57
|
-
const maxCount = computed(() => Math.ceil(Math.abs(minOffset.value) / size.value));
|
57
|
+
const maxCount = computed(() => size.value ? Math.ceil(Math.abs(minOffset.value) / size.value) : count.value);
|
58
58
|
const trackSize = computed(() => count.value * size.value);
|
59
59
|
const activeIndicator = computed(() => (state.active + count.value) % count.value);
|
60
60
|
const isCorrectDirection = computed(() => {
|
package/es/tabs/Tabs.mjs
CHANGED
@@ -141,17 +141,19 @@ var stdin_default = defineComponent({
|
|
141
141
|
const newTab = children[newIndex];
|
142
142
|
const newName = getTabName(newTab, newIndex);
|
143
143
|
const shouldEmitChange = state.currentIndex !== null;
|
144
|
-
state.currentIndex
|
144
|
+
if (state.currentIndex !== newIndex) {
|
145
|
+
state.currentIndex = newIndex;
|
146
|
+
if (!skipScrollIntoView) {
|
147
|
+
scrollIntoView();
|
148
|
+
}
|
149
|
+
setLine();
|
150
|
+
}
|
145
151
|
if (newName !== props.active) {
|
146
152
|
emit("update:active", newName);
|
147
153
|
if (shouldEmitChange) {
|
148
154
|
emit("change", newName, newTab.title);
|
149
155
|
}
|
150
156
|
}
|
151
|
-
if (!skipScrollIntoView) {
|
152
|
-
scrollIntoView();
|
153
|
-
}
|
154
|
-
setLine();
|
155
157
|
if (stickyFixed && !props.scrollspy) {
|
156
158
|
setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
|
157
159
|
}
|
@@ -250,13 +252,14 @@ var stdin_default = defineComponent({
|
|
250
252
|
}
|
251
253
|
};
|
252
254
|
const renderHeader = () => {
|
253
|
-
var _a, _b;
|
255
|
+
var _a, _b, _c;
|
254
256
|
const {
|
255
257
|
type,
|
256
|
-
border
|
258
|
+
border,
|
259
|
+
sticky
|
257
260
|
} = props;
|
258
|
-
|
259
|
-
"ref": wrapRef,
|
261
|
+
const Header = [_createVNode("div", {
|
262
|
+
"ref": sticky ? void 0 : wrapRef,
|
260
263
|
"class": [bem("wrap"), {
|
261
264
|
[BORDER_TOP_BOTTOM]: type === "line" && border
|
262
265
|
}]
|
@@ -269,7 +272,13 @@ var stdin_default = defineComponent({
|
|
269
272
|
}]),
|
270
273
|
"style": navStyle.value,
|
271
274
|
"aria-orientation": "horizontal"
|
272
|
-
}, [(_a = slots["nav-left"]) == null ? void 0 : _a.call(slots), renderNav(), renderLine(), (_b = slots["nav-right"]) == null ? void 0 : _b.call(slots)])]);
|
275
|
+
}, [(_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)];
|
276
|
+
if (sticky) {
|
277
|
+
return _createVNode("div", {
|
278
|
+
"ref": wrapRef
|
279
|
+
}, [Header]);
|
280
|
+
}
|
281
|
+
return Header;
|
273
282
|
};
|
274
283
|
watch([() => props.color, windowWidth], setLine);
|
275
284
|
watch(() => props.active, (value) => {
|
@@ -323,37 +332,31 @@ var stdin_default = defineComponent({
|
|
323
332
|
currentName,
|
324
333
|
scrollIntoView
|
325
334
|
});
|
326
|
-
return () => {
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
default: () => {
|
352
|
-
var _a2;
|
353
|
-
return [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)];
|
354
|
-
}
|
355
|
-
})]);
|
356
|
-
};
|
335
|
+
return () => _createVNode("div", {
|
336
|
+
"ref": root,
|
337
|
+
"class": bem([props.type])
|
338
|
+
}, [props.sticky ? _createVNode(Sticky, {
|
339
|
+
"container": root.value,
|
340
|
+
"offsetTop": offsetTopPx.value,
|
341
|
+
"onScroll": onStickyScroll
|
342
|
+
}, {
|
343
|
+
default: () => [renderHeader()]
|
344
|
+
}) : renderHeader(), _createVNode(TabsContent, {
|
345
|
+
"ref": contentRef,
|
346
|
+
"count": children.length,
|
347
|
+
"inited": state.inited,
|
348
|
+
"animated": props.animated,
|
349
|
+
"duration": props.duration,
|
350
|
+
"swipeable": props.swipeable,
|
351
|
+
"lazyRender": props.lazyRender,
|
352
|
+
"currentIndex": state.currentIndex,
|
353
|
+
"onChange": setCurrentIndex
|
354
|
+
}, {
|
355
|
+
default: () => {
|
356
|
+
var _a;
|
357
|
+
return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
|
358
|
+
}
|
359
|
+
})]);
|
357
360
|
}
|
358
361
|
});
|
359
362
|
export {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
2
2
|
import { ref, watch, computed, defineComponent } from "vue";
|
3
3
|
import { pick, extend, createNamespace, makeNumericProp, isSameValue } from "../utils/index.mjs";
|
4
|
-
import { genOptions, sharedProps, pickerInheritKeys } from "../date-picker/utils.mjs";
|
4
|
+
import { genOptions, sharedProps, pickerInheritKeys, formatValueRange } from "../date-picker/utils.mjs";
|
5
5
|
import { Picker } from "../picker/index.mjs";
|
6
6
|
const [name] = createNamespace("time-picker");
|
7
7
|
const timePickerProps = extend({}, sharedProps, {
|
@@ -45,13 +45,14 @@ var stdin_default = defineComponent({
|
|
45
45
|
if (!isSameValue(newValues, props.modelValue)) {
|
46
46
|
emit("update:modelValue", newValues);
|
47
47
|
}
|
48
|
-
}, {
|
49
|
-
immediate: true
|
50
48
|
});
|
51
49
|
watch(() => props.modelValue, (newValues) => {
|
50
|
+
newValues = formatValueRange(newValues, columns.value);
|
52
51
|
if (!isSameValue(newValues, currentValues.value)) {
|
53
52
|
currentValues.value = newValues;
|
54
53
|
}
|
54
|
+
}, {
|
55
|
+
immediate: true
|
55
56
|
});
|
56
57
|
const onChange = (...args) => emit("change", ...args);
|
57
58
|
const onCancel = (...args) => emit("cancel", ...args);
|
package/es/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/es/toast/Toast.mjs
CHANGED
@@ -17,6 +17,7 @@ const toastProps = {
|
|
17
17
|
duration: makeNumberProp(2e3),
|
18
18
|
position: makeStringProp("middle"),
|
19
19
|
teleport: [String, Object],
|
20
|
+
wordBreak: String,
|
20
21
|
className: unknownProp,
|
21
22
|
iconPrefix: String,
|
22
23
|
transition: makeStringProp("van-fade"),
|
@@ -108,7 +109,7 @@ var stdin_default = defineComponent({
|
|
108
109
|
onMounted(toggleClickable);
|
109
110
|
onUnmounted(toggleClickable);
|
110
111
|
return () => _createVNode(Popup, _mergeProps({
|
111
|
-
"class": [bem([props.position, {
|
112
|
+
"class": [bem([props.position, props.wordBreak === "normal" ? "break-normal" : props.wordBreak, {
|
112
113
|
[props.type]: !props.icon
|
113
114
|
}]), props.className],
|
114
115
|
"lockScroll": false,
|
package/es/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/es/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/es/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;
|
package/lib/calendar/Calendar.js
CHANGED
@@ -135,7 +135,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
135
135
|
};
|
136
136
|
let bodyHeight;
|
137
137
|
const bodyRef = (0, import_vue2.ref)();
|
138
|
-
const subtitle = (0, import_vue2.ref)(
|
138
|
+
const subtitle = (0, import_vue2.ref)({
|
139
|
+
text: "",
|
140
|
+
date: void 0
|
141
|
+
});
|
139
142
|
const currentDate = (0, import_vue2.ref)(getInitialDate());
|
140
143
|
const [monthRefs, setMonthRefs] = (0, import_use_refs.useRefs)();
|
141
144
|
const dayOffset = (0, import_vue2.computed)(() => props.firstDayOfWeek ? +props.firstDayOfWeek % 7 : 0);
|
@@ -196,7 +199,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
196
199
|
monthRefs.value[index].setVisible(visible);
|
197
200
|
});
|
198
201
|
if (currentMonth) {
|
199
|
-
subtitle.value =
|
202
|
+
subtitle.value = {
|
203
|
+
text: currentMonth.getTitle(),
|
204
|
+
date: currentMonth.date
|
205
|
+
};
|
200
206
|
}
|
201
207
|
};
|
202
208
|
const scrollToDate = (targetDate) => {
|
@@ -386,8 +392,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
386
392
|
const renderCalendar = () => (0, import_vue.createVNode)("div", {
|
387
393
|
"class": (0, import_utils2.bem)()
|
388
394
|
}, [(0, import_vue.createVNode)(import_CalendarHeader.default, {
|
395
|
+
"date": subtitle.value.date,
|
389
396
|
"title": props.title,
|
390
|
-
"subtitle": subtitle.value,
|
397
|
+
"subtitle": subtitle.value.text,
|
391
398
|
"showTitle": props.showTitle,
|
392
399
|
"showSubtitle": props.showSubtitle,
|
393
400
|
"firstDayOfWeek": dayOffset.value,
|
@@ -1,10 +1,12 @@
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
2
|
+
date: DateConstructor;
|
2
3
|
title: StringConstructor;
|
3
4
|
subtitle: StringConstructor;
|
4
5
|
showTitle: BooleanConstructor;
|
5
6
|
showSubtitle: BooleanConstructor;
|
6
7
|
firstDayOfWeek: NumberConstructor;
|
7
8
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "clickSubtitle"[], "clickSubtitle", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
9
|
+
date: DateConstructor;
|
8
10
|
title: StringConstructor;
|
9
11
|
subtitle: StringConstructor;
|
10
12
|
showTitle: BooleanConstructor;
|
@@ -28,6 +28,7 @@ const [name] = (0, import_utils.createNamespace)("calendar-header");
|
|
28
28
|
var stdin_default = (0, import_vue2.defineComponent)({
|
29
29
|
name,
|
30
30
|
props: {
|
31
|
+
date: Date,
|
31
32
|
title: String,
|
32
33
|
subtitle: String,
|
33
34
|
showTitle: Boolean,
|
@@ -51,7 +52,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
51
52
|
const onClickSubtitle = (event) => emit("clickSubtitle", event);
|
52
53
|
const renderSubtitle = () => {
|
53
54
|
if (props.showSubtitle) {
|
54
|
-
const title = slots.subtitle ? slots.subtitle(
|
55
|
+
const title = slots.subtitle ? slots.subtitle({
|
56
|
+
date: props.date,
|
57
|
+
text: props.subtitle
|
58
|
+
}) : props.subtitle;
|
55
59
|
return (0, import_vue.createVNode)("div", {
|
56
60
|
"class": (0, import_utils2.bem)("header-subtitle"),
|
57
61
|
"onClick": onClickSubtitle
|
package/lib/cell/Cell.d.ts
CHANGED
@@ -2,6 +2,10 @@ import { type PropType, type CSSProperties, type ExtractPropTypes } from 'vue';
|
|
2
2
|
export declare type CellSize = 'normal' | 'large';
|
3
3
|
export declare type CellArrowDirection = 'up' | 'down' | 'left' | 'right';
|
4
4
|
export declare const cellSharedProps: {
|
5
|
+
tag: {
|
6
|
+
type: PropType<keyof HTMLElementTagNameMap>;
|
7
|
+
default: keyof HTMLElementTagNameMap;
|
8
|
+
};
|
5
9
|
icon: StringConstructor;
|
6
10
|
size: PropType<CellSize>;
|
7
11
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -26,6 +30,10 @@ export declare const cellSharedProps: {
|
|
26
30
|
};
|
27
31
|
};
|
28
32
|
export declare const cellProps: {
|
33
|
+
tag: {
|
34
|
+
type: PropType<keyof HTMLElementTagNameMap>;
|
35
|
+
default: keyof HTMLElementTagNameMap;
|
36
|
+
};
|
29
37
|
icon: StringConstructor;
|
30
38
|
size: PropType<CellSize>;
|
31
39
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -55,6 +63,10 @@ export declare const cellProps: {
|
|
55
63
|
};
|
56
64
|
export declare type CellProps = ExtractPropTypes<typeof cellProps>;
|
57
65
|
declare const _default: import("vue").DefineComponent<{
|
66
|
+
tag: {
|
67
|
+
type: PropType<keyof HTMLElementTagNameMap>;
|
68
|
+
default: keyof HTMLElementTagNameMap;
|
69
|
+
};
|
58
70
|
icon: StringConstructor;
|
59
71
|
size: PropType<CellSize>;
|
60
72
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -82,6 +94,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
82
94
|
url: StringConstructor;
|
83
95
|
replace: BooleanConstructor;
|
84
96
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
97
|
+
tag: {
|
98
|
+
type: PropType<keyof HTMLElementTagNameMap>;
|
99
|
+
default: keyof HTMLElementTagNameMap;
|
100
|
+
};
|
85
101
|
icon: StringConstructor;
|
86
102
|
size: PropType<CellSize>;
|
87
103
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -111,6 +127,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
111
127
|
}>>, {
|
112
128
|
replace: boolean;
|
113
129
|
required: boolean;
|
130
|
+
tag: keyof HTMLElementTagNameMap;
|
114
131
|
center: boolean;
|
115
132
|
isLink: boolean;
|
116
133
|
border: boolean;
|
package/lib/cell/Cell.js
CHANGED
@@ -29,6 +29,7 @@ var import_use_route = require("../composables/use-route");
|
|
29
29
|
var import_icon = require("../icon");
|
30
30
|
const [name, bem] = (0, import_utils.createNamespace)("cell");
|
31
31
|
const cellSharedProps = {
|
32
|
+
tag: (0, import_utils.makeStringProp)("div"),
|
32
33
|
icon: String,
|
33
34
|
size: String,
|
34
35
|
title: import_utils.numericProp,
|
@@ -107,8 +108,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
107
108
|
}
|
108
109
|
};
|
109
110
|
return () => {
|
110
|
-
var _a
|
111
|
+
var _a;
|
111
112
|
const {
|
113
|
+
tag,
|
112
114
|
size,
|
113
115
|
center,
|
114
116
|
border,
|
@@ -125,12 +127,17 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
125
127
|
if (size) {
|
126
128
|
classes[size] = !!size;
|
127
129
|
}
|
128
|
-
return (0, import_vue.createVNode)(
|
130
|
+
return (0, import_vue.createVNode)(tag, {
|
129
131
|
"class": bem(classes),
|
130
132
|
"role": clickable ? "button" : void 0,
|
131
133
|
"tabindex": clickable ? 0 : void 0,
|
132
134
|
"onClick": route
|
133
|
-
},
|
135
|
+
}, {
|
136
|
+
default: () => {
|
137
|
+
var _a2;
|
138
|
+
return [renderLeftIcon(), renderTitle(), renderValue(), renderRightIcon(), (_a2 = slots.extra) == null ? void 0 : _a2.call(slots)];
|
139
|
+
}
|
140
|
+
});
|
134
141
|
};
|
135
142
|
}
|
136
143
|
});
|
package/lib/cell/index.d.ts
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
export declare const Cell: import("../utils").WithInstall<import("vue").DefineComponent<{
|
2
|
+
tag: {
|
3
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
4
|
+
default: keyof HTMLElementTagNameMap;
|
5
|
+
};
|
2
6
|
icon: StringConstructor;
|
3
7
|
size: import("vue").PropType<import("./Cell").CellSize>;
|
4
8
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -26,6 +30,10 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
|
|
26
30
|
url: StringConstructor;
|
27
31
|
replace: BooleanConstructor;
|
28
32
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
33
|
+
tag: {
|
34
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
35
|
+
default: keyof HTMLElementTagNameMap;
|
36
|
+
};
|
29
37
|
icon: StringConstructor;
|
30
38
|
size: import("vue").PropType<import("./Cell").CellSize>;
|
31
39
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -55,6 +63,7 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
|
|
55
63
|
}>>, {
|
56
64
|
replace: boolean;
|
57
65
|
required: boolean;
|
66
|
+
tag: keyof HTMLElementTagNameMap;
|
58
67
|
center: boolean;
|
59
68
|
isLink: boolean;
|
60
69
|
border: boolean;
|
@@ -1,5 +1,9 @@
|
|
1
1
|
import { type ExtractPropTypes } from 'vue';
|
2
2
|
export declare const collapseItemProps: {
|
3
|
+
tag: {
|
4
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
5
|
+
default: keyof HTMLElementTagNameMap;
|
6
|
+
};
|
3
7
|
icon: StringConstructor;
|
4
8
|
size: import("vue").PropType<import("../cell").CellSize>;
|
5
9
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -37,6 +41,10 @@ export declare const collapseItemProps: {
|
|
37
41
|
};
|
38
42
|
export declare type CollapseItemProps = ExtractPropTypes<typeof collapseItemProps>;
|
39
43
|
declare const _default: import("vue").DefineComponent<{
|
44
|
+
tag: {
|
45
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
46
|
+
default: keyof HTMLElementTagNameMap;
|
47
|
+
};
|
40
48
|
icon: StringConstructor;
|
41
49
|
size: import("vue").PropType<import("../cell").CellSize>;
|
42
50
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -72,6 +80,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
72
80
|
default: true;
|
73
81
|
};
|
74
82
|
}, (() => JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
83
|
+
tag: {
|
84
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
85
|
+
default: keyof HTMLElementTagNameMap;
|
86
|
+
};
|
75
87
|
icon: StringConstructor;
|
76
88
|
size: import("vue").PropType<import("../cell").CellSize>;
|
77
89
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -108,6 +120,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
108
120
|
};
|
109
121
|
}>>, {
|
110
122
|
required: boolean;
|
123
|
+
tag: keyof HTMLElementTagNameMap;
|
111
124
|
center: boolean;
|
112
125
|
disabled: boolean;
|
113
126
|
isLink: boolean;
|
@@ -1,4 +1,8 @@
|
|
1
1
|
export declare const CollapseItem: import("../utils").WithInstall<import("vue").DefineComponent<{
|
2
|
+
tag: {
|
3
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
4
|
+
default: keyof HTMLElementTagNameMap;
|
5
|
+
};
|
2
6
|
icon: StringConstructor;
|
3
7
|
size: import("vue").PropType<import("..").CellSize>;
|
4
8
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -34,6 +38,10 @@ export declare const CollapseItem: import("../utils").WithInstall<import("vue").
|
|
34
38
|
default: true;
|
35
39
|
};
|
36
40
|
}, (() => JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
41
|
+
tag: {
|
42
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
43
|
+
default: keyof HTMLElementTagNameMap;
|
44
|
+
};
|
37
45
|
icon: StringConstructor;
|
38
46
|
size: import("vue").PropType<import("..").CellSize>;
|
39
47
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -70,6 +78,7 @@ export declare const CollapseItem: import("../utils").WithInstall<import("vue").
|
|
70
78
|
};
|
71
79
|
}>>, {
|
72
80
|
required: boolean;
|
81
|
+
tag: keyof HTMLElementTagNameMap;
|
73
82
|
center: boolean;
|
74
83
|
disabled: boolean;
|
75
84
|
isLink: boolean;
|