@mcistudio/unoui-vue 1.2.7 → 1.3.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 +1 -1
- package/dist/captcha/Captcha.vue.d.ts +113 -0
- package/dist/captcha/index.d.ts +74 -0
- package/dist/captcha/index.js +2 -0
- package/dist/checkbox/Checkbox.vue.d.ts +2 -2
- package/dist/checkbox/CheckboxGroup.vue.d.ts +2 -2
- package/dist/chunks/IconPicker-B0EhOCL1.js +632 -0
- package/dist/chunks/IconPicker-B0EhOCL1.js.map +1 -0
- package/dist/chunks/captcha-DM3F32sM.js +401 -0
- package/dist/chunks/captcha-DM3F32sM.js.map +1 -0
- package/dist/config.d.ts +8 -1
- package/dist/config.js +19 -18
- package/dist/config.js.map +1 -1
- package/dist/datepicker/DatePicker.vue.d.ts +5 -5
- package/dist/datepicker/RangePicker.vue.d.ts +5 -5
- package/dist/iconpicker/IconPicker.vue.d.ts +43 -0
- package/dist/iconpicker/index.d.ts +27 -0
- package/dist/iconpicker/index.js +2 -0
- package/dist/iconpicker/svg-icon.d.ts +23 -0
- package/dist/imageeditor/ImageEditor.vue.d.ts +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.js +32 -30
- package/dist/input/Autocomplete.vue.d.ts +8 -8
- package/dist/input/Input.vue.d.ts +8 -8
- package/dist/input/InputI18n.vue.d.ts +7 -7
- package/dist/input/InputTag.vue.d.ts +8 -8
- package/dist/inputOtp/InputOtp.vue.d.ts +6 -6
- package/dist/qrcode/QRCode.vue.d.ts +1 -1
- package/dist/radio/Radio.vue.d.ts +3 -3
- package/dist/radio/RadioGroup.vue.d.ts +2 -2
- package/dist/rate/Rate.vue.d.ts +4 -4
- package/dist/select/Select.vue.d.ts +6 -6
- package/dist/slider/Slider.vue.d.ts +4 -4
- package/dist/splitter/Splitter.vue.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/switch/Switch.vue.d.ts +6 -6
- package/dist/tab/Tabs.vue.d.ts +1 -1
- package/dist/timepicker/TimePicker.vue.d.ts +5 -5
- package/dist/timepicker/TimeRangePicker.vue.d.ts +5 -5
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -98,7 +98,7 @@ Set `data-theme="dark"` on the document root to enable the dark theme. The light
|
|
|
98
98
|
| --------------------- | --------------------------------------------------------------------------------------------- |
|
|
99
99
|
| Layout | `Splitter`, `SplitterPanel` |
|
|
100
100
|
| General | `Button`, `ButtonGroup`, `Tag`, `Badge`, `BadgeRibbon` |
|
|
101
|
-
| Form | `Form`, `FormItem`, `Input`, `Autocomplete`, `InputTag`, `InputI18n`, `InputOtp`
|
|
101
|
+
| Form | `Form`, `FormItem`, `Input`, `Autocomplete`, `InputTag`, `InputI18n`, `Captcha`, `InputOtp` |
|
|
102
102
|
| Selection | `Checkbox`, `CheckboxGroup`, `Radio`, `RadioGroup`, `Switch`, `Select` |
|
|
103
103
|
| Date and numeric | `DatePicker`, `RangePicker`, `TimePicker`, `TimeRangePicker`, `Slider`, `ColorPicker`, `Rate` |
|
|
104
104
|
| Media | `ImageEditor` |
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { type CaptchaChallenge, type CaptchaImageReferrerPolicy, type CaptchaProvider, type CaptchaProps, type CaptchaVerifyFailure, type CaptchaVerifySuccess } from '.';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** modelValue 是后端验证成功后签发的一次性票据,不是用户输入的答案。 */
|
|
4
|
+
modelValue?: string;
|
|
5
|
+
/** provider 覆盖 configureUnoUI({ captcha }) 中配置的宿主后端服务。 */
|
|
6
|
+
provider?: CaptchaProvider;
|
|
7
|
+
/** size 是输入区和图片按钮尺寸,默认 md。 */
|
|
8
|
+
size?: CaptchaProps['size'];
|
|
9
|
+
/** disabled 表示是否禁用输入和刷新。 */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** readonly 表示是否只读展示,不发起答案校验。 */
|
|
12
|
+
readonly?: boolean;
|
|
13
|
+
/** placeholder 是答案输入框占位文案。 */
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
/** ariaLabel 是答案输入框的无障碍标签。 */
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
/** imageAlt 是验证码图片的无障碍描述,画面文字本身不应写入 alt。 */
|
|
18
|
+
imageAlt?: string;
|
|
19
|
+
/** refreshAriaLabel 是图片刷新按钮的无障碍标签。 */
|
|
20
|
+
refreshAriaLabel?: string;
|
|
21
|
+
/** loadingText 是挑战加载中的文案。 */
|
|
22
|
+
loadingText?: string;
|
|
23
|
+
/** verifyingText 是后端校验中的文案。 */
|
|
24
|
+
verifyingText?: string;
|
|
25
|
+
/** verifiedText 是验证成功文案。 */
|
|
26
|
+
verifiedText?: string;
|
|
27
|
+
/** requiredText 是未填写答案时的提示。 */
|
|
28
|
+
requiredText?: string;
|
|
29
|
+
/** invalidText 是后端拒绝答案时的默认提示。 */
|
|
30
|
+
invalidText?: string;
|
|
31
|
+
/** loadErrorText 是图片或挑战加载失败时的提示。 */
|
|
32
|
+
loadErrorText?: string;
|
|
33
|
+
/** verifyErrorText 是验证服务异常时的提示。 */
|
|
34
|
+
verifyErrorText?: string;
|
|
35
|
+
/** expiredText 是挑战过期时的提示。 */
|
|
36
|
+
expiredText?: string;
|
|
37
|
+
/** hintText 是正常状态下的刷新提示。 */
|
|
38
|
+
hintText?: string;
|
|
39
|
+
/** refreshIcon 是图片角落的刷新图标类名。 */
|
|
40
|
+
refreshIcon?: string;
|
|
41
|
+
/** refreshOnFailure 表示答案错误后是否自动废弃当前挑战并换题。 */
|
|
42
|
+
refreshOnFailure?: boolean;
|
|
43
|
+
/** maxlength 是答案输入的最大字符数。 */
|
|
44
|
+
maxlength?: number;
|
|
45
|
+
/** name 是验证成功票据隐藏字段的原生名称。 */
|
|
46
|
+
name?: string;
|
|
47
|
+
/** autocomplete 是答案输入框自动填充策略,默认关闭。 */
|
|
48
|
+
autocomplete?: string;
|
|
49
|
+
/** imageWidth 是图片按钮宽度,单位 px;不传时使用 size 对应宽度。 */
|
|
50
|
+
imageWidth?: number;
|
|
51
|
+
/** imageReferrerPolicy 控制验证码图片请求的 Referer 策略。 */
|
|
52
|
+
imageReferrerPolicy?: CaptchaImageReferrerPolicy;
|
|
53
|
+
};
|
|
54
|
+
declare function verify(): Promise<boolean>;
|
|
55
|
+
declare function refresh(event?: MouseEvent): Promise<void>;
|
|
56
|
+
declare function focus(): void;
|
|
57
|
+
declare function blur(): void;
|
|
58
|
+
declare function clear(): Promise<void>;
|
|
59
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
60
|
+
blur: typeof blur;
|
|
61
|
+
clear: typeof clear;
|
|
62
|
+
focus: typeof focus;
|
|
63
|
+
refresh: typeof refresh;
|
|
64
|
+
verify: typeof verify;
|
|
65
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
66
|
+
error: (error: unknown) => any;
|
|
67
|
+
invalid: (result: CaptchaVerifyFailure) => any;
|
|
68
|
+
"update:modelValue": (ticket: string) => any;
|
|
69
|
+
verified: (result: CaptchaVerifySuccess) => any;
|
|
70
|
+
load: (challenge: CaptchaChallenge) => any;
|
|
71
|
+
refresh: (event?: MouseEvent | undefined) => any;
|
|
72
|
+
expired: () => any;
|
|
73
|
+
focus: (event: FocusEvent) => any;
|
|
74
|
+
blur: (event: FocusEvent) => any;
|
|
75
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
76
|
+
onError?: ((error: unknown) => any) | undefined;
|
|
77
|
+
onInvalid?: ((result: CaptchaVerifyFailure) => any) | undefined;
|
|
78
|
+
"onUpdate:modelValue"?: ((ticket: string) => any) | undefined;
|
|
79
|
+
onVerified?: ((result: CaptchaVerifySuccess) => any) | undefined;
|
|
80
|
+
onLoad?: ((challenge: CaptchaChallenge) => any) | undefined;
|
|
81
|
+
onRefresh?: ((event?: MouseEvent | undefined) => any) | undefined;
|
|
82
|
+
onExpired?: (() => any) | undefined;
|
|
83
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
84
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
85
|
+
}>, {
|
|
86
|
+
size: "sm" | "md" | "lg" | null;
|
|
87
|
+
disabled: boolean;
|
|
88
|
+
name: string;
|
|
89
|
+
modelValue: string;
|
|
90
|
+
provider: CaptchaProvider;
|
|
91
|
+
readonly: boolean;
|
|
92
|
+
placeholder: string;
|
|
93
|
+
ariaLabel: string;
|
|
94
|
+
imageAlt: string;
|
|
95
|
+
refreshAriaLabel: string;
|
|
96
|
+
loadingText: string;
|
|
97
|
+
verifyingText: string;
|
|
98
|
+
verifiedText: string;
|
|
99
|
+
requiredText: string;
|
|
100
|
+
invalidText: string;
|
|
101
|
+
loadErrorText: string;
|
|
102
|
+
verifyErrorText: string;
|
|
103
|
+
expiredText: string;
|
|
104
|
+
hintText: string;
|
|
105
|
+
refreshIcon: string;
|
|
106
|
+
refreshOnFailure: boolean;
|
|
107
|
+
maxlength: number;
|
|
108
|
+
autocomplete: string;
|
|
109
|
+
imageWidth: number;
|
|
110
|
+
imageReferrerPolicy: CaptchaImageReferrerPolicy;
|
|
111
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
112
|
+
declare const _default: typeof __VLS_export;
|
|
113
|
+
export default _default;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export { default as Captcha } from './Captcha.vue';
|
|
3
|
+
/** CaptchaRequestContext 是宿主验证码服务接收的取消上下文。 */
|
|
4
|
+
export interface CaptchaRequestContext {
|
|
5
|
+
signal: AbortSignal;
|
|
6
|
+
}
|
|
7
|
+
/** CaptchaChallenge 是后端签发的一次性图形验证码挑战。 */
|
|
8
|
+
export interface CaptchaChallenge {
|
|
9
|
+
/** id 是后端用于定位挑战的标识,不能包含验证码答案。 */
|
|
10
|
+
id: string;
|
|
11
|
+
/** image 是图片 URL 或 data URL,由宿主后端返回;生产环境应使用栅格化 PNG/WebP,避免 SVG 文本暴露答案。 */
|
|
12
|
+
image: string;
|
|
13
|
+
/** expiresAt 是可选的毫秒时间戳,仅用于前端及时展示过期状态。 */
|
|
14
|
+
expiresAt?: number;
|
|
15
|
+
}
|
|
16
|
+
/** CaptchaVerifyPayload 是控件提交给宿主后端的用户答案。 */
|
|
17
|
+
export interface CaptchaVerifyPayload {
|
|
18
|
+
challengeId: string;
|
|
19
|
+
answer: string;
|
|
20
|
+
}
|
|
21
|
+
/** CaptchaVerifySuccess 表示后端验证通过,并签发一次性票据。 */
|
|
22
|
+
export interface CaptchaVerifySuccess {
|
|
23
|
+
verified: true;
|
|
24
|
+
/** ticket 供后续业务请求提交,必须由后端生成并一次性消费。 */
|
|
25
|
+
ticket: string;
|
|
26
|
+
/** expiresAt 是可选的票据过期时间,单位为毫秒。 */
|
|
27
|
+
expiresAt?: number;
|
|
28
|
+
}
|
|
29
|
+
/** CaptchaVerifyFailure 表示后端明确拒绝本次答案。 */
|
|
30
|
+
export interface CaptchaVerifyFailure {
|
|
31
|
+
verified: false;
|
|
32
|
+
/** message 是可选的、可安全展示给用户的错误文案。 */
|
|
33
|
+
message?: string;
|
|
34
|
+
}
|
|
35
|
+
export type CaptchaVerifyResult = CaptchaVerifySuccess | CaptchaVerifyFailure;
|
|
36
|
+
/** CaptchaProvider 是宿主应用提供的图形验证码后端适配器。 */
|
|
37
|
+
export interface CaptchaProvider {
|
|
38
|
+
/** getChallenge 获取图片和挑战标识;请求取消时应中止底层网络请求。 */
|
|
39
|
+
getChallenge(context: CaptchaRequestContext): Promise<CaptchaChallenge>;
|
|
40
|
+
/** verify 在后端校验答案,成功时返回一次性票据。 */
|
|
41
|
+
verify(payload: CaptchaVerifyPayload, context: CaptchaRequestContext): Promise<CaptchaVerifyResult>;
|
|
42
|
+
}
|
|
43
|
+
export type CaptchaState = 'loading' | 'ready' | 'verifying' | 'verified' | 'invalid' | 'expired' | 'error';
|
|
44
|
+
export type CaptchaImageReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
45
|
+
/** captchaRoot 定义图形验证码的纵向布局。 */
|
|
46
|
+
export declare const captchaRoot: (props?: ({
|
|
47
|
+
disabled?: boolean | null | undefined;
|
|
48
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
49
|
+
/** captchaRow 定义答案输入与图形区域的一行布局。 */
|
|
50
|
+
export declare const captchaRow: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
51
|
+
/** captchaInputWrapper 定义输入区边框、焦点、错误和禁用状态。 */
|
|
52
|
+
export declare const captchaInputWrapper: (props?: ({
|
|
53
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
54
|
+
focused?: boolean | null | undefined;
|
|
55
|
+
invalid?: boolean | null | undefined;
|
|
56
|
+
disabled?: boolean | null | undefined;
|
|
57
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
58
|
+
/** captchaInput 定义答案输入框的字号和水平内边距。 */
|
|
59
|
+
export declare const captchaInput: (props?: ({
|
|
60
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
61
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
62
|
+
/** captchaImageButton 定义可刷新的图形验证码图片按钮。 */
|
|
63
|
+
export declare const captchaImageButton: (props?: ({
|
|
64
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
65
|
+
state?: "error" | "loading" | "expired" | "ready" | null | undefined;
|
|
66
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
67
|
+
/** captchaImage 定义后端图片在按钮内的显示方式。 */
|
|
68
|
+
export declare const captchaImage: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
69
|
+
/** captchaFeedback 定义辅助、错误和成功文案的状态色。 */
|
|
70
|
+
export declare const captchaFeedback: (props?: ({
|
|
71
|
+
state?: "error" | "loading" | "invalid" | "verified" | "expired" | "ready" | "verifying" | null | undefined;
|
|
72
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
73
|
+
/** CaptchaProps 是图形验证码尺寸和输入容器样式推导出的属性类型。 */
|
|
74
|
+
export type CaptchaProps = VariantProps<typeof captchaInputWrapper>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../chunks/captcha-DM3F32sM.js";
|
|
2
|
+
export { t as Captcha, s as captchaFeedback, r as captchaImage, a as captchaImageButton, n as captchaInput, e as captchaInputWrapper, i as captchaRoot, o as captchaRow };
|
|
@@ -24,14 +24,14 @@ type __VLS_Slots = {} & {
|
|
|
24
24
|
};
|
|
25
25
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
26
26
|
input: (event: Event) => any;
|
|
27
|
-
change: (checked: boolean, event: Event) => any;
|
|
28
27
|
focus: (event: FocusEvent) => any;
|
|
29
28
|
blur: (event: FocusEvent) => any;
|
|
29
|
+
change: (checked: boolean, event: Event) => any;
|
|
30
30
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
31
31
|
onInput?: ((event: Event) => any) | undefined;
|
|
32
|
-
onChange?: ((checked: boolean, event: Event) => any) | undefined;
|
|
33
32
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
34
33
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
34
|
+
onChange?: ((checked: boolean, event: Event) => any) | undefined;
|
|
35
35
|
}>, {
|
|
36
36
|
disabled: boolean;
|
|
37
37
|
checked: boolean;
|
|
@@ -16,11 +16,11 @@ type __VLS_Slots = {} & {
|
|
|
16
16
|
default?: (props: typeof __VLS_1) => any;
|
|
17
17
|
};
|
|
18
18
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
19
|
-
change: (value: CheckboxValue[], event: Event) => any;
|
|
20
19
|
"update:modelValue": (value: CheckboxValue[]) => any;
|
|
20
|
+
change: (value: CheckboxValue[], event: Event) => any;
|
|
21
21
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
|
-
onChange?: ((value: CheckboxValue[], event: Event) => any) | undefined;
|
|
23
22
|
"onUpdate:modelValue"?: ((value: CheckboxValue[]) => any) | undefined;
|
|
23
|
+
onChange?: ((value: CheckboxValue[], event: Event) => any) | undefined;
|
|
24
24
|
}>, {
|
|
25
25
|
size: CheckboxSize;
|
|
26
26
|
disabled: boolean;
|