@hw-component/table 0.0.6-beta-v2 → 0.0.6-beta-v8
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/HTableHeader/index.js +8 -3
- package/lib/HTableHeader/index.js +8 -3
- package/package.json +2 -2
- package/src/components/HTableHeader/index.tsx +8 -2
- package/src/components/ModalTable/hooks.ts +3 -3
- package/src/components/ModalTable/index.tsx +4 -4
- package/src/components/Table.tsx +3 -1
- package/src/pages/ModalTable/index.tsx +17 -12
- package/src/pages/Table/index.tsx +4 -4
- package/src/pages/TableCustomize/index.tsx +1 -1
package/es/HTableHeader/index.js
CHANGED
|
@@ -18,13 +18,18 @@ import { useClassName } from '../hooks/index.js';
|
|
|
18
18
|
|
|
19
19
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
20
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
|
+
var defaultSearchSpan = {
|
|
22
|
+
xxl: 4,
|
|
23
|
+
xl: 6,
|
|
24
|
+
lg: 6,
|
|
25
|
+
md: 8,
|
|
26
|
+
sm: 12
|
|
27
|
+
};
|
|
21
28
|
var Header = (function (_ref) {
|
|
22
29
|
var configData = _ref.configData,
|
|
23
30
|
onFinish = _ref.onFinish,
|
|
24
31
|
_ref$searchSpan = _ref.searchSpan,
|
|
25
|
-
searchSpan = _ref$searchSpan === void 0 ?
|
|
26
|
-
span: 6
|
|
27
|
-
} : _ref$searchSpan,
|
|
32
|
+
searchSpan = _ref$searchSpan === void 0 ? defaultSearchSpan : _ref$searchSpan,
|
|
28
33
|
headerStyle = _ref.headerStyle;
|
|
29
34
|
var _useHTableContext = useHTableContext(),
|
|
30
35
|
tableInstance = _useHTableContext.tableInstance,
|
|
@@ -21,13 +21,18 @@ var index = require('../hooks/index.js');
|
|
|
21
21
|
|
|
22
22
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
23
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
|
+
var defaultSearchSpan = {
|
|
25
|
+
xxl: 4,
|
|
26
|
+
xl: 6,
|
|
27
|
+
lg: 6,
|
|
28
|
+
md: 8,
|
|
29
|
+
sm: 12
|
|
30
|
+
};
|
|
24
31
|
var Header = (function (_ref) {
|
|
25
32
|
var configData = _ref.configData,
|
|
26
33
|
onFinish = _ref.onFinish,
|
|
27
34
|
_ref$searchSpan = _ref.searchSpan,
|
|
28
|
-
searchSpan = _ref$searchSpan === void 0 ?
|
|
29
|
-
span: 6
|
|
30
|
-
} : _ref$searchSpan,
|
|
35
|
+
searchSpan = _ref$searchSpan === void 0 ? defaultSearchSpan : _ref$searchSpan,
|
|
31
36
|
headerStyle = _ref.headerStyle;
|
|
32
37
|
var _useHTableContext = context.useHTableContext(),
|
|
33
38
|
tableInstance = _useHTableContext.tableInstance,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hw-component/table",
|
|
3
|
-
"version": "0.0.6-beta-
|
|
3
|
+
"version": "0.0.6-beta-v8",
|
|
4
4
|
"description": "基于antd二次开发table组件",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"table"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@ant-design/pro-table": "2.70.0",
|
|
33
|
-
"@hw-component/form": "0.0.9-beta-
|
|
33
|
+
"@hw-component/form": "0.0.9-beta-v18",
|
|
34
34
|
"ahooks": "2.10.9",
|
|
35
35
|
"antd": "4.20.7",
|
|
36
36
|
"core-js": "3",
|
|
@@ -15,11 +15,17 @@ interface IHeaderProps {
|
|
|
15
15
|
loading?: boolean;
|
|
16
16
|
headerStyle?: React.CSSProperties;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
const defaultSearchSpan = {
|
|
19
|
+
xxl: 4,
|
|
20
|
+
xl: 6,
|
|
21
|
+
lg: 6,
|
|
22
|
+
md: 8,
|
|
23
|
+
sm: 12,
|
|
24
|
+
};
|
|
19
25
|
export default ({
|
|
20
26
|
configData,
|
|
21
27
|
onFinish,
|
|
22
|
-
searchSpan =
|
|
28
|
+
searchSpan = defaultSearchSpan,
|
|
23
29
|
headerStyle,
|
|
24
30
|
}: IHeaderProps) => {
|
|
25
31
|
const {
|
|
@@ -4,18 +4,18 @@ import type {
|
|
|
4
4
|
HOnDiaLogTableInstance,
|
|
5
5
|
ModalTableProps,
|
|
6
6
|
} from "../modal";
|
|
7
|
-
import {useEffect, useMemo, useState} from "react";
|
|
7
|
+
import { useEffect, useMemo, useState } from "react";
|
|
8
8
|
import type { DialogParamsModal } from "../modal";
|
|
9
9
|
|
|
10
10
|
export const useHDialogTable = () => {
|
|
11
11
|
const tableInstance = useHTable();
|
|
12
|
-
return useMemo(()=>{
|
|
12
|
+
return useMemo(() => {
|
|
13
13
|
return {
|
|
14
14
|
...tableInstance,
|
|
15
15
|
show: (params: DialogParamsModal) => {},
|
|
16
16
|
hide: () => {},
|
|
17
17
|
} as HDiaLogTableInstance;
|
|
18
|
-
},[]);
|
|
18
|
+
}, []);
|
|
19
19
|
};
|
|
20
20
|
interface ParamsModal extends HOnDiaLogTableInstance {
|
|
21
21
|
dialogTable?: HDiaLogTableInstance;
|
|
@@ -9,8 +9,8 @@ export default ({
|
|
|
9
9
|
dialogTable,
|
|
10
10
|
visible = false,
|
|
11
11
|
onCancel,
|
|
12
|
-
bodyStyle={},
|
|
13
|
-
|
|
12
|
+
bodyStyle = {},
|
|
13
|
+
afterClose,
|
|
14
14
|
...props
|
|
15
15
|
}: ModalTableProps) => {
|
|
16
16
|
const { modalVisible, setModalVisible } = useVisible(visible);
|
|
@@ -61,8 +61,8 @@ export default ({
|
|
|
61
61
|
}}
|
|
62
62
|
destroyOnClose
|
|
63
63
|
title={title}
|
|
64
|
-
bodyStyle={{padding:0,paddingBottom:24
|
|
65
|
-
afterClose={()=>{
|
|
64
|
+
bodyStyle={{ padding: 0, paddingBottom: 24, ...bodyStyle }}
|
|
65
|
+
afterClose={() => {
|
|
66
66
|
currentTable.form.resetFields();
|
|
67
67
|
afterClose?.();
|
|
68
68
|
}}
|
package/src/components/Table.tsx
CHANGED
|
@@ -68,7 +68,9 @@ export default ({
|
|
|
68
68
|
<Header searchSpan={searchSpan} headerStyle={headerStyle} />
|
|
69
69
|
)}
|
|
70
70
|
<Body
|
|
71
|
-
tableStyle={
|
|
71
|
+
tableStyle={
|
|
72
|
+
hideHeader ? { paddingTop: 24, ...tableStyle } : tableStyle
|
|
73
|
+
}
|
|
72
74
|
paginationStyle={paginationStyle}
|
|
73
75
|
rowKey={rowKey}
|
|
74
76
|
{...props}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Button } from "antd";
|
|
2
|
-
import {HModalTable, HTable, useHDialogTable} from "../../components";
|
|
2
|
+
import { HModalTable, HTable, useHDialogTable } from "../../components";
|
|
3
3
|
const configData = [
|
|
4
4
|
{
|
|
5
5
|
title: "座位",
|
|
@@ -62,20 +62,26 @@ const req2 = (params) => {
|
|
|
62
62
|
}, 2000);
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
|
-
const Test=()=>{
|
|
65
|
+
const Test = () => {
|
|
66
66
|
const dialogTable1 = useHDialogTable();
|
|
67
67
|
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
return (
|
|
69
|
+
<>
|
|
70
|
+
<HModalTable
|
|
71
|
+
dialogTable={dialogTable1}
|
|
72
|
+
title="111"
|
|
73
|
+
configData={configData}
|
|
74
|
+
/>
|
|
75
|
+
<Button
|
|
71
76
|
onClick={() => {
|
|
72
77
|
dialogTable1.show();
|
|
73
78
|
}}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
>
|
|
80
|
+
点我
|
|
81
|
+
</Button>
|
|
82
|
+
</>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
79
85
|
export default () => {
|
|
80
86
|
const dialogTable = useHDialogTable();
|
|
81
87
|
const dialogTable1 = useHDialogTable();
|
|
@@ -89,8 +95,7 @@ export default () => {
|
|
|
89
95
|
点我333
|
|
90
96
|
</Button>
|
|
91
97
|
<HModalTable dialogTable={dialogTable} configData={configData} />
|
|
92
|
-
|
|
93
|
-
headerTitle={<Test/>}/>
|
|
98
|
+
<HTable configData={[]} headerTitle={<Test />} />
|
|
94
99
|
</>
|
|
95
100
|
);
|
|
96
101
|
};
|
|
@@ -37,11 +37,11 @@ export default () => {
|
|
|
37
37
|
rowKey={"id"}
|
|
38
38
|
table={hTable}
|
|
39
39
|
rowSelection={{
|
|
40
|
-
getCheckboxProps:(item)=>{
|
|
40
|
+
getCheckboxProps: (item) => {
|
|
41
41
|
return {
|
|
42
|
-
disabled:item.id===2
|
|
43
|
-
}
|
|
44
|
-
}
|
|
42
|
+
disabled: item.id === 2,
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
45
|
}}
|
|
46
46
|
affixProps={{
|
|
47
47
|
target: () => document.querySelector(".body"),
|