asiaint-lowcode 2.0.0 → 2.0.2

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 (36) hide show
  1. package/README.md +0 -73
  2. package/dist/asiaint-lowcode.js +12 -0
  3. package/dist/asiaint-lowcode.umd.cjs +1579 -0
  4. package/dist/index.d.ts +528 -0
  5. package/dist/lazy/Card-op6i_z8G.js +46 -0
  6. package/dist/lazy/Cascader-cy25S0M_.js +41 -0
  7. package/dist/lazy/Checkbox-CQ56BycM.js +75 -0
  8. package/dist/lazy/Collapse-DXETETv8.js +54 -0
  9. package/dist/lazy/ColorInput-Ox5qD0YJ.js +28 -0
  10. package/dist/lazy/Component-BEqoz5jH.js +321 -0
  11. package/dist/lazy/Component-BLahI--2.js +117 -0
  12. package/dist/lazy/Component-C69_b7D6.js +97 -0
  13. package/dist/lazy/Component-CcwERaPj.js +27 -0
  14. package/dist/lazy/Component-DO63yabq.js +66 -0
  15. package/dist/lazy/Component-DhFx0wp3.js +13 -0
  16. package/dist/lazy/Component-IxyabXCT.js +24 -0
  17. package/dist/lazy/Custom-D7E3J-kY.js +26 -0
  18. package/dist/lazy/DatePicker-B565iRox.js +11 -0
  19. package/dist/lazy/Divider-2PVfgKTw.js +21 -0
  20. package/dist/lazy/FormList-BAk7pGQ5.js +199 -0
  21. package/dist/lazy/Grid-CQ3I3JJA.js +30 -0
  22. package/dist/lazy/Inline-DqNMJ75M.js +30 -0
  23. package/dist/lazy/JsonEdit-j4lAk68A.js +16385 -0
  24. package/dist/lazy/ObjGroup-CKy7PIXn.js +32 -0
  25. package/dist/lazy/Radio-Cv3X53D3.js +77 -0
  26. package/dist/lazy/SearchSelect-BkYukJim.js +86 -0
  27. package/dist/lazy/Select-MM2rUOPj.js +67 -0
  28. package/dist/lazy/Tabs-BVFfJAUT.js +47 -0
  29. package/dist/lazy/Tag-YpWlcGOi.js +22 -0
  30. package/dist/lazy/TextArea-KNtWavU4.js +25 -0
  31. package/dist/lazy/Title-32bZDihB.js +4 -0
  32. package/dist/lazy/Title.vue_vue_type_script_setup_true_lang-Ceco_9-w.js +23 -0
  33. package/dist/lazy/index-DoIvJXpY.js +22488 -0
  34. package/dist/lazy/useSelect-DkY4BS54.js +50 -0
  35. package/dist/style.css +6 -0
  36. package/package.json +1 -1
@@ -0,0 +1,54 @@
1
+ import { defineComponent as u, ref as f, onMounted as _, watch as h, resolveComponent as c, openBlock as o, createBlock as i, mergeProps as C, withCtx as r, createElementBlock as E, Fragment as k, renderList as v, createVNode as m, unref as V } from "vue";
2
+ import { a as y } from "./index-DoIvJXpY.js";
3
+ import "element-plus";
4
+ import { _ as B } from "./Title.vue_vue_type_script_setup_true_lang-Ceco_9-w.js";
5
+ const x = /* @__PURE__ */ u({
6
+ __name: "Collapse",
7
+ props: {
8
+ children: {}
9
+ },
10
+ setup(s) {
11
+ const t = s, n = f([]);
12
+ return _(() => {
13
+ n.value = t.children.filter((e) => e.checked).map((e) => e.name);
14
+ }), h(
15
+ () => t.children,
16
+ () => {
17
+ t.children.forEach((e) => {
18
+ e.children || (e.children = []);
19
+ });
20
+ }
21
+ ), (e, a) => {
22
+ const p = c("ElCollapseItem"), d = c("ElCollapse");
23
+ return o(), i(d, C(e.$attrs, {
24
+ modelValue: n.value,
25
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => n.value = l)
26
+ }), {
27
+ default: r(() => [
28
+ (o(!0), E(k, null, v(e.children, (l) => (o(), i(p, {
29
+ key: l.name,
30
+ name: l.name
31
+ }, {
32
+ title: r(() => [
33
+ m(B, {
34
+ title: l.title,
35
+ italic: "",
36
+ type: "h4"
37
+ }, null, 8, ["title"])
38
+ ]),
39
+ default: r(() => [
40
+ m(V(y), {
41
+ list: l.children
42
+ }, null, 8, ["list"])
43
+ ]),
44
+ _: 2
45
+ }, 1032, ["name"]))), 128))
46
+ ]),
47
+ _: 1
48
+ }, 16, ["modelValue"]);
49
+ };
50
+ }
51
+ });
52
+ export {
53
+ x as default
54
+ };
@@ -0,0 +1,28 @@
1
+ import { defineComponent as m, useModel as p, resolveComponent as n, openBlock as r, createElementBlock as s, createVNode as t } from "vue";
2
+ const c = { class: "vfc-color-input" }, V = /* @__PURE__ */ m({
3
+ __name: "ColorInput",
4
+ props: {
5
+ modelValue: {},
6
+ modelModifiers: {}
7
+ },
8
+ emits: ["update:modelValue"],
9
+ setup(u) {
10
+ const e = p(u, "modelValue");
11
+ return (i, o) => {
12
+ const a = n("el-input"), d = n("el-color-picker");
13
+ return r(), s("div", c, [
14
+ t(a, {
15
+ modelValue: e.value,
16
+ "onUpdate:modelValue": o[0] || (o[0] = (l) => e.value = l)
17
+ }, null, 8, ["modelValue"]),
18
+ t(d, {
19
+ modelValue: e.value,
20
+ "onUpdate:modelValue": o[1] || (o[1] = (l) => e.value = l)
21
+ }, null, 8, ["modelValue"])
22
+ ]);
23
+ };
24
+ }
25
+ });
26
+ export {
27
+ V as default
28
+ };
@@ -0,0 +1,321 @@
1
+ import { defineComponent as $, ref as v, computed as N, watch as L, onMounted as x, onBeforeUnmount as F, openBlock as T, createElementBlock as E, mergeModels as J, useModel as A, resolveComponent as G, unref as W, createElementVNode as P, createBlock as X, withCtx as D, createTextVNode as I, createCommentVNode as Y, createVNode as R } from "vue";
2
+ import { b as H, u as K, c as Q } from "./index-DoIvJXpY.js";
3
+ import "element-plus";
4
+ const Z = $({
5
+ props: {
6
+ width: {
7
+ type: Number,
8
+ default: 800
9
+ },
10
+ height: {
11
+ type: Number,
12
+ default: 300
13
+ },
14
+ lineWidth: {
15
+ type: Number,
16
+ default: 4
17
+ },
18
+ lineColor: {
19
+ type: String,
20
+ default: "#000000"
21
+ },
22
+ bgColor: {
23
+ type: String,
24
+ default: ""
25
+ },
26
+ isCrop: {
27
+ type: Boolean,
28
+ default: !1
29
+ },
30
+ isClearBgColor: {
31
+ type: Boolean,
32
+ default: !1
33
+ },
34
+ format: {
35
+ type: String,
36
+ default: "image/png"
37
+ },
38
+ quality: {
39
+ type: Number,
40
+ default: 1
41
+ }
42
+ },
43
+ setup(a) {
44
+ const n = v(!1), c = v(""), d = v([]), t = v(null), g = v(0), o = v(0), C = v(!1), f = v(1), l = v(null), S = N(() => a.height / a.width), u = N(() => a.bgColor ? a.bgColor : "rgba(255, 255, 255, 0)");
45
+ L(u, (e) => {
46
+ l.value && (l.value.style.background = e);
47
+ });
48
+ const s = () => {
49
+ if (l.value) {
50
+ l.value.style.width = `${a.width}px`;
51
+ const e = parseFloat(window.getComputedStyle(l.value).width);
52
+ l.value.style.height = `${S.value * e}px`, t.value = l.value.getContext("2d"), t.value && (t.value.scale(1 * f.value, 1 * f.value), f.value = e / a.width, t.value.scale(1 / f.value, 1 / f.value));
53
+ }
54
+ };
55
+ x(() => {
56
+ l.value && (l.value.height = a.height, l.value.width = a.width, l.value.style.background = u.value, s(), document.onmouseup = () => {
57
+ C.value = !1;
58
+ }), window.addEventListener("resize", s);
59
+ }), F(() => {
60
+ window.removeEventListener("resize", s);
61
+ });
62
+ const m = (e) => {
63
+ g.value = e.x, o.value = e.y, t.value && (t.value.beginPath(), t.value.moveTo(g.value, o.value), t.value.lineTo(e.x, e.y), t.value.lineCap = "round", t.value.lineJoin = "round", t.value.lineWidth = a.lineWidth * f.value, t.value.stroke(), t.value.closePath(), d.value.push(e));
64
+ }, y = (e) => {
65
+ t.value && (t.value.beginPath(), t.value.moveTo(g.value, o.value), t.value.lineTo(e.x, e.y), t.value.strokeStyle = a.lineColor, t.value.lineWidth = a.lineWidth * f.value, t.value.lineCap = "round", t.value.lineJoin = "round", t.value.stroke(), t.value.closePath(), o.value = e.y, g.value = e.x, d.value.push(e));
66
+ }, V = (e) => {
67
+ t.value && (t.value.beginPath(), t.value.moveTo(g.value, o.value), t.value.lineTo(e.x, e.y), t.value.lineCap = "round", t.value.lineJoin = "round", t.value.stroke(), t.value.closePath(), d.value.push(e), d.value.push({ x: -1, y: -1 }));
68
+ }, U = (e) => {
69
+ const i = (e == null ? void 0 : e.format) || a.format, b = (e == null ? void 0 : e.quality) || a.quality;
70
+ return new Promise((k, B) => {
71
+ if (!n.value) {
72
+ B("Warning: Not Signed!");
73
+ return;
74
+ }
75
+ if (t.value) {
76
+ const h = t.value.getImageData(0, 0, l.value.width, l.value.height);
77
+ t.value.globalCompositeOperation = "destination-over", t.value.fillStyle = u.value, t.value.fillRect(0, 0, l.value.width, l.value.height), c.value = l.value.toDataURL(i, b);
78
+ let p = c.value;
79
+ if (t.value.clearRect(0, 0, l.value.width, l.value.height), t.value.putImageData(h, 0, 0), t.value.globalCompositeOperation = "source-over", a.isCrop) {
80
+ const r = q(h.data), w = document.createElement("canvas"), M = w.getContext("2d");
81
+ if (M) {
82
+ w.width = r[2] - r[0], w.height = r[3] - r[1];
83
+ const z = t.value.getImageData(r[0], r[1], r[2], r[3]);
84
+ M.globalCompositeOperation = "destination-over", M.putImageData(z, 0, 0), M.fillStyle = u.value, M.fillRect(0, 0, w.width, w.height), p = w.toDataURL(i, b);
85
+ }
86
+ }
87
+ k(p);
88
+ }
89
+ });
90
+ }, O = () => {
91
+ t.value && t.value.clearRect(0, 0, l.value.width, l.value.height), a.isClearBgColor && (d.value = [], n.value = !1, c.value = "");
92
+ }, q = (e) => {
93
+ let i = l.value.width, b = 0, k = l.value.height, B = 0;
94
+ for (let h = 0; h < l.value.width; h++)
95
+ for (let p = 0; p < l.value.height; p++) {
96
+ const r = (h + l.value.width * p) * 4;
97
+ (e[r] > 0 || e[r + 1] > 0 || e[r + 2] > 0 || e[r + 3] > 0) && (B = Math.max(p, B), b = Math.max(h, b), k = Math.min(p, k), i = Math.min(h, i));
98
+ }
99
+ return [i + 1, k + 1, b + 1, B + 1];
100
+ };
101
+ return {
102
+ canvas: l,
103
+ myBg: u,
104
+ drawStart: m,
105
+ drawMove: y,
106
+ drawEnd: V,
107
+ generate: U,
108
+ reset: O,
109
+ touchStart: (e) => {
110
+ if (e.preventDefault(), n.value = !0, e.touches.length === 1 && l.value) {
111
+ const i = {
112
+ x: e.targetTouches[0].clientX - l.value.getBoundingClientRect().left,
113
+ y: e.targetTouches[0].clientY - l.value.getBoundingClientRect().top
114
+ };
115
+ m(i);
116
+ }
117
+ },
118
+ touchMove: (e) => {
119
+ if (e.preventDefault(), e.touches.length === 1) {
120
+ const i = {
121
+ x: e.targetTouches[0].clientX - l.value.getBoundingClientRect().left,
122
+ y: e.targetTouches[0].clientY - l.value.getBoundingClientRect().top
123
+ };
124
+ y(i);
125
+ }
126
+ },
127
+ touchEnd: (e) => {
128
+ if (e.preventDefault(), e.touches.length === 1) {
129
+ const i = {
130
+ x: e.targetTouches[0].clientX - l.value.getBoundingClientRect().left,
131
+ y: e.targetTouches[0].clientY - l.value.getBoundingClientRect().top
132
+ };
133
+ V(i);
134
+ }
135
+ },
136
+ mouseDown: (e) => {
137
+ e.preventDefault(), C.value = !0, n.value = !0;
138
+ const i = {
139
+ x: e.offsetX,
140
+ y: e.offsetY
141
+ };
142
+ m(i);
143
+ },
144
+ mouseMove: (e) => {
145
+ if (e.preventDefault(), C.value) {
146
+ const i = {
147
+ x: e.offsetX,
148
+ y: e.offsetY
149
+ };
150
+ y(i);
151
+ }
152
+ },
153
+ mouseUp: (e) => {
154
+ e.preventDefault();
155
+ const i = {
156
+ x: e.offsetX,
157
+ y: e.offsetY
158
+ };
159
+ V(i), C.value = !1;
160
+ }
161
+ };
162
+ }
163
+ });
164
+ function j(a, n, c, d, t, g) {
165
+ return T(), E("canvas", {
166
+ ref: "canvas",
167
+ onMousedown: n[0] || (n[0] = (...o) => a.mouseDown && a.mouseDown(...o)),
168
+ onMousemove: n[1] || (n[1] = (...o) => a.mouseMove && a.mouseMove(...o)),
169
+ onMouseup: n[2] || (n[2] = (...o) => a.mouseUp && a.mouseUp(...o)),
170
+ onTouchstart: n[3] || (n[3] = (...o) => a.touchStart && a.touchStart(...o)),
171
+ onTouchmove: n[4] || (n[4] = (...o) => a.touchMove && a.touchMove(...o)),
172
+ onTouchend: n[5] || (n[5] = (...o) => a.touchEnd && a.touchEnd(...o))
173
+ }, null, 544);
174
+ }
175
+ const _ = /* @__PURE__ */ H(Z, [["render", j], ["__scopeId", "data-v-0e272b28"]]), ee = { key: 0 }, te = { class: "vfc-esign-preview" }, le = ["src"], ae = {
176
+ key: 1,
177
+ class: "vfc-esign"
178
+ }, ie = /* @__PURE__ */ $({
179
+ __name: "Component",
180
+ props: /* @__PURE__ */ J({
181
+ lineWidth: { default: 6 },
182
+ lineColor: { default: "#000000" },
183
+ bgColor: { default: "#f6f6f6" },
184
+ isCrop: { type: Boolean, default: !1 },
185
+ width: { default: 700 },
186
+ height: { default: 300 },
187
+ disabled: { type: Boolean },
188
+ format: { default: "image/png" }
189
+ }, {
190
+ modelValue: {},
191
+ modelModifiers: {}
192
+ }),
193
+ emits: ["update:modelValue"],
194
+ setup(a) {
195
+ const n = a, c = v(), d = K(), t = A(a, "modelValue"), g = {
196
+ size: "small",
197
+ labelPosition: "right",
198
+ items: [
199
+ {
200
+ component: "Inline",
201
+ children: [
202
+ {
203
+ label: "画笔粗细",
204
+ component: "InputNumber",
205
+ name: "lineWidth",
206
+ props: {
207
+ controlsPosition: "right"
208
+ }
209
+ },
210
+ { label: "画笔颜色", component: "ColorPicker", name: "lineColor" },
211
+ { label: "画板背景色", component: "ColorPicker", name: "bgColor" }
212
+ ],
213
+ props: {
214
+ align: "left",
215
+ gap: 20
216
+ },
217
+ designKey: "design-ZuIT",
218
+ name: "form-OqAi",
219
+ style: {
220
+ marginBottom: "10px"
221
+ }
222
+ }
223
+ ]
224
+ }, o = v({
225
+ lineWidth: 6,
226
+ lineColor: "#000000",
227
+ bgColor: "#fff"
228
+ }), C = () => {
229
+ c.value.reset();
230
+ }, f = () => {
231
+ c.value.generate().then((u) => {
232
+ t.value = u;
233
+ }).catch((u) => {
234
+ alert(u);
235
+ });
236
+ }, l = v(""), S = () => {
237
+ l.value = t.value, t.value = "";
238
+ };
239
+ return x(() => {
240
+ Object.assign(o.value, n);
241
+ }), (u, s) => {
242
+ const m = G("el-button");
243
+ return W(d).read || t.value ? (T(), E("div", ee, [
244
+ P("div", te, [
245
+ P("img", {
246
+ src: t.value,
247
+ alt: "未签名"
248
+ }, null, 8, le)
249
+ ]),
250
+ W(d).read ? Y("", !0) : (T(), X(m, {
251
+ key: 0,
252
+ disabled: u.disabled,
253
+ onClick: S,
254
+ type: "primary"
255
+ }, {
256
+ default: D(() => s[2] || (s[2] = [
257
+ I("重写")
258
+ ])),
259
+ _: 1
260
+ }, 8, ["disabled"]))
261
+ ])) : (T(), E("div", ae, [
262
+ R(W(Q), {
263
+ modelValue: o.value,
264
+ "onUpdate:modelValue": s[0] || (s[0] = (y) => o.value = y),
265
+ schema: g,
266
+ class: "vfc-esign-actions"
267
+ }, null, 8, ["modelValue"]),
268
+ R(_, {
269
+ class: "vfc-esign-canvas",
270
+ ref_key: "esign",
271
+ ref: c,
272
+ width: u.width,
273
+ height: u.height,
274
+ isCrop: u.isCrop,
275
+ lineWidth: o.value.lineWidth,
276
+ lineColor: o.value.lineColor,
277
+ bgColor: o.value.bgColor,
278
+ format: u.format
279
+ }, null, 8, ["width", "height", "isCrop", "lineWidth", "lineColor", "bgColor", "format"]),
280
+ P("div", null, [
281
+ l.value ? (T(), X(m, {
282
+ key: 0,
283
+ disabled: u.disabled,
284
+ onClick: s[1] || (s[1] = (y) => t.value = l.value),
285
+ plain: "",
286
+ type: "primary"
287
+ }, {
288
+ default: D(() => s[3] || (s[3] = [
289
+ I("取消")
290
+ ])),
291
+ _: 1
292
+ }, 8, ["disabled"])) : Y("", !0),
293
+ R(m, {
294
+ disabled: u.disabled,
295
+ onClick: C,
296
+ plain: "",
297
+ type: "primary"
298
+ }, {
299
+ default: D(() => s[4] || (s[4] = [
300
+ I("清空")
301
+ ])),
302
+ _: 1
303
+ }, 8, ["disabled"]),
304
+ R(m, {
305
+ disabled: u.disabled,
306
+ onClick: f,
307
+ type: "primary"
308
+ }, {
309
+ default: D(() => s[5] || (s[5] = [
310
+ I("保存")
311
+ ])),
312
+ _: 1
313
+ }, 8, ["disabled"])
314
+ ])
315
+ ]));
316
+ };
317
+ }
318
+ });
319
+ export {
320
+ ie as default
321
+ };
@@ -0,0 +1,117 @@
1
+ var u = Object.defineProperty;
2
+ var m = (o, e, t) => e in o ? u(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var a = (o, e, t) => m(o, typeof e != "symbol" ? e + "" : e, t);
4
+ import { defineComponent as g, mergeModels as v, useModel as I, ref as c, onMounted as w, resolveComponent as C, openBlock as y, createElementBlock as _, createVNode as V, createElementVNode as M } from "vue";
5
+ import { u as b, b as x } from "./index-DoIvJXpY.js";
6
+ import "element-plus";
7
+ function S() {
8
+ return "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z".split(",");
9
+ }
10
+ function s(o, e) {
11
+ return Math.floor(Math.random() * (e - o) + o);
12
+ }
13
+ function d(o, e) {
14
+ const t = s(o, e), i = s(o, e), n = s(o, e);
15
+ return `rgb(${t},${i},${n})`;
16
+ }
17
+ class A {
18
+ constructor(e, t) {
19
+ a(this, "version", "1.0.0");
20
+ a(this, "options");
21
+ a(this, "_init", () => {
22
+ const e = this.options.element;
23
+ if (!e) return;
24
+ const t = document.createElement("canvas");
25
+ this.options.width = e.offsetWidth > 0 ? e.offsetWidth.toString() : "100", this.options.height = e.offsetHeight > 0 ? e.offsetHeight.toString() : "30", t.id = this.options.canvasId, t.width = parseInt(this.options.width), t.height = parseInt(this.options.height), t.style.cursor = "pointer", t.innerHTML = "您的浏览器版本不支持canvas", e.appendChild(t), t.onclick = () => {
26
+ this.refresh();
27
+ };
28
+ });
29
+ a(this, "refresh", () => {
30
+ this.options.code = "";
31
+ const e = document.getElementById(this.options.canvasId);
32
+ if (!e || !e.getContext)
33
+ return;
34
+ const t = e.getContext("2d");
35
+ t.textBaseline = "middle", t.fillStyle = d(180, 240), t.fillRect(0, 0, parseInt(this.options.width), parseInt(this.options.height));
36
+ let i;
37
+ this.options.type === "blend" ? i = [...this.options.numArr, ...this.options.letterArr] : this.options.type === "number" ? i = this.options.numArr : i = this.options.letterArr;
38
+ for (let n = 1; n <= 4; n++) {
39
+ const h = i[s(0, i.length)];
40
+ this.options.code += h, t.font = `${s(parseInt(this.options.height) / 2, parseInt(this.options.height))}px SimHei`, t.fillStyle = d(50, 160), t.shadowOffsetX = s(-3, 3), t.shadowOffsetY = s(-3, 3), t.shadowBlur = s(-3, 3), t.shadowColor = "rgba(0, 0, 0, 0.3)";
41
+ const l = parseInt(this.options.width) / 5 * n, r = parseInt(this.options.height) / 2, p = s(-30, 30);
42
+ t.translate(l, r), t.rotate(p * Math.PI / 180), t.fillText(h, 0, 0), t.rotate(-p * Math.PI / 180), t.translate(-l, -r);
43
+ }
44
+ for (let n = 0; n < 4; n++)
45
+ t.strokeStyle = d(40, 180), t.beginPath(), t.moveTo(
46
+ s(0, parseInt(this.options.width)),
47
+ s(0, parseInt(this.options.height))
48
+ ), t.lineTo(
49
+ s(0, parseInt(this.options.width)),
50
+ s(0, parseInt(this.options.height))
51
+ ), t.stroke();
52
+ for (let n = 0; n < parseInt(this.options.width) / 4; n++)
53
+ t.fillStyle = d(0, 255), t.beginPath(), t.arc(
54
+ s(0, parseInt(this.options.width)),
55
+ s(0, parseInt(this.options.height)),
56
+ 1,
57
+ 0,
58
+ 2 * Math.PI
59
+ ), t.fill();
60
+ });
61
+ a(this, "validate", (e) => {
62
+ const t = e.toLowerCase(), i = this.options.code.toLowerCase();
63
+ return console.log(i), t === i ? !0 : (this.refresh(), !1);
64
+ });
65
+ this.options = {
66
+ element: null,
67
+ canvasId: "verifyCanvas",
68
+ width: "100",
69
+ height: "30",
70
+ type: "blend",
71
+ code: "",
72
+ numArr: "0,1,2,3,4,5,6,7,8,9".split(","),
73
+ letterArr: S(),
74
+ ...t
75
+ }, e && (this.options.element = e, this._init(), this.refresh());
76
+ }
77
+ }
78
+ const P = { class: "vfc-verify-code" }, k = /* @__PURE__ */ g({
79
+ __name: "Component",
80
+ props: /* @__PURE__ */ v({
81
+ placeholder: {}
82
+ }, {
83
+ modelValue: {},
84
+ modelModifiers: {}
85
+ }),
86
+ emits: ["update:modelValue"],
87
+ setup(o) {
88
+ const e = I(o, "modelValue"), t = c(null), i = c(null), n = b(), h = () => {
89
+ var r;
90
+ if (!e.value) return;
91
+ const l = (r = i.value) == null ? void 0 : r.validate(e.value);
92
+ console.log("res", l), l ? n.updateVCodePass(!0) : n.updateVCodePass(!1);
93
+ };
94
+ return w(() => {
95
+ i.value = new A(t.value);
96
+ }), (l, r) => {
97
+ const p = C("el-input");
98
+ return y(), _("div", P, [
99
+ V(p, {
100
+ modelValue: e.value,
101
+ "onUpdate:modelValue": r[0] || (r[0] = (f) => e.value = f),
102
+ class: "verify-input",
103
+ placeholder: l.placeholder,
104
+ onBlur: h
105
+ }, null, 8, ["modelValue", "placeholder"]),
106
+ M("div", {
107
+ class: "verify-code",
108
+ ref_key: "codeEl",
109
+ ref: t
110
+ }, null, 512)
111
+ ]);
112
+ };
113
+ }
114
+ }), T = /* @__PURE__ */ x(k, [["__scopeId", "data-v-f5206e68"]]);
115
+ export {
116
+ T as default
117
+ };
@@ -0,0 +1,97 @@
1
+ import { defineComponent as b, mergeModels as V, useModel as B, resolveComponent as d, openBlock as l, createBlock as n, createSlots as C, withCtx as a, createElementBlock as m, Fragment as w, createVNode as E, unref as r, createElementVNode as o, createTextVNode as i, toDisplayString as p, createCommentVNode as u } from "vue";
2
+ import { ElMessage as M, ElMessageBox as N } from "element-plus";
3
+ import { _ as f } from "./index-DoIvJXpY.js";
4
+ const $ = {
5
+ key: 0,
6
+ style: { "min-width": "300px" }
7
+ }, F = { class: "el-upload__tip" }, x = /* @__PURE__ */ b({
8
+ __name: "Component",
9
+ props: /* @__PURE__ */ V({
10
+ action: {},
11
+ multiple: { type: Boolean },
12
+ btnText: { default: "点击上传" },
13
+ tip: {},
14
+ limit: { default: 3 },
15
+ drag: { type: Boolean },
16
+ name: { default: "file" },
17
+ listType: { default: "text" }
18
+ }, {
19
+ modelValue: {
20
+ default: () => []
21
+ },
22
+ modelModifiers: {}
23
+ }),
24
+ emits: ["update:modelValue"],
25
+ setup(c) {
26
+ const s = B(c, "modelValue"), y = (e, t) => {
27
+ console.log(e, t);
28
+ }, g = (e) => {
29
+ console.log(e);
30
+ }, v = (e, t) => {
31
+ M.warning(
32
+ `The limit is 3, you selected ${e.length} files this time, add up to ${e.length + t.length} totally`
33
+ );
34
+ }, h = (e, t) => N.confirm(`Cancel the transfer of ${e.name} ?`).then(
35
+ () => !0,
36
+ () => !1
37
+ );
38
+ return (e, t) => {
39
+ const T = d("el-button"), _ = d("el-upload");
40
+ return l(), n(_, {
41
+ "file-list": s.value,
42
+ "onUpdate:fileList": t[0] || (t[0] = (k) => s.value = k),
43
+ action: e.action,
44
+ multiple: e.multiple,
45
+ limit: e.limit,
46
+ drag: e.drag,
47
+ name: e.name,
48
+ listType: e.listType,
49
+ "on-preview": g,
50
+ "on-remove": y,
51
+ "before-remove": h,
52
+ "on-exceed": v
53
+ }, C({
54
+ default: a(() => [
55
+ e.listType === "text" ? (l(), m(w, { key: 0 }, [
56
+ e.drag ? (l(), m("div", $, [
57
+ E(r(f), {
58
+ class: "el-icon--upload",
59
+ name: "upload"
60
+ }),
61
+ t[1] || (t[1] = o("div", { class: "el-upload__text" }, [
62
+ i(" 拖拽文件到此处上传 "),
63
+ o("br"),
64
+ i(" 或"),
65
+ o("em", null, "点击上传")
66
+ ], -1))
67
+ ])) : (l(), n(T, {
68
+ key: 1,
69
+ type: "primary"
70
+ }, {
71
+ default: a(() => [
72
+ i(p(e.btnText), 1)
73
+ ]),
74
+ _: 1
75
+ }))
76
+ ], 64)) : u("", !0),
77
+ e.listType === "picture-card" ? (l(), n(r(f), {
78
+ key: 1,
79
+ name: "add"
80
+ })) : u("", !0)
81
+ ]),
82
+ _: 2
83
+ }, [
84
+ e.tip ? {
85
+ name: "tip",
86
+ fn: a(() => [
87
+ o("div", F, p(e.tip), 1)
88
+ ]),
89
+ key: "0"
90
+ } : void 0
91
+ ]), 1032, ["file-list", "action", "multiple", "limit", "drag", "name", "listType"]);
92
+ };
93
+ }
94
+ });
95
+ export {
96
+ x as default
97
+ };
@@ -0,0 +1,27 @@
1
+ import { defineComponent as d, mergeModels as m, useModel as r, resolveComponent as u, openBlock as p, createBlock as i, mergeProps as c, unref as f } from "vue";
2
+ import { u as V } from "./index-DoIvJXpY.js";
3
+ import "element-plus";
4
+ const B = /* @__PURE__ */ d({
5
+ __name: "Component",
6
+ props: /* @__PURE__ */ m({
7
+ disabled: { type: Boolean }
8
+ }, {
9
+ modelValue: {},
10
+ modelModifiers: {}
11
+ }),
12
+ emits: ["update:modelValue"],
13
+ setup(n) {
14
+ const t = V(), e = r(n, "modelValue");
15
+ return (o, l) => {
16
+ const a = u("el-switch");
17
+ return p(), i(a, c(o.$attrs, {
18
+ modelValue: e.value,
19
+ "onUpdate:modelValue": l[0] || (l[0] = (s) => e.value = s),
20
+ disabled: f(t).read || o.disabled
21
+ }), null, 16, ["modelValue", "disabled"]);
22
+ };
23
+ }
24
+ });
25
+ export {
26
+ B as default
27
+ };