vant 4.1.1 → 4.2.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/field/Field.mjs +11 -5
- package/es/field/index.css +1 -1
- package/es/image-preview/ImagePreviewItem.mjs +1 -1
- package/es/index.d.ts +2 -1
- package/es/index.mjs +5 -2
- package/es/locale/lang/km-KH.d.ts +62 -0
- package/es/locale/lang/km-KH.mjs +64 -0
- package/es/share-sheet/ShareSheet.mjs +11 -10
- package/es/swipe/Swipe.mjs +1 -1
- package/es/text-ellipsis/TextEllipsis.d.ts +13 -0
- package/es/text-ellipsis/TextEllipsis.mjs +4 -3
- package/es/text-ellipsis/index.d.ts +9 -0
- package/es/watermark/Watermark.d.ts +112 -0
- package/es/watermark/Watermark.mjs +131 -0
- package/es/watermark/index.css +1 -0
- package/es/watermark/index.d.ts +83 -0
- package/es/watermark/index.mjs +10 -0
- package/es/watermark/style/index.d.ts +1 -0
- package/es/watermark/style/index.mjs +2 -0
- package/lib/field/Field.js +11 -5
- package/lib/field/index.css +1 -1
- package/lib/image-preview/ImagePreviewItem.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +5 -2
- package/lib/locale/lang/km-KH.d.ts +62 -0
- package/lib/locale/lang/km-KH.js +83 -0
- package/lib/share-sheet/ShareSheet.js +11 -10
- package/lib/swipe/Swipe.js +1 -1
- package/lib/text-ellipsis/TextEllipsis.d.ts +13 -0
- package/lib/text-ellipsis/TextEllipsis.js +4 -3
- package/lib/text-ellipsis/index.d.ts +9 -0
- package/lib/vant.cjs.js +1035 -899
- package/lib/vant.es.js +1036 -900
- package/lib/vant.js +1035 -899
- package/lib/vant.min.js +1 -1
- package/lib/watermark/Watermark.d.ts +112 -0
- package/lib/watermark/Watermark.js +150 -0
- package/lib/watermark/index.css +1 -0
- package/lib/watermark/index.d.ts +83 -0
- package/lib/watermark/index.js +39 -0
- package/lib/watermark/style/index.d.ts +1 -0
- package/lib/watermark/style/index.js +2 -0
- package/lib/web-types.json +1 -1
- package/package.json +7 -1
package/lib/index.d.ts
CHANGED
@@ -93,10 +93,11 @@ export * from "./time-picker";
|
|
93
93
|
export * from "./toast";
|
94
94
|
export * from "./tree-select";
|
95
95
|
export * from "./uploader";
|
96
|
+
export * from "./watermark";
|
96
97
|
declare namespace _default {
|
97
98
|
export { install };
|
98
99
|
export { version };
|
99
100
|
}
|
100
101
|
export default _default;
|
101
102
|
export function install(app: any): void;
|
102
|
-
export const version: "4.
|
103
|
+
export const version: "4.2.0";
|
package/lib/index.js
CHANGED
@@ -117,6 +117,7 @@ var import_time_picker = require("./time-picker");
|
|
117
117
|
var import_toast = require("./toast");
|
118
118
|
var import_tree_select = require("./tree-select");
|
119
119
|
var import_uploader = require("./uploader");
|
120
|
+
var import_watermark = require("./watermark");
|
120
121
|
__reExport(stdin_exports, require("./action-bar"), module.exports);
|
121
122
|
__reExport(stdin_exports, require("./action-bar-button"), module.exports);
|
122
123
|
__reExport(stdin_exports, require("./action-bar-icon"), module.exports);
|
@@ -212,7 +213,8 @@ __reExport(stdin_exports, require("./time-picker"), module.exports);
|
|
212
213
|
__reExport(stdin_exports, require("./toast"), module.exports);
|
213
214
|
__reExport(stdin_exports, require("./tree-select"), module.exports);
|
214
215
|
__reExport(stdin_exports, require("./uploader"), module.exports);
|
215
|
-
|
216
|
+
__reExport(stdin_exports, require("./watermark"), module.exports);
|
217
|
+
const version = "4.2.0";
|
216
218
|
function install(app) {
|
217
219
|
const components = [
|
218
220
|
import_action_bar.ActionBar,
|
@@ -308,7 +310,8 @@ function install(app) {
|
|
308
310
|
import_time_picker.TimePicker,
|
309
311
|
import_toast.Toast,
|
310
312
|
import_tree_select.TreeSelect,
|
311
|
-
import_uploader.Uploader
|
313
|
+
import_uploader.Uploader,
|
314
|
+
import_watermark.Watermark
|
312
315
|
];
|
313
316
|
components.forEach((item) => {
|
314
317
|
if (item.install) {
|
@@ -0,0 +1,62 @@
|
|
1
|
+
declare const _default: {
|
2
|
+
name: string;
|
3
|
+
tel: string;
|
4
|
+
save: string;
|
5
|
+
confirm: string;
|
6
|
+
cancel: string;
|
7
|
+
delete: string;
|
8
|
+
loading: string;
|
9
|
+
noCoupon: string;
|
10
|
+
nameEmpty: string;
|
11
|
+
addContact: string;
|
12
|
+
telInvalid: string;
|
13
|
+
vanCalendar: {
|
14
|
+
end: string;
|
15
|
+
start: string;
|
16
|
+
title: string;
|
17
|
+
weekdays: string[];
|
18
|
+
monthTitle: (year: number, month: number) => string;
|
19
|
+
rangePrompt: (maxRange: number) => string;
|
20
|
+
};
|
21
|
+
vanCascader: {
|
22
|
+
select: string;
|
23
|
+
};
|
24
|
+
vanPagination: {
|
25
|
+
prev: string;
|
26
|
+
next: string;
|
27
|
+
};
|
28
|
+
vanPullRefresh: {
|
29
|
+
pulling: string;
|
30
|
+
loosing: string;
|
31
|
+
};
|
32
|
+
vanSubmitBar: {
|
33
|
+
label: string;
|
34
|
+
};
|
35
|
+
vanCoupon: {
|
36
|
+
unlimited: string;
|
37
|
+
discount: (discount: number) => string;
|
38
|
+
condition: (condition: number) => string;
|
39
|
+
};
|
40
|
+
vanCouponCell: {
|
41
|
+
title: string;
|
42
|
+
count: (count: number) => string;
|
43
|
+
};
|
44
|
+
vanCouponList: {
|
45
|
+
exchange: string;
|
46
|
+
close: string;
|
47
|
+
enable: string;
|
48
|
+
disabled: string;
|
49
|
+
placeholder: string;
|
50
|
+
};
|
51
|
+
vanAddressEdit: {
|
52
|
+
area: string;
|
53
|
+
areaEmpty: string;
|
54
|
+
addressEmpty: string;
|
55
|
+
addressDetail: string;
|
56
|
+
defaultAddress: string;
|
57
|
+
};
|
58
|
+
vanAddressList: {
|
59
|
+
add: string;
|
60
|
+
};
|
61
|
+
};
|
62
|
+
export default _default;
|
@@ -0,0 +1,83 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __export = (target, all) => {
|
6
|
+
for (var name in all)
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
8
|
+
};
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
11
|
+
for (let key of __getOwnPropNames(from))
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
14
|
+
}
|
15
|
+
return to;
|
16
|
+
};
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
18
|
+
var stdin_exports = {};
|
19
|
+
__export(stdin_exports, {
|
20
|
+
default: () => stdin_default
|
21
|
+
});
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
23
|
+
var stdin_default = {
|
24
|
+
name: "\u1788\u17D2\u1798\u17C4\u17C7",
|
25
|
+
tel: "\u1791\u17BC\u179A\u179F\u17D0\u1796\u17D2\u1791",
|
26
|
+
save: "\u179A\u1780\u17D2\u179F\u17B6\u1791\u17BB\u1780",
|
27
|
+
confirm: "\u1799\u179B\u17CB\u1796\u17D2\u179A\u1798",
|
28
|
+
cancel: "\u1794\u17C4\u17C7\u1794\u1784\u17CB",
|
29
|
+
delete: "\u179B\u17BB\u1794",
|
30
|
+
loading: "\u1780\u17C6\u1796\u17BB\u1784\u200B\u1795\u17D2\u1791\u17BB\u1780...",
|
31
|
+
noCoupon: "\u1782\u17D2\u1798\u17B6\u1793\u1782\u17BC\u1794\u17C9\u17BB\u1784",
|
32
|
+
nameEmpty: "\u179F\u17BC\u1798\u1794\u17C6\u1796\u17C1\u1789\u1788\u17D2\u1798\u17C4\u17C7",
|
33
|
+
addContact: "\u1794\u1793\u17D2\u1790\u17C2\u1798\u1791\u17C6\u1793\u17B6\u1780\u17CB\u1791\u17C6\u1793\u1784",
|
34
|
+
telInvalid: "\u179B\u17C1\u1781\u1791\u17BC\u179A\u179F\u17D0\u1796\u17D2\u1791\u1798\u17B7\u1793\u178F\u17D2\u179A\u17BC\u179C\u1791\u1798\u17D2\u179A\u1784\u17CB",
|
35
|
+
vanCalendar: {
|
36
|
+
end: "\u1794\u1789\u17D2\u1785\u1794\u17CB",
|
37
|
+
start: "\u1785\u17B6\u1794\u17CB\u1796\u17B8",
|
38
|
+
title: "\u1794\u17D2\u179A\u178F\u17B7\u1791\u17B7\u1793",
|
39
|
+
weekdays: ["\u17A2\u17B6", "\u1785", "\u17A2", "\u1796", "\u1796\u17D2\u179A", "\u179F\u17BB", "\u179F\u17C5"],
|
40
|
+
monthTitle: (year, month) => `${year}/${month}`,
|
41
|
+
rangePrompt: (maxRange) => `\u1787\u17D2\u179A\u17BE\u179F\u179A\u17BE\u179F\u1798\u17B7\u1793\u179B\u17BE\u179F\u1796\u17B8 ${maxRange} \u1790\u17D2\u1784\u17C3`
|
42
|
+
},
|
43
|
+
vanCascader: {
|
44
|
+
select: "\u1787\u17D2\u179A\u17BE\u179F\u179A\u17BE\u179F"
|
45
|
+
},
|
46
|
+
vanPagination: {
|
47
|
+
prev: "\u1798\u17BB\u1793",
|
48
|
+
next: "\u1794\u1793\u17D2\u1791\u17B6\u1794\u17CB"
|
49
|
+
},
|
50
|
+
vanPullRefresh: {
|
51
|
+
pulling: "\u1791\u17B6\u1789\u178A\u17BE\u1798\u17D2\u1794\u17B8\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u17A1\u17BE\u1784\u179C\u17B7\u1789...",
|
52
|
+
loosing: "\u1796\u17D2\u179A\u179B\u17C2\u1784\u178A\u17BE\u1798\u17D2\u1794\u17B8\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u17A1\u17BE\u1784\u179C\u17B7\u1789..."
|
53
|
+
},
|
54
|
+
vanSubmitBar: {
|
55
|
+
label: "\u179F\u179A\u17BB\u1794:"
|
56
|
+
},
|
57
|
+
vanCoupon: {
|
58
|
+
unlimited: "\u1782\u17D2\u1798\u17B6\u1793\u178A\u17C2\u1793\u1780\u17C6\u178E\u178F\u17CB",
|
59
|
+
discount: (discount) => `\u1794\u1789\u17D2\u1785\u17BB\u17C7\u178F\u1798\u17D2\u179B\u17C3 ${discount * 10}%`,
|
60
|
+
condition: (condition) => `\u1799\u17C9\u17B6\u1784\u178F\u17B7\u1785 ${condition}`
|
61
|
+
},
|
62
|
+
vanCouponCell: {
|
63
|
+
title: "\u1782\u17BC\u1794\u17C9\u17BB\u1784",
|
64
|
+
count: (count) => `\u17A2\u17D2\u1793\u1780\u1798\u17B6\u1793 ${count}\u1782\u17BC\u1794\u17C9\u17BB\u1784`
|
65
|
+
},
|
66
|
+
vanCouponList: {
|
67
|
+
exchange: "\u1794\u17D2\u178A\u17BC\u179A",
|
68
|
+
close: "\u1794\u17B7\u1791",
|
69
|
+
enable: "\u1794\u17D2\u179A\u17BE\u1794\u17B6\u1793",
|
70
|
+
disabled: "\u1798\u17B7\u1793\u17A2\u17B6\u1785\u1794\u17D2\u179A\u17BE\u1794\u17B6\u1793",
|
71
|
+
placeholder: "\u179B\u17C1\u1781\u1780\u17BC\u178A\u1782\u17BC\u1794\u17C9\u17BB\u1784"
|
72
|
+
},
|
73
|
+
vanAddressEdit: {
|
74
|
+
area: "\u1791\u17B8\u178F\u17B6\u17C6\u1784",
|
75
|
+
areaEmpty: "\u179F\u17BC\u1798\u1787\u17D2\u179A\u17BE\u179F\u179A\u17BE\u179F\u1791\u17B8\u178F\u17B6\u17C6\u1784\u1791\u1791\u17BD\u179B",
|
76
|
+
addressEmpty: "\u178F\u1798\u17D2\u179A\u17BC\u179C\u17A2\u17C4\u1799\u1798\u17B6\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793",
|
77
|
+
addressDetail: "\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793",
|
78
|
+
defaultAddress: "\u178A\u17B6\u1780\u17CB\u1787\u17B6\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u178A\u17BE\u1798"
|
79
|
+
},
|
80
|
+
vanAddressList: {
|
81
|
+
add: "\u1794\u1793\u17D2\u1790\u17C2\u1798\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u1790\u17D2\u1798\u17B8"
|
82
|
+
}
|
83
|
+
};
|
@@ -27,6 +27,7 @@ var import_utils = require("../utils");
|
|
27
27
|
var import_shared = require("../popup/shared");
|
28
28
|
var import_icon = require("../icon");
|
29
29
|
var import_popup = require("../popup");
|
30
|
+
const isImage = (name2) => name2 == null ? void 0 : name2.includes("/");
|
30
31
|
const popupInheritKeys = [...import_shared.popupSharedPropKeys, "round", "closeOnPopstate", "safeAreaInsetBottom"];
|
31
32
|
const iconMap = {
|
32
33
|
qq: "qq",
|
@@ -76,17 +77,17 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
76
77
|
}
|
77
78
|
};
|
78
79
|
const renderIcon = (icon) => {
|
79
|
-
if (
|
80
|
-
return (0, import_vue.createVNode)("
|
81
|
-
"
|
82
|
-
|
83
|
-
|
84
|
-
}, null)]);
|
80
|
+
if (isImage(icon)) {
|
81
|
+
return (0, import_vue.createVNode)("img", {
|
82
|
+
"src": icon,
|
83
|
+
"class": bem("image-icon")
|
84
|
+
}, null);
|
85
85
|
}
|
86
|
-
return (0, import_vue.createVNode)("
|
87
|
-
"
|
88
|
-
|
89
|
-
|
86
|
+
return (0, import_vue.createVNode)("div", {
|
87
|
+
"class": bem("icon", [icon])
|
88
|
+
}, [(0, import_vue.createVNode)(import_icon.Icon, {
|
89
|
+
"name": iconMap[icon] || icon
|
90
|
+
}, null)]);
|
90
91
|
};
|
91
92
|
const renderOption = (option, index) => {
|
92
93
|
const {
|
package/lib/swipe/Swipe.js
CHANGED
@@ -360,7 +360,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
360
360
|
(0, import_vue2.watch)(() => props.initialSwipe, (value) => initialize(+value));
|
361
361
|
(0, import_vue2.watch)(count, () => initialize(state.active));
|
362
362
|
(0, import_vue2.watch)(() => props.autoplay, autoplay);
|
363
|
-
(0, import_vue2.watch)([import_utils.windowWidth, import_utils.windowHeight], resize);
|
363
|
+
(0, import_vue2.watch)([import_utils.windowWidth, import_utils.windowHeight, () => props.width, () => props.height], resize);
|
364
364
|
(0, import_vue2.watch)((0, import_use.usePageVisibility)(), (visible) => {
|
365
365
|
if (visible === "visible") {
|
366
366
|
autoplay();
|
@@ -4,6 +4,10 @@ export declare const textEllipsisProps: {
|
|
4
4
|
type: (NumberConstructor | StringConstructor)[];
|
5
5
|
default: number;
|
6
6
|
};
|
7
|
+
dots: {
|
8
|
+
type: import("vue").PropType<string>;
|
9
|
+
default: string;
|
10
|
+
};
|
7
11
|
content: {
|
8
12
|
type: import("vue").PropType<string>;
|
9
13
|
default: string;
|
@@ -23,6 +27,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
23
27
|
type: (NumberConstructor | StringConstructor)[];
|
24
28
|
default: number;
|
25
29
|
};
|
30
|
+
dots: {
|
31
|
+
type: import("vue").PropType<string>;
|
32
|
+
default: string;
|
33
|
+
};
|
26
34
|
content: {
|
27
35
|
type: import("vue").PropType<string>;
|
28
36
|
default: string;
|
@@ -40,6 +48,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
40
48
|
type: (NumberConstructor | StringConstructor)[];
|
41
49
|
default: number;
|
42
50
|
};
|
51
|
+
dots: {
|
52
|
+
type: import("vue").PropType<string>;
|
53
|
+
default: string;
|
54
|
+
};
|
43
55
|
content: {
|
44
56
|
type: import("vue").PropType<string>;
|
45
57
|
default: string;
|
@@ -57,6 +69,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
57
69
|
}, {
|
58
70
|
content: string;
|
59
71
|
rows: string | number;
|
72
|
+
dots: string;
|
60
73
|
expandText: string;
|
61
74
|
collapseText: string;
|
62
75
|
}>;
|
@@ -28,6 +28,7 @@ var import_utils = require("../utils");
|
|
28
28
|
const [name, bem] = (0, import_utils.createNamespace)("text-ellipsis");
|
29
29
|
const textEllipsisProps = {
|
30
30
|
rows: (0, import_utils.makeNumericProp)(1),
|
31
|
+
dots: (0, import_utils.makeStringProp)("..."),
|
31
32
|
content: (0, import_utils.makeStringProp)(""),
|
32
33
|
expandText: (0, import_utils.makeStringProp)(""),
|
33
34
|
collapseText: (0, import_utils.makeStringProp)("")
|
@@ -71,16 +72,16 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
71
72
|
};
|
72
73
|
const calcEllipsisText = (container2, maxHeight2) => {
|
73
74
|
const {
|
75
|
+
dots,
|
74
76
|
content,
|
75
77
|
expandText
|
76
78
|
} = props;
|
77
|
-
const dot = "...";
|
78
79
|
let left = 0;
|
79
80
|
let right = content.length;
|
80
81
|
let res = -1;
|
81
82
|
while (left <= right) {
|
82
83
|
const mid = Math.floor((left + right) / 2);
|
83
|
-
container2.innerText = content.slice(0, mid) +
|
84
|
+
container2.innerText = content.slice(0, mid) + dots + expandText;
|
84
85
|
if (container2.offsetHeight <= maxHeight2) {
|
85
86
|
left = mid + 1;
|
86
87
|
res = mid;
|
@@ -88,7 +89,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
88
89
|
right = mid - 1;
|
89
90
|
}
|
90
91
|
}
|
91
|
-
return content.slice(0, res) +
|
92
|
+
return content.slice(0, res) + dots;
|
92
93
|
};
|
93
94
|
const container = cloneContainer();
|
94
95
|
if (!container)
|
@@ -3,6 +3,10 @@ export declare const TextEllipsis: import("../utils").WithInstall<import("vue").
|
|
3
3
|
type: (NumberConstructor | StringConstructor)[];
|
4
4
|
default: number;
|
5
5
|
};
|
6
|
+
dots: {
|
7
|
+
type: import("vue").PropType<string>;
|
8
|
+
default: string;
|
9
|
+
};
|
6
10
|
content: {
|
7
11
|
type: import("vue").PropType<string>;
|
8
12
|
default: string;
|
@@ -20,6 +24,10 @@ export declare const TextEllipsis: import("../utils").WithInstall<import("vue").
|
|
20
24
|
type: (NumberConstructor | StringConstructor)[];
|
21
25
|
default: number;
|
22
26
|
};
|
27
|
+
dots: {
|
28
|
+
type: import("vue").PropType<string>;
|
29
|
+
default: string;
|
30
|
+
};
|
23
31
|
content: {
|
24
32
|
type: import("vue").PropType<string>;
|
25
33
|
default: string;
|
@@ -37,6 +45,7 @@ export declare const TextEllipsis: import("../utils").WithInstall<import("vue").
|
|
37
45
|
}, {
|
38
46
|
content: string;
|
39
47
|
rows: string | number;
|
48
|
+
dots: string;
|
40
49
|
expandText: string;
|
41
50
|
collapseText: string;
|
42
51
|
}>>;
|