@hw-component/table 0.0.2-beta-v1 → 0.0.2-beta-v2
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 +1046 -2542
- package/es/Body/hooks.js +35 -90
- package/es/Body/index.d.ts +6 -20
- package/es/Body/index.js +62 -134
- package/es/Footer/index.d.ts +4 -12
- package/es/Footer/index.js +52 -103
- package/es/Header/index.d.ts +6 -12
- package/es/Header/index.js +32 -76
- package/es/Header/utils.d.ts +3 -5
- package/es/Header/utils.js +14 -21
- package/es/Table.d.ts +1 -16
- package/es/Table.js +53 -119
- package/es/TableConfig.d.ts +5 -10
- 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 +5 -10
- package/es/hooks/useCurrentTable.js +11 -14
- 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 +35 -54
- package/lib/Body/hooks.d.ts +1046 -2542
- package/lib/Body/hooks.js +36 -91
- package/lib/Body/index.d.ts +6 -20
- package/lib/Body/index.js +64 -136
- package/lib/Footer/index.d.ts +4 -12
- package/lib/Footer/index.js +54 -105
- package/lib/Header/index.d.ts +6 -12
- package/lib/Header/index.js +34 -78
- package/lib/Header/utils.d.ts +3 -5
- package/lib/Header/utils.js +15 -22
- package/lib/Table.d.ts +1 -16
- package/lib/Table.js +55 -121
- package/lib/TableConfig.d.ts +5 -10
- 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 +5 -10
- package/lib/hooks/useCurrentTable.js +13 -16
- 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 +6 -4
- package/lib/modal.d.ts +35 -54
- package/package.json +1 -1
- package/src/components/Body/index.tsx +4 -1
- package/src/components/Footer/index.tsx +5 -1
- package/src/components/Header/index.tsx +1 -0
package/es/Header/index.js
CHANGED
|
@@ -1,89 +1,45 @@
|
|
|
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 { jsx } from
|
|
12
|
-
import { Card } from
|
|
13
|
-
import { useHTableContext } from
|
|
14
|
-
import { HForm } from
|
|
15
|
-
import { useMemo } from
|
|
16
|
-
import { formConfigDataProvider } 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 { jsx } from 'react/jsx-runtime';
|
|
12
|
+
import { Card } from 'antd';
|
|
13
|
+
import { useHTableContext } from '../context.js';
|
|
14
|
+
import { HForm } from '@hw-component/form';
|
|
15
|
+
import { useMemo } from 'react';
|
|
16
|
+
import { formConfigDataProvider } from './utils.js';
|
|
17
17
|
|
|
18
|
-
function ownKeys(e, r) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var o = _Object$getOwnPropertySymbols(e);
|
|
22
|
-
r &&
|
|
23
|
-
(o = _filterInstanceProperty(o).call(o, function (r) {
|
|
24
|
-
return _Object$getOwnPropertyDescriptor(e, r).enumerable;
|
|
25
|
-
})),
|
|
26
|
-
t.push.apply(t, o);
|
|
27
|
-
}
|
|
28
|
-
return t;
|
|
29
|
-
}
|
|
30
|
-
function _objectSpread(e) {
|
|
31
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
32
|
-
var _context, _context2;
|
|
33
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
34
|
-
r % 2
|
|
35
|
-
? _forEachInstanceProperty((_context = ownKeys(Object(t), !0))).call(
|
|
36
|
-
_context,
|
|
37
|
-
function (r) {
|
|
38
|
-
_defineProperty(e, r, t[r]);
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
: _Object$getOwnPropertyDescriptors
|
|
42
|
-
? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t))
|
|
43
|
-
: _forEachInstanceProperty((_context2 = ownKeys(Object(t)))).call(
|
|
44
|
-
_context2,
|
|
45
|
-
function (r) {
|
|
46
|
-
_Object$defineProperty(
|
|
47
|
-
e,
|
|
48
|
-
r,
|
|
49
|
-
_Object$getOwnPropertyDescriptor(t, r)
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
return e;
|
|
55
|
-
}
|
|
56
|
-
var Header = function (_ref) {
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
var Header = (function (_ref) {
|
|
57
21
|
var configData = _ref.configData,
|
|
58
22
|
onFinish = _ref.onFinish,
|
|
59
23
|
_ref$searchSpan = _ref.searchSpan,
|
|
60
|
-
searchSpan =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
span: 6,
|
|
64
|
-
}
|
|
65
|
-
: _ref$searchSpan,
|
|
24
|
+
searchSpan = _ref$searchSpan === void 0 ? {
|
|
25
|
+
span: 6
|
|
26
|
+
} : _ref$searchSpan,
|
|
66
27
|
loading = _ref.loading,
|
|
67
28
|
headerStyle = _ref.headerStyle;
|
|
68
29
|
var _useHTableContext = useHTableContext(),
|
|
69
30
|
tableInstance = _useHTableContext.tableInstance;
|
|
70
31
|
var form = tableInstance.form;
|
|
71
|
-
var nConfigData = useMemo(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
[configData]
|
|
76
|
-
);
|
|
32
|
+
var nConfigData = useMemo(function () {
|
|
33
|
+
return formConfigDataProvider(configData);
|
|
34
|
+
}, [configData]);
|
|
77
35
|
return jsx(Card, {
|
|
78
|
-
style: _objectSpread(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
headerStyle
|
|
83
|
-
),
|
|
36
|
+
style: _objectSpread({
|
|
37
|
+
borderRadius: 4
|
|
38
|
+
}, headerStyle),
|
|
84
39
|
bordered: false,
|
|
40
|
+
className: "hw_table_header",
|
|
85
41
|
bodyStyle: {
|
|
86
|
-
paddingBottom: 0
|
|
42
|
+
paddingBottom: 0
|
|
87
43
|
},
|
|
88
44
|
children: jsx(HForm, {
|
|
89
45
|
itemSpan: searchSpan,
|
|
@@ -92,10 +48,10 @@ var Header = function (_ref) {
|
|
|
92
48
|
gutter: [20, 0],
|
|
93
49
|
hideLabel: true,
|
|
94
50
|
configData: nConfigData,
|
|
95
|
-
form: form
|
|
96
|
-
})
|
|
51
|
+
form: form
|
|
52
|
+
})
|
|
97
53
|
});
|
|
98
|
-
};
|
|
54
|
+
});
|
|
99
55
|
|
|
100
56
|
export { Header as default };
|
|
101
57
|
// powered by hdj
|
package/es/Header/utils.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { ConfigDataModal, ConfigItemModal } from "../modal";
|
|
2
2
|
import type { HItemProps } from "@hw-component/form/lib/Form/modal";
|
|
3
3
|
export declare function formConfigDataFilter(arr: ConfigDataModal): {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
realConfigData: ConfigItemModal[];
|
|
5
|
+
subConfigData: HItemProps;
|
|
6
6
|
};
|
|
7
|
-
export declare function formConfigDataProvider(
|
|
8
|
-
configData: ConfigDataModal
|
|
9
|
-
): HItemProps[];
|
|
7
|
+
export declare function formConfigDataProvider(configData: ConfigDataModal): HItemProps[];
|
package/es/Header/utils.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _toConsumableArray from
|
|
3
|
-
import
|
|
4
|
-
import _filterInstanceProperty from
|
|
5
|
-
import _mapInstanceProperty from
|
|
6
|
-
import _concatInstanceProperty from
|
|
2
|
+
import _toConsumableArray from '@babel/runtime-corejs3/helpers/toConsumableArray';
|
|
3
|
+
import 'core-js/modules/es.function.name.js';
|
|
4
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js/instance/filter';
|
|
5
|
+
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js/instance/map';
|
|
6
|
+
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js/instance/concat';
|
|
7
7
|
|
|
8
8
|
var defaultSubItem = {
|
|
9
9
|
type: "submit",
|
|
@@ -11,9 +11,9 @@ var defaultSubItem = {
|
|
|
11
11
|
extraList: ["submit", "reset"],
|
|
12
12
|
style: {
|
|
13
13
|
padding: "4px 24px",
|
|
14
|
-
borderRadius: "4px"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
14
|
+
borderRadius: "4px"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
17
|
};
|
|
18
18
|
function formConfigDataFilter(arr) {
|
|
19
19
|
var subConfigData = defaultSubItem;
|
|
@@ -31,7 +31,7 @@ function formConfigDataFilter(arr) {
|
|
|
31
31
|
});
|
|
32
32
|
return {
|
|
33
33
|
realConfigData: realConfigData,
|
|
34
|
-
subConfigData: subConfigData
|
|
34
|
+
subConfigData: subConfigData
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
function formConfigDataProvider(configData) {
|
|
@@ -39,17 +39,10 @@ function formConfigDataProvider(configData) {
|
|
|
39
39
|
var _formConfigDataFilter = formConfigDataFilter(configData),
|
|
40
40
|
realConfigData = _formConfigDataFilter.realConfigData,
|
|
41
41
|
subConfigData = _formConfigDataFilter.subConfigData;
|
|
42
|
-
var nConfigData = _mapInstanceProperty(realConfigData).call(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
return _concatInstanceProperty((_context = [])).call(
|
|
49
|
-
_context,
|
|
50
|
-
_toConsumableArray(nConfigData),
|
|
51
|
-
[subConfigData]
|
|
52
|
-
);
|
|
42
|
+
var nConfigData = _mapInstanceProperty(realConfigData).call(realConfigData, function (item) {
|
|
43
|
+
return formConfigDataItemProvider(item);
|
|
44
|
+
});
|
|
45
|
+
return _concatInstanceProperty(_context = []).call(_context, _toConsumableArray(nConfigData), [subConfigData]);
|
|
53
46
|
}
|
|
54
47
|
function formConfigDataItemProvider(_ref) {
|
|
55
48
|
var _ref$colon = _ref.colon,
|
|
@@ -66,7 +59,7 @@ function formConfigDataItemProvider(_ref) {
|
|
|
66
59
|
colon: colon,
|
|
67
60
|
type: searchType,
|
|
68
61
|
name: name || dataIndex,
|
|
69
|
-
render: searchRender
|
|
62
|
+
render: searchRender
|
|
70
63
|
};
|
|
71
64
|
}
|
|
72
65
|
|
package/es/Table.d.ts
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
1
|
import type { HTableProps } from "./modal";
|
|
2
|
-
declare const _default: ({
|
|
3
|
-
request,
|
|
4
|
-
configData,
|
|
5
|
-
searchSpan,
|
|
6
|
-
table,
|
|
7
|
-
actionRender,
|
|
8
|
-
footerRender,
|
|
9
|
-
hideHeader,
|
|
10
|
-
headerStyle,
|
|
11
|
-
footerStyle,
|
|
12
|
-
tableStyle,
|
|
13
|
-
action,
|
|
14
|
-
spaceSize,
|
|
15
|
-
className,
|
|
16
|
-
...props
|
|
17
|
-
}: HTableProps) => JSX.Element;
|
|
2
|
+
declare const _default: ({ request, configData, searchSpan, table, actionRender, footerRender, hideHeader, headerStyle, footerStyle, tableStyle, action, spaceSize, className, ...props }: HTableProps) => JSX.Element;
|
|
18
3
|
export default _default;
|
package/es/Table.js
CHANGED
|
@@ -1,80 +1,30 @@
|
|
|
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 { jsx, jsxs } from
|
|
13
|
-
import Header from
|
|
14
|
-
import Body from
|
|
15
|
-
import { useRequest } from
|
|
16
|
-
import { useMemo } from
|
|
17
|
-
import useCurrentTable from
|
|
18
|
-
import Footer from
|
|
19
|
-
import useRowObj from
|
|
20
|
-
import { HTableContext } from
|
|
21
|
-
import { Space } 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 { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
|
+
import Header from './Header/index.js';
|
|
14
|
+
import Body from './Body/index.js';
|
|
15
|
+
import { useRequest } from 'ahooks';
|
|
16
|
+
import { useMemo } from 'react';
|
|
17
|
+
import useCurrentTable from './hooks/useCurrentTable.js';
|
|
18
|
+
import Footer from './Footer/index.js';
|
|
19
|
+
import useRowObj from './hooks/useRowObj.js';
|
|
20
|
+
import { HTableContext } from './context.js';
|
|
21
|
+
import { Space } from 'antd';
|
|
22
22
|
|
|
23
|
-
var _excluded = [
|
|
24
|
-
"request",
|
|
25
|
-
"configData",
|
|
26
|
-
"searchSpan",
|
|
27
|
-
"table",
|
|
28
|
-
"actionRender",
|
|
29
|
-
"footerRender",
|
|
30
|
-
"hideHeader",
|
|
31
|
-
"headerStyle",
|
|
32
|
-
"footerStyle",
|
|
33
|
-
"tableStyle",
|
|
34
|
-
"action",
|
|
35
|
-
"spaceSize",
|
|
36
|
-
"className",
|
|
37
|
-
],
|
|
23
|
+
var _excluded = ["request", "configData", "searchSpan", "table", "actionRender", "footerRender", "hideHeader", "headerStyle", "footerStyle", "tableStyle", "action", "spaceSize", "className"],
|
|
38
24
|
_excluded2 = ["size", "current"];
|
|
39
|
-
function ownKeys(e, r) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var o = _Object$getOwnPropertySymbols(e);
|
|
43
|
-
r &&
|
|
44
|
-
(o = _filterInstanceProperty(o).call(o, function (r) {
|
|
45
|
-
return _Object$getOwnPropertyDescriptor(e, r).enumerable;
|
|
46
|
-
})),
|
|
47
|
-
t.push.apply(t, o);
|
|
48
|
-
}
|
|
49
|
-
return t;
|
|
50
|
-
}
|
|
51
|
-
function _objectSpread(e) {
|
|
52
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
53
|
-
var _context, _context2;
|
|
54
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
55
|
-
r % 2
|
|
56
|
-
? _forEachInstanceProperty((_context = ownKeys(Object(t), !0))).call(
|
|
57
|
-
_context,
|
|
58
|
-
function (r) {
|
|
59
|
-
_defineProperty(e, r, t[r]);
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
: _Object$getOwnPropertyDescriptors
|
|
63
|
-
? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t))
|
|
64
|
-
: _forEachInstanceProperty((_context2 = ownKeys(Object(t)))).call(
|
|
65
|
-
_context2,
|
|
66
|
-
function (r) {
|
|
67
|
-
_Object$defineProperty(
|
|
68
|
-
e,
|
|
69
|
-
r,
|
|
70
|
-
_Object$getOwnPropertyDescriptor(t, r)
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
return e;
|
|
76
|
-
}
|
|
77
|
-
var Table = function (_ref) {
|
|
25
|
+
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; }
|
|
26
|
+
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; }
|
|
27
|
+
var Table = (function (_ref) {
|
|
78
28
|
var request = _ref.request,
|
|
79
29
|
configData = _ref.configData,
|
|
80
30
|
searchSpan = _ref.searchSpan,
|
|
@@ -96,24 +46,20 @@ var Table = function (_ref) {
|
|
|
96
46
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
97
47
|
var saveParams = useMemo(function () {
|
|
98
48
|
return {
|
|
99
|
-
params: {}
|
|
49
|
+
params: {}
|
|
100
50
|
};
|
|
101
51
|
}, []);
|
|
102
52
|
var _useRequest = useRequest(function () {
|
|
103
|
-
var params =
|
|
104
|
-
arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
53
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
105
54
|
var _params$size = params.size,
|
|
106
55
|
size = _params$size === void 0 ? "10" : _params$size,
|
|
107
56
|
_params$current = params.current,
|
|
108
57
|
current = _params$current === void 0 ? "1" : _params$current,
|
|
109
58
|
oParams = _objectWithoutProperties(params, _excluded2);
|
|
110
|
-
var reqParams = _objectSpread(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
oParams
|
|
116
|
-
);
|
|
59
|
+
var reqParams = _objectSpread({
|
|
60
|
+
size: size,
|
|
61
|
+
current: current
|
|
62
|
+
}, oParams);
|
|
117
63
|
saveParams.params = reqParams;
|
|
118
64
|
return request(reqParams);
|
|
119
65
|
}),
|
|
@@ -135,7 +81,7 @@ var Table = function (_ref) {
|
|
|
135
81
|
run(_objectSpread({}, reqParams));
|
|
136
82
|
},
|
|
137
83
|
changeRowData: rowOnChange,
|
|
138
|
-
dispatch: dispatch
|
|
84
|
+
dispatch: dispatch
|
|
139
85
|
});
|
|
140
86
|
return jsx(HTableContext.Provider, {
|
|
141
87
|
value: {
|
|
@@ -143,48 +89,36 @@ var Table = function (_ref) {
|
|
|
143
89
|
selectedRowData: selectedRowData,
|
|
144
90
|
rowOnChange: rowOnChange,
|
|
145
91
|
data: data,
|
|
146
|
-
error: error
|
|
92
|
+
error: error
|
|
147
93
|
},
|
|
148
94
|
children: jsxs(Space, {
|
|
149
95
|
size: spaceSize,
|
|
150
96
|
direction: "vertical",
|
|
151
97
|
style: {
|
|
152
|
-
width: "100%"
|
|
98
|
+
width: "100%"
|
|
153
99
|
},
|
|
154
100
|
className: className,
|
|
155
|
-
children: [
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
_objectSpread(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
},
|
|
175
|
-
props
|
|
176
|
-
)
|
|
177
|
-
),
|
|
178
|
-
footerRender !== false &&
|
|
179
|
-
jsx(Footer, {
|
|
180
|
-
actionRender: actionRender,
|
|
181
|
-
footerRender: footerRender,
|
|
182
|
-
footerStyle: footerStyle,
|
|
183
|
-
}),
|
|
184
|
-
],
|
|
185
|
-
}),
|
|
101
|
+
children: [!hideHeader && jsx(Header, {
|
|
102
|
+
configData: configData,
|
|
103
|
+
onFinish: run,
|
|
104
|
+
loading: loading,
|
|
105
|
+
searchSpan: searchSpan,
|
|
106
|
+
headerStyle: headerStyle
|
|
107
|
+
}), jsx(Body, _objectSpread({
|
|
108
|
+
loading: loading,
|
|
109
|
+
configData: configData,
|
|
110
|
+
tableStyle: tableStyle,
|
|
111
|
+
onPageChange: function onPageChange(page) {
|
|
112
|
+
run(_objectSpread(_objectSpread({}, saveParams.params), page));
|
|
113
|
+
}
|
|
114
|
+
}, props)), footerRender !== false && jsx(Footer, {
|
|
115
|
+
actionRender: actionRender,
|
|
116
|
+
footerRender: footerRender,
|
|
117
|
+
footerStyle: footerStyle
|
|
118
|
+
})]
|
|
119
|
+
})
|
|
186
120
|
});
|
|
187
|
-
};
|
|
121
|
+
});
|
|
188
122
|
|
|
189
123
|
export { Table as default };
|
|
190
124
|
// powered by hdj
|
package/es/TableConfig.d.ts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { HTableInstance } from "./modal";
|
|
3
3
|
interface HTableConfigContextModal {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
emptyRender?: (table: HTableInstance) => React.ReactNode;
|
|
5
|
+
errorRender?: (table: HTableInstance, error: Error) => React.ReactNode;
|
|
6
6
|
}
|
|
7
7
|
export declare const HTableConfigContext: React.Context<HTableConfigContextModal | null>;
|
|
8
|
-
export declare const useHTableConfigContext: ({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}: HTableConfigContextModal) => {
|
|
12
|
-
errorRender:
|
|
13
|
-
| ((table: HTableInstance, error: Error) => React.ReactNode)
|
|
14
|
-
| undefined;
|
|
15
|
-
emptyRender: ((table: HTableInstance) => React.ReactNode) | undefined;
|
|
8
|
+
export declare const useHTableConfigContext: ({ emptyRender, errorRender, }: HTableConfigContextModal) => {
|
|
9
|
+
errorRender: ((table: HTableInstance, error: Error) => React.ReactNode) | undefined;
|
|
10
|
+
emptyRender: ((table: HTableInstance) => React.ReactNode) | undefined;
|
|
16
11
|
};
|
|
17
12
|
declare const Index: React.FC<HTableConfigContextModal>;
|
|
18
13
|
export default Index;
|
package/es/TableConfig.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _objectWithoutProperties from
|
|
3
|
-
import { jsx } from
|
|
4
|
-
import React, { useContext } from
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import React, { useContext } from 'react';
|
|
5
5
|
|
|
6
6
|
var _excluded = ["children"];
|
|
7
|
-
var HTableConfigContext = /*#__PURE__*/
|
|
7
|
+
var HTableConfigContext = /*#__PURE__*/React.createContext(null);
|
|
8
8
|
var useHTableConfigContext = function useHTableConfigContext(_ref) {
|
|
9
9
|
var emptyRender = _ref.emptyRender,
|
|
10
10
|
errorRender = _ref.errorRender;
|
|
@@ -13,7 +13,7 @@ var useHTableConfigContext = function useHTableConfigContext(_ref) {
|
|
|
13
13
|
configEmptyRender = _ref2.emptyRender;
|
|
14
14
|
return {
|
|
15
15
|
errorRender: errorRender || configErrorRender,
|
|
16
|
-
emptyRender: emptyRender || configEmptyRender
|
|
16
|
+
emptyRender: emptyRender || configEmptyRender
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
var Index = function Index(_ref3) {
|
|
@@ -21,7 +21,7 @@ var Index = function Index(_ref3) {
|
|
|
21
21
|
props = _objectWithoutProperties(_ref3, _excluded);
|
|
22
22
|
return jsx(HTableConfigContext.Provider, {
|
|
23
23
|
value: props,
|
|
24
|
-
children: children
|
|
24
|
+
children: children
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
27
|
|
package/es/context.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ResultModal, RowObj, HTableInstance } from "./modal";
|
|
3
3
|
interface HContextModal {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
tableInstance: HTableInstance;
|
|
5
|
+
data?: ResultModal;
|
|
6
|
+
selectedRowData: RowObj;
|
|
7
|
+
rowOnChange: (keys: React.Key[], rowData: any[]) => void;
|
|
8
|
+
error?: Error;
|
|
9
9
|
}
|
|
10
10
|
export declare const HTableContext: React.Context<HContextModal | null>;
|
|
11
11
|
export declare const useHTableContext: () => HContextModal;
|
package/es/context.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import React, { useContext } from
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
3
|
|
|
4
|
-
var HTableContext = /*#__PURE__*/
|
|
4
|
+
var HTableContext = /*#__PURE__*/React.createContext(null);
|
|
5
5
|
var useHTableContext = function useHTableContext() {
|
|
6
6
|
var result = useContext(HTableContext);
|
|
7
7
|
return result || {};
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import type { ParamsModal, HTableInstance } from "../modal";
|
|
3
3
|
interface currentTableParams {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
table?: HTableInstance;
|
|
5
|
+
reload: (params?: ParamsModal) => void;
|
|
6
|
+
changeRowData: (keys: React.Key[], data: any) => void;
|
|
7
|
+
dispatch: (key: string, params: any) => void;
|
|
8
8
|
}
|
|
9
|
-
declare const _default: ({
|
|
10
|
-
table,
|
|
11
|
-
reload,
|
|
12
|
-
changeRowData,
|
|
13
|
-
dispatch,
|
|
14
|
-
}: currentTableParams) => HTableInstance;
|
|
9
|
+
declare const _default: ({ table, reload, changeRowData, dispatch, }: currentTableParams) => HTableInstance;
|
|
15
10
|
export default _default;
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import { useMemo } from
|
|
3
|
-
import useHTable from
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import useHTable from './useHTable.js';
|
|
4
4
|
|
|
5
|
-
var useCurrentTable = function (_ref) {
|
|
5
|
+
var useCurrentTable = (function (_ref) {
|
|
6
6
|
var table = _ref.table,
|
|
7
7
|
reload = _ref.reload,
|
|
8
8
|
changeRowData = _ref.changeRowData,
|
|
9
9
|
dispatch = _ref.dispatch;
|
|
10
10
|
var useCurrentTable = useHTable();
|
|
11
|
-
return useMemo(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
[table]
|
|
20
|
-
);
|
|
21
|
-
};
|
|
11
|
+
return useMemo(function () {
|
|
12
|
+
var resultTable = table || useCurrentTable;
|
|
13
|
+
resultTable.table.reload = reload;
|
|
14
|
+
resultTable.table.setSelectedRowData = changeRowData;
|
|
15
|
+
resultTable.table.dispatch = dispatch;
|
|
16
|
+
return resultTable;
|
|
17
|
+
}, [table]);
|
|
18
|
+
});
|
|
22
19
|
|
|
23
20
|
export { useCurrentTable as default };
|
|
24
21
|
// powered by hdj
|
package/es/hooks/useHTable.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ParamsModal } from "../modal";
|
|
2
2
|
declare const _default: () => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
form: import("@hw-component/form/lib/Form/modal").HFormInstance;
|
|
4
|
+
table: {
|
|
5
|
+
reload: (params?: ParamsModal) => ParamsModal | undefined;
|
|
6
|
+
setSelectedRowData: () => void;
|
|
7
|
+
dispatch: () => void;
|
|
8
|
+
};
|
|
9
9
|
};
|
|
10
10
|
export default _default;
|
package/es/hooks/useHTable.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import { useMemo } from
|
|
3
|
-
import { useHForm } from
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useHForm } from '@hw-component/form';
|
|
4
4
|
|
|
5
|
-
var useHTable = function () {
|
|
5
|
+
var useHTable = (function () {
|
|
6
6
|
var form = useHForm();
|
|
7
7
|
var table = useMemo(function () {
|
|
8
8
|
return {
|
|
@@ -10,14 +10,14 @@ var useHTable = function () {
|
|
|
10
10
|
return params;
|
|
11
11
|
},
|
|
12
12
|
setSelectedRowData: function setSelectedRowData() {},
|
|
13
|
-
dispatch: function dispatch() {}
|
|
13
|
+
dispatch: function dispatch() {}
|
|
14
14
|
};
|
|
15
15
|
}, []);
|
|
16
16
|
return {
|
|
17
17
|
form: form,
|
|
18
|
-
table: table
|
|
18
|
+
table: table
|
|
19
19
|
};
|
|
20
|
-
};
|
|
20
|
+
});
|
|
21
21
|
|
|
22
22
|
export { useHTable as default };
|
|
23
23
|
// powered by hdj
|
package/es/hooks/useRowObj.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import type { RowObj } from "../modal";
|
|
3
3
|
declare const _default: () => {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
rowOnChange: (keys: React.Key[], rowData: any[]) => void;
|
|
5
|
+
selectedRowData: RowObj;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|