@web-utils/form-ui 1.0.0-beta86 → 1.0.0-beta88

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 (212) hide show
  1. package/affix/index.mjs +1 -1
  2. package/chunks/{4kjeIiag2.mjs → 5RCAxanu2.mjs} +3 -3
  3. package/chunks/{vebd58-O.mjs → 9ec0Wti82.mjs} +1 -1
  4. package/chunks/{BxcsELcB2.mjs → B7BaAm4k2.mjs} +2 -2
  5. package/chunks/{DSTNXl142.mjs → BFhVUqpP2.mjs} +2 -2
  6. package/chunks/BLKcXIrX.mjs +517 -0
  7. package/chunks/{C8h_P_kl2.mjs → BSOrm2U4.mjs} +2 -2
  8. package/chunks/BbUUI4mF.mjs +204 -0
  9. package/chunks/{D_q3C3v4.mjs → BegZOXrr.mjs} +4 -4
  10. package/chunks/{BIy6bO4j.mjs → Bg01eBVa2.mjs} +2 -2
  11. package/chunks/{DJlgX5ty.mjs → BhPVs8Ju.mjs} +1 -1
  12. package/chunks/{DrvwVjzq2.mjs → BmbhIxPF2.mjs} +2 -2
  13. package/chunks/{BYu4QaK72.mjs → Br3whXEJ2.mjs} +2 -2
  14. package/chunks/{y1Q66LEa2.mjs → BuI82QMb2.mjs} +1 -1
  15. package/chunks/{CCpKg0cM.mjs → Bv7b2DXh2.mjs} +2 -2
  16. package/chunks/{ofu8wJKp.mjs → C-s-88fN2.mjs} +1 -1
  17. package/chunks/{CET31mBi.mjs → C54nZqvy2.mjs} +1 -1
  18. package/chunks/CBHGpbDK.mjs +56 -0
  19. package/chunks/CFpGTE5U2.mjs +221 -0
  20. package/chunks/CIihGrgY.mjs +30 -0
  21. package/chunks/{XQwnPkab2.mjs → CW021IPm2.mjs} +1 -1
  22. package/chunks/{CLn5E7NV.mjs → CW1nopZH.mjs} +1 -1
  23. package/chunks/CY2YrwMT.mjs +302 -0
  24. package/chunks/{DVF9q3oX.mjs → CdvD0NRo2.mjs} +2 -2
  25. package/chunks/Cf_h9S62.mjs +378 -0
  26. package/chunks/{8h-xBLL82.mjs → CixNVW_T2.mjs} +10 -10
  27. package/chunks/{By-W0XXn2.mjs → ClkLQjZ82.mjs} +1 -1
  28. package/chunks/CsNZt53l.mjs +4074 -0
  29. package/chunks/{HFLY8Wla.mjs → D1mQTnJ8.mjs} +181 -185
  30. package/chunks/{CjCNtCWd.mjs → D20CQ-B6.mjs} +1 -1
  31. package/chunks/{BxuM-fgJ.mjs → D2kLAzxW.mjs} +1 -1
  32. package/chunks/{tfaGdZX2.mjs → D8_fl5Oq.mjs} +4 -4
  33. package/chunks/{C28bnMcw.mjs → DC3DNg_r.mjs} +1 -1
  34. package/chunks/{DWN5uzm02.mjs → DL4xcGES2.mjs} +10 -10
  35. package/chunks/{SWO35fS42.mjs → Dd4RtBO02.mjs} +1 -1
  36. package/chunks/{3nLaRSbR2.mjs → DdHN2Nv72.mjs} +1 -1
  37. package/chunks/{BrSqLOi5.mjs → DmJaItEY.mjs} +6 -6
  38. package/chunks/{CkHQY4ME2.mjs → Dnapnskp2.mjs} +1 -1
  39. package/chunks/{vHsAJZRT.mjs → MUk_IdeO2.mjs} +2 -2
  40. package/chunks/NAZ8HFBg.mjs +340 -0
  41. package/chunks/{saZ_qJOT.mjs → aOv3rI7q.mjs} +1 -1
  42. package/chunks/{mqi8hesW2.mjs → dxZzZgUn.mjs} +2 -2
  43. package/chunks/{Tq3_dajC2.mjs → m5oFTe8Y2.mjs} +1 -1
  44. package/chunks/{Dst9_BmZ.mjs → n7IipIUY.mjs} +3 -3
  45. package/chunks/{SInS7QSL.mjs → vCOhFr2x.mjs} +1 -1
  46. package/constants/index.d.ts +2 -0
  47. package/constants/index.mjs +2 -2
  48. package/data-table-picker/index.mjs +1 -1
  49. package/dialog-form/index.d.ts +4 -0
  50. package/dialog-form/index.mjs +154 -0
  51. package/dialog-form/style.css +1 -0
  52. package/empty-view/index.d.ts +2 -2
  53. package/flex-box/index.mjs +1 -1
  54. package/flex-column/index.mjs +1 -1
  55. package/flex-item/index.mjs +1 -1
  56. package/flex-row/index.mjs +1 -1
  57. package/flow-designer/index.mjs +1 -1
  58. package/form-cascader/index.mjs +1 -1
  59. package/form-checkbox/index.mjs +1 -1
  60. package/form-checkbox-group/index.mjs +1 -1
  61. package/form-date-picker/index.d.ts +4 -4
  62. package/form-date-picker/index.mjs +1 -1
  63. package/form-holder/index.mjs +1 -1
  64. package/form-image/index.mjs +1 -1
  65. package/form-input/index.mjs +1 -1
  66. package/form-input-cron-expression/index.mjs +1 -1
  67. package/form-input-email/index.mjs +1 -1
  68. package/form-input-id-card/index.mjs +1 -1
  69. package/form-input-number/index.mjs +1 -1
  70. package/form-input-phone-number/index.mjs +1 -1
  71. package/form-input-tag/index.mjs +1 -1
  72. package/form-input-time/index.mjs +1 -1
  73. package/form-item/index.mjs +1 -1
  74. package/form-item-group/index.mjs +1 -1
  75. package/form-radio-group/index.mjs +1 -1
  76. package/form-rate/index.mjs +1 -1
  77. package/form-row/index.mjs +1 -1
  78. package/form-select/index.mjs +1 -1
  79. package/form-slider/index.mjs +1 -1
  80. package/form-switch/index.mjs +1 -1
  81. package/form-table/index.mjs +1 -1
  82. package/form-table-plus/index.mjs +1 -1
  83. package/form-text/index.mjs +1 -1
  84. package/form-textarea/index.mjs +1 -1
  85. package/form-time-select/index.mjs +1 -1
  86. package/form-tree-select/index.mjs +1 -1
  87. package/form-tree-select-multiple/index.mjs +1 -1
  88. package/form-view/index.mjs +2 -2
  89. package/fy-array/index.d.ts +234 -0
  90. package/fy-array/index.mjs +130 -0
  91. package/fy-array/style.css +1 -0
  92. package/fy-button/index.d.ts +18 -0
  93. package/fy-button/index.mjs +2 -0
  94. package/fy-button/style.css +1 -0
  95. package/fy-cascader/index.d.ts +298 -0
  96. package/fy-cascader/index.mjs +116 -0
  97. package/fy-checkbox/index.d.ts +231 -0
  98. package/fy-checkbox/index.mjs +100 -0
  99. package/fy-checkbox/style.css +1 -0
  100. package/fy-curd/index.d.ts +908 -0
  101. package/fy-curd/index.mjs +2 -0
  102. package/fy-date/index.d.ts +246 -0
  103. package/fy-date/index.mjs +79 -0
  104. package/fy-date/style.css +1 -0
  105. package/fy-dynamic/index.d.ts +268 -0
  106. package/fy-dynamic/index.mjs +2 -0
  107. package/fy-empty/index.d.ts +31 -0
  108. package/fy-empty/index.mjs +35 -0
  109. package/fy-empty/style.css +1 -0
  110. package/fy-form/index.d.ts +522 -0
  111. package/fy-form/index.mjs +2 -0
  112. package/fy-form/style.css +1 -0
  113. package/fy-input/index.d.ts +316 -0
  114. package/fy-input/index.mjs +122 -0
  115. package/fy-input-color/index.d.ts +235 -0
  116. package/fy-input-color/index.mjs +80 -0
  117. package/fy-input-icon/index.d.ts +244 -0
  118. package/fy-input-icon/index.mjs +133 -0
  119. package/fy-input-icon/style.css +1 -0
  120. package/fy-input-map/index.d.ts +266 -0
  121. package/fy-input-map/index.mjs +248 -0
  122. package/fy-input-map/style.css +1 -0
  123. package/fy-input-number/index.d.ts +266 -0
  124. package/fy-input-number/index.mjs +78 -0
  125. package/fy-input-table/index.d.ts +248 -0
  126. package/fy-input-table/index.mjs +166 -0
  127. package/fy-input-table/style.css +1 -0
  128. package/fy-input-tree/index.d.ts +351 -0
  129. package/fy-input-tree/index.mjs +266 -0
  130. package/fy-input-tree/style.css +1 -0
  131. package/fy-radio/index.d.ts +218 -0
  132. package/fy-radio/index.mjs +56 -0
  133. package/fy-radio/style.css +1 -0
  134. package/fy-rate/index.d.ts +288 -0
  135. package/fy-rate/index.mjs +90 -0
  136. package/fy-rate/style.css +1 -0
  137. package/fy-select/index.d.ts +324 -0
  138. package/fy-select/index.mjs +2 -0
  139. package/fy-select/style.css +1 -0
  140. package/fy-slider/index.d.ts +249 -0
  141. package/fy-slider/index.mjs +72 -0
  142. package/fy-switch/index.d.ts +229 -0
  143. package/fy-switch/index.mjs +71 -0
  144. package/fy-tabs/index.d.ts +20 -0
  145. package/fy-tabs/index.mjs +50 -0
  146. package/fy-time/index.d.ts +704 -0
  147. package/fy-time/index.mjs +85 -0
  148. package/fy-title/index.d.ts +224 -0
  149. package/fy-title/index.mjs +18 -0
  150. package/fy-title/style.css +1 -0
  151. package/fy-tree/index.d.ts +141 -0
  152. package/fy-tree/index.mjs +390 -0
  153. package/fy-tree/style.css +1 -0
  154. package/fy-u-editor/index.d.ts +116 -0
  155. package/fy-u-editor/index.mjs +2 -0
  156. package/fy-u-editor/style.css +1 -0
  157. package/fy-upload/index.d.ts +379 -0
  158. package/fy-upload/index.mjs +2 -0
  159. package/fy-upload/style.css +1 -0
  160. package/helper/avue.d.ts +36 -0
  161. package/helper/avue.mjs +35 -0
  162. package/helper/input.mjs +1 -1
  163. package/icon-temp/index.d.ts +19 -0
  164. package/icon-temp/index.mjs +27 -0
  165. package/icon-temp/style.css +1 -0
  166. package/image-viewer/index.d.ts +1 -1
  167. package/index.css +1 -1
  168. package/index.d.ts +31 -1
  169. package/index.mjs +118 -90
  170. package/keyboard/index.mjs +1 -1
  171. package/monaco-editor/index.d.ts +126 -0
  172. package/monaco-editor/index.mjs +2 -0
  173. package/monaco-editor/style.css +1 -0
  174. package/package.json +3 -1
  175. package/pageable-table/index.d.ts +1 -1
  176. package/pageable-table/index.mjs +1 -1
  177. package/photo-swipe/index.mjs +1 -1
  178. package/resolver/components.mjs +1 -1
  179. package/split-pane/index.mjs +1 -1
  180. package/sub-table/index.mjs +1 -1
  181. package/sub-table-plus/index.mjs +1 -1
  182. package/table-column-def/index.d.ts +6 -6
  183. package/table-view/index.mjs +4 -4
  184. package/tag-render/index.d.ts +1 -1
  185. package/toolbar/index.mjs +1 -1
  186. package/vue-cron/index.mjs +1 -1
  187. package/vue-tags-input/index.d.ts +1 -1
  188. package/vue-tree-select/index.mjs +1 -1
  189. package/watermark/index.mjs +1 -1
  190. package/web-types.json +1 -1
  191. package/x-input-tag/index.mjs +1 -1
  192. package/chunks/{DCqyZyF6.mjs → BCYFaOiB.mjs} +0 -0
  193. package/chunks/{B1luuf_A2.mjs → BJDeTpmp2.mjs} +0 -0
  194. package/chunks/{BhHMGhJ8.mjs → BcsscZAM.mjs} +0 -0
  195. package/chunks/{DbcxJ45j.mjs → BfW25VbY.mjs} +1 -1
  196. package/chunks/{6dNVtIN32.mjs → BjccroM8.mjs} +0 -0
  197. package/chunks/{BTGrh7dw2.mjs → Br0vC3nS2.mjs} +0 -0
  198. package/chunks/{BM5LdxU72.mjs → CB0zQsKV2.mjs} +0 -0
  199. package/chunks/{Bs926z902.mjs → CHqxWrj7.mjs} +1 -1
  200. package/chunks/{B5c0s3IR.mjs → CJwAjhLy.mjs} +1 -1
  201. package/chunks/{BAG_R87k2.mjs → CZnwC17w.mjs} +0 -0
  202. package/chunks/{tVHVSu5h.mjs → CbedyG4s.mjs} +4 -4
  203. package/chunks/{BwL9Xz1F.mjs → Cp1olyWc.mjs} +0 -0
  204. package/chunks/{KOJEsarR2.mjs → CpmWELPU.mjs} +0 -0
  205. package/chunks/{C-zPVdz-.mjs → D9ft-f6n.mjs} +1 -1
  206. package/chunks/{PEU1JRcN2.mjs → DEHzWyyp.mjs} +0 -0
  207. package/chunks/{CHmZyvFr.mjs → DJe2Reym.mjs} +0 -0
  208. package/chunks/{CpsHWpwH2.mjs → DNq7pbXh2.mjs} +0 -0
  209. package/chunks/{X-ckP2Hj.mjs → DOLQ28wD.mjs} +0 -0
  210. package/chunks/{tqW2DSco.mjs → fT8tFJVO.mjs} +1 -1
  211. /package/chunks/{Dkw6LNCq2.mjs → jG7vu3RX.mjs} +0 -0
  212. /package/chunks/{b0ve2YgF.mjs → mQG01w6Y.mjs} +0 -0
package/affix/index.mjs CHANGED
@@ -41,7 +41,7 @@ var y = /* @__PURE__ */ Object.assign({ name: "Affix" }, {
41
41
  ref: O,
42
42
  class: o([{ affix: p(w) }]),
43
43
  style: s(p(E))
44
- }, [r(" @slot 内容插槽\r\n @param affix {boolean} 是否固定\r\n @param affix1 {boolean|string} 是否固定"), f(e.$slots, "default")], 6), g(a("div", { style: s(p(D)) }, null, 4), [[h, p(T)]])], 512));
44
+ }, [r(" @slot 内容插槽\n @param affix {boolean} 是否固定\n @param affix1 {boolean|string} 是否固定"), f(e.$slots, "default")], 6), g(a("div", { style: s(p(D)) }, null, 4), [[h, p(T)]])], 512));
45
45
  }
46
46
  });
47
47
  //#endregion
@@ -1,8 +1,8 @@
1
1
  import { i as e } from "./ClVh1Lek.mjs";
2
2
  import { commonAutoBindProps as t, commonManualBindProps as n } from "../props/common.mjs";
3
- import { n as r, o as i } from "./b0ve2YgF.mjs";
4
- import { n as a } from "./C28bnMcw.mjs";
5
- import { n as o, t as s } from "./8h-xBLL82.mjs";
3
+ import { n as r, o as i } from "./mQG01w6Y.mjs";
4
+ import { n as a } from "./DC3DNg_r.mjs";
5
+ import { n as o, t as s } from "./CixNVW_T2.mjs";
6
6
  import { computed as c, createVNode as l, getCurrentInstance as u, mergeProps as d, useModel as f, useTemplateRef as p } from "vue";
7
7
  import { isArray as m, isString as h, trace as g, warning as _ } from "@web-utils/core";
8
8
  import { useEventBus as v } from "@web-utils/vue/hooks/useEventBus";
@@ -1,4 +1,4 @@
1
- import { n as e, o as t } from "./b0ve2YgF.mjs";
1
+ import { n as e, o as t } from "./mQG01w6Y.mjs";
2
2
  import { allProps as n, predicate as r } from "../props/input-number.mjs";
3
3
  import { ElInputNumber as i } from "element-plus/es";
4
4
  import "element-plus/es/components/base/style/css";
@@ -1,5 +1,5 @@
1
- import { n as e } from "./b0ve2YgF.mjs";
2
- import { t } from "./C28bnMcw.mjs";
1
+ import { n as e } from "./mQG01w6Y.mjs";
2
+ import { t } from "./DC3DNg_r.mjs";
3
3
  import { allProps as n } from "../props/textarea.mjs";
4
4
  import { createVNode as r, isVNode as i, mergeProps as a, useModel as o } from "vue";
5
5
  //#region src/components/form/FormTextarea.vue?vue&type=script&lang.jsx
@@ -1,5 +1,5 @@
1
- import { n as e, o as t } from "./b0ve2YgF.mjs";
2
- import { t as n } from "./BTGrh7dw2.mjs";
1
+ import { n as e, o as t } from "./mQG01w6Y.mjs";
2
+ import { t as n } from "./Br0vC3nS2.mjs";
3
3
  import { allProps as r, predicate as i } from "../props/tree-select.mjs";
4
4
  import { createVNode as a, mergeProps as o } from "vue";
5
5
  //#endregion
@@ -0,0 +1,517 @@
1
+ import { u as e } from "./ClVh1Lek.mjs";
2
+ import { t } from "./B1MSrc6f.mjs";
3
+ import { avueConfigContextKey as n } from "../constants/index.mjs";
4
+ import { t as r } from "./CIihGrgY.mjs";
5
+ import { d as i, i as a } from "./BbUUI4mF.mjs";
6
+ import { n as o, t as s } from "./Cf_h9S62.mjs";
7
+ import { t as c } from "./CBHGpbDK.mjs";
8
+ import { ElLoadingDirective as l, ElUpload as u } from "element-plus/es";
9
+ import "element-plus/es/components/base/style/css";
10
+ import { Fragment as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, normalizeClass as _, openBlock as v, renderSlot as y, resolveDynamicComponent as b, toDisplayString as x, withCtx as S, withDirectives as C, withModifiers as w } from "vue";
11
+ import { isBlank as T } from "@web-utils/core";
12
+ import "element-plus/es/components/loading/style/css";
13
+ import "element-plus/es/components/upload/style/css";
14
+ //#region src/components/avue/fy-from/upload/canvas/index.js
15
+ var E, D, O = {
16
+ width: 200,
17
+ height: 200
18
+ }, k = {
19
+ text: "avueJS",
20
+ fontFamily: "microsoft yahei",
21
+ color: "#999",
22
+ fontSize: 16,
23
+ opacity: 100,
24
+ bottom: 10,
25
+ right: 10,
26
+ ratio: 1
27
+ };
28
+ function A(e, t) {
29
+ let n = new FileReader();
30
+ n.readAsDataURL(e), n.onload = function(e) {
31
+ t(e.target.result);
32
+ };
33
+ }
34
+ function j(e, t = {}, n) {
35
+ let { text: r, fontFamily: i, color: o, fontSize: s, opacity: c, bottom: l, right: u, ratio: d } = t;
36
+ f(), A(e, p);
37
+ function f() {
38
+ k.text = r || k.text, k.fontFamily = i || k.fontFamily, k.color = o || k.color, k.fontSize = s || k.fontSize, k.opacity = c || k.opacity, k.bottom = l || k.bottom, k.right = u || k.right, k.ratio = d || k.ratio;
39
+ }
40
+ function p(t) {
41
+ let r = new Image();
42
+ r.src = t, r.onload = function() {
43
+ let t = r.width, i = r.height;
44
+ m(t, i), D.drawImage(r, 0, 0, t, i), h(t, i);
45
+ let o = a(document.getElementById("canvas").toDataURL(e.type, k.ratio), e.name);
46
+ n == null || n(o);
47
+ };
48
+ }
49
+ function m(e, t) {
50
+ E = document.getElementById("canvas"), E === null && (E = document.createElement("canvas"), E.id = "canvas", E.className = "avue-canvas", document.body.appendChild(E)), D = E.getContext("2d"), E.width = e, E.height = t;
51
+ }
52
+ function h(e, t) {
53
+ let n = k.text, r = g(n, e, t);
54
+ D.font = `${r.fontSize}px ${k.fontFamily}`, D.fillStyle = k.color, D.globalAlpha = k.opacity / 100, D.fillText(n, r.x, r.y);
55
+ }
56
+ function g(e, t, n) {
57
+ let r, i, a = k.fontSize / O.width * t;
58
+ i = k.bottom ? O.height - k.bottom : k.top, r = k.right ? O.width - k.right : k.left, D.font = `${k.fontSize}px ${k.fontFamily}`;
59
+ let o = Number(D.measureText(e).width);
60
+ r -= o;
61
+ let s = r / O.width, c = i / O.height;
62
+ return r = s * t, i = c * n, {
63
+ x: r,
64
+ y: i,
65
+ fontSize: a
66
+ };
67
+ }
68
+ }
69
+ //#endregion
70
+ //#region src/components/avue/fy-from/upload/qiniu/index.js
71
+ var M = (e, t, n) => {
72
+ let r = JSON.stringify(n);
73
+ if (window.__ENV__ === "development") {
74
+ var i;
75
+ (i = console) == null || i.log("put_policy = ", r);
76
+ }
77
+ let a = F(N(r));
78
+ if (window.__ENV__ === "development") {
79
+ var o;
80
+ (o = console) == null || o.log("encoded = ", a);
81
+ }
82
+ let s = window.CryptoJS.HmacSHA1(a, t).toString(window.CryptoJS.enc.Base64);
83
+ if (window.__ENV__ === "development") {
84
+ var c;
85
+ (c = console) == null || c.log("encoded_signed=", s);
86
+ }
87
+ let l = `${e}:${I(s)}:${a}`;
88
+ if (window.__ENV__ === "development") {
89
+ var u;
90
+ (u = console) == null || u.log("upload_token=", l);
91
+ }
92
+ return l;
93
+ };
94
+ function N(e) {
95
+ let t, n, r;
96
+ t = "";
97
+ let i = e.length;
98
+ for (n = 0; n < i; n++) r = e.charCodeAt(n), r >= 1 && r <= 127 ? t += e.charAt(n) : r > 2047 ? (t += String.fromCharCode(224 | r >> 12 & 15), t += String.fromCharCode(128 | r >> 6 & 63), t += String.fromCharCode(128 | r >> 0 & 63)) : (t += String.fromCharCode(192 | r >> 6 & 31), t += String.fromCharCode(128 | r >> 0 & 63));
99
+ return t;
100
+ }
101
+ var P = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
102
+ function F(e) {
103
+ let t, n, r, i, a, o = e.length;
104
+ for (n = 0, t = ""; n < o;) {
105
+ if (r = e.charCodeAt(n++) & 255, n === o) {
106
+ t += P.charAt(r >> 2), t += P.charAt((r & 3) << 4), t += "==";
107
+ break;
108
+ }
109
+ if (i = e.charCodeAt(n++), n === o) {
110
+ t += P.charAt(r >> 2), t += P.charAt((r & 3) << 4 | (i & 240) >> 4), t += P.charAt((i & 15) << 2), t += "=";
111
+ break;
112
+ }
113
+ a = e.charCodeAt(n++), t += P.charAt(r >> 2), t += P.charAt((r & 3) << 4 | (i & 240) >> 4), t += P.charAt((i & 15) << 2 | (a & 192) >> 6), t += P.charAt(a & 63);
114
+ }
115
+ return t;
116
+ }
117
+ var I = function(e) {
118
+ return e = e.replace(/\+/g, "-"), e = e.replace(/\//g, "_"), e;
119
+ }, L = (e) => new window.OSS(e);
120
+ //#endregion
121
+ //#region src/components/avue/fy-from/upload/FyUpload.vue
122
+ function R(e, t = "") {
123
+ return t.match(/(^http:\/\/|^https:\/\/|^\/\/|data:image\/)/) ? t : e + t;
124
+ }
125
+ var z = {
126
+ name: "FyUpload",
127
+ mixins: [o, s],
128
+ inject: { AVUE: {
129
+ from: n,
130
+ default: null
131
+ } },
132
+ props: {
133
+ qiniu: Object,
134
+ ali: Object,
135
+ data: {
136
+ type: Object,
137
+ default: () => ({})
138
+ },
139
+ showFileList: {
140
+ type: Boolean,
141
+ default: !0
142
+ },
143
+ fileText: String,
144
+ fileType: { type: String },
145
+ oss: { type: String },
146
+ limit: { type: Number },
147
+ headers: {
148
+ type: Object,
149
+ default: () => ({})
150
+ },
151
+ accept: {
152
+ type: [String, Array],
153
+ default: ""
154
+ },
155
+ canvasOption: {
156
+ type: Object,
157
+ default: () => ({})
158
+ },
159
+ cropperOption: {
160
+ type: Object,
161
+ default: () => ({})
162
+ },
163
+ fileSize: { type: Number },
164
+ dragFile: {
165
+ type: Boolean,
166
+ default: !1
167
+ },
168
+ drag: {
169
+ type: Boolean,
170
+ default: !1
171
+ },
172
+ loadText: {
173
+ type: String,
174
+ default: "Loading..."
175
+ },
176
+ action: {
177
+ type: String,
178
+ default: ""
179
+ },
180
+ uploadBefore: Function,
181
+ uploadAfter: Function,
182
+ uploadDelete: Function,
183
+ uploadPreview: Function,
184
+ uploadError: Function,
185
+ uploadExceed: Function,
186
+ httpRequest: Function
187
+ },
188
+ data() {
189
+ return {
190
+ res: "",
191
+ loading: !1,
192
+ menu: !1,
193
+ reload: Math.random()
194
+ };
195
+ },
196
+ computed: {
197
+ isObject() {
198
+ return typeof this.text[0] == "object";
199
+ },
200
+ acceptList() {
201
+ return Array.isArray(this.accept) ? this.accept.join(",") : this.accept;
202
+ },
203
+ homeUrl() {
204
+ return this.propsHttp.home || "";
205
+ },
206
+ fileName() {
207
+ return this.propsHttp.fileName || "file";
208
+ },
209
+ isAliOss() {
210
+ return this.oss === "ali";
211
+ },
212
+ isQiniuOss() {
213
+ return this.oss === "qiniu";
214
+ },
215
+ isPictureImg() {
216
+ return this.listType === "picture-img";
217
+ },
218
+ imgUrl() {
219
+ return T(this.text) ? null : R(this.homeUrl, this.text[0]);
220
+ },
221
+ fileList() {
222
+ let e = [];
223
+ return (this.text || []).forEach((t, n) => {
224
+ if (t) {
225
+ let r = this.isObject ? t[this.labelKey] : t.substring(t.lastIndexOf("/") + 1), i = this.isObject ? t[this.valueKey] : t;
226
+ i = R(this.homeUrl, i), e.push({
227
+ uid: `${n}`,
228
+ status: "done",
229
+ type: this.isMediaType(i),
230
+ name: r,
231
+ url: i
232
+ });
233
+ }
234
+ }), e;
235
+ }
236
+ },
237
+ mounted() {
238
+ this.drag && this.setSort();
239
+ },
240
+ methods: {
241
+ isMediaType(t) {
242
+ return e(t, this.fileType);
243
+ },
244
+ setSort() {
245
+ if (!window.Sortable) {
246
+ c.logs("Sortable");
247
+ return;
248
+ }
249
+ let e = this.$el.querySelectorAll(".avue-upload > ul")[0];
250
+ window.Sortable.create(e, {
251
+ animation: 100,
252
+ onEnd: (e) => {
253
+ let t = this.text.splice(e.oldIndex, 1)[0];
254
+ this.text.splice(e.newIndex, 0, t), this.reload = Math.random(), this.$nextTick(() => this.setSort());
255
+ }
256
+ });
257
+ },
258
+ handleSuccess(e) {
259
+ if (this.isPictureImg) this.text.splice(0, 1, e[this.urlKey]);
260
+ else if (this.isObject) {
261
+ let t = {};
262
+ t[this.labelKey] = e[this.nameKey], t[this.valueKey] = e[this.urlKey], this.text.push(t);
263
+ } else this.text.push(e[this.urlKey]);
264
+ },
265
+ handleRemove(e) {
266
+ this.beforeRemove(e).then(() => {
267
+ this.delete(e);
268
+ });
269
+ },
270
+ handleError(e) {
271
+ var t;
272
+ (t = this.uploadError) == null || t.call(this, e, this.column);
273
+ },
274
+ delete(e) {
275
+ (this.text || []).forEach((t, n) => {
276
+ let r = this.isObject ? t[this.valueKey] : t;
277
+ R(this.homeUrl, r) === e.url && this.text.splice(n, 1);
278
+ });
279
+ },
280
+ show(e) {
281
+ this.loading = !1, this.res = e || this.res, this.handleSuccess(this.res);
282
+ },
283
+ hide(e) {
284
+ this.loading = !1, e && this.handleError(e);
285
+ },
286
+ handleFileChange(e, t) {
287
+ t.splice(t.length - 1, 1);
288
+ },
289
+ httpUpload(t) {
290
+ if (typeof this.httpRequest == "function") {
291
+ this.httpRequest(t);
292
+ return;
293
+ }
294
+ this.loading = !0;
295
+ let n = t.file, r = n.size / 1024;
296
+ if (!T(r) && r > this.fileSize) {
297
+ this.hide("文件太大不符合");
298
+ return;
299
+ }
300
+ let a = Object.assign(this.headers, { "Content-Type": "multipart/form-data" }), o = {}, s = {}, l = new FormData(), u = () => {
301
+ let e = (e) => {
302
+ let t = this.action;
303
+ for (let e in this.data) l.append(e, this.data[e]);
304
+ let r = e || n;
305
+ if (l.append(this.fileName, r), this.isQiniuOss) {
306
+ var u;
307
+ if (!window.CryptoJS) {
308
+ c.logs("CryptoJS"), this.hide();
309
+ return;
310
+ }
311
+ o = this.qiniu || ((u = this.AVUE) == null ? void 0 : u.qiniu);
312
+ let e = M(o.AK, o.SK, {
313
+ scope: o.scope,
314
+ deadline: (/* @__PURE__ */ new Date()).getTime() + o.deadline * 3600
315
+ });
316
+ l.append("token", e), t = o.bucket;
317
+ } else if (this.isAliOss) {
318
+ var d;
319
+ if (!window.OSS) {
320
+ c.logs("AliOSS"), this.hide();
321
+ return;
322
+ }
323
+ o = this.ali || ((d = this.AVUE) == null ? void 0 : d.ali), s = L(o);
324
+ }
325
+ (this.isAliOss ? s.put(r.name, r, { headers: this.headers }) : this.$axios.post(t, l, { headers: a })).then((e) => {
326
+ this.res = {}, this.isQiniuOss && (e.data.key = o.url + e.data.key), this.res = i(this.isAliOss ? e : e.data, this.resKey), typeof this.uploadAfter == "function" ? this.uploadAfter(this.res, this.show, this.hide, this.column) : this.show();
327
+ }).catch((e) => {
328
+ this.hide(e);
329
+ });
330
+ };
331
+ typeof this.uploadBefore == "function" ? this.uploadBefore(n, e, this.hide, this.column) : e();
332
+ };
333
+ if (e(n.name) !== "img") {
334
+ u();
335
+ return;
336
+ }
337
+ let d = () => {
338
+ T(this.canvasOption) ? u() : j(n, this.canvasOption, (e) => {
339
+ n = e, u();
340
+ });
341
+ };
342
+ T(this.cropperOption) ? d() : A(n, (e) => {
343
+ let t = Object.assign(this.cropperOption, {
344
+ img: e,
345
+ type: "file",
346
+ callback: (e) => {
347
+ n = e, d();
348
+ },
349
+ cancel: () => {
350
+ this.loading = !1;
351
+ }
352
+ });
353
+ this.$ImageCropper(t);
354
+ });
355
+ },
356
+ handleExceed(e, t) {
357
+ var n;
358
+ (n = this.uploadExceed) == null || n.call(this, this.limit, e, t, this.column);
359
+ },
360
+ handlePreview(e) {
361
+ let t = () => {
362
+ let t = this.fileList.findIndex((t) => t.url === e.url);
363
+ this.$ImagePreview(this.fileList, t);
364
+ };
365
+ typeof this.uploadPreview == "function" ? this.uploadPreview(e, this.column, t) : t();
366
+ },
367
+ handleDelete(e) {
368
+ this.beforeRemove(e).then(() => {
369
+ this.text = [], this.menu = !1;
370
+ });
371
+ },
372
+ beforeRemove(e) {
373
+ return typeof this.uploadDelete == "function" ? this.uploadDelete(e, this.column) : Promise.resolve();
374
+ }
375
+ }
376
+ }, B = ["element-loading-text"], V = {
377
+ key: 0,
378
+ class: "el-icon-plus"
379
+ }, H = {
380
+ key: 2,
381
+ class: "el-icon-plus avue-upload__avatar"
382
+ }, U = { class: "el-upload__text" }, W = ["innerHTML"], G = { key: 1 }, K = {
383
+ key: 1,
384
+ class: "avue-upload__avatar el-icon-document"
385
+ }, q = { class: "el-upload-list__item-actions" }, J = { class: "el-upload-list__item-preview" }, Y = ["onClick"], X = { class: "el-upload-list__item-delete" }, Z = ["onClick"], Q = ["onClick"], $ = { class: "el-upload-list__item-name" }, ee = ["onClick"], te = ["onClick"], ne = { class: "el-upload-list__item-name" }, re = ["onClick"];
386
+ function ie(e, t, n, i, a, o) {
387
+ let s = r, c = u, T = l;
388
+ return C((v(), m("div", {
389
+ class: "avue-upload",
390
+ "element-loading-text": n.loadText
391
+ }, [(v(), f(c, {
392
+ key: a.reload,
393
+ class: _({
394
+ "avue-upload--list": e.listType === "picture-img",
395
+ "avue-upload--upload": e.disabled
396
+ }),
397
+ action: n.action,
398
+ "on-remove": o.handleRemove,
399
+ accept: o.acceptList,
400
+ "before-remove": o.beforeRemove,
401
+ multiple: e.multiple,
402
+ "on-preview": o.handlePreview,
403
+ limit: n.limit,
404
+ "http-request": o.httpUpload,
405
+ readonly: e.readonly,
406
+ drag: n.dragFile,
407
+ "show-file-list": o.isPictureImg ? !1 : n.showFileList,
408
+ "list-type": e.listType,
409
+ "on-change": o.handleFileChange,
410
+ "on-exceed": o.handleExceed,
411
+ disabled: e.disabled,
412
+ "file-list": o.fileList,
413
+ onClick: e.handleClick
414
+ }, {
415
+ tip: S(() => [h("div", {
416
+ class: "el-upload__tip",
417
+ innerHTML: e.tip
418
+ }, null, 8, W)]),
419
+ file: S(({ file: n }) => [e.$slots.default ? y(e.$slots, "default", {
420
+ key: 0,
421
+ file: n
422
+ }) : e.listType === "picture-card" ? (v(), m("span", G, [o.isMediaType(n.url) ? (v(), f(b(n.type), {
423
+ key: 0,
424
+ class: "el-upload-list__item-thumbnail",
425
+ src: n.url
426
+ }, null, 8, ["src"])) : (v(), m("i", K)), h("span", q, [h("span", J, [h("i", {
427
+ class: "el-icon-zoom-in",
428
+ onClick: w((e) => o.handlePreview(n), ["stop"])
429
+ }, null, 8, Y)]), h("span", X, [e.disabled ? p("v-if", !0) : (v(), m("i", {
430
+ key: 0,
431
+ class: "el-icon-delete",
432
+ onClick: w((e) => o.handleRemove(n), ["stop"])
433
+ }, null, 8, Z))])])])) : e.listType === "picture" ? (v(), m("span", {
434
+ key: 2,
435
+ onClick: w((e) => o.handlePreview(n), ["stop"])
436
+ }, [
437
+ (v(), f(b(n.type), {
438
+ class: "el-upload-list__item-thumbnail",
439
+ src: n.url
440
+ }, null, 8, ["src"])),
441
+ h("a", $, [t[8] || (t[8] = h("i", { class: "el-icon-document" }, null, -1)), g(" " + x(n.name), 1)]),
442
+ h("i", {
443
+ class: "el-icon-close",
444
+ onClick: w((e) => o.handleRemove(n), ["stop"])
445
+ }, null, 8, ee)
446
+ ], 8, Q)) : (v(), m("span", {
447
+ key: 3,
448
+ onClick: w((e) => o.handlePreview(n), ["stop"])
449
+ }, [h("a", ne, [t[9] || (t[9] = h("i", { class: "el-icon-document" }, null, -1)), g(" " + x(n.name), 1)]), e.disabled ? p("v-if", !0) : (v(), m("i", {
450
+ key: 0,
451
+ class: "el-icon-close",
452
+ onClick: w((e) => o.handleRemove(n), ["stop"])
453
+ }, null, 8, re))], 8, te))]),
454
+ default: S(() => [e.listType === "picture-card" ? (v(), m("i", V)) : e.listType === "picture-img" ? (v(), m(d, { key: 1 }, [e.$slots.default ? y(e.$slots, "default", {
455
+ key: 0,
456
+ file: { url: o.imgUrl }
457
+ }) : (v(), m(d, { key: 1 }, [o.isMediaType(o.imgUrl) ? (v(), f(b(o.isMediaType(o.imgUrl)), {
458
+ key: 0,
459
+ src: o.imgUrl,
460
+ class: "avue-upload__avatar",
461
+ onMouseover: t[0] || (t[0] = (e) => a.menu = !0)
462
+ }, null, 40, ["src"])) : o.imgUrl ? (v(), m("i", {
463
+ key: 1,
464
+ class: "avue-upload__avatar el-icon-document",
465
+ onMouseover: t[1] || (t[1] = (e) => a.menu = !0)
466
+ }, null, 32)) : (v(), m("i", H)), a.menu ? (v(), m("div", {
467
+ key: 3,
468
+ class: "el-upload-list__item-actions avue-upload__menu",
469
+ onMouseover: t[4] || (t[4] = (e) => a.menu = !0),
470
+ onMouseout: t[5] || (t[5] = (e) => a.menu = !1),
471
+ onClick: t[6] || (t[6] = w(() => {}, ["stop"]))
472
+ }, [h("i", {
473
+ class: "el-icon-zoom-in",
474
+ onClick: t[2] || (t[2] = w((e) => o.handlePreview({ url: o.imgUrl }), ["stop"]))
475
+ }), e.disabled ? p("v-if", !0) : (v(), m("i", {
476
+ key: 0,
477
+ class: "el-icon-delete",
478
+ onClick: t[3] || (t[3] = w((e) => o.handleDelete(o.imgUrl), ["stop"]))
479
+ }))], 32)) : p("v-if", !0)], 64))], 64)) : n.dragFile ? (v(), m(d, { key: 2 }, [t[7] || (t[7] = h("i", { class: "el-icon-upload" }, null, -1)), h("div", U, [h("em", null, x(n.fileText || "上传"), 1)])], 64)) : (v(), f(s, {
480
+ key: 3,
481
+ icon: "el-icon-upload",
482
+ size: e.size,
483
+ type: "primary"
484
+ }, {
485
+ default: S(() => [g(x(n.fileText || "上传"), 1)]),
486
+ _: 1
487
+ }, 8, ["size"]))]),
488
+ _: 3
489
+ }, 8, [
490
+ "class",
491
+ "action",
492
+ "on-remove",
493
+ "accept",
494
+ "before-remove",
495
+ "multiple",
496
+ "on-preview",
497
+ "limit",
498
+ "http-request",
499
+ "readonly",
500
+ "drag",
501
+ "show-file-list",
502
+ "list-type",
503
+ "on-change",
504
+ "on-exceed",
505
+ "disabled",
506
+ "file-list",
507
+ "onClick"
508
+ ]))], 8, B)), [[
509
+ T,
510
+ a.loading,
511
+ void 0,
512
+ { lock: !0 }
513
+ ]]);
514
+ }
515
+ var ae = /* @__PURE__ */ t(z, [["render", ie]]);
516
+ //#endregion
517
+ export { ae as t };
@@ -1,12 +1,12 @@
1
1
  import { t as e } from "./B1MSrc6f.mjs";
2
- import { i as t, n } from "./BAG_R87k2.mjs";
2
+ import { i as t, n } from "./CZnwC17w.mjs";
3
3
  import { ElForm as r, ElFormItem as i, ElInput as a, ElOption as o, ElSelect as s, ElSwitch as c } from "element-plus/es";
4
4
  import "element-plus/es/components/base/style/css";
5
5
  import "element-plus/es/components/input/style/css";
6
6
  import { Fragment as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createVNode as p, openBlock as m, renderList as h, withCtx as g, withModifiers as _ } from "vue";
7
7
  import { fastClone as v } from "@web-utils/core";
8
- import "element-plus/es/components/form-item/style/css";
9
8
  import "element-plus/es/components/form/style/css";
9
+ import "element-plus/es/components/form-item/style/css";
10
10
  import "element-plus/es/components/select/style/css";
11
11
  import "element-plus/es/components/option/style/css";
12
12
  import "element-plus/es/components/switch/style/css";