@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.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 值枚举操作Hook
3
+ */
4
+ declare const useAuthorize: () => {
5
+ checkResource: (sign: string | undefined, gap?: boolean) => boolean;
6
+ };
7
+ export default useAuthorize;
@@ -0,0 +1,13 @@
1
+ import { DictListItem } from "../../index";
2
+ import React from "react";
3
+ /**
4
+ * 字典操作Hook
5
+ */
6
+ declare const useDictionary: () => {
7
+ getDataByType: (type: string) => Promise<DictListItem[]>;
8
+ getTagDataByType: (type: string) => Promise<{
9
+ label: React.ReactNode;
10
+ value: number;
11
+ }[]>;
12
+ };
13
+ export default useDictionary;
@@ -0,0 +1,9 @@
1
+ import { ConstantListItem } from "../../index";
2
+ import { ProSchemaValueEnumType } from "@ant-design/pro-provider";
3
+ /**
4
+ * 值枚举操作Hook
5
+ */
6
+ declare const useValueEnum: () => {
7
+ convertListToMap: (list: ConstantListItem[]) => Map<any, ProSchemaValueEnumType>;
8
+ };
9
+ export default useValueEnum;
@@ -1,3 +1,5 @@
1
+ import type { Settings as LayoutSettings } from "@ant-design/pro-layout";
2
+ import { RbCurrentTheme, RbCurrentUser } from "../../components/PageLayout/AppLayout/interface";
1
3
  /**
2
4
  * 响应结果传输类
3
5
  */
@@ -64,16 +66,131 @@ export type PageParams = {
64
66
  current?: number;
65
67
  pageSize?: number;
66
68
  };
69
+ /**
70
+ * 全局初始化状态相响应参数
71
+ */
72
+ export type RbInitialStateRespProps = {
73
+ /**
74
+ * 配置信息
75
+ */
76
+ settings?: Partial<LayoutSettings>;
77
+ /**
78
+ * 当前用户信息
79
+ */
80
+ currentUser?: RbCurrentUser;
81
+ /**
82
+ * 当前主题信息
83
+ */
84
+ currentTheme?: RbCurrentTheme;
85
+ /**
86
+ * 加载状态
87
+ */
88
+ loading?: boolean;
89
+ /**
90
+ * 触发远程用户信息的方法
91
+ */
92
+ fetchUserInfo: () => Promise<RbCurrentUser>;
93
+ /**
94
+ * 触发远程主题信息的方法
95
+ */
96
+ fetchThemeInfo: () => Promise<RbCurrentTheme>;
97
+ };
98
+ /**
99
+ * 全局初始化状态相请求参数
100
+ */
101
+ export type RbInitialStateReqProps = {
102
+ /**
103
+ * 当前国际化语言
104
+ */
105
+ locale: string;
106
+ /**
107
+ * 路由
108
+ */
109
+ history: any;
110
+ /**
111
+ * 默认配置
112
+ */
113
+ defaultSettings: Partial<LayoutSettings>;
114
+ /**
115
+ * 登录加载路径
116
+ */
117
+ loginLoadPath: string;
118
+ /**
119
+ * 获取用户初始化详情
120
+ *
121
+ * @param options 参数
122
+ */
123
+ getUserInitDetail: (options?: {
124
+ [p: string]: any;
125
+ }) => Promise<any>;
126
+ /**
127
+ * 获取当前主题详情
128
+ *
129
+ * @param options 参数
130
+ */
131
+ getCurrentThemeDetail: (options?: {
132
+ [p: string]: any;
133
+ }) => Promise<any>;
134
+ /**
135
+ * 获取头像预览URL方法
136
+ *
137
+ * @param guid 头像文件主键ID
138
+ */
139
+ getPreviewUrl: (guid: any) => null | string;
140
+ };
141
+ /**
142
+ * 全局方法
143
+ */
144
+ export type RbGlobalFunctionType = {
145
+ /**
146
+ * 请求字典数据接口
147
+ *
148
+ * @param sign 标识
149
+ * @param options
150
+ */
151
+ getDictDataByType?: (sign: string, options?: {
152
+ [p: string]: any;
153
+ }) => Promise<any>;
154
+ /**
155
+ * 获取用户详情方法
156
+ *
157
+ * @param id 用户主键ID
158
+ * @param options
159
+ */
160
+ getUserDetail?: (id: string, options?: {
161
+ [key: string]: any;
162
+ }) => Promise<any>;
163
+ /**
164
+ * 获取预览文件URL地址
165
+ *
166
+ * @param guid 文件主键ID
167
+ */
168
+ getPreviewUrl?: (guid: any) => null | string;
169
+ /**
170
+ * 获取上传文件URL地址
171
+ *
172
+ * @param configCode 文件编码
173
+ */
174
+ getUploadUrl?: (configCode: string) => string;
175
+ };
67
176
  /**
68
177
  * 全局参数
69
178
  */
70
- export type globalStateType = {
179
+ export type RbGlobalStateType = {
71
180
  /**
72
- * 国际化语言
181
+ * 国际化配置
73
182
  */
74
183
  intl: any;
75
184
  /**
76
185
  * 全局状态
77
186
  */
78
- initialState: any;
187
+ initialState: RbInitialStateRespProps;
188
+ /**
189
+ * 当前国际化语言
190
+ */
191
+ locale: string;
192
+ /**
193
+ * 公共方法
194
+ */
195
+ globalFunctions: RbGlobalFunctionType;
79
196
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regenbio/regenbio-components-react",
3
- "version": "1.3.33",
3
+ "version": "1.3.35",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,14 +0,0 @@
1
- import React from "react";
2
- import { DictListItem } from "../../index";
3
- declare const _default: {
4
- getDictData: <T>(type: string, locale: string, getDictDataByType: (sign: string, options?: {
5
- [p: string]: any;
6
- }) => Promise<any>) => Promise<DictListItem[]>;
7
- getDictData4Column: <T>(type: string, locale: string, getDictDataByType: (sign: string, options?: {
8
- [p: string]: any;
9
- }) => Promise<any>) => Promise<{
10
- label: React.ReactNode;
11
- value: number;
12
- }[]>;
13
- };
14
- export default _default;
@@ -1,6 +0,0 @@
1
- import { ProSchemaValueEnumType } from '@ant-design/pro-provider';
2
- import { ConstantListItem } from "../types/commonType";
3
- declare const _default: {
4
- convertListToMap: (list: ConstantListItem[], intl: any) => Map<any, ProSchemaValueEnumType>;
5
- };
6
- export default _default;
@@ -1,12 +0,0 @@
1
- /**
2
- * 校验资源是否可用
3
- *
4
- * @param sign 标识
5
- * @param initialState 全局变量
6
- * @param check 是否检查
7
- */
8
- export declare const checkResource: (sign: string | undefined, initialState: any, check?: boolean) => boolean;
9
- declare const _default: {
10
- checkResource: (sign: string | undefined, initialState: any, check?: boolean) => boolean;
11
- };
12
- export default _default;