@nutui/nutui 4.3.7 → 4.3.9

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/nutui.es.js +1 -1
  3. package/dist/nutui.js +4275 -4416
  4. package/dist/nutui.umd.js +1 -1
  5. package/dist/packages/actionsheet/ActionSheet.js +1 -1
  6. package/dist/packages/address/Address.js +1 -1
  7. package/dist/packages/address/index.css +1 -1
  8. package/dist/packages/badge/Badge.js +60 -72
  9. package/dist/packages/calendar/Calendar.js +1 -1
  10. package/dist/packages/cascader/Cascader.js +1 -1
  11. package/dist/packages/countdown/Countdown.js +2 -2
  12. package/dist/packages/dialog/Dialog.js +3 -3
  13. package/dist/packages/elevator/index.css +1 -1
  14. package/dist/packages/elevator/index.scss +4 -0
  15. package/dist/packages/fixednav/FixedNav.js +2 -2
  16. package/dist/packages/imagepreview/ImagePreview.js +3 -3
  17. package/dist/packages/{index-uHBD4dfS.js → index-wLaOjIn1.js} +2 -2
  18. package/dist/packages/list/index.css +1 -1
  19. package/dist/packages/list/index.scss +4 -0
  20. package/dist/packages/menuitem/MenuItem.js +1 -1
  21. package/dist/packages/menuitem/index.css +1 -1
  22. package/dist/packages/menuitem/index.scss +4 -0
  23. package/dist/packages/notify/Notify.js +1 -1
  24. package/dist/packages/numberkeyboard/NumberKeyboard.js +1 -1
  25. package/dist/packages/overlay/Overlay.js +40 -54
  26. package/dist/packages/popover/Popover.js +1 -1
  27. package/dist/packages/popup/Popup.js +1 -1
  28. package/dist/packages/shortpassword/ShortPassword.js +1 -1
  29. package/dist/packages/sku/Sku.js +1 -1
  30. package/dist/packages/tabbaritem/TabbarItem.js +3 -3
  31. package/dist/packages/timeselect/TimeSelect.js +1 -1
  32. package/dist/packages/watermark/Watermark.js +69 -159
  33. package/dist/smartips/web-types.json +3 -3
  34. package/dist/style.css +1 -1
  35. package/dist/types/__VUE/actionsheet/index.vue.d.ts +3 -3
  36. package/dist/types/__VUE/address/index.vue.d.ts +5 -5
  37. package/dist/types/__VUE/badge/badge.vue.d.ts +93 -0
  38. package/dist/types/__VUE/badge/index.d.ts +5 -0
  39. package/dist/types/__VUE/calendar/index.vue.d.ts +2 -2
  40. package/dist/types/__VUE/cascader/index.vue.d.ts +2 -2
  41. package/dist/types/__VUE/circleprogress/circle-progress.vue.d.ts +2 -2
  42. package/dist/types/__VUE/collapseitem/collapse-item.vue.d.ts +1 -1
  43. package/dist/types/__VUE/dialog/index.vue.d.ts +4 -4
  44. package/dist/types/__VUE/divider/divider.vue.d.ts +1 -1
  45. package/dist/types/__VUE/fixednav/index.vue.d.ts +1 -1
  46. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +1 -1
  47. package/dist/types/__VUE/input/input.vue.d.ts +1 -1
  48. package/dist/types/__VUE/list/index.vue.d.ts +1 -1
  49. package/dist/types/__VUE/menu/index.vue.d.ts +1 -1
  50. package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
  51. package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
  52. package/dist/types/__VUE/overlay/index.d.ts +5 -0
  53. package/dist/types/__VUE/overlay/overlay.vue.d.ts +87 -0
  54. package/dist/types/__VUE/picker/index.vue.d.ts +1 -1
  55. package/dist/types/__VUE/popover/index.vue.d.ts +4 -4
  56. package/dist/types/__VUE/popup/index.vue.d.ts +3 -3
  57. package/dist/types/__VUE/row/row.vue.d.ts +1 -1
  58. package/dist/types/__VUE/shortpassword/index.vue.d.ts +2 -2
  59. package/dist/types/__VUE/sku/index.vue.d.ts +2 -2
  60. package/dist/types/__VUE/swipe/swipe.vue.d.ts +1 -1
  61. package/dist/types/__VUE/tabs/index.vue.d.ts +1 -1
  62. package/dist/types/__VUE/tour/index.vue.d.ts +1 -1
  63. package/dist/types/__VUE/watermark/index.d.ts +6 -0
  64. package/dist/types/__VUE/watermark/watermark.vue.d.ts +127 -0
  65. package/dist/types/index.d.ts +7 -4
  66. package/dist/types/utils/index.d.ts +1 -0
  67. package/package.json +1 -1
  68. package/dist/types/__VUE/badge/index.vue.d.ts +0 -102
  69. package/dist/types/__VUE/overlay/index.vue.d.ts +0 -85
  70. package/dist/types/__VUE/watermark/index.vue.d.ts +0 -201
@@ -17,12 +17,12 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, normalizeProps, guardReactiveProps, withCtx, createElementVNode, renderSlot, createCommentVNode, createBlock, resolveDynamicComponent, unref, toDisplayString } from "vue";
20
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, unref, normalizeProps, guardReactiveProps, withCtx, createElementVNode, renderSlot, createCommentVNode, createBlock, resolveDynamicComponent, toDisplayString } from "vue";
21
21
  import { r as renderIcon } from "../renderIcon-BfOvhG7i.js";
22
22
  import { u as useRouter } from "../index-aiGQ-EiA.js";
23
23
  import { u as useParent } from "../useParent-D6DiuxZZ.js";
24
24
  import { T as TABBAR_KEY } from "../types-MuhxzCWc.js";
25
- import NutBadge from "../badge/Badge.js";
25
+ import { Badge as _sfc_main$1 } from "../badge/Badge.js";
26
26
  import { w as withInstall } from "../with-install-Ch3FF0uS.js";
27
27
  const _hoisted_1 = { class: "nut-tabbar-item_icon-box" };
28
28
  const _hoisted_2 = {
@@ -76,7 +76,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
76
76
  }),
77
77
  onClick: change
78
78
  }, [
79
- createVNode(NutBadge, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
79
+ createVNode(unref(_sfc_main$1), normalizeProps(guardReactiveProps(_ctx.$attrs)), {
80
80
  default: withCtx(() => [
81
81
  createElementVNode("view", _hoisted_1, [
82
82
  _ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2, [
@@ -1,6 +1,6 @@
1
1
  import { computed, provide, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, createElementBlock, toDisplayString, renderSlot } from "vue";
2
2
  import { c as createComponent } from "../component-DQf3CENX.js";
3
- import { N as NutPopup } from "../index-uHBD4dfS.js";
3
+ import { N as NutPopup } from "../index-wLaOjIn1.js";
4
4
  import { u as useLocale } from "../index-CFigyH92.js";
5
5
  import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
6
6
  const { create } = createComponent("time-select");
@@ -17,198 +17,108 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { reactive, watch, computed, toRefs, openBlock, createElementBlock, normalizeClass, normalizeStyle } from "vue";
21
- import { c as createComponent } from "../component-DQf3CENX.js";
22
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
23
- const { componentName, create } = createComponent("watermark");
24
- const _sfc_main = create({
20
+ import { defineComponent, ref, computed, watchEffect, openBlock, createElementBlock, normalizeClass, normalizeStyle } from "vue";
21
+ import { w as withInstall } from "../with-install-Ch3FF0uS.js";
22
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
23
+ name: "NutWatermark"
24
+ }), {
25
+ __name: "watermark",
25
26
  props: {
26
- name: {
27
- type: String,
28
- default: ""
29
- },
30
- gapY: {
31
- type: Number,
32
- default: 48
33
- },
34
- gapX: {
35
- type: Number,
36
- default: 24
37
- },
38
- zIndex: {
39
- type: Number,
40
- default: 2e3
41
- },
42
- width: {
43
- type: Number,
44
- default: 120
45
- },
46
- height: {
47
- type: Number,
48
- default: 64
49
- },
50
- rotate: {
51
- type: Number,
52
- default: -22
53
- },
54
- image: {
55
- type: String,
56
- default: ""
57
- },
58
- imageWidth: {
59
- type: Number,
60
- default: 120
61
- },
62
- imageHeight: {
63
- type: Number,
64
- default: 64
65
- },
66
- content: {
67
- type: [String, Array],
68
- default: ""
69
- },
70
- fontColor: {
71
- type: String,
72
- default: "rgba(0,0,0,.15)"
73
- },
74
- fontStyle: {
75
- type: String,
76
- default: "normal"
77
- },
78
- fontFamily: {
79
- type: String,
80
- default: "PingFang SC"
81
- },
82
- fontWeight: {
83
- type: String,
84
- default: "normal"
85
- },
86
- fontSize: {
87
- type: [String, Number],
88
- default: 14
89
- },
90
- fullPage: {
91
- type: Boolean,
92
- default: ""
93
- }
27
+ gapX: { default: 24 },
28
+ gapY: { default: 48 },
29
+ zIndex: { default: 2e3 },
30
+ width: { default: 120 },
31
+ height: { default: 64 },
32
+ rotate: { default: -22 },
33
+ image: {},
34
+ imageWidth: { default: 120 },
35
+ imageHeight: { default: 64 },
36
+ content: { default: "" },
37
+ fontColor: { default: "rgba(0,0,0,.15)" },
38
+ fontStyle: { default: "normal" },
39
+ fontFamily: { default: "PingFang SC" },
40
+ fontWeight: { default: "normal" },
41
+ fontSize: { default: 14 },
42
+ fullPage: { type: Boolean, default: true }
94
43
  },
95
- emits: ["click"],
96
- setup(props) {
97
- const state = reactive({
98
- base64Url: ""
44
+ setup(__props) {
45
+ const props = __props;
46
+ const base64Url = ref("");
47
+ const classes = computed(() => {
48
+ const prefixCls = "nut-watermark";
49
+ return {
50
+ [prefixCls]: true,
51
+ [`${prefixCls}-full-page`]: props.fullPage
52
+ };
99
53
  });
100
- const {
101
- zIndex,
102
- gapX,
103
- gapY,
104
- width,
105
- height,
106
- rotate,
107
- image,
108
- imageWidth,
109
- imageHeight,
110
- content,
111
- fontStyle,
112
- fontWeight,
113
- fontColor,
114
- fontSize,
115
- fontFamily
116
- } = props;
117
54
  const init = () => {
118
55
  const canvas = document.createElement("canvas");
119
56
  const ratio = window.devicePixelRatio;
120
57
  const ctx = canvas.getContext("2d");
121
- const canvasWidth = `${(gapX + width) * ratio}px`;
122
- const canvasHeight = `${(gapY + height) * ratio}px`;
123
- const markWidth = width * ratio;
124
- const markHeight = height * ratio;
58
+ const canvasWidth = `${(props.gapX + props.width) * ratio}px`;
59
+ const canvasHeight = `${(props.gapY + props.height) * ratio}px`;
60
+ const markWidth = props.width * ratio;
61
+ const markHeight = props.height * ratio;
125
62
  canvas.setAttribute("width", canvasWidth);
126
63
  canvas.setAttribute("height", canvasHeight);
127
64
  if (ctx) {
128
- if (image) {
65
+ if (props.image) {
129
66
  ctx.translate(markWidth / 2, markHeight / 2);
130
- ctx.rotate(Math.PI / 180 * Number(rotate));
67
+ ctx.rotate(Math.PI / 180 * Number(props.rotate));
131
68
  const img = new Image();
132
69
  img.crossOrigin = "anonymous";
133
70
  img.referrerPolicy = "no-referrer";
134
- img.src = image;
71
+ img.src = props.image;
135
72
  img.onload = () => {
136
73
  ctx.drawImage(
137
74
  img,
138
- -imageWidth * ratio / 2,
139
- -imageHeight * ratio / 2,
140
- imageWidth * ratio,
141
- imageHeight * ratio
75
+ -props.imageWidth * ratio / 2,
76
+ -props.imageHeight * ratio / 2,
77
+ props.imageWidth * ratio,
78
+ props.imageHeight * ratio
142
79
  );
143
80
  ctx.restore();
144
- state.base64Url = canvas.toDataURL();
81
+ base64Url.value = canvas.toDataURL();
145
82
  };
146
- } else if (content) {
83
+ } else if (props.content) {
147
84
  ctx.textBaseline = "middle";
148
85
  ctx.textAlign = "center";
149
86
  ctx.translate(markWidth / 2, markHeight / 2);
150
- ctx.rotate(Math.PI / 180 * Number(rotate));
151
- const markSize = Number(fontSize) * ratio;
152
- ctx.font = `${fontStyle} normal ${fontWeight} ${markSize}px/${markHeight}px ${fontFamily}`;
153
- ctx.fillStyle = fontColor;
154
- if (Array.isArray(content)) {
155
- content.map((item, index2) => {
156
- ctx.fillText(item, 0, (index2 - 1) * markSize);
87
+ ctx.rotate(Math.PI / 180 * Number(props.rotate));
88
+ const markSize = Number(props.fontSize) * ratio;
89
+ ctx.font = `${props.fontStyle} normal ${props.fontWeight} ${markSize}px/${markHeight}px ${props.fontFamily}`;
90
+ ctx.fillStyle = props.fontColor;
91
+ if (Array.isArray(props.content)) {
92
+ props.content.map((item, index) => {
93
+ ctx.fillText(item, 0, (index - 1) * markSize);
157
94
  });
158
95
  } else {
159
- ctx.fillText(content, 0, 0);
96
+ ctx.fillText(props.content, 0, 0);
160
97
  }
161
98
  ctx.restore();
162
- state.base64Url = canvas.toDataURL();
99
+ base64Url.value = canvas.toDataURL();
163
100
  }
164
101
  } else {
165
102
  throw new Error("当前环境不支持Canvas");
166
103
  }
167
104
  };
168
- init();
169
- watch(
170
- () => [
171
- zIndex,
172
- gapX,
173
- gapY,
174
- width,
175
- height,
176
- rotate,
177
- image,
178
- imageWidth,
179
- imageHeight,
180
- content,
181
- fontStyle,
182
- fontWeight,
183
- fontColor,
184
- fontSize,
185
- fontFamily
186
- ],
187
- () => {
188
- init();
189
- }
190
- );
191
- const classes = computed(() => {
192
- const prefixCls = componentName;
193
- return {
194
- [prefixCls]: true,
195
- [`${prefixCls}-full-page`]: props.fullPage
196
- };
105
+ watchEffect(() => {
106
+ init();
197
107
  });
198
- return __spreadProps(__spreadValues({}, toRefs(state)), { classes });
108
+ return (_ctx, _cache) => {
109
+ return openBlock(), createElementBlock("view", {
110
+ class: normalizeClass(classes.value),
111
+ style: normalizeStyle({
112
+ zIndex: _ctx.zIndex,
113
+ backgroundSize: `${_ctx.gapX + _ctx.width}px`,
114
+ backgroundImage: `url('${base64Url.value}')`
115
+ })
116
+ }, null, 6);
117
+ };
199
118
  }
200
- });
201
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
202
- return openBlock(), createElementBlock("view", {
203
- class: normalizeClass(_ctx.classes),
204
- style: normalizeStyle({
205
- zIndex: _ctx.zIndex,
206
- backgroundSize: `${_ctx.gapX + _ctx.width}px`,
207
- backgroundImage: `url('${_ctx.base64Url}')`
208
- })
209
- }, null, 6);
210
- }
211
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
119
+ }));
120
+ withInstall(_sfc_main);
212
121
  export {
213
- index as default
122
+ _sfc_main as Watermark,
123
+ _sfc_main as default
214
124
  };
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
4
  "name": "NutUI",
5
- "version": "4.3.7",
5
+ "version": "4.3.9",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "tags": [
@@ -7684,10 +7684,10 @@
7684
7684
  },
7685
7685
  {
7686
7686
  "name": "font-family",
7687
- "default": "`true`",
7687
+ "default": "`PingFang SC`",
7688
7688
  "description": "水印文字字体",
7689
7689
  "value": {
7690
- "type": "boolean",
7690
+ "type": "string",
7691
7691
  "kind": "expression"
7692
7692
  }
7693
7693
  }