@authing/react-ui-components 4.2.0-rc.0 → 4.2.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/LICENSE +21 -0
- package/lib/index.min.css +2 -2
- package/lib/index.min.js +1 -1
- package/package.json +3 -2
- package/types/Guard/module.d.ts +4 -1
- package/types/GuardFace/index.d.ts +16 -0
- package/types/GuardSelect/index.d.ts +29 -0
- package/types/MFA/interface.d.ts +3 -0
- package/types/NewSubmitSuccess/index.d.ts +2 -0
- package/types/NewSubmitSuccess/interface.d.ts +17 -0
- package/types/Register/core/WithEmail.d.ts +2 -2
- package/types/TenantPortalSelect/index.d.ts +16 -0
- package/types/Type/application.d.ts +10 -0
- package/types/ValidatorRules/ValidatorFormItem.d.ts +3 -1
- package/types/ValidatorRules/index.d.ts +0 -1
- package/types/_utils/context.d.ts +5 -0
- package/types/_utils/index.d.ts +2 -1
- package/types/_utils/responseManagement/interface.d.ts +2 -1
- package/types/_utils/tenant.d.ts +19 -0
- package/types/version/version.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authing/react-ui-components",
|
|
3
|
-
"version": "4.2.0
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "lib/index.min.js",
|
|
6
6
|
"typings": "types/index.d.ts",
|
|
@@ -234,5 +234,6 @@
|
|
|
234
234
|
"webpack-dev-server": "3.11.0",
|
|
235
235
|
"webpack-manifest-plugin": "2.2.0",
|
|
236
236
|
"workbox-webpack-plugin": "5.1.4"
|
|
237
|
-
}
|
|
237
|
+
},
|
|
238
|
+
"gitHead": "5667bd7685298485890c48e3fbe903716b8ab123"
|
|
238
239
|
}
|
package/types/Guard/module.d.ts
CHANGED
|
@@ -19,7 +19,10 @@ export declare enum GuardModuleType {
|
|
|
19
19
|
IDENTITY_BINDING_ASK = "identityBindingAsk",
|
|
20
20
|
IDENTITY_BINDING = "identityBinding",
|
|
21
21
|
SELF_UNLOCK = "selfUnlock",
|
|
22
|
-
FLOW_SELECT_ACCOUNT = "flowSelectAccount"
|
|
22
|
+
FLOW_SELECT_ACCOUNT = "flowSelectAccount",
|
|
23
|
+
/** 多租户门户选择页 */
|
|
24
|
+
TENANT_PORTAL = "tenant-portal",
|
|
25
|
+
New_SUBMIT_SUCCESS = "newSubmitSuccess"
|
|
23
26
|
}
|
|
24
27
|
export interface GuardModuleAction {
|
|
25
28
|
action: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import './styles.less';
|
|
2
|
+
import { AvatarProps } from 'antd/lib/avatar';
|
|
3
|
+
import { TagProps } from 'antd/lib/tag';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export interface GuardFaceProps {
|
|
6
|
+
/** 顶部 avatar 头像展示 */
|
|
7
|
+
avatar: AvatarProps | string;
|
|
8
|
+
/** 标题头部 */
|
|
9
|
+
title: React.ReactNode;
|
|
10
|
+
/** 标题描述 */
|
|
11
|
+
description?: React.ReactNode;
|
|
12
|
+
/** 标签功能 */
|
|
13
|
+
tags?: TagProps[];
|
|
14
|
+
}
|
|
15
|
+
/** 顶部通用区域封装,同时兼容样式的层叠和功能的自定义 */
|
|
16
|
+
export declare const GuardFace: (props: GuardFaceProps) => JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import './styles.less';
|
|
2
|
+
import { AvatarProps } from 'antd/lib/avatar';
|
|
3
|
+
import { ListItemProps, ListProps } from 'antd/lib/list';
|
|
4
|
+
import React, { CSSProperties } from 'react';
|
|
5
|
+
export interface GuardSelectItem {
|
|
6
|
+
/** avatar 头像展示 */
|
|
7
|
+
avatar?: AvatarProps | string;
|
|
8
|
+
/** 标题 */
|
|
9
|
+
title?: React.ReactNode;
|
|
10
|
+
/** 描述 */
|
|
11
|
+
description?: React.ReactNode;
|
|
12
|
+
/** 右侧操作组 */
|
|
13
|
+
actions?: ListItemProps['actions'];
|
|
14
|
+
/** 右侧额外的渲染内容 */
|
|
15
|
+
extra?: ListItemProps['extra'];
|
|
16
|
+
/** 数据项子内容,便于自定义 */
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
/** 其他元字段 */
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
}
|
|
21
|
+
export interface GuardSelectProps<T = any> extends ListProps<any> {
|
|
22
|
+
/**数据项之间的间隙,默认`20px` */
|
|
23
|
+
gap?: CSSProperties['marginBottom'];
|
|
24
|
+
/** 数据源 */
|
|
25
|
+
dataSource: T[];
|
|
26
|
+
onSelect?: (item?: T, index?: number) => void;
|
|
27
|
+
}
|
|
28
|
+
/** 选择列表组件 兼容绝大多数选择场景 */
|
|
29
|
+
export declare const GuardSelect: <D extends GuardSelectItem = any>(props: GuardSelectProps<D>) => JSX.Element;
|
package/types/MFA/interface.d.ts
CHANGED
|
@@ -29,6 +29,9 @@ export interface GuardMFAInitData {
|
|
|
29
29
|
nickme?: string;
|
|
30
30
|
username?: string;
|
|
31
31
|
current?: MFAType;
|
|
32
|
+
mfaPhoneCountryCode?: string;
|
|
33
|
+
mfaPhone?: string;
|
|
34
|
+
mfaEmail?: string;
|
|
32
35
|
}
|
|
33
36
|
export interface GuardMFAProps extends IG2FCProps, MFAEvents {
|
|
34
37
|
config: Partial<MFAConfig>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GuardModuleType } from '../Guard';
|
|
2
|
+
import { IG2Config, IG2Events, IG2FCViewProps } from '../Type';
|
|
3
|
+
export interface SubmitSuccessEvents extends IG2Events {
|
|
4
|
+
}
|
|
5
|
+
export interface SubmitSuccessConfig extends IG2Config {
|
|
6
|
+
}
|
|
7
|
+
export interface SubmitSuccessInitData {
|
|
8
|
+
title?: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
countDesc?: string;
|
|
12
|
+
changeModule?: GuardModuleType;
|
|
13
|
+
}
|
|
14
|
+
export interface GuardNewSubmitSuccessViewProps extends IG2FCViewProps, SubmitSuccessEvents {
|
|
15
|
+
config: SubmitSuccessConfig;
|
|
16
|
+
initData?: SubmitSuccessInitData;
|
|
17
|
+
}
|
|
@@ -7,7 +7,7 @@ export interface RegisterWithEmailProps {
|
|
|
7
7
|
publicConfig?: ApplicationConfig;
|
|
8
8
|
agreements: Agreement[];
|
|
9
9
|
registeContext?: any;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
label?: string;
|
|
11
|
+
method?: string;
|
|
12
12
|
}
|
|
13
13
|
export declare const RegisterWithEmail: React.FC<RegisterWithEmailProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './styles.less';
|
|
3
|
+
/** 租户门户选择状态机返回数据类型 */
|
|
4
|
+
export interface TenantPortalSelectType {
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
logo: string;
|
|
8
|
+
list: {
|
|
9
|
+
tenantName: string;
|
|
10
|
+
tenantId: string;
|
|
11
|
+
tenantLogo: string;
|
|
12
|
+
host: string;
|
|
13
|
+
userName: string;
|
|
14
|
+
}[];
|
|
15
|
+
}
|
|
16
|
+
export declare const GuardTenantPortalSelectView: () => JSX.Element;
|
|
@@ -292,4 +292,14 @@ export interface ApplicationConfig {
|
|
|
292
292
|
loginMethodsSort: string[];
|
|
293
293
|
};
|
|
294
294
|
tabMethodsFields: TabFieldsI18nItem[];
|
|
295
|
+
/** 是否为租户控制台应用 */
|
|
296
|
+
isTenantConsole?: boolean;
|
|
297
|
+
/** 是否默认为租户应用面板应用 */
|
|
298
|
+
isTenantDefault?: boolean;
|
|
299
|
+
/** 租户详情 */
|
|
300
|
+
tenantInfo?: Record<string, any>;
|
|
301
|
+
/** mfa 相关 */
|
|
302
|
+
mfa: {
|
|
303
|
+
faceScore: number;
|
|
304
|
+
};
|
|
295
305
|
}
|
|
@@ -3,4 +3,6 @@ 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
|
|
6
|
+
export declare const CustomNameFormItem: React.FC<ValidatorFormItemProps & {
|
|
7
|
+
method: string;
|
|
8
|
+
}>;
|
|
@@ -11,7 +11,6 @@ export interface ValidatorFormItemProps extends FormItemProps {
|
|
|
11
11
|
* 控制内部FormItem组件关于pattern的校验规则
|
|
12
12
|
*/
|
|
13
13
|
isCheckPattern?: boolean;
|
|
14
|
-
defaultMethod?: string;
|
|
15
14
|
}
|
|
16
15
|
export interface ValidatorFormItemMetaProps extends ValidatorFormItemProps {
|
|
17
16
|
method: 'email' | 'phone' | 'username' | string;
|
|
@@ -4,6 +4,7 @@ import { BackFillMultipleState, StoreInstance } from '../Guard/core/hooks/useMul
|
|
|
4
4
|
import { ModuleState } from '../Guard/GuardModule/stateMachine';
|
|
5
5
|
import { ApplicationConfig } from '../Type/application';
|
|
6
6
|
import { GuardHttp } from './guardHttp';
|
|
7
|
+
import { MultipleTenant } from './tenant';
|
|
7
8
|
export interface IGuardContext {
|
|
8
9
|
finallyConfig: GuardLocalConfig;
|
|
9
10
|
defaultMergedConfig: GuardLocalConfig;
|
|
@@ -43,6 +44,8 @@ export interface IGuardContext {
|
|
|
43
44
|
clearBackFillData?: () => void;
|
|
44
45
|
};
|
|
45
46
|
defaultLanguageConfig: Lang;
|
|
47
|
+
/** 租户信息获取和操作处理相关 */
|
|
48
|
+
tenantInstance?: MultipleTenant;
|
|
46
49
|
}
|
|
47
50
|
export declare const createGuardXContext: () => {
|
|
48
51
|
Provider: React.FC<{
|
|
@@ -143,3 +146,5 @@ export declare const useGuardMultipleInstance: () => {
|
|
|
143
146
|
* 默认语言
|
|
144
147
|
*/
|
|
145
148
|
export declare const useGuardDefaultLanguage: () => Lang;
|
|
149
|
+
/** 用来操作和获取租户相关的内容 */
|
|
150
|
+
export declare const useGuardTenantProvider: () => MultipleTenant | undefined;
|
package/types/_utils/index.d.ts
CHANGED
|
@@ -77,6 +77,7 @@ export declare const getPasswordValidateRules: (strength?: PasswordStrength, cus
|
|
|
77
77
|
export declare const sleep: (delay: number) => Promise<unknown>;
|
|
78
78
|
export declare const shoudGoToComplete: (user: User, contextType: ComplateFiledsPlace, config: ApplicationConfig | undefined, autoRegister?: boolean | undefined) => boolean;
|
|
79
79
|
export declare const transformMethod: (method: RegisterMethods | string) => string;
|
|
80
|
+
export declare const transformSortMethod: (method: RegisterSortMethods | string) => string;
|
|
80
81
|
export declare const mailDesensitization: (mail: string) => string;
|
|
81
82
|
export declare const phoneDesensitization: (phone: string) => string;
|
|
82
83
|
export declare const getHundreds: (num: number) => number;
|
|
@@ -91,6 +92,6 @@ export declare const getLoginTypePipe: (publicConfig: ApplicationConfig, registe
|
|
|
91
92
|
} | undefined;
|
|
92
93
|
export declare const getPasswordIdentify: (identity: string) => string;
|
|
93
94
|
export declare const getCurrentLng: () => Lang;
|
|
94
|
-
export declare const getSortLabels: (methods: string[], i18nConfig: Map<string, TabFieldsI18nItem>, defaultLanguageConfig: Lang) => string;
|
|
95
95
|
export declare const getI18nLabel: (method: string | RegisterSortMethods, i18nFields: Map<string, TabFieldsI18nItem>, defaultLanguageConfig: Lang) => string;
|
|
96
|
+
export declare const getSortLabels: (methods: string[], i18nConfig: Map<string, TabFieldsI18nItem>, defaultLanguageConfig: Lang) => string;
|
|
96
97
|
export declare const getSortTabs: (tabs: string[], tab?: string | undefined) => string[];
|
|
@@ -17,6 +17,7 @@ export declare enum ApiCode {
|
|
|
17
17
|
FORCED_PASSWORD_RESET = 2058,
|
|
18
18
|
UNSAFE_PASSWORD_TIP = 2061,
|
|
19
19
|
UNSAFE_PASSWORD_RESET = 2071,
|
|
20
|
-
FLOW_SELECT_ACCOUNT = 2921
|
|
20
|
+
FLOW_SELECT_ACCOUNT = 2921,
|
|
21
|
+
TENANT_PORTAL = 1644
|
|
21
22
|
}
|
|
22
23
|
export declare const ChangeModuleApiCodeMapping: Record<string, GuardModuleType>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ApplicationConfig } from '../Type';
|
|
2
|
+
/** **当前租户应用** 下的租户信息获取和操作处理,将租户相关的处理收拢 */
|
|
3
|
+
export declare class MultipleTenant {
|
|
4
|
+
private $config;
|
|
5
|
+
private $tenantId;
|
|
6
|
+
constructor(tenantId: string, config: ApplicationConfig);
|
|
7
|
+
/** 获取租户ID */
|
|
8
|
+
getCurrentTenantId: () => string | null;
|
|
9
|
+
/** 获取租户详情 */
|
|
10
|
+
getCurrentTenantInfo: () => Record<string, any> | undefined;
|
|
11
|
+
/**是否为【租户控制台】 */
|
|
12
|
+
isTenantConsole: () => boolean | undefined;
|
|
13
|
+
/** 是否为租户【单点登录】 */
|
|
14
|
+
isTenantSSO: () => boolean | "" | null;
|
|
15
|
+
/** 是否为租户【单点登录面板】 */
|
|
16
|
+
isTenantSSOLaunchPad: () => boolean | "" | null;
|
|
17
|
+
}
|
|
18
|
+
/** 初始化多租户实例 */
|
|
19
|
+
export declare const useMultipleTenant: (tenantId: string, publicConfig: ApplicationConfig) => MultipleTenant | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "4.2.0
|
|
1
|
+
declare const _default: "4.2.0";
|
|
2
2
|
export default _default;
|