vant 4.6.0 → 4.6.2
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/README.md +7 -7
- package/es/checkbox/Checkbox.d.ts +14 -13
- package/es/checkbox/Checkbox.mjs +2 -1
- package/es/checkbox/Checker.d.ts +9 -13
- package/es/checkbox/Checker.mjs +13 -3
- package/es/checkbox/index.d.ts +8 -8
- package/es/field/Field.d.ts +25 -0
- package/es/field/Field.mjs +9 -0
- package/es/field/index.d.ts +13 -0
- package/es/floating-bubble/FloatingBubble.d.ts +16 -21
- package/es/floating-bubble/FloatingBubble.mjs +6 -8
- package/es/floating-bubble/index.css +1 -1
- package/es/floating-bubble/index.d.ts +18 -18
- package/es/floating-bubble/types.d.ts +13 -1
- package/es/floating-panel/FloatingPanel.mjs +2 -5
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/lazyload/vue-lazyload/util.d.ts +2 -2
- package/es/pagination/index.css +1 -1
- package/es/radio/Radio.d.ts +18 -15
- package/es/radio/Radio.mjs +5 -3
- package/es/radio/index.css +1 -1
- package/es/radio/index.d.ts +11 -9
- package/es/radio/types.d.ts +1 -0
- package/es/search/Search.d.ts +19 -0
- package/es/search/index.d.ts +13 -0
- package/es/style/base.css +1 -1
- package/es/submit-bar/types.d.ts +0 -1
- package/es/text-ellipsis/TextEllipsis.d.ts +13 -0
- package/es/text-ellipsis/TextEllipsis.mjs +50 -19
- package/es/text-ellipsis/index.d.ts +9 -0
- package/es/uploader/Uploader.mjs +6 -4
- package/es/uploader/UploaderPreviewItem.mjs +1 -1
- package/es/uploader/types.d.ts +1 -0
- package/lib/checkbox/Checkbox.d.ts +14 -13
- package/lib/checkbox/Checkbox.js +1 -0
- package/lib/checkbox/Checker.d.ts +9 -13
- package/lib/checkbox/Checker.js +13 -3
- package/lib/checkbox/index.d.ts +8 -8
- package/lib/field/Field.d.ts +25 -0
- package/lib/field/Field.js +9 -0
- package/lib/field/index.d.ts +13 -0
- package/lib/floating-bubble/FloatingBubble.d.ts +16 -21
- package/lib/floating-bubble/FloatingBubble.js +6 -8
- package/lib/floating-bubble/index.css +1 -1
- package/lib/floating-bubble/index.d.ts +18 -18
- package/lib/floating-bubble/types.d.ts +13 -1
- package/lib/floating-panel/FloatingPanel.js +1 -4
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/lazyload/vue-lazyload/util.d.ts +2 -2
- package/lib/pagination/index.css +1 -1
- package/lib/radio/Radio.d.ts +18 -15
- package/lib/radio/Radio.js +4 -2
- package/lib/radio/index.css +1 -1
- package/lib/radio/index.d.ts +11 -9
- package/lib/radio/types.d.ts +1 -0
- package/lib/search/Search.d.ts +19 -0
- package/lib/search/index.d.ts +13 -0
- package/lib/style/base.css +1 -1
- package/lib/submit-bar/types.d.ts +0 -1
- package/lib/text-ellipsis/TextEllipsis.d.ts +13 -0
- package/lib/text-ellipsis/TextEllipsis.js +49 -18
- package/lib/text-ellipsis/index.d.ts +9 -0
- package/lib/uploader/Uploader.js +6 -4
- package/lib/uploader/UploaderPreviewItem.js +1 -1
- package/lib/uploader/types.d.ts +1 -0
- package/lib/vant.cjs.js +99 -49
- package/lib/vant.es.js +99 -49
- package/lib/vant.js +110 -187
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +1 -1
@@ -15,10 +15,6 @@ export type CheckerParent = {
|
|
15
15
|
};
|
16
16
|
export declare const checkerProps: {
|
17
17
|
name: PropType<unknown>;
|
18
|
-
shape: {
|
19
|
-
type: PropType<CheckerShape>;
|
20
|
-
default: CheckerShape;
|
21
|
-
};
|
22
18
|
disabled: BooleanConstructor;
|
23
19
|
iconSize: (NumberConstructor | StringConstructor)[];
|
24
20
|
modelValue: PropType<unknown>;
|
@@ -28,10 +24,6 @@ export declare const checkerProps: {
|
|
28
24
|
};
|
29
25
|
declare const _default: import("vue").DefineComponent<{
|
30
26
|
name: PropType<unknown>;
|
31
|
-
shape: {
|
32
|
-
type: PropType<CheckerShape>;
|
33
|
-
default: CheckerShape;
|
34
|
-
};
|
35
27
|
disabled: BooleanConstructor;
|
36
28
|
iconSize: (NumberConstructor | StringConstructor)[];
|
37
29
|
modelValue: PropType<unknown>;
|
@@ -44,6 +36,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
44
36
|
required: true;
|
45
37
|
};
|
46
38
|
role: StringConstructor;
|
39
|
+
shape: {
|
40
|
+
type: PropType<"dot" | "round" | "square">;
|
41
|
+
default: "dot" | "round" | "square";
|
42
|
+
};
|
47
43
|
parent: PropType<CheckerParent | null>;
|
48
44
|
checked: BooleanConstructor;
|
49
45
|
bindGroup: {
|
@@ -52,10 +48,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
52
48
|
};
|
53
49
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "toggle")[], "click" | "toggle", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
54
50
|
name: PropType<unknown>;
|
55
|
-
shape: {
|
56
|
-
type: PropType<CheckerShape>;
|
57
|
-
default: CheckerShape;
|
58
|
-
};
|
59
51
|
disabled: BooleanConstructor;
|
60
52
|
iconSize: (NumberConstructor | StringConstructor)[];
|
61
53
|
modelValue: PropType<unknown>;
|
@@ -68,6 +60,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
68
60
|
required: true;
|
69
61
|
};
|
70
62
|
role: StringConstructor;
|
63
|
+
shape: {
|
64
|
+
type: PropType<"dot" | "round" | "square">;
|
65
|
+
default: "dot" | "round" | "square";
|
66
|
+
};
|
71
67
|
parent: PropType<CheckerParent | null>;
|
72
68
|
checked: BooleanConstructor;
|
73
69
|
bindGroup: {
|
@@ -80,7 +76,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
80
76
|
}, {
|
81
77
|
checked: boolean;
|
82
78
|
disabled: boolean;
|
83
|
-
shape:
|
79
|
+
shape: "dot" | "round" | "square";
|
84
80
|
labelDisabled: boolean;
|
85
81
|
bindGroup: boolean;
|
86
82
|
}, {}>;
|
package/lib/checkbox/Checker.js
CHANGED
@@ -27,7 +27,6 @@ var import_utils = require("../utils");
|
|
27
27
|
var import_icon = require("../icon");
|
28
28
|
const checkerProps = {
|
29
29
|
name: import_utils.unknownProp,
|
30
|
-
shape: (0, import_utils.makeStringProp)("round"),
|
31
30
|
disabled: Boolean,
|
32
31
|
iconSize: import_utils.numericProp,
|
33
32
|
modelValue: import_utils.unknownProp,
|
@@ -39,6 +38,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
39
38
|
props: (0, import_utils.extend)({}, checkerProps, {
|
40
39
|
bem: (0, import_utils.makeRequiredProp)(Function),
|
41
40
|
role: String,
|
41
|
+
shape: (0, import_utils.makeStringProp)("round"),
|
42
42
|
parent: Object,
|
43
43
|
checked: Boolean,
|
44
44
|
bindGroup: import_utils.truthProp
|
@@ -89,6 +89,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
89
89
|
emit("click", event);
|
90
90
|
};
|
91
91
|
const renderIcon = () => {
|
92
|
+
var _a, _b;
|
92
93
|
const {
|
93
94
|
bem,
|
94
95
|
shape,
|
@@ -101,15 +102,24 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
101
102
|
disabled: disabled.value,
|
102
103
|
checked
|
103
104
|
}]),
|
104
|
-
"style": {
|
105
|
+
"style": shape !== "dot" ? {
|
105
106
|
fontSize: (0, import_utils.addUnit)(iconSize)
|
107
|
+
} : {
|
108
|
+
width: (0, import_utils.addUnit)(iconSize),
|
109
|
+
height: (0, import_utils.addUnit)(iconSize),
|
110
|
+
borderColor: (_a = iconStyle.value) == null ? void 0 : _a.borderColor
|
106
111
|
}
|
107
112
|
}, [slots.icon ? slots.icon({
|
108
113
|
checked,
|
109
114
|
disabled: disabled.value
|
110
|
-
}) : (0, import_vue.createVNode)(import_icon.Icon, {
|
115
|
+
}) : shape !== "dot" ? (0, import_vue.createVNode)(import_icon.Icon, {
|
111
116
|
"name": "success",
|
112
117
|
"style": iconStyle.value
|
118
|
+
}, null) : (0, import_vue.createVNode)("div", {
|
119
|
+
"class": bem("icon--dot__icon"),
|
120
|
+
"style": {
|
121
|
+
backgroundColor: (_b = iconStyle.value) == null ? void 0 : _b.backgroundColor
|
122
|
+
}
|
113
123
|
}, null)]);
|
114
124
|
};
|
115
125
|
const renderLabel = () => {
|
package/lib/checkbox/index.d.ts
CHANGED
@@ -1,9 +1,5 @@
|
|
1
1
|
export declare const Checkbox: import("../utils").WithInstall<import("vue").DefineComponent<{
|
2
2
|
name: import("vue").PropType<unknown>;
|
3
|
-
shape: {
|
4
|
-
type: import("vue").PropType<import("./Checker").CheckerShape>;
|
5
|
-
default: import("./Checker").CheckerShape;
|
6
|
-
};
|
7
3
|
disabled: BooleanConstructor;
|
8
4
|
iconSize: (NumberConstructor | StringConstructor)[];
|
9
5
|
modelValue: import("vue").PropType<unknown>;
|
@@ -11,16 +7,16 @@ export declare const Checkbox: import("../utils").WithInstall<import("vue").Defi
|
|
11
7
|
labelPosition: import("vue").PropType<import("./Checker").CheckerLabelPosition>;
|
12
8
|
labelDisabled: BooleanConstructor;
|
13
9
|
} & {
|
10
|
+
shape: {
|
11
|
+
type: import("vue").PropType<import("./Checker").CheckerShape>;
|
12
|
+
default: import("./Checker").CheckerShape;
|
13
|
+
};
|
14
14
|
bindGroup: {
|
15
15
|
type: BooleanConstructor;
|
16
16
|
default: true;
|
17
17
|
};
|
18
18
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
19
19
|
name: import("vue").PropType<unknown>;
|
20
|
-
shape: {
|
21
|
-
type: import("vue").PropType<import("./Checker").CheckerShape>;
|
22
|
-
default: import("./Checker").CheckerShape;
|
23
|
-
};
|
24
20
|
disabled: BooleanConstructor;
|
25
21
|
iconSize: (NumberConstructor | StringConstructor)[];
|
26
22
|
modelValue: import("vue").PropType<unknown>;
|
@@ -28,6 +24,10 @@ export declare const Checkbox: import("../utils").WithInstall<import("vue").Defi
|
|
28
24
|
labelPosition: import("vue").PropType<import("./Checker").CheckerLabelPosition>;
|
29
25
|
labelDisabled: BooleanConstructor;
|
30
26
|
} & {
|
27
|
+
shape: {
|
28
|
+
type: import("vue").PropType<import("./Checker").CheckerShape>;
|
29
|
+
default: import("./Checker").CheckerShape;
|
30
|
+
};
|
31
31
|
bindGroup: {
|
32
32
|
type: BooleanConstructor;
|
33
33
|
default: true;
|
package/lib/field/Field.d.ts
CHANGED
@@ -20,8 +20,14 @@ export declare const fieldSharedProps: {
|
|
20
20
|
inputAlign: PropType<FieldTextAlign>;
|
21
21
|
placeholder: StringConstructor;
|
22
22
|
autocomplete: StringConstructor;
|
23
|
+
autocapitalize: StringConstructor;
|
24
|
+
autocorrect: StringConstructor;
|
23
25
|
errorMessage: StringConstructor;
|
24
26
|
enterkeyhint: StringConstructor;
|
27
|
+
spellcheck: {
|
28
|
+
type: BooleanConstructor;
|
29
|
+
default: null;
|
30
|
+
};
|
25
31
|
clearTrigger: {
|
26
32
|
type: PropType<FieldClearTrigger>;
|
27
33
|
default: FieldClearTrigger;
|
@@ -90,8 +96,14 @@ export declare const fieldProps: {
|
|
90
96
|
inputAlign: PropType<FieldTextAlign>;
|
91
97
|
placeholder: StringConstructor;
|
92
98
|
autocomplete: StringConstructor;
|
99
|
+
autocapitalize: StringConstructor;
|
100
|
+
autocorrect: StringConstructor;
|
93
101
|
errorMessage: StringConstructor;
|
94
102
|
enterkeyhint: StringConstructor;
|
103
|
+
spellcheck: {
|
104
|
+
type: BooleanConstructor;
|
105
|
+
default: null;
|
106
|
+
};
|
95
107
|
clearTrigger: {
|
96
108
|
type: PropType<FieldClearTrigger>;
|
97
109
|
default: FieldClearTrigger;
|
@@ -178,8 +190,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
178
190
|
inputAlign: PropType<FieldTextAlign>;
|
179
191
|
placeholder: StringConstructor;
|
180
192
|
autocomplete: StringConstructor;
|
193
|
+
autocapitalize: StringConstructor;
|
194
|
+
autocorrect: StringConstructor;
|
181
195
|
errorMessage: StringConstructor;
|
182
196
|
enterkeyhint: StringConstructor;
|
197
|
+
spellcheck: {
|
198
|
+
type: BooleanConstructor;
|
199
|
+
default: null;
|
200
|
+
};
|
183
201
|
clearTrigger: {
|
184
202
|
type: PropType<FieldClearTrigger>;
|
185
203
|
default: FieldClearTrigger;
|
@@ -264,8 +282,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
264
282
|
inputAlign: PropType<FieldTextAlign>;
|
265
283
|
placeholder: StringConstructor;
|
266
284
|
autocomplete: StringConstructor;
|
285
|
+
autocapitalize: StringConstructor;
|
286
|
+
autocorrect: StringConstructor;
|
267
287
|
errorMessage: StringConstructor;
|
268
288
|
enterkeyhint: StringConstructor;
|
289
|
+
spellcheck: {
|
290
|
+
type: BooleanConstructor;
|
291
|
+
default: null;
|
292
|
+
};
|
269
293
|
clearTrigger: {
|
270
294
|
type: PropType<FieldClearTrigger>;
|
271
295
|
default: FieldClearTrigger;
|
@@ -327,6 +351,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
327
351
|
clearable: boolean;
|
328
352
|
clearIcon: string;
|
329
353
|
modelValue: string | number;
|
354
|
+
spellcheck: boolean;
|
330
355
|
clearTrigger: FieldClearTrigger;
|
331
356
|
formatTrigger: FieldFormatTrigger;
|
332
357
|
error: boolean;
|
package/lib/field/Field.js
CHANGED
@@ -47,8 +47,14 @@ const fieldSharedProps = {
|
|
47
47
|
inputAlign: String,
|
48
48
|
placeholder: String,
|
49
49
|
autocomplete: String,
|
50
|
+
autocapitalize: String,
|
51
|
+
autocorrect: String,
|
50
52
|
errorMessage: String,
|
51
53
|
enterkeyhint: String,
|
54
|
+
spellcheck: {
|
55
|
+
type: Boolean,
|
56
|
+
default: null
|
57
|
+
},
|
52
58
|
clearTrigger: (0, import_utils.makeStringProp)("focus"),
|
53
59
|
formatTrigger: (0, import_utils.makeStringProp)("onChange"),
|
54
60
|
error: {
|
@@ -376,7 +382,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
376
382
|
autofocus: props.autofocus,
|
377
383
|
placeholder: props.placeholder,
|
378
384
|
autocomplete: props.autocomplete,
|
385
|
+
autocapitalize: props.autocapitalize,
|
386
|
+
autocorrect: props.autocorrect,
|
379
387
|
enterkeyhint: props.enterkeyhint,
|
388
|
+
spellcheck: props.spellcheck,
|
380
389
|
"aria-labelledby": props.label ? `${id}-label` : void 0,
|
381
390
|
onBlur,
|
382
391
|
onFocus,
|
package/lib/field/index.d.ts
CHANGED
@@ -46,8 +46,14 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
46
46
|
inputAlign: import("vue").PropType<import("./types").FieldTextAlign>;
|
47
47
|
placeholder: StringConstructor;
|
48
48
|
autocomplete: StringConstructor;
|
49
|
+
autocapitalize: StringConstructor;
|
50
|
+
autocorrect: StringConstructor;
|
49
51
|
errorMessage: StringConstructor;
|
50
52
|
enterkeyhint: StringConstructor;
|
53
|
+
spellcheck: {
|
54
|
+
type: BooleanConstructor;
|
55
|
+
default: null;
|
56
|
+
};
|
51
57
|
clearTrigger: {
|
52
58
|
type: import("vue").PropType<import("./types").FieldClearTrigger>;
|
53
59
|
default: import("./types").FieldClearTrigger;
|
@@ -132,8 +138,14 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
132
138
|
inputAlign: import("vue").PropType<import("./types").FieldTextAlign>;
|
133
139
|
placeholder: StringConstructor;
|
134
140
|
autocomplete: StringConstructor;
|
141
|
+
autocapitalize: StringConstructor;
|
142
|
+
autocorrect: StringConstructor;
|
135
143
|
errorMessage: StringConstructor;
|
136
144
|
enterkeyhint: StringConstructor;
|
145
|
+
spellcheck: {
|
146
|
+
type: BooleanConstructor;
|
147
|
+
default: null;
|
148
|
+
};
|
137
149
|
clearTrigger: {
|
138
150
|
type: import("vue").PropType<import("./types").FieldClearTrigger>;
|
139
151
|
default: import("./types").FieldClearTrigger;
|
@@ -195,6 +207,7 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
195
207
|
clearable: boolean;
|
196
208
|
clearIcon: string;
|
197
209
|
modelValue: string | number;
|
210
|
+
spellcheck: boolean;
|
198
211
|
clearTrigger: import("./types").FieldClearTrigger;
|
199
212
|
formatTrigger: import("./types").FieldFormatTrigger;
|
200
213
|
error: boolean;
|
@@ -1,21 +1,16 @@
|
|
1
1
|
import { PropType, type ExtractPropTypes } from 'vue';
|
2
|
-
|
3
|
-
export type FloatingBubbleMagnetic = 'x' | 'y';
|
4
|
-
export type FloatingBubbleOffset = {
|
5
|
-
x: number;
|
6
|
-
y: number;
|
7
|
-
};
|
2
|
+
import { FloatingBubbleAxis, FloatingBubbleMagnetic, FloatingBubbleOffset } from './types';
|
8
3
|
export declare const floatingBubbleProps: {
|
4
|
+
gap: {
|
5
|
+
type: NumberConstructor;
|
6
|
+
default: number;
|
7
|
+
};
|
8
|
+
icon: StringConstructor;
|
9
9
|
axis: {
|
10
10
|
type: PropType<FloatingBubbleAxis>;
|
11
11
|
default: FloatingBubbleAxis;
|
12
12
|
};
|
13
13
|
magnetic: PropType<FloatingBubbleMagnetic>;
|
14
|
-
icon: StringConstructor;
|
15
|
-
gap: {
|
16
|
-
type: NumberConstructor;
|
17
|
-
default: number;
|
18
|
-
};
|
19
14
|
offset: {
|
20
15
|
type: PropType<FloatingBubbleOffset>;
|
21
16
|
default: () => {
|
@@ -30,16 +25,16 @@ export declare const floatingBubbleProps: {
|
|
30
25
|
};
|
31
26
|
export type FloatingBubbleProps = ExtractPropTypes<typeof floatingBubbleProps>;
|
32
27
|
declare const _default: import("vue").DefineComponent<{
|
28
|
+
gap: {
|
29
|
+
type: NumberConstructor;
|
30
|
+
default: number;
|
31
|
+
};
|
32
|
+
icon: StringConstructor;
|
33
33
|
axis: {
|
34
34
|
type: PropType<FloatingBubbleAxis>;
|
35
35
|
default: FloatingBubbleAxis;
|
36
36
|
};
|
37
37
|
magnetic: PropType<FloatingBubbleMagnetic>;
|
38
|
-
icon: StringConstructor;
|
39
|
-
gap: {
|
40
|
-
type: NumberConstructor;
|
41
|
-
default: number;
|
42
|
-
};
|
43
38
|
offset: {
|
44
39
|
type: PropType<FloatingBubbleOffset>;
|
45
40
|
default: () => {
|
@@ -52,16 +47,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
52
47
|
default: string;
|
53
48
|
};
|
54
49
|
}, () => 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<{
|
50
|
+
gap: {
|
51
|
+
type: NumberConstructor;
|
52
|
+
default: number;
|
53
|
+
};
|
54
|
+
icon: StringConstructor;
|
55
55
|
axis: {
|
56
56
|
type: PropType<FloatingBubbleAxis>;
|
57
57
|
default: FloatingBubbleAxis;
|
58
58
|
};
|
59
59
|
magnetic: PropType<FloatingBubbleMagnetic>;
|
60
|
-
icon: StringConstructor;
|
61
|
-
gap: {
|
62
|
-
type: NumberConstructor;
|
63
|
-
default: number;
|
64
|
-
};
|
65
60
|
offset: {
|
66
61
|
type: PropType<FloatingBubbleOffset>;
|
67
62
|
default: () => {
|
@@ -33,15 +33,15 @@ __export(stdin_exports, {
|
|
33
33
|
module.exports = __toCommonJS(stdin_exports);
|
34
34
|
var import_vue = require("vue");
|
35
35
|
var import_vue2 = require("vue");
|
36
|
+
var import_utils = require("../utils");
|
36
37
|
var import_use = require("@vant/use");
|
37
38
|
var import_use_touch = require("../composables/use-touch");
|
38
|
-
var import_utils = require("../utils");
|
39
39
|
var import_icon = __toESM(require("../icon"));
|
40
40
|
const floatingBubbleProps = {
|
41
|
+
gap: (0, import_utils.makeNumberProp)(24),
|
42
|
+
icon: String,
|
41
43
|
axis: (0, import_utils.makeStringProp)("y"),
|
42
44
|
magnetic: String,
|
43
|
-
icon: String,
|
44
|
-
gap: (0, import_utils.makeNumberProp)(24),
|
45
45
|
offset: {
|
46
46
|
type: Object,
|
47
47
|
default: () => ({
|
@@ -72,8 +72,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
72
72
|
});
|
73
73
|
const boundary = (0, import_vue2.computed)(() => ({
|
74
74
|
top: props.gap,
|
75
|
-
right: import_utils.windowWidth.value - state.value.
|
76
|
-
bottom: import_utils.windowHeight.value - state.value.
|
75
|
+
right: import_utils.windowWidth.value - state.value.width - props.gap,
|
76
|
+
bottom: import_utils.windowHeight.value - state.value.height - props.gap,
|
77
77
|
left: props.gap
|
78
78
|
}));
|
79
79
|
const dragging = (0, import_vue2.ref)(false);
|
@@ -171,9 +171,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
171
171
|
initialized = true;
|
172
172
|
});
|
173
173
|
});
|
174
|
-
(0, import_vue2.watch)([import_utils.windowWidth, import_utils.windowHeight, () => props.gap, () => props.offset],
|
175
|
-
deep: true
|
176
|
-
});
|
174
|
+
(0, import_vue2.watch)([import_utils.windowWidth, import_utils.windowHeight, () => props.gap, () => props.offset], updateState);
|
177
175
|
const show = (0, import_vue2.ref)(true);
|
178
176
|
(0, import_vue2.onActivated)(() => {
|
179
177
|
show.value = true;
|
@@ -1 +1 @@
|
|
1
|
-
:root{--van-floating-bubble-size: 48px;--van-floating-bubble-initial-gap: 24px;--van-floating-bubble-icon-size: 28px;--van-floating-bubble-background: var(--van-primary-color);--van-floating-bubble-color: var(--van-background-2);--van-floating-bubble-z-index: 999}.van-floating-bubble{position:fixed;left:0;top:0;right:var(--van-floating-bubble-initial-gap);bottom:var(--van-floating-bubble-initial-gap);width:var(--van-floating-bubble-size);height:var(--van-floating-bubble-size);box-sizing:border-box;display:flex;justify-content:center;align-items:center;overflow:hidden;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:none;background:var(--van-floating-bubble-background);color:var(--van-floating-bubble-color);border-radius:var(--van-radius
|
1
|
+
:root{--van-floating-bubble-size: 48px;--van-floating-bubble-initial-gap: 24px;--van-floating-bubble-icon-size: 28px;--van-floating-bubble-background: var(--van-primary-color);--van-floating-bubble-color: var(--van-background-2);--van-floating-bubble-z-index: 999;--van-floating-bubble-border-radius: var(--van-radius-max)}.van-floating-bubble{position:fixed;left:0;top:0;right:var(--van-floating-bubble-initial-gap);bottom:var(--van-floating-bubble-initial-gap);width:var(--van-floating-bubble-size);height:var(--van-floating-bubble-size);box-sizing:border-box;display:flex;justify-content:center;align-items:center;overflow:hidden;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:none;background:var(--van-floating-bubble-background);color:var(--van-floating-bubble-color);border-radius:var(--van-floating-bubble-border-radius);z-index:var(--van-floating-bubble-z-index);transition:transform var(--van-duration-base)}.van-floating-bubble:active{opacity:.8}.van-floating-bubble__icon{font-size:var(--van-floating-bubble-icon-size)}
|
@@ -1,16 +1,16 @@
|
|
1
1
|
export declare const FloatingBubble: import("../utils").WithInstall<import("vue").DefineComponent<{
|
2
|
-
axis: {
|
3
|
-
type: import("vue").PropType<import("./FloatingBubble").FloatingBubbleAxis>;
|
4
|
-
default: import("./FloatingBubble").FloatingBubbleAxis;
|
5
|
-
};
|
6
|
-
magnetic: import("vue").PropType<import("./FloatingBubble").FloatingBubbleMagnetic>;
|
7
|
-
icon: StringConstructor;
|
8
2
|
gap: {
|
9
3
|
type: NumberConstructor;
|
10
4
|
default: number;
|
11
5
|
};
|
6
|
+
icon: StringConstructor;
|
7
|
+
axis: {
|
8
|
+
type: import("vue").PropType<import("./types").FloatingBubbleAxis>;
|
9
|
+
default: import("./types").FloatingBubbleAxis;
|
10
|
+
};
|
11
|
+
magnetic: import("vue").PropType<import("./types").FloatingBubbleMagnetic>;
|
12
12
|
offset: {
|
13
|
-
type: import("vue").PropType<import("./
|
13
|
+
type: import("vue").PropType<import("./types").FloatingBubbleOffset>;
|
14
14
|
default: () => {
|
15
15
|
x: number;
|
16
16
|
y: number;
|
@@ -21,18 +21,18 @@ export declare const FloatingBubble: import("../utils").WithInstall<import("vue"
|
|
21
21
|
default: string;
|
22
22
|
};
|
23
23
|
}, () => 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<import("vue").ExtractPropTypes<{
|
24
|
-
axis: {
|
25
|
-
type: import("vue").PropType<import("./FloatingBubble").FloatingBubbleAxis>;
|
26
|
-
default: import("./FloatingBubble").FloatingBubbleAxis;
|
27
|
-
};
|
28
|
-
magnetic: import("vue").PropType<import("./FloatingBubble").FloatingBubbleMagnetic>;
|
29
|
-
icon: StringConstructor;
|
30
24
|
gap: {
|
31
25
|
type: NumberConstructor;
|
32
26
|
default: number;
|
33
27
|
};
|
28
|
+
icon: StringConstructor;
|
29
|
+
axis: {
|
30
|
+
type: import("vue").PropType<import("./types").FloatingBubbleAxis>;
|
31
|
+
default: import("./types").FloatingBubbleAxis;
|
32
|
+
};
|
33
|
+
magnetic: import("vue").PropType<import("./types").FloatingBubbleMagnetic>;
|
34
34
|
offset: {
|
35
|
-
type: import("vue").PropType<import("./
|
35
|
+
type: import("vue").PropType<import("./types").FloatingBubbleOffset>;
|
36
36
|
default: () => {
|
37
37
|
x: number;
|
38
38
|
y: number;
|
@@ -47,15 +47,15 @@ export declare const FloatingBubble: import("../utils").WithInstall<import("vue"
|
|
47
47
|
"onUpdate:offset"?: ((...args: any[]) => any) | undefined;
|
48
48
|
onOffsetChange?: ((...args: any[]) => any) | undefined;
|
49
49
|
}, {
|
50
|
-
offset: import("./
|
50
|
+
offset: import("./types").FloatingBubbleOffset;
|
51
51
|
teleport: string | import("vue").RendererElement | null | undefined;
|
52
52
|
gap: number;
|
53
|
-
axis: import("./
|
53
|
+
axis: import("./types").FloatingBubbleAxis;
|
54
54
|
}, {}>>;
|
55
55
|
export default FloatingBubble;
|
56
56
|
export { floatingBubbleProps } from './FloatingBubble';
|
57
|
-
export type { FloatingBubbleProps
|
58
|
-
export type { FloatingBubbleThemeVars } from './types';
|
57
|
+
export type { FloatingBubbleProps } from './FloatingBubble';
|
58
|
+
export type { FloatingBubbleThemeVars, FloatingBubbleAxis, FloatingBubbleMagnetic, FloatingBubbleOffset, } from './types';
|
59
59
|
declare module 'vue' {
|
60
60
|
interface GlobalComponents {
|
61
61
|
FloatingBubble: typeof FloatingBubble;
|
@@ -2,7 +2,19 @@ export type FloatingBubbleThemeVars = {
|
|
2
2
|
floatingBubbleSize?: string;
|
3
3
|
floatingBubbleInitialGap?: string;
|
4
4
|
floatingBubbleIconSize?: string;
|
5
|
-
floatingBubbleBackground
|
5
|
+
floatingBubbleBackground?: string;
|
6
6
|
floatingBubbleColor?: string;
|
7
7
|
floatingBubbleZIndex?: number | string;
|
8
8
|
};
|
9
|
+
export type FloatingBubbleAxis = 'x' | 'y' | 'xy' | 'lock';
|
10
|
+
export type FloatingBubbleMagnetic = 'x' | 'y';
|
11
|
+
export type FloatingBubbleOffset = {
|
12
|
+
x: number;
|
13
|
+
y: number;
|
14
|
+
};
|
15
|
+
export type FloatingBubbleBoundary = {
|
16
|
+
top: number;
|
17
|
+
right: number;
|
18
|
+
bottom: number;
|
19
|
+
left: number;
|
20
|
+
};
|
@@ -28,9 +28,6 @@ var import_use = require("@vant/use");
|
|
28
28
|
var import_use_lock_scroll = require("../composables/use-lock-scroll");
|
29
29
|
var import_use_touch = require("../composables/use-touch");
|
30
30
|
var import_use_sync_prop_ref = require("../composables/use-sync-prop-ref");
|
31
|
-
const {
|
32
|
-
height: windowHeight
|
33
|
-
} = (0, import_use.useWindowSize)();
|
34
31
|
const floatingPanelProps = {
|
35
32
|
height: (0, import_utils.makeNumericProp)(0),
|
36
33
|
anchors: (0, import_utils.makeArrayProp)(),
|
@@ -55,7 +52,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
55
52
|
var _a, _b;
|
56
53
|
return {
|
57
54
|
min: (_a = props.anchors[0]) != null ? _a : 100,
|
58
|
-
max: (_b = props.anchors[props.anchors.length - 1]) != null ? _b : Math.round(windowHeight.value * 0.6)
|
55
|
+
max: (_b = props.anchors[props.anchors.length - 1]) != null ? _b : Math.round(import_utils.windowHeight.value * 0.6)
|
59
56
|
};
|
60
57
|
});
|
61
58
|
const anchors = (0, import_vue2.computed)(() => props.anchors.length >= 2 ? props.anchors : [boundary.value.min, boundary.value.max]);
|