@ecoding/components.antd 0.2.14 → 0.2.16
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.
|
@@ -2,7 +2,7 @@ import React, { memo, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
2
2
|
import { Popover, Button, Typography, Table } from 'antd';
|
|
3
3
|
import { FilterOutlined, MenuOutlined } from '@ant-design/icons';
|
|
4
4
|
import TableProColumns from "./columns";
|
|
5
|
-
const TablePro = memo(({ className, header, buttonArea, filterArea, loading, rowKey, dataSource, pagination, offsetY, columns, operationColumn, columnsTitle, filterTitle }) => {
|
|
5
|
+
const TablePro = memo(({ className, header, buttonArea, filterArea, loading, rowKey, dataSource, pagination, offsetY, columns, operationColumn, bordered, columnsTitle, filterTitle }) => {
|
|
6
6
|
const ref = useRef(null);
|
|
7
7
|
const disColumnRef = useRef([]);
|
|
8
8
|
const [y, setY] = useState('100%');
|
|
@@ -25,7 +25,7 @@ const TablePro = memo(({ className, header, buttonArea, filterArea, loading, row
|
|
|
25
25
|
};
|
|
26
26
|
const showColumns = useMemo(() => {
|
|
27
27
|
return innerColumns.filter((c) => c.checked !== false).concat(operationColumn || []);
|
|
28
|
-
}, [innerColumns]);
|
|
28
|
+
}, [innerColumns, dataSource]);
|
|
29
29
|
useEffect(() => {
|
|
30
30
|
if (disColumnRef.current && disColumnRef.current.length > 0 && columns.length > 0) {
|
|
31
31
|
setColumns(columns.map((c) => {
|
|
@@ -67,10 +67,11 @@ const TablePro = memo(({ className, header, buttonArea, filterArea, loading, row
|
|
|
67
67
|
} },
|
|
68
68
|
React.createElement(Button, { type: "text", icon: React.createElement(MenuOutlined, null) }, columnsTitle))) : null)),
|
|
69
69
|
dataSource ? (React.createElement("div", { style: { height: '100%', overflow: 'hidden' }, ref: ref },
|
|
70
|
-
React.createElement(Table, { bordered:
|
|
70
|
+
React.createElement(Table, { bordered: bordered, rowKey: rowKey, columns: showColumns, dataSource: dataSource, scroll: { y }, loading: loading, pagination: pagination || false }))) : null));
|
|
71
71
|
});
|
|
72
72
|
TablePro.defaultProps = {
|
|
73
73
|
filterTitle: "筛选",
|
|
74
|
-
columnsTitle: "显示列"
|
|
74
|
+
columnsTitle: "显示列",
|
|
75
|
+
bordered: false
|
|
75
76
|
};
|
|
76
77
|
export default TablePro;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecoding/components.antd",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
4
4
|
"author": "cxc",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"react-quill": "^2.0.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "d43fb93777143fd7818502a8cee5b53b9f6ba88d"
|
|
48
48
|
}
|