vant 4.1.2 → 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/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.1.2";
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
- const version = "4.1.2";
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) {
@@ -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 (iconMap[icon]) {
80
- return (0, import_vue.createVNode)("div", {
81
- "class": bem("icon", [icon])
82
- }, [(0, import_vue.createVNode)(import_icon.Icon, {
83
- "name": iconMap[icon] || icon
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)("img", {
87
- "src": icon,
88
- "class": bem("image-icon")
89
- }, null);
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 {
@@ -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) + dot + expandText;
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) + dot;
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
  }>>;