go-captcha-vue 2.0.0-beta.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/README.md +141 -0
- package/dist/assets/icons/arrows-icon.vue.d.ts +4 -0
- package/dist/assets/icons/btn-default-icon.vue.d.ts +4 -0
- package/dist/assets/icons/btn-error-icon.vue.d.ts +4 -0
- package/dist/assets/icons/btn-success-icon.vue.d.ts +4 -0
- package/dist/assets/icons/btn-warn-icon.vue.d.ts +4 -0
- package/dist/assets/icons/close-icon.vue.d.ts +4 -0
- package/dist/assets/icons/loading-icon.vue.d.ts +4 -0
- package/dist/assets/icons/refresh-icon.vue.d.ts +4 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.vue.d.ts +49 -0
- package/dist/components/button/meta/config.d.ts +12 -0
- package/dist/components/click/hooks/handler.d.ts +16 -0
- package/dist/components/click/index.d.ts +2 -0
- package/dist/components/click/index.vue.d.ts +42 -0
- package/dist/components/click/meta/config.d.ts +15 -0
- package/dist/components/click/meta/data.d.ts +15 -0
- package/dist/components/click/meta/event.d.ts +13 -0
- package/dist/components/rotate/hooks/handler.d.ts +12 -0
- package/dist/components/rotate/index.d.ts +2 -0
- package/dist/components/rotate/index.vue.d.ts +42 -0
- package/dist/components/rotate/meta/config.d.ts +14 -0
- package/dist/components/rotate/meta/data.d.ts +10 -0
- package/dist/components/rotate/meta/event.d.ts +11 -0
- package/dist/components/slide/hooks/handler.d.ts +12 -0
- package/dist/components/slide/index.d.ts +2 -0
- package/dist/components/slide/index.vue.d.ts +42 -0
- package/dist/components/slide/meta/config.d.ts +15 -0
- package/dist/components/slide/meta/data.d.ts +17 -0
- package/dist/components/slide/meta/event.d.ts +12 -0
- package/dist/components/slide-region/hooks/handler.d.ts +12 -0
- package/dist/components/slide-region/index.d.ts +2 -0
- package/dist/components/slide-region/index.vue.d.ts +42 -0
- package/dist/components/slide-region/meta/config.d.ts +13 -0
- package/dist/components/slide-region/meta/data.d.ts +17 -0
- package/dist/components/slide-region/meta/event.d.ts +12 -0
- package/dist/go-captcha-vue.es.js +1312 -0
- package/dist/go-captcha-vue.umd.js +39 -0
- package/dist/helper/helper.d.ts +10 -0
- package/dist/index.d.ts +5 -0
- package/dist/style.css +1 -0
- package/env.d.ts +16 -0
- package/package.json +62 -0
package/README.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Go Captcha Vue Package
|
|
2
|
+
|
|
3
|
+
```shell
|
|
4
|
+
yarn add go-captcha-vue
|
|
5
|
+
# or
|
|
6
|
+
npm install go-captcha-vue
|
|
7
|
+
# or
|
|
8
|
+
pnpm install go-captcha-vue
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Use Go Captcha
|
|
12
|
+
```vue
|
|
13
|
+
|
|
14
|
+
import "go-captcha-vue/dist/style.css"
|
|
15
|
+
import GoCaptcha from "go-captcha-vue"
|
|
16
|
+
|
|
17
|
+
Vue.use(GoCaptcha)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## 🖖 Click Mode Captcha
|
|
22
|
+
```vue
|
|
23
|
+
<gocaptcha-click
|
|
24
|
+
:config="{}"
|
|
25
|
+
:data="{}"
|
|
26
|
+
:events="{}"
|
|
27
|
+
/>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### params
|
|
31
|
+
```ts
|
|
32
|
+
// config = {}
|
|
33
|
+
interface Config {
|
|
34
|
+
width?: number;
|
|
35
|
+
height?: number;
|
|
36
|
+
thumbWidth?: number;
|
|
37
|
+
thumbHeight?: number;
|
|
38
|
+
verticalPadding?: number;
|
|
39
|
+
horizontalPadding?: number;
|
|
40
|
+
showTheme?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// data = {}
|
|
44
|
+
interface Data {
|
|
45
|
+
image: string;
|
|
46
|
+
thumb: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// events = {}
|
|
50
|
+
interface Events {
|
|
51
|
+
click?: (x: number, y: number) => void;
|
|
52
|
+
refresh?: () => void;
|
|
53
|
+
close?: () => void;
|
|
54
|
+
confirm?: (dots: Array<CaptchaDot>) => boolean;
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## 🖖 Slide Mode Captcha
|
|
59
|
+
```vue
|
|
60
|
+
<gocaptcha-slide
|
|
61
|
+
:config="{}"
|
|
62
|
+
:data="{}"
|
|
63
|
+
:events="{}"
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
<gocaptcha-slide-region
|
|
67
|
+
:config="{}"
|
|
68
|
+
:data="{}"
|
|
69
|
+
:events="{}"
|
|
70
|
+
/>
|
|
71
|
+
```
|
|
72
|
+
### params
|
|
73
|
+
```ts
|
|
74
|
+
// config = {}
|
|
75
|
+
interface Config {
|
|
76
|
+
width?: number;
|
|
77
|
+
height?: number;
|
|
78
|
+
thumbWidth?: number;
|
|
79
|
+
thumbHeight?: number;
|
|
80
|
+
verticalPadding?: number;
|
|
81
|
+
horizontalPadding?: number;
|
|
82
|
+
showTheme?: boolean;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// data = {}
|
|
86
|
+
interface Data {
|
|
87
|
+
thumbX: number;
|
|
88
|
+
thumbY: number;
|
|
89
|
+
thumbWidth: number;
|
|
90
|
+
thumbHeight: number;
|
|
91
|
+
image: string;
|
|
92
|
+
thumb: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// events = {}
|
|
96
|
+
interface Events {
|
|
97
|
+
move?: (x: number, y: number) => void;
|
|
98
|
+
refresh?: () => void;
|
|
99
|
+
close?: () => void;
|
|
100
|
+
confirm?: (point: CaptchaPoint) => boolean;
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
## 🖖 Rotate Mode Captcha
|
|
106
|
+
```vue
|
|
107
|
+
<gocaptcha-rotate
|
|
108
|
+
:config="{}"
|
|
109
|
+
:data="{}"
|
|
110
|
+
:events="{}"
|
|
111
|
+
/>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### params
|
|
115
|
+
```ts
|
|
116
|
+
// config = {}
|
|
117
|
+
interface Config {
|
|
118
|
+
width?: number;
|
|
119
|
+
height?: number;
|
|
120
|
+
thumbWidth?: number;
|
|
121
|
+
thumbHeight?: number;
|
|
122
|
+
verticalPadding?: number;
|
|
123
|
+
horizontalPadding?: number;
|
|
124
|
+
showTheme?: boolean;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// data = {}
|
|
128
|
+
interface Data {
|
|
129
|
+
angle: number;
|
|
130
|
+
image: string;
|
|
131
|
+
thumb: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// events = {}
|
|
135
|
+
interface Events {
|
|
136
|
+
rotate?: (angle: number) => void;
|
|
137
|
+
refresh?: () => void;
|
|
138
|
+
close?: () => void;
|
|
139
|
+
confirm?: (angle: number) => boolean;
|
|
140
|
+
}
|
|
141
|
+
```
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
+
click: (...args: any[]) => void;
|
|
3
|
+
}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
+
click: (...args: any[]) => void;
|
|
3
|
+
}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
+
click: (...args: any[]) => void;
|
|
3
|
+
}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
+
click: (...args: any[]) => void;
|
|
3
|
+
}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
+
click: (...args: any[]) => void;
|
|
3
|
+
}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
+
click: (...args: any[]) => void;
|
|
3
|
+
}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
+
click: (...args: any[]) => void;
|
|
3
|
+
}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
+
click: (...args: any[]) => void;
|
|
3
|
+
}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { CaptchaConfig } from "./meta/config";
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
config?: CaptchaConfig | undefined;
|
|
4
|
+
clickEvent?: (() => void) | undefined;
|
|
5
|
+
disabled?: boolean | undefined;
|
|
6
|
+
type?: "default" | "warn" | "error" | "success" | undefined;
|
|
7
|
+
title?: string | undefined;
|
|
8
|
+
}>, {
|
|
9
|
+
config: () => CaptchaConfig;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
type: string;
|
|
12
|
+
title: string;
|
|
13
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
"click-event": (...args: any[]) => void;
|
|
15
|
+
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
16
|
+
config?: CaptchaConfig | undefined;
|
|
17
|
+
clickEvent?: (() => void) | undefined;
|
|
18
|
+
disabled?: boolean | undefined;
|
|
19
|
+
type?: "default" | "warn" | "error" | "success" | undefined;
|
|
20
|
+
title?: string | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
config: () => CaptchaConfig;
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
type: string;
|
|
25
|
+
title: string;
|
|
26
|
+
}>>>, {
|
|
27
|
+
title: string;
|
|
28
|
+
config: CaptchaConfig;
|
|
29
|
+
type: "default" | "warn" | "error" | "success";
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
export default _default;
|
|
33
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
34
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
35
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
36
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
37
|
+
} : {
|
|
38
|
+
type: import('vue').PropType<T[K]>;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
43
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
44
|
+
default: D[K];
|
|
45
|
+
}> : P[K];
|
|
46
|
+
};
|
|
47
|
+
declare type __VLS_Prettify<T> = {
|
|
48
|
+
[K in keyof T]: T[K];
|
|
49
|
+
} & {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/06/01
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
export interface CaptchaConfig {
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
verticalPadding?: number;
|
|
10
|
+
horizontalPadding?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const defaultConfig: () => CaptchaConfig;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CaptchaData } from "../meta/data";
|
|
2
|
+
import { CaptchaEvent } from "../meta/event";
|
|
3
|
+
export declare function useHandler(_data: CaptchaData, event: CaptchaEvent): {
|
|
4
|
+
dots: {
|
|
5
|
+
list: {
|
|
6
|
+
key: number;
|
|
7
|
+
index: number;
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
}[];
|
|
11
|
+
};
|
|
12
|
+
clickEvent: (e: Event | any) => boolean;
|
|
13
|
+
confirmEvent: (e: Event | any) => boolean;
|
|
14
|
+
closeEvent: (e: Event | any) => boolean;
|
|
15
|
+
refreshEvent: (e: Event | any) => boolean;
|
|
16
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CaptchaConfig } from "./meta/config";
|
|
2
|
+
import { CaptchaData } from "./meta/data";
|
|
3
|
+
import { CaptchaEvent } from "./meta/event";
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
config?: CaptchaConfig | undefined;
|
|
6
|
+
events?: CaptchaEvent | undefined;
|
|
7
|
+
data: CaptchaData;
|
|
8
|
+
}>, {
|
|
9
|
+
config: () => CaptchaConfig;
|
|
10
|
+
events: () => CaptchaEvent;
|
|
11
|
+
data: () => CaptchaData;
|
|
12
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
+
config?: CaptchaConfig | undefined;
|
|
14
|
+
events?: CaptchaEvent | undefined;
|
|
15
|
+
data: CaptchaData;
|
|
16
|
+
}>, {
|
|
17
|
+
config: () => CaptchaConfig;
|
|
18
|
+
events: () => CaptchaEvent;
|
|
19
|
+
data: () => CaptchaData;
|
|
20
|
+
}>>>, {
|
|
21
|
+
data: CaptchaData;
|
|
22
|
+
config: CaptchaConfig;
|
|
23
|
+
events: CaptchaEvent;
|
|
24
|
+
}>;
|
|
25
|
+
export default _default;
|
|
26
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
28
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
29
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
30
|
+
} : {
|
|
31
|
+
type: import('vue').PropType<T[K]>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
36
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
37
|
+
default: D[K];
|
|
38
|
+
}> : P[K];
|
|
39
|
+
};
|
|
40
|
+
declare type __VLS_Prettify<T> = {
|
|
41
|
+
[K in keyof T]: T[K];
|
|
42
|
+
} & {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/06/01
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
export interface CaptchaConfig {
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
thumbWidth?: number;
|
|
10
|
+
thumbHeight?: number;
|
|
11
|
+
verticalPadding?: number;
|
|
12
|
+
horizontalPadding?: number;
|
|
13
|
+
showTheme?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const defaultConfig: () => CaptchaConfig;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/05/25
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
import { CaptchaDot } from "./data";
|
|
7
|
+
export interface CaptchaEvent {
|
|
8
|
+
click?: (x: number, y: number) => void;
|
|
9
|
+
callback?: () => void;
|
|
10
|
+
refresh?: () => void;
|
|
11
|
+
close?: () => void;
|
|
12
|
+
confirm?: (dots: Array<CaptchaDot>, clear: (fn: Function) => void) => void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CaptchaData } from "../meta/data";
|
|
2
|
+
import { CaptchaEvent } from "../meta/event";
|
|
3
|
+
import { Ref } from "vue/types/v3-generated";
|
|
4
|
+
export declare function useHandler(data: CaptchaData, event: CaptchaEvent, dragBlockRef: Ref, dragBarRef: Ref): {
|
|
5
|
+
state: {
|
|
6
|
+
dragLeft: number;
|
|
7
|
+
thumbAngle: number;
|
|
8
|
+
};
|
|
9
|
+
dragEvent: (e: Event | any) => void;
|
|
10
|
+
closeEvent: (e: Event | any) => boolean;
|
|
11
|
+
refreshEvent: (e: Event | any) => boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CaptchaConfig } from "./meta/config";
|
|
2
|
+
import { CaptchaData } from "./meta/data";
|
|
3
|
+
import { CaptchaEvent } from "./meta/event";
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
config?: CaptchaConfig | undefined;
|
|
6
|
+
events?: CaptchaEvent | undefined;
|
|
7
|
+
data: CaptchaData;
|
|
8
|
+
}>, {
|
|
9
|
+
config: () => CaptchaConfig;
|
|
10
|
+
events: () => CaptchaEvent;
|
|
11
|
+
data: () => CaptchaData;
|
|
12
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
+
config?: CaptchaConfig | undefined;
|
|
14
|
+
events?: CaptchaEvent | undefined;
|
|
15
|
+
data: CaptchaData;
|
|
16
|
+
}>, {
|
|
17
|
+
config: () => CaptchaConfig;
|
|
18
|
+
events: () => CaptchaEvent;
|
|
19
|
+
data: () => CaptchaData;
|
|
20
|
+
}>>>, {
|
|
21
|
+
data: CaptchaData;
|
|
22
|
+
config: CaptchaConfig;
|
|
23
|
+
events: CaptchaEvent;
|
|
24
|
+
}>;
|
|
25
|
+
export default _default;
|
|
26
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
28
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
29
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
30
|
+
} : {
|
|
31
|
+
type: import('vue').PropType<T[K]>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
36
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
37
|
+
default: D[K];
|
|
38
|
+
}> : P[K];
|
|
39
|
+
};
|
|
40
|
+
declare type __VLS_Prettify<T> = {
|
|
41
|
+
[K in keyof T]: T[K];
|
|
42
|
+
} & {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/06/01
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
export interface CaptchaConfig {
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
size?: number;
|
|
10
|
+
verticalPadding?: number;
|
|
11
|
+
horizontalPadding?: number;
|
|
12
|
+
showTheme?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const defaultConfig: () => CaptchaConfig;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/06/01
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
export interface CaptchaEvent {
|
|
7
|
+
rotate?: (angle: number) => void;
|
|
8
|
+
refresh?: () => void;
|
|
9
|
+
close?: () => void;
|
|
10
|
+
confirm?: (angle: number, clear: (fn: Function) => void) => void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CaptchaData } from "../meta/data";
|
|
2
|
+
import { CaptchaEvent } from "../meta/event";
|
|
3
|
+
import { Ref } from "vue/types/v3-generated";
|
|
4
|
+
export declare function useHandler(data: CaptchaData, event: CaptchaEvent, containerRef: Ref, tileRef: Ref, dragBlockRef: Ref, dragBarRef: Ref): {
|
|
5
|
+
state: {
|
|
6
|
+
dragLeft: number;
|
|
7
|
+
thumbLeft: number;
|
|
8
|
+
};
|
|
9
|
+
dragEvent: (e: Event | any) => void;
|
|
10
|
+
closeEvent: (e: Event | any) => boolean;
|
|
11
|
+
refreshEvent: (e: Event | any) => boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CaptchaConfig } from "./meta/config";
|
|
2
|
+
import { CaptchaData } from "./meta/data";
|
|
3
|
+
import { CaptchaEvent } from "./meta/event";
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
config?: CaptchaConfig | undefined;
|
|
6
|
+
events?: CaptchaEvent | undefined;
|
|
7
|
+
data: CaptchaData;
|
|
8
|
+
}>, {
|
|
9
|
+
config: () => CaptchaConfig;
|
|
10
|
+
events: () => CaptchaEvent;
|
|
11
|
+
data: () => CaptchaData;
|
|
12
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
+
config?: CaptchaConfig | undefined;
|
|
14
|
+
events?: CaptchaEvent | undefined;
|
|
15
|
+
data: CaptchaData;
|
|
16
|
+
}>, {
|
|
17
|
+
config: () => CaptchaConfig;
|
|
18
|
+
events: () => CaptchaEvent;
|
|
19
|
+
data: () => CaptchaData;
|
|
20
|
+
}>>>, {
|
|
21
|
+
data: CaptchaData;
|
|
22
|
+
config: CaptchaConfig;
|
|
23
|
+
events: CaptchaEvent;
|
|
24
|
+
}>;
|
|
25
|
+
export default _default;
|
|
26
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
28
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
29
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
30
|
+
} : {
|
|
31
|
+
type: import('vue').PropType<T[K]>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
36
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
37
|
+
default: D[K];
|
|
38
|
+
}> : P[K];
|
|
39
|
+
};
|
|
40
|
+
declare type __VLS_Prettify<T> = {
|
|
41
|
+
[K in keyof T]: T[K];
|
|
42
|
+
} & {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/06/01
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
export interface CaptchaConfig {
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
thumbWidth?: number;
|
|
10
|
+
thumbHeight?: number;
|
|
11
|
+
verticalPadding?: number;
|
|
12
|
+
horizontalPadding?: number;
|
|
13
|
+
showTheme?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const defaultConfig: () => CaptchaConfig;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/06/01
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
export interface CaptchaData {
|
|
7
|
+
thumbX: number;
|
|
8
|
+
thumbY: number;
|
|
9
|
+
thumbWidth: number;
|
|
10
|
+
thumbHeight: number;
|
|
11
|
+
image: string;
|
|
12
|
+
thumb: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CaptchaPoint {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/06/01
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
import { CaptchaPoint } from "./data";
|
|
7
|
+
export interface CaptchaEvent {
|
|
8
|
+
move?: (x: number, y: number) => void;
|
|
9
|
+
refresh?: () => void;
|
|
10
|
+
close?: () => void;
|
|
11
|
+
confirm?: (point: CaptchaPoint, clear: (fn: Function) => void) => void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CaptchaData } from "../meta/data";
|
|
2
|
+
import { CaptchaEvent } from "../meta/event";
|
|
3
|
+
import { Ref } from "vue/types/v3-generated";
|
|
4
|
+
export declare function useHandler(data: CaptchaData, event: CaptchaEvent, containerRef: Ref, tileRef: Ref): {
|
|
5
|
+
state: {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
};
|
|
9
|
+
dragEvent: (e: Event | any) => void;
|
|
10
|
+
closeEvent: (e: Event | any) => boolean;
|
|
11
|
+
refreshEvent: (e: Event | any) => boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CaptchaConfig } from "./meta/config";
|
|
2
|
+
import { CaptchaData } from "./meta/data";
|
|
3
|
+
import { CaptchaEvent } from "./meta/event";
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
config?: CaptchaConfig | undefined;
|
|
6
|
+
events?: CaptchaEvent | undefined;
|
|
7
|
+
data: CaptchaData;
|
|
8
|
+
}>, {
|
|
9
|
+
config: () => CaptchaConfig;
|
|
10
|
+
events: () => CaptchaEvent;
|
|
11
|
+
data: () => CaptchaData;
|
|
12
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
+
config?: CaptchaConfig | undefined;
|
|
14
|
+
events?: CaptchaEvent | undefined;
|
|
15
|
+
data: CaptchaData;
|
|
16
|
+
}>, {
|
|
17
|
+
config: () => CaptchaConfig;
|
|
18
|
+
events: () => CaptchaEvent;
|
|
19
|
+
data: () => CaptchaData;
|
|
20
|
+
}>>>, {
|
|
21
|
+
data: CaptchaData;
|
|
22
|
+
config: CaptchaConfig;
|
|
23
|
+
events: CaptchaEvent;
|
|
24
|
+
}>;
|
|
25
|
+
export default _default;
|
|
26
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
28
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
29
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
30
|
+
} : {
|
|
31
|
+
type: import('vue').PropType<T[K]>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
36
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
37
|
+
default: D[K];
|
|
38
|
+
}> : P[K];
|
|
39
|
+
};
|
|
40
|
+
declare type __VLS_Prettify<T> = {
|
|
41
|
+
[K in keyof T]: T[K];
|
|
42
|
+
} & {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/06/01
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
export interface CaptchaConfig {
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
verticalPadding?: number;
|
|
10
|
+
horizontalPadding?: number;
|
|
11
|
+
showTheme?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const defaultConfig: () => CaptchaConfig;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/06/01
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
export interface CaptchaData {
|
|
7
|
+
thumbX: number;
|
|
8
|
+
thumbY: number;
|
|
9
|
+
thumbWidth: number;
|
|
10
|
+
thumbHeight: number;
|
|
11
|
+
image: string;
|
|
12
|
+
thumb: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CaptchaPoint {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}
|