go-captcha-vue 2.0.5 → 2.0.6
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/README.md +1 -0
- package/dist/components/rotate/meta/data.d.ts +1 -0
- package/dist/go-captcha-vue.es.js +219 -214
- package/dist/go-captcha-vue.umd.js +8 -8
- package/dist/style.css +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as q, openBlock as z, createElementBlock as H, mergeProps as oe, createElementVNode as o, reactive as T, toRaw as V, watch as F, computed as L, withDirectives as K, normalizeClass as se, normalizeStyle as D, toDisplayString as ie, vShow as Q, createVNode as I, unref as v, Fragment as
|
|
1
|
+
import { defineComponent as q, openBlock as z, createElementBlock as H, mergeProps as oe, createElementVNode as o, reactive as T, toRaw as V, watch as F, computed as L, withDirectives as K, normalizeClass as se, normalizeStyle as D, toDisplayString as ie, vShow as Q, createVNode as I, unref as v, Fragment as Ce, renderList as Be, ref as ee, onMounted as _e, nextTick as be, onUnmounted as we, toRefs as Te, createBlock as le, createCommentVNode as Pe } from "vue";
|
|
2
2
|
const Ee = () => ({
|
|
3
3
|
width: 300,
|
|
4
4
|
height: 220,
|
|
@@ -11,19 +11,19 @@ const Ee = () => ({
|
|
|
11
11
|
buttonText: "确认",
|
|
12
12
|
iconSize: 22,
|
|
13
13
|
dotSize: 24
|
|
14
|
-
}),
|
|
14
|
+
}), Xe = /* @__PURE__ */ o("path", { d: `M100.1,189.9C100.1,189.9,100,189.9,100.1,189.9c-49.7,0-90-40.4-90-89.9c0-49.6,40.4-89.9,89.9-89.9
|
|
15
15
|
c49.6,0,89.9,40.4,89.9,89.9c0,18.2-5.4,35.7-15.6,50.7c-1.5,2.1-3.6,3.4-6.1,3.9c-2.5,0.4-5-0.1-7-1.6c-4.2-3-5.3-8.6-2.4-12.9
|
|
16
16
|
c8.1-11.9,12.4-25.7,12.4-40.1c0-39.2-31.9-71.1-71.1-71.1c-39.2,0-71.1,31.9-71.1,71.1c0,39.2,31.9,71.1,71.1,71.1
|
|
17
17
|
c7.7,0,15.3-1.2,22.6-3.6c2.4-0.8,4.9-0.6,7.2,0.5c2.2,1.1,3.9,3.1,4.7,5.5c1.6,4.9-1,10.2-5.9,11.9
|
|
18
18
|
C119.3,188.4,109.8,189.9,100.1,189.9z M73,136.4C73,136.4,73,136.4,73,136.4c-2.5,0-4.9-1-6.7-2.8c-3.7-3.7-3.7-9.6,0-13.3
|
|
19
19
|
L86.7,100L66.4,79.7c-3.7-3.7-3.7-9.6,0-13.3c3.7-3.7,9.6-3.7,13.3,0L100,86.7l20.3-20.3c1.8-1.8,4.1-2.8,6.7-2.8c0,0,0,0,0,0
|
|
20
20
|
c2.5,0,4.9,1,6.7,2.8c1.8,1.8,2.8,4.1,2.8,6.7c0,2.5-1,4.9-2.8,6.7L113.3,100l20.3,20.3c3.7,3.7,3.7,9.6,0,13.3
|
|
21
|
-
c-3.7,3.7-9.6,3.7-13.3,0L100,113.3l-20.3,20.3C77.9,135.4,75.5,136.4,73,136.4z` }, null, -1),
|
|
22
|
-
|
|
21
|
+
c-3.7,3.7-9.6,3.7-13.3,0L100,113.3l-20.3,20.3C77.9,135.4,75.5,136.4,73,136.4z` }, null, -1), We = [
|
|
22
|
+
Xe
|
|
23
23
|
], fe = /* @__PURE__ */ q({
|
|
24
24
|
__name: "close-icon",
|
|
25
25
|
emits: ["click"],
|
|
26
|
-
setup(
|
|
26
|
+
setup(c, { emit: t }) {
|
|
27
27
|
const a = t;
|
|
28
28
|
function r(i) {
|
|
29
29
|
a("click", i);
|
|
@@ -33,9 +33,9 @@ const Ee = () => ({
|
|
|
33
33
|
viewBox: "0 0 200 200",
|
|
34
34
|
width: "20",
|
|
35
35
|
height: "20"
|
|
36
|
-
}, i.$attrs, { onClick: r }),
|
|
36
|
+
}, i.$attrs, { onClick: r }), We, 16));
|
|
37
37
|
}
|
|
38
|
-
}),
|
|
38
|
+
}), Me = /* @__PURE__ */ o("path", { d: `M135,149.9c-10.7,7.6-23.2,11.4-36,11.2c-1.7,0-3.4-0.1-5-0.3c-0.7-0.1-1.4-0.2-2-0.3c-1.3-0.2-2.6-0.4-3.9-0.6
|
|
39
39
|
c-0.8-0.2-1.6-0.4-2.3-0.5c-1.2-0.3-2.5-0.6-3.7-1c-0.6-0.2-1.2-0.4-1.7-0.6c-1.4-0.5-2.8-1-4.2-1.5c-0.3-0.1-0.6-0.3-0.9-0.4
|
|
40
40
|
c-1.6-0.7-3.2-1.4-4.7-2.3c-0.1,0-0.1-0.1-0.2-0.1c-5.1-2.9-9.8-6.4-14-10.6c-0.1-0.1-0.1-0.1-0.2-0.2c-1.3-1.3-2.5-2.7-3.7-4.1
|
|
41
41
|
c-0.2-0.3-0.5-0.6-0.7-0.9c-8.4-10.6-13.5-24.1-13.5-38.8h14.3c0.4,0,0.7-0.2,0.9-0.5c0.2-0.3,0.2-0.8,0-1.1L29.5,60.9
|
|
@@ -52,12 +52,12 @@ const Ee = () => ({
|
|
|
52
52
|
c0.6,0.1,1.3,0.3,1.9,0.4c1.4,0.3,2.8,0.7,4.2,1.1c0.4,0.1,0.9,0.3,1.3,0.4c1.6,0.5,3.1,1.1,4.6,1.7c0.2,0.1,0.3,0.1,0.5,0.2
|
|
53
53
|
c9,3.9,17,10,23.2,17.6c0,0,0.1,0.1,0.1,0.2c8.7,10.7,14,24.5,14,39.4H147c-0.4,0-0.7,0.2-0.9,0.5c-0.2,0.3-0.2,0.8,0,1.1l24,36.4
|
|
54
54
|
c0.2,0.3,0.5,0.5,0.9,0.5c0.4,0,0.7-0.2,0.9-0.5l23.9-36.4c0.2-0.3,0.2-0.7,0-1.1c-0.2-0.3-0.5-0.5-0.9-0.5L180.6,98.9L180.6,98.9
|
|
55
|
-
L180.6,98.9z` }, null, -1),
|
|
56
|
-
|
|
55
|
+
L180.6,98.9z` }, null, -1), Fe = [
|
|
56
|
+
Me
|
|
57
57
|
], ve = /* @__PURE__ */ q({
|
|
58
58
|
__name: "refresh-icon",
|
|
59
59
|
emits: ["click"],
|
|
60
|
-
setup(
|
|
60
|
+
setup(c, { emit: t }) {
|
|
61
61
|
const a = t;
|
|
62
62
|
function r(i) {
|
|
63
63
|
a("click", i);
|
|
@@ -67,9 +67,9 @@ const Ee = () => ({
|
|
|
67
67
|
viewBox: "0 0 200 200",
|
|
68
68
|
width: "20",
|
|
69
69
|
height: "20"
|
|
70
|
-
}, i.$attrs, { onClick: r }),
|
|
70
|
+
}, i.$attrs, { onClick: r }), Fe, 16));
|
|
71
71
|
}
|
|
72
|
-
}),
|
|
72
|
+
}), Ye = /* @__PURE__ */ o("circle", {
|
|
73
73
|
cx: "50",
|
|
74
74
|
cy: "36.8101",
|
|
75
75
|
r: "10"
|
|
@@ -83,12 +83,12 @@ const Ee = () => ({
|
|
|
83
83
|
keyTimes: "0;0.5;1",
|
|
84
84
|
values: "23;77;23"
|
|
85
85
|
})
|
|
86
|
-
], -1),
|
|
87
|
-
|
|
86
|
+
], -1), Re = [
|
|
87
|
+
Ye
|
|
88
88
|
], me = /* @__PURE__ */ q({
|
|
89
89
|
__name: "loading-icon",
|
|
90
90
|
emits: ["click"],
|
|
91
|
-
setup(
|
|
91
|
+
setup(c, { emit: t }) {
|
|
92
92
|
const a = t;
|
|
93
93
|
function r(i) {
|
|
94
94
|
a("click", i);
|
|
@@ -99,39 +99,39 @@ const Ee = () => ({
|
|
|
99
99
|
preserveAspectRatio: "xMidYMid",
|
|
100
100
|
width: "84",
|
|
101
101
|
height: "84"
|
|
102
|
-
}, i.$attrs, { onClick: r }),
|
|
102
|
+
}, i.$attrs, { onClick: r }), Re, 16));
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
|
-
function
|
|
105
|
+
function He(c) {
|
|
106
106
|
let t = 0, a = 0;
|
|
107
|
-
if (
|
|
108
|
-
const r =
|
|
107
|
+
if (c.getBoundingClientRect) {
|
|
108
|
+
const r = c.getBoundingClientRect(), i = document.documentElement;
|
|
109
109
|
t = r.left + Math.max(i.scrollLeft, document.body.scrollLeft) - i.clientLeft, a = r.top + Math.max(i.scrollTop, document.body.scrollTop) - i.clientTop;
|
|
110
110
|
} else
|
|
111
|
-
for (;
|
|
112
|
-
t +=
|
|
111
|
+
for (; c !== document.body; )
|
|
112
|
+
t += c.offsetLeft, a += c.offsetTop, c = c.offsetParent;
|
|
113
113
|
return {
|
|
114
114
|
domX: t,
|
|
115
115
|
domY: a
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
function ae(
|
|
118
|
+
function ae(c, t) {
|
|
119
119
|
let a = t.relatedTarget;
|
|
120
120
|
try {
|
|
121
|
-
for (; a && a !==
|
|
121
|
+
for (; a && a !== c; )
|
|
122
122
|
a = a.parentNode;
|
|
123
123
|
} catch (r) {
|
|
124
124
|
console.warn(r);
|
|
125
125
|
}
|
|
126
|
-
return a !==
|
|
126
|
+
return a !== c;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
const r = T({ list: [] }), i = (
|
|
130
|
-
const _ =
|
|
131
|
-
return r.list.push({ key: E.getTime(), index: B + 1, x: g, y: f }), t.click && t.click(g, f),
|
|
132
|
-
}, m = (
|
|
128
|
+
function Oe(c, t, a) {
|
|
129
|
+
const r = T({ list: [] }), i = (s) => {
|
|
130
|
+
const _ = s.currentTarget, x = He(_), l = s.pageX || s.clientX, b = s.pageY || s.clientY, h = x.domX, C = x.domY, Y = l - h, w = b - C, g = parseInt(Y.toString()), f = parseInt(w.toString()), E = /* @__PURE__ */ new Date(), B = r.list.length;
|
|
131
|
+
return r.list.push({ key: E.getTime(), index: B + 1, x: g, y: f }), t.click && t.click(g, f), s.cancelBubble = !0, s.preventDefault(), !1;
|
|
132
|
+
}, m = (s) => (t.confirm && t.confirm(V(r.list), () => {
|
|
133
133
|
y();
|
|
134
|
-
}),
|
|
134
|
+
}), s.cancelBubble = !0, s.preventDefault(), !1), n = (s) => (e(), s.cancelBubble = !0, s.preventDefault(), !1), u = (s) => (d(), s.cancelBubble = !0, s.preventDefault(), !1), e = () => {
|
|
135
135
|
t.close && t.close(), y();
|
|
136
136
|
}, d = () => {
|
|
137
137
|
t.refresh && t.refresh(), y();
|
|
@@ -142,7 +142,7 @@ function Ye(s, t, a) {
|
|
|
142
142
|
dots: r,
|
|
143
143
|
clickEvent: i,
|
|
144
144
|
confirmEvent: m,
|
|
145
|
-
closeEvent:
|
|
145
|
+
closeEvent: n,
|
|
146
146
|
refreshEvent: u,
|
|
147
147
|
resetData: y,
|
|
148
148
|
clearData: () => {
|
|
@@ -152,24 +152,24 @@ function Ye(s, t, a) {
|
|
|
152
152
|
close: e
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
|
-
const
|
|
155
|
+
const je = { class: "gc-header" }, Ae = ["src"], Ie = { class: "gc-loading" }, Ve = ["src"], Ne = { class: "gc-dots" }, Ue = { class: "gc-footer" }, qe = { class: "gc-icon-block gc-icon-block2" }, Ge = { class: "gc-button-block" }, re = /* @__PURE__ */ q({
|
|
156
156
|
__name: "index",
|
|
157
157
|
props: {
|
|
158
158
|
config: { default: Ee },
|
|
159
159
|
events: { default: () => ({}) },
|
|
160
160
|
data: { default: () => ({}) }
|
|
161
161
|
},
|
|
162
|
-
setup(
|
|
163
|
-
const a =
|
|
162
|
+
setup(c, { expose: t }) {
|
|
163
|
+
const a = c, { data: r, events: i, config: m } = a, n = T({ ...V(r) }), u = T({ ...V(i) }), e = T({ ...Ee(), ...V(m) });
|
|
164
164
|
F(() => a.data, (l, b) => {
|
|
165
|
-
Object.assign(
|
|
165
|
+
Object.assign(n, l);
|
|
166
166
|
}, { deep: !0 }), F(() => a.events, (l, b) => {
|
|
167
167
|
Object.assign(u, l);
|
|
168
168
|
}, { deep: !0 }), F(() => a.config, (l, b) => {
|
|
169
169
|
Object.assign(e, l);
|
|
170
170
|
}, { deep: !0 });
|
|
171
|
-
const d =
|
|
172
|
-
|
|
171
|
+
const d = Oe(n, u, () => {
|
|
172
|
+
n.thumb = "", n.image = "";
|
|
173
173
|
}), y = L(() => {
|
|
174
174
|
const l = e.horizontalPadding || 0, b = e.verticalPadding || 0;
|
|
175
175
|
return {
|
|
@@ -182,10 +182,10 @@ const Re = { class: "gc-header" }, He = ["src"], Oe = { class: "gc-loading" }, j
|
|
|
182
182
|
}), p = L(() => ({
|
|
183
183
|
width: e.thumbWidth + "px",
|
|
184
184
|
height: e.thumbHeight + "px"
|
|
185
|
-
})),
|
|
185
|
+
})), s = L(() => ({
|
|
186
186
|
width: e.width + "px",
|
|
187
187
|
height: e.height + "px"
|
|
188
|
-
})), _ = L(() =>
|
|
188
|
+
})), _ = L(() => n.image && n.image.length > 0 || n.thumb && n.thumb.length > 0), x = L(() => (e.width || 0) > 0 || (e.height || 0) > 0);
|
|
189
189
|
return t({
|
|
190
190
|
reset: d.resetData,
|
|
191
191
|
clear: d.clearData,
|
|
@@ -195,35 +195,35 @@ const Re = { class: "gc-header" }, He = ["src"], Oe = { class: "gc-loading" }, j
|
|
|
195
195
|
class: se(`go-captcha gc-wrapper ${e.showTheme && "gc-theme"}`),
|
|
196
196
|
style: D(y.value)
|
|
197
197
|
}, [
|
|
198
|
-
o("div",
|
|
198
|
+
o("div", je, [
|
|
199
199
|
o("span", null, ie(e.title), 1),
|
|
200
200
|
K(o("img", {
|
|
201
201
|
style: D(p.value),
|
|
202
|
-
src:
|
|
202
|
+
src: n.thumb,
|
|
203
203
|
alt: ""
|
|
204
|
-
}, null, 12,
|
|
204
|
+
}, null, 12, Ae), [
|
|
205
205
|
[Q, _.value]
|
|
206
206
|
])
|
|
207
207
|
]),
|
|
208
208
|
o("div", {
|
|
209
209
|
class: "gc-body",
|
|
210
|
-
style: D(
|
|
210
|
+
style: D(s.value)
|
|
211
211
|
}, [
|
|
212
|
-
o("div",
|
|
212
|
+
o("div", Ie, [
|
|
213
213
|
I(me)
|
|
214
214
|
]),
|
|
215
215
|
K(o("img", {
|
|
216
|
-
style: D(
|
|
216
|
+
style: D(s.value),
|
|
217
217
|
class: "gc-picture",
|
|
218
|
-
src:
|
|
218
|
+
src: n.image,
|
|
219
219
|
onClick: b[0] || (b[0] = //@ts-ignore
|
|
220
220
|
(...h) => v(d).clickEvent && v(d).clickEvent(...h)),
|
|
221
221
|
alt: ""
|
|
222
|
-
}, null, 12,
|
|
222
|
+
}, null, 12, Ve), [
|
|
223
223
|
[Q, _.value]
|
|
224
224
|
]),
|
|
225
|
-
o("div",
|
|
226
|
-
(z(!0), H(
|
|
225
|
+
o("div", Ne, [
|
|
226
|
+
(z(!0), H(Ce, null, Be(v(d).dots.list, (h) => (z(), H("div", {
|
|
227
227
|
class: "gc-dot",
|
|
228
228
|
key: `${h.key + "-" + h.index}`,
|
|
229
229
|
style: D({
|
|
@@ -236,8 +236,8 @@ const Re = { class: "gc-header" }, He = ["src"], Oe = { class: "gc-loading" }, j
|
|
|
236
236
|
}, ie(h.index), 5))), 128))
|
|
237
237
|
])
|
|
238
238
|
], 4),
|
|
239
|
-
o("div",
|
|
240
|
-
o("div",
|
|
239
|
+
o("div", Ue, [
|
|
240
|
+
o("div", qe, [
|
|
241
241
|
I(fe, {
|
|
242
242
|
width: e.iconSize,
|
|
243
243
|
height: e.iconSize,
|
|
@@ -249,7 +249,7 @@ const Re = { class: "gc-header" }, He = ["src"], Oe = { class: "gc-loading" }, j
|
|
|
249
249
|
onClick: v(d).refreshEvent
|
|
250
250
|
}, null, 8, ["width", "height", "onClick"])
|
|
251
251
|
]),
|
|
252
|
-
o("div",
|
|
252
|
+
o("div", Ge, [
|
|
253
253
|
o("button", {
|
|
254
254
|
class: se(!_.value && "disabled"),
|
|
255
255
|
onClick: b[1] || (b[1] = //@ts-ignore
|
|
@@ -263,8 +263,8 @@ const Re = { class: "gc-header" }, He = ["src"], Oe = { class: "gc-loading" }, j
|
|
|
263
263
|
}
|
|
264
264
|
});
|
|
265
265
|
re.name = "gocaptcha-click";
|
|
266
|
-
re.install = function(
|
|
267
|
-
|
|
266
|
+
re.install = function(c) {
|
|
267
|
+
c.component("gocaptcha-click", re);
|
|
268
268
|
};
|
|
269
269
|
const xe = () => ({
|
|
270
270
|
width: 300,
|
|
@@ -277,14 +277,14 @@ const xe = () => ({
|
|
|
277
277
|
title: "请拖动滑块完成拼图",
|
|
278
278
|
iconSize: 22,
|
|
279
279
|
scope: !0
|
|
280
|
-
}),
|
|
280
|
+
}), Je = /* @__PURE__ */ o("path", { d: `M131.6,116.3c0,0-75.6,0-109.7,0c-9.1,0-16.2-7.4-16.2-16.2c0-9.1,7.4-16.2,16.2-16.2c28.7,0,109.7,0,109.7,0
|
|
281
281
|
s-5.4-5.4-30.4-30.7c-6.4-6.4-6.4-16.7,0-23.1s16.7-6.4,23.1,0l58.4,58.4c6.4,6.4,6.4,16.7,0,23.1c0,0-32.9,32.9-57.9,57.9
|
|
282
|
-
c-6.4,6.4-16.7,6.4-23.1,0c-6.4-6.4-6.4-16.7,0-23.1C121.8,126.2,131.6,116.3,131.6,116.3z` }, null, -1),
|
|
283
|
-
|
|
284
|
-
],
|
|
282
|
+
c-6.4,6.4-16.7,6.4-23.1,0c-6.4-6.4-6.4-16.7,0-23.1C121.8,126.2,131.6,116.3,131.6,116.3z` }, null, -1), Ke = [
|
|
283
|
+
Je
|
|
284
|
+
], ze = /* @__PURE__ */ q({
|
|
285
285
|
__name: "arrows-icon",
|
|
286
286
|
emits: ["click"],
|
|
287
|
-
setup(
|
|
287
|
+
setup(c, { emit: t }) {
|
|
288
288
|
const a = t;
|
|
289
289
|
function r(i) {
|
|
290
290
|
a("click", i);
|
|
@@ -294,9 +294,9 @@ const xe = () => ({
|
|
|
294
294
|
viewBox: "0 0 200 200",
|
|
295
295
|
width: "20",
|
|
296
296
|
height: "20"
|
|
297
|
-
}, i.$attrs, { onClick: r }),
|
|
297
|
+
}, i.$attrs, { onClick: r }), Ke, 16));
|
|
298
298
|
}
|
|
299
|
-
}),
|
|
299
|
+
}), Le = () => ({
|
|
300
300
|
thumbX: 0,
|
|
301
301
|
thumbY: 0,
|
|
302
302
|
thumbWidth: 0,
|
|
@@ -304,23 +304,23 @@ const xe = () => ({
|
|
|
304
304
|
image: "",
|
|
305
305
|
thumb: ""
|
|
306
306
|
});
|
|
307
|
-
function
|
|
308
|
-
const d = T({ dragLeft: 0, thumbLeft:
|
|
309
|
-
F(() =>
|
|
307
|
+
function Qe(c, t, a, r, i, m, n, u, e) {
|
|
308
|
+
const d = T({ dragLeft: 0, thumbLeft: c.thumbX || 0, isFreeze: !1 });
|
|
309
|
+
F(() => c, (h, C) => {
|
|
310
310
|
d.isFreeze || (d.thumbLeft = h.thumbX || 0);
|
|
311
311
|
}, { deep: !0 });
|
|
312
312
|
const y = (h) => {
|
|
313
313
|
if (!ae(u.value, h))
|
|
314
314
|
return;
|
|
315
|
-
const
|
|
315
|
+
const C = h.touches && h.touches[0], Y = n.value.offsetLeft, w = i.value.offsetWidth, g = n.value.offsetWidth, f = w - g, E = m.value.offsetWidth, B = m.value.offsetLeft, te = w - E, G = (w - (E + B)) / f;
|
|
316
316
|
let N = !1, P = null, Z = 0, O = 0;
|
|
317
|
-
|
|
317
|
+
C ? Z = C.pageX - Y : Z = h.clientX - Y;
|
|
318
318
|
const R = (W) => {
|
|
319
319
|
N = !0;
|
|
320
320
|
const J = W.touches && W.touches[0];
|
|
321
321
|
let M = 0;
|
|
322
322
|
J ? M = J.pageX - Z : M = W.clientX - Z;
|
|
323
|
-
let
|
|
323
|
+
let Se = B + M * G;
|
|
324
324
|
if (M >= f) {
|
|
325
325
|
d.dragLeft = f, d.thumbLeft = O = te;
|
|
326
326
|
return;
|
|
@@ -329,9 +329,9 @@ function Je(s, t, a, r, i, m, c, u, e) {
|
|
|
329
329
|
d.dragLeft = 0, d.thumbLeft = O = B;
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
332
|
-
d.dragLeft = M, d.thumbLeft = O =
|
|
332
|
+
d.dragLeft = M, d.thumbLeft = O = Se, t.move && t.move(O, c.thumbY || 0), W.cancelBubble = !0, W.preventDefault();
|
|
333
333
|
}, U = (W) => {
|
|
334
|
-
ae(u.value, W) && (X(), N && (N = !1, !(O < 0) && (t.confirm && t.confirm({ x: parseInt(O.toString()), y:
|
|
334
|
+
ae(u.value, W) && (X(), N && (N = !1, !(O < 0) && (t.confirm && t.confirm({ x: parseInt(O.toString()), y: c.thumbY || 0 }, () => {
|
|
335
335
|
l();
|
|
336
336
|
}), W.cancelBubble = !0, W.preventDefault())));
|
|
337
337
|
}, j = (W) => {
|
|
@@ -340,22 +340,22 @@ function Je(s, t, a, r, i, m, c, u, e) {
|
|
|
340
340
|
P = null;
|
|
341
341
|
}, ce = (W) => {
|
|
342
342
|
P && (U(P), X());
|
|
343
|
-
}, k = a.scope, $ = k ? r.value : u.value,
|
|
344
|
-
|
|
343
|
+
}, k = a.scope, $ = k ? r.value : u.value, S = k ? r.value : document.body, X = () => {
|
|
344
|
+
S.removeEventListener("mousemove", R, !1), S.removeEventListener("touchmove", R, { passive: !1 }), $.removeEventListener("mouseup", U, !1), $.removeEventListener("mouseenter", A, !1), $.removeEventListener("mouseleave", j, !1), $.removeEventListener("touchend", U, !1), S.removeEventListener("mouseleave", U, !1), S.removeEventListener("mouseup", ce, !1), d.isFreeze = !1;
|
|
345
345
|
};
|
|
346
|
-
d.isFreeze = !0,
|
|
347
|
-
}, p = (h) => (_(), h.cancelBubble = !0, h.preventDefault(), !1),
|
|
346
|
+
d.isFreeze = !0, S.addEventListener("mousemove", R, !1), S.addEventListener("touchmove", R, { passive: !1 }), $.addEventListener("mouseup", U, !1), $.addEventListener("mouseenter", A, !1), $.addEventListener("mouseleave", j, !1), $.addEventListener("touchend", U, !1), S.addEventListener("mouseleave", U, !1), S.addEventListener("mouseup", ce, !1);
|
|
347
|
+
}, p = (h) => (_(), h.cancelBubble = !0, h.preventDefault(), !1), s = (h) => (x(), h.cancelBubble = !0, h.preventDefault(), !1), _ = () => {
|
|
348
348
|
t && t.close && t.close(), l();
|
|
349
349
|
}, x = () => {
|
|
350
350
|
t && t.refresh && t.refresh(), l();
|
|
351
351
|
}, l = () => {
|
|
352
|
-
d.dragLeft = 0, d.thumbLeft =
|
|
352
|
+
d.dragLeft = 0, d.thumbLeft = c.thumbX || 0;
|
|
353
353
|
};
|
|
354
354
|
return {
|
|
355
355
|
state: d,
|
|
356
356
|
dragEvent: y,
|
|
357
357
|
closeEvent: p,
|
|
358
|
-
refreshEvent:
|
|
358
|
+
refreshEvent: s,
|
|
359
359
|
resetData: l,
|
|
360
360
|
clearData: () => {
|
|
361
361
|
e && e(), l();
|
|
@@ -364,33 +364,33 @@ function Je(s, t, a, r, i, m, c, u, e) {
|
|
|
364
364
|
close: _
|
|
365
365
|
};
|
|
366
366
|
}
|
|
367
|
-
const
|
|
367
|
+
const Ze = { class: "gc-header" }, et = { class: "gc-icon-block" }, tt = { class: "gc-loading" }, nt = ["src"], st = ["src"], ct = { class: "gc-footer" }, ot = /* @__PURE__ */ o("div", { class: "gc-drag-line" }, null, -1), ue = /* @__PURE__ */ q({
|
|
368
368
|
__name: "index",
|
|
369
369
|
props: {
|
|
370
370
|
config: { default: xe },
|
|
371
371
|
events: { default: () => ({}) },
|
|
372
|
-
data: { default:
|
|
372
|
+
data: { default: Le }
|
|
373
373
|
},
|
|
374
|
-
setup(
|
|
375
|
-
const a =
|
|
374
|
+
setup(c, { expose: t }) {
|
|
375
|
+
const a = c, { data: r, events: i, config: m } = a, n = T({ ...Le(), ...V(r) }), u = T({ ...V(i) }), e = T({ ...xe(), ...V(m) });
|
|
376
376
|
F(() => a.data, (f, E) => {
|
|
377
|
-
Object.assign(
|
|
377
|
+
Object.assign(n, f);
|
|
378
378
|
}, { deep: !0 }), F(() => a.events, (f, E) => {
|
|
379
379
|
Object.assign(u, f);
|
|
380
380
|
}, { deep: !0 }), F(() => a.config, (f, E) => {
|
|
381
381
|
Object.assign(e, f);
|
|
382
382
|
}, { deep: !0 });
|
|
383
|
-
const d = ee(null), y = ee(null), p = ee(null),
|
|
384
|
-
|
|
383
|
+
const d = ee(null), y = ee(null), p = ee(null), s = ee(null), _ = ee(null), x = Qe(
|
|
384
|
+
n,
|
|
385
385
|
u,
|
|
386
386
|
e,
|
|
387
387
|
d,
|
|
388
388
|
p,
|
|
389
389
|
_,
|
|
390
|
-
|
|
390
|
+
s,
|
|
391
391
|
y,
|
|
392
392
|
() => {
|
|
393
|
-
|
|
393
|
+
n.thumb = "", n.image = "", n.thumbX = 0, n.thumbY = 0, n.thumbWidth = 0, n.thumbHeight = 0;
|
|
394
394
|
}
|
|
395
395
|
), l = L(() => {
|
|
396
396
|
const f = e.horizontalPadding || 0, E = e.verticalPadding || 0;
|
|
@@ -402,18 +402,18 @@ const Ke = { class: "gc-header" }, Qe = { class: "gc-icon-block" }, Ze = { class
|
|
|
402
402
|
paddingBottom: E + "px"
|
|
403
403
|
};
|
|
404
404
|
}), b = L(() => ({
|
|
405
|
-
width:
|
|
406
|
-
height:
|
|
407
|
-
top:
|
|
405
|
+
width: n.thumbWidth + "px",
|
|
406
|
+
height: n.thumbHeight + "px",
|
|
407
|
+
top: n.thumbY + "px",
|
|
408
408
|
left: x.state.thumbLeft + "px"
|
|
409
409
|
})), h = L(() => ({
|
|
410
410
|
width: e.width + "px",
|
|
411
411
|
height: e.height + "px"
|
|
412
|
-
})),
|
|
412
|
+
})), C = L(() => n.image && n.image.length > 0), Y = L(() => n.thumb && n.thumb.length > 0), w = L(() => (e.width || 0) > 0 || (e.height || 0) > 0), g = (f) => f.preventDefault();
|
|
413
413
|
return _e(async () => {
|
|
414
|
-
await be(),
|
|
414
|
+
await be(), s.value && s.value.addEventListener("dragstart", g);
|
|
415
415
|
}), we(() => {
|
|
416
|
-
|
|
416
|
+
s.value && s.value.removeEventListener("dragstart", g);
|
|
417
417
|
}), t({
|
|
418
418
|
reset: x.resetData,
|
|
419
419
|
clear: x.clearData,
|
|
@@ -425,9 +425,9 @@ const Ke = { class: "gc-header" }, Qe = { class: "gc-icon-block" }, Ze = { class
|
|
|
425
425
|
ref_key: "rootRef",
|
|
426
426
|
ref: d
|
|
427
427
|
}, [
|
|
428
|
-
o("div",
|
|
428
|
+
o("div", Ze, [
|
|
429
429
|
o("span", null, ie(e.title), 1),
|
|
430
|
-
o("div",
|
|
430
|
+
o("div", et, [
|
|
431
431
|
I(fe, {
|
|
432
432
|
width: e.iconSize,
|
|
433
433
|
height: e.iconSize,
|
|
@@ -446,16 +446,16 @@ const Ke = { class: "gc-header" }, Qe = { class: "gc-icon-block" }, Ze = { class
|
|
|
446
446
|
ref: p,
|
|
447
447
|
style: D(h.value)
|
|
448
448
|
}, [
|
|
449
|
-
o("div",
|
|
449
|
+
o("div", tt, [
|
|
450
450
|
I(me)
|
|
451
451
|
]),
|
|
452
452
|
K(o("img", {
|
|
453
453
|
class: "gc-picture",
|
|
454
454
|
style: D(h.value),
|
|
455
|
-
src:
|
|
455
|
+
src: n.image,
|
|
456
456
|
alt: ""
|
|
457
|
-
}, null, 12,
|
|
458
|
-
[Q,
|
|
457
|
+
}, null, 12, nt), [
|
|
458
|
+
[Q, C.value]
|
|
459
459
|
]),
|
|
460
460
|
o("div", {
|
|
461
461
|
class: "gc-tile",
|
|
@@ -464,24 +464,24 @@ const Ke = { class: "gc-header" }, Qe = { class: "gc-icon-block" }, Ze = { class
|
|
|
464
464
|
style: D(b.value)
|
|
465
465
|
}, [
|
|
466
466
|
K(o("img", {
|
|
467
|
-
src:
|
|
467
|
+
src: n.thumb,
|
|
468
468
|
alt: ""
|
|
469
|
-
}, null, 8,
|
|
469
|
+
}, null, 8, st), [
|
|
470
470
|
[Q, Y.value]
|
|
471
471
|
])
|
|
472
472
|
], 4)
|
|
473
473
|
], 4),
|
|
474
|
-
o("div",
|
|
474
|
+
o("div", ct, [
|
|
475
475
|
o("div", {
|
|
476
476
|
class: "gc-drag-slide-bar",
|
|
477
477
|
ref_key: "dragBarRef",
|
|
478
478
|
ref: y
|
|
479
479
|
}, [
|
|
480
|
-
|
|
480
|
+
ot,
|
|
481
481
|
o("div", {
|
|
482
|
-
class: se(["gc-drag-block", !
|
|
482
|
+
class: se(["gc-drag-block", !C.value && "disabled"]),
|
|
483
483
|
ref_key: "dragBlockRef",
|
|
484
|
-
ref:
|
|
484
|
+
ref: s,
|
|
485
485
|
onMousedown: E[1] || (E[1] = //@ts-ignore
|
|
486
486
|
(...B) => v(x).dragEvent && v(x).dragEvent(...B)),
|
|
487
487
|
style: D({ left: v(x).state.dragLeft + "px" })
|
|
@@ -491,7 +491,7 @@ const Ke = { class: "gc-header" }, Qe = { class: "gc-icon-block" }, Ze = { class
|
|
|
491
491
|
onTouchstart: E[0] || (E[0] = //@ts-ignore
|
|
492
492
|
(...B) => v(x).dragEvent && v(x).dragEvent(...B))
|
|
493
493
|
}, [
|
|
494
|
-
I(
|
|
494
|
+
I(ze)
|
|
495
495
|
], 32)
|
|
496
496
|
], 38)
|
|
497
497
|
], 512)
|
|
@@ -502,10 +502,10 @@ const Ke = { class: "gc-header" }, Qe = { class: "gc-icon-block" }, Ze = { class
|
|
|
502
502
|
}
|
|
503
503
|
});
|
|
504
504
|
ue.name = "gocaptcha-slide";
|
|
505
|
-
ue.install = function(
|
|
506
|
-
|
|
505
|
+
ue.install = function(c) {
|
|
506
|
+
c.component("gocaptcha-slide", ue);
|
|
507
507
|
};
|
|
508
|
-
const
|
|
508
|
+
const ye = () => ({
|
|
509
509
|
width: 300,
|
|
510
510
|
height: 220,
|
|
511
511
|
verticalPadding: 16,
|
|
@@ -514,7 +514,7 @@ const Le = () => ({
|
|
|
514
514
|
title: "请拖拽贴图完成拼图",
|
|
515
515
|
iconSize: 22,
|
|
516
516
|
scope: !0
|
|
517
|
-
}),
|
|
517
|
+
}), ke = () => ({
|
|
518
518
|
thumbX: 0,
|
|
519
519
|
thumbY: 0,
|
|
520
520
|
thumbWidth: 0,
|
|
@@ -522,24 +522,24 @@ const Le = () => ({
|
|
|
522
522
|
image: "",
|
|
523
523
|
thumb: ""
|
|
524
524
|
});
|
|
525
|
-
function
|
|
526
|
-
const u = T({ x:
|
|
527
|
-
F(() =>
|
|
525
|
+
function it(c, t, a, r, i, m, n) {
|
|
526
|
+
const u = T({ x: c.thumbX || 0, y: c.thumbY || 0, isFreeze: !1 });
|
|
527
|
+
F(() => c, (l, b) => {
|
|
528
528
|
u.isFreeze || (u.x = l.thumbX || 0, u.y = l.thumbY || 0);
|
|
529
529
|
}, { deep: !0 });
|
|
530
530
|
const e = (l) => {
|
|
531
531
|
if (!ae(i.value, l))
|
|
532
532
|
return;
|
|
533
|
-
const b = l.touches && l.touches[0], h = m.value.offsetLeft,
|
|
533
|
+
const b = l.touches && l.touches[0], h = m.value.offsetLeft, C = m.value.offsetTop, Y = i.value.offsetWidth, w = i.value.offsetHeight, g = m.value.offsetWidth, f = m.value.offsetHeight, E = Y - g, B = w - f;
|
|
534
534
|
let te = !1, ne = null, G = 0, N = 0, P = 0, Z = 0;
|
|
535
|
-
b ? (G = b.pageX - h, N = b.pageY -
|
|
535
|
+
b ? (G = b.pageX - h, N = b.pageY - C) : (G = l.clientX - h, N = l.clientY - C);
|
|
536
536
|
const O = (X) => {
|
|
537
537
|
te = !0;
|
|
538
538
|
const W = X.touches && X.touches[0];
|
|
539
539
|
let J = 0, M = 0;
|
|
540
540
|
W ? (J = W.pageX - G, M = W.pageY - N) : (J = X.clientX - G, M = X.clientY - N), J <= 0 && (J = 0), M <= 0 && (M = 0), J >= E && (J = E), M >= B && (M = B), u.x = J, u.y = M, P = J, Z = M, t.move && t.move(J, M), X.cancelBubble = !0, X.preventDefault();
|
|
541
541
|
}, R = (X) => {
|
|
542
|
-
ae(i.value, X) && (
|
|
542
|
+
ae(i.value, X) && (S(), te && (te = !1, !(P < 0 || Z < 0) && (t.confirm && t.confirm({ x: P, y: Z }, () => {
|
|
543
543
|
_();
|
|
544
544
|
}), X.cancelBubble = !0, X.preventDefault())));
|
|
545
545
|
}, U = (X) => {
|
|
@@ -547,17 +547,17 @@ function ot(s, t, a, r, i, m, c) {
|
|
|
547
547
|
}, j = () => {
|
|
548
548
|
ne = null;
|
|
549
549
|
}, A = (X) => {
|
|
550
|
-
ne && (R(ne),
|
|
551
|
-
}, ce = a.scope, k = ce ? r.value : i.value, $ = ce ? r.value : document.body,
|
|
550
|
+
ne && (R(ne), S());
|
|
551
|
+
}, ce = a.scope, k = ce ? r.value : i.value, $ = ce ? r.value : document.body, S = () => {
|
|
552
552
|
$.removeEventListener("mousemove", O, !1), $.removeEventListener("touchmove", O, { passive: !1 }), k.removeEventListener("mouseup", R, !1), k.removeEventListener("mouseenter", j, !1), k.removeEventListener("mouseleave", U, !1), k.removeEventListener("touchend", R, !1), $.removeEventListener("mouseleave", R, !1), $.removeEventListener("mouseup", A, !1), u.isFreeze = !1;
|
|
553
553
|
};
|
|
554
554
|
u.isFreeze = !0, $.addEventListener("mousemove", O, !1), $.addEventListener("touchmove", O, { passive: !1 }), k.addEventListener("mouseup", R, !1), k.addEventListener("mouseenter", j, !1), k.addEventListener("mouseleave", U, !1), k.addEventListener("touchend", R, !1), $.addEventListener("mouseleave", R, !1), $.addEventListener("mouseup", A, !1);
|
|
555
|
-
}, d = (l) => (p(), l.cancelBubble = !0, l.preventDefault(), !1), y = (l) => (
|
|
555
|
+
}, d = (l) => (p(), l.cancelBubble = !0, l.preventDefault(), !1), y = (l) => (s(), l.cancelBubble = !0, l.preventDefault(), !1), p = () => {
|
|
556
556
|
t && t.close && t.close(), _();
|
|
557
|
-
},
|
|
557
|
+
}, s = () => {
|
|
558
558
|
t && t.refresh && t.refresh(), _();
|
|
559
559
|
}, _ = () => {
|
|
560
|
-
u.x =
|
|
560
|
+
u.x = c.thumbX || 0, u.y = c.thumbY || 0;
|
|
561
561
|
};
|
|
562
562
|
return {
|
|
563
563
|
state: u,
|
|
@@ -566,37 +566,37 @@ function ot(s, t, a, r, i, m, c) {
|
|
|
566
566
|
refreshEvent: y,
|
|
567
567
|
resetData: _,
|
|
568
568
|
clearData: () => {
|
|
569
|
-
|
|
569
|
+
n && n(), _();
|
|
570
570
|
},
|
|
571
|
-
refresh:
|
|
571
|
+
refresh: s,
|
|
572
572
|
close: p
|
|
573
573
|
};
|
|
574
574
|
}
|
|
575
|
-
const
|
|
575
|
+
const at = { class: "gc-header gc-header2" }, lt = { class: "gc-loading" }, rt = ["src"], ut = ["src"], dt = { class: "gc-footer" }, ht = { class: "gc-icon-block" }, de = /* @__PURE__ */ q({
|
|
576
576
|
__name: "index",
|
|
577
577
|
props: {
|
|
578
|
-
config: { default:
|
|
578
|
+
config: { default: ye },
|
|
579
579
|
events: { default: () => ({}) },
|
|
580
|
-
data: { default:
|
|
580
|
+
data: { default: ke }
|
|
581
581
|
},
|
|
582
|
-
setup(
|
|
583
|
-
const a =
|
|
582
|
+
setup(c, { expose: t }) {
|
|
583
|
+
const a = c, { data: r, events: i, config: m } = a, n = T({ ...ke(), ...V(r) }), u = T({ ...V(i) }), e = T({ ...ye(), ...V(m) });
|
|
584
584
|
F(() => a.data, (w, g) => {
|
|
585
|
-
Object.assign(
|
|
585
|
+
Object.assign(n, w);
|
|
586
586
|
}, { deep: !0 }), F(() => a.events, (w, g) => {
|
|
587
587
|
Object.assign(u, w);
|
|
588
588
|
}, { deep: !0 }), F(() => a.config, (w, g) => {
|
|
589
589
|
Object.assign(e, w);
|
|
590
590
|
}, { deep: !0 });
|
|
591
|
-
const d = ee(null), y = ee(null), p = ee(null),
|
|
592
|
-
|
|
591
|
+
const d = ee(null), y = ee(null), p = ee(null), s = it(
|
|
592
|
+
n,
|
|
593
593
|
u,
|
|
594
594
|
e,
|
|
595
595
|
d,
|
|
596
596
|
y,
|
|
597
597
|
p,
|
|
598
598
|
() => {
|
|
599
|
-
|
|
599
|
+
n.thumb = "", n.image = "", n.thumbX = 0, n.thumbY = 0, n.thumbWidth = 0, n.thumbHeight = 0;
|
|
600
600
|
}
|
|
601
601
|
), _ = L(() => {
|
|
602
602
|
const w = e.horizontalPadding || 0, g = e.verticalPadding || 0;
|
|
@@ -608,30 +608,30 @@ const it = { class: "gc-header gc-header2" }, at = { class: "gc-loading" }, lt =
|
|
|
608
608
|
paddingBottom: g + "px"
|
|
609
609
|
};
|
|
610
610
|
}), x = L(() => ({
|
|
611
|
-
width:
|
|
612
|
-
height:
|
|
613
|
-
top:
|
|
614
|
-
left:
|
|
611
|
+
width: n.thumbWidth + "px",
|
|
612
|
+
height: n.thumbHeight + "px",
|
|
613
|
+
top: s.state.y + "px",
|
|
614
|
+
left: s.state.x + "px"
|
|
615
615
|
})), l = L(() => ({
|
|
616
616
|
width: e.width + "px",
|
|
617
617
|
height: e.height + "px"
|
|
618
|
-
})), b = L(() =>
|
|
618
|
+
})), b = L(() => n.image && n.image.length > 0), h = L(() => n.thumb && n.thumb.length > 0), C = L(() => (e.width || 0) > 0 || (e.height || 0) > 0), Y = (w) => w.preventDefault();
|
|
619
619
|
return _e(async () => {
|
|
620
620
|
await be(), p.value && p.value.addEventListener("dragstart", Y);
|
|
621
621
|
}), we(() => {
|
|
622
622
|
p.value && p.value.removeEventListener("dragstart", Y);
|
|
623
623
|
}), t({
|
|
624
|
-
reset:
|
|
625
|
-
clear:
|
|
626
|
-
refresh:
|
|
627
|
-
close:
|
|
624
|
+
reset: s.resetData,
|
|
625
|
+
clear: s.clearData,
|
|
626
|
+
refresh: s.refresh,
|
|
627
|
+
close: s.close
|
|
628
628
|
}), (w, g) => K((z(), H("div", {
|
|
629
629
|
class: se(`go-captcha gc-wrapper ${e.showTheme && "gc-theme"}`),
|
|
630
630
|
style: D(_.value),
|
|
631
631
|
ref_key: "rootRef",
|
|
632
632
|
ref: d
|
|
633
633
|
}, [
|
|
634
|
-
o("div",
|
|
634
|
+
o("div", at, [
|
|
635
635
|
o("span", null, ie(e.title), 1)
|
|
636
636
|
]),
|
|
637
637
|
o("div", {
|
|
@@ -640,15 +640,15 @@ const it = { class: "gc-header gc-header2" }, at = { class: "gc-loading" }, lt =
|
|
|
640
640
|
ref: y,
|
|
641
641
|
style: D(l.value)
|
|
642
642
|
}, [
|
|
643
|
-
o("div",
|
|
643
|
+
o("div", lt, [
|
|
644
644
|
I(me)
|
|
645
645
|
]),
|
|
646
646
|
K(o("img", {
|
|
647
647
|
class: "gc-picture",
|
|
648
648
|
style: D(l.value),
|
|
649
|
-
src:
|
|
649
|
+
src: n.image,
|
|
650
650
|
alt: ""
|
|
651
|
-
}, null, 12,
|
|
651
|
+
}, null, 12, rt), [
|
|
652
652
|
[Q, b.value]
|
|
653
653
|
]),
|
|
654
654
|
o("div", {
|
|
@@ -657,40 +657,40 @@ const it = { class: "gc-header gc-header2" }, at = { class: "gc-loading" }, lt =
|
|
|
657
657
|
ref: p,
|
|
658
658
|
style: D(x.value),
|
|
659
659
|
onMousedown: g[0] || (g[0] = //@ts-ignore
|
|
660
|
-
(...f) => v(
|
|
660
|
+
(...f) => v(s).dragEvent && v(s).dragEvent(...f)),
|
|
661
661
|
onTouchstart: g[1] || (g[1] = //@ts-ignore
|
|
662
|
-
(...f) => v(
|
|
662
|
+
(...f) => v(s).dragEvent && v(s).dragEvent(...f))
|
|
663
663
|
}, [
|
|
664
664
|
K(o("img", {
|
|
665
|
-
src:
|
|
665
|
+
src: n.thumb,
|
|
666
666
|
alt: ""
|
|
667
|
-
}, null, 8,
|
|
667
|
+
}, null, 8, ut), [
|
|
668
668
|
[Q, h.value]
|
|
669
669
|
])
|
|
670
670
|
], 36)
|
|
671
671
|
], 4),
|
|
672
|
-
o("div",
|
|
673
|
-
o("div",
|
|
672
|
+
o("div", dt, [
|
|
673
|
+
o("div", ht, [
|
|
674
674
|
I(fe, {
|
|
675
675
|
width: e.iconSize,
|
|
676
676
|
height: e.iconSize,
|
|
677
|
-
onClick: v(
|
|
677
|
+
onClick: v(s).closeEvent
|
|
678
678
|
}, null, 8, ["width", "height", "onClick"]),
|
|
679
679
|
I(ve, {
|
|
680
680
|
width: e.iconSize,
|
|
681
681
|
height: e.iconSize,
|
|
682
|
-
onClick: v(
|
|
682
|
+
onClick: v(s).refreshEvent
|
|
683
683
|
}, null, 8, ["width", "height", "onClick"])
|
|
684
684
|
])
|
|
685
685
|
])
|
|
686
686
|
], 6)), [
|
|
687
|
-
[Q,
|
|
687
|
+
[Q, C.value]
|
|
688
688
|
]);
|
|
689
689
|
}
|
|
690
690
|
});
|
|
691
691
|
de.name = "gocaptcha-slide-region";
|
|
692
|
-
de.install = function(
|
|
693
|
-
|
|
692
|
+
de.install = function(c) {
|
|
693
|
+
c.component("gocaptcha-slide-region", de);
|
|
694
694
|
};
|
|
695
695
|
const pe = () => ({
|
|
696
696
|
width: 300,
|
|
@@ -702,35 +702,36 @@ const pe = () => ({
|
|
|
702
702
|
title: "请拖动滑块完成拼图",
|
|
703
703
|
iconSize: 22,
|
|
704
704
|
scope: !0
|
|
705
|
-
}),
|
|
705
|
+
}), De = () => ({
|
|
706
706
|
angle: 0,
|
|
707
707
|
image: "",
|
|
708
|
-
thumb: ""
|
|
708
|
+
thumb: "",
|
|
709
|
+
thumbSize: 0
|
|
709
710
|
});
|
|
710
|
-
function gt(
|
|
711
|
-
const u = T({ dragLeft: 0, thumbAngle:
|
|
712
|
-
F(() =>
|
|
711
|
+
function gt(c, t, a, r, i, m, n) {
|
|
712
|
+
const u = T({ dragLeft: 0, thumbAngle: c.angle || 0, isFreeze: !1 });
|
|
713
|
+
F(() => c, (l, b) => {
|
|
713
714
|
u.isFreeze || (u.thumbAngle = l.angle || 0);
|
|
714
715
|
}, { deep: !0 });
|
|
715
716
|
const e = (l) => {
|
|
716
717
|
if (!ae(m.value, l))
|
|
717
718
|
return;
|
|
718
|
-
const b = l.touches && l.touches[0], h = i.value.offsetLeft,
|
|
719
|
+
const b = l.touches && l.touches[0], h = i.value.offsetLeft, C = m.value.offsetWidth, Y = i.value.offsetWidth, w = C - Y, g = 360, f = (g - c.angle) / w;
|
|
719
720
|
let E = 0, B = !1, te = null, ne = 0, G = 0;
|
|
720
721
|
b ? ne = b.pageX - h : ne = l.clientX - h;
|
|
721
722
|
const N = (k) => {
|
|
722
723
|
B = !0;
|
|
723
724
|
const $ = k.touches && k.touches[0];
|
|
724
|
-
let
|
|
725
|
-
if ($ ?
|
|
725
|
+
let S = 0;
|
|
726
|
+
if ($ ? S = $.pageX - ne : S = k.clientX - ne, E = c.angle + S * f, S >= w) {
|
|
726
727
|
u.dragLeft = w, u.thumbAngle = G = g;
|
|
727
728
|
return;
|
|
728
729
|
}
|
|
729
|
-
if (
|
|
730
|
-
u.dragLeft = 0, u.thumbAngle = G =
|
|
730
|
+
if (S <= 0) {
|
|
731
|
+
u.dragLeft = 0, u.thumbAngle = G = c.angle;
|
|
731
732
|
return;
|
|
732
733
|
}
|
|
733
|
-
u.dragLeft =
|
|
734
|
+
u.dragLeft = S, u.thumbAngle = G = E, t.rotate && t.rotate(E), k.cancelBubble = !0, k.preventDefault();
|
|
734
735
|
}, P = (k) => {
|
|
735
736
|
ae(m.value, k) && (ce(), B && (B = !1, !(G < 0) && (t.confirm && t.confirm(parseInt(G.toString()), () => {
|
|
736
737
|
_();
|
|
@@ -745,12 +746,12 @@ function gt(s, t, a, r, i, m, c) {
|
|
|
745
746
|
A.removeEventListener("mousemove", N, !1), A.removeEventListener("touchmove", N, { passive: !1 }), j.removeEventListener("mouseup", P, !1), j.removeEventListener("mouseenter", O, !1), j.removeEventListener("mouseleave", Z, !1), j.removeEventListener("touchend", P, !1), A.removeEventListener("mouseleave", P, !1), A.removeEventListener("mouseup", R, !1), u.isFreeze = !1;
|
|
746
747
|
};
|
|
747
748
|
u.isFreeze = !0, A.addEventListener("mousemove", N, !1), A.addEventListener("touchmove", N, { passive: !1 }), j.addEventListener("mouseup", P, !1), j.addEventListener("mouseenter", O, !1), j.addEventListener("mouseleave", Z, !1), j.addEventListener("touchend", P, !1), A.addEventListener("mouseleave", P, !1), A.addEventListener("mouseup", R, !1);
|
|
748
|
-
}, d = (l) => (p(), l.cancelBubble = !0, l.preventDefault(), !1), y = (l) => (
|
|
749
|
+
}, d = (l) => (p(), l.cancelBubble = !0, l.preventDefault(), !1), y = (l) => (s(), l.cancelBubble = !0, l.preventDefault(), !1), p = () => {
|
|
749
750
|
t && t.close && t.close(), _();
|
|
750
|
-
},
|
|
751
|
+
}, s = () => {
|
|
751
752
|
t && t.refresh && t.refresh(), _();
|
|
752
753
|
}, _ = () => {
|
|
753
|
-
u.dragLeft = 0, u.thumbAngle =
|
|
754
|
+
u.dragLeft = 0, u.thumbAngle = c.angle;
|
|
754
755
|
};
|
|
755
756
|
return {
|
|
756
757
|
state: u,
|
|
@@ -759,9 +760,9 @@ function gt(s, t, a, r, i, m, c) {
|
|
|
759
760
|
refreshEvent: y,
|
|
760
761
|
resetData: _,
|
|
761
762
|
clearData: () => {
|
|
762
|
-
|
|
763
|
+
n && n(), _();
|
|
763
764
|
},
|
|
764
|
-
refresh:
|
|
765
|
+
refresh: s,
|
|
765
766
|
close: p
|
|
766
767
|
};
|
|
767
768
|
}
|
|
@@ -770,26 +771,26 @@ const ft = { class: "gc-header" }, vt = { class: "gc-icon-block" }, mt = { class
|
|
|
770
771
|
props: {
|
|
771
772
|
config: { default: pe },
|
|
772
773
|
events: { default: () => ({}) },
|
|
773
|
-
data: { default:
|
|
774
|
+
data: { default: De }
|
|
774
775
|
},
|
|
775
|
-
setup(
|
|
776
|
-
const a =
|
|
776
|
+
setup(c, { expose: t }) {
|
|
777
|
+
const a = c, { data: r, events: i, config: m } = a, n = T({ ...De(), ...V(r) }), u = T({ ...V(i) }), e = T({ ...pe(), ...V(m) });
|
|
777
778
|
F(() => a.data, (g, f) => {
|
|
778
|
-
Object.assign(
|
|
779
|
+
Object.assign(n, g);
|
|
779
780
|
}, { deep: !0 }), F(() => a.events, (g, f) => {
|
|
780
781
|
Object.assign(u, g);
|
|
781
782
|
}, { deep: !0 }), F(() => a.config, (g, f) => {
|
|
782
783
|
Object.assign(e, g);
|
|
783
784
|
}, { deep: !0 });
|
|
784
|
-
const d = ee(null), y = ee(null), p = ee(null),
|
|
785
|
-
|
|
785
|
+
const d = ee(null), y = ee(null), p = ee(null), s = gt(
|
|
786
|
+
n,
|
|
786
787
|
u,
|
|
787
788
|
e,
|
|
788
789
|
d,
|
|
789
790
|
p,
|
|
790
791
|
y,
|
|
791
792
|
() => {
|
|
792
|
-
|
|
793
|
+
n.thumb = "", n.image = "", n.angle = 0;
|
|
793
794
|
}
|
|
794
795
|
), _ = L(() => {
|
|
795
796
|
const g = e.horizontalPadding || 0, f = e.verticalPadding || 0;
|
|
@@ -801,7 +802,11 @@ const ft = { class: "gc-header" }, vt = { class: "gc-icon-block" }, mt = { class
|
|
|
801
802
|
paddingBottom: f + "px"
|
|
802
803
|
};
|
|
803
804
|
}), x = L(() => ({
|
|
804
|
-
transform: `rotate(${
|
|
805
|
+
transform: `rotate(${s.state.thumbAngle}deg)`,
|
|
806
|
+
...n.thumbSize > 0 ? {
|
|
807
|
+
width: n.thumbSize + "px",
|
|
808
|
+
height: n.thumbSize + "px"
|
|
809
|
+
} : {}
|
|
805
810
|
})), l = L(() => ({
|
|
806
811
|
width: e.width + "px",
|
|
807
812
|
height: e.height + "px"
|
|
@@ -811,16 +816,16 @@ const ft = { class: "gc-header" }, vt = { class: "gc-icon-block" }, mt = { class
|
|
|
811
816
|
width: g + "px",
|
|
812
817
|
height: g + "px"
|
|
813
818
|
};
|
|
814
|
-
}), h = L(() =>
|
|
819
|
+
}), h = L(() => n.image && n.image.length > 0), C = L(() => n.thumb && n.thumb.length > 0), Y = L(() => (e.width || 0) > 0 || (e.height || 0) > 0), w = (g) => g.preventDefault();
|
|
815
820
|
return _e(async () => {
|
|
816
821
|
await be(), p.value && p.value.addEventListener("dragstart", w);
|
|
817
822
|
}), we(() => {
|
|
818
823
|
p.value && p.value.removeEventListener("dragstart", w);
|
|
819
824
|
}), t({
|
|
820
|
-
reset:
|
|
821
|
-
clear:
|
|
822
|
-
refresh:
|
|
823
|
-
close:
|
|
825
|
+
reset: s.resetData,
|
|
826
|
+
clear: s.clearData,
|
|
827
|
+
refresh: s.refresh,
|
|
828
|
+
close: s.close
|
|
824
829
|
}), (g, f) => K((z(), H("div", {
|
|
825
830
|
class: se(`go-captcha gc-wrapper ${e.showTheme && "gc-theme"}`),
|
|
826
831
|
style: D(_.value),
|
|
@@ -833,12 +838,12 @@ const ft = { class: "gc-header" }, vt = { class: "gc-icon-block" }, mt = { class
|
|
|
833
838
|
I(fe, {
|
|
834
839
|
width: e.iconSize,
|
|
835
840
|
height: e.iconSize,
|
|
836
|
-
onClick: v(
|
|
841
|
+
onClick: v(s).closeEvent
|
|
837
842
|
}, null, 8, ["width", "height", "onClick"]),
|
|
838
843
|
I(ve, {
|
|
839
844
|
width: e.iconSize,
|
|
840
845
|
height: e.iconSize,
|
|
841
|
-
onClick: v(
|
|
846
|
+
onClick: v(s).refreshEvent
|
|
842
847
|
}, null, 8, ["width", "height", "onClick"])
|
|
843
848
|
])
|
|
844
849
|
]),
|
|
@@ -859,7 +864,7 @@ const ft = { class: "gc-header" }, vt = { class: "gc-icon-block" }, mt = { class
|
|
|
859
864
|
style: D(b.value)
|
|
860
865
|
}, [
|
|
861
866
|
K(o("img", {
|
|
862
|
-
src:
|
|
867
|
+
src: n.image,
|
|
863
868
|
alt: ""
|
|
864
869
|
}, null, 8, pt), [
|
|
865
870
|
[Q, h.value]
|
|
@@ -872,10 +877,10 @@ const ft = { class: "gc-header" }, vt = { class: "gc-icon-block" }, mt = { class
|
|
|
872
877
|
style: D(x.value)
|
|
873
878
|
}, [
|
|
874
879
|
K(o("img", {
|
|
875
|
-
src:
|
|
880
|
+
src: n.thumb,
|
|
876
881
|
alt: ""
|
|
877
882
|
}, null, 8, wt), [
|
|
878
|
-
[Q,
|
|
883
|
+
[Q, C.value]
|
|
879
884
|
])
|
|
880
885
|
], 4)
|
|
881
886
|
])
|
|
@@ -893,15 +898,15 @@ const ft = { class: "gc-header" }, vt = { class: "gc-icon-block" }, mt = { class
|
|
|
893
898
|
ref_key: "dragBlockRef",
|
|
894
899
|
ref: p,
|
|
895
900
|
onMousedown: f[1] || (f[1] = //@ts-ignore
|
|
896
|
-
(...E) => v(
|
|
897
|
-
style: D({ left: v(
|
|
901
|
+
(...E) => v(s).dragEvent && v(s).dragEvent(...E)),
|
|
902
|
+
style: D({ left: v(s).state.dragLeft + "px" })
|
|
898
903
|
}, [
|
|
899
904
|
o("div", {
|
|
900
905
|
class: "gc-drag-block-inline",
|
|
901
906
|
onTouchstart: f[0] || (f[0] = //@ts-ignore
|
|
902
|
-
(...E) => v(
|
|
907
|
+
(...E) => v(s).dragEvent && v(s).dragEvent(...E))
|
|
903
908
|
}, [
|
|
904
|
-
I(
|
|
909
|
+
I(ze)
|
|
905
910
|
], 32)
|
|
906
911
|
], 38)
|
|
907
912
|
], 512)
|
|
@@ -912,8 +917,8 @@ const ft = { class: "gc-header" }, vt = { class: "gc-icon-block" }, mt = { class
|
|
|
912
917
|
}
|
|
913
918
|
});
|
|
914
919
|
he.name = "gocaptcha-rotate";
|
|
915
|
-
he.install = function(
|
|
916
|
-
|
|
920
|
+
he.install = function(c) {
|
|
921
|
+
c.component("gocaptcha-rotate", he);
|
|
917
922
|
};
|
|
918
923
|
const Lt = /* @__PURE__ */ o("circle", {
|
|
919
924
|
fill: "#3E7CFF",
|
|
@@ -930,7 +935,7 @@ const Lt = /* @__PURE__ */ o("circle", {
|
|
|
930
935
|
], Dt = /* @__PURE__ */ q({
|
|
931
936
|
__name: "btn-default-icon",
|
|
932
937
|
emits: ["click"],
|
|
933
|
-
setup(
|
|
938
|
+
setup(c, { emit: t }) {
|
|
934
939
|
const a = t;
|
|
935
940
|
function r(i) {
|
|
936
941
|
a("click", i);
|
|
@@ -951,10 +956,10 @@ const Lt = /* @__PURE__ */ o("circle", {
|
|
|
951
956
|
z`
|
|
952
957
|
}, null, -1), zt = [
|
|
953
958
|
$t
|
|
954
|
-
],
|
|
959
|
+
], St = /* @__PURE__ */ q({
|
|
955
960
|
__name: "btn-warn-icon",
|
|
956
961
|
emits: ["click"],
|
|
957
|
-
setup(
|
|
962
|
+
setup(c, { emit: t }) {
|
|
958
963
|
const a = t;
|
|
959
964
|
function r(i) {
|
|
960
965
|
a("click", i);
|
|
@@ -966,7 +971,7 @@ const Lt = /* @__PURE__ */ o("circle", {
|
|
|
966
971
|
height: "20"
|
|
967
972
|
}, i.$attrs, { onClick: r }), zt, 16));
|
|
968
973
|
}
|
|
969
|
-
}),
|
|
974
|
+
}), Ct = /* @__PURE__ */ o("path", {
|
|
970
975
|
fill: "#ED4630",
|
|
971
976
|
d: `M184,26.6L102.4,2.1h-4.9L16,26.6c-3.3,1.6-5.7,4.9-5.7,8.2v49.8c0,52.2,32.6,94.7,87.3,112.6
|
|
972
977
|
c0.8,0,1.6,0.8,2.4,0.8s1.6,0,2.4-0.8c54.7-18,87.3-59.6,87.3-112.6V34.7C189.8,31.5,187.3,28.2,184,26.6z M134.5,123.1
|
|
@@ -974,11 +979,11 @@ const Lt = /* @__PURE__ */ o("circle", {
|
|
|
974
979
|
c-2,0-4.1-0.8-5.7-2.3c-3.1-3.1-3.1-8.2,0-11.3L88.7,100L65.5,76.9c-3.1-3.1-3.1-8.2,0-11.3c3.1-3.1,8.2-3.1,11.3,0L100,88.7
|
|
975
980
|
l23.1-23.1c3.1-3.1,8.2-3.1,11.3,0c3.1,3.1,3.1,8.2,0,11.3L111.3,100L134.5,123.1z`
|
|
976
981
|
}, null, -1), Bt = [
|
|
977
|
-
|
|
982
|
+
Ct
|
|
978
983
|
], Tt = /* @__PURE__ */ q({
|
|
979
984
|
__name: "btn-error-icon",
|
|
980
985
|
emits: ["click"],
|
|
981
|
-
setup(
|
|
986
|
+
setup(c, { emit: t }) {
|
|
982
987
|
const a = t;
|
|
983
988
|
function r(i) {
|
|
984
989
|
a("click", i);
|
|
@@ -1001,7 +1006,7 @@ const Lt = /* @__PURE__ */ o("circle", {
|
|
|
1001
1006
|
], Wt = /* @__PURE__ */ q({
|
|
1002
1007
|
__name: "btn-success-icon",
|
|
1003
1008
|
emits: ["click"],
|
|
1004
|
-
setup(
|
|
1009
|
+
setup(c, { emit: t }) {
|
|
1005
1010
|
const a = t;
|
|
1006
1011
|
function r(i) {
|
|
1007
1012
|
a("click", i);
|
|
@@ -1013,7 +1018,7 @@ const Lt = /* @__PURE__ */ o("circle", {
|
|
|
1013
1018
|
height: "20"
|
|
1014
1019
|
}, i.$attrs, { onClick: r }), Xt, 16));
|
|
1015
1020
|
}
|
|
1016
|
-
}),
|
|
1021
|
+
}), $e = () => ({
|
|
1017
1022
|
width: 330,
|
|
1018
1023
|
height: 44,
|
|
1019
1024
|
verticalPadding: 12,
|
|
@@ -1021,17 +1026,17 @@ const Lt = /* @__PURE__ */ o("circle", {
|
|
|
1021
1026
|
}), ge = /* @__PURE__ */ q({
|
|
1022
1027
|
__name: "index",
|
|
1023
1028
|
props: {
|
|
1024
|
-
config: { default:
|
|
1029
|
+
config: { default: $e },
|
|
1025
1030
|
clickEvent: {},
|
|
1026
1031
|
disabled: { type: Boolean, default: !1 },
|
|
1027
1032
|
type: { default: "default" },
|
|
1028
1033
|
title: { default: "点击按键进行验证" }
|
|
1029
1034
|
},
|
|
1030
1035
|
emits: ["click-event"],
|
|
1031
|
-
setup(
|
|
1032
|
-
const a =
|
|
1033
|
-
F(() => a.config, (
|
|
1034
|
-
Object.assign(u,
|
|
1036
|
+
setup(c, { emit: t }) {
|
|
1037
|
+
const a = c, { type: r, title: i, disabled: m, config: n } = Te(a), u = T({ ...$e(), ...V(n) });
|
|
1038
|
+
F(() => a.config, (s, _) => {
|
|
1039
|
+
Object.assign(u, s);
|
|
1035
1040
|
}, { deep: !0 });
|
|
1036
1041
|
const e = L(() => ["go-captcha", "gc-btn-block", `gc-${r.value}`, m.value ? "gc-disabled" : ""]), d = L(() => ({
|
|
1037
1042
|
width: u.width + "px",
|
|
@@ -1041,10 +1046,10 @@ const Lt = /* @__PURE__ */ o("circle", {
|
|
|
1041
1046
|
paddingTop: u.verticalPadding + "px",
|
|
1042
1047
|
paddingBottom: u.verticalPadding + "px"
|
|
1043
1048
|
})), y = t;
|
|
1044
|
-
function p(
|
|
1045
|
-
y("click-event",
|
|
1049
|
+
function p(s) {
|
|
1050
|
+
y("click-event", s);
|
|
1046
1051
|
}
|
|
1047
|
-
return (
|
|
1052
|
+
return (s, _) => (z(), H("div", {
|
|
1048
1053
|
class: se(e.value),
|
|
1049
1054
|
style: D(d.value),
|
|
1050
1055
|
onClick: p
|
|
@@ -1052,19 +1057,19 @@ const Lt = /* @__PURE__ */ o("circle", {
|
|
|
1052
1057
|
o("div", {
|
|
1053
1058
|
class: se(v(r) === "default" ? "gc-ripple" : "")
|
|
1054
1059
|
}, [
|
|
1055
|
-
v(r) === "default" ? (z(), le(Dt, { key: 0 })) : v(r) === "warn" ? (z(), le(
|
|
1060
|
+
v(r) === "default" ? (z(), le(Dt, { key: 0 })) : v(r) === "warn" ? (z(), le(St, { key: 1 })) : v(r) === "error" ? (z(), le(Tt, { key: 2 })) : v(r) === "success" ? (z(), le(Wt, { key: 3 })) : Pe("", !0)
|
|
1056
1061
|
], 2),
|
|
1057
1062
|
o("span", null, ie(v(i)), 1)
|
|
1058
1063
|
], 6));
|
|
1059
1064
|
}
|
|
1060
1065
|
});
|
|
1061
1066
|
ge.name = "gocaptcha-button";
|
|
1062
|
-
ge.install = function(
|
|
1063
|
-
|
|
1067
|
+
ge.install = function(c) {
|
|
1068
|
+
c.component("gocaptcha-button", ge);
|
|
1064
1069
|
};
|
|
1065
1070
|
const Ft = {
|
|
1066
|
-
install(
|
|
1067
|
-
re.install(
|
|
1071
|
+
install(c) {
|
|
1072
|
+
re.install(c), ue.install(c), de.install(c), he.install(c), ge.install(c);
|
|
1068
1073
|
}
|
|
1069
1074
|
};
|
|
1070
1075
|
export {
|