vant 4.0.0-rc.5 → 4.0.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/action-sheet/index.css +1 -1
- 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/composables/use-sync-prop-ref.d.ts +2 -0
- package/es/composables/use-sync-prop-ref.mjs +18 -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/field/Field.d.ts +13 -0
- package/es/field/index.d.ts +9 -0
- package/es/image-preview/ImagePreview.d.ts +2 -1
- package/es/image-preview/ImagePreview.mjs +9 -4
- package/es/image-preview/ImagePreviewItem.d.ts +2 -1
- package/es/image-preview/ImagePreviewItem.mjs +22 -13
- package/es/image-preview/index.css +1 -1
- package/es/image-preview/index.d.ts +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/lazyload/vue-lazyload/lazy-image.mjs +5 -5
- package/es/picker/Picker.mjs +4 -2
- package/es/picker/PickerColumn.mjs +5 -4
- package/es/popover/Popover.mjs +13 -8
- package/es/skeleton/Skeleton.d.ts +23 -23
- package/es/skeleton/Skeleton.mjs +28 -23
- package/es/skeleton/SkeletonAvatar.d.ts +26 -0
- package/es/skeleton/SkeletonAvatar.mjs +22 -0
- package/es/skeleton/SkeletonImage.d.ts +26 -0
- package/es/skeleton/SkeletonImage.mjs +26 -0
- package/es/skeleton/SkeletonParagraph.d.ts +27 -0
- package/es/skeleton/SkeletonParagraph.mjs +31 -0
- package/es/skeleton/SkeletonTitle.d.ts +16 -0
- package/es/skeleton/SkeletonTitle.mjs +26 -0
- package/es/skeleton/index.css +1 -1
- package/es/skeleton/index.d.ts +85 -18
- package/es/skeleton/index.mjs +22 -2
- package/es/skeleton/style/index.mjs +2 -0
- package/es/skeleton/types.d.ts +7 -3
- package/es/stepper/Stepper.d.ts +1 -1
- package/es/stepper/Stepper.mjs +1 -2
- package/es/stepper/index.d.ts +1 -1
- package/es/swipe/Swipe.mjs +1 -1
- package/es/time-picker/TimePicker.mjs +4 -1
- 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/es/uploader/Uploader.mjs +4 -4
- package/es/utils/constant.d.ts +1 -0
- package/es/utils/constant.mjs +3 -1
- package/lib/action-sheet/index.css +1 -1
- 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/composables/use-sync-prop-ref.d.ts +2 -0
- package/lib/composables/use-sync-prop-ref.js +37 -0
- package/lib/coupon/index.css +1 -1
- package/lib/coupon-list/index.css +1 -1
- package/lib/date-picker/DatePicker.js +4 -1
- package/lib/field/Field.d.ts +13 -0
- package/lib/field/index.d.ts +9 -0
- package/lib/image-preview/ImagePreview.d.ts +2 -1
- package/lib/image-preview/ImagePreview.js +9 -4
- package/lib/image-preview/ImagePreviewItem.d.ts +2 -1
- package/lib/image-preview/ImagePreviewItem.js +21 -12
- package/lib/image-preview/index.css +1 -1
- package/lib/image-preview/index.d.ts +2 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/lazyload/vue-lazyload/lazy-image.js +6 -6
- package/lib/picker/Picker.js +3 -1
- package/lib/picker/PickerColumn.js +5 -4
- package/lib/popover/Popover.js +13 -8
- package/lib/skeleton/Skeleton.d.ts +23 -23
- package/lib/skeleton/Skeleton.js +34 -23
- package/lib/skeleton/SkeletonAvatar.d.ts +26 -0
- package/lib/skeleton/SkeletonAvatar.js +41 -0
- package/lib/skeleton/SkeletonImage.d.ts +26 -0
- package/lib/skeleton/SkeletonImage.js +45 -0
- package/lib/skeleton/SkeletonParagraph.d.ts +27 -0
- package/lib/skeleton/SkeletonParagraph.js +50 -0
- package/lib/skeleton/SkeletonTitle.d.ts +16 -0
- package/lib/skeleton/SkeletonTitle.js +45 -0
- package/lib/skeleton/index.css +1 -1
- package/lib/skeleton/index.d.ts +85 -18
- package/lib/skeleton/index.js +22 -2
- package/lib/skeleton/style/index.js +2 -0
- package/lib/skeleton/types.d.ts +7 -3
- package/lib/stepper/Stepper.d.ts +1 -1
- package/lib/stepper/Stepper.js +1 -2
- package/lib/stepper/index.d.ts +1 -1
- package/lib/swipe/Swipe.js +1 -1
- package/lib/time-picker/TimePicker.js +4 -1
- 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/uploader/Uploader.js +3 -3
- package/lib/utils/constant.d.ts +1 -0
- package/lib/utils/constant.js +3 -1
- package/lib/vant.cjs.js +936 -788
- package/lib/vant.es.js +936 -788
- package/lib/vant.js +930 -788
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -12150
- package/package.json +1 -1
- package/changelog.generated.md +0 -71
package/es/picker/Picker.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
|
2
|
-
import { ref, watch, computed, defineComponent } from "vue";
|
2
|
+
import { ref, watch, computed, nextTick, defineComponent } from "vue";
|
3
3
|
import { pick, extend, unitToPx, truthProp, isSameValue, makeArrayProp, preventDefault, makeStringProp, makeNumericProp, BORDER_UNSET_TOP_BOTTOM } from "../utils/index.mjs";
|
4
4
|
import { bem, name, isOptionExist, getColumnsType, findOptionByValue, assignDefaultFields, formatCascadeColumns, getFirstEnabledOption } from "./utils.mjs";
|
5
5
|
import { useChildren, useEventListener, useParent } from "@vant/use";
|
@@ -91,7 +91,9 @@ var stdin_default = defineComponent({
|
|
91
91
|
const confirm = () => {
|
92
92
|
children.forEach((child) => child.stopMomentum());
|
93
93
|
const params = getEventParams();
|
94
|
-
|
94
|
+
nextTick(() => {
|
95
|
+
emit("confirm", params);
|
96
|
+
});
|
95
97
|
return params;
|
96
98
|
};
|
97
99
|
const cancel = () => emit("cancel", getEventParams());
|
@@ -55,8 +55,9 @@ var stdin_default = defineComponent({
|
|
55
55
|
}
|
56
56
|
currentOffset.value = offset;
|
57
57
|
};
|
58
|
+
const isReadonly = () => props.readonly || !props.options.length;
|
58
59
|
const onClickOption = (index) => {
|
59
|
-
if (moving ||
|
60
|
+
if (moving || isReadonly()) {
|
60
61
|
return;
|
61
62
|
}
|
62
63
|
transitionEndTrigger = null;
|
@@ -81,7 +82,7 @@ var stdin_default = defineComponent({
|
|
81
82
|
}
|
82
83
|
};
|
83
84
|
const onTouchStart = (event) => {
|
84
|
-
if (
|
85
|
+
if (isReadonly()) {
|
85
86
|
return;
|
86
87
|
}
|
87
88
|
touch.start(event);
|
@@ -96,7 +97,7 @@ var stdin_default = defineComponent({
|
|
96
97
|
transitionEndTrigger = null;
|
97
98
|
};
|
98
99
|
const onTouchMove = (event) => {
|
99
|
-
if (
|
100
|
+
if (isReadonly()) {
|
100
101
|
return;
|
101
102
|
}
|
102
103
|
touch.move(event);
|
@@ -112,7 +113,7 @@ var stdin_default = defineComponent({
|
|
112
113
|
}
|
113
114
|
};
|
114
115
|
const onTouchEnd = () => {
|
115
|
-
if (
|
116
|
+
if (isReadonly()) {
|
116
117
|
return;
|
117
118
|
}
|
118
119
|
const distance = currentOffset.value - momentumOffset;
|
package/es/popover/Popover.mjs
CHANGED
@@ -3,10 +3,11 @@ import { ref, watch, nextTick, onMounted, watchEffect, onBeforeUnmount, defineCo
|
|
3
3
|
import { createPopper, offsetModifier } from "@vant/popperjs";
|
4
4
|
import { pick, extend, truthProp, numericProp, unknownProp, BORDER_BOTTOM, makeArrayProp, makeStringProp, createNamespace } from "../utils/index.mjs";
|
5
5
|
import { useClickAway } from "@vant/use";
|
6
|
+
import { useSyncPropRef } from "../composables/use-sync-prop-ref.mjs";
|
6
7
|
import { Icon } from "../icon/index.mjs";
|
7
8
|
import { Popup } from "../popup/index.mjs";
|
8
9
|
const [name, bem] = createNamespace("popover");
|
9
|
-
const popupProps = ["
|
10
|
+
const popupProps = ["overlay", "duration", "teleport", "overlayStyle", "overlayClass", "closeOnClickOverlay"];
|
10
11
|
const popoverProps = {
|
11
12
|
show: Boolean,
|
12
13
|
theme: makeStringProp("light"),
|
@@ -44,6 +45,7 @@ var stdin_default = defineComponent({
|
|
44
45
|
const popupRef = ref();
|
45
46
|
const wrapperRef = ref();
|
46
47
|
const popoverRef = ref();
|
48
|
+
const show = useSyncPropRef(() => props.show, (value) => emit("update:show", value));
|
47
49
|
const getPopoverOptions = () => ({
|
48
50
|
placement: props.placement,
|
49
51
|
modifiers: [{
|
@@ -66,7 +68,7 @@ var stdin_default = defineComponent({
|
|
66
68
|
};
|
67
69
|
const updateLocation = () => {
|
68
70
|
nextTick(() => {
|
69
|
-
if (!
|
71
|
+
if (!show.value) {
|
70
72
|
return;
|
71
73
|
}
|
72
74
|
if (!popper) {
|
@@ -76,10 +78,12 @@ var stdin_default = defineComponent({
|
|
76
78
|
}
|
77
79
|
});
|
78
80
|
};
|
79
|
-
const updateShow = (value) =>
|
81
|
+
const updateShow = (value) => {
|
82
|
+
show.value = value;
|
83
|
+
};
|
80
84
|
const onClickWrapper = () => {
|
81
85
|
if (props.trigger === "click") {
|
82
|
-
|
86
|
+
show.value = !show.value;
|
83
87
|
}
|
84
88
|
};
|
85
89
|
const onClickAction = (action, index) => {
|
@@ -88,12 +92,12 @@ var stdin_default = defineComponent({
|
|
88
92
|
}
|
89
93
|
emit("select", action, index);
|
90
94
|
if (props.closeOnClickAction) {
|
91
|
-
|
95
|
+
show.value = false;
|
92
96
|
}
|
93
97
|
};
|
94
98
|
const onClickAway = () => {
|
95
|
-
if (
|
96
|
-
|
99
|
+
if (show.value && props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
|
100
|
+
show.value = false;
|
97
101
|
}
|
98
102
|
};
|
99
103
|
const renderActionContent = (action, index) => {
|
@@ -145,7 +149,7 @@ var stdin_default = defineComponent({
|
|
145
149
|
popper = null;
|
146
150
|
}
|
147
151
|
});
|
148
|
-
watch(() => [
|
152
|
+
watch(() => [show.value, props.offset, props.placement], updateLocation);
|
149
153
|
useClickAway([wrapperRef, popupRef], onClickAway, {
|
150
154
|
eventName: "touchstart"
|
151
155
|
});
|
@@ -157,6 +161,7 @@ var stdin_default = defineComponent({
|
|
157
161
|
"onClick": onClickWrapper
|
158
162
|
}, [(_a = slots.reference) == null ? void 0 : _a.call(slots)]), _createVNode(Popup, _mergeProps({
|
159
163
|
"ref": popoverRef,
|
164
|
+
"show": show.value,
|
160
165
|
"class": bem([props.theme]),
|
161
166
|
"position": "",
|
162
167
|
"transition": "van-popover-zoom",
|
@@ -1,14 +1,20 @@
|
|
1
1
|
import { type PropType, type ExtractPropTypes } from 'vue';
|
2
2
|
import { type Numeric } from '../utils';
|
3
|
-
|
3
|
+
import type { SkeletonAvatarShape } from './types';
|
4
4
|
export declare const skeletonProps: {
|
5
5
|
row: {
|
6
6
|
type: (NumberConstructor | StringConstructor)[];
|
7
7
|
default: number;
|
8
8
|
};
|
9
|
-
title: BooleanConstructor;
|
10
9
|
round: BooleanConstructor;
|
10
|
+
title: BooleanConstructor;
|
11
|
+
titleWidth: (NumberConstructor | StringConstructor)[];
|
11
12
|
avatar: BooleanConstructor;
|
13
|
+
avatarSize: (NumberConstructor | StringConstructor)[];
|
14
|
+
avatarShape: {
|
15
|
+
type: PropType<SkeletonAvatarShape>;
|
16
|
+
default: SkeletonAvatarShape;
|
17
|
+
};
|
12
18
|
loading: {
|
13
19
|
type: BooleanConstructor;
|
14
20
|
default: true;
|
@@ -17,12 +23,6 @@ export declare const skeletonProps: {
|
|
17
23
|
type: BooleanConstructor;
|
18
24
|
default: true;
|
19
25
|
};
|
20
|
-
avatarSize: (NumberConstructor | StringConstructor)[];
|
21
|
-
titleWidth: (NumberConstructor | StringConstructor)[];
|
22
|
-
avatarShape: {
|
23
|
-
type: PropType<SkeletonAvatarShape>;
|
24
|
-
default: SkeletonAvatarShape;
|
25
|
-
};
|
26
26
|
rowWidth: {
|
27
27
|
type: PropType<Numeric | Numeric[]>;
|
28
28
|
default: string;
|
@@ -34,9 +34,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
34
34
|
type: (NumberConstructor | StringConstructor)[];
|
35
35
|
default: number;
|
36
36
|
};
|
37
|
-
title: BooleanConstructor;
|
38
37
|
round: BooleanConstructor;
|
38
|
+
title: BooleanConstructor;
|
39
|
+
titleWidth: (NumberConstructor | StringConstructor)[];
|
39
40
|
avatar: BooleanConstructor;
|
41
|
+
avatarSize: (NumberConstructor | StringConstructor)[];
|
42
|
+
avatarShape: {
|
43
|
+
type: PropType<SkeletonAvatarShape>;
|
44
|
+
default: SkeletonAvatarShape;
|
45
|
+
};
|
40
46
|
loading: {
|
41
47
|
type: BooleanConstructor;
|
42
48
|
default: true;
|
@@ -45,12 +51,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
45
51
|
type: BooleanConstructor;
|
46
52
|
default: true;
|
47
53
|
};
|
48
|
-
avatarSize: (NumberConstructor | StringConstructor)[];
|
49
|
-
titleWidth: (NumberConstructor | StringConstructor)[];
|
50
|
-
avatarShape: {
|
51
|
-
type: PropType<SkeletonAvatarShape>;
|
52
|
-
default: SkeletonAvatarShape;
|
53
|
-
};
|
54
54
|
rowWidth: {
|
55
55
|
type: PropType<Numeric | Numeric[]>;
|
56
56
|
default: string;
|
@@ -62,9 +62,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
62
62
|
type: (NumberConstructor | StringConstructor)[];
|
63
63
|
default: number;
|
64
64
|
};
|
65
|
-
title: BooleanConstructor;
|
66
65
|
round: BooleanConstructor;
|
66
|
+
title: BooleanConstructor;
|
67
|
+
titleWidth: (NumberConstructor | StringConstructor)[];
|
67
68
|
avatar: BooleanConstructor;
|
69
|
+
avatarSize: (NumberConstructor | StringConstructor)[];
|
70
|
+
avatarShape: {
|
71
|
+
type: PropType<SkeletonAvatarShape>;
|
72
|
+
default: SkeletonAvatarShape;
|
73
|
+
};
|
68
74
|
loading: {
|
69
75
|
type: BooleanConstructor;
|
70
76
|
default: true;
|
@@ -73,12 +79,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
73
79
|
type: BooleanConstructor;
|
74
80
|
default: true;
|
75
81
|
};
|
76
|
-
avatarSize: (NumberConstructor | StringConstructor)[];
|
77
|
-
titleWidth: (NumberConstructor | StringConstructor)[];
|
78
|
-
avatarShape: {
|
79
|
-
type: PropType<SkeletonAvatarShape>;
|
80
|
-
default: SkeletonAvatarShape;
|
81
|
-
};
|
82
82
|
rowWidth: {
|
83
83
|
type: PropType<Numeric | Numeric[]>;
|
84
84
|
default: string;
|
@@ -89,8 +89,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
89
89
|
round: boolean;
|
90
90
|
loading: boolean;
|
91
91
|
row: string | number;
|
92
|
-
avatar: boolean;
|
93
92
|
avatarShape: SkeletonAvatarShape;
|
94
93
|
rowWidth: Numeric | Numeric[];
|
94
|
+
avatar: boolean;
|
95
95
|
}>;
|
96
96
|
export default _default;
|
package/es/skeleton/Skeleton.mjs
CHANGED
@@ -1,19 +1,21 @@
|
|
1
|
-
import { mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
|
1
|
+
import { mergeProps as _mergeProps, Fragment as _Fragment, createVNode as _createVNode } from "vue";
|
2
2
|
import { defineComponent } from "vue";
|
3
|
-
import { addUnit, truthProp, numericProp,
|
3
|
+
import { addUnit, truthProp, numericProp, makeStringProp, makeNumericProp, createNamespace } from "../utils/index.mjs";
|
4
|
+
import SkeletonTitle from "./SkeletonTitle.mjs";
|
5
|
+
import SkeletonAvatar from "./SkeletonAvatar.mjs";
|
6
|
+
import SkeletonParagraph, { DEFAULT_ROW_WIDTH } from "./SkeletonParagraph.mjs";
|
4
7
|
const [name, bem] = createNamespace("skeleton");
|
5
|
-
const DEFAULT_ROW_WIDTH = "100%";
|
6
8
|
const DEFAULT_LAST_ROW_WIDTH = "60%";
|
7
9
|
const skeletonProps = {
|
8
10
|
row: makeNumericProp(0),
|
9
|
-
title: Boolean,
|
10
11
|
round: Boolean,
|
12
|
+
title: Boolean,
|
13
|
+
titleWidth: numericProp,
|
11
14
|
avatar: Boolean,
|
12
|
-
loading: truthProp,
|
13
|
-
animate: truthProp,
|
14
15
|
avatarSize: numericProp,
|
15
|
-
titleWidth: numericProp,
|
16
16
|
avatarShape: makeStringProp("round"),
|
17
|
+
loading: truthProp,
|
18
|
+
animate: truthProp,
|
17
19
|
rowWidth: {
|
18
20
|
type: [Number, String, Array],
|
19
21
|
default: DEFAULT_ROW_WIDTH
|
@@ -29,19 +31,17 @@ var stdin_default = defineComponent({
|
|
29
31
|
}) {
|
30
32
|
const renderAvatar = () => {
|
31
33
|
if (props.avatar) {
|
32
|
-
return _createVNode(
|
33
|
-
"
|
34
|
-
"
|
34
|
+
return _createVNode(SkeletonAvatar, {
|
35
|
+
"avatarShape": props.avatarShape,
|
36
|
+
"avatarSize": props.avatarSize
|
35
37
|
}, null);
|
36
38
|
}
|
37
39
|
};
|
38
40
|
const renderTitle = () => {
|
39
41
|
if (props.title) {
|
40
|
-
return _createVNode(
|
41
|
-
"
|
42
|
-
"
|
43
|
-
width: addUnit(props.titleWidth)
|
44
|
-
}
|
42
|
+
return _createVNode(SkeletonTitle, {
|
43
|
+
"round": props.round,
|
44
|
+
"titleWidth": props.titleWidth
|
45
45
|
}, null);
|
46
46
|
}
|
47
47
|
};
|
@@ -57,12 +57,19 @@ var stdin_default = defineComponent({
|
|
57
57
|
}
|
58
58
|
return rowWidth;
|
59
59
|
};
|
60
|
-
const renderRows = () => Array(+props.row).fill("").map((_, i) => _createVNode(
|
61
|
-
"
|
62
|
-
"
|
63
|
-
|
64
|
-
}
|
60
|
+
const renderRows = () => Array(+props.row).fill("").map((_, i) => _createVNode(SkeletonParagraph, {
|
61
|
+
"key": i,
|
62
|
+
"round": props.round,
|
63
|
+
"rowWidth": addUnit(getRowWidth(i))
|
65
64
|
}, null));
|
65
|
+
const renderContents = () => {
|
66
|
+
if (slots.template) {
|
67
|
+
return slots.template();
|
68
|
+
}
|
69
|
+
return _createVNode(_Fragment, null, [renderAvatar(), _createVNode("div", {
|
70
|
+
"class": bem("content")
|
71
|
+
}, [renderTitle(), renderRows()])]);
|
72
|
+
};
|
66
73
|
return () => {
|
67
74
|
var _a;
|
68
75
|
if (!props.loading) {
|
@@ -73,9 +80,7 @@ var stdin_default = defineComponent({
|
|
73
80
|
animate: props.animate,
|
74
81
|
round: props.round
|
75
82
|
})
|
76
|
-
}, attrs), [
|
77
|
-
"class": bem("content")
|
78
|
-
}, [renderTitle(), renderRows()])]);
|
83
|
+
}, attrs), [renderContents()]);
|
79
84
|
};
|
80
85
|
}
|
81
86
|
});
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
2
|
+
import type { SkeletonAvatarShape } from './types';
|
3
|
+
export declare const skeletonAvatarProps: {
|
4
|
+
avatarSize: (NumberConstructor | StringConstructor)[];
|
5
|
+
avatarShape: {
|
6
|
+
type: import("vue").PropType<SkeletonAvatarShape>;
|
7
|
+
default: SkeletonAvatarShape;
|
8
|
+
};
|
9
|
+
};
|
10
|
+
export declare type SkeletonAvatarProps = ExtractPropTypes<typeof skeletonAvatarProps>;
|
11
|
+
declare const _default: import("vue").DefineComponent<{
|
12
|
+
avatarSize: (NumberConstructor | StringConstructor)[];
|
13
|
+
avatarShape: {
|
14
|
+
type: import("vue").PropType<SkeletonAvatarShape>;
|
15
|
+
default: SkeletonAvatarShape;
|
16
|
+
};
|
17
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
18
|
+
avatarSize: (NumberConstructor | StringConstructor)[];
|
19
|
+
avatarShape: {
|
20
|
+
type: import("vue").PropType<SkeletonAvatarShape>;
|
21
|
+
default: SkeletonAvatarShape;
|
22
|
+
};
|
23
|
+
}>>, {
|
24
|
+
avatarShape: SkeletonAvatarShape;
|
25
|
+
}>;
|
26
|
+
export default _default;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { createVNode as _createVNode } from "vue";
|
2
|
+
import { defineComponent } from "vue";
|
3
|
+
import { numericProp, getSizeStyle, makeStringProp, createNamespace } from "../utils/index.mjs";
|
4
|
+
const [name, bem] = createNamespace("skeleton-avatar");
|
5
|
+
const skeletonAvatarProps = {
|
6
|
+
avatarSize: numericProp,
|
7
|
+
avatarShape: makeStringProp("round")
|
8
|
+
};
|
9
|
+
var stdin_default = defineComponent({
|
10
|
+
name,
|
11
|
+
props: skeletonAvatarProps,
|
12
|
+
setup(props) {
|
13
|
+
return () => _createVNode("div", {
|
14
|
+
"class": bem([props.avatarShape]),
|
15
|
+
"style": getSizeStyle(props.avatarSize)
|
16
|
+
}, null);
|
17
|
+
}
|
18
|
+
});
|
19
|
+
export {
|
20
|
+
stdin_default as default,
|
21
|
+
skeletonAvatarProps
|
22
|
+
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { type ExtractPropTypes } from 'vue';
|
2
|
+
import type { SkeletonImageShape } from './types';
|
3
|
+
export declare const skeletonImageProps: {
|
4
|
+
imageSize: (NumberConstructor | StringConstructor)[];
|
5
|
+
imageShape: {
|
6
|
+
type: import("vue").PropType<SkeletonImageShape>;
|
7
|
+
default: SkeletonImageShape;
|
8
|
+
};
|
9
|
+
};
|
10
|
+
export declare type SkeletonImageProps = ExtractPropTypes<typeof skeletonImageProps>;
|
11
|
+
declare const _default: import("vue").DefineComponent<{
|
12
|
+
imageSize: (NumberConstructor | StringConstructor)[];
|
13
|
+
imageShape: {
|
14
|
+
type: import("vue").PropType<SkeletonImageShape>;
|
15
|
+
default: SkeletonImageShape;
|
16
|
+
};
|
17
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
18
|
+
imageSize: (NumberConstructor | StringConstructor)[];
|
19
|
+
imageShape: {
|
20
|
+
type: import("vue").PropType<SkeletonImageShape>;
|
21
|
+
default: SkeletonImageShape;
|
22
|
+
};
|
23
|
+
}>>, {
|
24
|
+
imageShape: SkeletonImageShape;
|
25
|
+
}>;
|
26
|
+
export default _default;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { createVNode as _createVNode } from "vue";
|
2
|
+
import { defineComponent } from "vue";
|
3
|
+
import { numericProp, getSizeStyle, makeStringProp, createNamespace } from "../utils/index.mjs";
|
4
|
+
import { Icon } from "../icon/index.mjs";
|
5
|
+
const [name, bem] = createNamespace("skeleton-image");
|
6
|
+
const skeletonImageProps = {
|
7
|
+
imageSize: numericProp,
|
8
|
+
imageShape: makeStringProp("square")
|
9
|
+
};
|
10
|
+
var stdin_default = defineComponent({
|
11
|
+
name,
|
12
|
+
props: skeletonImageProps,
|
13
|
+
setup(props) {
|
14
|
+
return () => _createVNode("div", {
|
15
|
+
"class": bem([props.imageShape]),
|
16
|
+
"style": getSizeStyle(props.imageSize)
|
17
|
+
}, [_createVNode(Icon, {
|
18
|
+
"name": "photo",
|
19
|
+
"class": bem("icon")
|
20
|
+
}, null)]);
|
21
|
+
}
|
22
|
+
});
|
23
|
+
export {
|
24
|
+
stdin_default as default,
|
25
|
+
skeletonImageProps
|
26
|
+
};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
2
|
+
export declare const DEFAULT_ROW_WIDTH = "100%";
|
3
|
+
export declare const skeletonParagraphProps: {
|
4
|
+
round: BooleanConstructor;
|
5
|
+
rowWidth: {
|
6
|
+
type: (NumberConstructor | StringConstructor)[];
|
7
|
+
default: string;
|
8
|
+
};
|
9
|
+
};
|
10
|
+
export declare type SkeletonParagraphProps = ExtractPropTypes<typeof skeletonParagraphProps>;
|
11
|
+
declare const _default: import("vue").DefineComponent<{
|
12
|
+
round: BooleanConstructor;
|
13
|
+
rowWidth: {
|
14
|
+
type: (NumberConstructor | StringConstructor)[];
|
15
|
+
default: string;
|
16
|
+
};
|
17
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
18
|
+
round: BooleanConstructor;
|
19
|
+
rowWidth: {
|
20
|
+
type: (NumberConstructor | StringConstructor)[];
|
21
|
+
default: string;
|
22
|
+
};
|
23
|
+
}>>, {
|
24
|
+
round: boolean;
|
25
|
+
rowWidth: string | number;
|
26
|
+
}>;
|
27
|
+
export default _default;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { createVNode as _createVNode } from "vue";
|
2
|
+
import { defineComponent } from "vue";
|
3
|
+
import { createNamespace, numericProp } from "../utils/index.mjs";
|
4
|
+
const DEFAULT_ROW_WIDTH = "100%";
|
5
|
+
const skeletonParagraphProps = {
|
6
|
+
round: Boolean,
|
7
|
+
rowWidth: {
|
8
|
+
type: numericProp,
|
9
|
+
default: DEFAULT_ROW_WIDTH
|
10
|
+
}
|
11
|
+
};
|
12
|
+
const [name, bem] = createNamespace("skeleton-paragraph");
|
13
|
+
var stdin_default = defineComponent({
|
14
|
+
name,
|
15
|
+
props: skeletonParagraphProps,
|
16
|
+
setup(props) {
|
17
|
+
return () => _createVNode("div", {
|
18
|
+
"class": bem([{
|
19
|
+
round: props.round
|
20
|
+
}]),
|
21
|
+
"style": {
|
22
|
+
width: props.rowWidth
|
23
|
+
}
|
24
|
+
}, null);
|
25
|
+
}
|
26
|
+
});
|
27
|
+
export {
|
28
|
+
DEFAULT_ROW_WIDTH,
|
29
|
+
stdin_default as default,
|
30
|
+
skeletonParagraphProps
|
31
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { type ExtractPropTypes } from 'vue';
|
2
|
+
export declare const skeletonTitleProps: {
|
3
|
+
round: BooleanConstructor;
|
4
|
+
titleWidth: (NumberConstructor | StringConstructor)[];
|
5
|
+
};
|
6
|
+
export declare type SkeletonTitleProps = ExtractPropTypes<typeof skeletonTitleProps>;
|
7
|
+
declare const _default: import("vue").DefineComponent<{
|
8
|
+
round: BooleanConstructor;
|
9
|
+
titleWidth: (NumberConstructor | StringConstructor)[];
|
10
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
11
|
+
round: BooleanConstructor;
|
12
|
+
titleWidth: (NumberConstructor | StringConstructor)[];
|
13
|
+
}>>, {
|
14
|
+
round: boolean;
|
15
|
+
}>;
|
16
|
+
export default _default;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { createVNode as _createVNode } from "vue";
|
2
|
+
import { defineComponent } from "vue";
|
3
|
+
import { createNamespace, numericProp, addUnit } from "../utils/index.mjs";
|
4
|
+
const [name, bem] = createNamespace("skeleton-title");
|
5
|
+
const skeletonTitleProps = {
|
6
|
+
round: Boolean,
|
7
|
+
titleWidth: numericProp
|
8
|
+
};
|
9
|
+
var stdin_default = defineComponent({
|
10
|
+
name,
|
11
|
+
props: skeletonTitleProps,
|
12
|
+
setup(props) {
|
13
|
+
return () => _createVNode("h3", {
|
14
|
+
"class": bem([{
|
15
|
+
round: props.round
|
16
|
+
}]),
|
17
|
+
"style": {
|
18
|
+
width: addUnit(props.titleWidth)
|
19
|
+
}
|
20
|
+
}, null);
|
21
|
+
}
|
22
|
+
});
|
23
|
+
export {
|
24
|
+
stdin_default as default,
|
25
|
+
skeletonTitleProps
|
26
|
+
};
|
package/es/skeleton/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:root{--van-skeleton-
|
1
|
+
:root{--van-skeleton-paragraph-height: 16px;--van-skeleton-paragraph-background: var(--van-active-color);--van-skeleton-paragraph-margin-top: var(--van-padding-sm);--van-skeleton-title-width: 40%;--van-skeleton-avatar-size: 32px;--van-skeleton-avatar-background: var(--van-active-color);--van-skeleton-image-size: 96px;--van-skeleton-image-radius: 24px;--van-skeleton-duration: 1.2s}.van-skeleton{display:flex;padding:0 var(--van-padding-md)}.van-skeleton-avatar{flex-shrink:0;width:var(--van-skeleton-avatar-size);height:var(--van-skeleton-avatar-size);margin-right:var(--van-padding-md);background:var(--van-skeleton-avatar-background)}.van-skeleton-avatar--round{border-radius:var(--van-radius-max)}.van-skeleton__content{width:100%}.van-skeleton-avatar+.van-skeleton__content{padding-top:var(--van-padding-xs)}.van-skeleton-paragraph,.van-skeleton-title{height:var(--van-skeleton-paragraph-height);background:var(--van-skeleton-paragraph-background)}.van-skeleton-paragraph--round,.van-skeleton-title--round{border-radius:var(--van-radius-max)}.van-skeleton-title{width:var(--van-skeleton-title-width);margin:0}.van-skeleton-paragraph:not(:first-child){margin-top:var(--van-skeleton-paragraph-margin-top)}.van-skeleton-title+.van-skeleton-paragraph{margin-top:20px}.van-skeleton--animate{animation:van-skeleton-blink var(--van-skeleton-duration) ease-in-out infinite}.van-skeleton-image{display:flex;width:var(--van-skeleton-image-size);height:var(--van-skeleton-image-size);align-items:center;justify-content:center;background:var(--van-active-color)}.van-skeleton-image--round{border-radius:var(--van-skeleton-image-radius)}.van-skeleton-image__icon{width:calc(var(--van-skeleton-image-size) / 2);height:calc(var(--van-skeleton-image-size) / 2);font-size:calc(var(--van-skeleton-image-size) / 2);color:var(--van-gray-5)}@keyframes van-skeleton-blink{50%{opacity:.6}}
|