@web-utils/component 3.0.6 → 3.1.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.
Files changed (172) hide show
  1. package/address-input/index.mjs +20 -57
  2. package/affix/index.mjs +26 -47
  3. package/aside-menu/index.mjs +18 -43
  4. package/avatar/index.mjs +27 -49
  5. package/awesome-button/index.mjs +35 -43
  6. package/capsule-tab/index.mjs +16 -34
  7. package/card/index.mjs +21 -76
  8. package/carousel/index.mjs +14 -49
  9. package/chat/index.mjs +104 -414
  10. package/chunk-file-uploader/index.mjs +21 -38
  11. package/chunks/FormTemp.aa57efb4.mjs +125 -0
  12. package/code-mirror-editor/index.mjs +69 -79
  13. package/color-picker/index.mjs +29 -60
  14. package/comment/index.mjs +17 -48
  15. package/confirm-button/index.mjs +11 -19
  16. package/confirmable/index.mjs +12 -20
  17. package/context-menu/index.mjs +42 -144
  18. package/count-up/index.mjs +18 -25
  19. package/custom-scrollbar/index.mjs +13 -22
  20. package/data-box/index.mjs +15 -66
  21. package/data-card/index.mjs +16 -65
  22. package/data-cardtext/index.mjs +16 -52
  23. package/data-display/index.mjs +18 -62
  24. package/data-icons/index.mjs +16 -68
  25. package/data-imgtext/index.mjs +18 -79
  26. package/data-operatext/index.mjs +18 -75
  27. package/data-panel/index.mjs +16 -63
  28. package/data-pay/index.mjs +20 -122
  29. package/data-price/index.mjs +18 -60
  30. package/data-progress/index.mjs +16 -67
  31. package/data-rotate/index.mjs +16 -66
  32. package/data-table-picker/index.mjs +25 -88
  33. package/data-tabs/index.mjs +16 -64
  34. package/dialog-form/index.mjs +48 -94
  35. package/dynamic-table/index.mjs +43 -127
  36. package/e-charts/index.mjs +21 -34
  37. package/easy-popup/index.mjs +35 -61
  38. package/editable-progress/index.mjs +22 -77
  39. package/editable-tree/index.mjs +235 -546
  40. package/egd-collapse/index.mjs +13 -26
  41. package/egd-collapse-item/index.mjs +27 -87
  42. package/element-dialog/index.mjs +69 -133
  43. package/empty-view/index.mjs +13 -33
  44. package/error-view/index.mjs +14 -34
  45. package/flex-column/index.mjs +15 -23
  46. package/flex-item/index.mjs +18 -26
  47. package/flex-row/index.mjs +23 -31
  48. package/flex-scroller/index.mjs +16 -27
  49. package/flow/index.mjs +70 -110
  50. package/flow-designer/index.mjs +1215 -4804
  51. package/flow-node/index.mjs +15 -51
  52. package/flow-viewer/index.mjs +64 -89
  53. package/form-block/index.mjs +43 -62
  54. package/form-button/index.mjs +10 -18
  55. package/form-cascader/index.mjs +49 -100
  56. package/form-checkbox-group/index.mjs +43 -110
  57. package/form-date-picker/index.mjs +51 -97
  58. package/form-holder/index.mjs +25 -42
  59. package/form-input/index.mjs +40 -90
  60. package/form-input-email/index.mjs +35 -79
  61. package/form-input-id-card/index.mjs +40 -87
  62. package/form-input-number/index.mjs +42 -102
  63. package/form-input-phone-number/index.mjs +34 -75
  64. package/form-input-tag/index.mjs +31 -73
  65. package/form-input-time/index.mjs +42 -87
  66. package/form-item/index.mjs +70 -89
  67. package/form-item-config-provider/index.mjs +12 -20
  68. package/form-item-group/index.mjs +46 -65
  69. package/form-radio-group/index.mjs +50 -108
  70. package/form-select/index.mjs +44 -95
  71. package/form-switch/index.mjs +38 -85
  72. package/form-textarea/index.mjs +31 -75
  73. package/form-view/index.mjs +112 -260
  74. package/fy-array/index.mjs +35 -121
  75. package/fy-article/index.mjs +12 -43
  76. package/fy-cascader/index.mjs +26 -67
  77. package/fy-checkbox/index.mjs +27 -77
  78. package/fy-code/index.mjs +19 -33
  79. package/fy-curd/index.mjs +810 -2017
  80. package/fy-date/index.mjs +18 -59
  81. package/fy-draggable/index.mjs +81 -140
  82. package/fy-dynamic/index.mjs +85 -204
  83. package/fy-empty/index.mjs +14 -35
  84. package/fy-form/index.mjs +254 -571
  85. package/fy-form-design/index.mjs +1489 -6084
  86. package/fy-form-design/style.css +1 -1
  87. package/fy-input/index.mjs +34 -104
  88. package/fy-input-color/index.mjs +22 -67
  89. package/fy-input-icon/index.mjs +37 -122
  90. package/fy-input-map/index.mjs +57 -149
  91. package/fy-input-number/index.mjs +18 -53
  92. package/fy-input-table/index.mjs +36 -102
  93. package/fy-input-tree/index.mjs +51 -138
  94. package/fy-progress/index.mjs +12 -31
  95. package/fy-radio/index.mjs +20 -51
  96. package/fy-rate/index.mjs +18 -51
  97. package/fy-select/index.mjs +49 -134
  98. package/fy-slider/index.mjs +19 -52
  99. package/fy-switch/index.mjs +18 -48
  100. package/fy-tabs/index.mjs +19 -51
  101. package/fy-time/index.mjs +22 -62
  102. package/fy-title/index.mjs +14 -25
  103. package/fy-tree/index.mjs +74 -216
  104. package/fy-u-editor/index.mjs +50 -64
  105. package/fy-upload/index.mjs +167 -338
  106. package/guide-steps/index.mjs +33 -53
  107. package/highlight-j-s/index.mjs +13 -27
  108. package/icon-card/index.mjs +12 -36
  109. package/icon-temp/index.mjs +12 -34
  110. package/iframe-window/index.mjs +13 -40
  111. package/image-cropper/index.mjs +46 -171
  112. package/image-preview/index.mjs +54 -168
  113. package/image-viewer/index.mjs +24 -50
  114. package/index.css +1 -0
  115. package/index.mjs +3973 -501
  116. package/input-number/index.mjs +84 -173
  117. package/input-number-range/index.mjs +20 -70
  118. package/j-s-x-component/index.mjs +3 -3
  119. package/keep-view-alive/index.mjs +47 -55
  120. package/keyboard/index.mjs +100 -113
  121. package/license/index.mjs +34 -51
  122. package/loading-view/index.mjs +14 -34
  123. package/login/index.mjs +33 -161
  124. package/monaco-editor/index.mjs +13 -21
  125. package/name-avatar/index.mjs +13 -32
  126. package/nav-bar/index.mjs +12 -31
  127. package/not-implement/index.mjs +14 -25
  128. package/notice/index.mjs +32 -80
  129. package/package.json +1 -1
  130. package/page/index.mjs +11 -23
  131. package/page-header/index.mjs +16 -37
  132. package/page-index/index.mjs +42 -93
  133. package/page-index-top/index.mjs +42 -84
  134. package/page-skeleton/index.mjs +24 -39
  135. package/page-skeleton-new/index.mjs +21 -68
  136. package/pageable-table/index.mjs +105 -227
  137. package/pageable-view/index.mjs +30 -83
  138. package/photo-swipe/index.mjs +62 -87
  139. package/present-view/index.mjs +114 -267
  140. package/queue/index.mjs +14 -29
  141. package/record-video/index.mjs +29 -66
  142. package/resize-observer/index.mjs +18 -30
  143. package/search/index.mjs +47 -81
  144. package/search-popover/index.mjs +57 -329
  145. package/sign/index.mjs +43 -60
  146. package/sign-panel/index.mjs +40 -151
  147. package/skeleton/index.mjs +18 -44
  148. package/split-pane/index.mjs +45 -129
  149. package/stateful/index.mjs +18 -26
  150. package/static-pageable-table/index.mjs +18 -44
  151. package/swiper/index.mjs +53 -94
  152. package/tab/index.mjs +13 -39
  153. package/tab-item/index.mjs +23 -37
  154. package/table-column/index.mjs +27 -35
  155. package/table-view/index.mjs +89 -209
  156. package/tag-render/index.mjs +34 -69
  157. package/text-ellipsis/index.mjs +22 -47
  158. package/tinymce-editor/index.mjs +174 -285
  159. package/toolbar/index.mjs +21 -42
  160. package/toolbar-button/index.mjs +25 -54
  161. package/verify/index.mjs +16 -29
  162. package/vue-cron/index.mjs +272 -1089
  163. package/vue-qr-code/index.mjs +19 -27
  164. package/vue-quill-editor/index.mjs +15 -27
  165. package/vue-tags-input/index.mjs +104 -224
  166. package/vue-tree-select/index.mjs +595 -742
  167. package/vue-video-player/index.mjs +42 -57
  168. package/watermark/index.mjs +27 -35
  169. package/web-types.json +1 -1
  170. package/x-input-tag/index.mjs +50 -112
  171. package/chunks/FormTemp.7f91629d.mjs +0 -165
  172. /package/chunks/{vueComponentNormalizer.446f5dc4.mjs → _plugin-vue2_normalizer.446f5dc4.mjs} +0 -0
@@ -1,8 +1,8 @@
1
- import { p as I, e as B } from "../chunks/event.b5d855dd.mjs";
2
- import { B as N, i as F, p as K } from "../chunks/util.ae730cde.mjs";
1
+ import { p as R, e as I } from "../chunks/event.b5d855dd.mjs";
2
+ import { B, i as F, p as N } from "../chunks/util.ae730cde.mjs";
3
3
  import { p as A } from "../chunks/packages.1fc9ccba.mjs";
4
4
  import { isBlank as b } from "@web-utils/core";
5
- import { n as L } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
5
+ import { n as K } from "../chunks/_plugin-vue2_normalizer.446f5dc4.mjs";
6
6
  let d, g;
7
7
  const w = {
8
8
  width: 200,
@@ -25,292 +25,92 @@ const w = {
25
25
  ratio: 1
26
26
  // 压缩比
27
27
  };
28
- function P(t, e) {
28
+ function T(e, t) {
29
29
  const i = new FileReader();
30
- i.readAsDataURL(t), i.onload = function(o) {
31
- e(o.target.result);
30
+ i.readAsDataURL(e), i.onload = function(o) {
31
+ t(o.target.result);
32
32
  };
33
33
  }
34
- function D(t, e = {}, i) {
35
- const { text: o, fontFamily: s, color: a, fontSize: r, opacity: p, bottom: S, right: f, ratio: x } = e;
36
- v(), P(t, C);
34
+ function L(e, t = {}, i) {
35
+ const { text: o, fontFamily: s, color: u, fontSize: l, opacity: p, bottom: S, right: f, ratio: x } = t;
36
+ v(), T(e, C);
37
37
  function v() {
38
- n.text = o || n.text, n.fontFamily = s || n.fontFamily, n.color = a || n.color, n.fontSize = r || n.fontSize, n.opacity = p || n.opacity, n.bottom = S || n.bottom, n.right = f || n.right, n.ratio = x || n.ratio;
38
+ n.text = o || n.text, n.fontFamily = s || n.fontFamily, n.color = u || n.color, n.fontSize = l || n.fontSize, n.opacity = p || n.opacity, n.bottom = S || n.bottom, n.right = f || n.right, n.ratio = x || n.ratio;
39
39
  }
40
40
  function C(y) {
41
- const u = new Image();
42
- u.src = y, u.onload = function() {
43
- const m = u.width, l = u.height;
44
- c(m, l), g.drawImage(u, 0, 0, m, l), E(m, l);
45
- const _ = document.getElementById("canvas").toDataURL(t.type, n.ratio), k = N(_, t.name);
41
+ const c = new Image();
42
+ c.src = y, c.onload = function() {
43
+ const m = c.width, a = c.height;
44
+ r(m, a), g.drawImage(c, 0, 0, m, a), P(m, a);
45
+ const _ = document.getElementById("canvas").toDataURL(e.type, n.ratio), k = B(_, e.name);
46
46
  i && i(k);
47
47
  };
48
48
  }
49
- function c(y, u) {
50
- d = document.getElementById("canvas"), d === null && (d = document.createElement("canvas"), d.id = "canvas", d.className = "avue-canvas", document.body.appendChild(d)), g = d.getContext("2d"), d.width = y, d.height = u;
49
+ function r(y, c) {
50
+ d = document.getElementById("canvas"), d === null && (d = document.createElement("canvas"), d.id = "canvas", d.className = "avue-canvas", document.body.appendChild(d)), g = d.getContext("2d"), d.width = y, d.height = c;
51
51
  }
52
- function E(y, u) {
53
- const m = n.text, l = U(m, y, u);
54
- g.font = `${l.fontSize}px ${n.fontFamily}`, g.fillStyle = n.color, g.globalAlpha = n.opacity / 100, g.fillText(m, l.x, l.y);
52
+ function P(y, c) {
53
+ const m = n.text, a = E(m, y, c);
54
+ g.font = `${a.fontSize}px ${n.fontFamily}`, g.fillStyle = n.color, g.globalAlpha = n.opacity / 100, g.fillText(m, a.x, a.y);
55
55
  }
56
- function U(y, u, m) {
57
- let l, _;
58
- const $ = n.fontSize / w.width * u;
59
- n.bottom ? _ = w.height - n.bottom : _ = n.top, n.right ? l = w.width - n.right : l = n.left, g.font = `${n.fontSize}px ${n.fontFamily}`;
60
- const j = Number(g.measureText(y).width);
61
- l = l - j;
62
- const z = l / w.width, R = _ / w.height;
63
- return l = z * u, _ = R * m, {
64
- x: l,
56
+ function E(y, c, m) {
57
+ let a, _;
58
+ const U = n.fontSize / w.width * c;
59
+ n.bottom ? _ = w.height - n.bottom : _ = n.top, n.right ? a = w.width - n.right : a = n.left, g.font = `${n.fontSize}px ${n.fontFamily}`;
60
+ const $ = Number(g.measureText(y).width);
61
+ a = a - $;
62
+ const z = a / w.width, j = _ / w.height;
63
+ return a = z * c, _ = j * m, {
64
+ x: a,
65
65
  y: _,
66
- fontSize: $
66
+ fontSize: U
67
67
  };
68
68
  }
69
69
  }
70
- const M = (t, e, i) => {
70
+ const D = (e, t, i) => {
71
71
  const o = JSON.stringify(i);
72
72
  window.__ENV__ === "development" && console && console.log("put_policy = ", o);
73
- const s = V(q(o));
73
+ const s = M(q(o));
74
74
  window.__ENV__ === "development" && console && console.log("encoded = ", s);
75
- const r = window.CryptoJS.HmacSHA1(s, e).toString(window.CryptoJS.enc.Base64);
76
- window.__ENV__ === "development" && console && console.log("encoded_signed=", r);
77
- const p = `${t}:${J(r)}:${s}`;
75
+ const l = window.CryptoJS.HmacSHA1(s, t).toString(window.CryptoJS.enc.Base64);
76
+ window.__ENV__ === "development" && console && console.log("encoded_signed=", l);
77
+ const p = `${e}:${V(l)}:${s}`;
78
78
  return window.__ENV__ === "development" && console && console.log("upload_token=", p), p;
79
79
  };
80
- function q(t) {
81
- let e, i, o;
82
- e = "";
83
- const s = t.length;
80
+ function q(e) {
81
+ let t, i, o;
82
+ t = "";
83
+ const s = e.length;
84
84
  for (i = 0; i < s; i++)
85
- o = t.charCodeAt(i), o >= 1 && o <= 127 ? e += t.charAt(i) : o > 2047 ? (e += String.fromCharCode(224 | o >> 12 & 15), e += String.fromCharCode(128 | o >> 6 & 63), e += String.fromCharCode(128 | o >> 0 & 63)) : (e += String.fromCharCode(192 | o >> 6 & 31), e += String.fromCharCode(128 | o >> 0 & 63));
86
- return e;
85
+ o = e.charCodeAt(i), o >= 1 && o <= 127 ? t += e.charAt(i) : o > 2047 ? (t += String.fromCharCode(224 | o >> 12 & 15), t += String.fromCharCode(128 | o >> 6 & 63), t += String.fromCharCode(128 | o >> 0 & 63)) : (t += String.fromCharCode(192 | o >> 6 & 31), t += String.fromCharCode(128 | o >> 0 & 63));
86
+ return t;
87
87
  }
88
88
  const h = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
89
- function V(t) {
90
- let e, i, o, s, a;
91
- const r = t.length;
92
- for (i = 0, e = ""; i < r; ) {
93
- if (o = t.charCodeAt(i++) & 255, i === r) {
94
- e += h.charAt(o >> 2), e += h.charAt((o & 3) << 4), e += "==";
89
+ function M(e) {
90
+ let t, i, o, s, u;
91
+ const l = e.length;
92
+ for (i = 0, t = ""; i < l; ) {
93
+ if (o = e.charCodeAt(i++) & 255, i === l) {
94
+ t += h.charAt(o >> 2), t += h.charAt((o & 3) << 4), t += "==";
95
95
  break;
96
96
  }
97
- if (s = t.charCodeAt(i++), i === r) {
98
- e += h.charAt(o >> 2), e += h.charAt((o & 3) << 4 | (s & 240) >> 4), e += h.charAt((s & 15) << 2), e += "=";
97
+ if (s = e.charCodeAt(i++), i === l) {
98
+ t += h.charAt(o >> 2), t += h.charAt((o & 3) << 4 | (s & 240) >> 4), t += h.charAt((s & 15) << 2), t += "=";
99
99
  break;
100
100
  }
101
- a = t.charCodeAt(i++), e += h.charAt(o >> 2), e += h.charAt((o & 3) << 4 | (s & 240) >> 4), e += h.charAt((s & 15) << 2 | (a & 192) >> 6), e += h.charAt(a & 63);
101
+ u = e.charCodeAt(i++), t += h.charAt(o >> 2), t += h.charAt((o & 3) << 4 | (s & 240) >> 4), t += h.charAt((s & 15) << 2 | (u & 192) >> 6), t += h.charAt(u & 63);
102
102
  }
103
- return e;
103
+ return t;
104
104
  }
105
- const J = function(t) {
106
- return t = t.replace(/\+/g, "-"), t = t.replace(/\//g, "_"), t;
107
- }, H = (t) => new window.OSS(t);
108
- var Q = function() {
109
- var t = this, e = t.$createElement, i = t._self._c || e;
110
- return i("div", {
111
- directives: [{
112
- name: "loading",
113
- rawName: "v-loading.lock",
114
- value: t.loading,
115
- expression: "loading",
116
- modifiers: {
117
- lock: !0
118
- }
119
- }],
120
- staticClass: "avue-upload",
121
- attrs: {
122
- "element-loading-text": t.loadText
123
- }
124
- }, [i("ElUpload", {
125
- key: t.reload,
126
- class: {
127
- "avue-upload--list": t.listType === "picture-img",
128
- "avue-upload--upload": t.disabled
129
- },
130
- attrs: {
131
- action: t.action,
132
- "on-remove": t.handleRemove,
133
- accept: t.acceptList,
134
- "before-remove": t.beforeRemove,
135
- multiple: t.multiple,
136
- "on-preview": t.handlePreview,
137
- limit: t.limit,
138
- "http-request": t.httpUpload,
139
- readonly: t.readonly,
140
- drag: t.dragFile,
141
- "show-file-list": t.isPictureImg ? !1 : t.showFileList,
142
- "list-type": t.listType,
143
- "on-change": t.handleFileChange,
144
- "on-exceed": t.handleExceed,
145
- disabled: t.disabled,
146
- "file-list": t.fileList
147
- },
148
- nativeOn: {
149
- click: function(o) {
150
- return t.handleClick.apply(null, arguments);
151
- }
152
- },
153
- scopedSlots: t._u([{
154
- key: "tip",
155
- fn: function() {
156
- return [i("div", {
157
- staticClass: "el-upload__tip",
158
- domProps: {
159
- innerHTML: t._s(t.tip)
160
- }
161
- })];
162
- },
163
- proxy: !0
164
- }, {
165
- key: "file",
166
- fn: function(o) {
167
- var s = o.file;
168
- return [t.$scopedSlots.default ? t._t("default", null, {
169
- file: s
170
- }) : t.listType === "picture-card" ? i("span", [t.isMediaType(s.url) ? i(s.type, {
171
- tag: "Component",
172
- staticClass: "el-upload-list__item-thumbnail",
173
- attrs: {
174
- src: s.url
175
- }
176
- }) : i("i", {
177
- staticClass: "avue-upload__avatar el-icon-document"
178
- }), i("span", {
179
- staticClass: "el-upload-list__item-actions"
180
- }, [i("span", {
181
- staticClass: "el-upload-list__item-preview"
182
- }, [i("i", {
183
- staticClass: "el-icon-zoom-in",
184
- on: {
185
- click: function(a) {
186
- return a.stopPropagation(), t.handlePreview(s);
187
- }
188
- }
189
- })]), i("span", {
190
- staticClass: "el-upload-list__item-delete"
191
- }, [t.disabled ? t._e() : i("i", {
192
- staticClass: "el-icon-delete",
193
- on: {
194
- click: function(a) {
195
- return a.stopPropagation(), t.handleRemove(s);
196
- }
197
- }
198
- })])])], 1) : t.listType === "picture" ? i("span", {
199
- on: {
200
- click: function(a) {
201
- return a.stopPropagation(), t.handlePreview(s);
202
- }
203
- }
204
- }, [i(s.type, {
205
- tag: "Component",
206
- staticClass: "el-upload-list__item-thumbnail",
207
- attrs: {
208
- src: s.url
209
- }
210
- }), i("a", {
211
- staticClass: "el-upload-list__item-name"
212
- }, [i("i", {
213
- staticClass: "el-icon-document"
214
- }), t._v(" " + t._s(s.name) + " ")]), i("i", {
215
- staticClass: "el-icon-close",
216
- on: {
217
- click: function(a) {
218
- return a.stopPropagation(), t.handleRemove(s);
219
- }
220
- }
221
- })], 1) : i("span", {
222
- on: {
223
- click: function(a) {
224
- return a.stopPropagation(), t.handlePreview(s);
225
- }
226
- }
227
- }, [i("a", {
228
- staticClass: "el-upload-list__item-name"
229
- }, [i("i", {
230
- staticClass: "el-icon-document"
231
- }), t._v(" " + t._s(s.name) + " ")]), t.disabled ? t._e() : i("i", {
232
- staticClass: "el-icon-close",
233
- on: {
234
- click: function(a) {
235
- return a.stopPropagation(), t.handleRemove(s);
236
- }
237
- }
238
- })])];
239
- }
240
- }], null, !0)
241
- }, [t.listType === "picture-card" ? [i("i", {
242
- staticClass: "el-icon-plus"
243
- })] : t.listType === "picture-img" ? [t.$scopedSlots.default ? t._t("default", null, {
244
- file: {
245
- url: t.imgUrl
246
- }
247
- }) : [t.isMediaType(t.imgUrl) ? i(t.isMediaType(t.imgUrl), {
248
- tag: "Component",
249
- staticClass: "avue-upload__avatar",
250
- attrs: {
251
- src: t.imgUrl
252
- },
253
- on: {
254
- mouseover: function(o) {
255
- t.menu = !0;
256
- }
257
- }
258
- }) : t.imgUrl ? i("i", {
259
- staticClass: "avue-upload__avatar el-icon-document",
260
- on: {
261
- mouseover: function(o) {
262
- t.menu = !0;
263
- }
264
- }
265
- }) : i("i", {
266
- staticClass: "el-icon-plus avue-upload__avatar"
267
- }), t.menu ? i("div", {
268
- staticClass: "el-upload-list__item-actions avue-upload__menu",
269
- on: {
270
- mouseover: function(o) {
271
- t.menu = !0;
272
- },
273
- mouseout: function(o) {
274
- t.menu = !1;
275
- },
276
- click: function(o) {
277
- o.stopPropagation();
278
- }
279
- }
280
- }, [i("i", {
281
- staticClass: "el-icon-zoom-in",
282
- on: {
283
- click: function(o) {
284
- return o.stopPropagation(), t.handlePreview({
285
- url: t.imgUrl
286
- });
287
- }
288
- }
289
- }), t.disabled ? t._e() : i("i", {
290
- staticClass: "el-icon-delete",
291
- on: {
292
- click: function(o) {
293
- return o.stopPropagation(), t.handleDelete(t.imgUrl);
294
- }
295
- }
296
- })]) : t._e()]] : t.dragFile ? [i("i", {
297
- staticClass: "el-icon-upload"
298
- }), i("div", {
299
- staticClass: "el-upload__text"
300
- }, [i("em", [t._v(t._s(t.fileText || "上传"))])])] : [i("ElButton", {
301
- attrs: {
302
- icon: "el-icon-upload",
303
- size: t.size,
304
- type: "primary"
305
- }
306
- }, [t._v(" " + t._s(t.fileText || "上传") + " ")])]], 2)], 1);
307
- }, W = [];
308
- function O(t, e = "") {
309
- return e.match(/(^http:\/\/|^https:\/\/|^\/\/|data:image\/)/) ? e : t + e;
105
+ const V = function(e) {
106
+ return e = e.replace(/\+/g, "-"), e = e.replace(/\//g, "_"), e;
107
+ }, J = (e) => new window.OSS(e);
108
+ function O(e, t = "") {
109
+ return t.match(/(^http:\/\/|^https:\/\/|^\/\/|data:image\/)/) ? t : e + t;
310
110
  }
311
- const X = {
111
+ const H = {
312
112
  name: "FyUpload",
313
- mixins: [I, B],
113
+ mixins: [R, I],
314
114
  props: {
315
115
  qiniu: Object,
316
116
  ali: Object,
@@ -410,12 +210,12 @@ const X = {
410
210
  return b(this.text) ? null : O(this.homeUrl, this.text[0]);
411
211
  },
412
212
  fileList() {
413
- const t = [];
414
- return (this.text || []).forEach((e, i) => {
415
- if (e) {
416
- const o = this.isObject ? e[this.labelKey] : e.substring(e.lastIndexOf("/") + 1);
417
- let s = this.isObject ? e[this.valueKey] : e;
418
- s = O(this.homeUrl, s), t.push({
213
+ const e = [];
214
+ return (this.text || []).forEach((t, i) => {
215
+ if (t) {
216
+ const o = this.isObject ? t[this.labelKey] : t.substring(t.lastIndexOf("/") + 1);
217
+ let s = this.isObject ? t[this.valueKey] : t;
218
+ s = O(this.homeUrl, s), e.push({
419
219
  uid: `${i}`,
420
220
  status: "done",
421
221
  type: this.isMediaType(s),
@@ -423,125 +223,125 @@ const X = {
423
223
  url: s
424
224
  });
425
225
  }
426
- }), t;
226
+ }), e;
427
227
  }
428
228
  },
429
229
  mounted() {
430
230
  this.drag && this.setSort();
431
231
  },
432
232
  methods: {
433
- isMediaType(t) {
434
- return F(t, this.fileType);
233
+ isMediaType(e) {
234
+ return F(e, this.fileType);
435
235
  },
436
236
  setSort() {
437
237
  if (!window.Sortable) {
438
238
  A.logs("Sortable");
439
239
  return;
440
240
  }
441
- const t = this.$el.querySelectorAll(".avue-upload > ul")[0];
442
- window.Sortable.create(t, {
241
+ const e = this.$el.querySelectorAll(".avue-upload > ul")[0];
242
+ window.Sortable.create(e, {
443
243
  animation: 100,
444
- onEnd: (e) => {
445
- const i = this.text.splice(e.oldIndex, 1)[0];
446
- this.text.splice(e.newIndex, 0, i), this.reload = Math.random(), this.$nextTick(() => this.setSort());
244
+ onEnd: (t) => {
245
+ const i = this.text.splice(t.oldIndex, 1)[0];
246
+ this.text.splice(t.newIndex, 0, i), this.reload = Math.random(), this.$nextTick(() => this.setSort());
447
247
  }
448
248
  });
449
249
  },
450
- handleSuccess(t) {
250
+ handleSuccess(e) {
451
251
  if (this.isPictureImg)
452
- this.text.splice(0, 1, t[this.urlKey]);
252
+ this.text.splice(0, 1, e[this.urlKey]);
453
253
  else if (this.isObject) {
454
- const e = {};
455
- e[this.labelKey] = t[this.nameKey], e[this.valueKey] = t[this.urlKey], this.text.push(e);
254
+ const t = {};
255
+ t[this.labelKey] = e[this.nameKey], t[this.valueKey] = e[this.urlKey], this.text.push(t);
456
256
  } else
457
- this.text.push(t[this.urlKey]);
257
+ this.text.push(e[this.urlKey]);
458
258
  },
459
- handleRemove(t) {
460
- this.beforeRemove(t).then(() => {
461
- this.delete(t);
259
+ handleRemove(e) {
260
+ this.beforeRemove(e).then(() => {
261
+ this.delete(e);
462
262
  });
463
263
  },
464
- handleError(t) {
465
- this.uploadError && this.uploadError(t, this.column);
264
+ handleError(e) {
265
+ this.uploadError && this.uploadError(e, this.column);
466
266
  },
467
- delete(t) {
468
- (this.text || []).forEach((e, i) => {
469
- const o = this.isObject ? e[this.valueKey] : e;
470
- O(this.homeUrl, o) === t.url && this.text.splice(i, 1);
267
+ delete(e) {
268
+ (this.text || []).forEach((t, i) => {
269
+ const o = this.isObject ? t[this.valueKey] : t;
270
+ O(this.homeUrl, o) === e.url && this.text.splice(i, 1);
471
271
  });
472
272
  },
473
- show(t) {
474
- this.loading = !1, this.res = t || this.res, this.handleSuccess(this.res);
273
+ show(e) {
274
+ this.loading = !1, this.res = e || this.res, this.handleSuccess(this.res);
475
275
  },
476
- hide(t) {
477
- this.loading = !1, t && this.handleError(t);
276
+ hide(e) {
277
+ this.loading = !1, e && this.handleError(e);
478
278
  },
479
- handleFileChange(t, e) {
480
- e.splice(e.length - 1, 1);
279
+ handleFileChange(e, t) {
280
+ t.splice(t.length - 1, 1);
481
281
  },
482
- httpUpload(t) {
282
+ httpUpload(e) {
483
283
  if (typeof this.httpRequest == "function") {
484
- this.httpRequest(t);
284
+ this.httpRequest(e);
485
285
  return;
486
286
  }
487
287
  this.loading = !0;
488
- let e = t.file;
489
- const i = e.size / 1024;
288
+ let t = e.file;
289
+ const i = t.size / 1024;
490
290
  if (!b(i) && i > this.fileSize) {
491
291
  this.hide("文件太大不符合");
492
292
  return;
493
293
  }
494
294
  const o = Object.assign(this.headers, { "Content-Type": "multipart/form-data" });
495
- let s = {}, a = {};
496
- const r = new FormData(), p = () => {
295
+ let s = {}, u = {};
296
+ const l = new FormData(), p = () => {
497
297
  const f = (x) => {
498
298
  let v = this.action;
499
- for (const c in this.data)
500
- r.append(c, this.data[c]);
501
- const C = x || e;
502
- if (r.append(this.fileName, C), this.isQiniuOss) {
299
+ for (const r in this.data)
300
+ l.append(r, this.data[r]);
301
+ const C = x || t;
302
+ if (l.append(this.fileName, C), this.isQiniuOss) {
503
303
  if (!window.CryptoJS) {
504
304
  A.logs("CryptoJS"), this.hide();
505
305
  return;
506
306
  }
507
307
  s = this.qiniu || this.$AVUE.qiniu;
508
- const c = M(s.AK, s.SK, {
308
+ const r = D(s.AK, s.SK, {
509
309
  scope: s.scope,
510
310
  deadline: (/* @__PURE__ */ new Date()).getTime() + s.deadline * 3600
511
311
  });
512
- r.append("token", c), v = s.bucket;
312
+ l.append("token", r), v = s.bucket;
513
313
  } else if (this.isAliOss) {
514
314
  if (!window.OSS) {
515
315
  A.logs("AliOSS"), this.hide();
516
316
  return;
517
317
  }
518
- s = this.ali || this.$AVUE.ali, a = H(s);
318
+ s = this.ali || this.$AVUE.ali, u = J(s);
519
319
  }
520
- (() => this.isAliOss ? a.put(C.name, C, {
320
+ (() => this.isAliOss ? u.put(C.name, C, {
521
321
  headers: this.headers
522
- }) : this.$axios.post(v, r, { headers: o }))().then((c) => {
523
- this.res = {}, this.isQiniuOss && (c.data.key = s.url + c.data.key), this.res = K(this.isAliOss ? c : c.data, this.resKey), typeof this.uploadAfter == "function" ? this.uploadAfter(this.res, this.show, this.hide, this.column) : this.show();
524
- }).catch((c) => {
525
- this.hide(c);
322
+ }) : this.$axios.post(v, l, { headers: o }))().then((r) => {
323
+ this.res = {}, this.isQiniuOss && (r.data.key = s.url + r.data.key), this.res = N(this.isAliOss ? r : r.data, this.resKey), typeof this.uploadAfter == "function" ? this.uploadAfter(this.res, this.show, this.hide, this.column) : this.show();
324
+ }).catch((r) => {
325
+ this.hide(r);
526
326
  });
527
327
  };
528
- typeof this.uploadBefore == "function" ? this.uploadBefore(e, f, this.hide, this.column) : f();
328
+ typeof this.uploadBefore == "function" ? this.uploadBefore(t, f, this.hide, this.column) : f();
529
329
  };
530
- if (F(e.name) !== "img") {
330
+ if (F(t.name) !== "img") {
531
331
  p();
532
332
  return;
533
333
  }
534
334
  const S = () => {
535
- b(this.canvasOption) ? p() : D(e, this.canvasOption, (f) => {
536
- e = f, p();
335
+ b(this.canvasOption) ? p() : L(t, this.canvasOption, (f) => {
336
+ t = f, p();
537
337
  });
538
338
  };
539
- b(this.cropperOption) ? S() : P(e, (f) => {
339
+ b(this.cropperOption) ? S() : T(t, (f) => {
540
340
  const x = Object.assign(this.cropperOption, {
541
341
  img: f,
542
342
  type: "file",
543
343
  callback: (v) => {
544
- e = v, S();
344
+ t = v, S();
545
345
  },
546
346
  cancel: () => {
547
347
  this.loading = !1;
@@ -550,43 +350,72 @@ const X = {
550
350
  this.$ImageCropper(x);
551
351
  });
552
352
  },
553
- handleExceed(t, e) {
554
- this.uploadExceed && this.uploadExceed(this.limit, t, e, this.column);
353
+ handleExceed(e, t) {
354
+ this.uploadExceed && this.uploadExceed(this.limit, e, t, this.column);
555
355
  },
556
- handlePreview(t) {
557
- const e = () => {
558
- const i = this.fileList.findIndex((o) => o.url === t.url);
356
+ handlePreview(e) {
357
+ const t = () => {
358
+ const i = this.fileList.findIndex((o) => o.url === e.url);
559
359
  this.$ImagePreview(this.fileList, i);
560
360
  };
561
- typeof this.uploadPreview == "function" ? this.uploadPreview(t, this.column, e) : e();
361
+ typeof this.uploadPreview == "function" ? this.uploadPreview(e, this.column, t) : t();
562
362
  },
563
- handleDelete(t) {
564
- this.beforeRemove(t).then(() => {
363
+ handleDelete(e) {
364
+ this.beforeRemove(e).then(() => {
565
365
  this.text = [], this.menu = !1;
566
366
  });
567
367
  },
568
- beforeRemove(t) {
569
- return typeof this.uploadDelete == "function" ? this.uploadDelete(t, this.column) : Promise.resolve();
368
+ beforeRemove(e) {
369
+ return typeof this.uploadDelete == "function" ? this.uploadDelete(e, this.column) : Promise.resolve();
570
370
  }
571
371
  }
572
- }, T = {};
573
- var Y = /* @__PURE__ */ L(
574
- X,
372
+ };
373
+ var Q = function() {
374
+ var t = this, i = t._self._c;
375
+ return i("div", { directives: [{ name: "loading", rawName: "v-loading.lock", value: t.loading, expression: "loading", modifiers: { lock: !0 } }], staticClass: "avue-upload", attrs: { "element-loading-text": t.loadText } }, [i("ElUpload", { key: t.reload, class: { "avue-upload--list": t.listType === "picture-img", "avue-upload--upload": t.disabled }, attrs: { action: t.action, "on-remove": t.handleRemove, accept: t.acceptList, "before-remove": t.beforeRemove, multiple: t.multiple, "on-preview": t.handlePreview, limit: t.limit, "http-request": t.httpUpload, readonly: t.readonly, drag: t.dragFile, "show-file-list": t.isPictureImg ? !1 : t.showFileList, "list-type": t.listType, "on-change": t.handleFileChange, "on-exceed": t.handleExceed, disabled: t.disabled, "file-list": t.fileList }, nativeOn: { click: function(o) {
376
+ return t.handleClick.apply(null, arguments);
377
+ } }, scopedSlots: t._u([{ key: "tip", fn: function() {
378
+ return [i("div", { staticClass: "el-upload__tip", domProps: { innerHTML: t._s(t.tip) } })];
379
+ }, proxy: !0 }, { key: "file", fn: function({ file: o }) {
380
+ return [t.$scopedSlots.default ? t._t("default", null, { file: o }) : t.listType === "picture-card" ? i("span", [t.isMediaType(o.url) ? i(o.type, { tag: "Component", staticClass: "el-upload-list__item-thumbnail", attrs: { src: o.url } }) : i("i", { staticClass: "avue-upload__avatar el-icon-document" }), i("span", { staticClass: "el-upload-list__item-actions" }, [i("span", { staticClass: "el-upload-list__item-preview" }, [i("i", { staticClass: "el-icon-zoom-in", on: { click: function(s) {
381
+ return s.stopPropagation(), t.handlePreview(o);
382
+ } } })]), i("span", { staticClass: "el-upload-list__item-delete" }, [t.disabled ? t._e() : i("i", { staticClass: "el-icon-delete", on: { click: function(s) {
383
+ return s.stopPropagation(), t.handleRemove(o);
384
+ } } })])])], 1) : t.listType === "picture" ? i("span", { on: { click: function(s) {
385
+ return s.stopPropagation(), t.handlePreview(o);
386
+ } } }, [i(o.type, { tag: "Component", staticClass: "el-upload-list__item-thumbnail", attrs: { src: o.url } }), i("a", { staticClass: "el-upload-list__item-name" }, [i("i", { staticClass: "el-icon-document" }), t._v(" " + t._s(o.name) + " ")]), i("i", { staticClass: "el-icon-close", on: { click: function(s) {
387
+ return s.stopPropagation(), t.handleRemove(o);
388
+ } } })], 1) : i("span", { on: { click: function(s) {
389
+ return s.stopPropagation(), t.handlePreview(o);
390
+ } } }, [i("a", { staticClass: "el-upload-list__item-name" }, [i("i", { staticClass: "el-icon-document" }), t._v(" " + t._s(o.name) + " ")]), t.disabled ? t._e() : i("i", { staticClass: "el-icon-close", on: { click: function(s) {
391
+ return s.stopPropagation(), t.handleRemove(o);
392
+ } } })])];
393
+ } }], null, !0) }, [t.listType === "picture-card" ? [i("i", { staticClass: "el-icon-plus" })] : t.listType === "picture-img" ? [t.$scopedSlots.default ? t._t("default", null, { file: { url: t.imgUrl } }) : [t.isMediaType(t.imgUrl) ? i(t.isMediaType(t.imgUrl), { tag: "Component", staticClass: "avue-upload__avatar", attrs: { src: t.imgUrl }, on: { mouseover: function(o) {
394
+ t.menu = !0;
395
+ } } }) : t.imgUrl ? i("i", { staticClass: "avue-upload__avatar el-icon-document", on: { mouseover: function(o) {
396
+ t.menu = !0;
397
+ } } }) : i("i", { staticClass: "el-icon-plus avue-upload__avatar" }), t.menu ? i("div", { staticClass: "el-upload-list__item-actions avue-upload__menu", on: { mouseover: function(o) {
398
+ t.menu = !0;
399
+ }, mouseout: function(o) {
400
+ t.menu = !1;
401
+ }, click: function(o) {
402
+ o.stopPropagation();
403
+ } } }, [i("i", { staticClass: "el-icon-zoom-in", on: { click: function(o) {
404
+ return o.stopPropagation(), t.handlePreview({ url: t.imgUrl });
405
+ } } }), t.disabled ? t._e() : i("i", { staticClass: "el-icon-delete", on: { click: function(o) {
406
+ return o.stopPropagation(), t.handleDelete(t.imgUrl);
407
+ } } })]) : t._e()]] : t.dragFile ? [i("i", { staticClass: "el-icon-upload" }), i("div", { staticClass: "el-upload__text" }, [i("em", [t._v(t._s(t.fileText || "上传"))])])] : [i("ElButton", { attrs: { icon: "el-icon-upload", size: t.size, type: "primary" } }, [t._v(" " + t._s(t.fileText || "上传") + " ")])]], 2)], 1);
408
+ }, W = [], X = /* @__PURE__ */ K(
409
+ H,
575
410
  Q,
576
411
  W,
577
412
  !1,
578
- G,
413
+ null,
579
414
  null,
580
415
  null,
581
416
  null
582
417
  );
583
- function G(t) {
584
- for (let e in T)
585
- this[e] = T[e];
586
- }
587
- const st = /* @__PURE__ */ function() {
588
- return Y.exports;
589
- }();
418
+ const it = X.exports;
590
419
  export {
591
- st as default
420
+ it as default
592
421
  };