go-captcha-vue 1.0.0-pre.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/LICENSE +21 -0
- package/README.md +225 -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 +7 -0
- package/dist/components/button/index.vue.d.ts +50 -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 +17 -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 +15 -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 +16 -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 +14 -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 +1369 -0
- package/dist/go-captcha-vue.umd.js +39 -0
- package/dist/helper/helper.d.ts +10 -0
- package/dist/index.d.ts +11 -0
- package/dist/style.css +1 -0
- package/env.d.ts +16 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Awen <wengaolng@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# Go Captcha Vue Package
|
|
2
|
+
|
|
3
|
+
<br/>
|
|
4
|
+
|
|
5
|
+
| Vue Version | Go Captcha Version |
|
|
6
|
+
|:-----------------------|:------------------:|
|
|
7
|
+
| vue >= 2.7.14 && < 3.0 | go-captcha-vue@^1 |
|
|
8
|
+
| vue >= 3.0 | go-captcha-vue@^2 |
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
```shell
|
|
12
|
+
# Greater than or equal to vue2.7.14 and less than vue3.0
|
|
13
|
+
yarn add go-captcha-vue@^1
|
|
14
|
+
# or
|
|
15
|
+
npm install go-captcha-vue@^1
|
|
16
|
+
# or
|
|
17
|
+
pnpm install go-captcha-vue@^1
|
|
18
|
+
|
|
19
|
+
############################################
|
|
20
|
+
# Greater than vue3.0
|
|
21
|
+
yarn add go-captcha-vue@^2
|
|
22
|
+
# or
|
|
23
|
+
npm install go-captcha-vue@^2
|
|
24
|
+
# or
|
|
25
|
+
pnpm install go-captcha-vue@^2
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Use Go Captcha
|
|
29
|
+
```ts
|
|
30
|
+
import "go-captcha-vue/dist/style.css"
|
|
31
|
+
import GoCaptcha from "go-captcha-vue"
|
|
32
|
+
|
|
33
|
+
Vue.use(GoCaptcha)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 🖖 Click Mode Captcha
|
|
37
|
+
```vue
|
|
38
|
+
<gocaptcha-click
|
|
39
|
+
:config="{}"
|
|
40
|
+
:data="{}"
|
|
41
|
+
:events="{}"
|
|
42
|
+
/>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Parameter Reference
|
|
46
|
+
```ts
|
|
47
|
+
// config = {}
|
|
48
|
+
interface ClickConfig {
|
|
49
|
+
width?: number;
|
|
50
|
+
height?: number;
|
|
51
|
+
thumbWidth?: number;
|
|
52
|
+
thumbHeight?: number;
|
|
53
|
+
verticalPadding?: number;
|
|
54
|
+
horizontalPadding?: number;
|
|
55
|
+
showTheme?: boolean;
|
|
56
|
+
title?: string;
|
|
57
|
+
buttonText?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// data = {}
|
|
61
|
+
interface ClickData {
|
|
62
|
+
image: string;
|
|
63
|
+
thumb: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// events = {}
|
|
67
|
+
interface ClickEvents {
|
|
68
|
+
click?: (x: number, y: number) => void;
|
|
69
|
+
refresh?: () => void;
|
|
70
|
+
close?: () => void;
|
|
71
|
+
confirm?: (dots: Array<ClickDot>) => boolean;
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 🖖 Slide Mode Captcha
|
|
76
|
+
```vue
|
|
77
|
+
<gocaptcha-slide
|
|
78
|
+
:config="{}"
|
|
79
|
+
:data="{}"
|
|
80
|
+
:events="{}"
|
|
81
|
+
/>
|
|
82
|
+
|
|
83
|
+
<gocaptcha-slide-region
|
|
84
|
+
:config="{}"
|
|
85
|
+
:data="{}"
|
|
86
|
+
:events="{}"
|
|
87
|
+
/>
|
|
88
|
+
```
|
|
89
|
+
### Parameter Reference
|
|
90
|
+
```ts
|
|
91
|
+
// config = {}
|
|
92
|
+
interface SlideConfig {
|
|
93
|
+
width?: number;
|
|
94
|
+
height?: number;
|
|
95
|
+
thumbWidth?: number;
|
|
96
|
+
thumbHeight?: number;
|
|
97
|
+
verticalPadding?: number;
|
|
98
|
+
horizontalPadding?: number;
|
|
99
|
+
showTheme?: boolean;
|
|
100
|
+
title?: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// data = {}
|
|
104
|
+
interface SlideData {
|
|
105
|
+
thumbX: number;
|
|
106
|
+
thumbY: number;
|
|
107
|
+
thumbWidth: number;
|
|
108
|
+
thumbHeight: number;
|
|
109
|
+
image: string;
|
|
110
|
+
thumb: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// events = {}
|
|
114
|
+
interface SlideEvents {
|
|
115
|
+
move?: (x: number, y: number) => void;
|
|
116
|
+
refresh?: () => void;
|
|
117
|
+
close?: () => void;
|
|
118
|
+
confirm?: (point: SlidePoint) => boolean;
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
```ts
|
|
122
|
+
// config = {}
|
|
123
|
+
interface SlideRegionConfig {
|
|
124
|
+
width?: number;
|
|
125
|
+
height?: number;
|
|
126
|
+
thumbWidth?: number;
|
|
127
|
+
thumbHeight?: number;
|
|
128
|
+
verticalPadding?: number;
|
|
129
|
+
horizontalPadding?: number;
|
|
130
|
+
showTheme?: boolean;
|
|
131
|
+
title?: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// data = {}
|
|
135
|
+
interface SlideRegionData {
|
|
136
|
+
thumbX: number;
|
|
137
|
+
thumbY: number;
|
|
138
|
+
thumbWidth: number;
|
|
139
|
+
thumbHeight: number;
|
|
140
|
+
image: string;
|
|
141
|
+
thumb: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// events = {}
|
|
145
|
+
interface SlideRegionEvents {
|
|
146
|
+
move?: (x: number, y: number) => void;
|
|
147
|
+
refresh?: () => void;
|
|
148
|
+
close?: () => void;
|
|
149
|
+
confirm?: (point: SlideRegionPoint) => boolean;
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## 🖖 Rotate Mode Captcha
|
|
154
|
+
```vue
|
|
155
|
+
<gocaptcha-rotate
|
|
156
|
+
:config="{}"
|
|
157
|
+
:data="{}"
|
|
158
|
+
:events="{}"
|
|
159
|
+
/>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Parameter Reference
|
|
163
|
+
```ts
|
|
164
|
+
// config = {}
|
|
165
|
+
interface RotateConfig {
|
|
166
|
+
width?: number;
|
|
167
|
+
height?: number;
|
|
168
|
+
thumbWidth?: number;
|
|
169
|
+
thumbHeight?: number;
|
|
170
|
+
verticalPadding?: number;
|
|
171
|
+
horizontalPadding?: number;
|
|
172
|
+
showTheme?: boolean;
|
|
173
|
+
title?: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// data = {}
|
|
177
|
+
interface RotateData {
|
|
178
|
+
angle: number;
|
|
179
|
+
image: string;
|
|
180
|
+
thumb: string;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// events = {}
|
|
184
|
+
interface RotateEvents {
|
|
185
|
+
rotate?: (angle: number) => void;
|
|
186
|
+
refresh?: () => void;
|
|
187
|
+
close?: () => void;
|
|
188
|
+
confirm?: (angle: number) => boolean;
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
## Button
|
|
194
|
+
```vue
|
|
195
|
+
<gocaptcha-button />
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### params
|
|
199
|
+
```ts
|
|
200
|
+
interface _ {
|
|
201
|
+
config?: ButtonConfig;
|
|
202
|
+
clickEvent?: () => void;
|
|
203
|
+
disabled?: boolean;
|
|
204
|
+
type?: "default" | "warn" | "error" | "success";
|
|
205
|
+
title?: string;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export interface ButtonConfig {
|
|
209
|
+
width?: number;
|
|
210
|
+
height?: number;
|
|
211
|
+
verticalPadding?: number;
|
|
212
|
+
horizontalPadding?: number;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
<br/>
|
|
218
|
+
|
|
219
|
+
## 🍹 Buy me a coffee
|
|
220
|
+
<div>
|
|
221
|
+
<a href="http://witkeycode.com/sponsor" target="_blank"><img src="http://47.104.180.148/payment-code/wxpay.png" alt="Buy Me A Coffee" style="width: 217px !important;" ></a>
|
|
222
|
+
<a href="http://witkeycode.com/sponsor" target="_blank"><img src="http://47.104.180.148/payment-code/alipay.png" alt="Buy Me A Coffee" style="width: 217px !important;" ></a>
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
<br/>
|
|
@@ -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,50 @@
|
|
|
1
|
+
import { ButtonConfig } from "./meta/config";
|
|
2
|
+
import { ButtonType } from "@/components/button/meta/types";
|
|
3
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
config?: ButtonConfig | undefined;
|
|
5
|
+
clickEvent?: (() => void) | undefined;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
type?: ButtonType | undefined;
|
|
8
|
+
title?: string | undefined;
|
|
9
|
+
}>, {
|
|
10
|
+
config: () => ButtonConfig;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
type: string;
|
|
13
|
+
title: string;
|
|
14
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
"click-event": (...args: any[]) => void;
|
|
16
|
+
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
17
|
+
config?: ButtonConfig | undefined;
|
|
18
|
+
clickEvent?: (() => void) | undefined;
|
|
19
|
+
disabled?: boolean | undefined;
|
|
20
|
+
type?: ButtonType | undefined;
|
|
21
|
+
title?: string | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
config: () => ButtonConfig;
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
type: string;
|
|
26
|
+
title: string;
|
|
27
|
+
}>>>, {
|
|
28
|
+
title: string;
|
|
29
|
+
config: ButtonConfig;
|
|
30
|
+
type: ButtonType;
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
export default _default;
|
|
34
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
35
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
36
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
37
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
38
|
+
} : {
|
|
39
|
+
type: import('vue').PropType<T[K]>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
44
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
45
|
+
default: D[K];
|
|
46
|
+
}> : P[K];
|
|
47
|
+
};
|
|
48
|
+
declare type __VLS_Prettify<T> = {
|
|
49
|
+
[K in keyof T]: T[K];
|
|
50
|
+
} & {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/06/01
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
export interface ButtonConfig {
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
verticalPadding?: number;
|
|
10
|
+
horizontalPadding?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const defaultConfig: () => ButtonConfig;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ClickData } from "../meta/data";
|
|
2
|
+
import { ClickEvent } from "../meta/event";
|
|
3
|
+
export declare function useHandler(_data: ClickData, event: ClickEvent): {
|
|
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 { ClickConfig } from "./meta/config";
|
|
2
|
+
import { ClickData } from "./meta/data";
|
|
3
|
+
import { ClickEvent } from "./meta/event";
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
config?: ClickConfig | undefined;
|
|
6
|
+
events?: ClickEvent | undefined;
|
|
7
|
+
data: ClickData;
|
|
8
|
+
}>, {
|
|
9
|
+
config: () => ClickConfig;
|
|
10
|
+
events: () => ClickEvent;
|
|
11
|
+
data: () => ClickData;
|
|
12
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
+
config?: ClickConfig | undefined;
|
|
14
|
+
events?: ClickEvent | undefined;
|
|
15
|
+
data: ClickData;
|
|
16
|
+
}>, {
|
|
17
|
+
config: () => ClickConfig;
|
|
18
|
+
events: () => ClickEvent;
|
|
19
|
+
data: () => ClickData;
|
|
20
|
+
}>>>, {
|
|
21
|
+
data: ClickData;
|
|
22
|
+
config: ClickConfig;
|
|
23
|
+
events: ClickEvent;
|
|
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,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/06/01
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
export interface ClickConfig {
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
thumbWidth?: number;
|
|
10
|
+
thumbHeight?: number;
|
|
11
|
+
verticalPadding?: number;
|
|
12
|
+
horizontalPadding?: number;
|
|
13
|
+
showTheme?: boolean;
|
|
14
|
+
title?: string;
|
|
15
|
+
buttonText?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const defaultConfig: () => ClickConfig;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/05/25
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
import type { ClickDot } from "./data";
|
|
7
|
+
export interface ClickEvent {
|
|
8
|
+
click?: (x: number, y: number) => void;
|
|
9
|
+
callback?: () => void;
|
|
10
|
+
refresh?: () => void;
|
|
11
|
+
close?: () => void;
|
|
12
|
+
confirm?: (dots: Array<ClickDot>, clear: (fn: Function) => void) => void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RotateData } from "../meta/data";
|
|
2
|
+
import { RotateEvent } from "../meta/event";
|
|
3
|
+
import { Ref } from "vue";
|
|
4
|
+
export declare function useHandler(data: RotateData, event: RotateEvent, 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 { RotateConfig } from "./meta/config";
|
|
2
|
+
import { RotateData } from "./meta/data";
|
|
3
|
+
import { RotateEvent } from "./meta/event";
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
config?: RotateConfig | undefined;
|
|
6
|
+
events?: RotateEvent | undefined;
|
|
7
|
+
data: RotateData;
|
|
8
|
+
}>, {
|
|
9
|
+
config: () => RotateConfig;
|
|
10
|
+
events: () => RotateEvent;
|
|
11
|
+
data: () => RotateData;
|
|
12
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
+
config?: RotateConfig | undefined;
|
|
14
|
+
events?: RotateEvent | undefined;
|
|
15
|
+
data: RotateData;
|
|
16
|
+
}>, {
|
|
17
|
+
config: () => RotateConfig;
|
|
18
|
+
events: () => RotateEvent;
|
|
19
|
+
data: () => RotateData;
|
|
20
|
+
}>>>, {
|
|
21
|
+
data: RotateData;
|
|
22
|
+
config: RotateConfig;
|
|
23
|
+
events: RotateEvent;
|
|
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 RotateConfig {
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
size?: number;
|
|
10
|
+
verticalPadding?: number;
|
|
11
|
+
horizontalPadding?: number;
|
|
12
|
+
showTheme?: boolean;
|
|
13
|
+
title?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const defaultConfig: () => RotateConfig;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/06/01
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
export interface RotateEvent {
|
|
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 { SlideData } from "../meta/data";
|
|
2
|
+
import { SlideEvent } from "../meta/event";
|
|
3
|
+
import { Ref } from "vue";
|
|
4
|
+
export declare function useHandler(data: SlideData, event: SlideEvent, 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 { SlideConfig } from "./meta/config";
|
|
2
|
+
import { SlideData } from "./meta/data";
|
|
3
|
+
import { SlideEvent } from "./meta/event";
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
config?: SlideConfig | undefined;
|
|
6
|
+
events?: SlideEvent | undefined;
|
|
7
|
+
data: SlideData;
|
|
8
|
+
}>, {
|
|
9
|
+
config: () => SlideConfig;
|
|
10
|
+
events: () => SlideEvent;
|
|
11
|
+
data: () => SlideData;
|
|
12
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
+
config?: SlideConfig | undefined;
|
|
14
|
+
events?: SlideEvent | undefined;
|
|
15
|
+
data: SlideData;
|
|
16
|
+
}>, {
|
|
17
|
+
config: () => SlideConfig;
|
|
18
|
+
events: () => SlideEvent;
|
|
19
|
+
data: () => SlideData;
|
|
20
|
+
}>>>, {
|
|
21
|
+
data: SlideData;
|
|
22
|
+
config: SlideConfig;
|
|
23
|
+
events: SlideEvent;
|
|
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,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/06/01
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
export interface SlideConfig {
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
thumbWidth?: number;
|
|
10
|
+
thumbHeight?: number;
|
|
11
|
+
verticalPadding?: number;
|
|
12
|
+
horizontalPadding?: number;
|
|
13
|
+
showTheme?: boolean;
|
|
14
|
+
title?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const defaultConfig: () => SlideConfig;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author Awen
|
|
3
|
+
* @Date 2024/06/01
|
|
4
|
+
* @Email wengaolng@gmail.com
|
|
5
|
+
**/
|
|
6
|
+
export interface SlideData {
|
|
7
|
+
thumbX: number;
|
|
8
|
+
thumbY: number;
|
|
9
|
+
thumbWidth: number;
|
|
10
|
+
thumbHeight: number;
|
|
11
|
+
image: string;
|
|
12
|
+
thumb: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SlidePoint {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}
|