@authing/react-ui-components 4.0.9 → 4.1.0-rc.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.
- package/lib/index.min.js +1 -1
- package/package.json +1 -1
- package/types/Guard/core/hooks/useMultipleAccounts.d.ts +4 -2
- package/types/Guard/event.d.ts +2 -1
- package/types/Login/core/withPassword/FormItemAccount.d.ts +1 -2
- package/types/Login/core/withPassword/InputAccount.d.ts +1 -0
- package/types/Login/hooks/useLoginMultiple.d.ts +2 -1
- package/types/Register/core/WithEmail.d.ts +2 -0
- package/types/Register/interface.d.ts +2 -2
- package/types/Type/application.d.ts +24 -0
- package/types/ValidatorRules/ValidatorFormItem.d.ts +1 -0
- package/types/ValidatorRules/index.d.ts +4 -2
- package/types/_utils/config/index.d.ts +3 -3
- package/types/_utils/context.d.ts +2 -1
- package/types/_utils/index.d.ts +5 -2
- package/types/version/version.d.ts +1 -1
- package/types/AccountMerge/UserRadio.d.ts +0 -5
- package/types/AccountMerge/index.d.ts +0 -3
- package/types/AccountMerge/interface.d.ts +0 -27
- package/types/AccountMerge/utils.d.ts +0 -3
- package/types/ChangeAccoutType/index.d.ts +0 -3
- package/types/CompleteInfo/core/components/TreeSelect.d.ts +0 -11
package/package.json
CHANGED
|
@@ -248,7 +248,8 @@ declare class MultipleAccount {
|
|
|
248
248
|
} | undefined) => void;
|
|
249
249
|
setUserInfo: (user: Pick<User & {
|
|
250
250
|
id: string;
|
|
251
|
-
|
|
251
|
+
loginAccount?: string | undefined;
|
|
252
|
+
}, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode" | "loginAccount">) => void;
|
|
252
253
|
setLoginWayByHttpData: (account: string, data: {
|
|
253
254
|
username?: string | undefined;
|
|
254
255
|
phone?: string | undefined;
|
|
@@ -290,7 +291,8 @@ declare const useMultipleAccounts: ({ appId, finallyConfig, }: {
|
|
|
290
291
|
} | undefined) => void;
|
|
291
292
|
setUserInfo: (user: Pick<User & {
|
|
292
293
|
id: string;
|
|
293
|
-
|
|
294
|
+
loginAccount?: string | undefined;
|
|
295
|
+
}, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode" | "loginAccount">) => void;
|
|
294
296
|
setLoginWayByHttpData: (account: string, data: {
|
|
295
297
|
username?: string | undefined;
|
|
296
298
|
phone?: string | undefined;
|
package/types/Guard/event.d.ts
CHANGED
|
@@ -19,7 +19,8 @@ export declare const guardEventsFilter: (props: any, multipleInstance?: {
|
|
|
19
19
|
} | undefined) => void;
|
|
20
20
|
setUserInfo: (user: Pick<import("./core/hooks/useMultipleAccounts").User & {
|
|
21
21
|
id: string;
|
|
22
|
-
|
|
22
|
+
loginAccount?: string | undefined;
|
|
23
|
+
}, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode" | "loginAccount">) => void;
|
|
23
24
|
setLoginWayByHttpData: (account: string, data: {
|
|
24
25
|
username?: string | undefined;
|
|
25
26
|
phone?: string | undefined;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FormItemProps } from 'antd/lib/form';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { PasswordLoginMethods } from '../../../Type/application';
|
|
4
3
|
export interface FormItemAccountProps extends FormItemProps {
|
|
5
|
-
|
|
4
|
+
validPasswordLoginMethods: string[];
|
|
6
5
|
}
|
|
7
6
|
export declare const FormItemAccount: React.FC<FormItemAccountProps>;
|
|
@@ -3,5 +3,6 @@ import React from 'react';
|
|
|
3
3
|
import { PasswordLoginMethods } from '../../../Type/application';
|
|
4
4
|
export interface InputAccountProps extends InputProps {
|
|
5
5
|
passwordLoginMethods: PasswordLoginMethods[];
|
|
6
|
+
placeholder: string;
|
|
6
7
|
}
|
|
7
8
|
export declare const InputAccount: React.FC<InputAccountProps>;
|
|
@@ -34,7 +34,8 @@ declare function useLoginMultiple(setLoginWay: React.Dispatch<any>): {
|
|
|
34
34
|
} | undefined) => void;
|
|
35
35
|
setUserInfo: (user: Pick<import("../../Guard/core/hooks/useMultipleAccounts").User & {
|
|
36
36
|
id: string;
|
|
37
|
-
|
|
37
|
+
loginAccount?: string | undefined;
|
|
38
|
+
}, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode" | "loginAccount">) => void;
|
|
38
39
|
setLoginWayByHttpData: (account: string, data: {
|
|
39
40
|
username?: string | undefined;
|
|
40
41
|
phone?: string | undefined;
|
|
@@ -3,8 +3,8 @@ import { IG2FCProps, IG2Config, IG2Events } from '../Type';
|
|
|
3
3
|
import { Agreement, RegisterMethods } from '../Type/application';
|
|
4
4
|
export interface RegisterConfig extends IG2Config {
|
|
5
5
|
disableRegister?: boolean;
|
|
6
|
-
registerMethods?:
|
|
7
|
-
defaultRegisterMethod?:
|
|
6
|
+
registerMethods?: string[];
|
|
7
|
+
defaultRegisterMethod?: string;
|
|
8
8
|
publicKey?: string;
|
|
9
9
|
agreementEnabled?: boolean;
|
|
10
10
|
agreements?: Agreement[];
|
|
@@ -103,6 +103,11 @@ export declare const enum RegisterMethods {
|
|
|
103
103
|
Phone = "phone",
|
|
104
104
|
EmailCode = "emailCode"
|
|
105
105
|
}
|
|
106
|
+
export declare const enum RegisterSortMethods {
|
|
107
|
+
Email = "email-password",
|
|
108
|
+
Phone = "phone-code",
|
|
109
|
+
EmailCode = "email-code"
|
|
110
|
+
}
|
|
106
111
|
export declare type QrcodeTabsSettings = Record<LoginMethods, Array<{
|
|
107
112
|
id: string;
|
|
108
113
|
title: string;
|
|
@@ -145,9 +150,13 @@ export interface UserExtendsField {
|
|
|
145
150
|
export declare type ExtendsField = InternalExtendsField | UserExtendsField;
|
|
146
151
|
export interface ApplicationPasswordTabConfig {
|
|
147
152
|
enabledLoginMethods?: PasswordLoginMethods[];
|
|
153
|
+
validRegisterMethods?: string[];
|
|
154
|
+
validLoginMethods?: string[];
|
|
148
155
|
}
|
|
149
156
|
export interface ApplicationVerifyCodeTabConfig {
|
|
150
157
|
enabledLoginMethods: VerifyLoginMethods[];
|
|
158
|
+
validRegisterMethods?: string[];
|
|
159
|
+
validLoginMethods?: string[];
|
|
151
160
|
}
|
|
152
161
|
export interface Agreement {
|
|
153
162
|
id: number;
|
|
@@ -159,6 +168,14 @@ export interface Agreement {
|
|
|
159
168
|
export declare type PasswordLoginMethods = 'username-password' | 'email-password' | 'phone-password';
|
|
160
169
|
export declare type VerifyLoginMethods = 'email-code' | 'phone-code';
|
|
161
170
|
export declare type ComplateFiledsPlace = 'register' | 'login';
|
|
171
|
+
export interface TabFieldsI18nItem {
|
|
172
|
+
key: string;
|
|
173
|
+
label: string;
|
|
174
|
+
labelEn: string;
|
|
175
|
+
i18n: {
|
|
176
|
+
[propName in Lang]?: string;
|
|
177
|
+
};
|
|
178
|
+
}
|
|
162
179
|
export interface ApplicationConfig {
|
|
163
180
|
id: string;
|
|
164
181
|
allowedOrigins: string[];
|
|
@@ -264,4 +281,11 @@ export interface ApplicationConfig {
|
|
|
264
281
|
* 是否开启注册密码补全
|
|
265
282
|
*/
|
|
266
283
|
enableCompletePassword: boolean;
|
|
284
|
+
/**
|
|
285
|
+
* 登录注册排序
|
|
286
|
+
*/
|
|
287
|
+
tabMethodsSortConfig: {
|
|
288
|
+
loginMethodsSort: string[];
|
|
289
|
+
};
|
|
290
|
+
tabMethodsFields: TabFieldsI18nItem[];
|
|
267
291
|
}
|
|
@@ -3,3 +3,4 @@ import { ValidatorFormItemProps } from '.';
|
|
|
3
3
|
export declare const EmailFormItem: React.FC<ValidatorFormItemProps>;
|
|
4
4
|
export declare const PhoneFormItem: React.FC<ValidatorFormItemProps>;
|
|
5
5
|
export declare const UserNameFormItem: React.FC<ValidatorFormItemProps>;
|
|
6
|
+
export declare const CustomNameFormItem: React.FC<ValidatorFormItemProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormInstance, FormItemProps } from 'antd/lib/form';
|
|
2
2
|
import FormItem from 'antd/lib/form/FormItem';
|
|
3
3
|
import { PasswordFormItem } from './PasswordFormItem';
|
|
4
|
-
import { EmailFormItem, PhoneFormItem, UserNameFormItem } from './ValidatorFormItem';
|
|
4
|
+
import { EmailFormItem, PhoneFormItem, UserNameFormItem, CustomNameFormItem } from './ValidatorFormItem';
|
|
5
5
|
export interface ValidatorFormItemProps extends FormItemProps {
|
|
6
6
|
form?: FormInstance;
|
|
7
7
|
checkRepeat?: boolean;
|
|
@@ -11,9 +11,10 @@ export interface ValidatorFormItemProps extends FormItemProps {
|
|
|
11
11
|
* 控制内部FormItem组件关于pattern的校验规则
|
|
12
12
|
*/
|
|
13
13
|
isCheckPattern?: boolean;
|
|
14
|
+
defaultMethod?: string;
|
|
14
15
|
}
|
|
15
16
|
export interface ValidatorFormItemMetaProps extends ValidatorFormItemProps {
|
|
16
|
-
method: 'email' | 'phone' | 'username';
|
|
17
|
+
method: 'email' | 'phone' | 'username' | string;
|
|
17
18
|
}
|
|
18
19
|
export interface PasswordFormItemProps extends FormItemProps {
|
|
19
20
|
}
|
|
@@ -26,6 +27,7 @@ interface FormItemInterface extends InternalFormItemType {
|
|
|
26
27
|
Email: typeof EmailFormItem;
|
|
27
28
|
Phone: typeof PhoneFormItem;
|
|
28
29
|
UserName: typeof UserNameFormItem;
|
|
30
|
+
CustomName: typeof CustomNameFormItem;
|
|
29
31
|
}
|
|
30
32
|
declare const CustomFormItem: FormItemInterface;
|
|
31
33
|
export default CustomFormItem;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { GuardLocalConfig } from '../../Guard/config';
|
|
3
3
|
import { GuardHttp } from '../guardHttp';
|
|
4
4
|
import { GuardPageConfig } from '../../Type';
|
|
5
|
-
import { ApplicationConfig, LoginMethods
|
|
5
|
+
import { ApplicationConfig, LoginMethods } from '../../Type/application';
|
|
6
6
|
export declare const getPublicConfig: (appId: string) => ApplicationConfig;
|
|
7
7
|
export declare const setPublicConfig: (appId: string, config: ApplicationConfig) => ApplicationConfig;
|
|
8
8
|
export declare const getPageConfig: (appId: string) => GuardPageConfig;
|
|
@@ -26,8 +26,8 @@ export declare const useFetchConsoleConfig: (forceUpdate: number, appId?: string
|
|
|
26
26
|
loadingComponent?: import("react").ReactNode;
|
|
27
27
|
openEventsMapping?: boolean | undefined;
|
|
28
28
|
disableRegister?: boolean | undefined;
|
|
29
|
-
registerMethods?:
|
|
30
|
-
defaultRegisterMethod?:
|
|
29
|
+
registerMethods?: string[] | undefined;
|
|
30
|
+
defaultRegisterMethod?: string | undefined;
|
|
31
31
|
publicKey?: string | undefined;
|
|
32
32
|
agreementEnabled?: boolean | undefined;
|
|
33
33
|
agreements?: import("../../Type").Agreement[] | undefined;
|
|
@@ -106,7 +106,8 @@ export declare const useGuardMultipleInstance: () => {
|
|
|
106
106
|
} | undefined) => void;
|
|
107
107
|
setUserInfo: (user: Pick<import("../Guard/core/hooks/useMultipleAccounts").User & {
|
|
108
108
|
id: string;
|
|
109
|
-
|
|
109
|
+
loginAccount?: string | undefined;
|
|
110
|
+
}, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode" | "loginAccount">) => void;
|
|
110
111
|
setLoginWayByHttpData: (account: string, data: {
|
|
111
112
|
username?: string | undefined;
|
|
112
113
|
phone?: string | undefined;
|
package/types/_utils/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Rule } from 'antd/lib/form';
|
|
|
2
2
|
import qs from 'qs';
|
|
3
3
|
import { User } from 'authing-js-sdk';
|
|
4
4
|
import { GuardProps } from '../Guard';
|
|
5
|
-
import { ApplicationConfig, ComplateFiledsPlace, LoginMethods, RegisterMethods } from '../Type/application';
|
|
5
|
+
import { ApplicationConfig, ComplateFiledsPlace, LoginMethods, RegisterMethods, RegisterSortMethods, TabFieldsI18nItem } from '../Type/application';
|
|
6
6
|
import { Lang } from '../Type';
|
|
7
7
|
export * from './popupCenter';
|
|
8
8
|
export * from './clipboard';
|
|
@@ -75,7 +75,8 @@ export declare const getSymbolTypeLength: (pwd: string) => number;
|
|
|
75
75
|
export declare const getPasswordValidate: (strength?: PasswordStrength, customPasswordStrength?: any, fieldRequiredRuleMessage?: string | undefined) => Rule[];
|
|
76
76
|
export declare const sleep: (delay: number) => Promise<unknown>;
|
|
77
77
|
export declare const shoudGoToComplete: (user: User, contextType: ComplateFiledsPlace, config: ApplicationConfig | undefined, autoRegister?: boolean | undefined) => boolean;
|
|
78
|
-
export declare const tabSort: (
|
|
78
|
+
export declare const tabSort: (tabList: string[], defaultMethod?: string | undefined) => string[];
|
|
79
|
+
export declare const transformMethod: (method: RegisterMethods | string) => string;
|
|
79
80
|
export declare const mailDesensitization: (mail: string) => string;
|
|
80
81
|
export declare const phoneDesensitization: (phone: string) => string;
|
|
81
82
|
export declare const getHundreds: (num: number) => number;
|
|
@@ -90,3 +91,5 @@ export declare const getLoginTypePipe: (publicConfig: ApplicationConfig, registe
|
|
|
90
91
|
} | undefined;
|
|
91
92
|
export declare const getPasswordIdentify: (identity: string) => string;
|
|
92
93
|
export declare const getCurrentLng: () => Lang;
|
|
94
|
+
export declare const getSortLabels: (methods: string[], i18nConfig: Map<string, TabFieldsI18nItem>) => string;
|
|
95
|
+
export declare const getI18nLabel: (method: string | RegisterSortMethods, i18nFields: Map<string, TabFieldsI18nItem>) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "4.0.
|
|
1
|
+
declare const _default: "4.1.0-rc.0";
|
|
2
2
|
export default _default;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export interface BriefUserInfo {
|
|
2
|
-
displayName: string;
|
|
3
|
-
avatar: string;
|
|
4
|
-
phone: string;
|
|
5
|
-
email: string;
|
|
6
|
-
username: string;
|
|
7
|
-
name: string;
|
|
8
|
-
}
|
|
9
|
-
export interface GuardAccountMergeInitData {
|
|
10
|
-
currentUserInfo: BriefUserInfo;
|
|
11
|
-
existingUserInfo: BriefUserInfo;
|
|
12
|
-
mergeToken?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface UserRadioProps {
|
|
15
|
-
currentUserInfo: BriefUserInfo;
|
|
16
|
-
existingUserInfo: BriefUserInfo;
|
|
17
|
-
onChange?: (value: any) => void;
|
|
18
|
-
value?: any;
|
|
19
|
-
}
|
|
20
|
-
export interface UserRadioItemProps extends BriefUserInfo {
|
|
21
|
-
value: boolean;
|
|
22
|
-
selected: boolean;
|
|
23
|
-
onClick: (value: boolean) => void;
|
|
24
|
-
}
|
|
25
|
-
export declare enum AuthFlowAction {
|
|
26
|
-
MERGE = "confirm-account-merge"
|
|
27
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare type OptionType = {
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
children: OptionType[];
|
|
6
|
-
};
|
|
7
|
-
interface TreeSelectProps {
|
|
8
|
-
options: OptionType[];
|
|
9
|
-
}
|
|
10
|
-
declare const TreeSelect: React.FC<TreeSelectProps>;
|
|
11
|
-
export default TreeSelect;
|