@hw-component/table 0.0.2-beta-v3 → 0.0.2-beta-v5
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/es/Body/index.d.ts +1 -1
- package/es/Body/index.js +2 -2
- package/lib/Body/index.d.ts +1 -1
- package/lib/Body/index.js +2 -2
- package/package.json +1 -1
- package/src/components/Body/index.tsx +3 -3
- package/src/pages/Test/index.tsx +44 -33
package/es/Body/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import React from "react";
|
|
|
4
4
|
import type { HTableInstance } from "../modal";
|
|
5
5
|
interface HTableBodyProps extends Omit<ProTableProps<any, any>, "dataSource"> {
|
|
6
6
|
configData: ConfigDataModal;
|
|
7
|
-
onPageChange
|
|
7
|
+
onPageChange?: (params: ParamsModal) => void;
|
|
8
8
|
emptyRender?: (tableInstance: HTableInstance) => React.ReactNode;
|
|
9
9
|
errorRender?: (tableInstance: HTableInstance, error: Error) => React.ReactNode;
|
|
10
10
|
tableStyle?: React.CSSProperties;
|
package/es/Body/index.js
CHANGED
|
@@ -100,12 +100,12 @@ var Body = (function (_ref) {
|
|
|
100
100
|
onChange: function onChange(paginationData) {
|
|
101
101
|
var ps = paginationData.pageSize,
|
|
102
102
|
pn = paginationData.current;
|
|
103
|
-
onPageChange({
|
|
103
|
+
onPageChange === null || onPageChange === void 0 || onPageChange({
|
|
104
104
|
size: ps,
|
|
105
105
|
current: pn
|
|
106
106
|
});
|
|
107
107
|
},
|
|
108
|
-
pagination: _objectSpread({
|
|
108
|
+
pagination: pagination === false ? pagination : _objectSpread({
|
|
109
109
|
current: _Number$parseInt(current || "1", 10),
|
|
110
110
|
total: _Number$parseInt(total || "0", 10),
|
|
111
111
|
pageSize: _Number$parseInt(size || "10", 10),
|
package/lib/Body/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import React from "react";
|
|
|
4
4
|
import type { HTableInstance } from "../modal";
|
|
5
5
|
interface HTableBodyProps extends Omit<ProTableProps<any, any>, "dataSource"> {
|
|
6
6
|
configData: ConfigDataModal;
|
|
7
|
-
onPageChange
|
|
7
|
+
onPageChange?: (params: ParamsModal) => void;
|
|
8
8
|
emptyRender?: (tableInstance: HTableInstance) => React.ReactNode;
|
|
9
9
|
errorRender?: (tableInstance: HTableInstance, error: Error) => React.ReactNode;
|
|
10
10
|
tableStyle?: React.CSSProperties;
|
package/lib/Body/index.js
CHANGED
|
@@ -103,12 +103,12 @@ var Body = (function (_ref) {
|
|
|
103
103
|
onChange: function onChange(paginationData) {
|
|
104
104
|
var ps = paginationData.pageSize,
|
|
105
105
|
pn = paginationData.current;
|
|
106
|
-
onPageChange({
|
|
106
|
+
onPageChange === null || onPageChange === void 0 || onPageChange({
|
|
107
107
|
size: ps,
|
|
108
108
|
current: pn
|
|
109
109
|
});
|
|
110
110
|
},
|
|
111
|
-
pagination: _objectSpread({
|
|
111
|
+
pagination: pagination === false ? pagination : _objectSpread({
|
|
112
112
|
current: _Number$parseInt(current || "1", 10),
|
|
113
113
|
total: _Number$parseInt(total || "0", 10),
|
|
114
114
|
pageSize: _Number$parseInt(size || "10", 10),
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ import { useHTableConfigContext } from "../TableConfig";
|
|
|
10
10
|
|
|
11
11
|
interface HTableBodyProps extends Omit<ProTableProps<any, any>, "dataSource"> {
|
|
12
12
|
configData: ConfigDataModal;
|
|
13
|
-
onPageChange
|
|
13
|
+
onPageChange?: (params: ParamsModal) => void;
|
|
14
14
|
emptyRender?: (tableInstance: HTableInstance) => React.ReactNode;
|
|
15
15
|
errorRender?: (
|
|
16
16
|
tableInstance: HTableInstance,
|
|
@@ -78,9 +78,9 @@ export default ({
|
|
|
78
78
|
dataSource={records}
|
|
79
79
|
onChange={(paginationData) => {
|
|
80
80
|
const { pageSize: ps, current: pn } = paginationData;
|
|
81
|
-
onPageChange({ size: ps, current: pn });
|
|
81
|
+
onPageChange?.({ size: ps, current: pn });
|
|
82
82
|
}}
|
|
83
|
-
pagination={{
|
|
83
|
+
pagination={pagination===false?pagination:{
|
|
84
84
|
current: Number.parseInt(current || "1", 10),
|
|
85
85
|
total: Number.parseInt(total || "0", 10),
|
|
86
86
|
pageSize: Number.parseInt(size || "10", 10),
|
package/src/pages/Test/index.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { HTable,
|
|
1
|
+
import { HTable, useHTable } from "../../components";
|
|
2
2
|
import { Button } from "antd";
|
|
3
|
+
import Body from "../../components/Body";
|
|
4
|
+
import {HTableContext} from "../../components/context";
|
|
3
5
|
const configData = [
|
|
4
6
|
{
|
|
5
7
|
title: "座位",
|
|
@@ -25,38 +27,47 @@ export default () => {
|
|
|
25
27
|
>
|
|
26
28
|
点我
|
|
27
29
|
</div>
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
30
|
+
<HTableContext.Provider value={{
|
|
31
|
+
tableInstance:hTable,
|
|
32
|
+
selectedRowData:{},
|
|
33
|
+
rowOnChange:()=>{},
|
|
34
|
+
error:new Error("错误")
|
|
35
|
+
}}>
|
|
36
|
+
<Body configData={[{title:"sss"}]} onPageChange={()=>{}}/>
|
|
37
|
+
</HTableContext.Provider>
|
|
38
|
+
{/*<HTable*/}
|
|
39
|
+
{/* configData={configData}*/}
|
|
40
|
+
{/* rowKey={"id"}*/}
|
|
41
|
+
{/* headerStyle={{ borderRadius: 0 }}*/}
|
|
42
|
+
{/* tableStyle={{ borderRadius: 0, background: "#fff" }}*/}
|
|
43
|
+
{/* spaceSize={0}*/}
|
|
44
|
+
{/* pagination={false}*/}
|
|
45
|
+
{/* footerStyle={{ marginTop: 20 }}*/}
|
|
46
|
+
{/* table={hTable}*/}
|
|
47
|
+
{/* actionRender={(allCheck, selectedRowKeys, xjTable) => {*/}
|
|
48
|
+
{/* console.log(allCheck, selectedRowKeys, xjTable);*/}
|
|
49
|
+
{/* return <Button>点我</Button>;*/}
|
|
50
|
+
{/* }}*/}
|
|
51
|
+
{/* request={(a) => {*/}
|
|
52
|
+
{/* console.log(a);*/}
|
|
53
|
+
{/* return new Promise((resolve, reject) => {*/}
|
|
54
|
+
{/* setTimeout(() => {*/}
|
|
55
|
+
{/* // reject(new Error("错误"));*/}
|
|
56
|
+
{/* resolve({*/}
|
|
57
|
+
{/* size: "10",*/}
|
|
58
|
+
{/* current: "1",*/}
|
|
59
|
+
{/* total: "100",*/}
|
|
60
|
+
{/* records: [*/}
|
|
61
|
+
{/* {*/}
|
|
62
|
+
{/* id: 1,*/}
|
|
63
|
+
{/* name: "111",*/}
|
|
64
|
+
{/* },*/}
|
|
65
|
+
{/* ],*/}
|
|
66
|
+
{/* });*/}
|
|
67
|
+
{/* }, 2000);*/}
|
|
68
|
+
{/* });*/}
|
|
69
|
+
{/* }}*/}
|
|
70
|
+
{/*/>*/}
|
|
60
71
|
</>
|
|
61
72
|
);
|
|
62
73
|
};
|