@regenbio/regenbio-components-react 1.2.87 → 1.2.88

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,11 @@
1
+ import React from "react";
2
+ import { RbSingleImageUploaderProps } from "./type";
3
+ /**
4
+ * RB 单图片上传器
5
+ * 该层存在的意义在于捕获 Form 传递进来的 onChange 方法,让该组件能像原生组件一样运行
6
+ *
7
+ * @param props
8
+ * @constructor
9
+ */
10
+ declare const RbSingleImageUploader: React.FC<RbSingleImageUploaderProps>;
11
+ export default RbSingleImageUploader;
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ 'components.single-image-uploader.upload-button': string;
3
+ };
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ 'components.single-image-uploader.upload-button': string;
3
+ };
4
+ export default _default;
@@ -0,0 +1,64 @@
1
+ import React from "react";
2
+ import { NamePath } from "rc-field-form/es/interface";
3
+ import type { Rule } from "rc-field-form/lib/interface";
4
+ /**
5
+ * 单图片上传器属性
6
+ */
7
+ export type RbSingleImageUploaderProps = {
8
+ /**
9
+ * 字段名称
10
+ */
11
+ name?: NamePath;
12
+ /**
13
+ * 字段标题
14
+ */
15
+ label?: React.ReactNode;
16
+ /**
17
+ * 请求头
18
+ */
19
+ headers?: {
20
+ /**
21
+ * 访问令牌
22
+ */
23
+ accessToken?: string;
24
+ /**
25
+ * 语言
26
+ */
27
+ locale?: string;
28
+ /**
29
+ * 客户端ID
30
+ */
31
+ clientId?: string;
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
+ /**
44
+ * 规则
45
+ */
46
+ rules?: Rule[];
47
+ /**
48
+ * 文件编码
49
+ */
50
+ fileCode: string;
51
+ /**
52
+ * 上传成功回调
53
+ */
54
+ afterSuccess?: () => void;
55
+ /**
56
+ * 上传失败回调
57
+ * @param msg 失败消息
58
+ */
59
+ afterFail?: (msg: string) => void;
60
+ /**
61
+ * 国际化
62
+ */
63
+ intl: any;
64
+ };
package/build/index.d.ts CHANGED
@@ -25,6 +25,8 @@ import RbHomePage from "./components/HomePage";
25
25
  import { RbHomePageProps } from "./components/HomePage/type";
26
26
  import { RbMarkdownEditor, RbMarkdownConverter } from "./components/MarkdownEditor";
27
27
  import { RbMarkdownEditorProps } from "./components/MarkdownEditor/type";
28
+ import RbSingleImageUploader from "./components/Uploader/SingleImageUploader";
29
+ import { RbSingleImageUploaderProps } from "./components/Uploader/SingleImageUploader/type";
28
30
  import DbUtil from "./services/utils/dbUtil";
29
31
  import ObjectUtil from "./services/utils/objectUtil";
30
32
  import EventUtil from "./services/utils/eventUtil";
@@ -35,6 +37,7 @@ import StringUtil from "./services/utils/stringUtil";
35
37
  import NumberUtil from "./services/utils/numberUtil";
36
38
  import RandomUtil from "./services/utils/randomUtil";
37
39
  import UnicodeUtil from "./services/utils/unicodeUtil";
40
+ import UploadUtil from "./services/utils/uploadUtil";
38
41
  import EventEnum from "./services/enums/eventEnum";
39
42
  import StorageEnum from "./services/enums/storageEnum";
40
43
  import CommonConstant from "./services/constants/commonConstant";
@@ -70,7 +73,9 @@ export { RbHomePage };
70
73
  export type { RbHomePageProps };
71
74
  export { RbMarkdownConverter, RbMarkdownEditor };
72
75
  export type { RbMarkdownEditorProps };
73
- export { DbUtil, ObjectUtil, EventUtil, StorageUtil, ResourceUtil, RenderUtil, StringUtil, NumberUtil, RandomUtil, UnicodeUtil };
76
+ export { RbSingleImageUploader };
77
+ export type { RbSingleImageUploaderProps };
78
+ export { DbUtil, ObjectUtil, EventUtil, StorageUtil, ResourceUtil, RenderUtil, StringUtil, NumberUtil, RandomUtil, UnicodeUtil, UploadUtil };
74
79
  export { EventEnum, StorageEnum };
75
80
  export { CommonConstant, IconConstant, DbConstant };
76
81
  export { RespDTO, ConstantListItem };
@@ -94,5 +99,6 @@ declare const _default: {
94
99
  RbHomePage: React.FC<RbHomePageProps>;
95
100
  RbMarkdownConverter: import("showdown").Converter;
96
101
  RbMarkdownEditor: React.FC<RbMarkdownEditorProps>;
102
+ RbSingleImageUploader: React.FC<RbSingleImageUploaderProps>;
97
103
  };
98
104
  export default _default;