@regenbio/regenbio-components-react 1.0.4 → 1.0.6

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,2 @@
1
+ declare const Catalpa: () => any;
2
+ export default Catalpa;
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ PARAMS_RECORD_TABLE: string;
3
+ };
4
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { RbDataTableProps } from "./type";
2
+ /**
3
+ * RB 数据表格
4
+ * @param props 参数配置
5
+ * @constructor
6
+ */
7
+ declare const RbDataTable: <DataSource, U, ValueType = "text">(props: RbDataTableProps<DataSource, U, ValueType>) => any;
8
+ export default RbDataTable;
@@ -0,0 +1,103 @@
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
+ };
@@ -0,0 +1,18 @@
1
+ import RbDataTable from "@/components/data-table/index";
2
+ import { RbActionType, RbDataTableProps } from "@/components/data-table/type";
3
+ import DbUtil from "@/services/utils/DbUtil";
4
+ import ObjectUtil from "@/services/utils/ObjectUtil";
5
+ import Test from "./Test";
6
+ export * from "@/components/data-table";
7
+ /**
8
+ * 组件
9
+ */
10
+ export { RbDataTable, Test };
11
+ /**
12
+ * 类型
13
+ */
14
+ export type { RbActionType, RbDataTableProps };
15
+ /**
16
+ * 工具方法
17
+ */
18
+ export { DbUtil, ObjectUtil };