@authing/react-ui-components 4.0.16-rc.2 → 4.0.16-tn.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.16-rc.2",
3
+ "version": "4.0.16-tn.0",
4
4
  "private": false,
5
5
  "main": "lib/index.min.js",
6
6
  "typings": "types/index.d.ts",
@@ -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;
@@ -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
  }
@@ -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;
@@ -42,6 +43,8 @@ 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<{
@@ -137,3 +140,5 @@ export declare const useGuardMultipleInstance: () => {
137
140
  */
138
141
  clearBackFillData?: (() => void) | undefined;
139
142
  };
143
+ /** 用来操作和获取租户相关的内容 */
144
+ export declare const useGuardTenantProvider: () => MultipleTenant | undefined;
@@ -27,7 +27,7 @@ export declare const getClassnames: (classnames: (string | boolean | undefined)[
27
27
  * @param item
28
28
  * @returns {boolean}
29
29
  */
30
- export declare function isObject(item: any): boolean;
30
+ export declare function isObject(item: any): any;
31
31
  /**
32
32
  * https://www.itranslater.com/qa/details/2115518846294557696
33
33
  * Deep merge two objects.
@@ -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 | undefined;
15
+ /** 是否为租户【单点登录面板】 */
16
+ isTenantSSOLaunchPad: () => boolean | undefined;
17
+ }
18
+ /** 初始化多租户实例 */
19
+ export declare const useMultipleTenant: (tenantId: string, publicConfig: ApplicationConfig) => MultipleTenant | undefined;
@@ -1,2 +1,2 @@
1
- declare const _default: "4.0.16-rc.2";
1
+ declare const _default: "4.0.16-tn.0";
2
2
  export default _default;