@hw-component/table 0.0.1-beta-v8 → 0.0.2-beta-v1
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/hooks.d.ts +2542 -1046
- package/es/Body/hooks.js +90 -35
- package/es/Body/index.d.ts +20 -5
- package/es/Body/index.js +135 -61
- package/es/Footer/index.d.ts +12 -3
- package/es/Footer/index.js +105 -41
- package/es/Header/index.d.ts +13 -5
- package/es/Header/index.js +78 -21
- package/es/Header/utils.d.ts +5 -3
- package/es/Header/utils.js +21 -14
- package/es/Table.d.ts +16 -1
- package/es/Table.js +130 -51
- package/es/TableConfig.d.ts +10 -5
- package/es/TableConfig.js +6 -6
- package/es/context.d.ts +5 -5
- package/es/context.js +2 -2
- package/es/hooks/useCurrentTable.d.ts +10 -5
- package/es/hooks/useCurrentTable.js +14 -11
- package/es/hooks/useHTable.d.ts +6 -6
- package/es/hooks/useHTable.js +6 -6
- package/es/hooks/useRowObj.d.ts +2 -2
- package/es/hooks/useRowObj.js +6 -6
- package/es/index.js +3 -3
- package/es/modal.d.ts +54 -30
- package/lib/Body/hooks.d.ts +2542 -1046
- package/lib/Body/hooks.js +91 -36
- package/lib/Body/index.d.ts +20 -5
- package/lib/Body/index.js +137 -63
- package/lib/Footer/index.d.ts +12 -3
- package/lib/Footer/index.js +107 -43
- package/lib/Header/index.d.ts +13 -5
- package/lib/Header/index.js +80 -23
- package/lib/Header/utils.d.ts +5 -3
- package/lib/Header/utils.js +22 -15
- package/lib/Table.d.ts +16 -1
- package/lib/Table.js +132 -53
- package/lib/TableConfig.d.ts +10 -5
- package/lib/TableConfig.js +8 -8
- package/lib/context.d.ts +5 -5
- package/lib/context.js +3 -3
- package/lib/hooks/useCurrentTable.d.ts +10 -5
- package/lib/hooks/useCurrentTable.js +16 -13
- package/lib/hooks/useHTable.d.ts +6 -6
- package/lib/hooks/useHTable.js +8 -8
- package/lib/hooks/useRowObj.d.ts +2 -2
- package/lib/hooks/useRowObj.js +8 -8
- package/lib/index.js +4 -6
- package/lib/modal.d.ts +54 -30
- package/package.json +1 -1
- package/src/components/Body/index.tsx +3 -1
- package/src/components/Footer/index.tsx +3 -2
- package/src/components/Header/index.tsx +4 -2
- package/src/components/Table.tsx +18 -2
- package/src/components/modal.ts +5 -0
- package/src/pages/Test/index.tsx +4 -0
package/es/Body/hooks.js
CHANGED
|
@@ -1,34 +1,77 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _Object$keys from
|
|
3
|
-
import _Object$getOwnPropertySymbols from
|
|
4
|
-
import _Object$getOwnPropertyDescriptor from
|
|
5
|
-
import _forEachInstanceProperty from
|
|
6
|
-
import _Object$getOwnPropertyDescriptors from
|
|
7
|
-
import _Object$defineProperties from
|
|
8
|
-
import _Object$defineProperty from
|
|
9
|
-
import _defineProperty from
|
|
10
|
-
import _mapInstanceProperty from
|
|
11
|
-
import _filterInstanceProperty from
|
|
12
|
-
import _indexOfInstanceProperty from
|
|
13
|
-
import { useMemo, useEffect } from
|
|
14
|
-
import { useHTableContext } from
|
|
2
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js/object/keys";
|
|
3
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js/object/get-own-property-symbols";
|
|
4
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js/object/get-own-property-descriptor";
|
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js/instance/for-each";
|
|
6
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js/object/get-own-property-descriptors";
|
|
7
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js/object/define-properties";
|
|
8
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js/object/define-property";
|
|
9
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
10
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
11
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js/instance/filter";
|
|
12
|
+
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js/instance/index-of";
|
|
13
|
+
import { useMemo, useEffect } from "react";
|
|
14
|
+
import { useHTableContext } from "../context.js";
|
|
15
15
|
|
|
16
|
-
function ownKeys(e, r) {
|
|
17
|
-
|
|
16
|
+
function ownKeys(e, r) {
|
|
17
|
+
var t = _Object$keys(e);
|
|
18
|
+
if (_Object$getOwnPropertySymbols) {
|
|
19
|
+
var o = _Object$getOwnPropertySymbols(e);
|
|
20
|
+
r &&
|
|
21
|
+
(o = _filterInstanceProperty(o).call(o, function (r) {
|
|
22
|
+
return _Object$getOwnPropertyDescriptor(e, r).enumerable;
|
|
23
|
+
})),
|
|
24
|
+
t.push.apply(t, o);
|
|
25
|
+
}
|
|
26
|
+
return t;
|
|
27
|
+
}
|
|
28
|
+
function _objectSpread(e) {
|
|
29
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
30
|
+
var _context, _context2;
|
|
31
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
32
|
+
r % 2
|
|
33
|
+
? _forEachInstanceProperty((_context = ownKeys(Object(t), !0))).call(
|
|
34
|
+
_context,
|
|
35
|
+
function (r) {
|
|
36
|
+
_defineProperty(e, r, t[r]);
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
: _Object$getOwnPropertyDescriptors
|
|
40
|
+
? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t))
|
|
41
|
+
: _forEachInstanceProperty((_context2 = ownKeys(Object(t)))).call(
|
|
42
|
+
_context2,
|
|
43
|
+
function (r) {
|
|
44
|
+
_Object$defineProperty(
|
|
45
|
+
e,
|
|
46
|
+
r,
|
|
47
|
+
_Object$getOwnPropertyDescriptor(t, r)
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
return e;
|
|
53
|
+
}
|
|
18
54
|
var useCols = function useCols(cols, table) {
|
|
19
|
-
return useMemo(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
55
|
+
return useMemo(
|
|
56
|
+
function () {
|
|
57
|
+
return _mapInstanceProperty(cols).call(cols, function (item) {
|
|
58
|
+
var _render = item.render;
|
|
59
|
+
return _objectSpread(
|
|
60
|
+
_objectSpread({}, item),
|
|
61
|
+
{},
|
|
62
|
+
{
|
|
63
|
+
render: function render(dom, data, index) {
|
|
64
|
+
if (!_render) {
|
|
65
|
+
return dom;
|
|
66
|
+
}
|
|
67
|
+
return _render(dom, data, index, table);
|
|
68
|
+
},
|
|
26
69
|
}
|
|
27
|
-
|
|
28
|
-
}
|
|
70
|
+
);
|
|
29
71
|
});
|
|
30
|
-
}
|
|
31
|
-
|
|
72
|
+
},
|
|
73
|
+
[cols, table]
|
|
74
|
+
);
|
|
32
75
|
};
|
|
33
76
|
var useSynchronousKeys = function useSynchronousKeys(_ref) {
|
|
34
77
|
var selectedRowKeys = _ref.selectedRowKeys,
|
|
@@ -36,15 +79,27 @@ var useSynchronousKeys = function useSynchronousKeys(_ref) {
|
|
|
36
79
|
rowKey = _ref.rowKey;
|
|
37
80
|
var _useHTableContext = useHTableContext(),
|
|
38
81
|
rowOnChange = _useHTableContext.rowOnChange;
|
|
39
|
-
useEffect(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
82
|
+
useEffect(
|
|
83
|
+
function () {
|
|
84
|
+
if (selectedRowKeys && records && rowKey) {
|
|
85
|
+
var resultData = _filterInstanceProperty(records).call(
|
|
86
|
+
records,
|
|
87
|
+
function (item, index) {
|
|
88
|
+
var id =
|
|
89
|
+
typeof rowKey === "function" ? rowKey(item, index) : item[rowKey];
|
|
90
|
+
return (
|
|
91
|
+
_indexOfInstanceProperty(selectedRowKeys).call(
|
|
92
|
+
selectedRowKeys,
|
|
93
|
+
id
|
|
94
|
+
) !== -1
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
rowOnChange(selectedRowKeys, resultData);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
[selectedRowKeys, records, rowKey]
|
|
102
|
+
);
|
|
48
103
|
};
|
|
49
104
|
|
|
50
105
|
export { useCols, useSynchronousKeys };
|
package/es/Body/index.d.ts
CHANGED
|
@@ -3,10 +3,25 @@ import type { ConfigDataModal, ParamsModal } from "../modal";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import type { HTableInstance } from "../modal";
|
|
5
5
|
interface HTableBodyProps extends Omit<ProTableProps<any, any>, "dataSource"> {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
configData: ConfigDataModal;
|
|
7
|
+
onPageChange: (params: ParamsModal) => void;
|
|
8
|
+
emptyRender?: (tableInstance: HTableInstance) => React.ReactNode;
|
|
9
|
+
errorRender?: (
|
|
10
|
+
tableInstance: HTableInstance,
|
|
11
|
+
error: Error
|
|
12
|
+
) => React.ReactNode;
|
|
13
|
+
tableStyle?: React.CSSProperties;
|
|
10
14
|
}
|
|
11
|
-
declare const _default: ({
|
|
15
|
+
declare const _default: ({
|
|
16
|
+
loading,
|
|
17
|
+
configData,
|
|
18
|
+
pagination,
|
|
19
|
+
onPageChange,
|
|
20
|
+
rowSelection,
|
|
21
|
+
rowKey,
|
|
22
|
+
emptyRender,
|
|
23
|
+
errorRender,
|
|
24
|
+
tableStyle,
|
|
25
|
+
...props
|
|
26
|
+
}: HTableBodyProps) => JSX.Element;
|
|
12
27
|
export default _default;
|
package/es/Body/index.js
CHANGED
|
@@ -1,32 +1,78 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _Object$keys from
|
|
3
|
-
import _Object$getOwnPropertySymbols from
|
|
4
|
-
import _filterInstanceProperty from
|
|
5
|
-
import _Object$getOwnPropertyDescriptor from
|
|
6
|
-
import _forEachInstanceProperty from
|
|
7
|
-
import _Object$getOwnPropertyDescriptors from
|
|
8
|
-
import _Object$defineProperties from
|
|
9
|
-
import _Object$defineProperty from
|
|
10
|
-
import _defineProperty from
|
|
11
|
-
import _objectWithoutProperties from
|
|
12
|
-
import _keysInstanceProperty from
|
|
13
|
-
import _Number$parseInt from
|
|
14
|
-
import { jsx } from
|
|
15
|
-
import ProTable from
|
|
16
|
-
import { useCols, useSynchronousKeys } from
|
|
17
|
-
import { useHTableContext } from
|
|
18
|
-
import { ConfigProvider, Empty } from
|
|
19
|
-
import { useHTableConfigContext } from
|
|
2
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js/object/keys";
|
|
3
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js/object/get-own-property-symbols";
|
|
4
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js/instance/filter";
|
|
5
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js/object/get-own-property-descriptor";
|
|
6
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js/instance/for-each";
|
|
7
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js/object/get-own-property-descriptors";
|
|
8
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js/object/define-properties";
|
|
9
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js/object/define-property";
|
|
10
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
11
|
+
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
|
|
12
|
+
import _keysInstanceProperty from "@babel/runtime-corejs3/core-js/instance/keys";
|
|
13
|
+
import _Number$parseInt from "@babel/runtime-corejs3/core-js/number/parse-int";
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
import ProTable from "@ant-design/pro-table";
|
|
16
|
+
import { useCols, useSynchronousKeys } from "./hooks.js";
|
|
17
|
+
import { useHTableContext } from "../context.js";
|
|
18
|
+
import { ConfigProvider, Empty } from "antd";
|
|
19
|
+
import { useHTableConfigContext } from "../TableConfig.js";
|
|
20
20
|
|
|
21
|
-
var _excluded = [
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
var _excluded = [
|
|
22
|
+
"loading",
|
|
23
|
+
"configData",
|
|
24
|
+
"pagination",
|
|
25
|
+
"onPageChange",
|
|
26
|
+
"rowSelection",
|
|
27
|
+
"rowKey",
|
|
28
|
+
"emptyRender",
|
|
29
|
+
"errorRender",
|
|
30
|
+
"tableStyle",
|
|
31
|
+
];
|
|
32
|
+
function ownKeys(e, r) {
|
|
33
|
+
var t = _Object$keys(e);
|
|
34
|
+
if (_Object$getOwnPropertySymbols) {
|
|
35
|
+
var o = _Object$getOwnPropertySymbols(e);
|
|
36
|
+
r &&
|
|
37
|
+
(o = _filterInstanceProperty(o).call(o, function (r) {
|
|
38
|
+
return _Object$getOwnPropertyDescriptor(e, r).enumerable;
|
|
39
|
+
})),
|
|
40
|
+
t.push.apply(t, o);
|
|
41
|
+
}
|
|
42
|
+
return t;
|
|
43
|
+
}
|
|
44
|
+
function _objectSpread(e) {
|
|
45
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
46
|
+
var _context, _context2;
|
|
47
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
48
|
+
r % 2
|
|
49
|
+
? _forEachInstanceProperty((_context = ownKeys(Object(t), !0))).call(
|
|
50
|
+
_context,
|
|
51
|
+
function (r) {
|
|
52
|
+
_defineProperty(e, r, t[r]);
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
: _Object$getOwnPropertyDescriptors
|
|
56
|
+
? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t))
|
|
57
|
+
: _forEachInstanceProperty((_context2 = ownKeys(Object(t)))).call(
|
|
58
|
+
_context2,
|
|
59
|
+
function (r) {
|
|
60
|
+
_Object$defineProperty(
|
|
61
|
+
e,
|
|
62
|
+
r,
|
|
63
|
+
_Object$getOwnPropertyDescriptor(t, r)
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
return e;
|
|
69
|
+
}
|
|
24
70
|
var defaultRender = function defaultRender() {
|
|
25
71
|
return jsx(Empty, {
|
|
26
|
-
image: Empty.PRESENTED_IMAGE_SIMPLE
|
|
72
|
+
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
27
73
|
});
|
|
28
74
|
};
|
|
29
|
-
var Body =
|
|
75
|
+
var Body = function (_ref) {
|
|
30
76
|
var loading = _ref.loading,
|
|
31
77
|
configData = _ref.configData,
|
|
32
78
|
_ref$pagination = _ref.pagination,
|
|
@@ -38,6 +84,7 @@ var Body = (function (_ref) {
|
|
|
38
84
|
rowKey = _ref$rowKey === void 0 ? "id" : _ref$rowKey,
|
|
39
85
|
emptyRender = _ref.emptyRender,
|
|
40
86
|
errorRender = _ref.errorRender,
|
|
87
|
+
tableStyle = _ref.tableStyle,
|
|
41
88
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
42
89
|
var selectedRowKeys = rowSelection.selectedRowKeys,
|
|
43
90
|
onChange = rowSelection.onChange;
|
|
@@ -49,12 +96,18 @@ var Body = (function (_ref) {
|
|
|
49
96
|
error = _useHTableContext.error;
|
|
50
97
|
var _useHTableConfigConte = useHTableConfigContext({
|
|
51
98
|
emptyRender: emptyRender,
|
|
52
|
-
errorRender: errorRender
|
|
99
|
+
errorRender: errorRender,
|
|
53
100
|
}),
|
|
54
101
|
_useHTableConfigConte2 = _useHTableConfigConte.emptyRender,
|
|
55
|
-
tableEmptyRender =
|
|
102
|
+
tableEmptyRender =
|
|
103
|
+
_useHTableConfigConte2 === void 0
|
|
104
|
+
? defaultRender
|
|
105
|
+
: _useHTableConfigConte2,
|
|
56
106
|
_useHTableConfigConte3 = _useHTableConfigConte.errorRender,
|
|
57
|
-
tableErrorRender =
|
|
107
|
+
tableErrorRender =
|
|
108
|
+
_useHTableConfigConte3 === void 0
|
|
109
|
+
? defaultRender
|
|
110
|
+
: _useHTableConfigConte3;
|
|
58
111
|
var _ref2 = data || {},
|
|
59
112
|
records = _ref2.records,
|
|
60
113
|
size = _ref2.size,
|
|
@@ -70,49 +123,70 @@ var Body = (function (_ref) {
|
|
|
70
123
|
useSynchronousKeys({
|
|
71
124
|
selectedRowKeys: selectedRowKeys,
|
|
72
125
|
records: records,
|
|
73
|
-
rowKey: rowKey
|
|
126
|
+
rowKey: rowKey,
|
|
74
127
|
});
|
|
75
128
|
return jsx("div", {
|
|
76
|
-
style:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
129
|
+
style: _objectSpread(
|
|
130
|
+
{
|
|
131
|
+
borderRadius: 4,
|
|
132
|
+
overflow: "hidden",
|
|
133
|
+
},
|
|
134
|
+
tableStyle
|
|
135
|
+
),
|
|
80
136
|
children: jsx(ConfigProvider, {
|
|
81
137
|
renderEmpty: function renderEmpty() {
|
|
82
138
|
if (error) {
|
|
83
|
-
return tableErrorRender === null || tableErrorRender === void 0
|
|
139
|
+
return tableErrorRender === null || tableErrorRender === void 0
|
|
140
|
+
? void 0
|
|
141
|
+
: tableErrorRender(tableInstance, error);
|
|
84
142
|
}
|
|
85
|
-
return tableEmptyRender === null || tableEmptyRender === void 0
|
|
143
|
+
return tableEmptyRender === null || tableEmptyRender === void 0
|
|
144
|
+
? void 0
|
|
145
|
+
: tableEmptyRender(tableInstance);
|
|
86
146
|
},
|
|
87
|
-
children: jsx(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
147
|
+
children: jsx(
|
|
148
|
+
ProTable,
|
|
149
|
+
_objectSpread(
|
|
150
|
+
_objectSpread({}, props),
|
|
151
|
+
{},
|
|
152
|
+
{
|
|
153
|
+
columns: cols,
|
|
154
|
+
tableAlertRender: false,
|
|
155
|
+
search: false,
|
|
156
|
+
rowSelection: _objectSpread(
|
|
157
|
+
_objectSpread({}, rowSelection),
|
|
158
|
+
{},
|
|
159
|
+
{
|
|
160
|
+
selectedRowKeys: _keysInstanceProperty(selectedRowData),
|
|
161
|
+
onChange: change,
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
loading: loading,
|
|
165
|
+
rowKey: rowKey,
|
|
166
|
+
dataSource: records,
|
|
167
|
+
onChange: function onChange(paginationData) {
|
|
168
|
+
var ps = paginationData.pageSize,
|
|
169
|
+
pn = paginationData.current;
|
|
170
|
+
onPageChange({
|
|
171
|
+
size: ps,
|
|
172
|
+
current: pn,
|
|
173
|
+
});
|
|
174
|
+
},
|
|
175
|
+
pagination: _objectSpread(
|
|
176
|
+
{
|
|
177
|
+
current: _Number$parseInt(current || "1", 10),
|
|
178
|
+
total: _Number$parseInt(total || "0", 10),
|
|
179
|
+
pageSize: _Number$parseInt(size || "10", 10),
|
|
180
|
+
showQuickJumper: true,
|
|
181
|
+
},
|
|
182
|
+
pagination
|
|
183
|
+
),
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
),
|
|
187
|
+
}),
|
|
114
188
|
});
|
|
115
|
-
}
|
|
189
|
+
};
|
|
116
190
|
|
|
117
191
|
export { Body as default };
|
|
118
192
|
// powered by hdj
|
package/es/Footer/index.d.ts
CHANGED
|
@@ -2,8 +2,17 @@ import type { ActionRenderFn } from "../modal";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import type { HTableInstance, ResultModal, RowObj } from "../modal";
|
|
4
4
|
interface IFooterProps {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
actionRender?: ActionRenderFn;
|
|
6
|
+
footerRender?: (
|
|
7
|
+
tableInstance: HTableInstance,
|
|
8
|
+
selectedRowData: RowObj,
|
|
9
|
+
data?: ResultModal
|
|
10
|
+
) => React.ReactNode;
|
|
11
|
+
footerStyle?: React.CSSProperties;
|
|
7
12
|
}
|
|
8
|
-
declare const _default: ({
|
|
13
|
+
declare const _default: ({
|
|
14
|
+
actionRender,
|
|
15
|
+
footerRender,
|
|
16
|
+
footerStyle,
|
|
17
|
+
}: IFooterProps) => JSX.Element;
|
|
9
18
|
export default _default;
|
package/es/Footer/index.js
CHANGED
|
@@ -1,22 +1,70 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import _Number$
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
2
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
3
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
4
|
+
import _Number$parseInt from "@babel/runtime-corejs3/core-js/number/parse-int";
|
|
5
|
+
import _Number$isNaN from "@babel/runtime-corejs3/core-js/number/is-nan";
|
|
6
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js/object/keys";
|
|
7
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js/object/get-own-property-symbols";
|
|
8
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js/instance/filter";
|
|
9
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js/object/get-own-property-descriptor";
|
|
10
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js/instance/for-each";
|
|
11
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js/object/get-own-property-descriptors";
|
|
12
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js/object/define-properties";
|
|
13
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js/object/define-property";
|
|
14
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { Typography, Card, Row, Space, Button, Affix } from "antd";
|
|
16
|
+
import { useHTableContext } from "../context.js";
|
|
17
|
+
import { useState } from "react";
|
|
9
18
|
|
|
19
|
+
function ownKeys(e, r) {
|
|
20
|
+
var t = _Object$keys(e);
|
|
21
|
+
if (_Object$getOwnPropertySymbols) {
|
|
22
|
+
var o = _Object$getOwnPropertySymbols(e);
|
|
23
|
+
r &&
|
|
24
|
+
(o = _filterInstanceProperty(o).call(o, function (r) {
|
|
25
|
+
return _Object$getOwnPropertyDescriptor(e, r).enumerable;
|
|
26
|
+
})),
|
|
27
|
+
t.push.apply(t, o);
|
|
28
|
+
}
|
|
29
|
+
return t;
|
|
30
|
+
}
|
|
31
|
+
function _objectSpread(e) {
|
|
32
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
33
|
+
var _context, _context2;
|
|
34
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
35
|
+
r % 2
|
|
36
|
+
? _forEachInstanceProperty((_context = ownKeys(Object(t), !0))).call(
|
|
37
|
+
_context,
|
|
38
|
+
function (r) {
|
|
39
|
+
_defineProperty(e, r, t[r]);
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
: _Object$getOwnPropertyDescriptors
|
|
43
|
+
? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t))
|
|
44
|
+
: _forEachInstanceProperty((_context2 = ownKeys(Object(t)))).call(
|
|
45
|
+
_context2,
|
|
46
|
+
function (r) {
|
|
47
|
+
_Object$defineProperty(
|
|
48
|
+
e,
|
|
49
|
+
r,
|
|
50
|
+
_Object$getOwnPropertyDescriptor(t, r)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return e;
|
|
56
|
+
}
|
|
10
57
|
var Text = Typography.Text,
|
|
11
58
|
Link = Typography.Link;
|
|
12
|
-
var Footer =
|
|
59
|
+
var Footer = function (_ref) {
|
|
13
60
|
var actionRender = _ref.actionRender,
|
|
14
|
-
footerRender = _ref.footerRender
|
|
61
|
+
footerRender = _ref.footerRender,
|
|
62
|
+
footerStyle = _ref.footerStyle;
|
|
15
63
|
var _useHTableContext = useHTableContext(),
|
|
16
64
|
data = _useHTableContext.data,
|
|
17
65
|
selectedRowData = _useHTableContext.selectedRowData,
|
|
18
66
|
tableInstance = _useHTableContext.tableInstance;
|
|
19
|
-
|
|
67
|
+
_useHTableContext.error;
|
|
20
68
|
var _useState = useState(false),
|
|
21
69
|
_useState2 = _slicedToArray(_useState, 2),
|
|
22
70
|
allCheck = _useState2[0],
|
|
@@ -29,50 +77,66 @@ var Footer = (function (_ref) {
|
|
|
29
77
|
var num = allCheck ? showTotalNum : 0;
|
|
30
78
|
if (footerRender) {
|
|
31
79
|
return jsx(Fragment, {
|
|
32
|
-
children: footerRender(tableInstance, selectedRowData, data)
|
|
80
|
+
children: footerRender(tableInstance, selectedRowData, data),
|
|
33
81
|
});
|
|
34
82
|
}
|
|
35
83
|
var dom = jsx(Card, {
|
|
36
|
-
style:
|
|
37
|
-
|
|
38
|
-
|
|
84
|
+
style: _objectSpread(
|
|
85
|
+
{
|
|
86
|
+
borderRadius: 4,
|
|
87
|
+
},
|
|
88
|
+
footerStyle
|
|
89
|
+
),
|
|
39
90
|
bordered: false,
|
|
40
91
|
children: jsxs(Row, {
|
|
41
92
|
justify: "space-between",
|
|
42
|
-
children: [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
93
|
+
children: [
|
|
94
|
+
jsxs(Space, {
|
|
95
|
+
size: 20,
|
|
96
|
+
children: [
|
|
97
|
+
jsx(Button, {
|
|
98
|
+
type: "primary",
|
|
99
|
+
ghost: true,
|
|
100
|
+
disabled: showTotalNum == 0,
|
|
101
|
+
style: {
|
|
102
|
+
padding: "4px 24px",
|
|
103
|
+
borderRadius: "4px",
|
|
104
|
+
},
|
|
105
|
+
onClick: function onClick() {
|
|
106
|
+
setAllCheck(!allCheck);
|
|
107
|
+
},
|
|
108
|
+
children: !allCheck ? "选择全部" : "取消选择",
|
|
109
|
+
}),
|
|
110
|
+
jsxs(Text, {
|
|
111
|
+
type: "secondary",
|
|
112
|
+
children: ["\u5171", total, "\u6761"],
|
|
113
|
+
}),
|
|
114
|
+
jsxs(Text, {
|
|
115
|
+
type: "secondary",
|
|
116
|
+
children: [
|
|
117
|
+
"\u5DF2\u9009\u62E9",
|
|
118
|
+
jsx(Link, {
|
|
119
|
+
children: num,
|
|
120
|
+
}),
|
|
121
|
+
"\u6761",
|
|
122
|
+
],
|
|
123
|
+
}),
|
|
124
|
+
],
|
|
125
|
+
}),
|
|
126
|
+
actionRender === null || actionRender === void 0
|
|
127
|
+
? void 0
|
|
128
|
+
: actionRender(allCheck, selectedRowData, tableInstance),
|
|
129
|
+
],
|
|
130
|
+
}),
|
|
67
131
|
});
|
|
68
132
|
if (!data) {
|
|
69
133
|
return dom;
|
|
70
134
|
}
|
|
71
135
|
return jsx(Affix, {
|
|
72
136
|
offsetBottom: 10,
|
|
73
|
-
children: dom
|
|
137
|
+
children: dom,
|
|
74
138
|
});
|
|
75
|
-
}
|
|
139
|
+
};
|
|
76
140
|
|
|
77
141
|
export { Footer as default };
|
|
78
142
|
// powered by hdj
|
package/es/Header/index.d.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import type { ColProps } from "antd";
|
|
2
2
|
import type { ConfigDataModal } from "../modal";
|
|
3
|
+
import React from "react";
|
|
3
4
|
interface IHeaderProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
configData: ConfigDataModal;
|
|
6
|
+
onFinish: (value: Record<string, any>) => Promise<any>;
|
|
7
|
+
searchSpan?: ColProps;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
headerStyle?: React.CSSProperties;
|
|
8
10
|
}
|
|
9
|
-
declare const _default: ({
|
|
11
|
+
declare const _default: ({
|
|
12
|
+
configData,
|
|
13
|
+
onFinish,
|
|
14
|
+
searchSpan,
|
|
15
|
+
loading,
|
|
16
|
+
headerStyle,
|
|
17
|
+
}: IHeaderProps) => JSX.Element;
|
|
10
18
|
export default _default;
|