vant 4.4.1 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/address-list/AddressList.d.ts +13 -0
- package/es/address-list/AddressList.mjs +4 -2
- package/es/address-list/AddressListItem.d.ts +9 -0
- package/es/address-list/AddressListItem.mjs +4 -3
- package/es/address-list/index.d.ts +9 -0
- package/es/back-top/BackTop.mjs +14 -1
- package/es/barrage/index.d.ts +1 -1
- package/es/barrage/types.d.ts +6 -0
- package/es/composables/use-touch.d.ts +1 -0
- package/es/composables/use-touch.mjs +8 -1
- package/es/config-provider/types.d.ts +1 -1
- package/es/date-picker/DatePicker.d.ts +3 -3
- package/es/date-picker/index.d.ts +2 -2
- package/es/date-picker/utils.d.ts +4 -2
- package/es/date-picker/utils.mjs +8 -3
- package/es/dropdown-menu/DropdownMenu.mjs +10 -3
- package/es/dropdown-menu/index.d.ts +1 -1
- package/es/dropdown-menu/types.d.ts +5 -1
- package/es/field/Field.mjs +1 -1
- package/es/floating-bubble/FloatingBubble.d.ts +86 -0
- package/es/floating-bubble/FloatingBubble.mjs +177 -0
- package/es/floating-bubble/index.css +1 -0
- package/es/floating-bubble/index.d.ts +63 -0
- package/es/floating-bubble/index.mjs +10 -0
- package/es/floating-bubble/style/index.d.ts +1 -0
- package/es/floating-bubble/style/index.mjs +4 -0
- package/es/floating-bubble/types.d.ts +8 -0
- package/es/floating-bubble/types.mjs +0 -0
- package/es/floating-panel/FloatingPanel.d.ts +77 -0
- package/es/floating-panel/FloatingPanel.mjs +127 -0
- package/es/floating-panel/index.css +1 -0
- package/es/floating-panel/index.d.ts +61 -0
- package/es/floating-panel/index.mjs +10 -0
- package/es/floating-panel/style/index.d.ts +1 -0
- package/es/floating-panel/style/index.mjs +2 -0
- package/es/floating-panel/types.d.ts +9 -0
- package/es/floating-panel/types.mjs +0 -0
- package/es/image-preview/ImagePreviewItem.mjs +1 -2
- package/es/index.d.ts +4 -1
- package/es/index.mjs +10 -1
- package/es/picker/PickerColumn.mjs +7 -2
- package/es/rate/Rate.d.ts +4 -0
- package/es/rate/Rate.mjs +16 -10
- package/es/rate/index.css +1 -1
- package/es/rate/index.d.ts +3 -0
- package/es/rolling-text/RollingText.d.ts +104 -0
- package/es/rolling-text/RollingText.mjs +98 -0
- package/es/rolling-text/RollingTextItem.d.ts +67 -0
- package/es/rolling-text/RollingTextItem.mjs +47 -0
- package/es/rolling-text/index.css +1 -0
- package/es/rolling-text/index.d.ts +79 -0
- package/es/rolling-text/index.mjs +10 -0
- package/es/rolling-text/style/index.d.ts +1 -0
- package/es/rolling-text/style/index.mjs +2 -0
- package/es/rolling-text/types.d.ts +17 -0
- package/es/rolling-text/types.mjs +0 -0
- package/es/signature/index.d.ts +1 -0
- package/es/signature/types.d.ts +6 -0
- package/es/signature/types.mjs +0 -0
- package/es/slider/Slider.d.ts +1 -1
- package/es/slider/Slider.mjs +10 -2
- package/es/slider/index.d.ts +1 -1
- package/es/stepper/Stepper.d.ts +1 -1
- package/es/stepper/index.d.ts +1 -1
- package/es/time-picker/TimePicker.d.ts +31 -4
- package/es/time-picker/TimePicker.mjs +73 -21
- package/es/time-picker/index.d.ts +20 -2
- package/es/utils/basic.d.ts +3 -0
- package/es/utils/closest.d.ts +1 -0
- package/es/utils/closest.mjs +8 -0
- package/es/utils/constant.d.ts +1 -0
- package/es/utils/constant.mjs +3 -1
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.mjs +1 -0
- package/es/watermark/index.d.ts +1 -0
- package/es/watermark/types.d.ts +3 -0
- package/es/watermark/types.mjs +0 -0
- package/lib/address-list/AddressList.d.ts +13 -0
- package/lib/address-list/AddressList.js +3 -1
- package/lib/address-list/AddressListItem.d.ts +9 -0
- package/lib/address-list/AddressListItem.js +3 -2
- package/lib/address-list/index.d.ts +9 -0
- package/lib/back-top/BackTop.js +13 -0
- package/lib/barrage/index.d.ts +1 -1
- package/lib/barrage/types.d.ts +6 -0
- package/lib/composables/use-touch.d.ts +1 -0
- package/lib/composables/use-touch.js +8 -1
- package/lib/config-provider/types.d.ts +1 -1
- package/lib/date-picker/DatePicker.d.ts +3 -3
- package/lib/date-picker/index.d.ts +2 -2
- package/lib/date-picker/utils.d.ts +4 -2
- package/lib/date-picker/utils.js +2 -2
- package/lib/dropdown-menu/DropdownMenu.js +10 -3
- package/lib/dropdown-menu/index.d.ts +1 -1
- package/lib/dropdown-menu/types.d.ts +5 -1
- package/lib/field/Field.js +1 -1
- package/lib/floating-bubble/FloatingBubble.d.ts +86 -0
- package/lib/floating-bubble/FloatingBubble.js +206 -0
- package/lib/floating-bubble/index.css +1 -0
- package/lib/floating-bubble/index.d.ts +63 -0
- package/lib/floating-bubble/index.js +39 -0
- package/lib/floating-bubble/style/index.d.ts +1 -0
- package/lib/floating-bubble/style/index.js +4 -0
- package/lib/floating-bubble/types.d.ts +8 -0
- package/lib/floating-bubble/types.js +15 -0
- package/lib/floating-panel/FloatingPanel.d.ts +77 -0
- package/lib/floating-panel/FloatingPanel.js +146 -0
- package/lib/floating-panel/index.css +1 -0
- package/lib/floating-panel/index.d.ts +61 -0
- package/lib/floating-panel/index.js +39 -0
- package/lib/floating-panel/style/index.d.ts +1 -0
- package/lib/floating-panel/style/index.js +2 -0
- package/lib/floating-panel/types.d.ts +9 -0
- package/lib/floating-panel/types.js +15 -0
- package/lib/image-preview/ImagePreviewItem.js +1 -2
- package/lib/index.css +1 -1
- package/lib/index.d.ts +4 -1
- package/lib/index.js +10 -1
- package/lib/picker/PickerColumn.js +7 -2
- package/lib/rate/Rate.d.ts +4 -0
- package/lib/rate/Rate.js +16 -10
- package/lib/rate/index.css +1 -1
- package/lib/rate/index.d.ts +3 -0
- package/lib/rolling-text/RollingText.d.ts +104 -0
- package/lib/rolling-text/RollingText.js +127 -0
- package/lib/rolling-text/RollingTextItem.d.ts +67 -0
- package/lib/rolling-text/RollingTextItem.js +66 -0
- package/lib/rolling-text/index.css +1 -0
- package/lib/rolling-text/index.d.ts +79 -0
- package/lib/rolling-text/index.js +39 -0
- package/lib/rolling-text/style/index.d.ts +1 -0
- package/lib/rolling-text/style/index.js +2 -0
- package/lib/rolling-text/types.d.ts +17 -0
- package/lib/rolling-text/types.js +15 -0
- package/lib/signature/index.d.ts +1 -0
- package/lib/signature/types.d.ts +6 -0
- package/lib/signature/types.js +15 -0
- package/lib/slider/Slider.d.ts +1 -1
- package/lib/slider/Slider.js +10 -2
- package/lib/slider/index.d.ts +1 -1
- package/lib/stepper/Stepper.d.ts +1 -1
- package/lib/stepper/index.d.ts +1 -1
- package/lib/time-picker/TimePicker.d.ts +31 -4
- package/lib/time-picker/TimePicker.js +84 -32
- package/lib/time-picker/index.d.ts +20 -2
- package/lib/utils/basic.d.ts +3 -0
- package/lib/utils/closest.d.ts +1 -0
- package/lib/utils/closest.js +27 -0
- package/lib/utils/constant.d.ts +1 -0
- package/lib/utils/constant.js +3 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/vant.cjs.js +2547 -2019
- package/lib/vant.es.js +2547 -2019
- package/lib/vant.js +2544 -2016
- package/lib/vant.min.js +1 -1
- package/lib/watermark/index.d.ts +1 -0
- package/lib/watermark/types.d.ts +3 -0
- package/lib/watermark/types.js +15 -0
- package/lib/web-types.json +1 -1
- package/package.json +1 -1
@@ -17,6 +17,10 @@ export declare const addressListProps: {
|
|
17
17
|
};
|
18
18
|
addButtonText: StringConstructor;
|
19
19
|
defaultTagText: StringConstructor;
|
20
|
+
rightIcon: {
|
21
|
+
type: import("vue").PropType<string>;
|
22
|
+
default: string;
|
23
|
+
};
|
20
24
|
};
|
21
25
|
export type AddressListProps = ExtractPropTypes<typeof addressListProps>;
|
22
26
|
declare const _default: import("vue").DefineComponent<{
|
@@ -36,6 +40,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
36
40
|
};
|
37
41
|
addButtonText: StringConstructor;
|
38
42
|
defaultTagText: StringConstructor;
|
43
|
+
rightIcon: {
|
44
|
+
type: import("vue").PropType<string>;
|
45
|
+
default: string;
|
46
|
+
};
|
39
47
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:modelValue" | "add" | "edit" | "clickItem" | "editDisabled" | "selectDisabled")[], "select" | "update:modelValue" | "add" | "edit" | "clickItem" | "editDisabled" | "selectDisabled", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
40
48
|
list: {
|
41
49
|
type: import("vue").PropType<AddressListAddress[]>;
|
@@ -53,6 +61,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
53
61
|
};
|
54
62
|
addButtonText: StringConstructor;
|
55
63
|
defaultTagText: StringConstructor;
|
64
|
+
rightIcon: {
|
65
|
+
type: import("vue").PropType<string>;
|
66
|
+
default: string;
|
67
|
+
};
|
56
68
|
}>> & {
|
57
69
|
onSelect?: ((...args: any[]) => any) | undefined;
|
58
70
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
@@ -62,6 +74,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
62
74
|
onEditDisabled?: ((...args: any[]) => any) | undefined;
|
63
75
|
onSelectDisabled?: ((...args: any[]) => any) | undefined;
|
64
76
|
}, {
|
77
|
+
rightIcon: string;
|
65
78
|
switchable: boolean;
|
66
79
|
list: AddressListAddress[];
|
67
80
|
disabledList: AddressListAddress[];
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
2
2
|
import { defineComponent } from "vue";
|
3
|
-
import { truthProp, numericProp, makeArrayProp, createNamespace } from "../utils/index.mjs";
|
3
|
+
import { truthProp, numericProp, makeArrayProp, createNamespace, makeStringProp } from "../utils/index.mjs";
|
4
4
|
import { Button } from "../button/index.mjs";
|
5
5
|
import { RadioGroup } from "../radio-group/index.mjs";
|
6
6
|
import AddressListItem from "./AddressListItem.mjs";
|
@@ -12,7 +12,8 @@ const addressListProps = {
|
|
12
12
|
disabledText: String,
|
13
13
|
disabledList: makeArrayProp(),
|
14
14
|
addButtonText: String,
|
15
|
-
defaultTagText: String
|
15
|
+
defaultTagText: String,
|
16
|
+
rightIcon: makeStringProp("edit")
|
16
17
|
};
|
17
18
|
var stdin_default = defineComponent({
|
18
19
|
name,
|
@@ -37,6 +38,7 @@ var stdin_default = defineComponent({
|
|
37
38
|
"disabled": disabled,
|
38
39
|
"switchable": props.switchable,
|
39
40
|
"defaultTagText": props.defaultTagText,
|
41
|
+
"rightIcon": props.rightIcon,
|
40
42
|
"onEdit": onEdit,
|
41
43
|
"onClick": onClick,
|
42
44
|
"onSelect": onSelect
|
@@ -15,6 +15,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
15
15
|
disabled: BooleanConstructor;
|
16
16
|
switchable: BooleanConstructor;
|
17
17
|
defaultTagText: StringConstructor;
|
18
|
+
rightIcon: {
|
19
|
+
type: PropType<string>;
|
20
|
+
default: string;
|
21
|
+
};
|
18
22
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "click" | "edit")[], "select" | "click" | "edit", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
19
23
|
address: {
|
20
24
|
type: PropType<AddressListAddress>;
|
@@ -23,12 +27,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
23
27
|
disabled: BooleanConstructor;
|
24
28
|
switchable: BooleanConstructor;
|
25
29
|
defaultTagText: StringConstructor;
|
30
|
+
rightIcon: {
|
31
|
+
type: PropType<string>;
|
32
|
+
default: string;
|
33
|
+
};
|
26
34
|
}>> & {
|
27
35
|
onClick?: ((...args: any[]) => any) | undefined;
|
28
36
|
onSelect?: ((...args: any[]) => any) | undefined;
|
29
37
|
onEdit?: ((...args: any[]) => any) | undefined;
|
30
38
|
}, {
|
31
39
|
disabled: boolean;
|
40
|
+
rightIcon: string;
|
32
41
|
switchable: boolean;
|
33
42
|
}, {}>;
|
34
43
|
export default _default;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
2
2
|
import { defineComponent } from "vue";
|
3
|
-
import { extend, createNamespace, makeRequiredProp } from "../utils/index.mjs";
|
3
|
+
import { extend, createNamespace, makeRequiredProp, makeStringProp } from "../utils/index.mjs";
|
4
4
|
import { Tag } from "../tag/index.mjs";
|
5
5
|
import { Icon } from "../icon/index.mjs";
|
6
6
|
import { Cell } from "../cell/index.mjs";
|
@@ -12,7 +12,8 @@ var stdin_default = defineComponent({
|
|
12
12
|
address: makeRequiredProp(Object),
|
13
13
|
disabled: Boolean,
|
14
14
|
switchable: Boolean,
|
15
|
-
defaultTagText: String
|
15
|
+
defaultTagText: String,
|
16
|
+
rightIcon: makeStringProp("edit")
|
16
17
|
},
|
17
18
|
emits: ["edit", "click", "select"],
|
18
19
|
setup(props, {
|
@@ -26,7 +27,7 @@ var stdin_default = defineComponent({
|
|
26
27
|
emit("click");
|
27
28
|
};
|
28
29
|
const renderRightIcon = () => _createVNode(Icon, {
|
29
|
-
"name":
|
30
|
+
"name": props.rightIcon,
|
30
31
|
"class": bem("edit"),
|
31
32
|
"onClick": (event) => {
|
32
33
|
event.stopPropagation();
|
@@ -15,6 +15,10 @@ export declare const AddressList: import("../utils").WithInstall<import("vue").D
|
|
15
15
|
};
|
16
16
|
addButtonText: StringConstructor;
|
17
17
|
defaultTagText: StringConstructor;
|
18
|
+
rightIcon: {
|
19
|
+
type: import("vue").PropType<string>;
|
20
|
+
default: string;
|
21
|
+
};
|
18
22
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:modelValue" | "add" | "edit" | "clickItem" | "editDisabled" | "selectDisabled")[], "select" | "update:modelValue" | "add" | "edit" | "clickItem" | "editDisabled" | "selectDisabled", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
19
23
|
list: {
|
20
24
|
type: import("vue").PropType<import("./AddressListItem").AddressListAddress[]>;
|
@@ -32,6 +36,10 @@ export declare const AddressList: import("../utils").WithInstall<import("vue").D
|
|
32
36
|
};
|
33
37
|
addButtonText: StringConstructor;
|
34
38
|
defaultTagText: StringConstructor;
|
39
|
+
rightIcon: {
|
40
|
+
type: import("vue").PropType<string>;
|
41
|
+
default: string;
|
42
|
+
};
|
35
43
|
}>> & {
|
36
44
|
onSelect?: ((...args: any[]) => any) | undefined;
|
37
45
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
@@ -41,6 +49,7 @@ export declare const AddressList: import("../utils").WithInstall<import("vue").D
|
|
41
49
|
onEditDisabled?: ((...args: any[]) => any) | undefined;
|
42
50
|
onSelectDisabled?: ((...args: any[]) => any) | undefined;
|
43
51
|
}, {
|
52
|
+
rightIcon: string;
|
44
53
|
switchable: boolean;
|
45
54
|
list: import("./AddressListItem").AddressListAddress[];
|
46
55
|
disabledList: import("./AddressListItem").AddressListAddress[];
|
package/es/back-top/BackTop.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
|
2
|
-
import { ref, watch, computed, Teleport, nextTick, onMounted, defineComponent } from "vue";
|
2
|
+
import { ref, watch, computed, Teleport, nextTick, onMounted, defineComponent, onDeactivated, onActivated } from "vue";
|
3
3
|
import { extend, addUnit, inBrowser, numericProp, getScrollTop, getZIndexStyle, createNamespace, makeNumericProp } from "../utils/index.mjs";
|
4
4
|
import { throttle } from "../lazyload/vue-lazyload/util.mjs";
|
5
5
|
import { useEventListener, getScrollParent } from "@vant/use";
|
@@ -27,6 +27,7 @@ var stdin_default = defineComponent({
|
|
27
27
|
slots,
|
28
28
|
attrs
|
29
29
|
}) {
|
30
|
+
let shouldReshow = false;
|
30
31
|
const show = ref(false);
|
31
32
|
const root = ref();
|
32
33
|
const scrollParent = ref();
|
@@ -73,6 +74,18 @@ var stdin_default = defineComponent({
|
|
73
74
|
target: scrollParent
|
74
75
|
});
|
75
76
|
onMounted(updateTarget);
|
77
|
+
onActivated(() => {
|
78
|
+
if (shouldReshow) {
|
79
|
+
show.value = true;
|
80
|
+
shouldReshow = false;
|
81
|
+
}
|
82
|
+
});
|
83
|
+
onDeactivated(() => {
|
84
|
+
if (show.value && props.teleport) {
|
85
|
+
show.value = false;
|
86
|
+
shouldReshow = true;
|
87
|
+
}
|
88
|
+
});
|
76
89
|
watch(() => props.target, updateTarget);
|
77
90
|
return () => {
|
78
91
|
const Content = _createVNode("div", _mergeProps({
|
package/es/barrage/index.d.ts
CHANGED
@@ -61,7 +61,7 @@ export declare const Barrage: import("../utils").WithInstall<import("vue").Defin
|
|
61
61
|
export default Barrage;
|
62
62
|
export { barrageProps } from './Barrage';
|
63
63
|
export type { BarrageProps, BarrageItem } from './Barrage';
|
64
|
-
export type { BarrageInstance } from './types';
|
64
|
+
export type { BarrageInstance, BarrageThemeVars } from './types';
|
65
65
|
declare module 'vue' {
|
66
66
|
interface GlobalComponents {
|
67
67
|
VanBarrage: typeof Barrage;
|
package/es/barrage/types.d.ts
CHANGED
@@ -5,3 +5,9 @@ export type BarrageExpose = {
|
|
5
5
|
pause(): void;
|
6
6
|
};
|
7
7
|
export type BarrageInstance = ComponentPublicInstance<BarrageProps, BarrageExpose>;
|
8
|
+
export type BarrageThemeVars = {
|
9
|
+
barrageFontSize?: string;
|
10
|
+
barrageSpace?: string;
|
11
|
+
barrageFont?: string;
|
12
|
+
barrageColor?: string;
|
13
|
+
};
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { ref } from "vue";
|
2
|
+
import { TAP_OFFSET } from "../utils/index.mjs";
|
2
3
|
function getDirection(x, y) {
|
3
4
|
if (x > y) {
|
4
5
|
return "horizontal";
|
@@ -16,6 +17,7 @@ function useTouch() {
|
|
16
17
|
const offsetX = ref(0);
|
17
18
|
const offsetY = ref(0);
|
18
19
|
const direction = ref("");
|
20
|
+
const isTap = ref(true);
|
19
21
|
const isVertical = () => direction.value === "vertical";
|
20
22
|
const isHorizontal = () => direction.value === "horizontal";
|
21
23
|
const reset = () => {
|
@@ -24,6 +26,7 @@ function useTouch() {
|
|
24
26
|
offsetX.value = 0;
|
25
27
|
offsetY.value = 0;
|
26
28
|
direction.value = "";
|
29
|
+
isTap.value = true;
|
27
30
|
};
|
28
31
|
const start = (event) => {
|
29
32
|
reset();
|
@@ -40,6 +43,9 @@ function useTouch() {
|
|
40
43
|
if (!direction.value || offsetX.value < LOCK_DIRECTION_DISTANCE && offsetY.value < LOCK_DIRECTION_DISTANCE) {
|
41
44
|
direction.value = getDirection(offsetX.value, offsetY.value);
|
42
45
|
}
|
46
|
+
if (isTap.value && (offsetX.value > TAP_OFFSET || offsetY.value > TAP_OFFSET)) {
|
47
|
+
isTap.value = false;
|
48
|
+
}
|
43
49
|
};
|
44
50
|
return {
|
45
51
|
move,
|
@@ -53,7 +59,8 @@ function useTouch() {
|
|
53
59
|
offsetY,
|
54
60
|
direction,
|
55
61
|
isVertical,
|
56
|
-
isHorizontal
|
62
|
+
isHorizontal,
|
63
|
+
isTap
|
57
64
|
};
|
58
65
|
}
|
59
66
|
export {
|
@@ -1 +1 @@
|
|
1
|
-
export type ConfigProviderThemeVars = import('../action-bar').ActionBarThemeVars & import('../action-bar-button').ActionBarButtonThemeVars & import('../action-bar-icon').ActionBarIconThemeVars & import('../action-sheet').ActionSheetThemeVars & import('../address-edit').AddressEditThemeVars & import('../address-list').AddressListThemeVars & import('../badge').BadgeThemeVars & import('../button').ButtonThemeVars & import('../calendar').CalendarThemeVars & import('../card').CardThemeVars & import('../cascader').CascaderThemeVars & import('../cell').CellThemeVars & import('../cell-group').CellGroupThemeVars & import('../checkbox').CheckboxThemeVars & import('../circle').CircleThemeVars & import('../collapse-item').CollapseItemThemeVars & import('../contact-card').ContactCardThemeVars & import('../contact-edit').ContactEditThemeVars & import('../contact-list').ContactListThemeVars & import('../count-down').CountDownThemeVars & import('../coupon').CouponThemeVars & import('../coupon-cell').CouponCellThemeVars & import('../coupon-list').CouponListThemeVars & import('../dialog').DialogThemeVars & import('../divider').DividerThemeVars & import('../dropdown-item').DropdownItemThemeVars & import('../dropdown-menu').DropdownMenuThemeVars & import('../empty').EmptyThemeVars & import('../field').FieldThemeVars & import('../grid-item').GridItemThemeVars & import('../image').ImageThemeVars & import('../image-preview').ImagePreviewThemeVars & import('../index-anchor').IndexAnchorThemeVars & import('../index-bar').IndexBarThemeVars & import('../list').ListThemeVars & import('../loading').LoadingThemeVars & import('../nav-bar').NavBarThemeVars & import('../notice-bar').NoticeBarThemeVars & import('../notify').NotifyThemeVars & import('../number-keyboard').NumberKeyboardThemeVars & import('../overlay').OverlayThemeVars & import('../pagination').PaginationThemeVars & import('../password-input').PasswordInputThemeVars & import('../picker').PickerThemeVars & import('../picker-group').PickerGroupThemeVars & import('../popover').PopoverThemeVars & import('../popup').PopupThemeVars & import('../progress').ProgressThemeVars & import('../pull-refresh').PullRefreshThemeVars & import('../radio').RadioThemeVars & import('../rate').RateThemeVars & import('../search').SearchThemeVars & import('../share-sheet').ShareSheetThemeVars & import('../sidebar').SidebarThemeVars & import('../sidebar-item').SidebarItemThemeVars & import('../skeleton').SkeletonThemeVars & import('../slider').SliderThemeVars & import('../step').StepThemeVars & import('../stepper').StepperThemeVars & import('../steps').StepsThemeVars & import('../sticky').StickyThemeVars & import('../submit-bar').SubmitBarThemeVars & import('../swipe').SwipeThemeVars & import('../switch').SwitchThemeVars & import('../tabbar').TabbarThemeVars & import('../tabbar-item').TabbarItemThemeVars & import('../tabs').TabsThemeVars & import('../tag').TagThemeVars & import('../toast').ToastThemeVars & import('../tree-select').TreeSelectThemeVars & import('../uploader').UploaderThemeVars;
|
1
|
+
export type ConfigProviderThemeVars = import('../action-bar').ActionBarThemeVars & import('../action-bar-button').ActionBarButtonThemeVars & import('../action-bar-icon').ActionBarIconThemeVars & import('../action-sheet').ActionSheetThemeVars & import('../address-edit').AddressEditThemeVars & import('../address-list').AddressListThemeVars & import('../badge').BadgeThemeVars & import('../barrage').BarrageThemeVars & import('../button').ButtonThemeVars & import('../calendar').CalendarThemeVars & import('../card').CardThemeVars & import('../cascader').CascaderThemeVars & import('../cell').CellThemeVars & import('../cell-group').CellGroupThemeVars & import('../checkbox').CheckboxThemeVars & import('../circle').CircleThemeVars & import('../collapse-item').CollapseItemThemeVars & import('../contact-card').ContactCardThemeVars & import('../contact-edit').ContactEditThemeVars & import('../contact-list').ContactListThemeVars & import('../count-down').CountDownThemeVars & import('../coupon').CouponThemeVars & import('../coupon-cell').CouponCellThemeVars & import('../coupon-list').CouponListThemeVars & import('../dialog').DialogThemeVars & import('../divider').DividerThemeVars & import('../dropdown-item').DropdownItemThemeVars & import('../dropdown-menu').DropdownMenuThemeVars & import('../empty').EmptyThemeVars & import('../field').FieldThemeVars & import('../floating-bubble').FloatingBubbleThemeVars & import('../floating-panel').FloatingPanelThemeVars & import('../grid-item').GridItemThemeVars & import('../image').ImageThemeVars & import('../image-preview').ImagePreviewThemeVars & import('../index-anchor').IndexAnchorThemeVars & import('../index-bar').IndexBarThemeVars & import('../list').ListThemeVars & import('../loading').LoadingThemeVars & import('../nav-bar').NavBarThemeVars & import('../notice-bar').NoticeBarThemeVars & import('../notify').NotifyThemeVars & import('../number-keyboard').NumberKeyboardThemeVars & import('../overlay').OverlayThemeVars & import('../pagination').PaginationThemeVars & import('../password-input').PasswordInputThemeVars & import('../picker').PickerThemeVars & import('../picker-group').PickerGroupThemeVars & import('../popover').PopoverThemeVars & import('../popup').PopupThemeVars & import('../progress').ProgressThemeVars & import('../pull-refresh').PullRefreshThemeVars & import('../radio').RadioThemeVars & import('../rate').RateThemeVars & import('../rolling-text').RollingTextThemeVars & import('../search').SearchThemeVars & import('../share-sheet').ShareSheetThemeVars & import('../sidebar').SidebarThemeVars & import('../sidebar-item').SidebarItemThemeVars & import('../signature').SignatureThemeVars & import('../skeleton').SkeletonThemeVars & import('../slider').SliderThemeVars & import('../step').StepThemeVars & import('../stepper').StepperThemeVars & import('../steps').StepsThemeVars & import('../sticky').StickyThemeVars & import('../submit-bar').SubmitBarThemeVars & import('../swipe').SwipeThemeVars & import('../switch').SwitchThemeVars & import('../tabbar').TabbarThemeVars & import('../tabbar-item').TabbarItemThemeVars & import('../tabs').TabsThemeVars & import('../tag').TagThemeVars & import('../toast').ToastThemeVars & import('../tree-select').TreeSelectThemeVars & import('../uploader').UploaderThemeVars & import('../watermark').WatermarkThemeVars;
|
@@ -29,7 +29,7 @@ export declare const datePickerProps: {
|
|
29
29
|
type: PropType<string[]>;
|
30
30
|
default: () => never[];
|
31
31
|
};
|
32
|
-
filter: PropType<(columnType: string, options: import("../picker").PickerOption[]) => import("../picker").PickerOption[]>;
|
32
|
+
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values?: string[] | undefined) => import("../picker").PickerOption[]>;
|
33
33
|
formatter: {
|
34
34
|
type: PropType<(type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption>;
|
35
35
|
default: (type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption;
|
@@ -80,7 +80,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
80
80
|
type: PropType<string[]>;
|
81
81
|
default: () => never[];
|
82
82
|
};
|
83
|
-
filter: PropType<(columnType: string, options: import("../picker").PickerOption[]) => import("../picker").PickerOption[]>;
|
83
|
+
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values?: string[] | undefined) => import("../picker").PickerOption[]>;
|
84
84
|
formatter: {
|
85
85
|
type: PropType<(type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption>;
|
86
86
|
default: (type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption;
|
@@ -129,7 +129,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
129
129
|
type: PropType<string[]>;
|
130
130
|
default: () => never[];
|
131
131
|
};
|
132
|
-
filter: PropType<(columnType: string, options: import("../picker").PickerOption[]) => import("../picker").PickerOption[]>;
|
132
|
+
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values?: string[] | undefined) => import("../picker").PickerOption[]>;
|
133
133
|
formatter: {
|
134
134
|
type: PropType<(type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption>;
|
135
135
|
default: (type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption;
|
@@ -28,7 +28,7 @@ export declare const DatePicker: import("../utils").WithInstall<import("vue").De
|
|
28
28
|
type: import("vue").PropType<string[]>;
|
29
29
|
default: () => never[];
|
30
30
|
};
|
31
|
-
filter: import("vue").PropType<(columnType: string, options: import("..").PickerOption[]) => import("..").PickerOption[]>;
|
31
|
+
filter: import("vue").PropType<(columnType: string, options: import("..").PickerOption[], values?: string[] | undefined) => import("..").PickerOption[]>;
|
32
32
|
formatter: {
|
33
33
|
type: import("vue").PropType<(type: string, option: import("..").PickerOption) => import("..").PickerOption>;
|
34
34
|
default: (type: string, option: import("..").PickerOption) => import("..").PickerOption;
|
@@ -77,7 +77,7 @@ export declare const DatePicker: import("../utils").WithInstall<import("vue").De
|
|
77
77
|
type: import("vue").PropType<string[]>;
|
78
78
|
default: () => never[];
|
79
79
|
};
|
80
|
-
filter: import("vue").PropType<(columnType: string, options: import("..").PickerOption[]) => import("..").PickerOption[]>;
|
80
|
+
filter: import("vue").PropType<(columnType: string, options: import("..").PickerOption[], values?: string[] | undefined) => import("..").PickerOption[]>;
|
81
81
|
formatter: {
|
82
82
|
type: import("vue").PropType<(type: string, option: import("..").PickerOption) => import("..").PickerOption>;
|
83
83
|
default: (type: string, option: import("..").PickerOption) => import("..").PickerOption;
|
@@ -1,6 +1,8 @@
|
|
1
|
+
import { type RequiredParams } from '../utils';
|
1
2
|
import type { PropType } from 'vue';
|
2
3
|
import type { PickerOption } from '../picker';
|
3
|
-
type Filter = (columnType: string, options: PickerOption[]) => PickerOption[];
|
4
|
+
type Filter = (columnType: string, options: PickerOption[], values?: string[]) => PickerOption[];
|
5
|
+
export type TimeFilter = RequiredParams<Filter>;
|
4
6
|
type Formatter = (type: string, option: PickerOption) => PickerOption;
|
5
7
|
export declare const sharedProps: {
|
6
8
|
loading: BooleanConstructor;
|
@@ -40,6 +42,6 @@ export declare const sharedProps: {
|
|
40
42
|
export declare const pickerInheritKeys: ("title" | "readonly" | "loading" | "allowHtml" | "optionHeight" | "showToolbar" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText")[];
|
41
43
|
export declare function times<T>(n: number, iteratee: (index: number) => T): T[];
|
42
44
|
export declare const getMonthEndDay: (year: number, month: number) => number;
|
43
|
-
export declare const genOptions: <T extends string>(min: number, max: number, type: T, formatter: Formatter, filter?: Filter) => PickerOption[];
|
45
|
+
export declare const genOptions: <T extends string>(min: number, max: number, type: T, formatter: Formatter, filter?: Filter | TimeFilter, values?: string[]) => PickerOption[];
|
44
46
|
export declare const formatValueRange: (values: string[], columns: PickerOption[][]) => string[];
|
45
47
|
export {};
|
package/es/date-picker/utils.mjs
CHANGED
@@ -1,4 +1,9 @@
|
|
1
|
-
import {
|
1
|
+
import {
|
2
|
+
extend,
|
3
|
+
padZero,
|
4
|
+
makeArrayProp,
|
5
|
+
clamp
|
6
|
+
} from "../utils/index.mjs";
|
2
7
|
import { pickerSharedProps } from "../picker/Picker.mjs";
|
3
8
|
const sharedProps = extend({}, pickerSharedProps, {
|
4
9
|
modelValue: makeArrayProp(),
|
@@ -21,7 +26,7 @@ function times(n, iteratee) {
|
|
21
26
|
return result;
|
22
27
|
}
|
23
28
|
const getMonthEndDay = (year, month) => 32 - new Date(year, month - 1, 32).getDate();
|
24
|
-
const genOptions = (min, max, type, formatter, filter) => {
|
29
|
+
const genOptions = (min, max, type, formatter, filter, values) => {
|
25
30
|
const options = times(max - min + 1, (index) => {
|
26
31
|
const value = padZero(min + index);
|
27
32
|
return formatter(type, {
|
@@ -29,7 +34,7 @@ const genOptions = (min, max, type, formatter, filter) => {
|
|
29
34
|
value
|
30
35
|
});
|
31
36
|
});
|
32
|
-
return filter ? filter(type, options) : options;
|
37
|
+
return filter ? filter(type, options, values) : options;
|
33
38
|
};
|
34
39
|
const formatValueRange = (values, columns) => values.map((value, index) => {
|
35
40
|
const column = columns[index];
|
@@ -2,6 +2,7 @@ import { createVNode as _createVNode } from "vue";
|
|
2
2
|
import { ref, computed, defineComponent } from "vue";
|
3
3
|
import { isDef, truthProp, numericProp, windowHeight, makeStringProp, makeNumericProp, createNamespace, HAPTICS_FEEDBACK } from "../utils/index.mjs";
|
4
4
|
import { useId } from "../composables/use-id.mjs";
|
5
|
+
import { useExpose } from "../composables/use-expose.mjs";
|
5
6
|
import { useRect, useChildren, useClickAway, useScrollParent, useEventListener } from "@vant/use";
|
6
7
|
const [name, bem] = createNamespace("dropdown-menu");
|
7
8
|
const dropdownMenuProps = {
|
@@ -37,11 +38,14 @@ var stdin_default = defineComponent({
|
|
37
38
|
};
|
38
39
|
}
|
39
40
|
});
|
41
|
+
const close = () => {
|
42
|
+
children.forEach((item) => {
|
43
|
+
item.toggle(false);
|
44
|
+
});
|
45
|
+
};
|
40
46
|
const onClickAway = () => {
|
41
47
|
if (props.closeOnClickOutside) {
|
42
|
-
|
43
|
-
item.toggle(false);
|
44
|
-
});
|
48
|
+
close();
|
45
49
|
}
|
46
50
|
};
|
47
51
|
const updateOffset = () => {
|
@@ -104,6 +108,9 @@ var stdin_default = defineComponent({
|
|
104
108
|
"class": "van-ellipsis"
|
105
109
|
}, [item.renderTitle()])])]);
|
106
110
|
};
|
111
|
+
useExpose({
|
112
|
+
close
|
113
|
+
});
|
107
114
|
linkChildren({
|
108
115
|
id,
|
109
116
|
props,
|
@@ -55,7 +55,7 @@ export declare const DropdownMenu: import("../utils").WithInstall<import("vue").
|
|
55
55
|
export default DropdownMenu;
|
56
56
|
export { dropdownMenuProps } from './DropdownMenu';
|
57
57
|
export type { DropdownMenuProps };
|
58
|
-
export type { DropdownMenuDirection, DropdownMenuThemeVars } from './types';
|
58
|
+
export type { DropdownMenuInstance, DropdownMenuDirection, DropdownMenuThemeVars, } from './types';
|
59
59
|
declare module 'vue' {
|
60
60
|
interface GlobalComponents {
|
61
61
|
VanDropdownMenu: typeof DropdownMenu;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Ref } from 'vue';
|
1
|
+
import type { ComponentPublicInstance, Ref } from 'vue';
|
2
2
|
import type { DropdownMenuProps } from './DropdownMenu';
|
3
3
|
export type DropdownMenuDirection = 'up' | 'down';
|
4
4
|
export type DropdownMenuProvide = {
|
@@ -7,6 +7,10 @@ export type DropdownMenuProvide = {
|
|
7
7
|
offset: Ref<number>;
|
8
8
|
updateOffset: () => void;
|
9
9
|
};
|
10
|
+
export type DropdownMenuExpose = {
|
11
|
+
close: () => void;
|
12
|
+
};
|
13
|
+
export type DropdownMenuInstance = ComponentPublicInstance<DropdownMenuProps, DropdownMenuExpose>;
|
10
14
|
export type DropdownMenuThemeVars = {
|
11
15
|
dropdownMenuHeight?: string;
|
12
16
|
dropdownMenuBackground?: string;
|
package/es/field/Field.mjs
CHANGED
@@ -427,7 +427,7 @@ var stdin_default = defineComponent({
|
|
427
427
|
if (props.label) {
|
428
428
|
return _createVNode("label", {
|
429
429
|
"id": `${id}-label`,
|
430
|
-
"for": getInputId(),
|
430
|
+
"for": slots.input ? void 0 : getInputId(),
|
431
431
|
"onClick": (event) => {
|
432
432
|
preventDefault(event);
|
433
433
|
focus();
|
@@ -0,0 +1,86 @@
|
|
1
|
+
import { PropType, type ExtractPropTypes } from 'vue';
|
2
|
+
export type FloatingBubbleAxis = 'x' | 'y' | 'xy' | 'lock';
|
3
|
+
export type FloatingBubbleMagnetic = 'x' | 'y';
|
4
|
+
export type FloatingBubbleOffset = {
|
5
|
+
x: number;
|
6
|
+
y: number;
|
7
|
+
};
|
8
|
+
export declare const floatingBubbleProps: {
|
9
|
+
axis: {
|
10
|
+
type: PropType<FloatingBubbleAxis>;
|
11
|
+
default: FloatingBubbleAxis;
|
12
|
+
};
|
13
|
+
magnetic: PropType<FloatingBubbleMagnetic>;
|
14
|
+
icon: StringConstructor;
|
15
|
+
gap: {
|
16
|
+
type: NumberConstructor;
|
17
|
+
default: number;
|
18
|
+
};
|
19
|
+
offset: {
|
20
|
+
type: PropType<FloatingBubbleOffset>;
|
21
|
+
default: () => {
|
22
|
+
x: number;
|
23
|
+
y: number;
|
24
|
+
};
|
25
|
+
};
|
26
|
+
teleport: {
|
27
|
+
type: PropType<string | import("vue").RendererElement | null | undefined>;
|
28
|
+
default: string;
|
29
|
+
};
|
30
|
+
};
|
31
|
+
export type FloatingBubbleProps = ExtractPropTypes<typeof floatingBubbleProps>;
|
32
|
+
declare const _default: import("vue").DefineComponent<{
|
33
|
+
axis: {
|
34
|
+
type: PropType<FloatingBubbleAxis>;
|
35
|
+
default: FloatingBubbleAxis;
|
36
|
+
};
|
37
|
+
magnetic: PropType<FloatingBubbleMagnetic>;
|
38
|
+
icon: StringConstructor;
|
39
|
+
gap: {
|
40
|
+
type: NumberConstructor;
|
41
|
+
default: number;
|
42
|
+
};
|
43
|
+
offset: {
|
44
|
+
type: PropType<FloatingBubbleOffset>;
|
45
|
+
default: () => {
|
46
|
+
x: number;
|
47
|
+
y: number;
|
48
|
+
};
|
49
|
+
};
|
50
|
+
teleport: {
|
51
|
+
type: PropType<string | import("vue").RendererElement | null | undefined>;
|
52
|
+
default: string;
|
53
|
+
};
|
54
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "update:offset" | "offsetChange")[], "click" | "update:offset" | "offsetChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
55
|
+
axis: {
|
56
|
+
type: PropType<FloatingBubbleAxis>;
|
57
|
+
default: FloatingBubbleAxis;
|
58
|
+
};
|
59
|
+
magnetic: PropType<FloatingBubbleMagnetic>;
|
60
|
+
icon: StringConstructor;
|
61
|
+
gap: {
|
62
|
+
type: NumberConstructor;
|
63
|
+
default: number;
|
64
|
+
};
|
65
|
+
offset: {
|
66
|
+
type: PropType<FloatingBubbleOffset>;
|
67
|
+
default: () => {
|
68
|
+
x: number;
|
69
|
+
y: number;
|
70
|
+
};
|
71
|
+
};
|
72
|
+
teleport: {
|
73
|
+
type: PropType<string | import("vue").RendererElement | null | undefined>;
|
74
|
+
default: string;
|
75
|
+
};
|
76
|
+
}>> & {
|
77
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
78
|
+
"onUpdate:offset"?: ((...args: any[]) => any) | undefined;
|
79
|
+
onOffsetChange?: ((...args: any[]) => any) | undefined;
|
80
|
+
}, {
|
81
|
+
offset: FloatingBubbleOffset;
|
82
|
+
teleport: string | import("vue").RendererElement | null | undefined;
|
83
|
+
gap: number;
|
84
|
+
axis: FloatingBubbleAxis;
|
85
|
+
}, {}>;
|
86
|
+
export default _default;
|