@hw-component/table 1.9.16 → 1.9.18
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/HTableBody/index.d.ts +1 -0
- package/es/HTableBody/index.js +5 -3
- package/es/HTableHeader/index.d.ts +2 -1
- package/es/HTableHeader/index.js +7 -4
- package/es/HTablePagination/index.d.ts +2 -1
- package/es/HTablePagination/index.js +4 -2
- package/es/TableCustomize.js +6 -2
- package/lib/HTableBody/index.d.ts +1 -0
- package/lib/HTableBody/index.js +5 -3
- package/lib/HTableHeader/index.d.ts +2 -1
- package/lib/HTableHeader/index.js +7 -4
- package/lib/HTablePagination/index.d.ts +2 -1
- package/lib/HTablePagination/index.js +4 -2
- package/lib/TableCustomize.js +6 -2
- package/package.json +1 -1
- package/src/components/HTableBody/index.tsx +5 -4
- package/src/components/HTableHeader/index.tsx +6 -3
- package/src/components/HTablePagination/index.tsx +4 -2
- package/src/components/TableCustomize.tsx +4 -0
- package/src/pages/TableCustomize/index.tsx +0 -2
package/es/HTableBody/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface HTableBodyProps extends Omit<ProTableProps<any, any>, "dataSour
|
|
|
21
21
|
paginationActionRender?: (tableInstance: HTableInstance) => React.ReactNode;
|
|
22
22
|
localSorter?: boolean;
|
|
23
23
|
options?: OptionModal | false;
|
|
24
|
+
table?: HTableInstance;
|
|
24
25
|
}
|
|
25
26
|
declare const _default: (bodyProps: HTableBodyProps) => JSX.Element;
|
|
26
27
|
export default _default;
|
package/es/HTableBody/index.js
CHANGED
|
@@ -22,7 +22,7 @@ import AlertMsg from './AlertMsg.js';
|
|
|
22
22
|
import Options from './Options/index.js';
|
|
23
23
|
import HeaderTitle from './HeaderTitle/index.js';
|
|
24
24
|
|
|
25
|
-
var _excluded = ["configData", "pagination", "onPageChange", "rowSelection", "rowKey", "emptyRender", "errorRender", "tableStyle", "paginationStyle", "headerTitle", "options", "actionRender", "affixProps", "goTop", "size", "optionsRender", "paginationActionRender", "localSorter", "columnsState", "tableExtraRender"],
|
|
25
|
+
var _excluded = ["configData", "pagination", "onPageChange", "rowSelection", "rowKey", "emptyRender", "errorRender", "tableStyle", "paginationStyle", "headerTitle", "options", "actionRender", "affixProps", "goTop", "size", "optionsRender", "paginationActionRender", "localSorter", "columnsState", "tableExtraRender", "table"],
|
|
26
26
|
_excluded2 = ["value", "onChange", "reset"];
|
|
27
27
|
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; }
|
|
28
28
|
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; }
|
|
@@ -56,12 +56,13 @@ var Body = (function (bodyProps) {
|
|
|
56
56
|
localSorter = bodyProps.localSorter,
|
|
57
57
|
columnsState = bodyProps.columnsState,
|
|
58
58
|
tableExtraRender = bodyProps.tableExtraRender,
|
|
59
|
+
table = bodyProps.table,
|
|
59
60
|
props = _objectWithoutProperties(bodyProps, _excluded);
|
|
60
61
|
var _ref = rowSelection || {},
|
|
61
62
|
selectedRowKeys = _ref.selectedRowKeys,
|
|
62
63
|
configAlwaysShowAlert = _ref.alwaysShowAlert;
|
|
63
64
|
var _useHTableContext = useHTableContext(),
|
|
64
|
-
|
|
65
|
+
contextTableInstance = _useHTableContext.tableInstance,
|
|
65
66
|
contextConfigData = _useHTableContext.configData,
|
|
66
67
|
data = _useHTableContext.data,
|
|
67
68
|
selectedRowData = _useHTableContext.selectedRowData,
|
|
@@ -81,6 +82,7 @@ var Body = (function (bodyProps) {
|
|
|
81
82
|
var bodyConfigData = configData || contextConfigData;
|
|
82
83
|
var _ref2 = data || {},
|
|
83
84
|
records = _ref2.records;
|
|
85
|
+
var tableInstance = table || contextTableInstance;
|
|
84
86
|
var _useCols = useCols({
|
|
85
87
|
configData: bodyConfigData,
|
|
86
88
|
table: tableInstance,
|
|
@@ -161,7 +163,6 @@ var Body = (function (bodyProps) {
|
|
|
161
163
|
if (localSorter || typeof colSorter === "function") {
|
|
162
164
|
return;
|
|
163
165
|
}
|
|
164
|
-
console.log(sorter);
|
|
165
166
|
var orderByField = typeof order === "undefined" ? undefined : field;
|
|
166
167
|
var asc = typeof order === "undefined" ? undefined : order === "ascend";
|
|
167
168
|
tableInstance.table.reloadWithParams({
|
|
@@ -184,6 +185,7 @@ var Body = (function (bodyProps) {
|
|
|
184
185
|
paginationStyle: paginationStyle,
|
|
185
186
|
affixProps: affixProps,
|
|
186
187
|
goTop: goTop,
|
|
188
|
+
table: tableInstance,
|
|
187
189
|
actionRender: paginationActionRender
|
|
188
190
|
}, pagination))]
|
|
189
191
|
})]
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { IHeaderProps } from "./modal";
|
|
2
|
-
declare const _default: ({ configData, onFinish, searchSpan, headerStyle, initValues, hideLabel, labelWidth, onReset, }: IHeaderProps) => JSX.Element;
|
|
3
|
+
declare const _default: ({ configData, onFinish, searchSpan, headerStyle, initValues, hideLabel, labelWidth, onReset, table, loading, }: IHeaderProps) => JSX.Element;
|
|
3
4
|
export default _default;
|
package/es/HTableHeader/index.js
CHANGED
|
@@ -24,14 +24,17 @@ var Header = (function (_ref) {
|
|
|
24
24
|
initValues = _ref.initValues,
|
|
25
25
|
hideLabel = _ref.hideLabel,
|
|
26
26
|
labelWidth = _ref.labelWidth,
|
|
27
|
-
onReset = _ref.onReset
|
|
27
|
+
onReset = _ref.onReset,
|
|
28
|
+
table = _ref.table,
|
|
29
|
+
loading = _ref.loading;
|
|
28
30
|
var _useHTableContext = useHTableContext(),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
contextTableInstance = _useHTableContext.tableInstance,
|
|
32
|
+
contextLoading = _useHTableContext.loading,
|
|
31
33
|
contextOnFinish = _useHTableContext.onFinish,
|
|
32
34
|
contextConfigData = _useHTableContext.configData,
|
|
33
35
|
contextHideLabel = _useHTableContext.hideLabel,
|
|
34
36
|
contextLabelWidth = _useHTableContext.labelWidth;
|
|
37
|
+
var tableInstance = table || contextTableInstance;
|
|
35
38
|
var headerConfigData = configData || contextConfigData;
|
|
36
39
|
var form = tableInstance.form;
|
|
37
40
|
var subOnFinish = onFinish || contextOnFinish;
|
|
@@ -61,7 +64,7 @@ var Header = (function (_ref) {
|
|
|
61
64
|
children: jsx(HForm, {
|
|
62
65
|
itemSpan: searchSpan,
|
|
63
66
|
onFinish: subOnFinish,
|
|
64
|
-
submitLoading: loading,
|
|
67
|
+
submitLoading: contextLoading || loading,
|
|
65
68
|
dismissOnPressEnter: false,
|
|
66
69
|
gutter: [20, 0],
|
|
67
70
|
initialValues: initValues,
|
|
@@ -8,6 +8,7 @@ export interface IPaginationProps extends PaginationProps {
|
|
|
8
8
|
affixProps?: AffixProps | false;
|
|
9
9
|
goTop?: boolean;
|
|
10
10
|
actionRender?: (tableInstance: HTableInstance) => React.ReactNode;
|
|
11
|
+
table?: HTableInstance;
|
|
11
12
|
}
|
|
12
|
-
declare const _default: ({ onPageChange, paginationStyle, affixProps, goTop, actionRender, ...props }: IPaginationProps) => JSX.Element;
|
|
13
|
+
declare const _default: ({ onPageChange, paginationStyle, affixProps, goTop, actionRender, table, ...props }: IPaginationProps) => JSX.Element;
|
|
13
14
|
export default _default;
|
|
@@ -20,7 +20,7 @@ import { useState } from 'react';
|
|
|
20
20
|
import GoTop from '../GoTop/index.js';
|
|
21
21
|
import { useHTableConfigContext } from '../TableConfig.js';
|
|
22
22
|
|
|
23
|
-
var _excluded = ["onPageChange", "paginationStyle", "affixProps", "goTop", "actionRender"],
|
|
23
|
+
var _excluded = ["onPageChange", "paginationStyle", "affixProps", "goTop", "actionRender", "table"],
|
|
24
24
|
_excluded2 = ["offsetBottom"];
|
|
25
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
26
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -30,15 +30,17 @@ var HTablePagination = (function (_ref) {
|
|
|
30
30
|
affixProps = _ref.affixProps,
|
|
31
31
|
goTop = _ref.goTop,
|
|
32
32
|
actionRender = _ref.actionRender,
|
|
33
|
+
table = _ref.table,
|
|
33
34
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
34
35
|
var _useHTableContext = useHTableContext(),
|
|
35
36
|
contextOnPageChange = _useHTableContext.onPageChange,
|
|
36
37
|
data = _useHTableContext.data,
|
|
37
|
-
|
|
38
|
+
contextTableInstance = _useHTableContext.tableInstance;
|
|
38
39
|
var _useHTableConfigConte = useHTableConfigContext({
|
|
39
40
|
paginationStyle: paginationStyle
|
|
40
41
|
}),
|
|
41
42
|
defaultPaginationStyle = _useHTableConfigConte.paginationStyle;
|
|
43
|
+
var tableInstance = table || contextTableInstance;
|
|
42
44
|
var tableOnPageChange = onPageChange || contextOnPageChange;
|
|
43
45
|
var _ref2 = data || {},
|
|
44
46
|
size = _ref2.size,
|
package/es/TableCustomize.js
CHANGED
|
@@ -18,7 +18,7 @@ import useReq from './hooks/useReq.js';
|
|
|
18
18
|
import useDispatch from './hooks/useDispatch.js';
|
|
19
19
|
import { useState } from 'react';
|
|
20
20
|
|
|
21
|
-
var _excluded = ["request", "configData", "table", "action", "children", "rowKey"];
|
|
21
|
+
var _excluded = ["request", "configData", "table", "action", "children", "rowKey", "hideLabel", "labelWidth"];
|
|
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
24
|
var Index = function Index(_ref) {
|
|
@@ -29,6 +29,8 @@ var Index = function Index(_ref) {
|
|
|
29
29
|
action = _ref$action === void 0 ? {} : _ref$action,
|
|
30
30
|
children = _ref.children,
|
|
31
31
|
rowKey = _ref.rowKey,
|
|
32
|
+
hideLabel = _ref.hideLabel,
|
|
33
|
+
labelWidth = _ref.labelWidth,
|
|
32
34
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
33
35
|
var _useReq = useReq(_objectSpread({
|
|
34
36
|
request: request
|
|
@@ -89,7 +91,9 @@ var Index = function Index(_ref) {
|
|
|
89
91
|
setSelectedRowData: setSelectedRowData,
|
|
90
92
|
rowKey: rowKey,
|
|
91
93
|
headerOpen: open,
|
|
92
|
-
setHeaderOpen: setOpen
|
|
94
|
+
setHeaderOpen: setOpen,
|
|
95
|
+
hideLabel: hideLabel,
|
|
96
|
+
labelWidth: labelWidth
|
|
93
97
|
},
|
|
94
98
|
children: children
|
|
95
99
|
});
|
|
@@ -21,6 +21,7 @@ export interface HTableBodyProps extends Omit<ProTableProps<any, any>, "dataSour
|
|
|
21
21
|
paginationActionRender?: (tableInstance: HTableInstance) => React.ReactNode;
|
|
22
22
|
localSorter?: boolean;
|
|
23
23
|
options?: OptionModal | false;
|
|
24
|
+
table?: HTableInstance;
|
|
24
25
|
}
|
|
25
26
|
declare const _default: (bodyProps: HTableBodyProps) => JSX.Element;
|
|
26
27
|
export default _default;
|
package/lib/HTableBody/index.js
CHANGED
|
@@ -25,7 +25,7 @@ var AlertMsg = require('./AlertMsg.js');
|
|
|
25
25
|
var index = require('./Options/index.js');
|
|
26
26
|
var index$2 = require('./HeaderTitle/index.js');
|
|
27
27
|
|
|
28
|
-
var _excluded = ["configData", "pagination", "onPageChange", "rowSelection", "rowKey", "emptyRender", "errorRender", "tableStyle", "paginationStyle", "headerTitle", "options", "actionRender", "affixProps", "goTop", "size", "optionsRender", "paginationActionRender", "localSorter", "columnsState", "tableExtraRender"],
|
|
28
|
+
var _excluded = ["configData", "pagination", "onPageChange", "rowSelection", "rowKey", "emptyRender", "errorRender", "tableStyle", "paginationStyle", "headerTitle", "options", "actionRender", "affixProps", "goTop", "size", "optionsRender", "paginationActionRender", "localSorter", "columnsState", "tableExtraRender", "table"],
|
|
29
29
|
_excluded2 = ["value", "onChange", "reset"];
|
|
30
30
|
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; }
|
|
31
31
|
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; }
|
|
@@ -59,12 +59,13 @@ var Body = (function (bodyProps) {
|
|
|
59
59
|
localSorter = bodyProps.localSorter,
|
|
60
60
|
columnsState = bodyProps.columnsState,
|
|
61
61
|
tableExtraRender = bodyProps.tableExtraRender,
|
|
62
|
+
table = bodyProps.table,
|
|
62
63
|
props = _objectWithoutProperties(bodyProps, _excluded);
|
|
63
64
|
var _ref = rowSelection || {},
|
|
64
65
|
selectedRowKeys = _ref.selectedRowKeys,
|
|
65
66
|
configAlwaysShowAlert = _ref.alwaysShowAlert;
|
|
66
67
|
var _useHTableContext = context.useHTableContext(),
|
|
67
|
-
|
|
68
|
+
contextTableInstance = _useHTableContext.tableInstance,
|
|
68
69
|
contextConfigData = _useHTableContext.configData,
|
|
69
70
|
data = _useHTableContext.data,
|
|
70
71
|
selectedRowData = _useHTableContext.selectedRowData,
|
|
@@ -84,6 +85,7 @@ var Body = (function (bodyProps) {
|
|
|
84
85
|
var bodyConfigData = configData || contextConfigData;
|
|
85
86
|
var _ref2 = data || {},
|
|
86
87
|
records = _ref2.records;
|
|
88
|
+
var tableInstance = table || contextTableInstance;
|
|
87
89
|
var _useCols = hooks.useCols({
|
|
88
90
|
configData: bodyConfigData,
|
|
89
91
|
table: tableInstance,
|
|
@@ -164,7 +166,6 @@ var Body = (function (bodyProps) {
|
|
|
164
166
|
if (localSorter || typeof colSorter === "function") {
|
|
165
167
|
return;
|
|
166
168
|
}
|
|
167
|
-
console.log(sorter);
|
|
168
169
|
var orderByField = typeof order === "undefined" ? undefined : field;
|
|
169
170
|
var asc = typeof order === "undefined" ? undefined : order === "ascend";
|
|
170
171
|
tableInstance.table.reloadWithParams({
|
|
@@ -187,6 +188,7 @@ var Body = (function (bodyProps) {
|
|
|
187
188
|
paginationStyle: paginationStyle,
|
|
188
189
|
affixProps: affixProps,
|
|
189
190
|
goTop: goTop,
|
|
191
|
+
table: tableInstance,
|
|
190
192
|
actionRender: paginationActionRender
|
|
191
193
|
}, pagination))]
|
|
192
194
|
})]
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { IHeaderProps } from "./modal";
|
|
2
|
-
declare const _default: ({ configData, onFinish, searchSpan, headerStyle, initValues, hideLabel, labelWidth, onReset, }: IHeaderProps) => JSX.Element;
|
|
3
|
+
declare const _default: ({ configData, onFinish, searchSpan, headerStyle, initValues, hideLabel, labelWidth, onReset, table, loading, }: IHeaderProps) => JSX.Element;
|
|
3
4
|
export default _default;
|
|
@@ -27,14 +27,17 @@ var Header = (function (_ref) {
|
|
|
27
27
|
initValues = _ref.initValues,
|
|
28
28
|
hideLabel = _ref.hideLabel,
|
|
29
29
|
labelWidth = _ref.labelWidth,
|
|
30
|
-
onReset = _ref.onReset
|
|
30
|
+
onReset = _ref.onReset,
|
|
31
|
+
table = _ref.table,
|
|
32
|
+
loading = _ref.loading;
|
|
31
33
|
var _useHTableContext = context.useHTableContext(),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
contextTableInstance = _useHTableContext.tableInstance,
|
|
35
|
+
contextLoading = _useHTableContext.loading,
|
|
34
36
|
contextOnFinish = _useHTableContext.onFinish,
|
|
35
37
|
contextConfigData = _useHTableContext.configData,
|
|
36
38
|
contextHideLabel = _useHTableContext.hideLabel,
|
|
37
39
|
contextLabelWidth = _useHTableContext.labelWidth;
|
|
40
|
+
var tableInstance = table || contextTableInstance;
|
|
38
41
|
var headerConfigData = configData || contextConfigData;
|
|
39
42
|
var form$1 = tableInstance.form;
|
|
40
43
|
var subOnFinish = onFinish || contextOnFinish;
|
|
@@ -64,7 +67,7 @@ var Header = (function (_ref) {
|
|
|
64
67
|
children: jsxRuntime.jsx(form.HForm, {
|
|
65
68
|
itemSpan: searchSpan,
|
|
66
69
|
onFinish: subOnFinish,
|
|
67
|
-
submitLoading: loading,
|
|
70
|
+
submitLoading: contextLoading || loading,
|
|
68
71
|
dismissOnPressEnter: false,
|
|
69
72
|
gutter: [20, 0],
|
|
70
73
|
initialValues: initValues,
|
|
@@ -8,6 +8,7 @@ export interface IPaginationProps extends PaginationProps {
|
|
|
8
8
|
affixProps?: AffixProps | false;
|
|
9
9
|
goTop?: boolean;
|
|
10
10
|
actionRender?: (tableInstance: HTableInstance) => React.ReactNode;
|
|
11
|
+
table?: HTableInstance;
|
|
11
12
|
}
|
|
12
|
-
declare const _default: ({ onPageChange, paginationStyle, affixProps, goTop, actionRender, ...props }: IPaginationProps) => JSX.Element;
|
|
13
|
+
declare const _default: ({ onPageChange, paginationStyle, affixProps, goTop, actionRender, table, ...props }: IPaginationProps) => JSX.Element;
|
|
13
14
|
export default _default;
|
|
@@ -23,7 +23,7 @@ var React = require('react');
|
|
|
23
23
|
var index$1 = require('../GoTop/index.js');
|
|
24
24
|
var TableConfig = require('../TableConfig.js');
|
|
25
25
|
|
|
26
|
-
var _excluded = ["onPageChange", "paginationStyle", "affixProps", "goTop", "actionRender"],
|
|
26
|
+
var _excluded = ["onPageChange", "paginationStyle", "affixProps", "goTop", "actionRender", "table"],
|
|
27
27
|
_excluded2 = ["offsetBottom"];
|
|
28
28
|
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; }
|
|
29
29
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -33,15 +33,17 @@ var HTablePagination = (function (_ref) {
|
|
|
33
33
|
affixProps = _ref.affixProps,
|
|
34
34
|
goTop = _ref.goTop,
|
|
35
35
|
actionRender = _ref.actionRender,
|
|
36
|
+
table = _ref.table,
|
|
36
37
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
37
38
|
var _useHTableContext = context.useHTableContext(),
|
|
38
39
|
contextOnPageChange = _useHTableContext.onPageChange,
|
|
39
40
|
data = _useHTableContext.data,
|
|
40
|
-
|
|
41
|
+
contextTableInstance = _useHTableContext.tableInstance;
|
|
41
42
|
var _useHTableConfigConte = TableConfig.useHTableConfigContext({
|
|
42
43
|
paginationStyle: paginationStyle
|
|
43
44
|
}),
|
|
44
45
|
defaultPaginationStyle = _useHTableConfigConte.paginationStyle;
|
|
46
|
+
var tableInstance = table || contextTableInstance;
|
|
45
47
|
var tableOnPageChange = onPageChange || contextOnPageChange;
|
|
46
48
|
var _ref2 = data || {},
|
|
47
49
|
size = _ref2.size,
|
package/lib/TableCustomize.js
CHANGED
|
@@ -21,7 +21,7 @@ var useReq = require('./hooks/useReq.js');
|
|
|
21
21
|
var useDispatch = require('./hooks/useDispatch.js');
|
|
22
22
|
var React = require('react');
|
|
23
23
|
|
|
24
|
-
var _excluded = ["request", "configData", "table", "action", "children", "rowKey"];
|
|
24
|
+
var _excluded = ["request", "configData", "table", "action", "children", "rowKey", "hideLabel", "labelWidth"];
|
|
25
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
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
27
|
var Index = function Index(_ref) {
|
|
@@ -32,6 +32,8 @@ var Index = function Index(_ref) {
|
|
|
32
32
|
action = _ref$action === void 0 ? {} : _ref$action,
|
|
33
33
|
children = _ref.children,
|
|
34
34
|
rowKey = _ref.rowKey,
|
|
35
|
+
hideLabel = _ref.hideLabel,
|
|
36
|
+
labelWidth = _ref.labelWidth,
|
|
35
37
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
36
38
|
var _useReq = useReq.default(_objectSpread({
|
|
37
39
|
request: request
|
|
@@ -92,7 +94,9 @@ var Index = function Index(_ref) {
|
|
|
92
94
|
setSelectedRowData: setSelectedRowData,
|
|
93
95
|
rowKey: rowKey,
|
|
94
96
|
headerOpen: open,
|
|
95
|
-
setHeaderOpen: setOpen
|
|
97
|
+
setHeaderOpen: setOpen,
|
|
98
|
+
hideLabel: hideLabel,
|
|
99
|
+
labelWidth: labelWidth
|
|
96
100
|
},
|
|
97
101
|
children: children
|
|
98
102
|
});
|
package/package.json
CHANGED
|
@@ -50,6 +50,7 @@ export interface HTableBodyProps
|
|
|
50
50
|
paginationActionRender?: (tableInstance: HTableInstance) => React.ReactNode;
|
|
51
51
|
localSorter?: boolean;
|
|
52
52
|
options?: OptionModal | false;
|
|
53
|
+
table?:HTableInstance
|
|
53
54
|
}
|
|
54
55
|
const defaultRender = () => {
|
|
55
56
|
return <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />;
|
|
@@ -76,12 +77,13 @@ export default (bodyProps: HTableBodyProps) => {
|
|
|
76
77
|
localSorter,
|
|
77
78
|
columnsState,
|
|
78
79
|
tableExtraRender,
|
|
80
|
+
table,
|
|
79
81
|
...props
|
|
80
82
|
} = bodyProps;
|
|
81
83
|
const { selectedRowKeys, alwaysShowAlert: configAlwaysShowAlert } =
|
|
82
84
|
rowSelection || {};
|
|
83
85
|
const {
|
|
84
|
-
tableInstance,
|
|
86
|
+
tableInstance:contextTableInstance,
|
|
85
87
|
configData: contextConfigData,
|
|
86
88
|
data,
|
|
87
89
|
selectedRowData,
|
|
@@ -95,7 +97,7 @@ export default (bodyProps: HTableBodyProps) => {
|
|
|
95
97
|
const { cuSize, setCuSize } = useSize(size);
|
|
96
98
|
const bodyConfigData = configData || contextConfigData;
|
|
97
99
|
const { records } = data || {};
|
|
98
|
-
|
|
100
|
+
const tableInstance=table||contextTableInstance;
|
|
99
101
|
const { cols } = useCols({
|
|
100
102
|
configData: bodyConfigData,
|
|
101
103
|
table: tableInstance,
|
|
@@ -164,8 +166,6 @@ export default (bodyProps: HTableBodyProps) => {
|
|
|
164
166
|
if (localSorter||typeof colSorter==="function") {
|
|
165
167
|
return;
|
|
166
168
|
}
|
|
167
|
-
|
|
168
|
-
console.log(sorter)
|
|
169
169
|
const orderByField =
|
|
170
170
|
typeof order === "undefined" ? undefined : field;
|
|
171
171
|
const asc =
|
|
@@ -192,6 +192,7 @@ export default (bodyProps: HTableBodyProps) => {
|
|
|
192
192
|
paginationStyle={paginationStyle}
|
|
193
193
|
affixProps={affixProps}
|
|
194
194
|
goTop={goTop}
|
|
195
|
+
table={tableInstance}
|
|
195
196
|
actionRender={paginationActionRender}
|
|
196
197
|
{...pagination}
|
|
197
198
|
/>
|
|
@@ -24,15 +24,18 @@ export default ({
|
|
|
24
24
|
hideLabel,
|
|
25
25
|
labelWidth,
|
|
26
26
|
onReset,
|
|
27
|
+
table,
|
|
28
|
+
loading,
|
|
27
29
|
}: IHeaderProps) => {
|
|
28
30
|
const {
|
|
29
|
-
tableInstance,
|
|
30
|
-
loading,
|
|
31
|
+
tableInstance:contextTableInstance,
|
|
32
|
+
loading:contextLoading,
|
|
31
33
|
onFinish: contextOnFinish,
|
|
32
34
|
configData: contextConfigData,
|
|
33
35
|
hideLabel: contextHideLabel,
|
|
34
36
|
labelWidth: contextLabelWidth,
|
|
35
37
|
} = useHTableContext();
|
|
38
|
+
const tableInstance=table||contextTableInstance;
|
|
36
39
|
const headerConfigData = configData || contextConfigData;
|
|
37
40
|
const { form } = tableInstance;
|
|
38
41
|
const subOnFinish = onFinish || contextOnFinish;
|
|
@@ -59,7 +62,7 @@ export default ({
|
|
|
59
62
|
<HForm
|
|
60
63
|
itemSpan={searchSpan}
|
|
61
64
|
onFinish={subOnFinish}
|
|
62
|
-
submitLoading={loading}
|
|
65
|
+
submitLoading={contextLoading||loading}
|
|
63
66
|
dismissOnPressEnter={false}
|
|
64
67
|
gutter={[20, 0]}
|
|
65
68
|
initialValues={initValues}
|
|
@@ -13,6 +13,7 @@ export interface IPaginationProps extends PaginationProps {
|
|
|
13
13
|
affixProps?: AffixProps | false;
|
|
14
14
|
goTop?: boolean;
|
|
15
15
|
actionRender?: (tableInstance: HTableInstance) => React.ReactNode;
|
|
16
|
+
table?:HTableInstance
|
|
16
17
|
}
|
|
17
18
|
export default ({
|
|
18
19
|
onPageChange,
|
|
@@ -20,17 +21,18 @@ export default ({
|
|
|
20
21
|
affixProps,
|
|
21
22
|
goTop,
|
|
22
23
|
actionRender,
|
|
24
|
+
table,
|
|
23
25
|
...props
|
|
24
26
|
}: IPaginationProps) => {
|
|
25
27
|
const {
|
|
26
28
|
onPageChange: contextOnPageChange,
|
|
27
29
|
data,
|
|
28
|
-
tableInstance,
|
|
30
|
+
tableInstance:contextTableInstance,
|
|
29
31
|
} = useHTableContext();
|
|
30
32
|
const { paginationStyle: defaultPaginationStyle } = useHTableConfigContext({
|
|
31
33
|
paginationStyle,
|
|
32
34
|
});
|
|
33
|
-
|
|
35
|
+
const tableInstance=table||contextTableInstance;
|
|
34
36
|
const tableOnPageChange = onPageChange || contextOnPageChange;
|
|
35
37
|
const { size, current, total } = data || {};
|
|
36
38
|
const pageCurrent = Number.parseInt(current || "1", 10);
|
|
@@ -13,6 +13,8 @@ const Index: React.FC<HTableProps> = ({
|
|
|
13
13
|
action = {},
|
|
14
14
|
children,
|
|
15
15
|
rowKey,
|
|
16
|
+
hideLabel,
|
|
17
|
+
labelWidth,
|
|
16
18
|
...props
|
|
17
19
|
}) => {
|
|
18
20
|
const { run, loading, data, error, saveParams } = useReq({
|
|
@@ -64,6 +66,8 @@ const Index: React.FC<HTableProps> = ({
|
|
|
64
66
|
rowKey,
|
|
65
67
|
headerOpen: open,
|
|
66
68
|
setHeaderOpen: setOpen,
|
|
69
|
+
hideLabel,
|
|
70
|
+
labelWidth,
|
|
67
71
|
}}
|
|
68
72
|
>
|
|
69
73
|
{children}
|