@regenbio/regenbio-components-react 1.3.33 → 1.3.35

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.
@@ -105,10 +105,6 @@ export type RbDataTableProps<DataSource, U, ValueType = 'text'> = {
105
105
  * 粘性布局
106
106
  */
107
107
  sticky?: boolean | TableSticky;
108
- /**
109
- * 国际化
110
- */
111
- intl: any;
112
108
  /**
113
109
  * 等待状态改变监听
114
110
  *
@@ -130,5 +126,8 @@ export type RbDataTableProps<DataSource, U, ValueType = 'text'> = {
130
126
  alert: React.ReactNode | undefined;
131
127
  table: React.ReactNode | undefined;
132
128
  }) => React.ReactNode;
129
+ /**
130
+ * 配置展开属性
131
+ */
133
132
  expandable?: ExpandableConfig<DataSource>;
134
133
  };
@@ -28,8 +28,4 @@ export type RbFileTagProps = {
28
28
  * 标签颜色
29
29
  */
30
30
  color?: string;
31
- /**
32
- * 国际化
33
- */
34
- intl: any;
35
31
  };
@@ -27,32 +27,4 @@ export type RbUserCardProps = {
27
27
  * 子节点
28
28
  */
29
29
  children?: React.ReactNode;
30
- /**
31
- * 国际化
32
- */
33
- intl: any;
34
- /**
35
- * 全局变量,用来判断当前用户是否携带对应的权限标识
36
- */
37
- initialState?: any;
38
- /**
39
- * 获取用户详情方法
40
- *
41
- * @param id 用户主键ID
42
- */
43
- getUserDetail: (id: string, options?: {
44
- [key: string]: any;
45
- }) => Promise<any>;
46
- /**
47
- * 获取头像预览URL方法
48
- *
49
- * @param guid 头像文件主键ID
50
- */
51
- getPreviewUrl: (guid: any) => null | string;
52
- /**
53
- * 请求远程用户数据的方法
54
- *
55
- * @param guid 用户主键ID
56
- */
57
- request?: (guid: string) => Promise<any>;
58
30
  };
@@ -42,13 +42,4 @@ export type RbAttachmentTextProps = {
42
42
  * 访问令牌
43
43
  */
44
44
  accessToken?: string;
45
- /**
46
- * 国际化
47
- */
48
- intl: any;
49
- /**
50
- * 文件上传连接渲染方法
51
- * @param configCode 配置编码
52
- */
53
- uploadUrl: (configCode: string) => string;
54
45
  };
@@ -10,8 +10,4 @@ export type RbMarkdownEditorProps = {
10
10
  * 改变回调
11
11
  */
12
12
  onChange?: any;
13
- /**
14
- * 国际化
15
- */
16
- intl: any;
17
13
  };
@@ -30,16 +30,6 @@ export type RbSingleImageUploaderProps = {
30
30
  */
31
31
  clientId?: string;
32
32
  };
33
- /**
34
- * 文件上传链接渲染方法
35
- * @param configCode 配置编码
36
- */
37
- uploadUrl: (configCode: string) => string;
38
- /**
39
- * 文件预览链接渲染方法
40
- * @param guid 文件主键ID
41
- */
42
- previewUrl: (guid: any) => null | string;
43
33
  /**
44
34
  * 规则
45
35
  */
@@ -57,8 +47,4 @@ export type RbSingleImageUploaderProps = {
57
47
  * @param msg 失败消息
58
48
  */
59
49
  afterFail?: (msg: string) => void;
60
- /**
61
- * 国际化
62
- */
63
- intl: any;
64
50
  };
@@ -53,8 +53,4 @@ export type RbUserSelectorProps<ValueType = any, OptionType extends BaseOptionTy
53
53
  * @param guid 图片主键ID
54
54
  */
55
55
  avatarPreview: (guid: any) => null | string;
56
- /**
57
- * 国际化
58
- */
59
- intl: any;
60
56
  } & ProFormFieldRemoteProps;
@@ -13,10 +13,6 @@ export type RbActionBarProps = {
13
13
  * 操作栏子项
14
14
  */
15
15
  children: React.ReactElement<typeof RbActionBarItem> | React.ReactElement<typeof RbActionBarItem>[];
16
- /**
17
- * 全局变量,用来判断当前用户是否携带对应的权限标识
18
- */
19
- initialState?: any;
20
16
  /**
21
17
  * 表格的扩展操作 Ref,传入后可以联动数据表格的 Loading 状态
22
18
  */
@@ -1,7 +1,9 @@
1
+ import { Context } from 'react';
2
+ import { RbGlobalStateType } from "../../../services/types/commonType";
1
3
  /**
2
4
  * 全局状态上下文
3
5
  */
4
- export declare const GlobalStateContext: any;
6
+ export declare const RbGlobalContext: Context<RbGlobalStateType>;
5
7
  /**
6
8
  * 全局状态Hook
7
9
  */
@@ -1,4 +1,4 @@
1
- import { RbInitialStateRespProps } from "../../../PageLayout/AppLayout/type";
1
+ import { RbInitialStateRespProps } from "../../../../services/types/commonType";
2
2
  /**
3
3
  * Rb 授权组件属性
4
4
  */
@@ -10,18 +10,10 @@ export type RbAuthFrameProps = {
10
10
  * @param state 路由参数
11
11
  */
12
12
  onFinish: (to: string, state: any) => void;
13
- /**
14
- * 全局初始化状态
15
- */
16
- initialState: RbInitialStateRespProps;
17
13
  /**
18
14
  * 设置全局初始化状态
19
15
  */
20
16
  setInitialState: (initialState: RbInitialStateRespProps) => void;
21
- /**
22
- * 国际化
23
- */
24
- intl: any;
25
17
  /**
26
18
  * 查询路由参数
27
19
  */
@@ -11,10 +11,6 @@ export type RbBindFrameProps = {
11
11
  * 响应式
12
12
  */
13
13
  responsive: boolean;
14
- /**
15
- * 国际化
16
- */
17
- intl: any;
18
14
  /**
19
15
  * 获取用户强制绑定的信息
20
16
  * @param options 参数
@@ -1,4 +1,5 @@
1
- import { RbAppLayoutProps, RbInitialStateReqProps, RbInitialStateRespProps } from "./type";
1
+ import { RbAppLayoutProps } from "./type";
2
+ import { RbInitialStateReqProps, RbInitialStateRespProps } from "../../../services/types/commonType";
2
3
  /**
3
4
  * 获取初始化数据
4
5
  *
@@ -1,78 +1,5 @@
1
- import type { Settings as LayoutSettings } from '@ant-design/pro-components';
2
1
  import React from "react";
3
- import { RbCurrentTheme, RbCurrentUser } from "./interface";
4
- /**
5
- * 全局初始化状态相请求参数
6
- */
7
- export type RbInitialStateReqProps = {
8
- /**
9
- * 当前国际化语言
10
- */
11
- locale: string;
12
- /**
13
- * 路由
14
- */
15
- history: any;
16
- /**
17
- * 默认配置
18
- */
19
- defaultSettings: Partial<LayoutSettings>;
20
- /**
21
- * 登录加载路径
22
- */
23
- loginLoadPath: string;
24
- /**
25
- * 获取用户初始化详情
26
- *
27
- * @param options 参数
28
- */
29
- getUserInitDetail: (options?: {
30
- [p: string]: any;
31
- }) => Promise<any>;
32
- /**
33
- * 获取当前主题详情
34
- *
35
- * @param options 参数
36
- */
37
- getCurrentThemeDetail: (options?: {
38
- [p: string]: any;
39
- }) => Promise<any>;
40
- /**
41
- * 获取头像预览URL方法
42
- *
43
- * @param guid 头像文件主键ID
44
- */
45
- getPreviewUrl: (guid: any) => null | string;
46
- };
47
- /**
48
- * 全局初始化状态相响应参数
49
- */
50
- export type RbInitialStateRespProps = {
51
- /**
52
- * 配置信息
53
- */
54
- settings?: Partial<LayoutSettings>;
55
- /**
56
- * 当前用户信息
57
- */
58
- currentUser?: RbCurrentUser;
59
- /**
60
- * 当前主题信息
61
- */
62
- currentTheme?: RbCurrentTheme;
63
- /**
64
- * 加载状态
65
- */
66
- loading?: boolean;
67
- /**
68
- * 触发远程用户信息的方法
69
- */
70
- fetchUserInfo: () => Promise<RbCurrentUser>;
71
- /**
72
- * 触发远程主题信息的方法
73
- */
74
- fetchThemeInfo: () => Promise<RbCurrentTheme>;
75
- };
2
+ import { RbGlobalStateType, RbInitialStateRespProps } from "../../../services/types/commonType";
76
3
  /**
77
4
  * 应用布局属性
78
5
  */
@@ -89,10 +16,6 @@ export type RbAppLayoutProps = {
89
16
  * 客户端ID
90
17
  */
91
18
  clientId: string;
92
- /**
93
- * 全局初始化状态
94
- */
95
- initialState: RbInitialStateRespProps;
96
19
  /**
97
20
  * 设置全局初始化状态
98
21
  */
@@ -115,4 +38,8 @@ export type RbAppLayoutProps = {
115
38
  * 头像下拉
116
39
  */
117
40
  avatarDropdown: React.ReactNode;
41
+ /**
42
+ * 全局状态
43
+ */
44
+ globalState: RbGlobalStateType;
118
45
  };
package/build/index.d.ts CHANGED
@@ -28,32 +28,32 @@ import { RbMarkdownEditorProps } from "./components/DataEntry/MarkdownEditor/typ
28
28
  import RbSingleImageUploader from "./components/DataEntry/Uploader/SingleImageUploader";
29
29
  import { RbSingleImageUploaderProps } from "./components/DataEntry/Uploader/SingleImageUploader/type";
30
30
  import { getRbInitialState, getRbAppLayout } from "./components/PageLayout/AppLayout";
31
- import { RbInitialStateReqProps, RbInitialStateRespProps, RbAppLayoutProps } from "./components/PageLayout/AppLayout/type";
31
+ import { RbAppLayoutProps } from "./components/PageLayout/AppLayout/type";
32
32
  import { RbCurrentUser, RbCurrentTheme } from "./components/PageLayout/AppLayout/interface";
33
33
  import RbAuthFrame from "./components/Other/LoginLoad/AuthFrame";
34
34
  import { RbAuthFrameProps } from "./components/Other/LoginLoad/AuthFrame/type";
35
35
  import RbBindFrame from "./components/Other/LoginLoad/BindFrame";
36
36
  import { RbBindFrameProps } from "./components/Other/LoginLoad/BindFrame/type";
37
- import { GlobalStateContext } from "./components/Other/GlobalContext";
37
+ import { RbGlobalContext } from "./components/Other/GlobalContext";
38
38
  import DbUtil from "./services/utils/dbUtil";
39
39
  import ObjectUtil from "./services/utils/objectUtil";
40
40
  import EventUtil from "./services/utils/eventUtil";
41
41
  import StorageUtil from "./services/utils/storageUtil";
42
- import ResourceUtil from "./services/utils/resourceUtil";
43
- import RenderUtil from "./services/utils/renderUtil";
44
42
  import StringUtil from "./services/utils/stringUtil";
45
43
  import NumberUtil from "./services/utils/numberUtil";
46
44
  import RandomUtil from "./services/utils/randomUtil";
47
45
  import UnicodeUtil from "./services/utils/unicodeUtil";
48
46
  import UploadUtil from "./services/utils/uploadUtil";
49
47
  import RequestUtil from "./services/utils/requestUtil";
50
- import DictUtil from "./services/utils/dictUtil";
51
48
  import EventEnum from "./services/enums/eventEnum";
52
49
  import StorageEnum from "./services/enums/storageEnum";
50
+ import useDictionary from "./services/hooks/useDictionary";
51
+ import useValueEnum from "./services/hooks/useValueEnum";
52
+ import useAuthorize from "./services/hooks/useAuthorize";
53
53
  import CommonConstant from "./services/constants/commonConstant";
54
54
  import IconConstant from "./services/constants/iconConstant";
55
55
  import DbConstant from "./services/constants/dbConstant";
56
- import { RespDTO, ConstantListItem, DictListItem, PageParams } from "./services/types/commonType";
56
+ import { RespDTO, ConstantListItem, DictListItem, PageParams, RbInitialStateRespProps, RbInitialStateReqProps, RbGlobalStateType, RbGlobalFunctionType } from "./services/types/commonType";
57
57
  import { BaseDO, BaseRelativeDO } from "./services/interfaces/commonInterface";
58
58
  import { TokenDO } from "./services/interfaces/oauth2Interface";
59
59
  import zhCN from "./locales/zh-CN";
@@ -85,19 +85,20 @@ export type { RbPageContainerProps };
85
85
  export { RbHomePage };
86
86
  export type { RbHomePageProps };
87
87
  export { getRbInitialState, getRbAppLayout };
88
- export type { RbInitialStateReqProps, RbInitialStateRespProps, RbAppLayoutProps };
88
+ export type { RbAppLayoutProps };
89
89
  export { RbCurrentUser, RbCurrentTheme };
90
90
  export { RbActionBarItem, RbActionBar };
91
91
  export type { RbActionBarItemProps, RbActionBarProps };
92
92
  export { RbThemeSetter };
93
93
  export { RbAuthFrame, RbBindFrame };
94
94
  export type { RbAuthFrameProps, RbBindFrameProps };
95
- export { GlobalStateContext };
96
- export { DbUtil, ObjectUtil, EventUtil, StorageUtil, ResourceUtil, RenderUtil, StringUtil, NumberUtil, RandomUtil, UnicodeUtil, UploadUtil, RequestUtil, DictUtil };
95
+ export { RbGlobalContext };
96
+ export { DbUtil, ObjectUtil, EventUtil, StorageUtil, StringUtil, NumberUtil, RandomUtil, UnicodeUtil, UploadUtil, RequestUtil };
97
97
  export { EventEnum, StorageEnum };
98
98
  export { CommonConstant, IconConstant, DbConstant };
99
- export { RespDTO, ConstantListItem, DictListItem, PageParams };
99
+ export { RespDTO, ConstantListItem, DictListItem, PageParams, RbInitialStateReqProps, RbInitialStateRespProps, RbGlobalStateType, RbGlobalFunctionType };
100
100
  export { BaseDO, BaseRelativeDO, TokenDO };
101
+ export { useDictionary, useValueEnum, useAuthorize };
101
102
  export { zhCN, enUS };
102
103
  declare const _default: {
103
104
  RbDataTable: <DataSource, U, ValueType = "text">(props: RbDataTableProps<DataSource, U, ValueType>) => any;
@@ -121,6 +122,6 @@ declare const _default: {
121
122
  RbSingleImageUploader: React.FC<RbSingleImageUploaderProps>;
122
123
  RbAuthFrame: React.FC<RbAuthFrameProps>;
123
124
  RbBindFrame: React.FC<RbBindFrameProps>;
124
- GlobalStateContext: any;
125
+ RbGlobalContext: Context<RbGlobalStateType>;
125
126
  };
126
127
  export default _default;