@jctrans-materials/comps-vue2 1.0.41-beta.9 → 1.0.42-beta.0

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.
@@ -0,0 +1,6 @@
1
+ export declare function useCountdown(duration?: number): {
2
+ isCounting: import('../../../../vue-demi').Ref<boolean>;
3
+ countdown: import('../../../../vue-demi').Ref<number>;
4
+ startTimer: () => void;
5
+ stopTimer: () => void;
6
+ };
@@ -0,0 +1,2 @@
1
+ export declare const FORM_TYPE_COLOR_MAP: Record<number, string>;
2
+ export declare const DEFAULT_COUNTDOWN_SECONDS = 60;
@@ -0,0 +1,114 @@
1
+ declare const _default: import('../../../vue-demi').DefineComponent<{
2
+ value: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ placeholder: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ label: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
14
+ ready: {
15
+ type: BooleanConstructor;
16
+ default: boolean;
17
+ };
18
+ showIcon: {
19
+ type: BooleanConstructor;
20
+ default: boolean;
21
+ };
22
+ disabled: {
23
+ type: BooleanConstructor;
24
+ default: boolean;
25
+ };
26
+ duration: {
27
+ type: NumberConstructor;
28
+ default: number;
29
+ };
30
+ formTypeColor: {
31
+ type: (StringConstructor | NumberConstructor)[];
32
+ default: string;
33
+ };
34
+ isEn: {
35
+ type: BooleanConstructor;
36
+ default: boolean;
37
+ };
38
+ }, {}, {
39
+ isCounting: boolean;
40
+ countdown: number;
41
+ timer: ReturnType<typeof setInterval> | null;
42
+ captchaVisible: boolean;
43
+ }, {
44
+ statusClass(): string;
45
+ btnText(): string;
46
+ }, {
47
+ /**
48
+ * 点击发送按钮
49
+ */
50
+ handleSend: any;
51
+ /**
52
+ * 滑块验证成功后的回调
53
+ */
54
+ handleCaptchaSuccess(captchaData: {
55
+ uuid: string;
56
+ code: string;
57
+ }): void;
58
+ /**
59
+ * 开始倒计时(可被父组件通过 ref 直接调用)
60
+ */
61
+ startTimer(): void;
62
+ /**
63
+ * 停止倒计时
64
+ */
65
+ stopTimer(): void;
66
+ }, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "send")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
67
+ value: {
68
+ type: StringConstructor;
69
+ default: string;
70
+ };
71
+ placeholder: {
72
+ type: StringConstructor;
73
+ default: string;
74
+ };
75
+ label: {
76
+ type: StringConstructor;
77
+ default: string;
78
+ };
79
+ ready: {
80
+ type: BooleanConstructor;
81
+ default: boolean;
82
+ };
83
+ showIcon: {
84
+ type: BooleanConstructor;
85
+ default: boolean;
86
+ };
87
+ disabled: {
88
+ type: BooleanConstructor;
89
+ default: boolean;
90
+ };
91
+ duration: {
92
+ type: NumberConstructor;
93
+ default: number;
94
+ };
95
+ formTypeColor: {
96
+ type: (StringConstructor | NumberConstructor)[];
97
+ default: string;
98
+ };
99
+ isEn: {
100
+ type: BooleanConstructor;
101
+ default: boolean;
102
+ };
103
+ }>>, {
104
+ value: string;
105
+ label: string;
106
+ placeholder: string;
107
+ ready: boolean;
108
+ showIcon: boolean;
109
+ disabled: boolean;
110
+ duration: number;
111
+ formTypeColor: string | number;
112
+ isEn: boolean;
113
+ }>;
114
+ export default _default;
@@ -0,0 +1,41 @@
1
+ declare const _default: import('../../../vue-demi').DefineComponent<{
2
+ label: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ placeholder: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ value: {
11
+ type: (StringConstructor | NumberConstructor)[];
12
+ default: string;
13
+ };
14
+ }, {
15
+ googleInputRef: any;
16
+ isFocus: import('../../../vue-demi').Ref<boolean>;
17
+ isHavePrepend: import('../../../vue-demi').ComputedRef<boolean>;
18
+ shouldFloat: import('../../../vue-demi').ComputedRef<boolean>;
19
+ focusInput: () => void;
20
+ handleInput: (val: string | number) => void;
21
+ localBlur: (e: FocusEvent) => void;
22
+ localFocus: (e: FocusEvent) => void;
23
+ }, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "blur" | "focus")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
24
+ label: {
25
+ type: StringConstructor;
26
+ default: string;
27
+ };
28
+ placeholder: {
29
+ type: StringConstructor;
30
+ default: string;
31
+ };
32
+ value: {
33
+ type: (StringConstructor | NumberConstructor)[];
34
+ default: string;
35
+ };
36
+ }>>, {
37
+ value: string | number;
38
+ label: string;
39
+ placeholder: string;
40
+ }>;
41
+ export default _default;
@@ -25,7 +25,7 @@ declare const _default: import('../../../vue-demi').DefineComponent<{
25
25
  onCarrierChange: (value: string | number) => void;
26
26
  lang: string;
27
27
  showApplyData: boolean;
28
- }, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value" | "change" | "apply" | "focus" | "blur" | "remove-tag")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
28
+ }, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "blur" | "focus" | "update:modelValue" | "update:value" | "change" | "apply" | "remove-tag")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
29
29
  value: {
30
30
  type: (StringConstructor | NumberConstructor)[];
31
31
  default: string;
@@ -48,9 +48,9 @@ declare const _default: import('../../../vue-demi').DefineComponent<{
48
48
  };
49
49
  }>>, {
50
50
  value: string | number;
51
+ placeholder: string;
51
52
  modelValue: string | number;
52
53
  lang: string;
53
- placeholder: string;
54
54
  showApplyData: boolean;
55
55
  }>;
56
56
  export default _default;
@@ -25,7 +25,7 @@ declare const _default: import('../../../vue-demi').DefineComponent<{
25
25
  onCarrierChange: (value: string | number) => void;
26
26
  lang: string;
27
27
  showApplyData: boolean;
28
- }, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value" | "change" | "apply" | "focus" | "blur" | "remove-tag")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
28
+ }, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "blur" | "focus" | "update:modelValue" | "update:value" | "change" | "apply" | "remove-tag")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
29
29
  value: {
30
30
  type: (StringConstructor | NumberConstructor)[];
31
31
  default: string;
@@ -48,9 +48,9 @@ declare const _default: import('../../../vue-demi').DefineComponent<{
48
48
  };
49
49
  }>>, {
50
50
  value: string | number;
51
+ placeholder: string;
51
52
  modelValue: string | number;
52
53
  lang: string;
53
- placeholder: string;
54
54
  showApplyData: boolean;
55
55
  }>;
56
56
  export default _default;
@@ -25,7 +25,7 @@ declare const _default: import('../../../vue-demi').DefineComponent<{
25
25
  onCarrierChange: (value: string | number) => void;
26
26
  lang: string;
27
27
  showApplyData: boolean;
28
- }, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value" | "change" | "apply" | "focus" | "blur" | "remove-tag")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
28
+ }, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "blur" | "focus" | "update:modelValue" | "update:value" | "change" | "apply" | "remove-tag")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
29
29
  value: {
30
30
  type: (StringConstructor | NumberConstructor)[];
31
31
  default: string;
@@ -48,9 +48,9 @@ declare const _default: import('../../../vue-demi').DefineComponent<{
48
48
  };
49
49
  }>>, {
50
50
  value: string | number;
51
+ placeholder: string;
51
52
  modelValue: string | number;
52
53
  lang: string;
53
- placeholder: string;
54
54
  showApplyData: boolean;
55
55
  }>;
56
56
  export default _default;
@@ -25,7 +25,7 @@ declare const _default: import('../../../vue-demi').DefineComponent<{
25
25
  onCarrierChange: (value: string | number) => void;
26
26
  lang: string;
27
27
  showApplyData: boolean;
28
- }, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value" | "change" | "apply" | "focus" | "blur" | "remove-tag")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
28
+ }, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "blur" | "focus" | "update:modelValue" | "update:value" | "change" | "apply" | "remove-tag")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
29
29
  value: {
30
30
  type: (StringConstructor | NumberConstructor)[];
31
31
  default: string;
@@ -48,9 +48,9 @@ declare const _default: import('../../../vue-demi').DefineComponent<{
48
48
  };
49
49
  }>>, {
50
50
  value: string | number;
51
+ placeholder: string;
51
52
  modelValue: string | number;
52
53
  lang: string;
53
- placeholder: string;
54
54
  showApplyData: boolean;
55
55
  }>;
56
56
  export default _default;
@@ -77,7 +77,7 @@ declare const _default: import('../../../vue-demi').DefineComponent<{
77
77
  showApplyData: boolean;
78
78
  normalizeOptionValue: (id: any) => any;
79
79
  multiple: boolean;
80
- }, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value" | "change" | "apply" | "focus" | "blur" | "remove-tag")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
80
+ }, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("input" | "blur" | "focus" | "update:modelValue" | "update:value" | "change" | "apply" | "remove-tag")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
81
81
  value: {
82
82
  type: (StringConstructor | NumberConstructor | ArrayConstructor)[];
83
83
  default: undefined;
@@ -120,11 +120,11 @@ declare const _default: import('../../../vue-demi').DefineComponent<{
120
120
  };
121
121
  }>>, {
122
122
  value: string | number | unknown[];
123
+ placeholder: string;
123
124
  modelValue: string | number | unknown[];
124
125
  lang: string;
125
126
  lineType: "air" | "shipping";
126
127
  reportType: string;
127
- placeholder: string;
128
128
  multiple: boolean;
129
129
  showApplyData: boolean;
130
130
  defaultOptions: LocationUnifiedItem[];
@@ -0,0 +1,32 @@
1
+ declare const _default: import('../../../vue-demi').DefineComponent<{
2
+ label: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ left: {
7
+ type: (StringConstructor | NumberConstructor)[];
8
+ default: number;
9
+ };
10
+ }, {
11
+ wrapperRef: import('../../../vue-demi').Ref<HTMLDivElement | null>;
12
+ internalFocus: import('../../../vue-demi').Ref<boolean>;
13
+ isHavePrepend: import('../../../vue-demi').ComputedRef<boolean>;
14
+ isHaveAppend: import('../../../vue-demi').ComputedRef<boolean>;
15
+ leftValue: import('../../../vue-demi').ComputedRef<number>;
16
+ wrapperStyle: import('../../../vue-demi').ComputedRef<Record<string, string>>;
17
+ handleFocusIn: () => void;
18
+ handleFocusOut: (event: FocusEvent) => void;
19
+ }, {}, {}, {}, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, ("blur" | "focus")[], string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
20
+ label: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
24
+ left: {
25
+ type: (StringConstructor | NumberConstructor)[];
26
+ default: number;
27
+ };
28
+ }>>, {
29
+ label: string;
30
+ left: string | number;
31
+ }>;
32
+ export default _default;
@@ -30,8 +30,8 @@ declare const _default: import('../../../../vue-demi').DefineComponent<{
30
30
  default: boolean;
31
31
  };
32
32
  }>>, {
33
- isEn: boolean;
34
33
  path: string;
34
+ isEn: boolean;
35
35
  appId: string;
36
36
  }>;
37
37
  export default _default;
@@ -0,0 +1,63 @@
1
+ import { ComputedRef, Ref } from 'vue-demi';
2
+ import { CaptchaData, LoginMethod, LoginType } from '../loginDialog';
3
+
4
+ interface UseLoginFormOptions {
5
+ isEn: ComputedRef<boolean>;
6
+ loginType: Ref<LoginType>;
7
+ }
8
+ export declare function useLoginForm(options: UseLoginFormOptions): {
9
+ loginFormRef: Ref<any>;
10
+ loginForm: Ref<{
11
+ type: string;
12
+ username: string;
13
+ password: string;
14
+ remember: boolean;
15
+ email: string;
16
+ phone: string;
17
+ areaCode: string;
18
+ code: string;
19
+ }>;
20
+ areaCodeData: Ref<{
21
+ id: string;
22
+ nameCn: string;
23
+ nameEn: string;
24
+ shortCode: string;
25
+ telCode: string;
26
+ }[]>;
27
+ isCounting: Ref<boolean>;
28
+ codeReady: Ref<boolean>;
29
+ mobileUid: Ref<string>;
30
+ emailUid: Ref<string>;
31
+ verifyData: Ref<{
32
+ uuid: string;
33
+ code: string;
34
+ uniqueCode?: string | undefined;
35
+ }>;
36
+ captchaVisible: Ref<boolean>;
37
+ loginMethod: Ref<LoginMethod>;
38
+ computedRules: ComputedRef<{
39
+ username: any;
40
+ password: any;
41
+ } | {
42
+ email: any;
43
+ code: any;
44
+ username?: undefined;
45
+ password?: undefined;
46
+ } | {
47
+ phone: any;
48
+ code: any;
49
+ username?: undefined;
50
+ password?: undefined;
51
+ } | {
52
+ username?: undefined;
53
+ password?: undefined;
54
+ }>;
55
+ switchLoginTab: (type: string) => void;
56
+ validateField: (field: string) => void;
57
+ handleGetCode: ({ captchaData, startTimer, }: {
58
+ captchaData: CaptchaData;
59
+ startTimer: () => void;
60
+ }) => Promise<void>;
61
+ handleChangeSubType: (type: string) => Promise<void>;
62
+ };
63
+ export {};
@@ -74,4 +74,37 @@ export declare function go2Policy(target?: string): void;
74
74
  * @param {number} delay - 延迟时间(ms),默认100ms
75
75
  */
76
76
  export declare const handleRedirect: (path: any, delay?: number) => void;
77
+ /**
78
+ * 统一将重定向延迟输入规范化为毫秒数
79
+ * - undefined / null / "" → 0
80
+ * - "500" / 500 → 500;"1s" → 1000;"500ms" → 500
81
+ * - 小于 10 的数字按秒处理(1 → 1000)
82
+ * - 非有限数 / 负数 → 0
83
+ */
84
+ export declare const normalizeDelayMs: (delayInput: any) => number;
85
+ /**
86
+ * 手机号脱敏:保留前 2 位 + 后 2 位,中间用 * 填充
87
+ * - 长度 <= 4 → 原样返回
88
+ * - "13800001234" → "13*******34"
89
+ */
90
+ export declare const maskPhone: (phone: string | null | undefined) => string;
91
+ /**
92
+ * 邮箱脱敏:@ 前保留前 3 个字符 + ***,@ 后保留域名
93
+ * - 无 @ 或格式异常 → 原样返回
94
+ * - "liuxiaoming@outlook.com" → "liu***@outlook.com"
95
+ * - 长度 <= 3 的本地部分 → 原样保留本地部分
96
+ */
97
+ export declare const maskEmail: (email: string | null | undefined) => string;
98
+ /**
99
+ * 计算验证码输入框的浮动 label
100
+ * - 中国区且已填手机 → "13*******34 验证码" / "13*******34 OTP"
101
+ * - 海外区且已填邮箱 → "liu***@outlook.com 验证码" / "liu***@outlook.com OTP"
102
+ * - 未填联系方式 → 回退到默认 placeholder
103
+ */
104
+ export declare const buildCodeInputLabel: ({ isChina, phone, email, isEn, }: {
105
+ isChina: boolean;
106
+ phone: string | null | undefined;
107
+ email: string | null | undefined;
108
+ isEn: boolean;
109
+ }) => string;
77
110
  export {};
@@ -98,9 +98,9 @@ declare const _default: import('../../../vue-demi').DefineComponent<{
98
98
  };
99
99
  }>>, {
100
100
  value: any;
101
+ placeholder: string;
101
102
  lang: string;
102
103
  reportType: string;
103
- placeholder: string;
104
104
  multiple: boolean;
105
105
  historyKey: string;
106
106
  }>;
@@ -1,6 +1,6 @@
1
1
  declare const _default: import('../../../vue-demi').DefineComponent<{
2
2
  value: {
3
- type: (ArrayConstructor | ObjectConstructor)[];
3
+ type: (ObjectConstructor | ArrayConstructor)[];
4
4
  default: null;
5
5
  };
6
6
  multiple: {
@@ -125,7 +125,7 @@ declare const _default: import('../../../vue-demi').DefineComponent<{
125
125
  handleScroll(e: any): void;
126
126
  }, import('../../../vue-demi').ComponentOptionsMixin, import('../../../vue-demi').ComponentOptionsMixin, {}, string, Readonly<import('../../../vue-demi').ExtractPropTypes<{
127
127
  value: {
128
- type: (ArrayConstructor | ObjectConstructor)[];
128
+ type: (ObjectConstructor | ArrayConstructor)[];
129
129
  default: null;
130
130
  };
131
131
  multiple: {
@@ -177,12 +177,12 @@ declare const _default: import('../../../vue-demi').DefineComponent<{
177
177
  default: boolean;
178
178
  };
179
179
  }>>, {
180
- value: unknown[] | Record<string, any>;
181
- lang: string;
180
+ value: Record<string, any> | unknown[];
182
181
  placeholder: string;
182
+ disabled: boolean;
183
+ lang: string;
183
184
  multiple: boolean;
184
185
  showApplyData: boolean;
185
- disabled: boolean;
186
186
  historyKey: string;
187
187
  parentId: string | number;
188
188
  parentType: string;
@@ -72,9 +72,9 @@ declare const _default: import('../../../vue-demi').DefineComponent<{
72
72
  };
73
73
  }>>, {
74
74
  value: unknown[];
75
+ placeholder: string;
75
76
  lang: string;
76
77
  lineType: string;
77
- placeholder: string;
78
78
  multiple: boolean;
79
79
  lineId: number;
80
80
  }>;