asiaint-lowcode 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asiaint-lowcode.js +12 -0
- package/dist/asiaint-lowcode.umd.cjs +1579 -0
- package/dist/index.d.ts +621 -0
- package/dist/lazy/Card---AoXvYS.js +46 -0
- package/dist/lazy/Cascader-BR70LGn1.js +41 -0
- package/dist/lazy/Checkbox-BkN59USC.js +75 -0
- package/dist/lazy/Collapse-Dm754krv.js +54 -0
- package/dist/lazy/ColorInput-Ox5qD0YJ.js +28 -0
- package/dist/lazy/Component-6kccf2p2.js +24 -0
- package/dist/lazy/Component-DF4pvvy0.js +97 -0
- package/dist/lazy/Component-DJQM5OQV.js +27 -0
- package/dist/lazy/Component-DO63yabq.js +66 -0
- package/dist/lazy/Component-DT__xEY1.js +117 -0
- package/dist/lazy/Component-DhFx0wp3.js +13 -0
- package/dist/lazy/Component-wdoYPdpq.js +321 -0
- package/dist/lazy/Custom-D5IoN5_M.js +26 -0
- package/dist/lazy/DatePicker-DuIm95j0.js +11 -0
- package/dist/lazy/Divider-2PVfgKTw.js +21 -0
- package/dist/lazy/FormList-BjQT7shp.js +199 -0
- package/dist/lazy/Grid-BovYqDr-.js +30 -0
- package/dist/lazy/Inline-Cv5LyrT1.js +30 -0
- package/dist/lazy/JsonEdit-Dp7eAHK0.js +16385 -0
- package/dist/lazy/ObjGroup-DT4UeHtF.js +32 -0
- package/dist/lazy/Radio-P_nuE_Fb.js +77 -0
- package/dist/lazy/SearchSelect-Tec35-Iy.js +86 -0
- package/dist/lazy/Select-CnMIf_86.js +67 -0
- package/dist/lazy/Tabs-C7dXurre.js +47 -0
- package/dist/lazy/Tag-YpWlcGOi.js +22 -0
- package/dist/lazy/TextArea-DW5pxGGU.js +25 -0
- package/dist/lazy/Title-32bZDihB.js +4 -0
- package/dist/lazy/Title.vue_vue_type_script_setup_true_lang-Ceco_9-w.js +23 -0
- package/dist/lazy/index-C9fXRITB.js +22456 -0
- package/dist/lazy/useSelect-DvhNm7sS.js +50 -0
- package/dist/style.css +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { defineComponent as w, mergeModels as B, useModel as D, watch as M, resolveComponent as u, resolveDirective as F, unref as a, openBlock as l, createElementBlock as n, toDisplayString as I, Fragment as d, createCommentVNode as i, withDirectives as S, createBlock as s, mergeProps as j, withCtx as f, renderList as h } from "vue";
|
|
2
|
+
import "element-plus";
|
|
3
|
+
import { u as E } from "./index-C9fXRITB.js";
|
|
4
|
+
import { u as L } from "./useSelect-DvhNm7sS.js";
|
|
5
|
+
const N = { key: 0 }, O = {
|
|
6
|
+
key: 0,
|
|
7
|
+
style: { "font-size": "12px" }
|
|
8
|
+
}, A = /* @__PURE__ */ w({
|
|
9
|
+
__name: "Checkbox",
|
|
10
|
+
props: /* @__PURE__ */ B({
|
|
11
|
+
options: { default: () => [] },
|
|
12
|
+
mode: { default: "static" },
|
|
13
|
+
labelKey: { default: "label" },
|
|
14
|
+
valueKey: { default: "value" },
|
|
15
|
+
disabledKey: {},
|
|
16
|
+
api: {},
|
|
17
|
+
name: { default: "" },
|
|
18
|
+
onChange: {},
|
|
19
|
+
optionType: { default: "circle" },
|
|
20
|
+
direction: { default: "horizontal" },
|
|
21
|
+
space: { default: 20 }
|
|
22
|
+
}, {
|
|
23
|
+
modelValue: {},
|
|
24
|
+
modelModifiers: {}
|
|
25
|
+
}),
|
|
26
|
+
emits: ["update:modelValue"],
|
|
27
|
+
setup(p) {
|
|
28
|
+
const k = p, t = D(p, "modelValue"), g = E(), { currentOptions: r, selectChange: c, loading: m } = L(k);
|
|
29
|
+
return M(t, c), (e, y) => {
|
|
30
|
+
var b;
|
|
31
|
+
const K = u("el-checkbox"), C = u("el-checkbox-button"), _ = u("el-space"), V = u("el-checkbox-group"), z = F("loading");
|
|
32
|
+
return a(g).read ? (l(), n("div", N, I((b = t.value) == null ? void 0 : b.map((o) => {
|
|
33
|
+
var v;
|
|
34
|
+
return (v = a(r).find((T) => T[e.valueKey] === o)) == null ? void 0 : v[e.labelKey];
|
|
35
|
+
}).join("、")), 1)) : (l(), n(d, { key: 1 }, [
|
|
36
|
+
!a(r).length && !a(m) ? (l(), n("div", O, "暂无选项")) : i("", !0),
|
|
37
|
+
S((l(), s(V, j(e.$attrs, {
|
|
38
|
+
modelValue: t.value,
|
|
39
|
+
"onUpdate:modelValue": y[0] || (y[0] = (o) => t.value = o),
|
|
40
|
+
onChange: a(c)
|
|
41
|
+
}), {
|
|
42
|
+
default: f(() => [
|
|
43
|
+
e.optionType === "circle" || e.optionType === "border" ? (l(!0), n(d, { key: 0 }, h(a(r), (o) => (l(), s(K, {
|
|
44
|
+
key: o[e.valueKey],
|
|
45
|
+
label: o[e.labelKey],
|
|
46
|
+
value: o[e.valueKey],
|
|
47
|
+
border: e.optionType === "border"
|
|
48
|
+
}, null, 8, ["label", "value", "border"]))), 128)) : i("", !0),
|
|
49
|
+
e.optionType === "button" ? (l(), s(_, {
|
|
50
|
+
key: 1,
|
|
51
|
+
wrap: "",
|
|
52
|
+
size: [e.space, e.space]
|
|
53
|
+
}, {
|
|
54
|
+
default: f(() => [
|
|
55
|
+
(l(!0), n(d, null, h(a(r), (o) => (l(), s(C, {
|
|
56
|
+
key: o[e.valueKey],
|
|
57
|
+
label: o[e.labelKey],
|
|
58
|
+
value: o[e.valueKey],
|
|
59
|
+
size: "large"
|
|
60
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
61
|
+
]),
|
|
62
|
+
_: 1
|
|
63
|
+
}, 8, ["size"])) : i("", !0)
|
|
64
|
+
]),
|
|
65
|
+
_: 1
|
|
66
|
+
}, 16, ["modelValue", "onChange"])), [
|
|
67
|
+
[z, a(m)]
|
|
68
|
+
])
|
|
69
|
+
], 64));
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
export {
|
|
74
|
+
A as default
|
|
75
|
+
};
|
|
@@ -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-C9fXRITB.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,24 @@
|
|
|
1
|
+
import { defineComponent as a, useModel as s, resolveComponent as p, unref as d, openBlock as n, createElementBlock as i, toDisplayString as c, createBlock as _, mergeProps as f } from "vue";
|
|
2
|
+
import { u as v } from "./index-C9fXRITB.js";
|
|
3
|
+
import "element-plus";
|
|
4
|
+
const V = { key: 0 }, C = /* @__PURE__ */ a({
|
|
5
|
+
__name: "Component",
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: {},
|
|
8
|
+
modelModifiers: {}
|
|
9
|
+
},
|
|
10
|
+
emits: ["update:modelValue"],
|
|
11
|
+
setup(t) {
|
|
12
|
+
const e = s(t, "modelValue"), l = v();
|
|
13
|
+
return (m, o) => {
|
|
14
|
+
const r = p("el-input-number");
|
|
15
|
+
return d(l).read ? (n(), i("div", V, c(e.value), 1)) : (n(), _(r, f({ key: 1 }, m.$attrs, {
|
|
16
|
+
modelValue: e.value,
|
|
17
|
+
"onUpdate:modelValue": o[0] || (o[0] = (u) => e.value = u)
|
|
18
|
+
}), null, 16, ["modelValue"]));
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
C as default
|
|
24
|
+
};
|
|
@@ -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-C9fXRITB.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-C9fXRITB.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
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { defineComponent as f, mergeModels as V, useModel as _, ref as b, computed as w, watch as g, onMounted as h, resolveComponent as n, openBlock as s, createBlock as p, mergeProps as k, withCtx as m, createVNode as y, normalizeStyle as C, createElementBlock as M, Fragment as B, renderList as I } from "vue";
|
|
2
|
+
const A = /* @__PURE__ */ f({
|
|
3
|
+
__name: "Component",
|
|
4
|
+
props: /* @__PURE__ */ V({
|
|
5
|
+
selectPosition: { default: "append" },
|
|
6
|
+
selectWidth: { default: 70 },
|
|
7
|
+
selectInitialValue: {},
|
|
8
|
+
options: { default: () => [] },
|
|
9
|
+
parse: {}
|
|
10
|
+
}, {
|
|
11
|
+
modelValue: {
|
|
12
|
+
default: ""
|
|
13
|
+
},
|
|
14
|
+
modelModifiers: {}
|
|
15
|
+
}),
|
|
16
|
+
emits: ["update:modelValue"],
|
|
17
|
+
setup(d) {
|
|
18
|
+
const i = d, t = _(d, "modelValue"), o = b(""), r = w({
|
|
19
|
+
get() {
|
|
20
|
+
var e;
|
|
21
|
+
return (e = t.value) == null ? void 0 : e.replaceAll(o.value, "");
|
|
22
|
+
},
|
|
23
|
+
set(e) {
|
|
24
|
+
e ? t.value = e + o.value : t.value = e;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return g(o, (e, a) => {
|
|
28
|
+
var u;
|
|
29
|
+
t.value && (t.value = ((u = t.value) == null ? void 0 : u.replaceAll(a, "")) + e);
|
|
30
|
+
}), h(() => {
|
|
31
|
+
i.selectInitialValue && (o.value = i.selectInitialValue);
|
|
32
|
+
}), (e, a) => {
|
|
33
|
+
const u = n("el-option"), c = n("el-select"), v = n("el-input");
|
|
34
|
+
return s(), p(v, k({
|
|
35
|
+
"show-word-limit": "",
|
|
36
|
+
autocomplete: "off"
|
|
37
|
+
}, e.$attrs, {
|
|
38
|
+
modelValue: r.value,
|
|
39
|
+
"onUpdate:modelValue": a[1] || (a[1] = (l) => r.value = l)
|
|
40
|
+
}), {
|
|
41
|
+
[e.selectPosition]: m(() => [
|
|
42
|
+
y(c, {
|
|
43
|
+
modelValue: o.value,
|
|
44
|
+
"onUpdate:modelValue": a[0] || (a[0] = (l) => o.value = l),
|
|
45
|
+
style: C({ width: e.selectWidth + "px" }),
|
|
46
|
+
placeholder: " "
|
|
47
|
+
}, {
|
|
48
|
+
default: m(() => [
|
|
49
|
+
(s(!0), M(B, null, I(e.options, (l) => (s(), p(u, {
|
|
50
|
+
label: l.label,
|
|
51
|
+
value: l.value,
|
|
52
|
+
disabled: l.disabled,
|
|
53
|
+
key: l.value
|
|
54
|
+
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
55
|
+
]),
|
|
56
|
+
_: 1
|
|
57
|
+
}, 8, ["modelValue", "style"])
|
|
58
|
+
]),
|
|
59
|
+
_: 2
|
|
60
|
+
}, 1040, ["modelValue"]);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
export {
|
|
65
|
+
A as default
|
|
66
|
+
};
|
|
@@ -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-C9fXRITB.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,13 @@
|
|
|
1
|
+
import { defineComponent as t, openBlock as o, createElementBlock as r, normalizeProps as n, guardReactiveProps as p, toDisplayString as a } from "vue";
|
|
2
|
+
const c = /* @__PURE__ */ t({
|
|
3
|
+
__name: "Component",
|
|
4
|
+
props: {
|
|
5
|
+
text: {}
|
|
6
|
+
},
|
|
7
|
+
setup(s) {
|
|
8
|
+
return (e, i) => (o(), r("div", n(p(e.$attrs)), a(e.text), 17));
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
export {
|
|
12
|
+
c as default
|
|
13
|
+
};
|