@ecoding/components.antd 0.2.15 → 0.2.17
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.
|
@@ -117,6 +117,10 @@ const AsyncSlect = memo((props) => {
|
|
|
117
117
|
});
|
|
118
118
|
timeout = setTimeout(innerEx, 300);
|
|
119
119
|
});
|
|
120
|
+
const changeHandler = (v, ary) => {
|
|
121
|
+
props.onChange(v);
|
|
122
|
+
props.onChangeAry && props.onChangeAry(ary);
|
|
123
|
+
};
|
|
120
124
|
const children = useMemo(() => {
|
|
121
125
|
return (options &&
|
|
122
126
|
options.map((item) => {
|
|
@@ -131,6 +135,6 @@ const AsyncSlect = memo((props) => {
|
|
|
131
135
|
return option.children.join("").toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
132
136
|
}
|
|
133
137
|
return option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
134
|
-
}, allowClear: true, showSearch: true, onSearch: handleSearch, optionFilterProp: "children" }, props), children));
|
|
138
|
+
}, allowClear: true, showSearch: true, onSearch: handleSearch, optionFilterProp: "children" }, props, { onChange: changeHandler }), children));
|
|
135
139
|
});
|
|
136
140
|
export default AsyncSlect;
|
|
@@ -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%');
|
|
@@ -27,7 +27,7 @@ const TablePro = memo(({ className, header, buttonArea, filterArea, loading, row
|
|
|
27
27
|
if (dataSource && dataSource.length > 0) {
|
|
28
28
|
return innerColumns.filter((c) => c.checked !== false).concat(operationColumn || []);
|
|
29
29
|
}
|
|
30
|
-
return
|
|
30
|
+
return operationColumn;
|
|
31
31
|
}, [innerColumns, dataSource]);
|
|
32
32
|
useEffect(() => {
|
|
33
33
|
if (disColumnRef.current && disColumnRef.current.length > 0 && columns.length > 0) {
|
|
@@ -70,10 +70,11 @@ const TablePro = memo(({ className, header, buttonArea, filterArea, loading, row
|
|
|
70
70
|
} },
|
|
71
71
|
React.createElement(Button, { type: "text", icon: React.createElement(MenuOutlined, null) }, columnsTitle))) : null)),
|
|
72
72
|
dataSource ? (React.createElement("div", { style: { height: '100%', overflow: 'hidden' }, ref: ref },
|
|
73
|
-
React.createElement(Table, { bordered:
|
|
73
|
+
React.createElement(Table, { bordered: bordered, rowKey: rowKey, columns: showColumns, dataSource: dataSource, scroll: { y }, loading: loading, pagination: pagination || false }))) : null));
|
|
74
74
|
});
|
|
75
75
|
TablePro.defaultProps = {
|
|
76
76
|
filterTitle: "筛选",
|
|
77
|
-
columnsTitle: "显示列"
|
|
77
|
+
columnsTitle: "显示列",
|
|
78
|
+
bordered: false
|
|
78
79
|
};
|
|
79
80
|
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.17",
|
|
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": "21d4960fc01846b73155a6f41550a2e8274bfa80"
|
|
48
48
|
}
|