@ecoding/components.antd 0.3.22 → 0.3.24
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.
|
@@ -15,7 +15,7 @@ import { LoadingOutlined } from '@ant-design/icons';
|
|
|
15
15
|
import throttle from '../../helpers/throttle';
|
|
16
16
|
import http from '../../helpers/http';
|
|
17
17
|
const C = (_a) => {
|
|
18
|
-
var { transformItems, actionKey, actionParams, value, placeholder, onChange } = _a, rest = __rest(_a, ["transformItems", "actionKey", "actionParams", "value", "placeholder", "onChange"]);
|
|
18
|
+
var { transformItems, actionKey, actionParams, actionOptions, value, placeholder, onChange } = _a, rest = __rest(_a, ["transformItems", "actionKey", "actionParams", "actionOptions", "value", "placeholder", "onChange"]);
|
|
19
19
|
const isCompositionStart = useRef(false);
|
|
20
20
|
const [loading, setLoading] = useState(false);
|
|
21
21
|
const [open, setOpen] = useState(false);
|
|
@@ -30,7 +30,7 @@ const C = (_a) => {
|
|
|
30
30
|
}, [rest.action]);
|
|
31
31
|
const handleSearch = useCallback(throttle((vs) => {
|
|
32
32
|
setLoading(true);
|
|
33
|
-
r.get(action, Object.assign({}, actionParams || {}, { [actionKey]: vs })).then((res) => {
|
|
33
|
+
r.get(action, Object.assign({}, actionParams || {}, { [actionKey]: vs }), actionOptions || {}).then((res) => {
|
|
34
34
|
setLoading(false);
|
|
35
35
|
const temp = transformItems ? transformItems(res) : res;
|
|
36
36
|
if (temp && temp.length > 0) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { FilterValue, SorterResult, TableCurrentDataSource, TablePaginationConfig } from 'antd/lib/table/interface';
|
|
2
3
|
interface IProps {
|
|
3
4
|
className?: string;
|
|
4
5
|
header?: React.ReactNode;
|
|
@@ -13,6 +14,7 @@ interface IProps {
|
|
|
13
14
|
operationColumn?: any[];
|
|
14
15
|
pagination?: any;
|
|
15
16
|
offsetY?: number;
|
|
17
|
+
onChange?: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<any> | SorterResult<any>[], extra: TableCurrentDataSource<any>) => void;
|
|
16
18
|
filterTitle?: string;
|
|
17
19
|
columnsTitle?: string;
|
|
18
20
|
selectType?: "checkbox" | "radio";
|
|
@@ -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, searchInputArea, loading, rowKey, dataSource, pagination, offsetY, columns, operationColumn, bordered, selectChangeHandler, selectType, columnsTitle, filterTitle }) => {
|
|
5
|
+
const TablePro = memo(({ className, header, buttonArea, filterArea, searchInputArea, loading, rowKey, dataSource, pagination, offsetY, columns, operationColumn, bordered, selectChangeHandler, selectType, onChange, columnsTitle, filterTitle }) => {
|
|
6
6
|
const ref = useRef(null);
|
|
7
7
|
const disColumnRef = useRef([]);
|
|
8
8
|
const [y, setY] = useState('100%');
|
|
@@ -85,7 +85,7 @@ const TablePro = memo(({ className, header, buttonArea, filterArea, searchInputA
|
|
|
85
85
|
} },
|
|
86
86
|
React.createElement(Button, { type: "text", icon: React.createElement(MenuOutlined, null) }, columnsTitle))) : null)),
|
|
87
87
|
dataSource ? (React.createElement("div", { style: { height: '100%', overflow: 'hidden' }, ref: ref },
|
|
88
|
-
React.createElement(Table, { rowSelection: selectType ? rowSelection : undefined, bordered: bordered, rowKey: rowKey, columns: showColumns, dataSource: dataSource, scroll: { y }, loading: loading, pagination: pagination || false }))) : null));
|
|
88
|
+
React.createElement(Table, { rowSelection: selectType ? rowSelection : undefined, bordered: bordered, rowKey: rowKey, columns: showColumns, dataSource: dataSource, scroll: { y }, loading: loading, pagination: pagination || false, onChange: onChange || undefined }))) : null));
|
|
89
89
|
});
|
|
90
90
|
TablePro.defaultProps = {
|
|
91
91
|
filterTitle: "筛选",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecoding/components.antd",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.24",
|
|
4
4
|
"author": "cxc",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"antd": "^5.8.4",
|
|
44
44
|
"axios": "^1.1.2"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "12e5f8602bbab65800e9517cd1495db686877fe2"
|
|
47
47
|
}
|