@regenbio/regenbio-components-react 1.1.2 → 1.1.5
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/build/components/ActionBar/index.d.ts +16 -0
- package/build/components/ActionBar/type.d.ts +70 -0
- package/build/components/DataTable/constant.d.ts +4 -0
- package/build/components/DataTable/index.d.ts +9 -0
- package/build/components/DataTable/locales/en-US.d.ts +4 -0
- package/build/components/DataTable/locales/zh-CN.d.ts +4 -0
- package/build/components/DataTable/type.d.ts +107 -0
- package/build/components/ThemeListener/index.d.ts +9 -0
- package/build/components/ThemeListener/type.d.ts +10 -0
- package/build/components/ThemeSetter/index.d.ts +8 -0
- package/build/index.d.ts +34 -0
- package/build/index.js +17 -0
- package/build/index.js.LICENSE.txt +183 -0
- package/build/locales/en-US.d.ts +4 -0
- package/build/locales/zh-CN.d.ts +4 -0
- package/build/services/enums/eventEnum.d.ts +10 -0
- package/build/services/enums/storageEnum.d.ts +10 -0
- package/build/services/utils/dbUtil.d.ts +5 -0
- package/build/services/utils/eventUtil.d.ts +5 -0
- package/build/services/utils/objectUtil.d.ts +5 -0
- package/build/services/utils/resourceUtil.d.ts +12 -0
- package/build/services/utils/storageUtil.d.ts +5 -0
- package/package.json +4 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RbActionBarItemProps, RbActionBarProps } from "./type";
|
|
2
|
+
/**
|
|
3
|
+
* RB 操作栏子项
|
|
4
|
+
*
|
|
5
|
+
* @param props 参数配置
|
|
6
|
+
* @constructor
|
|
7
|
+
*/
|
|
8
|
+
declare const RbActionBarItem: (props: RbActionBarItemProps) => any;
|
|
9
|
+
/**
|
|
10
|
+
* RB 操作栏
|
|
11
|
+
*
|
|
12
|
+
* @param props 参数配置
|
|
13
|
+
* @constructor
|
|
14
|
+
*/
|
|
15
|
+
declare const RbActionBar: (props: RbActionBarProps) => any;
|
|
16
|
+
export { RbActionBarItem, RbActionBar };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React, { MutableRefObject } from "react";
|
|
2
|
+
import { RbActionBarItem } from "./index";
|
|
3
|
+
import { RbActionType } from "../DataTable/type";
|
|
4
|
+
/**
|
|
5
|
+
* 操作栏属性
|
|
6
|
+
*/
|
|
7
|
+
export type RbActionBarProps = {
|
|
8
|
+
/**
|
|
9
|
+
* 最大展示数量(超出后收起)
|
|
10
|
+
*/
|
|
11
|
+
max?: number;
|
|
12
|
+
/**
|
|
13
|
+
* 操作栏子项
|
|
14
|
+
*/
|
|
15
|
+
children: React.ReactElement<typeof RbActionBarItem> | React.ReactElement<typeof RbActionBarItem>[];
|
|
16
|
+
/**
|
|
17
|
+
* 全局变量,用来判断当前用户是否携带对应的权限标识
|
|
18
|
+
*/
|
|
19
|
+
initialState?: any;
|
|
20
|
+
/**
|
|
21
|
+
* 表格的扩展操作 Ref,传入后可以联动数据表格的 Loading 状态
|
|
22
|
+
*/
|
|
23
|
+
tableRef?: MutableRefObject<RbActionType | undefined>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* 操作栏子项属性
|
|
27
|
+
*/
|
|
28
|
+
export type RbActionBarItemProps = {
|
|
29
|
+
/**
|
|
30
|
+
* 权限标识
|
|
31
|
+
*/
|
|
32
|
+
sign: string;
|
|
33
|
+
/**
|
|
34
|
+
* 隐藏状态
|
|
35
|
+
*/
|
|
36
|
+
hide?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 表格的扩展操作 Ref,传入后可以联动数据表格的 Loading 状态
|
|
39
|
+
*/
|
|
40
|
+
tableRef?: MutableRefObject<RbActionType | undefined>;
|
|
41
|
+
/**
|
|
42
|
+
* 是否检查权限,默认不传递则检查,此时 sign 只有 key 的作用
|
|
43
|
+
*/
|
|
44
|
+
checkSign?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 点击触发方法
|
|
47
|
+
*/
|
|
48
|
+
onClick: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* 内容
|
|
51
|
+
*/
|
|
52
|
+
content?: React.ReactNode | string;
|
|
53
|
+
/**
|
|
54
|
+
* 二次确认参数(气泡框提示)
|
|
55
|
+
*/
|
|
56
|
+
doubleCheck?: {
|
|
57
|
+
/**
|
|
58
|
+
* 是否开启
|
|
59
|
+
*/
|
|
60
|
+
enable: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* 标题
|
|
63
|
+
*/
|
|
64
|
+
title: string;
|
|
65
|
+
/**
|
|
66
|
+
* 描述
|
|
67
|
+
*/
|
|
68
|
+
description?: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { ActionType, ProColumns, RequestData } from "@ant-design/pro-components";
|
|
2
|
+
import { ReactNode, Ref } from "react";
|
|
3
|
+
import { TableProps } from "antd";
|
|
4
|
+
import type { SortOrder } from "antd/lib/table/interface";
|
|
5
|
+
import type { ToolBarProps } from "@ant-design/pro-table/es/components/ToolBar";
|
|
6
|
+
import type { AlertRenderType } from "@ant-design/pro-table/es/components/Alert";
|
|
7
|
+
import type { TableProps as RcTableProps } from "rc-table/lib/Table";
|
|
8
|
+
import type { SearchConfig } from "@ant-design/pro-table/es/components/Form/FormRender";
|
|
9
|
+
import type { TableSticky } from "rc-table/lib/interface";
|
|
10
|
+
/**
|
|
11
|
+
* 扩展操作类型
|
|
12
|
+
*/
|
|
13
|
+
export type RbActionType = {
|
|
14
|
+
/**
|
|
15
|
+
* 主动开启表格等待
|
|
16
|
+
*/
|
|
17
|
+
startLoading: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* 主动关闭表格等待
|
|
20
|
+
*/
|
|
21
|
+
finishLoading: () => void;
|
|
22
|
+
} & ActionType;
|
|
23
|
+
/**
|
|
24
|
+
* 数据表格属性
|
|
25
|
+
*/
|
|
26
|
+
export type RbDataTableProps<DataSource, U, ValueType = 'text'> = {
|
|
27
|
+
/**
|
|
28
|
+
* 行主键,默认:guid
|
|
29
|
+
*/
|
|
30
|
+
rowKey?: string;
|
|
31
|
+
/**
|
|
32
|
+
* 字段配置
|
|
33
|
+
*/
|
|
34
|
+
columns?: ProColumns<DataSource, ValueType>[];
|
|
35
|
+
/**
|
|
36
|
+
* 查询参数配置
|
|
37
|
+
*/
|
|
38
|
+
params?: U;
|
|
39
|
+
/**
|
|
40
|
+
* 远程数据请求
|
|
41
|
+
*
|
|
42
|
+
* @param params 参数
|
|
43
|
+
* @param sort 排序
|
|
44
|
+
* @param filter 过滤
|
|
45
|
+
*/
|
|
46
|
+
request: (params: U & {
|
|
47
|
+
pageSize?: number;
|
|
48
|
+
current?: number;
|
|
49
|
+
keyword?: string;
|
|
50
|
+
}, sort: Record<string, SortOrder>, filter: Record<string, (string | number)[] | null>) => Promise<Partial<RequestData<DataSource>>>;
|
|
51
|
+
/**
|
|
52
|
+
* Table action 的引用,便于自定义触发
|
|
53
|
+
*/
|
|
54
|
+
actionRef?: Ref<RbActionType | undefined>;
|
|
55
|
+
/**
|
|
56
|
+
* 工具栏渲染
|
|
57
|
+
*/
|
|
58
|
+
toolBarRender?: ToolBarProps<DataSource>['toolBarRender'] | false;
|
|
59
|
+
/**
|
|
60
|
+
* 行选中
|
|
61
|
+
*/
|
|
62
|
+
rowSelection?: (TableProps<DataSource>['rowSelection'] & {
|
|
63
|
+
alwaysShowAlert?: boolean;
|
|
64
|
+
}) | false;
|
|
65
|
+
/**
|
|
66
|
+
* 表格警告栏
|
|
67
|
+
*/
|
|
68
|
+
tableAlertOptionRender?: AlertRenderType<DataSource>;
|
|
69
|
+
/**
|
|
70
|
+
* 缓存 Key 后缀,控制同一个 URL 下的两张表不起冲突
|
|
71
|
+
*/
|
|
72
|
+
cacheSuffix?: string;
|
|
73
|
+
/**
|
|
74
|
+
* 滚动条
|
|
75
|
+
*/
|
|
76
|
+
scroll?: RcTableProps<ValueType>['scroll'] & {
|
|
77
|
+
scrollToFirstRowOnChange?: boolean;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* 搜索
|
|
81
|
+
*/
|
|
82
|
+
search?: false | SearchConfig;
|
|
83
|
+
/**
|
|
84
|
+
* 边框
|
|
85
|
+
*/
|
|
86
|
+
bordered?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* 分页
|
|
89
|
+
*/
|
|
90
|
+
pagination?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* 表头
|
|
93
|
+
*/
|
|
94
|
+
headerTitle?: ReactNode;
|
|
95
|
+
/**
|
|
96
|
+
* 数据源
|
|
97
|
+
*/
|
|
98
|
+
dataSource?: RcTableProps<DataSource>['data'];
|
|
99
|
+
/**
|
|
100
|
+
* 粘性布局
|
|
101
|
+
*/
|
|
102
|
+
sticky?: boolean | TableSticky;
|
|
103
|
+
/**
|
|
104
|
+
* 国际化
|
|
105
|
+
*/
|
|
106
|
+
intl: any;
|
|
107
|
+
};
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import RbDataTable from "./components/DataTable/index";
|
|
2
|
+
import { RbDataTableProps, RbActionType } from "./components/DataTable/type";
|
|
3
|
+
import { RbActionBarItem, RbActionBar } from "./components/ActionBar";
|
|
4
|
+
import { RbActionBarItemProps, RbActionBarProps } from "./components/ActionBar/type";
|
|
5
|
+
import RbThemeSetter from "./components/ThemeSetter";
|
|
6
|
+
import RbThemeListener from "./components/ThemeListener";
|
|
7
|
+
import { RbThemeListenerProps } from "./components/ThemeListener/type";
|
|
8
|
+
import DbUtil from "./services/utils/dbUtil";
|
|
9
|
+
import ObjectUtil from "./services/utils/objectUtil";
|
|
10
|
+
import EventUtil from "./services/utils/eventUtil";
|
|
11
|
+
import StorageUtil from "./services/utils/storageUtil";
|
|
12
|
+
import ResourceUtil from "./services/utils/resourceUtil";
|
|
13
|
+
import EventEnum from "./services/enums/eventEnum";
|
|
14
|
+
import StorageEnum from "./services/enums/storageEnum";
|
|
15
|
+
import zhCN from "./locales/zh-CN";
|
|
16
|
+
import enUS from "./locales/en-US";
|
|
17
|
+
export { RbDataTable };
|
|
18
|
+
export type { RbDataTableProps, RbActionType };
|
|
19
|
+
export { RbActionBarItem, RbActionBar };
|
|
20
|
+
export type { RbActionBarItemProps, RbActionBarProps };
|
|
21
|
+
export { RbThemeSetter };
|
|
22
|
+
export { RbThemeListener };
|
|
23
|
+
export type { RbThemeListenerProps };
|
|
24
|
+
export { DbUtil, ObjectUtil, EventUtil, StorageUtil, ResourceUtil };
|
|
25
|
+
export { EventEnum, StorageEnum };
|
|
26
|
+
export { zhCN, enUS };
|
|
27
|
+
declare const _default: {
|
|
28
|
+
RbDataTable: <DataSource, U, ValueType = "text">(props: RbDataTableProps<DataSource, U, ValueType>) => any;
|
|
29
|
+
RbActionBarItem: (props: RbActionBarItemProps) => any;
|
|
30
|
+
RbActionBar: (props: RbActionBarProps) => any;
|
|
31
|
+
RbThemeSetter: (props: any) => any;
|
|
32
|
+
RbThemeListener: (props: RbThemeListenerProps) => any;
|
|
33
|
+
};
|
|
34
|
+
export default _default;
|