@authing/react-ui-components 4.0.24 → 4.1.0-cxmt.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/react-ui-components",
3
- "version": "4.0.24",
3
+ "version": "4.1.0-cxmt.0",
4
4
  "private": false,
5
5
  "main": "lib/index.min.js",
6
6
  "typings": "types/index.d.ts",
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { UserRadioItemProps, UserRadioProps } from './interface';
3
+ import './styles.less';
4
+ export declare const UserRadioItem: React.FC<UserRadioItemProps>;
5
+ export declare const UserRadio: React.FC<UserRadioProps>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import './styles.less';
3
+ export declare const GuardAccountMergeView: React.FC;
@@ -0,0 +1,27 @@
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
+ }
@@ -0,0 +1,3 @@
1
+ import { User } from 'authing-js-sdk';
2
+ export declare const getDisplayName: (user: User) => string;
3
+ export declare const getDisplayNameByEmail: (displayName: string) => string;
@@ -1,6 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
2
  import { AuthClientContextProps } from './context';
3
- export declare const AuthClientProvider: React.FC<AuthClientContextProps & {
4
- children: ReactNode;
5
- }>;
3
+ export declare const AuthClientProvider: React.FC<AuthClientContextProps>;
6
4
  export declare const useGlobalAuthClient: () => import("authing-js-sdk").AuthenticationClient | undefined;
@@ -7,6 +7,4 @@ export declare const BackLogin: React.FC<BackProps>;
7
7
  export interface BackCustomProps extends BackProps {
8
8
  onBack?: () => void;
9
9
  }
10
- export declare const BackCustom: React.FC<BackCustomProps & {
11
- children: any;
12
- }>;
10
+ export declare const BackCustom: React.FC<BackCustomProps>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import './style.less';
3
+ export declare const GuardChangeAccoutTypesView: () => JSX.Element;
@@ -1,8 +1,7 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
2
  export declare const GuardChangePassword: React.FC<{
3
3
  title: string;
4
4
  explain: string;
5
- children: ReactNode;
6
5
  }>;
7
6
  export declare const GuardFirstLoginPasswordResetView: React.FC;
8
7
  export declare const GuardPasswordNotSafeResetView: React.FC;
@@ -0,0 +1,11 @@
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;
@@ -2,7 +2,7 @@ import { AuthenticationClient, CommonMessage, SceneType } from 'authing-js-sdk';
2
2
  import { EmailScene, IG2Config, IG2Events, IG2FCProps, IG2FCViewProps } from '../Type';
3
3
  export interface ForgetPasswordEvents extends IG2Events {
4
4
  onEmailSend?: (authClient: AuthenticationClient, sence?: EmailScene) => void;
5
- onEmailSendError?: (error?: CommonMessage, authClient?: AuthenticationClient, sence?: EmailScene) => void;
5
+ onEmailSendError?: (error: CommonMessage, authClient: AuthenticationClient, sence?: EmailScene) => void;
6
6
  onPhoneSend?: (authClient: AuthenticationClient, sence?: SceneType) => void;
7
7
  onPhoneSendError?: (error: CommonMessage, authClient: AuthenticationClient, sence?: SceneType) => void;
8
8
  onPwdReset?: (authClient: AuthenticationClient) => void;
@@ -1,8 +1,7 @@
1
1
  import { GuardProps } from '..';
2
- import React, { ReactNode } from 'react';
2
+ import React from 'react';
3
3
  import { ModuleState } from '../GuardModule/stateMachine';
4
4
  export declare const RenderContext: React.FC<{
5
5
  guardProps: GuardProps;
6
6
  initState: ModuleState;
7
- children: ReactNode;
8
7
  }>;
@@ -19,7 +19,9 @@ export declare const 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"
23
25
  }
24
26
  export interface GuardModuleAction {
25
27
  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;
@@ -12,3 +12,4 @@ export interface ImageProProps extends React.ImgHTMLAttributes<HTMLImageElement>
12
12
  noSpin?: boolean;
13
13
  }
14
14
  export declare const ImagePro: (props: ImageProProps) => JSX.Element;
15
+ export declare const ImagePro2: (props: ImageProProps) => JSX.Element;
@@ -1,2 +1,4 @@
1
- /// <reference types="react" />
2
- export declare const InputPassword: (props: any) => JSX.Element;
1
+ import { Input } from 'antd';
2
+ import { PasswordProps } from 'antd/lib/input';
3
+ import React from 'react';
4
+ export declare const InputPassword: React.ForwardRefExoticComponent<PasswordProps & React.RefAttributes<React.RefObject<Input>>>;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const LoginWithWeComQrcode: (props: any) => JSX.Element;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import './index.less';
3
3
  import { CodeStatusDescriptions } from './WorkQrCode';
4
4
  export declare type CodeStatus = 'loading' | 'ready' | 'already' | 'success' | 'error' | 'expired' | 'cancel' | 'MFA';
5
- export declare const prefix: string;
5
+ export declare const prefix = "refactor";
6
6
  export interface UiQrProps {
7
7
  /**
8
8
  * Loading 组件
@@ -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;
@@ -264,4 +264,10 @@ export interface ApplicationConfig {
264
264
  * 是否开启注册密码补全
265
265
  */
266
266
  enableCompletePassword: boolean;
267
+ /** 是否为租户控制台应用 */
268
+ isTenantConsole?: boolean;
269
+ /** 是否默认为租户应用面板应用 */
270
+ isTenantDefault?: boolean;
271
+ /** 租户详情 */
272
+ tenantInfo?: Record<string, any>;
267
273
  }
@@ -1,9 +1,10 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
2
  import { GuardEvents, GuardLocalConfig, GuardModuleType, GuardPageConfig } from '..';
3
3
  import { BackFillMultipleState, StoreInstance } from '../Guard/core/hooks/useMultipleAccounts';
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;
@@ -42,18 +43,18 @@ export interface IGuardContext {
42
43
  */
43
44
  clearBackFillData?: () => void;
44
45
  };
46
+ /** 租户信息获取和操作处理相关 */
47
+ tenantInstance?: MultipleTenant;
45
48
  }
46
49
  export declare const createGuardXContext: () => {
47
50
  Provider: React.FC<{
48
51
  value: Partial<IGuardContext>;
49
- children: ReactNode;
50
52
  }>;
51
53
  Consumer: React.Consumer<IGuardContext>;
52
54
  };
53
55
  export declare const useGuardXContext: () => {
54
56
  Provider: React.FC<{
55
57
  value: Partial<IGuardContext>;
56
- children: ReactNode;
57
58
  }>;
58
59
  Consumer: React.Consumer<IGuardContext>;
59
60
  };
@@ -62,9 +63,7 @@ export interface IGuardContextProvider {
62
63
  spinChange: (spin: boolean) => void;
63
64
  }
64
65
  export declare const useGuardButtonContext: () => {
65
- GuardButtonProvider: React.FC<{
66
- children: ReactNode;
67
- }>;
66
+ GuardButtonProvider: React.FC<{}>;
68
67
  };
69
68
  export declare const useGuardButtonState: () => IGuardContextProvider;
70
69
  export declare const useGuardPublicConfig: () => ApplicationConfig;
@@ -141,3 +140,5 @@ export declare const useGuardMultipleInstance: () => {
141
140
  */
142
141
  clearBackFillData?: (() => void) | undefined;
143
142
  };
143
+ /** 用来操作和获取租户相关的内容 */
144
+ export declare const useGuardTenantProvider: () => MultipleTenant | undefined;
@@ -34,7 +34,7 @@ export declare function isObject(item: any): any;
34
34
  * @param target
35
35
  * @param ...sources
36
36
  */
37
- export declare function deepMerge<T extends object = any>(target: T, ...sources: any[]): T;
37
+ export declare function deepMerge<T extends any = any>(target: T, ...sources: any[]): T;
38
38
  /**
39
39
  * 在托管页下上传query中指定的用户自定义字段进行补全
40
40
  * @param params 指定上传的用户自定义字段
@@ -17,6 +17,7 @@ export declare const 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.0.24";
1
+ declare const _default: "4.1.0-cxmt.0";
2
2
  export default _default;